include "hdr1.html"; ?>
Line | Address | Object Code | Label | F1 | N1 | B | F2 | N2 | Comments | Check |
---|---|---|---|---|---|---|---|---|---|---|
1 | 0 | ; tape1.d/putcode.t2 | ||||||||
2 | 0 | ;------------------- | ||||||||
3 | 0 | putcode:: | ; | |||||||
4 | 0 | =831 | ||||||||
5 | 831 | ; | ||||||||
6 | 831 | ; PCdata is in 780, part word in 781, shift in 782 | ||||||||
7 | 831 | ; | ||||||||
8 | 831 | .ent: | ; | |||||||
9 | 831 | 0701416 | las | PCshift | ;shift count | @831 | ||||
10 | 831+ | 0401417 | sto | PCwk2 | ; | |||||
11 | 832 | 1101501 | .pat: | jmp | .1 | ;skip or return 00 830/jmp 1 | @832 | |||
12 | 832+ | 0000000 | o00 | 0 | ; | |||||
13 | 833 | 1101501 | jmp | .1 | ;no-op | |||||
14 | 833+ | 0601414 | .1: | lod | PCdata | ; | ||||
15 | 834 | 0006077320000 | o00 | PCwk2 | / | sll | 0 | ; shift left | @834 | |
16 | 835 | 0501415 | ads | work1 | ; | |||||
17 | 835+ | 0601416 | lod | PCshift | ;shift count | |||||
18 | 836 | 0121440 | sub | K39 | ;=39 | @836 | ||||
19 | 836+ | 1021534 | jn | .4 | ; ok, not yet full -> | |||||
20 | 837 | 0601425 | lod | errsw | ;ocode output to paper tape? | |||||
21 | 837+ | 1041514 | jz | .2 | ;->punch to p/t | |||||
22 | 838 | 0601440 | lod | K39 | ;=39 | @838 | ||||
23 | 838+ | 0561416 | o27 | PCshift | ;shift count | |||||
24 | 839 | 0621417 | lcs | PCwk2 | ; | |||||
25 | 839+ | 0601414 | lod | PCdata | ; | |||||
26 | 840 | 0006077220047 | o00 | PCwk2 | / | srl | 39 | ; | @840 | |
27 | 841 | 0201415 | exa | work1 | ; | |||||
28 | 841+ | 0501420 | ads | PCchk | ;add into sum-check | |||||
29 | 842 | call | ; store word in code area | @842 | ||||||
29+1 | 842 | 7306145002002 | lnk | L1026.lnk | : | jmp | L1026.ent | |||
30 | 843 | .ret: | ; | |||||||
31 | 843 | ret | ; | |||||||
31+1 | 843 | 0006373000001 | o00 | putcode.lnk | / | jmp | 1 | |||
32 | 844 | ; | ||||||||
33 | 844 | ; punch ocode word to paper tape | ||||||||
34 | 844 | .2: | ; | |||||||
35 | 844 | 0601441 | lod | K5 | ; | @844 | ||||
36 | 844+ | 0561416 | o27 | PCshift | ;shift count | |||||
37 | 845 | 0621417 | lcs | PCwk2 | ; | |||||
38 | 845+ | 0601414 | lod | PCdata | ; | |||||
39 | 846 | 0006077220005 | o00 | PCwk2 | / | srl | 5 | ; | @846 | |
40 | 847 | .3: | ; | |||||||
41 | 847 | 0201415 | exa | work1 | ; | |||||
42 | 847+ | 0061442 | and | K31 | ;=31 | |||||
43 | 848 | 2006077700000 | sto | PCwk2 | / | otp | 0 | ; punch ocode to p/t | @848 | |
44 | 849 | 0501420 | ads | PCchk | ;add into sum-check | |||||
45 | 849+ | .3a: | ; | |||||||
46 | 849+ | 0601416 | lod | PCshift | ;shift count | @849+ | ||||
47 | 850 | 0121441 | sub | K5 | ;=5 | @850 | ||||
48 | 850+ | 1021513 | jn | .ret | ;return | |||||
49 | 851 | 0401416 | sto | PCshift | ;shift count | |||||
50 | 851+ | 0601415 | lod | work1 | ; | |||||
51 | 852 | 1220005 | srl | 5 | ; | @852 | ||||
52 | 852+ | 1001517 | jmp | .3 | ;loop back | |||||
53 | 853 | ; | ||||||||
54 | 853 | 3406070401417 | L853: | las | PCshift | : | sto | PCwk2 | ;data for patching entry | |
55 | 854 | ;------------------------------------------------------------------- | ||||||||
56 | 854 | ; putOpcd: output ocode key (5-bit value) | ||||||||
57 | 854 | ; | ||||||||
58 | 854 | putOpcd.ent: | ; | |||||||
59 | 854 | 0401414 | sto | PCdata | ; | |||||
60 | 854+ | 0601443 | lod | K5a | ;=5 | |||||
61 | 855 | 1001477 | jmp | .ent | ; enter putcode proper | |||||
62 | 855+ | ; | ||||||||
63 | 855+ | putAddr.ent: | ; | |||||||
64 | 855+ | 0061450 | and | N2bits | ; | |||||
65 | 856 | 0401414 | sto | PCdata | ; | @856 | ||||
66 | 856+ | 0041444 | o02 | K12 | ;=12 | |||||
67 | 857 | 1001477 | jmp | .ent | ; | |||||
68 | 857+ | ;------------------------------------ | ||||||||
69 | 857+ | putcode6.ent: | ; | |||||||
70 | 857+ | 0040000 | o02 | 0 | ;=1 | |||||
71 | 858 | 1001613 | jmp | L907 | ;->907 | @858 | ||||
72 | 858+ | ;------------------------------------ | ||||||||
73 | 858+ | ; put full word to ocode stream | ||||||||
74 | 858+ | ; word in ACC | ||||||||
75 | 858+ | ; | ||||||||
76 | 858+ | putFwd.ent: | ; | |||||||
77 | 858+ | 0401414 | sto | PCdata | ; | @858+ | ||||
78 | 859 | 0601440 | lod | K39 | ;=39 number of bits to put | |||||
79 | 859+ | 1001477 | jmp | .ent | ; enter putcode proper | |||||
80 | 860 | ;-------------------------------------- | ||||||||
81 | 860 | 0601425 | .4: | lod | errsw | ; ocode to paper tape? | @860 | |||
82 | 860+ | 1141521 | jz | .3a | ; | |||||
83 | 861 | 1001513 | jmp | .ret | ;return to caller | |||||
84 | 861+ | ; | ||||||||
85 | 861+ | 0000000 | o00 | 0 | ; | @861+ | ||||
86 | 862 | ;------------------------------------------------------------------- | ||||||||
87 | 862 | ; initialise working variables for putcode | ||||||||
88 | 862 | ; | ||||||||
89 | 862 | InitPutCode.ent: | ; | |||||||
90 | 862 | 0541415 | cls | work1 | ; | @862 | ||||
91 | 862+ | 0541416 | cls | PCshift | ;shift count | |||||
92 | 863 | 0541424 | cls | W788 | ; | |||||
93 | 863+ | 0541426 | cls | W790 | ; | |||||
94 | 864 | 0541616 | cls | W910 | ; | @864 | ||||
95 | 864+ | 0541617 | cls | W911 | ; | |||||
96 | 865 | 0541420 | cls | PCchk | ;clear sum-check | |||||
97 | 865+ | 0601425 | lod | errsw | ; | |||||
98 | 866 | 1041565 | jz | .ptap1 | ; | @866 | ||||
99 | 866+ | 0601471 | lod | EndCode | ;data to be output 5:13,5:15 | |||||
100 | 867 | 0401414 | sto | PCdata | ;store for putcode | |||||
101 | 867+ | 0041451 | o02 | K9 | ;=9+1=>10 | |||||
102 | 868 | 1001477 | .868: | jmp | .ent | ;add 10-bit data to ocode | @868 | |||
103 | 868+ | ; | ||||||||
104 | 868+ | =885 | ||||||||
105 | 885 | ; | ||||||||
106 | 885 | .ptap1: | ; | |||||||
107 | 885 | 0601440 | lod | K39 | ;=39 | |||||
108 | 885+ | 0421422 | stn | GenAdr | ;set count=-39 | |||||
109 | 886 | 1700000 | .lp1: | otp | 0 | ;blank tape (40 blanks) | @886 | |||
110 | 886+ | 0641422 | lis | GenAdr | ;count | |||||
111 | 887 | 1021566 | jn | .lp1 | ;repeat | |||||
112 | 887+ | 1700017 | otp | 15 | ;output ocode key=15 (end of program marker) | |||||
113 | 888 | 0041444 | o02 | K12 | ;=12+1=>13 | @888 | ||||
114 | 888+ | 1001526 | jmp | putOpcd.ent | ;output ocode key=13 (check sumcheck) | |||||
115 | 889 | ;--------------------------------------------------------------------------- | ||||||||
116 | 889 | ; ClosePC: close the ocode stream at end of compilation | ||||||||
117 | 889 | ; write sumcheck and padding | ||||||||
118 | 889 | ; | ||||||||
119 | 889 | =868+ | ||||||||
120 | 868+ | ; | ||||||||
121 | 868+ | ClosePC:: | ; | |||||||
122 | 868+ | ; | ||||||||
123 | 868+ | 0000000 | o00 | 0 | ;unused? | @868+ | ||||
124 | 869 | 0000000 | o00 | 0 | ;unused?? | |||||
125 | 869+ | ; | ||||||||
126 | 869+ | 0601420 | .ent: | lod | PCchk | ;get sumcheck value | ||||
127 | 870 | call | ;output to ocode stream | @870 | ||||||
127+1 | 870 | 7306371101532 | lnk | putFwd.lnk | : | jmp | putFwd.ent | |||
128 | 871 | 0601457 | lod | K22 | ;=22 ocode key for sumcheck | |||||
129 | 871+ | 0000000 | o00 | 0 | ; | |||||
130 | 872 | call | ;output key | @872 | ||||||
130+1 | 872 | 7306371001526 | lnk | putOpcd.lnk | : | jmp | putOpcd.ent | |||
131 | 873 | 0601425 | lod | errsw | ;is output to paper tape? | |||||
132 | 873+ | 1041560 | jz | .1 | ;yes, only pad to 5 bits | |||||
133 | 874 | 0601440 | lod | K39 | ;=39 | @874 | ||||
134 | 874+ | 0121416 | sub | PCshift | ;shift count - number of spare bits | |||||
135 | 875 | 0401422 | sto | GenAdr | ;save for below | |||||
136 | 875+ | 0541414 | cls | PCdata | ;write zero bits | |||||
137 | 876 | call | ;write padding bits to fill word | @876 | ||||||
137+1 | 876 | 7306371001477 | lnk | putcode.lnk | : | jmp | putcode.ent | |||
138 | 877 | 0601422 | lod | GenAdr | ;length of padding | |||||
139 | 877+ | 0000000 | o00 | 0 | ; | |||||
140 | 878 | call | ;write word to core/tape/film | @878 | ||||||
140+1 | 878 | 7306145002002 | lnk | L1026.lnk | : | jmp | L1026.ent | |||
141 | 879 | .ret: | ret | ; | ||||||
141+1 | 879 | 0006117000001 | o00 | ClosePC.lnk | / | jmp | 1 | |||
142 | 880 | ; | ||||||||
143 | 880 | ; pad to paper tape | ||||||||
144 | 880 | ; | ||||||||
145 | 880 | 0601441 | .1: | lod | K5 | ;=5 | @880 | |||
146 | 880+ | 0121416 | sub | PCshift | ;shift count | |||||
147 | 881 | 0401422 | sto | GenAdr | ;save padding length | |||||
148 | 881+ | 0541414 | cls | PCdata | ;clear data | |||||
149 | 882 | call | ;write padding | @882 | ||||||
149+1 | 882 | 7306371001477 | lnk | putcode.lnk | : | jmp | putcode.ent | |||
150 | 883 | 0006113700000 | o00 | GenAdr | / | otp | 0 | ;add padd length | ||
151 | 884 | 1700037 | otp | 31 | ;letter shift/marker | @884 | ||||
152 | 884+ | 1001557 | jmp | .ret | ; | |||||
153 | 885 | ; | ||||||||
154 | 885 | ;------------------------------------------------------------------- | ||||||||
155 | 885 | ; | ||||||||
156 | 885 | =889 | ||||||||
157 | 889 | ; | ||||||||
158 | 889 | GenFinish:: | ; | |||||||
159 | 889 | .1: | call | ; | @889 | |||||
159+1 | 889 | 7307175001622 | lnk | SetCodePtr.lnk | : | jmp | SetCodePtr.ent | |||
160 | 890 | 0000000 | o00 | 0 | ; | |||||
161 | 890+ | 0601452 | lod | K3 | ;=3 | |||||
162 | 891 | 0401430 | sto | W792 | ; | |||||
163 | 891+ | 0602145 | lod | ObjPC | ;program counter | |||||
164 | 892 | call | ; | @892 | ||||||
164+1 | 892 | 7307175001630 | lnk | GenSetBase.lnk | : | jmp | GenSetBase.ent | |||
165 | 893 | 0601617 | lod | W911 | ;display size | |||||
166 | 893+ | 0401414 | sto | PCdata | ; | |||||
167 | 894 | 0041454 | o02 | K7 | ;=7+1=>8 | @894 | ||||
168 | 894+ | nop | ; | |||||||
168+1 | 894+ | 1001577 | jmp | .1 | ||||||
168+2 | 895 | .1: | ; | |||||||
169 | 895 | call | ;output display size | |||||||
169+1 | 895 | 7306371001477 | lnk | putcode.lnk | : | jmp | putcode.ent | |||
170 | 896 | 0601424 | lod | W788 | ;patch list size | @896 | ||||
171 | 896+ | 0061450 | and | N2bits | ; | |||||
172 | 897 | 0401414 | sto | PCdata | ; | |||||
173 | 897+ | 0041454 | o02 | K7 | ;=7+1=>8 | |||||
174 | 898 | call | ;output patch list size | @898 | ||||||
174+1 | 898 | 7306371001477 | lnk | putcode.lnk | : | jmp | putcode.ent | |||
175 | 899 | nop | ; | |||||||
175+1 | 899 | 1101603 | jmp | .1 | ||||||
175+2 | 899+ | .1: | ; | |||||||
176 | 899+ | 0602147 | lod | W1127 | ;Data Size | |||||
177 | 900 | call | ; | @900 | ||||||
177+1 | 900 | 7306371101527 | lnk | putAddr.lnk | : | jmp | putAddr.ent | |||
178 | 901 | 0602143 | lod | W1123 | ; | |||||
179 | 901+ | 0102145 | add | ObjPC | ;program counter | |||||
180 | 902 | call | ; | @902 | ||||||
180+1 | 902 | 7306371101527 | lnk | putAddr.lnk | : | jmp | putAddr.ent | |||
181 | 903 | 0601447 | lod | K17 | ;=17 | |||||
182 | 903+ | nop | ; | |||||||
182+1 | 903+ | 1001610 | jmp | .1 | ||||||
182+2 | 904 | .1: | ; | |||||||
183 | 904 | call | ;output SetProgSize key | @904 | ||||||
183+1 | 904 | 7306371001526 | lnk | putOpcd.lnk | : | jmp | putOpcd.ent | |||
184 | 905 | call | ;close down ocode stream | |||||||
184+1 | 905 | 7306115101545 | lnk | ClosePC.lnk | : | jmp | ClosePC.ent | |||
185 | 906 | 0010613000001 | o00 | Link15d | / | jmp | 1 | ; | @906 | |
186 | 907 | ;----------------- | ||||||||
187 | 907 | ; | ||||||||
188 | 907 | L907: | ; | |||||||
189 | 907 | 0761616 | .907: | o37 | W910 | ; | @907 | |||
190 | 907+ | 0121617 | sub | W911 | ; | |||||
191 | 908 | 1021615 | jn | L909 | ; | |||||
192 | 908+ | 0501617 | ads | W911 | ; | |||||
193 | 909 | L909: | ; | |||||||
194 | 909 | 0041451 | .909: | o02 | K9 | ;=9 | ||||
195 | 909+ | 1001526 | jmp | putOpcd.ent | ;-> | |||||
196 | 910 | ;----------------------------------------------------- | ||||||||
197 | 910 | 0000000000000 | W910: | +0 | ; | @910 | ||||
198 | 911 | 0000000000001 | W911: | +1 | ; | @911 | ||||
199 | 912 | ; | ||||||||
200 | 912 | ; no refs | ||||||||
201 | 912 | ; | ||||||||
202 | 912 | ;L912: | ||||||||
203 | 912 | 0541616 | cls | W910 | ; | @912 | ||||
204 | 912+ | 0541617 | cls | W911 | ; | |||||
205 | 913 | 1001544 | jmp | putcode.868 | ; | |||||
206 | 913+ | ; | ||||||||
207 | 913+ | 0000000 | o00 | 0 | ; | |||||
208 | 914 | ;------------------------------------------------------------------- | ||||||||
209 | 914 | SetCodePtr:: | ; | |||||||
210 | 914 | =914 | ||||||||
211 | 914 | ; | ||||||||
212 | 914 | ; Output Set Code Ptr ocode items | ||||||||
213 | 914 | .ent: | ; | |||||||
214 | 914 | call | ;round off last word | @914 | ||||||
214+1 | 914 | 7307255001654 | lnk | putNop.lnk | : | jmp | putNop.ent | |||
215 | 915 | 0602145 | lod | ObjPC | ;program counter | |||||
216 | 915+ | 0121461 | sub | K1 | ; | |||||
217 | 916 | call | ;output type 1 entry for code size | |||||||
217+1 | 916 | 7307445001761 | lnk | NopRef.lnk | : | jmp | NopRef.ent | |||
218 | 917 | 0041455 | o02 | K15a | ;=15+1=>16 type 16 ocode entry | @917 | ||||
219 | 917+ | 0000000 | o00 | 0 | ||||||
220 | 918 | L918: | ; | |||||||
221 | 918 | .918: | call | ;output key=16/17 | @918 | |||||
221+1 | 918 | 7306371001526 | lnk | putOpcd.lnk | : | jmp | putOpcd.ent | |||
222 | 919 | .ret: | ret | ;return | ||||||
222+1 | 919 | 0007177000001 | o00 | SetCodePtr.lnk | / | jmp | 1 | |||
223 | 920 | ; | ||||||||
224 | 920 | ;------------------------------------------------------------------- | ||||||||
225 | 920 | GenSetBase:: | ; | |||||||
226 | 920 | ; output SetBase ocode item, acc contains value, W792 contains | ||||||||
227 | 920 | ; base id. | ||||||||
228 | 920 | ; | ||||||||
229 | 920 | .ent: | ; | |||||||
230 | 920 | call | ; | @920 | ||||||
230+1 | 920 | 7307445001761 | lnk | NopRef.lnk | : | jmp | NopRef.ent | |||
231 | 921 | 0601430 | lod | W792 | ; | |||||
232 | 921+ | 0121424 | sub | W788 | ; | |||||
233 | 922 | 1121633 | jn | .923P | ; | @922 | ||||
234 | 922+ | 0501424 | ads | W788 | ; | |||||
235 | 923 | 0000000 | o00 | 0 | ; | |||||
236 | 923+ | 0601430 | .923P: | lod | W792 | ; | ||||
237 | 924 | 0401414 | sto | PCdata | ; | @924 | ||||
238 | 924+ | 0041454 | o02 | K7 | ; | |||||
239 | 925 | call | ; | |||||||
239+1 | 925 | 7306371001477 | lnk | putcode.lnk | : | jmp | putcode.ent | |||
240 | 926 | 0041447 | o02 | K17 | ;=17 set ocode key for PutOpcd | @926 | ||||
241 | 926+ | 1001626 | jmp | L918 | ;join previous code for output | |||||
242 | 927 | ;-------------------------------------------------------------- | ||||||||
243 | 927 | ; return address moved higher to avoid fwd refs | ||||||||
244 | 927 | =928 | ||||||||
245 | 928 | GenInst:: | ; | |||||||
246 | 928 | ; | ||||||||
247 | 928 | ; instruction information in Acc, call PutInst, then update things | ||||||||
248 | 928 | ; such as even/odd address flag. If instruction includes B-bit | ||||||||
249 | 928 | ; make sure aligned correctly to start, and output ocode to add | ||||||||
250 | 928 | ; B-bit into final code. | ||||||||
251 | 928 | ; | ||||||||
252 | 928 | .ent: | ; | |||||||
253 | 928 | 0401423 | sto | Link9 | ; | @928 | ||||
254 | 928+ | 0061456 | and | B20 | ;=0000002000000 test if B-bit set | |||||
255 | 929 | 1141642 | jz | GenInst1.ent | ; if zero -> no | |||||
256 | 929+ | 1001666 | jmp | .950 | ; ->make sure we're at an even address | |||||
257 | 930 | ; ; returns to GenInst1.ent | ||||||||
258 | 930 | ; | ||||||||
259 | 930 | 0000000 | o00 | 0 | ; | @930 | ||||
260 | 930+ | ; | ||||||||
261 | 930+ | GenInst1.ent: | ; | |||||||
262 | 930+ | 0601423 | lod | Link9 | ;reload saved info | @930+ | ||||
263 | 931 | call | ;output it | |||||||
263+1 | 931 | 7307445001712 | lnk | PutInst.lnk | : | jmp | PutInst.ent | |||
264 | 932 | 0601453 | .1: | lod | B39 | ;=04000000000000 | ||||
265 | 932+ | 0701426 | las | W790 | ;toggle W790 (odd-even inst flag) | |||||
266 | 933 | 1021652 | jn | .2 | ;top half, no need to test for B-modify | |||||
267 | 933+ | 0601423 | lod | Link9 | ;reload saved instruction | |||||
268 | 934 | 0061456 | and | B20 | ;=0000002000000 is B-bit set | @934 | ||||
269 | 934+ | 1041651 | jz | .ret | ;no, skip | |||||
270 | 935 | 0041467 | o02 | K24 | ;=24+1=>25 | |||||
271 | 935+ | 0000000 | o00 | 0 | ; | |||||
272 | 936 | call | ;generate opcd(25) to set B-bit | @936 | ||||||
272+1 | 936 | 7306371001526 | lnk | putOpcd.lnk | : | jmp | putOpcd.ent | |||
273 | 937 | ; from 934+ | ||||||||
274 | 937 | .ret: | ret | ; | @937 | |||||
274+1 | 937 | 0007177000001 | o00 | GenInst.lnk | / | jmp | 1 | |||
275 | 938 | ;----------------- | ||||||||
276 | 938 | 0442145 | .2: | inc | ObjPC | ;program counter | ||||
277 | 938+ | 1001651 | jmp | .ret | ; | |||||
278 | 939 | ;--------------------------------------------------------------- | ||||||||
279 | 939 | ; | ||||||||
280 | 939 | putNop:: | ; | |||||||
281 | 939 | ; | ||||||||
282 | 939 | ; | ||||||||
283 | 939 | ;----------------- | ||||||||
284 | 939 | ; if (W790 < 0), output a type 8 entry to ocode stream | ||||||||
285 | 939 | ; clearing W790. Otherwise just return. Effect is to force | ||||||||
286 | 939 | ; next instruction to top half of word | ||||||||
287 | 939 | ; | ||||||||
288 | 939 | =940 | ||||||||
289 | 940 | .ent: | ; | |||||||
290 | 940 | 0741426 | lzs | W790 | ; | @940 | ||||
291 | 940+ | 1121656 | jn | .1 | ;-> | |||||
292 | 941 | .ret: | ret | ; | ||||||
292+1 | 941 | 0007257000001 | o00 | putNop.lnk | / | jmp | 1 | |||
293 | 942 | ; | ||||||||
294 | 942 | 0000000 | o00 | 0 | ; | |||||
295 | 942+ | ; | ||||||||
296 | 942+ | 0041454 | .1: | o02 | K7 | ;=7+1 => 8 | @942+ | |||
297 | 943 | call | ;output type 8 opcode | |||||||
297+1 | 943 | 7306371001526 | lnk | putOpcd.lnk | : | jmp | putOpcd.ent | |||
298 | 944 | 0442145 | inc | ObjPC | ;? | |||||
299 | 944+ | 1001655 | jmp | .ret | ;->return | |||||
300 | 945 | ;------------------------------------------------------------------- | ||||||||
301 | 945 | ; output ocode to patch a jump into the switch lists | ||||||||
302 | 945 | ; Acc contains destination address info | ||||||||
303 | 945 | ; | ||||||||
304 | 945 | LabRef: | ; | |||||||
305 | 945 | call | ;generate reference address | |||||||
305+1 | 945 | 7307445001761 | lnk | NopRef.lnk | : | jmp | NopRef.ent | |||
306 | 946 | 0601444 | lod | K12 | ;=12 (patch switch list) | |||||
307 | 946+ | 0000000 | o00 | 0 | ; | |||||
308 | 947 | call | ;output ocode operator | @947 | ||||||
308+1 | 947 | 7306371001526 | lnk | putOpcd.lnk | : | jmp | putOpcd.ent | |||
309 | 948 | 1001651 | jmp | GenInst.ret | ;and return | |||||
310 | 948+ | ; | ||||||||
311 | 948+ | 0000000 | o00 | 0 | ; | |||||
312 | 949 | ;------------------------------------------------------------------- | ||||||||
313 | 949 | GenInst:: | ; | |||||||
314 | 949 | GenSkpInst.ent: | ; | |||||||
315 | 949 | 0401423 | sto | Link9 | ; | @949 | ||||
316 | 949+ | 0000000 | o00 | 0 | ; | |||||
317 | 950 | .950: | call | ; | @950 | |||||
317+1 | 950 | 7307255001654 | lnk | putNop.lnk | : | jmp | putNop.ent | |||
318 | 951 | 1101642 | jmp | GenInst1.ent | ; | |||||
319 | 951+ | ; | ||||||||
320 | 951+ | 0000000 | o00 | 0 | ; | |||||
321 | 952 | ;---------------------------------------------------- | ||||||||
322 | 952 | ; | ||||||||
323 | 952 | L952:: | ; | |||||||
324 | 952 | ; output half-word instruction (passed in Acc) ?? | ||||||||
325 | 952 | ; | ||||||||
326 | 952 | .ent: | ; | |||||||
327 | 952 | 0401422 | sto | GenAdr | ; | @952 | ||||
328 | 952+ | 0401423 | sto | Link9 | ; | |||||
329 | 953 | call | ; | |||||||
329+1 | 953 | 7307445001755 | lnk | L1005.lnk | : | jmp | L1005.ent | |||
330 | 954 | ret | ; | @954 | ||||||
330+1 | 954 | 0007257000001 | o00 | L952.lnk | / | jmp | 1 | |||
331 | 955 | ; | ||||||||
332 | 955 | ;------------------------------------------------------------------- | ||||||||
333 | 955 | ; | ||||||||
334 | 955 | L958:: | ; | |||||||
335 | 955 | ; | ||||||||
336 | 955 | L955: | ; | |||||||
337 | 955 | 0000000000000 | W955: | +0 | ; | @955 | ||||
338 | 956 | 0000000000000 | W956: | +0 | ; | @956 | ||||
339 | 957 | ; | ||||||||
340 | 957 | ; output full word as two instructions - assume B-bit not set! | ||||||||
341 | 957 | ; aligns object code to full word first | ||||||||
342 | 957 | ; | ||||||||
343 | 957 | =958 | ||||||||
344 | 958 | .ent: | ; | |||||||
345 | 958 | 0401674 | sto | W956 | ;save word | @958 | ||||
346 | 958+ | 0000000 | o00 | 0 | ; | |||||
347 | 959 | call | ;align if needed | |||||||
347+1 | 959 | 7307255001654 | lnk | putNop.lnk | : | jmp | putNop.ent | |||
348 | 960 | 0601674 | lod | W956 | ;reload word | @960 | ||||
349 | 960+ | 1220024 | srl | 20 | ;shift top half down | |||||
350 | 961 | call | ;and output it | |||||||
350+1 | 961 | 7307175001705 | lnk | L965.lnk | : | jmp | L965.ent | |||
351 | 962 | 0601674 | lod | W956 | ;reload word again | @962 | ||||
352 | 962+ | 0061470 | and | W824 | ;=0x7FFFF mask out bottom half | |||||
353 | 963 | call | ;output that | |||||||
353+1 | 963 | 7307175001705 | lnk | L965.lnk | : | jmp | L965.ent | |||
354 | 964 | ret | ; | @964 | ||||||
354+1 | 964 | 0007367000001 | o00 | L958.lnk | / | jmp | 1 | |||
355 | 965 | ;------------------------------------------------------------------- | ||||||||
356 | 965 | L965:: | ; | |||||||
357 | 965 | ; | ||||||||
358 | 965 | .ent: | ; | |||||||
359 | 965 | call | ; | @965 | ||||||
359+1 | 965 | 7307255001670 | lnk | L952.lnk | : | jmp | L952.ent | |||
360 | 966 | 1001644 | jmp | GenInst.1 | ; | |||||
361 | 966+ | ; | ||||||||
362 | 966+ | 0000000 | o00 | 0 | ; | |||||
363 | 967 | ; no refs | ||||||||
364 | 967 | ; | ||||||||
365 | 967 | 0601466 | lod | K19 | ; | @967 | ||||
366 | 967+ | 1001477 | jmp | putcode.ent | ; | |||||
367 | 968 | ; no refs | ||||||||
368 | 968 | ; | ||||||||
369 | 968 | 0041454 | o02 | K7 | ;=7 | @968 | ||||
370 | 968+ | 1001673 | jmp | L955 | ; ??? data area ??? | |||||
371 | 969 | ;-------------------------------------------------------------- | ||||||||
372 | 969 | ; output an instruction to ocode stream, | ||||||||
373 | 969 | ; opcode + flags are in Acc, | ||||||||
374 | 969 | PutInst:: | ; | |||||||
375 | 969 | ; | ||||||||
376 | 969 | =970 | ||||||||
377 | 970 | .ent: | ; | |||||||
378 | 970 | 0401423 | sto | Link9 | ;save instruction+flags | @970 | ||||
379 | 970+ | 0061454 | and | K7 | ;=7 | |||||
380 | 971 | 2000023001763 | sto | 4 | / | jmp | .sw | ;switch | ||
381 | 972 | ; | ||||||||
382 | 972 | =1011 | ||||||||
383 | 1011 | ; switch list used above (971) moved nearer to in-line | ||||||||
384 | 1011 | .sw: | ; | |||||||
385 | 1011 | 0041454 | o02 | K7 | ;=7+1=>8 +0 | @1011 | ||||
386 | 1011+ | 1001721 | jmp | .977 | ;put opcode 8 (NULL) | |||||
387 | 1012 | 0041443 | o02 | K5a | ;=5+1=>6 +1 | @1012 | ||||
388 | 1012+ | 1001723 | jmp | .979 | ; cond jump (pop) | |||||
389 | 1013 | 0601454 | lod | K7 | ;=7 +2 | @1013 | ||||
390 | 1013+ | 1101723 | jmp | .979P | ; cond jump (nopop) | |||||
391 | 1014 | 0601451 | lod | K9 | ;=9 +3 | @1014 | ||||
392 | 1014+ | 1001721 | jmp | .977 | ;put opcode (else jump) | |||||
393 | 1015 | 0601467 | lod | K24 | ;=24 +4 | @1015 | ||||
394 | 1015+ | 1001714 | jmp | .972 | ;instruction reference | |||||
395 | 1016 | 0601423 | lod | Link9 | ;saved instn +5 | @1016 | ||||
396 | 1016+ | 1001727 | jmp | .983 | ; | |||||
397 | 1017 | 0601422 | lod | GenAdr | ;address +6 | @1017 | ||||
398 | 1017+ | 1101730 | jmp | .984P | ; | |||||
399 | 1018 | 0041457 | o02 | K22 | ;=22+1=>23 +7 | @1018 | ||||
400 | 1018+ | 1001714 | jmp | .972 | ||||||
401 | 1019 | ;-------------------------------- | ||||||||
402 | 1019 | =972 | ||||||||
403 | 972 | ; | ||||||||
404 | 972 | ; types 4 + 7 entries comes here with Acc= 24 + 23 (instruction reference, table ref) | ||||||||
405 | 972 | ; also some type 6 can come here with Acc=5 (constant reference) | ||||||||
406 | 972 | ; | ||||||||
407 | 972 | 0401427 | .972: | sto | W791 | ;save opcode | @972 | |||
408 | 972+ | 0601423 | lod | Link9 | ;get instruction | |||||
409 | 973 | 1220015 | srl | 13 | ;shift opcode down | |||||
410 | 973+ | 0061460 | and | K63 | ;=63 mask it out | |||||
411 | 974 | 0401414 | sto | PCdata | ;and save it for putcode | @974 | ||||
412 | 974+ | 0041443 | o02 | K5a | ;=5+1=>6 bits for opcode | |||||
413 | 975 | ; everything else with operands comes in here | ||||||||
414 | 975 | .975: | call | ;output data | ||||||
414+1 | 975 | 7306371001477 | lnk | putcode.lnk | : | jmp | putcode.ent | |||
415 | 976 | 0601427 | lod | W791 | ;re-load saved opcode | @976 | ||||
416 | 976+ | 0000000 | o00 | 0 | ; | |||||
417 | 977 | ; types 0 + 3 come here with Acc=8 + 9 respectively (null, elsejump) | ||||||||
418 | 977 | .977: | call | ;output opcode | ||||||
418+1 | 977 | 7306371001526 | lnk | putOpcd.lnk | : | jmp | putOpcd.ent | |||
419 | 978 | ret | ;return | @978 | ||||||
419+1 | 978 | 0007447000001 | o00 | PutInst.lnk | / | jmp | 1 | |||
420 | 979 | ; | ||||||||
421 | 979 | ; type 1 comes here with Acc=6 (cond jump pop) | ||||||||
422 | 979 | 0441616 | .979: | inc | W910 | ; | ||||
423 | 979+ | ; type 2 comes here with Acc=7 (cond jump nopop) | ||||||||
424 | 979+ | 0401427 | .979P: | sto | W791 | ;save opcode | ||||
425 | 980 | 0601423 | lod | Link9 | ;get instruction | @980 | ||||
426 | 980+ | 1220015 | srl | 13 | ;shift opcode down | |||||
427 | 981 | 0061452 | and | K3 | ;=3 mask off condition bits | |||||
428 | 981+ | 0401414 | sto | PCdata | ;store data | |||||
429 | 982 | 0041461 | o02 | K1 | ;=1+1=>2 bits needed | @982 | ||||
430 | 982+ | 1001717 | jmp | .975 | ;generate modifier bits, then opcode | |||||
431 | 983 | ; type 5 comes here | ||||||||
432 | 983 | 1220024 | .983: | srl | 20 | ;shift instn down | ||||
433 | 983+ | 0401422 | sto | GenAdr | ;save it for later | |||||
434 | 984 | 1001755 | jmp | L1005.ent | ;?? | |||||
435 | 984+ | ; | ||||||||
436 | 984+ | ; type 6 comes here | ||||||||
437 | 984+ | .984P: | ; | |||||||
438 | 984+ | 0061462 | and | B1920 | ;=0000003000000 <000/400> | @984+ | ||||
439 | 985 | 1041733 | jz | .987 | ; zero-> | |||||
440 | 985+ | 0000000 | o00 | 0 | ; no-op | |||||
441 | 986 | 0601422 | lod | GenAdr | ;reload GenAdr | @986 | ||||
442 | 986+ | 1001737 | jmp | .991 | ; | |||||
443 | 987 | ; | ||||||||
444 | 987 | 0601422 | .987: | lod | GenAdr | ;reload GenAdr | ||||
445 | 987+ | 0061450 | and | N2bits | ;mask address part | |||||
446 | 988 | 2000022600000 | sto | 4 | / | lod | 0 | ;fetch item at address | @988 | |
447 | 989 | call | ;process it | |||||||
447+1 | 989 | 7306371001773 | lnk | putcode5.lnk | : | jmp | putcode5.ent | |||
448 | 990 | 0601443 | lod | K5a | ;=5 | @990 | ||||
449 | 990+ | 1001714 | jmp | .972 | ;handle as a constant reference | |||||
450 | 991 | ; | ||||||||
451 | 991 | .991: | ; | |||||||
452 | 991 | 0061463 | and | B2128 | ;=0001774000000 <001023:000> | @991 | ||||
453 | 991+ | 1041755 | jz | .1005 | ; zero -> | |||||
454 | 992 | 1220024 | srl | 20 | ; shift right | @992 | ||||
455 | 992+ | 1101756 | jmp | .1006P | ;-> | |||||
456 | 993 | ; | ||||||||
457 | 993 | .993: | ; | |||||||
458 | 993 | 0541427 | cls | W791 | ;clear 791 | @993 | ||||
459 | 993+ | 0601452 | lod | K3 | ;=3 | |||||
460 | 994 | call | ;putcode(3) output relocation id | |||||||
460+1 | 994 | 7306371001477 | lnk | putcode.lnk | : | jmp | putcode.ent | |||
461 | 995 | 0601422 | .995: | lod | GenAdr | ; | @995 | |||
462 | 995+ | 0061450 | and | N2bits | ;=0017777 | |||||
463 | 996 | 0401414 | sto | PCdata | ;save data for putcode | @996 | ||||
464 | 996+ | 0062253 | and | B6.13 | ;=0017740 mask to see if 5 bits is enough | |||||
465 | 997 | 1041751 | jz | .1001 | ;yes, use short form | @997 | ||||
466 | 997+ | 0041461 | o02 | K1 | ;=1+1=>2 | |||||
467 | 998 | 0501427 | .998: | ads | W791 | ;change opcode +2 | @998 | |||
468 | 998+ | 0601423 | .998P: | lod | Link9 | ;reload instruction | ||||
469 | 999 | 0061465 | and | F2mask | ;=<:77 0> | @999 | ||||
470 | 999+ | 0501414 | ads | PCdata | ;add to address | |||||
471 | 1000 | 0601466 | lod | K19 | ;19 bits in total | @1000 | ||||
472 | 1000+ | 1001717 | jmp | .975 | ;write to ocode stream | |||||
473 | 1001 | ; use short form ocode entry (1,3) | ||||||||
474 | 1001 | ; | ||||||||
475 | 1001 | 0040000 | .1001: | o02 | 0 | ;=1 | @1001 | |||
476 | 1001+ | 0501427 | ads | W791 | ;change opcode by +1 | |||||
477 | 1002 | 0601423 | .1002: | lod | Link9 | ;get instruction | @1002 | |||
478 | 1002+ | 0061465 | and | F2mask | ;=<:77 0> | |||||
479 | 1003 | 1220010 | srl | 8 | ; >> 8 | |||||
480 | 1003+ | 0501414 | ads | PCdata | ;add to address (<32) | |||||
481 | 1004 | 0602231 | lod | K11 | ;6+5 bits | @1004 | ||||
482 | 1004+ | 1001717 | jmp | .975 | ;and write to ocode stream | |||||
483 | 1005 | ; | ||||||||
484 | 1005 | L1005.ent: | ; | |||||||
485 | 1005 | 0041461 | .1005: | o02 | K1 | ;=2 large reloc | @1005 | |||
486 | 1005+ | 0401427 | sto | W791 | ;store key for putcode | |||||
487 | 1006 | 1001743 | jmp | .995 | ; | @1006 | ||||
488 | 1006+ | ; | ||||||||
489 | 1006+ | ; process relocation id | ||||||||
490 | 1006+ | .1006P: | ; | |||||||
491 | 1006+ | 0401414 | sto | PCdata | ; | @1006+ | ||||
492 | 1007 | 0061464 | and | K4088 | ;=07770 check if 3 bits enough | |||||
493 | 1007+ | 1041741 | jz | .993 | ; zero ->yes, use short ocode | |||||
494 | 1008 | 0041454 | o02 | K7 | ;=7+1=8 | @1008 | ||||
495 | 1008+ | 1001776 | jmp | .1022 | ;output 8-bit reloc id | |||||
496 | 1009 | ; | ||||||||
497 | 1009 | ; generate No-op reference <00 addr>, address info in Acc | ||||||||
498 | 1009 | ; | ||||||||
499 | 1009 | NopRef.ent: | ; | |||||||
500 | 1009 | 0541423 | .1009: | cls | Link9 | ;make instn <00 0> | ||||
501 | 1009+ | 0401422 | sto | GenAdr | ;save address info | |||||
502 | 1010 | 1001771 | jmp | .sw+6 | ;enter PutInst at type 6 | @1010 | ||||
503 | 1010+ | ; | ||||||||
504 | 1010+ | 0000000 | o00 | 0 | ; | |||||
505 | 1011 | ;-------------------------------------------------------------------- | ||||||||
506 | 1011 | ; | ||||||||
507 | 1011 | =1019 | ||||||||
508 | 1019 | putcode5.ent: | ; | |||||||
509 | 1019 | 1041774 | jz | .1020 | ; | @1019 | ||||
510 | 1019+ | 1101532 | jmp | putFwd.ent | ;output full-word to ocode | |||||
511 | 1020 | ; | ||||||||
512 | 1020 | 0601452 | .1020: | lod | K3 | ;=3 small absolute value | @1020 | |||
513 | 1020+ | 0401427 | sto | W791 | ;store key | |||||
514 | 1021 | 0541414 | cls | PCdata | ;set data=0 | |||||
515 | 1021+ | 1001752 | jmp | .1002 | ;write it | |||||
516 | 1022 | ;-------------------------------------------------------------------- | ||||||||
517 | 1022 | .1022: | call | ; | @1022 | |||||
517+1 | 1022 | 7306371001477 | lnk | putcode.lnk | : | jmp | putcode.ent | |||
518 | 1023 | 0601466 | lod | K19 | ;set key=19, extra large reloc | |||||
519 | 1023+ | 0401427 | sto | W791 | ; | |||||
520 | 1024 | 0601422 | lod | GenAdr | ;load address bits | @1024 | ||||
521 | 1024+ | 0061450 | and | N2bits | ;mask to 13 bits | |||||
522 | 1025 | 0401414 | sto | PCdata | ;store for putcode | |||||
523 | 1025+ | 1101746 | jmp | .998P | ;do it | |||||
524 | 1026 | ;-------------------------------------------------------------------- | ||||||||
525 | 1026 | ; output word of ocode, to tape or core | ||||||||
526 | 1026 | ; | ||||||||
527 | 1026 | L1026:: | ; | |||||||
528 | 1026 | ; | ||||||||
529 | 1026 | .ent: | ; | |||||||
530 | 1026 | 0201437 | exa | W799 | ; incore? | @1026 | ||||
531 | 1026+ | 1142066 | jz | L1077.1078P | ;->yes | |||||
532 | 1027 | call | ; output to film? | |||||||
532+1 | 1027 | 7306151102065 | lnk | L1077.lnk | : | jmp | L1077.ent | |||
533 | 1028 | ret | ; | @1028 | ||||||
533+1 | 1028 | 0006147000001 | o00 | L1026.lnk | / | jmp | 1 | |||
534 | 1029 | ;-------------------------------------------------------------------- | ||||||||
535 | 1029 | L1029.ent: | ; | |||||||
536 | 1029 | 0602160 | lod | dicpt | ; | @1029 | ||||
537 | 1029+ | 0124304 | sub | constptr | ; | |||||
538 | 1030 | 1122007 | jn | .1031P | ; | @1030 | ||||
539 | 1030+ | 0604304 | lod | constptr | ; | |||||
540 | 1031 | 1002010 | jmp | .1032 | ; | |||||
541 | 1031+ | ; | ||||||||
542 | 1031+ | 0602160 | .1031P: | lod | dicpt | ; | ||||
543 | 1032 | ; | ||||||||
544 | 1032 | 0122151 | .1032: | sub | stkp | ; | @1032 | |||
545 | 1032+ | 1042061 | jz | .1073 | ; | |||||
546 | 1033 | 1220001 | srl | 1 | ; | |||||
547 | 1033+ | 1042061 | jz | .1073 | ; | |||||
548 | 1034 | 0102151 | add | stkp | ; | @1034 | ||||
549 | 1034+ | 0401432 | sto | Link10a | ; | |||||
550 | 1035 | 0202151 | exa | stkp | ; | |||||
551 | 1035+ | 0401433 | sto | Link10b | ; | |||||
552 | 1036 | .1036: | ; | |||||||
553 | 1036 | 0006156600000 | o00 | Link10b | / | lod | 0 | ; | @1036 | |
554 | 1037 | 0006152400000 | o00 | Link10a | / | sto | 0 | ; | ||
555 | 1038 | 0040000 | o02 | 0 | ; | @1038 | ||||
556 | 1038+ | 0561432 | o27 | Link10a | ; | |||||
557 | 1039 | 0761433 | o37 | Link10b | ; | |||||
558 | 1039+ | 0167525 | bus | stkbase | ; | |||||
559 | 1040 | 1022014 | jn | .1036 | ; | @1040 | ||||
560 | 1040+ | 0041432 | o02 | Link10a | ; | |||||
561 | 1041 | 0407525 | sto | stkbase | ; | |||||
562 | 1041+ | 1002036 | jmp | .1054 | ; | |||||
563 | 1042 | ; | ||||||||
564 | 1042 | 0041421 | .1042: | o02 | W785 | ; | @1042 | |||
565 | 1042+ | 0167525 | bus | stkbase | ; | |||||
566 | 1043 | 1042064 | jz | .1076 | ; | |||||
567 | 1043+ | 0121445 | sub | K120 | ;=120 | |||||
568 | 1044 | 1122025 | jn | .1045P | ; | @1044 | ||||
569 | 1044+ | 0041440 | o02 | K39 | ; | |||||
570 | 1045 | 1002027 | jmp | .1047 | ; | |||||
571 | 1045+ | ; | ||||||||
572 | 1045+ | .1045P: | ; | |||||||
573 | 1045+ | 0101445 | add | K120 | ;=120 | |||||
574 | 1046 | 1220002 | srl | 2 | ; | @1046 | ||||
575 | 1046+ | 1042064 | jz | .1076 | ||||||
576 | 1047 | L1047: | ; | |||||||
577 | 1047 | .1047: | ; | |||||||
578 | 1047 | 1010653 | jmp | L4523 | ||||||
579 | 1047+ | ; | ||||||||
580 | 1047+ | L1047P: | ; | |||||||
581 | 1047+ | .1047P: | ; | |||||||
582 | 1047+ | 0401432 | sto | Link10a | ; | |||||
583 | 1048 | 0207525 | exa | stkbase | ; | @1048 | ||||
584 | 1048+ | 0401433 | sto | Link10b | ; | |||||
585 | 1049 | .1049: | ; | |||||||
586 | 1049 | 2206156577777 | inc | Link10b | / | lod | -1 | ; | ||
587 | 1050 | 2206152377777 | inc | Link10a | / | sto | -1 | ; | @1050 | |
588 | 1051 | 0601433 | lod | Link10b | ; | |||||
589 | 1051+ | 0122151 | sub | stkp | ; | |||||
590 | 1052 | 1022031 | jn | .1049 | ; | @1052 | ||||
591 | 1052+ | 0601432 | lod | Link10a | ; | |||||
592 | 1053 | 0402151 | sto | stkp | ; | |||||
593 | 1053+ | nop | ; | |||||||
593+1 | 1053+ | 1002036 | jmp | .1 | ||||||
593+2 | 1054 | .1: | ; | |||||||
594 | 1054 | .1054: | ret | ; | @1054 | |||||
594+1 | 1054 | 0006147000001 | o00 | L1026.lnk | / | jmp | 1 | |||
595 | 1055 | ; | ||||||||
596 | 1055 | ;-------------------------------------------------------------------- | ||||||||
597 | 1055 | L1055: | ; | |||||||
598 | 1055 | ; initialise paper tape output, first output 40 blanks to ptp | ||||||||
599 | 1055 | ; | ||||||||
600 | 1055 | 0601440 | .1055: | lod | K39 | ;=+39 | @1055 | |||
601 | 1055+ | 0421432 | stn | Link10a | ; | |||||
602 | 1056 | 1700000 | .1056: | otp | 0 | ;punch blank tape | @1056 | |||
603 | 1056+ | 0641432 | lis | Link10a | ;count | |||||
604 | 1057 | 1022040 | jn | .1056 | ;loop back until done | |||||
605 | 1057+ | ; | ||||||||
606 | 1057+ | 0741415 | lzs | work1 | ;set to zero | |||||
607 | 1058 | 0401432 | sto | Link10a | ; | @1058 | ||||
608 | 1058+ | 0741416 | lzs | PCshift | ;shift count | |||||
609 | 1059 | 0401433 | sto | Link10b | ; | |||||
610 | 1059+ | 0044334 | o02 | W2268 | ; | |||||
611 | 1060 | 0421420 | stn | PCchk | ; | @1060 | ||||
612 | 1060+ | 0541425 | cls | errsw | ; | |||||
613 | 1061 | 0607532 | lod | FreeMemPtr | ; | |||||
614 | 1061+ | 0401434 | sto | Work1 | ; | |||||
615 | 1062 | 0006162600000 | .1062: | o00 | Work1 | / | lod | 0 | ; | @1062 |
616 | 1063 | call | ; | |||||||
616+1 | 1063 | 7306371101532 | lnk | putFwd.lnk | : | jmp | putFwd.ent | |||
617 | 1064 | 0441434 | inc | Work1 | ; | @1064 | ||||
618 | 1064+ | 0601434 | lod | Work1 | ; | |||||
619 | 1065 | 0121421 | sub | W785 | ; | |||||
620 | 1065+ | 1022046 | jn | .1062 | ; | |||||
621 | 1066 | 0601432 | lod | Link10a | ; | @1066 | ||||
622 | 1066+ | 0401414 | sto | PCdata | ; | |||||
623 | 1067 | 0601433 | lod | Link10b | ; | |||||
624 | 1067+ | nop | ; | |||||||
624+1 | 1067+ | 1002054 | jmp | .1 | ||||||
624+2 | 1068 | .1: | ; | |||||||
625 | 1068 | .1068: | call | ; | @1068 | |||||
625+1 | 1068 | 7306371001477 | lnk | putcode.lnk | : | jmp | putcode.ent | |||
626 | 1069 | 0607522 | lod | eotflg | ; | |||||
627 | 1069+ | 1102062 | jmp | .1074P | ; | |||||
628 | 1070 | ; | ||||||||
629 | 1070 | L1026:: | ; | |||||||
630 | 1070 | ; | ||||||||
631 | 1070 | L1070.ent: | ; | |||||||
632 | 1070 | 0601425 | lod | errsw | ; | @1070 | ||||
633 | 1070+ | 1142057 | jz | .1071P | ; | |||||
634 | 1071 | 1002072 | jmp | L1077.1082 | ; | |||||
635 | 1071+ | ; | ||||||||
636 | 1071+ | .1071P: | ; | |||||||
637 | 1071+ | 0602211 | lod | K4 | ;=4 | |||||
638 | 1072 | _err49: | ; | |||||||
639 | 1072 | 1661044 | lnk | errlnk | ;error 49: program too large or complex | @1072 | ||||
640 | 1072+ | 1001070 | jmp | Error | ;call error routine | |||||
641 | 1073 | ;-------------------------------------------------------------------- | ||||||||
642 | 1073 | .1073: | ; | |||||||
643 | 1073 | 0601476 | lod | putcode.lnk | ; | |||||
644 | 1073+ | 0407522 | sto | eotflg | ; | |||||
645 | 1074 | 1002064 | jmp | .1076 | ; | @1074 | ||||
646 | 1074+ | ; | ||||||||
647 | 1074+ | 0401476 | .1074P: | sto | putcode.lnk | ; | ||||
648 | 1075 | 0607532 | lod | FreeMemPtr | ; | @1075 | ||||
649 | 1075+ | 1102027 | jmp | .1047P | ; | |||||
650 | 1076 | ; | ||||||||
651 | 1076 | 0601436 | .1076: | lod | W798 | ; | @1076 | |||
652 | 1076+ | 1042037 | jz | .1055 | ; | |||||
653 | 1077 | 1002140 | jmp | .1120 | ; | |||||
654 | 1077+ | ; | ||||||||
655 | 1077+ | L1077:: | ; | |||||||
656 | 1077+ | ; | ||||||||
657 | 1077+ | .ent: | ; | |||||||
658 | 1077+ | 0201437 | exa | W799 | ; recover word | @1077+ | ||||
659 | 1078 | 1002100 | jmp | WrtFilmWd.ent | ;->write to film | @1078 | ||||
660 | 1078+ | ;-------------------------------------------------------------------- | ||||||||
661 | 1078+ | 0201437 | .1078P: | exa | W799 | ; recover word | ||||
662 | 1079 | 2206106377777 | inc | W785 | / | sto | -1 | ; store code word | ||
663 | 1080 | 0601421 | lod | W785 | ; get pointer | @1080 | ||||
664 | 1080+ | 0127525 | sub | stkbase | ; compare against limit | |||||
665 | 1081 | 1022036 | jn | L1026.1054 | ; if OK, ->return | |||||
666 | 1081+ | 1002005 | jmp | L1029.ent | ||||||
667 | 1082 | ;-------------------------------------------------------------------- | ||||||||
668 | 1082 | 0601437 | .1082: | lod | W799 | ; film switch | @1082 | |||
669 | 1082+ | 1042022 | jz | L1026.1042 | ; core output | |||||
670 | 1083 | 1002060 | jmp | _err49 | ; program too large or complex | |||||
671 | 1083+ | ; | ||||||||
672 | 1083+ | 0000000 | o00 | 0 | ||||||
673 | 1084 | ;------------------------------------------------------------------- | ||||||||
674 | 1084 | WrtFilmBlk.ent: | ; | |||||||
675 | 1084 | ; | ||||||||
676 | 1084 | 0006363742001 | .1084: | o00 | W828 | / | o76 | 1025 | ;prepare to write | @1084 |
677 | 1085 | 0036553760000 | o00 | FreeMemPtr | / | o77 | 0 | ; write block | ||
678 | 1086 | 1722003 | o75 | 1027 | ;read last block address | @1086 | ||||
679 | 1086+ | 0101475 | add | W829 | ;=4095 | |||||
680 | 1087 | 0401435 | sto | Work2 | ; | |||||
681 | 1087+ | 1002106 | jmp | .1094 | ; | |||||
682 | 1088 | ;------------------------------------------------------ | ||||||||
683 | 1088 | ; add word to film buffer, if buffer full, write to film | ||||||||
684 | 1088 | ; | ||||||||
685 | 1088 | WrtFilmWd.ent: | ; | |||||||
686 | 1088 | 0006162400000 | o00 | Work1 | / | sto | 0 | ;add to buffer | @1088 | |
687 | 1089 | 0641434 | lis | Work1 | ;increment and get buffer pointer | |||||
688 | 1089+ | 0127532 | sub | FreeMemPtr | ;buffer base | |||||
689 | 1090 | 0121460 | sub | K63 | ;=63 | @1090 | ||||
690 | 1090+ | 1022111 | jn | .1097 | ;not full-> | |||||
691 | 1091 | 0006363742001 | o00 | W828 | / | o76 | 1025 | ;prepare to write to film | ||
692 | 1092 | 0036553760000 | o00 | FreeMemPtr | / | o77 | 0 | ; write the block | @1092 | |
693 | 1093 | 0040000 | o02 | 0 | ;=1 | |||||
694 | 1093+ | 0561435 | o27 | Work2 | ;decrement block number | |||||
695 | 1094 | .1094: | ; | |||||||
696 | 1094 | 0006363742002 | o00 | W828 | / | o76 | 1026 | ;prepare to search | @1094 | |
697 | 1095 | 0006167760000 | o00 | Work2 | / | o77 | 0 | ; do search | ||
698 | 1096 | 0607532 | lod | FreeMemPtr | ;block address | @1096 | ||||
699 | 1096+ | 0401434 | sto | Work1 | ;store in pointer | |||||
700 | 1097 | .1097: | ; | |||||||
701 | 1097 | ret | ||||||||
701+1 | 1097 | 0006153000001 | o00 | L1077.lnk | / | jmp | 1 | |||
702 | 1098 | ;-------------------------------- | ||||||||
703 | 1098 | .1098: | ; | |||||||
704 | 1098 | 1042135 | jz | .1117 | ; | @1098 | ||||
705 | 1098+ | .1098P: | ; | |||||||
706 | 1098+ | 0601472 | lod | W826 | ;'no han' | |||||
707 | 1099 | 1714035 | otp | TP+CR | ;6k+CR | |||||
708 | 1099+ | 1714036 | otp | TP+LF | ;6k+LF | |||||
709 | 1100 | call | ; lnk 795 :jmp 4292 | @1100 | ||||||
709+1 | 1100 | 7306155010304 | lnk | dispwdc.lnk | : | jmp | dispwdc.ent | |||
710 | 1101 | 0601473 | lod | W826+1 | ;'dler ' | |||||
711 | 1101+ | 0541020 | cls | W528 | ;indicate continue after KbWait | |||||
712 | 1102 | call | ; lnk 795 :jmp 4292 | @1102 | ||||||
712+1 | 1102 | 7306155010304 | lnk | dispwdc.lnk | : | jmp | dispwdc.ent | |||
713 | 1103 | 1661044 | lnk | errlnk | ; | |||||
714 | 1103+ | 1001056 | jmp | KbWait | ;call error handler | |||||
715 | 1104 | 0006363742001 | o00 | W828 | / | o76 | 1025 | ;prepare to write | @1104 | |
716 | 1105 | 0061461 | and | K1 | ; handler not available | |||||
717 | 1105+ | 1042123 | jz | .1107 | ; | |||||
718 | 1106 | .1106: | ; | |||||||
719 | 1106 | 1002037 | jmp | L1055 | ;initialise paper tape output | @1106 | ||||
720 | 1106+ | ; | ||||||||
721 | 1106+ | 0000000 | o00 | 0 | ||||||
722 | 1107 | ;-------------------------------------------------------------------- | ||||||||
723 | 1107 | .1107: | ; | |||||||
724 | 1107 | 0006363742001 | o00 | W828 | / | o76 | 1025 | ;prepare to write | ||
725 | 1108 | 0062211 | and | K4 | ;=4 write enable bit | @1108 | ||||
726 | 1108+ | 1042122 | jz | .1106 | ;not enabled, use ptp | |||||
727 | 1109 | L1109: | ; | |||||||
728 | 1109 | .1109: | call | ;call 1084 | ||||||
728+1 | 1109 | 7306151002074 | lnk | WrtFilmBlk.lnk | : | jmp | WrtFilmBlk.ent | |||
729 | 1110 | 1661437 | lnk | W799 | ;set film switch | @1110 | ||||
730 | 1110+ | 0041460 | o02 | K63 | ;=63 | |||||
731 | 1111 | 0107532 | add | FreeMemPtr | ; | |||||
732 | 1111+ | 0401433 | sto | Link10b | ; | |||||
733 | 1112 | L1112: | ; | |||||||
734 | 1112 | 2206156577777 | .1112: | inc | Link10b | / | lod | -1 | ; | @1112 |
735 | 1113 | call | ; | |||||||
735+1 | 1113 | 7306151002100 | lnk | WrtFilmWd.lnk | : | jmp | WrtFilmWd.ent | |||
736 | 1114 | 0601433 | lod | Link10b | ; | @1114 | ||||
737 | 1114+ | 0121421 | sub | W785 | ; | |||||
738 | 1115 | 1022130 | jn | L1112 | ; | |||||
739 | 1115+ | 0041460 | o02 | K63 | ;=63 | |||||
740 | 1116 | 0107532 | add | FreeMemPtr | ; | @1116 | ||||
741 | 1116+ | 1102027 | jmp | L1047P | ; | |||||
742 | 1117 | ; | ||||||||
743 | 1117 | 0006363742001 | .1117: | o00 | W828 | / | o76 | 1025 | ;prepare to write to film | |
744 | 1118 | 0062211 | and | K4 | ;=4, write enabled? | @1118 | ||||
745 | 1118+ | 1142112 | jz | .1098P | ;no, | |||||
746 | 1119 | 1002125 | jmp | L1109 | ; | |||||
747 | 1119+ | ; | ||||||||
748 | 1119+ | 0000000 | o00 | 0 | ; | |||||
749 | 1120 | ; | ||||||||
750 | 1120 | L1026:: | ; | |||||||
751 | 1120 | ; | ||||||||
752 | 1120 | 0006363742001 | .1120: | o00 | W828 | / | o76 | 1025 | ;prepare to write to film | |
753 | 1121 | 0061461 | and | K1 | ; handler not available | |||||
754 | 1121+ | 1002112 | jmp | L1077.1098 | ; | |||||
755 | 1122 | ;-------------------------------------------------------------------- |