Today I located the DEC RIM for the PDP8. Still being a novice at DEC programming, I took some time figuring out how it worked. It reads a paper tape and deposits the information to memory. There are three parts to the tape, the leader, the information and the trailer. The leader and trailer allow getting the TTY and the computer to operate together. The leader and trailer are all the same 200 Octal and there are a bunch of them, 20 or 30, more if more time is needed to get the computer started. The 200 Octal punches the 8th channel (MSB) of the paper tape. The first segment of the DEC RIM loader reads the tape and deciphers whether it is reading the leader/trailer or information to be entered into memory. So basically, this program segment checks the MSB of what is read and if it is a ONE, it is the leader or trailer.
Address Code Instr Explanation
7756 6032 KCC Clear Key Flag, Clear AC
7757 6031 KSF Skip on Key Flag
7760 5357 JMP Wait on Key Flag
7761 6036 KRB Read Key Buffer & Clear Key Flag
BIT 0 1 2 3 4 5 6 7 8 9 10 11
AC= 0 0 0 0 8 7 6 5 4 3 2 1 Channel bits
Leader bit^ ^ A1, D1 A2, D2
Data = 0 Address = 1 | A3, D3 A4, D4
The accumulator (AC4-AC11) will be filled with the channel bits from the paper tape read.
AC4 will have Channel 8 bit which is the leader/trailer bit. If AC4 is set to ONE the read is either leader or trailer. If AC4 is ZERO then the read is information.
AC5 is the Data or Address bit, Data = ZERO & Address = ONE
AC6,7,8 is either A1, D1 or A3, D3
AC9,10,11 is either A3, D3 or A4, D4
7762 7106 CLL, RTL Clear LINK & Rotate AC and LINK left twice
L0 = ZERO
L1 = 1 BIT 2 3 4 5 6 7 8 9 10 11 L0 0
AC= 0 0 8 7 6 5 4 3 2 1 0 0 Channel bits
7763 7006 RTL
L1 = 1
L2 = 3 BIT 4 5 6 7 8 9 10 11 L0 0 L1 2
AC= 8 7 6 5 4 3 2 1 0 0 0 0 Channel bits
The leader/trailer bit is now in the MSB of the accumulator, also considered the sign bit. If the sign bit = ONE then the number is negative.
7764 7510 SPA SKIP on positive Accumulator. If Sign bit =1
then continue to read leader. If sign bit =0
then begin to process information.
7765 5357 JMP loop until leader is complete
When the program gets to address 7766, the leader has past and the information that is to be deposited into memory is at hand. The first byte of non leader will fall through the 7765 jump here. The information is formatted as two bytes of address information followed by two bytes of data information. This is continued until the trailer begins.
7766 7006 RTL Rotate AC and LINK left twice
L2 = 3
L3 = 5 BIT 6 7 8 9 10 11 L0 0 L1 2 L2 4
AC= 6 5 4 3 2 1 0 0 0 0 0 0 Channel bits
Now bit 5 is in the LINK. This bit tells whether the information is DATA (=0) or and ADDRESS (=1). Since this is the first non leader information it will be an address so the LINK = 1. The 6 MSBits of the accumulator have A1 and A2 address information. Which is the high half of the first address to save Data information into.
7767 6031 KSF SKIP on Key Flag
7770 5367 JMP Wait until the 2nd byte of info is received
7771 6034 KRS Get info and OR it with AC4-AC11 do not clear
Accumulator
A3 A4
BIT 0 0 0 0 8 7 6 5 4 3 2 1 2nd Addr byte
AC= 6 5 4 3 2 1 0 0 0 0 0 0 Channel bits
A1 A2
The 2nd address bit, #8 is the leader bit, which is now zero. Each second address byte on the paper tape has channel 7 = ZERO. The first address byte has Channel 7 was a ONE. These two numbers are OR'd. The result now in the accumulator is the complete address A1,A2,A3,A4.
7772 7420 SNL SKIP if LINK is not ZERO. This time we have
an address, so LINK = 1 Go to 7774
7773 3776 DCA Indirect store & clear AC. Use the address
that is in 7776 to store DATA.
7774 3376 DCA Direct store & clear AC. Store Address
directly into 7776.
7775 5356 JMP Continue, jump back to beginning
7776 0000 Storage
The program then jumps back to the beginning to get the next 2 bytes of information or trailer. The information is formatted as two bytes of Address followed by two bytes of Data. Each byte has the 2 MSB's as leader bit and Address/Data bit. Then two Octal numbers, 6 bits or information.
Te next time through the program, the two data bytes are retrieved. This time the LINK will be a ZERO and the SNL in address 7772 will not SKIP and the first DCA will take the address stored in 7776 and use it to store the Data D1,D2,D3,D4 there.
I made a paper tape with the TTY Echo program on it.
Leader
200
200
... 20-30 leader bytes
200
200
100 1st address --- 01 (Address) 000=A1, 000=A2
000 000=A3, 000=A4 The start address of the saved data is 0000 Octal
060 1st Data --- 00 (Data) 110=D1, 000=D2
032 011=D3, 010=D4 The data to be saved at 0000 is 6032
100 2nd address --- 01 (Address) 000=A1, 000=A2
001 000=A3, 001=A4
060 2nd Data --- 00 (Data) 110=D1, 000=D2
031 011=D3, 001=D4
100 3rd address --- 01 (Address) 000=A1, 000=A2
002 000=A3, 002=A4
050 3rd Data --- 00 (Data) 101=D1, 000=D2
001 000=D3, 001=D4
100 4th address --- 01 (Address) 000=A1, 000=A2
003 000=A3, 003=A4
060 4th Data --- 00 (Data) 110=D1, 000=D2
036 011=D3, 110=D4
100 5th address --- 01 (Address) 000=A1, 000=A2
004 000=A3, 004=A4
060 5th Data --- 00 (Data) 110=D1, 000=D2
046 100=D3, 110=D4
100 6th address --- 01 (Address) 000=A1, 000=A2
005 000=A3, 005=A4
060 6th Data --- 00 (Data) 110=D1, 000=D2
041 100=D3, 001=D4
100 7th address --- 01 (Address) 000=A1, 000=A2
006 000=A3, 006=A4
050 7th Data --- 00 (Data) 101=D1, 000=D2
005 000=D3, 101=D4
100 8th address --- 01 (Address) 000=A1, 000=A2
007 000=A3, 007=A4
050 8th Data --- 00 (Data) 101=D1, 000=D2
001 000=D3, 001=D4
Trailer
200
200
... 20-30 trailer bytes
200
200
This exercise helped me become more familiar with the DEC instructions. I add it here for anyone else who may be interested. By the way it works. Thanks Mike