hlorenzi / customasm

💻 An assembler for custom, user-defined instruction sets! https://hlorenzi.github.io/customasm/web/
Apache License 2.0
720 stars 56 forks source link

#align directive does not work in v0.11.4 #70

Closed gpthimble closed 3 years ago

gpthimble commented 3 years ago

I'm trying to use customasm for my risc processor, but when I use #align directive, the assembler not produces the expected output. For example:

d8 0xff

align 2

d16 0xffff

it should output like : 0x0000: ff 00 ffff

but when i try this on v0.11.4, it outputs: 0x0000: ff ff ff

rj45 commented 3 years ago

Looking at the code, it appears that the #align directive is in bits... so #align 2 would make sure it's aligned to a 2 bit boundary, which won't do anything. #align 16 is likely what you want.

gpthimble commented 3 years ago

align 16 will output the expected result! Thank you for reply!