Specifications
CHAPiER 6
PROGRAMMING OF
PERIPHERALS
Programming of peripherals is extremely simple in the PDP-11-a special
class of instructions to deal with input/output operations is unnecessary.
The Unibus permits a unified addressing structure in which control, status,
and data registers for peripheral devices are directly addressed as memory
locations. Therefore all operations on these registers, such as transferring
information into or out of them or manpulating data within them, are per-
formed by normal memory reference instruction.
The ability to use all memory reference instructions on peripheral device.
registers greatly increases the flexibility of input/output programming. ln-
formation in a device register can be compared directly with a value and a
branch made on the result.
CMP #lOl, PRB
BEQ SERVICE
In this case the program looks for 101, from the paper tape reader data
buffer, and branches if it finds it. There is no need to transfer the informa-
tion into an intermediate register for comparison.
When the character is of interest, a memory reference instruction can trans-
fer the character into a user buffer in core or in another peripheral device.
MOV PRB, LOC
This instruction transfers a character from the paper tape reader buffer into
a user-defined location.
All arithmetic operations can be performed on a peripheral device register.
ADD #lo, -DSX
This instruction will add lo8 to a display’s x-deflection register.
All peripheral device registers can be treated as accumulators. There is no
need to funnel all data transfers, arithmetic operations, and comparisons
through a single or small number of accumulator registers.
DEVICE REGISTERS
All peripheral devices are specified by a set of registers which are addressed
‘as core memory and manipulated as flexibly as an accumulator. There are
two types of registers associated with each device: 1) Control and Status.Reg-
isters (CSR); and 2) Data Registers.
CONTROL AND STATUS REGISTERS (CSR)-Each peripheral has one or more
control and status registers which contain all the information necessary to
communicate with that device. The general form of a control and status
register is shown below.
General Control and Status Register
, This general form does not necessarily apply to any device, but is presented
as a format which could be used as a guideline for designing peripheral
47