You might be able to use Deek in AMOS to find out the kickstart version.
A quick search found this ASM code:
move.l $4.w,a6 ; get execbase
moveq #0,d1
move.w $14(a6),d1 ; KS version (1.3 = version 34)
So in AMOS you might be able to use KICKSTART=Deek($18). You'd have to know which Kickstart's the returned number/s represent to interpret them properly.
Not quite right! It's offset $14 from the
address stored in address $00000004. So:
G_KICKSTART=Deek(Leek($4)+$14))
In answer to the question: I would recommend checking for WB1.3 first. If it's WB1.3 or less, forget doing anything using the OS. If it's V2.0 or above, only then attempting to use the OS library calls.
I usually hesitate to get involved with questions like this from lack of experience and the thought that everyone else must surely know a lot more about theses things than me. However, from documenting and bug fixing in AMOS Pro, I've gleaned the following stuff. I would be very pleased if anyone else can supply more info...
AMOS already does all the checking when it starts up and loads and initialises the data areas for amiga.library - the ones pointed to by A5 whilst a program is running. So the following locations may also be of interest:
Kickstart Version NumberAssemblermove.w WB2.0(a5),<ea destination>
AMOSG_KICKSTART=Deek(Areg(5)+$414
AMOS uses this to check for WB1.3 versus WB2.0 and above. If it's zero, you're in WB1.3 land and need to be very careful what you're calling in the libraries. It appears to an Amiga OS novice like myself that WB1.3 is really only in existence for old games compatibility and should be avoided for anything "serious"
Otherwise the location contains the version number. See also the LoadView flag below.
Check for AA ChipsetAssemblerbtst #WFlag_AA,T_WFlags(a5)
AMOSG_WFLAGS=Deek(Areg(5)-23
GF_AA=Btst(0,G_WFLAGS)
Set if AMOS is running on a machine with the AA chipset. Note that the code that sets this flag is doing a
software check, not a
hardware check. So expect this flag to be cleared if running in anything under WB3.0 even if the machine has the AA chipset in hardware. In which case you couldn't do anything with the chipset unless you wrote everything yourself and completely disabled the OS. So I reckon it's a better indicator than checking the hardware (which is always a bit risky!).
Check for LoadView (WB version = 39 or above)Assemblerbtst #WFlag_LoadView,T_WFlags(a5)
AMOSG_WFLAGS=Deek(Areg(5)-23
GF_LOADVIEW=Btst(4,G_WFLAGS)
Set for a WB version of 39 or over. AMOS uses a different LoadView routine if running on the later versions.
(Note how I carefully avoided what all those version numbers actually mean as I don't know how to relate them to WB1.3, WB2.x, WB3.x, etc.
Any references above are just derived from comments in the AMOS sources. Anyone got a useful list, or knows where that may be found?)
Putting the above all together:
'=======================================
' A short demo of some of the system info
' that AMOS can supply:
'
' Kickstart Version
' AA Chipset Available? (but false if
' not running WB 3.0 or above)
' Kickstart 39 or over? (requires
' different LoadView routines)
'
' Author: bruceuncle
' Date: 05/02/2014
'
' Offsets from A5:
'
Global G_WB2_0,G_T_WFLAGS
G_WB2_0=$414
G_T_WFLAGS=-23
'
' Bit positions in G_T_WFLAGS(A5):
'
Global G_WFLAG_AA,G_WFLAG_LOADVIEW
G_WFLAG_AA=0
G_WFLAG_LOADVIEW=4
'
' Results:
'
Global G_KICKSTART,GF_AA,GF_LOADVIEW
A=Leek($4)
G_KICKSTART=Deek(Areg(5)+G_WB2_0)
GF_AA=Btst(G_WFLAG_AA,Areg(5)+G_T_WFLAGS)
GF_LOADVIEW=Btst(G_WFLAG_LOADVIEW,Areg(5)+G_T_WFLAGS)
Print " Kickstart Version: ";G_KICKSTART
Print " AA Chipset: ";
If GF_AA Then Print "True" Else Print "False"
Print "V39 or over (Loadview): ";
If GF_LOADVIEW Then Print "True" Else Print "False"