From ecab77f9e9ed4d0f7dc6d57fa3b2b614d4aabcf3 Mon Sep 17 00:00:00 2001 From: Mid <> Date: Wed, 15 Oct 2025 14:11:02 +0300 Subject: [PATCH] Holy fucking bug omg --- src/x86/cg.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/x86/cg.c b/src/x86/cg.c index 4ae6a3b..0cc568d 100644 --- a/src/x86/cg.c +++ b/src/x86/cg.c @@ -608,9 +608,9 @@ void cg_chunk(CGState *cg, AST *a) { if(a->chunk.stackReservation) { for(int i = 0; i < MAX_REGS_PER_CLASS && cg->calleeSaved.reg[i]; i++) { if(x86_ia16()) { - printf("mov [bp + %li], %s\n", cg->calleeSaved.stackOffset[i] - a->chunk.stackReservation, cg->calleeSaved.reg[i]); + printf("mov %s, [bp + %li]\n", cg->calleeSaved.reg[i], cg->calleeSaved.stackOffset[i] - a->chunk.stackReservation); } else { - printf("mov [esp + %li], %s\n", cg->calleeSaved.stackOffset[i], cg->calleeSaved.reg[i]); + printf("mov %s, [esp + %li]\n", cg->calleeSaved.reg[i], cg->calleeSaved.stackOffset[i]); } }