SpartaDOS X Reference Manual

Programming with SpartaDOS X




Page Seven "Kernel" Values

Index


Several page seven locations allow "kernel" operation to be accessed. While it is beyond the scope of this manual to document all of these locations, a few may prove to be of interest.

Name Address Function
sparta_flag $700 'S' if SpartaDOS
sparta_version $701 version in hex; $32 = 3.2, $40 4.0, etc.
kernel $703 jump (JMP) to "kernel" entry
misc $709 jump (JMP) to "misc" entry
sio_index $70F "swap" table (9 bytes)
device $761 "kernel" device number
name $762 filename and ext (11 bytes)
date $77B see below (3 bytes)
time $77E see below (3 bytes)
dateset $781 see below
path $7A0 path only string (64 bytes)

The "kernel" routine is called by doing a subroutine jump (JSR) to address $703 with the desired command in the 6502 Y register and the desired device number in device. For example, with a $10 in device, a value of 100 in Y will cause the current time and date to be placed in the variables time and date. A 101 will cause the current time to be set to the values contained in the variables time and date.

kd_gettd 100 get current time and date
kd_settd 101 set time and date

The following is a list of valid "misc" vector commands. These should be loaded into the A register before executing a JSR $709. The Y register is used as an index into COPYBUF for those operations using COPYBUF.

misc_initz 0 initialize misc driver
misc_getfina 1 convert path at COPYBUF to device, path, and name
misc_getpath 2 convert path at COPYBUF to device and path
misc_convdc 4 convert three byte number at DIVEND to a text string
at DECOUT

The low nibble of the device number is the unit number of the device, such as 2 for D2:. The high nibble is one of the following:

0 SIO block device (SPARTA.SYS, ATARIDOS.SYS, etc.)
1 Clock driver (CLOCK.SYS, JIFFY.SYS)
2 ROM cartridge driver
3 Console driver
4 Printer driver
5 RS232 driver (COM.SYS)
6 reserved
7 reserved

Whenever a file is opened the time and date for that file will be placed in time and date. When a file is opened for write only and dateset equals 0, the current time and date will be read into time and date and assigned to the file. If dateset is -1 ($FF), the file will get the time and date that are in the variables when the open is executed. Dateset, unlike the old COMTAB location TDOVER from previous versions of SpartaDOS, will automatically clear after use. This is how a copy of a file can retain the time and date of the original. This is also how a program like ARC assigns stored time/date information to a new file.


Previous page

Next page