Ref: http://bitsavers.trailing-edge.com/pdf/dec/pdp1/PDP-1_Subroutines_1961.pdf
Note: Lower and upper case!
MIT Macro assembler. A backslash ("\") denotes an overstrike character.
Symbols that occur at least once with an overstrike are assembler variables (i.e. a memory location will be assigned by the assembler on the keyword variables.)
An opening brace denotes a constant expression (with memory assigned to this by the assembler on the keyword constants.)
define setup A,B
law i B
dac A
term
/codeword display
cwd, 0
dap cwx
lac i cwd
dac \cw
idx cwd
xct i cwx
dac \x
idx cwx
xct i cwx
lio i cwd
spi
sub \2dl
dac \y
idx cwx
setup \ctr, 22
setup \cty, 7
d, setup \ctx, 5
c, lio \cw
ril 1s
dio \cw
spi
jmp plt
a, isp \ctr
jmp b
lac i cwd
dac cw
setup \ctr, 22
b, isp ctx
jmp inx
isp cty
jmp iny
cwx, jmp .
inx, lac x
add del
dac x
jmp c
iny, lac x
sub \4dl
dac x
lac y
add del
dac y
jmp d
plt, lac x
lio y
dpy-i
jmp a
siz,del, 2000
dap sex
lac del
sal 1s
dac \2dl
sal 1s
dac \4dl
sex, jmp .
variables
constants
start
/alphabetic codeword tables
lwr, 374200 000000 /space, printing
561020 010604 /1
774040 005056 /2
564204 203056 /3
420413 345122 /4
164204 175037 /5
564307 241056 /6
604040 004077 /7
564305 243056 /8
564205 343056 /9
0 0
0 0
0 0
0 0
0 0
0 0
144512 245114 /0
602020 010101 //
160231 016000 /s
421220 010744 /t
72245 122000 /u
42506 142000 /v
125326 142000 /w
212421 242000 /x
60235 522451 /y
372020 276000 /z
0 0
440430 600000 /,
0 0
0 0
1170 174200 /tab, printing
0 0
400000 214000 /·
42410 614002 /j
112461 222410 /k
70410 204106 /l
655326 164000 /m
512245 124000 /n
62245 114000 /o
102071 522456 /p
30472 645116 /q
502041 124000 /r
0 0
0 0
000174 000000 /-
101010 204210 /)
000000 000037 /¯
21041 20202 /(
0 0
72234 114000 /a
162245 134410 /b
72041 16000 /c
72245 116041 /d
72075 114000 /e
102161 20446 /f
60235 522446 /g
112245 134410 /h
561020 30004 /i
042555 224512 /l.c., printing
061400 000000 /.
122451 266504 /u.c., printing
042175 010000 /bksp, printing
0 0
306020 204600 /c.r., printing
upr, 374200 0 /space, printing
000000 023562 /"
000000 004304 /'
000000 005250 /~
760207 200000 /⊃
042452 142000 /∨
214251 210000 /∧
010421 010101 /<
101010 104210 />
441020 052704 /↑
0 0
0 0
0 0
0 0
0 0
0 0
040574 210000 /→
040020 243056 /?
564205 241056 /S
441020 010237 /T
164306 143061 /U
042506 143061 /V
125326 143061 /W
612420 010521 /X
441020 010521 /Y
774040 004077 /Z
0 0
407603 300000 /=
0 0
0 0
050774 312000 /tab, printing
0 0
007600 400000 /_
144410 204107 /J
214523 051121 /K
374102 041020 /L
214306 153561 /M
214306 353461 /N
164306 143056 /O
604103 243076 /P
154526 143056 /Q
614523 243076 /R
0 0
0 0
441174 010000 /+
60410 204106 /]
441020 010204 /|
461020 010206 /[
214376 143056 /A
764307 243076 /B
164302 041056 /C
364306 143076 /D
774103 041037 /E
604103 041037 /F
164336 041056 /G
614307 343061 /H
561020 010216 /I
042555 224512 /l.c., printing
404250 025040 /×
122451 266504 /u.c., printing
042175 010000 /bksp, printing
0 0
306020 204600 /c.r., printing
start
///// Annotations
PATTERN:
13 : 14 : 15 : 16 : 17
......................
word 2 8 : 9 : 10 : 11 : 12
......................
3 : 4 : 5 : 6 : 9
---------.............
16 : 17 | 0 : 1 : 2
........--------------
word 1 11 : 12 : 13 : 14 : 15
......................
6 : 7 : 8 : 9 : 10
......................
1 : 2 : 3 : 4 : 5
WORD 1, BIT 0: DEPRESS 2. (should be: WORD 2)
law cw1
jda cwd
lac \x
lac \y