Paper tape drive reader

221 views
Skip to first unread message

Despondent

unread,
Feb 16, 2018, 7:16:58 PM2/16/18
to Altair-Duino
I've been doing some online research into paper tape readers, and i found a design that uses a Parallax Propeller Activity Board... The code for it seems to use a comma and a space to send the data to a terminal... First off, is it even possible to attach a physical drive device to the simulator? I saw that someone wired a Pi up to the arduino for "input/output", but there wasn't really any specifics

Tom Wilson

unread,
Feb 16, 2018, 9:07:51 PM2/16/18
to Altair-Duino
You’d probably have to wire something to the serial port, and you might need to modify the boot loader or the emulator to match up the port numbers. It sounds like a fun project.

Tom Wilson

unread,
Feb 18, 2018, 10:54:27 PM2/18/18
to Altair-Duino
Okay, so looking around a little bit, I have some suggestions.

If you are using the USB port to connect your PC to the Arduino, you should have at least one of the serial ports available. In that case, you should be able to wire up a second Arduino to one of the paper tape readers I'm seeing out there. However, I'm not sure yet how the tape bootloader works, whether it can just read from an input port, or whether you'd need to modify the software. It shouldn't be that hard to do, since these things are usually pretty simple machine code programs.

Here's a link I found to simulating a paper tape reader with TeraTerm. This will work with any terminal, so it should be a matter of disassembling the loader to see what the code actually looks like.
https://www.solivant.com/altair_bootloaders/index.php?album=altair_bootloaders&pagen=1

You've got me curious now; I'm going to enter the code on that page into altair32 and look at it in the debugger to see what it does.

Tom Wilson

unread,
Feb 19, 2018, 1:16:52 AM2/19/18
to Altair-Duino
All right, so here's my disassembly and analysis of two different paper tape booloaders. The first is 
one I find in every place instructions are given for loading from tape. The second is from the 
instructions in the Altairduino documentation. 

1 MVI A,03h ; Load 3 into A register
2 OUT 10h ; and send that to port 10h.
3 MVI A,15h ; load 15h into A
4 OUT 10h         ; and send that. 
5 LXI H,0FAEh     ; Load 0FAEh into the memory pointer. 
; (M is H and L combined as a 16 bit value)
6 LXI SP,001Ah    ; Set the stack pointer to 1Ah. That's the DCX B instruction below.
7 IN 10h          ; Read from the same port... again 
8 RRC             ; Rotate right (moves all bits right 1 position, aka divide by 2)
9 RNC ; If even number, goes back up to line 6.
10 IN 11h ; read from port 11h... not sure what 11 is yet.
11 CMP L ; Checks the just-read data against the L register (AEh)
12 RZ ; Go to line 6 if values match.
13 DCR L ; Reduces memory counter by 1.
15 MOV M,A ; Sets memory address 0FADh with what we read from port 11h.
15 RNZ ; Jumps to line 6 and repeat until memory counter is 0F00h. 
16 PCHL ; Sets the program counter with the value in HL (0F00h by now)
17 0Bh 00h ; this memory place holds the value 0B00h, or 000B as a 16-bit number

So as far as I can tell without watching this in operation, the program attempts to read 
from ports 10h and 11h to pull data from the tape. The DCR L statement implies that the
data is loaded in reverse order - from top to bottom. This will start at memory location 
0FAEh and read down to 0F00h. 

Finally, the PCHL statement jumps to address 0F00h and executes the program loaded from tape. 

There are a couple things I don't get yet. The IN, followed by RRC and RNC are interesting. 
This basically reads from the port, then checks to see if the value read is an even number (or 0).
If the value is even, then it reads from port 11 and saves it.

The other  thing going on is the Compare in line 10. The tape file appears to have AE bytes
at the beginning, so this skips the repeating "AE" values, then reads "AE" actual bytes, then 
jumps to that program in order to finish loading the actual program. 



