PDP-12 User's Manual

CHAPTER 3
LINC MODE PROGRAMMING

Section VI. LINCTAPE

The basic LINCtape system consists of two TU55 transports controlled by a fully- buffered subprocessor. A single ten-channel tape head serves for both reading and writing. Information is redundantly recorded; one line of tape contains five bits, each recorded in two non-adjacent channels, as shown in Figure 3-16. Three bits are actual data; the other two provide control information for the tape processor. The Timing Track determines the position of each recorded line. Four lines are required to accommodate a full 12-bit word; the corresponding Mark Track code identifies the nature of the data word. The recording technique and tape layout are described in detail in the PDP-12 Maintenance Manual.

ORGANIZATION OF DATA

On a standard-format LINCtape, information is recorded in blocks of 256 12-bit words each, with identifying data at each end of the block. One LINCtape reel has a capacity of 512 standard blocks, a total of 131,072 words of data.

                INTERBLOCK
                   ZONE  /-------- 512 BLOCKS ------\
                   \   \/                            \
       +------------+--+---------+---+-- --+---------+---+------------+
FULL   |            |  |         | I |     |         | I |            |
TAPE   |  END ZONE  |  | 1 BLOCK | B | ... | 1 BLOCK | B |  END ZONE  |
       |            |  |         | Z |     |         | Z |            |
       +------------+--+---------+---+-- --+---------+---+------------+
       \           /
        About 5 feet

       ++-----+----+---+----------------------+----+---+---+-----+-----+
ONE    ||INTER|    |   |                      |    |   |   |     |     |
BLOCK  ||BLOCK| BN | G |       DATA           | CS | C | C | RBN | IBZ |
       ||ZONE |    |   |                      |    |   |   |     |     |
       ++-----+----+---+----------------------+----+---+---+-----+-----+
  Words -> 5    1    1        256                1   1   1    1     5



                         ---+---+---+---+---+-----
ONE      Data Channel 1 ->  | 0 | 1 | 2 | 3 |
DATA     Data Channel 2 ->  | 4 | 5 | 6 | 7 |
WORD     Data Channel 3 ->  | 8 | 9 |10 |11 |
                         ---+---+---+---+---+-----
                              |
                              +-- Bit Location

                  <------- Tape Direction Forward --------------
Figure 3-16. LINCtape Format

The organization of a tape is schematically presented in Figure 3-16. At each end of the tape is a long End Zone which allows the transport to reverse direction or come to rest without pulling the tape off the reel. Between the end zones and the terminal blocks, and between blocks, are Interblock Zones which can be sensed by the LINC instruction IBZ. An interblock zone is 5 words long.

A block consists of 256 data words preceded and followed by control and identifying information, as shown in the second drawing in Figure 3-16.

Block Number (BN) -
This identifies the block. On a standard LINCtape, block numbers are sequential, from 0000 through 0777(8).

Guard Word (G) -
This protects the Block Number from transients when the read/write current is turned on and off, and allows time for the tape processor to switch from Search to Read or Write modes.

Data Words -
This is the information recorded on tape from core memory. The Final Data Word is specially identified, to signal the end of the block. When writing a tape, this signal conditions the processor to write the checksum in the next word position.

Checksum (CS) -
This is the 2's-complement (of the 12-bit sum of all the data words in the block plus the constant 7777(8)).The result of adding the data sum to the checksum should be 0000; this provides a check (hence the name) on the accuracy of the transmission.

Check Words (C) -
These are dummy words whose Mark Track code is the same as that for the Checksum. They are provided to insure that the Write current will be turned off before the Reverse Block Number is encountered. The Guard and Check words are not of general interest to the programmer except as they affect timing.

Reverse Block Number (RBN) -
This is the complement of the Block Number, and identifies the block when tape is being searched in the reverse direction.

Subprocessor

The LINCtape subprocessor controls all information transfer between memory and tape. It is fully buffered; once an operation has been initiated by a LINC mode instruction, it is carried to completion by the tape processor. The central processor may either wait until the tape transfer is complete, or proceed immediately after the tape instruction has begun, testing at some later time for completion of the operation.

Transfers are effected in either Standard or Extended modes. In Standard mode, transfers are made to and from fixed memory locations. Extended Operations provide for a flexible addressing facility, program interrupt, and additional tape units.

As can be seen in Figure 3-17, the tape subprocessor contains seven registers which provide the transmission path for data and for control information.

Data Path

