Changes

Jump to: navigation, search

Technical information about Locomotive BASIC

516 bytes added, 14:17, 26 August 2012
/* Passing parameters to a RSX (Resident System Extension) command or binary function */
or
<pre>
@b$="test"
CALL or |RSX-command,@b$
</pre>
...
</pre>
A register holds the number of parameters. IX points to each parameter. IX+0/IX+1 is the last parameter. Each parameter is a 16-bit value.
If you hand-over a parameter is a string than , the 16-bit value is an address of a "string descriptor block". The first two bytes holds byte of the string description or is the length of . The next 2 bytes are an address that point to the stringin memory.
Hint: the first two bytes at the end of stack shows the internal return address from BASIC interpreter where it was executed.
With the help of the variable container "@" it is also possible to get a result from an invoked mc-code back to basic.
In this case the param contains the address of the integer, floating point or string. You can modify these to give the result.
BASIC allocates the strings, so when you modify a string, do not write more characters than the original string.
 
Hint: the first two bytes at the end of stack shows the internal return address from BASIC interpreter where it was executed.
== Additional keywords and variables in BASIC v1.1 ==
2,541
edits