summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCharles Crayne <chuck@thor.crayne.org>2007-09-28 15:16:47 -0700
committerCharles Crayne <chuck@thor.crayne.org>2007-09-28 15:16:47 -0700
commit99e03176694a449bac08b2652061f1a1d2688507 (patch)
tree3d1376703785b116851aef4cfc2cb6f544b60ade
parentcc00498f5fd14d58bde0f7e32c9b777ca1b94600 (diff)
parent43827654ac5cef5ce37a1faaaf86103fa51d1ea8 (diff)
downloadnasm-99e03176694a449bac08b2652061f1a1d2688507.tar.gz
Merge branch 'master' of git+ssh://ccrayne@repo.or.cz/srv/git/nasm
-rw-r--r--Makefile.in14
-rw-r--r--Mkfiles/README62
-rw-r--r--Mkfiles/msvc.mak123
-rw-r--r--Mkfiles/openwcom.mak272
-rw-r--r--Mkfiles/owlinux.mak265
-rw-r--r--assemble.c2
-rw-r--r--compiler.h21
-rw-r--r--configure.in9
-rw-r--r--doc/nasmdoc.src75
-rw-r--r--hashtbl.c4
-rw-r--r--insns.dat26
-rw-r--r--lib/snprintf.c24
-rw-r--r--lib/vsnprintf.c49
-rwxr-xr-xmkdep.pl29
-rw-r--r--nasm.c13
-rw-r--r--nasmlib.c33
-rw-r--r--nasmlib.h3
-rw-r--r--test/movimm.asm26
-rw-r--r--test/riprel.asm652
-rw-r--r--test/riprel.pl23
-rw-r--r--version2
-rwxr-xr-xversion.pl20
22 files changed, 1511 insertions, 236 deletions
diff --git a/Makefile.in b/Makefile.in
index d41d4554..dd21a106 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -23,6 +23,8 @@ LDFLAGS = @LDFLAGS@
LIBS = @LIBS@
PERL = perl -I$(srcdir)/perllib
+XOBJS = @XOBJS@
+
INSTALL = @INSTALL@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_DATA = @INSTALL_DATA@
@@ -70,11 +72,11 @@ NDISASM = ndisasm.$(O) disasm.$(O) sync.$(O) nasmlib.$(O) insnsd.$(O)
all: nasm$(X) ndisasm$(X) nasm.man ndisasm.man
cd rdoff && $(MAKE) all
-nasm$(X): $(NASM)
- $(CC) $(LDFLAGS) -o nasm$(X) $(NASM) $(LIBS)
+nasm$(X): $(NASM) $(XOBJS)
+ $(CC) $(LDFLAGS) -o nasm$(X) $(NASM) $(XOBJS) $(LIBS)
-ndisasm$(X): $(NDISASM)
- $(CC) $(LDFLAGS) -o ndisasm$(X) $(NDISASM) $(LIBS)
+ndisasm$(X): $(NDISASM) $(XOBJS)
+ $(CC) $(LDFLAGS) -o ndisasm$(X) $(NDISASM) $(XOBJS) $(LIBS)
# These source files are automagically generated from a single
# instruction-table file by a Perl script. They're distributed,
@@ -214,7 +216,7 @@ splint:
#
alldeps: perlreq
$(PERL) mkdep.pl -M Makefile.in Mkfiles/*.mak -- \
- . output
+ . output lib
./config.status
#-- Magic hints to mkdep.pl --#
@@ -242,6 +244,8 @@ insnsd.$(O): insnsd.c compiler.h config.h insns.h insnsi.h nasm.h nasmlib.h \
insnsn.$(O): insnsn.c
labels.$(O): labels.c compiler.h config.h hashtbl.h insnsi.h nasm.h \
nasmlib.h regs.h version.h
+lib/snprintf.$(O): lib/snprintf.c compiler.h config.h nasmlib.h
+lib/vsnprintf.$(O): lib/vsnprintf.c compiler.h config.h nasmlib.h
listing.$(O): listing.c compiler.h config.h insnsi.h listing.h nasm.h \
nasmlib.h regs.h version.h
macros.$(O): macros.c
diff --git a/Mkfiles/README b/Mkfiles/README
index 047c7884..1144517d 100644
--- a/Mkfiles/README
+++ b/Mkfiles/README
@@ -1,44 +1,34 @@
These are pre-created Makefiles for various platforms, use them if
GNU autoconf/automake packages are not supported on your system.
-Copy appropriate Makefile to ../Makefile, look at it to see if there
-are any edits that need to be made, and run make.
+The Makefiles are:
-Some of these Makefiles have been contributed by end users, and the
-NASM team has no way of knowing if they work correctly or not. For
-that reason, there are sometimes multiple Makefiles for the same
-platform. Look at the comments at the beginning to help select a
-Makefile for your particular system.
+ Filename Target Compiler Tested with
+ ---------------------------------------------------------------------------
+ msvc.mak Win32 MS Visual C++ Visual C++ Express 2005
+ For building on a Win32 host using Microsoft Visual C++.
-The Makefiles are:
+ Usage: nmake /f Mkfiles/msvc.mak
+
+
+ Filename Target Compiler Tested with
+ ---------------------------------------------------------------------------
+ openwcom.mak DOS,Win32,OS/2 OpenWatcom C OpenWatcom 1.7 (Win32)
- Filename Target Compiler Notes
+ For building on a DOS, OS/2 or Win32 host using OpenWatcom.
+ OpenWatcom can be downloaded from http://www.openwatcom.org/.
+
+ Usage: wmake /f Mkfiles/<filename> <target>
+
+ <target> is dos, win32, or os2.
+
+ Filename Target Compiler Tested with
---------------------------------------------------------------------------
- Makefile.b32 Win32 Borland C++ OK as of NASM 0.98.37
- Makefile.bc3 16-bit DOS Borland C++ OK as of NASM 0.98.34
- Makefile.bor 16-bit DOS Turbo C (**)
- Makefile.dcp Win32 Dev-Cpp/MinGW OK as of NASM 0.99.00
- Makefile.dj 32-bit DOS DJGPP OK as of NASM 0.98.37
- Makefile.djo 32-bit DOS DJGPP "Opus Make" version(**)
- Makefile.dl 32-bit DOS cc386 cc386 by David Lindauer
- Makefile.dos 16-bit DOS MSC 5 (**)
- Makefile.ms7 16-bit DOS MSC 7 OK as of NASM 0.98.31
- Makefile.os2 OS/2 Warp Borland C++ (**)
- Makefile.sc 32-bit DOS Symantec C++ 7
- Makefile.scw Win32 Symantec C++ 7
- Makefile.unx Unix Any(*) use only if "configure" fails
- Makefile.vc Win32 MS Visual C++ OK as of NASM 0.98.32
- Makefile.wc 32-bit DOS Watcom C (**)
- Makefile.wcd 16-bit DOS OpenWatcom C OK as of NASM 0.98.37
- Makefile.wcw Win32 Watcom C (**)
-
-
-(*) = This Makefile should work with any compiler which is ANSI
- C89/ISO C90 compliant and that uses the standard Unix compiler
- arguments, such as -c, -o, -I and -O. Pre-ANSI compilers,
- such as the "cc" distributed with SunOS 4.x, will not work.
- If you find a system on which you need to use this, please write
- <nasm-devel@lists.sourceforge.net> and tell us which system.
-
-(**) = Probably obsolete, needs updating.
+ owlinux.mak DOS,Win32,OS/2 OpenWatcom C OpenWatcom 1.6rc2 (Linux)
+
+ For building on a Linux host using OpenWatcom for Linux.
+
+ Usage: make -f Mkfiles/<filename> <target>
+
+ <target> is dos, win32, or os2.
diff --git a/Mkfiles/msvc.mak b/Mkfiles/msvc.mak
index 5871efb3..66cd9814 100644
--- a/Mkfiles/msvc.mak
+++ b/Mkfiles/msvc.mak
@@ -171,76 +171,77 @@ everything: all doc rdf
#-- Magic hints to mkdep.pl --#
# @object-ending: ".$(O)"
# @path-separator: "/"
+# @exclude: "config.h"
#-- Everything below is generated by mkdep.pl - do not edit --#
-assemble.$(O): assemble.c assemble.h compiler.h config.h insns.h insnsi.h \
- nasm.h nasmlib.h pptok.h preproc.h regflags.c regs.h regvals.c tokens.h \
- version.h
+assemble.$(O): assemble.c assemble.h compiler.h insns.h insnsi.h nasm.h \
+ nasmlib.h pptok.h preproc.h regflags.c regs.h regvals.c tokens.h version.h
crc64.$(O): crc64.c
-disasm.$(O): disasm.c compiler.h config.h disasm.h insns.h insnsi.h insnsn.c \
- names.c nasm.h nasmlib.h regdis.c regs.c regs.h sync.h tokens.h version.h
-eval.$(O): eval.c compiler.h config.h eval.h float.h insnsi.h labels.h \
- nasm.h nasmlib.h regs.h version.h
-exprlib.$(O): exprlib.c compiler.h config.h insnsi.h nasm.h nasmlib.h regs.h \
- version.h
-float.$(O): float.c compiler.h config.h insnsi.h nasm.h nasmlib.h regs.h \
- version.h
-hashtbl.$(O): hashtbl.c compiler.h config.h hashtbl.h insnsi.h nasm.h \
+disasm.$(O): disasm.c compiler.h disasm.h insns.h insnsi.h insnsn.c names.c \
+ nasm.h nasmlib.h regdis.c regs.c regs.h sync.h tokens.h version.h
+eval.$(O): eval.c compiler.h eval.h float.h insnsi.h labels.h nasm.h \
nasmlib.h regs.h version.h
-insnsa.$(O): insnsa.c compiler.h config.h insns.h insnsi.h nasm.h nasmlib.h \
- regs.h tokens.h version.h
-insnsd.$(O): insnsd.c compiler.h config.h insns.h insnsi.h nasm.h nasmlib.h \
- regs.h tokens.h version.h
+exprlib.$(O): exprlib.c compiler.h insnsi.h nasm.h nasmlib.h regs.h \
+ version.h
+float.$(O): float.c compiler.h insnsi.h nasm.h nasmlib.h regs.h version.h
+hashtbl.$(O): hashtbl.c compiler.h hashtbl.h insnsi.h nasm.h nasmlib.h \
+ regs.h version.h
+insnsa.$(O): insnsa.c compiler.h insns.h insnsi.h nasm.h nasmlib.h regs.h \
+ tokens.h version.h
+insnsd.$(O): insnsd.c compiler.h insns.h insnsi.h nasm.h nasmlib.h regs.h \
+ tokens.h version.h
insnsn.$(O): insnsn.c
-labels.$(O): labels.c compiler.h config.h hashtbl.h insnsi.h nasm.h \
- nasmlib.h regs.h version.h
-listing.$(O): listing.c compiler.h config.h insnsi.h listing.h nasm.h \
- nasmlib.h regs.h version.h
+labels.$(O): labels.c compiler.h hashtbl.h insnsi.h nasm.h nasmlib.h regs.h \
+ version.h
+lib/snprintf.$(O): lib/snprintf.c compiler.h nasmlib.h
+lib/vsnprintf.$(O): lib/vsnprintf.c compiler.h nasmlib.h
+listing.$(O): listing.c compiler.h insnsi.h listing.h nasm.h nasmlib.h \
+ regs.h version.h
macros.$(O): macros.c
names.$(O): names.c insnsn.c regs.c
-nasm.$(O): nasm.c assemble.h compiler.h config.h eval.h insns.h insnsi.h \
- labels.h listing.h nasm.h nasmlib.h outform.h parser.h pptok.h preproc.h \
- regs.h stdscan.h tokens.h version.h
-nasmlib.$(O): nasmlib.c compiler.h config.h insns.h insnsi.h nasm.h \
- nasmlib.h regs.h tokens.h version.h
-ndisasm.$(O): ndisasm.c compiler.h config.h disasm.h insns.h insnsi.h nasm.h \
+nasm.$(O): nasm.c assemble.h compiler.h eval.h insns.h insnsi.h labels.h \
+ listing.h nasm.h nasmlib.h outform.h parser.h pptok.h preproc.h regs.h \
+ stdscan.h tokens.h version.h
+nasmlib.$(O): nasmlib.c compiler.h insns.h insnsi.h nasm.h nasmlib.h regs.h \
+ tokens.h version.h
+ndisasm.$(O): ndisasm.c compiler.h disasm.h insns.h insnsi.h nasm.h \
nasmlib.h regs.h sync.h tokens.h version.h
-outform.$(O): outform.c compiler.h config.h insnsi.h nasm.h nasmlib.h \
+outform.$(O): outform.c compiler.h insnsi.h nasm.h nasmlib.h outform.h \
+ regs.h version.h
+output/outaout.$(O): output/outaout.c compiler.h insnsi.h nasm.h nasmlib.h \
+ outform.h regs.h stdscan.h version.h
+output/outas86.$(O): output/outas86.c compiler.h insnsi.h nasm.h nasmlib.h \
+ outform.h regs.h version.h
+output/outbin.$(O): output/outbin.c compiler.h eval.h insnsi.h labels.h \
+ nasm.h nasmlib.h outform.h regs.h stdscan.h version.h
+output/outcoff.$(O): output/outcoff.c compiler.h insnsi.h nasm.h nasmlib.h \
+ outform.h regs.h version.h
+output/outdbg.$(O): output/outdbg.c compiler.h insnsi.h nasm.h nasmlib.h \
+ outform.h regs.h version.h
+output/outelf32.$(O): output/outelf32.c compiler.h insnsi.h nasm.h nasmlib.h \
+ outform.h regs.h stdscan.h version.h
+output/outelf64.$(O): output/outelf64.c compiler.h insnsi.h nasm.h nasmlib.h \
+ outform.h regs.h stdscan.h version.h
+output/outieee.$(O): output/outieee.c compiler.h insnsi.h nasm.h nasmlib.h \
+ outform.h regs.h version.h
+output/outmacho.$(O): output/outmacho.c compiler.h insnsi.h nasm.h nasmlib.h \
+ outform.h regs.h version.h
+output/outobj.$(O): output/outobj.c compiler.h insnsi.h nasm.h nasmlib.h \
+ outform.h regs.h stdscan.h version.h
+output/outrdf.$(O): output/outrdf.c compiler.h insnsi.h nasm.h nasmlib.h \
outform.h regs.h version.h
-output/outaout.$(O): output/outaout.c compiler.h config.h insnsi.h nasm.h \
- nasmlib.h outform.h regs.h stdscan.h version.h
-output/outas86.$(O): output/outas86.c compiler.h config.h insnsi.h nasm.h \
- nasmlib.h outform.h regs.h version.h
-output/outbin.$(O): output/outbin.c compiler.h config.h eval.h insnsi.h \
- labels.h nasm.h nasmlib.h outform.h regs.h stdscan.h version.h
-output/outcoff.$(O): output/outcoff.c compiler.h config.h insnsi.h nasm.h \
- nasmlib.h outform.h regs.h version.h
-output/outdbg.$(O): output/outdbg.c compiler.h config.h insnsi.h nasm.h \
- nasmlib.h outform.h regs.h version.h
-output/outelf32.$(O): output/outelf32.c compiler.h config.h insnsi.h nasm.h \
- nasmlib.h outform.h regs.h stdscan.h version.h
-output/outelf64.$(O): output/outelf64.c compiler.h config.h insnsi.h nasm.h \
- nasmlib.h outform.h regs.h stdscan.h version.h
-output/outieee.$(O): output/outieee.c compiler.h config.h insnsi.h nasm.h \
- nasmlib.h outform.h regs.h version.h
-output/outmacho.$(O): output/outmacho.c compiler.h config.h insnsi.h nasm.h \
- nasmlib.h outform.h regs.h version.h
-output/outobj.$(O): output/outobj.c compiler.h config.h insnsi.h nasm.h \
- nasmlib.h outform.h regs.h stdscan.h version.h
-output/outrdf.$(O): output/outrdf.c compiler.h config.h insnsi.h nasm.h \
- nasmlib.h outform.h regs.h version.h
-output/outrdf2.$(O): output/outrdf2.c compiler.h config.h insnsi.h nasm.h \
- nasmlib.h outform.h rdoff/rdoff.h regs.h version.h
-parser.$(O): parser.c compiler.h config.h float.h insns.h insnsi.h nasm.h \
- nasmlib.h parser.h regflags.c regs.h stdscan.h tokens.h version.h
-pptok.$(O): pptok.c compiler.h config.h nasmlib.h pptok.h preproc.h
-preproc.$(O): preproc.c compiler.h config.h hashtbl.h insnsi.h macros.c \
- nasm.h nasmlib.h pptok.h preproc.h regs.h version.h
+output/outrdf2.$(O): output/outrdf2.c compiler.h insnsi.h nasm.h nasmlib.h \
+ outform.h rdoff/rdoff.h regs.h version.h
+parser.$(O): parser.c compiler.h float.h insns.h insnsi.h nasm.h nasmlib.h \
+ parser.h regflags.c regs.h stdscan.h tokens.h version.h
+pptok.$(O): pptok.c compiler.h nasmlib.h pptok.h preproc.h
+preproc.$(O): preproc.c compiler.h hashtbl.h insnsi.h macros.c nasm.h \
+ nasmlib.h pptok.h preproc.h regs.h version.h
regdis.$(O): regdis.c
regflags.$(O): regflags.c
regs.$(O): regs.c
regvals.$(O): regvals.c
-stdscan.$(O): stdscan.c compiler.h config.h insns.h insnsi.h nasm.h \
- nasmlib.h regs.h stdscan.h tokens.h version.h
-sync.$(O): sync.c compiler.h config.h nasmlib.h sync.h
-tokhash.$(O): tokhash.c compiler.h config.h insns.h insnsi.h nasm.h \
- nasmlib.h regs.h tokens.h version.h
+stdscan.$(O): stdscan.c compiler.h insns.h insnsi.h nasm.h nasmlib.h regs.h \
+ stdscan.h tokens.h version.h
+sync.$(O): sync.c compiler.h nasmlib.h sync.h
+tokhash.$(O): tokhash.c compiler.h insns.h insnsi.h nasm.h nasmlib.h regs.h \
+ tokens.h version.h
diff --git a/Mkfiles/openwcom.mak b/Mkfiles/openwcom.mak
new file mode 100644
index 00000000..955f4f4f
--- /dev/null
+++ b/Mkfiles/openwcom.mak
@@ -0,0 +1,272 @@
+# -*- makefile -*-
+#
+# Makefile for building NASM using OpenWatcom 1.7
+# building on a DOS/Win/OS2 platform host (backslashes
+# used in pathnames)
+#
+
+top_srcdir = .
+srcdir = .
+VPATH = .\output
+prefix = C:\Program Files\NASM
+exec_prefix = $(prefix)
+bindir = $(prefix)\bin
+mandir = $(prefix)\man
+
+CC = wcl386
+CFLAGS = -3 -bcl=$(TARGET) -ox -wx -ze -fpi
+BUILD_CFLAGS = $(CFLAGS) # -I$(srcdir)/inttypes
+INTERNAL_CFLAGS = -I$(srcdir) -I. -DHAVE_SNPRINTF -DHAVE_VSNPRINTF
+ALL_CFLAGS = $(BUILD_CFLAGS) $(INTERNAL_CFLAGS)
+LD = $(CC)
+LDFLAGS = $(ALL_CFLAGS)
+LIBS =
+PERL = perl -I$(srcdir)/perllib
+
+STRIP = wstrip
+
+# Binary suffixes
+O = obj
+X = .exe
+
+# WMAKE errors out if a suffix is declared more than once, including
+# its own built-in declarations. Thus, we need to explicitly clear the list
+# first. Also, WMAKE only allows implicit rules that point "to the left"
+# in this list!
+.SUFFIXES:
+.SUFFIXES: .man .1 .$(O) .i .c
+
+# Needed to find C files anywhere but in the current directory
+.c : $(VPATH)
+
+.c.$(O):
+ $(CC) -c $(ALL_CFLAGS) -fo=$^@ $[@
+
+# Note: wcl386 is broken if forward slashes are used as path separators.
+NASM = nasm.$(O) nasmlib.$(O) float.$(O) insnsa.$(O) assemble.$(O) &
+ labels.$(O) hashtbl.$(O) crc64.$(O) parser.$(O) &
+ outform.$(O) output\outbin.$(O) &
+ output\outaout.$(O) output\outcoff.$(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) pptok.$(O) &
+ listing.$(O) eval.$(O) exprlib.$(O) stdscan.$(O) tokhash.$(O)
+
+NDISASM = ndisasm.$(O) disasm.$(O) sync.$(O) nasmlib.$(O) insnsd.$(O)
+
+what: .SYMBOLIC
+ @echo Please build "dos", "win32" or "os2"
+
+dos: .SYMBOLIC
+ $(MAKE) /f $(__MAKEFILES__) all TARGET=DOS4G
+
+win32: .SYMBOLIC
+ $(MAKE) /f $(__MAKEFILES__) all TARGET=NT
+
+os2: .SYMBOLIC
+ $(MAKE) /f $(__MAKEFILES__) all TARGET=OS2V2
+
+all: nasm$(X) ndisasm$(X) .SYMBOLIC
+ rem cd rdoff && $(MAKE) all
+
+nasm$(X): $(NASM)
+ $(LD) $(LDFLAGS) -fe=nasm$(X) $(NASM) $(LIBS)
+
+ndisasm$(X): $(NDISASM)
+ $(LD) $(LDFLAGS) -fe=ndisasm$(X) $(NDISASM) $(LIBS)
+
+# These source files are automagically generated from a single
+# instruction-table file by a Perl script. They're distributed,
+# though, so it isn't necessary to have Perl just to recompile NASM
+# from the distribution.
+
+insnsa.c: insns.dat insns.pl
+ $(PERL) $(srcdir)/insns.pl -a $(srcdir)/insns.dat
+insnsd.c: insns.dat insns.pl
+ $(PERL) $(srcdir)/insns.pl -d $(srcdir)/insns.dat
+insnsi.h: insns.dat insns.pl
+ $(PERL) $(srcdir)/insns.pl -i $(srcdir)/insns.dat
+insnsn.c: insns.dat insns.pl
+ $(PERL) $(srcdir)/insns.pl -n $(srcdir)/insns.dat
+
+# These files contains all the standard macros that are derived from
+# the version number.
+version.h: version version.pl
+ $(PERL) $(srcdir)/version.pl h < $(srcdir)/version > version.h
+
+version.mac: version version.pl
+ $(PERL) $(srcdir)/version.pl mac < $(srcdir)/version > version.mac
+
+# This source file is generated from the standard macros file
+# `standard.mac' by another Perl script. Again, it's part of the
+# standard distribution.
+
+macros.c: macros.pl standard.mac version.mac
+ $(PERL) $(srcdir)/macros.pl $(srcdir)/standard.mac version.mac
+
+# These source files are generated from regs.dat by yet another
+# perl script.
+regs.c: regs.dat regs.pl
+ $(PERL) $(srcdir)/regs.pl c $(srcdir)/regs.dat > regs.c
+regflags.c: regs.dat regs.pl
+ $(PERL) $(srcdir)/regs.pl fc $(srcdir)/regs.dat > regflags.c
+regdis.c: regs.dat regs.pl
+ $(PERL) $(srcdir)/regs.pl dc $(srcdir)/regs.dat > regdis.c
+regvals.c: regs.dat regs.pl
+ $(PERL) $(srcdir)/regs.pl vc $(srcdir)/regs.dat > regvals.c
+regs.h: regs.dat regs.pl
+ $(PERL) $(srcdir)/regs.pl h $(srcdir)/regs.dat > regs.h
+
+# Assembler token hash
+tokhash.c: insns.dat regs.dat tokens.dat tokhash.pl perllib/phash.ph
+ $(PERL) $(srcdir)/tokhash.pl c $(srcdir)/insns.dat $(srcdir)/regs.dat &
+ $(srcdir)/tokens.dat > tokhash.c
+
+# Assembler token metadata
+tokens.h: insns.dat regs.dat tokens.dat tokhash.pl perllib/phash.ph
+ $(PERL) $(srcdir)/tokhash.pl h $(srcdir)/insns.dat $(srcdir)/regs.dat &
+ $(srcdir)/tokens.dat > tokens.h
+
+# Preprocessor token hash
+pptok.h: pptok.dat pptok.pl perllib/phash.ph
+ $(PERL) $(srcdir)/pptok.pl h $(srcdir)/pptok.dat pptok.h
+pptok.c: pptok.dat pptok.pl perllib/phash.ph
+ $(PERL) $(srcdir)/pptok.pl c $(srcdir)/pptok.dat pptok.c
+
+# This target generates all files that require perl.
+# This allows easier generation of distribution (see dist target).
+PERLREQ = macros.c insnsa.c insnsd.c insnsi.h insnsn.c &
+ regs.c regs.h regflags.c regdis.c regvals.c tokhash.c tokens.h &
+ version.h version.mac pptok.h pptok.c
+perlreq: $(PERLREQ)
+
+clean: .SYMBOLIC
+ -del /f *.$(O)
+ -del /f *.s
+ -del /f *.i
+ -del /f output\*.$(O)
+ -del /f output\*.s
+ -del /f output\*.i
+ -del /f nasm$(X)
+ -del /f ndisasm$(X)
+ rem cd rdoff && $(MAKE) clean
+
+distclean: clean .SYMBOLIC
+ -del /f config.h
+ -del /f config.log
+ -del /f config.status
+ -del /f Makefile
+ -del /f *~
+ -del /f *.bak
+ -del /f *.lst
+ -del /f *.bin
+ -del /f output\*~
+ -del /f output\*.bak
+ -del /f test\*.lst
+ -del /f test\*.bin
+ -del /f test\*.$(O)
+ -del /f test\*.bin
+ -del /f/s autom4te*.cache
+ rem cd rdoff && $(MAKE) distclean
+
+cleaner: clean .SYMBOLIC
+ -del /f $(PERLREQ)
+ -del /f *.man
+ -del /f nasm.spec
+ rem cd doc && $(MAKE) clean
+
+spotless: distclean cleaner .SYMBOLIC
+ -del /f doc\Makefile
+ -del doc\*~
+ -del doc\*.bak
+
+strip: .SYMBOLIC
+ $(STRIP) *.exe
+
+rdf:
+ # cd rdoff && $(MAKE)
+
+doc:
+ # cd doc && $(MAKE) all
+
+everything: all doc rdf
+
+#-- Magic hints to mkdep.pl --#
+# @object-ending: ".$(O)"
+# @path-separator: "\"
+# @exclude: "config.h"
+# @continuation: "&"
+#-- Everything below is generated by mkdep.pl - do not edit --#
+assemble.$(O): assemble.c assemble.h compiler.h insns.h insnsi.h nasm.h &
+ nasmlib.h pptok.h preproc.h regflags.c regs.h regvals.c tokens.h version.h
+crc64.$(O): crc64.c
+disasm.$(O): disasm.c compiler.h disasm.h insns.h insnsi.h insnsn.c names.c &
+ nasm.h nasmlib.h regdis.c regs.c regs.h sync.h tokens.h version.h
+eval.$(O): eval.c compiler.h eval.h float.h insnsi.h labels.h nasm.h &
+ nasmlib.h regs.h version.h
+exprlib.$(O): exprlib.c compiler.h insnsi.h nasm.h nasmlib.h regs.h &
+ version.h
+float.$(O): float.c compiler.h insnsi.h nasm.h nasmlib.h regs.h version.h
+hashtbl.$(O): hashtbl.c compiler.h hashtbl.h insnsi.h nasm.h nasmlib.h &
+ regs.h version.h
+insnsa.$(O): insnsa.c compiler.h insns.h insnsi.h nasm.h nasmlib.h regs.h &
+ tokens.h version.h
+insnsd.$(O): insnsd.c compiler.h insns.h insnsi.h nasm.h nasmlib.h regs.h &
+ tokens.h version.h
+insnsn.$(O): insnsn.c
+labels.$(O): labels.c compiler.h hashtbl.h insnsi.h nasm.h nasmlib.h regs.h &
+ version.h
+lib\snprintf.$(O): lib\snprintf.c compiler.h nasmlib.h
+lib\vsnprintf.$(O): lib\vsnprintf.c compiler.h nasmlib.h
+listing.$(O): listing.c compiler.h insnsi.h listing.h nasm.h nasmlib.h &
+ regs.h version.h
+macros.$(O): macros.c
+names.$(O): names.c insnsn.c regs.c
+nasm.$(O): nasm.c assemble.h compiler.h eval.h insns.h insnsi.h labels.h &
+ listing.h nasm.h nasmlib.h outform.h parser.h pptok.h preproc.h regs.h &
+ stdscan.h tokens.h version.h
+nasmlib.$(O): nasmlib.c compiler.h insns.h insnsi.h nasm.h nasmlib.h regs.h &
+ tokens.h version.h
+ndisasm.$(O): ndisasm.c compiler.h disasm.h insns.h insnsi.h nasm.h &
+ nasmlib.h regs.h sync.h tokens.h version.h
+outform.$(O): outform.c compiler.h insnsi.h nasm.h nasmlib.h outform.h &
+ regs.h version.h
+output\outaout.$(O): output\outaout.c compiler.h insnsi.h nasm.h nasmlib.h &
+ outform.h regs.h stdscan.h version.h
+output\outas86.$(O): output\outas86.c compiler.h insnsi.h nasm.h nasmlib.h &
+ outform.h regs.h version.h
+output\outbin.$(O): output\outbin.c compiler.h eval.h insnsi.h labels.h &
+ nasm.h nasmlib.h outform.h regs.h stdscan.h version.h
+output\outcoff.$(O): output\outcoff.c compiler.h insnsi.h nasm.h nasmlib.h &
+ outform.h regs.h version.h
+output\outdbg.$(O): output\outdbg.c compiler.h insnsi.h nasm.h nasmlib.h &
+ outform.h regs.h version.h
+output\outelf32.$(O): output\outelf32.c compiler.h insnsi.h nasm.h nasmlib.h &
+ outform.h regs.h stdscan.h version.h
+output\outelf64.$(O): output\outelf64.c compiler.h insnsi.h nasm.h nasmlib.h &
+ outform.h regs.h stdscan.h version.h
+output\outieee.$(O): output\outieee.c compiler.h insnsi.h nasm.h nasmlib.h &
+ outform.h regs.h version.h
+output\outmacho.$(O): output\outmacho.c compiler.h insnsi.h nasm.h nasmlib.h &
+ outform.h regs.h version.h
+output\outobj.$(O): output\outobj.c compiler.h insnsi.h nasm.h nasmlib.h &
+ outform.h regs.h stdscan.h version.h
+output\outrdf.$(O): output\outrdf.c compiler.h insnsi.h nasm.h nasmlib.h &
+ outform.h regs.h version.h
+output\outrdf2.$(O): output\outrdf2.c compiler.h insnsi.h nasm.h nasmlib.h &
+ outform.h rdoff\rdoff.h regs.h version.h
+parser.$(O): parser.c compiler.h float.h insns.h insnsi.h nasm.h nasmlib.h &
+ parser.h regflags.c regs.h stdscan.h tokens.h version.h
+pptok.$(O): pptok.c compiler.h nasmlib.h pptok.h preproc.h
+preproc.$(O): preproc.c compiler.h hashtbl.h insnsi.h macros.c nasm.h &
+ nasmlib.h pptok.h preproc.h regs.h version.h
+regdis.$(O): regdis.c
+regflags.$(O): regflags.c
+regs.$(O): regs.c
+regvals.$(O): regvals.c
+stdscan.$(O): stdscan.c compiler.h insns.h insnsi.h nasm.h nasmlib.h regs.h &
+ stdscan.h tokens.h version.h
+sync.$(O): sync.c compiler.h nasmlib.h sync.h
+tokhash.$(O): tokhash.c compiler.h insns.h insnsi.h nasm.h nasmlib.h regs.h &
+ tokens.h version.h
diff --git a/Mkfiles/owlinux.mak b/Mkfiles/owlinux.mak
new file mode 100644
index 00000000..f25e039a
--- /dev/null
+++ b/Mkfiles/owlinux.mak
@@ -0,0 +1,265 @@
+# -*- makefile -*-
+#
+# Makefile for cross-compiling NASM from Linux
+# to DOS, Win32 or OS/2 using OpenWatcom.
+#
+
+top_srcdir = .
+srcdir = .
+prefix = C:/Program Files/NASM
+exec_prefix = $(prefix)
+bindir = $(prefix)/bin
+mandir = $(prefix)/man
+
+CC = wcl386
+CFLAGS = -3 -bcl=$(TARGET) -ox -wx -ze -fpi
+BUILD_CFLAGS = $(CFLAGS) # -I$(srcdir)/inttypes
+INTERNAL_CFLAGS = -I$(srcdir) -I. -DHAVE_SNPRINTF -DHAVE_VSNPRINTF
+ALL_CFLAGS = $(BUILD_CFLAGS) $(INTERNAL_CFLAGS)
+LD = $(CC)
+LDFLAGS = $(ALL_CFLAGS)
+LIBS =
+PERL = perl -I$(srcdir)/perllib
+
+STRIP = wstrip
+
+# Binary suffixes
+O = obj
+X = .exe
+
+# WMAKE errors out if a suffix is declared more than once, including
+# its own built-in declarations. Thus, we need to explicitly clear the list
+# first. Also, WMAKE only allows implicit rules that point "to the left"
+# in this list!
+.SUFFIXES:
+.SUFFIXES: .man .1 .$(O) .i .c
+
+.c.$(O):
+ $(CC) -c $(ALL_CFLAGS) -fo=$@ $<
+
+NASM = nasm.$(O) nasmlib.$(O) float.$(O) insnsa.$(O) assemble.$(O) \
+ labels.$(O) hashtbl.$(O) crc64.$(O) parser.$(O) \
+ outform.$(O) output/outbin.$(O) \
+ output/outaout.$(O) output/outcoff.$(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) pptok.$(O) \
+ listing.$(O) eval.$(O) exprlib.$(O) stdscan.$(O) tokhash.$(O)
+
+NDISASM = ndisasm.$(O) disasm.$(O) sync.$(O) nasmlib.$(O) insnsd.$(O)
+
+what:
+ @echo 'Please build "dos", "win32" or "os2"'
+
+dos:
+ $(MAKE) -f $(MAKEFILE_LIST) all TARGET=DOS4G
+
+win32:
+ $(MAKE) -f $(MAKEFILE_LIST) all TARGET=NT
+
+os2:
+ $(MAKE) -f $(MAKEFILE_LIST) all TARGET=OS2V2
+
+all: nasm$(X) ndisasm$(X)
+
+nasm$(X): $(NASM)
+ $(LD) $(LDFLAGS) -fe=nasm$(X) $(NASM) $(LIBS)
+
+ndisasm$(X): $(NDISASM)
+ $(LD) $(LDFLAGS) -fe=ndisasm$(X) $(NDISASM) $(LIBS)
+
+# These source files are automagically generated from a single
+# instruction-table file by a Perl script. They're distributed,
+# though, so it isn't necessary to have Perl just to recompile NASM
+# from the distribution.
+
+insnsa.c: insns.dat insns.pl
+ $(PERL) $(srcdir)/insns.pl -a $(srcdir)/insns.dat
+insnsd.c: insns.dat insns.pl
+ $(PERL) $(srcdir)/insns.pl -d $(srcdir)/insns.dat
+insnsi.h: insns.dat insns.pl
+ $(PERL) $(srcdir)/insns.pl -i $(srcdir)/insns.dat
+insnsn.c: insns.dat insns.pl
+ $(PERL) $(srcdir)/insns.pl -n $(srcdir)/insns.dat
+
+# These files contains all the standard macros that are derived from
+# the version number.
+version.h: version version.pl
+ $(PERL) $(srcdir)/version.pl h < $(srcdir)/version > version.h
+
+version.mac: version version.pl
+ $(PERL) $(srcdir)/version.pl mac < $(srcdir)/version > version.mac
+
+# This source file is generated from the standard macros file
+# `standard.mac' by another Perl script. Again, it's part of the
+# standard distribution.
+
+macros.c: macros.pl standard.mac version.mac
+ $(PERL) $(srcdir)/macros.pl $(srcdir)/standard.mac version.mac
+
+# These source files are generated from regs.dat by yet another
+# perl script.
+regs.c: regs.dat regs.pl
+ $(PERL) $(srcdir)/regs.pl c $(srcdir)/regs.dat > regs.c
+regflags.c: regs.dat regs.pl
+ $(PERL) $(srcdir)/regs.pl fc $(srcdir)/regs.dat > regflags.c
+regdis.c: regs.dat regs.pl
+ $(PERL) $(srcdir)/regs.pl dc $(srcdir)/regs.dat > regdis.c
+regvals.c: regs.dat regs.pl
+ $(PERL) $(srcdir)/regs.pl vc $(srcdir)/regs.dat > regvals.c
+regs.h: regs.dat regs.pl
+ $(PERL) $(srcdir)/regs.pl h $(srcdir)/regs.dat > regs.h
+
+# Assembler token hash
+tokhash.c: insns.dat regs.dat tokens.dat tokhash.pl perllib/phash.ph
+ $(PERL) $(srcdir)/tokhash.pl c $(srcdir)/insns.dat $(srcdir)/regs.dat \
+ $(srcdir)/tokens.dat > tokhash.c
+
+# Assembler token metadata
+tokens.h: insns.dat regs.dat tokens.dat tokhash.pl perllib/phash.ph
+ $(PERL) $(srcdir)/tokhash.pl h $(srcdir)/insns.dat $(srcdir)/regs.dat \
+ $(srcdir)/tokens.dat > tokens.h
+
+# Preprocessor token hash
+pptok.h: pptok.dat pptok.pl perllib/phash.ph
+ $(PERL) $(srcdir)/pptok.pl h $(srcdir)/pptok.dat pptok.h
+pptok.c: pptok.dat pptok.pl perllib/phash.ph
+ $(PERL) $(srcdir)/pptok.pl c $(srcdir)/pptok.dat pptok.c
+
+# This target generates all files that require perl.
+# This allows easier generation of distribution (see dist target).
+PERLREQ = macros.c insnsa.c insnsd.c insnsi.h insnsn.c \
+ regs.c regs.h regflags.c regdis.c regvals.c tokhash.c tokens.h \
+ version.h version.mac pptok.h pptok.c
+perlreq: $(PERLREQ)
+
+clean:
+ -rm -f *.$(O)
+ -rm -f *.s
+ -rm -f *.i
+ -rm -f output/*.$(O)
+ -rm -f output/*.s
+ -rm -f output/*.i
+ -rm -f nasm$(X)
+ -rm -f ndisasm$(X)
+ cd rdoff && $(MAKE) clean
+
+distclean: clean .SYMBOLIC
+ -rm -f config.h
+ -rm -f config.log
+ -rm -f config.status
+ -rm -f Makefile
+ -rm -f *~
+ -rm -f *.bak
+ -rm -f *.lst
+ -rm -f *.bin
+ -rm -f output/*~
+ -rm -f output/*.bak
+ -rm -f test/*.lst
+ -rm -f test/*.bin
+ -rm -f test/*.$(O)
+ -rm -f test/*.bin
+ -rm -f/s autom4te*.cache
+ cd rdoff && $(MAKE) distclean
+
+cleaner: clean .SYMBOLIC
+ -rm -f $(PERLREQ)
+ -rm -f *.man
+ -rm -f nasm.spec
+ cd doc && $(MAKE) clean
+
+spotless: distclean cleaner .SYMBOLIC
+ -rm -f doc/Makefile
+ -rm -f doc/*~
+ -rm -f doc/*.bak
+
+strip:
+ $(STRIP) *.exe
+
+rdf:
+ # cd rdoff && $(MAKE)
+
+doc:
+ # cd doc && $(MAKE) all
+
+everything: all doc rdf
+
+#-- Magic hints to mkdep.pl --#
+# @object-ending: ".$(O)"
+# @path-separator: "/"
+# @exclude: "config.h"
+# @continuation: "\"
+#-- Everything below is generated by mkdep.pl - do not edit --#
+assemble.$(O): assemble.c assemble.h compiler.h insns.h insnsi.h nasm.h \
+ nasmlib.h pptok.h preproc.h regflags.c regs.h regvals.c tokens.h version.h
+crc64.$(O): crc64.c
+disasm.$(O): disasm.c compiler.h disasm.h insns.h insnsi.h insnsn.c names.c \
+ nasm.h nasmlib.h regdis.c regs.c regs.h sync.h tokens.h version.h
+eval.$(O): eval.c compiler.h eval.h float.h insnsi.h labels.h nasm.h \
+ nasmlib.h regs.h version.h
+exprlib.$(O): exprlib.c compiler.h insnsi.h nasm.h nasmlib.h regs.h \
+ version.h
+float.$(O): float.c compiler.h insnsi.h nasm.h nasmlib.h regs.h version.h
+hashtbl.$(O): hashtbl.c compiler.h hashtbl.h insnsi.h nasm.h nasmlib.h \
+ regs.h version.h
+insnsa.$(O): insnsa.c compiler.h insns.h insnsi.h nasm.h nasmlib.h regs.h \
+ tokens.h version.h
+insnsd.$(O): insnsd.c compiler.h insns.h insnsi.h nasm.h nasmlib.h regs.h \
+ tokens.h version.h
+insnsn.$(O): insnsn.c
+labels.$(O): labels.c compiler.h hashtbl.h insnsi.h nasm.h nasmlib.h regs.h \
+ version.h
+lib/snprintf.$(O): lib/snprintf.c compiler.h nasmlib.h
+lib/vsnprintf.$(O): lib/vsnprintf.c compiler.h nasmlib.h
+listing.$(O): listing.c compiler.h insnsi.h listing.h nasm.h nasmlib.h \
+ regs.h version.h
+macros.$(O): macros.c
+names.$(O): names.c insnsn.c regs.c
+nasm.$(O): nasm.c assemble.h compiler.h eval.h insns.h insnsi.h labels.h \
+ listing.h nasm.h nasmlib.h outform.h parser.h pptok.h preproc.h regs.h \
+ stdscan.h tokens.h version.h
+nasmlib.$(O): nasmlib.c compiler.h insns.h insnsi.h nasm.h nasmlib.h regs.h \
+ tokens.h version.h
+ndisasm.$(O): ndisasm.c compiler.h disasm.h insns.h insnsi.h nasm.h \
+ nasmlib.h regs.h sync.h tokens.h version.h
+outform.$(O): outform.c compiler.h insnsi.h nasm.h nasmlib.h outform.h \
+ regs.h version.h
+output/outaout.$(O): output/outaout.c compiler.h insnsi.h nasm.h nasmlib.h \
+ outform.h regs.h stdscan.h version.h
+output/outas86.$(O): output/outas86.c compiler.h insnsi.h nasm.h nasmlib.h \
+ outform.h regs.h version.h
+output/outbin.$(O): output/outbin.c compiler.h eval.h insnsi.h labels.h \
+ nasm.h nasmlib.h outform.h regs.h stdscan.h version.h
+output/outcoff.$(O): output/outcoff.c compiler.h insnsi.h nasm.h nasmlib.h \
+ outform.h regs.h version.h
+output/outdbg.$(O): output/outdbg.c compiler.h insnsi.h nasm.h nasmlib.h \
+ outform.h regs.h version.h
+output/outelf32.$(O): output/outelf32.c compiler.h insnsi.h nasm.h nasmlib.h \
+ outform.h regs.h stdscan.h version.h
+output/outelf64.$(O): output/outelf64.c compiler.h insnsi.h nasm.h nasmlib.h \
+ outform.h regs.h stdscan.h version.h
+output/outieee.$(O): output/outieee.c compiler.h insnsi.h nasm.h nasmlib.h \
+ outform.h regs.h version.h
+output/outmacho.$(O): output/outmacho.c compiler.h insnsi.h nasm.h nasmlib.h \
+ outform.h regs.h version.h
+output/outobj.$(O): output/outobj.c compiler.h insnsi.h nasm.h nasmlib.h \
+ outform.h regs.h stdscan.h version.h
+output/outrdf.$(O): output/outrdf.c compiler.h insnsi.h nasm.h nasmlib.h \
+ outform.h regs.h version.h
+output/outrdf2.$(O): output/outrdf2.c compiler.h insnsi.h nasm.h nasmlib.h \
+ outform.h rdoff/rdoff.h regs.h version.h
+parser.$(O): parser.c compiler.h float.h insns.h insnsi.h nasm.h nasmlib.h \
+ parser.h regflags.c regs.h stdscan.h tokens.h version.h
+pptok.$(O): pptok.c compiler.h nasmlib.h pptok.h preproc.h
+preproc.$(O): preproc.c compiler.h hashtbl.h insnsi.h macros.c nasm.h \
+ nasmlib.h pptok.h preproc.h regs.h version.h
+regdis.$(O): regdis.c
+regflags.$(O): regflags.c
+regs.$(O): regs.c
+regvals.$(O): regvals.c
+stdscan.$(O): stdscan.c compiler.h insns.h insnsi.h nasm.h nasmlib.h regs.h \
+ stdscan.h tokens.h version.h
+sync.$(O): sync.c compiler.h nasmlib.h sync.h
+tokhash.$(O): tokhash.c compiler.h insns.h insnsi.h nasm.h nasmlib.h regs.h \
+ tokens.h version.h
diff --git a/assemble.c b/assemble.c
index 89c02100..4d56a650 100644
--- a/assemble.c
+++ b/assemble.c
@@ -1698,7 +1698,7 @@ static int matches(const struct itemplate *itemp, insn * instruction, int bits)
if (instruction->oprs[i].type != instruction->oprs[j].type ||
instruction->oprs[i].basereg != instruction->oprs[j].basereg)
return 0;
- } else if (itemp->opd[i] & ~instruction->oprs[i].type ||
+ } else if (itemp->opd[i] & ~instruction->oprs[i].type ||
((itemp->opd[i] & SIZE_MASK) &&
((itemp->opd[i] ^ instruction->oprs[i].type) & SIZE_MASK))) {
if ((itemp->opd[i] & ~instruction->oprs[i].type & ~SIZE_MASK) ||
diff --git a/compiler.h b/compiler.h
index 8ceb9ee9..798466fe 100644
--- a/compiler.h
+++ b/compiler.h
@@ -38,13 +38,24 @@
#endif
/* Some versions of MSVC have these only with underscores in front */
-
-#if !defined(HAVE_SNPRINTF) && defined(HAVE__SNPRINTF)
-# define snprintf _snprintf
+#include <stdio.h>
+#include <stddef.h>
+#include <stdarg.h>
+
+#ifndef HAVE_SNPRINTF
+# ifdef HAVE__SNPRINTF
+# define snprintf _snprintf
+# else
+int snprintf(char *, size_t, const char *, ...);
+# endif
#endif
-#if !defined(HAVE_VSNPRINTF) && defined(HAVE__VSNPRINTF)
-# define vsnprintf _vsnprintf
+#ifndef HAVE_VSNPRINTF
+# ifdef HAVE__VSNPRINT
+# define vsnprintf _vsnprintf
+# else
+int vsnprintf(char *, size_t, const char *, va_list);
+# endif
#endif
#endif /* COMPILER_H */
diff --git a/configure.in b/configure.in
index a52b620b..3def6cbe 100644
--- a/configure.in
+++ b/configure.in
@@ -87,6 +87,7 @@ AC_C_CONST
AC_TYPE_SIZE_T
dnl Checks for library functions.
+AC_SUBST_FILE(XOBJS)
AC_CHECK_FUNCS(strcspn, ,
AC_MSG_ERROR([NASM requires ANSI C (specifically, "strcspn")]))
@@ -95,15 +96,15 @@ AC_CHECK_FUNCS(strspn, ,
AC_MSG_ERROR([NASM requires ANSI C (specifically, "strspn")]))
missing=true
-AC_CHECK_FUNCS([snprintf _snprintf], missing=false)
+AC_CHECK_FUNCS([vsnprintf _vsnprintf], missing=false)
if $missing; then
- AC_MSG_ERROR([NASM requires ISO C99 (specifically, "snprintf")])
+ XOBJS="$XOBJS lib/vsnprintf.o"
fi
missing=true
-AC_CHECK_FUNCS([vsnprintf _vsnprintf], missing=false)
+AC_CHECK_FUNCS([snprintf _snprintf], missing=false)
if $missing; then
- AC_MSG_ERROR([NASM requires ISO C99 (specifically, "vsnprintf")])
+ XOBJS="$XOBJS lib/snprintf.o"
fi
AC_CHECK_FUNCS(getuid)
diff --git a/doc/nasmdoc.src b/doc/nasmdoc.src
index db290d68..73ccbf8f 100644
--- a/doc/nasmdoc.src
+++ b/doc/nasmdoc.src
@@ -35,6 +35,7 @@
\IR{-v} \c{-v} option
\IR{-w} \c{-w} option
\IR{-y} \c{-y} option
+\IR{-Z} \c{-Z} option
\IR{!=} \c{!=} operator
\IR{$, here} \c{$}, Here token
\IR{$, prefix} \c{$}, prefix
@@ -581,7 +582,7 @@ instead of being delimited by colons.
See also the \c{Visual C++} output format, \k{win32fmt}.
-\S{opt-E} The \i\c{-E} Option: Send Errors to a File
+\S{opt-Z} The \i\c{-Z} Option: Send Errors to a File
Under \I{DOS}\c{MS-DOS} it can be difficult (though there are ways) to
redirect the standard-error output of a program to a file. Since
@@ -589,13 +590,16 @@ NASM usually produces its warning and \i{error messages} on
\i\c{stderr}, this can make it hard to capture the errors if (for
example) you want to load them into an editor.
-NASM therefore provides the \c{-E} option, taking a filename argument
+NASM therefore provides the \c{-Z} option, taking a filename argument
which causes errors to be sent to the specified files rather than
standard error. Therefore you can \I{redirecting errors}redirect
the errors into a file by typing
-\c nasm -E myfile.err -f obj myfile.asm
+\c nasm -Z myfile.err -f obj myfile.asm
+In earlier versions of NASM, this option was called \c{-E}, but it was
+changed since \c{-E} is an option conventionally used for
+preprocessing only, with disastrous results. See \k{opt-E}.
\S{opt-s} The \i\c{-s} Option: Send Errors to \i\c{stdout}
@@ -606,7 +610,7 @@ program, you can type:
\c nasm -s -f obj myfile.asm | more
-See also the \c{-E} option, \k{opt-E}.
+See also the \c{-Z} option, \k{opt-Z}.
\S{opt-i} The \i\c{-i}\I\c{-I} Option: Include File Search Directories
@@ -699,10 +703,10 @@ For Makefile compatibility with many C compilers, this option can also
be specified as \c{-U}.
-\S{opt-e} The \i\c{-e} Option: Preprocess Only
+\S{opt-E} The \i\c{-E}\I{-e} Option: Preprocess Only
NASM allows the \i{preprocessor} to be run on its own, up to a
-point. Using the \c{-e} option (which requires no arguments) will
+point. Using the \c{-E} option (which requires no arguments) will
cause NASM to preprocess its input file, expand all the macro
references, remove all the comments and preprocessor directives, and
print the resulting file on standard output (or save it to a file,
@@ -716,6 +720,9 @@ which depend on the values of symbols: so code such as
will cause an error in \i{preprocess-only mode}.
+For compatiblity with older version of NASM, this option can also be
+written \c{-e}. \c{-E} in older versions of NASM was the equivalent
+of the current \c{-Z} option, \k{opt-Z}.
\S{opt-a} The \i\c{-a} Option: Don't Preprocess At All
@@ -844,8 +851,7 @@ brackets) exists.
\S{opt-v} The \i\c{-v} Option: Display \i{Version} Info
Typing \c{NASM -v} will display the version of NASM which you are using,
-and the date on which it was compiled. This replaces the deprecated
-\c{-r}.
+and the date on which it was compiled.
You will need the version number if you report a bug.
@@ -6282,6 +6288,59 @@ just from 32-bit platforms but from each other. If a specific size
data type is desired, it is probably best to use the types defined in
the Standard C header \c{<inttypes.h>}.
+In 64-bit mode, the default instruction size is still 32 bits. When
+loading a value into a 32-bit register (but not an 8- or 16-bit
+register), the upper 32 bits of the corresponding 64-bit register are
+set to zero.
+
+\H{id64} Immediates and displacements in 64-bit mode
+
+In 64-bit mode, immediates and displacements are generally only 32
+bits wide. NASM will therefore truncate most displacements and
+immediates to 32 bits.
+
+The only instruction which takes a full \i{64-bit immediate} is:
+
+\c MOV reg64,imm64
+
+NASM will produce this instruction whenever the programmer uses
+\c{MOV} with an immediate into a 64-bit register. If this is not
+desirable, simply specify the equivalent 32-bit register, which will
+be automatically zero-extended by the processor, or specify the
+immediate as \c{DWORD}:
+
+\c mov rax,foo ; 64-bit immediate
+\c mov rax,qword foo ; (identical)
+\c mov eax,foo ; 32-bit immediate, zero-extended
+\c mov rax,dword foo ; 32-bit immediate, sign-extended
+
+The length of these instructions are 10, 5 and 7 bytes, respectively.
+
+The only instructions which take a full \i{64-bit \e{displacement}} is
+loading or storing, using \c{MOV}, \c{AL}, \c{AX}, \c{EAX} or \c{RAX}
+(but no other registers) to an absolute 64-bit address. Since this is
+a relatively rarely used instruction (64-bit code generally uses
+relative addressing), the programmer has to explicitly declare the
+displacement size as \c{QWORD}:
+
+\c default abs
+\c
+\c mov eax,[foo] ; 32-bit absolute disp, sign-extended
+\c mov eax,[a32 foo] ; 32-bit absolute disp, zero-extended
+\c mov eax,[qword foo] ; 64-bit absolute disp
+\c
+\c default rel
+\c
+\c mov eax,[foo] ; 32-bit relative disp
+\c mov eax,[a32 foo] ; d:o, address truncated to 32 bits(!)
+\c mov eax,[qword foo] ; error
+\c mov eax,[abs qword foo] ; 64-bit absolute disp
+
+A sign-extended absolute displacement can access from -2 GB to +2 GB;
+a zero-extended absolute displacement can access from 0 to 4 GB.
+
+FIXME: THIS IS NOT YET CORRECTLY IMPLEMENTED
+
\H{unix64} Interfacing to 64-bit C Programs (Unix)
On Unix, the 64-bit ABI is defined by the document:
diff --git a/hashtbl.c b/hashtbl.c
index 6ebba3e8..cefd37fe 100644
--- a/hashtbl.c
+++ b/hashtbl.c
@@ -15,9 +15,7 @@
static struct hash_tbl_node *alloc_table(size_t newsize)
{
size_t bytes = newsize*sizeof(struct hash_tbl_node);
- struct hash_tbl_node *newtbl = nasm_malloc(bytes);
-
- memset(newtbl, 0, bytes);
+ struct hash_tbl_node *newtbl = nasm_zalloc(bytes);
return newtbl;
}
diff --git a/insns.dat b/insns.dat
index b7a45a3e..f4c1e111 100644
--- a/insns.dat
+++ b/insns.dat
@@ -616,12 +616,12 @@ JMPE rm16 \320\2\x0F\x00\206 IA64
JMPE rm32 \321\2\x0F\x00\206 IA64
JRCXZ imm \1\xE3\50 X64
LAHF void \1\x9F 8086
-LAR reg16,mem \320\2\x0F\x02\110 286,PROT,SM
+LAR reg16,mem \320\2\x0F\x02\110 286,PROT,SW
LAR reg16,reg16 \320\2\x0F\x02\110 286,PROT
-LAR reg32,mem \321\2\x0F\x02\110 386,PROT,SM
-LAR reg32,reg32 \321\2\x0F\x02\110 386,PROT
-LAR reg64,mem \324\2\x0F\x02\110 X64,SM
-LAR reg64,reg64 \324\2\x0F\x02\110 X64,PROT
+LAR reg32,mem \321\2\x0F\x02\110 386,PROT,SW
+LAR reg32,reg16 \321\2\x0F\x02\110 386,PROT
+LAR reg64,mem \324\2\x0F\x02\110 X64,PROT,SW
+LAR reg64,reg16 \324\2\x0F\x02\110 X64,PROT
LDS reg16,mem \320\1\xC5\110 8086,NOLONG
LDS reg32,mem \321\1\xC5\110 386,NOLONG
LEA reg16,mem \320\1\x8D\110 8086
@@ -669,12 +669,12 @@ LOOPZ imm \312\1\xE1\50 8086
LOOPZ imm,reg_cx \310\1\xE1\50 8086,NOLONG
LOOPZ imm,reg_ecx \311\1\xE1\50 386
LOOPZ imm,reg_rcx \313\1\xE1\50 X64
-LSL reg16,mem \320\2\x0F\x03\110 286,PROT,SM
+LSL reg16,mem \320\2\x0F\x03\110 286,PROT,SW
LSL reg16,reg16 \320\2\x0F\x03\110 286,PROT
-LSL reg32,mem \321\2\x0F\x03\110 386,PROT,SM
-LSL reg32,reg32 \321\2\x0F\x03\110 386,PROT
-LSL reg64,mem \324\2\x0F\x03\110 X64,SM
-LSL reg64,reg64 \324\2\x0F\x03\110 X64,PROT
+LSL reg32,mem \321\2\x0F\x03\110 386,PROT,SW
+LSL reg32,reg16 \321\2\x0F\x03\110 386,PROT
+LSL reg64,mem \324\2\x0F\x03\110 X64,PROT,SW
+LSL reg64,reg16 \324\2\x0F\x03\110 X64,PROT
LSS reg16,mem \320\2\x0F\xB2\110 386
LSS reg32,mem \321\2\x0F\xB2\110 386
LTR mem \1\x0F\170\203 286,PROT,PRIV
@@ -722,15 +722,15 @@ MOV reg16,reg16 \320\1\x8B\110 8086
MOV reg32,mem \321\1\x8B\110 386,SM
MOV reg32,reg32 \321\1\x8B\110 386
MOV reg64,mem \324\1\x8B\110 X64,SM
-MOV reg64,reg64 \324\1\x8B\110 X64
+MOV reg64,reg64 \324\1\x8B\110 X64,SM
MOV reg8,imm \10\xB0\21 8086,SM
MOV reg16,imm \320\10\xB8\31 8086,SM
MOV reg32,imm \321\10\xB8\41 386,SM
-MOV reg64,imm \324\10\xB8\55 X64,SM
+MOV reg64,imm \324\10\xB8\55 X64,SQ
MOV rm8,imm \1\xC6\200\21 8086,SM
MOV rm16,imm \320\1\xC7\200\31 8086,SM
MOV rm32,imm \321\1\xC7\200\41 386,SM
-MOV rm64,imm \324\1\xC7\200\41 X64,SM
+MOV rm64,imm \324\1\xC7\200\41 X64,SD
MOV mem,imm8 \1\xC6\200\21 8086,SM
MOV mem,imm16 \320\1\xC7\200\31 8086,SM
MOV mem,imm32 \321\1\xC7\200\41 386,SM
diff --git a/lib/snprintf.c b/lib/snprintf.c
new file mode 100644
index 00000000..f56a492a
--- /dev/null
+++ b/lib/snprintf.c
@@ -0,0 +1,24 @@
+/*
+ * snprintf()
+ *
+ * Implement snprintf() in terms of vsnprintf()
+ */
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <stdarg.h>
+
+#include "nasmlib.h"
+
+int snprintf(char *str, size_t size, const char *format, ...)
+{
+ va_list ap;
+ int rv;
+
+ va_start(ap, format);
+ rv = vsnprintf(str, size, format, ap);
+ va_end(ap);
+
+ return rv;
+}
+
diff --git a/lib/vsnprintf.c b/lib/vsnprintf.c
new file mode 100644
index 00000000..2c9399a0
--- /dev/null
+++ b/lib/vsnprintf.c
@@ -0,0 +1,49 @@
+/*
+ * vsnprintf()
+ *
+ * Poor substitute for a real vsnprintf() function for systems
+ * that don't have them...
+ */
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <stdarg.h>
+#include <string.h>
+
+#include "nasmlib.h"
+
+extern efunc nasm_malloc_error;
+
+#define BUFFER_SIZE 65536 /* Bigger than any string we might print... */
+
+static char snprintf_buffer[BUFFER_SIZE];
+
+int vsnprintf(char *str, size_t size, const char *format, va_list ap)
+{
+ int rv, bytes;
+
+ if (size > BUFFER_SIZE) {
+ nasm_malloc_error(ERR_PANIC|ERR_NOFILE,
+ "snprintf: size (%d) > BUFFER_SIZE (%d)",
+ size, BUFFER_SIZE);
+ size = BUFFER_SIZE;
+ }
+
+ rv = vsprintf(snprintf_buffer, format, ap);
+ if (rv >= BUFFER_SIZE) {
+ nasm_malloc_error(ERR_PANIC|ERR_NOFILE,
+ "snprintf buffer overflow");
+ }
+
+ if (size > 0) {
+ if ((size_t)rv < size-1)
+ bytes = rv;
+ else
+ bytes = size-1;
+
+ memcpy(str, snprintf_buffer, bytes);
+ str[bytes] = '\0';
+ }
+
+ return rv;
+}
diff --git a/mkdep.pl b/mkdep.pl
index 31eb88da..d376287e 100755
--- a/mkdep.pl
+++ b/mkdep.pl
@@ -93,7 +93,9 @@ sub insert_deps($) {
my($line,$parm,$val);
my($obj) = '.o'; # Defaults
my($sep) = '/';
+ my($cont) = "\\";
my($maxline) = 78; # Seems like a reasonable default
+ my @exclude = (); # Don't exclude anything
while ( defined($line = <IN>) ) {
if ( $line =~ /^\s*\#\s*@([a-z0-9-]+):\s*\"([^\"]*)\"/ ) {
@@ -104,6 +106,10 @@ sub insert_deps($) {
$sep = $val;
} elsif ( $parm eq 'line-width' ) {
$maxline = $val+0;
+ } elsif ( $parm eq 'continuation' ) {
+ $cont = $val;
+ } elsif ( $parm eq 'exclude' ) {
+ @exclude = split(/\,/, $val);
}
} elsif ( $line eq $barrier ) {
last; # Stop reading input at barrier line
@@ -112,6 +118,11 @@ sub insert_deps($) {
}
close(IN);
+ my $e, %do_exclude;
+ foreach $e (@exclude) {
+ $do_exclude{$e} = 1;
+ }
+
my $dfile, $ofile, $str, $sl, $len;
my @deps, $dep;
@@ -124,14 +135,16 @@ sub insert_deps($) {
$len = length($str);
print OUT $str;
foreach $dep ($dfile, alldeps($dfile)) {
- $str = convert_file($dep,$sep);
- $sl = length($str)+1;
- if ( $len+$sl > $maxline-2 ) {
- print OUT " \\\n ", $str;
- $len = $sl;
- } else {
- print OUT ' ', $str;
- $len += $sl;
+ unless ($do_exclude{$dep}) {
+ $str = convert_file($dep,$sep);
+ $sl = length($str)+1;
+ if ( $len+$sl > $maxline-2 ) {
+ print OUT ' ', $cont, "\n ", $str;
+ $len = $sl;
+ } else {
+ print OUT ' ', $str;
+ $len += $sl;
+ }
}
}
print OUT "\n";
diff --git a/nasm.c b/nasm.c
index 6b7ca4c3..ed9c6cb6 100644
--- a/nasm.c
+++ b/nasm.c
@@ -383,11 +383,11 @@ static int process_arg(char *p, char *q)
case 'i':
case 'I':
case 'l':
- case 'E':
case 'F':
case 'X':
case 'u':
case 'U':
+ case 'Z':
if (!(param = get_param(p, q, &advance)))
break;
if (p[1] == 'o') { /* output file */
@@ -441,7 +441,7 @@ static int process_arg(char *p, char *q)
pp_include_path(param);
} else if (p[1] == 'l') { /* listing file */
strcpy(listname, param);
- } else if (p[1] == 'E') { /* error messages file */
+ } else if (p[1] == 'Z') { /* error messages file */
error_file = fopen(param, "w");
if (!error_file) {
error_file = stderr; /* Revert to default! */
@@ -476,16 +476,15 @@ static int process_arg(char *p, char *q)
("usage: nasm [-@ response file] [-o outfile] [-f format] "
"[-l listfile]\n"
" [options...] [--] filename\n"
- " or nasm -r for version info (obsolete)\n"
- " or nasm -v for version info (preferred)\n\n"
+ " or nasm -v for version info\n\n"
" -t assemble in SciTech TASM compatible mode\n"
" -g generate debug information in selected format.\n");
printf
- (" -e preprocess only (writes output to stdout by default)\n"
+ (" -E (or -e) preprocess only (writes output to stdout by default)\n"
" -a don't preprocess (assemble only)\n"
" -M generate Makefile dependencies on stdout\n"
" -MG d:o, missing files assumed generated\n\n"
- " -E<file> redirect error messages to file\n"
+ " -Z<file> redirect error messages to file\n"
" -s redirect error messages to stdout\n\n"
" -F format select a debugging format\n\n"
" -I<path> adds a pathname to the include file path\n");
@@ -523,7 +522,6 @@ static int process_arg(char *p, char *q)
case 't':
tasm_compatible_mode = TRUE;
break;
- case 'r':
case 'v':
{
const char *nasm_version_string =
@@ -537,6 +535,7 @@ static int process_arg(char *p, char *q)
}
break;
case 'e': /* preprocess only */
+ case 'E':
operating_mode = op_preprocess;
break;
case 'a': /* assemble only - don't preprocess */
diff --git a/nasmlib.c b/nasmlib.c
index 59971c9d..6f0e6afd 100644
--- a/nasmlib.c
+++ b/nasmlib.c
@@ -17,7 +17,7 @@
#include "insns.h"
int globalbits = 0; /* defined in nasm.h, works better here for ASM+DISASM */
-static efunc nasm_malloc_error;
+efunc nasm_malloc_error; /* Exported for the benefit of vsnprintf.c */
#ifdef LOGALLOC
static FILE *logfp;
@@ -45,7 +45,24 @@ void *nasm_malloc(size_t size)
#ifdef LOGALLOC
else
fprintf(logfp, "%s %d malloc(%ld) returns %p\n",
- file, line, (int32_t)size, p);
+ file, line, (long)size, p);
+#endif
+ return p;
+}
+
+#ifdef LOGALLOC
+void *nasm_zalloc_log(char *file, int line, size_t size)
+#else
+void *nasm_zalloc(size_t size)
+#endif
+{
+ void *p = calloc(size, 1);
+ if (!p)
+ nasm_malloc_error(ERR_FATAL | ERR_NOFILE, "out of memory");
+#ifdef LOGALLOC
+ else
+ fprintf(logfp, "%s %d calloc(%ld, 1) returns %p\n",
+ file, line, (long)size, p);
#endif
return p;
}
@@ -62,10 +79,10 @@ void *nasm_realloc(void *q, size_t size)
#ifdef LOGALLOC
else if (q)
fprintf(logfp, "%s %d realloc(%p,%ld) returns %p\n",
- file, line, q, (int32_t)size, p);
+ file, line, q, (long)size, p);
else
fprintf(logfp, "%s %d malloc(%ld) returns %p\n",
- file, line, (int32_t)size, p);
+ file, line, (long)size, p);
#endif
return p;
}
@@ -99,7 +116,7 @@ char *nasm_strdup(const char *s)
#ifdef LOGALLOC
else
fprintf(logfp, "%s %d strdup(%ld) returns %p\n",
- file, line, (int32_t)size, p);
+ file, line, (long)size, p);
#endif
strcpy(p, s);
return p;
@@ -120,7 +137,7 @@ char *nasm_strndup(char *s, size_t len)
#ifdef LOGALLOC
else
fprintf(logfp, "%s %d strndup(%ld) returns %p\n",
- file, line, (int32_t)size, p);
+ file, line, (long)size, p);
#endif
strncpy(p, s, len);
p[len] = '\0';
@@ -377,9 +394,7 @@ static struct RAA *real_raa_init(int layers)
int i;
if (layers == 0) {
- r = nasm_malloc(LEAFSIZ);
- r->layers = 0;
- memset(r->u.l.data, 0, sizeof(r->u.l.data));
+ r = nasm_zalloc(LEAFSIZ);
r->stepsize = 1L;
} else {
r = nasm_malloc(BRANCHSIZ);
diff --git a/nasmlib.h b/nasmlib.h
index 43342096..a2544fc1 100644
--- a/nasmlib.h
+++ b/nasmlib.h
@@ -74,17 +74,20 @@ typedef void (*efunc) (int severity, const char *fmt, ...);
void nasm_set_malloc_error(efunc);
#ifndef LOGALLOC
void *nasm_malloc(size_t);
+void *nasm_zalloc(size_t);
void *nasm_realloc(void *, size_t);
void nasm_free(void *);
char *nasm_strdup(const char *);
char *nasm_strndup(char *, size_t);
#else
void *nasm_malloc_log(char *, int, size_t);
+void *nasm_zalloc_log(char *, int, size_t);
void *nasm_realloc_log(char *, int, void *, size_t);
void nasm_free_log(char *, int, void *);
char *nasm_strdup_log(char *, int, const char *);
char *nasm_strndup_log(char *, int, char *, size_t);
#define nasm_malloc(x) nasm_malloc_log(__FILE__,__LINE__,x)
+#define nasm_zalloc(x) nasm_malloc_log(__FILE__,__LINE__,x)
#define nasm_realloc(x,y) nasm_realloc_log(__FILE__,__LINE__,x,y)
#define nasm_free(x) nasm_free_log(__FILE__,__LINE__,x)
#define nasm_strdup(x) nasm_strdup_log(__FILE__,__LINE__,x)
diff --git a/test/movimm.asm b/test/movimm.asm
new file mode 100644
index 00000000..b5a7a274
--- /dev/null
+++ b/test/movimm.asm
@@ -0,0 +1,26 @@
+ bits 64
+
+ mov rax,1234567890abcdefh
+ mov eax,1234567890abcdefh
+ mov rax,dword 1234567890abcdefh
+ mov rax,qword 1234567890abcdefh
+ mov dword [rsi],1234567890abcdefh
+ mov qword [rsi],1234567890abcdefh
+ mov dword [rsi],dword 1234567890abcdefh
+ mov qword [rsi],dword 1234567890abcdefh
+; mov qword [rsi],qword 1234567890abcdefh ; Error
+; mov [rsi],qword 1234567890abcdefh ; Error
+ mov [rsi],dword 1234567890abcdefh
+
+ ; The optimizer probably should compact these forms, doesn't yet?
+ mov rax,12345678h
+ mov eax,12345678h
+ mov rax,dword 12345678h
+ mov rax,qword 12345678h
+ mov dword [rsi],12345678h
+ mov qword [rsi],12345678h
+ mov dword [rsi],dword 12345678h
+ mov qword [rsi],dword 12345678h
+; mov qword [rsi],qword 12345678h ; Error
+; mov [rsi],qword 12345678h ; Error
+ mov [rsi],dword 12345678h
diff --git a/test/riprel.asm b/test/riprel.asm
index 3e4e6a38..c9e9121b 100644
--- a/test/riprel.asm
+++ b/test/riprel.asm
@@ -1,99 +1,603 @@
bits 64
default abs
-
+
+ mov al,[foo]
+ mov bl,[foo]
+ mov ax,[foo]
+ mov bx,[foo]
+ mov eax,[foo]
+ mov ebx,[foo]
mov rax,[foo]
- mov rax,[123456789abcdef0h]
mov rbx,[foo]
+ mov al,[0xaaaaaaaaaaaaaaaa]
+ mov bl,[0xaaaaaaaaaaaaaaaa]
+ mov ax,[0xaaaaaaaaaaaaaaaa]
+ mov bx,[0xaaaaaaaaaaaaaaaa]
+ mov eax,[0xaaaaaaaaaaaaaaaa]
+ mov ebx,[0xaaaaaaaaaaaaaaaa]
+ mov rax,[0xaaaaaaaaaaaaaaaa]
+ mov rbx,[0xaaaaaaaaaaaaaaaa]
+ mov al,[0xbbbbbbbb]
+ mov bl,[0xbbbbbbbb]
+ mov ax,[0xbbbbbbbb]
+ mov bx,[0xbbbbbbbb]
+ mov eax,[0xbbbbbbbb]
+ mov ebx,[0xbbbbbbbb]
+ mov rax,[0xbbbbbbbb]
+ mov rbx,[0xbbbbbbbb]
+ mov al,[0xffffffffcccccccc]
+ mov bl,[0xffffffffcccccccc]
+ mov ax,[0xffffffffcccccccc]
+ mov bx,[0xffffffffcccccccc]
+ mov eax,[0xffffffffcccccccc]
+ mov ebx,[0xffffffffcccccccc]
+ mov rax,[0xffffffffcccccccc]
+ mov rbx,[0xffffffffcccccccc]
+
+ mov al,[dword foo]
+ mov bl,[dword foo]
+ mov ax,[dword foo]
+ mov bx,[dword foo]
+ mov eax,[dword foo]
+ mov ebx,[dword foo]
mov rax,[dword foo]
mov rbx,[dword foo]
+ mov al,[dword 0xaaaaaaaaaaaaaaaa]
+ mov bl,[dword 0xaaaaaaaaaaaaaaaa]
+ mov ax,[dword 0xaaaaaaaaaaaaaaaa]
+ mov bx,[dword 0xaaaaaaaaaaaaaaaa]
+ mov eax,[dword 0xaaaaaaaaaaaaaaaa]
+ mov ebx,[dword 0xaaaaaaaaaaaaaaaa]
+ mov rax,[dword 0xaaaaaaaaaaaaaaaa]
+ mov rbx,[dword 0xaaaaaaaaaaaaaaaa]
+ mov al,[dword 0xbbbbbbbb]
+ mov bl,[dword 0xbbbbbbbb]
+ mov ax,[dword 0xbbbbbbbb]
+ mov bx,[dword 0xbbbbbbbb]
+ mov eax,[dword 0xbbbbbbbb]
+ mov ebx,[dword 0xbbbbbbbb]
+ mov rax,[dword 0xbbbbbbbb]
+ mov rbx,[dword 0xbbbbbbbb]
+ mov al,[dword 0xffffffffcccccccc]
+ mov bl,[dword 0xffffffffcccccccc]
+ mov ax,[dword 0xffffffffcccccccc]
+ mov bx,[dword 0xffffffffcccccccc]
+ mov eax,[dword 0xffffffffcccccccc]
+ mov ebx,[dword 0xffffffffcccccccc]
+ mov rax,[dword 0xffffffffcccccccc]
+ mov rbx,[dword 0xffffffffcccccccc]
+
+ mov al,[qword foo]
+ mov bl,[qword foo]
+ mov ax,[qword foo]
+ mov bx,[qword foo]
+ mov eax,[qword foo]
+ mov ebx,[qword foo]
mov rax,[qword foo]
- mov rax,[rel foo]
- mov rbx,[rel foo]
- mov rax,[rel dword foo]
- mov rax,[rel qword foo]
+ mov rbx,[qword foo]
+ mov al,[qword 0xaaaaaaaaaaaaaaaa]
+ mov bl,[qword 0xaaaaaaaaaaaaaaaa]
+ mov ax,[qword 0xaaaaaaaaaaaaaaaa]
+ mov bx,[qword 0xaaaaaaaaaaaaaaaa]
+ mov eax,[qword 0xaaaaaaaaaaaaaaaa]
+ mov ebx,[qword 0xaaaaaaaaaaaaaaaa]
+ mov rax,[qword 0xaaaaaaaaaaaaaaaa]
+ mov rbx,[qword 0xaaaaaaaaaaaaaaaa]
+ mov al,[qword 0xbbbbbbbb]
+ mov bl,[qword 0xbbbbbbbb]
+ mov ax,[qword 0xbbbbbbbb]
+ mov bx,[qword 0xbbbbbbbb]
+ mov eax,[qword 0xbbbbbbbb]
+ mov ebx,[qword 0xbbbbbbbb]
+ mov rax,[qword 0xbbbbbbbb]
+ mov rbx,[qword 0xbbbbbbbb]
+ mov al,[qword 0xffffffffcccccccc]
+ mov bl,[qword 0xffffffffcccccccc]
+ mov ax,[qword 0xffffffffcccccccc]
+ mov bx,[qword 0xffffffffcccccccc]
+ mov eax,[qword 0xffffffffcccccccc]
+ mov ebx,[qword 0xffffffffcccccccc]
+ mov rax,[qword 0xffffffffcccccccc]
+ mov rbx,[qword 0xffffffffcccccccc]
+
+ mov al,[abs foo]
+ mov bl,[abs foo]
+ mov ax,[abs foo]
+ mov bx,[abs foo]
+ mov eax,[abs foo]
+ mov ebx,[abs foo]
mov rax,[abs foo]
mov rbx,[abs foo]
+ mov al,[abs 0xaaaaaaaaaaaaaaaa]
+ mov bl,[abs 0xaaaaaaaaaaaaaaaa]
+ mov ax,[abs 0xaaaaaaaaaaaaaaaa]
+ mov bx,[abs 0xaaaaaaaaaaaaaaaa]
+ mov eax,[abs 0xaaaaaaaaaaaaaaaa]
+ mov ebx,[abs 0xaaaaaaaaaaaaaaaa]
+ mov rax,[abs 0xaaaaaaaaaaaaaaaa]
+ mov rbx,[abs 0xaaaaaaaaaaaaaaaa]
+ mov al,[abs 0xbbbbbbbb]
+ mov bl,[abs 0xbbbbbbbb]
+ mov ax,[abs 0xbbbbbbbb]
+ mov bx,[abs 0xbbbbbbbb]
+ mov eax,[abs 0xbbbbbbbb]
+ mov ebx,[abs 0xbbbbbbbb]
+ mov rax,[abs 0xbbbbbbbb]
+ mov rbx,[abs 0xbbbbbbbb]
+ mov al,[abs 0xffffffffcccccccc]
+ mov bl,[abs 0xffffffffcccccccc]
+ mov ax,[abs 0xffffffffcccccccc]
+ mov bx,[abs 0xffffffffcccccccc]
+ mov eax,[abs 0xffffffffcccccccc]
+ mov ebx,[abs 0xffffffffcccccccc]
+ mov rax,[abs 0xffffffffcccccccc]
+ mov rbx,[abs 0xffffffffcccccccc]
+
+ mov al,[abs dword foo]
+ mov bl,[abs dword foo]
+ mov ax,[abs dword foo]
+ mov bx,[abs dword foo]
+ mov eax,[abs dword foo]
+ mov ebx,[abs dword foo]
mov rax,[abs dword foo]
+ mov rbx,[abs dword foo]
+ mov al,[abs dword 0xaaaaaaaaaaaaaaaa]
+ mov bl,[abs dword 0xaaaaaaaaaaaaaaaa]
+ mov ax,[abs dword 0xaaaaaaaaaaaaaaaa]
+ mov bx,[abs dword 0xaaaaaaaaaaaaaaaa]
+ mov eax,[abs dword 0xaaaaaaaaaaaaaaaa]
+ mov ebx,[abs dword 0xaaaaaaaaaaaaaaaa]
+ mov rax,[abs dword 0xaaaaaaaaaaaaaaaa]
+ mov rbx,[abs dword 0xaaaaaaaaaaaaaaaa]
+ mov al,[abs dword 0xbbbbbbbb]
+ mov bl,[abs dword 0xbbbbbbbb]
+ mov ax,[abs dword 0xbbbbbbbb]
+ mov bx,[abs dword 0xbbbbbbbb]
+ mov eax,[abs dword 0xbbbbbbbb]
+ mov ebx,[abs dword 0xbbbbbbbb]
+ mov rax,[abs dword 0xbbbbbbbb]
+ mov rbx,[abs dword 0xbbbbbbbb]
+ mov al,[abs dword 0xffffffffcccccccc]
+ mov bl,[abs dword 0xffffffffcccccccc]
+ mov ax,[abs dword 0xffffffffcccccccc]
+ mov bx,[abs dword 0xffffffffcccccccc]
+ mov eax,[abs dword 0xffffffffcccccccc]
+ mov ebx,[abs dword 0xffffffffcccccccc]
+ mov rax,[abs dword 0xffffffffcccccccc]
+ mov rbx,[abs dword 0xffffffffcccccccc]
+
+ mov al,[abs qword foo]
+ mov bl,[abs qword foo]
+ mov ax,[abs qword foo]
+ mov bx,[abs qword foo]
+ mov eax,[abs qword foo]
+ mov ebx,[abs qword foo]
mov rax,[abs qword foo]
+ mov rbx,[abs qword foo]
+ mov al,[abs qword 0xaaaaaaaaaaaaaaaa]
+ mov bl,[abs qword 0xaaaaaaaaaaaaaaaa]
+ mov ax,[abs qword 0xaaaaaaaaaaaaaaaa]
+ mov bx,[abs qword 0xaaaaaaaaaaaaaaaa]
+ mov eax,[abs qword 0xaaaaaaaaaaaaaaaa]
+ mov ebx,[abs qword 0xaaaaaaaaaaaaaaaa]
+ mov rax,[abs qword 0xaaaaaaaaaaaaaaaa]
+ mov rbx,[abs qword 0xaaaaaaaaaaaaaaaa]
+ mov al,[abs qword 0xbbbbbbbb]
+ mov bl,[abs qword 0xbbbbbbbb]
+ mov ax,[abs qword 0xbbbbbbbb]
+ mov bx,[abs qword 0xbbbbbbbb]
+ mov eax,[abs qword 0xbbbbbbbb]
+ mov ebx,[abs qword 0xbbbbbbbb]
+ mov rax,[abs qword 0xbbbbbbbb]
+ mov rbx,[abs qword 0xbbbbbbbb]
+ mov al,[abs qword 0xffffffffcccccccc]
+ mov bl,[abs qword 0xffffffffcccccccc]
+ mov ax,[abs qword 0xffffffffcccccccc]
+ mov bx,[abs qword 0xffffffffcccccccc]
+ mov eax,[abs qword 0xffffffffcccccccc]
+ mov ebx,[abs qword 0xffffffffcccccccc]
+ mov rax,[abs qword 0xffffffffcccccccc]
+ mov rbx,[abs qword 0xffffffffcccccccc]
+
+ mov al,[rel foo]
+ mov bl,[rel foo]
+ mov ax,[rel foo]
+ mov bx,[rel foo]
+ mov eax,[rel foo]
+ mov ebx,[rel foo]
+ mov rax,[rel foo]
+ mov rbx,[rel foo]
+ mov al,[rel 0xaaaaaaaaaaaaaaaa]
+ mov bl,[rel 0xaaaaaaaaaaaaaaaa]
+ mov ax,[rel 0xaaaaaaaaaaaaaaaa]
+ mov bx,[rel 0xaaaaaaaaaaaaaaaa]
+ mov eax,[rel 0xaaaaaaaaaaaaaaaa]
+ mov ebx,[rel 0xaaaaaaaaaaaaaaaa]
+ mov rax,[rel 0xaaaaaaaaaaaaaaaa]
+ mov rbx,[rel 0xaaaaaaaaaaaaaaaa]
+ mov al,[rel 0xbbbbbbbb]
+ mov bl,[rel 0xbbbbbbbb]
+ mov ax,[rel 0xbbbbbbbb]
+ mov bx,[rel 0xbbbbbbbb]
+ mov eax,[rel 0xbbbbbbbb]
+ mov ebx,[rel 0xbbbbbbbb]
+ mov rax,[rel 0xbbbbbbbb]
+ mov rbx,[rel 0xbbbbbbbb]
+ mov al,[rel 0xffffffffcccccccc]
+ mov bl,[rel 0xffffffffcccccccc]
+ mov ax,[rel 0xffffffffcccccccc]
+ mov bx,[rel 0xffffffffcccccccc]
+ mov eax,[rel 0xffffffffcccccccc]
+ mov ebx,[rel 0xffffffffcccccccc]
+ mov rax,[rel 0xffffffffcccccccc]
+ mov rbx,[rel 0xffffffffcccccccc]
+
+ mov al,[rel dword foo]
+ mov bl,[rel dword foo]
+ mov ax,[rel dword foo]
+ mov bx,[rel dword foo]
+ mov eax,[rel dword foo]
+ mov ebx,[rel dword foo]
+ mov rax,[rel dword foo]
+ mov rbx,[rel dword foo]
+ mov al,[rel dword 0xaaaaaaaaaaaaaaaa]
+ mov bl,[rel dword 0xaaaaaaaaaaaaaaaa]
+ mov ax,[rel dword 0xaaaaaaaaaaaaaaaa]
+ mov bx,[rel dword 0xaaaaaaaaaaaaaaaa]
+ mov eax,[rel dword 0xaaaaaaaaaaaaaaaa]
+ mov ebx,[rel dword 0xaaaaaaaaaaaaaaaa]
+ mov rax,[rel dword 0xaaaaaaaaaaaaaaaa]
+ mov rbx,[rel dword 0xaaaaaaaaaaaaaaaa]
+ mov al,[rel dword 0xbbbbbbbb]
+ mov bl,[rel dword 0xbbbbbbbb]
+ mov ax,[rel dword 0xbbbbbbbb]
+ mov bx,[rel dword 0xbbbbbbbb]
+ mov eax,[rel dword 0xbbbbbbbb]
+ mov ebx,[rel dword 0xbbbbbbbb]
+ mov rax,[rel dword 0xbbbbbbbb]
+ mov rbx,[rel dword 0xbbbbbbbb]
+ mov al,[rel dword 0xffffffffcccccccc]
+ mov bl,[rel dword 0xffffffffcccccccc]
+ mov ax,[rel dword 0xffffffffcccccccc]
+ mov bx,[rel dword 0xffffffffcccccccc]
+ mov eax,[rel dword 0xffffffffcccccccc]
+ mov ebx,[rel dword 0xffffffffcccccccc]
+ mov rax,[rel dword 0xffffffffcccccccc]
+ mov rbx,[rel dword 0xffffffffcccccccc]
+
+ mov al,[rel qword foo]
+ mov bl,[rel qword foo]
+ mov ax,[rel qword foo]
+ mov bx,[rel qword foo]
+ mov eax,[rel qword foo]
+ mov ebx,[rel qword foo]
+ mov rax,[rel qword foo]
+ mov rbx,[rel qword foo]
+ mov al,[rel qword 0xaaaaaaaaaaaaaaaa]
+ mov bl,[rel qword 0xaaaaaaaaaaaaaaaa]
+ mov ax,[rel qword 0xaaaaaaaaaaaaaaaa]
+ mov bx,[rel qword 0xaaaaaaaaaaaaaaaa]
+ mov eax,[rel qword 0xaaaaaaaaaaaaaaaa]
+ mov ebx,[rel qword 0xaaaaaaaaaaaaaaaa]
+ mov rax,[rel qword 0xaaaaaaaaaaaaaaaa]
+ mov rbx,[rel qword 0xaaaaaaaaaaaaaaaa]
+ mov al,[rel qword 0xbbbbbbbb]
+ mov bl,[rel qword 0xbbbbbbbb]
+ mov ax,[rel qword 0xbbbbbbbb]
+ mov bx,[rel qword 0xbbbbbbbb]
+ mov eax,[rel qword 0xbbbbbbbb]
+ mov ebx,[rel qword 0xbbbbbbbb]
+ mov rax,[rel qword 0xbbbbbbbb]
+ mov rbx,[rel qword 0xbbbbbbbb]
+ mov al,[rel qword 0xffffffffcccccccc]
+ mov bl,[rel qword 0xffffffffcccccccc]
+ mov ax,[rel qword 0xffffffffcccccccc]
+ mov bx,[rel qword 0xffffffffcccccccc]
+ mov eax,[rel qword 0xffffffffcccccccc]
+ mov ebx,[rel qword 0xffffffffcccccccc]
+ mov rax,[rel qword 0xffffffffcccccccc]
+ mov rbx,[rel qword 0xffffffffcccccccc]
- mov rax,[es:foo]
- mov rax,[es:123456789abcdef0h]
- mov rbx,[es:foo]
- mov rax,[dword es:foo]
- mov rbx,[dword es:foo]
- mov rax,[qword es:foo]
- mov rax,[rel es:foo]
- mov rbx,[rel es:foo]
- mov rax,[rel dword es:foo]
- mov rax,[rel qword es:foo]
- mov rax,[abs es:foo]
- mov rbx,[abs es:foo]
- mov rax,[abs dword es:foo]
- mov rax,[abs qword es:foo]
-
- mov rax,[fs:foo]
- mov rax,[fs:123456789abcdef0h]
- mov rbx,[fs:foo]
- mov rax,[dword fs:foo]
- mov rbx,[dword fs:foo]
- mov rax,[qword fs:foo]
- mov rax,[rel fs:foo]
- mov rbx,[rel fs:foo]
- mov rax,[rel dword fs:foo]
- mov rax,[rel qword fs:foo]
- mov rax,[abs fs:foo]
- mov rbx,[abs fs:foo]
- mov rax,[abs dword fs:foo]
- mov rax,[abs qword fs:foo]
default rel
-
+
+ mov al,[foo]
+ mov bl,[foo]
+ mov ax,[foo]
+ mov bx,[foo]
+ mov eax,[foo]
+ mov ebx,[foo]
mov rax,[foo]
- mov rax,[123456789abcdef0h]
mov rbx,[foo]
+ mov al,[0xaaaaaaaaaaaaaaaa]
+ mov bl,[0xaaaaaaaaaaaaaaaa]
+ mov ax,[0xaaaaaaaaaaaaaaaa]
+ mov bx,[0xaaaaaaaaaaaaaaaa]
+ mov eax,[0xaaaaaaaaaaaaaaaa]
+ mov ebx,[0xaaaaaaaaaaaaaaaa]
+ mov rax,[0xaaaaaaaaaaaaaaaa]
+ mov rbx,[0xaaaaaaaaaaaaaaaa]
+ mov al,[0xbbbbbbbb]
+ mov bl,[0xbbbbbbbb]
+ mov ax,[0xbbbbbbbb]
+ mov bx,[0xbbbbbbbb]
+ mov eax,[0xbbbbbbbb]
+ mov ebx,[0xbbbbbbbb]
+ mov rax,[0xbbbbbbbb]
+ mov rbx,[0xbbbbbbbb]
+ mov al,[0xffffffffcccccccc]
+ mov bl,[0xffffffffcccccccc]
+ mov ax,[0xffffffffcccccccc]
+ mov bx,[0xffffffffcccccccc]
+ mov eax,[0xffffffffcccccccc]
+ mov ebx,[0xffffffffcccccccc]
+ mov rax,[0xffffffffcccccccc]
+ mov rbx,[0xffffffffcccccccc]
+
+ mov al,[dword foo]
+ mov bl,[dword foo]
+ mov ax,[dword foo]
+ mov bx,[dword foo]
+ mov eax,[dword foo]
+ mov ebx,[dword foo]
mov rax,[dword foo]
mov rbx,[dword foo]
+ mov al,[dword 0xaaaaaaaaaaaaaaaa]
+ mov bl,[dword 0xaaaaaaaaaaaaaaaa]
+ mov ax,[dword 0xaaaaaaaaaaaaaaaa]
+ mov bx,[dword 0xaaaaaaaaaaaaaaaa]
+ mov eax,[dword 0xaaaaaaaaaaaaaaaa]
+ mov ebx,[dword 0xaaaaaaaaaaaaaaaa]
+ mov rax,[dword 0xaaaaaaaaaaaaaaaa]
+ mov rbx,[dword 0xaaaaaaaaaaaaaaaa]
+ mov al,[dword 0xbbbbbbbb]
+ mov bl,[dword 0xbbbbbbbb]
+ mov ax,[dword 0xbbbbbbbb]
+ mov bx,[dword 0xbbbbbbbb]
+ mov eax,[dword 0xbbbbbbbb]
+ mov ebx,[dword 0xbbbbbbbb]
+ mov rax,[dword 0xbbbbbbbb]
+ mov rbx,[dword 0xbbbbbbbb]
+ mov al,[dword 0xffffffffcccccccc]
+ mov bl,[dword 0xffffffffcccccccc]
+ mov ax,[dword 0xffffffffcccccccc]
+ mov bx,[dword 0xffffffffcccccccc]
+ mov eax,[dword 0xffffffffcccccccc]
+ mov ebx,[dword 0xffffffffcccccccc]
+ mov rax,[dword 0xffffffffcccccccc]
+ mov rbx,[dword 0xffffffffcccccccc]
+
+ mov al,[qword foo]
+ mov bl,[qword foo]
+ mov ax,[qword foo]
+ mov bx,[qword foo]
+ mov eax,[qword foo]
+ mov ebx,[qword foo]
mov rax,[qword foo]
- mov rax,[rel foo]
- mov rbx,[rel foo]
- mov rax,[rel dword foo]
- mov rax,[rel qword foo]
+ mov rbx,[qword foo]
+ mov al,[qword 0xaaaaaaaaaaaaaaaa]
+ mov bl,[qword 0xaaaaaaaaaaaaaaaa]
+ mov ax,[qword 0xaaaaaaaaaaaaaaaa]
+ mov bx,[qword 0xaaaaaaaaaaaaaaaa]
+ mov eax,[qword 0xaaaaaaaaaaaaaaaa]
+ mov ebx,[qword 0xaaaaaaaaaaaaaaaa]
+ mov rax,[qword 0xaaaaaaaaaaaaaaaa]
+ mov rbx,[qword 0xaaaaaaaaaaaaaaaa]
+ mov al,[qword 0xbbbbbbbb]
+ mov bl,[qword 0xbbbbbbbb]
+ mov ax,[qword 0xbbbbbbbb]
+ mov bx,[qword 0xbbbbbbbb]
+ mov eax,[qword 0xbbbbbbbb]
+ mov ebx,[qword 0xbbbbbbbb]
+ mov rax,[qword 0xbbbbbbbb]
+ mov rbx,[qword 0xbbbbbbbb]
+ mov al,[qword 0xffffffffcccccccc]
+ mov bl,[qword 0xffffffffcccccccc]
+ mov ax,[qword 0xffffffffcccccccc]
+ mov bx,[qword 0xffffffffcccccccc]
+ mov eax,[qword 0xffffffffcccccccc]
+ mov ebx,[qword 0xffffffffcccccccc]
+ mov rax,[qword 0xffffffffcccccccc]
+ mov rbx,[qword 0xffffffffcccccccc]
+
+ mov al,[abs foo]
+ mov bl,[abs foo]
+ mov ax,[abs foo]
+ mov bx,[abs foo]
+ mov eax,[abs foo]
+ mov ebx,[abs foo]
mov rax,[abs foo]
mov rbx,[abs foo]
+ mov al,[abs 0xaaaaaaaaaaaaaaaa]
+ mov bl,[abs 0xaaaaaaaaaaaaaaaa]
+ mov ax,[abs 0xaaaaaaaaaaaaaaaa]
+ mov bx,[abs 0xaaaaaaaaaaaaaaaa]
+ mov eax,[abs 0xaaaaaaaaaaaaaaaa]
+ mov ebx,[abs 0xaaaaaaaaaaaaaaaa]
+ mov rax,[abs 0xaaaaaaaaaaaaaaaa]
+ mov rbx,[abs 0xaaaaaaaaaaaaaaaa]
+ mov al,[abs 0xbbbbbbbb]
+ mov bl,[abs 0xbbbbbbbb]
+ mov ax,[abs 0xbbbbbbbb]
+ mov bx,[abs 0xbbbbbbbb]
+ mov eax,[abs 0xbbbbbbbb]
+ mov ebx,[abs 0xbbbbbbbb]
+ mov rax,[abs 0xbbbbbbbb]
+ mov rbx,[abs 0xbbbbbbbb]
+ mov al,[abs 0xffffffffcccccccc]
+ mov bl,[abs 0xffffffffcccccccc]
+ mov ax,[abs 0xffffffffcccccccc]
+ mov bx,[abs 0xffffffffcccccccc]
+ mov eax,[abs 0xffffffffcccccccc]
+ mov ebx,[abs 0xffffffffcccccccc]
+ mov rax,[abs 0xffffffffcccccccc]
+ mov rbx,[abs 0xffffffffcccccccc]
+
+ mov al,[abs dword foo]
+ mov bl,[abs dword foo]
+ mov ax,[abs dword foo]
+ mov bx,[abs dword foo]
+ mov eax,[abs dword foo]
+ mov ebx,[abs dword foo]
mov rax,[abs dword foo]
+ mov rbx,[abs dword foo]
+ mov al,[abs dword 0xaaaaaaaaaaaaaaaa]
+ mov bl,[abs dword 0xaaaaaaaaaaaaaaaa]
+ mov ax,[abs dword 0xaaaaaaaaaaaaaaaa]
+ mov bx,[abs dword 0xaaaaaaaaaaaaaaaa]
+ mov eax,[abs dword 0xaaaaaaaaaaaaaaaa]
+ mov ebx,[abs dword 0xaaaaaaaaaaaaaaaa]
+ mov rax,[abs dword 0xaaaaaaaaaaaaaaaa]
+ mov rbx,[abs dword 0xaaaaaaaaaaaaaaaa]
+ mov al,[abs dword 0xbbbbbbbb]
+ mov bl,[abs dword 0xbbbbbbbb]
+ mov ax,[abs dword 0xbbbbbbbb]
+ mov bx,[abs dword 0xbbbbbbbb]
+ mov eax,[abs dword 0xbbbbbbbb]
+ mov ebx,[abs dword 0xbbbbbbbb]
+ mov rax,[abs dword 0xbbbbbbbb]
+ mov rbx,[abs dword 0xbbbbbbbb]
+ mov al,[abs dword 0xffffffffcccccccc]
+ mov bl,[abs dword 0xffffffffcccccccc]
+ mov ax,[abs dword 0xffffffffcccccccc]
+ mov bx,[abs dword 0xffffffffcccccccc]
+ mov eax,[abs dword 0xffffffffcccccccc]
+ mov ebx,[abs dword 0xffffffffcccccccc]
+ mov rax,[abs dword 0xffffffffcccccccc]
+ mov rbx,[abs dword 0xffffffffcccccccc]
+
+ mov al,[abs qword foo]
+ mov bl,[abs qword foo]
+ mov ax,[abs qword foo]
+ mov bx,[abs qword foo]
+ mov eax,[abs qword foo]
+ mov ebx,[abs qword foo]
mov rax,[abs qword foo]
+ mov rbx,[abs qword foo]
+ mov al,[abs qword 0xaaaaaaaaaaaaaaaa]
+ mov bl,[abs qword 0xaaaaaaaaaaaaaaaa]
+ mov ax,[abs qword 0xaaaaaaaaaaaaaaaa]
+ mov bx,[abs qword 0xaaaaaaaaaaaaaaaa]
+ mov eax,[abs qword 0xaaaaaaaaaaaaaaaa]
+ mov ebx,[abs qword 0xaaaaaaaaaaaaaaaa]
+ mov rax,[abs qword 0xaaaaaaaaaaaaaaaa]
+ mov rbx,[abs qword 0xaaaaaaaaaaaaaaaa]
+ mov al,[abs qword 0xbbbbbbbb]
+ mov bl,[abs qword 0xbbbbbbbb]
+ mov ax,[abs qword 0xbbbbbbbb]
+ mov bx,[abs qword 0xbbbbbbbb]
+ mov eax,[abs qword 0xbbbbbbbb]
+ mov ebx,[abs qword 0xbbbbbbbb]
+ mov rax,[abs qword 0xbbbbbbbb]
+ mov rbx,[abs qword 0xbbbbbbbb]
+ mov al,[abs qword 0xffffffffcccccccc]
+ mov bl,[abs qword 0xffffffffcccccccc]
+ mov ax,[abs qword 0xffffffffcccccccc]
+ mov bx,[abs qword 0xffffffffcccccccc]
+ mov eax,[abs qword 0xffffffffcccccccc]
+ mov ebx,[abs qword 0xffffffffcccccccc]
+ mov rax,[abs qword 0xffffffffcccccccc]
+ mov rbx,[abs qword 0xffffffffcccccccc]
+
+ mov al,[rel foo]
+ mov bl,[rel foo]
+ mov ax,[rel foo]
+ mov bx,[rel foo]
+ mov eax,[rel foo]
+ mov ebx,[rel foo]
+ mov rax,[rel foo]
+ mov rbx,[rel foo]
+ mov al,[rel 0xaaaaaaaaaaaaaaaa]
+ mov bl,[rel 0xaaaaaaaaaaaaaaaa]
+ mov ax,[rel 0xaaaaaaaaaaaaaaaa]
+ mov bx,[rel 0xaaaaaaaaaaaaaaaa]
+ mov eax,[rel 0xaaaaaaaaaaaaaaaa]
+ mov ebx,[rel 0xaaaaaaaaaaaaaaaa]
+ mov rax,[rel 0xaaaaaaaaaaaaaaaa]
+ mov rbx,[rel 0xaaaaaaaaaaaaaaaa]
+ mov al,[rel 0xbbbbbbbb]
+ mov bl,[rel 0xbbbbbbbb]
+ mov ax,[rel 0xbbbbbbbb]
+ mov bx,[rel 0xbbbbbbbb]
+ mov eax,[rel 0xbbbbbbbb]
+ mov ebx,[rel 0xbbbbbbbb]
+ mov rax,[rel 0xbbbbbbbb]
+ mov rbx,[rel 0xbbbbbbbb]
+ mov al,[rel 0xffffffffcccccccc]
+ mov bl,[rel 0xffffffffcccccccc]
+ mov ax,[rel 0xffffffffcccccccc]
+ mov bx,[rel 0xffffffffcccccccc]
+ mov eax,[rel 0xffffffffcccccccc]
+ mov ebx,[rel 0xffffffffcccccccc]
+ mov rax,[rel 0xffffffffcccccccc]
+ mov rbx,[rel 0xffffffffcccccccc]
+
+ mov al,[rel dword foo]
+ mov bl,[rel dword foo]
+ mov ax,[rel dword foo]
+ mov bx,[rel dword foo]
+ mov eax,[rel dword foo]
+ mov ebx,[rel dword foo]
+ mov rax,[rel dword foo]
+ mov rbx,[rel dword foo]
+ mov al,[rel dword 0xaaaaaaaaaaaaaaaa]
+ mov bl,[rel dword 0xaaaaaaaaaaaaaaaa]
+ mov ax,[rel dword 0xaaaaaaaaaaaaaaaa]
+ mov bx,[rel dword 0xaaaaaaaaaaaaaaaa]
+ mov eax,[rel dword 0xaaaaaaaaaaaaaaaa]
+ mov ebx,[rel dword 0xaaaaaaaaaaaaaaaa]
+ mov rax,[rel dword 0xaaaaaaaaaaaaaaaa]
+ mov rbx,[rel dword 0xaaaaaaaaaaaaaaaa]
+ mov al,[rel dword 0xbbbbbbbb]
+ mov bl,[rel dword 0xbbbbbbbb]
+ mov ax,[rel dword 0xbbbbbbbb]
+ mov bx,[rel dword 0xbbbbbbbb]
+ mov eax,[rel dword 0xbbbbbbbb]
+ mov ebx,[rel dword 0xbbbbbbbb]
+ mov rax,[rel dword 0xbbbbbbbb]
+ mov rbx,[rel dword 0xbbbbbbbb]
+ mov al,[rel dword 0xffffffffcccccccc]
+ mov bl,[rel dword 0xffffffffcccccccc]
+ mov ax,[rel dword 0xffffffffcccccccc]
+ mov bx,[rel dword 0xffffffffcccccccc]
+ mov eax,[rel dword 0xffffffffcccccccc]
+ mov ebx,[rel dword 0xffffffffcccccccc]
+ mov rax,[rel dword 0xffffffffcccccccc]
+ mov rbx,[rel dword 0xffffffffcccccccc]
+
+ mov al,[rel qword foo]
+ mov bl,[rel qword foo]
+ mov ax,[rel qword foo]
+ mov bx,[rel qword foo]
+ mov eax,[rel qword foo]
+ mov ebx,[rel qword foo]
+ mov rax,[rel qword foo]
+ mov rbx,[rel qword foo]
+ mov al,[rel qword 0xaaaaaaaaaaaaaaaa]
+ mov bl,[rel qword 0xaaaaaaaaaaaaaaaa]
+ mov ax,[rel qword 0xaaaaaaaaaaaaaaaa]
+ mov bx,[rel qword 0xaaaaaaaaaaaaaaaa]
+ mov eax,[rel qword 0xaaaaaaaaaaaaaaaa]
+ mov ebx,[rel qword 0xaaaaaaaaaaaaaaaa]
+ mov rax,[rel qword 0xaaaaaaaaaaaaaaaa]
+ mov rbx,[rel qword 0xaaaaaaaaaaaaaaaa]
+ mov al,[rel qword 0xbbbbbbbb]
+ mov bl,[rel qword 0xbbbbbbbb]
+ mov ax,[rel qword 0xbbbbbbbb]
+ mov bx,[rel qword 0xbbbbbbbb]
+ mov eax,[rel qword 0xbbbbbbbb]
+ mov ebx,[rel qword 0xbbbbbbbb]
+ mov rax,[rel qword 0xbbbbbbbb]
+ mov rbx,[rel qword 0xbbbbbbbb]
+ mov al,[rel qword 0xffffffffcccccccc]
+ mov bl,[rel qword 0xffffffffcccccccc]
+ mov ax,[rel qword 0xffffffffcccccccc]
+ mov bx,[rel qword 0xffffffffcccccccc]
+ mov eax,[rel qword 0xffffffffcccccccc]
+ mov ebx,[rel qword 0xffffffffcccccccc]
+ mov rax,[rel qword 0xffffffffcccccccc]
+ mov rbx,[rel qword 0xffffffffcccccccc]
+
- mov rax,[es:foo]
- mov rax,[es:123456789abcdef0h]
- mov rbx,[es:foo]
- mov rax,[dword es:foo]
- mov rbx,[dword es:foo]
- mov rax,[qword es:foo]
- mov rax,[rel es:foo]
- mov rbx,[rel es:foo]
- mov rax,[rel dword es:foo]
- mov rax,[rel qword es:foo]
- mov rax,[abs es:foo]
- mov rbx,[abs es:foo]
- mov rax,[abs dword es:foo]
- mov rax,[abs qword es:foo]
-
- mov rax,[fs:foo]
- mov rax,[fs:123456789abcdef0h]
- mov rbx,[fs:foo]
- mov rax,[dword fs:foo]
- mov rbx,[dword fs:foo]
- mov rax,[qword fs:foo]
- mov rax,[rel fs:foo]
- mov rbx,[rel fs:foo]
- mov rax,[rel dword fs:foo]
- mov rax,[rel qword fs:foo]
- mov rax,[abs fs:foo]
- mov rbx,[abs fs:foo]
- mov rax,[abs dword fs:foo]
- mov rax,[abs qword fs:foo]
-
- section .data
-foo equ $
- \ No newline at end of file
+foo:
diff --git a/test/riprel.pl b/test/riprel.pl
new file mode 100644
index 00000000..fa4405e2
--- /dev/null
+++ b/test/riprel.pl
@@ -0,0 +1,23 @@
+#!/usr/bin/perl
+
+print "\tbits 64\n";
+
+foreach $mode ('abs', 'rel') {
+ print "\n\tdefault $mode\n\n";
+
+ foreach $rq ('', 'abs ', 'rel ') {
+ foreach $sq ('', 'dword ', 'qword ') {
+ foreach $v ('foo', '0xaaaaaaaaaaaaaaaa', '0xbbbbbbbb',
+ '0xffffffffcccccccc') {
+ foreach $r ('al', 'bl', 'ax', 'bx', 'eax', 'ebx', 'rax', 'rbx') {
+ print "\tmov $r,[$rq$sq$v]\n";
+ }
+ }
+ print "\n";
+ }
+ }
+}
+
+print "\nfoo:\n";
+
+
diff --git a/version b/version
index a3ebc112..3d401399 100644
--- a/version
+++ b/version
@@ -1 +1 @@
-0.99.03
+0.99.04
diff --git a/version.pl b/version.pl
index 6f3da058..e78fbc2f 100755
--- a/version.pl
+++ b/version.pl
@@ -8,7 +8,8 @@
#
# <major>.<minor>[.<subminor>][pl<patchlevel>]]<tail>
#
-# ... where <tail> is not necessarily numeric.
+# ... where <tail> is not necessarily numeric, but if it is of the form
+# -<digits> it is assumed to be a snapshot release.
#
# This defines the following macros:
#
@@ -17,6 +18,7 @@
# NASM_MINOR_VER
# NASM_SUBMINOR_VER -- this is zero if no subminor
# NASM_PATCHLEVEL_VER -- this is zero is no patchlevel
+# NASM_SNAPSHOT -- if snapshot
# NASM_VERSION_ID -- version number encoded
# NASM_VER -- whole version number as a string
#
@@ -25,6 +27,7 @@
# __NASM_MINOR__
# __NASM_SUBMINOR__
# __NASM_PATCHLEVEL__
+# __NASM_SNAPSHOT__
# __NASM_VERSION_ID__
# __NASM_VER__
#
@@ -57,6 +60,12 @@ if ( $line =~ /^([0-9]+)\.([0-9]+)(.*)$/ ) {
die "$0: Invalid input format\n";
}
+if ($tail =~ /^\-([0-9]+)/) {
+ $snapshot = $1;
+} else {
+ undef $snapshot;
+}
+
$nmaj = $maj+0; $nmin = $min+0;
$nsmin = $smin+0; $nplvl = $plvl+0;
@@ -79,6 +88,8 @@ $nasm_id = ($nmaj << 24)+($nmin << 16)+($nsmin << 8)+$nplvl;
$mangled_ver = sprintf("%d.%02d.%02d", $nmaj, $nmin, $nsmin);
$mangled_ver .= '.'.$nplvl if ($nplvl != 0);
+($mtail = $tail) =~ tr/-/./;
+$mangled_ver .= $mtail;
if ( $what eq 'h' ) {
print "#ifndef NASM_VERSION_H\n";
@@ -87,6 +98,9 @@ if ( $what eq 'h' ) {
printf "#define NASM_MINOR_VER %d\n", $nmin;
printf "#define NASM_SUBMINOR_VER %d\n", $nsmin;
printf "#define NASM_PATCHLEVEL_VER %d\n", $nplvl;
+ if (defined($snapshot)) {
+ printf "#define NASM_SNAPSHOT %d\n", $snapshot;
+ }
printf "#define NASM_VERSION_ID 0x%08x\n", $nasm_id;
printf "#define NASM_VER \"%s\"\n", $line;
print "#endif /* NASM_VERSION_H */\n";
@@ -95,6 +109,9 @@ if ( $what eq 'h' ) {
printf "%%define __NASM_MINOR__ %d\n", $nmin;
printf "%%define __NASM_SUBMINOR__ %d\n", $nsmin;
printf "%%define __NASM_PATCHLEVEL__ %d\n", $nplvl;
+ if (defined($snapshot)) {
+ printf "%%define __NASM_SNAPSHOT__ %d\n", $snapshot;
+ }
printf "%%define __NASM_VERSION_ID__ 0%08Xh\n", $nasm_id;
printf "%%define __NASM_VER__ \"%s\"\n", $line;
} elsif ( $what eq 'sed' ) {
@@ -102,6 +119,7 @@ if ( $what eq 'h' ) {
printf "s/\@\@NASM_MINOR\@\@/%d/g\n", $nmin;
printf "s/\@\@NASM_SUBMINOR\@\@/%d/g\n", $nsmin;
printf "s/\@\@NASM_PATCHLEVEL\@\@/%d/g\n", $nplvl;
+ printf "s/\@\@NASM_SNAPSHOT\@\@/%d/g\n", $snapshot; # Possibly empty
printf "s/\@\@NASM_VERSION_ID\@\@/%d/g\n", $nasm_id;
printf "s/\@\@NASM_VERSION_XID\@\@/0x%08x/g\n", $nasm_id;
printf "s/\@\@NASM_VER\@\@/%s/g\n", $line;