File: subscript.t2

For general comments see here
LineAddressObject Code LabelF1N1BF2N2CommentsCheck
1 0  ; tape1.d/subscript.t2
2 0  ;---------------------
3 0  ;
4 0  =2649 
5 2649  Subscript::; 
6 2649  ; an array identifier has been read in a context which expects a subscript.
7 2649  ;
8 2649  .ent:; 
9 2649 0442151 inc stkp   ; @2649
10 2649+0605077 lod .lnk   ;
11 2650 2210646377776 inc stkp/sto -2;store return address @2650
12 2651 2210646537777 inc stkp/cls -1;
13 2652 1661044_err25:lnk errlnk   ;error 25: missing ) after subscript @2652
14 2652+0603427 lod idptr   ;push id info to stack
15 2653   call     ;
15+12653 7323731005012 lnk push.lnk:jmp push.ent 
16 2654   call     ;get next token @2654
16+12654 7322411004503 lnk advance.lnk:jmp advance.ent 
17 2655 0600600 lod token   ;which should be a...
18 2655+0124323 sub K47   ;=47 [(]
19 2656 1145141 jz .ok1   ;OK, skip error @2656
20 2656+ _err26:; 
21 2656+1661044 lnk errlnk   ;error 26: missing bracket
22 2657 1004772 jmp error2   ;call error routine
23 2657+ ;
24 2657+0603430.ok1:lod W1816   ;get id pointer?
25 2658 0010646377775 o00 stkp/20 -3; @2658
26 2659  .loop1:; 
27 2659   call     ;get integer expression
27+12659 7326171005506 lnk IntExprn.lnk:jmp IntExprn.ent 
28 2660 0600600 lod token   ;check token @2660
29 2660+0124363 sub K41   ;=41 [,]
30 2661 1045143 jz .loop1   ;more subscripts
31 2661+0124364 sub K7b   ;=7 ->[)]
32 2662 1045147 jz .end1   ;end of subscript list @2662
33 2662+1004772 jmp error2   ;call error routine
34 2663  ;
35 2663 0604340.end1:lod K2b   ;=2
36 2663+0424300 stn W2240   ;allow for 2 entries basic overhead
37 2664 0602151 lod stkp   ; @2664
38 2664+0404305 sto W2245   ;temporary pointer into stack
39 2665  .loop2:; 
40 2665 0444300 inc W2240   ;bump counter
41 2665+0040000 o02 0   ;=1
42 2666 2721426600000 o27 W2245/lod 0;decrement temp stack ptr and load @2666
43 2667 1045154 jz .end2   ;start of subscript list
44 2667+1005151 jmp .loop2   ;loop until stopper found
45 2668  ;
46 2668 0604300.end2:lod W2240   ;get count @2668
47 2668+1320015 sll 13   ;shift to F2 position
48 2669 0404306 sto W2246   ;and save it
49 2669+1661044_err27:lnk errlnk   ;error 27: wrong number of subscripts
50 2670 0021426600001 o00 W2245/lod 1;get array variable info @2670
51 2671 0404031 sto IdInfo   ;
52 2671+0064365 and W2293   ;=<000:770> mask for F2
53 2672 1045162 jz .unset   ;zero? unknown @2672
54 2672+0124306 sub W2246   ;compare with number supplied
55 2673 1045165 jz .match   ;OK, go ahead
56 2673+1004772 jmp error2   ;call error routine
57 2674  ;
58 2674 0021426577777.unset:o00 W2245/lod -1;get real id pointer @2674
59 2675 0400004 sto 4   ;
60 2675+0604306 lod W2246   ;get supplied subscr count
61 2676 0000022477777 o00 4/ads -1;assume it's right, all later refs @2676
62 2677   ; must agree 
63 2677  .match:; 
64 2677 0604300 lod W2240   ;save subscr count
65 2677+0404306 sto W2246   ;for undoing stack when finished
66 2678 1105207 jmp .skip   ;-->> @2678
67 2678+ =2695+ 
68 2695+ .skip:; 
69 2695+0601425 lod errsw   ;any error so far
70 2696 1145166 jz .cont   ;no, continue @2696
71 2696+0601437 lod W799   ; film switch?
72 2697 1045212 jz .2698   ; to core?
73 2697+1105166 jmp .cont   ;-->>
74 2698  ;
75 2698  =2678+ 
76 2678+ .cont:; 
77 2678+0603523 lod GPs+46   ;=>GP1 30;GP7F 6,04
78 2679   call     ;lod array,call index1
78+12679 7320121004033 lnk gencode.lnk:jmp gencode.ent 
79 2680  .loop3:; 
80 2680 0040000 o02 0   ;=1 @2680
81 2680+0164300 bus W2240   ;decrement subscript number
82 2681 0404300 sto W2240   ;and save
83 2681+1045200 jz .end3   ;finished
84 2682 2221426600001 inc W2245/lod 1;get next subscript @2682
85 2683 0404031 sto IdInfo   ;
86 2683+0000000 o00 0   ;
87 2684   call     ;call 2601 @2684
87+12684 7323761005051 lnk FreeTemp.lnk:jmp FreeTemp.ent 
88 2685 0000000 o00 0   ;
89 2685+0603524 lod GPs+47   ;=>GP1 30;GP2F 7,44
90 2686   call     ;lod index,goto index2 @2686
90+12686 7320121004033 lnk gencode.lnk:jmp gencode.ent 
91 2687 1005170 jmp .loop3   ;and repeat
92 2687+  pad     ;
92+12687+0000000 00 0    
93 2688  ;
94 2688 2221426600001.end3:inc W2245/lod 1;get final subscript @2688
95 2689 0404031 sto IdInfo   ;store for Gencode
96 2689+  pad     ;
96+12689+0000000 00 0    
97 2690   call     ;mark free if temp @2690
97+12690 7323761005051 lnk FreeTemp.lnk:jmp FreeTemp.ent 
98 2691   pad     ;
98+12691 0000000 00 0    
99 2691+0603525 lod GPs+48   ;=>GP1 30;GP2F 8,44
100 2692   call     ;lod index,goto index3 @2692
100+12692 7320121004033 lnk gencode.lnk:jmp gencode.ent 
101 2693   call     ;discard closing )
101+12693 7322411004503 lnk advance.lnk:jmp advance.ent 
102 2694 0604347 lod K4a   ;=4 basic stack overhead @2694
103 2694+0104306 add W2246   ;add number of subscripts
104 2695 1007133 jmp UnwindN   ;unwind stack and return
105 2695+ ;
106 2695+ =2698 
107 2698  .2698:; 
108 2698 0044306 o02 W2246   ;
109 2698+1320001 sll 1   ;
110 2699 0101421 add W785   ;
111 2699+0404307 sto W2247   ;
112 2700 0127525 sub stkbase   ; @2700
113 2700+1125166 jn .cont   ;
114 2701   call     ;
114+12701 7306145002005 lnk L1029.lnk:jmp L1029.ent 
115 2702 0044307 o02 W2247   ; @2702
116 2702+0167525 bus stkbase   ;
117 2703 7306145022064 lnk L1026.lnk:jn L1026.1076;if < call 1076
118 2704 0604340 lod K2b   ;=2 @2704
119 2704+0104306 add W2246   ;
120 2705 0162151 bus stkp   ;
121 2705+0344305 stc W2245   ;
122 2706 1105166 jmp .cont   ; @2706
123 2706+ ;
124 2706+0000000 o00 0    
125 2707  ;--------------------------------------------------------------------