
Commands - 128
SYS
System Function
SYNTAX: a = SYS(n)
PURPOSE: To access system data and addresses.
REMARK S: n is the system number.
The following is a list of system information returned using this function:
n Function
0 Program size
1 Last address of array variables
2 Bottom of stack
3 Interrupt table addr ess
4 COM 1 output spool count
5 COM 2 output spool count
6 COM1 error flag
7 COM2 error flag
8 Keypad string table address
9 COM 1 input character count
10 COM 2 input character count
11 Buffer full flag for COM1 port
12 Buffer full flag for COM2 port
13 Display row
14 Display column
15 Sparkle flag address (RPC-2350G only)
The SYS function lets you access internal variables within the operating system. In most cases, you
will not need to use this function.
If you need to find memory that is not used by CAMBASIC , you can use all the addresses from the
address returned from SYS(1) up to the address returned by SYS(2). Since the stack moves
downward, it is recommended that you stay at least 300 bytes below the address given by SYS(2).
If you execute: PRINT SYS(2)–SYS(1)
in the Immediate Mode, the result will be the amount of remaining RAM.
SYS(1) indicates the last address used by arrays. A rrays sit on top of " regular" numeric variables,
which in turn are on top of your program.
SYS(2) r eturns the bottom of the system stack, w hich is below the string stack. Be sure to exec ute
this command after using CLEAR n.
Komentáře k této Příručce