summaryrefslogtreecommitdiff
path: root/nasm.c
diff options
context:
space:
mode:
authorCyrill Gorcunov <gorcunov@gmail.com>2010-04-20 15:33:45 +0400
committerCyrill Gorcunov <gorcunov@gmail.com>2010-04-21 01:07:47 +0400
commitd5f2aef30abcba734c51abdadf3255a6f4bd5be9 (patch)
treec56e16283f5c979b47174d9ba5b7fc76d02224e8 /nasm.c
parentd7a64b72a2ca9c0a399545279f96a5b7e39b8b6d (diff)
downloadnasm-d5f2aef30abcba734c51abdadf3255a6f4bd5be9.tar.gz
nasm-d5f2aef30abcba734c51abdadf3255a6f4bd5be9.tar.bz2
nasm-d5f2aef30abcba734c51abdadf3255a6f4bd5be9.zip
Introduce SEGALIGN directive
No real handling yet though. Definition only. Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
Diffstat (limited to 'nasm.c')
-rw-r--r--nasm.c14
1 files changed, 13 insertions, 1 deletions
diff --git a/nasm.c b/nasm.c
index a1ff56c..afd9ea4 100644
--- a/nasm.c
+++ b/nasm.c
@@ -1232,7 +1232,19 @@ static void assemble_file(char *fname, StrList **depend_ptr)
location.segment = seg;
}
break;
- case D_EXTERN: /* [EXTERN label:special] */
+ case D_SEGALIGN: /* [SEGALIGN n] */
+ {
+ if (*value) {
+ int align = atoi(value);
+ if (!is_power2(align)) {
+ nasm_error(ERR_NONFATAL,
+ "segment alignment `%s' is not power of two",
+ value);
+ }
+ }
+ }
+ break;
+ case D_EXTERN: /* [EXTERN label:special] */
if (*value == '$')
value++; /* skip initial $ if present */
if (pass0 == 2) {