From 422e1e63b332ec41599e49a03e43c342046c92f7 Mon Sep 17 00:00:00 2001 From: Thomas Voss Date: Wed, 14 Feb 2024 08:36:42 +0100 Subject: Set pad to false after padding --- src/c8asm/assembler.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/c8asm/assembler.c b/src/c8asm/assembler.c index 2e8693b..50955c4 100644 --- a/src/c8asm/assembler.c +++ b/src/c8asm/assembler.c @@ -100,8 +100,10 @@ assemble(FILE *stream, struct ast ast) /* Instructions need to be 0-padded so they appear on an even byte boundary. */ - if (node->instr.kind != I_DB && pad) + if (node->instr.kind != I_DB && pad) { putchar(0); + pad = false; + } switch (node->instr.kind) { case I_ADD_I_VX: -- cgit v1.2.3