|
Lines 129-140
Link Here
|
| 129 |
(let ((address (address-index address))) |
129 |
(let ((address (address-index address))) |
| 130 |
(let ((vector (address->vector address)) |
130 |
(let ((vector (address->vector address)) |
| 131 |
(byte-address (address->vector-index address))) |
131 |
(byte-address (address->vector-index address))) |
| 132 |
(if (not (= 0 (bitwise-and byte-address 3))) |
132 |
(if (not (= 0 (bitwise-and byte-address 5))) ; [64-bit] |
| 133 |
(error "unaligned address error" address) |
133 |
(error "unaligned address error" address) |
| 134 |
(+ (+ (arithmetic-shift (signed-code-vector-ref vector byte-address) 24) |
134 |
(+ (arithmetic-shift (signed-code-vector-ref vector byte-address) 56) |
| 135 |
(arithmetic-shift (code-vector-ref vector (+ byte-address 1)) 16)) |
135 |
(arithmetic-shift (code-vector-ref vector (+ byte-address 1)) 48) |
| 136 |
(+ (arithmetic-shift (code-vector-ref vector (+ byte-address 2)) 8) |
136 |
(arithmetic-shift (code-vector-ref vector (+ byte-address 2)) 40) |
| 137 |
(code-vector-ref vector (+ byte-address 3)))))))) |
137 |
(arithmetic-shift (code-vector-ref vector (+ byte-address 3)) 32) |
|
|
138 |
(arithmetic-shift (code-vector-ref vector (+ byte-address 4)) 24) |
| 139 |
(arithmetic-shift (code-vector-ref vector (+ byte-address 5)) 16) |
| 140 |
(arithmetic-shift (code-vector-ref vector (+ byte-address 6)) 8) |
| 141 |
(code-vector-ref vector (+ byte-address 7))))))) |
| 138 |
|
142 |
|
| 139 |
(define (unsigned-byte-set! address value) |
143 |
(define (unsigned-byte-set! address value) |
| 140 |
(let ((address (address-index address))) |
144 |
(let ((address (address-index address))) |
|
Lines 149-160
Link Here
|
| 149 |
(if (not (= 0 (bitwise-and byte-address 3))) |
153 |
(if (not (= 0 (bitwise-and byte-address 3))) |
| 150 |
(error "unaligned address error" address)) |
154 |
(error "unaligned address error" address)) |
| 151 |
(code-vector-set! vector byte-address |
155 |
(code-vector-set! vector byte-address |
| 152 |
(bitwise-and 255 (arithmetic-shift value -24))) |
156 |
(bitwise-and 255 (arithmetic-shift value -56))) |
| 153 |
(code-vector-set! vector (+ byte-address 1) |
157 |
(code-vector-set! vector (+ byte-address 1) |
| 154 |
(bitwise-and 255 (arithmetic-shift value -16))) |
158 |
(bitwise-and 255 (arithmetic-shift value -48))) |
| 155 |
(code-vector-set! vector (+ byte-address 2) |
159 |
(code-vector-set! vector (+ byte-address 2) |
| 156 |
(bitwise-and 255 (arithmetic-shift value -8))) |
160 |
(bitwise-and 255 (arithmetic-shift value -40))) |
| 157 |
(code-vector-set! vector (+ byte-address 3) |
161 |
(code-vector-set! vector (+ byte-address 3) |
|
|
162 |
(bitwise-and 255 (arithmetic-shift value -32))) |
| 163 |
(code-vector-set! vector (+ byte-address 4) |
| 164 |
(bitwise-and 255 (arithmetic-shift value -24))) |
| 165 |
(code-vector-set! vector (+ byte-address 5) |
| 166 |
(bitwise-and 255 (arithmetic-shift value -16))) |
| 167 |
(code-vector-set! vector (+ byte-address 6) |
| 168 |
(bitwise-and 255 (arithmetic-shift value -8))) |
| 169 |
(code-vector-set! vector (+ byte-address 7) |
| 158 |
(bitwise-and 255 value))))) |
170 |
(bitwise-and 255 value))))) |
| 159 |
|
171 |
|
| 160 |
; With the right access to the flonum bits we could actually make these |
172 |
; With the right access to the flonum bits we could actually make these |
|
Lines 190-201
Link Here
|
| 190 |
(let ((vector (address->vector address)) |
202 |
(let ((vector (address->vector address)) |
| 191 |
(byte-address (address->vector-index address))) |
203 |
(byte-address (address->vector-index address))) |
| 192 |
(let loop ((i 0)) |
204 |
(let loop ((i 0)) |
| 193 |
(if (or (= i count) |
205 |
(if (= i count) |
| 194 |
(not (byte-ready? port))) |
|
|
| 195 |
(values i #f (enum errors no-errors)) |
206 |
(values i #f (enum errors no-errors)) |
| 196 |
(cond ((eof-object? b) |
207 |
(cond ((eof-object? b) |
| 197 |
(values i #f (enum errors no-errors))) |
208 |
(values i #t (enum errors no-errors))) |
| 198 |
(else |
209 |
(else |
| 199 |
(code-vector-set! vector |
210 |
(code-vector-set! vector |
| 200 |
(+ i byte-address) |
211 |
(+ i byte-address) |