flat assembler
Message board for the users of flat assembler.
Index
> Macroinstructions > Align to Boundary |
Author |
|
vid 18 Sep 2005, 23:24
this is kind of macro which IMHO isn't very good to use in real coding. you don't align registers often, and "and eax,FFFFFFF0h ;align to 16 bytes" is more readable than searching source for what exactly overloaded align does.
ps: check for [] type of "reg", eg. "align [aaa],16" |
|||
18 Sep 2005, 23:24 |
|
Tomasz Grysztar 18 Sep 2005, 23:30
And why not just:
Code: macro align reg,bound { add reg,bound-1 and reg,not(bound-1) } ? |
|||
18 Sep 2005, 23:30 |
|
Tommy 19 Sep 2005, 06:11
Thnx Tomasz (didn't think of it)...
|
|||
19 Sep 2005, 06:11 |
|
revolution 19 Sep 2005, 08:05
Better is one that allows the use of normal align also
Code: macro align reg,[bound] { if ~ bound eq add reg,bound-1 and reg,not(bound-1) else align reg end if } Code: align eax,3 So now we modify the macro to this. Code: macro align reg,[bound] { if ~ bound eq add reg,1 shl bound-1 and reg,not(1 shl bound-1) else align reg end if } |
|||
19 Sep 2005, 08:05 |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.