]> granicus.if.org Git - yasm/commitdiff
Add a workaround for the lack of per-objfmt macro support to fix the common
authorPeter Johnson <peter@tortall.net>
Tue, 16 Dec 2003 07:45:04 +0000 (07:45 -0000)
committerPeter Johnson <peter@tortall.net>
Tue, 16 Dec 2003 07:45:04 +0000 (07:45 -0000)
use of the ORG macro (several user comments about the lack of this) and the
initial value of the __SECT__ macro (used by ENDSTRUC among other macros).
Fortunately, for all current objfmts, __SECT__ is currently defined as
[section .text], so one common definition can be used for now.

FIXME: remove this workaround when a better solution has been implemented.

svn path=/trunk/yasm/; revision=1087

modules/preprocs/nasm/standard.mac
modules/preprocs/nasm/tests/Makefile.inc
modules/preprocs/nasm/tests/orgsect.asm [new file with mode: 0644]
modules/preprocs/nasm/tests/orgsect.errwarn [new file with mode: 0644]
modules/preprocs/nasm/tests/orgsect.hex [new file with mode: 0644]

index bbbf90d8d327619c17fcb701e10214e55e9c4a8b..26d77f7ab80c1be0b73c03d6dfa004a0625fb11a 100644 (file)
@@ -22,7 +22,7 @@
 %define __FILE__
 %define __LINE__
 
-%define __SECT__               ; it ought to be defined, even if as nothing
+%define __SECT__ [section .text] ; it ought to be defined, even if as nothing
 
 %imacro section 1+.nolist
 %define __SECT__ [section %1]
@@ -107,4 +107,7 @@ __SECT__
 [cpu %1]
 %endmacro
 
+%imacro org 1+.nolist
+[org %1]
+%endmacro
 
index 57fc86a7014c501480d2b7f00eed2ca4a5a72cc4..99625e4ed0a21fc4a1bb78561cb6a34e26c22ee6 100644 (file)
@@ -7,3 +7,6 @@ EXTRA_DIST += modules/preprocs/nasm/tests/ifcritical-err.asm
 EXTRA_DIST += modules/preprocs/nasm/tests/ifcritical-err.errwarn
 EXTRA_DIST += modules/preprocs/nasm/tests/noinclude-err.asm
 EXTRA_DIST += modules/preprocs/nasm/tests/noinclude-err.errwarn
+EXTRA_DIST += modules/preprocs/nasm/tests/orgsect.asm
+EXTRA_DIST += modules/preprocs/nasm/tests/orgsect.errwarn
+EXTRA_DIST += modules/preprocs/nasm/tests/orgsect.hex
diff --git a/modules/preprocs/nasm/tests/orgsect.asm b/modules/preprocs/nasm/tests/orgsect.asm
new file mode 100644 (file)
index 0000000..d8e9c41
--- /dev/null
@@ -0,0 +1,7 @@
+ORG 100h
+label:
+db 5
+STRUC Foo
+.bar   resb 4
+ENDSTRUC
+dw label
diff --git a/modules/preprocs/nasm/tests/orgsect.errwarn b/modules/preprocs/nasm/tests/orgsect.errwarn
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/modules/preprocs/nasm/tests/orgsect.hex b/modules/preprocs/nasm/tests/orgsect.hex
new file mode 100644 (file)
index 0000000..d055b67
--- /dev/null
@@ -0,0 +1,3 @@
+05 
+00 
+01