Table of contents |
2 Example 3 External links |
The PDP-8 was a 12-bit computer with 4096 words of memory. It had only eight instructions, one full register, the accumulator (AC), and a single-bit register, the link (L) bit. The machine operated at a clock rate of 1 MHz, and took 10 clocks for each instruction, so that it ran at 0.1MIPS.
The instruction set:
Here is an example of a complete PDP-8 assembly language program – Hello, world – written for the PAL-III assembler.
*200 / set assembly origin (load address)
hello, cla cll
tls / tls to set printer flag.
tad charac / set up index register
dca ir1 / for getting characters.
tad m6 / set up counter for
dca count / typing characters.
next, tad i ir1 / get a character.
jms type / type it.
isz count / done yet?
jmp next / no: type another.
hlt
type, 0 / type subroutine
tsf
jmp .-1
tls
cla
jmp i type
charac, . / used as initial value of ir1
310 / H
305 / E
314 / L
314 / L
317 / O
254 / ,
240 /
327 / W
317 / O
322 / R
314 / L
304 / D
241 / !
m6, -15
count, 0
ir1 = 10
$
Description
A wide variety of operations are available through the OPR microcoded
instructions. In general, the operations within each Group can be combined by oring the bit patterns for the desired operations into a single instruction. If none of the bits are set, the result is the NOP instruction.
Example
/ adapted from example in Digital PDP-8 Handbook Series, Introduction to Programming, p5-12
External links