From 08635ffc8c5d9e9def105c0955da2aa47150caa9 Mon Sep 17 00:00:00 2001 From: rs <> Date: Wed, 2 Jul 2025 23:55:18 -0500 Subject: [PATCH] Add align assembler directive --- projects/cpu_0/asm/as.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/projects/cpu_0/asm/as.py b/projects/cpu_0/asm/as.py index 8db13b8..a8104ea 100755 --- a/projects/cpu_0/asm/as.py +++ b/projects/cpu_0/asm/as.py @@ -37,6 +37,10 @@ def assemble(source: str) -> bytearray: if token == '(': comment = True + elif token == 'align': + x = len(b) % 4 + if x != 0: + b += b'\x00'*(4-x) elif token in instrs: b += instrs[token] elif '=' in token: -- 2.43.0