-
Notifications
You must be signed in to change notification settings - Fork 1
/
smon_acme.asm
1832 lines (1826 loc) · 40.1 KB
/
smon_acme.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
!to"smon__pc000.prg",cbm
PCHSAVE = $02A8 ; PC hi
PCLSAVE = $02A9 ; PC lo
SRSAVE = $02AA ; SR
AKSAVE = $02AB ; A
XRSAVE = $02AC ; XR
YSAVE = $02AD ; YR
SPSAVE = $02AE ; SP
PRNNO = $02AF ; Printer number
IONO = $02B0 ; Device-Number
IRQ_LO = $0314 ; Vector: Hardware IRQ Interrupt Address Lo
IRQ_HI = $0315 ; Vector: Hardware IRQ Interrupt Address Hi
BRK_LO = $0316 ; Vector: BRK Lo
BRK_HI = $0317 ; Vector: BRK Hi
LOADVECT = $0330 ; Vector: Kernal LOAD
SAVEVECT = $0332 ; Vector: Kernal SAVE
WARMSTART = $A474 ; Restart BASIC
ADD = $BC49 ; Addition
INTOUT = $BDCD ; Output Positive Integer in A/X
INTOUT1 = $BDD1 ; Output Positive Integer in A/X
STROUT = $BDDD ; Convert FAC#1 to ASCII String
VIC_CTRL1 = $D011 ; VIC Control Register 1
TIMERA_LO = $DC04 ; Timer A Low-Byte (Kernal-IRQ, Tape)
TIMERA_HI = $DC05 ; Timer A High-Byte (Kernal-IRQ, Tape)
CONTROL_REGA = $DC0E ; Control Register A CIA#1
EN_TIMER = $FDDD ; Enable Timer
OPEN = $FFC0 ; OPEN Vector
CLOSE = $FFC3 ; CLOSE Vector
CHKOUT = $FFC9 ; Set Output
CLRCHN = $FFCC ; Restore I/O Vector
CHRIN = $FFCF ; Input Vector
CHROUT = $FFD2 ; Output Vector
STOP = $FFE1 ; Test STOP Vector
GETIN = $FFE4 ; Vector: Kernal GETIN Routine
*= $c000
lda #$14 ; set break-vector to program start
sta BRK_LO
lda #$C2
sta BRK_HI
ICMD: brk ;"."
byteblock:
!by $27,$23,$24,$25,$2C,$3A,$3B,$3D ;"'#$%,:;"
!by $3F,$41,$42,$43,$44,$46,$47,$49 ;"=?ABCDFG"
!by $4B,$4C,$4D,$4F,$50,$52,$53,$54 ;"IKLMOPRS"
!by $56,$57,$58,$00,$00,$00 ;"TVWX.."
IOFS: !by $00,$00,$DA,$CA,$2D,$C9,$07,$C9 ; Command offsets
!by $1B,$C9,$FB,$C6,$1C,$C4,$B5,$C3
!by $F4,$CA,$99,$C8,$D0,$C6,$6B,$C9
!by $3C,$CA,$5C,$C5,$10,$CB,$E2,$C3
!by $43,$C8,$B6,$CA,$4D,$C8,$F8,$C3
!by $C0,$C9,$3C,$C8,$85,$C3,$4D,$C8
!by $F0,$CB,$42,$CA,$D2,$C9,$6D,$C3
LC061: !by $27,$3A,$3B,$2C,$28,$29,$21,$00
!by $00,$00
LC06B: !by $FF
LC06C: !by $FF,$01
LC06E: !by $00,$41,$5A,$49,$52
LC073: !by $54,$80,$20,$40,$10
LC078: !by $00,$02,$01,$01,$02
LC07D: !by $00,$91,$91,$0D,$53,$D9,$31,$37
!by $32,$0D
LC087: !by $00,$7D,$4C,$7D,$C9,$0D,$0D,$20
!by $20,$50,$43,$20,$20,$53,$52,$20
!by $41,$43,$20,$58,$52,$20,$59,$52
!by $20,$53,$50,$20,$20,$4E,$56,$2D
!by $42,$44,$49,$5A,$43
LC0AC: !by $00,$02,$04
LC0AF: !by $01,$2C,$00
LC0B2: !by $2C,$59,$29
LC0B5: !by $58,$9D,$1F,$FF,$1C,$1C,$1F,$1F
!by $1F,$1C,$DF,$1C,$1F,$DF,$FF,$FF
!by $03
LC0C6: !by $1F,$80,$09,$20,$0C,$04,$10,$01
!by $11,$14,$96,$1C,$19,$94,$BE,$6C
!by $03,$13
LC0D8: !by $01,$02,$02,$03,$03,$02,$02,$02
!by $02,$02,$02,$03,$03,$02,$03,$03
!by $03,$02
LC0EA: !by $00,$40,$40,$80,$80,$20,$10,$25
!by $26,$21,$22,$81,$82,$21,$82,$84
!by $08
LC0FB: !by $08,$E7,$E7,$E7,$E7,$E3,$E3,$E3
!by $E3,$E3,$E3,$E3,$E3,$E3,$E3,$E7
!by $A7,$E7,$E7,$F3,$F3,$F7
LC111: !by $DF,$26,$46,$06,$66,$41,$81,$E1
!by $01,$A0,$A2,$A1,$C1,$21,$61,$84
!by $86,$E6,$C6,$E0,$C0,$24,$4C,$20
!by $90,$B0,$F0,$30,$D0,$10,$50,$70
!by $78,$00,$18,$D8,$58,$B8,$CA,$88
!by $E8,$C8,$EA
LC13C: !by $48,$08,$68,$28,$40,$60,$AA,$A8
!by $BA,$8A,$9A,$98,$38
LC149: !by $F8,$89,$9C,$9E
LC14D: !by $B2,$2A,$4A,$0A,$6A,$4F,$23,$93
!by $B3,$F3,$33,$D3,$13,$53
LC15B: !by $73,$52,$4C,$41,$52,$45,$53,$53
!by $4F,$4C,$4C,$4C,$43,$41,$41,$53
!by $53,$49,$44,$43,$43,$42,$4A,$4A
!by $42,$42,$42,$42,$42,$42,$42,$42
!by $53,$42,$43,$43,$43,$43,$44,$44
!by $49,$49,$4E,$50,$50,$50,$50,$52
!by $52,$54,$54,$54,$54,$54,$54,$53
LC193: !by $53,$4F,$53,$53,$4F,$4F,$54,$42
!by $52,$44,$44,$44,$4D,$4E,$44,$54
!by $54,$4E,$45,$50,$50,$49,$4D,$53
!by $43,$43,$45,$4D,$4E,$50,$56,$56
!by $45,$52,$4C,$4C,$4C,$4C,$45,$45
!by $4E,$4E,$4F,$48,$48,$4C,$4C,$54
!by $54,$41,$41,$53,$58,$58,$59,$45
LC1CB: !by $45,$4C,$52,$4C,$52,$52,$41,$43
!by $41,$59,$58,$41,$50,$44,$43,$59
!by $58,$43,$43,$58,$59,$54,$50,$52
!by $43,$53,$51,$49,$45,$4C,$43,$53
!by $49,$4B,$43,$44,$49,$56,$58,$59
!by $58,$59,$50,$41,$50,$41,$50,$49
!by $53,$58,$59,$58,$41,$53,$41,$43
LC203: !by $44,$08,$84,$81,$22,$21,$26,$20
LC20B: !by $80,$03,$20,$1C,$14,$14,$10,$04
!by $0C
; SMON START
PRGSTART:
cld
lda #$08
sta IONO ; set drive #8
lda #$04
sta PRNNO ; set printer #4
lda #$06
sta $D020 ; border and
sta $D021 ; screen color
lda #$03
sta $0286 ; charcolor
ldx #$05
LC22E: pla
sta PCHSAVE,x ; save stack
dex
bpl LC22E
lda PCLSAVE
bne LC23D
dec PCHSAVE ; PC high
LC23D: dec PCLSAVE ; PC low
tsx
stx SPSAVE
lda #$52
jmp LC2FF
LC249: jsr LC2C2
beq LC259
LC24E: jsr LC27E
sta PCLSAVE
lda $FC
sta PCHSAVE
LC259: rts
LC25A: ldx #$A4
jsr LC280
jsr LC280
bne LC280
LC264: jsr LC27E
lda #$FE
sta $FD
lda #$FF
sta $FE
jsr LC2C2
bne LC280
sta $0277
inc $C6
rts
LC27A: jsr LC27E
!by $2C
LC27E: ldx #$FB
LC280: jsr LC28D
sta $01,x
jsr LC29A
sta $00,x
inx
inx
rts
LC28D: jsr USERINPUT
cmp #$20
beq LC28D
cmp #$2C
beq LC28D
bne LC29D
LC29A: jsr USERINPUT
LC29D: jsr LC2AF
asl
asl
asl
asl
sta $B4
jsr USERINPUT
jsr LC2AF
ora $B4
rts
LC2AF: cmp #$3A
bcc LC2B5
adc #$08
LC2B5: and #$0F
rts
LC2B8: jsr USERINPUT
cmp #$20
beq LC2B8
dec $D3
rts
LC2C2: jsr CHRIN
dec $D3
cmp #$0D
LC2C9: rts
; GET INPUT AND AWAIT RETURN
USERINPUT:
jsr CHRIN ; get char
cmp #$0D ; await return
bne LC2C9
; Faulty Userinput
UNKNOWN:lda #$3F ; "?"
jsr CHROUT
LC2D6: ldx SPSAVE
txs
ldx #$00
stx $C6
jsr LC351
lda ($D1,x)
ldx #$06
LC2E5: cmp LC061,x
beq LC2F2
dex
bpl LC2E5
lda #$2E ;"."
jsr CHROUT ; drop point
LC2F2: jsr USERINPUT ; await next input
cmp #$2E
beq LC2F2
jmp LCF85
LC2FC: jmp LCFB2
LC2FF: sta $AC
and #$7F
ldx #$20
; Check User-Input
INTERPRETER:
cmp ICMD,x ; compare users char
beq LC30F ; matched
dex
bne INTERPRETER
beq LC2FC
LC30F: jsr LC315 ; fetch routine offset
jmp LC2D6
LC315: txa
asl
tax
inx
lda IOFS,x ; low address
pha ; on stack
dex
lda IOFS,x ; high address
pha ; on stack
rts
LC323: lda $FC
jsr LC32A
lda $FB
LC32A: pha
lsr
lsr
lsr
lsr
jsr LC335
pla
and #$0F
LC335: cmp #$0A
bcc LC33B
adc #$06
LC33B: adc #$30
jmp CHROUT
LC340: lda #$0D ; next line
LC342: jsr CHROUT
txa
jmp CHROUT
LC349: jsr LC34C
LC34C: lda #$20 ; space
jmp CHROUT
LC351: lda #$0D ; next line
jmp CHROUT
LC356: sta $BB
sty $BC
ldy #$00
LC35C: lda ($BB),y
beq LC366
jsr CHROUT
iny
bne LC35C
LC366: rts
LC367: inc $FB
bne LC36D
inc $FC
LC36D: rts
; EXIT (X)
EXIT: lda #$0E ; restore
sta $0286 ; system
sta $D020 ; colors
lda #$06
sta $D021
lda #$37 ; default rom-config
sta $01
ldx SPSAVE ; restore stack
txs
jmp WARMSTART ; basic warmstart
; $C386: REGISTER (R)
REGISTER:
ldy #$C0
lda #$8C
jsr LC356
ldx #$3B
jsr LC340
lda PCHSAVE
sta $FC
lda PCLSAVE
sta $FB
jsr LC323
jsr LC34C
ldx #$FB
LC3A4: lda $01AF,x
jsr LC32A
jsr LC34C
inx
bne LC3A4
lda SRSAVE
jmp LC3D0
; $C3B6: Semis
SEMIS: jsr LC24E
ldx #$FB
LC3BB: jsr USERINPUT
jsr LC29A
sta $01AF,x
inx
bne LC3BB
jsr LC34C
lda SRSAVE,x
jmp LC3D0
LC3D0: sta $AA
lda #$20
ldy #$09
LC3D6: jsr CHROUT
asl $AA
lda #$30
adc #$00
dey
bne LC3D6
rts
; $C3E3: GO (G)
GO: jsr LC249
ldx SPSAVE
txs
ldx #$FA
LC3EC: lda $01AE,x
pha
inx
bne LC3EC
pla
tay
pla
tax
pla
rti
; $C3F9 MEMDUMP (M)
MEMDUMP:jsr LC264
LC3FC: ldx #$3A
jsr LC340
jsr LC323
ldy #$20
ldx #$00
LC408: jsr LC34C
lda ($FB,x)
jsr LC32A
lda ($FB,x)
jsr LC439
bne LC408
jsr LC45D
bcc LC3FC
rts
; Colon
COLON: jsr LC27E
ldy #$20
ldx #$00
LC424: jsr USERINPUT
jsr LC29A
sta ($FB,x)
cmp ($FB,x)
beq LC433
jmp UNKNOWN
LC433: jsr LC439
bne LC424
rts
LC439: cmp #$20
bcc LC449
cmp #$60
bcc LC44B
cmp #$C0
bcc LC449
cmp #$DB
bcc LC44D
LC449: lda #$2E
LC44B: and #$3F
LC44D: and #$7F
LC44F: sta ($D1),y
lda $0286
sta ($F3),y
LC456: jsr LC367
iny
cpy #$28
rts
LC45D: jsr LC46F
jmp LC466
LC463: jsr LC367
LC466: lda $FB
cmp $FD
lda $FC
sbc $FE
rts
LC46F: jsr LC494
LC472: jsr LC486
beq LC485
LC477: jsr LC486
beq LC477
cmp #$20
bne LC485
sta $0277
inc $C6
LC485: rts
LC486: jsr GETIN
pha
jsr STOP
beq LC491
pla
LC490: rts
LC491: jmp LC2D6
LC494: ldy #$28
LC496: bit $AC
bpl LC490
sty $C8
sty $D0
lda #$FF
jsr CLOSE
lda #$FF
sta $B8
sta $B9
lda PRNNO
sta $BA
jsr OPEN
ldx #$00
stx $D3
dex
jsr CHKOUT
LC4B9: jsr CHRIN
jsr CHROUT
cmp #$0D
bne LC4B9
jsr CLRCHN
lda #$91
jmp CHROUT
LC4CB: ldy #$00
lda ($FB),y
bit $AA
bmi LC4D5
bvc LC4E1
LC4D5: ldx #$1F
LC4D7: cmp LC13C,x
beq LC50B
dex
cpx #$15
bne LC4D7
LC4E1: ldx #$04
LC4E3: cmp LC149,x
beq LC509
cmp LC14D,x
beq LC50B
dex
bne LC4E3
ldx #$38
LC4F2: cmp LC111,x
beq LC50B
dex
cpx #$16
bne LC4F2
LC4FC: lda ($FB),y
and LC0FB,x
eor LC111,x
beq LC50B
dex
bne LC4FC
LC509: ldx #$00
LC50B: stx $AD
txa
beq LC51F
ldx #$11
LC512: lda ($FB),y
and LC0B5,x
eor LC0C6,x
beq LC51F
dex
bne LC512
LC51F: lda LC0EA,x
sta $AB
lda LC0D8,x
sta $B6
ldx $AD
rts
LC52C: ldy #$01
lda ($FB),y
tax
iny
lda ($FB),y
ldy #$10
cpy $AB
bne LC541
jsr LC54A
ldy #$03
bne LC543
LC541: ldy $B6
LC543: stx $00AE
sta $00AF
rts
LC54A: ldy #$01
lda ($FB),y
bpl LC551
dey
LC551: sec
adc $FB
tax
inx
beq LC559
dey
LC559: tya
adc $FC
LC55C: rts
; DISASS (D)
DISASS: ldx #$00
stx $AA
jsr LC264
LC564: jsr LC58C
lda $AD
cmp #$16
beq LC576
cmp #$30
beq LC576
cmp #$21
bne LC586
nop
LC576: jsr LC494
jsr LC351
ldx #$23
lda #$2D
LC580: jsr CHROUT
dex
bne LC580
LC586: jsr LC45D
bcc LC564
rts
LC58C: ldx #$2C
jsr LC340
jsr LC323
jsr LC34C
LC597: jsr LC675
jsr LC4CB
jsr LC34C
LC5A0: lda ($FB),y
jsr LC32A
jsr LC34C
iny
cpy $B6
bne LC5A0
lda #$03
sec
sbc $B6
tax
beq LC5BE
LC5B5: jsr LC349
jsr LC34C
dex
bne LC5B5
LC5BE: lda #$20
jsr CHROUT
ldy #$00
ldx $AD
LC5C7: bne LC5DA
ldx #$03
LC5CB: lda #$2A
jsr CHROUT
dex
bne LC5CB
bit $AA
bmi LC55C
jmp LC66A
LC5DA: bit $AA
bvc LC607
lda #$08
bit $AB
beq LC607
lda ($FB),y
and #$FC
sta $AD
iny
lda ($FB),y
asl
tay
lda $033C,y
sta $00AE
iny
lda $033C,y
sta $00AF
jsr LC6BE
ldy $B6
jsr LC693
jsr LC4CB
LC607: lda LC15B,x
jsr CHROUT
lda LC193,x
jsr CHROUT
lda LC1CB,x
jsr CHROUT
lda #$20
bit $AB
beq LC622
jsr LC349
LC622: ldx #$20
lda #$04
bit $AB
beq LC62C
ldx #$28
LC62C: txa
jsr CHROUT
bit $AB
bvc LC639
lda #$23
jsr CHROUT
LC639: jsr LC52C
dey
beq LC655
lda #$08
bit $AB
beq LC64C
lda #$4D
jsr CHROUT
ldy #$01
LC64C: lda $00AD,y
jsr LC32A
dey
bne LC64C
LC655: ldy #$03
LC657: lda LC0AC,y
bit $AB
beq LC667
lda LC0AF,y
ldx LC0B2,y
jsr LC342
LC667: dey
bne LC657
LC66A: lda $B6
LC66C: jsr LC367
sec
sbc #$01
bne LC66C
rts
LC675: ldy $D3
lda #$20
LC679: sta ($D1),y
iny
cpy #$28
bcc LC679
rts
LC681: cpx $AB
bne LC689
ora $AD
sta $AD
LC689: rts
LC68A: lda $00AD,y
sta ($FB),y
cmp ($FB),y
bne LC697
LC693: dey
bpl LC68A
rts
LC697: pla
pla
rts
LC69A: bne LC6B8
txa
ora $AB
sta $AB
LC6A1: lda #$04
sta $B5
LC6A5: jsr CHRIN
cmp #$20
beq LC6B9
cmp #$24
beq LC6B9
cmp #$28
beq LC6B9
cmp #$2C
beq LC6B9
LC6B8: rts
LC6B9: dec $B5
bne LC6A5
rts
LC6BE: cpx #$18
bmi LC6D0
lda $00AE
sec
sbc #$02
sec
sbc $FB
sta $00AE
ldy #$40
LC6D0: rts
; Assembler (A)
ASSEMBLER:
jsr LC27E
sta $FD
lda $FC
sta $FE
LC6DA: jsr LC351
LC6DD: jsr LC6E4
bmi LC6DD
bpl LC6DA
LC6E4: lda #$00
sta $D3
jsr LC34C
jsr LC323
jsr LC34C
jsr CHRIN
lda #$01
sta $D3
ldx #$80
bne LC701
; Comma
COMMA: ldx #$80
stx $02B1
LC701: stx $AA
jsr LC27E
lda #$25
sta $C8
bit $02B1
bpl LC717
ldx #$0A
LC711: jsr CHRIN
dex
bne LC711
LC717: lda #$00
sta $02B1
jsr LC6A1
cmp #$46
bne LC739
lsr $AA
pla
pla
ldx #$02
LC729: lda $FA,x
pha
lda $FC,x
sta $FA,x
pla
sta $FC,x
dex
bne LC729
jmp LC564
LC739: cmp #$2E
bne LC74E
jsr LC29A
ldy #$00
sta ($FB),y
cmp ($FB),y
bne LC74C
jsr LC367
iny
LC74C: dey
rts
LC74E: ldx #$FD
cmp #$4D
bne LC76D
jsr LC29A
ldy #$00
cmp #$3F
bcs LC74C
asl
tay
lda $FB
sta $033C,y
lda $FC
iny
sta $033C,y
LC76A: jsr LC6A1
LC76D: sta $A9,x
cpx #$FD
bne LC777
lda #$07
sta $B7
LC777: inx
bne LC76A
ldx #$38
LC77C: lda $A6
cmp LC15B,x
beq LC788
LC783: dex
bne LC77C
dex
rts
LC788: lda $A7
cmp LC193,x
bne LC783
lda $A8
cmp LC1CB,x
bne LC783
lda LC111,x
sta $AD
jsr LC6A1
ldy #$00
cpx #$20
bpl LC7AD
cmp #$20
bne LC7B0
lda LC14D,x
sta $AD
LC7AD: jmp LC831
LC7B0: ldy #$08
cmp #$4D
beq LC7D6
ldy #$40
cmp #$23
beq LC7D6
jsr LC29D
sta $00AE
sta $00AF
jsr LC6A1
ldy #$20
cmp #$30
bcc LC7E9
cmp #$47
bcs LC7E9
ldy #$80
dec $D3
LC7D6: jsr LC6A1
jsr LC29D
sta $00AE
jsr LC6A1
cpy #$08
beq LC7E9
jsr LC6BE
LC7E9: sty $AB
ldx #$01
cmp #$58
jsr LC69A
ldx #$04
cmp #$29
jsr LC69A
ldx #$02
cmp #$59
jsr LC69A
lda $AD
and #$0D
beq LC810
ldx #$40
lda #$08
jsr LC681
lda #$18
!by $2C
LC810: lda #$1C
ldx #$82
jsr LC681
ldy #$08
lda $AD
cmp #$20
beq LC828
LC81F: ldx LC203,y
lda LC20B,y
jsr LC681
LC828: dey
bne LC81F
lda $AB
bpl LC830
iny
LC830: iny
LC831: jsr LC68A
dec $B7
lda $B7
sta $D3
jmp LC597
; SETPRINTER (P)
SETPRINTER:
jsr LC28D
sta PRNNO
rts
; IO SET (I)
IOSET: jsr LC28D
sta IONO
rts
LC84B: jmp UNKNOWN
; LOADSAVE (L/S)
LOADSAVE:
ldy #$02
sty $BC
dey
sty $B9
sty $BB
dey
sty $B7
jsr USERINPUT
cmp #$22
bne LC84B
LC861: jsr USERINPUT
sta ($BB),y
iny
inc $B7
cmp #$22
bne LC861
dec $B7
lda IONO
sta $BA
lda $AC
cmp #$53
beq LC88D
jsr LC2C2
beq LC888
ldx #$C3
jsr LC280
lda #$00
sta $B9
LC888: lda #$00
jmp (LOADVECT)
LC88D: ldx #$C1
jsr LC280
ldx #$AE
jsr LC280
jmp (SAVEVECT)
; ADDSUB
ADDSUB: jsr LC27E
jsr USERINPUT
eor #$02
lsr
lsr
php
jsr LC280
jsr LC351
plp
bcs LC8BA
lda $FD
adc $FB
tax
lda $FE
adc $FC
LC8B7: sec
bcs LC8C3
LC8BA: lda $FB
sbc $FD
tax
lda $FC
sbc $FE
LC8C3: tay
LC8C4: txa
LC8C5: sty $FC
sta $FB
sty $62
sta $63
php
lda #$00
sta $D3
jsr LC675
lda $FC
bne LC8E8
jsr LC349
lda $FB
jsr LC32A
lda $FB
jsr LC3D0
beq LC8EB
LC8E8: jsr LC323
LC8EB: jsr LC34C
ldx #$90
lda $01
sta $02B1
lda #$37
sta $01
plp
jsr ADD
jsr STROUT
ldx $02B1
stx $01
jmp LC356
; Convert Hexadecimal
BEFHEX: jsr LC28D
tax
ldy $D3
lda ($D1),y
eor #$20
beq LC8B7
txa
tay
jsr LC29A
LC919: sec