-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathExBasROM.LST
5406 lines (5406 loc) · 449 KB
/
ExBasROM.LST
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
0001
0002 a000 UART EQU $A000
0003 a001 RECEV EQU UART+1
0004 a001 TRANS EQU UART+1
0005 a000 USTAT EQU UART
0006 a000 UCTRL EQU UART
0007
0008 0008 BS EQU 8 BACKSPACE
0009 000d CR EQU $D ENTER KEY
0010 001b ESC EQU $1B ESCAPE CODE
0011 0020 SPACE EQU $20 SPACE (BLANK)
0012 003a STKBUF EQU 58 STACK BUFFER ROOM
0013 00fa LBUFMX EQU 250 MAX NUMBER OF CHARS IN A BASIC LINE
0014 00fa MAXLIN EQU $FA MAXIMUM MS BYTE OF LINE NUMBER
0015 * PSEUDO OPS
0016 0021 SKP1 EQU $21 OP CODE OF BRN — SKIP ONE BYTE
0017 008c SKP2 EQU $8C OP CODE OF CMPX # - SKIP TWO BYTES
0018 0086 SKP1LD EQU $86 OP CODE OF LDA # - SKIP THE NEXT BYTE
0019 * AND LOAD THE VALUE OF THAT BYTE INTO ACCA — THIS
0020 * IS USUALLY USED TO LOAD ACCA WITH A NON ZERO VALUE
0021 0095 RTS_LOW EQU $95
0022 0000 ORG 0
0023 0000 ENDFLG RMB 1 STOP/END FLAG: POSITIVE=STOP, NEG=END
0024 0001 CHARAC RMB 1 TERMINATOR FLAG 1
0025 0002 ENDCHR RMB 1 TERMINATOR FLAG 2
0026 0003 TMPLOC RMB 1 SCRATCH VARIABLE
0027 0004 IFCTR RMB 1 IF COUNTER - HOW MANY IF STATEMENTS IN A LINE
0028 0005 DIMFLG RMB 1 *DV* ARRAY FLAG 0=EVALUATE, 1=DIMENSIONING
0029 0006 VALTYP RMB 1 *DV* *PV TYPE FLAG: 0=NUMERIC, $FF=STRING
0030 0007 GARBFL RMB 1 *TV STRING SPACE HOUSEKEEPING FLAG
0031 0008 ARYDIS RMB 1 DISABLE ARRAY SEARCH: 00=ALLOW SEARCH
0032 0009 INPFLG RMB 1 *TV INPUT FLAG: READ=0, INPUT<>0
0033 000a RELFLG RMB 1 *TV RELATIONAL OPERATOR FLAG
0034 000b TEMPPT RMB 2 *PV TEMPORARY STRING STACK POINTER
0035 000d LASTPT RMB 2 *PV ADDR OF LAST USED STRING STACK ADDRESS
0036 000f TEMPTR RMB 2 TEMPORARY POINTER
0037 0011 TMPTR1 RMB 2 TEMPORARY DESCRIPTOR STORAGE (STACK SEARCH)
0038 0013 FPA2 RMB 4 FLOATING POINT ACCUMULATOR #2 MANTISSA
0039 0017 BOTSTK RMB 2 BOTTOM OF STACK AT LAST CHECK
0040 0019 TXTTAB RMB 2 *PV BEGINNING OF BASIC PROGRAM
0041 001b VARTAB RMB 2 *PV START OF VARIABLES
0042 001d ARYTAB RMB 2 *PV START OF ARRAYS
0043 001f ARYEND RMB 2 *PV END OF ARRAYS (+1)
0044 0021 FRETOP RMB 2 *PV START OF STRING STORAGE (TOP OF FREE RAM)
0045 0023 STRTAB RMB 2 *PV START OF STRING VARIABLES
0046 0025 FRESPC RMB 2 UTILITY STRING POINTER
0047 0027 MEMSIZ RMB 2 *PV TOP OF STRING SPACE
0048 0029 OLDTXT RMB 2 SAVED LINE NUMBER DURING A "STOP"
0049 002b BINVAL RMB 2 BINARY VALUE OF A CONVERTED LINE NUMBER
0050 002d OLDPTR RMB 2 SAVED INPUT PTR DURING A "STOP"
0051 002f TINPTR RMB 2 TEMPORARY INPUT POINTER STORAGE
0052 0031 DATTXT RMB 2 *PV 'DATA' STATEMENT LINE NUMBER POINTER
0053 0033 DATPTR RMB 2 *PV 'DATA' STATEMENT ADDRESS POINTER
0054 0035 DATTMP RMB 2 DATA POINTER FOR 'INPUT' & 'READ'
0055 0037 VARNAM RMB 2 *TV TEMP STORAGE FOR A VARIABLE NAME
0056 0039 VARPTR RMB 2 *TV POINTER TO A VARIABLE DESCRIPTOR
0057 003b VARDES RMB 2 TEMP POINTER TO A VARIABLE DESCRIPTOR
0058 003d RELPTR RMB 2 POINTER TO RELATIONAL OPERATOR PROCESSING ROUTINE
0059 003f TRELFL RMB 1 TEMPORARY RELATIONAL OPERATOR FLAG BYTE
0060 * FLOATING POINT ACCUMULATORS #3,4 & 5 ARE MOSTLY
0061 * USED AS SCRATCH PAD VARIABLES.
0062 ** FLOATING POINT ACCUMULATOR #3 :PACKED: ($40-$44)
0063 0040 V40 RMB 1
0064 0041 V41 RMB 1
0065 0042 V42 RMB 1
0066 0043 V43 RMB 1
0067 0044 V44 RMB 1
0068 ** FLOATING POINT ACCUMULATOR #4 :PACKED: ($45-$49)
0069 0045 V45 RMB 1
0070 0046 V46 RMB 1
0071 0047 V47 RMB 1
0072 0048 V48 RMB 2
0073 ** FLOATING POINT ACCUMULATOR #5 :PACKED: ($4A—$4E)
0074 004a V4A RMB 1
0075 004b V4B RMB 2
0076 004d V4D RMB 2
0077 ** FLOATING POINT ACCUMULATOR #0
0078 004f FP0EXP RMB 1 *PV FLOATING POINT ACCUMULATOR #0 EXPONENT
0079 0050 FPA0 RMB 4 *PV FLOATING POINT ACCUMULATOR #0 MANTISSA
0080 0054 FP0SGN RMB 1 *PV FLOATING POINT ACCUMULATOR #0 SIGN
0081 0055 COEFCT RMB 1 POLYNOMIAL COEFFICIENT COUNTER
0082 0056 STRDES RMB 5 TEMPORARY STRING DESCRIPTOR
0083 005b FPCARY RMB 1 FLOATING POINT CARRY BYTE
0084 ** FLOATING POINT ACCUMULATOR #1
0085 005c FP1EXP RMB 1 *PV FLOATING POINT ACCUMULATOR #1 EXPONENT
0086 005d FPA1 RMB 4 *PV FLOATING POINT ACCUMULATOR #1 MANTISSA
0087 0061 FP1SGN RMB 1 *PV FLOATING POINT ACCUMULATOR #1 SIGN
0088 0062 RESSGN RMB 1 SIGN OF RESULT OF FLOATING POINT OPERATION
0089 0063 FPSBYT RMB 1 FLOATING POINT SUB BYTE (FIFTH BYTE)
0090 0064 COEFPT RMB 2 POLYNOMIAL COEFFICIENT POINTER
0091 0066 LSTTXT RMB 2 CURRENT LINE POINTER DURING LIST
0092 0068 CURLIN RMB 2 *PV CURRENT LINE # OF BASIC PROGRAM, $FFFF = DIRECT
0093 006a DEVCFW RMB 1 *TV TAB FIELD WIDTH
0094 006b DEVLCF RMB 1 *TV TAB ZONE
0095 006c DEVPOS RMB 1 *TV PRINT POSITION
0096 006d DEVWID RMB 1 *TV PRINT WIDTH
0097 006e RSTFLG RMB 1 *PV WARM START FLAG: $55=WARM, OTHER=COLD
0098 006f RSTVEC RMB 2 *PV WARM START VECTOR - JUMP ADDRESS FOR WARM START
0099 0071 TOPRAM RMB 2 *PV TOP OF RAM
0100 0073 IKEYIM RMB 1 *TV INKEY$ RAM IMAGE
0101 0074 ZERO RMB 2 *PV DUMMY - THESE TWO BYTES ARE ALWAYS ZERO
0102 * THE FOLLOWING BYTES ARE MOVED DOWN FROM ROM
0103 0076 LPTCFW RMB 1 16
0104 0077 LPTLCF RMB 1 112
0105 0078 LPTWID RMB 1 132
0106 0079 LPTPOS RMB 1 0
0107 007a EXECJP RMB 2 LB4AA
0108
0109 * THIS ROUTINE PICKS UP THE NEXT INPUT CHARACTER FROM
0110 * BASIC. THE ADDRESS OF THE NEXT BASIC BYTE TO BE
0111 * INTERPRETED IS STORED AT CHARAD.
0112 007c 0c 84 GETNCH INC <CHARAD+1 *PV INCREMENT LS BYTE OF INPUT POINTER
0113 007e 26 02 BNE GETCCH *PV BRANCH IF NOT ZERO (NO CARRY)
0114 0080 0c 83 INC <CHARAD *PV INCREMENT MS BYTE OF INPUT POINTER
0115 0082 b6 GETCCH FCB $B6 *PV OP CODE OF LDA EXTENDED
0116 0083 CHARAD RMB 2 *PV THESE 2 BYTES CONTAIN ADDRESS OF THE CURRENT
0117 * * CHARACTER WHICH THE BASIC INTERPRETER IS
0118 * * PROCESSING
0119 0085 7e dc bf JMP BROMHK JUMP BACK INTO THE BASIC RUM
0120
0121 0088 VAB RMB 1 = LOW ORDER FOUR BYTES OF THE PRODUCT
0122 0089 VAC RMB 1 = OF A FLOATING POINT MULTIPLICATION
0123 008a VAD RMB 1 = THESE BYTES ARE USE AS RANDOM DATA
0124 008b VAE RMB 1 = BY THE RND STATEMENT
0125
0126 * EXTENDED BASIC VARIABLES
0127 008c TRCFLG RMB 1 *PV TRACE FLAG 0=OFF ELSE=ON
0128 008d USRADR RMB 2 *PV ADDRESS OF THE START OF USR VECTORS
0129
0130 * EXTENDED BASIC SCRATCH PAD VARIABLES
0131 008f VCF RMB 2
0132 0091 VD1 RMB 2
0133 0093 VD3 RMB 2
0134 0095 VD5 RMB 2
0135 0097 VD7 RMB 1
0136 0098 VD8 RMB 1
0137 0099 VD9 RMB 1
0138 009a VDA RMB 1
0139 009b SW3VEC RMB 3
0140 009e SW2VEC RMB 3
0141 00a1 SWIVEC RMB 3
0142 00a4 NMIVEC RMB 3
0143 00a7 IRQVEC RMB 3
0144 00aa FRQVEC RMB 3
0145 00ad USRJMP RMB 3 JUMP ADDRESS FOR BASIC'S USR FUNCTION
0146 00b0 RVSEED RMB 1 * FLOATING POINT RANDOM NUMBER SEED EXPONENT
0147 00b1 RMB 4 * MANTISSA: INITIALLY SET TO $804FC75259
0148
0149 **** USR FUNCTION VECTOR ADDRESSES (EX BASIC ONLY)
0150 00b5 USR0 RMB 2 USR 0 VECTOR
0151 00b7 RMB 2 USR 1
0152 00b9 RMB 2 USR 2
0153 00bb RMB 2 USR 3
0154 00bd RMB 2 USR 4
0155 00bf RMB 2 USR 5
0156 00c1 RMB 2 USR 6
0157 00c3 RMB 2 USR 7
0158 00c5 RMB 2 USR 8
0159 00c7 RMB 2 USR 9
0160
0161 00c9 STRSTK RMB 8*5 STRING DESCRIPTOR STACK
0162 00f1 LINHDR RMB 2 LINE INPUT BUFFER HEADER
0163 00f3 LINBUF RMB LBUFMX+1 BASIC LINE INPUT BUFFER
0164 01ee STRBUF RMB 41 STRING BUFFER
0165
0166 0217 PROGST RMB 1 START OF PROGRAM SPACE
0167 * INTERRUPT VECTORS
0168 fff2 ORG $FFF2
0169 fff2 SWI3 RMB 2
0170 fff4 SWI2 RMB 2
0171 fff6 FIRQ RMB 2
0172 fff8 IRQ RMB 2
0173 fffa SWI RMB 2
0174 fffc NMI RMB 2
0175 fffe RESETV RMB 2
0176
0177
0178
0179 db00 ORG $DB00
0180
0181 * CONSOLE IN
0182 db00 8d 03 LA171 BSR KEYIN GET A CHARACTER FROM CONSOLE IN
0183 db02 27 fc BEQ LA171 LOOP IF NO KEY DOWN
0184 db04 39 RTS
0185
0186 *
0187 * THIS ROUTINE GETS A KEYSTROKE FROM THE KEYBOARD IF A KEY
0188 * IS DOWN. IT RETURNS ZERO TRUE IF THERE WAS NO KEY DOWN.
0189 *
0190 *
0191 LA1C1
0192 db05 b6 a0 00 KEYIN LDA USTAT
0193 db08 85 01 BITA #1
0194 db0a 27 06 BEQ NOCHAR
0195 db0c b6 a0 01 LDA RECEV
0196 db0f 84 7f ANDA #$7F
0197 db11 39 RTS
0198 db12 4f NOCHAR CLRA
0199 db13 39 RTS
0200
0201
0202
0203 * CONSOLE OUT
0204 db14 8d 24 PUTCHR BSR WAITACIA
0205 db16 34 02 PSHS A
0206 db18 81 0d CMPA #CR IS IT CARRIAGE RETURN?
0207 db1a 27 0b BEQ NEWLINE YES
0208 db1c b7 a0 01 STA TRANS
0209 db1f 0c 79 INC LPTPOS INCREMENT CHARACTER COUNTER
0210 db21 96 79 LDA LPTPOS CHECK FOR END OF LINE PRINTER LINE
0211 db23 91 78 CMPA LPTWID AT END OF LINE PRINTER LINE?
0212 db25 25 10 BLO PUTEND NO
0213 db27 0f 79 NEWLINE CLR LPTPOS RESET CHARACTER COUNTER
0214 db29 8d 0f BSR WAITACIA
0215 db2b 86 0d LDA #13
0216 db2d b7 a0 01 STA TRANS
0217 db30 8d 08 BSR WAITACIA
0218 db32 86 0a LDA #10 DO LINEFEED AFTER CR
0219 db34 b7 a0 01 STA TRANS
0220 db37 35 02 PUTEND PULS A
0221 db39 39 RTS
0222
0223 db3a 34 02 WAITACIA PSHS A
0224 db3c b6 a0 00 WRWAIT LDA USTAT
0225 db3f 85 02 BITA #2
0226 db41 27 f9 BEQ WRWAIT
0227 db43 35 02 PULS A
0228 db45 39 RTS
0229
0230 *
0231 RESVEC
0232 db46 10 ce 01 ee LA00E LDS #LINBUF+LBUFMX+1 SET STACK TO TOP OF LINE INPUT BUFFER
0233 db4a 96 6e LDA RSTFLG GET WARM START FLAG
0234 db4c 81 55 CMPA #$55 IS IT A WARM START?
0235 db4e 26 0a BNE BACDST NO - D0 A COLD START
0236 db50 9e 6f LDX RSTVEC WARM START VECTOR
0237 db52 a6 84 LDA ,X GET FIRST BYTE OF WARM START ADDR
0238 db54 81 12 CMPA #$12 IS IT NOP?
0239 db56 26 02 BNE BACDST NO - DO A COLD START
0240 db58 6e 84 JMP ,X YES, G0 THERE
0241
0242 * COLD START ENTRY
0243
0244 db5a 8e 02 18 BACDST LDX #PROGST+1 POINT X TO CLEAR 1ST 1K OF RAM
0245 db5d 6f 83 LA077 CLR ,--X MOVE POINTER DOWN TWO-CLEAR BYTE
0246 db5f 30 01 LEAX 1,X ADVANCE POINTER ONE
0247 db61 26 fa BNE LA077 KEEP GOING IF NOT AT BOTTOM OF PAGE 0
0248 db63 8e 02 17 LDX #PROGST SET TO START OF PROGRAM SPACE
0249 db66 6f 80 CLR ,X+ CLEAR 1ST BYTE OF BASIC PROGRAM
0250 db68 9f 19 STX TXTTAB BEGINNING OF BASIC PROGRAM
0251 db6a a6 02 LA084 LDA 2,X LOOK FOR END OF MEMORY
0252 db6c 43 COMA * COMPLEMENT IT AND PUT IT BACK
0253 db6d a7 02 STA 2,X * INTO SYSTEM MEMORY
0254 db6f a1 02 CMPA 2,X IS IT RAM?
0255 db71 26 06 BNE LA093 BRANCH IF NOT (ROM, BAD RAM OR NO RAM)
0256 db73 30 01 LEAX 1,X MOVE POINTER UP ONE
0257 db75 63 01 COM 1,X RE-COMPLEMENT TO RESTORE BYTE
0258 db77 20 f1 BRA LA084 KEEP LOOKING FOR END OF RAM
0259 db79 9f 71 LA093 STX TOPRAM SAVE ABSOLUTE TOP OF RAM
0260 db7b 9f 27 STX MEMSIZ SAVE TOP OF STRING SPACE
0261 db7d 9f 23 STX STRTAB SAVE START OF STRING VARIABLES
0262 db7f 30 89 ff 38 LEAX -200,X CLEAR 200 - DEFAULT STRING SPACE TO 200 BYTES
0263 db83 9f 21 STX FRETOP SAVE START OF STRING SPACE
0264 db85 1f 14 TFR X,S PUT STACK THERE
0265 db87 8e db ce LDX #LA10D POINT X TO ROM SOURCE DATA
0266 db8a ce 00 76 LDU #LPTCFW POINT U TO RAM DESTINATION
0267 db8d c6 12 LDB #18 MOVE 18 BYTES
0268 db8f bd dc ae JSR LA59A MOVE 18 BYTES FROM ROM TO RAM
0269 db92 ce 00 a7 LDU #IRQVEC POINT U TO NEXT RAM DESTINATION
0270 db95 c6 04 LDB #4 MOVE 4 MORE BYTES
0271 db97 bd dc ae JSR LA59A MOVE 4 BYTES FROM ROM TO RAM
0272 db9a 86 39 LDA #$39
0273 db9c 97 f0 STA LINHDR-1 PUT RTS IN LINHDR-1
0274 db9e bd df ba JSR LAD19 G0 DO A ‘NEW’
0275 * EXTENDED BASIC INITIALISATION
0276 dba1 8e 00 b5 LDX #USR0 INITIALIZE ADDRESS OF START OF
0277 dba4 9f 8d STX USRADR USR JUMP TABLE
0278 * INITIALIZE THE USR CALLS TO ‘FC ERROR’
0279 dba6 ce e6 ce LDU #LB44A ADDRESS OF ‘FC ERROR’ ROUTINE
0280 dba9 c6 0a LDB #10 10 USR CALLS IN EX BASIC
0281 dbab ef 81 L8031 STU ,X++ STORE ‘FC’ ERROR AT USR ADDRESSES
0282 dbad 5a DECB FINISHED ALL 10?
0283 dbae 26 fb BNE L8031 NO
0284
0285 * INITIALISE ACIA
0286 dbb0 86 95 LDA #RTS_LOW DIV16 CLOCK -> 7372800 / 4 / 16 = 115200
0287 dbb2 b7 a0 00 STA UCTRL
0288 dbb5 8e dc 03 LDX #LA147-1 POINT X TO COLOR BASIC COPYRIGHT MESSAGE
0289 dbb8 bd eb e5 JSR LB99C PRINT ‘COLOR BASIC’
0290 dbbb 8e db c6 LDX #BAWMST WARM START ADDRESS
0291 dbbe 9f 6f STX RSTVEC SAVE IT
0292 dbc0 86 55 LDA #$55 WARM START FLAG
0293 dbc2 97 6e STA RSTFLG SAVE IT
0294 dbc4 20 04 BRA LA0F3 GO TO BASIC’S MAIN LOOP
0295 dbc6 12 BAWMST NOP NOP REQ’D FOR WARM START
0296 dbc7 bd df d4 JSR LAD33 DO PART OF A NEW
0297 dbca 7e df 22 LA0F3 JMP LAC73 GO TO MAIN LOOP OF BASIC
0298 *
0299 * FIRQ SERVICE ROUTINE
0300 BFRQSV
0301 dbcd 3b RTI
0302 *
0303 * THESE BYTES ARE MOVED TO ADDRESSES $76 - $85 THE DIRECT PAGE
0304 dbce 10 LA10D FCB 16 TAB FIELD WIDTH
0305 dbcf 40 FCB 64 LAST TAB ZONE
0306 dbd0 50 FCB 80 PRINTER WIDTH
0307 dbd1 00 FCB 0 LINE PRINTER POSITION
0308 dbd2 e6 ce FDB LB44A ARGUMENT OF EXEC COMMAND - SET TO ‘FC’ ERROR
0309 * LINE INPUT ROUTINE
0310 dbd4 0c 84 INC CHARAD+1
0311 dbd6 26 02 BNE LA123
0312 dbd8 0c 83 INC CHARAD
0313 dbda b6 00 00 LA123 LDA >0000
0314 dbdd 7e dc bf JMP BROMHK
0315 *
0316 * THESE BYTES ARE MOVED TO ADDRESSES $A7-$B1
0317 dbe0 7e dc be JMP BIRQSV IRQ SERVICE
0318 dbe3 7e db cd JMP BFRQSV FIRQ SERVICE
0319 dbe6 7e e6 ce JMP LB44A USR ADDRESS FOR 8K BASIC (INITIALIZED TO ‘FC’ ERROR)
0320 dbe9 80 FCB $80 *RANDOM SEED
0321 dbea 4f c7 FDB $4FC7 *RANDON SEED OF MANTISSA
0322 dbec 52 59 FDB $5259 *.811635157
0323 * BASIC COMMAND INTERPRETATION TABLE ROM IMAGE
0324 dbee 32 COMVEC FCB 50 50 BASIC COMMANDS
0325 dbef dd 1d FDB LAA66 POINTS TO RESERVED WORDS
0326 dbf1 de 2a FDB LAB67 POINTS TO JUMP TABLE FOR COMMANDS
0327 dbf3 1d FCB 29 29 BASIC SECONDARY COMMANDS
0328 dbf4 dd bd FDB LAB1A POINTS TO SECONDARY FUNCTION RESERVED WORDS
0329 dbf6 dc ce FDB LAA29 POINTS TO SECONDARY FUNCTION JUMP TABLE
0330 dbf8 00 00 FDB 0 NO MORE TABLES (RES WORDS=0)
0331 dbfa 00 00 FDB 0 NO MORE TABLES
0332 dbfc 00 00 FDB 0 NO MORE TABLES
0333 dbfe 00 00 FDB 0 NO MORE TABLES
0334 dc00 00 00 FDB 0 NO MORE TABLES
0335 dc02 00 00 FDB 0 NO MORE TABLES (SECONDARY FNS =0)
0336
0337 * COPYRIGHT MESSAGES
0338 dc04 36 38 30 39 20 45 LA147 FCC "6809 EXTENDED BASIC"
58 54 45 4e 44 45
44 20 42 41 53 49
43
0339 dc17 0d FCB CR
0340 dc18 28 43 29 20 31 39 FCC "(C) 1982 BY MICROSOFT"
38 32 20 42 59 20
4d 49 43 52 4f 53
4f 46 54
0341 dc2d 0d 0d LA156 FCB CR,CR
0342 dc2f 00 LA165 FCB $00
0343
0344
0345 dc30 34 16 LA35F PSHS X,B,A SAVE REGISTERS
0346 dc32 9e 76 LDX LPTCFW TAB FIELD WIDTH AND TAB ZONE
0347 dc34 dc 78 LDD LPTWID PRINTER WIDTH AND POSITION
0348 dc36 9f 6a LA37C STX DEVCFW SAVE TAB FIELD WIDTH AND ZONE
0349 dc38 d7 6c STB DEVPOS SAVE PRINT POSITION
0350 dc3a 97 6d STA DEVWID SAVE PRINT WIDTH
0351 dc3c 35 96 PULS A,B,X,PC RESTORE REGISTERS
0352
0353 * THIS IS THE ROUTINE THAT GETS AN INPUT LINE FOR BASIC
0354 * EXIT WITH BREAK KEY: CARRY = 1
0355 * EXIT WITH ENTER KEY: CARRY = 0
0356 LA38D
0357 dc3e 0f 73 LA390 CLR IKEYIM RESET BREAK CHECK KEY TEMP KEY STORAGE
0358 dc40 8e 00 f4 LDX #LINBUF+1 INPUT LINE BUFFER
0359 dc43 c6 01 LDB #1 ACCB CHAR COUNTER: SET TO 1 TO ALLOW A
0360 * BACKSPACE AS FIRST CHARACTER
0361 dc45 bd db 00 LA39A JSR LA171 GO GET A CHARACTER FROM CONSOLE IN
0362 dc48 81 08 CMPA #BS BACKSPACE
0363 dc4a 26 07 BNE LA3B4 NO
0364 dc4c 5a DECB YES - DECREMENT CHAR COUNTER
0365 dc4d 27 ef BEQ LA390 BRANCH IF BACK AT START OF LINE AGAIN
0366 dc4f 30 1f LEAX -1,X DECREMENT BUFFER POINTER
0367 dc51 20 34 BRA LA3E8 ECHO CHAR TO SCREEN
0368 dc53 81 15 LA3B4 CMPA #$15 SHIFT RIGHT ARROW?
0369 dc55 26 0a BNE LA3C2 NO
0370 * YES, RESET BUFFER TO BEGINNING AND ERASE CURRENT LINE
0371 dc57 5a LA3B8 DECB DEC CHAR CTR
0372 dc58 27 e4 BEQ LA390 GO BACK TO START IF CHAR CTR = 0
0373 dc5a 86 08 LDA #BS BACKSPACE?
0374 dc5c bd db 14 JSR PUTCHR SEND TO CONSOLE OUT (SCREEN)
0375 dc5f 20 f6 BRA LA3B8 KEEP GOING
0376 dc61 81 03 LA3C2 CMPA #3 BREAK KEY?
0377 dc63 1a 01 ORCC #1 SET CARRY FLAG
0378 dc65 27 05 BEQ LA3CD BRANCH IF BREAK KEY DOWN
0379 dc67 81 0d LA3C8 CMPA #CR ENTER KEY?
0380 dc69 26 0d BNE LA3D9 NO
0381 dc6b 4f LA3CC CLRA CLEAR CARRY FLAG IF ENTER KEY - END LINE ENTRY
0382 dc6c 34 01 LA3CD PSHS CC SAVE CARRY FLAG
0383 dc6e bd eb a5 JSR LB958 SEND CR TO SCREEN
0384 dc71 6f 84 CLR ,X MAKE LAST BYTE IN INPUT BUFFER = 0
0385 dc73 8e 00 f3 LDX #LINBUF RESET INPUT BUFFER POINTER
0386 dc76 35 81 PULS CC,PC RESTORE CARRY FLAG
0387
0388 * INSERT A CHARACTER INTO THE BASIC LINE INPUT BUFFER
0389 dc78 81 20 LA3D9 CMPA #$20 IS IT CONTROL CHAR?
0390 dc7a 25 c9 BLO LA39A BRANCH IF CONTROL CHARACTER
0391 dc7c 81 7b CMPA #'z+1 *
0392 dc7e 24 c5 BCC LA39A * IGNORE IF > LOWER CASE Z
0393 dc80 c1 fa CMPB #LBUFMX HAVE 250 OR MORE CHARACTERS BEEN ENTERED?
0394 dc82 24 c1 BCC LA39A YES, IGNORE ANY MORE
0395 dc84 a7 80 STA ,X+ PUT IT IN INPUT BUFFER
0396 dc86 5c INCB INCREMENT CHARACTER COUNTER
0397 dc87 bd db 14 LA3E8 JSR PUTCHR ECHO IT TO SCREEN
0398 dc8a 20 b9 BRA LA39A GO SET SOME MORE
0399
0400
0401 * EXEC
0402 dc8c 27 05 EXEC BEQ LA545 BRANCH IF NO ARGUMENT
0403 dc8e bd e9 c1 JSR LB73D EVALUATE ARGUMENT - ARGUMENT RETURNED IN X
0404 dc91 9f 7a STX EXECJP STORE X TO EXEC JUMP ADDRESS
0405 dc93 6e 9f 00 7a LA545 JMP [EXECJP] GO DO IT
0406
0407 * BREAK CHECK
0408 dc97 7e e0 a3 LA549 JMP LADEB GO DO BREAK KEY CHECK
0409
0410 * INKEY$
0411 dc9a 96 73 INKEY LDA IKEYIM WAS A KEY DOWN IN THE BREAK CHECK?
0412 dc9c 26 03 BNE LA56B YES
0413 dc9e bd db 05 JSR KEYIN GO GET A KEY
0414 dca1 0f 73 LA56B CLR IKEYIM CLEAR INKEY RAM IMAGE
0415 dca3 97 53 STA FPA0+3 STORE THE KEY IN FPA0
0416 dca5 10 26 0c 6a LBNE LB68F CONVERT FPA0+3 TO A STRING
0417 dca9 97 56 STA STRDES SET LENGTH OF STRING = 0 IF NO KEY DOWN
0418 dcab 7e e9 1f JMP LB69B PUT A NULL STRING ONTO THE STRING STACK
0419
0420 * MOVE ACCB BYTES FROM (X) TO (U)
0421 dcae a6 80 LA59A LDA ,X+ GET BYTE FROM X
0422 dcb0 a7 c0 STA ,U+ STORE IT AT U
0423 dcb2 5a DECB MOVED ALL BYTES?
0424 dcb3 26 f9 BNE LA59A NO
0425 dcb5 39 LA5A1 RTS
0426
0427 dcb6 39 LA5C4 RTS
0428
0429 ** THIS ROUTINE WILL SCAN OFF THE FILE NAME FROM A BASIC LINE
0430 ** AND RETURN A SYNTAX ERROR IF THERE ARE ANY CHARACTERS
0431 ** FOLLOWING THE END OF THE NAME
0432 dcb7 9d 82 LA5C7 JSR GETCCH GET CURRENT INPUT CHAR FROM BASIC LINE
0433 dcb9 27 fb LA5C9 BEQ LA5C4 RETURN IF END OF LINE
0434 dcbb 7e e5 00 JMP LB277 SYNTAX ERROR IF ANY MORE CHARACTERS
0435 * IRQ SERVICE
0436 BIRQSV
0437 dcbe 3b LA9C5 RTI RETURN FROM INTERRUPT
0438
0439 * SET CARRY IF NUMERIC - RETURN WITH
0440 * ZERO FLAG SET IF ACCA = 0 OR 3A(:) - END
0441 * OF BASIC LINE OR SUB LINE
0442 dcbf 81 3a BROMHK CMPA #'9+1 IS THIS CHARACTER >=(ASCII 9)+1?
0443 dcc1 24 0a BHS LAA28 BRANCH IF > 9; Z SET IF = COLON
0444 dcc3 81 20 CMPA #SPACE SPACE?
0445 dcc5 26 02 BNE LAA24 NO - SET CARRY IF NUMERIC
0446 dcc7 0e 7c JMP GETNCH IF SPACE, GET NECT CHAR (IGNORE SPACES)
0447 dcc9 80 30 LAA24 SUBA #'0 * SET CARRY IF
0448 dccb 80 d0 SUBA #-'0 * CHARACTER > ASCII 0
0449 dccd 39 LAA28 RTS
0450
0451 * DISPATCH TABLE FOR SECONDARY FUNCTIONS
0452 * TOKENS ARE PRECEEDED BY $FF
0453 * FIRST SET ALWAYS HAS ONE PARAMETER
0454 FUNC_TAB
0455 dcce ee c3 LAA29 FDB SGN SGN
0456 dcd0 ef 37 FDB INT INT
0457 dcd2 ee dc FDB ABS ABS
0458 dcd4 00 ad FDB USRJMP USR
0459 0083 TOK_USR EQU *-FUNC_TAB/2+$7F
0460 ff83 TOK_FF_USR EQU *-FUNC_TAB/2+$FF7F
0461 dcd6 f1 68 FDB RND RND
0462 dcd8 f1 bd FDB SIN SIN
0463 dcda e9 d4 FDB PEEK PEEK
0464 dcdc e9 05 FDB LEN LEN
0465 dcde e7 81 FDB STR STR$
0466 dce0 e9 9a FDB VAL VAL
0467 dce2 e9 24 FDB ASC ASC
0468 dce4 e9 10 FDB CHR CHR$
0469 dce6 f2 6d FDB ATN ATN
0470 dce8 f2 35 FDB COS COS
0471 dcea f2 3e FDB TAN TAN
0472 dcec f3 af FDB EXP EXP
0473 dcee f3 e1 FDB FIX FIX
0474 dcf0 f3 03 FDB LOG LOG
0475 dcf2 f5 69 FDB POS POS
0476 dcf4 f3 3d FDB SQR SQR
0477 dcf6 fa 3b FDB HEXDOL HEX$
0478 * LEFT, RIGHT AND MID ARE TREATED SEPARATELY
0479 dcf8 e9 2f FDB LEFT LEFT$
0480 0095 TOK_LEFT EQU *-FUNC_TAB/2+$7F
0481 dcfa e9 4c FDB RIGHT RIGHT$
0482 dcfc e9 53 FDB MID MID$
0483 0097 TOK_MID EQU *-FUNC_TAB/2+$7F
0484 * REMAINING FUNCTIONS
0485 dcfe dc 9a FDB INKEY INKEY$
0486 0098 TOK_INKEY EQU *-FUNC_TAB/2+$7F
0487 dd00 e7 72 FDB MEM MEM
0488 dd02 f5 71 FDB VARPT VARPTR
0489 dd04 f6 31 FDB INSTR INSTR
0490 dd06 f6 01 FDB STRING STRING$
0491 001d NUM_SEC_FNS EQU *-FUNC_TAB/2
0492
0493 * THIS TABLE CONTAINS PRECEDENCES AND DISPATCH ADDRESSES FOR ARITHMETIC
0494 * AND LOGICAL OPERATORS - THE NEGATION OPERATORS DO NOT ACT ON TWO OPERANDS
0495 * S0 THEY ARE NOT LISTED IN THIS TABLE. THEY ARE TREATED SEPARATELY IN THE
0496 * EXPRESSION EVALUATION ROUTINE. THEY ARE:
0497 * UNARY NEGATION (-), PRECEDENCE &7D AND LOGICAL NEGATION (NOT), PRECEDENCE $5A
0498 * THE RELATIONAL OPERATORS < > = ARE ALSO NOT LISTED, PRECEDENCE $64.
0499 * A PRECEDENCE VALUE OF ZERO INDICATES END OF EXPRESSION OR PARENTHESES
0500 *
0501 dd08 79 LAA51 FCB $79
0502 dd09 ec 0e FDB LB9C5 +
0503 dd0b 79 FCB $79
0504 dd0c ec 05 FDB LB9BC -
0505 dd0e 7b FCB $7B
0506 dd0f ed 15 FDB LBACC *
0507 dd11 7b FCB $7B
0508 dd12 ed da FDB LBB91 /
0509 dd14 7f FCB $7F
0510 dd15 f3 46 FDB L8489 EXPONENTIATION
0511 dd17 50 FCB $50
0512 dd18 e5 59 FDB LB2D5 AND
0513 dd1a 46 FCB $46
0514 dd1b e5 58 FDB LB2D4 OR
0515
0516 * THIS IS THE RESERVED WORD TABLE
0517 * FIRST PART OF THE TABLE CONTAINS EXECUTABLE COMMANDS
0518 dd1d 46 4f LAA66 FCC "FO" 80
0519 dd1f d2 FCB $80+'R'
0520 dd20 47 FCC "G" 81
0521 dd21 cf FCB $80+'O'
0522 0081 TOK_GO EQU $81
0523 dd22 52 45 FCC "RE" 82
0524 dd24 cd FCB $80+'M'
0525 dd25 a7 FCB ''+$80 83
0526 dd26 45 4c 53 FCC "ELS" 84
0527 dd29 c5 FCB $80+'E'
0528 dd2a 49 FCC "I" 85
0529 dd2b c6 FCB $80+'F'
0530 dd2c 44 41 54 FCC "DAT" 86
0531 dd2f c1 FCB $80+'A'
0532 dd30 50 52 49 4e FCC "PRIN" 87
0533 dd34 d4 FCB $80+'T'
0534 dd35 4f FCC "O" 88
0535 dd36 ce FCB $80+'N'
0536 dd37 49 4e 50 55 FCC "INPU" 89
0537 dd3b d4 FCB $80+'T'
0538 dd3c 45 4e FCC "EN" 8A
0539 dd3e c4 FCB $80+'D'
0540 dd3f 4e 45 58 FCC "NEX" 8B
0541 dd42 d4 FCB $80+'T'
0542 dd43 44 49 FCC "DI" 8C
0543 dd45 cd FCB $80+'M'
0544 dd46 52 45 41 FCC "REA" 8D
0545 dd49 c4 FCB $80+'D'
0546 dd4a 52 55 FCC "RU" 8E
0547 dd4c ce FCB $80+'N'
0548 dd4d 52 45 53 54 4f 52 FCC "RESTOR" 8F
0549 dd53 c5 FCB $80+'E'
0550 dd54 52 45 54 55 52 FCC "RETUR" 90
0551 dd59 ce FCB $80+'N'
0552 dd5a 53 54 4f FCC "STO" 91
0553 dd5d d0 FCB $80+'P'
0554 dd5e 50 4f 4b FCC "POK" 92
0555 dd61 c5 FCB $80+'E'
0556 dd62 43 4f 4e FCC "CON" 93
0557 dd65 d4 FCB $80+'T'
0558 dd66 4c 49 53 FCC "LIS" 94
0559 dd69 d4 FCB $80+'T'
0560 dd6a 43 4c 45 41 FCC "CLEA" 95
0561 dd6e d2 FCB $80+'R'
0562 dd6f 4e 45 FCC "NE" 96
0563 dd71 d7 FCB $80+'W'
0564 dd72 45 58 45 FCC "EXE" 97
0565 dd75 c3 FCB $80+'C'
0566 dd76 54 52 4f FCC "TRO" 98
0567 dd79 ce FCB $80+'N'
0568 dd7a 54 52 4f 46 FCC "TROF" 99
0569 dd7e c6 FCB $80+'F'
0570 dd7f 44 45 FCC "DE" 9A
0571 dd81 cc FCB $80+'L'
0572 dd82 44 45 FCC "DE" 9B
0573 dd84 c6 FCB $80+'F'
0574 dd85 4c 49 4e FCC "LIN" 9C
0575 dd88 c5 FCB $80+'E'
0576 dd89 52 45 4e 55 FCC "RENU" 9D
0577 dd8d cd FCB $80+'M'
0578 dd8e 45 44 49 FCC "EDI" 9E
0579 dd91 d4 FCB $80+'T'
0580 * END OF EXECUTABLE COMMANDS. THE REMAINDER OF THE TABLE ARE NON-EXECUTABLE TOKENS
0581 dd92 54 41 42 FCC "TAB" 9F
0582 dd95 a8 FCB $80+'('
0583 009f TOK_TAB EQU $9F
0584 dd96 54 FCC "T" A0
0585 dd97 cf FCB $80+'O'
0586 00a0 TOK_TO EQU $A0
0587 dd98 53 55 FCC "SU" A1
0588 dd9a c2 FCB $80+'B'
0589 00a1 TOK_SUB EQU $A1
0590 dd9b 54 48 45 FCC "THE" A2
0591 dd9e ce FCB $80+'N'
0592 00a2 TOK_THEN EQU $A2
0593 dd9f 4e 4f FCC "NO" A3
0594 dda1 d4 FCB $80+'T'
0595 00a3 TOK_NOT EQU $A3
0596 dda2 53 54 45 FCC "STE" A4
0597 dda5 d0 FCB $80+'P'
0598 00a4 TOK_STEP EQU $A4
0599 dda6 4f 46 FCC "OF" A5
0600 dda8 c6 FCB $80+'F'
0601 dda9 ab FCB '++$80 A6
0602 00a6 TOK_PLUS EQU $A6
0603 ddaa ad FCB '-+$80 A7
0604 00a7 TOK_MINUS EQU $A7
0605 ddab aa FCB '*+$80 A8
0606 ddac af FCB '/+$80 A9
0607 ddad de FCB '^+$80 AA
0608 ddae 41 4e FCC "AN" AB
0609 ddb0 c4 FCB $80+'D'
0610 ddb1 4f FCC "O" AC
0611 ddb2 d2 FCB $80+'R'
0612 ddb3 be FCB '>+$80 AD
0613 00ad TOK_GREATER EQU $AD
0614 ddb4 bd FCB '=+$80 AE
0615 00ae TOK_EQUALS EQU $AE
0616 ddb5 bc FCB '<+$80 AF
0617 ddb6 46 FCC "F" B0
0618 ddb7 ce FCB $80+'N'
0619 00b0 TOK_FN EQU $B0
0620 ddb8 55 53 49 4e FCC "USIN" B1
0621 ddbc c7 FCB $80+'G'
0622 00b1 TOK_USING EQU $B1
0623 *
0624
0625 * FIRST SET ALWAYS HAS ONE PARAMETER
0626 ddbd 53 47 LAB1A FCC "SG" 80
0627 ddbf ce FCB $80+'N'
0628 ddc0 49 4e FCC "IN" 81
0629 ddc2 d4 FCB $80+'T'
0630 ddc3 41 42 FCC "AB" 82
0631 ddc5 d3 FCB $80+'S'
0632 ddc6 55 53 FCC "US" 83
0633 ddc8 d2 FCB $80+'R'
0634 ddc9 52 4e FCC "RN" 84
0635 ddcb c4 FCB $80+'D'
0636 ddcc 53 49 FCC "SI" 85
0637 ddce ce FCB $80+'N'
0638 ddcf 50 45 45 FCC "PEE" 86
0639 ddd2 cb FCB $80+'K'
0640 ddd3 4c 45 FCC "LE" 87
0641 ddd5 ce FCB $80+'N'
0642 ddd6 53 54 52 FCC "STR" 88
0643 ddd9 a4 FCB $80+'$'
0644 ddda 56 41 FCC "VA" 89
0645 dddc cc FCB $80+'L'
0646 dddd 41 53 FCC "AS" 8A
0647 dddf c3 FCB $80+'C'
0648 dde0 43 48 52 FCC "CHR" 8B
0649 dde3 a4 FCB $80+'$'
0650 dde4 41 54 FCC "AT" 8C
0651 dde6 ce FCB $80+'N'
0652 dde7 43 4f FCC "CO" 8D
0653 dde9 d3 FCB $80+'S'
0654 ddea 54 41 FCC "TA" 8E
0655 ddec ce FCB $80+'N'
0656 dded 45 58 FCC "EX" 8F
0657 ddef d0 FCB $80+'P'
0658 ddf0 46 49 FCC "FI" 90
0659 ddf2 d8 FCB $80+'X'
0660 ddf3 4c 4f FCC "LO" 91
0661 ddf5 c7 FCB $80+'G'
0662 ddf6 50 4f FCC "PO" 92
0663 ddf8 d3 FCB $80+'S'
0664 ddf9 53 51 FCC "SQ" 93
0665 ddfb d2 FCB $80+'R'
0666 ddfc 48 45 58 FCC "HEX" 94
0667 ddff a4 FCB $80+'$'
0668 * LEFT, RIGHT AND MID ARE TREATED SEPARATELY
0669 de00 4c 45 46 54 FCC "LEFT" 95
0670 de04 a4 FCB $80+'$'
0671 de05 52 49 47 48 54 FCC "RIGHT" 96
0672 de0a a4 FCB $80+'$'
0673 de0b 4d 49 44 FCC "MID" 97
0674 de0e a4 FCB $80+'$'
0675 * REMAINING FUNCTIONS
0676 de0f 49 4e 4b 45 59 FCC "INKEY" 98
0677 de14 a4 FCB $80+'$'
0678 de15 4d 45 FCC "ME" 99
0679 de17 cd FCB $80+'M'
0680 de18 56 41 52 50 54 FCC "VARPT" 9A
0681 de1d d2 FCB $80+'R'
0682 de1e 49 4e 53 54 FCC "INST" 9B
0683 de22 d2 FCB $80+'R'
0684 de23 53 54 52 49 4e 47 FCC "STRING" 9C
0685 de29 a4 FCB $80+'$'
0686
0687 *
0688 * DISPATCH TABLE FOR COMMANDS TOKEN #
0689 CMD_TAB
0690 de2a df e8 LAB67 FDB FOR 80
0691 de2c e1 33 FDB GO 81
0692 de2e e1 90 FDB REM 82
0693 0082 TOK_REM EQU *-CMD_TAB/2+$7F
0694 de30 e1 90 FDB REM 83 (')
0695 0083 TOK_SNGL_Q EQU *-CMD_TAB/2+$7F
0696 de32 e1 90 FDB REM 84 (ELSE)
0697 0084 TOK_ELSE EQU *-CMD_TAB/2+$7F
0698 de34 e1 c1 FDB IF 85
0699 0085 TOK_IF EQU *-CMD_TAB/2+$7F
0700 de36 e1 8d FDB DATA 86
0701 0086 TOK_DATA EQU *-CMD_TAB/2+$7F
0702 de38 eb 6a FDB PRINT 87
0703 0087 TOK_PRINT EQU *-CMD_TAB/2+$7F
0704 de3a e1 ef FDB ON 88
0705 de3c e2 9c FDB INPUT 89
0706 0089 TOK_INPUT EQU *-CMD_TAB/2+$7F
0707 de3e e0 ba FDB END 8A
0708 de40 e3 81 FDB NEXT 8B
0709 de42 e5 d2 FDB DIM 8C
0710 de44 e2 d6 FDB READ 8D
0711 de46 e1 28 FDB RUN 8E
0712 de48 e0 9c FDB RESTOR 8F
0713 de4a e1 6d FDB RETURN 90
0714 de4c e0 be FDB STOP 91
0715 de4e e9 db FDB POKE 92
0716 de50 e0 e3 FDB CONT 93
0717 de52 e9 e2 FDB LIST 94
0718 de54 e0 f4 FDB CLEAR 95
0719 de56 df b8 FDB NEW 96
0720 de58 dc 8c FDB EXEC 97
0721 de5a f5 64 FDB TRON 98
0722 de5c f5 65 FDB TROFF 99
0723 de5e f7 e0 FDB DEL 9A
0724 de60 f7 24 FDB DEF 9B
0725 de62 fe ce FDB LINE 9C
0726 de64 f8 6a FDB RENUM 9D
0727 de66 f3 f0 FDB EDIT 9E
0728 009e TOK_HIGH_EXEC EQU *-CMD_TAB/2+$7F
0729
0730 * ERROR MESSAGES AND THEIR NUMBERS AS USED INTERNALLY
0731 de68 4e 46 LABAF FCC "NF" 0 NEXT WITHOUT FOR
0732 de6a 53 4e FCC "SN" 1 SYNTAX ERROR
0733 de6c 52 47 FCC "RG" 2 RETURN WITHOUT GOSUB
0734 de6e 4f 44 FCC "OD" 3 OUT OF DATA
0735 de70 46 43 FCC "FC" 4 ILLEGAL FUNCTION CALL
0736 de72 4f 56 FCC "OV" 5 OVERFLOW
0737 de74 4f 4d FCC "OM" 6 OUT OF MEMORY
0738 de76 55 4c FCC "UL" 7 UNDEFINED LINE NUMBER
0739 de78 42 53 FCC "BS" 8 BAD SUBSCRIPT
0740 de7a 44 44 FCC "DD" 9 REDIMENSIONED ARRAY
0741 de7c 2f 30 FCC "/0" 10 DIVISION BY ZERO
0742 de7e 49 44 FCC "ID" 11 ILLEGAL DIRECT STATEMENT
0743 de80 54 4d FCC "TM" 12 TYPE MISMATCH
0744 de82 4f 53 FCC "OS" 13 OUT OF STRING SPACE
0745 de84 4c 53 FCC "LS" 14 STRING TOO LONG
0746 de86 53 54 FCC "ST" 15 STRING FORMULA TOO COMPLEX
0747 de88 43 4e FCC "CN" 16 CAN'T CONTINUE
0748 de8a 46 44 FCC "FD" 17 BAD FILE DATA
0749 de8c 41 4f FCC "AO" 18 FILE ALREADY OPEN
0750 de8e 44 4e FCC "DN" 19 DEVICE NUMBER ERROR
0751 de90 49 4f FCC "IO" 20 I/O ERROR
0752 de92 46 4d FCC "FM" 21 BAD FILE MODE
0753 de94 4e 4f FCC "NO" 22 FILE NOT OPEN
0754 de96 49 45 FCC "IE" 23 INPUT PAST END OF FILE
0755 de98 44 53 FCC "DS" 24 DIRECT STATEMENT IN FILE
0756 * ADDITIONAL ERROR MESSAGES ADDED BY EXTENDED BASIC
0757 de9a 55 46 L890B FCC "UF" 25 UNDEFINED FUNCTION (FN) CALL
0758 de9c 4e 45 L890D FCC "NE" 26 FILE NOT FOUND
0759
0760 de9e 20 45 52 52 4f 52 LABE1 FCC " ERROR"
0761 dea4 00 FCB $00
0762 dea5 20 49 4e 20 LABE8 FCC " IN "
0763 dea9 00 FCB $00
0764 deaa 0d LABED FCB CR
0765 deab 4f 4b LABEE FCC "OK"
0766 dead 0d 00 FCB CR,$00
0767 deaf 0d LABF2 FCB CR
0768 deb0 42 52 45 41 4b FCC "BREAK"
0769 deb5 00 FCB $00
0770
0771 * SEARCH THE STACK FOR ‘GOSUB/RETURN’ OR ‘FOR/NEXT’ DATA.
0772 * THE ‘FOR/NEXT’ INDEX VARIABLE DESCRIPTOR ADDRESS BEING
0773 * SOUGHT IS STORED IN VARDES. EACH BLOCK OF FOR/NEXT DATA IS 18
0774 * BYTES WITH A $80 LEADER BYTE AND THE GOSUB/RETURN DATA IS 5 BYTES
0775 * WITH AN $A6 LEADER BYTE. THE FIRST NON "FOR/NEXT" DATA
0776 * IS CONSIDERED ‘GOSUB/RETURN’
0777 deb6 30 64 LABF9 LEAX 4,S POINT X TO 3RD ADDRESS ON STACK - IGNORE THE
0778 * FIRST TWO RETURN ADDRESSES ON THE STACK
0779 deb8 c6 12 LABFB LDB #18 18 BYTES SAVED ON STACK FOR EACH ‘FOR’ LOOP
0780 deba 9f 0f STX TEMPTR SAVE POINTER
0781 debc a6 84 LDA ,X GET 1ST BYTE
0782 debe 80 80 SUBA #$80 * CHECK FOR TYPE OF STACK JUMP FOUND
0783 dec0 26 15 BNE LAC1A * BRANCH IF NOT ‘FOR/NEXT’
0784 dec2 ae 01 LDX 1,X = GET INDEX VARIABLE DESCRIPTOR
0785 dec4 9f 11 STX TMPTR1 = POINTER AND SAVE IT IN TMPTR1
0786 dec6 9e 3b LDX VARDES GET INDEX VARIABLE BEING SEARCHED FOR
0787 dec8 27 09 BEQ LAC16 BRANCH IF DEFAULT INDEX VARIABLE - USE THE
0788 * FIRST ‘FOR/NEXT’ DATA FOUND ON STACK
0789 * IF NO INDEX VARIABLE AFTER ‘NEXT’
0790 deca 9c 11 CMPX TMPTR1 DOES THE STACK INDEX MATCH THE ONE
0791 * BEING SEARCHED FOR?
0792 decc 27 09 BEQ LAC1A YES
0793 dece 9e 0f LDX TEMPTR * RESTORE INITIAL POINTER, ADD
0794 ded0 3a ABX * 18 TO IT AND LOOK FOR
0795 ded1 20 e5 BRA LABFB * NEXT BLOCK OF DATA
0796 ded3 9e 11 LAC16 LDX TMPTR1 = GET 1ST INDEX VARIABLE FOUND AND
0797 ded5 9f 3b STX VARDES = SAVE AS ‘NEXT’ INDEX
0798 ded7 9e 0f LAC1A LDX TEMPTR POINT X TO START OF ‘FOR/NEXT’ DATA
0799 ded9 4d TSTA SET ZERO FLAG IF ‘FOR/NEXT’ DATA
0800 deda 39 RTS
0801 * CHECK FOR MEMORY SPACE FOR NEW TOP OF
0802 * ARRAYS AND MOVE ARRAYS TO NEW LOCATION
0803 dedb 8d 17 LAC1E BSR LAC37 ACCD = NEW BOTTOM OF FREE RAM - IS THERE
0804 * ROOM FOR THE STACK?
0805 * MOVE BYTES FROM V43(X) TO V41(U) UNTIL (X) = V47 AND
0806 * SAVE FINAL VALUE OF U IN V45
0807 dedd de 41 LAC20 LDU V41 POINT U TO DESTINATION ADDRESS (V41)
0808 dedf 33 41 LEAU 1,U ADD ONE TO U - COMPENSATE FOR FIRST PSHU
0809 dee1 9e 43 LDX V43 POINT X TO SOURCE ADDRESS (V43)
0810 dee3 30 01 LEAX 1,X ADD ONE - COMPENSATE FOR FIRST LDA ,X
0811 dee5 a6 82 LAC28 LDA ,-X GRAB A BYTE FROM SOURCE
0812 dee7 36 02 PSHU A MOVE IT TO DESTINATION
0813 dee9 9c 47 CMPX V47 DONE?
0814 deeb 26 f8 BNE LAC28 NO - KEEP MOVING BYTES
0815 deed df 45 STU V45 SAVE FINAL DESTINATION ADDRESS
0816 deef 39 LAC32 RTS
0817 * CHECK TO SEE IF THERE IS ROOM TO STORE 2*ACCB
0818 * BYTES IN FREE RAM - OM ERROR IF NOT
0819 def0 4f LAC33 CLRA * ACCD CONTAINS NUMBER OF EXTRA
0820 def1 58 ASLB * BYTES TO PUT ON STACK
0821 def2 d3 1f ADDD ARYEND END OF PROGRAM AND VARIABLES
0822 def4 c3 00 3a LAC37 ADDD #STKBUF ADD STACK BUFFER - ROOM FOR STACK?
0823 def7 25 08 BCS LAC44 BRANCH IF GREATER THAN $FFFF
0824 def9 10 df 17 STS BOTSTK CURRENT NEW BOTTOM OF STACK STACK POINTER
0825 defc 10 93 17 CMPD BOTSTK ARE WE GOING TO BE BELOW STACK?
0826 deff 25 ee BCS LAC32 YES - NO ERROR
0827 df01 c6 0c LAC44 LDB #6*2 OUT OF MEMORY ERROR
0828
0829 * ERROR SERVICING ROUTINE
0830 df03 bd df d4 LAC46 JSR LAD33 RESET STACK, STRING STACK, CONTINUE POINTER
0831 df06 bd eb a9 JSR LB95C SEND A CR TO SCREEN
0832 df09 bd eb f8 JSR LB9AF SEND A ‘?‘ TO SCREEN
0833 df0c 8e de 68 LDX #LABAF POINT TO ERROR TABLE
0834 df0f 3a LAC60 ABX ADD MESSAGE NUMBER OFFSET
0835 df10 8d 31 BSR LACA0 * GET TWO CHARACTERS FROM X AND
0836 df12 8d 2f BSR LACA0 * SEND TO CONSOLE OUT (SCREEN)
0837 df14 8e de 9d LDX #LABE1-1 POINT TO "ERROR" MESSAGE
0838 df17 bd eb e5 LAC68 JSR LB99C PRINT MESSAGE POINTED TO BY X
0839 df1a 96 68 LDA CURLIN GET CURRENT LINE NUMBER (CURL IN)
0840 df1c 4c INCA TEST FOR DIRECT MODE
0841 df1d 27 03 BEQ LAC73 BRANCH IF DIRECT MODE
0842 df1f bd f0 0e JSR LBDC5 PRINT ‘IN ****‘
0843
0844 * THIS IS THE MAIN LOOP OF BASIC WHEN IN DIRECT MODE
0845 df22 bd eb a9 LAC73 JSR LB95C MOVE CURSOR TO START OF LINE
0846 df25 8e de aa LDX #LABED POINT X TO ‘OK’, CR MESSAGE
0847 df28 bd eb e5 JSR LB99C PRINT ‘OK’, CR
0848 df2b bd dc 3e LAC7C JSR LA390 GO GET AN INPUT LINE
0849 df2e ce ff ff LDU #$FFFF THE LINE NUMBER FOR DIRECT MODE IS $FFFF
0850 df31 df 68 STU CURLIN SAVE IT IN CURLIN
0851 df33 25 f6 BCS LAC7C BRANCH IF LINE INPUT TERMINATED BY BREAK
0852 df35 9f 83 STX CHARAD SAVE (X) AS CURRENT INPUT POINTER - THIS WILL
0853 * ENABLE THE ‘LIVE KEYBOARD’ (DIRECT) MODE. THE
0854 * LINE JUST ENTERED WILL BE INTERPRETED
0855 df37 9d 7c JSR GETNCH GET NEXT CHARACTER FROM BASIC
0856 df39 27 f0 BEQ LAC7C NO LINE INPUT - GET ANOTHER LINE
0857 df3b 25 0b BCS LACA5 BRANCH IF NUMER1C - THERE WAS A LINE NUMBER BEFORE
0858 * THE STATEMENT ENTERED, SO THIS STATEMENT
0859 * WILL BE MERGED INTO THE BASIC PROGRAM
0860 df3d bd ea 97 JSR LB821 GO CRUNCH LINE
0861 df40 7e e0 71 JMP LADC0 GO EXECUTE THE STATEMENT (LIVE KEYBOARD)
0862 *
0863 df43 a6 80 LACA0 LDA ,X+ GET A CHARACTER
0864 df45 7e eb fa JMP LB9B1 SEND TO CONSOLE OUT
0865 * TAKE A LINE FROM THE LINE INPUT BUFFER
0866 * AND INSERT IT INTO THE BASIC PROGRAM
0867 df48 bd e2 14 LACA5 JSR LAF67 CONVERT LINE NUMBER TO BINARY
0868 df4b 9e 2b LACA8 LDX BINVAL GET CONVERTED LINE NUMBER
0869 df4d 9f f1 STX LINHDR STORE IT IN LINE INPUT HEADER
0870 df4f bd ea 97 JSR LB821 GO CRUNCH THE LINE
0871 df52 d7 03 STB TMPLOC SAVE LINE LENGTH
0872 df54 8d 4c BSR LAD01 FIND OUT WHERE TO INSERT LINE
0873 df56 25 12 BCS LACC8 BRANCH IF LINE NUMBER DOES NOT ALREADY EXIST
0874 df58 dc 47 LDD V47 GET ABSOLUTE ADDRESS OF LINE NUMBER
0875 df5a a3 84 SUBD ,X SUBTRACT ADDRESS OF NEXT LINE NUMBER
0876 df5c d3 1b ADDD VARTAB * ADD TO CURRENT END OF PROGRAM - THIS WILL REMOVE
0877 df5e dd 1b STD VARTAB * THE LENGTH OF THIS LINE NUMBER FROM THE PROGRAM
0878 df60 ee 84 LDU ,X POINT U TO ADDRESS OF NEXT LINE NUMBER
0879 * DELETE OLD LINE FROM BASIC PROGRAM
0880 df62 37 02 LACC0 PULU A GET A BYTE FROM WHAT’S LEFT OF PROGRAM
0881 df64 a7 80 STA ,X+ MOVE IT DOWN
0882 df66 9c 1b CMPX VARTAB COMPARE TO END OF BASIC PROGRAM
0883 df68 26 f8 BNE LACC0 BRANCH IF NOT AT END
0884 df6a 96 f3 LACC8 LDA LINBUF * CHECK TO SEE IF THERE IS A LINE IN
0885 df6c 27 1c BEQ LACE9 * THE BUFFER AND BRANCH IF NONE
0886 df6e dc 1b LDD VARTAB = SAVE CURRENT END OF
0887 df70 dd 43 STD V43 = PROGRAM IN V43
0888 df72 db 03 ADDB TMPLOC * ADD LENGTH OF CRUNCHED LINE,
0889 df74 89 00 ADCA #0 * PROPOGATE CARRY AND SAVE NEW END
0890 df76 dd 41 STD V41 * OF PROGRAM IN V41
0891 df78 bd de db JSR LAC1E = MAKE SURE THERE’S ENOUGH RAM FOR THIS
0892 * = LINE & MAKE A HOLE IN BASIC FOR NEW LINE
0893 df7b ce 00 ef LDU #LINHDR-2 POINT U TO LINE TO BE INSERTED
0894 df7e 37 02 LACDD PULU A GET A BYTE FROM NEW LINE
0895 df80 a7 80 STA ,X+ INSERT IT IN PROGRAM
0896 df82 9c 45 CMPX V45 * COMPARE TO ADDRESS OF END OF INSERTED
0897 df84 26 f8 BNE LACDD * LINE AND BRANCH IF NOT DONE
0898 df86 9e 41 LDX V41 = GET AND SAVE
0899 df88 9f 1b STX VARTAB = END OF PROGRAM
0900 df8a 8d 36 LACE9 BSR LAD21 RESET INPUT POINTER, CLEAR VARIABLES, INITIALIZE
0901 df8c 8d 02 BSR LACEF ADJUST START OF NEXT LINE ADDRESSES
0902 df8e 20 9b BRA LAC7C REENTER BASIC’S INPUT LOOP
0903 * COMPUTE THE START OF NEXT LINE ADDRESSES FOR THE BASIC PROGRAM
0904 df90 9e 19 LACEF LDX TXTTAB POINT X TO START OF PROGRAM
0905 df92 ec 84 LACF1 LDD ,X GET ADDRESS OF NEXT LINE
0906 df94 27 21 BEQ LAD16 RETURN IF END OF PROGRAM
0907 df96 33 04 LEAU 4,X POINT U TO START OF BASIC TEXT IN LINE
0908 df98 a6 c0 LACF7 LDA ,U+ * SKIP THROUGH THE LINE UNTIL A
0909 df9a 26 fc BNE LACF7 * ZERO (END OF LINE) IS FOUND
0910 df9c ef 84 STU ,X SAVE THE NEW START OF NEXT LINE ADDRESS
0911 df9e ae 84 LDX ,X POINT X TO START OF NEXT LINE
0912 dfa0 20 f0 BRA LACF1 KEEP GOING
0913 *
0914 * FIND A LINE NUMBER IN THE BASIC PROGRAM
0915 * RETURN WITH CARRY SET IF NO MATCH FOUND
0916 dfa2 dc 2b LAD01 LDD BINVAL GET THE LINE NUMBER TO FIND
0917 dfa4 9e 19 LDX TXTTAB BEGINNING OF PROGRAM
0918 dfa6 ee 84 LAD05 LDU ,X GET ADDRESS OF NEXT LINE NUMBER
0919 dfa8 27 09 BEQ LAD12 BRANCH IF END OF PROG
0920 dfaa 10 a3 02 CMPD 2,X IS IT A MATCH?
0921 dfad 23 06 BLS LAD14 CARRY SET IF LOWER; CARRY CLEAR IF MATCH
0922 dfaf ae 84 LDX ,X X = ADDRESS OF NEXT LINE
0923 dfb1 20 f3 BRA LAD05 KEEP LOOPING FOR LINE NUMBER
0924 dfb3 1a 01 LAD12 ORCC #1 SET CARRY FLAG
0925 dfb5 9f 47 LAD14 STX V47 SAVE MATCH LINE NUMBER OR NUMBER OF LINE JUST AFTER
0926 * WHERE IT SHOULD HAVE BEEN
0927 dfb7 39 LAD16 RTS
0928
0929 * NEW
0930 dfb8 26 fb NEW BNE LAD14 BRANCH IF ARGUMENT GIVEN
0931 dfba 9e 19 LAD19 LDX TXTTAB GET START OF BASIC
0932 dfbc 6f 80 CLR ,X+ * PUT 2 ZERO BYTES THERE - ERASE
0933 dfbe 6f 80 CLR ,X+ * THE BASIC PROGRAM
0934 dfc0 9f 1b STX VARTAB AND THE NEXT ADDRESS IS NOW THE END OF PROGRAM
0935 dfc2 9e 19 LAD21 LDX TXTTAB GET START OF BASIC
0936 dfc4 bd e1 68 JSR LAEBB PUT INPUT POINTER ONE BEFORE START OF BASIC
0937 * ERASE ALL VARIABLES
0938 dfc7 9e 27 LAD26 LDX MEMSIZ * RESET START OF STRING VARIABLES
0939 dfc9 9f 23 STX STRTAB * TO TOP OF STRING SPACE
0940 dfcb bd e0 9c JSR RESTOR RESET ‘DATA’ POINTER TO START OF BASIC
0941 dfce 9e 1b LDX VARTAB * GET START OF VARIABLES AND USE IT
0942 dfd0 9f 1d STX ARYTAB * TO RESET START OF ARRAYS
0943 dfd2 9f 1f STX ARYEND RESET END OF ARRAYS
0944 dfd4 8e 00 c9 LAD33 LDX #STRSTK * RESET STRING STACK POINTER TO
0945 dfd7 9f 0b STX TEMPPT * BOTTOM OF STRING STACK
0946 dfd9 ae e4 LDX ,S GET RETURN ADDRESS OFF STACK
0947 dfdb 10 de 21 LDS FRETOP RESTORE STACK POINTER
0948 dfde 6f e2 CLR ,-S PUT A ZERO BYTE ON STACK - TO CLEAR ANY RETURN OF
0949 * FOR/NEXT DATA FROM THE STACK
0950 dfe0 0f 2d CLR OLDPTR RESET ‘CONT’ ADDRESS SO YOU
0951 dfe2 0f 2e CLR OLDPTR+1 ‘CAN’T CONTINUE’
0952 dfe4 0f 08 CLR ARYDIS CLEAR THE ARRAY DISABLE FLAG
0953 dfe6 6e 84 JMP ,X RETURN TO CALLING ROUTINE - THIS IS NECESSARY
0954 * SINCE THE STACK WAS RESET
0955 *
0956 * FOR
0957 *
0958 * THE FOR COMMAND WILL STORE 18 BYTES ON THE STACK FOR
0959 * EACH FOR-NEXT LOOP WHICH IS BEING PROCESSED. THESE
0960 * BYTES ARE DEFINED AS FOLLOWS: 0- $80 (FOR FLAG);
0961 * 1,2=INDEX VARIABLE DESCRIPTOR POINTER; 3-7=FP VALUE OF STEP;
0962 * 8=STEP DIRECTION: $FF IF NEGATIVE; 0 IF ZERO; 1 IF POSITIVE;
0963 * 9-13=FP VALUE OF ‘TO’ PARAMETER;
0964 * 14,15=CURRENT LINE NUMBER; 16,17=RAM ADDRESS OF THE END
0965 * OF THE LINE CONTAINING THE ‘FOR’ STATEMENT
0966 dfe8 86 80 FOR LDA #$80 * SAVE THE DISABLE ARRAY FLAG IN VO8
0967 dfea 97 08 STA ARYDIS * DO NOT ALLOW THE INDEX VARIABLE TO BE AN ARRAY
0968 dfec bd e2 36 JSR LET SET INDEX VARIABLE TO INITIAL VALUE
0969 dfef bd de b6 JSR LABF9 SEARCH THE STACK FOR ‘FOR/NEXT’ DATA
0970 dff2 32 62 LEAS 2,S PURGE RETURN ADDRESS OFF OF THE STACK
0971 dff4 26 04 BNE LAD59 BRANCH IF INDEX VARIABLE NOT ALREADY BEING USED
0972 dff6 9e 0f LDX TEMPTR GET (ADDRESS + 18) OF MATCHED ‘FOR/NEXT’ DATA
0973 dff8 32 85 LEAS B,X MOVE THE STACK POINTER TO THE BEGINNING OF THE
0974 * MATCHED ‘FOR/NEXT’ DATA SO THE NEW DATA WILL
0975 * OVERLAY THE OLD DATA. THIS WILL ALSO DESTROY
0976 * ALL OF THE ‘RETURN’ AND ‘FOR/NEXT’ DATA BELOW
0977 * THIS POINT ON THE STACK
0978 dffa c6 09 LAD59 LDB #$09 * CHECK FOR ROOM FOR 18 BYTES
0979 dffc bd de f0 JSR LAC33 * IN FREE RAM
0980 dfff bd e1 95 JSR LAEE8 GET ADDR OF END OF SUBLINE IN X
0981 e002 dc 68 LDD CURLIN GET CURRENT LINE NUMBER
0982 e004 34 16 PSHS X,B,A SAVE LINE ADDR AND LINE NUMBER ON STACK
0983 e006 c6 a0 LDB #TOK_TO TOKEN FOR ‘TO’
0984 e008 bd e4 f8 JSR LB26F SYNTAX CHECK FOR ‘TO’
0985 e00b bd e3 cc JSR LB143 ‘TM’ ERROR IF INDEX VARIABLE SET TO STRING
0986 e00e bd e3 ca JSR LB141 EVALUATE EXPRESSION
0987 *
0988 e011 d6 54 LDB FP0SGN GET FPA0 MANTISSA SIGN
0989 e013 ca 7f ORB #$7F FORM A MASK TO SAVE DATA BITS OF HIGH ORDER MANTISSA
0990 e015 d4 50 ANDB FPA0 PUT THE MANTISSA SIGN IN BIT 7 OF HIGH ORDER MANTISSA
0991 e017 d7 50 STB FPA0 SAVE THE PACKED HIGH ORDER MANTISSA
0992 e019 10 8e e0 20 LDY #LAD7F LOAD FOLLOWING ADDRESS INTO Y AS A RETURN
0993 e01d 7e e4 73 JMP LB1EA ADDRESS - PUSH FPA0 ONTO THE STACK
0994 e020 8e ed 0e LAD7F LDX #LBAC5 POINT X TO FLOATING POINT NUMBER 1.0 (DEFAULT STEP VALUE)