forked from dspinellis/unix-history-repo
-
Notifications
You must be signed in to change notification settings - Fork 0
/
bc.s
288 lines (274 loc) · 3.07 KB
/
bc.s
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
" bc
jmp start
rinit:
jms initio
jmp .+1 i
initio: 0
lac inter-1
dac fetch
jmp rinit
jms inter
inter: 0
las
and o17
sza
jms trace
lac pc i
dac instr
lac pc
and o10000
sna
jmp badpc
lac sp
and o17700
sad o17700
jmp badsp
and o10000
sna
jmp badsp
lac instr
sad insasg
skp
jmp inter i
-4
tad sp
dac t1
lac t1 i
and o10000
sna
jmp badasgn
lac instr
jmp inter i
trace: 0
and d1
sza
jms dtrace
las
and d2
sza
jms ddisp
las
and d4
sza
jms histog
las
and d8
sza
jmp stop
jmp trace i
dtrace: 0
lac pc
dac 8
lac 8 i
dac instr
lac 8
jms octal; -4
law 040
jms putc
lac instr
cll; lrs 14
tad lacop
dac .+1
lac ..
jms putc
law 040
jms putc
lac instr
jms octal; -4
lac instr
sad inslitr
skp
jmp 1f
law 040
jms putc
lac 8 i
jms octal; -6
1:
law 012
jms putc
jms flush
jmp dtrace i
ddisp: 0
jms dspinit
lac dspbp
dac 8
lac dp
sad olddp
skp
jms dspblk
lac pc
jms dspnt
lac sp
jms dspnt
lac lastv
jms dspnt
-1
dac B i
lac pbs i
sza
jmp .-2
jmp ddisp i
dspblk: 0
lac dspbuf
dac 8
lac dp
dac t1
dzm t2
1:
lac t1
sna
jmp 1f
lac o216000 " dx -20
dac 8 i
lac t2
tad o20
dac t2
lac t1
tad d1
dac t3
lac t3 i
jms dspnt
lac t1 i
dac t1
jmp 1b
1:
lac o160020 " sx 20
tad t2
dac dspbuf i
dac 8 i
lac 8
dac dspbp
jmp dspblk i
dspnt: 0
and o7777
lrss 2
xor o164000 " sy 0
dac 8 i
lac o17010
dac 8 i
jmp dspnt i
dspinit: 0
-1
tad dspinit
dac dspinit
-300
tad lastv
dac lastv
dac dspbuf
-1
dac dspinit i
dac dspbuf i
dzm olddp
lac dspbuf
sys capt
law 13
sys sysloc
dac pbs
jmp dspinit i
histog: 0
jms hisinit
lac pc
lrs 6
and o77
tad histbuf
dac t1
isz t1 i
jmp histog i
jmp .
hisinit: 0
-1
tad hisinit
dac hisinit
-1
dac hisinit i
-64
dac t1
tad lastv
dac lastv
dac histbuf
tad dm1
dac 8
1:
dsm 8 i
isz t1
jmp 1b
jmp hisinit i
histbuf: 0
olddp: 0
dspbuf: 0
dspbp: 0
instr: 0
obs: 0
inslitr: n 5
insasg: b 1
o17: 017
d8: 8
o77: 077
o10000: 010000
d5: 5
o60: 060
o7777: 07777
o216000: 0216000
o160020: 0160020
o20: 020
o164000: 0164000
o17010: 017010
o17700: 017700
d2: 2
lacop: lac .
a>;b>;c>;f>;n>;s>;t>;u>;x>;y>
badpc:
jms flush
lac d1
sys write; mpc; mpcs
jmp stop
badsp:
jms flush
lac d1
sys write; msp; msps
jmp stop
badasgn:
jms flush
lac d1
sys write; mas; mass
jmp stop
mpc:
012;<pc>;012
mpcs = .-mpc
msp:
012;<sp>;012
msps = .-msp
mas:
012;<as>;012
mass = .-mas
octal: 0
lmq
lac d5
tad octal i
cma
dac 2f
sna
jmp 3f
1:
llss 3
isz 2f
jmp 1b
3:
lac octal i
dac 2f
lacq
dac 2f+1
1:
lac 2f+1
lmq
ecla llss 3
tad o60
jms putc
lac 2f+1
alss 3
dac 2f+1
isz 2f
jmp 1b
isz octal
jmp octal i
2: 0;0