diff clojure/com/aurellem/run/adv_choreo.clj @ 566:a2ff0032119e

changed jump from relative to absolute to allow for display-glyph code greater than 128 numbers.
author Robert McIntyre <rlm@mit.edu>
date Sat, 01 Sep 2012 03:03:46 -0500
parents bb1dc927859b
children dba6bb38d2fb
line wrap: on
line diff
     1.1 --- a/clojure/com/aurellem/run/adv_choreo.clj	Fri Aug 31 12:14:47 2012 -0500
     1.2 +++ b/clojure/com/aurellem/run/adv_choreo.clj	Sat Sep 01 03:03:46 2012 -0500
     1.3 @@ -163,15 +163,16 @@
     1.4  
     1.5            0x47 0xBA ;; compare B to D
     1.6            0x20 ;; skip next section B != D
     1.7 -          7 ;; this is equal to the number of instructions in the next
     1.8 +          8 ;; this is equal to the number of instructions in the next
     1.9              ;; indented region!
    1.10              
    1.11              0x79 0xBB ;; compare C to E
    1.12              0x20 ;; JR NZ, skip if C != E
    1.13 -            3
    1.14 +            4
    1.15              0xF1 ;; pop AF for stack maintainance!
    1.16              0x18
    1.17 -            :to-stack-cleanup
    1.18 +            :stack-cleanup-low
    1.19 +            :stack-cleanup-high
    1.20            ])
    1.21  
    1.22          display-glyph
    1.23 @@ -219,10 +220,17 @@
    1.24           
    1.25          stack-cleanup
    1.26          [0xF1 0xE1 0xD1 0xC1]
    1.27 -        
    1.28 +
    1.29 +        [stack-cleanup-high
    1.30 +         stack-cleanup-low]
    1.31 +        (disect-bytes-2 (+ start-address (count load-data)
    1.32 +                           (count handle-glyph-count*)
    1.33 +                           (count cleanup)
    1.34 +                           (count display-glyph)))
    1.35 +         
    1.36          handle-glyph-count
    1.37 -        (replace {:to-stack-cleanup
    1.38 -                  (+ (count display-glyph) (count cleanup))}
    1.39 +        (replace {:stack-cleanup-high stack-cleanup-high
    1.40 +                  :stack-cleanup-low  stack-cleanup-low}
    1.41                   handle-glyph-count*)]
    1.42      (println  (+ (count display-glyph) (count cleanup)))
    1.43      (concat load-data