About
Docs
Files
Support
Index

Essentials
AutoDocs
Library functions
Cooperate
Process mastering
Debug
Own debugging kit
FGE
Smart modeid pick
Loader
Shared lib. loader
Macros
Helper macros
Structs
All the structures
Logs
Library changelogs
Tools
Progs baked inside

Tools
amiscreen0.3
ansifilter0.1
auto2guide0.1
ccfilter0.1
chipset0.1
cputype0.1
device640.1
dupfilter0.1
expandlogs0.1
findsm0.2
fmpp0.1
fsmount0.1
genanim0.3
gensymtab0.1
hashlab0.4
ktm0.6
linkpoint0.1
logo2ilbm0.1
lpradio0.1
lzwpack0.1
minism0.2
mkheader0.1
modeidctrl0.1
mss0.6
multisum0.3
newterm0.2
numconv0.1
palhack1.1
patmat0.1
pfr0.2
playamitape0.1
qdbflags0.1
qfill0.1
resmodinit0.2
sadctrl0.2
saveassign0.1
setanim0.2
systime0.1
tokendump0.1
uassign0.1
viewlogo0.1
waitback0.4
wrapmount0.1



C
P
U
T
Y
P
E

cputype-0.1
------------

---

Sometimes  there is a need to  detect the  CPU  in order to pick  the right
script flow. Of course there is  'CPU'  command that comes with the OS, but
it  lacks  68060  support  and  is  somewhat pain  to use when  it comes to
conditionals in the way that it must be called whenever you require to take
some action. My command  on the other hand  must only be  executed once per
script, or once per shell or even once per session.

---

NOTES:

[*]
Requires  68020(no FPU)+,  OS2.04(theoretically)+, 2+ kilos of free memory.

[*]
Output is  literal/numeral CPU representation such as: 68000, 68010, 68020,
68030, 68040, 68060. This way AmigaDOS 'if-else-endif' comes in handy.

---

HELP:

   > cputype ?

     ENVVARNAME



   ENVVARNAME  -  When passed then that name will be used as an environment
                  variable which will hold the CPU type. If not passed then
                  CPU type will be printed to the shell.

---

USAGE:

   ; Informational output, the value will be printed
   cputype

   ; Practical usage, the '$CPU' will hold the value 
   cputype CPU
   echo "$CPU"


   ; Example script, we set the dummy  CPU  in order
   ; to protect from lack of 'cputype'
   failat 21
   set CPU 68020
   cputype CPU
   if $CPU ge 68040 val
     echo "Woohoo! Lots of MIPS for me 8-)!"
   else
     if $CPU ge 68030 val
       echo "Yow! I can still feel the MIPS!"
     else
       echo "Well..., uh..., hmmm..., OK..."
     endif
   endif

---
megacz
    



































No more fear cus pure HTML is here!
Copyright (C) 2013-2014 by Burnt Chip Dominators