Read/Write Buffer (RWB) 12 Bits -
When reading, the four lines of a data word are assembled in this register, in the bit positions shown in the third drawing of Figure 3-16. When writing, the contents of the RWB are disassembled and written on four consecutive lines of tape. Essentially, the RWB is a three- section shift register, with the three bits of a tape line entering (or leaving) the register at four- bit intervals, as indicated by the arrows in Figure 3-17.

Tape Buffer (TB) 12 Bits -
When reading, the assembled word is transferred from the RWB to the TB, and from there sent to the MB in the central processor. On writing, the direction is reversed. Information from the MB enters the TB, and from there is placed in the RWB for disassembly onto the tape.

Tape Accumulator (TAC) 12 Bits -
As each data word is read or written, the data sum is accumulated in the TAC. On reading, this sum is added to the Checksum read from tape, to determine whether the transfer was completed accurately. On writing, the data sum is complemented when the final data word signal is received, and the resulting Checksum is written in the word position following the final data word. The contents of the TAC can be brought into the central processor AC, using the LINC mode TAC instruction. In searching operations, the TAC also holds the sum of the desired block number and the last block number read from tape.

Control Registers

In Standard mode operations, these registers are automatically set up; in Extended Operations, the program must set the XOB and TMA Setup Register.

Tape Block Number (TBN) 12 Bits -
This contains the number of the block to be accessed in a data transfer. As the tape is searched, the Block Number read from tape is compared with that in the TBN; when the numbers match, the tape is positioned so that the transfer can begin. During group operations, the TBN contains the first block number of the tape to be accessed.

[ GIF image of Figure 3-17 ]

Figure 3-17. LINCtape Processor Information Paths

Tape Memory Address (TMA) 12 Bits -
This contains the address of the memory location to or from which the data is being transferred. In extended address mode, TMA is loaded from the TMA Setup Register at the start of transmission; in Standard mode, the MBLK and TBLK information in the second tape instruction word are used to determine the initial contents of TMA. The TMA is incremented by 1 for each data word transferred.

TMA Setup Register 12 Bits -
In Extended Address mode, this register retains the first memory address of the data to be transferred. If the transfer is not successful, the contents of TMA Setup are placed in the TMA, and the operation is repeated. The TMA Setup Register is loaded from the AC, using the TMA instruction.

Extended Operations Buffer (XOB) 12 Bits -
The contents of this register determine which of the various extended tape operations are in effect. These include extended memory addressing, tape interrupt, and no- pause condition.

PROGRAMMING

The tape transfer operations are the same for both Standard and Extended Operation modes. Data can be read or written in single blocks or groups of contiguous blocks, with or without error-checking. Step-by-step searches can be performed, and block numbers can be identified without reading or writing data.

All LINCtape instructions require two words. The first word specifies the operation to be performed, one of two units, and the motion of tape at the end of the operation. The second word gives the tape block number and in Standard mode also gives the memory block number. The structure of the two words is shown in Figure 3-18.

              +---+---+---+---+---+---+---+---+---+---+----+----+
First Word    | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 |
              +---+---+---+---+---+---+---+---+---+---+----+----+
              \                          /  ^   ^ \             /
               \--- Instruction Code ---/   |   |  \ Operation /
                                            |   |
                                   Motion --+   +-- Unit


               /----- Block Number (Extended Addressing) ------\
              /                                                 \
              +---+---+---+---+---+---+---+---+---+---+----+----+
Second Word   | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 |
              +---+---+---+---+---+---+---+---+---+---+----+----+
              \          /\                                     /
               \ Memory /  \----  Tape Block Number (TBLK) ----/
              Block Number
                 (MBLK)  

Figure 3-18. LINCtape Instruction Format

First Word -
The general instruction code for the LINCtape class is 0700. The particular operation to be performed is specified by bits 9-11 of the first word. In the basic system, one of the two TU55 units is selected by bit 8. If this bit is 0, the unit dialed to 8 is selected; if bit 8 is 1, unit 1 is chosen. Bit 7 (the I-bit) is used to determine the state of the unit's motion when the operation is completed. See Section 3.34 below.

Second Word -
In Standard Addressing, bits 3-11 of the second word specify the number of the tape block to be accessed. Bits 0-2 specify one of four regions of a LINC Memory Field to or from which data is to be transferred. These memory blocks are assigned to specific addresses in each field. There are four blocks in each field, each being 256 words (1 tape block) long. The blocks are assigned as follows:
Memory                   LINC                       LINC
Block Number         Memory Field              Field Addresses
(MBLK)                                         (if IF=0 & DF=1)
----------------------------------------------------------------

  0                 Instruction Field            0000-0377
  1                 Instruction Field            0400-0777
  2                 Instruction Field            1000-1377
  3                 Instruction Field            1400-1777

  4                 Data Field                   2000-2377
  5                 Data Field                   2400-2777
  6                 Data Field                   3000-3377
  7                 Data Field                   3400-1777

