File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 238238(instruct Sal (dst i) check:shift)
239239(instruct Sar (dst i) check:shift)
240240(instruct Push (a1) check:push)
241+ (instruct Pushf () check:none)
242+ (instruct Popf () check:none)
241243(instruct Pop (a1) check:register)
242244(instruct Lea (dst x) check:lea)
243245(instruct Not (x) check:register)
385387(define (check-has-initial-label asm)
386388 (unless (findf Label? asm)
387389 (error 'prog "no initial label found " )))
390+
391+
392+ ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
393+ ;; Symbol to Label
394+
395+ ;; Symbol -> Label
396+ ;; Produce a symbol that is a valid Nasm label
397+ ;; Guarantees that (eq? s1 s2) <=> (eq? (symbol->label s1) (symbol->label s1))
398+ (provide symbol->label)
399+ (define (symbol->label s)
400+ (string->symbol
401+ (string-append
402+ "label_ "
403+ (list->string
404+ (map (λ (c)
405+ (if (or (char<=? #\a c #\z )
406+ (char<=? #\A c #\Z )
407+ (char<=? #\0 c #\9 )
408+ (memq c '(#\_ #\$ #\# #\@ #\~ #\. #\? )))
409+ c
410+ #\_ ))
411+ (string->list (symbol->string s))))
412+ "_ "
413+ (number->string (eq-hash-code s) 16 ))))
Original file line number Diff line number Diff line change 211211 [(Push a)
212212 (string-append tab "push "
213213 (arg->string a))]
214+ [(Pushf)
215+ (string-append tab "pushf " )]
216+ [(Popf)
217+ (string-append tab "popf " )]
214218 [(Pop r)
215219 (string-append tab "pop "
216220 (reg->string r))]
234238 " equ "
235239 (number->string c))]
236240
241+ [(Db (? bytes? bs))
242+ (apply string-append tab "db " (add-between (map number->string (bytes->list bs)) ", " ))]
237243 [(Db x)
238244 (string-append tab "db " (arg->string x))]
239245 [(Dw x)
You can’t perform that action at this time.
0 commit comments