summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--directives.dat1
-rw-r--r--nasm.c14
-rw-r--r--standard.mac4
3 files changed, 18 insertions, 1 deletions
diff --git a/directives.dat b/directives.dat
index b08d387..fbcf666 100644
--- a/directives.dat
+++ b/directives.dat
@@ -48,6 +48,7 @@ list
section
segment
warning
+segalign
; --- Format-specific directives
export ; outcoff, outobj
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) {
diff --git a/standard.mac b/standard.mac
index a3e8eea..a7a52db 100644
--- a/standard.mac
+++ b/standard.mac
@@ -66,6 +66,10 @@
%define __SECT__ [segment %1]
__SECT__
%endmacro
+%imacro segalign 1+.nolist
+%define __SECT__ [segalign %1]
+ __SECT__
+%endmacro
%imacro absolute 1+.nolist
%define __SECT__ [absolute %1]