changeset 556:6e6b7961595b

created scaffold for displaying terminal characters.
author Robert McIntyre <rlm@mit.edu>
date Fri, 31 Aug 2012 01:48:31 -0500
parents 2d9bf762a073
children cd54ac4a8701
files clojure/com/aurellem/run/adv_choreo.clj
diffstat 1 files changed, 43 insertions(+), 12 deletions(-) [+]
line wrap: on
line diff
     1.1 --- a/clojure/com/aurellem/run/adv_choreo.clj	Fri Aug 31 00:52:33 2012 -0500
     1.2 +++ b/clojure/com/aurellem/run/adv_choreo.clj	Fri Aug 31 01:48:31 2012 -0500
     1.3 @@ -127,22 +127,52 @@
     1.4  
     1.5  (defn glyph-display-program
     1.6    [start-address
     1.7 +   monitor-address
     1.8     delay-count
     1.9     total-glyph-count]
    1.10 -  [0xC5
    1.11 -   0xD5
    1.12 -   0xE5
    1.13 -   0xF5
    1.14 +  (let [data-start (+ 2 start-address)
    1.15 +        monitor-address-high (+ 0 data-start)
    1.16 +        monitor-address-low  (+ 1 data-start)
    1.17  
    1.18 +        glyph-count-high     (+ 2 data-start)
    1.19 +        glyph-count-low      (+ 3 data-start)
    1.20  
    1.21 +        delay-address        (+ 4 data-start)]
    1.22 +        
    1.23 +        
    1.24 +  (flatten
    1.25 +   [;; data region
    1.26  
    1.27 -   0xF1
    1.28 -   0xE1
    1.29 -   0xD1
    1.30 -   0xC1
    1.31 -   
    1.32 -   ])
    1.33 +    0x18
    1.34 +    5
    1.35 +    (disect-bytes-2 monitor-address)
    1.36 +    (disect-bytes-2 total-glyph-count)
    1.37 +    delay-count
    1.38  
    1.39 +    ;; save all registers
    1.40 +    0xC5 0xD5 0xE5 0xF5
    1.41 +
    1.42 +    ;; load data from data region into registers
    1.43 +
    1.44 +    0x21
    1.45 +    (disect-bytes-2 monitor-address-high)
    1.46 +
    1.47 +    0x2A 0x47 ;; monitor-address-high -> B
    1.48 +    0x2A 0x4F ;; monitor-address-low  -> C
    1.49 +
    1.50 +    0x2A 0x57 ;; glyph-count-high -> D
    1.51 +    0x2A 0x5F ;; glyph-count-low  -> E
    1.52 +
    1.53 +    0x2A ;; delay -> A 
    1.54 +    
    1.55 +
    1.56 +    
    1.57 +    
    1.58 +    ;; restore all registers
    1.59 +    0xF1 0xE1 0xD1 0xC1
    1.60 +   ])))
    1.61 +
    1.62 +(def main-program-base-address 0xC000)
    1.63  
    1.64  (defn glyph-bootstrap-program
    1.65    [start-address delay-count total-glyph-count]
    1.66 @@ -152,7 +182,8 @@
    1.67          glyph-display (glyph-display-program
    1.68                         (+ (count init) (count header)
    1.69                            start-address)
    1.70 -                       0 0) ;; ONLY FOR TESTING
    1.71 +                       main-program-base-address 100
    1.72 +                       (- (count (program-data 0)) 100))
    1.73  
    1.74          state-machine-start-address
    1.75          (+ start-address (count init) (count header) (count glyph-display))
    1.76 @@ -173,7 +204,7 @@
    1.77      
    1.78      (concat init glyph-display header state-machine return-to-header)))
    1.79  
    1.80 -(def main-program-base-address 0xC000)
    1.81 +
    1.82  
    1.83  (defn begin-glyph-bootstrap
    1.84    ([] (begin-glyph-bootstrap (launch-main-bootstrap-program)))