summaryrefslogtreecommitdiff
path: root/standard.mac
diff options
context:
space:
mode:
authorH. Peter Anvin <hpa@zytor.com>2008-09-25 02:31:50 -0700
committerH. Peter Anvin <hpa@zytor.com>2008-09-25 02:31:50 -0700
commit152656f8d3c34a1a5efef6d512439fc686690ecf (patch)
tree7276331cf0219c2f3ac72a92d064a895c4b67834 /standard.mac
parent6e79efc26b04dc7e82b528e8ff3e5f92d5f284b7 (diff)
downloadnasm-152656f8d3c34a1a5efef6d512439fc686690ecf.tar.gz
nasm-152656f8d3c34a1a5efef6d512439fc686690ecf.tar.bz2
nasm-152656f8d3c34a1a5efef6d512439fc686690ecf.zip
Actually make non-power-of-2 alignments work
We can't use ($$-$) % (%1) since the wraparound will be wrong except for powers of 2. Signed-off-by: H. Peter Anvin <hpa@zytor.com>
Diffstat (limited to 'standard.mac')
-rw-r--r--standard.mac6
1 files changed, 3 insertions, 3 deletions
diff --git a/standard.mac b/standard.mac
index 4e356d9..b3e4ae3 100644
--- a/standard.mac
+++ b/standard.mac
@@ -66,13 +66,13 @@ __SECT__
%endmacro
%imacro align 1-2+.nolist nop
- times ($$-$) % (%1) %2
+ times ((%1) - (($-$$) % (%1))) %2
%endmacro
%imacro alignb 1-2+.nolist
%ifempty %2
- resb ($$-$) % (%1)
+ resb ((%1) - (($-$$) % (%1)))
%else
- times ($$-$) % (%1) %2
+ times ((%1) - (($-$$) % (%1))) %2
%endif
%endmacro