From: Luke Lau Date: Mon, 29 Jul 2019 23:48:00 +0000 (+0100) Subject: Fix = codegen X-Git-Url: https://git.lukelau.me/?p=scheme.git;a=commitdiff_plain;h=6cad928374127b2fae65d7023fd31a725f4bd1d9 Fix = codegen Use the sete instruction instead of the just plain wrong subtraction method --- diff --git a/codegen.scm b/codegen.scm index 00e0129..c736773 100644 --- a/codegen.scm +++ b/codegen.scm @@ -46,9 +46,9 @@ (codegen-expr a si env) (emit "movq %rax, ~a(%rbp)" si) (codegen-expr b (- si wordsize) env) - (emit "subq ~a(%rbp), %rax" si) - (emit "not %rax") - (emit "andq $1, %rax")) + (emit "## ~a = ~b" a b) + (emit "cmpq ~a(%rbp), %rax" si) + (emit "sete %al")) ; 'write file handle addr-string num-bytes