forked from dspinellis/unix-history-repo
-
Notifications
You must be signed in to change notification settings - Fork 0
/
db.s
1217 lines (1215 loc) · 13.2 KB
/
db.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
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
" db
narg = ..+07777
lac i narg
sad d4
jmp start
lac narg
tad d5
dac rcorep
dac wcorep
lac i narg
sad d8
jmp start
sad d12
skp
jmp error
lac narg
tad d9
dac nlnamep
"
start:
lac nlbufp
cma
tad o17777
cll
idiv
6
cll
lacq
mul
6
lacq
dac namesize
sys open; nlnamep: nlname; 0
dac symindex
sma
jmp 1f
2:
dzm nlcnt
lac nlbufp
dac nlsize
jmp 3f
1:
sys read; nlbuff; namesize:0
spa
jmp 2b
dac nlcnt
tad nlbufp
dac nlsize
3:
lac symindex
sys close
sys open
wcorep: corename; 1
dac wcore
sys open; rcorep: corename; 0
dac rcore
spa
jmp error
"
lac o52012
jms wchar
law dotdot
dac nsearch
jms nlsearch
jmp mloop
lac value
dac relocval
cma
tad d1
dac mrelocv
dzm sysflag
mloop:
-1
dac nwords
ml1:
jms rch
dac nchar1
sad o52
skp
jmp 1f
dzm nchar1
dac indflg
1:
jms getexp
lac errf
sna
jmp cmd
error:
dzm indflg
lac o40
dac rator
dzm errf
lac d1
sys write; errmes; 1
jmp mloop
cmd:
lacq
sad o41
jmp patch
lac opfound
sna
jmp 1f
lac comflg
dzm comflg
sza
jmp 1f
lac curval
dac curdot
lac curreloc
dac dotrel
1:
lacq
sad o42
jmp ascii
sad o12
jmp newln
sad o77
jmp symbol
sad o47
jmp saddress
sad o75
jmp address
sad o57
jmp octal
sad o72
jmp decimal
sad o136
skp
jmp 1f
dac sysflag
jmp mloop
1:
sad o45
skp
jmp 1f
dzm sysflag
jmp mloop
1:
sad d1
sys exit
sad o54
skp
jmp error
" comma
jms getexp
lac errf
sza
jmp error
law
dac comflg
lac curreloc
sza
jmp 1f
lac value
cma
dac nwords
jmp cmd
1:
lac reldot
sna
jmp error
lac curval
cma
tad curdot
sma
jmp error
dac nwords
jmp cmd
"
saddress:
lac curdot
dac 9f
dzm curdot
lac reldot
sza
lac relocval
tad 9f
jms prsym
lac o12
jms wchar
lac 9f
dac curdot
jmp mloop
9:0
"
symbol:
law prsym
dac type
jmp print
"
octal:
law proct
dac type
jmp print
"
ascii:
law prasc
dac type
jmp print
"
decimal:
law prdec
dac type
jmp print
"
address:
lac curdot
jms octw
5
lac curreloc
sza
jmp 1f
lac o12
jms wchar
jmp mloop
1:
lac o162012
jms wchar
jmp mloop
"
print:
lac sysflag
sza
jmp 2f
lac reldot
sza
jmp 1f
lac curdot
dac addr
jmp sprint
2:
lac curdot
dac addr
jmp sprint
1:
law inbuf
dac addr
lac curdot
dac 1f
lac rcore
sys seek; 1:0; 0
spa
jmp error
lac rcore
sys read; inbuf; 64
spa
jmp error
sna
jmp error
"
sprint:
lac indflg
sna
jmp 2f
dzm indflg
lac i addr
and o17777
dac curdot
dzm reldot
tad mrelocv
spa
jmp print
dac curdot
lac d1
dac reldot
jmp print
"
2:
lac o40
jms wchar
lac addr
dac 3f
lac i addr
jms i type
lac 3f
dac addr
isz addr
law prasc
sad type
jmp 1f
lac nl
jms wchar
1:
isz nwords
jmp 1f
law prasc
sad type
skp
jmp mloop
lac nl
jms wchar
jmp mloop
1:
isz curdot
nop
lac nwords
spa
jmp print
jmp 2b
3:0
"
prdec: "temp
proct:0
jms octw
6
jmp i proct
"
patch:
lac opfound
sna
jmp error
lac curreloc
sna
jmp 1f
lac curval
tad relocval
skp
1:
lac curval
dac inbuf
lac sysflag
sna
jmp 1f
lac inbuf
dac i curdot
jmp bump
1:
lac reldot
sna
jmp error
lac curdot
dac 2f
lac wcore
spa
jmp error
sys seek; 2:0; 0
spa
jmp error
lac wcore
sys write; inbuf; 1
spa
jmp error
bump:
-1
dac nwords
isz curdot
jmp print
"
newln:
lac opfound
sna
jmp bump
jmp print
"
getexp:0
dzm errf
lac o40
dac rator
dzm curval
dzm curreloc
dzm reloc
dzm value
dzm opfound
xloop:
jms rch
lmq
sad o44
skp
jmp 1f
jms getspec
jms oprand
jmp xloop
1:
tad om60
spa
jmp 1f
tad om10
sma
jmp 1f
lacq
jms getnum " ??? getnur
jms oprand
jmp xloop
1:
lacq
sad o56
jmp 1f
tad om141
spa
jmp 2f
tad om32
sma
jmp 2f
1:
lacq
jms getsym
jms oprand
jmp xloop
2:
lacq
tad om101
spa
jmp 1f
tad om32
spa
jmp 1b
1:
lacq
sad o74
skp
jmp 1f
jms rch
alss 9
dac value
dzm reloc
jms oprand
jmp xloop
1:
sad o40
jmp xloop
sad o55 "-
skp
jmp 1f
2:
lac o40
sad rator
skp
jmp error
lacq
dac rator
jmp xloop
1:
sad o53 "+
jmp 2b
lac curreloc
sna
jmp 1f
sad d1
skp
dac errf
1:
lac o40
sad rator
jmp i getexp
dac errf
jmp i getexp
"
getspec: 0
jms rch
sad o141
jmp spcac
sad o161 "q
jmp spcmq
sad o151 "i
jmp spcic
lmq
tad om60
spa
jmp 2f
tad om10
sma
jmp 2f
lacq
jms getnum
jmp spcai
2:
law
dac errf
jmp getspec i
spcac:
cla
jmp 1f
spcmq:
lac d1
jmp 1f
spcic:
lac d10
jmp 1f
spcai:
lac value
tad dm6
1:
tad o10000
dac value
lac d1
dac reloc
jmp i getspec
"
getsym:0
lmq
law symbuf
dac symbufp
dzm symbuf
-8
dac symcnt
dzm nchar1
lac nopcom
dac skipt
skp
storech:
lmq
lac i symbufp
and o177000
sna
jmp 1f
omq
dac i symbufp
isz symbufp
dzm i symbufp
jmp 2f
1:
llss 27
dac i symbufp
"
2:
isz symcnt
skp
jmp endsym
skipt:
nop " or jmp fill
jms rch
sad o76
skp
jmp 1f
lac symbuf
lrss 9
and o177
dac value
dzm reloc
jmp i getsym
1:
sad o56
jmp storech
dac nchar1
tad om60
spa
jmp fill
tad m10
spa
jmp 2f
lac nchar1
tad om141
spa
jmp 1f
tad om32
spa
jmp 2f
1:
lac nchar1
tad om101
spa
jmp fill
tad om32
sma
jmp fill
2:
lac nchar1
dzm nchar1
jmp storech
"
fill:
lac trafill
dac skipt
lac o40
jmp storech
"
endsym:
lac symbuf
sad o56040
jmp dotsym
law symbuf
dac nsearch
jms nlsearch
jmp undef
dzm nsearch
jmp i getsym
"
dotsym:
lac curdot
dac value
lac dotrel
dac reloc
jmp i getsym
"
undef:
dzm nsearch
law
dac errf
jmp i getsym
"
getnum:0
dzm reloc
dzm value
num1:
tad om60
lmq
lac value
alss 3
omq
dac value
jms rch
dac nchar1
sad o162
jmp nrel
tad om60
spa
jmp i getnum
tad om10
sma
jmp i getnum
lac nchar1
dzm nchar1
jmp num1
nrel:
dzm nchar1
lac d1
dac reloc
jmp i getnum
"
oprand:0
lac rator
sad o53
jmp opplus
sad o40
jmp opor
sad o55
jmp opminus
opplus:
lac value
tad curval
dac curval
1:
lac curreloc
tad reloc
dac curreloc
jmp retop
"
opor:
lac value
lmq
lac curval
omq
dac curval
jmp 1b
"
opminus:
lac curval
cma
tad value
cma
dac curval
lac reloc
cma
tad d1
tad curreloc
dac curreloc
retop:
lac o40
dac rator
dac opfound
jmp i oprand
"
prasc:0
jms wchar
jmp i prasc
"
prsym:0
dac word
dzm relflg
dzm relocflg
dzm nsearch
and o760000
sad o760000
jmp plaw
sad o20000
jmp pcal
and o740000
sad o640000
jmp peae
sad o740000
jmp popr
sad o700000
jmp piot
sna
jmp poct
jms nlsearch
jmp poct
jms wrname
lac o40
jms wchar
lac word
and o20000
sna
jmp 1f
lac o151040
jms wchar
lac word
xor o20000
dac word
1:
symadr:
lac d1
dac relflg
dac relocflg
lac word
and o17777
tad mrelocv
sma
jmp 1f
tad relocval
dzm relocflg
1:
pradr:
dac addr
jms nlsearch
jmp octala
pr1:
dzm relflg
jms wrname
lac value
sad addr
jmp i prsym
cma
tad d1
tad addr
sma
jmp 1f
cma
tad d1
dac addr
lac o55
jms wchar
jmp 2f
1:
dac addr
lac o53
jms wchar
2:
lac addr
jms octw
1
jmp i prsym
"
plaw:
lac d1
dac relocflg
lac word
and o17777
tad mrelocv
sma
jmp 1f
tad relocval
dzm relocflg
1:
dac addr
law
dac relflg
lac addr
jms nlsearch
jmp poct
dac symindex
law laws
jms wrname
lac o40
jms wchar
3:
lac symindex
jmp pr1
2:0
9:0
"
peae:
lac word
jms nlsearch
jmp 1f
jms wrname
jmp i prsym
1:
lac word
and o777700
jms nlsearch
jmp 1f
jms wrname
lac o40
jms wchar
lac word
and o77
jms octw
1
jmp i prsym
1:
law eaes
dac addr
jmp nfnd
"
popr:
law oprs
jmp 1f
piot:
law iots
1:
dac addr
lac word
jms nlsearch
jmp 1f
jms wrname
jmp i prsym
1:
nfnd:
lac addr
jms wrname
octala:
dzm relflg
lac o40
jms wchar
lac word
and o37777
lmq
lac relocflg
sna
jmp 1f
lacq
tad mrelocv
lmq
1:
lacq
jms octw
1
lac relocflg
sna
jmp i prsym
lac o162
jms wchar
dzm relocflg
jmp i prsym
"
poct:
lac word
jms octw
6
jmp i prsym
"
pcal:
lac word
sna
jmp poct
and o17777
jms nlsearch
jmp 1f
dac addr
law syss
jms wrname
lac o40
jms wchar
lac addr
jms wrname
jmp i prsym
"
1:
lac word
and o20000
sza
jmp poct
jmp symadr
"
wrname:0
tad dm1
dac 10
-4
dac 3f
1:
lac i 10
dac 2f
lmq
cla
llss 9
sad o40
jmp i wrname
jms wchar
lac 2f
and o177
sad o40
jmp i wrname
jms wchar
isz 3f
jmp 1b
jmp i wrname
2:0
3:0
"
nlsearch:0
dac match
lac brack
dac best
dzm minp
1:
lac nlbufp
tad dm6
dac cnlp
nloop:
lac cnlp
tad d6
dac cnlp
lmq
cma
tad nlsize
spa
jmp nlend
lac nsearch
sza
jmp testn
lacq
tad d3
dac np
lac i np
sna
jmp nloop
isz np
lac i np
dac treloc
sad relocflg
skp
jmp nloop
isz np
lac i np
dac tvalue
sad match
jmp nlok
lac relocflg
sna
jmp nloop
lac relflg
sna
jmp nloop
-1
tad tvalue
cma
tad match
spa
jmp nloop
dac 2f
tad mbrack
sma
jmp nloop
lac best
cma
tad d1
tad 2f
sma
jmp nloop
lac 2f
dac best
lac tvalue
dac value
lac treloc
dac reloc
lac cnlp
dac minp
jmp nloop
"
2:0
"
testn:
lacq
dac minp
-4
dac value
lac match
dac inbuf
1:
lac i minp
sad i inbuf
skp
jmp nloop
isz minp
isz inbuf
isz value
jmp 1b
lac i minp
dac treloc
isz minp
lac i minp
dac tvalue
jmp nlok
"
nlend:
lac relflg
sna
jmp i nlsearch
lac dotrel
sad relocflg
skp
jmp 1f
-1
tad curdot
cma
tad match
spa