In Standard Mode addressing, the contents of a tape block and a memory block correspond exactly. All single-block transfers are effected between the tape block and the memory block specified by the second word of the tape instruction. In group transfers, where several contiguous blocks are transferred, the second word is interpreted in a slightly different way. (See description of RCG and WCG instructions.) The two non-transfer instructions, MTB and CHK, use the second word in still different ways and are described below.

TAPE MOTION

Although tape can be read or written only in the forward direction, it may be searched either forward or backward. Bit 7 of the first word of a LINCtape instruction determines the motion of the tape when a LINCtape operation has been completed.

If bit 7 (the I-bit) is set to 1, the tape is left moving in the direction it was going at the completion of the operation. Except for searches backward, this will usually be the forward direction.

If bit 7 is set to 0, the tape processor enters the Turnaround state at the completion of the operation. Regardless of its former motion, the tape is set moving backwards. When a block mark is encountered, the tape stops, leaving the Turnaround state and entering the idle state. If a new tape instruction occurs while the tape processor is in the Turnaround state, searching begins with the tape moving backwards. (A tape instruction is considered to be complete when the tape processor enters either the Turnaround or the idle state.)

If the tape has stopped, a new tape instruction will always cause it to begin moving in the forward direction. It will not search backwards until one block number has been encountered and compared with the desired block number.

NOTE

The foregoing discussion applies only to tape motion at the completion of an instruction. It should not be confused with the NO PAUSE Extended Operation, which affects central processor action after a tape operation has begun.

LINCTAPE INSTRUCTIONS

In the subsequent instruction descriptions, the following terms are used:

Data sum -
2's complement sum of all 256 data words in a block.
Checksum -
2's complement of (Data sum + 7777(8))
Transfer check -
Data sum + Checksum + 7777(8)
If the transfer is successful, the transfer check = 7777(8)
If not, the transfer check != 7777(8)

RDE - Read Tape Form: RDE I U
Octal code: 0702+ 20I+ 10U
Execution time: 3.2 µsec
Operation: Block TBLK is read from tape into memory block MBLK. The transfer check is left in the TAC and AC. The contents of tape are unchanged.

RDC - Read and Check

Form: RDC I U
Octal code: 0700 + 20I + 10U
Execution time: 3.2 µsec
Operation: Block TBLK is read from tape into memory block MBLK. If the block is transferred correctly, the transfer check is left in the TAC and AC; otherwise, the operation is repeated. The information on tape is unchanged.

RCG - Read and Check Group

Form: RCG I U
Octal code: 0701 + 20I + 10U
Execution time: 3.2 µsec
Operation: MBLK is the number of additional consecutive blocks to be transferred. Block TBLK is read from tape into the memory block designated by the three low-order bits of MBLK, e.g., tape block 773 is read into memory block 3, tape block 027 into memory block 7, etc. The next consecutive TBLK blocks are read into successive memory blocks. Tape block 000 follows tape block 777, and memory block 0 follows memory block 7.

Example: Transfer blocks 202-205 from unit 1 to memory, leaving the unit in motion at the end.

            ...
            RCG I l        0731
            3202                       /MBLK=3, THE NUMBER OF ADDITIONAL BLOCKS
                                       /TBLK=202.

Data is transferred from tape block 202 into memory block 2, then from 203 to memory block 3, 204 to memory block 4, and 205 to memory block 5.

Each block transfer is checked; if the transfer is successful, the transfer check (7777) is left in the TAC otherwise, that block is repeated. If the entire group is transferred successfully, 7777 is left in the TAC and AC at the end of the operation.

WRC - Write and Check

Form: WRC I U
Octal Code: 0704 + 20I + 10U
Execution Time: 3.2 µsec
Operation: The contents of memory block MBLK are copied into block TBLK. If the transfer is successful, the transfer check (7777) is left in the TAC; otherwise, the operation is repeated.

WRI - Write Tape

Form: WRI I U
Octal code: 0706 + 20I + 10U
Execution time: 3.2 µsec
Operation: The contents of memory block MBLK are copied into block TBLK; the transfer check is left in the TAC. The contents of memory are unchanged.