And here's the paper tape loader from the altairduino documentation:
1 LXI H,0FAEh ; Set the starting location to 0FAEh. Same as the first loader 
2 LXI SP,0012h ; Set the stack pointer to 12h (line 2)
3 IN 00h ; Read from port 0
4 RRC ; Rotate right one
5 RC ; Jumps to location 12h if the data we just read
; is 0 (or another even value)
6 IN 01h ; Read from port 1
7 CMP L ; Compared what we just read to L (AEh)
8 RZ ; If they match, jump to line 2 
9 DCR L ; Count down in our memory pointer 
10 MOV M,A ; Store the read data in memory
12 RNZ ; Jumps to line 2 if L is not zero
13      PCHL ; Jump to 0F00h (L must be zero to get here)
14 03h 00h ; Address 3, the opcode starting in line 2. 

Again, we see the program reading from two different ports (00 and 01 in this case), the
Decrement L - the bottom half of the memory pointer, and jumping to the 
final value of M, which will be 0F00h. 

So my guess is that if you want to load paper tapes from an external reader, you'll need
to modify the address in line 3 and line 6 to match the ports you're using. Since 
I haven't figured out what the port numbers are for the serial port yet, I'll have to 
come back with that info in a future message. 
Message has been deleted

Tom Wilson

unread,
Feb 19, 2018, 1:34:34 AM2/19/18
to Altair-Duino
Weird. Tom Lake posted a reply, but I can’t find it now.

Short version is this... there’s an analysis here that matches what I found:
https://www.solivant.com/altair_bootloaders/index.php?album=altair_bootloaders&pagen=1

Also, the lead-in is different for different programs, as I suspected. As the size of the second stage loader changed, so did the lead in value. So you would also have to change the 0FAEh value to match the lead-in for the specific tape you are loading.

Finally, the left 8 switches are the “sense” switches are are often used to configure programs during boot-up. You will probably need to set those to the correct value for the particular bootloader to make it use the serial port you plan on using.

That’s all I got for now. I’ll have more as I dig into the serial port addressing and figure out what IO port addresses are being used by Altairduino.

Despondent

unread,
Feb 19, 2018, 8:29:15 PM2/19/18
to Altair-Duino
Interesting. Thanks.

Bill Carson

unread,
Mar 4, 2018, 12:02:44 PM3/4/18
to Altair-Duino
I would love to be able to interface one of these.
http://www.swtpc.com/mholley/OAE80_Reader/OAE80_Index.htm

It would be quite easy to design a 3D printed base to mount the guide wires and opto diodes. What I don’t know about is how you could interface the device. Whilst I am taken with the idea of the Altair-Duino, at some point the blinkenlights won’t be as important to me as getting things talking via an 8 bit data bus. Would it be possible to reassign the data led pins to inputs, maybe via one of the Aux switches ?

Bill

Tom Wilson

unread,
Mar 4, 2018, 3:01:23 PM3/4/18
to Altair-Duino
What you need is a second Arduno. That will be your parallel to serial converter. You can wire the UART pins from that unit to the pins on your Altairduino.

Randy

unread,
Mar 4, 2018, 6:35:21 PM3/4/18
to Altair-Duino

Randy

unread,
Mar 4, 2018, 8:03:22 PM3/4/18
to Altair-Duino
And to quote a certain Maker whose kits we all seem to like from a recent article. “I’m looking at recreating an Altair 680, a Kenbak-1 (I almost have that finished) and a recreation of the OAE OP-80A paper tape reader kit,”.

Bill Carson

unread,
Mar 4, 2018, 8:18:50 PM3/4/18
to Altair-Duino
Thanks Tom second Arduino makes the most sense.

Tom Wilson

unread,
Mar 4, 2018, 10:36:11 PM3/4/18
to Altair-Duino
Let me know if you need help with the software. I’ve already torn apart the paper tape bootloader, so it should be straightforward to build a program to read the pins from the tape reader and output them as byte data.

My only real concern is the data rate on the Altairduino. It can get laggy trying to read from the serial ports, so we’d probwbly have to buffer the data from the tape reader. In fact, it might be smartest to buffer the data coming in on the tape reader, then spool it back out at a steady pace. Adding a “record” and “play” button shouldn’t be hard.

Bill Carson

unread,
Mar 5, 2018, 1:53:21 AM3/5/18
to Altair-Duino
Be nice to add further Ardunios in a S-100 style.
Reply all
Reply to author
Forward
0 new messages