100 lines
7.0 KiB
Plaintext
100 lines
7.0 KiB
Plaintext
|
170 loadI 0 => r_nul // initialise zero register
|
||
|
171 loadI 176 => r_arp // malloc
|
||
|
172 push r_arp // malloc
|
||
|
173 loadI 20 => r_arp // malloc
|
||
|
174 push r_arp // malloc
|
||
|
175 jumpI -> memalloc // malloc
|
||
|
176 pop => r_arp // malloc
|
||
|
177 addI r_arp,16 => r_arp // construct main AR
|
||
|
178 loadI 183 => __1 // malloc
|
||
|
179 push __1 // malloc
|
||
|
180 loadI 8 => __1 // malloc
|
||
|
181 push __1 // malloc
|
||
|
182 jumpI -> memalloc // malloc
|
||
|
183 pop => __1 // malloc
|
||
|
184 loadI 189 => __2 // malloc
|
||
|
185 push __2 // malloc
|
||
|
186 loadI 8 => __2 // malloc
|
||
|
187 push __2 // malloc
|
||
|
188 jumpI -> memalloc // malloc
|
||
|
189 pop => __2 // malloc
|
||
|
190 loadI 1 => __3 // 1
|
||
|
191 storeAI __3 => __2,0 // store array element
|
||
|
192 loadI 2 => __3 // 2
|
||
|
193 storeAI __3 => __2,4 // store array element
|
||
|
194 storeAI __2 => __1,0 // store array element
|
||
|
195 loadI 200 => __2 // malloc
|
||
|
196 push __2 // malloc
|
||
|
197 loadI 8 => __2 // malloc
|
||
|
198 push __2 // malloc
|
||
|
199 jumpI -> memalloc // malloc
|
||
|
200 pop => __2 // malloc
|
||
|
201 loadI 3 => __3 // 3
|
||
|
202 storeAI __3 => __2,0 // store array element
|
||
|
203 loadI 4 => __3 // 4
|
||
|
204 storeAI __3 => __2,4 // store array element
|
||
|
205 storeAI __2 => __1,4 // store array element
|
||
|
206 addI r_arp,0 => __2 // add offset
|
||
|
207 load __2 => __3 // load reference
|
||
|
208 cmp_EQ __3,r_nul => __4 // remove old reference
|
||
|
209 cbr __4 -> ynul0,nnul1 // remove old reference
|
||
|
210 nnul1: nop // remove old reference
|
||
|
211 loadI 215 => __4 // free
|
||
|
212 push __4 // free
|
||
|
213 push __3 // free
|
||
|
214 jumpI -> memfree // free
|
||
|
215 ynul0: nop // remove old reference
|
||
|
216 store __1 => __2 // to matrix
|
||
|
217 load __2 => __3 // load reference
|
||
|
218 loadI 222 => __5 // memaddref
|
||
|
219 push __5 // memaddref
|
||
|
220 push __3 // memaddref
|
||
|
221 jumpI -> memaddref // memaddref
|
||
|
222 cmp_EQ __1,r_nul => __3 // remove old reference
|
||
|
223 cbr __3 -> ynul2,nnul3 // remove old reference
|
||
|
224 nnul3: nop // remove old reference
|
||
|
225 loadI 229 => __3 // free
|
||
|
226 push __3 // free
|
||
|
227 push __1 // free
|
||
|
228 jumpI -> memfree // free
|
||
|
229 ynul2: nop // remove old reference
|
||
|
230 addI r_arp,0 => __2 // add offset
|
||
|
231 load __2 => __2 // get array object
|
||
|
232 loadI 0 => __3 // 0
|
||
|
233 loadAI __2,-4 => __1 // check array index
|
||
|
234 divI __1,4 => __1 // check array index
|
||
|
235 cmp_LT __3,__1 => __1 // check array index
|
||
|
236 cmp_GE __3,r_nul => __4 // check array index
|
||
|
237 and __1,__4 => __4 // check array index
|
||
|
238 cbr __4 -> nob5,oob4 // check array index
|
||
|
239 oob4: haltI 1634692962 // array index out of bounds
|
||
|
240 nob5: multI __3,4 => __3 // multiply index by size
|
||
|
241 add __2,__3 => __2 // get array index address
|
||
|
242 load __2 => __2 // get array object
|
||
|
243 loadI 1 => __4 // 1
|
||
|
244 loadAI __2,-4 => __3 // check array index
|
||
|
245 divI __3,4 => __3 // check array index
|
||
|
246 cmp_LT __4,__3 => __3 // check array index
|
||
|
247 cmp_GE __4,r_nul => __1 // check array index
|
||
|
248 and __3,__1 => __1 // check array index
|
||
|
249 cbr __1 -> nob7,oob6 // check array index
|
||
|
250 oob6: haltI 1634692962 // array index out of bounds
|
||
|
251 nob7: multI __4,4 => __4 // multiply index by size
|
||
|
252 add __2,__4 => __2 // get array index address
|
||
|
253 load __2 => __2 // load address
|
||
|
254 out "",__2 //
|
||
|
255 loadAI r_arp,0 => __4 // remove reference get var
|
||
|
256 cmp_EQ __4,r_nul => __1 // remove reference
|
||
|
257 cbr __1 -> ynul8,nnul9 // remove reference
|
||
|
258 nnul9: nop // remove reference
|
||
|
259 loadI 263 => __1 // free
|
||
|
260 push __1 // free
|
||
|
261 push __4 // free
|
||
|
262 jumpI -> memfree // free
|
||
|
263 ynul8: nop // remove reference
|
||
|
264 subI r_arp,16 => r_arp // deconstruct main AR
|
||
|
265 loadI 269 => __2 // free
|
||
|
266 push __2 // free
|
||
|
267 push r_arp // free
|
||
|
268 jumpI -> memfree // free
|