<?xml version="1.0"?>
<?xml-stylesheet type="text/css" href="http://fileformats.archiveteam.org/skins/common/feed.css?303"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
		<id>http://fileformats.archiveteam.org/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Hackerb9</id>
		<title>Just Solve the File Format Problem - User contributions [en]</title>
		<link rel="self" type="application/atom+xml" href="http://fileformats.archiveteam.org/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Hackerb9"/>
		<link rel="alternate" type="text/html" href="http://fileformats.archiveteam.org/wiki/Special:Contributions/Hackerb9"/>
		<updated>2026-04-28T03:02:51Z</updated>
		<subtitle>User contributions</subtitle>
		<generator>MediaWiki 1.19.2</generator>

	<entry>
		<id>http://fileformats.archiveteam.org/wiki/Tandy_200_BASIC_tokenized_file</id>
		<title>Tandy 200 BASIC tokenized file</title>
		<link rel="alternate" type="text/html" href="http://fileformats.archiveteam.org/wiki/Tandy_200_BASIC_tokenized_file"/>
				<updated>2024-07-18T04:19:57Z</updated>
		
		<summary type="html">&lt;p&gt;Hackerb9: /* Calculating PL PH */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{FormatInfo&lt;br /&gt;
|subcat=Source code&lt;br /&gt;
|subcat2=Tokenized BASIC&lt;br /&gt;
|released=1983&lt;br /&gt;
|extensions={{ext|ba}}&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
'''Tandy 200 BASIC''' was a version of Microsoft BASIC for the Radio Shack Tandy 200 computer. The tokenizations for the TRS-80 Model 100 and Tandy 102 appear to be identical. In fact, while the research that created this page was done on a Tandy 200, experiments using [https://sourceforge.net/projects/virtualt/ emulated systems] indicate that the tokenized BASIC file format is the same across most of the computers related to the Kyocera Kyotronic-85, with the exception being the models made by NEC.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;margin-left: auto; margin-right: auto; border: none;&amp;quot;&lt;br /&gt;
|+ Which of the Kyotronic-85 Sisters use this format&lt;br /&gt;
! title=&amp;quot;Name of the manufacturer and computer model&amp;quot; | Computer Model&lt;br /&gt;
! title=&amp;quot;Whether the tokenization is the same as for the Tandy 200&amp;quot; | Uses Tandy 200 Tokenization?&lt;br /&gt;
|- style=text-align:center&lt;br /&gt;
|Kyocera Kyotronic-85&amp;lt;br/&amp;gt;Olivetti M10&amp;lt;br/&amp;gt;TRS-80 Model 100&amp;lt;br/&amp;gt;Tandy 200&amp;lt;br/&amp;gt;Tandy 102||Yes&lt;br /&gt;
|- style=text-align:center&lt;br /&gt;
| NEC PC-8201 &amp;lt;br/&amp;gt; NEC PC-8201A &amp;lt;br/&amp;gt; NEC PC-8300 || No&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
While the NEC PC-8201/8300 format is not the same, the BASIC it runs (N82 BASIC) is very close and it is expected the tokenization will be similar.&lt;br /&gt;
&lt;br /&gt;
== Tokens ==&lt;br /&gt;
All BASIC tokens on the Tandy 200 are a single byte with a value from 128 to 255. &lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+ Table mapping token values to BASIC keywords&lt;br /&gt;
! title=&amp;quot;The value of the token in hexadecimal&amp;quot; | Hex&lt;br /&gt;
! title=&amp;quot;The value of the token in decimal&amp;quot; | Dec&lt;br /&gt;
! title=&amp;quot;The BASIC keyword the token stands for&amp;quot; | Keyword &lt;br /&gt;
! title=&amp;quot;Miscellany&amp;quot; | Notes&lt;br /&gt;
|-&lt;br /&gt;
|-&lt;br /&gt;
|80||128||END&lt;br /&gt;
|-&lt;br /&gt;
|81||129||FOR&lt;br /&gt;
|-&lt;br /&gt;
|82||130||NEXT&lt;br /&gt;
|-&lt;br /&gt;
|83||131||DATA&lt;br /&gt;
|-&lt;br /&gt;
|84||132||INPUT&lt;br /&gt;
|-&lt;br /&gt;
|85||133||DIM&lt;br /&gt;
|-&lt;br /&gt;
|86||134||READ&lt;br /&gt;
|-&lt;br /&gt;
|87||135||LET&lt;br /&gt;
|-&lt;br /&gt;
|88||136||GOTO&lt;br /&gt;
|-&lt;br /&gt;
|89||137||RUN&lt;br /&gt;
|-&lt;br /&gt;
|8A||138||IF&lt;br /&gt;
|-&lt;br /&gt;
|8B||139||RESTORE&lt;br /&gt;
|-&lt;br /&gt;
|8C||140||GOSUB&lt;br /&gt;
|-&lt;br /&gt;
|8D||141||RETURN&lt;br /&gt;
|-&lt;br /&gt;
|8E||142||REM&lt;br /&gt;
|-&lt;br /&gt;
|8F||143||STOP&lt;br /&gt;
|-&lt;br /&gt;
|90||144||WIDTH&lt;br /&gt;
|-&lt;br /&gt;
|91||145||ELSE||When tokenizing, the Tandy 200 always adds a colon (':') before the ELSE token (3A 91). If the user actually writes :ELSE it is tokenized as 3A 3A 91.&lt;br /&gt;
|-&lt;br /&gt;
|92||146||LINE&lt;br /&gt;
|-&lt;br /&gt;
|93||147||EDIT&lt;br /&gt;
|-&lt;br /&gt;
|94||148||ERROR&lt;br /&gt;
|-&lt;br /&gt;
|95||149||RESUME&lt;br /&gt;
|-&lt;br /&gt;
|96||150||OUT&lt;br /&gt;
|-&lt;br /&gt;
|97||151||ON&lt;br /&gt;
|-&lt;br /&gt;
|98||152||DSKO$&lt;br /&gt;
|-&lt;br /&gt;
|99||153||OPEN&lt;br /&gt;
|-&lt;br /&gt;
|9A||154||CLOSE&lt;br /&gt;
|-&lt;br /&gt;
|9B||155||LOAD||Note that LOADM is simply the token for LOAD followed by an ASCII 'M'. &lt;br /&gt;
|-&lt;br /&gt;
|9C||156||MERGE&lt;br /&gt;
|-QUOTE&lt;br /&gt;
|9D||157||FILES&lt;br /&gt;
|-&lt;br /&gt;
|9E||158||SAVE&lt;br /&gt;
|-&lt;br /&gt;
|9F||159||LFILES&lt;br /&gt;
|-&lt;br /&gt;
|A0||160||LPRINT&lt;br /&gt;
|-&lt;br /&gt;
|A1||161||DEF&lt;br /&gt;
|-&lt;br /&gt;
|A2||162||POKE&lt;br /&gt;
|-&lt;br /&gt;
|A3||163||PRINT&lt;br /&gt;
|-&lt;br /&gt;
|A4||164||CONT&lt;br /&gt;
|-&lt;br /&gt;
|A5||165||LIST&lt;br /&gt;
|-&lt;br /&gt;
|A6||166||LLIST&lt;br /&gt;
|-&lt;br /&gt;
|A7||167||CLEAR&lt;br /&gt;
|-&lt;br /&gt;
|A8||168||CLOAD&lt;br /&gt;
|-&lt;br /&gt;
|A9||169||CSAVE&lt;br /&gt;
|-&lt;br /&gt;
|AA||170||TIME$&lt;br /&gt;
|-&lt;br /&gt;
|AB||171||DATE$&lt;br /&gt;
|-&lt;br /&gt;
|AC||172||DAY$&lt;br /&gt;
|-&lt;br /&gt;
|AD||173||COM&lt;br /&gt;
|-&lt;br /&gt;
|AE||174||MDM&lt;br /&gt;
|-&lt;br /&gt;
|AF||175||KEY&lt;br /&gt;
|-&lt;br /&gt;
|B0||176||CLS&lt;br /&gt;
|-&lt;br /&gt;
|B1||177||BEEP&lt;br /&gt;
|-&lt;br /&gt;
|B2||178||SOUND&lt;br /&gt;
|-&lt;br /&gt;
|B3||179||LCOPY&lt;br /&gt;
|-&lt;br /&gt;
|B4||180||PSET&lt;br /&gt;
|-&lt;br /&gt;
|B5||181||PRESET&lt;br /&gt;
|-&lt;br /&gt;
|B6||182||MOTOR&lt;br /&gt;
|-&lt;br /&gt;
|B7||183||MAX&lt;br /&gt;
|-&lt;br /&gt;
|B8||184||POWER&lt;br /&gt;
|-&lt;br /&gt;
|B9||185||CALL&lt;br /&gt;
|-&lt;br /&gt;
|BA||186||MENU&lt;br /&gt;
|-&lt;br /&gt;
|BB||187||IPL&lt;br /&gt;
|-&lt;br /&gt;
|BC||188||NAME&lt;br /&gt;
|-&lt;br /&gt;
|BD||189||KILL&lt;br /&gt;
|-&lt;br /&gt;
|BE||190||SCREEN&lt;br /&gt;
|-&lt;br /&gt;
|BF||191||NEW&lt;br /&gt;
|-&lt;br /&gt;
|C0||192||TAB(&lt;br /&gt;
|-&lt;br /&gt;
|C1||193||TO&lt;br /&gt;
|-&lt;br /&gt;
|C2||194||USING&lt;br /&gt;
|-&lt;br /&gt;
|C3||195||VARPTR&lt;br /&gt;
|-&lt;br /&gt;
|C4||196||ERL&lt;br /&gt;
|-&lt;br /&gt;
|C5||197||ERR&lt;br /&gt;
|-&lt;br /&gt;
|C6||198||STRING$&lt;br /&gt;
|-&lt;br /&gt;
|C7||199||INSTR&lt;br /&gt;
|-&lt;br /&gt;
|C8||200||DSKI$&lt;br /&gt;
|-&lt;br /&gt;
|C9||201||INKEY$&lt;br /&gt;
|-&lt;br /&gt;
|CA||202||CSRLIN&lt;br /&gt;
|-&lt;br /&gt;
|CB||203||OFF&lt;br /&gt;
|-&lt;br /&gt;
|CC||204||HIMEM&lt;br /&gt;
|-&lt;br /&gt;
|CD||205||THEN&lt;br /&gt;
|-&lt;br /&gt;
|CE||206||NOT&lt;br /&gt;
|-&lt;br /&gt;
|CF||207||STEP&lt;br /&gt;
|-&lt;br /&gt;
|D0||208||+&lt;br /&gt;
|-&lt;br /&gt;
|D1||209||-&lt;br /&gt;
|-&lt;br /&gt;
|D2||210||*&lt;br /&gt;
|-&lt;br /&gt;
|D3||211||/&lt;br /&gt;
|-&lt;br /&gt;
|D4||212||^&lt;br /&gt;
|-&lt;br /&gt;
|D5||213||AND&lt;br /&gt;
|-&lt;br /&gt;
|D6||214||OR&lt;br /&gt;
|-&lt;br /&gt;
|D7||215||XOR&lt;br /&gt;
|-&lt;br /&gt;
|D8||216||EQV&lt;br /&gt;
|-&lt;br /&gt;
|D9||217||IMP&lt;br /&gt;
|-&lt;br /&gt;
|DA||218||MOD&lt;br /&gt;
|-&lt;br /&gt;
|DB||219||\&lt;br /&gt;
|-&lt;br /&gt;
|DC||220||&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|DD||221||=&lt;br /&gt;
|-&lt;br /&gt;
|DE||222||&amp;lt;&lt;br /&gt;
|-&lt;br /&gt;
|DF||223||SGN&lt;br /&gt;
|-&lt;br /&gt;
|E0||224||INT&lt;br /&gt;
|-&lt;br /&gt;
|E1||225||ABS&lt;br /&gt;
|-&lt;br /&gt;
|E2||226||FRE&lt;br /&gt;
|-&lt;br /&gt;
|E3||227||INP&lt;br /&gt;
|-&lt;br /&gt;
|E4||228||LPOS&lt;br /&gt;
|-&lt;br /&gt;
|E5||229||POS&lt;br /&gt;
|-&lt;br /&gt;
|E6||230||SQR&lt;br /&gt;
|-&lt;br /&gt;
|E7||231||RND&lt;br /&gt;
|-&lt;br /&gt;
|E8||232||LOG&lt;br /&gt;
|-&lt;br /&gt;
|E9||233||EXP&lt;br /&gt;
|-&lt;br /&gt;
|EA||234||COS&lt;br /&gt;
|-&lt;br /&gt;
|EB||235||SIN&lt;br /&gt;
|-&lt;br /&gt;
|EC||236||TAN&lt;br /&gt;
|-&lt;br /&gt;
|ED||237||ATN&lt;br /&gt;
|-&lt;br /&gt;
|EE||238||PEEK&lt;br /&gt;
|-&lt;br /&gt;
|EF||239||EOF&lt;br /&gt;
|-&lt;br /&gt;
|F0||240||LOC&lt;br /&gt;
|-&lt;br /&gt;
|F1||241||LOF&lt;br /&gt;
|-&lt;br /&gt;
|F2||242||CINT&lt;br /&gt;
|-&lt;br /&gt;
|F3||243||CSNG&lt;br /&gt;
|-&lt;br /&gt;
|F4||244||CDBL&lt;br /&gt;
|-&lt;br /&gt;
|F5||245||FIX&lt;br /&gt;
|-&lt;br /&gt;
|F6||246||LEN&lt;br /&gt;
|-&lt;br /&gt;
|F7||247||STR$&lt;br /&gt;
|-&lt;br /&gt;
|F8||248||VAL&lt;br /&gt;
|-&lt;br /&gt;
|F9||249||ASC&lt;br /&gt;
|-&lt;br /&gt;
|FA||250||CHR$&lt;br /&gt;
|-&lt;br /&gt;
|FB||251||SPACE$&lt;br /&gt;
|-&lt;br /&gt;
|FC||252||LEFT$&lt;br /&gt;
|-&lt;br /&gt;
|FD||253||RIGHT$&lt;br /&gt;
|-&lt;br /&gt;
|FE||254||MID$&lt;br /&gt;
|-&lt;br /&gt;
|FF||255||' (QUOTE) || When tokenizing, the single quote character expands to three characters: a colon (3A), the byte for REM (8E), and then FF.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== File Format ==&lt;br /&gt;
&lt;br /&gt;
Tokenised BASIC code is a sequence of tokenized lines. Each tokenized line has the following format:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+ Format of a single tokenized line&lt;br /&gt;
!Name!!Length!!Description&lt;br /&gt;
|-&lt;br /&gt;
|PL PH&lt;br /&gt;
|2 bytes&lt;br /&gt;
|Address in RAM of the next line of BASIC; unsigned 16-bit integer, little-endian. In a file, PL PH is merely a placeholder and the value is never used. In RAM, PL PH == 0 marks the end of the tokenized BASIC listing. (See [[#Details for PL PH]].)&lt;br /&gt;
|-&lt;br /&gt;
|LL LH&lt;br /&gt;
|2 bytes&lt;br /&gt;
|Line number; unsigned 16-bit integer, little-endian.&lt;br /&gt;
|-&lt;br /&gt;
|B&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt; … B&amp;lt;sub&amp;gt;n&amp;lt;/sub&amp;gt;&lt;br /&gt;
|Any number of bytes&lt;br /&gt;
|Depending on the high bit, each byte is either a token or an ASCII character. &lt;br /&gt;
|-&lt;br /&gt;
|NULL&lt;br /&gt;
|1 byte&lt;br /&gt;
|NULL byte (&amp;lt;code&amp;gt;0x00&amp;lt;/code&amp;gt;) to signal end of line. &lt;br /&gt;
|}&lt;br /&gt;
              &lt;br /&gt;
Typically, the list of tokenized lines continues until the end of the file. Once a program is loaded into RAM, the end is signaled by two consecutive NULLs in the location where PL PH would normally start the next line.&lt;br /&gt;
&lt;br /&gt;
=== Limits ===&lt;br /&gt;
&lt;br /&gt;
* Line numbers can range from 0 to 65529 (but see variances below).&lt;br /&gt;
* Tokenized line length is limited to 256 characters, including the trailing NULL byte. (To do: double check this.)&lt;br /&gt;
&lt;br /&gt;
=== Acceptable variances ===&lt;br /&gt;
&lt;br /&gt;
While Tandy BASIC will never generate such files, it has no problem loading a tokenized program that:&lt;br /&gt;
&lt;br /&gt;
* Has line numbers out of order; the numerical value of a line number is ignored. Program lines are always LISTed and RUN in the order they appear in the tokenized file.&lt;br /&gt;
* Contains duplicate line numbers; all lines are kept and run in the order found in the file. (GOTO is complicated as search starts at the next line, not the beginning of the program.)&lt;br /&gt;
* Contains a line with zero bytes of data; LIST will show the line number with no text afterward. Does not replace or delete a preexisting line with that number.&lt;br /&gt;
* Contains arbitrary bytes for PL PH; the value of PL PH is always recalculated at LOAD time.&lt;br /&gt;
* Contains line numbers greater than the nominal maximum of 65529; this can be used to store hidden binary data [https://www.mail-archive.com/m100@lists.bitchin100.com/msg16195.html according to John R. Hogerhuis].&lt;br /&gt;
&lt;br /&gt;
''Sidenote'': while these variances are accepted by actual hardware, emulators may not be able to handle such files. For example, [https://sourceforge.net/projects/virtualt/ Virtual T] (as of version 1.7 in 2022) refuses to load tokenized BASIC programs that have lines out of order, duplicate lines, or bogus values for PL PH.&lt;br /&gt;
&lt;br /&gt;
=== Details for PL PH ===&lt;br /&gt;
In a file, the specific values of the 16-bit integer PL PH addresses are artifacts of where the file happened to be in memory before saving. The file's values are ''never'' used as Tandy BASIC always recalculates PL PH upon loading a program into RAM. &lt;br /&gt;
&lt;br /&gt;
Although not technically part of the file format, one may want to calculate PL PH for compatibility with broken or persnickety emulators. Expand the section below to see details.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible mw-collapsed&amp;quot;&amp;gt;&lt;br /&gt;
==== Calculating PL PH ====&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Once in RAM, PL PH represents the absolute memory address of the next line. According to John Hogerhuis, PL PH is positioned before the line's data so the BASIC interpreter can quickly skip ahead to reach the target line of GOTO, GOSUB, THEN, ELSE, RESTORE, RESUME, RUN, LIST, LLIST, or EDIT.&amp;lt;ref group=&amp;quot;note&amp;quot;&amp;gt;Searching begins at the ''next'' line in the program. The claim that one can speed up commonly used subroutines by putting them at low numbered lines is plausible as the search would detect immediately that the next line's number was too high and restart the search from the beginning.&amp;lt;/ref&amp;gt;)&lt;br /&gt;
Additionally, the end of a tokenized BASIC listing is marked by the final line's PL PH equal to zero (two NULL bytes). &lt;br /&gt;
&lt;br /&gt;
Note that because the addresses are absolute, not relative, their values depend not only on the program code but on an initial offset. That offset is why identical programs may not have identical checksums (but see the bacmp program). &lt;br /&gt;
&lt;br /&gt;
By default on the Tandy 200, the first token of the first line of the BASIC program in RAM is at address 0xA001. For all other Model T computers, including the Model 100, the first token is at 0x8001.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
&amp;lt;references group=&amp;quot;note&amp;quot; /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Format documentation ==&lt;br /&gt;
&lt;br /&gt;
* [https://m100.bitchin100.narkive.com/eP2uSl4J/tokenized-basic-programs-bytes-of-mystery Discussion of byte format on Bitchin 100 Mailing List]&lt;br /&gt;
* [http://www.club100.org/library/ups/tokens.do BASIC program to create a table of tokens]&lt;br /&gt;
* [https://archive.org/details/HiddenPowersOfTheTrs80Model100/page/n229/mode/2up?view=theater Hidden Powers of the TRS 80 Model 100]. Appendix B lists the BASIC token values for the Model 100. Other than the omission of 255 for a single quote remark, this reference matches what hackerb9 found programmatically for the Tandy 200.&lt;br /&gt;
* [http://web.archive.org/web/20220324135218/https://help.ayra.ch/trs80-reference#trs-80-model-100-basic-reference Ayra Model 100 BASIC Reference]&lt;br /&gt;
&lt;br /&gt;
== Other links ==&lt;br /&gt;
&lt;br /&gt;
* [https://github.com/hackerb9/tokenize/ Hackerb9's C program for tokenizing BASIC code]&lt;br /&gt;
* [https://sourceforge.net/projects/virtualt/ A Tandy 200 &amp;amp; Model 100/102 emulator]&lt;br /&gt;
* [http://bitchin100.com/CloudT/ A TRS-80 Model 100 emulator that runs in a web browser]&lt;br /&gt;
&lt;br /&gt;
[[Category:TRS-80]]&lt;br /&gt;
[[Category:Microsoft]]&lt;/div&gt;</summary>
		<author><name>Hackerb9</name></author>	</entry>

	<entry>
		<id>http://fileformats.archiveteam.org/wiki/Tandy_200_BASIC_tokenized_file</id>
		<title>Tandy 200 BASIC tokenized file</title>
		<link rel="alternate" type="text/html" href="http://fileformats.archiveteam.org/wiki/Tandy_200_BASIC_tokenized_file"/>
				<updated>2024-07-18T04:18:02Z</updated>
		
		<summary type="html">&lt;p&gt;Hackerb9: /* Details for PL PH */ Fill in more details, make section collapsed by default as it will grow longer once an example is added&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{FormatInfo&lt;br /&gt;
|subcat=Source code&lt;br /&gt;
|subcat2=Tokenized BASIC&lt;br /&gt;
|released=1983&lt;br /&gt;
|extensions={{ext|ba}}&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
'''Tandy 200 BASIC''' was a version of Microsoft BASIC for the Radio Shack Tandy 200 computer. The tokenizations for the TRS-80 Model 100 and Tandy 102 appear to be identical. In fact, while the research that created this page was done on a Tandy 200, experiments using [https://sourceforge.net/projects/virtualt/ emulated systems] indicate that the tokenized BASIC file format is the same across most of the computers related to the Kyocera Kyotronic-85, with the exception being the models made by NEC.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;margin-left: auto; margin-right: auto; border: none;&amp;quot;&lt;br /&gt;
|+ Which of the Kyotronic-85 Sisters use this format&lt;br /&gt;
! title=&amp;quot;Name of the manufacturer and computer model&amp;quot; | Computer Model&lt;br /&gt;
! title=&amp;quot;Whether the tokenization is the same as for the Tandy 200&amp;quot; | Uses Tandy 200 Tokenization?&lt;br /&gt;
|- style=text-align:center&lt;br /&gt;
|Kyocera Kyotronic-85&amp;lt;br/&amp;gt;Olivetti M10&amp;lt;br/&amp;gt;TRS-80 Model 100&amp;lt;br/&amp;gt;Tandy 200&amp;lt;br/&amp;gt;Tandy 102||Yes&lt;br /&gt;
|- style=text-align:center&lt;br /&gt;
| NEC PC-8201 &amp;lt;br/&amp;gt; NEC PC-8201A &amp;lt;br/&amp;gt; NEC PC-8300 || No&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
While the NEC PC-8201/8300 format is not the same, the BASIC it runs (N82 BASIC) is very close and it is expected the tokenization will be similar.&lt;br /&gt;
&lt;br /&gt;
== Tokens ==&lt;br /&gt;
All BASIC tokens on the Tandy 200 are a single byte with a value from 128 to 255. &lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+ Table mapping token values to BASIC keywords&lt;br /&gt;
! title=&amp;quot;The value of the token in hexadecimal&amp;quot; | Hex&lt;br /&gt;
! title=&amp;quot;The value of the token in decimal&amp;quot; | Dec&lt;br /&gt;
! title=&amp;quot;The BASIC keyword the token stands for&amp;quot; | Keyword &lt;br /&gt;
! title=&amp;quot;Miscellany&amp;quot; | Notes&lt;br /&gt;
|-&lt;br /&gt;
|-&lt;br /&gt;
|80||128||END&lt;br /&gt;
|-&lt;br /&gt;
|81||129||FOR&lt;br /&gt;
|-&lt;br /&gt;
|82||130||NEXT&lt;br /&gt;
|-&lt;br /&gt;
|83||131||DATA&lt;br /&gt;
|-&lt;br /&gt;
|84||132||INPUT&lt;br /&gt;
|-&lt;br /&gt;
|85||133||DIM&lt;br /&gt;
|-&lt;br /&gt;
|86||134||READ&lt;br /&gt;
|-&lt;br /&gt;
|87||135||LET&lt;br /&gt;
|-&lt;br /&gt;
|88||136||GOTO&lt;br /&gt;
|-&lt;br /&gt;
|89||137||RUN&lt;br /&gt;
|-&lt;br /&gt;
|8A||138||IF&lt;br /&gt;
|-&lt;br /&gt;
|8B||139||RESTORE&lt;br /&gt;
|-&lt;br /&gt;
|8C||140||GOSUB&lt;br /&gt;
|-&lt;br /&gt;
|8D||141||RETURN&lt;br /&gt;
|-&lt;br /&gt;
|8E||142||REM&lt;br /&gt;
|-&lt;br /&gt;
|8F||143||STOP&lt;br /&gt;
|-&lt;br /&gt;
|90||144||WIDTH&lt;br /&gt;
|-&lt;br /&gt;
|91||145||ELSE||When tokenizing, the Tandy 200 always adds a colon (':') before the ELSE token (3A 91). If the user actually writes :ELSE it is tokenized as 3A 3A 91.&lt;br /&gt;
|-&lt;br /&gt;
|92||146||LINE&lt;br /&gt;
|-&lt;br /&gt;
|93||147||EDIT&lt;br /&gt;
|-&lt;br /&gt;
|94||148||ERROR&lt;br /&gt;
|-&lt;br /&gt;
|95||149||RESUME&lt;br /&gt;
|-&lt;br /&gt;
|96||150||OUT&lt;br /&gt;
|-&lt;br /&gt;
|97||151||ON&lt;br /&gt;
|-&lt;br /&gt;
|98||152||DSKO$&lt;br /&gt;
|-&lt;br /&gt;
|99||153||OPEN&lt;br /&gt;
|-&lt;br /&gt;
|9A||154||CLOSE&lt;br /&gt;
|-&lt;br /&gt;
|9B||155||LOAD||Note that LOADM is simply the token for LOAD followed by an ASCII 'M'. &lt;br /&gt;
|-&lt;br /&gt;
|9C||156||MERGE&lt;br /&gt;
|-QUOTE&lt;br /&gt;
|9D||157||FILES&lt;br /&gt;
|-&lt;br /&gt;
|9E||158||SAVE&lt;br /&gt;
|-&lt;br /&gt;
|9F||159||LFILES&lt;br /&gt;
|-&lt;br /&gt;
|A0||160||LPRINT&lt;br /&gt;
|-&lt;br /&gt;
|A1||161||DEF&lt;br /&gt;
|-&lt;br /&gt;
|A2||162||POKE&lt;br /&gt;
|-&lt;br /&gt;
|A3||163||PRINT&lt;br /&gt;
|-&lt;br /&gt;
|A4||164||CONT&lt;br /&gt;
|-&lt;br /&gt;
|A5||165||LIST&lt;br /&gt;
|-&lt;br /&gt;
|A6||166||LLIST&lt;br /&gt;
|-&lt;br /&gt;
|A7||167||CLEAR&lt;br /&gt;
|-&lt;br /&gt;
|A8||168||CLOAD&lt;br /&gt;
|-&lt;br /&gt;
|A9||169||CSAVE&lt;br /&gt;
|-&lt;br /&gt;
|AA||170||TIME$&lt;br /&gt;
|-&lt;br /&gt;
|AB||171||DATE$&lt;br /&gt;
|-&lt;br /&gt;
|AC||172||DAY$&lt;br /&gt;
|-&lt;br /&gt;
|AD||173||COM&lt;br /&gt;
|-&lt;br /&gt;
|AE||174||MDM&lt;br /&gt;
|-&lt;br /&gt;
|AF||175||KEY&lt;br /&gt;
|-&lt;br /&gt;
|B0||176||CLS&lt;br /&gt;
|-&lt;br /&gt;
|B1||177||BEEP&lt;br /&gt;
|-&lt;br /&gt;
|B2||178||SOUND&lt;br /&gt;
|-&lt;br /&gt;
|B3||179||LCOPY&lt;br /&gt;
|-&lt;br /&gt;
|B4||180||PSET&lt;br /&gt;
|-&lt;br /&gt;
|B5||181||PRESET&lt;br /&gt;
|-&lt;br /&gt;
|B6||182||MOTOR&lt;br /&gt;
|-&lt;br /&gt;
|B7||183||MAX&lt;br /&gt;
|-&lt;br /&gt;
|B8||184||POWER&lt;br /&gt;
|-&lt;br /&gt;
|B9||185||CALL&lt;br /&gt;
|-&lt;br /&gt;
|BA||186||MENU&lt;br /&gt;
|-&lt;br /&gt;
|BB||187||IPL&lt;br /&gt;
|-&lt;br /&gt;
|BC||188||NAME&lt;br /&gt;
|-&lt;br /&gt;
|BD||189||KILL&lt;br /&gt;
|-&lt;br /&gt;
|BE||190||SCREEN&lt;br /&gt;
|-&lt;br /&gt;
|BF||191||NEW&lt;br /&gt;
|-&lt;br /&gt;
|C0||192||TAB(&lt;br /&gt;
|-&lt;br /&gt;
|C1||193||TO&lt;br /&gt;
|-&lt;br /&gt;
|C2||194||USING&lt;br /&gt;
|-&lt;br /&gt;
|C3||195||VARPTR&lt;br /&gt;
|-&lt;br /&gt;
|C4||196||ERL&lt;br /&gt;
|-&lt;br /&gt;
|C5||197||ERR&lt;br /&gt;
|-&lt;br /&gt;
|C6||198||STRING$&lt;br /&gt;
|-&lt;br /&gt;
|C7||199||INSTR&lt;br /&gt;
|-&lt;br /&gt;
|C8||200||DSKI$&lt;br /&gt;
|-&lt;br /&gt;
|C9||201||INKEY$&lt;br /&gt;
|-&lt;br /&gt;
|CA||202||CSRLIN&lt;br /&gt;
|-&lt;br /&gt;
|CB||203||OFF&lt;br /&gt;
|-&lt;br /&gt;
|CC||204||HIMEM&lt;br /&gt;
|-&lt;br /&gt;
|CD||205||THEN&lt;br /&gt;
|-&lt;br /&gt;
|CE||206||NOT&lt;br /&gt;
|-&lt;br /&gt;
|CF||207||STEP&lt;br /&gt;
|-&lt;br /&gt;
|D0||208||+&lt;br /&gt;
|-&lt;br /&gt;
|D1||209||-&lt;br /&gt;
|-&lt;br /&gt;
|D2||210||*&lt;br /&gt;
|-&lt;br /&gt;
|D3||211||/&lt;br /&gt;
|-&lt;br /&gt;
|D4||212||^&lt;br /&gt;
|-&lt;br /&gt;
|D5||213||AND&lt;br /&gt;
|-&lt;br /&gt;
|D6||214||OR&lt;br /&gt;
|-&lt;br /&gt;
|D7||215||XOR&lt;br /&gt;
|-&lt;br /&gt;
|D8||216||EQV&lt;br /&gt;
|-&lt;br /&gt;
|D9||217||IMP&lt;br /&gt;
|-&lt;br /&gt;
|DA||218||MOD&lt;br /&gt;
|-&lt;br /&gt;
|DB||219||\&lt;br /&gt;
|-&lt;br /&gt;
|DC||220||&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|DD||221||=&lt;br /&gt;
|-&lt;br /&gt;
|DE||222||&amp;lt;&lt;br /&gt;
|-&lt;br /&gt;
|DF||223||SGN&lt;br /&gt;
|-&lt;br /&gt;
|E0||224||INT&lt;br /&gt;
|-&lt;br /&gt;
|E1||225||ABS&lt;br /&gt;
|-&lt;br /&gt;
|E2||226||FRE&lt;br /&gt;
|-&lt;br /&gt;
|E3||227||INP&lt;br /&gt;
|-&lt;br /&gt;
|E4||228||LPOS&lt;br /&gt;
|-&lt;br /&gt;
|E5||229||POS&lt;br /&gt;
|-&lt;br /&gt;
|E6||230||SQR&lt;br /&gt;
|-&lt;br /&gt;
|E7||231||RND&lt;br /&gt;
|-&lt;br /&gt;
|E8||232||LOG&lt;br /&gt;
|-&lt;br /&gt;
|E9||233||EXP&lt;br /&gt;
|-&lt;br /&gt;
|EA||234||COS&lt;br /&gt;
|-&lt;br /&gt;
|EB||235||SIN&lt;br /&gt;
|-&lt;br /&gt;
|EC||236||TAN&lt;br /&gt;
|-&lt;br /&gt;
|ED||237||ATN&lt;br /&gt;
|-&lt;br /&gt;
|EE||238||PEEK&lt;br /&gt;
|-&lt;br /&gt;
|EF||239||EOF&lt;br /&gt;
|-&lt;br /&gt;
|F0||240||LOC&lt;br /&gt;
|-&lt;br /&gt;
|F1||241||LOF&lt;br /&gt;
|-&lt;br /&gt;
|F2||242||CINT&lt;br /&gt;
|-&lt;br /&gt;
|F3||243||CSNG&lt;br /&gt;
|-&lt;br /&gt;
|F4||244||CDBL&lt;br /&gt;
|-&lt;br /&gt;
|F5||245||FIX&lt;br /&gt;
|-&lt;br /&gt;
|F6||246||LEN&lt;br /&gt;
|-&lt;br /&gt;
|F7||247||STR$&lt;br /&gt;
|-&lt;br /&gt;
|F8||248||VAL&lt;br /&gt;
|-&lt;br /&gt;
|F9||249||ASC&lt;br /&gt;
|-&lt;br /&gt;
|FA||250||CHR$&lt;br /&gt;
|-&lt;br /&gt;
|FB||251||SPACE$&lt;br /&gt;
|-&lt;br /&gt;
|FC||252||LEFT$&lt;br /&gt;
|-&lt;br /&gt;
|FD||253||RIGHT$&lt;br /&gt;
|-&lt;br /&gt;
|FE||254||MID$&lt;br /&gt;
|-&lt;br /&gt;
|FF||255||' (QUOTE) || When tokenizing, the single quote character expands to three characters: a colon (3A), the byte for REM (8E), and then FF.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== File Format ==&lt;br /&gt;
&lt;br /&gt;
Tokenised BASIC code is a sequence of tokenized lines. Each tokenized line has the following format:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+ Format of a single tokenized line&lt;br /&gt;
!Name!!Length!!Description&lt;br /&gt;
|-&lt;br /&gt;
|PL PH&lt;br /&gt;
|2 bytes&lt;br /&gt;
|Address in RAM of the next line of BASIC; unsigned 16-bit integer, little-endian. In a file, PL PH is merely a placeholder and the value is never used. In RAM, PL PH == 0 marks the end of the tokenized BASIC listing. (See [[#Details for PL PH]].)&lt;br /&gt;
|-&lt;br /&gt;
|LL LH&lt;br /&gt;
|2 bytes&lt;br /&gt;
|Line number; unsigned 16-bit integer, little-endian.&lt;br /&gt;
|-&lt;br /&gt;
|B&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt; … B&amp;lt;sub&amp;gt;n&amp;lt;/sub&amp;gt;&lt;br /&gt;
|Any number of bytes&lt;br /&gt;
|Depending on the high bit, each byte is either a token or an ASCII character. &lt;br /&gt;
|-&lt;br /&gt;
|NULL&lt;br /&gt;
|1 byte&lt;br /&gt;
|NULL byte (&amp;lt;code&amp;gt;0x00&amp;lt;/code&amp;gt;) to signal end of line. &lt;br /&gt;
|}&lt;br /&gt;
              &lt;br /&gt;
Typically, the list of tokenized lines continues until the end of the file. Once a program is loaded into RAM, the end is signaled by two consecutive NULLs in the location where PL PH would normally start the next line.&lt;br /&gt;
&lt;br /&gt;
=== Limits ===&lt;br /&gt;
&lt;br /&gt;
* Line numbers can range from 0 to 65529 (but see variances below).&lt;br /&gt;
* Tokenized line length is limited to 256 characters, including the trailing NULL byte. (To do: double check this.)&lt;br /&gt;
&lt;br /&gt;
=== Acceptable variances ===&lt;br /&gt;
&lt;br /&gt;
While Tandy BASIC will never generate such files, it has no problem loading a tokenized program that:&lt;br /&gt;
&lt;br /&gt;
* Has line numbers out of order; the numerical value of a line number is ignored. Program lines are always LISTed and RUN in the order they appear in the tokenized file.&lt;br /&gt;
* Contains duplicate line numbers; all lines are kept and run in the order found in the file. (GOTO is complicated as search starts at the next line, not the beginning of the program.)&lt;br /&gt;
* Contains a line with zero bytes of data; LIST will show the line number with no text afterward. Does not replace or delete a preexisting line with that number.&lt;br /&gt;
* Contains arbitrary bytes for PL PH; the value of PL PH is always recalculated at LOAD time.&lt;br /&gt;
* Contains line numbers greater than the nominal maximum of 65529; this can be used to store hidden binary data [https://www.mail-archive.com/m100@lists.bitchin100.com/msg16195.html according to John R. Hogerhuis].&lt;br /&gt;
&lt;br /&gt;
''Sidenote'': while these variances are accepted by actual hardware, emulators may not be able to handle such files. For example, [https://sourceforge.net/projects/virtualt/ Virtual T] (as of version 1.7 in 2022) refuses to load tokenized BASIC programs that have lines out of order, duplicate lines, or bogus values for PL PH.&lt;br /&gt;
&lt;br /&gt;
=== Details for PL PH ===&lt;br /&gt;
In a file, the specific values of the 16-bit integer PL PH addresses are artifacts of where the file happened to be in memory before saving. The file's values are ''never'' used as Tandy BASIC always recalculates PL PH upon loading a program into RAM. &lt;br /&gt;
&lt;br /&gt;
Although not technically part of the file format, one may want to calculate PL PH for compatibility with broken or persnickety emulators. Expand the section below to see details.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible mw-collapsed&amp;quot;&amp;gt;&lt;br /&gt;
==== Calculating PL PH ====&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Once in RAM, PL PH represents the absolute memory address of the next line. According to John Hogerhuis, PL PH is positioned before the line's data so the BASIC interpreter can quickly skip ahead to reach the target line of GOTO, GOSUB, THEN, ELSE, RESTORE, RESUME, RUN, LIST, LLIST, or EDIT.&amp;lt;ref group=&amp;quot;note&amp;quot;&amp;gt;Searching begins at the ''next'' line in the program. The claim that one can speed up commonly used subroutines by putting them at low numbered lines is plausible as the search would detect immediately that the next line's number was too high and restart the search from the beginning.&amp;lt;/ref&amp;gt;)&lt;br /&gt;
Additionally, the end of a tokenized BASIC listing is marked by the final line's PL PH equal to zero (two NULL bytes). &lt;br /&gt;
&lt;br /&gt;
Note that because the addresses are absolute, not relative, their values depend not only on the program code but on an initial offset. That offset is why identical programs may not have identical checksums (but see the bacmp program). &lt;br /&gt;
&lt;br /&gt;
By default on the Tandy 200, the first token of the first line of the BASIC program in RAM is at address 0xA001. For all other Model T computers, including the Model 100, the first token is at 0x8001.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;references group=&amp;quot;note&amp;quot; /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Format documentation ==&lt;br /&gt;
&lt;br /&gt;
* [https://m100.bitchin100.narkive.com/eP2uSl4J/tokenized-basic-programs-bytes-of-mystery Discussion of byte format on Bitchin 100 Mailing List]&lt;br /&gt;
* [http://www.club100.org/library/ups/tokens.do BASIC program to create a table of tokens]&lt;br /&gt;
* [https://archive.org/details/HiddenPowersOfTheTrs80Model100/page/n229/mode/2up?view=theater Hidden Powers of the TRS 80 Model 100]. Appendix B lists the BASIC token values for the Model 100. Other than the omission of 255 for a single quote remark, this reference matches what hackerb9 found programmatically for the Tandy 200.&lt;br /&gt;
* [http://web.archive.org/web/20220324135218/https://help.ayra.ch/trs80-reference#trs-80-model-100-basic-reference Ayra Model 100 BASIC Reference]&lt;br /&gt;
&lt;br /&gt;
== Other links ==&lt;br /&gt;
&lt;br /&gt;
* [https://github.com/hackerb9/tokenize/ Hackerb9's C program for tokenizing BASIC code]&lt;br /&gt;
* [https://sourceforge.net/projects/virtualt/ A Tandy 200 &amp;amp; Model 100/102 emulator]&lt;br /&gt;
* [http://bitchin100.com/CloudT/ A TRS-80 Model 100 emulator that runs in a web browser]&lt;br /&gt;
&lt;br /&gt;
[[Category:TRS-80]]&lt;br /&gt;
[[Category:Microsoft]]&lt;/div&gt;</summary>
		<author><name>Hackerb9</name></author>	</entry>

	<entry>
		<id>http://fileformats.archiveteam.org/wiki/Tandy_200_BASIC_tokenized_file</id>
		<title>Tandy 200 BASIC tokenized file</title>
		<link rel="alternate" type="text/html" href="http://fileformats.archiveteam.org/wiki/Tandy_200_BASIC_tokenized_file"/>
				<updated>2024-03-18T06:37:41Z</updated>
		
		<summary type="html">&lt;p&gt;Hackerb9: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{FormatInfo&lt;br /&gt;
|subcat=Source code&lt;br /&gt;
|subcat2=Tokenized BASIC&lt;br /&gt;
|released=1983&lt;br /&gt;
|extensions={{ext|ba}}&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
'''Tandy 200 BASIC''' was a version of Microsoft BASIC for the Radio Shack Tandy 200 computer. The tokenizations for the TRS-80 Model 100 and Tandy 102 appear to be identical. In fact, while the research that created this page was done on a Tandy 200, experiments using [https://sourceforge.net/projects/virtualt/ emulated systems] indicate that the tokenized BASIC file format is the same across most of the computers related to the Kyocera Kyotronic-85, with the exception being the models made by NEC.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;margin-left: auto; margin-right: auto; border: none;&amp;quot;&lt;br /&gt;
|+ Which of the Kyotronic-85 Sisters use this format&lt;br /&gt;
! title=&amp;quot;Name of the manufacturer and computer model&amp;quot; | Computer Model&lt;br /&gt;
! title=&amp;quot;Whether the tokenization is the same as for the Tandy 200&amp;quot; | Uses Tandy 200 Tokenization?&lt;br /&gt;
|- style=text-align:center&lt;br /&gt;
|Kyocera Kyotronic-85&amp;lt;br/&amp;gt;Olivetti M10&amp;lt;br/&amp;gt;TRS-80 Model 100&amp;lt;br/&amp;gt;Tandy 200&amp;lt;br/&amp;gt;Tandy 102||Yes&lt;br /&gt;
|- style=text-align:center&lt;br /&gt;
| NEC PC-8201 &amp;lt;br/&amp;gt; NEC PC-8201A &amp;lt;br/&amp;gt; NEC PC-8300 || No&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
While the NEC PC-8201/8300 format is not the same, the BASIC it runs (N82 BASIC) is very close and it is expected the tokenization will be similar.&lt;br /&gt;
&lt;br /&gt;
== Tokens ==&lt;br /&gt;
All BASIC tokens on the Tandy 200 are a single byte with a value from 128 to 255. &lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+ Table mapping token values to BASIC keywords&lt;br /&gt;
! title=&amp;quot;The value of the token in hexadecimal&amp;quot; | Hex&lt;br /&gt;
! title=&amp;quot;The value of the token in decimal&amp;quot; | Dec&lt;br /&gt;
! title=&amp;quot;The BASIC keyword the token stands for&amp;quot; | Keyword &lt;br /&gt;
! title=&amp;quot;Miscellany&amp;quot; | Notes&lt;br /&gt;
|-&lt;br /&gt;
|-&lt;br /&gt;
|80||128||END&lt;br /&gt;
|-&lt;br /&gt;
|81||129||FOR&lt;br /&gt;
|-&lt;br /&gt;
|82||130||NEXT&lt;br /&gt;
|-&lt;br /&gt;
|83||131||DATA&lt;br /&gt;
|-&lt;br /&gt;
|84||132||INPUT&lt;br /&gt;
|-&lt;br /&gt;
|85||133||DIM&lt;br /&gt;
|-&lt;br /&gt;
|86||134||READ&lt;br /&gt;
|-&lt;br /&gt;
|87||135||LET&lt;br /&gt;
|-&lt;br /&gt;
|88||136||GOTO&lt;br /&gt;
|-&lt;br /&gt;
|89||137||RUN&lt;br /&gt;
|-&lt;br /&gt;
|8A||138||IF&lt;br /&gt;
|-&lt;br /&gt;
|8B||139||RESTORE&lt;br /&gt;
|-&lt;br /&gt;
|8C||140||GOSUB&lt;br /&gt;
|-&lt;br /&gt;
|8D||141||RETURN&lt;br /&gt;
|-&lt;br /&gt;
|8E||142||REM&lt;br /&gt;
|-&lt;br /&gt;
|8F||143||STOP&lt;br /&gt;
|-&lt;br /&gt;
|90||144||WIDTH&lt;br /&gt;
|-&lt;br /&gt;
|91||145||ELSE||When tokenizing, the Tandy 200 always adds a colon (':') before the ELSE token (3A 91). If the user actually writes :ELSE it is tokenized as 3A 3A 91.&lt;br /&gt;
|-&lt;br /&gt;
|92||146||LINE&lt;br /&gt;
|-&lt;br /&gt;
|93||147||EDIT&lt;br /&gt;
|-&lt;br /&gt;
|94||148||ERROR&lt;br /&gt;
|-&lt;br /&gt;
|95||149||RESUME&lt;br /&gt;
|-&lt;br /&gt;
|96||150||OUT&lt;br /&gt;
|-&lt;br /&gt;
|97||151||ON&lt;br /&gt;
|-&lt;br /&gt;
|98||152||DSKO$&lt;br /&gt;
|-&lt;br /&gt;
|99||153||OPEN&lt;br /&gt;
|-&lt;br /&gt;
|9A||154||CLOSE&lt;br /&gt;
|-&lt;br /&gt;
|9B||155||LOAD||Note that LOADM is simply the token for LOAD followed by an ASCII 'M'. &lt;br /&gt;
|-&lt;br /&gt;
|9C||156||MERGE&lt;br /&gt;
|-QUOTE&lt;br /&gt;
|9D||157||FILES&lt;br /&gt;
|-&lt;br /&gt;
|9E||158||SAVE&lt;br /&gt;
|-&lt;br /&gt;
|9F||159||LFILES&lt;br /&gt;
|-&lt;br /&gt;
|A0||160||LPRINT&lt;br /&gt;
|-&lt;br /&gt;
|A1||161||DEF&lt;br /&gt;
|-&lt;br /&gt;
|A2||162||POKE&lt;br /&gt;
|-&lt;br /&gt;
|A3||163||PRINT&lt;br /&gt;
|-&lt;br /&gt;
|A4||164||CONT&lt;br /&gt;
|-&lt;br /&gt;
|A5||165||LIST&lt;br /&gt;
|-&lt;br /&gt;
|A6||166||LLIST&lt;br /&gt;
|-&lt;br /&gt;
|A7||167||CLEAR&lt;br /&gt;
|-&lt;br /&gt;
|A8||168||CLOAD&lt;br /&gt;
|-&lt;br /&gt;
|A9||169||CSAVE&lt;br /&gt;
|-&lt;br /&gt;
|AA||170||TIME$&lt;br /&gt;
|-&lt;br /&gt;
|AB||171||DATE$&lt;br /&gt;
|-&lt;br /&gt;
|AC||172||DAY$&lt;br /&gt;
|-&lt;br /&gt;
|AD||173||COM&lt;br /&gt;
|-&lt;br /&gt;
|AE||174||MDM&lt;br /&gt;
|-&lt;br /&gt;
|AF||175||KEY&lt;br /&gt;
|-&lt;br /&gt;
|B0||176||CLS&lt;br /&gt;
|-&lt;br /&gt;
|B1||177||BEEP&lt;br /&gt;
|-&lt;br /&gt;
|B2||178||SOUND&lt;br /&gt;
|-&lt;br /&gt;
|B3||179||LCOPY&lt;br /&gt;
|-&lt;br /&gt;
|B4||180||PSET&lt;br /&gt;
|-&lt;br /&gt;
|B5||181||PRESET&lt;br /&gt;
|-&lt;br /&gt;
|B6||182||MOTOR&lt;br /&gt;
|-&lt;br /&gt;
|B7||183||MAX&lt;br /&gt;
|-&lt;br /&gt;
|B8||184||POWER&lt;br /&gt;
|-&lt;br /&gt;
|B9||185||CALL&lt;br /&gt;
|-&lt;br /&gt;
|BA||186||MENU&lt;br /&gt;
|-&lt;br /&gt;
|BB||187||IPL&lt;br /&gt;
|-&lt;br /&gt;
|BC||188||NAME&lt;br /&gt;
|-&lt;br /&gt;
|BD||189||KILL&lt;br /&gt;
|-&lt;br /&gt;
|BE||190||SCREEN&lt;br /&gt;
|-&lt;br /&gt;
|BF||191||NEW&lt;br /&gt;
|-&lt;br /&gt;
|C0||192||TAB(&lt;br /&gt;
|-&lt;br /&gt;
|C1||193||TO&lt;br /&gt;
|-&lt;br /&gt;
|C2||194||USING&lt;br /&gt;
|-&lt;br /&gt;
|C3||195||VARPTR&lt;br /&gt;
|-&lt;br /&gt;
|C4||196||ERL&lt;br /&gt;
|-&lt;br /&gt;
|C5||197||ERR&lt;br /&gt;
|-&lt;br /&gt;
|C6||198||STRING$&lt;br /&gt;
|-&lt;br /&gt;
|C7||199||INSTR&lt;br /&gt;
|-&lt;br /&gt;
|C8||200||DSKI$&lt;br /&gt;
|-&lt;br /&gt;
|C9||201||INKEY$&lt;br /&gt;
|-&lt;br /&gt;
|CA||202||CSRLIN&lt;br /&gt;
|-&lt;br /&gt;
|CB||203||OFF&lt;br /&gt;
|-&lt;br /&gt;
|CC||204||HIMEM&lt;br /&gt;
|-&lt;br /&gt;
|CD||205||THEN&lt;br /&gt;
|-&lt;br /&gt;
|CE||206||NOT&lt;br /&gt;
|-&lt;br /&gt;
|CF||207||STEP&lt;br /&gt;
|-&lt;br /&gt;
|D0||208||+&lt;br /&gt;
|-&lt;br /&gt;
|D1||209||-&lt;br /&gt;
|-&lt;br /&gt;
|D2||210||*&lt;br /&gt;
|-&lt;br /&gt;
|D3||211||/&lt;br /&gt;
|-&lt;br /&gt;
|D4||212||^&lt;br /&gt;
|-&lt;br /&gt;
|D5||213||AND&lt;br /&gt;
|-&lt;br /&gt;
|D6||214||OR&lt;br /&gt;
|-&lt;br /&gt;
|D7||215||XOR&lt;br /&gt;
|-&lt;br /&gt;
|D8||216||EQV&lt;br /&gt;
|-&lt;br /&gt;
|D9||217||IMP&lt;br /&gt;
|-&lt;br /&gt;
|DA||218||MOD&lt;br /&gt;
|-&lt;br /&gt;
|DB||219||\&lt;br /&gt;
|-&lt;br /&gt;
|DC||220||&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|DD||221||=&lt;br /&gt;
|-&lt;br /&gt;
|DE||222||&amp;lt;&lt;br /&gt;
|-&lt;br /&gt;
|DF||223||SGN&lt;br /&gt;
|-&lt;br /&gt;
|E0||224||INT&lt;br /&gt;
|-&lt;br /&gt;
|E1||225||ABS&lt;br /&gt;
|-&lt;br /&gt;
|E2||226||FRE&lt;br /&gt;
|-&lt;br /&gt;
|E3||227||INP&lt;br /&gt;
|-&lt;br /&gt;
|E4||228||LPOS&lt;br /&gt;
|-&lt;br /&gt;
|E5||229||POS&lt;br /&gt;
|-&lt;br /&gt;
|E6||230||SQR&lt;br /&gt;
|-&lt;br /&gt;
|E7||231||RND&lt;br /&gt;
|-&lt;br /&gt;
|E8||232||LOG&lt;br /&gt;
|-&lt;br /&gt;
|E9||233||EXP&lt;br /&gt;
|-&lt;br /&gt;
|EA||234||COS&lt;br /&gt;
|-&lt;br /&gt;
|EB||235||SIN&lt;br /&gt;
|-&lt;br /&gt;
|EC||236||TAN&lt;br /&gt;
|-&lt;br /&gt;
|ED||237||ATN&lt;br /&gt;
|-&lt;br /&gt;
|EE||238||PEEK&lt;br /&gt;
|-&lt;br /&gt;
|EF||239||EOF&lt;br /&gt;
|-&lt;br /&gt;
|F0||240||LOC&lt;br /&gt;
|-&lt;br /&gt;
|F1||241||LOF&lt;br /&gt;
|-&lt;br /&gt;
|F2||242||CINT&lt;br /&gt;
|-&lt;br /&gt;
|F3||243||CSNG&lt;br /&gt;
|-&lt;br /&gt;
|F4||244||CDBL&lt;br /&gt;
|-&lt;br /&gt;
|F5||245||FIX&lt;br /&gt;
|-&lt;br /&gt;
|F6||246||LEN&lt;br /&gt;
|-&lt;br /&gt;
|F7||247||STR$&lt;br /&gt;
|-&lt;br /&gt;
|F8||248||VAL&lt;br /&gt;
|-&lt;br /&gt;
|F9||249||ASC&lt;br /&gt;
|-&lt;br /&gt;
|FA||250||CHR$&lt;br /&gt;
|-&lt;br /&gt;
|FB||251||SPACE$&lt;br /&gt;
|-&lt;br /&gt;
|FC||252||LEFT$&lt;br /&gt;
|-&lt;br /&gt;
|FD||253||RIGHT$&lt;br /&gt;
|-&lt;br /&gt;
|FE||254||MID$&lt;br /&gt;
|-&lt;br /&gt;
|FF||255||' (QUOTE) || When tokenizing, the single quote character expands to three characters: a colon (3A), the byte for REM (8E), and then FF.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== File Format ==&lt;br /&gt;
&lt;br /&gt;
Tokenised BASIC code is a sequence of tokenized lines. Each tokenized line has the following format:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+ Format of a single tokenized line&lt;br /&gt;
!Name!!Length!!Description&lt;br /&gt;
|-&lt;br /&gt;
|PL PH&lt;br /&gt;
|2 bytes&lt;br /&gt;
|Address in RAM of the next line of BASIC; unsigned 16-bit integer, little-endian. In a file, PL PH is merely a placeholder and the value is never used. In RAM, PL PH == 0 marks the end of the tokenized BASIC listing. (See [[#Details for PL PH]].)&lt;br /&gt;
|-&lt;br /&gt;
|LL LH&lt;br /&gt;
|2 bytes&lt;br /&gt;
|Line number; unsigned 16-bit integer, little-endian.&lt;br /&gt;
|-&lt;br /&gt;
|B&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt; … B&amp;lt;sub&amp;gt;n&amp;lt;/sub&amp;gt;&lt;br /&gt;
|Any number of bytes&lt;br /&gt;
|Depending on the high bit, each byte is either a token or an ASCII character. &lt;br /&gt;
|-&lt;br /&gt;
|NULL&lt;br /&gt;
|1 byte&lt;br /&gt;
|NULL byte (&amp;lt;code&amp;gt;0x00&amp;lt;/code&amp;gt;) to signal end of line. &lt;br /&gt;
|}&lt;br /&gt;
              &lt;br /&gt;
Typically, the list of tokenized lines continues until the end of the file. Once a program is loaded into RAM, the end is signaled by two consecutive NULLs in the location where PL PH would normally start the next line.&lt;br /&gt;
&lt;br /&gt;
=== Limits ===&lt;br /&gt;
&lt;br /&gt;
* Line numbers can range from 0 to 65529 (but see variances below).&lt;br /&gt;
* Tokenized line length is limited to 256 characters, including the trailing NULL byte. (To do: double check this.)&lt;br /&gt;
&lt;br /&gt;
=== Acceptable variances ===&lt;br /&gt;
&lt;br /&gt;
While Tandy BASIC will never generate such files, it has no problem loading a tokenized program that:&lt;br /&gt;
&lt;br /&gt;
* Has line numbers out of order; the numerical value of a line number is ignored. Program lines are always LISTed and RUN in the order they appear in the tokenized file.&lt;br /&gt;
* Contains duplicate line numbers; all lines are kept and run in the order found in the file. (GOTO is complicated as search starts at the next line, not the beginning of the program.)&lt;br /&gt;
* Contains a line with zero bytes of data; LIST will show the line number with no text afterward. Does not replace or delete a preexisting line with that number.&lt;br /&gt;
* Contains arbitrary bytes for PL PH; the value of PL PH is always recalculated at LOAD time.&lt;br /&gt;
* Contains line numbers greater than the nominal maximum of 65529; this can be used to store hidden binary data [https://www.mail-archive.com/m100@lists.bitchin100.com/msg16195.html according to John R. Hogerhuis].&lt;br /&gt;
&lt;br /&gt;
''Sidenote'': while these variances are accepted by actual hardware, emulators may not be able to handle such files. For example, [https://sourceforge.net/projects/virtualt/ Virtual T] (as of version 1.7 in 2022) refuses to load tokenized BASIC programs that have lines out of order, duplicate lines, or bogus values for PL PH.&lt;br /&gt;
&lt;br /&gt;
=== Details for PL PH ===&lt;br /&gt;
In a file, the specific values of the 16-bit integer PL PH are ''never'' used. Tandy BASIC always recalculates PL PH before loading a program into RAM. Although not technically part of the file format, one may want to calculate PL PH for compatibility with broken or persnickety emulators.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible mw-collapsed&amp;quot;&amp;gt;&lt;br /&gt;
==== Calculating PL PH ====&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
Once in RAM, PL PH represents the memory address of the next line. According to John Hogerhuis, the purpose is to quickly skip through lines in order to reach the target of GOTO, GOSUB, and READ. Additionally, the end of a tokenized BASIC listing is marked by the final line's PL PH equal to zero (two NULL bytes). &lt;br /&gt;
&lt;br /&gt;
By default on the Tandy 200, the first token of the first line of the BASIC program in RAM is at address 0xA001.&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Format documentation ==&lt;br /&gt;
&lt;br /&gt;
* [https://m100.bitchin100.narkive.com/eP2uSl4J/tokenized-basic-programs-bytes-of-mystery Discussion of byte format on Bitchin 100 Mailing List]&lt;br /&gt;
* [http://www.club100.org/library/ups/tokens.do BASIC program to create a table of tokens]&lt;br /&gt;
* [https://archive.org/details/HiddenPowersOfTheTrs80Model100/page/n229/mode/2up?view=theater Hidden Powers of the TRS 80 Model 100]. Appendix B lists the BASIC token values for the Model 100. Other than the omission of 255 for a single quote remark, this reference matches what hackerb9 found programmatically for the Tandy 200.&lt;br /&gt;
* [http://web.archive.org/web/20220324135218/https://help.ayra.ch/trs80-reference#trs-80-model-100-basic-reference Ayra Model 100 BASIC Reference]&lt;br /&gt;
&lt;br /&gt;
== Other links ==&lt;br /&gt;
&lt;br /&gt;
* [https://github.com/hackerb9/tokenize/ Hackerb9's C program for tokenizing BASIC code]&lt;br /&gt;
* [https://sourceforge.net/projects/virtualt/ A Tandy 200 &amp;amp; Model 100/102 emulator]&lt;br /&gt;
* [http://bitchin100.com/CloudT/ A TRS-80 Model 100 emulator that runs in a web browser]&lt;br /&gt;
&lt;br /&gt;
[[Category:TRS-80]]&lt;br /&gt;
[[Category:Microsoft]]&lt;/div&gt;</summary>
		<author><name>Hackerb9</name></author>	</entry>

	<entry>
		<id>http://fileformats.archiveteam.org/wiki/Tandy_200_BASIC_tokenized_file</id>
		<title>Tandy 200 BASIC tokenized file</title>
		<link rel="alternate" type="text/html" href="http://fileformats.archiveteam.org/wiki/Tandy_200_BASIC_tokenized_file"/>
				<updated>2024-03-18T06:23:02Z</updated>
		
		<summary type="html">&lt;p&gt;Hackerb9: Add .BA category&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{FormatInfo&lt;br /&gt;
|subcat=Source code&lt;br /&gt;
|subcat2=Tokenized BASIC&lt;br /&gt;
|released=1983&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
'''Tandy 200 BASIC''' was a version of Microsoft BASIC for the Radio Shack Tandy 200 computer. The tokenizations for the TRS-80 Model 100 and Tandy 102 appear to be identical. In fact, while the research that created this page was done on a Tandy 200, experiments using [https://sourceforge.net/projects/virtualt/ emulated systems] indicate that the tokenized BASIC file format is the same across most of the computers related to the Kyocera Kyotronic-85, with the exception being the models made by NEC.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;margin-left: auto; margin-right: auto; border: none;&amp;quot;&lt;br /&gt;
|+ Which of the Kyotronic-85 Sisters use this format&lt;br /&gt;
! title=&amp;quot;Name of the manufacturer and computer model&amp;quot; | Computer Model&lt;br /&gt;
! title=&amp;quot;Whether the tokenization is the same as for the Tandy 200&amp;quot; | Uses Tandy 200 Tokenization?&lt;br /&gt;
|- style=text-align:center&lt;br /&gt;
|Kyocera Kyotronic-85&amp;lt;br/&amp;gt;Olivetti M10&amp;lt;br/&amp;gt;TRS-80 Model 100&amp;lt;br/&amp;gt;Tandy 200&amp;lt;br/&amp;gt;Tandy 102||Yes&lt;br /&gt;
|- style=text-align:center&lt;br /&gt;
| NEC PC-8201 &amp;lt;br/&amp;gt; NEC PC-8201A &amp;lt;br/&amp;gt; NEC PC-8300 || No&lt;br /&gt;
|extensions={{ext|ba}}&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
While the NEC PC-8201/8300 format is not the same, the BASIC it runs (N82 BASIC) is very close and it is expected the tokenization will be similar.&lt;br /&gt;
&lt;br /&gt;
== Tokens ==&lt;br /&gt;
All BASIC tokens on the Tandy 200 are a single byte with a value from 128 to 255. &lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+ Table mapping token values to BASIC keywords&lt;br /&gt;
! title=&amp;quot;The value of the token in hexadecimal&amp;quot; | Hex&lt;br /&gt;
! title=&amp;quot;The value of the token in decimal&amp;quot; | Dec&lt;br /&gt;
! title=&amp;quot;The BASIC keyword the token stands for&amp;quot; | Keyword &lt;br /&gt;
! title=&amp;quot;Miscellany&amp;quot; | Notes&lt;br /&gt;
|-&lt;br /&gt;
|-&lt;br /&gt;
|80||128||END&lt;br /&gt;
|-&lt;br /&gt;
|81||129||FOR&lt;br /&gt;
|-&lt;br /&gt;
|82||130||NEXT&lt;br /&gt;
|-&lt;br /&gt;
|83||131||DATA&lt;br /&gt;
|-&lt;br /&gt;
|84||132||INPUT&lt;br /&gt;
|-&lt;br /&gt;
|85||133||DIM&lt;br /&gt;
|-&lt;br /&gt;
|86||134||READ&lt;br /&gt;
|-&lt;br /&gt;
|87||135||LET&lt;br /&gt;
|-&lt;br /&gt;
|88||136||GOTO&lt;br /&gt;
|-&lt;br /&gt;
|89||137||RUN&lt;br /&gt;
|-&lt;br /&gt;
|8A||138||IF&lt;br /&gt;
|-&lt;br /&gt;
|8B||139||RESTORE&lt;br /&gt;
|-&lt;br /&gt;
|8C||140||GOSUB&lt;br /&gt;
|-&lt;br /&gt;
|8D||141||RETURN&lt;br /&gt;
|-&lt;br /&gt;
|8E||142||REM&lt;br /&gt;
|-&lt;br /&gt;
|8F||143||STOP&lt;br /&gt;
|-&lt;br /&gt;
|90||144||WIDTH&lt;br /&gt;
|-&lt;br /&gt;
|91||145||ELSE||When tokenizing, the Tandy 200 always adds a colon (':') before the ELSE token (3A 91). If the user actually writes :ELSE it is tokenized as 3A 3A 91.&lt;br /&gt;
|-&lt;br /&gt;
|92||146||LINE&lt;br /&gt;
|-&lt;br /&gt;
|93||147||EDIT&lt;br /&gt;
|-&lt;br /&gt;
|94||148||ERROR&lt;br /&gt;
|-&lt;br /&gt;
|95||149||RESUME&lt;br /&gt;
|-&lt;br /&gt;
|96||150||OUT&lt;br /&gt;
|-&lt;br /&gt;
|97||151||ON&lt;br /&gt;
|-&lt;br /&gt;
|98||152||DSKO$&lt;br /&gt;
|-&lt;br /&gt;
|99||153||OPEN&lt;br /&gt;
|-&lt;br /&gt;
|9A||154||CLOSE&lt;br /&gt;
|-&lt;br /&gt;
|9B||155||LOAD||Note that LOADM is simply the token for LOAD followed by an ASCII 'M'. &lt;br /&gt;
|-&lt;br /&gt;
|9C||156||MERGE&lt;br /&gt;
|-QUOTE&lt;br /&gt;
|9D||157||FILES&lt;br /&gt;
|-&lt;br /&gt;
|9E||158||SAVE&lt;br /&gt;
|-&lt;br /&gt;
|9F||159||LFILES&lt;br /&gt;
|-&lt;br /&gt;
|A0||160||LPRINT&lt;br /&gt;
|-&lt;br /&gt;
|A1||161||DEF&lt;br /&gt;
|-&lt;br /&gt;
|A2||162||POKE&lt;br /&gt;
|-&lt;br /&gt;
|A3||163||PRINT&lt;br /&gt;
|-&lt;br /&gt;
|A4||164||CONT&lt;br /&gt;
|-&lt;br /&gt;
|A5||165||LIST&lt;br /&gt;
|-&lt;br /&gt;
|A6||166||LLIST&lt;br /&gt;
|-&lt;br /&gt;
|A7||167||CLEAR&lt;br /&gt;
|-&lt;br /&gt;
|A8||168||CLOAD&lt;br /&gt;
|-&lt;br /&gt;
|A9||169||CSAVE&lt;br /&gt;
|-&lt;br /&gt;
|AA||170||TIME$&lt;br /&gt;
|-&lt;br /&gt;
|AB||171||DATE$&lt;br /&gt;
|-&lt;br /&gt;
|AC||172||DAY$&lt;br /&gt;
|-&lt;br /&gt;
|AD||173||COM&lt;br /&gt;
|-&lt;br /&gt;
|AE||174||MDM&lt;br /&gt;
|-&lt;br /&gt;
|AF||175||KEY&lt;br /&gt;
|-&lt;br /&gt;
|B0||176||CLS&lt;br /&gt;
|-&lt;br /&gt;
|B1||177||BEEP&lt;br /&gt;
|-&lt;br /&gt;
|B2||178||SOUND&lt;br /&gt;
|-&lt;br /&gt;
|B3||179||LCOPY&lt;br /&gt;
|-&lt;br /&gt;
|B4||180||PSET&lt;br /&gt;
|-&lt;br /&gt;
|B5||181||PRESET&lt;br /&gt;
|-&lt;br /&gt;
|B6||182||MOTOR&lt;br /&gt;
|-&lt;br /&gt;
|B7||183||MAX&lt;br /&gt;
|-&lt;br /&gt;
|B8||184||POWER&lt;br /&gt;
|-&lt;br /&gt;
|B9||185||CALL&lt;br /&gt;
|-&lt;br /&gt;
|BA||186||MENU&lt;br /&gt;
|-&lt;br /&gt;
|BB||187||IPL&lt;br /&gt;
|-&lt;br /&gt;
|BC||188||NAME&lt;br /&gt;
|-&lt;br /&gt;
|BD||189||KILL&lt;br /&gt;
|-&lt;br /&gt;
|BE||190||SCREEN&lt;br /&gt;
|-&lt;br /&gt;
|BF||191||NEW&lt;br /&gt;
|-&lt;br /&gt;
|C0||192||TAB(&lt;br /&gt;
|-&lt;br /&gt;
|C1||193||TO&lt;br /&gt;
|-&lt;br /&gt;
|C2||194||USING&lt;br /&gt;
|-&lt;br /&gt;
|C3||195||VARPTR&lt;br /&gt;
|-&lt;br /&gt;
|C4||196||ERL&lt;br /&gt;
|-&lt;br /&gt;
|C5||197||ERR&lt;br /&gt;
|-&lt;br /&gt;
|C6||198||STRING$&lt;br /&gt;
|-&lt;br /&gt;
|C7||199||INSTR&lt;br /&gt;
|-&lt;br /&gt;
|C8||200||DSKI$&lt;br /&gt;
|-&lt;br /&gt;
|C9||201||INKEY$&lt;br /&gt;
|-&lt;br /&gt;
|CA||202||CSRLIN&lt;br /&gt;
|-&lt;br /&gt;
|CB||203||OFF&lt;br /&gt;
|-&lt;br /&gt;
|CC||204||HIMEM&lt;br /&gt;
|-&lt;br /&gt;
|CD||205||THEN&lt;br /&gt;
|-&lt;br /&gt;
|CE||206||NOT&lt;br /&gt;
|-&lt;br /&gt;
|CF||207||STEP&lt;br /&gt;
|-&lt;br /&gt;
|D0||208||+&lt;br /&gt;
|-&lt;br /&gt;
|D1||209||-&lt;br /&gt;
|-&lt;br /&gt;
|D2||210||*&lt;br /&gt;
|-&lt;br /&gt;
|D3||211||/&lt;br /&gt;
|-&lt;br /&gt;
|D4||212||^&lt;br /&gt;
|-&lt;br /&gt;
|D5||213||AND&lt;br /&gt;
|-&lt;br /&gt;
|D6||214||OR&lt;br /&gt;
|-&lt;br /&gt;
|D7||215||XOR&lt;br /&gt;
|-&lt;br /&gt;
|D8||216||EQV&lt;br /&gt;
|-&lt;br /&gt;
|D9||217||IMP&lt;br /&gt;
|-&lt;br /&gt;
|DA||218||MOD&lt;br /&gt;
|-&lt;br /&gt;
|DB||219||\&lt;br /&gt;
|-&lt;br /&gt;
|DC||220||&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|DD||221||=&lt;br /&gt;
|-&lt;br /&gt;
|DE||222||&amp;lt;&lt;br /&gt;
|-&lt;br /&gt;
|DF||223||SGN&lt;br /&gt;
|-&lt;br /&gt;
|E0||224||INT&lt;br /&gt;
|-&lt;br /&gt;
|E1||225||ABS&lt;br /&gt;
|-&lt;br /&gt;
|E2||226||FRE&lt;br /&gt;
|-&lt;br /&gt;
|E3||227||INP&lt;br /&gt;
|-&lt;br /&gt;
|E4||228||LPOS&lt;br /&gt;
|-&lt;br /&gt;
|E5||229||POS&lt;br /&gt;
|-&lt;br /&gt;
|E6||230||SQR&lt;br /&gt;
|-&lt;br /&gt;
|E7||231||RND&lt;br /&gt;
|-&lt;br /&gt;
|E8||232||LOG&lt;br /&gt;
|-&lt;br /&gt;
|E9||233||EXP&lt;br /&gt;
|-&lt;br /&gt;
|EA||234||COS&lt;br /&gt;
|-&lt;br /&gt;
|EB||235||SIN&lt;br /&gt;
|-&lt;br /&gt;
|EC||236||TAN&lt;br /&gt;
|-&lt;br /&gt;
|ED||237||ATN&lt;br /&gt;
|-&lt;br /&gt;
|EE||238||PEEK&lt;br /&gt;
|-&lt;br /&gt;
|EF||239||EOF&lt;br /&gt;
|-&lt;br /&gt;
|F0||240||LOC&lt;br /&gt;
|-&lt;br /&gt;
|F1||241||LOF&lt;br /&gt;
|-&lt;br /&gt;
|F2||242||CINT&lt;br /&gt;
|-&lt;br /&gt;
|F3||243||CSNG&lt;br /&gt;
|-&lt;br /&gt;
|F4||244||CDBL&lt;br /&gt;
|-&lt;br /&gt;
|F5||245||FIX&lt;br /&gt;
|-&lt;br /&gt;
|F6||246||LEN&lt;br /&gt;
|-&lt;br /&gt;
|F7||247||STR$&lt;br /&gt;
|-&lt;br /&gt;
|F8||248||VAL&lt;br /&gt;
|-&lt;br /&gt;
|F9||249||ASC&lt;br /&gt;
|-&lt;br /&gt;
|FA||250||CHR$&lt;br /&gt;
|-&lt;br /&gt;
|FB||251||SPACE$&lt;br /&gt;
|-&lt;br /&gt;
|FC||252||LEFT$&lt;br /&gt;
|-&lt;br /&gt;
|FD||253||RIGHT$&lt;br /&gt;
|-&lt;br /&gt;
|FE||254||MID$&lt;br /&gt;
|-&lt;br /&gt;
|FF||255||' (QUOTE) || When tokenizing, the single quote character expands to three characters: a colon (3A), the byte for REM (8E), and then FF.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== File Format ==&lt;br /&gt;
&lt;br /&gt;
Tokenised BASIC code is a sequence of tokenized lines. Each tokenized line has the following format:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+ Format of a single tokenized line&lt;br /&gt;
!Name!!Length!!Description&lt;br /&gt;
|-&lt;br /&gt;
|PL PH&lt;br /&gt;
|2 bytes&lt;br /&gt;
|Address in RAM of the next line of BASIC; unsigned 16-bit integer, little-endian. In a file, PL PH is merely a placeholder and the value is never used. In RAM, PL PH == 0 marks the end of the tokenized BASIC listing. (See [[#Details for PL PH]].)&lt;br /&gt;
|-&lt;br /&gt;
|LL LH&lt;br /&gt;
|2 bytes&lt;br /&gt;
|Line number; unsigned 16-bit integer, little-endian.&lt;br /&gt;
|-&lt;br /&gt;
|B&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt; … B&amp;lt;sub&amp;gt;n&amp;lt;/sub&amp;gt;&lt;br /&gt;
|Any number of bytes&lt;br /&gt;
|Depending on the high bit, each byte is either a token or an ASCII character. &lt;br /&gt;
|-&lt;br /&gt;
|NULL&lt;br /&gt;
|1 byte&lt;br /&gt;
|NULL byte (&amp;lt;code&amp;gt;0x00&amp;lt;/code&amp;gt;) to signal end of line. &lt;br /&gt;
|}&lt;br /&gt;
              &lt;br /&gt;
Typically, the list of tokenized lines continues until the end of the file. Once a program is loaded into RAM, the end is signaled by two consecutive NULLs in the location where PL PH would normally start the next line.&lt;br /&gt;
&lt;br /&gt;
=== Limits ===&lt;br /&gt;
&lt;br /&gt;
* Line numbers can range from 0 to 65529 (but see variances below).&lt;br /&gt;
* Tokenized line length is limited to 256 characters, including the trailing NULL byte. (To do: double check this.)&lt;br /&gt;
&lt;br /&gt;
=== Acceptable variances ===&lt;br /&gt;
&lt;br /&gt;
While Tandy BASIC will never generate such files, it has no problem loading a tokenized program that:&lt;br /&gt;
&lt;br /&gt;
* Has line numbers out of order; the numerical value of a line number is ignored. Program lines are always LISTed and RUN in the order they appear in the tokenized file.&lt;br /&gt;
* Contains duplicate line numbers; all lines are kept and run in the order found in the file. (GOTO is complicated as search starts at the next line, not the beginning of the program.)&lt;br /&gt;
* Contains a line with zero bytes of data; LIST will show the line number with no text afterward. Does not replace or delete a preexisting line with that number.&lt;br /&gt;
* Contains arbitrary bytes for PL PH; the value of PL PH is always recalculated at LOAD time.&lt;br /&gt;
* Contains line numbers greater than the nominal maximum of 65529; this can be used to store hidden binary data [https://www.mail-archive.com/m100@lists.bitchin100.com/msg16195.html according to John R. Hogerhuis].&lt;br /&gt;
&lt;br /&gt;
''Sidenote'': while these variances are accepted by actual hardware, emulators may not be able to handle such files. For example, [https://sourceforge.net/projects/virtualt/ Virtual T] (as of version 1.7 in 2022) refuses to load tokenized BASIC programs that have lines out of order, duplicate lines, or bogus values for PL PH.&lt;br /&gt;
&lt;br /&gt;
=== Details for PL PH ===&lt;br /&gt;
In a file, the specific values of the 16-bit integer PL PH are ''never'' used. Tandy BASIC always recalculates PL PH before loading a program into RAM. Although not technically part of the file format, one may want to calculate PL PH for compatibility with broken or persnickety emulators.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible mw-collapsed&amp;quot;&amp;gt;&lt;br /&gt;
==== Calculating PL PH ====&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
Once in RAM, PL PH represents the memory address of the next line. According to John Hogerhuis, the purpose is to quickly skip through lines in order to reach the target of GOTO, GOSUB, and READ. Additionally, the end of a tokenized BASIC listing is marked by the final line's PL PH equal to zero (two NULL bytes). &lt;br /&gt;
&lt;br /&gt;
By default on the Tandy 200, the first token of the first line of the BASIC program in RAM is at address 0xA001.&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Format documentation ==&lt;br /&gt;
&lt;br /&gt;
* [https://m100.bitchin100.narkive.com/eP2uSl4J/tokenized-basic-programs-bytes-of-mystery Discussion of byte format on Bitchin 100 Mailing List]&lt;br /&gt;
* [http://www.club100.org/library/ups/tokens.do BASIC program to create a table of tokens]&lt;br /&gt;
* [https://archive.org/details/HiddenPowersOfTheTrs80Model100/page/n229/mode/2up?view=theater Hidden Powers of the TRS 80 Model 100]. Appendix B lists the BASIC token values for the Model 100. Other than the omission of 255 for a single quote remark, this reference matches what hackerb9 found programmatically for the Tandy 200.&lt;br /&gt;
* [http://web.archive.org/web/20220324135218/https://help.ayra.ch/trs80-reference#trs-80-model-100-basic-reference Ayra Model 100 BASIC Reference]&lt;br /&gt;
&lt;br /&gt;
== Other links ==&lt;br /&gt;
&lt;br /&gt;
* [https://github.com/hackerb9/tokenize/ Hackerb9's C program for tokenizing BASIC code]&lt;br /&gt;
* [https://sourceforge.net/projects/virtualt/ A Tandy 200 &amp;amp; Model 100/102 emulator]&lt;br /&gt;
* [http://bitchin100.com/CloudT/ A TRS-80 Model 100 emulator that runs in a web browser]&lt;br /&gt;
&lt;br /&gt;
[[Category:TRS-80]]&lt;br /&gt;
[[Category:Microsoft]]&lt;/div&gt;</summary>
		<author><name>Hackerb9</name></author>	</entry>

	<entry>
		<id>http://fileformats.archiveteam.org/wiki/Tandy_200_BASIC_tokenized_file</id>
		<title>Tandy 200 BASIC tokenized file</title>
		<link rel="alternate" type="text/html" href="http://fileformats.archiveteam.org/wiki/Tandy_200_BASIC_tokenized_file"/>
				<updated>2024-03-11T02:28:02Z</updated>
		
		<summary type="html">&lt;p&gt;Hackerb9: /* Calculating PL PH */ CLEAR / HIMEM is for something else.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{FormatInfo&lt;br /&gt;
|subcat=Source code&lt;br /&gt;
|subcat2=Tokenized BASIC&lt;br /&gt;
|released=1983&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
'''Tandy 200 BASIC''' was a version of Microsoft BASIC for the Radio Shack Tandy 200 computer. The tokenizations for the TRS-80 Model 100 and Tandy 102 appear to be identical. In fact, while the research that created this page was done on a Tandy 200, experiments using [https://sourceforge.net/projects/virtualt/ emulated systems] indicate that the tokenized BASIC file format is the same across most of the computers related to the Kyocera Kyotronic-85, with the exception being the models made by NEC.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;margin-left: auto; margin-right: auto; border: none;&amp;quot;&lt;br /&gt;
|+ Which of the Kyotronic-85 Sisters use this format&lt;br /&gt;
! title=&amp;quot;Name of the manufacturer and computer model&amp;quot; | Computer Model&lt;br /&gt;
! title=&amp;quot;Whether the tokenization is the same as for the Tandy 200&amp;quot; | Uses Tandy 200 Tokenization?&lt;br /&gt;
|- style=text-align:center&lt;br /&gt;
|Kyocera Kyotronic-85&amp;lt;br/&amp;gt;Olivetti M10&amp;lt;br/&amp;gt;TRS-80 Model 100&amp;lt;br/&amp;gt;Tandy 200&amp;lt;br/&amp;gt;Tandy 102||Yes&lt;br /&gt;
|- style=text-align:center&lt;br /&gt;
| NEC PC-8201 &amp;lt;br/&amp;gt; NEC PC-8201A &amp;lt;br/&amp;gt; NEC PC-8300 || No&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
While the NEC PC-8201/8300 format is not the same, the BASIC it runs (N82 BASIC) is very close and it is expected the tokenization will be similar.&lt;br /&gt;
&lt;br /&gt;
== Tokens ==&lt;br /&gt;
All BASIC tokens on the Tandy 200 are a single byte with a value from 128 to 255. &lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+ Table mapping token values to BASIC keywords&lt;br /&gt;
! title=&amp;quot;The value of the token in hexadecimal&amp;quot; | Hex&lt;br /&gt;
! title=&amp;quot;The value of the token in decimal&amp;quot; | Dec&lt;br /&gt;
! title=&amp;quot;The BASIC keyword the token stands for&amp;quot; | Keyword &lt;br /&gt;
! title=&amp;quot;Miscellany&amp;quot; | Notes&lt;br /&gt;
|-&lt;br /&gt;
|-&lt;br /&gt;
|80||128||END&lt;br /&gt;
|-&lt;br /&gt;
|81||129||FOR&lt;br /&gt;
|-&lt;br /&gt;
|82||130||NEXT&lt;br /&gt;
|-&lt;br /&gt;
|83||131||DATA&lt;br /&gt;
|-&lt;br /&gt;
|84||132||INPUT&lt;br /&gt;
|-&lt;br /&gt;
|85||133||DIM&lt;br /&gt;
|-&lt;br /&gt;
|86||134||READ&lt;br /&gt;
|-&lt;br /&gt;
|87||135||LET&lt;br /&gt;
|-&lt;br /&gt;
|88||136||GOTO&lt;br /&gt;
|-&lt;br /&gt;
|89||137||RUN&lt;br /&gt;
|-&lt;br /&gt;
|8A||138||IF&lt;br /&gt;
|-&lt;br /&gt;
|8B||139||RESTORE&lt;br /&gt;
|-&lt;br /&gt;
|8C||140||GOSUB&lt;br /&gt;
|-&lt;br /&gt;
|8D||141||RETURN&lt;br /&gt;
|-&lt;br /&gt;
|8E||142||REM&lt;br /&gt;
|-&lt;br /&gt;
|8F||143||STOP&lt;br /&gt;
|-&lt;br /&gt;
|90||144||WIDTH&lt;br /&gt;
|-&lt;br /&gt;
|91||145||ELSE||When tokenizing, the Tandy 200 always adds a colon (':') before the ELSE token (3A 91). If the user actually writes :ELSE it is tokenized as 3A 3A 91.&lt;br /&gt;
|-&lt;br /&gt;
|92||146||LINE&lt;br /&gt;
|-&lt;br /&gt;
|93||147||EDIT&lt;br /&gt;
|-&lt;br /&gt;
|94||148||ERROR&lt;br /&gt;
|-&lt;br /&gt;
|95||149||RESUME&lt;br /&gt;
|-&lt;br /&gt;
|96||150||OUT&lt;br /&gt;
|-&lt;br /&gt;
|97||151||ON&lt;br /&gt;
|-&lt;br /&gt;
|98||152||DSKO$&lt;br /&gt;
|-&lt;br /&gt;
|99||153||OPEN&lt;br /&gt;
|-&lt;br /&gt;
|9A||154||CLOSE&lt;br /&gt;
|-&lt;br /&gt;
|9B||155||LOAD||Note that LOADM is simply the token for LOAD followed by an ASCII 'M'. &lt;br /&gt;
|-&lt;br /&gt;
|9C||156||MERGE&lt;br /&gt;
|-QUOTE&lt;br /&gt;
|9D||157||FILES&lt;br /&gt;
|-&lt;br /&gt;
|9E||158||SAVE&lt;br /&gt;
|-&lt;br /&gt;
|9F||159||LFILES&lt;br /&gt;
|-&lt;br /&gt;
|A0||160||LPRINT&lt;br /&gt;
|-&lt;br /&gt;
|A1||161||DEF&lt;br /&gt;
|-&lt;br /&gt;
|A2||162||POKE&lt;br /&gt;
|-&lt;br /&gt;
|A3||163||PRINT&lt;br /&gt;
|-&lt;br /&gt;
|A4||164||CONT&lt;br /&gt;
|-&lt;br /&gt;
|A5||165||LIST&lt;br /&gt;
|-&lt;br /&gt;
|A6||166||LLIST&lt;br /&gt;
|-&lt;br /&gt;
|A7||167||CLEAR&lt;br /&gt;
|-&lt;br /&gt;
|A8||168||CLOAD&lt;br /&gt;
|-&lt;br /&gt;
|A9||169||CSAVE&lt;br /&gt;
|-&lt;br /&gt;
|AA||170||TIME$&lt;br /&gt;
|-&lt;br /&gt;
|AB||171||DATE$&lt;br /&gt;
|-&lt;br /&gt;
|AC||172||DAY$&lt;br /&gt;
|-&lt;br /&gt;
|AD||173||COM&lt;br /&gt;
|-&lt;br /&gt;
|AE||174||MDM&lt;br /&gt;
|-&lt;br /&gt;
|AF||175||KEY&lt;br /&gt;
|-&lt;br /&gt;
|B0||176||CLS&lt;br /&gt;
|-&lt;br /&gt;
|B1||177||BEEP&lt;br /&gt;
|-&lt;br /&gt;
|B2||178||SOUND&lt;br /&gt;
|-&lt;br /&gt;
|B3||179||LCOPY&lt;br /&gt;
|-&lt;br /&gt;
|B4||180||PSET&lt;br /&gt;
|-&lt;br /&gt;
|B5||181||PRESET&lt;br /&gt;
|-&lt;br /&gt;
|B6||182||MOTOR&lt;br /&gt;
|-&lt;br /&gt;
|B7||183||MAX&lt;br /&gt;
|-&lt;br /&gt;
|B8||184||POWER&lt;br /&gt;
|-&lt;br /&gt;
|B9||185||CALL&lt;br /&gt;
|-&lt;br /&gt;
|BA||186||MENU&lt;br /&gt;
|-&lt;br /&gt;
|BB||187||IPL&lt;br /&gt;
|-&lt;br /&gt;
|BC||188||NAME&lt;br /&gt;
|-&lt;br /&gt;
|BD||189||KILL&lt;br /&gt;
|-&lt;br /&gt;
|BE||190||SCREEN&lt;br /&gt;
|-&lt;br /&gt;
|BF||191||NEW&lt;br /&gt;
|-&lt;br /&gt;
|C0||192||TAB(&lt;br /&gt;
|-&lt;br /&gt;
|C1||193||TO&lt;br /&gt;
|-&lt;br /&gt;
|C2||194||USING&lt;br /&gt;
|-&lt;br /&gt;
|C3||195||VARPTR&lt;br /&gt;
|-&lt;br /&gt;
|C4||196||ERL&lt;br /&gt;
|-&lt;br /&gt;
|C5||197||ERR&lt;br /&gt;
|-&lt;br /&gt;
|C6||198||STRING$&lt;br /&gt;
|-&lt;br /&gt;
|C7||199||INSTR&lt;br /&gt;
|-&lt;br /&gt;
|C8||200||DSKI$&lt;br /&gt;
|-&lt;br /&gt;
|C9||201||INKEY$&lt;br /&gt;
|-&lt;br /&gt;
|CA||202||CSRLIN&lt;br /&gt;
|-&lt;br /&gt;
|CB||203||OFF&lt;br /&gt;
|-&lt;br /&gt;
|CC||204||HIMEM&lt;br /&gt;
|-&lt;br /&gt;
|CD||205||THEN&lt;br /&gt;
|-&lt;br /&gt;
|CE||206||NOT&lt;br /&gt;
|-&lt;br /&gt;
|CF||207||STEP&lt;br /&gt;
|-&lt;br /&gt;
|D0||208||+&lt;br /&gt;
|-&lt;br /&gt;
|D1||209||-&lt;br /&gt;
|-&lt;br /&gt;
|D2||210||*&lt;br /&gt;
|-&lt;br /&gt;
|D3||211||/&lt;br /&gt;
|-&lt;br /&gt;
|D4||212||^&lt;br /&gt;
|-&lt;br /&gt;
|D5||213||AND&lt;br /&gt;
|-&lt;br /&gt;
|D6||214||OR&lt;br /&gt;
|-&lt;br /&gt;
|D7||215||XOR&lt;br /&gt;
|-&lt;br /&gt;
|D8||216||EQV&lt;br /&gt;
|-&lt;br /&gt;
|D9||217||IMP&lt;br /&gt;
|-&lt;br /&gt;
|DA||218||MOD&lt;br /&gt;
|-&lt;br /&gt;
|DB||219||\&lt;br /&gt;
|-&lt;br /&gt;
|DC||220||&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|DD||221||=&lt;br /&gt;
|-&lt;br /&gt;
|DE||222||&amp;lt;&lt;br /&gt;
|-&lt;br /&gt;
|DF||223||SGN&lt;br /&gt;
|-&lt;br /&gt;
|E0||224||INT&lt;br /&gt;
|-&lt;br /&gt;
|E1||225||ABS&lt;br /&gt;
|-&lt;br /&gt;
|E2||226||FRE&lt;br /&gt;
|-&lt;br /&gt;
|E3||227||INP&lt;br /&gt;
|-&lt;br /&gt;
|E4||228||LPOS&lt;br /&gt;
|-&lt;br /&gt;
|E5||229||POS&lt;br /&gt;
|-&lt;br /&gt;
|E6||230||SQR&lt;br /&gt;
|-&lt;br /&gt;
|E7||231||RND&lt;br /&gt;
|-&lt;br /&gt;
|E8||232||LOG&lt;br /&gt;
|-&lt;br /&gt;
|E9||233||EXP&lt;br /&gt;
|-&lt;br /&gt;
|EA||234||COS&lt;br /&gt;
|-&lt;br /&gt;
|EB||235||SIN&lt;br /&gt;
|-&lt;br /&gt;
|EC||236||TAN&lt;br /&gt;
|-&lt;br /&gt;
|ED||237||ATN&lt;br /&gt;
|-&lt;br /&gt;
|EE||238||PEEK&lt;br /&gt;
|-&lt;br /&gt;
|EF||239||EOF&lt;br /&gt;
|-&lt;br /&gt;
|F0||240||LOC&lt;br /&gt;
|-&lt;br /&gt;
|F1||241||LOF&lt;br /&gt;
|-&lt;br /&gt;
|F2||242||CINT&lt;br /&gt;
|-&lt;br /&gt;
|F3||243||CSNG&lt;br /&gt;
|-&lt;br /&gt;
|F4||244||CDBL&lt;br /&gt;
|-&lt;br /&gt;
|F5||245||FIX&lt;br /&gt;
|-&lt;br /&gt;
|F6||246||LEN&lt;br /&gt;
|-&lt;br /&gt;
|F7||247||STR$&lt;br /&gt;
|-&lt;br /&gt;
|F8||248||VAL&lt;br /&gt;
|-&lt;br /&gt;
|F9||249||ASC&lt;br /&gt;
|-&lt;br /&gt;
|FA||250||CHR$&lt;br /&gt;
|-&lt;br /&gt;
|FB||251||SPACE$&lt;br /&gt;
|-&lt;br /&gt;
|FC||252||LEFT$&lt;br /&gt;
|-&lt;br /&gt;
|FD||253||RIGHT$&lt;br /&gt;
|-&lt;br /&gt;
|FE||254||MID$&lt;br /&gt;
|-&lt;br /&gt;
|FF||255||' (QUOTE) || When tokenizing, the single quote character expands to three characters: a colon (3A), the byte for REM (8E), and then FF.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== File Format ==&lt;br /&gt;
&lt;br /&gt;
Tokenised BASIC code is a sequence of tokenized lines. Each tokenized line has the following format:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+ Format of a single tokenized line&lt;br /&gt;
!Name!!Length!!Description&lt;br /&gt;
|-&lt;br /&gt;
|PL PH&lt;br /&gt;
|2 bytes&lt;br /&gt;
|Address in RAM of the next line of BASIC; unsigned 16-bit integer, little-endian. In a file, PL PH is merely a placeholder and the value is never used. In RAM, PL PH == 0 marks the end of the tokenized BASIC listing. (See [[#Details for PL PH]].)&lt;br /&gt;
|-&lt;br /&gt;
|LL LH&lt;br /&gt;
|2 bytes&lt;br /&gt;
|Line number; unsigned 16-bit integer, little-endian.&lt;br /&gt;
|-&lt;br /&gt;
|B&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt; … B&amp;lt;sub&amp;gt;n&amp;lt;/sub&amp;gt;&lt;br /&gt;
|Any number of bytes&lt;br /&gt;
|Depending on the high bit, each byte is either a token or an ASCII character. &lt;br /&gt;
|-&lt;br /&gt;
|NULL&lt;br /&gt;
|1 byte&lt;br /&gt;
|NULL byte (&amp;lt;code&amp;gt;0x00&amp;lt;/code&amp;gt;) to signal end of line. &lt;br /&gt;
|}&lt;br /&gt;
              &lt;br /&gt;
Typically, the list of tokenized lines continues until the end of the file. Once a program is loaded into RAM, the end is signaled by two consecutive NULLs in the location where PL PH would normally start the next line.&lt;br /&gt;
&lt;br /&gt;
=== Limits ===&lt;br /&gt;
&lt;br /&gt;
* Line numbers can range from 0 to 65529 (but see variances below).&lt;br /&gt;
* Tokenized line length is limited to 256 characters, including the trailing NULL byte. (To do: double check this.)&lt;br /&gt;
&lt;br /&gt;
=== Acceptable variances ===&lt;br /&gt;
&lt;br /&gt;
While Tandy BASIC will never generate such files, it has no problem loading a tokenized program that:&lt;br /&gt;
&lt;br /&gt;
* Has line numbers out of order; the numerical value of a line number is ignored. Program lines are always LISTed and RUN in the order they appear in the tokenized file.&lt;br /&gt;
* Contains duplicate line numbers; all lines are kept and run in the order found in the file. (GOTO is complicated as search starts at the next line, not the beginning of the program.)&lt;br /&gt;
* Contains a line with zero bytes of data; LIST will show the line number with no text afterward. Does not replace or delete a preexisting line with that number.&lt;br /&gt;
* Contains arbitrary bytes for PL PH; the value of PL PH is always recalculated at LOAD time.&lt;br /&gt;
* Contains line numbers greater than the nominal maximum of 65529; this can be used to store hidden binary data [https://www.mail-archive.com/m100@lists.bitchin100.com/msg16195.html according to John R. Hogerhuis].&lt;br /&gt;
&lt;br /&gt;
''Sidenote'': while these variances are accepted by actual hardware, emulators may not be able to handle such files. For example, [https://sourceforge.net/projects/virtualt/ Virtual T] (as of version 1.7 in 2022) refuses to load tokenized BASIC programs that have lines out of order, duplicate lines, or bogus values for PL PH.&lt;br /&gt;
&lt;br /&gt;
=== Details for PL PH ===&lt;br /&gt;
In a file, the specific values of the 16-bit integer PL PH are ''never'' used. Tandy BASIC always recalculates PL PH before loading a program into RAM. Although not technically part of the file format, one may want to calculate PL PH for compatibility with broken or persnickety emulators.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible mw-collapsed&amp;quot;&amp;gt;&lt;br /&gt;
==== Calculating PL PH ====&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
Once in RAM, PL PH represents the memory address of the next line. According to John Hogerhuis, the purpose is to quickly skip through lines in order to reach the target of GOTO, GOSUB, and READ. Additionally, the end of a tokenized BASIC listing is marked by the final line's PL PH equal to zero (two NULL bytes). &lt;br /&gt;
&lt;br /&gt;
By default on the Tandy 200, the first token of the first line of the BASIC program in RAM is at address 0xA001.&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Format documentation ==&lt;br /&gt;
&lt;br /&gt;
* [https://m100.bitchin100.narkive.com/eP2uSl4J/tokenized-basic-programs-bytes-of-mystery Discussion of byte format on Bitchin 100 Mailing List]&lt;br /&gt;
* [http://www.club100.org/library/ups/tokens.do BASIC program to create a table of tokens]&lt;br /&gt;
* [https://archive.org/details/HiddenPowersOfTheTrs80Model100/page/n229/mode/2up?view=theater Hidden Powers of the TRS 80 Model 100]. Appendix B lists the BASIC token values for the Model 100. Other than the omission of 255 for a single quote remark, this reference matches what hackerb9 found programmatically for the Tandy 200.&lt;br /&gt;
* [http://web.archive.org/web/20220324135218/https://help.ayra.ch/trs80-reference#trs-80-model-100-basic-reference Ayra Model 100 BASIC Reference]&lt;br /&gt;
&lt;br /&gt;
== Other links ==&lt;br /&gt;
&lt;br /&gt;
* [https://github.com/hackerb9/tokenize/ Hackerb9's C program for tokenizing BASIC code]&lt;br /&gt;
* [https://sourceforge.net/projects/virtualt/ A Tandy 200 &amp;amp; Model 100/102 emulator]&lt;br /&gt;
* [http://bitchin100.com/CloudT/ A TRS-80 Model 100 emulator that runs in a web browser]&lt;br /&gt;
&lt;br /&gt;
[[Category:TRS-80]]&lt;br /&gt;
[[Category:Microsoft]]&lt;/div&gt;</summary>
		<author><name>Hackerb9</name></author>	</entry>

	<entry>
		<id>http://fileformats.archiveteam.org/wiki/Tandy_200_BASIC_tokenized_file</id>
		<title>Tandy 200 BASIC tokenized file</title>
		<link rel="alternate" type="text/html" href="http://fileformats.archiveteam.org/wiki/Tandy_200_BASIC_tokenized_file"/>
				<updated>2024-03-10T22:21:41Z</updated>
		
		<summary type="html">&lt;p&gt;Hackerb9: /* Details for PL PH */ Fill in more details, make section collapsed by default as it will grow longer once an example is added&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{FormatInfo&lt;br /&gt;
|subcat=Source code&lt;br /&gt;
|subcat2=Tokenized BASIC&lt;br /&gt;
|released=1983&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
'''Tandy 200 BASIC''' was a version of Microsoft BASIC for the Radio Shack Tandy 200 computer. The tokenizations for the TRS-80 Model 100 and Tandy 102 appear to be identical. In fact, while the research that created this page was done on a Tandy 200, experiments using [https://sourceforge.net/projects/virtualt/ emulated systems] indicate that the tokenized BASIC file format is the same across most of the computers related to the Kyocera Kyotronic-85, with the exception being the models made by NEC.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;margin-left: auto; margin-right: auto; border: none;&amp;quot;&lt;br /&gt;
|+ Which of the Kyotronic-85 Sisters use this format&lt;br /&gt;
! title=&amp;quot;Name of the manufacturer and computer model&amp;quot; | Computer Model&lt;br /&gt;
! title=&amp;quot;Whether the tokenization is the same as for the Tandy 200&amp;quot; | Uses Tandy 200 Tokenization?&lt;br /&gt;
|- style=text-align:center&lt;br /&gt;
|Kyocera Kyotronic-85&amp;lt;br/&amp;gt;Olivetti M10&amp;lt;br/&amp;gt;TRS-80 Model 100&amp;lt;br/&amp;gt;Tandy 200&amp;lt;br/&amp;gt;Tandy 102||Yes&lt;br /&gt;
|- style=text-align:center&lt;br /&gt;
| NEC PC-8201 &amp;lt;br/&amp;gt; NEC PC-8201A &amp;lt;br/&amp;gt; NEC PC-8300 || No&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
While the NEC PC-8201/8300 format is not the same, the BASIC it runs (N82 BASIC) is very close and it is expected the tokenization will be similar.&lt;br /&gt;
&lt;br /&gt;
== Tokens ==&lt;br /&gt;
All BASIC tokens on the Tandy 200 are a single byte with a value from 128 to 255. &lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+ Table mapping token values to BASIC keywords&lt;br /&gt;
! title=&amp;quot;The value of the token in hexadecimal&amp;quot; | Hex&lt;br /&gt;
! title=&amp;quot;The value of the token in decimal&amp;quot; | Dec&lt;br /&gt;
! title=&amp;quot;The BASIC keyword the token stands for&amp;quot; | Keyword &lt;br /&gt;
! title=&amp;quot;Miscellany&amp;quot; | Notes&lt;br /&gt;
|-&lt;br /&gt;
|-&lt;br /&gt;
|80||128||END&lt;br /&gt;
|-&lt;br /&gt;
|81||129||FOR&lt;br /&gt;
|-&lt;br /&gt;
|82||130||NEXT&lt;br /&gt;
|-&lt;br /&gt;
|83||131||DATA&lt;br /&gt;
|-&lt;br /&gt;
|84||132||INPUT&lt;br /&gt;
|-&lt;br /&gt;
|85||133||DIM&lt;br /&gt;
|-&lt;br /&gt;
|86||134||READ&lt;br /&gt;
|-&lt;br /&gt;
|87||135||LET&lt;br /&gt;
|-&lt;br /&gt;
|88||136||GOTO&lt;br /&gt;
|-&lt;br /&gt;
|89||137||RUN&lt;br /&gt;
|-&lt;br /&gt;
|8A||138||IF&lt;br /&gt;
|-&lt;br /&gt;
|8B||139||RESTORE&lt;br /&gt;
|-&lt;br /&gt;
|8C||140||GOSUB&lt;br /&gt;
|-&lt;br /&gt;
|8D||141||RETURN&lt;br /&gt;
|-&lt;br /&gt;
|8E||142||REM&lt;br /&gt;
|-&lt;br /&gt;
|8F||143||STOP&lt;br /&gt;
|-&lt;br /&gt;
|90||144||WIDTH&lt;br /&gt;
|-&lt;br /&gt;
|91||145||ELSE||When tokenizing, the Tandy 200 always adds a colon (':') before the ELSE token (3A 91). If the user actually writes :ELSE it is tokenized as 3A 3A 91.&lt;br /&gt;
|-&lt;br /&gt;
|92||146||LINE&lt;br /&gt;
|-&lt;br /&gt;
|93||147||EDIT&lt;br /&gt;
|-&lt;br /&gt;
|94||148||ERROR&lt;br /&gt;
|-&lt;br /&gt;
|95||149||RESUME&lt;br /&gt;
|-&lt;br /&gt;
|96||150||OUT&lt;br /&gt;
|-&lt;br /&gt;
|97||151||ON&lt;br /&gt;
|-&lt;br /&gt;
|98||152||DSKO$&lt;br /&gt;
|-&lt;br /&gt;
|99||153||OPEN&lt;br /&gt;
|-&lt;br /&gt;
|9A||154||CLOSE&lt;br /&gt;
|-&lt;br /&gt;
|9B||155||LOAD||Note that LOADM is simply the token for LOAD followed by an ASCII 'M'. &lt;br /&gt;
|-&lt;br /&gt;
|9C||156||MERGE&lt;br /&gt;
|-QUOTE&lt;br /&gt;
|9D||157||FILES&lt;br /&gt;
|-&lt;br /&gt;
|9E||158||SAVE&lt;br /&gt;
|-&lt;br /&gt;
|9F||159||LFILES&lt;br /&gt;
|-&lt;br /&gt;
|A0||160||LPRINT&lt;br /&gt;
|-&lt;br /&gt;
|A1||161||DEF&lt;br /&gt;
|-&lt;br /&gt;
|A2||162||POKE&lt;br /&gt;
|-&lt;br /&gt;
|A3||163||PRINT&lt;br /&gt;
|-&lt;br /&gt;
|A4||164||CONT&lt;br /&gt;
|-&lt;br /&gt;
|A5||165||LIST&lt;br /&gt;
|-&lt;br /&gt;
|A6||166||LLIST&lt;br /&gt;
|-&lt;br /&gt;
|A7||167||CLEAR&lt;br /&gt;
|-&lt;br /&gt;
|A8||168||CLOAD&lt;br /&gt;
|-&lt;br /&gt;
|A9||169||CSAVE&lt;br /&gt;
|-&lt;br /&gt;
|AA||170||TIME$&lt;br /&gt;
|-&lt;br /&gt;
|AB||171||DATE$&lt;br /&gt;
|-&lt;br /&gt;
|AC||172||DAY$&lt;br /&gt;
|-&lt;br /&gt;
|AD||173||COM&lt;br /&gt;
|-&lt;br /&gt;
|AE||174||MDM&lt;br /&gt;
|-&lt;br /&gt;
|AF||175||KEY&lt;br /&gt;
|-&lt;br /&gt;
|B0||176||CLS&lt;br /&gt;
|-&lt;br /&gt;
|B1||177||BEEP&lt;br /&gt;
|-&lt;br /&gt;
|B2||178||SOUND&lt;br /&gt;
|-&lt;br /&gt;
|B3||179||LCOPY&lt;br /&gt;
|-&lt;br /&gt;
|B4||180||PSET&lt;br /&gt;
|-&lt;br /&gt;
|B5||181||PRESET&lt;br /&gt;
|-&lt;br /&gt;
|B6||182||MOTOR&lt;br /&gt;
|-&lt;br /&gt;
|B7||183||MAX&lt;br /&gt;
|-&lt;br /&gt;
|B8||184||POWER&lt;br /&gt;
|-&lt;br /&gt;
|B9||185||CALL&lt;br /&gt;
|-&lt;br /&gt;
|BA||186||MENU&lt;br /&gt;
|-&lt;br /&gt;
|BB||187||IPL&lt;br /&gt;
|-&lt;br /&gt;
|BC||188||NAME&lt;br /&gt;
|-&lt;br /&gt;
|BD||189||KILL&lt;br /&gt;
|-&lt;br /&gt;
|BE||190||SCREEN&lt;br /&gt;
|-&lt;br /&gt;
|BF||191||NEW&lt;br /&gt;
|-&lt;br /&gt;
|C0||192||TAB(&lt;br /&gt;
|-&lt;br /&gt;
|C1||193||TO&lt;br /&gt;
|-&lt;br /&gt;
|C2||194||USING&lt;br /&gt;
|-&lt;br /&gt;
|C3||195||VARPTR&lt;br /&gt;
|-&lt;br /&gt;
|C4||196||ERL&lt;br /&gt;
|-&lt;br /&gt;
|C5||197||ERR&lt;br /&gt;
|-&lt;br /&gt;
|C6||198||STRING$&lt;br /&gt;
|-&lt;br /&gt;
|C7||199||INSTR&lt;br /&gt;
|-&lt;br /&gt;
|C8||200||DSKI$&lt;br /&gt;
|-&lt;br /&gt;
|C9||201||INKEY$&lt;br /&gt;
|-&lt;br /&gt;
|CA||202||CSRLIN&lt;br /&gt;
|-&lt;br /&gt;
|CB||203||OFF&lt;br /&gt;
|-&lt;br /&gt;
|CC||204||HIMEM&lt;br /&gt;
|-&lt;br /&gt;
|CD||205||THEN&lt;br /&gt;
|-&lt;br /&gt;
|CE||206||NOT&lt;br /&gt;
|-&lt;br /&gt;
|CF||207||STEP&lt;br /&gt;
|-&lt;br /&gt;
|D0||208||+&lt;br /&gt;
|-&lt;br /&gt;
|D1||209||-&lt;br /&gt;
|-&lt;br /&gt;
|D2||210||*&lt;br /&gt;
|-&lt;br /&gt;
|D3||211||/&lt;br /&gt;
|-&lt;br /&gt;
|D4||212||^&lt;br /&gt;
|-&lt;br /&gt;
|D5||213||AND&lt;br /&gt;
|-&lt;br /&gt;
|D6||214||OR&lt;br /&gt;
|-&lt;br /&gt;
|D7||215||XOR&lt;br /&gt;
|-&lt;br /&gt;
|D8||216||EQV&lt;br /&gt;
|-&lt;br /&gt;
|D9||217||IMP&lt;br /&gt;
|-&lt;br /&gt;
|DA||218||MOD&lt;br /&gt;
|-&lt;br /&gt;
|DB||219||\&lt;br /&gt;
|-&lt;br /&gt;
|DC||220||&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|DD||221||=&lt;br /&gt;
|-&lt;br /&gt;
|DE||222||&amp;lt;&lt;br /&gt;
|-&lt;br /&gt;
|DF||223||SGN&lt;br /&gt;
|-&lt;br /&gt;
|E0||224||INT&lt;br /&gt;
|-&lt;br /&gt;
|E1||225||ABS&lt;br /&gt;
|-&lt;br /&gt;
|E2||226||FRE&lt;br /&gt;
|-&lt;br /&gt;
|E3||227||INP&lt;br /&gt;
|-&lt;br /&gt;
|E4||228||LPOS&lt;br /&gt;
|-&lt;br /&gt;
|E5||229||POS&lt;br /&gt;
|-&lt;br /&gt;
|E6||230||SQR&lt;br /&gt;
|-&lt;br /&gt;
|E7||231||RND&lt;br /&gt;
|-&lt;br /&gt;
|E8||232||LOG&lt;br /&gt;
|-&lt;br /&gt;
|E9||233||EXP&lt;br /&gt;
|-&lt;br /&gt;
|EA||234||COS&lt;br /&gt;
|-&lt;br /&gt;
|EB||235||SIN&lt;br /&gt;
|-&lt;br /&gt;
|EC||236||TAN&lt;br /&gt;
|-&lt;br /&gt;
|ED||237||ATN&lt;br /&gt;
|-&lt;br /&gt;
|EE||238||PEEK&lt;br /&gt;
|-&lt;br /&gt;
|EF||239||EOF&lt;br /&gt;
|-&lt;br /&gt;
|F0||240||LOC&lt;br /&gt;
|-&lt;br /&gt;
|F1||241||LOF&lt;br /&gt;
|-&lt;br /&gt;
|F2||242||CINT&lt;br /&gt;
|-&lt;br /&gt;
|F3||243||CSNG&lt;br /&gt;
|-&lt;br /&gt;
|F4||244||CDBL&lt;br /&gt;
|-&lt;br /&gt;
|F5||245||FIX&lt;br /&gt;
|-&lt;br /&gt;
|F6||246||LEN&lt;br /&gt;
|-&lt;br /&gt;
|F7||247||STR$&lt;br /&gt;
|-&lt;br /&gt;
|F8||248||VAL&lt;br /&gt;
|-&lt;br /&gt;
|F9||249||ASC&lt;br /&gt;
|-&lt;br /&gt;
|FA||250||CHR$&lt;br /&gt;
|-&lt;br /&gt;
|FB||251||SPACE$&lt;br /&gt;
|-&lt;br /&gt;
|FC||252||LEFT$&lt;br /&gt;
|-&lt;br /&gt;
|FD||253||RIGHT$&lt;br /&gt;
|-&lt;br /&gt;
|FE||254||MID$&lt;br /&gt;
|-&lt;br /&gt;
|FF||255||' (QUOTE) || When tokenizing, the single quote character expands to three characters: a colon (3A), the byte for REM (8E), and then FF.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== File Format ==&lt;br /&gt;
&lt;br /&gt;
Tokenised BASIC code is a sequence of tokenized lines. Each tokenized line has the following format:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+ Format of a single tokenized line&lt;br /&gt;
!Name!!Length!!Description&lt;br /&gt;
|-&lt;br /&gt;
|PL PH&lt;br /&gt;
|2 bytes&lt;br /&gt;
|Address in RAM of the next line of BASIC; unsigned 16-bit integer, little-endian. In a file, PL PH is merely a placeholder and the value is never used. In RAM, PL PH == 0 marks the end of the tokenized BASIC listing. (See [[#Details for PL PH]].)&lt;br /&gt;
|-&lt;br /&gt;
|LL LH&lt;br /&gt;
|2 bytes&lt;br /&gt;
|Line number; unsigned 16-bit integer, little-endian.&lt;br /&gt;
|-&lt;br /&gt;
|B&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt; … B&amp;lt;sub&amp;gt;n&amp;lt;/sub&amp;gt;&lt;br /&gt;
|Any number of bytes&lt;br /&gt;
|Depending on the high bit, each byte is either a token or an ASCII character. &lt;br /&gt;
|-&lt;br /&gt;
|NULL&lt;br /&gt;
|1 byte&lt;br /&gt;
|NULL byte (&amp;lt;code&amp;gt;0x00&amp;lt;/code&amp;gt;) to signal end of line. &lt;br /&gt;
|}&lt;br /&gt;
              &lt;br /&gt;
Typically, the list of tokenized lines continues until the end of the file. Once a program is loaded into RAM, the end is signaled by two consecutive NULLs in the location where PL PH would normally start the next line.&lt;br /&gt;
&lt;br /&gt;
=== Limits ===&lt;br /&gt;
&lt;br /&gt;
* Line numbers can range from 0 to 65529 (but see variances below).&lt;br /&gt;
* Tokenized line length is limited to 256 characters, including the trailing NULL byte. (To do: double check this.)&lt;br /&gt;
&lt;br /&gt;
=== Acceptable variances ===&lt;br /&gt;
&lt;br /&gt;
While Tandy BASIC will never generate such files, it has no problem loading a tokenized program that:&lt;br /&gt;
&lt;br /&gt;
* Has line numbers out of order; the numerical value of a line number is ignored. Program lines are always LISTed and RUN in the order they appear in the tokenized file.&lt;br /&gt;
* Contains duplicate line numbers; all lines are kept and run in the order found in the file. (GOTO is complicated as search starts at the next line, not the beginning of the program.)&lt;br /&gt;
* Contains a line with zero bytes of data; LIST will show the line number with no text afterward. Does not replace or delete a preexisting line with that number.&lt;br /&gt;
* Contains arbitrary bytes for PL PH; the value of PL PH is always recalculated at LOAD time.&lt;br /&gt;
* Contains line numbers greater than the nominal maximum of 65529; this can be used to store hidden binary data [https://www.mail-archive.com/m100@lists.bitchin100.com/msg16195.html according to John R. Hogerhuis].&lt;br /&gt;
&lt;br /&gt;
''Sidenote'': while these variances are accepted by actual hardware, emulators may not be able to handle such files. For example, [https://sourceforge.net/projects/virtualt/ Virtual T] (as of version 1.7 in 2022) refuses to load tokenized BASIC programs that have lines out of order, duplicate lines, or bogus values for PL PH.&lt;br /&gt;
&lt;br /&gt;
=== Details for PL PH ===&lt;br /&gt;
In a file, the specific values of the 16-bit integer PL PH are ''never'' used. Tandy BASIC always recalculates PL PH before loading a program into RAM. Although not technically part of the file format, one may want to calculate PL PH for compatibility with broken or persnickety emulators.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible mw-collapsed&amp;quot;&amp;gt;&lt;br /&gt;
==== Calculating PL PH ====&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
Once in RAM, PL PH represents the memory address of the next line. According to John Hogerhuis, the purpose is to quickly skip through lines in order to reach the target of GOTO, GOSUB, and READ. Additionally, the end of a tokenized BASIC listing is marked by the final line's PL PH equal to zero (two NULL bytes). &lt;br /&gt;
&lt;br /&gt;
By default on the Tandy 200, the first line of the BASIC program in RAM starts at address 0xA001. However, that can be changed by the HIMEM command.&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Format documentation ==&lt;br /&gt;
&lt;br /&gt;
* [https://m100.bitchin100.narkive.com/eP2uSl4J/tokenized-basic-programs-bytes-of-mystery Discussion of byte format on Bitchin 100 Mailing List]&lt;br /&gt;
* [http://www.club100.org/library/ups/tokens.do BASIC program to create a table of tokens]&lt;br /&gt;
* [https://archive.org/details/HiddenPowersOfTheTrs80Model100/page/n229/mode/2up?view=theater Hidden Powers of the TRS 80 Model 100]. Appendix B lists the BASIC token values for the Model 100. Other than the omission of 255 for a single quote remark, this reference matches what hackerb9 found programmatically for the Tandy 200.&lt;br /&gt;
* [http://web.archive.org/web/20220324135218/https://help.ayra.ch/trs80-reference#trs-80-model-100-basic-reference Ayra Model 100 BASIC Reference]&lt;br /&gt;
&lt;br /&gt;
== Other links ==&lt;br /&gt;
&lt;br /&gt;
* [https://github.com/hackerb9/tokenize/ Hackerb9's C program for tokenizing BASIC code]&lt;br /&gt;
* [https://sourceforge.net/projects/virtualt/ A Tandy 200 &amp;amp; Model 100/102 emulator]&lt;br /&gt;
* [http://bitchin100.com/CloudT/ A TRS-80 Model 100 emulator that runs in a web browser]&lt;br /&gt;
&lt;br /&gt;
[[Category:TRS-80]]&lt;br /&gt;
[[Category:Microsoft]]&lt;/div&gt;</summary>
		<author><name>Hackerb9</name></author>	</entry>

	<entry>
		<id>http://fileformats.archiveteam.org/wiki/Tandy_200_BASIC_tokenized_file</id>
		<title>Tandy 200 BASIC tokenized file</title>
		<link rel="alternate" type="text/html" href="http://fileformats.archiveteam.org/wiki/Tandy_200_BASIC_tokenized_file"/>
				<updated>2022-11-05T10:59:02Z</updated>
		
		<summary type="html">&lt;p&gt;Hackerb9: Add info about other platforms that use the same tokenization format&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{FormatInfo&lt;br /&gt;
|subcat=Source code&lt;br /&gt;
|subcat2=Tokenized BASIC&lt;br /&gt;
|released=1983&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
'''Tandy 200 BASIC''' was a version of Microsoft BASIC for the Radio Shack Tandy 200 computer. The tokenizations for the TRS-80 Model 100 and Tandy 102 appear to be identical. In fact, while the research that created this page was done on a Tandy 200, experiments using [https://sourceforge.net/projects/virtualt/ emulated systems] indicate that the tokenized BASIC file format is the same across most of the computers related to the Kyocera Kyotronic-85, with the exception being the models made by NEC.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;margin-left: auto; margin-right: auto; border: none;&amp;quot;&lt;br /&gt;
|+ Which of the Kyotronic-85 Sisters use this format&lt;br /&gt;
! title=&amp;quot;Name of the manufacturer and computer model&amp;quot; | Computer Model&lt;br /&gt;
! title=&amp;quot;Whether the tokenization is the same as for the Tandy 200&amp;quot; | Uses Tandy 200 Tokenization?&lt;br /&gt;
|- style=text-align:center&lt;br /&gt;
|Kyocera Kyotronic-85&amp;lt;br/&amp;gt;Olivetti M10&amp;lt;br/&amp;gt;TRS-80 Model 100&amp;lt;br/&amp;gt;Tandy 200&amp;lt;br/&amp;gt;Tandy 102||Yes&lt;br /&gt;
|- style=text-align:center&lt;br /&gt;
| NEC PC-8201 &amp;lt;br/&amp;gt; NEC PC-8201A &amp;lt;br/&amp;gt; NEC PC-8300 || No&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
While the NEC PC-8201/8300 format is not the same, the BASIC it runs (N82 BASIC) is very close and it is expected the tokenization will be similar.&lt;br /&gt;
&lt;br /&gt;
== Tokens ==&lt;br /&gt;
All BASIC tokens on the Tandy 200 are a single byte with a value from 128 to 255. &lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+ Table mapping token values to BASIC keywords&lt;br /&gt;
! title=&amp;quot;The value of the token in hexadecimal&amp;quot; | Hex&lt;br /&gt;
! title=&amp;quot;The value of the token in decimal&amp;quot; | Dec&lt;br /&gt;
! title=&amp;quot;The BASIC keyword the token stands for&amp;quot; | Keyword &lt;br /&gt;
! title=&amp;quot;Miscellany&amp;quot; | Notes&lt;br /&gt;
|-&lt;br /&gt;
|-&lt;br /&gt;
|80||128||END&lt;br /&gt;
|-&lt;br /&gt;
|81||129||FOR&lt;br /&gt;
|-&lt;br /&gt;
|82||130||NEXT&lt;br /&gt;
|-&lt;br /&gt;
|83||131||DATA&lt;br /&gt;
|-&lt;br /&gt;
|84||132||INPUT&lt;br /&gt;
|-&lt;br /&gt;
|85||133||DIM&lt;br /&gt;
|-&lt;br /&gt;
|86||134||READ&lt;br /&gt;
|-&lt;br /&gt;
|87||135||LET&lt;br /&gt;
|-&lt;br /&gt;
|88||136||GOTO&lt;br /&gt;
|-&lt;br /&gt;
|89||137||RUN&lt;br /&gt;
|-&lt;br /&gt;
|8A||138||IF&lt;br /&gt;
|-&lt;br /&gt;
|8B||139||RESTORE&lt;br /&gt;
|-&lt;br /&gt;
|8C||140||GOSUB&lt;br /&gt;
|-&lt;br /&gt;
|8D||141||RETURN&lt;br /&gt;
|-&lt;br /&gt;
|8E||142||REM&lt;br /&gt;
|-&lt;br /&gt;
|8F||143||STOP&lt;br /&gt;
|-&lt;br /&gt;
|90||144||WIDTH&lt;br /&gt;
|-&lt;br /&gt;
|91||145||ELSE||When tokenizing, the Tandy 200 always adds a colon (':') before the ELSE token (3A 91). If the user actually writes :ELSE it is tokenized as 3A 3A 91.&lt;br /&gt;
|-&lt;br /&gt;
|92||146||LINE&lt;br /&gt;
|-&lt;br /&gt;
|93||147||EDIT&lt;br /&gt;
|-&lt;br /&gt;
|94||148||ERROR&lt;br /&gt;
|-&lt;br /&gt;
|95||149||RESUME&lt;br /&gt;
|-&lt;br /&gt;
|96||150||OUT&lt;br /&gt;
|-&lt;br /&gt;
|97||151||ON&lt;br /&gt;
|-&lt;br /&gt;
|98||152||DSKO$&lt;br /&gt;
|-&lt;br /&gt;
|99||153||OPEN&lt;br /&gt;
|-&lt;br /&gt;
|9A||154||CLOSE&lt;br /&gt;
|-&lt;br /&gt;
|9B||155||LOAD||Note that LOADM is simply the token for LOAD followed by an ASCII 'M'. &lt;br /&gt;
|-&lt;br /&gt;
|9C||156||MERGE&lt;br /&gt;
|-QUOTE&lt;br /&gt;
|9D||157||FILES&lt;br /&gt;
|-&lt;br /&gt;
|9E||158||SAVE&lt;br /&gt;
|-&lt;br /&gt;
|9F||159||LFILES&lt;br /&gt;
|-&lt;br /&gt;
|A0||160||LPRINT&lt;br /&gt;
|-&lt;br /&gt;
|A1||161||DEF&lt;br /&gt;
|-&lt;br /&gt;
|A2||162||POKE&lt;br /&gt;
|-&lt;br /&gt;
|A3||163||PRINT&lt;br /&gt;
|-&lt;br /&gt;
|A4||164||CONT&lt;br /&gt;
|-&lt;br /&gt;
|A5||165||LIST&lt;br /&gt;
|-&lt;br /&gt;
|A6||166||LLIST&lt;br /&gt;
|-&lt;br /&gt;
|A7||167||CLEAR&lt;br /&gt;
|-&lt;br /&gt;
|A8||168||CLOAD&lt;br /&gt;
|-&lt;br /&gt;
|A9||169||CSAVE&lt;br /&gt;
|-&lt;br /&gt;
|AA||170||TIME$&lt;br /&gt;
|-&lt;br /&gt;
|AB||171||DATE$&lt;br /&gt;
|-&lt;br /&gt;
|AC||172||DAY$&lt;br /&gt;
|-&lt;br /&gt;
|AD||173||COM&lt;br /&gt;
|-&lt;br /&gt;
|AE||174||MDM&lt;br /&gt;
|-&lt;br /&gt;
|AF||175||KEY&lt;br /&gt;
|-&lt;br /&gt;
|B0||176||CLS&lt;br /&gt;
|-&lt;br /&gt;
|B1||177||BEEP&lt;br /&gt;
|-&lt;br /&gt;
|B2||178||SOUND&lt;br /&gt;
|-&lt;br /&gt;
|B3||179||LCOPY&lt;br /&gt;
|-&lt;br /&gt;
|B4||180||PSET&lt;br /&gt;
|-&lt;br /&gt;
|B5||181||PRESET&lt;br /&gt;
|-&lt;br /&gt;
|B6||182||MOTOR&lt;br /&gt;
|-&lt;br /&gt;
|B7||183||MAX&lt;br /&gt;
|-&lt;br /&gt;
|B8||184||POWER&lt;br /&gt;
|-&lt;br /&gt;
|B9||185||CALL&lt;br /&gt;
|-&lt;br /&gt;
|BA||186||MENU&lt;br /&gt;
|-&lt;br /&gt;
|BB||187||IPL&lt;br /&gt;
|-&lt;br /&gt;
|BC||188||NAME&lt;br /&gt;
|-&lt;br /&gt;
|BD||189||KILL&lt;br /&gt;
|-&lt;br /&gt;
|BE||190||SCREEN&lt;br /&gt;
|-&lt;br /&gt;
|BF||191||NEW&lt;br /&gt;
|-&lt;br /&gt;
|C0||192||TAB(&lt;br /&gt;
|-&lt;br /&gt;
|C1||193||TO&lt;br /&gt;
|-&lt;br /&gt;
|C2||194||USING&lt;br /&gt;
|-&lt;br /&gt;
|C3||195||VARPTR&lt;br /&gt;
|-&lt;br /&gt;
|C4||196||ERL&lt;br /&gt;
|-&lt;br /&gt;
|C5||197||ERR&lt;br /&gt;
|-&lt;br /&gt;
|C6||198||STRING$&lt;br /&gt;
|-&lt;br /&gt;
|C7||199||INSTR&lt;br /&gt;
|-&lt;br /&gt;
|C8||200||DSKI$&lt;br /&gt;
|-&lt;br /&gt;
|C9||201||INKEY$&lt;br /&gt;
|-&lt;br /&gt;
|CA||202||CSRLIN&lt;br /&gt;
|-&lt;br /&gt;
|CB||203||OFF&lt;br /&gt;
|-&lt;br /&gt;
|CC||204||HIMEM&lt;br /&gt;
|-&lt;br /&gt;
|CD||205||THEN&lt;br /&gt;
|-&lt;br /&gt;
|CE||206||NOT&lt;br /&gt;
|-&lt;br /&gt;
|CF||207||STEP&lt;br /&gt;
|-&lt;br /&gt;
|D0||208||+&lt;br /&gt;
|-&lt;br /&gt;
|D1||209||-&lt;br /&gt;
|-&lt;br /&gt;
|D2||210||*&lt;br /&gt;
|-&lt;br /&gt;
|D3||211||/&lt;br /&gt;
|-&lt;br /&gt;
|D4||212||^&lt;br /&gt;
|-&lt;br /&gt;
|D5||213||AND&lt;br /&gt;
|-&lt;br /&gt;
|D6||214||OR&lt;br /&gt;
|-&lt;br /&gt;
|D7||215||XOR&lt;br /&gt;
|-&lt;br /&gt;
|D8||216||EQV&lt;br /&gt;
|-&lt;br /&gt;
|D9||217||IMP&lt;br /&gt;
|-&lt;br /&gt;
|DA||218||MOD&lt;br /&gt;
|-&lt;br /&gt;
|DB||219||\&lt;br /&gt;
|-&lt;br /&gt;
|DC||220||&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|DD||221||=&lt;br /&gt;
|-&lt;br /&gt;
|DE||222||&amp;lt;&lt;br /&gt;
|-&lt;br /&gt;
|DF||223||SGN&lt;br /&gt;
|-&lt;br /&gt;
|E0||224||INT&lt;br /&gt;
|-&lt;br /&gt;
|E1||225||ABS&lt;br /&gt;
|-&lt;br /&gt;
|E2||226||FRE&lt;br /&gt;
|-&lt;br /&gt;
|E3||227||INP&lt;br /&gt;
|-&lt;br /&gt;
|E4||228||LPOS&lt;br /&gt;
|-&lt;br /&gt;
|E5||229||POS&lt;br /&gt;
|-&lt;br /&gt;
|E6||230||SQR&lt;br /&gt;
|-&lt;br /&gt;
|E7||231||RND&lt;br /&gt;
|-&lt;br /&gt;
|E8||232||LOG&lt;br /&gt;
|-&lt;br /&gt;
|E9||233||EXP&lt;br /&gt;
|-&lt;br /&gt;
|EA||234||COS&lt;br /&gt;
|-&lt;br /&gt;
|EB||235||SIN&lt;br /&gt;
|-&lt;br /&gt;
|EC||236||TAN&lt;br /&gt;
|-&lt;br /&gt;
|ED||237||ATN&lt;br /&gt;
|-&lt;br /&gt;
|EE||238||PEEK&lt;br /&gt;
|-&lt;br /&gt;
|EF||239||EOF&lt;br /&gt;
|-&lt;br /&gt;
|F0||240||LOC&lt;br /&gt;
|-&lt;br /&gt;
|F1||241||LOF&lt;br /&gt;
|-&lt;br /&gt;
|F2||242||CINT&lt;br /&gt;
|-&lt;br /&gt;
|F3||243||CSNG&lt;br /&gt;
|-&lt;br /&gt;
|F4||244||CDBL&lt;br /&gt;
|-&lt;br /&gt;
|F5||245||FIX&lt;br /&gt;
|-&lt;br /&gt;
|F6||246||LEN&lt;br /&gt;
|-&lt;br /&gt;
|F7||247||STR$&lt;br /&gt;
|-&lt;br /&gt;
|F8||248||VAL&lt;br /&gt;
|-&lt;br /&gt;
|F9||249||ASC&lt;br /&gt;
|-&lt;br /&gt;
|FA||250||CHR$&lt;br /&gt;
|-&lt;br /&gt;
|FB||251||SPACE$&lt;br /&gt;
|-&lt;br /&gt;
|FC||252||LEFT$&lt;br /&gt;
|-&lt;br /&gt;
|FD||253||RIGHT$&lt;br /&gt;
|-&lt;br /&gt;
|FE||254||MID$&lt;br /&gt;
|-&lt;br /&gt;
|FF||255||' (QUOTE) || When tokenizing, the single quote character expands to three characters: a colon (3A), the byte for REM (8E), and then FF.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== File Format ==&lt;br /&gt;
&lt;br /&gt;
Tokenised BASIC code is a sequence of tokenized lines. Each tokenized line has the following format:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+ Format of a single tokenized line&lt;br /&gt;
!Name!!Length!!Description&lt;br /&gt;
|-&lt;br /&gt;
|PL PH&lt;br /&gt;
|2 bytes&lt;br /&gt;
|Address in RAM of the next line of BASIC; unsigned 16-bit integer, little-endian. In a file, PL PH is merely a placeholder and the value is never used. In RAM, PL PH == 0 marks the end of the tokenized BASIC listing. (See [[#Details for PL PH]].)&lt;br /&gt;
|-&lt;br /&gt;
|LL LH&lt;br /&gt;
|2 bytes&lt;br /&gt;
|Line number; unsigned 16-bit integer, little-endian.&lt;br /&gt;
|-&lt;br /&gt;
|B&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt; … B&amp;lt;sub&amp;gt;n&amp;lt;/sub&amp;gt;&lt;br /&gt;
|Any number of bytes&lt;br /&gt;
|Depending on the high bit, each byte is either a token or an ASCII character. &lt;br /&gt;
|-&lt;br /&gt;
|NULL&lt;br /&gt;
|1 byte&lt;br /&gt;
|NULL byte (&amp;lt;code&amp;gt;0x00&amp;lt;/code&amp;gt;) to signal end of line. &lt;br /&gt;
|}&lt;br /&gt;
              &lt;br /&gt;
Typically, the list of tokenized lines continues until the end of the file. Once a program is loaded into RAM, the end is signaled by two consecutive NULLs in the location where PL PH would normally start the next line.&lt;br /&gt;
&lt;br /&gt;
=== Limits ===&lt;br /&gt;
&lt;br /&gt;
* Line numbers can range from 0 to 65529 (but see variances below).&lt;br /&gt;
* Tokenized line length is limited to 256 characters, including the trailing NULL byte. (To do: double check this.)&lt;br /&gt;
&lt;br /&gt;
=== Acceptable variances ===&lt;br /&gt;
&lt;br /&gt;
While Tandy BASIC will never generate such files, it has no problem loading a tokenized program that:&lt;br /&gt;
&lt;br /&gt;
* Has line numbers out of order; the numerical value of a line number is ignored. Program lines are always LISTed and RUN in the order they appear in the tokenized file.&lt;br /&gt;
* Contains duplicate line numbers; all lines are kept and run in the order found in the file. (GOTO is complicated as search starts at the next line, not the beginning of the program.)&lt;br /&gt;
* Contains a line with zero bytes of data; LIST will show the line number with no text afterward. Does not replace or delete a preexisting line with that number.&lt;br /&gt;
* Contains arbitrary bytes for PL PH; the value of PL PH is always recalculated at LOAD time.&lt;br /&gt;
* Contains line numbers greater than the nominal maximum of 65529; this can be used to store hidden binary data [https://www.mail-archive.com/m100@lists.bitchin100.com/msg16195.html according to John R. Hogerhuis].&lt;br /&gt;
&lt;br /&gt;
''Sidenote'': while these variances are accepted by actual hardware, emulators may not be able to handle such files. For example, [https://sourceforge.net/projects/virtualt/ Virtual T] (as of version 1.7 in 2022) refuses to load tokenized BASIC programs that have lines out of order, duplicate lines, or bogus values for PL PH.&lt;br /&gt;
&lt;br /&gt;
=== Details for PL PH ===&lt;br /&gt;
&lt;br /&gt;
In a file, the specific values of the 16-bit integer PL PH are never used. During program load, Tandy BASIC recalculates PL PH before storing it into RAM. Once in memory, PL PH is used to skip to the line required for GOTO, GOSUB, and READ, thus speeding up the program. Additionally, the end of a tokenized BASIC listing in RAM is marked by PL PH equal to zero (two NULL bytes). &lt;br /&gt;
&lt;br /&gt;
(Stub. This is where Tandy BASIC's calculation of PL PH values will go.)&lt;br /&gt;
&lt;br /&gt;
== Format documentation ==&lt;br /&gt;
&lt;br /&gt;
* [https://m100.bitchin100.narkive.com/eP2uSl4J/tokenized-basic-programs-bytes-of-mystery Discussion of byte format on Bitchin 100 Mailing List]&lt;br /&gt;
* [http://www.club100.org/library/ups/tokens.do BASIC program to create a table of tokens]&lt;br /&gt;
* [https://archive.org/details/HiddenPowersOfTheTrs80Model100/page/n229/mode/2up?view=theater Hidden Powers of the TRS 80 Model 100]. Appendix B lists the BASIC token values for the Model 100. Other than the omission of 255 for a single quote remark, this reference matches what hackerb9 found programmatically for the Tandy 200.&lt;br /&gt;
* [http://web.archive.org/web/20220324135218/https://help.ayra.ch/trs80-reference#trs-80-model-100-basic-reference Ayra Model 100 BASIC Reference]&lt;br /&gt;
&lt;br /&gt;
== Other links ==&lt;br /&gt;
&lt;br /&gt;
* [https://github.com/hackerb9/tokenize/ Hackerb9's C program for tokenizing BASIC code]&lt;br /&gt;
* [https://sourceforge.net/projects/virtualt/ A Tandy 200 &amp;amp; Model 100/102 emulator]&lt;br /&gt;
* [http://bitchin100.com/CloudT/ A TRS-80 Model 100 emulator that runs in a web browser]&lt;br /&gt;
&lt;br /&gt;
[[Category:Microsoft]]&lt;/div&gt;</summary>
		<author><name>Hackerb9</name></author>	</entry>

	<entry>
		<id>http://fileformats.archiveteam.org/wiki/Tandy_200_BASIC_tokenized_file</id>
		<title>Tandy 200 BASIC tokenized file</title>
		<link rel="alternate" type="text/html" href="http://fileformats.archiveteam.org/wiki/Tandy_200_BASIC_tokenized_file"/>
				<updated>2022-10-06T03:36:50Z</updated>
		
		<summary type="html">&lt;p&gt;Hackerb9: /* Other links */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{FormatInfo&lt;br /&gt;
|subcat=Source code&lt;br /&gt;
|subcat2=Tokenized BASIC&lt;br /&gt;
|released=1984&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
'''Tandy 200 BASIC''' was a version of Microsoft BASIC for the Radio Shack Tandy 200 computer. The tokenizations for the TRS-80 Model 100 and Tandy 102 appear to be identical. The NEC PC-8201/8300 format is not the same, but should be similar.&lt;br /&gt;
&lt;br /&gt;
== Tokens ==&lt;br /&gt;
All BASIC tokens on the Tandy 200 are a single byte with a value from 128 to 255. &lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+ Table mapping token values to BASIC keywords&lt;br /&gt;
! title=&amp;quot;The value of the token in hexadecimal&amp;quot; | Hex&lt;br /&gt;
! title=&amp;quot;The value of the token in decimal&amp;quot; | Dec&lt;br /&gt;
! title=&amp;quot;The BASIC keyword the token stands for&amp;quot; | Keyword &lt;br /&gt;
! title=&amp;quot;Miscellany&amp;quot; | Notes&lt;br /&gt;
|-&lt;br /&gt;
|-&lt;br /&gt;
|80||128||END&lt;br /&gt;
|-&lt;br /&gt;
|81||129||FOR&lt;br /&gt;
|-&lt;br /&gt;
|82||130||NEXT&lt;br /&gt;
|-&lt;br /&gt;
|83||131||DATA&lt;br /&gt;
|-&lt;br /&gt;
|84||132||INPUT&lt;br /&gt;
|-&lt;br /&gt;
|85||133||DIM&lt;br /&gt;
|-&lt;br /&gt;
|86||134||READ&lt;br /&gt;
|-&lt;br /&gt;
|87||135||LET&lt;br /&gt;
|-&lt;br /&gt;
|88||136||GOTO&lt;br /&gt;
|-&lt;br /&gt;
|89||137||RUN&lt;br /&gt;
|-&lt;br /&gt;
|8A||138||IF&lt;br /&gt;
|-&lt;br /&gt;
|8B||139||RESTORE&lt;br /&gt;
|-&lt;br /&gt;
|8C||140||GOSUB&lt;br /&gt;
|-&lt;br /&gt;
|8D||141||RETURN&lt;br /&gt;
|-&lt;br /&gt;
|8E||142||REM&lt;br /&gt;
|-&lt;br /&gt;
|8F||143||STOP&lt;br /&gt;
|-&lt;br /&gt;
|90||144||WIDTH&lt;br /&gt;
|-&lt;br /&gt;
|91||145||ELSE||When tokenizing, the Tandy 200 always adds a colon (':') before the ELSE token (3A 91). If the user actually writes :ELSE it is tokenized as 3A 3A 91.&lt;br /&gt;
|-&lt;br /&gt;
|92||146||LINE&lt;br /&gt;
|-&lt;br /&gt;
|93||147||EDIT&lt;br /&gt;
|-&lt;br /&gt;
|94||148||ERROR&lt;br /&gt;
|-&lt;br /&gt;
|95||149||RESUME&lt;br /&gt;
|-&lt;br /&gt;
|96||150||OUT&lt;br /&gt;
|-&lt;br /&gt;
|97||151||ON&lt;br /&gt;
|-&lt;br /&gt;
|98||152||DSKO$&lt;br /&gt;
|-&lt;br /&gt;
|99||153||OPEN&lt;br /&gt;
|-&lt;br /&gt;
|9A||154||CLOSE&lt;br /&gt;
|-&lt;br /&gt;
|9B||155||LOAD||Note that LOADM is simply the token for LOAD followed by an ASCII 'M'. &lt;br /&gt;
|-&lt;br /&gt;
|9C||156||MERGE&lt;br /&gt;
|-QUOTE&lt;br /&gt;
|9D||157||FILES&lt;br /&gt;
|-&lt;br /&gt;
|9E||158||SAVE&lt;br /&gt;
|-&lt;br /&gt;
|9F||159||LFILES&lt;br /&gt;
|-&lt;br /&gt;
|A0||160||LPRINT&lt;br /&gt;
|-&lt;br /&gt;
|A1||161||DEF&lt;br /&gt;
|-&lt;br /&gt;
|A2||162||POKE&lt;br /&gt;
|-&lt;br /&gt;
|A3||163||PRINT&lt;br /&gt;
|-&lt;br /&gt;
|A4||164||CONT&lt;br /&gt;
|-&lt;br /&gt;
|A5||165||LIST&lt;br /&gt;
|-&lt;br /&gt;
|A6||166||LLIST&lt;br /&gt;
|-&lt;br /&gt;
|A7||167||CLEAR&lt;br /&gt;
|-&lt;br /&gt;
|A8||168||CLOAD&lt;br /&gt;
|-&lt;br /&gt;
|A9||169||CSAVE&lt;br /&gt;
|-&lt;br /&gt;
|AA||170||TIME$&lt;br /&gt;
|-&lt;br /&gt;
|AB||171||DATE$&lt;br /&gt;
|-&lt;br /&gt;
|AC||172||DAY$&lt;br /&gt;
|-&lt;br /&gt;
|AD||173||COM&lt;br /&gt;
|-&lt;br /&gt;
|AE||174||MDM&lt;br /&gt;
|-&lt;br /&gt;
|AF||175||KEY&lt;br /&gt;
|-&lt;br /&gt;
|B0||176||CLS&lt;br /&gt;
|-&lt;br /&gt;
|B1||177||BEEP&lt;br /&gt;
|-&lt;br /&gt;
|B2||178||SOUND&lt;br /&gt;
|-&lt;br /&gt;
|B3||179||LCOPY&lt;br /&gt;
|-&lt;br /&gt;
|B4||180||PSET&lt;br /&gt;
|-&lt;br /&gt;
|B5||181||PRESET&lt;br /&gt;
|-&lt;br /&gt;
|B6||182||MOTOR&lt;br /&gt;
|-&lt;br /&gt;
|B7||183||MAX&lt;br /&gt;
|-&lt;br /&gt;
|B8||184||POWER&lt;br /&gt;
|-&lt;br /&gt;
|B9||185||CALL&lt;br /&gt;
|-&lt;br /&gt;
|BA||186||MENU&lt;br /&gt;
|-&lt;br /&gt;
|BB||187||IPL&lt;br /&gt;
|-&lt;br /&gt;
|BC||188||NAME&lt;br /&gt;
|-&lt;br /&gt;
|BD||189||KILL&lt;br /&gt;
|-&lt;br /&gt;
|BE||190||SCREEN&lt;br /&gt;
|-&lt;br /&gt;
|BF||191||NEW&lt;br /&gt;
|-&lt;br /&gt;
|C0||192||TAB(&lt;br /&gt;
|-&lt;br /&gt;
|C1||193||TO&lt;br /&gt;
|-&lt;br /&gt;
|C2||194||USING&lt;br /&gt;
|-&lt;br /&gt;
|C3||195||VARPTR&lt;br /&gt;
|-&lt;br /&gt;
|C4||196||ERL&lt;br /&gt;
|-&lt;br /&gt;
|C5||197||ERR&lt;br /&gt;
|-&lt;br /&gt;
|C6||198||STRING$&lt;br /&gt;
|-&lt;br /&gt;
|C7||199||INSTR&lt;br /&gt;
|-&lt;br /&gt;
|C8||200||DSKI$&lt;br /&gt;
|-&lt;br /&gt;
|C9||201||INKEY$&lt;br /&gt;
|-&lt;br /&gt;
|CA||202||CSRLIN&lt;br /&gt;
|-&lt;br /&gt;
|CB||203||OFF&lt;br /&gt;
|-&lt;br /&gt;
|CC||204||HIMEM&lt;br /&gt;
|-&lt;br /&gt;
|CD||205||THEN&lt;br /&gt;
|-&lt;br /&gt;
|CE||206||NOT&lt;br /&gt;
|-&lt;br /&gt;
|CF||207||STEP&lt;br /&gt;
|-&lt;br /&gt;
|D0||208||+&lt;br /&gt;
|-&lt;br /&gt;
|D1||209||-&lt;br /&gt;
|-&lt;br /&gt;
|D2||210||*&lt;br /&gt;
|-&lt;br /&gt;
|D3||211||/&lt;br /&gt;
|-&lt;br /&gt;
|D4||212||^&lt;br /&gt;
|-&lt;br /&gt;
|D5||213||AND&lt;br /&gt;
|-&lt;br /&gt;
|D6||214||OR&lt;br /&gt;
|-&lt;br /&gt;
|D7||215||XOR&lt;br /&gt;
|-&lt;br /&gt;
|D8||216||EQV&lt;br /&gt;
|-&lt;br /&gt;
|D9||217||IMP&lt;br /&gt;
|-&lt;br /&gt;
|DA||218||MOD&lt;br /&gt;
|-&lt;br /&gt;
|DB||219||\&lt;br /&gt;
|-&lt;br /&gt;
|DC||220||&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|DD||221||=&lt;br /&gt;
|-&lt;br /&gt;
|DE||222||&amp;lt;&lt;br /&gt;
|-&lt;br /&gt;
|DF||223||SGN&lt;br /&gt;
|-&lt;br /&gt;
|E0||224||INT&lt;br /&gt;
|-&lt;br /&gt;
|E1||225||ABS&lt;br /&gt;
|-&lt;br /&gt;
|E2||226||FRE&lt;br /&gt;
|-&lt;br /&gt;
|E3||227||INP&lt;br /&gt;
|-&lt;br /&gt;
|E4||228||LPOS&lt;br /&gt;
|-&lt;br /&gt;
|E5||229||POS&lt;br /&gt;
|-&lt;br /&gt;
|E6||230||SQR&lt;br /&gt;
|-&lt;br /&gt;
|E7||231||RND&lt;br /&gt;
|-&lt;br /&gt;
|E8||232||LOG&lt;br /&gt;
|-&lt;br /&gt;
|E9||233||EXP&lt;br /&gt;
|-&lt;br /&gt;
|EA||234||COS&lt;br /&gt;
|-&lt;br /&gt;
|EB||235||SIN&lt;br /&gt;
|-&lt;br /&gt;
|EC||236||TAN&lt;br /&gt;
|-&lt;br /&gt;
|ED||237||ATN&lt;br /&gt;
|-&lt;br /&gt;
|EE||238||PEEK&lt;br /&gt;
|-&lt;br /&gt;
|EF||239||EOF&lt;br /&gt;
|-&lt;br /&gt;
|F0||240||LOC&lt;br /&gt;
|-&lt;br /&gt;
|F1||241||LOF&lt;br /&gt;
|-&lt;br /&gt;
|F2||242||CINT&lt;br /&gt;
|-&lt;br /&gt;
|F3||243||CSNG&lt;br /&gt;
|-&lt;br /&gt;
|F4||244||CDBL&lt;br /&gt;
|-&lt;br /&gt;
|F5||245||FIX&lt;br /&gt;
|-&lt;br /&gt;
|F6||246||LEN&lt;br /&gt;
|-&lt;br /&gt;
|F7||247||STR$&lt;br /&gt;
|-&lt;br /&gt;
|F8||248||VAL&lt;br /&gt;
|-&lt;br /&gt;
|F9||249||ASC&lt;br /&gt;
|-&lt;br /&gt;
|FA||250||CHR$&lt;br /&gt;
|-&lt;br /&gt;
|FB||251||SPACE$&lt;br /&gt;
|-&lt;br /&gt;
|FC||252||LEFT$&lt;br /&gt;
|-&lt;br /&gt;
|FD||253||RIGHT$&lt;br /&gt;
|-&lt;br /&gt;
|FE||254||MID$&lt;br /&gt;
|-&lt;br /&gt;
|FF||255||' (QUOTE) || When tokenizing, the single quote character expands to three characters: a colon (3A), the byte for REM (8E), and then FF.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== File Format ==&lt;br /&gt;
&lt;br /&gt;
Tokenised BASIC code is a sequence of tokenized lines. Each tokenized line has the following format:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+ Format of a single tokenized line&lt;br /&gt;
!Name!!Length!!Description&lt;br /&gt;
|-&lt;br /&gt;
|PL PH&lt;br /&gt;
|2 bytes&lt;br /&gt;
|Address in RAM of the next line of BASIC; unsigned 16-bit integer, little-endian. In a file, PL PH is merely a placeholder and the value is never used. In RAM, PL PH == 0 marks the end of the tokenized BASIC listing. (See [[#Details for PL PH]].)&lt;br /&gt;
|-&lt;br /&gt;
|LL LH&lt;br /&gt;
|2 bytes&lt;br /&gt;
|Line number; unsigned 16-bit integer, little-endian.&lt;br /&gt;
|-&lt;br /&gt;
|B&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt; … B&amp;lt;sub&amp;gt;n&amp;lt;/sub&amp;gt;&lt;br /&gt;
|Any number of bytes&lt;br /&gt;
|Depending on the high bit, each byte is either a token or an ASCII character. &lt;br /&gt;
|-&lt;br /&gt;
|NULL&lt;br /&gt;
|1 byte&lt;br /&gt;
|NULL byte (&amp;lt;code&amp;gt;0x00&amp;lt;/code&amp;gt;) to signal end of line. &lt;br /&gt;
|}&lt;br /&gt;
              &lt;br /&gt;
Typically, the list of tokenized lines continues until the end of the file. Once a program is loaded into RAM, the end is signaled by two consecutive NULLs in the location where PL PH would normally start the next line.&lt;br /&gt;
&lt;br /&gt;
=== Limits ===&lt;br /&gt;
&lt;br /&gt;
* Line numbers can range from 0 to 65529 (but see variances below).&lt;br /&gt;
* Tokenized line length is limited to 256 characters, including the trailing NULL byte. (To do: double check this.)&lt;br /&gt;
&lt;br /&gt;
=== Acceptable variances ===&lt;br /&gt;
&lt;br /&gt;
While Tandy BASIC will never generate such files, it has no problem loading a tokenized program that:&lt;br /&gt;
&lt;br /&gt;
* Has line numbers out of order; the numerical value of a line number is ignored. Program lines are always LISTed and RUN in the order they appear in the tokenized file.&lt;br /&gt;
* Contains duplicate line numbers; all lines are kept and run in the order found in the file. (GOTO is complicated as search starts at the next line, not the beginning of the program.)&lt;br /&gt;
* Contains a line with zero bytes of data; LIST will show the line number with no text afterward. Does not replace or delete a preexisting line with that number.&lt;br /&gt;
* Contains arbitrary bytes for PL PH; the value of PL PH is always recalculated at LOAD time.&lt;br /&gt;
* Contains line numbers greater than the nominal maximum of 65529; this can be used to store hidden binary data [https://www.mail-archive.com/m100@lists.bitchin100.com/msg16195.html according to John R. Hogerhuis].&lt;br /&gt;
&lt;br /&gt;
''Sidenote'': while these variances are accepted by actual hardware, emulators may not be able to handle such files. For example, [https://sourceforge.net/projects/virtualt/ Virtual T] (as of version 1.7 in 2022) refuses to load tokenized BASIC programs that have lines out of order, duplicate lines, or bogus values for PL PH.&lt;br /&gt;
&lt;br /&gt;
=== Details for PL PH ===&lt;br /&gt;
&lt;br /&gt;
In a file, the specific values of the 16-bit integer PL PH are never used. During program load, Tandy BASIC recalculates PL PH before storing it into RAM. Once in memory, PL PH is used to skip to the line required for GOTO, GOSUB, and READ, thus speeding up the program. Additionally, the end of a tokenized BASIC listing in RAM is marked by PL PH equal to zero (two NULL bytes). &lt;br /&gt;
&lt;br /&gt;
(Stub. This is where Tandy BASIC's calculation of PL PH values will go.)&lt;br /&gt;
&lt;br /&gt;
== Format documentation ==&lt;br /&gt;
&lt;br /&gt;
* [https://m100.bitchin100.narkive.com/eP2uSl4J/tokenized-basic-programs-bytes-of-mystery Discussion of byte format on Bitchin 100 Mailing List]&lt;br /&gt;
* [http://www.club100.org/library/ups/tokens.do BASIC program to create a table of tokens]&lt;br /&gt;
* [https://archive.org/details/HiddenPowersOfTheTrs80Model100/page/n229/mode/2up?view=theater Hidden Powers of the TRS 80 Model 100]. Appendix B lists the BASIC token values for the Model 100. Other than the omission of 255 for a single quote remark, this reference matches what hackerb9 found programmatically for the Tandy 200.&lt;br /&gt;
* [http://web.archive.org/web/20220324135218/https://help.ayra.ch/trs80-reference#trs-80-model-100-basic-reference Ayra Model 100 BASIC Reference]&lt;br /&gt;
&lt;br /&gt;
== Other links ==&lt;br /&gt;
&lt;br /&gt;
* [https://github.com/hackerb9/tokenize/ Hackerb9's C program for tokenizing BASIC code]&lt;br /&gt;
* [https://sourceforge.net/projects/virtualt/ A Tandy 200 &amp;amp; Model 100/102 emulator]&lt;br /&gt;
* [http://bitchin100.com/CloudT/ A TRS-80 Model 100 emulator that runs in a web browser]&lt;br /&gt;
&lt;br /&gt;
[[Category:Microsoft]]&lt;/div&gt;</summary>
		<author><name>Hackerb9</name></author>	</entry>

	<entry>
		<id>http://fileformats.archiveteam.org/wiki/Tandy_200_BASIC_tokenized_file</id>
		<title>Tandy 200 BASIC tokenized file</title>
		<link rel="alternate" type="text/html" href="http://fileformats.archiveteam.org/wiki/Tandy_200_BASIC_tokenized_file"/>
				<updated>2022-10-06T00:24:45Z</updated>
		
		<summary type="html">&lt;p&gt;Hackerb9: /* Details for PL PH */ grammar&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{FormatInfo&lt;br /&gt;
|subcat=Source code&lt;br /&gt;
|subcat2=Tokenized BASIC&lt;br /&gt;
|released=1984&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
'''Tandy 200 BASIC''' was a version of Microsoft BASIC for the Radio Shack Tandy 200 computer. The tokenizations for the TRS-80 Model 100 and Tandy 102 appear to be identical. The NEC PC-8201/8300 format is not the same, but should be similar.&lt;br /&gt;
&lt;br /&gt;
== Tokens ==&lt;br /&gt;
All BASIC tokens on the Tandy 200 are a single byte with a value from 128 to 255. &lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+ Table mapping token values to BASIC keywords&lt;br /&gt;
! title=&amp;quot;The value of the token in hexadecimal&amp;quot; | Hex&lt;br /&gt;
! title=&amp;quot;The value of the token in decimal&amp;quot; | Dec&lt;br /&gt;
! title=&amp;quot;The BASIC keyword the token stands for&amp;quot; | Keyword &lt;br /&gt;
! title=&amp;quot;Miscellany&amp;quot; | Notes&lt;br /&gt;
|-&lt;br /&gt;
|-&lt;br /&gt;
|80||128||END&lt;br /&gt;
|-&lt;br /&gt;
|81||129||FOR&lt;br /&gt;
|-&lt;br /&gt;
|82||130||NEXT&lt;br /&gt;
|-&lt;br /&gt;
|83||131||DATA&lt;br /&gt;
|-&lt;br /&gt;
|84||132||INPUT&lt;br /&gt;
|-&lt;br /&gt;
|85||133||DIM&lt;br /&gt;
|-&lt;br /&gt;
|86||134||READ&lt;br /&gt;
|-&lt;br /&gt;
|87||135||LET&lt;br /&gt;
|-&lt;br /&gt;
|88||136||GOTO&lt;br /&gt;
|-&lt;br /&gt;
|89||137||RUN&lt;br /&gt;
|-&lt;br /&gt;
|8A||138||IF&lt;br /&gt;
|-&lt;br /&gt;
|8B||139||RESTORE&lt;br /&gt;
|-&lt;br /&gt;
|8C||140||GOSUB&lt;br /&gt;
|-&lt;br /&gt;
|8D||141||RETURN&lt;br /&gt;
|-&lt;br /&gt;
|8E||142||REM&lt;br /&gt;
|-&lt;br /&gt;
|8F||143||STOP&lt;br /&gt;
|-&lt;br /&gt;
|90||144||WIDTH&lt;br /&gt;
|-&lt;br /&gt;
|91||145||ELSE||When tokenizing, the Tandy 200 always adds a colon (':') before the ELSE token (3A 91). If the user actually writes :ELSE it is tokenized as 3A 3A 91.&lt;br /&gt;
|-&lt;br /&gt;
|92||146||LINE&lt;br /&gt;
|-&lt;br /&gt;
|93||147||EDIT&lt;br /&gt;
|-&lt;br /&gt;
|94||148||ERROR&lt;br /&gt;
|-&lt;br /&gt;
|95||149||RESUME&lt;br /&gt;
|-&lt;br /&gt;
|96||150||OUT&lt;br /&gt;
|-&lt;br /&gt;
|97||151||ON&lt;br /&gt;
|-&lt;br /&gt;
|98||152||DSKO$&lt;br /&gt;
|-&lt;br /&gt;
|99||153||OPEN&lt;br /&gt;
|-&lt;br /&gt;
|9A||154||CLOSE&lt;br /&gt;
|-&lt;br /&gt;
|9B||155||LOAD||Note that LOADM is simply the token for LOAD followed by an ASCII 'M'. &lt;br /&gt;
|-&lt;br /&gt;
|9C||156||MERGE&lt;br /&gt;
|-QUOTE&lt;br /&gt;
|9D||157||FILES&lt;br /&gt;
|-&lt;br /&gt;
|9E||158||SAVE&lt;br /&gt;
|-&lt;br /&gt;
|9F||159||LFILES&lt;br /&gt;
|-&lt;br /&gt;
|A0||160||LPRINT&lt;br /&gt;
|-&lt;br /&gt;
|A1||161||DEF&lt;br /&gt;
|-&lt;br /&gt;
|A2||162||POKE&lt;br /&gt;
|-&lt;br /&gt;
|A3||163||PRINT&lt;br /&gt;
|-&lt;br /&gt;
|A4||164||CONT&lt;br /&gt;
|-&lt;br /&gt;
|A5||165||LIST&lt;br /&gt;
|-&lt;br /&gt;
|A6||166||LLIST&lt;br /&gt;
|-&lt;br /&gt;
|A7||167||CLEAR&lt;br /&gt;
|-&lt;br /&gt;
|A8||168||CLOAD&lt;br /&gt;
|-&lt;br /&gt;
|A9||169||CSAVE&lt;br /&gt;
|-&lt;br /&gt;
|AA||170||TIME$&lt;br /&gt;
|-&lt;br /&gt;
|AB||171||DATE$&lt;br /&gt;
|-&lt;br /&gt;
|AC||172||DAY$&lt;br /&gt;
|-&lt;br /&gt;
|AD||173||COM&lt;br /&gt;
|-&lt;br /&gt;
|AE||174||MDM&lt;br /&gt;
|-&lt;br /&gt;
|AF||175||KEY&lt;br /&gt;
|-&lt;br /&gt;
|B0||176||CLS&lt;br /&gt;
|-&lt;br /&gt;
|B1||177||BEEP&lt;br /&gt;
|-&lt;br /&gt;
|B2||178||SOUND&lt;br /&gt;
|-&lt;br /&gt;
|B3||179||LCOPY&lt;br /&gt;
|-&lt;br /&gt;
|B4||180||PSET&lt;br /&gt;
|-&lt;br /&gt;
|B5||181||PRESET&lt;br /&gt;
|-&lt;br /&gt;
|B6||182||MOTOR&lt;br /&gt;
|-&lt;br /&gt;
|B7||183||MAX&lt;br /&gt;
|-&lt;br /&gt;
|B8||184||POWER&lt;br /&gt;
|-&lt;br /&gt;
|B9||185||CALL&lt;br /&gt;
|-&lt;br /&gt;
|BA||186||MENU&lt;br /&gt;
|-&lt;br /&gt;
|BB||187||IPL&lt;br /&gt;
|-&lt;br /&gt;
|BC||188||NAME&lt;br /&gt;
|-&lt;br /&gt;
|BD||189||KILL&lt;br /&gt;
|-&lt;br /&gt;
|BE||190||SCREEN&lt;br /&gt;
|-&lt;br /&gt;
|BF||191||NEW&lt;br /&gt;
|-&lt;br /&gt;
|C0||192||TAB(&lt;br /&gt;
|-&lt;br /&gt;
|C1||193||TO&lt;br /&gt;
|-&lt;br /&gt;
|C2||194||USING&lt;br /&gt;
|-&lt;br /&gt;
|C3||195||VARPTR&lt;br /&gt;
|-&lt;br /&gt;
|C4||196||ERL&lt;br /&gt;
|-&lt;br /&gt;
|C5||197||ERR&lt;br /&gt;
|-&lt;br /&gt;
|C6||198||STRING$&lt;br /&gt;
|-&lt;br /&gt;
|C7||199||INSTR&lt;br /&gt;
|-&lt;br /&gt;
|C8||200||DSKI$&lt;br /&gt;
|-&lt;br /&gt;
|C9||201||INKEY$&lt;br /&gt;
|-&lt;br /&gt;
|CA||202||CSRLIN&lt;br /&gt;
|-&lt;br /&gt;
|CB||203||OFF&lt;br /&gt;
|-&lt;br /&gt;
|CC||204||HIMEM&lt;br /&gt;
|-&lt;br /&gt;
|CD||205||THEN&lt;br /&gt;
|-&lt;br /&gt;
|CE||206||NOT&lt;br /&gt;
|-&lt;br /&gt;
|CF||207||STEP&lt;br /&gt;
|-&lt;br /&gt;
|D0||208||+&lt;br /&gt;
|-&lt;br /&gt;
|D1||209||-&lt;br /&gt;
|-&lt;br /&gt;
|D2||210||*&lt;br /&gt;
|-&lt;br /&gt;
|D3||211||/&lt;br /&gt;
|-&lt;br /&gt;
|D4||212||^&lt;br /&gt;
|-&lt;br /&gt;
|D5||213||AND&lt;br /&gt;
|-&lt;br /&gt;
|D6||214||OR&lt;br /&gt;
|-&lt;br /&gt;
|D7||215||XOR&lt;br /&gt;
|-&lt;br /&gt;
|D8||216||EQV&lt;br /&gt;
|-&lt;br /&gt;
|D9||217||IMP&lt;br /&gt;
|-&lt;br /&gt;
|DA||218||MOD&lt;br /&gt;
|-&lt;br /&gt;
|DB||219||\&lt;br /&gt;
|-&lt;br /&gt;
|DC||220||&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|DD||221||=&lt;br /&gt;
|-&lt;br /&gt;
|DE||222||&amp;lt;&lt;br /&gt;
|-&lt;br /&gt;
|DF||223||SGN&lt;br /&gt;
|-&lt;br /&gt;
|E0||224||INT&lt;br /&gt;
|-&lt;br /&gt;
|E1||225||ABS&lt;br /&gt;
|-&lt;br /&gt;
|E2||226||FRE&lt;br /&gt;
|-&lt;br /&gt;
|E3||227||INP&lt;br /&gt;
|-&lt;br /&gt;
|E4||228||LPOS&lt;br /&gt;
|-&lt;br /&gt;
|E5||229||POS&lt;br /&gt;
|-&lt;br /&gt;
|E6||230||SQR&lt;br /&gt;
|-&lt;br /&gt;
|E7||231||RND&lt;br /&gt;
|-&lt;br /&gt;
|E8||232||LOG&lt;br /&gt;
|-&lt;br /&gt;
|E9||233||EXP&lt;br /&gt;
|-&lt;br /&gt;
|EA||234||COS&lt;br /&gt;
|-&lt;br /&gt;
|EB||235||SIN&lt;br /&gt;
|-&lt;br /&gt;
|EC||236||TAN&lt;br /&gt;
|-&lt;br /&gt;
|ED||237||ATN&lt;br /&gt;
|-&lt;br /&gt;
|EE||238||PEEK&lt;br /&gt;
|-&lt;br /&gt;
|EF||239||EOF&lt;br /&gt;
|-&lt;br /&gt;
|F0||240||LOC&lt;br /&gt;
|-&lt;br /&gt;
|F1||241||LOF&lt;br /&gt;
|-&lt;br /&gt;
|F2||242||CINT&lt;br /&gt;
|-&lt;br /&gt;
|F3||243||CSNG&lt;br /&gt;
|-&lt;br /&gt;
|F4||244||CDBL&lt;br /&gt;
|-&lt;br /&gt;
|F5||245||FIX&lt;br /&gt;
|-&lt;br /&gt;
|F6||246||LEN&lt;br /&gt;
|-&lt;br /&gt;
|F7||247||STR$&lt;br /&gt;
|-&lt;br /&gt;
|F8||248||VAL&lt;br /&gt;
|-&lt;br /&gt;
|F9||249||ASC&lt;br /&gt;
|-&lt;br /&gt;
|FA||250||CHR$&lt;br /&gt;
|-&lt;br /&gt;
|FB||251||SPACE$&lt;br /&gt;
|-&lt;br /&gt;
|FC||252||LEFT$&lt;br /&gt;
|-&lt;br /&gt;
|FD||253||RIGHT$&lt;br /&gt;
|-&lt;br /&gt;
|FE||254||MID$&lt;br /&gt;
|-&lt;br /&gt;
|FF||255||' (QUOTE) || When tokenizing, the single quote character expands to three characters: a colon (3A), the byte for REM (8E), and then FF.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== File Format ==&lt;br /&gt;
&lt;br /&gt;
Tokenised BASIC code is a sequence of tokenized lines. Each tokenized line has the following format:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+ Format of a single tokenized line&lt;br /&gt;
!Name!!Length!!Description&lt;br /&gt;
|-&lt;br /&gt;
|PL PH&lt;br /&gt;
|2 bytes&lt;br /&gt;
|Address in RAM of the next line of BASIC; unsigned 16-bit integer, little-endian. In a file, PL PH is merely a placeholder and the value is never used. In RAM, PL PH == 0 marks the end of the tokenized BASIC listing. (See [[#Details for PL PH]].)&lt;br /&gt;
|-&lt;br /&gt;
|LL LH&lt;br /&gt;
|2 bytes&lt;br /&gt;
|Line number; unsigned 16-bit integer, little-endian.&lt;br /&gt;
|-&lt;br /&gt;
|B&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt; … B&amp;lt;sub&amp;gt;n&amp;lt;/sub&amp;gt;&lt;br /&gt;
|Any number of bytes&lt;br /&gt;
|Depending on the high bit, each byte is either a token or an ASCII character. &lt;br /&gt;
|-&lt;br /&gt;
|NULL&lt;br /&gt;
|1 byte&lt;br /&gt;
|NULL byte (&amp;lt;code&amp;gt;0x00&amp;lt;/code&amp;gt;) to signal end of line. &lt;br /&gt;
|}&lt;br /&gt;
              &lt;br /&gt;
Typically, the list of tokenized lines continues until the end of the file. Once a program is loaded into RAM, the end is signaled by two consecutive NULLs in the location where PL PH would normally start the next line.&lt;br /&gt;
&lt;br /&gt;
=== Limits ===&lt;br /&gt;
&lt;br /&gt;
* Line numbers can range from 0 to 65529 (but see variances below).&lt;br /&gt;
* Tokenized line length is limited to 256 characters, including the trailing NULL byte. (To do: double check this.)&lt;br /&gt;
&lt;br /&gt;
=== Acceptable variances ===&lt;br /&gt;
&lt;br /&gt;
While Tandy BASIC will never generate such files, it has no problem loading a tokenized program that:&lt;br /&gt;
&lt;br /&gt;
* Has line numbers out of order; the numerical value of a line number is ignored. Program lines are always LISTed and RUN in the order they appear in the tokenized file.&lt;br /&gt;
* Contains duplicate line numbers; all lines are kept and run in the order found in the file. (GOTO is complicated as search starts at the next line, not the beginning of the program.)&lt;br /&gt;
* Contains a line with zero bytes of data; LIST will show the line number with no text afterward. Does not replace or delete a preexisting line with that number.&lt;br /&gt;
* Contains arbitrary bytes for PL PH; the value of PL PH is always recalculated at LOAD time.&lt;br /&gt;
* Contains line numbers greater than the nominal maximum of 65529; this can be used to store hidden binary data [https://www.mail-archive.com/m100@lists.bitchin100.com/msg16195.html according to John R. Hogerhuis].&lt;br /&gt;
&lt;br /&gt;
''Sidenote'': while these variances are accepted by actual hardware, emulators may not be able to handle such files. For example, [https://sourceforge.net/projects/virtualt/ Virtual T] (as of version 1.7 in 2022) refuses to load tokenized BASIC programs that have lines out of order, duplicate lines, or bogus values for PL PH.&lt;br /&gt;
&lt;br /&gt;
=== Details for PL PH ===&lt;br /&gt;
&lt;br /&gt;
In a file, the specific values of the 16-bit integer PL PH are never used. During program load, Tandy BASIC recalculates PL PH before storing it into RAM. Once in memory, PL PH is used to skip to the line required for GOTO, GOSUB, and READ, thus speeding up the program. Additionally, the end of a tokenized BASIC listing in RAM is marked by PL PH equal to zero (two NULL bytes). &lt;br /&gt;
&lt;br /&gt;
(Stub. This is where Tandy BASIC's calculation of PL PH values will go.)&lt;br /&gt;
&lt;br /&gt;
== Format documentation ==&lt;br /&gt;
&lt;br /&gt;
* [https://m100.bitchin100.narkive.com/eP2uSl4J/tokenized-basic-programs-bytes-of-mystery Discussion of byte format on Bitchin 100 Mailing List]&lt;br /&gt;
* [http://www.club100.org/library/ups/tokens.do BASIC program to create a table of tokens]&lt;br /&gt;
* [https://archive.org/details/HiddenPowersOfTheTrs80Model100/page/n229/mode/2up?view=theater Hidden Powers of the TRS 80 Model 100]. Appendix B lists the BASIC token values for the Model 100. Other than the omission of 255 for a single quote remark, this reference matches what hackerb9 found programmatically for the Tandy 200.&lt;br /&gt;
* [http://web.archive.org/web/20220324135218/https://help.ayra.ch/trs80-reference#trs-80-model-100-basic-reference Ayra Model 100 BASIC Reference]&lt;br /&gt;
&lt;br /&gt;
== Other links ==&lt;br /&gt;
&lt;br /&gt;
* [https://github.com/hackerb9/tokenize/ Hackerb9's simple program for tokenizing BASIC code]&lt;br /&gt;
* [https://sourceforge.net/projects/virtualt/ A Tandy 200 &amp;amp; Model 100/102 emulator]&lt;br /&gt;
* [http://bitchin100.com/CloudT/ A TRS-80 Model 100 emulator that runs in a web browser]&lt;br /&gt;
&lt;br /&gt;
[[Category:Microsoft]]&lt;/div&gt;</summary>
		<author><name>Hackerb9</name></author>	</entry>

	<entry>
		<id>http://fileformats.archiveteam.org/wiki/Tandy_200_BASIC_tokenized_file</id>
		<title>Tandy 200 BASIC tokenized file</title>
		<link rel="alternate" type="text/html" href="http://fileformats.archiveteam.org/wiki/Tandy_200_BASIC_tokenized_file"/>
				<updated>2022-10-06T00:23:56Z</updated>
		
		<summary type="html">&lt;p&gt;Hackerb9: Fix up description of PL PH to separate a program in a file versus a program in RAM&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{FormatInfo&lt;br /&gt;
|subcat=Source code&lt;br /&gt;
|subcat2=Tokenized BASIC&lt;br /&gt;
|released=1984&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
'''Tandy 200 BASIC''' was a version of Microsoft BASIC for the Radio Shack Tandy 200 computer. The tokenizations for the TRS-80 Model 100 and Tandy 102 appear to be identical. The NEC PC-8201/8300 format is not the same, but should be similar.&lt;br /&gt;
&lt;br /&gt;
== Tokens ==&lt;br /&gt;
All BASIC tokens on the Tandy 200 are a single byte with a value from 128 to 255. &lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+ Table mapping token values to BASIC keywords&lt;br /&gt;
! title=&amp;quot;The value of the token in hexadecimal&amp;quot; | Hex&lt;br /&gt;
! title=&amp;quot;The value of the token in decimal&amp;quot; | Dec&lt;br /&gt;
! title=&amp;quot;The BASIC keyword the token stands for&amp;quot; | Keyword &lt;br /&gt;
! title=&amp;quot;Miscellany&amp;quot; | Notes&lt;br /&gt;
|-&lt;br /&gt;
|-&lt;br /&gt;
|80||128||END&lt;br /&gt;
|-&lt;br /&gt;
|81||129||FOR&lt;br /&gt;
|-&lt;br /&gt;
|82||130||NEXT&lt;br /&gt;
|-&lt;br /&gt;
|83||131||DATA&lt;br /&gt;
|-&lt;br /&gt;
|84||132||INPUT&lt;br /&gt;
|-&lt;br /&gt;
|85||133||DIM&lt;br /&gt;
|-&lt;br /&gt;
|86||134||READ&lt;br /&gt;
|-&lt;br /&gt;
|87||135||LET&lt;br /&gt;
|-&lt;br /&gt;
|88||136||GOTO&lt;br /&gt;
|-&lt;br /&gt;
|89||137||RUN&lt;br /&gt;
|-&lt;br /&gt;
|8A||138||IF&lt;br /&gt;
|-&lt;br /&gt;
|8B||139||RESTORE&lt;br /&gt;
|-&lt;br /&gt;
|8C||140||GOSUB&lt;br /&gt;
|-&lt;br /&gt;
|8D||141||RETURN&lt;br /&gt;
|-&lt;br /&gt;
|8E||142||REM&lt;br /&gt;
|-&lt;br /&gt;
|8F||143||STOP&lt;br /&gt;
|-&lt;br /&gt;
|90||144||WIDTH&lt;br /&gt;
|-&lt;br /&gt;
|91||145||ELSE||When tokenizing, the Tandy 200 always adds a colon (':') before the ELSE token (3A 91). If the user actually writes :ELSE it is tokenized as 3A 3A 91.&lt;br /&gt;
|-&lt;br /&gt;
|92||146||LINE&lt;br /&gt;
|-&lt;br /&gt;
|93||147||EDIT&lt;br /&gt;
|-&lt;br /&gt;
|94||148||ERROR&lt;br /&gt;
|-&lt;br /&gt;
|95||149||RESUME&lt;br /&gt;
|-&lt;br /&gt;
|96||150||OUT&lt;br /&gt;
|-&lt;br /&gt;
|97||151||ON&lt;br /&gt;
|-&lt;br /&gt;
|98||152||DSKO$&lt;br /&gt;
|-&lt;br /&gt;
|99||153||OPEN&lt;br /&gt;
|-&lt;br /&gt;
|9A||154||CLOSE&lt;br /&gt;
|-&lt;br /&gt;
|9B||155||LOAD||Note that LOADM is simply the token for LOAD followed by an ASCII 'M'. &lt;br /&gt;
|-&lt;br /&gt;
|9C||156||MERGE&lt;br /&gt;
|-QUOTE&lt;br /&gt;
|9D||157||FILES&lt;br /&gt;
|-&lt;br /&gt;
|9E||158||SAVE&lt;br /&gt;
|-&lt;br /&gt;
|9F||159||LFILES&lt;br /&gt;
|-&lt;br /&gt;
|A0||160||LPRINT&lt;br /&gt;
|-&lt;br /&gt;
|A1||161||DEF&lt;br /&gt;
|-&lt;br /&gt;
|A2||162||POKE&lt;br /&gt;
|-&lt;br /&gt;
|A3||163||PRINT&lt;br /&gt;
|-&lt;br /&gt;
|A4||164||CONT&lt;br /&gt;
|-&lt;br /&gt;
|A5||165||LIST&lt;br /&gt;
|-&lt;br /&gt;
|A6||166||LLIST&lt;br /&gt;
|-&lt;br /&gt;
|A7||167||CLEAR&lt;br /&gt;
|-&lt;br /&gt;
|A8||168||CLOAD&lt;br /&gt;
|-&lt;br /&gt;
|A9||169||CSAVE&lt;br /&gt;
|-&lt;br /&gt;
|AA||170||TIME$&lt;br /&gt;
|-&lt;br /&gt;
|AB||171||DATE$&lt;br /&gt;
|-&lt;br /&gt;
|AC||172||DAY$&lt;br /&gt;
|-&lt;br /&gt;
|AD||173||COM&lt;br /&gt;
|-&lt;br /&gt;
|AE||174||MDM&lt;br /&gt;
|-&lt;br /&gt;
|AF||175||KEY&lt;br /&gt;
|-&lt;br /&gt;
|B0||176||CLS&lt;br /&gt;
|-&lt;br /&gt;
|B1||177||BEEP&lt;br /&gt;
|-&lt;br /&gt;
|B2||178||SOUND&lt;br /&gt;
|-&lt;br /&gt;
|B3||179||LCOPY&lt;br /&gt;
|-&lt;br /&gt;
|B4||180||PSET&lt;br /&gt;
|-&lt;br /&gt;
|B5||181||PRESET&lt;br /&gt;
|-&lt;br /&gt;
|B6||182||MOTOR&lt;br /&gt;
|-&lt;br /&gt;
|B7||183||MAX&lt;br /&gt;
|-&lt;br /&gt;
|B8||184||POWER&lt;br /&gt;
|-&lt;br /&gt;
|B9||185||CALL&lt;br /&gt;
|-&lt;br /&gt;
|BA||186||MENU&lt;br /&gt;
|-&lt;br /&gt;
|BB||187||IPL&lt;br /&gt;
|-&lt;br /&gt;
|BC||188||NAME&lt;br /&gt;
|-&lt;br /&gt;
|BD||189||KILL&lt;br /&gt;
|-&lt;br /&gt;
|BE||190||SCREEN&lt;br /&gt;
|-&lt;br /&gt;
|BF||191||NEW&lt;br /&gt;
|-&lt;br /&gt;
|C0||192||TAB(&lt;br /&gt;
|-&lt;br /&gt;
|C1||193||TO&lt;br /&gt;
|-&lt;br /&gt;
|C2||194||USING&lt;br /&gt;
|-&lt;br /&gt;
|C3||195||VARPTR&lt;br /&gt;
|-&lt;br /&gt;
|C4||196||ERL&lt;br /&gt;
|-&lt;br /&gt;
|C5||197||ERR&lt;br /&gt;
|-&lt;br /&gt;
|C6||198||STRING$&lt;br /&gt;
|-&lt;br /&gt;
|C7||199||INSTR&lt;br /&gt;
|-&lt;br /&gt;
|C8||200||DSKI$&lt;br /&gt;
|-&lt;br /&gt;
|C9||201||INKEY$&lt;br /&gt;
|-&lt;br /&gt;
|CA||202||CSRLIN&lt;br /&gt;
|-&lt;br /&gt;
|CB||203||OFF&lt;br /&gt;
|-&lt;br /&gt;
|CC||204||HIMEM&lt;br /&gt;
|-&lt;br /&gt;
|CD||205||THEN&lt;br /&gt;
|-&lt;br /&gt;
|CE||206||NOT&lt;br /&gt;
|-&lt;br /&gt;
|CF||207||STEP&lt;br /&gt;
|-&lt;br /&gt;
|D0||208||+&lt;br /&gt;
|-&lt;br /&gt;
|D1||209||-&lt;br /&gt;
|-&lt;br /&gt;
|D2||210||*&lt;br /&gt;
|-&lt;br /&gt;
|D3||211||/&lt;br /&gt;
|-&lt;br /&gt;
|D4||212||^&lt;br /&gt;
|-&lt;br /&gt;
|D5||213||AND&lt;br /&gt;
|-&lt;br /&gt;
|D6||214||OR&lt;br /&gt;
|-&lt;br /&gt;
|D7||215||XOR&lt;br /&gt;
|-&lt;br /&gt;
|D8||216||EQV&lt;br /&gt;
|-&lt;br /&gt;
|D9||217||IMP&lt;br /&gt;
|-&lt;br /&gt;
|DA||218||MOD&lt;br /&gt;
|-&lt;br /&gt;
|DB||219||\&lt;br /&gt;
|-&lt;br /&gt;
|DC||220||&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|DD||221||=&lt;br /&gt;
|-&lt;br /&gt;
|DE||222||&amp;lt;&lt;br /&gt;
|-&lt;br /&gt;
|DF||223||SGN&lt;br /&gt;
|-&lt;br /&gt;
|E0||224||INT&lt;br /&gt;
|-&lt;br /&gt;
|E1||225||ABS&lt;br /&gt;
|-&lt;br /&gt;
|E2||226||FRE&lt;br /&gt;
|-&lt;br /&gt;
|E3||227||INP&lt;br /&gt;
|-&lt;br /&gt;
|E4||228||LPOS&lt;br /&gt;
|-&lt;br /&gt;
|E5||229||POS&lt;br /&gt;
|-&lt;br /&gt;
|E6||230||SQR&lt;br /&gt;
|-&lt;br /&gt;
|E7||231||RND&lt;br /&gt;
|-&lt;br /&gt;
|E8||232||LOG&lt;br /&gt;
|-&lt;br /&gt;
|E9||233||EXP&lt;br /&gt;
|-&lt;br /&gt;
|EA||234||COS&lt;br /&gt;
|-&lt;br /&gt;
|EB||235||SIN&lt;br /&gt;
|-&lt;br /&gt;
|EC||236||TAN&lt;br /&gt;
|-&lt;br /&gt;
|ED||237||ATN&lt;br /&gt;
|-&lt;br /&gt;
|EE||238||PEEK&lt;br /&gt;
|-&lt;br /&gt;
|EF||239||EOF&lt;br /&gt;
|-&lt;br /&gt;
|F0||240||LOC&lt;br /&gt;
|-&lt;br /&gt;
|F1||241||LOF&lt;br /&gt;
|-&lt;br /&gt;
|F2||242||CINT&lt;br /&gt;
|-&lt;br /&gt;
|F3||243||CSNG&lt;br /&gt;
|-&lt;br /&gt;
|F4||244||CDBL&lt;br /&gt;
|-&lt;br /&gt;
|F5||245||FIX&lt;br /&gt;
|-&lt;br /&gt;
|F6||246||LEN&lt;br /&gt;
|-&lt;br /&gt;
|F7||247||STR$&lt;br /&gt;
|-&lt;br /&gt;
|F8||248||VAL&lt;br /&gt;
|-&lt;br /&gt;
|F9||249||ASC&lt;br /&gt;
|-&lt;br /&gt;
|FA||250||CHR$&lt;br /&gt;
|-&lt;br /&gt;
|FB||251||SPACE$&lt;br /&gt;
|-&lt;br /&gt;
|FC||252||LEFT$&lt;br /&gt;
|-&lt;br /&gt;
|FD||253||RIGHT$&lt;br /&gt;
|-&lt;br /&gt;
|FE||254||MID$&lt;br /&gt;
|-&lt;br /&gt;
|FF||255||' (QUOTE) || When tokenizing, the single quote character expands to three characters: a colon (3A), the byte for REM (8E), and then FF.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== File Format ==&lt;br /&gt;
&lt;br /&gt;
Tokenised BASIC code is a sequence of tokenized lines. Each tokenized line has the following format:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+ Format of a single tokenized line&lt;br /&gt;
!Name!!Length!!Description&lt;br /&gt;
|-&lt;br /&gt;
|PL PH&lt;br /&gt;
|2 bytes&lt;br /&gt;
|Address in RAM of the next line of BASIC; unsigned 16-bit integer, little-endian. In a file, PL PH is merely a placeholder and the value is never used. In RAM, PL PH == 0 marks the end of the tokenized BASIC listing. (See [[#Details for PL PH]].)&lt;br /&gt;
|-&lt;br /&gt;
|LL LH&lt;br /&gt;
|2 bytes&lt;br /&gt;
|Line number; unsigned 16-bit integer, little-endian.&lt;br /&gt;
|-&lt;br /&gt;
|B&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt; … B&amp;lt;sub&amp;gt;n&amp;lt;/sub&amp;gt;&lt;br /&gt;
|Any number of bytes&lt;br /&gt;
|Depending on the high bit, each byte is either a token or an ASCII character. &lt;br /&gt;
|-&lt;br /&gt;
|NULL&lt;br /&gt;
|1 byte&lt;br /&gt;
|NULL byte (&amp;lt;code&amp;gt;0x00&amp;lt;/code&amp;gt;) to signal end of line. &lt;br /&gt;
|}&lt;br /&gt;
              &lt;br /&gt;
Typically, the list of tokenized lines continues until the end of the file. Once a program is loaded into RAM, the end is signaled by two consecutive NULLs in the location where PL PH would normally start the next line.&lt;br /&gt;
&lt;br /&gt;
=== Limits ===&lt;br /&gt;
&lt;br /&gt;
* Line numbers can range from 0 to 65529 (but see variances below).&lt;br /&gt;
* Tokenized line length is limited to 256 characters, including the trailing NULL byte. (To do: double check this.)&lt;br /&gt;
&lt;br /&gt;
=== Acceptable variances ===&lt;br /&gt;
&lt;br /&gt;
While Tandy BASIC will never generate such files, it has no problem loading a tokenized program that:&lt;br /&gt;
&lt;br /&gt;
* Has line numbers out of order; the numerical value of a line number is ignored. Program lines are always LISTed and RUN in the order they appear in the tokenized file.&lt;br /&gt;
* Contains duplicate line numbers; all lines are kept and run in the order found in the file. (GOTO is complicated as search starts at the next line, not the beginning of the program.)&lt;br /&gt;
* Contains a line with zero bytes of data; LIST will show the line number with no text afterward. Does not replace or delete a preexisting line with that number.&lt;br /&gt;
* Contains arbitrary bytes for PL PH; the value of PL PH is always recalculated at LOAD time.&lt;br /&gt;
* Contains line numbers greater than the nominal maximum of 65529; this can be used to store hidden binary data [https://www.mail-archive.com/m100@lists.bitchin100.com/msg16195.html according to John R. Hogerhuis].&lt;br /&gt;
&lt;br /&gt;
''Sidenote'': while these variances are accepted by actual hardware, emulators may not be able to handle such files. For example, [https://sourceforge.net/projects/virtualt/ Virtual T] (as of version 1.7 in 2022) refuses to load tokenized BASIC programs that have lines out of order, duplicate lines, or bogus values for PL PH.&lt;br /&gt;
&lt;br /&gt;
=== Details for PL PH ===&lt;br /&gt;
&lt;br /&gt;
In a file, the specific values of the 16-bit integer PL PH in a file are never used. During program load, Tandy BASIC recalculates PL PH before storing it into RAM. Once in memory, PL PH is used to skip to the line required for GOTO, GOSUB, and READ, thus speeding up the program. Additionally, the end of a tokenized BASIC listing in RAM is marked by PL PH equal to zero (two NULL bytes). &lt;br /&gt;
&lt;br /&gt;
(Stub. This is where Tandy BASIC's calculation of PL PH values will go.)&lt;br /&gt;
&lt;br /&gt;
== Format documentation ==&lt;br /&gt;
&lt;br /&gt;
* [https://m100.bitchin100.narkive.com/eP2uSl4J/tokenized-basic-programs-bytes-of-mystery Discussion of byte format on Bitchin 100 Mailing List]&lt;br /&gt;
* [http://www.club100.org/library/ups/tokens.do BASIC program to create a table of tokens]&lt;br /&gt;
* [https://archive.org/details/HiddenPowersOfTheTrs80Model100/page/n229/mode/2up?view=theater Hidden Powers of the TRS 80 Model 100]. Appendix B lists the BASIC token values for the Model 100. Other than the omission of 255 for a single quote remark, this reference matches what hackerb9 found programmatically for the Tandy 200.&lt;br /&gt;
* [http://web.archive.org/web/20220324135218/https://help.ayra.ch/trs80-reference#trs-80-model-100-basic-reference Ayra Model 100 BASIC Reference]&lt;br /&gt;
&lt;br /&gt;
== Other links ==&lt;br /&gt;
&lt;br /&gt;
* [https://github.com/hackerb9/tokenize/ Hackerb9's simple program for tokenizing BASIC code]&lt;br /&gt;
* [https://sourceforge.net/projects/virtualt/ A Tandy 200 &amp;amp; Model 100/102 emulator]&lt;br /&gt;
* [http://bitchin100.com/CloudT/ A TRS-80 Model 100 emulator that runs in a web browser]&lt;br /&gt;
&lt;br /&gt;
[[Category:Microsoft]]&lt;/div&gt;</summary>
		<author><name>Hackerb9</name></author>	</entry>

	<entry>
		<id>http://fileformats.archiveteam.org/wiki/Tandy_200_BASIC_tokenized_file</id>
		<title>Tandy 200 BASIC tokenized file</title>
		<link rel="alternate" type="text/html" href="http://fileformats.archiveteam.org/wiki/Tandy_200_BASIC_tokenized_file"/>
				<updated>2022-10-05T21:43:10Z</updated>
		
		<summary type="html">&lt;p&gt;Hackerb9: /* Acceptable variances */ Add note about zero bytes of data&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{FormatInfo&lt;br /&gt;
|subcat=Source code&lt;br /&gt;
|subcat2=Tokenized BASIC&lt;br /&gt;
|released=1984&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
'''Tandy 200 BASIC''' was a version of Microsoft BASIC for the Radio Shack Tandy 200 computer. The tokenizations for the TRS-80 Model 100 and Tandy 102 appear to be identical. The NEC PC-8201/8300 format is not the same, but should be similar.&lt;br /&gt;
&lt;br /&gt;
== Tokens ==&lt;br /&gt;
All BASIC tokens on the Tandy 200 are a single byte with a value from 128 to 255. &lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+ Table mapping token values to BASIC keywords&lt;br /&gt;
! title=&amp;quot;The value of the token in hexadecimal&amp;quot; | Hex&lt;br /&gt;
! title=&amp;quot;The value of the token in decimal&amp;quot; | Dec&lt;br /&gt;
! title=&amp;quot;The BASIC keyword the token stands for&amp;quot; | Keyword &lt;br /&gt;
! title=&amp;quot;Miscellany&amp;quot; | Notes&lt;br /&gt;
|-&lt;br /&gt;
|-&lt;br /&gt;
|80||128||END&lt;br /&gt;
|-&lt;br /&gt;
|81||129||FOR&lt;br /&gt;
|-&lt;br /&gt;
|82||130||NEXT&lt;br /&gt;
|-&lt;br /&gt;
|83||131||DATA&lt;br /&gt;
|-&lt;br /&gt;
|84||132||INPUT&lt;br /&gt;
|-&lt;br /&gt;
|85||133||DIM&lt;br /&gt;
|-&lt;br /&gt;
|86||134||READ&lt;br /&gt;
|-&lt;br /&gt;
|87||135||LET&lt;br /&gt;
|-&lt;br /&gt;
|88||136||GOTO&lt;br /&gt;
|-&lt;br /&gt;
|89||137||RUN&lt;br /&gt;
|-&lt;br /&gt;
|8A||138||IF&lt;br /&gt;
|-&lt;br /&gt;
|8B||139||RESTORE&lt;br /&gt;
|-&lt;br /&gt;
|8C||140||GOSUB&lt;br /&gt;
|-&lt;br /&gt;
|8D||141||RETURN&lt;br /&gt;
|-&lt;br /&gt;
|8E||142||REM&lt;br /&gt;
|-&lt;br /&gt;
|8F||143||STOP&lt;br /&gt;
|-&lt;br /&gt;
|90||144||WIDTH&lt;br /&gt;
|-&lt;br /&gt;
|91||145||ELSE||When tokenizing, the Tandy 200 always adds a colon (':') before the ELSE token (3A 91). If the user actually writes :ELSE it is tokenized as 3A 3A 91.&lt;br /&gt;
|-&lt;br /&gt;
|92||146||LINE&lt;br /&gt;
|-&lt;br /&gt;
|93||147||EDIT&lt;br /&gt;
|-&lt;br /&gt;
|94||148||ERROR&lt;br /&gt;
|-&lt;br /&gt;
|95||149||RESUME&lt;br /&gt;
|-&lt;br /&gt;
|96||150||OUT&lt;br /&gt;
|-&lt;br /&gt;
|97||151||ON&lt;br /&gt;
|-&lt;br /&gt;
|98||152||DSKO$&lt;br /&gt;
|-&lt;br /&gt;
|99||153||OPEN&lt;br /&gt;
|-&lt;br /&gt;
|9A||154||CLOSE&lt;br /&gt;
|-&lt;br /&gt;
|9B||155||LOAD||Note that LOADM is simply the token for LOAD followed by an ASCII 'M'. &lt;br /&gt;
|-&lt;br /&gt;
|9C||156||MERGE&lt;br /&gt;
|-QUOTE&lt;br /&gt;
|9D||157||FILES&lt;br /&gt;
|-&lt;br /&gt;
|9E||158||SAVE&lt;br /&gt;
|-&lt;br /&gt;
|9F||159||LFILES&lt;br /&gt;
|-&lt;br /&gt;
|A0||160||LPRINT&lt;br /&gt;
|-&lt;br /&gt;
|A1||161||DEF&lt;br /&gt;
|-&lt;br /&gt;
|A2||162||POKE&lt;br /&gt;
|-&lt;br /&gt;
|A3||163||PRINT&lt;br /&gt;
|-&lt;br /&gt;
|A4||164||CONT&lt;br /&gt;
|-&lt;br /&gt;
|A5||165||LIST&lt;br /&gt;
|-&lt;br /&gt;
|A6||166||LLIST&lt;br /&gt;
|-&lt;br /&gt;
|A7||167||CLEAR&lt;br /&gt;
|-&lt;br /&gt;
|A8||168||CLOAD&lt;br /&gt;
|-&lt;br /&gt;
|A9||169||CSAVE&lt;br /&gt;
|-&lt;br /&gt;
|AA||170||TIME$&lt;br /&gt;
|-&lt;br /&gt;
|AB||171||DATE$&lt;br /&gt;
|-&lt;br /&gt;
|AC||172||DAY$&lt;br /&gt;
|-&lt;br /&gt;
|AD||173||COM&lt;br /&gt;
|-&lt;br /&gt;
|AE||174||MDM&lt;br /&gt;
|-&lt;br /&gt;
|AF||175||KEY&lt;br /&gt;
|-&lt;br /&gt;
|B0||176||CLS&lt;br /&gt;
|-&lt;br /&gt;
|B1||177||BEEP&lt;br /&gt;
|-&lt;br /&gt;
|B2||178||SOUND&lt;br /&gt;
|-&lt;br /&gt;
|B3||179||LCOPY&lt;br /&gt;
|-&lt;br /&gt;
|B4||180||PSET&lt;br /&gt;
|-&lt;br /&gt;
|B5||181||PRESET&lt;br /&gt;
|-&lt;br /&gt;
|B6||182||MOTOR&lt;br /&gt;
|-&lt;br /&gt;
|B7||183||MAX&lt;br /&gt;
|-&lt;br /&gt;
|B8||184||POWER&lt;br /&gt;
|-&lt;br /&gt;
|B9||185||CALL&lt;br /&gt;
|-&lt;br /&gt;
|BA||186||MENU&lt;br /&gt;
|-&lt;br /&gt;
|BB||187||IPL&lt;br /&gt;
|-&lt;br /&gt;
|BC||188||NAME&lt;br /&gt;
|-&lt;br /&gt;
|BD||189||KILL&lt;br /&gt;
|-&lt;br /&gt;
|BE||190||SCREEN&lt;br /&gt;
|-&lt;br /&gt;
|BF||191||NEW&lt;br /&gt;
|-&lt;br /&gt;
|C0||192||TAB(&lt;br /&gt;
|-&lt;br /&gt;
|C1||193||TO&lt;br /&gt;
|-&lt;br /&gt;
|C2||194||USING&lt;br /&gt;
|-&lt;br /&gt;
|C3||195||VARPTR&lt;br /&gt;
|-&lt;br /&gt;
|C4||196||ERL&lt;br /&gt;
|-&lt;br /&gt;
|C5||197||ERR&lt;br /&gt;
|-&lt;br /&gt;
|C6||198||STRING$&lt;br /&gt;
|-&lt;br /&gt;
|C7||199||INSTR&lt;br /&gt;
|-&lt;br /&gt;
|C8||200||DSKI$&lt;br /&gt;
|-&lt;br /&gt;
|C9||201||INKEY$&lt;br /&gt;
|-&lt;br /&gt;
|CA||202||CSRLIN&lt;br /&gt;
|-&lt;br /&gt;
|CB||203||OFF&lt;br /&gt;
|-&lt;br /&gt;
|CC||204||HIMEM&lt;br /&gt;
|-&lt;br /&gt;
|CD||205||THEN&lt;br /&gt;
|-&lt;br /&gt;
|CE||206||NOT&lt;br /&gt;
|-&lt;br /&gt;
|CF||207||STEP&lt;br /&gt;
|-&lt;br /&gt;
|D0||208||+&lt;br /&gt;
|-&lt;br /&gt;
|D1||209||-&lt;br /&gt;
|-&lt;br /&gt;
|D2||210||*&lt;br /&gt;
|-&lt;br /&gt;
|D3||211||/&lt;br /&gt;
|-&lt;br /&gt;
|D4||212||^&lt;br /&gt;
|-&lt;br /&gt;
|D5||213||AND&lt;br /&gt;
|-&lt;br /&gt;
|D6||214||OR&lt;br /&gt;
|-&lt;br /&gt;
|D7||215||XOR&lt;br /&gt;
|-&lt;br /&gt;
|D8||216||EQV&lt;br /&gt;
|-&lt;br /&gt;
|D9||217||IMP&lt;br /&gt;
|-&lt;br /&gt;
|DA||218||MOD&lt;br /&gt;
|-&lt;br /&gt;
|DB||219||\&lt;br /&gt;
|-&lt;br /&gt;
|DC||220||&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|DD||221||=&lt;br /&gt;
|-&lt;br /&gt;
|DE||222||&amp;lt;&lt;br /&gt;
|-&lt;br /&gt;
|DF||223||SGN&lt;br /&gt;
|-&lt;br /&gt;
|E0||224||INT&lt;br /&gt;
|-&lt;br /&gt;
|E1||225||ABS&lt;br /&gt;
|-&lt;br /&gt;
|E2||226||FRE&lt;br /&gt;
|-&lt;br /&gt;
|E3||227||INP&lt;br /&gt;
|-&lt;br /&gt;
|E4||228||LPOS&lt;br /&gt;
|-&lt;br /&gt;
|E5||229||POS&lt;br /&gt;
|-&lt;br /&gt;
|E6||230||SQR&lt;br /&gt;
|-&lt;br /&gt;
|E7||231||RND&lt;br /&gt;
|-&lt;br /&gt;
|E8||232||LOG&lt;br /&gt;
|-&lt;br /&gt;
|E9||233||EXP&lt;br /&gt;
|-&lt;br /&gt;
|EA||234||COS&lt;br /&gt;
|-&lt;br /&gt;
|EB||235||SIN&lt;br /&gt;
|-&lt;br /&gt;
|EC||236||TAN&lt;br /&gt;
|-&lt;br /&gt;
|ED||237||ATN&lt;br /&gt;
|-&lt;br /&gt;
|EE||238||PEEK&lt;br /&gt;
|-&lt;br /&gt;
|EF||239||EOF&lt;br /&gt;
|-&lt;br /&gt;
|F0||240||LOC&lt;br /&gt;
|-&lt;br /&gt;
|F1||241||LOF&lt;br /&gt;
|-&lt;br /&gt;
|F2||242||CINT&lt;br /&gt;
|-&lt;br /&gt;
|F3||243||CSNG&lt;br /&gt;
|-&lt;br /&gt;
|F4||244||CDBL&lt;br /&gt;
|-&lt;br /&gt;
|F5||245||FIX&lt;br /&gt;
|-&lt;br /&gt;
|F6||246||LEN&lt;br /&gt;
|-&lt;br /&gt;
|F7||247||STR$&lt;br /&gt;
|-&lt;br /&gt;
|F8||248||VAL&lt;br /&gt;
|-&lt;br /&gt;
|F9||249||ASC&lt;br /&gt;
|-&lt;br /&gt;
|FA||250||CHR$&lt;br /&gt;
|-&lt;br /&gt;
|FB||251||SPACE$&lt;br /&gt;
|-&lt;br /&gt;
|FC||252||LEFT$&lt;br /&gt;
|-&lt;br /&gt;
|FD||253||RIGHT$&lt;br /&gt;
|-&lt;br /&gt;
|FE||254||MID$&lt;br /&gt;
|-&lt;br /&gt;
|FF||255||' (QUOTE) || When tokenizing, the single quote character expands to three characters: a colon (3A), the byte for REM (8E), and then FF.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== File Format ==&lt;br /&gt;
&lt;br /&gt;
Tokenised BASIC code is a sequence of tokenized lines. Each tokenized line has the following format:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+ Format of a single tokenized line&lt;br /&gt;
!Name!!Length!!Description&lt;br /&gt;
|-&lt;br /&gt;
|PL PH&lt;br /&gt;
|2 bytes&lt;br /&gt;
|Address in RAM of the next line of BASIC; unsigned 16-bit integer, little-endian. PL PH equal to zero marks the end of a tokenized BASIC listing. All other values can be ignored as they are merely placeholders in the file. (See [[#Details for PL PH]].)&lt;br /&gt;
|-&lt;br /&gt;
|LL LH&lt;br /&gt;
|2 bytes&lt;br /&gt;
|Line number; unsigned 16-bit integer, little-endian.&lt;br /&gt;
|-&lt;br /&gt;
|B&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt; … B&amp;lt;sub&amp;gt;n&amp;lt;/sub&amp;gt;&lt;br /&gt;
|Any number of bytes&lt;br /&gt;
|Depending on the high bit, each byte is either a token or an ASCII character. &lt;br /&gt;
|-&lt;br /&gt;
|NULL&lt;br /&gt;
|1 byte&lt;br /&gt;
|NULL byte (&amp;lt;code&amp;gt;0x00&amp;lt;/code&amp;gt;) to signal end of line. &lt;br /&gt;
|}&lt;br /&gt;
              &lt;br /&gt;
The end of the tokenized data is signaled by two consecutive NULLs in the location where PL PH would normally begin a new line.&lt;br /&gt;
&lt;br /&gt;
=== Limits ===&lt;br /&gt;
&lt;br /&gt;
* Line numbers can range from 0 to 65529 (but see variances below).&lt;br /&gt;
* Tokenized line length is limited to 256 characters, including the trailing NULL byte. (To do: double check this.)&lt;br /&gt;
&lt;br /&gt;
=== Acceptable variances ===&lt;br /&gt;
&lt;br /&gt;
While Tandy BASIC will never generate such files, it has no problem loading a tokenized program that:&lt;br /&gt;
&lt;br /&gt;
* Has line numbers out of order; they will be sorted when loaded.&lt;br /&gt;
* Contains duplicate line numbers; previous line is discarded.&lt;br /&gt;
* Contains arbitrary bytes for PL PH; they are always regenerated during loading.&lt;br /&gt;
* Has a ^Z (ASCII 26) at the end of the file.&lt;br /&gt;
* Contains line numbers greater than the nominal maximum of 65529; this can be used to store hidden binary data [https://www.mail-archive.com/m100@lists.bitchin100.com/msg16195.html according to John R. Hogerhuis].&lt;br /&gt;
* Contains a tokenized line with zero bytes of data; if a line with that number existed before, it will be discarded.&lt;br /&gt;
&lt;br /&gt;
''Sidenote'': while these variances are accepted by actual hardware, emulators may not be able to handle such files. For example, [https://sourceforge.net/projects/virtualt/ Virtual T] (as of version 1.7 in 2022) refuses to load tokenized BASIC programs that have lines out of order, duplicate lines, or bogus values for PL PH.&lt;br /&gt;
&lt;br /&gt;
=== Details for PL PH ===&lt;br /&gt;
&lt;br /&gt;
The value of the 16-bit integer PL PH in a tokenized BASIC file is not used, except to mark the end of the listing when PL PH equals zero. During program load, Tandy BASIC always recalculates PL PH. Once in memory, PL PH is used to skip to the line required for GOTO, GOSUB, and READ, thus speeding up the program. &lt;br /&gt;
&lt;br /&gt;
(Stub. This is where the correct calculation of PL PH values will go.)&lt;br /&gt;
&lt;br /&gt;
== Format documentation ==&lt;br /&gt;
&lt;br /&gt;
* [https://m100.bitchin100.narkive.com/eP2uSl4J/tokenized-basic-programs-bytes-of-mystery Discussion of byte format on Bitchin 100 Mailing List]&lt;br /&gt;
* [http://www.club100.org/library/ups/tokens.do BASIC program to create a table of tokens]&lt;br /&gt;
* [https://archive.org/details/HiddenPowersOfTheTrs80Model100/page/n229/mode/2up?view=theater Hidden Powers of the TRS 80 Model 100]. Appendix B lists the BASIC token values for the Model 100. Other than the omission of 255 for a single quote remark, this reference matches what hackerb9 found programmatically for the Tandy 200.&lt;br /&gt;
* [http://web.archive.org/web/20220324135218/https://help.ayra.ch/trs80-reference#trs-80-model-100-basic-reference Ayra Model 100 BASIC Reference]&lt;br /&gt;
&lt;br /&gt;
== Other links ==&lt;br /&gt;
&lt;br /&gt;
* [https://github.com/hackerb9/tokenize/ Hackerb9's simple program for tokenizing BASIC code]&lt;br /&gt;
* [https://sourceforge.net/projects/virtualt/ A Tandy 200 &amp;amp; Model 100/102 emulator]&lt;br /&gt;
* [http://bitchin100.com/CloudT/ A TRS-80 Model 100 emulator that runs in a web browser]&lt;br /&gt;
&lt;br /&gt;
[[Category:Microsoft]]&lt;/div&gt;</summary>
		<author><name>Hackerb9</name></author>	</entry>

	<entry>
		<id>http://fileformats.archiveteam.org/wiki/Tandy_200_BASIC_tokenized_file</id>
		<title>Tandy 200 BASIC tokenized file</title>
		<link rel="alternate" type="text/html" href="http://fileformats.archiveteam.org/wiki/Tandy_200_BASIC_tokenized_file"/>
				<updated>2022-10-05T21:37:20Z</updated>
		
		<summary type="html">&lt;p&gt;Hackerb9: /* Acceptable variances */ Be specific about &amp;quot;illegal line numbers&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{FormatInfo&lt;br /&gt;
|subcat=Source code&lt;br /&gt;
|subcat2=Tokenized BASIC&lt;br /&gt;
|released=1984&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
'''Tandy 200 BASIC''' was a version of Microsoft BASIC for the Radio Shack Tandy 200 computer. The tokenizations for the TRS-80 Model 100 and Tandy 102 appear to be identical. The NEC PC-8201/8300 format is not the same, but should be similar.&lt;br /&gt;
&lt;br /&gt;
== Tokens ==&lt;br /&gt;
All BASIC tokens on the Tandy 200 are a single byte with a value from 128 to 255. &lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+ Table mapping token values to BASIC keywords&lt;br /&gt;
! title=&amp;quot;The value of the token in hexadecimal&amp;quot; | Hex&lt;br /&gt;
! title=&amp;quot;The value of the token in decimal&amp;quot; | Dec&lt;br /&gt;
! title=&amp;quot;The BASIC keyword the token stands for&amp;quot; | Keyword &lt;br /&gt;
! title=&amp;quot;Miscellany&amp;quot; | Notes&lt;br /&gt;
|-&lt;br /&gt;
|-&lt;br /&gt;
|80||128||END&lt;br /&gt;
|-&lt;br /&gt;
|81||129||FOR&lt;br /&gt;
|-&lt;br /&gt;
|82||130||NEXT&lt;br /&gt;
|-&lt;br /&gt;
|83||131||DATA&lt;br /&gt;
|-&lt;br /&gt;
|84||132||INPUT&lt;br /&gt;
|-&lt;br /&gt;
|85||133||DIM&lt;br /&gt;
|-&lt;br /&gt;
|86||134||READ&lt;br /&gt;
|-&lt;br /&gt;
|87||135||LET&lt;br /&gt;
|-&lt;br /&gt;
|88||136||GOTO&lt;br /&gt;
|-&lt;br /&gt;
|89||137||RUN&lt;br /&gt;
|-&lt;br /&gt;
|8A||138||IF&lt;br /&gt;
|-&lt;br /&gt;
|8B||139||RESTORE&lt;br /&gt;
|-&lt;br /&gt;
|8C||140||GOSUB&lt;br /&gt;
|-&lt;br /&gt;
|8D||141||RETURN&lt;br /&gt;
|-&lt;br /&gt;
|8E||142||REM&lt;br /&gt;
|-&lt;br /&gt;
|8F||143||STOP&lt;br /&gt;
|-&lt;br /&gt;
|90||144||WIDTH&lt;br /&gt;
|-&lt;br /&gt;
|91||145||ELSE||When tokenizing, the Tandy 200 always adds a colon (':') before the ELSE token (3A 91). If the user actually writes :ELSE it is tokenized as 3A 3A 91.&lt;br /&gt;
|-&lt;br /&gt;
|92||146||LINE&lt;br /&gt;
|-&lt;br /&gt;
|93||147||EDIT&lt;br /&gt;
|-&lt;br /&gt;
|94||148||ERROR&lt;br /&gt;
|-&lt;br /&gt;
|95||149||RESUME&lt;br /&gt;
|-&lt;br /&gt;
|96||150||OUT&lt;br /&gt;
|-&lt;br /&gt;
|97||151||ON&lt;br /&gt;
|-&lt;br /&gt;
|98||152||DSKO$&lt;br /&gt;
|-&lt;br /&gt;
|99||153||OPEN&lt;br /&gt;
|-&lt;br /&gt;
|9A||154||CLOSE&lt;br /&gt;
|-&lt;br /&gt;
|9B||155||LOAD||Note that LOADM is simply the token for LOAD followed by an ASCII 'M'. &lt;br /&gt;
|-&lt;br /&gt;
|9C||156||MERGE&lt;br /&gt;
|-QUOTE&lt;br /&gt;
|9D||157||FILES&lt;br /&gt;
|-&lt;br /&gt;
|9E||158||SAVE&lt;br /&gt;
|-&lt;br /&gt;
|9F||159||LFILES&lt;br /&gt;
|-&lt;br /&gt;
|A0||160||LPRINT&lt;br /&gt;
|-&lt;br /&gt;
|A1||161||DEF&lt;br /&gt;
|-&lt;br /&gt;
|A2||162||POKE&lt;br /&gt;
|-&lt;br /&gt;
|A3||163||PRINT&lt;br /&gt;
|-&lt;br /&gt;
|A4||164||CONT&lt;br /&gt;
|-&lt;br /&gt;
|A5||165||LIST&lt;br /&gt;
|-&lt;br /&gt;
|A6||166||LLIST&lt;br /&gt;
|-&lt;br /&gt;
|A7||167||CLEAR&lt;br /&gt;
|-&lt;br /&gt;
|A8||168||CLOAD&lt;br /&gt;
|-&lt;br /&gt;
|A9||169||CSAVE&lt;br /&gt;
|-&lt;br /&gt;
|AA||170||TIME$&lt;br /&gt;
|-&lt;br /&gt;
|AB||171||DATE$&lt;br /&gt;
|-&lt;br /&gt;
|AC||172||DAY$&lt;br /&gt;
|-&lt;br /&gt;
|AD||173||COM&lt;br /&gt;
|-&lt;br /&gt;
|AE||174||MDM&lt;br /&gt;
|-&lt;br /&gt;
|AF||175||KEY&lt;br /&gt;
|-&lt;br /&gt;
|B0||176||CLS&lt;br /&gt;
|-&lt;br /&gt;
|B1||177||BEEP&lt;br /&gt;
|-&lt;br /&gt;
|B2||178||SOUND&lt;br /&gt;
|-&lt;br /&gt;
|B3||179||LCOPY&lt;br /&gt;
|-&lt;br /&gt;
|B4||180||PSET&lt;br /&gt;
|-&lt;br /&gt;
|B5||181||PRESET&lt;br /&gt;
|-&lt;br /&gt;
|B6||182||MOTOR&lt;br /&gt;
|-&lt;br /&gt;
|B7||183||MAX&lt;br /&gt;
|-&lt;br /&gt;
|B8||184||POWER&lt;br /&gt;
|-&lt;br /&gt;
|B9||185||CALL&lt;br /&gt;
|-&lt;br /&gt;
|BA||186||MENU&lt;br /&gt;
|-&lt;br /&gt;
|BB||187||IPL&lt;br /&gt;
|-&lt;br /&gt;
|BC||188||NAME&lt;br /&gt;
|-&lt;br /&gt;
|BD||189||KILL&lt;br /&gt;
|-&lt;br /&gt;
|BE||190||SCREEN&lt;br /&gt;
|-&lt;br /&gt;
|BF||191||NEW&lt;br /&gt;
|-&lt;br /&gt;
|C0||192||TAB(&lt;br /&gt;
|-&lt;br /&gt;
|C1||193||TO&lt;br /&gt;
|-&lt;br /&gt;
|C2||194||USING&lt;br /&gt;
|-&lt;br /&gt;
|C3||195||VARPTR&lt;br /&gt;
|-&lt;br /&gt;
|C4||196||ERL&lt;br /&gt;
|-&lt;br /&gt;
|C5||197||ERR&lt;br /&gt;
|-&lt;br /&gt;
|C6||198||STRING$&lt;br /&gt;
|-&lt;br /&gt;
|C7||199||INSTR&lt;br /&gt;
|-&lt;br /&gt;
|C8||200||DSKI$&lt;br /&gt;
|-&lt;br /&gt;
|C9||201||INKEY$&lt;br /&gt;
|-&lt;br /&gt;
|CA||202||CSRLIN&lt;br /&gt;
|-&lt;br /&gt;
|CB||203||OFF&lt;br /&gt;
|-&lt;br /&gt;
|CC||204||HIMEM&lt;br /&gt;
|-&lt;br /&gt;
|CD||205||THEN&lt;br /&gt;
|-&lt;br /&gt;
|CE||206||NOT&lt;br /&gt;
|-&lt;br /&gt;
|CF||207||STEP&lt;br /&gt;
|-&lt;br /&gt;
|D0||208||+&lt;br /&gt;
|-&lt;br /&gt;
|D1||209||-&lt;br /&gt;
|-&lt;br /&gt;
|D2||210||*&lt;br /&gt;
|-&lt;br /&gt;
|D3||211||/&lt;br /&gt;
|-&lt;br /&gt;
|D4||212||^&lt;br /&gt;
|-&lt;br /&gt;
|D5||213||AND&lt;br /&gt;
|-&lt;br /&gt;
|D6||214||OR&lt;br /&gt;
|-&lt;br /&gt;
|D7||215||XOR&lt;br /&gt;
|-&lt;br /&gt;
|D8||216||EQV&lt;br /&gt;
|-&lt;br /&gt;
|D9||217||IMP&lt;br /&gt;
|-&lt;br /&gt;
|DA||218||MOD&lt;br /&gt;
|-&lt;br /&gt;
|DB||219||\&lt;br /&gt;
|-&lt;br /&gt;
|DC||220||&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|DD||221||=&lt;br /&gt;
|-&lt;br /&gt;
|DE||222||&amp;lt;&lt;br /&gt;
|-&lt;br /&gt;
|DF||223||SGN&lt;br /&gt;
|-&lt;br /&gt;
|E0||224||INT&lt;br /&gt;
|-&lt;br /&gt;
|E1||225||ABS&lt;br /&gt;
|-&lt;br /&gt;
|E2||226||FRE&lt;br /&gt;
|-&lt;br /&gt;
|E3||227||INP&lt;br /&gt;
|-&lt;br /&gt;
|E4||228||LPOS&lt;br /&gt;
|-&lt;br /&gt;
|E5||229||POS&lt;br /&gt;
|-&lt;br /&gt;
|E6||230||SQR&lt;br /&gt;
|-&lt;br /&gt;
|E7||231||RND&lt;br /&gt;
|-&lt;br /&gt;
|E8||232||LOG&lt;br /&gt;
|-&lt;br /&gt;
|E9||233||EXP&lt;br /&gt;
|-&lt;br /&gt;
|EA||234||COS&lt;br /&gt;
|-&lt;br /&gt;
|EB||235||SIN&lt;br /&gt;
|-&lt;br /&gt;
|EC||236||TAN&lt;br /&gt;
|-&lt;br /&gt;
|ED||237||ATN&lt;br /&gt;
|-&lt;br /&gt;
|EE||238||PEEK&lt;br /&gt;
|-&lt;br /&gt;
|EF||239||EOF&lt;br /&gt;
|-&lt;br /&gt;
|F0||240||LOC&lt;br /&gt;
|-&lt;br /&gt;
|F1||241||LOF&lt;br /&gt;
|-&lt;br /&gt;
|F2||242||CINT&lt;br /&gt;
|-&lt;br /&gt;
|F3||243||CSNG&lt;br /&gt;
|-&lt;br /&gt;
|F4||244||CDBL&lt;br /&gt;
|-&lt;br /&gt;
|F5||245||FIX&lt;br /&gt;
|-&lt;br /&gt;
|F6||246||LEN&lt;br /&gt;
|-&lt;br /&gt;
|F7||247||STR$&lt;br /&gt;
|-&lt;br /&gt;
|F8||248||VAL&lt;br /&gt;
|-&lt;br /&gt;
|F9||249||ASC&lt;br /&gt;
|-&lt;br /&gt;
|FA||250||CHR$&lt;br /&gt;
|-&lt;br /&gt;
|FB||251||SPACE$&lt;br /&gt;
|-&lt;br /&gt;
|FC||252||LEFT$&lt;br /&gt;
|-&lt;br /&gt;
|FD||253||RIGHT$&lt;br /&gt;
|-&lt;br /&gt;
|FE||254||MID$&lt;br /&gt;
|-&lt;br /&gt;
|FF||255||' (QUOTE) || When tokenizing, the single quote character expands to three characters: a colon (3A), the byte for REM (8E), and then FF.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== File Format ==&lt;br /&gt;
&lt;br /&gt;
Tokenised BASIC code is a sequence of tokenized lines. Each tokenized line has the following format:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+ Format of a single tokenized line&lt;br /&gt;
!Name!!Length!!Description&lt;br /&gt;
|-&lt;br /&gt;
|PL PH&lt;br /&gt;
|2 bytes&lt;br /&gt;
|Address in RAM of the next line of BASIC; unsigned 16-bit integer, little-endian. PL PH equal to zero marks the end of a tokenized BASIC listing. All other values can be ignored as they are merely placeholders in the file. (See [[#Details for PL PH]].)&lt;br /&gt;
|-&lt;br /&gt;
|LL LH&lt;br /&gt;
|2 bytes&lt;br /&gt;
|Line number; unsigned 16-bit integer, little-endian.&lt;br /&gt;
|-&lt;br /&gt;
|B&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt; … B&amp;lt;sub&amp;gt;n&amp;lt;/sub&amp;gt;&lt;br /&gt;
|Any number of bytes&lt;br /&gt;
|Depending on the high bit, each byte is either a token or an ASCII character. &lt;br /&gt;
|-&lt;br /&gt;
|NULL&lt;br /&gt;
|1 byte&lt;br /&gt;
|NULL byte (&amp;lt;code&amp;gt;0x00&amp;lt;/code&amp;gt;) to signal end of line. &lt;br /&gt;
|}&lt;br /&gt;
              &lt;br /&gt;
The end of the tokenized data is signaled by two consecutive NULLs in the location where PL PH would normally begin a new line.&lt;br /&gt;
&lt;br /&gt;
=== Limits ===&lt;br /&gt;
&lt;br /&gt;
* Line numbers can range from 0 to 65529 (but see variances below).&lt;br /&gt;
* Tokenized line length is limited to 256 characters, including the trailing NULL byte. (To do: double check this.)&lt;br /&gt;
&lt;br /&gt;
=== Acceptable variances ===&lt;br /&gt;
&lt;br /&gt;
While Tandy BASIC will never generate such files, it has no problem loading a tokenized program that:&lt;br /&gt;
&lt;br /&gt;
* Has line numbers out of order; they will be sorted when loaded.&lt;br /&gt;
* Contains duplicate line numbers; previous line is discarded.&lt;br /&gt;
* Contains arbitrary bytes for PL PH; they are always regenerated during loading.&lt;br /&gt;
* Has a ^Z (ASCII 26) at the end of the file.&lt;br /&gt;
* Contains line numbers greater than the nominal maximum of 65529; this can be used to store hidden binary data [https://www.mail-archive.com/m100@lists.bitchin100.com/msg16195.html according to John R. Hogerhuis].&lt;br /&gt;
&lt;br /&gt;
Note that while these variances are accepted by actual hardware, emulators may not be able to handle such files. For example, the [https://sourceforge.net/projects/virtualt/ Virtual T] emulator (as of version 1.7 in 2022) refuses to load tokenized BASIC programs that have lines out of order, duplicate lines, or bogus values for PL PH.&lt;br /&gt;
&lt;br /&gt;
=== Details for PL PH ===&lt;br /&gt;
&lt;br /&gt;
The value of the 16-bit integer PL PH in a tokenized BASIC file is not used, except to mark the end of the listing when PL PH equals zero. During program load, Tandy BASIC always recalculates PL PH. Once in memory, PL PH is used to skip to the line required for GOTO, GOSUB, and READ, thus speeding up the program. &lt;br /&gt;
&lt;br /&gt;
(Stub. This is where the correct calculation of PL PH values will go.)&lt;br /&gt;
&lt;br /&gt;
== Format documentation ==&lt;br /&gt;
&lt;br /&gt;
* [https://m100.bitchin100.narkive.com/eP2uSl4J/tokenized-basic-programs-bytes-of-mystery Discussion of byte format on Bitchin 100 Mailing List]&lt;br /&gt;
* [http://www.club100.org/library/ups/tokens.do BASIC program to create a table of tokens]&lt;br /&gt;
* [https://archive.org/details/HiddenPowersOfTheTrs80Model100/page/n229/mode/2up?view=theater Hidden Powers of the TRS 80 Model 100]. Appendix B lists the BASIC token values for the Model 100. Other than the omission of 255 for a single quote remark, this reference matches what hackerb9 found programmatically for the Tandy 200.&lt;br /&gt;
* [http://web.archive.org/web/20220324135218/https://help.ayra.ch/trs80-reference#trs-80-model-100-basic-reference Ayra Model 100 BASIC Reference]&lt;br /&gt;
&lt;br /&gt;
== Other links ==&lt;br /&gt;
&lt;br /&gt;
* [https://github.com/hackerb9/tokenize/ Hackerb9's simple program for tokenizing BASIC code]&lt;br /&gt;
* [https://sourceforge.net/projects/virtualt/ A Tandy 200 &amp;amp; Model 100/102 emulator]&lt;br /&gt;
* [http://bitchin100.com/CloudT/ A TRS-80 Model 100 emulator that runs in a web browser]&lt;br /&gt;
&lt;br /&gt;
[[Category:Microsoft]]&lt;/div&gt;</summary>
		<author><name>Hackerb9</name></author>	</entry>

	<entry>
		<id>http://fileformats.archiveteam.org/wiki/Tandy_200_BASIC_tokenized_file</id>
		<title>Tandy 200 BASIC tokenized file</title>
		<link rel="alternate" type="text/html" href="http://fileformats.archiveteam.org/wiki/Tandy_200_BASIC_tokenized_file"/>
				<updated>2022-10-05T21:32:16Z</updated>
		
		<summary type="html">&lt;p&gt;Hackerb9: Move PL PH details to section instead of putting inside table&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{FormatInfo&lt;br /&gt;
|subcat=Source code&lt;br /&gt;
|subcat2=Tokenized BASIC&lt;br /&gt;
|released=1984&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
'''Tandy 200 BASIC''' was a version of Microsoft BASIC for the Radio Shack Tandy 200 computer. The tokenizations for the TRS-80 Model 100 and Tandy 102 appear to be identical. The NEC PC-8201/8300 format is not the same, but should be similar.&lt;br /&gt;
&lt;br /&gt;
== Tokens ==&lt;br /&gt;
All BASIC tokens on the Tandy 200 are a single byte with a value from 128 to 255. &lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+ Table mapping token values to BASIC keywords&lt;br /&gt;
! title=&amp;quot;The value of the token in hexadecimal&amp;quot; | Hex&lt;br /&gt;
! title=&amp;quot;The value of the token in decimal&amp;quot; | Dec&lt;br /&gt;
! title=&amp;quot;The BASIC keyword the token stands for&amp;quot; | Keyword &lt;br /&gt;
! title=&amp;quot;Miscellany&amp;quot; | Notes&lt;br /&gt;
|-&lt;br /&gt;
|-&lt;br /&gt;
|80||128||END&lt;br /&gt;
|-&lt;br /&gt;
|81||129||FOR&lt;br /&gt;
|-&lt;br /&gt;
|82||130||NEXT&lt;br /&gt;
|-&lt;br /&gt;
|83||131||DATA&lt;br /&gt;
|-&lt;br /&gt;
|84||132||INPUT&lt;br /&gt;
|-&lt;br /&gt;
|85||133||DIM&lt;br /&gt;
|-&lt;br /&gt;
|86||134||READ&lt;br /&gt;
|-&lt;br /&gt;
|87||135||LET&lt;br /&gt;
|-&lt;br /&gt;
|88||136||GOTO&lt;br /&gt;
|-&lt;br /&gt;
|89||137||RUN&lt;br /&gt;
|-&lt;br /&gt;
|8A||138||IF&lt;br /&gt;
|-&lt;br /&gt;
|8B||139||RESTORE&lt;br /&gt;
|-&lt;br /&gt;
|8C||140||GOSUB&lt;br /&gt;
|-&lt;br /&gt;
|8D||141||RETURN&lt;br /&gt;
|-&lt;br /&gt;
|8E||142||REM&lt;br /&gt;
|-&lt;br /&gt;
|8F||143||STOP&lt;br /&gt;
|-&lt;br /&gt;
|90||144||WIDTH&lt;br /&gt;
|-&lt;br /&gt;
|91||145||ELSE||When tokenizing, the Tandy 200 always adds a colon (':') before the ELSE token (3A 91). If the user actually writes :ELSE it is tokenized as 3A 3A 91.&lt;br /&gt;
|-&lt;br /&gt;
|92||146||LINE&lt;br /&gt;
|-&lt;br /&gt;
|93||147||EDIT&lt;br /&gt;
|-&lt;br /&gt;
|94||148||ERROR&lt;br /&gt;
|-&lt;br /&gt;
|95||149||RESUME&lt;br /&gt;
|-&lt;br /&gt;
|96||150||OUT&lt;br /&gt;
|-&lt;br /&gt;
|97||151||ON&lt;br /&gt;
|-&lt;br /&gt;
|98||152||DSKO$&lt;br /&gt;
|-&lt;br /&gt;
|99||153||OPEN&lt;br /&gt;
|-&lt;br /&gt;
|9A||154||CLOSE&lt;br /&gt;
|-&lt;br /&gt;
|9B||155||LOAD||Note that LOADM is simply the token for LOAD followed by an ASCII 'M'. &lt;br /&gt;
|-&lt;br /&gt;
|9C||156||MERGE&lt;br /&gt;
|-QUOTE&lt;br /&gt;
|9D||157||FILES&lt;br /&gt;
|-&lt;br /&gt;
|9E||158||SAVE&lt;br /&gt;
|-&lt;br /&gt;
|9F||159||LFILES&lt;br /&gt;
|-&lt;br /&gt;
|A0||160||LPRINT&lt;br /&gt;
|-&lt;br /&gt;
|A1||161||DEF&lt;br /&gt;
|-&lt;br /&gt;
|A2||162||POKE&lt;br /&gt;
|-&lt;br /&gt;
|A3||163||PRINT&lt;br /&gt;
|-&lt;br /&gt;
|A4||164||CONT&lt;br /&gt;
|-&lt;br /&gt;
|A5||165||LIST&lt;br /&gt;
|-&lt;br /&gt;
|A6||166||LLIST&lt;br /&gt;
|-&lt;br /&gt;
|A7||167||CLEAR&lt;br /&gt;
|-&lt;br /&gt;
|A8||168||CLOAD&lt;br /&gt;
|-&lt;br /&gt;
|A9||169||CSAVE&lt;br /&gt;
|-&lt;br /&gt;
|AA||170||TIME$&lt;br /&gt;
|-&lt;br /&gt;
|AB||171||DATE$&lt;br /&gt;
|-&lt;br /&gt;
|AC||172||DAY$&lt;br /&gt;
|-&lt;br /&gt;
|AD||173||COM&lt;br /&gt;
|-&lt;br /&gt;
|AE||174||MDM&lt;br /&gt;
|-&lt;br /&gt;
|AF||175||KEY&lt;br /&gt;
|-&lt;br /&gt;
|B0||176||CLS&lt;br /&gt;
|-&lt;br /&gt;
|B1||177||BEEP&lt;br /&gt;
|-&lt;br /&gt;
|B2||178||SOUND&lt;br /&gt;
|-&lt;br /&gt;
|B3||179||LCOPY&lt;br /&gt;
|-&lt;br /&gt;
|B4||180||PSET&lt;br /&gt;
|-&lt;br /&gt;
|B5||181||PRESET&lt;br /&gt;
|-&lt;br /&gt;
|B6||182||MOTOR&lt;br /&gt;
|-&lt;br /&gt;
|B7||183||MAX&lt;br /&gt;
|-&lt;br /&gt;
|B8||184||POWER&lt;br /&gt;
|-&lt;br /&gt;
|B9||185||CALL&lt;br /&gt;
|-&lt;br /&gt;
|BA||186||MENU&lt;br /&gt;
|-&lt;br /&gt;
|BB||187||IPL&lt;br /&gt;
|-&lt;br /&gt;
|BC||188||NAME&lt;br /&gt;
|-&lt;br /&gt;
|BD||189||KILL&lt;br /&gt;
|-&lt;br /&gt;
|BE||190||SCREEN&lt;br /&gt;
|-&lt;br /&gt;
|BF||191||NEW&lt;br /&gt;
|-&lt;br /&gt;
|C0||192||TAB(&lt;br /&gt;
|-&lt;br /&gt;
|C1||193||TO&lt;br /&gt;
|-&lt;br /&gt;
|C2||194||USING&lt;br /&gt;
|-&lt;br /&gt;
|C3||195||VARPTR&lt;br /&gt;
|-&lt;br /&gt;
|C4||196||ERL&lt;br /&gt;
|-&lt;br /&gt;
|C5||197||ERR&lt;br /&gt;
|-&lt;br /&gt;
|C6||198||STRING$&lt;br /&gt;
|-&lt;br /&gt;
|C7||199||INSTR&lt;br /&gt;
|-&lt;br /&gt;
|C8||200||DSKI$&lt;br /&gt;
|-&lt;br /&gt;
|C9||201||INKEY$&lt;br /&gt;
|-&lt;br /&gt;
|CA||202||CSRLIN&lt;br /&gt;
|-&lt;br /&gt;
|CB||203||OFF&lt;br /&gt;
|-&lt;br /&gt;
|CC||204||HIMEM&lt;br /&gt;
|-&lt;br /&gt;
|CD||205||THEN&lt;br /&gt;
|-&lt;br /&gt;
|CE||206||NOT&lt;br /&gt;
|-&lt;br /&gt;
|CF||207||STEP&lt;br /&gt;
|-&lt;br /&gt;
|D0||208||+&lt;br /&gt;
|-&lt;br /&gt;
|D1||209||-&lt;br /&gt;
|-&lt;br /&gt;
|D2||210||*&lt;br /&gt;
|-&lt;br /&gt;
|D3||211||/&lt;br /&gt;
|-&lt;br /&gt;
|D4||212||^&lt;br /&gt;
|-&lt;br /&gt;
|D5||213||AND&lt;br /&gt;
|-&lt;br /&gt;
|D6||214||OR&lt;br /&gt;
|-&lt;br /&gt;
|D7||215||XOR&lt;br /&gt;
|-&lt;br /&gt;
|D8||216||EQV&lt;br /&gt;
|-&lt;br /&gt;
|D9||217||IMP&lt;br /&gt;
|-&lt;br /&gt;
|DA||218||MOD&lt;br /&gt;
|-&lt;br /&gt;
|DB||219||\&lt;br /&gt;
|-&lt;br /&gt;
|DC||220||&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|DD||221||=&lt;br /&gt;
|-&lt;br /&gt;
|DE||222||&amp;lt;&lt;br /&gt;
|-&lt;br /&gt;
|DF||223||SGN&lt;br /&gt;
|-&lt;br /&gt;
|E0||224||INT&lt;br /&gt;
|-&lt;br /&gt;
|E1||225||ABS&lt;br /&gt;
|-&lt;br /&gt;
|E2||226||FRE&lt;br /&gt;
|-&lt;br /&gt;
|E3||227||INP&lt;br /&gt;
|-&lt;br /&gt;
|E4||228||LPOS&lt;br /&gt;
|-&lt;br /&gt;
|E5||229||POS&lt;br /&gt;
|-&lt;br /&gt;
|E6||230||SQR&lt;br /&gt;
|-&lt;br /&gt;
|E7||231||RND&lt;br /&gt;
|-&lt;br /&gt;
|E8||232||LOG&lt;br /&gt;
|-&lt;br /&gt;
|E9||233||EXP&lt;br /&gt;
|-&lt;br /&gt;
|EA||234||COS&lt;br /&gt;
|-&lt;br /&gt;
|EB||235||SIN&lt;br /&gt;
|-&lt;br /&gt;
|EC||236||TAN&lt;br /&gt;
|-&lt;br /&gt;
|ED||237||ATN&lt;br /&gt;
|-&lt;br /&gt;
|EE||238||PEEK&lt;br /&gt;
|-&lt;br /&gt;
|EF||239||EOF&lt;br /&gt;
|-&lt;br /&gt;
|F0||240||LOC&lt;br /&gt;
|-&lt;br /&gt;
|F1||241||LOF&lt;br /&gt;
|-&lt;br /&gt;
|F2||242||CINT&lt;br /&gt;
|-&lt;br /&gt;
|F3||243||CSNG&lt;br /&gt;
|-&lt;br /&gt;
|F4||244||CDBL&lt;br /&gt;
|-&lt;br /&gt;
|F5||245||FIX&lt;br /&gt;
|-&lt;br /&gt;
|F6||246||LEN&lt;br /&gt;
|-&lt;br /&gt;
|F7||247||STR$&lt;br /&gt;
|-&lt;br /&gt;
|F8||248||VAL&lt;br /&gt;
|-&lt;br /&gt;
|F9||249||ASC&lt;br /&gt;
|-&lt;br /&gt;
|FA||250||CHR$&lt;br /&gt;
|-&lt;br /&gt;
|FB||251||SPACE$&lt;br /&gt;
|-&lt;br /&gt;
|FC||252||LEFT$&lt;br /&gt;
|-&lt;br /&gt;
|FD||253||RIGHT$&lt;br /&gt;
|-&lt;br /&gt;
|FE||254||MID$&lt;br /&gt;
|-&lt;br /&gt;
|FF||255||' (QUOTE) || When tokenizing, the single quote character expands to three characters: a colon (3A), the byte for REM (8E), and then FF.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== File Format ==&lt;br /&gt;
&lt;br /&gt;
Tokenised BASIC code is a sequence of tokenized lines. Each tokenized line has the following format:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+ Format of a single tokenized line&lt;br /&gt;
!Name!!Length!!Description&lt;br /&gt;
|-&lt;br /&gt;
|PL PH&lt;br /&gt;
|2 bytes&lt;br /&gt;
|Address in RAM of the next line of BASIC; unsigned 16-bit integer, little-endian. PL PH equal to zero marks the end of a tokenized BASIC listing. All other values can be ignored as they are merely placeholders in the file. (See [[#Details for PL PH]].)&lt;br /&gt;
|-&lt;br /&gt;
|LL LH&lt;br /&gt;
|2 bytes&lt;br /&gt;
|Line number; unsigned 16-bit integer, little-endian.&lt;br /&gt;
|-&lt;br /&gt;
|B&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt; … B&amp;lt;sub&amp;gt;n&amp;lt;/sub&amp;gt;&lt;br /&gt;
|Any number of bytes&lt;br /&gt;
|Depending on the high bit, each byte is either a token or an ASCII character. &lt;br /&gt;
|-&lt;br /&gt;
|NULL&lt;br /&gt;
|1 byte&lt;br /&gt;
|NULL byte (&amp;lt;code&amp;gt;0x00&amp;lt;/code&amp;gt;) to signal end of line. &lt;br /&gt;
|}&lt;br /&gt;
              &lt;br /&gt;
The end of the tokenized data is signaled by two consecutive NULLs in the location where PL PH would normally begin a new line.&lt;br /&gt;
&lt;br /&gt;
=== Limits ===&lt;br /&gt;
&lt;br /&gt;
* Line numbers can range from 0 to 65529 (but see variances below).&lt;br /&gt;
* Tokenized line length is limited to 256 characters, including the trailing NULL byte. (To do: double check this.)&lt;br /&gt;
&lt;br /&gt;
=== Acceptable variances ===&lt;br /&gt;
&lt;br /&gt;
While Tandy BASIC will never generate such files, it has no problem loading a tokenized program that:&lt;br /&gt;
&lt;br /&gt;
* Has line numbers out of order; they will be sorted when loaded.&lt;br /&gt;
* Contains duplicate line numbers; previous line is discarded.&lt;br /&gt;
* Contains arbitrary bytes for PL PH; they are always regenerated during loading.&lt;br /&gt;
* Has a ^Z (ASCII 26) at the end of the file.&lt;br /&gt;
* Contains illegal line numbers; this can be used to store hidden binary data [https://www.mail-archive.com/m100@lists.bitchin100.com/msg16195.html according to John R. Hogerhuis].&lt;br /&gt;
&lt;br /&gt;
Note that while these variances are accepted on an actual Model T device (Model 100, Tandy 200, or Tandy 102), emulators may not be able to handle such files. For example, the [https://sourceforge.net/projects/virtualt/ Virtual T] emulator (as of version 1.7 in 2022) refuses to load tokenized BASIC programs that have lines out of order, duplicate lines, or bogus values for PL PH.&lt;br /&gt;
&lt;br /&gt;
=== Details for PL PH ===&lt;br /&gt;
&lt;br /&gt;
The value of the 16-bit integer PL PH in a tokenized BASIC file is not used, except to mark the end of the listing when PL PH equals zero. During program load, Tandy BASIC always recalculates PL PH. Once in memory, PL PH is used to skip to the line required for GOTO, GOSUB, and READ, thus speeding up the program. &lt;br /&gt;
&lt;br /&gt;
(Stub. This is where the correct calculation of PL PH values will go.)&lt;br /&gt;
&lt;br /&gt;
== Format documentation ==&lt;br /&gt;
&lt;br /&gt;
* [https://m100.bitchin100.narkive.com/eP2uSl4J/tokenized-basic-programs-bytes-of-mystery Discussion of byte format on Bitchin 100 Mailing List]&lt;br /&gt;
* [http://www.club100.org/library/ups/tokens.do BASIC program to create a table of tokens]&lt;br /&gt;
* [https://archive.org/details/HiddenPowersOfTheTrs80Model100/page/n229/mode/2up?view=theater Hidden Powers of the TRS 80 Model 100]. Appendix B lists the BASIC token values for the Model 100. Other than the omission of 255 for a single quote remark, this reference matches what hackerb9 found programmatically for the Tandy 200.&lt;br /&gt;
* [http://web.archive.org/web/20220324135218/https://help.ayra.ch/trs80-reference#trs-80-model-100-basic-reference Ayra Model 100 BASIC Reference]&lt;br /&gt;
&lt;br /&gt;
== Other links ==&lt;br /&gt;
&lt;br /&gt;
* [https://github.com/hackerb9/tokenize/ Hackerb9's simple program for tokenizing BASIC code]&lt;br /&gt;
* [https://sourceforge.net/projects/virtualt/ A Tandy 200 &amp;amp; Model 100/102 emulator]&lt;br /&gt;
* [http://bitchin100.com/CloudT/ A TRS-80 Model 100 emulator that runs in a web browser]&lt;br /&gt;
&lt;br /&gt;
[[Category:Microsoft]]&lt;/div&gt;</summary>
		<author><name>Hackerb9</name></author>	</entry>

	<entry>
		<id>http://fileformats.archiveteam.org/wiki/Tandy_200_BASIC_tokenized_file</id>
		<title>Tandy 200 BASIC tokenized file</title>
		<link rel="alternate" type="text/html" href="http://fileformats.archiveteam.org/wiki/Tandy_200_BASIC_tokenized_file"/>
				<updated>2022-10-05T21:22:34Z</updated>
		
		<summary type="html">&lt;p&gt;Hackerb9: /* File Format */ Shorten description by simply saying &amp;quot;high bit&amp;quot; instead of talking about &amp;gt;= 128.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{FormatInfo&lt;br /&gt;
|subcat=Source code&lt;br /&gt;
|subcat2=Tokenized BASIC&lt;br /&gt;
|released=1984&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
'''Tandy 200 BASIC''' was a version of Microsoft BASIC for the Radio Shack Tandy 200 computer. The tokenizations for the TRS-80 Model 100 and Tandy 102 appear to be identical. The NEC PC-8201/8300 format is not the same, but should be similar.&lt;br /&gt;
&lt;br /&gt;
== Tokens ==&lt;br /&gt;
All BASIC tokens on the Tandy 200 are a single byte with a value from 128 to 255. &lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+ Table mapping token values to BASIC keywords&lt;br /&gt;
! title=&amp;quot;The value of the token in hexadecimal&amp;quot; | Hex&lt;br /&gt;
! title=&amp;quot;The value of the token in decimal&amp;quot; | Dec&lt;br /&gt;
! title=&amp;quot;The BASIC keyword the token stands for&amp;quot; | Keyword &lt;br /&gt;
! title=&amp;quot;Miscellany&amp;quot; | Notes&lt;br /&gt;
|-&lt;br /&gt;
|-&lt;br /&gt;
|80||128||END&lt;br /&gt;
|-&lt;br /&gt;
|81||129||FOR&lt;br /&gt;
|-&lt;br /&gt;
|82||130||NEXT&lt;br /&gt;
|-&lt;br /&gt;
|83||131||DATA&lt;br /&gt;
|-&lt;br /&gt;
|84||132||INPUT&lt;br /&gt;
|-&lt;br /&gt;
|85||133||DIM&lt;br /&gt;
|-&lt;br /&gt;
|86||134||READ&lt;br /&gt;
|-&lt;br /&gt;
|87||135||LET&lt;br /&gt;
|-&lt;br /&gt;
|88||136||GOTO&lt;br /&gt;
|-&lt;br /&gt;
|89||137||RUN&lt;br /&gt;
|-&lt;br /&gt;
|8A||138||IF&lt;br /&gt;
|-&lt;br /&gt;
|8B||139||RESTORE&lt;br /&gt;
|-&lt;br /&gt;
|8C||140||GOSUB&lt;br /&gt;
|-&lt;br /&gt;
|8D||141||RETURN&lt;br /&gt;
|-&lt;br /&gt;
|8E||142||REM&lt;br /&gt;
|-&lt;br /&gt;
|8F||143||STOP&lt;br /&gt;
|-&lt;br /&gt;
|90||144||WIDTH&lt;br /&gt;
|-&lt;br /&gt;
|91||145||ELSE||When tokenizing, the Tandy 200 always adds a colon (':') before the ELSE token (3A 91). If the user actually writes :ELSE it is tokenized as 3A 3A 91.&lt;br /&gt;
|-&lt;br /&gt;
|92||146||LINE&lt;br /&gt;
|-&lt;br /&gt;
|93||147||EDIT&lt;br /&gt;
|-&lt;br /&gt;
|94||148||ERROR&lt;br /&gt;
|-&lt;br /&gt;
|95||149||RESUME&lt;br /&gt;
|-&lt;br /&gt;
|96||150||OUT&lt;br /&gt;
|-&lt;br /&gt;
|97||151||ON&lt;br /&gt;
|-&lt;br /&gt;
|98||152||DSKO$&lt;br /&gt;
|-&lt;br /&gt;
|99||153||OPEN&lt;br /&gt;
|-&lt;br /&gt;
|9A||154||CLOSE&lt;br /&gt;
|-&lt;br /&gt;
|9B||155||LOAD||Note that LOADM is simply the token for LOAD followed by an ASCII 'M'. &lt;br /&gt;
|-&lt;br /&gt;
|9C||156||MERGE&lt;br /&gt;
|-QUOTE&lt;br /&gt;
|9D||157||FILES&lt;br /&gt;
|-&lt;br /&gt;
|9E||158||SAVE&lt;br /&gt;
|-&lt;br /&gt;
|9F||159||LFILES&lt;br /&gt;
|-&lt;br /&gt;
|A0||160||LPRINT&lt;br /&gt;
|-&lt;br /&gt;
|A1||161||DEF&lt;br /&gt;
|-&lt;br /&gt;
|A2||162||POKE&lt;br /&gt;
|-&lt;br /&gt;
|A3||163||PRINT&lt;br /&gt;
|-&lt;br /&gt;
|A4||164||CONT&lt;br /&gt;
|-&lt;br /&gt;
|A5||165||LIST&lt;br /&gt;
|-&lt;br /&gt;
|A6||166||LLIST&lt;br /&gt;
|-&lt;br /&gt;
|A7||167||CLEAR&lt;br /&gt;
|-&lt;br /&gt;
|A8||168||CLOAD&lt;br /&gt;
|-&lt;br /&gt;
|A9||169||CSAVE&lt;br /&gt;
|-&lt;br /&gt;
|AA||170||TIME$&lt;br /&gt;
|-&lt;br /&gt;
|AB||171||DATE$&lt;br /&gt;
|-&lt;br /&gt;
|AC||172||DAY$&lt;br /&gt;
|-&lt;br /&gt;
|AD||173||COM&lt;br /&gt;
|-&lt;br /&gt;
|AE||174||MDM&lt;br /&gt;
|-&lt;br /&gt;
|AF||175||KEY&lt;br /&gt;
|-&lt;br /&gt;
|B0||176||CLS&lt;br /&gt;
|-&lt;br /&gt;
|B1||177||BEEP&lt;br /&gt;
|-&lt;br /&gt;
|B2||178||SOUND&lt;br /&gt;
|-&lt;br /&gt;
|B3||179||LCOPY&lt;br /&gt;
|-&lt;br /&gt;
|B4||180||PSET&lt;br /&gt;
|-&lt;br /&gt;
|B5||181||PRESET&lt;br /&gt;
|-&lt;br /&gt;
|B6||182||MOTOR&lt;br /&gt;
|-&lt;br /&gt;
|B7||183||MAX&lt;br /&gt;
|-&lt;br /&gt;
|B8||184||POWER&lt;br /&gt;
|-&lt;br /&gt;
|B9||185||CALL&lt;br /&gt;
|-&lt;br /&gt;
|BA||186||MENU&lt;br /&gt;
|-&lt;br /&gt;
|BB||187||IPL&lt;br /&gt;
|-&lt;br /&gt;
|BC||188||NAME&lt;br /&gt;
|-&lt;br /&gt;
|BD||189||KILL&lt;br /&gt;
|-&lt;br /&gt;
|BE||190||SCREEN&lt;br /&gt;
|-&lt;br /&gt;
|BF||191||NEW&lt;br /&gt;
|-&lt;br /&gt;
|C0||192||TAB(&lt;br /&gt;
|-&lt;br /&gt;
|C1||193||TO&lt;br /&gt;
|-&lt;br /&gt;
|C2||194||USING&lt;br /&gt;
|-&lt;br /&gt;
|C3||195||VARPTR&lt;br /&gt;
|-&lt;br /&gt;
|C4||196||ERL&lt;br /&gt;
|-&lt;br /&gt;
|C5||197||ERR&lt;br /&gt;
|-&lt;br /&gt;
|C6||198||STRING$&lt;br /&gt;
|-&lt;br /&gt;
|C7||199||INSTR&lt;br /&gt;
|-&lt;br /&gt;
|C8||200||DSKI$&lt;br /&gt;
|-&lt;br /&gt;
|C9||201||INKEY$&lt;br /&gt;
|-&lt;br /&gt;
|CA||202||CSRLIN&lt;br /&gt;
|-&lt;br /&gt;
|CB||203||OFF&lt;br /&gt;
|-&lt;br /&gt;
|CC||204||HIMEM&lt;br /&gt;
|-&lt;br /&gt;
|CD||205||THEN&lt;br /&gt;
|-&lt;br /&gt;
|CE||206||NOT&lt;br /&gt;
|-&lt;br /&gt;
|CF||207||STEP&lt;br /&gt;
|-&lt;br /&gt;
|D0||208||+&lt;br /&gt;
|-&lt;br /&gt;
|D1||209||-&lt;br /&gt;
|-&lt;br /&gt;
|D2||210||*&lt;br /&gt;
|-&lt;br /&gt;
|D3||211||/&lt;br /&gt;
|-&lt;br /&gt;
|D4||212||^&lt;br /&gt;
|-&lt;br /&gt;
|D5||213||AND&lt;br /&gt;
|-&lt;br /&gt;
|D6||214||OR&lt;br /&gt;
|-&lt;br /&gt;
|D7||215||XOR&lt;br /&gt;
|-&lt;br /&gt;
|D8||216||EQV&lt;br /&gt;
|-&lt;br /&gt;
|D9||217||IMP&lt;br /&gt;
|-&lt;br /&gt;
|DA||218||MOD&lt;br /&gt;
|-&lt;br /&gt;
|DB||219||\&lt;br /&gt;
|-&lt;br /&gt;
|DC||220||&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|DD||221||=&lt;br /&gt;
|-&lt;br /&gt;
|DE||222||&amp;lt;&lt;br /&gt;
|-&lt;br /&gt;
|DF||223||SGN&lt;br /&gt;
|-&lt;br /&gt;
|E0||224||INT&lt;br /&gt;
|-&lt;br /&gt;
|E1||225||ABS&lt;br /&gt;
|-&lt;br /&gt;
|E2||226||FRE&lt;br /&gt;
|-&lt;br /&gt;
|E3||227||INP&lt;br /&gt;
|-&lt;br /&gt;
|E4||228||LPOS&lt;br /&gt;
|-&lt;br /&gt;
|E5||229||POS&lt;br /&gt;
|-&lt;br /&gt;
|E6||230||SQR&lt;br /&gt;
|-&lt;br /&gt;
|E7||231||RND&lt;br /&gt;
|-&lt;br /&gt;
|E8||232||LOG&lt;br /&gt;
|-&lt;br /&gt;
|E9||233||EXP&lt;br /&gt;
|-&lt;br /&gt;
|EA||234||COS&lt;br /&gt;
|-&lt;br /&gt;
|EB||235||SIN&lt;br /&gt;
|-&lt;br /&gt;
|EC||236||TAN&lt;br /&gt;
|-&lt;br /&gt;
|ED||237||ATN&lt;br /&gt;
|-&lt;br /&gt;
|EE||238||PEEK&lt;br /&gt;
|-&lt;br /&gt;
|EF||239||EOF&lt;br /&gt;
|-&lt;br /&gt;
|F0||240||LOC&lt;br /&gt;
|-&lt;br /&gt;
|F1||241||LOF&lt;br /&gt;
|-&lt;br /&gt;
|F2||242||CINT&lt;br /&gt;
|-&lt;br /&gt;
|F3||243||CSNG&lt;br /&gt;
|-&lt;br /&gt;
|F4||244||CDBL&lt;br /&gt;
|-&lt;br /&gt;
|F5||245||FIX&lt;br /&gt;
|-&lt;br /&gt;
|F6||246||LEN&lt;br /&gt;
|-&lt;br /&gt;
|F7||247||STR$&lt;br /&gt;
|-&lt;br /&gt;
|F8||248||VAL&lt;br /&gt;
|-&lt;br /&gt;
|F9||249||ASC&lt;br /&gt;
|-&lt;br /&gt;
|FA||250||CHR$&lt;br /&gt;
|-&lt;br /&gt;
|FB||251||SPACE$&lt;br /&gt;
|-&lt;br /&gt;
|FC||252||LEFT$&lt;br /&gt;
|-&lt;br /&gt;
|FD||253||RIGHT$&lt;br /&gt;
|-&lt;br /&gt;
|FE||254||MID$&lt;br /&gt;
|-&lt;br /&gt;
|FF||255||' (QUOTE) || When tokenizing, the single quote character expands to three characters: a colon (3A), the byte for REM (8E), and then FF.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== File Format ==&lt;br /&gt;
&lt;br /&gt;
Tokenised BASIC code is a sequence of tokenized lines. Each tokenized line has the following format:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+ Format of a single tokenized line&lt;br /&gt;
!Name!!Length!!Description&lt;br /&gt;
|-&lt;br /&gt;
|PL PH&lt;br /&gt;
|2 bytes&lt;br /&gt;
|Address in RAM of the next line of BASIC; unsigned 16-bit integer, little-endian. PL PH equal to zero marks the end of a tokenized BASIC listing. All other values can be ignored as they are merely placeholders in the file. During program load, Tandy BASIC always recalculates PL PH. Once in memory, PL PH is used to skip to the line required for GOTO, GOSUB, and READ, thus speeding up the program. &lt;br /&gt;
|-&lt;br /&gt;
|LL LH&lt;br /&gt;
|2 bytes&lt;br /&gt;
|Line number; unsigned 16-bit integer, little-endian.&lt;br /&gt;
|-&lt;br /&gt;
|B&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt; … B&amp;lt;sub&amp;gt;n&amp;lt;/sub&amp;gt;&lt;br /&gt;
|Any number of bytes&lt;br /&gt;
|Depending on the high bit, each byte is either a token or an ASCII character. &lt;br /&gt;
|-&lt;br /&gt;
|NULL&lt;br /&gt;
|1 byte&lt;br /&gt;
|NULL byte (&amp;lt;code&amp;gt;0x00&amp;lt;/code&amp;gt;) to signal end of line. &lt;br /&gt;
|}&lt;br /&gt;
              &lt;br /&gt;
The end of the tokenized data is signaled by two consecutive NULLs in the location where PL PH would normally begin a new line.&lt;br /&gt;
&lt;br /&gt;
=== Limits ===&lt;br /&gt;
&lt;br /&gt;
* Line numbers can range from 0 to 65529 (but see variances below).&lt;br /&gt;
* Tokenized line length is limited to 256 characters, including the trailing NULL byte. (To do: double check this.)&lt;br /&gt;
&lt;br /&gt;
=== Acceptable variances ===&lt;br /&gt;
&lt;br /&gt;
While Tandy BASIC will never generate such files, it has no problem loading a tokenized program that:&lt;br /&gt;
&lt;br /&gt;
* Has line numbers out of order; they will be sorted when loaded.&lt;br /&gt;
* Contains duplicate line numbers; previous line is discarded.&lt;br /&gt;
* Contains arbitrary bytes for PL PH; they are always regenerated during loading.&lt;br /&gt;
* Has a ^Z (ASCII 26) at the end of the file.&lt;br /&gt;
* Contains illegal line numbers; this can be used to store hidden binary data [https://www.mail-archive.com/m100@lists.bitchin100.com/msg16195.html according to John R. Hogerhuis].&lt;br /&gt;
&lt;br /&gt;
Note that while these variances are accepted on an actual Model T device (Model 100, Tandy 200, or Tandy 102), emulators may not be able to handle such files. For example, the [https://sourceforge.net/projects/virtualt/ Virtual T] emulator (as of version 1.7 in 2022) refuses to load tokenized BASIC programs that have lines out of order, duplicate lines, or bogus values for PL PH.&lt;br /&gt;
&lt;br /&gt;
=== Details for PL PH ===&lt;br /&gt;
&lt;br /&gt;
(Stub. This is where the correct calculation of PL PH values will go.)&lt;br /&gt;
&lt;br /&gt;
== Format documentation ==&lt;br /&gt;
&lt;br /&gt;
* [https://m100.bitchin100.narkive.com/eP2uSl4J/tokenized-basic-programs-bytes-of-mystery Discussion of byte format on Bitchin 100 Mailing List]&lt;br /&gt;
* [http://www.club100.org/library/ups/tokens.do BASIC program to create a table of tokens]&lt;br /&gt;
* [https://archive.org/details/HiddenPowersOfTheTrs80Model100/page/n229/mode/2up?view=theater Hidden Powers of the TRS 80 Model 100]. Appendix B lists the BASIC token values for the Model 100. Other than the omission of 255 for a single quote remark, this reference matches what hackerb9 found programmatically for the Tandy 200.&lt;br /&gt;
* [http://web.archive.org/web/20220324135218/https://help.ayra.ch/trs80-reference#trs-80-model-100-basic-reference Ayra Model 100 BASIC Reference]&lt;br /&gt;
&lt;br /&gt;
== Other links ==&lt;br /&gt;
&lt;br /&gt;
* [https://github.com/hackerb9/tokenize/ Hackerb9's simple program for tokenizing BASIC code]&lt;br /&gt;
* [https://sourceforge.net/projects/virtualt/ A Tandy 200 &amp;amp; Model 100/102 emulator]&lt;br /&gt;
* [http://bitchin100.com/CloudT/ A TRS-80 Model 100 emulator that runs in a web browser]&lt;br /&gt;
&lt;br /&gt;
[[Category:Microsoft]]&lt;/div&gt;</summary>
		<author><name>Hackerb9</name></author>	</entry>

	<entry>
		<id>http://fileformats.archiveteam.org/wiki/Tandy_200_BASIC_tokenized_file</id>
		<title>Tandy 200 BASIC tokenized file</title>
		<link rel="alternate" type="text/html" href="http://fileformats.archiveteam.org/wiki/Tandy_200_BASIC_tokenized_file"/>
				<updated>2022-10-05T21:09:24Z</updated>
		
		<summary type="html">&lt;p&gt;Hackerb9: /* Tokens */ Add caption for table of tokens&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{FormatInfo&lt;br /&gt;
|subcat=Source code&lt;br /&gt;
|subcat2=Tokenized BASIC&lt;br /&gt;
|released=1984&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
'''Tandy 200 BASIC''' was a version of Microsoft BASIC for the Radio Shack Tandy 200 computer. The tokenizations for the TRS-80 Model 100 and Tandy 102 appear to be identical. The NEC PC-8201/8300 format is not the same, but should be similar.&lt;br /&gt;
&lt;br /&gt;
== Tokens ==&lt;br /&gt;
All BASIC tokens on the Tandy 200 are a single byte with a value from 128 to 255. &lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+ Table mapping token values to BASIC keywords&lt;br /&gt;
! title=&amp;quot;The value of the token in hexadecimal&amp;quot; | Hex&lt;br /&gt;
! title=&amp;quot;The value of the token in decimal&amp;quot; | Dec&lt;br /&gt;
! title=&amp;quot;The BASIC keyword the token stands for&amp;quot; | Keyword &lt;br /&gt;
! title=&amp;quot;Miscellany&amp;quot; | Notes&lt;br /&gt;
|-&lt;br /&gt;
|-&lt;br /&gt;
|80||128||END&lt;br /&gt;
|-&lt;br /&gt;
|81||129||FOR&lt;br /&gt;
|-&lt;br /&gt;
|82||130||NEXT&lt;br /&gt;
|-&lt;br /&gt;
|83||131||DATA&lt;br /&gt;
|-&lt;br /&gt;
|84||132||INPUT&lt;br /&gt;
|-&lt;br /&gt;
|85||133||DIM&lt;br /&gt;
|-&lt;br /&gt;
|86||134||READ&lt;br /&gt;
|-&lt;br /&gt;
|87||135||LET&lt;br /&gt;
|-&lt;br /&gt;
|88||136||GOTO&lt;br /&gt;
|-&lt;br /&gt;
|89||137||RUN&lt;br /&gt;
|-&lt;br /&gt;
|8A||138||IF&lt;br /&gt;
|-&lt;br /&gt;
|8B||139||RESTORE&lt;br /&gt;
|-&lt;br /&gt;
|8C||140||GOSUB&lt;br /&gt;
|-&lt;br /&gt;
|8D||141||RETURN&lt;br /&gt;
|-&lt;br /&gt;
|8E||142||REM&lt;br /&gt;
|-&lt;br /&gt;
|8F||143||STOP&lt;br /&gt;
|-&lt;br /&gt;
|90||144||WIDTH&lt;br /&gt;
|-&lt;br /&gt;
|91||145||ELSE||When tokenizing, the Tandy 200 always adds a colon (':') before the ELSE token (3A 91). If the user actually writes :ELSE it is tokenized as 3A 3A 91.&lt;br /&gt;
|-&lt;br /&gt;
|92||146||LINE&lt;br /&gt;
|-&lt;br /&gt;
|93||147||EDIT&lt;br /&gt;
|-&lt;br /&gt;
|94||148||ERROR&lt;br /&gt;
|-&lt;br /&gt;
|95||149||RESUME&lt;br /&gt;
|-&lt;br /&gt;
|96||150||OUT&lt;br /&gt;
|-&lt;br /&gt;
|97||151||ON&lt;br /&gt;
|-&lt;br /&gt;
|98||152||DSKO$&lt;br /&gt;
|-&lt;br /&gt;
|99||153||OPEN&lt;br /&gt;
|-&lt;br /&gt;
|9A||154||CLOSE&lt;br /&gt;
|-&lt;br /&gt;
|9B||155||LOAD||Note that LOADM is simply the token for LOAD followed by an ASCII 'M'. &lt;br /&gt;
|-&lt;br /&gt;
|9C||156||MERGE&lt;br /&gt;
|-QUOTE&lt;br /&gt;
|9D||157||FILES&lt;br /&gt;
|-&lt;br /&gt;
|9E||158||SAVE&lt;br /&gt;
|-&lt;br /&gt;
|9F||159||LFILES&lt;br /&gt;
|-&lt;br /&gt;
|A0||160||LPRINT&lt;br /&gt;
|-&lt;br /&gt;
|A1||161||DEF&lt;br /&gt;
|-&lt;br /&gt;
|A2||162||POKE&lt;br /&gt;
|-&lt;br /&gt;
|A3||163||PRINT&lt;br /&gt;
|-&lt;br /&gt;
|A4||164||CONT&lt;br /&gt;
|-&lt;br /&gt;
|A5||165||LIST&lt;br /&gt;
|-&lt;br /&gt;
|A6||166||LLIST&lt;br /&gt;
|-&lt;br /&gt;
|A7||167||CLEAR&lt;br /&gt;
|-&lt;br /&gt;
|A8||168||CLOAD&lt;br /&gt;
|-&lt;br /&gt;
|A9||169||CSAVE&lt;br /&gt;
|-&lt;br /&gt;
|AA||170||TIME$&lt;br /&gt;
|-&lt;br /&gt;
|AB||171||DATE$&lt;br /&gt;
|-&lt;br /&gt;
|AC||172||DAY$&lt;br /&gt;
|-&lt;br /&gt;
|AD||173||COM&lt;br /&gt;
|-&lt;br /&gt;
|AE||174||MDM&lt;br /&gt;
|-&lt;br /&gt;
|AF||175||KEY&lt;br /&gt;
|-&lt;br /&gt;
|B0||176||CLS&lt;br /&gt;
|-&lt;br /&gt;
|B1||177||BEEP&lt;br /&gt;
|-&lt;br /&gt;
|B2||178||SOUND&lt;br /&gt;
|-&lt;br /&gt;
|B3||179||LCOPY&lt;br /&gt;
|-&lt;br /&gt;
|B4||180||PSET&lt;br /&gt;
|-&lt;br /&gt;
|B5||181||PRESET&lt;br /&gt;
|-&lt;br /&gt;
|B6||182||MOTOR&lt;br /&gt;
|-&lt;br /&gt;
|B7||183||MAX&lt;br /&gt;
|-&lt;br /&gt;
|B8||184||POWER&lt;br /&gt;
|-&lt;br /&gt;
|B9||185||CALL&lt;br /&gt;
|-&lt;br /&gt;
|BA||186||MENU&lt;br /&gt;
|-&lt;br /&gt;
|BB||187||IPL&lt;br /&gt;
|-&lt;br /&gt;
|BC||188||NAME&lt;br /&gt;
|-&lt;br /&gt;
|BD||189||KILL&lt;br /&gt;
|-&lt;br /&gt;
|BE||190||SCREEN&lt;br /&gt;
|-&lt;br /&gt;
|BF||191||NEW&lt;br /&gt;
|-&lt;br /&gt;
|C0||192||TAB(&lt;br /&gt;
|-&lt;br /&gt;
|C1||193||TO&lt;br /&gt;
|-&lt;br /&gt;
|C2||194||USING&lt;br /&gt;
|-&lt;br /&gt;
|C3||195||VARPTR&lt;br /&gt;
|-&lt;br /&gt;
|C4||196||ERL&lt;br /&gt;
|-&lt;br /&gt;
|C5||197||ERR&lt;br /&gt;
|-&lt;br /&gt;
|C6||198||STRING$&lt;br /&gt;
|-&lt;br /&gt;
|C7||199||INSTR&lt;br /&gt;
|-&lt;br /&gt;
|C8||200||DSKI$&lt;br /&gt;
|-&lt;br /&gt;
|C9||201||INKEY$&lt;br /&gt;
|-&lt;br /&gt;
|CA||202||CSRLIN&lt;br /&gt;
|-&lt;br /&gt;
|CB||203||OFF&lt;br /&gt;
|-&lt;br /&gt;
|CC||204||HIMEM&lt;br /&gt;
|-&lt;br /&gt;
|CD||205||THEN&lt;br /&gt;
|-&lt;br /&gt;
|CE||206||NOT&lt;br /&gt;
|-&lt;br /&gt;
|CF||207||STEP&lt;br /&gt;
|-&lt;br /&gt;
|D0||208||+&lt;br /&gt;
|-&lt;br /&gt;
|D1||209||-&lt;br /&gt;
|-&lt;br /&gt;
|D2||210||*&lt;br /&gt;
|-&lt;br /&gt;
|D3||211||/&lt;br /&gt;
|-&lt;br /&gt;
|D4||212||^&lt;br /&gt;
|-&lt;br /&gt;
|D5||213||AND&lt;br /&gt;
|-&lt;br /&gt;
|D6||214||OR&lt;br /&gt;
|-&lt;br /&gt;
|D7||215||XOR&lt;br /&gt;
|-&lt;br /&gt;
|D8||216||EQV&lt;br /&gt;
|-&lt;br /&gt;
|D9||217||IMP&lt;br /&gt;
|-&lt;br /&gt;
|DA||218||MOD&lt;br /&gt;
|-&lt;br /&gt;
|DB||219||\&lt;br /&gt;
|-&lt;br /&gt;
|DC||220||&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|DD||221||=&lt;br /&gt;
|-&lt;br /&gt;
|DE||222||&amp;lt;&lt;br /&gt;
|-&lt;br /&gt;
|DF||223||SGN&lt;br /&gt;
|-&lt;br /&gt;
|E0||224||INT&lt;br /&gt;
|-&lt;br /&gt;
|E1||225||ABS&lt;br /&gt;
|-&lt;br /&gt;
|E2||226||FRE&lt;br /&gt;
|-&lt;br /&gt;
|E3||227||INP&lt;br /&gt;
|-&lt;br /&gt;
|E4||228||LPOS&lt;br /&gt;
|-&lt;br /&gt;
|E5||229||POS&lt;br /&gt;
|-&lt;br /&gt;
|E6||230||SQR&lt;br /&gt;
|-&lt;br /&gt;
|E7||231||RND&lt;br /&gt;
|-&lt;br /&gt;
|E8||232||LOG&lt;br /&gt;
|-&lt;br /&gt;
|E9||233||EXP&lt;br /&gt;
|-&lt;br /&gt;
|EA||234||COS&lt;br /&gt;
|-&lt;br /&gt;
|EB||235||SIN&lt;br /&gt;
|-&lt;br /&gt;
|EC||236||TAN&lt;br /&gt;
|-&lt;br /&gt;
|ED||237||ATN&lt;br /&gt;
|-&lt;br /&gt;
|EE||238||PEEK&lt;br /&gt;
|-&lt;br /&gt;
|EF||239||EOF&lt;br /&gt;
|-&lt;br /&gt;
|F0||240||LOC&lt;br /&gt;
|-&lt;br /&gt;
|F1||241||LOF&lt;br /&gt;
|-&lt;br /&gt;
|F2||242||CINT&lt;br /&gt;
|-&lt;br /&gt;
|F3||243||CSNG&lt;br /&gt;
|-&lt;br /&gt;
|F4||244||CDBL&lt;br /&gt;
|-&lt;br /&gt;
|F5||245||FIX&lt;br /&gt;
|-&lt;br /&gt;
|F6||246||LEN&lt;br /&gt;
|-&lt;br /&gt;
|F7||247||STR$&lt;br /&gt;
|-&lt;br /&gt;
|F8||248||VAL&lt;br /&gt;
|-&lt;br /&gt;
|F9||249||ASC&lt;br /&gt;
|-&lt;br /&gt;
|FA||250||CHR$&lt;br /&gt;
|-&lt;br /&gt;
|FB||251||SPACE$&lt;br /&gt;
|-&lt;br /&gt;
|FC||252||LEFT$&lt;br /&gt;
|-&lt;br /&gt;
|FD||253||RIGHT$&lt;br /&gt;
|-&lt;br /&gt;
|FE||254||MID$&lt;br /&gt;
|-&lt;br /&gt;
|FF||255||' (QUOTE) || When tokenizing, the single quote character expands to three characters: a colon (3A), the byte for REM (8E), and then FF.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== File Format ==&lt;br /&gt;
&lt;br /&gt;
Tokenised BASIC code is a sequence of tokenized lines. Each tokenized line has the following format:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+ Format of a single tokenized line&lt;br /&gt;
!Name!!Length!!Description&lt;br /&gt;
|-&lt;br /&gt;
|PL PH&lt;br /&gt;
|2 bytes&lt;br /&gt;
|Address in RAM of the next line of BASIC; unsigned 16-bit integer, little-endian. PL PH equal to zero marks the end of a tokenized BASIC listing. All other values can be ignored as they are merely placeholders in the file. During program load, Tandy BASIC always recalculates PL PH. Once in memory, PL PH is used to skip to the line required for GOTO, GOSUB, and READ, thus speeding up the program. &lt;br /&gt;
|-&lt;br /&gt;
|LL LH&lt;br /&gt;
|2 bytes&lt;br /&gt;
|Line number; unsigned 16-bit integer, little-endian.&lt;br /&gt;
|-&lt;br /&gt;
|B&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt; … B&amp;lt;sub&amp;gt;n&amp;lt;/sub&amp;gt;&lt;br /&gt;
|Any number&lt;br /&gt;
|Sequence of tokens or ASCII characters. If a character's value is ≥ 128, then it is a token. All tokens are a single byte. &lt;br /&gt;
|-&lt;br /&gt;
|NULL&lt;br /&gt;
|1 byte&lt;br /&gt;
|NULL byte (&amp;lt;code&amp;gt;0x00&amp;lt;/code&amp;gt;) to signal end of line. &lt;br /&gt;
|}&lt;br /&gt;
              &lt;br /&gt;
The end of the tokenized data is signaled by two consecutive NULLs in the location where PL PH would normally begin a new line.&lt;br /&gt;
&lt;br /&gt;
=== Limits ===&lt;br /&gt;
&lt;br /&gt;
* Line numbers can range from 0 to 65529 (but see variances below).&lt;br /&gt;
* Tokenized line length is limited to 256 characters, including the trailing NULL byte. (To do: double check this.)&lt;br /&gt;
&lt;br /&gt;
=== Acceptable variances ===&lt;br /&gt;
&lt;br /&gt;
While Tandy BASIC will never generate such files, it has no problem loading a tokenized program that:&lt;br /&gt;
&lt;br /&gt;
* Has line numbers out of order; they will be sorted when loaded.&lt;br /&gt;
* Contains duplicate line numbers; previous line is discarded.&lt;br /&gt;
* Contains arbitrary bytes for PL PH; they are always regenerated during loading.&lt;br /&gt;
* Has a ^Z (ASCII 26) at the end of the file.&lt;br /&gt;
* Contains illegal line numbers; this can be used to store hidden binary data [https://www.mail-archive.com/m100@lists.bitchin100.com/msg16195.html according to John R. Hogerhuis].&lt;br /&gt;
&lt;br /&gt;
Note that while these variances are accepted on an actual Model T device (Model 100, Tandy 200, or Tandy 102), emulators may not be able to handle such files. For example, the [https://sourceforge.net/projects/virtualt/ Virtual T] emulator (as of version 1.7 in 2022) refuses to load tokenized BASIC programs that have lines out of order, duplicate lines, or bogus values for PL PH.&lt;br /&gt;
&lt;br /&gt;
=== Details for PL PH ===&lt;br /&gt;
&lt;br /&gt;
(Stub. This is where the correct calculation of PL PH values will go.)&lt;br /&gt;
&lt;br /&gt;
== Format documentation ==&lt;br /&gt;
&lt;br /&gt;
* [https://m100.bitchin100.narkive.com/eP2uSl4J/tokenized-basic-programs-bytes-of-mystery Discussion of byte format on Bitchin 100 Mailing List]&lt;br /&gt;
* [http://www.club100.org/library/ups/tokens.do BASIC program to create a table of tokens]&lt;br /&gt;
* [https://archive.org/details/HiddenPowersOfTheTrs80Model100/page/n229/mode/2up?view=theater Hidden Powers of the TRS 80 Model 100]. Appendix B lists the BASIC token values for the Model 100. Other than the omission of 255 for a single quote remark, this reference matches what hackerb9 found programmatically for the Tandy 200.&lt;br /&gt;
* [http://web.archive.org/web/20220324135218/https://help.ayra.ch/trs80-reference#trs-80-model-100-basic-reference Ayra Model 100 BASIC Reference]&lt;br /&gt;
&lt;br /&gt;
== Other links ==&lt;br /&gt;
&lt;br /&gt;
* [https://github.com/hackerb9/tokenize/ Hackerb9's simple program for tokenizing BASIC code]&lt;br /&gt;
* [https://sourceforge.net/projects/virtualt/ A Tandy 200 &amp;amp; Model 100/102 emulator]&lt;br /&gt;
* [http://bitchin100.com/CloudT/ A TRS-80 Model 100 emulator that runs in a web browser]&lt;br /&gt;
&lt;br /&gt;
[[Category:Microsoft]]&lt;/div&gt;</summary>
		<author><name>Hackerb9</name></author>	</entry>

	<entry>
		<id>http://fileformats.archiveteam.org/wiki/Tandy_200_BASIC_tokenized_file</id>
		<title>Tandy 200 BASIC tokenized file</title>
		<link rel="alternate" type="text/html" href="http://fileformats.archiveteam.org/wiki/Tandy_200_BASIC_tokenized_file"/>
				<updated>2022-10-05T21:01:45Z</updated>
		
		<summary type="html">&lt;p&gt;Hackerb9: /* File Format */ Add tokenized line table caption&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{FormatInfo&lt;br /&gt;
|subcat=Source code&lt;br /&gt;
|subcat2=Tokenized BASIC&lt;br /&gt;
|released=1984&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
'''Tandy 200 BASIC''' was a version of Microsoft BASIC for the Radio Shack Tandy 200 computer. The tokenizations for the TRS-80 Model 100 and Tandy 102 appear to be identical. The NEC PC-8201/8300 format is not the same, but should be similar.&lt;br /&gt;
&lt;br /&gt;
== Tokens ==&lt;br /&gt;
&lt;br /&gt;
Table of tokenized BASIC keywords.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! title=&amp;quot;Hexadecimal code point&amp;quot; | Hex&lt;br /&gt;
! title=&amp;quot;Decimal code point&amp;quot; | Dec&lt;br /&gt;
! title=&amp;quot;BASIC element the token stands for&amp;quot; | Token meaning &lt;br /&gt;
! title=&amp;quot;Miscellany&amp;quot; | Notes&lt;br /&gt;
|-&lt;br /&gt;
|-&lt;br /&gt;
|80||128||END&lt;br /&gt;
|-&lt;br /&gt;
|81||129||FOR&lt;br /&gt;
|-&lt;br /&gt;
|82||130||NEXT&lt;br /&gt;
|-&lt;br /&gt;
|83||131||DATA&lt;br /&gt;
|-&lt;br /&gt;
|84||132||INPUT&lt;br /&gt;
|-&lt;br /&gt;
|85||133||DIM&lt;br /&gt;
|-&lt;br /&gt;
|86||134||READ&lt;br /&gt;
|-&lt;br /&gt;
|87||135||LET&lt;br /&gt;
|-&lt;br /&gt;
|88||136||GOTO&lt;br /&gt;
|-&lt;br /&gt;
|89||137||RUN&lt;br /&gt;
|-&lt;br /&gt;
|8A||138||IF&lt;br /&gt;
|-&lt;br /&gt;
|8B||139||RESTORE&lt;br /&gt;
|-&lt;br /&gt;
|8C||140||GOSUB&lt;br /&gt;
|-&lt;br /&gt;
|8D||141||RETURN&lt;br /&gt;
|-&lt;br /&gt;
|8E||142||REM&lt;br /&gt;
|-&lt;br /&gt;
|8F||143||STOP&lt;br /&gt;
|-&lt;br /&gt;
|90||144||WIDTH&lt;br /&gt;
|-&lt;br /&gt;
|91||145||ELSE||When tokenizing, the Tandy 200 always adds a colon (':') before the ELSE token (3A 91). If the user actually writes :ELSE it is tokenized as 3A 3A 91.&lt;br /&gt;
|-&lt;br /&gt;
|92||146||LINE&lt;br /&gt;
|-&lt;br /&gt;
|93||147||EDIT&lt;br /&gt;
|-&lt;br /&gt;
|94||148||ERROR&lt;br /&gt;
|-&lt;br /&gt;
|95||149||RESUME&lt;br /&gt;
|-&lt;br /&gt;
|96||150||OUT&lt;br /&gt;
|-&lt;br /&gt;
|97||151||ON&lt;br /&gt;
|-&lt;br /&gt;
|98||152||DSKO$&lt;br /&gt;
|-&lt;br /&gt;
|99||153||OPEN&lt;br /&gt;
|-&lt;br /&gt;
|9A||154||CLOSE&lt;br /&gt;
|-&lt;br /&gt;
|9B||155||LOAD||Note that LOADM is simply the token for LOAD followed by an ASCII 'M'. &lt;br /&gt;
|-&lt;br /&gt;
|9C||156||MERGE&lt;br /&gt;
|-QUOTE&lt;br /&gt;
|9D||157||FILES&lt;br /&gt;
|-&lt;br /&gt;
|9E||158||SAVE&lt;br /&gt;
|-&lt;br /&gt;
|9F||159||LFILES&lt;br /&gt;
|-&lt;br /&gt;
|A0||160||LPRINT&lt;br /&gt;
|-&lt;br /&gt;
|A1||161||DEF&lt;br /&gt;
|-&lt;br /&gt;
|A2||162||POKE&lt;br /&gt;
|-&lt;br /&gt;
|A3||163||PRINT&lt;br /&gt;
|-&lt;br /&gt;
|A4||164||CONT&lt;br /&gt;
|-&lt;br /&gt;
|A5||165||LIST&lt;br /&gt;
|-&lt;br /&gt;
|A6||166||LLIST&lt;br /&gt;
|-&lt;br /&gt;
|A7||167||CLEAR&lt;br /&gt;
|-&lt;br /&gt;
|A8||168||CLOAD&lt;br /&gt;
|-&lt;br /&gt;
|A9||169||CSAVE&lt;br /&gt;
|-&lt;br /&gt;
|AA||170||TIME$&lt;br /&gt;
|-&lt;br /&gt;
|AB||171||DATE$&lt;br /&gt;
|-&lt;br /&gt;
|AC||172||DAY$&lt;br /&gt;
|-&lt;br /&gt;
|AD||173||COM&lt;br /&gt;
|-&lt;br /&gt;
|AE||174||MDM&lt;br /&gt;
|-&lt;br /&gt;
|AF||175||KEY&lt;br /&gt;
|-&lt;br /&gt;
|B0||176||CLS&lt;br /&gt;
|-&lt;br /&gt;
|B1||177||BEEP&lt;br /&gt;
|-&lt;br /&gt;
|B2||178||SOUND&lt;br /&gt;
|-&lt;br /&gt;
|B3||179||LCOPY&lt;br /&gt;
|-&lt;br /&gt;
|B4||180||PSET&lt;br /&gt;
|-&lt;br /&gt;
|B5||181||PRESET&lt;br /&gt;
|-&lt;br /&gt;
|B6||182||MOTOR&lt;br /&gt;
|-&lt;br /&gt;
|B7||183||MAX&lt;br /&gt;
|-&lt;br /&gt;
|B8||184||POWER&lt;br /&gt;
|-&lt;br /&gt;
|B9||185||CALL&lt;br /&gt;
|-&lt;br /&gt;
|BA||186||MENU&lt;br /&gt;
|-&lt;br /&gt;
|BB||187||IPL&lt;br /&gt;
|-&lt;br /&gt;
|BC||188||NAME&lt;br /&gt;
|-&lt;br /&gt;
|BD||189||KILL&lt;br /&gt;
|-&lt;br /&gt;
|BE||190||SCREEN&lt;br /&gt;
|-&lt;br /&gt;
|BF||191||NEW&lt;br /&gt;
|-&lt;br /&gt;
|C0||192||TAB(&lt;br /&gt;
|-&lt;br /&gt;
|C1||193||TO&lt;br /&gt;
|-&lt;br /&gt;
|C2||194||USING&lt;br /&gt;
|-&lt;br /&gt;
|C3||195||VARPTR&lt;br /&gt;
|-&lt;br /&gt;
|C4||196||ERL&lt;br /&gt;
|-&lt;br /&gt;
|C5||197||ERR&lt;br /&gt;
|-&lt;br /&gt;
|C6||198||STRING$&lt;br /&gt;
|-&lt;br /&gt;
|C7||199||INSTR&lt;br /&gt;
|-&lt;br /&gt;
|C8||200||DSKI$&lt;br /&gt;
|-&lt;br /&gt;
|C9||201||INKEY$&lt;br /&gt;
|-&lt;br /&gt;
|CA||202||CSRLIN&lt;br /&gt;
|-&lt;br /&gt;
|CB||203||OFF&lt;br /&gt;
|-&lt;br /&gt;
|CC||204||HIMEM&lt;br /&gt;
|-&lt;br /&gt;
|CD||205||THEN&lt;br /&gt;
|-&lt;br /&gt;
|CE||206||NOT&lt;br /&gt;
|-&lt;br /&gt;
|CF||207||STEP&lt;br /&gt;
|-&lt;br /&gt;
|D0||208||+&lt;br /&gt;
|-&lt;br /&gt;
|D1||209||-&lt;br /&gt;
|-&lt;br /&gt;
|D2||210||*&lt;br /&gt;
|-&lt;br /&gt;
|D3||211||/&lt;br /&gt;
|-&lt;br /&gt;
|D4||212||^&lt;br /&gt;
|-&lt;br /&gt;
|D5||213||AND&lt;br /&gt;
|-&lt;br /&gt;
|D6||214||OR&lt;br /&gt;
|-&lt;br /&gt;
|D7||215||XOR&lt;br /&gt;
|-&lt;br /&gt;
|D8||216||EQV&lt;br /&gt;
|-&lt;br /&gt;
|D9||217||IMP&lt;br /&gt;
|-&lt;br /&gt;
|DA||218||MOD&lt;br /&gt;
|-&lt;br /&gt;
|DB||219||\&lt;br /&gt;
|-&lt;br /&gt;
|DC||220||&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|DD||221||=&lt;br /&gt;
|-&lt;br /&gt;
|DE||222||&amp;lt;&lt;br /&gt;
|-&lt;br /&gt;
|DF||223||SGN&lt;br /&gt;
|-&lt;br /&gt;
|E0||224||INT&lt;br /&gt;
|-&lt;br /&gt;
|E1||225||ABS&lt;br /&gt;
|-&lt;br /&gt;
|E2||226||FRE&lt;br /&gt;
|-&lt;br /&gt;
|E3||227||INP&lt;br /&gt;
|-&lt;br /&gt;
|E4||228||LPOS&lt;br /&gt;
|-&lt;br /&gt;
|E5||229||POS&lt;br /&gt;
|-&lt;br /&gt;
|E6||230||SQR&lt;br /&gt;
|-&lt;br /&gt;
|E7||231||RND&lt;br /&gt;
|-&lt;br /&gt;
|E8||232||LOG&lt;br /&gt;
|-&lt;br /&gt;
|E9||233||EXP&lt;br /&gt;
|-&lt;br /&gt;
|EA||234||COS&lt;br /&gt;
|-&lt;br /&gt;
|EB||235||SIN&lt;br /&gt;
|-&lt;br /&gt;
|EC||236||TAN&lt;br /&gt;
|-&lt;br /&gt;
|ED||237||ATN&lt;br /&gt;
|-&lt;br /&gt;
|EE||238||PEEK&lt;br /&gt;
|-&lt;br /&gt;
|EF||239||EOF&lt;br /&gt;
|-&lt;br /&gt;
|F0||240||LOC&lt;br /&gt;
|-&lt;br /&gt;
|F1||241||LOF&lt;br /&gt;
|-&lt;br /&gt;
|F2||242||CINT&lt;br /&gt;
|-&lt;br /&gt;
|F3||243||CSNG&lt;br /&gt;
|-&lt;br /&gt;
|F4||244||CDBL&lt;br /&gt;
|-&lt;br /&gt;
|F5||245||FIX&lt;br /&gt;
|-&lt;br /&gt;
|F6||246||LEN&lt;br /&gt;
|-&lt;br /&gt;
|F7||247||STR$&lt;br /&gt;
|-&lt;br /&gt;
|F8||248||VAL&lt;br /&gt;
|-&lt;br /&gt;
|F9||249||ASC&lt;br /&gt;
|-&lt;br /&gt;
|FA||250||CHR$&lt;br /&gt;
|-&lt;br /&gt;
|FB||251||SPACE$&lt;br /&gt;
|-&lt;br /&gt;
|FC||252||LEFT$&lt;br /&gt;
|-&lt;br /&gt;
|FD||253||RIGHT$&lt;br /&gt;
|-&lt;br /&gt;
|FE||254||MID$&lt;br /&gt;
|-&lt;br /&gt;
|FF||255||' (QUOTE) || When tokenizing, the single quote character expands to three characters: a colon (3A), the byte for REM (8E), and then FF.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== File Format ==&lt;br /&gt;
&lt;br /&gt;
Tokenised BASIC code is a sequence of tokenized lines. Each tokenized line has the following format:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+ Format of a single tokenized line&lt;br /&gt;
!Name!!Length!!Description&lt;br /&gt;
|-&lt;br /&gt;
|PL PH&lt;br /&gt;
|2 bytes&lt;br /&gt;
|Address in RAM of the next line of BASIC; unsigned 16-bit integer, little-endian. PL PH equal to zero marks the end of a tokenized BASIC listing. All other values can be ignored as they are merely placeholders in the file. During program load, Tandy BASIC always recalculates PL PH. Once in memory, PL PH is used to skip to the line required for GOTO, GOSUB, and READ, thus speeding up the program. &lt;br /&gt;
|-&lt;br /&gt;
|LL LH&lt;br /&gt;
|2 bytes&lt;br /&gt;
|Line number; unsigned 16-bit integer, little-endian.&lt;br /&gt;
|-&lt;br /&gt;
|B&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt; … B&amp;lt;sub&amp;gt;n&amp;lt;/sub&amp;gt;&lt;br /&gt;
|Any number&lt;br /&gt;
|Sequence of tokens or ASCII characters. If a character's value is ≥ 128, then it is a token. All tokens are a single byte. &lt;br /&gt;
|-&lt;br /&gt;
|NULL&lt;br /&gt;
|1 byte&lt;br /&gt;
|NULL byte (&amp;lt;code&amp;gt;0x00&amp;lt;/code&amp;gt;) to signal end of line. &lt;br /&gt;
|}&lt;br /&gt;
              &lt;br /&gt;
The end of the tokenized data is signaled by two consecutive NULLs in the location where PL PH would normally begin a new line.&lt;br /&gt;
&lt;br /&gt;
=== Limits ===&lt;br /&gt;
&lt;br /&gt;
* Line numbers can range from 0 to 65529 (but see variances below).&lt;br /&gt;
* Tokenized line length is limited to 256 characters, including the trailing NULL byte. (To do: double check this.)&lt;br /&gt;
&lt;br /&gt;
=== Acceptable variances ===&lt;br /&gt;
&lt;br /&gt;
While Tandy BASIC will never generate such files, it has no problem loading a tokenized program that:&lt;br /&gt;
&lt;br /&gt;
* Has line numbers out of order; they will be sorted when loaded.&lt;br /&gt;
* Contains duplicate line numbers; previous line is discarded.&lt;br /&gt;
* Contains arbitrary bytes for PL PH; they are always regenerated during loading.&lt;br /&gt;
* Has a ^Z (ASCII 26) at the end of the file.&lt;br /&gt;
* Contains illegal line numbers; this can be used to store hidden binary data [https://www.mail-archive.com/m100@lists.bitchin100.com/msg16195.html according to John R. Hogerhuis].&lt;br /&gt;
&lt;br /&gt;
Note that while these variances are accepted on an actual Model T device (Model 100, Tandy 200, or Tandy 102), emulators may not be able to handle such files. For example, the [https://sourceforge.net/projects/virtualt/ Virtual T] emulator (as of version 1.7 in 2022) refuses to load tokenized BASIC programs that have lines out of order, duplicate lines, or bogus values for PL PH.&lt;br /&gt;
&lt;br /&gt;
=== Details for PL PH ===&lt;br /&gt;
&lt;br /&gt;
(Stub. This is where the correct calculation of PL PH values will go.)&lt;br /&gt;
&lt;br /&gt;
== Format documentation ==&lt;br /&gt;
&lt;br /&gt;
* [https://m100.bitchin100.narkive.com/eP2uSl4J/tokenized-basic-programs-bytes-of-mystery Discussion of byte format on Bitchin 100 Mailing List]&lt;br /&gt;
* [http://www.club100.org/library/ups/tokens.do BASIC program to create a table of tokens]&lt;br /&gt;
* [https://archive.org/details/HiddenPowersOfTheTrs80Model100/page/n229/mode/2up?view=theater Hidden Powers of the TRS 80 Model 100]. Appendix B lists the BASIC token values for the Model 100. Other than the omission of 255 for a single quote remark, this reference matches what hackerb9 found programmatically for the Tandy 200.&lt;br /&gt;
* [http://web.archive.org/web/20220324135218/https://help.ayra.ch/trs80-reference#trs-80-model-100-basic-reference Ayra Model 100 BASIC Reference]&lt;br /&gt;
&lt;br /&gt;
== Other links ==&lt;br /&gt;
&lt;br /&gt;
* [https://github.com/hackerb9/tokenize/ Hackerb9's simple program for tokenizing BASIC code]&lt;br /&gt;
* [https://sourceforge.net/projects/virtualt/ A Tandy 200 &amp;amp; Model 100/102 emulator]&lt;br /&gt;
* [http://bitchin100.com/CloudT/ A TRS-80 Model 100 emulator that runs in a web browser]&lt;br /&gt;
&lt;br /&gt;
[[Category:Microsoft]]&lt;/div&gt;</summary>
		<author><name>Hackerb9</name></author>	</entry>

	<entry>
		<id>http://fileformats.archiveteam.org/wiki/Tandy_200_BASIC_tokenized_file</id>
		<title>Tandy 200 BASIC tokenized file</title>
		<link rel="alternate" type="text/html" href="http://fileformats.archiveteam.org/wiki/Tandy_200_BASIC_tokenized_file"/>
				<updated>2022-10-05T20:56:10Z</updated>
		
		<summary type="html">&lt;p&gt;Hackerb9: /* Acceptable variances */ use specific verb&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{FormatInfo&lt;br /&gt;
|subcat=Source code&lt;br /&gt;
|subcat2=Tokenized BASIC&lt;br /&gt;
|released=1984&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
'''Tandy 200 BASIC''' was a version of Microsoft BASIC for the Radio Shack Tandy 200 computer. The tokenizations for the TRS-80 Model 100 and Tandy 102 appear to be identical. The NEC PC-8201/8300 format is not the same, but should be similar.&lt;br /&gt;
&lt;br /&gt;
== Tokens ==&lt;br /&gt;
&lt;br /&gt;
Table of tokenized BASIC keywords.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! title=&amp;quot;Hexadecimal code point&amp;quot; | Hex&lt;br /&gt;
! title=&amp;quot;Decimal code point&amp;quot; | Dec&lt;br /&gt;
! title=&amp;quot;BASIC element the token stands for&amp;quot; | Token meaning &lt;br /&gt;
! title=&amp;quot;Miscellany&amp;quot; | Notes&lt;br /&gt;
|-&lt;br /&gt;
|-&lt;br /&gt;
|80||128||END&lt;br /&gt;
|-&lt;br /&gt;
|81||129||FOR&lt;br /&gt;
|-&lt;br /&gt;
|82||130||NEXT&lt;br /&gt;
|-&lt;br /&gt;
|83||131||DATA&lt;br /&gt;
|-&lt;br /&gt;
|84||132||INPUT&lt;br /&gt;
|-&lt;br /&gt;
|85||133||DIM&lt;br /&gt;
|-&lt;br /&gt;
|86||134||READ&lt;br /&gt;
|-&lt;br /&gt;
|87||135||LET&lt;br /&gt;
|-&lt;br /&gt;
|88||136||GOTO&lt;br /&gt;
|-&lt;br /&gt;
|89||137||RUN&lt;br /&gt;
|-&lt;br /&gt;
|8A||138||IF&lt;br /&gt;
|-&lt;br /&gt;
|8B||139||RESTORE&lt;br /&gt;
|-&lt;br /&gt;
|8C||140||GOSUB&lt;br /&gt;
|-&lt;br /&gt;
|8D||141||RETURN&lt;br /&gt;
|-&lt;br /&gt;
|8E||142||REM&lt;br /&gt;
|-&lt;br /&gt;
|8F||143||STOP&lt;br /&gt;
|-&lt;br /&gt;
|90||144||WIDTH&lt;br /&gt;
|-&lt;br /&gt;
|91||145||ELSE||When tokenizing, the Tandy 200 always adds a colon (':') before the ELSE token (3A 91). If the user actually writes :ELSE it is tokenized as 3A 3A 91.&lt;br /&gt;
|-&lt;br /&gt;
|92||146||LINE&lt;br /&gt;
|-&lt;br /&gt;
|93||147||EDIT&lt;br /&gt;
|-&lt;br /&gt;
|94||148||ERROR&lt;br /&gt;
|-&lt;br /&gt;
|95||149||RESUME&lt;br /&gt;
|-&lt;br /&gt;
|96||150||OUT&lt;br /&gt;
|-&lt;br /&gt;
|97||151||ON&lt;br /&gt;
|-&lt;br /&gt;
|98||152||DSKO$&lt;br /&gt;
|-&lt;br /&gt;
|99||153||OPEN&lt;br /&gt;
|-&lt;br /&gt;
|9A||154||CLOSE&lt;br /&gt;
|-&lt;br /&gt;
|9B||155||LOAD||Note that LOADM is simply the token for LOAD followed by an ASCII 'M'. &lt;br /&gt;
|-&lt;br /&gt;
|9C||156||MERGE&lt;br /&gt;
|-QUOTE&lt;br /&gt;
|9D||157||FILES&lt;br /&gt;
|-&lt;br /&gt;
|9E||158||SAVE&lt;br /&gt;
|-&lt;br /&gt;
|9F||159||LFILES&lt;br /&gt;
|-&lt;br /&gt;
|A0||160||LPRINT&lt;br /&gt;
|-&lt;br /&gt;
|A1||161||DEF&lt;br /&gt;
|-&lt;br /&gt;
|A2||162||POKE&lt;br /&gt;
|-&lt;br /&gt;
|A3||163||PRINT&lt;br /&gt;
|-&lt;br /&gt;
|A4||164||CONT&lt;br /&gt;
|-&lt;br /&gt;
|A5||165||LIST&lt;br /&gt;
|-&lt;br /&gt;
|A6||166||LLIST&lt;br /&gt;
|-&lt;br /&gt;
|A7||167||CLEAR&lt;br /&gt;
|-&lt;br /&gt;
|A8||168||CLOAD&lt;br /&gt;
|-&lt;br /&gt;
|A9||169||CSAVE&lt;br /&gt;
|-&lt;br /&gt;
|AA||170||TIME$&lt;br /&gt;
|-&lt;br /&gt;
|AB||171||DATE$&lt;br /&gt;
|-&lt;br /&gt;
|AC||172||DAY$&lt;br /&gt;
|-&lt;br /&gt;
|AD||173||COM&lt;br /&gt;
|-&lt;br /&gt;
|AE||174||MDM&lt;br /&gt;
|-&lt;br /&gt;
|AF||175||KEY&lt;br /&gt;
|-&lt;br /&gt;
|B0||176||CLS&lt;br /&gt;
|-&lt;br /&gt;
|B1||177||BEEP&lt;br /&gt;
|-&lt;br /&gt;
|B2||178||SOUND&lt;br /&gt;
|-&lt;br /&gt;
|B3||179||LCOPY&lt;br /&gt;
|-&lt;br /&gt;
|B4||180||PSET&lt;br /&gt;
|-&lt;br /&gt;
|B5||181||PRESET&lt;br /&gt;
|-&lt;br /&gt;
|B6||182||MOTOR&lt;br /&gt;
|-&lt;br /&gt;
|B7||183||MAX&lt;br /&gt;
|-&lt;br /&gt;
|B8||184||POWER&lt;br /&gt;
|-&lt;br /&gt;
|B9||185||CALL&lt;br /&gt;
|-&lt;br /&gt;
|BA||186||MENU&lt;br /&gt;
|-&lt;br /&gt;
|BB||187||IPL&lt;br /&gt;
|-&lt;br /&gt;
|BC||188||NAME&lt;br /&gt;
|-&lt;br /&gt;
|BD||189||KILL&lt;br /&gt;
|-&lt;br /&gt;
|BE||190||SCREEN&lt;br /&gt;
|-&lt;br /&gt;
|BF||191||NEW&lt;br /&gt;
|-&lt;br /&gt;
|C0||192||TAB(&lt;br /&gt;
|-&lt;br /&gt;
|C1||193||TO&lt;br /&gt;
|-&lt;br /&gt;
|C2||194||USING&lt;br /&gt;
|-&lt;br /&gt;
|C3||195||VARPTR&lt;br /&gt;
|-&lt;br /&gt;
|C4||196||ERL&lt;br /&gt;
|-&lt;br /&gt;
|C5||197||ERR&lt;br /&gt;
|-&lt;br /&gt;
|C6||198||STRING$&lt;br /&gt;
|-&lt;br /&gt;
|C7||199||INSTR&lt;br /&gt;
|-&lt;br /&gt;
|C8||200||DSKI$&lt;br /&gt;
|-&lt;br /&gt;
|C9||201||INKEY$&lt;br /&gt;
|-&lt;br /&gt;
|CA||202||CSRLIN&lt;br /&gt;
|-&lt;br /&gt;
|CB||203||OFF&lt;br /&gt;
|-&lt;br /&gt;
|CC||204||HIMEM&lt;br /&gt;
|-&lt;br /&gt;
|CD||205||THEN&lt;br /&gt;
|-&lt;br /&gt;
|CE||206||NOT&lt;br /&gt;
|-&lt;br /&gt;
|CF||207||STEP&lt;br /&gt;
|-&lt;br /&gt;
|D0||208||+&lt;br /&gt;
|-&lt;br /&gt;
|D1||209||-&lt;br /&gt;
|-&lt;br /&gt;
|D2||210||*&lt;br /&gt;
|-&lt;br /&gt;
|D3||211||/&lt;br /&gt;
|-&lt;br /&gt;
|D4||212||^&lt;br /&gt;
|-&lt;br /&gt;
|D5||213||AND&lt;br /&gt;
|-&lt;br /&gt;
|D6||214||OR&lt;br /&gt;
|-&lt;br /&gt;
|D7||215||XOR&lt;br /&gt;
|-&lt;br /&gt;
|D8||216||EQV&lt;br /&gt;
|-&lt;br /&gt;
|D9||217||IMP&lt;br /&gt;
|-&lt;br /&gt;
|DA||218||MOD&lt;br /&gt;
|-&lt;br /&gt;
|DB||219||\&lt;br /&gt;
|-&lt;br /&gt;
|DC||220||&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|DD||221||=&lt;br /&gt;
|-&lt;br /&gt;
|DE||222||&amp;lt;&lt;br /&gt;
|-&lt;br /&gt;
|DF||223||SGN&lt;br /&gt;
|-&lt;br /&gt;
|E0||224||INT&lt;br /&gt;
|-&lt;br /&gt;
|E1||225||ABS&lt;br /&gt;
|-&lt;br /&gt;
|E2||226||FRE&lt;br /&gt;
|-&lt;br /&gt;
|E3||227||INP&lt;br /&gt;
|-&lt;br /&gt;
|E4||228||LPOS&lt;br /&gt;
|-&lt;br /&gt;
|E5||229||POS&lt;br /&gt;
|-&lt;br /&gt;
|E6||230||SQR&lt;br /&gt;
|-&lt;br /&gt;
|E7||231||RND&lt;br /&gt;
|-&lt;br /&gt;
|E8||232||LOG&lt;br /&gt;
|-&lt;br /&gt;
|E9||233||EXP&lt;br /&gt;
|-&lt;br /&gt;
|EA||234||COS&lt;br /&gt;
|-&lt;br /&gt;
|EB||235||SIN&lt;br /&gt;
|-&lt;br /&gt;
|EC||236||TAN&lt;br /&gt;
|-&lt;br /&gt;
|ED||237||ATN&lt;br /&gt;
|-&lt;br /&gt;
|EE||238||PEEK&lt;br /&gt;
|-&lt;br /&gt;
|EF||239||EOF&lt;br /&gt;
|-&lt;br /&gt;
|F0||240||LOC&lt;br /&gt;
|-&lt;br /&gt;
|F1||241||LOF&lt;br /&gt;
|-&lt;br /&gt;
|F2||242||CINT&lt;br /&gt;
|-&lt;br /&gt;
|F3||243||CSNG&lt;br /&gt;
|-&lt;br /&gt;
|F4||244||CDBL&lt;br /&gt;
|-&lt;br /&gt;
|F5||245||FIX&lt;br /&gt;
|-&lt;br /&gt;
|F6||246||LEN&lt;br /&gt;
|-&lt;br /&gt;
|F7||247||STR$&lt;br /&gt;
|-&lt;br /&gt;
|F8||248||VAL&lt;br /&gt;
|-&lt;br /&gt;
|F9||249||ASC&lt;br /&gt;
|-&lt;br /&gt;
|FA||250||CHR$&lt;br /&gt;
|-&lt;br /&gt;
|FB||251||SPACE$&lt;br /&gt;
|-&lt;br /&gt;
|FC||252||LEFT$&lt;br /&gt;
|-&lt;br /&gt;
|FD||253||RIGHT$&lt;br /&gt;
|-&lt;br /&gt;
|FE||254||MID$&lt;br /&gt;
|-&lt;br /&gt;
|FF||255||' (QUOTE) || When tokenizing, the single quote character expands to three characters: a colon (3A), the byte for REM (8E), and then FF.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== File Format ==&lt;br /&gt;
&lt;br /&gt;
Tokenised BASIC code is a sequence of tokenized lines. Each tokenized line has the following format:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!Name!!Length!!Description&lt;br /&gt;
|-&lt;br /&gt;
|PL PH&lt;br /&gt;
|2 bytes&lt;br /&gt;
|Address in RAM of the next line of BASIC; unsigned 16-bit integer, little-endian. PL PH equal to zero marks the end of a tokenized BASIC listing. All other values can be ignored as they are merely placeholders in the file. During program load, Tandy BASIC always recalculates PL PH. Once in memory, PL PH is used to skip to the line required for GOTO, GOSUB, and READ, thus speeding up the program. &lt;br /&gt;
|-&lt;br /&gt;
|LL LH&lt;br /&gt;
|2 bytes&lt;br /&gt;
|Line number, unsigned 16-bit integer, little-endian.&lt;br /&gt;
|-&lt;br /&gt;
|B&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt; … B&amp;lt;sub&amp;gt;n&amp;lt;/sub&amp;gt;&lt;br /&gt;
|Any number&lt;br /&gt;
|Sequence of tokens or ASCII characters. If a character's value is ≥ 128, then it is a token. All tokens are a single byte. &lt;br /&gt;
|-&lt;br /&gt;
|NULL&lt;br /&gt;
|1 byte&lt;br /&gt;
|NULL byte (&amp;lt;code&amp;gt;0x00&amp;lt;/code&amp;gt;) to signal end of line. &lt;br /&gt;
|}&lt;br /&gt;
              &lt;br /&gt;
The end of the tokenized data is signaled by two consecutive NULLs in the location where PL PH would normally begin a new line.&lt;br /&gt;
&lt;br /&gt;
=== Limits ===&lt;br /&gt;
&lt;br /&gt;
* Line numbers can range from 0 to 65529 (but see variances below).&lt;br /&gt;
* Tokenized line length is limited to 256 characters, including the trailing NULL byte. (To do: double check this.)&lt;br /&gt;
&lt;br /&gt;
=== Acceptable variances ===&lt;br /&gt;
&lt;br /&gt;
While Tandy BASIC will never generate such files, it has no problem loading a tokenized program that:&lt;br /&gt;
&lt;br /&gt;
* Has line numbers out of order; they will be sorted when loaded.&lt;br /&gt;
* Contains duplicate line numbers; previous line is discarded.&lt;br /&gt;
* Contains arbitrary bytes for PL PH; they are always regenerated during loading.&lt;br /&gt;
* Has a ^Z (ASCII 26) at the end of the file.&lt;br /&gt;
* Contains illegal line numbers; this can be used to store hidden binary data [https://www.mail-archive.com/m100@lists.bitchin100.com/msg16195.html according to John R. Hogerhuis].&lt;br /&gt;
&lt;br /&gt;
Note that while these variances are accepted on an actual Model T device (Model 100, Tandy 200, or Tandy 102), emulators may not be able to handle such files. For example, the [https://sourceforge.net/projects/virtualt/ Virtual T] emulator (as of version 1.7 in 2022) refuses to load tokenized BASIC programs that have lines out of order, duplicate lines, or bogus values for PL PH.&lt;br /&gt;
&lt;br /&gt;
=== Details for PL PH ===&lt;br /&gt;
&lt;br /&gt;
(Stub. This is where the correct calculation of PL PH values will go.)&lt;br /&gt;
&lt;br /&gt;
== Format documentation ==&lt;br /&gt;
&lt;br /&gt;
* [https://m100.bitchin100.narkive.com/eP2uSl4J/tokenized-basic-programs-bytes-of-mystery Discussion of byte format on Bitchin 100 Mailing List]&lt;br /&gt;
* [http://www.club100.org/library/ups/tokens.do BASIC program to create a table of tokens]&lt;br /&gt;
* [https://archive.org/details/HiddenPowersOfTheTrs80Model100/page/n229/mode/2up?view=theater Hidden Powers of the TRS 80 Model 100]. Appendix B lists the BASIC token values for the Model 100. Other than the omission of 255 for a single quote remark, this reference matches what hackerb9 found programmatically for the Tandy 200.&lt;br /&gt;
* [http://web.archive.org/web/20220324135218/https://help.ayra.ch/trs80-reference#trs-80-model-100-basic-reference Ayra Model 100 BASIC Reference]&lt;br /&gt;
&lt;br /&gt;
== Other links ==&lt;br /&gt;
&lt;br /&gt;
* [https://github.com/hackerb9/tokenize/ Hackerb9's simple program for tokenizing BASIC code]&lt;br /&gt;
* [https://sourceforge.net/projects/virtualt/ A Tandy 200 &amp;amp; Model 100/102 emulator]&lt;br /&gt;
* [http://bitchin100.com/CloudT/ A TRS-80 Model 100 emulator that runs in a web browser]&lt;br /&gt;
&lt;br /&gt;
[[Category:Microsoft]]&lt;/div&gt;</summary>
		<author><name>Hackerb9</name></author>	</entry>

	<entry>
		<id>http://fileformats.archiveteam.org/wiki/Tandy_200_BASIC_tokenized_file</id>
		<title>Tandy 200 BASIC tokenized file</title>
		<link rel="alternate" type="text/html" href="http://fileformats.archiveteam.org/wiki/Tandy_200_BASIC_tokenized_file"/>
				<updated>2022-10-05T20:53:36Z</updated>
		
		<summary type="html">&lt;p&gt;Hackerb9: /* File Format */ Tidy language&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{FormatInfo&lt;br /&gt;
|subcat=Source code&lt;br /&gt;
|subcat2=Tokenized BASIC&lt;br /&gt;
|released=1984&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
'''Tandy 200 BASIC''' was a version of Microsoft BASIC for the Radio Shack Tandy 200 computer. The tokenizations for the TRS-80 Model 100 and Tandy 102 appear to be identical. The NEC PC-8201/8300 format is not the same, but should be similar.&lt;br /&gt;
&lt;br /&gt;
== Tokens ==&lt;br /&gt;
&lt;br /&gt;
Table of tokenized BASIC keywords.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! title=&amp;quot;Hexadecimal code point&amp;quot; | Hex&lt;br /&gt;
! title=&amp;quot;Decimal code point&amp;quot; | Dec&lt;br /&gt;
! title=&amp;quot;BASIC element the token stands for&amp;quot; | Token meaning &lt;br /&gt;
! title=&amp;quot;Miscellany&amp;quot; | Notes&lt;br /&gt;
|-&lt;br /&gt;
|-&lt;br /&gt;
|80||128||END&lt;br /&gt;
|-&lt;br /&gt;
|81||129||FOR&lt;br /&gt;
|-&lt;br /&gt;
|82||130||NEXT&lt;br /&gt;
|-&lt;br /&gt;
|83||131||DATA&lt;br /&gt;
|-&lt;br /&gt;
|84||132||INPUT&lt;br /&gt;
|-&lt;br /&gt;
|85||133||DIM&lt;br /&gt;
|-&lt;br /&gt;
|86||134||READ&lt;br /&gt;
|-&lt;br /&gt;
|87||135||LET&lt;br /&gt;
|-&lt;br /&gt;
|88||136||GOTO&lt;br /&gt;
|-&lt;br /&gt;
|89||137||RUN&lt;br /&gt;
|-&lt;br /&gt;
|8A||138||IF&lt;br /&gt;
|-&lt;br /&gt;
|8B||139||RESTORE&lt;br /&gt;
|-&lt;br /&gt;
|8C||140||GOSUB&lt;br /&gt;
|-&lt;br /&gt;
|8D||141||RETURN&lt;br /&gt;
|-&lt;br /&gt;
|8E||142||REM&lt;br /&gt;
|-&lt;br /&gt;
|8F||143||STOP&lt;br /&gt;
|-&lt;br /&gt;
|90||144||WIDTH&lt;br /&gt;
|-&lt;br /&gt;
|91||145||ELSE||When tokenizing, the Tandy 200 always adds a colon (':') before the ELSE token (3A 91). If the user actually writes :ELSE it is tokenized as 3A 3A 91.&lt;br /&gt;
|-&lt;br /&gt;
|92||146||LINE&lt;br /&gt;
|-&lt;br /&gt;
|93||147||EDIT&lt;br /&gt;
|-&lt;br /&gt;
|94||148||ERROR&lt;br /&gt;
|-&lt;br /&gt;
|95||149||RESUME&lt;br /&gt;
|-&lt;br /&gt;
|96||150||OUT&lt;br /&gt;
|-&lt;br /&gt;
|97||151||ON&lt;br /&gt;
|-&lt;br /&gt;
|98||152||DSKO$&lt;br /&gt;
|-&lt;br /&gt;
|99||153||OPEN&lt;br /&gt;
|-&lt;br /&gt;
|9A||154||CLOSE&lt;br /&gt;
|-&lt;br /&gt;
|9B||155||LOAD||Note that LOADM is simply the token for LOAD followed by an ASCII 'M'. &lt;br /&gt;
|-&lt;br /&gt;
|9C||156||MERGE&lt;br /&gt;
|-QUOTE&lt;br /&gt;
|9D||157||FILES&lt;br /&gt;
|-&lt;br /&gt;
|9E||158||SAVE&lt;br /&gt;
|-&lt;br /&gt;
|9F||159||LFILES&lt;br /&gt;
|-&lt;br /&gt;
|A0||160||LPRINT&lt;br /&gt;
|-&lt;br /&gt;
|A1||161||DEF&lt;br /&gt;
|-&lt;br /&gt;
|A2||162||POKE&lt;br /&gt;
|-&lt;br /&gt;
|A3||163||PRINT&lt;br /&gt;
|-&lt;br /&gt;
|A4||164||CONT&lt;br /&gt;
|-&lt;br /&gt;
|A5||165||LIST&lt;br /&gt;
|-&lt;br /&gt;
|A6||166||LLIST&lt;br /&gt;
|-&lt;br /&gt;
|A7||167||CLEAR&lt;br /&gt;
|-&lt;br /&gt;
|A8||168||CLOAD&lt;br /&gt;
|-&lt;br /&gt;
|A9||169||CSAVE&lt;br /&gt;
|-&lt;br /&gt;
|AA||170||TIME$&lt;br /&gt;
|-&lt;br /&gt;
|AB||171||DATE$&lt;br /&gt;
|-&lt;br /&gt;
|AC||172||DAY$&lt;br /&gt;
|-&lt;br /&gt;
|AD||173||COM&lt;br /&gt;
|-&lt;br /&gt;
|AE||174||MDM&lt;br /&gt;
|-&lt;br /&gt;
|AF||175||KEY&lt;br /&gt;
|-&lt;br /&gt;
|B0||176||CLS&lt;br /&gt;
|-&lt;br /&gt;
|B1||177||BEEP&lt;br /&gt;
|-&lt;br /&gt;
|B2||178||SOUND&lt;br /&gt;
|-&lt;br /&gt;
|B3||179||LCOPY&lt;br /&gt;
|-&lt;br /&gt;
|B4||180||PSET&lt;br /&gt;
|-&lt;br /&gt;
|B5||181||PRESET&lt;br /&gt;
|-&lt;br /&gt;
|B6||182||MOTOR&lt;br /&gt;
|-&lt;br /&gt;
|B7||183||MAX&lt;br /&gt;
|-&lt;br /&gt;
|B8||184||POWER&lt;br /&gt;
|-&lt;br /&gt;
|B9||185||CALL&lt;br /&gt;
|-&lt;br /&gt;
|BA||186||MENU&lt;br /&gt;
|-&lt;br /&gt;
|BB||187||IPL&lt;br /&gt;
|-&lt;br /&gt;
|BC||188||NAME&lt;br /&gt;
|-&lt;br /&gt;
|BD||189||KILL&lt;br /&gt;
|-&lt;br /&gt;
|BE||190||SCREEN&lt;br /&gt;
|-&lt;br /&gt;
|BF||191||NEW&lt;br /&gt;
|-&lt;br /&gt;
|C0||192||TAB(&lt;br /&gt;
|-&lt;br /&gt;
|C1||193||TO&lt;br /&gt;
|-&lt;br /&gt;
|C2||194||USING&lt;br /&gt;
|-&lt;br /&gt;
|C3||195||VARPTR&lt;br /&gt;
|-&lt;br /&gt;
|C4||196||ERL&lt;br /&gt;
|-&lt;br /&gt;
|C5||197||ERR&lt;br /&gt;
|-&lt;br /&gt;
|C6||198||STRING$&lt;br /&gt;
|-&lt;br /&gt;
|C7||199||INSTR&lt;br /&gt;
|-&lt;br /&gt;
|C8||200||DSKI$&lt;br /&gt;
|-&lt;br /&gt;
|C9||201||INKEY$&lt;br /&gt;
|-&lt;br /&gt;
|CA||202||CSRLIN&lt;br /&gt;
|-&lt;br /&gt;
|CB||203||OFF&lt;br /&gt;
|-&lt;br /&gt;
|CC||204||HIMEM&lt;br /&gt;
|-&lt;br /&gt;
|CD||205||THEN&lt;br /&gt;
|-&lt;br /&gt;
|CE||206||NOT&lt;br /&gt;
|-&lt;br /&gt;
|CF||207||STEP&lt;br /&gt;
|-&lt;br /&gt;
|D0||208||+&lt;br /&gt;
|-&lt;br /&gt;
|D1||209||-&lt;br /&gt;
|-&lt;br /&gt;
|D2||210||*&lt;br /&gt;
|-&lt;br /&gt;
|D3||211||/&lt;br /&gt;
|-&lt;br /&gt;
|D4||212||^&lt;br /&gt;
|-&lt;br /&gt;
|D5||213||AND&lt;br /&gt;
|-&lt;br /&gt;
|D6||214||OR&lt;br /&gt;
|-&lt;br /&gt;
|D7||215||XOR&lt;br /&gt;
|-&lt;br /&gt;
|D8||216||EQV&lt;br /&gt;
|-&lt;br /&gt;
|D9||217||IMP&lt;br /&gt;
|-&lt;br /&gt;
|DA||218||MOD&lt;br /&gt;
|-&lt;br /&gt;
|DB||219||\&lt;br /&gt;
|-&lt;br /&gt;
|DC||220||&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|DD||221||=&lt;br /&gt;
|-&lt;br /&gt;
|DE||222||&amp;lt;&lt;br /&gt;
|-&lt;br /&gt;
|DF||223||SGN&lt;br /&gt;
|-&lt;br /&gt;
|E0||224||INT&lt;br /&gt;
|-&lt;br /&gt;
|E1||225||ABS&lt;br /&gt;
|-&lt;br /&gt;
|E2||226||FRE&lt;br /&gt;
|-&lt;br /&gt;
|E3||227||INP&lt;br /&gt;
|-&lt;br /&gt;
|E4||228||LPOS&lt;br /&gt;
|-&lt;br /&gt;
|E5||229||POS&lt;br /&gt;
|-&lt;br /&gt;
|E6||230||SQR&lt;br /&gt;
|-&lt;br /&gt;
|E7||231||RND&lt;br /&gt;
|-&lt;br /&gt;
|E8||232||LOG&lt;br /&gt;
|-&lt;br /&gt;
|E9||233||EXP&lt;br /&gt;
|-&lt;br /&gt;
|EA||234||COS&lt;br /&gt;
|-&lt;br /&gt;
|EB||235||SIN&lt;br /&gt;
|-&lt;br /&gt;
|EC||236||TAN&lt;br /&gt;
|-&lt;br /&gt;
|ED||237||ATN&lt;br /&gt;
|-&lt;br /&gt;
|EE||238||PEEK&lt;br /&gt;
|-&lt;br /&gt;
|EF||239||EOF&lt;br /&gt;
|-&lt;br /&gt;
|F0||240||LOC&lt;br /&gt;
|-&lt;br /&gt;
|F1||241||LOF&lt;br /&gt;
|-&lt;br /&gt;
|F2||242||CINT&lt;br /&gt;
|-&lt;br /&gt;
|F3||243||CSNG&lt;br /&gt;
|-&lt;br /&gt;
|F4||244||CDBL&lt;br /&gt;
|-&lt;br /&gt;
|F5||245||FIX&lt;br /&gt;
|-&lt;br /&gt;
|F6||246||LEN&lt;br /&gt;
|-&lt;br /&gt;
|F7||247||STR$&lt;br /&gt;
|-&lt;br /&gt;
|F8||248||VAL&lt;br /&gt;
|-&lt;br /&gt;
|F9||249||ASC&lt;br /&gt;
|-&lt;br /&gt;
|FA||250||CHR$&lt;br /&gt;
|-&lt;br /&gt;
|FB||251||SPACE$&lt;br /&gt;
|-&lt;br /&gt;
|FC||252||LEFT$&lt;br /&gt;
|-&lt;br /&gt;
|FD||253||RIGHT$&lt;br /&gt;
|-&lt;br /&gt;
|FE||254||MID$&lt;br /&gt;
|-&lt;br /&gt;
|FF||255||' (QUOTE) || When tokenizing, the single quote character expands to three characters: a colon (3A), the byte for REM (8E), and then FF.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== File Format ==&lt;br /&gt;
&lt;br /&gt;
Tokenised BASIC code is a sequence of tokenized lines. Each tokenized line has the following format:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!Name!!Length!!Description&lt;br /&gt;
|-&lt;br /&gt;
|PL PH&lt;br /&gt;
|2 bytes&lt;br /&gt;
|Address in RAM of the next line of BASIC; unsigned 16-bit integer, little-endian. PL PH equal to zero marks the end of a tokenized BASIC listing. All other values can be ignored as they are merely placeholders in the file. During program load, Tandy BASIC always recalculates PL PH. Once in memory, PL PH is used to skip to the line required for GOTO, GOSUB, and READ, thus speeding up the program. &lt;br /&gt;
|-&lt;br /&gt;
|LL LH&lt;br /&gt;
|2 bytes&lt;br /&gt;
|Line number, unsigned 16-bit integer, little-endian.&lt;br /&gt;
|-&lt;br /&gt;
|B&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt; … B&amp;lt;sub&amp;gt;n&amp;lt;/sub&amp;gt;&lt;br /&gt;
|Any number&lt;br /&gt;
|Sequence of tokens or ASCII characters. If a character's value is ≥ 128, then it is a token. All tokens are a single byte. &lt;br /&gt;
|-&lt;br /&gt;
|NULL&lt;br /&gt;
|1 byte&lt;br /&gt;
|NULL byte (&amp;lt;code&amp;gt;0x00&amp;lt;/code&amp;gt;) to signal end of line. &lt;br /&gt;
|}&lt;br /&gt;
              &lt;br /&gt;
The end of the tokenized data is signaled by two consecutive NULLs in the location where PL PH would normally begin a new line.&lt;br /&gt;
&lt;br /&gt;
=== Limits ===&lt;br /&gt;
&lt;br /&gt;
* Line numbers can range from 0 to 65529 (but see variances below).&lt;br /&gt;
* Tokenized line length is limited to 256 characters, including the trailing NULL byte. (To do: double check this.)&lt;br /&gt;
&lt;br /&gt;
=== Acceptable variances ===&lt;br /&gt;
&lt;br /&gt;
While Tandy BASIC will never generate such files, it has no problem with a tokenized program that:&lt;br /&gt;
&lt;br /&gt;
* Has line numbers out of order; they will be sorted when loaded.&lt;br /&gt;
* Contains duplicate line numbers; previous line is discarded.&lt;br /&gt;
* Contains arbitrary bytes for PL PH; they are always regenerated during loading.&lt;br /&gt;
* Has a ^Z (ASCII 26) at the end of the file.&lt;br /&gt;
* Contains illegal line numbers; this can be used to store hidden binary data [https://www.mail-archive.com/m100@lists.bitchin100.com/msg16195.html according to John R. Hogerhuis].&lt;br /&gt;
&lt;br /&gt;
Note that while these variances are accepted on an actual Model T device (Model 100, Tandy 200, or Tandy 102), emulators may not be able to handle such files. For example, the [https://sourceforge.net/projects/virtualt/ Virtual T] emulator (as of version 1.7 in 2022) refuses to load tokenized BASIC programs that have lines out of order, duplicate lines, or bogus values for PL PH. &lt;br /&gt;
&lt;br /&gt;
=== Details for PL PH ===&lt;br /&gt;
&lt;br /&gt;
(Stub. This is where the correct calculation of PL PH values will go.)&lt;br /&gt;
&lt;br /&gt;
== Format documentation ==&lt;br /&gt;
&lt;br /&gt;
* [https://m100.bitchin100.narkive.com/eP2uSl4J/tokenized-basic-programs-bytes-of-mystery Discussion of byte format on Bitchin 100 Mailing List]&lt;br /&gt;
* [http://www.club100.org/library/ups/tokens.do BASIC program to create a table of tokens]&lt;br /&gt;
* [https://archive.org/details/HiddenPowersOfTheTrs80Model100/page/n229/mode/2up?view=theater Hidden Powers of the TRS 80 Model 100]. Appendix B lists the BASIC token values for the Model 100. Other than the omission of 255 for a single quote remark, this reference matches what hackerb9 found programmatically for the Tandy 200.&lt;br /&gt;
* [http://web.archive.org/web/20220324135218/https://help.ayra.ch/trs80-reference#trs-80-model-100-basic-reference Ayra Model 100 BASIC Reference]&lt;br /&gt;
&lt;br /&gt;
== Other links ==&lt;br /&gt;
&lt;br /&gt;
* [https://github.com/hackerb9/tokenize/ Hackerb9's simple program for tokenizing BASIC code]&lt;br /&gt;
* [https://sourceforge.net/projects/virtualt/ A Tandy 200 &amp;amp; Model 100/102 emulator]&lt;br /&gt;
* [http://bitchin100.com/CloudT/ A TRS-80 Model 100 emulator that runs in a web browser]&lt;br /&gt;
&lt;br /&gt;
[[Category:Microsoft]]&lt;/div&gt;</summary>
		<author><name>Hackerb9</name></author>	</entry>

	<entry>
		<id>http://fileformats.archiveteam.org/wiki/Tandy_200_BASIC_tokenized_file</id>
		<title>Tandy 200 BASIC tokenized file</title>
		<link rel="alternate" type="text/html" href="http://fileformats.archiveteam.org/wiki/Tandy_200_BASIC_tokenized_file"/>
				<updated>2022-10-05T20:49:15Z</updated>
		
		<summary type="html">&lt;p&gt;Hackerb9: /* Format documentation */ Mention the lack ' (single quote)&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{FormatInfo&lt;br /&gt;
|subcat=Source code&lt;br /&gt;
|subcat2=Tokenized BASIC&lt;br /&gt;
|released=1984&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
'''Tandy 200 BASIC''' was a version of Microsoft BASIC for the Radio Shack Tandy 200 computer. The tokenizations for the TRS-80 Model 100 and Tandy 102 appear to be identical. The NEC PC-8201/8300 format is not the same, but should be similar.&lt;br /&gt;
&lt;br /&gt;
== Tokens ==&lt;br /&gt;
&lt;br /&gt;
Table of tokenized BASIC keywords.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! title=&amp;quot;Hexadecimal code point&amp;quot; | Hex&lt;br /&gt;
! title=&amp;quot;Decimal code point&amp;quot; | Dec&lt;br /&gt;
! title=&amp;quot;BASIC element the token stands for&amp;quot; | Token meaning &lt;br /&gt;
! title=&amp;quot;Miscellany&amp;quot; | Notes&lt;br /&gt;
|-&lt;br /&gt;
|-&lt;br /&gt;
|80||128||END&lt;br /&gt;
|-&lt;br /&gt;
|81||129||FOR&lt;br /&gt;
|-&lt;br /&gt;
|82||130||NEXT&lt;br /&gt;
|-&lt;br /&gt;
|83||131||DATA&lt;br /&gt;
|-&lt;br /&gt;
|84||132||INPUT&lt;br /&gt;
|-&lt;br /&gt;
|85||133||DIM&lt;br /&gt;
|-&lt;br /&gt;
|86||134||READ&lt;br /&gt;
|-&lt;br /&gt;
|87||135||LET&lt;br /&gt;
|-&lt;br /&gt;
|88||136||GOTO&lt;br /&gt;
|-&lt;br /&gt;
|89||137||RUN&lt;br /&gt;
|-&lt;br /&gt;
|8A||138||IF&lt;br /&gt;
|-&lt;br /&gt;
|8B||139||RESTORE&lt;br /&gt;
|-&lt;br /&gt;
|8C||140||GOSUB&lt;br /&gt;
|-&lt;br /&gt;
|8D||141||RETURN&lt;br /&gt;
|-&lt;br /&gt;
|8E||142||REM&lt;br /&gt;
|-&lt;br /&gt;
|8F||143||STOP&lt;br /&gt;
|-&lt;br /&gt;
|90||144||WIDTH&lt;br /&gt;
|-&lt;br /&gt;
|91||145||ELSE||When tokenizing, the Tandy 200 always adds a colon (':') before the ELSE token (3A 91). If the user actually writes :ELSE it is tokenized as 3A 3A 91.&lt;br /&gt;
|-&lt;br /&gt;
|92||146||LINE&lt;br /&gt;
|-&lt;br /&gt;
|93||147||EDIT&lt;br /&gt;
|-&lt;br /&gt;
|94||148||ERROR&lt;br /&gt;
|-&lt;br /&gt;
|95||149||RESUME&lt;br /&gt;
|-&lt;br /&gt;
|96||150||OUT&lt;br /&gt;
|-&lt;br /&gt;
|97||151||ON&lt;br /&gt;
|-&lt;br /&gt;
|98||152||DSKO$&lt;br /&gt;
|-&lt;br /&gt;
|99||153||OPEN&lt;br /&gt;
|-&lt;br /&gt;
|9A||154||CLOSE&lt;br /&gt;
|-&lt;br /&gt;
|9B||155||LOAD||Note that LOADM is simply the token for LOAD followed by an ASCII 'M'. &lt;br /&gt;
|-&lt;br /&gt;
|9C||156||MERGE&lt;br /&gt;
|-QUOTE&lt;br /&gt;
|9D||157||FILES&lt;br /&gt;
|-&lt;br /&gt;
|9E||158||SAVE&lt;br /&gt;
|-&lt;br /&gt;
|9F||159||LFILES&lt;br /&gt;
|-&lt;br /&gt;
|A0||160||LPRINT&lt;br /&gt;
|-&lt;br /&gt;
|A1||161||DEF&lt;br /&gt;
|-&lt;br /&gt;
|A2||162||POKE&lt;br /&gt;
|-&lt;br /&gt;
|A3||163||PRINT&lt;br /&gt;
|-&lt;br /&gt;
|A4||164||CONT&lt;br /&gt;
|-&lt;br /&gt;
|A5||165||LIST&lt;br /&gt;
|-&lt;br /&gt;
|A6||166||LLIST&lt;br /&gt;
|-&lt;br /&gt;
|A7||167||CLEAR&lt;br /&gt;
|-&lt;br /&gt;
|A8||168||CLOAD&lt;br /&gt;
|-&lt;br /&gt;
|A9||169||CSAVE&lt;br /&gt;
|-&lt;br /&gt;
|AA||170||TIME$&lt;br /&gt;
|-&lt;br /&gt;
|AB||171||DATE$&lt;br /&gt;
|-&lt;br /&gt;
|AC||172||DAY$&lt;br /&gt;
|-&lt;br /&gt;
|AD||173||COM&lt;br /&gt;
|-&lt;br /&gt;
|AE||174||MDM&lt;br /&gt;
|-&lt;br /&gt;
|AF||175||KEY&lt;br /&gt;
|-&lt;br /&gt;
|B0||176||CLS&lt;br /&gt;
|-&lt;br /&gt;
|B1||177||BEEP&lt;br /&gt;
|-&lt;br /&gt;
|B2||178||SOUND&lt;br /&gt;
|-&lt;br /&gt;
|B3||179||LCOPY&lt;br /&gt;
|-&lt;br /&gt;
|B4||180||PSET&lt;br /&gt;
|-&lt;br /&gt;
|B5||181||PRESET&lt;br /&gt;
|-&lt;br /&gt;
|B6||182||MOTOR&lt;br /&gt;
|-&lt;br /&gt;
|B7||183||MAX&lt;br /&gt;
|-&lt;br /&gt;
|B8||184||POWER&lt;br /&gt;
|-&lt;br /&gt;
|B9||185||CALL&lt;br /&gt;
|-&lt;br /&gt;
|BA||186||MENU&lt;br /&gt;
|-&lt;br /&gt;
|BB||187||IPL&lt;br /&gt;
|-&lt;br /&gt;
|BC||188||NAME&lt;br /&gt;
|-&lt;br /&gt;
|BD||189||KILL&lt;br /&gt;
|-&lt;br /&gt;
|BE||190||SCREEN&lt;br /&gt;
|-&lt;br /&gt;
|BF||191||NEW&lt;br /&gt;
|-&lt;br /&gt;
|C0||192||TAB(&lt;br /&gt;
|-&lt;br /&gt;
|C1||193||TO&lt;br /&gt;
|-&lt;br /&gt;
|C2||194||USING&lt;br /&gt;
|-&lt;br /&gt;
|C3||195||VARPTR&lt;br /&gt;
|-&lt;br /&gt;
|C4||196||ERL&lt;br /&gt;
|-&lt;br /&gt;
|C5||197||ERR&lt;br /&gt;
|-&lt;br /&gt;
|C6||198||STRING$&lt;br /&gt;
|-&lt;br /&gt;
|C7||199||INSTR&lt;br /&gt;
|-&lt;br /&gt;
|C8||200||DSKI$&lt;br /&gt;
|-&lt;br /&gt;
|C9||201||INKEY$&lt;br /&gt;
|-&lt;br /&gt;
|CA||202||CSRLIN&lt;br /&gt;
|-&lt;br /&gt;
|CB||203||OFF&lt;br /&gt;
|-&lt;br /&gt;
|CC||204||HIMEM&lt;br /&gt;
|-&lt;br /&gt;
|CD||205||THEN&lt;br /&gt;
|-&lt;br /&gt;
|CE||206||NOT&lt;br /&gt;
|-&lt;br /&gt;
|CF||207||STEP&lt;br /&gt;
|-&lt;br /&gt;
|D0||208||+&lt;br /&gt;
|-&lt;br /&gt;
|D1||209||-&lt;br /&gt;
|-&lt;br /&gt;
|D2||210||*&lt;br /&gt;
|-&lt;br /&gt;
|D3||211||/&lt;br /&gt;
|-&lt;br /&gt;
|D4||212||^&lt;br /&gt;
|-&lt;br /&gt;
|D5||213||AND&lt;br /&gt;
|-&lt;br /&gt;
|D6||214||OR&lt;br /&gt;
|-&lt;br /&gt;
|D7||215||XOR&lt;br /&gt;
|-&lt;br /&gt;
|D8||216||EQV&lt;br /&gt;
|-&lt;br /&gt;
|D9||217||IMP&lt;br /&gt;
|-&lt;br /&gt;
|DA||218||MOD&lt;br /&gt;
|-&lt;br /&gt;
|DB||219||\&lt;br /&gt;
|-&lt;br /&gt;
|DC||220||&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|DD||221||=&lt;br /&gt;
|-&lt;br /&gt;
|DE||222||&amp;lt;&lt;br /&gt;
|-&lt;br /&gt;
|DF||223||SGN&lt;br /&gt;
|-&lt;br /&gt;
|E0||224||INT&lt;br /&gt;
|-&lt;br /&gt;
|E1||225||ABS&lt;br /&gt;
|-&lt;br /&gt;
|E2||226||FRE&lt;br /&gt;
|-&lt;br /&gt;
|E3||227||INP&lt;br /&gt;
|-&lt;br /&gt;
|E4||228||LPOS&lt;br /&gt;
|-&lt;br /&gt;
|E5||229||POS&lt;br /&gt;
|-&lt;br /&gt;
|E6||230||SQR&lt;br /&gt;
|-&lt;br /&gt;
|E7||231||RND&lt;br /&gt;
|-&lt;br /&gt;
|E8||232||LOG&lt;br /&gt;
|-&lt;br /&gt;
|E9||233||EXP&lt;br /&gt;
|-&lt;br /&gt;
|EA||234||COS&lt;br /&gt;
|-&lt;br /&gt;
|EB||235||SIN&lt;br /&gt;
|-&lt;br /&gt;
|EC||236||TAN&lt;br /&gt;
|-&lt;br /&gt;
|ED||237||ATN&lt;br /&gt;
|-&lt;br /&gt;
|EE||238||PEEK&lt;br /&gt;
|-&lt;br /&gt;
|EF||239||EOF&lt;br /&gt;
|-&lt;br /&gt;
|F0||240||LOC&lt;br /&gt;
|-&lt;br /&gt;
|F1||241||LOF&lt;br /&gt;
|-&lt;br /&gt;
|F2||242||CINT&lt;br /&gt;
|-&lt;br /&gt;
|F3||243||CSNG&lt;br /&gt;
|-&lt;br /&gt;
|F4||244||CDBL&lt;br /&gt;
|-&lt;br /&gt;
|F5||245||FIX&lt;br /&gt;
|-&lt;br /&gt;
|F6||246||LEN&lt;br /&gt;
|-&lt;br /&gt;
|F7||247||STR$&lt;br /&gt;
|-&lt;br /&gt;
|F8||248||VAL&lt;br /&gt;
|-&lt;br /&gt;
|F9||249||ASC&lt;br /&gt;
|-&lt;br /&gt;
|FA||250||CHR$&lt;br /&gt;
|-&lt;br /&gt;
|FB||251||SPACE$&lt;br /&gt;
|-&lt;br /&gt;
|FC||252||LEFT$&lt;br /&gt;
|-&lt;br /&gt;
|FD||253||RIGHT$&lt;br /&gt;
|-&lt;br /&gt;
|FE||254||MID$&lt;br /&gt;
|-&lt;br /&gt;
|FF||255||' (QUOTE) || When tokenizing, the single quote character expands to three characters: a colon (3A), the byte for REM (8E), and then FF.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== File Format ==&lt;br /&gt;
&lt;br /&gt;
Tokenised BASIC code is a sequence of tokenized lines. Each tokenized line has the following format:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!Name!!Length!!Description&lt;br /&gt;
|-&lt;br /&gt;
|PL PH&lt;br /&gt;
|2 bytes&lt;br /&gt;
|Address in RAM of the next line of BASIC, unsigned 16-bit integer, little-endian. The end of a tokenized BASIC listing is marked by PL PH being zero. All other values can be ignored as they are merely placeholders in the file. During program load, Tandy BASIC always recalculates PL PH. Once in memory, PL PH is used to skip to the line required for GOTO, GOSUB, and READ, thus speeding up the program. &lt;br /&gt;
|-&lt;br /&gt;
|LL LH&lt;br /&gt;
|2 bytes&lt;br /&gt;
|Line number, unsigned 16-bit integer, little-endian.&lt;br /&gt;
|-&lt;br /&gt;
|B&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt; … B&amp;lt;sub&amp;gt;n&amp;lt;/sub&amp;gt;&lt;br /&gt;
|Any number&lt;br /&gt;
|Sequence of tokens or ASCII characters. If a character's value is ≥ 128, then it is a token. All tokens are a single byte. &lt;br /&gt;
|-&lt;br /&gt;
|NULL&lt;br /&gt;
|1 byte&lt;br /&gt;
|NULL byte (&amp;lt;code&amp;gt;0x00&amp;lt;/code&amp;gt;) to signal end of line. &lt;br /&gt;
|}&lt;br /&gt;
              &lt;br /&gt;
The end of the tokenized data is signaled by two consecutive NULLs in the location where PL PH would normally begin a new line.&lt;br /&gt;
&lt;br /&gt;
=== Limits ===&lt;br /&gt;
&lt;br /&gt;
* Line numbers can range from 0 to 65529 (but see variances below).&lt;br /&gt;
* Tokenized line length is limited to 256 characters, including the trailing NULL byte. (To do: double check this.)&lt;br /&gt;
&lt;br /&gt;
=== Acceptable variances ===&lt;br /&gt;
&lt;br /&gt;
While Tandy BASIC will never generate such files, it has no problem with a tokenized program that:&lt;br /&gt;
&lt;br /&gt;
* Has line numbers out of order; they will be sorted when loaded.&lt;br /&gt;
* Contains duplicate line numbers; previous line is discarded.&lt;br /&gt;
* Contains arbitrary bytes for PL PH; they are always regenerated during loading.&lt;br /&gt;
* Has a ^Z (ASCII 26) at the end of the file.&lt;br /&gt;
* Contains illegal line numbers; this can be used to store hidden binary data [https://www.mail-archive.com/m100@lists.bitchin100.com/msg16195.html according to John R. Hogerhuis].&lt;br /&gt;
&lt;br /&gt;
Note that while these variances are accepted on an actual Model T device (Model 100, Tandy 200, or Tandy 102), emulators may not be able to handle such files. For example, the [https://sourceforge.net/projects/virtualt/ Virtual T] emulator (as of version 1.7 in 2022) refuses to load tokenized BASIC programs that have lines out of order, duplicate lines, or bogus values for PL PH. &lt;br /&gt;
&lt;br /&gt;
=== Details for PL PH ===&lt;br /&gt;
&lt;br /&gt;
(Stub. This is where the correct calculation of PL PH values will go.)&lt;br /&gt;
&lt;br /&gt;
== Format documentation ==&lt;br /&gt;
&lt;br /&gt;
* [https://m100.bitchin100.narkive.com/eP2uSl4J/tokenized-basic-programs-bytes-of-mystery Discussion of byte format on Bitchin 100 Mailing List]&lt;br /&gt;
* [http://www.club100.org/library/ups/tokens.do BASIC program to create a table of tokens]&lt;br /&gt;
* [https://archive.org/details/HiddenPowersOfTheTrs80Model100/page/n229/mode/2up?view=theater Hidden Powers of the TRS 80 Model 100]. Appendix B lists the BASIC token values for the Model 100. Other than the omission of 255 for a single quote remark, this reference matches what hackerb9 found programmatically for the Tandy 200.&lt;br /&gt;
* [http://web.archive.org/web/20220324135218/https://help.ayra.ch/trs80-reference#trs-80-model-100-basic-reference Ayra Model 100 BASIC Reference]&lt;br /&gt;
&lt;br /&gt;
== Other links ==&lt;br /&gt;
&lt;br /&gt;
* [https://github.com/hackerb9/tokenize/ Hackerb9's simple program for tokenizing BASIC code]&lt;br /&gt;
* [https://sourceforge.net/projects/virtualt/ A Tandy 200 &amp;amp; Model 100/102 emulator]&lt;br /&gt;
* [http://bitchin100.com/CloudT/ A TRS-80 Model 100 emulator that runs in a web browser]&lt;br /&gt;
&lt;br /&gt;
[[Category:Microsoft]]&lt;/div&gt;</summary>
		<author><name>Hackerb9</name></author>	</entry>

	<entry>
		<id>http://fileformats.archiveteam.org/wiki/Tandy_200_BASIC_tokenized_file</id>
		<title>Tandy 200 BASIC tokenized file</title>
		<link rel="alternate" type="text/html" href="http://fileformats.archiveteam.org/wiki/Tandy_200_BASIC_tokenized_file"/>
				<updated>2022-10-05T20:43:09Z</updated>
		
		<summary type="html">&lt;p&gt;Hackerb9: /* File Format */ Add information about the marker for the end of listing&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{FormatInfo&lt;br /&gt;
|subcat=Source code&lt;br /&gt;
|subcat2=Tokenized BASIC&lt;br /&gt;
|released=1984&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
'''Tandy 200 BASIC''' was a version of Microsoft BASIC for the Radio Shack Tandy 200 computer. The tokenizations for the TRS-80 Model 100 and Tandy 102 appear to be identical. The NEC PC-8201/8300 format is not the same, but should be similar.&lt;br /&gt;
&lt;br /&gt;
== Tokens ==&lt;br /&gt;
&lt;br /&gt;
Table of tokenized BASIC keywords.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! title=&amp;quot;Hexadecimal code point&amp;quot; | Hex&lt;br /&gt;
! title=&amp;quot;Decimal code point&amp;quot; | Dec&lt;br /&gt;
! title=&amp;quot;BASIC element the token stands for&amp;quot; | Token meaning &lt;br /&gt;
! title=&amp;quot;Miscellany&amp;quot; | Notes&lt;br /&gt;
|-&lt;br /&gt;
|-&lt;br /&gt;
|80||128||END&lt;br /&gt;
|-&lt;br /&gt;
|81||129||FOR&lt;br /&gt;
|-&lt;br /&gt;
|82||130||NEXT&lt;br /&gt;
|-&lt;br /&gt;
|83||131||DATA&lt;br /&gt;
|-&lt;br /&gt;
|84||132||INPUT&lt;br /&gt;
|-&lt;br /&gt;
|85||133||DIM&lt;br /&gt;
|-&lt;br /&gt;
|86||134||READ&lt;br /&gt;
|-&lt;br /&gt;
|87||135||LET&lt;br /&gt;
|-&lt;br /&gt;
|88||136||GOTO&lt;br /&gt;
|-&lt;br /&gt;
|89||137||RUN&lt;br /&gt;
|-&lt;br /&gt;
|8A||138||IF&lt;br /&gt;
|-&lt;br /&gt;
|8B||139||RESTORE&lt;br /&gt;
|-&lt;br /&gt;
|8C||140||GOSUB&lt;br /&gt;
|-&lt;br /&gt;
|8D||141||RETURN&lt;br /&gt;
|-&lt;br /&gt;
|8E||142||REM&lt;br /&gt;
|-&lt;br /&gt;
|8F||143||STOP&lt;br /&gt;
|-&lt;br /&gt;
|90||144||WIDTH&lt;br /&gt;
|-&lt;br /&gt;
|91||145||ELSE||When tokenizing, the Tandy 200 always adds a colon (':') before the ELSE token (3A 91). If the user actually writes :ELSE it is tokenized as 3A 3A 91.&lt;br /&gt;
|-&lt;br /&gt;
|92||146||LINE&lt;br /&gt;
|-&lt;br /&gt;
|93||147||EDIT&lt;br /&gt;
|-&lt;br /&gt;
|94||148||ERROR&lt;br /&gt;
|-&lt;br /&gt;
|95||149||RESUME&lt;br /&gt;
|-&lt;br /&gt;
|96||150||OUT&lt;br /&gt;
|-&lt;br /&gt;
|97||151||ON&lt;br /&gt;
|-&lt;br /&gt;
|98||152||DSKO$&lt;br /&gt;
|-&lt;br /&gt;
|99||153||OPEN&lt;br /&gt;
|-&lt;br /&gt;
|9A||154||CLOSE&lt;br /&gt;
|-&lt;br /&gt;
|9B||155||LOAD||Note that LOADM is simply the token for LOAD followed by an ASCII 'M'. &lt;br /&gt;
|-&lt;br /&gt;
|9C||156||MERGE&lt;br /&gt;
|-QUOTE&lt;br /&gt;
|9D||157||FILES&lt;br /&gt;
|-&lt;br /&gt;
|9E||158||SAVE&lt;br /&gt;
|-&lt;br /&gt;
|9F||159||LFILES&lt;br /&gt;
|-&lt;br /&gt;
|A0||160||LPRINT&lt;br /&gt;
|-&lt;br /&gt;
|A1||161||DEF&lt;br /&gt;
|-&lt;br /&gt;
|A2||162||POKE&lt;br /&gt;
|-&lt;br /&gt;
|A3||163||PRINT&lt;br /&gt;
|-&lt;br /&gt;
|A4||164||CONT&lt;br /&gt;
|-&lt;br /&gt;
|A5||165||LIST&lt;br /&gt;
|-&lt;br /&gt;
|A6||166||LLIST&lt;br /&gt;
|-&lt;br /&gt;
|A7||167||CLEAR&lt;br /&gt;
|-&lt;br /&gt;
|A8||168||CLOAD&lt;br /&gt;
|-&lt;br /&gt;
|A9||169||CSAVE&lt;br /&gt;
|-&lt;br /&gt;
|AA||170||TIME$&lt;br /&gt;
|-&lt;br /&gt;
|AB||171||DATE$&lt;br /&gt;
|-&lt;br /&gt;
|AC||172||DAY$&lt;br /&gt;
|-&lt;br /&gt;
|AD||173||COM&lt;br /&gt;
|-&lt;br /&gt;
|AE||174||MDM&lt;br /&gt;
|-&lt;br /&gt;
|AF||175||KEY&lt;br /&gt;
|-&lt;br /&gt;
|B0||176||CLS&lt;br /&gt;
|-&lt;br /&gt;
|B1||177||BEEP&lt;br /&gt;
|-&lt;br /&gt;
|B2||178||SOUND&lt;br /&gt;
|-&lt;br /&gt;
|B3||179||LCOPY&lt;br /&gt;
|-&lt;br /&gt;
|B4||180||PSET&lt;br /&gt;
|-&lt;br /&gt;
|B5||181||PRESET&lt;br /&gt;
|-&lt;br /&gt;
|B6||182||MOTOR&lt;br /&gt;
|-&lt;br /&gt;
|B7||183||MAX&lt;br /&gt;
|-&lt;br /&gt;
|B8||184||POWER&lt;br /&gt;
|-&lt;br /&gt;
|B9||185||CALL&lt;br /&gt;
|-&lt;br /&gt;
|BA||186||MENU&lt;br /&gt;
|-&lt;br /&gt;
|BB||187||IPL&lt;br /&gt;
|-&lt;br /&gt;
|BC||188||NAME&lt;br /&gt;
|-&lt;br /&gt;
|BD||189||KILL&lt;br /&gt;
|-&lt;br /&gt;
|BE||190||SCREEN&lt;br /&gt;
|-&lt;br /&gt;
|BF||191||NEW&lt;br /&gt;
|-&lt;br /&gt;
|C0||192||TAB(&lt;br /&gt;
|-&lt;br /&gt;
|C1||193||TO&lt;br /&gt;
|-&lt;br /&gt;
|C2||194||USING&lt;br /&gt;
|-&lt;br /&gt;
|C3||195||VARPTR&lt;br /&gt;
|-&lt;br /&gt;
|C4||196||ERL&lt;br /&gt;
|-&lt;br /&gt;
|C5||197||ERR&lt;br /&gt;
|-&lt;br /&gt;
|C6||198||STRING$&lt;br /&gt;
|-&lt;br /&gt;
|C7||199||INSTR&lt;br /&gt;
|-&lt;br /&gt;
|C8||200||DSKI$&lt;br /&gt;
|-&lt;br /&gt;
|C9||201||INKEY$&lt;br /&gt;
|-&lt;br /&gt;
|CA||202||CSRLIN&lt;br /&gt;
|-&lt;br /&gt;
|CB||203||OFF&lt;br /&gt;
|-&lt;br /&gt;
|CC||204||HIMEM&lt;br /&gt;
|-&lt;br /&gt;
|CD||205||THEN&lt;br /&gt;
|-&lt;br /&gt;
|CE||206||NOT&lt;br /&gt;
|-&lt;br /&gt;
|CF||207||STEP&lt;br /&gt;
|-&lt;br /&gt;
|D0||208||+&lt;br /&gt;
|-&lt;br /&gt;
|D1||209||-&lt;br /&gt;
|-&lt;br /&gt;
|D2||210||*&lt;br /&gt;
|-&lt;br /&gt;
|D3||211||/&lt;br /&gt;
|-&lt;br /&gt;
|D4||212||^&lt;br /&gt;
|-&lt;br /&gt;
|D5||213||AND&lt;br /&gt;
|-&lt;br /&gt;
|D6||214||OR&lt;br /&gt;
|-&lt;br /&gt;
|D7||215||XOR&lt;br /&gt;
|-&lt;br /&gt;
|D8||216||EQV&lt;br /&gt;
|-&lt;br /&gt;
|D9||217||IMP&lt;br /&gt;
|-&lt;br /&gt;
|DA||218||MOD&lt;br /&gt;
|-&lt;br /&gt;
|DB||219||\&lt;br /&gt;
|-&lt;br /&gt;
|DC||220||&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|DD||221||=&lt;br /&gt;
|-&lt;br /&gt;
|DE||222||&amp;lt;&lt;br /&gt;
|-&lt;br /&gt;
|DF||223||SGN&lt;br /&gt;
|-&lt;br /&gt;
|E0||224||INT&lt;br /&gt;
|-&lt;br /&gt;
|E1||225||ABS&lt;br /&gt;
|-&lt;br /&gt;
|E2||226||FRE&lt;br /&gt;
|-&lt;br /&gt;
|E3||227||INP&lt;br /&gt;
|-&lt;br /&gt;
|E4||228||LPOS&lt;br /&gt;
|-&lt;br /&gt;
|E5||229||POS&lt;br /&gt;
|-&lt;br /&gt;
|E6||230||SQR&lt;br /&gt;
|-&lt;br /&gt;
|E7||231||RND&lt;br /&gt;
|-&lt;br /&gt;
|E8||232||LOG&lt;br /&gt;
|-&lt;br /&gt;
|E9||233||EXP&lt;br /&gt;
|-&lt;br /&gt;
|EA||234||COS&lt;br /&gt;
|-&lt;br /&gt;
|EB||235||SIN&lt;br /&gt;
|-&lt;br /&gt;
|EC||236||TAN&lt;br /&gt;
|-&lt;br /&gt;
|ED||237||ATN&lt;br /&gt;
|-&lt;br /&gt;
|EE||238||PEEK&lt;br /&gt;
|-&lt;br /&gt;
|EF||239||EOF&lt;br /&gt;
|-&lt;br /&gt;
|F0||240||LOC&lt;br /&gt;
|-&lt;br /&gt;
|F1||241||LOF&lt;br /&gt;
|-&lt;br /&gt;
|F2||242||CINT&lt;br /&gt;
|-&lt;br /&gt;
|F3||243||CSNG&lt;br /&gt;
|-&lt;br /&gt;
|F4||244||CDBL&lt;br /&gt;
|-&lt;br /&gt;
|F5||245||FIX&lt;br /&gt;
|-&lt;br /&gt;
|F6||246||LEN&lt;br /&gt;
|-&lt;br /&gt;
|F7||247||STR$&lt;br /&gt;
|-&lt;br /&gt;
|F8||248||VAL&lt;br /&gt;
|-&lt;br /&gt;
|F9||249||ASC&lt;br /&gt;
|-&lt;br /&gt;
|FA||250||CHR$&lt;br /&gt;
|-&lt;br /&gt;
|FB||251||SPACE$&lt;br /&gt;
|-&lt;br /&gt;
|FC||252||LEFT$&lt;br /&gt;
|-&lt;br /&gt;
|FD||253||RIGHT$&lt;br /&gt;
|-&lt;br /&gt;
|FE||254||MID$&lt;br /&gt;
|-&lt;br /&gt;
|FF||255||' (QUOTE) || When tokenizing, the single quote character expands to three characters: a colon (3A), the byte for REM (8E), and then FF.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== File Format ==&lt;br /&gt;
&lt;br /&gt;
Tokenised BASIC code is a sequence of tokenized lines. Each tokenized line has the following format:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!Name!!Length!!Description&lt;br /&gt;
|-&lt;br /&gt;
|PL PH&lt;br /&gt;
|2 bytes&lt;br /&gt;
|Address in RAM of the next line of BASIC, unsigned 16-bit integer, little-endian. The end of a tokenized BASIC listing is marked by PL PH being zero. All other values can be ignored as they are merely placeholders in the file. During program load, Tandy BASIC always recalculates PL PH. Once in memory, PL PH is used to skip to the line required for GOTO, GOSUB, and READ, thus speeding up the program. &lt;br /&gt;
|-&lt;br /&gt;
|LL LH&lt;br /&gt;
|2 bytes&lt;br /&gt;
|Line number, unsigned 16-bit integer, little-endian.&lt;br /&gt;
|-&lt;br /&gt;
|B&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt; … B&amp;lt;sub&amp;gt;n&amp;lt;/sub&amp;gt;&lt;br /&gt;
|Any number&lt;br /&gt;
|Sequence of tokens or ASCII characters. If a character's value is ≥ 128, then it is a token. All tokens are a single byte. &lt;br /&gt;
|-&lt;br /&gt;
|NULL&lt;br /&gt;
|1 byte&lt;br /&gt;
|NULL byte (&amp;lt;code&amp;gt;0x00&amp;lt;/code&amp;gt;) to signal end of line. &lt;br /&gt;
|}&lt;br /&gt;
              &lt;br /&gt;
The end of the tokenized data is signaled by two consecutive NULLs in the location where PL PH would normally begin a new line.&lt;br /&gt;
&lt;br /&gt;
=== Limits ===&lt;br /&gt;
&lt;br /&gt;
* Line numbers can range from 0 to 65529 (but see variances below).&lt;br /&gt;
* Tokenized line length is limited to 256 characters, including the trailing NULL byte. (To do: double check this.)&lt;br /&gt;
&lt;br /&gt;
=== Acceptable variances ===&lt;br /&gt;
&lt;br /&gt;
While Tandy BASIC will never generate such files, it has no problem with a tokenized program that:&lt;br /&gt;
&lt;br /&gt;
* Has line numbers out of order; they will be sorted when loaded.&lt;br /&gt;
* Contains duplicate line numbers; previous line is discarded.&lt;br /&gt;
* Contains arbitrary bytes for PL PH; they are always regenerated during loading.&lt;br /&gt;
* Has a ^Z (ASCII 26) at the end of the file.&lt;br /&gt;
* Contains illegal line numbers; this can be used to store hidden binary data [https://www.mail-archive.com/m100@lists.bitchin100.com/msg16195.html according to John R. Hogerhuis].&lt;br /&gt;
&lt;br /&gt;
Note that while these variances are accepted on an actual Model T device (Model 100, Tandy 200, or Tandy 102), emulators may not be able to handle such files. For example, the [https://sourceforge.net/projects/virtualt/ Virtual T] emulator (as of version 1.7 in 2022) refuses to load tokenized BASIC programs that have lines out of order, duplicate lines, or bogus values for PL PH. &lt;br /&gt;
&lt;br /&gt;
=== Details for PL PH ===&lt;br /&gt;
&lt;br /&gt;
(Stub. This is where the correct calculation of PL PH values will go.)&lt;br /&gt;
&lt;br /&gt;
== Format documentation ==&lt;br /&gt;
&lt;br /&gt;
* [https://m100.bitchin100.narkive.com/eP2uSl4J/tokenized-basic-programs-bytes-of-mystery Discussion of byte format on Bitchin 100 Mailing List]&lt;br /&gt;
* [http://www.club100.org/library/ups/tokens.do BASIC program to create a table of tokens]&lt;br /&gt;
* [https://archive.org/details/HiddenPowersOfTheTrs80Model100/page/n229/mode/2up?view=theater Hidden Powers of the TRS 80 Model 100]. Appendix B lists the BASIC token values for the Model 100 which matches what hackerb9 found programmatically for the Tandy 200.&lt;br /&gt;
* [http://web.archive.org/web/20220324135218/https://help.ayra.ch/trs80-reference#trs-80-model-100-basic-reference Ayra Model 100 BASIC Reference]&lt;br /&gt;
&lt;br /&gt;
== Other links ==&lt;br /&gt;
&lt;br /&gt;
* [https://github.com/hackerb9/tokenize/ Hackerb9's simple program for tokenizing BASIC code]&lt;br /&gt;
* [https://sourceforge.net/projects/virtualt/ A Tandy 200 &amp;amp; Model 100/102 emulator]&lt;br /&gt;
* [http://bitchin100.com/CloudT/ A TRS-80 Model 100 emulator that runs in a web browser]&lt;br /&gt;
&lt;br /&gt;
[[Category:Microsoft]]&lt;/div&gt;</summary>
		<author><name>Hackerb9</name></author>	</entry>

	<entry>
		<id>http://fileformats.archiveteam.org/wiki/Tandy_200_BASIC_tokenized_file</id>
		<title>Tandy 200 BASIC tokenized file</title>
		<link rel="alternate" type="text/html" href="http://fileformats.archiveteam.org/wiki/Tandy_200_BASIC_tokenized_file"/>
				<updated>2022-10-05T20:07:28Z</updated>
		
		<summary type="html">&lt;p&gt;Hackerb9: /* Tokens */ Remove vestigial notice about blank entries.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{FormatInfo&lt;br /&gt;
|subcat=Source code&lt;br /&gt;
|subcat2=Tokenized BASIC&lt;br /&gt;
|released=1984&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
'''Tandy 200 BASIC''' was a version of Microsoft BASIC for the Radio Shack Tandy 200 computer. The tokenizations for the TRS-80 Model 100 and Tandy 102 appear to be identical. The NEC PC-8201/8300 format is not the same, but should be similar.&lt;br /&gt;
&lt;br /&gt;
== Tokens ==&lt;br /&gt;
&lt;br /&gt;
Table of tokenized BASIC keywords.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! title=&amp;quot;Hexadecimal code point&amp;quot; | Hex&lt;br /&gt;
! title=&amp;quot;Decimal code point&amp;quot; | Dec&lt;br /&gt;
! title=&amp;quot;BASIC element the token stands for&amp;quot; | Token meaning &lt;br /&gt;
! title=&amp;quot;Miscellany&amp;quot; | Notes&lt;br /&gt;
|-&lt;br /&gt;
|-&lt;br /&gt;
|80||128||END&lt;br /&gt;
|-&lt;br /&gt;
|81||129||FOR&lt;br /&gt;
|-&lt;br /&gt;
|82||130||NEXT&lt;br /&gt;
|-&lt;br /&gt;
|83||131||DATA&lt;br /&gt;
|-&lt;br /&gt;
|84||132||INPUT&lt;br /&gt;
|-&lt;br /&gt;
|85||133||DIM&lt;br /&gt;
|-&lt;br /&gt;
|86||134||READ&lt;br /&gt;
|-&lt;br /&gt;
|87||135||LET&lt;br /&gt;
|-&lt;br /&gt;
|88||136||GOTO&lt;br /&gt;
|-&lt;br /&gt;
|89||137||RUN&lt;br /&gt;
|-&lt;br /&gt;
|8A||138||IF&lt;br /&gt;
|-&lt;br /&gt;
|8B||139||RESTORE&lt;br /&gt;
|-&lt;br /&gt;
|8C||140||GOSUB&lt;br /&gt;
|-&lt;br /&gt;
|8D||141||RETURN&lt;br /&gt;
|-&lt;br /&gt;
|8E||142||REM&lt;br /&gt;
|-&lt;br /&gt;
|8F||143||STOP&lt;br /&gt;
|-&lt;br /&gt;
|90||144||WIDTH&lt;br /&gt;
|-&lt;br /&gt;
|91||145||ELSE||When tokenizing, the Tandy 200 always adds a colon (':') before the ELSE token (3A 91). If the user actually writes :ELSE it is tokenized as 3A 3A 91.&lt;br /&gt;
|-&lt;br /&gt;
|92||146||LINE&lt;br /&gt;
|-&lt;br /&gt;
|93||147||EDIT&lt;br /&gt;
|-&lt;br /&gt;
|94||148||ERROR&lt;br /&gt;
|-&lt;br /&gt;
|95||149||RESUME&lt;br /&gt;
|-&lt;br /&gt;
|96||150||OUT&lt;br /&gt;
|-&lt;br /&gt;
|97||151||ON&lt;br /&gt;
|-&lt;br /&gt;
|98||152||DSKO$&lt;br /&gt;
|-&lt;br /&gt;
|99||153||OPEN&lt;br /&gt;
|-&lt;br /&gt;
|9A||154||CLOSE&lt;br /&gt;
|-&lt;br /&gt;
|9B||155||LOAD||Note that LOADM is simply the token for LOAD followed by an ASCII 'M'. &lt;br /&gt;
|-&lt;br /&gt;
|9C||156||MERGE&lt;br /&gt;
|-QUOTE&lt;br /&gt;
|9D||157||FILES&lt;br /&gt;
|-&lt;br /&gt;
|9E||158||SAVE&lt;br /&gt;
|-&lt;br /&gt;
|9F||159||LFILES&lt;br /&gt;
|-&lt;br /&gt;
|A0||160||LPRINT&lt;br /&gt;
|-&lt;br /&gt;
|A1||161||DEF&lt;br /&gt;
|-&lt;br /&gt;
|A2||162||POKE&lt;br /&gt;
|-&lt;br /&gt;
|A3||163||PRINT&lt;br /&gt;
|-&lt;br /&gt;
|A4||164||CONT&lt;br /&gt;
|-&lt;br /&gt;
|A5||165||LIST&lt;br /&gt;
|-&lt;br /&gt;
|A6||166||LLIST&lt;br /&gt;
|-&lt;br /&gt;
|A7||167||CLEAR&lt;br /&gt;
|-&lt;br /&gt;
|A8||168||CLOAD&lt;br /&gt;
|-&lt;br /&gt;
|A9||169||CSAVE&lt;br /&gt;
|-&lt;br /&gt;
|AA||170||TIME$&lt;br /&gt;
|-&lt;br /&gt;
|AB||171||DATE$&lt;br /&gt;
|-&lt;br /&gt;
|AC||172||DAY$&lt;br /&gt;
|-&lt;br /&gt;
|AD||173||COM&lt;br /&gt;
|-&lt;br /&gt;
|AE||174||MDM&lt;br /&gt;
|-&lt;br /&gt;
|AF||175||KEY&lt;br /&gt;
|-&lt;br /&gt;
|B0||176||CLS&lt;br /&gt;
|-&lt;br /&gt;
|B1||177||BEEP&lt;br /&gt;
|-&lt;br /&gt;
|B2||178||SOUND&lt;br /&gt;
|-&lt;br /&gt;
|B3||179||LCOPY&lt;br /&gt;
|-&lt;br /&gt;
|B4||180||PSET&lt;br /&gt;
|-&lt;br /&gt;
|B5||181||PRESET&lt;br /&gt;
|-&lt;br /&gt;
|B6||182||MOTOR&lt;br /&gt;
|-&lt;br /&gt;
|B7||183||MAX&lt;br /&gt;
|-&lt;br /&gt;
|B8||184||POWER&lt;br /&gt;
|-&lt;br /&gt;
|B9||185||CALL&lt;br /&gt;
|-&lt;br /&gt;
|BA||186||MENU&lt;br /&gt;
|-&lt;br /&gt;
|BB||187||IPL&lt;br /&gt;
|-&lt;br /&gt;
|BC||188||NAME&lt;br /&gt;
|-&lt;br /&gt;
|BD||189||KILL&lt;br /&gt;
|-&lt;br /&gt;
|BE||190||SCREEN&lt;br /&gt;
|-&lt;br /&gt;
|BF||191||NEW&lt;br /&gt;
|-&lt;br /&gt;
|C0||192||TAB(&lt;br /&gt;
|-&lt;br /&gt;
|C1||193||TO&lt;br /&gt;
|-&lt;br /&gt;
|C2||194||USING&lt;br /&gt;
|-&lt;br /&gt;
|C3||195||VARPTR&lt;br /&gt;
|-&lt;br /&gt;
|C4||196||ERL&lt;br /&gt;
|-&lt;br /&gt;
|C5||197||ERR&lt;br /&gt;
|-&lt;br /&gt;
|C6||198||STRING$&lt;br /&gt;
|-&lt;br /&gt;
|C7||199||INSTR&lt;br /&gt;
|-&lt;br /&gt;
|C8||200||DSKI$&lt;br /&gt;
|-&lt;br /&gt;
|C9||201||INKEY$&lt;br /&gt;
|-&lt;br /&gt;
|CA||202||CSRLIN&lt;br /&gt;
|-&lt;br /&gt;
|CB||203||OFF&lt;br /&gt;
|-&lt;br /&gt;
|CC||204||HIMEM&lt;br /&gt;
|-&lt;br /&gt;
|CD||205||THEN&lt;br /&gt;
|-&lt;br /&gt;
|CE||206||NOT&lt;br /&gt;
|-&lt;br /&gt;
|CF||207||STEP&lt;br /&gt;
|-&lt;br /&gt;
|D0||208||+&lt;br /&gt;
|-&lt;br /&gt;
|D1||209||-&lt;br /&gt;
|-&lt;br /&gt;
|D2||210||*&lt;br /&gt;
|-&lt;br /&gt;
|D3||211||/&lt;br /&gt;
|-&lt;br /&gt;
|D4||212||^&lt;br /&gt;
|-&lt;br /&gt;
|D5||213||AND&lt;br /&gt;
|-&lt;br /&gt;
|D6||214||OR&lt;br /&gt;
|-&lt;br /&gt;
|D7||215||XOR&lt;br /&gt;
|-&lt;br /&gt;
|D8||216||EQV&lt;br /&gt;
|-&lt;br /&gt;
|D9||217||IMP&lt;br /&gt;
|-&lt;br /&gt;
|DA||218||MOD&lt;br /&gt;
|-&lt;br /&gt;
|DB||219||\&lt;br /&gt;
|-&lt;br /&gt;
|DC||220||&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|DD||221||=&lt;br /&gt;
|-&lt;br /&gt;
|DE||222||&amp;lt;&lt;br /&gt;
|-&lt;br /&gt;
|DF||223||SGN&lt;br /&gt;
|-&lt;br /&gt;
|E0||224||INT&lt;br /&gt;
|-&lt;br /&gt;
|E1||225||ABS&lt;br /&gt;
|-&lt;br /&gt;
|E2||226||FRE&lt;br /&gt;
|-&lt;br /&gt;
|E3||227||INP&lt;br /&gt;
|-&lt;br /&gt;
|E4||228||LPOS&lt;br /&gt;
|-&lt;br /&gt;
|E5||229||POS&lt;br /&gt;
|-&lt;br /&gt;
|E6||230||SQR&lt;br /&gt;
|-&lt;br /&gt;
|E7||231||RND&lt;br /&gt;
|-&lt;br /&gt;
|E8||232||LOG&lt;br /&gt;
|-&lt;br /&gt;
|E9||233||EXP&lt;br /&gt;
|-&lt;br /&gt;
|EA||234||COS&lt;br /&gt;
|-&lt;br /&gt;
|EB||235||SIN&lt;br /&gt;
|-&lt;br /&gt;
|EC||236||TAN&lt;br /&gt;
|-&lt;br /&gt;
|ED||237||ATN&lt;br /&gt;
|-&lt;br /&gt;
|EE||238||PEEK&lt;br /&gt;
|-&lt;br /&gt;
|EF||239||EOF&lt;br /&gt;
|-&lt;br /&gt;
|F0||240||LOC&lt;br /&gt;
|-&lt;br /&gt;
|F1||241||LOF&lt;br /&gt;
|-&lt;br /&gt;
|F2||242||CINT&lt;br /&gt;
|-&lt;br /&gt;
|F3||243||CSNG&lt;br /&gt;
|-&lt;br /&gt;
|F4||244||CDBL&lt;br /&gt;
|-&lt;br /&gt;
|F5||245||FIX&lt;br /&gt;
|-&lt;br /&gt;
|F6||246||LEN&lt;br /&gt;
|-&lt;br /&gt;
|F7||247||STR$&lt;br /&gt;
|-&lt;br /&gt;
|F8||248||VAL&lt;br /&gt;
|-&lt;br /&gt;
|F9||249||ASC&lt;br /&gt;
|-&lt;br /&gt;
|FA||250||CHR$&lt;br /&gt;
|-&lt;br /&gt;
|FB||251||SPACE$&lt;br /&gt;
|-&lt;br /&gt;
|FC||252||LEFT$&lt;br /&gt;
|-&lt;br /&gt;
|FD||253||RIGHT$&lt;br /&gt;
|-&lt;br /&gt;
|FE||254||MID$&lt;br /&gt;
|-&lt;br /&gt;
|FF||255||' (QUOTE) || When tokenizing, the single quote character expands to three characters: a colon (3A), the byte for REM (8E), and then FF.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== File Format ==&lt;br /&gt;
&lt;br /&gt;
Tokenised BASIC code is a sequence of tokenized lines. Each tokenized line has the following format:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!Name!!Length!!Description&lt;br /&gt;
|-&lt;br /&gt;
|PL PH&lt;br /&gt;
|2 bytes&lt;br /&gt;
|Address of the next line in memory, little endian. This data can be ignored as it is only a placeholder. The value of PL PH in a file is moot because the address is recalculated every time the program loads. Once in memory, PL PH is used to skip to the line required for GOTO, GOSUB, and READ, thus speeding up the program. &lt;br /&gt;
|-&lt;br /&gt;
|LL LH&lt;br /&gt;
|2 bytes&lt;br /&gt;
|Line number, little endian.&lt;br /&gt;
|-&lt;br /&gt;
|B0 … BN&lt;br /&gt;
|Any number&lt;br /&gt;
|Sequence of tokens or ASCII characters. If a character's value is ≥ 128, then it is a token. All tokens are a single byte. &lt;br /&gt;
|-&lt;br /&gt;
|NULL&lt;br /&gt;
|1 byte&lt;br /&gt;
|NULL byte (`0x00`) to signal end of line. &lt;br /&gt;
|}&lt;br /&gt;
              &lt;br /&gt;
&lt;br /&gt;
=== Limits ===&lt;br /&gt;
&lt;br /&gt;
* Line numbers can range from 0 to 65529 (but see variances below).&lt;br /&gt;
* Tokenized line length is limited to 256 characters, including the trailing NULL byte. (To do: double check this.)&lt;br /&gt;
&lt;br /&gt;
=== Acceptable variances ===&lt;br /&gt;
&lt;br /&gt;
While Tandy BASIC will never generate such files, it has no problem with a tokenized program that:&lt;br /&gt;
&lt;br /&gt;
* Has line numbers out of order; they will be sorted when loaded.&lt;br /&gt;
* Contains duplicate line numbers; previous line is discarded.&lt;br /&gt;
* Contains arbitrary bytes for PL PH; they are always regenerated during loading.&lt;br /&gt;
* Has a ^Z (ASCII 26) at the end of the file.&lt;br /&gt;
* Contains illegal line numbers; this can be used to store hidden binary data [https://www.mail-archive.com/m100@lists.bitchin100.com/msg16195.html according to John R. Hogerhuis].&lt;br /&gt;
&lt;br /&gt;
Note that while these variances are accepted on an actual Model T device (Model 100, Tandy 200, or Tandy 102), emulators may not be able to handle such files. For example, the [https://sourceforge.net/projects/virtualt/ Virtual T] emulator (as of version 1.7 in 2022) refuses to load tokenized BASIC programs that have lines out of order, duplicate lines, or bogus values for PL PH. &lt;br /&gt;
&lt;br /&gt;
=== Details for PL PH ===&lt;br /&gt;
&lt;br /&gt;
(Stub. This is where the correct calculation of PL PH values will go.)&lt;br /&gt;
&lt;br /&gt;
== Format documentation ==&lt;br /&gt;
&lt;br /&gt;
* [https://m100.bitchin100.narkive.com/eP2uSl4J/tokenized-basic-programs-bytes-of-mystery Discussion of byte format on Bitchin 100 Mailing List]&lt;br /&gt;
* [http://www.club100.org/library/ups/tokens.do BASIC program to create a table of tokens]&lt;br /&gt;
* [https://archive.org/details/HiddenPowersOfTheTrs80Model100/page/n229/mode/2up?view=theater Hidden Powers of the TRS 80 Model 100]. Appendix B lists the BASIC token values for the Model 100 which matches what hackerb9 found programmatically for the Tandy 200.&lt;br /&gt;
* [http://web.archive.org/web/20220324135218/https://help.ayra.ch/trs80-reference#trs-80-model-100-basic-reference Ayra Model 100 BASIC Reference]&lt;br /&gt;
&lt;br /&gt;
== Other links ==&lt;br /&gt;
&lt;br /&gt;
* [https://github.com/hackerb9/tokenize/ Hackerb9's simple program for tokenizing BASIC code]&lt;br /&gt;
* [https://sourceforge.net/projects/virtualt/ A Tandy 200 &amp;amp; Model 100/102 emulator]&lt;br /&gt;
* [http://bitchin100.com/CloudT/ A TRS-80 Model 100 emulator that runs in a web browser]&lt;br /&gt;
&lt;br /&gt;
[[Category:Microsoft]]&lt;/div&gt;</summary>
		<author><name>Hackerb9</name></author>	</entry>

	<entry>
		<id>http://fileformats.archiveteam.org/wiki/Tandy_200_BASIC_tokenized_file</id>
		<title>Tandy 200 BASIC tokenized file</title>
		<link rel="alternate" type="text/html" href="http://fileformats.archiveteam.org/wiki/Tandy_200_BASIC_tokenized_file"/>
				<updated>2022-10-05T20:01:48Z</updated>
		
		<summary type="html">&lt;p&gt;Hackerb9: /* Tokens */ Actually, the problem was the final pipe symbol confused wiki table. Hopefully this fixes it.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{FormatInfo&lt;br /&gt;
|subcat=Source code&lt;br /&gt;
|subcat2=Tokenized BASIC&lt;br /&gt;
|released=1984&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
'''Tandy 200 BASIC''' was a version of Microsoft BASIC for the Radio Shack Tandy 200 computer. The tokenizations for the TRS-80 Model 100 and Tandy 102 appear to be identical. The NEC PC-8201/8300 format is not the same, but should be similar.&lt;br /&gt;
&lt;br /&gt;
== Tokens ==&lt;br /&gt;
&lt;br /&gt;
Blank values indicate either that the token is unused or is used for something unknown.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! title=&amp;quot;Hexadecimal code point&amp;quot; | Hex&lt;br /&gt;
! title=&amp;quot;Decimal code point&amp;quot; | Dec&lt;br /&gt;
! title=&amp;quot;BASIC element the token stands for&amp;quot; | Token meaning &lt;br /&gt;
! title=&amp;quot;Miscellany&amp;quot; | Notes&lt;br /&gt;
|-&lt;br /&gt;
|-&lt;br /&gt;
|80||128||END&lt;br /&gt;
|-&lt;br /&gt;
|81||129||FOR&lt;br /&gt;
|-&lt;br /&gt;
|82||130||NEXT&lt;br /&gt;
|-&lt;br /&gt;
|83||131||DATA&lt;br /&gt;
|-&lt;br /&gt;
|84||132||INPUT&lt;br /&gt;
|-&lt;br /&gt;
|85||133||DIM&lt;br /&gt;
|-&lt;br /&gt;
|86||134||READ&lt;br /&gt;
|-&lt;br /&gt;
|87||135||LET&lt;br /&gt;
|-&lt;br /&gt;
|88||136||GOTO&lt;br /&gt;
|-&lt;br /&gt;
|89||137||RUN&lt;br /&gt;
|-&lt;br /&gt;
|8A||138||IF&lt;br /&gt;
|-&lt;br /&gt;
|8B||139||RESTORE&lt;br /&gt;
|-&lt;br /&gt;
|8C||140||GOSUB&lt;br /&gt;
|-&lt;br /&gt;
|8D||141||RETURN&lt;br /&gt;
|-&lt;br /&gt;
|8E||142||REM&lt;br /&gt;
|-&lt;br /&gt;
|8F||143||STOP&lt;br /&gt;
|-&lt;br /&gt;
|90||144||WIDTH&lt;br /&gt;
|-&lt;br /&gt;
|91||145||ELSE||When tokenizing, the Tandy 200 always adds a colon (':') before the ELSE token (3A 91). If the user actually writes :ELSE it is tokenized as 3A 3A 91.&lt;br /&gt;
|-&lt;br /&gt;
|92||146||LINE&lt;br /&gt;
|-&lt;br /&gt;
|93||147||EDIT&lt;br /&gt;
|-&lt;br /&gt;
|94||148||ERROR&lt;br /&gt;
|-&lt;br /&gt;
|95||149||RESUME&lt;br /&gt;
|-&lt;br /&gt;
|96||150||OUT&lt;br /&gt;
|-&lt;br /&gt;
|97||151||ON&lt;br /&gt;
|-&lt;br /&gt;
|98||152||DSKO$&lt;br /&gt;
|-&lt;br /&gt;
|99||153||OPEN&lt;br /&gt;
|-&lt;br /&gt;
|9A||154||CLOSE&lt;br /&gt;
|-&lt;br /&gt;
|9B||155||LOAD||Note that LOADM is simply the token for LOAD followed by an ASCII 'M'. &lt;br /&gt;
|-&lt;br /&gt;
|9C||156||MERGE&lt;br /&gt;
|-QUOTE&lt;br /&gt;
|9D||157||FILES&lt;br /&gt;
|-&lt;br /&gt;
|9E||158||SAVE&lt;br /&gt;
|-&lt;br /&gt;
|9F||159||LFILES&lt;br /&gt;
|-&lt;br /&gt;
|A0||160||LPRINT&lt;br /&gt;
|-&lt;br /&gt;
|A1||161||DEF&lt;br /&gt;
|-&lt;br /&gt;
|A2||162||POKE&lt;br /&gt;
|-&lt;br /&gt;
|A3||163||PRINT&lt;br /&gt;
|-&lt;br /&gt;
|A4||164||CONT&lt;br /&gt;
|-&lt;br /&gt;
|A5||165||LIST&lt;br /&gt;
|-&lt;br /&gt;
|A6||166||LLIST&lt;br /&gt;
|-&lt;br /&gt;
|A7||167||CLEAR&lt;br /&gt;
|-&lt;br /&gt;
|A8||168||CLOAD&lt;br /&gt;
|-&lt;br /&gt;
|A9||169||CSAVE&lt;br /&gt;
|-&lt;br /&gt;
|AA||170||TIME$&lt;br /&gt;
|-&lt;br /&gt;
|AB||171||DATE$&lt;br /&gt;
|-&lt;br /&gt;
|AC||172||DAY$&lt;br /&gt;
|-&lt;br /&gt;
|AD||173||COM&lt;br /&gt;
|-&lt;br /&gt;
|AE||174||MDM&lt;br /&gt;
|-&lt;br /&gt;
|AF||175||KEY&lt;br /&gt;
|-&lt;br /&gt;
|B0||176||CLS&lt;br /&gt;
|-&lt;br /&gt;
|B1||177||BEEP&lt;br /&gt;
|-&lt;br /&gt;
|B2||178||SOUND&lt;br /&gt;
|-&lt;br /&gt;
|B3||179||LCOPY&lt;br /&gt;
|-&lt;br /&gt;
|B4||180||PSET&lt;br /&gt;
|-&lt;br /&gt;
|B5||181||PRESET&lt;br /&gt;
|-&lt;br /&gt;
|B6||182||MOTOR&lt;br /&gt;
|-&lt;br /&gt;
|B7||183||MAX&lt;br /&gt;
|-&lt;br /&gt;
|B8||184||POWER&lt;br /&gt;
|-&lt;br /&gt;
|B9||185||CALL&lt;br /&gt;
|-&lt;br /&gt;
|BA||186||MENU&lt;br /&gt;
|-&lt;br /&gt;
|BB||187||IPL&lt;br /&gt;
|-&lt;br /&gt;
|BC||188||NAME&lt;br /&gt;
|-&lt;br /&gt;
|BD||189||KILL&lt;br /&gt;
|-&lt;br /&gt;
|BE||190||SCREEN&lt;br /&gt;
|-&lt;br /&gt;
|BF||191||NEW&lt;br /&gt;
|-&lt;br /&gt;
|C0||192||TAB(&lt;br /&gt;
|-&lt;br /&gt;
|C1||193||TO&lt;br /&gt;
|-&lt;br /&gt;
|C2||194||USING&lt;br /&gt;
|-&lt;br /&gt;
|C3||195||VARPTR&lt;br /&gt;
|-&lt;br /&gt;
|C4||196||ERL&lt;br /&gt;
|-&lt;br /&gt;
|C5||197||ERR&lt;br /&gt;
|-&lt;br /&gt;
|C6||198||STRING$&lt;br /&gt;
|-&lt;br /&gt;
|C7||199||INSTR&lt;br /&gt;
|-&lt;br /&gt;
|C8||200||DSKI$&lt;br /&gt;
|-&lt;br /&gt;
|C9||201||INKEY$&lt;br /&gt;
|-&lt;br /&gt;
|CA||202||CSRLIN&lt;br /&gt;
|-&lt;br /&gt;
|CB||203||OFF&lt;br /&gt;
|-&lt;br /&gt;
|CC||204||HIMEM&lt;br /&gt;
|-&lt;br /&gt;
|CD||205||THEN&lt;br /&gt;
|-&lt;br /&gt;
|CE||206||NOT&lt;br /&gt;
|-&lt;br /&gt;
|CF||207||STEP&lt;br /&gt;
|-&lt;br /&gt;
|D0||208||+&lt;br /&gt;
|-&lt;br /&gt;
|D1||209||-&lt;br /&gt;
|-&lt;br /&gt;
|D2||210||*&lt;br /&gt;
|-&lt;br /&gt;
|D3||211||/&lt;br /&gt;
|-&lt;br /&gt;
|D4||212||^&lt;br /&gt;
|-&lt;br /&gt;
|D5||213||AND&lt;br /&gt;
|-&lt;br /&gt;
|D6||214||OR&lt;br /&gt;
|-&lt;br /&gt;
|D7||215||XOR&lt;br /&gt;
|-&lt;br /&gt;
|D8||216||EQV&lt;br /&gt;
|-&lt;br /&gt;
|D9||217||IMP&lt;br /&gt;
|-&lt;br /&gt;
|DA||218||MOD&lt;br /&gt;
|-&lt;br /&gt;
|DB||219||\&lt;br /&gt;
|-&lt;br /&gt;
|DC||220||&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|DD||221||=&lt;br /&gt;
|-&lt;br /&gt;
|DE||222||&amp;lt;&lt;br /&gt;
|-&lt;br /&gt;
|DF||223||SGN&lt;br /&gt;
|-&lt;br /&gt;
|E0||224||INT&lt;br /&gt;
|-&lt;br /&gt;
|E1||225||ABS&lt;br /&gt;
|-&lt;br /&gt;
|E2||226||FRE&lt;br /&gt;
|-&lt;br /&gt;
|E3||227||INP&lt;br /&gt;
|-&lt;br /&gt;
|E4||228||LPOS&lt;br /&gt;
|-&lt;br /&gt;
|E5||229||POS&lt;br /&gt;
|-&lt;br /&gt;
|E6||230||SQR&lt;br /&gt;
|-&lt;br /&gt;
|E7||231||RND&lt;br /&gt;
|-&lt;br /&gt;
|E8||232||LOG&lt;br /&gt;
|-&lt;br /&gt;
|E9||233||EXP&lt;br /&gt;
|-&lt;br /&gt;
|EA||234||COS&lt;br /&gt;
|-&lt;br /&gt;
|EB||235||SIN&lt;br /&gt;
|-&lt;br /&gt;
|EC||236||TAN&lt;br /&gt;
|-&lt;br /&gt;
|ED||237||ATN&lt;br /&gt;
|-&lt;br /&gt;
|EE||238||PEEK&lt;br /&gt;
|-&lt;br /&gt;
|EF||239||EOF&lt;br /&gt;
|-&lt;br /&gt;
|F0||240||LOC&lt;br /&gt;
|-&lt;br /&gt;
|F1||241||LOF&lt;br /&gt;
|-&lt;br /&gt;
|F2||242||CINT&lt;br /&gt;
|-&lt;br /&gt;
|F3||243||CSNG&lt;br /&gt;
|-&lt;br /&gt;
|F4||244||CDBL&lt;br /&gt;
|-&lt;br /&gt;
|F5||245||FIX&lt;br /&gt;
|-&lt;br /&gt;
|F6||246||LEN&lt;br /&gt;
|-&lt;br /&gt;
|F7||247||STR$&lt;br /&gt;
|-&lt;br /&gt;
|F8||248||VAL&lt;br /&gt;
|-&lt;br /&gt;
|F9||249||ASC&lt;br /&gt;
|-&lt;br /&gt;
|FA||250||CHR$&lt;br /&gt;
|-&lt;br /&gt;
|FB||251||SPACE$&lt;br /&gt;
|-&lt;br /&gt;
|FC||252||LEFT$&lt;br /&gt;
|-&lt;br /&gt;
|FD||253||RIGHT$&lt;br /&gt;
|-&lt;br /&gt;
|FE||254||MID$&lt;br /&gt;
|-&lt;br /&gt;
|FF||255||' (QUOTE) || When tokenizing, the single quote character expands to three characters: a colon (3A), the byte for REM (8E), and then FF.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== File Format ==&lt;br /&gt;
&lt;br /&gt;
Tokenised BASIC code is a sequence of tokenized lines. Each tokenized line has the following format:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!Name!!Length!!Description&lt;br /&gt;
|-&lt;br /&gt;
|PL PH&lt;br /&gt;
|2 bytes&lt;br /&gt;
|Address of the next line in memory, little endian. This data can be ignored as it is only a placeholder. The value of PL PH in a file is moot because the address is recalculated every time the program loads. Once in memory, PL PH is used to skip to the line required for GOTO, GOSUB, and READ, thus speeding up the program. &lt;br /&gt;
|-&lt;br /&gt;
|LL LH&lt;br /&gt;
|2 bytes&lt;br /&gt;
|Line number, little endian.&lt;br /&gt;
|-&lt;br /&gt;
|B0 … BN&lt;br /&gt;
|Any number&lt;br /&gt;
|Sequence of tokens or ASCII characters. If a character's value is ≥ 128, then it is a token. All tokens are a single byte. &lt;br /&gt;
|-&lt;br /&gt;
|NULL&lt;br /&gt;
|1 byte&lt;br /&gt;
|NULL byte (`0x00`) to signal end of line. &lt;br /&gt;
|}&lt;br /&gt;
              &lt;br /&gt;
&lt;br /&gt;
=== Limits ===&lt;br /&gt;
&lt;br /&gt;
* Line numbers can range from 0 to 65529 (but see variances below).&lt;br /&gt;
* Tokenized line length is limited to 256 characters, including the trailing NULL byte. (To do: double check this.)&lt;br /&gt;
&lt;br /&gt;
=== Acceptable variances ===&lt;br /&gt;
&lt;br /&gt;
While Tandy BASIC will never generate such files, it has no problem with a tokenized program that:&lt;br /&gt;
&lt;br /&gt;
* Has line numbers out of order; they will be sorted when loaded.&lt;br /&gt;
* Contains duplicate line numbers; previous line is discarded.&lt;br /&gt;
* Contains arbitrary bytes for PL PH; they are always regenerated during loading.&lt;br /&gt;
* Has a ^Z (ASCII 26) at the end of the file.&lt;br /&gt;
* Contains illegal line numbers; this can be used to store hidden binary data [https://www.mail-archive.com/m100@lists.bitchin100.com/msg16195.html according to John R. Hogerhuis].&lt;br /&gt;
&lt;br /&gt;
Note that while these variances are accepted on an actual Model T device (Model 100, Tandy 200, or Tandy 102), emulators may not be able to handle such files. For example, the [https://sourceforge.net/projects/virtualt/ Virtual T] emulator (as of version 1.7 in 2022) refuses to load tokenized BASIC programs that have lines out of order, duplicate lines, or bogus values for PL PH. &lt;br /&gt;
&lt;br /&gt;
=== Details for PL PH ===&lt;br /&gt;
&lt;br /&gt;
(Stub. This is where the correct calculation of PL PH values will go.)&lt;br /&gt;
&lt;br /&gt;
== Format documentation ==&lt;br /&gt;
&lt;br /&gt;
* [https://m100.bitchin100.narkive.com/eP2uSl4J/tokenized-basic-programs-bytes-of-mystery Discussion of byte format on Bitchin 100 Mailing List]&lt;br /&gt;
* [http://www.club100.org/library/ups/tokens.do BASIC program to create a table of tokens]&lt;br /&gt;
* [https://archive.org/details/HiddenPowersOfTheTrs80Model100/page/n229/mode/2up?view=theater Hidden Powers of the TRS 80 Model 100]. Appendix B lists the BASIC token values for the Model 100 which matches what hackerb9 found programmatically for the Tandy 200.&lt;br /&gt;
* [http://web.archive.org/web/20220324135218/https://help.ayra.ch/trs80-reference#trs-80-model-100-basic-reference Ayra Model 100 BASIC Reference]&lt;br /&gt;
&lt;br /&gt;
== Other links ==&lt;br /&gt;
&lt;br /&gt;
* [https://github.com/hackerb9/tokenize/ Hackerb9's simple program for tokenizing BASIC code]&lt;br /&gt;
* [https://sourceforge.net/projects/virtualt/ A Tandy 200 &amp;amp; Model 100/102 emulator]&lt;br /&gt;
* [http://bitchin100.com/CloudT/ A TRS-80 Model 100 emulator that runs in a web browser]&lt;br /&gt;
&lt;br /&gt;
[[Category:Microsoft]]&lt;/div&gt;</summary>
		<author><name>Hackerb9</name></author>	</entry>

	<entry>
		<id>http://fileformats.archiveteam.org/wiki/Tandy_200_BASIC_tokenized_file</id>
		<title>Tandy 200 BASIC tokenized file</title>
		<link rel="alternate" type="text/html" href="http://fileformats.archiveteam.org/wiki/Tandy_200_BASIC_tokenized_file"/>
				<updated>2022-10-05T19:57:34Z</updated>
		
		<summary type="html">&lt;p&gt;Hackerb9: /* Tokens */ Replace&amp;quot; \&amp;lt;&amp;quot; with &amp;quot;&amp;amp;lt;&amp;quot; as it is resilient to repeated wiki editing&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{FormatInfo&lt;br /&gt;
|subcat=Source code&lt;br /&gt;
|subcat2=Tokenized BASIC&lt;br /&gt;
|released=1984&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
'''Tandy 200 BASIC''' was a version of Microsoft BASIC for the Radio Shack Tandy 200 computer. The tokenizations for the TRS-80 Model 100 and Tandy 102 appear to be identical. The NEC PC-8201/8300 format is not the same, but should be similar.&lt;br /&gt;
&lt;br /&gt;
== Tokens ==&lt;br /&gt;
&lt;br /&gt;
Blank values indicate either that the token is unused or is used for something unknown.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! title=&amp;quot;Hexadecimal code point&amp;quot; | Hex&lt;br /&gt;
! title=&amp;quot;Decimal code point&amp;quot; | Dec&lt;br /&gt;
! title=&amp;quot;BASIC element the token stands for&amp;quot; | Token meaning &lt;br /&gt;
! title=&amp;quot;Miscellany&amp;quot; | Notes&lt;br /&gt;
|-&lt;br /&gt;
|-&lt;br /&gt;
|80||128||END&lt;br /&gt;
|-&lt;br /&gt;
|81||129||FOR&lt;br /&gt;
|-&lt;br /&gt;
|82||130||NEXT&lt;br /&gt;
|-&lt;br /&gt;
|83||131||DATA&lt;br /&gt;
|-&lt;br /&gt;
|84||132||INPUT&lt;br /&gt;
|-&lt;br /&gt;
|85||133||DIM&lt;br /&gt;
|-&lt;br /&gt;
|86||134||READ&lt;br /&gt;
|-&lt;br /&gt;
|87||135||LET&lt;br /&gt;
|-&lt;br /&gt;
|88||136||GOTO&lt;br /&gt;
|-&lt;br /&gt;
|89||137||RUN&lt;br /&gt;
|-&lt;br /&gt;
|8A||138||IF&lt;br /&gt;
|-&lt;br /&gt;
|8B||139||RESTORE&lt;br /&gt;
|-&lt;br /&gt;
|8C||140||GOSUB&lt;br /&gt;
|-&lt;br /&gt;
|8D||141||RETURN&lt;br /&gt;
|-&lt;br /&gt;
|8E||142||REM&lt;br /&gt;
|-&lt;br /&gt;
|8F||143||STOP&lt;br /&gt;
|-&lt;br /&gt;
|90||144||WIDTH&lt;br /&gt;
|-&lt;br /&gt;
|91||145||ELSE||When tokenizing, the Tandy 200 always adds a colon (':') before the ELSE token (3A 91). If the user actually writes :ELSE it is tokenized as 3A 3A 91.&lt;br /&gt;
|-&lt;br /&gt;
|92||146||LINE&lt;br /&gt;
|-&lt;br /&gt;
|93||147||EDIT&lt;br /&gt;
|-&lt;br /&gt;
|94||148||ERROR&lt;br /&gt;
|-&lt;br /&gt;
|95||149||RESUME&lt;br /&gt;
|-&lt;br /&gt;
|96||150||OUT&lt;br /&gt;
|-&lt;br /&gt;
|97||151||ON&lt;br /&gt;
|-&lt;br /&gt;
|98||152||DSKO$&lt;br /&gt;
|-&lt;br /&gt;
|99||153||OPEN&lt;br /&gt;
|-&lt;br /&gt;
|9A||154||CLOSE&lt;br /&gt;
|-&lt;br /&gt;
|9B||155||LOAD||Note that LOADM is simply the token for LOAD followed by an ASCII 'M'. &lt;br /&gt;
|-&lt;br /&gt;
|9C||156||MERGE&lt;br /&gt;
|-QUOTE&lt;br /&gt;
|9D||157||FILES&lt;br /&gt;
|-&lt;br /&gt;
|9E||158||SAVE&lt;br /&gt;
|-&lt;br /&gt;
|9F||159||LFILES&lt;br /&gt;
|-&lt;br /&gt;
|A0||160||LPRINT&lt;br /&gt;
|-&lt;br /&gt;
|A1||161||DEF&lt;br /&gt;
|-&lt;br /&gt;
|A2||162||POKE&lt;br /&gt;
|-&lt;br /&gt;
|A3||163||PRINT&lt;br /&gt;
|-&lt;br /&gt;
|A4||164||CONT&lt;br /&gt;
|-&lt;br /&gt;
|A5||165||LIST&lt;br /&gt;
|-&lt;br /&gt;
|A6||166||LLIST&lt;br /&gt;
|-&lt;br /&gt;
|A7||167||CLEAR&lt;br /&gt;
|-&lt;br /&gt;
|A8||168||CLOAD&lt;br /&gt;
|-&lt;br /&gt;
|A9||169||CSAVE&lt;br /&gt;
|-&lt;br /&gt;
|AA||170||TIME$&lt;br /&gt;
|-&lt;br /&gt;
|AB||171||DATE$&lt;br /&gt;
|-&lt;br /&gt;
|AC||172||DAY$&lt;br /&gt;
|-&lt;br /&gt;
|AD||173||COM&lt;br /&gt;
|-&lt;br /&gt;
|AE||174||MDM&lt;br /&gt;
|-&lt;br /&gt;
|AF||175||KEY&lt;br /&gt;
|-&lt;br /&gt;
|B0||176||CLS&lt;br /&gt;
|-&lt;br /&gt;
|B1||177||BEEP&lt;br /&gt;
|-&lt;br /&gt;
|B2||178||SOUND&lt;br /&gt;
|-&lt;br /&gt;
|B3||179||LCOPY&lt;br /&gt;
|-&lt;br /&gt;
|B4||180||PSET&lt;br /&gt;
|-&lt;br /&gt;
|B5||181||PRESET&lt;br /&gt;
|-&lt;br /&gt;
|B6||182||MOTOR&lt;br /&gt;
|-&lt;br /&gt;
|B7||183||MAX&lt;br /&gt;
|-&lt;br /&gt;
|B8||184||POWER&lt;br /&gt;
|-&lt;br /&gt;
|B9||185||CALL&lt;br /&gt;
|-&lt;br /&gt;
|BA||186||MENU&lt;br /&gt;
|-&lt;br /&gt;
|BB||187||IPL&lt;br /&gt;
|-&lt;br /&gt;
|BC||188||NAME&lt;br /&gt;
|-&lt;br /&gt;
|BD||189||KILL&lt;br /&gt;
|-&lt;br /&gt;
|BE||190||SCREEN&lt;br /&gt;
|-&lt;br /&gt;
|BF||191||NEW&lt;br /&gt;
|-&lt;br /&gt;
|C0||192||TAB(&lt;br /&gt;
|-&lt;br /&gt;
|C1||193||TO&lt;br /&gt;
|-&lt;br /&gt;
|C2||194||USING&lt;br /&gt;
|-&lt;br /&gt;
|C3||195||VARPTR&lt;br /&gt;
|-&lt;br /&gt;
|C4||196||ERL&lt;br /&gt;
|-&lt;br /&gt;
|C5||197||ERR&lt;br /&gt;
|-&lt;br /&gt;
|C6||198||STRING$&lt;br /&gt;
|-&lt;br /&gt;
|C7||199||INSTR&lt;br /&gt;
|-&lt;br /&gt;
|C8||200||DSKI$&lt;br /&gt;
|-&lt;br /&gt;
|C9||201||INKEY$&lt;br /&gt;
|-&lt;br /&gt;
|CA||202||CSRLIN&lt;br /&gt;
|-&lt;br /&gt;
|CB||203||OFF&lt;br /&gt;
|-&lt;br /&gt;
|CC||204||HIMEM&lt;br /&gt;
|-&lt;br /&gt;
|CD||205||THEN&lt;br /&gt;
|-&lt;br /&gt;
|CE||206||NOT&lt;br /&gt;
|-&lt;br /&gt;
|CF||207||STEP&lt;br /&gt;
|-&lt;br /&gt;
|D0||208||+&lt;br /&gt;
|-&lt;br /&gt;
|D1||209||-&lt;br /&gt;
|-&lt;br /&gt;
|D2||210||*&lt;br /&gt;
|-&lt;br /&gt;
|D3||211||/&lt;br /&gt;
|-&lt;br /&gt;
|D4||212||^&lt;br /&gt;
|-&lt;br /&gt;
|D5||213||AND&lt;br /&gt;
|-&lt;br /&gt;
|D6||214||OR&lt;br /&gt;
|-&lt;br /&gt;
|D7||215||XOR&lt;br /&gt;
|-&lt;br /&gt;
|D8||216||EQV&lt;br /&gt;
|-&lt;br /&gt;
|D9||217||IMP&lt;br /&gt;
|-&lt;br /&gt;
|DA||218||MOD&lt;br /&gt;
|-&lt;br /&gt;
|DB||219||\&lt;br /&gt;
|-&lt;br /&gt;
|DC||220||&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|DD||221||=&lt;br /&gt;
|-&lt;br /&gt;
|DE||222||&amp;amp;lt;|&lt;br /&gt;
|-&lt;br /&gt;
|DF||223||SGN&lt;br /&gt;
|-&lt;br /&gt;
|E0||224||INT&lt;br /&gt;
|-&lt;br /&gt;
|E1||225||ABS&lt;br /&gt;
|-&lt;br /&gt;
|E2||226||FRE&lt;br /&gt;
|-&lt;br /&gt;
|E3||227||INP&lt;br /&gt;
|-&lt;br /&gt;
|E4||228||LPOS&lt;br /&gt;
|-&lt;br /&gt;
|E5||229||POS&lt;br /&gt;
|-&lt;br /&gt;
|E6||230||SQR&lt;br /&gt;
|-&lt;br /&gt;
|E7||231||RND&lt;br /&gt;
|-&lt;br /&gt;
|E8||232||LOG&lt;br /&gt;
|-&lt;br /&gt;
|E9||233||EXP&lt;br /&gt;
|-&lt;br /&gt;
|EA||234||COS&lt;br /&gt;
|-&lt;br /&gt;
|EB||235||SIN&lt;br /&gt;
|-&lt;br /&gt;
|EC||236||TAN&lt;br /&gt;
|-&lt;br /&gt;
|ED||237||ATN&lt;br /&gt;
|-&lt;br /&gt;
|EE||238||PEEK&lt;br /&gt;
|-&lt;br /&gt;
|EF||239||EOF&lt;br /&gt;
|-&lt;br /&gt;
|F0||240||LOC&lt;br /&gt;
|-&lt;br /&gt;
|F1||241||LOF&lt;br /&gt;
|-&lt;br /&gt;
|F2||242||CINT&lt;br /&gt;
|-&lt;br /&gt;
|F3||243||CSNG&lt;br /&gt;
|-&lt;br /&gt;
|F4||244||CDBL&lt;br /&gt;
|-&lt;br /&gt;
|F5||245||FIX&lt;br /&gt;
|-&lt;br /&gt;
|F6||246||LEN&lt;br /&gt;
|-&lt;br /&gt;
|F7||247||STR$&lt;br /&gt;
|-&lt;br /&gt;
|F8||248||VAL&lt;br /&gt;
|-&lt;br /&gt;
|F9||249||ASC&lt;br /&gt;
|-&lt;br /&gt;
|FA||250||CHR$&lt;br /&gt;
|-&lt;br /&gt;
|FB||251||SPACE$&lt;br /&gt;
|-&lt;br /&gt;
|FC||252||LEFT$&lt;br /&gt;
|-&lt;br /&gt;
|FD||253||RIGHT$&lt;br /&gt;
|-&lt;br /&gt;
|FE||254||MID$&lt;br /&gt;
|-&lt;br /&gt;
|FF||255||' (QUOTE) || When tokenizing, the single quote character expands to three characters: a colon (3A), the byte for REM (8E), and then FF.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== File Format ==&lt;br /&gt;
&lt;br /&gt;
Tokenised BASIC code is a sequence of tokenized lines. Each tokenized line has the following format:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!Name!!Length!!Description&lt;br /&gt;
|-&lt;br /&gt;
|PL PH&lt;br /&gt;
|2 bytes&lt;br /&gt;
|Address of the next line in memory, little endian. This data can be ignored as it is only a placeholder. The value of PL PH in a file is moot because the address is recalculated every time the program loads. Once in memory, PL PH is used to skip to the line required for GOTO, GOSUB, and READ, thus speeding up the program. &lt;br /&gt;
|-&lt;br /&gt;
|LL LH&lt;br /&gt;
|2 bytes&lt;br /&gt;
|Line number, little endian.&lt;br /&gt;
|-&lt;br /&gt;
|B0 … BN&lt;br /&gt;
|Any number&lt;br /&gt;
|Sequence of tokens or ASCII characters. If a character's value is ≥ 128, then it is a token. All tokens are a single byte. &lt;br /&gt;
|-&lt;br /&gt;
|NULL&lt;br /&gt;
|1 byte&lt;br /&gt;
|NULL byte (`0x00`) to signal end of line. &lt;br /&gt;
|}&lt;br /&gt;
              &lt;br /&gt;
&lt;br /&gt;
=== Limits ===&lt;br /&gt;
&lt;br /&gt;
* Line numbers can range from 0 to 65529 (but see variances below).&lt;br /&gt;
* Tokenized line length is limited to 256 characters, including the trailing NULL byte. (To do: double check this.)&lt;br /&gt;
&lt;br /&gt;
=== Acceptable variances ===&lt;br /&gt;
&lt;br /&gt;
While Tandy BASIC will never generate such files, it has no problem with a tokenized program that:&lt;br /&gt;
&lt;br /&gt;
* Has line numbers out of order; they will be sorted when loaded.&lt;br /&gt;
* Contains duplicate line numbers; previous line is discarded.&lt;br /&gt;
* Contains arbitrary bytes for PL PH; they are always regenerated during loading.&lt;br /&gt;
* Has a ^Z (ASCII 26) at the end of the file.&lt;br /&gt;
* Contains illegal line numbers; this can be used to store hidden binary data [https://www.mail-archive.com/m100@lists.bitchin100.com/msg16195.html according to John R. Hogerhuis].&lt;br /&gt;
&lt;br /&gt;
Note that while these variances are accepted on an actual Model T device (Model 100, Tandy 200, or Tandy 102), emulators may not be able to handle such files. For example, the [https://sourceforge.net/projects/virtualt/ Virtual T] emulator (as of version 1.7 in 2022) refuses to load tokenized BASIC programs that have lines out of order, duplicate lines, or bogus values for PL PH. &lt;br /&gt;
&lt;br /&gt;
=== Details for PL PH ===&lt;br /&gt;
&lt;br /&gt;
(Stub. This is where the correct calculation of PL PH values will go.)&lt;br /&gt;
&lt;br /&gt;
== Format documentation ==&lt;br /&gt;
&lt;br /&gt;
* [https://m100.bitchin100.narkive.com/eP2uSl4J/tokenized-basic-programs-bytes-of-mystery Discussion of byte format on Bitchin 100 Mailing List]&lt;br /&gt;
* [http://www.club100.org/library/ups/tokens.do BASIC program to create a table of tokens]&lt;br /&gt;
* [https://archive.org/details/HiddenPowersOfTheTrs80Model100/page/n229/mode/2up?view=theater Hidden Powers of the TRS 80 Model 100]. Appendix B lists the BASIC token values for the Model 100 which matches what hackerb9 found programmatically for the Tandy 200.&lt;br /&gt;
* [http://web.archive.org/web/20220324135218/https://help.ayra.ch/trs80-reference#trs-80-model-100-basic-reference Ayra Model 100 BASIC Reference]&lt;br /&gt;
&lt;br /&gt;
== Other links ==&lt;br /&gt;
&lt;br /&gt;
* [https://github.com/hackerb9/tokenize/ Hackerb9's simple program for tokenizing BASIC code]&lt;br /&gt;
* [https://sourceforge.net/projects/virtualt/ A Tandy 200 &amp;amp; Model 100/102 emulator]&lt;br /&gt;
* [http://bitchin100.com/CloudT/ A TRS-80 Model 100 emulator that runs in a web browser]&lt;br /&gt;
&lt;br /&gt;
[[Category:Microsoft]]&lt;/div&gt;</summary>
		<author><name>Hackerb9</name></author>	</entry>

	<entry>
		<id>http://fileformats.archiveteam.org/wiki/Tandy_200_BASIC_tokenized_file</id>
		<title>Tandy 200 BASIC tokenized file</title>
		<link rel="alternate" type="text/html" href="http://fileformats.archiveteam.org/wiki/Tandy_200_BASIC_tokenized_file"/>
				<updated>2022-10-05T19:52:55Z</updated>
		
		<summary type="html">&lt;p&gt;Hackerb9: /* Format documentation */ Add links for Hidden Powers and Ayra&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{FormatInfo&lt;br /&gt;
|subcat=Source code&lt;br /&gt;
|subcat2=Tokenized BASIC&lt;br /&gt;
|released=1984&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
'''Tandy 200 BASIC''' was a version of Microsoft BASIC for the Radio Shack Tandy 200 computer. The tokenizations for the TRS-80 Model 100 and Tandy 102 appear to be identical. The NEC PC-8201/8300 format is not the same, but should be similar.&lt;br /&gt;
&lt;br /&gt;
== Tokens ==&lt;br /&gt;
&lt;br /&gt;
Blank values indicate either that the token is unused or is used for something unknown.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! title=&amp;quot;Hexadecimal code point&amp;quot; | Hex&lt;br /&gt;
! title=&amp;quot;Decimal code point&amp;quot; | Dec&lt;br /&gt;
! title=&amp;quot;BASIC element the token stands for&amp;quot; | Token meaning &lt;br /&gt;
! title=&amp;quot;Miscellany&amp;quot; | Notes&lt;br /&gt;
|-&lt;br /&gt;
|-&lt;br /&gt;
|80||128||END&lt;br /&gt;
|-&lt;br /&gt;
|81||129||FOR&lt;br /&gt;
|-&lt;br /&gt;
|82||130||NEXT&lt;br /&gt;
|-&lt;br /&gt;
|83||131||DATA&lt;br /&gt;
|-&lt;br /&gt;
|84||132||INPUT&lt;br /&gt;
|-&lt;br /&gt;
|85||133||DIM&lt;br /&gt;
|-&lt;br /&gt;
|86||134||READ&lt;br /&gt;
|-&lt;br /&gt;
|87||135||LET&lt;br /&gt;
|-&lt;br /&gt;
|88||136||GOTO&lt;br /&gt;
|-&lt;br /&gt;
|89||137||RUN&lt;br /&gt;
|-&lt;br /&gt;
|8A||138||IF&lt;br /&gt;
|-&lt;br /&gt;
|8B||139||RESTORE&lt;br /&gt;
|-&lt;br /&gt;
|8C||140||GOSUB&lt;br /&gt;
|-&lt;br /&gt;
|8D||141||RETURN&lt;br /&gt;
|-&lt;br /&gt;
|8E||142||REM&lt;br /&gt;
|-&lt;br /&gt;
|8F||143||STOP&lt;br /&gt;
|-&lt;br /&gt;
|90||144||WIDTH&lt;br /&gt;
|-&lt;br /&gt;
|91||145||ELSE||When tokenizing, the Tandy 200 always adds a colon (':') before the ELSE token (3A 91). If the user actually writes :ELSE it is tokenized as 3A 3A 91.&lt;br /&gt;
|-&lt;br /&gt;
|92||146||LINE&lt;br /&gt;
|-&lt;br /&gt;
|93||147||EDIT&lt;br /&gt;
|-&lt;br /&gt;
|94||148||ERROR&lt;br /&gt;
|-&lt;br /&gt;
|95||149||RESUME&lt;br /&gt;
|-&lt;br /&gt;
|96||150||OUT&lt;br /&gt;
|-&lt;br /&gt;
|97||151||ON&lt;br /&gt;
|-&lt;br /&gt;
|98||152||DSKO$&lt;br /&gt;
|-&lt;br /&gt;
|99||153||OPEN&lt;br /&gt;
|-&lt;br /&gt;
|9A||154||CLOSE&lt;br /&gt;
|-&lt;br /&gt;
|9B||155||LOAD||Note that LOADM is simply the token for LOAD followed by an ASCII 'M'. &lt;br /&gt;
|-&lt;br /&gt;
|9C||156||MERGE&lt;br /&gt;
|-QUOTE&lt;br /&gt;
|9D||157||FILES&lt;br /&gt;
|-&lt;br /&gt;
|9E||158||SAVE&lt;br /&gt;
|-&lt;br /&gt;
|9F||159||LFILES&lt;br /&gt;
|-&lt;br /&gt;
|A0||160||LPRINT&lt;br /&gt;
|-&lt;br /&gt;
|A1||161||DEF&lt;br /&gt;
|-&lt;br /&gt;
|A2||162||POKE&lt;br /&gt;
|-&lt;br /&gt;
|A3||163||PRINT&lt;br /&gt;
|-&lt;br /&gt;
|A4||164||CONT&lt;br /&gt;
|-&lt;br /&gt;
|A5||165||LIST&lt;br /&gt;
|-&lt;br /&gt;
|A6||166||LLIST&lt;br /&gt;
|-&lt;br /&gt;
|A7||167||CLEAR&lt;br /&gt;
|-&lt;br /&gt;
|A8||168||CLOAD&lt;br /&gt;
|-&lt;br /&gt;
|A9||169||CSAVE&lt;br /&gt;
|-&lt;br /&gt;
|AA||170||TIME$&lt;br /&gt;
|-&lt;br /&gt;
|AB||171||DATE$&lt;br /&gt;
|-&lt;br /&gt;
|AC||172||DAY$&lt;br /&gt;
|-&lt;br /&gt;
|AD||173||COM&lt;br /&gt;
|-&lt;br /&gt;
|AE||174||MDM&lt;br /&gt;
|-&lt;br /&gt;
|AF||175||KEY&lt;br /&gt;
|-&lt;br /&gt;
|B0||176||CLS&lt;br /&gt;
|-&lt;br /&gt;
|B1||177||BEEP&lt;br /&gt;
|-&lt;br /&gt;
|B2||178||SOUND&lt;br /&gt;
|-&lt;br /&gt;
|B3||179||LCOPY&lt;br /&gt;
|-&lt;br /&gt;
|B4||180||PSET&lt;br /&gt;
|-&lt;br /&gt;
|B5||181||PRESET&lt;br /&gt;
|-&lt;br /&gt;
|B6||182||MOTOR&lt;br /&gt;
|-&lt;br /&gt;
|B7||183||MAX&lt;br /&gt;
|-&lt;br /&gt;
|B8||184||POWER&lt;br /&gt;
|-&lt;br /&gt;
|B9||185||CALL&lt;br /&gt;
|-&lt;br /&gt;
|BA||186||MENU&lt;br /&gt;
|-&lt;br /&gt;
|BB||187||IPL&lt;br /&gt;
|-&lt;br /&gt;
|BC||188||NAME&lt;br /&gt;
|-&lt;br /&gt;
|BD||189||KILL&lt;br /&gt;
|-&lt;br /&gt;
|BE||190||SCREEN&lt;br /&gt;
|-&lt;br /&gt;
|BF||191||NEW&lt;br /&gt;
|-&lt;br /&gt;
|C0||192||TAB(&lt;br /&gt;
|-&lt;br /&gt;
|C1||193||TO&lt;br /&gt;
|-&lt;br /&gt;
|C2||194||USING&lt;br /&gt;
|-&lt;br /&gt;
|C3||195||VARPTR&lt;br /&gt;
|-&lt;br /&gt;
|C4||196||ERL&lt;br /&gt;
|-&lt;br /&gt;
|C5||197||ERR&lt;br /&gt;
|-&lt;br /&gt;
|C6||198||STRING$&lt;br /&gt;
|-&lt;br /&gt;
|C7||199||INSTR&lt;br /&gt;
|-&lt;br /&gt;
|C8||200||DSKI$&lt;br /&gt;
|-&lt;br /&gt;
|C9||201||INKEY$&lt;br /&gt;
|-&lt;br /&gt;
|CA||202||CSRLIN&lt;br /&gt;
|-&lt;br /&gt;
|CB||203||OFF&lt;br /&gt;
|-&lt;br /&gt;
|CC||204||HIMEM&lt;br /&gt;
|-&lt;br /&gt;
|CD||205||THEN&lt;br /&gt;
|-&lt;br /&gt;
|CE||206||NOT&lt;br /&gt;
|-&lt;br /&gt;
|CF||207||STEP&lt;br /&gt;
|-&lt;br /&gt;
|D0||208||+&lt;br /&gt;
|-&lt;br /&gt;
|D1||209||-&lt;br /&gt;
|-&lt;br /&gt;
|D2||210||*&lt;br /&gt;
|-&lt;br /&gt;
|D3||211||/&lt;br /&gt;
|-&lt;br /&gt;
|D4||212||^&lt;br /&gt;
|-&lt;br /&gt;
|D5||213||AND&lt;br /&gt;
|-&lt;br /&gt;
|D6||214||OR&lt;br /&gt;
|-&lt;br /&gt;
|D7||215||XOR&lt;br /&gt;
|-&lt;br /&gt;
|D8||216||EQV&lt;br /&gt;
|-&lt;br /&gt;
|D9||217||IMP&lt;br /&gt;
|-&lt;br /&gt;
|DA||218||MOD&lt;br /&gt;
|-&lt;br /&gt;
|DB||219||\&lt;br /&gt;
|-&lt;br /&gt;
|DC||220||&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|DD||221||=&lt;br /&gt;
|-&lt;br /&gt;
|DE||222||\|&lt;br /&gt;
|-&lt;br /&gt;
|DF||223||SGN&lt;br /&gt;
|-&lt;br /&gt;
|E0||224||INT&lt;br /&gt;
|-&lt;br /&gt;
|E1||225||ABS&lt;br /&gt;
|-&lt;br /&gt;
|E2||226||FRE&lt;br /&gt;
|-&lt;br /&gt;
|E3||227||INP&lt;br /&gt;
|-&lt;br /&gt;
|E4||228||LPOS&lt;br /&gt;
|-&lt;br /&gt;
|E5||229||POS&lt;br /&gt;
|-&lt;br /&gt;
|E6||230||SQR&lt;br /&gt;
|-&lt;br /&gt;
|E7||231||RND&lt;br /&gt;
|-&lt;br /&gt;
|E8||232||LOG&lt;br /&gt;
|-&lt;br /&gt;
|E9||233||EXP&lt;br /&gt;
|-&lt;br /&gt;
|EA||234||COS&lt;br /&gt;
|-&lt;br /&gt;
|EB||235||SIN&lt;br /&gt;
|-&lt;br /&gt;
|EC||236||TAN&lt;br /&gt;
|-&lt;br /&gt;
|ED||237||ATN&lt;br /&gt;
|-&lt;br /&gt;
|EE||238||PEEK&lt;br /&gt;
|-&lt;br /&gt;
|EF||239||EOF&lt;br /&gt;
|-&lt;br /&gt;
|F0||240||LOC&lt;br /&gt;
|-&lt;br /&gt;
|F1||241||LOF&lt;br /&gt;
|-&lt;br /&gt;
|F2||242||CINT&lt;br /&gt;
|-&lt;br /&gt;
|F3||243||CSNG&lt;br /&gt;
|-&lt;br /&gt;
|F4||244||CDBL&lt;br /&gt;
|-&lt;br /&gt;
|F5||245||FIX&lt;br /&gt;
|-&lt;br /&gt;
|F6||246||LEN&lt;br /&gt;
|-&lt;br /&gt;
|F7||247||STR$&lt;br /&gt;
|-&lt;br /&gt;
|F8||248||VAL&lt;br /&gt;
|-&lt;br /&gt;
|F9||249||ASC&lt;br /&gt;
|-&lt;br /&gt;
|FA||250||CHR$&lt;br /&gt;
|-&lt;br /&gt;
|FB||251||SPACE$&lt;br /&gt;
|-&lt;br /&gt;
|FC||252||LEFT$&lt;br /&gt;
|-&lt;br /&gt;
|FD||253||RIGHT$&lt;br /&gt;
|-&lt;br /&gt;
|FE||254||MID$&lt;br /&gt;
|-&lt;br /&gt;
|FF||255||' (QUOTE) || When tokenizing, the single quote character expands to three characters: a colon (3A), the byte for REM (8E), and then FF.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== File Format ==&lt;br /&gt;
&lt;br /&gt;
Tokenised BASIC code is a sequence of tokenized lines. Each tokenized line has the following format:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!Name!!Length!!Description&lt;br /&gt;
|-&lt;br /&gt;
|PL PH&lt;br /&gt;
|2 bytes&lt;br /&gt;
|Address of the next line in memory, little endian. This data can be ignored as it is only a placeholder. The value of PL PH in a file is moot because the address is recalculated every time the program loads. Once in memory, PL PH is used to skip to the line required for GOTO, GOSUB, and READ, thus speeding up the program. &lt;br /&gt;
|-&lt;br /&gt;
|LL LH&lt;br /&gt;
|2 bytes&lt;br /&gt;
|Line number, little endian.&lt;br /&gt;
|-&lt;br /&gt;
|B0 … BN&lt;br /&gt;
|Any number&lt;br /&gt;
|Sequence of tokens or ASCII characters. If a character's value is ≥ 128, then it is a token. All tokens are a single byte. &lt;br /&gt;
|-&lt;br /&gt;
|NULL&lt;br /&gt;
|1 byte&lt;br /&gt;
|NULL byte (`0x00`) to signal end of line. &lt;br /&gt;
|}&lt;br /&gt;
              &lt;br /&gt;
&lt;br /&gt;
=== Limits ===&lt;br /&gt;
&lt;br /&gt;
* Line numbers can range from 0 to 65529 (but see variances below).&lt;br /&gt;
* Tokenized line length is limited to 256 characters, including the trailing NULL byte. (To do: double check this.)&lt;br /&gt;
&lt;br /&gt;
=== Acceptable variances ===&lt;br /&gt;
&lt;br /&gt;
While Tandy BASIC will never generate such files, it has no problem with a tokenized program that:&lt;br /&gt;
&lt;br /&gt;
* Has line numbers out of order; they will be sorted when loaded.&lt;br /&gt;
* Contains duplicate line numbers; previous line is discarded.&lt;br /&gt;
* Contains arbitrary bytes for PL PH; they are always regenerated during loading.&lt;br /&gt;
* Has a ^Z (ASCII 26) at the end of the file.&lt;br /&gt;
* Contains illegal line numbers; this can be used to store hidden binary data [https://www.mail-archive.com/m100@lists.bitchin100.com/msg16195.html according to John R. Hogerhuis].&lt;br /&gt;
&lt;br /&gt;
Note that while these variances are accepted on an actual Model T device (Model 100, Tandy 200, or Tandy 102), emulators may not be able to handle such files. For example, the [https://sourceforge.net/projects/virtualt/ Virtual T] emulator (as of version 1.7 in 2022) refuses to load tokenized BASIC programs that have lines out of order, duplicate lines, or bogus values for PL PH. &lt;br /&gt;
&lt;br /&gt;
=== Details for PL PH ===&lt;br /&gt;
&lt;br /&gt;
(Stub. This is where the correct calculation of PL PH values will go.)&lt;br /&gt;
&lt;br /&gt;
== Format documentation ==&lt;br /&gt;
&lt;br /&gt;
* [https://m100.bitchin100.narkive.com/eP2uSl4J/tokenized-basic-programs-bytes-of-mystery Discussion of byte format on Bitchin 100 Mailing List]&lt;br /&gt;
* [http://www.club100.org/library/ups/tokens.do BASIC program to create a table of tokens]&lt;br /&gt;
* [https://archive.org/details/HiddenPowersOfTheTrs80Model100/page/n229/mode/2up?view=theater Hidden Powers of the TRS 80 Model 100]. Appendix B lists the BASIC token values for the Model 100 which matches what hackerb9 found programmatically for the Tandy 200.&lt;br /&gt;
* [http://web.archive.org/web/20220324135218/https://help.ayra.ch/trs80-reference#trs-80-model-100-basic-reference Ayra Model 100 BASIC Reference]&lt;br /&gt;
&lt;br /&gt;
== Other links ==&lt;br /&gt;
&lt;br /&gt;
* [https://github.com/hackerb9/tokenize/ Hackerb9's simple program for tokenizing BASIC code]&lt;br /&gt;
* [https://sourceforge.net/projects/virtualt/ A Tandy 200 &amp;amp; Model 100/102 emulator]&lt;br /&gt;
* [http://bitchin100.com/CloudT/ A TRS-80 Model 100 emulator that runs in a web browser]&lt;br /&gt;
&lt;br /&gt;
[[Category:Microsoft]]&lt;/div&gt;</summary>
		<author><name>Hackerb9</name></author>	</entry>

	<entry>
		<id>http://fileformats.archiveteam.org/wiki/Tandy_200_BASIC_tokenized_file</id>
		<title>Tandy 200 BASIC tokenized file</title>
		<link rel="alternate" type="text/html" href="http://fileformats.archiveteam.org/wiki/Tandy_200_BASIC_tokenized_file"/>
				<updated>2022-10-05T19:35:39Z</updated>
		
		<summary type="html">&lt;p&gt;Hackerb9: Create subsections for limits and acceptable variances&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{FormatInfo&lt;br /&gt;
|subcat=Source code&lt;br /&gt;
|subcat2=Tokenized BASIC&lt;br /&gt;
|released=1984&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
'''Tandy 200 BASIC''' was a version of Microsoft BASIC for the Radio Shack Tandy 200 computer. The tokenizations for the TRS-80 Model 100 and Tandy 102 appear to be identical. The NEC PC-8201/8300 format is not the same, but should be similar.&lt;br /&gt;
&lt;br /&gt;
== Tokens ==&lt;br /&gt;
&lt;br /&gt;
Blank values indicate either that the token is unused or is used for something unknown.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! title=&amp;quot;Hexadecimal code point&amp;quot; | Hex&lt;br /&gt;
! title=&amp;quot;Decimal code point&amp;quot; | Dec&lt;br /&gt;
! title=&amp;quot;BASIC element the token stands for&amp;quot; | Token meaning &lt;br /&gt;
! title=&amp;quot;Miscellany&amp;quot; | Notes&lt;br /&gt;
|-&lt;br /&gt;
|-&lt;br /&gt;
|80||128||END&lt;br /&gt;
|-&lt;br /&gt;
|81||129||FOR&lt;br /&gt;
|-&lt;br /&gt;
|82||130||NEXT&lt;br /&gt;
|-&lt;br /&gt;
|83||131||DATA&lt;br /&gt;
|-&lt;br /&gt;
|84||132||INPUT&lt;br /&gt;
|-&lt;br /&gt;
|85||133||DIM&lt;br /&gt;
|-&lt;br /&gt;
|86||134||READ&lt;br /&gt;
|-&lt;br /&gt;
|87||135||LET&lt;br /&gt;
|-&lt;br /&gt;
|88||136||GOTO&lt;br /&gt;
|-&lt;br /&gt;
|89||137||RUN&lt;br /&gt;
|-&lt;br /&gt;
|8A||138||IF&lt;br /&gt;
|-&lt;br /&gt;
|8B||139||RESTORE&lt;br /&gt;
|-&lt;br /&gt;
|8C||140||GOSUB&lt;br /&gt;
|-&lt;br /&gt;
|8D||141||RETURN&lt;br /&gt;
|-&lt;br /&gt;
|8E||142||REM&lt;br /&gt;
|-&lt;br /&gt;
|8F||143||STOP&lt;br /&gt;
|-&lt;br /&gt;
|90||144||WIDTH&lt;br /&gt;
|-&lt;br /&gt;
|91||145||ELSE||When tokenizing, the Tandy 200 always adds a colon (':') before the ELSE token (3A 91). If the user actually writes :ELSE it is tokenized as 3A 3A 91.&lt;br /&gt;
|-&lt;br /&gt;
|92||146||LINE&lt;br /&gt;
|-&lt;br /&gt;
|93||147||EDIT&lt;br /&gt;
|-&lt;br /&gt;
|94||148||ERROR&lt;br /&gt;
|-&lt;br /&gt;
|95||149||RESUME&lt;br /&gt;
|-&lt;br /&gt;
|96||150||OUT&lt;br /&gt;
|-&lt;br /&gt;
|97||151||ON&lt;br /&gt;
|-&lt;br /&gt;
|98||152||DSKO$&lt;br /&gt;
|-&lt;br /&gt;
|99||153||OPEN&lt;br /&gt;
|-&lt;br /&gt;
|9A||154||CLOSE&lt;br /&gt;
|-&lt;br /&gt;
|9B||155||LOAD||Note that LOADM is simply the token for LOAD followed by an ASCII 'M'. &lt;br /&gt;
|-&lt;br /&gt;
|9C||156||MERGE&lt;br /&gt;
|-QUOTE&lt;br /&gt;
|9D||157||FILES&lt;br /&gt;
|-&lt;br /&gt;
|9E||158||SAVE&lt;br /&gt;
|-&lt;br /&gt;
|9F||159||LFILES&lt;br /&gt;
|-&lt;br /&gt;
|A0||160||LPRINT&lt;br /&gt;
|-&lt;br /&gt;
|A1||161||DEF&lt;br /&gt;
|-&lt;br /&gt;
|A2||162||POKE&lt;br /&gt;
|-&lt;br /&gt;
|A3||163||PRINT&lt;br /&gt;
|-&lt;br /&gt;
|A4||164||CONT&lt;br /&gt;
|-&lt;br /&gt;
|A5||165||LIST&lt;br /&gt;
|-&lt;br /&gt;
|A6||166||LLIST&lt;br /&gt;
|-&lt;br /&gt;
|A7||167||CLEAR&lt;br /&gt;
|-&lt;br /&gt;
|A8||168||CLOAD&lt;br /&gt;
|-&lt;br /&gt;
|A9||169||CSAVE&lt;br /&gt;
|-&lt;br /&gt;
|AA||170||TIME$&lt;br /&gt;
|-&lt;br /&gt;
|AB||171||DATE$&lt;br /&gt;
|-&lt;br /&gt;
|AC||172||DAY$&lt;br /&gt;
|-&lt;br /&gt;
|AD||173||COM&lt;br /&gt;
|-&lt;br /&gt;
|AE||174||MDM&lt;br /&gt;
|-&lt;br /&gt;
|AF||175||KEY&lt;br /&gt;
|-&lt;br /&gt;
|B0||176||CLS&lt;br /&gt;
|-&lt;br /&gt;
|B1||177||BEEP&lt;br /&gt;
|-&lt;br /&gt;
|B2||178||SOUND&lt;br /&gt;
|-&lt;br /&gt;
|B3||179||LCOPY&lt;br /&gt;
|-&lt;br /&gt;
|B4||180||PSET&lt;br /&gt;
|-&lt;br /&gt;
|B5||181||PRESET&lt;br /&gt;
|-&lt;br /&gt;
|B6||182||MOTOR&lt;br /&gt;
|-&lt;br /&gt;
|B7||183||MAX&lt;br /&gt;
|-&lt;br /&gt;
|B8||184||POWER&lt;br /&gt;
|-&lt;br /&gt;
|B9||185||CALL&lt;br /&gt;
|-&lt;br /&gt;
|BA||186||MENU&lt;br /&gt;
|-&lt;br /&gt;
|BB||187||IPL&lt;br /&gt;
|-&lt;br /&gt;
|BC||188||NAME&lt;br /&gt;
|-&lt;br /&gt;
|BD||189||KILL&lt;br /&gt;
|-&lt;br /&gt;
|BE||190||SCREEN&lt;br /&gt;
|-&lt;br /&gt;
|BF||191||NEW&lt;br /&gt;
|-&lt;br /&gt;
|C0||192||TAB(&lt;br /&gt;
|-&lt;br /&gt;
|C1||193||TO&lt;br /&gt;
|-&lt;br /&gt;
|C2||194||USING&lt;br /&gt;
|-&lt;br /&gt;
|C3||195||VARPTR&lt;br /&gt;
|-&lt;br /&gt;
|C4||196||ERL&lt;br /&gt;
|-&lt;br /&gt;
|C5||197||ERR&lt;br /&gt;
|-&lt;br /&gt;
|C6||198||STRING$&lt;br /&gt;
|-&lt;br /&gt;
|C7||199||INSTR&lt;br /&gt;
|-&lt;br /&gt;
|C8||200||DSKI$&lt;br /&gt;
|-&lt;br /&gt;
|C9||201||INKEY$&lt;br /&gt;
|-&lt;br /&gt;
|CA||202||CSRLIN&lt;br /&gt;
|-&lt;br /&gt;
|CB||203||OFF&lt;br /&gt;
|-&lt;br /&gt;
|CC||204||HIMEM&lt;br /&gt;
|-&lt;br /&gt;
|CD||205||THEN&lt;br /&gt;
|-&lt;br /&gt;
|CE||206||NOT&lt;br /&gt;
|-&lt;br /&gt;
|CF||207||STEP&lt;br /&gt;
|-&lt;br /&gt;
|D0||208||+&lt;br /&gt;
|-&lt;br /&gt;
|D1||209||-&lt;br /&gt;
|-&lt;br /&gt;
|D2||210||*&lt;br /&gt;
|-&lt;br /&gt;
|D3||211||/&lt;br /&gt;
|-&lt;br /&gt;
|D4||212||^&lt;br /&gt;
|-&lt;br /&gt;
|D5||213||AND&lt;br /&gt;
|-&lt;br /&gt;
|D6||214||OR&lt;br /&gt;
|-&lt;br /&gt;
|D7||215||XOR&lt;br /&gt;
|-&lt;br /&gt;
|D8||216||EQV&lt;br /&gt;
|-&lt;br /&gt;
|D9||217||IMP&lt;br /&gt;
|-&lt;br /&gt;
|DA||218||MOD&lt;br /&gt;
|-&lt;br /&gt;
|DB||219||\&lt;br /&gt;
|-&lt;br /&gt;
|DC||220||&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|DD||221||=&lt;br /&gt;
|-&lt;br /&gt;
|DE||222||\|&lt;br /&gt;
|-&lt;br /&gt;
|DF||223||SGN&lt;br /&gt;
|-&lt;br /&gt;
|E0||224||INT&lt;br /&gt;
|-&lt;br /&gt;
|E1||225||ABS&lt;br /&gt;
|-&lt;br /&gt;
|E2||226||FRE&lt;br /&gt;
|-&lt;br /&gt;
|E3||227||INP&lt;br /&gt;
|-&lt;br /&gt;
|E4||228||LPOS&lt;br /&gt;
|-&lt;br /&gt;
|E5||229||POS&lt;br /&gt;
|-&lt;br /&gt;
|E6||230||SQR&lt;br /&gt;
|-&lt;br /&gt;
|E7||231||RND&lt;br /&gt;
|-&lt;br /&gt;
|E8||232||LOG&lt;br /&gt;
|-&lt;br /&gt;
|E9||233||EXP&lt;br /&gt;
|-&lt;br /&gt;
|EA||234||COS&lt;br /&gt;
|-&lt;br /&gt;
|EB||235||SIN&lt;br /&gt;
|-&lt;br /&gt;
|EC||236||TAN&lt;br /&gt;
|-&lt;br /&gt;
|ED||237||ATN&lt;br /&gt;
|-&lt;br /&gt;
|EE||238||PEEK&lt;br /&gt;
|-&lt;br /&gt;
|EF||239||EOF&lt;br /&gt;
|-&lt;br /&gt;
|F0||240||LOC&lt;br /&gt;
|-&lt;br /&gt;
|F1||241||LOF&lt;br /&gt;
|-&lt;br /&gt;
|F2||242||CINT&lt;br /&gt;
|-&lt;br /&gt;
|F3||243||CSNG&lt;br /&gt;
|-&lt;br /&gt;
|F4||244||CDBL&lt;br /&gt;
|-&lt;br /&gt;
|F5||245||FIX&lt;br /&gt;
|-&lt;br /&gt;
|F6||246||LEN&lt;br /&gt;
|-&lt;br /&gt;
|F7||247||STR$&lt;br /&gt;
|-&lt;br /&gt;
|F8||248||VAL&lt;br /&gt;
|-&lt;br /&gt;
|F9||249||ASC&lt;br /&gt;
|-&lt;br /&gt;
|FA||250||CHR$&lt;br /&gt;
|-&lt;br /&gt;
|FB||251||SPACE$&lt;br /&gt;
|-&lt;br /&gt;
|FC||252||LEFT$&lt;br /&gt;
|-&lt;br /&gt;
|FD||253||RIGHT$&lt;br /&gt;
|-&lt;br /&gt;
|FE||254||MID$&lt;br /&gt;
|-&lt;br /&gt;
|FF||255||' (QUOTE) || When tokenizing, the single quote character expands to three characters: a colon (3A), the byte for REM (8E), and then FF.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== File Format ==&lt;br /&gt;
&lt;br /&gt;
Tokenised BASIC code is a sequence of tokenized lines. Each tokenized line has the following format:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!Name!!Length!!Description&lt;br /&gt;
|-&lt;br /&gt;
|PL PH&lt;br /&gt;
|2 bytes&lt;br /&gt;
|Address of the next line in memory, little endian. This data can be ignored as it is only a placeholder. The value of PL PH in a file is moot because the address is recalculated every time the program loads. Once in memory, PL PH is used to skip to the line required for GOTO, GOSUB, and READ, thus speeding up the program. &lt;br /&gt;
|-&lt;br /&gt;
|LL LH&lt;br /&gt;
|2 bytes&lt;br /&gt;
|Line number, little endian.&lt;br /&gt;
|-&lt;br /&gt;
|B0 … BN&lt;br /&gt;
|Any number&lt;br /&gt;
|Sequence of tokens or ASCII characters. If a character's value is ≥ 128, then it is a token. All tokens are a single byte. &lt;br /&gt;
|-&lt;br /&gt;
|NULL&lt;br /&gt;
|1 byte&lt;br /&gt;
|NULL byte (`0x00`) to signal end of line. &lt;br /&gt;
|}&lt;br /&gt;
              &lt;br /&gt;
&lt;br /&gt;
=== Limits ===&lt;br /&gt;
&lt;br /&gt;
* Line numbers can range from 0 to 65529 (but see variances below).&lt;br /&gt;
* Tokenized line length is limited to 256 characters, including the trailing NULL byte. (To do: double check this.)&lt;br /&gt;
&lt;br /&gt;
=== Acceptable variances ===&lt;br /&gt;
&lt;br /&gt;
While Tandy BASIC will never generate such files, it has no problem with a tokenized program that:&lt;br /&gt;
&lt;br /&gt;
* Has line numbers out of order; they will be sorted when loaded.&lt;br /&gt;
* Contains duplicate line numbers; previous line is discarded.&lt;br /&gt;
* Contains arbitrary bytes for PL PH; they are always regenerated during loading.&lt;br /&gt;
* Has a ^Z (ASCII 26) at the end of the file.&lt;br /&gt;
* Contains illegal line numbers; this can be used to store hidden binary data [https://www.mail-archive.com/m100@lists.bitchin100.com/msg16195.html according to John R. Hogerhuis].&lt;br /&gt;
&lt;br /&gt;
Note that while these variances are accepted on an actual Model T device (Model 100, Tandy 200, or Tandy 102), emulators may not be able to handle such files. For example, the [https://sourceforge.net/projects/virtualt/ Virtual T] emulator (as of version 1.7 in 2022) refuses to load tokenized BASIC programs that have lines out of order, duplicate lines, or bogus values for PL PH. &lt;br /&gt;
&lt;br /&gt;
=== Details for PL PH ===&lt;br /&gt;
&lt;br /&gt;
(Stub. This is where the correct calculation of PL PH values will go.)&lt;br /&gt;
&lt;br /&gt;
== Format documentation ==&lt;br /&gt;
&lt;br /&gt;
* [https://m100.bitchin100.narkive.com/eP2uSl4J/tokenized-basic-programs-bytes-of-mystery Discussion of byte format on Bitchin 100 Mailing List]&lt;br /&gt;
* [http://www.club100.org/library/ups/tokens.do BASIC program to create a table of tokens]&lt;br /&gt;
&lt;br /&gt;
== Other links ==&lt;br /&gt;
&lt;br /&gt;
* [https://github.com/hackerb9/tokenize/ Hackerb9's simple program for tokenizing BASIC code]&lt;br /&gt;
* [https://sourceforge.net/projects/virtualt/ A Tandy 200 &amp;amp; Model 100/102 emulator]&lt;br /&gt;
* [http://bitchin100.com/CloudT/ A TRS-80 Model 100 emulator that runs in a web browser]&lt;br /&gt;
&lt;br /&gt;
[[Category:Microsoft]]&lt;/div&gt;</summary>
		<author><name>Hackerb9</name></author>	</entry>

	<entry>
		<id>http://fileformats.archiveteam.org/wiki/Tandy_200_BASIC_tokenized_file</id>
		<title>Tandy 200 BASIC tokenized file</title>
		<link rel="alternate" type="text/html" href="http://fileformats.archiveteam.org/wiki/Tandy_200_BASIC_tokenized_file"/>
				<updated>2022-10-05T12:39:56Z</updated>
		
		<summary type="html">&lt;p&gt;Hackerb9: Add note that VirtualT requires PL PH to be set exactly&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{FormatInfo&lt;br /&gt;
|subcat=Source code&lt;br /&gt;
|subcat2=Tokenized BASIC&lt;br /&gt;
|released=1984&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
'''Tandy 200 BASIC''' was a version of Microsoft BASIC for the Radio Shack Tandy 200 computer. The tokenizations for the TRS-80 Model 100 and Tandy 102 appear to be identical. The NEC PC-8201/8300 format is not the same, but should be similar.&lt;br /&gt;
&lt;br /&gt;
== Tokens ==&lt;br /&gt;
&lt;br /&gt;
Blank values indicate either that the token is unused or is used for something unknown.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! title=&amp;quot;Hexadecimal code point&amp;quot; | Hex&lt;br /&gt;
! title=&amp;quot;Decimal code point&amp;quot; | Dec&lt;br /&gt;
! title=&amp;quot;BASIC element the token stands for&amp;quot; | Token meaning &lt;br /&gt;
! title=&amp;quot;Miscellany&amp;quot; | Notes&lt;br /&gt;
|-&lt;br /&gt;
|-&lt;br /&gt;
|80||128||END&lt;br /&gt;
|-&lt;br /&gt;
|81||129||FOR&lt;br /&gt;
|-&lt;br /&gt;
|82||130||NEXT&lt;br /&gt;
|-&lt;br /&gt;
|83||131||DATA&lt;br /&gt;
|-&lt;br /&gt;
|84||132||INPUT&lt;br /&gt;
|-&lt;br /&gt;
|85||133||DIM&lt;br /&gt;
|-&lt;br /&gt;
|86||134||READ&lt;br /&gt;
|-&lt;br /&gt;
|87||135||LET&lt;br /&gt;
|-&lt;br /&gt;
|88||136||GOTO&lt;br /&gt;
|-&lt;br /&gt;
|89||137||RUN&lt;br /&gt;
|-&lt;br /&gt;
|8A||138||IF&lt;br /&gt;
|-&lt;br /&gt;
|8B||139||RESTORE&lt;br /&gt;
|-&lt;br /&gt;
|8C||140||GOSUB&lt;br /&gt;
|-&lt;br /&gt;
|8D||141||RETURN&lt;br /&gt;
|-&lt;br /&gt;
|8E||142||REM&lt;br /&gt;
|-&lt;br /&gt;
|8F||143||STOP&lt;br /&gt;
|-&lt;br /&gt;
|90||144||WIDTH&lt;br /&gt;
|-&lt;br /&gt;
|91||145||ELSE||When tokenizing, the Tandy 200 always adds a colon (':') before the ELSE token (3A 91). If the user actually writes :ELSE it is tokenized as 3A 3A 91.&lt;br /&gt;
|-&lt;br /&gt;
|92||146||LINE&lt;br /&gt;
|-&lt;br /&gt;
|93||147||EDIT&lt;br /&gt;
|-&lt;br /&gt;
|94||148||ERROR&lt;br /&gt;
|-&lt;br /&gt;
|95||149||RESUME&lt;br /&gt;
|-&lt;br /&gt;
|96||150||OUT&lt;br /&gt;
|-&lt;br /&gt;
|97||151||ON&lt;br /&gt;
|-&lt;br /&gt;
|98||152||DSKO$&lt;br /&gt;
|-&lt;br /&gt;
|99||153||OPEN&lt;br /&gt;
|-&lt;br /&gt;
|9A||154||CLOSE&lt;br /&gt;
|-&lt;br /&gt;
|9B||155||LOAD||Note that LOADM is simply the token for LOAD followed by an ASCII 'M'. &lt;br /&gt;
|-&lt;br /&gt;
|9C||156||MERGE&lt;br /&gt;
|-QUOTE&lt;br /&gt;
|9D||157||FILES&lt;br /&gt;
|-&lt;br /&gt;
|9E||158||SAVE&lt;br /&gt;
|-&lt;br /&gt;
|9F||159||LFILES&lt;br /&gt;
|-&lt;br /&gt;
|A0||160||LPRINT&lt;br /&gt;
|-&lt;br /&gt;
|A1||161||DEF&lt;br /&gt;
|-&lt;br /&gt;
|A2||162||POKE&lt;br /&gt;
|-&lt;br /&gt;
|A3||163||PRINT&lt;br /&gt;
|-&lt;br /&gt;
|A4||164||CONT&lt;br /&gt;
|-&lt;br /&gt;
|A5||165||LIST&lt;br /&gt;
|-&lt;br /&gt;
|A6||166||LLIST&lt;br /&gt;
|-&lt;br /&gt;
|A7||167||CLEAR&lt;br /&gt;
|-&lt;br /&gt;
|A8||168||CLOAD&lt;br /&gt;
|-&lt;br /&gt;
|A9||169||CSAVE&lt;br /&gt;
|-&lt;br /&gt;
|AA||170||TIME$&lt;br /&gt;
|-&lt;br /&gt;
|AB||171||DATE$&lt;br /&gt;
|-&lt;br /&gt;
|AC||172||DAY$&lt;br /&gt;
|-&lt;br /&gt;
|AD||173||COM&lt;br /&gt;
|-&lt;br /&gt;
|AE||174||MDM&lt;br /&gt;
|-&lt;br /&gt;
|AF||175||KEY&lt;br /&gt;
|-&lt;br /&gt;
|B0||176||CLS&lt;br /&gt;
|-&lt;br /&gt;
|B1||177||BEEP&lt;br /&gt;
|-&lt;br /&gt;
|B2||178||SOUND&lt;br /&gt;
|-&lt;br /&gt;
|B3||179||LCOPY&lt;br /&gt;
|-&lt;br /&gt;
|B4||180||PSET&lt;br /&gt;
|-&lt;br /&gt;
|B5||181||PRESET&lt;br /&gt;
|-&lt;br /&gt;
|B6||182||MOTOR&lt;br /&gt;
|-&lt;br /&gt;
|B7||183||MAX&lt;br /&gt;
|-&lt;br /&gt;
|B8||184||POWER&lt;br /&gt;
|-&lt;br /&gt;
|B9||185||CALL&lt;br /&gt;
|-&lt;br /&gt;
|BA||186||MENU&lt;br /&gt;
|-&lt;br /&gt;
|BB||187||IPL&lt;br /&gt;
|-&lt;br /&gt;
|BC||188||NAME&lt;br /&gt;
|-&lt;br /&gt;
|BD||189||KILL&lt;br /&gt;
|-&lt;br /&gt;
|BE||190||SCREEN&lt;br /&gt;
|-&lt;br /&gt;
|BF||191||NEW&lt;br /&gt;
|-&lt;br /&gt;
|C0||192||TAB(&lt;br /&gt;
|-&lt;br /&gt;
|C1||193||TO&lt;br /&gt;
|-&lt;br /&gt;
|C2||194||USING&lt;br /&gt;
|-&lt;br /&gt;
|C3||195||VARPTR&lt;br /&gt;
|-&lt;br /&gt;
|C4||196||ERL&lt;br /&gt;
|-&lt;br /&gt;
|C5||197||ERR&lt;br /&gt;
|-&lt;br /&gt;
|C6||198||STRING$&lt;br /&gt;
|-&lt;br /&gt;
|C7||199||INSTR&lt;br /&gt;
|-&lt;br /&gt;
|C8||200||DSKI$&lt;br /&gt;
|-&lt;br /&gt;
|C9||201||INKEY$&lt;br /&gt;
|-&lt;br /&gt;
|CA||202||CSRLIN&lt;br /&gt;
|-&lt;br /&gt;
|CB||203||OFF&lt;br /&gt;
|-&lt;br /&gt;
|CC||204||HIMEM&lt;br /&gt;
|-&lt;br /&gt;
|CD||205||THEN&lt;br /&gt;
|-&lt;br /&gt;
|CE||206||NOT&lt;br /&gt;
|-&lt;br /&gt;
|CF||207||STEP&lt;br /&gt;
|-&lt;br /&gt;
|D0||208||+&lt;br /&gt;
|-&lt;br /&gt;
|D1||209||-&lt;br /&gt;
|-&lt;br /&gt;
|D2||210||*&lt;br /&gt;
|-&lt;br /&gt;
|D3||211||/&lt;br /&gt;
|-&lt;br /&gt;
|D4||212||^&lt;br /&gt;
|-&lt;br /&gt;
|D5||213||AND&lt;br /&gt;
|-&lt;br /&gt;
|D6||214||OR&lt;br /&gt;
|-&lt;br /&gt;
|D7||215||XOR&lt;br /&gt;
|-&lt;br /&gt;
|D8||216||EQV&lt;br /&gt;
|-&lt;br /&gt;
|D9||217||IMP&lt;br /&gt;
|-&lt;br /&gt;
|DA||218||MOD&lt;br /&gt;
|-&lt;br /&gt;
|DB||219||\&lt;br /&gt;
|-&lt;br /&gt;
|DC||220||&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|DD||221||=&lt;br /&gt;
|-&lt;br /&gt;
|DE||222||\|&lt;br /&gt;
|-&lt;br /&gt;
|DF||223||SGN&lt;br /&gt;
|-&lt;br /&gt;
|E0||224||INT&lt;br /&gt;
|-&lt;br /&gt;
|E1||225||ABS&lt;br /&gt;
|-&lt;br /&gt;
|E2||226||FRE&lt;br /&gt;
|-&lt;br /&gt;
|E3||227||INP&lt;br /&gt;
|-&lt;br /&gt;
|E4||228||LPOS&lt;br /&gt;
|-&lt;br /&gt;
|E5||229||POS&lt;br /&gt;
|-&lt;br /&gt;
|E6||230||SQR&lt;br /&gt;
|-&lt;br /&gt;
|E7||231||RND&lt;br /&gt;
|-&lt;br /&gt;
|E8||232||LOG&lt;br /&gt;
|-&lt;br /&gt;
|E9||233||EXP&lt;br /&gt;
|-&lt;br /&gt;
|EA||234||COS&lt;br /&gt;
|-&lt;br /&gt;
|EB||235||SIN&lt;br /&gt;
|-&lt;br /&gt;
|EC||236||TAN&lt;br /&gt;
|-&lt;br /&gt;
|ED||237||ATN&lt;br /&gt;
|-&lt;br /&gt;
|EE||238||PEEK&lt;br /&gt;
|-&lt;br /&gt;
|EF||239||EOF&lt;br /&gt;
|-&lt;br /&gt;
|F0||240||LOC&lt;br /&gt;
|-&lt;br /&gt;
|F1||241||LOF&lt;br /&gt;
|-&lt;br /&gt;
|F2||242||CINT&lt;br /&gt;
|-&lt;br /&gt;
|F3||243||CSNG&lt;br /&gt;
|-&lt;br /&gt;
|F4||244||CDBL&lt;br /&gt;
|-&lt;br /&gt;
|F5||245||FIX&lt;br /&gt;
|-&lt;br /&gt;
|F6||246||LEN&lt;br /&gt;
|-&lt;br /&gt;
|F7||247||STR$&lt;br /&gt;
|-&lt;br /&gt;
|F8||248||VAL&lt;br /&gt;
|-&lt;br /&gt;
|F9||249||ASC&lt;br /&gt;
|-&lt;br /&gt;
|FA||250||CHR$&lt;br /&gt;
|-&lt;br /&gt;
|FB||251||SPACE$&lt;br /&gt;
|-&lt;br /&gt;
|FC||252||LEFT$&lt;br /&gt;
|-&lt;br /&gt;
|FD||253||RIGHT$&lt;br /&gt;
|-&lt;br /&gt;
|FE||254||MID$&lt;br /&gt;
|-&lt;br /&gt;
|FF||255||' (QUOTE) || When tokenizing, the single quote character expands to three characters: a colon (3A), the byte for REM (8E), and then FF.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== File Format ==&lt;br /&gt;
&lt;br /&gt;
Tokenised BASIC code is a sequence of tokenized lines. Each tokenized line has the following format:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!Name!!Length!!Description&lt;br /&gt;
|-&lt;br /&gt;
|PL PH&lt;br /&gt;
|2 bytes&lt;br /&gt;
|Address of the next line in memory, little endian. This data can be ignored as it is only a placeholder. The value of PL PH in a file is moot because the address is recalculated every time the program loads. Once in memory, PL PH is used to skip to the line required for GOTO, GOSUB, and READ, thus speeding up the program. &lt;br /&gt;
|-&lt;br /&gt;
|LL LH&lt;br /&gt;
|2 bytes&lt;br /&gt;
|Line number, little endian.&lt;br /&gt;
|-&lt;br /&gt;
|B0 … BN&lt;br /&gt;
|Any number&lt;br /&gt;
|Sequence of tokens or ASCII characters. If a character's value is ≥ 128, then it is a token. All tokens are a single byte. &lt;br /&gt;
|-&lt;br /&gt;
|NULL&lt;br /&gt;
|1 byte&lt;br /&gt;
|NULL byte (`0x00`) to signal end of line. &lt;br /&gt;
|}&lt;br /&gt;
              &lt;br /&gt;
=== Details for PL PH ===&lt;br /&gt;
&lt;br /&gt;
While the address in PL PH is ignored by Tandy portables, the Virtual T emulator (as of version 1.7 in 2022) does a sanity check of files and will refuse to load BASIC files that do not have PL PH set exactly. In particular, each subsequent address must equal the previous address plus the length of the current line.                                                                                                                                                                                                                                                                                                                                                                                  &lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
== Format documentation ==&lt;br /&gt;
&lt;br /&gt;
* [https://m100.bitchin100.narkive.com/eP2uSl4J/tokenized-basic-programs-bytes-of-mystery Discussion of byte format on Bitchin 100 Mailing List]&lt;br /&gt;
* [http://www.club100.org/library/ups/tokens.do BASIC program to create a table of tokens]&lt;br /&gt;
&lt;br /&gt;
== Other links ==&lt;br /&gt;
&lt;br /&gt;
* [https://github.com/hackerb9/tokenize/ Hackerb9's simple program for tokenizing BASIC code]&lt;br /&gt;
* [https://sourceforge.net/projects/virtualt/ A Tandy 200 &amp;amp; Model 100/102 emulator]&lt;br /&gt;
* [http://bitchin100.com/CloudT/ A TRS-80 Model 100 emulator that runs in a web browser]&lt;br /&gt;
&lt;br /&gt;
[[Category:Microsoft]]&lt;/div&gt;</summary>
		<author><name>Hackerb9</name></author>	</entry>

	<entry>
		<id>http://fileformats.archiveteam.org/wiki/Tandy_200_BASIC_tokenized_file</id>
		<title>Tandy 200 BASIC tokenized file</title>
		<link rel="alternate" type="text/html" href="http://fileformats.archiveteam.org/wiki/Tandy_200_BASIC_tokenized_file"/>
				<updated>2022-09-24T05:57:13Z</updated>
		
		<summary type="html">&lt;p&gt;Hackerb9: Model 100, Tandy 102 appear identical&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{FormatInfo&lt;br /&gt;
|subcat=Source code&lt;br /&gt;
|subcat2=Tokenized BASIC&lt;br /&gt;
|released=1984&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
'''Tandy 200 BASIC''' was a version of Microsoft BASIC for the Radio Shack Tandy 200 computer. The tokenizations for the TRS-80 Model 100 and Tandy 102 appear to be identical. The NEC PC-8201/8300 format is not the same, but should be similar.&lt;br /&gt;
&lt;br /&gt;
== Tokens ==&lt;br /&gt;
&lt;br /&gt;
Blank values indicate either that the token is unused or is used for something unknown.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! title=&amp;quot;Hexadecimal code point&amp;quot; | Hex&lt;br /&gt;
! title=&amp;quot;Decimal code point&amp;quot; | Dec&lt;br /&gt;
! title=&amp;quot;BASIC element the token stands for&amp;quot; | Token meaning &lt;br /&gt;
! title=&amp;quot;Miscellany&amp;quot; | Notes&lt;br /&gt;
|-&lt;br /&gt;
|-&lt;br /&gt;
|80||128||END&lt;br /&gt;
|-&lt;br /&gt;
|81||129||FOR&lt;br /&gt;
|-&lt;br /&gt;
|82||130||NEXT&lt;br /&gt;
|-&lt;br /&gt;
|83||131||DATA&lt;br /&gt;
|-&lt;br /&gt;
|84||132||INPUT&lt;br /&gt;
|-&lt;br /&gt;
|85||133||DIM&lt;br /&gt;
|-&lt;br /&gt;
|86||134||READ&lt;br /&gt;
|-&lt;br /&gt;
|87||135||LET&lt;br /&gt;
|-&lt;br /&gt;
|88||136||GOTO&lt;br /&gt;
|-&lt;br /&gt;
|89||137||RUN&lt;br /&gt;
|-&lt;br /&gt;
|8A||138||IF&lt;br /&gt;
|-&lt;br /&gt;
|8B||139||RESTORE&lt;br /&gt;
|-&lt;br /&gt;
|8C||140||GOSUB&lt;br /&gt;
|-&lt;br /&gt;
|8D||141||RETURN&lt;br /&gt;
|-&lt;br /&gt;
|8E||142||REM&lt;br /&gt;
|-&lt;br /&gt;
|8F||143||STOP&lt;br /&gt;
|-&lt;br /&gt;
|90||144||WIDTH&lt;br /&gt;
|-&lt;br /&gt;
|91||145||ELSE||When tokenizing, the Tandy 200 always adds a colon (':') before the ELSE token (3A 91). If the user actually writes :ELSE it is tokenized as 3A 3A 91.&lt;br /&gt;
|-&lt;br /&gt;
|92||146||LINE&lt;br /&gt;
|-&lt;br /&gt;
|93||147||EDIT&lt;br /&gt;
|-&lt;br /&gt;
|94||148||ERROR&lt;br /&gt;
|-&lt;br /&gt;
|95||149||RESUME&lt;br /&gt;
|-&lt;br /&gt;
|96||150||OUT&lt;br /&gt;
|-&lt;br /&gt;
|97||151||ON&lt;br /&gt;
|-&lt;br /&gt;
|98||152||DSKO$&lt;br /&gt;
|-&lt;br /&gt;
|99||153||OPEN&lt;br /&gt;
|-&lt;br /&gt;
|9A||154||CLOSE&lt;br /&gt;
|-&lt;br /&gt;
|9B||155||LOAD||Note that LOADM is simply the token for LOAD followed by an ASCII 'M'. &lt;br /&gt;
|-&lt;br /&gt;
|9C||156||MERGE&lt;br /&gt;
|-QUOTE&lt;br /&gt;
|9D||157||FILES&lt;br /&gt;
|-&lt;br /&gt;
|9E||158||SAVE&lt;br /&gt;
|-&lt;br /&gt;
|9F||159||LFILES&lt;br /&gt;
|-&lt;br /&gt;
|A0||160||LPRINT&lt;br /&gt;
|-&lt;br /&gt;
|A1||161||DEF&lt;br /&gt;
|-&lt;br /&gt;
|A2||162||POKE&lt;br /&gt;
|-&lt;br /&gt;
|A3||163||PRINT&lt;br /&gt;
|-&lt;br /&gt;
|A4||164||CONT&lt;br /&gt;
|-&lt;br /&gt;
|A5||165||LIST&lt;br /&gt;
|-&lt;br /&gt;
|A6||166||LLIST&lt;br /&gt;
|-&lt;br /&gt;
|A7||167||CLEAR&lt;br /&gt;
|-&lt;br /&gt;
|A8||168||CLOAD&lt;br /&gt;
|-&lt;br /&gt;
|A9||169||CSAVE&lt;br /&gt;
|-&lt;br /&gt;
|AA||170||TIME$&lt;br /&gt;
|-&lt;br /&gt;
|AB||171||DATE$&lt;br /&gt;
|-&lt;br /&gt;
|AC||172||DAY$&lt;br /&gt;
|-&lt;br /&gt;
|AD||173||COM&lt;br /&gt;
|-&lt;br /&gt;
|AE||174||MDM&lt;br /&gt;
|-&lt;br /&gt;
|AF||175||KEY&lt;br /&gt;
|-&lt;br /&gt;
|B0||176||CLS&lt;br /&gt;
|-&lt;br /&gt;
|B1||177||BEEP&lt;br /&gt;
|-&lt;br /&gt;
|B2||178||SOUND&lt;br /&gt;
|-&lt;br /&gt;
|B3||179||LCOPY&lt;br /&gt;
|-&lt;br /&gt;
|B4||180||PSET&lt;br /&gt;
|-&lt;br /&gt;
|B5||181||PRESET&lt;br /&gt;
|-&lt;br /&gt;
|B6||182||MOTOR&lt;br /&gt;
|-&lt;br /&gt;
|B7||183||MAX&lt;br /&gt;
|-&lt;br /&gt;
|B8||184||POWER&lt;br /&gt;
|-&lt;br /&gt;
|B9||185||CALL&lt;br /&gt;
|-&lt;br /&gt;
|BA||186||MENU&lt;br /&gt;
|-&lt;br /&gt;
|BB||187||IPL&lt;br /&gt;
|-&lt;br /&gt;
|BC||188||NAME&lt;br /&gt;
|-&lt;br /&gt;
|BD||189||KILL&lt;br /&gt;
|-&lt;br /&gt;
|BE||190||SCREEN&lt;br /&gt;
|-&lt;br /&gt;
|BF||191||NEW&lt;br /&gt;
|-&lt;br /&gt;
|C0||192||TAB(&lt;br /&gt;
|-&lt;br /&gt;
|C1||193||TO&lt;br /&gt;
|-&lt;br /&gt;
|C2||194||USING&lt;br /&gt;
|-&lt;br /&gt;
|C3||195||VARPTR&lt;br /&gt;
|-&lt;br /&gt;
|C4||196||ERL&lt;br /&gt;
|-&lt;br /&gt;
|C5||197||ERR&lt;br /&gt;
|-&lt;br /&gt;
|C6||198||STRING$&lt;br /&gt;
|-&lt;br /&gt;
|C7||199||INSTR&lt;br /&gt;
|-&lt;br /&gt;
|C8||200||DSKI$&lt;br /&gt;
|-&lt;br /&gt;
|C9||201||INKEY$&lt;br /&gt;
|-&lt;br /&gt;
|CA||202||CSRLIN&lt;br /&gt;
|-&lt;br /&gt;
|CB||203||OFF&lt;br /&gt;
|-&lt;br /&gt;
|CC||204||HIMEM&lt;br /&gt;
|-&lt;br /&gt;
|CD||205||THEN&lt;br /&gt;
|-&lt;br /&gt;
|CE||206||NOT&lt;br /&gt;
|-&lt;br /&gt;
|CF||207||STEP&lt;br /&gt;
|-&lt;br /&gt;
|D0||208||+&lt;br /&gt;
|-&lt;br /&gt;
|D1||209||-&lt;br /&gt;
|-&lt;br /&gt;
|D2||210||*&lt;br /&gt;
|-&lt;br /&gt;
|D3||211||/&lt;br /&gt;
|-&lt;br /&gt;
|D4||212||^&lt;br /&gt;
|-&lt;br /&gt;
|D5||213||AND&lt;br /&gt;
|-&lt;br /&gt;
|D6||214||OR&lt;br /&gt;
|-&lt;br /&gt;
|D7||215||XOR&lt;br /&gt;
|-&lt;br /&gt;
|D8||216||EQV&lt;br /&gt;
|-&lt;br /&gt;
|D9||217||IMP&lt;br /&gt;
|-&lt;br /&gt;
|DA||218||MOD&lt;br /&gt;
|-&lt;br /&gt;
|DB||219||\&lt;br /&gt;
|-&lt;br /&gt;
|DC||220||&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|DD||221||=&lt;br /&gt;
|-&lt;br /&gt;
|DE||222||\|&lt;br /&gt;
|-&lt;br /&gt;
|DF||223||SGN&lt;br /&gt;
|-&lt;br /&gt;
|E0||224||INT&lt;br /&gt;
|-&lt;br /&gt;
|E1||225||ABS&lt;br /&gt;
|-&lt;br /&gt;
|E2||226||FRE&lt;br /&gt;
|-&lt;br /&gt;
|E3||227||INP&lt;br /&gt;
|-&lt;br /&gt;
|E4||228||LPOS&lt;br /&gt;
|-&lt;br /&gt;
|E5||229||POS&lt;br /&gt;
|-&lt;br /&gt;
|E6||230||SQR&lt;br /&gt;
|-&lt;br /&gt;
|E7||231||RND&lt;br /&gt;
|-&lt;br /&gt;
|E8||232||LOG&lt;br /&gt;
|-&lt;br /&gt;
|E9||233||EXP&lt;br /&gt;
|-&lt;br /&gt;
|EA||234||COS&lt;br /&gt;
|-&lt;br /&gt;
|EB||235||SIN&lt;br /&gt;
|-&lt;br /&gt;
|EC||236||TAN&lt;br /&gt;
|-&lt;br /&gt;
|ED||237||ATN&lt;br /&gt;
|-&lt;br /&gt;
|EE||238||PEEK&lt;br /&gt;
|-&lt;br /&gt;
|EF||239||EOF&lt;br /&gt;
|-&lt;br /&gt;
|F0||240||LOC&lt;br /&gt;
|-&lt;br /&gt;
|F1||241||LOF&lt;br /&gt;
|-&lt;br /&gt;
|F2||242||CINT&lt;br /&gt;
|-&lt;br /&gt;
|F3||243||CSNG&lt;br /&gt;
|-&lt;br /&gt;
|F4||244||CDBL&lt;br /&gt;
|-&lt;br /&gt;
|F5||245||FIX&lt;br /&gt;
|-&lt;br /&gt;
|F6||246||LEN&lt;br /&gt;
|-&lt;br /&gt;
|F7||247||STR$&lt;br /&gt;
|-&lt;br /&gt;
|F8||248||VAL&lt;br /&gt;
|-&lt;br /&gt;
|F9||249||ASC&lt;br /&gt;
|-&lt;br /&gt;
|FA||250||CHR$&lt;br /&gt;
|-&lt;br /&gt;
|FB||251||SPACE$&lt;br /&gt;
|-&lt;br /&gt;
|FC||252||LEFT$&lt;br /&gt;
|-&lt;br /&gt;
|FD||253||RIGHT$&lt;br /&gt;
|-&lt;br /&gt;
|FE||254||MID$&lt;br /&gt;
|-&lt;br /&gt;
|FF||255||' (QUOTE) || When tokenizing, the single quote character expands to three characters: a colon (3A), the byte for REM (8E), and then FF.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== File Format ==&lt;br /&gt;
&lt;br /&gt;
Tokenised BASIC code is a sequence of tokenized lines. Each tokenized line has the following format:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!Name!!Length!!Description&lt;br /&gt;
|-&lt;br /&gt;
|PL PH&lt;br /&gt;
|2 bytes&lt;br /&gt;
|Address of the next line in memory, little endian. This data can be ignored as it is only a placeholder. The value of PL PH in a file is moot because the address is recalculated every time the program loads. Once in memory, PL PH is used to skip to the line required for GOTO, GOSUB, and READ, thus speeding up the program. &lt;br /&gt;
|-&lt;br /&gt;
|LL LH&lt;br /&gt;
|2 bytes&lt;br /&gt;
|Line number, little endian.&lt;br /&gt;
|-&lt;br /&gt;
|B0 … BN&lt;br /&gt;
|Any number&lt;br /&gt;
|Sequence of tokens or ASCII characters. If a character's value is ≥ 128, then it is a token. All tokens are a single byte. &lt;br /&gt;
|-&lt;br /&gt;
|NULL&lt;br /&gt;
|1 byte&lt;br /&gt;
|NULL byte (`0x00`) to signal end of line. &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Format documentation ==&lt;br /&gt;
&lt;br /&gt;
* [https://m100.bitchin100.narkive.com/eP2uSl4J/tokenized-basic-programs-bytes-of-mystery Discussion of byte format on Bitchin 100 Mailing List]&lt;br /&gt;
* [http://www.club100.org/library/ups/tokens.do BASIC program to create a table of tokens]&lt;br /&gt;
&lt;br /&gt;
== Other links ==&lt;br /&gt;
&lt;br /&gt;
* [https://github.com/hackerb9/tokenize/ Hackerb9's simple program for tokenizing BASIC code]&lt;br /&gt;
* [https://sourceforge.net/projects/virtualt/ A Tandy 200 &amp;amp; Model 100/102 emulator]&lt;br /&gt;
* [http://bitchin100.com/CloudT/ A TRS-80 Model 100 emulator that runs in a web browser]&lt;br /&gt;
&lt;br /&gt;
[[Category:Microsoft]]&lt;/div&gt;</summary>
		<author><name>Hackerb9</name></author>	</entry>

	<entry>
		<id>http://fileformats.archiveteam.org/wiki/Tandy_200_BASIC_tokenized_file</id>
		<title>Tandy 200 BASIC tokenized file</title>
		<link rel="alternate" type="text/html" href="http://fileformats.archiveteam.org/wiki/Tandy_200_BASIC_tokenized_file"/>
				<updated>2022-08-21T09:26:07Z</updated>
		
		<summary type="html">&lt;p&gt;Hackerb9: /* Tokens */ colon is 3A&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{FormatInfo&lt;br /&gt;
|subcat=Source code&lt;br /&gt;
|subcat2=Tokenized BASIC&lt;br /&gt;
|released=1984&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
'''Tandy 200 BASIC''' was a version of Microsoft BASIC for the Radio Shack Tandy 200 computer. The tokenization for the TRS-80 Model 100/102 and NEC PC-8201/8300 should be similar, if not identical.&lt;br /&gt;
&lt;br /&gt;
== Tokens ==&lt;br /&gt;
&lt;br /&gt;
Blank values indicate either that the token is unused or is used for something unknown.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! title=&amp;quot;Hexadecimal code point&amp;quot; | Hex&lt;br /&gt;
! title=&amp;quot;Decimal code point&amp;quot; | Dec&lt;br /&gt;
! title=&amp;quot;BASIC element the token stands for&amp;quot; | Token meaning &lt;br /&gt;
! title=&amp;quot;Miscellany&amp;quot; | Notes&lt;br /&gt;
|-&lt;br /&gt;
|-&lt;br /&gt;
|80||128||END&lt;br /&gt;
|-&lt;br /&gt;
|81||129||FOR&lt;br /&gt;
|-&lt;br /&gt;
|82||130||NEXT&lt;br /&gt;
|-&lt;br /&gt;
|83||131||DATA&lt;br /&gt;
|-&lt;br /&gt;
|84||132||INPUT&lt;br /&gt;
|-&lt;br /&gt;
|85||133||DIM&lt;br /&gt;
|-&lt;br /&gt;
|86||134||READ&lt;br /&gt;
|-&lt;br /&gt;
|87||135||LET&lt;br /&gt;
|-&lt;br /&gt;
|88||136||GOTO&lt;br /&gt;
|-&lt;br /&gt;
|89||137||RUN&lt;br /&gt;
|-&lt;br /&gt;
|8A||138||IF&lt;br /&gt;
|-&lt;br /&gt;
|8B||139||RESTORE&lt;br /&gt;
|-&lt;br /&gt;
|8C||140||GOSUB&lt;br /&gt;
|-&lt;br /&gt;
|8D||141||RETURN&lt;br /&gt;
|-&lt;br /&gt;
|8E||142||REM&lt;br /&gt;
|-&lt;br /&gt;
|8F||143||STOP&lt;br /&gt;
|-&lt;br /&gt;
|90||144||WIDTH&lt;br /&gt;
|-&lt;br /&gt;
|91||145||ELSE||When tokenizing, the Tandy 200 always adds a colon (':') before the ELSE token (3A 91). If the user actually writes :ELSE it is tokenized as 3A 3A 91.&lt;br /&gt;
|-&lt;br /&gt;
|92||146||LINE&lt;br /&gt;
|-&lt;br /&gt;
|93||147||EDIT&lt;br /&gt;
|-&lt;br /&gt;
|94||148||ERROR&lt;br /&gt;
|-&lt;br /&gt;
|95||149||RESUME&lt;br /&gt;
|-&lt;br /&gt;
|96||150||OUT&lt;br /&gt;
|-&lt;br /&gt;
|97||151||ON&lt;br /&gt;
|-&lt;br /&gt;
|98||152||DSKO$&lt;br /&gt;
|-&lt;br /&gt;
|99||153||OPEN&lt;br /&gt;
|-&lt;br /&gt;
|9A||154||CLOSE&lt;br /&gt;
|-&lt;br /&gt;
|9B||155||LOAD||Note that LOADM is simply the token for LOAD followed by an ASCII 'M'. &lt;br /&gt;
|-&lt;br /&gt;
|9C||156||MERGE&lt;br /&gt;
|-QUOTE&lt;br /&gt;
|9D||157||FILES&lt;br /&gt;
|-&lt;br /&gt;
|9E||158||SAVE&lt;br /&gt;
|-&lt;br /&gt;
|9F||159||LFILES&lt;br /&gt;
|-&lt;br /&gt;
|A0||160||LPRINT&lt;br /&gt;
|-&lt;br /&gt;
|A1||161||DEF&lt;br /&gt;
|-&lt;br /&gt;
|A2||162||POKE&lt;br /&gt;
|-&lt;br /&gt;
|A3||163||PRINT&lt;br /&gt;
|-&lt;br /&gt;
|A4||164||CONT&lt;br /&gt;
|-&lt;br /&gt;
|A5||165||LIST&lt;br /&gt;
|-&lt;br /&gt;
|A6||166||LLIST&lt;br /&gt;
|-&lt;br /&gt;
|A7||167||CLEAR&lt;br /&gt;
|-&lt;br /&gt;
|A8||168||CLOAD&lt;br /&gt;
|-&lt;br /&gt;
|A9||169||CSAVE&lt;br /&gt;
|-&lt;br /&gt;
|AA||170||TIME$&lt;br /&gt;
|-&lt;br /&gt;
|AB||171||DATE$&lt;br /&gt;
|-&lt;br /&gt;
|AC||172||DAY$&lt;br /&gt;
|-&lt;br /&gt;
|AD||173||COM&lt;br /&gt;
|-&lt;br /&gt;
|AE||174||MDM&lt;br /&gt;
|-&lt;br /&gt;
|AF||175||KEY&lt;br /&gt;
|-&lt;br /&gt;
|B0||176||CLS&lt;br /&gt;
|-&lt;br /&gt;
|B1||177||BEEP&lt;br /&gt;
|-&lt;br /&gt;
|B2||178||SOUND&lt;br /&gt;
|-&lt;br /&gt;
|B3||179||LCOPY&lt;br /&gt;
|-&lt;br /&gt;
|B4||180||PSET&lt;br /&gt;
|-&lt;br /&gt;
|B5||181||PRESET&lt;br /&gt;
|-&lt;br /&gt;
|B6||182||MOTOR&lt;br /&gt;
|-&lt;br /&gt;
|B7||183||MAX&lt;br /&gt;
|-&lt;br /&gt;
|B8||184||POWER&lt;br /&gt;
|-&lt;br /&gt;
|B9||185||CALL&lt;br /&gt;
|-&lt;br /&gt;
|BA||186||MENU&lt;br /&gt;
|-&lt;br /&gt;
|BB||187||IPL&lt;br /&gt;
|-&lt;br /&gt;
|BC||188||NAME&lt;br /&gt;
|-&lt;br /&gt;
|BD||189||KILL&lt;br /&gt;
|-&lt;br /&gt;
|BE||190||SCREEN&lt;br /&gt;
|-&lt;br /&gt;
|BF||191||NEW&lt;br /&gt;
|-&lt;br /&gt;
|C0||192||TAB(&lt;br /&gt;
|-&lt;br /&gt;
|C1||193||TO&lt;br /&gt;
|-&lt;br /&gt;
|C2||194||USING&lt;br /&gt;
|-&lt;br /&gt;
|C3||195||VARPTR&lt;br /&gt;
|-&lt;br /&gt;
|C4||196||ERL&lt;br /&gt;
|-&lt;br /&gt;
|C5||197||ERR&lt;br /&gt;
|-&lt;br /&gt;
|C6||198||STRING$&lt;br /&gt;
|-&lt;br /&gt;
|C7||199||INSTR&lt;br /&gt;
|-&lt;br /&gt;
|C8||200||DSKI$&lt;br /&gt;
|-&lt;br /&gt;
|C9||201||INKEY$&lt;br /&gt;
|-&lt;br /&gt;
|CA||202||CSRLIN&lt;br /&gt;
|-&lt;br /&gt;
|CB||203||OFF&lt;br /&gt;
|-&lt;br /&gt;
|CC||204||HIMEM&lt;br /&gt;
|-&lt;br /&gt;
|CD||205||THEN&lt;br /&gt;
|-&lt;br /&gt;
|CE||206||NOT&lt;br /&gt;
|-&lt;br /&gt;
|CF||207||STEP&lt;br /&gt;
|-&lt;br /&gt;
|D0||208||+&lt;br /&gt;
|-&lt;br /&gt;
|D1||209||-&lt;br /&gt;
|-&lt;br /&gt;
|D2||210||*&lt;br /&gt;
|-&lt;br /&gt;
|D3||211||/&lt;br /&gt;
|-&lt;br /&gt;
|D4||212||^&lt;br /&gt;
|-&lt;br /&gt;
|D5||213||AND&lt;br /&gt;
|-&lt;br /&gt;
|D6||214||OR&lt;br /&gt;
|-&lt;br /&gt;
|D7||215||XOR&lt;br /&gt;
|-&lt;br /&gt;
|D8||216||EQV&lt;br /&gt;
|-&lt;br /&gt;
|D9||217||IMP&lt;br /&gt;
|-&lt;br /&gt;
|DA||218||MOD&lt;br /&gt;
|-&lt;br /&gt;
|DB||219||\&lt;br /&gt;
|-&lt;br /&gt;
|DC||220||&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|DD||221||=&lt;br /&gt;
|-&lt;br /&gt;
|DE||222||\|&lt;br /&gt;
|-&lt;br /&gt;
|DF||223||SGN&lt;br /&gt;
|-&lt;br /&gt;
|E0||224||INT&lt;br /&gt;
|-&lt;br /&gt;
|E1||225||ABS&lt;br /&gt;
|-&lt;br /&gt;
|E2||226||FRE&lt;br /&gt;
|-&lt;br /&gt;
|E3||227||INP&lt;br /&gt;
|-&lt;br /&gt;
|E4||228||LPOS&lt;br /&gt;
|-&lt;br /&gt;
|E5||229||POS&lt;br /&gt;
|-&lt;br /&gt;
|E6||230||SQR&lt;br /&gt;
|-&lt;br /&gt;
|E7||231||RND&lt;br /&gt;
|-&lt;br /&gt;
|E8||232||LOG&lt;br /&gt;
|-&lt;br /&gt;
|E9||233||EXP&lt;br /&gt;
|-&lt;br /&gt;
|EA||234||COS&lt;br /&gt;
|-&lt;br /&gt;
|EB||235||SIN&lt;br /&gt;
|-&lt;br /&gt;
|EC||236||TAN&lt;br /&gt;
|-&lt;br /&gt;
|ED||237||ATN&lt;br /&gt;
|-&lt;br /&gt;
|EE||238||PEEK&lt;br /&gt;
|-&lt;br /&gt;
|EF||239||EOF&lt;br /&gt;
|-&lt;br /&gt;
|F0||240||LOC&lt;br /&gt;
|-&lt;br /&gt;
|F1||241||LOF&lt;br /&gt;
|-&lt;br /&gt;
|F2||242||CINT&lt;br /&gt;
|-&lt;br /&gt;
|F3||243||CSNG&lt;br /&gt;
|-&lt;br /&gt;
|F4||244||CDBL&lt;br /&gt;
|-&lt;br /&gt;
|F5||245||FIX&lt;br /&gt;
|-&lt;br /&gt;
|F6||246||LEN&lt;br /&gt;
|-&lt;br /&gt;
|F7||247||STR$&lt;br /&gt;
|-&lt;br /&gt;
|F8||248||VAL&lt;br /&gt;
|-&lt;br /&gt;
|F9||249||ASC&lt;br /&gt;
|-&lt;br /&gt;
|FA||250||CHR$&lt;br /&gt;
|-&lt;br /&gt;
|FB||251||SPACE$&lt;br /&gt;
|-&lt;br /&gt;
|FC||252||LEFT$&lt;br /&gt;
|-&lt;br /&gt;
|FD||253||RIGHT$&lt;br /&gt;
|-&lt;br /&gt;
|FE||254||MID$&lt;br /&gt;
|-&lt;br /&gt;
|FF||255||' (QUOTE) || When tokenizing, the single quote character expands to three characters: a colon (3A), the byte for REM (8E), and then FF.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== File Format ==&lt;br /&gt;
&lt;br /&gt;
Tokenised BASIC code is a sequence of tokenized lines. Each tokenized line has the following format:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!Name!!Length!!Description&lt;br /&gt;
|-&lt;br /&gt;
|PL PH&lt;br /&gt;
|2 bytes&lt;br /&gt;
|Address of the next line in memory, little endian. This data can be ignored as it is only a placeholder. The value of PL PH in a file is moot because the address is recalculated every time the program loads. Once in memory, PL PH is used to skip to the line required for GOTO, GOSUB, and READ, thus speeding up the program. &lt;br /&gt;
|-&lt;br /&gt;
|LL LH&lt;br /&gt;
|2 bytes&lt;br /&gt;
|Line number, little endian.&lt;br /&gt;
|-&lt;br /&gt;
|B0 … BN&lt;br /&gt;
|Any number&lt;br /&gt;
|Sequence of tokens or ASCII characters. If a character's value is ≥ 128, then it is a token. All tokens are a single byte. &lt;br /&gt;
|-&lt;br /&gt;
|NULL&lt;br /&gt;
|1 byte&lt;br /&gt;
|NULL byte (`0x00`) to signal end of line. &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Format documentation ==&lt;br /&gt;
&lt;br /&gt;
* [https://m100.bitchin100.narkive.com/eP2uSl4J/tokenized-basic-programs-bytes-of-mystery Discussion of byte format on Bitchin 100 Mailing List]&lt;br /&gt;
* [http://www.club100.org/library/ups/tokens.do BASIC program to create a table of tokens]&lt;br /&gt;
&lt;br /&gt;
== Other links ==&lt;br /&gt;
&lt;br /&gt;
* [https://github.com/hackerb9/tokenize/ Hackerb9's simple program for tokenizing BASIC code]&lt;br /&gt;
* [https://sourceforge.net/projects/virtualt/ A Tandy 200 &amp;amp; Model 100/102 emulator]&lt;br /&gt;
* [http://bitchin100.com/CloudT/ A TRS-80 Model 100 emulator that runs in a web browser]&lt;br /&gt;
&lt;br /&gt;
[[Category:Microsoft]]&lt;/div&gt;</summary>
		<author><name>Hackerb9</name></author>	</entry>

	<entry>
		<id>http://fileformats.archiveteam.org/wiki/Tandy_200_BASIC_tokenized_file</id>
		<title>Tandy 200 BASIC tokenized file</title>
		<link rel="alternate" type="text/html" href="http://fileformats.archiveteam.org/wiki/Tandy_200_BASIC_tokenized_file"/>
				<updated>2022-08-21T09:24:20Z</updated>
		
		<summary type="html">&lt;p&gt;Hackerb9: /* Tokens */ clarify :ELSE behaviour&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{FormatInfo&lt;br /&gt;
|subcat=Source code&lt;br /&gt;
|subcat2=Tokenized BASIC&lt;br /&gt;
|released=1984&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
'''Tandy 200 BASIC''' was a version of Microsoft BASIC for the Radio Shack Tandy 200 computer. The tokenization for the TRS-80 Model 100/102 and NEC PC-8201/8300 should be similar, if not identical.&lt;br /&gt;
&lt;br /&gt;
== Tokens ==&lt;br /&gt;
&lt;br /&gt;
Blank values indicate either that the token is unused or is used for something unknown.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! title=&amp;quot;Hexadecimal code point&amp;quot; | Hex&lt;br /&gt;
! title=&amp;quot;Decimal code point&amp;quot; | Dec&lt;br /&gt;
! title=&amp;quot;BASIC element the token stands for&amp;quot; | Token meaning &lt;br /&gt;
! title=&amp;quot;Miscellany&amp;quot; | Notes&lt;br /&gt;
|-&lt;br /&gt;
|-&lt;br /&gt;
|80||128||END&lt;br /&gt;
|-&lt;br /&gt;
|81||129||FOR&lt;br /&gt;
|-&lt;br /&gt;
|82||130||NEXT&lt;br /&gt;
|-&lt;br /&gt;
|83||131||DATA&lt;br /&gt;
|-&lt;br /&gt;
|84||132||INPUT&lt;br /&gt;
|-&lt;br /&gt;
|85||133||DIM&lt;br /&gt;
|-&lt;br /&gt;
|86||134||READ&lt;br /&gt;
|-&lt;br /&gt;
|87||135||LET&lt;br /&gt;
|-&lt;br /&gt;
|88||136||GOTO&lt;br /&gt;
|-&lt;br /&gt;
|89||137||RUN&lt;br /&gt;
|-&lt;br /&gt;
|8A||138||IF&lt;br /&gt;
|-&lt;br /&gt;
|8B||139||RESTORE&lt;br /&gt;
|-&lt;br /&gt;
|8C||140||GOSUB&lt;br /&gt;
|-&lt;br /&gt;
|8D||141||RETURN&lt;br /&gt;
|-&lt;br /&gt;
|8E||142||REM&lt;br /&gt;
|-&lt;br /&gt;
|8F||143||STOP&lt;br /&gt;
|-&lt;br /&gt;
|90||144||WIDTH&lt;br /&gt;
|-&lt;br /&gt;
|91||145||ELSE||When tokenizing, the Tandy 200 always adds a colon (':') before the ELSE token (3A 91). If the user actually writes :ELSE it is tokenized as 3A 3A 91.&lt;br /&gt;
|-&lt;br /&gt;
|92||146||LINE&lt;br /&gt;
|-&lt;br /&gt;
|93||147||EDIT&lt;br /&gt;
|-&lt;br /&gt;
|94||148||ERROR&lt;br /&gt;
|-&lt;br /&gt;
|95||149||RESUME&lt;br /&gt;
|-&lt;br /&gt;
|96||150||OUT&lt;br /&gt;
|-&lt;br /&gt;
|97||151||ON&lt;br /&gt;
|-&lt;br /&gt;
|98||152||DSKO$&lt;br /&gt;
|-&lt;br /&gt;
|99||153||OPEN&lt;br /&gt;
|-&lt;br /&gt;
|9A||154||CLOSE&lt;br /&gt;
|-&lt;br /&gt;
|9B||155||LOAD||Note that LOADM is simply the token for LOAD followed by an ASCII 'M'. &lt;br /&gt;
|-&lt;br /&gt;
|9C||156||MERGE&lt;br /&gt;
|-QUOTE&lt;br /&gt;
|9D||157||FILES&lt;br /&gt;
|-&lt;br /&gt;
|9E||158||SAVE&lt;br /&gt;
|-&lt;br /&gt;
|9F||159||LFILES&lt;br /&gt;
|-&lt;br /&gt;
|A0||160||LPRINT&lt;br /&gt;
|-&lt;br /&gt;
|A1||161||DEF&lt;br /&gt;
|-&lt;br /&gt;
|A2||162||POKE&lt;br /&gt;
|-&lt;br /&gt;
|A3||163||PRINT&lt;br /&gt;
|-&lt;br /&gt;
|A4||164||CONT&lt;br /&gt;
|-&lt;br /&gt;
|A5||165||LIST&lt;br /&gt;
|-&lt;br /&gt;
|A6||166||LLIST&lt;br /&gt;
|-&lt;br /&gt;
|A7||167||CLEAR&lt;br /&gt;
|-&lt;br /&gt;
|A8||168||CLOAD&lt;br /&gt;
|-&lt;br /&gt;
|A9||169||CSAVE&lt;br /&gt;
|-&lt;br /&gt;
|AA||170||TIME$&lt;br /&gt;
|-&lt;br /&gt;
|AB||171||DATE$&lt;br /&gt;
|-&lt;br /&gt;
|AC||172||DAY$&lt;br /&gt;
|-&lt;br /&gt;
|AD||173||COM&lt;br /&gt;
|-&lt;br /&gt;
|AE||174||MDM&lt;br /&gt;
|-&lt;br /&gt;
|AF||175||KEY&lt;br /&gt;
|-&lt;br /&gt;
|B0||176||CLS&lt;br /&gt;
|-&lt;br /&gt;
|B1||177||BEEP&lt;br /&gt;
|-&lt;br /&gt;
|B2||178||SOUND&lt;br /&gt;
|-&lt;br /&gt;
|B3||179||LCOPY&lt;br /&gt;
|-&lt;br /&gt;
|B4||180||PSET&lt;br /&gt;
|-&lt;br /&gt;
|B5||181||PRESET&lt;br /&gt;
|-&lt;br /&gt;
|B6||182||MOTOR&lt;br /&gt;
|-&lt;br /&gt;
|B7||183||MAX&lt;br /&gt;
|-&lt;br /&gt;
|B8||184||POWER&lt;br /&gt;
|-&lt;br /&gt;
|B9||185||CALL&lt;br /&gt;
|-&lt;br /&gt;
|BA||186||MENU&lt;br /&gt;
|-&lt;br /&gt;
|BB||187||IPL&lt;br /&gt;
|-&lt;br /&gt;
|BC||188||NAME&lt;br /&gt;
|-&lt;br /&gt;
|BD||189||KILL&lt;br /&gt;
|-&lt;br /&gt;
|BE||190||SCREEN&lt;br /&gt;
|-&lt;br /&gt;
|BF||191||NEW&lt;br /&gt;
|-&lt;br /&gt;
|C0||192||TAB(&lt;br /&gt;
|-&lt;br /&gt;
|C1||193||TO&lt;br /&gt;
|-&lt;br /&gt;
|C2||194||USING&lt;br /&gt;
|-&lt;br /&gt;
|C3||195||VARPTR&lt;br /&gt;
|-&lt;br /&gt;
|C4||196||ERL&lt;br /&gt;
|-&lt;br /&gt;
|C5||197||ERR&lt;br /&gt;
|-&lt;br /&gt;
|C6||198||STRING$&lt;br /&gt;
|-&lt;br /&gt;
|C7||199||INSTR&lt;br /&gt;
|-&lt;br /&gt;
|C8||200||DSKI$&lt;br /&gt;
|-&lt;br /&gt;
|C9||201||INKEY$&lt;br /&gt;
|-&lt;br /&gt;
|CA||202||CSRLIN&lt;br /&gt;
|-&lt;br /&gt;
|CB||203||OFF&lt;br /&gt;
|-&lt;br /&gt;
|CC||204||HIMEM&lt;br /&gt;
|-&lt;br /&gt;
|CD||205||THEN&lt;br /&gt;
|-&lt;br /&gt;
|CE||206||NOT&lt;br /&gt;
|-&lt;br /&gt;
|CF||207||STEP&lt;br /&gt;
|-&lt;br /&gt;
|D0||208||+&lt;br /&gt;
|-&lt;br /&gt;
|D1||209||-&lt;br /&gt;
|-&lt;br /&gt;
|D2||210||*&lt;br /&gt;
|-&lt;br /&gt;
|D3||211||/&lt;br /&gt;
|-&lt;br /&gt;
|D4||212||^&lt;br /&gt;
|-&lt;br /&gt;
|D5||213||AND&lt;br /&gt;
|-&lt;br /&gt;
|D6||214||OR&lt;br /&gt;
|-&lt;br /&gt;
|D7||215||XOR&lt;br /&gt;
|-&lt;br /&gt;
|D8||216||EQV&lt;br /&gt;
|-&lt;br /&gt;
|D9||217||IMP&lt;br /&gt;
|-&lt;br /&gt;
|DA||218||MOD&lt;br /&gt;
|-&lt;br /&gt;
|DB||219||\&lt;br /&gt;
|-&lt;br /&gt;
|DC||220||&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|DD||221||=&lt;br /&gt;
|-&lt;br /&gt;
|DE||222||\|&lt;br /&gt;
|-&lt;br /&gt;
|DF||223||SGN&lt;br /&gt;
|-&lt;br /&gt;
|E0||224||INT&lt;br /&gt;
|-&lt;br /&gt;
|E1||225||ABS&lt;br /&gt;
|-&lt;br /&gt;
|E2||226||FRE&lt;br /&gt;
|-&lt;br /&gt;
|E3||227||INP&lt;br /&gt;
|-&lt;br /&gt;
|E4||228||LPOS&lt;br /&gt;
|-&lt;br /&gt;
|E5||229||POS&lt;br /&gt;
|-&lt;br /&gt;
|E6||230||SQR&lt;br /&gt;
|-&lt;br /&gt;
|E7||231||RND&lt;br /&gt;
|-&lt;br /&gt;
|E8||232||LOG&lt;br /&gt;
|-&lt;br /&gt;
|E9||233||EXP&lt;br /&gt;
|-&lt;br /&gt;
|EA||234||COS&lt;br /&gt;
|-&lt;br /&gt;
|EB||235||SIN&lt;br /&gt;
|-&lt;br /&gt;
|EC||236||TAN&lt;br /&gt;
|-&lt;br /&gt;
|ED||237||ATN&lt;br /&gt;
|-&lt;br /&gt;
|EE||238||PEEK&lt;br /&gt;
|-&lt;br /&gt;
|EF||239||EOF&lt;br /&gt;
|-&lt;br /&gt;
|F0||240||LOC&lt;br /&gt;
|-&lt;br /&gt;
|F1||241||LOF&lt;br /&gt;
|-&lt;br /&gt;
|F2||242||CINT&lt;br /&gt;
|-&lt;br /&gt;
|F3||243||CSNG&lt;br /&gt;
|-&lt;br /&gt;
|F4||244||CDBL&lt;br /&gt;
|-&lt;br /&gt;
|F5||245||FIX&lt;br /&gt;
|-&lt;br /&gt;
|F6||246||LEN&lt;br /&gt;
|-&lt;br /&gt;
|F7||247||STR$&lt;br /&gt;
|-&lt;br /&gt;
|F8||248||VAL&lt;br /&gt;
|-&lt;br /&gt;
|F9||249||ASC&lt;br /&gt;
|-&lt;br /&gt;
|FA||250||CHR$&lt;br /&gt;
|-&lt;br /&gt;
|FB||251||SPACE$&lt;br /&gt;
|-&lt;br /&gt;
|FC||252||LEFT$&lt;br /&gt;
|-&lt;br /&gt;
|FD||253||RIGHT$&lt;br /&gt;
|-&lt;br /&gt;
|FE||254||MID$&lt;br /&gt;
|-&lt;br /&gt;
|FF||255||' (QUOTE) || When tokenizing, the single quote character expands to three characters: a colon, the byte for REM (0x8E), and then 0xFF.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== File Format ==&lt;br /&gt;
&lt;br /&gt;
Tokenised BASIC code is a sequence of tokenized lines. Each tokenized line has the following format:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!Name!!Length!!Description&lt;br /&gt;
|-&lt;br /&gt;
|PL PH&lt;br /&gt;
|2 bytes&lt;br /&gt;
|Address of the next line in memory, little endian. This data can be ignored as it is only a placeholder. The value of PL PH in a file is moot because the address is recalculated every time the program loads. Once in memory, PL PH is used to skip to the line required for GOTO, GOSUB, and READ, thus speeding up the program. &lt;br /&gt;
|-&lt;br /&gt;
|LL LH&lt;br /&gt;
|2 bytes&lt;br /&gt;
|Line number, little endian.&lt;br /&gt;
|-&lt;br /&gt;
|B0 … BN&lt;br /&gt;
|Any number&lt;br /&gt;
|Sequence of tokens or ASCII characters. If a character's value is ≥ 128, then it is a token. All tokens are a single byte. &lt;br /&gt;
|-&lt;br /&gt;
|NULL&lt;br /&gt;
|1 byte&lt;br /&gt;
|NULL byte (`0x00`) to signal end of line. &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Format documentation ==&lt;br /&gt;
&lt;br /&gt;
* [https://m100.bitchin100.narkive.com/eP2uSl4J/tokenized-basic-programs-bytes-of-mystery Discussion of byte format on Bitchin 100 Mailing List]&lt;br /&gt;
* [http://www.club100.org/library/ups/tokens.do BASIC program to create a table of tokens]&lt;br /&gt;
&lt;br /&gt;
== Other links ==&lt;br /&gt;
&lt;br /&gt;
* [https://github.com/hackerb9/tokenize/ Hackerb9's simple program for tokenizing BASIC code]&lt;br /&gt;
* [https://sourceforge.net/projects/virtualt/ A Tandy 200 &amp;amp; Model 100/102 emulator]&lt;br /&gt;
* [http://bitchin100.com/CloudT/ A TRS-80 Model 100 emulator that runs in a web browser]&lt;br /&gt;
&lt;br /&gt;
[[Category:Microsoft]]&lt;/div&gt;</summary>
		<author><name>Hackerb9</name></author>	</entry>

	<entry>
		<id>http://fileformats.archiveteam.org/wiki/Tandy_200_BASIC_tokenized_file</id>
		<title>Tandy 200 BASIC tokenized file</title>
		<link rel="alternate" type="text/html" href="http://fileformats.archiveteam.org/wiki/Tandy_200_BASIC_tokenized_file"/>
				<updated>2022-07-26T06:44:06Z</updated>
		
		<summary type="html">&lt;p&gt;Hackerb9: /* Other links */ Add link to tokenizer&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{FormatInfo&lt;br /&gt;
|subcat=Source code&lt;br /&gt;
|subcat2=Tokenized BASIC&lt;br /&gt;
|released=1984&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
'''Tandy 200 BASIC''' was a version of Microsoft BASIC for the Radio Shack Tandy 200 computer. The tokenization for the TRS-80 Model 100/102 and NEC PC-8201/8300 should be similar, if not identical.&lt;br /&gt;
&lt;br /&gt;
== Tokens ==&lt;br /&gt;
&lt;br /&gt;
Blank values indicate either that the token is unused or is used for something unknown.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! title=&amp;quot;Hexadecimal code point&amp;quot; | Hex&lt;br /&gt;
! title=&amp;quot;Decimal code point&amp;quot; | Dec&lt;br /&gt;
! title=&amp;quot;BASIC element the token stands for&amp;quot; | Token meaning &lt;br /&gt;
! title=&amp;quot;Miscellany&amp;quot; | Notes&lt;br /&gt;
|-&lt;br /&gt;
|-&lt;br /&gt;
|80||128||END&lt;br /&gt;
|-&lt;br /&gt;
|81||129||FOR&lt;br /&gt;
|-&lt;br /&gt;
|82||130||NEXT&lt;br /&gt;
|-&lt;br /&gt;
|83||131||DATA&lt;br /&gt;
|-&lt;br /&gt;
|84||132||INPUT&lt;br /&gt;
|-&lt;br /&gt;
|85||133||DIM&lt;br /&gt;
|-&lt;br /&gt;
|86||134||READ&lt;br /&gt;
|-&lt;br /&gt;
|87||135||LET&lt;br /&gt;
|-&lt;br /&gt;
|88||136||GOTO&lt;br /&gt;
|-&lt;br /&gt;
|89||137||RUN&lt;br /&gt;
|-&lt;br /&gt;
|8A||138||IF&lt;br /&gt;
|-&lt;br /&gt;
|8B||139||RESTORE&lt;br /&gt;
|-&lt;br /&gt;
|8C||140||GOSUB&lt;br /&gt;
|-&lt;br /&gt;
|8D||141||RETURN&lt;br /&gt;
|-&lt;br /&gt;
|8E||142||REM&lt;br /&gt;
|-&lt;br /&gt;
|8F||143||STOP&lt;br /&gt;
|-&lt;br /&gt;
|90||144||WIDTH&lt;br /&gt;
|-&lt;br /&gt;
|91||145||ELSE||When tokenizing, the Tandy 200 always adds a colon (':') before the ELSE token&lt;br /&gt;
|-&lt;br /&gt;
|92||146||LINE&lt;br /&gt;
|-&lt;br /&gt;
|93||147||EDIT&lt;br /&gt;
|-&lt;br /&gt;
|94||148||ERROR&lt;br /&gt;
|-&lt;br /&gt;
|95||149||RESUME&lt;br /&gt;
|-&lt;br /&gt;
|96||150||OUT&lt;br /&gt;
|-&lt;br /&gt;
|97||151||ON&lt;br /&gt;
|-&lt;br /&gt;
|98||152||DSKO$&lt;br /&gt;
|-&lt;br /&gt;
|99||153||OPEN&lt;br /&gt;
|-&lt;br /&gt;
|9A||154||CLOSE&lt;br /&gt;
|-&lt;br /&gt;
|9B||155||LOAD||Note that LOADM is simply the token for LOAD followed by an ASCII 'M'. &lt;br /&gt;
|-&lt;br /&gt;
|9C||156||MERGE&lt;br /&gt;
|-QUOTE&lt;br /&gt;
|9D||157||FILES&lt;br /&gt;
|-&lt;br /&gt;
|9E||158||SAVE&lt;br /&gt;
|-&lt;br /&gt;
|9F||159||LFILES&lt;br /&gt;
|-&lt;br /&gt;
|A0||160||LPRINT&lt;br /&gt;
|-&lt;br /&gt;
|A1||161||DEF&lt;br /&gt;
|-&lt;br /&gt;
|A2||162||POKE&lt;br /&gt;
|-&lt;br /&gt;
|A3||163||PRINT&lt;br /&gt;
|-&lt;br /&gt;
|A4||164||CONT&lt;br /&gt;
|-&lt;br /&gt;
|A5||165||LIST&lt;br /&gt;
|-&lt;br /&gt;
|A6||166||LLIST&lt;br /&gt;
|-&lt;br /&gt;
|A7||167||CLEAR&lt;br /&gt;
|-&lt;br /&gt;
|A8||168||CLOAD&lt;br /&gt;
|-&lt;br /&gt;
|A9||169||CSAVE&lt;br /&gt;
|-&lt;br /&gt;
|AA||170||TIME$&lt;br /&gt;
|-&lt;br /&gt;
|AB||171||DATE$&lt;br /&gt;
|-&lt;br /&gt;
|AC||172||DAY$&lt;br /&gt;
|-&lt;br /&gt;
|AD||173||COM&lt;br /&gt;
|-&lt;br /&gt;
|AE||174||MDM&lt;br /&gt;
|-&lt;br /&gt;
|AF||175||KEY&lt;br /&gt;
|-&lt;br /&gt;
|B0||176||CLS&lt;br /&gt;
|-&lt;br /&gt;
|B1||177||BEEP&lt;br /&gt;
|-&lt;br /&gt;
|B2||178||SOUND&lt;br /&gt;
|-&lt;br /&gt;
|B3||179||LCOPY&lt;br /&gt;
|-&lt;br /&gt;
|B4||180||PSET&lt;br /&gt;
|-&lt;br /&gt;
|B5||181||PRESET&lt;br /&gt;
|-&lt;br /&gt;
|B6||182||MOTOR&lt;br /&gt;
|-&lt;br /&gt;
|B7||183||MAX&lt;br /&gt;
|-&lt;br /&gt;
|B8||184||POWER&lt;br /&gt;
|-&lt;br /&gt;
|B9||185||CALL&lt;br /&gt;
|-&lt;br /&gt;
|BA||186||MENU&lt;br /&gt;
|-&lt;br /&gt;
|BB||187||IPL&lt;br /&gt;
|-&lt;br /&gt;
|BC||188||NAME&lt;br /&gt;
|-&lt;br /&gt;
|BD||189||KILL&lt;br /&gt;
|-&lt;br /&gt;
|BE||190||SCREEN&lt;br /&gt;
|-&lt;br /&gt;
|BF||191||NEW&lt;br /&gt;
|-&lt;br /&gt;
|C0||192||TAB(&lt;br /&gt;
|-&lt;br /&gt;
|C1||193||TO&lt;br /&gt;
|-&lt;br /&gt;
|C2||194||USING&lt;br /&gt;
|-&lt;br /&gt;
|C3||195||VARPTR&lt;br /&gt;
|-&lt;br /&gt;
|C4||196||ERL&lt;br /&gt;
|-&lt;br /&gt;
|C5||197||ERR&lt;br /&gt;
|-&lt;br /&gt;
|C6||198||STRING$&lt;br /&gt;
|-&lt;br /&gt;
|C7||199||INSTR&lt;br /&gt;
|-&lt;br /&gt;
|C8||200||DSKI$&lt;br /&gt;
|-&lt;br /&gt;
|C9||201||INKEY$&lt;br /&gt;
|-&lt;br /&gt;
|CA||202||CSRLIN&lt;br /&gt;
|-&lt;br /&gt;
|CB||203||OFF&lt;br /&gt;
|-&lt;br /&gt;
|CC||204||HIMEM&lt;br /&gt;
|-&lt;br /&gt;
|CD||205||THEN&lt;br /&gt;
|-&lt;br /&gt;
|CE||206||NOT&lt;br /&gt;
|-&lt;br /&gt;
|CF||207||STEP&lt;br /&gt;
|-&lt;br /&gt;
|D0||208||+&lt;br /&gt;
|-&lt;br /&gt;
|D1||209||-&lt;br /&gt;
|-&lt;br /&gt;
|D2||210||*&lt;br /&gt;
|-&lt;br /&gt;
|D3||211||/&lt;br /&gt;
|-&lt;br /&gt;
|D4||212||^&lt;br /&gt;
|-&lt;br /&gt;
|D5||213||AND&lt;br /&gt;
|-&lt;br /&gt;
|D6||214||OR&lt;br /&gt;
|-&lt;br /&gt;
|D7||215||XOR&lt;br /&gt;
|-&lt;br /&gt;
|D8||216||EQV&lt;br /&gt;
|-&lt;br /&gt;
|D9||217||IMP&lt;br /&gt;
|-&lt;br /&gt;
|DA||218||MOD&lt;br /&gt;
|-&lt;br /&gt;
|DB||219||\&lt;br /&gt;
|-&lt;br /&gt;
|DC||220||&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|DD||221||=&lt;br /&gt;
|-&lt;br /&gt;
|DE||222||\|&lt;br /&gt;
|-&lt;br /&gt;
|DF||223||SGN&lt;br /&gt;
|-&lt;br /&gt;
|E0||224||INT&lt;br /&gt;
|-&lt;br /&gt;
|E1||225||ABS&lt;br /&gt;
|-&lt;br /&gt;
|E2||226||FRE&lt;br /&gt;
|-&lt;br /&gt;
|E3||227||INP&lt;br /&gt;
|-&lt;br /&gt;
|E4||228||LPOS&lt;br /&gt;
|-&lt;br /&gt;
|E5||229||POS&lt;br /&gt;
|-&lt;br /&gt;
|E6||230||SQR&lt;br /&gt;
|-&lt;br /&gt;
|E7||231||RND&lt;br /&gt;
|-&lt;br /&gt;
|E8||232||LOG&lt;br /&gt;
|-&lt;br /&gt;
|E9||233||EXP&lt;br /&gt;
|-&lt;br /&gt;
|EA||234||COS&lt;br /&gt;
|-&lt;br /&gt;
|EB||235||SIN&lt;br /&gt;
|-&lt;br /&gt;
|EC||236||TAN&lt;br /&gt;
|-&lt;br /&gt;
|ED||237||ATN&lt;br /&gt;
|-&lt;br /&gt;
|EE||238||PEEK&lt;br /&gt;
|-&lt;br /&gt;
|EF||239||EOF&lt;br /&gt;
|-&lt;br /&gt;
|F0||240||LOC&lt;br /&gt;
|-&lt;br /&gt;
|F1||241||LOF&lt;br /&gt;
|-&lt;br /&gt;
|F2||242||CINT&lt;br /&gt;
|-&lt;br /&gt;
|F3||243||CSNG&lt;br /&gt;
|-&lt;br /&gt;
|F4||244||CDBL&lt;br /&gt;
|-&lt;br /&gt;
|F5||245||FIX&lt;br /&gt;
|-&lt;br /&gt;
|F6||246||LEN&lt;br /&gt;
|-&lt;br /&gt;
|F7||247||STR$&lt;br /&gt;
|-&lt;br /&gt;
|F8||248||VAL&lt;br /&gt;
|-&lt;br /&gt;
|F9||249||ASC&lt;br /&gt;
|-&lt;br /&gt;
|FA||250||CHR$&lt;br /&gt;
|-&lt;br /&gt;
|FB||251||SPACE$&lt;br /&gt;
|-&lt;br /&gt;
|FC||252||LEFT$&lt;br /&gt;
|-&lt;br /&gt;
|FD||253||RIGHT$&lt;br /&gt;
|-&lt;br /&gt;
|FE||254||MID$&lt;br /&gt;
|-&lt;br /&gt;
|FF||255||' (QUOTE) || When tokenizing, the single quote character expands to three characters: a colon, the byte for REM (0x8E), and then 0xFF.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== File Format ==&lt;br /&gt;
&lt;br /&gt;
Tokenised BASIC code is a sequence of tokenized lines. Each tokenized line has the following format:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!Name!!Length!!Description&lt;br /&gt;
|-&lt;br /&gt;
|PL PH&lt;br /&gt;
|2 bytes&lt;br /&gt;
|Address of the next line in memory, little endian. This data can be ignored as it is only a placeholder. The value of PL PH in a file is moot because the address is recalculated every time the program loads. Once in memory, PL PH is used to skip to the line required for GOTO, GOSUB, and READ, thus speeding up the program. &lt;br /&gt;
|-&lt;br /&gt;
|LL LH&lt;br /&gt;
|2 bytes&lt;br /&gt;
|Line number, little endian.&lt;br /&gt;
|-&lt;br /&gt;
|B0 … BN&lt;br /&gt;
|Any number&lt;br /&gt;
|Sequence of tokens or ASCII characters. If a character's value is ≥ 128, then it is a token. All tokens are a single byte. &lt;br /&gt;
|-&lt;br /&gt;
|NULL&lt;br /&gt;
|1 byte&lt;br /&gt;
|NULL byte (`0x00`) to signal end of line. &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Format documentation ==&lt;br /&gt;
&lt;br /&gt;
* [https://m100.bitchin100.narkive.com/eP2uSl4J/tokenized-basic-programs-bytes-of-mystery Discussion of byte format on Bitchin 100 Mailing List]&lt;br /&gt;
* [http://www.club100.org/library/ups/tokens.do BASIC program to create a table of tokens]&lt;br /&gt;
&lt;br /&gt;
== Other links ==&lt;br /&gt;
&lt;br /&gt;
* [https://github.com/hackerb9/tokenize/ Hackerb9's simple program for tokenizing BASIC code]&lt;br /&gt;
* [https://sourceforge.net/projects/virtualt/ A Tandy 200 &amp;amp; Model 100/102 emulator]&lt;br /&gt;
* [http://bitchin100.com/CloudT/ A TRS-80 Model 100 emulator that runs in a web browser]&lt;br /&gt;
&lt;br /&gt;
[[Category:Microsoft]]&lt;/div&gt;</summary>
		<author><name>Hackerb9</name></author>	</entry>

	<entry>
		<id>http://fileformats.archiveteam.org/wiki/Tandy_200_BASIC_tokenized_file</id>
		<title>Tandy 200 BASIC tokenized file</title>
		<link rel="alternate" type="text/html" href="http://fileformats.archiveteam.org/wiki/Tandy_200_BASIC_tokenized_file"/>
				<updated>2022-07-26T06:38:09Z</updated>
		
		<summary type="html">&lt;p&gt;Hackerb9: /* Tokens */ Add notes for oddly behaving tokens (ELSE, LOADM, single quote)&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{FormatInfo&lt;br /&gt;
|subcat=Source code&lt;br /&gt;
|subcat2=Tokenized BASIC&lt;br /&gt;
|released=1984&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
'''Tandy 200 BASIC''' was a version of Microsoft BASIC for the Radio Shack Tandy 200 computer. The tokenization for the TRS-80 Model 100/102 and NEC PC-8201/8300 should be similar, if not identical.&lt;br /&gt;
&lt;br /&gt;
== Tokens ==&lt;br /&gt;
&lt;br /&gt;
Blank values indicate either that the token is unused or is used for something unknown.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! title=&amp;quot;Hexadecimal code point&amp;quot; | Hex&lt;br /&gt;
! title=&amp;quot;Decimal code point&amp;quot; | Dec&lt;br /&gt;
! title=&amp;quot;BASIC element the token stands for&amp;quot; | Token meaning &lt;br /&gt;
! title=&amp;quot;Miscellany&amp;quot; | Notes&lt;br /&gt;
|-&lt;br /&gt;
|-&lt;br /&gt;
|80||128||END&lt;br /&gt;
|-&lt;br /&gt;
|81||129||FOR&lt;br /&gt;
|-&lt;br /&gt;
|82||130||NEXT&lt;br /&gt;
|-&lt;br /&gt;
|83||131||DATA&lt;br /&gt;
|-&lt;br /&gt;
|84||132||INPUT&lt;br /&gt;
|-&lt;br /&gt;
|85||133||DIM&lt;br /&gt;
|-&lt;br /&gt;
|86||134||READ&lt;br /&gt;
|-&lt;br /&gt;
|87||135||LET&lt;br /&gt;
|-&lt;br /&gt;
|88||136||GOTO&lt;br /&gt;
|-&lt;br /&gt;
|89||137||RUN&lt;br /&gt;
|-&lt;br /&gt;
|8A||138||IF&lt;br /&gt;
|-&lt;br /&gt;
|8B||139||RESTORE&lt;br /&gt;
|-&lt;br /&gt;
|8C||140||GOSUB&lt;br /&gt;
|-&lt;br /&gt;
|8D||141||RETURN&lt;br /&gt;
|-&lt;br /&gt;
|8E||142||REM&lt;br /&gt;
|-&lt;br /&gt;
|8F||143||STOP&lt;br /&gt;
|-&lt;br /&gt;
|90||144||WIDTH&lt;br /&gt;
|-&lt;br /&gt;
|91||145||ELSE||When tokenizing, the Tandy 200 always adds a colon (':') before the ELSE token&lt;br /&gt;
|-&lt;br /&gt;
|92||146||LINE&lt;br /&gt;
|-&lt;br /&gt;
|93||147||EDIT&lt;br /&gt;
|-&lt;br /&gt;
|94||148||ERROR&lt;br /&gt;
|-&lt;br /&gt;
|95||149||RESUME&lt;br /&gt;
|-&lt;br /&gt;
|96||150||OUT&lt;br /&gt;
|-&lt;br /&gt;
|97||151||ON&lt;br /&gt;
|-&lt;br /&gt;
|98||152||DSKO$&lt;br /&gt;
|-&lt;br /&gt;
|99||153||OPEN&lt;br /&gt;
|-&lt;br /&gt;
|9A||154||CLOSE&lt;br /&gt;
|-&lt;br /&gt;
|9B||155||LOAD||Note that LOADM is simply the token for LOAD followed by an ASCII 'M'. &lt;br /&gt;
|-&lt;br /&gt;
|9C||156||MERGE&lt;br /&gt;
|-QUOTE&lt;br /&gt;
|9D||157||FILES&lt;br /&gt;
|-&lt;br /&gt;
|9E||158||SAVE&lt;br /&gt;
|-&lt;br /&gt;
|9F||159||LFILES&lt;br /&gt;
|-&lt;br /&gt;
|A0||160||LPRINT&lt;br /&gt;
|-&lt;br /&gt;
|A1||161||DEF&lt;br /&gt;
|-&lt;br /&gt;
|A2||162||POKE&lt;br /&gt;
|-&lt;br /&gt;
|A3||163||PRINT&lt;br /&gt;
|-&lt;br /&gt;
|A4||164||CONT&lt;br /&gt;
|-&lt;br /&gt;
|A5||165||LIST&lt;br /&gt;
|-&lt;br /&gt;
|A6||166||LLIST&lt;br /&gt;
|-&lt;br /&gt;
|A7||167||CLEAR&lt;br /&gt;
|-&lt;br /&gt;
|A8||168||CLOAD&lt;br /&gt;
|-&lt;br /&gt;
|A9||169||CSAVE&lt;br /&gt;
|-&lt;br /&gt;
|AA||170||TIME$&lt;br /&gt;
|-&lt;br /&gt;
|AB||171||DATE$&lt;br /&gt;
|-&lt;br /&gt;
|AC||172||DAY$&lt;br /&gt;
|-&lt;br /&gt;
|AD||173||COM&lt;br /&gt;
|-&lt;br /&gt;
|AE||174||MDM&lt;br /&gt;
|-&lt;br /&gt;
|AF||175||KEY&lt;br /&gt;
|-&lt;br /&gt;
|B0||176||CLS&lt;br /&gt;
|-&lt;br /&gt;
|B1||177||BEEP&lt;br /&gt;
|-&lt;br /&gt;
|B2||178||SOUND&lt;br /&gt;
|-&lt;br /&gt;
|B3||179||LCOPY&lt;br /&gt;
|-&lt;br /&gt;
|B4||180||PSET&lt;br /&gt;
|-&lt;br /&gt;
|B5||181||PRESET&lt;br /&gt;
|-&lt;br /&gt;
|B6||182||MOTOR&lt;br /&gt;
|-&lt;br /&gt;
|B7||183||MAX&lt;br /&gt;
|-&lt;br /&gt;
|B8||184||POWER&lt;br /&gt;
|-&lt;br /&gt;
|B9||185||CALL&lt;br /&gt;
|-&lt;br /&gt;
|BA||186||MENU&lt;br /&gt;
|-&lt;br /&gt;
|BB||187||IPL&lt;br /&gt;
|-&lt;br /&gt;
|BC||188||NAME&lt;br /&gt;
|-&lt;br /&gt;
|BD||189||KILL&lt;br /&gt;
|-&lt;br /&gt;
|BE||190||SCREEN&lt;br /&gt;
|-&lt;br /&gt;
|BF||191||NEW&lt;br /&gt;
|-&lt;br /&gt;
|C0||192||TAB(&lt;br /&gt;
|-&lt;br /&gt;
|C1||193||TO&lt;br /&gt;
|-&lt;br /&gt;
|C2||194||USING&lt;br /&gt;
|-&lt;br /&gt;
|C3||195||VARPTR&lt;br /&gt;
|-&lt;br /&gt;
|C4||196||ERL&lt;br /&gt;
|-&lt;br /&gt;
|C5||197||ERR&lt;br /&gt;
|-&lt;br /&gt;
|C6||198||STRING$&lt;br /&gt;
|-&lt;br /&gt;
|C7||199||INSTR&lt;br /&gt;
|-&lt;br /&gt;
|C8||200||DSKI$&lt;br /&gt;
|-&lt;br /&gt;
|C9||201||INKEY$&lt;br /&gt;
|-&lt;br /&gt;
|CA||202||CSRLIN&lt;br /&gt;
|-&lt;br /&gt;
|CB||203||OFF&lt;br /&gt;
|-&lt;br /&gt;
|CC||204||HIMEM&lt;br /&gt;
|-&lt;br /&gt;
|CD||205||THEN&lt;br /&gt;
|-&lt;br /&gt;
|CE||206||NOT&lt;br /&gt;
|-&lt;br /&gt;
|CF||207||STEP&lt;br /&gt;
|-&lt;br /&gt;
|D0||208||+&lt;br /&gt;
|-&lt;br /&gt;
|D1||209||-&lt;br /&gt;
|-&lt;br /&gt;
|D2||210||*&lt;br /&gt;
|-&lt;br /&gt;
|D3||211||/&lt;br /&gt;
|-&lt;br /&gt;
|D4||212||^&lt;br /&gt;
|-&lt;br /&gt;
|D5||213||AND&lt;br /&gt;
|-&lt;br /&gt;
|D6||214||OR&lt;br /&gt;
|-&lt;br /&gt;
|D7||215||XOR&lt;br /&gt;
|-&lt;br /&gt;
|D8||216||EQV&lt;br /&gt;
|-&lt;br /&gt;
|D9||217||IMP&lt;br /&gt;
|-&lt;br /&gt;
|DA||218||MOD&lt;br /&gt;
|-&lt;br /&gt;
|DB||219||\&lt;br /&gt;
|-&lt;br /&gt;
|DC||220||&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|DD||221||=&lt;br /&gt;
|-&lt;br /&gt;
|DE||222||\|&lt;br /&gt;
|-&lt;br /&gt;
|DF||223||SGN&lt;br /&gt;
|-&lt;br /&gt;
|E0||224||INT&lt;br /&gt;
|-&lt;br /&gt;
|E1||225||ABS&lt;br /&gt;
|-&lt;br /&gt;
|E2||226||FRE&lt;br /&gt;
|-&lt;br /&gt;
|E3||227||INP&lt;br /&gt;
|-&lt;br /&gt;
|E4||228||LPOS&lt;br /&gt;
|-&lt;br /&gt;
|E5||229||POS&lt;br /&gt;
|-&lt;br /&gt;
|E6||230||SQR&lt;br /&gt;
|-&lt;br /&gt;
|E7||231||RND&lt;br /&gt;
|-&lt;br /&gt;
|E8||232||LOG&lt;br /&gt;
|-&lt;br /&gt;
|E9||233||EXP&lt;br /&gt;
|-&lt;br /&gt;
|EA||234||COS&lt;br /&gt;
|-&lt;br /&gt;
|EB||235||SIN&lt;br /&gt;
|-&lt;br /&gt;
|EC||236||TAN&lt;br /&gt;
|-&lt;br /&gt;
|ED||237||ATN&lt;br /&gt;
|-&lt;br /&gt;
|EE||238||PEEK&lt;br /&gt;
|-&lt;br /&gt;
|EF||239||EOF&lt;br /&gt;
|-&lt;br /&gt;
|F0||240||LOC&lt;br /&gt;
|-&lt;br /&gt;
|F1||241||LOF&lt;br /&gt;
|-&lt;br /&gt;
|F2||242||CINT&lt;br /&gt;
|-&lt;br /&gt;
|F3||243||CSNG&lt;br /&gt;
|-&lt;br /&gt;
|F4||244||CDBL&lt;br /&gt;
|-&lt;br /&gt;
|F5||245||FIX&lt;br /&gt;
|-&lt;br /&gt;
|F6||246||LEN&lt;br /&gt;
|-&lt;br /&gt;
|F7||247||STR$&lt;br /&gt;
|-&lt;br /&gt;
|F8||248||VAL&lt;br /&gt;
|-&lt;br /&gt;
|F9||249||ASC&lt;br /&gt;
|-&lt;br /&gt;
|FA||250||CHR$&lt;br /&gt;
|-&lt;br /&gt;
|FB||251||SPACE$&lt;br /&gt;
|-&lt;br /&gt;
|FC||252||LEFT$&lt;br /&gt;
|-&lt;br /&gt;
|FD||253||RIGHT$&lt;br /&gt;
|-&lt;br /&gt;
|FE||254||MID$&lt;br /&gt;
|-&lt;br /&gt;
|FF||255||' (QUOTE) || When tokenizing, the single quote character expands to three characters: a colon, the byte for REM (0x8E), and then 0xFF.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== File Format ==&lt;br /&gt;
&lt;br /&gt;
Tokenised BASIC code is a sequence of tokenized lines. Each tokenized line has the following format:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!Name!!Length!!Description&lt;br /&gt;
|-&lt;br /&gt;
|PL PH&lt;br /&gt;
|2 bytes&lt;br /&gt;
|Address of the next line in memory, little endian. This data can be ignored as it is only a placeholder. The value of PL PH in a file is moot because the address is recalculated every time the program loads. Once in memory, PL PH is used to skip to the line required for GOTO, GOSUB, and READ, thus speeding up the program. &lt;br /&gt;
|-&lt;br /&gt;
|LL LH&lt;br /&gt;
|2 bytes&lt;br /&gt;
|Line number, little endian.&lt;br /&gt;
|-&lt;br /&gt;
|B0 … BN&lt;br /&gt;
|Any number&lt;br /&gt;
|Sequence of tokens or ASCII characters. If a character's value is ≥ 128, then it is a token. All tokens are a single byte. &lt;br /&gt;
|-&lt;br /&gt;
|NULL&lt;br /&gt;
|1 byte&lt;br /&gt;
|NULL byte (`0x00`) to signal end of line. &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Format documentation ==&lt;br /&gt;
&lt;br /&gt;
* [https://m100.bitchin100.narkive.com/eP2uSl4J/tokenized-basic-programs-bytes-of-mystery Discussion of byte format on Bitchin 100 Mailing List]&lt;br /&gt;
* [http://www.club100.org/library/ups/tokens.do BASIC program to create a table of tokens]&lt;br /&gt;
&lt;br /&gt;
== Other links ==&lt;br /&gt;
&lt;br /&gt;
* [https://sourceforge.net/projects/virtualt/ A Tandy 200 &amp;amp; Model 100/102 emulator]&lt;br /&gt;
* [http://bitchin100.com/CloudT/ A TRS-80 Model 100 emulator that runs in a web browser]&lt;br /&gt;
&lt;br /&gt;
[[Category:Microsoft]]&lt;/div&gt;</summary>
		<author><name>Hackerb9</name></author>	</entry>

	<entry>
		<id>http://fileformats.archiveteam.org/wiki/Tandy_200_BASIC_tokenized_file</id>
		<title>Tandy 200 BASIC tokenized file</title>
		<link rel="alternate" type="text/html" href="http://fileformats.archiveteam.org/wiki/Tandy_200_BASIC_tokenized_file"/>
				<updated>2022-07-26T06:29:05Z</updated>
		
		<summary type="html">&lt;p&gt;Hackerb9: /* File Format */ File does not end line number set to 0x00 0x00.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{FormatInfo&lt;br /&gt;
|subcat=Source code&lt;br /&gt;
|subcat2=Tokenized BASIC&lt;br /&gt;
|released=1984&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
'''Tandy 200 BASIC''' was a version of Microsoft BASIC for the Radio Shack Tandy 200 computer. The tokenization for the TRS-80 Model 100/102 and NEC PC-8201/8300 should be similar, if not identical.&lt;br /&gt;
&lt;br /&gt;
== Tokens ==&lt;br /&gt;
&lt;br /&gt;
Blank values indicate either that the token is unused or is used for something unknown.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! title=&amp;quot;Hexadecimal code point&amp;quot; | Hex&lt;br /&gt;
! title=&amp;quot;Decimal code point&amp;quot; | Dec&lt;br /&gt;
! title=&amp;quot;BASIC element the token stands for&amp;quot; | Token meaning&lt;br /&gt;
|-&lt;br /&gt;
|-&lt;br /&gt;
|80||128||END&lt;br /&gt;
|-&lt;br /&gt;
|81||129||FOR&lt;br /&gt;
|-&lt;br /&gt;
|82||130||NEXT&lt;br /&gt;
|-&lt;br /&gt;
|83||131||DATA&lt;br /&gt;
|-&lt;br /&gt;
|84||132||INPUT&lt;br /&gt;
|-&lt;br /&gt;
|85||133||DIM&lt;br /&gt;
|-&lt;br /&gt;
|86||134||READ&lt;br /&gt;
|-&lt;br /&gt;
|87||135||LET&lt;br /&gt;
|-&lt;br /&gt;
|88||136||GOTO&lt;br /&gt;
|-&lt;br /&gt;
|89||137||RUN&lt;br /&gt;
|-&lt;br /&gt;
|8A||138||IF&lt;br /&gt;
|-&lt;br /&gt;
|8B||139||RESTORE&lt;br /&gt;
|-&lt;br /&gt;
|8C||140||GOSUB&lt;br /&gt;
|-&lt;br /&gt;
|8D||141||RETURN&lt;br /&gt;
|-&lt;br /&gt;
|8E||142||REM&lt;br /&gt;
|-&lt;br /&gt;
|8F||143||STOP&lt;br /&gt;
|-&lt;br /&gt;
|90||144||WIDTH&lt;br /&gt;
|-&lt;br /&gt;
|91||145||ELSE&lt;br /&gt;
|-&lt;br /&gt;
|92||146||LINE&lt;br /&gt;
|-&lt;br /&gt;
|93||147||EDIT&lt;br /&gt;
|-&lt;br /&gt;
|94||148||ERROR&lt;br /&gt;
|-&lt;br /&gt;
|95||149||RESUME&lt;br /&gt;
|-&lt;br /&gt;
|96||150||OUT&lt;br /&gt;
|-&lt;br /&gt;
|97||151||ON&lt;br /&gt;
|-&lt;br /&gt;
|98||152||DSKO$&lt;br /&gt;
|-&lt;br /&gt;
|99||153||OPEN&lt;br /&gt;
|-&lt;br /&gt;
|9A||154||CLOSE&lt;br /&gt;
|-&lt;br /&gt;
|9B||155||LOAD&lt;br /&gt;
|-&lt;br /&gt;
|9C||156||MERGE&lt;br /&gt;
|-&lt;br /&gt;
|9D||157||FILES&lt;br /&gt;
|-&lt;br /&gt;
|9E||158||SAVE&lt;br /&gt;
|-&lt;br /&gt;
|9F||159||LFILES&lt;br /&gt;
|-&lt;br /&gt;
|A0||160||LPRINT&lt;br /&gt;
|-&lt;br /&gt;
|A1||161||DEF&lt;br /&gt;
|-&lt;br /&gt;
|A2||162||POKE&lt;br /&gt;
|-&lt;br /&gt;
|A3||163||PRINT&lt;br /&gt;
|-&lt;br /&gt;
|A4||164||CONT&lt;br /&gt;
|-&lt;br /&gt;
|A5||165||LIST&lt;br /&gt;
|-&lt;br /&gt;
|A6||166||LLIST&lt;br /&gt;
|-&lt;br /&gt;
|A7||167||CLEAR&lt;br /&gt;
|-&lt;br /&gt;
|A8||168||CLOAD&lt;br /&gt;
|-&lt;br /&gt;
|A9||169||CSAVE&lt;br /&gt;
|-&lt;br /&gt;
|AA||170||TIME$&lt;br /&gt;
|-&lt;br /&gt;
|AB||171||DATE$&lt;br /&gt;
|-&lt;br /&gt;
|AC||172||DAY$&lt;br /&gt;
|-&lt;br /&gt;
|AD||173||COM&lt;br /&gt;
|-&lt;br /&gt;
|AE||174||MDM&lt;br /&gt;
|-&lt;br /&gt;
|AF||175||KEY&lt;br /&gt;
|-&lt;br /&gt;
|B0||176||CLS&lt;br /&gt;
|-&lt;br /&gt;
|B1||177||BEEP&lt;br /&gt;
|-&lt;br /&gt;
|B2||178||SOUND&lt;br /&gt;
|-&lt;br /&gt;
|B3||179||LCOPY&lt;br /&gt;
|-&lt;br /&gt;
|B4||180||PSET&lt;br /&gt;
|-&lt;br /&gt;
|B5||181||PRESET&lt;br /&gt;
|-&lt;br /&gt;
|B6||182||MOTOR&lt;br /&gt;
|-&lt;br /&gt;
|B7||183||MAX&lt;br /&gt;
|-&lt;br /&gt;
|B8||184||POWER&lt;br /&gt;
|-&lt;br /&gt;
|B9||185||CALL&lt;br /&gt;
|-&lt;br /&gt;
|BA||186||MENU&lt;br /&gt;
|-&lt;br /&gt;
|BB||187||IPL&lt;br /&gt;
|-&lt;br /&gt;
|BC||188||NAME&lt;br /&gt;
|-&lt;br /&gt;
|BD||189||KILL&lt;br /&gt;
|-&lt;br /&gt;
|BE||190||SCREEN&lt;br /&gt;
|-&lt;br /&gt;
|BF||191||NEW&lt;br /&gt;
|-&lt;br /&gt;
|C0||192||TAB(&lt;br /&gt;
|-&lt;br /&gt;
|C1||193||TO&lt;br /&gt;
|-&lt;br /&gt;
|C2||194||USING&lt;br /&gt;
|-&lt;br /&gt;
|C3||195||VARPTR&lt;br /&gt;
|-&lt;br /&gt;
|C4||196||ERL&lt;br /&gt;
|-&lt;br /&gt;
|C5||197||ERR&lt;br /&gt;
|-&lt;br /&gt;
|C6||198||STRING$&lt;br /&gt;
|-&lt;br /&gt;
|C7||199||INSTR&lt;br /&gt;
|-&lt;br /&gt;
|C8||200||DSKI$&lt;br /&gt;
|-&lt;br /&gt;
|C9||201||INKEY$&lt;br /&gt;
|-&lt;br /&gt;
|CA||202||CSRLIN&lt;br /&gt;
|-&lt;br /&gt;
|CB||203||OFF&lt;br /&gt;
|-&lt;br /&gt;
|CC||204||HIMEM&lt;br /&gt;
|-&lt;br /&gt;
|CD||205||THEN&lt;br /&gt;
|-&lt;br /&gt;
|CE||206||NOT&lt;br /&gt;
|-&lt;br /&gt;
|CF||207||STEP&lt;br /&gt;
|-&lt;br /&gt;
|D0||208||+&lt;br /&gt;
|-&lt;br /&gt;
|D1||209||-&lt;br /&gt;
|-&lt;br /&gt;
|D2||210||*&lt;br /&gt;
|-&lt;br /&gt;
|D3||211||/&lt;br /&gt;
|-&lt;br /&gt;
|D4||212||^&lt;br /&gt;
|-&lt;br /&gt;
|D5||213||AND&lt;br /&gt;
|-&lt;br /&gt;
|D6||214||OR&lt;br /&gt;
|-&lt;br /&gt;
|D7||215||XOR&lt;br /&gt;
|-&lt;br /&gt;
|D8||216||EQV&lt;br /&gt;
|-&lt;br /&gt;
|D9||217||IMP&lt;br /&gt;
|-&lt;br /&gt;
|DA||218||MOD&lt;br /&gt;
|-&lt;br /&gt;
|DB||219||\&lt;br /&gt;
|-&lt;br /&gt;
|DC||220||&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|DD||221||=&lt;br /&gt;
|-&lt;br /&gt;
|DE||222||\|&lt;br /&gt;
|-&lt;br /&gt;
|DF||223||SGN&lt;br /&gt;
|-&lt;br /&gt;
|E0||224||INT&lt;br /&gt;
|-&lt;br /&gt;
|E1||225||ABS&lt;br /&gt;
|-&lt;br /&gt;
|E2||226||FRE&lt;br /&gt;
|-&lt;br /&gt;
|E3||227||INP&lt;br /&gt;
|-&lt;br /&gt;
|E4||228||LPOS&lt;br /&gt;
|-&lt;br /&gt;
|E5||229||POS&lt;br /&gt;
|-&lt;br /&gt;
|E6||230||SQR&lt;br /&gt;
|-&lt;br /&gt;
|E7||231||RND&lt;br /&gt;
|-&lt;br /&gt;
|E8||232||LOG&lt;br /&gt;
|-&lt;br /&gt;
|E9||233||EXP&lt;br /&gt;
|-&lt;br /&gt;
|EA||234||COS&lt;br /&gt;
|-&lt;br /&gt;
|EB||235||SIN&lt;br /&gt;
|-&lt;br /&gt;
|EC||236||TAN&lt;br /&gt;
|-&lt;br /&gt;
|ED||237||ATN&lt;br /&gt;
|-&lt;br /&gt;
|EE||238||PEEK&lt;br /&gt;
|-&lt;br /&gt;
|EF||239||EOF&lt;br /&gt;
|-&lt;br /&gt;
|F0||240||LOC&lt;br /&gt;
|-&lt;br /&gt;
|F1||241||LOF&lt;br /&gt;
|-&lt;br /&gt;
|F2||242||CINT&lt;br /&gt;
|-&lt;br /&gt;
|F3||243||CSNG&lt;br /&gt;
|-&lt;br /&gt;
|F4||244||CDBL&lt;br /&gt;
|-&lt;br /&gt;
|F5||245||FIX&lt;br /&gt;
|-&lt;br /&gt;
|F6||246||LEN&lt;br /&gt;
|-&lt;br /&gt;
|F7||247||STR$&lt;br /&gt;
|-&lt;br /&gt;
|F8||248||VAL&lt;br /&gt;
|-&lt;br /&gt;
|F9||249||ASC&lt;br /&gt;
|-&lt;br /&gt;
|FA||250||CHR$&lt;br /&gt;
|-&lt;br /&gt;
|FB||251||SPACE$&lt;br /&gt;
|-&lt;br /&gt;
|FC||252||LEFT$&lt;br /&gt;
|-&lt;br /&gt;
|FD||253||RIGHT$&lt;br /&gt;
|-&lt;br /&gt;
|FE||254||MID$&lt;br /&gt;
|-&lt;br /&gt;
|FF||255||' (QUOTE)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== File Format ==&lt;br /&gt;
&lt;br /&gt;
Tokenised BASIC code is a sequence of tokenized lines. Each tokenized line has the following format:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!Name!!Length!!Description&lt;br /&gt;
|-&lt;br /&gt;
|PL PH&lt;br /&gt;
|2 bytes&lt;br /&gt;
|Address of the next line in memory, little endian. This data can be ignored as it is only a placeholder. The value of PL PH in a file is moot because the address is recalculated every time the program loads. Once in memory, PL PH is used to skip to the line required for GOTO, GOSUB, and READ, thus speeding up the program. &lt;br /&gt;
|-&lt;br /&gt;
|LL LH&lt;br /&gt;
|2 bytes&lt;br /&gt;
|Line number, little endian.&lt;br /&gt;
|-&lt;br /&gt;
|B0 … BN&lt;br /&gt;
|Any number&lt;br /&gt;
|Sequence of tokens or ASCII characters. If a character's value is ≥ 128, then it is a token. All tokens are a single byte. &lt;br /&gt;
|-&lt;br /&gt;
|NULL&lt;br /&gt;
|1 byte&lt;br /&gt;
|NULL byte (`0x00`) to signal end of line. &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Format documentation ==&lt;br /&gt;
&lt;br /&gt;
* [https://m100.bitchin100.narkive.com/eP2uSl4J/tokenized-basic-programs-bytes-of-mystery Discussion of byte format on Bitchin 100 Mailing List]&lt;br /&gt;
* [http://www.club100.org/library/ups/tokens.do BASIC program to create a table of tokens]&lt;br /&gt;
&lt;br /&gt;
== Other links ==&lt;br /&gt;
&lt;br /&gt;
* [https://sourceforge.net/projects/virtualt/ A Tandy 200 &amp;amp; Model 100/102 emulator]&lt;br /&gt;
* [http://bitchin100.com/CloudT/ A TRS-80 Model 100 emulator that runs in a web browser]&lt;br /&gt;
&lt;br /&gt;
[[Category:Microsoft]]&lt;/div&gt;</summary>
		<author><name>Hackerb9</name></author>	</entry>

	<entry>
		<id>http://fileformats.archiveteam.org/wiki/Tandy_200_BASIC_tokenized_file</id>
		<title>Tandy 200 BASIC tokenized file</title>
		<link rel="alternate" type="text/html" href="http://fileformats.archiveteam.org/wiki/Tandy_200_BASIC_tokenized_file"/>
				<updated>2022-07-25T06:05:56Z</updated>
		
		<summary type="html">&lt;p&gt;Hackerb9: /* File Format  */  Add specific details on the bytes in the file.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{FormatInfo&lt;br /&gt;
|subcat=Source code&lt;br /&gt;
|subcat2=Tokenized BASIC&lt;br /&gt;
|released=1984&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
'''Tandy 200 BASIC''' was a version of Microsoft BASIC for the Radio Shack Tandy 200 computer. The tokenization for the TRS-80 Model 100/102 and NEC PC-8201/8300 should be similar, if not identical.&lt;br /&gt;
&lt;br /&gt;
== Tokens ==&lt;br /&gt;
&lt;br /&gt;
Blank values indicate either that the token is unused or is used for something unknown.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! title=&amp;quot;Hexadecimal code point&amp;quot; | Hex&lt;br /&gt;
! title=&amp;quot;Decimal code point&amp;quot; | Dec&lt;br /&gt;
! title=&amp;quot;BASIC element the token stands for&amp;quot; | Token meaning&lt;br /&gt;
|-&lt;br /&gt;
|-&lt;br /&gt;
|80||128||END&lt;br /&gt;
|-&lt;br /&gt;
|81||129||FOR&lt;br /&gt;
|-&lt;br /&gt;
|82||130||NEXT&lt;br /&gt;
|-&lt;br /&gt;
|83||131||DATA&lt;br /&gt;
|-&lt;br /&gt;
|84||132||INPUT&lt;br /&gt;
|-&lt;br /&gt;
|85||133||DIM&lt;br /&gt;
|-&lt;br /&gt;
|86||134||READ&lt;br /&gt;
|-&lt;br /&gt;
|87||135||LET&lt;br /&gt;
|-&lt;br /&gt;
|88||136||GOTO&lt;br /&gt;
|-&lt;br /&gt;
|89||137||RUN&lt;br /&gt;
|-&lt;br /&gt;
|8A||138||IF&lt;br /&gt;
|-&lt;br /&gt;
|8B||139||RESTORE&lt;br /&gt;
|-&lt;br /&gt;
|8C||140||GOSUB&lt;br /&gt;
|-&lt;br /&gt;
|8D||141||RETURN&lt;br /&gt;
|-&lt;br /&gt;
|8E||142||REM&lt;br /&gt;
|-&lt;br /&gt;
|8F||143||STOP&lt;br /&gt;
|-&lt;br /&gt;
|90||144||WIDTH&lt;br /&gt;
|-&lt;br /&gt;
|91||145||ELSE&lt;br /&gt;
|-&lt;br /&gt;
|92||146||LINE&lt;br /&gt;
|-&lt;br /&gt;
|93||147||EDIT&lt;br /&gt;
|-&lt;br /&gt;
|94||148||ERROR&lt;br /&gt;
|-&lt;br /&gt;
|95||149||RESUME&lt;br /&gt;
|-&lt;br /&gt;
|96||150||OUT&lt;br /&gt;
|-&lt;br /&gt;
|97||151||ON&lt;br /&gt;
|-&lt;br /&gt;
|98||152||DSKO$&lt;br /&gt;
|-&lt;br /&gt;
|99||153||OPEN&lt;br /&gt;
|-&lt;br /&gt;
|9A||154||CLOSE&lt;br /&gt;
|-&lt;br /&gt;
|9B||155||LOAD&lt;br /&gt;
|-&lt;br /&gt;
|9C||156||MERGE&lt;br /&gt;
|-&lt;br /&gt;
|9D||157||FILES&lt;br /&gt;
|-&lt;br /&gt;
|9E||158||SAVE&lt;br /&gt;
|-&lt;br /&gt;
|9F||159||LFILES&lt;br /&gt;
|-&lt;br /&gt;
|A0||160||LPRINT&lt;br /&gt;
|-&lt;br /&gt;
|A1||161||DEF&lt;br /&gt;
|-&lt;br /&gt;
|A2||162||POKE&lt;br /&gt;
|-&lt;br /&gt;
|A3||163||PRINT&lt;br /&gt;
|-&lt;br /&gt;
|A4||164||CONT&lt;br /&gt;
|-&lt;br /&gt;
|A5||165||LIST&lt;br /&gt;
|-&lt;br /&gt;
|A6||166||LLIST&lt;br /&gt;
|-&lt;br /&gt;
|A7||167||CLEAR&lt;br /&gt;
|-&lt;br /&gt;
|A8||168||CLOAD&lt;br /&gt;
|-&lt;br /&gt;
|A9||169||CSAVE&lt;br /&gt;
|-&lt;br /&gt;
|AA||170||TIME$&lt;br /&gt;
|-&lt;br /&gt;
|AB||171||DATE$&lt;br /&gt;
|-&lt;br /&gt;
|AC||172||DAY$&lt;br /&gt;
|-&lt;br /&gt;
|AD||173||COM&lt;br /&gt;
|-&lt;br /&gt;
|AE||174||MDM&lt;br /&gt;
|-&lt;br /&gt;
|AF||175||KEY&lt;br /&gt;
|-&lt;br /&gt;
|B0||176||CLS&lt;br /&gt;
|-&lt;br /&gt;
|B1||177||BEEP&lt;br /&gt;
|-&lt;br /&gt;
|B2||178||SOUND&lt;br /&gt;
|-&lt;br /&gt;
|B3||179||LCOPY&lt;br /&gt;
|-&lt;br /&gt;
|B4||180||PSET&lt;br /&gt;
|-&lt;br /&gt;
|B5||181||PRESET&lt;br /&gt;
|-&lt;br /&gt;
|B6||182||MOTOR&lt;br /&gt;
|-&lt;br /&gt;
|B7||183||MAX&lt;br /&gt;
|-&lt;br /&gt;
|B8||184||POWER&lt;br /&gt;
|-&lt;br /&gt;
|B9||185||CALL&lt;br /&gt;
|-&lt;br /&gt;
|BA||186||MENU&lt;br /&gt;
|-&lt;br /&gt;
|BB||187||IPL&lt;br /&gt;
|-&lt;br /&gt;
|BC||188||NAME&lt;br /&gt;
|-&lt;br /&gt;
|BD||189||KILL&lt;br /&gt;
|-&lt;br /&gt;
|BE||190||SCREEN&lt;br /&gt;
|-&lt;br /&gt;
|BF||191||NEW&lt;br /&gt;
|-&lt;br /&gt;
|C0||192||TAB(&lt;br /&gt;
|-&lt;br /&gt;
|C1||193||TO&lt;br /&gt;
|-&lt;br /&gt;
|C2||194||USING&lt;br /&gt;
|-&lt;br /&gt;
|C3||195||VARPTR&lt;br /&gt;
|-&lt;br /&gt;
|C4||196||ERL&lt;br /&gt;
|-&lt;br /&gt;
|C5||197||ERR&lt;br /&gt;
|-&lt;br /&gt;
|C6||198||STRING$&lt;br /&gt;
|-&lt;br /&gt;
|C7||199||INSTR&lt;br /&gt;
|-&lt;br /&gt;
|C8||200||DSKI$&lt;br /&gt;
|-&lt;br /&gt;
|C9||201||INKEY$&lt;br /&gt;
|-&lt;br /&gt;
|CA||202||CSRLIN&lt;br /&gt;
|-&lt;br /&gt;
|CB||203||OFF&lt;br /&gt;
|-&lt;br /&gt;
|CC||204||HIMEM&lt;br /&gt;
|-&lt;br /&gt;
|CD||205||THEN&lt;br /&gt;
|-&lt;br /&gt;
|CE||206||NOT&lt;br /&gt;
|-&lt;br /&gt;
|CF||207||STEP&lt;br /&gt;
|-&lt;br /&gt;
|D0||208||+&lt;br /&gt;
|-&lt;br /&gt;
|D1||209||-&lt;br /&gt;
|-&lt;br /&gt;
|D2||210||*&lt;br /&gt;
|-&lt;br /&gt;
|D3||211||/&lt;br /&gt;
|-&lt;br /&gt;
|D4||212||^&lt;br /&gt;
|-&lt;br /&gt;
|D5||213||AND&lt;br /&gt;
|-&lt;br /&gt;
|D6||214||OR&lt;br /&gt;
|-&lt;br /&gt;
|D7||215||XOR&lt;br /&gt;
|-&lt;br /&gt;
|D8||216||EQV&lt;br /&gt;
|-&lt;br /&gt;
|D9||217||IMP&lt;br /&gt;
|-&lt;br /&gt;
|DA||218||MOD&lt;br /&gt;
|-&lt;br /&gt;
|DB||219||\&lt;br /&gt;
|-&lt;br /&gt;
|DC||220||&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|DD||221||=&lt;br /&gt;
|-&lt;br /&gt;
|DE||222||\|&lt;br /&gt;
|-&lt;br /&gt;
|DF||223||SGN&lt;br /&gt;
|-&lt;br /&gt;
|E0||224||INT&lt;br /&gt;
|-&lt;br /&gt;
|E1||225||ABS&lt;br /&gt;
|-&lt;br /&gt;
|E2||226||FRE&lt;br /&gt;
|-&lt;br /&gt;
|E3||227||INP&lt;br /&gt;
|-&lt;br /&gt;
|E4||228||LPOS&lt;br /&gt;
|-&lt;br /&gt;
|E5||229||POS&lt;br /&gt;
|-&lt;br /&gt;
|E6||230||SQR&lt;br /&gt;
|-&lt;br /&gt;
|E7||231||RND&lt;br /&gt;
|-&lt;br /&gt;
|E8||232||LOG&lt;br /&gt;
|-&lt;br /&gt;
|E9||233||EXP&lt;br /&gt;
|-&lt;br /&gt;
|EA||234||COS&lt;br /&gt;
|-&lt;br /&gt;
|EB||235||SIN&lt;br /&gt;
|-&lt;br /&gt;
|EC||236||TAN&lt;br /&gt;
|-&lt;br /&gt;
|ED||237||ATN&lt;br /&gt;
|-&lt;br /&gt;
|EE||238||PEEK&lt;br /&gt;
|-&lt;br /&gt;
|EF||239||EOF&lt;br /&gt;
|-&lt;br /&gt;
|F0||240||LOC&lt;br /&gt;
|-&lt;br /&gt;
|F1||241||LOF&lt;br /&gt;
|-&lt;br /&gt;
|F2||242||CINT&lt;br /&gt;
|-&lt;br /&gt;
|F3||243||CSNG&lt;br /&gt;
|-&lt;br /&gt;
|F4||244||CDBL&lt;br /&gt;
|-&lt;br /&gt;
|F5||245||FIX&lt;br /&gt;
|-&lt;br /&gt;
|F6||246||LEN&lt;br /&gt;
|-&lt;br /&gt;
|F7||247||STR$&lt;br /&gt;
|-&lt;br /&gt;
|F8||248||VAL&lt;br /&gt;
|-&lt;br /&gt;
|F9||249||ASC&lt;br /&gt;
|-&lt;br /&gt;
|FA||250||CHR$&lt;br /&gt;
|-&lt;br /&gt;
|FB||251||SPACE$&lt;br /&gt;
|-&lt;br /&gt;
|FC||252||LEFT$&lt;br /&gt;
|-&lt;br /&gt;
|FD||253||RIGHT$&lt;br /&gt;
|-&lt;br /&gt;
|FE||254||MID$&lt;br /&gt;
|-&lt;br /&gt;
|FF||255||' (QUOTE)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== File Format ==&lt;br /&gt;
&lt;br /&gt;
Tokenised BASIC code is a sequence of tokenized lines. Each tokenized line has the following format:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!Name!!Length!!Description&lt;br /&gt;
|-&lt;br /&gt;
|PL PH&lt;br /&gt;
|2 bytes&lt;br /&gt;
|Address of the next line in memory, little endian. With one exception, this data can be ignored as it is only a placeholder. The exception is that the end of the program listing is marked by PL PH == 00 00. The value of PL PH in a file does not matter because the address is recalculated every time the program loads. PL PH is used to skip to the line required for GOTO, GOSUB, and READ, thus speeding up the program. &lt;br /&gt;
|-&lt;br /&gt;
|LL LH&lt;br /&gt;
|2 bytes&lt;br /&gt;
|Line number, little endian.&lt;br /&gt;
|-&lt;br /&gt;
|B0 … BN&lt;br /&gt;
|Any number&lt;br /&gt;
|Sequence of tokens or ASCII characters. If a character's value is ≥ 128, then it is a token. All tokens are a single byte. &lt;br /&gt;
|-&lt;br /&gt;
|NULL&lt;br /&gt;
|1 byte&lt;br /&gt;
|NULL byte (00) to signal end of line. &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Format documentation ==&lt;br /&gt;
&lt;br /&gt;
* [https://m100.bitchin100.narkive.com/eP2uSl4J/tokenized-basic-programs-bytes-of-mystery Discussion of byte format on Bitchin 100 Mailing List]&lt;br /&gt;
* [http://www.club100.org/library/ups/tokens.do BASIC program to create a table of tokens]&lt;br /&gt;
&lt;br /&gt;
== Other links ==&lt;br /&gt;
&lt;br /&gt;
* [https://sourceforge.net/projects/virtualt/ A Tandy 200 &amp;amp; Model 100/102 emulator]&lt;br /&gt;
* [http://bitchin100.com/CloudT/ A TRS-80 Model 100 emulator that runs in a web browser]&lt;br /&gt;
&lt;br /&gt;
[[Category:Microsoft]]&lt;/div&gt;</summary>
		<author><name>Hackerb9</name></author>	</entry>

	<entry>
		<id>http://fileformats.archiveteam.org/wiki/Tandy_200_BASIC_tokenized_file</id>
		<title>Tandy 200 BASIC tokenized file</title>
		<link rel="alternate" type="text/html" href="http://fileformats.archiveteam.org/wiki/Tandy_200_BASIC_tokenized_file"/>
				<updated>2022-07-24T11:42:59Z</updated>
		
		<summary type="html">&lt;p&gt;Hackerb9: /* Tokens */ Apparently REM and ' have separate entries.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{FormatInfo&lt;br /&gt;
|subcat=Source code&lt;br /&gt;
|subcat2=Tokenized BASIC&lt;br /&gt;
|released=1984&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
'''Tandy 200 BASIC''' was a version of Microsoft BASIC for the Radio Shack Tandy 200 computer. The tokenization for the TRS-80 Model 100/102 and NEC PC-8201/8300 should be similar, if not identical.&lt;br /&gt;
&lt;br /&gt;
== Tokens ==&lt;br /&gt;
&lt;br /&gt;
Blank values indicate either that the token is unused or is used for something unknown.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! title=&amp;quot;Hexadecimal code point&amp;quot; | Hex&lt;br /&gt;
! title=&amp;quot;Decimal code point&amp;quot; | Dec&lt;br /&gt;
! title=&amp;quot;BASIC element the token stands for&amp;quot; | Token meaning&lt;br /&gt;
|-&lt;br /&gt;
|-&lt;br /&gt;
|80||128||END&lt;br /&gt;
|-&lt;br /&gt;
|81||129||FOR&lt;br /&gt;
|-&lt;br /&gt;
|82||130||NEXT&lt;br /&gt;
|-&lt;br /&gt;
|83||131||DATA&lt;br /&gt;
|-&lt;br /&gt;
|84||132||INPUT&lt;br /&gt;
|-&lt;br /&gt;
|85||133||DIM&lt;br /&gt;
|-&lt;br /&gt;
|86||134||READ&lt;br /&gt;
|-&lt;br /&gt;
|87||135||LET&lt;br /&gt;
|-&lt;br /&gt;
|88||136||GOTO&lt;br /&gt;
|-&lt;br /&gt;
|89||137||RUN&lt;br /&gt;
|-&lt;br /&gt;
|8A||138||IF&lt;br /&gt;
|-&lt;br /&gt;
|8B||139||RESTORE&lt;br /&gt;
|-&lt;br /&gt;
|8C||140||GOSUB&lt;br /&gt;
|-&lt;br /&gt;
|8D||141||RETURN&lt;br /&gt;
|-&lt;br /&gt;
|8E||142||REM&lt;br /&gt;
|-&lt;br /&gt;
|8F||143||STOP&lt;br /&gt;
|-&lt;br /&gt;
|90||144||WIDTH&lt;br /&gt;
|-&lt;br /&gt;
|91||145||ELSE&lt;br /&gt;
|-&lt;br /&gt;
|92||146||LINE&lt;br /&gt;
|-&lt;br /&gt;
|93||147||EDIT&lt;br /&gt;
|-&lt;br /&gt;
|94||148||ERROR&lt;br /&gt;
|-&lt;br /&gt;
|95||149||RESUME&lt;br /&gt;
|-&lt;br /&gt;
|96||150||OUT&lt;br /&gt;
|-&lt;br /&gt;
|97||151||ON&lt;br /&gt;
|-&lt;br /&gt;
|98||152||DSKO$&lt;br /&gt;
|-&lt;br /&gt;
|99||153||OPEN&lt;br /&gt;
|-&lt;br /&gt;
|9A||154||CLOSE&lt;br /&gt;
|-&lt;br /&gt;
|9B||155||LOAD&lt;br /&gt;
|-&lt;br /&gt;
|9C||156||MERGE&lt;br /&gt;
|-&lt;br /&gt;
|9D||157||FILES&lt;br /&gt;
|-&lt;br /&gt;
|9E||158||SAVE&lt;br /&gt;
|-&lt;br /&gt;
|9F||159||LFILES&lt;br /&gt;
|-&lt;br /&gt;
|A0||160||LPRINT&lt;br /&gt;
|-&lt;br /&gt;
|A1||161||DEF&lt;br /&gt;
|-&lt;br /&gt;
|A2||162||POKE&lt;br /&gt;
|-&lt;br /&gt;
|A3||163||PRINT&lt;br /&gt;
|-&lt;br /&gt;
|A4||164||CONT&lt;br /&gt;
|-&lt;br /&gt;
|A5||165||LIST&lt;br /&gt;
|-&lt;br /&gt;
|A6||166||LLIST&lt;br /&gt;
|-&lt;br /&gt;
|A7||167||CLEAR&lt;br /&gt;
|-&lt;br /&gt;
|A8||168||CLOAD&lt;br /&gt;
|-&lt;br /&gt;
|A9||169||CSAVE&lt;br /&gt;
|-&lt;br /&gt;
|AA||170||TIME$&lt;br /&gt;
|-&lt;br /&gt;
|AB||171||DATE$&lt;br /&gt;
|-&lt;br /&gt;
|AC||172||DAY$&lt;br /&gt;
|-&lt;br /&gt;
|AD||173||COM&lt;br /&gt;
|-&lt;br /&gt;
|AE||174||MDM&lt;br /&gt;
|-&lt;br /&gt;
|AF||175||KEY&lt;br /&gt;
|-&lt;br /&gt;
|B0||176||CLS&lt;br /&gt;
|-&lt;br /&gt;
|B1||177||BEEP&lt;br /&gt;
|-&lt;br /&gt;
|B2||178||SOUND&lt;br /&gt;
|-&lt;br /&gt;
|B3||179||LCOPY&lt;br /&gt;
|-&lt;br /&gt;
|B4||180||PSET&lt;br /&gt;
|-&lt;br /&gt;
|B5||181||PRESET&lt;br /&gt;
|-&lt;br /&gt;
|B6||182||MOTOR&lt;br /&gt;
|-&lt;br /&gt;
|B7||183||MAX&lt;br /&gt;
|-&lt;br /&gt;
|B8||184||POWER&lt;br /&gt;
|-&lt;br /&gt;
|B9||185||CALL&lt;br /&gt;
|-&lt;br /&gt;
|BA||186||MENU&lt;br /&gt;
|-&lt;br /&gt;
|BB||187||IPL&lt;br /&gt;
|-&lt;br /&gt;
|BC||188||NAME&lt;br /&gt;
|-&lt;br /&gt;
|BD||189||KILL&lt;br /&gt;
|-&lt;br /&gt;
|BE||190||SCREEN&lt;br /&gt;
|-&lt;br /&gt;
|BF||191||NEW&lt;br /&gt;
|-&lt;br /&gt;
|C0||192||TAB(&lt;br /&gt;
|-&lt;br /&gt;
|C1||193||TO&lt;br /&gt;
|-&lt;br /&gt;
|C2||194||USING&lt;br /&gt;
|-&lt;br /&gt;
|C3||195||VARPTR&lt;br /&gt;
|-&lt;br /&gt;
|C4||196||ERL&lt;br /&gt;
|-&lt;br /&gt;
|C5||197||ERR&lt;br /&gt;
|-&lt;br /&gt;
|C6||198||STRING$&lt;br /&gt;
|-&lt;br /&gt;
|C7||199||INSTR&lt;br /&gt;
|-&lt;br /&gt;
|C8||200||DSKI$&lt;br /&gt;
|-&lt;br /&gt;
|C9||201||INKEY$&lt;br /&gt;
|-&lt;br /&gt;
|CA||202||CSRLIN&lt;br /&gt;
|-&lt;br /&gt;
|CB||203||OFF&lt;br /&gt;
|-&lt;br /&gt;
|CC||204||HIMEM&lt;br /&gt;
|-&lt;br /&gt;
|CD||205||THEN&lt;br /&gt;
|-&lt;br /&gt;
|CE||206||NOT&lt;br /&gt;
|-&lt;br /&gt;
|CF||207||STEP&lt;br /&gt;
|-&lt;br /&gt;
|D0||208||+&lt;br /&gt;
|-&lt;br /&gt;
|D1||209||-&lt;br /&gt;
|-&lt;br /&gt;
|D2||210||*&lt;br /&gt;
|-&lt;br /&gt;
|D3||211||/&lt;br /&gt;
|-&lt;br /&gt;
|D4||212||^&lt;br /&gt;
|-&lt;br /&gt;
|D5||213||AND&lt;br /&gt;
|-&lt;br /&gt;
|D6||214||OR&lt;br /&gt;
|-&lt;br /&gt;
|D7||215||XOR&lt;br /&gt;
|-&lt;br /&gt;
|D8||216||EQV&lt;br /&gt;
|-&lt;br /&gt;
|D9||217||IMP&lt;br /&gt;
|-&lt;br /&gt;
|DA||218||MOD&lt;br /&gt;
|-&lt;br /&gt;
|DB||219||\&lt;br /&gt;
|-&lt;br /&gt;
|DC||220||&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|DD||221||=&lt;br /&gt;
|-&lt;br /&gt;
|DE||222||\|&lt;br /&gt;
|-&lt;br /&gt;
|DF||223||SGN&lt;br /&gt;
|-&lt;br /&gt;
|E0||224||INT&lt;br /&gt;
|-&lt;br /&gt;
|E1||225||ABS&lt;br /&gt;
|-&lt;br /&gt;
|E2||226||FRE&lt;br /&gt;
|-&lt;br /&gt;
|E3||227||INP&lt;br /&gt;
|-&lt;br /&gt;
|E4||228||LPOS&lt;br /&gt;
|-&lt;br /&gt;
|E5||229||POS&lt;br /&gt;
|-&lt;br /&gt;
|E6||230||SQR&lt;br /&gt;
|-&lt;br /&gt;
|E7||231||RND&lt;br /&gt;
|-&lt;br /&gt;
|E8||232||LOG&lt;br /&gt;
|-&lt;br /&gt;
|E9||233||EXP&lt;br /&gt;
|-&lt;br /&gt;
|EA||234||COS&lt;br /&gt;
|-&lt;br /&gt;
|EB||235||SIN&lt;br /&gt;
|-&lt;br /&gt;
|EC||236||TAN&lt;br /&gt;
|-&lt;br /&gt;
|ED||237||ATN&lt;br /&gt;
|-&lt;br /&gt;
|EE||238||PEEK&lt;br /&gt;
|-&lt;br /&gt;
|EF||239||EOF&lt;br /&gt;
|-&lt;br /&gt;
|F0||240||LOC&lt;br /&gt;
|-&lt;br /&gt;
|F1||241||LOF&lt;br /&gt;
|-&lt;br /&gt;
|F2||242||CINT&lt;br /&gt;
|-&lt;br /&gt;
|F3||243||CSNG&lt;br /&gt;
|-&lt;br /&gt;
|F4||244||CDBL&lt;br /&gt;
|-&lt;br /&gt;
|F5||245||FIX&lt;br /&gt;
|-&lt;br /&gt;
|F6||246||LEN&lt;br /&gt;
|-&lt;br /&gt;
|F7||247||STR$&lt;br /&gt;
|-&lt;br /&gt;
|F8||248||VAL&lt;br /&gt;
|-&lt;br /&gt;
|F9||249||ASC&lt;br /&gt;
|-&lt;br /&gt;
|FA||250||CHR$&lt;br /&gt;
|-&lt;br /&gt;
|FB||251||SPACE$&lt;br /&gt;
|-&lt;br /&gt;
|FC||252||LEFT$&lt;br /&gt;
|-&lt;br /&gt;
|FD||253||RIGHT$&lt;br /&gt;
|-&lt;br /&gt;
|FE||254||MID$&lt;br /&gt;
|-&lt;br /&gt;
|FF||255||' (QUOTE)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Format documentation ==&lt;br /&gt;
* [http://www.club100.org/library/ups/tokens.do BASIC program to create a table of tokens]&lt;br /&gt;
&lt;br /&gt;
== Other links ==&lt;br /&gt;
&lt;br /&gt;
* [https://sourceforge.net/projects/virtualt/ A Tandy 200 &amp;amp; Model 100/102 emulator]&lt;br /&gt;
* [http://bitchin100.com/CloudT/ A TRS-80 Model 100 emulator that runs in a web browser]&lt;br /&gt;
&lt;br /&gt;
[[Category:Microsoft]]&lt;/div&gt;</summary>
		<author><name>Hackerb9</name></author>	</entry>

	<entry>
		<id>http://fileformats.archiveteam.org/wiki/Tandy_200_BASIC_tokenized_file</id>
		<title>Tandy 200 BASIC tokenized file</title>
		<link rel="alternate" type="text/html" href="http://fileformats.archiveteam.org/wiki/Tandy_200_BASIC_tokenized_file"/>
				<updated>2022-07-24T11:41:12Z</updated>
		
		<summary type="html">&lt;p&gt;Hackerb9: /* Tokens */ Typo: didn't need to escape backslash&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{FormatInfo&lt;br /&gt;
|subcat=Source code&lt;br /&gt;
|subcat2=Tokenized BASIC&lt;br /&gt;
|released=1984&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
'''Tandy 200 BASIC''' was a version of Microsoft BASIC for the Radio Shack Tandy 200 computer. The tokenization for the TRS-80 Model 100/102 and NEC PC-8201/8300 should be similar, if not identical.&lt;br /&gt;
&lt;br /&gt;
== Tokens ==&lt;br /&gt;
&lt;br /&gt;
Blank values indicate either that the token is unused or is used for something unknown.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! title=&amp;quot;Hexadecimal code point&amp;quot; | Hex&lt;br /&gt;
! title=&amp;quot;Decimal code point&amp;quot; | Dec&lt;br /&gt;
! title=&amp;quot;BASIC element the token stands for&amp;quot; | Token meaning&lt;br /&gt;
|-&lt;br /&gt;
|-&lt;br /&gt;
|80||128||END&lt;br /&gt;
|-&lt;br /&gt;
|81||129||FOR&lt;br /&gt;
|-&lt;br /&gt;
|82||130||NEXT&lt;br /&gt;
|-&lt;br /&gt;
|83||131||DATA&lt;br /&gt;
|-&lt;br /&gt;
|84||132||INPUT&lt;br /&gt;
|-&lt;br /&gt;
|85||133||DIM&lt;br /&gt;
|-&lt;br /&gt;
|86||134||READ&lt;br /&gt;
|-&lt;br /&gt;
|87||135||LET&lt;br /&gt;
|-&lt;br /&gt;
|88||136||GOTO&lt;br /&gt;
|-&lt;br /&gt;
|89||137||RUN&lt;br /&gt;
|-&lt;br /&gt;
|8A||138||IF&lt;br /&gt;
|-&lt;br /&gt;
|8B||139||RESTORE&lt;br /&gt;
|-&lt;br /&gt;
|8C||140||GOSUB&lt;br /&gt;
|-&lt;br /&gt;
|8D||141||RETURN&lt;br /&gt;
|-&lt;br /&gt;
|8E||142||REM&lt;br /&gt;
|-&lt;br /&gt;
|8F||143||STOP&lt;br /&gt;
|-&lt;br /&gt;
|90||144||WIDTH&lt;br /&gt;
|-&lt;br /&gt;
|91||145||ELSE&lt;br /&gt;
|-&lt;br /&gt;
|92||146||LINE&lt;br /&gt;
|-&lt;br /&gt;
|93||147||EDIT&lt;br /&gt;
|-&lt;br /&gt;
|94||148||ERROR&lt;br /&gt;
|-&lt;br /&gt;
|95||149||RESUME&lt;br /&gt;
|-&lt;br /&gt;
|96||150||OUT&lt;br /&gt;
|-&lt;br /&gt;
|97||151||ON&lt;br /&gt;
|-&lt;br /&gt;
|98||152||DSKO$&lt;br /&gt;
|-&lt;br /&gt;
|99||153||OPEN&lt;br /&gt;
|-&lt;br /&gt;
|9A||154||CLOSE&lt;br /&gt;
|-&lt;br /&gt;
|9B||155||LOAD&lt;br /&gt;
|-&lt;br /&gt;
|9C||156||MERGE&lt;br /&gt;
|-&lt;br /&gt;
|9D||157||FILES&lt;br /&gt;
|-&lt;br /&gt;
|9E||158||SAVE&lt;br /&gt;
|-&lt;br /&gt;
|9F||159||LFILES&lt;br /&gt;
|-&lt;br /&gt;
|A0||160||LPRINT&lt;br /&gt;
|-&lt;br /&gt;
|A1||161||DEF&lt;br /&gt;
|-&lt;br /&gt;
|A2||162||POKE&lt;br /&gt;
|-&lt;br /&gt;
|A3||163||PRINT&lt;br /&gt;
|-&lt;br /&gt;
|A4||164||CONT&lt;br /&gt;
|-&lt;br /&gt;
|A5||165||LIST&lt;br /&gt;
|-&lt;br /&gt;
|A6||166||LLIST&lt;br /&gt;
|-&lt;br /&gt;
|A7||167||CLEAR&lt;br /&gt;
|-&lt;br /&gt;
|A8||168||CLOAD&lt;br /&gt;
|-&lt;br /&gt;
|A9||169||CSAVE&lt;br /&gt;
|-&lt;br /&gt;
|AA||170||TIME$&lt;br /&gt;
|-&lt;br /&gt;
|AB||171||DATE$&lt;br /&gt;
|-&lt;br /&gt;
|AC||172||DAY$&lt;br /&gt;
|-&lt;br /&gt;
|AD||173||COM&lt;br /&gt;
|-&lt;br /&gt;
|AE||174||MDM&lt;br /&gt;
|-&lt;br /&gt;
|AF||175||KEY&lt;br /&gt;
|-&lt;br /&gt;
|B0||176||CLS&lt;br /&gt;
|-&lt;br /&gt;
|B1||177||BEEP&lt;br /&gt;
|-&lt;br /&gt;
|B2||178||SOUND&lt;br /&gt;
|-&lt;br /&gt;
|B3||179||LCOPY&lt;br /&gt;
|-&lt;br /&gt;
|B4||180||PSET&lt;br /&gt;
|-&lt;br /&gt;
|B5||181||PRESET&lt;br /&gt;
|-&lt;br /&gt;
|B6||182||MOTOR&lt;br /&gt;
|-&lt;br /&gt;
|B7||183||MAX&lt;br /&gt;
|-&lt;br /&gt;
|B8||184||POWER&lt;br /&gt;
|-&lt;br /&gt;
|B9||185||CALL&lt;br /&gt;
|-&lt;br /&gt;
|BA||186||MENU&lt;br /&gt;
|-&lt;br /&gt;
|BB||187||IPL&lt;br /&gt;
|-&lt;br /&gt;
|BC||188||NAME&lt;br /&gt;
|-&lt;br /&gt;
|BD||189||KILL&lt;br /&gt;
|-&lt;br /&gt;
|BE||190||SCREEN&lt;br /&gt;
|-&lt;br /&gt;
|BF||191||NEW&lt;br /&gt;
|-&lt;br /&gt;
|C0||192||TAB(&lt;br /&gt;
|-&lt;br /&gt;
|C1||193||TO&lt;br /&gt;
|-&lt;br /&gt;
|C2||194||USING&lt;br /&gt;
|-&lt;br /&gt;
|C3||195||VARPTR&lt;br /&gt;
|-&lt;br /&gt;
|C4||196||ERL&lt;br /&gt;
|-&lt;br /&gt;
|C5||197||ERR&lt;br /&gt;
|-&lt;br /&gt;
|C6||198||STRING$&lt;br /&gt;
|-&lt;br /&gt;
|C7||199||INSTR&lt;br /&gt;
|-&lt;br /&gt;
|C8||200||DSKI$&lt;br /&gt;
|-&lt;br /&gt;
|C9||201||INKEY$&lt;br /&gt;
|-&lt;br /&gt;
|CA||202||CSRLIN&lt;br /&gt;
|-&lt;br /&gt;
|CB||203||OFF&lt;br /&gt;
|-&lt;br /&gt;
|CC||204||HIMEM&lt;br /&gt;
|-&lt;br /&gt;
|CD||205||THEN&lt;br /&gt;
|-&lt;br /&gt;
|CE||206||NOT&lt;br /&gt;
|-&lt;br /&gt;
|CF||207||STEP&lt;br /&gt;
|-&lt;br /&gt;
|D0||208||+&lt;br /&gt;
|-&lt;br /&gt;
|D1||209||-&lt;br /&gt;
|-&lt;br /&gt;
|D2||210||*&lt;br /&gt;
|-&lt;br /&gt;
|D3||211||/&lt;br /&gt;
|-&lt;br /&gt;
|D4||212||^&lt;br /&gt;
|-&lt;br /&gt;
|D5||213||AND&lt;br /&gt;
|-&lt;br /&gt;
|D6||214||OR&lt;br /&gt;
|-&lt;br /&gt;
|D7||215||XOR&lt;br /&gt;
|-&lt;br /&gt;
|D8||216||EQV&lt;br /&gt;
|-&lt;br /&gt;
|D9||217||IMP&lt;br /&gt;
|-&lt;br /&gt;
|DA||218||MOD&lt;br /&gt;
|-&lt;br /&gt;
|DB||219||\&lt;br /&gt;
|-&lt;br /&gt;
|DC||220||&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|DD||221||=&lt;br /&gt;
|-&lt;br /&gt;
|DE||222||\|&lt;br /&gt;
|-&lt;br /&gt;
|DF||223||SGN&lt;br /&gt;
|-&lt;br /&gt;
|E0||224||INT&lt;br /&gt;
|-&lt;br /&gt;
|E1||225||ABS&lt;br /&gt;
|-&lt;br /&gt;
|E2||226||FRE&lt;br /&gt;
|-&lt;br /&gt;
|E3||227||INP&lt;br /&gt;
|-&lt;br /&gt;
|E4||228||LPOS&lt;br /&gt;
|-&lt;br /&gt;
|E5||229||POS&lt;br /&gt;
|-&lt;br /&gt;
|E6||230||SQR&lt;br /&gt;
|-&lt;br /&gt;
|E7||231||RND&lt;br /&gt;
|-&lt;br /&gt;
|E8||232||LOG&lt;br /&gt;
|-&lt;br /&gt;
|E9||233||EXP&lt;br /&gt;
|-&lt;br /&gt;
|EA||234||COS&lt;br /&gt;
|-&lt;br /&gt;
|EB||235||SIN&lt;br /&gt;
|-&lt;br /&gt;
|EC||236||TAN&lt;br /&gt;
|-&lt;br /&gt;
|ED||237||ATN&lt;br /&gt;
|-&lt;br /&gt;
|EE||238||PEEK&lt;br /&gt;
|-&lt;br /&gt;
|EF||239||EOF&lt;br /&gt;
|-&lt;br /&gt;
|F0||240||LOC&lt;br /&gt;
|-&lt;br /&gt;
|F1||241||LOF&lt;br /&gt;
|-&lt;br /&gt;
|F2||242||CINT&lt;br /&gt;
|-&lt;br /&gt;
|F3||243||CSNG&lt;br /&gt;
|-&lt;br /&gt;
|F4||244||CDBL&lt;br /&gt;
|-&lt;br /&gt;
|F5||245||FIX&lt;br /&gt;
|-&lt;br /&gt;
|F6||246||LEN&lt;br /&gt;
|-&lt;br /&gt;
|F7||247||STR$&lt;br /&gt;
|-&lt;br /&gt;
|F8||248||VAL&lt;br /&gt;
|-&lt;br /&gt;
|F9||249||ASC&lt;br /&gt;
|-&lt;br /&gt;
|FA||250||CHR$&lt;br /&gt;
|-&lt;br /&gt;
|FB||251||SPACE$&lt;br /&gt;
|-&lt;br /&gt;
|FC||252||LEFT$&lt;br /&gt;
|-&lt;br /&gt;
|FD||253||RIGHT$&lt;br /&gt;
|-&lt;br /&gt;
|FE||254||MID$&lt;br /&gt;
|-&lt;br /&gt;
|FF||255||(REM QUOTE)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Format documentation ==&lt;br /&gt;
* [http://www.club100.org/library/ups/tokens.do BASIC program to create a table of tokens]&lt;br /&gt;
&lt;br /&gt;
== Other links ==&lt;br /&gt;
&lt;br /&gt;
* [https://sourceforge.net/projects/virtualt/ A Tandy 200 &amp;amp; Model 100/102 emulator]&lt;br /&gt;
* [http://bitchin100.com/CloudT/ A TRS-80 Model 100 emulator that runs in a web browser]&lt;br /&gt;
&lt;br /&gt;
[[Category:Microsoft]]&lt;/div&gt;</summary>
		<author><name>Hackerb9</name></author>	</entry>

	<entry>
		<id>http://fileformats.archiveteam.org/wiki/Tandy_200_BASIC_tokenized_file</id>
		<title>Tandy 200 BASIC tokenized file</title>
		<link rel="alternate" type="text/html" href="http://fileformats.archiveteam.org/wiki/Tandy_200_BASIC_tokenized_file"/>
				<updated>2022-07-24T11:40:25Z</updated>
		
		<summary type="html">&lt;p&gt;Hackerb9: Created page and added the table of tokens from a genuine Tandy 200&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{FormatInfo&lt;br /&gt;
|subcat=Source code&lt;br /&gt;
|subcat2=Tokenized BASIC&lt;br /&gt;
|released=1984&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
'''Tandy 200 BASIC''' was a version of Microsoft BASIC for the Radio Shack Tandy 200 computer. The tokenization for the TRS-80 Model 100/102 and NEC PC-8201/8300 should be similar, if not identical.&lt;br /&gt;
&lt;br /&gt;
== Tokens ==&lt;br /&gt;
&lt;br /&gt;
Blank values indicate either that the token is unused or is used for something unknown.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! title=&amp;quot;Hexadecimal code point&amp;quot; | Hex&lt;br /&gt;
! title=&amp;quot;Decimal code point&amp;quot; | Dec&lt;br /&gt;
! title=&amp;quot;BASIC element the token stands for&amp;quot; | Token meaning&lt;br /&gt;
|-&lt;br /&gt;
|-&lt;br /&gt;
|80||128||END&lt;br /&gt;
|-&lt;br /&gt;
|81||129||FOR&lt;br /&gt;
|-&lt;br /&gt;
|82||130||NEXT&lt;br /&gt;
|-&lt;br /&gt;
|83||131||DATA&lt;br /&gt;
|-&lt;br /&gt;
|84||132||INPUT&lt;br /&gt;
|-&lt;br /&gt;
|85||133||DIM&lt;br /&gt;
|-&lt;br /&gt;
|86||134||READ&lt;br /&gt;
|-&lt;br /&gt;
|87||135||LET&lt;br /&gt;
|-&lt;br /&gt;
|88||136||GOTO&lt;br /&gt;
|-&lt;br /&gt;
|89||137||RUN&lt;br /&gt;
|-&lt;br /&gt;
|8A||138||IF&lt;br /&gt;
|-&lt;br /&gt;
|8B||139||RESTORE&lt;br /&gt;
|-&lt;br /&gt;
|8C||140||GOSUB&lt;br /&gt;
|-&lt;br /&gt;
|8D||141||RETURN&lt;br /&gt;
|-&lt;br /&gt;
|8E||142||REM&lt;br /&gt;
|-&lt;br /&gt;
|8F||143||STOP&lt;br /&gt;
|-&lt;br /&gt;
|90||144||WIDTH&lt;br /&gt;
|-&lt;br /&gt;
|91||145||ELSE&lt;br /&gt;
|-&lt;br /&gt;
|92||146||LINE&lt;br /&gt;
|-&lt;br /&gt;
|93||147||EDIT&lt;br /&gt;
|-&lt;br /&gt;
|94||148||ERROR&lt;br /&gt;
|-&lt;br /&gt;
|95||149||RESUME&lt;br /&gt;
|-&lt;br /&gt;
|96||150||OUT&lt;br /&gt;
|-&lt;br /&gt;
|97||151||ON&lt;br /&gt;
|-&lt;br /&gt;
|98||152||DSKO$&lt;br /&gt;
|-&lt;br /&gt;
|99||153||OPEN&lt;br /&gt;
|-&lt;br /&gt;
|9A||154||CLOSE&lt;br /&gt;
|-&lt;br /&gt;
|9B||155||LOAD&lt;br /&gt;
|-&lt;br /&gt;
|9C||156||MERGE&lt;br /&gt;
|-&lt;br /&gt;
|9D||157||FILES&lt;br /&gt;
|-&lt;br /&gt;
|9E||158||SAVE&lt;br /&gt;
|-&lt;br /&gt;
|9F||159||LFILES&lt;br /&gt;
|-&lt;br /&gt;
|A0||160||LPRINT&lt;br /&gt;
|-&lt;br /&gt;
|A1||161||DEF&lt;br /&gt;
|-&lt;br /&gt;
|A2||162||POKE&lt;br /&gt;
|-&lt;br /&gt;
|A3||163||PRINT&lt;br /&gt;
|-&lt;br /&gt;
|A4||164||CONT&lt;br /&gt;
|-&lt;br /&gt;
|A5||165||LIST&lt;br /&gt;
|-&lt;br /&gt;
|A6||166||LLIST&lt;br /&gt;
|-&lt;br /&gt;
|A7||167||CLEAR&lt;br /&gt;
|-&lt;br /&gt;
|A8||168||CLOAD&lt;br /&gt;
|-&lt;br /&gt;
|A9||169||CSAVE&lt;br /&gt;
|-&lt;br /&gt;
|AA||170||TIME$&lt;br /&gt;
|-&lt;br /&gt;
|AB||171||DATE$&lt;br /&gt;
|-&lt;br /&gt;
|AC||172||DAY$&lt;br /&gt;
|-&lt;br /&gt;
|AD||173||COM&lt;br /&gt;
|-&lt;br /&gt;
|AE||174||MDM&lt;br /&gt;
|-&lt;br /&gt;
|AF||175||KEY&lt;br /&gt;
|-&lt;br /&gt;
|B0||176||CLS&lt;br /&gt;
|-&lt;br /&gt;
|B1||177||BEEP&lt;br /&gt;
|-&lt;br /&gt;
|B2||178||SOUND&lt;br /&gt;
|-&lt;br /&gt;
|B3||179||LCOPY&lt;br /&gt;
|-&lt;br /&gt;
|B4||180||PSET&lt;br /&gt;
|-&lt;br /&gt;
|B5||181||PRESET&lt;br /&gt;
|-&lt;br /&gt;
|B6||182||MOTOR&lt;br /&gt;
|-&lt;br /&gt;
|B7||183||MAX&lt;br /&gt;
|-&lt;br /&gt;
|B8||184||POWER&lt;br /&gt;
|-&lt;br /&gt;
|B9||185||CALL&lt;br /&gt;
|-&lt;br /&gt;
|BA||186||MENU&lt;br /&gt;
|-&lt;br /&gt;
|BB||187||IPL&lt;br /&gt;
|-&lt;br /&gt;
|BC||188||NAME&lt;br /&gt;
|-&lt;br /&gt;
|BD||189||KILL&lt;br /&gt;
|-&lt;br /&gt;
|BE||190||SCREEN&lt;br /&gt;
|-&lt;br /&gt;
|BF||191||NEW&lt;br /&gt;
|-&lt;br /&gt;
|C0||192||TAB(&lt;br /&gt;
|-&lt;br /&gt;
|C1||193||TO&lt;br /&gt;
|-&lt;br /&gt;
|C2||194||USING&lt;br /&gt;
|-&lt;br /&gt;
|C3||195||VARPTR&lt;br /&gt;
|-&lt;br /&gt;
|C4||196||ERL&lt;br /&gt;
|-&lt;br /&gt;
|C5||197||ERR&lt;br /&gt;
|-&lt;br /&gt;
|C6||198||STRING$&lt;br /&gt;
|-&lt;br /&gt;
|C7||199||INSTR&lt;br /&gt;
|-&lt;br /&gt;
|C8||200||DSKI$&lt;br /&gt;
|-&lt;br /&gt;
|C9||201||INKEY$&lt;br /&gt;
|-&lt;br /&gt;
|CA||202||CSRLIN&lt;br /&gt;
|-&lt;br /&gt;
|CB||203||OFF&lt;br /&gt;
|-&lt;br /&gt;
|CC||204||HIMEM&lt;br /&gt;
|-&lt;br /&gt;
|CD||205||THEN&lt;br /&gt;
|-&lt;br /&gt;
|CE||206||NOT&lt;br /&gt;
|-&lt;br /&gt;
|CF||207||STEP&lt;br /&gt;
|-&lt;br /&gt;
|D0||208||+&lt;br /&gt;
|-&lt;br /&gt;
|D1||209||-&lt;br /&gt;
|-&lt;br /&gt;
|D2||210||*&lt;br /&gt;
|-&lt;br /&gt;
|D3||211||/&lt;br /&gt;
|-&lt;br /&gt;
|D4||212||^&lt;br /&gt;
|-&lt;br /&gt;
|D5||213||AND&lt;br /&gt;
|-&lt;br /&gt;
|D6||214||OR&lt;br /&gt;
|-&lt;br /&gt;
|D7||215||XOR&lt;br /&gt;
|-&lt;br /&gt;
|D8||216||EQV&lt;br /&gt;
|-&lt;br /&gt;
|D9||217||IMP&lt;br /&gt;
|-&lt;br /&gt;
|DA||218||MOD&lt;br /&gt;
|-&lt;br /&gt;
|DB||219||\\&lt;br /&gt;
|-&lt;br /&gt;
|DC||220||&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|DD||221||=&lt;br /&gt;
|-&lt;br /&gt;
|DE||222||\|&lt;br /&gt;
|-&lt;br /&gt;
|DF||223||SGN&lt;br /&gt;
|-&lt;br /&gt;
|E0||224||INT&lt;br /&gt;
|-&lt;br /&gt;
|E1||225||ABS&lt;br /&gt;
|-&lt;br /&gt;
|E2||226||FRE&lt;br /&gt;
|-&lt;br /&gt;
|E3||227||INP&lt;br /&gt;
|-&lt;br /&gt;
|E4||228||LPOS&lt;br /&gt;
|-&lt;br /&gt;
|E5||229||POS&lt;br /&gt;
|-&lt;br /&gt;
|E6||230||SQR&lt;br /&gt;
|-&lt;br /&gt;
|E7||231||RND&lt;br /&gt;
|-&lt;br /&gt;
|E8||232||LOG&lt;br /&gt;
|-&lt;br /&gt;
|E9||233||EXP&lt;br /&gt;
|-&lt;br /&gt;
|EA||234||COS&lt;br /&gt;
|-&lt;br /&gt;
|EB||235||SIN&lt;br /&gt;
|-&lt;br /&gt;
|EC||236||TAN&lt;br /&gt;
|-&lt;br /&gt;
|ED||237||ATN&lt;br /&gt;
|-&lt;br /&gt;
|EE||238||PEEK&lt;br /&gt;
|-&lt;br /&gt;
|EF||239||EOF&lt;br /&gt;
|-&lt;br /&gt;
|F0||240||LOC&lt;br /&gt;
|-&lt;br /&gt;
|F1||241||LOF&lt;br /&gt;
|-&lt;br /&gt;
|F2||242||CINT&lt;br /&gt;
|-&lt;br /&gt;
|F3||243||CSNG&lt;br /&gt;
|-&lt;br /&gt;
|F4||244||CDBL&lt;br /&gt;
|-&lt;br /&gt;
|F5||245||FIX&lt;br /&gt;
|-&lt;br /&gt;
|F6||246||LEN&lt;br /&gt;
|-&lt;br /&gt;
|F7||247||STR$&lt;br /&gt;
|-&lt;br /&gt;
|F8||248||VAL&lt;br /&gt;
|-&lt;br /&gt;
|F9||249||ASC&lt;br /&gt;
|-&lt;br /&gt;
|FA||250||CHR$&lt;br /&gt;
|-&lt;br /&gt;
|FB||251||SPACE$&lt;br /&gt;
|-&lt;br /&gt;
|FC||252||LEFT$&lt;br /&gt;
|-&lt;br /&gt;
|FD||253||RIGHT$&lt;br /&gt;
|-&lt;br /&gt;
|FE||254||MID$&lt;br /&gt;
|-&lt;br /&gt;
|FF||255||(REM QUOTE)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Format documentation ==&lt;br /&gt;
* [http://www.club100.org/library/ups/tokens.do BASIC program to create a table of tokens]&lt;br /&gt;
&lt;br /&gt;
== Other links ==&lt;br /&gt;
&lt;br /&gt;
* [https://sourceforge.net/projects/virtualt/ A Tandy 200 &amp;amp; Model 100/102 emulator]&lt;br /&gt;
* [http://bitchin100.com/CloudT/ A TRS-80 Model 100 emulator that runs in a web browser]&lt;br /&gt;
&lt;br /&gt;
[[Category:Microsoft]]&lt;/div&gt;</summary>
		<author><name>Hackerb9</name></author>	</entry>

	</feed>