The Digital Equipment Corporation PDP-8Paper Tape Instructions
Part of
the PDP-8 Programmer's Reference Manual
|
This document describes the high speed paper-tape reader-punch interface of the PDP-8, including the PC8E (M840) interface for the Omnibus machines (the PDP-8/E,F,M and A) as well as earlier models. The IOmec (Digitronics) 9602-1 interface is an extension of this.
Note: Most of these registers are accessed via the accumulator; such registers are illustrated as their contents appears when loaded in the accumulator.
00 01 02 03 04 05 06 07 08 09 10 11 ___________________________________ | 0| 0| 0| 0| | | | | | | | | |__|__|__|__|__|__|__|__|__|__|__|__| | | | | Unused | Keyboard Buffer |The reader buffer register holds the character most recently read from the paper tape. While a character is being read, the contents of this register are unpredictable.
00 01 02 03 04 05 06 07 08 09 10 11 ___________________________________ | | | | | | | | | | | | | |__|__|__|__|__|__|__|__|__|__|__|__| | | | | Ignored | Keyboard Buffer |The punch buffer register holds the character that is to be punched on tape. Modifying this register while it is being used to generate output may produce unpredictable results.
00 01 02 03 04 05 06 07 08 09 10 11 ___________________________________ | | | | | | | | | | | | | |__|__|__|__|__|__|__|__|__|__|__|__| | | | | | | Ignored |RE FE D |This register is only present in the IOmec paper-tape interface. The register is set to zero on reset, and can be ignored for most IOmec readers. The 3 bits are:
00 01 02 03 04 05 06 07 08 09 10 11 ___________________________________ | 1| 1| 0| 0| 0| 0| 0| x| x| | | | |__|__|__|__|__|__|__|__|__|__|__|__| | | | | | IOT | Device | Op |The high-speed paper-tape reader/punch is always connected as devices 01 and 02.
RPE
The interrupt enable bit is set. This is not supported by the interfaces on PDP-8 models prior to the PDP-8/E, and thus should be avoided in portable code.
RSF
If the reader flag is set, indicating that input data is ready, the next instruction in sequence is skipped. All PDP-8 reader interfaces support this operation.
RRB
The reader buffer is ored with the accumulator. All PDP-8 paper tape interfaces support this operation. This instruction also clears the reader flag.
For pre-omnibus DEC reader interfaces, this was a never used microcoded combination of RRB and RSF. For DEC's PC8E interface, it was undefined. IOmec stole this combination and used it to load a command from the accumulator into the reader's command register.
RFC
Clear the reader flag and initiate the reading of the next character from tape. The reader flag will be set by the completion of the read operation. All PDP-8 paper tape interfaces support this operation.
For pre-omnibus DEC reader interfaces, this was a rarely used microcoded combination of RFC and RSF. For DEC's PC8E interface, it was undefined. IOmec stole this combination and used it to skip the next instruciton in sequence if the end-of-tape flag was set.
RRB RFC
The reader buffer is ored to the accumulator, the reader flag is cleared,
and the read of the next character is initiated.
This operation is documented as a microcoded combination of RRB
and RFC
; but in the PC8E interface, it is decoded as a distinct
operation. All PDP-8 paper tape interfaces support this operation.
For pre-omnibus DEC reader interfaces, this was a never used microcoded combination of RFC, RRB and RSF. For DEC's PC8E interface, it was undefined. IOmec stole this combination and used it to clear the end-of-tape flag.
PCE
The interrupt enable bit is reset. This is not supported by the interfaces on PDP-8 models prior to the PDP-8/E, and thus should be avoided in portable code.
PSF
If the punch flag is set, indicating output is complete, the next instruction in sequence is skipped. All PDP-8 punch interfaces support this operation.
PCF
The punch flag is reset. All PDP-8 paper tape interfaces support this operation.
PPC
The least significant 8-bits of the accumulator is copied to the punch buffer, initiating output. All PDP-8 paper tape interfaces support this operation.
PLS
The least significant 8 bits of the accumulator are copied to the punch buffer,
initiating output, and the punch flag is reset.
This operation is a microcoded combination of PCF
and
PPC
; but in the PC8E interface, it is decoded as a distinct
operation. All PDP-8 paper tape interfaces support this operation.
RSF= 6011 / Reader Skip if Flag RRB= 6012 / Read Reader Buffer RFC= 6014 / Reader Flag Clear PSF= 6021 / Punch Skip if Flag PCF= 6022 / Punch Clear Flag PPC= 6024 / Punch Put Character PLS= 6026 / Punch Load Sequence
One problem with the design of the punch interface is that the punch flag, like all device flags, is cleared on reset and powerup, but for many purposes, it would be better to have this flag set, indicating that, at startup time, the punch buffer register is ready to receive one character of output. The traditional startup code accomplishes this by outputting a null, since, on input, nulls are usually expected as leader:
/ initialize the punch for output CLA PPC / output nullGiven this initialization, the following two subroutines (or variations on them) are commonly used in most PDP-8 programs for polled paper tape input-output:
PTRIN, .-. /Read from paper tape reader / returns character in ac PTRLP, RSF / await input ready JMP PTRLP CLA RRB RFC / read character JMP I PTRIN PTPOUT, .-. /Write to paper tape punch / given character in ac PTPLP, PSF / await input ready JMP PTPLP PLS / write character JMP I PTPOUT