-
Notifications
You must be signed in to change notification settings - Fork 0
/
threecom.mix
1124 lines (1123 loc) · 24.1 KB
/
threecom.mix
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
ORIG 3999
JMP BEGIN
*
* THREETRAN -- MIX COMPILER
*
* D. KNUTH
* MARCH, 1965
* DEBUGGED MARCH 23, 196
*
BYTESIZE EQU 1(4:4)
READER EQU 16
PRINTER EQU 18
TAPE EQU 1
TBUF EQU 0
OPBUF EQU 0
*
* CONTENTS OF BUFFER AREAS
*
ORIG 0
LOADER ENT5 140,6
ENT3 100
1H ENN3 0,3
2H IN 0,5(TAPE)
INC5 0,3
ENT1 99
ENT2 99,5
LDA 99,5
DEC2 1
ADD 0,2
DEC1 1
J1P *-3,6
JAZ 2F,6
HLT 1
IOC 2(TAPE)
IN 0,5(TAPE)
DEC5 0,3
JMP 2B,6
2H LD4 0,2(5:5)
ENT1 98,5
J4Z 5F,6
LD1 0,2(3:4)
ST4 *+1,6(4:4)
MOVE 1,2(*)
INC2 1,4
JMP 2B,6
3H DEC2 1
LD4 0,2(0:2)
STA 0,2(0:2)
ENT2 0,4
J4NN *-3,6
4H DEC1 1
5H LD2 0,1(4:5)
LDA 0,1(0:2)
J2P 3B,6
JAZ 1B,6
IOC 0(TAPE)
LD1 0,1(2:3)
JOV 0,1
JMP 0,1
*
SSIZE EQU 35 SIZE IS ORBUF - STANDARD
ORIG 47
STANDARD CON SSIZE-1,*+1(3:4)
OUTSUB STJ 9F
LD1N 1F
ST1 1F
ENTX 0
JAP *+3
ENTX 45
STX OPBUF+14,1(1:1)
CHAR
STA OPBUF+12,1
STX OPBUF+13,1
OUT OPBUF+12,1(PRINTER)
9H JMP *
1H CON 12
ORBUF EQU *+21
INSUB STJ 9F
LD1N 1F
ST1 1F
IN ORBUF+8,1(READER)
LD1N 1F
LDA ORBUF+8,1
LDX ORBUF+9,1
NUM
LDX ORBUF+10,1(1:1)
DECX 45
9H JXNZ *
STA ORBUF+10,1
LDAN ORBUF+10,1
JMP 9B-1
1H CON 8
INIT0 IN ORBUF+16(READER)
IOC 0(PRINTER)
STZ OPBUF+2
ENT1 OPBUF+3
MOVE OPBUF+2(45)
JMP OBJECT
ORIG ORBUF+32
OBJECT EQU * BEGINNING OF OBJECT PROGRM
*
PBU1 EQU *+1
CON 0
ALF .....
ALF THRE
ALF ETRAN
ALF -- M
ALF IX C
ALF OMPIL
ALF ER ..
ALF .....
ALF .....
ALF .....
ALF .....
ALF .....
ALF .....
ALF .....
ALF .....
ALF .....
ALF .....
ALF .....
ALF .....
ALF .....
ALF .....
ALF .....
ALF .....
ALF .....
CON *+2
PBUF2 EQU *+1
CON 0
ORIG PBUF2+24
CON PBUF1
RBUF1 ORIG *+16
CON *+1
RBUF2 ORIG *+16
CON RBUF1
*
* SUBROUTINES FOR INPUT/OUTPUT
*
COMPL1 STA INST
COMPL STJ 9F
ST5 TEMP5
ST6 TEMP6
LSW JMP 2F
LD1 PBUF
FMTSW JMP 1F
LDA INST
CHAR
STA 4,1
STX 5,1
JMP 3F
1H LDA INST(0:2)
JANN *+3
ENTX 45
STX 3,1(5:5)
CHAR
STX 4,1(1:4)
LDA INST(3:3)
CHAR
STX 5,1(1:2)
LDA INST(4:4)
CHAR
STX 5,1(4:5)
LDA INST(5:5)
CHAR
STX 6,1(2:3)
3H LDA PROG(1:2)
CHAR
STX 2,1(2:5)
INC1 7
MOVE COMT(2)
STZ COMT
STZ COMT1
JMP PRINTOUT
2H LDX PROG(1:2)
INCX 1
STX PROG(1:2)
DECX 1
JBUS *(TAPE)
LD6 PT1
CMPX MAXLOC
JGE 1F
CMPX EASYLOC
JE 2F
1H JMP SETN
STX BASELOC
STX TBUF,6(0:4)
INCX BYTESIZE
STX MAXLOC
DECX BYTESIZE
ST6 BASEINDEX
INC6 1
2H INCX 1
STX EASYLOC
LDA INST
STA TBUF,6
INC6 1
LD5 PT2
JMP 3F
FIXUP STJ 9F
ST5 TEMP5
ST6 TEMP6
JBUS *(TAPE)
LD5 PT2
STA TBUF+1,5
DEC5 1
LD6 PT1
3H CMP6 PT2
SWITCH JL 4F
JMP SETN
STZ TBUF+1,5
STZ TBUF,6
8H ENT5 97
LDAN TBUF+98
SUB TBUF,5
DEC5 1
J5NN *-2
STA TBUF+99
OUT TBUF(TAPE)
JOV *+1
ST5 EASYLOC
ENT5 97
ENT6 0
4H ST6 PT1
ST5 PT2
LD5 TEMP5
LD6 TEMP6
9H JMP *
SETN STJ 1F
LDA EASYLOC
JAN 1F
SUB BASELOC
LD1 BASEINDEX
STA TBUF,1(5:5)
1H JMP *
EASYLOC CON -1
PT1 CON 44
PT2 CON 44
*
READIN STJ 9F
LD1 RBUF
IN 0,1(READER)
LD1 16,1
ST1 RBUF
ST1 1F(0:2)
LD1 PBUF
INC1 3
1H MOVE *(16)
JMP PRINTOUT
9H JMP *
RBUF CON RBUF1
*
PRINTOUT STJ 1F
LD1 PBUF
OUT 0,1(PRINTER)
LD1 24,1
ST1 PBUF
MOVE -1,1(24)
1H JMP *
PBUF CON PBUF1
*
ERROR1 STJ ERRSW
ERROR CHAR
LD1 PBUF
STX 2,1(2:3)
ENTA 49
ENTX 0
SRAX 5,5
LD3N RBUF
INC3 0,1
INC3 2,6
STA 0,3
STX 1,3
MOVE 2F(2)
LDA ERRCOUNT
INCA 1
STA ERRCOUNT
JMP PRINTOUT
ERRSW JMP NEXT1
2H ALF ****
ALF ERROR
*
* BEGINNING OF COMPILER AND LEXICAL SCAN
*
RATOR ORIG *+30
RAND ORIG *+30
LOUP CON 0
CON OBJECT(1:2),2(3:3)
ORIG *+18
BEGIN IOC 0(TAPE)
IN RBUF2(READER)
IOC 0(PRINTER)
JMP FIXUP
ENTA SSIZE
STA PT1
ENT1 TBUF
JBUS *(TAPE)
MOVE STANDARD(SSIZE)
JMP PRINTOUT
2H JMP READIN
LD1 RBUF
LDA 0,1
CMPA 1F
JNE 3F
STZ LSW(5:5)
JMP 2B
1H ALF LIST
*
NEXT J2NZ BAD
NEXT1 JMP READIN
LD1 RBUF
LDA 1,1(1:1)
JANZ NEXT1
LABEL LDA INSLABEL(0:2)
JAN 1F
INCA 1
ADD PROG
JMP FIXUP
LDA UNDLABEL
STA INSLABEL
1H LD1 RBUF
3H LDX 0,1
JXZ 1F
ENTA 0
NUM
JMP CSERCH
LDA 1,1(3:3)
DECA 3
JAZ *+6
LD6 RBUF
INC6 1
ENT5 -5
ENTA 12
JMP ERROR
LDA 1,1(0:2)
LDX PROG(0:2)
STX 1,1(0:2)
ENTX 2
STX 1,1(3:3)
JAN 1F
INCA 1
ADD PROG
JMP FIXUP
1H ENT3 0
ENT2 0
ENT4 0
STZ S
STZ REG
STZ RX
NEWCARD LD6 RBUF
ENTA 49
STA 14,6(3:3)
INC6 1
ENT5 -4
LDA LDELIM
STA RATOR
*
LEXSCAN ENT1 5
LDX 0,6
SLAX 5,5
ENTA 0
JXNZ 1F
ENT5 -5
INC6 1
LDX 0,6
JXZ *-2
1H CMPX =40(1:1)=(1:1)
JL 2F
INC5 1 SPECIAL CHARACTER SCANNED
SLAX 1
DECA 52
JAN SSCAN
BADCHAR ENTA 9
JMP ERROR
2H SLAX 1
INC5 1
JAZ 1B
DEC1 1
J1NZ *+2
STA TEMP
J5N *+4
ENT5 -5
INC6 1
LDX 0,6
CMPX =0=(1:1)
JE *+3
CMPX =40(1:1)=(1:1)
JL 2B
ENTX 0
J1NN 2F
CMP1 =-5=
JGE *+3
ENTA 11
JMP ERROR
SLC 10,1
LDA TEMP
JMP 3F
2H SLAX 0,1
3H CMPA =30(1:1)=(1:1)
JGE CONST
IDENT ENT1 ROOT
ST2 TEMP HERE BEGINS THE PREVIOUS "SEARCH" ROUTINE
1H ENT2 0,1
CMPA 0,1
JL 2F
JG 3F
CMPX 1,1
JE 7F
JG 3F
2H LD1 2,1(2:3)
J1P 1B
LD1 Y
ST1 2,2(2:3)
JMP 4F
3H LD1 2,1(4:5)
J1P 1B
LD1 Y
ST1 2,2(4:5)
4H ENT2 4,1
ST2 Y
DEC2 3998
J2NN NOROOM
STA 0,1
STX 1,1
STZ 2,1
7H LD2 TEMP HERE END THE PREVIOUS "SEARCH" ROUTINE
LDA 2,1(1:1)
CMPA =1=
JG SSCAN
STZ RAND+1,3
INC1 3
8H INC3 1
ST1 RAND,3(0:2)
CMP3 =29=
JL SSCAN
NOROOM ENTA 13
JMP ERROR
CONST SRAX 5,1
NUM
JMP CSERCH
LDA UNDLABEL
STA RAND+1,3
ENTA 0
INC1 2
JMP 8B
CON 100000
UNDLABEL CON -1(0:2),3(3:3)
INSLABEL CON -1(0:2),3(3:3)
*
CSERCH STJ 9F
ENT1 CROOT
ST2 TEMP
1H ENT2 0,1
CMPA 0,1
JE 7F
JG 3F
LD1 1,1(4:5)
J1P 1B
LD1 Y
ENTX 0,2
ST1 1,2(4:5)
JMP 4F
3H LD1 2,1(4:5)
DEC2 0,1
J2N 1B
INC2 0,1
LD1 Y
LDX 2,2
ST1 2,2(4:5)
4H ENT2 3,1
ST2 Y
STX 2,1(4:5)
DEC2 3998
J2NN NOROOM
STA 0,1
LDX UNDLABEL
STX 1,1
ENNX BYTESIZE+4
STX 2,1(0:3)
7H LD2 TEMP
9H JMP *
CROOT CON 100
CON -1(0:2),3(3:3)
CON -1(0:2),4(3:3)
*
* SYNTAX SCANNER
*
TRUNSTILE ENTA 12
SSCAN STA OP
LD1 OP
LDA CONTROL,1
JAN 2F
LDX CONTROL,1(2:2)
DECX 0,4
JXNZ BAD
4H LD4 CONTROL,1(3:3)
2H STA *+1(1:2)
JMP *
UNITARY INC1 18
J4Z STACK
ENT4 0
*
COMPARE1 LD1 OP
LDA CONTROL,1
COMPARE CMPA RATOR,2(1:1)
JG STACK
LD1 RATOR,2(4:5)
DEC2 1
LDA RAND,3
JMP 0,1
*
STACK1 LD1 OP
STACK DEC2 29
J2NN NOROOM
INC2 30
LDA STACKT,1
STA RATOR,2
JAP LEXSCAN
STZ RATOR(2:2)
JMP EQSTAK
*
EQUAL LDX S
JXZ COMPARE
ENTA 2
JMP SSCAN
LPREN LDA OP
INCA 9
JAZ LEXSCAN
ENTA 1
JMP ERROR
IF1 ENTA 1
STA S
JMP STACK
IF2 LDX OP
DECX 13
JXNZ BAD
LDX S
JXZ IF3
JMP BAD
REPL LDX RATOR,2(3:3)
JXNZ REPL1
BAD ENTA 10
JMP ERROR
ARRAY1 ENTX 1
STX LPRENR(2:2)
JMP STACK
LD LDX OP
DECX 12
ENTA 2
JXNZ ERROR
ENTA 14
LDX RATOR(2:2)
JXNZ ERROR
JMP NEXT1
*
CARDEND LD1 RBUF
LD1 16,1
JBUS *(READER)
LDA 1,1(1:1)
JAZ TURNSTILE
JMP READIN
JMP NEWCARD
*
* XMIX INTERPRETIVE ROUTINE
*
XMIX STJ XMIX(0:5)
XMIXC LD1 XMIXP
LDA 0,1
STA XMIXI
INC1 1
ST1 XMIXP
LD1 XMIXI(3:3)
JMP *+1,1
JMP XMIXC
JMP RE
JMP FR
JMP CI
JMP CP
JMP LOAD
LD1 XMIXI(1:2)
JMP 0,1
*
RE STA RX(5:5)
DEC3 1
ST3 REG
STZ RAND,3
JMP COMPARE1
*
FR JMP FRSUB
JMP XMIXC
FRSUB STJ 1F
LD1 LD1 REG
J1Z 1F
LD1 TEMPS(4:5)
J1P 2F
LD1 Y
ENTX 1,1
STX Y
DECX 3998
JXNN NOROOM
STZ 0,1
ENTX 5
STX 0,1(3:3)
2H JMP ADDR
LDA 0,1
STA TEMPS(4:5)
ENTA 1
STA 0,1(3:3)
ENTA 0,1
LD1 REG
STA RAND,1(1:2)
STZ REG
LDA STA
ADD RX
STA INST(3:5)
STZ RX
JMP COMPL
1H JMP *
*
LOAD LD1N XMIXI(0:2)
INC1 0,3
ST1 3F(0:2)
LDA RAND,1
LDX RX
JANZ 1F
STZ RX
JXZ XMIXC
LDA SLAX5
JMP COMPL1
JMP XMIXC
SLAX5 SLAX 5
1H JMP FRSUB
3H ENT1 *
ST1 REG
*
CI LD1N XMIXI(0:2)
INC1 0,3
LDA RAND,1
STA STA V
LD1 V(4:5)
J1Z 1F
JMP ADDR
LDA LD1
STA INST(3:5)
JMP COMPL
1H LD1 V(1:2)
JMP ADDR
2H LDA XMIXI(4:5)
STA INST(3:5)
LDA V(4:5)
JAZ *+3
ENTA 1
STA INST(3:3)
2H JMP COMPL
JMP XMIXC
CP STA INST
STZ INST(3:3)
JMP 2B
*
ADDR STJ 9F
LDA 0,1
STA INST
ST2 TEMP
LD2 INST(3:3)
JMP *+1,2
JMP 0F VARIABLE
JMP 1F ACTIVE TEMP
JMP 2F LABEL
JMP 3F FUTURE LABEL
JMP 4F CONSTANT
JMP 5F INACTIVE TEMP
4H LDA -2,1
CHAR
STA COMT
JMP FREF
JMP 6F
3H JMP FREF
2H LDA -1,1(1:5)
CHAR
CMPA 7F
JG 8F
JMP 6F
1H LDA TEMPS
STA 0,1(3:5)
ST1 TEMPS(4:5)
5H LDX *+2
JMP 4F
ALF TEMP
0H LDA -3,1
LDX -2,1
STA COMT
4H LDA 0,1(1:2)
JANZ 4F
LDA VAR
DECA 1
STA VAR
STA 0,1(1:2)
4H STA INST(1:2)
6H STX COMT1
8H LD2 TEMP
9H JMP *
7H ALF 00000
FREF STJ 9F
LDA PROG(0:2)
STA 0,1(0:2)
ENTA 47
LD2 PBUF
STA 3,2(4:4)
9H JMP *
TEMPS CON 5(3:3)
*
* GENERATORS
*
ADD JAZ 1F
JMP XMIX
LDA 1,5 LD(1)
ADD 0,3 CI ADD(0)
NOP 0,1 RE(0)
1H JMP XMIX
LDA 0,5 LD(0)
ADD 1,3 CI ADD(1)
NOP 0,1 RE(0)
SUB JMP XMIX
LDA 1,5 LD(1)
SUB 0,3 CI SUB(0)
NOP 0,1 RE(0)
MUL JAZ 1F
JMP XMIX
LDA 1,5 LD(1)
MUL 0,3 CI MUL(0)
MOVE 0,1(0) RE(1)
1H JMP XMIX
LDA 0,5 LD(0)
MUL 1,3 CI MUL(1)
MOVE 0,1(0) RE(1)
DIV JMP XMIX
LDA 1,5 LD(1)
SRAX 5,4 CP SRAX 5
DIV 0,3 CI DIV(0)
NOP 0,1 RE(0)
NEG INC3 1
JMP XMIX
NOP 0,2 FR
LDAN 1,3 CI LDAN(1)
NOP 0,1 RE(0)
SUBSC JAZ 1F
LDA RAND,3(4:5)
JAZ 2F
JMP XMIX
LDA 0,5
NOP *+1,6 XT *+1
1H JMP FRSUB
2H LDA RAND,3(1:2)
STA RAND-1,3(4:5)
DEC3 1
JMP COMPARE1
EQSTAK LDA RAND,3(1:2)
STA LHS
ENT1 0,3
DEC1 1
J1Z LEXSCAN
CMPA RAND,1(4:5)
JNE *-3
JMP XMIX
NOP 0,2 FR
LDA 0,5 LD(0)
NOP 0,2 FR
NOP *+1,6 XT *+1
ENT1 -1,3
LDX RAND,3(1:2)
LDA LHS
STA RAND,3(1:2)
CMPA RAND,1(4:5)
JNE *+2
STX RAND,1(4:5)
DEC1 1
J1P *-4
JMP LEXSCAN
REPL1 LD1 RAND-1,3(1:2)
J1Z NOVAR
LDA 0,1(3:3)
JAZ *+3
NOVAR ENTA 4
JMP ERROR
LDA RX
JANZ 1F
JMP XMIX
LDA 0,5
STA 1,3 CI STA(1)
NOP 0,1 RE(0)
1H JMP XMIX
STX 1,3 CI STX(1)
MOVE 0,1(0) RE(1)
*
LSS ENTX 7 "GE"
JMP 2F
GTR ENTX 9 "LE"
JMP 2F
EQL ENTX 8 "NE"
2H STX 1F(4:4)
DECX 16
STX 3F(4:4)
LDX 4F
STX RAND+1,3
JAZ 5F
JMP XMIX
LDA 1,5 LD(1)
CMPA 0,3
1H JNE -1,3 CI JNE(-1)
NOP *+1,6 XT
6H LDA S
DECA 1
STA S
DEC3 2
STZ REG
JMP COMPARE1 RETURN TO SYNTAX SCAN
5H JMP XMIX
LDA 0,5 LD(0)
CMPA 1,3 CI CMPA(1)
3H JNE -1,3 CI JNE(-1)
NOP 6B,6
4H CON INSLABEL(1:2)
IF3 EQU LEXSCAN
*
GO LDX RAND,3(3:3)
ENTA 7
JXZ ERROR
LD1 RAND,3(1:2)
DEC1 1
JMP ADDR
ENTA 39 "JMP"
STA INST(3:5)
JMP COMPL
JMP NEXT
FOR0 STZ REG COMMA OCCURS
LDA RX
STA 3F(1:2)
STZ RX
JMP STACK1
FOR1 LDA RAND,3(3:3)
JAZ 2F
LDA SLAX5
3H ENTX *
JXNZ COMPL1
JMP 1F
2H LDA LHS
STA RAND+1(1:2)
LDA RAND,3
JAZ 4F
JMP XMIX
LDA 0,5
4H JMP XMIX
LDA 1,5
NOP *+1,6 XT
LD1 RAND,3(1:2)
ENTA 5
STA 0,1(3:3)
1H LD1 L
INC1 2
CMP1 =20=
JGE NOROOM
ST1 L
LDA LHS
STA LOOP,1
LDA UNDLABEL(0:3)
STA LOOP,1(0:3)
LDA PROG(1:2)
STA LOOP+1,1(1:2)
ENTA 2
STA LOOP+1,1(3:3)
ENTA LOOP,1
STZ RAND+1,3
STA RAND+1,3(1:2)
JMP XMIX
CMPA 0,3 CI CMPA(0)
JG -1,3 CI JG(-1)
NOP NEXT,6 XT
END LD1 L
LDA RAND,3(1:2)
CMPA LOOP,1(4:5)
JNE BADFOR
LDA LOOP,1
STA INSLABEL
ENTA LOOP+1,1
STZ RAND+1,3
STA RAND+1,3(1:2)
DEC1 2
ST1 L
JMP XMIX
LDA 0,3 CI LDA(0)
INCA 1,4 CP INCA 1
STA 0,3 CI STA(0)
JMP -1,3 CI JMP(-1)
NOP NEXT,6 XT NEXT
BADFOR ENTA 8
JMP ERROR
*
IN LD1 RAND,3(1:2)
J1Z NOVAR
LDA 0,1(3:3)
JANZ NOVAR
JMP XMIX
NOP 0,2 FR
JMP INSUB,4 CP JMP INSUB
STA 0,3 CI STZ(0)
NOP NEXT,6 XT
OUT JMP XMIX
LDA 0,5 LD(0)
JMP OUTSUB,4 CP JMP OUTSUB
NOP NEXT,6 XT
ARRAY DEC3 2
J3Z *+4
1H ENTA 6
STZ LPRENR(2:2)
JMP ERROR
LDX RAND+2(3:3)
JXZ 1B
LD1 RAND+1(1:2)
LDX 0,1(1:2)
JXNZ 1B
LD3 RAND+2(1:2)
LDA VAR
SUB -2,3
DECA 1
STA VAR
STA 0,1(1:2)
ENT3 0
ENTA 1
STA -1,1(1:1)
LDA OP
DECA 12
JAZ 1F
INC2 1
JMP LEXSCAN
1H STZ LPRENR(2:2)
JMP NEXT
*
* THE END OF COMPILATION
*
STOP LD4 L
ENTA 8
J4P ERROR1
DEC4 2
J4P *-3
LDA HLT(4:5)
JMP COMPL1
STZ FMTSW
ENT2 CROOT
ENT4 0,2
3H LD2 1,4(4:5)
J2NZ *-2
4H LDA 2,4(0:2)
JAN 1F
INCA 1
ADD PROG
JMP FIXUP
LDA 0,4
JMP COMPL1
1H LDA 1,4(0:2)
JAN 1F
LDA 1,4(3:3)
DECA 3
JANZ 1F
LDA 0,4
CHAR
LD2 PBUF
STX 3,2
ENTA 7
JMP ERROR1
1H CMP4 2,4(4:5)
LD4 2,4(4:5)
JL 3B
J4P 4B
LDA PROG(1:2)
CMPA VAR
ENTA 13
JG ERROR1
LDA 2F
STZ SWITCH
JMP FIXUP
LD2 PBUF
LDA ERRCOUNT
CHAR
STX 0,2
ENT1 23
LDA 1F
STA 1,2
INC2 1
DEC1 1
J1P *-3
JMP PRINTOUT
OUT TBUF(TAPE)
IOC 0(TAPE)
IOC 0(PRINTER)
HLT HLT 2
ENT6 3500
IN 0,6(TAPE)
IN 40,6(TAPE)
JMP 0,6
1H ALF .....