From fd49408ed9a0250f085ff41bef1fe48423447245 Mon Sep 17 00:00:00 2001 From: Victor van den Elzen Date: Wed, 1 Oct 2008 13:16:26 +0200 Subject: [PATCH] Already aligned aligns should be 0 bytes, not %1. --- macros/smartalign.mac | 6 +++--- standard.mac | 6 +++--- test/align13.asm | 1 + 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/macros/smartalign.mac b/macros/smartalign.mac index 2c45d284..f2ae104b 100644 --- a/macros/smartalign.mac +++ b/macros/smartalign.mac @@ -161,14 +161,14 @@ USE: smartalign %unimacro align 1-2+.nolist %imacro align 1-2+.nolist %ifnempty %2 - times ((%1) - (($-$$) % (%1))) %2 + times (((%1) - (($-$$) % (%1))) % (%1)) %2 %else %push - %assign %$pad (%1) - (($-$$) % (%1)) + %assign %$pad (((%1) - (($-$$) % (%1))) % (%1)) %if %$pad > __ALIGN_JMP_THRESHOLD__ jmp %$end ; We can't re-use %$pad here as $ will have changed! - times ((%1) - (($-$$) % (%1))) nop + times (((%1) - (($-$$) % (%1))) % (%1)) nop %$end: %else %if __BITS__ == 16 diff --git a/standard.mac b/standard.mac index b3e4ae3a..0faa1876 100644 --- a/standard.mac +++ b/standard.mac @@ -66,13 +66,13 @@ __SECT__ %endmacro %imacro align 1-2+.nolist nop - times ((%1) - (($-$$) % (%1))) %2 + times (((%1) - (($-$$) % (%1))) % (%1)) %2 %endmacro %imacro alignb 1-2+.nolist %ifempty %2 - resb ((%1) - (($-$$) % (%1))) + resb (((%1) - (($-$$) % (%1))) % (%1)) %else - times ((%1) - (($-$$) % (%1))) %2 + times (((%1) - (($-$$) % (%1))) % (%1)) %2 %endif %endmacro diff --git a/test/align13.asm b/test/align13.asm index cfc5c689..556373fc 100644 --- a/test/align13.asm +++ b/test/align13.asm @@ -11,5 +11,6 @@ inc eax inc eax align 13 + align 13 ;should do nothing inc eax inc eax -- 2.11.4.GIT