-
Notifications
You must be signed in to change notification settings - Fork 6
/
TRANS.ASM
1213 lines (1208 loc) · 14.7 KB
/
TRANS.ASM
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
; Z80 to 8086 Translator version 2.21
; Runs on the 8086 under 86-DOS
; by Tim Paterson
;
ORG 100H
EOF: EQU 1AH ;End of file
EOL: EQU 0DH
FCB: EQU 5CH
SYSTEM: EQU 5
OPEN: EQU 15
CLOSE: EQU 16
SETDMA: EQU 26
CREATE: EQU 22
DELETE: EQU 19
READ: EQU 20
WRITE: EQU 21
PRNBUF: EQU 9
MOV SP,STACK
MOV DX,HEADER
MOV CL,9
CALL SYSTEM
MOV BX,FCB+12
XOR AL,AL
MOV CH,4
CLRFCB:
MOV [BX],AL
INC BX
DEC CH
JNZ CLRFCB
MOV [FCB+32],AL
MOV BX,FCB
MOV DX,PUTFCB
MOV CX,16
UP
MOV SI,BX
MOV DI,DX
REP
MOVB
MOV DX,DI
MOV BX,SI
MOV [PUTFCB+32],AL
MOV BX,"A"+5300H ;"AS"
MOV [PUTFCB+9],BX
MOV AL,'M'
MOV [PUTFCB+11],AL
MOV DX,FCB
MOV CL,OPEN
CALL SYSTEM
INC AL
MOV DX,NOFILE
JZ ABORTJ
MOV DX,PUTFCB
MOV CL,DELETE
CALL SYSTEM
MOV DX,PUTFCB
MOV CL,CREATE
CALL SYSTEM
INC AL
MOV DX,NOROOM
ABORTJ:
JZ ABORT
MOV DX,PUTFCB
MOV CL,OPEN
CALL SYSTEM
MOV BX,PUTBUF
MOV [PUTPT],BX
MOV BX,GETBUF+80H
MOV [GETPT],BX
TRANLN:
XOR AL,AL
MOV [OP1],AL
MOV [OP2],AL
MOV BX,OPCODE
CALL LOAD
MOV BX,OP1
CALL GETOP
MOV B,[BX],0
MOV BX,OP2
CALL GETOP
DOLIN:
MOV B,[BX],0
CALL FINDOP
ENLIN:
MOV SP,STACK
MOV AL,[CHAR]
CMP AL,';'
JNZ NOCOM
MOV AL,9
CALL PUTCH
MOV AL,';'
NOCOM:
CALL PUTCH
PUTLIN:
CMP AL,EOF
JZ END
CALL GETCH
CALL PUTCH
CMP AL,10
JNZ PUTLIN
JP TRANLN
END:
MOV CH,127
MOV AL,1AH
FILL:
CALL PUTCH
DEC CH
JNZ FILL
MOV DX,PUTFCB
MOV CL,CLOSE
CALL SYSTEM
MOV DX,ENDMES
ABORT:
MOV CL,PRNBUF
CALL SYSTEM
JMP 0
DELIM:
CALL GETCH
DELCHK:
CMP AL,EOL
JZ DOLIN
CMP AL,EOF
JZ DOLIN
CMP AL,';'
JZ DOLIN
CMP AL,' '
JZ RET
CMP AL,':'
JZ RET
CMP AL,','
JZ RET
CMP AL,9
RET
HEX:
AND AL,0FH
ADD AL,90H
DAA
ADC AL,40H
DAA
PUTCH:
PUSH BX
PUSH DX
PUSH CX
LAHF
XCHG AH,AL
PUSH AX
XCHG AH,AL
AND AL,7FH
MOV BX,[PUTPT]
MOV [BX],AL
INC BX
MOV [PUTPT],BX
CMP BX,PUTBUF+80H
JNZ POPRET
MOV DX,PUTBUF
MOV [PUTPT],DX
MOV CL,SETDMA
CALL SYSTEM
MOV DX,PUTFCB
MOV CL,WRITE
CALL SYSTEM
OR AL,AL
MOV DX,WRTERR
JNZ ABORT
POPRET:
POP AX
XCHG AH,AL
SAHF
NOTAF:
POP CX
POP DX
POP BX
RET
;
; Get character from source file.
;
GETCH:
PUSH BX
PUSH DX
PUSH CX
MOV BX,[GETPT] ; Get buffer pointer.
CMP BX,GETBUF+80H ; Past end-of-buffer?
JNZ GETIT ; Jump if not.
MOV DX,GETBUF ; Set `DMA address'.
MOV CL,SETDMA
CALL SYSTEM
MOV DX,FCB ; Read the next record from source file.
MOV CL,READ
CALL SYSTEM
CMP AL,0 ; Entire record read OK?
JE OKRECORD
CMP AL,3 ; Partial record read?
JE OKRECORD
MOV AL,EOF ; Force end-of-file character in case
JP TESEND ; there is nothing in the record.
OKRECORD:
MOV BX,GETBUF ; Reset buffer pointer.
GETIT:
MOV AL,[BX] ; Get next character from buffer.
INC BX ; Point to next character.
MOV [GETPT],BX ; Save new pointer.
TESEND:
MOV [CHAR],AL
JP NOTAF ; Pop registers and return.
LOAD:
CALL DELIM
JZ LOADOP
EATLAB:
CALL PUTCH
CALL DELIM
JNZ EATLAB
ENLAB:
MOV AL,':'
CALL PUTCH
LOADOP:
MOV BX,OPCODE
EATEM:
CALL DELIM
JZ EATEM
LOADLP:
CALL IDCHK
JNC $+5
JMP OPERR
MOV [BX],AL
INC BX
CALL DELIM
JNZ LOADLP
MOV B,[BX],0
CMP AL,':'
JNZ RET
MOV BX,OPCODE
CALL TRANS
JP ENLAB
GETOP:
XOR AL,AL
LAHF
XCHG AX,BP
SAHF
GETLP:
CALL DELIM
JZ GETLP
OPCHAR:
CMP AL,'('
JNZ NOTLEF
LAHF
XCHG AX,BP
SAHF
INC AL
LAHF
XCHG AX,BP
SAHF
MOV B,[BX],'['
JP NEXCH
NOTLEF:
CMP AL,')'
JNZ NOTRIT
LAHF
XCHG AX,BP
SAHF
DEC AL
LAHF
XCHG AX,BP
SAHF
MOV B,[BX],']'
JP NEXCH
NOTRIT:
MOV [BX],AL
CMP AL,''''
JZ EATQUO
CALL IDCHK
JNC GETID
NEXCH:
INC BX
CALL GETCH
IDRET:
CALL DELCHK
JNZ OPCHAR
CMP AL,' '
JZ OPCHAR
RET
EATQUO:
INC BX
CALL GETCH
MOV [BX],AL
CMP AL,';'
JZ L0000
CALL DELCHK
L0000:
CMP AL,''''
JNZ EATQUO
JP NEXCH
IDCHK:
CMP AL,'0'
JC RET
CMP AL,'9'+1
CMC
JNC RET
CMP AL,40H
JC RET
AND AL,5FH
CMP AL,'A'
JC RET
CMP AL,'Z'+1
CMC
RET
GETID:
MOV [BX],AL
MOV CH,1
LODID:
INC BX
CALL GETCH
CALL IDCHK
JC RWCHK
MOV [BX],AL
INC CH
JP LODID
RWCHK:
LAHF
XCHG AH,AL
PUSH AX
XCHG AH,AL
PUSH BX
DEC BX
DEC CH
MOV DL,CH
JZ LOOKRW
MOV DL,[BX]
DEC BX
DEC CH
JNZ NORW
LOOKRW:
MOV AL,[BX]
MOV DH,AL
PUSH BX
MOV BX,RWTAB
MOV CX,LENRW
RWLK:
UP
MOV DI,BX
REPNZ
SCAB
MOV BX,DI
JNZ NOTRW
PUSH BX
PUSH CX
MOV CX,LENRW-1
LAHF
ADD BX,CX
RCR SI
SAHF
RCL SI
MOV AL,[BX]
POP CX
POP BX
CMP AL,DL
JZ HAVRW
MOV AL,CL
OR AL,AL
MOV AL,DH
JNZ RWLK
NOTRW:
POP BX
NORW:
POP BX
ENDRW:
POP AX
XCHG AH,AL
SAHF
JMP IDRET
HAVRW:
POP BX
INC CL
MOV [BX],CL
INC BX
POP DX
PUSH BX
MOV AL,CL
MOV BX,IXSI
CMP AL,RSI
JZ IXIY
MOV BX,IYDI
CMP AL,RDI
JNZ NORW
IXIY:
LAHF
XCHG AX,BP
SAHF
JZ NOTENC
LAHF
XCHG AX,BP
SAHF
CALL OUTSTR
JP NORW
NOTENC:
LAHF
XCHG AX,BP
SAHF
POP BX
DEC BX
MOV B,[BX],'['
INC BX
ADD AL,RIX-1
MOV [BX],AL
INC BX
MOV B,[BX],']'
INC BX
JP ENDRW
RET
FINDOP:
MOV BX,OPCODE
MOV CX,5
XOR AL,AL
UP
MOV DI,BX
REPNZ
SCAB
MOV BX,DI
JNZ OPERR
MOV AL,4
SUB AL,CL
JZ RET
DEC AL
JZ OPERR
MOV CL,AL
DEC BX
DEC BX
OR B,[BX],080H
MOV AL,[OPCODE]
SUB AL,'A'
JC OPERR
ADD AL,AL
MOV DL,AL
MOV DH,0
MOV BX,OPTAB
LAHF
ADD BX,DX
RCR SI
SAHF
RCL SI
MOV DL,[BX]
INC BX
MOV DH,[BX]
XCHG DX,BX
MOV AL,9
CALL PUTCH
LOOKOP:
MOV AL,[BX]
OR AL,AL
JZ OPERR
MOV DX,OPCODE+1
MOV CH,CL
LOOKLP:
MOV SI,DX
LODB
CMP AL,[BX]
JNZ NEXOP
INC DX
INC BX
DEC CH
JNZ LOOKLP
MOV DX,[BX]
MOV BX,[BX+2]
JMP DX
NEXOP:
RCR SI
TEST B,[BX],080H
RCL SI
LAHF
INC BX
SAHF
JZ NEXOP
MOV DX,4
LAHF
ADD BX,DX
RCR SI
SAHF
RCL SI
JP LOOKOP
OPERR:
MOV BX,OPCODE
CALL OUTSTR
CALL TWOOPS
MOV BX,OPCDER
CALL OUTSTR
JMP ENLIN
LD:
CALL OUTSTR
MOV BX,OP1
MOV DX,OP2+1
CALL LCHECK
JNZ $+5
JMP LDAX
XCHG DX,BX
DEC BX
INC DX
CALL LCHECK
JNZ $+5
JMP STAX
;If immediate move, check for byte memory reference
MOV AL,[OP2]
CMP AL,20H ;Could be immediate?
MOV AL,9
JC L0001
CALL BYTCHK ;Add "B," if memory reference
L0001:
CALL TRAN1
JP TRNOP2
TWOOPS:
CALL TRNOP1
TRNOP2:
MOV AL,','
TRAN2:
MOV BX,OP2
PTRANS:
CALL PUTCH
TRANS:
MOV AL,[BX]
LAHF
INC BX
SAHF
OR AL,AL
JZ RET
CALL TRNTOK
JP TRANS
LCHECK:
MOV AL,[BX]
CMP AL,RAL
JNZ RET
MOV SI,DX
LODB
CMP AL,RCX
JZ RET
CMP AL,RDX
RET
ONEOP:
CALL OUTSTR
MOV AL,9
CALL BYTCHK ;If memory reference, add "B," flag
JMPS TRAN1
TRNOP1:
MOV AL,9
TRAN1:
MOV BX,OP1
JP PTRANS
IN:
MOV AL,[OP1]
CMP AL,RAL
XCHG DX,BX
MOV BX,OP2
JZ GETPORT
MOV BX,SAVEAX
CALL OUTSTR
CALL OUTSTR
MOV BX,OP2
CALL GETPORT
MOV BX,MOV0
CALL ONEOP
MOV AL,','
CALL PUTCH
MOV AL,RAL
CALL TRNTOK
IODONE:
MOV BX,RESTAX
JMP OUTSTR
OUT:
MOV AL,[OP2]
XCHG DX,BX
MOV BX,OP1
CMP AL,RAL
JZ GETOUT
MOV BX,SAVEAX
CALL OUTSTR
MOV BX,MOVAL
CALL OUTSTR
CALL TRNOP2
MOV BX,CRLFTB
CALL OUTSTR
MOV BX,OP1
CALL GETOUT
JP IODONE
GETPORT:
MOV AL,[BX]
CMP AL,'['
JNZ NOBRAK
LAHF
INC BX
SAHF
PUSH BX
MOV CX,80
MOV AL,']'
UP
MOV DI,BX
REPNZ
SCAB
MOV BX,DI
LAHF
DEC BX
SAHF
MOV B,[BX],0
POP BX
NOBRAK:
MOV AL,[BX]
CMP AL,RGCL
JNZ FIXPOR
MOV BX,IO1
CALL OUTSTR
XCHG DX,BX
CALL OUTSTR
MOV AL,RDX
CALL TRNTOK
MOV BX,IO2
JMP OUTSTR
GETOUT:
CALL GETPORT
JNC RET
MOV BX,BADIO
JMP OUTSTR
FIXPOR:
XCHG DX,BX
CALL OUTSTR
XCHG DX,BX
JMP TRANS
LDAX:
MOV BX,LDAX1
LSAX:
CALL OUTSTR
MOV SI,DX
LODB
CALL TRNTOK
JP OUTSTR
STAX:
MOV BX,STAX1
JP LSAX
TRNTOK:
CMP AL,' '
JC $+5
JMP PUTCH
PUSH BX
PUSH CX
MOV CL,AL
MOV CH,0
MOV BX,TOKTAB-2
LAHF
ADD BX,CX
RCR SI
SAHF
RCL SI
LAHF
ADD BX,CX
RCR SI
SAHF
RCL SI
MOV AL,[BX]
CALL PUTCH
INC BX
MOV AL,[BX]
POP CX
POP BX
OR AL,AL
JZ RET
JMP PUTCH
PUSH:
MOV DX,PUSHAF
JP AFCHK
POP:
MOV DX,POPAF
AFCHK:
MOV AL,[OP1]
CMP AL,RAX
JNZ ONEOPJ
XCHG DX,BX
OUTSTR:
MOV AL,[BX]
OR AL,AL
JNZ L0002
CALL NEWOP
L0002:
CALL PUTCH
INC BX
ADD AL,AL
JNC OUTSTR
RET
NEWOP:
MOV AL,13
CALL PUTCH
MOV AL,10
CALL PUTCH
MOV AL,9
RET
LDDR:
CALL OUTSTR
MOV BX,BLMOVE
JP OUTSTR
CPDR:
CALL OUTSTR
MOV BX,CMPREP
JP OUTSTR
ADD:
MOV AL,[OP1]
CMP AL,RBX
JZ DAD
ARITH:
CALL OUTSTR
MOV AL,[OP2]
OR AL,AL
JZ $+5
JMP TWOOPS
MOV AL,9
CALL PUTCH
MOV AL,RAL
CALL TRNTOK
MOV AL,','
JMP TRAN1
ACCUM:
CALL OUTSTR
MOV AL,9
CALL PUTCH
MOV AL,RAL
JMP TRNTOK
ONEOPJ: JMP ONEOP
DAD:
MOV BX,DAD1
CALL OUTSTR
CALL TWOOPS
MOV BX,DAD2
JP OUTSTR
INCDEC:
MOV AL,[OP1]
CMP AL,RCX+1 ;16-bit?
JNC ONEOPJ
MOV BX,LAHF
CALL OUTSTR
XCHG DX,BX
MOV BX,OPCODE-1
CALL ONEOP
XCHG DX,BX
OUTSTRJ:
JMP OUTSTR
JUMP:
MOV AL,[OP1]
CMP AL,'['
JNZ DIRECT
MOV AL,[OP1+1]
MOV [OP1],AL
XOR AL,AL
MOV [OP1+1],AL
DIRECT:
MOV AL,[OP2]
OR AL,AL
JZ ONEOPJ
CALL FIXCON
MOV BX,OP2
OUTCON:
MOV CH,AL
MOV AL,'J'
CALL PUTCH
MOV AL,CH
CALL TRNTOK
MOV AL,9
CALL PTRANS
MOV AL,CH
CMP AL,ODDPAR
MOV BX,WARNPA
JZ OUTSTRJ
CMP AL,EVEPAR
JZ OUTSTRJ
RET
FIXCON:
MOV AL,[OP1]
CMP AL,RGCL
JNZ RET
MOV AL,CY
RET
RETURN:
MOV AL,[OP1]
OR AL,AL
JZ OUTSTRJ
MOV BX,'R'+4500H ;"RE"
MOV [OP2],BX
MOV BX,'T'
MOV [OP2+2],BX
JP DIRECT
ONEOPJ1:
JMP ONEOP
DOCALL:
MOV AL,[OP2]
OR AL,AL
JZ ONEOPJ1
CALL FIXCON
DEC AL
XOR AL,1
INC AL
MOV BX,LABEL
CALL OUTCON
MOV BX,OPCODE-1
CALL OUTSTR
MOV AL,[OP2]
OR AL,AL
MOV AL,9
MOV BX,OP2
JZ L0003
CALL PTRANS
L0003:
MOV BX,CRLF
CALL OUTSTR
CALL TRANS
CALL OUTSTR
MOV BX,LABEL+4
NEXLAB:
INC [BX]
MOV AL,[BX]
CMP AL,'9'+1
JNZ RET
MOV B,[BX],'0'
LAHF
DEC BX
SAHF
JP NEXLAB
EX:
MOV AL,[OP1]
CMP AL,RAX
JZ OUTSTRJ1
MOV AL,[OP1+1]
CMP AL,STP
JZ XTHL
MOV BX,XCHG
CALL OUTSTR
JMP TWOOPS
XTHL:
MOV BX,XTHL1
CALL OUTSTR
CALL TRNOP2
MOV BX,XTHL2
OUTSTRJ1:
JMP OUTSTR
PSEUDO:
CALL ONEOP
MOV AL,[OP2]
OR AL,AL
JZ RET
JMP TRNOP2
RET
BITSET:
MOV CL,0
JP SETRES
RES:
MOV CL,-1
SETRES:
CALL OUTSTR
PUSH BX
MOV AL,[OP2]
CMP AL,'['
MOV AL,9
JNZ L0004
CALL BFLAG
L0004:
CALL TRAN2
MOV AL,','
CALL PUTCH
CALL GETBIT
MOV BX,BITERR
JNC L0005
CALL OUTSTR
L0005:
POP BX
JMP OUTSTR
BYTCHK:
;Check if memory reference and add "B," for byte mode
CMP B,[OP1],"[" ;Memory reference?
JNZ RET
CMP B,[OP1+1],RIX ;Referencing IX as a word?
JZ RET
CMP B,[OP1+1],RIY
JZ RET
BFLAG:
CALL PUTCH
MOV AL,'B'
CALL PUTCH
MOV AL,','
RET
GETBIT:
MOV AL,[OP1+1]
OR AL,AL
STC
JNZ RET
MOV AL,[OP1]
SUB AL,'0'
JC RET
CMP AL,8
CMC
JC RET
MOV CH,AL
INC CH
XOR AL,AL
STC
SHFT:
RCL AL
DEC CH
JNZ SHFT
XOR AL,CL
MOV CH,AL
MOV AL,'0'
CALL PUTCH
MOV AL,CH
RCR AL
RCR AL
RCR AL
RCR AL
CALL HEX
MOV AL,CH
CALL HEX
MOV AL,'H'
JMP PUTCH
OPTAB:
DW AOPS,BOPS,COPS,DOPS,EOPS
DW FOPS,GOPS,HOPS,IOPS,JOPS
DW KOPS,LOPS,MOPS,NOPS,OOPS
DW POPS,QOPS,ROPS,SOPS,TOPS
DW UOPS,VOPS,WOPS,XOPS,YOPS
DW ZOPS
AOPS:
DM 'DD'
DW ADD,OPCODE
DM 'DC'
DW ARITH,OPCODE
DM 'ND'
DW ARITH,OPCODE
DB 0
BOPS:
DM 'IT'
DW BITSET,TESBIT
DB 0
COPS:
DM 'ALL'
DW DOCALL,OPCODE
DM 'P'
DW ARITH,CMP
DM 'PL'
DW ACCUM,NOT
DM 'PIR'
DW OUTSTR,CPIR
DM 'PDR'
DW CPDR,DOWN
DM 'CF'
DW OUTSTR,CMC
DB 0
DOPS:
DM 'EC'
DW INCDEC,OPCODE
DM 'JNZ'
DW ONEOP,DJNZ
DM 'AA'
DW OUTSTR,OPCODE
DM 'I'
DW OUTSTR,OPCODE
DM 'W'
DW PSEUDO,OPCODE
DM 'B'
DW PSEUDO,OPCODE
DM 'M'
DW PSEUDO,OPCODE
DM 'S'
DW ONEOP,OPCODE
DB 0
EOPS:
DM 'X'
DW EX,EXAF
DM 'I'
DW OUTSTR,OPCODE
DM 'XX'
DW OUTSTR,EXX
DM 'QU'
DW ONEOP,OPCODE
DM 'NDIF'
DW OUTSTR,OPCODE
DB 0
FOPS:
DB 0
GOPS:
DB 0
HOPS:
DM 'ALT'
DW OUTSTR,HLT
DB 0
IOPS:
DM 'NC'
DW INCDEC,OPCODE
DM 'N'
DW IN,INB
DM 'F'
DW ONEOP,OPCODE
DB 0
JOPS:
DM 'R'
DW JUMP,JR
DM 'P'