|
| | | | 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
| |
| | | | |
|