Remote Processing CAMBASIC User Manual

Page 161

Advertising
background image

Comm ands - 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

COM 1 error flag

7

COM 2 error flag

8

Keypad string table addr ess

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

D i sp la y co lu m n

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 use d by arra ys. A rrays sit on top of " regular" numeric va riables,
w h ic h in tu r n ar e o n t op o f y o ur p r og r a m .

SYS(2) r eturns the b ottom of the s ystem stac k, w hich is below the string stac k. Be su re to exec ute
this command after using CLE AR n.

Advertising