Remote Processing CAMBASIC User Manual

Page 162

Advertising
background image

Comm ands - 129

SYS(3) is used by assembly language programm ers to determine jump vector location.

SYS(4) and SYS (5) return the status of the console output buffer and primary output buffer
respectively. When zero is returned, the buffer is empty. A nonzero value means the buffer has
some ch aracter s to send. A nonzer o value is not the nu mber of chara cters left.

SYS(6) and SYS(7) provide an important data security function when executing the ON COM$
statement. When a par ity, overrun, or framing er ror occurs on the serial port, CAM BASIC
branches to your ON COM $ interrupt service routine. By testing SYS(6) for the COM 1 Port or
SYS(7) for the COM2 Port, you can determine if the serial data was truncated at the error.

The SYS(6) and SYS(7) will return 0 if no err or has occurred. Any nonzero value means an er ror
has occurred and you can request the host to retransmit the data.

The adv anced user may w ant to know which of the three er rors has occur red. The SY S function w ill
return 64 for an overrun error, 32 for a parity error, and 16 for a framing error. Keep in mind that
an incorrect baud rate could cause any one of these errors, since the incoming bits would be out of
time synchronization with the UART clock.

Err ors are m ost likely to occur from noise when using m odems or radio links.

SYS(8) returns the start of the keypad string table. Keys may be redefined by PO KEing into the
address corresponding to the key' s new value. T he following routine prints the address of the
keypad string and the “ key” values.

10 FOR N = SYS(8) TO SYS(8)+15
20 A = PEEK(N)
30 PRINT N,A,CHR$(A)
40 NEXT

SYS(9) and SYS(10) return the number of characters in the COM1 port input buffer and the COM2
port input buffer.

SYS(11) and SYS(12) return the CO M1 port buffer full flag and the COM 2 port buffer full flag.
“0” means the buffer is no t full; “ 1” m eans the buffe r is full.

SYS(13) and SYS(14) display the cursor position of the VF display.

ERROR:

< Data negative> – for n
< Illegal argument> – if n > number of functions

Advertising