# HG changeset patch # User Robert McIntyre # Date 1334308392 18000 # Node ID 5c0e12f0a833a186d812e6ea1436bdc1a492d3db # Parent b21d28e6c966d2bff7b4abe8c53352b258a5bb81 set H, but found flaw in program flow. diff -r b21d28e6c966 -r 5c0e12f0a833 clojure/com/aurellem/gb/rlm_assembly.clj --- a/clojure/com/aurellem/gb/rlm_assembly.clj Thu Apr 12 01:25:28 2012 -0500 +++ b/clojure/com/aurellem/gb/rlm_assembly.clj Fri Apr 13 04:13:12 2012 -0500 @@ -218,38 +218,63 @@ 0xAF ;; test for output-mode (bytes-to-write > 0) 0xB8 ;; (cp A B) - 0x20 ;; skip input section if - :to-output ;; we're not in input mode + 0x00 ;; skip input section if + 0x00;;:to-output ;; we're not in input mode :to-be-executed ;; write mode to instruction-to-be-executed (pun) + 0x79 ;; C->A 0xEA :to-be-executed-address 0x18 ;; return :to-beginning-1] + ;; output + ;; [:output-start ;; just a label + ;; 0x54 ;; + ;; 0x5D ;; HL->DE \ + ;; ;; | + ;; 0x79 ;; C->A | this mess is all to do + ;; 0x12 ;; A->(DE) | 0x22 (LDI (HL), A) without + ;; ;; | any repeating nybbles + ;; 0x23 ;; inc HL / + + + ;; 0x05 ;; DEC bytes-to-write (B) + ;; 0x20 ;; if there are no more bytes to write, + ;; 0x04 + ;; 0xAF ;; put a no op (0x00) in to-be-executed + ;; 0xEA + ;; :to-be-executed-address + + ;; 0x18 + ;; :to-beginning-2] + output [:output-start ;; just a label - 0x54 ;; - 0x5D ;; HL->DE \ + 0x00 ;; + 0x00 ;; HL->DE \ ;; | - 0x79 ;; C->A | this mess is all to do - 0x12 ;; A->(DE) | 0x22 (LDI (HL), A) without + 0x00 ;; C->A | this mess is all to do + 0x00 ;; A->(DE) | 0x22 (LDI (HL), A) without ;; | any repeating nybbles - 0x23 ;; inc HL / + 0x00 ;; inc HL / - 0x05 ;; DEC bytes-to-write (B) - 0x20 ;; if there are no more bytes to write, - 0x04 - 0xAF ;; put a no op (0x00) in to-be-executed - 0xEA - :to-be-executed-address + 0x00 ;; DEC bytes-to-write (B) + 0x00 ;; if there are no more bytes to write, + 0x00 + 0x00 ;; put a no op (0x00) in to-be-executed + 0x00 + 0x00 + 0x00 0x18 :to-beginning-2] + + symbols {:to-be-executed-address (reverse @@ -304,13 +329,9 @@ (let [after (-> (bootstrap-base) (step []) - (step []) - (step []) (step (buttons 0x67)) (step (buttons n)) - (step []) - (step []) - (step []))] + )] (hex (H after)))) (defn test-write-bytes-mode []