FASM - compacting “buffer db 0, 0, 0, 0, 0, 0, …”
سؤال
I was lucky enough to run into some NASM code that compiled fine in FASM changing just a single line;
buffer times 64 db 0
This works fine in NASM, but not in FASM - i had to write:
buffer db 0, 0, 0, 0, 0, 0, ...
There must be a more compact way to do this.
المحلول
You are probably looking for:
buffer db 64 dup(0)
نصائح أخرى
In fasm you should write
buffer rb 64 ; reserve 64 bytes
in fasm, when a label is folowed by a macro, its name should end with a colon
buffer: times 64 db 0
لا تنتمي إلى StackOverflow