flat assembler
Message board for the users of flat assembler.
![]() |
Author |
|
decard 11 May 2004, 10:49
try something like this:
Code: macro zero_align value { times ((value-1)-($+value-1) mod value) db 0 } |
|||
![]() |
|
Jibz 11 May 2004, 11:05
Code: format MS COFF macro zero_align value { times ((value-1)-($+value-1) mod value) db 0 } section '.text' code readable executable nop zero_align 4 nop gives me Code: flat assembler version 1.52 altest.asm [9]: zero_align 4 altest.asm [3] zero_align [0]: macro zero_align value { times ((value-1)-($+value-1) mod value) db 0 } error: invalid expression. Using RVA $ instead gives the same error .. |
|||
![]() |
|
Tomasz Grysztar 11 May 2004, 11:48
Code: macro align value,fill { if fill eq align value else local ..size virtual @@: align value ..size = $-@b end virtual times ..size db fill end if } align 4,0 ; or: align 4,? |
|||
![]() |
|
Jibz 11 May 2004, 11:57
Thanks a lot, that did the job
![]() |
|||
![]() |
|
hopcode 03 Jan 2009, 11:49
Hallo all,
My solution (not fully tested) was already posted ? Code: macro @align val,fill { times((($+val-1)and not (val-1))-$) db fill } ;usage: @align 4,0 does it work ? |
|||
![]() |
|
revolution 03 Jan 2009, 12:00
hopcode wrote: does it work ? |
|||
![]() |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2025, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.