9. Operating System Routines
||Entry address &FFCE, vector
This is a
dummy routine provided for compatibility with BBC BASIC.
Its normal function is to open a file for reading and
writing, but since this is not required by the ATOM COS
and only one file (channel number 13) can be open at any
time, the routine will not be used by the user.
||Entry address &FFD4, vector
puts a byte in A to the tape. On entry Y contains the
channel number (13). On exit A, X and Y are preserved, N,
V and Z are undefined and D=0.
||Entry address &FFD7, vector
gets a byte from tape and returns it in A. On entry Y
contains the channel number (13).
On exit X and Y are preserved, N, V, and Z are undefined
||Entry address &FFEE, vector
writes the character in A to the screen. On exit A, X and
Y are preserved, C,N,V and Z are undefined and D=0. The
interrupt state is preserved but interrupts may be
enabled during the operation. All lower case letters are
converted to upper case. The following control codes (in
hex) are provided:
||Page mode on/off
||Select screen mode
||Entry address &FFF4, vector
multi-purpose OS routine. The call number is passed in A
and the X and Y registers are used to pass other values.
Values are returned in X and/or Y. The calls and their
functions are as follows:
||Read key within time
limit. The call waits for the specified time or
until a key is pressed.
The delay in centiseconds is passed in Y (ms
byte) and X (ls byte), maximum value &7FFF.
On exit Y contains either &1B if ESC was
pressed, &FF if time-out occurred, or 0 with
X containing the character detected. In the event
of ESC being pressed, OSBYTE &7E must be used
to acknowledge it. OSBYTE &81 with negative
values in A is not implemented.
||Read top of OS RAM
address. This call returns the address of the
first free location in memory above that required
by the operating system in Y (ms byte) and X (ls
||Read bottom of display RAM
address. This call returns the lowest memory
address used by the screen in Y (ms byte) and X
||Entry address &FFF1, vector
invokes a number of miscellaneous OS operations that
require more data or return more values than can be
handled by OSBYTE. It is entered with the call number in
A, and Y (m.s. byte) and X (l.s. byte) pointing to a
parameter block. The calls and their functions are as
||Read an input line.
On entry the parameter block should contain,
starting at byte 0, the address of the buffer for
the line (2 bytes), the maximum length of line,
the minimum acceptable ASCII code, and the
maximum acceptable ASCII code.
On exit C=1 indicates that the line was
terminated by ESC rather than CR, and Y contains
the length of the line, including the CR if C=0.
||Read 5-byte system time.
This call reads the elapsed-time clock into the
five bytes pointed to by X and Y.
The clock is incremented by one every 10 ms.
||Write 5-byte system time.
This call writes the value at the five bytes
pointed to by X and Y into the elapsed-time
||Generate a sound.
This call generates a sound defined by the four
2-byte values pointed to by X and Y.
Refer to the keyword SOUND
||Entry address &FFF7, vector
routine sends a command line to the interpreter.
On entry X (l. s. byte) and Y (m. s. byte) point to the
command line, terminated by &D. Leading spaces and
asterisks are removed.