https://bitchin100.com/wiki/api.php?action=feedcontributions&user=64.81.88.222&feedformat=atom
Bitchin100 DocGarden - User contributions [en]
2024-03-28T17:26:53Z
User contributions
MediaWiki 1.39.3
https://bitchin100.com/wiki/index.php?title=DLPilot_Usage&diff=898
DLPilot Usage
2009-01-31T06:07:02Z
<p>64.81.88.222: /* Viewing .DO files on your Palm */</p>
<hr />
<div>DLPilot is designed to not require any documentation of its own.<br />
Rather, it is for the most part a "slave" to whatever disk client you<br />
choose.<br />
<br />
== Compatible disk clients ==<br />
<br />
* TS-DOS<br />
* TEENY<br />
* WP-2 Disk client<br />
* Booster Pak (TS-DOS)<br />
* POWR-DOS<br />
* TINY<br />
<br />
TS-DOS on a Mombo, Rex, or Remem is an excellent solution.<br />
<br />
If you don't have a ROM solution, TEENY is the sensible alternative.<br />
<br />
== Getting Connected ==<br />
<br />
To plug your Palm to Model T, you need an adapter that bridges the<br />
9-pin female adapter on your Palm cradle or cable to the 25-pin female<br />
port on your Model T. That means your adapter should be 25-pin male to<br />
9-pin male, wired straight-through.<br />
<br />
Note: the connection '''must''' be "straight through." '''DO NOT''' use a crossover<br />
cable like the Club100 "Complink" cable. Your Palm cradle is wired like<br />
a modem (DCE) not a terminal (DTE). The Complink cable is designed for<br />
connecting a Model T to another terminal (your PC). So, it is<br />
inappropriate for this purpose.<br />
<br />
You may need an adapter AND a gender changer depending on what adapters<br />
you have laying around.<br />
<br />
== Usage ==<br />
<br />
Install dlp.prc by whatever means you normally install Palm<br />
applications. On Linux, I use pilot-xfer. On Windows, you probably use<br />
Palm Desktop "Install."<br />
<br />
Following install, look in your applications and launch the icon that<br />
looks like a Model 100.<br />
<br />
Click the "ON" button. This turns on the serial port power on your Palm.<br />
It won't work if you don't click the ON button. Yeah, yeah, but sorry, I<br />
find this amusing and am unlikely to change it.<br />
<br />
At this point, you should be able to completely remote control DLPilot<br />
from your Model T. You can save files to DLPilot and load them back to<br />
your laptop by following the TS-DOS documentation.<br />
<br />
== Viewing .DO files on your Palm ==<br />
<br />
So, you've transferred a .DO file to your Palm and you want to look at<br />
it or edit it on the Palm. You can use SiEd from the Files section of<br />
the DLPilot Yahoo group.<br />
<br />
DO files are converted to/form PalmDOC format on the fly by DLPilot<br />
while using your disk client. Any document reader software that supports<br />
the PalmDOC format (which should be all of them) can view the files.<br />
<br />
NOTE: DO files from a WP-2 are not the same as DO files from a M100. DO files from a WP-2 may not be viewed on the Palm. Your best bet with the WP-2 is to convert the files to .DA files, and save those to the Palm.<br />
<br />
== Converting Files to/from .pdb Format ==<br />
<br />
In order to transfer files to your Palm, they must be in the Palm<br />
Database (pdb) format. Further, to use with DLPilot, the files must<br />
be PalmDOC files. This is a special binary format for representing<br />
files > 4K on the Palm as a single pdb.<br />
<br />
For Windows, Steve Adolph reported success using the TiBR converter:<br />
<br />
[http://www.indevsoftware.com/product.php?Id=13&Section=&ep=88 TiBR Converter (Windows)]<br />
<br />
For Linux, you can use txt2pdbdoc:<br />
<br />
[http://homepage.mac.com/pauljlucas/software/txt2pdbdoc txt2pdbdoc]<br />
<br />
== Transferring .pdb Files from Palm to PC ==<br />
<br />
For Linux, this is straightforward. You simply use pilot-xfer.<br />
<br />
For Windows, you use the Palm Desktop and do a Hotsync.<br />
(TBD: step by step instructions)<br />
<br />
== Manipulating Files on Palm ==<br />
<br />
You may need a file manipulation program on your Palm. I believe you can<br />
use it to mark files for Hotsync. Also, you can use it to transfer files<br />
to other Palms over the IR link, or transfer .pdb's to a flash card if<br />
your Palm supports it.<br />
<br />
[http://nosleepsoftware.sourceforge.net/index.php?page=filez nosleep's FileZ]</div>
64.81.88.222
https://bitchin100.com/wiki/index.php?title=DLPilot_Usage&diff=897
DLPilot Usage
2009-01-31T06:06:44Z
<p>64.81.88.222: /* Viewing .DO files on your Palm */</p>
<hr />
<div>DLPilot is designed to not require any documentation of its own.<br />
Rather, it is for the most part a "slave" to whatever disk client you<br />
choose.<br />
<br />
== Compatible disk clients ==<br />
<br />
* TS-DOS<br />
* TEENY<br />
* WP-2 Disk client<br />
* Booster Pak (TS-DOS)<br />
* POWR-DOS<br />
* TINY<br />
<br />
TS-DOS on a Mombo, Rex, or Remem is an excellent solution.<br />
<br />
If you don't have a ROM solution, TEENY is the sensible alternative.<br />
<br />
== Getting Connected ==<br />
<br />
To plug your Palm to Model T, you need an adapter that bridges the<br />
9-pin female adapter on your Palm cradle or cable to the 25-pin female<br />
port on your Model T. That means your adapter should be 25-pin male to<br />
9-pin male, wired straight-through.<br />
<br />
Note: the connection '''must''' be "straight through." '''DO NOT''' use a crossover<br />
cable like the Club100 "Complink" cable. Your Palm cradle is wired like<br />
a modem (DCE) not a terminal (DTE). The Complink cable is designed for<br />
connecting a Model T to another terminal (your PC). So, it is<br />
inappropriate for this purpose.<br />
<br />
You may need an adapter AND a gender changer depending on what adapters<br />
you have laying around.<br />
<br />
== Usage ==<br />
<br />
Install dlp.prc by whatever means you normally install Palm<br />
applications. On Linux, I use pilot-xfer. On Windows, you probably use<br />
Palm Desktop "Install."<br />
<br />
Following install, look in your applications and launch the icon that<br />
looks like a Model 100.<br />
<br />
Click the "ON" button. This turns on the serial port power on your Palm.<br />
It won't work if you don't click the ON button. Yeah, yeah, but sorry, I<br />
find this amusing and am unlikely to change it.<br />
<br />
At this point, you should be able to completely remote control DLPilot<br />
from your Model T. You can save files to DLPilot and load them back to<br />
your laptop by following the TS-DOS documentation.<br />
<br />
== Viewing .DO files on your Palm ==<br />
<br />
So, you've transferred a .DO file to your Palm and you want to look at<br />
it or edit it on the Palm. You can use SiEd from the Files section of<br />
the DLPilot Yahoo group.<br />
<br />
DO files are converted to/form PalmDOC format on the fly by DLPilot<br />
while using your disk client. Any document reader software that supports<br />
the PalmDOC format (which should be all of them) can view the files.<br />
<br />
NOTE: DO files from your WP-2 are not the same as DO files from a M100. DO files from a WP-2 may not be viewed on the Palm. Your best bet with the WP-2 is to convert the files to .DA files, and save those to the Palm.<br />
<br />
== Converting Files to/from .pdb Format ==<br />
<br />
In order to transfer files to your Palm, they must be in the Palm<br />
Database (pdb) format. Further, to use with DLPilot, the files must<br />
be PalmDOC files. This is a special binary format for representing<br />
files > 4K on the Palm as a single pdb.<br />
<br />
For Windows, Steve Adolph reported success using the TiBR converter:<br />
<br />
[http://www.indevsoftware.com/product.php?Id=13&Section=&ep=88 TiBR Converter (Windows)]<br />
<br />
For Linux, you can use txt2pdbdoc:<br />
<br />
[http://homepage.mac.com/pauljlucas/software/txt2pdbdoc txt2pdbdoc]<br />
<br />
== Transferring .pdb Files from Palm to PC ==<br />
<br />
For Linux, this is straightforward. You simply use pilot-xfer.<br />
<br />
For Windows, you use the Palm Desktop and do a Hotsync.<br />
(TBD: step by step instructions)<br />
<br />
== Manipulating Files on Palm ==<br />
<br />
You may need a file manipulation program on your Palm. I believe you can<br />
use it to mark files for Hotsync. Also, you can use it to transfer files<br />
to other Palms over the IR link, or transfer .pdb's to a flash card if<br />
your Palm supports it.<br />
<br />
[http://nosleepsoftware.sourceforge.net/index.php?page=filez nosleep's FileZ]</div>
64.81.88.222
https://bitchin100.com/wiki/index.php?title=WP2_Diskette_Mode&diff=896
WP2 Diskette Mode
2009-01-31T06:04:45Z
<p>64.81.88.222: New page: == Overview == WP2 Diskette Mode is a TPDD client built-in to the WP-2. It is compatible with LaddieCon, DLPilot, and DLPlus.</p>
<hr />
<div>== Overview ==<br />
<br />
WP2 Diskette Mode is a TPDD client built-in to the WP-2. It is compatible with [[LaddieCon]], [[DLPilot]], and [[DLPlus]].</div>
64.81.88.222
https://bitchin100.com/wiki/index.php?title=Model_T_DocGarden&diff=895
Model T DocGarden
2009-01-31T06:03:46Z
<p>64.81.88.222: /* Clients */</p>
<hr />
<div>These pages are devoted to the Model T:<br />
<br />
TRS-80 Model 100, Tandy Model 102, KC-85, NEC 8201A, NEC 8300, Olivetti M10, Tandy Model 200, and the WP-2<br />
<br />
== Classic Article Repubs ==<br />
<br />
We hope to republish one or more articles from the Golden Era of the Model T every month:<br />
<br />
[[:Category:Model 100 Classics]]<br />
<br />
== One-Liners ==<br />
<br />
This is a collection of Microsoft BASIC programs that<br />
* Do something interesting or useful<br />
* With only a single line of code<br />
<br />
One-liners are bite-sized computer programs on a human scale. You are encouraged to type them in manually (by hand) and study their operation.<br />
<br />
[[Model 100/102 Compatible One-Liners]]<br />
<br />
== Tandy Disk Drive and Emulators ==<br />
<br />
TPDD emulators, in concert with a compatible disk clients like<br />
TS-DOS, TEENY, POWR-DOS, FLOPPY.CO, the Booster Pak, or the <br />
WP-2 built-in Diskette client are the most "advanced" way to<br />
accurately and quickly transfer all file types including binary<br />
files to and from your Model T laptop. There are different<br />
options for the server side on modern operating systems and<br />
devices:<br />
<br />
=== Servers ===<br />
<br />
[[LaddieCon]] is a TPDD emulator for Windows written in C#.Net.<br />
<br />
[[DLPilot]] is a TPDD emulator for PalmOS devices.<br />
<br />
[[DLPlus]] is a TPDD emulator for Linux, BSD, and MacOSX.<br />
<br />
[[NADSBox]] is an advanced stand-alone TPDD emulation device that uses SD cards. It implements multiple levels of TS-DOS directory extensions<br />
<br />
[[Desklink]] is a DOS based TPDD emulator which implements a single-level of the TS-DOS directory extensions<br />
<br />
[[Jan's DOS-Based Docking Station]]<br />
<br />
=== Clients ===<br />
<br />
[[TS-DOS]] is a nice DOS and GUI available in RAM and ROM versions. It is the only client that supports subdirectories given special servers (no real TPDD supports subdirectories).<br />
<br />
[[TEENY]] is a very small RAM-based TPDD client<br />
<br />
[[LAPDOS]] is a DOS PC based TPDD client.<br />
<br />
[[PDD]] is a DOS PC based TPDD client.<br />
<br />
[[WP2 Diskette Mode]] is a TPDD client built-in to the WP-2. It is compatible with LaddieCon, DLPilot, and DLPlus.<br />
<br />
=== Real TPDD and TPDD-2 ===<br />
<br />
[[Differences]] between TPDD-1 and TPDD-2<br />
<br />
== Simple Text File Transfer (No Client) ==<br />
<br />
You can use any "terminal program" to transfer text files to<br />
and from your Model T laptop. Here are some tutorials:<br />
<br />
[[Text File Transfer using Hyperterminal]]<br />
<br />
[http://web.mac.com/lorddoomicus/Doomd/Blog/Entries/2006/9/10_Connecting_a_Tandy_102_Computer_to_a_Mac.html Text File Transfer to Mac using Z-Term]<br />
<br />
== File Storage using MP3 Player ==<br />
<br />
[[File storage with mp3 player]]<br />
<br />
== Model T Software ==<br />
<br />
[[VirtualT]] Model 100/102, T200, NEC 8201A, M10 emulator<br />
<br />
[[mtcpm]] CP/M for the Tandy 100/102/200<br />
<br />
[[RAM4TH]]<br />
<br />
== Model T Hardware Hacks and Troubleshooting ==<br />
<br />
[[Splitting the Model 100/102/200 case]]<br />
<br />
[[Recovering an Unresponsive Laptop]]<br />
<br />
[[International Keyboard Support]]<br />
<br />
[[Repairing Problem Keys]]<br />
<br />
== Model T Hardware Projects ==<br />
<br />
[[Remem]] is the ultimate Model T memory upgrade<br />
<br />
:[http://lists.bitchin100.com/listinfo.cgi/remem-users-bitchin100.com remem-users mailing list] This is a support list for remem users.<br />
:[[Remem Software HOWTO's]]<br />
<br />
[[REX]] is a flash OptROM emulator/switcher<br />
<br />
[[REX2]] is a upcoming flash OptROM emulator/switcher with support for a 64K all-RAM mode. This permits running with a patched main ROM, or the upcoming [[mtcpm]] (Model T CP/M)<br />
<br />
[[NADSBox]] is a stand-alone TPDD emulation device that uses SD cards<br />
<br />
[[Mikrokolor]] Is a Color Graphics interface for the Model 100. Allows for 40x80 character graphics/text<br />
<br />
== Model T Developer Reference ==<br />
<br />
[[String Handling]]<br />
<br />
[[ROM Hooks]]<br />
<br />
[[RAM Variables]]<br />
<br />
[[Option ROM Programming]]<br />
<br />
[[8085 Reference]]<br />
<br />
[[Low Level Filesystem Access]]<br />
<br />
[[Low Level LCD Access]]<br />
<br />
[[Direct Keyboard Access]]<br />
<br />
[[Serial Port Access]]<br />
<br />
[[CO File Format]]<br />
<br />
[[BCR Port Access]]<br />
<br />
[[TPDD Protocol]]<br />
<br />
[[Relocating Loader (RLC) Format]]<br />
<br />
[[Error Codes]]<br />
<br />
[[Doing Binary In BASIC]]<br />
<br />
== Other Topics ==<br />
<br />
== Model T Links ==<br />
<br />
[http://club100.org Rick Hanson's Club 100]<br />
<br />
[http://www.istop.com/%7Esadolph/remem_home.html Steve Adolph's Remem Site]<br />
<br />
[http://sliderule.mraiow.com/wiki/Portable_Computer_Index#T Chris Osburn's Calculating Instruments]<br />
<br />
[http://kenpettit.com/projects.html Ken Pettit's Model T Projects]</div>
64.81.88.222
https://bitchin100.com/wiki/index.php?title=Model_T_TCP_Architecture&diff=881
Model T TCP Architecture
2009-01-24T18:54:52Z
<p>64.81.88.222: /* Goals */</p>
<hr />
<div>== Overview ==<br />
<br />
Presumably, a TCP stack on the Model 100 cannot be done. The 8085 is just too underpowered. All the more reason to do it, right?<br />
<br />
This article is a place to hash out goals, anti-goals, and a design<br />
<br />
== Goals ==<br />
<br />
* Phase 1<br />
** SLIP only<br />
** <br />
* Phase 2<br />
** Implement [http://www.faqs.org/rfcs/rfc1144.html header compression]<br />
<br />
== Anti-Goals ==<br />
<br />
== Design ==</div>
64.81.88.222
https://bitchin100.com/wiki/index.php?title=Model_T_TCP_Architecture&diff=880
Model T TCP Architecture
2009-01-24T18:49:57Z
<p>64.81.88.222: /* Overview */</p>
<hr />
<div>== Overview ==<br />
<br />
Presumably, a TCP stack on the Model 100 cannot be done. The 8085 is just too underpowered. All the more reason to do it, right?<br />
<br />
This article is a place to hash out goals, anti-goals, and a design<br />
<br />
== Goals ==<br />
<br />
== Anti-Goals ==<br />
<br />
== Design ==</div>
64.81.88.222
https://bitchin100.com/wiki/index.php?title=Model_T_TCP_Architecture&diff=879
Model T TCP Architecture
2009-01-24T18:49:21Z
<p>64.81.88.222: New page: == Overview == Presumably, a TCP stack on the Model 100 cannot be done. All the more reason to do it, right? This article is a place to hash out goals, anti-goals, and a design == Goals...</p>
<hr />
<div>== Overview ==<br />
<br />
Presumably, a TCP stack on the Model 100 cannot be done. All the more reason to do it, right?<br />
<br />
This article is a place to hash out goals, anti-goals, and a design<br />
<br />
== Goals ==<br />
<br />
== Anti-Goals ==<br />
<br />
== Design ==</div>
64.81.88.222
https://bitchin100.com/wiki/index.php?title=ROM_Addresses:_Getting_BASIC_to_do_What_You_Want&diff=878
ROM Addresses: Getting BASIC to do What You Want
2009-01-23T16:29:01Z
<p>64.81.88.222: /* Jake's ROM Addresses For BASIC Keywords */</p>
<hr />
<div>How does BASIC do what you tell it to do? Clues to the language's subservience lie in ROM.<br />
<br />
'''<big>By JAKE COMMANDER<br/>Portable l00 September 1983, pg. 24</big>'''<br />
<br />
How on earth does Basic know what to do? All those statements, commands, and functions, yet the interpreter untiringly plods through your code always knowing what's required next. Just how does it do it?<br />
<br />
Well, if the answer were simple, everybody would be writing BASIC interpreters and putting Microsoft out of business. But it is possible to follow at least some of the pathways Basic uses to perform its duties.<br />
<br />
Most addresses of the ROM routines which comprise BASIC are held in two tables. These can be unraveled to give a list of routines used to perform various tasks.<br />
<br />
== Jump Addresses ==<br />
<br />
One table contains jump addresses for the commands (or verbs, as it were) which will always be the first thing the interpreter picks up from a statement. The whole repertoire of such commands is catered for the table located at 0262 hex.<br />
<br />
BASIC gets the appropriate jump address by using the token number for the command it's about to execute. All tokens are numbers from 128 to 255; therefore subtracting 128 gives numbers from zero to 127. As each jump address in the table is two bytes long, the token (minus 128) is multiplied by two to give an offset into the table. This points straight at the address which is needed. The two-byte address is picked up and jumped to ? and we're now executing a BASIC command in pure machine code.<br />
<br />
What happens next depends entirely on the machine code for the command itself. Various syntaxes are allowed for some commands but not for others. For instance, the print command would allow an expression such as <code>TAB(22);l/3</code>, so would an <code>LPRINT</code>. But a <code>LET</code> would have none of that. <code>LET X = TAB(22); 1/3</code> would have you on the carpet in no time.<br />
<br />
Also various combinations of tokens can do different things. The comparison operators, for example, can be used pretty much interchangeably. These operators, >? <> = < , etc are all OK syntactically. This versatility means a table for such a wide set of possibilities is nigh impossible.<br />
<br />
== Second Table ==<br />
<br />
However, there is a second table at location 004E in the ROM. This contains many addresses used in the evaluation of Basic math functions and expressions. These are extracted and jumped to in a similar fashion to the first table.<br />
<br />
Any BASIC word excluded from either of these tables is handled separately by the interpreter according to its particular use. However, out of a possible 128 tokens, these two tables give us a mechanism by which we can follow the machine-code execution of many of them. It is the combination of these routines and the syntax checking required to logically execute them that makes up an interpreter.<br />
<br />
The following list has been compiled from the two tables I've described and a disassembly of other parts of the ROM. It shows the entry points for all important BASIC statements and functions. Certain functions can have more than one possible syntactic use and the list does not cover all such uses. (An example is the statement <code>OFF</code>, which can be <code>SOUND OFF</code> or <code>MOTOR OFF</code> etc.) The list is in four columns. The first is the address in ROM where the BASIC word occurs in the vocabulary table. The second entry is the word itself. Third is the token assigned to that word when it is encoded by the BASIC interpreter.<br />
<br />
== Fourth Column ==<br />
<br />
The fourth column contains the address the interpreter jumps to to execute the token representing the statement or function desired. Once again, some statements can have more than one use such as <code>MID$(LH$)=RH$</code>, and <code>LH$=MID$(RH$)</code>. In these cases, two addresses are given: one for use on the left hand side of the equals sign and one for the right hand side of the sign.<br />
<br />
Perhaps unsurprisingly, things get a little more complicated with the mathematical functions in BASIC. It's not simply a matter of taking an address for, say, a multiply routine and then jumping to it. The BASIC interpreter has to know the numeric type of operator it has to work on. For instance, with the addition operator, BASIC has four choices:<br />
<br />
# Signed integer<br />
# Single precision<br />
# Double precision<br />
# String<br />
<br />
None of the other binary operators allow string manipulation, so they're limited to the numeric variable types only.<br />
<br />
The addresses of these binary operators can be confirmed (if you need confirmation) from three short tables in ROM, one each for double precision, single precision, and integer numbers respectively. <br />
<br />
The tables contain six addresses apiece for addition, subtraction, multiplication, division, exponentiation, and comparison. Rather than clutter the token-addresses table, these addresses are contained separately at the end.<br />
<br />
In a following article, I'll be looking at ways to use some of these addresses in your own machine-code programs. For the more adventurous, an experiment will probably prove irresistible. Remember, though, in a RAM-file machine such as the Model 100, a lock-up may cost you all your files. Use caution.<br />
<br />
== Jake's ROM Addresses For BASIC Keywords ==<br />
<br />
<table border="1" cellpadding="5" cellspacing="0"><br />
<tr><td>0080</td><td>END</td><td>80</td><td>409F</td></tr><br />
<tr><td>0083</td><td>FOR</td><td>81</td><td>0726</td></tr><br />
<tr><td>0086</td><td>NEXT</td><td>82</td><td>4174</td></tr><br />
<tr><td>008A</td><td>DATA</td><td>83</td><td>099E</td></tr><br />
<tr><td>008E</td><td>INPUT</td><td>84</td><td>0CA3</td></tr><br />
<tr><td>0093</td><td>DIM</td><td>85</td><td>478B</td></tr><br />
<tr><td>0096</td><td>READ</td><td>86</td><td>0CD9</td></tr><br />
<tr><td>009A</td><td>LET</td><td>87</td><td>09C3</td></tr><br />
<tr><td>009D</td><td>GOTO</td><td>88</td><td>0936</td></tr><br />
<tr><td>00A1</td><td>RUN</td><td>89</td><td>090F</td></tr><br />
<tr><td>00A4</td><td>IF</td><td>8A</td><td>0B1A</td></tr><br />
<tr><td>00A6</td><td>RESTORE</td><td>8B</td><td>407F</td></tr><br />
<tr><td>00AD</td><td>GOSUB</td><td>8C</td><td>091E</td></tr><br />
<tr><td>0082</td><td>RETURN</td><td>8D</td><td>0966</td></tr><br />
<tr><td>00B8</td><td>REM</td><td>8E</td><td>09A0</td></tr><br />
<tr><td>00BB</td><td>STOP</td><td>8F</td><td>409A</td></tr><br />
<tr><td>00BF</td><td>WIDTH</td><td>9D</td><td>1DC3</td></tr><br />
<tr><td>00C4</td><td>ELSE</td><td>91</td><td>09A0</td></tr><br />
<tr><td>00C8</td><td>LINE</td><td>92</td><td>0C45</td></tr><br />
<tr><td>00CC</td><td>EDIT</td><td>93</td><td>5E51</td></tr><br />
<tr><td>00D0</td><td>ERROR</td><td>94</td><td>0B0F</td></tr><br />
<tr><td>00D5</td><td>RESUME</td><td>95</td><td>0AB0</td></tr><br />
<tr><td>00DB</td><td>OUT</td><td>96</td><td>110C</td></tr><br />
<tr><td>00DE</td><td>ON</td><td>97</td><td>0A2F</td></tr> <br />
<tr><td>00E0</td><td>DSKO$</td><td>98</td><td>5071</td></tr><br />
<tr><td>00E5</td><td>OPEN</td><td>99</td><td>4CCB</td></tr><br />
<tr><td>00E9</td><td>CLOSE</td><td>9A</td><td>4E20</td></tr><br />
<tr><td>00EE</td><td>LOAD</td><td>98</td><td>4D70</td></tr><br />
<tr><td>00F2</td><td>MERGE</td><td>9C</td><td>4D71</td></tr><br />
<tr><td>00F7</td><td>FILES</td><td>9D</td><td>1F3A</td></tr><br />
<tr><td>00FC</td><td>SAVE</td><td>9E</td><td>4DCF</td></tr><br />
<tr><td>0100</td><td>LFILES</td><td>9F</td><td>506F</td></tr><br />
<tr><td>0106</td><td>LPRINT</td><td>A0</td><td>0B4E</td></tr><br />
<tr><td>010C</td><td>DEF</td><td>A1</td><td>0872</td></tr><br />
<tr><td>010F</td><td>POKE</td><td>A2</td><td>128B</td></tr><br />
<tr><td>0113</td><td>PRINT</td><td>A3</td><td>0B56</td></tr><br />
<tr><td>0118</td><td>CONT</td><td>A4</td><td>40DA</td></tr><br />
<tr><td>011C</td><td>LIST</td><td>A5</td><td>1140</td></tr><br />
<tr><td>0120</td><td>LLIST</td><td>A6</td><td>113B</td></tr><br />
<tr><td>0125</td><td>CLEAR</td><td>A7</td><td>40F9</td></tr><br />
<tr><td>012A</td><td>CLOAD</td><td>A8</td><td>2377</td></tr><br />
<tr><td>012F</td><td>CSAVE</td><td>A9</td><td>2280</td></tr><br />
<tr><td>0134</td><td>TIME$</td><td>AA<td>19AB 1904</td></tr><br />
<tr><td>0139</td><td>DATE$</td><td>AB</td><td>19BD 1924</td></tr><br />
<tr><td>013E</td><td>DAY$</td><td>AC</td><td>19F1 1955</td></tr><br />
<tr><td>0142</td><td>COM</td><td>AD</td><td>1A9E</td></tr><br />
<tr><td>0145</td><td>MDM</td><td>AE</td><td>1A9E</td></tr><br />
<tr><td>0148</td><td>KEY</td><td>AF</td><td>1BB8</td></tr><br />
<tr><td>014B</td><td>CLS</td><td>B0</td><td>4231</td></tr><br />
<tr><td>014E</td><td>BEEP</td><td>B1</td><td>4229</td></tr><br />
<tr><td>0152</td><td>SOUND</td><td>B2</td><td>1DC5</td></tr><br />
<tr><td>0157</td><td>LCOPY</td><td>B3</td><td>1E5E</td></tr><br />
<tr><td>015C</td><td>PSET</td><td>B4</td><td>1C57</td></tr><br />
<tr><td>0160</td><td>PRESET</td><td>B5</td><td>1C66</td></tr><br />
<tr><td>0166</td><td>MOTOR</td><td>B6</td><td>1DEC</td></tr><br />
<tr><td>016B</td><td>MAX</td><td>B7</td><td>7F0B 19DB</td></tr><br />
<tr><td>016E</td><td>POWER</td><td>B8</td><td>1419</td></tr><br />
<tr><td>0173</td><td>CALL</td><td>B9</td><td>1DFA</td></tr><br />
<tr><td>0177</td><td>MENU</td><td>BA</td><td>5797</td></tr><br />
<tr><td>017B</td><td>IPL</td><td>BB</td><td>1A78</td></tr><br />
<tr><td>017E</td><td>NAME</td><td>BC</td><td>2037</td></tr><br />
<tr><td>0182</td><td>KILL</td><td>BD</td><td>1F91</td></tr><br />
<tr><td>0186</td><td>SCREEN</td><td>BE</td><td>1E22</td></tr><br />
<tr><td>018C</td><td>NEW</td><td>BF</td><td>20FE</td></tr><br />
<tr><td>018F</td><td>TAB(</td><td>C0</td><td>0C01</td></tr><br />
<tr><td>0193</td><td>TO</td><td>C1</td><td>076B</td></tr><br />
<tr><td>0195</td><td>USING</td><td>C2</td><td>4991</td></tr><br />
<tr><td>D19A</td><td>VARPTR</td><td>C3</td><td>0F7E</td></tr><br />
<tr><td>01A0</td><td>ERL</td><td>C4</td><td>0F56</td></tr><br />
<tr><td>01A3</td><td>ERR</td><td>C5</td><td>0F47</td></tr><br />
<tr><td>01A6</td><td>STRING$</td><td>C6</td><td>296D</td></tr><br />
<tr><td>01AD</td><td>INSTR</td><td>C7</td><td>2A37</td></tr><br />
<tr><td>0182</td><td>DSKI$</td><td>C8</td><td>5073</td></tr><br />
<tr><td>01B7</td><td>INKEY$</td><td>C9</td><td>4BEA</td></tr><br />
<tr><td>01BD</td><td>CSRLIN</td><td>CA</td><td>1D90</td></tr><br />
<tr><td>01C3</td><td>OFF</td><td>C8</td><td>various</td></tr><br />
<tr><td>01C6</td><td>HIMEM</td><td>CC</td><td>1DB9</td></tr><br />
<tr><td>01CB</td><td>THEN</td><td>CD</td><td>0B2A</td></tr><br />
<tr><td>01CF</td><td>NOT</td><td>CE</td><td>1054</td></tr><br />
<tr><td>01D2</td><td>STEP</td><td>CF</td><td>0783</td></tr><br />
<tr><td>0106</td><td>+</td><td>D0</td><td>See table 2</td></tr><br />
<tr><td>01D7</td><td>-</td><td>D1</td><td>See table 2</td></tr><br />
<tr><td>01D8</td><td>*</td><td>D2</td><td>See table 2</td></tr><br />
<tr><td>01D9</td><td>/</td><td>D3</td><td>See table 2</td></tr><br />
<tr><td>010A</td><td>\</td><td>D4</td><td>See table 2</td></tr><br />
<tr><td>01DB</td><td>AND</td><td>D5</td><td>1097</td></tr><br />
<tr><td>01DE</td><td>OR</td><td>06</td><td>108C</td></tr><br />
<tr><td>01E0</td><td>XOR</td><td>D7</td><td>10A2</td></tr><br />
<tr><td>01E3</td><td>EQV</td><td>D8</td><td>10AD</td></tr><br />
<tr><td>01E6</td><td>IMP</td><td>D9</td><td>10B5</td></tr><br />
<tr><td>01E9</td><td>MOD</td><td>DA</td><td>37DF</td></tr><br />
<tr><td>01EC</td><td>\</td><td>DB</td><td>377E</td></tr><br />
<tr><td>01ED</td><td>&gt;</td><td>DC</td><td>0E29</td></tr><br />
<tr><td>01EE</td><td>=</td><td>DD</td><td>0E29</td></tr><br />
<tr><td>01EF</td><td><</td><td>DE</td><td>0E29</td></tr><br />
<tr><td>01F0</td><td>SGN</td><td>DF</td><td>3407</td></tr><br />
<tr><td>01F3</td><td>INT</td><td>E0</td><td>3654</td></tr><br />
<tr><td>OIF6</td><td>ABS</td><td>E1</td><td>33F2</td></tr><br />
<tr><td>01F9</td><td>FRE</td><td>E2</td><td>2B4C</td></tr><br />
<tr><td>01FC</td><td>INP</td><td>E3</td><td>1100</td></tr><br />
<tr><td>01FF</td><td>LPOS</td><td>E4</td><td>10C8</td></tr><br />
<tr><td>0203</td><td>POS</td><td>E5</td><td>10CE</td></tr><br />
<tr><td>0206</td><td>SQR</td><td>E6</td><td>305A</td></tr><br />
<tr><td>0209</td><td>RND</td><td>E7</td><td>313E</td></tr><br />
<tr><td>020C</td><td>LOG</td><td>E8</td><td>2FCF</td></tr> <br />
<tr><td>020F</td><td>EXP</td><td>E9</td><td>30A4</td></tr><br />
<tr><td>0212</td><td>COS</td><td>EA</td><td>2EEF</td></tr><br />
<tr><td>0215</td><td>SIN</td><td>EB</td><td>2F09</td></tr><br />
<tr><td>0218</td><td>TAN</td><td>EC</td><td>2F58</td></tr><br />
<tr><td>021B</td><td>ATN</td><td>ED</td><td>2F71</td></tr><br />
<tr><td>021E</td><td>PEEK</td><td>EE</td><td>1284</td></tr><br />
<tr><td>0222</td><td>EOF</td><td>EF</td><td>1889</td></tr><br />
<tr><td>0225</td><td>LOG</td><td>F0</td><td>506D</td></tr><br />
<tr><td>0228</td><td>LOF</td><td>F1</td><td>506B</td></tr><br />
<tr><td>022B</td><td>CINT</td><td>F2</td><td>3501</td></tr><br />
<tr><td>022F</td><td>CSNG</td><td>F3</td><td>352A</td></tr><br />
<tr><td>0233</td><td>CDBL</td><td>F4</td><td>35BA</td></tr><br />
<tr><td>0237</td><td>FIX</td><td>F5</td><td>3645</td></tr><br />
<tr><td>023A</td><td>LEN</td><td>F6</td><td>2943</td></tr><br />
<tr><td>023D</td><td>STR$</td><td>F7</td><td>273A</td></tr><br />
<tr><td>0241</td><td>VAL</td><td>F8</td><td>2A07</td></tr><br />
<tr><td>0244</td><td>ASC</td><td>F9</td><td>294F</td></tr><br />
<tr><td>0247</td><td>CHR$</td><td>FA</td><td>295F</td></tr><br />
<tr><td>0248</td><td>SPACE$</td><td>FB</td><td>298E</td></tr><br />
<tr><td>0251</td><td>LEFT$</td><td>FC</td><td>29AB</td></tr><br />
<tr><td>0256</td><td>RIGHT$</td><td>FD</td><td>29DC</td></tr><br />
<tr><td>025C</td><td>MID$</td><td>FE</td><td>2AC2 29E6</td></tr><br />
<tr><td>0260</td><td>'</td><td>FF</td><td>0A90</td></tr> <br />
</table><br />
<br />
<pre><br />
+ - * / > Cmpr<br />
D.P. 2B78 2B69 2CFF 2DC7 3D8E 34FA<br />
S.P. 37F4 37FD 3803 380E 3D7F 3498<br />
INT 3704 36F8 3725 OFOD 3DF7 34C2<br />
String 28CC 270C<br />
</pre><br />
<br />
[[Category:Model 100 Classics]]</div>
64.81.88.222
https://bitchin100.com/wiki/index.php?title=ROM_Addresses:_Getting_BASIC_to_do_What_You_Want&diff=877
ROM Addresses: Getting BASIC to do What You Want
2009-01-23T16:23:30Z
<p>64.81.88.222: /* Jake's ROM Addresses For BASIC Keywords */</p>
<hr />
<div>How does BASIC do what you tell it to do? Clues to the language's subservience lie in ROM.<br />
<br />
'''<big>By JAKE COMMANDER<br/>Portable l00 September 1983, pg. 24</big>'''<br />
<br />
How on earth does Basic know what to do? All those statements, commands, and functions, yet the interpreter untiringly plods through your code always knowing what's required next. Just how does it do it?<br />
<br />
Well, if the answer were simple, everybody would be writing BASIC interpreters and putting Microsoft out of business. But it is possible to follow at least some of the pathways Basic uses to perform its duties.<br />
<br />
Most addresses of the ROM routines which comprise BASIC are held in two tables. These can be unraveled to give a list of routines used to perform various tasks.<br />
<br />
== Jump Addresses ==<br />
<br />
One table contains jump addresses for the commands (or verbs, as it were) which will always be the first thing the interpreter picks up from a statement. The whole repertoire of such commands is catered for the table located at 0262 hex.<br />
<br />
BASIC gets the appropriate jump address by using the token number for the command it's about to execute. All tokens are numbers from 128 to 255; therefore subtracting 128 gives numbers from zero to 127. As each jump address in the table is two bytes long, the token (minus 128) is multiplied by two to give an offset into the table. This points straight at the address which is needed. The two-byte address is picked up and jumped to ? and we're now executing a BASIC command in pure machine code.<br />
<br />
What happens next depends entirely on the machine code for the command itself. Various syntaxes are allowed for some commands but not for others. For instance, the print command would allow an expression such as <code>TAB(22);l/3</code>, so would an <code>LPRINT</code>. But a <code>LET</code> would have none of that. <code>LET X = TAB(22); 1/3</code> would have you on the carpet in no time.<br />
<br />
Also various combinations of tokens can do different things. The comparison operators, for example, can be used pretty much interchangeably. These operators, >? <> = < , etc are all OK syntactically. This versatility means a table for such a wide set of possibilities is nigh impossible.<br />
<br />
== Second Table ==<br />
<br />
However, there is a second table at location 004E in the ROM. This contains many addresses used in the evaluation of Basic math functions and expressions. These are extracted and jumped to in a similar fashion to the first table.<br />
<br />
Any BASIC word excluded from either of these tables is handled separately by the interpreter according to its particular use. However, out of a possible 128 tokens, these two tables give us a mechanism by which we can follow the machine-code execution of many of them. It is the combination of these routines and the syntax checking required to logically execute them that makes up an interpreter.<br />
<br />
The following list has been compiled from the two tables I've described and a disassembly of other parts of the ROM. It shows the entry points for all important BASIC statements and functions. Certain functions can have more than one possible syntactic use and the list does not cover all such uses. (An example is the statement <code>OFF</code>, which can be <code>SOUND OFF</code> or <code>MOTOR OFF</code> etc.) The list is in four columns. The first is the address in ROM where the BASIC word occurs in the vocabulary table. The second entry is the word itself. Third is the token assigned to that word when it is encoded by the BASIC interpreter.<br />
<br />
== Fourth Column ==<br />
<br />
The fourth column contains the address the interpreter jumps to to execute the token representing the statement or function desired. Once again, some statements can have more than one use such as <code>MID$(LH$)=RH$</code>, and <code>LH$=MID$(RH$)</code>. In these cases, two addresses are given: one for use on the left hand side of the equals sign and one for the right hand side of the sign.<br />
<br />
Perhaps unsurprisingly, things get a little more complicated with the mathematical functions in BASIC. It's not simply a matter of taking an address for, say, a multiply routine and then jumping to it. The BASIC interpreter has to know the numeric type of operator it has to work on. For instance, with the addition operator, BASIC has four choices:<br />
<br />
# Signed integer<br />
# Single precision<br />
# Double precision<br />
# String<br />
<br />
None of the other binary operators allow string manipulation, so they're limited to the numeric variable types only.<br />
<br />
The addresses of these binary operators can be confirmed (if you need confirmation) from three short tables in ROM, one each for double precision, single precision, and integer numbers respectively. <br />
<br />
The tables contain six addresses apiece for addition, subtraction, multiplication, division, exponentiation, and comparison. Rather than clutter the token-addresses table, these addresses are contained separately at the end.<br />
<br />
In a following article, I'll be looking at ways to use some of these addresses in your own machine-code programs. For the more adventurous, an experiment will probably prove irresistible. Remember, though, in a RAM-file machine such as the Model 100, a lock-up may cost you all your files. Use caution.<br />
<br />
== Jake's ROM Addresses For BASIC Keywords ==<br />
<br />
<table border="1"><br />
<tr><td>0080</td><td>END</td><td>80</td><td>409F</td></tr><br />
<tr><td>0083</td><td>FOR</td><td>81</td><td>0726</td></tr><br />
<tr><td>0086</td><td>NEXT</td><td>82</td><td>4174</td></tr><br />
<tr><td>008A</td><td>DATA</td><td>83</td><td>099E</td></tr><br />
<tr><td>008E</td><td>INPUT</td><td>84</td><td>0CA3</td></tr><br />
<tr><td>0093</td><td>DIM</td><td>85</td><td>478B</td></tr><br />
<tr><td>0096</td><td>READ</td><td>86</td><td>0CD9</td></tr><br />
<tr><td>009A</td><td>LET</td><td>87</td><td>09C3</td></tr><br />
<tr><td>009D</td><td>GOTO</td><td>88</td><td>0936</td></tr><br />
<tr><td>00A1</td><td>RUN</td><td>89</td><td>090F</td></tr><br />
<tr><td>00A4</td><td>IF</td><td>8A</td><td>0B1A</td></tr><br />
<tr><td>00A6</td><td>RESTORE</td><td>8B</td><td>407F</td></tr><br />
<tr><td>00AD</td><td>GOSUB</td><td>8C</td><td>091E</td></tr><br />
<tr><td>0082</td><td>RETURN</td><td>8D</td><td>0966</td></tr><br />
<tr><td>00B8</td><td>REM</td><td>8E</td><td>09A0</td></tr><br />
<tr><td>00BB</td><td>STOP</td><td>8F</td><td>409A</td></tr><br />
<tr><td>00BF</td><td>WIDTH</td><td>9D</td><td>1DC3</td></tr><br />
<tr><td>00C4</td><td>ELSE</td><td>91</td><td>09A0</td></tr><br />
<tr><td>00C8</td><td>LINE</td><td>92</td><td>0C45</td></tr><br />
<tr><td>00CC</td><td>EDIT</td><td>93</td><td>5E51</td></tr><br />
<tr><td>00D0</td><td>ERROR</td><td>94</td><td>0B0F</td></tr><br />
<tr><td>00D5</td><td>RESUME</td><td>95</td><td>0AB0</td></tr><br />
<tr><td>00DB</td><td>OUT</td><td>96</td><td>110C</td></tr><br />
<tr><td>00DE</td><td>ON</td><td>97</td><td>0A2F</td></tr> <br />
<tr><td>00E0</td><td>DSKO$</td><td>98</td><td>5071</td></tr><br />
<tr><td>00E5</td><td>OPEN</td><td>99</td><td>4CCB</td></tr><br />
<tr><td>00E9</td><td>CLOSE</td><td>9A</td><td>4E20</td></tr><br />
<tr><td>00EE</td><td>LOAD</td><td>98</td><td>4D70</td></tr><br />
<tr><td>00F2</td><td>MERGE</td><td>9C</td><td>4D71</td></tr><br />
<tr><td>00F7</td><td>FILES</td><td>9D</td><td>1F3A</td></tr><br />
<tr><td>00FC</td><td>SAVE</td><td>9E</td><td>4DCF</td></tr><br />
<tr><td>0100</td><td>LFILES</td><td>9F</td><td>506F</td></tr><br />
<tr><td>0106</td><td>LPRINT</td><td>A0</td><td>0B4E</td></tr><br />
<tr><td>010C</td><td>DEF</td><td>A1</td><td>0872</td></tr><br />
<tr><td>010F</td><td>POKE</td><td>A2</td><td>128B</td></tr><br />
<tr><td>0113</td><td>PRINT</td><td>A3</td><td>0B56</td></tr><br />
<tr><td>0118</td><td>CONT</td><td>A4</td><td>40DA</td></tr><br />
<tr><td>011C</td><td>LIST</td><td>A5</td><td>1140</td></tr><br />
<tr><td>0120</td><td>LLIST</td><td>A6</td><td>113B</td></tr><br />
<tr><td>0125</td><td>CLEAR</td><td>A7</td><td>40F9</td></tr><br />
<tr><td>012A</td><td>CLOAD</td><td>A8</td><td>2377</td></tr><br />
<tr><td>012F</td><td>CSAVE</td><td>A9</td><td>2280</td></tr><br />
<tr><td>0134</td><td>TIME$</td><td>AA<td>19AB 1904</td></tr><br />
<tr><td>0139</td><td>DATE$</td><td>AB</td><td>19BD 1924</td></tr><br />
<tr><td>013E</td><td>DAY$</td><td>AC</td><td>19F1 1955</td></tr><br />
<tr><td>0142</td><td>COM</td><td>AD</td><td>1A9E</td></tr><br />
<tr><td>0145</td><td>MDM</td><td>AE</td><td>1A9E</td></tr><br />
<tr><td>0148</td><td>KEY</td><td>AF</td><td>1BB8</td></tr><br />
<tr><td>014B</td><td>CLS</td><td>B0</td><td>4231</td></tr><br />
<tr><td>014E</td><td>BEEP</td><td>B1</td><td>4229</td></tr><br />
<tr><td>0152</td><td>SOUND</td><td>B2</td><td>1DC5</td></tr><br />
<tr><td>0157</td><td>LCOPY</td><td>B3</td><td>1E5E</td></tr><br />
<tr><td>015C</td><td>PSET</td><td>B4</td><td>1C57</td></tr><br />
<tr><td>0160</td><td>PRESET</td><td>B5</td><td>1C66</td></tr><br />
<tr><td>0166</td><td>MOTOR</td><td>B6</td><td>1DEC</td></tr><br />
<tr><td>016B</td><td>MAX</td><td>B7</td><td>7F0B 19DB</td></tr><br />
<tr><td>016E</td><td>POWER</td><td>B8</td><td>1419</td></tr><br />
<tr><td>0173</td><td>CALL</td><td>B9</td><td>1DFA</td></tr><br />
<tr><td>0177</td><td>MENU</td><td>BA</td><td>5797</td></tr><br />
<tr><td>017B</td><td>IPL</td><td>BB</td><td>1A78</td></tr><br />
<tr><td>017E</td><td>NAME</td><td>BC</td><td>2037</td></tr><br />
<tr><td>0182</td><td>KILL</td><td>BD</td><td>1F91</td></tr><br />
<tr><td>0186</td><td>SCREEN</td><td>BE</td><td>1E22</td></tr><br />
<tr><td>018C</td><td>NEW</td><td>BF</td><td>20FE</td></tr><br />
<tr><td>018F</td><td>TAB(</td><td>C0</td><td>0C01</td></tr><br />
<tr><td>0193</td><td>TO</td><td>C1</td><td>076B</td></tr><br />
<tr><td>0195</td><td>USING</td><td>C2</td><td>4991</td></tr><br />
<tr><td>D19A</td><td>VARPTR</td><td>C3</td><td>0F7E</td></tr><br />
<tr><td>01A0</td><td>ERL</td><td>C4</td><td>0F56</td></tr><br />
<tr><td>01A3</td><td>ERR</td><td>C5</td><td>0F47</td></tr><br />
<tr><td>01A6</td><td>STRING$</td><td>C6</td><td>296D</td></tr><br />
<tr><td>01AD</td><td>INSTR</td><td>C7</td><td>2A37</td></tr><br />
<tr><td>0182</td><td>DSKI$</td><td>C8</td><td>5073</td></tr><br />
<tr><td>01B7</td><td>INKEY$</td><td>C9</td><td>4BEA</td></tr><br />
<tr><td>01BD</td><td>CSRLIN</td><td>CA</td><td>1D90</td></tr><br />
<tr><td>01C3</td><td>OFF</td><td>C8</td><td>various</td></tr><br />
<tr><td>01C6</td><td>HIMEM</td><td>CC</td><td>1DB9</td></tr><br />
<tr><td>01CB</td><td>THEN</td><td>CD</td><td>0B2A</td></tr><br />
<tr><td>01CF</td><td>NOT</td><td>CE</td><td>1054</td></tr><br />
<tr><td>01D2</td><td>STEP</td><td>CF</td><td>0783</td></tr><br />
<tr><td>0106</td><td>+</td><td>D0</td><td>See table 2</td></tr><br />
<tr><td>01D7</td><td>-</td><td>D1</td><td>See table 2</td></tr><br />
<tr><td>01D8</td><td>*</td><td>D2</td><td>See table 2</td></tr><br />
<tr><td>01D9</td><td>/</td><td>D3</td><td>See table 2</td></tr><br />
<tr><td>010A</td><td>\</td><td>D4</td><td>See table 2</td></tr><br />
<tr><td>01DB</td><td>AND</td><td>D5</td><td>1097</td></tr><br />
<tr><td>01DE</td><td>OR</td><td>06</td><td>108C</td></tr><br />
<tr><td>01E0</td><td>XOR</td><td>D7</td><td>10A2</td></tr><br />
<tr><td>01E3</td><td>EQV</td><td>D8</td><td>10AD</td></tr><br />
<tr><td>01E6</td><td>IMP</td><td>D9</td><td>10B5</td></tr><br />
<tr><td>01E9</td><td>MOD</td><td>DA</td><td>37DF</td></tr><br />
<tr><td>01EC</td><td>\</td><td>DB</td><td>377E</td></tr><br />
<tr><td>01ED</td><td>&gt;</td><td>DC</td><td>0E29</td></tr><br />
<tr><td>01EE</td><td>=</td><td>DD</td><td>0E29</td></tr><br />
<tr><td>01EF</td><td><</td><td>DE</td><td>0E29</td></tr><br />
<tr><td>01F0</td><td>SGN</td><td>DF</td><td>3407</td></tr><br />
<tr><td>01F3</td><td>INT</td><td>E0</td><td>3654</td></tr><br />
<tr><td>OIF6</td><td>ABS</td><td>E1</td><td>33F2</td></tr><br />
<tr><td>01F9</td><td>FRE</td><td>E2</td><td>2B4C</td></tr><br />
<tr><td>01FC</td><td>INP</td><td>E3</td><td>1100</td></tr><br />
<tr><td>01FF</td><td>LPOS</td><td>E4</td><td>10C8</td></tr><br />
<tr><td>0203</td><td>POS</td><td>E5</td><td>10CE</td></tr><br />
<tr><td>0206</td><td>SQR</td><td>E6</td><td>305A</td></tr><br />
<tr><td>0209</td><td>RND</td><td>E7</td><td>313E</td></tr><br />
<tr><td>020C</td><td>LOG</td><td>E8</td><td>2FCF</td></tr> <br />
<tr><td>020F</td><td>EXP</td><td>E9</td><td>30A4</td></tr><br />
<tr><td>0212</td><td>COS</td><td>EA</td><td>2EEF</td></tr><br />
<tr><td>0215</td><td>SIN</td><td>EB</td><td>2F09</td></tr><br />
<tr><td>0218</td><td>TAN</td><td>EC</td><td>2F58</td></tr><br />
<tr><td>021B</td><td>ATN</td><td>ED</td><td>2F71</td></tr><br />
<tr><td>021E</td><td>PEEK</td><td>EE</td><td>1284</td></tr><br />
<tr><td>0222</td><td>EOF</td><td>EF</td><td>1889</td></tr><br />
<tr><td>0225</td><td>LOG</td><td>F0</td><td>506D</td></tr><br />
<tr><td>0228</td><td>LOF</td><td>F1</td><td>506B</td></tr><br />
<tr><td>022B</td><td>CINT</td><td>F2</td><td>3501</td></tr><br />
<tr><td>022F</td><td>CSNG</td><td>F3</td><td>352A</td></tr><br />
<tr><td>0233</td><td>CDBL</td><td>F4</td><td>35BA</td></tr><br />
<tr><td>0237</td><td>FIX</td><td>F5</td><td>3645</td></tr><br />
<tr><td>023A</td><td>LEN</td><td>F6</td><td>2943</td></tr><br />
<tr><td>023D</td><td>STR$</td><td>F7</td><td>273A</td></tr><br />
<tr><td>0241</td><td>VAL</td><td>F8</td><td>2A07</td></tr><br />
<tr><td>0244</td><td>ASC</td><td>F9</td><td>294F</td></tr><br />
<tr><td>0247</td><td>CHR$</td><td>FA</td><td>295F</td></tr><br />
<tr><td>0248</td><td>SPACE$</td><td>FB</td><td>298E</td></tr><br />
<tr><td>0251</td><td>LEFT$</td><td>FC</td><td>29AB</td></tr><br />
<tr><td>0256</td><td>RIGHT$</td><td>FD</td><td>29DC</td></tr><br />
<tr><td>025C</td><td>MID$</td><td>FE</td><td>2AC2 29E6</td></tr><br />
<tr><td>0260</td><td>'</td><td>FF</td><td>0A90</td></tr> <br />
</table><br />
<br />
<pre><br />
+ - * / > Cmpr<br />
D.P. 2B78 2B69 2CFF 2DC7 3D8E 34FA<br />
S.P. 37F4 37FD 3803 380E 3D7F 3498<br />
INT 3704 36F8 3725 OFOD 3DF7 34C2<br />
String 28CC 270C<br />
</pre><br />
<br />
[[Category:Model 100 Classics]]</div>
64.81.88.222
https://bitchin100.com/wiki/index.php?title=ROM_Addresses:_Getting_BASIC_to_do_What_You_Want&diff=876
ROM Addresses: Getting BASIC to do What You Want
2009-01-23T16:22:08Z
<p>64.81.88.222: /* Jake's ROM Addresses For BASIC Keywords */</p>
<hr />
<div>How does BASIC do what you tell it to do? Clues to the language's subservience lie in ROM.<br />
<br />
'''<big>By JAKE COMMANDER<br/>Portable l00 September 1983, pg. 24</big>'''<br />
<br />
How on earth does Basic know what to do? All those statements, commands, and functions, yet the interpreter untiringly plods through your code always knowing what's required next. Just how does it do it?<br />
<br />
Well, if the answer were simple, everybody would be writing BASIC interpreters and putting Microsoft out of business. But it is possible to follow at least some of the pathways Basic uses to perform its duties.<br />
<br />
Most addresses of the ROM routines which comprise BASIC are held in two tables. These can be unraveled to give a list of routines used to perform various tasks.<br />
<br />
== Jump Addresses ==<br />
<br />
One table contains jump addresses for the commands (or verbs, as it were) which will always be the first thing the interpreter picks up from a statement. The whole repertoire of such commands is catered for the table located at 0262 hex.<br />
<br />
BASIC gets the appropriate jump address by using the token number for the command it's about to execute. All tokens are numbers from 128 to 255; therefore subtracting 128 gives numbers from zero to 127. As each jump address in the table is two bytes long, the token (minus 128) is multiplied by two to give an offset into the table. This points straight at the address which is needed. The two-byte address is picked up and jumped to ? and we're now executing a BASIC command in pure machine code.<br />
<br />
What happens next depends entirely on the machine code for the command itself. Various syntaxes are allowed for some commands but not for others. For instance, the print command would allow an expression such as <code>TAB(22);l/3</code>, so would an <code>LPRINT</code>. But a <code>LET</code> would have none of that. <code>LET X = TAB(22); 1/3</code> would have you on the carpet in no time.<br />
<br />
Also various combinations of tokens can do different things. The comparison operators, for example, can be used pretty much interchangeably. These operators, >? <> = < , etc are all OK syntactically. This versatility means a table for such a wide set of possibilities is nigh impossible.<br />
<br />
== Second Table ==<br />
<br />
However, there is a second table at location 004E in the ROM. This contains many addresses used in the evaluation of Basic math functions and expressions. These are extracted and jumped to in a similar fashion to the first table.<br />
<br />
Any BASIC word excluded from either of these tables is handled separately by the interpreter according to its particular use. However, out of a possible 128 tokens, these two tables give us a mechanism by which we can follow the machine-code execution of many of them. It is the combination of these routines and the syntax checking required to logically execute them that makes up an interpreter.<br />
<br />
The following list has been compiled from the two tables I've described and a disassembly of other parts of the ROM. It shows the entry points for all important BASIC statements and functions. Certain functions can have more than one possible syntactic use and the list does not cover all such uses. (An example is the statement <code>OFF</code>, which can be <code>SOUND OFF</code> or <code>MOTOR OFF</code> etc.) The list is in four columns. The first is the address in ROM where the BASIC word occurs in the vocabulary table. The second entry is the word itself. Third is the token assigned to that word when it is encoded by the BASIC interpreter.<br />
<br />
== Fourth Column ==<br />
<br />
The fourth column contains the address the interpreter jumps to to execute the token representing the statement or function desired. Once again, some statements can have more than one use such as <code>MID$(LH$)=RH$</code>, and <code>LH$=MID$(RH$)</code>. In these cases, two addresses are given: one for use on the left hand side of the equals sign and one for the right hand side of the sign.<br />
<br />
Perhaps unsurprisingly, things get a little more complicated with the mathematical functions in BASIC. It's not simply a matter of taking an address for, say, a multiply routine and then jumping to it. The BASIC interpreter has to know the numeric type of operator it has to work on. For instance, with the addition operator, BASIC has four choices:<br />
<br />
# Signed integer<br />
# Single precision<br />
# Double precision<br />
# String<br />
<br />
None of the other binary operators allow string manipulation, so they're limited to the numeric variable types only.<br />
<br />
The addresses of these binary operators can be confirmed (if you need confirmation) from three short tables in ROM, one each for double precision, single precision, and integer numbers respectively. <br />
<br />
The tables contain six addresses apiece for addition, subtraction, multiplication, division, exponentiation, and comparison. Rather than clutter the token-addresses table, these addresses are contained separately at the end.<br />
<br />
In a following article, I'll be looking at ways to use some of these addresses in your own machine-code programs. For the more adventurous, an experiment will probably prove irresistible. Remember, though, in a RAM-file machine such as the Model 100, a lock-up may cost you all your files. Use caution.<br />
<br />
== Jake's ROM Addresses For BASIC Keywords ==<br />
<br />
<table border="1"><br />
<tr><td>0080</td><td>END</td><td>80</td><td>409F</td></tr><br />
<tr><td>0083</td><td>FOR</td><td>81</td><td>0726</td></tr><br />
<tr><td>0086</td><td>NEXT</td><td>82</td><td>4174</td></tr><br />
<tr><td>008A</td><td>DATA</td><td>83</td><td>099E</td></tr><br />
<tr><td>008E</td><td>INPUT</td><td>84</td><td>0CA3</td></tr><br />
<tr><td>0093</td><td>DIM</td><td>85</td><td>478B</td></tr><br />
<tr><td>0096</td><td>READ</td><td>86</td><td>0CD9</td></tr><br />
<tr><td>009A</td><td>LET</td><td>87</td><td>09C3</td></tr><br />
<tr><td>009D</td><td>GOTO</td><td>88</td><td>0936</td></tr><br />
<tr><td>00A1</td><td>RUN</td><td>89</td><td>090F</td></tr><br />
<tr><td>00A4</td><td>IF</td><td>8A</td><td>0B1A</td></tr><br />
<tr><td>00A6</td><td>RESTORE</td><td>8B</td><td>407F</td></tr><br />
<tr><td>00AD</td><td>GOSUB</td><td>8C</td><td>091E</td></tr><br />
<tr><td>0082</td><td>RETURN</td><td>8D</td><td>0966</td></tr><br />
<tr><td>00B8</td><td>REM</td><td>8E</td><td>09AO</td></tr><br />
<tr><td>00BB</td><td>STOP</td><td>8F</td><td>409A</td></tr><br />
<tr><td>00BF</td><td>WIDTH</td><td>9D</td><td>1DC3</td></tr><br />
<tr><td>00C4</td><td>ELSE</td><td>91</td><td>09AO</td></tr><br />
<tr><td>00C8</td><td>LINE</td><td>92</td><td>0C45</td></tr><br />
<tr><td>00CC</td><td>EDIT</td><td>93</td><td>5E51</td></tr><br />
<tr><td>00D0</td><td>ERROR</td><td>94</td><td>0B0F</td></tr><br />
<tr><td>00D5</td><td>RESUME</td><td>95</td><td>0AB0</td></tr><br />
<tr><td>00DB</td><td>OUT</td><td>96</td><td>110C</td></tr><br />
<tr><td>00DE</td><td>ON</td><td>97</td><td>0A2F</td></tr> <br />
<tr><td>00E0</td><td>DSKO$</td><td>98</td><td>5071</td></tr><br />
<tr><td>00E5</td><td>OPEN</td><td>99</td><td>4CCB</td></tr><br />
<tr><td>00E9</td><td>CLOSE</td><td>9A</td><td>4E20</td></tr><br />
<tr><td>00EE</td><td>LOAD</td><td>98</td><td>4D70</td></tr><br />
<tr><td>00F2</td><td>MERGE</td><td>9C</td><td>4D71</td></tr><br />
<tr><td>00F7</td><td>FILES</td><td>9D</td><td>1F3A</td></tr><br />
<tr><td>00FC</td><td>SAVE</td><td>9E</td><td>4DCF</td></tr><br />
<tr><td>0100</td><td>LFILES</td><td>9F</td><td>506F</td></tr><br />
<tr><td>0106</td><td>LPRINT</td><td>A0</td><td>0B4E</td></tr><br />
<tr><td>010C</td><td>DEF</td><td>A1</td><td>0872</td></tr><br />
<tr><td>010F</td><td>POKE</td><td>A2</td><td>128B</td></tr><br />
<tr><td>0113</td><td>PRINT</td><td>A3</td><td>0B56</td></tr><br />
<tr><td>0118</td><td>CONT</td><td>A4</td><td>40DA</td></tr><br />
<tr><td>011C</td><td>LIST</td><td>A5</td><td>1140</td></tr><br />
<tr><td>0120</td><td>LLIST</td><td>A6</td><td>113B</td></tr><br />
<tr><td>0125</td><td>CLEAR</td><td>A7</td><td>40F9</td></tr><br />
<tr><td>012A</td><td>CLOAD</td><td>A8</td><td>2377</td></tr><br />
<tr><td>012F</td><td>CSAVE</td><td>A9</td><td>2280</td></tr><br />
<tr><td>0134</td><td>TIME$</td><td>AA<td>19AB 1904</td></tr><br />
<tr><td>0139</td><td>DATE$</td><td>AB</td><td>19BD 1924</td></tr><br />
<tr><td>013E</td><td>DAY$</td><td>AC</td><td>19F1 1955</td></tr><br />
<tr><td>0142</td><td>COM</td><td>AD</td><td>1A9E</td></tr><br />
<tr><td>0145</td><td>MDM</td><td>AE</td><td>1A9E</td></tr><br />
<tr><td>0148</td><td>KEY</td><td>AF</td><td>1BB8</td></tr><br />
<tr><td>014B</td><td>CLS</td><td>B0</td><td>4231</td></tr><br />
<tr><td>014E</td><td>BEEP</td><td>B1</td><td>4229</td></tr><br />
<tr><td>0152</td><td>SOUND</td><td>B2</td><td>1DC5</td></tr><br />
<tr><td>0157</td><td>LCOPY</td><td>B3</td><td>1E5E</td></tr><br />
<tr><td>015C</td><td>PSET</td><td>B4</td><td>1C57</td></tr><br />
<tr><td>0160</td><td>PRESET</td><td>B5</td><td>1C66</td></tr><br />
<tr><td>0166</td><td>MOTOR</td><td>B6</td><td>1DEC</td></tr><br />
<tr><td>016B</td><td>MAX</td><td>B7</td><td>7F0B 19DB</td></tr><br />
<tr><td>016E</td><td>POWER</td><td>B8</td><td>1419</td></tr><br />
<tr><td>0173</td><td>CALL</td><td>B9</td><td>1DFA</td></tr><br />
<tr><td>0177</td><td>MENU</td><td>BA</td><td>5797</td></tr><br />
<tr><td>017B</td><td>IPL</td><td>BB</td><td>1A78</td></tr><br />
<tr><td>017E</td><td>NAME</td><td>BC</td><td>2037</td></tr><br />
<tr><td>0182</td><td>KILL</td><td>BD</td><td>1F91</td></tr><br />
<tr><td>0186</td><td>SCREEN</td><td>BE</td><td>1E22</td></tr><br />
<tr><td>018C</td><td>NEW</td><td>BF</td><td>20FE</td></tr><br />
<tr><td>018F</td><td>TAB(</td><td>C0</td><td>0C01</td></tr><br />
<tr><td>0193</td><td>TO</td><td>C1</td><td>076B</td></tr><br />
<tr><td>0195</td><td>USING</td><td>C2</td><td>4991</td></tr><br />
<tr><td>D19A</td><td>VARPTR</td><td>C3</td><td>0F7E</td></tr><br />
<tr><td>01A0</td><td>ERL</td><td>C4</td><td>0F56</td></tr><br />
<tr><td>01A3</td><td>ERR</td><td>C5</td><td>0F47</td></tr><br />
<tr><td>01A6</td><td>STRING$</td><td>C6</td><td>296D</td></tr><br />
<tr><td>01AD</td><td>INSTR</td><td>C7</td><td>2A37</td></tr><br />
<tr><td>0182</td><td>DSKI$</td><td>C8</td><td>5073</td></tr><br />
<tr><td>01B7</td><td>INKEY$</td><td>C9</td><td>4BEA</td></tr><br />
<tr><td>01BD</td><td>CSRLIN</td><td>CA</td><td>1D90</td></tr><br />
<tr><td>01C3</td><td>OFF</td><td>C8</td><td>various</td></tr><br />
<tr><td>01C6</td><td>HIMEM</td><td>CC</td><td>1DB9</td></tr><br />
<tr><td>01CB</td><td>THEN</td><td>CD</td><td>0B2A</td></tr><br />
<tr><td>01CF</td><td>NOT</td><td>CE</td><td>1054</td></tr><br />
<tr><td>01D2</td><td>STEP</td><td>CF</td><td>0783</td></tr><br />
<tr><td>0106</td><td>+</td><td>D0</td><td>See table 2</td></tr><br />
<tr><td>01D7</td><td>-</td><td>D1</td><td>See table 2</td></tr><br />
<tr><td>01D8</td><td>*</td><td>D2</td><td>See table 2</td></tr><br />
<tr><td>01D9</td><td>/</td><td>D3</td><td>See table 2</td></tr><br />
<tr><td>010A</td><td>\</td><td>D4</td><td>See table 2</td></tr><br />
<tr><td>01DB</td><td>AND</td><td>D5</td><td>1097</td></tr><br />
<tr><td>01DE</td><td>OR</td><td>06</td><td>108C</td></tr><br />
<tr><td>01E0</td><td>XOR</td><td>D7</td><td>10A2</td></tr><br />
<tr><td>01E3</td><td>EQV</td><td>D8</td><td>10AD</td></tr><br />
<tr><td>01E6</td><td>IMP</td><td>D9</td><td>10B5</td></tr><br />
<tr><td>01E9</td><td>MOD</td><td>DA</td><td>37DF</td></tr><br />
<tr><td>01EC</td><td>\</td><td>DB</td><td>377E</td></tr><br />
<tr><td>01ED</td><td>&gt;</td><td>DC</td><td>0E29</td></tr><br />
<tr><td>01EE</td><td>=</td><td>DD</td><td>0E29</td></tr><br />
<tr><td>01EF</td><td><</td><td>DE</td><td>0E29</td></tr><br />
<tr><td>01F0</td><td>SGN</td><td>DF</td><td>3407</td></tr><br />
<tr><td>01F3</td><td>INT</td><td>E0</td><td>3654</td></tr><br />
<tr><td>OIF6</td><td>ABS</td><td>E1</td><td>33F2</td></tr><br />
<tr><td>01F9</td><td>FRE</td><td>E2</td><td>2B4C</td></tr><br />
<tr><td>01FC</td><td>INP</td><td>E3</td><td>1100</td></tr><br />
<tr><td>01FF</td><td>LPOS</td><td>E4</td><td>10C8</td></tr><br />
<tr><td>0203</td><td>POS</td><td>E5</td><td>10CE</td></tr><br />
<tr><td>0206</td><td>SQR</td><td>E6</td><td>305A</td></tr><br />
<tr><td>0209</td><td>RND</td><td>E7</td><td>313E</td></tr><br />
<tr><td>020C</td><td>LOG</td><td>E8</td><td>2FCF</td></tr> <br />
<tr><td>020F</td><td>EXP</td><td>E9</td><td>30A4</td></tr><br />
<tr><td>0212</td><td>COS</td><td>EA</td><td>2EEF</td></tr><br />
<tr><td>0215</td><td>SIN</td><td>EB</td><td>2F09</td></tr><br />
<tr><td>0218</td><td>TAN</td><td>EC</td><td>2F58</td></tr><br />
<tr><td>021B</td><td>ATN</td><td>ED</td><td>2F71</td></tr><br />
<tr><td>021E</td><td>PEEK</td><td>EE</td><td>1284</td></tr><br />
<tr><td>0222</td><td>EOF</td><td>EF</td><td>1889</td></tr><br />
<tr><td>0225</td><td>LOG</td><td>F0</td><td>506D</td></tr><br />
<tr><td>0228</td><td>LOF</td><td>F1</td><td>506B</td></tr><br />
<tr><td>022B</td><td>CINT</td><td>F2</td><td>3501</td></tr><br />
<tr><td>022F</td><td>CSNG</td><td>F3</td><td>352A</td></tr><br />
<tr><td>0233</td><td>CDBL</td><td>F4</td><td>35BA</td></tr><br />
<tr><td>0237</td><td>FIX</td><td>F5</td><td>3645</td></tr><br />
<tr><td>023A</td><td>LEN</td><td>F6</td><td>2943</td></tr><br />
<tr><td>023D</td><td>STR$</td><td>F7</td><td>273A</td></tr><br />
<tr><td>0241</td><td>VAL</td><td>F8</td><td>2A07</td></tr><br />
<tr><td>0244</td><td>ASC</td><td>F9</td><td>294F</td></tr><br />
<tr><td>0247</td><td>CHR$</td><td>FA</td><td>295F</td></tr><br />
<tr><td>0248</td><td>SPACE$</td><td>FB</td><td>298E</td></tr><br />
<tr><td>0251</td><td>LEFT$</td><td>FC</td><td>29AB</td></tr><br />
<tr><td>0256</td><td>RIGHT$</td><td>FD</td><td>29DC</td></tr><br />
<tr><td>025C</td><td>MID$</td><td>FE</td><td>2AC2 29E6</td></tr><br />
<tr><td>0260</td><td>'</td><td>FF</td><td>0A90</td></tr> <br />
</table><br />
<br />
<pre><br />
+ - * / > Cmpr<br />
D.P. 2B78 2B69 2CFF 2DC7 3D8E 34FA<br />
S.P. 37F4 37FD 3803 380E 3D7F 3498<br />
INT 3704 36F8 3725 OFOD 3DF7 34C2<br />
String 28CC 270C<br />
</pre><br />
<br />
[[Category:Model 100 Classics]]</div>
64.81.88.222
https://bitchin100.com/wiki/index.php?title=ROM_Addresses:_Getting_BASIC_to_do_What_You_Want&diff=875
ROM Addresses: Getting BASIC to do What You Want
2009-01-23T16:19:11Z
<p>64.81.88.222: /* Jake's ROM Addresses For BASIC Keywords */</p>
<hr />
<div>How does BASIC do what you tell it to do? Clues to the language's subservience lie in ROM.<br />
<br />
'''<big>By JAKE COMMANDER<br/>Portable l00 September 1983, pg. 24</big>'''<br />
<br />
How on earth does Basic know what to do? All those statements, commands, and functions, yet the interpreter untiringly plods through your code always knowing what's required next. Just how does it do it?<br />
<br />
Well, if the answer were simple, everybody would be writing BASIC interpreters and putting Microsoft out of business. But it is possible to follow at least some of the pathways Basic uses to perform its duties.<br />
<br />
Most addresses of the ROM routines which comprise BASIC are held in two tables. These can be unraveled to give a list of routines used to perform various tasks.<br />
<br />
== Jump Addresses ==<br />
<br />
One table contains jump addresses for the commands (or verbs, as it were) which will always be the first thing the interpreter picks up from a statement. The whole repertoire of such commands is catered for the table located at 0262 hex.<br />
<br />
BASIC gets the appropriate jump address by using the token number for the command it's about to execute. All tokens are numbers from 128 to 255; therefore subtracting 128 gives numbers from zero to 127. As each jump address in the table is two bytes long, the token (minus 128) is multiplied by two to give an offset into the table. This points straight at the address which is needed. The two-byte address is picked up and jumped to ? and we're now executing a BASIC command in pure machine code.<br />
<br />
What happens next depends entirely on the machine code for the command itself. Various syntaxes are allowed for some commands but not for others. For instance, the print command would allow an expression such as <code>TAB(22);l/3</code>, so would an <code>LPRINT</code>. But a <code>LET</code> would have none of that. <code>LET X = TAB(22); 1/3</code> would have you on the carpet in no time.<br />
<br />
Also various combinations of tokens can do different things. The comparison operators, for example, can be used pretty much interchangeably. These operators, >? <> = < , etc are all OK syntactically. This versatility means a table for such a wide set of possibilities is nigh impossible.<br />
<br />
== Second Table ==<br />
<br />
However, there is a second table at location 004E in the ROM. This contains many addresses used in the evaluation of Basic math functions and expressions. These are extracted and jumped to in a similar fashion to the first table.<br />
<br />
Any BASIC word excluded from either of these tables is handled separately by the interpreter according to its particular use. However, out of a possible 128 tokens, these two tables give us a mechanism by which we can follow the machine-code execution of many of them. It is the combination of these routines and the syntax checking required to logically execute them that makes up an interpreter.<br />
<br />
The following list has been compiled from the two tables I've described and a disassembly of other parts of the ROM. It shows the entry points for all important BASIC statements and functions. Certain functions can have more than one possible syntactic use and the list does not cover all such uses. (An example is the statement <code>OFF</code>, which can be <code>SOUND OFF</code> or <code>MOTOR OFF</code> etc.) The list is in four columns. The first is the address in ROM where the BASIC word occurs in the vocabulary table. The second entry is the word itself. Third is the token assigned to that word when it is encoded by the BASIC interpreter.<br />
<br />
== Fourth Column ==<br />
<br />
The fourth column contains the address the interpreter jumps to to execute the token representing the statement or function desired. Once again, some statements can have more than one use such as <code>MID$(LH$)=RH$</code>, and <code>LH$=MID$(RH$)</code>. In these cases, two addresses are given: one for use on the left hand side of the equals sign and one for the right hand side of the sign.<br />
<br />
Perhaps unsurprisingly, things get a little more complicated with the mathematical functions in BASIC. It's not simply a matter of taking an address for, say, a multiply routine and then jumping to it. The BASIC interpreter has to know the numeric type of operator it has to work on. For instance, with the addition operator, BASIC has four choices:<br />
<br />
# Signed integer<br />
# Single precision<br />
# Double precision<br />
# String<br />
<br />
None of the other binary operators allow string manipulation, so they're limited to the numeric variable types only.<br />
<br />
The addresses of these binary operators can be confirmed (if you need confirmation) from three short tables in ROM, one each for double precision, single precision, and integer numbers respectively. <br />
<br />
The tables contain six addresses apiece for addition, subtraction, multiplication, division, exponentiation, and comparison. Rather than clutter the token-addresses table, these addresses are contained separately at the end.<br />
<br />
In a following article, I'll be looking at ways to use some of these addresses in your own machine-code programs. For the more adventurous, an experiment will probably prove irresistible. Remember, though, in a RAM-file machine such as the Model 100, a lock-up may cost you all your files. Use caution.<br />
<br />
== Jake's ROM Addresses For BASIC Keywords ==<br />
<br />
<table border="1"><br />
<tr><td>0080</td><td>END</td><td>80</td><td>409F</td></tr><br />
<tr><td>0083</td><td>FOR</td><td>81</td><td>0726</td></tr><br />
<tr><td>0086</td><td>NEXT</td><td>82</td><td>4174</td></tr><br />
<tr><td>008A</td><td>DATA</td><td>83</td><td>099E</td></tr><br />
<tr><td>008E</td><td>INPUT</td><td>84</td><td>0CA3</td></tr><br />
<tr><td>0093</td><td>DIM</td><td>85</td><td>478B</td></tr><br />
<tr><td>0096</td><td>READ</td><td>86</td><td>OCD9</td></tr><br />
<tr><td>009A</td><td>LET</td><td>87</td><td>09C3</td></tr><br />
<tr><td>009D</td><td>GOTO</td><td>88</td><td>0936</td></tr><br />
<tr><td>00A1</td><td>RUN</td><td>89</td><td>090F</td></tr><br />
<tr><td>00A4</td><td>IF</td><td>8A</td><td>OB1A</td></tr><br />
<tr><td>00A6</td><td>RESTORE</td><td>8B</td><td>407F</td></tr><br />
<tr><td>00AD</td><td>GOSUB</td><td>8C</td><td>091E</td></tr><br />
<tr><td>0082</td><td>RETURN</td><td>8D</td><td>0966</td></tr><br />
<tr><td>00B8</td><td>REM</td><td>8E</td><td>09AO</td></tr><br />
<tr><td>00BB</td><td>STOP</td><td>8F</td><td>409A</td></tr><br />
<tr><td>00BF</td><td>WIDTH</td><td>9D</td><td>1DC3</td></tr><br />
<tr><td>00C4</td><td>ELSE</td><td>91</td><td>09AO</td></tr><br />
<tr><td>00C8</td><td>LINE</td><td>92</td><td>OC45</td></tr><br />
<tr><td>00CC</td><td>EDIT</td><td>93</td><td>5E51</td></tr><br />
<tr><td>00D0</td><td>ERROR</td><td>94</td><td>OBOF</td></tr><br />
<tr><td>00D5</td><td>RESUME</td><td>95</td><td>OABO</td></tr><br />
<tr><td>00DB</td><td>OUT</td><td>96</td><td>11OC</td></tr><br />
<tr><td>00DE</td><td>ON</td><td>97</td><td>OA2F</td></tr> <br />
<tr><td>00E0</td><td>DSKO$</td><td>98</td><td>5071</td></tr><br />
<tr><td>00E5</td><td>OPEN</td><td>99</td><td>4CCB</td></tr><br />
<tr><td>00E9</td><td>CLOSE</td><td>9A</td><td>4E20</td></tr><br />
<tr><td>00EE</td><td>LOAD</td><td>98</td><td>4D70</td></tr><br />
<tr><td>00F2</td><td>MERGE</td><td>9C</td><td>4D71</td></tr><br />
<tr><td>00F7</td><td>FILES</td><td>9D</td><td>1F3A</td></tr><br />
<tr><td>00FC</td><td>SAVE</td><td>9E</td><td>4DCF</td></tr><br />
<tr><td>0100</td><td>LFILES</td><td>9F</td><td>506F</td></tr><br />
<tr><td>0106</td><td>LPRINT</td><td>AO</td><td>OB4E</td></tr><br />
<tr><td>010C</td><td>DEF</td><td>A1</td><td>0872</td></tr><br />
<tr><td>010F</td><td>POKE</td><td>A2</td><td>128B</td></tr><br />
<tr><td>0113</td><td>PRINT</td><td>A3</td><td>0B56</td></tr><br />
<tr><td>0118</td><td>CONT</td><td>A4</td><td>40DA</td></tr><br />
<tr><td>011C</td><td>LIST</td><td>A5</td><td>1140</td></tr><br />
<tr><td>0120</td><td>LLIST</td><td>A6</td><td>113B</td></tr><br />
<tr><td>0125</td><td>CLEAR</td><td>A7</td><td>40F9</td></tr><br />
<tr><td>012A</td><td>CLOAD</td><td>A8</td><td>2377</td></tr><br />
<tr><td>012F</td><td>CSAVE</td><td>A9</td><td>2280</td></tr><br />
<tr><td>0134</td><td>TIME$</td><td>AA<td>19AB 1904</td></tr><br />
<tr><td>0139</td><td>DATE$</td><td>AB</td><td>19BD 1924</td></tr><br />
<tr><td>013E</td><td>DAY$</td><td>AC</td><td>19F1 1955</td></tr><br />
<tr><td>0142</td><td>COM</td><td>AD</td><td>1A9E</td></tr><br />
<tr><td>0145</td><td>MDM</td><td>AE</td><td>1A9E</td></tr><br />
<tr><td>0148</td><td>KEY</td><td>AF</td><td>1BB8</td></tr><br />
<tr><td>014B</td><td>CLS</td><td>BO</td><td>4231</td></tr><br />
<tr><td>014E</td><td>BEEP</td><td>B1</td><td>4229</td></tr><br />
<tr><td>0152</td><td>SOUND</td><td>B2</td><td>1DC5</td></tr><br />
<tr><td>0157</td><td>LCOPY</td><td>B3</td><td>1E5E</td></tr><br />
<tr><td>015C</td><td>PSET</td><td>B4</td><td>1C57</td></tr><br />
<tr><td>0160</td><td>PRESET</td><td>B5</td><td>1C66</td></tr><br />
<tr><td>0166</td><td>MOTOR</td><td>B6</td><td>1DEC</td></tr><br />
<tr><td>016B</td><td>MAX</td><td>B7</td><td>7FOB 19DB</td></tr><br />
<tr><td>016E</td><td>POWER</td><td>B8</td><td>1419</td></tr><br />
<tr><td>0173</td><td>CALL</td><td>B9</td><td>1DFA</td></tr><br />
<tr><td>0177</td><td>MENU</td><td>BA</td><td>5797</td></tr><br />
<tr><td>017B</td><td>IPL</td><td>BB</td><td>1A78</td></tr><br />
<tr><td>017E</td><td>NAME</td><td>BC</td><td>2037</td></tr><br />
<tr><td>0182</td><td>KILL</td><td>BD</td><td>1F91</td></tr><br />
<tr><td>0186</td><td>SCREEN</td><td>BE</td><td>1E22</td></tr><br />
<tr><td>018C</td><td>NEW</td><td>BF</td><td>20FE</td></tr><br />
<tr><td>018F</td><td>TAB(</td><td>CO</td><td>OC01</td></tr><br />
<tr><td>0193</td><td>TO</td><td>C1</td><td>076B</td></tr><br />
<tr><td>0195</td><td>USING</td><td>C2</td><td>4991</td></tr><br />
<tr><td>D19A</td><td>VARPTR</td><td>C3</td><td>OF7E</td></tr><br />
<tr><td>01A0</td><td>ERL</td><td>C4</td><td>OF56</td></tr><br />
<tr><td>01A3</td><td>ERR</td><td>C5</td><td>OF47</td></tr><br />
<tr><td>01A6</td><td>STRING$</td><td>C6</td><td>296D</td></tr><br />
<tr><td>01AD</td><td>INSTR</td><td>C7</td><td>2A37</td></tr><br />
<tr><td>0182</td><td>DSKI$</td><td>C8</td><td>5073</td></tr><br />
<tr><td>01B7</td><td>INKEY$</td><td>C9</td><td>4BEA</td></tr><br />
<tr><td>01BD</td><td>CSRLIN</td><td>CA</td><td>1D90</td></tr><br />
<tr><td>01C3</td><td>OFF</td><td>C8</td><td>various</td></tr><br />
<tr><td>01C6</td><td>HIMEM</td><td>CC</td><td>1DB9</td></tr><br />
<tr><td>01CB</td><td>THEN</td><td>CD</td><td>OB2A</td></tr><br />
<tr><td>01CF</td><td>NOT</td><td>CE</td><td>1054</td></tr><br />
<tr><td>01D2</td><td>STEP</td><td>CF</td><td>O783</td></tr><br />
<tr><td>0106</td><td>+</td><td>D0</td></tr><br />
<tr><td>01D7</td><td>-</td><td>D1</td></tr><br />
<tr><td>01D8</td><td>*</td><td>D2</td></tr><br />
<tr><td>01D9</td><td>/</td><td>D3</td></tr><br />
<tr><td>010A</td><td>\</td><td>D4</td></tr><br />
<tr><td>01DB</td><td>AND</td><td>D5</td><td>1097</td></tr><br />
<tr><td>01DE</td><td>OR</td><td>06</td><td>108C</td></tr><br />
<tr><td>01E0</td><td>XOR</td><td>D7</td><td>10A2</td></tr><br />
<tr><td>01E3</td><td>EQV</td><td>D8</td><td>10AD</td></tr><br />
<tr><td>01E6</td><td>IMP</td><td>D9</td><td>10B5</td></tr><br />
<tr><td>01E9</td><td>MOD</td><td>DA</td><td>37DF</td></tr><br />
<tr><td>01EC</td><td>\</td><td>DB</td><td>377E</td></tr><br />
<tr><td>01ED</td><td>&gt;</td><td>DC</td><td>OE29</td></tr><br />
<tr><td>01EE</td><td>=</td><td>DD</td><td>OE29</td></tr><br />
<tr><td>01EF</td><td><</td><td>DE</td><td>OE29</td></tr><br />
<tr><td>01F0</td><td>SGN</td><td>DF</td><td>3407</td></tr><br />
<tr><td>01F3</td><td>INT</td><td>E0</td><td>3654</td></tr><br />
<tr><td>OIF6</td><td>ABS</td><td>E1</td><td>33F2</td></tr><br />
<tr><td>01F9</td><td>FRE</td><td>E2</td><td>2B4C</td></tr><br />
<tr><td>01FC</td><td>INP</td><td>E3</td><td>1100</td></tr><br />
<tr><td>01FF</td><td>LPOS</td><td>E4</td><td>10C8</td></tr><br />
<tr><td>0203</td><td>POS</td><td>E5</td><td>10CE</td></tr><br />
<tr><td>0206</td><td>SQR</td><td>E6</td><td>305A</td></tr><br />
<tr><td>0209</td><td>RND</td><td>E7</td><td>313E</td></tr><br />
<tr><td>020C</td><td>LOG</td><td>E8</td><td>2FCF</td></tr> <br />
<tr><td>020F</td><td>EXP</td><td>E9</td><td>30A4</td></tr><br />
<tr><td>0212</td><td>COS</td><td>EA</td><td>2EEF</td></tr><br />
<tr><td>0215</td><td>SIN</td><td>EB</td><td>2F09</td></tr><br />
<tr><td>0218</td><td>TAN</td><td>EC</td><td>2F58</td></tr><br />
<tr><td>021B</td><td>ATN</td><td>ED</td><td>2F71</td></tr><br />
<tr><td>021E</td><td>PEEK</td><td>EE</td><td>1284</td></tr><br />
<tr><td>0222</td><td>EOF</td><td>EF</td><td>1889</td></tr><br />
<tr><td>0225</td><td>LOG</td><td>F0</td><td>506D</td></tr><br />
<tr><td>0228</td><td>LOF</td><td>F1</td><td>506B</td></tr><br />
<tr><td>022B</td><td>CINT</td><td>F2</td><td>3501</td></tr><br />
<tr><td>022F</td><td>CSNG</td><td>F3</td><td>352A</td></tr><br />
<tr><td>0233</td><td>CDBL</td><td>F4</td><td>35BA</td></tr><br />
<tr><td>0237</td><td>FIX</td><td>F5</td><td>3645</td></tr><br />
<tr><td>023A</td><td>LEN</td><td>F6</td><td>2943</td></tr><br />
<tr><td>023D</td><td>STR$</td><td>F7</td><td>273A</td></tr><br />
<tr><td>0241</td><td>VAL</td><td>F8</td><td>2A07</td></tr><br />
<tr><td>0244</td><td>ASC</td><td>F9</td><td>294F</td></tr><br />
<tr><td>0247</td><td>CHR$</td><td>FA</td><td>295F</td></tr><br />
<tr><td>0248</td><td>SPACE$</td><td>FB</td><td>298E</td></tr><br />
<tr><td>0251</td><td>LEFT$</td><td>FC</td><td>29AB</td></tr><br />
<tr><td>0256</td><td>RIGHT$</td><td>FD</td><td>29DC</td></tr><br />
<tr><td>025C</td><td>MID$</td><td>FE</td><td>2AC2 29E6</td></tr><br />
<tr><td>0260</td><td>'</td><td>FF</td><td>OA90</td></tr> <br />
</table><br />
<br />
<pre><br />
+ - * / > Cmpr<br />
D.P. 2B78 2B69 2CFF 2DC7 3D8E 34FA<br />
S.P. 37F4 37FD 3803 380E 3D7F 3498<br />
INT 3704 36F8 3725 OFOD 3DF7 34C2<br />
String 28CC 270C<br />
</pre><br />
<br />
[[Category:Model 100 Classics]]</div>
64.81.88.222
https://bitchin100.com/wiki/index.php?title=Model_T_DocGarden&diff=867
Model T DocGarden
2009-01-23T06:12:04Z
<p>64.81.88.222: /* Classic Article Repubs */</p>
<hr />
<div>These pages are devoted to the Model T:<br />
<br />
TRS-80 Model 100, Tandy Model 102, KC-85, NEC 8201A, NEC 8300, Olivetti M10, Tandy Model 200, and the WP-2<br />
<br />
== Classic Article Repubs ==<br />
<br />
We hope to republish one or more articles from the Golden Era of the Model T every month:<br />
<br />
[[:Category:Model 100 Classics]]<br />
<br />
== One-Liners ==<br />
<br />
This is a collection of Microsoft BASIC programs that<br />
* Do something interesting or useful<br />
* With only a single line of code<br />
<br />
One-liners are bite-sized computer programs on a human scale. You are encouraged to type them in manually (by hand) and study their operation.<br />
<br />
[[Model 100/102 Compatible One-Liners]]<br />
<br />
== Tandy Disk Drive and Emulators ==<br />
<br />
TPDD emulators, in concert with a compatible disk clients like<br />
TS-DOS, TEENY, POWR-DOS, FLOPPY.CO, the Booster Pak, or the <br />
WP-2 built-in Diskette client are the most "advanced" way to<br />
accurately and quickly transfer all file types including binary<br />
files to and from your Model T laptop. There are different<br />
options for the server side on modern operating systems and<br />
devices:<br />
<br />
=== Servers ===<br />
<br />
[[LaddieCon]] is a TPDD emulator for Windows written in C#.Net.<br />
<br />
[[DLPilot]] is a TPDD emulator for PalmOS devices.<br />
<br />
[[DLPlus]] is a TPDD emulator for Linux, BSD, and MacOSX.<br />
<br />
[[NADSBox]] is an advanced stand-alone TPDD emulation device that uses SD cards. It implements multiple levels of TS-DOS directory extensions<br />
<br />
[[Desklink]] is a DOS based TPDD emulator which implements a single-level of the TS-DOS directory extensions<br />
<br />
[[Jan's DOS-Based Docking Station]]<br />
<br />
=== Clients ===<br />
<br />
[[TS-DOS]] is a nice DOS and GUI available in RAM and ROM versions. It is the only client that supports subdirectories given special servers (no real TPDD supports subdirectories).<br />
<br />
[[TEENY]] is a very small RAM-based TPDD client<br />
<br />
[[LAPDOS]] is a DOS PC based TPDD client.<br />
<br />
[[PDD]] is a DOS PC based TPDD client.<br />
<br />
=== Real TPDD and TPDD-2 ===<br />
<br />
[[Differences]] between TPDD-1 and TPDD-2<br />
<br />
== Simple Text File Transfer (No Client) ==<br />
<br />
You can use any "terminal program" to transfer text files to<br />
and from your Model T laptop. Here are some tutorials:<br />
<br />
[[Text File Transfer using Hyperterminal]]<br />
<br />
[http://web.mac.com/lorddoomicus/Doomd/Blog/Entries/2006/9/10_Connecting_a_Tandy_102_Computer_to_a_Mac.html Text File Transfer to Mac using Z-Term]<br />
<br />
== File Storage using MP3 Player ==<br />
<br />
[[File storage with mp3 player]]<br />
<br />
== Model T Software ==<br />
<br />
[[VirtualT]] Model 100/102, T200, NEC 8201A, M10 emulator<br />
<br />
[[mtcpm]] CP/M for the Tandy 100/102/200<br />
<br />
[[RAM4TH]]<br />
<br />
== Model T Hardware Hacks and Troubleshooting ==<br />
<br />
[[Splitting the Model 100/102/200 case]]<br />
<br />
[[Recovering an Unresponsive Laptop]]<br />
<br />
[[International Keyboard Support]]<br />
<br />
[[Repairing Problem Keys]]<br />
<br />
== Model T Hardware Projects ==<br />
<br />
[[Remem]] is the ultimate Model T memory upgrade<br />
<br />
:[http://lists.bitchin100.com/listinfo.cgi/remem-users-bitchin100.com remem-users mailing list] This is a support list for remem users.<br />
:[[Remem Software HOWTO's]]<br />
<br />
[[REX]] is a flash OptROM emulator/switcher<br />
<br />
[[REX2]] is a upcoming flash OptROM emulator/switcher with support for a 64K all-RAM mode. This permits running with a patched main ROM, or the upcoming [[mtcpm]] (Model T CP/M)<br />
<br />
[[NADSBox]] is a stand-alone TPDD emulation device that uses SD cards<br />
<br />
[[Mikrokolor]] Is a Color Graphics interface for the Model 100. Allows for 40x80 character graphics/text<br />
<br />
== Model T Developer Reference ==<br />
<br />
[[String Handling]]<br />
<br />
[[ROM Hooks]]<br />
<br />
[[RAM Variables]]<br />
<br />
[[Option ROM Programming]]<br />
<br />
[[8085 Reference]]<br />
<br />
[[Low Level Filesystem Access]]<br />
<br />
[[Low Level LCD Access]]<br />
<br />
[[Direct Keyboard Access]]<br />
<br />
[[Serial Port Access]]<br />
<br />
[[CO File Format]]<br />
<br />
[[BCR Port Access]]<br />
<br />
[[TPDD Protocol]]<br />
<br />
[[Relocating Loader (RLC) Format]]<br />
<br />
[[Error Codes]]<br />
<br />
[[Doing Binary In BASIC]]<br />
<br />
== Other Topics ==<br />
<br />
== Model T Links ==<br />
<br />
[http://club100.org Rick Hanson's Club 100]<br />
<br />
[http://www.istop.com/%7Esadolph/remem_home.html Steve Adolph's Remem Site]<br />
<br />
[http://sliderule.mraiow.com/wiki/Portable_Computer_Index#T Chris Osburn's Calculating Instruments]<br />
<br />
[http://kenpettit.com/projects.html Ken Pettit's Model T Projects]</div>
64.81.88.222
https://bitchin100.com/wiki/index.php?title=Category:Model_100_Classics&diff=851
Category:Model 100 Classics
2009-01-23T05:40:38Z
<p>64.81.88.222: </p>
<hr />
<div>How does Basic do what you tell it to do? Clues to the language's subservience lie in ROM.<br />
<br />
<big>By JAKE COMMANDER</big> <br />
<br />
How on earth does Basic know what to do? All those statements, commands, and functions, yet the interpreter untiringly plods through your code always knowing what's required next. Just how does it do it?<br />
<br />
Well, if the answer were simple, everybody would be writing Basic interpreters and putting Microsoft out of business. But it is possible to follow at least some of the pathways Basic uses to perform its duties.<br />
<br />
Most addresses of the ROM routines which comprise Basic are held in two tables. These can be unravelled to give a list of routines used to perform various tasks. <br />
<br />
== JUMP ADDRESSES ==<br />
<br />
One table contains jump addresses for the commands ( or verbs, as it were) which will always be the first thing the interpreter picks up from a statement. The whole repertoire of such commands is catered for the table located at 0262 hex.<br />
<br />
Basic gets the appropriate jump address by using the token number for the command it's about to execute. All tokens are numbers from 128 to 255; therefore subtracting 128 gives numbers from zero to 127. As each jump address in the table is two bytes long, the token (minus 128) is multiplied by two to give an offset into the table. This points straight at the address which is needed. The two-byte address is picked up and jumped to ― and we're now executing a Basic command in pure machine code.<br />
<br />
What happens next depends entirely on the machine code for the command itself. Various syntaxes are allowed for some commands but not for others. For instance, the print command would allow an expression such as <code>TAB(22);l/3</code>, so would an <code>LPRINT</code>. But a LET would have none of that. <code>LET X = TAB(22); 1/3</code> would have you on the carpet in no time.<br />
<br />
Also various combinations of tokens can do different things. The comparison operators, for example, can be used pretty much interchangeably. These operators, >― <> = < , etc are all OK syntactically. This versatility means a table for such a wide set of possibilities is nigh impossible.<br />
<br />
== SECOND TABLE ==<br />
<br />
However, there is a second table at location 004E in the ROM. This contains many addresses used in the evaluation of Basic math functions and expressions. These are extracted and jumped to in a similar fashion to the first table.<br />
<br />
Any BASIC word excluded from either of these tables is handled separately by the interpreter according to its particular use. However, out of a possible 128 tokens, these two tables give us a mechanism by which we can follow the machine-code execution of many of them. It is the combination of these routines and the syntax checking required to logically execute them that makes up an interpreter.<br />
<br />
The following list has been compiled from the two tables I've described and a disassembly of other parts of the ROM. It shows the entry points for all important BASIC statements and functions. Certain functions can have more than one possible syntactic use and the list does not cover all such uses. (An example is the statement <code>OFF</code>, which can be <code>SOUND OFF</code> or <code>MOTOR OFF</code> etc.) The list is in four columns. The first is the address in ROM where the BASIC word occurs in the vocabulary table. The second entry is the word itself. Third is the token assigned to that word when it is encoded by the Basic interpreter. <br />
<br />
== FOURTH COLUMN ==<br />
<br />
The fourth column contains the address the interpreter jumps to to execute the token representing the statement or function desired. Once again, some statements can have more than one use such as <code>MID$(LH$)=RH$</code>, and <code>LH$=MID$(RH$)</code>. In these cases, two addresses are given: one for use on the left hand side of the equals sign and one for the right hand side of the sign.<br />
<br />
Perhaps unsurprisingly, things get a little more complicated with the mathematical functions in BASIC. It's not simply a matter of taking an address for, say, a multiply routine and then jumping to it. The BASIC interpreter has to know the numeric type of operator it has to work on. For instance, with the addition operator, Basic has four choices: signed integer, single precision, double precision, and string. None of the other binary operators allow string manipulation, so they're limited to the numeric variable types only.<br />
<br />
The addresses of these binary operators can be confirmed (if you need confirmation) from three short tables in ROM ― one each for double precision, single precision, and integer numbers respectively. <br />
<br />
The tables contain six addresses apiece for addition, subtraction, multiplication, division, exponentiation, and comparison. Rather than clutter the token-addresses table, these addresses are contained separately at the end.<br />
<br />
In a following article, I'll be looking at ways to use some of these addresses in your own machine-code programs. For the more adventurous, an experiment will probably prove irresistible. Remember, though, in a RAM-file machine such as the Model 100, a lock-up may cost you all your files. Use caution.<br />
<br />
JAKES ROM ADDRESSES FOR BASIC KEYWORDS<br />
<br />
0080 => END = 80 @ 409F<br />
<br />
0083 => FOR = 81 @ 0726<br />
<br />
0086 => NEXT = 82 @ 4174<br />
<br />
008A => DATA = 83 @ 099E<br />
<br />
008E => INPUT = 84 @ 0CA3<br />
<br />
0093 => DIM = 85 @ 478B<br />
<br />
0096 => READ = 86 @ OCD9<br />
<br />
009A => LET = 87 @ 09C3<br />
<br />
009D => GOTO = 88 @ 0936<br />
<br />
OOA1 => RUN = 89 @ 090F<br />
<br />
OOA4 => IF = 8A @ OB1A<br />
<br />
OOA6 => RESTORE = 8B @ 407F<br />
<br />
00AD => GOSU8 = 8C @ 091E<br />
<br />
0082 => RETURN = 8D @ 0966<br />
<br />
OOB8 => REM = 8E @ 09AO<br />
<br />
OOBB => STOP = 8F @ 409A<br />
<br />
OOBF => WIDTH = 9D @ 1DC3<br />
<br />
OOC4 => ELSE = 91 @ 09AO<br />
<br />
OOC8 => LINE = 92 @ OC45<br />
<br />
OOCC => EDIT = 93 @ 5E51<br />
<br />
OODO => ERROR = 94 @ OBOF<br />
<br />
00D5 => RESUME = 95 @ OABO<br />
<br />
OODB => OUT = 96 @ 11OC<br />
<br />
OODE => ON = 97 @ OA2F<br />
<br />
OOEO => DSKOS = 98 @ 5071<br />
<br />
OOE5 => OPEN = 99 @ 4CCB<br />
<br />
OOE9 => CLOSE = 9A © 4E20<br />
<br />
OOEE => LOAD = 98 @ 4D70<br />
<br />
OOF2 => MERGE = 9C @ 4D71<br />
<br />
OOF7 => FILES = 9D @ 1F3A<br />
<br />
OOFC => SAVE = 9E © 4DCF<br />
<br />
0100 => LFILES = 9F @ 506F<br />
<br />
0106 => LPRINT = AO @ OB4E<br />
<br />
010C => DEF = A1 @ 0872<br />
<br />
010F => POKE = A2 @ 128B<br />
<br />
0113 => PRINT = A3 @ 0B56<br />
<br />
0118 => CONT = A4 @ 40DA<br />
<br />
011C => LIST = A5 @ 1140<br />
<br />
0120 => LLIST = A6 @ 113B<br />
<br />
0125 => CLEAR = A7 @ 40F9<br />
<br />
012A => CLOAD = A8@ 2377<br />
<br />
012F => CSAVE = A9 @ 2280<br />
<br />
0134 => T1ME$ = AA @ 19AB 1904<br />
<br />
0139 => DATES = AB @ 19BD 1924<br />
<br />
013E => DAYS = AC © 19F1 1955<br />
<br />
0142 => COM = AD @ 1A9E<br />
<br />
0145 => MDM = AE @ 1A9E<br />
<br />
0148 => KEY = AF @ 1BB8<br />
<br />
014B => CLS = BO @ 4231<br />
<br />
014E => BEEP = B1 @ 4229<br />
<br />
0152 => SOUND = B2 @ 1DC5<br />
<br />
0157 => LCOPY = B3 @ 1E5E<br />
<br />
015C => PSET = B4 @ 1C57<br />
<br />
0160 => PRESET = B5 @ 1C66<br />
<br />
0166 => MOTOR = B6 @ 1DEC<br />
<br />
016B => MAX = B7 @ 7FOB 19DB<br />
<br />
016E => POWER = B8 @ 1419<br />
<br />
0173 => CALL = B9 @ 1DFA<br />
<br />
0177 => MENU = BA @ 5797<br />
<br />
017B => IPL = BB @ 1A78<br />
<br />
017E => NAME = BC @ 2037<br />
<br />
0182 => KILL = BD @ 1F91<br />
<br />
0186 => 3CREEN = BE @ 1E22<br />
<br />
018C => NEW = BF @ 20FE<br />
<br />
018F => TAB( = CO @ OC01<br />
� <br />
0193 => TO = C1 @ 076B<br />
<br />
0195 => USING = C2@ 4991<br />
<br />
D19A => VARPTR = C3 @ OF7E<br />
<br />
01AO => ERL = C4@ OF56<br />
<br />
01 A3 => ERR = C5@ OF47<br />
<br />
01 A6 => STING$ = C6@ 296D<br />
<br />
01 AD => INSTR = C7 @ 2A37<br />
<br />
0182 => DSKI$ = C8 @ 5073<br />
<br />
01B7 => INKEY$ = C9@ 4BEA<br />
<br />
01BD => CSRLIN = CA@ 1D90<br />
<br />
01C3 => OFF = C8 @ various<br />
<br />
01C6 => HIMEM = CC @ 1DB9<br />
<br />
01CB => THEN = CD® OB2A<br />
<br />
01CF => NOT = CE @ 1054<br />
<br />
01D2 => STEP = CF @ O783<br />
<br />
01 06 => + = D0 *<br />
<br />
01D7 => - = D1 * See<br />
<br />
01D8 => * = D2 * table<br />
<br />
01 D9 => / = D3 * at end<br />
<br />
010A => /\ = D4 *<br />
<br />
01 DB => AND = D5 @ 1097<br />
<br />
01 DE => OR = 06 @ 108C<br />
<br />
O1EO => XOR = D7 @ 10A2<br />
<br />
01E3 => EQV = D8 @ 10AD<br />
<br />
01E6 => IMP = D9 @ 10B5<br />
<br />
01E9 => MOD = DA@ 37DF<br />
<br />
01 EC => \ = DB @ 377E<br />
<br />
01ED => > = DC@ OE29<br />
<br />
01EE => = = DD@ OE29<br />
<br />
01EF => < = DE @ OE29<br />
<br />
01FO => SGN = DF @ 3407<br />
<br />
01F3 => INT = E0 @ 3654<br />
<br />
OIF6 => ABS = E1 @ 33F2<br />
<br />
01F9 => FRE = E2 @ 2B4C<br />
<br />
01FC => INP = E3 @ 1100<br />
<br />
01FF => LPOS = E4 @ 10C8<br />
<br />
0203 => POS = E5 @ 10CE<br />
<br />
0206 => SQR = E6 @ 305A<br />
<br />
0209 => RND = E7 @ 313E<br />
<br />
020C => LOG = E8 @ 2FCF <br />
<br />
020F => EXP = E9 @ 30A4<br />
<br />
0212 => COS = EA @ 2EEF<br />
<br />
0215 => SIN = EB @ 2F09<br />
<br />
0218 => TAN = EC @ 2F58<br />
<br />
021B => ATN = ED @ 2F71<br />
<br />
021E => PEEK = EE @ 1284<br />
<br />
0222 => EOF = EF @ 1889<br />
<br />
0225 => LOG = F0 @ 506D<br />
<br />
0228 => LOF = F1 @ 506B<br />
<br />
022B => CINT = F2 @ 3501<br />
<br />
022F => CSNG = F3 @ 352A<br />
<br />
0233 => CDBL = F4 @ 35BA<br />
<br />
0237 => FIX = F5 @ 3645<br />
<br />
023A => LEN = F6 @ 2943<br />
<br />
023D => STR$ = F7 @ 273A<br />
<br />
0241 => VAL = F8 @ 2A07<br />
<br />
0244 => ASC = F9 @ 294F<br />
<br />
0247 => CHR$ = FA @ 295F<br />
<br />
0248 => SPACE$ = FB @ 298E<br />
<br />
0251 => LEFT$ = FC @ 29AB<br />
<br />
0256 => RIGHT$ = FD @ 29DC<br />
<br />
025C => MID$ = FE @ 2AC2 29E6<br />
<br />
0260 => ' = FF @ OA90<br />
<br />
<br />
+ - * / > Cmpr<br />
D.P. 2B78 2B69 2CFF 2DC7 3D8E 34FA<br />
S.P. 37F4 37FD 3803 380E 3D7F 3498<br />
INT 3704 36F8 3725 OFOD 3DF7 34C2<br />
Siring 28CC 270C<br />
<br />
Portable lO0 September 1983</div>
64.81.88.222
https://bitchin100.com/wiki/index.php?title=Model_T_DocGarden&diff=850
Model T DocGarden
2009-01-23T05:31:35Z
<p>64.81.88.222: /* Model T Hardware Projects */</p>
<hr />
<div>These pages are devoted to the Model T:<br />
<br />
TRS-80 Model 100, Tandy Model 102, KC-85, NEC 8201A, NEC 8300, Olivetti M10, Tandy Model 200, and the WP-2<br />
<br />
== Classic Article Repubs ==<br />
<br />
We hope to republish one or more articles from the Golden Era of the Model T every month: [[:Category:Model 100 Classics]]<br />
<br />
== One-Liners ==<br />
<br />
This is a collection of Microsoft BASIC programs that<br />
* Do something interesting or useful<br />
* With only a single line of code<br />
<br />
One-liners are bite-sized computer programs on a human scale. You are encouraged to type them in manually (by hand) and study their operation.<br />
<br />
[[Model 100/102 Compatible One-Liners]]<br />
<br />
== Tandy Disk Drive and Emulators ==<br />
<br />
TPDD emulators, in concert with a compatible disk clients like<br />
TS-DOS, TEENY, POWR-DOS, FLOPPY.CO, the Booster Pak, or the <br />
WP-2 built-in Diskette client are the most "advanced" way to<br />
accurately and quickly transfer all file types including binary<br />
files to and from your Model T laptop. There are different<br />
options for the server side on modern operating systems and<br />
devices:<br />
<br />
=== Servers ===<br />
<br />
[[LaddieCon]] is a TPDD emulator for Windows written in C#.Net.<br />
<br />
[[DLPilot]] is a TPDD emulator for PalmOS devices.<br />
<br />
[[DLPlus]] is a TPDD emulator for Linux, BSD, and MacOSX.<br />
<br />
[[NADSBox]] is an advanced stand-alone TPDD emulation device that uses SD cards. It implements multiple levels of TS-DOS directory extensions<br />
<br />
[[Desklink]] is a DOS based TPDD emulator which implements a single-level of the TS-DOS directory extensions<br />
<br />
[[Jan's DOS-Based Docking Station]]<br />
<br />
=== Clients ===<br />
<br />
[[TS-DOS]] is a nice DOS and GUI available in RAM and ROM versions. It is the only client that supports subdirectories given special servers (no real TPDD supports subdirectories).<br />
<br />
[[TEENY]] is a very small RAM-based TPDD client<br />
<br />
[[LAPDOS]] is a DOS PC based TPDD client.<br />
<br />
[[PDD]] is a DOS PC based TPDD client.<br />
<br />
=== Real TPDD and TPDD-2 ===<br />
<br />
[[Differences]] between TPDD-1 and TPDD-2<br />
<br />
== Simple Text File Transfer (No Client) ==<br />
<br />
You can use any "terminal program" to transfer text files to<br />
and from your Model T laptop. Here are some tutorials:<br />
<br />
[[Text File Transfer using Hyperterminal]]<br />
<br />
[http://web.mac.com/lorddoomicus/Doomd/Blog/Entries/2006/9/10_Connecting_a_Tandy_102_Computer_to_a_Mac.html Text File Transfer to Mac using Z-Term]<br />
<br />
== File Storage using MP3 Player ==<br />
<br />
[[File storage with mp3 player]]<br />
<br />
== Model T Software ==<br />
<br />
[[VirtualT]] Model 100/102, T200, NEC 8201A, M10 emulator<br />
<br />
[[mtcpm]] CP/M for the Tandy 100/102/200<br />
<br />
[[RAM4TH]]<br />
<br />
== Model T Hardware Hacks and Troubleshooting ==<br />
<br />
[[Splitting the Model 100/102/200 case]]<br />
<br />
[[Recovering an Unresponsive Laptop]]<br />
<br />
[[International Keyboard Support]]<br />
<br />
[[Repairing Problem Keys]]<br />
<br />
== Model T Hardware Projects ==<br />
<br />
[[Remem]] is the ultimate Model T memory upgrade<br />
<br />
:[http://lists.bitchin100.com/listinfo.cgi/remem-users-bitchin100.com remem-users mailing list] This is a support list for remem users.<br />
:[[Remem Software HOWTO's]]<br />
<br />
[[REX]] is a flash OptROM emulator/switcher<br />
<br />
[[REX2]] is a upcoming flash OptROM emulator/switcher with support for a 64K all-RAM mode. This permits running with a patched main ROM, or the upcoming [[mtcpm]] (Model T CP/M)<br />
<br />
[[NADSBox]] is a stand-alone TPDD emulation device that uses SD cards<br />
<br />
[[Mikrokolor]] Is a Color Graphics interface for the Model 100. Allows for 40x80 character graphics/text<br />
<br />
== Model T Developer Reference ==<br />
<br />
[[String Handling]]<br />
<br />
[[ROM Hooks]]<br />
<br />
[[RAM Variables]]<br />
<br />
[[Option ROM Programming]]<br />
<br />
[[8085 Reference]]<br />
<br />
[[Low Level Filesystem Access]]<br />
<br />
[[Low Level LCD Access]]<br />
<br />
[[Direct Keyboard Access]]<br />
<br />
[[Serial Port Access]]<br />
<br />
[[CO File Format]]<br />
<br />
[[BCR Port Access]]<br />
<br />
[[TPDD Protocol]]<br />
<br />
[[Relocating Loader (RLC) Format]]<br />
<br />
[[Error Codes]]<br />
<br />
[[Doing Binary In BASIC]]<br />
<br />
== Other Topics ==<br />
<br />
== Model T Links ==<br />
<br />
[http://club100.org Rick Hanson's Club 100]<br />
<br />
[http://www.istop.com/%7Esadolph/remem_home.html Steve Adolph's Remem Site]<br />
<br />
[http://sliderule.mraiow.com/wiki/Portable_Computer_Index#T Chris Osburn's Calculating Instruments]<br />
<br />
[http://kenpettit.com/projects.html Ken Pettit's Model T Projects]</div>
64.81.88.222
https://bitchin100.com/wiki/index.php?title=Mikrokolor&diff=847
Mikrokolor
2009-01-21T03:05:26Z
<p>64.81.88.222: </p>
<hr />
<div>== About ==<br />
<br />
The Mikrokolor Color Graphics interface was made in 1984 by Andreasen's Electronics Research & Development, Inc. It sold for $335, and allowed 80x40 character text and graphics in color on an external screen.</div>
64.81.88.222
https://bitchin100.com/wiki/index.php?title=Synchronize_Time_with_your_NADS&diff=825
Synchronize Time with your NADS
2009-01-12T17:29:43Z
<p>64.81.88.222: </p>
<hr />
<div>This program will synchronize your time and date with NADSBox.<br />
<br />
Note, you will have to set the DAY$ separately since this code doesn't do that calculation.<br />
<br />
The program appears below, formatted for easy type-in on the TRS-80 Model 100 or Tandy 102.<br />
<br />
<pre><br />
1 MAXFILES=2:DEFSTRA-F:F="COM:98N1E":OPE<br />
NFFOROUTPUTAS1:OPENFFORINPUTAS2:E=CHR$(5<br />
):C=CHR$(13):?#1,E;"time";C;E;"date";C;:<br />
INPUT#2,A:A=STR$(VAL(A)+(RIGHT$(A,1)="p"<br />
AND12))+RIGHT$(A,7):MID$(A,1)="0":TIME$=<br />
MID$(A,LEN(A)-8,8)<br />
2 INPUT#2,A:MID$(A,1)="0":L=LEN(A)-9:DAT<br />
E$=MID$(A,L,2)+"/"+MID$(A,3+L,2)+"/"+RIG<br />
HT$(A,2)<br />
</pre><br />
<br />
Note: this program is formatted as it would look on your Model T at 40 characters-per-line, as you type it in from the BASIC prompt. From the main menu, launch BASIC. Observe that each program line starts with a number. There are two lines of code.<br />
<br />
As you type each line, hit enter at the end of each line of code, not the end of each 40 columns.<br />
<br />
This is how programs were formatted for type-in in hobbyist magazines.</div>
64.81.88.222
https://bitchin100.com/wiki/index.php?title=Synchronize_Time_with_your_NADS&diff=824
Synchronize Time with your NADS
2009-01-12T17:27:56Z
<p>64.81.88.222: </p>
<hr />
<div>This program will synchronize your time and date with NADSBox.<br />
<br />
Note, you will have to set the DAY$ separately since this code doesn't do that calculation.<br />
<br />
The program appears below, formatted for easy type-in on the TRS-80 Model 100 or Tandy 102.<br />
<br />
<pre><br />
1 MAXFILES=2:DEFSTRA-F:F="COM:98N1E":OPE<br />
NFFOROUTPUTAS1:OPENFFORINPUTAS2:E=CHR$(5<br />
):C=CHR$(13):?#1,E;"time";C;E;"date";C;:<br />
INPUT#2,A:A=STR$(VAL(A)+(RIGHT$(A,1)="p"<br />
AND12))+RIGHT$(A,7):MID$(A,1)="0":TIME$=<br />
MID$(A,LEN(A)-8,8)<br />
2 INPUT#2,A:MID$(A,1)="0":L=LEN(A)-9:DAT<br />
E$=MID$(A,L,2)+"/"+MID$(A,3+L,2)+"/"+RIG<br />
HT$(A,2)<br />
</pre><br />
<br />
Note: this program is formatted as it would look on your Model T at 40 characters-per-line. Each program line starts with a number. There are two lines of code. Hit enter at the end of each line of code, not the end of each 40 columns.<br />
<br />
This is how programs were formatted for type-in in hobbyist magazines.</div>
64.81.88.222
https://bitchin100.com/wiki/index.php?title=Synchronize_Time_with_your_NADS&diff=823
Synchronize Time with your NADS
2009-01-12T17:27:02Z
<p>64.81.88.222: </p>
<hr />
<div>This program will synchronize your time and date with NADSBox.<br />
<br />
Note, you will have to set the DAY$ separately since this code doesn't do that calculation.<br />
<br />
The program appears below, formatted for easy type-in on the TRS-80 Model 100 or Tandy 102.<br />
<br />
<br />
<pre><br />
1 MAXFILES=2:DEFSTRA-F:F="COM:98N1E":OPE<br />
NFFOROUTPUTAS1:OPENFFORINPUTAS2:E=CHR$(5<br />
):C=CHR$(13):?#1,E;"time";C;E;"date";C;:<br />
INPUT#2,A:A=STR$(VAL(A)+(RIGHT$(A,1)="p"<br />
AND12))+RIGHT$(A,7):MID$(A,1)="0":TIME$=<br />
MID$(A,LEN(A)-8,8)<br />
2 INPUT#2,A:MID$(A,1)="0":L=LEN(A)-9:DAT<br />
E$=MID$(A,L,2)+"/"+MID$(A,3+L,2)+"/"+RIG<br />
HT$(A,2)<br />
</pre><br />
<br />
Note: this program is formatted as it would look on your Model T at 40 characters-per-line. Each program line starts with a number. There are two lines of code. Hit enter at the end of each line of code, not the end of each 40 columns.<br />
<br />
This is how programs were formatted for type-in in hobbyist magazines.</div>
64.81.88.222
https://bitchin100.com/wiki/index.php?title=Error_Codes&diff=806
Error Codes
2009-01-08T08:50:25Z
<p>64.81.88.222: /* BASIC Error Codes */</p>
<hr />
<div>== BASIC Error Codes ==<br />
<br />
<table border="1"><br />
<tr><td>1</td><td>NF</td><td>Next without for</td></tr><br />
<tr><td>2</td><td>SN</td><td>Syntax Error</td></tr><br />
<tr><td>3</td><td>RG</td><td>Return without gosub</td></tr><br />
<tr><td>4</td><td>OD</td><td>Out of data</td></tr><br />
<tr><td>5</td><td>FC</td><td>Illegal function call</td></tr><br />
<tr><td>6</td><td>OV</td><td>Overflow</td></tr><br />
<tr><td>7</td><td>OM</td><td>Out of memory</td></tr><br />
<tr><td>8</td><td>UL</td><td>Undefined line</td></tr><br />
<tr><td>9</td><td>BS</td><td>Bad subscript</td></tr><br />
<tr><td>10</td><td>DD</td><td>Double dimensioned array</td></tr><br />
<tr><td>11</td><td>/0</td><td>Divide by zero</td></tr><br />
<tr><td>12</td><td>ID</td><td>Illegal direct</td></tr><br />
<tr><td>13</td><td>TM</td><td>Type mismatch</td></tr><br />
<tr><td>14</td><td>OS</td><td>Out of string space</td></tr><br />
<tr><td>15</td><td>LS</td><td>String too long</td></tr><br />
<tr><td>16</td><td>ST</td><td>String formula too complex</td></tr><br />
<tr><td>17</td><td>CN</td><td>Can't continue</td></tr><br />
<tr><td>18</td><td>IO</td><td>IO error</td></tr><br />
<tr><td>19</td><td>NR</td><td>No resume</td></tr><br />
<tr><td>20</td><td>RW</td><td>Resume without error</td></tr><br />
<tr><td>21</td><td>UE</td><td>Undefined error</td></tr><br />
<tr><td>22</td><td>MO</td><td>Missing operand</td></tr><br />
<tr><td>23-49</td><td>UE</td><td>Undefined error</td></tr><br />
<tr><td>50</td><td>IE</td><td>Undefined error</td></tr><br />
<tr><td>51</td><td>BN</td><td>Bad file number</td></tr><br />
<tr><td>52</td><td>FF</td><td>File not found</td></tr><br />
<tr><td>53</td><td>AO</td><td>Already open</td></tr><br />
<tr><td>54</td><td>EF</td><td>Input past end of file</td></tr><br />
<tr><td>55</td><td>NM</td><td>Bad file name</td></tr><br />
<tr><td>56</td><td>DS</td><td>Direct statement in file</td></tr><br />
<tr><td>57</td><td>FL</td><td>Undefined error</td></tr><br />
<tr><td>58</td><td>CF</td><td>File not open</td></tr><br />
<tr><td>59-255</td><td>UE</td><td>Undefined error</td></tr><br />
</table></div>
64.81.88.222
https://bitchin100.com/wiki/index.php?title=Error_Codes&diff=805
Error Codes
2009-01-08T08:49:54Z
<p>64.81.88.222: New page: == BASIC Error Codes == <table> <tr><td>1</td><td>NF</td><td>Next without for</td></tr> <tr><td>2</td><td>SN</td><td>Syntax Error</td></tr> <tr><td>3</td><td>RG</td><td>Return without gos...</p>
<hr />
<div>== BASIC Error Codes ==<br />
<br />
<table><br />
<tr><td>1</td><td>NF</td><td>Next without for</td></tr><br />
<tr><td>2</td><td>SN</td><td>Syntax Error</td></tr><br />
<tr><td>3</td><td>RG</td><td>Return without gosub</td></tr><br />
<tr><td>4</td><td>OD</td><td>Out of data</td></tr><br />
<tr><td>5</td><td>FC</td><td>Illegal function call</td></tr><br />
<tr><td>6</td><td>OV</td><td>Overflow</td></tr><br />
<tr><td>7</td><td>OM</td><td>Out of memory</td></tr><br />
<tr><td>8</td><td>UL</td><td>Undefined line</td></tr><br />
<tr><td>9</td><td>BS</td><td>Bad subscript</td></tr><br />
<tr><td>10</td><td>DD</td><td>Double dimensioned array</td></tr><br />
<tr><td>11</td><td>/0</td><td>Divide by zero</td></tr><br />
<tr><td>12</td><td>ID</td><td>Illegal direct</td></tr><br />
<tr><td>13</td><td>TM</td><td>Type mismatch</td></tr><br />
<tr><td>14</td><td>OS</td><td>Out of string space</td></tr><br />
<tr><td>15</td><td>LS</td><td>String too long</td></tr><br />
<tr><td>16</td><td>ST</td><td>String formula too complex</td></tr><br />
<tr><td>17</td><td>CN</td><td>Can't continue</td></tr><br />
<tr><td>18</td><td>IO</td><td>IO error</td></tr><br />
<tr><td>19</td><td>NR</td><td>No resume</td></tr><br />
<tr><td>20</td><td>RW</td><td>Resume without error</td></tr><br />
<tr><td>21</td><td>UE</td><td>Undefined error</td></tr><br />
<tr><td>22</td><td>MO</td><td>Missing operand</td></tr><br />
<tr><td>23-49</td><td>UE</td><td>Undefined error</td></tr><br />
<tr><td>50</td><td>IE</td><td>Undefined error</td></tr><br />
<tr><td>51</td><td>BN</td><td>Bad file number</td></tr><br />
<tr><td>52</td><td>FF</td><td>File not found</td></tr><br />
<tr><td>53</td><td>AO</td><td>Already open</td></tr><br />
<tr><td>54</td><td>EF</td><td>Input past end of file</td></tr><br />
<tr><td>55</td><td>NM</td><td>Bad file name</td></tr><br />
<tr><td>56</td><td>DS</td><td>Direct statement in file</td></tr><br />
<tr><td>57</td><td>FL</td><td>Undefined error</td></tr><br />
<tr><td>58</td><td>CF</td><td>File not open</td></tr><br />
<tr><td>59-255</td><td>UE</td><td>Undefined error</td></tr><br />
</table></div>
64.81.88.222
https://bitchin100.com/wiki/index.php?title=Model_T_DocGarden&diff=804
Model T DocGarden
2009-01-08T08:23:57Z
<p>64.81.88.222: /* Model T Developer Reference */</p>
<hr />
<div>These pages are devoted to the Model T:<br />
<br />
TRS-80 Model 100, Tandy Model 102, KC-85, NEC 8201A, NEC 8300, Olivetti M10, Tandy Model 200, and the WP-2<br />
<br />
== One-Liners ==<br />
<br />
This is a collection of Microsoft BASIC programs that<br />
* Do something interesting or useful<br />
* With only a single line of code<br />
<br />
One-liners are bite-sized computer programs on a human scale. You are encouraged to type them in manually (by hand) and study their operation.<br />
<br />
[[Model 100/102 Compatible One-Liners]]<br />
<br />
== Tandy Disk Drive and Emulators ==<br />
<br />
TPDD emulators, in concert with a compatible disk clients like<br />
TS-DOS, TEENY, POWR-DOS, FLOPPY.CO, the Booster Pak, or the <br />
WP-2 built-in Diskette client are the most "advanced" way to<br />
accurately and quickly transfer all file types including binary<br />
files to and from your Model T laptop. There are different<br />
options for the server side on modern operating systems and<br />
devices:<br />
<br />
=== Servers ===<br />
<br />
[[LaddieCon]] is a TPDD emulator for Windows written in C#.Net.<br />
<br />
[[DLPilot]] is a TPDD emulator for PalmOS devices.<br />
<br />
[[DLPlus]] is a TPDD emulator for Linux, BSD, and MacOSX.<br />
<br />
[[NADSBox]] is an advanced stand-alone TPDD emulation device that uses SD cards. It implements multiple levels of TS-DOS directory extensions<br />
<br />
[[Desklink]] is a DOS based TPDD emulator which implements a single-level of the TS-DOS directory extensions<br />
<br />
[[Jan's DOS-Based Docking Station]]<br />
<br />
=== Clients ===<br />
<br />
[[TEENY]] is a very small RAM-based TPDD client<br />
<br />
[[LAPDOS]] is a DOS PC based TPDD client.<br />
<br />
[[PDD]] is a DOS PC based TPDD client.<br />
<br />
=== Real TPDD and TPDD-2 ===<br />
<br />
[[Differences]] between TPDD-1 and TPDD-2<br />
<br />
== Simple Text File Transfer (No Client) ==<br />
<br />
You can use any "terminal program" to transfer text files to<br />
and from your Model T laptop. Here are some tutorials:<br />
<br />
[[Text File Transfer using Hyperterminal]]<br />
<br />
[http://web.mac.com/lorddoomicus/Doomd/Blog/Entries/2006/9/10_Connecting_a_Tandy_102_Computer_to_a_Mac.html Text File Transfer to Mac using Z-Term]<br />
<br />
== File Storage using MP3 Player ==<br />
<br />
[[File storage with mp3 player]]<br />
<br />
== Model T Software ==<br />
<br />
[[VirtualT]] Model 100/102, T200, NEC 8201A, M10 emulator<br />
<br />
[[mtcpm]] CP/M for the Tandy 100/102/200<br />
<br />
[[RAM4TH]]<br />
<br />
== Model T Hardware Hacks and Troubleshooting ==<br />
<br />
[[Splitting the Model 100/102/200 case]]<br />
<br />
[[Recovering an Unresponsive Laptop]]<br />
<br />
[[International Keyboard Support]]<br />
<br />
[[Repairing Problem Keys]]<br />
<br />
== Model T Hardware Projects ==<br />
<br />
[[Remem]] is the ultimate Model T memory upgrade<br />
<br />
:[http://lists.bitchin100.com/listinfo.cgi/remem-users-bitchin100.com remem-users mailing list] This is a support list for remem users.<br />
:[[Remem Software HOWTO's]]<br />
<br />
[[REX]] is a flash OptROM emulator/switcher<br />
<br />
[[REX2]] is a upcoming flash OptROM emulator/switcher with support for a 64K all-RAM mode. This permits running with a patched main ROM, or the upcoming [[mtcpm]] (Model T CP/M)<br />
<br />
[http://www.kenpettit.com/nadsbox.html NADSBox] is a stand-alone TPDD emulation device that uses SD cards<br />
<br />
== Model T Developer Reference ==<br />
<br />
[[String Handling]]<br />
<br />
[[ROM Hooks]]<br />
<br />
[[RAM Variables]]<br />
<br />
[[Option ROM Programming]]<br />
<br />
[[8085 Reference]]<br />
<br />
[[Low Level Filesystem Access]]<br />
<br />
[[Low Level LCD Access]]<br />
<br />
[[Direct Keyboard Access]]<br />
<br />
[[Serial Port Access]]<br />
<br />
[[CO File Format]]<br />
<br />
[[BCR Port Access]]<br />
<br />
[[TPDD Protocol]]<br />
<br />
[[Relocating Loader (RLC) Format]]<br />
<br />
[[Error Codes]]<br />
<br />
== Other Topics ==<br />
<br />
== Model T Links ==<br />
<br />
[http://club100.org Rick Hanson's Club 100]<br />
<br />
[http://www.istop.com/%7Esadolph/remem_home.html Steve Adolph's Remem Site]<br />
<br />
[http://sliderule.mraiow.com/wiki/Portable_Computer_Index#T Chris Osburn's Calculating Instruments]<br />
<br />
[http://kenpettit.com/projects.html Ken Pettit's Model T Projects]</div>
64.81.88.222
https://bitchin100.com/wiki/index.php?title=TPDD-2_Driver_Reverse_Engineering&diff=803
TPDD-2 Driver Reverse Engineering
2009-01-08T07:42:48Z
<p>64.81.88.222: </p>
<hr />
<div><pre><br />
TD2TIP.009 Direct Sector Access using FLOPPY (FLOPPY2)<br />
======================================================<br />
Joel Dinda<br />
[75725,1134]<br />
<br />
While FLOPPY isn't my favorite program, it provides TDD2 users the capability<br />
to bypass the TDD file structure and access disk sectors directly. The most<br />
obvious applications for this capability are utility programs (there are<br />
several such in this Library) and (random access?) database programs (aside:<br />
database programmers will have to write their own file-management routines, a<br />
matter this discussion ignores). This file lists all-in-one-place those things<br />
someone writing such a program will need to know.<br />
<br />
First I'll talk about syntax, then I'll discuss some necessary concerns,<br />
finally I'll discuss some background matters.<br />
<br />
**WARNING: This is an advanced and fairly specialized programming tip. Only<br />
fairly experienced M100(etc) programmers will understand some of this<br />
discussion. Lots of it is pretty opaque. While it's not intended to<br />
intimidate, you've got to be writing a pretty sophisticated program to want to<br />
know these things.<br />
<br />
Powr-DOS/TDD1 users/programmers will want to read DOSTIP.009.<br />
<br />
Syntax<br />
======<br />
The necessary command is a conventional BASIC CALL:<br />
<br />
CALL Z,Y,X<br />
Where:<br />
Z is the start of FLOPPY's file transfer routine (depends upon which<br />
computer you're using)<br />
<br />
Y is the code for the activity you wish to provoke (details follow).<br />
<br />
X is the RAM address of some further instructions necessary for execution<br />
of the routine.<br />
<br />
Z options:<br />
----------<br />
In M100/T102, Z is 62297 (-3239 integer).<br />
In T200, Z is 58980 (-6556).<br />
<br />
Y options:<br />
----------<br />
1 attempts to format the diskette.<br />
3 attempts to read the diskette.<br />
4 attempts to write to the diskette.<br />
5 checks (reports) the status of the drive (so do the other options).<br />
<br />
--TD2TIP.005 says, incorrectly, the Y=2 writes to the diskette (*easy*<br />
mistake). If someone figures out what Y=2 actually *does* do, I'd like<br />
to hear about it. Thanks.<br />
<br />
X options:<br />
----------<br />
Any legal RAM address--but some are far better than others. I'll return<br />
to this momentarily.<br />
<br />
Further information at location X:<br />
----------------------------------<br />
The routine beginning at Z checks at X for two pieces of information:<br />
X and X+1 store the address, in RAM, reserved (by you) for the file<br />
transfer. (Call it a buffer [BF]; this is its lowest address [possibly<br />
HIMEM]. I discuss this further below.) Like most M100 two-byte<br />
addresses, these are stored LSB+MSB. (I suggest a simple solution in<br />
the discussion below.)<br />
<br />
X+2 is the diskette sector being transferred.<br />
<br />
It may help to think of the information at X this way: You're<br />
transferring data [content and direction unspecified] between a buffer<br />
which is indicated at X & X+1 and a diskette sector which is indicated at<br />
X+2.<br />
<br />
Necessary Concerns:<br />
===================<br />
M100 or T200?<br />
-------------<br />
By this time there's no excuse for donating a computer- specific program to<br />
this SIG without good reason. PEEK(1) returns 51 in M100/T102; it returns 171<br />
in T200. Once you know this, you can assign the appropriate value to Z and any<br />
other computer-related POKEs, PEEKs, or CALLs you'll be using. (I like to<br />
work over the keyboard buffer, for instance.)<br />
<br />
Is FLOPPY there?<br />
----------------<br />
Next, check to see if FLOPPY's actually installed. Tandy's BACKUP does this by<br />
checking four RAM locations; the following line is a slightly more compact<br />
version of theirs:<br />
IF PEEK(Z)=229 AND PEEK(Z+1)=94 AND PEEK(Z+239)=4 AND PEEK(Z+240)=195<br />
THEN continue ELSE error: "No System"<br />
<br />
Buffers<br />
-------<br />
Next create one or more buffers for your program's use.<br />
<br />
You'll need one buffer for each sector you intend to duplicate in RAM at any<br />
one time; the exact number will depend either upon the nature of your<br />
application or the amount of RAM available. Each buffer will be 1284 bytes<br />
long; it should be locked in with some variation of the following instruction:<br />
CLEAR256,HIMEM-(1284*(number of buffers))<br />
<br />
It is *always* good practice to restore HIMEM to its previous value when the<br />
program finishes; there are at least two workable schemes. Folks who use<br />
MAXRAM instead of HIMEM in programs which overwrite high memory are despicable<br />
creatures; they should, at least, warn users that they're destroying files.<br />
<br />
Variable X:<br />
-----------<br />
The third CALL argument points to a RAM address containing address information<br />
for the CALL's use. I know of two ways to do this, but suggest that everyone<br />
use this one:<br />
<br />
If BF is the first (lowest) address in the buffer, and S is the sector number:<br />
<br />
0 ... :DEFINT T:DIM T(1): ...<br />
16 ... :T(0)=BF:T(1)=S:CALL Z,Y,VARPTR(T(0)): ...<br />
<br />
This is a "cute trick"; it works because M100 stores T(0) and T(1)<br />
together in RAM; VARPTR(T(0)) tells that location. [Please notice the<br />
DEFINT! It matters!]<br />
<br />
Some of the SIG's utilities use POKEs to accomplish this, but there's no<br />
advantage (and the coding's more difficult).<br />
<br />
Detecting Errors<br />
----------------<br />
While this CALL does not directly return error messages, it *does* return error<br />
information. This information is stored at address X; if you've used<br />
VARPTR(T(0)), you only need to determine the value of T(0). Good practice (and<br />
common sense) dictate that you check this value *immediately* after attempting<br />
any file transfer.<br />
<br />
These are the documented errors:<br />
T(0)=0 or 1 no error<br />
T(0)=3 RS232 Not Ready (Powr-DOS Error 59/NR)<br />
T(0)=5 Communications Error (61/CM)<br />
T(0)=6 Write Protected (63/WP)<br />
T(0)=8 No Disk in Drive (65/ND)<br />
T(0)=9 Hard Trouble (66/HT)<br />
T(0)=12 Drive Not Responding (60/DN) [not previously documented]<br />
<br />
Presumably the "empty" numbers can be generated, but I haven't figured out how.<br />
If you discover one, please pass it along. Thanks.<br />
<br />
I've been using the following approach. Obviously there are others, but I'm<br />
happy with this one:<br />
<br />
0 ON ERROR GOTO 99: ...<br />
...<br />
16 ... :CALL Z,X,VARPTR(T(0)):GOSUB98: ...<br />
...<br />
97 MENU<br />
98 IF T(0)<2 THEN RETURN ELSE IF T(0)=6 OR T(0)=8 THEN ERROR 63 ELSE IF<br />
T(0)=3 OR T(0)=5 OR T(0)=9 OR T(0)=12 THEN ERROR 60 ELSE ERROR 99<br />
99 IF ERR=63 THEN PRINT "Disk Error" ELSE IF ERR=60 THEN PRINT "Drive<br />
Error" ELSE PRINT "Error" ERR "in line" ERL:END<br />
<br />
I've used ERROR 99 as a clue that we've found a new error code. The other<br />
codes simplify conversion between Powr-DOS & FLOPPY.<br />
<br />
You can modify this to RESUME or quit, as appropriate. For instance, knowledge<br />
that T(0)=6 means the diskette is write protected can be used with CALL Z,5,X<br />
force the user to protect a diskette's files.<br />
<br />
Background<br />
==========<br />
Much of the technical information was obtained by studying Tandy's BACKUP.BA,<br />
which is supplied with the TDD2 drive, and by systematic experimentation. Some<br />
of the other discussion follows from Powr-DOS experience.<br />
<br />
Buffer Format:<br />
--------------<br />
The first byte in the sector (more exactly, in the buffer) (let's call it BF+0)<br />
indicates the diskette format in use. 0 means it's a TDD1 diskette; 22 means<br />
it's a TDD2 diskette. This is evidently provided for our information, as<br />
changing it has no effect--if you "save" a sector with this byte changed, then<br />
retrieve it again, it's been restored to its original value.<br />
<br />
The second byte in the sector (well, buffer) (BF+1) is the file vector:<br />
0 means the sector's empty;<br />
255 is an EOF marker; and<br />
any other number indicates "file continues here".<br />
Since file deletions do *not* modify these vectors, these may be misleading.<br />
<br />
Two bytes of unknown consequence follow at BF+2 & BF+3. They appear to always<br />
be zero; presumably they could contain information with meaning to the drive.<br />
<br />
The next 1280 bytes (starting at BF+4) duplicate the sector's contents. If the<br />
sector is not 0 or 1, this could be anything (TDD2 doesn't inflict any format).<br />
Unless modified, Sectors 0 and 1 conform, with three significant modifications,<br />
to the information in SECTR0.TDD, available from this Library. Discussion<br />
follows immediately....<br />
<br />
Directory Structure:<br />
--------------------<br />
TDD directory structure is discussed at some length in my file SECTR0.TDD. <br />
Since FLOPPY delivers a somewhat different copy of the sector to RAM, a few<br />
adjustments must be made; some of these adjustments result from differences<br />
between the drives, while others seem to be idiosyncratic programming<br />
decisions.<br />
<br />
Perhaps the most important difference between sector buffers created by<br />
Powr-DOS and FLOPPY is that FLOPPY's sectors come with four leading bytes (two<br />
of which contain information), while P-DOS's come with 12 trailing bytes (one<br />
of which contains information). When reading SECTR0.TDD, you must therefore<br />
add an offset of 4 to most counts, while the file vector check must be adjusted<br />
from BF+1281 to BF+1.<br />
<br />
Since TDD2 diskettes contain two directories (Sectors 0 and 1), certain<br />
allowances must be made for this. Except for the allocation table, the<br />
structure of the directory sector(s) is unchanged from that described in<br />
SECTR0.<br />
<br />
The allocation table *is* changed. Where TDD1 stores allocation information<br />
for 80 sectors on half of 160 bits, TDD2 (naturally) uses all 160 bits to store<br />
twice as much information. The allocation table is duplicated on both<br />
directories, effectively describing the entire diskette for either. <br />
*Important related matter:* FLOPPY (and any other DOS, near as I can tell)<br />
updates *both* allocation tables when you add or subtract a file. One side<br />
effect of this is that Sector 1 should be considered unavailable under all<br />
circumstances--unless you're writing your own file control routines and *never*<br />
use the TDD2's built-in routines for file transfers.<br />
<br />
<br />
Enough. That should point you in the right direction....<br />
Joel Dinda<br />
July 4, 88<br />
</pre></div>
64.81.88.222
https://bitchin100.com/wiki/index.php?title=TPDD-2_Driver_Reverse_Engineering&diff=802
TPDD-2 Driver Reverse Engineering
2009-01-08T07:42:04Z
<p>64.81.88.222: New page: TD2TIP.009 Direct Sector Access using FLOPPY (FLOPPY2) ====================================================== Joel Dinda [75725,1134] While FLOPPY isn't my favorite program, it provides T...</p>
<hr />
<div>TD2TIP.009 Direct Sector Access using FLOPPY (FLOPPY2)<br />
======================================================<br />
Joel Dinda<br />
[75725,1134]<br />
<br />
While FLOPPY isn't my favorite program, it provides TDD2 users the capability<br />
to bypass the TDD file structure and access disk sectors directly. The most<br />
obvious applications for this capability are utility programs (there are<br />
several such in this Library) and (random access?) database programs (aside:<br />
database programmers will have to write their own file-management routines, a<br />
matter this discussion ignores). This file lists all-in-one-place those things<br />
someone writing such a program will need to know.<br />
<br />
First I'll talk about syntax, then I'll discuss some necessary concerns,<br />
finally I'll discuss some background matters.<br />
<br />
**WARNING: This is an advanced and fairly specialized programming tip. Only<br />
fairly experienced M100(etc) programmers will understand some of this<br />
discussion. Lots of it is pretty opaque. While it's not intended to<br />
intimidate, you've got to be writing a pretty sophisticated program to want to<br />
know these things.<br />
<br />
Powr-DOS/TDD1 users/programmers will want to read DOSTIP.009.<br />
<br />
Syntax<br />
======<br />
The necessary command is a conventional BASIC CALL:<br />
<br />
CALL Z,Y,X<br />
Where:<br />
Z is the start of FLOPPY's file transfer routine (depends upon which<br />
computer you're using)<br />
<br />
Y is the code for the activity you wish to provoke (details follow).<br />
<br />
X is the RAM address of some further instructions necessary for execution<br />
of the routine.<br />
<br />
Z options:<br />
----------<br />
In M100/T102, Z is 62297 (-3239 integer).<br />
In T200, Z is 58980 (-6556).<br />
<br />
Y options:<br />
----------<br />
1 attempts to format the diskette.<br />
3 attempts to read the diskette.<br />
4 attempts to write to the diskette.<br />
5 checks (reports) the status of the drive (so do the other options).<br />
<br />
--TD2TIP.005 says, incorrectly, the Y=2 writes to the diskette (*easy*<br />
mistake). If someone figures out what Y=2 actually *does* do, I'd like<br />
to hear about it. Thanks.<br />
<br />
X options:<br />
----------<br />
Any legal RAM address--but some are far better than others. I'll return<br />
to this momentarily.<br />
<br />
Further information at location X:<br />
----------------------------------<br />
The routine beginning at Z checks at X for two pieces of information:<br />
X and X+1 store the address, in RAM, reserved (by you) for the file<br />
transfer. (Call it a buffer [BF]; this is its lowest address [possibly<br />
HIMEM]. I discuss this further below.) Like most M100 two-byte<br />
addresses, these are stored LSB+MSB. (I suggest a simple solution in<br />
the discussion below.)<br />
<br />
X+2 is the diskette sector being transferred.<br />
<br />
It may help to think of the information at X this way: You're<br />
transferring data [content and direction unspecified] between a buffer<br />
which is indicated at X & X+1 and a diskette sector which is indicated at<br />
X+2.<br />
<br />
Necessary Concerns:<br />
===================<br />
M100 or T200?<br />
-------------<br />
By this time there's no excuse for donating a computer- specific program to<br />
this SIG without good reason. PEEK(1) returns 51 in M100/T102; it returns 171<br />
in T200. Once you know this, you can assign the appropriate value to Z and any<br />
other computer-related POKEs, PEEKs, or CALLs you'll be using. (I like to<br />
work over the keyboard buffer, for instance.)<br />
<br />
Is FLOPPY there?<br />
----------------<br />
Next, check to see if FLOPPY's actually installed. Tandy's BACKUP does this by<br />
checking four RAM locations; the following line is a slightly more compact<br />
version of theirs:<br />
IF PEEK(Z)=229 AND PEEK(Z+1)=94 AND PEEK(Z+239)=4 AND PEEK(Z+240)=195<br />
THEN continue ELSE error: "No System"<br />
<br />
Buffers<br />
-------<br />
Next create one or more buffers for your program's use.<br />
<br />
You'll need one buffer for each sector you intend to duplicate in RAM at any<br />
one time; the exact number will depend either upon the nature of your<br />
application or the amount of RAM available. Each buffer will be 1284 bytes<br />
long; it should be locked in with some variation of the following instruction:<br />
CLEAR256,HIMEM-(1284*(number of buffers))<br />
<br />
It is *always* good practice to restore HIMEM to its previous value when the<br />
program finishes; there are at least two workable schemes. Folks who use<br />
MAXRAM instead of HIMEM in programs which overwrite high memory are despicable<br />
creatures; they should, at least, warn users that they're destroying files.<br />
<br />
Variable X:<br />
-----------<br />
The third CALL argument points to a RAM address containing address information<br />
for the CALL's use. I know of two ways to do this, but suggest that everyone<br />
use this one:<br />
<br />
If BF is the first (lowest) address in the buffer, and S is the sector number:<br />
<br />
0 ... :DEFINT T:DIM T(1): ...<br />
16 ... :T(0)=BF:T(1)=S:CALL Z,Y,VARPTR(T(0)): ...<br />
<br />
This is a "cute trick"; it works because M100 stores T(0) and T(1)<br />
together in RAM; VARPTR(T(0)) tells that location. [Please notice the<br />
DEFINT! It matters!]<br />
<br />
Some of the SIG's utilities use POKEs to accomplish this, but there's no<br />
advantage (and the coding's more difficult).<br />
<br />
Detecting Errors<br />
----------------<br />
While this CALL does not directly return error messages, it *does* return error<br />
information. This information is stored at address X; if you've used<br />
VARPTR(T(0)), you only need to determine the value of T(0). Good practice (and<br />
common sense) dictate that you check this value *immediately* after attempting<br />
any file transfer.<br />
<br />
These are the documented errors:<br />
T(0)=0 or 1 no error<br />
T(0)=3 RS232 Not Ready (Powr-DOS Error 59/NR)<br />
T(0)=5 Communications Error (61/CM)<br />
T(0)=6 Write Protected (63/WP)<br />
T(0)=8 No Disk in Drive (65/ND)<br />
T(0)=9 Hard Trouble (66/HT)<br />
T(0)=12 Drive Not Responding (60/DN) [not previously documented]<br />
<br />
Presumably the "empty" numbers can be generated, but I haven't figured out how.<br />
If you discover one, please pass it along. Thanks.<br />
<br />
I've been using the following approach. Obviously there are others, but I'm<br />
happy with this one:<br />
<br />
0 ON ERROR GOTO 99: ...<br />
...<br />
16 ... :CALL Z,X,VARPTR(T(0)):GOSUB98: ...<br />
...<br />
97 MENU<br />
98 IF T(0)<2 THEN RETURN ELSE IF T(0)=6 OR T(0)=8 THEN ERROR 63 ELSE IF<br />
T(0)=3 OR T(0)=5 OR T(0)=9 OR T(0)=12 THEN ERROR 60 ELSE ERROR 99<br />
99 IF ERR=63 THEN PRINT "Disk Error" ELSE IF ERR=60 THEN PRINT "Drive<br />
Error" ELSE PRINT "Error" ERR "in line" ERL:END<br />
<br />
I've used ERROR 99 as a clue that we've found a new error code. The other<br />
codes simplify conversion between Powr-DOS & FLOPPY.<br />
<br />
You can modify this to RESUME or quit, as appropriate. For instance, knowledge<br />
that T(0)=6 means the diskette is write protected can be used with CALL Z,5,X<br />
force the user to protect a diskette's files.<br />
<br />
Background<br />
==========<br />
Much of the technical information was obtained by studying Tandy's BACKUP.BA,<br />
which is supplied with the TDD2 drive, and by systematic experimentation. Some<br />
of the other discussion follows from Powr-DOS experience.<br />
<br />
Buffer Format:<br />
--------------<br />
The first byte in the sector (more exactly, in the buffer) (let's call it BF+0)<br />
indicates the diskette format in use. 0 means it's a TDD1 diskette; 22 means<br />
it's a TDD2 diskette. This is evidently provided for our information, as<br />
changing it has no effect--if you "save" a sector with this byte changed, then<br />
retrieve it again, it's been restored to its original value.<br />
<br />
The second byte in the sector (well, buffer) (BF+1) is the file vector:<br />
0 means the sector's empty;<br />
255 is an EOF marker; and<br />
any other number indicates "file continues here".<br />
Since file deletions do *not* modify these vectors, these may be misleading.<br />
<br />
Two bytes of unknown consequence follow at BF+2 & BF+3. They appear to always<br />
be zero; presumably they could contain information with meaning to the drive.<br />
<br />
The next 1280 bytes (starting at BF+4) duplicate the sector's contents. If the<br />
sector is not 0 or 1, this could be anything (TDD2 doesn't inflict any format).<br />
Unless modified, Sectors 0 and 1 conform, with three significant modifications,<br />
to the information in SECTR0.TDD, available from this Library. Discussion<br />
follows immediately....<br />
<br />
Directory Structure:<br />
--------------------<br />
TDD directory structure is discussed at some length in my file SECTR0.TDD. <br />
Since FLOPPY delivers a somewhat different copy of the sector to RAM, a few<br />
adjustments must be made; some of these adjustments result from differences<br />
between the drives, while others seem to be idiosyncratic programming<br />
decisions.<br />
<br />
Perhaps the most important difference between sector buffers created by<br />
Powr-DOS and FLOPPY is that FLOPPY's sectors come with four leading bytes (two<br />
of which contain information), while P-DOS's come with 12 trailing bytes (one<br />
of which contains information). When reading SECTR0.TDD, you must therefore<br />
add an offset of 4 to most counts, while the file vector check must be adjusted<br />
from BF+1281 to BF+1.<br />
<br />
Since TDD2 diskettes contain two directories (Sectors 0 and 1), certain<br />
allowances must be made for this. Except for the allocation table, the<br />
structure of the directory sector(s) is unchanged from that described in<br />
SECTR0.<br />
<br />
The allocation table *is* changed. Where TDD1 stores allocation information<br />
for 80 sectors on half of 160 bits, TDD2 (naturally) uses all 160 bits to store<br />
twice as much information. The allocation table is duplicated on both<br />
directories, effectively describing the entire diskette for either. <br />
*Important related matter:* FLOPPY (and any other DOS, near as I can tell)<br />
updates *both* allocation tables when you add or subtract a file. One side<br />
effect of this is that Sector 1 should be considered unavailable under all<br />
circumstances--unless you're writing your own file control routines and *never*<br />
use the TDD2's built-in routines for file transfers.<br />
<br />
<br />
Enough. That should point you in the right direction....<br />
Joel Dinda<br />
July 4, 88</div>
64.81.88.222
https://bitchin100.com/wiki/index.php?title=TPDD-2_Sector_Access&diff=801
TPDD-2 Sector Access
2009-01-08T07:41:46Z
<p>64.81.88.222: New page: Reverse engineering by Joel Dinda</p>
<hr />
<div>[[Reverse engineering by Joel Dinda]]</div>
64.81.88.222
https://bitchin100.com/wiki/index.php?title=TPDD_Protocol&diff=800
TPDD Protocol
2009-01-08T07:40:46Z
<p>64.81.88.222: </p>
<hr />
<div>[[Base Protocol]]<br />
<br />
[[Desklink/TS-DOS Directory Access]]<br />
<br />
[[TPDD-2 Sector Access]]</div>
64.81.88.222
https://bitchin100.com/wiki/index.php?title=Model_100_RAM_Dump_One-Liners&diff=771
Model 100 RAM Dump One-Liners
2009-01-05T05:12:30Z
<p>64.81.88.222: New page: This one-liner creates an image of a Model 100/102 laptop's RAM in well less than one minute. This variant is tailored for NADSBox: Image:dmprmn.png What good is it? * Saving an in...</p>
<hr />
<div>This one-liner creates an image of a Model 100/102 laptop's RAM in well less than one minute.<br />
<br />
This variant is tailored for NADSBox:<br />
<br />
[[Image:dmprmn.png]]<br />
<br />
What good is it?<br />
<br />
* Saving an instance of your computer to send to another programmer for debugging purposes<br />
* The basis of an backup tool<br />
<br />
Interesting related ideas:<br />
<br />
* Write a program that loads the file back up on a real laptop</div>
64.81.88.222
https://bitchin100.com/wiki/index.php?title=Model_100/102_Compatible_One-Liners&diff=770
Model 100/102 Compatible One-Liners
2009-01-05T05:06:59Z
<p>64.81.88.222: New page: Model 100 RAM Dump One-Liners</p>
<hr />
<div>[[Model 100 RAM Dump One-Liners]]</div>
64.81.88.222
https://bitchin100.com/wiki/index.php?title=Model_T_DocGarden&diff=769
Model T DocGarden
2009-01-05T05:05:54Z
<p>64.81.88.222: /* One Liners */</p>
<hr />
<div>These pages are devoted to the Model T:<br />
<br />
TRS-80 Model 100, Tandy Model 102, KC-85, NEC 8201A, NEC 8300, Olivetti M10, Tandy Model 200, and the WP-2<br />
<br />
== One-Liners ==<br />
<br />
This is a collection of Microsoft BASIC programs that<br />
* Accomplish a useful task<br />
* Consist of single line of code<br />
<br />
One-liners are bite-sized computer programs on a human scale. You are encouraged to type them in manually (by hand) and study their operation.<br />
<br />
[[Model 100/102 Compatible One-Liners]]<br />
<br />
== Tandy Disk Drive and Emulators ==<br />
<br />
TPDD emulators, in concert with a compatible disk clients like<br />
TS-DOS, TEENY, POWR-DOS, FLOPPY.CO, the Booster Pak, or the <br />
WP-2 built-in Diskette client are the most "advanced" way to<br />
accurately and quickly transfer all file types including binary<br />
files to and from your Model T laptop. There are different<br />
options for the server side on modern operating systems and<br />
devices:<br />
<br />
=== Servers ===<br />
<br />
[[LaddieCon]] is a TPDD emulator for Windows written in C#.Net.<br />
<br />
[[DLPilot]] is a TPDD emulator for PalmOS devices.<br />
<br />
[[DLPlus]] is a TPDD emulator for Linux, BSD, and MacOSX.<br />
<br />
[[NADSBox]] is an advanced stand-alone TPDD emulation device that uses SD cards. It implements multiple levels of TS-DOS directory extensions<br />
<br />
[[Desklink]] is a DOS based TPDD emulator which implements a single-level of the TS-DOS directory extensions<br />
<br />
[[Jan's DOS-Based Docking Station]]<br />
<br />
=== Clients ===<br />
<br />
[[TEENY]] is a very small RAM-based TPDD client<br />
<br />
[[LAPDOS]] is a DOS PC based TPDD client.<br />
<br />
[[PDD]] is a DOS PC based TPDD client.<br />
<br />
=== Real TPDD and TPDD-2 ===<br />
<br />
[[Differences]] between TPDD-1 and TPDD-2<br />
<br />
== Simple Text File Transfer (No Client) ==<br />
<br />
You can use any "terminal program" to transfer text files to<br />
and from your Model T laptop. Here are some tutorials:<br />
<br />
[[Text File Transfer using Hyperterminal]]<br />
<br />
[http://web.mac.com/lorddoomicus/Doomd/Blog/Entries/2006/9/10_Connecting_a_Tandy_102_Computer_to_a_Mac.html Text File Transfer to Mac using Z-Term]<br />
<br />
== Model T Software ==<br />
<br />
[[VirtualT]] Model 100/102, T200, NEC 8201A, M10 emulator<br />
<br />
[[mtcpm]] CP/M for the Tandy 100/102/200<br />
<br />
[[RAM4TH]]<br />
<br />
== Model T Hardware Hacks and Troubleshooting ==<br />
<br />
[[Splitting the Model 100/102/200 case]]<br />
<br />
[[Recovering an Unresponsive Laptop]]<br />
<br />
[[International Keyboard Support]]<br />
<br />
[[Repairing Problem Keys]]<br />
<br />
== Model T Hardware Projects ==<br />
<br />
[[Remem]] is the ultimate Model T memory upgrade<br />
<br />
:[http://lists.bitchin100.com/listinfo.cgi/remem-users-bitchin100.com remem-users mailing list] This is a support list for remem users.<br />
:[[Remem Software HOWTO's]]<br />
<br />
[[REX]] is a flash OptROM emulator/switcher<br />
<br />
[[REX2]] is a upcoming flash OptROM emulator/switcher with support for a 64K all-RAM mode. This permits running with a patched main ROM, or the upcoming [[mtcpm]] (Model T CP/M)<br />
<br />
[http://www.kenpettit.com/nadsbox.html NADSBox] is a stand-alone TPDD emulation device that uses SD cards<br />
<br />
== Model T Developer Reference ==<br />
<br />
[[String Handling]]<br />
<br />
[[ROM Hooks]]<br />
<br />
[[RAM Variables]]<br />
<br />
[[Option ROM Programming]]<br />
<br />
[[8085 Reference]]<br />
<br />
[[Low Level Filesystem Access]]<br />
<br />
[[Low Level LCD Access]]<br />
<br />
[[Direct Keyboard Access]]<br />
<br />
[[Serial Port Access]]<br />
<br />
[[CO File Format]]<br />
<br />
[[BCR Port Access]]<br />
<br />
[[TPDD Protocol]]<br />
<br />
[[Relocating Loader (RLC) Format]]<br />
<br />
== Other Topics ==<br />
<br />
== Model T Links ==<br />
<br />
[http://club100.org Rick Hanson's Club 100]<br />
<br />
[http://www.istop.com/%7Esadolph/remem_home.html Steve Adolph's Remem Site]<br />
<br />
[http://sliderule.mraiow.com/wiki/Portable_Computer_Index#T Chris Osburn's Calculating Instruments]<br />
<br />
[http://kenpettit.com/projects.html Ken Pettit's Model T Projects]</div>
64.81.88.222
https://bitchin100.com/wiki/index.php?title=Model_T_DocGarden&diff=768
Model T DocGarden
2009-01-05T05:05:36Z
<p>64.81.88.222: /* One Liners */</p>
<hr />
<div>These pages are devoted to the Model T:<br />
<br />
TRS-80 Model 100, Tandy Model 102, KC-85, NEC 8201A, NEC 8300, Olivetti M10, Tandy Model 200, and the WP-2<br />
<br />
== One Liners ==<br />
<br />
This is a collection of Microsoft BASIC programs that<br />
* Accomplish a useful task<br />
* Consist of single line of code<br />
<br />
One-liners are bite-sized computer programs on a human scale. You are encouraged to type them in manually (by hand) and study their operation.<br />
<br />
[[Model 100/102 Compatible One-Liners]]<br />
<br />
== Tandy Disk Drive and Emulators ==<br />
<br />
TPDD emulators, in concert with a compatible disk clients like<br />
TS-DOS, TEENY, POWR-DOS, FLOPPY.CO, the Booster Pak, or the <br />
WP-2 built-in Diskette client are the most "advanced" way to<br />
accurately and quickly transfer all file types including binary<br />
files to and from your Model T laptop. There are different<br />
options for the server side on modern operating systems and<br />
devices:<br />
<br />
=== Servers ===<br />
<br />
[[LaddieCon]] is a TPDD emulator for Windows written in C#.Net.<br />
<br />
[[DLPilot]] is a TPDD emulator for PalmOS devices.<br />
<br />
[[DLPlus]] is a TPDD emulator for Linux, BSD, and MacOSX.<br />
<br />
[[NADSBox]] is an advanced stand-alone TPDD emulation device that uses SD cards. It implements multiple levels of TS-DOS directory extensions<br />
<br />
[[Desklink]] is a DOS based TPDD emulator which implements a single-level of the TS-DOS directory extensions<br />
<br />
[[Jan's DOS-Based Docking Station]]<br />
<br />
=== Clients ===<br />
<br />
[[TEENY]] is a very small RAM-based TPDD client<br />
<br />
[[LAPDOS]] is a DOS PC based TPDD client.<br />
<br />
[[PDD]] is a DOS PC based TPDD client.<br />
<br />
=== Real TPDD and TPDD-2 ===<br />
<br />
[[Differences]] between TPDD-1 and TPDD-2<br />
<br />
== Simple Text File Transfer (No Client) ==<br />
<br />
You can use any "terminal program" to transfer text files to<br />
and from your Model T laptop. Here are some tutorials:<br />
<br />
[[Text File Transfer using Hyperterminal]]<br />
<br />
[http://web.mac.com/lorddoomicus/Doomd/Blog/Entries/2006/9/10_Connecting_a_Tandy_102_Computer_to_a_Mac.html Text File Transfer to Mac using Z-Term]<br />
<br />
== Model T Software ==<br />
<br />
[[VirtualT]] Model 100/102, T200, NEC 8201A, M10 emulator<br />
<br />
[[mtcpm]] CP/M for the Tandy 100/102/200<br />
<br />
[[RAM4TH]]<br />
<br />
== Model T Hardware Hacks and Troubleshooting ==<br />
<br />
[[Splitting the Model 100/102/200 case]]<br />
<br />
[[Recovering an Unresponsive Laptop]]<br />
<br />
[[International Keyboard Support]]<br />
<br />
[[Repairing Problem Keys]]<br />
<br />
== Model T Hardware Projects ==<br />
<br />
[[Remem]] is the ultimate Model T memory upgrade<br />
<br />
:[http://lists.bitchin100.com/listinfo.cgi/remem-users-bitchin100.com remem-users mailing list] This is a support list for remem users.<br />
:[[Remem Software HOWTO's]]<br />
<br />
[[REX]] is a flash OptROM emulator/switcher<br />
<br />
[[REX2]] is a upcoming flash OptROM emulator/switcher with support for a 64K all-RAM mode. This permits running with a patched main ROM, or the upcoming [[mtcpm]] (Model T CP/M)<br />
<br />
[http://www.kenpettit.com/nadsbox.html NADSBox] is a stand-alone TPDD emulation device that uses SD cards<br />
<br />
== Model T Developer Reference ==<br />
<br />
[[String Handling]]<br />
<br />
[[ROM Hooks]]<br />
<br />
[[RAM Variables]]<br />
<br />
[[Option ROM Programming]]<br />
<br />
[[8085 Reference]]<br />
<br />
[[Low Level Filesystem Access]]<br />
<br />
[[Low Level LCD Access]]<br />
<br />
[[Direct Keyboard Access]]<br />
<br />
[[Serial Port Access]]<br />
<br />
[[CO File Format]]<br />
<br />
[[BCR Port Access]]<br />
<br />
[[TPDD Protocol]]<br />
<br />
[[Relocating Loader (RLC) Format]]<br />
<br />
== Other Topics ==<br />
<br />
== Model T Links ==<br />
<br />
[http://club100.org Rick Hanson's Club 100]<br />
<br />
[http://www.istop.com/%7Esadolph/remem_home.html Steve Adolph's Remem Site]<br />
<br />
[http://sliderule.mraiow.com/wiki/Portable_Computer_Index#T Chris Osburn's Calculating Instruments]<br />
<br />
[http://kenpettit.com/projects.html Ken Pettit's Model T Projects]</div>
64.81.88.222
https://bitchin100.com/wiki/index.php?title=Model_T_DocGarden&diff=767
Model T DocGarden
2009-01-05T05:03:01Z
<p>64.81.88.222: /* One Liners */</p>
<hr />
<div>These pages are devoted to the Model T:<br />
<br />
TRS-80 Model 100, Tandy Model 102, KC-85, NEC 8201A, NEC 8300, Olivetti M10, Tandy Model 200, and the WP-2<br />
<br />
== One Liners ==<br />
<br />
This is a collection of programs that<br />
* Accomplish a useful task<br />
* Consist of single line of code<br />
<br />
One-liners are bite-sized computer programs. You are encouraged to type them in by hand. <br />
<br />
[[Model 100/102 Compatible One-Liners]]<br />
<br />
== Tandy Disk Drive and Emulators ==<br />
<br />
TPDD emulators, in concert with a compatible disk clients like<br />
TS-DOS, TEENY, POWR-DOS, FLOPPY.CO, the Booster Pak, or the <br />
WP-2 built-in Diskette client are the most "advanced" way to<br />
accurately and quickly transfer all file types including binary<br />
files to and from your Model T laptop. There are different<br />
options for the server side on modern operating systems and<br />
devices:<br />
<br />
=== Servers ===<br />
<br />
[[LaddieCon]] is a TPDD emulator for Windows written in C#.Net.<br />
<br />
[[DLPilot]] is a TPDD emulator for PalmOS devices.<br />
<br />
[[DLPlus]] is a TPDD emulator for Linux, BSD, and MacOSX.<br />
<br />
[[NADSBox]] is an advanced stand-alone TPDD emulation device that uses SD cards. It implements multiple levels of TS-DOS directory extensions<br />
<br />
[[Desklink]] is a DOS based TPDD emulator which implements a single-level of the TS-DOS directory extensions<br />
<br />
[[Jan's DOS-Based Docking Station]]<br />
<br />
=== Clients ===<br />
<br />
[[TEENY]] is a very small RAM-based TPDD client<br />
<br />
[[LAPDOS]] is a DOS PC based TPDD client.<br />
<br />
[[PDD]] is a DOS PC based TPDD client.<br />
<br />
=== Real TPDD and TPDD-2 ===<br />
<br />
[[Differences]] between TPDD-1 and TPDD-2<br />
<br />
== Simple Text File Transfer (No Client) ==<br />
<br />
You can use any "terminal program" to transfer text files to<br />
and from your Model T laptop. Here are some tutorials:<br />
<br />
[[Text File Transfer using Hyperterminal]]<br />
<br />
[http://web.mac.com/lorddoomicus/Doomd/Blog/Entries/2006/9/10_Connecting_a_Tandy_102_Computer_to_a_Mac.html Text File Transfer to Mac using Z-Term]<br />
<br />
== Model T Software ==<br />
<br />
[[VirtualT]] Model 100/102, T200, NEC 8201A, M10 emulator<br />
<br />
[[mtcpm]] CP/M for the Tandy 100/102/200<br />
<br />
[[RAM4TH]]<br />
<br />
== Model T Hardware Hacks and Troubleshooting ==<br />
<br />
[[Splitting the Model 100/102/200 case]]<br />
<br />
[[Recovering an Unresponsive Laptop]]<br />
<br />
[[International Keyboard Support]]<br />
<br />
[[Repairing Problem Keys]]<br />
<br />
== Model T Hardware Projects ==<br />
<br />
[[Remem]] is the ultimate Model T memory upgrade<br />
<br />
:[http://lists.bitchin100.com/listinfo.cgi/remem-users-bitchin100.com remem-users mailing list] This is a support list for remem users.<br />
:[[Remem Software HOWTO's]]<br />
<br />
[[REX]] is a flash OptROM emulator/switcher<br />
<br />
[[REX2]] is a upcoming flash OptROM emulator/switcher with support for a 64K all-RAM mode. This permits running with a patched main ROM, or the upcoming [[mtcpm]] (Model T CP/M)<br />
<br />
[http://www.kenpettit.com/nadsbox.html NADSBox] is a stand-alone TPDD emulation device that uses SD cards<br />
<br />
== Model T Developer Reference ==<br />
<br />
[[String Handling]]<br />
<br />
[[ROM Hooks]]<br />
<br />
[[RAM Variables]]<br />
<br />
[[Option ROM Programming]]<br />
<br />
[[8085 Reference]]<br />
<br />
[[Low Level Filesystem Access]]<br />
<br />
[[Low Level LCD Access]]<br />
<br />
[[Direct Keyboard Access]]<br />
<br />
[[Serial Port Access]]<br />
<br />
[[CO File Format]]<br />
<br />
[[BCR Port Access]]<br />
<br />
[[TPDD Protocol]]<br />
<br />
[[Relocating Loader (RLC) Format]]<br />
<br />
== Other Topics ==<br />
<br />
== Model T Links ==<br />
<br />
[http://club100.org Rick Hanson's Club 100]<br />
<br />
[http://www.istop.com/%7Esadolph/remem_home.html Steve Adolph's Remem Site]<br />
<br />
[http://sliderule.mraiow.com/wiki/Portable_Computer_Index#T Chris Osburn's Calculating Instruments]<br />
<br />
[http://kenpettit.com/projects.html Ken Pettit's Model T Projects]</div>
64.81.88.222
https://bitchin100.com/wiki/index.php?title=Model_T_DocGarden&diff=766
Model T DocGarden
2009-01-05T05:00:15Z
<p>64.81.88.222: </p>
<hr />
<div>These pages are devoted to the Model T:<br />
<br />
TRS-80 Model 100, Tandy Model 102, KC-85, NEC 8201A, NEC 8300, Olivetti M10, Tandy Model 200, and the WP-2<br />
<br />
== One Liners ==<br />
<br />
This is a collection of programs that<br />
* Accomplish a useful task<br />
* Are succinct enough to be expressed in a single line of code<br />
<br />
[[Model 100/102 Compatible One-Liners]]<br />
<br />
== Tandy Disk Drive and Emulators ==<br />
<br />
TPDD emulators, in concert with a compatible disk clients like<br />
TS-DOS, TEENY, POWR-DOS, FLOPPY.CO, the Booster Pak, or the <br />
WP-2 built-in Diskette client are the most "advanced" way to<br />
accurately and quickly transfer all file types including binary<br />
files to and from your Model T laptop. There are different<br />
options for the server side on modern operating systems and<br />
devices:<br />
<br />
=== Servers ===<br />
<br />
[[LaddieCon]] is a TPDD emulator for Windows written in C#.Net.<br />
<br />
[[DLPilot]] is a TPDD emulator for PalmOS devices.<br />
<br />
[[DLPlus]] is a TPDD emulator for Linux, BSD, and MacOSX.<br />
<br />
[[NADSBox]] is an advanced stand-alone TPDD emulation device that uses SD cards. It implements multiple levels of TS-DOS directory extensions<br />
<br />
[[Desklink]] is a DOS based TPDD emulator which implements a single-level of the TS-DOS directory extensions<br />
<br />
[[Jan's DOS-Based Docking Station]]<br />
<br />
=== Clients ===<br />
<br />
[[TEENY]] is a very small RAM-based TPDD client<br />
<br />
[[LAPDOS]] is a DOS PC based TPDD client.<br />
<br />
[[PDD]] is a DOS PC based TPDD client.<br />
<br />
=== Real TPDD and TPDD-2 ===<br />
<br />
[[Differences]] between TPDD-1 and TPDD-2<br />
<br />
== Simple Text File Transfer (No Client) ==<br />
<br />
You can use any "terminal program" to transfer text files to<br />
and from your Model T laptop. Here are some tutorials:<br />
<br />
[[Text File Transfer using Hyperterminal]]<br />
<br />
[http://web.mac.com/lorddoomicus/Doomd/Blog/Entries/2006/9/10_Connecting_a_Tandy_102_Computer_to_a_Mac.html Text File Transfer to Mac using Z-Term]<br />
<br />
== Model T Software ==<br />
<br />
[[VirtualT]] Model 100/102, T200, NEC 8201A, M10 emulator<br />
<br />
[[mtcpm]] CP/M for the Tandy 100/102/200<br />
<br />
[[RAM4TH]]<br />
<br />
== Model T Hardware Hacks and Troubleshooting ==<br />
<br />
[[Splitting the Model 100/102/200 case]]<br />
<br />
[[Recovering an Unresponsive Laptop]]<br />
<br />
[[International Keyboard Support]]<br />
<br />
[[Repairing Problem Keys]]<br />
<br />
== Model T Hardware Projects ==<br />
<br />
[[Remem]] is the ultimate Model T memory upgrade<br />
<br />
:[http://lists.bitchin100.com/listinfo.cgi/remem-users-bitchin100.com remem-users mailing list] This is a support list for remem users.<br />
:[[Remem Software HOWTO's]]<br />
<br />
[[REX]] is a flash OptROM emulator/switcher<br />
<br />
[[REX2]] is a upcoming flash OptROM emulator/switcher with support for a 64K all-RAM mode. This permits running with a patched main ROM, or the upcoming [[mtcpm]] (Model T CP/M)<br />
<br />
[http://www.kenpettit.com/nadsbox.html NADSBox] is a stand-alone TPDD emulation device that uses SD cards<br />
<br />
== Model T Developer Reference ==<br />
<br />
[[String Handling]]<br />
<br />
[[ROM Hooks]]<br />
<br />
[[RAM Variables]]<br />
<br />
[[Option ROM Programming]]<br />
<br />
[[8085 Reference]]<br />
<br />
[[Low Level Filesystem Access]]<br />
<br />
[[Low Level LCD Access]]<br />
<br />
[[Direct Keyboard Access]]<br />
<br />
[[Serial Port Access]]<br />
<br />
[[CO File Format]]<br />
<br />
[[BCR Port Access]]<br />
<br />
[[TPDD Protocol]]<br />
<br />
[[Relocating Loader (RLC) Format]]<br />
<br />
== Other Topics ==<br />
<br />
== Model T Links ==<br />
<br />
[http://club100.org Rick Hanson's Club 100]<br />
<br />
[http://www.istop.com/%7Esadolph/remem_home.html Steve Adolph's Remem Site]<br />
<br />
[http://sliderule.mraiow.com/wiki/Portable_Computer_Index#T Chris Osburn's Calculating Instruments]<br />
<br />
[http://kenpettit.com/projects.html Ken Pettit's Model T Projects]</div>
64.81.88.222
https://bitchin100.com/wiki/index.php?title=8085_Reference&diff=765
8085 Reference
2009-01-01T23:05:28Z
<p>64.81.88.222: Undo revision 764 by 88.177.233.189 (Talk)</p>
<hr />
<div><H1>8085 Instruction Mnemonic Meanings</H1><br />
<H2 >Data Transfer Group</H2><br />
{| BORDER=1 WIDTH=70% style="font-size:70%"<br />
| COLSPAN=2 | <P>Instruction</P><br />
| | <P>Mnemonic Meaning</P><br />
| COLSPAN=4 | <P>Flags</P><br />
|- <br />
| COLSPAN=3 | <P><BR></P><br />
| | <P ALIGN=CENTER>Zf</P><br />
| | <P ALIGN=CENTER>Cf</P><br />
| | <P ALIGN=CENTER>Pf</P><br />
| | <P ALIGN=CENTER>Sf</P><br />
|- <br />
| | <P>MOV</P><br />
| | <P>dreg, sreg</P><br />
| | <P>MOVe</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
|- <br />
| | <P>MVI</P><br />
| | <P>reg, byte</P><br />
| | <P>MoVe Immediate</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
|- <br />
| | <P>MVX</P><br />
| | <P>drp, srp</P><br />
| | <P>MoVe eXtended-register (pseudo for high &amp;<br />
low MOVs)</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
|- <br />
| | <P>LXI</P><br />
| | <P>rp, word</P><br />
| | <P>Load eXtended-register Immediate</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
|- <br />
| | <P>XCHG</P><br />
| | <P><BR></P><br />
| | <P>eXCHanGe hl with de</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
|- <br />
| | <P>LDA</P><br />
| | <P>addr</P><br />
| | <P>LoaD Accumulator direct</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
|- <br />
| | <P>STA</P><br />
| | <P>addr</P><br />
| | <P>STore Accumulator direct</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
|- <br />
| | <P>LDAX</P><br />
| | <P>B</P><br />
| | <P>LoaD Accumulator indirect via eXtended-register<br />
Bc</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
|- <br />
| | <P>STAX</P><br />
| | <P>B</P><br />
| | <P>Store Accumulator indirect via<br />
eXtended-register Bc</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
|- <br />
| | <P>LDAX</P><br />
| | <P>D</P><br />
| | <P>LoaD Accumulator indirect via eXtended-register<br />
De</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
|- <br />
| | <P>STAX</P><br />
| | <P>D</P><br />
| | <P>Store Accumulator indirect via<br />
eXtended-register De</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
|- <br />
| | <P>LHLD</P><br />
| | <P>addr</P><br />
| | <P>Load HL Direct</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
|- <br />
| | <P>SHLD</P><br />
| | <P>addr</P><br />
| | <P>Store HL Direct</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
|- <br />
| | <P>LHLI</P><br />
| | <P><BR></P><br />
| | <P>Load HL Indirect via extended register de</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
|- VALIGN=TOP<br />
| | <P>SHLI</P><br />
| | <P><BR></P><br />
| | <P>Store HL Indirect via extended register de</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
|}<br />
<br />
<H2 >Arithmetic Group</H2><br />
{| BORDER=1 WIDTH=70% style="font-size:70%"<br />
| COLSPAN=2 | <P>Instruction</P><br />
| | <P>Mnemonic Meaning</P><br />
| COLSPAN=4 | <P>Flags</P><br />
|- <br />
| COLSPAN=3 | <P><BR></P><br />
| | <P ALIGN=CENTER>Zf</P><br />
| | <P ALIGN=CENTER>Cf</P><br />
| | <P ALIGN=CENTER>Pf</P><br />
| | <P ALIGN=CENTER>Sf</P><br />
|- <br />
| | <P>ADD</P><br />
| | <P>reg</P><br />
| | <P>ADD</P><br />
| | <P ALIGN=CENTER>x</P><br />
| | <P ALIGN=CENTER>x</P><br />
| | <P ALIGN=CENTER>x</P><br />
| | <P ALIGN=CENTER>x</P><br />
|- <br />
| | <P>ADI</P><br />
| | <P>byte</P><br />
| | <P>ADd Immediate</P><br />
| | <P ALIGN=CENTER>x</P><br />
| | <P ALIGN=CENTER>x</P><br />
| | <P ALIGN=CENTER>x</P><br />
| | <P ALIGN=CENTER>x</P><br />
|- <br />
| | <P>ADC</P><br />
| | <P>reg</P><br />
| | <P>ADd with Carry</P><br />
| | <P ALIGN=CENTER>x</P><br />
| | <P ALIGN=CENTER>x</P><br />
| | <P ALIGN=CENTER>x</P><br />
| | <P ALIGN=CENTER>x</P><br />
|- <br />
| | <P>ACI</P><br />
| | <P>byte</P><br />
| | <P>Add with Carry Immediate</P><br />
| | <P ALIGN=CENTER>x</P><br />
| | <P ALIGN=CENTER>x</P><br />
| | <P ALIGN=CENTER>x</P><br />
| | <P ALIGN=CENTER>x</P><br />
|- <br />
| | <P>SUB</P><br />
| | <P>reg</P><br />
| | <P>SUBtract</P><br />
| | <P ALIGN=CENTER>x</P><br />
| | <P ALIGN=CENTER>x</P><br />
| | <P ALIGN=CENTER>x</P><br />
| | <P ALIGN=CENTER>x</P><br />
|- <br />
| | <P>SUI</P><br />
| | <P>byte</P><br />
| | <P>SUbtract Immediate</P><br />
| | <P ALIGN=CENTER>x</P><br />
| | <P ALIGN=CENTER>x</P><br />
| | <P ALIGN=CENTER>x</P><br />
| | <P ALIGN=CENTER>x</P><br />
|- <br />
| | <P>SBB</P><br />
| | <P>reg</P><br />
| | <P>SuBtract with Borrow</P><br />
| | <P ALIGN=CENTER>x</P><br />
| | <P ALIGN=CENTER>x</P><br />
| | <P ALIGN=CENTER>x</P><br />
| | <P ALIGN=CENTER>x</P><br />
|- <br />
| | <P>SBI</P><br />
| | <P>byte</P><br />
| | <P>Subtract with Borrow Immediate</P><br />
| | <P ALIGN=CENTER>x</P><br />
| | <P ALIGN=CENTER>x</P><br />
| | <P ALIGN=CENTER>x</P><br />
| | <P ALIGN=CENTER>x</P><br />
|- <br />
| | <P>DAA</P><br />
| | <P><BR></P><br />
| | <P>Decimal Adjust Accumulator</P><br />
| | <P ALIGN=CENTER>x</P><br />
| | <P ALIGN=CENTER>x</P><br />
| | <P ALIGN=CENTER>x</P><br />
| | <P ALIGN=CENTER>x</P><br />
|- <br />
| | <P>INR</P><br />
| | <P>reg</P><br />
| | <P>INcrement Register</P><br />
| | <P ALIGN=CENTER>x</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>x</P><br />
| | <P ALIGN=CENTER>x</P><br />
|- <br />
| | <P>INX</P><br />
| | <P>rp</P><br />
| | <P>INcrement eXtended-register</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
|- <br />
| | <P>DCR</P><br />
| | <P>reg</P><br />
| | <P>DeCrement Register</P><br />
| | <P ALIGN=CENTER>x</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>x</P><br />
| | <P ALIGN=CENTER>x</P><br />
|- <br />
| | <P>DCX</P><br />
| | <P>rp</P><br />
| | <P>DeCrement eXtended-register</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
|- <br />
| | <P>DAD</P><br />
| | <P>rp</P><br />
| | <P>Dual-register ADd to hl</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>x</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
|- <br />
| | <P>HLMBC</P><br />
| | <P><BR></P><br />
| | <P>HL Minus BC</P><br />
| | <P ALIGN=CENTER>x</P><br />
| | <P ALIGN=CENTER>x</P><br />
| | <P ALIGN=CENTER>h</P><br />
| | <P ALIGN=CENTER>x</P><br />
|- <br />
| | <P>DEHL</P><br />
| | <P>byte</P><br />
| | <P>DE from HL plus byte</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
|- VALIGN=TOP<br />
| | <P>DESP</P><br />
| | <P>byte</P><br />
| | <P>DE from SP plus byte</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
|}<br />
<br />
<H2 >Logical Group</H2><br />
{| BORDER=1 WIDTH=70% style="font-size:70%"<br />
| COLSPAN=2 | <P>Instruction</P><br />
| | <P>Mnemonic Meaning</P><br />
| COLSPAN=4 | <P>Flags</P><br />
|- <br />
| COLSPAN=3 | <P><BR></P><br />
| | <P ALIGN=CENTER>Zf</P><br />
| | <P ALIGN=CENTER>Cf</P><br />
| | <P ALIGN=CENTER>Pf</P><br />
| | <P ALIGN=CENTER>Sf</P><br />
|- <br />
| | <P>CMP</P><br />
| | <P>reg</P><br />
| | <P>CoMPare</P><br />
| | <P ALIGN=CENTER>x</P><br />
| | <P ALIGN=CENTER>x</P><br />
| | <P ALIGN=CENTER>x</P><br />
| | <P ALIGN=CENTER>x</P><br />
|- <br />
| | <P>CPI</P><br />
| | <P>byte</P><br />
| | <P>ComPare Immediate</P><br />
| | <P ALIGN=CENTER>x</P><br />
| | <P ALIGN=CENTER>x</P><br />
| | <P ALIGN=CENTER>x</P><br />
| | <P ALIGN=CENTER>x</P><br />
|- <br />
| | <P>CMA</P><br />
| | <P><BR></P><br />
| | <P>CoMplement Accumulator</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
|- <br />
| | <P>CMC</P><br />
| | <P><BR></P><br />
| | <P>CoMplement Carry</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>x</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
|- <br />
| | <P>STC</P><br />
| | <P><BR></P><br />
| | <P>SeT Carry</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>1</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
|- <br />
| | <P>SHLR</P><br />
| | <P><BR></P><br />
| | <P>Shift HL Right</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>x</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
|- <br />
| | <P>ANA</P><br />
| | <P>reg</P><br />
| | <P>ANd Accumulator</P><br />
| | <P ALIGN=CENTER>x</P><br />
| | <P ALIGN=CENTER>0</P><br />
| | <P ALIGN=CENTER>x</P><br />
| | <P ALIGN=CENTER>x</P><br />
|- <br />
| | <P>ANI</P><br />
| | <P>byte</P><br />
| | <P>ANd Immediate</P><br />
| | <P ALIGN=CENTER>x</P><br />
| | <P ALIGN=CENTER>0</P><br />
| | <P ALIGN=CENTER>x</P><br />
| | <P ALIGN=CENTER>x</P><br />
|- <br />
| | <P>ORA</P><br />
| | <P>reg</P><br />
| | <P>OR Accumulator</P><br />
| | <P ALIGN=CENTER>x</P><br />
| | <P ALIGN=CENTER>0</P><br />
| | <P ALIGN=CENTER>x</P><br />
| | <P ALIGN=CENTER>x</P><br />
|- <br />
| | <P>ORI</P><br />
| | <P>byte</P><br />
| | <P>OR Immediate</P><br />
| | <P ALIGN=CENTER>x</P><br />
| | <P ALIGN=CENTER>0</P><br />
| | <P ALIGN=CENTER>x</P><br />
| | <P ALIGN=CENTER>x</P><br />
|- <br />
| | <P>XRA</P><br />
| | <P>reg</P><br />
| | <P>eXclusive oR Accumulator</P><br />
| | <P ALIGN=CENTER>x</P><br />
| | <P ALIGN=CENTER>0</P><br />
| | <P ALIGN=CENTER>x</P><br />
| | <P ALIGN=CENTER>x</P><br />
|- <br />
| | <P>XRI</P><br />
| | <P>byte</P><br />
| | <P>eXclusive oR Immediate</P><br />
| | <P ALIGN=CENTER>x</P><br />
| | <P ALIGN=CENTER>0</P><br />
| | <P ALIGN=CENTER>x</P><br />
| | <P ALIGN=CENTER>x</P><br />
|- <br />
| | <P>RAL</P><br />
| | <P><BR></P><br />
| | <P>Rotate Accumulator Left through carry</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>x</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
|- <br />
| | <P>RAR</P><br />
| | <P><BR></P><br />
| | <P>Rotate Accumulator Right through carry</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>x</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
|- <br />
| | <P>RLC</P><br />
| | <P><BR></P><br />
| | <P>Rotate accumulator Left Circular</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>x</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
|- <br />
| | <P>RRC</P><br />
| | <P><BR></P><br />
| | <P>Rotate accumulator Right Circular</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>x</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
|- VALIGN=TOP<br />
| | <P>RDEL</P><br />
| | <P><BR></P><br />
| | <P>Rotate DE Left through carry</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>x</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
|}<br />
<br />
<H2 >Stack, Input/Output, &amp; Machine Control Group</H2><br />
{| BORDER=1 WIDTH=70% style="font-size:70%"<br />
| COLSPAN=2 | <P>Instruction</P><br />
| | <P>Mnemonic Meaning</P><br />
| COLSPAN=4 | <P>Flags</P><br />
|- <br />
| COLSPAN=3 | <P><BR></P><br />
| | <P ALIGN=CENTER>Zf</P><br />
| | <P ALIGN=CENTER>Cf</P><br />
| | <P ALIGN=CENTER>Pf</P><br />
| | <P ALIGN=CENTER>Sf</P><br />
|- <br />
| | <P>PUSH</P><br />
| | <P>rp</P><br />
| | <P>PUSH on stack</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
|- <br />
| | <P>POP</P><br />
| | <P>rp</P><br />
| | <P>POP off stack</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
|- <br />
| | <P>SPHL</P><br />
| | <P><BR></P><br />
| | <P>Stack Pointer from HL</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
|- <br />
| | <P>XTHL</P><br />
| | <P><BR></P><br />
| | <P>eXchange Top of stack with HL</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
|- <br />
| | <P>IN</P><br />
| | <P>port</P><br />
| | <P>INput from port</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
|- <br />
| | <P>OUT</P><br />
| | <P>port</P><br />
| | <P>OUTput to port</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
|- <br />
| | <P>DI</P><br />
| | <P><BR></P><br />
| | <P>Disable Interrupts</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
|- <br />
| | <P>EI</P><br />
| | <P><BR></P><br />
| | <P>Enable Interrupts</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
|- <br />
| | <P>RIM</P><br />
| | <P><BR></P><br />
| | <P>Read Interrupt Mask</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
|- <br />
| | <P>SIM</P><br />
| | <P><BR></P><br />
| | <P>Set Interrupt Mask</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
|- <br />
| | <P>NOP</P><br />
| | <P><BR></P><br />
| | <P>No OPeration</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
|- <br />
| | <P>HLT</P><br />
| | <P><BR></P><br />
| | <P>HaLT</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
|}<br />
<br />
<H2 >Branch Group</H2><br />
{| BORDER=1 WIDTH=70% style="font-size:70%"<br />
| COLSPAN=2 | <P>Instruction</P><br />
| | <P>Mnemonic Meaning</P><br />
| COLSPAN=4 | <P>Flags</P><br />
|- <br />
| COLSPAN=3 | <P><BR></P><br />
| | <P ALIGN=CENTER>Zf</P><br />
| | <P ALIGN=CENTER>Cf</P><br />
| | <P ALIGN=CENTER>Pf</P><br />
| | <P ALIGN=CENTER>Sf</P><br />
|- <br />
| | <P>JMP</P><br />
| | <P>label</P><br />
| | <P>JuMP unconditional</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
|- <br />
| | <P>JZ</P><br />
| | <P>label</P><br />
| | <P>Jump if Zero</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
|- <br />
| | <P>JNZ</P><br />
| | <P>label</P><br />
| | <P>Jump if No Zero</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
|- <br />
| | <P>JP</P><br />
| | <P>label</P><br />
| | <P>Jump if Positive</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
|- <br />
| | <P>JM</P><br />
| | <P>label</P><br />
| | <P>Jump if Minus</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
|- <br />
| | <P>JC</P><br />
| | <P>label</P><br />
| | <P>Jump if Carry</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
|- <br />
| | <P>JNC</P><br />
| | <P>label</P><br />
| | <P>Jump if No Carry</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
|- <br />
| | <P>JTM</P><br />
| | <P>label</P><br />
| | <P>Jump if True sign Minus</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
|- <br />
| | <P>JTP</P><br />
| | <P>label</P><br />
| | <P>Jump if True sign Positive</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
|- <br />
| | <P>JPE</P><br />
| | <P>label</P><br />
| | <P>Jump if Parity Even</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
|- <br />
| | <P>JPO</P><br />
| | <P>label</P><br />
| | <P>Jump if Parity Odd</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
|- <br />
| | <P>CALL</P><br />
| | <P>label</P><br />
| | <P>CALL unconditioanl</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
|- <br />
| | <P>CZ</P><br />
| | <P>label</P><br />
| | <P>Call if Zero</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
|- <br />
| | <P>CNZ</P><br />
| | <P>label</P><br />
| | <P>Call if No Zero</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
|- <br />
| | <P>CP</P><br />
| | <P>label</P><br />
| | <P>Call if Positive</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
|- <br />
| | <P>CM</P><br />
| | <P>label</P><br />
| | <P>Call if Minus</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
|- <br />
| | <P>CC</P><br />
| | <P>label</P><br />
| | <P>Call if Carry</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
|- <br />
| | <P>CNC</P><br />
| | <P>label</P><br />
| | <P>Call if No Carry</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
|- <br />
| | <P>CPE</P><br />
| | <P>label</P><br />
| | <P>Call if Parity Even</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
|- <br />
| | <P>CPO</P><br />
| | <P>label</P><br />
| | <P>Call if Parity Odd</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
|- <br />
| | <P>RET</P><br />
| | <P><BR></P><br />
| | <P>RETurn unconditional</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
|- <br />
| | <P>RZ</P><br />
| | <P><BR></P><br />
| | <P>Return if Zero</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
|- <br />
| | <P>RNZ</P><br />
| | <P><BR></P><br />
| | <P>Return if No Zero</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
|- <br />
| | <P>RP</P><br />
| | <P><BR></P><br />
| | <P>Return if Positive</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
|- <br />
| | <P>RM</P><br />
| | <P><BR></P><br />
| | <P>Return if Minus</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
|- <br />
| | <P>RC</P><br />
| | <P><BR></P><br />
| | <P>Return if Carry</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
|- <br />
| | <P>RNC</P><br />
| | <P><BR></P><br />
| | <P>Return if No Carry</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
|- <br />
| | <P>RPE</P><br />
| | <P><BR></P><br />
| | <P>Return if Parity Even</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
|- <br />
| | <P>RPO</P><br />
| | <P><BR></P><br />
| | <P>Return if Parity Odd</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
|- <br />
| | <P>PCHL</P><br />
| | <P><BR></P><br />
| | <P>Program Counter from HL</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
|- <br />
| | <P>RST</P><br />
| | <P>n</P><br />
| | <P>ReSTart</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
|- VALIGN=TOP<br />
| | <P>RSTV</P><br />
| | <P><BR></P><br />
| | <P>ReSTart if oVerflow</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
|}<br />
<br />
<H1 >8085 Instruction Actions by Functional Group</H1><br />
<H2 >Data Transfer Group</H2><br />
{| BORDER=1 WIDTH=70% style="font-size:70%"<br />
| COLSPAN=2 % | <P>Instruction</P><br />
| | <P>Mnemonic Meaning</P><br />
| COLSPAN=4 % | <P>Flags</P><br />
|- <br />
| COLSPAN=3 % | <P><BR></P><br />
| | <P ALIGN=CENTER>Zf</P><br />
| | <P ALIGN=CENTER>Cf</P><br />
| | <P ALIGN=CENTER>Pf</P><br />
| | <P ALIGN=CENTER>Sf</P><br />
|- <br />
| | <P>MOV</P><br />
| | <P>dreg, sreg</P><br />
| | <P>dreg&lt;=sreg</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
|- <br />
| | <P>MVI</P><br />
| | <P>reg, byte</P><br />
| | <P>reg&lt;=byte</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
|- <br />
| | <P>MVX</P><br />
| | <P>drp, srp</P><br />
| | <P>drp&lt;=srp (pseudo for high &amp; low MOVs)</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
|- <br />
| | <P>LXI</P><br />
| | <P>rp, word</P><br />
| | <P>rp&lt;=word</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
|- <br />
| | <P>XCHG</P><br />
| | <P><BR></P><br />
| | <P>HL&lt;=DE while DE&lt;=HL</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
|- <br />
| | <P>LDA</P><br />
| | <P>addr</P><br />
| | <P>A&lt;=b[addr]</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
|- <br />
| | <P>STA</P><br />
| | <P>addr</P><br />
| | <P>b[addr]&lt;=A</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
|- <br />
| | <P>LDAX</P><br />
| | <P>B</P><br />
| | <P>A&lt;=b[BC]</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
|- <br />
| | <P>STAX</P><br />
| | <P>B</P><br />
| | <P>b[BC]&lt;=A</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
|- <br />
| | <P>LDAX</P><br />
| | <P>D</P><br />
| | <P>A&lt;=b[DE]</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
|- <br />
| | <P>STAX</P><br />
| | <P>D</P><br />
| | <P>b[DE]&lt;=A</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
|- <br />
| | <P>LHLD</P><br />
| | <P>addr</P><br />
| | <P>HL&lt;=w[addr]</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
|- <br />
| | <P>SHLD</P><br />
| | <P>addr</P><br />
| | <P>w[addr]&lt;=HL</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
|- <br />
| | <P>LHLI</P><br />
| | <P><BR></P><br />
| | <P>HL&lt;=w[DE]</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
|- VALIGN=TOP<br />
| | <P>SHLI</P><br />
| | <P><BR></P><br />
| | <P>w[DE]&lt;=HL</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
|}<br />
<br />
<H2 >Arithmetic Group</H2><br />
{| BORDER=1 WIDTH=70% style="font-size:70%"<br />
| COLSPAN=2 | <P>Instruction</P><br />
| | <P>Mnemonic Meaning</P><br />
| COLSPAN=4 | <P>Flags</P><br />
|- <br />
| COLSPAN=3 | <P><BR></P><br />
| | <P ALIGN=CENTER>Zf</P><br />
| | <P ALIGN=CENTER>Cf</P><br />
| | <P ALIGN=CENTER>Pf</P><br />
| | <P ALIGN=CENTER>Sf</P><br />
|- <br />
| | <P>ADD</P><br />
| | <P>reg</P><br />
| | <P>A&lt;=A+reg</P><br />
| | <P ALIGN=CENTER>x</P><br />
| | <P ALIGN=CENTER>x</P><br />
| | <P ALIGN=CENTER>x</P><br />
| | <P ALIGN=CENTER>x</P><br />
|- <br />
| | <P>ADI</P><br />
| | <P>byte</P><br />
| | <P>A&lt;=A+byte</P><br />
| | <P ALIGN=CENTER>x</P><br />
| | <P ALIGN=CENTER>x</P><br />
| | <P ALIGN=CENTER>x</P><br />
| | <P ALIGN=CENTER>x</P><br />
|- <br />
| | <P>ADC</P><br />
| | <P>reg</P><br />
| | <P>A&lt;=A+reg+Cf</P><br />
| | <P ALIGN=CENTER>x</P><br />
| | <P ALIGN=CENTER>x</P><br />
| | <P ALIGN=CENTER>x</P><br />
| | <P ALIGN=CENTER>x</P><br />
|- <br />
| | <P>ACI</P><br />
| | <P>byte</P><br />
| | <P>A&lt;=A+byte+Cf</P><br />
| | <P ALIGN=CENTER>x</P><br />
| | <P ALIGN=CENTER>x</P><br />
| | <P ALIGN=CENTER>x</P><br />
| | <P ALIGN=CENTER>x</P><br />
|- <br />
| | <P>SUB</P><br />
| | <P>reg</P><br />
| | <P>A&lt;=A-reg</P><br />
| | <P ALIGN=CENTER>x</P><br />
| | <P ALIGN=CENTER>x</P><br />
| | <P ALIGN=CENTER>x</P><br />
| | <P ALIGN=CENTER>x</P><br />
|- <br />
| | <P>SUI</P><br />
| | <P>byte</P><br />
| | <P>A&lt;=A-byte</P><br />
| | <P ALIGN=CENTER>x</P><br />
| | <P ALIGN=CENTER>x</P><br />
| | <P ALIGN=CENTER>x</P><br />
| | <P ALIGN=CENTER>x</P><br />
|- <br />
| | <P>SBB</P><br />
| | <P>reg</P><br />
| | <P>A&lt;=A-reg-Cf</P><br />
| | <P ALIGN=CENTER>x</P><br />
| | <P ALIGN=CENTER>x</P><br />
| | <P ALIGN=CENTER>x</P><br />
| | <P ALIGN=CENTER>x</P><br />
|- <br />
| | <P>SBI</P><br />
| | <P>byte</P><br />
| | <P>A&lt;=A-byte-Cf</P><br />
| | <P ALIGN=CENTER>x</P><br />
| | <P ALIGN=CENTER>x</P><br />
| | <P ALIGN=CENTER>x</P><br />
| | <P ALIGN=CENTER>x</P><br />
|- <br />
| | <P>DAA</P><br />
| | <P><BR></P><br />
| | <P>in A3..A0 and A7..A4: if &gt;9 then +6, carry<br />
to next</P><br />
| | <P ALIGN=CENTER>x</P><br />
| | <P ALIGN=CENTER>x</P><br />
| | <P ALIGN=CENTER>x</P><br />
| | <P ALIGN=CENTER>x</P><br />
|- <br />
| | <P>INR</P><br />
| | <P>reg</P><br />
| | <P>reg&lt;=reg+1</P><br />
| | <P ALIGN=CENTER>x</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>x</P><br />
| | <P ALIGN=CENTER>x</P><br />
|- <br />
| | <P>INX</P><br />
| | <P>rp</P><br />
| | <P>rp&lt;=rp+1</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
|- <br />
| | <P>DCR</P><br />
| | <P>reg</P><br />
| | <P>reg&lt;=reg-1</P><br />
| | <P ALIGN=CENTER>x</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>x</P><br />
| | <P ALIGN=CENTER>x</P><br />
|- <br />
| | <P>DCX</P><br />
| | <P>rp</P><br />
| | <P>rp&lt;=rp-1</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
|- <br />
| | <P>DAD</P><br />
| | <P>rp</P><br />
| | <P>HL&lt;=HL+rp</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>x</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
|- <br />
| | <P>HLMBC</P><br />
| | <P><BR></P><br />
| | <P>HL&lt;=HL-BC</P><br />
| | <P ALIGN=CENTER>x</P><br />
| | <P ALIGN=CENTER>x</P><br />
| | <P ALIGN=CENTER>h</P><br />
| | <P ALIGN=CENTER>x</P><br />
|- <br />
| | <P>DEHL</P><br />
| | <P>byte</P><br />
| | <P>DE&lt;=HL+byte</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
|- VALIGN=TOP<br />
| | <P>DESP</P><br />
| | <P>byte</P><br />
| | <P>DE&lt;=SP+byte</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
|}<br />
<br />
<H2 >Branch Group</H2><br />
{| BORDER=1 WIDTH=70% style="font-size:70%"<br />
| COLSPAN=2 | <P>Instruction</P><br />
| | <P>Mnemonic Meaning</P><br />
| COLSPAN=4 | <P>Flags</P><br />
|- <br />
| COLSPAN=3 | <P><BR></P><br />
| | <P ALIGN=CENTER>Zf</P><br />
| | <P ALIGN=CENTER>Cf</P><br />
| | <P ALIGN=CENTER>Pf</P><br />
| | <P ALIGN=CENTER>Sf</P><br />
|- <br />
| | <P>JMP</P><br />
| | <P>label</P><br />
| | <P>PC&lt;=label</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
|- <br />
| | <P>JZ</P><br />
| | <P>label</P><br />
| | <P>if Zf=1 then PC&lt;=label</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
|- <br />
| | <P>JNZ</P><br />
| | <P>label</P><br />
| | <P>if Zf=0 then PC&lt;=label</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
|- <br />
| | <P>JP</P><br />
| | <P>label</P><br />
| | <P>if Sf=0 then PC&lt;=label</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
|- <br />
| | <P>JM</P><br />
| | <P>label</P><br />
| | <P>if Sf=1 then PC&lt;=label</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
|- <br />
| | <P>JC</P><br />
| | <P>label</P><br />
| | <P>if Cf=1 then PC&lt;=label</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
|- <br />
| | <P>JNC</P><br />
| | <P>label</P><br />
| | <P>if Cf=0 then PC&lt;=label</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
|- <br />
| | <P>JTM</P><br />
| | <P>label</P><br />
| | <P>if TSf=1 then PC&lt;=label</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
|- <br />
| | <P>JTP</P><br />
| | <P>label</P><br />
| | <P>if TSf=0 then PC&lt;=label</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
|- <br />
| | <P>JPE</P><br />
| | <P>label</P><br />
| | <P>if Pf=1 then PC&lt;=label</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
|- <br />
| | <P>JPO</P><br />
| | <P>label</P><br />
| | <P>if Pf=0 then PC&lt;=label</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
|- <br />
| | <P>CALL</P><br />
| | <P>label</P><br />
| | <P>SP&lt;=SP-2, w[SP]&lt;=PC+3, PC&lt;=label</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
|- <br />
| | <P>CZ</P><br />
| | <P>label</P><br />
| | <P>if Zf=1 then SP&lt;=SP-2, w[SP]&lt;=PC+3,<br />
PC&lt;=label</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
|- <br />
| | <P>CNZ</P><br />
| | <P>label</P><br />
| | <P>if Zf=0 then SP&lt;=SP-2, w[SP]&lt;=PC+3,<br />
PC&lt;=label</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
|- <br />
| | <P>CP</P><br />
| | <P>label</P><br />
| | <P>if Sf=0 then SP&lt;=SP-2, w[SP]&lt;=PC+3,<br />
PC&lt;=label</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
|- <br />
| | <P>CM</P><br />
| | <P>label</P><br />
| | <P>if Sf=1 then SP&lt;=SP-2, w[SP]&lt;=PC+3,<br />
PC&lt;=label</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
|- <br />
| | <P>CC</P><br />
| | <P>label</P><br />
| | <P>if Cf=1 then SP&lt;=SP-2, w[SP]&lt;=PC+3,<br />
PC&lt;=label</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
|- <br />
| | <P>CNC</P><br />
| | <P>label</P><br />
| | <P>if Cf=0 then SP&lt;=SP-2, w[SP]&lt;=PC+3,<br />
PC&lt;=label</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
|- <br />
| | <P>CPE</P><br />
| | <P>label</P><br />
| | <P>if Pf=1 then SP&lt;=SP-2, w[SP]&lt;=PC+3,<br />
PC&lt;=label</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
|- <br />
| | <P>CPO</P><br />
| | <P>label</P><br />
| | <P>if Pf=0 then SP&lt;=SP-2, w[SP]&lt;=PC+3,<br />
PC&lt;=label</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
|- <br />
| | <P>RET</P><br />
| | <P><BR></P><br />
| | <P>PC&lt;=w[SP], SP&lt;=SP+2</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
|- <br />
| | <P>RZ</P><br />
| | <P><BR></P><br />
| | <P>if Zf=1 then PC&lt;=w[SP], SP&lt;=SP+2</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
|- <br />
| | <P>RNZ</P><br />
| | <P><BR></P><br />
| | <P>if Zf=0 then PC&lt;=w[SP], SP&lt;=SP+2</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
|- <br />
| | <P>RP</P><br />
| | <P><BR></P><br />
| | <P>if Sf=0 then PC&lt;=w[SP], SP&lt;=SP+2</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
|- <br />
| | <P>RM</P><br />
| | <P><BR></P><br />
| | <P>if Sf=1 then PC&lt;=w[SP], SP&lt;=SP+2</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
|- <br />
| | <P>RC</P><br />
| | <P><BR></P><br />
| | <P>if Cf=1 then PC&lt;=w[SP], SP&lt;=SP+2</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
|- <br />
| | <P>RNC</P><br />
| | <P><BR></P><br />
| | <P>if Cf=0 then PC&lt;=w[SP], SP&lt;=SP+2</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
|- <br />
| | <P>RPE</P><br />
| | <P><BR></P><br />
| | <P>if Pf=1 then PC&lt;=w[SP], SP&lt;=SP+2</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
|- <br />
| | <P>RPO</P><br />
| | <P><BR></P><br />
| | <P>if Pf=0 then PC&lt;=w[SP], SP&lt;=SP+2</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
|- <br />
| | <P>PCHL</P><br />
| | <P><BR></P><br />
| | <P>PC&lt;=HL</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
|- <br />
| | <P>RST</P><br />
| | <P>n</P><br />
| | <P>SP&lt;=SP-2, w[SP]&lt;=PC+1, PC&lt;=n*8 where n<br />
is 0 to 7</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
|- <br />
| | <P>RSTV</P><br />
| | <P><BR></P><br />
| | <P>if OVf=1 then SP&lt;=SP-2, w[SP]&lt;=PC+1,<br />
PC&lt;=8*8</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
|}<br />
<br />
<H2>Logical Group</H2><br />
{| BORDER=1 WIDTH=70% style="font-size:70%"<br />
| COLSPAN=2 | <P>Instruction</P><br />
| | <P>Mnemonic Meaning</P><br />
| COLSPAN=4 | <P>Flags</P><br />
|- <br />
| COLSPAN=3 | <P><BR></P><br />
| | <P ALIGN=CENTER>Zf</P><br />
| | <P ALIGN=CENTER>Cf</P><br />
| | <P ALIGN=CENTER>Pf</P><br />
| | <P ALIGN=CENTER>Sf</P><br />
|- <br />
| | <P>CMP</P><br />
| | <P>reg</P><br />
| | <P>T&lt;=A-reg</P><br />
| | <P ALIGN=CENTER>x</P><br />
| | <P ALIGN=CENTER>x</P><br />
| | <P ALIGN=CENTER>x</P><br />
| | <P ALIGN=CENTER>x</P><br />
|- <br />
| | <P>CPI</P><br />
| | <P>byte</P><br />
| | <P>T&lt;=A-byte</P><br />
| | <P ALIGN=CENTER>x</P><br />
| | <P ALIGN=CENTER>x</P><br />
| | <P ALIGN=CENTER>x</P><br />
| | <P ALIGN=CENTER>x</P><br />
|- <br />
| | <P>CMA</P><br />
| | <P><BR></P><br />
| | <P>A&lt;=1's complement of A</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
|- <br />
| | <P>CMC</P><br />
| | <P><BR></P><br />
| | <P>Cf&lt;=1's complement of Cf</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>x</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
|- <br />
| | <P>STC</P><br />
| | <P><BR></P><br />
| | <P>Cf&lt;=1</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>1</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
|- <br />
| | <P>SHLR</P><br />
| | <P><BR></P><br />
| | <P>HL&lt;=HL/2 while H6&lt;=H7 (extend sign) and<br />
Cf&lt;=L0</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>x</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
|- <br />
| | <P>ANA</P><br />
| | <P>reg</P><br />
| | <P>A&lt;=A AND reg</P><br />
| | <P ALIGN=CENTER>x</P><br />
| | <P ALIGN=CENTER>0</P><br />
| | <P ALIGN=CENTER>x</P><br />
| | <P ALIGN=CENTER>x</P><br />
|- <br />
| | <P>ANI</P><br />
| | <P>byte</P><br />
| | <P>A&lt;=A AND byte</P><br />
| | <P ALIGN=CENTER>x</P><br />
| | <P ALIGN=CENTER>0</P><br />
| | <P ALIGN=CENTER>x</P><br />
| | <P ALIGN=CENTER>x</P><br />
|- <br />
| | <P>ORA</P><br />
| | <P>reg</P><br />
| | <P>A&lt;=A Inclusive OR reg</P><br />
| | <P ALIGN=CENTER>x</P><br />
| | <P ALIGN=CENTER>0</P><br />
| | <P ALIGN=CENTER>x</P><br />
| | <P ALIGN=CENTER>x</P><br />
|- <br />
| | <P>ORI</P><br />
| | <P>byte</P><br />
| | <P>A&lt;=A Inclusive OR byte</P><br />
| | <P ALIGN=CENTER>x</P><br />
| | <P ALIGN=CENTER>0</P><br />
| | <P ALIGN=CENTER>x</P><br />
| | <P ALIGN=CENTER>x</P><br />
|- <br />
| | <P>XRA</P><br />
| | <P>reg</P><br />
| | <P>A&lt;=A Exclusive OR reg</P><br />
| | <P ALIGN=CENTER>x</P><br />
| | <P ALIGN=CENTER>0</P><br />
| | <P ALIGN=CENTER>x</P><br />
| | <P ALIGN=CENTER>x</P><br />
|- <br />
| | <P>XRI</P><br />
| | <P>byte</P><br />
| | <P>A&lt;=A Exclusive OR byte</P><br />
| | <P ALIGN=CENTER>x</P><br />
| | <P ALIGN=CENTER>0</P><br />
| | <P ALIGN=CENTER>x</P><br />
| | <P ALIGN=CENTER>x</P><br />
|- <br />
| | <P>RAL</P><br />
| | <P><BR></P><br />
| | <P>A&lt;=A*2 where Cf&lt;=A7 while A0&lt;=Cf</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>x</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
|- <br />
| | <P>RAR</P><br />
| | <P><BR></P><br />
| | <P>A&lt;=A/2 where Cf&lt;=A0 while A7&lt;=Cf</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>x</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
|- <br />
| | <P>RLC</P><br />
| | <P><BR></P><br />
| | <P>A7..A1&lt;=A6..A0 while A0&lt;=A7 and Cf&lt;=A7</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>x</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
|- <br />
| | <P>RRC</P><br />
| | <P><BR></P><br />
| | <P>A6..A0&lt;=A7..A1 while A7&lt;=A0 and Cf&lt;=A0</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>x</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
|- <br />
| | <P>RDEL</P><br />
| | <P><BR></P><br />
| | <P>DE&lt;=DE*2 where: Cf&lt;=DE15 while DE00&lt;=Cf</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>x</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
|}<br />
<br />
<H2>Stack, Input/Output, &amp; Machine Control Group</H2><br />
{| BORDER=1 WIDTH=70% style="font-size:70%"<br />
| COLSPAN=2 | <P>Instruction</P><br />
| | <P>Mnemonic Meaning</P><br />
| COLSPAN=4 | <P>Flags</P><br />
|- <br />
| COLSPAN=3 | <P><BR></P><br />
| | <P ALIGN=CENTER>Zf</P><br />
| | <P ALIGN=CENTER>Cf</P><br />
| | <P ALIGN=CENTER>Pf</P><br />
| | <P ALIGN=CENTER>Sf</P><br />
|- <br />
| | <P>PUSH</P><br />
| | <P>rp</P><br />
| | <P>SP&lt;=SP-2, w[SP]&lt;=rp</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
|- <br />
| | <P>POP</P><br />
| | <P>rp</P><br />
| | <P>rp&lt;=w[SP], SP&lt;=SP+2</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
|- <br />
| | <P>SPHL</P><br />
| | <P><BR></P><br />
| | <P>SP&lt;=HL</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
|- <br />
| | <P>XTHL</P><br />
| | <P><BR></P><br />
| | <P>HL&lt;=w[SP] while w[SP]&lt;=HL</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
|- <br />
| | <P>IN</P><br />
| | <P>port</P><br />
| | <P>A&lt;=data from port</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
|- <br />
| | <P>OUT</P><br />
| | <P>port</P><br />
| | <P>data to port&lt;=A</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
|- <br />
| | <P>DI</P><br />
| | <P><BR></P><br />
| | <P>disable interrupts</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
|- <br />
| | <P>EI</P><br />
| | <P><BR></P><br />
| | <P>enable interrupts</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
|- <br />
| | <P>RIM</P><br />
| | <P><BR></P><br />
| | <P>A&lt;=interrupt mask</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
|- <br />
| | <P>SIM</P><br />
| | <P><BR></P><br />
| | <P>interrupt mask&lt;=A</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
|- <br />
| | <P>NOP</P><br />
| | <P><BR></P><br />
| | <P>do nothing</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
|- <br />
| | <P>HLT</P><br />
| | <P><BR></P><br />
| | <P>halt 8085 processor</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
|}<br />
<br />
<H1 STYLE="page-break-before: always">8085 Instructions by Mnemonic</H1><br />
{| BORDER=1 WIDTH=70% style="font-size:70%"<br />
| COLSPAN=2 | <P>Instruction</P><br />
| | <P>Mnemonic Meaning</P><br />
| COLSPAN=4 | <P>Flags</P><br />
|- <br />
| COLSPAN=3 | <P><BR></P><br />
| | <P ALIGN=CENTER>Zf</P><br />
| | <P ALIGN=CENTER>Cf</P><br />
| | <P ALIGN=CENTER>Pf</P><br />
| | <P ALIGN=CENTER>Sf</P><br />
|- <br />
| | <P>ACI</P><br />
| | <P>byte</P><br />
| | <P>Add with Carry Immediate</P><br />
| | <P ALIGN=CENTER>x</P><br />
| | <P ALIGN=CENTER>x</P><br />
| | <P ALIGN=CENTER>x</P><br />
| | <P ALIGN=CENTER>x</P><br />
|- <br />
| | <P>ADC</P><br />
| | <P>reg</P><br />
| | <P>ADd with Carry</P><br />
| | <P ALIGN=CENTER>x</P><br />
| | <P ALIGN=CENTER>x</P><br />
| | <P ALIGN=CENTER>x</P><br />
| | <P ALIGN=CENTER>x</P><br />
|- <br />
| | <P>ADD</P><br />
| | <P>reg</P><br />
| | <P>ADD</P><br />
| | <P ALIGN=CENTER>x</P><br />
| | <P ALIGN=CENTER>x</P><br />
| | <P ALIGN=CENTER>x</P><br />
| | <P ALIGN=CENTER>x</P><br />
|- <br />
| | <P>ADI</P><br />
| | <P>byte</P><br />
| | <P>ADd Immediate</P><br />
| | <P ALIGN=CENTER>x</P><br />
| | <P ALIGN=CENTER>x</P><br />
| | <P ALIGN=CENTER>x</P><br />
| | <P ALIGN=CENTER>x</P><br />
|- <br />
| | <P>ANA</P><br />
| | <P>reg</P><br />
| | <P>ANd Accumulator</P><br />
| | <P ALIGN=CENTER>x</P><br />
| | <P ALIGN=CENTER>0</P><br />
| | <P ALIGN=CENTER>x</P><br />
| | <P ALIGN=CENTER>x</P><br />
|- <br />
| | <P>ANI</P><br />
| | <P>byte</P><br />
| | <P>ANd Immediate</P><br />
| | <P ALIGN=CENTER>x</P><br />
| | <P ALIGN=CENTER>0</P><br />
| | <P ALIGN=CENTER>x</P><br />
| | <P ALIGN=CENTER>x</P><br />
|- <br />
| | <P>CALL</P><br />
| | <P>label</P><br />
| | <P>CALL unconditional</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
|- <br />
| | <P>CC</P><br />
| | <P>label</P><br />
| | <P>Call if Carry</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
|- <br />
| | <P>CM</P><br />
| | <P>label</P><br />
| | <P>Call if Minus</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
|- <br />
| | <P>CMA</P><br />
| | <P><BR></P><br />
| | <P>CoMplement Accumulator</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
|- <br />
| | <P>CMC</P><br />
| | <P><BR></P><br />
| | <P>CoMplement Carry</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>x</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
|- <br />
| | <P>CMP</P><br />
| | <P>reg</P><br />
| | <P>CoMPare</P><br />
| | <P ALIGN=CENTER>x</P><br />
| | <P ALIGN=CENTER>x</P><br />
| | <P ALIGN=CENTER>x</P><br />
| | <P ALIGN=CENTER>x</P><br />
|- <br />
| | <P>CNC</P><br />
| | <P>label</P><br />
| | <P>Call if No Carry</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
|- <br />
| | <P>CNZ</P><br />
| | <P>label</P><br />
| | <P>Call if No Zero</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
|- <br />
| | <P>CP</P><br />
| | <P>label</P><br />
| | <P>Call if Positive</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
|- <br />
| | <P>CPE</P><br />
| | <P>label</P><br />
| | <P>Call if Parity Even</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
|- <br />
| | <P>CPI</P><br />
| | <P>byte</P><br />
| | <P>ComPare Immediate</P><br />
| | <P ALIGN=CENTER>x</P><br />
| | <P ALIGN=CENTER>x</P><br />
| | <P ALIGN=CENTER>x</P><br />
| | <P ALIGN=CENTER>x</P><br />
|- <br />
| | <P>CPO</P><br />
| | <P>label</P><br />
| | <P>Call if Parity Odd</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
|- <br />
| | <P>CZ</P><br />
| | <P>label</P><br />
| | <P>Call if Zero</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
|- <br />
| | <P>DAA</P><br />
| | <P><BR></P><br />
| | <P>Decimal Adjust Accumulator</P><br />
| | <P ALIGN=CENTER>x</P><br />
| | <P ALIGN=CENTER>x</P><br />
| | <P ALIGN=CENTER>x</P><br />
| | <P ALIGN=CENTER>x</P><br />
|- <br />
| | <P>DAD</P><br />
| | <P>rp</P><br />
| | <P>Dual-register ADd to hl</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>x</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
|- <br />
| | <P>DCR</P><br />
| | <P>reg</P><br />
| | <P>DeCrement Register</P><br />
| | <P ALIGN=CENTER>x</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>x</P><br />
| | <P ALIGN=CENTER>x</P><br />
|- <br />
| | <P>DCX</P><br />
| | <P>rp</P><br />
| | <P>DeCrement eXtended-register</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
|- <br />
| | <P>DEHL</P><br />
| | <P>byte</P><br />
| | <P>DE from HL plus byte</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
|- <br />
| | <P>DESP</P><br />
| | <P>byte</P><br />
| | <P>DE from SP plus byte</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
|- <br />
| | <P>DI</P><br />
| | <P><BR></P><br />
| | <P>Disable Interrupts</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
|- <br />
| | <P>EI</P><br />
| | <P><BR></P><br />
| | <P>Enable Interrupts</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
|- <br />
| | <P>HLMBC</P><br />
| | <P><BR></P><br />
| | <P>HL Minus BC</P><br />
| | <P ALIGN=CENTER>x</P><br />
| | <P ALIGN=CENTER>x</P><br />
| | <P ALIGN=CENTER>h</P><br />
| | <P ALIGN=CENTER>x</P><br />
|- <br />
| | <P>HLT</P><br />
| | <P><BR></P><br />
| | <P>HaLT</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
|- <br />
| | <P>IN</P><br />
| | <P>port</P><br />
| | <P>INput from port</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
|- <br />
| | <P>INR</P><br />
| | <P>reg</P><br />
| | <P>INcrement Register</P><br />
| | <P ALIGN=CENTER>x</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>x</P><br />
| | <P ALIGN=CENTER>x</P><br />
|- <br />
| | <P>INX</P><br />
| | <P>rp</P><br />
| | <P>INcrement eXtended-register</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
|- <br />
| | <P>JC</P><br />
| | <P>label</P><br />
| | <P>Jump if Carry</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
|- <br />
| | <P>JM</P><br />
| | <P>label</P><br />
| | <P>Jump if Minus</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
|- <br />
| | <P>JMP</P><br />
| | <P>label</P><br />
| | <P>JuMP unconditional</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
|- <br />
| | <P>JNC</P><br />
| | <P>label</P><br />
| | <P>Jump if No Carry</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
|- <br />
| | <P>JNZ</P><br />
| | <P>label</P><br />
| | <P>Jump if No Zero</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
|- <br />
| | <P>JP</P><br />
| | <P>label</P><br />
| | <P>Jump if Positive</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
|- <br />
| | <P>JPE</P><br />
| | <P>label</P><br />
| | <P>Jump if Parity Even</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
|- <br />
| | <P>JPO</P><br />
| | <P>label</P><br />
| | <P>Jump if Parity Odd</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
|- <br />
| | <P>JTM</P><br />
| | <P>label</P><br />
| | <P>Jump if True sign Minus</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
|- <br />
| | <P>JTP</P><br />
| | <P>label</P><br />
| | <P>Jump if True sign Positive</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
|- <br />
| | <P>JZ</P><br />
| | <P>label</P><br />
| | <P>Jump if Zero</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
|- <br />
| | <P>LDA</P><br />
| | <P>addr</P><br />
| | <P>LoaD Accumulator direct</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
|- <br />
| | <P>LDAX</P><br />
| | <P>B</P><br />
| | <P>LoaD Accumulator indirect via eXtended-register<br />
Bc</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
|- <br />
| | <P>LDAX</P><br />
| | <P>D</P><br />
| | <P>LoaD Accumulator indirect via eXtended-register<br />
De</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
|- <br />
| | <P>LHLD</P><br />
| | <P>addr</P><br />
| | <P>Load HL Direct</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
|- <br />
| | <P>LHLI</P><br />
| | <P><BR></P><br />
| | <P>Load HL Indirect via extended register de</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
|- <br />
| | <P>LXI</P><br />
| | <P>rp, word</P><br />
| | <P>Load eXtended-register Immediate</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
|- <br />
| | <P>MOV</P><br />
| | <P>dreg, sreg</P><br />
| | <P>MOVe</P><br />
| | <P ALIGN=CENTER><BR></P><br />
| | <P ALIGN=CENTER><BR></P><br />
| | <P ALIGN=CENTER><BR></P><br />
| | <P ALIGN=CENTER><BR></P><br />
|- <br />
| | <P>MVI</P><br />
| | <P>reg, byte</P><br />
| | <P>MoVe Immediate</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
|- <br />
| | <P>MVX</P><br />
| | <P>drp, srp</P><br />
| | <P>MoVe eXtended-register (pseudo for high &amp;<br />
low MOVs)</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
|- <br />
| | <P>NOP</P><br />
| | <P><BR></P><br />
| | <P>No OPeration</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
|- <br />
| | <P>ORA</P><br />
| | <P>reg</P><br />
| | <P>OR Accumulator</P><br />
| | <P ALIGN=CENTER>x</P><br />
| | <P ALIGN=CENTER>0</P><br />
| | <P ALIGN=CENTER>x</P><br />
| | <P ALIGN=CENTER>x</P><br />
|- <br />
| | <P>ORI</P><br />
| | <P>byte</P><br />
| | <P>OR Immediate</P><br />
| | <P ALIGN=CENTER>x</P><br />
| | <P ALIGN=CENTER>0</P><br />
| | <P ALIGN=CENTER>x</P><br />
| | <P ALIGN=CENTER>x</P><br />
|- <br />
| | <P>OUT</P><br />
| | <P>port</P><br />
| | <P>OUTput to port</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
|- <br />
| | <P>PCHL</P><br />
| | <P><BR></P><br />
| | <P>Program Counter from HL</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
|- <br />
| | <P>POP</P><br />
| | <P>rp</P><br />
| | <P>POP off stack</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
|- <br />
| | <P>PUSH</P><br />
| | <P>rp</P><br />
| | <P>PUSH on stack</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
|- <br />
| | <P>RAL</P><br />
| | <P><BR></P><br />
| | <P>Rotate Accumulator Left through carry</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>x</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
|- <br />
| | <P>RAR</P><br />
| | <P><BR></P><br />
| | <P>Rotate Accumulator Right through carry</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>x</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
|- <br />
| | <P>RC</P><br />
| | <P><BR></P><br />
| | <P>Return if Carry</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
|- <br />
| | <P>RDEL</P><br />
| | <P><BR></P><br />
| | <P>Rotate DE Left through carry</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>x</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
|- <br />
| | <P>RET</P><br />
| | <P><BR></P><br />
| | <P>RETurn unconditional</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
|- <br />
| | <P>RIM</P><br />
| | <P><BR></P><br />
| | <P>Read Interrupt Mask</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
|- <br />
| | <P>RLC</P><br />
| | <P><BR></P><br />
| | <P>Rotate accumulator Left Circular</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>x</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
|- <br />
| | <P>RM</P><br />
| | <P><BR></P><br />
| | <P>Return if Minus</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
|- <br />
| | <P>RNC</P><br />
| | <P><BR></P><br />
| | <P>Return if No Carry</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
|- <br />
| | <P>RNZ</P><br />
| | <P><BR></P><br />
| | <P>Return if No Zero</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
|- <br />
| | <P>RP</P><br />
| | <P><BR></P><br />
| | <P>Return if Positive</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
|- <br />
| | <P>RPE</P><br />
| | <P><BR></P><br />
| | <P>Return if Parity Even</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
|- <br />
| | <P>RPO</P><br />
| | <P><BR></P><br />
| | <P>Return if Parity Odd</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
|- <br />
| | <P>RRC</P><br />
| | <P><BR></P><br />
| | <P>Rotate accumulator Right Circular</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>x</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
|- <br />
| | <P>RST</P><br />
| | <P>n</P><br />
| | <P>ReSTart</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
|- <br />
| | <P>RSTV</P><br />
| | <P><BR></P><br />
| | <P>ReSTart if oVerflow</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
|- <br />
| | <P>RZ</P><br />
| | <P><BR></P><br />
| | <P>Return if Zero</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
|- <br />
| | <P>SBB</P><br />
| | <P>reg</P><br />
| | <P>SuBtract with Borrow</P><br />
| | <P ALIGN=CENTER>x</P><br />
| | <P ALIGN=CENTER>x</P><br />
| | <P ALIGN=CENTER>x</P><br />
| | <P ALIGN=CENTER>x</P><br />
|- <br />
| | <P>SBI</P><br />
| | <P>byte</P><br />
| | <P>Subtract with Borrow Immediate</P><br />
| | <P ALIGN=CENTER>x</P><br />
| | <P ALIGN=CENTER>x</P><br />
| | <P ALIGN=CENTER>x</P><br />
| | <P ALIGN=CENTER>x</P><br />
|- <br />
| | <P>SHLD</P><br />
| | <P>addr</P><br />
| | <P>Store HL Direct</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
|- <br />
| | <P>SHLI</P><br />
| | <P><BR></P><br />
| | <P>Store HL Indirect via extended register de</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
|- <br />
| | <P>SHLR</P><br />
| | <P><BR></P><br />
| | <P>Shift HL Right</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>x</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
|- <br />
| | <P>SIM</P><br />
| | <P><BR></P><br />
| | <P>Set Interrupt Mask</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
|- <br />
| | <P>SPHL</P><br />
| | <P><BR></P><br />
| | <P>Stack Pointer from HL</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
|- <br />
| | <P>STA</P><br />
| | <P>addr</P><br />
| | <P>STore Accumulator direct</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
|- <br />
| | <P>STAX</P><br />
| | <P>B</P><br />
| | <P>Store Accumulator indirect via<br />
eXtended-register Bc</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
|- <br />
| | <P>STAX</P><br />
| | <P>D</P><br />
| | <P>Store Accumulator indirect via<br />
eXtended-register De</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
|- <br />
| | <P>STC</P><br />
| | <P><BR></P><br />
| | <P>SeT Carry</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>1</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
|- <br />
| | <P>SUB</P><br />
| | <P>reg</P><br />
| | <P>SUBtract</P><br />
| | <P ALIGN=CENTER>x</P><br />
| | <P ALIGN=CENTER>x</P><br />
| | <P ALIGN=CENTER>x</P><br />
| | <P ALIGN=CENTER>x</P><br />
|- <br />
| | <P>SUI</P><br />
| | <P>byte</P><br />
| | <P>SUbtract Immediate</P><br />
| | <P ALIGN=CENTER>x</P><br />
| | <P ALIGN=CENTER>x</P><br />
| | <P ALIGN=CENTER>x</P><br />
| | <P ALIGN=CENTER>x</P><br />
|- <br />
| | <P>XCHG</P><br />
| | <P><BR></P><br />
| | <P>eXCHanGe hl with de</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
|- <br />
| | <P>XRA</P><br />
| | <P>reg</P><br />
| | <P>eXclusive oR Accumulator</P><br />
| | <P ALIGN=CENTER>x</P><br />
| | <P ALIGN=CENTER>0</P><br />
| | <P ALIGN=CENTER>x</P><br />
| | <P ALIGN=CENTER>x</P><br />
|- <br />
| | <P>XRI</P><br />
| | <P>byte</P><br />
| | <P>eXclusive oR Immediate</P><br />
| | <P ALIGN=CENTER>x</P><br />
| | <P ALIGN=CENTER>0</P><br />
| | <P ALIGN=CENTER>x</P><br />
| | <P ALIGN=CENTER>x</P><br />
|- <br />
| | <P>XTHL</P><br />
| | <P><BR></P><br />
| | <P>eXchange Top of stack with HL</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
| | <P ALIGN=CENTER>.</P><br />
|}<br />
<br />
<H1 STYLE="page-break-before: always">8085 Machine<br />
Cycles by Functional Group</H1><br />
<br />
<H2 >Data Transfer Group</H2><br />
{| BORDER=1 WIDTH=70% style="font-size:70%"<br />
| COLSPAN=2 | <P><BR></P><br />
| | <P>Essential Cycles +register M involved or<br />
condition Met</P><br />
| | <P ALIGN=RIGHT>EC +MM</P><br />
|- <br />
| COLSPAN=2 | <P>Instruction</P><br />
| | <P>Mnemonic Meaning</P><br />
| | <P ALIGN=RIGHT>Cycles</P><br />
|- <br />
| | <P>MOV</P><br />
| | <P>dreg, sreg</P><br />
| | <P>MOVe</P><br />
| | <P ALIGN=RIGHT>04 +03</P><br />
|- <br />
| | <P>MVI</P><br />
| | <P>reg, byte</P><br />
| | <P>MoVe Immediate</P><br />
| | <P ALIGN=RIGHT>07 +03</P><br />
|- <br />
| | <P>MVX</P><br />
| | <P>drp, srp</P><br />
| | <P>MoVe eXtended-register (pseudo for high &amp;<br />
low MOVs)</P><br />
| | <P ALIGN=RIGHT>--</P><br />
|- <br />
| | <P>LXI</P><br />
| | <P>rp, word</P><br />
| | <P>Load eXtended-register Immediate</P><br />
| | <P ALIGN=RIGHT>10</P><br />
|- <br />
| | <P>XCHG</P><br />
| | <P><BR></P><br />
| | <P>eXCHanGe hl with de</P><br />
| | <P ALIGN=RIGHT>04</P><br />
|- <br />
| | <P>LDA</P><br />
| | <P>addr</P><br />
| | <P>LoaD Accumulator direct</P><br />
| | <P ALIGN=RIGHT>13</P><br />
|- <br />
| | <P>STA</P><br />
| | <P>addr</P><br />
| | <P>STore Accumulator direct</P><br />
| | <P ALIGN=RIGHT>13</P><br />
|- <br />
| | <P>LDAX</P><br />
| | <P>B</P><br />
| | <P>LoaD Accumulator indirect via eXtended-register<br />
Bc</P><br />
| | <P ALIGN=RIGHT>07</P><br />
|- <br />
| | <P>STAX</P><br />
| | <P>B</P><br />
| | <P>Store Accumulator indirect via<br />
eXtended-register Bc</P><br />
| | <P ALIGN=RIGHT>07</P><br />
|- <br />
| | <P>LDAX</P><br />
| | <P>D</P><br />
| | <P>LoaD Accumulator indirect via eXtended-register<br />
De</P><br />
| | <P ALIGN=RIGHT>07</P><br />
|- <br />
| | <P>STAX</P><br />
| | <P>D</P><br />
| | <P>Store Accumulator indirect via<br />
eXtended-register De</P><br />
| | <P ALIGN=RIGHT>07</P><br />
|- <br />
| | <P>LHLD</P><br />
| | <P>addr</P><br />
| | <P>Load HL Direct</P><br />
| | <P ALIGN=RIGHT>16</P><br />
|- <br />
| | <P>SHLD</P><br />
| | <P>addr</P><br />
| | <P>Store HL Direct</P><br />
| | <P ALIGN=RIGHT>16</P><br />
|- <br />
| | <P>LHLI</P><br />
| | <P><BR></P><br />
| | <P>Load HL Indirect via extended register de</P><br />
| | <P ALIGN=RIGHT>10</P><br />
|- VALIGN=TOP<br />
| | <P>SHLI</P><br />
| | <P><BR></P><br />
| | <P>Store HL Indirect via extended register de</P><br />
| | <P ALIGN=RIGHT>10</P><br />
|}<br />
<br />
<H2 >Arithmetic Group</H2><br />
{| BORDER=1 WIDTH=70% style="font-size:70%" <br />
| COLSPAN=2 | <P><BR></P><br />
| | <P>Essential Cycles +register M involved or<br />
condition Met</P><br />
| | <P ALIGN=RIGHT>EC +MM</P><br />
|- <br />
| COLSPAN=2 | <P>Instruction</P><br />
| | <P>Mnemonic Meaning</P><br />
| | <P ALIGN=RIGHT>Cycles</P><br />
|- <br />
| | <P>ADD</P><br />
| | <P>reg</P><br />
| | <P>ADD</P><br />
| | <P ALIGN=RIGHT>04 +03</P><br />
|- <br />
| | <P>ADI</P><br />
| | <P>byte</P><br />
| | <P>ADd Immediate</P><br />
| | <P ALIGN=RIGHT>07</P><br />
|- <br />
| | <P>ADC</P><br />
| | <P>reg</P><br />
| | <P>ADd with Carry</P><br />
| | <P ALIGN=RIGHT>04 +03</P><br />
|- <br />
| | <P>ACI</P><br />
| | <P>byte</P><br />
| | <P>Add with Carry Immediate</P><br />
| | <P ALIGN=RIGHT>07</P><br />
|- <br />
| | <P>SUB</P><br />
| | <P>reg</P><br />
| | <P>SUBtract</P><br />
| | <P ALIGN=RIGHT>04 +03</P><br />
|- <br />
| | <P>SUI</P><br />
| | <P>byte</P><br />
| | <P>SUbtract Immediate</P><br />
| | <P ALIGN=RIGHT>07</P><br />
|- <br />
| | <P>SBB</P><br />
| | <P>reg</P><br />
| | <P>SuBtract with Borrow</P><br />
| | <P ALIGN=RIGHT>04 +03</P><br />
|- <br />
| | <P>SBI</P><br />
| | <P>byte</P><br />
| | <P>Subtract with Borrow Immediate</P><br />
| | <P ALIGN=RIGHT>07</P><br />
|- <br />
| | <P>DAA</P><br />
| | <P><BR></P><br />
| | <P>Decimal Adjust Accumulator</P><br />
| | <P ALIGN=RIGHT>04</P><br />
|- <br />
| | <P>INR</P><br />
| | <P>reg</P><br />
| | <P>INcrement Register</P><br />
| | <P ALIGN=RIGHT>04 +06</P><br />
|- <br />
| | <P>INX</P><br />
| | <P>rp</P><br />
| | <P>INcrement eXtended-register</P><br />
| | <P ALIGN=RIGHT>06</P><br />
|- <br />
| | <P>DCR</P><br />
| | <P>reg</P><br />
| | <P>DeCrement Register</P><br />
| | <P ALIGN=RIGHT>04 +06</P><br />
|- <br />
| | <P>DCX</P><br />
| | <P>rp</P><br />
| | <P>DeCrement eXtended-register</P><br />
| | <P ALIGN=RIGHT>06</P><br />
|- <br />
| | <P>DAD</P><br />
| | <P>rp</P><br />
| | <P>Dual-register ADd to hl</P><br />
| | <P ALIGN=RIGHT>10</P><br />
|- <br />
| | <P>HLMBC</P><br />
| | <P><BR></P><br />
| | <P>HL Minus BC</P><br />
| | <P ALIGN=RIGHT>10</P><br />
|- <br />
| | <P>DEHL</P><br />
| | <P>byte</P><br />
| | <P>DE from HL plus byte</P><br />
| | <P ALIGN=RIGHT>10</P><br />
|- VALIGN=TOP<br />
| | <P>DESP</P><br />
| | <P>byte</P><br />
| | <P>DE from SP plus byte</P><br />
| | <P ALIGN=RIGHT>10</P><br />
|}<br />
<br />
<H2 >Logical Group</H2><br />
{| BORDER=1 WIDTH=70% style="font-size:70%"<br />
| COLSPAN=2 | <P><BR></P><br />
| | <P>Essential Cycles +register M involved or<br />
condition Met</P><br />
| | <P ALIGN=RIGHT>EC +MM</P><br />
|- <br />
| COLSPAN=2 | <P>Instruction</P><br />
| | <P>Mnemonic Meaning</P><br />
| | <P ALIGN=RIGHT>Cycles</P><br />
|- <br />
| | <P>CMP</P><br />
| | <P>reg</P><br />
| | <P>CoMPare</P><br />
| | <P ALIGN=RIGHT>04 +03</P><br />
|- <br />
| | <P>CPI</P><br />
| | <P>byte</P><br />
| | <P>ComPare Immediate</P><br />
| | <P ALIGN=RIGHT>07</P><br />
|- <br />
| | <P>CMA</P><br />
| | <P><BR></P><br />
| | <P>CoMplement Accumulator</P><br />
| | <P ALIGN=RIGHT>04</P><br />
|- <br />
| | <P>CMC</P><br />
| | <P><BR></P><br />
| | <P>CoMplement Carry</P><br />
| | <P ALIGN=RIGHT>04</P><br />
|- <br />
| | <P>STC</P><br />
| | <P><BR></P><br />
| | <P>SeT Carry</P><br />
| | <P ALIGN=RIGHT>04</P><br />
|- <br />
| | <P>SHLR</P><br />
| | <P><BR></P><br />
| | <P>Shift HL Right</P><br />
| | <P ALIGN=RIGHT>07</P><br />
|- <br />
| | <P>ANA</P><br />
| | <P>reg</P><br />
| | <P>ANd Accumulator</P><br />
| | <P ALIGN=RIGHT>04 +03</P><br />
|- <br />
| | <P>ANI</P><br />
| | <P>byte</P><br />
| | <P>ANd Immediate</P><br />
| | <P ALIGN=RIGHT>07</P><br />
|- <br />
| | <P>ORA</P><br />
| | <P>reg</P><br />
| | <P>OR Accumulator</P><br />
| | <P ALIGN=RIGHT>04 +03</P><br />
|- <br />
| | <P>ORI</P><br />
| | <P>byte</P><br />
| | <P>OR Immediate</P><br />
| | <P ALIGN=RIGHT>07</P><br />
|- <br />
| | <P>XRA</P><br />
| | <P>reg</P><br />
| | <P>eXclusive oR Accumulator</P><br />
| | <P ALIGN=RIGHT>04 +03</P><br />
|- <br />
| | <P>XRI</P><br />
| | <P>byte</P><br />
| | <P>eXclusive oR Immediate</P><br />
| | <P ALIGN=RIGHT>07</P><br />
|- <br />
| | <P>RAL</P><br />
| | <P><BR></P><br />
| | <P>Rotate Accumulator Left through carry</P><br />
| | <P ALIGN=RIGHT>04</P><br />
|- <br />
| | <P>RAR</P><br />
| | <P><BR></P><br />
| | <P>Rotate Accumulator Right through carry</P><br />
| | <P ALIGN=RIGHT>04</P><br />
|- <br />
| | <P>RLC</P><br />
| | <P><BR></P><br />
| | <P>Rotate accumulator Left Circular</P><br />
| | <P ALIGN=RIGHT>04</P><br />
|- <br />
| | <P>RRC</P><br />
| | <P><BR></P><br />
| | <P>Rotate accumulator Right Circular</P><br />
| | <P ALIGN=RIGHT>04</P><br />
|- VALIGN=TOP<br />
| | <P>RDEL</P><br />
| | <P><BR></P><br />
| | <P>Rotate DE Left through carry</P><br />
| | <P ALIGN=RIGHT>10</P><br />
|}<br />
<br />
<H2 >Stack, Input/Output, &amp; Machine Control Group</H2><br />
{| BORDER=1 WIDTH=70% style="font-size:70%"<br />
| COLSPAN=2 | <P><BR></P><br />
| | <P>Essential Cycles +register M involved or<br />
condition Met</P><br />
| | <P ALIGN=RIGHT>EC +MM</P><br />
|- <br />
| COLSPAN=2 | <P>Instruction</P><br />
| | <P>Mnemonic Meaning</P><br />
| | <P ALIGN=RIGHT>Cycles</P><br />
|- <br />
| | <P>PUSH</P><br />
| | <P>rp</P><br />
| | <P>PUSH on stack</P><br />
| | <P ALIGN=RIGHT>12</P><br />
|- <br />
| | <P>POP</P><br />
| | <P>rp</P><br />
| | <P>POP off stack</P><br />
| | <P ALIGN=RIGHT>10</P><br />
|- <br />
| | <P>SPHL</P><br />
| | <P><BR></P><br />
| | <P>Stack Pointer from HL</P><br />
| | <P ALIGN=RIGHT>06</P><br />
|- <br />
| | <P>XTHL</P><br />
| | <P><BR></P><br />
| | <P>eXchange Top of stack with HL</P><br />
| | <P ALIGN=RIGHT>16</P><br />
|- <br />
| | <P>IN</P><br />
| | <P>port</P><br />
| | <P>INput from port</P><br />
| | <P ALIGN=RIGHT>10</P><br />
|- <br />
| | <P>OUT</P><br />
| | <P>port</P><br />
| | <P>OUTput to port</P><br />
| | <P ALIGN=RIGHT>10</P><br />
|- <br />
| | <P>DI</P><br />
| | <P><BR></P><br />
| | <P>Disable Interrupts</P><br />
| | <P ALIGN=RIGHT>04</P><br />
|- <br />
| | <P>EI</P><br />
| | <P><BR></P><br />
| | <P>Enable Interrupts</P><br />
| | <P ALIGN=RIGHT>04</P><br />
|- <br />
| | <P>RIM</P><br />
| | <P><BR></P><br />
| | <P>Read Interrupt Mask</P><br />
| | <P ALIGN=RIGHT>04</P><br />
|- <br />
| | <P>SIM</P><br />
| | <P><BR></P><br />
| | <P>Set Interrupt Mask</P><br />
| | <P ALIGN=RIGHT>04</P><br />
|- <br />
| | <P>NOP</P><br />
| | <P><BR></P><br />
| | <P>No OPeration</P><br />
| | <P ALIGN=RIGHT>04</P><br />
|- <br />
| | <P>HLT</P><br />
| | <P><BR></P><br />
| | <P>HaLT</P><br />
| | <P ALIGN=RIGHT>05</P><br />
|}<br />
<br />
<H2 >Branch Group</H2><br />
{| BORDER=1 WIDTH=70% style="font-size:70%"<br />
| COLSPAN=2 | <P><BR></P><br />
| | <P>Essential Cycles +register M involved or<br />
condition Met</P><br />
| | <P ALIGN=RIGHT>EC +MM</P><br />
|- <br />
| COLSPAN=2 | <P>Instruction</P><br />
| | <P>Mnemonic Meaning</P><br />
| | <P ALIGN=RIGHT>Cycles</P><br />
|- <br />
| | <P>JMP</P><br />
| | <P>label</P><br />
| | <P>JuMP unconditional</P><br />
| | <P ALIGN=RIGHT>10</P><br />
|- <br />
| | <P>JZ</P><br />
| | <P>label</P><br />
| | <P>Jump if Zero</P><br />
| | <P ALIGN=RIGHT>07 +03</P><br />
|- <br />
| | <P>JNZ</P><br />
| | <P>label</P><br />
| | <P>Jump if No Zero</P><br />
| | <P ALIGN=RIGHT>07 +03</P><br />
|- <br />
| | <P>JP</P><br />
| | <P>label</P><br />
| | <P>Jump if Positive</P><br />
| | <P ALIGN=RIGHT>07 +03</P><br />
|- <br />
| | <P>JM</P><br />
| | <P>label</P><br />
| | <P>Jump if Minus</P><br />
| | <P ALIGN=RIGHT>07 +03</P><br />
|- <br />
| | <P>JC</P><br />
| | <P>label</P><br />
| | <P>Jump if Carry</P><br />
| | <P ALIGN=RIGHT>07 +03</P><br />
|- <br />
| | <P>JNC</P><br />
| | <P>label</P><br />
| | <P>Jump if No Carry</P><br />
| | <P ALIGN=RIGHT>07 +03</P><br />
|- <br />
| | <P>JTM</P><br />
| | <P>label</P><br />
| | <P>Jump if True sign Minus</P><br />
| | <P ALIGN=RIGHT>07 +03</P><br />
|- <br />
| | <P>JTP</P><br />
| | <P>label</P><br />
| | <P>Jump if True sign Positive</P><br />
| | <P ALIGN=RIGHT>07 +03</P><br />
|- <br />
| | <P>JPE</P><br />
| | <P>label</P><br />
| | <P>Jump if Parity Even</P><br />
| | <P ALIGN=RIGHT>07 +03</P><br />
|- <br />
| | <P>JPO</P><br />
| | <P>label</P><br />
| | <P>Jump if Parity Odd</P><br />
| | <P ALIGN=RIGHT>07 +03</P><br />
|- <br />
| | <P>CALL</P><br />
| | <P>label</P><br />
| | <P>CALL unconditional</P><br />
| | <P ALIGN=RIGHT>18</P><br />
|- <br />
| | <P>CZ</P><br />
| | <P>label</P><br />
| | <P>Call if Zero</P><br />
| | <P ALIGN=RIGHT>09 +09</P><br />
|- <br />
| | <P>CNZ</P><br />
| | <P>label</P><br />
| | <P>Call if No Zero</P><br />
| | <P ALIGN=RIGHT>09 +09</P><br />
|- <br />
| | <P>CP</P><br />
| | <P>label</P><br />
| | <P>Call if Positive</P><br />
| | <P ALIGN=RIGHT>09 +09</P><br />
|- <br />
| | <P>CM</P><br />
| | <P>label</P><br />
| | <P>Call if Minus</P><br />
| | <P ALIGN=RIGHT>09 +09</P><br />
|- <br />
| | <P>CC</P><br />
| | <P>label</P><br />
| | <P>Call if Carry</P><br />
| | <P ALIGN=RIGHT>09 +09</P><br />
|- <br />
| | <P>CNC</P><br />
| | <P>label</P><br />
| | <P>Call if No Carry</P><br />
| | <P ALIGN=RIGHT>09 +09</P><br />
|- <br />
| | <P>CPE</P><br />
| | <P>label</P><br />
| | <P>Call if Parity Even</P><br />
| | <P ALIGN=RIGHT>09 +09</P><br />
|- <br />
| | <P>CPO</P><br />
| | <P>label</P><br />
| | <P>Call if Parity Odd</P><br />
| | <P ALIGN=RIGHT>09 +09</P><br />
|- <br />
| | <P>RET</P><br />
| | <P><BR></P><br />
| | <P>RETurn unconditional</P><br />
| | <P ALIGN=RIGHT>10</P><br />
|- <br />
| | <P>RZ</P><br />
| | <P><BR></P><br />
| | <P>Return if Zero</P><br />
| | <P ALIGN=RIGHT>06 +06</P><br />
|- <br />
| | <P>RNZ</P><br />
| | <P><BR></P><br />
| | <P>Return if No Zero</P><br />
| | <P ALIGN=RIGHT>06 +06</P><br />
|- <br />
| | <P>RP</P><br />
| | <P><BR></P><br />
| | <P>Return if Positive</P><br />
| | <P ALIGN=RIGHT>06 +06</P><br />
|- <br />
| | <P>RM</P><br />
| | <P><BR></P><br />
| | <P>Return if Minus</P><br />
| | <P ALIGN=RIGHT>06 +06</P><br />
|- <br />
| | <P>RC</P><br />
| | <P><BR></P><br />
| | <P>Return if Carry</P><br />
| | <P ALIGN=RIGHT>06 +06</P><br />
|- <br />
| | <P>RNC</P><br />
| | <P><BR></P><br />
| | <P>Return if No Carry</P><br />
| | <P ALIGN=RIGHT>06 +06</P><br />
|- <br />
| | <P>RPE</P><br />
| | <P><BR></P><br />
| | <P>Return if Parity Even</P><br />
| | <P ALIGN=RIGHT>06 +06</P><br />
|- <br />
| | <P>RPO</P><br />
| | <P><BR></P><br />
| | <P>Return if Parity Odd</P><br />
| | <P ALIGN=RIGHT>06 +06</P><br />
|- <br />
| | <P>PCHL</P><br />
| | <P><BR></P><br />
| | <P>Program Counter from HL</P><br />
| | <P ALIGN=RIGHT>06</P><br />
|- <br />
| | <P>RST</P><br />
| | <P>n</P><br />
| | <P>ReSTart</P><br />
| | <P ALIGN=RIGHT>12</P><br />
|- VALIGN=TOP<br />
| | <P>RSTV</P><br />
| | <P><BR></P><br />
| | <P>ReSTart if oVerflow</P><br />
| | <P ALIGN=RIGHT>06 +06</P><br />
|}<br />
<br />
<H1 >8085 Instruction Mnemonics by Op-code</H1><br />
{| BORDER="1" WIDTH=100% style="font-size:70%"<br />
| | <P><BR></P><br />
| | <P ALIGN=CENTER STYLE="margin-left: -0.04in">x0h</P><br />
| | <P ALIGN=CENTER STYLE="margin-left: -0.04in">x1h</P><br />
| | <P ALIGN=CENTER STYLE="margin-left: -0.04in">x2h</P><br />
| | <P ALIGN=CENTER STYLE="margin-left: -0.04in">x3h</P><br />
| | <P ALIGN=CENTER STYLE="margin-left: -0.04in">x4h</P><br />
| | <P ALIGN=CENTER STYLE="margin-left: -0.04in">x5h</P><br />
| | <P ALIGN=CENTER STYLE="margin-left: -0.04in">x6h</P><br />
| | <P ALIGN=CENTER STYLE="margin-left: -0.04in">x7h</P><br />
| | <P ALIGN=CENTER STYLE="margin-left: -0.04in">x8h</P><br />
| | <P ALIGN=CENTER STYLE="margin-left: -0.04in">x9h</P><br />
| | <P ALIGN=CENTER STYLE="margin-left: -0.04in">xAh</P><br />
| | <P ALIGN=CENTER STYLE="margin-left: -0.04in">xBh</P><br />
| | <P ALIGN=CENTER STYLE="margin-left: -0.04in">xCh</P><br />
| | <P ALIGN=CENTER STYLE="margin-left: -0.04in">xDh</P><br />
| | <P ALIGN=CENTER STYLE="margin-left: -0.04in">xEh</P><br />
| | <P ALIGN=CENTER STYLE="margin-left: -0.04in">xFh</P><br />
|- <br />
| | <P>00h-0Fh</P><br />
| | <P>NOP</P><br />
| | <P>LXI B,w</P><br />
| | <P>STAX B</P><br />
| | <P>INX B</P><br />
| | <P>INR B</P><br />
| | <P>DCR B</P><br />
| | <P>MVI B,b</P><br />
| | <P>RLC</P><br />
| | <P>HLMBC</P><br />
| | <P>DAD B</P><br />
| | <P>LDAX B</P><br />
| | <P>DCX B</P><br />
| | <P>INR C</P><br />
| | <P>DCR C</P><br />
| | <P>MVI C,b</P><br />
| | <P>RRC</P><br />
|- <br />
| | <P>10h-1Fh</P><br />
| | <P>SHLR</P><br />
| | <P>LXI D,w</P><br />
| | <P>STAX D</P><br />
| | <P>INX D</P><br />
| | <P>INR D</P><br />
| | <P>DCR D</P><br />
| | <P>MVI D,b</P><br />
| | <P>RAL</P><br />
| | <P>RDEL <br />
</P><br />
| | <P>DAD D</P><br />
| | <P>LDAX D</P><br />
| | <P>DCX D</P><br />
| | <P>INR E</P><br />
| | <P>DCR E</P><br />
| | <P>MVI E,b</P><br />
| | <P>RAR</P><br />
|- <br />
| | <P>20h-2Fh</P><br />
| | <P>RIM</P><br />
| | <P>LXI H,w</P><br />
| | <P>SHLD @</P><br />
| | <P>INX H</P><br />
| | <P>INR H</P><br />
| | <P>DCR H</P><br />
| | <P>MVI H,b</P><br />
| | <P>DAA</P><br />
| | <P>DEHL b</P><br />
| | <P>DAD H</P><br />
| | <P>LHLD @</P><br />
| | <P>DCX H</P><br />
| | <P>INR L</P><br />
| | <P>DCR L</P><br />
| | <P>MVI L,b</P><br />
| | <P>CMA</P><br />
|- <br />
| | <P>30h-3Fh</P><br />
| | <P>SIM</P><br />
| | <P>LXI SP,w</P><br />
| | <P>STA @</P><br />
| | <P>INX SP</P><br />
| | <P>INR M</P><br />
| | <P>DCR M</P><br />
| | <P>MVI M,b</P><br />
| | <P>STC</P><br />
| | <P>DESP b</P><br />
| | <P>DAD SP</P><br />
| | <P>LDA @</P><br />
| | <P>DCX SP</P><br />
| | <P>INR A</P><br />
| | <P>DCR A</P><br />
| | <P>MVI A,b</P><br />
| | <P>CMC</P><br />
|- <br />
| | <P>40h-4Fh</P><br />
| | <P>MOV B,B</P><br />
| | <P>MOV B,C</P><br />
| | <P>MOV B,D</P><br />
| | <P>MOV B,E</P><br />
| | <P>MOV B,H</P><br />
| | <P>MOV B,L</P><br />
| | <P>MOV B,M</P><br />
| | <P>MOV B,A</P><br />
| | <P>MOV C,B</P><br />
| | <P>MOV C,C</P><br />
| | <P>MOV C,D</P><br />
| | <P>MOV C,E</P><br />
| | <P>MOV C,H</P><br />
| | <P>MOV C,L</P><br />
| | <P>MOV C,M</P><br />
| | <P>MOV C,A</P><br />
|- <br />
| | <P>50h-5Fh</P><br />
| | <P>MOV D,B</P><br />
| | <P>MOV D,C</P><br />
| | <P>MOV D,D</P><br />
| | <P>MOV D,E</P><br />
| | <P>MOV D,H</P><br />
| | <P>MOV D,L</P><br />
| | <P>MOV D,M</P><br />
| | <P>MOV D,A</P><br />
| | <P>MOV E,B</P><br />
| | <P>MOV E,C</P><br />
| | <P>MOV E,D</P><br />
| | <P>MOV E,E</P><br />
| | <P>MOV E,H</P><br />
| | <P>MOV E,L</P><br />
| | <P>MOV E,M</P><br />
| | <P>MOV E,A</P><br />
|- <br />
| | <P>60h-6Fh</P><br />
| | <P>MOV H,B</P><br />
| | <P>MOV H,C</P><br />
| | <P>MOV H,D</P><br />
| | <P>MOV H,E</P><br />
| | <P>MOV H,H</P><br />
| | <P>MOV H,L</P><br />
| | <P>MOV H,M</P><br />
| | <P>MOV H,A</P><br />
| | <P>MOV L,B</P><br />
| | <P>MOV L,C</P><br />
| | <P>MOV L,D</P><br />
| | <P>MOV L,E</P><br />
| | <P>MOV L,H</P><br />
| | <P>MOV L,L</P><br />
| | <P>MOV L,M</P><br />
| | <P>MOV L,A</P><br />
|- <br />
| | <P>70h-7Fh</P><br />
| | <P>MOV M,B</P><br />
| | <P>MOV M,C</P><br />
| | <P>MOV M,D</P><br />
| | <P>MOV M,E</P><br />
| | <P>MOV M,H</P><br />
| | <P>MOV M,L</P><br />
| | <P>HLT</P><br />
| | <P>MOV M,A</P><br />
| | <P>MOV A,B</P><br />
| | <P>MOV A,C</P><br />
| | <P>MOV A,D</P><br />
| | <P>MOV A,E</P><br />
| | <P>MOV A,H</P><br />
| | <P>MOV A,L</P><br />
| | <P>MOV A,M</P><br />
| | <P>MOV A,A</P><br />
|- <br />
| | <P>80h-8Fh</P><br />
| | <P>ADD B</P><br />
| | <P>ADD C</P><br />
| | <P>ADD D</P><br />
| | <P>ADD E</P><br />
| | <P>ADD H</P><br />
| | <P>ADD L</P><br />
| | <P>ADD M</P><br />
| | <P>ADD A</P><br />
| | <P>ADC B</P><br />
| | <P>ADC C</P><br />
| | <P>ADC D</P><br />
| | <P>ADC E</P><br />
| | <P>ADC H</P><br />
| | <P>ADC L</P><br />
| | <P>ADC M</P><br />
| | <P>ADC A</P><br />
|- <br />
| | <P>90h-9Fh</P><br />
| | <P>SUB B</P><br />
| | <P>SUB C</P><br />
| | <P>SUB D</P><br />
| | <P>SUB E</P><br />
| | <P>SUB H</P><br />
| | <P>SUB L</P><br />
| | <P>SUB M</P><br />
| | <P>SUB A</P><br />
| | <P>SBB B</P><br />
| | <P>SBB C</P><br />
| | <P>SBB D</P><br />
| | <P>SBB E</P><br />
| | <P>SBB H</P><br />
| | <P>SBB L</P><br />
| | <P>SBB M</P><br />
| | <P>SBB A</P><br />
|- <br />
| | <P>A0h-AFh</P><br />
| | <P>ANA B</P><br />
| | <P>ANA C</P><br />
| | <P>ANA D</P><br />
| | <P>ANA E</P><br />
| | <P>ANA H</P><br />
| | <P>ANA L</P><br />
| | <P>ANA M</P><br />
| | <P>ANA A</P><br />
| | <P>XRA B</P><br />
| | <P>XRA C</P><br />
| | <P>XRA D</P><br />
| | <P>XRA E</P><br />
| | <P>XRA H</P><br />
| | <P>XRA L</P><br />
| | <P>XRA M</P><br />
| | <P>XRA A</P><br />
|- <br />
| | <P>B0h-BFh&nbsp;</P><br />
| | <P>ORA B</P><br />
| | <P>ORA C</P><br />
| | <P>ORA D</P><br />
| | <P>ORA E</P><br />
| | <P>ORA H</P><br />
| | <P>ORA L</P><br />
| | <P>ORA M</P><br />
| | <P>ORA A</P><br />
| | <P>CMP B</P><br />
| | <P>CMP C</P><br />
| | <P>CMP D</P><br />
| | <P>CMP E</P><br />
| | <P>CMP H</P><br />
| | <P>CMP L</P><br />
| | <P>CMP M</P><br />
| | <P>CMP A</P><br />
|- <br />
| | <P>COh-CFh</P><br />
| | <P>RNZ</P><br />
| | <P>POP B</P><br />
| | <P>JNZ @</P><br />
| | <P>JMP @</P><br />
| | <P>CNZ @</P><br />
| | <P>PUSH B</P><br />
| | <P>ADI b</P><br />
| | <P>RST 0</P><br />
| | <P>RZ</P><br />
| | <P>RET</P><br />
| | <P>JZ @</P><br />
| | <P>RSTV</P><br />
| | <P>CZ @</P><br />
| | <P>CALL @</P><br />
| | <P>ACI b</P><br />
| | <P>RST 1</P><br />
|- <br />
| | <P>D0h-DFh</P><br />
| | <P>RNC</P><br />
| | <P>POP D</P><br />
| | <P>JNC @</P><br />
| | <P>OUT port</P><br />
| | <P>CNC @</P><br />
| | <P>PUSH D</P><br />
| | <P>SUI b</P><br />
| | <P>RST 2</P><br />
| | <P>RC</P><br />
| | <P>SHLI</P><br />
| | <P>JC @</P><br />
| | <P>IN port</P><br />
| | <P>CC @</P><br />
| | <P>JTP @</P><br />
| | <P>SBI b</P><br />
| | <P>RST 3</P><br />
|- <br />
| | <P>E0h-EFh</P><br />
| | <P>RPO</P><br />
| | <P>POP H</P><br />
| | <P>JPO @</P><br />
| | <P>XTHL</P><br />
| | <P>CPO @</P><br />
| | <P>PUSH H</P><br />
| | <P>ANI b</P><br />
| | <P>RST 4</P><br />
| | <P>RPE</P><br />
| | <P>PCHL</P><br />
| | <P>JPE @</P><br />
| | <P>XCHG</P><br />
| | <P>CPE @</P><br />
| | <P>LHLI</P><br />
| | <P>XRI b</P><br />
| | <P>RST 5</P><br />
|- <br />
| | <P>F0h-FFh</P><br />
| | <P>RP</P><br />
| | <P>POP PSW</P><br />
| | <P>JP @</P><br />
| | <P>DI</P><br />
| | <P>CP @</P><br />
| | <P>PUSH PSW</P><br />
| | <P>ORI b</P><br />
| | <P>RST 6</P><br />
| | <P>RM</P><br />
| | <P>SPHL</P><br />
| | <P>JM @</P><br />
| | <P>EI</P><br />
| | <P>CM @</P><br />
| | <P>JTM @</P><br />
| | <P>CPI b</P><br />
| | <P>RST 7</P><br />
|}</div>
64.81.88.222
https://bitchin100.com/wiki/index.php?title=Desklink/TS-DOS_Directory_Access&diff=763
Desklink/TS-DOS Directory Access
2008-12-31T04:45:06Z
<p>64.81.88.222: /* <p>TS-DOS Directory Management Extensions Programmer's Guide</p><p>By Kenneth D. Pettit</p> */</p>
<hr />
<div><div><br />
<br />
= <p>TS-DOS Directory Management Extensions Programmer's Guide</p> =<br />
<br />
<big>By Kenneth D. Pettit</big><br />
<br />
== Overview ==<br />
<br />
TS-DOS was developed as an alternative for accessing the TPDD and TPDD-2 drives from the Tandy and NEC line of laptops (Model 100, 102, 200 and PC-8201a). As part of the design, when used with the companion "DeskLink" PC program, TS-DOS adds the ability to create and manage a directory structure on the target media. This same directory access extension is also built into the NADSBox SD card reader and allows navigation and access of the FAT directory structure on the media card. The extensions were discovered by reverse engineering the communication between a Model 102 and Desklink (running on an HP 200LX) and between TS-DOS and a TPDD-1 using an HP 4951B serial protocol analyzer. This document describes the TS-DOS directory management extensions (DME) and is, to my knowledge, a complete description of the protocol.<br />
<br />
== Protocol Structure ==<br />
<br />
=== History ===<br />
<br />
The TPDD-1 supported two modes of operation for accessing data on the floppy disc - an "Operational" mode and an "FDC Emulation" mode. Each of these modes have a very different command structure and are well documented in the TPDD-1 reference manual. The FDC Emulation mode was used for direct sector access of the data stored on the disc. Neither the TPDD-2 nor Desklink support the FDC Emulation mode and instead add sector access commands in Operational mode to provide the same functionality.<br /><br /><br />
<br />
=== Basic premise for extension addition ===<br />
<br />
The directory management extensions in TS-DOS are implemented partially using commands to support the FDC Emulation mode, and partially using a targeted file extension ("&lt;&gt;") in operational mode commands to denote references to a directory or subdirectory on the media. The FDC Emulation mode commands are used to identify if the client supports DME and the "&lt;&gt;" extension is used to specify target directories for creation, deletion or navigation.<br />
<br />
=== Request Format ===<br />
<br />
Both FDC Emulation requests and Operational mode requests are issued by TS-DOS, although only a single FDC Emulation mode request is used. FDC Emulation requests consist of a single ASCII character with one or more ASCII arguments followed by a carriage return (0Dh). Operational mode requests consist of a Preamble of ZZ (5Ah 5Ah), followed by a Request ID byte, a Payload Length byte, 0 or more payload bytes, terminated by a checksum.<br />
<br />
<blockquote><strong>Note:</strong> All values are shown as hexadecimal. ASCII character strings are enclosed with quotation marks. The quotation marks are not part of the command or response.</blockquote><br />
<br />
=== Response Format ===<br />
<br />
In operational mode, the reponse format is identical to the request format, except that no preamble is sent. In FDC Emulation mode, the reponse format varies depending on the command and the TPDD service. Specific details regarding FDC Emulation mode responses will be described as needed.<br />
<br />
== TPDD Service discovery ==<br />
<br />
Since TS-DOS must operate with with various TPDD servers, and since not all servers follow the same protocol, it must determine if the server is capable of supporting DME. This is done by sending an FDC Emulation mode command to go into operational mode ("M1"), followed by an operational mode command to go into FDC Emulation mode. For this operational mode sequence, TS-DOS actually terminates the command with a carriage return (0Dh) which isn't part of the standard operational mode protocol. The following two commands are sent:<br /><br />
<br />
=== Directory Management Extensions Request (DMEReq) ===<br />
<br />
{| cellspacing="10" cellpadding="10"<br />
| "M1"<br />
| 0D<br />
|<br />
{| style="text-align: left; background-color: rgb(255, 255, 204); height: 113px" border="1" cellspacing="2" cellpadding="2"<br />
| Preamble<br />
| Request ID<br />
| Payload Length<br />
| Checksum<br />
|-<br />
| 5A 5A<br />
| 08<br />
| 00<br />
| F7<br />
|}<br />
| 0D<br />
|}<br />
<br />
<br /> For a TPDD service that supports FDC Emulation mode, the standard response for both commands is no response. If the server does not respond to either command, or responds with an error message, then TS-DOS knows the server does not support DME.<br /><br /> If the server does support DME, then after the final carriage return (0Dh), it shall reply with a standard operational mode response. The response ID must be 12h and the payload field must be 11 bytes long and contain the name of the current directory, or at least the lowest level name in the tree, as shown below. The name should be 6 characters long and should be terminated with ".&lt;&gt;",20h. Names shorter than 6 characters should be padded with spaces before the ".&lt;&gt;",20h extension.<br /><br /> TS-DOS will display the directory name reported in the DMEResp payload in the upper right corner of the display in reverse video characters. If the current directory is the root "/" directory, then the server should return "ROOT .&lt;&gt; " in the payload filed as a standard, although any name could be provided. TS-DOS will send the DMEReq sequence multiple times including when it has requested a directory change operation. This provides a way of reporting the new subdirectory name for display in the TS-DOS title bar.<br />
<br />
=== Directory Management Extensions Response (DMEResp) ===<br />
<br />
{| style="text-align: left; background-color: rgb(255, 255, 204); height: 113px" border="1" cellspacing="2" cellpadding="2"<br />
| Response ID<br />
| Payload Length<br />
| Payload<br />
| Checksum<br />
|-<br />
| 12<br />
| 0B<br />
|<br />
{| style="text-align: left; width: 100%" border="1" frame="box" cellspacing="2" cellpadding="2" frame="box"<br />
| Rsvd<br />
| Dir Name<br />
| Extension<br />
|-<br />
| 00<br />
| 6 bytes, space padded<br />
| ".&lt;&gt;",20h<br />
|}<br />
| Checksum<br />
|}<br />
<br />
== Directory reporting from Server ==<br />
<br />
The server device (DeskLink, NADSBox, etc.) should use the receipt of a DMEReq as an indication to provide directory and subdirectory information to TS-DOS (or any other client). If the DMEReq sequence is not received, then the server is communicating with a DOS that does not support DME, such as TEENY or FLOPPY, etc. Directory information is reported using the same protocol as regular files using the Directory Reference Request with the exception that the extension is reported as "&amp;lt&amp;gt ". Directory Reference Requests are part of the standard TPDD-1 and TPDD-2 protocol and can refer to a specific directory entry, or the first, next or previous entry in the directory. For filename discovery, the "first", "next" or "previous" search forms are used, and the filename is all 00h.<br />
<br />
=== Directory Reference Request (DRReq) ===<br />
<br />
{| style="text-align: left; background-color: rgb(255, 255, 204); height: 113px" border="1" cellspacing="2" cellpadding="2"<br />
| Preamble<br />
| Request ID<br />
| Payload Length<br />
| Payload<br />
| Checksum<br />
|-<br />
| 5A 5A<br />
| 00<br />
| 1A<br />
|<br />
{| style="text-align: left; width: 100%" border="1" frame="box" cellspacing="2" cellpadding="2" frame="box"<br />
| File Name<br />
| Attribute<br />
| Search Form<br />
|-<br />
| 24d bytes of 00<br />
| "F"<br />
| 01, 02 or 03<br />
|}<br />
| Checksum<br />
|}<br />
<br />
<br /> When DME support has been established, the server reports directory information by responding to the DRReq sequence with a Directory Reference Response (DRResp) packet with the filename field containing the directory name in 6.2 filename format. The directory name should be 6 characters or less with space padding and the 2 character extension must be set to "&lt;&gt;". TS-DOS uses the "&lt;&gt;" extension to identify the entry as a directory. When the server is reporting file / directory entries for a directory other than the root, it should provide a mechanism for navigating to the parent directory. In both DeskLink and NADSBox, this is done by reporting the first entry of a subdirectory as "PARENT.&lt;&gt;". The number of Free Sectors on the media should be a single byte with the value 80H or less. Sectors in the TPDD protocol are 1280 bytes in length.<br /><br />
<br />
=== Directory Reference Response (DRResp) ===<br />
<br />
{| style="text-align: left; background-color: rgb(255, 255, 204); height: 113px" border="1" cellspacing="2" cellpadding="2"<br />
| Response ID<br />
| Payload Length<br />
| Payload<br />
| Checksum<br />
|-<br />
| 11<br />
| 1C<br />
|<br />
{| style="text-align: left; width: 100%" border="1" frame="box" cellspacing="2" cellpadding="2" frame="box"<br />
| Dir Name<br />
| Ext.<br />
| Spaces (or 00h)<br />
| Attribute<br />
| Size<br />
| Free<br />
|}<br />
|-<br />
| 6 bytes<br />
| "&lt;&gt;"<br />
| 18 (decimal) bytes<br />
| "F"<br />
| 00<br />
| <nowiki># Sectors</nowiki><br />
|}<br />
<br />
{|<br />
| Checksum<br />
|}<br />
<br />
== Change Directory requests from TS-DOS ==<br />
<br />
When the user navigates the cursor to a directory entry that has the "&lt;&gt;" extension and pressed Enter, TS-DOS will perform a Directory Change operation to naviagte to that directory. This is accomplished by sending a Change Direcotry Reference Request (CDRReq) followed by a standard Open File Request and then a Close File Request. The CDRReq packet is the same as a standard DRReq packet except the filename extension is set to "&lt;&gt;".<br />
<br />
=== Change Directory Reference Request (CDRReq) ===<br />
<br />
{| style="text-align: left; background-color: rgb(255, 255, 204); height: 113px" border="1" cellspacing="2" cellpadding="2"<br />
| Preamble<br />
| Request ID<br />
| Payload Length<br />
| Payload<br />
| Checksum<br />
|-<br />
| 5A 5A<br />
| 00<br />
| 1A<br />
|<br />
{| style="text-align: left; width: 100%" border="1" frame="box" cellspacing="2" cellpadding="2" frame="box"<br />
| Dir Name<br />
| Ext.<br />
| Spaces (or 00h)<br />
| Attribute<br />
| Search Form<br />
|-<br />
| 6 bytes<br />
| "&lt;&gt;"<br />
| 18 (decimal) bytes<br />
| "F"<br />
| 00<br />
|}<br />
| Checksum<br />
|}<br />
<br />
<br /> The server should respond to the CDRReq packet with a DRResp response packet containing the same directory name that was passed in the CDRReq. The server should save the directory name and expect to receive a subsequent Open File Request. When the Open File Request is received, the server should process it as a Change Directory operation to the directory specified in the CDRReq packet and return a standard Normal Response Packet (Id = 12H) with the appropriate error code. If the directory name matches the special name given for the parent directory ("PARENT.&lt;&gt;"), then the server should change to the parent of the current directory. The the server should then expect a Close File Request and respond as usual.<br /><br />
<br />
=== Checksum Algorithm ===<br />
<br />
Total = Sum of all bytes from TypeID..Last byte of Payload<br /> Checksum = (Total &amp; FFh) XOR FFh</div>
64.81.88.222
https://bitchin100.com/wiki/index.php?title=LAPDOS&diff=762
LAPDOS
2008-12-31T04:40:37Z
<p>64.81.88.222: </p>
<hr />
<div>LAPDOS is a DOS-based PC TPDD client. It comes with a program that, loaded onto the Model T, turns the Model T laptop into a TPDD server. This is the only known instance where a Model T is made to be a TPDD server. Typically, it is the client.<br />
<br />
This allows LAPDOS to copy files directly to/from a Model 100 without an intervening step of moving the files to a disk drive. This innovation, and a dual-pane file manager is likely what made LAPDOS such a successful product.<br />
<br />
[[How to set up an old PC to run LAPDOS]]</div>
64.81.88.222
https://bitchin100.com/wiki/index.php?title=Relocating_Loader_(RLC)_Format&diff=624
Relocating Loader (RLC) Format
2008-12-21T05:00:04Z
<p>64.81.88.222: /* START */</p>
<hr />
<div>== What is RLC ==<br />
<br />
The Model 100 use an 8085 CPU. This CPU does not support position independent<br />
machine code, at least in any traditional sense.<br />
<br />
Also, the Model 100 has no built-in support for transferring binary machine<br />
language files over the serial port.<br />
<br />
Presumably for these reasons, someone created the RLC format. RLC is a representation of an 8085 machine<br />
language program that is relocatable and 7-bit clean.<br />
<br />
There are many programs in the Compuserve Model 100 SIG archive, for example, that are formatted<br />
as RLC files.<br />
<br />
== Format ==<br />
<br />
=== Overview ===<br />
<br />
RLC is an ASCII base-16 representation of an 8085 machine language<br />
program. Unlike traditional hexadecimal, however, it uses the ASCII characters<br />
<pre>0123456789:;<=>?</pre><br />
It starts with a header, followed by the body, and ending with a<br />
checksum. Whitespace is permitted, and most RLC files seem to keep the data<br />
less than 128 bytes per line.<br />
<br />
=== START ===<br />
<br />
One value must be supplied at load time which does not appear<br />
in the RLC file: the START address. START is<br />
where the user wants to locate the relocatable image. The first field in the body<br />
will be poked into RAM starting at START. Note that there must be sufficient space<br />
CLEAR'ed at START to load the program.<br />
<br />
=== Header ===<br />
<br />
The first line starts with (in ASCII format) the number of bytes in the RLC<br />
file, followed by the offset within the image to the entry point.<br />
<br />
The numeric values are space separated. For example, here is the first line of<br />
an RLC file coding for a 7387 byte image, whose entry point is the first byte<br />
of the image.<br />
<br />
<pre><br />
7387 0<br />
</pre><br />
<br />
It is not clear whether the header needs to be on its own line. It is also<br />
unclear whether the first line needs to start with a space.<br />
<br />
=== Body ===<br />
<br />
The body of the RLC file is a sequence of fields and whitespace.<br />
Whitespace is generally needed just to separate lines.<br />
<br />
The two types of fields are octets and relocation offsets.<br />
<br />
==== Octet ====<br />
<br />
An octet is a two-ASCII-character, base-16 representation of a byte. The high nibble appears first.<br />
<br />
No separator between octets is required.<br />
<br />
==== Relocation Offset ====<br />
<br />
A relocation offset is represented by an '@' sign and followed by a<br />
big-endian, base-16 representation of an address to be relocated.<br />
<br />
<pre><br />
@035><br />
</pre><br />
<br />
In hexadecimal, this would represent the offset 0x035E, or 862 in decimal.<br />
<br />
In order to format as 8085 binary, this is added to the user-requested START<br />
address for the image and formatted in little-endian byte order (least<br />
significant byte first).<br />
<br />
=== Checksum ===<br />
<br />
The RLC file ends with the checksum in decimal format.<br />
<br />
The checksum is the arithmetic sum of all offsets and octets in<br />
the image. It is at least a 32-bit integer.<br />
<br />
In the examples I have seen, it occurs on its own<br />
line and is preceded by a space.</div>
64.81.88.222
https://bitchin100.com/wiki/index.php?title=Relocating_Loader_(RLC)_Format&diff=623
Relocating Loader (RLC) Format
2008-12-21T04:59:12Z
<p>64.81.88.222: /* Format */</p>
<hr />
<div>== What is RLC ==<br />
<br />
The Model 100 use an 8085 CPU. This CPU does not support position independent<br />
machine code, at least in any traditional sense.<br />
<br />
Also, the Model 100 has no built-in support for transferring binary machine<br />
language files over the serial port.<br />
<br />
Presumably for these reasons, someone created the RLC format. RLC is a representation of an 8085 machine<br />
language program that is relocatable and 7-bit clean.<br />
<br />
There are many programs in the Compuserve Model 100 SIG archive, for example, that are formatted<br />
as RLC files.<br />
<br />
== Format ==<br />
<br />
=== Overview ===<br />
<br />
RLC is an ASCII base-16 representation of an 8085 machine language<br />
program. Unlike traditional hexadecimal, however, it uses the ASCII characters<br />
<pre>0123456789:;<=>?</pre><br />
It starts with a header, followed by the body, and ending with a<br />
checksum. Whitespace is permitted, and most RLC files seem to keep the data<br />
less than 128 bytes per line.<br />
<br />
=== START ===<br />
<br />
One value must be supplied at load time. This is the START address. START is<br />
where the user wants to locate the relocatable image. The first field in the body<br />
will be poked into RAM starting at START. Note that there must be sufficient space<br />
CLEAR'ed at START to load the program.<br />
<br />
=== Header ===<br />
<br />
The first line starts with (in ASCII format) the number of bytes in the RLC<br />
file, followed by the offset within the image to the entry point.<br />
<br />
The numeric values are space separated. For example, here is the first line of<br />
an RLC file coding for a 7387 byte image, whose entry point is the first byte<br />
of the image.<br />
<br />
<pre><br />
7387 0<br />
</pre><br />
<br />
It is not clear whether the header needs to be on its own line. It is also<br />
unclear whether the first line needs to start with a space.<br />
<br />
=== Body ===<br />
<br />
The body of the RLC file is a sequence of fields and whitespace.<br />
Whitespace is generally needed just to separate lines.<br />
<br />
The two types of fields are octets and relocation offsets.<br />
<br />
==== Octet ====<br />
<br />
An octet is a two-ASCII-character, base-16 representation of a byte. The high nibble appears first.<br />
<br />
No separator between octets is required.<br />
<br />
==== Relocation Offset ====<br />
<br />
A relocation offset is represented by an '@' sign and followed by a<br />
big-endian, base-16 representation of an address to be relocated.<br />
<br />
<pre><br />
@035><br />
</pre><br />
<br />
In hexadecimal, this would represent the offset 0x035E, or 862 in decimal.<br />
<br />
In order to format as 8085 binary, this is added to the user-requested START<br />
address for the image and formatted in little-endian byte order (least<br />
significant byte first).<br />
<br />
=== Checksum ===<br />
<br />
The RLC file ends with the checksum in decimal format.<br />
<br />
The checksum is the arithmetic sum of all offsets and octets in<br />
the image. It is at least a 32-bit integer.<br />
<br />
In the examples I have seen, it occurs on its own<br />
line and is preceded by a space.</div>
64.81.88.222
https://bitchin100.com/wiki/index.php?title=Model_T_DocGarden&diff=615
Model T DocGarden
2008-12-20T21:11:07Z
<p>64.81.88.222: /* Model T Developer Reference */</p>
<hr />
<div>These pages are devoted to the Model T:<br />
<br />
TRS-80 Model 100, Tandy Model 102, KC-85, NEC 8201A, NEC 8300, Olivetti M10, Tandy Model 200, and the WP-2<br />
<br />
== Tandy Disk Drive and Emulators ==<br />
<br />
TPDD emulators, in concert with a compatible disk clients like<br />
TS-DOS, TEENY, POWR-DOS, FLOPPY.CO, the Booster Pak, or the <br />
WP-2 built-in Diskette client are the most "advanced" way to<br />
accurately and quickly transfer all file types including binary<br />
files to and from your Model T laptop. There are different<br />
options for the server side on modern operating systems and<br />
devices:<br />
<br />
=== Servers ===<br />
<br />
[[LaddieCon]] is a TPDD emulator for Windows written in C#.Net.<br />
<br />
[[DLPilot]] is a TPDD emulator for PalmOS devices.<br />
<br />
[[DLPlus]] is a TPDD emulator for Linux, BSD, and MacOSX.<br />
<br />
[[NADSBox]] is an advanced stand-alone TPDD emulation device that uses SD cards.<br />
<br />
=== Clients ===<br />
<br />
[[TEENY]] is a very small RAM-based TPDD client<br />
<br />
=== Real TPDD and TPDD-2 ===<br />
<br />
[[Differences]] between TPDD-1 and TPDD-2<br />
<br />
== Simple Text File Transfer (No Client) ==<br />
<br />
You can use any "terminal program" to transfer text files to<br />
and from your Model T laptop. Here are some tutorials:<br />
<br />
[[Text File Transfer using Hyperterminal]]<br />
<br />
[http://web.mac.com/lorddoomicus/Doomd/Blog/Entries/2006/9/10_Connecting_a_Tandy_102_Computer_to_a_Mac.html Text File Transfer to Mac using Z-Term]<br />
<br />
== Model T Software ==<br />
<br />
[[VirtualT]] Model 100/102, T200, NEC 8201A, M10 emulator<br />
<br />
[[mtcpm]] CP/M for the Tandy 100/102/200<br />
<br />
[[RAM4TH]]<br />
<br />
== Model T Hardware Hacks and Troubleshooting ==<br />
<br />
[[Splitting the Model 100/102/200 case]]<br />
<br />
[[Recovering an Unresponsive Laptop]]<br />
<br />
[[International Keyboard Support]]<br />
<br />
[[Repairing Problem Keys]]<br />
<br />
== Model T Hardware Projects ==<br />
<br />
[[Remem]] is the ultimate Model T memory upgrade<br />
<br />
:[http://lists.bitchin100.com/listinfo.cgi/remem-users-bitchin100.com remem-users mailing list] This is a support list for remem users.<br />
:[[Remem Software HOWTO's]]<br />
<br />
[[REX]] is a flash OptROM emulator/switcher<br />
<br />
[[REX2]] is a upcoming flash OptROM emulator/switcher with support for a 64K all-RAM mode. This permits running with a patched main ROM, or the upcoming [[mtcpm]] (Model T CP/M)<br />
<br />
[http://www.kenpettit.com/nadsbox.html NADSBox] is a stand-alone TPDD emulation device that uses SD cards<br />
<br />
== Model T Developer Reference ==<br />
<br />
[[ROM Hooks]]<br />
<br />
[[RAM Variables]]<br />
<br />
[[Option ROM Programming]]<br />
<br />
[[8085 Reference]]<br />
<br />
[[Low Level Filesystem Access]]<br />
<br />
[[Low Level LCD Access]]<br />
<br />
[[Direct Keyboard Access]]<br />
<br />
[[Serial Port Access]]<br />
<br />
[[CO File Format]]<br />
<br />
[[BCR Port Access]]<br />
<br />
[[TPDD Protocol]]<br />
<br />
[[Relocating Loader (RLC) Format]]<br />
<br />
== Other Topics ==<br />
<br />
== Model T Links ==<br />
<br />
[http://club100.org Rick Hanson's Club 100]<br />
<br />
[http://www.istop.com/%7Esadolph/remem_home.html Steve Adolph's Remem Site]<br />
<br />
[http://sliderule.mraiow.com/wiki/Portable_Computer_Index#T Chris Osburn's Calculating Instruments]<br />
<br />
[http://kenpettit.com/projects.html Ken Pettit's Model T Projects]</div>
64.81.88.222
https://bitchin100.com/wiki/index.php?title=Model_T_DocGarden&diff=596
Model T DocGarden
2008-12-18T04:55:04Z
<p>64.81.88.222: /* Model T Software */</p>
<hr />
<div>These pages are devoted to the Model T:<br />
<br />
TRS-80 Model 100, Tandy Model 102, KC-85, NEC 8201A, NEC 8300, Olivetti M10, Tandy Model 200, and the WP-2<br />
<br />
== Tandy Disk Drive and Emulators ==<br />
<br />
TPDD emulators, in concert with a compatible disk clients like<br />
TS-DOS, TEENY, POWR-DOS, FLOPPY.CO, the Booster Pak, or the <br />
WP-2 built-in Diskette client are the most "advanced" way to<br />
accurately and quickly transfer all file types including binary<br />
files to and from your Model T laptop. There are different<br />
options for the server side on modern operating systems and<br />
devices:<br />
<br />
=== Servers ===<br />
<br />
[[LaddieCon]] is a TPDD emulator for Windows written in C#.Net.<br />
<br />
[[DLPilot]] is a TPDD emulator for PalmOS devices.<br />
<br />
[[DLPlus]] is a TPDD emulator for Linux, BSD, and MacOSX.<br />
<br />
[[NADSBox]] is an advanced stand-alone TPDD emulation device that uses SD cards.<br />
<br />
=== Clients ===<br />
<br />
[[TEENY]] is a very small RAM-based TPDD client<br />
<br />
=== Real TPDD and TPDD-2 ===<br />
<br />
[[Differences]] between TPDD-1 and TPDD-2<br />
<br />
== Simple Text File Transfer (No Client) ==<br />
<br />
You can use any "terminal program" to transfer text files to<br />
and from your Model T laptop. Here are some tutorials:<br />
<br />
[[Text File Transfer using Hyperterminal]]<br />
<br />
[http://web.mac.com/lorddoomicus/Doomd/Blog/Entries/2006/9/10_Connecting_a_Tandy_102_Computer_to_a_Mac.html Text File Transfer to Mac using Z-Term]<br />
<br />
== Model T Software ==<br />
<br />
[[VirtualT]] Model 100/102, T200, NEC 8201A, M10 emulator<br />
<br />
[[mtcpm]] CP/M for the Tandy 100/102/200<br />
<br />
[[RAM4TH]]<br />
<br />
== Model T Hardware Hacks and Troubleshooting ==<br />
<br />
[[Splitting the Model 100/102/200 case]]<br />
<br />
[[Recovering an Unresponsive Laptop]]<br />
<br />
[[International Keyboard Support]]<br />
<br />
[[Repairing Problem Keys]]<br />
<br />
== Model T Hardware Projects ==<br />
<br />
[[Remem]] is the ultimate Model T memory upgrade<br />
<br />
:[http://lists.bitchin100.com/listinfo.cgi/remem-users-bitchin100.com remem-users mailing list] This is a support list for remem users.<br />
:[[Remem Software HOWTO's]]<br />
<br />
[[REX]] is a flash OptROM emulator/switcher<br />
<br />
[[REX2]] is a upcoming flash OptROM emulator/switcher with support for a 64K all-RAM mode. This permits running with a patched main ROM, or the upcoming [[mtcpm]] (Model T CP/M)<br />
<br />
[http://www.kenpettit.com/nadsbox.html NADSBox] is a stand-alone TPDD emulation device that uses SD cards<br />
<br />
== Model T Developer Reference ==<br />
<br />
[[ROM Hooks]]<br />
<br />
[[RAM Variables]]<br />
<br />
[[Option ROM Programming]]<br />
<br />
[[8085 Reference]]<br />
<br />
[[Low Level Filesystem Access]]<br />
<br />
[[Low Level LCD Access]]<br />
<br />
[[Direct Keyboard Access]]<br />
<br />
[[Serial Port Access]]<br />
<br />
[[CO File Format]]<br />
<br />
[[BCR Port Access]]<br />
<br />
[[TPDD Protocol]]<br />
<br />
== Other Topics ==<br />
<br />
== Model T Links ==<br />
<br />
[http://club100.org Rick Hanson's Club 100]<br />
<br />
[http://www.istop.com/%7Esadolph/remem_home.html Steve Adolph's Remem Site]<br />
<br />
[http://sliderule.mraiow.com/wiki/Portable_Computer_Index#T Chris Osburn's Calculating Instruments]<br />
<br />
[http://kenpettit.com/projects.html Ken Pettit's Model T Projects]</div>
64.81.88.222
https://bitchin100.com/wiki/index.php?title=Diagnose_DTR/DSR_and_RTS/CTS_issues&diff=595
Diagnose DTR/DSR and RTS/CTS issues
2008-12-15T05:12:33Z
<p>64.81.88.222: </p>
<hr />
<div>TS-DOS and TEENY depend upon at least DSR to be high during operation. TS-DOS may also depend on CTS being high during operation.<br />
<br />
If DSR is low, then these programs will refuse to operate.<br />
<br />
NADSBox has the feature that it loops back the laptop's DTR to DSR. Also, it loops back RTS to CTS.<br />
<br />
So, if your laptop's DTR, DSR, RTS and CTS lines are working, TS-DOS should work fine with NADSBox. If TS-DOS or TEENY refuse to operate, you may have an issue with one or more of these signals.<br />
<br />
This program detects if these outputs and inputs are working. If the values change depending on whether NADSBox is connected, then your flow control lines are working properly. If one or both do not change, then there is a problem with your flow control lines either outbound or inbound for the relevant pair (DTR+DSR, RTS+CTS).<br />
<br />
Note that it makes no difference whether NADSBox is on or off during the diagnostic. Also, it assumes the default in that RTS is looped back to CTS (this is configurable by the user through a jumper in NADSBox... see the manual).<br />
<br />
== NEC 8201A, NEC 8300 Version ==<br />
<br />
<pre><br />
10 CLS<br />
20 DEFINT D<br />
30 OPEN"COM:9N81NN" FOR INPUT AS 1<br />
40 OUT 186, (INP(186) AND 63)<br />
50 DS=INP(187)<br />
60 DR=(DS/32)AND1<br />
70 DC=(DS/16)AND1<br />
80 LOCATE1,3:PRINT"DSR: ";DR<br />
90 LOCATE1,4:PRINT"CTS: ";DC<br />
100 GOTO 50<br />
</pre><br />
<br />
== Model 100 Version ==<br />
<br />
(untested... let me know if you try this before I do)<br />
<br />
<pre><br />
10 CLS<br />
20 DEFINT D<br />
30 OPEN"COM:98N1E" FOR INPUT AS 1<br />
40 OUT 186, (INP(186) AND 63)<br />
50 DS=INP(187)<br />
60 DR=(DS/32)AND1<br />
70 DC=(DS/16)AND1<br />
80 PRINT@1,"DSR: ";DR<br />
90 PRINT@41"CTS: ";DC<br />
100 GOTO 50<br />
</pre></div>
64.81.88.222
https://bitchin100.com/wiki/index.php?title=Diagnose_DTR/DSR_and_RTS/CTS_issues&diff=594
Diagnose DTR/DSR and RTS/CTS issues
2008-12-15T04:57:44Z
<p>64.81.88.222: </p>
<hr />
<div>TS-DOS and TEENY depend upon at least DSR to be high during operation. TS-DOS may also depend on CTS being high during operation.<br />
<br />
If DSR is low, then these programs will refuse to operate.<br />
<br />
NADSBox has the feature that it loops back the laptop's DTR to DSR. Also, it loops back RTS to CTS.<br />
<br />
So, if your laptop's DTR, DSR, RTS and CTS lines are working, TS-DOS should work fine with NADSBox. If TS-DOS or TEENY refuse to operate, you may have an issue with one or more of these signals.<br />
<br />
This program detects if these outputs and inputs are working. If the values change depending on whether NADSBox is connected, then your flow control lines are working properly. If one or both do not change, then there is a problem with your flow control lines are outbound or inbound for the relevant pair (DTR+DSR, RTS+CTS).<br />
<br />
Note that it makes no difference whether NADSBox is on or off during the diagnostic. Also, it assumes the default in that RTS is looped back to CTS (this is configurable by the user through a jumper in NADSBox... see the manual).<br />
<br />
== NEC 8201A, NEC 8300 Version ==<br />
<br />
<pre><br />
10 CLS<br />
20 DEFINT D<br />
30 OPEN"COM:9N81NN" FOR INPUT AS 1<br />
40 OUT 186, (INP(186) AND 63)<br />
50 DS=INP(187)<br />
60 DR=(DS/32)AND1<br />
70 DC=(DS/16)AND1<br />
80 LOCATE1,3:PRINT"DSR: ";DR<br />
90 LOCATE1,4:PRINT"CTS: ";DC<br />
100 GOTO 50<br />
</pre><br />
<br />
== Model 100 Version ==<br />
<br />
(untested... let me know if you try this before I do)<br />
<br />
<pre><br />
10 CLS<br />
20 DEFINT D<br />
30 OPEN"COM:98N1E" FOR INPUT AS 1<br />
40 OUT 186, (INP(186) AND 63)<br />
50 DS=INP(187)<br />
60 DR=(DS/32)AND1<br />
70 DC=(DS/16)AND1<br />
80 PRINT@1,"DSR: ";DR<br />
90 PRINT@41"CTS: ";DC<br />
100 GOTO 50<br />
</pre></div>
64.81.88.222
https://bitchin100.com/wiki/index.php?title=Diagnose_DTR/DSR_and_RTS/CTS_issues&diff=593
Diagnose DTR/DSR and RTS/CTS issues
2008-12-15T04:48:23Z
<p>64.81.88.222: New page: TS-DOS and TEENY depend upon at least DSR to be high during operation. TS-DOS may also depend on CTS being high during operation. If DSR is low, then these programs will refuse to operate...</p>
<hr />
<div>TS-DOS and TEENY depend upon at least DSR to be high during operation. TS-DOS may also depend on CTS being high during operation.<br />
<br />
If DSR is low, then these programs will refuse to operate.<br />
<br />
NADSBox loops back the laptop's DTR to DSR. Also, it loops back RTS to CTS.<br />
<br />
So, if your laptop's DTR, DSR, RTS and CTS lines are working, you should have no issue communicating with NADSBox.<br />
<br />
This program will let you detect if these outputs and inputs are working. If the values change depending on whether NADSBox is connected, then your flow control lines are working properly. If one or both do not change, then there is a problem with your flow control lines are outbound or inbound for the relevant pair (DTR+DSR, RTS+CTS).<br />
<br />
Note that this code is for the NEC 8201A and 8300.<br />
<br />
You must change the "COM:9N81NN" to "COM:98N1E" for the Model 100.<br />
<br />
<pre><br />
10 CLS<br />
20 DEFINT D<br />
30 OPEN"COM:9N81NN" FOR INPUT AS 1<br />
40 OUT 186, (INP(186) AND 63)<br />
50 DS=INP(187)<br />
60 DR=(DS/32)AND1<br />
70 DC=(DS/16)AND1<br />
80 LOCATE1,3:PRINT"DSR: ";DR<br />
90 LOCATE1,4:PRINT"CTS: ";DC<br />
100 GOTO 50<br />
</pre></div>
64.81.88.222
https://bitchin100.com/wiki/index.php?title=NADSBox&diff=592
NADSBox
2008-12-15T04:39:59Z
<p>64.81.88.222: /* NADSBox Tips and Tricks */</p>
<hr />
<div>== What is NADSBox ==<br />
<br />
[http://www.kenpettit.com/nadsbox.html NADSBox] is a stand-alone TPDD emulation device that uses SD cards.<br />
<br />
It also has a very advanced command prompt accessible via TELCOM which helps trememendously in bootstrapping RAM-based TPDD clients, among other things.<br />
<br />
== NADSBox Tips and Tricks ==<br />
<br />
[[ Dangling NADS ]]<br />
<br />
[[ Diagnose DTR/DSR and RTS/CTS issues ]]</div>
64.81.88.222
https://bitchin100.com/wiki/index.php?title=NADSBox&diff=591
NADSBox
2008-12-15T04:39:39Z
<p>64.81.88.222: /* NADSBox Tips and Tricks */</p>
<hr />
<div>== What is NADSBox ==<br />
<br />
[http://www.kenpettit.com/nadsbox.html NADSBox] is a stand-alone TPDD emulation device that uses SD cards.<br />
<br />
It also has a very advanced command prompt accessible via TELCOM which helps trememendously in bootstrapping RAM-based TPDD clients, among other things.<br />
<br />
== NADSBox Tips and Tricks ==<br />
<br />
[[ Dangling NADS ]]<br />
[[ Troubleshooting DTR/DSR and RTS/CTS issues ]]</div>
64.81.88.222
https://bitchin100.com/wiki/index.php?title=TPDD_Base_Protocol&diff=590
TPDD Base Protocol
2008-12-15T03:57:47Z
<p>64.81.88.222: </p>
<hr />
<div>== General Reference ==<br />
<br />
<UL><br />
<LI>Disks are single sided 3.5 inch standard disks</LI><br />
<LI>PDD1 - 40 tracks 2 sectors 1280 bytes/sector (100K/disk)</LI><br />
<LI>PDD2 - 80 tracks 2 sectors 1280 bytes/sector (200K/disk treated as two banks of 100k<br />
each)</LI><br />
<LI>Maximum file size = 64k. </LI><br />
<LI>Maximum number of directory entries (files) is 40 for PDD1 and 80 for PDD2.</LI><br />
<LI>File names are maximum 24 characters (padded with trailing blanks) although Tandy always<br />
used 6 for filename and 2 for filetype, with period seperator (i.e. XXXXXX.TT)</LI><br />
<LI>All communications with drive are at 19,200 bps. PDD1 has dip switches so this can drop<br />
to 9600bps. PDD2 is auto sensing down to 1200bps (??? - can anyone confirm this?).</LI><br />
</UL><br />
<br />
== Command Format ==<br />
<br />
All commands are in a request/return format (half-duplex)<br />
<br />
General request format:<br />
<br />
<BLOCKQUOTE><br />
<p><TT>preamble type length data checksum</TT></p><br />
</BLOCKQUOTE><br />
<br />
General return format:<br />
<br />
<BLOCKQUOTE><br />
<p><TT>type length data checksum</TT></p><br />
</BLOCKQUOTE><br />
<br />
== Command Type ==<br />
<br />
<P ALIGN="CENTER">(all values are in HEX)</P><br />
<br />
{| WIDTH="100%" BORDER="1" <br />
! &nbsp;command <br />
! &nbsp;request <br />
! &nbsp;return<br />
|- <br />
| &nbsp;directory ref <br />
| &nbsp;00<br />
| &nbsp;11 12<br />
|- <br />
| &nbsp;open file<br />
| &nbsp;01<br />
| &nbsp;12<br />
|- <br />
| &nbsp;close file<br />
| &nbsp;02<br />
| &nbsp;12<br />
|- <br />
| &nbsp;read file<br />
| &nbsp;03<br />
| &nbsp;10 12<br />
|- <br />
| &nbsp;write file<br />
| &nbsp;04<br />
| &nbsp;12<br />
|- <br />
| &nbsp;delete file<br />
| &nbsp;05<br />
| &nbsp;12<br />
|- <br />
| &nbsp;format disk<br />
| &nbsp;06 *<br />
| &nbsp;12<br />
|- <br />
| &nbsp;drive status<br />
| &nbsp;07 *<br />
| &nbsp;12<br />
|- <br />
| &nbsp;drive condition<br />
| &nbsp;0C *<br />
| &nbsp;15<br />
|- <br />
| &nbsp; rename file<br />
| &nbsp;0D<br />
| &nbsp;12<br />
|}<br />
<br />
<P>* PDD2 treats the disk as two banks of 100k each. All commands except these two must<br />
specify the bank number as part of the request. The above commands reference BANK 0. To<br />
reference BANK 1 you must add 40 HEX to these values (bit 6 = bank number). E.G. 'open<br />
file' becomes 41 for BANK 1.</P><br />
<br />
== Request Command details ==<br />
<br />
=== Type 00 - Directory Reference ===<br />
<br />
<PRE> 2 1 1 24 1 1 1 bytes<br />
+----+--+--+--------------+----------+------------+------+<br />
&#124;5a5a&#124;00&#124;1a&#124; filename &#124;attribute &#124;search form &#124;chksum&#124; <br />
+----+--+--+--------------+----------+------------+------+</PRE><br />
<br />
* Preamble - always 'ZZ'<br />
* request - type 00h*<br />
* length - length of data 1ah (26 decimal)<br />
* filename - padded with blanks<br />
* attribute - specify 'F' (not used normally)<br />
* search form<br />
<br />
<BLOCKQUOTE><br />
* 00h - reference file for open or delete<br />
* 01h - request first directory block<br />
* 02h - request next directory block<br />
* 03h - request previous directory block<br />
* 04h - end directory reference<br />
</BLOCKQUOTE><br />
<br />
checksum - see below for calculating<br />
<br />
=== Type 01 - Open file ===<br />
<br />
<PRE> 2 1 1 1 1 bytes<br />
+----+--+--+------+------+<br />
&#124;5a5a&#124;01&#124;01&#124; mode &#124;chksum&#124;<br />
+----+--+--+------+------+</PRE><br />
<br />
* Preamble - always 'ZZ'<br />
* request - type 01h<br />
* length - length of data 01h (1 decimal)<br />
* mode -<br />
<br />
<BLOCKQUOTE><br />
* 01h - open new file for WRITE<br />
* 02h - open existing file for APPEND<br />
* 03h - open existing file for READ<br />
</BLOCKQUOTE><br />
<br />
checksum - see below for calculating<br />
<br />
=== Type 02 - Close file ===<br />
<br />
<PRE> 2 1 1 1 bytes<br />
+----+--+--+------+<br />
&#124;5a5a&#124;02&#124;00&#124;chksum&#124;<br />
+----+--+--+------+</PRE><br />
<br />
* Preamble - always 'ZZ'<br />
* request - type 02h<br />
* length - length of data 00h (no data field)<br />
* checksum - see below for calculating<br />
<br />
=== Type 03 - Read file ===<br />
<br />
<PRE><br />
<pre> 2 1 1 1 bytes<br />
+----+--+--+------+<br />
&#124;5a5a&#124;03&#124;00&#124;chksum&#124;<br />
+----+--+--+------+</PRE><br />
<br />
* Preamble - always 'ZZ'<br />
* request - type 03h<br />
* length - length of data 00h (no data field)<br />
* checksum - see below for calculating<br />
<br />
=== Type 04 - Write file ===<br />
<br />
<PRE> 2 1 1 1-128 1 bytes<br />
+----+--+---+------+------+<br />
&#124;5a5a&#124;04&#124;01-&#124;data &#124;chksum&#124;<br />
&#124; &#124; &#124; 80&#124; &#124; &#124;<br />
+----+--+---+------+------+</PRE><br />
<br />
* Preamble - always 'ZZ'<br />
* requesr - type 04<br />
* length - length of data 01h-80h (actual length of data)<br />
* checksum - see below for calculating<br />
<br />
=== Type 05 - Delete file ===<br />
<br />
<PRE> 2 1 1 1 bytes<br />
+----+--+--+------+<br />
&#124;5a5a&#124;05&#124;00&#124;chksum&#124;<br />
+----+--+--+------+</PRE><br />
<br />
* Preamble - always 'ZZ'<br />
* request - type 05h<br />
* length - length of data 00h (no data field)<br />
* checksum - see below for calculating<br />
<br />
=== Type 06 - Format Disk ===<br />
<br />
<PRE> 2 1 1 1 bytes<br />
+----+--+--+------+<br />
&#124;5a5a&#124;06&#124;00&#124;chksum&#124;<br />
+----+--+--+------+</PRE><br />
<br />
* Preamble - always 'ZZ'<br />
* request - type 06h<br />
* length - length of data 00h (no data field)<br />
* checksum - see below for calculating<br />
<br />
=== Type 07 - Drive Status ===<br />
<PRE><br />
2 1 1 1 bytes<<br />
+----+--+--+------+<br />
&#124;5a5a&#124;07&#124;00&#124;chksum&#124;<br />
+----+--+--+------+</PRE><br />
<br />
* Preamble - always 'ZZ'<br />
* request - type 07h<br />
* length - length of data 00h (no data field)<br />
* checksum - see below for calculating<br />
<br />
=== Type 0C - Drive Condition ===<br />
<PRE><br />
2 1 1 1 bytes<br />
+----+--+--+------+<br />
&#124;5a5a&#124;0C&#124;00&#124;chksum&#124;<br />
+----+--+--+------+</PRE><br />
<br />
* Preamble - always 'ZZ'<br />
* request - type 0Ch<br />
* length - length of data 00h (no data field)<br />
* checksum - see below for calculating<br />
<br />
=== Type 0D - Rename file ===<br />
<PRE><br />
2 1 1 24 1 1 bytes<<br />
+----+--+--+-------+------+------+<br />
&#124;5a5a&#124;0D&#124;19&#124;newname&#124;attrib&#124;chksum&#124;<br />
+----+--+--+-------+------+------+</PRE><br />
<br />
* Preamble - always 'ZZ'<br />
* request - type 0D<br />
* length - length of data 19h (25 decimal)<br />
* newname - new name for the file<br />
* attribute- not used (specify 'F')<br />
* checksum - see below for calculating<br />
<br />
== Return Command Details ==<br />
=== Type 10 - Read file Return ===<br />
<PRE><br />
1 1 0-128 1 bytes<br />
+--+---+----------+-----+<br />
&#124;10&#124;00-&#124; file data&#124;cksum&#124;<br />
&#124; &#124; 80&#124; &#124;cksum&#124;<br />
+--+---+----------+-----+</PRE><br />
<br />
* return - type 10<br />
* length - length of data 00h-80h (0-128 decimal)<UL><LI>if length is equal to 80h there may be more data - you must issue another read command</LI><LI>if length is less than 80h then this is last block</LI></UL><br />
* file data - data read from file<br />
* checksum - see below for calculating<br />
<br />
=== Type 11 - Directory reference return ===<br />
<PRE><br />
1 1 24 1 2 1 1 bytes<br />
+--+--+--------+------+----+----+-----+<br />
&#124;11&#124;1c&#124;filename&#124;attrib&#124;size&#124;free&#124;cksum&#124;<br />
+--+--+--------+------+----+----+-----+</PRE><br />
<br />
* return - type 11h<br />
* length - length of data 1Ch (28 decimal)<br />
* filename - file name - if no name specied is 00H. If at end of directory is 00H.<br />
* attribute - not used<br />
* size - size of file<br />
* free - number of free sectors (multiply by 1280 for bytes)<br />
* checksum - see below for calculating<br />
<br />
=== Type 12 - Normal Return ===<br />
<PRE> 1 1 1 1 bytes<br />
+--+--+-----+-----+<br />
&#124;12&#124;01&#124;error&#124;cksum&#124;<br />
+--+--+-----+-----+</PRE><br />
<br />
* return - type 12h<br />
* length - length of data 01h<br />
* error code-<br />
<br />
{| WIDTH="100%" BORDER="1" <br />
| &nbsp;00 - normal (no error)<br />
| &nbsp;10 - file does not exist<br />
| &nbsp;11 - file exists<br />
|- <br />
| &nbsp;30 - no filename<br />
| &nbsp;31 - dir search error<br />
| &nbsp;35 - bank error<br />
|- <br />
| &nbsp;36 - parameter error<br />
| &nbsp;37 - open format mismatch<br />
| &nbsp;3f - end of file<br />
|- <br />
| &nbsp;40 - no start mark<br />
| &nbsp;41 - crc check error in ID<br />
| &nbsp;42 - sector length error<br />
|- <br />
| &nbsp;44 - format verify error<br />
| &nbsp;46 - format interruption<br />
| &nbsp;47 - erase offset error<br />
|- <br />
| &nbsp;49 - crc check error in data<br />
| &nbsp;4a - sector number error<br />
| &nbsp;4b - read data timeout<br />
|- <br />
| &nbsp;4d - sector number error<br />
| &nbsp;50 - disk write protect<br />
| &nbsp;5e - un-initilized disk<br />
|- <br />
| &nbsp;60 - directory full<br />
| &nbsp;61 - disk full<br />
| &nbsp;6e - file too long<br />
|- <br />
| &nbsp;70 - no disk<br />
| &nbsp;71 - disk change error<br />
| &nbsp;<br />
|}<br />
<br />
* checksum - see below for calculating<br />
<br />
=== Type 15 - Drive Condition Return ===<br />
<PRE><br />
1 1 1 1 bytes<br />
+--+--+---------+-----+<br />
&#124;15&#124;01&#124;condition&#124;cksum&#124;<br />
+--+--+---------+-----+</PRE><br />
<br />
* return - type 15h<br />
* length - length of data 01h<br />
* condition- bit values<br />
<br />
<PRE> 7 6 5 4 3 2 1 0 bit<br />
+-+-+-+-+-+-+-+-+<br />
MSB &#124;0&#124;0&#124;0&#124;0&#124;x&#124;x&#124;x&#124;x&#124; LSB<br />
+-+-+-+-+-+-+-+-+<br />
&#124; &#124; &#124; &#124;<br />
&#124; &#124; &#124; +--power (0=normal 1=low)<br />
&#124; &#124; +----write protect (0=not prot 1=prot)<br />
&#124; +------disk out (0=disk in 1=disk out)<br />
+--------disk change status (0=not changed 1=changed)</PRE><br />
* checksum - see below for calculating<br />
<br />
<H2>Sequence of Events</H2><br />
{| WIDTH="100%" <br />
| &nbsp;<I>Get directory</I><br />
| req 00 search form 01<BR><br />
req 00 search form 02 (repeat as needed)<br />
|- <br />
| &nbsp;<I>Write file</I><br />
| req 00 search form 00<BR><br />
req 01 mode 01 or 02<BR><br />
req 04 (repeat as needed)<BR><br />
req 02<br />
|- <br />
| &nbsp;<I>Read file</I><br />
| req 00 search form 00<BR><br />
req 01 mode 03<BR><br />
req 03 (repeat as needed)<BR><br />
req 02<br />
|- <br />
| &nbsp;<I>Rename file</I><br />
| req 00 search form 00<BR><br />
req 0d<br />
|- <br />
| &nbsp;<I>Delete file</I><br />
| &nbsp;req 00 search form 00<BR><br />
req 05<br />
|}<HR><br />
<br />
<H2>Calculating Checksum</H2><P>The check sum is &quot;the one's complement of the least significant byte of the number<br />
of bytes from the block format through the data block&quot;. Most people (me included)<br />
don't understand what that involves if you have to calculate it. Fortunately I found an<br />
example of how to do this and so I'm passing it on to you.</P><P>Checksum=(bytes MOD 256) XOR 255</P><P>where bytes = number of bytes including the Request Type, Length and all Data fields<br />
(but not including the preamble).</P><HR><H2>Using this Information</H2><P>A lot of the above commands can be set up in advance since there is no variable part to<br />
calculate. Some commands must have the length and checksum calculate as the data is built<br />
but the others don't. Here's how I set up some of the commands in my program:</P><br />
<br />
<pre><br />
Close$ = "ZZ"+Chr$(2)+Chr$(0)+Chr$(253)<br />
Dir1$ = "ZZ"+Chr$(0)+Chr$(26)+Space$(24)+"F"+Chr$(1)+Chr$(158)<br />
Dir2$ = "ZZ"+Chr$(0)+Chr$(26)+Space$(24)+"F"+Chr$(2)+Chr$(157)<br />
Status$ = "ZZ"+Chr$(7)+Chr$(0)+Chr$(248)+Chr$(13)<br />
Format$ = "ZZ"+Chr$(6)+Chr$(0)+Chr$(249)+Chr$(13)<br />
Erase$ = "ZZ"+Chr$(5)+Chr$(0)+Chr$(250)<br />
Seek$(1) = "ZZ"+Chr$(1)+Chr$(1)+Chr$(1)+Chr$(252)<br />
Seek$(2) = "ZZ"+Chr$(1)+Chr$(1)+Chr$(2)+Chr$(251)<br />
Seek$(3) = "ZZ"+Chr$(1)+Chr$(1)+Chr$(3)+Chr$(250)<br />
</pre><br />
<br />
<P>The above commands can be sent directly without any calculating to speed up your<br />
program. </P></div>
64.81.88.222
https://bitchin100.com/wiki/index.php?title=TPDD_Base_Protocol&diff=589
TPDD Base Protocol
2008-12-15T03:56:06Z
<p>64.81.88.222: </p>
<hr />
<div>== General Reference ==<br />
<br />
<UL><br />
<LI>Disks are single sided 3.5 inch standard disks</LI><br />
<LI>PDD1 - 40 tracks 2 sectors 1280 bytes/sector (100K/disk)</LI><br />
<LI>PDD2 - 80 tracks 2 sectors 1280 bytes/sector (200K/disk treated as two banks of 100k<br />
each)</LI><br />
<LI>Maximum file size = 64k. </LI><br />
<LI>Maximum number of directory entries (files) is 40 for PDD1 and 80 for PDD2.</LI><br />
<LI>File names are maximum 24 characters (padded with trailing blanks) although Tandy always<br />
used 6 for filename and 2 for filetype, with period seperator (i.e. XXXXXX.TT)</LI><br />
<LI>All communications with drive are at 19,200 bps. PDD1 has dip switches so this can drop<br />
to 9600bps. PDD2 is auto sensing down to 1200bps (??? - can anyone confirm this?).</LI><br />
</UL><br />
<br />
== Command Format ==<br />
<br />
All commands are in a request/return format (half-duplex)<br />
<br />
General request format:<br />
<br />
<BLOCKQUOTE><br />
<p><TT>preamble type length data checksum</TT></p><br />
</BLOCKQUOTE><br />
<br />
General return format:<br />
<br />
<BLOCKQUOTE><br />
<p><TT>type length data checksum</TT></p><br />
</BLOCKQUOTE><br />
<br />
== Command Type ==<br />
<br />
<P ALIGN="CENTER">(all values are in HEX)</P><br />
<br />
{| WIDTH="100%" BORDER="1" <br />
! &nbsp;command <br />
! &nbsp;request <br />
! &nbsp;return<br />
|- <br />
| &nbsp;directory ref <br />
| &nbsp;00<br />
| &nbsp;11 12<br />
|- <br />
| &nbsp;open file<br />
| &nbsp;01<br />
| &nbsp;12<br />
|- <br />
| &nbsp;close file<br />
| &nbsp;02<br />
| &nbsp;12<br />
|- <br />
| &nbsp;read file<br />
| &nbsp;03<br />
| &nbsp;10 12<br />
|- <br />
| &nbsp;write file<br />
| &nbsp;04<br />
| &nbsp;12<br />
|- <br />
| &nbsp;delete file<br />
| &nbsp;05<br />
| &nbsp;12<br />
|- <br />
| &nbsp;format disk<br />
| &nbsp;06 *<br />
| &nbsp;12<br />
|- <br />
| &nbsp;drive status<br />
| &nbsp;07 *<br />
| &nbsp;12<br />
|- <br />
| &nbsp;drive condition<br />
| &nbsp;0C *<br />
| &nbsp;15<br />
|- <br />
| &nbsp; rename file<br />
| &nbsp;0D<br />
| &nbsp;12<br />
|}<br />
<br />
<P>* PDD2 treats the disk as two banks of 100k each. All commands except these two must<br />
specify the bank number as part of the request. The above commands reference BANK 0. To<br />
reference BANK 1 you must add 40 HEX to these values (bit 6 = bank number). E.G. 'open<br />
file' becomes 41 for BANK 1.</P><br />
<br />
== Request Command details ==<br />
<br />
=== Type 00 - Directory Reference ===<br />
<br />
<PRE> 2 1 1 24 1 1 1 bytes<br />
+----+--+--+--------------+----------+------------+------+<br />
&#124;5a5a&#124;00&#124;1a&#124; filename &#124;attribute &#124;search form &#124;chksum&#124; <br />
+----+--+--+--------------+----------+------------+------+</PRE><br />
<br />
* Preamble - always 'ZZ'<br />
* request - type 00h*<br />
* length - length of data 1ah (26 decimal)<br />
* filename - padded with blanks<br />
* attribute - specify 'F' (not used normally)<br />
* search form<br />
<br />
<BLOCKQUOTE><br />
* 00h - reference file for open or delete<br />
* 01h - request first directory block<br />
* 02h - request next directory block<br />
* 03h - request previous directory block<br />
* 04h - end directory reference<br />
</BLOCKQUOTE><br />
<br />
checksum - see below for calculating<br />
<br />
=== Type 01 - Open file ===<br />
<br />
<PRE> 2 1 1 1 1 bytes<br />
+----+--+--+------+------+<br />
&#124;5a5a&#124;01&#124;01&#124; mode &#124;chksum&#124;<br />
+----+--+--+------+------+</PRE><br />
<br />
* Preamble - always 'ZZ'<br />
* request - type 01h<br />
* length - length of data 01h (1 decimal)<br />
* mode -<br />
<br />
<BLOCKQUOTE><br />
* 01h - open new file for WRITE<br />
* 02h - open existing file for APPEND<br />
* 03h - open existing file for READ<br />
</BLOCKQUOTE><br />
<br />
checksum - see below for calculating<br />
<br />
=== Type 02 - Close file ===<br />
<br />
<PRE> 2 1 1 1 bytes<br />
+----+--+--+------+<br />
&#124;5a5a&#124;02&#124;00&#124;chksum&#124;<br />
+----+--+--+------+</PRE><br />
<br />
* Preamble - always 'ZZ'<br />
* request - type 02h<br />
* length - length of data 00h (no data field)<br />
* checksum - see below for calculating<br />
<br />
=== Type 03 - Read file ===<br />
<br />
<PRE><br />
<pre> 2 1 1 1 bytes<br />
+----+--+--+------+<br />
&#124;5a5a&#124;03&#124;00&#124;chksum&#124;<br />
+----+--+--+------+</PRE><br />
<br />
* Preamble - always 'ZZ'<br />
* request - type 03h<br />
* length - length of data 00h (no data field)<br />
* checksum - see below for calculating<br />
<br />
=== Type 04 - Write file ===<br />
<br />
<PRE> 2 1 1 1-128 1 bytes<br />
+----+--+---+------+------+<br />
&#124;5a5a&#124;04&#124;01-&#124;data &#124;chksum&#124;<br />
&#124; &#124; &#124; 80&#124; &#124; &#124;<br />
+----+--+---+------+------+</PRE><br />
<br />
* Preamble - always 'ZZ'<br />
* requesr - type 04<br />
* length - length of data 01h-80h (actual length of data)<br />
* checksum - see below for calculating<br />
<br />
=== Type 05 - Delete file ===<br />
<br />
<PRE> 2 1 1 1 bytes<br />
+----+--+--+------+<br />
&#124;5a5a&#124;05&#124;00&#124;chksum&#124;<br />
+----+--+--+------+</PRE><br />
<br />
* Preamble - always 'ZZ'<br />
* request - type 05h<br />
* length - length of data 00h (no data field)<br />
* checksum - see below for calculating<br />
<br />
=== Type 06 - Format Disk ===<br />
<br />
<PRE> 2 1 1 1 bytes<br />
+----+--+--+------+<br />
&#124;5a5a&#124;06&#124;00&#124;chksum&#124;<br />
+----+--+--+------+</PRE><br />
<br />
* Preamble - always 'ZZ'<br />
* request - type 06h<br />
* length - length of data 00h (no data field)<br />
* checksum - see below for calculating<br />
<br />
=== Type 07 - Drive Status ===<br />
<PRE><br />
2 1 1 1 bytes<<br />
+----+--+--+------+<br />
&#124;5a5a&#124;07&#124;00&#124;chksum&#124;<br />
+----+--+--+------+</PRE><br />
<br />
* Preamble - always 'ZZ'<br />
* request - type 07h<br />
* length - length of data 00h (no data field)<br />
* checksum - see below for calculating<br />
<br />
=== Type 0C - Drive Condition ===<br />
<PRE><br />
2 1 1 1 bytes<br />
+----+--+--+------+<br />
&#124;5a5a&#124;0C&#124;00&#124;chksum&#124;<br />
+----+--+--+------+</PRE><br />
<br />
* Preamble - always 'ZZ'<br />
* request - type 0Ch<br />
* length - length of data 00h (no data field)<br />
* checksum - see below for calculating<br />
<br />
=== Type 0D - Rename file ===<br />
<PRE><br />
2 1 1 24 1 1 bytes<<br />
+----+--+--+-------+------+------+<br />
&#124;5a5a&#124;0D&#124;19&#124;newname&#124;attrib&#124;chksum&#124;<br />
+----+--+--+-------+------+------+</PRE><br />
<br />
* Preamble - always 'ZZ'<br />
* request - type 0D<br />
* length - length of data 19h (25 decimal)<br />
* newname - new name for the file<br />
* attribute- not used (specify 'F')<br />
* checksum - see below for calculating<br />
<br />
== Return Command Details ==<br />
=== Type 10 - Read file Return ===<br />
<PRE><br />
1 1 0-128 1 bytes<br />
+--+---+----------+-----+<br />
&#124;10&#124;00-&#124; file data&#124;cksum&#124;<br />
&#124; &#124; 80&#124; &#124;cksum&#124;<br />
+--+---+----------+-----+</PRE><br />
<br />
* return - type 10<br />
* length - length of data 00h-80h (0-128 decimal)<UL><LI>if length is equal to 80h there may be more data - you must issue another read command</LI><LI>if length is less than 80h then this is last block</LI></UL><br />
* file data - data read from file<br />
* checksum - see below for calculating<br />
<br />
=== Type 11 - Directory reference return ===<br />
<PRE><br />
1 1 24 1 2 1 1 bytes<br />
+--+--+--------+------+----+----+-----+<br />
&#124;11&#124;1c&#124;filename&#124;attrib&#124;size&#124;free&#124;cksum&#124;<br />
+--+--+--------+------+----+----+-----+</PRE><br />
<br />
* return - type 11h<br />
* length - length of data 1Ch (28 decimal)<br />
* filename - file name - if no name specied is 00H. If at end of directory is 00H.<br />
* attribute - not used<br />
* size - size of file<br />
* free - number of free sectors (multiply by 1280 for bytes)<br />
* checksum - see below for calculating<br />
<br />
=== Type 12 - Normal Return ===<br />
<PRE> 1 1 1 1 bytes<br />
+--+--+-----+-----+<br />
&#124;12&#124;01&#124;error&#124;cksum&#124;<br />
+--+--+-----+-----+</PRE><br />
<br />
* return - type 12h<br />
* length - length of data 01h<br />
* error code-<br />
<br />
{| WIDTH="100%" BORDER="1" <br />
| &nbsp;00 - normal (no error)<br />
| &nbsp;10 - file does not exist<br />
| &nbsp;11 - file exists<br />
|- <br />
| &nbsp;30 - no filename<br />
| &nbsp;31 - dir search error<br />
| &nbsp;35 - bank error<br />
|- <br />
| &nbsp;36 - parameter error<br />
| &nbsp;37 - open format mismatch<br />
| &nbsp;3f - end of file<br />
|- <br />
| &nbsp;40 - no start mark<br />
| &nbsp;41 - crc check error in ID<br />
| &nbsp;42 - sector length error<br />
|- <br />
| &nbsp;44 - format verify error<br />
| &nbsp;46 - format interruption<br />
| &nbsp;47 - erase offset error<br />
|- <br />
| &nbsp;49 - crc check error in data<br />
| &nbsp;4a - sector number error<br />
| &nbsp;4b - read data timeout<br />
|- <br />
| &nbsp;4d - sector number error<br />
| &nbsp;50 - disk write protect<br />
| &nbsp;5e - un-initilized disk<br />
|- <br />
| &nbsp;60 - directory full<br />
| &nbsp;61 - disk full<br />
| &nbsp;6e - file too long<br />
|- <br />
| &nbsp;70 - no disk<br />
| &nbsp;71 - disk change error<br />
| &nbsp;<br />
|}<br />
<br />
* checksum - see below for calculating<br />
<br />
=== Type 15 - Drive Condition Return ===<br />
<PRE><br />
1 1 1 1 bytes<br />
+--+--+---------+-----+<br />
&#124;15&#124;01&#124;condition&#124;cksum&#124;<br />
+--+--+---------+-----+</PRE><br />
<br />
* return - type 15h<br />
* length - length of data 01h<br />
* condition- bit values<br />
<br />
<PRE> 7 6 5 4 3 2 1 0 bit<br />
+-+-+-+-+-+-+-+-+<br />
MSB &#124;0&#124;0&#124;0&#124;0&#124;x&#124;x&#124;x&#124;x&#124; LSB<br />
+-+-+-+-+-+-+-+-+<br />
&#124; &#124; &#124; &#124;<br />
&#124; &#124; &#124; +--power (0=normal 1=low)<br />
&#124; &#124; +----write protect (0=not prot 1=prot)<br />
&#124; +------disk out (0=disk in 1=disk out)<br />
+--------disk change status (0=not changed 1=changed)</PRE><br />
* checksum - see below for calculating<br />
<br />
<H2>Sequence of Events</H2><br />
{| WIDTH="100%" <br />
| &nbsp;<I>Get directory</I><br />
| req 00 search form 01<BR><br />
req 00 search form 02 (repeat as needed)<br />
|- <br />
| &nbsp;<I>Write file</I><br />
| req 00 search form 00<BR><br />
req 01 mode 01 or 02<BR><br />
req 04 (repeat as needed)<BR><br />
req 02<br />
|- <br />
| &nbsp;<I>Read file</I><br />
| req 00 search form 00<BR><br />
req 01 mode 03<BR><br />
req 03 (repeat as needed)<BR><br />
req 02<br />
|- <br />
| &nbsp;<I>Rename file</I><br />
| req 00 search form 00<BR><br />
req 0d<br />
|- <br />
| &nbsp;<I>Delete file</I><br />
| &nbsp;req 00 search form 00<BR><br />
req 05<br />
|}<HR><br />
<br />
<H2>Calculating Checksum</H2><P>The check sum is &quot;the one's complement of the least significant byte of the number<br />
of bytes from the block format through the data block&quot;. Most people (me included)<br />
don't understand what that involves if you have to calculate it. Fortunately I found an<br />
example of how to do this and so I'm passing it on to you.</P><P>Checksum=(bytes MOD 256) XOR 255</P><P>where bytes = number of bytes including the Request Type, Length and all Data fields<br />
(but not including the preamble).</P><HR><H2>Using this Information</H2><P>A lot of the above commands can be set up in advance since there is no variable part to<br />
calculate. Some commands must have the length and checksum calculate as the data is built<br />
but the others don't. Here's how I set up some of the commands in my program:</P><br />
<br />
<pre><br />
Close$ = "ZZ&quot;+Chr$(2)+Chr$(0)+Chr$(253)<br />
Dir1$ = &quot;ZZ&quot;+Chr$(0)+Chr$(26)+Space$(24)+&quot;F&quot;+Chr$(1)+Chr$(158)<br />
Dir2$ = &quot;ZZ&quot;+Chr$(0)+Chr$(26)+Space$(24)+&quot;F&quot;+Chr$(2)+Chr$(157)<br />
Status$ = &quot;ZZ&quot;+Chr$(7)+Chr$(0)+Chr$(248)+Chr$(13)<br />
Format$ = &quot;ZZ&quot;+Chr$(6)+Chr$(0)+Chr$(249)+Chr$(13)<br />
Erase$ = &quot;ZZ&quot;+Chr$(5)+Chr$(0)+Chr$(250)<br />
Seek$(1) = &quot;ZZ&quot;+Chr$(1)+Chr$(1)+Chr$(1)+Chr$(252)<br />
Seek$(2) = &quot;ZZ&quot;+Chr$(1)+Chr$(1)+Chr$(2)+Chr$(251)<br />
Seek$(3) = &quot;ZZ&quot;+Chr$(1)+Chr$(1)+Chr$(3)+Chr$(250)<br />
</pre><br />
<br />
<P>The above commands can be sent directly without any calculating to speed up your<br />
program. </P></div>
64.81.88.222
https://bitchin100.com/wiki/index.php?title=TPDD_Base_Protocol&diff=588
TPDD Base Protocol
2008-12-15T03:55:21Z
<p>64.81.88.222: </p>
<hr />
<div>== General Reference ==<br />
<br />
<UL><br />
<LI>Disks are single sided 3.5 inch standard disks</LI><br />
<LI>PDD1 - 40 tracks 2 sectors 1280 bytes/sector (100K/disk)</LI><br />
<LI>PDD2 - 80 tracks 2 sectors 1280 bytes/sector (200K/disk treated as two banks of 100k<br />
each)</LI><br />
<LI>Maximum file size = 64k. </LI><br />
<LI>Maximum number of directory entries (files) is 40 for PDD1 and 80 for PDD2.</LI><br />
<LI>File names are maximum 24 characters (padded with trailing blanks) although Tandy always<br />
used 6 for filename and 2 for filetype, with period seperator (i.e. XXXXXX.TT)</LI><br />
<LI>All communications with drive are at 19,200 bps. PDD1 has dip switches so this can drop<br />
to 9600bps. PDD2 is auto sensing down to 1200bps (??? - can anyone confirm this?).</LI><br />
</UL><br />
<br />
== Command Format ==<br />
<br />
All commands are in a request/return format (half-duplex)<br />
<br />
General request format:<br />
<br />
<BLOCKQUOTE><br />
<p><TT>preamble type length data checksum</TT></p><br />
</BLOCKQUOTE><br />
<br />
General return format:<br />
<br />
<BLOCKQUOTE><br />
<p><TT>type length data checksum</TT></p><br />
</BLOCKQUOTE><br />
<br />
== Command Type ==<br />
<br />
<P ALIGN="CENTER">(all values are in HEX)</P><br />
<br />
{| WIDTH="100%" BORDER="1" <br />
! &nbsp;command <br />
! &nbsp;request <br />
! &nbsp;return<br />
|- <br />
| &nbsp;directory ref <br />
| &nbsp;00<br />
| &nbsp;11 12<br />
|- <br />
| &nbsp;open file<br />
| &nbsp;01<br />
| &nbsp;12<br />
|- <br />
| &nbsp;close file<br />
| &nbsp;02<br />
| &nbsp;12<br />
|- <br />
| &nbsp;read file<br />
| &nbsp;03<br />
| &nbsp;10 12<br />
|- <br />
| &nbsp;write file<br />
| &nbsp;04<br />
| &nbsp;12<br />
|- <br />
| &nbsp;delete file<br />
| &nbsp;05<br />
| &nbsp;12<br />
|- <br />
| &nbsp;format disk<br />
| &nbsp;06 *<br />
| &nbsp;12<br />
|- <br />
| &nbsp;drive status<br />
| &nbsp;07 *<br />
| &nbsp;12<br />
|- <br />
| &nbsp;drive condition<br />
| &nbsp;0C *<br />
| &nbsp;15<br />
|- <br />
| &nbsp; rename file<br />
| &nbsp;0D<br />
| &nbsp;12<br />
|}<br />
<br />
<P>* PDD2 treats the disk as two banks of 100k each. All commands except these two must<br />
specify the bank number as part of the request. The above commands reference BANK 0. To<br />
reference BANK 1 you must add 40 HEX to these values (bit 6 = bank number). E.G. 'open<br />
file' becomes 41 for BANK 1.</P><br />
<br />
== Request Command details ==<br />
<br />
=== Type 00 - Directory Reference ===<br />
<br />
<PRE> 2 1 1 24 1 1 1 bytes<br />
+----+--+--+--------------+----------+------------+------+<br />
&#124;5a5a&#124;00&#124;1a&#124; filename &#124;attribute &#124;search form &#124;chksum&#124; <br />
+----+--+--+--------------+----------+------------+------+</PRE><br />
<br />
* Preamble - always 'ZZ'<br />
* request - type 00h*<br />
* length - length of data 1ah (26 decimal)<br />
* filename - padded with blanks<br />
* attribute - specify 'F' (not used normally)<br />
* search form<br />
<br />
<BLOCKQUOTE><br />
* 00h - reference file for open or delete<br />
* 01h - request first directory block<br />
* 02h - request next directory block<br />
* 03h - request previous directory block<br />
* 04h - end directory reference<br />
</BLOCKQUOTE><br />
<br />
checksum - see below for calculating<br />
<br />
=== Type 01 - Open file ===<br />
<br />
<PRE> 2 1 1 1 1 bytes<br />
+----+--+--+------+------+<br />
&#124;5a5a&#124;01&#124;01&#124; mode &#124;chksum&#124;<br />
+----+--+--+------+------+</PRE><br />
<br />
* Preamble - always 'ZZ'<br />
* request - type 01h<br />
* length - length of data 01h (1 decimal)<br />
* mode -<br />
<br />
<BLOCKQUOTE><br />
* 01h - open new file for WRITE<br />
* 02h - open existing file for APPEND<br />
* 03h - open existing file for READ<br />
</BLOCKQUOTE><br />
<br />
checksum - see below for calculating<br />
<br />
=== Type 02 - Close file ===<br />
<br />
<PRE> 2 1 1 1 bytes<br />
+----+--+--+------+<br />
&#124;5a5a&#124;02&#124;00&#124;chksum&#124;<br />
+----+--+--+------+</PRE><br />
<br />
* Preamble - always 'ZZ'<br />
* request - type 02h<br />
* length - length of data 00h (no data field)<br />
* checksum - see below for calculating<br />
<br />
=== Type 03 - Read file ===<br />
<br />
<PRE><br />
<pre> 2 1 1 1 bytes<br />
+----+--+--+------+<br />
&#124;5a5a&#124;03&#124;00&#124;chksum&#124;<br />
+----+--+--+------+</PRE><br />
<br />
* Preamble - always 'ZZ'<br />
* request - type 03h<br />
* length - length of data 00h (no data field)<br />
* checksum - see below for calculating<br />
<br />
=== Type 04 - Write file ===<br />
<br />
<PRE> 2 1 1 1-128 1 bytes<br />
+----+--+---+------+------+<br />
&#124;5a5a&#124;04&#124;01-&#124;data &#124;chksum&#124;<br />
&#124; &#124; &#124; 80&#124; &#124; &#124;<br />
+----+--+---+------+------+</PRE><br />
<br />
* Preamble - always 'ZZ'<br />
* requesr - type 04<br />
* length - length of data 01h-80h (actual length of data)<br />
* checksum - see below for calculating<br />
<br />
=== Type 05 - Delete file ===<br />
<br />
<PRE> 2 1 1 1 bytes<br />
+----+--+--+------+<br />
&#124;5a5a&#124;05&#124;00&#124;chksum&#124;<br />
+----+--+--+------+</PRE><br />
<br />
* Preamble - always 'ZZ'<br />
* request - type 05h<br />
* length - length of data 00h (no data field)<br />
* checksum - see below for calculating<br />
<br />
=== Type 06 - Format Disk ===<br />
<br />
<PRE> 2 1 1 1 bytes<br />
+----+--+--+------+<br />
&#124;5a5a&#124;06&#124;00&#124;chksum&#124;<br />
+----+--+--+------+</PRE><br />
<br />
* Preamble - always 'ZZ'<br />
* request - type 06h<br />
* length - length of data 00h (no data field)<br />
* checksum - see below for calculating<br />
<br />
=== Type 07 - Drive Status ===<br />
<PRE><br />
2 1 1 1 bytes<<br />
+----+--+--+------+<br />
&#124;5a5a&#124;07&#124;00&#124;chksum&#124;<br />
+----+--+--+------+</PRE><br />
<br />
* Preamble - always 'ZZ'<br />
* request - type 07h<br />
* length - length of data 00h (no data field)<br />
* checksum - see below for calculating<br />
<br />
=== Type 0C - Drive Condition ===<br />
<PRE><br />
2 1 1 1 bytes<br />
+----+--+--+------+<br />
&#124;5a5a&#124;0C&#124;00&#124;chksum&#124;<br />
+----+--+--+------+</PRE><br />
<br />
* Preamble - always 'ZZ'<br />
* request - type 0Ch<br />
* length - length of data 00h (no data field)<br />
* checksum - see below for calculating<br />
<br />
=== Type 0D - Rename file ===<br />
<PRE><br />
2 1 1 24 1 1 bytes<<br />
+----+--+--+-------+------+------+<br />
&#124;5a5a&#124;0D&#124;19&#124;newname&#124;attrib&#124;chksum&#124;<br />
+----+--+--+-------+------+------+</PRE><br />
<br />
* Preamble - always 'ZZ'<br />
* request - type 0D<br />
* length - length of data 19h (25 decimal)<br />
* newname - new name for the file<br />
* attribute- not used (specify 'F')<br />
* checksum - see below for calculating<br />
<br />
== Return Command Details ==<br />
=== Type 10 - Read file Return ===<br />
<PRE><br />
1 1 0-128 1 bytes<br />
+--+---+----------+-----+<br />
&#124;10&#124;00-&#124; file data&#124;cksum&#124;<br />
&#124; &#124; 80&#124; &#124;cksum&#124;<br />
+--+---+----------+-----+</PRE><br />
<br />
* return - type 10<br />
* length - length of data 00h-80h (0-128 decimal)<UL><LI>if length is equal to 80h there may be more data - you must issue another read command</LI><LI>if length is less than 80h then this is last block</LI></UL><br />
* file data - data read from file<br />
* checksum - see below for calculating<br />
<br />
=== Type 11 - Directory reference return ===<br />
<PRE><br />
1 1 24 1 2 1 1 bytes<br />
+--+--+--------+------+----+----+-----+<br />
&#124;11&#124;1c&#124;filename&#124;attrib&#124;size&#124;free&#124;cksum&#124;<br />
+--+--+--------+------+----+----+-----+</PRE><br />
<br />
* return - type 11h<br />
* length - length of data 1Ch (28 decimal)<br />
* filename - file name - if no name specied is 00H. If at end of directory is 00H.<br />
* attribute - not used<br />
* size - size of file<br />
* free - number of free sectors (multiply by 1280 for bytes)<br />
* checksum - see below for calculating<br />
<br />
=== Type 12 - Normal Return ===<br />
<PRE> 1 1 1 1 bytes<br />
+--+--+-----+-----+<br />
&#124;12&#124;01&#124;error&#124;cksum&#124;<br />
+--+--+-----+-----+</PRE><br />
<br />
* return - type 12h<br />
* length - length of data 01h<br />
* error code-<br />
<br />
{| WIDTH="100%" BORDER="1" <br />
| &nbsp;00 - normal (no error)<br />
| &nbsp;10 - file does not exist<br />
| &nbsp;11 - file exists<br />
|- <br />
| &nbsp;30 - no filename<br />
| &nbsp;31 - dir search error<br />
| &nbsp;35 - bank error<br />
|- <br />
| &nbsp;36 - parameter error<br />
| &nbsp;37 - open format mismatch<br />
| &nbsp;3f - end of file<br />
|- <br />
| &nbsp;40 - no start mark<br />
| &nbsp;41 - crc check error in ID<br />
| &nbsp;42 - sector length error<br />
|- <br />
| &nbsp;44 - format verify error<br />
| &nbsp;46 - format interruption<br />
| &nbsp;47 - erase offset error<br />
|- <br />
| &nbsp;49 - crc check error in data<br />
| &nbsp;4a - sector number error<br />
| &nbsp;4b - read data timeout<br />
|- <br />
| &nbsp;4d - sector number error<br />
| &nbsp;50 - disk write protect<br />
| &nbsp;5e - un-initilized disk<br />
|- <br />
| &nbsp;60 - directory full<br />
| &nbsp;61 - disk full<br />
| &nbsp;6e - file too long<br />
|- <br />
| &nbsp;70 - no disk<br />
| &nbsp;71 - disk change error<br />
| &nbsp;<br />
|}<br />
<br />
* checksum - see below for calculating<br />
<br />
=== Type 15 - Drive Condition Return ===<br />
<PRE><br />
1 1 1 1 bytes<br />
+--+--+---------+-----+<br />
&#124;15&#124;01&#124;condition&#124;cksum&#124;<br />
+--+--+---------+-----+</PRE><br />
<br />
* return - type 15h<br />
* length - length of data 01h<br />
* condition- bit values<br />
<br />
<PRE> 7 6 5 4 3 2 1 0 bit<br />
+-+-+-+-+-+-+-+-+<br />
MSB &#124;0&#124;0&#124;0&#124;0&#124;x&#124;x&#124;x&#124;x&#124; LSB<br />
+-+-+-+-+-+-+-+-+<br />
&#124; &#124; &#124; &#124;<br />
&#124; &#124; &#124; +--power (0=normal 1=low)<br />
&#124; &#124; +----write protect (0=not prot 1=prot)<br />
&#124; +------disk out (0=disk in 1=disk out)<br />
+--------disk change status (0=not changed 1=changed)</PRE><br />
* checksum - see below for calculating<br />
<br />
<H2>Sequence of Events</H2><br />
{| WIDTH="100%" <br />
| &nbsp;<I>Get directory</I><br />
| req 00 search form 01<BR><br />
req 00 search form 02 (repeat as needed)<br />
|- <br />
| &nbsp;<I>Write file</I><br />
| req 00 search form 00<BR><br />
req 01 mode 01 or 02<BR><br />
req 04 (repeat as needed)<BR><br />
req 02<br />
|- <br />
| &nbsp;<I>Read file</I><br />
| req 00 search form 00<BR><br />
req 01 mode 03<BR><br />
req 03 (repeat as needed)<BR><br />
req 02<br />
|- <br />
| &nbsp;<I>Rename file</I><br />
| req 00 search form 00<BR><br />
req 0d<br />
|- <br />
| &nbsp;<I>Delete file</I><br />
| &nbsp;req 00 search form 00<BR><br />
req 05<br />
|}<HR><br />
<br />
<H2>Calculating Checksum</H2><P>The check sum is &quot;the one's complement of the least significant byte of the number<br />
of bytes from the block format through the data block&quot;. Most people (me included)<br />
don't understand what that involves if you have to calculate it. Fortunately I found an<br />
example of how to do this and so I'm passing it on to you.</P><P>Checksum=(bytes MOD 256) XOR 255</P><P>where bytes = number of bytes including the Request Type, Length and all Data fields<br />
(but not including the preamble).</P><HR><H2>Using this Information</H2><P>A lot of the above commands can be set up in advance since there is no variable part to<br />
calculate. Some commands must have the length and checksum calculate as the data is built<br />
but the others don't. Here's how I set up some of the commands in my program:</P><br />
<br />
<pre><br />
Close$ =&quot;ZZ&quot;+Chr$(2)+Chr$(0)+Chr$(253)<br />
Dir1$ =&quot;ZZ&quot;+Chr$(0)+Chr$(26)+Space$(24)+&quot;F&quot;+Chr$(1)+Chr$(158)<br />
Dir2$ =&quot;ZZ&quot;+Chr$(0)+Chr$(26)+Space$(24)+&quot;F&quot;+Chr$(2)+Chr$(157)<br />
Status$ =&quot;ZZ&quot;+Chr$(7)+Chr$(0)+Chr$(248)+Chr$(13)<br />
Format$ =&quot;ZZ&quot;+Chr$(6)+Chr$(0)+Chr$(249)+Chr$(13)<br />
Erase$ =&quot;ZZ&quot;+Chr$(5)+Chr$(0)+Chr$(250)<br />
Seek$(1)=&quot;ZZ&quot;+Chr$(1)+Chr$(1)+Chr$(1)+Chr$(252)<br />
Seek$(2)=&quot;ZZ&quot;+Chr$(1)+Chr$(1)+Chr$(2)+Chr$(251)<br />
Seek$(3)=&quot;ZZ&quot;+Chr$(1)+Chr$(1)+Chr$(3)+Chr$(250)<br />
</pre><br />
<br />
<P>The above commands can be sent directly without any calculating to speed up your<br />
program. </P></div>
64.81.88.222
https://bitchin100.com/wiki/index.php?title=TPDD_Base_Protocol&diff=587
TPDD Base Protocol
2008-12-15T03:54:44Z
<p>64.81.88.222: </p>
<hr />
<div>== General Reference ==<br />
<br />
<UL><br />
<LI>Disks are single sided 3.5 inch standard disks</LI><br />
<LI>PDD1 - 40 tracks 2 sectors 1280 bytes/sector (100K/disk)</LI><br />
<LI>PDD2 - 80 tracks 2 sectors 1280 bytes/sector (200K/disk treated as two banks of 100k<br />
each)</LI><br />
<LI>Maximum file size = 64k. </LI><br />
<LI>Maximum number of directory entries (files) is 40 for PDD1 and 80 for PDD2.</LI><br />
<LI>File names are maximum 24 characters (padded with trailing blanks) although Tandy always<br />
used 6 for filename and 2 for filetype, with period seperator (i.e. XXXXXX.TT)</LI><br />
<LI>All communications with drive are at 19,200 bps. PDD1 has dip switches so this can drop<br />
to 9600bps. PDD2 is auto sensing down to 1200bps (??? - can anyone confirm this?).</LI><br />
</UL><br />
<br />
== Command Format ==<br />
<br />
All commands are in a request/return format (half-duplex)<br />
<br />
General request format:<br />
<br />
<BLOCKQUOTE><br />
<p><TT>preamble type length data checksum</TT></p><br />
</BLOCKQUOTE><br />
<br />
General return format:<br />
<br />
<BLOCKQUOTE><br />
<p><TT>type length data checksum</TT></p><br />
</BLOCKQUOTE><br />
<br />
== Command Type ==<br />
<br />
<P ALIGN="CENTER">(all values are in HEX)</P><br />
<br />
{| WIDTH="100%" BORDER="1" <br />
! &nbsp;command <br />
! &nbsp;request <br />
! &nbsp;return<br />
|- <br />
| &nbsp;directory ref <br />
| &nbsp;00<br />
| &nbsp;11 12<br />
|- <br />
| &nbsp;open file<br />
| &nbsp;01<br />
| &nbsp;12<br />
|- <br />
| &nbsp;close file<br />
| &nbsp;02<br />
| &nbsp;12<br />
|- <br />
| &nbsp;read file<br />
| &nbsp;03<br />
| &nbsp;10 12<br />
|- <br />
| &nbsp;write file<br />
| &nbsp;04<br />
| &nbsp;12<br />
|- <br />
| &nbsp;delete file<br />
| &nbsp;05<br />
| &nbsp;12<br />
|- <br />
| &nbsp;format disk<br />
| &nbsp;06 *<br />
| &nbsp;12<br />
|- <br />
| &nbsp;drive status<br />
| &nbsp;07 *<br />
| &nbsp;12<br />
|- <br />
| &nbsp;drive condition<br />
| &nbsp;0C *<br />
| &nbsp;15<br />
|- <br />
| &nbsp; rename file<br />
| &nbsp;0D<br />
| &nbsp;12<br />
|}<br />
<br />
<P>* PDD2 treats the disk as two banks of 100k each. All commands except these two must<br />
specify the bank number as part of the request. The above commands reference BANK 0. To<br />
reference BANK 1 you must add 40 HEX to these values (bit 6 = bank number). E.G. 'open<br />
file' becomes 41 for BANK 1.</P><br />
<br />
== Request Command details ==<br />
<br />
=== Type 00 - Directory Reference ===<br />
<br />
<PRE> 2 1 1 24 1 1 1 bytes<br />
+----+--+--+--------------+----------+------------+------+<br />
&#124;5a5a&#124;00&#124;1a&#124; filename &#124;attribute &#124;search form &#124;chksum&#124; <br />
+----+--+--+--------------+----------+------------+------+</PRE><br />
<br />
* Preamble - always 'ZZ'<br />
* request - type 00h*<br />
* length - length of data 1ah (26 decimal)<br />
* filename - padded with blanks<br />
* attribute - specify 'F' (not used normally)<br />
* search form<br />
<br />
<BLOCKQUOTE><br />
* 00h - reference file for open or delete<br />
* 01h - request first directory block<br />
* 02h - request next directory block<br />
* 03h - request previous directory block<br />
* 04h - end directory reference<br />
</BLOCKQUOTE><br />
<br />
checksum - see below for calculating<br />
<br />
=== Type 01 - Open file ===<br />
<br />
<PRE> 2 1 1 1 1 bytes<br />
+----+--+--+------+------+<br />
&#124;5a5a&#124;01&#124;01&#124; mode &#124;chksum&#124;<br />
+----+--+--+------+------+</PRE><br />
<br />
* Preamble - always 'ZZ'<br />
* request - type 01h<br />
* length - length of data 01h (1 decimal)<br />
* mode -<br />
<br />
<BLOCKQUOTE><br />
* 01h - open new file for WRITE<br />
* 02h - open existing file for APPEND<br />
* 03h - open existing file for READ<br />
</BLOCKQUOTE><br />
<br />
checksum - see below for calculating<br />
<br />
=== Type 02 - Close file ===<br />
<br />
<PRE> 2 1 1 1 bytes<br />
+----+--+--+------+<br />
&#124;5a5a&#124;02&#124;00&#124;chksum&#124;<br />
+----+--+--+------+</PRE><br />
<br />
* Preamble - always 'ZZ'<br />
* request - type 02h<br />
* length - length of data 00h (no data field)<br />
* checksum - see below for calculating<br />
<br />
=== Type 03 - Read file ===<br />
<br />
<PRE><br />
<pre> 2 1 1 1 bytes<br />
+----+--+--+------+<br />
&#124;5a5a&#124;03&#124;00&#124;chksum&#124;<br />
+----+--+--+------+</PRE><br />
<br />
* Preamble - always 'ZZ'<br />
* request - type 03h<br />
* length - length of data 00h (no data field)<br />
* checksum - see below for calculating<br />
<br />
=== Type 04 - Write file ===<br />
<br />
<PRE> 2 1 1 1-128 1 bytes<br />
+----+--+---+------+------+<br />
&#124;5a5a&#124;04&#124;01-&#124;data &#124;chksum&#124;<br />
&#124; &#124; &#124; 80&#124; &#124; &#124;<br />
+----+--+---+------+------+</PRE><br />
<br />
* Preamble - always 'ZZ'<br />
* requesr - type 04<br />
* length - length of data 01h-80h (actual length of data)<br />
* checksum - see below for calculating<br />
<br />
=== Type 05 - Delete file ===<br />
<br />
<PRE> 2 1 1 1 bytes<br />
+----+--+--+------+<br />
&#124;5a5a&#124;05&#124;00&#124;chksum&#124;<br />
+----+--+--+------+</PRE><br />
<br />
* Preamble - always 'ZZ'<br />
* request - type 05h<br />
* length - length of data 00h (no data field)<br />
* checksum - see below for calculating<br />
<br />
=== Type 06 - Format Disk ===<br />
<br />
<PRE> 2 1 1 1 bytes<br />
+----+--+--+------+<br />
&#124;5a5a&#124;06&#124;00&#124;chksum&#124;<br />
+----+--+--+------+</PRE><br />
<br />
* Preamble - always 'ZZ'<br />
* request - type 06h<br />
* length - length of data 00h (no data field)<br />
* checksum - see below for calculating<br />
<br />
=== Type 07 - Drive Status ===<br />
<PRE><br />
2 1 1 1 bytes<<br />
+----+--+--+------+<br />
&#124;5a5a&#124;07&#124;00&#124;chksum&#124;<br />
+----+--+--+------+</PRE><br />
<br />
* Preamble - always 'ZZ'<br />
* request - type 07h<br />
* length - length of data 00h (no data field)<br />
* checksum - see below for calculating<br />
<br />
=== Type 0C - Drive Condition ===<br />
<PRE><br />
2 1 1 1 bytes<br />
+----+--+--+------+<br />
&#124;5a5a&#124;0C&#124;00&#124;chksum&#124;<br />
+----+--+--+------+</PRE><br />
<br />
* Preamble - always 'ZZ'<br />
* request - type 0Ch<br />
* length - length of data 00h (no data field)<br />
* checksum - see below for calculating<br />
<br />
=== Type 0D - Rename file ===<br />
<PRE><br />
2 1 1 24 1 1 bytes<<br />
+----+--+--+-------+------+------+<br />
&#124;5a5a&#124;0D&#124;19&#124;newname&#124;attrib&#124;chksum&#124;<br />
+----+--+--+-------+------+------+</PRE><br />
<br />
* Preamble - always 'ZZ'<br />
* request - type 0D<br />
* length - length of data 19h (25 decimal)<br />
* newname - new name for the file<br />
* attribute- not used (specify 'F')<br />
* checksum - see below for calculating<br />
<br />
== Return Command Details ==<br />
=== Type 10 - Read file Return ===<br />
<PRE><br />
1 1 0-128 1 bytes<br />
+--+---+----------+-----+<br />
&#124;10&#124;00-&#124; file data&#124;cksum&#124;<br />
&#124; &#124; 80&#124; &#124;cksum&#124;<br />
+--+---+----------+-----+</PRE><br />
<br />
* return - type 10<br />
* length - length of data 00h-80h (0-128 decimal)<UL><LI>if length is equal to 80h there may be more data - you must issue another read command</LI><LI>if length is less than 80h then this is last block</LI></UL><br />
* file data - data read from file<br />
* checksum - see below for calculating<br />
<br />
=== Type 11 - Directory reference return ===<br />
<PRE><br />
1 1 24 1 2 1 1 bytes<br />
+--+--+--------+------+----+----+-----+<br />
&#124;11&#124;1c&#124;filename&#124;attrib&#124;size&#124;free&#124;cksum&#124;<br />
+--+--+--------+------+----+----+-----+</PRE><br />
<br />
* return - type 11h<br />
* length - length of data 1Ch (28 decimal)<br />
* filename - file name - if no name specied is 00H. If at end of directory is 00H.<br />
* attribute - not used<br />
* size - size of file<br />
* free - number of free sectors (multiply by 1280 for bytes)<br />
* checksum - see below for calculating<br />
<br />
=== Type 12 - Normal Return ===<br />
<PRE> 1 1 1 1 bytes<br />
+--+--+-----+-----+<br />
&#124;12&#124;01&#124;error&#124;cksum&#124;<br />
+--+--+-----+-----+</PRE><br />
<br />
* return - type 12h<br />
* length - length of data 01h<br />
* error code-<br />
<br />
{| WIDTH="100%" BORDER="1" <br />
| &nbsp;00 - normal (no error)<br />
| &nbsp;10 - file does not exist<br />
| &nbsp;11 - file exists<br />
|- <br />
| &nbsp;30 - no filename<br />
| &nbsp;31 - dir search error<br />
| &nbsp;35 - bank error<br />
|- <br />
| &nbsp;36 - parameter error<br />
| &nbsp;37 - open format mismatch<br />
| &nbsp;3f - end of file<br />
|- <br />
| &nbsp;40 - no start mark<br />
| &nbsp;41 - crc check error in ID<br />
| &nbsp;42 - sector length error<br />
|- <br />
| &nbsp;44 - format verify error<br />
| &nbsp;46 - format interruption<br />
| &nbsp;47 - erase offset error<br />
|- <br />
| &nbsp;49 - crc check error in data<br />
| &nbsp;4a - sector number error<br />
| &nbsp;4b - read data timeout<br />
|- <br />
| &nbsp;4d - sector number error<br />
| &nbsp;50 - disk write protect<br />
| &nbsp;5e - un-initilized disk<br />
|- <br />
| &nbsp;60 - directory full<br />
| &nbsp;61 - disk full<br />
| &nbsp;6e - file too long<br />
|- <br />
| &nbsp;70 - no disk<br />
| &nbsp;71 - disk change error<br />
| &nbsp;<br />
|}<br />
<br />
* checksum - see below for calculating<br />
<br />
=== Type 15 - Drive Condition Return ===<br />
<PRE><br />
1 1 1 1 bytes<br />
+--+--+---------+-----+<br />
&#124;15&#124;01&#124;condition&#124;cksum&#124;<br />
+--+--+---------+-----+</PRE><br />
<br />
* return - type 15h<br />
* length - length of data 01h<br />
* condition- bit values<br />
<br />
<PRE> 7 6 5 4 3 2 1 0 bit<br />
+-+-+-+-+-+-+-+-+<br />
MSB &#124;0&#124;0&#124;0&#124;0&#124;x&#124;x&#124;x&#124;x&#124; LSB<br />
+-+-+-+-+-+-+-+-+<br />
&#124; &#124; &#124; &#124;<br />
&#124; &#124; &#124; +--power (0=normal 1=low)<br />
&#124; &#124; +----write protect (0=not prot 1=prot)<br />
&#124; +------disk out (0=disk in 1=disk out)<br />
+--------disk change status (0=not changed 1=changed)</PRE><br />
* checksum - see below for calculating<br />
<br />
<H2>Sequence of Events</H2><br />
{| WIDTH="100%" <br />
| &nbsp;<I>Get directory</I><br />
| req 00 search form 01<BR><br />
req 00 search form 02 (repeat as needed)<br />
|- <br />
| &nbsp;<I>Write file</I><br />
| req 00 search form 00<BR><br />
req 01 mode 01 or 02<BR><br />
req 04 (repeat as needed)<BR><br />
req 02<br />
|- <br />
| &nbsp;<I>Read file</I><br />
| req 00 search form 00<BR><br />
req 01 mode 03<BR><br />
req 03 (repeat as needed)<BR><br />
req 02<br />
|- <br />
| &nbsp;<I>Rename file</I><br />
| req 00 search form 00<BR><br />
req 0d<br />
|- <br />
| &nbsp;<I>Delete file</I><br />
| &nbsp;req 00 search form 00<BR><br />
req 05<br />
|}<HR><br />
<br />
<H2>Calculating Checksum</H2><P>The check sum is &quot;the one's complement of the least significant byte of the number<br />
of bytes from the block format through the data block&quot;. Most people (me included)<br />
don't understand what that involves if you have to calculate it. Fortunately I found an<br />
example of how to do this and so I'm passing it on to you.</P><P>Checksum=(bytes MOD 256) XOR 255</P><P>where bytes = number of bytes including the Request Type, Length and all Data fields<br />
(but not including the preamble).</P><HR><H2>Using this Information</H2><P>A lot of the above commands can be set up in advance since there is no variable part to<br />
calculate. Some commands must have the length and checksum calculate as the data is built<br />
but the others don't. Here's how I set up some of the commands in my program:</P><br />
<br />
<pre><br />
Close$=&quot;ZZ&quot;+Chr$(2)+Chr$(0)+Chr$(253)<br />
Dir1$=&quot;ZZ&quot;+Chr$(0)+Chr$(26)+Space$(24)+&quot;F&quot;+Chr$(1)+Chr$(158)<br />
Dir2$=&quot;ZZ&quot;+Chr$(0)+Chr$(26)+Space$(24)+&quot;F&quot;+Chr$(2)+Chr$(157)<br />
Status$=&quot;ZZ&quot;+Chr$(7)+Chr$(0)+Chr$(248)+Chr$(13)<br />
Format$=&quot;ZZ&quot;+Chr$(6)+Chr$(0)+Chr$(249)+Chr$(13)<br />
Erase$=&quot;ZZ&quot;+Chr$(5)+Chr$(0)+Chr$(250)<br />
Seek$(1)=&quot;ZZ&quot;+Chr$(1)+Chr$(1)+Chr$(1)+Chr$(252)<br />
Seek$(2)=&quot;ZZ&quot;+Chr$(1)+Chr$(1)+Chr$(2)+Chr$(251)<br />
Seek$(3)=&quot;ZZ&quot;+Chr$(1)+Chr$(1)+Chr$(3)+Chr$(250)<br />
</pre><br />
<br />
<P>The above commands can be sent directly without any calculating to speed up your<br />
program. </P></div>
64.81.88.222
https://bitchin100.com/wiki/index.php?title=TPDD_Base_Protocol&diff=586
TPDD Base Protocol
2008-12-15T03:51:20Z
<p>64.81.88.222: </p>
<hr />
<div>== General Reference ==<br />
<br />
<UL><br />
<LI>Disks are single sided 3.5 inch standard disks</LI><br />
<LI>PDD1 - 40 tracks 2 sectors 1280 bytes/sector (100K/disk)</LI><br />
<LI>PDD2 - 80 tracks 2 sectors 1280 bytes/sector (200K/disk treated as two banks of 100k<br />
each)</LI><br />
<LI>Maximum file size = 64k. </LI><br />
<LI>Maximum number of directory entries (files) is 40 for PDD1 and 80 for PDD2.</LI><br />
<LI>File names are maximum 24 characters (padded with trailing blanks) although Tandy always<br />
used 6 for filename and 2 for filetype, with period seperator (i.e. XXXXXX.TT)</LI><br />
<LI>All communications with drive are at 19,200 bps. PDD1 has dip switches so this can drop<br />
to 9600bps. PDD2 is auto sensing down to 1200bps (??? - can anyone confirm this?).</LI><br />
</UL><br />
<br />
== Command Format ==<br />
<br />
All commands are in a request/return format (half-duplex)<br />
<br />
General request format:<br />
<br />
<BLOCKQUOTE><br />
<p><TT>preamble type length data checksum</TT></p><br />
</BLOCKQUOTE><br />
<br />
General return format:<br />
<br />
<BLOCKQUOTE><br />
<p><TT>type length data checksum</TT></p><br />
</BLOCKQUOTE><br />
<br />
== Command Type ==<br />
<br />
<P ALIGN="CENTER">(all values are in HEX)</P><br />
<br />
{| WIDTH="100%" BORDER="1" <br />
! &nbsp;command <br />
! &nbsp;request <br />
! &nbsp;return<br />
|- <br />
| &nbsp;directory ref <br />
| &nbsp;00<br />
| &nbsp;11 12<br />
|- <br />
| &nbsp;open file<br />
| &nbsp;01<br />
| &nbsp;12<br />
|- <br />
| &nbsp;close file<br />
| &nbsp;02<br />
| &nbsp;12<br />
|- <br />
| &nbsp;read file<br />
| &nbsp;03<br />
| &nbsp;10 12<br />
|- <br />
| &nbsp;write file<br />
| &nbsp;04<br />
| &nbsp;12<br />
|- <br />
| &nbsp;delete file<br />
| &nbsp;05<br />
| &nbsp;12<br />
|- <br />
| &nbsp;format disk<br />
| &nbsp;06 *<br />
| &nbsp;12<br />
|- <br />
| &nbsp;drive status<br />
| &nbsp;07 *<br />
| &nbsp;12<br />
|- <br />
| &nbsp;drive condition<br />
| &nbsp;0C *<br />
| &nbsp;15<br />
|- <br />
| &nbsp; rename file<br />
| &nbsp;0D<br />
| &nbsp;12<br />
|}<br />
<br />
<P>* PDD2 treats the disk as two banks of 100k each. All commands except these two must<br />
specify the bank number as part of the request. The above commands reference BANK 0. To<br />
reference BANK 1 you must add 40 HEX to these values (bit 6 = bank number). E.G. 'open<br />
file' becomes 41 for BANK 1.</P><br />
<br />
== Request Command details ==<br />
<br />
=== Type 00 - Directory Reference ===<br />
<br />
<PRE> 2 1 1 24 1 1 1 bytes<br />
+----+--+--+--------------+----------+------------+------+<br />
&#124;5a5a&#124;00&#124;1a&#124; filename &#124;attribute &#124;search form &#124;chksum&#124; <br />
+----+--+--+--------------+----------+------------+------+</PRE><br />
<br />
* Preamble - always 'ZZ'<br />
* request - type 00h*<br />
* length - length of data 1ah (26 decimal)<br />
* filename - padded with blanks<br />
* attribute - specify 'F' (not used normally)<br />
* search form<br />
<br />
<BLOCKQUOTE><br />
* 00h - reference file for open or delete<br />
* 01h - request first directory block<br />
* 02h - request next directory block<br />
* 03h - request previous directory block<br />
* 04h - end directory reference<br />
</BLOCKQUOTE><br />
<br />
checksum - see below for calculating<br />
<br />
=== Type 01 - Open file ===<br />
<br />
<PRE> 2 1 1 1 1 bytes<br />
+----+--+--+------+------+<br />
&#124;5a5a&#124;01&#124;01&#124; mode &#124;chksum&#124;<br />
+----+--+--+------+------+</PRE><br />
<br />
* Preamble - always 'ZZ'<br />
* request - type 01h<br />
* length - length of data 01h (1 decimal)<br />
* mode -<br />
<br />
<BLOCKQUOTE><br />
* 01h - open new file for WRITE<br />
* 02h - open existing file for APPEND<br />
* 03h - open existing file for READ<br />
</BLOCKQUOTE><br />
<br />
checksum - see below for calculating<br />
<br />
=== Type 02 - Close file ===<br />
<br />
<PRE> 2 1 1 1 bytes<br />
+----+--+--+------+<br />
&#124;5a5a&#124;02&#124;00&#124;chksum&#124;<br />
+----+--+--+------+</PRE><br />
<br />
* Preamble - always 'ZZ'<br />
* request - type 02h<br />
* length - length of data 00h (no data field)<br />
* checksum - see below for calculating<br />
<br />
=== Type 03 - Read file ===<br />
<br />
<PRE><br />
<pre> 2 1 1 1 bytes<br />
+----+--+--+------+<br />
&#124;5a5a&#124;03&#124;00&#124;chksum&#124;<br />
+----+--+--+------+</PRE><br />
<br />
* Preamble - always 'ZZ'<br />
* request - type 03h<br />
* length - length of data 00h (no data field)<br />
* checksum - see below for calculating<br />
<br />
=== Type 04 - Write file ===<br />
<br />
<PRE> 2 1 1 1-128 1 bytes<br />
+----+--+---+------+------+<br />
&#124;5a5a&#124;04&#124;01-&#124;data &#124;chksum&#124;<br />
&#124; &#124; &#124; 80&#124; &#124; &#124;<br />
+----+--+---+------+------+</PRE><br />
<br />
* Preamble - always 'ZZ'<br />
* requesr - type 04<br />
* length - length of data 01h-80h (actual length of data)<br />
* checksum - see below for calculating<br />
<br />
=== Type 05 - Delete file ===<br />
<br />
<PRE> 2 1 1 1 bytes<br />
+----+--+--+------+<br />
&#124;5a5a&#124;05&#124;00&#124;chksum&#124;<br />
+----+--+--+------+</PRE><br />
<br />
* Preamble - always 'ZZ'<br />
* request - type 05h<br />
* length - length of data 00h (no data field)<br />
* checksum - see below for calculating<br />
<br />
=== Type 06 - Format Disk ===<br />
<br />
<PRE> 2 1 1 1 bytes<br />
+----+--+--+------+<br />
&#124;5a5a&#124;06&#124;00&#124;chksum&#124;<br />
+----+--+--+------+</PRE><br />
<br />
* Preamble - always 'ZZ'<br />
* request - type 06h<br />
* length - length of data 00h (no data field)<br />
* checksum - see below for calculating<br />
<br />
=== Type 07 - Drive Status ===<br />
<PRE><br />
2 1 1 1 bytes<<br />
+----+--+--+------+<br />
&#124;5a5a&#124;07&#124;00&#124;chksum&#124;<br />
+----+--+--+------+</PRE><br />
<br />
* Preamble - always 'ZZ'<br />
* request - type 07h<br />
* length - length of data 00h (no data field)<br />
* checksum - see below for calculating<br />
<br />
=== Type 0C - Drive Condition ===<br />
<PRE><br />
2 1 1 1 bytes<br />
+----+--+--+------+<br />
&#124;5a5a&#124;0C&#124;00&#124;chksum&#124;<br />
+----+--+--+------+</PRE><br />
<br />
* Preamble - always 'ZZ'<br />
* request - type 0Ch<br />
* length - length of data 00h (no data field)<br />
* checksum - see below for calculating<br />
<br />
=== Type 0D - Rename file ===<br />
<PRE><br />
2 1 1 24 1 1 bytes<<br />
+----+--+--+-------+------+------+<br />
&#124;5a5a&#124;0D&#124;19&#124;newname&#124;attrib&#124;chksum&#124;<br />
+----+--+--+-------+------+------+</PRE><br />
<br />
* Preamble - always 'ZZ'<br />
* request - type 0D<br />
* length - length of data 19h (25 decimal)<br />
* newname - new name for the file<br />
* attribute- not used (specify 'F')<br />
* checksum - see below for calculating<br />
<br />
== Return Command Details ==<br />
=== Type 10 - Read file Return ===<br />
<PRE><br />
1 1 0-128 1 bytes<br />
+--+---+----------+-----+<br />
&#124;10&#124;00-&#124; file data&#124;cksum&#124;<br />
&#124; &#124; 80&#124; &#124;cksum&#124;<br />
+--+---+----------+-----+</PRE><br />
<br />
* return - type 10<br />
* length - length of data 00h-80h (0-128 decimal)<UL><LI>if length is equal to 80h there may be more data - you must issue another read command</LI><LI>if length is less than 80h then this is last block</LI></UL><br />
* file data - data read from file<br />
* checksum - see below for calculating<br />
<br />
=== Type 11 - Directory reference return ===<br />
<PRE><br />
1 1 24 1 2 1 1 bytes<br />
+--+--+--------+------+----+----+-----+<br />
&#124;11&#124;1c&#124;filename&#124;attrib&#124;size&#124;free&#124;cksum&#124;<br />
+--+--+--------+------+----+----+-----+</PRE><br />
<br />
* return - type 11h<br />
* length - length of data 1Ch (28 decimal)<br />
* filename - file name - if no name specied is 00H. If at end of directory is 00H.<br />
* attribute - not used<br />
* size - size of file<br />
* free - number of free sectors (multiply by 1280 for bytes)<br />
* checksum - see below for calculating<br />
<br />
=== Type 12 - Normal Return ===<br />
<PRE> 1 1 1 1 bytes<br />
+--+--+-----+-----+<br />
&#124;12&#124;01&#124;error&#124;cksum&#124;<br />
+--+--+-----+-----+</PRE><br />
<br />
* return - type 12h<br />
* length - length of data 01h<br />
* error code-<br />
<br />
{| WIDTH="100%" BORDER="1" <br />
| &nbsp;00 - normal (no error)<br />
| &nbsp;10 - file does not exist<br />
| &nbsp;11 - file exists<br />
|- <br />
| &nbsp;30 - no filename<br />
| &nbsp;31 - dir search error<br />
| &nbsp;35 - bank error<br />
|- <br />
| &nbsp;36 - parameter error<br />
| &nbsp;37 - open format mismatch<br />
| &nbsp;3f - end of file<br />
|- <br />
| &nbsp;40 - no start mark<br />
| &nbsp;41 - crc check error in ID<br />
| &nbsp;42 - sector length error<br />
|- <br />
| &nbsp;44 - format verify error<br />
| &nbsp;46 - format interruption<br />
| &nbsp;47 - erase offset error<br />
|- <br />
| &nbsp;49 - crc check error in data<br />
| &nbsp;4a - sector number error<br />
| &nbsp;4b - read data timeout<br />
|- <br />
| &nbsp;4d - sector number error<br />
| &nbsp;50 - disk write protect<br />
| &nbsp;5e - un-initilized disk<br />
|- <br />
| &nbsp;60 - directory full<br />
| &nbsp;61 - disk full<br />
| &nbsp;6e - file too long<br />
|- <br />
| &nbsp;70 - no disk<br />
| &nbsp;71 - disk change error<br />
| &nbsp;<br />
|}<br />
<br />
* checksum - see below for calculating<br />
<br />
=== Type 15 - Drive Condition Return ===<br />
<PRE><br />
1 1 1 1 bytes<br />
+--+--+---------+-----+<br />
&#124;15&#124;01&#124;condition&#124;cksum&#124;<br />
+--+--+---------+-----+</PRE><br />
<br />
* return - type 15h<br />
* length - length of data 01h<br />
* condition- bit values<br />
<br />
<PRE> 7 6 5 4 3 2 1 0 bit<br />
+-+-+-+-+-+-+-+-+<br />
MSB &#124;0&#124;0&#124;0&#124;0&#124;x&#124;x&#124;x&#124;x&#124; LSB<br />
+-+-+-+-+-+-+-+-+<br />
&#124; &#124; &#124; &#124;<br />
&#124; &#124; &#124; +--power (0=normal 1=low)<br />
&#124; &#124; +----write protect (0=not prot 1=prot)<br />
&#124; +------disk out (0=disk in 1=disk out)<br />
+--------disk change status (0=not changed 1=changed)</PRE><br />
* checksum - see below for calculating<br />
<br />
<H2>Sequence of Events</H2><br />
{| WIDTH="100%" <br />
| &nbsp;<I>Get directory</I><br />
| req 00 search form 01<BR><br />
req 00 search form 02 (repeat as needed)<br />
|- <br />
| &nbsp;<I>Write file</I><br />
| req 00 search form 00<BR><br />
req 01 mode 01 or 02<BR><br />
req 04 (repeat as needed)<BR><br />
req 02<br />
|- <br />
| &nbsp;<I>Read file</I><br />
| req 00 search form 00<BR><br />
req 01 mode 03<BR><br />
req 03 (repeat as needed)<BR><br />
req 02<br />
|- <br />
| &nbsp;<I>Rename file</I><br />
| req 00 search form 00<BR><br />
req 0d<br />
|- <br />
| &nbsp;<I>Delete file</I><br />
| &nbsp;req 00 search form 00<BR><br />
req 05<br />
|}<HR><br />
<br />
<H2>Calculating Checksum</H2><P>The check sum is &quot;the one's complement of the least significant byte of the number<br />
of bytes from the block format through the data block&quot;. Most people (me included)<br />
don't understand what that involves if you have to calculate it. Fortunately I found an<br />
example of how to do this and so I'm passing it on to you.</P><P>Checksum=(bytes MOD 256) XOR 255</P><P>where bytes = number of bytes including the Request Type, Length and all Data fields<br />
(but not including the preamble).</P><HR><H2>Using this Information</H2><P>A lot of the above commands can be set up in advance since there is no variable part to<br />
calculate. Some commands must have the length and checksum calculate as the data is built<br />
but the others don't. Here's how I set up some of the commands in my program:</P><br />
<br />
<pre><br />
<P><FONT FACE="Arial"><FONT SIZE="-1">Close$=&quot;ZZ&quot;+Chr$(2)+Chr$(0)+Chr$(253)</FONT><BR><FONT SIZE="-1">Dir1$=&quot;ZZ&quot;+Chr$(0)+Chr$(26)+Space$(24)+&quot;F&quot;+Chr$(1)+Chr$(158)</FONT><BR><FONT SIZE="-1">Dir2$=&quot;ZZ&quot;+Chr$(0)+Chr$(26)+Space$(24)+&quot;F&quot;+Chr$(2)+Chr$(157)</FONT><BR><FONT SIZE="-1">Status$=&quot;ZZ&quot;+Chr$(7)+Chr$(0)+Chr$(248)+Chr$(13)</FONT><BR><FONT SIZE="-1">Format$=&quot;ZZ&quot;+Chr$(6)+Chr$(0)+Chr$(249)+Chr$(13)<BR><br />
Erase$=&quot;ZZ&quot;+Chr$(5)+Chr$(0)+Chr$(250)</FONT><BR><FONT SIZE="-1">Seek$(1)=&quot;ZZ&quot;+Chr$(1)+Chr$(1)+Chr$(1)+Chr$(252)</FONT><BR><FONT SIZE="-1">Seek$(2)=&quot;ZZ&quot;+Chr$(1)+Chr$(1)+Chr$(2)+Chr$(251)</FONT><BR><FONT SIZE="-1">Seek$(3)=&quot;ZZ&quot;+Chr$(1)+Chr$(1)+Chr$(3)+Chr$(250)</FONT></FONT></P><br />
</pre><br />
<br />
<P>The above commands can be sent directly without any calculating to speed up your<br />
program. </P></div>
64.81.88.222
https://bitchin100.com/wiki/index.php?title=TPDD_Protocol&diff=585
TPDD Protocol
2008-12-13T09:35:19Z
<p>64.81.88.222: </p>
<hr />
<div>[[Base Protocol]]<br />
<br />
[[Desklink/TS-DOS Directory Access]]</div>
64.81.88.222
https://bitchin100.com/wiki/index.php?title=TPDD_Protocol&diff=584
TPDD Protocol
2008-12-13T09:35:06Z
<p>64.81.88.222: </p>
<hr />
<div>[[Base Protocol]]<br />
[[Desklink/TS-DOS Directory Access]]</div>
64.81.88.222