include "hdr1.html"; ?>
Line | Address | Object Code | Label | F1 | N1 | B | F2 | N2 | Comments | Check |
---|---|---|---|---|---|---|---|---|---|---|
1 | 0 | ; tape1.d/declare.t2 | ||||||||
2 | 0 | ;------------------- | ||||||||
3 | 0 | ; | ||||||||
4 | 0 | =1196 | ||||||||
5 | 1196 | declaration:: | ; | |||||||
6 | 1196 | .loop: | ; | |||||||
7 | 1196 | ;.1196: | ||||||||
8 | 1196 | call | ; | @1196 | ||||||
8+1 | 1196 | 7322411004503 | lnk | advance.lnk | : | jmp | advance.ent | |||
9 | 1197 | declns.ent: | ; | |||||||
10 | 1197 | 0602175 | lod | bit39 | ;mark as local to current block | |||||
11 | 1197+ | 0402162 | sto | typeinfo | ;declaration type | |||||
12 | 1198 | 0600600 | lod | token | ;token | @1198 | ||||
13 | 1198+ | 1022261 | jn | .err2 | ;constant | |||||
14 | 1199 | 0122176 | sub | K9a | ;=9 | |||||
15 | 1199+ | 1022334 | jn | .stat | ;statement starter | |||||
16 | 1200 | 0122200 | sub | K8a | ;=8 | @1200 | ||||
17 | 1200+ | 1022263 | jn | .decl | ;declarer | |||||
18 | 1201 | 0000000 | .err2: | o00 | 0 | ; | @1201 | |||
19 | 1201+ | 1661044 | _err02: | lnk | errlnk | ;error 2: bad start or end to statement, or | ||||
20 | 1202 | ;symbol following own not real,int,bool,array, | ||||||||
21 | 1202 | ;or proc decl not followed by ;, or | ||||||||
22 | 1202 | ;name in decl not folowed by , or ;, or | ||||||||
23 | 1202 | ;decl following proc decl not proc decl. | ||||||||
24 | 1202 | Error2: | ; | |||||||
25 | 1202 | 0602205 | lod | K2a | ;=2 | |||||
26 | 1202+ | 1001070 | jmp | Error | ; | |||||
27 | 1203 | ; | ||||||||
28 | 1203 | ;token is valid start for declaration | ||||||||
29 | 1203 | ; | ||||||||
30 | 1203 | .decl: | ; | |||||||
31 | 1203 | 0003003002330 | o00 | token | / | jmp | declsw-10 | ;switch on declarer | ||
32 | 1204 | ; | ||||||||
33 | 1204 | ; own declaration | ||||||||
34 | 1204 | ; | ||||||||
35 | 1204 | .own: | ; | |||||||
36 | 1204 | call | ;get next token | @1204 | ||||||
36+1 | 1204 | 7305105001222 | lnk | gettoken.lnk | : | jmp | gettoken.ent | |||
37 | 1205 | 0600600 | lod | token | ;token | |||||
38 | 1205+ | 0122231 | sub | K11 | ;should be int,real,boolean,array | |||||
39 | 1206 | 1022261 | jn | .err2 | ;error if less | |||||
40 | 1206+ | 0122211 | sub | K4 | ; | |||||
41 | 1207 | 0003003022330 | o00 | token | / | jn | declsw-10 | ; | ||
42 | 1208 | 1002261 | jmp | .err2 | ;not valid with own | @1208 | ||||
43 | 1208+ | ; | ||||||||
44 | 1208+ | ; boolean, integer or real keyword | ||||||||
45 | 1208+ | ; ACC contains mode bits | ||||||||
46 | 1208+ | ; | ||||||||
47 | 1208+ | 0402163 | .svar: | sto | W1139 | ;save type | @1208+ | |||
48 | 1209 | call | ;get next token | |||||||
48+1 | 1209 | 7305105001222 | lnk | gettoken.lnk | : | jmp | gettoken.ent | |||
49 | 1210 | 0600600 | lod | token | ;load token | @1210 | ||||
50 | 1210+ | 1042321 | jz | .ident | ;zero->identifier list | |||||
51 | 1211 | 0122230 | sub | K14 | ;=14, [ARRAY] | |||||
52 | 1211+ | 1043062 | jz | L1586 | ;yes, do array declaration | |||||
53 | 1212 | 0122205 | sub | K2a | ;=2, [PROCEDURE] | @1212 | ||||
54 | 1212+ | 1142275 | jz | .tproc | ;yes, do procedure declaration | |||||
55 | 1213 | 1002261 | jmp | .err2 | ;otherwise error | |||||
56 | 1213+ | ; | ||||||||
57 | 1213+ | ; type procedure declaration | ||||||||
58 | 1213+ | ; | ||||||||
59 | 1213+ | .tproc: | ; | |||||||
60 | 1213+ | 0602162 | lod | typeinfo | ; | |||||
61 | 1214 | 1042261 | jz | .err2 | ;zero, error (own int proc) | @1214 | ||||
62 | 1214+ | 0602163 | lod | W1139 | ;get type | |||||
63 | 1215 | 0102232 | .proc: | add | procbit | ;=02000000000000 add proc bit | @1215 | |||
64 | 1215+ | 0402163 | sto | W1139 | ;store updated type | |||||
65 | 1216 | 1110637 | jmp | .skip1 | ;-->> | @1216 | ||||
66 | 1216+ | =4511+ | ||||||||
67 | 4511+ | .skip1: | ; | |||||||
68 | 4511+ | 0040000 | o02 | 0 | ;=1 | |||||
69 | 4512 | 0410621 | sto | W4497 | ;set recovery flag=+1 | @4512 | ||||
70 | 4512+ | 0602160 | lod | dicpt | ; | |||||
71 | 4513 | 0410625 | sto | W4501 | ; | |||||
72 | 4513+ | 1010626 | jmp | statement.4502 | ; | |||||
73 | 4514 | ; | ||||||||
74 | 4514 | =1216+ | ||||||||
75 | 1216+ | .resumeproc: | ; | |||||||
76 | 1216+ | 0040000 | o02 | 0 | ;=1 | @1216+ | ||||
77 | 1217 | call | ;generate code? | |||||||
77+1 | 1217 | 7307175001640 | lnk | GenInst.lnk | : | jmp | GenInst.ent | |||
78 | 1218 | 1002470 | jmp | .procparam | ; | @1218 | ||||
79 | 1218+ | ; | ||||||||
80 | 1218+ | pad | ; | |||||||
80+1 | 1218+ | 0000000 | 00 | 0 | ||||||
81 | 1219 | ;-------------------------------------------------------------------- | ||||||||
82 | 1219 | ; | ||||||||
83 | 1219 | .recover: | ; | |||||||
84 | 1219 | 0600600 | lod | token | ; | @1219 | ||||
85 | 1219+ | 0122200 | sub | K8a | ;=8 ['] | |||||
86 | 1220 | 1042306 | jz | .semicolon | ; | |||||
87 | 1220+ | 1002261 | jmp | .err2 | ; | |||||
88 | 1221 | ; | ||||||||
89 | 1221 | .comment: | ; | |||||||
90 | 1221 | call | ;skip over comment | |||||||
90+1 | 1221 | 7312031002420 | lnk | skipcomment.lnk | : | jmp | skipcomment.ent | |||
91 | 1222 | .semicolon: | ; | |||||||
92 | 1222 | call | ;discard semicolon, get next | |||||||
92+1 | 1222 | 7322411004503 | lnk | advance.lnk | : | jmp | advance.ent | |||
93 | 1223 | 0600600 | lod | token | ; | |||||
94 | 1223+ | 1022261 | jn | .err2 | ;constant not a good starter | |||||
95 | 1224 | 0122176 | sub | K9a | ;=9 | @1224 | ||||
96 | 1224+ | 1022333 | jn | .stat2 | ;statement starter | |||||
97 | 1225 | 0122200 | sub | K8a | ;=8 | |||||
98 | 1225+ | 1022313 | jn | .decl2 | ;declaration starter | |||||
99 | 1226 | 1002261 | jmp | .err2 | ;others | |||||
100 | 1226+ | ; | ||||||||
101 | 1226+ | 0000000 | o00 | 0 | ; | |||||
102 | 1227 | ; | ||||||||
103 | 1227 | ; keyword for declaration, switch to appropriate point | ||||||||
104 | 1227 | .decl2: | ; | |||||||
105 | 1227 | 0003003002340 | o00 | token | / | jmp | decl2sw-9 | ;switch on token | @1227 | |
106 | 1228 | ;-------------------------------------------------------------------- | ||||||||
107 | 1228 | ; param type: int, bool, real | ||||||||
108 | 1228 | ; | ||||||||
109 | 1228 | .pvar: | ; | |||||||
110 | 1228 | 0102232 | add | procbit | ; | @1228 | ||||
111 | 1228+ | 0402163 | sto | W1139 | ; | |||||
112 | 1229 | call | ; | |||||||
112+1 | 1229 | 7305105001222 | lnk | gettoken.lnk | : | jmp | gettoken.ent | |||
113 | 1230 | 0600600 | lod | token | ; | @1230 | ||||
114 | 1230+ | 0122245 | sub | K16 | ;=16 [PROCEDURE] | |||||
115 | 1231 | 1042470 | jz | .procparam | ; | |||||
116 | 1231+ | 1002261 | jmp | .err2 | ; | |||||
117 | 1232 | ; | ||||||||
118 | 1232 | ; param type: procedure | ||||||||
119 | 1232 | ; | ||||||||
120 | 1232 | 0402163 | .prp: | sto | W1139 | ; | @1232 | |||
121 | 1232+ | 1002470 | jmp | .procparam | ; | |||||
122 | 1233 | ; | ||||||||
123 | 1233 | .ident: | ; | |||||||
124 | 1233 | call | ;compile id list? | @1233 | ||||||
124+1 | 1233 | 7310725110636 | lnk | L4510.lnk | : | jmp | L4510.ent | |||
125 | 1234 | .idlst: | ; recovery point from errors | |||||||
126 | 1234 | 0602162 | lod | typeinfo | ; | |||||
127 | 1234+ | 1142325 | jz | .own2 | ;own variables? -> | |||||
128 | 1235 | 0602164 | lod | idcount | ;number of ids | |||||
129 | 1235+ | 0502161 | ads | wsptr | ;add to workspace pointer | |||||
130 | 1236 | 0602161 | lod | wsptr | ;pass current workspace pointer | |||||
131 | 1236+ | 1002327 | jmp | .define | ;->to add it to dic info | |||||
132 | 1237 | ; | ||||||||
133 | 1237 | 0000000 | o00 | 0 | ||||||
134 | 1237+ | ; | ||||||||
135 | 1237+ | 0602164 | .own2: | lod | idcount | ;number of ids in list | @1237+ | |||
136 | 1238 | 0502143 | ads | W1123 | ;add to global wksp size | |||||
137 | 1238+ | 0602143 | lod | W1123 | ;pass current global pointer | |||||
138 | 1239 | ; | ||||||||
139 | 1239 | .define: | ; | |||||||
140 | 1239 | 0102177 | add | MaxInt | ;=03777777777777 | @1239 | ||||
141 | 1239+ | 0102163 | add | W1139 | ;idtype | |||||
142 | 1240 | call | ;add to dictionary | @1240 | ||||||
142+1 | 1240 | 7312031002407 | lnk | addtodic.lnk | : | jmp | addtodic.ent | |||
143 | 1241 | 0600600 | .done: | lod | token | ;token | ||||
144 | 1241+ | 0122200 | sub | K8a | ;=8 ['] | |||||
145 | 1242 | 1042254 | jz | .loop | ; apostrophe (semicolon) -> | @1242 | ||||
146 | 1242+ | 1002261 | jmp | .err2 | ;error? | |||||
147 | 1243 | ;-------------------------------------------------------------------- | ||||||||
148 | 1243 | ; next token is statement - end of declarations | ||||||||
149 | 1243 | ; | ||||||||
150 | 1243 | .stat2: | ; | |||||||
151 | 1243 | call | ; | |||||||
151+1 | 1243 | 7306371101531 | lnk | putcode6.lnk | : | jmp | putcode6.ent | |||
152 | 1244 | .stat: | ; | |||||||
153 | 1244 | 0602161 | lod | wsptr | ; | @1244 | ||||
154 | 1244+ | 0122147 | sub | W1127 | ;wsplim | |||||
155 | 1245 | 1022336 | jn | .under | ; | |||||
156 | 1245+ | 0502147 | ads | W1127 | ; | |||||
157 | 1246 | .under: | ; | |||||||
158 | 1246 | ret | ; | @1246 | ||||||
158+1 | 1246 | 0010643000001 | o00 | declaration.lnk | / | jmp | 1 | |||
159 | 1247 | ; o00 Link15a /jmp 1 ;return | ||||||||
160 | 1247 | ;-------------------------------------------------------------------- | ||||||||
161 | 1247 | .comm2: | call | ;no longer referenced | ||||||
161+1 | 1247 | 7312031002420 | lnk | skipcomment.lnk | : | jmp | skipcomment.ent | |||
162 | 1248 | 1002254 | jmp | .loop | ; | @1248 | ||||
163 | 1248+ | ; | ||||||||
164 | 1248+ | 0000000 | o00 | 0 | ; | |||||
165 | 1249 | ; | ||||||||
166 | 1249 | ;.1249: ;no longer referenced | ||||||||
167 | 1249 | 1002337 | jmp | .comm2 | ; | @1249 | ||||
168 | 1249+ | ; | ||||||||
169 | 1249+ | 0000000 | o00 | 0 | ; | |||||
170 | 1250 | ;-------------------------------------------------------------------- | ||||||||
171 | 1250 | ; switch list referenced at 1203 above, based on declarer | ||||||||
172 | 1250 | ; | ||||||||
173 | 1250 | declsw: | ; | |||||||
174 | 1250 | 2610711002264 | cls | typeinfo | : | jmp | .own | ; +10 own | @1250 | |
175 | 1251 | 3011055102270 | lod | boolbit | : | jmp | .svar | ; +11 boolean 0100000000000 | ||
176 | 1252 | 3011061102270 | lod | intbit | : | jmp | .svar | ; +12 integer 0200000000000 | @1252 | |
177 | 1253 | 3011065102270 | lod | realbit | : | jmp | .svar | ; +13 real 0300000000000 | ||
178 | 1254 | 3011015003061 | lod | rarrbit | : | jmp | L1585 | ; +14 array | @1254 | |
179 | 1255 | 4012200000000 | jmp | .switch | : | o00 | 0 | ; +15 switch | ||
180 | 1256 | 0600001002277 | cla | 0 | : | jmp | .proc | ; +16 procedure | @1256 | |
181 | 1257 | ; | ||||||||
182 | 1257 | decl2sw: | ; | |||||||
183 | 1257 | 4011424000000 | jmp | .comment | : | o00 | 0 | ; +09 comment | ||
184 | 1258 | 4011304000000 | jmp | .err2 | : | o00 | 0 | ; +10 own | @1258 | |
185 | 1259 | 3011055002314 | lod | boolbit | : | jmp | .pvar | ; +11 boolean | ||
186 | 1260 | 3011061002314 | lod | intbit | : | jmp | .pvar | ; +12 integer | @1260 | |
187 | 1261 | 3011065002314 | lod | realbit | : | jmp | .pvar | ; +13 real | ||
188 | 1262 | 4011304000000 | jmp | .err2 | : | o00 | 0 | ; +14 array | @1262 | |
189 | 1263 | 4011304000000 | jmp | .err2 | : | o00 | 0 | ; +15 switch | ||
190 | 1264 | 3011151002320 | lod | procbit | : | jmp | .prp | ; +16 procedure | @1264 | |
191 | 1265 | ;-------------------------------------------------------------------- | ||||||||
192 | 1265 | ; switch declaration | ||||||||
193 | 1265 | ; | ||||||||
194 | 1265 | =1312 | ||||||||
195 | 1312 | .switch: | ; | |||||||
196 | 1312 | call | ;save stkp, then call gettoken | @1312 | ||||||
196+1 | 1312 | 7305105010635 | lnk | L4509.lnk | : | jmp | L4509.ent | |||
197 | 1313 | call | ;read ids | |||||||
197+1 | 1313 | 7310725002361 | lnk | declid.lnk | : | jmp | declid.ent | |||
198 | 1314 | 0602164 | lod | idcount | ;number of ids in list | @1314 | ||||
199 | 1314+ | 0122207 | sub | K1c | ;=1 | |||||
200 | 1315 | 1142444 | jz | .idok | ; | |||||
201 | 1315+ | 1661044 | _err05: | lnk | errlnk | ;error 5: missing := in switch | ||||
202 | 1316 | 1002262 | jmp | Error2 | ; | @1316 | ||||
203 | 1316+ | ; | ||||||||
204 | 1316+ | 0042201 | .idok: | o02 | K42 | ;=42+1=>43 [:=] | ||||
205 | 1317 | 0120600 | sub | token | ; | |||||
206 | 1317+ | 1042447 | jz | .swok | ;OK, skip | |||||
207 | 1318 | 1661044 | _err06: | lnk | errlnk | ;error 6: missing := in switch | @1318 | |||
208 | 1318+ | 1002262 | jmp | Error2 | ;call error rtne | |||||
209 | 1319 | ; | ||||||||
210 | 1319 | 0602144 | .swok: | lod | W1124 | ; | ||||
211 | 1319+ | 1320027 | sll | 23 | ; | |||||
212 | 1320 | 0102216 | add | swchbit | ;=04400000000000 | @1320 | ||||
213 | 1320+ | 0102143 | add | W1123 | ; | |||||
214 | 1321 | call | ;add type info to dic | |||||||
214+1 | 1321 | 7312031002407 | lnk | addtodic.lnk | : | jmp | addtodic.ent | |||
215 | 1322 | 0602160 | lod | dicpt | ; | @1322 | ||||
216 | 1322+ | 0342171 | stc | W1145 | ; | |||||
217 | 1323 | call | ;add to dic | |||||||
217+1 | 1323 | 7312031002407 | lnk | addtodic.lnk | : | jmp | addtodic.ent | |||
218 | 1324 | call | ;discard :=, get 1st id | @1324 | ||||||
218+1 | 1324 | 7305105001222 | lnk | gettoken.lnk | : | jmp | gettoken.ent | |||
219 | 1325 | call | ;read list of ids | |||||||
219+1 | 1325 | 7310725002361 | lnk | declid.lnk | : | jmp | declid.ent | |||
220 | 1326 | 0602164 | lod | idcount | ;number of ids in list | @1326 | ||||
221 | 1326+ | 0502143 | ads | W1123 | ; | |||||
222 | 1327 | 0602144 | lod | W1124 | ; | |||||
223 | 1327+ | 1320027 | sll | 23 | ; | |||||
224 | 1328 | 0102217 | add | swlabit | ;=04477777777777 | @1328 | ||||
225 | 1328+ | 0102143 | add | W1123 | ; | |||||
226 | 1329 | call | ; | |||||||
226+1 | 1329 | 7312031002407 | lnk | addtodic.lnk | : | jmp | addtodic.ent | |||
227 | 1330 | 0602164 | lod | idcount | ;number of ids in list | @1330 | ||||
228 | 1330+ | 0102177 | add | MaxInt | ; | |||||
229 | 1331 | 0010746400000 | o00 | W1145 | / | sto | 0 | ; | ||
230 | 1332 | 1002331 | jmp | declaration.done | ;finished, check for semicolon | @1332 | ||||
231 | 1332+ | ; | ||||||||
232 | 1332+ | 0000000 | o00 | 0 | ; | |||||
233 | 1333 | ;-------------------------------------------------------------------- | ||||||||
234 | 1333 | =1336 | ||||||||
235 | 1336 | ; | ||||||||
236 | 1336 | .procparam: | ; | |||||||
237 | 1336 | call | ;stack something, then gettoken | @1336 | ||||||
237+1 | 1336 | 7305105003014 | lnk | L1548.lnk | : | jmp | L1548.ent | |||
238 | 1337 | call | ; | |||||||
238+1 | 1337 | 7310725002361 | lnk | declid.lnk | : | jmp | declid.ent | |||
239 | 1338 | 0602160 | lod | dicpt | ; | @1338 | ||||
240 | 1338+ | 0402171 | sto | W1145 | ; | |||||
241 | 1339 | 0602163 | lod | W1139 | ; | |||||
242 | 1339+ | 0102161 | add | wsptr | ; | |||||
243 | 1340 | 0102175 | add | bit39 | ; | @1340 | ||||
244 | 1340+ | 0102234 | add | Bit32 | ;=00020000000000 | |||||
245 | 1341 | call | ; | |||||||
245+1 | 1341 | 7312031002407 | lnk | addtodic.lnk | : | jmp | addtodic.ent | |||
246 | 1342 | call | ;call 940 | @1342 | ||||||
246+1 | 1342 | 7307255001654 | lnk | putNop.lnk | : | jmp | putNop.ent | |||
247 | 1343 | 0602175 | lod | bit39 | ; | |||||
248 | 1343+ | 0102145 | add | ObjPC | ; | |||||
249 | 1344 | call | ; | @1344 | ||||||
249+1 | 1344 | 7312031002407 | lnk | addtodic.lnk | : | jmp | addtodic.ent | |||
250 | 1345 | 0602175 | lod | bit39 | ; | |||||
251 | 1345+ | 0402172 | sto | Link15c | ; | |||||
252 | 1346 | 0402173 | sto | W1147 | ; | @1346 | ||||
253 | 1346+ | 0442161 | inc | wsptr | ; | |||||
254 | 1347 | 0602160 | lod | dicpt | ; | |||||
255 | 1347+ | 0402174 | sto | W1148 | ; | |||||
256 | 1348 | 0600600 | lod | token | ; | @1348 | ||||
257 | 1348+ | 0122200 | sub | K8a | ;=8, ['] | |||||
258 | 1349 | 1042655 | jz | .lp3k | ;yes, no formal parameters | |||||
259 | 1349+ | 0122235 | sub | K39b | ;=39, =>[(] | |||||
260 | 1350 | 1042507 | jz | .params | ;yes, get parameter list | @1350 | ||||
261 | 1350+ | 1002541 | jmp | _err07 | ; | |||||
262 | 1351 | ; | ||||||||
263 | 1351 | ; process parameter list | ||||||||
264 | 1351 | ; | ||||||||
265 | 1351 | .params: | ; | |||||||
266 | 1351 | call | ;discard [(] | @1351 | ||||||
266+1 | 1351 | 7305105001222 | lnk | gettoken.lnk | : | jmp | gettoken.ent | |||
267 | 1352 | call | ;get id list (formal params) | |||||||
267+1 | 1352 | 7310725003000 | lnk | declid1.lnk | : | jmp | declid1.ent | |||
268 | 1353 | .1353: | ; | |||||||
269 | 1353 | 0042204 | o02 | K47a | ;=47+1=>48, [)] | |||||
270 | 1353+ | 0120600 | sub | token | ;check closing delimiter | |||||
271 | 1354 | 1042513 | jz | .closeOK | ;OK, skip | @1354 | ||||
272 | 1354+ | 1002541 | jmp | _err07 | ;missing ) in param list | |||||
273 | 1355 | ; | ||||||||
274 | 1355 | .closeOK: | ; | |||||||
275 | 1355 | call | ;discard ), get next token | @1355 | ||||||
275+1 | 1355 | 7305105001222 | lnk | gettoken.lnk | : | jmp | gettoken.ent | |||
276 | 1356 | 0600600 | lod | token | ;check for semicolon | |||||
277 | 1356+ | 0122200 | sub | K8a | ;=8, ['] | |||||
278 | 1357 | 1042516 | jz | .semiOK | ;OK, skip | @1357 | ||||
279 | 1357+ | 1003010 | jmp | .1544 | ;missing semicolon? | |||||
280 | 1358 | ; | ||||||||
281 | 1358 | .semiOK: | ; | |||||||
282 | 1358 | 0602164 | lod | idcount | ;number of params in list | @1358 | ||||
283 | 1358+ | 0125036 | sub | W2590 | ; | |||||
284 | 1359 | 1022520 | jn | .idsOK | ; | |||||
285 | 1359+ | 1102751 | jmp | _err08a | ; | |||||
286 | 1360 | ; | ||||||||
287 | 1360 | .idsOK: | ; | |||||||
288 | 1360 | 0602164 | lod | idcount | ;number of params | @1360 | ||||
289 | 1360+ | 1320034 | sll | 28 | ; | |||||
290 | 1361 | 0010762500001 | o00 | W1148 | / | ads | 1 | ; | ||
291 | 1362 | 0602174 | lod | W1148 | ; | @1362 | ||||
292 | 1362+ | 0402166 | sto | W1142 | ; | |||||
293 | 1363 | 0042160 | o02 | dicpt | ; | |||||
294 | 1363+ | 0402167 | sto | W1143 | ; | |||||
295 | 1364 | .ploop: | ; | |||||||
296 | 1364 | 0010732600000 | o00 | W1142 | / | lod | 0 | ; | @1364 | |
297 | 1365 | call | ; | |||||||
297+1 | 1365 | 7312031002407 | lnk | addtodic.lnk | : | jmp | addtodic.ent | |||
298 | 1366 | 0642161 | lis | wsptr | ; | @1366 | ||||
299 | 1366+ | 0102236 | add | Bit33 | ; | |||||
300 | 1367 | call | ; | |||||||
300+1 | 1367 | 7312031102613 | lnk | L1419P.lnk | : | jmp | L1419P.ent | |||
301 | 1368 | 0040000 | o02 | 0 | ; | @1368 | ||||
302 | 1368+ | 0762166 | o37 | W1142 | ; | |||||
303 | 1369 | 0162167 | bus | W1143 | ; | |||||
304 | 1369+ | 1022524 | jn | .ploop | ; | |||||
305 | 1370 | 0040000 | o02 | 0 | ;=1 | @1370 | ||||
306 | 1370+ | 0000000 | o00 | 0 | ; | |||||
307 | 1371 | 0010736420000 | o00 | W1143 | / | stn | 0 | ; | ||
308 | 1372 | .specs: | ; | |||||||
309 | 1372 | call | ;get token following ' | @1372 | ||||||
309+1 | 1372 | 7305105001222 | lnk | gettoken.lnk | : | jmp | gettoken.ent | |||
310 | 1373 | 0600600 | lod | token | ; | |||||
311 | 1373+ | 0122237 | sub | K19b | ;=19 [VALUE] | |||||
312 | 1374 | 1042537 | jz | .value | ;yes, process value list | @1374 | ||||
313 | 1374+ | 1102760 | jmp | .1520P | ;check for type specs | |||||
314 | 1375 | ; | ||||||||
315 | 1375 | .value: | ; | |||||||
316 | 1375 | call | ;discard VALUE/comma, get next token | @1375 | ||||||
316+1 | 1375 | 7305105001222 | lnk | gettoken.lnk | : | jmp | gettoken.ent | |||
317 | 1376 | 0600600 | lod | token | ; | @1376 | ||||
318 | 1376+ | 1042543 | jz | .valid | ;identifier, ->OK | |||||
319 | 1377 | 1661044 | _err07: | lnk | errlnk | ;error 7: in a procedure declaration: | ||||
320 | 1377+ | ;a) item after proc name not ( or ; | ||||||||
321 | 1377+ | ;b) not ; or ) after formal params | ||||||||
322 | 1377+ | ;c) list in value of spec has bad form | ||||||||
323 | 1377+ | ;d) spec before value part | ||||||||
324 | 1377+ | 1002262 | jmp | Error2 | ;call error rtne | |||||
325 | 1378 | 1002542 | .halt: | jmp | .halt | ;dynamic halt | @1378 | |||
326 | 1378+ | ; | ||||||||
327 | 1378+ | pad | ; | |||||||
327+1 | 1378+ | 0000000 | 00 | 0 | ||||||
328 | 1379 | ; | ||||||||
329 | 1379 | ; identifier in VALUE list | ||||||||
330 | 1379 | ; | ||||||||
331 | 1379 | .valid: | ; | |||||||
332 | 1379 | call | ; lookup identifier | @1379 | ||||||
332+1 | 1379 | 7316111003423 | lnk | lookupid.lnk | : | jmp | lookupid.ent | |||
333 | 1380 | 1142754 | jz | _err10a | ;identifier not found | |||||
334 | 1380+ | 0042236 | o02 | Bit33 | ; | |||||
335 | 1381 | 0116142457777 | neg | W1816 | / | ans | -1 | ; | ||
336 | 1382 | .errrec: | ; | |||||||
337 | 1382 | call | ;get next token | @1382 | ||||||
337+1 | 1382 | 7305105001222 | lnk | gettoken.lnk | : | jmp | gettoken.ent | |||
338 | 1383 | 0040600 | o02 | token | ;token+1 | |||||
339 | 1383+ | 0122201 | sub | K42 | ;=42, [,]+1 | |||||
340 | 1384 | 1042537 | jz | .value | ;comma, back for more | @1384 | ||||
341 | 1384+ | 0102241 | add | K33 | ;=33, [']+1 | |||||
342 | 1385 | 1042552 | jz | .valsemi | ;semicolon, check for other specs | |||||
343 | 1385+ | 1002541 | jmp | _err07 | ;otherwise, error | |||||
344 | 1386 | ; | ||||||||
345 | 1386 | ; end of specification list, see if more specs follow | ||||||||
346 | 1386 | ; | ||||||||
347 | 1386 | .valsemi: | ; | |||||||
348 | 1386 | ;.1386: | ||||||||
349 | 1386 | call | ;discard ', get next token | @1386 | ||||||
349+1 | 1386 | 7305105001222 | lnk | gettoken.lnk | : | jmp | gettoken.ent | |||
350 | 1387 | .1387: | ; | |||||||
351 | 1387 | 0600600 | lod | token | ; | |||||
352 | 1387+ | 1022541 | jn | _err07 | ;constant | |||||
353 | 1388 | 0122237 | sub | K19b | ;=19 | @1388 | ||||
354 | 1388+ | 1122555 | jn | .valok | ;declaration or statement | |||||
355 | 1389 | 1002541 | jmp | _err07 | ;error | |||||
356 | 1389+ | ; | ||||||||
357 | 1389+ | .valok: | ; | |||||||
358 | 1389+ | 0102240 | add | K10b | ;=10 | |||||
359 | 1390 | 1022606 | jn | .stat3 | ;statement | @1390 | ||||
360 | 1390+ | pad | ; | |||||||
360+1 | 1390+ | 0000000 | 00 | 0 | ||||||
361 | 1391 | 0003003002755 | o00 | token | / | jmp | specsw-9 | ;switch on declarer | ||
362 | 1392 | ; | ||||||||
363 | 1392 | pad | ||||||||
363+1 | 1392 | 0000000 | 00 | 0 | ||||||
364 | 1392+ | ; | ||||||||
365 | 1392+ | ; boolean, integer, real (simple) specification | ||||||||
366 | 1392+ | ; | ||||||||
367 | 1392+ | .ssp: | ; | |||||||
368 | 1392+ | 0402162 | sto | typeinfo | ;store type | @1392+ | ||||
369 | 1393 | call | ;get next token | |||||||
369+1 | 1393 | 7305105001222 | lnk | gettoken.lnk | : | jmp | gettoken.ent | |||
370 | 1394 | 0600600 | lod | token | ; | @1394 | ||||
371 | 1394+ | 0122230 | sub | K14 | ;=14, [ARRAY]? | |||||
372 | 1395 | 1042564 | jz | .aspec | ;yes, ->typed array spec. | |||||
373 | 1395+ | 1002567 | jmp | .sspec | ;scalar type spec | |||||
374 | 1396 | ; | ||||||||
375 | 1396 | ; handle array declaration | ||||||||
376 | 1396 | ; | ||||||||
377 | 1396 | 0602202 | .aspec: | lod | arrbit | ;add array bit | @1396 | |||
378 | 1396+ | 0502162 | ads | typeinfo | ;into type | |||||
379 | 1397 | 1002566 | jmp | .cspec | ;join common section | |||||
380 | 1397+ | ; | ||||||||
381 | 1397+ | ; array or string | ||||||||
382 | 1397+ | .asp: | ; | |||||||
383 | 1397+ | 0402162 | sto | typeinfo | ;store type bits | |||||
384 | 1398 | .cspec: | ; | |||||||
385 | 1398 | call | ;discard type keyword | @1398 | ||||||
385+1 | 1398 | 7305105001222 | lnk | gettoken.lnk | : | jmp | gettoken.ent | |||
386 | 1399 | .sspec: | ; | |||||||
387 | 1399 | 0600600 | lod | token | ;get next token | |||||
388 | 1399+ | 1042571 | jz | .idspec | ;identifier | |||||
389 | 1400 | 1002541 | jmp | _err07 | ;error | @1400 | ||||
390 | 1400+ | ; | ||||||||
391 | 1400+ | 0000000 | o00 | 0 | ||||||
392 | 1401 | ; | ||||||||
393 | 1401 | .idspec: | ; | |||||||
394 | 1401 | call | ;lookup identifier | @1401 | ||||||
394+1 | 1401 | 7316111003423 | lnk | lookupid.lnk | : | jmp | lookupid.ent | |||
395 | 1402 | 1142756 | jz | _err11a | ; | |||||
396 | 1402+ | 0602221 | lod | typbits | ;=03700000000000 | |||||
397 | 1403 | 0016142057777 | o00 | W1816 | / | and | -1 | ; | @1403 | |
398 | 1404 | 1142575 | jz | .idspok | ; | |||||
399 | 1404+ | 0040000 | o02 | 0 | ;=1 | |||||
400 | 1405 | 1002757 | jmp | _err11 | ;name not a param | @1405 | ||||
401 | 1405+ | ; | ||||||||
402 | 1405+ | .idspok: | ; | |||||||
403 | 1405+ | 0602162 | lod | typeinfo | ; | |||||
404 | 1406 | 0016142677777 | o00 | W1816 | / | las | -1 | ; | @1406 | |
405 | 1407 | 0102162 | add | typeinfo | ; | |||||
406 | 1407+ | 0403427 | sto | idptr | ; | |||||
407 | 1408 | 0063023 | and | W1555 | ;=03777740000000 | @1408 | ||||
408 | 1408+ | 0122252 | sub | strbit | ;string bits | |||||
409 | 1409 | 1103016 | jmp | .skip2 | ; | |||||
410 | 1409+ | =1550+ | ||||||||
411 | 1550+ | .skip2: | ; | |||||||
412 | 1550+ | 1142751 | jz | _err08a | ;type not allowed as param | |||||
413 | 1551 | 0102236 | add | Bit33 | ;=00040000000000 | @1551 | ||||
414 | 1551+ | 0062243 | and | MskArgTp | ;=03740000000000 | |||||
415 | 1552 | 1142751 | jz | _err08a | ;more than 64 params | |||||
416 | 1552+ | 0603427 | lod | idptr | ; | |||||
417 | 1553 | 0062242 | and | W1186 | ;=03440000000000 | |||||
418 | 1553+ | 0122236 | sub | Bit33 | ;=00040000000000 | |||||
419 | 1554 | 1142601 | jz | .sp1 | ; | @1554 | ||||
420 | 1554+ | 1002602 | jmp | .sp2 | ; | |||||
421 | 1555 | ; | ||||||||
422 | 1555 | =1409+ | ||||||||
423 | 1409+ | ; | ||||||||
424 | 1409+ | .sp1: | ; | |||||||
425 | 1409+ | 0542172 | cls | Link15c | ; | |||||
426 | 1410 | .sp2: | ; | |||||||
427 | 1410 | call | ;get next token | @1410 | ||||||
427+1 | 1410 | 7305105001222 | lnk | gettoken.lnk | : | jmp | gettoken.ent | |||
428 | 1411 | 0040600 | o02 | token | ;token+1 | |||||
429 | 1411+ | 0122201 | sub | K42 | ;=42, [,]+1 | |||||
430 | 1412 | 1042566 | jz | .cspec | ;comma, get another ident | @1412 | ||||
431 | 1412+ | 0102241 | add | K33 | ;=33, =>[']+1 | |||||
432 | 1413 | 1042552 | jz | .valsemi | ;semicolon, end of specification | |||||
433 | 1413+ | 1002541 | jmp | _err07 | ;otherwise error | |||||
434 | 1414 | ;-------------------------------------------------------------------- | ||||||||
435 | 1414 | ; statement starter after specifications | ||||||||
436 | 1414 | ; first check all parameters are specified | ||||||||
437 | 1414 | ; | ||||||||
438 | 1414 | .stat3: | ; | |||||||
439 | 1414 | 0010736540000 | o00 | W1143 | / | cls | 0 | ;add stopper to list | @1414 | |
440 | 1415 | 0602160 | lod | dicpt | ; | |||||
441 | 1415+ | 0402167 | sto | W1143 | ; | |||||
442 | 1416 | .sploop: | ; | |||||||
443 | 1416 | 2210736600000 | inc | W1143 | / | lod | 0 | ;get param info | @1416 | |
444 | 1417 | 1043005 | jz | .spdone | ;end of list, all params OK | |||||
445 | 1417+ | 0062221 | and | typbits | ;=03700000000000 | |||||
446 | 1418 | 1142753 | jz | _err08b | ;no type specified | @1418 | ||||
447 | 1418+ | 0442167 | inc | W1143 | ;skip name entry | |||||
448 | 1419 | 1002610 | jmp | .sploop | ;and try next one | |||||
449 | 1419+ | ;-------------------------------------------------------------------- | ||||||||
450 | 1419+ | L1419P.ent: | ; | |||||||
451 | 1419+ | 0102175 | add | bit39 | ; | |||||
452 | 1420 | 1002407 | jmp | addtodic.ent | ; | @1420 | ||||
453 | 1420+ | ;-------------------------------------------------------------------- | ||||||||
454 | 1420+ | ; | ||||||||
455 | 1420+ | =1541 | ||||||||
456 | 1541 | ; finished procedure heading, looking for statement/block | ||||||||
457 | 1541 | ; | ||||||||
458 | 1541 | .spdone: | ; | |||||||
459 | 1541 | call | ; | |||||||
459+1 | 1541 | 7322411004504 | lnk | advance2.lnk | : | jmp | advance2.ent | |||
460 | 1542 | 1102614 | jmp | .skip3 | ; | @1542 | ||||
461 | 1542+ | =1420+ | ||||||||
462 | 1420+ | .skip3: | ; | |||||||
463 | 1420+ | 0602172 | lod | Link15c | ; | |||||
464 | 1421 | 1022617 | jn | .lp3a | ;skip over next bit | |||||
465 | 1421+ | 1102730 | jmp | .skip4 | ;-->> | |||||
466 | 1422 | =1496+ | ||||||||
467 | 1496+ | .skip4: | ; | |||||||
468 | 1496+ | 0042233 | o02 | Bit21 | ;=00000004000000 | @1496+ | ||||
469 | 1497 | 0702152 | las | W1130 | ; | |||||
470 | 1497+ | 0062212 | and | B19.28 | ;=00001777000000 | |||||
471 | 1498 | 0401422 | sto | GenAdr | ; | @1498 | ||||
472 | 1498+ | 0602226 | lod | K6 | ;=6 | |||||
473 | 1499 | call | ; | |||||||
473+1 | 1499 | 7307175001640 | lnk | GenInst.lnk | : | jmp | GenInst.ent | |||
474 | 1500 | 0010746600000 | o00 | W1145 | / | lod | 0 | ; | @1500 | |
475 | 1501 | 0062244 | and | M1188 | ; | |||||
476 | 1501+ | 0401422 | sto | GenAdr | ; | |||||
477 | 1502 | 0602226 | lod | K6 | ;=6 | @1502 | ||||
478 | 1502+ | 1002711 | jmp | .skip5 | ;-->> | |||||
479 | 1503 | =1481 | ||||||||
480 | 1481 | .skip5: | ; | |||||||
481 | 1481 | call | ; | @1481 | ||||||
481+1 | 1481 | 7307175001640 | lnk | GenInst.lnk | : | jmp | GenInst.ent | |||
482 | 1482 | 0602236 | lod | Bit33 | ; | |||||
483 | 1482+ | 1002616 | jmp | .skip6 | ;-->> | |||||
484 | 1483 | =1422 | ||||||||
485 | 1422 | .skip6: | ; | |||||||
486 | 1422 | 0010762500002 | o00 | W1148 | / | ads | 2 | ; | @1422 | |
487 | 1423 | .lp3a: | ; | |||||||
488 | 1423 | 0602164 | lod | idcount | ;number of ids in list | |||||
489 | 1423+ | 0162174 | bus | W1148 | ; | |||||
490 | 1424 | 0402166 | sto | W1142 | ; | @1424 | ||||
491 | 1424+ | .lp3b: | ; | |||||||
492 | 1424+ | 0602164 | lod | idcount | ;number of ids in list | |||||
493 | 1425 | 0122226 | sub | K6 | ;=6 | |||||
494 | 1425+ | 1122623 | jn | .lp3c | ; | |||||
495 | 1426 | 0042176 | o02 | K9a | ;=9+1=>10 | @1426 | ||||
496 | 1426+ | 1002625 | jmp | .lp3d | ; | |||||
497 | 1427 | ; | ||||||||
498 | 1427 | pad | ; | |||||||
498+1 | 1427 | 0000000 | 00 | 0 | ||||||
499 | 1427+ | ; | ||||||||
500 | 1427+ | .lp3c: | ; | |||||||
501 | 1427+ | 0040000 | o02 | 0 | ; | |||||
502 | 1428 | 0162164 | bus | idcount | ;number of ids in list | @1428 | ||||
503 | 1428+ | 1320001 | sll | 1 | ;double number | |||||
504 | 1429 | .lp3d: | ; | |||||||
505 | 1429 | 0422167 | stn | W1143 | ;store (negated) | |||||
506 | 1429+ | 0542170 | cls | idpt1 | ;clear pointer | |||||
507 | 1430 | .lp3e: | ; | |||||||
508 | 1430 | 0602167 | lod | W1143 | ; | @1430 | ||||
509 | 1430+ | 0102166 | add | W1142 | ; | |||||
510 | 1431 | 2010726577777 | sto | Link15b | / | lod | -1 | ; | ||
511 | 1432 | 0062243 | and | MskArgTp | ; | @1432 | ||||
512 | 1432+ | 0202170 | exa | idpt1 | ; | |||||
513 | 1433 | 1220006 | srl | 6 | ; | |||||
514 | 1433+ | 0702170 | las | idpt1 | ; | |||||
515 | 1434 | 0062242 | and | W1186 | ; | @1434 | ||||
516 | 1434+ | 0122202 | sub | arrbit | ; | |||||
517 | 1435 | 1042634 | jz | .lp3f | ; | |||||
518 | 1435+ | 1102643 | jmp | .lp3h | ; | |||||
519 | 1436 | ; | ||||||||
520 | 1436 | .lp3f: | ; | |||||||
521 | 1436 | 0602173 | lod | W1147 | ; | @1436 | ||||
522 | 1436+ | 1042637 | jz | .lp3g | ; | |||||
523 | 1437 | 0542173 | cls | W1147 | ; | |||||
524 | 1437+ | nop | ; | |||||||
524+1 | 1437+ | 1002636 | jmp | .1 | ||||||
524+2 | 1438 | .1: | ; | |||||||
525 | 1438 | call | ;generate Enter Block call | @1438 | ||||||
525+1 | 1438 | 7320121003403 | lnk | GenEB.lnk | : | jmp | GenEB.ent | |||
526 | 1439 | .lp3g: | ; | |||||||
527 | 1439 | 0010726577777 | o00 | Link15b | / | lod | -1 | ; | ||
528 | 1440 | 0062244 | and | M1188 | ; | @1440 | ||||
529 | 1440+ | 0404031 | sto | IdInfo | ; | |||||
530 | 1441 | 0603517 | lod | GPs+42 | ; | |||||
531 | 1441+ | 0000000 | o00 | 0 | ; | |||||
532 | 1442 | call | ; | @1442 | ||||||
532+1 | 1442 | 7320121004033 | lnk | gencode.lnk | : | jmp | gencode.ent | |||
533 | 1443 | 1002645 | jmp | .lp3i | ; | |||||
534 | 1443+ | ; | ||||||||
535 | 1443+ | .lp3h: | ; | |||||||
536 | 1443+ | 1022645 | jn | .lp3i | ; | |||||
537 | 1444 | 0010726557777 | o00 | Link15b | / | o27 | -1 | ; | @1444 | |
538 | 1445 | .lp3i: | ; | |||||||
539 | 1445 | 0602205 | lod | K2a | ; | |||||
540 | 1445+ | 0702167 | las | W1143 | ; | |||||
541 | 1446 | 1022626 | jn | .lp3e | ; | @1446 | ||||
542 | 1446+ | ; end of loop | ||||||||
543 | 1446+ | 0602170 | lod | idpt1 | ; | |||||
544 | 1447 | 0000000 | o00 | 0 | ; | |||||
545 | 1447+ | 0102175 | add | bit39 | ; | |||||
546 | 1448 | 0010762400000 | o00 | W1148 | / | sto | 0 | ; | @1448 | |
547 | 1449 | 0040000 | o02 | 0 | ;=1 | |||||
548 | 1449+ | 0562174 | o27 | W1148 | ; | |||||
549 | 1450 | 0602226 | lod | K6 | ;=6 | @1450 | ||||
550 | 1450+ | 0122164 | sub | idcount | ;number of ids in list | |||||
551 | 1451 | 1022654 | jn | .lp3j | ; | |||||
552 | 1451+ | 1102660 | jmp | .1456P | ; | |||||
553 | 1452 | ; | ||||||||
554 | 1452 | 0422164 | .lp3j: | stn | idcount | ;number of ids in list | @1452 | |||
555 | 1452+ | 1103003 | jmp | .1539P | ; | |||||
556 | 1453 | ; | ||||||||
557 | 1453 | .lp3k: | ; | |||||||
558 | 1453 | call | ; | |||||||
558+1 | 1453 | 7322411004503 | lnk | advance.lnk | : | jmp | advance.ent | |||
559 | 1454 | 0600600 | lod | token | ; | @1454 | ||||
560 | 1454+ | 1022541 | jn | _err07 | ;constant, error | |||||
561 | 1455 | 0162176 | bus | K9a | ;=9 | |||||
562 | 1455+ | 1022541 | jn | _err07 | ;not statement starter, error | |||||
563 | 1456 | 1043024 | jz | .1556 | ;dummy statement | @1456 | ||||
564 | 1456+ | .1456P: | ; | |||||||
565 | 1456+ | 0602163 | lod | W1139 | ; | |||||
566 | 1457 | 0062215 | and | realbit | ; | |||||
567 | 1457+ | 1142662 | jz | .1458P | ; | |||||
568 | 1458 | 0442161 | inc | wsptr | ; | @1458 | ||||
569 | 1458+ | .1458P: | ; | |||||||
570 | 1458+ | 0742147 | lzs | W1127 | ; | |||||
571 | 1459 | call | ; | |||||||
571+1 | 1459 | 7312031002415 | lnk | stack.lnk | : | jmp | stack.ent | |||
572 | 1460 | 0602172 | lod | Link15c | ; | @1460 | ||||
573 | 1460+ | 1220001 | srl | 1 | ; | |||||
574 | 1461 | 0402167 | sto | W1143 | ; | |||||
575 | 1461+ | 0602163 | lod | W1139 | ; | |||||
576 | 1462 | 1003001 | jmp | .1537 | ; | @1462 | ||||
577 | 1462+ | ; | ||||||||
578 | 1462+ | .1462P: | ; | |||||||
579 | 1462+ | 0602175 | lod | bit39 | ; | |||||
580 | 1463 | .1463: | ; | |||||||
581 | 1463 | 0102167 | add | W1143 | ; | |||||
582 | 1463+ | 1220001 | srl | 1 | ; | |||||
583 | 1464 | 0102173 | add | W1147 | ; | @1464 | ||||
584 | 1464+ | 0402167 | sto | W1143 | ; | |||||
585 | 1465 | 0602174 | lod | W1148 | ; | |||||
586 | 1465+ | 1320024 | sll | 20 | ; | |||||
587 | 1466 | 0102171 | add | W1145 | ; | @1466 | ||||
588 | 1466+ | 0102167 | add | W1143 | ; | |||||
589 | 1467 | call | ; | |||||||
589+1 | 1467 | 7312031002415 | lnk | stack.lnk | : | jmp | stack.ent | |||
590 | 1468 | call | ;compile procedure body | @1468 | ||||||
590+1 | 1468 | 7310611003254 | lnk | statement.lnk | : | jmp | statement.ent | |||
591 | 1469 | 0602161 | lod | wsptr | ; | |||||
592 | 1469+ | 0162147 | bus | W1127 | ; | |||||
593 | 1470 | 1022677 | jn | .1471 | ; | @1470 | ||||
594 | 1470+ | 0502161 | ads | wsptr | ; | |||||
595 | 1471 | .1471: | ; | |||||||
596 | 1471 | 0010646577777 | o00 | stkp | / | lod | -1 | ; | ||
597 | 1472 | 0402167 | sto | W1143 | ; | @1472 | ||||
598 | 1472+ | 1220024 | srl | 20 | ; | |||||
599 | 1473 | 0062222 | and | K8191 | ;=8191 | |||||
600 | 1473+ | 0402160 | sto | dicpt | ; | |||||
601 | 1474 | 0000000 | o00 | 0 | ; | @1474 | ||||
602 | 1474+ | 0602205 | lod | K2a | ; | |||||
603 | 1475 | 2710646600000 | o27 | stkp | / | lod | 0 | ; | ||
604 | 1476 | 0402147 | sto | W1127 | ; | @1476 | ||||
605 | 1476+ | 0042234 | o02 | Bit32 | ;=00020000000000 | |||||
606 | 1477 | 0110736660000 | neg | W1143 | / | lns | 0 | ; | ||
607 | 1478 | 0062244 | and | M1188 | ; | @1478 | ||||
608 | 1478+ | 0162161 | bus | wsptr | ; | |||||
609 | 1479 | 0402166 | sto | W1142 | ; | |||||
610 | 1479+ | 0602167 | lod | W1143 | ; | |||||
611 | 1480 | 1022714 | jn | .1484 | ; | @1480 | ||||
612 | 1480+ | 1002713 | jmp | .1483 | ;-->> | |||||
613 | 1481 | =1483 | ||||||||
614 | 1483 | .1483: | ; | |||||||
615 | 1483 | call | ;generate Exit Block call | @1483 | ||||||
615+1 | 1483 | 7320121003401 | lnk | GenXB.lnk | : | jmp | GenXB.ent | |||
616 | 1484 | .1484: | ; | |||||||
617 | 1484 | 0602167 | lod | W1143 | ; | |||||
618 | 1484+ | 1320001 | sll | 1 | ; | |||||
619 | 1485 | 1022716 | jn | .1486 | ; | |||||
620 | 1485+ | 1002722 | jmp | .1490 | ; | |||||
621 | 1486 | ; | ||||||||
622 | 1486 | .1486: | ; | |||||||
623 | 1486 | 0010736040000 | o00 | W1143 | / | o02 | 0 | ; | @1486 | |
624 | 1487 | 0401422 | sto | GenAdr | ; | |||||
625 | 1487+ | 1002466 | jmp | .1334 | ;-->> | |||||
626 | 1488 | =1334 | ||||||||
627 | 1334 | 0010736577777 | .1334: | o00 | W1143 | / | lod | -1 | ; | @1334 |
628 | 1335 | 1220034 | srl | 28 | ; | |||||
629 | 1335+ | 1002720 | jmp | .1488 | ;-->> | |||||
630 | 1336 | =1488 | ||||||||
631 | 1488 | 0062223 | .1488: | and | K31b | ;=31 | @1488 | |||
632 | 1488+ | 0501422 | ads | GenAdr | ; | |||||
633 | 1489 | call | ; | |||||||
633+1 | 1489 | 7307175103002 | lnk | L1538P.lnk | : | jmp | L1538P.ent | |||
634 | 1490 | 0602167 | .1490: | lod | W1143 | ; | @1490 | |||
635 | 1490+ | 1320002 | sll | 2 | ; | |||||
636 | 1491 | 1022743 | jn | .1507 | ; | |||||
637 | 1491+ | 0603542 | lod | GPs+61 | ;=04000031000002 | |||||
638 | 1492 | call | ; | @1492 | ||||||
638+1 | 1492 | 7320121004033 | lnk | gencode.lnk | : | jmp | gencode.ent | |||
639 | 1493 | 0042233 | o02 | Bit21 | ;=00000004000000 | |||||
640 | 1493+ | 0562152 | o27 | W1130 | ; | |||||
641 | 1494 | 0602152 | lod | W1130 | ; | @1494 | ||||
642 | 1494+ | 0062222 | and | K8191 | ;=8191 | |||||
643 | 1495 | 0401430 | sto | W792 | ; | |||||
644 | 1495+ | 0602166 | lod | W1142 | ; | |||||
645 | 1496 | 1002465 | jmp | .1333 | ;-->> | @1496 | ||||
646 | 1496+ | =1333 | ||||||||
647 | 1333 | 0102225 | .1333: | add | Bbit | ;=<00 0 / 00 0> | ||||
648 | 1333+ | 1002737 | jmp | .1503 | ; | |||||
649 | 1334 | ; | ||||||||
650 | 1334 | =1503 | ||||||||
651 | 1503 | .1503: | ; | |||||||
652 | 1503 | call | ; | @1503 | ||||||
652+1 | 1503 | 7307175001630 | lnk | GenSetBase.lnk | : | jmp | GenSetBase.ent | |||
653 | 1504 | .1504: | ; | |||||||
654 | 1504 | 0040000 | o02 | 0 | ;=1 | |||||
655 | 1504+ | 0000000 | o00 | 0 | ; | |||||
656 | 1505 | 2710646600000 | o27 | stkp | / | lod | 0 | ; | ||
657 | 1506 | 0402153 | sto | W1131 | ; | @1506 | ||||
658 | 1506+ | 1002303 | jmp | .recover | ; | |||||
659 | 1507 | ; | ||||||||
660 | 1507 | .1507: | ; | |||||||
661 | 1507 | 0010736600000 | o00 | W1143 | / | lod | 0 | ; | @1507 | |
662 | 1508 | 0062244 | and | M1188 | ; | |||||
663 | 1508+ | 0401422 | sto | GenAdr | ; | |||||
664 | 1509 | 0602226 | lod | K6 | ;=6 | |||||
665 | 1509+ | 0102225 | add | Bbit | ;=<000/000> | |||||
666 | 1510 | call | ; | @1510 | ||||||
666+1 | 1510 | 7307175001665 | lnk | GenSkpInst.lnk | : | jmp | GenSkpInst.ent | |||
667 | 1511 | 0042224 | o02 | Bit19 | ;=00000001000000 | |||||
668 | 1511+ | 0000000 | o00 | 0 | ; | |||||
669 | 1512 | call | ; | @1512 | ||||||
669+1 | 1512 | 7307175001705 | lnk | L965.lnk | : | jmp | L965.ent | |||
670 | 1513 | 1002740 | jmp | .1504 | ; | |||||
671 | 1513+ | ; | ||||||||
672 | 1513+ | _err08a: | ; | |||||||
673 | 1513+ | 0602210 | lod | K7a | ;=7 | |||||
674 | 1514 | _err08: | ; | |||||||
675 | 1514 | 1661044 | lnk | errlnk | ;error 8: param of non-allowable type | @1514 | ||||
676 | 1514+ | ;or, too many parameters | ||||||||
677 | 1514+ | ;parameter not specified | ||||||||
678 | 1514+ | 1001051 | jmp | Error1 | ;call error routine | |||||
679 | 1515 | 1002753 | .hlt15: | jmp | .hlt15 | ;dynamic stop | ||||
680 | 1515+ | ; | ||||||||
681 | 1515+ | _err08b: | ; | |||||||
682 | 1515+ | 0602200 | lod | K8a | ;=8, obsolete | @1515+ | ||||
683 | 1516 | 1002752 | jmp | _err08 | ; | |||||
684 | 1516+ | ; | ||||||||
685 | 1516+ | _err10a: | ; | |||||||
686 | 1516+ | 0602176 | lod | K9a | ;=9, obsolete | |||||
687 | 1517 | _err10: | ; | |||||||
688 | 1517 | 1661044 | lnk | errlnk | ;error 10: name in value not param | @1517 | ||||
689 | 1517+ | 1001051 | jmp | Error1 | ;goto error rtne | |||||
690 | 1518 | 1002546 | jmp | .errrec | ;if error returns continue | |||||
691 | 1518+ | ; | ||||||||
692 | 1518+ | _err11a: | ; | |||||||
693 | 1518+ | 0602176 | lod | K9a | ;=9, obsolete | |||||
694 | 1519 | _err11: | ; | |||||||
695 | 1519 | 1661044 | lnk | errlnk | ;error 11: name in spec not param, or | |||||
696 | 1519+ | ;param spec twice | ||||||||
697 | 1519+ | 1001051 | jmp | Error1 | ;goto error rtne | |||||
698 | 1520 | 1002602 | jmp | .sp2 | ; | @1520 | ||||
699 | 1520+ | ;-------------------------------------------------------------------- | ||||||||
700 | 1520+ | .1520P: | ; | |||||||
701 | 1520+ | 0102240 | add | K10b | ; | |||||
702 | 1521 | 1042762 | jz | .cmnt | ; | |||||
703 | 1521+ | 1002553 | jmp | .1387 | ; | |||||
704 | 1522 | ; | ||||||||
705 | 1522 | .cmnt: | ; | |||||||
706 | 1522 | call | ; | @1522 | ||||||
706+1 | 1522 | 7312031002420 | lnk | skipcomment.lnk | : | jmp | skipcomment.ent | |||
707 | 1523 | 1002534 | jmp | .specs | ; | |||||
708 | 1523+ | pad | ; | |||||||
708+1 | 1523+ | 0000000 | 00 | 0 | ||||||
709 | 1524 | ; | ||||||||
710 | 1524 | .comt: | ; | |||||||
711 | 1524 | call | ; | @1524 | ||||||
711+1 | 1524 | 7312031002420 | lnk | skipcomment.lnk | : | jmp | skipcomment.ent | |||
712 | 1525 | 1002552 | jmp | .valsemi | ; | |||||
713 | 1525+ | pad | ||||||||
713+1 | 1525+ | 0000000 | 00 | 0 | ||||||
714 | 1526 | ; | ||||||||
715 | 1526 | specsw: | ; | |||||||
716 | 1526 | 4013720000000 | jmp | .comt | : | 00 | 0 | ; +9 comment | @1526 | |
717 | 1527 | 4012604000000 | jmp | _err07 | : | 00 | 0 | ; +10 own invalid as spec | ||
718 | 1528 | 3011055102560 | lod | boolbit | : | jmp | .ssp | ; +11 boolean | @1528 | |
719 | 1529 | 3011061102560 | lod | intbit | : | jmp | .ssp | ; +12 integer | ||
720 | 1530 | 3011065102560 | lod | realbit | : | jmp | .ssp | ; +13 real | @1530 | |
721 | 1531 | 3011015102565 | lod | rarrbit | : | jmp | .asp | ; +14 array | ||
722 | 1532 | 4413644000000 | jmp | _err08a | : | 00 | 0 | ; +15 switch | @1532 | |
723 | 1533 | 4413644000000 | jmp | _err08a | : | 00 | 0 | ; +16 procedure | ||
724 | 1534 | 3011251102565 | lod | strbit | : | jmp | .asp | ; +17 string | @1534 | |
725 | 1535 | 3010621103012 | lod | W1124 | : | jmp | .lbl | ; +18 label | ||
726 | 1536 | ;-------------------------------------------------------------------- | ||||||||
727 | 1536 | ; | ||||||||
728 | 1536 | =1537 | ||||||||
729 | 1537 | 0062215 | .1537: | and | realbit | ; | @1537 | |||
730 | 1537+ | 1042667 | jz | .1463 | ; | |||||
731 | 1538 | 1102666 | jmp | .1462P | ; | |||||
732 | 1538+ | ;-------------------------------------------------------------------- | ||||||||
733 | 1538+ | ; | ||||||||
734 | 1538+ | L1538P.ent: | ; | |||||||
735 | 1538+ | 0602220 | lod | W1168 | ; | @1538+ | ||||
736 | 1539 | 1001640 | jmp | GenInst.ent | ; | |||||
737 | 1539+ | ;-------------------------------------------------------------------- | ||||||||
738 | 1539+ | ; | ||||||||
739 | 1539+ | ;L1539P: | ||||||||
740 | 1539+ | 0042231 | .1539P: | o02 | K11 | ; | @1539+ | |||
741 | 1540 | 0562166 | o27 | W1142 | ; | @1540 | ||||
742 | 1540+ | 1102620 | jmp | .lp3b | ; | |||||
743 | 1541 | ; | ||||||||
744 | 1541 | =1542+ | ||||||||
745 | 1542+ | ; | ||||||||
746 | 1542+ | ; no reference to here?? | ||||||||
747 | 1542+ | ; | ||||||||
748 | 1542+ | 0600600 | lod | token | ; | |||||
749 | 1543 | 1043010 | jz | .1544 | ; | |||||
750 | 1543+ | 1002541 | jmp | _err07 | ; | |||||
751 | 1544 | =1544 | ||||||||
752 | 1544 | ; and hence to here | ||||||||
753 | 1544 | .1544: | ; | |||||||
754 | 1544 | call | ; | @1544 | ||||||
754+1 | 1544 | 7306371006514 | lnk | SkipPLC.lnk | : | jmp | SkipPLC.ent | |||
755 | 1545 | call | ; | |||||||
755+1 | 1545 | 7310725002400 | lnk | declid2.lnk | : | jmp | declid2.ent | |||
756 | 1546 | 1002511 | jmp | .1353 | ; | @1546 | ||||
757 | 1546+ | ; | ||||||||
758 | 1546+ | .lbl: | ; | |||||||
759 | 1546+ | 1320027 | sll | 23 | ; | |||||
760 | 1547 | 0102250 | add | W1192 | ; | @1547 | ||||
761 | 1547+ | 1102565 | jmp | .asp | ; | |||||
762 | 1548 | ; | ||||||||
763 | 1548 | L1548.ent: | ; | |||||||
764 | 1548 | 0602144 | lod | W1124 | ; | @1548 | ||||
765 | 1548+ | 0202153 | exa | W1131 | ; | |||||
766 | 1549 | call | ; | |||||||
766+1 | 1549 | 7312031002415 | lnk | stack.lnk | : | jmp | stack.ent | |||
767 | 1550 | 1001222 | jmp | gettoken.ent | ; | @1550 | ||||
768 | 1550+ | ; | ||||||||
769 | 1550+ | =1555 | ||||||||
770 | 1555 | ; | ||||||||
771 | 1555 | 3777740000000 | W1555: | +03777740000000 | ; | |||||
772 | 1556 | ; | ||||||||
773 | 1556 | .1556: | ; | |||||||
774 | 1556 | call | ; | |||||||
774+1 | 1556 | 7312031002420 | lnk | skipcomment.lnk | : | jmp | skipcomment.ent | |||
775 | 1557 | 1002655 | jmp | .lp3k | ; | |||||
776 | 1557+ | ; | ||||||||
777 | 1557+ | pad | ||||||||
777+1 | 1557+ | 0000000 | 00 | 0 | ||||||
778 | 1558 | ;-------------------------------------------------------------------- | ||||||||
779 | 1558 | ; getboundexp, get expression suitable for array bound | ||||||||
780 | 1558 | ; | ||||||||
781 | 1558 | getboundexp:: | ; | |||||||
782 | 1558 | ; | ||||||||
783 | 1558 | .ent: | ; | |||||||
784 | 1558 | pad | ; | @1558 | ||||||
784+1 | 1558 | 0000000 | 00 | 0 | ||||||
785 | 1558+ | 0542171 | cls | W1145 | ; | |||||
786 | 1559 | call | ;get next token | |||||||
786+1 | 1559 | 7305105001222 | lnk | gettoken.lnk | : | jmp | gettoken.ent | |||
787 | 1560 | 0040600 | o02 | token | ;token+1 | @1560 | ||||
788 | 1560+ | 1023225 | jn | L1685 | ;-> if -2 | |||||
789 | 1561 | 0124346 | sub | W2278 | ;=23 ->[+]+1 | |||||
790 | 1561+ | 1043047 | jz | GetIntExp | ;handle plus sign | |||||
791 | 1562 | 0122207 | sub | K1c | ;=1 ->[-]+1 | @1562 | ||||
792 | 1562+ | 1143046 | jz | GetIntExp1 | ;->handle neg sign | |||||
793 | 1563 | pad | ; | |||||||
793+1 | 1563 | 0000000 | 00 | 0 | ||||||
794 | 1563+ | 0542172 | cls | Link15c | ; | |||||
795 | 1564 | L1564.ent: | ; | |||||||
796 | 1564 | 0602156 | .1564: | lod | frameptr | ; | @1564 | |||
797 | 1564+ | 0202160 | exa | dicpt | ; | |||||
798 | 1565 | 0402173 | sto | W1147 | ; | |||||
799 | 1565+ | L1565P: | ; | |||||||
800 | 1565+ | .1565P: | ; | |||||||
801 | 1565+ | 0404304 | sto | constptr | ; | @1565+ | ||||
802 | 1566 | call | ;process identifier? | |||||||
802+1 | 1566 | 7322411004504 | lnk | advance2.lnk | : | jmp | advance2.ent | |||
803 | 1567 | call | ; | |||||||
803+1 | 1567 | 7326171003053 | lnk | GetIntExp2.lnk | : | jmp | GetIntExp2.ent | |||
804 | 1568 | 0602173 | lod | W1147 | ; | @1568 | ||||
805 | 1568+ | 0402160 | sto | dicpt | ; | |||||
806 | 1569 | 0542166 | cls | W1142 | ; | |||||
807 | 1569+ | 0040000 | o02 | 0 | ;=1 | |||||
808 | 1570 | 2710646600000 | o27 | stkp | / | lod | 0 | ; | @1570 | |
809 | 1571 | 0062177 | and | MaxInt | ; | |||||
810 | 1571+ | L1571P: | ; | |||||||
811 | 1571+ | 0102175 | .1571P: | add | bit39 | ; | ||||
812 | 1572 | call | ; | @1572 | ||||||
812+1 | 1572 | 7312031002407 | lnk | addtodic.lnk | : | jmp | addtodic.ent | |||
813 | 1573 | 0010727000001 | o00 | Link15b | / | jmp | 1 | ;return | ||
814 | 1574 | ; | ||||||||
815 | 1574 | pad | ; | @1574 | ||||||
815+1 | 1574 | 0000000 | 00 | 0 | ||||||
816 | 1574+ | ;-------------------------------------------------------------------- | ||||||||
817 | 1574+ | ; | ||||||||
818 | 1574+ | ; declid process an identifier, checking for duplicate | ||||||||
819 | 1574+ | ; declarations. If OK, add to dictionary | ||||||||
820 | 1574+ | ; | ||||||||
821 | 1574+ | declid:: | ; | |||||||
822 | 1574+ | =1536 | ||||||||
823 | 1536 | ; entry moved into module | ||||||||
824 | 1536 | ; add ident to dictionary, regardless of duplicates | ||||||||
825 | 1536 | ; | ||||||||
826 | 1536 | declid1.ent: | ; | |||||||
827 | 1536 | 0602160 | lod | dicpt | ; bypass duplicate search | @1536 | ||||
828 | 1536+ | 1102361 | jmp | .1 | ; enter main body | |||||
829 | 1537 | ; | ||||||||
830 | 1537 | ; main entry, include duplicate scan | ||||||||
831 | 1537 | ; | ||||||||
832 | 1537 | =1265 | ||||||||
833 | 1265 | .ent: | ; | |||||||
834 | 1265 | 0602156 | lod | frameptr | ; | @1265 | ||||
835 | 1265+ | 0402167 | .1: | sto | W1143 | ;limit for scans | ||||
836 | 1266 | 0602160 | lod | dicpt | ; | |||||
837 | 1266+ | 0402170 | sto | idpt1 | ; | |||||
838 | 1267 | 0542164 | cls | idcount | ;number of ids in list | @1267 | ||||
839 | 1267+ | 1102367 | jmp | .3 | ; | |||||
840 | 1268 | ; | ||||||||
841 | 1268 | 0000000000000 | +0 | ;no reference! | @1268 | |||||
842 | 1269 | ; | ||||||||
843 | 1269 | .2: | ; | |||||||
844 | 1269 | 2210742600000 | inc | idpt1 | / | lod | 0 | ; | @1269 | |
845 | 1270 | 0120576 | sub | ident | ;ident | |||||
846 | 1270+ | 1142402 | jz | .7 | ;match->duplicate id | |||||
847 | 1271 | 0602170 | lod | idpt1 | ; | |||||
848 | 1271+ | .3: | ; | |||||||
849 | 1271+ | 0122167 | sub | W1143 | ; | @1271+ | ||||
850 | 1272 | 1022365 | jn | .2 | ;back to check next one | |||||
851 | 1272+ | 0600600 | lod | token | ;token | |||||
852 | 1273 | 1142372 | jz | .4 | ;ident-> | |||||
853 | 1273+ | 1661044 | _err04: | lnk | errlnk | ;error 4: item after comma in decl not name | ||||
854 | 1274 | 1002262 | jmp | Error2 | ;loop back to test for name | @1274 | ||||
855 | 1274+ | ; | ||||||||
856 | 1274+ | .4: | ; | |||||||
857 | 1274+ | 0600576 | lod | ident | ;identifier value | |||||
858 | 1275 | call | ; add id to list | |||||||
858+1 | 1275 | 7312031002407 | lnk | addtodic.lnk | : | jmp | addtodic.ent | |||
859 | 1276 | 0442164 | inc | idcount | ;idcount | @1276 | ||||
860 | 1276+ | pad | ;no-op | |||||||
860+1 | 1276+ | 0000000 | 00 | 0 | ||||||
861 | 1277 | .5: | ; | |||||||
862 | 1277 | call | ; | @1277 | ||||||
862+1 | 1277 | 7305105001222 | lnk | gettoken.lnk | : | jmp | gettoken.ent | |||
863 | 1278 | 0040600 | o02 | token | ;token+1 | @1278 | ||||
864 | 1278+ | 0122201 | sub | K42 | ;=42 | |||||
865 | 1279 | 1042400 | jz | .6 | ; comma-> | |||||
866 | 1279+ | 1002405 | jmp | .ret | ;anything else-> | |||||
867 | 1280 | ; | ||||||||
868 | 1280 | ; alternate entry point | ||||||||
869 | 1280 | ; | ||||||||
870 | 1280 | declid2.ent: | ; | |||||||
871 | 1280 | .6: | ; | |||||||
872 | 1280 | call | ; | @1280 | ||||||
872+1 | 1280 | 7305105001222 | lnk | gettoken.lnk | : | jmp | gettoken.ent | |||
873 | 1281 | 0602160 | lod | dicpt | ; | |||||
874 | 1281+ | 0402170 | sto | idpt1 | ; | |||||
875 | 1282 | 1002365 | jmp | .2 | ; loop back for next identifier | @1282 | ||||
876 | 1282+ | ; | ||||||||
877 | 1282+ | .7: | ; | |||||||
878 | 1282+ | 0040000 | o02 | 0 | ||||||
879 | 1283 | 1661044 | _err03: | lnk | errlnk | ;error 3: name declared twice | ||||
880 | 1283+ | 1001051 | jmp | Error1 | ;call error handler | |||||
881 | 1284 | 1002375 | jmp | .5 | ; | @1284 | ||||
882 | 1284+ | ; | ||||||||
883 | 1284+ | pad | ||||||||
883+1 | 1284+ | 0000000 | 00 | 0 | ||||||
884 | 1285 | .ret: | ; | |||||||
885 | 1285 | ret | ||||||||
885+1 | 1285 | 0010727000001 | o00 | declid.lnk | / | jmp | 1 | |||
886 | 1286 | ;-------------------------------------------------------------------- |