aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/codegen.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/codegen.c')
-rw-r--r--src/codegen.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/codegen.c b/src/codegen.c
index 34f6c23..f02a38c 100644
--- a/src/codegen.c
+++ b/src/codegen.c
@@ -87,6 +87,10 @@ static void codegen_unary_expr(CodeGen* g, AstNode* ast) {
fprintf(g->out, " sete al\n");
fprintf(g->out, " movzb rax, al\n");
fprintf(g->out, " push rax\n");
+ } else if (ast->node_op == TokenKind_tilde) {
+ fprintf(g->out, " pop rax\n");
+ fprintf(g->out, " not rax\n");
+ fprintf(g->out, " push rax\n");
} else {
unreachable();
}