Changes

Jump to: navigation, search

Technical information about Locomotive BASIC

11 bytes removed, 11:34, 6 December 2012
/* BASIC tokens */
<br> The 16-bit byte offset is initially set to 0, but is setup when the program is RUN. The offset is stored in little-endian format, with low byte followed by high byte.
#**The token byte defines the variable type (i.e. string, floating point, integer) and the suffix ("$", none and "%"). #**The variable name is stored in the program, with bit 7 of the last character set to "1". e.g. The variable named "abc" will be encoded as 'a','b','c'+&amp;80 #*String values: #**Each string value is prefixed with &amp;22 token. #**All strings must be enclosed by double quote symbols (&amp;quot). This symbols define the start and end of the string value. #**The string value can contain any symbol except the quote ("). i.e. 0-&amp;21, and &amp;23-&amp;ff can be used.
*After running a program, Tokens of "1d" with 16-bit BASIC program line pointers are changed to token "1e" with the 16-bit memory address of the BASIC line number in memory.
<br> NOTES:
#*These codes are prefixed by &amp;FF. e.g. The keyword "ABS" is stored as the following sequence: <pre>&amp;FF,&amp;00</pre> #*Codes &amp;1e...&amp;3f inclusive are not used #*Codes &amp;4a...&amp;6f inclusive are not used #*Codes &amp;80...&amp;ff inclusive are not used
#*When a BASIC program is in memory, the BASIC ROM can replace "16-bit BASIC program line number" tokens with "16-bit BASIC program line memory address pointer".
When a program is loaded or saved, there will only be "16-bit BASIC program line number" tokens followed by a 16-bit number of the line.
2,541
edits