Mercurial > vba-clojure
comparison clojure/com/aurellem/gb/rlm_assembly.clj @ 399:ddb3c6299619
allowed non-even initial blank inputs.
author | Robert McIntyre <rlm@mit.edu> |
---|---|
date | Fri, 13 Apr 2012 05:35:55 -0500 |
parents | 0591dcddf831 |
children | 1b9137ef7380 |
comparison
equal
deleted
inserted
replaced
398:0591dcddf831 | 399:ddb3c6299619 |
---|---|
215 | 215 |
216 0x5F ;; A->E | 216 0x5F ;; A->E |
217 0xAF ;; test for output-mode (bytes-to-write > 0) | 217 0xAF ;; test for output-mode (bytes-to-write > 0) |
218 0x00 ;; (cp A B) | 218 0x00 ;; (cp A B) |
219 0x7B ;; E->A | 219 0x7B ;; E->A |
220 0x20 ;; skip input section if | 220 0x20 ;; skip input section if |
221 :to-output ;; we're not in input mode | 221 :to-output ;; we're not in input mode |
222 | 222 |
223 :to-be-executed | 223 :to-be-executed |
224 | 224 |
225 ;; write mode to instruction-to-be-executed (pun) | 225 ;; write mode to instruction-to-be-executed (pun) |
226 0xEA | 226 0xEA |
227 :to-be-executed-address | 227 :to-be-executed-address |
228 | 228 |
229 ;; if A is zero, skip the protection section | |
230 0xA7 | |
231 0x28 | |
232 0x09 | |
233 | |
229 0x0C ;; inc C | 234 0x0C ;; inc C |
230 0xCB | 235 0xCB |
231 0x41 ;; test bit 0 of C | 236 0x41 ;; test bit 0 of C |
232 0x20 ;; if (0 == (C % 2)) | 237 0x20 ;; if (0 == (C % 2)) |
233 0x04 | 238 0x04 |
234 0xAF ;; put a no op (0x00) in to-be-executed | 239 0xAF ;; put a no op (0x00) in to-be-executed |
235 0xEA | 240 0xEA ;; every other time. |
236 :to-be-executed-address | 241 :to-be-executed-address |
237 | 242 |
238 0x18 ;; return | 243 0x18 ;; return |
239 :to-beginning-1] | 244 :to-beginning-1] |
240 | 245 |
333 | 338 |
334 (defn test-set-H [n] | 339 (defn test-set-H [n] |
335 (let [after | 340 (let [after |
336 (-> (bootstrap-base) | 341 (-> (bootstrap-base) |
337 (step []) | 342 (step []) |
338 (step []) | |
339 (step (buttons 0x67)) | 343 (step (buttons 0x67)) |
340 (step (buttons n)) | 344 (step (buttons n)) |
345 (step []) | |
346 (step []) | |
341 )] | 347 )] |
342 (hex (H after)))) | 348 (hex (H after)))) |
343 | 349 |
344 (defn test-write-bytes-mode [] | 350 (defn test-write-bytes-mode [] |
345 (let [target-address 0xC00F | 351 (let [target-address 0xC00F |