]> git.the-white-hart.net Git - vhdl/commitdiff
Add align assembler directive
authorrs <>
Thu, 3 Jul 2025 04:55:18 +0000 (23:55 -0500)
committerrs <>
Thu, 3 Jul 2025 04:55:18 +0000 (23:55 -0500)
projects/cpu_0/asm/as.py

index 8db13b8e5ca5f486c7a81c11c35ef46f3da792cc..a8104ea6265569f16c0ef701fc47c79e3c3ed709 100755 (executable)
@@ -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: