Mercurial > vba-clojure
comparison clojure/com/aurellem/run/bootstrap_0.clj @ 342:4e0b64ea7b66
completed testing of item-writer; looks good.
author | Robert McIntyre <rlm@mit.edu> |
---|---|
date | Sun, 08 Apr 2012 06:11:29 -0500 |
parents | bf9b9777c3ce |
children | 652c5abee892 |
comparison
equal
deleted
inserted
replaced
341:bf9b9777c3ce | 342:4e0b64ea7b66 |
---|---|
971 23 ;; skip "input second nybble" and "jump to target" below | 971 23 ;; skip "input second nybble" and "jump to target" below |
972 | 972 |
973 ;; input second nybble | 973 ;; input second nybble |
974 | 974 |
975 0x0C ;; inc C | 975 0x0C ;; inc C |
976 0x37 ;; (item-hack) set-carry flag no-op | 976 0x0C ;; inc C |
977 | 977 |
978 0x00 ;; (item-hack) no-op | 978 0x00 ;; (item-hack) no-op |
979 0xE6 ;; select bottom bits | 979 0xE6 ;; select bottom bits |
980 0x0F | 980 0x0F |
981 0x37 ;; (item-hack) set-carry flag no-op | 981 0x37 ;; (item-hack) set-carry flag no-op |
1017 0x18 ;; relative jump backwards | 1017 0x18 ;; relative jump backwards |
1018 0xCD ;; literal -51 == TM05; go back to input section | 1018 0xCD ;; literal -51 == TM05; go back to input section |
1019 0x01 ;; (item-hack) will never reach this instruction | 1019 0x01 ;; (item-hack) will never reach this instruction |
1020 | 1020 |
1021 ]))) | 1021 ]))) |
1022 | |
1023 | |
1024 | 1022 |
1025 (defn test-item-writer [] | 1023 (defn test-item-writer [] |
1026 (-> (read-state "bootstrap-init") | 1024 (-> (read-state "bootstrap-init") |
1027 (set-memory pc-item-list-start 50) | 1025 (set-memory pc-item-list-start 50) |
1028 (set-memory-range | 1026 (set-memory-range |
1029 map-function-address-start | 1027 map-function-address-start |
1030 (reverse (disect-bytes-2 (inc pc-item-list-start)))) | 1028 (reverse (disect-bytes-2 (inc pc-item-list-start)))) |
1031 (set-memory-range | 1029 (set-memory-range |
1032 (inc pc-item-list-start) | 1030 (inc pc-item-list-start) |
1033 (item-writer 0xD162 201 0xD162)))) | 1031 (item-writer 0xD162 201 0xD162)))) |
1032 | |
1033 | |
1034 (defn item-writer-state [] | |
1035 (read-state "item-writer")) | |
1036 | |
1037 (defn test-item-writer-2 [] | |
1038 (let [orig (item-writer-state)] | |
1039 (-> orig | |
1040 (print-listing 0xD162 (+ 0xD162 20)) | |
1041 (run-moves (reduce | |
1042 concat [[:a] [:b]] | |
1043 (repeat 5 [[:a :b :start :select] []]))) | |
1044 ((fn [_] (println "===========") _)) | |
1045 (print-listing 0xD162 (+ 0xD162 20))))) | |
1046 |