SYS (BASIC)

from Wikipedia, the free encyclopedia

The BASIC command SYS is used on home computers C64 , C128 , VC20 , C16 , C116 and Plus / 4 to call machine language programs or system routines. The corresponding machine language program is executed until the RTS command (assembler command: return from subroutine) is issued there. The BASIC program is then continued.

The command can be used to jump to any memory address in the number range from 0 to 65535. However, the memory address there should contain a functional machine language program that contains the RTS command, since otherwise no sensible program execution is possible.

If the numbers are not in the ranges specified above, the BASIC error message ? ILLEGAL QUANTITY ERROR appears .

There were two approaches to transferring parameters to the machine program. Either you used the POKE command in the BASIC program to store the parameters in precisely specified memory cells, where the machine program could then read them out, or you appended the parameters (separated by commas) directly to the SYS command. For this purpose, however, the machine program had to call certain routines of the BASIC interpreter, which took over the reading of the parameters from the SYS line.