File: intexpr.t2

For general comments see here
LineAddressObject Code LabelF1N1BF2N2CommentsCheck
1 0  ; tape1.d/expr.t2
2 0  ;----------------
3 0  IntExprn::; 
4 0  =1574+ 
5 1574+ GetIntExp1:; 
6 1574+1662171.1574P:lnk W1145   ;
7 1575  GetIntExp:; 
8 1575 0600600.1575:lod token   ;
9 1575+0404303 sto W2243   ;
10 1576   call     ; @1576
10+11576 7305105001222 lnk gettoken.lnk:jmp gettoken.ent 
11 1577 0040600 o02 token   ;
12 1577+1023225 jn L1685   ;
13 1578   call     ; @1578
13+11578 7310751003034 lnk L1564.lnk:jmp L1564.ent 
14 1579  GetIntExp2.ent:; 
15 1579 0602172 lod Link15c   ;
16 1579+1045507 jz L2887   ;
17 1580 1105535 jmp L2909P   ; @1580
18 1580+ ;
19 1580+0000000 o00 0    
20 1581  ;--------------------------------------------------------------------
21 1581  L1581:; 
22 1581 0062222.1581:and K8191   ;=8191
23 1581+0401430 sto W792   ;
24 1582 0042166 o02 W1142   ; @1582
25 1582+0102225 add Bbit   ;=<000/000>
26 1583   call     ;
26+11583 7307175001630 lnk GenSetBase.lnk:jmp GenSetBase.ent 
27 1584 1003174 jmp .1660   ; @1584
28 1584+ ;
29 1584+0000000 o00 0    
30 1585  ;--------------------------------------------------------------------
31 1585  L1585:; 
32 1585 0402163.1585:sto W1139   ;
33 1585+1003063 jmp .1587   ;
34 1586  ;
35 1586  L1586:; 
36 1586 0602202.1586:lod arrbit   ; @1586
37 1586+0502163 ads W1139   ;
38 1587  .1587:; 
39 1587   call     ;save stkp, call gettoken
39+11587 7305105010635 lnk L4509.lnk:jmp L4509.ent 
40 1588   call     ;get id @1588
40+11588 7310725002361 lnk declid.lnk:jmp declid.ent 
41 1589 0600600 lod token   ;
42 1589+0122204 sub K47a   ;=47 [(]
43 1590 1043067 jz .1591   ; @1590
44 1590+1003102 jmp _err13   ;
45 1591  ;
46 1591 0602175.1591:lod bit39   ; @1591
47 1591+0402166 sto W1142   ;
48 1592 0542167 cls W1143   ; @1592
49 1592+0602175 lod bit39   ;
50 1593   call     ;
50+11593 7312031002407 lnk addtodic.lnk:jmp addtodic.ent 
51 1594 0602160 lod dicpt   ; @1594
52 1594+1003246 jmp .1702   ;
53 1595  ;
54 1595  .1595:call     ;get bound expression @1595
54+11595 7310725003026 lnk getboundexp.lnk:jmp getboundexp.ent 
55 1596 0600600 lod token   ;
56 1596+0122201 sub K42   ;=42, check for colon
57 1597 1043076 jz .1598   ;syntax OK
58 1597+1003102 jmp _err13   ;report syntax error
59 1598  ;
60 1598  .1598:call     ;get second bound expression @1598
60+11598 7310725003026 lnk getboundexp.lnk:jmp getboundexp.ent 
61 1599 0442167 inc W1143   ;bump subscript counter
62 1599+0040600 o02 token   ;token+1
63 1600 0122201 sub K42   ;=42 -> [,] @1600
64 1600+1043073 jz .1595   ;more to come
65 1601 0122210 sub K7a   ;=7 ->[)]
66 1601+1043103 jz .1603   ;end of bound list
67 1602  _err13:; 
68 1602 1661044 lnk errlnk   ;error 13: in array declaration: @1602
69 1602+  ; no comma or ( after identifier, or 
70 1602+  ; no colon between bounds, or 
71 1602+  ; no comma or ) after bounds 
72 1602+1002262 jmp Error2   ;call error rtne
73 1603  .1603:; 
74 1603   call     ;
74+11603 7305105003251 lnk L1705.lnk:jmp L1705.ent 
75 1604 0602162 lod typeinfo   ; @1604
76 1604+1143133 jz .1627P   ;
77 1605 0603541 lod GPs+60   ;=04000024000007
78 1605+  nop     ;
78+11605+1003106 jmp .1    
78+21606  .1:; 
79 1606  .1606:call     ; @1606
79+11606 7320121004033 lnk gencode.lnk:jmp gencode.ent 
80 1607 0602164 lod idcount   ;number of ids in list
81 1607+0402161 sto wsptr   ;
82 1608   call     ; @1608
82+11608 7307175001705 lnk L965.lnk:jmp L965.ent 
83 1609 0602174 lod W1148   ;
84 1609+0502161 ads wsptr   ;
85 1610 0401422 sto GenAdr   ; @1610
86 1610+0602167 lod W1143   ;
87 1611 1320015 sll 13   ;
88 1611+0402167 sto W1143   ;
89 1612 0102226 add K6   ;=6 @1612
90 1612+0000000 o00 0   ;
91 1613   call     ;
91+11613 7307175001640 lnk GenInst.lnk:jmp GenInst.ent 
92 1614 0602170 lod idpt1   ; @1614
93 1614+0402172 sto Link15c   ;
94 1615  .1615:; 
95 1615 0010752600000 o00 Link15c/lod 0;
96 1616 0401422 sto GenAdr   ; @1616
97 1616+0062215 and realbit   ;
98 1617 1220020 srl 16   ;
99 1617+0102226 add K6   ;=6
100 1618   call     ; @1618
100+11618 7307175001640 lnk GenInst.lnk:jmp GenInst.ent 
101 1619 0040000 o02 0   ;=1
102 1619+0562172 o27 Link15c   ;
103 1620 0602172 lod Link15c   ; @1620
104 1620+0162160 bus dicpt   ;
105 1621 1023117 jn .1615   ;
106 1621+0602167 lod W1143   ;
107 1622 0102161 add wsptr   ; @1622
108 1622+0102163 add W1139   ;
109 1623 0102177 add MaxInt   ;
110 1623+0000000 o00 0   ;
111 1624 0010742400001 o00 idpt1/sto 1; @1624
112 1625 0602170.1625:lod idpt1   ;
113 1625+1103241 jmp .1697P   ;
114 1626  ;
115 1626  .1626:; 
116 1626 0122201 sub K42   ;=42 @1626
117 1626+1043063 jz .1587   ;
118 1627 1002331 jmp declaration.done   ;
119 1627+ ;
120 1627+0040000.1627P:o02 0   ;=1
121 1628 0202166 exa W1142   ; @1628
122 1628+1143216 jz .1678P   ;
123 1629   call     ;
123+11629 7307175001622 lnk SetCodePtr.lnk:jmp SetCodePtr.ent 
124 1630 0602143 lod W1123   ; @1630
125 1630+0202145 exa ObjPC   ;
126 1631 0402173 sto W1147   ;
127 1631+1003221 jmp .1681   ;
128 1632  ;
129 1632  .1632:call     ; @1632
129+11632 7307175001705 lnk L965.lnk:jmp L965.ent 
130 1633 0602170 lod idpt1   ;
131 1633+0402172 sto Link15c   ;
132 1634  .1634:; 
133 1634 0010752600000 o00 Link15c/lod 0; @1634
134 1635 0402171 sto W1145   ;
135 1635+0062222 and K8191   ;=8191
136 1636 0202171 exa W1145   ; @1636
137 1636+0062213 and boolbit   ;
138 1637 1043146 jz .1638   ;
139 1637+0622171 lcs W1145   ;
140 1638 0010752577777.1638:o00 Link15c/lod -1; @1638
141 1639 0402165 sto Link15b   ;
142 1639+0062222 and K8191   ;=8191
143 1640 0202165 exa Link15b   ; @1640
144 1640+0062213 and boolbit   ;
145 1641  .1641:; 
146 1641 1043152 jz .1642   ;
147 1641+0622165 lcs Link15b   ;
148 1642  .1642:; 
149 1642 0042165 o02 Link15b   ; @1642
150 1642+0122171 sub W1145   ;
151 1643 0402165 sto Link15b   ;
152 1643+1123214 jn .1676P   ;
153 1644 1242166 mul W1142   ; @1644
154 1644+1360000 ara 0   ;
155 1645 0402166 sto W1142   ;
156 1645+0602171 lod W1145   ;
157 1646   call     ; @1646
157+11646 7307365001676 lnk L958.lnk:jmp L958.ent 
158 1647 0602165 lod Link15b   ;
159 1647+0000000 o00 0   ;
160 1648   call     ; @1648
160+11648 7307365001676 lnk L958.lnk:jmp L958.ent 
161 1649 0602205 lod K2a   ;
162 1649+0562172 o27 Link15c   ;
163 1650 0602172 lod Link15c   ; @1650
164 1650+0162160 bus dicpt   ;
165 1651 1023142 jn .1634   ;
166 1651+0602167 lod W1143   ;
167 1652 1320001 sll 1   ; @1652
168 1652+0102164 add idcount   ;number of ids in list
169 1653 0102207 add K1c   ;=1
170 1653+0702143 las W1123   ;
171 1654 0402165 sto Link15b   ; @1654
172 1654+0602167 lod W1143   ;
173 1655 1320015 sll 13   ;
174 1655+0102143 add W1123   ;
175 1656 0102163 add W1139   ; @1656
176 1656+0102177 add MaxInt   ;
177 1657 0010742400001 o00 idpt1/sto 1;
178 1658 0602152 lod W1130   ; @1658
179 1658+1003055 jmp .1581   ;
180 1659  ;
181 1659  ; no apparent reference to here !!!!!!!!!!!
182 1659  ;
183 1659 0602156 lod frameptr   ; @1659
184 1659+1103423 jmp lookupid.1811P   ;branch into lookup identifier
185 1660  ;
186 1660  .1660:; 
187 1660 0602164 lod idcount   ;number of ids in list @1660
188 1660+0422172 stn Link15c   ;
189 1661 0442172 inc Link15c   ;
190 1661+0140000.1661P:cla 0   ;
191 1662   call     ; @1662
191+11662 7307175001640 lnk GenInst.lnk:jmp GenInst.ent 
192 1663 0042143 o02 W1123   ;
193 1663+0401422 sto GenAdr   ;
194 1664 0602226 lod K6   ;=6 @1664
195 1664+0000000 o00 0   ;
196 1665   call     ;
196+11665 7307175001640 lnk GenInst.lnk:jmp GenInst.ent 
197 1666 0602165 lod Link15b   ; @1666
198 1666+0000000 o00 0   ;
199 1667   call     ;
199+11667 7307445001761 lnk NopRef.lnk:jmp NopRef.ent 
200 1668 0602143 lod W1123   ; @1668
201 1668+0000000 o00 0   ;
202 1669   call     ;
202+11669 7307445001761 lnk NopRef.lnk:jmp NopRef.ent 
203 1670 0602227 lod K26   ;=26 @1670
204 1670+0000000 o00 0   ;
205 1671   call     ;
205+11671 7306371001526 lnk putOpcd.lnk:jmp putOpcd.ent 
206 1672 0042166 o02 W1142   ; @1672
207 1672+0502143 ads W1123   ;
208 1673 0642172 lis Link15c   ;
209 1673+1123175 jn .1661P   ;
210 1674   call     ; @1674
210+11674 7307175001622 lnk SetCodePtr.lnk:jmp SetCodePtr.ent 
211 1675 0602173 lod W1147   ;
212 1675+0402145 sto ObjPC   ;
213 1676 1003131 jmp .1625   ; @1676
214 1676+ ;
215 1676+ .1676P:; 
216 1676+0042211 o02 K4   ;=4+1=>5
217 1677 1661044_err14:lnk errlnk   ;error 14: negative own array size
218 1677+1001070 jmp Error   ;call error routine
219 1678 0000000 o00 0   ; @1678
220 1678+ .1678P:; 
221 1678+0042205 o02 K2a   ;=2+1=>3
222 1679 1661044_err15:lnk errlnk   ;error 15: own array with variable bounds
223 1679+1001051 jmp Error1   ;goto error rtne
224 1680 1003131 jmp .1625   ; @1680
225 1680+ ;
226 1680+0000000 o00 0    
227 1681  ;
228 1681 0602152.1681:lod W1130   ;
229 1681+0062212 and B19.28   ;=00001777000000
230 1682 0401422 sto GenAdr   ; @1682
231 1682+0602226 lod K6   ;=6
232 1683   call     ;
232+11683 7307175001640 lnk GenInst.lnk:jmp GenInst.ent 
233 1684 0602167 lod W1143   ; @1684
234 1684+1003140 jmp .1632   ;
235 1685  ;
236 1685  L1685:; 
237 1685 0600576.1685:lod ident   ;save id info
238 1685+0402172 sto Link15c   ;
239 1686   call     ;see what comes next @1686
239+11686 7305105001222 lnk gettoken.lnk:jmp gettoken.ent 
240 1687 0040600 o02 token   ;token+1
241 1687+0122201 sub K42   ;=42 [,]+1
242 1688 1043243 jz .1699   ; @1688
243 1688+0122207 sub K1c   ;=1 => [:]+1
244 1689 1043243 jz .1699   ;
245 1689+0122226 sub K6   ;=6 => [)]+1
246 1690 1043243 jz .1699   ; @1690
247 1690+0602171 lod W1145   ;
248 1691 1043234 jz .1692   ;
249 1691+0622172 lcs Link15c   ;
250 1692  .1692:; 
251 1692 0040000 o02 0   ; @1692
252 1692+0202172 exa Link15c   ;
253 1693   call     ;
253+11693 7312031002407 lnk addtodic.lnk:jmp addtodic.ent 
254 1694 0042160 o02 dicpt   ; @1694
255 1694+0402173 sto W1147   ;
256 1695 0102214 add intbit   ;
257 1695+0404303 sto W2243   ;
258 1696 0602156 lod frameptr   ; @1696
259 1696+0202160 exa dicpt   ;
260 1697 1103035 jmp L1565P   ;
261 1697+ ;
262 1697+0402160.1697P:sto dicpt   ;
263 1698 0040600 o02 token   ; @1698
264 1698+1003132 jmp .1626   ;
265 1699  ;
266 1699 0742171.1699:lzs W1145   ;
267 1699+1143244 jz .1700P   ;
268 1700 0602213 lod boolbit   ; @1700
269 1700+ .1700P:; 
270 1700+0102225 add Bbit   ;=<000/000>
271 1701 0102172 add Link15c   ;
272 1701+1103043 jmp L1571P   ;
273 1702  ;
274 1702  .1702:; 
275 1702 0402170 sto idpt1   ; @1702
276 1702+0602162 lod typeinfo   ;
277 1703 1043073 jz .1595   ;
278 1703+0602161 lod wsptr   ;
279 1704 0402174 sto W1148   ; @1704
280 1704+1003073 jmp .1595   ;
281 1705  ;
282 1705  L1705::; 
283 1705  ;
284 1705  .ent:; 
285 1705 0602167 lod W1143   ;
286 1705+0124314 sub K32a   ;
287 1706 1021222 jn gettoken.ent   ; @1706
288 1706+0602210 lod K7a   ;
289 1707 1661044_err16:lnk errlnk   ;error 16: array with >16 dims
290 1707+1001070 jmp Error   ;call error routine
291 1708  ;--------------------------------------------------------------------
292 1708  IntExprn::; 
293 1708  ; get integer expression, checking for simplest case etc.
294 1708  ; only used for subscripts so we can optimise slightly
295 1708  ;
296 1708  =2886 
297 2886  .ent:; 
298 2886   call     ; @2886
298+12886 7322411004503 lnk advance.lnk:jmp advance.ent 
299 2887  L2887:; 
300 2887  .2887:; 
301 2887 0605436 lod Variable.lnk   ;
302 2887+0000000 o00 0   ;
303 2888   call     ; @2888
303+12888 7323731005012 lnk push.lnk:jmp push.ent 
304 2889 0604340 lod K2b   ;=2
305 2889+0404300 sto W2240   ;
306 2890   call     ;check for simple variable or constant @2890
306+12890 7323761005054 lnk SimpleTerm.lnk:jmp SimpleTerm.ent 
307 2891 1025525 jn .2901   ;no, need more complex approach
308 2891+0603427 lod idptr   ;
309 2892 0064324 and T_Mask   ;=00700000000000 mask type bits @2892
310 2892+0124320 sub IntBit   ;=00200000000000 (integer)
311 2893 1145516 jz .2894P   ;value is integer
312 2893+1005525 jmp .2901   ;need conversion ?
313 2894  ;
314 2894 0000000 o00 0   ; @2894
315 2894+ ;
316 2894+0603427.2894P:lod idptr   ;
317 2895   call     ;
317+12895 7323731005012 lnk push.lnk:jmp push.ent 
318 2896   call     ;get next token @2896
318+12896 7322411004503 lnk advance.lnk:jmp advance.ent 
319 2897   call     ;see if arithmetic operator
319+12897 7323761005070 lnk TestArithOp.lnk:jmp TestArithOp.ent 
320 2898 1025073 jn Pop1   ;no, return via stack, simplest case @2898
321 2898+0040000 o02 0   ;=1
322 2899 2710646600000 o27 stkp/lod 0; pop item from stack
323 2900 0404303 sto W2243   ; @2900
324 2900+0444300 inc W2240   ;
325 2901  .2901:; 
326 2901   call     ;
326+12901 7323131004627 lnk expression.lnk:jmp expression.ent 
327 2902 0010646577777 o00 stkp/lod -1; @2902
328 2903 0404306 sto W2246   ;
329 2903+0124320 sub IntBit   ;
330 2904 1045534 jz .2908   ; @2904
331 2904+0604341 lod K3a   ;=3
332 2905   call     ;
332+12905 7320121004032 lnk gencode1.lnk:jmp gencode1.ent 
333 2906 0604320 lod IntBit   ; @2906
334 2906+0000000 o00 0   ;
335 2907 0010646377777 o00 stkp/sto -1;
336 2908  .2908:; 
337 2908   call     ; @2908
337+12908 7323761005021 lnk SaveTemp.lnk:jmp SaveTemp.ent 
338 2909 1005073 jmp Pop1   ;return via stack
339 2909+ ;
340 2909+ L2909P:; 
341 2909+ .2909P:; 
342 2909+0605436 lod Variable.lnk   ;
343 2910  .2910:; 
344 2910   call     ; @2910
344+12910 7323731005012 lnk push.lnk:jmp push.ent 
345 2911 0604341 lod K3a   ;=3
346 2911+0404300 sto W2240   ;
347 2912 1005525 jmp .2901   ; @2912
348 2912+ ;
349 2912+0000000 o00 0    
350 2913  ;
351 2913  ;--------------------------------------------------------------------