https://bitchin100.com/wiki/index.php?title=BASIC_Variable_Format&feed=atom&action=historyBASIC Variable Format - Revision history2024-03-29T09:34:39ZRevision history for this page on the wikiMediaWiki 1.39.3https://bitchin100.com/wiki/index.php?title=BASIC_Variable_Format&diff=2559&oldid=prevJhoger at 19:39, 23 August 20122012-08-23T19:39:44Z<p></p>
<a href="https://bitchin100.com/wiki/index.php?title=BASIC_Variable_Format&diff=2559&oldid=2558">Show changes</a>Jhogerhttps://bitchin100.com/wiki/index.php?title=BASIC_Variable_Format&diff=2558&oldid=prevJhoger: New page: Per Ron Wiesen, from a discussion on the Bitchin100 Mailing List: <pre> Variable Format - (RRW) For M100: The format of BASIC variables as they appear in the variable table is shown here...2012-08-21T17:28:06Z<p>New page: Per Ron Wiesen, from a discussion on the Bitchin100 Mailing List: <pre> Variable Format - (RRW) For M100: The format of BASIC variables as they appear in the variable table is shown here...</p>
<p><b>New page</b></p><div>Per Ron Wiesen, from a discussion on the Bitchin100 Mailing List:<br />
<br />
<pre><br />
Variable Format - (RRW)<br />
For M100:<br />
The format of BASIC variables as they appear in the variable table is<br />
shown here. Where BASIC encounters a variable name, it searches the<br />
variable table for the variable name of the appropriate variable type:<br />
numeric double-precision, numeric single-precision, numeric integer,<br />
or string. Where the name is not found, BASIC expands the table and<br />
appends the variable at the end of the variable table (i.e, defines the<br />
previously undefined variable). Where the name is found, the variable<br />
content follows in the case of numeric variable types and a descriptor<br />
of content follows in the case of the string variable type.<br />
<br />
Each varible defined within the variable table consumes a 3-byte header<br />
and from 2 to 8 more bytes depending on the variable type. The header<br />
contains a "Type" byte and a "Name" in 2-character form. The value of<br />
"Type" also serves as a skip-count (relative to first byte of content)<br />
to the next (if any) header.<br />
<br />
+-----------+----------+----------+-----------+<br />
| DP | SP | Integer | String |<br />
| Format | Format | Format | Format |<br />
---------------------+-----------+----------+----------+-----------+<br />
Byte 0 Type | 8 | 4 | 2 | 3 |<br />
Byte 1 Name, 1st character |<br />
Byte 2 Name, 2nd character - NUL for 1-character names |<br />
---------------------+-----------+----------+----------+-----------+<br />
Byte 3<-<(VARPTR) | S & E | S & E | LSB | Len |<br />
Byte 4 | BCD M | BCD M | MSB | Addr Low |<br />
Byte 5 | BCD # | BCD # | - | Addr High |<br />
Byte 6 | BCD # | BCD L | - | - |<br />
Byte 7 | BCD # | - | - | - |<br />
Byte 8 | BCD # | - | - | - |<br />
Byte 9 | BCD # | - | - | - |<br />
Byte 10 | BCD L | - | - | - |<br />
---------------------+-----------+----------+----------+-----------+<br />
<br />
LSB = Least significant byte of intger.<br />
MSB = Most significant byte of integer. Bit 7 contains the sign<br />
of the integer.<br />
BCD L = Least significant BCD byte, contains least significant pair<br />
of 4-bit BCD digits.<br />
BCD H = Most significant BCD byte, contains most significant pair of<br />
4-bit BCD digits.<br />
BCD # = Middle BCD bytes. Each digit of the number is represented<br />
by one of the 4-bit values in the two nibbles in each byte.<br />
S & E = Sign and exponent of each number. Bit 7 contains the sign<br />
of the floating point number. Bits 0-5 determine where the<br />
decimal point is to be inserted. For example, if this byte<br />
contained a 65, the sign would be positive (value 64) and the<br />
decimal point would be placed after the 1st digit (value 1),<br />
and before the second digit (#.############# in DP Format or<br />
#.##### is SP Format). The purpose of bit 6 is unknown, but<br />
it may be a marker for the "currently selected" variable.<br />
Addr = Address to string content. This can be to a string constant<br />
within a BASIC program statement (e.g., V$ = "constant") or<br />
it can be within the string area BASIC (e.g., V$ = SPACE$(2).<br />
Len = Length of string. The LEN(var$) function returns this value.<br />
<br />
</pre><br />
<br />
[[Category:Model T Developer Reference]]</div>Jhoger