-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathCTS256A.PRN
1546 lines (1421 loc) · 79.2 KB
/
CTS256A.PRN
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
;** TMS-7000(tm) DISASSEMBLER V1.40beta1 - (c) 2015-24 GmEsoft, All rights reserved. **
;
; Fri Aug 16 12:28:01 2024
;
; Disassembly of : CTS256A.BIN
; Equates file : CTS256A.EQU
; Screening file : CTS256A.SCR
0200 PARLINP EQU >0200 ; Memory-mapped parallel input from Host
2000 SP0256 EQU >2000 ; Memory-mapped parallel output to SP0256A-AL2
3000 CTSXRAM EQU >3000 ; CTS-256A External RAM origin
F000 AORG >F000
; Main entry point
F000 523A START MOV %>3A,B R:
F002 0D LDSP .
F003 8820002D MOVD %SP0256,R45 ; Memory-mapped parallel...-
F007 A2AA00 MOVP %>AA,P0 ...
F00A A20A10 MOVP %>0A,P16 ...
F00D 9104 MOVP P4,B ..
F00F 5307 AND %>07,B S.
F011 5D00 CMP %>00,B ].
F013 E239 JZ PARALL ; Start in parallel mode.9
F015 737F0A AND %>7F,R10 s..
F018 8004 MOVP P4,A ..
F01A 2308 AND %>08,A #.
F01C 2D00 CMP %>00,A -.
F01E E207 JZ SER7N2 ; P17 = SMODE := Fixed S..
F020 8A1000 LDA @>1000 ...
F023 8211 MOVP A,P17 ..
F025 E003 JMP SERSEL ; Serial selectable conf..
; P17 = SMODE := Fixed Serial 7N2 config
F027 A2CB11 SER7N2 MOVP %>CB,P17 ...
; Serial selectable config
F02A A21511 SERSEL MOVP %>15,P17 ...
F02D AAF03E LDA @SCT1TB(B) ; Table of values for SC..>
F030 B8 PUSH A .
F031 AAF046 LDA @T3DATB(B) ; Table of timer3 reload..F
F034 C9 POP B .
F035 9215 MOVP B,P21 ..
F037 8214 MOVP A,P20 ..
F039 A40110 ORP %>01,P16 ...
F03C E01A JMP INIRAM ; Init RAM config ..
; Table of values for SCTL1
F03E SCT1TB BYTE >FF,>40,>43,>40,>43,>40,>40,>40
; Table of timer3 reload values T3DATA
F046 T3DATB BYTE >FF,>20,>57,>07,>C2,>0F,>81,>03
; Start in parallel mode
F04E 74800A PARALL OR %>80,R10 t..
F051 8802002F MOVD %PARLINP,R47 ; Memory-mapped parallel.../
F055 A43000 ORP %>30,P0 .0.
; Init RAM config
F058 9104 INIRAM MOVP P4,B ..
F05A 5310 AND %>10,B S.
F05C 5D00 CMP %>00,B ].
F05E E259 JZ INTRAM ; init internal RAM poin.Y
F060 88300003 MOVD %CTSXRAM,R3 ; CTS-256A External RAM .0..
F064 980329 MOVD R3,R41 ..)
F067 D802 PUSH R2 ..
F069 D202 DEC R2 ..
F06B 420222 MOV R2,R34 B."
F06E 72FF23 MOV %>FF,R35 r.#
F071 780202 ADD %>02,R2 x..
F074 D517 CLR R23 ..
; External RAM sizing loop
F076 D302 IRAML0 INC R2 ..
F078 7DF002 CMP %>F0,R2 }..
F07B E21E JZ IRAMX0 ; Exit external RAM sizi..
F07D D317 INC R23 ..
F07F 7D1017 CMP %>10,R23 }..
F082 E217 JZ IRAMX0 ; Exit external RAM sizi..
F084 225A MOV %>5A,A "Z
F086 9B03 STA *R3 ..
F088 B5 CLR A .
F089 9A03 LDA *R3 ..
F08B 2D5A CMP %>5A,A -Z
F08D E60C JNZ IRAMX0 ; Exit external RAM sizi..
F08F B7 SWAP A .
F090 9B03 STA *R3 ..
F092 B5 CLR A .
F093 9A03 LDA *R3 ..
F095 2DA5 CMP %>A5,A -.
F097 E602 JNZ IRAMX0 ; Exit external RAM sizi..
F099 E0DB JMP IRAML0 ; External RAM sizing lo..
; Exit external RAM sizing loop
F09B 420226 IRAMX0 MOV R2,R38 B.&
F09E D527 CLR R39 .'
F0A0 7A0102 SUB %>01,R2 z..
F0A3 980307 MOVD R3,R7 ...
F0A6 98072B MOVD R7,R43 ..+
F0A9 7A0102 SUB %>01,R2 z..
F0AC 420224 MOV R2,R36 B.$
F0AF 72FF25 MOV %>FF,R37 r.%
F0B2 D902 POP R2 ..
F0B4 72DF32 MOV %>DF,R50 r.2
F0B7 E01D JMP INIROM ; Init EPROM ..
; init internal RAM pointers
F0B9 88005129 INTRAM MOVD %>0051,R41 ..Q)
F0BD 88006525 MOVD %>0065,R37 ..e%
F0C1 88005023 MOVD %>0050,R35 ..P#
F0C5 8800662B MOVD %>0066,R43 ..f+
F0C9 88008027 MOVD %>0080,R39 ...'
F0CD 982903 MOVD R41,R3 .).
F0D0 982B07 MOVD R43,R7 .+.
F0D3 720132 MOV %>01,R50 r.2
; Init EPROM
F0D6 88000013 INIROM MOVD %>0000,R19 ....
F0DA C5 LF0DA CLR B .
F0DB 781012 ADD %>10,R18 x..
F0DE 7DF012 CMP %>F0,R18 }..
F0E1 E217 JZ INITOK ; Done peripherals init ..
F0E3 9A13 LF0E3 LDA *R19 ..
F0E5 ADF526 CMPA @LTFLGS(B) ; Letter flags ..&
F0E8 E6F0 JNZ LF0DA ..
F0EA C3 INC B .
F0EB 5D05 CMP %>05,B ].
F0ED E204 JZ STAROM ; Boot in EPROM ..
F0EF D313 INC R19 ..
F0F1 E0F0 JMP LF0E3 ..
; Boot in EPROM
F0F3 D313 STAROM INC R19 ..
F0F5 981331 MOVD R19,R49 ..1
F0F8 9C31 BR *R49 .1
; Done peripherals init
F0FA 720030 INITOK MOV %>00,R48 r.0
F0FD 8EF143 CALL @INIPTR ; Init buffer pointers a..C
F100 8EF1AC CALL @SAYOK ; Say O.K. ...
F103 E00B JMP LF110 ..
; Polling loop
F105 76010B07 POLL BTJO %>01,R11,LF110 v...
F109 73EF0B AND %>EF,R11 s..
; Idle loop (wait interrupt?)
F10C 77100BFC WTIDLE BTJZ %>10,R11,WTIDLE ; Idle loop (wait interrw...
F110 4D0305 LF110 CMP R3,R5 M..
F113 E607 JNZ ENDPOL ; Exit polling loop ..
F115 4D0204 CMP R2,R4 M..
F118 E602 JNZ ENDPOL ; Exit polling loop ..
F11A E0E9 JMP POLL ; Polling loop ..
; Exit polling loop
F11C 7D0038 ENDPOL CMP %>00,R56 }.8
F11F E605 JNZ LF126 ..
F121 7D0039 CMP %>00,R57 }.9
F124 E2F6 JZ ENDPOL ; Exit polling loop ..
F126 77080B09 LF126 BTJZ %>08,R11,LF133 w...
F12A 7D0132 CMP %>01,R50 }.2
F12D E211 JZ CLBUF1 ..
; wait reset of bit 3 of R11
F12F 76080BFC W11B3 BTJO %>08,R11,W11B3 ; wait reset of bit 3 ofv...
F133 8EF3E7 LF133 CALL @ENCODE ; Encode text to allopho...
F136 4D0709 CMP R7,R9 M..
F139 E2D5 JZ LF110 ..
F13B A40100 ORP %>01,P0 ...
F13E E0D0 JMP LF110 ..
F140 8CF1F0 CLBUF1 BR @CLBUF ; clear buffers - reinit...
; Init buffer pointers and regs
F143 73000B INIPTR AND %>00,R11 s..
F146 D537 CLR R55 .7
F148 D538 CLR R56 .8
F14A D539 CLR R57 .9
F14C A40106 ORP %>01,P6 ...
F14F 982903 MOVD R41,R3 .).
F152 982B07 MOVD R43,R7 .+.
F155 2220 MOV %>20,A ".
F157 9B03 STA *R3 ..
F159 8EF72B CALL @INCR3 ; inc R2:3 and roll if n..+
F15C 980305 MOVD R3,R5 ...
F15F D803 PUSH R3 ..
F161 D807 PUSH R7 ..
F163 D806 PUSH R6 ..
F165 D203 DEC R3 ..
F167 4A0307 SUB R3,R7 J..
F16A 4B0206 SBB R2,R6 K..
F16D 980734 MOVD R7,R52 ..4
F170 DB34 DECD R52 .4
F172 B0 TSTA .
F173 DD06 RRC R6 ..
F175 DD07 RRC R7 ..
F177 98071F MOVD R7,R31 ...
F17A DD06 RRC R6 ..
F17C DD07 RRC R7 ..
F17E B0 TSTA .
F17F DD06 RRC R6 ..
F181 DD07 RRC R7 ..
F183 980721 MOVD R7,R33 ..!
F186 D906 POP R6 ..
F188 D907 POP R7 ..
F18A D903 POP R3 ..
F18C 980709 MOVD R7,R9 ...
F18F 980319 MOVD R3,R25 ...
F192 982736 MOVD R39,R54 .'6
F195 4A2B36 SUB R43,R54 J+6
F198 4B2A35 SBB R42,R53 K*5
F19B 9104 MOVP P4,B ..
F19D 5380 AND %>80,B S.
F19F 5D00 CMP %>00,B ].
F1A1 E203 JZ LF1A6 ..
F1A3 74010B OR %>01,R11 t..
F1A6 05 LF1A6 EINT .
F1A7 0A RETS .
; "O-K\n"
F1A8 STROK TEXT 'O-K'
F1AB BYTE >0D
; Say O.K.
F1AC 73F90A SAYOK AND %>F9,R10 s..
F1AF C5 CLR B .
F1B0 AAF1A8 LF1B0 LDA @STROK(B) ; "O-K\n" ...
F1B3 8EF1E2 CALL @STINPB ; Store char in input bu...
F1B6 C3 INC B .
F1B7 5D04 CMP %>04,B ].
F1B9 E6F5 JNZ LF1B0 ..
F1BB 0A RETS .
; INT4 handler (serial interrupt)
F1BC A6021101 INT4 BTJOP %>02,P17,INT3 ; INT3 handler (parallel....
F1C0 0B RETI .
; INT3 handler (parallel interrupt)
F1C1 B8 INT3 PUSH A .
F1C2 76800A0B BTJO %>80,R10,LF1D1 v...
F1C6 A3FE10 ANDP %>FE,P16 ...
; wait RXBUF ready with new character
F1C9 A70211FC WRXRDY BTJZP %>02,P17,WRXRDY ; wait RXBUF ready with ....
F1CD 8016 MOVP P22,A ..
F1CF E005 JMP LF1D6 ..
F1D1 A3EF00 LF1D1 ANDP %>EF,P0 ...
F1D4 9A2F LDA *R47 ./
F1D6 8EF1E2 LF1D6 CALL @STINPB ; Store char in input bu...
F1D9 B9 POP A .
F1DA 76200B03 BTJO %>20,R11,LF1E1 v...
F1DE 8EF28C CALL @ENINT ; enable parallel or ser...
F1E1 0B LF1E1 RETI .
; Store char in input buffer
F1E2 C8 STINPB PUSH B .
F1E3 D80A PUSH R10 ..
F1E5 D80C PUSH R12 ..
F1E7 D80D PUSH R13 ..
F1E9 73F90A AND %>F9,R10 s..
F1EC 2D1B CMP %>1B,A -.
F1EE E614 JNZ NOTESC ; Not <ESC> ..
; clear buffers - reinit
F1F0 A3FE00 CLBUF ANDP %>FE,P0 ...
F1F3 8EF143 CALL @INIPTR ; Init buffer pointers a..C
F1F6 523A MOV %>3A,B R:
F1F8 0D LDSP .
F1F9 982D1B MOVD R45,R27 .-.
F1FC 9B1B STA *R27 ..
F1FE 8EF28C CALL @ENINT ; enable parallel or ser...
F201 8CF105 BR @POLL ; Polling loop ...
; Not <ESC>
F204 2D12 NOTESC CMP %>12,A -.
F206 E619 JNZ NOTCTR ; Not <Ctrl-R> ..
F208 76010B12 BTJO %>01,R11,LF21E v...
F20C 4A1903 SUB R25,R3 J..
F20F 4B1802 SBB R24,R2 K..
F212 4A0334 SUB R3,R52 J.4
F215 4B0233 SBB R2,R51 K.3
F218 981903 MOVD R25,R3 ...
F21B 720139 MOV %>01,R57 r.9
F21E 8CF284 LF21E BR @XSTINP ; exit handler ...
; Not <Ctrl-R>
F221 2D08 NOTCTR CMP %>08,A -.
F223 E623 JNZ NOTBKS ; Not <BkSp> .#
F225 4D0204 CMP R2,R4 M..
F228 E605 JNZ LF22F ..
F22A 4D0305 CMP R3,R5 M..
F22D E255 JZ XSTINP ; exit handler .U
F22F D803 LF22F PUSH R3 ..
F231 D802 PUSH R2 ..
F233 980503 MOVD R5,R3 ...
F236 8EF73B CALL @DECR3 ; dec R2:3 and roll if n..;
F239 980305 MOVD R3,R5 ...
F23C D902 POP R2 ..
F23E D903 POP R3 ..
F240 D334 INC R52 .4
F242 E740 JNC XSTINP ; exit handler .@
F244 D333 INC R51 .3
F246 E03C JMP XSTINP ; exit handler .<
; Not <BkSp>
F248 2D27 NOTBKS CMP %>27,A -'
F24A E226 JZ STOCHR ; put char in buffer .&
F24C 2D7B CMP %>7B,A -{
F24E E40C JP DELIMT ; Delimiter (not letter/..
F250 2D30 CMP %>30,A -0
F252 E108 JN DELIMT ; Delimiter (not letter/..
F254 2D3A CMP %>3A,A -:
F256 E11A JN STOCHR ; put char in buffer ..
F258 2D41 CMP %>41,A -A
F25A E516 JPZ STOCHR ; put char in buffer ..
; Delimiter (not letter/digit/')
F25C 76010B07 DELIMT BTJO %>01,R11,LF267 v...
F260 2D0D CMP %>0D,A -.
F262 E606 JNZ LF26A ..
F264 74100B OR %>10,R11 t..
F267 980319 LF267 MOVD R3,R25 ...
F26A 2480 LF26A OR %>80,A $.
F26C D339 INC R57 .9
F26E E702 JNC STOCHR ; put char in buffer ..
F270 D338 INC R56 .8
; put char in buffer
F272 8EF298 STOCHR CALL @RWBUFR ; read/write in input/ou...
F275 77200B0B BTJZ %>20,R11,XSTINP ; exit handler w...
F279 228D MOV %>8D,A ".
F27B D339 INC R57 .9
F27D E702 JNC LF281 ..
F27F D338 INC R56 .8
F281 8EF298 LF281 CALL @RWBUFR ; read/write in input/ou...
; exit handler
F284 D90D XSTINP POP R13 ..
F286 D90C POP R12 ..
F288 D90A POP R10 ..
F28A C9 POP B .
F28B 0A RETS .
; enable parallel or serial interrupt
F28C 77800A04 ENINT BTJZ %>80,R10,ENINT4 ; enable INT4 w...
F290 A41000 ORP %>10,P0 ...
F293 0A RETS .
; enable INT4
F294 A40110 ENINT4 ORP %>01,P16 ...
F297 0A RETS .
; read/write in input/output buffer
F298 76020A2E RWBUFR BTJO %>02,R10,RDBUF ; read from input or outv...
F29C 76040A07 BTJO %>04,R10,WROBUF ; Write to output bufferv...
F2A0 98050D MOVD R5,R13 ...
F2A3 DB34 DECD R52 .4
F2A5 E005 JMP WRBUF ..
; Write to output buffer
F2A7 98090D WROBUF MOVD R9,R13 ...
F2AA DB36 DECD R54 .6
F2AC 9B0D WRBUF STA *R13 ..
F2AE 8A000D LDA @>000D ...
F2B1 78010D ADD %>01,R13 x..
F2B4 79000C ADC %>00,R12 y..
F2B7 8EF311 CALL @ROLR13 ; Roll R12:R13 according...
F2BA 76040A07 BTJO %>04,R10,WOBUFX v...
F2BE 980D05 MOVD R13,R5 ...
F2C1 8EF331 WRBUFX CALL @CHKBUF ; Check if inp or out bu..1
F2C4 0A RETS .
F2C5 980D09 WOBUFX MOVD R13,R9 ...
F2C8 E0F7 JMP WRBUFX ..
; read from input or output buffer
F2CA 76040A0B RDBUF BTJO %>04,R10,RDOBUF ; read from output buffev...
F2CE 98030D MOVD R3,R13 ...
F2D1 76020B0D BTJO %>02,R11,RDBUF1 ; Read byte from buffer v...
F2D5 D337 INC R55 .7
F2D7 E009 JMP RDBUF1 ; Read byte from buffer ..
; read from output buffer
F2D9 98070D RDOBUF MOVD R7,R13 ...
F2DC D336 INC R54 .6
F2DE E702 JNC RDBUF1 ; Read byte from buffer ..
F2E0 D335 INC R53 .5
; Read byte from buffer
F2E2 9A0D RDBUF1 LDA *R13 ..
F2E4 76040A0B BTJO %>04,R10,LF2F3 v...
F2E8 278005 BTJZ %>80,A,LF2F0 '..
F2EB 74010A OR %>01,R10 t..
F2EE E003 JMP LF2F3 ..
F2F0 73FE0A LF2F0 AND %>FE,R10 s..
F2F3 B8 LF2F3 PUSH A .
F2F4 8A000D LDA @>000D ...
F2F7 78010D ADD %>01,R13 x..
F2FA 79000C ADC %>00,R12 y..
F2FD 8EF311 CALL @ROLR13 ; Roll R12:R13 according...
F300 76040A05 BTJO %>04,R10,ROBUFX v...
F304 980D03 MOVD R13,R3 ...
F307 B9 POP A .
F308 0A RETS .
F309 980D07 ROBUFX MOVD R13,R7 ...
F30C 8EF335 CALL @CKOBUF ; Check if output buffer..5
F30F B9 POP A .
F310 0A RETS .
; Roll R12:R13 according to active buffer (R10.2)
F311 76040A0E ROLR13 BTJO %>04,R10,ROLOUT ; Roll output buffer v...
; Roll input buffer
F315 4D2B0D ROLINP CMP R43,R13 M+.
F318 E608 JNZ LF322 ..
F31A 4D2A0C CMP R42,R12 M*.
F31D E603 JNZ LF322 ..
F31F 98290D MOVD R41,R13 .).
F322 0A LF322 RETS .
; Roll output buffer
F323 4D270D ROLOUT CMP R39,R13 M'.
F326 E608 JNZ LF330 ..
F328 4D260C CMP R38,R12 M&.
F32B E603 JNZ LF330 ..
F32D 982B0D MOVD R43,R13 .+.
F330 0A LF330 RETS .
; Check if inp or out buffer full or above HWM
F331 77040A12 CHKBUF BTJZ %>04,R10,CKIBUF ; Check if input buffer w...
; Check if output buffer full or above HWM
F335 7D0135 CKOBUF CMP %>01,R53 }.5
F338 E209 JZ LF343 ..
F33A 4D3236 CMP R50,R54 M26
F33D E404 JP LF343 ..
F33F 74080B OR %>08,R11 t..
F342 0A RETS .
F343 73F70B LF343 AND %>F7,R11 s..
F346 0A RETS .
; Check if input buffer full or above HWM
F347 7D0033 CKIBUF CMP %>00,R51 }.3
F34A E40A JP LF356 ..
F34C 7D0134 CMP %>01,R52 }.4
F34F E405 JP LF356 ..
F351 74200B OR %>20,R11 t..
F354 E01B JMP TXOFF ; Send XOFF, clear DTR/B..
F356 4D1E33 LF356 CMP R30,R51 M.3
F359 E107 JN LF362 ..
F35B E41B JP TXON ; Send XON, set DTR/BUSY..
F35D 4D1F34 CMP R31,R52 M.4
F360 E516 JPZ TXON ; Send XON, set DTR/BUSY..
F362 4D2033 LF362 CMP R32,R51 M.3
F365 E41D JP LF384 ..
F367 E105 JN LF36E ..
F369 4D2134 CMP R33,R52 M!4
F36C E416 JP LF384 ..
F36E 74040B LF36E OR %>04,R11 t..
; Send XOFF, clear DTR/BUSY*
F371 A3FE06 TXOFF ANDP %>FE,P6 ...
F374 A21317 MOVP %>13,P23 ...
F377 0A RETS .
; Send XON, set DTR/BUSY*
F378 73DB0B TXON AND %>DB,R11 s..
F37B 8EF28C CALL @ENINT ; enable parallel or ser...
F37E A40106 ORP %>01,P6 ...
F381 A21117 MOVP %>11,P23 ...
F384 0A LF384 RETS .
; INT1 handler (SP0256)
F385 A3FE00 INT1 ANDP %>FE,P0 ...
F388 B8 PUSH A .
F389 C8 PUSH B .
F38A D80A PUSH R10 ..
F38C D80C PUSH R12 ..
F38E D80D PUSH R13 ..
F390 74060A OR %>06,R10 t..
F393 8EF298 CALL @RWBUFR ; read/write in input/ou...
F396 982D1B MOVD R45,R27 .-.
F399 48001B ADD R0,R27 H..
F39C 9B1B STA *R27 ..
F39E D90D POP R13 ..
F3A0 D90C POP R12 ..
F3A2 D90A POP R10 ..
F3A4 C9 POP B .
F3A5 B9 POP A .
F3A6 4D0709 CMP R7,R9 M..
F3A9 E203 JZ LF3AE ..
F3AB A40100 ORP %>01,P0 ...
F3AE 0B LF3AE RETI .
; select rules set
F3AF 2D30 SELRUL CMP %>30,A -0
F3B1 E502 JPZ LF3B5 ..
F3B3 E02A JMP LF3DF .*
F3B5 2D3A LF3B5 CMP %>3A,A -:
F3B7 E508 JPZ LF3C1 ..
F3B9 88FF8E15 MOVD %RULNUM,R21 ; Rules for digits ....
F3BD 73DF0A AND %>DF,R10 s..
F3C0 0A RETS .
F3C1 2D41 LF3C1 CMP %>41,A -A
F3C3 E502 JPZ LF3C7 ..
F3C5 E018 JMP LF3DF ..
F3C7 2D5B LF3C7 CMP %>5B,A -[
F3C9 E504 JPZ LF3CF ..
F3CB 74200A OR %>20,R10 t..
F3CE 0A RETS .
F3CF 2D61 LF3CF CMP %>61,A -a
F3D1 E502 JPZ LF3D5 ..
F3D3 E00A JMP LF3DF ..
F3D5 2D7B LF3D5 CMP %>7B,A -{
F3D7 E506 JPZ LF3DF ..
F3D9 2A20 SUB %>20,A *.
F3DB 74200A OR %>20,R10 t..
F3DE 0A RETS .
F3DF 73DF0A LF3DF AND %>DF,R10 s..
F3E2 88F78C15 MOVD %RLPNCT,R21 ; Rules for punctuation ....
F3E6 0A RETS .
; Encode text to allophones
F3E7 7D0030 ENCODE CMP %>00,R48 }.0
F3EA E202 JZ LF3EE ..
F3EC 9C31 BR *R49 .1
F3EE 980311 LF3EE MOVD R3,R17 ...
F3F1 8EF74B CALL @DECR17 ; dec R16:17 and roll if..K
F3F4 8EF70F LF3F4 CALL @FETCH ; Fetch char and mask hi...
F3F7 77010A05 BTJZ %>01,R10,LF400 w...
F3FB 74800B OR %>80,R11 t..
F3FE E003 JMP LF403 ..
F400 737F0B LF400 AND %>7F,R11 s..
F403 8EF3AF LF403 CALL @SELRUL ; select rules set ...
F406 77200A11 BTJZ %>20,R10,LF41B w...
F40A C5 CLR B .
F40B 2A41 SUB %>41,A *A
F40D 2C02 MPY %>02,A ,.
F40F 5802 ADD %>02,B X.
F411 AAFFBC LDA @TABRUL(B) ; Index of rules tables ...
F414 D014 MOV A,R20 ..
F416 AAFFBD LDA @TABRU1(B) ; Index of rules tables ...
F419 D015 MOV A,R21 ..
F41B 5201 LF41B MOV %>01,B R.
F41D 8EF488 CALL @RSEEKB ; right seek Bth '[' ...
F420 8EF4C2 LF420 CALL @CMPBKT ; compare in-brackets ...
F423 76100A40 BTJO %>10,R10,LF467 v..@
F427 98111D MOVD R17,R29 ...
F42A 73BF0A AND %>BF,R10 s..
F42D 8EF564 CALL @CHKPAT ; Check rule pattern ..d
F430 76100A33 BTJO %>10,R10,LF467 v..3
F434 8EF47E CALL @LSEEKB ; left seek '[' ..~
F437 74400A OR %>40,R10 t@.
F43A 8EF564 CALL @CHKPAT ; Check rule pattern ..d
F43D 76100A39 BTJO %>10,R10,LF47A v..9
F441 483734 ADD R55,R52 H74
F444 790033 ADC %>00,R51 y.3
F447 D537 CLR R55 .7
F449 73FD0B AND %>FD,R11 s..
F44C 5202 MOV %>02,B R.
F44E 8EF488 CALL @RSEEKB ; right seek Bth '[' ...
F451 8EF49E CALL @WRALLO ; Write allophones ...
F454 980F03 MOVD R15,R3 ...
F457 980311 MOVD R3,R17 ...
F45A 8EF74B CALL @DECR17 ; dec R16:17 and roll if..K
F45D 77800B93 BTJZ %>80,R11,LF3F4 w...
F461 DB39 DECD R57 .9
F463 8EF347 CALL @CKIBUF ; Check if input buffer ..G
F466 0A RETS .
F467 D315 LF467 INC R21 ..
F469 E702 JNC LF46D ..
F46B D314 INC R20 ..
F46D 5202 LF46D MOV %>02,B R.
F46F 8EF488 LF46F CALL @RSEEKB ; right seek Bth '[' ...
F472 720137 MOV %>01,R55 r.7
F475 73FD0B AND %>FD,R11 s..
F478 E0A6 JMP LF420 ..
F47A 5203 LF47A MOV %>03,B R.
F47C E0F1 JMP LF46F ..
; left seek '['
F47E 9A15 LSEEKB LDA *R21 ..
F480 274001 BTJZ %>40,A,LF484 '@.
F483 0A RETS .
F484 DB15 LF484 DECD R21 ..
F486 E0F6 JMP LSEEKB ; left seek '[' ..
; right seek Bth '['
F488 D517 RSEEKB CLR R23 ..
F48A 9A15 LF48A LDA *R21 ..
F48C 274007 BTJZ %>40,A,LF496 '@.
F48F D317 INC R23 ..
F491 3D17 CMP R23,B =.
F493 E601 JNZ LF496 ..
F495 0A RETS .
F496 D315 LF496 INC R21 ..
F498 E702 JNC LF49C ..
F49A D314 INC R20 ..
F49C E0EC LF49C JMP LF48A ..
; Write allophones
F49E D517 WRALLO CLR R23 ..
F4A0 9A15 LDA *R21 ..
F4A2 2DFF CMP %>FF,A -.
F4A4 E21B JZ LF4C1 ..
F4A6 278002 BTJZ %>80,A,LF4AB '..
F4A9 D317 INC R23 ..
F4AB 233F LF4AB AND %>3F,A #?
F4AD 73FD0A AND %>FD,R10 s..
F4B0 74040A OR %>04,R10 t..
F4B3 8EF298 CALL @RWBUFR ; read/write in input/ou...
F4B6 D315 INC R21 ..
F4B8 E702 JNC LF4BC ..
F4BA D314 INC R20 ..
F4BC 7D0117 LF4BC CMP %>01,R23 }..
F4BF E6DD JNZ WRALLO ; Write allophones ..
F4C1 0A LF4C1 RETS .
; compare in-brackets
F4C2 980313 CMPBKT MOVD R3,R19 ...
F4C5 73F70A AND %>F7,R10 s..
F4C8 77200A08 BTJZ %>20,R10,LF4D4 w...
F4CC 9A15 LDA *R21 ..
F4CE 2DFF CMP %>FF,A -.
F4D0 E60B JNZ LF4DD ..
F4D2 E02E JMP LF502 ..
F4D4 2DFF LF4D4 CMP %>FF,A -.
F4D6 E22A JZ LF502 .*
F4D8 8EF73B CALL @DECR3 ; dec R2:3 and roll if n..;
F4DB D237 DEC R55 .7
F4DD 8EF70F LF4DD CALL @FETCH ; Fetch char and mask hi...
F4E0 2D61 CMP %>61,A -a
F4E2 E102 JN LF4E6 ..
F4E4 2A20 SUB %>20,A *.
F4E6 2A20 LF4E6 SUB %>20,A *.
F4E8 C0 MOV A,B .
F4E9 9A15 LDA *R21 ..
F4EB 278003 BTJZ %>80,A,LF4F1 '..
F4EE 74080A OR %>08,R10 t..
F4F1 233F LF4F1 AND %>3F,A #?
F4F3 3D00 CMP R0,B =.
F4F5 E207 JZ LF4FE ..
F4F7 74100A OR %>10,R10 t..
F4FA 981303 MOVD R19,R3 ...
F4FD 0A RETS .
F4FE 77080A0A LF4FE BTJZ %>08,R10,LF50C w...
F502 98030F LF502 MOVD R3,R15 ...
F505 73EF0A AND %>EF,R10 s..
F508 74020B OR %>02,R11 t..
F50B 0A RETS .
F50C D315 LF50C INC R21 ..
F50E E7CD JNC LF4DD ..
F510 D314 INC R20 ..
F512 E0C9 JMP LF4DD ..
; Get letter flags
F514 3216 GFLAGS MOV R22,B 2.
F516 5D3A CMP %>3A,B ]:
F518 E40A JP GFLAGX ..
F51A 5D21 CMP %>21,B ]!
F51C E106 JN GFLAGX ..
F51E 5A21 SUB %>21,B Z!
F520 AAF526 LDA @LTFLGS(B) ; Letter flags ..&
F523 0A RETS .
F524 B5 GFLAGX CLR A .
F525 0A RETS .
; Letter flags
F526 LTFLGS BYTE >80,>48,>28,>58,>85,>08,>68,>08
F52E BYTE >84,>78,>08,>58,>48,>58,>82,>08
F536 BYTE >08,>58,>38,>18,>82,>48,>48,>28
F53E BYTE >84,>78
; Pattern jump table
F540 8CF69E PATBRT BR @PATVOW ; # 09 1+ vowels ...
F543 8CF6B4 BR @PATVOC ; . 0A voiced consonant:...
F546 8CF601 BR @PATSUF ; % 0B suffix: -ER(S) -E...
F549 8CF6D7 BR @PATSIB ; & 0C sibilant: S C G Z...
F54C 8CF6E2 BR @PATPLU ; @ 0D T S R D L Z N J T...
F54F 8CF6BF BR @PAT1CO ; ^ 0E 1 consonant only ...
F552 8CF6C7 BR @PATFVO ; + 0F front vowel: E I ...
F555 8CF5EA BR @PAT0MC ; : 10 0+ consonants ...
F558 8CF5B9 BR @PAT1MC ; * 11 1+ consonants ...
F55B 8CF6CF BR @PATBVO ; > 12 back vowel: O U ...
F55E 8CF5B0 BR @PATNLT ; < 13 Anything other th...
F561 8CF5CC BR @PAT2MV ; ? 14 2+ vowels ...
; Check rule pattern
F564 76400A0A CHKPAT BTJO %>40,R10,LF572 v@..
F568 5240 MOV %>40,B R@
F56A D315 INC R21 ..
F56C E702 JNC LF570 ..
F56E D314 INC R20 ..
F570 E004 LF570 JMP LF576 ..
F572 5280 LF572 MOV %>80,B R.
F574 DB15 DECD R21 ..
F576 9A15 LF576 LDA *R21 ..
F578 6712 BTJZ B,A,LF58C g.
F57A 76400A04 BTJO %>40,R10,LF582 v@..
F57E DB15 DECD R21 ..
F580 E006 JMP LF588 ..
F582 D315 LF582 INC R21 ..
F584 E702 JNC LF588 ..
F586 D314 INC R20 ..
F588 73EF0A LF588 AND %>EF,R10 s..
F58B 0A RETS .
F58C 8EF75B LF58C CALL @GNEXT ; get next char and move..[
F58F 9A15 LDA *R21 ..
F591 2D15 CMP %>15,A -.
F593 E10F JN LF5A4 ..
F595 4D0016 LF595 CMP R0,R22 M..
F598 E2CA JZ CHKPAT ; Check rule pattern ..
; pattern match failed
F59A 74100A PATFLD OR %>10,R10 t..
F59D 981303 MOVD R19,R3 ...
F5A0 981D11 MOVD R29,R17 ...
F5A3 0A RETS .
F5A4 2D07 LF5A4 CMP %>07,A -.
F5A6 E2ED JZ LF595 ..
F5A8 C0 MOV A,B .
F5A9 5A09 SUB %>09,B Z.
F5AB 5C03 MPY %>03,B \.
F5AD ACF540 BR @PATBRT(B) ; Pattern jump table ..@
; < 13 Anything other than a letter
F5B0 8EF514 PATNLT CALL @GFLAGS ; Get letter flags ...
F5B3 2D00 CMP %>00,A -.
F5B5 E247 JZ PATOK1 ; pattern match ok .G
F5B7 E0E1 JMP PATFLD ; pattern match failed ..
; * 11 1+ consonants
F5B9 8EF514 PAT1MC CALL @GFLAGS ; Get letter flags ...
F5BC 260802 BTJO %>08,A,LF5C1 &..
F5BF E0D9 JMP PATFLD ; pattern match failed ..
F5C1 8EF75B LF5C1 CALL @GNEXT ; get next char and move..[
F5C4 8EF514 CALL @GFLAGS ; Get letter flags ...
F5C7 2608F7 BTJO %>08,A,LF5C1 &..
F5CA E02F JMP LF5FB ./
; ? 14 2+ vowels
F5CC 8EF514 PAT2MV CALL @GFLAGS ; Get letter flags ...
F5CF 268002 BTJO %>80,A,LF5D4 &..
F5D2 E0C6 JMP PATFLD ; pattern match failed ..
F5D4 8EF75B LF5D4 CALL @GNEXT ; get next char and move..[
F5D7 8EF514 CALL @GFLAGS ; Get letter flags ...
F5DA 268002 BTJO %>80,A,LF5DF &..
F5DD E0BB JMP PATFLD ; pattern match failed ..
F5DF 8EF75B LF5DF CALL @GNEXT ; get next char and move..[
F5E2 8EF514 CALL @GFLAGS ; Get letter flags ...
F5E5 2680F7 BTJO %>80,A,LF5DF &..
F5E8 E011 JMP LF5FB ..
; : 10 0+ consonants
F5EA 8EF514 PAT0MC CALL @GFLAGS ; Get letter flags ...
F5ED 260802 BTJO %>08,A,LF5F2 &..
F5F0 E009 JMP LF5FB ..
F5F2 8EF75B LF5F2 CALL @GNEXT ; get next char and move..[
F5F5 8EF514 CALL @GFLAGS ; Get letter flags ...
F5F8 2608F7 BTJO %>08,A,LF5F2 &..
F5FB 8EF77F LF5FB CALL @UNGET ; Unget last input chara...
; pattern match ok
F5FE 8CF564 PATOK1 BR @CHKPAT ; Check rule pattern ..d
; % 0B suffix: -ER(S) -E -ES -ED -ELY -ING -OR -MENT
F601 8EF514 PATSUF CALL @GFLAGS ; Get letter flags ...
F604 260150 BTJO %>01,A,LF657 &.P
F607 7D2916 CMP %>29,R22 }).
F60A E230 JZ LF63C .0
F60C 7D2D16 CMP %>2D,R22 }-.
F60F E207 JZ LF618 ..
F611 7D2F16 CMP %>2F,R22 }/.
F614 E21D JZ LF633 ..
F616 E071 JMP PATFL1 ; pattern match failed .q
F618 8EF70F LF618 CALL @FETCH ; Fetch char and mask hi...
F61B 2D45 CMP %>45,A -E
F61D E202 JZ LF621 ..
F61F E068 JMP PATFL1 ; pattern match failed .h
F621 8EF70F LF621 CALL @FETCH ; Fetch char and mask hi...
F624 2D4E CMP %>4E,A -N
F626 E202 JZ LF62A ..
F628 E05F JMP PATFL1 ; pattern match failed ._
F62A 8EF70F LF62A CALL @FETCH ; Fetch char and mask hi...
F62D 2D54 CMP %>54,A -T
F62F E21D JZ LF64E ..
F631 E056 JMP PATFL1 ; pattern match failed .V
F633 8EF70F LF633 CALL @FETCH ; Fetch char and mask hi...
F636 2D52 CMP %>52,A -R
F638 E214 JZ LF64E ..
F63A E04D JMP PATFL1 ; pattern match failed .M
F63C 8EF70F LF63C CALL @FETCH ; Fetch char and mask hi...
F63F 2D4E CMP %>4E,A -N
F641 E202 JZ LF645 ..
F643 E044 JMP PATFL1 ; pattern match failed .D
F645 8EF70F LF645 CALL @FETCH ; Fetch char and mask hi...
F648 2D47 CMP %>47,A -G
F64A E202 JZ LF64E ..
F64C E03B JMP PATFL1 ; pattern match failed .;
F64E 8EF68C LF64E CALL @CHKLTR ; Test if next input cha...
F651 76200A34 BTJO %>20,R10,PATFL1 ; pattern match failed v..4
F655 E065 JMP PATOK2 .e
F657 8EF70F LF657 CALL @FETCH ; Fetch char and mask hi...
F65A 2D52 CMP %>52,A -R
F65C E60C JNZ LF66A ..
F65E 8EF70F CALL @FETCH ; Fetch char and mask hi...
F661 2D53 CMP %>53,A -S
F663 E2E9 JZ LF64E ..
F665 8EF73B CALL @DECR3 ; dec R2:3 and roll if n..;
F668 E0E4 JMP LF64E ..
F66A 2D53 LF66A CMP %>53,A -S
F66C E2E0 JZ LF64E ..
F66E 2D44 CMP %>44,A -D
F670 E2DC JZ LF64E ..
F672 2D4C CMP %>4C,A -L
F674 E20C JZ LF682 ..
F676 8EF73B CALL @DECR3 ; dec R2:3 and roll if n..;
F679 8EF68C CALL @CHKLTR ; Test if next input cha...
F67C 77200A3C BTJZ %>20,R10,PATOK2 w..<
F680 E007 JMP PATFL1 ; pattern match failed ..
F682 8EF70F LF682 CALL @FETCH ; Fetch char and mask hi...
F685 2D59 CMP %>59,A -Y
F687 E2C5 JZ LF64E ..
; pattern match failed
F689 8CF59A PATFL1 BR @PATFLD ; pattern match failed ...
; Test if next input char is a letter, R10.5=1 if yes
F68C 8EF70F CHKLTR CALL @FETCH ; Fetch char and mask hi...
F68F D815 PUSH R21 ..
F691 D814 PUSH R20 ..
F693 8EF3AF CALL @SELRUL ; select rules set ...
F696 D914 POP R20 ..
F698 D915 POP R21 ..
F69A 8EF73B CALL @DECR3 ; dec R2:3 and roll if n..;
F69D 0A RETS .
; # 09 1+ vowels
F69E 8EF514 PATVOW CALL @GFLAGS ; Get letter flags ...
F6A1 268002 BTJO %>80,A,LF6A6 &..
F6A4 E0E3 JMP PATFL1 ; pattern match failed ..
F6A6 8EF75B LF6A6 CALL @GNEXT ; get next char and move..[
F6A9 8EF514 CALL @GFLAGS ; Get letter flags ...
F6AC 2680F7 BTJO %>80,A,LF6A6 &..
F6AF 8EF77F CALL @UNGET ; Unget last input chara...
F6B2 E008 JMP PATOK2 ..
; . 0A voiced consonant: B D G J L M N R V W X
F6B4 8EF514 PATVOC CALL @GFLAGS ; Get letter flags ...
F6B7 264002 BTJO %>40,A,PATOK2 &@.
F6BA E0CD JMP PATFL1 ; pattern match failed ..
F6BC 8CF564 PATOK2 BR @CHKPAT ; Check rule pattern ..d
; ^ 0E 1 consonant only
F6BF 8EF514 PAT1CO CALL @GFLAGS ; Get letter flags ...
F6C2 2608F7 BTJO %>08,A,PATOK2 &..
F6C5 E0C2 JMP PATFL1 ; pattern match failed ..
; + 0F front vowel: E I Y
F6C7 8EF514 PATFVO CALL @GFLAGS ; Get letter flags ...
F6CA 2604EF BTJO %>04,A,PATOK2 &..
F6CD E0BA JMP PATFL1 ; pattern match failed ..
; > 12 back vowel: O U
F6CF 8EF514 PATBVO CALL @GFLAGS ; Get letter flags ...
F6D2 2602E7 BTJO %>02,A,PATOK2 &..
F6D5 E0B2 JMP PATFL1 ; pattern match failed ..
; & 0C sibilant: S C G Z X J CH SH
F6D7 8EF514 PATSIB CALL @GFLAGS ; Get letter flags ...
F6DA 2620DF BTJO %>20,A,PATOK2 &..
F6DD 8EF75B CALL @GNEXT ; get next char and move..[
F6E0 E00E JMP LF6F0 ..
; @ 0D T S R D L Z N J TH CH SH preceding long U
F6E2 8EF514 PATPLU CALL @GFLAGS ; Get letter flags ...
F6E5 2610D4 BTJO %>10,A,PATOK2 &..
F6E8 8EF75B CALL @GNEXT ; get next char and move..[
F6EB 7D3416 CMP %>34,R22 }4.
F6EE E20C JZ LF6FC ..
F6F0 7D2316 LF6F0 CMP %>23,R22 }#.
F6F3 E207 JZ LF6FC ..
F6F5 7D3316 CMP %>33,R22 }3.
F6F8 E202 JZ LF6FC ..
F6FA E08D JMP PATFL1 ; pattern match failed ..
F6FC 981103 LF6FC MOVD R17,R3 ...
F6FF 8EF72B CALL @INCR3 ; inc R2:3 and roll if n..+
F702 8EF72B CALL @INCR3 ; inc R2:3 and roll if n..+
F705 8EF70F CALL @FETCH ; Fetch char and mask hi...
F708 2D48 CMP %>48,A -H
F70A E2B0 JZ PATOK2 ..
F70C 8CF59A BR @PATFLD ; pattern match failed ...
; Fetch char and mask high bit
F70F 74020A FETCH OR %>02,R10 t..
F712 73FB0A AND %>FB,R10 s..
F715 8EF298 CALL @RWBUFR ; read/write in input/ou...
F718 237F AND %>7F,A #.
F71A 0A RETS .
; inc R16:17 and roll if needed
F71B D311 INCR17 INC R17 ..
F71D E702 JNC LF721 ..
F71F D310 INC R16 ..
F721 98110D LF721 MOVD R17,R13 ...
F724 8EF315 CALL @ROLINP ; Roll input buffer ...
F727 980D11 MOVD R13,R17 ...
F72A 0A RETS .
; inc R2:3 and roll if needed
F72B D303 INCR3 INC R3 ..
F72D E702 JNC LF731 ..
F72F D302 INC R2 ..
F731 98030D LF731 MOVD R3,R13 ...
F734 8EF315 CALL @ROLINP ; Roll input buffer ...
F737 980D03 MOVD R13,R3 ...
F73A 0A RETS .
; dec R2:3 and roll if needed
F73B DB03 DECR3 DECD R3 ..
F73D 4D2303 CMP R35,R3 M#.
F740 E608 JNZ LF74A ..
F742 4D2202 CMP R34,R2 M".
F745 E603 JNZ LF74A ..
F747 982503 MOVD R37,R3 .%.
F74A 0A LF74A RETS .
; dec R16:17 and roll if needed
F74B DB11 DECR17 DECD R17 ..
F74D 4D2311 CMP R35,R17 M#.
F750 E608 JNZ LF75A ..
F752 4D2210 CMP R34,R16 M".
F755 E603 JNZ LF75A ..
F757 982511 MOVD R37,R17 .%.
F75A 0A LF75A RETS .
; get next char and move code to range 00-3F
F75B 77400A07 GNEXT BTJZ %>40,R10,LF766 w@..
F75F D803 PUSH R3 ..
F761 D802 PUSH R2 ..
F763 981103 MOVD R17,R3 ...
F766 8EF70F LF766 CALL @FETCH ; Fetch char and mask hi...
F769 77400A07 BTJZ %>40,R10,LF774 w@..
F76D 8EF74B CALL @DECR17 ; dec R16:17 and roll if..K
F770 D902 POP R2 ..
F772 D903 POP R3 ..
F774 2D61 LF774 CMP %>61,A -a
F776 E102 JN LF77A ..
F778 2A20 SUB %>20,A *.
F77A 2A20 LF77A SUB %>20,A *.
F77C D016 MOV A,R22 ..
F77E 0A RETS .
; Unget last input character
F77F 76400A04 UNGET BTJO %>40,R10,LF787 v@..
F783 8EF73B CALL @DECR3 ; dec R2:3 and roll if n..;
F786 0A RETS .
F787 8EF71B LF787 CALL @INCR17 ; inc R16:17 and roll if...
F78A 0A RETS .
F78B BYTE >FF
; Rules for punctuation
F78C RLPNCT BYTE >CD,>C0,>0A,>47,>B3,>EB,>09,>10
F794 BYTE >0A,>25,>47,>B3,>EB,>09,>47,>B3
F79C BYTE >EB,>47,>B3,>F7,>C7,>FF,>CC,>C3