Skip to content

Commit c1549ca

Browse files
committed
Update printer
1 parent 412814c commit c1549ca

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

asm/printer.rkt

+11
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,12 @@
1313
(symbol->string o) " "
1414
(arg->string a1) ", "
1515
(arg->string a2) "\n")]
16+
[`(,(? opcode3? o) ,a1 ,a2 ,a3)
17+
(string-append "\t"
18+
(symbol->string o) " "
19+
(arg->string a1) ", "
20+
(arg->string a2) ", "
21+
(arg->string a3) "\n")]
1622
[`(jmp ,l)
1723
(string-append "\tjmp " (label->string l) "\n")]
1824
[`(je ,l)
@@ -30,6 +36,8 @@
3036
[`ret "\tret\n"]
3137
[`(neg ,a1)
3238
(string-append "\tneg " (arg->string a1) "\n")]
39+
[`(not ,a1)
40+
(string-append "\tnot " (arg->string a1) "\n")]
3341
[`(call ,l)
3442
(string-append "\tcall " (label->string l) "\n")]
3543
[`(push ,r)
@@ -39,6 +47,9 @@
3947
(define (opcode2? x)
4048
(memq x '(mov add sub cmp and cmovl xor or sal sar)))
4149

50+
(define (opcode3? x)
51+
(memq x '(shld shrd)))
52+
4253
;; Arg -> String
4354
(define (arg->string a)
4455
(match a

0 commit comments

Comments
 (0)