This command allows you to start the execution of a subroutine, written directly
in machine language, starting from the indicated address. It must be noted that
this jump is intended as a return: any assembly instruction that returns from
execution will continue the execution of the program from the next ugBASIC line.
Moreover, it is possible to communicate with the machine code. This is made
possible by indicating, at the same time as the call, the population of specific
input registers and the recovery of values from specific output registers.
The extended syntax allow the specification of r1
, r2
, .. as the various
processor registers, v1
, v2
, .. are the values passed in the various
registers and x1
, x2
, .. are the variables that will receive the
execution result from the various registers. Since the registers are different
from CPU to CPU, it can be useful to add the ON
target specification.
SYS address _ [ WITH REG(r1)=v1[, REG(r2)=v2 [, ... ] ] ] _ [ RETURN x1=REG(r1)[, x2=REG(r2)[, ... ] ] ] _ [ ON target1[, target2[, ... ] ] ]
Join BASIC 10Liner Contest with ugBASIC!
An interesting competition is held at the beginning of each year: the
BASIC 10Liner Contest.
It is possible to use ugBASIC to participate in the next
"BASIC10Liner" competition, in the following categories:
SYS ↔ Sy
If you have found a problem with this keyword, if you think there is a bug or, more
simply, you would like it to be improved, open an issue for this example on GitHub.
Thank you!
open an issue
BACK TO KEYWORDS