WCG - Write and Check Group

Form: WCG I U
Octal code: 0705 + 20I + 10U
Execution time: 3.2 µsec
Operation: MBLK is the number of additional consecutive memory blocks whose contents are written on tape. The low-order digit of TBLK specifies the first memory block to be accessed. The contents of this block are copied into block TBLK of tape. The contents of the remaining MBLK memory blocks are copied into the next successive tape blocks. Memory block 0 follows memory block 7, and tape block 000 follows tape block 777. The scheme is identical with that for RCG.

The following two instructions do not transfer any data.

MTB - Move Toward Block

Form: MTB I U
Octal code: 0703 + 20I + 10U
Execution time: 3.2 µsec
Operation: Subtract the next tape block number (or reverse block number, if the tape is moving backwards) encountered from TBLK, leaving the difference in the TAC and AC. If I = 0, the tape stops. If I = 1, the tape is left moving forward if the difference is positive or 0, and backward if negative. If the tape is at rest when this instruction is given, it starts moving forward; otherwise it continues in the direction it had been going. The MBLK bits of the second word are ignored.

CHK - Check Tape Block

Form: CHK I U
Octal code: 0707 + 20I + 10U
Execution time: 3.2 µsec
Operation: Tape block TBLK is found, and its contents read into the tape control registers only, to form the data sum (no transfer takes place). The checksum is read, and the transfer check is left in the TAC and AC. The information on tape is unchanged, and the MBLK bits of the second word are ignored.

The contents of the Tape Accumulator can be examined by using the following instruction.

TAC - Tape Accumulator to AC

Octal code: 0003
Execution time: 1.6 µsec
Operation: The contents of the Tape Accumulator are placed in the central processor AC. The previous C(AC) are lost; C(TAC) are unchanged.

EXTENDED OPERATIONS

LINCtape Extended Operations give the programmer a more flexible addressing scheme for information transfers, additional control functions, and a tape processor maintenance facility. These operations are controlled by the contents of the Extended Operations Buffer, defined as shown in Figure 3-19. The XOB can be loaded from the AC and vice versa.

AXO - AC to XOB

Octal code: 0001
Execution time: 1.6 µsec
Operation: The contents of the AC are placed in the Extended Operations Buffer. The previous C(XOB) are lost: C(AC) are unchanged.

XOA - XOB to AC

Octal code: 0021
Execution time: 1.6 µsec
Operation: The contents of the Extended Operations Buffer are placed in the AC. The previous C(AC) are lost; C(XOB) are unchanged.


              EXTENDED OPERATIONS BUFFER
              +---+---+---+---+---+---+---+---+---+---+----+----+
              | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 |
              +---+---+---+---+---+---+---+---+---+---+----+----+
              \           /     ^   ^   ^   ^   ^   ^ \         /
                Extended        |   |   |   |   |   |   Extended
                 Memory         |   |   |   |   |   |    Units
                 Address        |   |   |   |   |   |
                                |   |   |   |   |   |   Hold
                 Mark ----------+   |   |   |   |   +-- Unit
            Condition               |   |   |   |       Motion
                                    |   |   |   |
               Enable               |   |   |   |       Do Not
                 Tape --------------+   |   |   +------ Pause During
            Interrupt                   |   |           Execution
                                        |   |
          Maintenance ------------------+   +---------- Enable Extended
                 Mode                                   Address Mode
Figure 3-19. Extended Operations Buffer Bit Assignments

Extended Address Format

This facility releases the programmer from the limitation of block to block transfers, as described previously. Instead, a block transfer may begin in any register of any memory bank, regardless of the settings of the Memory Field Registers.

When the Extended Address Mode is enabled (by setting bit 7 of the XOB to 1), all subsequent tape transfers are executed as follows:

The starting address of the area in memory is placed in the TMA Setup Register by the program, using the instruction TMA.

TMA - Load TMA Setup Register

Octal code: 0023
Execution time: 1.6 µsec
Operation: The contents of the AC are placed in the Tape Memory Address Setup Register. The previous contents of TMA Setup are lost; C(AC) are unchanged.

At the occurrence of a tape transfer instruction, the contents of the TMA Setup Register are placed in the TMA. The second word of the instruction is taken as a full 12-bit block number, and placed in the TBN. The transfer is effected between tape and the designated area of the 4096-word memory bank specified by bits 0-2 of the XOB. The transfer is thus independent of the LINC Memory Field assignments.

As in all extended memory operations, whether with tape or not, the transfer will not cross memory bank boundaries; register 7777 of a given bank is followed by register 0000.

