Documentation for the "transmit" program. A program to download binary files from a PC to the memory of the Microlab at speeds of around 4-5kB/s. It involves typing a small (90 bytes) bootstrap program into the microlab in order to download a larger transfer program. It is based on an assembler and download program I wrote for the Amiga in Amos Pro a LONG time ago (when the Microlab came out). I decided to rewrite the program in C so I could use the assembler on both my PC running Linux and on my Amiga without the effort of using Amos Pro. This program uses "port.h" by damianf@wpi.edu This program will only work on Linux as it uses ioperm. If anybody gets it working on another system I'd be interested to see how they did it. WARNING: This involves an electrical connection between the parallel port of a PC and the IO ports on the microlab. Bad things will happen if you do it wrong. First, make up a cable. PC Parallel Microlab 34-way =========== =============== Gnd (20) Gnd (11, 12, 27 or 28) Strobe (1) porta_0 (20) Busy (12) porta_1 (14) Data 0 (2) portb_0 (33) Data 1 (3) portb_1 (30) Data 2 (4) portb_2 (32) Data 3 (5) portb_3 (34) Data 4 (6) portb_4 (25) Data 5 (7) portb_5 (29) Data 6 (8) portb_6 (31) Data 7 (9) portb_7 (23) You may consider putting current limiting resistors of around 220-470 ohms on each line to protect the port. I haven't found a need for this and nothing's exploded yet... Now you'll need to get the small bootstrap program onto the Microlab. Here it is assembled to be put at address 0x200: $0200: 4C 30 02 AD $0204: 41 80 29 01 $0208: C9 01 D0 F7 $020C: 60 A9 02 8D $0210: 41 80 AD 41 $0214: 80 29 01 C9 $0218: 00 D0 F7 A9 $021C: 00 8D 41 80 $0220: 60 A9 02 8D $0224: 43 80 A9 00 $0228: 8D 42 80 A2 $022C: 00 A0 00 60 $0230: 20 21 02 A2 $0234: 05 20 03 02 $0238: 20 0D 02 CA $023C: D0 F7 20 03 $0240: 02 AD 40 80 $0244: 91 90 18 A5 $0248: 90 69 01 85 $024C: 90 A5 91 69 $0250: 00 85 91 20 $0254: 0D 02 4C 3E $0258: 02 00 FF FF If you already have something there and want to move it to a different address you will have to reassemble it. assemble -d -a
receive-small.asm This will produce a hex dump similar to the one above. Once you've typed this program into the Microlab, the next step is to download the full version of the receive program into the Microlab. 1. Edit "receive.asm" and change the ORG to where you want to program to be put. 2. Assemble using "assemble -o receive.asm". This will assemble the program at the address in the ORG statement and write out the binary to . 3. Tell the Microlab where to put the receive program. The address is stored in locations 0x90 and 0x91 LSB first. To download to address 0x300, location 0x90 will hold 0x00 and location 0x91 will hold 0x03. 4. Start the receive program on the microlab 5. Transmit the full program to the Microlab using "transmit
". This should print up some messages to let you know if it's working or not. 6. Stop the program on the Microlab and try to run the newly downloaded full version of the program. With the full version you don't need to enter the destination address into locations 0x90 and 0x91 as these are transmitted along with the code. If you're REALLY interesting in how it works then just read the code, there's not much of it! Basically, the program sends a dummy byte, then the start and end addresses, and then the code as a sequential series of bytes. I haven't had to include error checking or anything difficult like that because I've never had a transfer go wrong yet. Dave.