SMSQ/e Help needed
Posted: Wed Jun 19, 2013 3:18 pm
I am trying to find a suitable PEEK/PEEK_W/PEEK_L possibly from the system variables that will give me an incremental number based around the system clock.
A$=DATE$:PRINT A$(19 to 20) gives me seconds, as does PRINT DATE but I would like something with greater resolution. I.e 10ths or 100ths of a second. Is their documentation of the system variables under SMSQ/e I can refer to?
Now there is a document on Dilwyn's site called System Variables which contains the following:
System Variables List
The following are relative to MT_INF trap result: the $280xx can only be relied on for ROMs up to JS/MG. "+" numbers in braces are decimal offsets in the area. The base address of the system variables should be checked by using a call to the MT.INF trap (Trap #1 with D0 = 0), where the resultant value of A0 is the pointer to the system variables. Several extensions have been written for SuperBASIC to check this value, such as the function VER$(-2) in the Minerva ROM.
DEFine FuNction GET_SYSVARS
REMark a fairly simple system variable base address check
LET system_vars = 163840
LET v$ = VER$
IF v$ = 'JSL1' OR v$ = 'HBA' THEN LET system_vars = VER$(-2)
RETurn system_vars
END DEFine
$28000.W SV_IDENT Identification
$d2450000 QL (QDOS) system variable identifier
"S2AT" SMS Atari system variable identifier
Pointers defining QDOS memory map:
$28004.L SV_CHEAP Base of common heap area
$28008.L SV_CHPFR First free space in common heap area
$2800C.L SV_FREE Base of free area [+12 ]
$28010.L SV_BASIC Base of BASIC area [+16 ]
$28014.L SV_TRNSP Base of transient program area
$28018.L SV_TRNFR First free space in TPA
$2801C.L SV_RESPR Base of resident procedure area
$28020.L SV_RAMT Top of RAM(+1) [+32 ]
$28024.L SYS_MXFR Maximum return from free memory call (SMS only)
$28028.L SYS_RTC Real time in seconds (SMS only)
$2802C.W SYS_RTCF Real time fractional, countdown (SMS only)
These last two look promising, especially the 'Real time fractional', in order to test this I need to peek it I suppose, but I dont know how to do this correctly. Not having done a great deal of this before i am a bit lost, any ideas clever people?
A$=DATE$:PRINT A$(19 to 20) gives me seconds, as does PRINT DATE but I would like something with greater resolution. I.e 10ths or 100ths of a second. Is their documentation of the system variables under SMSQ/e I can refer to?
Now there is a document on Dilwyn's site called System Variables which contains the following:
System Variables List
The following are relative to MT_INF trap result: the $280xx can only be relied on for ROMs up to JS/MG. "+" numbers in braces are decimal offsets in the area. The base address of the system variables should be checked by using a call to the MT.INF trap (Trap #1 with D0 = 0), where the resultant value of A0 is the pointer to the system variables. Several extensions have been written for SuperBASIC to check this value, such as the function VER$(-2) in the Minerva ROM.
DEFine FuNction GET_SYSVARS
REMark a fairly simple system variable base address check
LET system_vars = 163840
LET v$ = VER$
IF v$ = 'JSL1' OR v$ = 'HBA' THEN LET system_vars = VER$(-2)
RETurn system_vars
END DEFine
$28000.W SV_IDENT Identification
$d2450000 QL (QDOS) system variable identifier
"S2AT" SMS Atari system variable identifier
Pointers defining QDOS memory map:
$28004.L SV_CHEAP Base of common heap area
$28008.L SV_CHPFR First free space in common heap area
$2800C.L SV_FREE Base of free area [+12 ]
$28010.L SV_BASIC Base of BASIC area [+16 ]
$28014.L SV_TRNSP Base of transient program area
$28018.L SV_TRNFR First free space in TPA
$2801C.L SV_RESPR Base of resident procedure area
$28020.L SV_RAMT Top of RAM(+1) [+32 ]
$28024.L SYS_MXFR Maximum return from free memory call (SMS only)
$28028.L SYS_RTC Real time in seconds (SMS only)
$2802C.W SYS_RTCF Real time fractional, countdown (SMS only)
These last two look promising, especially the 'Real time fractional', in order to test this I need to peek it I suppose, but I dont know how to do this correctly. Not having done a great deal of this before i am a bit lost, any ideas clever people?