Already aligned aligns should be 0 bytes, not %1.
authorVictor van den Elzen <victor.vde@gmail.com>
Wed, 1 Oct 2008 11:16:26 +0000 (13:16 +0200)
committerVictor van den Elzen <victor.vde@gmail.com>
Wed, 1 Oct 2008 11:21:02 +0000 (13:21 +0200)
macros/smartalign.mac
standard.mac
test/align13.asm

index 2c45d28..f2ae104 100644 (file)
@@ -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
index b3e4ae3..0faa187 100644 (file)
@@ -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
 
index cfc5c68..556373f 100644 (file)
@@ -11,5 +11,6 @@
        inc eax
        inc eax
        align 13
+       align 13 ;should do nothing
        inc eax
        inc eax