File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 5757 (λ (a1 a2 n)
5858 (unless (register? a1)
5959 (error n "expects register; given ~v " a1))
60- (unless (and (exact-integer? a2) (<= 0 a2 63 ))
60+ (unless (or (and (exact-integer? a2) (<= 0 a2 63 ))
61+ (eq? 'cl a2))
6162 (error n "expects exact integer in [0,63]; given ~v " a2))
6263 (values a1 a2)))
6364
142143(instruct Push (a1) check:push)
143144(instruct Pop (a1) check:register)
144145(instruct Lea (dst x) check:lea)
146+ (instruct Div (den) check:register)
145147
146148(instruct Offset (r i) check:offset)
147149(instruct Extern (x) check:label-symbol)
170172(define offset? Offset?)
171173
172174(define (register? x)
173- (and (memq x '(eax rax rbx rcx rdx rbp rsp rsi rdi r8 r9 r10 r11 r12 r13 r14 r15))
175+ (and (memq x '(cl eax rax rbx rcx rdx rbp rsp rsi rdi r8 r9 r10 r11 r12 r13 r14 r15))
174176 #t ))
175177
176178(define (label? x)
204206 (Push? x)
205207 (Pop? x)
206208 (Lea? x)
209+ (Div? x)
207210 (Comment? x)
208211 (Equ? x)
209212 (Dd? x)
Original file line number Diff line number Diff line change 153153 (string-append tab "lea "
154154 (arg->string d) ", [rel "
155155 (exp->string x) "] " )]
156+ [(Div r)
157+ (string-append tab "div "
158+ (arg->string r))]
156159 [(Equ x c)
157160 (string-append tab
158161 (symbol->string x)
You can’t perform that action at this time.
0 commit comments