-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathbasic.asm
240 lines (236 loc) · 5.95 KB
/
basic.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
.namespace basic {
// BASIC keyword tokens
.label TOK_END = $80
.label TOK_FOR = $81
.label TOK_NEXT = $82
.label TOK_DATA = $83
.label TOK_INPUTN = $84
.label TOK_INPUT = $85
.label TOK_DIM = $86
.label TOK_READ = $87
.label TOK_LET = $88
.label TOK_GOTO = $89
.label TOK_RUN = $8a
.label TOK_IF = $8b
.label TOK_RESTORE = $8c
.label TOK_GOSUB = $8d
.label TOK_RETURN = $8e
.label TOK_REM = $8f
.label TOK_STOP = $90
.label TOK_ON = $91
.label TOK_WAIT = $92
.label TOK_LOAD = $93
.label TOK_SAVE = $94
.label TOK_VERIFY = $95
.label TOK_DEF = $96
.label TOK_POKE = $97
.label TOK_PRINTN = $98
.label TOK_PRINT = $99
.label TOK_CONT = $9a
.label TOK_LIST = $9b
.label TOK_CLR = $9c
.label TOK_CMD = $9d
.label TOK_SYS = $9e
.label TOK_OPEN = $9f
.label TOK_CLOSE = $a0
.label TOK_GET = $a1
.label TOK_NEW = $a2
// BASIC function tokens
.label TOK_SGN = $b4
.label TOK_INT = $b5
.label TOK_ABS = $b6
.label TOK_USR = $b7
.label TOK_FRE = $b8
.label TOK_POS = $b9
.label TOK_SQR = $ba
.label TOK_RND = $bb
.label TOK_LOG = $bc
.label TOK_EXP = $bd
.label TOK_COS = $be
.label TOK_SIN = $bf
.label TOK_TAN = $c0
.label TOK_ATN = $c1
.label TOK_PEEK = $c2
.label TOK_LEN = $c3
.label TOK_STR = $c4
.label TOK_VAL = $c5
.label TOK_ASC = $c6
.label TOK_CHR = $c7
.label TOK_LEFT = $c8
.label TOK_RIGHT = $c9
.label TOK_MID = $ca
// BASIC math operator tokens
.label TOK_ADD = $aa
.label TOK_SUB = $ab
.label TOK_MULT = $ac
.label TOK_DIV = $ad
.label TOK_EXPN = $ae
.label TOK_AND = $af
.label TOK_OR = $b0
.label TOK_GT = $b1
.label TOK_EQ = $b2
.label TOK_LT = $b3
// BASIC misc tokens
.label TOK_TAB = $a3
.label TOK_TO = $a4
.label TOK_FN = $a5
.label TOK_SPC = $a6
.label TOK_THEN = $a7
.label TOK_NOT = $a8
.label TOK_STEP = $a9
.label CBMBASIC = $a004
.label STMDSP = $a00c
.label OPTAB = $a080
.label RESLST = $a09e
.label ERRTAB = $a19e
.label FNDFOR = $a38a
.label BLTU = $a3b8
.label GETSTK = $a3fb
.label REASON = $a408
.label OMERR = $a435
.label ERROR = $a437
.label READY = $a474
.label MAIN = $a480
.label MAIN1 = $a49c
.label LINKPRG = $a533
.label INLIN = $a560
.label CRUNCH = $a579
.label FINDLN = $a613
.label SCRTCH = $a642
.label CLEAR = $a65e
.label RUNC = $a68e
.label LIST = $a69c
.label QPLOP = $a717
.label FOR = $a742
.label NEWSTT = $a7ae
.label GONE = $a7e4
.label RESTOR = $a81d
.label END = $a831
.label CONT = $a857
.label RUN = $a871
.label GOSUB = $a883
.label GOTO = $a8a0
.label RETURN = $a8d2
.label DATA = $a8f8
.label DATAN = $a906
.label IF = $a928
.label REM = $a93b
.label ONGOTO = $a94b
.label LINGET = $a96b
.label LET = $a9a5
.label PRINTN = $aa80
.label CMD = $aa86
.label PRINT = $aaa0
.label STROUT = $ab1e
.label DOAGIN = $ab4d
.label GET = $ab7b
.label INPUTN = $aba5
.label INPUT = $abbf
.label READ = $ac06
.label EXIGNT = $acfc
.label NEXT = $ad1e
.label FRMNUM = $ad8a
.label FRMEVAL = $ad9e
.label EVAL = $ae83
.label PIVAL = $aea8
.label PARCHK = $aef1
.label CHKCLS = $aef7
.label CHKOPN = $aefa
.label CHKCOM = $aeff
.label SNERR = $af08
.label ISVAR = $af2b
.label ISFUN = $afa7
.label OROP = $afe6
.label ANDOP = $afe9
.label DORE1 = $b016
.label DIM = $b018
.label PTRGET = $b08b
.label NOTFNS = $b11d
.label FINPTR = $b185
.label ARYGET = $b194
.label N32768 = $b1a5
.label INTIDX = $b1b2
.label AYINT = $b1bf
.label ISARY = $b1d1
.label BSERR = $b245
.label FCERR = $b248
.label UMULT = $b34c
.label FRE = $b37d
.label GIVAYF = $b391
.label POS = $b39e
.label ERRDIR = $b3a6
.label DEF = $b3b3
.label GETFNM = $b3e1
.label FNDOER = $b3f4
.label STRD = $b465
.label STRLIT = $b487
.label GETSPA = $b4f4
.label GARBAG = $b526
.label CAT = $b63d
.label MOVINS = $b67a
.label FRESTR = $b6a3
.label FRETMS = $b6db
.label CHRD = $b6ec
.label LEFTD = $b700
.label RIGHTD = $b72c
.label MIDD = $b737
.label PREAM = $b761
.label LEN = $b77c
.label ASC = $b78b
.label GETBYTC = $b79b
.label VAL = $b7ad
.label GETNUM = $b7eb
.label GETADR = $b7f7
.label PEEK = $b80d
.label POKE = $b824
.label FUWAIT = $b82d
.label FADDH = $b849
.label FSUB = $b850
.label FSUBT = $b853
.label FADD = $b867
.label FADDT = $b86a
.label FADD4 = $b8a7
.label NORMAL = $b8fe
.label NEGFAC = $b947
.label OVERR = $b97e
.label MULSHF = $b983
.label FONE = $b9bc
.label LOGCN2 = $b9c1
.label LOG = $b9ea
.label FMULT = $ba28
.label MLTPLY = $ba59
.label CONUPK = $ba8c
.label MULDIV = $bab7
.label MLDVEX = $bad4
.label MUL10 = $bae2
.label TENC = $baf9
.label DIV10 = $bafe
.label FDIV = $bb0f
.label FDIVT = $bb12
.label MOVFM = $bba2
.label MOV2F = $bbc7
.label MOVFA = $bbfc
.label MOVAF = $bc0c
.label MOVEF = $bc0f
.label ROUND = $bc1b
.label SIGN = $bc2b
.label SGN = $bc39
.label ABS = $bc58
.label FCOMP = $bc5b
.label QINT = $bc9b
.label INT = $bccc
.label FIN = $bcf3
.label FINLOG = $bd7e
.label NO999 = $bdb3
.label INPRT = $bdc0
.label LINPRT = $bdcd
.label FOUT = $bddd
.label FHALF = $bf11
.label FOUTBL = $bf1c
.label FDCEND = $bf3a
.label SQR = $bf71
.label FPWRT = $bf7b
.label NEGOP = $bfb4
.label EXPCON = $bfbf
.label EXP = $bfed
}