Changes

Jump to: navigation, search

Technical information about Locomotive BASIC

150 bytes added, 14:30, 16 April 2012
/* Passing parameters to a RSX (Resident System Extension) command or binary function */
Both RSX and CALL commands works (are!) similar from BASIC command line and invokes a machine code - the only difference is: with the help of a RSX command you don't need to know the exact access address. You can pass up to 32 parameters with a CALL or RSX command. Possible parameters could integer, floating points and strings. Just store the parameter into a variable:
For Passing for integer:
<pre>
CALL &4000,32,34,&5E,&x10101010
|RSX-command,32,34,&5E,&x10101010
</pre>
For Passing for floating points
<pre>
@a!=43.375
@b$="test"
CALL or |RSX-command,@a!
</pre>
 
<br> Passing a string parameter:
<br> BASIC v1.0
<pre>a$="A":|DRIVE,@a$
</pre>
BASIC v1.1:
<pre>|DRIVE,"A"
</pre>
or
<pre>
@b$="test"
CALL or |RSX-command,@b$
</pre>
 
The parameters will be stored inside the range of Stack:
<pre>
Hint: the first two bytes at the end of stack shows the internal return address from BASIC interpreter where it was executed.
  <br> Passing a string parameter:  <br> BASIC v1.0 <pre>a$=With the help of the variable container "A@":|DRIVE,@it is also possible to get a$</pre> BASIC v1result from an invoked mc-code back to basic.1: <pre>|DRIVE,"A"</pre>
== Additional keywords and variables in BASIC v1.1 ==
205
edits