Spare Time Gizmos
SBC6120 User's Manual
03/09/2003 1:35 PM
Page 40
6.3 G
ET
RAM D
ISK
S
IZE
PR0
function 2 will return the size of a RAM disk chip.
TAD
(<
unit
>
/ load the desired RAM disk unit, 0..3
PR0
/ call the SBC6120 ROM firmware
2
/ function code for Get RAM Disk Size
<
return with the RAM disk size in the AC
>
The desired RAM disk unit, from 0 to 3, should be passed in the AC, and the usable size of the
corresponding SRAM chip, in 128 word pages, is returned in the AC. A 512K SRAM would, for
example, return 2688
10
in the AC. If there is no SRAM chip installed for the selected unit then
zero will be returned in the AC - this is not considered an error condition and the LINK will not be
set in this instance.
If the unit number passed in the AC is greater than three, then the LINK will be set to indicate an
error and the AC cleared on return.
6.4 G
ET
RAM D
ISK
B
ATTERY
S
TATUS
PR0
function 3 will return the status of the RAM disk Lithium backup battery.
PR0
/ call the SBC6120 ROM firmware
3
/ function code for Get RAM disk battery status
<
return with AC == -1 if batteries are OK
>
As long as either battery has sufficient voltage, -1 will be return in the AC. If both batteries have
failed, then zero is returned. This call has no error return.
The backup battery status is tested by BTS6120 once, immediately after power up, and the result
stored in a word of panel memory. This call simply returns the value of that stored flag and does
not cause the batteries to be tested again
. It isn't possible to monitor the battery status in real
time!
6.5 R
EAD
/W
RITE
IDE
DISK
PR0
function 4 is used to read or write the SBC6120 IDE disk.
PR0
/ call the SBC6120 ROM firmware
4
/ function code for IDE disk I/O
<
arg1
>
/ R/W bit, page count, buffer field and unit
<
arg2
>
/ buffer address
<
arg3
>
/ starting block number
<
return with the LINK set if an error occurs
>
The argument list for this function, including the definition of
arg1
, is identical to a standard OS/8
device handler call. Except for
arg3
, which specifies the disk address in blocks rather than
pages, the argument list for this function is also identical to
PR0
function 1, Read/Write RAM Disk.
If this function fails, then on return the LINK will be set and the contents of the drive’s error
register are in the AC. If no IDE drive is attached to the SBC6120, then this call will always give
the error return with the LINK set and 0377
8
in the AC. A program can also test to see if an IDE
drive is attached using the next function, Get IDE Disk Size.
6.6 G
ET
IDE D
ISK
S
IZE
PR0
function 5 will return the size of the IDE disk.