NOTE

The group transfer instructions RCG and WCG cannot be used in extended address mode.

The non-transfer instructions MTB and CHK are not affected.

Example: Read the contents of block 365 of unit 0 into memory bank 1 (second 4K memory bank) starting in register (10)540.

                Octal
Instruction     Code               Action

LDA I 0         1020          /LOAD AC WITH STARTING ADDRESS
0540            0540          /STARTING ADDRESS OF TARGET AREA
TMA             0023          /PLACE STARTING ADDRESS IN TMA SETUP
LDA I 0         1020          /LOAD AC WITH EXTENDED OPERATIONS BITS
1020                          /BANK I:ENTER EXTENDED ADDRESS MODE.
AXO             0001          /LOAD XOB FROM AC.
...
...
RDC 0           0700          /READ AND CHECK FROM UNIT 0
0365            0365          /BLOCK 365
...
The data will be read into registers 540-1137 of memory bank 1.

Extended Units

The two Extended Units bits (XOB[10,11]) may be thought of as an extension of the unit bit of a LINCtape instruction (bit 8). Taken together, the three bits can select one of up to eight TU55 transports which may be attached to the TC12 tape control. The logical unit numbers are assigned by rotating the dials on the transports; they correspond to the unit select bits as follows:

Extended unit        Instruction          Transport
Bits (XOB)            Unit Bit            Selected
 10   11                  8 
----------------------------------------------------

  0    0                  0                   8
  0    0                  1                   1
  0    1                  0                   2
  0    1                  1                   3
  1    0                  0                   4
  1    0                  1                   5
  1    1                  0                   6
  1    1                  1                   7
Tape Interrupt Enable

When this bit (XOB[5]) is set, a program interrupt will occur whenever a tape operation is not in progress. As with other LINC interrupts, control is transferred to register 0041 of memory field 0; the contents of the PC are stored in register 0040. (If the central processor is in PDP-8 mode, the interrupt uses registers 0001 and 0000.)

No Pause Condition

Normally, the central processor waits until a tape operation is finished before proceeding. Such delays are eliminated by setting the No Pause condition bit (XOB[8]). When this condition is enabled, the processor continues with the program as soon as the LINCtape instruction has heen interpreted and the operation initiated.

Subsequently, the program can monitor the Tape Done (STD) flag to determine when the operation has finished, before starting a new one. When NO PAUSE is set, the transfer of the Transfer Check to the accumulator at the end of tape instruction inhibited.

STD - Skip if Tape Done

Form: STD I
Octal code: 0416 + 20I
Execution time: 1.6 µsec
Operation: If I = 0, skip the next instruction if the tape operation is completed; otherwise execute the next instruction. If I = 1, skip if the operation is still in progress. This instruction is identical to SXL I 16.

Used in conjunction with the tape flag and tape interrupt, the No Pause condition can save considerable amounts of time, and gives the programmer added flexibility in the processing of data before a transfer is completed.

Hold Unit Motion

Normally, a tape transport stops as soon as another unit has been selected. When XOB[9] is set, however, the transport will continue in the direction it has been moving when the unit is deselected. This is a useful feature for certain operations involving several units, and must be used with care. Note that it is not the same as the motion bit of a LINCtape instruction, which determines the motion state of a unit at the completion of an instruction only.

MARK Condition

This bit (XOB[4]) is used in conjunction with the MARK switch on the operator's console, to allow the MARK12 program (see Chapter 6, Section III on Program Library) to record Timing and Mark tracks on a new tape. The interaction between the switch and the XOB is designed to minimize the possibility of accidentally destroying a tape by enabling the MARK flip-flop. The flip-flop can be set only when the MARK switch is held down while an AXO instruction is being executed with AC[4] set to 1.

Maintenance Mode

When bit 6 of the XOB is set to 1, all timing signals and data are prevented from entering the tape control registers from the reader- writers. Instead, signals generated by PDP-8 IOT instructions are used as input to the tape control, in order to simulate the functions of the tape head and the tape processor. The Maintenance Mode is designed for diagnostic purposes only and is not intended for general use.

Tape Trap

Whenever the TAPE TRAP and INSTRUCTION TRAP Special Functions are enabled (ESF with AC[2,3] set to 1s), LINCtape instructions are not executed. When one is encountered, a program trap to register 0140 of memory field 0 occurs. The Tape Trap is intended primarily for use with LINC-8 programs and the I/O Handler (PROGOFOP simulator) to ensure compatibility.