summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.gitignore2
-rw-r--r--Makefile.in19
-rw-r--r--Mkfiles/msvc.mak28
-rw-r--r--Mkfiles/netware.mak24
-rw-r--r--Mkfiles/openwcom.mak28
-rw-r--r--Mkfiles/owlinux.mak28
-rw-r--r--directives.dat52
-rw-r--r--nasm.c28
8 files changed, 148 insertions, 61 deletions
diff --git a/.gitignore b/.gitignore
index 11f476e..f25c6ea 100644
--- a/.gitignore
+++ b/.gitignore
@@ -18,6 +18,8 @@
/config.log
/config.status
/configure
+/directives.c
+/directives.h
/doc/*.dip
/doc/*.hpj
/doc/*.pdf
diff --git a/Makefile.in b/Makefile.in
index 5bb73b2..a3e222f 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -62,6 +62,7 @@ X = @EXEEXT@
NASM = nasm.$(O) nasmlib.$(O) ver.$(O) \
raa.$(O) saa.$(O) rbtree.$(O) \
float.$(O) insnsa.$(O) insnsb.$(O) \
+ directives.$(O) \
assemble.$(O) labels.$(O) hashtbl.$(O) crc64.$(O) parser.$(O) \
output/outform.$(O) output/outlib.$(O) output/nulldbg.$(O) \
output/outbin.$(O) output/outaout.$(O) output/outcoff.$(O) \
@@ -155,11 +156,18 @@ pptok.c: pptok.dat pptok.pl perllib/phash.ph
pptok.ph: pptok.dat pptok.pl perllib/phash.ph
$(PERL) $(srcdir)/pptok.pl ph $(srcdir)/pptok.dat pptok.ph
+# Directives hash
+directives.h: directives.dat directives.pl perllib/phash.ph
+ $(PERL) $(srcdir)/directives.pl h $(srcdir)/directives.dat directives.h
+directives.c: directives.dat directives.pl perllib/phash.ph
+ $(PERL) $(srcdir)/directives.pl c $(srcdir)/directives.dat directives.c
+
# This target generates all files that require perl.
# This allows easier generation of distribution (see dist target).
PERLREQ = macros.c insnsb.c insnsa.c insnsd.c insnsi.h insnsn.c \
regs.c regs.h regflags.c regdis.c regdis.h regvals.c \
tokhash.c tokens.h pptok.h pptok.c pptok.ph \
+ directives.c directives.h \
version.h version.mac version.mak version.nsh
perlreq: $(PERLREQ)
@@ -247,6 +255,8 @@ alldeps: perlreq
assemble.$(O): assemble.c assemble.h compiler.h config.h insns.h insnsi.h \
nasm.h nasmlib.h pptok.h preproc.h regs.h tables.h tokens.h
crc64.$(O): crc64.c compiler.h config.h nasmlib.h
+directives.$(O): directives.c compiler.h config.h directives.h hashtbl.h \
+ insnsi.h nasm.h nasmlib.h pptok.h preproc.h regs.h
disasm.$(O): disasm.c compiler.h config.h disasm.h insns.h insnsi.h nasm.h \
nasmlib.h pptok.h preproc.h regdis.h regs.h sync.h tables.h tokens.h
eval.$(O): eval.c compiler.h config.h eval.h float.h insnsi.h labels.h \
@@ -272,9 +282,9 @@ listing.$(O): listing.c compiler.h config.h insnsi.h listing.h nasm.h \
nasmlib.h pptok.h preproc.h regs.h
macros.$(O): macros.c compiler.h config.h hashtbl.h insnsi.h nasm.h \
nasmlib.h output/outform.h pptok.h preproc.h regs.h tables.h
-nasm.$(O): nasm.c assemble.h compiler.h config.h eval.h float.h insns.h \
- insnsi.h labels.h listing.h nasm.h nasmlib.h output/outform.h parser.h \
- pptok.h preproc.h raa.h regs.h saa.h stdscan.h tokens.h
+nasm.$(O): nasm.c assemble.h compiler.h config.h directives.h eval.h float.h \
+ insns.h insnsi.h labels.h listing.h nasm.h nasmlib.h output/outform.h \
+ parser.h pptok.h preproc.h raa.h regs.h saa.h stdscan.h tokens.h
nasmlib.$(O): nasmlib.c compiler.h config.h insns.h insnsi.h nasm.h \
nasmlib.h pptok.h preproc.h regs.h tokens.h
ndisasm.$(O): ndisasm.c compiler.h config.h disasm.h insns.h insnsi.h nasm.h \
@@ -306,6 +316,8 @@ output/outelf64.$(O): output/outelf64.c compiler.h config.h insnsi.h nasm.h \
nasmlib.h output/dwarf.h output/elf64.h output/elfcommon.h output/outelf.h \
output/outform.h output/outlib.h pptok.h preproc.h raa.h rbtree.h regs.h \
saa.h stdscan.h
+output/outexe.$(O): output/outexe.c compiler.h config.h insnsi.h nasm.h \
+ nasmlib.h output/outform.h pptok.h preproc.h regs.h
output/outform.$(O): output/outform.c compiler.h config.h insnsi.h nasm.h \
nasmlib.h output/outform.h pptok.h preproc.h regs.h
output/outieee.$(O): output/outieee.c compiler.h config.h insnsi.h nasm.h \
@@ -326,7 +338,6 @@ output/outrdf.$(O): output/outrdf.c compiler.h config.h insnsi.h nasm.h \
output/outrdf2.$(O): output/outrdf2.c compiler.h config.h insnsi.h nasm.h \
nasmlib.h output/outform.h output/outlib.h pptok.h preproc.h rdoff/rdoff.h \
regs.h saa.h
-owtest.$(O): owtest.c
parser.$(O): parser.c compiler.h config.h float.h insns.h insnsi.h nasm.h \
nasmlib.h parser.h pptok.h preproc.h regs.h stdscan.h tables.h tokens.h
pptok.$(O): pptok.c compiler.h config.h hashtbl.h nasmlib.h pptok.h \
diff --git a/Mkfiles/msvc.mak b/Mkfiles/msvc.mak
index 8dcb5da..95a044d 100644
--- a/Mkfiles/msvc.mak
+++ b/Mkfiles/msvc.mak
@@ -37,15 +37,16 @@ X = .exe
NASM = nasm.$(O) nasmlib.$(O) ver.$(O) \
raa.$(O) saa.$(O) rbtree.$(O) \
float.$(O) insnsa.$(O) insnsb.$(O) \
+ directives.$(O) \
assemble.$(O) labels.$(O) hashtbl.$(O) crc64.$(O) parser.$(O) \
output/outform.$(O) output/outlib.$(O) output/nulldbg.$(O) \
output/outbin.$(O) output/outaout.$(O) output/outcoff.$(O) \
output/outelf.$(O) output/outelf32.$(O) output/outelf64.$(O) \
output/outobj.$(O) output/outas86.$(O) output/outrdf2.$(O) \
- output/outdbg.$(O) output/outieee.$(O) output/outmacho.$(O) \
- preproc.$(O) quote.$(O) pptok.$(O) macros.$(O) \
- listing.$(O) eval.$(O) exprlib.$(O) stdscan.$(O) strfunc.$(O) \
- tokhash.$(O) regvals.$(O) regflags.$(O)
+ output/outdbg.$(O) output/outieee.$(O) output/outmacho32.$(O) \
+ output/outmacho64.$(O) preproc.$(O) quote.$(O) pptok.$(O) \
+ macros.$(O) listing.$(O) eval.$(O) exprlib.$(O) stdscan.$(O) \
+ strfunc.$(O) tokhash.$(O) regvals.$(O) regflags.$(O)
NDISASM = ndisasm.$(O) disasm.$(O) sync.$(O) nasmlib.$(O) ver.$(O) \
insnsd.$(O) insnsb.$(O) insnsn.$(O) regs.$(O) regdis.$(O)
@@ -185,6 +186,8 @@ everything: all doc rdf
assemble.$(O): assemble.c assemble.h compiler.h insns.h insnsi.h nasm.h \
nasmlib.h pptok.h preproc.h regs.h tables.h tokens.h
crc64.$(O): crc64.c compiler.h nasmlib.h
+directives.$(O): directives.c compiler.h directives.h hashtbl.h insnsi.h \
+ nasm.h nasmlib.h pptok.h preproc.h regs.h
disasm.$(O): disasm.c compiler.h disasm.h insns.h insnsi.h nasm.h nasmlib.h \
pptok.h preproc.h regdis.h regs.h sync.h tables.h tokens.h
eval.$(O): eval.c compiler.h eval.h float.h insnsi.h labels.h nasm.h \
@@ -210,9 +213,9 @@ listing.$(O): listing.c compiler.h insnsi.h listing.h nasm.h nasmlib.h \
pptok.h preproc.h regs.h
macros.$(O): macros.c compiler.h hashtbl.h insnsi.h nasm.h nasmlib.h \
output/outform.h pptok.h preproc.h regs.h tables.h
-nasm.$(O): nasm.c assemble.h compiler.h eval.h float.h insns.h insnsi.h \
- labels.h listing.h nasm.h nasmlib.h output/outform.h parser.h pptok.h \
- preproc.h raa.h regs.h saa.h stdscan.h tokens.h
+nasm.$(O): nasm.c assemble.h compiler.h directives.h eval.h float.h insns.h \
+ insnsi.h labels.h listing.h nasm.h nasmlib.h output/outform.h parser.h \
+ pptok.h preproc.h raa.h regs.h saa.h stdscan.h tokens.h
nasmlib.$(O): nasmlib.c compiler.h insns.h insnsi.h nasm.h nasmlib.h pptok.h \
preproc.h regs.h tokens.h
ndisasm.$(O): ndisasm.c compiler.h disasm.h insns.h insnsi.h nasm.h \
@@ -242,14 +245,20 @@ output/outelf64.$(O): output/outelf64.c compiler.h insnsi.h nasm.h nasmlib.h \
output/dwarf.h output/elf64.h output/elfcommon.h output/outelf.h \
output/outform.h output/outlib.h pptok.h preproc.h raa.h rbtree.h regs.h \
saa.h stdscan.h
+output/outexe.$(O): output/outexe.c compiler.h insnsi.h nasm.h nasmlib.h \
+ output/outform.h pptok.h preproc.h regs.h
output/outform.$(O): output/outform.c compiler.h insnsi.h nasm.h nasmlib.h \
output/outform.h pptok.h preproc.h regs.h
output/outieee.$(O): output/outieee.c compiler.h insnsi.h nasm.h nasmlib.h \
output/outform.h output/outlib.h pptok.h preproc.h regs.h
output/outlib.$(O): output/outlib.c compiler.h insnsi.h nasm.h nasmlib.h \
output/outlib.h pptok.h preproc.h regs.h
-output/outmacho.$(O): output/outmacho.c compiler.h insnsi.h nasm.h nasmlib.h \
- output/outform.h output/outlib.h pptok.h preproc.h raa.h regs.h saa.h
+output/outmacho32.$(O): output/outmacho32.c compiler.h insnsi.h nasm.h \
+ nasmlib.h output/outform.h output/outlib.h pptok.h preproc.h raa.h regs.h \
+ saa.h
+output/outmacho64.$(O): output/outmacho64.c compiler.h insnsi.h nasm.h \
+ nasmlib.h output/outform.h output/outlib.h pptok.h preproc.h raa.h regs.h \
+ saa.h
output/outobj.$(O): output/outobj.c compiler.h insnsi.h nasm.h nasmlib.h \
output/outform.h output/outlib.h pptok.h preproc.h regs.h stdscan.h
output/outrdf.$(O): output/outrdf.c compiler.h insnsi.h nasm.h nasmlib.h \
@@ -257,7 +266,6 @@ output/outrdf.$(O): output/outrdf.c compiler.h insnsi.h nasm.h nasmlib.h \
output/outrdf2.$(O): output/outrdf2.c compiler.h insnsi.h nasm.h nasmlib.h \
output/outform.h output/outlib.h pptok.h preproc.h rdoff/rdoff.h regs.h \
saa.h
-owtest.$(O): owtest.c
parser.$(O): parser.c compiler.h float.h insns.h insnsi.h nasm.h nasmlib.h \
parser.h pptok.h preproc.h regs.h stdscan.h tables.h tokens.h
pptok.$(O): pptok.c compiler.h hashtbl.h nasmlib.h pptok.h preproc.h
diff --git a/Mkfiles/netware.mak b/Mkfiles/netware.mak
index 9309cd5..5261c13 100644
--- a/Mkfiles/netware.mak
+++ b/Mkfiles/netware.mak
@@ -33,15 +33,16 @@ O = o
NASM = nasm.o nasmlib.o ver.o \
raa.o saa.o rbtree.o \
float.o insnsa.o insnsb.o \
+ directives.o \
assemble.o labels.o hashtbl.o crc64.o parser.o \
outform.o outlib.o nulldbg.o \
outbin.o outaout.o outcoff.o \
outelf.o outelf32.o outelf64.o \
outobj.o outas86.o outrdf2.o \
- outdbg.o outieee.o outmacho.o \
- preproc.o quote.o pptok.o macros.o \
- listing.o eval.o exprlib.o stdscan.o strfunc.o \
- tokhash.o regvals.o regflags.o
+ outdbg.o outieee.o outmacho32.o \
+ outmacho64.o preproc.o quote.o pptok.o \
+ macros.o listing.o eval.o exprlib.o stdscan.o \
+ strfunc.o tokhash.o regvals.o regflags.o
NDISASM = ndisasm.o disasm.o sync.o nasmlib.o ver.o \
insnsd.o insnsb.o insnsn.o regs.o regdis.o
@@ -125,6 +126,8 @@ $(OBJDIR)/version.mak: $(PROOT)/version $(PROOT)/version.pl $(OBJDIR)
assemble.o: assemble.c assemble.h compiler.h config.h insns.h insnsi.h \
nasm.h nasmlib.h pptok.h preproc.h regs.h tables.h tokens.h
crc64.o: crc64.c compiler.h config.h nasmlib.h
+directives.o: directives.c compiler.h config.h directives.h hashtbl.h \
+ insnsi.h nasm.h nasmlib.h pptok.h preproc.h regs.h
disasm.o: disasm.c compiler.h config.h disasm.h insns.h insnsi.h nasm.h \
nasmlib.h pptok.h preproc.h regdis.h regs.h sync.h tables.h tokens.h
eval.o: eval.c compiler.h config.h eval.h float.h insnsi.h labels.h nasm.h \
@@ -150,9 +153,9 @@ listing.o: listing.c compiler.h config.h insnsi.h listing.h nasm.h nasmlib.h \
pptok.h preproc.h regs.h
macros.o: macros.c compiler.h config.h hashtbl.h insnsi.h nasm.h nasmlib.h \
outform.h pptok.h preproc.h regs.h tables.h
-nasm.o: nasm.c assemble.h compiler.h config.h eval.h float.h insns.h \
- insnsi.h labels.h listing.h nasm.h nasmlib.h outform.h parser.h pptok.h \
- preproc.h raa.h regs.h saa.h stdscan.h tokens.h
+nasm.o: nasm.c assemble.h compiler.h config.h directives.h eval.h float.h \
+ insns.h insnsi.h labels.h listing.h nasm.h nasmlib.h outform.h parser.h \
+ pptok.h preproc.h raa.h regs.h saa.h stdscan.h tokens.h
nasmlib.o: nasmlib.c compiler.h config.h insns.h insnsi.h nasm.h nasmlib.h \
pptok.h preproc.h regs.h tokens.h
ndisasm.o: ndisasm.c compiler.h config.h disasm.h insns.h insnsi.h nasm.h \
@@ -177,13 +180,17 @@ outelf32.o: outelf32.c compiler.h config.h insnsi.h nasm.h nasmlib.h dwarf.h \
outelf64.o: outelf64.c compiler.h config.h insnsi.h nasm.h nasmlib.h dwarf.h \
elf64.h elfcommon.h outelf.h outform.h outlib.h pptok.h preproc.h raa.h \
rbtree.h regs.h saa.h stdscan.h
+outexe.o: outexe.c compiler.h config.h insnsi.h nasm.h nasmlib.h outform.h \
+ pptok.h preproc.h regs.h
outform.o: outform.c compiler.h config.h insnsi.h nasm.h nasmlib.h outform.h \
pptok.h preproc.h regs.h
outieee.o: outieee.c compiler.h config.h insnsi.h nasm.h nasmlib.h outform.h \
outlib.h pptok.h preproc.h regs.h
outlib.o: outlib.c compiler.h config.h insnsi.h nasm.h nasmlib.h outlib.h \
pptok.h preproc.h regs.h
-outmacho.o: outmacho.c compiler.h config.h insnsi.h nasm.h nasmlib.h \
+outmacho32.o: outmacho32.c compiler.h config.h insnsi.h nasm.h nasmlib.h \
+ outform.h outlib.h pptok.h preproc.h raa.h regs.h saa.h
+outmacho64.o: outmacho64.c compiler.h config.h insnsi.h nasm.h nasmlib.h \
outform.h outlib.h pptok.h preproc.h raa.h regs.h saa.h
outobj.o: outobj.c compiler.h config.h insnsi.h nasm.h nasmlib.h outform.h \
outlib.h pptok.h preproc.h regs.h stdscan.h
@@ -191,7 +198,6 @@ outrdf.o: outrdf.c compiler.h config.h insnsi.h nasm.h nasmlib.h outform.h \
pptok.h preproc.h regs.h
outrdf2.o: outrdf2.c compiler.h config.h insnsi.h nasm.h nasmlib.h outform.h \
outlib.h pptok.h preproc.h rdoff.h regs.h saa.h
-owtest.o: owtest.c
parser.o: parser.c compiler.h config.h float.h insns.h insnsi.h nasm.h \
nasmlib.h parser.h pptok.h preproc.h regs.h stdscan.h tables.h tokens.h
pptok.o: pptok.c compiler.h config.h hashtbl.h nasmlib.h pptok.h preproc.h
diff --git a/Mkfiles/openwcom.mak b/Mkfiles/openwcom.mak
index a25ba66..ff24b9e 100644
--- a/Mkfiles/openwcom.mak
+++ b/Mkfiles/openwcom.mak
@@ -49,15 +49,16 @@ X = .exe
NASM = nasm.$(O) nasmlib.$(O) ver.$(O) &
raa.$(O) saa.$(O) rbtree.$(O) &
float.$(O) insnsa.$(O) insnsb.$(O) &
+ directives.$(O) &
assemble.$(O) labels.$(O) hashtbl.$(O) crc64.$(O) parser.$(O) &
output\outform.$(O) output\outlib.$(O) output\nulldbg.$(O) &
output\outbin.$(O) output\outaout.$(O) output\outcoff.$(O) &
output\outelf.$(O) output\outelf32.$(O) output\outelf64.$(O) &
output\outobj.$(O) output\outas86.$(O) output\outrdf2.$(O) &
- output\outdbg.$(O) output\outieee.$(O) output\outmacho.$(O) &
- preproc.$(O) quote.$(O) pptok.$(O) macros.$(O) &
- listing.$(O) eval.$(O) exprlib.$(O) stdscan.$(O) strfunc.$(O) &
- tokhash.$(O) regvals.$(O) regflags.$(O)
+ output\outdbg.$(O) output\outieee.$(O) output\outmacho32.$(O) &
+ output\outmacho64.$(O) preproc.$(O) quote.$(O) pptok.$(O) &
+ macros.$(O) listing.$(O) eval.$(O) exprlib.$(O) stdscan.$(O) &
+ strfunc.$(O) tokhash.$(O) regvals.$(O) regflags.$(O)
NDISASM = ndisasm.$(O) disasm.$(O) sync.$(O) nasmlib.$(O) ver.$(O) &
insnsd.$(O) insnsb.$(O) insnsn.$(O) regs.$(O) regdis.$(O)
@@ -214,6 +215,8 @@ everything: all doc rdf
assemble.$(O): assemble.c assemble.h compiler.h insns.h insnsi.h nasm.h &
nasmlib.h pptok.h preproc.h regs.h tables.h tokens.h
crc64.$(O): crc64.c compiler.h nasmlib.h
+directives.$(O): directives.c compiler.h directives.h hashtbl.h insnsi.h &
+ nasm.h nasmlib.h pptok.h preproc.h regs.h
disasm.$(O): disasm.c compiler.h disasm.h insns.h insnsi.h nasm.h nasmlib.h &
pptok.h preproc.h regdis.h regs.h sync.h tables.h tokens.h
eval.$(O): eval.c compiler.h eval.h float.h insnsi.h labels.h nasm.h &
@@ -239,9 +242,9 @@ listing.$(O): listing.c compiler.h insnsi.h listing.h nasm.h nasmlib.h &
pptok.h preproc.h regs.h
macros.$(O): macros.c compiler.h hashtbl.h insnsi.h nasm.h nasmlib.h &
output\outform.h pptok.h preproc.h regs.h tables.h
-nasm.$(O): nasm.c assemble.h compiler.h eval.h float.h insns.h insnsi.h &
- labels.h listing.h nasm.h nasmlib.h output\outform.h parser.h pptok.h &
- preproc.h raa.h regs.h saa.h stdscan.h tokens.h
+nasm.$(O): nasm.c assemble.h compiler.h directives.h eval.h float.h insns.h &
+ insnsi.h labels.h listing.h nasm.h nasmlib.h output\outform.h parser.h &
+ pptok.h preproc.h raa.h regs.h saa.h stdscan.h tokens.h
nasmlib.$(O): nasmlib.c compiler.h insns.h insnsi.h nasm.h nasmlib.h pptok.h &
preproc.h regs.h tokens.h
ndisasm.$(O): ndisasm.c compiler.h disasm.h insns.h insnsi.h nasm.h &
@@ -271,14 +274,20 @@ output\outelf64.$(O): output\outelf64.c compiler.h insnsi.h nasm.h nasmlib.h &
output\dwarf.h output\elf64.h output\elfcommon.h output\outelf.h &
output\outform.h output\outlib.h pptok.h preproc.h raa.h rbtree.h regs.h &
saa.h stdscan.h
+output\outexe.$(O): output\outexe.c compiler.h insnsi.h nasm.h nasmlib.h &
+ output\outform.h pptok.h preproc.h regs.h
output\outform.$(O): output\outform.c compiler.h insnsi.h nasm.h nasmlib.h &
output\outform.h pptok.h preproc.h regs.h
output\outieee.$(O): output\outieee.c compiler.h insnsi.h nasm.h nasmlib.h &
output\outform.h output\outlib.h pptok.h preproc.h regs.h
output\outlib.$(O): output\outlib.c compiler.h insnsi.h nasm.h nasmlib.h &
output\outlib.h pptok.h preproc.h regs.h
-output\outmacho.$(O): output\outmacho.c compiler.h insnsi.h nasm.h nasmlib.h &
- output\outform.h output\outlib.h pptok.h preproc.h raa.h regs.h saa.h
+output\outmacho32.$(O): output\outmacho32.c compiler.h insnsi.h nasm.h &
+ nasmlib.h output\outform.h output\outlib.h pptok.h preproc.h raa.h regs.h &
+ saa.h
+output\outmacho64.$(O): output\outmacho64.c compiler.h insnsi.h nasm.h &
+ nasmlib.h output\outform.h output\outlib.h pptok.h preproc.h raa.h regs.h &
+ saa.h
output\outobj.$(O): output\outobj.c compiler.h insnsi.h nasm.h nasmlib.h &
output\outform.h output\outlib.h pptok.h preproc.h regs.h stdscan.h
output\outrdf.$(O): output\outrdf.c compiler.h insnsi.h nasm.h nasmlib.h &
@@ -286,7 +295,6 @@ output\outrdf.$(O): output\outrdf.c compiler.h insnsi.h nasm.h nasmlib.h &
output\outrdf2.$(O): output\outrdf2.c compiler.h insnsi.h nasm.h nasmlib.h &
output\outform.h output\outlib.h pptok.h preproc.h rdoff\rdoff.h regs.h &
saa.h
-owtest.$(O): owtest.c
parser.$(O): parser.c compiler.h float.h insns.h insnsi.h nasm.h nasmlib.h &
parser.h pptok.h preproc.h regs.h stdscan.h tables.h tokens.h
pptok.$(O): pptok.c compiler.h hashtbl.h nasmlib.h pptok.h preproc.h
diff --git a/Mkfiles/owlinux.mak b/Mkfiles/owlinux.mak
index 7299892..bda449e 100644
--- a/Mkfiles/owlinux.mak
+++ b/Mkfiles/owlinux.mak
@@ -60,15 +60,16 @@ X = .exe
NASM = nasm.$(O) nasmlib.$(O) ver.$(O) \
raa.$(O) saa.$(O) rbtree.$(O) \
float.$(O) insnsa.$(O) insnsb.$(O) \
+ directives.$(O) \
assemble.$(O) labels.$(O) hashtbl.$(O) crc64.$(O) parser.$(O) \
output/outform.$(O) output/outlib.$(O) output/nulldbg.$(O) \
output/outbin.$(O) output/outaout.$(O) output/outcoff.$(O) \
output/outelf.$(O) output/outelf32.$(O) output/outelf64.$(O) \
output/outobj.$(O) output/outas86.$(O) output/outrdf2.$(O) \
- output/outdbg.$(O) output/outieee.$(O) output/outmacho.$(O) \
- preproc.$(O) quote.$(O) pptok.$(O) macros.$(O) \
- listing.$(O) eval.$(O) exprlib.$(O) stdscan.$(O) strfunc.$(O) \
- tokhash.$(O) regvals.$(O) regflags.$(O)
+ output/outdbg.$(O) output/outieee.$(O) output/outmacho32.$(O) \
+ output/outmacho64.$(O) preproc.$(O) quote.$(O) pptok.$(O) \
+ macros.$(O) listing.$(O) eval.$(O) exprlib.$(O) stdscan.$(O) \
+ strfunc.$(O) tokhash.$(O) regvals.$(O) regflags.$(O)
NDISASM = ndisasm.$(O) disasm.$(O) sync.$(O) nasmlib.$(O) ver.$(O) \
insnsd.$(O) insnsb.$(O) insnsn.$(O) regs.$(O) regdis.$(O)
@@ -224,6 +225,8 @@ everything: all doc rdf
assemble.$(O): assemble.c assemble.h compiler.h insns.h insnsi.h nasm.h \
nasmlib.h pptok.h preproc.h regs.h tables.h tokens.h
crc64.$(O): crc64.c compiler.h nasmlib.h
+directives.$(O): directives.c compiler.h directives.h hashtbl.h insnsi.h \
+ nasm.h nasmlib.h pptok.h preproc.h regs.h
disasm.$(O): disasm.c compiler.h disasm.h insns.h insnsi.h nasm.h nasmlib.h \
pptok.h preproc.h regdis.h regs.h sync.h tables.h tokens.h
eval.$(O): eval.c compiler.h eval.h float.h insnsi.h labels.h nasm.h \
@@ -249,9 +252,9 @@ listing.$(O): listing.c compiler.h insnsi.h listing.h nasm.h nasmlib.h \
pptok.h preproc.h regs.h
macros.$(O): macros.c compiler.h hashtbl.h insnsi.h nasm.h nasmlib.h \
output/outform.h pptok.h preproc.h regs.h tables.h
-nasm.$(O): nasm.c assemble.h compiler.h eval.h float.h insns.h insnsi.h \
- labels.h listing.h nasm.h nasmlib.h output/outform.h parser.h pptok.h \
- preproc.h raa.h regs.h saa.h stdscan.h tokens.h
+nasm.$(O): nasm.c assemble.h compiler.h directives.h eval.h float.h insns.h \
+ insnsi.h labels.h listing.h nasm.h nasmlib.h output/outform.h parser.h \
+ pptok.h preproc.h raa.h regs.h saa.h stdscan.h tokens.h
nasmlib.$(O): nasmlib.c compiler.h insns.h insnsi.h nasm.h nasmlib.h pptok.h \
preproc.h regs.h tokens.h
ndisasm.$(O): ndisasm.c compiler.h disasm.h insns.h insnsi.h nasm.h \
@@ -281,14 +284,20 @@ output/outelf64.$(O): output/outelf64.c compiler.h insnsi.h nasm.h nasmlib.h \
output/dwarf.h output/elf64.h output/elfcommon.h output/outelf.h \
output/outform.h output/outlib.h pptok.h preproc.h raa.h rbtree.h regs.h \
saa.h stdscan.h
+output/outexe.$(O): output/outexe.c compiler.h insnsi.h nasm.h nasmlib.h \
+ output/outform.h pptok.h preproc.h regs.h
output/outform.$(O): output/outform.c compiler.h insnsi.h nasm.h nasmlib.h \
output/outform.h pptok.h preproc.h regs.h
output/outieee.$(O): output/outieee.c compiler.h insnsi.h nasm.h nasmlib.h \
output/outform.h output/outlib.h pptok.h preproc.h regs.h
output/outlib.$(O): output/outlib.c compiler.h insnsi.h nasm.h nasmlib.h \
output/outlib.h pptok.h preproc.h regs.h
-output/outmacho.$(O): output/outmacho.c compiler.h insnsi.h nasm.h nasmlib.h \
- output/outform.h output/outlib.h pptok.h preproc.h raa.h regs.h saa.h
+output/outmacho32.$(O): output/outmacho32.c compiler.h insnsi.h nasm.h \
+ nasmlib.h output/outform.h output/outlib.h pptok.h preproc.h raa.h regs.h \
+ saa.h
+output/outmacho64.$(O): output/outmacho64.c compiler.h insnsi.h nasm.h \
+ nasmlib.h output/outform.h output/outlib.h pptok.h preproc.h raa.h regs.h \
+ saa.h
output/outobj.$(O): output/outobj.c compiler.h insnsi.h nasm.h nasmlib.h \
output/outform.h output/outlib.h pptok.h preproc.h regs.h stdscan.h
output/outrdf.$(O): output/outrdf.c compiler.h insnsi.h nasm.h nasmlib.h \
@@ -296,7 +305,6 @@ output/outrdf.$(O): output/outrdf.c compiler.h insnsi.h nasm.h nasmlib.h \
output/outrdf2.$(O): output/outrdf2.c compiler.h insnsi.h nasm.h nasmlib.h \
output/outform.h output/outlib.h pptok.h preproc.h rdoff/rdoff.h regs.h \
saa.h
-owtest.$(O): owtest.c
parser.$(O): parser.c compiler.h float.h insns.h insnsi.h nasm.h nasmlib.h \
parser.h pptok.h preproc.h regs.h stdscan.h tables.h tokens.h
pptok.$(O): pptok.c compiler.h hashtbl.h nasmlib.h pptok.h preproc.h
diff --git a/directives.dat b/directives.dat
new file mode 100644
index 0000000..95d20eb
--- /dev/null
+++ b/directives.dat
@@ -0,0 +1,52 @@
+;; --------------------------------------------------------------------------
+;;
+;; Copyright 1996-2009 The NASM Authors - All Rights Reserved
+;; See the file AUTHORS included with the NASM distribution for
+;; the specific copyright holders.
+;;
+;; Redistribution and use in source and binary forms, with or without
+;; modification, are permitted provided that the following
+;; conditions are met:
+;;
+;; * Redistributions of source code must retain the above copyright
+;; notice, this list of conditions and the following disclaimer.
+;; * Redistributions in binary form must reproduce the above
+;; copyright notice, this list of conditions and the following
+;; disclaimer in the documentation and/or other materials provided
+;; with the distribution.
+;;
+;; THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
+;; CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
+;; INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+;; MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+;; DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
+;; CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+;; SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+;; NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+;; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+;; HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+;; CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
+;; OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
+;; EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+;;
+;; --------------------------------------------------------------------------
+;;
+;; List of global NASM directives (independent of the backend)
+;;
+;; Note: we may want to consider hashing even backend-dependent
+;; directives, and invoke the backend with an already-decoded directive
+;; number.
+;;
+absolute
+bits
+common
+cpu
+debug
+default
+extern
+float
+global
+list
+section
+segment
+warning
diff --git a/nasm.c b/nasm.c
index a938aaa..d1cd465 100644
--- a/nasm.c
+++ b/nasm.c
@@ -1,5 +1,5 @@
/* ----------------------------------------------------------------------- *
- *
+ *
* Copyright 1996-2009 The NASM Authors - All Rights Reserved
* See the file AUTHORS included with the NASM distribution for
* the specific copyright holders.
@@ -14,7 +14,7 @@
* copyright notice, this list of conditions and the following
* disclaimer in the documentation and/or other materials provided
* with the distribution.
- *
+ *
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
* CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
* INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
@@ -31,7 +31,7 @@
*
* ----------------------------------------------------------------------- */
-/*
+/*
* The Netwide Assembler main program module
*/
@@ -60,6 +60,7 @@
#include "labels.h"
#include "output/outform.h"
#include "listing.h"
+#include "directives.h"
struct forwrefinfo { /* info held on forward refs. */
int lineno;
@@ -284,7 +285,7 @@ static void emit_dependencies(StrList *list)
} else {
deps = stdout;
}
-
+
linepos = fprintf(deps, "%s:", depend_target);
for (l = list; l; l = l->next) {
len = strlen(l->str);
@@ -296,11 +297,11 @@ static void emit_dependencies(StrList *list)
linepos += len+1;
}
fprintf(deps, "\n\n");
-
+
for (l = list; l; l = nl) {
if (depend_emit_phony)
fprintf(deps, "%s:\n\n", l->str);
-
+
nl = l->next;
nasm_free(l);
}
@@ -1150,15 +1151,6 @@ static void parse_cmdline(int argc, char **argv)
}
}
-/* List of directives */
-enum directives {
- D_NONE, D_ABSOLUTE, D_BITS, D_COMMON, D_CPU, D_DEBUG, D_DEFAULT,
- D_EXTERN, D_FLOAT, D_GLOBAL, D_LIST, D_SECTION, D_SEGMENT, D_WARNING
-};
-static const char *directives[] = {
- "", "absolute", "bits", "common", "cpu", "debug", "default",
- "extern", "float", "global", "list", "section", "segment", "warning"
-};
static enum directives getkw(char **directive, char **value);
static void assemble_file(char *fname, StrList **depend_ptr)
@@ -1520,7 +1512,7 @@ static void assemble_file(char *fname, StrList **depend_ptr)
&& forwref->lineno == globallineno);
} else
output_ins.forw_ref = false;
-
+
if (output_ins.forw_ref) {
if (passn == 1) {
for (i = 0; i < output_ins.operands; i++) {
@@ -1806,7 +1798,7 @@ static enum directives getkw(char **directive, char **value)
*buf++ = '\0';
}
- return bsii(*directive, directives, elements(directives));
+ return find_directive(*directive);
}
/**
@@ -1922,7 +1914,7 @@ static void report_error_common(int severity, const char *fmt,
{
char msg[1024];
const char *pfx;
-
+
switch (severity & (ERR_MASK|ERR_NO_SEVERITY)) {
case ERR_WARNING:
pfx = "warning: ";