Upstream version 2.08rc7
authorAnas Nashif <anas.nashif@intel.com>
Tue, 15 May 2012 21:27:48 +0000 (22:27 +0100)
committerAnas Nashif <anas.nashif@intel.com>
Tue, 15 May 2012 21:27:48 +0000 (22:27 +0100)
415 files changed:
AUTHORS [new file with mode: 0644]
CHANGES [new file with mode: 0644]
ChangeLog [new file with mode: 0644]
INSTALL [new file with mode: 0644]
LICENSE [new file with mode: 0644]
Makefile.in [new file with mode: 0644]
Mkfiles/README [new file with mode: 0644]
Mkfiles/msvc.mak [new file with mode: 0644]
Mkfiles/netware.mak [new file with mode: 0644]
Mkfiles/openwcom.mak [new file with mode: 0644]
Mkfiles/owlinux.mak [new file with mode: 0644]
README [new file with mode: 0644]
TODO [new file with mode: 0644]
aclocal.m4 [new file with mode: 0644]
assemble.c [new file with mode: 0644]
assemble.h [new file with mode: 0644]
autogen.sh [new file with mode: 0755]
compiler.h [new file with mode: 0644]
config.h.in [new file with mode: 0644]
configure [new file with mode: 0755]
configure.in [new file with mode: 0644]
contrib/VSrules/nasm.README [new file with mode: 0644]
contrib/VSrules/nasm.rules [new file with mode: 0644]
crc64.c [new file with mode: 0644]
directives.c [new file with mode: 0644]
directives.dat [new file with mode: 0644]
directives.h [new file with mode: 0644]
directives.pl [new file with mode: 0755]
disasm.c [new file with mode: 0644]
disasm.h [new file with mode: 0644]
doc/Makefile [new file with mode: 0644]
doc/Makefile.in [new file with mode: 0644]
doc/afmmetrics.pl [new file with mode: 0755]
doc/changes.src [new file with mode: 0644]
doc/genps.pl [new file with mode: 0755]
doc/genpsdriver.pl [new file with mode: 0644]
doc/head.ps [new file with mode: 0644]
doc/inslist.pl [new file with mode: 0644]
doc/internal.doc [new file with mode: 0644]
doc/makedocs.bat [new file with mode: 0644]
doc/metrics/pagd8a.ph [new file with mode: 0644]
doc/metrics/pagdo8a.ph [new file with mode: 0644]
doc/metrics/pagk8a.ph [new file with mode: 0644]
doc/metrics/pagko8a.ph [new file with mode: 0644]
doc/metrics/pbkd8a.ph [new file with mode: 0644]
doc/metrics/pbkdi8a.ph [new file with mode: 0644]
doc/metrics/pbkl8a.ph [new file with mode: 0644]
doc/metrics/pbkli8a.ph [new file with mode: 0644]
doc/metrics/pcrb8a.ph [new file with mode: 0644]
doc/metrics/pcrbo8a.ph [new file with mode: 0644]
doc/metrics/pcrr8a.ph [new file with mode: 0644]
doc/metrics/pcrro8a.ph [new file with mode: 0644]
doc/metrics/phvb8a.ph [new file with mode: 0644]
doc/metrics/phvb8an.ph [new file with mode: 0644]
doc/metrics/phvbo8a.ph [new file with mode: 0644]
doc/metrics/phvbo8an.ph [new file with mode: 0644]
doc/metrics/phvl8a.ph [new file with mode: 0644]
doc/metrics/phvlo8a.ph [new file with mode: 0644]
doc/metrics/phvr8a.ph [new file with mode: 0644]
doc/metrics/phvr8an.ph [new file with mode: 0644]
doc/metrics/phvro8a.ph [new file with mode: 0644]
doc/metrics/phvro8an.ph [new file with mode: 0644]
doc/metrics/pncb8a.ph [new file with mode: 0644]
doc/metrics/pncbi8a.ph [new file with mode: 0644]
doc/metrics/pncr8a.ph [new file with mode: 0644]
doc/metrics/pncri8a.ph [new file with mode: 0644]
doc/metrics/pplb8a.ph [new file with mode: 0644]
doc/metrics/pplbi8a.ph [new file with mode: 0644]
doc/metrics/pplr8a.ph [new file with mode: 0644]
doc/metrics/pplri8a.ph [new file with mode: 0644]
doc/metrics/psyr.ph [new file with mode: 0644]
doc/metrics/ptmb8a.ph [new file with mode: 0644]
doc/metrics/ptmbi8a.ph [new file with mode: 0644]
doc/metrics/ptmr8a.ph [new file with mode: 0644]
doc/metrics/ptmri8a.ph [new file with mode: 0644]
doc/metrics/putb8a.ph [new file with mode: 0644]
doc/metrics/putbi8a.ph [new file with mode: 0644]
doc/metrics/putr8a.ph [new file with mode: 0644]
doc/metrics/putri8a.ph [new file with mode: 0644]
doc/metrics/pzcmi8a.ph [new file with mode: 0644]
doc/metrics/pzdr.ph [new file with mode: 0644]
doc/nasmdoc.src [new file with mode: 0644]
doc/nasmlogo.eps [new file with mode: 0644]
doc/opt_var.txt [new file with mode: 0644]
doc/psfonts.ph [new file with mode: 0644]
doc/pswidth.ph [new file with mode: 0644]
doc/rdsrc.pl [new file with mode: 0644]
eval.c [new file with mode: 0644]
eval.h [new file with mode: 0644]
exprlib.c [new file with mode: 0644]
float.c [new file with mode: 0644]
float.h [new file with mode: 0644]
hashtbl.c [new file with mode: 0644]
hashtbl.h [new file with mode: 0644]
headers/c [new file with mode: 0644]
headers/doc [new file with mode: 0644]
headers/mac [new file with mode: 0644]
headers/perl [new file with mode: 0644]
insns.dat [new file with mode: 0644]
insns.h [new file with mode: 0644]
insns.pl [new file with mode: 0755]
insnsa.c [new file with mode: 0644]
insnsb.c [new file with mode: 0644]
insnsd.c [new file with mode: 0644]
insnsi.h [new file with mode: 0644]
insnsn.c [new file with mode: 0644]
install-sh [new file with mode: 0755]
inttypes/inttypes.h [new file with mode: 0644]
labels.c [new file with mode: 0644]
labels.h [new file with mode: 0644]
lcc/README [new file with mode: 0644]
lcc/bind.c [new file with mode: 0644]
lcc/lin-aout.c [new file with mode: 0644]
lcc/lin-elf.c [new file with mode: 0644]
lcc/x86nasm.md [new file with mode: 0644]
lib/snprintf.c [new file with mode: 0644]
lib/strlcpy.c [new file with mode: 0644]
lib/vsnprintf.c [new file with mode: 0644]
listing.c [new file with mode: 0644]
listing.h [new file with mode: 0644]
macros.c [new file with mode: 0644]
macros.pl [new file with mode: 0755]
macros/altreg.mac [new file with mode: 0644]
macros/smartalign.mac [new file with mode: 0644]
misc/Doxyfile [new file with mode: 0644]
misc/Nindent [new file with mode: 0755]
misc/README [new file with mode: 0644]
misc/altreg.inc [new file with mode: 0644]
misc/c16.mac [new file with mode: 0644]
misc/c32.mac [new file with mode: 0644]
misc/cleanfile [new file with mode: 0755]
misc/cleanpatch [new file with mode: 0755]
misc/crcgen.c [new file with mode: 0644]
misc/exebin.mac [new file with mode: 0644]
misc/exebin2.mac [new file with mode: 0644]
misc/findleak.pl [new file with mode: 0755]
misc/findleak.txt [new file with mode: 0644]
misc/fmtinsns.pl [new file with mode: 0755]
misc/genfma.pl [new file with mode: 0755]
misc/hints.txt [new file with mode: 0644]
misc/magic [new file with mode: 0644]
misc/makedist.sh [new file with mode: 0755]
misc/myC32.mac [new file with mode: 0644]
misc/nasm.sl [new file with mode: 0644]
misc/nasmstab [new file with mode: 0644]
misc/omfdump.c [new file with mode: 0644]
misc/pmw.bat [new file with mode: 0644]
misc/proc32.ash [new file with mode: 0644]
misc/release [new file with mode: 0755]
misc/scitech.mac [new file with mode: 0644]
misc/tag-release [new file with mode: 0755]
misc/xcrcgen.c [new file with mode: 0644]
mkdep.pl [new file with mode: 0755]
nasm.1 [new file with mode: 0644]
nasm.c [new file with mode: 0644]
nasm.h [new file with mode: 0644]
nasm.nsi [new file with mode: 0644]
nasm.spec [new file with mode: 0644]
nasm.spec.in [new file with mode: 0644]
nasmlib.c [new file with mode: 0644]
nasmlib.h [new file with mode: 0644]
ndisasm.1 [new file with mode: 0644]
ndisasm.c [new file with mode: 0644]
nsis/nasm-un.ico [new file with mode: 0644]
nsis/nasm.ico [new file with mode: 0644]
opflags.h [new file with mode: 0644]
output/dwarf.h [new file with mode: 0644]
output/elf.h [new file with mode: 0644]
output/nulldbg.c [new file with mode: 0644]
output/nullout.c [new file with mode: 0644]
output/outaout.c [new file with mode: 0644]
output/outaout.mac [new file with mode: 0644]
output/outas86.c [new file with mode: 0644]
output/outas86.mac [new file with mode: 0644]
output/outbin.c [new file with mode: 0644]
output/outbin.mac [new file with mode: 0644]
output/outcoff.c [new file with mode: 0644]
output/outcoff.mac [new file with mode: 0644]
output/outdbg.c [new file with mode: 0644]
output/outelf.c [new file with mode: 0644]
output/outelf.h [new file with mode: 0644]
output/outelf.mac [new file with mode: 0644]
output/outelf32.c [new file with mode: 0644]
output/outelf64.c [new file with mode: 0644]
output/outform.c [new file with mode: 0644]
output/outform.h [new file with mode: 0644]
output/outieee.c [new file with mode: 0644]
output/outlib.c [new file with mode: 0644]
output/outlib.h [new file with mode: 0644]
output/outmacho.mac [new file with mode: 0644]
output/outmacho32.c [new file with mode: 0644]
output/outmacho64.c [new file with mode: 0644]
output/outobj.c [new file with mode: 0644]
output/outobj.mac [new file with mode: 0644]
output/outrdf.mac [new file with mode: 0644]
output/outrdf2.c [new file with mode: 0644]
output/outrdf2.mac [new file with mode: 0644]
output/stabs.h [new file with mode: 0644]
parser.c [new file with mode: 0644]
parser.h [new file with mode: 0644]
perllib/README [new file with mode: 0644]
perllib/crc64.ph [new file with mode: 0644]
perllib/gensv.pl [new file with mode: 0755]
perllib/phash.ph [new file with mode: 0644]
perllib/random_sv_vectors.ph [new file with mode: 0644]
phash.pl [new file with mode: 0755]
pptok.c [new file with mode: 0644]
pptok.dat [new file with mode: 0644]
pptok.h [new file with mode: 0644]
pptok.ph [new file with mode: 0644]
pptok.pl [new file with mode: 0755]
preproc.c [new file with mode: 0644]
preproc.h [new file with mode: 0644]
quote.c [new file with mode: 0644]
quote.h [new file with mode: 0644]
raa.c [new file with mode: 0644]
raa.h [new file with mode: 0644]
rbtree.c [new file with mode: 0644]
rbtree.h [new file with mode: 0644]
rdoff/Makefile.in [new file with mode: 0644]
rdoff/Mkfiles/Makefile.dj [new file with mode: 0644]
rdoff/Mkfiles/Makefile.emx [new file with mode: 0644]
rdoff/Mkfiles/Makefile.sc [new file with mode: 0644]
rdoff/Mkfiles/Makefile.unx [new file with mode: 0644]
rdoff/Mkfiles/README [new file with mode: 0644]
rdoff/README [new file with mode: 0644]
rdoff/collectn.c [new file with mode: 0644]
rdoff/collectn.h [new file with mode: 0644]
rdoff/doc/Makefile [new file with mode: 0644]
rdoff/doc/rdoff.texi [new file with mode: 0644]
rdoff/doc/v1-v2.txt [new file with mode: 0644]
rdoff/hash.c [new file with mode: 0644]
rdoff/hash.h [new file with mode: 0644]
rdoff/ldrdf.1 [new file with mode: 0644]
rdoff/ldrdf.c [new file with mode: 0644]
rdoff/ldsegs.h [new file with mode: 0644]
rdoff/rdf2bin.1 [new file with mode: 0644]
rdoff/rdf2bin.c [new file with mode: 0644]
rdoff/rdf2com.1 [new file with mode: 0644]
rdoff/rdf2ihx.1 [new file with mode: 0644]
rdoff/rdf2ith.1 [new file with mode: 0644]
rdoff/rdf2srec.1 [new file with mode: 0644]
rdoff/rdfdump.1 [new file with mode: 0644]
rdoff/rdfdump.c [new file with mode: 0644]
rdoff/rdflib.1 [new file with mode: 0644]
rdoff/rdflib.c [new file with mode: 0644]
rdoff/rdfload.c [new file with mode: 0644]
rdoff/rdfload.h [new file with mode: 0644]
rdoff/rdlar.c [new file with mode: 0644]
rdoff/rdlar.h [new file with mode: 0644]
rdoff/rdlib.c [new file with mode: 0644]
rdoff/rdlib.h [new file with mode: 0644]
rdoff/rdoff.c [new file with mode: 0644]
rdoff/rdoff.h [new file with mode: 0644]
rdoff/rdx.1 [new file with mode: 0644]
rdoff/rdx.c [new file with mode: 0644]
rdoff/segtab.c [new file with mode: 0644]
rdoff/segtab.h [new file with mode: 0644]
rdoff/symtab.c [new file with mode: 0644]
rdoff/symtab.h [new file with mode: 0644]
rdoff/test/Makefile [new file with mode: 0644]
rdoff/test/makelib.sh [new file with mode: 0644]
rdoff/test/rdfseg.asm [new file with mode: 0644]
rdoff/test/rdfseg2.asm [new file with mode: 0644]
rdoff/test/rdftest1.asm [new file with mode: 0644]
rdoff/test/rdftest2.asm [new file with mode: 0644]
rdoff/test/rdtlib.asm [new file with mode: 0644]
rdoff/test/rdtmain.asm [new file with mode: 0644]
rdoff/test/testlib.asm [new file with mode: 0644]
regdis.c [new file with mode: 0644]
regdis.h [new file with mode: 0644]
regflags.c [new file with mode: 0644]
regs.c [new file with mode: 0644]
regs.dat [new file with mode: 0644]
regs.h [new file with mode: 0644]
regs.pl [new file with mode: 0755]
regvals.c [new file with mode: 0644]
saa.c [new file with mode: 0644]
saa.h [new file with mode: 0644]
standard.mac [new file with mode: 0644]
stdscan.c [new file with mode: 0644]
stdscan.h [new file with mode: 0644]
strfunc.c [new file with mode: 0644]
sync.c [new file with mode: 0644]
sync.h [new file with mode: 0644]
syncfiles.pl [new file with mode: 0755]
tables.h [new file with mode: 0644]
test/Makefile [new file with mode: 0644]
test/_file_.asm [new file with mode: 0644]
test/_version.asm [new file with mode: 0644]
test/a32offs.asm [new file with mode: 0644]
test/absolute.asm [new file with mode: 0644]
test/addr64x.asm [new file with mode: 0644]
test/align13.asm [new file with mode: 0644]
test/align13s.asm [new file with mode: 0644]
test/alonesym-obj.asm [new file with mode: 0644]
test/andbyte.asm [new file with mode: 0644]
test/aoutso.asm [new file with mode: 0644]
test/aouttest.asm [new file with mode: 0644]
test/aouttest.c [new file with mode: 0644]
test/avx.asm [new file with mode: 0644]
test/avx005.asm [new file with mode: 0644]
test/bcd.asm [new file with mode: 0644]
test/binexe.asm [new file with mode: 0644]
test/bintest.asm [new file with mode: 0644]
test/bisect.sh [new file with mode: 0755]
test/br1879590.asm [new file with mode: 0644]
test/br2003451.asm [new file with mode: 0644]
test/br2030823.asm [new file with mode: 0644]
test/br2148476.asm [new file with mode: 0644]
test/br2222615.asm [new file with mode: 0644]
test/br560575.asm [new file with mode: 0644]
test/br560873.asm [new file with mode: 0644]
test/br890790.asm [new file with mode: 0644]
test/br890790_i.asm [new file with mode: 0644]
test/changed.asm [new file with mode: 0644]
test/cofftest.asm [new file with mode: 0644]
test/cofftest.c [new file with mode: 0644]
test/crc32.asm [new file with mode: 0644]
test/dtbcd.asm [new file with mode: 0644]
test/elf64so.asm [new file with mode: 0644]
test/elfso.asm [new file with mode: 0644]
test/elftest.asm [new file with mode: 0644]
test/elftest.c [new file with mode: 0644]
test/elftest64.c [new file with mode: 0644]
test/elif.asm [new file with mode: 0644]
test/expimp.asm [new file with mode: 0644]
test/far64.asm [new file with mode: 0644]
test/float.asm [new file with mode: 0644]
test/float8.asm [new file with mode: 0644]
test/floatb.asm [new file with mode: 0644]
test/floatexp.asm [new file with mode: 0644]
test/floatize.asm [new file with mode: 0644]
test/floattest.asm [new file with mode: 0644]
test/floatx.asm [new file with mode: 0644]
test/fpu.asm [new file with mode: 0644]
test/fwdopt.asm [new file with mode: 0644]
test/fwdoptpp.asm [new file with mode: 0644]
test/gotoff64.asm [new file with mode: 0644]
test/ifelse.asm [new file with mode: 0644]
test/ifmacro.asm [new file with mode: 0644]
test/iftoken.asm [new file with mode: 0644]
test/iftoken.pl [new file with mode: 0755]
test/imacro.asm [new file with mode: 0644]
test/imm64.asm [new file with mode: 0644]
test/immwarn.asm [new file with mode: 0644]
test/imul.asm [new file with mode: 0644]
test/inc1.asm [new file with mode: 0644]
test/inc2.asm [new file with mode: 0644]
test/inctest.asm [new file with mode: 0644]
test/insnlbl.asm [new file with mode: 0644]
test/invlpga.asm [new file with mode: 0644]
test/jmp64.asm [new file with mode: 0644]
test/lar_lsl.asm [new file with mode: 0644]
test/larlsl.asm [new file with mode: 0644]
test/lnxhello.asm [new file with mode: 0644]
test/local.asm [new file with mode: 0644]
test/loopoffs.asm [new file with mode: 0644]
test/macro-defaults.asm [new file with mode: 0644]
test/mmxsize.asm [new file with mode: 0644]
test/movimm.asm [new file with mode: 0644]
test/movnti.asm [new file with mode: 0644]
test/multisection.asm [new file with mode: 0644]
test/nasmformat.asm [new file with mode: 0644]
test/new [new file with mode: 0755]
test/nop.asm [new file with mode: 0644]
test/nullfile.asm [new file with mode: 0644]
test/objexe.asm [new file with mode: 0644]
test/objlink.c [new file with mode: 0644]
test/objtest.asm [new file with mode: 0644]
test/optimization.asm [new file with mode: 0644]
test/org.asm [new file with mode: 0644]
test/perf/label.pl [new file with mode: 0755]
test/perf/macro.pl [new file with mode: 0755]
test/perf/token.pl [new file with mode: 0755]
test/performtest.pl [new file with mode: 0755]
test/pinsr16.asm [new file with mode: 0644]
test/pinsr32.asm [new file with mode: 0644]
test/pinsr64.asm [new file with mode: 0644]
test/popcnt.asm [new file with mode: 0644]
test/ppindirect.asm [new file with mode: 0644]
test/pushseg.asm [new file with mode: 0644]
test/r13.asm [new file with mode: 0644]
test/radix.asm [new file with mode: 0644]
test/riprel.asm [new file with mode: 0644]
test/riprel.pl [new file with mode: 0755]
test/riprel2.asm [new file with mode: 0644]
test/smartalign16.asm [new file with mode: 0644]
test/smartalign32.asm [new file with mode: 0644]
test/smartalign64.asm [new file with mode: 0644]
test/struc.asm [new file with mode: 0644]
test/test67.asm [new file with mode: 0644]
test/testdos.asm [new file with mode: 0644]
test/testnos3.asm [new file with mode: 0644]
test/time.asm [new file with mode: 0644]
test/tmap.nas [new file with mode: 0644]
test/uscore.asm [new file with mode: 0644]
test/utf.asm [new file with mode: 0644]
test/vmread.asm [new file with mode: 0644]
test/weirdpaste.asm [new file with mode: 0644]
test/xchg.asm [new file with mode: 0644]
test/xcrypt.asm [new file with mode: 0644]
test/zerobyte.asm [new file with mode: 0644]
tokens.dat [new file with mode: 0644]
tokens.h [new file with mode: 0644]
tokhash.c [new file with mode: 0644]
tokhash.pl [new file with mode: 0755]
ver.c [new file with mode: 0644]
version [new file with mode: 0644]
version.h [new file with mode: 0644]
version.mac [new file with mode: 0644]
version.mak [new file with mode: 0644]
version.nsh [new file with mode: 0644]
version.pl [new file with mode: 0755]
version.sed [new file with mode: 0644]

diff --git a/AUTHORS b/AUTHORS
new file mode 100644 (file)
index 0000000..a66ecb3
--- /dev/null
+++ b/AUTHORS
@@ -0,0 +1,137 @@
+This is the AUTHORS file for the NASM project located at:
+http://nasm.sourceforge.net/
+
+Names should be inserted as follows:
+
+N: Name Here
+E: Email Here
+D: Description Here
+D: Additional Description Here.... and so on
+C: Copyright information
+
+Such is life.
+-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
+
+N: Julian Hall
+E: Jules@acris.co.uk
+D: Original author and co-conspirator
+
+N: Simon Tatham
+E: anakin@pobox.com
+D: Original author and co-conspirator
+
+N: Nelson Rush
+E: palisade@users.sourceforge.net
+D: Some guy.
+
+N: Frank Kotler
+E: fbkotler@users.sf.net
+D: Bug smashing.
+D: Documentation - "KATMAI" and "3DNow!" instructions supported by 0.98
+D: General coordination and moral support.
+
+N: Stephen Silver
+E: nasm@argentum.freeserve.co.uk
+D: Documentation - "3dNow!" instructions and misc.
+D: insns.dat fixes and new instructions.
+
+N: AMD Inc. (names of developers here?)
+E: 
+D: 3DNow instructions
+D: New Athlon instructions
+D: Makefile.vc fix
+
+N: John Coffman
+E: johninsd@users.sourceforge.net
+D: added Jcc optimizations; CPU level checks
+D: bug fixes, compilation fixes
+
+N: Yuri Zaporogets
+E: yuriz@users.sourceforge.net
+D: RDOFF support
+
+N: H. Peter Anvin
+E: hpa@zytor.com
+D: Primary maintainer for the 0.98, late 0.98.x and 2.x releases.
+C: Contributions since 2008-12-15 are Copyright Intel Corporation.
+
+N: John Fine
+E: johnfine@earthlink.net
+D: Preprocessor and OBJ (OMF) output format driver
+D: Organized DOS versions of 0.98 release
+
+N: Kendall Bennet
+E: KendallB@scitechsoft.com 
+D: NASM enhancements
+D: macros
+D: Syntax modifications
+
+N: Gary Clark
+E: 
+D: AMD 3DNow! instructions
+
+N: Andrew Crabtree
+E: 
+D: Debugging support
+
+N: Rafael R. Sevilla
+E: dido@pacific.net.ph
+D: RDF2HEX utility
+
+N: Jaime Tejedor Gómez, aka Metalbrain
+E: metalbrain_coder@gmx.net
+D: jecxz bug fix
+
+N: James Seter
+E: pharos@zsnes.com
+D: --POSTFIX, --PREFIX switches
+D: ?
+
+N: Edward J. Beroset
+E: beroset@mindspring.com
+D: added %substr and %strlen
+
+N: Stanislav Karchebny, aka berkus, madfire, daemonhunter
+E: madfire@users.sourceforge.net
+D: multiple sections support for -fbin format
+D: cvs maintenance
+D: webpage at http://nasm.2y.net maintenance
+
+N: Debbie Wiles, aka debs
+E: debs@dwiles.demon.co.uk
+D: Work on docs, added undocumented instructions (esp SSE2 and 3D-Now!)
+D: Added other documentation and tidied up docs
+D: Added a few instructions to insns.dat and tidied it up.
+
+N: Trevor Woerner
+E: FIXME
+D: Quiet compiler warnings
+
+N: Michael K. Ter Louw
+E: mterlo1 "at" uic "dot" edu
+D: Multisection support for "-f bin"
+
+N: Martin Wawro
+E: FIXME
+D: stabs debug support for "-f elf"
+
+N: Alexei Frounze
+E: alexfru@users.sourceforge.net
+D: "-I" paths searched for "incbined" files
+D: bugswatting
+
+N: Keith Kanios, aka SpooK
+E: keith@kanios.net
+D: c99 Compliance
+D: General x64 Support
+D: win64 (x86-64 COFF) output format
+D: __BITS__ Standard Macro
+D: Website Maintenance @ http://nasm.sourceforge.net/
+
+N: Chuck Crayne
+E: ccrayne@users.sourceforge.net
+D: elf64 (x86_64) output format
+
+N: Cyrill Gorcunov
+E: gorcunov@gmail.com
+D: AMD XOP/FMA4/CVT16 instructions
diff --git a/CHANGES b/CHANGES
new file mode 100644 (file)
index 0000000..b89696f
--- /dev/null
+++ b/CHANGES
@@ -0,0 +1,2 @@
+The revision history has moved to the file doc/changes.src, and
+is now included in the documentation as Appendix C.
diff --git a/ChangeLog b/ChangeLog
new file mode 100644 (file)
index 0000000..ff3befc
--- /dev/null
+++ b/ChangeLog
@@ -0,0 +1,2905 @@
+Sat Nov 24 16:31:48 2007 -0800 H. Peter Anvin 
+  * Typo fixes in documentation
+Tue Nov 20 23:37:46 2007 -0800 H. Peter Anvin 
+  * NASM 2.00rc3
+Tue Nov 20 21:45:16 2007 -0800 H. Peter Anvin 
+  * Unbreak CMPSW/CMPSD/CMPSQ
+Tue Nov 20 13:23:34 2007 -0800 H. Peter Anvin 
+  * Merge branch 'master' of git+ssh://repo.or.cz/srv/git/nasm
+Tue Nov 20 13:22:58 2007 -0800 H. Peter Anvin 
+  * ndisasm: handle the case of "no more sync points"
+Mon Nov 19 23:09:31 2007 -0800 H. Peter Anvin 
+  * NASM 2.00rc2
+Mon Nov 19 23:09:24 2007 -0800 H. Peter Anvin 
+  * tag-release: a simple script to tag the repository for release
+Mon Nov 19 13:14:59 2007 -0800 H. Peter Anvin 
+  * Slightly faster implementation of the deadman counter
+Mon Nov 19 12:26:50 2007 -0800 H. Peter Anvin 
+  * BR 812417: Deadman counter for macro expansion
+Mon Nov 19 12:02:38 2007 -0800 H. Peter Anvin 
+  * BR 877583: Fix RAA memory leak
+Mon Nov 19 11:53:18 2007 -0800 H. Peter Anvin 
+  * BR 863173: Fix offsets of TIMES/INCBIN in list file
+Mon Nov 19 11:45:40 2007 -0800 H. Peter Anvin 
+  * BR 1834731: Remove redundant error messages for no input file
+Mon Nov 19 11:44:05 2007 -0800 H. Peter Anvin 
+  * insns.pl: remove debugging output
+Sun Nov 18 22:18:09 2007 -0800 H. Peter Anvin 
+  * Clean up remaining build warnings
+Sun Nov 18 21:55:26 2007 -0800 H. Peter Anvin 
+  * BR 1834292: Fix multiple disassembler bugs
+Sun Nov 18 12:01:05 2007 -0800 H. Peter Anvin 
+  * BR 1834056: Remove warnings in rdoff/rdoff.c
+Sun Nov 18 11:55:10 2007 -0800 H. Peter Anvin 
+  * BR 1091926: Bounds checking for command line parsing
+Sat Nov 17 21:21:18 2007 -0800 H. Peter Anvin 
+  * Remove FIXME from documentation
+Sat Nov 17 21:08:33 2007 -0800 Charles Crayne 
+  * Check in Keith's Fixes
+Sat Nov 17 14:35:19 2007 -0800 H. Peter Anvin 
+  * Make the definition for float_const() match the prototype
+Fri Nov 16 00:03:02 2007 -0800 H. Peter Anvin 
+  * NASM 2.00rc1
+Thu Nov 15 17:12:29 2007 -0800 H. Peter Anvin 
+  * Clean up the command-line parsing; make -w/-W match others
+Thu Nov 15 14:38:19 2007 -0800 H. Peter Anvin 
+  * BR 993895: Support zero-operand floating-point insn
+Thu Nov 15 10:25:52 2007 -0800 H. Peter Anvin 
+  * Remove some vestiges of "native" RESW/RESD support
+Thu Nov 15 10:24:55 2007 -0800 H. Peter Anvin 
+  * outbin.c: fix one missed change from type -> size
+Tue Nov 13 19:52:54 2007 -0800 root 
+  * Support setting OSABI value in ELF header.
+Tue Nov 13 11:34:34 2007 -0800 H. Peter Anvin 
+  * Enable a few warnings by default; clean up warning descriptions
+Tue Nov 13 11:31:15 2007 -0800 H. Peter Anvin 
+  * Add gcc-style -W/-Wno- warning selections; -Wall; -Werror
+Tue Nov 13 10:37:23 2007 -0800 H. Peter Anvin 
+  * Clean up the fwrite*() function definitions somewhat
+Tue Nov 13 09:49:51 2007 -0800 H. Peter Anvin 
+  * Cast 64-bit switch expressions to (int) to keep OpenWatcom happy
+Tue Nov 13 09:46:38 2007 -0800 H. Peter Anvin 
+  * x86-host-specific performance improvement
+Tue Nov 13 09:37:59 2007 -0800 H. Peter Anvin 
+  * Address data is int64_t; simplify writing an address object
+Mon Nov 12 23:00:31 2007 -0800 H. Peter Anvin 
+  * ndisasm: factor out the common operand-extraction code
+Mon Nov 12 22:56:07 2007 -0800 H. Peter Anvin 
+  * Un-special-case "xchg rax,rax"; disassemble o64
+Mon Nov 12 22:11:46 2007 -0800 H. Peter Anvin 
+  * BR 1709392: Fix alignment handling in Mach-O format
+Mon Nov 12 22:05:31 2007 -0800 H. Peter Anvin 
+  * BR 1828866: fix handling of LAR/LSL
+Mon Nov 12 21:57:00 2007 -0800 H. Peter Anvin 
+  * Better (but not *good!*) handling of 64-bit addressing in ndisasm
+Mon Nov 12 21:02:33 2007 -0800 H. Peter Anvin 
+  * Fix disassembly of XCHG
+Mon Nov 12 20:18:33 2007 -0800 H. Peter Anvin 
+  * Test of XCHG
+Mon Nov 12 20:18:05 2007 -0800 H. Peter Anvin 
+  * Fix handling of XCHG in 64-bit mode
+Mon Nov 12 19:36:13 2007 -0800 H. Peter Anvin 
+  * More \321 -> \324 bug fixes
+Mon Nov 12 18:26:31 2007 -0800 H. Peter Anvin 
+  * float.c: all warnings and errors are pass 1 only
+Sat Nov 10 21:55:19 2007 -0800 Charles Crayne 
+  * Update documentation for stack relative directives.
+Sat Nov 10 17:52:23 2007 -0800 Charles Crayne 
+  * Clean up a few more 32-bit bottlenecks
+Fri Nov 9 16:37:41 2007 -0800 Charles Crayne 
+  * Update documantation for stack relative directives
+Fri Nov 9 16:33:54 2007 -0800 Charles Crayne 
+  * Merge branch 'master' of /home/chuck/development/gitnasm/
+Fri Nov 9 16:25:43 2007 -0800 Charles Crayne 
+  * Update documentation for stack relative directives
+Fri Nov 9 14:44:02 2007 -0800 H. Peter Anvin 
+  * Don't combine type and size into a single argument
+Thu Nov 8 22:11:14 2007 -0800 Charles Crayne 
+  * Add flat64 to %stacksize choices
+Thu Nov 8 20:43:22 2007 -0800 H. Peter Anvin 
+  * Fix building under OpenWatcom
+Thu Nov 8 20:29:37 2007 -0800 H. Peter Anvin 
+  * ps2pdf: remove -dOptimize=true
+Thu Nov 8 20:21:41 2007 -0800 H. Peter Anvin 
+  * No binary files left in the source distro; unbreak release script
+Thu Nov 8 20:01:11 2007 -0800 H. Peter Anvin 
+  * BR 1828103: Fix %arg and %local
+Thu Nov 8 19:34:01 2007 -0800 H. Peter Anvin 
+  * nasmlib.c: prefix_name(): use the elements() macro
+Thu Nov 8 19:30:22 2007 -0800 H. Peter Anvin 
+  * Move elements() to nasmlib.h
+Thu Nov 8 19:15:33 2007 -0800 H. Peter Anvin 
+  * constipate the "str" argument to bsi() and bsii()
+Wed Nov 7 19:03:46 2007 -0800 Charles Crayne 
+  * Upgrade RAA functions to hold 64-bit data.
+Tue Nov 6 21:48:12 2007 -0800 Charles Crayne 
+  * Pass 64-bit instruction lengths to back-ends.
+Tue Nov 6 18:27:23 2007 -0800 Charles Crayne 
+  * Prepare for 64-bit instruction lengths
+Mon Nov 5 21:49:49 2007 -0800 Charles Crayne 
+  * Disambiguate error messages
+Mon Nov 5 17:19:32 2007 -0800 Charles Crayne 
+  * Upgrade label functions to 64-bit
+Sun Nov 4 21:10:42 2007 -0800 H. Peter Anvin 
+  * Permit opcode names as labels as long as they are followed by a colon
+Sun Nov 4 15:28:30 2007 -0800 Charles Crayne 
+  * Make warning limit valid for both i386 and x86_64
+Sat Nov 3 22:06:13 2007 -0700 Charles Crayne 
+  * Warn on out of bounds EA displacements
+Thu Nov 1 15:08:27 2007 -0700 H. Peter Anvin 
+  * Treat info files as binary when creating xdoc distro file
+Thu Nov 1 15:07:42 2007 -0700 H. Peter Anvin 
+  * Remove obsolete binary files from the distribution
+Thu Nov 1 14:53:32 2007 -0700 H. Peter Anvin 
+  * Move declarations before statements
+Wed Oct 31 23:37:35 2007 -0700 H. Peter Anvin 
+  * NASM 0.99.06
+Wed Oct 31 23:37:19 2007 -0700 H. Peter Anvin 
+  * Script to tag the tree for release
+Wed Oct 31 10:59:26 2007 -0700 H. Peter Anvin 
+  * Even more "riprel" tests
+Tue Oct 30 01:17:57 2007 -0700 H. Peter Anvin 
+  * floatx.asm: add tests for "rounds up to smallest denorm"
+Tue Oct 30 01:13:27 2007 -0700 H. Peter Anvin 
+  * Run "make alldeps"
+Tue Oct 30 01:13:09 2007 -0700 H. Peter Anvin 
+  * float.c: handle round-up-to-denorm correctly.
+Tue Oct 30 00:59:27 2007 -0700 H. Peter Anvin 
+  * Exhaustive test for 8-bit floating point values
+Mon Oct 29 23:12:47 2007 -0700 H. Peter Anvin 
+  * Clean up the handing of operands in assemble.c
+Mon Oct 29 22:56:08 2007 -0700 H. Peter Anvin 
+  * Don't warn for segmented references
+Mon Oct 29 20:20:12 2007 -0700 H. Peter Anvin 
+  * Use a 32-bit floating-point limb size; support 8-bit float
+Mon Oct 29 18:24:59 2007 -0700 Charles Crayne 
+  * Reduce severity of redundant prefixes from error to warning.
+Sun Oct 28 23:23:24 2007 -0700 H. Peter Anvin 
+  * Test of some addressing modes in 64-bit mode.
+Sun Oct 28 23:21:46 2007 -0700 H. Peter Anvin 
+  * Fix bogus flagging of effective addresses as invalid
+Sun Oct 28 23:10:34 2007 -0700 H. Peter Anvin 
+  * Actually shut up the warning in rdfload.c
+Sun Oct 28 22:04:42 2007 -0700 H. Peter Anvin 
+  * Clean up stealth whitespace
+Sun Oct 28 22:04:00 2007 -0700 H. Peter Anvin 
+  * Fix warning about cast to pointer in rdfload.c
+Sun Oct 28 22:04:00 2007 -0700 H. Peter Anvin 
+  * 64-bit addressing and prefix handling changes
+Sun Oct 28 15:29:54 2007 -0700 Charles Crayne 
+  * Adjust stabs symbol index to match symbol table.
+Fri Oct 26 21:38:02 2007 -0700 H. Peter Anvin 
+  * readnum(): handle prefix-suffix collision like "0h"
+Fri Oct 26 18:49:29 2007 -0700 H. Peter Anvin 
+  * Better handling of platforms which hide "extended" functionality
+Wed Oct 24 15:51:40 2007 -0700 Charles Crayne 
+  * Merge branch 'master' of /home/chuck/development/gitnasm/
+Wed Oct 24 15:30:17 2007 -0700 Charles Crayne 
+  * Update sections about debug info formats
+Wed Oct 24 15:29:51 2007 -0700 H. Peter Anvin 
+  * Fix the handling of floating-point tokens in the preprocessor
+Tue Oct 23 19:28:39 2007 -0700 Charles Crayne 
+  * Fix bugs item #1817677
+Tue Oct 23 00:08:58 2007 -0700 H. Peter Anvin 
+  * Slightly simplify the radix-detection code
+Mon Oct 22 19:48:06 2007 -0700 H. Peter Anvin 
+  * Unbreak particularly tricky hex constants
+Mon Oct 22 19:37:36 2007 -0700 H. Peter Anvin 
+  * Decimal floating point can also start with 0. 0e 0E
+Mon Oct 22 17:34:10 2007 -0700 H. Peter Anvin 
+  * Support binary and octal floating-point
+Mon Oct 22 16:53:48 2007 -0700 H. Peter Anvin 
+  * More consistent handling of radix letters
+Sun Oct 21 15:33:01 2007 -0700 H. Peter Anvin 
+  * float.c: correct exponent capping
+Sun Oct 21 14:21:43 2007 -0700 Charles Crayne 
+  * Clean up elf symbol table section
+Fri Oct 19 18:33:57 2007 -0700 H. Peter Anvin 
+  * Allow $-prefixed hexadecimal FP as an alternative to 0x
+Fri Oct 19 14:43:22 2007 -0700 H. Peter Anvin 
+  * Scripts to remove stealth whitespace
+Fri Oct 19 14:42:29 2007 -0700 H. Peter Anvin 
+  * Formatting: kill off "stealth whitespace"
+Fri Oct 19 14:26:52 2007 -0700 H. Peter Anvin 
+  * test/floatx.asm: fix test case
+Fri Oct 19 14:19:52 2007 -0700 H. Peter Anvin 
+  * uscore.asm: Fix test case
+Fri Oct 19 14:17:51 2007 -0700 H. Peter Anvin 
+  * float.c: mark read_exponent() static
+Fri Oct 19 14:10:35 2007 -0700 H. Peter Anvin 
+  * Don't confuse suffixed hexadecimal with floating-point
+Fri Oct 19 13:17:24 2007 -0700 H. Peter Anvin 
+  * Anchor filename locations in .gitignore
+Fri Oct 19 13:16:51 2007 -0700 H. Peter Anvin 
+  * test/Makefile: Use -Ox instead of -O999
+Fri Oct 19 13:14:06 2007 -0700 H. Peter Anvin 
+  * Test of underscored constants
+Fri Oct 19 13:10:46 2007 -0700 H. Peter Anvin 
+  * Allow underscores in numbers; better detection of FP
+Fri Oct 19 10:52:31 2007 -0700 H. Peter Anvin 
+  * Modernize nasm.spec.in and make it closer to the Fedora version
+Thu Oct 18 23:33:06 2007 -0700 Charles Crayne 
+  * Suppress datarootdir warnings from configure
+Thu Oct 18 21:17:20 2007 -0700 Charles Crayne 
+  * Suppress signedness warnings in disassembler
+Thu Oct 18 19:14:08 2007 -0700 H. Peter Anvin 
+  * Cleaner solution for MinGW handling of __STRICT_ANSI__
+Thu Oct 18 19:14:08 2007 -0700 H. Peter Anvin 
+  * configure: Undefine __STRICT_ANSI__ for mingw's benefit
+Thu Oct 18 19:14:07 2007 -0700 H. Peter Anvin 
+  * Fix invocation of readnum()
+Thu Oct 18 19:02:42 2007 -0700 Charles Crayne 
+  * Suppress a few signedness warnings
+Thu Oct 18 17:04:10 2007 -0700 root 
+  * Avoid unnecessary warning on redefinition of section (bug 801180)
+Wed Oct 17 17:55:45 2007 -0700 Charles Crayne 
+  * Generate stabs entries for any executable section
+Tue Oct 16 22:59:09 2007 -0700 H. Peter Anvin 
+  * NASM 0.99.05
+Tue Oct 16 15:46:04 2007 -0700 H. Peter Anvin 
+  * Tests of obscenely large exponents
+Tue Oct 16 14:42:32 2007 -0700 H. Peter Anvin 
+  * Comma-separate contents of __FLOAT__
+Tue Oct 16 14:40:27 2007 -0700 H. Peter Anvin 
+  * Implement floating-point option control directive
+Tue Oct 16 11:48:07 2007 -0700 H. Peter Anvin 
+  * Floating-point warning fixes; fix round-to-overflow
+Tue Oct 16 11:32:58 2007 -0700 H. Peter Anvin 
+  * Handle rounding of denorms correctly; make fp overflow a warning
+Tue Oct 16 10:35:02 2007 -0700 H. Peter Anvin 
+  * Additional entries for .gitignore
+Tue Oct 16 10:32:57 2007 -0700 H. Peter Anvin 
+  * Refactor floating-point formatting code; fix 80-bit denorms
+Tue Oct 16 10:31:16 2007 -0700 H. Peter Anvin 
+  * Add 1.5 as a test case: representative of an exact fraction
+Mon Oct 15 20:06:06 2007 -0700 H. Peter Anvin 
+  * Recognize 'd', 't' and 'y' as radix suffixes
+Mon Oct 15 19:53:10 2007 -0700 H. Peter Anvin 
+  * Fix FISTTP opcodes (BR 689695)
+Mon Oct 15 19:46:32 2007 -0700 H. Peter Anvin 
+  * New floating-point conversion routines
+Mon Oct 15 17:48:43 2007 -0700 H. Peter Anvin 
+  * Add testnos3 from the gdtoa package (floating-point test)
+Sat Oct 13 23:19:21 2007 -0700 H. Peter Anvin 
+  * .gitignore file doesn't need to be in the release file
+Sat Oct 13 23:17:41 2007 -0700 H. Peter Anvin 
+  * Add .gitignore file so "git status" produces something sane
+Sat Oct 13 23:12:46 2007 -0700 H. Peter Anvin 
+  * autoconf: drop AC_USE_SYSTEM_EXTENSIONS to support autoconf 2.59
+Sat Oct 13 07:09:22 2007 -0700 Keith Kanios 
+  * Fix 32-bit types in preproc.c and eval.c
+Thu Oct 11 20:32:33 2007 -0700 Charles Crayne 
+  * Must define types before using them
+Thu Oct 11 13:42:09 2007 -0700 H. Peter Anvin 
+  * preproc.c: move smacro define/undef to separate functions
+Thu Oct 11 13:38:38 2007 -0700 H. Peter Anvin 
+  * preproc.c: PP_DEFINE and PP_XDEFINE are case-sensitive
+Thu Oct 11 12:52:03 2007 -0700 H. Peter Anvin 
+  * preproc.c: normalize the handling of case sensitivity
+Thu Oct 11 12:51:06 2007 -0700 H. Peter Anvin 
+  * Define macros necessary for <inttypes.h> on C++
+Thu Oct 11 10:12:58 2007 -0700 H. Peter Anvin 
+  * More "bool" fixes
+Thu Oct 11 10:11:57 2007 -0700 H. Peter Anvin 
+  * preproc.c: allow 64-bit repeat counts
+Thu Oct 11 10:06:19 2007 -0700 H. Peter Anvin 
+  * preproc.c: For an SMacro, in_progress really is a boolean (no %rep)
+Thu Oct 11 00:05:57 2007 -0700 H. Peter Anvin 
+  * Additional uses of bool and enum
+Thu Oct 11 00:05:57 2007 -0700 H. Peter Anvin 
+  * preproc.c: MMacro.in_progress is not a boolean
+Wed Oct 10 18:07:51 2007 -0700 H. Peter Anvin 
+  * saa_fread/fwrite: when seeking, must set [rw]ptr as well
+Wed Oct 10 14:58:45 2007 -0700 H. Peter Anvin 
+  * Use the compiler-provided booleans if available, otherwise emulate
+Wed Oct 10 14:55:14 2007 -0700 H. Peter Anvin 
+  * owlinux.mak: don't clean things we won't be able to
+Wed Oct 10 14:29:53 2007 -0700 H. Peter Anvin 
+  * configure.in: looks like we need autoconf 2.61 :(
+Wed Oct 10 14:06:59 2007 -0700 H. Peter Anvin 
+  * Create option -Ox to tell NASM to do unlimited passes
+Mon Oct 8 19:26:57 2007 -0700 H. Peter Anvin 
+  * Revert "floatb.asm: fix broken testcase"
+Mon Oct 8 18:39:24 2007 -0700 H. Peter Anvin 
+  * floatb.asm: fix broken testcase
+Mon Oct 8 12:41:00 2007 -0700 H. Peter Anvin 
+  * saa_rstruct: fix overrun check
+Mon Oct 8 12:12:23 2007 -0700 H. Peter Anvin 
+  * Add Frank's floattest.asm test file
+Sun Oct 7 21:13:14 2007 -0700 H. Peter Anvin 
+  * saa_fpwrite: initializing "len" should be part of the loop
+Sun Oct 7 18:46:57 2007 -0700 Charles Crayne 
+  * Fix infinite loop in function saa_fpwrite
+Fri Oct 5 17:44:16 2007 -0700 H. Peter Anvin 
+  * zerobyte.asm: use a real instruction to avoid confusing ndisasm
+Fri Oct 5 17:42:31 2007 -0700 H. Peter Anvin 
+  * zerobyte.asm: add test cases for non-initial \170 uses
+Fri Oct 5 17:29:01 2007 -0700 H. Peter Anvin 
+  * Check in the proper zerobyte test
+Fri Oct 5 17:04:32 2007 -0700 H. Peter Anvin 
+  * Emit REX prefix before literal zero (\170)
+Fri Oct 5 17:01:15 2007 -0700 H. Peter Anvin 
+  * LICENSE: Break long line
+Fri Oct 5 14:36:03 2007 -0700 H. Peter Anvin 
+  * Add test for problematic floats
+Thu Oct 4 23:51:08 2007 -0700 H. Peter Anvin 
+  * floatx.asm: add Inf and NaN to the boundary condition tests
+Thu Oct 4 23:09:19 2007 -0700 H. Peter Anvin 
+  * floatx.asm: add specific tests for exponent boundary conditions
+Thu Oct 4 22:51:08 2007 -0700 H. Peter Anvin 
+  * float.c: correct the exponent
+Thu Oct 4 15:18:23 2007 -0700 H. Peter Anvin 
+  * Additional rules in test/Makefile
+Thu Oct 4 13:42:56 2007 -0700 H. Peter Anvin 
+  * Rewrite the handling of SAA's to allow random access
+Wed Oct 3 21:30:57 2007 -0700 H. Peter Anvin 
+  * Change cloc_t to struct location, and reorder the members
+Wed Oct 3 21:24:51 2007 -0700 H. Peter Anvin 
+  * BR 1352920: change loc_t -> cloc_t
+Wed Oct 3 21:22:16 2007 -0700 H. Peter Anvin 
+  * BR 1352920: Handle upper case %line
+Wed Oct 3 17:40:12 2007 -0700 H. Peter Anvin 
+  * Use autoconf to request feature macros
+Tue Oct 2 22:04:15 2007 -0700 H. Peter Anvin 
+  * preproc.c: constipation
+Tue Oct 2 21:57:27 2007 -0700 H. Peter Anvin 
+  * make alldeps
+Tue Oct 2 21:53:51 2007 -0700 H. Peter Anvin 
+  * Portability fixes
+Tue Oct 2 21:13:18 2007 -0700 H. Peter Anvin 
+  * Run "make alldeps".
+Tue Oct 2 17:40:00 2007 -0700 H. Peter Anvin 
+  * Use the crc64 we already use as the perfect hash function prehash
+Tue Oct 2 15:09:33 2007 -0700 H. Peter Anvin 
+  * insns.dat: add systematic names for the hinting NOPs (0F18-0F1F)
+Mon Oct 1 11:28:32 2007 -0700 H. Peter Anvin 
+  * Unspecified files are null strings, not null pointers
+Mon Oct 1 11:26:31 2007 -0700 H. Peter Anvin 
+  * Check for the most basic filename overlaps
+Sun Sep 30 22:15:36 2007 -0700 Charles Crayne 
+  * modified:   nasm.1 to add newer command line options
+Fri Sep 28 21:27:41 2007 -0700 Charles Crayne 
+  * Merge branch 'master' of git+ssh://ccrayne@repo.or.cz/srv/git/nasm
+Fri Sep 28 20:17:12 2007 -0700 H. Peter Anvin 
+  * configure.in: AC_SUBST_FILE should have been AC_SUBST
+Fri Sep 28 17:17:20 2007 -0700 H. Peter Anvin 
+  * Unbreak relative references to immediate addresses
+Fri Sep 28 15:16:47 2007 -0700 Charles Crayne 
+  * Merge branch 'master' of git+ssh://ccrayne@repo.or.cz/srv/git/nasm
+Fri Sep 28 12:01:55 2007 -0700 H. Peter Anvin 
+  * lib/vsnprintf.c: correct boundary conditions
+Fri Sep 28 10:50:20 2007 -0700 H. Peter Anvin 
+  * Add substitutes for snprintf() and vsnprintf()
+Fri Sep 28 02:03:41 2007 -0400 Frank Kotler 
+  * Merge branch 'master' of git+ssh://fbkotler@repo.or.cz/srv/git/nasm
+Thu Sep 27 21:35:04 2007 -0700 H. Peter Anvin 
+  * Exclude config.h from the dependency list for the canned makefiles
+Thu Sep 27 21:12:17 2007 -0700 H. Peter Anvin 
+  * version.pl: Add support for daily snapshot releases
+Thu Sep 27 19:46:55 2007 -0700 H. Peter Anvin 
+  * Add Makefile for Linux -> DOS, Win32, OS/2 using OpenWatcom
+Wed Sep 26 19:57:07 2007 -0700 H. Peter Anvin 
+  * Add Makefile for OpenWatcom (DOS, OS/2 or Win32 output)
+Wed Sep 26 17:00:18 2007 -0700 H. Peter Anvin 
+  * Test for various addressing modes in 64-bit mode
+Wed Sep 26 15:19:28 2007 -0700 H. Peter Anvin 
+  * nasm option reshuffling, -E -> -Z
+Tue Sep 25 23:57:21 2007 -0400 Frank Kotler 
+  * Version 0.99.04
+Tue Sep 25 20:36:45 2007 -0700 H. Peter Anvin 
+  * nasmdoc: corrections on 64-bit immediates/displacements
+Tue Sep 25 16:02:21 2007 -0700 H. Peter Anvin 
+  * nasmdoc: shorten lines which are too long
+Tue Sep 25 16:01:07 2007 -0700 H. Peter Anvin 
+  * Document NASM behaviour for 64-bit immediates and displacements
+Tue Sep 25 15:44:40 2007 -0700 H. Peter Anvin 
+  * test/movimm.asm: add optimizable forms
+Tue Sep 25 15:41:19 2007 -0700 H. Peter Anvin 
+  * assemble.c: clean up whitespace
+Tue Sep 25 15:40:36 2007 -0700 H. Peter Anvin 
+  * Correct the handling of "MOV" with immediate in 64-bit mode
+Tue Sep 25 15:39:42 2007 -0700 H. Peter Anvin 
+  * Test of immediate handling on 64-bit mode
+Tue Sep 25 14:27:34 2007 -0700 H. Peter Anvin 
+  * Add nasm_zalloc() to nasmlib.c
+Tue Sep 25 14:26:03 2007 -0700 H. Peter Anvin 
+  * Fix BR 1490407: size of the second operand of LAR/LSL
+Tue Sep 25 14:11:29 2007 -0700 H. Peter Anvin 
+  * Fix BR 1490407: size of the second operand of LAR/LSL
+Tue Sep 25 13:34:55 2007 -0700 H. Peter Anvin 
+  * Makefile.in: make "make install" create directories
+Tue Sep 25 08:48:37 2007 -0700 H. Peter Anvin 
+  * Fix BR 1445441: uninitialized use of "error_file"
+Mon Sep 24 21:33:17 2007 -0700 H. Peter Anvin 
+  * preproc.c: fix the loop in %undef
+Mon Sep 24 20:53:48 2007 -0700 H. Peter Anvin 
+  * float.c: clear off uninitialized warning
+Mon Sep 24 17:02:41 2007 -0700 H. Peter Anvin 
+  * outcoff: set the "virtual size field" to zero (BR 1351586)
+Mon Sep 24 15:56:02 2007 -0700 H. Peter Anvin 
+  * insns.dat: SMINT - mark ND, DMINT - fix opcode
+Mon Sep 24 15:55:20 2007 -0700 H. Peter Anvin 
+  * 0F0F is a 3Dnow! prefix; remove from prefix list
+Mon Sep 24 15:48:09 2007 -0700 H. Peter Anvin 
+  * Additional compaction missed by script
+Mon Sep 24 15:42:53 2007 -0700 H. Peter Anvin 
+  * insns.dat: machine-generated compaction mmx/xmmreg,mem -> mmx/xmmrm
+Mon Sep 24 13:54:00 2007 -0700 H. Peter Anvin 
+  * nasmdoc: grammar fix
+Mon Sep 24 13:44:02 2007 -0700 H. Peter Anvin 
+  * nasmdoc: remove stray periods
+Mon Sep 24 13:42:09 2007 -0700 H. Peter Anvin 
+  * test/Makefile: make a bit more useful
+Mon Sep 24 13:41:58 2007 -0700 H. Peter Anvin 
+  * Implement the -MG option (SF RFE 1564264)
+Mon Sep 24 12:52:09 2007 -0700 H. Peter Anvin 
+  * nasmdoc: clarify __float*__ example
+Mon Sep 24 12:44:38 2007 -0700 H. Peter Anvin 
+  * nasmdoc: document the __float*__ operators
+Mon Sep 24 12:30:54 2007 -0700 H. Peter Anvin 
+  * Support __float*__ for floating-point numbers in expressions
+Mon Sep 24 10:51:07 2007 -0700 H. Peter Anvin 
+  * eval.c: replace sequence of ifs with switch
+Mon Sep 24 10:50:23 2007 -0700 H. Peter Anvin 
+  * tokhash: allow a bit smarter pattern matching
+Sat Sep 22 22:35:28 2007 -0700 H. Peter Anvin 
+  * Implement INVLPGA according to the documentation
+Sat Sep 22 22:02:34 2007 -0700 H. Peter Anvin 
+  * Reformat insns.dat to uniform column width
+Sat Sep 22 21:50:03 2007 -0700 H. Peter Anvin 
+  * Simple test for 0x67 prefixes
+Sat Sep 22 21:49:51 2007 -0700 H. Peter Anvin 
+  * Auto-generate 0x67 prefixes without the need for \30x codes
+Sat Sep 22 21:47:13 2007 -0700 H. Peter Anvin 
+  * Make test/Makefile a bit more useful
+Sat Sep 22 21:29:41 2007 -0700 H. Peter Anvin 
+  * Add TY_OWORD for "DO" output
+Sat Sep 22 19:52:11 2007 -0700 H. Peter Anvin 
+  * LDDQU needs \301 (BR 1103549)
+Sat Sep 22 19:51:13 2007 -0700 H. Peter Anvin 
+  * RDTSCP and INVLPGA aren't 64-bit specific
+Sat Sep 22 19:40:37 2007 -0700 H. Peter Anvin 
+  * Cyrix GX1 instructions: BBx_RESET, CPU_READ, CPU_WRITE
+Sat Sep 22 19:28:14 2007 -0700 H. Peter Anvin 
+  * Centaur XSHA1, XSHA256, MONTMUL
+Sat Sep 22 19:20:56 2007 -0700 H. Peter Anvin 
+  * Implement Centaur's XCRYPT instructions
+Sat Sep 22 19:13:05 2007 -0700 H. Peter Anvin 
+  * Add Geode LX (AMD's Cyrix-derived core) instructions
+Sat Sep 22 19:05:11 2007 -0700 H. Peter Anvin 
+  * Add the GETSEC instruction for Intel SMX
+Sat Sep 22 18:59:18 2007 -0700 H. Peter Anvin 
+  * Add the AMD SSE4a and LZCNT instructions
+Sat Sep 22 18:23:20 2007 -0700 H. Peter Anvin 
+  * Tag UMOV as ND (no disassembly) to avoid collision
+Sat Sep 22 18:20:49 2007 -0700 H. Peter Anvin 
+  * Disallow optimizing by less than 5 passes.
+Sat Sep 22 17:45:45 2007 -0700 H. Peter Anvin 
+  * BR 1783117: Document that %+ needs a space after it, and fix crash
+Sat Sep 22 16:44:56 2007 -0700 H. Peter Anvin 
+  * nasm.spec.in: minor fixes
+Sat Sep 22 16:38:25 2007 -0700 H. Peter Anvin 
+  * release script: handle stricter CLI parsing for "git tag"
+Sat Sep 22 16:35:11 2007 -0700 H. Peter Anvin 
+  * Update nasm.spec.in and make it handle rc releases
+Sat Sep 22 16:19:19 2007 -0700 H. Peter Anvin 
+  * version.pl: support version numbers of the form X.Y[.Z]rcW
+Thu Sep 20 21:33:43 2007 -0700 Charles Crayne 
+  * Merge branch 'master' of git+ssh://ccrayne@repo.or.cz/srv/git/nasm
+Thu Sep 20 21:12:33 2007 -0700 Charles Crayne 
+  *    modified:   misc/release to fix bug in removing .git
+Wed Sep 19 21:41:43 2007 -0700 H. Peter Anvin 
+  * Merge branch 'master' of git+ssh://repo.or.cz/srv/git/nasm
+Wed Sep 19 21:41:27 2007 -0700 H. Peter Anvin 
+  * Update manual pages
+Wed Sep 19 21:41:02 2007 -0700 H. Peter Anvin 
+  * Remove limit on number of sync points
+Wed Sep 19 21:40:37 2007 -0700 H. Peter Anvin 
+  * Make nasm_malloc() et al available from inside ndisasm
+Wed Sep 19 21:07:32 2007 -0400 Frank Kotler 
+  * Version 0.99.03
+Wed Sep 19 21:06:59 2007 -0400 Frank Kotler 
+  * Merge branch 'master' of git+ssh://fbkotler@repo.or.cz/srv/git/nasm
+Wed Sep 19 16:22:03 2007 -0700 H. Peter Anvin 
+  * Merge commit 'origin/sse5'
+Wed Sep 19 16:15:22 2007 -0700 H. Peter Anvin 
+  * test/Makefile: make a bit more useful
+Tue Sep 18 22:54:40 2007 -0700 H. Peter Anvin 
+  * Slightly optimize the interface to nasm_token_hash()
+Wed Sep 19 01:34:55 2007 -0400 Frank Kotler 
+  * Merge branch 'master' of git+ssh://fbkotler@repo.or.cz/srv/git/nasm
+Tue Sep 18 22:23:42 2007 -0700 H. Peter Anvin 
+  * Merge commit 'origin/master' into sse5
+Tue Sep 18 22:22:49 2007 -0700 H. Peter Anvin 
+  * elf64: fix 32-bit truncations
+Tue Sep 18 22:08:04 2007 -0700 H. Peter Anvin 
+  * Document Infinity and NaN
+Tue Sep 18 21:55:56 2007 -0700 H. Peter Anvin 
+  * Support generating NaNs and infinities
+Tue Sep 18 19:12:26 2007 -0700 H. Peter Anvin 
+  * Update documentation
+Tue Sep 18 18:37:36 2007 -0700 H. Peter Anvin 
+  * Simple test for hexadecimal floating-point numbers
+Tue Sep 18 18:33:17 2007 -0700 H. Peter Anvin 
+  * Fix error-reporting in hexadecimal floating-point numbers
+Tue Sep 18 18:31:26 2007 -0700 H. Peter Anvin 
+  * Support C99-style hexadecimal floating point.
+Tue Sep 18 17:50:34 2007 -0700 H. Peter Anvin 
+  * Unify all standard IEEE floating-point formats; add 128-bit
+Tue Sep 18 17:49:09 2007 -0700 H. Peter Anvin 
+  * Fix handling of DO; support unary + for floating-point numbers
+Tue Sep 18 16:39:03 2007 -0700 H. Peter Anvin 
+  * Support 16-bit IEEE floating point; used in SSE5
+Tue Sep 18 15:43:40 2007 -0700 H. Peter Anvin 
+  * Merge commit 'origin/master' into sse5
+Tue Sep 18 15:43:08 2007 -0700 H. Peter Anvin 
+  * Add NOP with argument to the instruction list
+Tue Sep 18 15:24:38 2007 -0700 H. Peter Anvin 
+  * Remove 0FC2 from list of instruction prefixes
+Tue Sep 18 15:08:20 2007 -0700 H. Peter Anvin 
+  * Speed up the disassembler by allowing prefixed instruction tables
+Tue Sep 18 13:45:12 2007 -0700 H. Peter Anvin 
+  * Document oword, do and reso
+Tue Sep 18 13:01:32 2007 -0700 H. Peter Anvin 
+  * Implement "oword" (128 bits) as a first-class size
+Tue Sep 18 12:38:07 2007 -0700 H. Peter Anvin 
+  * Change the token prehash function for better convergence
+Tue Sep 18 12:23:21 2007 -0700 H. Peter Anvin 
+  * SSE5 instruction table
+Tue Sep 18 02:06:09 2007 -0400 Frank Kotler 
+  * add "const" to output/outdbg.c
+Mon Sep 17 18:45:44 2007 -0700 H. Peter Anvin 
+  * Disassembler support for SSE5 instructions
+Mon Sep 17 17:27:46 2007 -0700 H. Peter Anvin 
+  * insns.dat: All SSE5 instructions are AMD
+Mon Sep 17 17:25:27 2007 -0700 H. Peter Anvin 
+  * Actually generate SSE5 instructions
+Mon Sep 17 16:55:04 2007 -0700 H. Peter Anvin 
+  * Initial support for generating DREX suffixes
+Mon Sep 17 16:31:33 2007 -0700 H. Peter Anvin 
+  * Fix a few instances of missing renumbers
+Mon Sep 17 16:20:45 2007 -0700 H. Peter Anvin 
+  * Enable IF_AR3
+Mon Sep 17 15:49:53 2007 -0700 H. Peter Anvin 
+  * Merge commit 'origin/master' into sse5
+Mon Sep 17 15:49:30 2007 -0700 H. Peter Anvin 
+  * Initial support for four arguments per instruction
+Mon Sep 17 15:48:32 2007 -0700 H. Peter Anvin 
+  * CLFLUSH: Neither an x64 instruction nor AMD
+Mon Sep 17 13:56:26 2007 -0700 H. Peter Anvin 
+  * Sort dependency lists
+Mon Sep 17 13:53:14 2007 -0700 H. Peter Anvin 
+  * Cleaner way to handle MSVC's _snprintf() underscore damage
+Mon Sep 17 13:19:25 2007 -0700 H. Peter Anvin 
+  * test/r13.asm: test special-casing of rbp and r13 in 64-bit mode
+Mon Sep 17 13:03:33 2007 -0700 H. Peter Anvin 
+  * Additional documentation for 64-bit programming
+Sun Sep 16 22:27:07 2007 -0700 H. Peter Anvin 
+  * INSTALL: MSVC++ compilation instructions
+Sun Sep 16 22:17:29 2007 -0700 H. Peter Anvin 
+  * make alldeps: change Mkfiles/Makefile.* to Mkfiles/*.mak
+Sun Sep 16 22:16:24 2007 -0700 H. Peter Anvin 
+  * Fix Makefile for MSVC++ 2005, delete obsolete Makefiles
+Sun Sep 16 22:15:34 2007 -0700 H. Peter Anvin 
+  * Minor fixes needed to compile with MSVC++ 2005
+Sun Sep 16 18:35:02 2007 -0700 H. Peter Anvin 
+  * Run "make alldeps"
+Sun Sep 16 18:04:57 2007 -0700 H. Peter Anvin 
+  * Switch the preprocessor over to using the hash table library
+Sun Sep 16 17:53:17 2007 -0700 H. Peter Anvin 
+  * Fix the handling of local labels
+Fri Sep 14 18:36:01 2007 -0700 H. Peter Anvin 
+  * preproc.c: remove unnecessary int64_t
+Fri Sep 14 18:03:29 2007 -0700 H. Peter Anvin 
+  * Use the new hash table function library to store labels
+Fri Sep 14 09:24:38 2007 -0700 H. Peter Anvin 
+  * Define a proper hash table library
+Thu Sep 13 18:13:20 2007 -0700 H. Peter Anvin 
+  * Simple performance benchmarks: label, macro and token lookups
+Thu Sep 13 12:25:32 2007 -0700 H. Peter Anvin 
+  * release script: fix final cleanup
+Thu Sep 13 12:22:00 2007 -0700 H. Peter Anvin 
+  * Modify release script for a git-centric world
+Thu Sep 13 11:06:42 2007 -0700 H. Peter Anvin 
+  * pptok.c: don't insist on C99 compiler behaviour
+Wed Sep 12 22:02:06 2007 -0700 H. Peter Anvin 
+  * Fix literal F2 and F3 prefixes
+Wed Sep 12 21:58:51 2007 -0700 H. Peter Anvin 
+  * Add (untested!) SSSE3, SSE4.1, SSE4.2 instructions
+Wed Sep 12 21:06:36 2007 -0700 H. Peter Anvin 
+  * Add support for Tejas New Instructions (SSSE3)
+Wed Sep 12 21:05:06 2007 -0700 H. Peter Anvin 
+  * Remove $Id$ tags (useless with git)
+Wed Sep 12 21:04:58 2007 -0700 H. Peter Anvin 
+  * Use rm32 operands for VMREAD/VMWRITE
+Wed Sep 12 21:04:51 2007 -0700 H. Peter Anvin 
+  * Macros for SSSE3/SSE4 instruction sets
+Wed Sep 12 21:04:39 2007 -0700 H. Peter Anvin 
+  * Support r/m operands for non-integer types
+Wed Sep 12 20:27:41 2007 -0700 H. Peter Anvin 
+  * Use enumerations where practical to ease debugging
+Wed Sep 12 17:02:55 2007 +0000 H. Peter Anvin 
+  * pptok.c: quick-and-dirty downcasing during prehashing
+Wed Sep 12 16:55:57 2007 +0000 H. Peter Anvin 
+  * phash: Tell the user when the graph is OK
+Wed Sep 12 05:18:20 2007 +0000 H. Peter Anvin 
+  * pptok.c: handle holes in the pp_directives array
+Wed Sep 12 04:20:08 2007 +0000 H. Peter Anvin 
+  * preproc.c: adjust whitespace
+Wed Sep 12 04:18:37 2007 +0000 H. Peter Anvin 
+  * More automation in the preprocessor conditionals handling
+Wed Sep 12 02:13:39 2007 +0000 H. Peter Anvin 
+  * pptok.c: fix spacing
+Wed Sep 12 02:12:07 2007 +0000 H. Peter Anvin 
+  * Generate automatically correct tests for %if and %elif
+Wed Sep 12 01:34:19 2007 +0000 H. Peter Anvin 
+  * Run "make alldeps"; add dependencies missing from the previous checkin
+Wed Sep 12 01:29:43 2007 +0000 H. Peter Anvin 
+  * Use a perfect hash to look up preprocessor directives
+Wed Sep 12 01:27:53 2007 +0000 H. Peter Anvin 
+  * phash: Be a bit more aggressive about trying to make a small hash
+Wed Sep 12 00:22:29 2007 +0000 H. Peter Anvin 
+  * Add RCXZ as a known preprocessor condition
+Tue Sep 11 23:57:23 2007 +0000 H. Peter Anvin 
+  * doc: add some cross-references
+Tue Sep 11 23:52:01 2007 +0000 H. Peter Anvin 
+  * Feeble attempt at updating the documentation; remove Appendix B
+Tue Sep 11 22:44:03 2007 +0000 H. Peter Anvin 
+  * Handle instructions which can have both REX.W and OSP
+Tue Sep 11 22:14:18 2007 +0000 H. Peter Anvin 
+  * Use enums to make debugging easier
+Tue Sep 11 22:13:17 2007 +0000 H. Peter Anvin 
+  * ndisasm: handle \366 codes, prefer unprefixed instructions
+Tue Sep 11 22:00:34 2007 +0000 H. Peter Anvin 
+  * Simplify tokens.dat slightly
+Tue Sep 11 04:26:44 2007 +0000 H. Peter Anvin 
+  * Quiet gcc warning about uninitialized variables
+Tue Sep 11 04:16:57 2007 +0000 H. Peter Anvin 
+  * Make the big instruction arrays "const"
+Mon Sep 10 23:32:05 2007 +0000 H. Peter Anvin 
+  * Use an actual enum for the opcode
+Mon Sep 10 23:30:21 2007 +0000 H. Peter Anvin 
+  * Fix order of token arguments
+Mon Sep 10 18:59:26 2007 +0000 H. Peter Anvin 
+  * assemble.c: correct special handing of ESP/RSP
+Mon Sep 10 18:59:01 2007 +0000 H. Peter Anvin 
+  * tokhash: correct duplicate-token test
+Mon Sep 10 18:58:40 2007 +0000 H. Peter Anvin 
+  * tokhash: adjust table types to reduce size
+Mon Sep 10 18:55:52 2007 +0000 H. Peter Anvin 
+  * Fix the MMXREG and XMMREG flags definitions.
+Wed Sep 5 06:48:38 2007 +0000 H. Peter Anvin 
+  * nasm.spec.in: Copyright -> License
+Wed Sep 5 06:40:51 2007 +0000 H. Peter Anvin 
+  * Fix "make tar"; useful for RPM testing
+Wed Sep 5 06:24:43 2007 +0000 H. Peter Anvin 
+  * Remove obsolete Serial: construct; we shouldn't need it anyway.
+Tue Sep 4 01:29:43 2007 +0000 Chuck Crayne 
+  * Provide 64-bit support for ORG directive
+Sun Sep 2 16:37:03 2007 +0000 H. Peter Anvin 
+  * Fix some MMX/SSE irregularities which interact with the 64-bit support
+Sun Sep 2 14:46:00 2007 +0000 H. Peter Anvin 
+  * phash.ph: yet another attempt at getting Perl to behave, arithmetically
+Sun Sep 2 06:23:29 2007 +0000 H. Peter Anvin 
+  * Simple 64-bit org test
+Sun Sep 2 06:20:15 2007 +0000 H. Peter Anvin 
+  * phash.ph: remove some stale code
+Sun Sep 2 01:00:34 2007 +0000 Chuck Crayne 
+  * Force use of integer values for generating hash keys.
+Fri Aug 31 18:10:23 2007 +0000 H. Peter Anvin 
+  * phash: don't rely on the build platform Perl version of rand()
+Fri Aug 31 07:31:51 2007 +0000 H. Peter Anvin 
+  * tokhash.pl: formatting changes for readability
+Fri Aug 31 07:23:31 2007 +0000 H. Peter Anvin 
+  * tokhash: Speed up the rejection of unhashed values
+Fri Aug 31 06:06:17 2007 +0000 H. Peter Anvin 
+  * tokhash.pl: "ix" should have the same width as the "hash" arrays
+Fri Aug 31 00:28:35 2007 +0000 H. Peter Anvin 
+  * Add "do not edit" comment to tokhash.c
+Fri Aug 31 00:23:40 2007 +0000 H. Peter Anvin 
+  * Make the token hash a bit smaller by using 16-bit hash tables
+Fri Aug 31 00:16:10 2007 +0000 H. Peter Anvin 
+  * Minor cleanup; remove duplication of names.c
+Thu Aug 30 23:42:39 2007 +0000 H. Peter Anvin 
+  * phash.ph: use a bipartite graph to reduce the storage requirements
+Thu Aug 30 22:35:34 2007 +0000 H. Peter Anvin 
+  * Finishing touches on perfect hash tokenizer; actually turn the thing on
+Thu Aug 30 21:50:20 2007 +0000 H. Peter Anvin 
+  * Makefile rule for tokhash.c
+Thu Aug 30 21:47:46 2007 +0000 H. Peter Anvin 
+  * tokens.dat: Data file containing alphanumeric tokens not in other .dats
+Thu Aug 30 21:45:56 2007 +0000 H. Peter Anvin 
+  * Generate a perfect hash for the token parser
+Thu Aug 30 21:40:08 2007 +0000 H. Peter Anvin 
+  * Fix bugs in repeated suffix handling, which led to missing r8d/r8w/r8d
+Thu Aug 30 21:39:37 2007 +0000 H. Peter Anvin 
+  * phash.ph: more powerful prehashing
+Thu Aug 30 20:15:25 2007 +0000 H. Peter Anvin 
+  * Make the perfect hash generator an includable module
+Wed Aug 29 20:30:31 2007 +0000 H. Peter Anvin 
+  * Correct the logic for recording fs: and gs: overrides.
+Wed Aug 29 18:20:19 2007 +0000 H. Peter Anvin 
+  * Generate R_X86_64_64 relocations in elf64 output
+Wed Aug 29 17:24:03 2007 +0000 H. Peter Anvin 
+  * Add README file
+Wed Aug 29 17:20:09 2007 +0000 H. Peter Anvin 
+  * Create a Perl library directory, and add the Graph module to it
+Wed Aug 29 17:05:17 2007 +0000 H. Peter Anvin 
+  * Perfect hash generator, as a perl script
+Wed Aug 29 16:41:43 2007 +0000 H. Peter Anvin 
+  * Use standard macro for the default directive
+Wed Aug 29 16:40:26 2007 +0000 H. Peter Anvin 
+  * Add standard macro for [default] directive
+Wed Aug 29 16:38:47 2007 +0000 H. Peter Anvin 
+  * More test cases for rel and abs addressing
+Wed Aug 29 16:38:05 2007 +0000 H. Peter Anvin 
+  * Add [default] directive
+Wed Aug 29 16:25:46 2007 +0000 H. Peter Anvin 
+  * nasmlib: add bsii() case-insensitive version of bsi()
+Wed Aug 29 15:49:53 2007 +0000 H. Peter Anvin 
+  * Add test cases for IP-relative addressing
+Wed Aug 29 15:19:19 2007 +0000 H. Peter Anvin 
+  * Suppress IP-relative only for fs: and gs: overrides
+Tue Aug 28 23:06:00 2007 +0000 H. Peter Anvin 
+  * Implement REL/ABS modifiers
+Sun Aug 26 05:51:39 2007 +0000 Frank Kotler 
+  * attempt to make static makefiles aware of outelf32/outelf64
+Sun Aug 26 05:48:54 2007 +0000 Frank Kotler 
+  * add nasm_strsep to nasmlib, for output/outmacho.c - strtok doesn't work
+Sun Aug 26 05:41:33 2007 +0000 Frank Kotler 
+  * remove "#include <unistd.h> from rdoff directory - two places - it annoyed Windows users and seems unneeded
+Sun Aug 26 05:10:24 2007 +0000 Frank Kotler 
+  * finally commit Mike Frysinger's "elf-visibility" patch
+Mon Aug 20 21:03:14 2007 +0000 H. Peter Anvin 
+  * regs.pl: handle dashed sequences with suffixes
+Mon Aug 20 20:10:04 2007 +0000 H. Peter Anvin 
+  * sync.c: change ULONG_MAX to UINT32_MAX
+Mon Aug 20 20:09:11 2007 +0000 H. Peter Anvin 
+  * Add _MIN and _MAX macros for the fixed-size types.
+Mon Aug 20 20:02:17 2007 +0000 H. Peter Anvin 
+  * ldrdf: cast output of sizeof() before passing to printf(), to avoid warning.
+Sun Aug 19 18:49:26 2007 +0000 Keith Kanios 
+  * Fixed RIP address processing ambiguity found by Charles Crayne.
+Fri Aug 17 07:37:52 2007 +0000 Keith Kanios 
+  * Fixed issues with REX prefix effective address generation. Fixed XMM instruction output.
+Fri Aug 17 02:03:10 2007 +0000 Keith Kanios 
+  * Changed MMXREG and XMMREG flags to help resolve invalid REX prefix generation for MMX instructions.
+Sat Jul 7 02:01:08 2007 +0000 H. Peter Anvin 
+  * More int/int32_t confusion
+Sat Jul 7 01:59:52 2007 +0000 H. Peter Anvin 
+  * regflag() should return int32_t.
+Thu Jun 21 19:00:12 2007 +0000 H. Peter Anvin 
+  * Detect missing <inttypes.h> and include ersatz version if missing
+Thu Jun 21 06:24:23 2007 +0000 H. Peter Anvin 
+  * inttypes.h: for older preprocessors, specify L and LL as appropriate
+Thu Jun 21 06:20:43 2007 +0000 H. Peter Anvin 
+  * inttypes.h: Fix spelling of SHRT_MAX
+Thu Jun 21 06:15:42 2007 +0000 H. Peter Anvin 
+  * inttypes.h: do a single ersatz <inttypes.h> based on <limits.h>
+Sun Jun 3 02:42:41 2007 +0000 Chuck Crayne 
+  * Support 32-bit direct addressing in 64-bit mode without base or index regs
+Sat Jun 2 02:26:21 2007 +0000 H. Peter Anvin 
+  * Fix the [U]INT*_C() creation macros
+Sat Jun 2 00:05:35 2007 +0000 H. Peter Anvin 
+  * For platforms that don't have them, provide <inttypes.h> for common models.
+Wed May 30 22:21:11 2007 +0000 H. Peter Anvin 
+  * Fix the handling of the \313 code.
+Wed May 30 22:20:01 2007 +0000 H. Peter Anvin 
+  * Machine-generated \321->\324 corrections
+Wed May 30 21:22:33 2007 +0000 Frank Kotler 
+  * update "version" to 0.99.02
+Wed May 30 20:30:15 2007 +0000 H. Peter Anvin 
+  * Correct the generation of 67 prefixes.
+Wed May 30 18:30:18 2007 +0000 H. Peter Anvin 
+  * Update dependencies.
+Wed May 30 16:34:29 2007 +0000 Frank Kotler 
+  * update cvs server name in misc/release script
+Wed May 30 04:28:50 2007 +0000 H. Peter Anvin 
+  * Avoid magic values; we have more than 124 registers now
+Wed May 30 04:27:58 2007 +0000 H. Peter Anvin 
+  * Remove bogus redundant tests
+Wed May 30 03:44:50 2007 +0000 H. Peter Anvin 
+  * More \321 -> \324
+Wed May 30 03:44:02 2007 +0000 H. Peter Anvin 
+  * Remove bogus check for 64-bitness
+Wed May 30 03:25:21 2007 +0000 H. Peter Anvin 
+  * Get rid of magic open-coded "register numbers"
+Wed May 30 02:48:51 2007 +0000 H. Peter Anvin 
+  * MOV reg64,reg64 takes \324 (64 bit with REX) not \321 (32 bit)
+Wed May 30 00:18:26 2007 +0000 H. Peter Anvin 
+  * Rename REGNORM to REG_EA
+Wed May 30 00:15:25 2007 +0000 H. Peter Anvin 
+  * More instruction flag surgery
+Wed May 30 00:05:00 2007 +0000 H. Peter Anvin 
+  * More cleanup of operand flags/register classes
+Tue May 29 23:57:12 2007 +0000 H. Peter Anvin 
+  * Clean up the existing operand flag definitions, and document
+Tue May 29 21:44:55 2007 +0000 H. Peter Anvin 
+  * Run "make alldeps"
+Thu May 24 22:33:07 2007 +0000 Frank Kotler 
+  * update version number to 0.99.01
+Tue May 15 04:33:43 2007 +0000 H. Peter Anvin 
+  * regs.dat: fix comment
+Fri May 4 18:47:16 2007 +0000 H. Peter Anvin 
+  * 16-bit relocations are standard in ELF64 (at my request, incidentally)
+Fri May 4 02:16:08 2007 +0000 Chuck Crayne 
+  * Addition of elf32 and elf64 output formats.
+Wed May 2 04:21:26 2007 +0000 Chuck Crayne 
+  * Allow '!' to be used in expressions with same meaning as in C.
+Wed May 2 01:59:16 2007 +0000 Chuck Crayne 
+  * Add %IFN and %ELIFN as per RFE #786286
+Mon Apr 30 22:26:58 2007 +0000 Chuck Crayne 
+  * Accept responsibility for support of outelf64.c
+Sun Apr 29 20:57:53 2007 +0000 Chuck Crayne 
+  * Clarify comments about relocation entries.
+Sun Apr 29 00:28:24 2007 +0000 Chuck Crayne 
+  * Allow ELF32 to be invoked either as -f elf or -f elf32
+Sat Apr 28 22:18:04 2007 +0000 Chuck Crayne 
+  * Eliminate shift count warnings when building on 32-bit systems
+Sat Apr 28 06:18:48 2007 +0000 Chuck Crayne 
+  * Initial support for ELF64
+Wed Apr 18 02:27:18 2007 +0000 H. Peter Anvin 
+  * Fix the handling of \324 for computing the length
+Wed Apr 18 02:24:34 2007 +0000 Keith Kanios 
+  * Fixed RDF/2 to comply with "maxbits" use.
+Tue Apr 17 20:23:11 2007 +0000 H. Peter Anvin 
+  * Handle "LOCK as REX.R" for MOV CRx; fix warning for invalid 64-bit regs
+Mon Apr 16 18:16:46 2007 +0000 Keith Kanios 
+  * MEM_OFFSET Instructions Fixed.
+Mon Apr 16 15:46:46 2007 +0000 Keith Kanios 
+  * Fixed 64-bit Mode Segment Selection.
+Mon Apr 16 14:31:54 2007 +0000 Keith Kanios 
+  * Fixed distinction between [LOCAL]SYMBOL/IMMEDIATE for RIP-relative addressing.
+Mon Apr 16 14:05:01 2007 +0000 Keith Kanios 
+  * Fixed long mode MEM_OFFS issue.
+Mon Apr 16 13:54:49 2007 +0000 Keith Kanios 
+  * Filled in all RIP Register Flags.
+Mon Apr 16 05:26:29 2007 +0000 H. Peter Anvin 
+  * More \321 -> \324 for 64-bit instructions
+Mon Apr 16 04:56:06 2007 +0000 Keith Kanios 
+  * Fixed 64-bit offset generation.
+Mon Apr 16 02:39:56 2007 +0000 H. Peter Anvin 
+  * More 64-bit ndisasm fixes.
+Mon Apr 16 02:02:06 2007 +0000 H. Peter Anvin 
+  * Fixes for 64-bit ndisasm.
+Mon Apr 16 01:21:29 2007 +0000 H. Peter Anvin 
+  * Use + instead of * for extension; it feels cleaner with the new meaning.
+Mon Apr 16 01:18:30 2007 +0000 H. Peter Anvin 
+  * Initial 64-bit support for ndisasm.  Still a work in progress.
+Sun Apr 15 23:12:17 2007 +0000 H. Peter Anvin 
+  * Clean up the 64-bitification of regs.dat for 64-bit ndisasm support
+Sun Apr 15 23:10:26 2007 +0000 H. Peter Anvin 
+  * Remove @GCCFLAGS@
+Sun Apr 15 23:09:23 2007 +0000 H. Peter Anvin 
+  * CR8 is not special in any way as far as the assembler is concerned.
+Sun Apr 15 23:03:28 2007 +0000 H. Peter Anvin Sat Nov 24 16:31:48 2007 -0800 H. Peter Anvin 
+  * Typo fixes in documentation
+Tue Nov 20 23:37:46 2007 -0800 H. Peter Anvin 
+  * NASM 2.00rc3
+Tue Nov 20 21:45:16 2007 -0800 H. Peter Anvin 
+  * Unbreak CMPSW/CMPSD/CMPSQ
+Tue Nov 20 13:23:34 2007 -0800 H. Peter Anvin 
+  * Merge branch 'master' of git+ssh://repo.or.cz/srv/git/nasm
+Tue Nov 20 13:22:58 2007 -0800 H. Peter Anvin 
+  * ndisasm: handle the case of "no more sync points"
+Mon Nov 19 23:09:31 2007 -0800 H. Peter Anvin 
+  * NASM 2.00rc2
+Mon Nov 19 23:09:24 2007 -0800 H. Peter Anvin 
+  * tag-release: a simple script to tag the repository for release
+Mon Nov 19 13:14:59 2007 -0800 H. Peter Anvin 
+  * Slightly faster implementation of the deadman counter
+Mon Nov 19 12:26:50 2007 -0800 H. Peter Anvin 
+  * BR 812417: Deadman counter for macro expansion
+Mon Nov 19 12:02:38 2007 -0800 H. Peter Anvin 
+  * BR 877583: Fix RAA memory leak
+Mon Nov 19 11:53:18 2007 -0800 H. Peter Anvin 
+  * BR 863173: Fix offsets of TIMES/INCBIN in list file
+Mon Nov 19 11:45:40 2007 -0800 H. Peter Anvin 
+  * BR 1834731: Remove redundant error messages for no input file
+Mon Nov 19 11:44:05 2007 -0800 H. Peter Anvin 
+  * insns.pl: remove debugging output
+Sun Nov 18 22:18:09 2007 -0800 H. Peter Anvin 
+  * Clean up remaining build warnings
+Sun Nov 18 21:55:26 2007 -0800 H. Peter Anvin 
+  * BR 1834292: Fix multiple disassembler bugs
+Sun Nov 18 12:01:05 2007 -0800 H. Peter Anvin 
+  * BR 1834056: Remove warnings in rdoff/rdoff.c
+Sun Nov 18 11:55:10 2007 -0800 H. Peter Anvin 
+  * BR 1091926: Bounds checking for command line parsing
+Sat Nov 17 21:21:18 2007 -0800 H. Peter Anvin 
+  * Remove FIXME from documentation
+Sat Nov 17 21:08:33 2007 -0800 Charles Crayne 
+  * Check in Keith's Fixes
+Sat Nov 17 14:35:19 2007 -0800 H. Peter Anvin 
+  * Make the definition for float_const() match the prototype
+Fri Nov 16 00:03:02 2007 -0800 H. Peter Anvin 
+  * NASM 2.00rc1
+Thu Nov 15 17:12:29 2007 -0800 H. Peter Anvin 
+  * Clean up the command-line parsing; make -w/-W match others
+Thu Nov 15 14:38:19 2007 -0800 H. Peter Anvin 
+  * BR 993895: Support zero-operand floating-point insn
+Thu Nov 15 10:25:52 2007 -0800 H. Peter Anvin 
+  * Remove some vestiges of "native" RESW/RESD support
+Thu Nov 15 10:24:55 2007 -0800 H. Peter Anvin 
+  * outbin.c: fix one missed change from type -> size
+Tue Nov 13 19:52:54 2007 -0800 root 
+  * Support setting OSABI value in ELF header.
+Tue Nov 13 11:34:34 2007 -0800 H. Peter Anvin 
+  * Enable a few warnings by default; clean up warning descriptions
+Tue Nov 13 11:31:15 2007 -0800 H. Peter Anvin 
+  * Add gcc-style -W/-Wno- warning selections; -Wall; -Werror
+Tue Nov 13 10:37:23 2007 -0800 H. Peter Anvin 
+  * Clean up the fwrite*() function definitions somewhat
+Tue Nov 13 09:49:51 2007 -0800 H. Peter Anvin 
+  * Cast 64-bit switch expressions to (int) to keep OpenWatcom happy
+Tue Nov 13 09:46:38 2007 -0800 H. Peter Anvin 
+  * x86-host-specific performance improvement
+Tue Nov 13 09:37:59 2007 -0800 H. Peter Anvin 
+  * Address data is int64_t; simplify writing an address object
+Mon Nov 12 23:00:31 2007 -0800 H. Peter Anvin 
+  * ndisasm: factor out the common operand-extraction code
+Mon Nov 12 22:56:07 2007 -0800 H. Peter Anvin 
+  * Un-special-case "xchg rax,rax"; disassemble o64
+Mon Nov 12 22:11:46 2007 -0800 H. Peter Anvin 
+  * BR 1709392: Fix alignment handling in Mach-O formatSat Nov 24 16:31:48 2007 -0800 H. Peter Anvin 
+  * Typo fixes in documentation
+Tue Nov 20 23:37:46 2007 -0800 H. Peter Anvin 
+  * NASM 2.00rc3
+Tue Nov 20 21:45:16 2007 -0800 H. Peter Anvin 
+  * Unbreak CMPSW/CMPSD/CMPSQ
+Tue Nov 20 13:23:34 2007 -0800 H. Peter Anvin 
+  * Merge branch 'master' of git+ssh://repo.or.cz/srv/git/nasm
+Tue Nov 20 13:22:58 2007 -0800 H. Peter Anvin 
+  * ndisasm: handle the case of "no more sync points"
+Mon Nov 19 23:09:31 2007 -0800 H. Peter Anvin 
+  * NASM 2.00rc2
+Mon Nov 19 23:09:24 2007 -0800 H. Peter Anvin 
+  * tag-release: a simple script to tag the repository for release
+Mon Nov 19 13:14:59 2007 -0800 H. Peter Anvin 
+  * Slightly faster implementation of the deadman counter
+Mon Nov 19 12:26:50 2007 -0800 H. Peter Anvin 
+  * BR 812417: Deadman counter for macro expansion
+Mon Nov 19 12:02:38 2007 -0800 H. Peter Anvin 
+  * BR 877583: Fix RAA memory leak
+Mon Nov 19 11:53:18 2007 -0800 H. Peter Anvin 
+  * BR 863173: Fix offsets of TIMES/INCBIN in list file
+Mon Nov 19 11:45:40 2007 -0800 H. Peter Anvin 
+  * BR 1834731: Remove redundant error messages for no input file
+Mon Nov 19 11:44:05 2007 -0800 H. Peter Anvin 
+  * insns.pl: remove debugging output
+Sun Nov 18 22:18:09 2007 -0800 H. Peter Anvin 
+  * Clean up remaining build warnings
+Sun Nov 18 21:55:26 2007 -0800 H. Peter Anvin 
+  * BR 1834292: Fix multiple disassembler bugs
+Sun Nov 18 12:01:05 2007 -0800 H. Peter Anvin 
+  * BR 1834056: Remove warnings in rdoff/rdoff.c
+Sun Nov 18 11:55:10 2007 -0800 H. Peter Anvin 
+  * BR 1091926: Bounds checking for command line parsing
+Sat Nov 17 21:21:18 2007 -0800 H. Peter Anvin 
+  * Remove FIXME from documentation
+Sat Nov 17 21:08:33 2007 -0800 Charles Crayne 
+  * Check in Keith's Fixes
+Sat Nov 17 14:35:19 2007 -0800 H. Peter Anvin 
+  * Make the definition for float_const() match the prototype
+Fri Nov 16 00:03:02 2007 -0800 H. Peter Anvin 
+  * NASM 2.00rc1
+Thu Nov 15 17:12:29 2007 -0800 H. Peter Anvin 
+  * Clean up the command-line parsing; make -w/-W match others
+Thu Nov 15 14:38:19 2007 -0800 H. Peter Anvin 
+  * BR 993895: Support zero-operand floating-point insn
+Thu Nov 15 10:25:52 2007 -0800 H. Peter Anvin 
+  * Remove some vestiges of "native" RESW/RESD support
+Thu Nov 15 10:24:55 2007 -0800 H. Peter Anvin 
+  * outbin.c: fix one missed change from type -> size
+Tue Nov 13 19:52:54 2007 -0800 root 
+  * Support setting OSABI value in ELF header.
+Tue Nov 13 11:34:34 2007 -0800 H. Peter Anvin 
+  * Enable a few warnings by default; clean up warning descriptions
+Tue Nov 13 11:31:15 2007 -0800 H. Peter Anvin 
+  * Add gcc-style -W/-Wno- warning selections; -Wall; -Werror
+Tue Nov 13 10:37:23 2007 -0800 H. Peter Anvin 
+  * Clean up the fwrite*() function definitions somewhat
+Tue Nov 13 09:49:51 2007 -0800 H. Peter Anvin 
+  * Cast 64-bit switch expressions to (int) to keep OpenWatcom happy
+Tue Nov 13 09:46:38 2007 -0800 H. Peter Anvin 
+  * x86-host-specific performance improvement
+Tue Nov 13 09:37:59 2007 -0800 H. Peter Anvin 
+  * Address data is int64_t; simplify writing an address object
+Mon Nov 12 23:00:31 2007 -0800 H. Peter Anvin 
+  * ndisasm: factor out the common operand-extraction code
+Mon Nov 12 22:56:07 2007 -0800 H. Peter Anvin 
+  * Un-special-case "xchg rax,rax"; disassemble o64
+Mon Nov 12 22:11:46 2007 -0800 H. Peter Anvin 
+  * BR 1709392: Fix alignment handling in Mach-O format
+Mon Nov 12 22:05:31 2007 -0800 H. Peter Anvin 
+  * BR 1828866: fix handling of LAR/LSL
+Mon Nov 12 21:57:00 2007 -0800 H. Peter Anvin 
+  * Better (but not *good!*) handling of 64-bit addressing in ndisasm
+Mon Nov 12 21:02:33 2007 -0800 H. Peter Anvin 
+  * Fix disassembly of XCHG
+Mon Nov 12 20:18:33 2007 -0800 H. Peter Anvin 
+  * Test of XCHG
+Mon Nov 12 20:18:05 2007 -0800 H. Peter Anvin 
+  * Fix handling of XCHG in 64-bit mode
+Mon Nov 12 19:36:13 2007 -0800 H. Peter Anvin 
+  * More \321 -> \324 bug fixes
+Mon Nov 12 18:26:31 2007 -0800 H. Peter Anvin 
+  * float.c: all warnings and errors are pass 1 only
+Sat Nov 10 21:55:19 2007 -0800 Charles Crayne 
+  * Update documentation for stack relative directives.
+Sat Nov 10 17:52:23 2007 -0800 Charles Crayne 
+  * Clean up a few more 32-bit bottlenecks
+Fri Nov 9 16:37:41 2007 -0800 Charles Crayne 
+  * Update documantation for stack relative directives
+Fri Nov 9 16:33:54 2007 -0800 Charles Crayne 
+  * Merge branch 'master' of /home/chuck/development/gitnasm/
+Fri Nov 9 16:25:43 2007 -0800 Charles Crayne 
+  * Update documentation for stack relative directives
+Fri Nov 9 14:44:02 2007 -0800 H. Peter Anvin 
+  * Don't combine type and size into a single argument
+Thu Nov 8 22:11:14 2007 -0800 Charles Crayne 
+  * Add flat64 to %stacksize choices
+Thu Nov 8 20:43:22 2007 -0800 H. Peter Anvin 
+  * Fix building under OpenWatcom
+Thu Nov 8 20:29:37 2007 -0800 H. Peter Anvin 
+  * ps2pdf: remove -dOptimize=true
+Thu Nov 8 20:21:41 2007 -0800 H. Peter Anvin 
+  * No binary files left in the source distro; unbreak release script
+Thu Nov 8 20:01:11 2007 -0800 H. Peter Anvin 
+  * BR 1828103: Fix %arg and %local
+Thu Nov 8 19:34:01 2007 -0800 H. Peter Anvin 
+  * nasmlib.c: prefix_name(): use the elements() macro
+Thu Nov 8 19:30:22 2007 -0800 H. Peter Anvin 
+  * Move elements() to nasmlib.h
+Thu Nov 8 19:15:33 2007 -0800 H. Peter Anvin 
+  * constipate the "str" argument to bsi() and bsii()
+Wed Nov 7 19:03:46 2007 -0800 Charles Crayne 
+  * Upgrade RAA functions to hold 64-bit data.
+Tue Nov 6 21:48:12 2007 -0800 Charles Crayne 
+  * Pass 64-bit instruction lengths to back-ends.
+Tue Nov 6 18:27:23 2007 -0800 Charles Crayne 
+  * Prepare for 64-bit instruction lengths
+Mon Nov 5 21:49:49 2007 -0800 Charles Crayne 
+  * Disambiguate error messages
+Mon Nov 5 17:19:32 2007 -0800 Charles Crayne 
+  * Upgrade label functions to 64-bit
+Sun Nov 4 21:10:42 2007 -0800 H. Peter Anvin 
+  * Permit opcode names as labels as long as they are followed by a colon
+Sun Nov 4 15:28:30 2007 -0800 Charles Crayne 
+  * Make warning limit valid for both i386 and x86_64
+Sat Nov 3 22:06:13 2007 -0700 Charles Crayne 
+  * Warn on out of bounds EA displacements
+Thu Nov 1 15:08:27 2007 -0700 H. Peter Anvin 
+  * Treat info files as binary when creating xdoc distro file
+Thu Nov 1 15:07:42 2007 -0700 H. Peter Anvin 
+  * Remove obsolete binary files from the distribution
+Thu Nov 1 14:53:32 2007 -0700 H. Peter Anvin 
+  * Move declarations before statements
+Wed Oct 31 23:37:35 2007 -0700 H. Peter Anvin 
+  * NASM 0.99.06
+Wed Oct 31 23:37:19 2007 -0700 H. Peter Anvin 
+  * Script to tag the tree for release
+Wed Oct 31 10:59:26 2007 -0700 H. Peter Anvin 
+  * Even more "riprel" tests
+Tue Oct 30 01:17:57 2007 -0700 H. Peter Anvin 
+  * floatx.asm: add tests for "rounds up to smallest denorm"
+Tue Oct 30 01:13:27 2007 -0700 H. Peter Anvin 
+  * Run "make alldeps"
+Tue Oct 30 01:13:09 2007 -0700 H. Peter Anvin 
+  * float.c: handle round-up-to-denorm correctly.
+Tue Oct 30 00:59:27 2007 -0700 H. Peter Anvin 
+  * Exhaustive test for 8-bit floating point values
+Mon Oct 29 23:12:47 2007 -0700 H. Peter Anvin 
+  * Clean up the handing of operands in assemble.c
+Mon Oct 29 22:56:08 2007 -0700 H. Peter Anvin 
+  * Don't warn for segmented references
+Mon Oct 29 20:20:12 2007 -0700 H. Peter Anvin 
+  * Use a 32-bit floating-point limb size; support 8-bit float
+Mon Oct 29 18:24:59 2007 -0700 Charles Crayne 
+  * Reduce severity of redundant prefixes from error to warning.
+Sun Oct 28 23:23:24 2007 -0700 H. Peter Anvin 
+  * Test of some addressing modes in 64-bit mode.
+Sun Oct 28 23:21:46 2007 -0700 H. Peter Anvin 
+  * Fix bogus flagging of effective addresses as invalid
+Sun Oct 28 23:10:34 2007 -0700 H. Peter Anvin 
+  * Actually shut up the warning in rdfload.c
+Sun Oct 28 22:04:42 2007 -0700 H. Peter Anvin 
+  * Clean up stealth whitespace
+Sun Oct 28 22:04:00 2007 -0700 H. Peter Anvin 
+  * Fix warning about cast to pointer in rdfload.c
+Sun Oct 28 22:04:00 2007 -0700 H. Peter Anvin 
+  * 64-bit addressing and prefix handling changes
+Sun Oct 28 15:29:54 2007 -0700 Charles Crayne 
+  * Adjust stabs symbol index to match symbol table.
+Fri Oct 26 21:38:02 2007 -0700 H. Peter Anvin 
+  * readnum(): handle prefix-suffix collision like "0h"
+Fri Oct 26 18:49:29 2007 -0700 H. Peter Anvin 
+  * Better handling of platforms which hide "extended" functionality
+Wed Oct 24 15:51:40 2007 -0700 Charles Crayne 
+  * Merge branch 'master' of /home/chuck/development/gitnasm/
+Wed Oct 24 15:30:17 2007 -0700 Charles Crayne 
+  * Update sections about debug info formats
+Wed Oct 24 15:29:51 2007 -0700 H. Peter Anvin 
+  * Fix the handling of floating-point tokens in the preprocessor
+Tue Oct 23 19:28:39 2007 -0700 Charles Crayne 
+  * Fix bugs item #1817677
+Tue Oct 23 00:08:58 2007 -0700 H. Peter Anvin 
+  * Slightly simplify the radix-detection code
+Mon Oct 22 19:48:06 2007 -0700 H. Peter Anvin 
+  * Unbreak particularly tricky hex constants
+Mon Oct 22 19:37:36 2007 -0700 H. Peter Anvin 
+  * Decimal floating point can also start with 0. 0e 0E
+Mon Oct 22 17:34:10 2007 -0700 H. Peter Anvin 
+  * Support binary and octal floating-point
+Mon Oct 22 16:53:48 2007 -0700 H. Peter Anvin 
+  * More consistent handling of radix letters
+Sun Oct 21 15:33:01 2007 -0700 H. Peter Anvin 
+  * float.c: correct exponent capping
+Sun Oct 21 14:21:43 2007 -0700 Charles Crayne 
+  * Clean up elf symbol table section
+Fri Oct 19 18:33:57 2007 -0700 H. Peter Anvin 
+  * Allow $-prefixed hexadecimal FP as an alternative to 0x
+Fri Oct 19 14:43:22 2007 -0700 H. Peter Anvin 
+  * Scripts to remove stealth whitespace
+Fri Oct 19 14:42:29 2007 -0700 H. Peter Anvin 
+  * Formatting: kill off "stealth whitespace"
+Fri Oct 19 14:26:52 2007 -0700 H. Peter Anvin 
+  * test/floatx.asm: fix test case
+Fri Oct 19 14:19:52 2007 -0700 H. Peter Anvin 
+  * uscore.asm: Fix test case
+Fri Oct 19 14:17:51 2007 -0700 H. Peter Anvin 
+  * float.c: mark read_exponent() static
+Fri Oct 19 14:10:35 2007 -0700 H. Peter Anvin 
+  * Don't confuse suffixed hexadecimal with floating-point
+Fri Oct 19 13:17:24 2007 -0700 H. Peter Anvin 
+  * Anchor filename locations in .gitignore
+Fri Oct 19 13:16:51 2007 -0700 H. Peter Anvin 
+  * test/Makefile: Use -Ox instead of -O999
+Fri Oct 19 13:14:06 2007 -0700 H. Peter Anvin 
+  * Test of underscored constants
+Fri Oct 19 13:10:46 2007 -0700 H. Peter Anvin 
+  * Allow underscores in numbers; better detection of FP
+Fri Oct 19 10:52:31 2007 -0700 H. Peter Anvin 
+  * Modernize nasm.spec.in and make it closer to the Fedora version
+Thu Oct 18 23:33:06 2007 -0700 Charles Crayne 
+  * Suppress datarootdir warnings from configure
+Thu Oct 18 21:17:20 2007 -0700 Charles Crayne 
+  * Suppress signedness warnings in disassembler
+Thu Oct 18 19:14:08 2007 -0700 H. Peter Anvin 
+  * Cleaner solution for MinGW handling of __STRICT_ANSI__
+Thu Oct 18 19:14:08 2007 -0700 H. Peter Anvin 
+  * configure: Undefine __STRICT_ANSI__ for mingw's benefit
+Thu Oct 18 19:14:07 2007 -0700 H. Peter Anvin 
+  * Fix invocation of readnum()
+Thu Oct 18 19:02:42 2007 -0700 Charles Crayne 
+  * Suppress a few signedness warnings
+Thu Oct 18 17:04:10 2007 -0700 root 
+  * Avoid unnecessary warning on redefinition of section (bug 801180)
+Wed Oct 17 17:55:45 2007 -0700 Charles Crayne 
+  * Generate stabs entries for any executable section
+Tue Oct 16 22:59:09 2007 -0700 H. Peter Anvin 
+  * NASM 0.99.05
+Tue Oct 16 15:46:04 2007 -0700 H. Peter Anvin 
+  * Tests of obscenely large exponents
+Tue Oct 16 14:42:32 2007 -0700 H. Peter Anvin 
+  * Comma-separate contents of __FLOAT__
+Tue Oct 16 14:40:27 2007 -0700 H. Peter Anvin 
+  * Implement floating-point option control directive
+Tue Oct 16 11:48:07 2007 -0700 H. Peter Anvin 
+  * Floating-point warning fixes; fix round-to-overflow
+Tue Oct 16 11:32:58 2007 -0700 H. Peter Anvin 
+  * Handle rounding of denorms correctly; make fp overflow a warning
+Tue Oct 16 10:35:02 2007 -0700 H. Peter Anvin 
+  * Additional entries for .gitignore
+Tue Oct 16 10:32:57 2007 -0700 H. Peter Anvin 
+  * Refactor floating-point formatting code; fix 80-bit denorms
+Tue Oct 16 10:31:16 2007 -0700 H. Peter Anvin 
+  * Add 1.5 as a test case: representative of an exact fraction
+Mon Oct 15 20:06:06 2007 -0700 H. Peter Anvin 
+  * Recognize 'd', 't' and 'y' as radix suffixes
+Mon Oct 15 19:53:10 2007 -0700 H. Peter Anvin 
+  * Fix FISTTP opcodes (BR 689695)
+Mon Oct 15 19:46:32 2007 -0700 H. Peter Anvin 
+  * New floating-point conversion routines
+Mon Oct 15 17:48:43 2007 -0700 H. Peter Anvin 
+  * Add testnos3 from the gdtoa package (floating-point test)
+Sat Oct 13 23:19:21 2007 -0700 H. Peter Anvin 
+  * .gitignore file doesn't need to be in the release file
+Sat Oct 13 23:17:41 2007 -0700 H. Peter Anvin 
+  * Add .gitignore file so "git status" produces something sane
+Sat Oct 13 23:12:46 2007 -0700 H. Peter Anvin 
+  * autoconf: drop AC_USE_SYSTEM_EXTENSIONS to support autoconf 2.59
+Sat Oct 13 07:09:22 2007 -0700 Keith Kanios 
+  * Fix 32-bit types in preproc.c and eval.c
+Thu Oct 11 20:32:33 2007 -0700 Charles Crayne 
+  * Must define types before using them
+Thu Oct 11 13:42:09 2007 -0700 H. Peter Anvin 
+  * preproc.c: move smacro define/undef to separate functions
+Thu Oct 11 13:38:38 2007 -0700 H. Peter Anvin 
+  * preproc.c: PP_DEFINE and PP_XDEFINE are case-sensitive
+Thu Oct 11 12:52:03 2007 -0700 H. Peter Anvin 
+  * preproc.c: normalize the handling of case sensitivity
+Thu Oct 11 12:51:06 2007 -0700 H. Peter Anvin 
+  * Define macros necessary for <inttypes.h> on C++
+Thu Oct 11 10:12:58 2007 -0700 H. Peter Anvin 
+  * More "bool" fixes
+Thu Oct 11 10:11:57 2007 -0700 H. Peter Anvin 
+  * preproc.c: allow 64-bit repeat counts
+Thu Oct 11 10:06:19 2007 -0700 H. Peter Anvin 
+  * preproc.c: For an SMacro, in_progress really is a boolean (no %rep)
+Thu Oct 11 00:05:57 2007 -0700 H. Peter Anvin 
+  * Additional uses of bool and enum
+Thu Oct 11 00:05:57 2007 -0700 H. Peter Anvin 
+  * preproc.c: MMacro.in_progress is not a boolean
+Wed Oct 10 18:07:51 2007 -0700 H. Peter Anvin 
+  * saa_fread/fwrite: when seeking, must set [rw]ptr as well
+Wed Oct 10 14:58:45 2007 -0700 H. Peter Anvin 
+  * Use the compiler-provided booleans if available, otherwise emulate
+Wed Oct 10 14:55:14 2007 -0700 H. Peter Anvin 
+  * owlinux.mak: don't clean things we won't be able to
+Wed Oct 10 14:29:53 2007 -0700 H. Peter Anvin 
+  * configure.in: looks like we need autoconf 2.61 :(
+Wed Oct 10 14:06:59 2007 -0700 H. Peter Anvin 
+  * Create option -Ox to tell NASM to do unlimited passes
+Mon Oct 8 19:26:57 2007 -0700 H. Peter Anvin 
+  * Revert "floatb.asm: fix broken testcase"
+Mon Oct 8 18:39:24 2007 -0700 H. Peter Anvin 
+  * floatb.asm: fix broken testcase
+Mon Oct 8 12:41:00 2007 -0700 H. Peter Anvin 
+  * saa_rstruct: fix overrun check
+Mon Oct 8 12:12:23 2007 -0700 H. Peter Anvin 
+  * Add Frank's floattest.asm test file
+Sun Oct 7 21:13:14 2007 -0700 H. Peter Anvin 
+  * saa_fpwrite: initializing "len" should be part of the loop
+Sun Oct 7 18:46:57 2007 -0700 Charles Crayne 
+  * Fix infinite loop in function saa_fpwrite
+Fri Oct 5 17:44:16 2007 -0700 H. Peter Anvin 
+  * zerobyte.asm: use a real instruction to avoid confusing ndisasm
+Fri Oct 5 17:42:31 2007 -0700 H. Peter Anvin 
+  * zerobyte.asm: add test cases for non-initial \170 uses
+Fri Oct 5 17:29:01 2007 -0700 H. Peter Anvin 
+  * Check in the proper zerobyte test
+Fri Oct 5 17:04:32 2007 -0700 H. Peter Anvin 
+  * Emit REX prefix before literal zero (\170)
+Fri Oct 5 17:01:15 2007 -0700 H. Peter Anvin 
+  * LICENSE: Break long line
+Fri Oct 5 14:36:03 2007 -0700 H. Peter Anvin 
+  * Add test for problematic floats
+Thu Oct 4 23:51:08 2007 -0700 H. Peter Anvin 
+  * floatx.asm: add Inf and NaN to the boundary condition tests
+Thu Oct 4 23:09:19 2007 -0700 H. Peter Anvin 
+  * floatx.asm: add specific tests for exponent boundary conditions
+Thu Oct 4 22:51:08 2007 -0700 H. Peter Anvin 
+  * float.c: correct the exponent
+Thu Oct 4 15:18:23 2007 -0700 H. Peter Anvin 
+  * Additional rules in test/Makefile
+Thu Oct 4 13:42:56 2007 -0700 H. Peter Anvin 
+  * Rewrite the handling of SAA's to allow random access
+Wed Oct 3 21:30:57 2007 -0700 H. Peter Anvin 
+  * Change cloc_t to struct location, and reorder the members
+Wed Oct 3 21:24:51 2007 -0700 H. Peter Anvin 
+  * BR 1352920: change loc_t -> cloc_t
+Wed Oct 3 21:22:16 2007 -0700 H. Peter Anvin 
+  * BR 1352920: Handle upper case %line
+Wed Oct 3 17:40:12 2007 -0700 H. Peter Anvin 
+  * Use autoconf to request feature macros
+Tue Oct 2 22:04:15 2007 -0700 H. Peter Anvin 
+  * preproc.c: constipation
+Tue Oct 2 21:57:27 2007 -0700 H. Peter Anvin 
+  * make alldeps
+Tue Oct 2 21:53:51 2007 -0700 H. Peter Anvin 
+  * Portability fixes
+Tue Oct 2 21:13:18 2007 -0700 H. Peter Anvin 
+  * Run "make alldeps".
+Tue Oct 2 17:40:00 2007 -0700 H. Peter Anvin 
+  * Use the crc64 we already use as the perfect hash function prehash
+Tue Oct 2 15:09:33 2007 -0700 H. Peter Anvin 
+  * insns.dat: add systematic names for the hinting NOPs (0F18-0F1F)
+Mon Oct 1 11:28:32 2007 -0700 H. Peter Anvin 
+  * Unspecified files are null strings, not null pointers
+Mon Oct 1 11:26:31 2007 -0700 H. Peter Anvin 
+  * Check for the most basic filename overlaps
+Sun Sep 30 22:15:36 2007 -0700 Charles Crayne 
+  * modified:   nasm.1 to add newer command line options
+Fri Sep 28 21:27:41 2007 -0700 Charles Crayne 
+  * Merge branch 'master' of git+ssh://ccrayne@repo.or.cz/srv/git/nasm
+Fri Sep 28 20:17:12 2007 -0700 H. Peter Anvin 
+  * configure.in: AC_SUBST_FILE should have been AC_SUBST
+Fri Sep 28 17:17:20 2007 -0700 H. Peter Anvin 
+  * Unbreak relative references to immediate addresses
+Fri Sep 28 15:16:47 2007 -0700 Charles Crayne 
+  * Merge branch 'master' of git+ssh://ccrayne@repo.or.cz/srv/git/nasm
+Fri Sep 28 12:01:55 2007 -0700 H. Peter Anvin 
+  * lib/vsnprintf.c: correct boundary conditions
+Fri Sep 28 10:50:20 2007 -0700 H. Peter Anvin 
+  * Add substitutes for snprintf() and vsnprintf()
+Fri Sep 28 02:03:41 2007 -0400 Frank Kotler 
+  * Merge branch 'master' of git+ssh://fbkotler@repo.or.cz/srv/git/nasm
+Thu Sep 27 21:35:04 2007 -0700 H. Peter Anvin 
+  * Exclude config.h from the dependency list for the canned makefiles
+Thu Sep 27 21:12:17 2007 -0700 H. Peter Anvin 
+  * version.pl: Add support for daily snapshot releases
+Thu Sep 27 19:46:55 2007 -0700 H. Peter Anvin 
+  * Add Makefile for Linux -> DOS, Win32, OS/2 using OpenWatcom
+Wed Sep 26 19:57:07 2007 -0700 H. Peter Anvin 
+  * Add Makefile for OpenWatcom (DOS, OS/2 or Win32 output)
+Wed Sep 26 17:00:18 2007 -0700 H. Peter Anvin 
+  * Test for various addressing modes in 64-bit mode
+Wed Sep 26 15:19:28 2007 -0700 H. Peter Anvin 
+  * nasm option reshuffling, -E -> -Z
+Tue Sep 25 23:57:21 2007 -0400 Frank Kotler 
+  * Version 0.99.04
+Tue Sep 25 20:36:45 2007 -0700 H. Peter Anvin 
+  * nasmdoc: corrections on 64-bit immediates/displacements
+Tue Sep 25 16:02:21 2007 -0700 H. Peter Anvin 
+  * nasmdoc: shorten lines which are too long
+Tue Sep 25 16:01:07 2007 -0700 H. Peter Anvin 
+  * Document NASM behaviour for 64-bit immediates and displacements
+Tue Sep 25 15:44:40 2007 -0700 H. Peter Anvin 
+  * test/movimm.asm: add optimizable forms
+Tue Sep 25 15:41:19 2007 -0700 H. Peter Anvin 
+  * assemble.c: clean up whitespace
+Tue Sep 25 15:40:36 2007 -0700 H. Peter Anvin 
+  * Correct the handling of "MOV" with immediate in 64-bit mode
+Tue Sep 25 15:39:42 2007 -0700 H. Peter Anvin 
+  * Test of immediate handling on 64-bit mode
+Tue Sep 25 14:27:34 2007 -0700 H. Peter Anvin 
+  * Add nasm_zalloc() to nasmlib.c
+Tue Sep 25 14:26:03 2007 -0700 H. Peter Anvin 
+  * Fix BR 1490407: size of the second operand of LAR/LSL
+Tue Sep 25 14:11:29 2007 -0700 H. Peter Anvin 
+  * Fix BR 1490407: size of the second operand of LAR/LSL
+Tue Sep 25 13:34:55 2007 -0700 H. Peter Anvin 
+  * Makefile.in: make "make install" create directories
+Tue Sep 25 08:48:37 2007 -0700 H. Peter Anvin 
+  * Fix BR 1445441: uninitialized use of "error_file"
+Mon Sep 24 21:33:17 2007 -0700 H. Peter Anvin 
+  * preproc.c: fix the loop in %undef
+Mon Sep 24 20:53:48 2007 -0700 H. Peter Anvin 
+  * float.c: clear off uninitialized warning
+Mon Sep 24 17:02:41 2007 -0700 H. Peter Anvin 
+  * outcoff: set the "virtual size field" to zero (BR 1351586)
+Mon Sep 24 15:56:02 2007 -0700 H. Peter Anvin 
+  * insns.dat: SMINT - mark ND, DMINT - fix opcode
+Mon Sep 24 15:55:20 2007 -0700 H. Peter Anvin 
+  * 0F0F is a 3Dnow! prefix; remove from prefix list
+Mon Sep 24 15:48:09 2007 -0700 H. Peter Anvin 
+  * Additional compaction missed by script
+Mon Sep 24 15:42:53 2007 -0700 H. Peter Anvin 
+  * insns.dat: machine-generated compaction mmx/xmmreg,mem -> mmx/xmmrm
+Mon Sep 24 13:54:00 2007 -0700 H. Peter Anvin 
+  * nasmdoc: grammar fix
+Mon Sep 24 13:44:02 2007 -0700 H. Peter Anvin 
+  * nasmdoc: remove stray periods
+Mon Sep 24 13:42:09 2007 -0700 H. Peter Anvin 
+  * test/Makefile: make a bit more useful
+Mon Sep 24 13:41:58 2007 -0700 H. Peter Anvin 
+  * Implement the -MG option (SF RFE 1564264)
+Mon Sep 24 12:52:09 2007 -0700 H. Peter Anvin 
+  * nasmdoc: clarify __float*__ example
+Mon Sep 24 12:44:38 2007 -0700 H. Peter Anvin 
+  * nasmdoc: document the __float*__ operators
+Mon Sep 24 12:30:54 2007 -0700 H. Peter Anvin 
+  * Support __float*__ for floating-point numbers in expressions
+Mon Sep 24 10:51:07 2007 -0700 H. Peter Anvin 
+  * eval.c: replace sequence of ifs with switch
+Mon Sep 24 10:50:23 2007 -0700 H. Peter Anvin 
+  * tokhash: allow a bit smarter pattern matching
+Sat Sep 22 22:35:28 2007 -0700 H. Peter Anvin 
+  * Implement INVLPGA according to the documentation
+Sat Sep 22 22:02:34 2007 -0700 H. Peter Anvin 
+  * Reformat insns.dat to uniform column width
+Sat Sep 22 21:50:03 2007 -0700 H. Peter Anvin 
+  * Simple test for 0x67 prefixes
+Sat Sep 22 21:49:51 2007 -0700 H. Peter Anvin 
+  * Auto-generate 0x67 prefixes without the need for \30x codes
+Sat Sep 22 21:47:13 2007 -0700 H. Peter Anvin 
+  * Make test/Makefile a bit more useful
+Sat Sep 22 21:29:41 2007 -0700 H. Peter Anvin 
+  * Add TY_OWORD for "DO" output
+Sat Sep 22 19:52:11 2007 -0700 H. Peter Anvin 
+  * LDDQU needs \301 (BR 1103549)
+Sat Sep 22 19:51:13 2007 -0700 H. Peter Anvin 
+  * RDTSCP and INVLPGA aren't 64-bit specific
+Sat Sep 22 19:40:37 2007 -0700 H. Peter Anvin 
+  * Cyrix GX1 instructions: BBx_RESET, CPU_READ, CPU_WRITE
+Sat Sep 22 19:28:14 2007 -0700 H. Peter Anvin 
+  * Centaur XSHA1, XSHA256, MONTMUL
+Sat Sep 22 19:20:56 2007 -0700 H. Peter Anvin 
+  * Implement Centaur's XCRYPT instructions
+Sat Sep 22 19:13:05 2007 -0700 H. Peter Anvin 
+  * Add Geode LX (AMD's Cyrix-derived core) instructions
+Sat Sep 22 19:05:11 2007 -0700 H. Peter Anvin 
+  * Add the GETSEC instruction for Intel SMX
+Sat Sep 22 18:59:18 2007 -0700 H. Peter Anvin 
+  * Add the AMD SSE4a and LZCNT instructions
+Sat Sep 22 18:23:20 2007 -0700 H. Peter Anvin 
+  * Tag UMOV as ND (no disassembly) to avoid collision
+Sat Sep 22 18:20:49 2007 -0700 H. Peter Anvin 
+  * Disallow optimizing by less than 5 passes.
+Sat Sep 22 17:45:45 2007 -0700 H. Peter Anvin 
+  * BR 1783117: Document that %+ needs a space after it, and fix crash
+Sat Sep 22 16:44:56 2007 -0700 H. Peter Anvin 
+  * nasm.spec.in: minor fixes
+Sat Sep 22 16:38:25 2007 -0700 H. Peter Anvin 
+  * release script: handle stricter CLI parsing for "git tag"
+Sat Sep 22 16:35:11 2007 -0700 H. Peter Anvin 
+  * Update nasm.spec.in and make it handle rc releases
+Sat Sep 22 16:19:19 2007 -0700 H. Peter Anvin 
+  * version.pl: support version numbers of the form X.Y[.Z]rcW
+Thu Sep 20 21:33:43 2007 -0700 Charles Crayne 
+  * Merge branch 'master' of git+ssh://ccrayne@repo.or.cz/srv/git/nasm
+Thu Sep 20 21:12:33 2007 -0700 Charles Crayne 
+  *    modified:   misc/release to fix bug in removing .git
+Wed Sep 19 21:41:43 2007 -0700 H. Peter Anvin 
+  * Merge branch 'master' of git+ssh://repo.or.cz/srv/git/nasm
+Wed Sep 19 21:41:27 2007 -0700 H. Peter Anvin 
+  * Update manual pages
+Wed Sep 19 21:41:02 2007 -0700 H. Peter Anvin 
+  * Remove limit on number of sync points
+Wed Sep 19 21:40:37 2007 -0700 H. Peter Anvin 
+  * Make nasm_malloc() et al available from inside ndisasm
+Wed Sep 19 21:07:32 2007 -0400 Frank Kotler 
+  * Version 0.99.03
+Wed Sep 19 21:06:59 2007 -0400 Frank Kotler 
+  * Merge branch 'master' of git+ssh://fbkotler@repo.or.cz/srv/git/nasm
+Wed Sep 19 16:22:03 2007 -0700 H. Peter Anvin 
+  * Merge commit 'origin/sse5'
+Wed Sep 19 16:15:22 2007 -0700 H. Peter Anvin 
+  * test/Makefile: make a bit more useful
+Tue Sep 18 22:54:40 2007 -0700 H. Peter Anvin 
+  * Slightly optimize the interface to nasm_token_hash()
+Wed Sep 19 01:34:55 2007 -0400 Frank Kotler 
+  * Merge branch 'master' of git+ssh://fbkotler@repo.or.cz/srv/git/nasm
+Tue Sep 18 22:23:42 2007 -0700 H. Peter Anvin 
+  * Merge commit 'origin/master' into sse5
+Tue Sep 18 22:22:49 2007 -0700 H. Peter Anvin 
+  * elf64: fix 32-bit truncations
+Tue Sep 18 22:08:04 2007 -0700 H. Peter Anvin 
+  * Document Infinity and NaN
+Tue Sep 18 21:55:56 2007 -0700 H. Peter Anvin 
+  * Support generating NaNs and infinities
+Tue Sep 18 19:12:26 2007 -0700 H. Peter Anvin 
+  * Update documentation
+Tue Sep 18 18:37:36 2007 -0700 H. Peter Anvin 
+  * Simple test for hexadecimal floating-point numbers
+Tue Sep 18 18:33:17 2007 -0700 H. Peter Anvin 
+  * Fix error-reporting in hexadecimal floating-point numbers
+Tue Sep 18 18:31:26 2007 -0700 H. Peter Anvin 
+  * Support C99-style hexadecimal floating point.
+Tue Sep 18 17:50:34 2007 -0700 H. Peter Anvin 
+  * Unify all standard IEEE floating-point formats; add 128-bit
+Tue Sep 18 17:49:09 2007 -0700 H. Peter Anvin 
+  * Fix handling of DO; support unary + for floating-point numbers
+Tue Sep 18 16:39:03 2007 -0700 H. Peter Anvin 
+  * Support 16-bit IEEE floating point; used in SSE5
+Tue Sep 18 15:43:40 2007 -0700 H. Peter Anvin 
+  * Merge commit 'origin/master' into sse5
+Tue Sep 18 15:43:08 2007 -0700 H. Peter Anvin 
+  * Add NOP with argument to the instruction list
+Tue Sep 18 15:24:38 2007 -0700 H. Peter Anvin 
+  * Remove 0FC2 from list of instruction prefixes
+Tue Sep 18 15:08:20 2007 -0700 H. Peter Anvin 
+  * Speed up the disassembler by allowing prefixed instruction tables
+Tue Sep 18 13:45:12 2007 -0700 H. Peter Anvin 
+  * Document oword, do and reso
+Tue Sep 18 13:01:32 2007 -0700 H. Peter Anvin 
+  * Implement "oword" (128 bits) as a first-class size
+Tue Sep 18 12:38:07 2007 -0700 H. Peter Anvin 
+  * Change the token prehash function for better convergence
+Tue Sep 18 12:23:21 2007 -0700 H. Peter Anvin 
+  * SSE5 instruction table
+Tue Sep 18 02:06:09 2007 -0400 Frank Kotler 
+  * add "const" to output/outdbg.c
+Mon Sep 17 18:45:44 2007 -0700 H. Peter Anvin 
+  * Disassembler support for SSE5 instructions
+Mon Sep 17 17:27:46 2007 -0700 H. Peter Anvin 
+  * insns.dat: All SSE5 instructions are AMD
+Mon Sep 17 17:25:27 2007 -0700 H. Peter Anvin 
+  * Actually generate SSE5 instructions
+Mon Sep 17 16:55:04 2007 -0700 H. Peter Anvin 
+  * Initial support for generating DREX suffixes
+Mon Sep 17 16:31:33 2007 -0700 H. Peter Anvin 
+  * Fix a few instances of missing renumbers
+Mon Sep 17 16:20:45 2007 -0700 H. Peter Anvin 
+  * Enable IF_AR3
+Mon Sep 17 15:49:53 2007 -0700 H. Peter Anvin 
+  * Merge commit 'origin/master' into sse5
+Mon Sep 17 15:49:30 2007 -0700 H. Peter Anvin 
+  * Initial support for four arguments per instruction
+Mon Sep 17 15:48:32 2007 -0700 H. Peter Anvin 
+  * CLFLUSH: Neither an x64 instruction nor AMD
+Mon Sep 17 13:56:26 2007 -0700 H. Peter Anvin 
+  * Sort dependency lists
+Mon Sep 17 13:53:14 2007 -0700 H. Peter Anvin 
+  * Cleaner way to handle MSVC's _snprintf() underscore damage
+Mon Sep 17 13:19:25 2007 -0700 H. Peter Anvin 
+  * test/r13.asm: test special-casing of rbp and r13 in 64-bit mode
+Mon Sep 17 13:03:33 2007 -0700 H. Peter Anvin 
+  * Additional documentation for 64-bit programming
+Sun Sep 16 22:27:07 2007 -0700 H. Peter Anvin 
+  * INSTALL: MSVC++ compilation instructions
+Sun Sep 16 22:17:29 2007 -0700 H. Peter Anvin 
+  * make alldeps: change Mkfiles/Makefile.* to Mkfiles/*.mak
+Sun Sep 16 22:16:24 2007 -0700 H. Peter Anvin 
+  * Fix Makefile for MSVC++ 2005, delete obsolete Makefiles
+Sun Sep 16 22:15:34 2007 -0700 H. Peter Anvin 
+  * Minor fixes needed to compile with MSVC++ 2005
+Sun Sep 16 18:35:02 2007 -0700 H. Peter Anvin 
+  * Run "make alldeps"
+Sun Sep 16 18:04:57 2007 -0700 H. Peter Anvin 
+  * Switch the preprocessor over to using the hash table library
+Sun Sep 16 17:53:17 2007 -0700 H. Peter Anvin 
+  * Fix the handling of local labels
+Fri Sep 14 18:36:01 2007 -0700 H. Peter Anvin 
+  * preproc.c: remove unnecessary int64_t
+Fri Sep 14 18:03:29 2007 -0700 H. Peter Anvin 
+  * Use the new hash table function library to store labels
+Fri Sep 14 09:24:38 2007 -0700 H. Peter Anvin 
+  * Define a proper hash table library
+Thu Sep 13 18:13:20 2007 -0700 H. Peter Anvin 
+  * Simple performance benchmarks: label, macro and token lookups
+Thu Sep 13 12:25:32 2007 -0700 H. Peter Anvin 
+  * release script: fix final cleanup
+Thu Sep 13 12:22:00 2007 -0700 H. Peter Anvin 
+  * Modify release script for a git-centric world
+Thu Sep 13 11:06:42 2007 -0700 H. Peter Anvin 
+  * pptok.c: don't insist on C99 compiler behaviour
+Wed Sep 12 22:02:06 2007 -0700 H. Peter Anvin 
+  * Fix literal F2 and F3 prefixes
+Wed Sep 12 21:58:51 2007 -0700 H. Peter Anvin 
+  * Add (untested!) SSSE3, SSE4.1, SSE4.2 instructions
+Wed Sep 12 21:06:36 2007 -0700 H. Peter Anvin 
+  * Add support for Tejas New Instructions (SSSE3)
+Wed Sep 12 21:05:06 2007 -0700 H. Peter Anvin 
+  * Remove $Id$ tags (useless with git)
+Wed Sep 12 21:04:58 2007 -0700 H. Peter Anvin 
+  * Use rm32 operands for VMREAD/VMWRITE
+Wed Sep 12 21:04:51 2007 -0700 H. Peter Anvin 
+  * Macros for SSSE3/SSE4 instruction sets
+Wed Sep 12 21:04:39 2007 -0700 H. Peter Anvin 
+  * Support r/m operands for non-integer types
+Wed Sep 12 20:27:41 2007 -0700 H. Peter Anvin 
+  * Use enumerations where practical to ease debugging
+Wed Sep 12 17:02:55 2007 +0000 H. Peter Anvin 
+  * pptok.c: quick-and-dirty downcasing during prehashing
+Wed Sep 12 16:55:57 2007 +0000 H. Peter Anvin 
+  * phash: Tell the user when the graph is OK
+Wed Sep 12 05:18:20 2007 +0000 H. Peter Anvin 
+  * pptok.c: handle holes in the pp_directives array
+Wed Sep 12 04:20:08 2007 +0000 H. Peter Anvin 
+  * preproc.c: adjust whitespace
+Wed Sep 12 04:18:37 2007 +0000 H. Peter Anvin 
+  * More automation in the preprocessor conditionals handling
+Wed Sep 12 02:13:39 2007 +0000 H. Peter Anvin 
+  * pptok.c: fix spacing
+Wed Sep 12 02:12:07 2007 +0000 H. Peter Anvin 
+  * Generate automatically correct tests for %if and %elif
+Wed Sep 12 01:34:19 2007 +0000 H. Peter Anvin 
+  * Run "make alldeps"; add dependencies missing from the previous checkin
+Wed Sep 12 01:29:43 2007 +0000 H. Peter Anvin 
+  * Use a perfect hash to look up preprocessor directives
+Wed Sep 12 01:27:53 2007 +0000 H. Peter Anvin 
+  * phash: Be a bit more aggressive about trying to make a small hash
+Wed Sep 12 00:22:29 2007 +0000 H. Peter Anvin 
+  * Add RCXZ as a known preprocessor condition
+Tue Sep 11 23:57:23 2007 +0000 H. Peter Anvin 
+  * doc: add some cross-references
+Tue Sep 11 23:52:01 2007 +0000 H. Peter Anvin 
+  * Feeble attempt at updating the documentation; remove Appendix B
+Tue Sep 11 22:44:03 2007 +0000 H. Peter Anvin 
+  * Handle instructions which can have both REX.W and OSP
+Tue Sep 11 22:14:18 2007 +0000 H. Peter Anvin 
+  * Use enums to make debugging easier
+Tue Sep 11 22:13:17 2007 +0000 H. Peter Anvin 
+  * ndisasm: handle \366 codes, prefer unprefixed instructions
+Tue Sep 11 22:00:34 2007 +0000 H. Peter Anvin 
+  * Simplify tokens.dat slightly
+Tue Sep 11 04:26:44 2007 +0000 H. Peter Anvin 
+  * Quiet gcc warning about uninitialized variables
+Tue Sep 11 04:16:57 2007 +0000 H. Peter Anvin 
+  * Make the big instruction arrays "const"
+Mon Sep 10 23:32:05 2007 +0000 H. Peter Anvin 
+  * Use an actual enum for the opcode
+Mon Sep 10 23:30:21 2007 +0000 H. Peter Anvin 
+  * Fix order of token arguments
+Mon Sep 10 18:59:26 2007 +0000 H. Peter Anvin 
+  * assemble.c: correct special handing of ESP/RSP
+Mon Sep 10 18:59:01 2007 +0000 H. Peter Anvin 
+  * tokhash: correct duplicate-token test
+Mon Sep 10 18:58:40 2007 +0000 H. Peter Anvin 
+  * tokhash: adjust table types to reduce size
+Mon Sep 10 18:55:52 2007 +0000 H. Peter Anvin 
+  * Fix the MMXREG and XMMREG flags definitions.
+Wed Sep 5 06:48:38 2007 +0000 H. Peter Anvin 
+  * nasm.spec.in: Copyright -> License
+Wed Sep 5 06:40:51 2007 +0000 H. Peter Anvin 
+  * Fix "make tar"; useful for RPM testing
+Wed Sep 5 06:24:43 2007 +0000 H. Peter Anvin 
+  * Remove obsolete Serial: construct; we shouldn't need it anyway.
+Tue Sep 4 01:29:43 2007 +0000 Chuck Crayne 
+  * Provide 64-bit support for ORG directive
+Sun Sep 2 16:37:03 2007 +0000 H. Peter Anvin 
+  * Fix some MMX/SSE irregularities which interact with the 64-bit support
+Sun Sep 2 14:46:00 2007 +0000 H. Peter Anvin 
+  * phash.ph: yet another attempt at getting Perl to behave, arithmetically
+Sun Sep 2 06:23:29 2007 +0000 H. Peter Anvin 
+  * Simple 64-bit org test
+Sun Sep 2 06:20:15 2007 +0000 H. Peter Anvin 
+  * phash.ph: remove some stale code
+Sun Sep 2 01:00:34 2007 +0000 Chuck Crayne 
+  * Force use of integer values for generating hash keys.
+Fri Aug 31 18:10:23 2007 +0000 H. Peter Anvin 
+  * phash: don't rely on the build platform Perl version of rand()
+Fri Aug 31 07:31:51 2007 +0000 H. Peter Anvin 
+  * tokhash.pl: formatting changes for readability
+Fri Aug 31 07:23:31 2007 +0000 H. Peter Anvin 
+  * tokhash: Speed up the rejection of unhashed values
+Fri Aug 31 06:06:17 2007 +0000 H. Peter Anvin 
+  * tokhash.pl: "ix" should have the same width as the "hash" arrays
+Fri Aug 31 00:28:35 2007 +0000 H. Peter Anvin 
+  * Add "do not edit" comment to tokhash.c
+Fri Aug 31 00:23:40 2007 +0000 H. Peter Anvin 
+  * Make the token hash a bit smaller by using 16-bit hash tables
+Fri Aug 31 00:16:10 2007 +0000 H. Peter Anvin 
+  * Minor cleanup; remove duplication of names.c
+Thu Aug 30 23:42:39 2007 +0000 H. Peter Anvin 
+  * phash.ph: use a bipartite graph to reduce the storage requirements
+Thu Aug 30 22:35:34 2007 +0000 H. Peter Anvin 
+  * Finishing touches on perfect hash tokenizer; actually turn the thing on
+Thu Aug 30 21:50:20 2007 +0000 H. Peter Anvin 
+  * Makefile rule for tokhash.c
+Thu Aug 30 21:47:46 2007 +0000 H. Peter Anvin 
+  * tokens.dat: Data file containing alphanumeric tokens not in other .dats
+Thu Aug 30 21:45:56 2007 +0000 H. Peter Anvin 
+  * Generate a perfect hash for the token parser
+Thu Aug 30 21:40:08 2007 +0000 H. Peter Anvin 
+  * Fix bugs in repeated suffix handling, which led to missing r8d/r8w/r8d
+Thu Aug 30 21:39:37 2007 +0000 H. Peter Anvin 
+  * phash.ph: more powerful prehashing
+Thu Aug 30 20:15:25 2007 +0000 H. Peter Anvin 
+  * Make the perfect hash generator an includable module
+Wed Aug 29 20:30:31 2007 +0000 H. Peter Anvin 
+  * Correct the logic for recording fs: and gs: overrides.
+Wed Aug 29 18:20:19 2007 +0000 H. Peter Anvin 
+  * Generate R_X86_64_64 relocations in elf64 output
+Wed Aug 29 17:24:03 2007 +0000 H. Peter Anvin 
+  * Add README file
+Wed Aug 29 17:20:09 2007 +0000 H. Peter Anvin 
+  * Create a Perl library directory, and add the Graph module to it
+Wed Aug 29 17:05:17 2007 +0000 H. Peter Anvin 
+  * Perfect hash generator, as a perl script
+Wed Aug 29 16:41:43 2007 +0000 H. Peter Anvin 
+  * Use standard macro for the default directive
+Wed Aug 29 16:40:26 2007 +0000 H. Peter Anvin 
+  * Add standard macro for [default] directive
+Wed Aug 29 16:38:47 2007 +0000 H. Peter Anvin 
+  * More test cases for rel and abs addressing
+Wed Aug 29 16:38:05 2007 +0000 H. Peter Anvin 
+  * Add [default] directive
+Wed Aug 29 16:25:46 2007 +0000 H. Peter Anvin 
+  * nasmlib: add bsii() case-insensitive version of bsi()
+Wed Aug 29 15:49:53 2007 +0000 H. Peter Anvin 
+  * Add test cases for IP-relative addressing
+Wed Aug 29 15:19:19 2007 +0000 H. Peter Anvin 
+  * Suppress IP-relative only for fs: and gs: overrides
+Tue Aug 28 23:06:00 2007 +0000 H. Peter Anvin 
+  * Implement REL/ABS modifiers
+Sun Aug 26 05:51:39 2007 +0000 Frank Kotler 
+  * attempt to make static makefiles aware of outelf32/outelf64
+Sun Aug 26 05:48:54 2007 +0000 Frank Kotler 
+  * add nasm_strsep to nasmlib, for output/outmacho.c - strtok doesn't work
+Sun Aug 26 05:41:33 2007 +0000 Frank Kotler 
+  * remove "#include <unistd.h> from rdoff directory - two places - it annoyed Windows users and seems unneeded
+Sun Aug 26 05:10:24 2007 +0000 Frank Kotler 
+  * finally commit Mike Frysinger's "elf-visibility" patch
+Mon Aug 20 21:03:14 2007 +0000 H. Peter Anvin 
+  * regs.pl: handle dashed sequences with suffixes
+Mon Aug 20 20:10:04 2007 +0000 H. Peter Anvin 
+  * sync.c: change ULONG_MAX to UINT32_MAX
+Mon Aug 20 20:09:11 2007 +0000 H. Peter Anvin 
+  * Add _MIN and _MAX macros for the fixed-size types.
+Mon Aug 20 20:02:17 2007 +0000 H. Peter Anvin 
+  * ldrdf: cast output of sizeof() before passing to printf(), to avoid warning.
+Sun Aug 19 18:49:26 2007 +0000 Keith Kanios 
+  * Fixed RIP address processing ambiguity found by Charles Crayne.
+Fri Aug 17 07:37:52 2007 +0000 Keith Kanios 
+  * Fixed issues with REX prefix effective address generation. Fixed XMM instruction output.
+Fri Aug 17 02:03:10 2007 +0000 Keith Kanios 
+  * Changed MMXREG and XMMREG flags to help resolve invalid REX prefix generation for MMX instructions.
+Sat Jul 7 02:01:08 2007 +0000 H. Peter Anvin 
+  * More int/int32_t confusion
+Sat Jul 7 01:59:52 2007 +0000 H. Peter Anvin 
+  * regflag() should return int32_t.
+Thu Jun 21 19:00:12 2007 +0000 H. Peter Anvin 
+  * Detect missing <inttypes.h> and include ersatz version if missing
+Thu Jun 21 06:24:23 2007 +0000 H. Peter Anvin 
+  * inttypes.h: for older preprocessors, specify L and LL as appropriate
+Thu Jun 21 06:20:43 2007 +0000 H. Peter Anvin 
+  * inttypes.h: Fix spelling of SHRT_MAX
+Thu Jun 21 06:15:42 2007 +0000 H. Peter Anvin 
+  * inttypes.h: do a single ersatz <inttypes.h> based on <limits.h>
+Sun Jun 3 02:42:41 2007 +0000 Chuck Crayne 
+  * Support 32-bit direct addressing in 64-bit mode without base or index regs
+Sat Jun 2 02:26:21 2007 +0000 H. Peter Anvin 
+  * Fix the [U]INT*_C() creation macros
+Sat Jun 2 00:05:35 2007 +0000 H. Peter Anvin 
+  * For platforms that don't have them, provide <inttypes.h> for common models.
+Wed May 30 22:21:11 2007 +0000 H. Peter Anvin 
+  * Fix the handling of the \313 code.
+Wed May 30 22:20:01 2007 +0000 H. Peter Anvin 
+  * Machine-generated \321->\324 corrections
+Wed May 30 21:22:33 2007 +0000 Frank Kotler 
+  * update "version" to 0.99.02
+Wed May 30 20:30:15 2007 +0000 H. Peter Anvin 
+  * Correct the generation of 67 prefixes.
+Wed May 30 18:30:18 2007 +0000 H. Peter Anvin 
+  * Update dependencies.
+Wed May 30 16:34:29 2007 +0000 Frank Kotler 
+  * update cvs server name in misc/release script
+Wed May 30 04:28:50 2007 +0000 H. Peter Anvin 
+  * Avoid magic values; we have more than 124 registers now
+Wed May 30 04:27:58 2007 +0000 H. Peter Anvin 
+  * Remove bogus redundant tests
+Wed May 30 03:44:50 2007 +0000 H. Peter Anvin 
+  * More \321 -> \324
+Wed May 30 03:44:02 2007 +0000 H. Peter Anvin 
+  * Remove bogus check for 64-bitness
+Wed May 30 03:25:21 2007 +0000 H. Peter Anvin 
+  * Get rid of magic open-coded "register numbers"
+Wed May 30 02:48:51 2007 +0000 H. Peter Anvin 
+  * MOV reg64,reg64 takes \324 (64 bit with REX) not \321 (32 bit)
+Wed May 30 00:18:26 2007 +0000 H. Peter Anvin 
+  * Rename REGNORM to REG_EA
+Wed May 30 00:15:25 2007 +0000 H. Peter Anvin 
+  * More instruction flag surgery
+Wed May 30 00:05:00 2007 +0000 H. Peter Anvin 
+  * More cleanup of operand flags/register classes
+Tue May 29 23:57:12 2007 +0000 H. Peter Anvin 
+  * Clean up the existing operand flag definitions, and document
+Tue May 29 21:44:55 2007 +0000 H. Peter Anvin 
+  * Run "make alldeps"
+Thu May 24 22:33:07 2007 +0000 Frank Kotler 
+  * update version number to 0.99.01
+Tue May 15 04:33:43 2007 +0000 H. Peter Anvin 
+  * regs.dat: fix comment
+Fri May 4 18:47:16 2007 +0000 H. Peter Anvin 
+  * 16-bit relocations are standard in ELF64 (at my request, incidentally)
+Fri May 4 02:16:08 2007 +0000 Chuck Crayne 
+  * Addition of elf32 and elf64 output formats.
+Wed May 2 04:21:26 2007 +0000 Chuck Crayne 
+  * Allow '!' to be used in expressions with same meaning as in C.
+Wed May 2 01:59:16 2007 +0000 Chuck Crayne 
+  * Add %IFN and %ELIFN as per RFE #786286
+Mon Apr 30 22:26:58 2007 +0000 Chuck Crayne 
+  * Accept responsibility for support of outelf64.c
+Sun Apr 29 20:57:53 2007 +0000 Chuck Crayne 
+  * Clarify comments about relocation entries.
+Sun Apr 29 00:28:24 2007 +0000 Chuck Crayne 
+  * Allow ELF32 to be invoked either as -f elf or -f elf32
+Sat Apr 28 22:18:04 2007 +0000 Chuck Crayne 
+  * Eliminate shift count warnings when building on 32-bit systems
+Sat Apr 28 06:18:48 2007 +0000 Chuck Crayne 
+  * Initial support for ELF64
+Wed Apr 18 02:27:18 2007 +0000 H. Peter Anvin 
+  * Fix the handling of \324 for computing the length
+Wed Apr 18 02:24:34 2007 +0000 Keith Kanios 
+  * Fixed RDF/2 to comply with "maxbits" use.
+Tue Apr 17 20:23:11 2007 +0000 H. Peter Anvin 
+  * Handle "LOCK as REX.R" for MOV CRx; fix warning for invalid 64-bit regs
+Mon Apr 16 18:16:46 2007 +0000 Keith Kanios 
+  * MEM_OFFSET Instructions Fixed.
+Mon Apr 16 15:46:46 2007 +0000 Keith Kanios 
+  * Fixed 64-bit Mode Segment Selection.
+Mon Apr 16 14:31:54 2007 +0000 Keith Kanios 
+  * Fixed distinction between [LOCAL]SYMBOL/IMMEDIATE for RIP-relative addressing.
+Mon Apr 16 14:05:01 2007 +0000 Keith Kanios 
+  * Fixed long mode MEM_OFFS issue.
+Mon Apr 16 13:54:49 2007 +0000 Keith Kanios 
+  * Filled in all RIP Register Flags.
+Mon Apr 16 05:26:29 2007 +0000 H. Peter Anvin 
+  * More \321 -> \324 for 64-bit instructions
+Mon Apr 16 04:56:06 2007 +0000 Keith Kanios 
+  * Fixed 64-bit offset generation.
+Mon Apr 16 02:39:56 2007 +0000 H. Peter Anvin 
+  * More 64-bit ndisasm fixes.
+Mon Apr 16 02:02:06 2007 +0000 H. Peter Anvin 
+  * Fixes for 64-bit ndisasm.
+Mon Apr 16 01:21:29 2007 +0000 H. Peter Anvin 
+  * Use + instead of * for extension; it feels cleaner with the new meaning.
+Mon Apr 16 01:18:30 2007 +0000 H. Peter Anvin 
+  * Initial 64-bit support for ndisasm.  Still a work in progress.
+Sun Apr 15 23:12:17 2007 +0000 H. Peter Anvin 
+  * Clean up the 64-bitification of regs.dat for 64-bit ndisasm support
+Sun Apr 15 23:10:26 2007 +0000 H. Peter Anvin 
+  * Remove @GCCFLAGS@
+Sun Apr 15 23:09:23 2007 +0000 H. Peter Anvin 
+  * CR8 is not special in any way as far as the assembler is concerned.
+Sun Apr 15 23:03:28 2007 +0000 H. Peter Anvin 
+  * Get rid of @GCCFLAGS@
+Sun Apr 15 22:45:25 2007 +0000 H. Peter Anvin 
+  * Cleaner way to add gcc options
+Sun Apr 15 22:08:30 2007 +0000 Keith Kanios 
+  * Fixed distinction between RIP relative symbols and immediate values.
+Sun Apr 15 05:40:43 2007 +0000 H. Peter Anvin 
+  * Fix the register number for CR7 (it was using the same number as CR15).
+Sun Apr 15 05:32:18 2007 +0000 H. Peter Anvin 
+  * More perl-like idioms for generating regdis.c
+Sun Apr 15 01:37:13 2007 +0000 Keith Kanios 
+  * Fixed regdis.c generation.
+Sat Apr 14 18:54:52 2007 +0000 Keith Kanios 
+  * Added DQ constants for all BITS modes.
+Sat Apr 14 08:03:02 2007 +0000 H. Peter Anvin 
+  * outmacho.c: stylistic cleanups
+Sat Apr 14 03:52:05 2007 +0000 Keith Kanios 
+  * Fixed support for DQ constants in long mode.
+Sat Apr 14 03:44:31 2007 +0000 Keith Kanios 
+  * Hopefully it is actually fixed this time :P
+Sat Apr 14 01:49:07 2007 +0000 Keith Kanios 
+  * Fixed structure initialization issue.
+Sat Apr 14 01:44:35 2007 +0000 Keith Kanios 
+  * Refixed uninitialized data.
+Sat Apr 14 01:40:24 2007 +0000 Keith Kanios 
+  * Fixed uninitialized structure data.
+Sat Apr 14 01:24:14 2007 +0000 Keith Kanios 
+  * c99 printf/fprintf compliance.
+Sat Apr 14 00:46:25 2007 +0000 Keith Kanios 
+  * Placated unreferenced types.
+Sat Apr 14 00:10:59 2007 +0000 Keith Kanios 
+  * c99 printf/fprintf compliance.
+Fri Apr 13 23:09:18 2007 +0000 Keith Kanios 
+  * Added outmacho.* to static makefile.
+Fri Apr 13 22:24:46 2007 +0000 Keith Kanios 
+  * Fixed REGRIP -> RIPREG to match regs.dat.
+Fri Apr 13 22:07:53 2007 +0000 Keith Kanios 
+  * Fixed obj_fwrite() declaration to match "static" definition.
+Fri Apr 13 22:03:24 2007 +0000 Keith Kanios 
+  * Added appropriate "void" prototypes.
+Fri Apr 13 22:00:42 2007 +0000 Keith Kanios 
+  * Replaced str(n)casecmp with more standard str(n)icmp.
+Fri Apr 13 20:06:41 2007 +0000 H. Peter Anvin 
+  * AIf we have config.h, we should actually include it!!
+Fri Apr 13 19:59:20 2007 +0000 H. Peter Anvin 
+  * When compiling with gcc, compile with -W -Wall for maximum warnings.
+Fri Apr 13 19:58:42 2007 +0000 H. Peter Anvin 
+  * Macroize any compiler-specific code; macros defined in "compiler.h"
+Fri Apr 13 16:47:53 2007 +0000 Keith Kanios 
+  * Fixed distinction between char and int8_t data types.
+Fri Apr 13 01:17:45 2007 +0000 Keith Kanios 
+  * Comment "REX.I" should have been "REX.X"
+Fri Apr 13 00:52:54 2007 +0000 Keith Kanios 
+  * Fixed c99 data-types after removal of typedefs.
+Fri Apr 13 00:43:50 2007 +0000 Keith Kanios 
+  * Added Dev-Cpp Makefile
+Fri Apr 13 00:38:29 2007 +0000 Keith Kanios 
+  * *** empty log message ***
+Thu Apr 12 17:58:02 2007 +0000 H. Peter Anvin 
+  * Remove redundant inclusion of <inttypes.h>
+Thu Apr 12 16:54:50 2007 +0000 H. Peter Anvin 
+  * Remove obsolete types; add <inttypes.h> where needed; header fixes
+Thu Apr 12 16:25:58 2007 +0000 H. Peter Anvin 
+  * autogen.sh script to create configure, et al.
+Thu Apr 12 16:23:11 2007 +0000 Keith Kanios 
+  * Fixed c99 support for RDOFF Tools
+Thu Apr 12 16:12:09 2007 +0000 H. Peter Anvin 
+  * outmacho.c: Don't assume __builtin_ctzl exists for gcc < 4
+
+Mon Nov 12 22:05:31 2007 -0800 H. Peter Anvin 
+  * BR 1828866: fix handling of LAR/LSL
+Mon Nov 12 21:57:00 2007 -0800 H. Peter Anvin 
+  * Better (but not *good!*) handling of 64-bit addressing in ndisasm
+Mon Nov 12 21:02:33 2007 -0800 H. Peter Anvin 
+  * Fix disassembly of XCHG
+Mon Nov 12 20:18:33 2007 -0800 H. Peter Anvin 
+  * Test of XCHG
+Mon Nov 12 20:18:05 2007 -0800 H. Peter Anvin 
+  * Fix handling of XCHG in 64-bit mode
+Mon Nov 12 19:36:13 2007 -0800 H. Peter Anvin 
+  * More \321 -> \324 bug fixes
+Mon Nov 12 18:26:31 2007 -0800 H. Peter Anvin 
+  * float.c: all warnings and errors are pass 1 only
+Sat Nov 10 21:55:19 2007 -0800 Charles Crayne 
+  * Update documentation for stack relative directives.
+Sat Nov 10 17:52:23 2007 -0800 Charles Crayne 
+  * Clean up a few more 32-bit bottlenecks
+Fri Nov 9 16:37:41 2007 -0800 Charles Crayne 
+  * Update documantation for stack relative directives
+Fri Nov 9 16:33:54 2007 -0800 Charles Crayne 
+  * Merge branch 'master' of /home/chuck/development/gitnasm/
+Fri Nov 9 16:25:43 2007 -0800 Charles Crayne 
+  * Update documentation for stack relative directives
+Fri Nov 9 14:44:02 2007 -0800 H. Peter Anvin 
+  * Don't combine type and size into a single argument
+Thu Nov 8 22:11:14 2007 -0800 Charles Crayne 
+  * Add flat64 to %stacksize choices
+Thu Nov 8 20:43:22 2007 -0800 H. Peter Anvin 
+  * Fix building under OpenWatcom
+Thu Nov 8 20:29:37 2007 -0800 H. Peter Anvin 
+  * ps2pdf: remove -dOptimize=true
+Thu Nov 8 20:21:41 2007 -0800 H. Peter Anvin 
+  * No binary files left in the source distro; unbreak release script
+Thu Nov 8 20:01:11 2007 -0800 H. Peter Anvin 
+  * BR 1828103: Fix %arg and %local
+Thu Nov 8 19:34:01 2007 -0800 H. Peter Anvin 
+  * nasmlib.c: prefix_name(): use the elements() macro
+Thu Nov 8 19:30:22 2007 -0800 H. Peter Anvin 
+  * Move elements() to nasmlib.h
+Thu Nov 8 19:15:33 2007 -0800 H. Peter Anvin 
+  * constipate the "str" argument to bsi() and bsii()
+Wed Nov 7 19:03:46 2007 -0800 Charles Crayne 
+  * Upgrade RAA functions to hold 64-bit data.
+Tue Nov 6 21:48:12 2007 -0800 Charles Crayne 
+  * Pass 64-bit instruction lengths to back-ends.
+Tue Nov 6 18:27:23 2007 -0800 Charles Crayne 
+  * Prepare for 64-bit instruction lengths
+Mon Nov 5 21:49:49 2007 -0800 Charles Crayne 
+  * Disambiguate error messages
+Mon Nov 5 17:19:32 2007 -0800 Charles Crayne 
+  * Upgrade label functions to 64-bit
+Sun Nov 4 21:10:42 2007 -0800 H. Peter Anvin 
+  * Permit opcode names as labels as long as they are followed by a colon
+Sun Nov 4 15:28:30 2007 -0800 Charles Crayne 
+  * Make warning limit valid for both i386 and x86_64
+Sat Nov 3 22:06:13 2007 -0700 Charles Crayne 
+  * Warn on out of bounds EA displacements
+Thu Nov 1 15:08:27 2007 -0700 H. Peter Anvin 
+  * Treat info files as binary when creating xdoc distro file
+Thu Nov 1 15:07:42 2007 -0700 H. Peter Anvin 
+  * Remove obsolete binary files from the distribution
+Thu Nov 1 14:53:32 2007 -0700 H. Peter Anvin 
+  * Move declarations before statements
+Wed Oct 31 23:37:35 2007 -0700 H. Peter Anvin 
+  * NASM 0.99.06
+Wed Oct 31 23:37:19 2007 -0700 H. Peter Anvin 
+  * Script to tag the tree for release
+Wed Oct 31 10:59:26 2007 -0700 H. Peter Anvin 
+  * Even more "riprel" tests
+Tue Oct 30 01:17:57 2007 -0700 H. Peter Anvin 
+  * floatx.asm: add tests for "rounds up to smallest denorm"
+Tue Oct 30 01:13:27 2007 -0700 H. Peter Anvin 
+  * Run "make alldeps"
+Tue Oct 30 01:13:09 2007 -0700 H. Peter Anvin 
+  * float.c: handle round-up-to-denorm correctly.
+Tue Oct 30 00:59:27 2007 -0700 H. Peter Anvin 
+  * Exhaustive test for 8-bit floating point values
+Mon Oct 29 23:12:47 2007 -0700 H. Peter Anvin 
+  * Clean up the handing of operands in assemble.c
+Mon Oct 29 22:56:08 2007 -0700 H. Peter Anvin 
+  * Don't warn for segmented references
+Mon Oct 29 20:20:12 2007 -0700 H. Peter Anvin 
+  * Use a 32-bit floating-point limb size; support 8-bit float
+Mon Oct 29 18:24:59 2007 -0700 Charles Crayne 
+  * Reduce severity of redundant prefixes from error to warning.
+Sun Oct 28 23:23:24 2007 -0700 H. Peter Anvin 
+  * Test of some addressing modes in 64-bit mode.
+Sun Oct 28 23:21:46 2007 -0700 H. Peter Anvin 
+  * Fix bogus flagging of effective addresses as invalid
+Sun Oct 28 23:10:34 2007 -0700 H. Peter Anvin 
+  * Actually shut up the warning in rdfload.c
+Sun Oct 28 22:04:42 2007 -0700 H. Peter Anvin 
+  * Clean up stealth whitespace
+Sun Oct 28 22:04:00 2007 -0700 H. Peter Anvin 
+  * Fix warning about cast to pointer in rdfload.c
+Sun Oct 28 22:04:00 2007 -0700 H. Peter Anvin 
+  * 64-bit addressing and prefix handling changes
+Sun Oct 28 15:29:54 2007 -0700 Charles Crayne 
+  * Adjust stabs symbol index to match symbol table.
+Fri Oct 26 21:38:02 2007 -0700 H. Peter Anvin 
+  * readnum(): handle prefix-suffix collision like "0h"
+Fri Oct 26 18:49:29 2007 -0700 H. Peter Anvin 
+  * Better handling of platforms which hide "extended" functionality
+Wed Oct 24 15:51:40 2007 -0700 Charles Crayne 
+  * Merge branch 'master' of /home/chuck/development/gitnasm/
+Wed Oct 24 15:30:17 2007 -0700 Charles Crayne 
+  * Update sections about debug info formats
+Wed Oct 24 15:29:51 2007 -0700 H. Peter Anvin 
+  * Fix the handling of floating-point tokens in the preprocessor
+Tue Oct 23 19:28:39 2007 -0700 Charles Crayne 
+  * Fix bugs item #1817677
+Tue Oct 23 00:08:58 2007 -0700 H. Peter Anvin 
+  * Slightly simplify the radix-detection code
+Mon Oct 22 19:48:06 2007 -0700 H. Peter Anvin 
+  * Unbreak particularly tricky hex constants
+Mon Oct 22 19:37:36 2007 -0700 H. Peter Anvin 
+  * Decimal floating point can also start with 0. 0e 0E
+Mon Oct 22 17:34:10 2007 -0700 H. Peter Anvin 
+  * Support binary and octal floating-point
+Mon Oct 22 16:53:48 2007 -0700 H. Peter Anvin 
+  * More consistent handling of radix letters
+Sun Oct 21 15:33:01 2007 -0700 H. Peter Anvin 
+  * float.c: correct exponent capping
+Sun Oct 21 14:21:43 2007 -0700 Charles Crayne 
+  * Clean up elf symbol table section
+Fri Oct 19 18:33:57 2007 -0700 H. Peter Anvin 
+  * Allow $-prefixed hexadecimal FP as an alternative to 0x
+Fri Oct 19 14:43:22 2007 -0700 H. Peter Anvin 
+  * Scripts to remove stealth whitespace
+Fri Oct 19 14:42:29 2007 -0700 H. Peter Anvin 
+  * Formatting: kill off "stealth whitespace"
+Fri Oct 19 14:26:52 2007 -0700 H. Peter Anvin 
+  * test/floatx.asm: fix test case
+Fri Oct 19 14:19:52 2007 -0700 H. Peter Anvin 
+  * uscore.asm: Fix test case
+Fri Oct 19 14:17:51 2007 -0700 H. Peter Anvin 
+  * float.c: mark read_exponent() static
+Fri Oct 19 14:10:35 2007 -0700 H. Peter Anvin 
+  * Don't confuse suffixed hexadecimal with floating-point
+Fri Oct 19 13:17:24 2007 -0700 H. Peter Anvin 
+  * Anchor filename locations in .gitignore
+Fri Oct 19 13:16:51 2007 -0700 H. Peter Anvin 
+  * test/Makefile: Use -Ox instead of -O999
+Fri Oct 19 13:14:06 2007 -0700 H. Peter Anvin 
+  * Test of underscored constants
+Fri Oct 19 13:10:46 2007 -0700 H. Peter Anvin 
+  * Allow underscores in numbers; better detection of FP
+Fri Oct 19 10:52:31 2007 -0700 H. Peter Anvin 
+  * Modernize nasm.spec.in and make it closer to the Fedora version
+Thu Oct 18 23:33:06 2007 -0700 Charles Crayne 
+  * Suppress datarootdir warnings from configure
+Thu Oct 18 21:17:20 2007 -0700 Charles Crayne 
+  * Suppress signedness warnings in disassembler
+Thu Oct 18 19:14:08 2007 -0700 H. Peter Anvin 
+  * Cleaner solution for MinGW handling of __STRICT_ANSI__
+Thu Oct 18 19:14:08 2007 -0700 H. Peter Anvin 
+  * configure: Undefine __STRICT_ANSI__ for mingw's benefit
+Thu Oct 18 19:14:07 2007 -0700 H. Peter Anvin 
+  * Fix invocation of readnum()
+Thu Oct 18 19:02:42 2007 -0700 Charles Crayne 
+  * Suppress a few signedness warnings
+Thu Oct 18 17:04:10 2007 -0700 root 
+  * Avoid unnecessary warning on redefinition of section (bug 801180)
+Wed Oct 17 17:55:45 2007 -0700 Charles Crayne 
+  * Generate stabs entries for any executable section
+Tue Oct 16 22:59:09 2007 -0700 H. Peter Anvin 
+  * NASM 0.99.05
+Tue Oct 16 15:46:04 2007 -0700 H. Peter Anvin 
+  * Tests of obscenely large exponents
+Tue Oct 16 14:42:32 2007 -0700 H. Peter Anvin 
+  * Comma-separate contents of __FLOAT__
+Tue Oct 16 14:40:27 2007 -0700 H. Peter Anvin 
+  * Implement floating-point option control directive
+Tue Oct 16 11:48:07 2007 -0700 H. Peter Anvin 
+  * Floating-point warning fixes; fix round-to-overflow
+Tue Oct 16 11:32:58 2007 -0700 H. Peter Anvin 
+  * Handle rounding of denorms correctly; make fp overflow a warning
+Tue Oct 16 10:35:02 2007 -0700 H. Peter Anvin 
+  * Additional entries for .gitignore
+Tue Oct 16 10:32:57 2007 -0700 H. Peter Anvin 
+  * Refactor floating-point formatting code; fix 80-bit denorms
+Tue Oct 16 10:31:16 2007 -0700 H. Peter Anvin 
+  * Add 1.5 as a test case: representative of an exact fraction
+Mon Oct 15 20:06:06 2007 -0700 H. Peter Anvin 
+  * Recognize 'd', 't' and 'y' as radix suffixes
+Mon Oct 15 19:53:10 2007 -0700 H. Peter Anvin 
+  * Fix FISTTP opcodes (BR 689695)
+Mon Oct 15 19:46:32 2007 -0700 H. Peter Anvin 
+  * New floating-point conversion routines
+Mon Oct 15 17:48:43 2007 -0700 H. Peter Anvin 
+  * Add testnos3 from the gdtoa package (floating-point test)
+Sat Oct 13 23:19:21 2007 -0700 H. Peter Anvin 
+  * .gitignore file doesn't need to be in the release file
+Sat Oct 13 23:17:41 2007 -0700 H. Peter Anvin 
+  * Add .gitignore file so "git status" produces something sane
+Sat Oct 13 23:12:46 2007 -0700 H. Peter Anvin 
+  * autoconf: drop AC_USE_SYSTEM_EXTENSIONS to support autoconf 2.59
+Sat Oct 13 07:09:22 2007 -0700 Keith Kanios 
+  * Fix 32-bit types in preproc.c and eval.c
+Thu Oct 11 20:32:33 2007 -0700 Charles Crayne 
+  * Must define types before using them
+Thu Oct 11 13:42:09 2007 -0700 H. Peter Anvin 
+  * preproc.c: move smacro define/undef to separate functions
+Thu Oct 11 13:38:38 2007 -0700 H. Peter Anvin 
+  * preproc.c: PP_DEFINE and PP_XDEFINE are case-sensitive
+Thu Oct 11 12:52:03 2007 -0700 H. Peter Anvin 
+  * preproc.c: normalize the handling of case sensitivity
+Thu Oct 11 12:51:06 2007 -0700 H. Peter Anvin 
+  * Define macros necessary for <inttypes.h> on C++
+Thu Oct 11 10:12:58 2007 -0700 H. Peter Anvin 
+  * More "bool" fixes
+Thu Oct 11 10:11:57 2007 -0700 H. Peter Anvin 
+  * preproc.c: allow 64-bit repeat counts
+Thu Oct 11 10:06:19 2007 -0700 H. Peter Anvin 
+  * preproc.c: For an SMacro, in_progress really is a boolean (no %rep)
+Thu Oct 11 00:05:57 2007 -0700 H. Peter Anvin 
+  * Additional uses of bool and enum
+Thu Oct 11 00:05:57 2007 -0700 H. Peter Anvin 
+  * preproc.c: MMacro.in_progress is not a boolean
+Wed Oct 10 18:07:51 2007 -0700 H. Peter Anvin 
+  * saa_fread/fwrite: when seeking, must set [rw]ptr as well
+Wed Oct 10 14:58:45 2007 -0700 H. Peter Anvin 
+  * Use the compiler-provided booleans if available, otherwise emulate
+Wed Oct 10 14:55:14 2007 -0700 H. Peter Anvin 
+  * owlinux.mak: don't clean things we won't be able to
+Wed Oct 10 14:29:53 2007 -0700 H. Peter Anvin 
+  * configure.in: looks like we need autoconf 2.61 :(
+Wed Oct 10 14:06:59 2007 -0700 H. Peter Anvin 
+  * Create option -Ox to tell NASM to do unlimited passes
+Mon Oct 8 19:26:57 2007 -0700 H. Peter Anvin 
+  * Revert "floatb.asm: fix broken testcase"
+Mon Oct 8 18:39:24 2007 -0700 H. Peter Anvin 
+  * floatb.asm: fix broken testcase
+Mon Oct 8 12:41:00 2007 -0700 H. Peter Anvin 
+  * saa_rstruct: fix overrun check
+Mon Oct 8 12:12:23 2007 -0700 H. Peter Anvin 
+  * Add Frank's floattest.asm test file
+Sun Oct 7 21:13:14 2007 -0700 H. Peter Anvin 
+  * saa_fpwrite: initializing "len" should be part of the loop
+Sun Oct 7 18:46:57 2007 -0700 Charles Crayne 
+  * Fix infinite loop in function saa_fpwrite
+Fri Oct 5 17:44:16 2007 -0700 H. Peter Anvin 
+  * zerobyte.asm: use a real instruction to avoid confusing ndisasm
+Fri Oct 5 17:42:31 2007 -0700 H. Peter Anvin 
+  * zerobyte.asm: add test cases for non-initial \170 uses
+Fri Oct 5 17:29:01 2007 -0700 H. Peter Anvin 
+  * Check in the proper zerobyte test
+Fri Oct 5 17:04:32 2007 -0700 H. Peter Anvin 
+  * Emit REX prefix before literal zero (\170)
+Fri Oct 5 17:01:15 2007 -0700 H. Peter Anvin 
+  * LICENSE: Break long line
+Fri Oct 5 14:36:03 2007 -0700 H. Peter Anvin 
+  * Add test for problematic floats
+Thu Oct 4 23:51:08 2007 -0700 H. Peter Anvin 
+  * floatx.asm: add Inf and NaN to the boundary condition tests
+Thu Oct 4 23:09:19 2007 -0700 H. Peter Anvin 
+  * floatx.asm: add specific tests for exponent boundary conditions
+Thu Oct 4 22:51:08 2007 -0700 H. Peter Anvin 
+  * float.c: correct the exponent
+Thu Oct 4 15:18:23 2007 -0700 H. Peter Anvin 
+  * Additional rules in test/Makefile
+Thu Oct 4 13:42:56 2007 -0700 H. Peter Anvin 
+  * Rewrite the handling of SAA's to allow random access
+Wed Oct 3 21:30:57 2007 -0700 H. Peter Anvin 
+  * Change cloc_t to struct location, and reorder the members
+Wed Oct 3 21:24:51 2007 -0700 H. Peter Anvin 
+  * BR 1352920: change loc_t -> cloc_t
+Wed Oct 3 21:22:16 2007 -0700 H. Peter Anvin 
+  * BR 1352920: Handle upper case %line
+Wed Oct 3 17:40:12 2007 -0700 H. Peter Anvin 
+  * Use autoconf to request feature macros
+Tue Oct 2 22:04:15 2007 -0700 H. Peter Anvin 
+  * preproc.c: constipation
+Tue Oct 2 21:57:27 2007 -0700 H. Peter Anvin 
+  * make alldeps
+Tue Oct 2 21:53:51 2007 -0700 H. Peter Anvin 
+  * Portability fixes
+Tue Oct 2 21:13:18 2007 -0700 H. Peter Anvin 
+  * Run "make alldeps".
+Tue Oct 2 17:40:00 2007 -0700 H. Peter Anvin 
+  * Use the crc64 we already use as the perfect hash function prehash
+Tue Oct 2 15:09:33 2007 -0700 H. Peter Anvin 
+  * insns.dat: add systematic names for the hinting NOPs (0F18-0F1F)
+Mon Oct 1 11:28:32 2007 -0700 H. Peter Anvin 
+  * Unspecified files are null strings, not null pointers
+Mon Oct 1 11:26:31 2007 -0700 H. Peter Anvin 
+  * Check for the most basic filename overlaps
+Sun Sep 30 22:15:36 2007 -0700 Charles Crayne 
+  * modified:   nasm.1 to add newer command line options
+Fri Sep 28 21:27:41 2007 -0700 Charles Crayne 
+  * Merge branch 'master' of git+ssh://ccrayne@repo.or.cz/srv/git/nasm
+Fri Sep 28 20:17:12 2007 -0700 H. Peter Anvin 
+  * configure.in: AC_SUBST_FILE should have been AC_SUBST
+Fri Sep 28 17:17:20 2007 -0700 H. Peter Anvin 
+  * Unbreak relative references to immediate addresses
+Fri Sep 28 15:16:47 2007 -0700 Charles Crayne 
+  * Merge branch 'master' of git+ssh://ccrayne@repo.or.cz/srv/git/nasm
+Fri Sep 28 12:01:55 2007 -0700 H. Peter Anvin 
+  * lib/vsnprintf.c: correct boundary conditions
+Fri Sep 28 10:50:20 2007 -0700 H. Peter Anvin 
+  * Add substitutes for snprintf() and vsnprintf()
+Fri Sep 28 02:03:41 2007 -0400 Frank Kotler 
+  * Merge branch 'master' of git+ssh://fbkotler@repo.or.cz/srv/git/nasm
+Thu Sep 27 21:35:04 2007 -0700 H. Peter Anvin 
+  * Exclude config.h from the dependency list for the canned makefiles
+Thu Sep 27 21:12:17 2007 -0700 H. Peter Anvin 
+  * version.pl: Add support for daily snapshot releases
+Thu Sep 27 19:46:55 2007 -0700 H. Peter Anvin 
+  * Add Makefile for Linux -> DOS, Win32, OS/2 using OpenWatcom
+Wed Sep 26 19:57:07 2007 -0700 H. Peter Anvin 
+  * Add Makefile for OpenWatcom (DOS, OS/2 or Win32 output)
+Wed Sep 26 17:00:18 2007 -0700 H. Peter Anvin 
+  * Test for various addressing modes in 64-bit mode
+Wed Sep 26 15:19:28 2007 -0700 H. Peter Anvin 
+  * nasm option reshuffling, -E -> -Z
+Tue Sep 25 23:57:21 2007 -0400 Frank Kotler 
+  * Version 0.99.04
+Tue Sep 25 20:36:45 2007 -0700 H. Peter Anvin 
+  * nasmdoc: corrections on 64-bit immediates/displacements
+Tue Sep 25 16:02:21 2007 -0700 H. Peter Anvin 
+  * nasmdoc: shorten lines which are too long
+Tue Sep 25 16:01:07 2007 -0700 H. Peter Anvin 
+  * Document NASM behaviour for 64-bit immediates and displacements
+Tue Sep 25 15:44:40 2007 -0700 H. Peter Anvin 
+  * test/movimm.asm: add optimizable forms
+Tue Sep 25 15:41:19 2007 -0700 H. Peter Anvin 
+  * assemble.c: clean up whitespace
+Tue Sep 25 15:40:36 2007 -0700 H. Peter Anvin 
+  * Correct the handling of "MOV" with immediate in 64-bit mode
+Tue Sep 25 15:39:42 2007 -0700 H. Peter Anvin 
+  * Test of immediate handling on 64-bit mode
+Tue Sep 25 14:27:34 2007 -0700 H. Peter Anvin 
+  * Add nasm_zalloc() to nasmlib.c
+Tue Sep 25 14:26:03 2007 -0700 H. Peter Anvin 
+  * Fix BR 1490407: size of the second operand of LAR/LSL
+Tue Sep 25 14:11:29 2007 -0700 H. Peter Anvin 
+  * Fix BR 1490407: size of the second operand of LAR/LSL
+Tue Sep 25 13:34:55 2007 -0700 H. Peter Anvin 
+  * Makefile.in: make "make install" create directories
+Tue Sep 25 08:48:37 2007 -0700 H. Peter Anvin 
+  * Fix BR 1445441: uninitialized use of "error_file"
+Mon Sep 24 21:33:17 2007 -0700 H. Peter Anvin 
+  * preproc.c: fix the loop in %undef
+Mon Sep 24 20:53:48 2007 -0700 H. Peter Anvin 
+  * float.c: clear off uninitialized warning
+Mon Sep 24 17:02:41 2007 -0700 H. Peter Anvin 
+  * outcoff: set the "virtual size field" to zero (BR 1351586)
+Mon Sep 24 15:56:02 2007 -0700 H. Peter Anvin 
+  * insns.dat: SMINT - mark ND, DMINT - fix opcode
+Mon Sep 24 15:55:20 2007 -0700 H. Peter Anvin 
+  * 0F0F is a 3Dnow! prefix; remove from prefix list
+Mon Sep 24 15:48:09 2007 -0700 H. Peter Anvin 
+  * Additional compaction missed by script
+Mon Sep 24 15:42:53 2007 -0700 H. Peter Anvin 
+  * insns.dat: machine-generated compaction mmx/xmmreg,mem -> mmx/xmmrm
+Mon Sep 24 13:54:00 2007 -0700 H. Peter Anvin 
+  * nasmdoc: grammar fix
+Mon Sep 24 13:44:02 2007 -0700 H. Peter Anvin 
+  * nasmdoc: remove stray periods
+Mon Sep 24 13:42:09 2007 -0700 H. Peter Anvin 
+  * test/Makefile: make a bit more useful
+Mon Sep 24 13:41:58 2007 -0700 H. Peter Anvin 
+  * Implement the -MG option (SF RFE 1564264)
+Mon Sep 24 12:52:09 2007 -0700 H. Peter Anvin 
+  * nasmdoc: clarify __float*__ example
+Mon Sep 24 12:44:38 2007 -0700 H. Peter Anvin 
+  * nasmdoc: document the __float*__ operators
+Mon Sep 24 12:30:54 2007 -0700 H. Peter Anvin 
+  * Support __float*__ for floating-point numbers in expressions
+Mon Sep 24 10:51:07 2007 -0700 H. Peter Anvin 
+  * eval.c: replace sequence of ifs with switch
+Mon Sep 24 10:50:23 2007 -0700 H. Peter Anvin 
+  * tokhash: allow a bit smarter pattern matching
+Sat Sep 22 22:35:28 2007 -0700 H. Peter Anvin 
+  * Implement INVLPGA according to the documentation
+Sat Sep 22 22:02:34 2007 -0700 H. Peter Anvin 
+  * Reformat insns.dat to uniform column width
+Sat Sep 22 21:50:03 2007 -0700 H. Peter Anvin 
+  * Simple test for 0x67 prefixes
+Sat Sep 22 21:49:51 2007 -0700 H. Peter Anvin 
+  * Auto-generate 0x67 prefixes without the need for \30x codes
+Sat Sep 22 21:47:13 2007 -0700 H. Peter Anvin 
+  * Make test/Makefile a bit more useful
+Sat Sep 22 21:29:41 2007 -0700 H. Peter Anvin 
+  * Add TY_OWORD for "DO" output
+Sat Sep 22 19:52:11 2007 -0700 H. Peter Anvin 
+  * LDDQU needs \301 (BR 1103549)
+Sat Sep 22 19:51:13 2007 -0700 H. Peter Anvin 
+  * RDTSCP and INVLPGA aren't 64-bit specific
+Sat Sep 22 19:40:37 2007 -0700 H. Peter Anvin 
+  * Cyrix GX1 instructions: BBx_RESET, CPU_READ, CPU_WRITE
+Sat Sep 22 19:28:14 2007 -0700 H. Peter Anvin 
+  * Centaur XSHA1, XSHA256, MONTMUL
+Sat Sep 22 19:20:56 2007 -0700 H. Peter Anvin 
+  * Implement Centaur's XCRYPT instructions
+Sat Sep 22 19:13:05 2007 -0700 H. Peter Anvin 
+  * Add Geode LX (AMD's Cyrix-derived core) instructions
+Sat Sep 22 19:05:11 2007 -0700 H. Peter Anvin 
+  * Add the GETSEC instruction for Intel SMX
+Sat Sep 22 18:59:18 2007 -0700 H. Peter Anvin 
+  * Add the AMD SSE4a and LZCNT instructions
+Sat Sep 22 18:23:20 2007 -0700 H. Peter Anvin 
+  * Tag UMOV as ND (no disassembly) to avoid collision
+Sat Sep 22 18:20:49 2007 -0700 H. Peter Anvin 
+  * Disallow optimizing by less than 5 passes.
+Sat Sep 22 17:45:45 2007 -0700 H. Peter Anvin 
+  * BR 1783117: Document that %+ needs a space after it, and fix crash
+Sat Sep 22 16:44:56 2007 -0700 H. Peter Anvin 
+  * nasm.spec.in: minor fixes
+Sat Sep 22 16:38:25 2007 -0700 H. Peter Anvin 
+  * release script: handle stricter CLI parsing for "git tag"
+Sat Sep 22 16:35:11 2007 -0700 H. Peter Anvin 
+  * Update nasm.spec.in and make it handle rc releases
+Sat Sep 22 16:19:19 2007 -0700 H. Peter Anvin 
+  * version.pl: support version numbers of the form X.Y[.Z]rcW
+Thu Sep 20 21:33:43 2007 -0700 Charles Crayne 
+  * Merge branch 'master' of git+ssh://ccrayne@repo.or.cz/srv/git/nasm
+Thu Sep 20 21:12:33 2007 -0700 Charles Crayne 
+  *    modified:   misc/release to fix bug in removing .git
+Wed Sep 19 21:41:43 2007 -0700 H. Peter Anvin 
+  * Merge branch 'master' of git+ssh://repo.or.cz/srv/git/nasm
+Wed Sep 19 21:41:27 2007 -0700 H. Peter Anvin 
+  * Update manual pages
+Wed Sep 19 21:41:02 2007 -0700 H. Peter Anvin 
+  * Remove limit on number of sync points
+Wed Sep 19 21:40:37 2007 -0700 H. Peter Anvin 
+  * Make nasm_malloc() et al available from inside ndisasm
+Wed Sep 19 21:07:32 2007 -0400 Frank Kotler 
+  * Version 0.99.03
+Wed Sep 19 21:06:59 2007 -0400 Frank Kotler 
+  * Merge branch 'master' of git+ssh://fbkotler@repo.or.cz/srv/git/nasm
+Wed Sep 19 16:22:03 2007 -0700 H. Peter Anvin 
+  * Merge commit 'origin/sse5'
+Wed Sep 19 16:15:22 2007 -0700 H. Peter Anvin 
+  * test/Makefile: make a bit more useful
+Tue Sep 18 22:54:40 2007 -0700 H. Peter Anvin 
+  * Slightly optimize the interface to nasm_token_hash()
+Wed Sep 19 01:34:55 2007 -0400 Frank Kotler 
+  * Merge branch 'master' of git+ssh://fbkotler@repo.or.cz/srv/git/nasm
+Tue Sep 18 22:23:42 2007 -0700 H. Peter Anvin 
+  * Merge commit 'origin/master' into sse5
+Tue Sep 18 22:22:49 2007 -0700 H. Peter Anvin 
+  * elf64: fix 32-bit truncations
+Tue Sep 18 22:08:04 2007 -0700 H. Peter Anvin 
+  * Document Infinity and NaN
+Tue Sep 18 21:55:56 2007 -0700 H. Peter Anvin 
+  * Support generating NaNs and infinities
+Tue Sep 18 19:12:26 2007 -0700 H. Peter Anvin 
+  * Update documentation
+Tue Sep 18 18:37:36 2007 -0700 H. Peter Anvin 
+  * Simple test for hexadecimal floating-point numbers
+Tue Sep 18 18:33:17 2007 -0700 H. Peter Anvin 
+  * Fix error-reporting in hexadecimal floating-point numbers
+Tue Sep 18 18:31:26 2007 -0700 H. Peter Anvin 
+  * Support C99-style hexadecimal floating point.
+Tue Sep 18 17:50:34 2007 -0700 H. Peter Anvin 
+  * Unify all standard IEEE floating-point formats; add 128-bit
+Tue Sep 18 17:49:09 2007 -0700 H. Peter Anvin 
+  * Fix handling of DO; support unary + for floating-point numbers
+Tue Sep 18 16:39:03 2007 -0700 H. Peter Anvin 
+  * Support 16-bit IEEE floating point; used in SSE5
+Tue Sep 18 15:43:40 2007 -0700 H. Peter Anvin 
+  * Merge commit 'origin/master' into sse5
+Tue Sep 18 15:43:08 2007 -0700 H. Peter Anvin 
+  * Add NOP with argument to the instruction list
+Tue Sep 18 15:24:38 2007 -0700 H. Peter Anvin 
+  * Remove 0FC2 from list of instruction prefixes
+Tue Sep 18 15:08:20 2007 -0700 H. Peter Anvin 
+  * Speed up the disassembler by allowing prefixed instruction tables
+Tue Sep 18 13:45:12 2007 -0700 H. Peter Anvin 
+  * Document oword, do and reso
+Tue Sep 18 13:01:32 2007 -0700 H. Peter Anvin 
+  * Implement "oword" (128 bits) as a first-class size
+Tue Sep 18 12:38:07 2007 -0700 H. Peter Anvin 
+  * Change the token prehash function for better convergence
+Tue Sep 18 12:23:21 2007 -0700 H. Peter Anvin 
+  * SSE5 instruction table
+Tue Sep 18 02:06:09 2007 -0400 Frank Kotler 
+  * add "const" to output/outdbg.c
+Mon Sep 17 18:45:44 2007 -0700 H. Peter Anvin 
+  * Disassembler support for SSE5 instructions
+Mon Sep 17 17:27:46 2007 -0700 H. Peter Anvin 
+  * insns.dat: All SSE5 instructions are AMD
+Mon Sep 17 17:25:27 2007 -0700 H. Peter Anvin 
+  * Actually generate SSE5 instructions
+Mon Sep 17 16:55:04 2007 -0700 H. Peter Anvin 
+  * Initial support for generating DREX suffixes
+Mon Sep 17 16:31:33 2007 -0700 H. Peter Anvin 
+  * Fix a few instances of missing renumbers
+Mon Sep 17 16:20:45 2007 -0700 H. Peter Anvin 
+  * Enable IF_AR3
+Mon Sep 17 15:49:53 2007 -0700 H. Peter Anvin 
+  * Merge commit 'origin/master' into sse5
+Mon Sep 17 15:49:30 2007 -0700 H. Peter Anvin 
+  * Initial support for four arguments per instruction
+Mon Sep 17 15:48:32 2007 -0700 H. Peter Anvin 
+  * CLFLUSH: Neither an x64 instruction nor AMD
+Mon Sep 17 13:56:26 2007 -0700 H. Peter Anvin 
+  * Sort dependency lists
+Mon Sep 17 13:53:14 2007 -0700 H. Peter Anvin 
+  * Cleaner way to handle MSVC's _snprintf() underscore damage
+Mon Sep 17 13:19:25 2007 -0700 H. Peter Anvin 
+  * test/r13.asm: test special-casing of rbp and r13 in 64-bit mode
+Mon Sep 17 13:03:33 2007 -0700 H. Peter Anvin 
+  * Additional documentation for 64-bit programming
+Sun Sep 16 22:27:07 2007 -0700 H. Peter Anvin 
+  * INSTALL: MSVC++ compilation instructions
+Sun Sep 16 22:17:29 2007 -0700 H. Peter Anvin 
+  * make alldeps: change Mkfiles/Makefile.* to Mkfiles/*.mak
+Sun Sep 16 22:16:24 2007 -0700 H. Peter Anvin 
+  * Fix Makefile for MSVC++ 2005, delete obsolete Makefiles
+Sun Sep 16 22:15:34 2007 -0700 H. Peter Anvin 
+  * Minor fixes needed to compile with MSVC++ 2005
+Sun Sep 16 18:35:02 2007 -0700 H. Peter Anvin 
+  * Run "make alldeps"
+Sun Sep 16 18:04:57 2007 -0700 H. Peter Anvin 
+  * Switch the preprocessor over to using the hash table library
+Sun Sep 16 17:53:17 2007 -0700 H. Peter Anvin 
+  * Fix the handling of local labels
+Fri Sep 14 18:36:01 2007 -0700 H. Peter Anvin 
+  * preproc.c: remove unnecessary int64_t
+Fri Sep 14 18:03:29 2007 -0700 H. Peter Anvin 
+  * Use the new hash table function library to store labels
+Fri Sep 14 09:24:38 2007 -0700 H. Peter Anvin 
+  * Define a proper hash table library
+Thu Sep 13 18:13:20 2007 -0700 H. Peter Anvin 
+  * Simple performance benchmarks: label, macro and token lookups
+Thu Sep 13 12:25:32 2007 -0700 H. Peter Anvin 
+  * release script: fix final cleanup
+Thu Sep 13 12:22:00 2007 -0700 H. Peter Anvin 
+  * Modify release script for a git-centric world
+Thu Sep 13 11:06:42 2007 -0700 H. Peter Anvin 
+  * pptok.c: don't insist on C99 compiler behaviour
+Wed Sep 12 22:02:06 2007 -0700 H. Peter Anvin 
+  * Fix literal F2 and F3 prefixes
+Wed Sep 12 21:58:51 2007 -0700 H. Peter Anvin 
+  * Add (untested!) SSSE3, SSE4.1, SSE4.2 instructions
+Wed Sep 12 21:06:36 2007 -0700 H. Peter Anvin 
+  * Add support for Tejas New Instructions (SSSE3)
+Wed Sep 12 21:05:06 2007 -0700 H. Peter Anvin 
+  * Remove $Id$ tags (useless with git)
+Wed Sep 12 21:04:58 2007 -0700 H. Peter Anvin 
+  * Use rm32 operands for VMREAD/VMWRITE
+Wed Sep 12 21:04:51 2007 -0700 H. Peter Anvin 
+  * Macros for SSSE3/SSE4 instruction sets
+Wed Sep 12 21:04:39 2007 -0700 H. Peter Anvin 
+  * Support r/m operands for non-integer types
+Wed Sep 12 20:27:41 2007 -0700 H. Peter Anvin 
+  * Use enumerations where practical to ease debugging
+Wed Sep 12 17:02:55 2007 +0000 H. Peter Anvin 
+  * pptok.c: quick-and-dirty downcasing during prehashing
+Wed Sep 12 16:55:57 2007 +0000 H. Peter Anvin 
+  * phash: Tell the user when the graph is OK
+Wed Sep 12 05:18:20 2007 +0000 H. Peter Anvin 
+  * pptok.c: handle holes in the pp_directives array
+Wed Sep 12 04:20:08 2007 +0000 H. Peter Anvin 
+  * preproc.c: adjust whitespace
+Wed Sep 12 04:18:37 2007 +0000 H. Peter Anvin 
+  * More automation in the preprocessor conditionals handling
+Wed Sep 12 02:13:39 2007 +0000 H. Peter Anvin 
+  * pptok.c: fix spacing
+Wed Sep 12 02:12:07 2007 +0000 H. Peter Anvin 
+  * Generate automatically correct tests for %if and %elif
+Wed Sep 12 01:34:19 2007 +0000 H. Peter Anvin 
+  * Run "make alldeps"; add dependencies missing from the previous checkin
+Wed Sep 12 01:29:43 2007 +0000 H. Peter Anvin 
+  * Use a perfect hash to look up preprocessor directives
+Wed Sep 12 01:27:53 2007 +0000 H. Peter Anvin 
+  * phash: Be a bit more aggressive about trying to make a small hash
+Wed Sep 12 00:22:29 2007 +0000 H. Peter Anvin 
+  * Add RCXZ as a known preprocessor condition
+Tue Sep 11 23:57:23 2007 +0000 H. Peter Anvin 
+  * doc: add some cross-references
+Tue Sep 11 23:52:01 2007 +0000 H. Peter Anvin 
+  * Feeble attempt at updating the documentation; remove Appendix B
+Tue Sep 11 22:44:03 2007 +0000 H. Peter Anvin 
+  * Handle instructions which can have both REX.W and OSP
+Tue Sep 11 22:14:18 2007 +0000 H. Peter Anvin 
+  * Use enums to make debugging easier
+Tue Sep 11 22:13:17 2007 +0000 H. Peter Anvin 
+  * ndisasm: handle \366 codes, prefer unprefixed instructions
+Tue Sep 11 22:00:34 2007 +0000 H. Peter Anvin 
+  * Simplify tokens.dat slightly
+Tue Sep 11 04:26:44 2007 +0000 H. Peter Anvin 
+  * Quiet gcc warning about uninitialized variables
+Tue Sep 11 04:16:57 2007 +0000 H. Peter Anvin 
+  * Make the big instruction arrays "const"
+Mon Sep 10 23:32:05 2007 +0000 H. Peter Anvin 
+  * Use an actual enum for the opcode
+Mon Sep 10 23:30:21 2007 +0000 H. Peter Anvin 
+  * Fix order of token arguments
+Mon Sep 10 18:59:26 2007 +0000 H. Peter Anvin 
+  * assemble.c: correct special handing of ESP/RSP
+Mon Sep 10 18:59:01 2007 +0000 H. Peter Anvin 
+  * tokhash: correct duplicate-token test
+Mon Sep 10 18:58:40 2007 +0000 H. Peter Anvin 
+  * tokhash: adjust table types to reduce size
+Mon Sep 10 18:55:52 2007 +0000 H. Peter Anvin 
+  * Fix the MMXREG and XMMREG flags definitions.
+Wed Sep 5 06:48:38 2007 +0000 H. Peter Anvin 
+  * nasm.spec.in: Copyright -> License
+Wed Sep 5 06:40:51 2007 +0000 H. Peter Anvin 
+  * Fix "make tar"; useful for RPM testing
+Wed Sep 5 06:24:43 2007 +0000 H. Peter Anvin 
+  * Remove obsolete Serial: construct; we shouldn't need it anyway.
+Tue Sep 4 01:29:43 2007 +0000 Chuck Crayne 
+  * Provide 64-bit support for ORG directive
+Sun Sep 2 16:37:03 2007 +0000 H. Peter Anvin 
+  * Fix some MMX/SSE irregularities which interact with the 64-bit support
+Sun Sep 2 14:46:00 2007 +0000 H. Peter Anvin 
+  * phash.ph: yet another attempt at getting Perl to behave, arithmetically
+Sun Sep 2 06:23:29 2007 +0000 H. Peter Anvin 
+  * Simple 64-bit org test
+Sun Sep 2 06:20:15 2007 +0000 H. Peter Anvin 
+  * phash.ph: remove some stale code
+Sun Sep 2 01:00:34 2007 +0000 Chuck Crayne 
+  * Force use of integer values for generating hash keys.
+Fri Aug 31 18:10:23 2007 +0000 H. Peter Anvin 
+  * phash: don't rely on the build platform Perl version of rand()
+Fri Aug 31 07:31:51 2007 +0000 H. Peter Anvin 
+  * tokhash.pl: formatting changes for readability
+Fri Aug 31 07:23:31 2007 +0000 H. Peter Anvin 
+  * tokhash: Speed up the rejection of unhashed values
+Fri Aug 31 06:06:17 2007 +0000 H. Peter Anvin 
+  * tokhash.pl: "ix" should have the same width as the "hash" arrays
+Fri Aug 31 00:28:35 2007 +0000 H. Peter Anvin 
+  * Add "do not edit" comment to tokhash.c
+Fri Aug 31 00:23:40 2007 +0000 H. Peter Anvin 
+  * Make the token hash a bit smaller by using 16-bit hash tables
+Fri Aug 31 00:16:10 2007 +0000 H. Peter Anvin 
+  * Minor cleanup; remove duplication of names.c
+Thu Aug 30 23:42:39 2007 +0000 H. Peter Anvin 
+  * phash.ph: use a bipartite graph to reduce the storage requirements
+Thu Aug 30 22:35:34 2007 +0000 H. Peter Anvin 
+  * Finishing touches on perfect hash tokenizer; actually turn the thing on
+Thu Aug 30 21:50:20 2007 +0000 H. Peter Anvin 
+  * Makefile rule for tokhash.c
+Thu Aug 30 21:47:46 2007 +0000 H. Peter Anvin 
+  * tokens.dat: Data file containing alphanumeric tokens not in other .dats
+Thu Aug 30 21:45:56 2007 +0000 H. Peter Anvin 
+  * Generate a perfect hash for the token parser
+Thu Aug 30 21:40:08 2007 +0000 H. Peter Anvin 
+  * Fix bugs in repeated suffix handling, which led to missing r8d/r8w/r8d
+Thu Aug 30 21:39:37 2007 +0000 H. Peter Anvin 
+  * phash.ph: more powerful prehashing
+Thu Aug 30 20:15:25 2007 +0000 H. Peter Anvin 
+  * Make the perfect hash generator an includable module
+Wed Aug 29 20:30:31 2007 +0000 H. Peter Anvin 
+  * Correct the logic for recording fs: and gs: overrides.
+Wed Aug 29 18:20:19 2007 +0000 H. Peter Anvin 
+  * Generate R_X86_64_64 relocations in elf64 output
+Wed Aug 29 17:24:03 2007 +0000 H. Peter Anvin 
+  * Add README file
+Wed Aug 29 17:20:09 2007 +0000 H. Peter Anvin 
+  * Create a Perl library directory, and add the Graph module to it
+Wed Aug 29 17:05:17 2007 +0000 H. Peter Anvin 
+  * Perfect hash generator, as a perl script
+Wed Aug 29 16:41:43 2007 +0000 H. Peter Anvin 
+  * Use standard macro for the default directive
+Wed Aug 29 16:40:26 2007 +0000 H. Peter Anvin 
+  * Add standard macro for [default] directive
+Wed Aug 29 16:38:47 2007 +0000 H. Peter Anvin 
+  * More test cases for rel and abs addressing
+Wed Aug 29 16:38:05 2007 +0000 H. Peter Anvin 
+  * Add [default] directive
+Wed Aug 29 16:25:46 2007 +0000 H. Peter Anvin 
+  * nasmlib: add bsii() case-insensitive version of bsi()
+Wed Aug 29 15:49:53 2007 +0000 H. Peter Anvin 
+  * Add test cases for IP-relative addressing
+Wed Aug 29 15:19:19 2007 +0000 H. Peter Anvin 
+  * Suppress IP-relative only for fs: and gs: overrides
+Tue Aug 28 23:06:00 2007 +0000 H. Peter Anvin 
+  * Implement REL/ABS modifiers
+Sun Aug 26 05:51:39 2007 +0000 Frank Kotler 
+  * attempt to make static makefiles aware of outelf32/outelf64
+Sun Aug 26 05:48:54 2007 +0000 Frank Kotler 
+  * add nasm_strsep to nasmlib, for output/outmacho.c - strtok doesn't work
+Sun Aug 26 05:41:33 2007 +0000 Frank Kotler 
+  * remove "#include <unistd.h> from rdoff directory - two places - it annoyed Windows users and seems unneeded
+Sun Aug 26 05:10:24 2007 +0000 Frank Kotler 
+  * finally commit Mike Frysinger's "elf-visibility" patch
+Mon Aug 20 21:03:14 2007 +0000 H. Peter Anvin 
+  * regs.pl: handle dashed sequences with suffixes
+Mon Aug 20 20:10:04 2007 +0000 H. Peter Anvin 
+  * sync.c: change ULONG_MAX to UINT32_MAX
+Mon Aug 20 20:09:11 2007 +0000 H. Peter Anvin 
+  * Add _MIN and _MAX macros for the fixed-size types.
+Mon Aug 20 20:02:17 2007 +0000 H. Peter Anvin 
+  * ldrdf: cast output of sizeof() before passing to printf(), to avoid warning.
+Sun Aug 19 18:49:26 2007 +0000 Keith Kanios 
+  * Fixed RIP address processing ambiguity found by Charles Crayne.
+Fri Aug 17 07:37:52 2007 +0000 Keith Kanios 
+  * Fixed issues with REX prefix effective address generation. Fixed XMM instruction output.
+Fri Aug 17 02:03:10 2007 +0000 Keith Kanios 
+  * Changed MMXREG and XMMREG flags to help resolve invalid REX prefix generation for MMX instructions.
+Sat Jul 7 02:01:08 2007 +0000 H. Peter Anvin 
+  * More int/int32_t confusion
+Sat Jul 7 01:59:52 2007 +0000 H. Peter Anvin 
+  * regflag() should return int32_t.
+Thu Jun 21 19:00:12 2007 +0000 H. Peter Anvin 
+  * Detect missing <inttypes.h> and include ersatz version if missing
+Thu Jun 21 06:24:23 2007 +0000 H. Peter Anvin 
+  * inttypes.h: for older preprocessors, specify L and LL as appropriate
+Thu Jun 21 06:20:43 2007 +0000 H. Peter Anvin 
+  * inttypes.h: Fix spelling of SHRT_MAX
+Thu Jun 21 06:15:42 2007 +0000 H. Peter Anvin 
+  * inttypes.h: do a single ersatz <inttypes.h> based on <limits.h>
+Sun Jun 3 02:42:41 2007 +0000 Chuck Crayne 
+  * Support 32-bit direct addressing in 64-bit mode without base or index regs
+Sat Jun 2 02:26:21 2007 +0000 H. Peter Anvin 
+  * Fix the [U]INT*_C() creation macros
+Sat Jun 2 00:05:35 2007 +0000 H. Peter Anvin 
+  * For platforms that don't have them, provide <inttypes.h> for common models.
+Wed May 30 22:21:11 2007 +0000 H. Peter Anvin 
+  * Fix the handling of the \313 code.
+Wed May 30 22:20:01 2007 +0000 H. Peter Anvin 
+  * Machine-generated \321->\324 corrections
+Wed May 30 21:22:33 2007 +0000 Frank Kotler 
+  * update "version" to 0.99.02
+Wed May 30 20:30:15 2007 +0000 H. Peter Anvin 
+  * Correct the generation of 67 prefixes.
+Wed May 30 18:30:18 2007 +0000 H. Peter Anvin 
+  * Update dependencies.
+Wed May 30 16:34:29 2007 +0000 Frank Kotler 
+  * update cvs server name in misc/release script
+Wed May 30 04:28:50 2007 +0000 H. Peter Anvin 
+  * Avoid magic values; we have more than 124 registers now
+Wed May 30 04:27:58 2007 +0000 H. Peter Anvin 
+  * Remove bogus redundant tests
+Wed May 30 03:44:50 2007 +0000 H. Peter Anvin 
+  * More \321 -> \324
+Wed May 30 03:44:02 2007 +0000 H. Peter Anvin 
+  * Remove bogus check for 64-bitness
+Wed May 30 03:25:21 2007 +0000 H. Peter Anvin 
+  * Get rid of magic open-coded "register numbers"
+Wed May 30 02:48:51 2007 +0000 H. Peter Anvin 
+  * MOV reg64,reg64 takes \324 (64 bit with REX) not \321 (32 bit)
+Wed May 30 00:18:26 2007 +0000 H. Peter Anvin 
+  * Rename REGNORM to REG_EA
+Wed May 30 00:15:25 2007 +0000 H. Peter Anvin 
+  * More instruction flag surgery
+Wed May 30 00:05:00 2007 +0000 H. Peter Anvin 
+  * More cleanup of operand flags/register classes
+Tue May 29 23:57:12 2007 +0000 H. Peter Anvin 
+  * Clean up the existing operand flag definitions, and document
+Tue May 29 21:44:55 2007 +0000 H. Peter Anvin 
+  * Run "make alldeps"
+Thu May 24 22:33:07 2007 +0000 Frank Kotler 
+  * update version number to 0.99.01
+Tue May 15 04:33:43 2007 +0000 H. Peter Anvin 
+  * regs.dat: fix comment
+Fri May 4 18:47:16 2007 +0000 H. Peter Anvin 
+  * 16-bit relocations are standard in ELF64 (at my request, incidentally)
+Fri May 4 02:16:08 2007 +0000 Chuck Crayne 
+  * Addition of elf32 and elf64 output formats.
+Wed May 2 04:21:26 2007 +0000 Chuck Crayne 
+  * Allow '!' to be used in expressions with same meaning as in C.
+Wed May 2 01:59:16 2007 +0000 Chuck Crayne 
+  * Add %IFN and %ELIFN as per RFE #786286
+Mon Apr 30 22:26:58 2007 +0000 Chuck Crayne 
+  * Accept responsibility for support of outelf64.c
+Sun Apr 29 20:57:53 2007 +0000 Chuck Crayne 
+  * Clarify comments about relocation entries.
+Sun Apr 29 00:28:24 2007 +0000 Chuck Crayne 
+  * Allow ELF32 to be invoked either as -f elf or -f elf32
+Sat Apr 28 22:18:04 2007 +0000 Chuck Crayne 
+  * Eliminate shift count warnings when building on 32-bit systems
+Sat Apr 28 06:18:48 2007 +0000 Chuck Crayne 
+  * Initial support for ELF64
+Wed Apr 18 02:27:18 2007 +0000 H. Peter Anvin 
+  * Fix the handling of \324 for computing the length
+Wed Apr 18 02:24:34 2007 +0000 Keith Kanios 
+  * Fixed RDF/2 to comply with "maxbits" use.
+Tue Apr 17 20:23:11 2007 +0000 H. Peter Anvin 
+  * Handle "LOCK as REX.R" for MOV CRx; fix warning for invalid 64-bit regs
+Mon Apr 16 18:16:46 2007 +0000 Keith Kanios 
+  * MEM_OFFSET Instructions Fixed.
+Mon Apr 16 15:46:46 2007 +0000 Keith Kanios 
+  * Fixed 64-bit Mode Segment Selection.
+Mon Apr 16 14:31:54 2007 +0000 Keith Kanios 
+  * Fixed distinction between [LOCAL]SYMBOL/IMMEDIATE for RIP-relative addressing.
+Mon Apr 16 14:05:01 2007 +0000 Keith Kanios 
+  * Fixed long mode MEM_OFFS issue.
+Mon Apr 16 13:54:49 2007 +0000 Keith Kanios 
+  * Filled in all RIP Register Flags.
+Mon Apr 16 05:26:29 2007 +0000 H. Peter Anvin 
+  * More \321 -> \324 for 64-bit instructions
+Mon Apr 16 04:56:06 2007 +0000 Keith Kanios 
+  * Fixed 64-bit offset generation.
+Mon Apr 16 02:39:56 2007 +0000 H. Peter Anvin 
+  * More 64-bit ndisasm fixes.
+Mon Apr 16 02:02:06 2007 +0000 H. Peter Anvin 
+  * Fixes for 64-bit ndisasm.
+Mon Apr 16 01:21:29 2007 +0000 H. Peter Anvin 
+  * Use + instead of * for extension; it feels cleaner with the new meaning.
+Mon Apr 16 01:18:30 2007 +0000 H. Peter Anvin 
+  * Initial 64-bit support for ndisasm.  Still a work in progress.
+Sun Apr 15 23:12:17 2007 +0000 H. Peter Anvin 
+  * Clean up the 64-bitification of regs.dat for 64-bit ndisasm support
+Sun Apr 15 23:10:26 2007 +0000 H. Peter Anvin 
+  * Remove @GCCFLAGS@
+Sun Apr 15 23:09:23 2007 +0000 H. Peter Anvin 
+  * CR8 is not special in any way as far as the assembler is concerned.
+Sun Apr 15 23:03:28 2007 +0000 H. Peter Anvin 
+  * Get rid of @GCCFLAGS@
+Sun Apr 15 22:45:25 2007 +0000 H. Peter Anvin 
+  * Cleaner way to add gcc options
+Sun Apr 15 22:08:30 2007 +0000 Keith Kanios 
+  * Fixed distinction between RIP relative symbols and immediate values.
+Sun Apr 15 05:40:43 2007 +0000 H. Peter Anvin 
+  * Fix the register number for CR7 (it was using the same number as CR15).
+Sun Apr 15 05:32:18 2007 +0000 H. Peter Anvin 
+  * More perl-like idioms for generating regdis.c
+Sun Apr 15 01:37:13 2007 +0000 Keith Kanios 
+  * Fixed regdis.c generation.
+Sat Apr 14 18:54:52 2007 +0000 Keith Kanios 
+  * Added DQ constants for all BITS modes.
+Sat Apr 14 08:03:02 2007 +0000 H. Peter Anvin 
+  * outmacho.c: stylistic cleanups
+Sat Apr 14 03:52:05 2007 +0000 Keith Kanios 
+  * Fixed support for DQ constants in long mode.
+Sat Apr 14 03:44:31 2007 +0000 Keith Kanios 
+  * Hopefully it is actually fixed this time :P
+Sat Apr 14 01:49:07 2007 +0000 Keith Kanios 
+  * Fixed structure initialization issue.
+Sat Apr 14 01:44:35 2007 +0000 Keith Kanios 
+  * Refixed uninitialized data.
+Sat Apr 14 01:40:24 2007 +0000 Keith Kanios 
+  * Fixed uninitialized structure data.
+Sat Apr 14 01:24:14 2007 +0000 Keith Kanios 
+  * c99 printf/fprintf compliance.
+Sat Apr 14 00:46:25 2007 +0000 Keith Kanios 
+  * Placated unreferenced types.
+Sat Apr 14 00:10:59 2007 +0000 Keith Kanios 
+  * c99 printf/fprintf compliance.
+Fri Apr 13 23:09:18 2007 +0000 Keith Kanios 
+  * Added outmacho.* to static makefile.
+Fri Apr 13 22:24:46 2007 +0000 Keith Kanios 
+  * Fixed REGRIP -> RIPREG to match regs.dat.
+Fri Apr 13 22:07:53 2007 +0000 Keith Kanios 
+  * Fixed obj_fwrite() declaration to match "static" definition.
+Fri Apr 13 22:03:24 2007 +0000 Keith Kanios 
+  * Added appropriate "void" prototypes.
+Fri Apr 13 22:00:42 2007 +0000 Keith Kanios 
+  * Replaced str(n)casecmp with more standard str(n)icmp.
+Fri Apr 13 20:06:41 2007 +0000 H. Peter Anvin 
+  * AIf we have config.h, we should actually include it!!
+Fri Apr 13 19:59:20 2007 +0000 H. Peter Anvin 
+  * When compiling with gcc, compile with -W -Wall for maximum warnings.
+Fri Apr 13 19:58:42 2007 +0000 H. Peter Anvin 
+  * Macroize any compiler-specific code; macros defined in "compiler.h"
+Fri Apr 13 16:47:53 2007 +0000 Keith Kanios 
+  * Fixed distinction between char and int8_t data types.
+Fri Apr 13 01:17:45 2007 +0000 Keith Kanios 
+  * Comment "REX.I" should have been "REX.X"
+Fri Apr 13 00:52:54 2007 +0000 Keith Kanios 
+  * Fixed c99 data-types after removal of typedefs.
+Fri Apr 13 00:43:50 2007 +0000 Keith Kanios 
+  * Added Dev-Cpp Makefile
+Fri Apr 13 00:38:29 2007 +0000 Keith Kanios 
+  * *** empty log message ***
+Thu Apr 12 17:58:02 2007 +0000 H. Peter Anvin 
+  * Remove redundant inclusion of <inttypes.h>
+Thu Apr 12 16:54:50 2007 +0000 H. Peter Anvin 
+  * Remove obsolete types; add <inttypes.h> where needed; header fixes
+Thu Apr 12 16:25:58 2007 +0000 H. Peter Anvin 
+  * autogen.sh script to create configure, et al.
+Thu Apr 12 16:23:11 2007 +0000 Keith Kanios 
+  * Fixed c99 support for RDOFF Tools
+Thu Apr 12 16:12:09 2007 +0000 H. Peter Anvin 
+  * outmacho.c: Don't assume __builtin_ctzl exists for gcc < 4
+
+  * Get rid of @GCCFLAGS@
+Sun Apr 15 22:45:25 2007 +0000 H. Peter Anvin 
+  * Cleaner way to add gcc options
+Sun Apr 15 22:08:30 2007 +0000 Keith Kanios 
+  * Fixed distinction between RIP relative symbols and immediate values.
+Sun Apr 15 05:40:43 2007 +0000 H. Peter Anvin 
+  * Fix the register number for CR7 (it was using the same number as CR15).
+Sun Apr 15 05:32:18 2007 +0000 H. Peter Anvin 
+  * More perl-like idioms for generating regdis.c
+Sun Apr 15 01:37:13 2007 +0000 Keith Kanios 
+  * Fixed regdis.c generation.
+Sat Apr 14 18:54:52 2007 +0000 Keith Kanios 
+  * Added DQ constants for all BITS modes.
+Sat Apr 14 08:03:02 2007 +0000 H. Peter Anvin 
+  * outmacho.c: stylistic cleanups
+Sat Apr 14 03:52:05 2007 +0000 Keith Kanios 
+  * Fixed support for DQ constants in long mode.
+Sat Apr 14 03:44:31 2007 +0000 Keith Kanios 
+  * Hopefully it is actually fixed this time :P
+Sat Apr 14 01:49:07 2007 +0000 Keith Kanios 
+  * Fixed structure initialization issue.
+Sat Apr 14 01:44:35 2007 +0000 Keith Kanios 
+  * Refixed uninitialized data.
+Sat Apr 14 01:40:24 2007 +0000 Keith Kanios 
+  * Fixed uninitialized structure data.
+Sat Apr 14 01:24:14 2007 +0000 Keith Kanios 
+  * c99 printf/fprintf compliance.
+Sat Apr 14 00:46:25 2007 +0000 Keith Kanios 
+  * Placated unreferenced types.
+Sat Apr 14 00:10:59 2007 +0000 Keith Kanios 
+  * c99 printf/fprintf compliance.
+Fri Apr 13 23:09:18 2007 +0000 Keith Kanios 
+  * Added outmacho.* to static makefile.
+Fri Apr 13 22:24:46 2007 +0000 Keith Kanios 
+  * Fixed REGRIP -> RIPREG to match regs.dat.
+Fri Apr 13 22:07:53 2007 +0000 Keith Kanios 
+  * Fixed obj_fwrite() declaration to match "static" definition.
+Fri Apr 13 22:03:24 2007 +0000 Keith Kanios 
+  * Added appropriate "void" prototypes.
+Fri Apr 13 22:00:42 2007 +0000 Keith Kanios 
+  * Replaced str(n)casecmp with more standard str(n)icmp.
+Fri Apr 13 20:06:41 2007 +0000 H. Peter Anvin 
+  * AIf we have config.h, we should actually include it!!
+Fri Apr 13 19:59:20 2007 +0000 H. Peter Anvin 
+  * When compiling with gcc, compile with -W -Wall for maximum warnings.
+Fri Apr 13 19:58:42 2007 +0000 H. Peter Anvin 
+  * Macroize any compiler-specific code; macros defined in "compiler.h"
+Fri Apr 13 16:47:53 2007 +0000 Keith Kanios 
+  * Fixed distinction between char and int8_t data types.
+Fri Apr 13 01:17:45 2007 +0000 Keith Kanios 
+  * Comment "REX.I" should have been "REX.X"
+Fri Apr 13 00:52:54 2007 +0000 Keith Kanios 
+  * Fixed c99 data-types after removal of typedefs.
+Fri Apr 13 00:43:50 2007 +0000 Keith Kanios 
+  * Added Dev-Cpp Makefile
+Fri Apr 13 00:38:29 2007 +0000 Keith Kanios 
+  * *** empty log message ***
+Thu Apr 12 17:58:02 2007 +0000 H. Peter Anvin 
+  * Remove redundant inclusion of <inttypes.h>
+Thu Apr 12 16:54:50 2007 +0000 H. Peter Anvin 
+  * Remove obsolete types; add <inttypes.h> where needed; header fixes
+Thu Apr 12 16:25:58 2007 +0000 H. Peter Anvin 
+  * autogen.sh script to create configure, et al.
+Thu Apr 12 16:23:11 2007 +0000 Keith Kanios 
+  * Fixed c99 support for RDOFF Tools
+Thu Apr 12 16:12:09 2007 +0000 H. Peter Anvin 
+  * outmacho.c: Don't assume __builtin_ctzl exists for gcc < 4
+2007-04-10  Keith Kanios <keith@kanios.net>
+   * (insns.dat): updated x86-64 general+system instruction set.
+
+2007-04-09  Keith Kanios <keith@kanios.net>
+   * (outrdf.c): added support for 64-bit addressing.
+   * (outrdf2.c): added support for 64-bit addressing.
+
+2007-04-08  Keith Kanios <keith@kanios.net>
+   * (standard.mac): added entry for __BITS__ standard macro.
+   * (preproc.c): added __BITS__ to the standard macro processing.
+
+2007-04-05  Keith Kanios <keith@kanios.net>
+   * (nasm.c): added [BITS 64] for the x86-64 architecture extension.
+   * (nasm.h): added general flags to support the x86-64 architecture.
+   * (nasmlib.h): updated to support the x86-64 architecture.
+   * (nasmlib.c): revamped readnum/readlinenum to support 64-bit.
+   * (assemble.c): modified for the x86-64 architecture extension.
+   * (regs.dat): added x86-64 register extensions; revamped flags.
+   * (insns.dat): added AMD64 instruction set support.
+   * (outbin.c): added support for 64-bit addressing.
+   * (outcoff.c): added win64 (x86-64 COFF) support.
+   * (outform.h): added entry for win64.
+
+2007-03-15  Keith Kanios <keith@kanios.net>
+   * (*.c): added c99 data-type compliance and <inttypes.h> inclusion.
+   * (*.pl): added c99 data-type compliance and <inttypes.h> inclusion.
+   * (*.h): added c99 data-type compliance.
+   * (assemble.h): fixed procedure defintions to sync with respective
+   procedure declarations.
+
+2002-05-16  Ed Beroset <beroset@mindspring.com>
+   * (preproc.c): fixed unterminated macro bug error reporting
+   * (nasmlib.h): changed strdup's arg to const char *
+   * (nasmlib.c): changed strdup's arg to const char *
+
+2002-05-12  Debbie Wiles <debs@dwiles.demon.co.uk>
+   * (insns.dat): fixed incorrect processor flags
+   * (Mkfiles/Makefile.vc): added optimisation, and changed to work with 0.98.31
+   * (doc/nasmdoc.src): added %ifmacro, and tidied up format of code items.
+
+2002-05-03  H. Peter Anvin <hpa@zytor.com>
+   * (nasm.c): Change the NASM environment variable to NASMOPT.
+
+2002-05-03  H. Peter Anvin <hpa@zytor.com>
+   * (Makefile.in Mkfiles/*): use new version -> version.{h,mac}.
+   * (macros.pl): support multiple input files (standard.mac, version.mac).
+   * (standard.mac): use an explicit delimiter to end the TASM macros.
+   * (nasm-version): remove, no longer needed.
+   * (version.pl): script to produce version.h and version.mac from version.
+   * (version): contains the official NASM version.
+   * (nasm.h): include version.h.
+
+2002-05-03  H. Peter Anvin <hpa@zytor.com>
+
+   * (configure.in): create output directory.
+   * (Makefile.in): change cd ; to cd &&.
+   * (rdoff/Makefile.in): handle building in a separate obj directory
+     correctly.
+       
+2002-04-29  Stanislav Karchebny  <madfire@users.sourceforge.net>
+
+   * (Makefile.in): added 'strip' target to strip debug info.
+   * (INSTALL): added INSTALL file.
+   * (nasm.1): added -v option description.
+
+
+2002-04-29  Frank Kotler  <fbkotler@users.sourceforge.net>
+
+   * (parser.c): fixed INCBIN bug reported by Rebel.
+
+
+2002-04-11  Stanislav Karchebny  <madfire@users.sourceforge.net>
+
+   * Started ChangeLog for recording per-file changes in the project.
+     We could get away without ChangeLog at all (use CVS logs), but we
+     lose CVS so often its better to have log glued to the sources =)
+     You should record changes in CHANGES also, not for every change
+     but rather when making a release.
+
diff --git a/INSTALL b/INSTALL
new file mode 100644 (file)
index 0000000..d184982
--- /dev/null
+++ b/INSTALL
@@ -0,0 +1,102 @@
+1. Installing NASM from source (Unix, MacOS X; Windows - Cygwin;
+   Windows - MinGW; DOS - DJGPP)
+2. Installing NASM from source (Windows - MS Visual C++)
+3. Installing NASM from source (DOS, Windows, OS/2 - OpenWatcom)
+
+
+1. Installing NASM from source (Unix, MacOS X; Windows - Cygwin;
+   Windows - MinGW; DOS - DJGPP)
+================================================================
+
+Installing NASM is pretty straightforward on Unix or Unix-like systems
+with a C compiler, Make, and standard shell tools installed, including
+MinGW for Windows (with MSYS installed) and DJGPP for DOS with the
+appropriate tools.  Perl is not required for compiling unmodified
+sources from a tarball, but is required to build from git or for most
+source modifications.
+
+If you checked out source from git you will need to run autoconf to
+generate configure, otherwise you don't have to.
+
+$ sh autogen.sh
+
+Then run configure to detect your platform settings and generate makefiles.
+
+$ sh configure
+
+You can get information about available configuration options by
+running `sh configure --help`.
+
+If configure fails, please file a bug report with detailed platform
+information at:
+
+    http://www.sf.net/projects/nasm/
+
+If everything went okay, type
+
+$ make
+
+to build NASM, ndisasm and rdoff tools, or
+
+$ make everything
+
+to build the former plus the docs.
+
+You can decrease the size of produces executables by stripping off
+unnecessary information, to achieve this run
+
+$ make strip
+
+If you install to a system-wide location you might need to become
+root:
+
+$ su <enter root password>
+
+then
+
+$ make install
+
+optionally followed by 
+
+$ make install_rdf
+
+Or you can 
+
+$ make install_everything
+
+to install everything =)
+
+
+Thats it, enjoy!
+
+
+2. Installing NASM from source (Windows - MS Visual C++)
+========================================================
+
+The recommended compiler for NASM on Windows is MinGW
+(http://www.mingw.org/), but it is also possible to compile with
+Microsoft Visual C++ (tested with Visual C++ 2005 Express Edition.)
+
+To do so, start the "Visual C++ Command Shell", go to the directory
+where the NASM source code was extracted, and run:
+
+> nmake /f Mkfiles/msvc.mak
+
+We recommend MinGW over Visual C++ 2005 as we have found it to be more
+up to date with regards to C99 compliance, and we are increasingly
+using C99 features in NASM.
+
+
+3. Installing NASM from source (DOS, Windows, OS/2 - OpenWatcom)
+================================================================
+
+NASM has been reported to build correctly with OpenWatcom 1.7 on the
+Windows and OS/2 platforms.  In addition, it *should* work under DOS
+with the DOS4GW DOS extender, although the NASM developers recommend
+using DJGPP with the CWSDPMI DOS extender instead.
+
+A WMAKE make file is provided:
+
+> wmake -f Mkfiles\openwcom.mak <platform>
+
+... where <platform> is "dos", "win32" or "os2".
diff --git a/LICENSE b/LICENSE
new file mode 100644 (file)
index 0000000..f397b82
--- /dev/null
+++ b/LICENSE
@@ -0,0 +1,29 @@
+NASM is now licensed under the 2-clause BSD license, also known as the
+simplified BSD license.
+
+    Copyright 1996-2009 the NASM Authors - All rights reserved.
+
+    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.
diff --git a/Makefile.in b/Makefile.in
new file mode 100644 (file)
index 0000000..e8edf4a
--- /dev/null
@@ -0,0 +1,378 @@
+#
+# Auto-configuring Makefile for the Netwide Assembler.
+#
+# The Netwide Assembler is copyright (C) 1996 Simon Tatham and
+# Julian Hall. All rights reserved. The software is
+# redistributable under the license given in the file "LICENSE"
+# distributed in the NASM archive.
+
+top_srcdir     = @top_srcdir@
+srcdir         = @srcdir@
+VPATH          = @srcdir@
+prefix         = @prefix@
+exec_prefix    = @exec_prefix@
+bindir         = @bindir@
+mandir         = @mandir@
+datarootdir    = @datarootdir@
+
+CC             = @CC@
+CFLAGS         = @CFLAGS@
+BUILD_CFLAGS   = $(CFLAGS) @DEFS@
+INTERNAL_CFLAGS = -I$(srcdir) -I.
+ALL_CFLAGS     = $(BUILD_CFLAGS) $(INTERNAL_CFLAGS)
+LDFLAGS                = @LDFLAGS@
+LIBS           = @LIBS@
+PERL           = perl -I$(srcdir)/perllib
+
+XOBJS          = @XOBJS@
+
+INSTALL                = @INSTALL@
+INSTALL_PROGRAM        = @INSTALL_PROGRAM@
+INSTALL_DATA   = @INSTALL_DATA@
+
+NROFF          = @NROFF@
+
+MKDIR          = mkdir
+RM             = rm
+
+STRIP          = strip
+
+# Binary suffixes
+O               = @OBJEXT@
+X               = @EXEEXT@
+
+.SUFFIXES: .c .i .s .$(O) .1 .man
+
+.PHONY: all doc rdf install clean distclean cleaner spotless install_rdf
+.PHONY: install_doc everything install_everything strip perlreq dist
+
+.c.$(O):
+       $(CC) -c $(ALL_CFLAGS) -o $@ $<
+
+.c.s:
+       $(CC) -S $(ALL_CFLAGS) -o $@ $<
+
+.c.i:
+       $(CC) -E $(ALL_CFLAGS) -o $@ $<
+
+.1.man:
+       $(NROFF) -man $< > $@
+
+#-- Begin File Lists --#
+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/nullout.$(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/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) \
+       lib/strlcpy.$(O)
+
+NDISASM = ndisasm.$(O) disasm.$(O) sync.$(O) nasmlib.$(O) ver.$(O) \
+       insnsd.$(O) insnsb.$(O) insnsn.$(O) regs.$(O) regdis.$(O)
+#-- End File Lists --#
+
+all: nasm$(X) ndisasm$(X) nasm.man ndisasm.man
+       cd rdoff && $(MAKE) all
+
+nasm$(X): $(NASM) $(XOBJS)
+       $(CC) $(LDFLAGS) -o nasm$(X) $(NASM) $(XOBJS) $(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,
+# though, so it isn't necessary to have Perl just to recompile NASM
+# from the distribution.
+
+insnsb.c: insns.dat insns.pl
+       $(PERL) $(srcdir)/insns.pl -b $(srcdir)/insns.dat
+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
+version.sed: version version.pl
+       $(PERL) $(srcdir)/version.pl sed < $(srcdir)/version > version.sed
+version.mak: version version.pl
+       $(PERL) $(srcdir)/version.pl make < $(srcdir)/version > version.mak
+version.nsh: version version.pl
+       $(PERL) $(srcdir)/version.pl nsis < $(srcdir)/version > version.nsh
+
+# 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 pptok.ph standard.mac version.mac \
+       $(srcdir)/macros/*.mac $(srcdir)/output/*.mac
+       $(PERL) $(srcdir)/macros.pl $(srcdir)/standard.mac version.mac \
+               $(srcdir)/macros/*.mac $(srcdir)/output/*.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
+regdis.h: regs.dat regs.pl
+       $(PERL) $(srcdir)/regs.pl dh $(srcdir)/regs.dat > regdis.h
+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
+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)
+
+install: nasm$(X) ndisasm$(X)
+       $(MKDIR) -p $(INSTALLROOT)$(bindir)
+       $(INSTALL_PROGRAM) nasm$(X) $(INSTALLROOT)$(bindir)/nasm$(X)
+       $(INSTALL_PROGRAM) ndisasm$(X) $(INSTALLROOT)$(bindir)/ndisasm$(X)
+       $(MKDIR) -p $(INSTALLROOT)$(mandir)/man1
+       $(INSTALL_DATA) $(srcdir)/nasm.1 $(INSTALLROOT)$(mandir)/man1/nasm.1
+       $(INSTALL_DATA) $(srcdir)/ndisasm.1 $(INSTALLROOT)$(mandir)/man1/ndisasm.1
+
+clean:
+       $(RM) -f *.$(O) *.s *.i
+       $(RM) -f output/*.$(O) output/*.s output/*.i
+       $(RM) -f nasm$(X) ndisasm$(X)
+       cd rdoff && $(MAKE) clean
+
+distclean: clean
+       $(RM) -f config.h config.log config.status
+       $(RM) -f Makefile *~ *.bak *.lst *.bin
+       $(RM) -f output/*~ output/*.bak
+       $(RM) -f test/*.lst test/*.bin test/*.$(O) test/*.bin
+       $(RM) -rf autom4te*.cache
+       cd rdoff && $(MAKE) distclean
+
+cleaner: clean
+       $(RM) -f $(PERLREQ) *.man nasm.spec
+       cd doc && $(MAKE) clean
+
+spotless: distclean cleaner
+       $(RM) -f doc/Makefile doc/*~ doc/*.bak
+
+strip:
+       $(STRIP) --strip-unneeded nasm$(X) ndisasm$(X)
+
+rdf:
+       cd rdoff && $(MAKE)
+
+rdf_install install_rdf:
+       cd rdoff && $(MAKE) install
+
+doc:
+       cd doc && $(MAKE) all
+
+doc_install install_doc:
+       cd doc && $(MAKE) install
+
+everything: all doc rdf
+
+install_everything: everything install install_doc install_rdf
+
+dist: spotless perlreq spec
+       autoheader
+       autoconf
+       $(RM) -rf ./autom4te*.cache
+
+tar: dist
+       tar -cvj --exclude CVS -C .. -f ../nasm-`cat version`-`date +%Y%m%d`.tar.bz2 `basename \`pwd\``
+
+spec: nasm.spec
+
+nasm.spec: nasm.spec.in version.sed
+       sed -f version.sed < nasm.spec.in > nasm.spec
+
+splint:
+       splint -weak *.c
+
+test: nasm$(X)
+       cd test && $(PERL) performtest.pl --nasm=../nasm *.asm
+
+#
+# This build dependencies in *ALL* makefiles.  Partially for that reason,
+# it's expected to be invoked manually.
+#
+alldeps: perlreq
+       $(PERL) syncfiles.pl Makefile.in Mkfiles/*.mak
+       $(PERL) mkdep.pl -M Makefile.in Mkfiles/*.mak -- \
+               . output lib
+       ./config.status
+
+#-- Magic hints to mkdep.pl --#
+# @object-ending: ".$(O)"
+# @path-separator: "/"
+#-- Everything below is generated by mkdep.pl - do not edit --#
+assemble.$(O): assemble.c assemble.h compiler.h config.h directives.h \
+ insns.h insnsi.h nasm.h nasmlib.h opflags.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 opflags.h pptok.h preproc.h regs.h
+disasm.$(O): disasm.c compiler.h config.h directives.h disasm.h insns.h \
+ insnsi.h nasm.h nasmlib.h opflags.h pptok.h preproc.h regdis.h regs.h \
+ sync.h tables.h tokens.h
+eval.$(O): eval.c compiler.h config.h directives.h eval.h float.h insnsi.h \
+ labels.h nasm.h nasmlib.h opflags.h pptok.h preproc.h regs.h
+exprlib.$(O): exprlib.c compiler.h config.h directives.h insnsi.h nasm.h \
+ nasmlib.h opflags.h pptok.h preproc.h regs.h
+float.$(O): float.c compiler.h config.h directives.h float.h insnsi.h nasm.h \
+ nasmlib.h opflags.h pptok.h preproc.h regs.h
+hashtbl.$(O): hashtbl.c compiler.h config.h directives.h hashtbl.h insnsi.h \
+ nasm.h nasmlib.h opflags.h pptok.h preproc.h regs.h
+insnsa.$(O): insnsa.c compiler.h config.h directives.h insns.h insnsi.h \
+ nasm.h nasmlib.h opflags.h pptok.h preproc.h regs.h tokens.h
+insnsb.$(O): insnsb.c compiler.h config.h directives.h insns.h insnsi.h \
+ nasm.h nasmlib.h opflags.h pptok.h preproc.h regs.h tokens.h
+insnsd.$(O): insnsd.c compiler.h config.h directives.h insns.h insnsi.h \
+ nasm.h nasmlib.h opflags.h pptok.h preproc.h regs.h tokens.h
+insnsn.$(O): insnsn.c compiler.h config.h insnsi.h opflags.h tables.h
+labels.$(O): labels.c compiler.h config.h directives.h hashtbl.h insnsi.h \
+ nasm.h nasmlib.h opflags.h pptok.h preproc.h regs.h
+lib/snprintf.$(O): lib/snprintf.c compiler.h config.h nasmlib.h
+lib/strlcpy.$(O): lib/strlcpy.c compiler.h config.h
+lib/vsnprintf.$(O): lib/vsnprintf.c compiler.h config.h nasmlib.h
+listing.$(O): listing.c compiler.h config.h directives.h insnsi.h listing.h \
+ nasm.h nasmlib.h opflags.h pptok.h preproc.h regs.h
+macros.$(O): macros.c compiler.h config.h directives.h hashtbl.h insnsi.h \
+ nasm.h nasmlib.h opflags.h output/outform.h pptok.h preproc.h regs.h \
+ tables.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 opflags.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 directives.h insns.h insnsi.h \
+ nasm.h nasmlib.h opflags.h pptok.h preproc.h regs.h tokens.h
+ndisasm.$(O): ndisasm.c compiler.h config.h directives.h disasm.h insns.h \
+ insnsi.h nasm.h nasmlib.h opflags.h pptok.h preproc.h regs.h sync.h \
+ tokens.h
+output/nulldbg.$(O): output/nulldbg.c compiler.h config.h directives.h \
+ insnsi.h nasm.h nasmlib.h opflags.h pptok.h preproc.h regs.h
+output/nullout.$(O): output/nullout.c compiler.h config.h directives.h \
+ insnsi.h nasm.h nasmlib.h opflags.h output/outlib.h pptok.h preproc.h \
+ regs.h
+output/outaout.$(O): output/outaout.c compiler.h config.h directives.h \
+ eval.h insnsi.h nasm.h nasmlib.h opflags.h output/outform.h output/outlib.h \
+ pptok.h preproc.h raa.h regs.h saa.h stdscan.h
+output/outas86.$(O): output/outas86.c compiler.h config.h directives.h \
+ insnsi.h nasm.h nasmlib.h opflags.h output/outform.h output/outlib.h \
+ pptok.h preproc.h raa.h regs.h saa.h
+output/outbin.$(O): output/outbin.c compiler.h config.h directives.h eval.h \
+ insnsi.h labels.h nasm.h nasmlib.h opflags.h output/outform.h \
+ output/outlib.h pptok.h preproc.h regs.h saa.h stdscan.h
+output/outcoff.$(O): output/outcoff.c compiler.h config.h directives.h \
+ eval.h insnsi.h nasm.h nasmlib.h opflags.h output/outform.h output/outlib.h \
+ pptok.h preproc.h raa.h regs.h saa.h
+output/outdbg.$(O): output/outdbg.c compiler.h config.h directives.h \
+ insnsi.h nasm.h nasmlib.h opflags.h output/outform.h pptok.h preproc.h \
+ regs.h
+output/outelf.$(O): output/outelf.c compiler.h config.h directives.h \
+ insnsi.h nasm.h nasmlib.h opflags.h output/dwarf.h output/elf.h \
+ output/outelf.h output/outform.h pptok.h preproc.h regs.h
+output/outelf32.$(O): output/outelf32.c compiler.h config.h directives.h \
+ eval.h insnsi.h nasm.h nasmlib.h opflags.h output/dwarf.h output/elf.h \
+ output/outelf.h output/outform.h output/outlib.h output/stabs.h pptok.h \
+ preproc.h raa.h rbtree.h regs.h saa.h stdscan.h
+output/outelf64.$(O): output/outelf64.c compiler.h config.h directives.h \
+ eval.h insnsi.h nasm.h nasmlib.h opflags.h output/dwarf.h output/elf.h \
+ output/outelf.h output/outform.h output/outlib.h output/stabs.h pptok.h \
+ preproc.h raa.h rbtree.h regs.h saa.h stdscan.h
+output/outform.$(O): output/outform.c compiler.h config.h directives.h \
+ insnsi.h nasm.h nasmlib.h opflags.h output/outform.h pptok.h preproc.h \
+ regs.h
+output/outieee.$(O): output/outieee.c compiler.h config.h directives.h \
+ insnsi.h nasm.h nasmlib.h opflags.h output/outform.h output/outlib.h \
+ pptok.h preproc.h regs.h
+output/outlib.$(O): output/outlib.c compiler.h config.h directives.h \
+ insnsi.h nasm.h nasmlib.h opflags.h output/outlib.h pptok.h preproc.h \
+ regs.h
+output/outmacho32.$(O): output/outmacho32.c compiler.h config.h directives.h \
+ eval.h insnsi.h nasm.h nasmlib.h opflags.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 config.h directives.h \
+ insnsi.h nasm.h nasmlib.h opflags.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 config.h directives.h eval.h \
+ insnsi.h nasm.h nasmlib.h opflags.h output/outform.h output/outlib.h \
+ pptok.h preproc.h regs.h stdscan.h
+output/outrdf2.$(O): output/outrdf2.c compiler.h config.h directives.h \
+ insnsi.h nasm.h nasmlib.h opflags.h output/outform.h output/outlib.h \
+ pptok.h preproc.h rdoff/rdoff.h regs.h saa.h
+parser.$(O): parser.c compiler.h config.h directives.h eval.h float.h \
+ insns.h insnsi.h nasm.h nasmlib.h opflags.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
+preproc.$(O): preproc.c compiler.h config.h directives.h eval.h hashtbl.h \
+ insnsi.h nasm.h nasmlib.h opflags.h pptok.h preproc.h quote.h regs.h \
+ stdscan.h tables.h tokens.h
+quote.$(O): quote.c compiler.h config.h nasmlib.h quote.h
+raa.$(O): raa.c compiler.h config.h nasmlib.h raa.h
+rbtree.$(O): rbtree.c compiler.h config.h rbtree.h
+regdis.$(O): regdis.c regdis.h regs.h
+regflags.$(O): regflags.c compiler.h config.h directives.h insnsi.h nasm.h \
+ nasmlib.h opflags.h pptok.h preproc.h regs.h tables.h
+regs.$(O): regs.c compiler.h config.h insnsi.h opflags.h tables.h
+regvals.$(O): regvals.c compiler.h config.h insnsi.h opflags.h tables.h
+saa.$(O): saa.c compiler.h config.h nasmlib.h saa.h
+stdscan.$(O): stdscan.c compiler.h config.h directives.h insns.h insnsi.h \
+ nasm.h nasmlib.h opflags.h pptok.h preproc.h quote.h regs.h stdscan.h \
+ tokens.h
+strfunc.$(O): strfunc.c compiler.h config.h directives.h insnsi.h nasm.h \
+ nasmlib.h opflags.h pptok.h preproc.h regs.h
+sync.$(O): sync.c compiler.h config.h nasmlib.h sync.h
+tokhash.$(O): tokhash.c compiler.h config.h directives.h hashtbl.h insns.h \
+ insnsi.h nasm.h nasmlib.h opflags.h pptok.h preproc.h regs.h tokens.h
+ver.$(O): ver.c compiler.h config.h directives.h insnsi.h nasm.h nasmlib.h \
+ opflags.h pptok.h preproc.h regs.h version.h
diff --git a/Mkfiles/README b/Mkfiles/README
new file mode 100644 (file)
index 0000000..6bab32c
--- /dev/null
@@ -0,0 +1,42 @@
+These are pre-created Makefiles for various platforms, use them if
+GNU autoconf/automake packages are not supported on your system.
+
+The Makefiles are:
+
+  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++.
+
+       Usage:  nmake /f Mkfiles/msvc.mak
+
+
+  Filename      Target         Compiler        Tested with
+  ---------------------------------------------------------------------------
+  openwcom.mak DOS,Win32,OS/2  OpenWatcom C    OpenWatcom 1.7 (Win32)
+
+       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
+  ---------------------------------------------------------------------------
+  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.
+
+  Filename      Target         Compiler        Tested with
+  ---------------------------------------------------------------------------
+  netware.mak  NetWare         Cross-GCC       Cross-GCC 3.2.3 (Linux, Win32)
+
+       For building on a Linux or Win32 host using Cross-GCC for Linux/Win32.
+
+       Usage:  make -f Mkfiles/netware.mak
diff --git a/Mkfiles/msvc.mak b/Mkfiles/msvc.mak
new file mode 100644 (file)
index 0000000..7bb1cfd
--- /dev/null
@@ -0,0 +1,300 @@
+# -*- makefile -*-
+#
+# Makefile for building NASM using Microsoft Visual C++ and NMAKE.
+# Tested on Microsoft Visual C++ 2005 Express Edition.
+#
+# Make sure to put the appropriate directories in your PATH, in
+# the case of MSVC++ 2005, they are ...\VC\bin and ...\Common7\IDE.
+
+top_srcdir     = .
+srcdir         = .
+VPATH          = .
+prefix         = C:\Program Files\NASM
+exec_prefix    = $(prefix)
+bindir         = $(prefix)/bin
+mandir         = $(prefix)/man
+
+CC             = cl
+CFLAGS         = /O2 /Ox /Oy /W2
+BUILD_CFLAGS   = $(CFLAGS) /I$(srcdir)/inttypes
+INTERNAL_CFLAGS = /I$(srcdir) /I. /DHAVE__SNPRINTF /DHAVE__VSNPRINTF
+ALL_CFLAGS     = $(BUILD_CFLAGS) $(INTERNAL_CFLAGS)
+LDFLAGS                =
+LIBS           =
+PERL           = perl -I$(srcdir)/perllib
+
+# Binary suffixes
+O               = obj
+X               = .exe
+
+.SUFFIXES: .c .i .s .$(O) .1 .man
+
+.c.obj:
+       $(CC) /c $(ALL_CFLAGS) /Fo$@ $<
+
+#-- Begin File Lists --#
+# Edit in Makefile.in, not here!
+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/nullout.$(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/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) \
+       lib/strlcpy.$(O)
+
+NDISASM = ndisasm.$(O) disasm.$(O) sync.$(O) nasmlib.$(O) ver.$(O) \
+       insnsd.$(O) insnsb.$(O) insnsn.$(O) regs.$(O) regdis.$(O)
+#-- End File Lists --#
+
+all: nasm$(X) ndisasm$(X)
+       rem cd rdoff && $(MAKE) all
+
+nasm$(X): $(NASM)
+       $(CC) $(LDFLAGS) /Fenasm$(X) $(NASM) $(LIBS)
+
+ndisasm$(X): $(NDISASM)
+       $(CC) $(LDFLAGS) /Fendisasm$(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.
+
+insnsb.c: insns.dat insns.pl
+       $(PERL) $(srcdir)/insns.pl -b $(srcdir)/insns.dat
+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 insnsb.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:
+       -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
+       -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
+       -del /f $(PERLREQ)
+       -del /f *.man
+       -del /f nasm.spec
+       rem cd doc && $(MAKE) clean
+
+spotless: distclean cleaner
+       -del /f doc\Makefile
+       -del doc\*~
+       -del doc\*.bak
+
+strip:
+
+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"
+#-- Everything below is generated by mkdep.pl - do not edit --#
+assemble.$(O): assemble.c assemble.h compiler.h directives.h insns.h \
+ insnsi.h nasm.h nasmlib.h opflags.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 opflags.h pptok.h preproc.h regs.h
+disasm.$(O): disasm.c compiler.h directives.h disasm.h insns.h insnsi.h \
+ nasm.h nasmlib.h opflags.h pptok.h preproc.h regdis.h regs.h sync.h \
+ tables.h tokens.h
+eval.$(O): eval.c compiler.h directives.h eval.h float.h insnsi.h labels.h \
+ nasm.h nasmlib.h opflags.h pptok.h preproc.h regs.h
+exprlib.$(O): exprlib.c compiler.h directives.h insnsi.h nasm.h nasmlib.h \
+ opflags.h pptok.h preproc.h regs.h
+float.$(O): float.c compiler.h directives.h float.h insnsi.h nasm.h \
+ nasmlib.h opflags.h pptok.h preproc.h regs.h
+hashtbl.$(O): hashtbl.c compiler.h directives.h hashtbl.h insnsi.h nasm.h \
+ nasmlib.h opflags.h pptok.h preproc.h regs.h
+insnsa.$(O): insnsa.c compiler.h directives.h insns.h insnsi.h nasm.h \
+ nasmlib.h opflags.h pptok.h preproc.h regs.h tokens.h
+insnsb.$(O): insnsb.c compiler.h directives.h insns.h insnsi.h nasm.h \
+ nasmlib.h opflags.h pptok.h preproc.h regs.h tokens.h
+insnsd.$(O): insnsd.c compiler.h directives.h insns.h insnsi.h nasm.h \
+ nasmlib.h opflags.h pptok.h preproc.h regs.h tokens.h
+insnsn.$(O): insnsn.c compiler.h insnsi.h opflags.h tables.h
+labels.$(O): labels.c compiler.h directives.h hashtbl.h insnsi.h nasm.h \
+ nasmlib.h opflags.h pptok.h preproc.h regs.h
+lib/snprintf.$(O): lib/snprintf.c compiler.h nasmlib.h
+lib/strlcpy.$(O): lib/strlcpy.c compiler.h
+lib/vsnprintf.$(O): lib/vsnprintf.c compiler.h nasmlib.h
+listing.$(O): listing.c compiler.h directives.h insnsi.h listing.h nasm.h \
+ nasmlib.h opflags.h pptok.h preproc.h regs.h
+macros.$(O): macros.c compiler.h directives.h hashtbl.h insnsi.h nasm.h \
+ nasmlib.h opflags.h output/outform.h pptok.h preproc.h regs.h tables.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 opflags.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 directives.h insns.h insnsi.h nasm.h \
+ nasmlib.h opflags.h pptok.h preproc.h regs.h tokens.h
+ndisasm.$(O): ndisasm.c compiler.h directives.h disasm.h insns.h insnsi.h \
+ nasm.h nasmlib.h opflags.h pptok.h preproc.h regs.h sync.h tokens.h
+output/nulldbg.$(O): output/nulldbg.c compiler.h directives.h insnsi.h \
+ nasm.h nasmlib.h opflags.h pptok.h preproc.h regs.h
+output/nullout.$(O): output/nullout.c compiler.h directives.h insnsi.h \
+ nasm.h nasmlib.h opflags.h output/outlib.h pptok.h preproc.h regs.h
+output/outaout.$(O): output/outaout.c compiler.h directives.h eval.h \
+ insnsi.h nasm.h nasmlib.h opflags.h output/outform.h output/outlib.h \
+ pptok.h preproc.h raa.h regs.h saa.h stdscan.h
+output/outas86.$(O): output/outas86.c compiler.h directives.h insnsi.h \
+ nasm.h nasmlib.h opflags.h output/outform.h output/outlib.h pptok.h \
+ preproc.h raa.h regs.h saa.h
+output/outbin.$(O): output/outbin.c compiler.h directives.h eval.h insnsi.h \
+ labels.h nasm.h nasmlib.h opflags.h output/outform.h output/outlib.h \
+ pptok.h preproc.h regs.h saa.h stdscan.h
+output/outcoff.$(O): output/outcoff.c compiler.h directives.h eval.h \
+ insnsi.h nasm.h nasmlib.h opflags.h output/outform.h output/outlib.h \
+ pptok.h preproc.h raa.h regs.h saa.h
+output/outdbg.$(O): output/outdbg.c compiler.h directives.h insnsi.h nasm.h \
+ nasmlib.h opflags.h output/outform.h pptok.h preproc.h regs.h
+output/outelf.$(O): output/outelf.c compiler.h directives.h insnsi.h nasm.h \
+ nasmlib.h opflags.h output/dwarf.h output/elf.h output/outelf.h \
+ output/outform.h pptok.h preproc.h regs.h
+output/outelf32.$(O): output/outelf32.c compiler.h directives.h eval.h \
+ insnsi.h nasm.h nasmlib.h opflags.h output/dwarf.h output/elf.h \
+ output/outelf.h output/outform.h output/outlib.h output/stabs.h pptok.h \
+ preproc.h raa.h rbtree.h regs.h saa.h stdscan.h
+output/outelf64.$(O): output/outelf64.c compiler.h directives.h eval.h \
+ insnsi.h nasm.h nasmlib.h opflags.h output/dwarf.h output/elf.h \
+ output/outelf.h output/outform.h output/outlib.h output/stabs.h pptok.h \
+ preproc.h raa.h rbtree.h regs.h saa.h stdscan.h
+output/outform.$(O): output/outform.c compiler.h directives.h insnsi.h \
+ nasm.h nasmlib.h opflags.h output/outform.h pptok.h preproc.h regs.h
+output/outieee.$(O): output/outieee.c compiler.h directives.h insnsi.h \
+ nasm.h nasmlib.h opflags.h output/outform.h output/outlib.h pptok.h \
+ preproc.h regs.h
+output/outlib.$(O): output/outlib.c compiler.h directives.h insnsi.h nasm.h \
+ nasmlib.h opflags.h output/outlib.h pptok.h preproc.h regs.h
+output/outmacho32.$(O): output/outmacho32.c compiler.h directives.h eval.h \
+ insnsi.h nasm.h nasmlib.h opflags.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 directives.h insnsi.h \
+ nasm.h nasmlib.h opflags.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 directives.h eval.h insnsi.h \
+ nasm.h nasmlib.h opflags.h output/outform.h output/outlib.h pptok.h \
+ preproc.h regs.h stdscan.h
+output/outrdf2.$(O): output/outrdf2.c compiler.h directives.h insnsi.h \
+ nasm.h nasmlib.h opflags.h output/outform.h output/outlib.h pptok.h \
+ preproc.h rdoff/rdoff.h regs.h saa.h
+parser.$(O): parser.c compiler.h directives.h eval.h float.h insns.h \
+ insnsi.h nasm.h nasmlib.h opflags.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
+preproc.$(O): preproc.c compiler.h directives.h eval.h hashtbl.h insnsi.h \
+ nasm.h nasmlib.h opflags.h pptok.h preproc.h quote.h regs.h stdscan.h \
+ tables.h tokens.h
+quote.$(O): quote.c compiler.h nasmlib.h quote.h
+raa.$(O): raa.c compiler.h nasmlib.h raa.h
+rbtree.$(O): rbtree.c compiler.h rbtree.h
+regdis.$(O): regdis.c regdis.h regs.h
+regflags.$(O): regflags.c compiler.h directives.h insnsi.h nasm.h nasmlib.h \
+ opflags.h pptok.h preproc.h regs.h tables.h
+regs.$(O): regs.c compiler.h insnsi.h opflags.h tables.h
+regvals.$(O): regvals.c compiler.h insnsi.h opflags.h tables.h
+saa.$(O): saa.c compiler.h nasmlib.h saa.h
+stdscan.$(O): stdscan.c compiler.h directives.h insns.h insnsi.h nasm.h \
+ nasmlib.h opflags.h pptok.h preproc.h quote.h regs.h stdscan.h tokens.h
+strfunc.$(O): strfunc.c compiler.h directives.h insnsi.h nasm.h nasmlib.h \
+ opflags.h pptok.h preproc.h regs.h
+sync.$(O): sync.c compiler.h nasmlib.h sync.h
+tokhash.$(O): tokhash.c compiler.h directives.h hashtbl.h insns.h insnsi.h \
+ nasm.h nasmlib.h opflags.h pptok.h preproc.h regs.h tokens.h
+ver.$(O): ver.c compiler.h directives.h insnsi.h nasm.h nasmlib.h opflags.h \
+ pptok.h preproc.h regs.h version.h
diff --git a/Mkfiles/netware.mak b/Mkfiles/netware.mak
new file mode 100644 (file)
index 0000000..fbd19bf
--- /dev/null
@@ -0,0 +1,235 @@
+# -*- makefile -*- GNU Makefile for NetWare target
+
+PROOT=.
+OBJDIR=release
+
+-include $(OBJDIR)/version.mak
+
+TARGETS=nasm.nlm ndisasm.nlm
+
+PERL=perl
+
+CROSSPREFIX=i586-netware-
+
+CC=$(CROSSPREFIX)gcc
+LD=$(CC)
+
+BINSUFFIX=.nlm
+
+VERSION=$(NASM_MAJOR_VER).$(NASM_MINOR_VER).$(NASM_SUBMINOR_VER)
+
+CFLAGS=-g -O2 -Wall -std=c99 -pedantic -D__NETWARE__ -D_POSIX_SOURCE -DHAVE_CONFIG_H -I.
+LDFLAGS=-Wl,--nlm-description="NASM $(NASM_VER) - the Netwide Assembler (gcc build)"
+LDFLAGS+=-Wl,--nlm-copyright="NASM is licensed under LGPL."
+LDFLAGS+=-Wl,--nlm-version=$(VERSION)
+LDFLAGS+=-Wl,--nlm-kernelspace
+LDFLAGS+=-Wl,--nlm-posixflag
+LDFLAGS+=-s
+
+O = o
+
+#-- Begin File Lists --#
+# Edit in Makefile.in, not here!
+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 \
+       nullout.o \
+       outbin.o outaout.o outcoff.o \
+       outelf.o outelf32.o outelf64.o \
+       outobj.o outas86.o outrdf2.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 \
+       strlcpy.o
+
+NDISASM = ndisasm.o disasm.o sync.o nasmlib.o ver.o \
+       insnsd.o insnsb.o insnsn.o regs.o regdis.o
+#-- End File Lists --#
+
+NASM_OBJ = $(addprefix $(OBJDIR)/,$(notdir $(NASM))) $(EOLIST)
+NDIS_OBJ = $(addprefix $(OBJDIR)/,$(notdir $(NDISASM))) $(EOLIST)
+
+VPATH  = *.c $(PROOT) $(PROOT)/output
+
+
+all: $(OBJDIR) config.h $(TARGETS)
+
+$(OBJDIR)/%.o: %.c
+       $(CC) $(CFLAGS) -c -o $@ $<
+
+nasm$(BINSUFFIX): $(NASM_OBJ)
+       $(LD) $(LDFLAGS) -o $@ $^
+
+ndisasm$(BINSUFFIX): $(NDIS_OBJ)
+       $(LD) $(LDFLAGS) -o $@ $^
+
+$(OBJDIR):
+       @mkdir $@
+
+config.h: $(PROOT)/Mkfiles/netware.mak
+       @echo Creating $@
+       @echo $(DL)/* $@ for NetWare target.$(DL) > $@
+       @echo $(DL)** Do not edit this file - it is created by make!$(DL) >> $@
+       @echo $(DL)** All your changes will be lost!!$(DL) >> $@
+       @echo $(DL)*/$(DL) >> $@
+       @echo $(DL)#ifndef __NETWARE__$(DL) >> $@
+       @echo $(DL)#error This $(notdir $@) is created for NetWare platform!$(DL) >> $@
+       @echo $(DL)#endif$(DL) >> $@
+       @echo $(DL)#define PACKAGE_VERSION "$(NASM_VER)"$(DL) >> $@
+       @echo $(DL)#define OS "i586-pc-libc-NetWare"$(DL) >> $@
+       @echo $(DL)#define HAVE_DECL_STRCASECMP 1$(DL) >> $@
+       @echo $(DL)#define HAVE_DECL_STRICMP 1$(DL) >> $@
+       @echo $(DL)#define HAVE_DECL_STRNCASECMP 1$(DL) >> $@
+       @echo $(DL)#define HAVE_DECL_STRNICMP 1$(DL) >> $@
+       @echo $(DL)#define HAVE_INTTYPES_H 1$(DL) >> $@
+       @echo $(DL)#define HAVE_LIMITS_H 1$(DL) >> $@
+       @echo $(DL)#define HAVE_MEMORY_H 1$(DL) >> $@
+       @echo $(DL)#define HAVE_SNPRINTF 1$(DL) >> $@
+       @echo $(DL)#define HAVE_STDBOOL_H 1$(DL) >> $@
+       @echo $(DL)#define HAVE_STDINT_H 1$(DL) >> $@
+       @echo $(DL)#define HAVE_STDLIB_H 1$(DL) >> $@
+       @echo $(DL)#define HAVE_STRCASECMP 1$(DL) >> $@
+       @echo $(DL)#define HAVE_STRCSPN 1$(DL) >> $@
+       @echo $(DL)#define HAVE_STRICMP 1$(DL) >> $@
+       @echo $(DL)#define HAVE_STRINGS_H 1$(DL) >> $@
+       @echo $(DL)#define HAVE_STRING_H 1$(DL) >> $@
+       @echo $(DL)#define HAVE_STRNCASECMP 1$(DL) >> $@
+       @echo $(DL)#define HAVE_STRNICMP 1$(DL) >> $@
+       @echo $(DL)#define HAVE_STRSPN 1$(DL) >> $@
+       @echo $(DL)#define HAVE_SYS_STAT_H 1$(DL) >> $@
+       @echo $(DL)#define HAVE_SYS_TYPES_H 1$(DL) >> $@
+       @echo $(DL)#define HAVE_UNISTD_H 1$(DL) >> $@
+       @echo $(DL)#define HAVE_VSNPRINTF 1$(DL) >> $@
+       @echo $(DL)#define STDC_HEADERS 1$(DL) >> $@
+       @echo $(DL)#ifndef _GNU_SOURCE$(DL) >> $@
+       @echo $(DL)#define _GNU_SOURCE 1$(DL) >> $@
+       @echo $(DL)#endif$(DL) >> $@
+       @echo $(DL)#define ldiv __CW_ldiv$(DL) >> $@
+
+clean:
+       -$(RM) -r $(OBJDIR)
+       -$(RM) config.h
+
+distclean: clean
+       -$(RM) $(TARGETS)
+
+$(OBJDIR)/version.mak: $(PROOT)/version $(PROOT)/version.pl $(OBJDIR)
+       @$(PERL) $(PROOT)/version.pl make < $< > $@
+
+#-- Magic hints to mkdep.pl --#
+# @object-ending: ".o"
+# @path-separator: ""
+# @continuation: "\"
+#-- Everything below is generated by mkdep.pl - do not edit --#
+assemble.o: assemble.c assemble.h compiler.h config.h directives.h insns.h \
+ insnsi.h nasm.h nasmlib.h opflags.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 opflags.h pptok.h preproc.h regs.h
+disasm.o: disasm.c compiler.h config.h directives.h disasm.h insns.h \
+ insnsi.h nasm.h nasmlib.h opflags.h pptok.h preproc.h regdis.h regs.h \
+ sync.h tables.h tokens.h
+eval.o: eval.c compiler.h config.h directives.h eval.h float.h insnsi.h \
+ labels.h nasm.h nasmlib.h opflags.h pptok.h preproc.h regs.h
+exprlib.o: exprlib.c compiler.h config.h directives.h insnsi.h nasm.h \
+ nasmlib.h opflags.h pptok.h preproc.h regs.h
+float.o: float.c compiler.h config.h directives.h float.h insnsi.h nasm.h \
+ nasmlib.h opflags.h pptok.h preproc.h regs.h
+hashtbl.o: hashtbl.c compiler.h config.h directives.h hashtbl.h insnsi.h \
+ nasm.h nasmlib.h opflags.h pptok.h preproc.h regs.h
+insnsa.o: insnsa.c compiler.h config.h directives.h insns.h insnsi.h nasm.h \
+ nasmlib.h opflags.h pptok.h preproc.h regs.h tokens.h
+insnsb.o: insnsb.c compiler.h config.h directives.h insns.h insnsi.h nasm.h \
+ nasmlib.h opflags.h pptok.h preproc.h regs.h tokens.h
+insnsd.o: insnsd.c compiler.h config.h directives.h insns.h insnsi.h nasm.h \
+ nasmlib.h opflags.h pptok.h preproc.h regs.h tokens.h
+insnsn.o: insnsn.c compiler.h config.h insnsi.h opflags.h tables.h
+labels.o: labels.c compiler.h config.h directives.h hashtbl.h insnsi.h \
+ nasm.h nasmlib.h opflags.h pptok.h preproc.h regs.h
+snprintf.o: snprintf.c compiler.h config.h nasmlib.h
+strlcpy.o: strlcpy.c compiler.h config.h
+vsnprintf.o: vsnprintf.c compiler.h config.h nasmlib.h
+listing.o: listing.c compiler.h config.h directives.h insnsi.h listing.h \
+ nasm.h nasmlib.h opflags.h pptok.h preproc.h regs.h
+macros.o: macros.c compiler.h config.h directives.h hashtbl.h insnsi.h \
+ nasm.h nasmlib.h opflags.h outform.h pptok.h preproc.h regs.h tables.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 opflags.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 directives.h insns.h insnsi.h \
+ nasm.h nasmlib.h opflags.h pptok.h preproc.h regs.h tokens.h
+ndisasm.o: ndisasm.c compiler.h config.h directives.h disasm.h insns.h \
+ insnsi.h nasm.h nasmlib.h opflags.h pptok.h preproc.h regs.h sync.h \
+ tokens.h
+nulldbg.o: nulldbg.c compiler.h config.h directives.h insnsi.h nasm.h \
+ nasmlib.h opflags.h pptok.h preproc.h regs.h
+nullout.o: nullout.c compiler.h config.h directives.h insnsi.h nasm.h \
+ nasmlib.h opflags.h outlib.h pptok.h preproc.h regs.h
+outaout.o: outaout.c compiler.h config.h directives.h eval.h insnsi.h nasm.h \
+ nasmlib.h opflags.h outform.h outlib.h pptok.h preproc.h raa.h regs.h saa.h \
+ stdscan.h
+outas86.o: outas86.c compiler.h config.h directives.h insnsi.h nasm.h \
+ nasmlib.h opflags.h outform.h outlib.h pptok.h preproc.h raa.h regs.h saa.h
+outbin.o: outbin.c compiler.h config.h directives.h eval.h insnsi.h labels.h \
+ nasm.h nasmlib.h opflags.h outform.h outlib.h pptok.h preproc.h regs.h \
+ saa.h stdscan.h
+outcoff.o: outcoff.c compiler.h config.h directives.h eval.h insnsi.h nasm.h \
+ nasmlib.h opflags.h outform.h outlib.h pptok.h preproc.h raa.h regs.h saa.h
+outdbg.o: outdbg.c compiler.h config.h directives.h insnsi.h nasm.h \
+ nasmlib.h opflags.h outform.h pptok.h preproc.h regs.h
+outelf.o: outelf.c compiler.h config.h directives.h insnsi.h nasm.h \
+ nasmlib.h opflags.h dwarf.h elf.h outelf.h outform.h pptok.h preproc.h \
+ regs.h
+outelf32.o: outelf32.c compiler.h config.h directives.h eval.h insnsi.h \
+ nasm.h nasmlib.h opflags.h dwarf.h elf.h outelf.h outform.h outlib.h \
+ stabs.h pptok.h preproc.h raa.h rbtree.h regs.h saa.h stdscan.h
+outelf64.o: outelf64.c compiler.h config.h directives.h eval.h insnsi.h \
+ nasm.h nasmlib.h opflags.h dwarf.h elf.h outelf.h outform.h outlib.h \
+ stabs.h pptok.h preproc.h raa.h rbtree.h regs.h saa.h stdscan.h
+outform.o: outform.c compiler.h config.h directives.h insnsi.h nasm.h \
+ nasmlib.h opflags.h outform.h pptok.h preproc.h regs.h
+outieee.o: outieee.c compiler.h config.h directives.h insnsi.h nasm.h \
+ nasmlib.h opflags.h outform.h outlib.h pptok.h preproc.h regs.h
+outlib.o: outlib.c compiler.h config.h directives.h insnsi.h nasm.h \
+ nasmlib.h opflags.h outlib.h pptok.h preproc.h regs.h
+outmacho32.o: outmacho32.c compiler.h config.h directives.h eval.h insnsi.h \
+ nasm.h nasmlib.h opflags.h outform.h outlib.h pptok.h preproc.h raa.h \
+ regs.h saa.h
+outmacho64.o: outmacho64.c compiler.h config.h directives.h insnsi.h nasm.h \
+ nasmlib.h opflags.h outform.h outlib.h pptok.h preproc.h raa.h regs.h saa.h
+outobj.o: outobj.c compiler.h config.h directives.h eval.h insnsi.h nasm.h \
+ nasmlib.h opflags.h outform.h outlib.h pptok.h preproc.h regs.h stdscan.h
+outrdf2.o: outrdf2.c compiler.h config.h directives.h insnsi.h nasm.h \
+ nasmlib.h opflags.h outform.h outlib.h pptok.h preproc.h rdoff.h regs.h \
+ saa.h
+parser.o: parser.c compiler.h config.h directives.h eval.h float.h insns.h \
+ insnsi.h nasm.h nasmlib.h opflags.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
+preproc.o: preproc.c compiler.h config.h directives.h eval.h hashtbl.h \
+ insnsi.h nasm.h nasmlib.h opflags.h pptok.h preproc.h quote.h regs.h \
+ stdscan.h tables.h tokens.h
+quote.o: quote.c compiler.h config.h nasmlib.h quote.h
+raa.o: raa.c compiler.h config.h nasmlib.h raa.h
+rbtree.o: rbtree.c compiler.h config.h rbtree.h
+regdis.o: regdis.c regdis.h regs.h
+regflags.o: regflags.c compiler.h config.h directives.h insnsi.h nasm.h \
+ nasmlib.h opflags.h pptok.h preproc.h regs.h tables.h
+regs.o: regs.c compiler.h config.h insnsi.h opflags.h tables.h
+regvals.o: regvals.c compiler.h config.h insnsi.h opflags.h tables.h
+saa.o: saa.c compiler.h config.h nasmlib.h saa.h
+stdscan.o: stdscan.c compiler.h config.h directives.h insns.h insnsi.h \
+ nasm.h nasmlib.h opflags.h pptok.h preproc.h quote.h regs.h stdscan.h \
+ tokens.h
+strfunc.o: strfunc.c compiler.h config.h directives.h insnsi.h nasm.h \
+ nasmlib.h opflags.h pptok.h preproc.h regs.h
+sync.o: sync.c compiler.h config.h nasmlib.h sync.h
+tokhash.o: tokhash.c compiler.h config.h directives.h hashtbl.h insns.h \
+ insnsi.h nasm.h nasmlib.h opflags.h pptok.h preproc.h regs.h tokens.h
+ver.o: ver.c compiler.h config.h directives.h insnsi.h nasm.h nasmlib.h \
+ opflags.h pptok.h preproc.h regs.h version.h
diff --git a/Mkfiles/openwcom.mak b/Mkfiles/openwcom.mak
new file mode 100644 (file)
index 0000000..32a67c4
--- /dev/null
@@ -0,0 +1,329 @@
+# -*- 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
+DEBUG          =
+CFLAGS         = -6 -ox -wx -ze -fpi $(DEBUG)
+BUILD_CFLAGS   = $(CFLAGS) $(TARGET_FLAGS) # -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.
+#-- Begin File Lists --#
+# Edit in Makefile.in, not here!
+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\nullout.$(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\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) &
+       lib\strlcpy.$(O)
+
+NDISASM = ndisasm.$(O) disasm.$(O) sync.$(O) nasmlib.$(O) ver.$(O) &
+       insnsd.$(O) insnsb.$(O) insnsn.$(O) regs.$(O) regdis.$(O)
+#-- End File Lists --#
+
+what:  .SYMBOLIC
+       @echo Please build "dos", "win32" or "os2"
+
+dos:   .SYMBOLIC
+       $(MAKE) /f $(__MAKEFILES__) all TARGET_FLAGS="-bt=DOS -l=DOS4G"
+
+win32: .SYMBOLIC
+       $(MAKE) /f $(__MAKEFILES__) all TARGET_FLAGS="-bt=NT  -l=NT"
+
+os2:   .SYMBOLIC
+       $(MAKE) /f $(__MAKEFILES__) all TARGET_FLAGS="-bt=OS2 -l=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.
+
+insnsb.c: insns.dat insns.pl
+       $(PERL) $(srcdir)/insns.pl -b $(srcdir)/insns.dat
+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
+regdis.h: regs.dat regs.pl
+       $(PERL) $(srcdir)/regs.pl dh $(srcdir)/regs.dat > regdis.h
+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 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 &
+         version.h version.mac
+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 directives.h insns.h &
+ insnsi.h nasm.h nasmlib.h opflags.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 opflags.h pptok.h preproc.h regs.h
+disasm.$(O): disasm.c compiler.h directives.h disasm.h insns.h insnsi.h &
+ nasm.h nasmlib.h opflags.h pptok.h preproc.h regdis.h regs.h sync.h &
+ tables.h tokens.h
+eval.$(O): eval.c compiler.h directives.h eval.h float.h insnsi.h labels.h &
+ nasm.h nasmlib.h opflags.h pptok.h preproc.h regs.h
+exprlib.$(O): exprlib.c compiler.h directives.h insnsi.h nasm.h nasmlib.h &
+ opflags.h pptok.h preproc.h regs.h
+float.$(O): float.c compiler.h directives.h float.h insnsi.h nasm.h &
+ nasmlib.h opflags.h pptok.h preproc.h regs.h
+hashtbl.$(O): hashtbl.c compiler.h directives.h hashtbl.h insnsi.h nasm.h &
+ nasmlib.h opflags.h pptok.h preproc.h regs.h
+insnsa.$(O): insnsa.c compiler.h directives.h insns.h insnsi.h nasm.h &
+ nasmlib.h opflags.h pptok.h preproc.h regs.h tokens.h
+insnsb.$(O): insnsb.c compiler.h directives.h insns.h insnsi.h nasm.h &
+ nasmlib.h opflags.h pptok.h preproc.h regs.h tokens.h
+insnsd.$(O): insnsd.c compiler.h directives.h insns.h insnsi.h nasm.h &
+ nasmlib.h opflags.h pptok.h preproc.h regs.h tokens.h
+insnsn.$(O): insnsn.c compiler.h insnsi.h opflags.h tables.h
+labels.$(O): labels.c compiler.h directives.h hashtbl.h insnsi.h nasm.h &
+ nasmlib.h opflags.h pptok.h preproc.h regs.h
+lib\snprintf.$(O): lib\snprintf.c compiler.h nasmlib.h
+lib\strlcpy.$(O): lib\strlcpy.c compiler.h
+lib\vsnprintf.$(O): lib\vsnprintf.c compiler.h nasmlib.h
+listing.$(O): listing.c compiler.h directives.h insnsi.h listing.h nasm.h &
+ nasmlib.h opflags.h pptok.h preproc.h regs.h
+macros.$(O): macros.c compiler.h directives.h hashtbl.h insnsi.h nasm.h &
+ nasmlib.h opflags.h output\outform.h pptok.h preproc.h regs.h tables.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 opflags.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 directives.h insns.h insnsi.h nasm.h &
+ nasmlib.h opflags.h pptok.h preproc.h regs.h tokens.h
+ndisasm.$(O): ndisasm.c compiler.h directives.h disasm.h insns.h insnsi.h &
+ nasm.h nasmlib.h opflags.h pptok.h preproc.h regs.h sync.h tokens.h
+output\nulldbg.$(O): output\nulldbg.c compiler.h directives.h insnsi.h &
+ nasm.h nasmlib.h opflags.h pptok.h preproc.h regs.h
+output\nullout.$(O): output\nullout.c compiler.h directives.h insnsi.h &
+ nasm.h nasmlib.h opflags.h output\outlib.h pptok.h preproc.h regs.h
+output\outaout.$(O): output\outaout.c compiler.h directives.h eval.h &
+ insnsi.h nasm.h nasmlib.h opflags.h output\outform.h output\outlib.h &
+ pptok.h preproc.h raa.h regs.h saa.h stdscan.h
+output\outas86.$(O): output\outas86.c compiler.h directives.h insnsi.h &
+ nasm.h nasmlib.h opflags.h output\outform.h output\outlib.h pptok.h &
+ preproc.h raa.h regs.h saa.h
+output\outbin.$(O): output\outbin.c compiler.h directives.h eval.h insnsi.h &
+ labels.h nasm.h nasmlib.h opflags.h output\outform.h output\outlib.h &
+ pptok.h preproc.h regs.h saa.h stdscan.h
+output\outcoff.$(O): output\outcoff.c compiler.h directives.h eval.h &
+ insnsi.h nasm.h nasmlib.h opflags.h output\outform.h output\outlib.h &
+ pptok.h preproc.h raa.h regs.h saa.h
+output\outdbg.$(O): output\outdbg.c compiler.h directives.h insnsi.h nasm.h &
+ nasmlib.h opflags.h output\outform.h pptok.h preproc.h regs.h
+output\outelf.$(O): output\outelf.c compiler.h directives.h insnsi.h nasm.h &
+ nasmlib.h opflags.h output\dwarf.h output\elf.h output\outelf.h &
+ output\outform.h pptok.h preproc.h regs.h
+output\outelf32.$(O): output\outelf32.c compiler.h directives.h eval.h &
+ insnsi.h nasm.h nasmlib.h opflags.h output\dwarf.h output\elf.h &
+ output\outelf.h output\outform.h output\outlib.h output\stabs.h pptok.h &
+ preproc.h raa.h rbtree.h regs.h saa.h stdscan.h
+output\outelf64.$(O): output\outelf64.c compiler.h directives.h eval.h &
+ insnsi.h nasm.h nasmlib.h opflags.h output\dwarf.h output\elf.h &
+ output\outelf.h output\outform.h output\outlib.h output\stabs.h pptok.h &
+ preproc.h raa.h rbtree.h regs.h saa.h stdscan.h
+output\outform.$(O): output\outform.c compiler.h directives.h insnsi.h &
+ nasm.h nasmlib.h opflags.h output\outform.h pptok.h preproc.h regs.h
+output\outieee.$(O): output\outieee.c compiler.h directives.h insnsi.h &
+ nasm.h nasmlib.h opflags.h output\outform.h output\outlib.h pptok.h &
+ preproc.h regs.h
+output\outlib.$(O): output\outlib.c compiler.h directives.h insnsi.h nasm.h &
+ nasmlib.h opflags.h output\outlib.h pptok.h preproc.h regs.h
+output\outmacho32.$(O): output\outmacho32.c compiler.h directives.h eval.h &
+ insnsi.h nasm.h nasmlib.h opflags.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 directives.h insnsi.h &
+ nasm.h nasmlib.h opflags.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 directives.h eval.h insnsi.h &
+ nasm.h nasmlib.h opflags.h output\outform.h output\outlib.h pptok.h &
+ preproc.h regs.h stdscan.h
+output\outrdf2.$(O): output\outrdf2.c compiler.h directives.h insnsi.h &
+ nasm.h nasmlib.h opflags.h output\outform.h output\outlib.h pptok.h &
+ preproc.h rdoff\rdoff.h regs.h saa.h
+parser.$(O): parser.c compiler.h directives.h eval.h float.h insns.h &
+ insnsi.h nasm.h nasmlib.h opflags.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
+preproc.$(O): preproc.c compiler.h directives.h eval.h hashtbl.h insnsi.h &
+ nasm.h nasmlib.h opflags.h pptok.h preproc.h quote.h regs.h stdscan.h &
+ tables.h tokens.h
+quote.$(O): quote.c compiler.h nasmlib.h quote.h
+raa.$(O): raa.c compiler.h nasmlib.h raa.h
+rbtree.$(O): rbtree.c compiler.h rbtree.h
+regdis.$(O): regdis.c regdis.h regs.h
+regflags.$(O): regflags.c compiler.h directives.h insnsi.h nasm.h nasmlib.h &
+ opflags.h pptok.h preproc.h regs.h tables.h
+regs.$(O): regs.c compiler.h insnsi.h opflags.h tables.h
+regvals.$(O): regvals.c compiler.h insnsi.h opflags.h tables.h
+saa.$(O): saa.c compiler.h nasmlib.h saa.h
+stdscan.$(O): stdscan.c compiler.h directives.h insns.h insnsi.h nasm.h &
+ nasmlib.h opflags.h pptok.h preproc.h quote.h regs.h stdscan.h tokens.h
+strfunc.$(O): strfunc.c compiler.h directives.h insnsi.h nasm.h nasmlib.h &
+ opflags.h pptok.h preproc.h regs.h
+sync.$(O): sync.c compiler.h nasmlib.h sync.h
+tokhash.$(O): tokhash.c compiler.h directives.h hashtbl.h insns.h insnsi.h &
+ nasm.h nasmlib.h opflags.h pptok.h preproc.h regs.h tokens.h
+ver.$(O): ver.c compiler.h directives.h insnsi.h nasm.h nasmlib.h opflags.h &
+ pptok.h preproc.h regs.h version.h
diff --git a/Mkfiles/owlinux.mak b/Mkfiles/owlinux.mak
new file mode 100644 (file)
index 0000000..a52a667
--- /dev/null
@@ -0,0 +1,339 @@
+# -*- makefile -*-
+#
+# Makefile for cross-compiling NASM from Linux
+# to DOS, Win32 or OS/2 using OpenWatcom.
+#
+# Please see http://bugzilla.openwatcom.org/show_bug.cgi?id=751
+# for some caveats in using OpenWatcom as a cross-compiler
+# from Linux, in particular:
+#
+# > Second and more importantly, the makefile needs to ensure that the
+# > proper headers are included. This is normally not a problem when
+# > building on DOS, Windows, or OS/2, as they share the same C
+# > library headers. But when cross-compiling from (or to) Linux, it
+# > is crucial.
+# >
+# > This may be accomplished by setting the INCLUDE env var in the
+# > makefile, or setting OS2_INCLUDE, DOS_INCLUDE, NT_INCLUDE env vars
+# > *and* making sure that the proper -bt switch is used, or passing a
+# > switch like -I"$(%WATCOM)/h". The last variant is probably the
+# > easiest to implement and least likely to break.
+#
+
+top_srcdir     = .
+srcdir         = .
+prefix         = C:/Program Files/NASM
+exec_prefix    = $(prefix)
+bindir         = $(prefix)/bin
+mandir         = $(prefix)/man
+
+CC             = wcl386
+DEBUG          =
+CFLAGS         = -6 -ox -wx -ze -fpi $(DEBUG)
+BUILD_CFLAGS   = $(CFLAGS) $(TARGET_FLAGS) # -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=$@ $<
+
+#-- Begin File Lists --#
+# Edit in Makefile.in, not here!
+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/nullout.$(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/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) \
+       lib/strlcpy.$(O)
+
+NDISASM = ndisasm.$(O) disasm.$(O) sync.$(O) nasmlib.$(O) ver.$(O) \
+       insnsd.$(O) insnsb.$(O) insnsn.$(O) regs.$(O) regdis.$(O)
+#-- End File Lists --#
+
+what:
+       @echo 'Please build "dos", "win32" or "os2"'
+
+dos:
+       $(MAKE) -f $(MAKEFILE_LIST) all TARGET_FLAGS='-bt=DOS -l=DOS4G'
+
+win32:
+       $(MAKE) -f $(MAKEFILE_LIST) all TARGET_FLAGS='-bt=NT  -l=NT'
+
+os2:
+       $(MAKE) -f $(MAKEFILE_LIST) all TARGET_FLAGS='-bt=OS2 -l=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.
+
+insnsb.c: insns.dat insns.pl
+       $(PERL) $(srcdir)/insns.pl -b $(srcdir)/insns.dat
+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
+regdis.h: regs.dat regs.pl
+       $(PERL) $(srcdir)/regs.pl dh $(srcdir)/regs.dat > regdis.h
+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 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 \
+         version.h version.mac
+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 directives.h insns.h \
+ insnsi.h nasm.h nasmlib.h opflags.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 opflags.h pptok.h preproc.h regs.h
+disasm.$(O): disasm.c compiler.h directives.h disasm.h insns.h insnsi.h \
+ nasm.h nasmlib.h opflags.h pptok.h preproc.h regdis.h regs.h sync.h \
+ tables.h tokens.h
+eval.$(O): eval.c compiler.h directives.h eval.h float.h insnsi.h labels.h \
+ nasm.h nasmlib.h opflags.h pptok.h preproc.h regs.h
+exprlib.$(O): exprlib.c compiler.h directives.h insnsi.h nasm.h nasmlib.h \
+ opflags.h pptok.h preproc.h regs.h
+float.$(O): float.c compiler.h directives.h float.h insnsi.h nasm.h \
+ nasmlib.h opflags.h pptok.h preproc.h regs.h
+hashtbl.$(O): hashtbl.c compiler.h directives.h hashtbl.h insnsi.h nasm.h \
+ nasmlib.h opflags.h pptok.h preproc.h regs.h
+insnsa.$(O): insnsa.c compiler.h directives.h insns.h insnsi.h nasm.h \
+ nasmlib.h opflags.h pptok.h preproc.h regs.h tokens.h
+insnsb.$(O): insnsb.c compiler.h directives.h insns.h insnsi.h nasm.h \
+ nasmlib.h opflags.h pptok.h preproc.h regs.h tokens.h
+insnsd.$(O): insnsd.c compiler.h directives.h insns.h insnsi.h nasm.h \
+ nasmlib.h opflags.h pptok.h preproc.h regs.h tokens.h
+insnsn.$(O): insnsn.c compiler.h insnsi.h opflags.h tables.h
+labels.$(O): labels.c compiler.h directives.h hashtbl.h insnsi.h nasm.h \
+ nasmlib.h opflags.h pptok.h preproc.h regs.h
+lib/snprintf.$(O): lib/snprintf.c compiler.h nasmlib.h
+lib/strlcpy.$(O): lib/strlcpy.c compiler.h
+lib/vsnprintf.$(O): lib/vsnprintf.c compiler.h nasmlib.h
+listing.$(O): listing.c compiler.h directives.h insnsi.h listing.h nasm.h \
+ nasmlib.h opflags.h pptok.h preproc.h regs.h
+macros.$(O): macros.c compiler.h directives.h hashtbl.h insnsi.h nasm.h \
+ nasmlib.h opflags.h output/outform.h pptok.h preproc.h regs.h tables.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 opflags.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 directives.h insns.h insnsi.h nasm.h \
+ nasmlib.h opflags.h pptok.h preproc.h regs.h tokens.h
+ndisasm.$(O): ndisasm.c compiler.h directives.h disasm.h insns.h insnsi.h \
+ nasm.h nasmlib.h opflags.h pptok.h preproc.h regs.h sync.h tokens.h
+output/nulldbg.$(O): output/nulldbg.c compiler.h directives.h insnsi.h \
+ nasm.h nasmlib.h opflags.h pptok.h preproc.h regs.h
+output/nullout.$(O): output/nullout.c compiler.h directives.h insnsi.h \
+ nasm.h nasmlib.h opflags.h output/outlib.h pptok.h preproc.h regs.h
+output/outaout.$(O): output/outaout.c compiler.h directives.h eval.h \
+ insnsi.h nasm.h nasmlib.h opflags.h output/outform.h output/outlib.h \
+ pptok.h preproc.h raa.h regs.h saa.h stdscan.h
+output/outas86.$(O): output/outas86.c compiler.h directives.h insnsi.h \
+ nasm.h nasmlib.h opflags.h output/outform.h output/outlib.h pptok.h \
+ preproc.h raa.h regs.h saa.h
+output/outbin.$(O): output/outbin.c compiler.h directives.h eval.h insnsi.h \
+ labels.h nasm.h nasmlib.h opflags.h output/outform.h output/outlib.h \
+ pptok.h preproc.h regs.h saa.h stdscan.h
+output/outcoff.$(O): output/outcoff.c compiler.h directives.h eval.h \
+ insnsi.h nasm.h nasmlib.h opflags.h output/outform.h output/outlib.h \
+ pptok.h preproc.h raa.h regs.h saa.h
+output/outdbg.$(O): output/outdbg.c compiler.h directives.h insnsi.h nasm.h \
+ nasmlib.h opflags.h output/outform.h pptok.h preproc.h regs.h
+output/outelf.$(O): output/outelf.c compiler.h directives.h insnsi.h nasm.h \
+ nasmlib.h opflags.h output/dwarf.h output/elf.h output/outelf.h \
+ output/outform.h pptok.h preproc.h regs.h
+output/outelf32.$(O): output/outelf32.c compiler.h directives.h eval.h \
+ insnsi.h nasm.h nasmlib.h opflags.h output/dwarf.h output/elf.h \
+ output/outelf.h output/outform.h output/outlib.h output/stabs.h pptok.h \
+ preproc.h raa.h rbtree.h regs.h saa.h stdscan.h
+output/outelf64.$(O): output/outelf64.c compiler.h directives.h eval.h \
+ insnsi.h nasm.h nasmlib.h opflags.h output/dwarf.h output/elf.h \
+ output/outelf.h output/outform.h output/outlib.h output/stabs.h pptok.h \
+ preproc.h raa.h rbtree.h regs.h saa.h stdscan.h
+output/outform.$(O): output/outform.c compiler.h directives.h insnsi.h \
+ nasm.h nasmlib.h opflags.h output/outform.h pptok.h preproc.h regs.h
+output/outieee.$(O): output/outieee.c compiler.h directives.h insnsi.h \
+ nasm.h nasmlib.h opflags.h output/outform.h output/outlib.h pptok.h \
+ preproc.h regs.h
+output/outlib.$(O): output/outlib.c compiler.h directives.h insnsi.h nasm.h \
+ nasmlib.h opflags.h output/outlib.h pptok.h preproc.h regs.h
+output/outmacho32.$(O): output/outmacho32.c compiler.h directives.h eval.h \
+ insnsi.h nasm.h nasmlib.h opflags.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 directives.h insnsi.h \
+ nasm.h nasmlib.h opflags.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 directives.h eval.h insnsi.h \
+ nasm.h nasmlib.h opflags.h output/outform.h output/outlib.h pptok.h \
+ preproc.h regs.h stdscan.h
+output/outrdf2.$(O): output/outrdf2.c compiler.h directives.h insnsi.h \
+ nasm.h nasmlib.h opflags.h output/outform.h output/outlib.h pptok.h \
+ preproc.h rdoff/rdoff.h regs.h saa.h
+parser.$(O): parser.c compiler.h directives.h eval.h float.h insns.h \
+ insnsi.h nasm.h nasmlib.h opflags.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
+preproc.$(O): preproc.c compiler.h directives.h eval.h hashtbl.h insnsi.h \
+ nasm.h nasmlib.h opflags.h pptok.h preproc.h quote.h regs.h stdscan.h \
+ tables.h tokens.h
+quote.$(O): quote.c compiler.h nasmlib.h quote.h
+raa.$(O): raa.c compiler.h nasmlib.h raa.h
+rbtree.$(O): rbtree.c compiler.h rbtree.h
+regdis.$(O): regdis.c regdis.h regs.h
+regflags.$(O): regflags.c compiler.h directives.h insnsi.h nasm.h nasmlib.h \
+ opflags.h pptok.h preproc.h regs.h tables.h
+regs.$(O): regs.c compiler.h insnsi.h opflags.h tables.h
+regvals.$(O): regvals.c compiler.h insnsi.h opflags.h tables.h
+saa.$(O): saa.c compiler.h nasmlib.h saa.h
+stdscan.$(O): stdscan.c compiler.h directives.h insns.h insnsi.h nasm.h \
+ nasmlib.h opflags.h pptok.h preproc.h quote.h regs.h stdscan.h tokens.h
+strfunc.$(O): strfunc.c compiler.h directives.h insnsi.h nasm.h nasmlib.h \
+ opflags.h pptok.h preproc.h regs.h
+sync.$(O): sync.c compiler.h nasmlib.h sync.h
+tokhash.$(O): tokhash.c compiler.h directives.h hashtbl.h insns.h insnsi.h \
+ nasm.h nasmlib.h opflags.h pptok.h preproc.h regs.h tokens.h
+ver.$(O): ver.c compiler.h directives.h insnsi.h nasm.h nasmlib.h opflags.h \
+ pptok.h preproc.h regs.h version.h
diff --git a/README b/README
new file mode 100644 (file)
index 0000000..792b038
--- /dev/null
+++ b/README
@@ -0,0 +1,23 @@
+              NASM, the Netwide Assembler.
+
+Many many developers all over the net respect NASM for what it is
+- a widespread (thus netwide), portable (thus netwide!), very
+flexible and mature assembler tool with support for many output
+formats (thus netwide!!).
+
+Now we have good news for you: NASM is licensed under the "simplified"
+(2-clause) BSD license.  This means its development is open to even
+wider society of programmers wishing to improve their lovely
+assembler.
+
+The NASM project is now situated at SourceForge.net, the most
+popular Open Source development site on the Internet.
+
+Visit our website at http://nasm.sourceforge.net/ and our
+SourceForge project at http://sourceforge.net/projects/nasm/
+
+See the file CHANGES for the description of changes between revisions,
+and the file AUTHORS for a list of contributors.
+
+                                                   With best regards,
+                                                           NASM crew.
diff --git a/TODO b/TODO
new file mode 100644 (file)
index 0000000..29a1b05
--- /dev/null
+++ b/TODO
@@ -0,0 +1,376 @@
+NASM TODO list
+==============
+
+This, like the AUTHORS file, is intended for easy readability by both human 
+and machine, thus the format.
+
+  F: feature
+  V: version you should expect it by
+  R: responsible person or - if unassigned
+  C: % complete
+  D: description
+  D: maybe on multiple lines
+  
+Anything that doesn't start with /^[FVRCD]:/ should be ignored.
+
+  F:-line triggers new entry.
+  Empty V,R,C assume: V: ?, R: -, C: 0%
+
+=============
+
+F: Extended x64 Support
+D: Full FPU/MMX/SSE* instruction support for x64
+
+F: ELF64 output format
+D: Support for assembling code to the ELF64 output format
+
+F: NDISASM x64 Support
+D: Ability to disassemble respective x64 code
+
+F: General x64 Support
+V: 0.99.00
+R: Keith Kanios
+C: 99%
+D: Support for assembling 64-bit code to various output formats
+
+F: win64 (x86-64 COFF) output format
+V: 0.99.00
+R: Keith Kanios
+C: 99%
+D: Support for assembling code to the win64 output format
+
+F: c99 data-type compliance
+V: 0.99.00
+R: Keith Kanios
+C: 99%
+D: Revamped entire source-code base data-types for compliance
+D: with c99 (inttypes.h)
+
+F: __BITS__ Standard Macro
+V: 0.99.00
+R: Keith Kanios
+C: 100%
+D: __BITS__ standard macro that returns current [BITS XX] mode
+
+F: i18n via gettext
+D: kkanios: be careful about that, stick to UTF-8 if anything
+
+F: Convert shallow code model to deep code model
+D: Tired of messing between lots of unrelated files (especially .c/.h stuff)
+
+F: Automated dependency generation for Makefile
+D: Current looks awful and will break if anything changes.
+
+F: Move output modules out*.c to output/ subdir
+R: madfire
+C: 100%
+
+== THESE ARE FROM old NASM's Wishlist
+== THEY NEED SEVERE REVISING (seems they weren't updated for a couple of years or so)
+
+F: Check misc/ide.cfg into RCS as Watcom IDE enhancement thingy
+V: 0.98
+D: (nop@dlc.fi)
+
+F: Package the Linux Assembler HOWTO
+V: 0.98
+
+F: 3DNow!, SSE and other extensions need documenting
+V: 0.98
+D: hpa: Does it really make sense to have a whole instruction set
+D: reference packaged with the assembler?
+D: kkanios: Yes, for me it was a great help... and still is.
+
+F: prototypes of lrotate don't match in test/*. Fix.
+V: 0.98
+
+F: Build djgpp binaries for 0.98 onwards. Look into PMODE/W as a stub
+V: 0.98
+D: it might be a lot better than CWSDPMI. It's in PMW133.ZIP.
+
+F: %undef operator that goes along with %define
+V: ?
+C: 100%
+
+F: Fix `%error' giving error messages twice.
+V: 0.99
+D: Not especially important, as changes planned for 1.1x below will make
+D: the preprocessor be only called once.
+
+F: Sort out problems with OBJ
+V: 0.99
+D: * TLINK32 doesn't seem to like SEGDEF32 et al. So for that, we
+D:   should avoid xxx32 records wherever we can.
+D: * However, didn't we change _to_ using xxx32 at some stage? Try
+D:   to remember why and when.
+D: * Apparently Delphi's linker has trouble with two or more
+D:   globals being defined inside a PUBDEF32. Don't even know if it
+D:   _can_ cope with a PUBDEF16.
+D: * Might need extra flags. *sigh*
+
+F: Symbol table output may possibly be useful.
+V: 0.99
+D: Ken Martwick (kenm@efn.org) wants the following format:
+D:     labelname       type    offset(hex)     repetition count
+D: Possibly include xref addresses after repetition count?
+
+F: ELF fixes
+V: 0.99
+D: There are various other bugs in outelf.c that make certain kinds
+D: of relocation not work. See zbrown.asm. Looks like we may have to do
+D: a major rewrite of parts of it. Compare some NASM code output with
+D: equivalent GAS code output. Look at the ELF spec. Generally fix things.
+
+F: ELF fixes
+V: 0.99
+D: NASM is currently using a kludge in ELF that involves defining
+D: a symbol at a zero absolute offset. This isn't needed, as the
+D: documented solution to the problem that this solves is to use
+D: SHN_UNDEF.
+
+F: Debug information, in all formats it can be usefully done in.
+V: 0.99
+D: * including line-number record support.
+D: * "George C. Lindauer" <gclind01@starbase.spd.louisville.edu>
+D:   wants to have some say in how this goes through.
+D: * Andrew Crabtree <andrewc@rosemail.rose.hp.com> wants to help out.
+
+F: Think about a line-continuation character.
+V: 0.99
+
+F: Consider allowing declaration of two labels on the same line,
+V: 0.99
+D: syntax 'label1[:] label2[:] ... instruction'.
+D: Need to investigate feasibility.
+
+F: Quoting of quotes by doubling them, in string and char constants.
+V: 0.99
+
+F: Two-operand syntax for SEGMENT/SECTION macro to avoid warnings
+D: of ignored section parameters on reissue of __SECT__.
+D: Or maybe skip the warning if the given parameters are identical to
+D: what was actually stored. Investigate.                              
+V: 0.99
+
+F: Apparently we are not missing a PSRAQ instruction, because it
+D: doesn't exist.  Check that it doesn't exist as an undocumented
+D: instruction, or something stupid like that.
+V: 0.99
+
+F: Any assembled form starting 0x80 can also start 0x82.
+V: 1.00
+D: ndisasm should know this. New special code in instruction encodings, probably.
+
+F: Pointing an EQU at an external symbol now generates an error.
+V: 1.05
+D: There may be a better way of handling this; we should look into it.
+D: Ideally, the label mechanism should be changed to cope with one
+D: label being declared relative to another - that may work, but could be
+D: a pain to implement (or is it? it may be easy enough that you just
+D: need to declare a new offset in the same segment...) This should be done
+D: before v1.0 is released. There is a comment regarding this in labels.c,
+D: towards the end of the file, which discusses ways of fixing this.
+
+F: nested %rep used to cause a panic.
+V: 1.10
+D: Now a more informative error message is produced. This problem whould
+D: be fixed before v1.0.
+D: See comment in switch() statement block for PP_REP in do_directive()
+D: in preproc.c (line 1585, or thereabouts)
+
+F: Contribution
+D: zgraeme.tar contains improved hash table routines
+D: contributed by Graeme Defty <graeme@HK.Super.NET> for use in the
+D: label manager.
+
+F: Contribution
+D: zsyntax.zip contains a syntax-highlighting mode for
+D: NASM, for use with the Aurora text editor (??).
+
+F: Contribution
+D: zvim.zip contains a syntax-highlighting mode for NASM, for use with vim.
+
+F: Contribution
+D: zkendal1.zip and zkendal2.zip contain Kendall
+D: Bennett's (<KendallB@scitechsoft.com>) alternative syntax stuff,
+D: providing an alternative syntax mode for NASM which allows a macro
+D: set to be written that allows the same source files to be
+D: assembled with NASM and TASM.
+R: Kendall Bennett
+C: 100%
+
+F: Add the UD2 instruction.
+C: 100%
+
+F: Add the four instructions documented in 24368901.pdf (Intel's own document).
+C: 100%
+
+F: Some means of avoiding MOV memoffs,EAX which apparently the
+D: Pentium pairing detector thinks modifies EAX. Similar means of
+D: choosing instruction encodings where necessary.
+V: 1.10?
+
+F: The example of ..@ makes it clear that a ..@ label isn't just
+D: local, but doesn't make it clear that it isn't just global either.
+
+F: hpa wants an evaluator operator for ceil(log2(x)).
+
+F: Extra reloc types in ELF
+D: R_386_16 type 20, PC16 is 21, 8 is 22, PC8 is 23.
+D: Add support for the 16s at least.
+
+F: Lazy section creation or selective section output
+D: in COFF/win32 at least and probably other formats: don't bother to emit a section
+D: if it contains no data. Particularly the default auto-created
+D: section. We believe zero-length sections crash at least WLINK (in win32).
+
+F: Make the flags field in `struct itemplate' in insns.h a long instead of an int.
+C: 100%?
+
+F: Implement %ifref to check whether a single-line macro has ever been expanded since (last re) definition. Or maybe not. We'll see.
+
+F: add pointer to \k{insLEAVE} and \k{insENTER} in chapters about      mixed-language programming.
+
+F: Some equivalent to TASM's GLOBAL directive
+D: ie something which defines a symbol as external if it doesn't end up being defined
+D: but defines it as public if it does end up being defined.
+
+F: Documentation doesn't explain about C++ name mangling.
+
+F: see if BITS can be made to do anything sensible in obj (eg set the default new-segment property to Use32).
+
+F: OBJ: coalesce consecutive offset and segment fixups for the same location into full-32bit-pointer fixups.
+D: This is apparently necessary because some twazzock in the PowerBASIC development
+D: team didn't design to support the OMF spec the way the rest of the
+D: world sees it.
+
+F: Allow % to be separated from the rest of a preproc directive, for   alternative directive indentation styles.
+
+F: __DATE__, __TIME__, and text variants of __NASM_MAJOR__ and __NASM_MINOR__.
+
+F: Warn on TIMES combined with multi-line macros.
+V: 1.00
+D: TIMES gets applied to first line only - should bring to users' attention.
+
+F: Re-work the evaluator, again, with a per-object-format fixup
+D: routine, so as to be able to cope with section offsets "really"
+D: being pure numbers; should be able to allow at _least_ the two
+D: common idioms
+D:   TIMES 510-$ DB 0            ; bootsector
+D:   MOV AX,(PROG_END-100H)/16   ; .COM TSR
+D: Would need to call the fixup throughout the evaluator, and the
+D: fixup would have to be allowed to return UNKNOWN on pass one if it
+D: had to. (_Always_ returning UNKNOWN on pass one, though a lovely
+D: clean design, breaks the first of the above examples.)
+V: 1.10
+
+F: Preprocessor identifier concatenation?
+V: 1.10
+
+F: Arbitrary section names in `bin'.
+V: 0.98.09
+D: Is this necessary? Is it even desirable?
+D: hpa: Desirable, yes.  Necessary?  Probably not, but there are definitely cases where it becomes quite useful.
+R: madfire
+C: 100%
+
+F: Ability to read from a pipe.
+V: 1.10
+D: Obviously not useful under dos, so memory problems with storing
+D: entire input file aren't a problem either.
+
+F: File caching under DOS/32 bit...
+V: 1.10?
+D: maybe even implement discardable buffers that get thrown away
+D: when we get a NULL returned from malloc(). Only really useful under
+D: DOS. Think about it.
+
+F: possibly spool out the pre-processed stuff to a file, to avoid having to re-process it.
+V: 1.10?
+D: Possible problems with preprocessor values not known on pass 1? Have a look...
+
+F: Or maybe we can spool out a pre-parsed version...?
+V: 1.10
+D: Need to investigate feasibility. Does the results from the parser
+D: change from pass 1 to pass 2? Would it be feasible to alter it so that
+D: the parser returns an invariant result, and this is then processed
+D: afterwards to resolve label references, etc?
+
+F: Subsection support?
+
+F: A good ALIGN mechanism, similar to GAS's.
+V: 0.98p1
+D: GAS pads out space by means of the following (32-bit) instructions:
+D:         8DB42600000000    lea esi,[esi+0x0]
+D:         8DB600000000      lea esi,[esi+0x0]
+D:         8D742600          lea esi,[esi+0x0]
+D:         8D7600            lea esi,[esi+0x0]
+D:         8D36              lea esi,[esi]
+D:         90                nop
+D: It uses up to two of these instructions to do up to 14-byte pads;
+D: when more than 14 bytes are needed, it issues a (short) jump to
+D: the end of the padded section and then NOPs the rest. Come up with
+D: a similar scheme for 16 bit mode, and also come up with a way to
+D: use it - internal to the assembler, so that programs using ALIGN
+D: don't knock over preprocess-only mode.
+D:   Also re-work the macro form so that when given one argument in a
+D: code section it calls this feature.
+R: Panos Minos
+C: 100%?
+
+F: Possibly a means whereby FP constants can be specified as immediate operands to non-FP instructions.
+D: * Possible syntax: MOV EAX,FLOAT 1.2 to get a single-precision FP
+D:   constant. Then maybe MOV EAX,HI_FLOAT 1.2 and MOV EAX,LO_FLOAT
+D:   1.2 to get the two halves of a double-precision one. Best to
+D:   ignore extended-precision in case it bites.
+D: * Alternatively, maybe MOV EAX,FLOAT(4,0-4,1.2) to get bytes 0-4
+D:   (ie 0-3) of a 4-byte constant. Then HI_FLOAT is FLOAT(8,4-8,x)
+D:   and LO_FLOAT is FLOAT(8,0-4,x). But this version allows two-byte
+D:   chunks, one-byte chunks, even stranger chunks, and pieces of
+D:   ten-byte reals to be bandied around as well.
+
+F: A UNION macro might be quite cool
+D: now that ABSOLUTE is sane enough to be able to handle it.
+
+F: An equivalent to gcc's ## stringify operator, plus string concatenation
+D: somehow implemented without undue ugliness, so as
+D: to be able to do `%include "/my/path/%1"' in a macro, or something
+D: similar...
+
+F: Actually _do_ something with the processor, privileged and
+D: undocumented flags in the instruction table. When this happens,
+D: consider allowing PMULHRW to map to either of the Cyrix or AMD
+D: versions?
+D: hpa: The -p option to ndisasm now uses this to some extent.
+V: 1.10
+
+F: Maybe NEC V20/V30 instructions?                                     ?
+D: hpa: What are they?  Should be trivial to implement.
+
+F: Yet more object formats.
+D: * Possibly direct support for .EXE files?
+V: 1.10
+
+F: Symbol map in binary format. Format-specific options...
+V: 1.10?
+
+F: REDESIGN: Think about EQU dependency, and about start-point specification in OBJ. Possibly re-think directive support.
+V: 1.20?
+
+F: Think about a wrapper program like gcc?
+V: 2.00?
+D: Possibly invent a _patch_ for gcc so that it can take .asm files on the command line?
+D: If a wrapper happens, think about adding an option to cause the
+D: resulting executable file to be executed immediately, thus
+D: allowing NASM source files to have #!... (probably silly)
+
+F: Multi-platform support?
+D: If so: definitely Alpha; possibly Java byte code;
+D: probably ARM/StrongARM; maybe Sparc; maybe Mips; maybe
+D: Vax. Perhaps Z80 and 6502, just for a laugh?
+
+F: Consider a 'verbose' option that prints information about the resulting object file onto stdout.
+
+F: Line numbers in the .lst file don't match the line numbers in the input.
+D: They probably should, rather than the current matching of the post-preprocessor line numbers.
+
diff --git a/aclocal.m4 b/aclocal.m4
new file mode 100644 (file)
index 0000000..5159c11
--- /dev/null
@@ -0,0 +1,39 @@
+dnl --------------------------------------------------------------------------
+dnl PA_ADD_CFLAGS()
+dnl
+dnl Attempt to add the given option to CFLAGS, if it doesn't break compilation
+dnl --------------------------------------------------------------------------
+AC_DEFUN(PA_ADD_CFLAGS,
+[AC_MSG_CHECKING([if $CC accepts $1])
+ pa_add_cflags__old_cflags="$CFLAGS"
+ CFLAGS="$CFLAGS $1"
+ AC_TRY_LINK([#include <stdio.h>],
+ [printf("Hello, World!\n");],
+ AC_MSG_RESULT([yes]),
+ AC_MSG_RESULT([no])
+ CFLAGS="$pa_add_cflags__old_cflags")])
+
+dnl --------------------------------------------------------------------------
+dnl PA_WORKING_STDBOOL
+dnl
+dnl See if we have a working <stdbool.h> and bool support; in particular,
+dnl OpenWatcom 1.8 has a broken _Bool type that we don't want to use.
+dnl --------------------------------------------------------------------------
+AC_DEFUN(PA_WORKING_BOOL,
+[AC_MSG_CHECKING([if $CC has a working bool type])
+ AC_COMPILE_IFELSE(
+ [
+#ifndef __cplusplus
+#include <stdbool.h>
+#endif
+int foo(bool x, int y)
+{
+       return x+y;
+}
+ ],
+ [AC_MSG_RESULT([yes])
+  AC_DEFINE(HAVE_WORKING_BOOL, 1,
+    [Define to 1 if your compiler has a correct implementation of bool])],
+ [AC_MSG_RESULT([no])])
+])
+
diff --git a/assemble.c b/assemble.c
new file mode 100644 (file)
index 0000000..81476db
--- /dev/null
@@ -0,0 +1,2603 @@
+/* ----------------------------------------------------------------------- *
+ *
+ *   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.
+ *
+ * ----------------------------------------------------------------------- */
+
+/*
+ * assemble.c   code generation for the Netwide Assembler
+ *
+ * the actual codes (C syntax, i.e. octal):
+ * \0            - terminates the code. (Unless it's a literal of course.)
+ * \1..\4       - that many literal bytes follow in the code stream
+ * \5            - add 4 to the primary operand number (b, low octdigit)
+ * \6            - add 4 to the secondary operand number (a, middle octdigit)
+ * \7            - add 4 to both the primary and the secondary operand number
+ * \10..\13      - a literal byte follows in the code stream, to be added
+ *                 to the register value of operand 0..3
+ * \14..\17      - a signed byte immediate operand, from operand 0..3
+ * \20..\23      - a byte immediate operand, from operand 0..3
+ * \24..\27      - an unsigned byte immediate operand, from operand 0..3
+ * \30..\33      - a word immediate operand, from operand 0..3
+ * \34..\37      - select between \3[0-3] and \4[0-3] depending on 16/32 bit
+ *                 assembly mode or the operand-size override on the operand
+ * \40..\43      - a long immediate operand, from operand 0..3
+ * \44..\47      - select between \3[0-3], \4[0-3] and \5[4-7]
+ *                depending on the address size of the instruction.
+ * \50..\53      - a byte relative operand, from operand 0..3
+ * \54..\57      - a qword immediate operand, from operand 0..3
+ * \60..\63      - a word relative operand, from operand 0..3
+ * \64..\67      - select between \6[0-3] and \7[0-3] depending on 16/32 bit
+ *                 assembly mode or the operand-size override on the operand
+ * \70..\73      - a long relative operand, from operand 0..3
+ * \74..\77      - a word constant, from the _segment_ part of operand 0..3
+ * \1ab          - a ModRM, calculated on EA in operand a, with the spare
+ *                 field the register value of operand b.
+ * \140..\143    - an immediate word or signed byte for operand 0..3
+ * \144..\147    - or 2 (s-field) into opcode byte if operand 0..3
+ *                 is a signed byte rather than a word.  Opcode byte follows.
+ * \150..\153    - an immediate dword or signed byte for operand 0..3
+ * \154..\157    - or 2 (s-field) into opcode byte if operand 0..3
+ *                 is a signed byte rather than a dword.  Opcode byte follows.
+ * \160..\163    - this instruction uses DREX rather than REX, with the
+ *                OC0 field set to 0, and the dest field taken from
+ *                 operand 0..3.
+ * \164..\167    - this instruction uses DREX rather than REX, with the
+ *                OC0 field set to 1, and the dest field taken from
+ *                 operand 0..3.
+ * \171                 - placement of DREX suffix in the absence of an EA
+ * \172\ab      - the register number from operand a in bits 7..4, with
+ *                 the 4-bit immediate from operand b in bits 3..0.
+ * \173\xab     - the register number from operand a in bits 7..4, with
+ *                the value b in bits 3..0.
+ * \174\a       - the register number from operand a in bits 7..4, and
+ *                an arbitrary value in bits 3..0 (assembled as zero.)
+ * \2ab          - a ModRM, calculated on EA in operand a, with the spare
+ *                 field equal to digit b.
+ * \250..\253    - same as \150..\153, except warn if the 64-bit operand
+ *                 is not equal to the truncated and sign-extended 32-bit
+ *                 operand; used for 32-bit immediates in 64-bit mode.
+ * \254..\257    - a signed 32-bit operand to be extended to 64 bits.
+ * \260..\263    - this instruction uses VEX/XOP rather than REX, with the
+ *                V field taken from operand 0..3.
+ * \270                 - this instruction uses VEX/XOP rather than REX, with the
+ *                V field set to 1111b.
+ *
+ * VEX/XOP prefixes are followed by the sequence:
+ * \tmm\wlp        where mm is the M field; and wlp is:
+ *                 00 0ww lpp
+ *                 [w0] ww = 0 for W = 0
+ *                 [w1] ww = 1 for W = 1
+ *                 [wx] ww = 2 for W don't care (always assembled as 0)
+ *                 [ww] ww = 3 for W used as REX.W
+ *
+ * t = 0 for VEX (C4/C5), t = 1 for XOP (8F).
+ *
+ * \274..\277    - a signed byte immediate operand, from operand 0..3,
+ *                 which is to be extended to the operand size.
+ * \310          - indicates fixed 16-bit address size, i.e. optional 0x67.
+ * \311          - indicates fixed 32-bit address size, i.e. optional 0x67.
+ * \312          - (disassembler only) invalid with non-default address size.
+ * \313          - indicates fixed 64-bit address size, 0x67 invalid.
+ * \314          - (disassembler only) invalid with REX.B
+ * \315          - (disassembler only) invalid with REX.X
+ * \316          - (disassembler only) invalid with REX.R
+ * \317          - (disassembler only) invalid with REX.W
+ * \320          - indicates fixed 16-bit operand size, i.e. optional 0x66.
+ * \321          - indicates fixed 32-bit operand size, i.e. optional 0x66.
+ * \322          - indicates that this instruction is only valid when the
+ *                 operand size is the default (instruction to disassembler,
+ *                 generates no code in the assembler)
+ * \323          - indicates fixed 64-bit operand size, REX on extensions only.
+ * \324          - indicates 64-bit operand size requiring REX prefix.
+ * \325                 - instruction which always uses spl/bpl/sil/dil
+ * \330          - a literal byte follows in the code stream, to be added
+ *                 to the condition code value of the instruction.
+ * \331          - instruction not valid with REP prefix.  Hint for
+ *                 disassembler only; for SSE instructions.
+ * \332          - REP prefix (0xF2 byte) used as opcode extension.
+ * \333          - REP prefix (0xF3 byte) used as opcode extension.
+ * \334          - LOCK prefix used as REX.R (used in non-64-bit mode)
+ * \335          - disassemble a rep (0xF3 byte) prefix as repe not rep.
+ * \336          - force a REP(E) prefix (0xF2) even if not specified.
+ * \337                 - force a REPNE prefix (0xF3) even if not specified.
+ *                 \336-\337 are still listed as prefixes in the disassembler.
+ * \340          - reserve <operand 0> bytes of uninitialized storage.
+ *                 Operand 0 had better be a segmentless constant.
+ * \341                 - this instruction needs a WAIT "prefix"
+ * \344,\345     - the PUSH/POP (respectively) codes for CS, DS, ES, SS
+ *                 (POP is never used for CS) depending on operand 0
+ * \346,\347     - the second byte of PUSH/POP codes for FS, GS, depending
+ *                 on operand 0
+ * \360                 - no SSE prefix (== \364\331)
+ * \361          - 66 SSE prefix (== \366\331)
+ * \362          - F2 SSE prefix (== \364\332)
+ * \363          - F3 SSE prefix (== \364\333)
+ * \364          - operand-size prefix (0x66) not permitted
+ * \365          - address-size prefix (0x67) not permitted
+ * \366          - operand-size prefix (0x66) used as opcode extension
+ * \367          - address-size prefix (0x67) used as opcode extension
+ * \370,\371,\372 - match only if operand 0 meets byte jump criteria.
+ *                370 is used for Jcc, 371 is used for JMP.
+ * \373                 - assemble 0x03 if bits==16, 0x05 if bits==32;
+ *                used for conditional jump over longer jump
+ */
+
+#include "compiler.h"
+
+#include <stdio.h>
+#include <string.h>
+#include <inttypes.h>
+
+#include "nasm.h"
+#include "nasmlib.h"
+#include "assemble.h"
+#include "insns.h"
+#include "tables.h"
+
+enum match_result {
+    /*
+     * Matching errors.  These should be sorted so that more specific
+     * errors come later in the sequence.
+     */
+    MERR_INVALOP,
+    MERR_OPSIZEMISSING,
+    MERR_OPSIZEMISMATCH,
+    MERR_BADCPU,
+    MERR_BADMODE,
+    /*
+     * Matching success; the conditional ones first
+     */
+    MOK_JUMP,                  /* Matching OK but needs jmp_match() */
+    MOK_GOOD                   /* Matching unconditionally OK */
+};
+
+typedef struct {
+    int sib_present;                 /* is a SIB byte necessary? */
+    int bytes;                       /* # of bytes of offset needed */
+    int size;                        /* lazy - this is sib+bytes+1 */
+    uint8_t modrm, sib, rex, rip;    /* the bytes themselves */
+} ea;
+
+static uint32_t cpu;            /* cpu level received from nasm.c */
+static efunc errfunc;
+static struct ofmt *outfmt;
+static ListGen *list;
+
+static int64_t calcsize(int32_t, int64_t, int, insn *, const uint8_t *);
+static void gencode(int32_t segment, int64_t offset, int bits,
+                    insn * ins, const struct itemplate *temp,
+                   int64_t insn_end);
+static enum match_result find_match(const struct itemplate **tempp,
+                                   insn *instruction,
+                                   int32_t segment, int64_t offset, int bits);
+static enum match_result matches(const struct itemplate *, insn *, int bits);
+static opflags_t regflag(const operand *);
+static int32_t regval(const operand *);
+static int rexflags(int, opflags_t, int);
+static int op_rexflags(const operand *, int);
+static ea *process_ea(operand *, ea *, int, int, int, opflags_t);
+static void add_asp(insn *, int);
+
+static int has_prefix(insn * ins, enum prefix_pos pos, enum prefixes prefix)
+{
+    return ins->prefixes[pos] == prefix;
+}
+
+static void assert_no_prefix(insn * ins, enum prefix_pos pos)
+{
+    if (ins->prefixes[pos])
+       errfunc(ERR_NONFATAL, "invalid %s prefix",
+               prefix_name(ins->prefixes[pos]));
+}
+
+static const char *size_name(int size)
+{
+    switch (size) {
+    case 1:
+       return "byte";
+    case 2:
+       return "word";
+    case 4:
+       return "dword";
+    case 8:
+       return "qword";
+    case 10:
+       return "tword";
+    case 16:
+       return "oword";
+    case 32:
+       return "yword";
+    default:
+       return "???";
+    }
+}
+
+static void warn_overflow(int pass, int size)
+{
+    errfunc(ERR_WARNING | pass | ERR_WARN_NOV,
+            "%s data exceeds bounds", size_name(size));
+}
+
+static void warn_overflow_const(int64_t data, int size)
+{
+    if (overflow_general(data, size))
+        warn_overflow(ERR_PASS1, size);
+}
+
+static void warn_overflow_opd(const struct operand *o, int size)
+{
+    if (size < 8 && o->wrt == NO_SEG && o->segment == NO_SEG) {
+        if (overflow_general(o->offset, size))
+            warn_overflow(ERR_PASS2, size);
+    }
+}
+
+/*
+ * This routine wrappers the real output format's output routine,
+ * in order to pass a copy of the data off to the listing file
+ * generator at the same time.
+ */
+static void out(int64_t offset, int32_t segto, const void *data,
+                enum out_type type, uint64_t size,
+               int32_t segment, int32_t wrt)
+{
+    static int32_t lineno = 0;     /* static!!! */
+    static char *lnfname = NULL;
+    uint8_t p[8];
+
+    if (type == OUT_ADDRESS && segment == NO_SEG && wrt == NO_SEG) {
+       /*
+        * This is a non-relocated address, and we're going to
+        * convert it into RAWDATA format.
+        */
+       uint8_t *q = p;
+
+       if (size > 8) {
+           errfunc(ERR_PANIC, "OUT_ADDRESS with size > 8");
+           return;
+       }
+
+       WRITEADDR(q, *(int64_t *)data, size);
+       data = p;
+       type = OUT_RAWDATA;
+    }
+
+    list->output(offset, data, type, size);
+
+    /*
+     * this call to src_get determines when we call the
+     * debug-format-specific "linenum" function
+     * it updates lineno and lnfname to the current values
+     * returning 0 if "same as last time", -2 if lnfname
+     * changed, and the amount by which lineno changed,
+     * if it did. thus, these variables must be static
+     */
+
+    if (src_get(&lineno, &lnfname)) {
+        outfmt->current_dfmt->linenum(lnfname, lineno, segto);
+    }
+
+    outfmt->output(segto, data, type, size, segment, wrt);
+}
+
+static bool jmp_match(int32_t segment, int64_t offset, int bits,
+                     insn * ins, const uint8_t *code)
+{
+    int64_t isize;
+    uint8_t c = code[0];
+
+    if ((c != 0370 && c != 0371) || (ins->oprs[0].type & STRICT))
+        return false;
+    if (!optimizing)
+       return false;
+    if (optimizing < 0 && c == 0371)
+       return false;
+
+    isize = calcsize(segment, offset, bits, ins, code);
+
+    if (ins->oprs[0].opflags & OPFLAG_UNKNOWN)
+        /* Be optimistic in pass 1 */
+        return true;
+
+    if (ins->oprs[0].segment != segment)
+        return false;
+
+    isize = ins->oprs[0].offset - offset - isize; /* isize is delta */
+    return (isize >= -128 && isize <= 127); /* is it byte size? */
+}
+
+int64_t assemble(int32_t segment, int64_t offset, int bits, uint32_t cp,
+                insn * instruction, struct ofmt *output, efunc error,
+                ListGen * listgen)
+{
+    const struct itemplate *temp;
+    int j;
+    enum match_result m;
+    int64_t insn_end;
+    int32_t itimes;
+    int64_t start = offset;
+    int64_t wsize;              /* size for DB etc. */
+
+    errfunc = error;            /* to pass to other functions */
+    cpu = cp;
+    outfmt = output;            /* likewise */
+    list = listgen;             /* and again */
+
+    wsize = idata_bytes(instruction->opcode);
+    if (wsize == -1)
+        return 0;
+
+    if (wsize) {
+        extop *e;
+        int32_t t = instruction->times;
+        if (t < 0)
+            errfunc(ERR_PANIC,
+                    "instruction->times < 0 (%ld) in assemble()", t);
+
+        while (t--) {           /* repeat TIMES times */
+            list_for_each(e, instruction->eops) {
+                if (e->type == EOT_DB_NUMBER) {
+                    if (wsize == 1) {
+                        if (e->segment != NO_SEG)
+                            errfunc(ERR_NONFATAL,
+                                    "one-byte relocation attempted");
+                        else {
+                            uint8_t out_byte = e->offset;
+                            out(offset, segment, &out_byte,
+                                OUT_RAWDATA, 1, NO_SEG, NO_SEG);
+                        }
+                    } else if (wsize > 8) {
+                        errfunc(ERR_NONFATAL,
+                               "integer supplied to a DT, DO or DY"
+                                " instruction");
+                    } else
+                        out(offset, segment, &e->offset,
+                            OUT_ADDRESS, wsize, e->segment, e->wrt);
+                    offset += wsize;
+                } else if (e->type == EOT_DB_STRING ||
+                          e->type == EOT_DB_STRING_FREE) {
+                    int align;
+
+                    out(offset, segment, e->stringval,
+                        OUT_RAWDATA, e->stringlen, NO_SEG, NO_SEG);
+                    align = e->stringlen % wsize;
+
+                    if (align) {
+                        align = wsize - align;
+                        out(offset, segment, zero_buffer,
+                            OUT_RAWDATA, align, NO_SEG, NO_SEG);
+                    }
+                    offset += e->stringlen + align;
+                }
+            }
+            if (t > 0 && t == instruction->times - 1) {
+                /*
+                 * Dummy call to list->output to give the offset to the
+                 * listing module.
+                 */
+                list->output(offset, NULL, OUT_RAWDATA, 0);
+                list->uplevel(LIST_TIMES);
+            }
+        }
+        if (instruction->times > 1)
+            list->downlevel(LIST_TIMES);
+        return offset - start;
+    }
+
+    if (instruction->opcode == I_INCBIN) {
+        const char *fname = instruction->eops->stringval;
+        FILE *fp;
+
+       fp = fopen(fname, "rb");
+       if (!fp) {
+            error(ERR_NONFATAL, "`incbin': unable to open file `%s'",
+                  fname);
+       } else if (fseek(fp, 0L, SEEK_END) < 0) {
+            error(ERR_NONFATAL, "`incbin': unable to seek on file `%s'",
+                  fname);
+       } else {
+            static char buf[4096];
+            size_t t = instruction->times;
+            size_t base = 0;
+           size_t len;
+
+            len = ftell(fp);
+            if (instruction->eops->next) {
+                base = instruction->eops->next->offset;
+                len -= base;
+                if (instruction->eops->next->next &&
+                    len > (size_t)instruction->eops->next->next->offset)
+                    len = (size_t)instruction->eops->next->next->offset;
+            }
+            /*
+             * Dummy call to list->output to give the offset to the
+             * listing module.
+             */
+            list->output(offset, NULL, OUT_RAWDATA, 0);
+            list->uplevel(LIST_INCBIN);
+            while (t--) {
+                size_t l;
+
+                fseek(fp, base, SEEK_SET);
+                l = len;
+                while (l > 0) {
+                    int32_t m;
+                   m = fread(buf, 1, l > sizeof(buf) ? sizeof(buf) : l, fp);
+                    if (!m) {
+                        /*
+                         * This shouldn't happen unless the file
+                         * actually changes while we are reading
+                         * it.
+                         */
+                        error(ERR_NONFATAL,
+                              "`incbin': unexpected EOF while"
+                              " reading file `%s'", fname);
+                        t = 0;  /* Try to exit cleanly */
+                        break;
+                    }
+                    out(offset, segment, buf, OUT_RAWDATA, m,
+                        NO_SEG, NO_SEG);
+                    l -= m;
+                }
+            }
+            list->downlevel(LIST_INCBIN);
+            if (instruction->times > 1) {
+                /*
+                 * Dummy call to list->output to give the offset to the
+                 * listing module.
+                 */
+                list->output(offset, NULL, OUT_RAWDATA, 0);
+                list->uplevel(LIST_TIMES);
+                list->downlevel(LIST_TIMES);
+            }
+            fclose(fp);
+            return instruction->times * len;
+        }
+        return 0;               /* if we're here, there's an error */
+    }
+
+    /* Check to see if we need an address-size prefix */
+    add_asp(instruction, bits);
+
+    m = find_match(&temp, instruction, segment, offset, bits);
+
+    if (m == MOK_GOOD) {
+       /* Matches! */
+       int64_t insn_size = calcsize(segment, offset, bits,
+                                    instruction, temp->code);
+       itimes = instruction->times;
+       if (insn_size < 0)  /* shouldn't be, on pass two */
+           error(ERR_PANIC, "errors made it through from pass one");
+       else
+           while (itimes--) {
+               for (j = 0; j < MAXPREFIX; j++) {
+                   uint8_t c = 0;
+                   switch (instruction->prefixes[j]) {
+                   case P_WAIT:
+                       c = 0x9B;
+                       break;
+                   case P_LOCK:
+                       c = 0xF0;
+                       break;
+                   case P_REPNE:
+                   case P_REPNZ:
+                       c = 0xF2;
+                       break;
+                   case P_REPE:
+                   case P_REPZ:
+                   case P_REP:
+                       c = 0xF3;
+                       break;
+                   case R_CS:
+                       if (bits == 64) {
+                           error(ERR_WARNING | ERR_PASS2,
+                                 "cs segment base generated, but will be ignored in 64-bit mode");
+                       }
+                       c = 0x2E;
+                       break;
+                   case R_DS:
+                       if (bits == 64) {
+                           error(ERR_WARNING | ERR_PASS2,
+                                 "ds segment base generated, but will be ignored in 64-bit mode");
+                       }
+                       c = 0x3E;
+                       break;
+                   case R_ES:
+                       if (bits == 64) {
+                           error(ERR_WARNING | ERR_PASS2,
+                                 "es segment base generated, but will be ignored in 64-bit mode");
+                       }
+                       c = 0x26;
+                       break;
+                   case R_FS:
+                       c = 0x64;
+                       break;
+                   case R_GS:
+                       c = 0x65;
+                       break;
+                   case R_SS:
+                       if (bits == 64) {
+                           error(ERR_WARNING | ERR_PASS2,
+                                 "ss segment base generated, but will be ignored in 64-bit mode");
+                       }
+                       c = 0x36;
+                       break;
+                   case R_SEGR6:
+                   case R_SEGR7:
+                       error(ERR_NONFATAL,
+                             "segr6 and segr7 cannot be used as prefixes");
+                       break;
+                   case P_A16:
+                       if (bits == 64) {
+                           error(ERR_NONFATAL,
+                                 "16-bit addressing is not supported "
+                                 "in 64-bit mode");
+                       } else if (bits != 16)
+                           c = 0x67;
+                       break;
+                   case P_A32:
+                       if (bits != 32)
+                           c = 0x67;
+                       break;
+                   case P_A64:
+                       if (bits != 64) {
+                           error(ERR_NONFATAL,
+                                 "64-bit addressing is only supported "
+                                 "in 64-bit mode");
+                       }
+                       break;
+                   case P_ASP:
+                       c = 0x67;
+                       break;
+                   case P_O16:
+                       if (bits != 16)
+                           c = 0x66;
+                       break;
+                   case P_O32:
+                       if (bits == 16)
+                           c = 0x66;
+                       break;
+                   case P_O64:
+                       /* REX.W */
+                       break;
+                   case P_OSP:
+                       c = 0x66;
+                       break;
+                   case P_none:
+                       break;
+                   default:
+                       error(ERR_PANIC, "invalid instruction prefix");
+                   }
+                   if (c != 0) {
+                       out(offset, segment, &c, OUT_RAWDATA, 1,
+                           NO_SEG, NO_SEG);
+                       offset++;
+                   }
+               }
+               insn_end = offset + insn_size;
+               gencode(segment, offset, bits, instruction,
+                       temp, insn_end);
+               offset += insn_size;
+               if (itimes > 0 && itimes == instruction->times - 1) {
+                   /*
+                    * Dummy call to list->output to give the offset to the
+                    * listing module.
+                    */
+                   list->output(offset, NULL, OUT_RAWDATA, 0);
+                   list->uplevel(LIST_TIMES);
+               }
+           }
+       if (instruction->times > 1)
+           list->downlevel(LIST_TIMES);
+       return offset - start;
+    } else {
+       /* No match */
+       switch (m) {
+       case MERR_OPSIZEMISSING:
+           error(ERR_NONFATAL, "operation size not specified");
+           break;
+       case MERR_OPSIZEMISMATCH:
+            error(ERR_NONFATAL, "mismatch in operand sizes");
+           break;
+       case MERR_BADCPU:
+            error(ERR_NONFATAL, "no instruction for this cpu level");
+           break;
+       case MERR_BADMODE:
+            error(ERR_NONFATAL, "instruction not supported in %d-bit mode",
+                 bits);
+           break;
+       default:
+            error(ERR_NONFATAL,
+                  "invalid combination of opcode and operands");
+           break;
+       }
+    }
+    return 0;
+}
+
+int64_t insn_size(int32_t segment, int64_t offset, int bits, uint32_t cp,
+                 insn * instruction, efunc error)
+{
+    const struct itemplate *temp;
+    enum match_result m;
+
+    errfunc = error;            /* to pass to other functions */
+    cpu = cp;
+
+    if (instruction->opcode == I_none)
+        return 0;
+
+    if (instruction->opcode == I_DB || instruction->opcode == I_DW ||
+        instruction->opcode == I_DD || instruction->opcode == I_DQ ||
+       instruction->opcode == I_DT || instruction->opcode == I_DO ||
+       instruction->opcode == I_DY) {
+        extop *e;
+        int32_t isize, osize, wsize;
+
+        isize = 0;
+        wsize = idata_bytes(instruction->opcode);
+
+        list_for_each(e, instruction->eops) {
+            int32_t align;
+
+            osize = 0;
+            if (e->type == EOT_DB_NUMBER) {
+                osize = 1;
+                warn_overflow_const(e->offset, wsize);
+            } else if (e->type == EOT_DB_STRING ||
+                       e->type == EOT_DB_STRING_FREE)
+                osize = e->stringlen;
+
+            align = (-osize) % wsize;
+            if (align < 0)
+                align += wsize;
+            isize += osize + align;
+        }
+        return isize * instruction->times;
+    }
+
+    if (instruction->opcode == I_INCBIN) {
+       const char *fname = instruction->eops->stringval;
+        FILE *fp;
+        int64_t val = 0;
+        size_t len;
+
+       fp = fopen(fname, "rb");
+       if (!fp)
+            error(ERR_NONFATAL, "`incbin': unable to open file `%s'",
+                  fname);
+        else if (fseek(fp, 0L, SEEK_END) < 0)
+            error(ERR_NONFATAL, "`incbin': unable to seek on file `%s'",
+                  fname);
+        else {
+            len = ftell(fp);
+            if (instruction->eops->next) {
+                len -= instruction->eops->next->offset;
+                if (instruction->eops->next->next &&
+                    len > (size_t)instruction->eops->next->next->offset) {
+                    len = (size_t)instruction->eops->next->next->offset;
+                }
+            }
+            val = instruction->times * len;
+        }
+        if (fp)
+            fclose(fp);
+        return val;
+    }
+
+    /* Check to see if we need an address-size prefix */
+    add_asp(instruction, bits);
+
+    m = find_match(&temp, instruction, segment, offset, bits);
+    if (m == MOK_GOOD) {
+       /* we've matched an instruction. */
+       int64_t isize;
+       const uint8_t *codes = temp->code;
+       int j;
+       
+       isize = calcsize(segment, offset, bits, instruction, codes);
+       if (isize < 0)
+           return -1;
+       for (j = 0; j < MAXPREFIX; j++) {
+           switch (instruction->prefixes[j]) {
+           case P_A16:
+               if (bits != 16)
+                   isize++;
+               break;
+           case P_A32:
+               if (bits != 32)
+                   isize++;
+               break;
+           case P_O16:
+               if (bits != 16)
+                   isize++;
+               break;
+           case P_O32:
+               if (bits == 16)
+                   isize++;
+               break;
+           case P_A64:
+           case P_O64:
+           case P_none:
+               break;
+           default:
+               isize++;
+               break;
+           }
+       }
+       return isize * instruction->times;
+    } else {
+       return -1;                  /* didn't match any instruction */
+    }
+}
+
+static bool possible_sbyte(operand *o)
+{
+    return o->wrt == NO_SEG && o->segment == NO_SEG &&
+       !(o->opflags & OPFLAG_UNKNOWN) &&
+       optimizing >= 0 && !(o->type & STRICT);
+}
+
+/* check that opn[op]  is a signed byte of size 16 or 32 */
+static bool is_sbyte16(operand *o)
+{
+    int16_t v;
+
+    if (!possible_sbyte(o))
+       return false;
+
+    v = o->offset;
+    return v >= -128 && v <= 127;
+}
+
+static bool is_sbyte32(operand *o)
+{
+    int32_t v;
+
+    if (!possible_sbyte(o))
+       return false;
+
+    v = o->offset;
+    return v >= -128 && v <= 127;
+}
+
+/* Common construct */
+#define case4(x) case (x): case (x)+1: case (x)+2: case (x)+3
+
+static int64_t calcsize(int32_t segment, int64_t offset, int bits,
+                       insn * ins, const uint8_t *codes)
+{
+    int64_t length = 0;
+    uint8_t c;
+    int rex_mask = ~0;
+    int op1, op2;
+    struct operand *opx;
+    uint8_t opex = 0;
+
+    ins->rex = 0;               /* Ensure REX is reset */
+
+    if (ins->prefixes[PPS_OSIZE] == P_O64)
+       ins->rex |= REX_W;
+
+    (void)segment;              /* Don't warn that this parameter is unused */
+    (void)offset;               /* Don't warn that this parameter is unused */
+
+    while (*codes) {
+       c = *codes++;
+       op1 = (c & 3) + ((opex & 1) << 2);
+       op2 = ((c >> 3) & 3) + ((opex & 2) << 1);
+       opx = &ins->oprs[op1];
+       opex = 0;               /* For the next iteration */
+
+        switch (c) {
+        case 01:
+        case 02:
+        case 03:
+       case 04:
+            codes += c, length += c;
+            break;
+
+       case 05:
+       case 06:
+       case 07:
+           opex = c;
+           break;
+
+       case4(010):
+           ins->rex |=
+               op_rexflags(opx, REX_B|REX_H|REX_P|REX_W);
+            codes++, length++;
+            break;
+
+       case4(014):
+       case4(020):
+       case4(024):
+            length++;
+            break;
+
+       case4(030):
+            length += 2;
+            break;
+
+       case4(034):
+            if (opx->type & (BITS16 | BITS32 | BITS64))
+                length += (opx->type & BITS16) ? 2 : 4;
+            else
+                length += (bits == 16) ? 2 : 4;
+            break;
+
+       case4(040):
+            length += 4;
+            break;
+
+       case4(044):
+            length += ins->addr_size >> 3;
+            break;
+
+       case4(050):
+            length++;
+            break;
+
+       case4(054):
+            length += 8; /* MOV reg64/imm */
+            break;
+
+       case4(060):
+            length += 2;
+            break;
+
+       case4(064):
+            if (opx->type & (BITS16 | BITS32 | BITS64))
+                length += (opx->type & BITS16) ? 2 : 4;
+            else
+                length += (bits == 16) ? 2 : 4;
+            break;
+
+       case4(070):
+            length += 4;
+            break;
+
+       case4(074):
+            length += 2;
+            break;
+
+       case4(0140):
+            length += is_sbyte16(opx) ? 1 : 2;
+            break;
+
+       case4(0144):
+            codes++;
+            length++;
+            break;
+
+       case4(0150):
+            length += is_sbyte32(opx) ? 1 : 4;
+            break;
+
+       case4(0154):
+            codes++;
+            length++;
+            break;
+
+       case4(0160):
+           length++;
+           ins->rex |= REX_D;
+           ins->drexdst = regval(opx);
+           break;
+
+       case4(0164):
+           length++;
+           ins->rex |= REX_D|REX_OC;
+           ins->drexdst = regval(opx);
+           break;
+
+       case 0171:
+           break;
+
+       case 0172:
+       case 0173:
+       case 0174:
+           codes++;
+           length++;
+           break;
+
+       case4(0250):
+            length += is_sbyte32(opx) ? 1 : 4;
+            break;
+
+       case4(0254):
+           length += 4;
+           break;
+
+       case4(0260):
+           ins->rex |= REX_V;
+           ins->drexdst = regval(opx);
+           ins->vex_cm = *codes++;
+           ins->vex_wlp = *codes++;
+           break;
+
+       case 0270:
+           ins->rex |= REX_V;
+           ins->drexdst = 0;
+           ins->vex_cm = *codes++;
+           ins->vex_wlp = *codes++;
+           break;
+
+       case4(0274):
+            length++;
+            break;
+
+       case4(0300):
+            break;
+
+        case 0310:
+           if (bits == 64)
+               return -1;
+            length += (bits != 16) && !has_prefix(ins, PPS_ASIZE, P_A16);
+            break;
+
+        case 0311:
+            length += (bits != 32) && !has_prefix(ins, PPS_ASIZE, P_A32);
+            break;
+
+        case 0312:
+            break;
+
+        case 0313:
+           if (bits != 64 || has_prefix(ins, PPS_ASIZE, P_A16) ||
+               has_prefix(ins, PPS_ASIZE, P_A32))
+               return -1;
+            break;
+
+       case4(0314):
+           break;
+
+        case 0320:
+            length += (bits != 16);
+            break;
+
+        case 0321:
+            length += (bits == 16);
+            break;
+
+        case 0322:
+            break;
+
+        case 0323:
+            rex_mask &= ~REX_W;
+            break;
+
+        case 0324:
+           ins->rex |= REX_W;
+            break;
+
+       case 0325:
+           ins->rex |= REX_NH;
+           break;
+
+        case 0330:
+            codes++, length++;
+            break;
+
+        case 0331:
+            break;
+
+        case 0332:
+        case 0333:
+            length++;
+            break;
+
+       case 0334:
+           ins->rex |= REX_L;
+           break;
+
+        case 0335:
+           break;
+
+       case 0336:
+           if (!ins->prefixes[PPS_LREP])
+               ins->prefixes[PPS_LREP] = P_REP;
+           break;
+
+       case 0337:
+           if (!ins->prefixes[PPS_LREP])
+               ins->prefixes[PPS_LREP] = P_REPNE;
+           break;
+
+        case 0340:
+            if (ins->oprs[0].segment != NO_SEG)
+                errfunc(ERR_NONFATAL, "attempt to reserve non-constant"
+                        " quantity of BSS space");
+            else
+                length += ins->oprs[0].offset;
+            break;
+
+       case 0341:
+           if (!ins->prefixes[PPS_WAIT])
+               ins->prefixes[PPS_WAIT] = P_WAIT;
+           break;
+
+       case4(0344):
+            length++;
+            break;
+
+       case 0360:
+           break;
+
+       case 0361:
+       case 0362:
+       case 0363:
+           length++;
+           break;
+
+       case 0364:
+       case 0365:
+           break;
+
+        case 0366:
+        case 0367:
+           length++;
+           break;
+
+        case 0370:
+        case 0371:
+        case 0372:
+            break;
+
+        case 0373:
+            length++;
+            break;
+
+       case4(0100):
+       case4(0110):
+       case4(0120):
+       case4(0130):
+       case4(0200):
+       case4(0204):
+       case4(0210):
+       case4(0214):
+       case4(0220):
+       case4(0224):
+       case4(0230):
+       case4(0234):
+           {
+                ea ea_data;
+                int rfield;
+               opflags_t rflags;
+               struct operand *opy = &ins->oprs[op2];
+
+                ea_data.rex = 0;           /* Ensure ea.REX is initially 0 */
+
+               if (c <= 0177) {
+                   /* pick rfield from operand b (opx) */
+                   rflags = regflag(opx);
+                   rfield = nasm_regvals[opx->basereg];
+               } else {
+                   rflags = 0;
+                   rfield = c & 7;
+               }
+                if (!process_ea(opy, &ea_data, bits,
+                               ins->addr_size, rfield, rflags)) {
+                    errfunc(ERR_NONFATAL, "invalid effective address");
+                    return -1;
+                } else {
+                   ins->rex |= ea_data.rex;
+                    length += ea_data.size;
+                }
+           }
+           break;
+
+       default:
+           errfunc(ERR_PANIC, "internal instruction table corrupt"
+                   ": instruction code \\%o (0x%02X) given", c, c);
+           break;
+       }
+    }
+
+    ins->rex &= rex_mask;
+
+    if (ins->rex & REX_NH) {
+       if (ins->rex & REX_H) {
+           errfunc(ERR_NONFATAL, "instruction cannot use high registers");
+           return -1;
+       }
+       ins->rex &= ~REX_P;     /* Don't force REX prefix due to high reg */
+    }
+
+    if (ins->rex & REX_V) {
+       int bad32 = REX_R|REX_W|REX_X|REX_B;
+
+       if (ins->rex & REX_H) {
+           errfunc(ERR_NONFATAL, "cannot use high register in vex instruction");
+           return -1;
+       }
+       switch (ins->vex_wlp & 030) {
+       case 000:
+       case 020:
+           ins->rex &= ~REX_W;
+           break;
+       case 010:
+           ins->rex |= REX_W;
+           bad32 &= ~REX_W;
+           break;
+       case 030:
+           /* Follow REX_W */
+           break;
+       }
+
+       if (bits != 64 && ((ins->rex & bad32) || ins->drexdst > 7)) {
+           errfunc(ERR_NONFATAL, "invalid operands in non-64-bit mode");
+           return -1;
+       }
+       if (ins->vex_cm != 1 || (ins->rex & (REX_W|REX_R|REX_B)))
+           length += 3;
+       else
+           length += 2;
+    } else if (ins->rex & REX_D) {
+       if (ins->rex & REX_H) {
+           errfunc(ERR_NONFATAL, "cannot use high register in drex instruction");
+           return -1;
+       }
+       if (bits != 64 && ((ins->rex & (REX_R|REX_W|REX_X|REX_B)) ||
+                          ins->drexdst > 7)) {
+           errfunc(ERR_NONFATAL, "invalid operands in non-64-bit mode");
+           return -1;
+       }
+       length++;
+    } else if (ins->rex & REX_REAL) {
+       if (ins->rex & REX_H) {
+           errfunc(ERR_NONFATAL, "cannot use high register in rex instruction");
+           return -1;
+       } else if (bits == 64) {
+           length++;
+       } else if ((ins->rex & REX_L) &&
+                  !(ins->rex & (REX_P|REX_W|REX_X|REX_B)) &&
+                  cpu >= IF_X86_64) {
+           /* LOCK-as-REX.R */
+           assert_no_prefix(ins, PPS_LREP);
+           length++;
+       } else {
+           errfunc(ERR_NONFATAL, "invalid operands in non-64-bit mode");
+           return -1;
+       }
+    }
+
+    return length;
+}
+
+#define EMIT_REX()                                                     \
+    if (!(ins->rex & (REX_D|REX_V)) && (ins->rex & REX_REAL) && (bits == 64)) { \
+       ins->rex = (ins->rex & REX_REAL)|REX_P;                         \
+       out(offset, segment, &ins->rex, OUT_RAWDATA, 1, NO_SEG, NO_SEG); \
+       ins->rex = 0;                                                   \
+       offset += 1; \
+    }
+
+static void gencode(int32_t segment, int64_t offset, int bits,
+                    insn * ins, const struct itemplate *temp,
+                   int64_t insn_end)
+{
+    static char condval[] = {   /* conditional opcodes */
+        0x7, 0x3, 0x2, 0x6, 0x2, 0x4, 0xF, 0xD, 0xC, 0xE, 0x6, 0x2,
+        0x3, 0x7, 0x3, 0x5, 0xE, 0xC, 0xD, 0xF, 0x1, 0xB, 0x9, 0x5,
+        0x0, 0xA, 0xA, 0xB, 0x8, 0x4
+    };
+    uint8_t c;
+    uint8_t bytes[4];
+    int64_t size;
+    int64_t data;
+    int op1, op2;
+    struct operand *opx;
+    const uint8_t *codes = temp->code;
+    uint8_t opex = 0;
+
+    while (*codes) {
+       c = *codes++;
+       op1 = (c & 3) + ((opex & 1) << 2);
+       op2 = ((c >> 3) & 3) + ((opex & 2) << 1);
+       opx = &ins->oprs[op1];
+       opex = 0;               /* For the next iteration */
+
+        switch (c) {
+        case 01:
+        case 02:
+        case 03:
+       case 04:
+           EMIT_REX();
+            out(offset, segment, codes, OUT_RAWDATA, c, NO_SEG, NO_SEG);
+            codes += c;
+            offset += c;
+            break;
+
+       case 05:
+       case 06:
+       case 07:
+           opex = c;
+           break;
+
+       case4(010):
+           EMIT_REX();
+            bytes[0] = *codes++ + (regval(opx) & 7);
+            out(offset, segment, bytes, OUT_RAWDATA, 1, NO_SEG, NO_SEG);
+            offset += 1;
+            break;
+
+       case4(014):
+           /* The test for BITS8 and SBYTE here is intended to avoid
+              warning on optimizer actions due to SBYTE, while still
+              warn on explicit BYTE directives.  Also warn, obviously,
+              if the optimizer isn't enabled. */
+            if (((opx->type & BITS8) ||
+                !(opx->type & temp->opd[op1] & BYTENESS)) &&
+               (opx->offset < -128 || opx->offset > 127)) {
+                errfunc(ERR_WARNING | ERR_PASS2 | ERR_WARN_NOV,
+                       "signed byte value exceeds bounds");
+           }
+            if (opx->segment != NO_SEG) {
+                data = opx->offset;
+                out(offset, segment, &data, OUT_ADDRESS, 1,
+                    opx->segment, opx->wrt);
+            } else {
+                bytes[0] = opx->offset;
+                out(offset, segment, bytes, OUT_RAWDATA, 1, NO_SEG,
+                    NO_SEG);
+            }
+            offset += 1;
+            break;
+
+       case4(020):
+            if (opx->offset < -256 || opx->offset > 255) {
+                errfunc(ERR_WARNING | ERR_PASS2 | ERR_WARN_NOV,
+                       "byte value exceeds bounds");
+            }
+            if (opx->segment != NO_SEG) {
+                data = opx->offset;
+                out(offset, segment, &data, OUT_ADDRESS, 1,
+                    opx->segment, opx->wrt);
+            } else {
+                bytes[0] = opx->offset;
+                out(offset, segment, bytes, OUT_RAWDATA, 1, NO_SEG,
+                    NO_SEG);
+            }
+            offset += 1;
+            break;
+
+       case4(024):
+            if (opx->offset < 0 || opx->offset > 255)
+                errfunc(ERR_WARNING | ERR_PASS2 | ERR_WARN_NOV,
+                       "unsigned byte value exceeds bounds");
+            if (opx->segment != NO_SEG) {
+                data = opx->offset;
+                out(offset, segment, &data, OUT_ADDRESS, 1,
+                    opx->segment, opx->wrt);
+            } else {
+                bytes[0] = opx->offset;
+                out(offset, segment, bytes, OUT_RAWDATA, 1, NO_SEG,
+                    NO_SEG);
+            }
+            offset += 1;
+            break;
+
+       case4(030):
+            warn_overflow_opd(opx, 2);
+            data = opx->offset;
+            out(offset, segment, &data, OUT_ADDRESS, 2,
+                opx->segment, opx->wrt);
+            offset += 2;
+            break;
+
+       case4(034):
+            if (opx->type & (BITS16 | BITS32))
+                size = (opx->type & BITS16) ? 2 : 4;
+            else
+                size = (bits == 16) ? 2 : 4;
+            warn_overflow_opd(opx, size);
+            data = opx->offset;
+            out(offset, segment, &data, OUT_ADDRESS, size,
+                opx->segment, opx->wrt);
+            offset += size;
+            break;
+
+       case4(040):
+            warn_overflow_opd(opx, 4);
+            data = opx->offset;
+            out(offset, segment, &data, OUT_ADDRESS, 4,
+                opx->segment, opx->wrt);
+            offset += 4;
+            break;
+
+       case4(044):
+            data = opx->offset;
+            size = ins->addr_size >> 3;
+            warn_overflow_opd(opx, size);
+            out(offset, segment, &data, OUT_ADDRESS, size,
+                opx->segment, opx->wrt);
+            offset += size;
+            break;
+
+       case4(050):
+            if (opx->segment != segment)
+                errfunc(ERR_NONFATAL,
+                        "short relative jump outside segment");
+            data = opx->offset - insn_end;
+            if (data > 127 || data < -128)
+                errfunc(ERR_NONFATAL, "short jump is out of range");
+            bytes[0] = data;
+            out(offset, segment, bytes, OUT_RAWDATA, 1, NO_SEG, NO_SEG);
+            offset += 1;
+            break;
+
+       case4(054):
+            data = (int64_t)opx->offset;
+            out(offset, segment, &data, OUT_ADDRESS, 8,
+                opx->segment, opx->wrt);
+            offset += 8;
+            break;
+
+       case4(060):
+            if (opx->segment != segment) {
+                data = opx->offset;
+                out(offset, segment, &data,
+                    OUT_REL2ADR, insn_end - offset,
+                    opx->segment, opx->wrt);
+            } else {
+                data = opx->offset - insn_end;
+                out(offset, segment, &data,
+                    OUT_ADDRESS, 2, NO_SEG, NO_SEG);
+            }
+            offset += 2;
+            break;
+
+       case4(064):
+            if (opx->type & (BITS16 | BITS32 | BITS64))
+                size = (opx->type & BITS16) ? 2 : 4;
+            else
+                size = (bits == 16) ? 2 : 4;
+            if (opx->segment != segment) {
+                data = opx->offset;
+                out(offset, segment, &data,
+                   size == 2 ? OUT_REL2ADR : OUT_REL4ADR,
+                   insn_end - offset, opx->segment, opx->wrt);
+            } else {
+                data = opx->offset - insn_end;
+                out(offset, segment, &data,
+                    OUT_ADDRESS, size, NO_SEG, NO_SEG);
+            }
+            offset += size;
+            break;
+
+       case4(070):
+            if (opx->segment != segment) {
+                data = opx->offset;
+                out(offset, segment, &data,
+                    OUT_REL4ADR, insn_end - offset,
+                    opx->segment, opx->wrt);
+            } else {
+                data = opx->offset - insn_end;
+                out(offset, segment, &data,
+                    OUT_ADDRESS, 4, NO_SEG, NO_SEG);
+            }
+            offset += 4;
+            break;
+
+       case4(074):
+            if (opx->segment == NO_SEG)
+                errfunc(ERR_NONFATAL, "value referenced by FAR is not"
+                        " relocatable");
+           data = 0;
+            out(offset, segment, &data, OUT_ADDRESS, 2,
+                outfmt->segbase(1 + opx->segment),
+                opx->wrt);
+            offset += 2;
+            break;
+
+       case4(0140):
+            data = opx->offset;
+            warn_overflow_opd(opx, 2);
+            if (is_sbyte16(opx)) {
+                bytes[0] = data;
+                out(offset, segment, bytes, OUT_RAWDATA, 1, NO_SEG,
+                    NO_SEG);
+                offset++;
+            } else {
+                out(offset, segment, &data, OUT_ADDRESS, 2,
+                    opx->segment, opx->wrt);
+                offset += 2;
+            }
+            break;
+
+       case4(0144):
+           EMIT_REX();
+            bytes[0] = *codes++;
+            if (is_sbyte16(opx))
+                bytes[0] |= 2;  /* s-bit */
+            out(offset, segment, bytes, OUT_RAWDATA, 1, NO_SEG, NO_SEG);
+            offset++;
+            break;
+
+       case4(0150):
+            data = opx->offset;
+            warn_overflow_opd(opx, 4);
+            if (is_sbyte32(opx)) {
+                bytes[0] = data;
+                out(offset, segment, bytes, OUT_RAWDATA, 1, NO_SEG,
+                    NO_SEG);
+                offset++;
+            } else {
+                out(offset, segment, &data, OUT_ADDRESS, 4,
+                    opx->segment, opx->wrt);
+                offset += 4;
+            }
+            break;
+
+       case4(0154):
+           EMIT_REX();
+            bytes[0] = *codes++;
+            if (is_sbyte32(opx))
+                bytes[0] |= 2;  /* s-bit */
+            out(offset, segment, bytes, OUT_RAWDATA, 1, NO_SEG, NO_SEG);
+            offset++;
+            break;
+
+       case4(0160):
+       case4(0164):
+           break;
+
+       case 0171:
+           bytes[0] =
+               (ins->drexdst << 4) |
+               (ins->rex & REX_OC ? 0x08 : 0) |
+               (ins->rex & (REX_R|REX_X|REX_B));
+           ins->rex = 0;
+            out(offset, segment, bytes, OUT_RAWDATA, 1, NO_SEG, NO_SEG);
+           offset++;
+           break;
+
+       case 0172:
+           c = *codes++;
+           opx = &ins->oprs[c >> 3];
+           bytes[0] = nasm_regvals[opx->basereg] << 4;
+           opx = &ins->oprs[c & 7];
+           if (opx->segment != NO_SEG || opx->wrt != NO_SEG) {
+               errfunc(ERR_NONFATAL,
+                       "non-absolute expression not permitted as argument %d",
+                       c & 7);
+           } else {
+               if (opx->offset & ~15) {
+                   errfunc(ERR_WARNING | ERR_PASS2 | ERR_WARN_NOV,
+                           "four-bit argument exceeds bounds");
+               }
+               bytes[0] |= opx->offset & 15;
+           }
+           out(offset, segment, bytes, OUT_RAWDATA, 1, NO_SEG, NO_SEG);
+           offset++;
+           break;
+
+       case 0173:
+           c = *codes++;
+           opx = &ins->oprs[c >> 4];
+           bytes[0] = nasm_regvals[opx->basereg] << 4;
+           bytes[0] |= c & 15;
+           out(offset, segment, bytes, OUT_RAWDATA, 1, NO_SEG, NO_SEG);
+           offset++;
+           break;
+
+       case 0174:
+           c = *codes++;
+           opx = &ins->oprs[c];
+           bytes[0] = nasm_regvals[opx->basereg] << 4;
+           out(offset, segment, bytes, OUT_RAWDATA, 1, NO_SEG, NO_SEG);
+           offset++;
+           break;
+
+       case4(0250):
+            data = opx->offset;
+           if (opx->wrt == NO_SEG && opx->segment == NO_SEG &&
+               (int32_t)data != (int64_t)data) {
+               errfunc(ERR_WARNING | ERR_PASS2 | ERR_WARN_NOV,
+                       "signed dword immediate exceeds bounds");
+           }
+            if (is_sbyte32(opx)) {
+                bytes[0] = data;
+                out(offset, segment, bytes, OUT_RAWDATA, 1, NO_SEG,
+                    NO_SEG);
+                offset++;
+            } else {
+                out(offset, segment, &data, OUT_ADDRESS, 4,
+                    opx->segment, opx->wrt);
+                offset += 4;
+            }
+            break;
+
+       case4(0254):
+            data = opx->offset;
+           if (opx->wrt == NO_SEG && opx->segment == NO_SEG &&
+               (int32_t)data != (int64_t)data) {
+               errfunc(ERR_WARNING | ERR_PASS2 | ERR_WARN_NOV,
+                       "signed dword immediate exceeds bounds");
+           }
+           out(offset, segment, &data, OUT_ADDRESS, 4,
+               opx->segment, opx->wrt);
+           offset += 4;
+            break;
+
+       case4(0260):
+       case 0270:
+           codes += 2;
+           if (ins->vex_cm != 1 || (ins->rex & (REX_W|REX_X|REX_B))) {
+               bytes[0] = (ins->vex_cm >> 6) ? 0x8f : 0xc4;
+               bytes[1] = (ins->vex_cm & 31) | ((~ins->rex & 7) << 5);
+               bytes[2] = ((ins->rex & REX_W) << (7-3)) |
+                   ((~ins->drexdst & 15)<< 3) | (ins->vex_wlp & 07);
+               out(offset, segment, &bytes, OUT_RAWDATA, 3, NO_SEG, NO_SEG);
+               offset += 3;
+           } else {
+               bytes[0] = 0xc5;
+               bytes[1] = ((~ins->rex & REX_R) << (7-2)) |
+                   ((~ins->drexdst & 15) << 3) | (ins->vex_wlp & 07);
+               out(offset, segment, &bytes, OUT_RAWDATA, 2, NO_SEG, NO_SEG);
+               offset += 2;
+           }
+           break;
+
+       case4(0274):
+       {
+           uint64_t uv, um;
+           int s;
+
+           if (ins->rex & REX_W)
+               s = 64;
+           else if (ins->prefixes[PPS_OSIZE] == P_O16)
+               s = 16;
+           else if (ins->prefixes[PPS_OSIZE] == P_O32)
+               s = 32;
+           else
+               s = bits;
+
+           um = (uint64_t)2 << (s-1);
+           uv = opx->offset;
+
+           if (uv > 127 && uv < (uint64_t)-128 &&
+               (uv < um-128 || uv > um-1)) {
+                errfunc(ERR_WARNING | ERR_PASS2 | ERR_WARN_NOV,
+                       "signed byte value exceeds bounds");
+           }
+            if (opx->segment != NO_SEG) {
+                data = uv;
+                out(offset, segment, &data, OUT_ADDRESS, 1,
+                    opx->segment, opx->wrt);
+            } else {
+                bytes[0] = uv;
+                out(offset, segment, bytes, OUT_RAWDATA, 1, NO_SEG,
+                    NO_SEG);
+            }
+            offset += 1;
+            break;
+       }
+
+       case4(0300):
+            break;
+
+        case 0310:
+            if (bits == 32 && !has_prefix(ins, PPS_ASIZE, P_A16)) {
+                *bytes = 0x67;
+                out(offset, segment, bytes, OUT_RAWDATA, 1, NO_SEG, NO_SEG);
+                offset += 1;
+            } else
+                offset += 0;
+            break;
+
+        case 0311:
+            if (bits != 32 && !has_prefix(ins, PPS_ASIZE, P_A32)) {
+                *bytes = 0x67;
+                out(offset, segment, bytes, OUT_RAWDATA, 1, NO_SEG, NO_SEG);
+                offset += 1;
+            } else
+                offset += 0;
+            break;
+
+        case 0312:
+            break;
+
+        case 0313:
+            ins->rex = 0;
+            break;
+
+       case4(0314):
+           break;
+
+        case 0320:
+            if (bits != 16) {
+                *bytes = 0x66;
+                out(offset, segment, bytes, OUT_RAWDATA, 1, NO_SEG, NO_SEG);
+                offset += 1;
+            } else
+                offset += 0;
+            break;
+
+        case 0321:
+            if (bits == 16) {
+                *bytes = 0x66;
+                out(offset, segment, bytes, OUT_RAWDATA, 1, NO_SEG, NO_SEG);
+                offset += 1;
+            } else
+                offset += 0;
+            break;
+
+        case 0322:
+        case 0323:
+            break;
+
+        case 0324:
+            ins->rex |= REX_W;
+            break;
+
+       case 0325:
+           break;
+
+        case 0330:
+            *bytes = *codes++ ^ condval[ins->condition];
+            out(offset, segment, bytes, OUT_RAWDATA, 1, NO_SEG, NO_SEG);
+            offset += 1;
+            break;
+
+        case 0331:
+            break;
+
+       case 0332:
+        case 0333:
+            *bytes = c - 0332 + 0xF2;
+            out(offset, segment, bytes, OUT_RAWDATA, 1, NO_SEG, NO_SEG);
+            offset += 1;
+            break;
+
+        case 0334:
+            if (ins->rex & REX_R) {
+                *bytes = 0xF0;
+                out(offset, segment, bytes, OUT_RAWDATA, 1, NO_SEG, NO_SEG);
+                offset += 1;
+            }
+            ins->rex &= ~(REX_L|REX_R);
+            break;
+
+        case 0335:
+           break;
+
+        case 0336:
+        case 0337:
+           break;
+
+        case 0340:
+            if (ins->oprs[0].segment != NO_SEG)
+                errfunc(ERR_PANIC, "non-constant BSS size in pass two");
+            else {
+                int64_t size = ins->oprs[0].offset;
+                if (size > 0)
+                    out(offset, segment, NULL,
+                        OUT_RESERVE, size, NO_SEG, NO_SEG);
+                offset += size;
+            }
+            break;
+
+       case 0341:
+           break;
+
+        case 0344:
+        case 0345:
+           bytes[0] = c & 1;
+            switch (ins->oprs[0].basereg) {
+            case R_CS:
+                bytes[0] += 0x0E;
+                break;
+            case R_DS:
+                bytes[0] += 0x1E;
+                break;
+            case R_ES:
+                bytes[0] += 0x06;
+                break;
+            case R_SS:
+                bytes[0] += 0x16;
+                break;
+            default:
+                errfunc(ERR_PANIC,
+                        "bizarre 8086 segment register received");
+            }
+            out(offset, segment, bytes, OUT_RAWDATA, 1, NO_SEG, NO_SEG);
+            offset++;
+            break;
+
+        case 0346:
+        case 0347:
+           bytes[0] = c & 1;
+            switch (ins->oprs[0].basereg) {
+            case R_FS:
+                bytes[0] += 0xA0;
+                break;
+            case R_GS:
+                bytes[0] += 0xA8;
+                break;
+            default:
+                errfunc(ERR_PANIC,
+                        "bizarre 386 segment register received");
+            }
+            out(offset, segment, bytes, OUT_RAWDATA, 1, NO_SEG, NO_SEG);
+            offset++;
+            break;
+
+       case 0360:
+           break;
+
+       case 0361:
+           bytes[0] = 0x66;
+            out(offset, segment, bytes, OUT_RAWDATA, 1, NO_SEG, NO_SEG);
+            offset += 1;
+           break;
+
+       case 0362:
+       case 0363:
+           bytes[0] = c - 0362 + 0xf2;
+            out(offset, segment, bytes, OUT_RAWDATA, 1, NO_SEG, NO_SEG);
+            offset += 1;
+           break;
+
+       case 0364:
+       case 0365:
+           break;
+
+        case 0366:
+       case 0367:
+            *bytes = c - 0366 + 0x66;
+            out(offset, segment, bytes, OUT_RAWDATA, 1, NO_SEG, NO_SEG);
+            offset += 1;
+            break;
+
+        case 0370:
+        case 0371:
+        case 0372:
+            break;
+
+        case 0373:
+            *bytes = bits == 16 ? 3 : 5;
+            out(offset, segment, bytes, OUT_RAWDATA, 1, NO_SEG, NO_SEG);
+            offset += 1;
+            break;
+
+       case4(0100):
+       case4(0110):
+       case4(0120):
+       case4(0130):
+       case4(0200):
+       case4(0204):
+       case4(0210):
+       case4(0214):
+       case4(0220):
+       case4(0224):
+       case4(0230):
+       case4(0234):
+           {
+                ea ea_data;
+                int rfield;
+               opflags_t rflags;
+                uint8_t *p;
+                int32_t s;
+               enum out_type type;
+               struct operand *opy = &ins->oprs[op2];
+
+                if (c <= 0177) {
+                   /* pick rfield from operand b (opx) */
+                   rflags = regflag(opx);
+                    rfield = nasm_regvals[opx->basereg];
+               } else {
+                   /* rfield is constant */
+                   rflags = 0;
+                    rfield = c & 7;
+               }
+
+                if (!process_ea(opy, &ea_data, bits, ins->addr_size,
+                               rfield, rflags)) {
+                    errfunc(ERR_NONFATAL, "invalid effective address");
+                }
+
+
+                p = bytes;
+                *p++ = ea_data.modrm;
+                if (ea_data.sib_present)
+                    *p++ = ea_data.sib;
+
+               /* DREX suffixes come between the SIB and the displacement */
+               if (ins->rex & REX_D) {
+                   *p++ = (ins->drexdst << 4) |
+                          (ins->rex & REX_OC ? 0x08 : 0) |
+                          (ins->rex & (REX_R|REX_X|REX_B));
+                   ins->rex = 0;
+               }
+
+                s = p - bytes;
+                out(offset, segment, bytes, OUT_RAWDATA, s, NO_SEG, NO_SEG);
+
+                /*
+                 * Make sure the address gets the right offset in case
+                 * the line breaks in the .lst file (BR 1197827)
+                 */
+                offset += s;
+                s = 0;
+
+                switch (ea_data.bytes) {
+                case 0:
+                    break;
+                case 1:
+                case 2:
+                case 4:
+                case 8:
+                    data = opy->offset;
+                    warn_overflow_opd(opy, ea_data.bytes);
+                    s += ea_data.bytes;
+                   if (ea_data.rip) {
+                       if (opy->segment == segment) {
+                           data -= insn_end;
+                           out(offset, segment, &data, OUT_ADDRESS,
+                               ea_data.bytes, NO_SEG, NO_SEG);
+                       } else {
+                           out(offset, segment, &data, OUT_REL4ADR,
+                               insn_end - offset, opy->segment, opy->wrt);
+                       }
+                   } else {
+                       type = OUT_ADDRESS;
+                       out(offset, segment, &data, OUT_ADDRESS,
+                           ea_data.bytes, opy->segment, opy->wrt);
+                   }
+                    break;
+                default:
+                    /* Impossible! */
+                    errfunc(ERR_PANIC,
+                            "Invalid amount of bytes (%d) for offset?!",
+                            ea_data.bytes);
+                    break;
+                }
+                offset += s;
+           }
+           break;
+
+       default:
+           errfunc(ERR_PANIC, "internal instruction table corrupt"
+                   ": instruction code \\%o (0x%02X) given", c, c);
+           break;
+        }
+    }
+}
+
+static opflags_t regflag(const operand * o)
+{
+    if (o->basereg < EXPR_REG_START || o->basereg >= REG_ENUM_LIMIT) {
+        errfunc(ERR_PANIC, "invalid operand passed to regflag()");
+    }
+    return nasm_reg_flags[o->basereg];
+}
+
+static int32_t regval(const operand * o)
+{
+    if (o->basereg < EXPR_REG_START || o->basereg >= REG_ENUM_LIMIT) {
+        errfunc(ERR_PANIC, "invalid operand passed to regval()");
+    }
+    return nasm_regvals[o->basereg];
+}
+
+static int op_rexflags(const operand * o, int mask)
+{
+    opflags_t flags;
+    int val;
+
+    if (o->basereg < EXPR_REG_START || o->basereg >= REG_ENUM_LIMIT) {
+        errfunc(ERR_PANIC, "invalid operand passed to op_rexflags()");
+    }
+
+    flags = nasm_reg_flags[o->basereg];
+    val = nasm_regvals[o->basereg];
+
+    return rexflags(val, flags, mask);
+}
+
+static int rexflags(int val, opflags_t flags, int mask)
+{
+    int rex = 0;
+
+    if (val >= 8)
+       rex |= REX_B|REX_X|REX_R;
+    if (flags & BITS64)
+       rex |= REX_W;
+    if (!(REG_HIGH & ~flags))  /* AH, CH, DH, BH */
+       rex |= REX_H;
+    else if (!(REG8 & ~flags) && val >= 4) /* SPL, BPL, SIL, DIL */
+       rex |= REX_P;
+
+    return rex & mask;
+}
+
+static enum match_result find_match(const struct itemplate **tempp,
+                                   insn *instruction,
+                                   int32_t segment, int64_t offset, int bits)
+{
+    const struct itemplate *temp;
+    enum match_result m, merr;
+    opflags_t xsizeflags[MAX_OPERANDS];
+    bool opsizemissing = false;
+    int i;
+
+    for (i = 0; i < instruction->operands; i++)
+       xsizeflags[i] = instruction->oprs[i].type & SIZE_MASK;
+
+    merr = MERR_INVALOP;
+
+    for (temp = nasm_instructions[instruction->opcode];
+        temp->opcode != I_none; temp++) {
+       m = matches(temp, instruction, bits);
+       if (m == MOK_JUMP) {
+           if (jmp_match(segment, offset, bits, instruction, temp->code))
+               m = MOK_GOOD;
+           else
+               m = MERR_INVALOP;
+       } else if (m == MERR_OPSIZEMISSING &&
+                  (temp->flags & IF_SMASK) != IF_SX) {
+           /*
+            * Missing operand size and a candidate for fuzzy matching...
+            */
+           for (i = 0; i < temp->operands; i++) {
+               if ((temp->opd[i] & SAME_AS) == 0)
+                   xsizeflags[i] |= temp->opd[i] & SIZE_MASK;
+           }
+           opsizemissing = true;
+       }
+       if (m > merr)
+           merr = m;
+       if (merr == MOK_GOOD)
+           goto done;
+    }
+
+    /* No match, but see if we can get a fuzzy operand size match... */
+    if (!opsizemissing)
+       goto done;
+
+    for (i = 0; i < instruction->operands; i++) {
+       /*
+        * We ignore extrinsic operand sizes on registers, so we should
+        * never try to fuzzy-match on them.  This also resolves the case
+        * when we have e.g. "xmmrm128" in two different positions.
+        */
+       if (is_class(REGISTER, instruction->oprs[i].type))
+           continue;
+
+       /* This tests if xsizeflags[i] has more than one bit set */
+       if ((xsizeflags[i] & (xsizeflags[i]-1)))
+           goto done;          /* No luck */
+
+       instruction->oprs[i].type |= xsizeflags[i]; /* Set the size */
+    }
+
+    /* Try matching again... */
+    for (temp = nasm_instructions[instruction->opcode];
+        temp->opcode != I_none; temp++) {
+       m = matches(temp, instruction, bits);
+       if (m == MOK_JUMP) {
+           if (jmp_match(segment, offset, bits, instruction, temp->code))
+               m = MOK_GOOD;
+           else
+               m = MERR_INVALOP;
+       }
+       if (m > merr)
+           merr = m;
+       if (merr == MOK_GOOD)
+           goto done;
+    }
+
+done:
+    *tempp = temp;
+    return merr;
+}
+
+static enum match_result matches(const struct itemplate *itemp,
+                                 insn *instruction, int bits)
+{
+    int i, size[MAX_OPERANDS], asize, oprs;
+    bool opsizemissing = false;
+
+    /*
+     * Check the opcode
+     */
+    if (itemp->opcode != instruction->opcode)
+        return MERR_INVALOP;
+
+    /*
+     * Count the operands
+     */
+    if (itemp->operands != instruction->operands)
+        return MERR_INVALOP;
+
+    /*
+     * Check that no spurious colons or TOs are present
+     */
+    for (i = 0; i < itemp->operands; i++)
+        if (instruction->oprs[i].type & ~itemp->opd[i] & (COLON | TO))
+            return MERR_INVALOP;
+
+    /*
+     * Process size flags
+     */
+    switch (itemp->flags & IF_SMASK) {
+    case IF_SB:
+        asize = BITS8;
+        break;
+    case IF_SW:
+        asize = BITS16;
+        break;
+    case IF_SD:
+        asize = BITS32;
+        break;
+    case IF_SQ:
+        asize = BITS64;
+        break;
+    case IF_SO:
+        asize = BITS128;
+        break;
+    case IF_SY:
+        asize = BITS256;
+        break;
+    case IF_SZ:
+        switch (bits) {
+        case 16:
+            asize = BITS16;
+            break;
+        case 32:
+            asize = BITS32;
+            break;
+        case 64:
+            asize = BITS64;
+            break;
+        default:
+            asize = 0;
+            break;
+        }
+        break;
+    default:
+        asize = 0;
+        break;
+    }
+
+    if (itemp->flags & IF_ARMASK) {
+        /* S- flags only apply to a specific operand */
+        i = ((itemp->flags & IF_ARMASK) >> IF_ARSHFT) - 1;
+        memset(size, 0, sizeof size);
+        size[i] = asize;
+    } else {
+        /* S- flags apply to all operands */
+        for (i = 0; i < MAX_OPERANDS; i++)
+            size[i] = asize;
+    }
+
+    /*
+     * Check that the operand flags all match up,
+     * it's a bit tricky so lets be verbose:
+     *
+     * 1) Find out the size of operand. If instruction
+     *    doesn't have one specified -- we're trying to
+     *    guess it either from template (IF_S* flag) or
+     *    from code bits.
+     *
+     * 2) If template operand (i) has SAME_AS flag [used for registers only]
+     *    (ie the same operand as was specified somewhere in template, and
+     *    this referred operand index is being achieved via ~SAME_AS)
+     *    we are to be sure that both registers (in template and instruction)
+     *    do exactly match.
+     *
+     * 3) If template operand do not match the instruction OR
+     *    template has an operand size specified AND this size differ
+     *    from which instruction has (perhaps we got it from code bits)
+     *    we are:
+     *      a)  Check that only size of instruction and operand is differ
+     *          other characteristics do match
+     *      b)  Perhaps it's a register specified in instruction so
+     *          for such a case we just mark that operand as "size
+     *          missing" and this will turn on fuzzy operand size
+     *          logic facility (handled by a caller)
+     */
+    for (i = 0; i < itemp->operands; i++) {
+        opflags_t type = instruction->oprs[i].type;
+        if (!(type & SIZE_MASK))
+            type |= size[i];
+
+        if (itemp->opd[i] & SAME_AS) {
+            int j = itemp->opd[i] & ~SAME_AS;
+            if (type != instruction->oprs[j].type ||
+                instruction->oprs[i].basereg != instruction->oprs[j].basereg)
+                return MERR_INVALOP;
+        } else if (itemp->opd[i] & ~type ||
+            ((itemp->opd[i] & SIZE_MASK) &&
+             ((itemp->opd[i] ^ type) & SIZE_MASK))) {
+            if ((itemp->opd[i] & ~type & ~SIZE_MASK) || (type & SIZE_MASK)) {
+                return MERR_INVALOP;
+            } else if (!is_class(REGISTER, type)) {
+                /*
+                 * Note: we don't honor extrinsic operand sizes for registers,
+                 * so "missing operand size" for a register should be
+                 * considered a wildcard match rather than an error.
+                 */
+                opsizemissing = true;
+            }
+        }
+    }
+
+    if (opsizemissing)
+        return MERR_OPSIZEMISSING;
+
+    /*
+     * Check operand sizes
+     */
+    if (itemp->flags & (IF_SM | IF_SM2)) {
+        oprs = (itemp->flags & IF_SM2 ? 2 : itemp->operands);
+        for (i = 0; i < oprs; i++) {
+            asize = itemp->opd[i] & SIZE_MASK;
+            if (asize) {
+                for (i = 0; i < oprs; i++)
+                    size[i] = asize;
+                break;
+            }
+        }
+    } else {
+        oprs = itemp->operands;
+    }
+
+    for (i = 0; i < itemp->operands; i++) {
+        if (!(itemp->opd[i] & SIZE_MASK) &&
+            (instruction->oprs[i].type & SIZE_MASK & ~size[i]))
+            return MERR_OPSIZEMISMATCH;
+    }
+
+    /*
+     * Check template is okay at the set cpu level
+     */
+    if (((itemp->flags & IF_PLEVEL) > cpu))
+        return MERR_BADCPU;
+
+    /*
+     * Verify the appropriate long mode flag.
+     */
+    if ((itemp->flags & (bits == 64 ? IF_NOLONG : IF_LONG)))
+        return MERR_BADMODE;
+
+    /*
+     * Check if special handling needed for Jumps
+     */
+    if ((itemp->code[0] & 0374) == 0370)
+        return MOK_JUMP;
+
+    return MOK_GOOD;
+}
+
+static ea *process_ea(operand * input, ea * output, int bits,
+                     int addrbits, int rfield, opflags_t rflags)
+{
+    bool forw_ref = !!(input->opflags & OPFLAG_UNKNOWN);
+
+    output->rip = false;
+
+    /* REX flags for the rfield operand */
+    output->rex |= rexflags(rfield, rflags, REX_R|REX_P|REX_W|REX_H);
+
+    if (is_class(REGISTER, input->type)) {  /* register direct */
+        int i;
+       opflags_t f;
+
+        if (input->basereg < EXPR_REG_START /* Verify as Register */
+            || input->basereg >= REG_ENUM_LIMIT)
+            return NULL;
+       f = regflag(input);
+        i = nasm_regvals[input->basereg];
+
+       if (REG_EA & ~f)
+           return NULL;        /* Invalid EA register */
+
+       output->rex |= op_rexflags(input, REX_B|REX_P|REX_W|REX_H);
+
+        output->sib_present = false;             /* no SIB necessary */
+        output->bytes = 0;  /* no offset necessary either */
+        output->modrm = 0xC0 | ((rfield & 7) << 3) | (i & 7);
+    } else {                    /* it's a memory reference */
+        if (input->basereg == -1
+            && (input->indexreg == -1 || input->scale == 0)) {
+            /* it's a pure offset */
+            if (bits == 64 && (~input->type & IP_REL)) {
+              int scale, index, base;
+              output->sib_present = true;
+              scale = 0;
+              index = 4;
+              base = 5;
+              output->sib = (scale << 6) | (index << 3) | base;
+              output->bytes = 4;
+              output->modrm = 4 | ((rfield & 7) << 3);
+             output->rip = false;
+            } else {
+              output->sib_present = false;
+              output->bytes = (addrbits != 16 ? 4 : 2);
+              output->modrm = (addrbits != 16 ? 5 : 6) | ((rfield & 7) << 3);
+             output->rip = bits == 64;
+            }
+        } else {                /* it's an indirection */
+            int i = input->indexreg, b = input->basereg, s = input->scale;
+            int32_t o = input->offset, seg = input->segment;
+            int hb = input->hintbase, ht = input->hinttype;
+            int t, it, bt;             /* register numbers */
+           opflags_t x, ix, bx;        /* register flags */
+
+            if (s == 0)
+                i = -1;         /* make this easy, at least */
+
+            if (i >= EXPR_REG_START && i < REG_ENUM_LIMIT) {
+                it = nasm_regvals[i];
+               ix = nasm_reg_flags[i];
+           } else {
+                it = -1;
+               ix = 0;
+           }
+
+           if (b >= EXPR_REG_START && b < REG_ENUM_LIMIT) {
+                bt = nasm_regvals[b];
+               bx = nasm_reg_flags[b];
+           } else {
+                bt = -1;
+               bx = 0;
+           }
+
+           /* check for a 32/64-bit memory reference... */
+           if ((ix|bx) & (BITS32|BITS64)) {
+                /* it must be a 32/64-bit memory reference. Firstly we have
+                 * to check that all registers involved are type E/Rxx. */
+               int32_t sok = BITS32|BITS64;
+
+                if (it != -1) {
+                   if (!(REG64 & ~ix) || !(REG32 & ~ix))
+                       sok &= ix;
+                   else
+                       return NULL;
+               }
+
+               if (bt != -1) {
+                   if (REG_GPR & ~bx)
+                       return NULL; /* Invalid register */
+                   if (~sok & bx & SIZE_MASK)
+                       return NULL; /* Invalid size */
+                   sok &= bx;
+               }
+
+                /* While we're here, ensure the user didn't specify
+                  WORD or QWORD. */
+                if (input->disp_size == 16 || input->disp_size == 64)
+                   return NULL;
+
+               if (addrbits == 16 ||
+                   (addrbits == 32 && !(sok & BITS32)) ||
+                   (addrbits == 64 && !(sok & BITS64)))
+                   return NULL;
+
+                /* now reorganize base/index */
+                if (s == 1 && bt != it && bt != -1 && it != -1 &&
+                    ((hb == b && ht == EAH_NOTBASE)
+                     || (hb == i && ht == EAH_MAKEBASE))) {
+                   /* swap if hints say so */
+                    t = bt, bt = it, it = t;
+                   x = bx, bx = ix, ix = x;
+               }
+                if (bt == it)     /* convert EAX+2*EAX to 3*EAX */
+                    bt = -1, bx = 0, s++;
+                if (bt == -1 && s == 1 && !(hb == it && ht == EAH_NOTBASE)) {
+                   /* make single reg base, unless hint */
+                    bt = it, bx = ix, it = -1, ix = 0;
+               }
+                if (((s == 2 && it != REG_NUM_ESP
+                      && !(input->eaflags & EAF_TIMESTWO)) || s == 3
+                     || s == 5 || s == 9) && bt == -1)
+                    bt = it, bx = ix, s--; /* convert 3*EAX to EAX+2*EAX */
+                if (it == -1 && (bt & 7) != REG_NUM_ESP
+                    && (input->eaflags & EAF_TIMESTWO))
+                    it = bt, ix = bx, bt = -1, bx = 0, s = 1;
+                /* convert [NOSPLIT EAX] to sib format with 0x0 displacement */
+                if (s == 1 && it == REG_NUM_ESP) {
+                   /* swap ESP into base if scale is 1 */
+                    t = it, it = bt, bt = t;
+                   x = ix, ix = bx, bx = x;
+               }
+                if (it == REG_NUM_ESP
+                    || (s != 1 && s != 2 && s != 4 && s != 8 && it != -1))
+                    return NULL;        /* wrong, for various reasons */
+
+               output->rex |= rexflags(it, ix, REX_X);
+               output->rex |= rexflags(bt, bx, REX_B);
+
+                if (it == -1 && (bt & 7) != REG_NUM_ESP) {
+                   /* no SIB needed */
+                    int mod, rm;
+
+                    if (bt == -1) {
+                        rm = 5;
+                        mod = 0;
+                    } else {
+                        rm = (bt & 7);
+                        if (rm != REG_NUM_EBP && o == 0 &&
+                                seg == NO_SEG && !forw_ref &&
+                                !(input->eaflags &
+                                  (EAF_BYTEOFFS | EAF_WORDOFFS)))
+                            mod = 0;
+                        else if (input->eaflags & EAF_BYTEOFFS ||
+                                 (o >= -128 && o <= 127 && seg == NO_SEG
+                                  && !forw_ref
+                                  && !(input->eaflags & EAF_WORDOFFS)))
+                            mod = 1;
+                        else
+                            mod = 2;
+                    }
+
+                    output->sib_present = false;
+                    output->bytes = (bt == -1 || mod == 2 ? 4 : mod);
+                    output->modrm = (mod << 6) | ((rfield & 7) << 3) | rm;
+                } else {
+                   /* we need a SIB */
+                    int mod, scale, index, base;
+
+                    if (it == -1)
+                        index = 4, s = 1;
+                    else
+                        index = (it & 7);
+
+                    switch (s) {
+                    case 1:
+                        scale = 0;
+                        break;
+                    case 2:
+                        scale = 1;
+                        break;
+                    case 4:
+                        scale = 2;
+                        break;
+                    case 8:
+                        scale = 3;
+                        break;
+                    default:   /* then what the smeg is it? */
+                        return NULL;    /* panic */
+                    }
+
+                    if (bt == -1) {
+                        base = 5;
+                        mod = 0;
+                    } else {
+                        base = (bt & 7);
+                        if (base != REG_NUM_EBP && o == 0 &&
+                                    seg == NO_SEG && !forw_ref &&
+                                    !(input->eaflags &
+                                      (EAF_BYTEOFFS | EAF_WORDOFFS)))
+                            mod = 0;
+                        else if (input->eaflags & EAF_BYTEOFFS ||
+                                 (o >= -128 && o <= 127 && seg == NO_SEG
+                                  && !forw_ref
+                                  && !(input->eaflags & EAF_WORDOFFS)))
+                            mod = 1;
+                        else
+                            mod = 2;
+                    }
+
+                    output->sib_present = true;
+                    output->bytes =  (bt == -1 || mod == 2 ? 4 : mod);
+                    output->modrm = (mod << 6) | ((rfield & 7) << 3) | 4;
+                    output->sib = (scale << 6) | (index << 3) | base;
+                }
+            } else {            /* it's 16-bit */
+                int mod, rm;
+
+                /* check for 64-bit long mode */
+                if (addrbits == 64)
+                    return NULL;
+
+                /* check all registers are BX, BP, SI or DI */
+                if ((b != -1 && b != R_BP && b != R_BX && b != R_SI
+                     && b != R_DI) || (i != -1 && i != R_BP && i != R_BX
+                                       && i != R_SI && i != R_DI))
+                    return NULL;
+
+                /* ensure the user didn't specify DWORD/QWORD */
+                if (input->disp_size == 32 || input->disp_size == 64)
+                    return NULL;
+
+                if (s != 1 && i != -1)
+                    return NULL;        /* no can do, in 16-bit EA */
+                if (b == -1 && i != -1) {
+                    int tmp = b;
+                    b = i;
+                    i = tmp;
+                }               /* swap */
+                if ((b == R_SI || b == R_DI) && i != -1) {
+                    int tmp = b;
+                    b = i;
+                    i = tmp;
+                }
+                /* have BX/BP as base, SI/DI index */
+                if (b == i)
+                    return NULL;        /* shouldn't ever happen, in theory */
+                if (i != -1 && b != -1 &&
+                    (i == R_BP || i == R_BX || b == R_SI || b == R_DI))
+                    return NULL;        /* invalid combinations */
+                if (b == -1)    /* pure offset: handled above */
+                    return NULL;        /* so if it gets to here, panic! */
+
+                rm = -1;
+                if (i != -1)
+                    switch (i * 256 + b) {
+                    case R_SI * 256 + R_BX:
+                        rm = 0;
+                        break;
+                    case R_DI * 256 + R_BX:
+                        rm = 1;
+                        break;
+                    case R_SI * 256 + R_BP:
+                        rm = 2;
+                        break;
+                    case R_DI * 256 + R_BP:
+                        rm = 3;
+                        break;
+                } else
+                    switch (b) {
+                    case R_SI:
+                        rm = 4;
+                        break;
+                    case R_DI:
+                        rm = 5;
+                        break;
+                    case R_BP:
+                        rm = 6;
+                        break;
+                    case R_BX:
+                        rm = 7;
+                        break;
+                    }
+                if (rm == -1)   /* can't happen, in theory */
+                    return NULL;        /* so panic if it does */
+
+                if (o == 0 && seg == NO_SEG && !forw_ref && rm != 6 &&
+                    !(input->eaflags & (EAF_BYTEOFFS | EAF_WORDOFFS)))
+                    mod = 0;
+                else if (input->eaflags & EAF_BYTEOFFS ||
+                         (o >= -128 && o <= 127 && seg == NO_SEG
+                          && !forw_ref
+                          && !(input->eaflags & EAF_WORDOFFS)))
+                    mod = 1;
+                else
+                    mod = 2;
+
+                output->sib_present = false;    /* no SIB - it's 16-bit */
+                output->bytes = mod;    /* bytes of offset needed */
+                output->modrm = (mod << 6) | ((rfield & 7) << 3) | rm;
+            }
+        }
+    }
+
+    output->size = 1 + output->sib_present + output->bytes;
+    return output;
+}
+
+static void add_asp(insn *ins, int addrbits)
+{
+    int j, valid;
+    int defdisp;
+
+    valid = (addrbits == 64) ? 64|32 : 32|16;
+
+    switch (ins->prefixes[PPS_ASIZE]) {
+    case P_A16:
+       valid &= 16;
+       break;
+    case P_A32:
+       valid &= 32;
+       break;
+    case P_A64:
+       valid &= 64;
+       break;
+    case P_ASP:
+       valid &= (addrbits == 32) ? 16 : 32;
+       break;
+    default:
+       break;
+    }
+
+    for (j = 0; j < ins->operands; j++) {
+       if (is_class(MEMORY, ins->oprs[j].type)) {
+           opflags_t i, b;
+
+           /* Verify as Register */
+           if (ins->oprs[j].indexreg < EXPR_REG_START
+               || ins->oprs[j].indexreg >= REG_ENUM_LIMIT)
+               i = 0;
+           else
+               i = nasm_reg_flags[ins->oprs[j].indexreg];
+
+           /* Verify as Register */
+           if (ins->oprs[j].basereg < EXPR_REG_START
+               || ins->oprs[j].basereg >= REG_ENUM_LIMIT)
+               b = 0;
+           else
+               b = nasm_reg_flags[ins->oprs[j].basereg];
+
+           if (ins->oprs[j].scale == 0)
+               i = 0;
+
+           if (!i && !b) {
+               int ds = ins->oprs[j].disp_size;
+               if ((addrbits != 64 && ds > 8) ||
+                   (addrbits == 64 && ds == 16))
+                   valid &= ds;
+           } else {
+               if (!(REG16 & ~b))
+                   valid &= 16;
+               if (!(REG32 & ~b))
+                   valid &= 32;
+               if (!(REG64 & ~b))
+                   valid &= 64;
+
+               if (!(REG16 & ~i))
+                   valid &= 16;
+               if (!(REG32 & ~i))
+                   valid &= 32;
+               if (!(REG64 & ~i))
+                   valid &= 64;
+           }
+       }
+    }
+
+    if (valid & addrbits) {
+       ins->addr_size = addrbits;
+    } else if (valid & ((addrbits == 32) ? 16 : 32)) {
+       /* Add an address size prefix */
+       enum prefixes pref = (addrbits == 32) ? P_A16 : P_A32;
+       ins->prefixes[PPS_ASIZE] = pref;
+       ins->addr_size = (addrbits == 32) ? 16 : 32;
+    } else {
+       /* Impossible... */
+       errfunc(ERR_NONFATAL, "impossible combination of address sizes");
+       ins->addr_size = addrbits; /* Error recovery */
+    }
+
+    defdisp = ins->addr_size == 16 ? 16 : 32;
+
+    for (j = 0; j < ins->operands; j++) {
+       if (!(MEM_OFFS & ~ins->oprs[j].type) &&
+           (ins->oprs[j].disp_size ? ins->oprs[j].disp_size : defdisp)
+           != ins->addr_size) {
+           /* mem_offs sizes must match the address size; if not,
+              strip the MEM_OFFS bit and match only EA instructions */
+           ins->oprs[j].type &= ~(MEM_OFFS & ~MEMORY);
+       }
+    }
+}
diff --git a/assemble.h b/assemble.h
new file mode 100644 (file)
index 0000000..e5e5015
--- /dev/null
@@ -0,0 +1,47 @@
+/* ----------------------------------------------------------------------- *
+ *   
+ *   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.
+ *
+ * ----------------------------------------------------------------------- */
+
+/*
+ * assemble.h  header file for assemble.c
+ */
+
+#ifndef NASM_ASSEMBLE_H
+#define NASM_ASSEMBLE_H
+
+int64_t insn_size(int32_t segment, int64_t offset, int bits, uint32_t cp,
+               insn * instruction, efunc error);
+int64_t assemble(int32_t segment, int64_t offset, int bits, uint32_t cp,
+              insn * instruction, struct ofmt *output, efunc error,
+              ListGen * listgen);
+
+#endif
diff --git a/autogen.sh b/autogen.sh
new file mode 100755 (executable)
index 0000000..5a1395d
--- /dev/null
@@ -0,0 +1,7 @@
+#!/bin/sh -xe
+#
+# Simple script to run the appropriate autotools from a repository.
+#
+autoheader
+autoconf
+rm -rf autom4te.cache config.log config.status
diff --git a/compiler.h b/compiler.h
new file mode 100644 (file)
index 0000000..5805f5a
--- /dev/null
@@ -0,0 +1,186 @@
+/* ----------------------------------------------------------------------- *
+ *   
+ *   Copyright 2007-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.
+ *
+ * ----------------------------------------------------------------------- */
+
+/*
+ * compiler.h
+ *
+ * Compiler-specific macros for NASM.  Feel free to add support for
+ * other compilers in here.
+ *
+ * This header file should be included before any other header.
+ */
+
+#ifndef NASM_COMPILER_H
+#define NASM_COMPILER_H 1
+
+#ifdef HAVE_CONFIG_H
+# include "config.h"
+/* autoconf doesn't define these if they are redundant, but we want to
+   be able to #ifdef them... */
+#else
+/* Default these to unsupported unless we have config.h */
+# ifndef inline
+#  define inline
+# endif
+# ifndef restrict
+#  define restrict
+# endif
+#endif /* HAVE_CONFIG_H */
+
+/* This is required to get the standard <inttypes.h> macros when compiling
+   with a C++ compiler.  This must be defined *before* <inttypes.h> is
+   included, directly or indirectly. */
+#define __STDC_CONSTANT_MACROS 1
+#define __STDC_LIMIT_MACROS    1
+#define __STDC_FORMAT_MACROS   1
+
+#ifdef __GNUC__
+# if __GNUC__ >= 4
+#  define HAVE_GNUC_4
+# endif
+# if __GNUC__ >= 3
+#  define HAVE_GNUC_3
+# endif
+#endif
+
+#ifdef __GNUC__
+# define _unused       __attribute__((unused))
+#else
+# define _unused
+#endif
+
+/* Some versions of MSVC have these only with underscores in front */
+#include <stddef.h>
+#include <stdarg.h>
+#include <stdio.h>
+
+#ifndef HAVE_SNPRINTF
+# ifdef HAVE__SNPRINTF
+#  define snprintf _snprintf
+# else
+int snprintf(char *, size_t, const char *, ...);
+# endif
+#endif
+
+#ifndef HAVE_VSNPRINTF
+# ifdef HAVE__VSNPRINT
+#  define vsnprintf _vsnprintf
+# else
+int vsnprintf(char *, size_t, const char *, va_list);
+# endif
+#endif
+
+#if !defined(HAVE_STRLCPY) || !HAVE_DECL_STRLCPY
+size_t strlcpy(char *, const char *, size_t);
+#endif
+
+#ifndef __cplusplus            /* C++ has false, true, bool as keywords */
+# if defined(HAVE_STDBOOL_H) && defined(HAVE_WORKING_BOOL)
+#  include <stdbool.h>
+# else
+/* This is sort of dangerous, since casts will behave different than
+   casting to the standard boolean type.  Always use !!, not (bool). */
+typedef enum bool { false, true } bool;
+# endif
+#endif
+
+/* Provide a substitute for offsetof() if we don't have one.  This
+   variant works on most (but not *all*) systems... */
+#ifndef offsetof
+# define offsetof(t,m) ((size_t)&(((t *)0)->m))
+#endif
+
+/* The container_of construct: if p is a pointer to member m of
+   container class c, then return a pointer to the container of which
+   *p is a member. */
+#ifndef container_of
+# define container_of(p, c, m) ((c *)((char *)(p) - offsetof(c,m)))
+#endif
+
+/* Some misguided platforms hide the defs for these */
+#if defined(HAVE_STRCASECMP) && !HAVE_DECL_STRCASECMP
+int strcasecmp(const char *, const char *);
+#endif
+
+#if defined(HAVE_STRICMP) && !HAVE_DECL_STRICMP
+int stricmp(const char *, const char *);
+#endif
+
+#if defined(HAVE_STRNCASECMP) && !HAVE_DECL_STRNCASECMP
+int strncasecmp(const char *, const char *, size_t);
+#endif
+
+#if defined(HAVE_STRNICMP) && !HAVE_DECL_STRNICMP
+int strnicmp(const char *, const char *, size_t);
+#endif
+
+#if defined(HAVE_STRSEP) && !HAVE_DECL_STRSEP
+char *strsep(char **, const char *);
+#endif
+
+/*
+ * Define this to 1 for faster performance if this is a littleendian
+ * platform which can do unaligned memory references.  It is safe
+ * to leave it defined to 0 even if that is true.
+ */
+#if defined(__386__) || defined(__i386__) || defined(__x86_64__)
+# define X86_MEMORY 1
+# ifndef WORDS_LITTLEENDIAN
+#  define WORDS_LITTLEENDIAN 1
+# endif
+#else
+# define X86_MEMORY 0
+#endif
+
+/*
+ * Hints to the compiler that a particular branch of code is more or
+ * less likely to be taken.
+ */
+#if defined(__GNUC__) && __GNUC__ >= 3
+# define likely(x)     __builtin_expect(!!(x), 1)
+# define unlikely(x)   __builtin_expect(!!(x), 0)
+#else
+# define likely(x)     (!!(x))
+# define unlikely(x)   (!!(x))
+#endif
+
+/*
+ * How to tell the compiler that a function doesn't return
+ */
+#ifdef __GNUC__
+# define no_return void __attribute__((noreturn))
+#else
+# define no_return void
+#endif
+
+#endif /* NASM_COMPILER_H */
diff --git a/config.h.in b/config.h.in
new file mode 100644 (file)
index 0000000..3625fe0
--- /dev/null
@@ -0,0 +1,189 @@
+/* config.h.in.  Generated from configure.in by autoheader.  */
+
+/* Define if building universal (internal helper macro) */
+#undef AC_APPLE_UNIVERSAL_BUILD
+
+/* Define to 1 if you have the declaration of `strcasecmp', and to 0 if you
+   don't. */
+#undef HAVE_DECL_STRCASECMP
+
+/* Define to 1 if you have the declaration of `stricmp', and to 0 if you
+   don't. */
+#undef HAVE_DECL_STRICMP
+
+/* Define to 1 if you have the declaration of `strlcpy', and to 0 if you
+   don't. */
+#undef HAVE_DECL_STRLCPY
+
+/* Define to 1 if you have the declaration of `strncasecmp', and to 0 if you
+   don't. */
+#undef HAVE_DECL_STRNCASECMP
+
+/* Define to 1 if you have the declaration of `strnicmp', and to 0 if you
+   don't. */
+#undef HAVE_DECL_STRNICMP
+
+/* Define to 1 if you have the declaration of `strsep', and to 0 if you don't.
+   */
+#undef HAVE_DECL_STRSEP
+
+/* Define to 1 if you have the `getgid' function. */
+#undef HAVE_GETGID
+
+/* Define to 1 if you have the `getuid' function. */
+#undef HAVE_GETUID
+
+/* Define to 1 if you have the <inttypes.h> header file. */
+#undef HAVE_INTTYPES_H
+
+/* Define to 1 if you have the <limits.h> header file. */
+#undef HAVE_LIMITS_H
+
+/* Define to 1 if you have the <memory.h> header file. */
+#undef HAVE_MEMORY_H
+
+/* Define to 1 if you have the `snprintf' function. */
+#undef HAVE_SNPRINTF
+
+/* Define to 1 if you have the <stdbool.h> header file. */
+#undef HAVE_STDBOOL_H
+
+/* Define to 1 if you have the <stdint.h> header file. */
+#undef HAVE_STDINT_H
+
+/* Define to 1 if you have the <stdlib.h> header file. */
+#undef HAVE_STDLIB_H
+
+/* Define to 1 if you have the `strcasecmp' function. */
+#undef HAVE_STRCASECMP
+
+/* Define to 1 if you have the `strcspn' function. */
+#undef HAVE_STRCSPN
+
+/* Define to 1 if you have the `stricmp' function. */
+#undef HAVE_STRICMP
+
+/* Define to 1 if you have the <strings.h> header file. */
+#undef HAVE_STRINGS_H
+
+/* Define to 1 if you have the <string.h> header file. */
+#undef HAVE_STRING_H
+
+/* Define to 1 if you have the `strlcpy' function. */
+#undef HAVE_STRLCPY
+
+/* Define to 1 if you have the `strncasecmp' function. */
+#undef HAVE_STRNCASECMP
+
+/* Define to 1 if you have the `strnicmp' function. */
+#undef HAVE_STRNICMP
+
+/* Define to 1 if you have the `strsep' function. */
+#undef HAVE_STRSEP
+
+/* Define to 1 if you have the `strspn' function. */
+#undef HAVE_STRSPN
+
+/* Define to 1 if you have the <sys/stat.h> header file. */
+#undef HAVE_SYS_STAT_H
+
+/* Define to 1 if you have the <sys/types.h> header file. */
+#undef HAVE_SYS_TYPES_H
+
+/* Define to 1 if you have the <unistd.h> header file. */
+#undef HAVE_UNISTD_H
+
+/* Define to 1 if you have the `vsnprintf' function. */
+#undef HAVE_VSNPRINTF
+
+/* Define to 1 if your compiler has a correct implementation of bool */
+#undef HAVE_WORKING_BOOL
+
+/* Define to 1 if you have the `_snprintf' function. */
+#undef HAVE__SNPRINTF
+
+/* Define to 1 if you have the `_vsnprintf' function. */
+#undef HAVE__VSNPRINTF
+
+/* Define to the address where bug reports for this package should be sent. */
+#undef PACKAGE_BUGREPORT
+
+/* Define to the full name of this package. */
+#undef PACKAGE_NAME
+
+/* Define to the full name and version of this package. */
+#undef PACKAGE_STRING
+
+/* Define to the one symbol short name of this package. */
+#undef PACKAGE_TARNAME
+
+/* Define to the version of this package. */
+#undef PACKAGE_VERSION
+
+/* Define to 1 if you have the ANSI C header files. */
+#undef STDC_HEADERS
+
+/* Enable extensions on AIX 3, Interix.  */
+#ifndef _ALL_SOURCE
+# undef _ALL_SOURCE
+#endif
+/* Enable GNU extensions on systems that have them.  */
+#ifndef _GNU_SOURCE
+# undef _GNU_SOURCE
+#endif
+/* Enable threading extensions on Solaris.  */
+#ifndef _POSIX_PTHREAD_SEMANTICS
+# undef _POSIX_PTHREAD_SEMANTICS
+#endif
+/* Enable extensions on HP NonStop.  */
+#ifndef _TANDEM_SOURCE
+# undef _TANDEM_SOURCE
+#endif
+/* Enable general extensions on Solaris.  */
+#ifndef __EXTENSIONS__
+# undef __EXTENSIONS__
+#endif
+
+
+/* Define to 1 if your processor stores words with the most significant byte
+   first (like Motorola and SPARC, unlike Intel and VAX). */
+#undef WORDS_BIGENDIAN
+
+/* Define to 1 if your processor stores words with the least significant byte
+   first (like Intel and VAX, unlike Motorola and SPARC). */
+#undef WORDS_LITTLEENDIAN
+
+/* Define to 1 if on MINIX. */
+#undef _MINIX
+
+/* Define to 2 if the system does not provide POSIX.1 features except with
+   this defined. */
+#undef _POSIX_1_SOURCE
+
+/* Define to 1 if you need to in order for `stat' and other things to work. */
+#undef _POSIX_SOURCE
+
+/* Define to empty if `const' does not conform to ANSI C. */
+#undef const
+
+/* Define to `__inline__' or `__inline' if that's what the C compiler
+   calls it, or to nothing if 'inline' is not supported under any name.  */
+#ifndef __cplusplus
+#undef inline
+#endif
+
+/* Define to the equivalent of the C99 'restrict' keyword, or to
+   nothing if this is not supported.  Do not define if restrict is
+   supported directly.  */
+#undef restrict
+/* Work around a bug in Sun C++: it does not support _Restrict, even
+   though the corresponding Sun C compiler does, which causes
+   "#define restrict _Restrict" in the previous line.  Perhaps some future
+   version of Sun C++ will work with _Restrict; if so, it'll probably
+   define __RESTRICT, just as Sun C does.  */
+#if defined __SUNPRO_CC && !defined __RESTRICT
+# define _Restrict
+#endif
+
+/* Define to `unsigned int' if <sys/types.h> does not define. */
+#undef size_t
diff --git a/configure b/configure
new file mode 100755 (executable)
index 0000000..3d4cc4b
--- /dev/null
+++ b/configure
@@ -0,0 +1,9270 @@
+#! /bin/sh
+# Guess values for system-dependent variables and create Makefiles.
+# Generated by GNU Autoconf 2.63.
+#
+# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001,
+# 2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
+# This configure script is free software; the Free Software Foundation
+# gives unlimited permission to copy, distribute and modify it.
+## --------------------- ##
+## M4sh Initialization.  ##
+## --------------------- ##
+
+# Be more Bourne compatible
+DUALCASE=1; export DUALCASE # for MKS sh
+if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
+  emulate sh
+  NULLCMD=:
+  # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which
+  # is contrary to our usage.  Disable this feature.
+  alias -g '${1+"$@"}'='"$@"'
+  setopt NO_GLOB_SUBST
+else
+  case `(set -o) 2>/dev/null` in
+  *posix*) set -o posix ;;
+esac
+
+fi
+
+
+
+
+# PATH needs CR
+# Avoid depending upon Character Ranges.
+as_cr_letters='abcdefghijklmnopqrstuvwxyz'
+as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
+as_cr_Letters=$as_cr_letters$as_cr_LETTERS
+as_cr_digits='0123456789'
+as_cr_alnum=$as_cr_Letters$as_cr_digits
+
+as_nl='
+'
+export as_nl
+# Printing a long string crashes Solaris 7 /usr/bin/printf.
+as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
+as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo
+as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo
+if (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then
+  as_echo='printf %s\n'
+  as_echo_n='printf %s'
+else
+  if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then
+    as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"'
+    as_echo_n='/usr/ucb/echo -n'
+  else
+    as_echo_body='eval expr "X$1" : "X\\(.*\\)"'
+    as_echo_n_body='eval
+      arg=$1;
+      case $arg in
+      *"$as_nl"*)
+       expr "X$arg" : "X\\(.*\\)$as_nl";
+       arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;;
+      esac;
+      expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl"
+    '
+    export as_echo_n_body
+    as_echo_n='sh -c $as_echo_n_body as_echo'
+  fi
+  export as_echo_body
+  as_echo='sh -c $as_echo_body as_echo'
+fi
+
+# The user is always right.
+if test "${PATH_SEPARATOR+set}" != set; then
+  PATH_SEPARATOR=:
+  (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && {
+    (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 ||
+      PATH_SEPARATOR=';'
+  }
+fi
+
+# Support unset when possible.
+if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then
+  as_unset=unset
+else
+  as_unset=false
+fi
+
+
+# IFS
+# We need space, tab and new line, in precisely that order.  Quoting is
+# there to prevent editors from complaining about space-tab.
+# (If _AS_PATH_WALK were called with IFS unset, it would disable word
+# splitting by setting IFS to empty value.)
+IFS=" ""       $as_nl"
+
+# Find who we are.  Look in the path if we contain no directory separator.
+case $0 in
+  *[\\/]* ) as_myself=$0 ;;
+  *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break
+done
+IFS=$as_save_IFS
+
+     ;;
+esac
+# We did not find ourselves, most probably we were run as `sh COMMAND'
+# in which case we are not to be found in the path.
+if test "x$as_myself" = x; then
+  as_myself=$0
+fi
+if test ! -f "$as_myself"; then
+  $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2
+  { (exit 1); exit 1; }
+fi
+
+# Work around bugs in pre-3.0 UWIN ksh.
+for as_var in ENV MAIL MAILPATH
+do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var
+done
+PS1='$ '
+PS2='> '
+PS4='+ '
+
+# NLS nuisances.
+LC_ALL=C
+export LC_ALL
+LANGUAGE=C
+export LANGUAGE
+
+# Required to use basename.
+if expr a : '\(a\)' >/dev/null 2>&1 &&
+   test "X`expr 00001 : '.*\(...\)'`" = X001; then
+  as_expr=expr
+else
+  as_expr=false
+fi
+
+if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then
+  as_basename=basename
+else
+  as_basename=false
+fi
+
+
+# Name of the executable.
+as_me=`$as_basename -- "$0" ||
+$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \
+        X"$0" : 'X\(//\)$' \| \
+        X"$0" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X/"$0" |
+    sed '/^.*\/\([^/][^/]*\)\/*$/{
+           s//\1/
+           q
+         }
+         /^X\/\(\/\/\)$/{
+           s//\1/
+           q
+         }
+         /^X\/\(\/\).*/{
+           s//\1/
+           q
+         }
+         s/.*/./; q'`
+
+# CDPATH.
+$as_unset CDPATH
+
+
+if test "x$CONFIG_SHELL" = x; then
+  if (eval ":") 2>/dev/null; then
+  as_have_required=yes
+else
+  as_have_required=no
+fi
+
+  if test $as_have_required = yes &&    (eval ":
+(as_func_return () {
+  (exit \$1)
+}
+as_func_success () {
+  as_func_return 0
+}
+as_func_failure () {
+  as_func_return 1
+}
+as_func_ret_success () {
+  return 0
+}
+as_func_ret_failure () {
+  return 1
+}
+
+exitcode=0
+if as_func_success; then
+  :
+else
+  exitcode=1
+  echo as_func_success failed.
+fi
+
+if as_func_failure; then
+  exitcode=1
+  echo as_func_failure succeeded.
+fi
+
+if as_func_ret_success; then
+  :
+else
+  exitcode=1
+  echo as_func_ret_success failed.
+fi
+
+if as_func_ret_failure; then
+  exitcode=1
+  echo as_func_ret_failure succeeded.
+fi
+
+if ( set x; as_func_ret_success y && test x = \"\$1\" ); then
+  :
+else
+  exitcode=1
+  echo positional parameters were not saved.
+fi
+
+test \$exitcode = 0) || { (exit 1); exit 1; }
+
+(
+  as_lineno_1=\$LINENO
+  as_lineno_2=\$LINENO
+  test \"x\$as_lineno_1\" != \"x\$as_lineno_2\" &&
+  test \"x\`expr \$as_lineno_1 + 1\`\" = \"x\$as_lineno_2\") || { (exit 1); exit 1; }
+") 2> /dev/null; then
+  :
+else
+  as_candidate_shells=
+    as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  case $as_dir in
+        /*)
+          for as_base in sh bash ksh sh5; do
+            as_candidate_shells="$as_candidate_shells $as_dir/$as_base"
+          done;;
+       esac
+done
+IFS=$as_save_IFS
+
+
+      for as_shell in $as_candidate_shells $SHELL; do
+        # Try only shells that exist, to save several forks.
+        if { test -f "$as_shell" || test -f "$as_shell.exe"; } &&
+               { ("$as_shell") 2> /dev/null <<\_ASEOF
+if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
+  emulate sh
+  NULLCMD=:
+  # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which
+  # is contrary to our usage.  Disable this feature.
+  alias -g '${1+"$@"}'='"$@"'
+  setopt NO_GLOB_SUBST
+else
+  case `(set -o) 2>/dev/null` in
+  *posix*) set -o posix ;;
+esac
+
+fi
+
+
+:
+_ASEOF
+}; then
+  CONFIG_SHELL=$as_shell
+              as_have_required=yes
+              if { "$as_shell" 2> /dev/null <<\_ASEOF
+if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
+  emulate sh
+  NULLCMD=:
+  # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which
+  # is contrary to our usage.  Disable this feature.
+  alias -g '${1+"$@"}'='"$@"'
+  setopt NO_GLOB_SUBST
+else
+  case `(set -o) 2>/dev/null` in
+  *posix*) set -o posix ;;
+esac
+
+fi
+
+
+:
+(as_func_return () {
+  (exit $1)
+}
+as_func_success () {
+  as_func_return 0
+}
+as_func_failure () {
+  as_func_return 1
+}
+as_func_ret_success () {
+  return 0
+}
+as_func_ret_failure () {
+  return 1
+}
+
+exitcode=0
+if as_func_success; then
+  :
+else
+  exitcode=1
+  echo as_func_success failed.
+fi
+
+if as_func_failure; then
+  exitcode=1
+  echo as_func_failure succeeded.
+fi
+
+if as_func_ret_success; then
+  :
+else
+  exitcode=1
+  echo as_func_ret_success failed.
+fi
+
+if as_func_ret_failure; then
+  exitcode=1
+  echo as_func_ret_failure succeeded.
+fi
+
+if ( set x; as_func_ret_success y && test x = "$1" ); then
+  :
+else
+  exitcode=1
+  echo positional parameters were not saved.
+fi
+
+test $exitcode = 0) || { (exit 1); exit 1; }
+
+(
+  as_lineno_1=$LINENO
+  as_lineno_2=$LINENO
+  test "x$as_lineno_1" != "x$as_lineno_2" &&
+  test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2") || { (exit 1); exit 1; }
+
+_ASEOF
+}; then
+  break
+fi
+
+fi
+
+      done
+
+      if test "x$CONFIG_SHELL" != x; then
+  for as_var in BASH_ENV ENV
+       do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var
+       done
+       export CONFIG_SHELL
+       exec "$CONFIG_SHELL" "$as_myself" ${1+"$@"}
+fi
+
+
+    if test $as_have_required = no; then
+  echo This script requires a shell more modern than all the
+      echo shells that I found on your system.  Please install a
+      echo modern shell, or manually run the script under such a
+      echo shell if you do have one.
+      { (exit 1); exit 1; }
+fi
+
+
+fi
+
+fi
+
+
+
+(eval "as_func_return () {
+  (exit \$1)
+}
+as_func_success () {
+  as_func_return 0
+}
+as_func_failure () {
+  as_func_return 1
+}
+as_func_ret_success () {
+  return 0
+}
+as_func_ret_failure () {
+  return 1
+}
+
+exitcode=0
+if as_func_success; then
+  :
+else
+  exitcode=1
+  echo as_func_success failed.
+fi
+
+if as_func_failure; then
+  exitcode=1
+  echo as_func_failure succeeded.
+fi
+
+if as_func_ret_success; then
+  :
+else
+  exitcode=1
+  echo as_func_ret_success failed.
+fi
+
+if as_func_ret_failure; then
+  exitcode=1
+  echo as_func_ret_failure succeeded.
+fi
+
+if ( set x; as_func_ret_success y && test x = \"\$1\" ); then
+  :
+else
+  exitcode=1
+  echo positional parameters were not saved.
+fi
+
+test \$exitcode = 0") || {
+  echo No shell found that supports shell functions.
+  echo Please tell bug-autoconf@gnu.org about your system,
+  echo including any error possibly output before this message.
+  echo This can help us improve future autoconf versions.
+  echo Configuration will now proceed without shell functions.
+}
+
+
+
+  as_lineno_1=$LINENO
+  as_lineno_2=$LINENO
+  test "x$as_lineno_1" != "x$as_lineno_2" &&
+  test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2" || {
+
+  # Create $as_me.lineno as a copy of $as_myself, but with $LINENO
+  # uniformly replaced by the line number.  The first 'sed' inserts a
+  # line-number line after each line using $LINENO; the second 'sed'
+  # does the real work.  The second script uses 'N' to pair each
+  # line-number line with the line containing $LINENO, and appends
+  # trailing '-' during substitution so that $LINENO is not a special
+  # case at line end.
+  # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the
+  # scripts with optimization help from Paolo Bonzini.  Blame Lee
+  # E. McMahon (1931-1989) for sed's syntax.  :-)
+  sed -n '
+    p
+    /[$]LINENO/=
+  ' <$as_myself |
+    sed '
+      s/[$]LINENO.*/&-/
+      t lineno
+      b
+      :lineno
+      N
+      :loop
+      s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/
+      t loop
+      s/-\n.*//
+    ' >$as_me.lineno &&
+  chmod +x "$as_me.lineno" ||
+    { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2
+   { (exit 1); exit 1; }; }
+
+  # Don't try to exec as it changes $[0], causing all sort of problems
+  # (the dirname of $[0] is not the place where we might find the
+  # original and so on.  Autoconf is especially sensitive to this).
+  . "./$as_me.lineno"
+  # Exit status is that of the last command.
+  exit
+}
+
+
+if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then
+  as_dirname=dirname
+else
+  as_dirname=false
+fi
+
+ECHO_C= ECHO_N= ECHO_T=
+case `echo -n x` in
+-n*)
+  case `echo 'x\c'` in
+  *c*) ECHO_T='        ';;     # ECHO_T is single tab character.
+  *)   ECHO_C='\c';;
+  esac;;
+*)
+  ECHO_N='-n';;
+esac
+if expr a : '\(a\)' >/dev/null 2>&1 &&
+   test "X`expr 00001 : '.*\(...\)'`" = X001; then
+  as_expr=expr
+else
+  as_expr=false
+fi
+
+rm -f conf$$ conf$$.exe conf$$.file
+if test -d conf$$.dir; then
+  rm -f conf$$.dir/conf$$.file
+else
+  rm -f conf$$.dir
+  mkdir conf$$.dir 2>/dev/null
+fi
+if (echo >conf$$.file) 2>/dev/null; then
+  if ln -s conf$$.file conf$$ 2>/dev/null; then
+    as_ln_s='ln -s'
+    # ... but there are two gotchas:
+    # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail.
+    # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable.
+    # In both cases, we have to default to `cp -p'.
+    ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe ||
+      as_ln_s='cp -p'
+  elif ln conf$$.file conf$$ 2>/dev/null; then
+    as_ln_s=ln
+  else
+    as_ln_s='cp -p'
+  fi
+else
+  as_ln_s='cp -p'
+fi
+rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file
+rmdir conf$$.dir 2>/dev/null
+
+if mkdir -p . 2>/dev/null; then
+  as_mkdir_p=:
+else
+  test -d ./-p && rmdir ./-p
+  as_mkdir_p=false
+fi
+
+if test -x / >/dev/null 2>&1; then
+  as_test_x='test -x'
+else
+  if ls -dL / >/dev/null 2>&1; then
+    as_ls_L_option=L
+  else
+    as_ls_L_option=
+  fi
+  as_test_x='
+    eval sh -c '\''
+      if test -d "$1"; then
+       test -d "$1/.";
+      else
+       case $1 in
+       -*)set "./$1";;
+       esac;
+       case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in
+       ???[sx]*):;;*)false;;esac;fi
+    '\'' sh
+  '
+fi
+as_executable_p=$as_test_x
+
+# Sed expression to map a string onto a valid CPP name.
+as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'"
+
+# Sed expression to map a string onto a valid variable name.
+as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'"
+
+
+
+exec 7<&0 </dev/null 6>&1
+
+# Name of the host.
+# hostname on some systems (SVR3.2, Linux) returns a bogus exit status,
+# so uname gets run too.
+ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q`
+
+#
+# Initializations.
+#
+ac_default_prefix=/usr/local
+ac_clean_files=
+ac_config_libobj_dir=.
+LIBOBJS=
+cross_compiling=no
+subdirs=
+MFLAGS=
+MAKEFLAGS=
+SHELL=${CONFIG_SHELL-/bin/sh}
+
+# Identity of this package.
+PACKAGE_NAME=
+PACKAGE_TARNAME=
+PACKAGE_VERSION=
+PACKAGE_STRING=
+PACKAGE_BUGREPORT=
+
+ac_unique_file="config.h.in"
+# Factoring default headers for most tests.
+ac_includes_default="\
+#include <stdio.h>
+#ifdef HAVE_SYS_TYPES_H
+# include <sys/types.h>
+#endif
+#ifdef HAVE_SYS_STAT_H
+# include <sys/stat.h>
+#endif
+#ifdef STDC_HEADERS
+# include <stdlib.h>
+# include <stddef.h>
+#else
+# ifdef HAVE_STDLIB_H
+#  include <stdlib.h>
+# endif
+#endif
+#ifdef HAVE_STRING_H
+# if !defined STDC_HEADERS && defined HAVE_MEMORY_H
+#  include <memory.h>
+# endif
+# include <string.h>
+#endif
+#ifdef HAVE_STRINGS_H
+# include <strings.h>
+#endif
+#ifdef HAVE_INTTYPES_H
+# include <inttypes.h>
+#endif
+#ifdef HAVE_STDINT_H
+# include <stdint.h>
+#endif
+#ifdef HAVE_UNISTD_H
+# include <unistd.h>
+#endif"
+
+ac_subst_vars='LTLIBOBJS
+LIBOBJS
+XOBJS
+PSTOPDF
+PS2PDF
+ACRODIST
+NROFF
+INSTALL_DATA
+INSTALL_SCRIPT
+INSTALL_PROGRAM
+SET_MAKE
+LN_S
+EGREP
+GREP
+CPP
+OBJEXT
+EXEEXT
+ac_ct_CC
+CPPFLAGS
+LDFLAGS
+CFLAGS
+CC
+ac_prefix_program
+target_alias
+host_alias
+build_alias
+LIBS
+ECHO_T
+ECHO_N
+ECHO_C
+DEFS
+mandir
+localedir
+libdir
+psdir
+pdfdir
+dvidir
+htmldir
+infodir
+docdir
+oldincludedir
+includedir
+localstatedir
+sharedstatedir
+sysconfdir
+datadir
+datarootdir
+libexecdir
+sbindir
+bindir
+program_transform_name
+prefix
+exec_prefix
+PACKAGE_BUGREPORT
+PACKAGE_STRING
+PACKAGE_VERSION
+PACKAGE_TARNAME
+PACKAGE_NAME
+PATH_SEPARATOR
+SHELL'
+ac_subst_files=''
+ac_user_opts='
+enable_option_checking
+'
+      ac_precious_vars='build_alias
+host_alias
+target_alias
+CC
+CFLAGS
+LDFLAGS
+LIBS
+CPPFLAGS
+CPP'
+
+
+# Initialize some variables set by options.
+ac_init_help=
+ac_init_version=false
+ac_unrecognized_opts=
+ac_unrecognized_sep=
+# The variables have the same names as the options, with
+# dashes changed to underlines.
+cache_file=/dev/null
+exec_prefix=NONE
+no_create=
+no_recursion=
+prefix=NONE
+program_prefix=NONE
+program_suffix=NONE
+program_transform_name=s,x,x,
+silent=
+site=
+srcdir=
+verbose=
+x_includes=NONE
+x_libraries=NONE
+
+# Installation directory options.
+# These are left unexpanded so users can "make install exec_prefix=/foo"
+# and all the variables that are supposed to be based on exec_prefix
+# by default will actually change.
+# Use braces instead of parens because sh, perl, etc. also accept them.
+# (The list follows the same order as the GNU Coding Standards.)
+bindir='${exec_prefix}/bin'
+sbindir='${exec_prefix}/sbin'
+libexecdir='${exec_prefix}/libexec'
+datarootdir='${prefix}/share'
+datadir='${datarootdir}'
+sysconfdir='${prefix}/etc'
+sharedstatedir='${prefix}/com'
+localstatedir='${prefix}/var'
+includedir='${prefix}/include'
+oldincludedir='/usr/include'
+docdir='${datarootdir}/doc/${PACKAGE}'
+infodir='${datarootdir}/info'
+htmldir='${docdir}'
+dvidir='${docdir}'
+pdfdir='${docdir}'
+psdir='${docdir}'
+libdir='${exec_prefix}/lib'
+localedir='${datarootdir}/locale'
+mandir='${datarootdir}/man'
+
+ac_prev=
+ac_dashdash=
+for ac_option
+do
+  # If the previous option needs an argument, assign it.
+  if test -n "$ac_prev"; then
+    eval $ac_prev=\$ac_option
+    ac_prev=
+    continue
+  fi
+
+  case $ac_option in
+  *=*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;;
+  *)   ac_optarg=yes ;;
+  esac
+
+  # Accept the important Cygnus configure options, so we can diagnose typos.
+
+  case $ac_dashdash$ac_option in
+  --)
+    ac_dashdash=yes ;;
+
+  -bindir | --bindir | --bindi | --bind | --bin | --bi)
+    ac_prev=bindir ;;
+  -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*)
+    bindir=$ac_optarg ;;
+
+  -build | --build | --buil | --bui | --bu)
+    ac_prev=build_alias ;;
+  -build=* | --build=* | --buil=* | --bui=* | --bu=*)
+    build_alias=$ac_optarg ;;
+
+  -cache-file | --cache-file | --cache-fil | --cache-fi \
+  | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c)
+    ac_prev=cache_file ;;
+  -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \
+  | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*)
+    cache_file=$ac_optarg ;;
+
+  --config-cache | -C)
+    cache_file=config.cache ;;
+
+  -datadir | --datadir | --datadi | --datad)
+    ac_prev=datadir ;;
+  -datadir=* | --datadir=* | --datadi=* | --datad=*)
+    datadir=$ac_optarg ;;
+
+  -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \
+  | --dataroo | --dataro | --datar)
+    ac_prev=datarootdir ;;
+  -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \
+  | --dataroot=* | --dataroo=* | --dataro=* | --datar=*)
+    datarootdir=$ac_optarg ;;
+
+  -disable-* | --disable-*)
+    ac_useropt=`expr "x$ac_option" : 'x-*disable-\(.*\)'`
+    # Reject names that are not valid shell variable names.
+    expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
+      { $as_echo "$as_me: error: invalid feature name: $ac_useropt" >&2
+   { (exit 1); exit 1; }; }
+    ac_useropt_orig=$ac_useropt
+    ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
+    case $ac_user_opts in
+      *"
+"enable_$ac_useropt"
+"*) ;;
+      *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--disable-$ac_useropt_orig"
+        ac_unrecognized_sep=', ';;
+    esac
+    eval enable_$ac_useropt=no ;;
+
+  -docdir | --docdir | --docdi | --doc | --do)
+    ac_prev=docdir ;;
+  -docdir=* | --docdir=* | --docdi=* | --doc=* | --do=*)
+    docdir=$ac_optarg ;;
+
+  -dvidir | --dvidir | --dvidi | --dvid | --dvi | --dv)
+    ac_prev=dvidir ;;
+  -dvidir=* | --dvidir=* | --dvidi=* | --dvid=* | --dvi=* | --dv=*)
+    dvidir=$ac_optarg ;;
+
+  -enable-* | --enable-*)
+    ac_useropt=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'`
+    # Reject names that are not valid shell variable names.
+    expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
+      { $as_echo "$as_me: error: invalid feature name: $ac_useropt" >&2
+   { (exit 1); exit 1; }; }
+    ac_useropt_orig=$ac_useropt
+    ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
+    case $ac_user_opts in
+      *"
+"enable_$ac_useropt"
+"*) ;;
+      *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--enable-$ac_useropt_orig"
+        ac_unrecognized_sep=', ';;
+    esac
+    eval enable_$ac_useropt=\$ac_optarg ;;
+
+  -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \
+  | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \
+  | --exec | --exe | --ex)
+    ac_prev=exec_prefix ;;
+  -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \
+  | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \
+  | --exec=* | --exe=* | --ex=*)
+    exec_prefix=$ac_optarg ;;
+
+  -gas | --gas | --ga | --g)
+    # Obsolete; use --with-gas.
+    with_gas=yes ;;
+
+  -help | --help | --hel | --he | -h)
+    ac_init_help=long ;;
+  -help=r* | --help=r* | --hel=r* | --he=r* | -hr*)
+    ac_init_help=recursive ;;
+  -help=s* | --help=s* | --hel=s* | --he=s* | -hs*)
+    ac_init_help=short ;;
+
+  -host | --host | --hos | --ho)
+    ac_prev=host_alias ;;
+  -host=* | --host=* | --hos=* | --ho=*)
+    host_alias=$ac_optarg ;;
+
+  -htmldir | --htmldir | --htmldi | --htmld | --html | --htm | --ht)
+    ac_prev=htmldir ;;
+  -htmldir=* | --htmldir=* | --htmldi=* | --htmld=* | --html=* | --htm=* \
+  | --ht=*)
+    htmldir=$ac_optarg ;;
+
+  -includedir | --includedir | --includedi | --included | --include \
+  | --includ | --inclu | --incl | --inc)
+    ac_prev=includedir ;;
+  -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \
+  | --includ=* | --inclu=* | --incl=* | --inc=*)
+    includedir=$ac_optarg ;;
+
+  -infodir | --infodir | --infodi | --infod | --info | --inf)
+    ac_prev=infodir ;;
+  -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*)
+    infodir=$ac_optarg ;;
+
+  -libdir | --libdir | --libdi | --libd)
+    ac_prev=libdir ;;
+  -libdir=* | --libdir=* | --libdi=* | --libd=*)
+    libdir=$ac_optarg ;;
+
+  -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \
+  | --libexe | --libex | --libe)
+    ac_prev=libexecdir ;;
+  -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \
+  | --libexe=* | --libex=* | --libe=*)
+    libexecdir=$ac_optarg ;;
+
+  -localedir | --localedir | --localedi | --localed | --locale)
+    ac_prev=localedir ;;
+  -localedir=* | --localedir=* | --localedi=* | --localed=* | --locale=*)
+    localedir=$ac_optarg ;;
+
+  -localstatedir | --localstatedir | --localstatedi | --localstated \
+  | --localstate | --localstat | --localsta | --localst | --locals)
+    ac_prev=localstatedir ;;
+  -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \
+  | --localstate=* | --localstat=* | --localsta=* | --localst=* | --locals=*)
+    localstatedir=$ac_optarg ;;
+
+  -mandir | --mandir | --mandi | --mand | --man | --ma | --m)
+    ac_prev=mandir ;;
+  -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*)
+    mandir=$ac_optarg ;;
+
+  -nfp | --nfp | --nf)
+    # Obsolete; use --without-fp.
+    with_fp=no ;;
+
+  -no-create | --no-create | --no-creat | --no-crea | --no-cre \
+  | --no-cr | --no-c | -n)
+    no_create=yes ;;
+
+  -no-recursion | --no-recursion | --no-recursio | --no-recursi \
+  | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r)
+    no_recursion=yes ;;
+
+  -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \
+  | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \
+  | --oldin | --oldi | --old | --ol | --o)
+    ac_prev=oldincludedir ;;
+  -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \
+  | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \
+  | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*)
+    oldincludedir=$ac_optarg ;;
+
+  -prefix | --prefix | --prefi | --pref | --pre | --pr | --p)
+    ac_prev=prefix ;;
+  -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*)
+    prefix=$ac_optarg ;;
+
+  -program-prefix | --program-prefix | --program-prefi | --program-pref \
+  | --program-pre | --program-pr | --program-p)
+    ac_prev=program_prefix ;;
+  -program-prefix=* | --program-prefix=* | --program-prefi=* \
+  | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*)
+    program_prefix=$ac_optarg ;;
+
+  -program-suffix | --program-suffix | --program-suffi | --program-suff \
+  | --program-suf | --program-su | --program-s)
+    ac_prev=program_suffix ;;
+  -program-suffix=* | --program-suffix=* | --program-suffi=* \
+  | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*)
+    program_suffix=$ac_optarg ;;
+
+  -program-transform-name | --program-transform-name \
+  | --program-transform-nam | --program-transform-na \
+  | --program-transform-n | --program-transform- \
+  | --program-transform | --program-transfor \
+  | --program-transfo | --program-transf \
+  | --program-trans | --program-tran \
+  | --progr-tra | --program-tr | --program-t)
+    ac_prev=program_transform_name ;;
+  -program-transform-name=* | --program-transform-name=* \
+  | --program-transform-nam=* | --program-transform-na=* \
+  | --program-transform-n=* | --program-transform-=* \
+  | --program-transform=* | --program-transfor=* \
+  | --program-transfo=* | --program-transf=* \
+  | --program-trans=* | --program-tran=* \
+  | --progr-tra=* | --program-tr=* | --program-t=*)
+    program_transform_name=$ac_optarg ;;
+
+  -pdfdir | --pdfdir | --pdfdi | --pdfd | --pdf | --pd)
+    ac_prev=pdfdir ;;
+  -pdfdir=* | --pdfdir=* | --pdfdi=* | --pdfd=* | --pdf=* | --pd=*)
+    pdfdir=$ac_optarg ;;
+
+  -psdir | --psdir | --psdi | --psd | --ps)
+    ac_prev=psdir ;;
+  -psdir=* | --psdir=* | --psdi=* | --psd=* | --ps=*)
+    psdir=$ac_optarg ;;
+
+  -q | -quiet | --quiet | --quie | --qui | --qu | --q \
+  | -silent | --silent | --silen | --sile | --sil)
+    silent=yes ;;
+
+  -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)
+    ac_prev=sbindir ;;
+  -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
+  | --sbi=* | --sb=*)
+    sbindir=$ac_optarg ;;
+
+  -sharedstatedir | --sharedstatedir | --sharedstatedi \
+  | --sharedstated | --sharedstate | --sharedstat | --sharedsta \
+  | --sharedst | --shareds | --shared | --share | --shar \
+  | --sha | --sh)
+    ac_prev=sharedstatedir ;;
+  -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \
+  | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \
+  | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \
+  | --sha=* | --sh=*)
+    sharedstatedir=$ac_optarg ;;
+
+  -site | --site | --sit)
+    ac_prev=site ;;
+  -site=* | --site=* | --sit=*)
+    site=$ac_optarg ;;
+
+  -srcdir | --srcdir | --srcdi | --srcd | --src | --sr)
+    ac_prev=srcdir ;;
+  -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*)
+    srcdir=$ac_optarg ;;
+
+  -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \
+  | --syscon | --sysco | --sysc | --sys | --sy)
+    ac_prev=sysconfdir ;;
+  -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \
+  | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*)
+    sysconfdir=$ac_optarg ;;
+
+  -target | --target | --targe | --targ | --tar | --ta | --t)
+    ac_prev=target_alias ;;
+  -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*)
+    target_alias=$ac_optarg ;;
+
+  -v | -verbose | --verbose | --verbos | --verbo | --verb)
+    verbose=yes ;;
+
+  -version | --version | --versio | --versi | --vers | -V)
+    ac_init_version=: ;;
+
+  -with-* | --with-*)
+    ac_useropt=`expr "x$ac_option" : 'x-*with-\([^=]*\)'`
+    # Reject names that are not valid shell variable names.
+    expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
+      { $as_echo "$as_me: error: invalid package name: $ac_useropt" >&2
+   { (exit 1); exit 1; }; }
+    ac_useropt_orig=$ac_useropt
+    ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
+    case $ac_user_opts in
+      *"
+"with_$ac_useropt"
+"*) ;;
+      *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--with-$ac_useropt_orig"
+        ac_unrecognized_sep=', ';;
+    esac
+    eval with_$ac_useropt=\$ac_optarg ;;
+
+  -without-* | --without-*)
+    ac_useropt=`expr "x$ac_option" : 'x-*without-\(.*\)'`
+    # Reject names that are not valid shell variable names.
+    expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
+      { $as_echo "$as_me: error: invalid package name: $ac_useropt" >&2
+   { (exit 1); exit 1; }; }
+    ac_useropt_orig=$ac_useropt
+    ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
+    case $ac_user_opts in
+      *"
+"with_$ac_useropt"
+"*) ;;
+      *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--without-$ac_useropt_orig"
+        ac_unrecognized_sep=', ';;
+    esac
+    eval with_$ac_useropt=no ;;
+
+  --x)
+    # Obsolete; use --with-x.
+    with_x=yes ;;
+
+  -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \
+  | --x-incl | --x-inc | --x-in | --x-i)
+    ac_prev=x_includes ;;
+  -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \
+  | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*)
+    x_includes=$ac_optarg ;;
+
+  -x-libraries | --x-libraries | --x-librarie | --x-librari \
+  | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l)
+    ac_prev=x_libraries ;;
+  -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \
+  | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*)
+    x_libraries=$ac_optarg ;;
+
+  -*) { $as_echo "$as_me: error: unrecognized option: $ac_option
+Try \`$0 --help' for more information." >&2
+   { (exit 1); exit 1; }; }
+    ;;
+
+  *=*)
+    ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='`
+    # Reject names that are not valid shell variable names.
+    expr "x$ac_envvar" : ".*[^_$as_cr_alnum]" >/dev/null &&
+      { $as_echo "$as_me: error: invalid variable name: $ac_envvar" >&2
+   { (exit 1); exit 1; }; }
+    eval $ac_envvar=\$ac_optarg
+    export $ac_envvar ;;
+
+  *)
+    # FIXME: should be removed in autoconf 3.0.
+    $as_echo "$as_me: WARNING: you should use --build, --host, --target" >&2
+    expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null &&
+      $as_echo "$as_me: WARNING: invalid host type: $ac_option" >&2
+    : ${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}
+    ;;
+
+  esac
+done
+
+if test -n "$ac_prev"; then
+  ac_option=--`echo $ac_prev | sed 's/_/-/g'`
+  { $as_echo "$as_me: error: missing argument to $ac_option" >&2
+   { (exit 1); exit 1; }; }
+fi
+
+if test -n "$ac_unrecognized_opts"; then
+  case $enable_option_checking in
+    no) ;;
+    fatal) { $as_echo "$as_me: error: unrecognized options: $ac_unrecognized_opts" >&2
+   { (exit 1); exit 1; }; } ;;
+    *)     $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;;
+  esac
+fi
+
+# Check all directory arguments for consistency.
+for ac_var in  exec_prefix prefix bindir sbindir libexecdir datarootdir \
+               datadir sysconfdir sharedstatedir localstatedir includedir \
+               oldincludedir docdir infodir htmldir dvidir pdfdir psdir \
+               libdir localedir mandir
+do
+  eval ac_val=\$$ac_var
+  # Remove trailing slashes.
+  case $ac_val in
+    */ )
+      ac_val=`expr "X$ac_val" : 'X\(.*[^/]\)' \| "X$ac_val" : 'X\(.*\)'`
+      eval $ac_var=\$ac_val;;
+  esac
+  # Be sure to have absolute directory names.
+  case $ac_val in
+    [\\/$]* | ?:[\\/]* )  continue;;
+    NONE | '' ) case $ac_var in *prefix ) continue;; esac;;
+  esac
+  { $as_echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2
+   { (exit 1); exit 1; }; }
+done
+
+# There might be people who depend on the old broken behavior: `$host'
+# used to hold the argument of --host etc.
+# FIXME: To remove some day.
+build=$build_alias
+host=$host_alias
+target=$target_alias
+
+# FIXME: To remove some day.
+if test "x$host_alias" != x; then
+  if test "x$build_alias" = x; then
+    cross_compiling=maybe
+    $as_echo "$as_me: WARNING: If you wanted to set the --build type, don't use --host.
+    If a cross compiler is detected then cross compile mode will be used." >&2
+  elif test "x$build_alias" != "x$host_alias"; then
+    cross_compiling=yes
+  fi
+fi
+
+ac_tool_prefix=
+test -n "$host_alias" && ac_tool_prefix=$host_alias-
+
+test "$silent" = yes && exec 6>/dev/null
+
+
+ac_pwd=`pwd` && test -n "$ac_pwd" &&
+ac_ls_di=`ls -di .` &&
+ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` ||
+  { $as_echo "$as_me: error: working directory cannot be determined" >&2
+   { (exit 1); exit 1; }; }
+test "X$ac_ls_di" = "X$ac_pwd_ls_di" ||
+  { $as_echo "$as_me: error: pwd does not report name of working directory" >&2
+   { (exit 1); exit 1; }; }
+
+
+# Find the source files, if location was not specified.
+if test -z "$srcdir"; then
+  ac_srcdir_defaulted=yes
+  # Try the directory containing this script, then the parent directory.
+  ac_confdir=`$as_dirname -- "$as_myself" ||
+$as_expr X"$as_myself" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+        X"$as_myself" : 'X\(//\)[^/]' \| \
+        X"$as_myself" : 'X\(//\)$' \| \
+        X"$as_myself" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X"$as_myself" |
+    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+           s//\1/
+           q
+         }
+         /^X\(\/\/\)[^/].*/{
+           s//\1/
+           q
+         }
+         /^X\(\/\/\)$/{
+           s//\1/
+           q
+         }
+         /^X\(\/\).*/{
+           s//\1/
+           q
+         }
+         s/.*/./; q'`
+  srcdir=$ac_confdir
+  if test ! -r "$srcdir/$ac_unique_file"; then
+    srcdir=..
+  fi
+else
+  ac_srcdir_defaulted=no
+fi
+if test ! -r "$srcdir/$ac_unique_file"; then
+  test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .."
+  { $as_echo "$as_me: error: cannot find sources ($ac_unique_file) in $srcdir" >&2
+   { (exit 1); exit 1; }; }
+fi
+ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work"
+ac_abs_confdir=`(
+       cd "$srcdir" && test -r "./$ac_unique_file" || { $as_echo "$as_me: error: $ac_msg" >&2
+   { (exit 1); exit 1; }; }
+       pwd)`
+# When building in place, set srcdir=.
+if test "$ac_abs_confdir" = "$ac_pwd"; then
+  srcdir=.
+fi
+# Remove unnecessary trailing slashes from srcdir.
+# Double slashes in file names in object file debugging info
+# mess up M-x gdb in Emacs.
+case $srcdir in
+*/) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;;
+esac
+for ac_var in $ac_precious_vars; do
+  eval ac_env_${ac_var}_set=\${${ac_var}+set}
+  eval ac_env_${ac_var}_value=\$${ac_var}
+  eval ac_cv_env_${ac_var}_set=\${${ac_var}+set}
+  eval ac_cv_env_${ac_var}_value=\$${ac_var}
+done
+
+#
+# Report the --help message.
+#
+if test "$ac_init_help" = "long"; then
+  # Omit some internal or obsolete options to make the list less imposing.
+  # This message is too long to be a string in the A/UX 3.1 sh.
+  cat <<_ACEOF
+\`configure' configures this package to adapt to many kinds of systems.
+
+Usage: $0 [OPTION]... [VAR=VALUE]...
+
+To assign environment variables (e.g., CC, CFLAGS...), specify them as
+VAR=VALUE.  See below for descriptions of some of the useful variables.
+
+Defaults for the options are specified in brackets.
+
+Configuration:
+  -h, --help              display this help and exit
+      --help=short        display options specific to this package
+      --help=recursive    display the short help of all the included packages
+  -V, --version           display version information and exit
+  -q, --quiet, --silent   do not print \`checking...' messages
+      --cache-file=FILE   cache test results in FILE [disabled]
+  -C, --config-cache      alias for \`--cache-file=config.cache'
+  -n, --no-create         do not create output files
+      --srcdir=DIR        find the sources in DIR [configure dir or \`..']
+
+Installation directories:
+  --prefix=PREFIX         install architecture-independent files in PREFIX
+                          [$ac_default_prefix]
+  --exec-prefix=EPREFIX   install architecture-dependent files in EPREFIX
+                          [PREFIX]
+
+By default, \`make install' will install all the files in
+\`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc.  You can specify
+an installation prefix other than \`$ac_default_prefix' using \`--prefix',
+for instance \`--prefix=\$HOME'.
+
+For better control, use the options below.
+
+Fine tuning of the installation directories:
+  --bindir=DIR            user executables [EPREFIX/bin]
+  --sbindir=DIR           system admin executables [EPREFIX/sbin]
+  --libexecdir=DIR        program executables [EPREFIX/libexec]
+  --sysconfdir=DIR        read-only single-machine data [PREFIX/etc]
+  --sharedstatedir=DIR    modifiable architecture-independent data [PREFIX/com]
+  --localstatedir=DIR     modifiable single-machine data [PREFIX/var]
+  --libdir=DIR            object code libraries [EPREFIX/lib]
+  --includedir=DIR        C header files [PREFIX/include]
+  --oldincludedir=DIR     C header files for non-gcc [/usr/include]
+  --datarootdir=DIR       read-only arch.-independent data root [PREFIX/share]
+  --datadir=DIR           read-only architecture-independent data [DATAROOTDIR]
+  --infodir=DIR           info documentation [DATAROOTDIR/info]
+  --localedir=DIR         locale-dependent data [DATAROOTDIR/locale]
+  --mandir=DIR            man documentation [DATAROOTDIR/man]
+  --docdir=DIR            documentation root [DATAROOTDIR/doc/PACKAGE]
+  --htmldir=DIR           html documentation [DOCDIR]
+  --dvidir=DIR            dvi documentation [DOCDIR]
+  --pdfdir=DIR            pdf documentation [DOCDIR]
+  --psdir=DIR             ps documentation [DOCDIR]
+_ACEOF
+
+  cat <<\_ACEOF
+_ACEOF
+fi
+
+if test -n "$ac_init_help"; then
+
+  cat <<\_ACEOF
+
+Some influential environment variables:
+  CC          C compiler command
+  CFLAGS      C compiler flags
+  LDFLAGS     linker flags, e.g. -L<lib dir> if you have libraries in a
+              nonstandard directory <lib dir>
+  LIBS        libraries to pass to the linker, e.g. -l<library>
+  CPPFLAGS    C/C++/Objective C preprocessor flags, e.g. -I<include dir> if
+              you have headers in a nonstandard directory <include dir>
+  CPP         C preprocessor
+
+Use these variables to override the choices made by `configure' or to help
+it to find libraries and programs with nonstandard names/locations.
+
+_ACEOF
+ac_status=$?
+fi
+
+if test "$ac_init_help" = "recursive"; then
+  # If there are subdirs, report their specific --help.
+  for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue
+    test -d "$ac_dir" ||
+      { cd "$srcdir" && ac_pwd=`pwd` && srcdir=. && test -d "$ac_dir"; } ||
+      continue
+    ac_builddir=.
+
+case "$ac_dir" in
+.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;;
+*)
+  ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'`
+  # A ".." for each directory in $ac_dir_suffix.
+  ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'`
+  case $ac_top_builddir_sub in
+  "") ac_top_builddir_sub=. ac_top_build_prefix= ;;
+  *)  ac_top_build_prefix=$ac_top_builddir_sub/ ;;
+  esac ;;
+esac
+ac_abs_top_builddir=$ac_pwd
+ac_abs_builddir=$ac_pwd$ac_dir_suffix
+# for backward compatibility:
+ac_top_builddir=$ac_top_build_prefix
+
+case $srcdir in
+  .)  # We are building in place.
+    ac_srcdir=.
+    ac_top_srcdir=$ac_top_builddir_sub
+    ac_abs_top_srcdir=$ac_pwd ;;
+  [\\/]* | ?:[\\/]* )  # Absolute name.
+    ac_srcdir=$srcdir$ac_dir_suffix;
+    ac_top_srcdir=$srcdir
+    ac_abs_top_srcdir=$srcdir ;;
+  *) # Relative name.
+    ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix
+    ac_top_srcdir=$ac_top_build_prefix$srcdir
+    ac_abs_top_srcdir=$ac_pwd/$srcdir ;;
+esac
+ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix
+
+    cd "$ac_dir" || { ac_status=$?; continue; }
+    # Check for guested configure.
+    if test -f "$ac_srcdir/configure.gnu"; then
+      echo &&
+      $SHELL "$ac_srcdir/configure.gnu" --help=recursive
+    elif test -f "$ac_srcdir/configure"; then
+      echo &&
+      $SHELL "$ac_srcdir/configure" --help=recursive
+    else
+      $as_echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2
+    fi || ac_status=$?
+    cd "$ac_pwd" || { ac_status=$?; break; }
+  done
+fi
+
+test -n "$ac_init_help" && exit $ac_status
+if $ac_init_version; then
+  cat <<\_ACEOF
+configure
+generated by GNU Autoconf 2.63
+
+Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001,
+2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
+This configure script is free software; the Free Software Foundation
+gives unlimited permission to copy, distribute and modify it.
+_ACEOF
+  exit
+fi
+cat >config.log <<_ACEOF
+This file contains any messages produced by compilers while
+running configure, to aid debugging if configure makes a mistake.
+
+It was created by $as_me, which was
+generated by GNU Autoconf 2.63.  Invocation command line was
+
+  $ $0 $@
+
+_ACEOF
+exec 5>>config.log
+{
+cat <<_ASUNAME
+## --------- ##
+## Platform. ##
+## --------- ##
+
+hostname = `(hostname || uname -n) 2>/dev/null | sed 1q`
+uname -m = `(uname -m) 2>/dev/null || echo unknown`
+uname -r = `(uname -r) 2>/dev/null || echo unknown`
+uname -s = `(uname -s) 2>/dev/null || echo unknown`
+uname -v = `(uname -v) 2>/dev/null || echo unknown`
+
+/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown`
+/bin/uname -X     = `(/bin/uname -X) 2>/dev/null     || echo unknown`
+
+/bin/arch              = `(/bin/arch) 2>/dev/null              || echo unknown`
+/usr/bin/arch -k       = `(/usr/bin/arch -k) 2>/dev/null       || echo unknown`
+/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown`
+/usr/bin/hostinfo      = `(/usr/bin/hostinfo) 2>/dev/null      || echo unknown`
+/bin/machine           = `(/bin/machine) 2>/dev/null           || echo unknown`
+/usr/bin/oslevel       = `(/usr/bin/oslevel) 2>/dev/null       || echo unknown`
+/bin/universe          = `(/bin/universe) 2>/dev/null          || echo unknown`
+
+_ASUNAME
+
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  $as_echo "PATH: $as_dir"
+done
+IFS=$as_save_IFS
+
+} >&5
+
+cat >&5 <<_ACEOF
+
+
+## ----------- ##
+## Core tests. ##
+## ----------- ##
+
+_ACEOF
+
+
+# Keep a trace of the command line.
+# Strip out --no-create and --no-recursion so they do not pile up.
+# Strip out --silent because we don't want to record it for future runs.
+# Also quote any args containing shell meta-characters.
+# Make two passes to allow for proper duplicate-argument suppression.
+ac_configure_args=
+ac_configure_args0=
+ac_configure_args1=
+ac_must_keep_next=false
+for ac_pass in 1 2
+do
+  for ac_arg
+  do
+    case $ac_arg in
+    -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;;
+    -q | -quiet | --quiet | --quie | --qui | --qu | --q \
+    | -silent | --silent | --silen | --sile | --sil)
+      continue ;;
+    *\'*)
+      ac_arg=`$as_echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;;
+    esac
+    case $ac_pass in
+    1) ac_configure_args0="$ac_configure_args0 '$ac_arg'" ;;
+    2)
+      ac_configure_args1="$ac_configure_args1 '$ac_arg'"
+      if test $ac_must_keep_next = true; then
+       ac_must_keep_next=false # Got value, back to normal.
+      else
+       case $ac_arg in
+         *=* | --config-cache | -C | -disable-* | --disable-* \
+         | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \
+         | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \
+         | -with-* | --with-* | -without-* | --without-* | --x)
+           case "$ac_configure_args0 " in
+             "$ac_configure_args1"*" '$ac_arg' "* ) continue ;;
+           esac
+           ;;
+         -* ) ac_must_keep_next=true ;;
+       esac
+      fi
+      ac_configure_args="$ac_configure_args '$ac_arg'"
+      ;;
+    esac
+  done
+done
+$as_unset ac_configure_args0 || test "${ac_configure_args0+set}" != set || { ac_configure_args0=; export ac_configure_args0; }
+$as_unset ac_configure_args1 || test "${ac_configure_args1+set}" != set || { ac_configure_args1=; export ac_configure_args1; }
+
+# When interrupted or exit'd, cleanup temporary files, and complete
+# config.log.  We remove comments because anyway the quotes in there
+# would cause problems or look ugly.
+# WARNING: Use '\'' to represent an apostrophe within the trap.
+# WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug.
+trap 'exit_status=$?
+  # Save into config.log some information that might help in debugging.
+  {
+    echo
+
+    cat <<\_ASBOX
+## ---------------- ##
+## Cache variables. ##
+## ---------------- ##
+_ASBOX
+    echo
+    # The following way of writing the cache mishandles newlines in values,
+(
+  for ac_var in `(set) 2>&1 | sed -n '\''s/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'\''`; do
+    eval ac_val=\$$ac_var
+    case $ac_val in #(
+    *${as_nl}*)
+      case $ac_var in #(
+      *_cv_*) { $as_echo "$as_me:$LINENO: WARNING: cache variable $ac_var contains a newline" >&5
+$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;;
+      esac
+      case $ac_var in #(
+      _ | IFS | as_nl) ;; #(
+      BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #(
+      *) $as_unset $ac_var ;;
+      esac ;;
+    esac
+  done
+  (set) 2>&1 |
+    case $as_nl`(ac_space='\'' '\''; set) 2>&1` in #(
+    *${as_nl}ac_space=\ *)
+      sed -n \
+       "s/'\''/'\''\\\\'\'''\''/g;
+         s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\''\\2'\''/p"
+      ;; #(
+    *)
+      sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p"
+      ;;
+    esac |
+    sort
+)
+    echo
+
+    cat <<\_ASBOX
+## ----------------- ##
+## Output variables. ##
+## ----------------- ##
+_ASBOX
+    echo
+    for ac_var in $ac_subst_vars
+    do
+      eval ac_val=\$$ac_var
+      case $ac_val in
+      *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;;
+      esac
+      $as_echo "$ac_var='\''$ac_val'\''"
+    done | sort
+    echo
+
+    if test -n "$ac_subst_files"; then
+      cat <<\_ASBOX
+## ------------------- ##
+## File substitutions. ##
+## ------------------- ##
+_ASBOX
+      echo
+      for ac_var in $ac_subst_files
+      do
+       eval ac_val=\$$ac_var
+       case $ac_val in
+       *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;;
+       esac
+       $as_echo "$ac_var='\''$ac_val'\''"
+      done | sort
+      echo
+    fi
+
+    if test -s confdefs.h; then
+      cat <<\_ASBOX
+## ----------- ##
+## confdefs.h. ##
+## ----------- ##
+_ASBOX
+      echo
+      cat confdefs.h
+      echo
+    fi
+    test "$ac_signal" != 0 &&
+      $as_echo "$as_me: caught signal $ac_signal"
+    $as_echo "$as_me: exit $exit_status"
+  } >&5
+  rm -f core *.core core.conftest.* &&
+    rm -f -r conftest* confdefs* conf$$* $ac_clean_files &&
+    exit $exit_status
+' 0
+for ac_signal in 1 2 13 15; do
+  trap 'ac_signal='$ac_signal'; { (exit 1); exit 1; }' $ac_signal
+done
+ac_signal=0
+
+# confdefs.h avoids OS command line length limits that DEFS can exceed.
+rm -f -r conftest* confdefs.h
+
+# Predefined preprocessor variables.
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE_NAME "$PACKAGE_NAME"
+_ACEOF
+
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE_TARNAME "$PACKAGE_TARNAME"
+_ACEOF
+
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE_VERSION "$PACKAGE_VERSION"
+_ACEOF
+
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE_STRING "$PACKAGE_STRING"
+_ACEOF
+
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT"
+_ACEOF
+
+
+# Let the site file select an alternate cache file if it wants to.
+# Prefer an explicitly selected file to automatically selected ones.
+ac_site_file1=NONE
+ac_site_file2=NONE
+if test -n "$CONFIG_SITE"; then
+  ac_site_file1=$CONFIG_SITE
+elif test "x$prefix" != xNONE; then
+  ac_site_file1=$prefix/share/config.site
+  ac_site_file2=$prefix/etc/config.site
+else
+  ac_site_file1=$ac_default_prefix/share/config.site
+  ac_site_file2=$ac_default_prefix/etc/config.site
+fi
+for ac_site_file in "$ac_site_file1" "$ac_site_file2"
+do
+  test "x$ac_site_file" = xNONE && continue
+  if test -r "$ac_site_file"; then
+    { $as_echo "$as_me:$LINENO: loading site script $ac_site_file" >&5
+$as_echo "$as_me: loading site script $ac_site_file" >&6;}
+    sed 's/^/| /' "$ac_site_file" >&5
+    . "$ac_site_file"
+  fi
+done
+
+if test -r "$cache_file"; then
+  # Some versions of bash will fail to source /dev/null (special
+  # files actually), so we avoid doing that.
+  if test -f "$cache_file"; then
+    { $as_echo "$as_me:$LINENO: loading cache $cache_file" >&5
+$as_echo "$as_me: loading cache $cache_file" >&6;}
+    case $cache_file in
+      [\\/]* | ?:[\\/]* ) . "$cache_file";;
+      *)                      . "./$cache_file";;
+    esac
+  fi
+else
+  { $as_echo "$as_me:$LINENO: creating cache $cache_file" >&5
+$as_echo "$as_me: creating cache $cache_file" >&6;}
+  >$cache_file
+fi
+
+# Check that the precious variables saved in the cache have kept the same
+# value.
+ac_cache_corrupted=false
+for ac_var in $ac_precious_vars; do
+  eval ac_old_set=\$ac_cv_env_${ac_var}_set
+  eval ac_new_set=\$ac_env_${ac_var}_set
+  eval ac_old_val=\$ac_cv_env_${ac_var}_value
+  eval ac_new_val=\$ac_env_${ac_var}_value
+  case $ac_old_set,$ac_new_set in
+    set,)
+      { $as_echo "$as_me:$LINENO: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5
+$as_echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;}
+      ac_cache_corrupted=: ;;
+    ,set)
+      { $as_echo "$as_me:$LINENO: error: \`$ac_var' was not set in the previous run" >&5
+$as_echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;}
+      ac_cache_corrupted=: ;;
+    ,);;
+    *)
+      if test "x$ac_old_val" != "x$ac_new_val"; then
+       # differences in whitespace do not lead to failure.
+       ac_old_val_w=`echo x $ac_old_val`
+       ac_new_val_w=`echo x $ac_new_val`
+       if test "$ac_old_val_w" != "$ac_new_val_w"; then
+         { $as_echo "$as_me:$LINENO: error: \`$ac_var' has changed since the previous run:" >&5
+$as_echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;}
+         ac_cache_corrupted=:
+       else
+         { $as_echo "$as_me:$LINENO: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&5
+$as_echo "$as_me: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&2;}
+         eval $ac_var=\$ac_old_val
+       fi
+       { $as_echo "$as_me:$LINENO:   former value:  \`$ac_old_val'" >&5
+$as_echo "$as_me:   former value:  \`$ac_old_val'" >&2;}
+       { $as_echo "$as_me:$LINENO:   current value: \`$ac_new_val'" >&5
+$as_echo "$as_me:   current value: \`$ac_new_val'" >&2;}
+      fi;;
+  esac
+  # Pass precious variables to config.status.
+  if test "$ac_new_set" = set; then
+    case $ac_new_val in
+    *\'*) ac_arg=$ac_var=`$as_echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;;
+    *) ac_arg=$ac_var=$ac_new_val ;;
+    esac
+    case " $ac_configure_args " in
+      *" '$ac_arg' "*) ;; # Avoid dups.  Use of quotes ensures accuracy.
+      *) ac_configure_args="$ac_configure_args '$ac_arg'" ;;
+    esac
+  fi
+done
+if $ac_cache_corrupted; then
+  { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+  { $as_echo "$as_me:$LINENO: error: changes in the environment can compromise the build" >&5
+$as_echo "$as_me: error: changes in the environment can compromise the build" >&2;}
+  { { $as_echo "$as_me:$LINENO: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&5
+$as_echo "$as_me: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&2;}
+   { (exit 1); exit 1; }; }
+fi
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+
+ac_config_headers="$ac_config_headers config.h"
+
+
+
+
+if test "x$prefix" = xNONE; then
+  $as_echo_n "checking for prefix by " >&6
+  # Extract the first word of "nasm", so it can be a program name with args.
+set dummy nasm; ac_word=$2
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_path_ac_prefix_program+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  case $ac_prefix_program in
+  [\\/]* | ?:[\\/]*)
+  ac_cv_path_ac_prefix_program="$ac_prefix_program" # Let the user override the test with a path.
+  ;;
+  *)
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_path_ac_prefix_program="$as_dir/$ac_word$ac_exec_ext"
+    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+IFS=$as_save_IFS
+
+  ;;
+esac
+fi
+ac_prefix_program=$ac_cv_path_ac_prefix_program
+if test -n "$ac_prefix_program"; then
+  { $as_echo "$as_me:$LINENO: result: $ac_prefix_program" >&5
+$as_echo "$ac_prefix_program" >&6; }
+else
+  { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+  if test -n "$ac_prefix_program"; then
+    prefix=`$as_dirname -- "$ac_prefix_program" ||
+$as_expr X"$ac_prefix_program" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+        X"$ac_prefix_program" : 'X\(//\)[^/]' \| \
+        X"$ac_prefix_program" : 'X\(//\)$' \| \
+        X"$ac_prefix_program" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X"$ac_prefix_program" |
+    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+           s//\1/
+           q
+         }
+         /^X\(\/\/\)[^/].*/{
+           s//\1/
+           q
+         }
+         /^X\(\/\/\)$/{
+           s//\1/
+           q
+         }
+         /^X\(\/\).*/{
+           s//\1/
+           q
+         }
+         s/.*/./; q'`
+    prefix=`$as_dirname -- "$prefix" ||
+$as_expr X"$prefix" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+        X"$prefix" : 'X\(//\)[^/]' \| \
+        X"$prefix" : 'X\(//\)$' \| \
+        X"$prefix" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X"$prefix" |
+    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+           s//\1/
+           q
+         }
+         /^X\(\/\/\)[^/].*/{
+           s//\1/
+           q
+         }
+         /^X\(\/\/\)$/{
+           s//\1/
+           q
+         }
+         /^X\(\/\).*/{
+           s//\1/
+           q
+         }
+         s/.*/./; q'`
+  fi
+fi
+
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+if test -n "$ac_tool_prefix"; then
+  # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args.
+set dummy ${ac_tool_prefix}gcc; ac_word=$2
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_CC+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$CC"; then
+  ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_CC="${ac_tool_prefix}gcc"
+    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+IFS=$as_save_IFS
+
+fi
+fi
+CC=$ac_cv_prog_CC
+if test -n "$CC"; then
+  { $as_echo "$as_me:$LINENO: result: $CC" >&5
+$as_echo "$CC" >&6; }
+else
+  { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_prog_CC"; then
+  ac_ct_CC=$CC
+  # Extract the first word of "gcc", so it can be a program name with args.
+set dummy gcc; ac_word=$2
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_ac_ct_CC+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$ac_ct_CC"; then
+  ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_ac_ct_CC="gcc"
+    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_CC=$ac_cv_prog_ac_ct_CC
+if test -n "$ac_ct_CC"; then
+  { $as_echo "$as_me:$LINENO: result: $ac_ct_CC" >&5
+$as_echo "$ac_ct_CC" >&6; }
+else
+  { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+  if test "x$ac_ct_CC" = x; then
+    CC=""
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:$LINENO: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+    CC=$ac_ct_CC
+  fi
+else
+  CC="$ac_cv_prog_CC"
+fi
+
+if test -z "$CC"; then
+          if test -n "$ac_tool_prefix"; then
+    # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args.
+set dummy ${ac_tool_prefix}cc; ac_word=$2
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_CC+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$CC"; then
+  ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_CC="${ac_tool_prefix}cc"
+    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+IFS=$as_save_IFS
+
+fi
+fi
+CC=$ac_cv_prog_CC
+if test -n "$CC"; then
+  { $as_echo "$as_me:$LINENO: result: $CC" >&5
+$as_echo "$CC" >&6; }
+else
+  { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+  fi
+fi
+if test -z "$CC"; then
+  # Extract the first word of "cc", so it can be a program name with args.
+set dummy cc; ac_word=$2
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_CC+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$CC"; then
+  ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+  ac_prog_rejected=no
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then
+       ac_prog_rejected=yes
+       continue
+     fi
+    ac_cv_prog_CC="cc"
+    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+IFS=$as_save_IFS
+
+if test $ac_prog_rejected = yes; then
+  # We found a bogon in the path, so make sure we never use it.
+  set dummy $ac_cv_prog_CC
+  shift
+  if test $# != 0; then
+    # We chose a different compiler from the bogus one.
+    # However, it has the same basename, so the bogon will be chosen
+    # first if we set CC to just the basename; use the full file name.
+    shift
+    ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@"
+  fi
+fi
+fi
+fi
+CC=$ac_cv_prog_CC
+if test -n "$CC"; then
+  { $as_echo "$as_me:$LINENO: result: $CC" >&5
+$as_echo "$CC" >&6; }
+else
+  { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$CC"; then
+  if test -n "$ac_tool_prefix"; then
+  for ac_prog in cl.exe
+  do
+    # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
+set dummy $ac_tool_prefix$ac_prog; ac_word=$2
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_CC+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$CC"; then
+  ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_CC="$ac_tool_prefix$ac_prog"
+    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+IFS=$as_save_IFS
+
+fi
+fi
+CC=$ac_cv_prog_CC
+if test -n "$CC"; then
+  { $as_echo "$as_me:$LINENO: result: $CC" >&5
+$as_echo "$CC" >&6; }
+else
+  { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+    test -n "$CC" && break
+  done
+fi
+if test -z "$CC"; then
+  ac_ct_CC=$CC
+  for ac_prog in cl.exe
+do
+  # Extract the first word of "$ac_prog", so it can be a program name with args.
+set dummy $ac_prog; ac_word=$2
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_ac_ct_CC+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$ac_ct_CC"; then
+  ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_ac_ct_CC="$ac_prog"
+    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_CC=$ac_cv_prog_ac_ct_CC
+if test -n "$ac_ct_CC"; then
+  { $as_echo "$as_me:$LINENO: result: $ac_ct_CC" >&5
+$as_echo "$ac_ct_CC" >&6; }
+else
+  { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+  test -n "$ac_ct_CC" && break
+done
+
+  if test "x$ac_ct_CC" = x; then
+    CC=""
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:$LINENO: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+    CC=$ac_ct_CC
+  fi
+fi
+
+fi
+
+
+test -z "$CC" && { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+{ { $as_echo "$as_me:$LINENO: error: no acceptable C compiler found in \$PATH
+See \`config.log' for more details." >&5
+$as_echo "$as_me: error: no acceptable C compiler found in \$PATH
+See \`config.log' for more details." >&2;}
+   { (exit 1); exit 1; }; }; }
+
+# Provide some information about the compiler.
+$as_echo "$as_me:$LINENO: checking for C compiler version" >&5
+set X $ac_compile
+ac_compiler=$2
+{ (ac_try="$ac_compiler --version >&5"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_compiler --version >&5") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }
+{ (ac_try="$ac_compiler -v >&5"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_compiler -v >&5") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }
+{ (ac_try="$ac_compiler -V >&5"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_compiler -V >&5") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }
+
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+ac_clean_files_save=$ac_clean_files
+ac_clean_files="$ac_clean_files a.out a.out.dSYM a.exe b.out"
+# Try to create an executable without -o first, disregard a.out.
+# It will help us diagnose broken compilers, and finding out an intuition
+# of exeext.
+{ $as_echo "$as_me:$LINENO: checking for C compiler default output file name" >&5
+$as_echo_n "checking for C compiler default output file name... " >&6; }
+ac_link_default=`$as_echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'`
+
+# The possible output files:
+ac_files="a.out conftest.exe conftest a.exe a_out.exe b.out conftest.*"
+
+ac_rmfiles=
+for ac_file in $ac_files
+do
+  case $ac_file in
+    *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;;
+    * ) ac_rmfiles="$ac_rmfiles $ac_file";;
+  esac
+done
+rm -f $ac_rmfiles
+
+if { (ac_try="$ac_link_default"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_link_default") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; then
+  # Autoconf-2.13 could set the ac_cv_exeext variable to `no'.
+# So ignore a value of `no', otherwise this would lead to `EXEEXT = no'
+# in a Makefile.  We should not override ac_cv_exeext if it was cached,
+# so that the user can short-circuit this test for compilers unknown to
+# Autoconf.
+for ac_file in $ac_files ''
+do
+  test -f "$ac_file" || continue
+  case $ac_file in
+    *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj )
+       ;;
+    [ab].out )
+       # We found the default executable, but exeext='' is most
+       # certainly right.
+       break;;
+    *.* )
+        if test "${ac_cv_exeext+set}" = set && test "$ac_cv_exeext" != no;
+       then :; else
+          ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
+       fi
+       # We set ac_cv_exeext here because the later test for it is not
+       # safe: cross compilers may not add the suffix if given an `-o'
+       # argument, so we may need to know it at that point already.
+       # Even if this section looks crufty: it has the advantage of
+       # actually working.
+       break;;
+    * )
+       break;;
+  esac
+done
+test "$ac_cv_exeext" = no && ac_cv_exeext=
+
+else
+  ac_file=''
+fi
+
+{ $as_echo "$as_me:$LINENO: result: $ac_file" >&5
+$as_echo "$ac_file" >&6; }
+if test -z "$ac_file"; then
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+{ { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+{ { $as_echo "$as_me:$LINENO: error: C compiler cannot create executables
+See \`config.log' for more details." >&5
+$as_echo "$as_me: error: C compiler cannot create executables
+See \`config.log' for more details." >&2;}
+   { (exit 77); exit 77; }; }; }
+fi
+
+ac_exeext=$ac_cv_exeext
+
+# Check that the compiler produces executables we can run.  If not, either
+# the compiler is broken, or we cross compile.
+{ $as_echo "$as_me:$LINENO: checking whether the C compiler works" >&5
+$as_echo_n "checking whether the C compiler works... " >&6; }
+# FIXME: These cross compiler hacks should be removed for Autoconf 3.0
+# If not cross compiling, check that we can run a simple program.
+if test "$cross_compiling" != yes; then
+  if { ac_try='./$ac_file'
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_try") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+    cross_compiling=no
+  else
+    if test "$cross_compiling" = maybe; then
+       cross_compiling=yes
+    else
+       { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+{ { $as_echo "$as_me:$LINENO: error: cannot run C compiled programs.
+If you meant to cross compile, use \`--host'.
+See \`config.log' for more details." >&5
+$as_echo "$as_me: error: cannot run C compiled programs.
+If you meant to cross compile, use \`--host'.
+See \`config.log' for more details." >&2;}
+   { (exit 1); exit 1; }; }; }
+    fi
+  fi
+fi
+{ $as_echo "$as_me:$LINENO: result: yes" >&5
+$as_echo "yes" >&6; }
+
+rm -f -r a.out a.out.dSYM a.exe conftest$ac_cv_exeext b.out
+ac_clean_files=$ac_clean_files_save
+# Check that the compiler produces executables we can run.  If not, either
+# the compiler is broken, or we cross compile.
+{ $as_echo "$as_me:$LINENO: checking whether we are cross compiling" >&5
+$as_echo_n "checking whether we are cross compiling... " >&6; }
+{ $as_echo "$as_me:$LINENO: result: $cross_compiling" >&5
+$as_echo "$cross_compiling" >&6; }
+
+{ $as_echo "$as_me:$LINENO: checking for suffix of executables" >&5
+$as_echo_n "checking for suffix of executables... " >&6; }
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_link") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; then
+  # If both `conftest.exe' and `conftest' are `present' (well, observable)
+# catch `conftest.exe'.  For instance with Cygwin, `ls conftest' will
+# work properly (i.e., refer to `conftest.exe'), while it won't with
+# `rm'.
+for ac_file in conftest.exe conftest conftest.*; do
+  test -f "$ac_file" || continue
+  case $ac_file in
+    *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;;
+    *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
+         break;;
+    * ) break;;
+  esac
+done
+else
+  { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+{ { $as_echo "$as_me:$LINENO: error: cannot compute suffix of executables: cannot compile and link
+See \`config.log' for more details." >&5
+$as_echo "$as_me: error: cannot compute suffix of executables: cannot compile and link
+See \`config.log' for more details." >&2;}
+   { (exit 1); exit 1; }; }; }
+fi
+
+rm -f conftest$ac_cv_exeext
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_exeext" >&5
+$as_echo "$ac_cv_exeext" >&6; }
+
+rm -f conftest.$ac_ext
+EXEEXT=$ac_cv_exeext
+ac_exeext=$EXEEXT
+{ $as_echo "$as_me:$LINENO: checking for suffix of object files" >&5
+$as_echo_n "checking for suffix of object files... " >&6; }
+if test "${ac_cv_objext+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.o conftest.obj
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_compile") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; then
+  for ac_file in conftest.o conftest.obj conftest.*; do
+  test -f "$ac_file" || continue;
+  case $ac_file in
+    *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM ) ;;
+    *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'`
+       break;;
+  esac
+done
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+{ { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+{ { $as_echo "$as_me:$LINENO: error: cannot compute suffix of object files: cannot compile
+See \`config.log' for more details." >&5
+$as_echo "$as_me: error: cannot compute suffix of object files: cannot compile
+See \`config.log' for more details." >&2;}
+   { (exit 1); exit 1; }; }; }
+fi
+
+rm -f conftest.$ac_cv_objext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_objext" >&5
+$as_echo "$ac_cv_objext" >&6; }
+OBJEXT=$ac_cv_objext
+ac_objext=$OBJEXT
+{ $as_echo "$as_me:$LINENO: checking whether we are using the GNU C compiler" >&5
+$as_echo_n "checking whether we are using the GNU C compiler... " >&6; }
+if test "${ac_cv_c_compiler_gnu+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+int
+main ()
+{
+#ifndef __GNUC__
+       choke me
+#endif
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  ac_compiler_gnu=yes
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+       ac_compiler_gnu=no
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ac_cv_c_compiler_gnu=$ac_compiler_gnu
+
+fi
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_c_compiler_gnu" >&5
+$as_echo "$ac_cv_c_compiler_gnu" >&6; }
+if test $ac_compiler_gnu = yes; then
+  GCC=yes
+else
+  GCC=
+fi
+ac_test_CFLAGS=${CFLAGS+set}
+ac_save_CFLAGS=$CFLAGS
+{ $as_echo "$as_me:$LINENO: checking whether $CC accepts -g" >&5
+$as_echo_n "checking whether $CC accepts -g... " >&6; }
+if test "${ac_cv_prog_cc_g+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  ac_save_c_werror_flag=$ac_c_werror_flag
+   ac_c_werror_flag=yes
+   ac_cv_prog_cc_g=no
+   CFLAGS="-g"
+   cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  ac_cv_prog_cc_g=yes
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+       CFLAGS=""
+      cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  :
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+       ac_c_werror_flag=$ac_save_c_werror_flag
+        CFLAGS="-g"
+        cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  ac_cv_prog_cc_g=yes
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+   ac_c_werror_flag=$ac_save_c_werror_flag
+fi
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_prog_cc_g" >&5
+$as_echo "$ac_cv_prog_cc_g" >&6; }
+if test "$ac_test_CFLAGS" = set; then
+  CFLAGS=$ac_save_CFLAGS
+elif test $ac_cv_prog_cc_g = yes; then
+  if test "$GCC" = yes; then
+    CFLAGS="-g -O2"
+  else
+    CFLAGS="-g"
+  fi
+else
+  if test "$GCC" = yes; then
+    CFLAGS="-O2"
+  else
+    CFLAGS=
+  fi
+fi
+{ $as_echo "$as_me:$LINENO: checking for $CC option to accept ISO C89" >&5
+$as_echo_n "checking for $CC option to accept ISO C89... " >&6; }
+if test "${ac_cv_prog_cc_c89+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  ac_cv_prog_cc_c89=no
+ac_save_CC=$CC
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <stdarg.h>
+#include <stdio.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+/* Most of the following tests are stolen from RCS 5.7's src/conf.sh.  */
+struct buf { int x; };
+FILE * (*rcsopen) (struct buf *, struct stat *, int);
+static char *e (p, i)
+     char **p;
+     int i;
+{
+  return p[i];
+}
+static char *f (char * (*g) (char **, int), char **p, ...)
+{
+  char *s;
+  va_list v;
+  va_start (v,p);
+  s = g (p, va_arg (v,int));
+  va_end (v);
+  return s;
+}
+
+/* OSF 4.0 Compaq cc is some sort of almost-ANSI by default.  It has
+   function prototypes and stuff, but not '\xHH' hex character constants.
+   These don't provoke an error unfortunately, instead are silently treated
+   as 'x'.  The following induces an error, until -std is added to get
+   proper ANSI mode.  Curiously '\x00'!='x' always comes out true, for an
+   array size at least.  It's necessary to write '\x00'==0 to get something
+   that's true only with -std.  */
+int osf4_cc_array ['\x00' == 0 ? 1 : -1];
+
+/* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters
+   inside strings and character constants.  */
+#define FOO(x) 'x'
+int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1];
+
+int test (int i, double x);
+struct s1 {int (*f) (int a);};
+struct s2 {int (*f) (double a);};
+int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int);
+int argc;
+char **argv;
+int
+main ()
+{
+return f (e, argv, 0) != argv[0]  ||  f (e, argv, 1) != argv[1];
+  ;
+  return 0;
+}
+_ACEOF
+for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \
+       -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"
+do
+  CC="$ac_save_CC $ac_arg"
+  rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  ac_cv_prog_cc_c89=$ac_arg
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+
+fi
+
+rm -f core conftest.err conftest.$ac_objext
+  test "x$ac_cv_prog_cc_c89" != "xno" && break
+done
+rm -f conftest.$ac_ext
+CC=$ac_save_CC
+
+fi
+# AC_CACHE_VAL
+case "x$ac_cv_prog_cc_c89" in
+  x)
+    { $as_echo "$as_me:$LINENO: result: none needed" >&5
+$as_echo "none needed" >&6; } ;;
+  xno)
+    { $as_echo "$as_me:$LINENO: result: unsupported" >&5
+$as_echo "unsupported" >&6; } ;;
+  *)
+    CC="$CC $ac_cv_prog_cc_c89"
+    { $as_echo "$as_me:$LINENO: result: $ac_cv_prog_cc_c89" >&5
+$as_echo "$ac_cv_prog_cc_c89" >&6; } ;;
+esac
+
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+{ $as_echo "$as_me:$LINENO: checking how to run the C preprocessor" >&5
+$as_echo_n "checking how to run the C preprocessor... " >&6; }
+# On Suns, sometimes $CPP names a directory.
+if test -n "$CPP" && test -d "$CPP"; then
+  CPP=
+fi
+if test -z "$CPP"; then
+  if test "${ac_cv_prog_CPP+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+      # Double quotes because CPP needs to be expanded
+    for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp"
+    do
+      ac_preproc_ok=false
+for ac_c_preproc_warn_flag in '' yes
+do
+  # Use a header file that comes with gcc, so configuring glibc
+  # with a fresh cross-compiler works.
+  # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+  # <limits.h> exists even on freestanding compilers.
+  # On the NeXT, cc -E runs the code through the compiler's parser,
+  # not just through cpp. "Syntax error" is here to catch this case.
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+                    Syntax error
+_ACEOF
+if { (ac_try="$ac_cpp conftest.$ac_ext"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } >/dev/null && {
+        test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       }; then
+  :
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+  # Broken: fails on valid input.
+continue
+fi
+
+rm -f conftest.err conftest.$ac_ext
+
+  # OK, works on sane cases.  Now check whether nonexistent headers
+  # can be detected and how.
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <ac_nonexistent.h>
+_ACEOF
+if { (ac_try="$ac_cpp conftest.$ac_ext"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } >/dev/null && {
+        test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       }; then
+  # Broken: success on invalid input.
+continue
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+  # Passes both tests.
+ac_preproc_ok=:
+break
+fi
+
+rm -f conftest.err conftest.$ac_ext
+
+done
+# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
+rm -f conftest.err conftest.$ac_ext
+if $ac_preproc_ok; then
+  break
+fi
+
+    done
+    ac_cv_prog_CPP=$CPP
+
+fi
+  CPP=$ac_cv_prog_CPP
+else
+  ac_cv_prog_CPP=$CPP
+fi
+{ $as_echo "$as_me:$LINENO: result: $CPP" >&5
+$as_echo "$CPP" >&6; }
+ac_preproc_ok=false
+for ac_c_preproc_warn_flag in '' yes
+do
+  # Use a header file that comes with gcc, so configuring glibc
+  # with a fresh cross-compiler works.
+  # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+  # <limits.h> exists even on freestanding compilers.
+  # On the NeXT, cc -E runs the code through the compiler's parser,
+  # not just through cpp. "Syntax error" is here to catch this case.
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+                    Syntax error
+_ACEOF
+if { (ac_try="$ac_cpp conftest.$ac_ext"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } >/dev/null && {
+        test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       }; then
+  :
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+  # Broken: fails on valid input.
+continue
+fi
+
+rm -f conftest.err conftest.$ac_ext
+
+  # OK, works on sane cases.  Now check whether nonexistent headers
+  # can be detected and how.
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <ac_nonexistent.h>
+_ACEOF
+if { (ac_try="$ac_cpp conftest.$ac_ext"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } >/dev/null && {
+        test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       }; then
+  # Broken: success on invalid input.
+continue
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+  # Passes both tests.
+ac_preproc_ok=:
+break
+fi
+
+rm -f conftest.err conftest.$ac_ext
+
+done
+# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
+rm -f conftest.err conftest.$ac_ext
+if $ac_preproc_ok; then
+  :
+else
+  { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+{ { $as_echo "$as_me:$LINENO: error: C preprocessor \"$CPP\" fails sanity check
+See \`config.log' for more details." >&5
+$as_echo "$as_me: error: C preprocessor \"$CPP\" fails sanity check
+See \`config.log' for more details." >&2;}
+   { (exit 1); exit 1; }; }; }
+fi
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+
+{ $as_echo "$as_me:$LINENO: checking for grep that handles long lines and -e" >&5
+$as_echo_n "checking for grep that handles long lines and -e... " >&6; }
+if test "${ac_cv_path_GREP+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  if test -z "$GREP"; then
+  ac_path_GREP_found=false
+  # Loop through the user's path and test for each of PROGNAME-LIST
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_prog in grep ggrep; do
+    for ac_exec_ext in '' $ac_executable_extensions; do
+      ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext"
+      { test -f "$ac_path_GREP" && $as_test_x "$ac_path_GREP"; } || continue
+# Check for GNU ac_path_GREP and select it if it is found.
+  # Check for GNU $ac_path_GREP
+case `"$ac_path_GREP" --version 2>&1` in
+*GNU*)
+  ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;;
+*)
+  ac_count=0
+  $as_echo_n 0123456789 >"conftest.in"
+  while :
+  do
+    cat "conftest.in" "conftest.in" >"conftest.tmp"
+    mv "conftest.tmp" "conftest.in"
+    cp "conftest.in" "conftest.nl"
+    $as_echo 'GREP' >> "conftest.nl"
+    "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break
+    diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break
+    ac_count=`expr $ac_count + 1`
+    if test $ac_count -gt ${ac_path_GREP_max-0}; then
+      # Best one so far, save it but keep looking for a better one
+      ac_cv_path_GREP="$ac_path_GREP"
+      ac_path_GREP_max=$ac_count
+    fi
+    # 10*(2^10) chars as input seems more than enough
+    test $ac_count -gt 10 && break
+  done
+  rm -f conftest.in conftest.tmp conftest.nl conftest.out;;
+esac
+
+      $ac_path_GREP_found && break 3
+    done
+  done
+done
+IFS=$as_save_IFS
+  if test -z "$ac_cv_path_GREP"; then
+    { { $as_echo "$as_me:$LINENO: error: no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&5
+$as_echo "$as_me: error: no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&2;}
+   { (exit 1); exit 1; }; }
+  fi
+else
+  ac_cv_path_GREP=$GREP
+fi
+
+fi
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_path_GREP" >&5
+$as_echo "$ac_cv_path_GREP" >&6; }
+ GREP="$ac_cv_path_GREP"
+
+
+{ $as_echo "$as_me:$LINENO: checking for egrep" >&5
+$as_echo_n "checking for egrep... " >&6; }
+if test "${ac_cv_path_EGREP+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  if echo a | $GREP -E '(a|b)' >/dev/null 2>&1
+   then ac_cv_path_EGREP="$GREP -E"
+   else
+     if test -z "$EGREP"; then
+  ac_path_EGREP_found=false
+  # Loop through the user's path and test for each of PROGNAME-LIST
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_prog in egrep; do
+    for ac_exec_ext in '' $ac_executable_extensions; do
+      ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext"
+      { test -f "$ac_path_EGREP" && $as_test_x "$ac_path_EGREP"; } || continue
+# Check for GNU ac_path_EGREP and select it if it is found.
+  # Check for GNU $ac_path_EGREP
+case `"$ac_path_EGREP" --version 2>&1` in
+*GNU*)
+  ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;;
+*)
+  ac_count=0
+  $as_echo_n 0123456789 >"conftest.in"
+  while :
+  do
+    cat "conftest.in" "conftest.in" >"conftest.tmp"
+    mv "conftest.tmp" "conftest.in"
+    cp "conftest.in" "conftest.nl"
+    $as_echo 'EGREP' >> "conftest.nl"
+    "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break
+    diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break
+    ac_count=`expr $ac_count + 1`
+    if test $ac_count -gt ${ac_path_EGREP_max-0}; then
+      # Best one so far, save it but keep looking for a better one
+      ac_cv_path_EGREP="$ac_path_EGREP"
+      ac_path_EGREP_max=$ac_count
+    fi
+    # 10*(2^10) chars as input seems more than enough
+    test $ac_count -gt 10 && break
+  done
+  rm -f conftest.in conftest.tmp conftest.nl conftest.out;;
+esac
+
+      $ac_path_EGREP_found && break 3
+    done
+  done
+done
+IFS=$as_save_IFS
+  if test -z "$ac_cv_path_EGREP"; then
+    { { $as_echo "$as_me:$LINENO: error: no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&5
+$as_echo "$as_me: error: no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&2;}
+   { (exit 1); exit 1; }; }
+  fi
+else
+  ac_cv_path_EGREP=$EGREP
+fi
+
+   fi
+fi
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_path_EGREP" >&5
+$as_echo "$ac_cv_path_EGREP" >&6; }
+ EGREP="$ac_cv_path_EGREP"
+
+
+{ $as_echo "$as_me:$LINENO: checking for ANSI C header files" >&5
+$as_echo_n "checking for ANSI C header files... " >&6; }
+if test "${ac_cv_header_stdc+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <stdlib.h>
+#include <stdarg.h>
+#include <string.h>
+#include <float.h>
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  ac_cv_header_stdc=yes
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+       ac_cv_header_stdc=no
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+
+if test $ac_cv_header_stdc = yes; then
+  # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <string.h>
+
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+  $EGREP "memchr" >/dev/null 2>&1; then
+  :
+else
+  ac_cv_header_stdc=no
+fi
+rm -f conftest*
+
+fi
+
+if test $ac_cv_header_stdc = yes; then
+  # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <stdlib.h>
+
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+  $EGREP "free" >/dev/null 2>&1; then
+  :
+else
+  ac_cv_header_stdc=no
+fi
+rm -f conftest*
+
+fi
+
+if test $ac_cv_header_stdc = yes; then
+  # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
+  if test "$cross_compiling" = yes; then
+  :
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <ctype.h>
+#include <stdlib.h>
+#if ((' ' & 0x0FF) == 0x020)
+# define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
+# define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
+#else
+# define ISLOWER(c) \
+                  (('a' <= (c) && (c) <= 'i') \
+                    || ('j' <= (c) && (c) <= 'r') \
+                    || ('s' <= (c) && (c) <= 'z'))
+# define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c))
+#endif
+
+#define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
+int
+main ()
+{
+  int i;
+  for (i = 0; i < 256; i++)
+    if (XOR (islower (i), ISLOWER (i))
+       || toupper (i) != TOUPPER (i))
+      return 2;
+  return 0;
+}
+_ACEOF
+rm -f conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_link") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_try") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  :
+else
+  $as_echo "$as_me: program exited with status $ac_status" >&5
+$as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+( exit $ac_status )
+ac_cv_header_stdc=no
+fi
+rm -rf conftest.dSYM
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
+fi
+
+
+fi
+fi
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_header_stdc" >&5
+$as_echo "$ac_cv_header_stdc" >&6; }
+if test $ac_cv_header_stdc = yes; then
+
+cat >>confdefs.h <<\_ACEOF
+#define STDC_HEADERS 1
+_ACEOF
+
+fi
+
+# On IRIX 5.3, sys/types and inttypes.h are conflicting.
+
+
+
+
+
+
+
+
+
+for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \
+                 inttypes.h stdint.h unistd.h
+do
+as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
+{ $as_echo "$as_me:$LINENO: checking for $ac_header" >&5
+$as_echo_n "checking for $ac_header... " >&6; }
+if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
+  $as_echo_n "(cached) " >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+$ac_includes_default
+
+#include <$ac_header>
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  eval "$as_ac_Header=yes"
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+       eval "$as_ac_Header=no"
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+ac_res=`eval 'as_val=${'$as_ac_Header'}
+                $as_echo "$as_val"'`
+              { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+as_val=`eval 'as_val=${'$as_ac_Header'}
+                $as_echo "$as_val"'`
+   if test "x$as_val" = x""yes; then
+  cat >>confdefs.h <<_ACEOF
+#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+
+done
+
+
+
+  if test "${ac_cv_header_minix_config_h+set}" = set; then
+  { $as_echo "$as_me:$LINENO: checking for minix/config.h" >&5
+$as_echo_n "checking for minix/config.h... " >&6; }
+if test "${ac_cv_header_minix_config_h+set}" = set; then
+  $as_echo_n "(cached) " >&6
+fi
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_header_minix_config_h" >&5
+$as_echo "$ac_cv_header_minix_config_h" >&6; }
+else
+  # Is the header compilable?
+{ $as_echo "$as_me:$LINENO: checking minix/config.h usability" >&5
+$as_echo_n "checking minix/config.h usability... " >&6; }
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+$ac_includes_default
+#include <minix/config.h>
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  ac_header_compiler=yes
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+       ac_header_compiler=no
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+{ $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
+$as_echo "$ac_header_compiler" >&6; }
+
+# Is the header present?
+{ $as_echo "$as_me:$LINENO: checking minix/config.h presence" >&5
+$as_echo_n "checking minix/config.h presence... " >&6; }
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <minix/config.h>
+_ACEOF
+if { (ac_try="$ac_cpp conftest.$ac_ext"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } >/dev/null && {
+        test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       }; then
+  ac_header_preproc=yes
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+  ac_header_preproc=no
+fi
+
+rm -f conftest.err conftest.$ac_ext
+{ $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
+$as_echo "$ac_header_preproc" >&6; }
+
+# So?  What about this header?
+case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
+  yes:no: )
+    { $as_echo "$as_me:$LINENO: WARNING: minix/config.h: accepted by the compiler, rejected by the preprocessor!" >&5
+$as_echo "$as_me: WARNING: minix/config.h: accepted by the compiler, rejected by the preprocessor!" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: minix/config.h: proceeding with the compiler's result" >&5
+$as_echo "$as_me: WARNING: minix/config.h: proceeding with the compiler's result" >&2;}
+    ac_header_preproc=yes
+    ;;
+  no:yes:* )
+    { $as_echo "$as_me:$LINENO: WARNING: minix/config.h: present but cannot be compiled" >&5
+$as_echo "$as_me: WARNING: minix/config.h: present but cannot be compiled" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: minix/config.h:     check for missing prerequisite headers?" >&5
+$as_echo "$as_me: WARNING: minix/config.h:     check for missing prerequisite headers?" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: minix/config.h: see the Autoconf documentation" >&5
+$as_echo "$as_me: WARNING: minix/config.h: see the Autoconf documentation" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: minix/config.h:     section \"Present But Cannot Be Compiled\"" >&5
+$as_echo "$as_me: WARNING: minix/config.h:     section \"Present But Cannot Be Compiled\"" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: minix/config.h: proceeding with the preprocessor's result" >&5
+$as_echo "$as_me: WARNING: minix/config.h: proceeding with the preprocessor's result" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: minix/config.h: in the future, the compiler will take precedence" >&5
+$as_echo "$as_me: WARNING: minix/config.h: in the future, the compiler will take precedence" >&2;}
+
+    ;;
+esac
+{ $as_echo "$as_me:$LINENO: checking for minix/config.h" >&5
+$as_echo_n "checking for minix/config.h... " >&6; }
+if test "${ac_cv_header_minix_config_h+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  ac_cv_header_minix_config_h=$ac_header_preproc
+fi
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_header_minix_config_h" >&5
+$as_echo "$ac_cv_header_minix_config_h" >&6; }
+
+fi
+if test "x$ac_cv_header_minix_config_h" = x""yes; then
+  MINIX=yes
+else
+  MINIX=
+fi
+
+
+  if test "$MINIX" = yes; then
+
+cat >>confdefs.h <<\_ACEOF
+#define _POSIX_SOURCE 1
+_ACEOF
+
+
+cat >>confdefs.h <<\_ACEOF
+#define _POSIX_1_SOURCE 2
+_ACEOF
+
+
+cat >>confdefs.h <<\_ACEOF
+#define _MINIX 1
+_ACEOF
+
+  fi
+
+
+
+  { $as_echo "$as_me:$LINENO: checking whether it is safe to define __EXTENSIONS__" >&5
+$as_echo_n "checking whether it is safe to define __EXTENSIONS__... " >&6; }
+if test "${ac_cv_safe_to_define___extensions__+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+#        define __EXTENSIONS__ 1
+         $ac_includes_default
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  ac_cv_safe_to_define___extensions__=yes
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+       ac_cv_safe_to_define___extensions__=no
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_safe_to_define___extensions__" >&5
+$as_echo "$ac_cv_safe_to_define___extensions__" >&6; }
+  test $ac_cv_safe_to_define___extensions__ = yes &&
+    cat >>confdefs.h <<\_ACEOF
+#define __EXTENSIONS__ 1
+_ACEOF
+
+  cat >>confdefs.h <<\_ACEOF
+#define _ALL_SOURCE 1
+_ACEOF
+
+  cat >>confdefs.h <<\_ACEOF
+#define _GNU_SOURCE 1
+_ACEOF
+
+  cat >>confdefs.h <<\_ACEOF
+#define _POSIX_PTHREAD_SEMANTICS 1
+_ACEOF
+
+  cat >>confdefs.h <<\_ACEOF
+#define _TANDEM_SOURCE 1
+_ACEOF
+
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+if test -n "$ac_tool_prefix"; then
+  # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args.
+set dummy ${ac_tool_prefix}gcc; ac_word=$2
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_CC+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$CC"; then
+  ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_CC="${ac_tool_prefix}gcc"
+    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+IFS=$as_save_IFS
+
+fi
+fi
+CC=$ac_cv_prog_CC
+if test -n "$CC"; then
+  { $as_echo "$as_me:$LINENO: result: $CC" >&5
+$as_echo "$CC" >&6; }
+else
+  { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_prog_CC"; then
+  ac_ct_CC=$CC
+  # Extract the first word of "gcc", so it can be a program name with args.
+set dummy gcc; ac_word=$2
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_ac_ct_CC+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$ac_ct_CC"; then
+  ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_ac_ct_CC="gcc"
+    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_CC=$ac_cv_prog_ac_ct_CC
+if test -n "$ac_ct_CC"; then
+  { $as_echo "$as_me:$LINENO: result: $ac_ct_CC" >&5
+$as_echo "$ac_ct_CC" >&6; }
+else
+  { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+  if test "x$ac_ct_CC" = x; then
+    CC=""
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:$LINENO: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+    CC=$ac_ct_CC
+  fi
+else
+  CC="$ac_cv_prog_CC"
+fi
+
+if test -z "$CC"; then
+          if test -n "$ac_tool_prefix"; then
+    # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args.
+set dummy ${ac_tool_prefix}cc; ac_word=$2
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_CC+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$CC"; then
+  ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_CC="${ac_tool_prefix}cc"
+    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+IFS=$as_save_IFS
+
+fi
+fi
+CC=$ac_cv_prog_CC
+if test -n "$CC"; then
+  { $as_echo "$as_me:$LINENO: result: $CC" >&5
+$as_echo "$CC" >&6; }
+else
+  { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+  fi
+fi
+if test -z "$CC"; then
+  # Extract the first word of "cc", so it can be a program name with args.
+set dummy cc; ac_word=$2
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_CC+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$CC"; then
+  ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+  ac_prog_rejected=no
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then
+       ac_prog_rejected=yes
+       continue
+     fi
+    ac_cv_prog_CC="cc"
+    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+IFS=$as_save_IFS
+
+if test $ac_prog_rejected = yes; then
+  # We found a bogon in the path, so make sure we never use it.
+  set dummy $ac_cv_prog_CC
+  shift
+  if test $# != 0; then
+    # We chose a different compiler from the bogus one.
+    # However, it has the same basename, so the bogon will be chosen
+    # first if we set CC to just the basename; use the full file name.
+    shift
+    ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@"
+  fi
+fi
+fi
+fi
+CC=$ac_cv_prog_CC
+if test -n "$CC"; then
+  { $as_echo "$as_me:$LINENO: result: $CC" >&5
+$as_echo "$CC" >&6; }
+else
+  { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$CC"; then
+  if test -n "$ac_tool_prefix"; then
+  for ac_prog in cl.exe
+  do
+    # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
+set dummy $ac_tool_prefix$ac_prog; ac_word=$2
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_CC+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$CC"; then
+  ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_CC="$ac_tool_prefix$ac_prog"
+    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+IFS=$as_save_IFS
+
+fi
+fi
+CC=$ac_cv_prog_CC
+if test -n "$CC"; then
+  { $as_echo "$as_me:$LINENO: result: $CC" >&5
+$as_echo "$CC" >&6; }
+else
+  { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+    test -n "$CC" && break
+  done
+fi
+if test -z "$CC"; then
+  ac_ct_CC=$CC
+  for ac_prog in cl.exe
+do
+  # Extract the first word of "$ac_prog", so it can be a program name with args.
+set dummy $ac_prog; ac_word=$2
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_ac_ct_CC+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$ac_ct_CC"; then
+  ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_ac_ct_CC="$ac_prog"
+    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_CC=$ac_cv_prog_ac_ct_CC
+if test -n "$ac_ct_CC"; then
+  { $as_echo "$as_me:$LINENO: result: $ac_ct_CC" >&5
+$as_echo "$ac_ct_CC" >&6; }
+else
+  { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+  test -n "$ac_ct_CC" && break
+done
+
+  if test "x$ac_ct_CC" = x; then
+    CC=""
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:$LINENO: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+    CC=$ac_ct_CC
+  fi
+fi
+
+fi
+
+
+test -z "$CC" && { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+{ { $as_echo "$as_me:$LINENO: error: no acceptable C compiler found in \$PATH
+See \`config.log' for more details." >&5
+$as_echo "$as_me: error: no acceptable C compiler found in \$PATH
+See \`config.log' for more details." >&2;}
+   { (exit 1); exit 1; }; }; }
+
+# Provide some information about the compiler.
+$as_echo "$as_me:$LINENO: checking for C compiler version" >&5
+set X $ac_compile
+ac_compiler=$2
+{ (ac_try="$ac_compiler --version >&5"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_compiler --version >&5") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }
+{ (ac_try="$ac_compiler -v >&5"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_compiler -v >&5") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }
+{ (ac_try="$ac_compiler -V >&5"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_compiler -V >&5") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }
+
+{ $as_echo "$as_me:$LINENO: checking whether we are using the GNU C compiler" >&5
+$as_echo_n "checking whether we are using the GNU C compiler... " >&6; }
+if test "${ac_cv_c_compiler_gnu+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+int
+main ()
+{
+#ifndef __GNUC__
+       choke me
+#endif
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  ac_compiler_gnu=yes
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+       ac_compiler_gnu=no
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ac_cv_c_compiler_gnu=$ac_compiler_gnu
+
+fi
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_c_compiler_gnu" >&5
+$as_echo "$ac_cv_c_compiler_gnu" >&6; }
+if test $ac_compiler_gnu = yes; then
+  GCC=yes
+else
+  GCC=
+fi
+ac_test_CFLAGS=${CFLAGS+set}
+ac_save_CFLAGS=$CFLAGS
+{ $as_echo "$as_me:$LINENO: checking whether $CC accepts -g" >&5
+$as_echo_n "checking whether $CC accepts -g... " >&6; }
+if test "${ac_cv_prog_cc_g+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  ac_save_c_werror_flag=$ac_c_werror_flag
+   ac_c_werror_flag=yes
+   ac_cv_prog_cc_g=no
+   CFLAGS="-g"
+   cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  ac_cv_prog_cc_g=yes
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+       CFLAGS=""
+      cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  :
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+       ac_c_werror_flag=$ac_save_c_werror_flag
+        CFLAGS="-g"
+        cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  ac_cv_prog_cc_g=yes
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+   ac_c_werror_flag=$ac_save_c_werror_flag
+fi
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_prog_cc_g" >&5
+$as_echo "$ac_cv_prog_cc_g" >&6; }
+if test "$ac_test_CFLAGS" = set; then
+  CFLAGS=$ac_save_CFLAGS
+elif test $ac_cv_prog_cc_g = yes; then
+  if test "$GCC" = yes; then
+    CFLAGS="-g -O2"
+  else
+    CFLAGS="-g"
+  fi
+else
+  if test "$GCC" = yes; then
+    CFLAGS="-O2"
+  else
+    CFLAGS=
+  fi
+fi
+{ $as_echo "$as_me:$LINENO: checking for $CC option to accept ISO C89" >&5
+$as_echo_n "checking for $CC option to accept ISO C89... " >&6; }
+if test "${ac_cv_prog_cc_c89+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  ac_cv_prog_cc_c89=no
+ac_save_CC=$CC
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <stdarg.h>
+#include <stdio.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+/* Most of the following tests are stolen from RCS 5.7's src/conf.sh.  */
+struct buf { int x; };
+FILE * (*rcsopen) (struct buf *, struct stat *, int);
+static char *e (p, i)
+     char **p;
+     int i;
+{
+  return p[i];
+}
+static char *f (char * (*g) (char **, int), char **p, ...)
+{
+  char *s;
+  va_list v;
+  va_start (v,p);
+  s = g (p, va_arg (v,int));
+  va_end (v);
+  return s;
+}
+
+/* OSF 4.0 Compaq cc is some sort of almost-ANSI by default.  It has
+   function prototypes and stuff, but not '\xHH' hex character constants.
+   These don't provoke an error unfortunately, instead are silently treated
+   as 'x'.  The following induces an error, until -std is added to get
+   proper ANSI mode.  Curiously '\x00'!='x' always comes out true, for an
+   array size at least.  It's necessary to write '\x00'==0 to get something
+   that's true only with -std.  */
+int osf4_cc_array ['\x00' == 0 ? 1 : -1];
+
+/* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters
+   inside strings and character constants.  */
+#define FOO(x) 'x'
+int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1];
+
+int test (int i, double x);
+struct s1 {int (*f) (int a);};
+struct s2 {int (*f) (double a);};
+int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int);
+int argc;
+char **argv;
+int
+main ()
+{
+return f (e, argv, 0) != argv[0]  ||  f (e, argv, 1) != argv[1];
+  ;
+  return 0;
+}
+_ACEOF
+for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \
+       -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"
+do
+  CC="$ac_save_CC $ac_arg"
+  rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  ac_cv_prog_cc_c89=$ac_arg
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+
+fi
+
+rm -f core conftest.err conftest.$ac_objext
+  test "x$ac_cv_prog_cc_c89" != "xno" && break
+done
+rm -f conftest.$ac_ext
+CC=$ac_save_CC
+
+fi
+# AC_CACHE_VAL
+case "x$ac_cv_prog_cc_c89" in
+  x)
+    { $as_echo "$as_me:$LINENO: result: none needed" >&5
+$as_echo "none needed" >&6; } ;;
+  xno)
+    { $as_echo "$as_me:$LINENO: result: unsupported" >&5
+$as_echo "unsupported" >&6; } ;;
+  *)
+    CC="$CC $ac_cv_prog_cc_c89"
+    { $as_echo "$as_me:$LINENO: result: $ac_cv_prog_cc_c89" >&5
+$as_echo "$ac_cv_prog_cc_c89" >&6; } ;;
+esac
+
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+{ $as_echo "$as_me:$LINENO: checking whether ln -s works" >&5
+$as_echo_n "checking whether ln -s works... " >&6; }
+LN_S=$as_ln_s
+if test "$LN_S" = "ln -s"; then
+  { $as_echo "$as_me:$LINENO: result: yes" >&5
+$as_echo "yes" >&6; }
+else
+  { $as_echo "$as_me:$LINENO: result: no, using $LN_S" >&5
+$as_echo "no, using $LN_S" >&6; }
+fi
+
+{ $as_echo "$as_me:$LINENO: checking whether ${MAKE-make} sets \$(MAKE)" >&5
+$as_echo_n "checking whether ${MAKE-make} sets \$(MAKE)... " >&6; }
+set x ${MAKE-make}
+ac_make=`$as_echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'`
+if { as_var=ac_cv_prog_make_${ac_make}_set; eval "test \"\${$as_var+set}\" = set"; }; then
+  $as_echo_n "(cached) " >&6
+else
+  cat >conftest.make <<\_ACEOF
+SHELL = /bin/sh
+all:
+       @echo '@@@%%%=$(MAKE)=@@@%%%'
+_ACEOF
+# GNU make sometimes prints "make[1]: Entering...", which would confuse us.
+case `${MAKE-make} -f conftest.make 2>/dev/null` in
+  *@@@%%%=?*=@@@%%%*)
+    eval ac_cv_prog_make_${ac_make}_set=yes;;
+  *)
+    eval ac_cv_prog_make_${ac_make}_set=no;;
+esac
+rm -f conftest.make
+fi
+if eval test \$ac_cv_prog_make_${ac_make}_set = yes; then
+  { $as_echo "$as_me:$LINENO: result: yes" >&5
+$as_echo "yes" >&6; }
+  SET_MAKE=
+else
+  { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
+  SET_MAKE="MAKE=${MAKE-make}"
+fi
+
+if test -f nasm.c; then
+  # we're building in the source dir, so we don't need this check at all
+  ac_cv_prog_make_vpathok=yes
+else
+  { $as_echo "$as_me:$LINENO: checking whether ${MAKE-make} has sane VPATH handling" >&5
+$as_echo_n "checking whether ${MAKE-make} has sane VPATH handling... " >&6; }
+set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y%./+-%__p_%'`
+if test "${ac_cv_prog_make_vpathok+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  mkdir conftestdir
+cat > conftestdir/conftestmake <<\EOF
+VPATH = ..
+conftestfoo: conftestbar
+       @echo ac_make2temp=ok
+conftestbar: conftestbaz
+       @echo ac_maketemp=broken
+       @touch conftestbar
+EOF
+echo > conftestbaz # these two lines need to be...
+echo > conftestbar # ... in this order not the other
+unset ac_maketemp
+unset ac_make2temp
+# GNU make sometimes prints "make[1]: Entering...", which would confuse us.
+eval `cd conftestdir; ${MAKE-make} -f conftestmake 2>/dev/null | grep temp=`
+if test -n "$ac_maketemp"; then
+  ac_cv_prog_make_vpathok=no
+else
+  if test -n "$ac_make2temp"; then
+    ac_cv_prog_make_vpathok=yes
+  else
+    ac_cv_prog_make_vpathok=no
+  fi
+fi
+rm -rf conftestdir
+rm -f conftestbar conftestbaz
+fi
+if test $ac_cv_prog_make_vpathok = yes; then
+  { $as_echo "$as_me:$LINENO: result: yes" >&5
+$as_echo "yes" >&6; }
+else
+  { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+fi
+ac_aux_dir=
+for ac_dir in "$srcdir" "$srcdir/.." "$srcdir/../.."; do
+  if test -f "$ac_dir/install-sh"; then
+    ac_aux_dir=$ac_dir
+    ac_install_sh="$ac_aux_dir/install-sh -c"
+    break
+  elif test -f "$ac_dir/install.sh"; then
+    ac_aux_dir=$ac_dir
+    ac_install_sh="$ac_aux_dir/install.sh -c"
+    break
+  elif test -f "$ac_dir/shtool"; then
+    ac_aux_dir=$ac_dir
+    ac_install_sh="$ac_aux_dir/shtool install -c"
+    break
+  fi
+done
+if test -z "$ac_aux_dir"; then
+  { { $as_echo "$as_me:$LINENO: error: cannot find install-sh or install.sh in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" >&5
+$as_echo "$as_me: error: cannot find install-sh or install.sh in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" >&2;}
+   { (exit 1); exit 1; }; }
+fi
+
+# These three variables are undocumented and unsupported,
+# and are intended to be withdrawn in a future Autoconf release.
+# They can cause serious problems if a builder's source tree is in a directory
+# whose full name contains unusual characters.
+ac_config_guess="$SHELL $ac_aux_dir/config.guess"  # Please don't use this var.
+ac_config_sub="$SHELL $ac_aux_dir/config.sub"  # Please don't use this var.
+ac_configure="$SHELL $ac_aux_dir/configure"  # Please don't use this var.
+
+
+# Find a good install program.  We prefer a C program (faster),
+# so one script is as good as another.  But avoid the broken or
+# incompatible versions:
+# SysV /etc/install, /usr/sbin/install
+# SunOS /usr/etc/install
+# IRIX /sbin/install
+# AIX /bin/install
+# AmigaOS /C/install, which installs bootblocks on floppy discs
+# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag
+# AFS /usr/afsws/bin/install, which mishandles nonexistent args
+# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
+# OS/2's system install, which has a completely different semantic
+# ./install, which can be erroneously created by make from ./install.sh.
+# Reject install programs that cannot install multiple files.
+{ $as_echo "$as_me:$LINENO: checking for a BSD-compatible install" >&5
+$as_echo_n "checking for a BSD-compatible install... " >&6; }
+if test -z "$INSTALL"; then
+if test "${ac_cv_path_install+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  # Account for people who put trailing slashes in PATH elements.
+case $as_dir/ in
+  ./ | .// | /cC/* | \
+  /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \
+  ?:\\/os2\\/install\\/* | ?:\\/OS2\\/INSTALL\\/* | \
+  /usr/ucb/* ) ;;
+  *)
+    # OSF1 and SCO ODT 3.0 have their own names for install.
+    # Don't use installbsd from OSF since it installs stuff as root
+    # by default.
+    for ac_prog in ginstall scoinst install; do
+      for ac_exec_ext in '' $ac_executable_extensions; do
+       if { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$as_dir/$ac_prog$ac_exec_ext"; }; then
+         if test $ac_prog = install &&
+           grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then
+           # AIX install.  It has an incompatible calling convention.
+           :
+         elif test $ac_prog = install &&
+           grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then
+           # program-specific install script used by HP pwplus--don't use.
+           :
+         else
+           rm -rf conftest.one conftest.two conftest.dir
+           echo one > conftest.one
+           echo two > conftest.two
+           mkdir conftest.dir
+           if "$as_dir/$ac_prog$ac_exec_ext" -c conftest.one conftest.two "`pwd`/conftest.dir" &&
+             test -s conftest.one && test -s conftest.two &&
+             test -s conftest.dir/conftest.one &&
+             test -s conftest.dir/conftest.two
+           then
+             ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c"
+             break 3
+           fi
+         fi
+       fi
+      done
+    done
+    ;;
+esac
+
+done
+IFS=$as_save_IFS
+
+rm -rf conftest.one conftest.two conftest.dir
+
+fi
+  if test "${ac_cv_path_install+set}" = set; then
+    INSTALL=$ac_cv_path_install
+  else
+    # As a last resort, use the slow shell script.  Don't cache a
+    # value for INSTALL within a source directory, because that will
+    # break other packages using the cache if that directory is
+    # removed, or if the value is a relative name.
+    INSTALL=$ac_install_sh
+  fi
+fi
+{ $as_echo "$as_me:$LINENO: result: $INSTALL" >&5
+$as_echo "$INSTALL" >&6; }
+
+# Use test -z because SunOS4 sh mishandles braces in ${var-val}.
+# It thinks the first close brace ends the variable substitution.
+test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}'
+
+test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}'
+
+test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
+
+
+{ $as_echo "$as_me:$LINENO: checking if $CC accepts -W" >&5
+$as_echo_n "checking if $CC accepts -W... " >&6; }
+ pa_add_cflags__old_cflags="$CFLAGS"
+ CFLAGS="$CFLAGS -W"
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <stdio.h>
+int
+main ()
+{
+printf("Hello, World!\n");
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_link") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest$ac_exeext && {
+        test "$cross_compiling" = yes ||
+        $as_test_x conftest$ac_exeext
+       }; then
+  { $as_echo "$as_me:$LINENO: result: yes" >&5
+$as_echo "yes" >&6; }
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+       { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
+ CFLAGS="$pa_add_cflags__old_cflags"
+fi
+
+rm -rf conftest.dSYM
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
+{ $as_echo "$as_me:$LINENO: checking if $CC accepts -Wall" >&5
+$as_echo_n "checking if $CC accepts -Wall... " >&6; }
+ pa_add_cflags__old_cflags="$CFLAGS"
+ CFLAGS="$CFLAGS -Wall"
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <stdio.h>
+int
+main ()
+{
+printf("Hello, World!\n");
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_link") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest$ac_exeext && {
+        test "$cross_compiling" = yes ||
+        $as_test_x conftest$ac_exeext
+       }; then
+  { $as_echo "$as_me:$LINENO: result: yes" >&5
+$as_echo "yes" >&6; }
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+       { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
+ CFLAGS="$pa_add_cflags__old_cflags"
+fi
+
+rm -rf conftest.dSYM
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
+{ $as_echo "$as_me:$LINENO: checking if $CC accepts -std=c99" >&5
+$as_echo_n "checking if $CC accepts -std=c99... " >&6; }
+ pa_add_cflags__old_cflags="$CFLAGS"
+ CFLAGS="$CFLAGS -std=c99"
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <stdio.h>
+int
+main ()
+{
+printf("Hello, World!\n");
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_link") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest$ac_exeext && {
+        test "$cross_compiling" = yes ||
+        $as_test_x conftest$ac_exeext
+       }; then
+  { $as_echo "$as_me:$LINENO: result: yes" >&5
+$as_echo "yes" >&6; }
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+       { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
+ CFLAGS="$pa_add_cflags__old_cflags"
+fi
+
+rm -rf conftest.dSYM
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
+{ $as_echo "$as_me:$LINENO: checking if $CC accepts -pedantic" >&5
+$as_echo_n "checking if $CC accepts -pedantic... " >&6; }
+ pa_add_cflags__old_cflags="$CFLAGS"
+ CFLAGS="$CFLAGS -pedantic"
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <stdio.h>
+int
+main ()
+{
+printf("Hello, World!\n");
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_link") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest$ac_exeext && {
+        test "$cross_compiling" = yes ||
+        $as_test_x conftest$ac_exeext
+       }; then
+  { $as_echo "$as_me:$LINENO: result: yes" >&5
+$as_echo "yes" >&6; }
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+       { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
+ CFLAGS="$pa_add_cflags__old_cflags"
+fi
+
+rm -rf conftest.dSYM
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
+
+for ac_prog in nroff
+do
+  # Extract the first word of "$ac_prog", so it can be a program name with args.
+set dummy $ac_prog; ac_word=$2
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_NROFF+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$NROFF"; then
+  ac_cv_prog_NROFF="$NROFF" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_NROFF="$ac_prog"
+    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+IFS=$as_save_IFS
+
+fi
+fi
+NROFF=$ac_cv_prog_NROFF
+if test -n "$NROFF"; then
+  { $as_echo "$as_me:$LINENO: result: $NROFF" >&5
+$as_echo "$NROFF" >&6; }
+else
+  { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+  test -n "$NROFF" && break
+done
+test -n "$NROFF" || NROFF="echo"
+
+for ac_prog in acrodist
+do
+  # Extract the first word of "$ac_prog", so it can be a program name with args.
+set dummy $ac_prog; ac_word=$2
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_ACRODIST+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$ACRODIST"; then
+  ac_cv_prog_ACRODIST="$ACRODIST" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_ACRODIST="$ac_prog"
+    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+IFS=$as_save_IFS
+
+fi
+fi
+ACRODIST=$ac_cv_prog_ACRODIST
+if test -n "$ACRODIST"; then
+  { $as_echo "$as_me:$LINENO: result: $ACRODIST" >&5
+$as_echo "$ACRODIST" >&6; }
+else
+  { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+  test -n "$ACRODIST" && break
+done
+test -n "$ACRODIST" || ACRODIST="false"
+
+for ac_prog in ps2pdf
+do
+  # Extract the first word of "$ac_prog", so it can be a program name with args.
+set dummy $ac_prog; ac_word=$2
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_PS2PDF+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$PS2PDF"; then
+  ac_cv_prog_PS2PDF="$PS2PDF" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_PS2PDF="$ac_prog"
+    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+IFS=$as_save_IFS
+
+fi
+fi
+PS2PDF=$ac_cv_prog_PS2PDF
+if test -n "$PS2PDF"; then
+  { $as_echo "$as_me:$LINENO: result: $PS2PDF" >&5
+$as_echo "$PS2PDF" >&6; }
+else
+  { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+  test -n "$PS2PDF" && break
+done
+test -n "$PS2PDF" || PS2PDF="false"
+
+for ac_prog in pstopdf
+do
+  # Extract the first word of "$ac_prog", so it can be a program name with args.
+set dummy $ac_prog; ac_word=$2
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_PSTOPDF+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$PSTOPDF"; then
+  ac_cv_prog_PSTOPDF="$PSTOPDF" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_PSTOPDF="$ac_prog"
+    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+IFS=$as_save_IFS
+
+fi
+fi
+PSTOPDF=$ac_cv_prog_PSTOPDF
+if test -n "$PSTOPDF"; then
+  { $as_echo "$as_me:$LINENO: result: $PSTOPDF" >&5
+$as_echo "$PSTOPDF" >&6; }
+else
+  { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+  test -n "$PSTOPDF" && break
+done
+test -n "$PSTOPDF" || PSTOPDF="false"
+
+
+{ $as_echo "$as_me:$LINENO: checking for ANSI C header files" >&5
+$as_echo_n "checking for ANSI C header files... " >&6; }
+if test "${ac_cv_header_stdc+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <stdlib.h>
+#include <stdarg.h>
+#include <string.h>
+#include <float.h>
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  ac_cv_header_stdc=yes
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+       ac_cv_header_stdc=no
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+
+if test $ac_cv_header_stdc = yes; then
+  # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <string.h>
+
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+  $EGREP "memchr" >/dev/null 2>&1; then
+  :
+else
+  ac_cv_header_stdc=no
+fi
+rm -f conftest*
+
+fi
+
+if test $ac_cv_header_stdc = yes; then
+  # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <stdlib.h>
+
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+  $EGREP "free" >/dev/null 2>&1; then
+  :
+else
+  ac_cv_header_stdc=no
+fi
+rm -f conftest*
+
+fi
+
+if test $ac_cv_header_stdc = yes; then
+  # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
+  if test "$cross_compiling" = yes; then
+  :
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <ctype.h>
+#include <stdlib.h>
+#if ((' ' & 0x0FF) == 0x020)
+# define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
+# define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
+#else
+# define ISLOWER(c) \
+                  (('a' <= (c) && (c) <= 'i') \
+                    || ('j' <= (c) && (c) <= 'r') \
+                    || ('s' <= (c) && (c) <= 'z'))
+# define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c))
+#endif
+
+#define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
+int
+main ()
+{
+  int i;
+  for (i = 0; i < 256; i++)
+    if (XOR (islower (i), ISLOWER (i))
+       || toupper (i) != TOUPPER (i))
+      return 2;
+  return 0;
+}
+_ACEOF
+rm -f conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_link") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_try") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  :
+else
+  $as_echo "$as_me: program exited with status $ac_status" >&5
+$as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+( exit $ac_status )
+ac_cv_header_stdc=no
+fi
+rm -rf conftest.dSYM
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
+fi
+
+
+fi
+fi
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_header_stdc" >&5
+$as_echo "$ac_cv_header_stdc" >&6; }
+if test $ac_cv_header_stdc = yes; then
+
+cat >>confdefs.h <<\_ACEOF
+#define STDC_HEADERS 1
+_ACEOF
+
+fi
+
+if test $ac_cv_header_stdc = no; then
+  { { $as_echo "$as_me:$LINENO: error: NASM requires ANSI C header files to compile" >&5
+$as_echo "$as_me: error: NASM requires ANSI C header files to compile" >&2;}
+   { (exit 1); exit 1; }; }
+fi
+
+
+for ac_header in limits.h
+do
+as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
+if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
+  { $as_echo "$as_me:$LINENO: checking for $ac_header" >&5
+$as_echo_n "checking for $ac_header... " >&6; }
+if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
+  $as_echo_n "(cached) " >&6
+fi
+ac_res=`eval 'as_val=${'$as_ac_Header'}
+                $as_echo "$as_val"'`
+              { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+else
+  # Is the header compilable?
+{ $as_echo "$as_me:$LINENO: checking $ac_header usability" >&5
+$as_echo_n "checking $ac_header usability... " >&6; }
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+$ac_includes_default
+#include <$ac_header>
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  ac_header_compiler=yes
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+       ac_header_compiler=no
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+{ $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
+$as_echo "$ac_header_compiler" >&6; }
+
+# Is the header present?
+{ $as_echo "$as_me:$LINENO: checking $ac_header presence" >&5
+$as_echo_n "checking $ac_header presence... " >&6; }
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <$ac_header>
+_ACEOF
+if { (ac_try="$ac_cpp conftest.$ac_ext"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } >/dev/null && {
+        test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       }; then
+  ac_header_preproc=yes
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+  ac_header_preproc=no
+fi
+
+rm -f conftest.err conftest.$ac_ext
+{ $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
+$as_echo "$ac_header_preproc" >&6; }
+
+# So?  What about this header?
+case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
+  yes:no: )
+    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
+$as_echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
+$as_echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
+    ac_header_preproc=yes
+    ;;
+  no:yes:* )
+    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
+$as_echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: $ac_header:     check for missing prerequisite headers?" >&5
+$as_echo "$as_me: WARNING: $ac_header:     check for missing prerequisite headers?" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
+$as_echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&5
+$as_echo "$as_me: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
+$as_echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
+$as_echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
+
+    ;;
+esac
+{ $as_echo "$as_me:$LINENO: checking for $ac_header" >&5
+$as_echo_n "checking for $ac_header... " >&6; }
+if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
+  $as_echo_n "(cached) " >&6
+else
+  eval "$as_ac_Header=\$ac_header_preproc"
+fi
+ac_res=`eval 'as_val=${'$as_ac_Header'}
+                $as_echo "$as_val"'`
+              { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+
+fi
+as_val=`eval 'as_val=${'$as_ac_Header'}
+                $as_echo "$as_val"'`
+   if test "x$as_val" = x""yes; then
+  cat >>confdefs.h <<_ACEOF
+#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+
+done
+
+if test $ac_cv_header_limits_h = no; then
+  { { $as_echo "$as_me:$LINENO: error: NASM requires '<limits.h>' to compile" >&5
+$as_echo "$as_me: error: NASM requires '<limits.h>' to compile" >&2;}
+   { (exit 1); exit 1; }; }
+fi
+
+
+for ac_header in inttypes.h
+do
+as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
+if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
+  { $as_echo "$as_me:$LINENO: checking for $ac_header" >&5
+$as_echo_n "checking for $ac_header... " >&6; }
+if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
+  $as_echo_n "(cached) " >&6
+fi
+ac_res=`eval 'as_val=${'$as_ac_Header'}
+                $as_echo "$as_val"'`
+              { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+else
+  # Is the header compilable?
+{ $as_echo "$as_me:$LINENO: checking $ac_header usability" >&5
+$as_echo_n "checking $ac_header usability... " >&6; }
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+$ac_includes_default
+#include <$ac_header>
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  ac_header_compiler=yes
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+       ac_header_compiler=no
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+{ $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
+$as_echo "$ac_header_compiler" >&6; }
+
+# Is the header present?
+{ $as_echo "$as_me:$LINENO: checking $ac_header presence" >&5
+$as_echo_n "checking $ac_header presence... " >&6; }
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <$ac_header>
+_ACEOF
+if { (ac_try="$ac_cpp conftest.$ac_ext"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } >/dev/null && {
+        test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       }; then
+  ac_header_preproc=yes
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+  ac_header_preproc=no
+fi
+
+rm -f conftest.err conftest.$ac_ext
+{ $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
+$as_echo "$ac_header_preproc" >&6; }
+
+# So?  What about this header?
+case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
+  yes:no: )
+    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
+$as_echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
+$as_echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
+    ac_header_preproc=yes
+    ;;
+  no:yes:* )
+    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
+$as_echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: $ac_header:     check for missing prerequisite headers?" >&5
+$as_echo "$as_me: WARNING: $ac_header:     check for missing prerequisite headers?" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
+$as_echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&5
+$as_echo "$as_me: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
+$as_echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
+$as_echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
+
+    ;;
+esac
+{ $as_echo "$as_me:$LINENO: checking for $ac_header" >&5
+$as_echo_n "checking for $ac_header... " >&6; }
+if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
+  $as_echo_n "(cached) " >&6
+else
+  eval "$as_ac_Header=\$ac_header_preproc"
+fi
+ac_res=`eval 'as_val=${'$as_ac_Header'}
+                $as_echo "$as_val"'`
+              { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+
+fi
+as_val=`eval 'as_val=${'$as_ac_Header'}
+                $as_echo "$as_val"'`
+   if test "x$as_val" = x""yes; then
+  cat >>confdefs.h <<_ACEOF
+#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
+_ACEOF
+
+else
+  CFLAGS="$CFLAGS -I\$(top_srcdir)/inttypes"
+fi
+
+done
+
+
+
+for ac_header in strings.h
+do
+as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
+if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
+  { $as_echo "$as_me:$LINENO: checking for $ac_header" >&5
+$as_echo_n "checking for $ac_header... " >&6; }
+if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
+  $as_echo_n "(cached) " >&6
+fi
+ac_res=`eval 'as_val=${'$as_ac_Header'}
+                $as_echo "$as_val"'`
+              { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+else
+  # Is the header compilable?
+{ $as_echo "$as_me:$LINENO: checking $ac_header usability" >&5
+$as_echo_n "checking $ac_header usability... " >&6; }
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+$ac_includes_default
+#include <$ac_header>
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  ac_header_compiler=yes
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+       ac_header_compiler=no
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+{ $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
+$as_echo "$ac_header_compiler" >&6; }
+
+# Is the header present?
+{ $as_echo "$as_me:$LINENO: checking $ac_header presence" >&5
+$as_echo_n "checking $ac_header presence... " >&6; }
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <$ac_header>
+_ACEOF
+if { (ac_try="$ac_cpp conftest.$ac_ext"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } >/dev/null && {
+        test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       }; then
+  ac_header_preproc=yes
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+  ac_header_preproc=no
+fi
+
+rm -f conftest.err conftest.$ac_ext
+{ $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
+$as_echo "$ac_header_preproc" >&6; }
+
+# So?  What about this header?
+case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
+  yes:no: )
+    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
+$as_echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
+$as_echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
+    ac_header_preproc=yes
+    ;;
+  no:yes:* )
+    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
+$as_echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: $ac_header:     check for missing prerequisite headers?" >&5
+$as_echo "$as_me: WARNING: $ac_header:     check for missing prerequisite headers?" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
+$as_echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&5
+$as_echo "$as_me: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
+$as_echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
+$as_echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
+
+    ;;
+esac
+{ $as_echo "$as_me:$LINENO: checking for $ac_header" >&5
+$as_echo_n "checking for $ac_header... " >&6; }
+if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
+  $as_echo_n "(cached) " >&6
+else
+  eval "$as_ac_Header=\$ac_header_preproc"
+fi
+ac_res=`eval 'as_val=${'$as_ac_Header'}
+                $as_echo "$as_val"'`
+              { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+
+fi
+as_val=`eval 'as_val=${'$as_ac_Header'}
+                $as_echo "$as_val"'`
+   if test "x$as_val" = x""yes; then
+  cat >>confdefs.h <<_ACEOF
+#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+
+done
+
+
+
+for ac_header in stdbool.h
+do
+as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
+if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
+  { $as_echo "$as_me:$LINENO: checking for $ac_header" >&5
+$as_echo_n "checking for $ac_header... " >&6; }
+if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
+  $as_echo_n "(cached) " >&6
+fi
+ac_res=`eval 'as_val=${'$as_ac_Header'}
+                $as_echo "$as_val"'`
+              { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+else
+  # Is the header compilable?
+{ $as_echo "$as_me:$LINENO: checking $ac_header usability" >&5
+$as_echo_n "checking $ac_header usability... " >&6; }
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+$ac_includes_default
+#include <$ac_header>
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  ac_header_compiler=yes
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+       ac_header_compiler=no
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+{ $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
+$as_echo "$ac_header_compiler" >&6; }
+
+# Is the header present?
+{ $as_echo "$as_me:$LINENO: checking $ac_header presence" >&5
+$as_echo_n "checking $ac_header presence... " >&6; }
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <$ac_header>
+_ACEOF
+if { (ac_try="$ac_cpp conftest.$ac_ext"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } >/dev/null && {
+        test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       }; then
+  ac_header_preproc=yes
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+  ac_header_preproc=no
+fi
+
+rm -f conftest.err conftest.$ac_ext
+{ $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
+$as_echo "$ac_header_preproc" >&6; }
+
+# So?  What about this header?
+case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
+  yes:no: )
+    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
+$as_echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
+$as_echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
+    ac_header_preproc=yes
+    ;;
+  no:yes:* )
+    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
+$as_echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: $ac_header:     check for missing prerequisite headers?" >&5
+$as_echo "$as_me: WARNING: $ac_header:     check for missing prerequisite headers?" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
+$as_echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&5
+$as_echo "$as_me: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
+$as_echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
+$as_echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
+
+    ;;
+esac
+{ $as_echo "$as_me:$LINENO: checking for $ac_header" >&5
+$as_echo_n "checking for $ac_header... " >&6; }
+if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
+  $as_echo_n "(cached) " >&6
+else
+  eval "$as_ac_Header=\$ac_header_preproc"
+fi
+ac_res=`eval 'as_val=${'$as_ac_Header'}
+                $as_echo "$as_val"'`
+              { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+
+fi
+as_val=`eval 'as_val=${'$as_ac_Header'}
+                $as_echo "$as_val"'`
+   if test "x$as_val" = x""yes; then
+  cat >>confdefs.h <<_ACEOF
+#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+
+done
+
+
+{ $as_echo "$as_me:$LINENO: checking for an ANSI C-conforming const" >&5
+$as_echo_n "checking for an ANSI C-conforming const... " >&6; }
+if test "${ac_cv_c_const+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+int
+main ()
+{
+/* FIXME: Include the comments suggested by Paul. */
+#ifndef __cplusplus
+  /* Ultrix mips cc rejects this.  */
+  typedef int charset[2];
+  const charset cs;
+  /* SunOS 4.1.1 cc rejects this.  */
+  char const *const *pcpcc;
+  char **ppc;
+  /* NEC SVR4.0.2 mips cc rejects this.  */
+  struct point {int x, y;};
+  static struct point const zero = {0,0};
+  /* AIX XL C 1.02.0.0 rejects this.
+     It does not let you subtract one const X* pointer from another in
+     an arm of an if-expression whose if-part is not a constant
+     expression */
+  const char *g = "string";
+  pcpcc = &g + (g ? g-g : 0);
+  /* HPUX 7.0 cc rejects these. */
+  ++pcpcc;
+  ppc = (char**) pcpcc;
+  pcpcc = (char const *const *) ppc;
+  { /* SCO 3.2v4 cc rejects this.  */
+    char *t;
+    char const *s = 0 ? (char *) 0 : (char const *) 0;
+
+    *t++ = 0;
+    if (s) return 0;
+  }
+  { /* Someone thinks the Sun supposedly-ANSI compiler will reject this.  */
+    int x[] = {25, 17};
+    const int *foo = &x[0];
+    ++foo;
+  }
+  { /* Sun SC1.0 ANSI compiler rejects this -- but not the above. */
+    typedef const int *iptr;
+    iptr p = 0;
+    ++p;
+  }
+  { /* AIX XL C 1.02.0.0 rejects this saying
+       "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */
+    struct s { int j; const int *ap[3]; };
+    struct s *b; b->j = 5;
+  }
+  { /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */
+    const int foo = 10;
+    if (!foo) return 0;
+  }
+  return !cs[0] && !zero.x;
+#endif
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  ac_cv_c_const=yes
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+       ac_cv_c_const=no
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_c_const" >&5
+$as_echo "$ac_cv_c_const" >&6; }
+if test $ac_cv_c_const = no; then
+
+cat >>confdefs.h <<\_ACEOF
+#define const /**/
+_ACEOF
+
+fi
+
+{ $as_echo "$as_me:$LINENO: checking for inline" >&5
+$as_echo_n "checking for inline... " >&6; }
+if test "${ac_cv_c_inline+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  ac_cv_c_inline=no
+for ac_kw in inline __inline__ __inline; do
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#ifndef __cplusplus
+typedef int foo_t;
+static $ac_kw foo_t static_foo () {return 0; }
+$ac_kw foo_t foo () {return 0; }
+#endif
+
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  ac_cv_c_inline=$ac_kw
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+  test "$ac_cv_c_inline" != no && break
+done
+
+fi
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_c_inline" >&5
+$as_echo "$ac_cv_c_inline" >&6; }
+
+
+case $ac_cv_c_inline in
+  inline | yes) ;;
+  *)
+    case $ac_cv_c_inline in
+      no) ac_val=;;
+      *) ac_val=$ac_cv_c_inline;;
+    esac
+    cat >>confdefs.h <<_ACEOF
+#ifndef __cplusplus
+#define inline $ac_val
+#endif
+_ACEOF
+    ;;
+esac
+
+{ $as_echo "$as_me:$LINENO: checking for C/C++ restrict keyword" >&5
+$as_echo_n "checking for C/C++ restrict keyword... " >&6; }
+if test "${ac_cv_c_restrict+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  ac_cv_c_restrict=no
+   # The order here caters to the fact that C++ does not require restrict.
+   for ac_kw in __restrict __restrict__ _Restrict restrict; do
+     cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+typedef int * int_ptr;
+       int foo (int_ptr $ac_kw ip) {
+       return ip[0];
+       }
+int
+main ()
+{
+int s[1];
+       int * $ac_kw t = s;
+       t[0] = 0;
+       return foo(t)
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  ac_cv_c_restrict=$ac_kw
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+     test "$ac_cv_c_restrict" != no && break
+   done
+
+fi
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_c_restrict" >&5
+$as_echo "$ac_cv_c_restrict" >&6; }
+
+
+ case $ac_cv_c_restrict in
+   restrict) ;;
+   no) cat >>confdefs.h <<\_ACEOF
+#define restrict /**/
+_ACEOF
+ ;;
+   *)  cat >>confdefs.h <<_ACEOF
+#define restrict $ac_cv_c_restrict
+_ACEOF
+ ;;
+ esac
+
+{ $as_echo "$as_me:$LINENO: checking for size_t" >&5
+$as_echo_n "checking for size_t... " >&6; }
+if test "${ac_cv_type_size_t+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  ac_cv_type_size_t=no
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+$ac_includes_default
+int
+main ()
+{
+if (sizeof (size_t))
+       return 0;
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+$ac_includes_default
+int
+main ()
+{
+if (sizeof ((size_t)))
+         return 0;
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  :
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+       ac_cv_type_size_t=yes
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_type_size_t" >&5
+$as_echo "$ac_cv_type_size_t" >&6; }
+if test "x$ac_cv_type_size_t" = x""yes; then
+  :
+else
+
+cat >>confdefs.h <<_ACEOF
+#define size_t unsigned int
+_ACEOF
+
+fi
+
+{ $as_echo "$as_me:$LINENO: checking if $CC has a working bool type" >&5
+$as_echo_n "checking if $CC has a working bool type... " >&6; }
+ cat >conftest.$ac_ext <<_ACEOF
+
+#ifndef __cplusplus
+#include <stdbool.h>
+#endif
+int foo(bool x, int y)
+{
+       return x+y;
+}
+
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  { $as_echo "$as_me:$LINENO: result: yes" >&5
+$as_echo "yes" >&6; }
+
+cat >>confdefs.h <<\_ACEOF
+#define HAVE_WORKING_BOOL 1
+_ACEOF
+
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+       { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+
+
+ { $as_echo "$as_me:$LINENO: checking whether byte ordering is bigendian" >&5
+$as_echo_n "checking whether byte ordering is bigendian... " >&6; }
+if test "${ac_cv_c_bigendian+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  ac_cv_c_bigendian=unknown
+    # See if we're dealing with a universal compiler.
+    cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#ifndef __APPLE_CC__
+              not a universal capable compiler
+            #endif
+            typedef int dummy;
+
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+
+       # Check for potential -arch flags.  It is not universal unless
+       # there are some -arch flags.  Note that *ppc* also matches
+       # ppc64.  This check is also rather less than ideal.
+       case "${CC} ${CFLAGS} ${CPPFLAGS} ${LDFLAGS}" in  #(
+         *-arch*ppc*|*-arch*i386*|*-arch*x86_64*) ac_cv_c_bigendian=universal;;
+       esac
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+    if test $ac_cv_c_bigendian = unknown; then
+      # See if sys/param.h defines the BYTE_ORDER macro.
+      cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <sys/types.h>
+            #include <sys/param.h>
+
+int
+main ()
+{
+#if ! (defined BYTE_ORDER && defined BIG_ENDIAN \
+                    && defined LITTLE_ENDIAN && BYTE_ORDER && BIG_ENDIAN \
+                    && LITTLE_ENDIAN)
+             bogus endian macros
+            #endif
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  # It does; now see whether it defined to BIG_ENDIAN or not.
+        cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <sys/types.h>
+               #include <sys/param.h>
+
+int
+main ()
+{
+#if BYTE_ORDER != BIG_ENDIAN
+                not big endian
+               #endif
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  ac_cv_c_bigendian=yes
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+       ac_cv_c_bigendian=no
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+    fi
+    if test $ac_cv_c_bigendian = unknown; then
+      # See if <limits.h> defines _LITTLE_ENDIAN or _BIG_ENDIAN (e.g., Solaris).
+      cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <limits.h>
+
+int
+main ()
+{
+#if ! (defined _LITTLE_ENDIAN || defined _BIG_ENDIAN)
+             bogus endian macros
+            #endif
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  # It does; now see whether it defined to _BIG_ENDIAN or not.
+        cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <limits.h>
+
+int
+main ()
+{
+#ifndef _BIG_ENDIAN
+                not big endian
+               #endif
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  ac_cv_c_bigendian=yes
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+       ac_cv_c_bigendian=no
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+    fi
+    if test $ac_cv_c_bigendian = unknown; then
+      # Compile a test program.
+      if test "$cross_compiling" = yes; then
+  # Try to guess by grepping values from an object file.
+        cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+short int ascii_mm[] =
+                 { 0x4249, 0x4765, 0x6E44, 0x6961, 0x6E53, 0x7953, 0 };
+               short int ascii_ii[] =
+                 { 0x694C, 0x5454, 0x656C, 0x6E45, 0x6944, 0x6E61, 0 };
+               int use_ascii (int i) {
+                 return ascii_mm[i] + ascii_ii[i];
+               }
+               short int ebcdic_ii[] =
+                 { 0x89D3, 0xE3E3, 0x8593, 0x95C5, 0x89C4, 0x9581, 0 };
+               short int ebcdic_mm[] =
+                 { 0xC2C9, 0xC785, 0x95C4, 0x8981, 0x95E2, 0xA8E2, 0 };
+               int use_ebcdic (int i) {
+                 return ebcdic_mm[i] + ebcdic_ii[i];
+               }
+               extern int foo;
+
+int
+main ()
+{
+return use_ascii (foo) == use_ebcdic (foo);
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  if grep BIGenDianSyS conftest.$ac_objext >/dev/null; then
+             ac_cv_c_bigendian=yes
+           fi
+           if grep LiTTleEnDian conftest.$ac_objext >/dev/null ; then
+             if test "$ac_cv_c_bigendian" = unknown; then
+               ac_cv_c_bigendian=no
+             else
+               # finding both strings is unlikely to happen, but who knows?
+               ac_cv_c_bigendian=unknown
+             fi
+           fi
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+$ac_includes_default
+int
+main ()
+{
+
+            /* Are we little or big endian?  From Harbison&Steele.  */
+            union
+            {
+              long int l;
+              char c[sizeof (long int)];
+            } u;
+            u.l = 1;
+            return u.c[sizeof (long int) - 1] == 1;
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_link") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_try") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_c_bigendian=no
+else
+  $as_echo "$as_me: program exited with status $ac_status" >&5
+$as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+( exit $ac_status )
+ac_cv_c_bigendian=yes
+fi
+rm -rf conftest.dSYM
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
+fi
+
+
+    fi
+fi
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_c_bigendian" >&5
+$as_echo "$ac_cv_c_bigendian" >&6; }
+ case $ac_cv_c_bigendian in #(
+   yes)
+     cat >>confdefs.h <<\_ACEOF
+#define WORDS_BIGENDIAN 1
+_ACEOF
+;; #(
+   no)
+     cat >>confdefs.h <<\_ACEOF
+#define WORDS_LITTLEENDIAN 1
+_ACEOF
+ ;; #(
+   universal)
+
+cat >>confdefs.h <<\_ACEOF
+#define AC_APPLE_UNIVERSAL_BUILD 1
+_ACEOF
+
+     ;; #(
+   *)
+     { { $as_echo "$as_me:$LINENO: error: unknown endianness
+ presetting ac_cv_c_bigendian=no (or yes) will help" >&5
+$as_echo "$as_me: error: unknown endianness
+ presetting ac_cv_c_bigendian=no (or yes) will help" >&2;}
+   { (exit 1); exit 1; }; } ;;
+ esac
+
+
+
+
+
+
+
+
+
+for ac_func in strcspn
+do
+as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
+{ $as_echo "$as_me:$LINENO: checking for $ac_func" >&5
+$as_echo_n "checking for $ac_func... " >&6; }
+if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then
+  $as_echo_n "(cached) " >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+/* Define $ac_func to an innocuous variant, in case <limits.h> declares $ac_func.
+   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
+#define $ac_func innocuous_$ac_func
+
+/* System header to define __stub macros and hopefully few prototypes,
+    which can conflict with char $ac_func (); below.
+    Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+    <limits.h> exists even on freestanding compilers.  */
+
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+
+#undef $ac_func
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char $ac_func ();
+/* The GNU C library defines this for functions which it implements
+    to always fail with ENOSYS.  Some functions are actually named
+    something starting with __ and the normal name is an alias.  */
+#if defined __stub_$ac_func || defined __stub___$ac_func
+choke me
+#endif
+
+int
+main ()
+{
+return $ac_func ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_link") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest$ac_exeext && {
+        test "$cross_compiling" = yes ||
+        $as_test_x conftest$ac_exeext
+       }; then
+  eval "$as_ac_var=yes"
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+       eval "$as_ac_var=no"
+fi
+
+rm -rf conftest.dSYM
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
+fi
+ac_res=`eval 'as_val=${'$as_ac_var'}
+                $as_echo "$as_val"'`
+              { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+as_val=`eval 'as_val=${'$as_ac_var'}
+                $as_echo "$as_val"'`
+   if test "x$as_val" = x""yes; then
+  cat >>confdefs.h <<_ACEOF
+#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
+_ACEOF
+
+else
+  { { $as_echo "$as_me:$LINENO: error: NASM requires ANSI C (specifically, \"strcspn\")" >&5
+$as_echo "$as_me: error: NASM requires ANSI C (specifically, \"strcspn\")" >&2;}
+   { (exit 1); exit 1; }; }
+fi
+done
+
+
+
+for ac_func in strspn
+do
+as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
+{ $as_echo "$as_me:$LINENO: checking for $ac_func" >&5
+$as_echo_n "checking for $ac_func... " >&6; }
+if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then
+  $as_echo_n "(cached) " >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+/* Define $ac_func to an innocuous variant, in case <limits.h> declares $ac_func.
+   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
+#define $ac_func innocuous_$ac_func
+
+/* System header to define __stub macros and hopefully few prototypes,
+    which can conflict with char $ac_func (); below.
+    Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+    <limits.h> exists even on freestanding compilers.  */
+
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+
+#undef $ac_func
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char $ac_func ();
+/* The GNU C library defines this for functions which it implements
+    to always fail with ENOSYS.  Some functions are actually named
+    something starting with __ and the normal name is an alias.  */
+#if defined __stub_$ac_func || defined __stub___$ac_func
+choke me
+#endif
+
+int
+main ()
+{
+return $ac_func ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_link") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest$ac_exeext && {
+        test "$cross_compiling" = yes ||
+        $as_test_x conftest$ac_exeext
+       }; then
+  eval "$as_ac_var=yes"
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+       eval "$as_ac_var=no"
+fi
+
+rm -rf conftest.dSYM
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
+fi
+ac_res=`eval 'as_val=${'$as_ac_var'}
+                $as_echo "$as_val"'`
+              { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+as_val=`eval 'as_val=${'$as_ac_var'}
+                $as_echo "$as_val"'`
+   if test "x$as_val" = x""yes; then
+  cat >>confdefs.h <<_ACEOF
+#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
+_ACEOF
+
+else
+  { { $as_echo "$as_me:$LINENO: error: NASM requires ANSI C (specifically, \"strspn\")" >&5
+$as_echo "$as_me: error: NASM requires ANSI C (specifically, \"strspn\")" >&2;}
+   { (exit 1); exit 1; }; }
+fi
+done
+
+
+missing=true
+
+
+for ac_func in vsnprintf _vsnprintf
+do
+as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
+{ $as_echo "$as_me:$LINENO: checking for $ac_func" >&5
+$as_echo_n "checking for $ac_func... " >&6; }
+if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then
+  $as_echo_n "(cached) " >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+/* Define $ac_func to an innocuous variant, in case <limits.h> declares $ac_func.
+   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
+#define $ac_func innocuous_$ac_func
+
+/* System header to define __stub macros and hopefully few prototypes,
+    which can conflict with char $ac_func (); below.
+    Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+    <limits.h> exists even on freestanding compilers.  */
+
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+
+#undef $ac_func
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char $ac_func ();
+/* The GNU C library defines this for functions which it implements
+    to always fail with ENOSYS.  Some functions are actually named
+    something starting with __ and the normal name is an alias.  */
+#if defined __stub_$ac_func || defined __stub___$ac_func
+choke me
+#endif
+
+int
+main ()
+{
+return $ac_func ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_link") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest$ac_exeext && {
+        test "$cross_compiling" = yes ||
+        $as_test_x conftest$ac_exeext
+       }; then
+  eval "$as_ac_var=yes"
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+       eval "$as_ac_var=no"
+fi
+
+rm -rf conftest.dSYM
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
+fi
+ac_res=`eval 'as_val=${'$as_ac_var'}
+                $as_echo "$as_val"'`
+              { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+as_val=`eval 'as_val=${'$as_ac_var'}
+                $as_echo "$as_val"'`
+   if test "x$as_val" = x""yes; then
+  cat >>confdefs.h <<_ACEOF
+#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
+_ACEOF
+ missing=false
+fi
+done
+
+if $missing; then
+   XOBJS="$XOBJS lib/vsnprintf.o"
+fi
+
+missing=true
+
+
+for ac_func in snprintf _snprintf
+do
+as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
+{ $as_echo "$as_me:$LINENO: checking for $ac_func" >&5
+$as_echo_n "checking for $ac_func... " >&6; }
+if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then
+  $as_echo_n "(cached) " >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+/* Define $ac_func to an innocuous variant, in case <limits.h> declares $ac_func.
+   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
+#define $ac_func innocuous_$ac_func
+
+/* System header to define __stub macros and hopefully few prototypes,
+    which can conflict with char $ac_func (); below.
+    Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+    <limits.h> exists even on freestanding compilers.  */
+
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+
+#undef $ac_func
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char $ac_func ();
+/* The GNU C library defines this for functions which it implements
+    to always fail with ENOSYS.  Some functions are actually named
+    something starting with __ and the normal name is an alias.  */
+#if defined __stub_$ac_func || defined __stub___$ac_func
+choke me
+#endif
+
+int
+main ()
+{
+return $ac_func ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_link") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest$ac_exeext && {
+        test "$cross_compiling" = yes ||
+        $as_test_x conftest$ac_exeext
+       }; then
+  eval "$as_ac_var=yes"
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+       eval "$as_ac_var=no"
+fi
+
+rm -rf conftest.dSYM
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
+fi
+ac_res=`eval 'as_val=${'$as_ac_var'}
+                $as_echo "$as_val"'`
+              { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+as_val=`eval 'as_val=${'$as_ac_var'}
+                $as_echo "$as_val"'`
+   if test "x$as_val" = x""yes; then
+  cat >>confdefs.h <<_ACEOF
+#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
+_ACEOF
+ missing=false
+fi
+done
+
+if $missing; then
+   XOBJS="$XOBJS lib/snprintf.o"
+fi
+
+
+
+for ac_func in strcasecmp stricmp
+do
+as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
+{ $as_echo "$as_me:$LINENO: checking for $ac_func" >&5
+$as_echo_n "checking for $ac_func... " >&6; }
+if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then
+  $as_echo_n "(cached) " >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+/* Define $ac_func to an innocuous variant, in case <limits.h> declares $ac_func.
+   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
+#define $ac_func innocuous_$ac_func
+
+/* System header to define __stub macros and hopefully few prototypes,
+    which can conflict with char $ac_func (); below.
+    Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+    <limits.h> exists even on freestanding compilers.  */
+
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+
+#undef $ac_func
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char $ac_func ();
+/* The GNU C library defines this for functions which it implements
+    to always fail with ENOSYS.  Some functions are actually named
+    something starting with __ and the normal name is an alias.  */
+#if defined __stub_$ac_func || defined __stub___$ac_func
+choke me
+#endif
+
+int
+main ()
+{
+return $ac_func ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_link") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest$ac_exeext && {
+        test "$cross_compiling" = yes ||
+        $as_test_x conftest$ac_exeext
+       }; then
+  eval "$as_ac_var=yes"
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+       eval "$as_ac_var=no"
+fi
+
+rm -rf conftest.dSYM
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
+fi
+ac_res=`eval 'as_val=${'$as_ac_var'}
+                $as_echo "$as_val"'`
+              { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+as_val=`eval 'as_val=${'$as_ac_var'}
+                $as_echo "$as_val"'`
+   if test "x$as_val" = x""yes; then
+  cat >>confdefs.h <<_ACEOF
+#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+done
+
+
+
+for ac_func in strncasecmp strnicmp
+do
+as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
+{ $as_echo "$as_me:$LINENO: checking for $ac_func" >&5
+$as_echo_n "checking for $ac_func... " >&6; }
+if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then
+  $as_echo_n "(cached) " >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+/* Define $ac_func to an innocuous variant, in case <limits.h> declares $ac_func.
+   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
+#define $ac_func innocuous_$ac_func
+
+/* System header to define __stub macros and hopefully few prototypes,
+    which can conflict with char $ac_func (); below.
+    Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+    <limits.h> exists even on freestanding compilers.  */
+
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+
+#undef $ac_func
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char $ac_func ();
+/* The GNU C library defines this for functions which it implements
+    to always fail with ENOSYS.  Some functions are actually named
+    something starting with __ and the normal name is an alias.  */
+#if defined __stub_$ac_func || defined __stub___$ac_func
+choke me
+#endif
+
+int
+main ()
+{
+return $ac_func ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_link") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest$ac_exeext && {
+        test "$cross_compiling" = yes ||
+        $as_test_x conftest$ac_exeext
+       }; then
+  eval "$as_ac_var=yes"
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+       eval "$as_ac_var=no"
+fi
+
+rm -rf conftest.dSYM
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
+fi
+ac_res=`eval 'as_val=${'$as_ac_var'}
+                $as_echo "$as_val"'`
+              { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+as_val=`eval 'as_val=${'$as_ac_var'}
+                $as_echo "$as_val"'`
+   if test "x$as_val" = x""yes; then
+  cat >>confdefs.h <<_ACEOF
+#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+done
+
+
+for ac_func in strsep
+do
+as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
+{ $as_echo "$as_me:$LINENO: checking for $ac_func" >&5
+$as_echo_n "checking for $ac_func... " >&6; }
+if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then
+  $as_echo_n "(cached) " >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+/* Define $ac_func to an innocuous variant, in case <limits.h> declares $ac_func.
+   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
+#define $ac_func innocuous_$ac_func
+
+/* System header to define __stub macros and hopefully few prototypes,
+    which can conflict with char $ac_func (); below.
+    Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+    <limits.h> exists even on freestanding compilers.  */
+
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+
+#undef $ac_func
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char $ac_func ();
+/* The GNU C library defines this for functions which it implements
+    to always fail with ENOSYS.  Some functions are actually named
+    something starting with __ and the normal name is an alias.  */
+#if defined __stub_$ac_func || defined __stub___$ac_func
+choke me
+#endif
+
+int
+main ()
+{
+return $ac_func ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_link") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest$ac_exeext && {
+        test "$cross_compiling" = yes ||
+        $as_test_x conftest$ac_exeext
+       }; then
+  eval "$as_ac_var=yes"
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+       eval "$as_ac_var=no"
+fi
+
+rm -rf conftest.dSYM
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
+fi
+ac_res=`eval 'as_val=${'$as_ac_var'}
+                $as_echo "$as_val"'`
+              { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+as_val=`eval 'as_val=${'$as_ac_var'}
+                $as_echo "$as_val"'`
+   if test "x$as_val" = x""yes; then
+  cat >>confdefs.h <<_ACEOF
+#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+done
+
+
+for ac_func in strlcpy
+do
+as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
+{ $as_echo "$as_me:$LINENO: checking for $ac_func" >&5
+$as_echo_n "checking for $ac_func... " >&6; }
+if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then
+  $as_echo_n "(cached) " >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+/* Define $ac_func to an innocuous variant, in case <limits.h> declares $ac_func.
+   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
+#define $ac_func innocuous_$ac_func
+
+/* System header to define __stub macros and hopefully few prototypes,
+    which can conflict with char $ac_func (); below.
+    Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+    <limits.h> exists even on freestanding compilers.  */
+
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+
+#undef $ac_func
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char $ac_func ();
+/* The GNU C library defines this for functions which it implements
+    to always fail with ENOSYS.  Some functions are actually named
+    something starting with __ and the normal name is an alias.  */
+#if defined __stub_$ac_func || defined __stub___$ac_func
+choke me
+#endif
+
+int
+main ()
+{
+return $ac_func ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_link") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest$ac_exeext && {
+        test "$cross_compiling" = yes ||
+        $as_test_x conftest$ac_exeext
+       }; then
+  eval "$as_ac_var=yes"
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+       eval "$as_ac_var=no"
+fi
+
+rm -rf conftest.dSYM
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
+fi
+ac_res=`eval 'as_val=${'$as_ac_var'}
+                $as_echo "$as_val"'`
+              { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+as_val=`eval 'as_val=${'$as_ac_var'}
+                $as_echo "$as_val"'`
+   if test "x$as_val" = x""yes; then
+  cat >>confdefs.h <<_ACEOF
+#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+done
+
+
+
+for ac_func in getuid
+do
+as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
+{ $as_echo "$as_me:$LINENO: checking for $ac_func" >&5
+$as_echo_n "checking for $ac_func... " >&6; }
+if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then
+  $as_echo_n "(cached) " >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+/* Define $ac_func to an innocuous variant, in case <limits.h> declares $ac_func.
+   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
+#define $ac_func innocuous_$ac_func
+
+/* System header to define __stub macros and hopefully few prototypes,
+    which can conflict with char $ac_func (); below.
+    Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+    <limits.h> exists even on freestanding compilers.  */
+
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+
+#undef $ac_func
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char $ac_func ();
+/* The GNU C library defines this for functions which it implements
+    to always fail with ENOSYS.  Some functions are actually named
+    something starting with __ and the normal name is an alias.  */
+#if defined __stub_$ac_func || defined __stub___$ac_func
+choke me
+#endif
+
+int
+main ()
+{
+return $ac_func ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_link") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest$ac_exeext && {
+        test "$cross_compiling" = yes ||
+        $as_test_x conftest$ac_exeext
+       }; then
+  eval "$as_ac_var=yes"
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+       eval "$as_ac_var=no"
+fi
+
+rm -rf conftest.dSYM
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
+fi
+ac_res=`eval 'as_val=${'$as_ac_var'}
+                $as_echo "$as_val"'`
+              { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+as_val=`eval 'as_val=${'$as_ac_var'}
+                $as_echo "$as_val"'`
+   if test "x$as_val" = x""yes; then
+  cat >>confdefs.h <<_ACEOF
+#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+done
+
+
+for ac_func in getgid
+do
+as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
+{ $as_echo "$as_me:$LINENO: checking for $ac_func" >&5
+$as_echo_n "checking for $ac_func... " >&6; }
+if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then
+  $as_echo_n "(cached) " >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+/* Define $ac_func to an innocuous variant, in case <limits.h> declares $ac_func.
+   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
+#define $ac_func innocuous_$ac_func
+
+/* System header to define __stub macros and hopefully few prototypes,
+    which can conflict with char $ac_func (); below.
+    Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+    <limits.h> exists even on freestanding compilers.  */
+
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+
+#undef $ac_func
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char $ac_func ();
+/* The GNU C library defines this for functions which it implements
+    to always fail with ENOSYS.  Some functions are actually named
+    something starting with __ and the normal name is an alias.  */
+#if defined __stub_$ac_func || defined __stub___$ac_func
+choke me
+#endif
+
+int
+main ()
+{
+return $ac_func ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_link") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest$ac_exeext && {
+        test "$cross_compiling" = yes ||
+        $as_test_x conftest$ac_exeext
+       }; then
+  eval "$as_ac_var=yes"
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+       eval "$as_ac_var=no"
+fi
+
+rm -rf conftest.dSYM
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
+fi
+ac_res=`eval 'as_val=${'$as_ac_var'}
+                $as_echo "$as_val"'`
+              { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+as_val=`eval 'as_val=${'$as_ac_var'}
+                $as_echo "$as_val"'`
+   if test "x$as_val" = x""yes; then
+  cat >>confdefs.h <<_ACEOF
+#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+done
+
+
+{ $as_echo "$as_me:$LINENO: checking whether strcasecmp is declared" >&5
+$as_echo_n "checking whether strcasecmp is declared... " >&6; }
+if test "${ac_cv_have_decl_strcasecmp+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+$ac_includes_default
+int
+main ()
+{
+#ifndef strcasecmp
+  (void) strcasecmp;
+#endif
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  ac_cv_have_decl_strcasecmp=yes
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+       ac_cv_have_decl_strcasecmp=no
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_have_decl_strcasecmp" >&5
+$as_echo "$ac_cv_have_decl_strcasecmp" >&6; }
+if test "x$ac_cv_have_decl_strcasecmp" = x""yes; then
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_DECL_STRCASECMP 1
+_ACEOF
+
+
+else
+  cat >>confdefs.h <<_ACEOF
+#define HAVE_DECL_STRCASECMP 0
+_ACEOF
+
+
+fi
+
+
+{ $as_echo "$as_me:$LINENO: checking whether stricmp is declared" >&5
+$as_echo_n "checking whether stricmp is declared... " >&6; }
+if test "${ac_cv_have_decl_stricmp+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+$ac_includes_default
+int
+main ()
+{
+#ifndef stricmp
+  (void) stricmp;
+#endif
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  ac_cv_have_decl_stricmp=yes
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+       ac_cv_have_decl_stricmp=no
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_have_decl_stricmp" >&5
+$as_echo "$ac_cv_have_decl_stricmp" >&6; }
+if test "x$ac_cv_have_decl_stricmp" = x""yes; then
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_DECL_STRICMP 1
+_ACEOF
+
+
+else
+  cat >>confdefs.h <<_ACEOF
+#define HAVE_DECL_STRICMP 0
+_ACEOF
+
+
+fi
+
+
+{ $as_echo "$as_me:$LINENO: checking whether strncasecmp is declared" >&5
+$as_echo_n "checking whether strncasecmp is declared... " >&6; }
+if test "${ac_cv_have_decl_strncasecmp+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+$ac_includes_default
+int
+main ()
+{
+#ifndef strncasecmp
+  (void) strncasecmp;
+#endif
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  ac_cv_have_decl_strncasecmp=yes
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+       ac_cv_have_decl_strncasecmp=no
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_have_decl_strncasecmp" >&5
+$as_echo "$ac_cv_have_decl_strncasecmp" >&6; }
+if test "x$ac_cv_have_decl_strncasecmp" = x""yes; then
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_DECL_STRNCASECMP 1
+_ACEOF
+
+
+else
+  cat >>confdefs.h <<_ACEOF
+#define HAVE_DECL_STRNCASECMP 0
+_ACEOF
+
+
+fi
+
+
+{ $as_echo "$as_me:$LINENO: checking whether strnicmp is declared" >&5
+$as_echo_n "checking whether strnicmp is declared... " >&6; }
+if test "${ac_cv_have_decl_strnicmp+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+$ac_includes_default
+int
+main ()
+{
+#ifndef strnicmp
+  (void) strnicmp;
+#endif
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  ac_cv_have_decl_strnicmp=yes
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+       ac_cv_have_decl_strnicmp=no
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_have_decl_strnicmp" >&5
+$as_echo "$ac_cv_have_decl_strnicmp" >&6; }
+if test "x$ac_cv_have_decl_strnicmp" = x""yes; then
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_DECL_STRNICMP 1
+_ACEOF
+
+
+else
+  cat >>confdefs.h <<_ACEOF
+#define HAVE_DECL_STRNICMP 0
+_ACEOF
+
+
+fi
+
+
+{ $as_echo "$as_me:$LINENO: checking whether strsep is declared" >&5
+$as_echo_n "checking whether strsep is declared... " >&6; }
+if test "${ac_cv_have_decl_strsep+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+$ac_includes_default
+int
+main ()
+{
+#ifndef strsep
+  (void) strsep;
+#endif
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  ac_cv_have_decl_strsep=yes
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+       ac_cv_have_decl_strsep=no
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_have_decl_strsep" >&5
+$as_echo "$ac_cv_have_decl_strsep" >&6; }
+if test "x$ac_cv_have_decl_strsep" = x""yes; then
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_DECL_STRSEP 1
+_ACEOF
+
+
+else
+  cat >>confdefs.h <<_ACEOF
+#define HAVE_DECL_STRSEP 0
+_ACEOF
+
+
+fi
+
+
+{ $as_echo "$as_me:$LINENO: checking whether strlcpy is declared" >&5
+$as_echo_n "checking whether strlcpy is declared... " >&6; }
+if test "${ac_cv_have_decl_strlcpy+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+$ac_includes_default
+int
+main ()
+{
+#ifndef strlcpy
+  (void) strlcpy;
+#endif
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  ac_cv_have_decl_strlcpy=yes
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+       ac_cv_have_decl_strlcpy=no
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_have_decl_strlcpy" >&5
+$as_echo "$ac_cv_have_decl_strlcpy" >&6; }
+if test "x$ac_cv_have_decl_strlcpy" = x""yes; then
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_DECL_STRLCPY 1
+_ACEOF
+
+
+else
+  cat >>confdefs.h <<_ACEOF
+#define HAVE_DECL_STRLCPY 0
+_ACEOF
+
+
+fi
+
+
+
+if test $ac_cv_prog_make_vpathok = no; then
+  echo Copying generated srcs into build directory to compensate for VPATH breakage
+  for file in macros.c insnsa.c insnsd.c insnsn.c insnsi.h version.h version.mac; do
+    if test ! -f $file; then cp -p ${srcdir}/${file} .; fi
+  done
+fi
+
+ac_config_commands="$ac_config_commands default-1"
+
+ac_config_files="$ac_config_files Makefile rdoff/Makefile doc/Makefile"
+
+cat >confcache <<\_ACEOF
+# This file is a shell script that caches the results of configure
+# tests run on this system so they can be shared between configure
+# scripts and configure runs, see configure's option --config-cache.
+# It is not useful on other systems.  If it contains results you don't
+# want to keep, you may remove or edit it.
+#
+# config.status only pays attention to the cache file if you give it
+# the --recheck option to rerun configure.
+#
+# `ac_cv_env_foo' variables (set or unset) will be overridden when
+# loading this file, other *unset* `ac_cv_foo' will be assigned the
+# following values.
+
+_ACEOF
+
+# The following way of writing the cache mishandles newlines in values,
+# but we know of no workaround that is simple, portable, and efficient.
+# So, we kill variables containing newlines.
+# Ultrix sh set writes to stderr and can't be redirected directly,
+# and sets the high bit in the cache file unless we assign to the vars.
+(
+  for ac_var in `(set) 2>&1 | sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'`; do
+    eval ac_val=\$$ac_var
+    case $ac_val in #(
+    *${as_nl}*)
+      case $ac_var in #(
+      *_cv_*) { $as_echo "$as_me:$LINENO: WARNING: cache variable $ac_var contains a newline" >&5
+$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;;
+      esac
+      case $ac_var in #(
+      _ | IFS | as_nl) ;; #(
+      BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #(
+      *) $as_unset $ac_var ;;
+      esac ;;
+    esac
+  done
+
+  (set) 2>&1 |
+    case $as_nl`(ac_space=' '; set) 2>&1` in #(
+    *${as_nl}ac_space=\ *)
+      # `set' does not quote correctly, so add quotes (double-quote
+      # substitution turns \\\\ into \\, and sed turns \\ into \).
+      sed -n \
+       "s/'/'\\\\''/g;
+         s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p"
+      ;; #(
+    *)
+      # `set' quotes correctly as required by POSIX, so do not add quotes.
+      sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p"
+      ;;
+    esac |
+    sort
+) |
+  sed '
+     /^ac_cv_env_/b end
+     t clear
+     :clear
+     s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/
+     t end
+     s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/
+     :end' >>confcache
+if diff "$cache_file" confcache >/dev/null 2>&1; then :; else
+  if test -w "$cache_file"; then
+    test "x$cache_file" != "x/dev/null" &&
+      { $as_echo "$as_me:$LINENO: updating cache $cache_file" >&5
+$as_echo "$as_me: updating cache $cache_file" >&6;}
+    cat confcache >$cache_file
+  else
+    { $as_echo "$as_me:$LINENO: not updating unwritable cache $cache_file" >&5
+$as_echo "$as_me: not updating unwritable cache $cache_file" >&6;}
+  fi
+fi
+rm -f confcache
+
+test "x$prefix" = xNONE && prefix=$ac_default_prefix
+# Let make expand exec_prefix.
+test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
+
+DEFS=-DHAVE_CONFIG_H
+
+ac_libobjs=
+ac_ltlibobjs=
+for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue
+  # 1. Remove the extension, and $U if already installed.
+  ac_script='s/\$U\././;s/\.o$//;s/\.obj$//'
+  ac_i=`$as_echo "$ac_i" | sed "$ac_script"`
+  # 2. Prepend LIBOBJDIR.  When used with automake>=1.10 LIBOBJDIR
+  #    will be set to the directory where LIBOBJS objects are built.
+  ac_libobjs="$ac_libobjs \${LIBOBJDIR}$ac_i\$U.$ac_objext"
+  ac_ltlibobjs="$ac_ltlibobjs \${LIBOBJDIR}$ac_i"'$U.lo'
+done
+LIBOBJS=$ac_libobjs
+
+LTLIBOBJS=$ac_ltlibobjs
+
+
+
+
+: ${CONFIG_STATUS=./config.status}
+ac_write_fail=0
+ac_clean_files_save=$ac_clean_files
+ac_clean_files="$ac_clean_files $CONFIG_STATUS"
+{ $as_echo "$as_me:$LINENO: creating $CONFIG_STATUS" >&5
+$as_echo "$as_me: creating $CONFIG_STATUS" >&6;}
+cat >$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+#! $SHELL
+# Generated by $as_me.
+# Run this file to recreate the current configuration.
+# Compiler output produced by configure, useful for debugging
+# configure, is in config.log if it exists.
+
+debug=false
+ac_cs_recheck=false
+ac_cs_silent=false
+SHELL=\${CONFIG_SHELL-$SHELL}
+_ACEOF
+
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+## --------------------- ##
+## M4sh Initialization.  ##
+## --------------------- ##
+
+# Be more Bourne compatible
+DUALCASE=1; export DUALCASE # for MKS sh
+if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
+  emulate sh
+  NULLCMD=:
+  # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which
+  # is contrary to our usage.  Disable this feature.
+  alias -g '${1+"$@"}'='"$@"'
+  setopt NO_GLOB_SUBST
+else
+  case `(set -o) 2>/dev/null` in
+  *posix*) set -o posix ;;
+esac
+
+fi
+
+
+
+
+# PATH needs CR
+# Avoid depending upon Character Ranges.
+as_cr_letters='abcdefghijklmnopqrstuvwxyz'
+as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
+as_cr_Letters=$as_cr_letters$as_cr_LETTERS
+as_cr_digits='0123456789'
+as_cr_alnum=$as_cr_Letters$as_cr_digits
+
+as_nl='
+'
+export as_nl
+# Printing a long string crashes Solaris 7 /usr/bin/printf.
+as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
+as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo
+as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo
+if (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then
+  as_echo='printf %s\n'
+  as_echo_n='printf %s'
+else
+  if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then
+    as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"'
+    as_echo_n='/usr/ucb/echo -n'
+  else
+    as_echo_body='eval expr "X$1" : "X\\(.*\\)"'
+    as_echo_n_body='eval
+      arg=$1;
+      case $arg in
+      *"$as_nl"*)
+       expr "X$arg" : "X\\(.*\\)$as_nl";
+       arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;;
+      esac;
+      expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl"
+    '
+    export as_echo_n_body
+    as_echo_n='sh -c $as_echo_n_body as_echo'
+  fi
+  export as_echo_body
+  as_echo='sh -c $as_echo_body as_echo'
+fi
+
+# The user is always right.
+if test "${PATH_SEPARATOR+set}" != set; then
+  PATH_SEPARATOR=:
+  (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && {
+    (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 ||
+      PATH_SEPARATOR=';'
+  }
+fi
+
+# Support unset when possible.
+if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then
+  as_unset=unset
+else
+  as_unset=false
+fi
+
+
+# IFS
+# We need space, tab and new line, in precisely that order.  Quoting is
+# there to prevent editors from complaining about space-tab.
+# (If _AS_PATH_WALK were called with IFS unset, it would disable word
+# splitting by setting IFS to empty value.)
+IFS=" ""       $as_nl"
+
+# Find who we are.  Look in the path if we contain no directory separator.
+case $0 in
+  *[\\/]* ) as_myself=$0 ;;
+  *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break
+done
+IFS=$as_save_IFS
+
+     ;;
+esac
+# We did not find ourselves, most probably we were run as `sh COMMAND'
+# in which case we are not to be found in the path.
+if test "x$as_myself" = x; then
+  as_myself=$0
+fi
+if test ! -f "$as_myself"; then
+  $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2
+  { (exit 1); exit 1; }
+fi
+
+# Work around bugs in pre-3.0 UWIN ksh.
+for as_var in ENV MAIL MAILPATH
+do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var
+done
+PS1='$ '
+PS2='> '
+PS4='+ '
+
+# NLS nuisances.
+LC_ALL=C
+export LC_ALL
+LANGUAGE=C
+export LANGUAGE
+
+# Required to use basename.
+if expr a : '\(a\)' >/dev/null 2>&1 &&
+   test "X`expr 00001 : '.*\(...\)'`" = X001; then
+  as_expr=expr
+else
+  as_expr=false
+fi
+
+if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then
+  as_basename=basename
+else
+  as_basename=false
+fi
+
+
+# Name of the executable.
+as_me=`$as_basename -- "$0" ||
+$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \
+        X"$0" : 'X\(//\)$' \| \
+        X"$0" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X/"$0" |
+    sed '/^.*\/\([^/][^/]*\)\/*$/{
+           s//\1/
+           q
+         }
+         /^X\/\(\/\/\)$/{
+           s//\1/
+           q
+         }
+         /^X\/\(\/\).*/{
+           s//\1/
+           q
+         }
+         s/.*/./; q'`
+
+# CDPATH.
+$as_unset CDPATH
+
+
+
+  as_lineno_1=$LINENO
+  as_lineno_2=$LINENO
+  test "x$as_lineno_1" != "x$as_lineno_2" &&
+  test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2" || {
+
+  # Create $as_me.lineno as a copy of $as_myself, but with $LINENO
+  # uniformly replaced by the line number.  The first 'sed' inserts a
+  # line-number line after each line using $LINENO; the second 'sed'
+  # does the real work.  The second script uses 'N' to pair each
+  # line-number line with the line containing $LINENO, and appends
+  # trailing '-' during substitution so that $LINENO is not a special
+  # case at line end.
+  # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the
+  # scripts with optimization help from Paolo Bonzini.  Blame Lee
+  # E. McMahon (1931-1989) for sed's syntax.  :-)
+  sed -n '
+    p
+    /[$]LINENO/=
+  ' <$as_myself |
+    sed '
+      s/[$]LINENO.*/&-/
+      t lineno
+      b
+      :lineno
+      N
+      :loop
+      s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/
+      t loop
+      s/-\n.*//
+    ' >$as_me.lineno &&
+  chmod +x "$as_me.lineno" ||
+    { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2
+   { (exit 1); exit 1; }; }
+
+  # Don't try to exec as it changes $[0], causing all sort of problems
+  # (the dirname of $[0] is not the place where we might find the
+  # original and so on.  Autoconf is especially sensitive to this).
+  . "./$as_me.lineno"
+  # Exit status is that of the last command.
+  exit
+}
+
+
+if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then
+  as_dirname=dirname
+else
+  as_dirname=false
+fi
+
+ECHO_C= ECHO_N= ECHO_T=
+case `echo -n x` in
+-n*)
+  case `echo 'x\c'` in
+  *c*) ECHO_T='        ';;     # ECHO_T is single tab character.
+  *)   ECHO_C='\c';;
+  esac;;
+*)
+  ECHO_N='-n';;
+esac
+if expr a : '\(a\)' >/dev/null 2>&1 &&
+   test "X`expr 00001 : '.*\(...\)'`" = X001; then
+  as_expr=expr
+else
+  as_expr=false
+fi
+
+rm -f conf$$ conf$$.exe conf$$.file
+if test -d conf$$.dir; then
+  rm -f conf$$.dir/conf$$.file
+else
+  rm -f conf$$.dir
+  mkdir conf$$.dir 2>/dev/null
+fi
+if (echo >conf$$.file) 2>/dev/null; then
+  if ln -s conf$$.file conf$$ 2>/dev/null; then
+    as_ln_s='ln -s'
+    # ... but there are two gotchas:
+    # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail.
+    # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable.
+    # In both cases, we have to default to `cp -p'.
+    ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe ||
+      as_ln_s='cp -p'
+  elif ln conf$$.file conf$$ 2>/dev/null; then
+    as_ln_s=ln
+  else
+    as_ln_s='cp -p'
+  fi
+else
+  as_ln_s='cp -p'
+fi
+rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file
+rmdir conf$$.dir 2>/dev/null
+
+if mkdir -p . 2>/dev/null; then
+  as_mkdir_p=:
+else
+  test -d ./-p && rmdir ./-p
+  as_mkdir_p=false
+fi
+
+if test -x / >/dev/null 2>&1; then
+  as_test_x='test -x'
+else
+  if ls -dL / >/dev/null 2>&1; then
+    as_ls_L_option=L
+  else
+    as_ls_L_option=
+  fi
+  as_test_x='
+    eval sh -c '\''
+      if test -d "$1"; then
+       test -d "$1/.";
+      else
+       case $1 in
+       -*)set "./$1";;
+       esac;
+       case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in
+       ???[sx]*):;;*)false;;esac;fi
+    '\'' sh
+  '
+fi
+as_executable_p=$as_test_x
+
+# Sed expression to map a string onto a valid CPP name.
+as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'"
+
+# Sed expression to map a string onto a valid variable name.
+as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'"
+
+
+exec 6>&1
+
+# Save the log message, to keep $[0] and so on meaningful, and to
+# report actual input values of CONFIG_FILES etc. instead of their
+# values after options handling.
+ac_log="
+This file was extended by $as_me, which was
+generated by GNU Autoconf 2.63.  Invocation command line was
+
+  CONFIG_FILES    = $CONFIG_FILES
+  CONFIG_HEADERS  = $CONFIG_HEADERS
+  CONFIG_LINKS    = $CONFIG_LINKS
+  CONFIG_COMMANDS = $CONFIG_COMMANDS
+  $ $0 $@
+
+on `(hostname || uname -n) 2>/dev/null | sed 1q`
+"
+
+_ACEOF
+
+case $ac_config_files in *"
+"*) set x $ac_config_files; shift; ac_config_files=$*;;
+esac
+
+case $ac_config_headers in *"
+"*) set x $ac_config_headers; shift; ac_config_headers=$*;;
+esac
+
+
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+# Files that config.status was made for.
+config_files="$ac_config_files"
+config_headers="$ac_config_headers"
+config_commands="$ac_config_commands"
+
+_ACEOF
+
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+ac_cs_usage="\
+\`$as_me' instantiates files from templates according to the
+current configuration.
+
+Usage: $0 [OPTION]... [FILE]...
+
+  -h, --help       print this help, then exit
+  -V, --version    print version number and configuration settings, then exit
+  -q, --quiet, --silent
+                   do not print progress messages
+  -d, --debug      don't remove temporary files
+      --recheck    update $as_me by reconfiguring in the same conditions
+      --file=FILE[:TEMPLATE]
+                   instantiate the configuration file FILE
+      --header=FILE[:TEMPLATE]
+                   instantiate the configuration header FILE
+
+Configuration files:
+$config_files
+
+Configuration headers:
+$config_headers
+
+Configuration commands:
+$config_commands
+
+Report bugs to <bug-autoconf@gnu.org>."
+
+_ACEOF
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+ac_cs_version="\\
+config.status
+configured by $0, generated by GNU Autoconf 2.63,
+  with options \\"`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\"
+
+Copyright (C) 2008 Free Software Foundation, Inc.
+This config.status script is free software; the Free Software Foundation
+gives unlimited permission to copy, distribute and modify it."
+
+ac_pwd='$ac_pwd'
+srcdir='$srcdir'
+INSTALL='$INSTALL'
+test -n "\$AWK" || AWK=awk
+_ACEOF
+
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+# The default lists apply if the user does not specify any file.
+ac_need_defaults=:
+while test $# != 0
+do
+  case $1 in
+  --*=*)
+    ac_option=`expr "X$1" : 'X\([^=]*\)='`
+    ac_optarg=`expr "X$1" : 'X[^=]*=\(.*\)'`
+    ac_shift=:
+    ;;
+  *)
+    ac_option=$1
+    ac_optarg=$2
+    ac_shift=shift
+    ;;
+  esac
+
+  case $ac_option in
+  # Handling of the options.
+  -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
+    ac_cs_recheck=: ;;
+  --version | --versio | --versi | --vers | --ver | --ve | --v | -V )
+    $as_echo "$ac_cs_version"; exit ;;
+  --debug | --debu | --deb | --de | --d | -d )
+    debug=: ;;
+  --file | --fil | --fi | --f )
+    $ac_shift
+    case $ac_optarg in
+    *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;;
+    esac
+    CONFIG_FILES="$CONFIG_FILES '$ac_optarg'"
+    ac_need_defaults=false;;
+  --header | --heade | --head | --hea )
+    $ac_shift
+    case $ac_optarg in
+    *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;;
+    esac
+    CONFIG_HEADERS="$CONFIG_HEADERS '$ac_optarg'"
+    ac_need_defaults=false;;
+  --he | --h)
+    # Conflict between --help and --header
+    { $as_echo "$as_me: error: ambiguous option: $1
+Try \`$0 --help' for more information." >&2
+   { (exit 1); exit 1; }; };;
+  --help | --hel | -h )
+    $as_echo "$ac_cs_usage"; exit ;;
+  -q | -quiet | --quiet | --quie | --qui | --qu | --q \
+  | -silent | --silent | --silen | --sile | --sil | --si | --s)
+    ac_cs_silent=: ;;
+
+  # This is an error.
+  -*) { $as_echo "$as_me: error: unrecognized option: $1
+Try \`$0 --help' for more information." >&2
+   { (exit 1); exit 1; }; } ;;
+
+  *) ac_config_targets="$ac_config_targets $1"
+     ac_need_defaults=false ;;
+
+  esac
+  shift
+done
+
+ac_configure_extra_args=
+
+if $ac_cs_silent; then
+  exec 6>/dev/null
+  ac_configure_extra_args="$ac_configure_extra_args --silent"
+fi
+
+_ACEOF
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+if \$ac_cs_recheck; then
+  set X '$SHELL' '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion
+  shift
+  \$as_echo "running CONFIG_SHELL=$SHELL \$*" >&6
+  CONFIG_SHELL='$SHELL'
+  export CONFIG_SHELL
+  exec "\$@"
+fi
+
+_ACEOF
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+exec 5>>config.log
+{
+  echo
+  sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX
+## Running $as_me. ##
+_ASBOX
+  $as_echo "$ac_log"
+} >&5
+
+_ACEOF
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+#
+# INIT-COMMANDS
+#
+
+
+_ACEOF
+
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+
+# Handling of arguments.
+for ac_config_target in $ac_config_targets
+do
+  case $ac_config_target in
+    "config.h") CONFIG_HEADERS="$CONFIG_HEADERS config.h" ;;
+    "default-1") CONFIG_COMMANDS="$CONFIG_COMMANDS default-1" ;;
+    "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;;
+    "rdoff/Makefile") CONFIG_FILES="$CONFIG_FILES rdoff/Makefile" ;;
+    "doc/Makefile") CONFIG_FILES="$CONFIG_FILES doc/Makefile" ;;
+
+  *) { { $as_echo "$as_me:$LINENO: error: invalid argument: $ac_config_target" >&5
+$as_echo "$as_me: error: invalid argument: $ac_config_target" >&2;}
+   { (exit 1); exit 1; }; };;
+  esac
+done
+
+
+# If the user did not use the arguments to specify the items to instantiate,
+# then the envvar interface is used.  Set only those that are not.
+# We use the long form for the default assignment because of an extremely
+# bizarre bug on SunOS 4.1.3.
+if $ac_need_defaults; then
+  test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files
+  test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers
+  test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands
+fi
+
+# Have a temporary directory for convenience.  Make it in the build tree
+# simply because there is no reason against having it here, and in addition,
+# creating and moving files from /tmp can sometimes cause problems.
+# Hook for its removal unless debugging.
+# Note that there is a small window in which the directory will not be cleaned:
+# after its creation but before its name has been assigned to `$tmp'.
+$debug ||
+{
+  tmp=
+  trap 'exit_status=$?
+  { test -z "$tmp" || test ! -d "$tmp" || rm -fr "$tmp"; } && exit $exit_status
+' 0
+  trap '{ (exit 1); exit 1; }' 1 2 13 15
+}
+# Create a (secure) tmp directory for tmp files.
+
+{
+  tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` &&
+  test -n "$tmp" && test -d "$tmp"
+}  ||
+{
+  tmp=./conf$$-$RANDOM
+  (umask 077 && mkdir "$tmp")
+} ||
+{
+   $as_echo "$as_me: cannot create a temporary directory in ." >&2
+   { (exit 1); exit 1; }
+}
+
+# Set up the scripts for CONFIG_FILES section.
+# No need to generate them if there are no CONFIG_FILES.
+# This happens for instance with `./config.status config.h'.
+if test -n "$CONFIG_FILES"; then
+
+
+ac_cr='\r'
+ac_cs_awk_cr=`$AWK 'BEGIN { print "a\rb" }' </dev/null 2>/dev/null`
+if test "$ac_cs_awk_cr" = "a${ac_cr}b"; then
+  ac_cs_awk_cr='\\r'
+else
+  ac_cs_awk_cr=$ac_cr
+fi
+
+echo 'BEGIN {' >"$tmp/subs1.awk" &&
+_ACEOF
+
+
+{
+  echo "cat >conf$$subs.awk <<_ACEOF" &&
+  echo "$ac_subst_vars" | sed 's/.*/&!$&$ac_delim/' &&
+  echo "_ACEOF"
+} >conf$$subs.sh ||
+  { { $as_echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5
+$as_echo "$as_me: error: could not make $CONFIG_STATUS" >&2;}
+   { (exit 1); exit 1; }; }
+ac_delim_num=`echo "$ac_subst_vars" | grep -c '$'`
+ac_delim='%!_!# '
+for ac_last_try in false false false false false :; do
+  . ./conf$$subs.sh ||
+    { { $as_echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5
+$as_echo "$as_me: error: could not make $CONFIG_STATUS" >&2;}
+   { (exit 1); exit 1; }; }
+
+  ac_delim_n=`sed -n "s/.*$ac_delim\$/X/p" conf$$subs.awk | grep -c X`
+  if test $ac_delim_n = $ac_delim_num; then
+    break
+  elif $ac_last_try; then
+    { { $as_echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5
+$as_echo "$as_me: error: could not make $CONFIG_STATUS" >&2;}
+   { (exit 1); exit 1; }; }
+  else
+    ac_delim="$ac_delim!$ac_delim _$ac_delim!! "
+  fi
+done
+rm -f conf$$subs.sh
+
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+cat >>"\$tmp/subs1.awk" <<\\_ACAWK &&
+_ACEOF
+sed -n '
+h
+s/^/S["/; s/!.*/"]=/
+p
+g
+s/^[^!]*!//
+:repl
+t repl
+s/'"$ac_delim"'$//
+t delim
+:nl
+h
+s/\(.\{148\}\).*/\1/
+t more1
+s/["\\]/\\&/g; s/^/"/; s/$/\\n"\\/
+p
+n
+b repl
+:more1
+s/["\\]/\\&/g; s/^/"/; s/$/"\\/
+p
+g
+s/.\{148\}//
+t nl
+:delim
+h
+s/\(.\{148\}\).*/\1/
+t more2
+s/["\\]/\\&/g; s/^/"/; s/$/"/
+p
+b
+:more2
+s/["\\]/\\&/g; s/^/"/; s/$/"\\/
+p
+g
+s/.\{148\}//
+t delim
+' <conf$$subs.awk | sed '
+/^[^""]/{
+  N
+  s/\n//
+}
+' >>$CONFIG_STATUS || ac_write_fail=1
+rm -f conf$$subs.awk
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+_ACAWK
+cat >>"\$tmp/subs1.awk" <<_ACAWK &&
+  for (key in S) S_is_set[key] = 1
+  FS = "\a"
+
+}
+{
+  line = $ 0
+  nfields = split(line, field, "@")
+  substed = 0
+  len = length(field[1])
+  for (i = 2; i < nfields; i++) {
+    key = field[i]
+    keylen = length(key)
+    if (S_is_set[key]) {
+      value = S[key]
+      line = substr(line, 1, len) "" value "" substr(line, len + keylen + 3)
+      len += length(value) + length(field[++i])
+      substed = 1
+    } else
+      len += 1 + keylen
+  }
+
+  print line
+}
+
+_ACAWK
+_ACEOF
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+if sed "s/$ac_cr//" < /dev/null > /dev/null 2>&1; then
+  sed "s/$ac_cr\$//; s/$ac_cr/$ac_cs_awk_cr/g"
+else
+  cat
+fi < "$tmp/subs1.awk" > "$tmp/subs.awk" \
+  || { { $as_echo "$as_me:$LINENO: error: could not setup config files machinery" >&5
+$as_echo "$as_me: error: could not setup config files machinery" >&2;}
+   { (exit 1); exit 1; }; }
+_ACEOF
+
+# VPATH may cause trouble with some makes, so we remove $(srcdir),
+# ${srcdir} and @srcdir@ from VPATH if srcdir is ".", strip leading and
+# trailing colons and then remove the whole line if VPATH becomes empty
+# (actually we leave an empty line to preserve line numbers).
+if test "x$srcdir" = x.; then
+  ac_vpsub='/^[         ]*VPATH[        ]*=/{
+s/:*\$(srcdir):*/:/
+s/:*\${srcdir}:*/:/
+s/:*@srcdir@:*/:/
+s/^\([^=]*=[    ]*\):*/\1/
+s/:*$//
+s/^[^=]*=[      ]*$//
+}'
+fi
+
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+fi # test -n "$CONFIG_FILES"
+
+# Set up the scripts for CONFIG_HEADERS section.
+# No need to generate them if there are no CONFIG_HEADERS.
+# This happens for instance with `./config.status Makefile'.
+if test -n "$CONFIG_HEADERS"; then
+cat >"$tmp/defines.awk" <<\_ACAWK ||
+BEGIN {
+_ACEOF
+
+# Transform confdefs.h into an awk script `defines.awk', embedded as
+# here-document in config.status, that substitutes the proper values into
+# config.h.in to produce config.h.
+
+# Create a delimiter string that does not exist in confdefs.h, to ease
+# handling of long lines.
+ac_delim='%!_!# '
+for ac_last_try in false false :; do
+  ac_t=`sed -n "/$ac_delim/p" confdefs.h`
+  if test -z "$ac_t"; then
+    break
+  elif $ac_last_try; then
+    { { $as_echo "$as_me:$LINENO: error: could not make $CONFIG_HEADERS" >&5
+$as_echo "$as_me: error: could not make $CONFIG_HEADERS" >&2;}
+   { (exit 1); exit 1; }; }
+  else
+    ac_delim="$ac_delim!$ac_delim _$ac_delim!! "
+  fi
+done
+
+# For the awk script, D is an array of macro values keyed by name,
+# likewise P contains macro parameters if any.  Preserve backslash
+# newline sequences.
+
+ac_word_re=[_$as_cr_Letters][_$as_cr_alnum]*
+sed -n '
+s/.\{148\}/&'"$ac_delim"'/g
+t rset
+:rset
+s/^[    ]*#[    ]*define[       ][      ]*/ /
+t def
+d
+:def
+s/\\$//
+t bsnl
+s/["\\]/\\&/g
+s/^ \('"$ac_word_re"'\)\(([^()]*)\)[    ]*\(.*\)/P["\1"]="\2"\
+D["\1"]=" \3"/p
+s/^ \('"$ac_word_re"'\)[        ]*\(.*\)/D["\1"]=" \2"/p
+d
+:bsnl
+s/["\\]/\\&/g
+s/^ \('"$ac_word_re"'\)\(([^()]*)\)[    ]*\(.*\)/P["\1"]="\2"\
+D["\1"]=" \3\\\\\\n"\\/p
+t cont
+s/^ \('"$ac_word_re"'\)[        ]*\(.*\)/D["\1"]=" \2\\\\\\n"\\/p
+t cont
+d
+:cont
+n
+s/.\{148\}/&'"$ac_delim"'/g
+t clear
+:clear
+s/\\$//
+t bsnlc
+s/["\\]/\\&/g; s/^/"/; s/$/"/p
+d
+:bsnlc
+s/["\\]/\\&/g; s/^/"/; s/$/\\\\\\n"\\/p
+b cont
+' <confdefs.h | sed '
+s/'"$ac_delim"'/"\\\
+"/g' >>$CONFIG_STATUS || ac_write_fail=1
+
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+  for (key in D) D_is_set[key] = 1
+  FS = "\a"
+}
+/^[\t ]*#[\t ]*(define|undef)[\t ]+$ac_word_re([\t (]|\$)/ {
+  line = \$ 0
+  split(line, arg, " ")
+  if (arg[1] == "#") {
+    defundef = arg[2]
+    mac1 = arg[3]
+  } else {
+    defundef = substr(arg[1], 2)
+    mac1 = arg[2]
+  }
+  split(mac1, mac2, "(") #)
+  macro = mac2[1]
+  prefix = substr(line, 1, index(line, defundef) - 1)
+  if (D_is_set[macro]) {
+    # Preserve the white space surrounding the "#".
+    print prefix "define", macro P[macro] D[macro]
+    next
+  } else {
+    # Replace #undef with comments.  This is necessary, for example,
+    # in the case of _POSIX_SOURCE, which is predefined and required
+    # on some systems where configure will not decide to define it.
+    if (defundef == "undef") {
+      print "/*", prefix defundef, macro, "*/"
+      next
+    }
+  }
+}
+{ print }
+_ACAWK
+_ACEOF
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+  { { $as_echo "$as_me:$LINENO: error: could not setup config headers machinery" >&5
+$as_echo "$as_me: error: could not setup config headers machinery" >&2;}
+   { (exit 1); exit 1; }; }
+fi # test -n "$CONFIG_HEADERS"
+
+
+eval set X "  :F $CONFIG_FILES  :H $CONFIG_HEADERS    :C $CONFIG_COMMANDS"
+shift
+for ac_tag
+do
+  case $ac_tag in
+  :[FHLC]) ac_mode=$ac_tag; continue;;
+  esac
+  case $ac_mode$ac_tag in
+  :[FHL]*:*);;
+  :L* | :C*:*) { { $as_echo "$as_me:$LINENO: error: invalid tag $ac_tag" >&5
+$as_echo "$as_me: error: invalid tag $ac_tag" >&2;}
+   { (exit 1); exit 1; }; };;
+  :[FH]-) ac_tag=-:-;;
+  :[FH]*) ac_tag=$ac_tag:$ac_tag.in;;
+  esac
+  ac_save_IFS=$IFS
+  IFS=:
+  set x $ac_tag
+  IFS=$ac_save_IFS
+  shift
+  ac_file=$1
+  shift
+
+  case $ac_mode in
+  :L) ac_source=$1;;
+  :[FH])
+    ac_file_inputs=
+    for ac_f
+    do
+      case $ac_f in
+      -) ac_f="$tmp/stdin";;
+      *) # Look for the file first in the build tree, then in the source tree
+        # (if the path is not absolute).  The absolute path cannot be DOS-style,
+        # because $ac_f cannot contain `:'.
+        test -f "$ac_f" ||
+          case $ac_f in
+          [\\/$]*) false;;
+          *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";;
+          esac ||
+          { { $as_echo "$as_me:$LINENO: error: cannot find input file: $ac_f" >&5
+$as_echo "$as_me: error: cannot find input file: $ac_f" >&2;}
+   { (exit 1); exit 1; }; };;
+      esac
+      case $ac_f in *\'*) ac_f=`$as_echo "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac
+      ac_file_inputs="$ac_file_inputs '$ac_f'"
+    done
+
+    # Let's still pretend it is `configure' which instantiates (i.e., don't
+    # use $as_me), people would be surprised to read:
+    #    /* config.h.  Generated by config.status.  */
+    configure_input='Generated from '`
+         $as_echo "$*" | sed 's|^[^:]*/||;s|:[^:]*/|, |g'
+       `' by configure.'
+    if test x"$ac_file" != x-; then
+      configure_input="$ac_file.  $configure_input"
+      { $as_echo "$as_me:$LINENO: creating $ac_file" >&5
+$as_echo "$as_me: creating $ac_file" >&6;}
+    fi
+    # Neutralize special characters interpreted by sed in replacement strings.
+    case $configure_input in #(
+    *\&* | *\|* | *\\* )
+       ac_sed_conf_input=`$as_echo "$configure_input" |
+       sed 's/[\\\\&|]/\\\\&/g'`;; #(
+    *) ac_sed_conf_input=$configure_input;;
+    esac
+
+    case $ac_tag in
+    *:-:* | *:-) cat >"$tmp/stdin" \
+      || { { $as_echo "$as_me:$LINENO: error: could not create $ac_file" >&5
+$as_echo "$as_me: error: could not create $ac_file" >&2;}
+   { (exit 1); exit 1; }; } ;;
+    esac
+    ;;
+  esac
+
+  ac_dir=`$as_dirname -- "$ac_file" ||
+$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+        X"$ac_file" : 'X\(//\)[^/]' \| \
+        X"$ac_file" : 'X\(//\)$' \| \
+        X"$ac_file" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X"$ac_file" |
+    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+           s//\1/
+           q
+         }
+         /^X\(\/\/\)[^/].*/{
+           s//\1/
+           q
+         }
+         /^X\(\/\/\)$/{
+           s//\1/
+           q
+         }
+         /^X\(\/\).*/{
+           s//\1/
+           q
+         }
+         s/.*/./; q'`
+  { as_dir="$ac_dir"
+  case $as_dir in #(
+  -*) as_dir=./$as_dir;;
+  esac
+  test -d "$as_dir" || { $as_mkdir_p && mkdir -p "$as_dir"; } || {
+    as_dirs=
+    while :; do
+      case $as_dir in #(
+      *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'(
+      *) as_qdir=$as_dir;;
+      esac
+      as_dirs="'$as_qdir' $as_dirs"
+      as_dir=`$as_dirname -- "$as_dir" ||
+$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+        X"$as_dir" : 'X\(//\)[^/]' \| \
+        X"$as_dir" : 'X\(//\)$' \| \
+        X"$as_dir" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X"$as_dir" |
+    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+           s//\1/
+           q
+         }
+         /^X\(\/\/\)[^/].*/{
+           s//\1/
+           q
+         }
+         /^X\(\/\/\)$/{
+           s//\1/
+           q
+         }
+         /^X\(\/\).*/{
+           s//\1/
+           q
+         }
+         s/.*/./; q'`
+      test -d "$as_dir" && break
+    done
+    test -z "$as_dirs" || eval "mkdir $as_dirs"
+  } || test -d "$as_dir" || { { $as_echo "$as_me:$LINENO: error: cannot create directory $as_dir" >&5
+$as_echo "$as_me: error: cannot create directory $as_dir" >&2;}
+   { (exit 1); exit 1; }; }; }
+  ac_builddir=.
+
+case "$ac_dir" in
+.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;;
+*)
+  ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'`
+  # A ".." for each directory in $ac_dir_suffix.
+  ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'`
+  case $ac_top_builddir_sub in
+  "") ac_top_builddir_sub=. ac_top_build_prefix= ;;
+  *)  ac_top_build_prefix=$ac_top_builddir_sub/ ;;
+  esac ;;
+esac
+ac_abs_top_builddir=$ac_pwd
+ac_abs_builddir=$ac_pwd$ac_dir_suffix
+# for backward compatibility:
+ac_top_builddir=$ac_top_build_prefix
+
+case $srcdir in
+  .)  # We are building in place.
+    ac_srcdir=.
+    ac_top_srcdir=$ac_top_builddir_sub
+    ac_abs_top_srcdir=$ac_pwd ;;
+  [\\/]* | ?:[\\/]* )  # Absolute name.
+    ac_srcdir=$srcdir$ac_dir_suffix;
+    ac_top_srcdir=$srcdir
+    ac_abs_top_srcdir=$srcdir ;;
+  *) # Relative name.
+    ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix
+    ac_top_srcdir=$ac_top_build_prefix$srcdir
+    ac_abs_top_srcdir=$ac_pwd/$srcdir ;;
+esac
+ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix
+
+
+  case $ac_mode in
+  :F)
+  #
+  # CONFIG_FILE
+  #
+
+  case $INSTALL in
+  [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;;
+  *) ac_INSTALL=$ac_top_build_prefix$INSTALL ;;
+  esac
+_ACEOF
+
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+# If the template does not know about datarootdir, expand it.
+# FIXME: This hack should be removed a few years after 2.60.
+ac_datarootdir_hack=; ac_datarootdir_seen=
+
+ac_sed_dataroot='
+/datarootdir/ {
+  p
+  q
+}
+/@datadir@/p
+/@docdir@/p
+/@infodir@/p
+/@localedir@/p
+/@mandir@/p
+'
+case `eval "sed -n \"\$ac_sed_dataroot\" $ac_file_inputs"` in
+*datarootdir*) ac_datarootdir_seen=yes;;
+*@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*)
+  { $as_echo "$as_me:$LINENO: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5
+$as_echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;}
+_ACEOF
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+  ac_datarootdir_hack='
+  s&@datadir@&$datadir&g
+  s&@docdir@&$docdir&g
+  s&@infodir@&$infodir&g
+  s&@localedir@&$localedir&g
+  s&@mandir@&$mandir&g
+    s&\\\${datarootdir}&$datarootdir&g' ;;
+esac
+_ACEOF
+
+# Neutralize VPATH when `$srcdir' = `.'.
+# Shell code in configure.ac might set extrasub.
+# FIXME: do we really want to maintain this feature?
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+ac_sed_extra="$ac_vpsub
+$extrasub
+_ACEOF
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+:t
+/@[a-zA-Z_][a-zA-Z_0-9]*@/!b
+s|@configure_input@|$ac_sed_conf_input|;t t
+s&@top_builddir@&$ac_top_builddir_sub&;t t
+s&@top_build_prefix@&$ac_top_build_prefix&;t t
+s&@srcdir@&$ac_srcdir&;t t
+s&@abs_srcdir@&$ac_abs_srcdir&;t t
+s&@top_srcdir@&$ac_top_srcdir&;t t
+s&@abs_top_srcdir@&$ac_abs_top_srcdir&;t t
+s&@builddir@&$ac_builddir&;t t
+s&@abs_builddir@&$ac_abs_builddir&;t t
+s&@abs_top_builddir@&$ac_abs_top_builddir&;t t
+s&@INSTALL@&$ac_INSTALL&;t t
+$ac_datarootdir_hack
+"
+eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$tmp/subs.awk" >$tmp/out \
+  || { { $as_echo "$as_me:$LINENO: error: could not create $ac_file" >&5
+$as_echo "$as_me: error: could not create $ac_file" >&2;}
+   { (exit 1); exit 1; }; }
+
+test -z "$ac_datarootdir_hack$ac_datarootdir_seen" &&
+  { ac_out=`sed -n '/\${datarootdir}/p' "$tmp/out"`; test -n "$ac_out"; } &&
+  { ac_out=`sed -n '/^[         ]*datarootdir[  ]*:*=/p' "$tmp/out"`; test -z "$ac_out"; } &&
+  { $as_echo "$as_me:$LINENO: WARNING: $ac_file contains a reference to the variable \`datarootdir'
+which seems to be undefined.  Please make sure it is defined." >&5
+$as_echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir'
+which seems to be undefined.  Please make sure it is defined." >&2;}
+
+  rm -f "$tmp/stdin"
+  case $ac_file in
+  -) cat "$tmp/out" && rm -f "$tmp/out";;
+  *) rm -f "$ac_file" && mv "$tmp/out" "$ac_file";;
+  esac \
+  || { { $as_echo "$as_me:$LINENO: error: could not create $ac_file" >&5
+$as_echo "$as_me: error: could not create $ac_file" >&2;}
+   { (exit 1); exit 1; }; }
+ ;;
+  :H)
+  #
+  # CONFIG_HEADER
+  #
+  if test x"$ac_file" != x-; then
+    {
+      $as_echo "/* $configure_input  */" \
+      && eval '$AWK -f "$tmp/defines.awk"' "$ac_file_inputs"
+    } >"$tmp/config.h" \
+      || { { $as_echo "$as_me:$LINENO: error: could not create $ac_file" >&5
+$as_echo "$as_me: error: could not create $ac_file" >&2;}
+   { (exit 1); exit 1; }; }
+    if diff "$ac_file" "$tmp/config.h" >/dev/null 2>&1; then
+      { $as_echo "$as_me:$LINENO: $ac_file is unchanged" >&5
+$as_echo "$as_me: $ac_file is unchanged" >&6;}
+    else
+      rm -f "$ac_file"
+      mv "$tmp/config.h" "$ac_file" \
+       || { { $as_echo "$as_me:$LINENO: error: could not create $ac_file" >&5
+$as_echo "$as_me: error: could not create $ac_file" >&2;}
+   { (exit 1); exit 1; }; }
+    fi
+  else
+    $as_echo "/* $configure_input  */" \
+      && eval '$AWK -f "$tmp/defines.awk"' "$ac_file_inputs" \
+      || { { $as_echo "$as_me:$LINENO: error: could not create -" >&5
+$as_echo "$as_me: error: could not create -" >&2;}
+   { (exit 1); exit 1; }; }
+  fi
+ ;;
+
+  :C)  { $as_echo "$as_me:$LINENO: executing $ac_file commands" >&5
+$as_echo "$as_me: executing $ac_file commands" >&6;}
+ ;;
+  esac
+
+
+  case $ac_file$ac_mode in
+    "default-1":C) mkdir -p output ;;
+
+  esac
+done # for ac_tag
+
+
+{ (exit 0); exit 0; }
+_ACEOF
+chmod +x $CONFIG_STATUS
+ac_clean_files=$ac_clean_files_save
+
+test $ac_write_fail = 0 ||
+  { { $as_echo "$as_me:$LINENO: error: write failure creating $CONFIG_STATUS" >&5
+$as_echo "$as_me: error: write failure creating $CONFIG_STATUS" >&2;}
+   { (exit 1); exit 1; }; }
+
+
+# configure is writing to config.log, and then calls config.status.
+# config.status does its own redirection, appending to config.log.
+# Unfortunately, on DOS this fails, as config.log is still kept open
+# by configure, so config.status won't be able to write to it; its
+# output is simply discarded.  So we exec the FD to /dev/null,
+# effectively closing config.log, so it can be properly (re)opened and
+# appended to by config.status.  When coming back to configure, we
+# need to make the FD available again.
+if test "$no_create" != yes; then
+  ac_cs_success=:
+  ac_config_status_args=
+  test "$silent" = yes &&
+    ac_config_status_args="$ac_config_status_args --quiet"
+  exec 5>/dev/null
+  $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false
+  exec 5>>config.log
+  # Use ||, not &&, to avoid exiting from the if with $? = 1, which
+  # would make configure fail if this is the last instruction.
+  $ac_cs_success || { (exit 1); exit 1; }
+fi
+if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then
+  { $as_echo "$as_me:$LINENO: WARNING: unrecognized options: $ac_unrecognized_opts" >&5
+$as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;}
+fi
+
diff --git a/configure.in b/configure.in
new file mode 100644 (file)
index 0000000..c23bac1
--- /dev/null
@@ -0,0 +1,156 @@
+dnl Process this file with autoconf 2.61 or later to produce
+dnl a configure script.
+AC_PREREQ(2.61)
+AC_INIT(config.h.in)
+AC_CONFIG_HEADERS(config.h)
+
+dnl Check for broken VPATH handling on older NetBSD makes.
+AC_DEFUN(AC_PROG_MAKE_VPATHOK,
+[AC_MSG_CHECKING(whether ${MAKE-make} has sane VPATH handling)
+set dummy ${MAKE-make}; ac_make=`echo "[$]2" | sed 'y%./+-%__p_%'`
+AC_CACHE_VAL(ac_cv_prog_make_vpathok,
+[mkdir conftestdir
+cat > conftestdir/conftestmake <<\EOF
+VPATH = ..
+conftestfoo: conftestbar
+       @echo ac_make2temp=ok
+conftestbar: conftestbaz
+       @echo ac_maketemp=broken
+       @touch conftestbar
+EOF
+echo > conftestbaz # these two lines need to be...
+echo > conftestbar # ... in this order not the other
+changequote(, )dnl
+unset ac_maketemp
+unset ac_make2temp
+# GNU make sometimes prints "make[1]: Entering...", which would confuse us.
+eval `cd conftestdir; ${MAKE-make} -f conftestmake 2>/dev/null | grep temp=`
+changequote([, ])dnl
+if test -n "$ac_maketemp"; then
+  ac_cv_prog_make_vpathok=no
+else
+  if test -n "$ac_make2temp"; then
+    ac_cv_prog_make_vpathok=yes
+  else
+    ac_cv_prog_make_vpathok=no
+  fi
+fi
+rm -rf conftestdir
+rm -f conftestbar conftestbaz])dnl
+if test $ac_cv_prog_make_vpathok = yes; then
+  AC_MSG_RESULT(yes)
+else
+  AC_MSG_RESULT(no)
+fi
+])
+
+AC_PREFIX_PROGRAM(nasm)
+
+dnl Checks for programs.
+dnl Consider AC_USE_SYSTEM_EXTENSIONS if autoconf 2.61 is OK in the future
+AC_USE_SYSTEM_EXTENSIONS
+AC_PROG_CC
+AC_PROG_LN_S
+AC_PROG_MAKE_SET
+if test -f nasm.c; then
+  # we're building in the source dir, so we don't need this check at all
+  ac_cv_prog_make_vpathok=yes
+else
+  AC_PROG_MAKE_VPATHOK
+fi
+AC_PROG_INSTALL
+
+dnl If we have gcc, add appropriate options
+PA_ADD_CFLAGS([-W])
+PA_ADD_CFLAGS([-Wall])
+PA_ADD_CFLAGS([-std=c99])
+PA_ADD_CFLAGS([-pedantic])
+
+dnl Look for programs...
+AC_CHECK_PROGS(NROFF,    nroff,    echo)
+AC_CHECK_PROGS(ACRODIST, acrodist, false)
+AC_CHECK_PROGS(PS2PDF,   ps2pdf,   false)
+AC_CHECK_PROGS(PSTOPDF,  pstopdf,  false)
+
+dnl Checks for header files.
+AC_HEADER_STDC
+if test $ac_cv_header_stdc = no; then
+  AC_MSG_ERROR([NASM requires ANSI C header files to compile])
+fi
+
+AC_CHECK_HEADERS(limits.h)
+if test $ac_cv_header_limits_h = no; then
+  AC_MSG_ERROR([NASM requires '<limits.h>' to compile])
+fi
+
+dnl Check for <inttypes.h> or add a substitute version
+AC_CHECK_HEADERS(inttypes.h, , CFLAGS="$CFLAGS -I\$(top_srcdir)/inttypes")
+
+dnl The standard header for str*casecmp is <strings.h>
+AC_CHECK_HEADERS(strings.h)
+
+dnl Look for <stdbool.h>
+AC_CHECK_HEADERS(stdbool.h)
+
+dnl Checks for typedefs, structures, and compiler characteristics.
+AC_C_CONST
+AC_C_INLINE
+AC_C_RESTRICT
+AC_TYPE_SIZE_T
+PA_WORKING_BOOL
+AC_C_BIGENDIAN(AC_DEFINE(WORDS_BIGENDIAN),AC_DEFINE(WORDS_LITTLEENDIAN))
+AH_TEMPLATE(WORDS_BIGENDIAN,
+[Define to 1 if your processor stores words with the most significant
+byte first (like Motorola and SPARC, unlike Intel and VAX).])
+AH_TEMPLATE(WORDS_LITTLEENDIAN,
+[Define to 1 if your processor stores words with the least significant
+byte first (like Intel and VAX, unlike Motorola and SPARC).])
+
+dnl Checks for library functions.
+AC_SUBST(XOBJS)
+
+AC_CHECK_FUNCS(strcspn, ,
+  AC_MSG_ERROR([NASM requires ANSI C (specifically, "strcspn")]))
+
+AC_CHECK_FUNCS(strspn, ,
+  AC_MSG_ERROR([NASM requires ANSI C (specifically, "strspn")]))
+
+missing=true
+AC_CHECK_FUNCS([vsnprintf _vsnprintf], missing=false)
+if $missing; then
+   XOBJS="$XOBJS lib/vsnprintf.o"
+fi
+
+missing=true
+AC_CHECK_FUNCS([snprintf _snprintf], missing=false)
+if $missing; then
+   XOBJS="$XOBJS lib/snprintf.o"
+fi
+
+AC_CHECK_FUNCS(strcasecmp stricmp)
+AC_CHECK_FUNCS(strncasecmp strnicmp)
+AC_CHECK_FUNCS(strsep)
+AC_CHECK_FUNCS(strlcpy)
+
+AC_CHECK_FUNCS(getuid)
+AC_CHECK_FUNCS(getgid)
+
+dnl Check for functions that might not be declared in the headers for
+dnl various idiotic reasons (mostly because of library authors
+dnl abusing the meaning of __STRICT_ANSI__)
+AC_CHECK_DECLS(strcasecmp)
+AC_CHECK_DECLS(stricmp)
+AC_CHECK_DECLS(strncasecmp)
+AC_CHECK_DECLS(strnicmp)
+AC_CHECK_DECLS(strsep)
+AC_CHECK_DECLS(strlcpy)
+
+if test $ac_cv_prog_make_vpathok = no; then
+  echo Copying generated srcs into build directory to compensate for VPATH breakage
+  for file in macros.c insnsa.c insnsd.c insnsn.c insnsi.h version.h version.mac; do
+    if test ! -f $file; then cp -p ${srcdir}/${file} .; fi
+  done
+fi
+
+AC_OUTPUT_COMMANDS([mkdir -p output])
+AC_OUTPUT(Makefile rdoff/Makefile doc/Makefile)
diff --git a/contrib/VSrules/nasm.README b/contrib/VSrules/nasm.README
new file mode 100644 (file)
index 0000000..8fbf155
--- /dev/null
@@ -0,0 +1,16 @@
+                       Visual Studio 2008 NASM integration
+
+
+In order to use nasm seamlessly in your VS2k8, follow the steps below. 
+
+1. First install nasm by running its installer
+2. copy nasm.rules to c:\Program Files\Microsoft Visual Studio 2008\VC\VCProjectDefaults
+3. Start Visual Studio 2008
+4. go to Tools->Options->VC++ Directories
+5. click on Show Directories for Executables
+6. add C:\Program Files\NASM to the list of paths
+7. Open a solution that you want to use NASM with
+8. Right click on the project name and select Custom Build Rules
+9. Check the box next to the NASM line
+10. Add any .asm files to the project
+11. click on build to test
diff --git a/contrib/VSrules/nasm.rules b/contrib/VSrules/nasm.rules
new file mode 100644 (file)
index 0000000..79b4fb1
--- /dev/null
@@ -0,0 +1,79 @@
+<?xml version="1.0" encoding="utf-8"?>
+<VisualStudioToolFile
+       Name="Netwide Macro Assembler"
+       Version="8.00"
+       >
+       <Rules>
+               <CustomBuildRule
+                       Name="NASM"
+                       DisplayName="Netwide Macro Assembler"
+                       CommandLine="nasm.exe -f win32 -Xvc [AllOptions] [AdditionalOptions] [Inputs]"
+                       Outputs="[$ObjectFileName]"
+                       FileExtensions="*.asm"
+                       ExecutionDescription="Assembling..."
+                       >
+                       <Properties>
+                               <StringProperty
+                                       Name="ObjectFileName"
+                                       DisplayName="Object File Name"
+                                       PropertyPageName="Object File"
+                                       Description="Specifies the name of the output object file.     (-o [file])"
+                                       HelpURL="http://www.nasm.us/doc/"
+                                       Switch="-o &quot;[value]&quot;"
+                                       DefaultValue="$(IntDir)\$(InputName).obj"
+                               />
+                               <StringProperty
+                                       Name="PreprocessorDefinitions"
+                                       DisplayName="Preprocessor Definitions"
+                                       Description="Defines a text macro with the given name.     (-D[symbol])"
+                                       HelpURL="http://www.nasm.us/doc/"
+                                       Switch="-D[value]"
+                                       Delimited="false"
+                                       Inheritable="true"
+                               />
+                               <StringProperty
+                                       Name="UndefinePreprocessorDefinitions"
+                                       DisplayName="Undefine Preprocessor Definitions"
+                                       Description="Undefines a text macro with the given name.     (-U[symbol])"
+                                       HelpURL="http://www.nasm.us/doc/"
+                                       Switch="-U[value]"
+                                       Delimited="false"
+                                       Inheritable="true"
+                               />
+                               <StringProperty
+                                       Name="AssembledCodeListingFile"
+                                       DisplayName="Assembled Code Listing File"
+                                       PropertyPageName="Listing File"
+                                       Description="Generates an assembled code listing file.     (-l [file])"
+                                       HelpURL="http://www.nasm.us/doc/"
+                                       Switch="-l &quot;[value]&quot;"
+                               />
+                               <StringProperty
+                                       Name="IncludePaths"
+                                       DisplayName="Include Paths"
+                                       Description="Sets path for include file.     (-I[path])"
+                                       HelpURL="http://www.nasm.us/doc/"
+                                       Switch="-I[value]"
+                                       Delimited="false"
+                                       Inheritable="true"
+                               />
+                               <BooleanProperty
+                                       Name="TreatWarningsAsErrors"
+                                       DisplayName="Treat Warnings As Errors"
+                                       Description="Returns an error code if warnings are generated.     (-Werror)"
+                                       HelpURL="http://www.nasm.us/doc/"
+                                       Switch="-Werror"
+                               />
+                               <BooleanProperty
+                                       Name="GenerateDebugInformation"
+                                       DisplayName="Generate Debug Information"
+                                       Description="Generates Debug Information.     (-g)"
+                                       HelpURL="http://www.nasm.us/doc/"
+                                       Switch="-g"
+                                       DefaultValue="true"
+                               />
+                               
+                       </Properties>
+               </CustomBuildRule>
+       </Rules>
+</VisualStudioToolFile>
diff --git a/crc64.c b/crc64.c
new file mode 100644 (file)
index 0000000..d93ea0c
--- /dev/null
+++ b/crc64.c
@@ -0,0 +1,188 @@
+/* ----------------------------------------------------------------------- *
+ *   
+ *   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.
+ *
+ * ----------------------------------------------------------------------- */
+
+#include "compiler.h"
+#include "nasmlib.h"
+
+static const uint64_t crc64_tab[256] = {
+    UINT64_C(0x0000000000000000), UINT64_C(0x7ad870c830358979),
+    UINT64_C(0xf5b0e190606b12f2), UINT64_C(0x8f689158505e9b8b),
+    UINT64_C(0xc038e5739841b68f), UINT64_C(0xbae095bba8743ff6),
+    UINT64_C(0x358804e3f82aa47d), UINT64_C(0x4f50742bc81f2d04),
+    UINT64_C(0xab28ecb46814fe75), UINT64_C(0xd1f09c7c5821770c),
+    UINT64_C(0x5e980d24087fec87), UINT64_C(0x24407dec384a65fe),
+    UINT64_C(0x6b1009c7f05548fa), UINT64_C(0x11c8790fc060c183),
+    UINT64_C(0x9ea0e857903e5a08), UINT64_C(0xe478989fa00bd371),
+    UINT64_C(0x7d08ff3b88be6f81), UINT64_C(0x07d08ff3b88be6f8),
+    UINT64_C(0x88b81eabe8d57d73), UINT64_C(0xf2606e63d8e0f40a),
+    UINT64_C(0xbd301a4810ffd90e), UINT64_C(0xc7e86a8020ca5077),
+    UINT64_C(0x4880fbd87094cbfc), UINT64_C(0x32588b1040a14285),
+    UINT64_C(0xd620138fe0aa91f4), UINT64_C(0xacf86347d09f188d),
+    UINT64_C(0x2390f21f80c18306), UINT64_C(0x594882d7b0f40a7f),
+    UINT64_C(0x1618f6fc78eb277b), UINT64_C(0x6cc0863448deae02),
+    UINT64_C(0xe3a8176c18803589), UINT64_C(0x997067a428b5bcf0),
+    UINT64_C(0xfa11fe77117cdf02), UINT64_C(0x80c98ebf2149567b),
+    UINT64_C(0x0fa11fe77117cdf0), UINT64_C(0x75796f2f41224489),
+    UINT64_C(0x3a291b04893d698d), UINT64_C(0x40f16bccb908e0f4),
+    UINT64_C(0xcf99fa94e9567b7f), UINT64_C(0xb5418a5cd963f206),
+    UINT64_C(0x513912c379682177), UINT64_C(0x2be1620b495da80e),
+    UINT64_C(0xa489f35319033385), UINT64_C(0xde51839b2936bafc),
+    UINT64_C(0x9101f7b0e12997f8), UINT64_C(0xebd98778d11c1e81),
+    UINT64_C(0x64b116208142850a), UINT64_C(0x1e6966e8b1770c73),
+    UINT64_C(0x8719014c99c2b083), UINT64_C(0xfdc17184a9f739fa),
+    UINT64_C(0x72a9e0dcf9a9a271), UINT64_C(0x08719014c99c2b08),
+    UINT64_C(0x4721e43f0183060c), UINT64_C(0x3df994f731b68f75),
+    UINT64_C(0xb29105af61e814fe), UINT64_C(0xc849756751dd9d87),
+    UINT64_C(0x2c31edf8f1d64ef6), UINT64_C(0x56e99d30c1e3c78f),
+    UINT64_C(0xd9810c6891bd5c04), UINT64_C(0xa3597ca0a188d57d),
+    UINT64_C(0xec09088b6997f879), UINT64_C(0x96d1784359a27100),
+    UINT64_C(0x19b9e91b09fcea8b), UINT64_C(0x636199d339c963f2),
+    UINT64_C(0xdf7adabd7a6e2d6f), UINT64_C(0xa5a2aa754a5ba416),
+    UINT64_C(0x2aca3b2d1a053f9d), UINT64_C(0x50124be52a30b6e4),
+    UINT64_C(0x1f423fcee22f9be0), UINT64_C(0x659a4f06d21a1299),
+    UINT64_C(0xeaf2de5e82448912), UINT64_C(0x902aae96b271006b),
+    UINT64_C(0x74523609127ad31a), UINT64_C(0x0e8a46c1224f5a63),
+    UINT64_C(0x81e2d7997211c1e8), UINT64_C(0xfb3aa75142244891),
+    UINT64_C(0xb46ad37a8a3b6595), UINT64_C(0xceb2a3b2ba0eecec),
+    UINT64_C(0x41da32eaea507767), UINT64_C(0x3b024222da65fe1e),
+    UINT64_C(0xa2722586f2d042ee), UINT64_C(0xd8aa554ec2e5cb97),
+    UINT64_C(0x57c2c41692bb501c), UINT64_C(0x2d1ab4dea28ed965),
+    UINT64_C(0x624ac0f56a91f461), UINT64_C(0x1892b03d5aa47d18),
+    UINT64_C(0x97fa21650afae693), UINT64_C(0xed2251ad3acf6fea),
+    UINT64_C(0x095ac9329ac4bc9b), UINT64_C(0x7382b9faaaf135e2),
+    UINT64_C(0xfcea28a2faafae69), UINT64_C(0x8632586aca9a2710),
+    UINT64_C(0xc9622c4102850a14), UINT64_C(0xb3ba5c8932b0836d),
+    UINT64_C(0x3cd2cdd162ee18e6), UINT64_C(0x460abd1952db919f),
+    UINT64_C(0x256b24ca6b12f26d), UINT64_C(0x5fb354025b277b14),
+    UINT64_C(0xd0dbc55a0b79e09f), UINT64_C(0xaa03b5923b4c69e6),
+    UINT64_C(0xe553c1b9f35344e2), UINT64_C(0x9f8bb171c366cd9b),
+    UINT64_C(0x10e3202993385610), UINT64_C(0x6a3b50e1a30ddf69),
+    UINT64_C(0x8e43c87e03060c18), UINT64_C(0xf49bb8b633338561),
+    UINT64_C(0x7bf329ee636d1eea), UINT64_C(0x012b592653589793),
+    UINT64_C(0x4e7b2d0d9b47ba97), UINT64_C(0x34a35dc5ab7233ee),
+    UINT64_C(0xbbcbcc9dfb2ca865), UINT64_C(0xc113bc55cb19211c),
+    UINT64_C(0x5863dbf1e3ac9dec), UINT64_C(0x22bbab39d3991495),
+    UINT64_C(0xadd33a6183c78f1e), UINT64_C(0xd70b4aa9b3f20667),
+    UINT64_C(0x985b3e827bed2b63), UINT64_C(0xe2834e4a4bd8a21a),
+    UINT64_C(0x6debdf121b863991), UINT64_C(0x1733afda2bb3b0e8),
+    UINT64_C(0xf34b37458bb86399), UINT64_C(0x8993478dbb8deae0),
+    UINT64_C(0x06fbd6d5ebd3716b), UINT64_C(0x7c23a61ddbe6f812),
+    UINT64_C(0x3373d23613f9d516), UINT64_C(0x49aba2fe23cc5c6f),
+    UINT64_C(0xc6c333a67392c7e4), UINT64_C(0xbc1b436e43a74e9d),
+    UINT64_C(0x95ac9329ac4bc9b5), UINT64_C(0xef74e3e19c7e40cc),
+    UINT64_C(0x601c72b9cc20db47), UINT64_C(0x1ac40271fc15523e),
+    UINT64_C(0x5594765a340a7f3a), UINT64_C(0x2f4c0692043ff643),
+    UINT64_C(0xa02497ca54616dc8), UINT64_C(0xdafce7026454e4b1),
+    UINT64_C(0x3e847f9dc45f37c0), UINT64_C(0x445c0f55f46abeb9),
+    UINT64_C(0xcb349e0da4342532), UINT64_C(0xb1eceec59401ac4b),
+    UINT64_C(0xfebc9aee5c1e814f), UINT64_C(0x8464ea266c2b0836),
+    UINT64_C(0x0b0c7b7e3c7593bd), UINT64_C(0x71d40bb60c401ac4),
+    UINT64_C(0xe8a46c1224f5a634), UINT64_C(0x927c1cda14c02f4d),
+    UINT64_C(0x1d148d82449eb4c6), UINT64_C(0x67ccfd4a74ab3dbf),
+    UINT64_C(0x289c8961bcb410bb), UINT64_C(0x5244f9a98c8199c2),
+    UINT64_C(0xdd2c68f1dcdf0249), UINT64_C(0xa7f41839ecea8b30),
+    UINT64_C(0x438c80a64ce15841), UINT64_C(0x3954f06e7cd4d138),
+    UINT64_C(0xb63c61362c8a4ab3), UINT64_C(0xcce411fe1cbfc3ca),
+    UINT64_C(0x83b465d5d4a0eece), UINT64_C(0xf96c151de49567b7),
+    UINT64_C(0x76048445b4cbfc3c), UINT64_C(0x0cdcf48d84fe7545),
+    UINT64_C(0x6fbd6d5ebd3716b7), UINT64_C(0x15651d968d029fce),
+    UINT64_C(0x9a0d8ccedd5c0445), UINT64_C(0xe0d5fc06ed698d3c),
+    UINT64_C(0xaf85882d2576a038), UINT64_C(0xd55df8e515432941),
+    UINT64_C(0x5a3569bd451db2ca), UINT64_C(0x20ed197575283bb3),
+    UINT64_C(0xc49581ead523e8c2), UINT64_C(0xbe4df122e51661bb),
+    UINT64_C(0x3125607ab548fa30), UINT64_C(0x4bfd10b2857d7349),
+    UINT64_C(0x04ad64994d625e4d), UINT64_C(0x7e7514517d57d734),
+    UINT64_C(0xf11d85092d094cbf), UINT64_C(0x8bc5f5c11d3cc5c6),
+    UINT64_C(0x12b5926535897936), UINT64_C(0x686de2ad05bcf04f),
+    UINT64_C(0xe70573f555e26bc4), UINT64_C(0x9ddd033d65d7e2bd),
+    UINT64_C(0xd28d7716adc8cfb9), UINT64_C(0xa85507de9dfd46c0),
+    UINT64_C(0x273d9686cda3dd4b), UINT64_C(0x5de5e64efd965432),
+    UINT64_C(0xb99d7ed15d9d8743), UINT64_C(0xc3450e196da80e3a),
+    UINT64_C(0x4c2d9f413df695b1), UINT64_C(0x36f5ef890dc31cc8),
+    UINT64_C(0x79a59ba2c5dc31cc), UINT64_C(0x037deb6af5e9b8b5),
+    UINT64_C(0x8c157a32a5b7233e), UINT64_C(0xf6cd0afa9582aa47),
+    UINT64_C(0x4ad64994d625e4da), UINT64_C(0x300e395ce6106da3),
+    UINT64_C(0xbf66a804b64ef628), UINT64_C(0xc5bed8cc867b7f51),
+    UINT64_C(0x8aeeace74e645255), UINT64_C(0xf036dc2f7e51db2c),
+    UINT64_C(0x7f5e4d772e0f40a7), UINT64_C(0x05863dbf1e3ac9de),
+    UINT64_C(0xe1fea520be311aaf), UINT64_C(0x9b26d5e88e0493d6),
+    UINT64_C(0x144e44b0de5a085d), UINT64_C(0x6e963478ee6f8124),
+    UINT64_C(0x21c640532670ac20), UINT64_C(0x5b1e309b16452559),
+    UINT64_C(0xd476a1c3461bbed2), UINT64_C(0xaeaed10b762e37ab),
+    UINT64_C(0x37deb6af5e9b8b5b), UINT64_C(0x4d06c6676eae0222),
+    UINT64_C(0xc26e573f3ef099a9), UINT64_C(0xb8b627f70ec510d0),
+    UINT64_C(0xf7e653dcc6da3dd4), UINT64_C(0x8d3e2314f6efb4ad),
+    UINT64_C(0x0256b24ca6b12f26), UINT64_C(0x788ec2849684a65f),
+    UINT64_C(0x9cf65a1b368f752e), UINT64_C(0xe62e2ad306bafc57),
+    UINT64_C(0x6946bb8b56e467dc), UINT64_C(0x139ecb4366d1eea5),
+    UINT64_C(0x5ccebf68aecec3a1), UINT64_C(0x2616cfa09efb4ad8),
+    UINT64_C(0xa97e5ef8cea5d153), UINT64_C(0xd3a62e30fe90582a),
+    UINT64_C(0xb0c7b7e3c7593bd8), UINT64_C(0xca1fc72bf76cb2a1),
+    UINT64_C(0x45775673a732292a), UINT64_C(0x3faf26bb9707a053),
+    UINT64_C(0x70ff52905f188d57), UINT64_C(0x0a2722586f2d042e),
+    UINT64_C(0x854fb3003f739fa5), UINT64_C(0xff97c3c80f4616dc),
+    UINT64_C(0x1bef5b57af4dc5ad), UINT64_C(0x61372b9f9f784cd4),
+    UINT64_C(0xee5fbac7cf26d75f), UINT64_C(0x9487ca0fff135e26),
+    UINT64_C(0xdbd7be24370c7322), UINT64_C(0xa10fceec0739fa5b),
+    UINT64_C(0x2e675fb4576761d0), UINT64_C(0x54bf2f7c6752e8a9),
+    UINT64_C(0xcdcf48d84fe75459), UINT64_C(0xb71738107fd2dd20),
+    UINT64_C(0x387fa9482f8c46ab), UINT64_C(0x42a7d9801fb9cfd2),
+    UINT64_C(0x0df7adabd7a6e2d6), UINT64_C(0x772fdd63e7936baf),
+    UINT64_C(0xf8474c3bb7cdf024), UINT64_C(0x829f3cf387f8795d),
+    UINT64_C(0x66e7a46c27f3aa2c), UINT64_C(0x1c3fd4a417c62355),
+    UINT64_C(0x935745fc4798b8de), UINT64_C(0xe98f353477ad31a7),
+    UINT64_C(0xa6df411fbfb21ca3), UINT64_C(0xdc0731d78f8795da),
+    UINT64_C(0x536fa08fdfd90e51), UINT64_C(0x29b7d047efec8728),
+};
+
+uint64_t crc64(uint64_t crc, const char *str)
+{
+    uint8_t c;
+
+    while ((c = *str++) != 0) {
+       crc = crc64_tab[(uint8_t)crc ^ c] ^ (crc >> 8);
+    }
+
+    return crc;
+}
+
+uint64_t crc64i(uint64_t crc, const char *str)
+{
+    uint8_t c;
+
+    while ((c = *str++) != 0) {
+       crc = crc64_tab[(uint8_t)crc ^ nasm_tolower(c)] ^ (crc >> 8);
+    }
+
+    return crc;
+}
diff --git a/directives.c b/directives.c
new file mode 100644 (file)
index 0000000..1e1d302
--- /dev/null
@@ -0,0 +1,127 @@
+/*
+ * This file is generated from directives.dat
+ * by directives.pl; do not edit.
+ */
+
+#include "compiler.h"
+#include <string.h>
+#include "nasm.h"
+#include "hashtbl.h"
+#include "directives.h"
+
+const char * const directives[24] = {
+    NULL,
+    "absolute",
+    "bits",
+    "common",
+    "cpu",
+    "debug",
+    "default",
+    "extern",
+    "float",
+    "global",
+    "list",
+    "section",
+    "segment",
+    "warning",
+    "export",
+    "group",
+    "import",
+    "library",
+    "map",
+    "module",
+    "org",
+    "osabi",
+    "safeseh",
+    "uppercase"
+};
+
+enum directives find_directive(const char *token)
+{
+#define UNUSED 16383
+    static const int16_t hash1[32] = {
+        0,
+        UNUSED,
+        UNUSED,
+        UNUSED,
+        UNUSED,
+        0,
+        0,
+        10,
+        0,
+        9,
+        UNUSED,
+        UNUSED,
+        UNUSED,
+        0,
+        0,
+        UNUSED,
+        UNUSED,
+        UNUSED,
+        UNUSED,
+        0,
+        UNUSED,
+        22,
+        16,
+        UNUSED,
+        -14,
+        13,
+        UNUSED,
+        UNUSED,
+        20,
+        -17,
+        13,
+        3,
+    };
+    static const int16_t hash2[32] = {
+        0,
+        UNUSED,
+        UNUSED,
+        UNUSED,
+        0,
+        UNUSED,
+        6,
+        0,
+        19,
+        2,
+        0,
+        28,
+        0,
+        0,
+        3,
+        UNUSED,
+        UNUSED,
+        UNUSED,
+        8,
+        21,
+        9,
+        1,
+        UNUSED,
+        UNUSED,
+        UNUSED,
+        UNUSED,
+        1,
+        5,
+        UNUSED,
+        UNUSED,
+        -4,
+        UNUSED,
+    };
+    uint32_t k1, k2;
+    uint64_t crc;
+    uint16_t ix;
+
+    crc = crc64i(UINT64_C(0x076259c3e291c26c), token);
+    k1 = (uint32_t)crc;
+    k2 = (uint32_t)(crc >> 32);
+
+    ix = hash1[k1 & 0x1f] + hash2[k2 & 0x1f];
+    if (ix >= 23)
+        return D_NONE;
+
+    ix++;
+    if (nasm_stricmp(token, directives[ix]))
+        return D_NONE;
+
+    return ix;
+}
diff --git a/directives.dat b/directives.dat
new file mode 100644 (file)
index 0000000..b08d387
--- /dev/null
@@ -0,0 +1,62 @@
+;; --------------------------------------------------------------------------
+;;
+;;   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 (including backend-specific ones)
+;;
+
+; --- Global directives
+absolute
+bits
+common
+cpu
+debug
+default
+extern
+float
+global
+list
+section
+segment
+warning
+
+; --- Format-specific directives
+export                         ; outcoff, outobj
+group                          ; outobj
+import                         ; outobj
+library                                ; outrdf2
+map                            ; outbin
+module                         ; outrdf2
+org                            ; outbin
+osabi                          ; outelf
+safeseh                                ; outcoff
+uppercase                      ; outieee, outobj
diff --git a/directives.h b/directives.h
new file mode 100644 (file)
index 0000000..97d5325
--- /dev/null
@@ -0,0 +1,39 @@
+/*
+ * This         file is generated from directives.dat
+ * by directives.pl; do not edit.
+ */
+
+#ifndef NASM_DIRECTIVES_H
+#define NASM_DIRECTIVES_H
+
+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,
+    D_EXPORT,
+    D_GROUP,
+    D_IMPORT,
+    D_LIBRARY,
+    D_MAP,
+    D_MODULE,
+    D_ORG,
+    D_OSABI,
+    D_SAFESEH,
+    D_UPPERCASE
+};
+
+extern const char * const directives[24];
+enum directives find_directive(const char *token);
+
+#endif /* NASM_DIRECTIVES_H */
diff --git a/directives.pl b/directives.pl
new file mode 100755 (executable)
index 0000000..d8bc6e8
--- /dev/null
@@ -0,0 +1,171 @@
+#!/usr/bin/perl
+## --------------------------------------------------------------------------
+##
+##   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.
+##
+## --------------------------------------------------------------------------
+
+#
+# Generate a perfect hash for directive parsing
+#
+# Usage: directives.pl directives.dat directives.c directives.h
+#
+
+require 'phash.ph';
+
+my($output, $directives_dat, $outfile) = @ARGV;
+
+@directives = ();
+
+open(DD, "< ${directives_dat}\0")
+    or die "$0: cannot open: ${directives_dat}: $!\n";
+while (defined($line = <DD>)) {
+    chomp $line;
+    if ($line =~ /^\s*([[:alnum:]]+)\s*(|[\;\#].*)$/) {
+       push(@directives, $1);
+    }
+}
+close(DD);
+
+if ($output eq 'h') {
+    open(H, "> ${outfile}\0")
+       or die "$0: cannot create: ${outfile}: $!\n";
+
+    print H "/*\n";
+    print H " * This    file is generated from directives.dat\n";
+    print H " * by directives.pl; do not edit.\n";
+    print H " */\n";
+    print H "\n";
+
+    print H "#ifndef NASM_DIRECTIVES_H\n";
+    print H "#define NASM_DIRECTIVES_H\n";
+    print H "\n";
+
+    print H "enum directives {\n";
+    print H "    D_NONE";
+    foreach $d (@directives) {
+       print H ",\n    D_\U$d";
+    }
+    print H "\n};\n\n";
+    printf H "extern const char * const directives[%d];\n",
+        scalar(@directives)+1;
+    print H "enum directives find_directive(const char *token);\n\n";
+    print H "#endif /* NASM_DIRECTIVES_H */\n";
+} elsif ($output eq 'c') {
+    %directive = ();
+    $n = 0;
+    foreach $d (@directives) {
+       if (exists($directive{$d})) {
+           die "$0: $directives_dat: duplicate directive: $d\n";
+       }
+       $directive{$d} = $n++;  # This is zero-based, unlike the enum!
+    }
+
+    @hashinfo = gen_perfect_hash(\%directive);
+    if (!defined(@hashinfo)) {
+       die "$0: no hash found\n";
+    }
+
+    # Paranoia...
+    verify_hash_table(\%directive, \@hashinfo);
+
+    ($n, $sv, $g) = @hashinfo;
+    $sv2 = $sv+2;
+
+    die if ($n & ($n-1));
+
+    open(C, "> ${outfile}\0")
+       or die "$0: cannot create: ${directives_c}: $!\n";
+
+    print C "/*\n";
+    print C " * This file is generated from directives.dat\n";
+    print C " * by directives.pl; do not edit.\n";
+    print C " */\n";
+    print C "\n";
+
+    print C "#include \"compiler.h\"\n";
+    print C "#include <string.h>\n";
+    print C "#include \"nasm.h\"\n";
+    print C "#include \"hashtbl.h\"\n";
+    print C "#include \"directives.h\"\n";
+    print C "\n";
+
+    printf C "const char * const directives[%d] = {\n",
+        scalar(@directives)+1;
+    print C "    NULL";
+    foreach $d (@directives) {
+       print C ",\n    \"$d\"";
+    }
+    print C "\n};\n\n";
+
+    print C "enum directives find_directive(const char *token)\n";
+    print C "{\n";
+
+    # Put a large value in unused slots.  This makes it extremely unlikely
+    # that any combination that involves unused slot will pass the range test.
+    # This speeds up rejection of unrecognized tokens, i.e. identifiers.
+    print C "#define UNUSED 16383\n";
+
+    print C "    static const int16_t hash1[$n] = {\n";
+    for ($i = 0; $i < $n; $i++) {
+       my $h = ${$g}[$i*2+0];
+       print C "        ", defined($h) ? $h : 'UNUSED', ",\n";
+    }
+    print C "    };\n";
+
+    print C "    static const int16_t hash2[$n] = {\n";
+    for ($i = 0; $i < $n; $i++) {
+       my $h = ${$g}[$i*2+1];
+       print C "        ", defined($h) ? $h : 'UNUSED', ",\n";
+    }
+    print C "    };\n";
+
+    print C  "    uint32_t k1, k2;\n";
+    print C  "    uint64_t crc;\n";
+    # For correct overflow behavior, "ix" should be unsigned of the same
+    # width as the hash arrays.
+    print C  "    uint16_t ix;\n";
+    print C  "\n";
+    printf C "    crc = crc64i(UINT64_C(0x%08x%08x), token);\n",
+       $$sv[0], $$sv[1];
+    print C  "    k1 = (uint32_t)crc;\n";
+    print C  "    k2 = (uint32_t)(crc >> 32);\n";
+    print C  "\n";
+    printf C "    ix = hash1[k1 & 0x%x] + hash2[k2 & 0x%x];\n", $n-1, $n-1;
+    printf C "    if (ix >= %d)\n", scalar(@directives);
+    print C  "        return D_NONE;\n";
+    print C  "\n";
+    print C  "    ix++;\n";    # Account for D_NONE
+    print C  "    if (nasm_stricmp(token, directives[ix]))\n";
+    print C  "        return D_NONE;\n";
+    print C  "\n";
+    print C  "    return ix;\n";
+    print C  "}\n";
+}
diff --git a/disasm.c b/disasm.c
new file mode 100644 (file)
index 0000000..561851a
--- /dev/null
+++ b/disasm.c
@@ -0,0 +1,1559 @@
+/* ----------------------------------------------------------------------- *
+ *   
+ *   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.
+ *
+ * ----------------------------------------------------------------------- */
+
+/* 
+ * disasm.c   where all the _work_ gets done in the Netwide Disassembler
+ */
+
+#include "compiler.h"
+
+#include <stdio.h>
+#include <string.h>
+#include <limits.h>
+#include <inttypes.h>
+
+#include "nasm.h"
+#include "disasm.h"
+#include "sync.h"
+#include "insns.h"
+#include "tables.h"
+#include "regdis.h"
+
+/*
+ * Flags that go into the `segment' field of `insn' structures
+ * during disassembly.
+ */
+#define SEG_RELATIVE     1
+#define SEG_32BIT        2
+#define SEG_RMREG        4
+#define SEG_DISP8        8
+#define SEG_DISP16      16
+#define SEG_DISP32      32
+#define SEG_NODISP      64
+#define SEG_SIGNED     128
+#define SEG_64BIT      256
+
+/*
+ * Prefix information
+ */
+struct prefix_info {
+    uint8_t osize;             /* Operand size */
+    uint8_t asize;             /* Address size */
+    uint8_t osp;               /* Operand size prefix present */
+    uint8_t asp;               /* Address size prefix present */
+    uint8_t rep;               /* Rep prefix present */
+    uint8_t seg;               /* Segment override prefix present */
+    uint8_t wait;              /* WAIT "prefix" present */
+    uint8_t lock;              /* Lock prefix present */
+    uint8_t vex[3];            /* VEX prefix present */
+    uint8_t vex_c;             /* VEX "class" (VEX, XOP, ...) */
+    uint8_t vex_m;             /* VEX.M field */
+    uint8_t vex_v;
+    uint8_t vex_lp;            /* VEX.LP fields */
+    uint32_t rex;              /* REX prefix present */
+};
+
+#define getu8(x) (*(uint8_t *)(x))
+#if X86_MEMORY
+/* Littleendian CPU which can handle unaligned references */
+#define getu16(x) (*(uint16_t *)(x))
+#define getu32(x) (*(uint32_t *)(x))
+#define getu64(x) (*(uint64_t *)(x))
+#else
+static uint16_t getu16(uint8_t *data)
+{
+    return (uint16_t)data[0] + ((uint16_t)data[1] << 8);
+}
+static uint32_t getu32(uint8_t *data)
+{
+    return (uint32_t)getu16(data) + ((uint32_t)getu16(data+2) << 16);
+}
+static uint64_t getu64(uint8_t *data)
+{
+    return (uint64_t)getu32(data) + ((uint64_t)getu32(data+4) << 32);
+}
+#endif
+
+#define gets8(x) ((int8_t)getu8(x))
+#define gets16(x) ((int16_t)getu16(x))
+#define gets32(x) ((int32_t)getu32(x))
+#define gets64(x) ((int64_t)getu64(x))
+
+/* Important: regval must already have been adjusted for rex extensions */
+static enum reg_enum whichreg(opflags_t regflags, int regval, int rex)
+{
+    if (!(regflags & (REGISTER|REGMEM)))
+       return 0;               /* Registers not permissible?! */
+
+    regflags |= REGISTER;
+
+    if (!(REG_AL & ~regflags))
+        return R_AL;
+    if (!(REG_AX & ~regflags))
+        return R_AX;
+    if (!(REG_EAX & ~regflags))
+        return R_EAX;
+    if (!(REG_RAX & ~regflags))
+       return R_RAX;
+    if (!(REG_DL & ~regflags))
+        return R_DL;
+    if (!(REG_DX & ~regflags))
+        return R_DX;
+    if (!(REG_EDX & ~regflags))
+        return R_EDX;
+    if (!(REG_RDX & ~regflags))
+        return R_RDX;
+    if (!(REG_CL & ~regflags))
+        return R_CL;
+    if (!(REG_CX & ~regflags))
+        return R_CX;
+    if (!(REG_ECX & ~regflags))
+        return R_ECX;
+    if (!(REG_RCX & ~regflags))
+        return R_RCX;
+    if (!(FPU0 & ~regflags))
+        return R_ST0;
+    if (!(XMM0 & ~regflags))
+       return R_XMM0;
+    if (!(YMM0 & ~regflags))
+       return R_YMM0;
+    if (!(REG_CS & ~regflags))
+        return (regval == 1) ? R_CS : 0;
+    if (!(REG_DESS & ~regflags))
+        return (regval == 0 || regval == 2
+                || regval == 3 ? nasm_rd_sreg[regval] : 0);
+    if (!(REG_FSGS & ~regflags))
+        return (regval == 4 || regval == 5 ? nasm_rd_sreg[regval] : 0);
+    if (!(REG_SEG67 & ~regflags))
+        return (regval == 6 || regval == 7 ? nasm_rd_sreg[regval] : 0);
+
+    /* All the entries below look up regval in an 16-entry array */
+    if (regval < 0 || regval > 15)
+        return 0;
+
+    if (!(REG8 & ~regflags)) {
+       if (rex & (REX_P|REX_NH))
+           return nasm_rd_reg8_rex[regval];
+       else
+           return nasm_rd_reg8[regval];
+    }
+    if (!(REG16 & ~regflags))
+        return nasm_rd_reg16[regval];
+    if (!(REG32 & ~regflags))
+        return nasm_rd_reg32[regval];
+    if (!(REG64 & ~regflags))
+        return nasm_rd_reg64[regval];
+    if (!(REG_SREG & ~regflags))
+        return nasm_rd_sreg[regval & 7]; /* Ignore REX */
+    if (!(REG_CREG & ~regflags))
+        return nasm_rd_creg[regval];
+    if (!(REG_DREG & ~regflags))
+        return nasm_rd_dreg[regval];
+    if (!(REG_TREG & ~regflags)) {
+       if (regval > 7)
+           return 0;           /* TR registers are ill-defined with rex */
+        return nasm_rd_treg[regval];
+    }
+    if (!(FPUREG & ~regflags))
+        return nasm_rd_fpureg[regval & 7]; /* Ignore REX */
+    if (!(MMXREG & ~regflags))
+        return nasm_rd_mmxreg[regval & 7]; /* Ignore REX */
+    if (!(XMMREG & ~regflags))
+        return nasm_rd_xmmreg[regval];
+    if (!(YMMREG & ~regflags))
+        return nasm_rd_ymmreg[regval];
+
+    return 0;
+}
+
+/*
+ * Process a DREX suffix
+ */
+static uint8_t *do_drex(uint8_t *data, insn *ins)
+{
+    uint8_t drex = *data++;
+    operand *dst = &ins->oprs[ins->drexdst];
+
+    if ((drex & 8) != ((ins->rex & REX_OC) ? 8 : 0))
+       return NULL;    /* OC0 mismatch */
+    ins->rex = (ins->rex & ~7) | (drex & 7);
+
+    dst->segment = SEG_RMREG;
+    dst->basereg = drex >> 4;
+    return data;
+}
+
+
+/*
+ * Process an effective address (ModRM) specification.
+ */
+static uint8_t *do_ea(uint8_t *data, int modrm, int asize,
+                     int segsize, operand * op, insn *ins)
+{
+    int mod, rm, scale, index, base;
+    int rex;
+    uint8_t sib = 0;
+
+    mod = (modrm >> 6) & 03;
+    rm = modrm & 07;
+
+    if (mod != 3 && rm == 4 && asize != 16)
+       sib = *data++;
+
+    if (ins->rex & REX_D) {
+       data = do_drex(data, ins);
+       if (!data)
+           return NULL;
+    }
+    rex = ins->rex;
+
+    if (mod == 3) {             /* pure register version */
+        op->basereg = rm+(rex & REX_B ? 8 : 0);
+        op->segment |= SEG_RMREG;
+        return data;
+    }
+
+    op->disp_size = 0;
+    op->eaflags = 0;
+
+    if (asize == 16) {
+        /*
+         * <mod> specifies the displacement size (none, byte or
+         * word), and <rm> specifies the register combination.
+         * Exception: mod=0,rm=6 does not specify [BP] as one might
+         * expect, but instead specifies [disp16].
+         */
+        op->indexreg = op->basereg = -1;
+        op->scale = 1;          /* always, in 16 bits */
+        switch (rm) {
+        case 0:
+            op->basereg = R_BX;
+            op->indexreg = R_SI;
+            break;
+        case 1:
+            op->basereg = R_BX;
+            op->indexreg = R_DI;
+            break;
+        case 2:
+            op->basereg = R_BP;
+            op->indexreg = R_SI;
+            break;
+        case 3:
+            op->basereg = R_BP;
+            op->indexreg = R_DI;
+            break;
+        case 4:
+            op->basereg = R_SI;
+            break;
+        case 5:
+            op->basereg = R_DI;
+            break;
+        case 6:
+            op->basereg = R_BP;
+            break;
+        case 7:
+            op->basereg = R_BX;
+            break;
+        }
+        if (rm == 6 && mod == 0) {      /* special case */
+            op->basereg = -1;
+            if (segsize != 16)
+                op->disp_size = 16;
+            mod = 2;            /* fake disp16 */
+        }
+        switch (mod) {
+        case 0:
+            op->segment |= SEG_NODISP;
+            break;
+        case 1:
+            op->segment |= SEG_DISP8;
+            op->offset = (int8_t)*data++;
+            break;
+        case 2:
+            op->segment |= SEG_DISP16;
+            op->offset = *data++;
+            op->offset |= ((unsigned)*data++) << 8;
+            break;
+        }
+        return data;
+    } else {
+        /*
+         * Once again, <mod> specifies displacement size (this time
+         * none, byte or *dword*), while <rm> specifies the base
+         * register. Again, [EBP] is missing, replaced by a pure
+         * disp32 (this time that's mod=0,rm=*5*) in 32-bit mode,
+        * and RIP-relative addressing in 64-bit mode.
+        *
+        * However, rm=4
+         * indicates not a single base register, but instead the
+         * presence of a SIB byte...
+         */
+       int a64 = asize == 64;
+
+        op->indexreg = -1;
+
+       if (a64)
+           op->basereg = nasm_rd_reg64[rm | ((rex & REX_B) ? 8 : 0)];
+       else
+           op->basereg = nasm_rd_reg32[rm | ((rex & REX_B) ? 8 : 0)];
+
+        if (rm == 5 && mod == 0) {
+           if (segsize == 64) {
+               op->eaflags |= EAF_REL;
+               op->segment |= SEG_RELATIVE;
+               mod = 2;        /* fake disp32 */
+           }
+
+           if (asize != 64)
+               op->disp_size = asize;
+
+           op->basereg = -1;
+           mod = 2;            /* fake disp32 */
+        }
+
+        if (rm == 4) {          /* process SIB */
+            scale = (sib >> 6) & 03;
+            index = (sib >> 3) & 07;
+            base = sib & 07;
+
+            op->scale = 1 << scale;
+
+           if (index == 4 && !(rex & REX_X))
+               op->indexreg = -1; /* ESP/RSP cannot be an index */
+           else if (a64)
+               op->indexreg = nasm_rd_reg64[index | ((rex & REX_X) ? 8 : 0)];
+           else
+               op->indexreg = nasm_rd_reg32[index | ((rex & REX_X) ? 8 : 0)];
+
+           if (base == 5 && mod == 0) {
+               op->basereg = -1;
+               mod = 2;        /* Fake disp32 */
+           } else if (a64)
+               op->basereg = nasm_rd_reg64[base | ((rex & REX_B) ? 8 : 0)];
+           else
+               op->basereg = nasm_rd_reg32[base | ((rex & REX_B) ? 8 : 0)];
+
+           if (segsize == 16)
+               op->disp_size = 32;
+        }
+
+        switch (mod) {
+        case 0:
+            op->segment |= SEG_NODISP;
+            break;
+        case 1:
+            op->segment |= SEG_DISP8;
+            op->offset = gets8(data);
+           data++;
+            break;
+        case 2:
+            op->segment |= SEG_DISP32;
+            op->offset = gets32(data);
+           data += 4;
+            break;
+        }
+        return data;
+    }
+}
+
+/*
+ * Determine whether the instruction template in t corresponds to the data
+ * stream in data. Return the number of bytes matched if so.
+ */
+#define case4(x) case (x): case (x)+1: case (x)+2: case (x)+3
+
+static int matches(const struct itemplate *t, uint8_t *data,
+                  const struct prefix_info *prefix, int segsize, insn *ins)
+{
+    uint8_t *r = (uint8_t *)(t->code);
+    uint8_t *origdata = data;
+    bool a_used = false, o_used = false;
+    enum prefixes drep = 0;
+    enum prefixes dwait = 0;
+    uint8_t lock = prefix->lock;
+    int osize = prefix->osize;
+    int asize = prefix->asize;
+    int i, c;
+    int op1, op2;
+    struct operand *opx, *opy;
+    uint8_t opex = 0;
+    int s_field_for = -1;      /* No 144/154 series code encountered */
+    bool vex_ok = false;
+    int regmask = (segsize == 64) ? 15 : 7;
+
+    for (i = 0; i < MAX_OPERANDS; i++) {
+       ins->oprs[i].segment = ins->oprs[i].disp_size =
+           (segsize == 64 ? SEG_64BIT : segsize == 32 ? SEG_32BIT : 0);
+    }
+    ins->condition = -1;
+    ins->rex = prefix->rex;
+    memset(ins->prefixes, 0, sizeof ins->prefixes);
+
+    if (t->flags & (segsize == 64 ? IF_NOLONG : IF_LONG))
+        return false;
+
+    if (prefix->rep == 0xF2)
+        drep = P_REPNE;
+    else if (prefix->rep == 0xF3)
+        drep = P_REP;
+
+    dwait = prefix->wait ? P_WAIT : 0;
+
+    while ((c = *r++) != 0) {
+       op1 = (c & 3) + ((opex & 1) << 2);
+       op2 = ((c >> 3) & 3) + ((opex & 2) << 1);
+       opx = &ins->oprs[op1];
+       opy = &ins->oprs[op2];
+       opex = 0;
+
+       switch (c) {
+       case 01:
+       case 02:
+       case 03:
+       case 04:
+            while (c--)
+                if (*r++ != *data++)
+                    return false;
+           break;
+
+       case 05:
+       case 06:
+       case 07:
+           opex = c;
+           break;
+
+       case4(010):
+       {
+            int t = *r++, d = *data++;
+            if (d < t || d > t + 7)
+                return false;
+            else {
+                opx->basereg = (d-t)+
+                   (ins->rex & REX_B ? 8 : 0);
+                opx->segment |= SEG_RMREG;
+            }
+           break;
+       }
+
+       case4(014):
+       case4(0274):
+            opx->offset = (int8_t)*data++;
+            opx->segment |= SEG_SIGNED;
+           break;
+
+       case4(020):
+            opx->offset = *data++;
+           break;
+
+       case4(024):
+            opx->offset = *data++;
+           break;
+
+       case4(030):
+            opx->offset = getu16(data);
+           data += 2;
+           break;
+
+       case4(034):
+           if (osize == 32) {
+               opx->offset = getu32(data);
+               data += 4;
+           } else {
+               opx->offset = getu16(data);
+               data += 2;
+           }
+            if (segsize != asize)
+                opx->disp_size = asize;
+           break;
+
+       case4(040):
+       case4(0254):
+            opx->offset = getu32(data);
+           data += 4;
+           break;
+
+       case4(044):
+           switch (asize) {
+           case 16:
+               opx->offset = getu16(data);
+               data += 2;
+               if (segsize != 16)
+                   opx->disp_size = 16;
+               break;
+           case 32:
+               opx->offset = getu32(data);
+               data += 4;
+               if (segsize == 16)
+                   opx->disp_size = 32;
+               break;
+           case 64:
+               opx->offset = getu64(data);
+               opx->disp_size = 64;
+               data += 8;
+               break;
+           }
+           break;
+
+       case4(050):
+            opx->offset = gets8(data++);
+            opx->segment |= SEG_RELATIVE;
+           break;
+
+       case4(054):
+           opx->offset = getu64(data);
+           data += 8;
+           break;
+
+       case4(060):
+            opx->offset = gets16(data);
+           data += 2;
+            opx->segment |= SEG_RELATIVE;
+            opx->segment &= ~SEG_32BIT;
+           break;
+
+       case4(064):
+            opx->segment |= SEG_RELATIVE;
+           if (osize == 16) {
+               opx->offset = gets16(data);
+               data += 2;
+                opx->segment &= ~(SEG_32BIT|SEG_64BIT);
+           } else if (osize == 32) {
+               opx->offset = gets32(data);
+               data += 4;
+                opx->segment &= ~SEG_64BIT;
+                opx->segment |= SEG_32BIT;
+           }
+            if (segsize != osize) {
+                opx->type =
+                    (opx->type & ~SIZE_MASK)
+                    | ((osize == 16) ? BITS16 : BITS32);
+            }
+           break;
+
+       case4(070):
+            opx->offset = gets32(data);
+           data += 4;
+            opx->segment |= SEG_32BIT | SEG_RELATIVE;
+           break;
+
+       case4(0100):
+       case4(0110):
+       case4(0120):
+       case4(0130):
+       {
+           int modrm = *data++;
+            opx->segment |= SEG_RMREG;
+            data = do_ea(data, modrm, asize, segsize, opy, ins);
+           if (!data)
+               return false;
+            opx->basereg = ((modrm >> 3) & 7) + (ins->rex & REX_R ? 8 : 0);
+           break;
+       }
+
+       case4(0140):
+           if (s_field_for == op1) {
+               opx->offset = gets8(data);
+               data++;
+           } else {
+               opx->offset = getu16(data);
+               data += 2;
+           }
+           break;
+
+       case4(0144):
+       case4(0154):
+           s_field_for = (*data & 0x02) ? op1 : -1;
+           if ((*data++ & ~0x02) != *r++)
+               return false;
+           break;
+
+       case4(0150):
+           if (s_field_for == op1) {
+               opx->offset = gets8(data);
+               data++;
+           } else {
+               opx->offset = getu32(data);
+               data += 4;
+           }
+           break;
+
+       case4(0160):
+           ins->rex |= REX_D;
+           ins->drexdst = op1;
+           break;
+
+       case4(0164):
+           ins->rex |= REX_D|REX_OC;
+           ins->drexdst = op1;
+           break;
+
+       case 0171:
+           data = do_drex(data, ins);
+           if (!data)
+               return false;
+           break;
+
+       case 0172:
+       {
+           uint8_t ximm = *data++;
+           c = *r++;
+           ins->oprs[c >> 3].basereg = (ximm >> 4) & regmask;
+           ins->oprs[c >> 3].segment |= SEG_RMREG;
+           ins->oprs[c & 7].offset = ximm & 15;
+       }
+       break;
+
+       case 0173:
+       {
+           uint8_t ximm = *data++;
+           c = *r++;
+
+           if ((c ^ ximm) & 15)
+               return false;
+
+           ins->oprs[c >> 4].basereg = (ximm >> 4) & regmask;
+           ins->oprs[c >> 4].segment |= SEG_RMREG;
+       }
+       break;
+
+       case 0174:
+       {
+           uint8_t ximm = *data++;
+           c = *r++;
+
+           ins->oprs[c].basereg = (ximm >> 4) & regmask;
+           ins->oprs[c].segment |= SEG_RMREG;
+       }
+       break;
+
+       case4(0200):
+       case4(0204):
+       case4(0210):
+       case4(0214):
+       case4(0220):
+       case4(0224):
+       case4(0230):
+       case4(0234):
+       {
+            int modrm = *data++;
+            if (((modrm >> 3) & 07) != (c & 07))
+                return false;   /* spare field doesn't match up */
+            data = do_ea(data, modrm, asize, segsize, opy, ins);
+           if (!data)
+               return false;
+           break;
+       }
+
+       case4(0260):
+       {
+           int vexm   = *r++;
+           int vexwlp = *r++;
+           ins->rex |= REX_V;
+           if ((prefix->rex & (REX_V|REX_D|REX_P)) != REX_V)
+               return false;
+
+           if ((vexm & 0x1f) != prefix->vex_m)
+               return false;
+
+           switch (vexwlp & 030) {
+           case 000:
+               if (prefix->rex & REX_W)
+                   return false;
+               break;
+           case 010:
+               if (!(prefix->rex & REX_W))
+                   return false;
+               ins->rex &= ~REX_W;
+               break;
+           case 020:           /* VEX.W is a don't care */
+               ins->rex &= ~REX_W;
+               break;
+           case 030:
+               break;
+           }
+
+           if ((vexwlp & 007) != prefix->vex_lp)
+               return false;
+
+           opx->segment |= SEG_RMREG;
+           opx->basereg = prefix->vex_v;
+           vex_ok = true;
+           break;
+       }
+
+       case 0270:
+       {
+           int vexm   = *r++;
+           int vexwlp = *r++;
+           ins->rex |= REX_V;
+           if ((prefix->rex & (REX_V|REX_D|REX_P)) != REX_V)
+               return false;
+
+           if ((vexm & 0x1f) != prefix->vex_m)
+               return false;
+
+           switch (vexwlp & 030) {
+           case 000:
+               if (ins->rex & REX_W)
+                   return false;
+               break;
+           case 010:
+               if (!(ins->rex & REX_W))
+                   return false;
+               break;
+           default:
+               break;          /* Need to do anything special here? */
+           }
+
+           if ((vexwlp & 007) != prefix->vex_lp)
+               return false;
+
+           if (prefix->vex_v != 0)
+               return false;
+
+           vex_ok = true;
+           break;
+       }
+
+       case 0310:
+            if (asize != 16)
+                return false;
+            else
+                a_used = true;
+           break;
+
+       case 0311:
+            if (asize != 32)
+                return false;
+            else
+                a_used = true;
+           break;
+
+       case 0312:
+            if (asize != segsize)
+                return false;
+            else
+                a_used = true;
+           break;
+
+       case 0313:
+           if (asize != 64)
+               return false;
+           else
+               a_used = true;
+           break;
+
+       case 0314:
+           if (prefix->rex & REX_B)
+               return false;
+           break;
+
+       case 0315:
+           if (prefix->rex & REX_X)
+               return false;
+           break;
+
+       case 0316:
+           if (prefix->rex & REX_R)
+               return false;
+           break;
+
+       case 0317:
+           if (prefix->rex & REX_W)
+               return false;
+           break;
+
+       case 0320:
+            if (osize != 16)
+                return false;
+            else
+                o_used = true;
+           break;
+
+       case 0321:
+            if (osize != 32)
+                return false;
+            else
+                o_used = true;
+           break;
+
+       case 0322:
+            if (osize != (segsize == 16) ? 16 : 32)
+                return false;
+            else
+                o_used = true;
+           break;
+
+       case 0323:
+           ins->rex |= REX_W;  /* 64-bit only instruction */
+           osize = 64;
+           o_used = true;
+           break;
+
+       case 0324:
+           if (!(ins->rex & (REX_P|REX_W)) || osize != 64)
+               return false;
+           o_used = true;
+           break;
+
+       case 0325:
+           ins->rex |= REX_NH;
+           break;
+
+       case 0330:
+       {
+            int t = *r++, d = *data++;
+            if (d < t || d > t + 15)
+                return false;
+            else
+                ins->condition = d - t;
+           break;
+       }
+
+       case 0331:
+            if (prefix->rep)
+                return false;
+           break;
+
+       case 0332:
+           if (prefix->rep != 0xF2)
+               return false;
+           drep = 0;
+           break;
+
+       case 0333:
+            if (prefix->rep != 0xF3)
+                return false;
+            drep = 0;
+           break;
+
+       case 0334:
+           if (lock) {
+               ins->rex |= REX_R;
+               lock = 0;
+           }
+           break;
+
+       case 0335:
+            if (drep == P_REP)
+                drep = P_REPE;
+           break;
+
+       case 0336:
+       case 0337:
+           break;
+
+       case 0340:
+           return false;
+
+       case 0341:
+           if (prefix->wait != 0x9B)
+               return false;
+           dwait = 0;
+           break;
+
+       case4(0344):
+           ins->oprs[0].basereg = (*data++ >> 3) & 7;
+           break;
+
+       case 0360:
+           if (prefix->osp || prefix->rep)
+               return false;
+           break;
+
+       case 0361:
+           if (!prefix->osp || prefix->rep)
+               return false;
+           o_used = true;
+           break;
+
+       case 0362:
+           if (prefix->osp || prefix->rep != 0xf2)
+               return false;
+           drep = 0;
+           break;
+
+       case 0363:
+           if (prefix->osp || prefix->rep != 0xf3)
+               return false;
+           drep = 0;
+           break;
+
+       case 0364:
+           if (prefix->osp)
+               return false;
+           break;
+
+       case 0365:
+           if (prefix->asp)
+               return false;
+           break;
+
+       case 0366:
+           if (!prefix->osp)
+               return false;
+           o_used = true;
+           break;
+
+       case 0367:
+           if (!prefix->asp)
+               return false;
+           a_used = true;
+           break;
+
+       default:
+           return false;       /* Unknown code */
+       }
+    }
+
+    if (!vex_ok && (ins->rex & REX_V))
+       return false;
+
+    /* REX cannot be combined with DREX or VEX */
+    if ((ins->rex & (REX_D|REX_V)) && (prefix->rex & REX_P))
+       return false;
+
+    /*
+     * Check for unused rep or a/o prefixes.
+     */
+    for (i = 0; i < t->operands; i++) {
+       if (ins->oprs[i].segment != SEG_RMREG)
+           a_used = true;
+    }
+
+    if (lock) {
+       if (ins->prefixes[PPS_LREP])
+           return false;
+       ins->prefixes[PPS_LREP] = P_LOCK;
+    }
+    if (drep) {
+       if (ins->prefixes[PPS_LREP])
+           return false;
+        ins->prefixes[PPS_LREP] = drep;
+    }
+    ins->prefixes[PPS_WAIT] = dwait;
+    if (!o_used) {
+       if (osize != ((segsize == 16) ? 16 : 32)) {
+           enum prefixes pfx = 0;
+
+           switch (osize) {
+           case 16:
+               pfx = P_O16;
+               break;
+           case 32:
+               pfx = P_O32;
+               break;
+           case 64:
+               pfx = P_O64;
+               break;
+           }
+
+           if (ins->prefixes[PPS_OSIZE])
+               return false;
+           ins->prefixes[PPS_OSIZE] = pfx;
+       }
+    }
+    if (!a_used && asize != segsize) {
+       if (ins->prefixes[PPS_ASIZE])
+           return false;
+        ins->prefixes[PPS_ASIZE] = asize == 16 ? P_A16 : P_A32;
+    }
+
+    /* Fix: check for redundant REX prefixes */
+
+    return data - origdata;
+}
+
+/* Condition names for disassembly, sorted by x86 code */
+static const char * const condition_name[16] = {
+    "o", "no", "c", "nc", "z", "nz", "na", "a",
+    "s", "ns", "pe", "po", "l", "nl", "ng", "g"
+};
+
+int32_t disasm(uint8_t *data, char *output, int outbufsize, int segsize,
+            int32_t offset, int autosync, uint32_t prefer)
+{
+    const struct itemplate * const *p, * const *best_p;
+    const struct disasm_index *ix;
+    uint8_t *dp;
+    int length, best_length = 0;
+    char *segover;
+    int i, slen, colon, n;
+    uint8_t *origdata;
+    int works;
+    insn tmp_ins, ins;
+    uint32_t goodness, best;
+    int best_pref;
+    struct prefix_info prefix;
+    bool end_prefix;
+
+    memset(&ins, 0, sizeof ins);
+
+    /*
+     * Scan for prefixes.
+     */
+    memset(&prefix, 0, sizeof prefix);
+    prefix.asize = segsize;
+    prefix.osize = (segsize == 64) ? 32 : segsize;
+    segover = NULL;
+    origdata = data;
+
+    ix = itable;
+
+    end_prefix = false;
+    while (!end_prefix) {
+       switch (*data) {
+       case 0xF2:
+       case 0xF3:
+            prefix.rep = *data++;
+           break;
+
+       case 0x9B:
+           prefix.wait = *data++;
+           break;
+
+       case 0xF0:
+            prefix.lock = *data++;
+           break;
+
+       case 0x2E:
+           segover = "cs", prefix.seg = *data++;
+           break;
+       case 0x36:
+           segover = "ss", prefix.seg = *data++;
+           break;
+       case 0x3E:
+           segover = "ds", prefix.seg = *data++;
+           break;
+       case 0x26:
+           segover = "es", prefix.seg = *data++;
+           break;
+       case 0x64:
+           segover = "fs", prefix.seg = *data++;
+           break;
+       case 0x65:
+           segover = "gs", prefix.seg = *data++;
+           break;
+
+       case 0x66:
+           prefix.osize = (segsize == 16) ? 32 : 16;
+           prefix.osp = *data++;
+           break;
+       case 0x67:
+           prefix.asize = (segsize == 32) ? 16 : 32;
+           prefix.asp = *data++;
+           break;
+
+       case 0xC4:
+       case 0xC5:
+           if (segsize == 64 || (data[1] & 0xc0) == 0xc0) {
+               prefix.vex[0] = *data++;
+               prefix.vex[1] = *data++;
+
+               prefix.rex = REX_V;
+               prefix.vex_c = RV_VEX;
+
+               if (prefix.vex[0] == 0xc4) {
+                   prefix.vex[2] = *data++;
+                   prefix.rex |= (~prefix.vex[1] >> 5) & 7; /* REX_RXB */
+                   prefix.rex |= (prefix.vex[2] >> (7-3)) & REX_W;
+                   prefix.vex_m = prefix.vex[1] & 0x1f;
+                   prefix.vex_v = (~prefix.vex[2] >> 3) & 15;
+                   prefix.vex_lp = prefix.vex[2] & 7;
+               } else {
+                   prefix.rex |= (~prefix.vex[1] >> (7-2)) & REX_R;
+                   prefix.vex_m = 1;
+                   prefix.vex_v = (~prefix.vex[1] >> 3) & 15;
+                   prefix.vex_lp = prefix.vex[1] & 7;
+               }
+
+               ix = itable_vex[RV_VEX][prefix.vex_m][prefix.vex_lp];
+           }
+           end_prefix = true;
+           break;
+
+       case 0x8F:
+           if ((data[1] & 030) != 0 &&
+               (segsize == 64 || (data[1] & 0xc0) == 0xc0)) {
+               prefix.vex[0] = *data++;
+               prefix.vex[1] = *data++;
+               prefix.vex[2] = *data++;
+
+               prefix.rex = REX_V;
+               prefix.vex_c = RV_XOP;
+
+               prefix.rex |= (~prefix.vex[1] >> 5) & 7; /* REX_RXB */
+               prefix.rex |= (prefix.vex[2] >> (7-3)) & REX_W;
+               prefix.vex_m = prefix.vex[1] & 0x1f;
+               prefix.vex_v = (~prefix.vex[2] >> 3) & 15;
+               prefix.vex_lp = prefix.vex[2] & 7;
+
+               ix = itable_vex[RV_XOP][prefix.vex_m][prefix.vex_lp];
+           }
+           end_prefix = true;
+           break;
+
+       case REX_P + 0x0:
+       case REX_P + 0x1:
+       case REX_P + 0x2:
+       case REX_P + 0x3:
+       case REX_P + 0x4:
+       case REX_P + 0x5:
+       case REX_P + 0x6:
+       case REX_P + 0x7:
+       case REX_P + 0x8:
+       case REX_P + 0x9:
+       case REX_P + 0xA:
+       case REX_P + 0xB:
+       case REX_P + 0xC:
+       case REX_P + 0xD:
+       case REX_P + 0xE:
+       case REX_P + 0xF:
+           if (segsize == 64) {
+               prefix.rex = *data++;
+               if (prefix.rex & REX_W)
+                   prefix.osize = 64;
+           }
+           end_prefix = true;
+           break;
+
+       default:
+           end_prefix = true;
+           break;
+       }
+    }
+
+    best = -1;                 /* Worst possible */
+    best_p = NULL;
+    best_pref = INT_MAX;
+
+    if (!ix)
+       return 0;               /* No instruction table at all... */
+
+    dp = data;
+    ix += *dp++;
+    while (ix->n == -1) {
+       ix = (const struct disasm_index *)ix->p + *dp++;
+    }
+
+    p = (const struct itemplate * const *)ix->p;
+    for (n = ix->n; n; n--, p++) {
+        if ((length = matches(*p, data, &prefix, segsize, &tmp_ins))) {
+            works = true;
+            /*
+             * Final check to make sure the types of r/m match up.
+            * XXX: Need to make sure this is actually correct.
+             */
+            for (i = 0; i < (*p)->operands; i++) {
+                if (!((*p)->opd[i] & SAME_AS) &&
+                   (
+                       /* If it's a mem-only EA but we have a
+                          register, die. */
+                       ((tmp_ins.oprs[i].segment & SEG_RMREG) &&
+                        is_class(MEMORY, (*p)->opd[i])) ||
+                       /* If it's a reg-only EA but we have a memory
+                          ref, die. */
+                       (!(tmp_ins.oprs[i].segment & SEG_RMREG) &&
+                        !(REG_EA & ~(*p)->opd[i]) &&
+                        !((*p)->opd[i] & REG_SMASK)) ||
+                       /* Register type mismatch (eg FS vs REG_DESS):
+                          die. */
+                       ((((*p)->opd[i] & (REGISTER | FPUREG)) ||
+                         (tmp_ins.oprs[i].segment & SEG_RMREG)) &&
+                        !whichreg((*p)->opd[i],
+                                  tmp_ins.oprs[i].basereg, tmp_ins.rex))
+                       )) {
+                    works = false;
+                    break;
+                }
+            }
+
+           /*
+            * Note: we always prefer instructions which incorporate
+            * prefixes in the instructions themselves.  This is to allow
+            * e.g. PAUSE to be preferred to REP NOP, and deal with
+            * MMX/SSE instructions where prefixes are used to select
+            * between MMX and SSE register sets or outright opcode
+            * selection.
+            */
+            if (works) {
+               int i, nprefix;
+                goodness = ((*p)->flags & IF_PFMASK) ^ prefer;
+               nprefix = 0;
+               for (i = 0; i < MAXPREFIX; i++)
+                   if (tmp_ins.prefixes[i])
+                       nprefix++;
+                if (nprefix < best_pref ||
+                   (nprefix == best_pref && goodness < best)) {
+                    /* This is the best one found so far */
+                    best = goodness;
+                    best_p = p;
+                   best_pref = nprefix;
+                    best_length = length;
+                    ins = tmp_ins;
+                }
+            }
+        }
+    }
+
+    if (!best_p)
+        return 0;               /* no instruction was matched */
+
+    /* Pick the best match */
+    p = best_p;
+    length = best_length;
+
+    slen = 0;
+
+    /* TODO: snprintf returns the value that the string would have if
+     *      the buffer were long enough, and not the actual length of
+     *      the returned string, so each instance of using the return
+     *      value of snprintf should actually be checked to assure that
+     *      the return value is "sane."  Maybe a macro wrapper could
+     *      be used for that purpose.
+     */
+    for (i = 0; i < MAXPREFIX; i++) {
+       const char *prefix = prefix_name(ins.prefixes[i]);
+       if (prefix)
+           slen += snprintf(output+slen, outbufsize-slen, "%s ", prefix);
+    }
+
+    i = (*p)->opcode;
+    if (i >= FIRST_COND_OPCODE)
+       slen += snprintf(output + slen, outbufsize - slen, "%s%s",
+                        nasm_insn_names[i], condition_name[ins.condition]);
+    else
+        slen += snprintf(output + slen, outbufsize - slen, "%s",
+                        nasm_insn_names[i]);
+
+    colon = false;
+    length += data - origdata;  /* fix up for prefixes */
+    for (i = 0; i < (*p)->operands; i++) {
+       opflags_t t = (*p)->opd[i];
+       const operand *o = &ins.oprs[i];
+       int64_t offs;
+
+       if (t & SAME_AS) {
+           o = &ins.oprs[t & ~SAME_AS];
+           t = (*p)->opd[t & ~SAME_AS];
+       }
+
+        output[slen++] = (colon ? ':' : i == 0 ? ' ' : ',');
+
+       offs = o->offset;
+        if (o->segment & SEG_RELATIVE) {
+            offs += offset + length;
+            /*
+             * sort out wraparound
+             */
+            if (!(o->segment & (SEG_32BIT|SEG_64BIT)))
+               offs &= 0xffff;
+           else if (segsize != 64)
+               offs &= 0xffffffff;
+
+            /*
+             * add sync marker, if autosync is on
+             */
+            if (autosync)
+                add_sync(offs, 0L);
+        }
+
+        if (t & COLON)
+            colon = true;
+        else
+            colon = false;
+
+        if ((t & (REGISTER | FPUREG)) ||
+            (o->segment & SEG_RMREG)) {
+           enum reg_enum reg;
+            reg = whichreg(t, o->basereg, ins.rex);
+            if (t & TO)
+                slen += snprintf(output + slen, outbufsize - slen, "to ");
+            slen += snprintf(output + slen, outbufsize - slen, "%s",
+                             nasm_reg_names[reg-EXPR_REG_START]);
+        } else if (!(UNITY & ~t)) {
+            output[slen++] = '1';
+        } else if (t & IMMEDIATE) {
+            if (t & BITS8) {
+                slen +=
+                    snprintf(output + slen, outbufsize - slen, "byte ");
+                if (o->segment & SEG_SIGNED) {
+                    if (offs < 0) {
+                        offs *= -1;
+                        output[slen++] = '-';
+                    } else
+                        output[slen++] = '+';
+                }
+            } else if (t & BITS16) {
+                slen +=
+                    snprintf(output + slen, outbufsize - slen, "word ");
+            } else if (t & BITS32) {
+                slen +=
+                    snprintf(output + slen, outbufsize - slen, "dword ");
+            } else if (t & BITS64) {
+                slen +=
+                    snprintf(output + slen, outbufsize - slen, "qword ");
+            } else if (t & NEAR) {
+                slen +=
+                    snprintf(output + slen, outbufsize - slen, "near ");
+            } else if (t & SHORT) {
+                slen +=
+                    snprintf(output + slen, outbufsize - slen, "short ");
+            }
+            slen +=
+                snprintf(output + slen, outbufsize - slen, "0x%"PRIx64"",
+                         offs);
+        } else if (!(MEM_OFFS & ~t)) {
+            slen +=
+                snprintf(output + slen, outbufsize - slen,
+                        "[%s%s%s0x%"PRIx64"]",
+                         (segover ? segover : ""),
+                         (segover ? ":" : ""),
+                        (o->disp_size == 64 ? "qword " :
+                         o->disp_size == 32 ? "dword " :
+                         o->disp_size == 16 ? "word " : ""), offs);
+            segover = NULL;
+        } else if (is_class(REGMEM, t)) {
+            int started = false;
+            if (t & BITS8)
+                slen +=
+                    snprintf(output + slen, outbufsize - slen, "byte ");
+            if (t & BITS16)
+                slen +=
+                    snprintf(output + slen, outbufsize - slen, "word ");
+            if (t & BITS32)
+                slen +=
+                    snprintf(output + slen, outbufsize - slen, "dword ");
+            if (t & BITS64)
+                slen +=
+                    snprintf(output + slen, outbufsize - slen, "qword ");
+            if (t & BITS80)
+                slen +=
+                    snprintf(output + slen, outbufsize - slen, "tword ");
+            if (t & BITS128)
+                slen +=
+                    snprintf(output + slen, outbufsize - slen, "oword ");
+            if (t & BITS256)
+                slen +=
+                    snprintf(output + slen, outbufsize - slen, "yword ");
+            if (t & FAR)
+                slen += snprintf(output + slen, outbufsize - slen, "far ");
+            if (t & NEAR)
+                slen +=
+                    snprintf(output + slen, outbufsize - slen, "near ");
+            output[slen++] = '[';
+            if (o->disp_size)
+                slen += snprintf(output + slen, outbufsize - slen, "%s",
+                                 (o->disp_size == 64 ? "qword " :
+                                 o->disp_size == 32 ? "dword " :
+                                  o->disp_size == 16 ? "word " :
+                                 ""));
+           if (o->eaflags & EAF_REL)
+               slen += snprintf(output + slen, outbufsize - slen, "rel ");
+            if (segover) {
+                slen +=
+                    snprintf(output + slen, outbufsize - slen, "%s:",
+                             segover);
+                segover = NULL;
+            }
+            if (o->basereg != -1) {
+                slen += snprintf(output + slen, outbufsize - slen, "%s",
+                                 nasm_reg_names[(o->basereg-EXPR_REG_START)]);
+                started = true;
+            }
+            if (o->indexreg != -1) {
+                if (started)
+                    output[slen++] = '+';
+                slen += snprintf(output + slen, outbufsize - slen, "%s",
+                                 nasm_reg_names[(o->indexreg-EXPR_REG_START)]);
+                if (o->scale > 1)
+                    slen +=
+                        snprintf(output + slen, outbufsize - slen, "*%d",
+                                 o->scale);
+                started = true;
+            }
+
+
+            if (o->segment & SEG_DISP8) {
+               const char *prefix;
+               uint8_t offset = offs;
+               if ((int8_t)offset < 0) {
+                   prefix = "-";
+                   offset = -offset;
+               } else {
+                   prefix = "+";
+               }
+                slen +=
+                    snprintf(output + slen, outbufsize - slen, "%s0x%"PRIx8"",
+                            prefix, offset);
+            } else if (o->segment & SEG_DISP16) {
+               const char *prefix;
+               uint16_t offset = offs;
+               if ((int16_t)offset < 0 && started) {
+                   offset = -offset;
+                   prefix = "-";
+               } else {
+                   prefix = started ? "+" : "";
+               }
+                slen +=
+                    snprintf(output + slen, outbufsize - slen,
+                            "%s0x%"PRIx16"", prefix, offset);
+            } else if (o->segment & SEG_DISP32) {
+               if (prefix.asize == 64) {
+                   const char *prefix;
+                   uint64_t offset = (int64_t)(int32_t)offs;
+                   if ((int32_t)offs < 0 && started) {
+                       offset = -offset;
+                       prefix = "-";
+                   } else {
+                       prefix = started ? "+" : "";
+                   }
+                   slen +=
+                       snprintf(output + slen, outbufsize - slen,
+                                "%s0x%"PRIx64"", prefix, offset);
+               } else {
+                   const char *prefix;
+                   uint32_t offset = offs;
+                   if ((int32_t) offset < 0 && started) {
+                       offset = -offset;
+                       prefix = "-";
+                   } else {
+                       prefix = started ? "+" : "";
+                   }
+                   slen +=
+                       snprintf(output + slen, outbufsize - slen,
+                                "%s0x%"PRIx32"", prefix, offset);
+               }
+            }
+            output[slen++] = ']';
+        } else {
+            slen +=
+                snprintf(output + slen, outbufsize - slen, "<operand%d>",
+                         i);
+        }
+    }
+    output[slen] = '\0';
+    if (segover) {              /* unused segment override */
+        char *p = output;
+        int count = slen + 1;
+        while (count--)
+            p[count + 3] = p[count];
+        strncpy(output, segover, 2);
+        output[2] = ' ';
+    }
+    return length;
+}
+
+/*
+ * This is called when we don't have a complete instruction.  If it
+ * is a standalone *single-byte* prefix show it as such, otherwise
+ * print it as a literal.
+ */
+int32_t eatbyte(uint8_t *data, char *output, int outbufsize, int segsize)
+{
+    uint8_t byte = *data;
+    const char *str = NULL;
+    
+    switch (byte) {
+    case 0xF2:
+       str = "repne";
+       break;
+    case 0xF3:
+       str = "rep";
+       break;
+    case 0x9B:
+       str = "wait";
+       break;
+    case 0xF0:
+       str = "lock";
+       break;
+    case 0x2E:
+       str = "cs";
+       break;
+    case 0x36:
+       str = "ss";
+       break;
+    case 0x3E:
+       str = "ss";
+       break;
+    case 0x26:
+       str = "es";
+       break;
+    case 0x64:
+       str = "fs";
+       break;
+    case 0x65:
+       str = "gs";
+       break;
+    case 0x66:
+       str = (segsize == 16) ? "o32" : "o16";
+       break;
+    case 0x67:
+       str = (segsize == 32) ? "a16" : "a32";
+       break;
+    case REX_P + 0x0:
+    case REX_P + 0x1:
+    case REX_P + 0x2:
+    case REX_P + 0x3:
+    case REX_P + 0x4:
+    case REX_P + 0x5:
+    case REX_P + 0x6:
+    case REX_P + 0x7:
+    case REX_P + 0x8:
+    case REX_P + 0x9:
+    case REX_P + 0xA:
+    case REX_P + 0xB:
+    case REX_P + 0xC:
+    case REX_P + 0xD:
+    case REX_P + 0xE:
+    case REX_P + 0xF:
+       if (segsize == 64) {
+           snprintf(output, outbufsize, "rex%s%s%s%s%s",
+                    (byte == REX_P) ? "" : ".",
+                    (byte & REX_W) ? "w" : "",
+                    (byte & REX_R) ? "r" : "",
+                    (byte & REX_X) ? "x" : "",
+                    (byte & REX_B) ? "b" : "");
+           break;
+       }
+       /* else fall through */
+    default:
+       snprintf(output, outbufsize, "db 0x%02x", byte);
+       break;
+    }
+
+    if (str)
+       snprintf(output, outbufsize, "%s", str);
+
+    return 1;
+}
diff --git a/disasm.h b/disasm.h
new file mode 100644 (file)
index 0000000..3edbfd5
--- /dev/null
+++ b/disasm.h
@@ -0,0 +1,47 @@
+/* ----------------------------------------------------------------------- *
+ *   
+ *   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.
+ *
+ * ----------------------------------------------------------------------- */
+
+/*
+ * disasm.h   header file for disasm.c
+ */
+
+#ifndef NASM_DISASM_H
+#define NASM_DISASM_H
+
+#define INSN_MAX 32             /* one instruction can't be longer than this */
+
+int32_t disasm(uint8_t *data, char *output, int outbufsize, int segsize,
+            int32_t offset, int autosync, uint32_t prefer);
+int32_t eatbyte(uint8_t *data, char *output, int outbufsize, int segsize);
+
+#endif
diff --git a/doc/Makefile b/doc/Makefile
new file mode 100644 (file)
index 0000000..ae31229
--- /dev/null
@@ -0,0 +1,102 @@
+#
+# UNIX Makefile for NASM documentation
+#
+
+srcdir         = .
+
+prefix         = /usr/local
+exec_prefix    = ${prefix}
+bindir         = ${exec_prefix}/bin
+mandir         = ${datarootdir}/man
+docdir         = $(prefix)/doc/nasm
+infodir                = ${datarootdir}/info
+datarootdir    = ${prefix}/share
+
+INSTALL                = /usr/bin/install -c
+INSTALL_PROGRAM        = ${INSTALL}
+INSTALL_DATA   = ${INSTALL} -m 644
+
+PERL           = perl
+MAKEINFO       = makeinfo
+TEXI2DVI        = texi2dvi
+TEXI2IPF       = texi2ipf
+IPFC           = ipfc
+
+ACRODIST       = false         # Acrobat Distiller
+PSTOPDF                = false         # BSD/MacOS X utility
+PS2PDF          = ps2pdf               # Part of GhostScript
+
+SRCS           = nasmdoc.src inslist.src changes.src
+OUT            = info html nasmdoc.txt nasmdoc.ps nasmdoc.pdf
+
+# exports
+export srcdir
+export PERL
+
+all: $(OUT)
+
+os2: nasm.inf
+
+inslist.src: inslist.pl ../insns.dat
+       $(PERL) $(srcdir)/inslist.pl
+
+.PHONY: html
+html: html/nasmdoc0.html
+
+html/nasmdoc0.html: $(SRCS) rdsrc.pl
+       mkdir -p html
+       $(PERL) $(srcdir)/rdsrc.pl html < $<
+       mv -f *.html html
+
+nasmdoc.dip: $(SRCS) rdsrc.pl
+       $(PERL) $(srcdir)/rdsrc.pl dip < $<
+
+nasmdoc.texi: $(SRCS) rdsrc.pl
+       $(PERL) $(srcdir)/rdsrc.pl texi < $<
+
+nasmdoc.txt: $(SRCS) rdsrc.pl
+       $(PERL) $(srcdir)/rdsrc.pl txt < $<
+
+nasmdoc.ps: nasmdoc.dip nasmlogo.eps $(srcdir)/../version genpsdriver.pl \
+           genps.pl psfonts.ph pswidth.ph head.ps
+       $(PERL) $(srcdir)/genpsdriver.pl > nasmdoc.ps
+
+nasmdoc.pdf: nasmdoc.ps
+       $(ACRODIST) -n -q --nosecurity -o $@ $< || \
+       $(PS2PDF) $< $@ || \
+       $(PSTOPDF) $< -o $@ 
+
+.PHONY: info
+info: info/nasm.info
+
+info/nasm.info: nasmdoc.texi
+       mkdir -p info
+       $(MAKEINFO) $<
+       mv -f *.info *.info-* info
+
+# DVI output from texinfo (optional)
+nasmdoc.dvi: nasmdoc.texi
+       $(TEXI2DVI) nasmdoc.texi
+
+# Rules for building an OS/2 book
+nasmdoc.ipf: nasmdoc.texi
+       $(TEXI2IPF) $< >$@
+
+nasm.inf: nasmdoc.ipf
+       $(IPFC) -i -s $< $@
+
+clean:
+       -rm -f *.rtf *.hpj *.texi *.gid *.ipf *.dip
+       -rm -f *.aux *.cp *.fn *.ky *.pg *.log *.toc *.tp *.vr
+
+spotless: clean
+       -rm -rf html info
+       -rm -f *.hlp nasmdoc.txt *.inf *.pdf *.dvi
+       -rm -f nasmdoc*.ps inslist.src
+
+install: all
+       mkdir -p $(INSTALLROOT)$(infodir)
+       $(INSTALL_DATA) info/* $(INSTALLROOT)$(infodir)
+       mkdir -p $(INSTALLROOT)$(docdir)/html
+       $(INSTALL_DATA) html/* $(INSTALLROOT)$(docdir)/html
+       $(INSTALL_DATA) nasmdoc.ps nasmdoc.pdf nasmdoc.txt $(INSTALLROOT)$(docdir)
diff --git a/doc/Makefile.in b/doc/Makefile.in
new file mode 100644 (file)
index 0000000..a2ef4e3
--- /dev/null
@@ -0,0 +1,102 @@
+#
+# UNIX Makefile for NASM documentation
+#
+
+srcdir         = @srcdir@
+VPATH          = @srcdir@
+prefix         = @prefix@
+exec_prefix    = @exec_prefix@
+bindir         = @bindir@
+mandir         = @mandir@
+docdir         = $(prefix)/doc/nasm
+infodir                = @infodir@
+datarootdir    = @datarootdir@
+
+INSTALL                = @INSTALL@
+INSTALL_PROGRAM        = @INSTALL_PROGRAM@
+INSTALL_DATA   = @INSTALL_DATA@
+
+PERL           = perl
+MAKEINFO       = makeinfo
+TEXI2DVI        = texi2dvi
+TEXI2IPF       = texi2ipf
+IPFC           = ipfc
+
+ACRODIST       = @ACRODIST@            # Acrobat Distiller
+PSTOPDF                = @PSTOPDF@             # BSD/MacOS X utility
+PS2PDF          = @PS2PDF@             # Part of GhostScript
+
+SRCS           = nasmdoc.src inslist.src changes.src
+OUT            = info html nasmdoc.txt nasmdoc.ps nasmdoc.pdf
+
+# exports
+export srcdir
+export PERL
+
+all: $(OUT)
+
+os2: nasm.inf
+
+inslist.src: inslist.pl ../insns.dat
+       $(PERL) $(srcdir)/inslist.pl
+
+.PHONY: html
+html: html/nasmdoc0.html
+
+html/nasmdoc0.html: $(SRCS) rdsrc.pl
+       mkdir -p html
+       $(PERL) $(srcdir)/rdsrc.pl html < $<
+       mv -f *.html html
+
+nasmdoc.dip: $(SRCS) rdsrc.pl
+       $(PERL) $(srcdir)/rdsrc.pl dip < $<
+
+nasmdoc.texi: $(SRCS) rdsrc.pl
+       $(PERL) $(srcdir)/rdsrc.pl texi < $<
+
+nasmdoc.txt: $(SRCS) rdsrc.pl
+       $(PERL) $(srcdir)/rdsrc.pl txt < $<
+
+nasmdoc.ps: nasmdoc.dip nasmlogo.eps $(srcdir)/../version genpsdriver.pl \
+           genps.pl psfonts.ph pswidth.ph head.ps
+       $(PERL) $(srcdir)/genpsdriver.pl > nasmdoc.ps
+
+nasmdoc.pdf: nasmdoc.ps
+       $(ACRODIST) -n -q --nosecurity -o $@ $< || \
+       $(PS2PDF) $< $@ || \
+       $(PSTOPDF) $< -o $@ 
+
+.PHONY: info
+info: info/nasm.info
+
+info/nasm.info: nasmdoc.texi
+       mkdir -p info
+       $(MAKEINFO) $<
+       mv -f *.info *.info-* info
+
+# DVI output from texinfo (optional)
+nasmdoc.dvi: nasmdoc.texi
+       $(TEXI2DVI) nasmdoc.texi
+
+# Rules for building an OS/2 book
+nasmdoc.ipf: nasmdoc.texi
+       $(TEXI2IPF) $< >$@
+
+nasm.inf: nasmdoc.ipf
+       $(IPFC) -i -s $< $@
+
+clean:
+       -rm -f *.rtf *.hpj *.texi *.gid *.ipf *.dip
+       -rm -f *.aux *.cp *.fn *.ky *.pg *.log *.toc *.tp *.vr
+
+spotless: clean
+       -rm -rf html info
+       -rm -f *.hlp nasmdoc.txt *.inf *.pdf *.dvi
+       -rm -f nasmdoc*.ps inslist.src
+
+install: all
+       mkdir -p $(INSTALLROOT)$(infodir)
+       $(INSTALL_DATA) info/* $(INSTALLROOT)$(infodir)
+       mkdir -p $(INSTALLROOT)$(docdir)/html
+       $(INSTALL_DATA) html/* $(INSTALLROOT)$(docdir)/html
+       $(INSTALL_DATA) nasmdoc.ps nasmdoc.pdf nasmdoc.txt $(INSTALLROOT)$(docdir)
diff --git a/doc/afmmetrics.pl b/doc/afmmetrics.pl
new file mode 100755 (executable)
index 0000000..6d7bfc2
--- /dev/null
@@ -0,0 +1,130 @@
+#!/usr/bin/perl
+## --------------------------------------------------------------------------
+##   
+##   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.
+##
+## --------------------------------------------------------------------------
+
+#
+# Parse AFM metric files
+#
+
+@widths = ((undef)x256);
+
+while ( $line = <STDIN> ) {
+    if ( $line =~ /^\s*FontName\s+(.*)\s*$/ ) {
+       $fontname = $1;
+    } elsif ( $line =~ /^\s*StartCharMetrics\b/ ) {
+       $charmetrics = 1;
+    } elsif ( $line =~ /^\s*EndCharMetrics\b/ ) {
+       $charmetrics = 0;
+    } elsif ( $line =~ /^\s*StartKernPairs\b/ ) {
+       $kerndata = 1;
+    } elsif ( $line =~ /^\s*EndKernPairs\b/ ) {
+       $kerndata = 0;
+    } elsif ( $charmetrics ) {
+       @data = split(/\s*;\s*/, $line);
+       undef $charcode, $width, $name;
+       foreach $d ( @data ) {
+           @dd = split(/\s+/, $d);
+           if ( $dd[0] eq 'C' ) {
+               $charcode = $dd[1];
+           } elsif ( $dd[0] eq 'WX' ) {
+               $width = $dd[1];
+           } elsif ( $dd[0] eq 'W' ) {
+               $width = $dd[2];
+           } elsif ( $dd[0] eq 'N' ) {
+               $name = $dd[1];
+           }
+       }
+       if ( defined($name) && defined($width) ) {
+           $charwidth{$name} = $width;
+       }
+    } elsif ( $kerndata ) {
+       @data = split(/\s+/, $line);
+       if ( $data[0] eq 'KPX' ) {
+           if ( defined($charcodes{$data[1]}) &&
+                defined($charcodes{$data[2]}) &&
+                $data[3] != 0 ) {
+               $kernpairs{chr($charcodes{$data[1]}).
+                          chr($charcodes{$data[2]})} = $data[3];
+           }
+       }
+    }
+}
+
+sub qstr($) {
+    my($s) = @_;
+    my($o,$c,$i);
+    $o = '"';
+    for ( $i = 0 ; $i < length($s) ; $i++ ) {
+       $c = substr($s,$i,1);
+       if ( $c lt ' ' || $c gt '~' ) {
+           $o .= sprintf("\\%03o", ord($c));
+       } elsif ( $c eq "\'" || $c eq "\"" || $c eq "\\" ) {
+           $o .= "\\".$c;
+       } else {
+           $o .= $c;
+       }
+    }
+    return $o.'"';
+}
+
+$psfont = $fontname;
+$psfont =~ s/[^A-Za-z0-9]/_/g;
+
+print "%PS_${psfont} = (\n";
+print "  name => \'$fontname\',\n";
+print "  widths => {";
+$lw = 100000;
+foreach $cc ( keys(%charwidth) ) {
+    $ss = sprintf('%s => %d, ', qstr($cc), $charwidth{$cc});
+    $lw += length($ss);
+    if ( $lw > 72 ) {
+       print "\n    ";
+       $lw = 4 + length($ss);
+    }
+    print $ss;
+}
+print "\n  }\n";
+#print "  kern => {";
+#$lw = 100000;
+#foreach $kp ( keys(%kernpairs) ) {
+#    $ss = sprintf('%s => %d, ', qstr($kp), $kernpairs{$kp});
+#    $lw += length($ss);
+#    if ( $lw > 72 ) {
+#      print "\n    ";
+#      $lw = 4 + length($ss);
+#    }
+#    print $ss;
+#}
+#print "  }\n";
+print ");\n";
+print "1;\n";
diff --git a/doc/changes.src b/doc/changes.src
new file mode 100644 (file)
index 0000000..0592f22
--- /dev/null
@@ -0,0 +1,1938 @@
+\#
+\# NASM revision history in nasmdoc format
+\#
+
+\H{cl-2.xx} NASM 2 Series
+
+The NASM 2 series support x86-64, and is the production version of NASM
+since 2007.
+
+
+\S{cl-2.08} Version 2.08
+
+\b A number of enhancements/fixes in macros area.
+
+\b Support for arbitrarily terminating macro expansions \c{%exitmacro}.
+  See \k{exitmacro}.
+
+\b Support for recursive macro expansion \c{%rmacro/irmacro}.
+  See \k{mlrmacro}.
+
+\b Support for converting strings to tokens.  See \k{deftok}.
+
+\b Fuzzy operand size logic introduced.
+
+\b Fix COFF stack overrun on too long export identifiers.
+
+\b Fix Macho-O alignment bug.
+
+\b Fix crashes with -fwin32 on file with many exports.
+
+\b Fix stack overrun for too long [DEBUG id].
+
+\b Fix incorrect sbyte usage in IMUL (hit only if optimization
+  flag passed).
+
+\b Append ending token for \c{.stabs} records in the ELF output format.
+
+\b New NSIS script which uses ModernUI and MultiUser approach.
+
+\b Visual Studio 2008 NASM integration (rules file).
+
+\b Warn a user if a constant is too long (and as result will be stripped).
+
+\b The obsoleted pre-XOP AMD SSE5 instruction set which was never actualized
+  was removed.
+
+\b Fix stack overrun on too long error file name passed from the command line.
+
+\b Bind symbols to the .text section by default (ie in case if SECTION
+  directive was omitted) in the ELF output format.
+
+\b Fix sync points array index wrapping.
+
+\b A few fixes for FMA4 and XOP instruction templates.
+
+\b Add AMD Lightweight Profiling (LWP) instructions.
+
+\S{cl-2.07} Version 2.07
+
+\b NASM is now under the 2-clause BSD license.  See \k{legal}.
+
+\b Fix the section type for the \c{.strtab} section in the \c{elf64}
+  output format.
+
+\b Fix the handling of \c{COMMON} directives in the \c{obj} output format.
+
+\b New \c{ith} and \c{srec} output formats; these are variants of the
+  \c{bin} output format which output Intel hex and Motorola S-records,
+  respectively.  See \k{ithfmt} and \k{srecfmt}.
+
+\b \c{rdf2ihx} replaced with an enhanced \c{rdf2bin}, which can output
+  binary, COM, Intel hex or Motorola S-records.
+
+\b The Windows installer now puts the NASM directory first in the
+  \c{PATH} of the "NASM Shell".
+
+\b Revert the early expansion behavior of \c{%+} to pre-2.06 behavior:
+  \c{%+} is only expanded late.
+
+\b Yet another Mach-O alignment fix.
+
+\b Don't delete the list file on errors.  Also, include error and
+  warning information in the list file.
+
+\b Support for 64-bit Mach-O output, see \k{machofmt}.
+
+\b Fix assert failure on certain operations that involve strings with
+  high-bit bytes.
+
+
+\S{cl-2.06} Version 2.06
+
+\b This release is dedicated to the memory of Charles A. Crayne, long
+  time NASM developer as well as moderator of \c{comp.lang.asm.x86} and
+  author of the book \e{Serious Assembler}.  We miss you, Chuck.
+
+\b Support for indirect macro expansion (\c{%[...]}).  See \k{indmacro}.
+
+\b \c{%pop} can now take an argument, see \k{pushpop}.
+
+\b The argument to \c{%use} is no longer macro-expanded.  Use
+  \c{%[...]} if macro expansion is desired.
+
+\b Support for thread-local storage in ELF32 and ELF64.  See \k{elftls}.
+
+\b Fix crash on \c{%ifmacro} without an argument.
+
+\b Correct the arguments to the \c{POPCNT} instruction.
+
+\b Fix section alignment in the Mach-O format.
+
+\b Update AVX support to version 5 of the Intel specification.
+
+\b Fix the handling of accesses to context-local macros from higher
+  levels in the context stack.
+
+\b Treat \c{WAIT} as a prefix rather than as an instruction, thereby
+  allowing constructs like \c{O16 FSAVE} to work correctly.
+
+\b Support for structures with a non-zero base offset. See \k{struc}.
+
+\b Correctly handle preprocessor token concatenation (see \k{concat})
+   involving floating-point numbers.
+
+\b The \c{PINSR} series of instructions have been corrected and
+   rationalized.
+
+\b Removed AMD SSE5, replaced with the new XOP/FMA4/CVT16 (rev 3.03)
+   spec.
+
+\b The ELF backends no longer automatically generate a \c{.comment} section.
+
+\b Add additional "well-known" ELF sections with default attributes.  See
+   \k{elfsect}.
+
+
+\S{cl-2.05.01} Version 2.05.01
+
+\b Fix the \c{-w}/\c{-W} option parsing, which was broken in NASM 2.05.
+
+
+\S{cl-2.05} Version 2.05
+
+\b Fix redundant REX.W prefix on \c{JMP reg64}.
+
+\b Make the behaviour of \c{-O0} match NASM 0.98 legacy behavior.
+  See \k{opt-O}.
+
+\b \c{-w-user} can be used to suppress the output of \c{%warning} directives.
+  See \k{opt-w}.
+
+\b Fix bug where \c{ALIGN} would issue a full alignment datum instead of
+  zero bytes.
+
+\b Fix offsets in list files.
+
+\b Fix \c{%include} inside multi-line macros or loops.
+
+\b Fix error where NASM would generate a spurious warning on valid
+  optimizations of immediate values.
+
+\b Fix arguments to a number of the \c{CVT} SSE instructions.
+
+\b Fix RIP-relative offsets when the instruction carries an immediate.
+
+\b Massive overhaul of the ELF64 backend for spec compliance.
+
+\b Fix the Geode \c{PFRCPV} and \c{PFRSQRTV} instruction.
+
+\b Fix the SSE 4.2 \c{CRC32} instruction.
+
+
+\S{cl-2.04} Version 2.04
+
+\b Sanitize macro handing in the \c{%error} directive.
+
+\b New \c{%warning} directive to issue user-controlled warnings.
+
+\b \c{%error} directives are now deferred to the final assembly phase.
+
+\b New \c{%fatal} directive to immediately terminate assembly.
+
+\b New \c{%strcat} directive to join quoted strings together.
+
+\b New \c{%use} macro directive to support standard macro directives.  See
+  \k{use}.
+
+\b Excess default parameters to \c{%macro} now issues a warning by default.
+  See \k{mlmacro}.
+
+\b Fix \c{%ifn} and \c{%elifn}.
+
+\b Fix nested \c{%else} clauses.
+
+\b Correct the handling of nested \c{%rep}s.
+
+\b New \c{%unmacro} directive to undeclare a multi-line macro.
+  See \k{unmacro}.
+
+\b Builtin macro \c{__PASS__} which expands to the current assembly pass.
+  See \k{pass_macro}.
+
+\b \c{__utf16__} and \c{__utf32__} operators to generate UTF-16 and UTF-32
+  strings.  See \k{unicode}.
+
+\b Fix bug in case-insensitive matching when compiled on platforms that
+  don't use the \c{configure} script.  Of the official release binaries,
+  that only affected the OS/2 binary.
+
+\b Support for x87 packed BCD constants.  See \k{bcdconst}.
+
+\b Correct the \c{LTR} and \c{SLDT} instructions in 64-bit mode.
+
+\b Fix unnecessary REX.W prefix on indirect jumps in 64-bit mode.
+
+\b Add AVX versions of the AES instructions (\c{VAES}...).
+
+\b Fix the 256-bit FMA instructions.
+
+\b Add 256-bit AVX stores per the latest AVX spec.
+
+\b VIA XCRYPT instructions can now be written either with or without
+  \c{REP}, apparently different versions of the VIA spec wrote them
+  differently.
+
+\b Add missing 64-bit \c{MOVNTI} instruction.
+
+\b Fix the operand size of \c{VMREAD} and \c{VMWRITE}.
+
+\b Numerous bug fixes, especially to the AES, AVX and VTX instructions.
+
+\b The optimizer now always runs until it converges.  It also runs even
+  when disabled, but doesn't optimize.  This allows most forward references
+  to be resolved properly.
+
+\b \c{%push} no longer needs a context identifier; omitting the context
+  identifier results in an anonymous context.
+
+
+\S{cl-2.03.01} Version 2.03.01
+
+\b Fix buffer overflow in the listing module.
+
+\b Fix the handling of hexadecimal escape codes in `...` strings.
+
+\b The Postscript/PDF documentation has been reformatted.
+
+\b The \c{-F} option now implies \c{-g}.
+
+
+\S{cl-2.03} Version 2.03
+
+\b Add support for Intel AVX, CLMUL and FMA instructions,
+including YMM registers.
+
+\b \c{dy}, \c{resy} and \c{yword} for 32-byte operands.
+
+\b Fix some SSE5 instructions.
+
+\b Intel \c{INVEPT}, \c{INVVPID} and \c{MOVBE} instructions.
+
+\b Fix checking for critical expressions when the optimizer is enabled.
+
+\b Support the DWARF debugging format for ELF targets.
+
+\b Fix optimizations of signed bytes.
+
+\b Fix operation on bigendian machines.
+
+\b Fix buffer overflow in the preprocessor.
+
+\b \c{SAFESEH} support for Win32, \c{IMAGEREL} for Win64 (SEH).
+
+\b \c{%?} and \c{%??} to refer to the name of a macro itself.  In particular,
+\c{%idefine keyword $%?} can be used to make a keyword "disappear".
+
+\b New options for dependency generation: \c{-MD}, \c{-MF},
+\c{-MP}, \c{-MT}, \c{-MQ}.
+
+\b New preprocessor directives \c{%pathsearch} and \c{%depend}; INCBIN
+reimplemented as a macro.
+
+\b \c{%include} now resolves macros in a sane manner.
+
+\b \c{%substr} can now be used to get other than one-character substrings.
+
+\b New type of character/string constants, using backquotes (\c{`...`}),
+which support C-style escape sequences.
+
+\b \c{%defstr} and \c{%idefstr} to stringize macro definitions before
+creation.
+
+\b Fix forward references used in \c{EQU} statements.
+
+
+\S{cl-2.02} Version 2.02
+
+\b Additional fixes for MMX operands with explicit \c{qword}, as well as
+  (hopefully) SSE operands with \c{oword}.
+
+\b Fix handling of truncated strings with \c{DO}.
+
+\b Fix segfaults due to memory overwrites when floating-point constants
+  were used.
+
+\b Fix segfaults due to missing include files.
+
+\b Fix OpenWatcom Makefiles for DOS and OS/2.
+
+\b Add autogenerated instruction list back into the documentation.
+
+\b ELF: Fix segfault when generating stabs, and no symbols have been
+  defined.
+
+\b ELF: Experimental support for DWARF debugging information.
+
+\b New compile date and time standard macros.
+
+\b \c{%ifnum} now returns true for negative numbers.
+
+\b New \c{%iftoken} test for a single token.
+
+\b New \c{%ifempty} test for empty expansion.
+
+\b Add support for the \c{XSAVE} instruction group.
+
+\b Makefile for Netware/gcc.
+
+\b Fix issue with some warnings getting emitted way too many times.
+
+\b Autogenerated instruction list added to the documentation.
+
+
+\S{cl-2.01} Version 2.01
+
+\b Fix the handling of MMX registers with explicit \c{qword} tags on
+  memory (broken in 2.00 due to 64-bit changes.)
+
+\b Fix the PREFETCH instructions.
+
+\b Fix the documentation.
+
+\b Fix debugging info when using \c{-f elf}
+(backwards compatibility alias for \c{-f elf32}).
+
+\b Man pages for rdoff tools (from the Debian project.)
+
+\b ELF: handle large numbers of sections.
+
+\b Fix corrupt output when the optimizer runs out of passes.
+
+
+\S{cl-2.00} Version 2.00
+
+\b Added c99 data-type compliance.
+
+\b Added general x86-64 support.
+
+\b Added win64 (x86-64 COFF) output format.
+
+\b Added \c{__BITS__} standard macro.
+
+\b Renamed the \c{elf} output format to \c{elf32} for clarity.
+
+\b Added \c{elf64} and \c{macho} (MacOS X) output formats.
+
+\b Added Numeric constants in \c{dq} directive.
+
+\b Added \c{oword}, \c{do} and \c{reso} pseudo operands.
+
+\b Allow underscores in numbers.
+
+\b Added 8-, 16- and 128-bit floating-point formats.
+
+\b Added binary, octal and hexadecimal floating-point.
+
+\b Correct the generation of floating-point constants.
+
+\b Added floating-point option control.
+
+\b Added Infinity and NaN floating point support.
+
+\b Added ELF Symbol Visibility support.
+
+\b Added setting OSABI value in ELF header directive.
+
+\b Added Generate Makefile Dependencies option.
+
+\b Added Unlimited Optimization Passes option.
+
+\b Added \c{%IFN} and \c{%ELIFN} support.
+
+\b Added Logical Negation Operator.
+
+\b Enhanced Stack Relative Preprocessor Directives.
+
+\b Enhanced ELF Debug Formats.
+
+\b Enhanced Send Errors to a File option.
+
+\b Added SSSE3, SSE4.1, SSE4.2, SSE5 support.
+
+\b Added a large number of additional instructions.
+
+\b Significant performance improvements.
+
+\b \c{-w+warning} and \c{-w-warning} can now be written as -Wwarning and
+ -Wno-warning, respectively.  See \k{opt-w}.
+
+\b Add \c{-w+error} to treat warnings as errors.  See \k{opt-w}.
+
+\b Add \c{-w+all} and \c{-w-all} to enable or disable all suppressible
+ warnings.  See \k{opt-w}.
+
+
+\H{cl-0.98.xx} NASM 0.98 Series
+
+The 0.98 series was the production versions of NASM from 1999 to 2007.
+
+
+\S{cl-0.98.39} Version 0.98.39
+
+\b fix buffer overflow
+
+\b fix outas86's \c{.bss} handling
+
+\b "make spotless" no longer deletes config.h.in.
+
+\b \c{%(el)if(n)idn} insensitivity to string quotes difference (#809300).
+
+\b (nasm.c)\c{__OUTPUT_FORMAT__} changed to string value instead of symbol.
+
+\S{cl-0.98.38} Version 0.98.38
+
+
+\b Add Makefile for 16-bit DOS binaries under OpenWatcom, and modify
+  \c{mkdep.pl} to be able to generate completely pathless dependencies, as
+  required by OpenWatcom wmake (it supports path searches, but not
+  explicit paths.)
+
+\b Fix the \c{STR} instruction.
+
+\b Fix the ELF output format, which was broken under certain
+  circumstances due to the addition of stabs support.
+
+\b Quick-fix Borland format debug-info for \c{-f obj}
+
+\b Fix for \c{%rep} with no arguments (#560568)
+
+\b Fix concatenation of preprocessor function call (#794686)
+
+\b Fix long label causes coredump (#677841)
+
+\b Use autoheader as well as autoconf to keep configure from generating
+  ridiculously long command lines.
+
+\b Make sure that all of the formats which support debugging output
+  actually will suppress debugging output when \c{-g} not specified.
+
+\S{cl-0.98.37} Version 0.98.37
+
+
+\b Paths given in \c{-I} switch searched for \c{incbin}-ed as
+  well as \c{%include}-ed files.
+
+\b Added stabs debugging for the ELF output format, patch from
+  Martin Wawro.
+
+\b Fix \c{output/outbin.c} to allow origin > 80000000h.
+
+\b Make \c{-U} switch work.
+
+\b Fix the use of relative offsets with explicit prefixes, e.g.
+\c{a32 loop foo}.
+
+\b Remove \c{backslash()}.
+
+\b Fix the \c{SMSW} and \c{SLDT} instructions.
+
+\b \c{-O2} and \c{-O3} are no longer aliases for \c{-O10} and \c{-O15}.
+If you mean the latter, please say so! :)
+
+\S{cl-0.98.36} Version 0.98.36
+
+
+\b Update rdoff - librarian/archiver - common rec - docs!
+
+\b Fix signed/unsigned problems.
+
+\b Fix \c{JMP FAR label} and \c{CALL FAR label}.
+
+\b Add new multisection support - map files - fix align bug
+
+\b Fix sysexit, movhps/movlps reg,reg bugs in insns.dat
+
+\b \c{Q} or \c{O} suffixes indicate octal
+
+\b Support Prescott new instructions (PNI).
+
+\b Cyrix \c{XSTORE} instruction.
+
+
+\S{cl-0.98.35} Version 0.98.35
+
+\b Fix build failure on 16-bit DOS (Makefile.bc3 workaround for compiler bug.)
+
+\b Fix dependencies and compiler warnings.
+
+\b Add "const" in a number of places.
+
+\b Add -X option to specify error reporting format (use -Xvc to
+  integrate with Microsoft Visual Studio.)
+
+\b Minor changes for code legibility.
+
+\b Drop use of tmpnam() in rdoff (security fix.)
+
+
+\S{cl-0.98.34} Version 0.98.34
+
+\b Correct additional address-size vs. operand-size confusions.
+
+\b Generate dependencies for all Makefiles automatically.
+
+\b Add support for unimplemented (but theoretically available)
+  registers such as tr0 and cr5.  Segment registers 6 and 7 are called
+  segr6 and segr7 for the operations which they can be represented.
+
+\b Correct some disassembler bugs related to redundant address-size prefixes.
+  Some work still remains in this area.
+
+\b Correctly generate an error for things like "SEG eax".
+
+\b Add the JMPE instruction, enabled by "CPU IA64".
+
+\b Correct compilation on newer gcc/glibc platforms.
+
+\b Issue an error on things like "jmp far eax".
+
+
+\S{cl-0.98.33} Version 0.98.33
+
+\b New __NASM_PATCHLEVEL__ and __NASM_VERSION_ID__ standard macros to
+  round out the version-query macros.  version.pl now understands
+  X.YYplWW or X.YY.ZZplWW as a version number, equivalent to
+  X.YY.ZZ.WW (or X.YY.0.WW, as appropriate).
+
+\b New keyword "strict" to disable the optimization of specific
+  operands.
+
+\b Fix the handing of size overrides with JMP instructions
+  (instructions such as "jmp dword foo".)
+
+\b Fix the handling of "ABSOLUTE label", where "label" points into a
+  relocatable segment.
+
+\b Fix OBJ output format with lots of externs.
+
+\b More documentation updates.
+
+\b Add -Ov option to get verbose information about optimizations.
+
+\b Undo a braindead change which broke \c{%elif} directives.
+
+\b Makefile updates.
+
+
+\S{cl-0.98.32} Version 0.98.32
+
+\b Fix NASM crashing when \c{%macro} directives were left unterminated.
+
+\b Lots of documentation updates.
+
+\b Complete rewrite of the PostScript/PDF documentation generator.
+
+\b The MS Visual C++ Makefile was updated and corrected.
+
+\b Recognize .rodata as a standard section name in ELF.
+
+\b Fix some obsolete Perl4-isms in Perl scripts.
+
+\b Fix configure.in to work with autoconf 2.5x.
+
+\b Fix a couple of "make cleaner" misses.
+
+\b Make the normal "./configure && make" work with Cygwin.
+
+
+\S{cl-0.98.31} Version 0.98.31
+
+\b Correctly build in a separate object directory again.
+
+\b Derive all references to the version number from the version file.
+
+\b New standard macros __NASM_SUBMINOR__ and __NASM_VER__ macros.
+
+\b Lots of Makefile updates and bug fixes.
+
+\b New \c{%ifmacro} directive to test for multiline macros.
+
+\b Documentation updates.
+
+\b Fixes for 16-bit OBJ format output.
+
+\b Changed the NASM environment variable to NASMENV.
+
+
+\S{cl-0.98.30} Version 0.98.30
+
+\b Changed doc files a lot: completely removed old READMExx and
+  Wishlist files, incorporating all information in CHANGES and TODO.
+
+\b I waited a long time to rename zoutieee.c to (original) outieee.c
+
+\b moved all output modules to output/ subdirectory.
+
+\b Added 'make strip' target to strip debug info from nasm & ndisasm.
+
+\b Added INSTALL file with installation instructions.
+
+\b Added -v option description to nasm man.
+
+\b Added dist makefile target to produce source distributions.
+
+\b 16-bit support for ELF output format (GNU extension, but useful.)
+
+
+\S{cl-0.98.28} Version 0.98.28
+
+\b Fastcooked this for Debian's Woody release:
+Frank applied the INCBIN bug patch to 0.98.25alt and called
+it 0.98.28 to not confuse poor little apt-get.
+
+
+\S{cl-0.98.26} Version 0.98.26
+
+\b Reorganised files even better from 0.98.25alt
+
+
+\S{cl-0.98.25alt} Version 0.98.25alt
+
+\b Prettified the source tree. Moved files to more reasonable places.
+
+\b Added findleak.pl script to misc/ directory.
+
+\b Attempted to fix doc.
+
+
+\S{cl-0.98.25} Version 0.98.25
+
+\b Line continuation character \c{\\}.
+
+\b Docs inadvertantly reverted - "dos packaging".
+
+
+\S{cl-0.98.24p1} Version 0.98.24p1
+
+\b FIXME: Someone, document this please.
+
+
+\S{cl-0.98.24} Version 0.98.24
+
+\b Documentation - Ndisasm doc added to Nasm.doc.
+
+
+\S{cl-0.98.23} Version 0.98.23
+
+\b Attempted to remove rdoff version1
+
+\b Lino Mastrodomenico's patches to preproc.c (%$$ bug?).
+
+
+\S{cl-0.98.22} Version 0.98.22
+
+\b Update rdoff2 - attempt to remove v1.
+
+
+\S{cl-0.98.21} Version 0.98.21
+
+\b Optimization fixes.
+
+
+\S{cl-0.98.20} Version 0.98.20
+
+\b Optimization fixes.
+
+
+\S{cl-0.98.19} Version 0.98.19
+
+\b H. J. Lu's patch back out.
+
+
+\S{cl-0.98.18} Version 0.98.18
+
+\b Added ".rdata" to "-f win32".
+
+
+\S{cl-0.98.17} Version 0.98.17
+
+\b H. J. Lu's "bogus elf" patch. (Red Hat problem?)
+
+
+\S{cl-0.98.16} Version 0.98.16
+
+\b Fix whitespace before "[section ..." bug.
+
+
+\S{cl-0.98.15} Version 0.98.15
+
+\b Rdoff changes (?).
+
+\b Fix fixes to memory leaks.
+
+
+\S{cl-0.98.14} Version 0.98.14
+
+\b Fix memory leaks.
+
+
+\S{cl-0.98.13} Version 0.98.13
+
+\b There was no 0.98.13
+
+
+\S{cl-0.98.12} Version 0.98.12
+
+\b Update optimization (new function of "-O1")
+
+\b Changes to test/bintest.asm (?).
+
+
+\S{cl-0.98.11} Version 0.98.11
+
+\b Optimization changes.
+
+\b Ndisasm fixed.
+
+
+\S{cl-0.98.10} Version 0.98.10
+
+\b There was no 0.98.10
+
+
+\S{cl-0.98.09} Version 0.98.09
+
+\b Add multiple sections support to "-f bin".
+
+\b Changed GLOBAL_TEMP_BASE in outelf.c from 6 to 15.
+
+\b Add "-v" as an alias to the "-r" switch.
+
+\b Remove "#ifdef" from Tasm compatibility options.
+
+\b Remove redundant size-overrides on "mov ds, ex", etc.
+
+\b Fixes to SSE2, other insns.dat (?).
+
+\b Enable uppercase "I" and "P" switches.
+
+\b Case insinsitive "seg" and "wrt".
+
+\b Update install.sh (?).
+
+\b Allocate tokens in blocks.
+
+\b Improve "invalid effective address" messages.
+
+
+\S{cl-0.98.08} Version 0.98.08
+
+\b Add "\c{%strlen}" and "\c{%substr}" macro operators
+
+\b Fixed broken c16.mac.
+
+\b Unterminated string error reported.
+
+\b Fixed bugs as per 0.98bf
+
+
+\S{cl-0.98.09b with John Coffman patches released 28-Oct-2001} Version 0.98.09b with John Coffman patches released 28-Oct-2001
+
+Changes from 0.98.07 release to 98.09b as of 28-Oct-2001
+
+\b More closely compatible with 0.98 when -O0 is implied
+or specified.  Not strictly identical, since backward 
+branches in range of short offsets are recognized, and signed
+byte values with no explicit size specification will be
+assembled as a single byte.
+
+\b More forgiving with the PUSH instruction.  0.98 requires
+a size to be specified always.  0.98.09b will imply the size
+from the current BITS setting (16 or 32).
+
+\b Changed definition of the optimization flag:
+
+        -O0     strict two-pass assembly, JMP and Jcc are
+                handled more like 0.98, except that back-
+                ward JMPs are short, if possible.
+
+        -O1     strict two-pass assembly, but forward
+                branches are assembled with code guaranteed
+                to reach; may produce larger code than
+                -O0, but will produce successful assembly
+                more often if branch offset sizes are not
+                specified.
+
+        -O2     multi-pass optimization, minimize branch
+                offsets; also will minimize signed immed-
+                iate bytes, overriding size specification.
+
+        -O3     like -O2, but more passes taken, if needed
+
+
+\S{cl-0.98.07 released 01/28/01} Version 0.98.07 released 01/28/01
+
+\b       Added Stepane Denis' SSE2 instructions to a *working*
+        version of the code - some earlier versions were based on
+        broken code - sorry 'bout that. version "0.98.07"
+
+
+01/28/01
+
+
+\b       Cosmetic modifications to nasm.c, nasm.h,
+        AUTHORS, MODIFIED
+
+
+\S{cl-0.98.06f released 01/18/01} Version 0.98.06f released 01/18/01
+
+
+\b       - Add "metalbrain"s jecxz bug fix in insns.dat
+        - alter nasmdoc.src to match - version "0.98.06f"
+
+
+\S{cl-0.98.06e released 01/09/01} Version 0.98.06e released 01/09/01
+
+
+\b       Removed the "outforms.h" file - it appears to be
+        someone's old backup of "outform.h". version "0.98.06e" 
+
+01/09/01
+
+\b fbk - finally added the fix for the "multiple %includes bug",
+        known since 7/27/99 - reported originally (?) and sent to
+        us by Austin Lunnen - he reports that John Fine had a fix
+        within the day. Here it is...
+
+\b Nelson Rush resigns from the group. Big thanks to Nelson for
+  his leadership and enthusiasm in getting these changes
+  incorporated into Nasm!
+
+\b fbk - [list +], [list -] directives - ineptly implemented, should
+        be re-written or removed, perhaps.
+
+\b Brian Raiter / fbk - "elfso bug" fix - applied to aoutb format
+                       as well - testing might be desirable...
+
+08/07/00
+
+\b James Seter - -postfix, -prefix command line switches.
+
+\b Yuri Zaporogets - rdoff utility changes.
+
+
+\S{cl-0.98p1} Version 0.98p1
+
+\b GAS-like palign (Panos Minos)
+
+\b FIXME: Someone, fill this in with details
+
+
+\S{cl-0.98bf (bug-fixed)} Version 0.98bf (bug-fixed)
+
+\b Fixed - elf and aoutb bug - shared libraries
+        - multiple "%include" bug in "-f obj"   
+        - jcxz, jecxz bug
+        - unrecognized option bug in ndisasm 
+
+\S{cl-0.98.03 with John Coffman's changes released 27-Jul-2000} Version 0.98.03 with John Coffman's changes released 27-Jul-2000
+
+\b Added signed byte optimizations for the 0x81/0x83 class
+of instructions: ADC, ADD, AND, CMP, OR, SBB, SUB, XOR:
+when used as 'ADD reg16,imm' or 'ADD reg32,imm.'  Also
+optimization of signed byte form of 'PUSH imm' and 'IMUL
+reg,imm'/'IMUL reg,reg,imm.'  No size specification is needed.
+
+\b Added multi-pass JMP and Jcc offset optimization.  Offsets
+on forward references will preferentially use the short form,
+without the need to code a specific size (short or near) for
+the branch.  Added instructions for 'Jcc label' to use the
+form 'Jnotcc $+3/JMP label', in cases where a short offset
+is out of bounds.  If compiling for a 386 or higher CPU, then
+the 386 form of Jcc will be used instead.
+
+This feature is controlled by a new command-line switch: "O",
+(upper case letter O).  "-O0" reverts the assembler to no
+extra optimization passes, "-O1" allows up to 5 extra passes,
+and "-O2"(default), allows up to 10 extra optimization passes.
+
+\b Added a new directive:  'cpu XXX', where XXX is any of: 
+8086, 186, 286, 386, 486, 586, pentium, 686, PPro, P2, P3 or
+Katmai.  All are case insensitive.  All instructions will
+be selected only if they apply to the selected cpu or lower.
+Corrected a couple of bugs in cpu-dependence in 'insns.dat'.
+
+\b Added to 'standard.mac', the "use16" and "use32" forms of
+the "bits 16/32" directive. This is nothing new, just conforms
+to a lot of other assemblers. (minor)
+
+\b Changed label allocation from 320/32 (10000 labels @ 200K+) 
+to 32/37 (1000 labels); makes running under DOS much easier.
+Since additional label space is allocated dynamically, this
+should have no effect on large programs with lots of labels.
+The 37 is a prime, believed to be better for hashing. (minor)
+
+
+\S{cl-0.98.03} Version 0.98.03
+
+"Integrated patchfile 0.98-0.98.01.  I call this version 0.98.03 for
+historical reasons: 0.98.02 was trashed." --John Coffman
+<johninsd@san.rr.com>, 27-Jul-2000
+
+\b Kendall Bennett's SciTech MGL changes
+
+\b Note that you must define "TASM_COMPAT" at compile-time
+to get the Tasm Ideal Mode compatibility.
+
+\b All changes can be compiled in and out using the TASM_COMPAT macros,
+and when compiled without TASM_COMPAT defined we get the exact same
+binary as the unmodified 0.98 sources.
+
+\b standard.mac, macros.c: Added macros to ignore TASM directives before
+first include
+
+\b nasm.h: Added extern declaration for tasm_compatible_mode
+
+\b nasm.c: Added global variable tasm_compatible_mode
+
+\b Added command line switch for TASM compatible mode (-t)
+
+\b Changed version command line to reflect when compiled with TASM additions
+
+\b Added response file processing to allow all arguments on a single
+line (response file is @resp rather than -@resp for NASM format).
+
+\b labels.c: Changes islocal() macro to support TASM style @@local labels.
+
+\b Added islocalchar() macro to support TASM style @@local labels.
+
+\b parser.c: Added support for TASM style memory references (ie: mov
+[DWORD eax],10 rather than the NASM style mov DWORD [eax],10).
+
+\b preproc.c: Added new directives, \c{%arg}, \c{%local}, \c{%stacksize} to directives
+table
+
+\b Added support for TASM style directives without a leading % symbol.
+
+\b Integrated a block of changes from Andrew Zabolotny <bit@eltech.ru>:
+
+\b A new keyword \c{%xdefine} and its case-insensitive counterpart \c{%ixdefine}.
+They work almost the same way as \c{%define} and \c{%idefine} but expand
+the definition immediately, not on the invocation. Something like a cross
+between \c{%define} and \c{%assign}. The "x" suffix stands for "eXpand", so
+"xdefine" can be deciphered as "expand-and-define". Thus you can do
+things like this:
+
+\c      %assign ofs     0
+\c
+\c      %macro  arg     1
+\c              %xdefine %1 dword [esp+ofs]
+\c              %assign ofs ofs+4
+\c      %endmacro
+
+\b Changed the place where the expansion of %$name macros are expanded.
+Now they are converted into ..@ctxnum.name form when detokenizing, so
+there are no quirks as before when using %$name arguments to macros,
+in macros etc. For example:
+
+\c      %macro  abc     1
+\c              %define %1 hello
+\c      %endm
+\c
+\c      abc     %$here
+\c      %$here
+
+    Now last line will be expanded into "hello" as expected. This also allows
+    for lots of goodies, a good example are extended "proc" macros included
+    in this archive.
+
+\b Added a check for "cstk" in smacro_defined() before calling get_ctx() -
+    this allows for things like:
+
+\c      %ifdef %$abc
+\c      %endif
+
+    to work without warnings even in no context.
+
+\b Added a check for "cstk" in %if*ctx and %elif*ctx directives -
+    this allows to use \c{%ifctx} without excessive warnings. If there is
+    no active context, \c{%ifctx} goes through "false" branch.
+
+\b Removed "user error: " prefix with \c{%error} directive: it just clobbers the
+    output and has absolutely no functionality. Besides, this allows to write
+    macros that does not differ from built-in functions in any way.
+
+\b Added expansion of string that is output by \c{%error} directive. Now you
+    can do things like:
+
+\c      %define hello(x) Hello, x!
+\c
+\c      %define %$name andy
+\c      %error "hello(%$name)"
+
+    Same happened with \c{%include} directive.
+
+\b Now all directives that expect an identifier will try to expand and
+    concatenate everything without whitespaces in between before usage.
+    For example, with "unfixed" nasm the commands
+
+\c      %define %$abc hello
+\c      %define __%$abc goodbye
+\c      __%$abc
+
+    would produce "incorrect" output: last line will expand to
+
+\c      hello goodbyehello
+
+    Not quite what you expected, eh? :-) The answer is that preprocessor
+    treats the \c{%define} construct as if it would be
+
+\c      %define __ %$abc goodbye
+
+    (note the white space between __ and %$abc). After my "fix" it
+    will "correctly" expand into
+
+\c      goodbye
+
+    as expected. Note that I use quotes around words "correct", "incorrect"
+    etc because this is rather a feature not a bug; however current behaviour
+    is more logical (and allows more advanced macro usage :-).
+
+    Same change was applied to:
+        \c{%push},\c{%macro},\c{%imacro},\c{%define},\c{%idefine},\c{%xdefine},\c{%ixdefine},
+        \c{%assign},\c{%iassign},\c{%undef}
+
+\b A new directive [WARNING {+|-}warning-id] have been added. It works only
+    if the assembly phase is enabled (i.e. it doesn't work with nasm -e).
+
+\b A new warning type: macro-selfref. By default this warning is disabled;
+    when enabled NASM warns when a macro self-references itself; for example
+    the following source:
+
+\c        [WARNING macro-selfref]
+\c
+\c        %macro          push    1-*
+\c                %rep    %0
+\c                        push    %1
+\c                        %rotate 1
+\c                %endrep
+\c        %endmacro
+\c
+\c                        push    eax,ebx,ecx
+
+    will produce a warning, but if we remove the first line we won't see it
+    anymore (which is The Right Thing To Do {tm} IMHO since C preprocessor
+    eats such constructs without warnings at all).
+
+\b Added a "error" routine to preprocessor which always will set ERR_PASS1
+    bit in severity_code. This removes annoying repeated errors on first
+    and second passes from preprocessor.
+
+\b Added the %+ operator in single-line macros for concatenating two
+    identifiers. Usage example:
+
+\c        %define _myfunc _otherfunc
+\c        %define cextern(x) _ %+ x
+\c        cextern (myfunc)
+
+    After first expansion, third line will become "_myfunc". After this
+    expansion is performed again so it becomes "_otherunc".
+
+\b Now if preprocessor is in a non-emitting state, no warning or error
+    will be emitted. Example:
+
+\c        %if 1
+\c                mov     eax,ebx
+\c        %else
+\c                put anything you want between these two brackets,
+\c                even macro-parameter references %1 or local
+\c                labels %$zz or macro-local labels %%zz - no
+\c                warning will be emitted.
+\c        %endif
+
+\b Context-local variables on expansion as a last resort are looked up
+    in outer contexts. For example, the following piece:
+
+\c        %push   outer
+\c        %define %$a [esp]
+\c
+\c                %push   inner
+\c                %$a
+\c                %pop
+\c        %pop
+
+    will expand correctly the fourth line to [esp]; if we'll define another
+    %$a inside the "inner" context, it will take precedence over outer
+    definition. However, this modification has been applied only to
+    expand_smacro and not to smacro_define: as a consequence expansion
+    looks in outer contexts, but \c{%ifdef} won't look in outer contexts.
+
+    This behaviour is needed because we don't want nested contexts to
+    act on already defined local macros. Example:
+
+\c        %define %$arg1  [esp+4]
+\c        test    eax,eax
+\c        if      nz
+\c                mov     eax,%$arg1
+\c        endif
+
+    In this example the "if" mmacro enters into the "if" context, so %$arg1
+    is not valid anymore inside "if". Of course it could be worked around
+    by using explicitely %$$arg1 but this is ugly IMHO.
+
+\b Fixed memory leak in \c{%undef}. The origline wasn't freed before
+    exiting on success.
+
+\b Fixed trap in preprocessor when line expanded to empty set of tokens.
+    This happens, for example, in the following case:
+
+\c        #define SOMETHING
+\c        SOMETHING
+
+
+\S{cl-0.98} Version 0.98
+
+All changes since NASM 0.98p3 have been produced by H. Peter Anvin <hpa@zytor.com>.
+
+\b The documentation comment delimiter is \# not #.
+
+\b Allow EQU definitions to refer to external labels; reported by
+  Pedro Gimeno.
+
+\b Re-enable support for RDOFF v1; reported by Pedro Gimeno.
+
+\b Updated License file per OK from Simon and Julian.
+
+
+\S{cl-0.98p9} Version 0.98p9
+
+\b Update documentation (although the instruction set reference will
+  have to wait; I don't want to hold up the 0.98 release for it.)
+
+\b Verified that the NASM implementation of the PEXTRW and PMOVMSKB
+  instructions is correct.  The encoding differs from what the Intel
+  manuals document, but the Pentium III behaviour matches NASM, not
+  the Intel manuals.
+
+\b Fix handling of implicit sizes in PSHUFW and PINSRW, reported by
+  Stefan Hoffmeister.
+
+\b Resurrect the -s option, which was removed when changing the
+  diagnostic output to stdout.
+
+
+\S{cl-0.98p8} Version 0.98p8
+
+\b Fix for "DB" when NASM is running on a bigendian machine.
+
+\b Invoke insns.pl once for each output script, making Makefile.in
+  legal for "make -j".
+
+\b Improve the Unix configure-based makefiles to make package
+  creation easier.
+
+\b Included an RPM .spec file for building RPM (RedHat Package Manager)
+  packages on Linux or Unix systems.
+
+\b Fix Makefile dependency problems.
+
+\b Change src/rdsrc.pl to include sectioning information in info
+  output; required for install-info to work.
+
+\b Updated the RDOFF distribution to version 2 from Jules; minor
+  massaging to make it compile in my environment.
+
+\b Split doc files that can be built by anyone with a Perl interpreter off
+  into a separate archive.
+
+\b "Dress rehearsal" release!
+
+
+\S{cl-0.98p7} Version 0.98p7
+
+\b Fixed opcodes with a third byte-sized immediate argument to not
+  complain if given "byte" on the immediate.
+
+\b Allow \c{%undef} to remove single-line macros with arguments.  This
+  matches the behaviour of #undef in the C preprocessor.
+
+\b Allow -d, -u, -i and -p to be specified as -D, -U, -I and -P for
+  compatibility with most C compilers and preprocessors.  This allows
+  Makefile options to be shared between cc and nasm, for example.
+
+\b Minor cleanups.
+
+\b Went through the list of Katmai instructions and hopefully fixed the
+  (rather few) mistakes in it.
+
+\b (Hopefully) fixed a number of disassembler bugs related to ambiguous
+  instructions (disambiguated by -p) and SSE instructions with REP.
+
+\b Fix for bug reported by Mark Junger: "call dword 0x12345678" should
+  work and may add an OSP (affected CALL, JMP, Jcc).
+
+\b Fix for environments when "stderr" isn't a compile-time constant.
+
+
+\S{cl-0.98p6} Version 0.98p6
+
+
+\b Took officially over coordination of the 0.98 release; so drop
+  the p3.x notation. Skipped p4 and p5 to avoid confusion with John
+  Fine's J4 and J5 releases.
+
+\b Update the documentation; however, it still doesn't include
+  documentation for the various new instructions.  I somehow wonder if
+  it makes sense to have an instruction set reference in the assembler
+  manual when Intel et al have PDF versions of their manuals online.
+
+\b Recognize "idt" or "centaur" for the -p option to ndisasm.
+
+\b Changed error messages back to stderr where they belong, but add an
+  -E option to redirect them elsewhere (the DOS shell cannot redirect
+  stderr.)
+
+\b -M option to generate Makefile dependencies (based on code from Alex
+  Verstak.)
+
+\b \c{%undef} preprocessor directive, and -u option, that undefines a
+  single-line macro.
+
+\b OS/2 Makefile (Mkfiles/Makefile.os2) for Borland under OS/2; from
+  Chuck Crayne.
+
+\b Various minor bugfixes (reported by):
+  - Dangling \c{%s} in preproc.c (Martin Junker)
+
+\b THERE ARE KNOWN BUGS IN SSE AND THE OTHER KATMAI INSTRUCTIONS.  I am
+  on a trip and didn't bring the Katmai instruction reference, so I
+  can't work on them right now.
+
+\b Updated the License file per agreement with Simon and Jules to
+  include a GPL distribution clause.
+
+
+\S{cl-0.98p3.7} Version 0.98p3.7
+
+\b (Hopefully) fixed the canned Makefiles to include the outrdf2 and
+  zoutieee modules.
+
+\b Renamed changes.asm to changed.asm.
+
+
+\S{cl-0.98p3.6} Version 0.98p3.6
+
+\b Fixed a bunch of instructions that were added in 0.98p3.5 which had
+  memory operands, and the address-size prefix was missing from the
+  instruction pattern.
+
+
+\S{cl-0.98p3.5} Version 0.98p3.5
+
+\b Merged in changes from John S. Fine's 0.98-J5 release.  John's based
+  0.98-J5 on my 0.98p3.3 release; this merges the changes.
+
+\b Expanded the instructions flag field to a long so we can fit more
+  flags; mark SSE (KNI) and AMD or Katmai-specific instructions as
+  such.
+
+\b Fix the "PRIV" flag on a bunch of instructions, and create new
+  "PROT" flag for protected-mode-only instructions (orthogonal to if
+  the instruction is privileged!) and new "SMM" flag for SMM-only
+  instructions.
+
+\b Added AMD-only SYSCALL and SYSRET instructions.
+
+\b Make SSE actually work, and add new Katmai MMX instructions.
+
+\b Added a -p (preferred vendor) option to ndisasm so that it can
+  distinguish e.g. Cyrix opcodes also used in SSE.  For example:
+
+\c      ndisasm -p cyrix aliased.bin
+\c      00000000  670F514310        paddsiw mm0,[ebx+0x10]
+\c      00000005  670F514320        paddsiw mm0,[ebx+0x20]
+\c      ndisasm -p intel aliased.bin
+\c      00000000  670F514310        sqrtps xmm0,[ebx+0x10]
+\c      00000005  670F514320        sqrtps xmm0,[ebx+0x20]
+
+\b Added a bunch of Cyrix-specific instructions.
+
+
+\S{cl-0.98p3.4} Version 0.98p3.4
+
+\b Made at least an attempt to modify all the additional Makefiles (in
+  the Mkfiles directory).  I can't test it, but this was the best I
+  could do.
+
+\b DOS DJGPP+"Opus Make" Makefile from John S. Fine.
+
+\b changes.asm changes from John S. Fine.
+
+
+\S{cl-0.98p3.3} Version 0.98p3.3
+
+\b Patch from Conan Brink to allow nesting of \c{%rep} directives.
+
+\b If we're going to allow INT01 as an alias for INT1/ICEBP (one of
+  Jules 0.98p3 changes), then we should allow INT03 as an alias for INT3
+  as well.
+
+\b Updated changes.asm to include the latest changes.
+
+\b Tried to clean up the <CR>s that had snuck in from a DOS/Windows
+  environment into my Unix environment, and try to make sure than
+  DOS/Windows users get them back.
+
+\b We would silently generate broken tools if insns.dat wasn't sorted
+  properly.  Change insns.pl so that the order doesn't matter.
+
+\b Fix bug in insns.pl (introduced by me) which would cause conditional
+  instructions to have an extra "cc" in disassembly, e.g. "jnz"
+  disassembled as "jccnz".
+
+
+\S{cl-0.98p3.2} Version 0.98p3.2
+
+\b Merged in John S. Fine's changes from his 0.98-J4 prerelease; see
+  http://www.csoft.net/cz/johnfine/
+
+\b Changed previous "spotless" Makefile target (appropriate for distribution)
+  to "distclean", and added "cleaner" target which is same as "clean"
+  except deletes files generated by Perl scripts; "spotless" is union.
+
+\b Removed BASIC programs from distribution.  Get a Perl interpreter
+  instead (see below.)
+
+\b Calling this "pre-release 3.2" rather than "p3-hpa2" because of
+  John's contributions.
+
+\b Actually link in the IEEE output format (zoutieee.c); fix a bunch of
+  compiler warnings in that file.  Note I don't know what IEEE output
+  is supposed to look like, so these changes were made "blind".
+
+
+\S{cl-0.98p3-hpa} Version 0.98p3-hpa
+
+\b Merged nasm098p3.zip with nasm-0.97.tar.gz to create a fully
+  buildable version for Unix systems (Makefile.in updates, etc.)
+
+\b Changed insns.pl to create the instruction tables in nasm.h and
+  names.c, so that a new instruction can be added by adding it *only*
+  to insns.dat.
+
+\b Added the following new instructions: SYSENTER, SYSEXIT, FXSAVE,
+  FXRSTOR, UD1, UD2 (the latter two are two opcodes that Intel
+  guarantee will never be used; one of them is documented as UD2 in
+  Intel documentation, the other one just as "Undefined Opcode" --
+  calling it UD1 seemed to make sense.)
+
+\b MAX_SYMBOL was defined to be 9, but LOADALL286 and LOADALL386 are 10
+  characters long.  Now MAX_SYMBOL is derived from insns.dat.
+
+\b A note on the BASIC programs included: forget them.  insns.bas is
+  already out of date.  Get yourself a Perl interpreter for your
+  platform of choice at
+  \W{http://www.cpan.org/ports/index.html}{http://www.cpan.org/ports/index.html}.
+
+
+\S{cl-0.98p3} Version 0.98 pre-release 3
+
+\b added response file support, improved command line handling, new layout
+help screen
+
+\b fixed limit checking bug, 'OUT byte nn, reg' bug, and a couple of rdoff
+related bugs, updated Wishlist; 0.98 Prerelease 3.
+
+
+\S{cl-0.98p2} Version 0.98 pre-release 2
+
+\b fixed bug in outcoff.c to do with truncating section names longer
+than 8 characters, referencing beyond end of string; 0.98 pre-release 2
+
+
+\S{cl-0.98p1} Version 0.98 pre-release 1
+
+\b Fixed a bug whereby STRUC didn't work at all in RDF.
+
+\b Fixed a problem with group specification in PUBDEFs in OBJ.
+
+\b Improved ease of adding new output formats. Contribution due to
+Fox Cutter.
+
+\b Fixed a bug in relocations in the `bin' format: was showing up when
+a relocatable reference crossed an 8192-byte boundary in any output
+section.
+
+\b Fixed a bug in local labels: local-label lookups were inconsistent
+between passes one and two if an EQU occurred between the definition
+of a global label and the subsequent use of a local label local to
+that global.
+
+\b Fixed a seg-fault in the preprocessor (again) which happened when
+you use a blank line as the first line of a multi-line macro
+definition and then defined a label on the same line as a call to
+that macro.
+
+\b Fixed a stale-pointer bug in the handling of the NASM environment
+variable. Thanks to Thomas McWilliams.
+
+\b ELF had a hard limit on the number of sections which caused
+segfaults when transgressed. Fixed.
+
+\b Added ability for ndisasm to read from stdin by using `-' as the
+filename.
+
+\b ndisasm wasn't outputting the TO keyword. Fixed.
+
+\b Fixed error cascade on bogus expression in \c{%if} - an error in
+evaluation was causing the entire \c{%if} to be discarded, thus creating
+trouble later when the \c{%else} or \c{%endif} was encountered.
+
+\b Forward reference tracking was instruction-granular not operand-
+granular, which was causing 286-specific code to be generated
+needlessly on code of the form `shr word [forwardref],1'. Thanks to
+Jim Hague for sending a patch.
+
+\b All messages now appear on stdout, as sending them to stderr serves
+no useful purpose other than to make redirection difficult.
+
+\b Fixed the problem with EQUs pointing to an external symbol - this
+now generates an error message.
+
+\b Allowed multiple size prefixes to an operand, of which only the first
+is taken into account.
+
+\b Incorporated John Fine's changes, including fixes of a large number
+of preprocessor bugs, some small problems in OBJ, and a reworking of
+label handling to define labels before their line is assembled, rather
+than after.
+
+\b Reformatted a lot of the source code to be more readable. Included
+'coding.txt' as a guideline for how to format code for contributors.
+
+\b Stopped nested \c{%reps} causing a panic - they now cause a slightly more
+friendly error message instead.
+
+\b Fixed floating point constant problems (patch by Pedro Gimeno)
+
+\b Fixed the return value of insn_size() not being checked for -1, indicating
+an error.
+
+\b Incorporated 3Dnow! instructions.
+
+\b Fixed the 'mov eax, eax + ebx' bug.
+
+\b Fixed the GLOBAL EQU bug in ELF. Released developers release 3.
+
+\b Incorporated John Fine's command line parsing changes
+
+\b Incorporated David Lindauer's OMF debug support
+
+\b Made changes for LCC 4.0 support (\c{__NASM_CDecl__}, removed register size
+specification warning when sizes agree).
+
+
+\H{cl-0.9x} NASM 0.9 Series
+
+Revisions before 0.98.
+
+
+\S{cl-0.97} Version 0.97 released December 1997
+
+\b This was entirely a bug-fix release to 0.96, which seems to have got
+cursed. Silly me.
+
+\b Fixed stupid mistake in OBJ which caused `MOV EAX,<constant>' to
+fail. Caused by an error in the `MOV EAX,<segment>' support.
+
+\b ndisasm hung at EOF when compiled with lcc on Linux because lcc on
+Linux somehow breaks feof(). ndisasm now does not rely on feof().
+
+\b A heading in the documentation was missing due to a markup error in
+the indexing. Fixed.
+
+\b Fixed failure to update all pointers on realloc() within extended-
+operand code in parser.c. Was causing wrong behaviour and seg faults
+on lines such as `dd 0.0,0.0,0.0,0.0,...'
+
+\b Fixed a subtle preprocessor bug whereby invoking one multi-line
+macro on the first line of the expansion of another, when the second
+had been invoked with a label defined before it, didn't expand the
+inner macro. 
+
+\b Added internal.doc back in to the distribution archives - it was
+missing in 0.96 *blush*
+
+\b Fixed bug causing 0.96 to be unable to assemble its own test files,
+specifically objtest.asm. *blush again*
+
+\b Fixed seg-faults and bogus error messages caused by mismatching
+\c{%rep} and \c{%endrep} within multi-line macro definitions.
+
+\b Fixed a problem with buffer overrun in OBJ, which was causing
+corruption at ends of long PUBDEF records.
+
+\b Separated DOS archives into main-program and documentation to reduce
+download size.
+
+
+\S{cl-0.96} Version 0.96 released November 1997
+
+\b Fixed a bug whereby, if `nasm sourcefile' would cause a filename
+collision warning and put output into `nasm.out', then `nasm
+sourcefile -o outputfile' still gave the warning even though the
+`-o' was honoured.
+Fixed name pollution under Digital UNIX: one of its header files
+defined R_SP, which broke the enum in nasm.h.
+
+\b Fixed minor instruction table problems: FUCOM and FUCOMP didn't have
+two-operand forms; NDISASM didn't recognise the longer register
+forms of PUSH and POP (eg FF F3 for PUSH BX); TEST mem,imm32 was
+flagged as undocumented; the 32-bit forms of CMOV had 16-bit operand
+size prefixes; `AAD imm' and `AAM imm' are no longer flagged as
+undocumented because the Intel Architecture reference documents
+them.
+
+\b Fixed a problem with the local-label mechanism, whereby strange
+types of symbol (EQUs, auto-defined OBJ segment base symbols)
+interfered with the `previous global label' value and screwed up
+local labels.
+
+\b Fixed a bug whereby the stub preprocessor didn't communicate with
+the listing file generator, so that the -a and -l options in
+conjunction would produce a useless listing file.
+
+\b Merged `os2' object file format back into `obj', after discovering
+that `obj' _also_ shouldn't have a link pass separator in a module
+containing a non-trivial MODEND. Flat segments are now declared
+using the FLAT attribute. `os2' is no longer a valid object format
+name: use `obj'.
+
+\b Removed the fixed-size temporary storage in the evaluator. Very very
+long expressions (like `mov ax,1+1+1+1+...' for two hundred 1s or
+so) should now no longer crash NASM.
+
+\b Fixed a bug involving segfaults on disassembly of MMX instructions,
+by changing the meaning of one of the operand-type flags in nasm.h.
+This may cause other apparently unrelated MMX problems; it needs to
+be tested thoroughly.
+
+\b Fixed some buffer overrun problems with large OBJ output files.
+Thanks to DJ Delorie for the bug report and fix.
+
+\b Made preprocess-only mode actually listen to the \c{%line} markers as it
+prints them, so that it can report errors more sanely.
+
+\b Re-designed the evaluator to keep more sensible track of expressions
+involving forward references: can now cope with previously-nightmare
+situations such as:
+
+\c   mov ax,foo | bar
+\c   foo equ 1
+\c   bar equ 2
+
+\b Added the ALIGN and ALIGNB standard macros.
+
+\b Added PIC support in ELF: use of WRT to obtain the four extra
+relocation types needed.
+
+\b Added the ability for output file formats to define their own
+extensions to the GLOBAL, COMMON and EXTERN directives.
+
+\b Implemented common-variable alignment, and global-symbol type and
+size declarations, in ELF.
+
+\b Implemented NEAR and FAR keywords for common variables, plus
+far-common element size specification, in OBJ.
+
+\b Added a feature whereby EXTERNs and COMMONs in OBJ can be given a
+default WRT specification (either a segment or a group).
+
+\b Transformed the Unix NASM archive into an auto-configuring package.
+
+\b Added a sanity-check for people applying SEG to things which are
+already segment bases: this previously went unnoticed by the SEG
+processing and caused OBJ-driver panics later.
+
+\b Added the ability, in OBJ format, to deal with `MOV EAX,<segment>'
+type references: OBJ doesn't directly support dword-size segment
+base fixups, but as long as the low two bytes of the constant term
+are zero, a word-size fixup can be generated instead and it will
+work.
+
+\b Added the ability to specify sections' alignment requirements in
+Win32 object files and pure binary files.
+
+\b Added preprocess-time expression evaluation: the \c{%assign} (and
+\c{%iassign}) directive and the bare \c{%if} (and \c{%elif}) conditional. Added
+relational operators to the evaluator, for use only in \c{%if}
+constructs: the standard relationals = < > <= >= <> (and C-like
+synonyms == and !=) plus low-precedence logical operators &&, ^^ and
+||.
+
+\b Added a preprocessor repeat construct: \c{%rep} / \c{%exitrep} / \c{%endrep}.
+
+\b Added the __FILE__ and __LINE__ standard macros.
+
+\b Added a sanity check for number constants being greater than
+0xFFFFFFFF. The warning can be disabled.
+
+\b Added the %0 token whereby a variadic multi-line macro can tell how
+many parameters it's been given in a specific invocation.
+
+\b Added \c{%rotate}, allowing multi-line macro parameters to be cycled.
+
+\b Added the `*' option for the maximum parameter count on multi-line
+macros, allowing them to take arbitrarily many parameters.
+
+\b Added the ability for the user-level forms of EXTERN, GLOBAL and
+COMMON to take more than one argument.
+
+\b Added the IMPORT and EXPORT directives in OBJ format, to deal with
+Windows DLLs.
+
+\b Added some more preprocessor \c{%if} constructs: \c{%ifidn} / \c{%ifidni} (exact
+textual identity), and \c{%ifid} / \c{%ifnum} / \c{%ifstr} (token type testing).
+
+\b Added the ability to distinguish SHL AX,1 (the 8086 version) from
+SHL AX,BYTE 1 (the 286-and-upwards version whose constant happens to
+be 1).
+
+\b Added NetBSD/FreeBSD/OpenBSD's variant of a.out format, complete
+with PIC shared library features.
+
+\b Changed NASM's idiosyncratic handling of FCLEX, FDISI, FENI, FINIT,
+FSAVE, FSTCW, FSTENV, and FSTSW to bring it into line with the
+otherwise accepted standard. The previous behaviour, though it was a
+deliberate feature, was a deliberate feature based on a
+misunderstanding. Apologies for the inconvenience.
+
+\b Improved the flexibility of ABSOLUTE: you can now give it an
+expression rather than being restricted to a constant, and it can
+take relocatable arguments as well.
+
+\b Added the ability for a variable to be declared as EXTERN multiple
+times, and the subsequent definitions are just ignored.
+
+\b We now allow instruction prefixes (CS, DS, LOCK, REPZ etc) to be
+alone on a line (without a following instruction).
+
+\b Improved sanity checks on whether the arguments to EXTERN, GLOBAL
+and COMMON are valid identifiers.
+
+\b Added misc/exebin.mac to allow direct generation of .EXE files by
+hacking up an EXE header using DB and DW; also added test/binexe.asm
+to demonstrate the use of this. Thanks to Yann Guidon for
+contributing the EXE header code.
+
+\b ndisasm forgot to check whether the input file had been successfully
+opened. Now it does. Doh!
+
+\b Added the Cyrix extensions to the MMX instruction set.
+
+\b Added a hinting mechanism to allow [EAX+EBX] and [EBX+EAX] to be
+assembled differently. This is important since [ESI+EBP] and
+[EBP+ESI] have different default base segment registers.
+
+\b Added support for the PharLap OMF extension for 4096-byte segment
+alignment.
+
+
+\S{cl-0.95 released July 1997} Version 0.95 released July 1997
+
+\b Fixed yet another ELF bug. This one manifested if the user relied on
+the default segment, and attempted to define global symbols without
+first explicitly declaring the target segment.
+
+\b Added makefiles (for NASM and the RDF tools) to build Win32 console
+apps under Symantec C++. Donated by Mark Junker.
+
+\b Added `macros.bas' and `insns.bas', QBasic versions of the Perl
+scripts that convert `standard.mac' to `macros.c' and convert
+`insns.dat' to `insnsa.c' and `insnsd.c'. Also thanks to Mark
+Junker.
+
+\b Changed the diassembled forms of the conditional instructions so
+that JB is now emitted as JC, and other similar changes. Suggested
+list by Ulrich Doewich.
+
+\b Added `@' to the list of valid characters to begin an identifier
+with.
+
+\b Documentary changes, notably the addition of the `Common Problems'
+section in nasm.doc.
+
+\b Fixed a bug relating to 32-bit PC-relative fixups in OBJ.
+
+\b Fixed a bug in perm_copy() in labels.c which was causing exceptions
+in cleanup_labels() on some systems.
+
+\b Positivity sanity check in TIMES argument changed from a warning to
+an error following a further complaint.
+
+\b Changed the acceptable limits on byte and word operands to allow
+things like `~10111001b' to work.
+
+\b Fixed a major problem in the preprocessor which caused seg-faults if
+macro definitions contained blank lines or comment-only lines.
+
+\b Fixed inadequate error checking on the commas separating the
+arguments to `db', `dw' etc.
+
+\b Fixed a crippling bug in the handling of macros with operand counts
+defined with a `+' modifier.
+
+\b Fixed a bug whereby object file formats which stored the input file
+name in the output file (such as OBJ and COFF) weren't doing so
+correctly when the output file name was specified on the command
+line.
+
+\b Removed [INC] and [INCLUDE] support for good, since they were
+obsolete anyway.
+
+\b Fixed a bug in OBJ which caused all fixups to be output in 16-bit
+(old-format) FIXUPP records, rather than putting the 32-bit ones in
+FIXUPP32 (new-format) records.
+
+\b Added, tentatively, OS/2 object file support (as a minor variant on
+OBJ).
+
+\b Updates to Fox Cutter's Borland C makefile, Makefile.bc2.
+
+\b Removed a spurious second fclose() on the output file.
+
+\b Added the `-s' command line option to redirect all messages which
+would go to stderr (errors, help text) to stdout instead.
+
+\b Added the `-w' command line option to selectively suppress some
+classes of assembly warning messages.
+
+\b Added the `-p' pre-include and `-d' pre-define command-line options.
+
+\b Added an include file search path: the `-i' command line option.
+
+\b Fixed a silly little preprocessor bug whereby starting a line with a
+`%!' environment-variable reference caused an `unknown directive'
+error.
+
+\b Added the long-awaited listing file support: the `-l' command line
+option.
+
+\b Fixed a problem with OBJ format whereby, in the absence of any
+explicit segment definition, non-global symbols declared in the
+implicit default segment generated spurious EXTDEF records in the
+output.
+
+\b Added the NASM environment variable.
+
+\b From this version forward, Win32 console-mode binaries will be
+included in the DOS distribution in addition to the 16-bit binaries.
+Added Makefile.vc for this purpose.
+
+\b Added `return 0;' to test/objlink.c to prevent compiler warnings.
+
+\b Added the __NASM_MAJOR__ and __NASM_MINOR__ standard defines.
+
+\b Added an alternative memory-reference syntax in which prefixing an
+operand with `&' is equivalent to enclosing it in square brackets,
+at the request of Fox Cutter.
+
+\b Errors in pass two now cause the program to return a non-zero error
+code, which they didn't before.
+
+\b Fixed the single-line macro cycle detection, which didn't work at
+all on macros with no parameters (caused an infinite loop). Also
+changed the behaviour of single-line macro cycle detection to work
+like cpp, so that macros like `extrn' as given in the documentation
+can be implemented.
+
+\b Fixed the implementation of WRT, which was too restrictive in that
+you couldn't do `mov ax,[di+abc wrt dgroup]' because (di+abc) wasn't
+a relocatable reference.
+
+
+\S{cl-0.94 released April 1997} Version 0.94 released April 1997
+
+
+\b Major item: added the macro processor.
+
+\b Added undocumented instructions SMI, IBTS, XBTS and LOADALL286. Also
+reorganised CMPXCHG instruction into early-486 and Pentium forms.
+Thanks to Thobias Jones for the information.
+
+\b Fixed two more stupid bugs in ELF, which were causing `ld' to
+continue to seg-fault in a lot of non-trivial cases.
+
+\b Fixed a seg-fault in the label manager.
+
+\b Stopped FBLD and FBSTP from _requiring_ the TWORD keyword, which is
+the only option for BCD loads/stores in any case.
+
+\b Ensured FLDCW, FSTCW and FSTSW can cope with the WORD keyword, if
+anyone bothers to provide it. Previously they complained unless no
+keyword at all was present.
+
+\b Some forms of FDIV/FDIVR and FSUB/FSUBR were still inverted: a
+vestige of a bug that I thought had been fixed in 0.92. This was
+fixed, hopefully for good this time...
+
+\b Another minor phase error (insofar as a phase error can _ever_ be
+minor) fixed, this one occurring in code of the form
+
+\c   rol ax,forward_reference
+\c   forward_reference equ 1
+
+\b The number supplied to TIMES is now sanity-checked for positivity,
+and also may be greater than 64K (which previously didn't work on
+16-bit systems).
+
+\b Added Watcom C makefiles, and misc/pmw.bat, donated by Dominik Behr.
+
+\b Added the INCBIN pseudo-opcode.
+
+\b Due to the advent of the preprocessor, the [INCLUDE] and [INC]
+directives have become obsolete. They are still supported in this
+version, with a warning, but won't be in the next.
+
+\b Fixed a bug in OBJ format, which caused incorrect object records to
+be output when absolute labels were made global.
+
+\b Updates to RDOFF subdirectory, and changes to outrdf.c.
+
+
+\S{cl-0.93 released January 1997} Version 0.93 released January 1997
+
+This release went out in a great hurry after semi-crippling bugs
+were found in 0.92.
+
+\b Really \e{did} fix the stack overflows this time. *blush*
+
+\b Had problems with EA instruction sizes changing between passes, when
+an offset contained a forward reference and so 4 bytes were
+allocated for the offset in pass one; by pass two the symbol had
+been defined and happened to be a small absolute value, so only 1
+byte got allocated, causing instruction size mismatch between passes
+and hence incorrect address calculations. Fixed.
+
+\b Stupid bug in the revised ELF section generation fixed (associated
+string-table section for .symtab was hard-coded as 7, even when this
+didn't fit with the real section table). Was causing `ld' to
+seg-fault under Linux.
+
+\b Included a new Borland C makefile, Makefile.bc2, donated by Fox
+Cutter <lmb@comtch.iea.com>.
+
+
+\S{cl-0.92 released January 1997} Version 0.92 released January 1997
+
+\b The FDIVP/FDIVRP and FSUBP/FSUBRP pairs had been inverted: this was
+fixed. This also affected the LCC driver.
+
+\b Fixed a bug regarding 32-bit effective addresses of the form
+\c{[other_register+ESP]}.
+
+\b Documentary changes, notably documentation of the fact that Borland
+Win32 compilers use `obj' rather than `win32' object format.
+
+\b Fixed the COMENT record in OBJ files, which was formatted
+incorrectly.
+
+\b Fixed a bug causing segfaults in large RDF files.
+
+\b OBJ format now strips initial periods from segment and group
+definitions, in order to avoid complications with the local label
+syntax.
+
+\b Fixed a bug in disassembling far calls and jumps in NDISASM.
+
+\b Added support for user-defined sections in COFF and ELF files.
+
+\b Compiled the DOS binaries with a sensible amount of stack, to
+prevent stack overflows on any arithmetic expression containing
+parentheses.
+
+\b Fixed a bug in handling of files that do not terminate in a newline.
+
+
+\S{cl-0.91 released November 1996} Version 0.91 released November 1996
+
+\b Loads of bug fixes.
+
+\b Support for RDF added.
+
+\b Support for DBG debugging format added.
+
+\b Support for 32-bit extensions to Microsoft OBJ format added.
+
+\b Revised for Borland C: some variable names changed, makefile added.
+
+\b LCC support revised to actually work.
+
+\b JMP/CALL NEAR/FAR notation added.
+
+\b `a16', `o16', `a32' and `o32' prefixes added.
+
+\b Range checking on short jumps implemented.
+
+\b MMX instruction support added.
+
+\b Negative floating point constant support added.
+
+\b Memory handling improved to bypass 64K barrier under DOS.
+
+\b \c{$} prefix to force treatment of reserved words as identifiers added.
+
+\b Default-size mechanism for object formats added.
+
+\b Compile-time configurability added.
+
+\b \c{#}, \c{@}, \c{~} and c\{?} are now valid characters in labels.
+
+\b \c{-e} and \c{-k} options in NDISASM added.
+
+
+\S{cl-0.90 released October 1996} Version 0.90 released October 1996
+
+First release version. First support for object file output. Other
+changes from previous version (0.3x) too numerous to document.
diff --git a/doc/genps.pl b/doc/genps.pl
new file mode 100755 (executable)
index 0000000..c7c23cf
--- /dev/null
@@ -0,0 +1,1231 @@
+#!/usr/bin/perl
+## --------------------------------------------------------------------------
+##   
+##   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.
+##
+## --------------------------------------------------------------------------
+
+#
+# Format the documentation as PostScript
+#
+
+use Env;
+use lib $srcdir;
+
+require 'psfonts.ph';          # The fonts we want to use
+require 'pswidth.ph';          # PostScript string width
+
+use Fcntl;
+
+#
+# PostScript configurables; these values are also available to the
+# PostScript code itself
+#
+%psconf = (
+          pagewidth => 595,    # Page width in PostScript points
+          pageheight => 792,   # Page height in PostScript points
+          lmarg => 100,        # Left margin in PostScript points
+          rmarg => 50,         # Right margin in PostScript points
+          topmarg => 100,      # Top margin in PostScript points
+          botmarg => 100,      # Bottom margin in PostScript points
+          plmarg => 50,        # Page number position relative to left margin
+          prmarg => 0,         # Page number position relative to right margin
+          pymarg => 50,        # Page number position relative to bot margin
+          startcopyright => 75, # How much above the bottom margin is the
+                                # copyright notice stuff
+          bulladj => 12,       # How much to indent a bullet paragraph
+          tocind => 12,        # TOC indentation per level
+          tocpnz => 24,        # Width of TOC page number only zone
+          tocdots => 8,        # Spacing between TOC dots
+          idxspace => 24,      # Minimum space between index title and pg#
+          idxindent => 24,     # How much to indent a subindex entry
+          idxgutter => 24,     # Space between index columns
+          idxcolumns => 2,     # Number of index columns
+          );
+
+%psbool = (
+          colorlinks => 0,     # Set links in blue rather than black
+          );
+
+# Known paper sizes
+%papersizes = (
+              'a5'     => [421, 595], # ISO half paper size
+              'b5'     => [501, 709], # ISO small paper size
+              'a4'     => [595, 842], # ISO standard paper size
+              'letter' => [612, 792], # US common paper size
+              'pa4'    => [595, 792], # Compromise ("portable a4")
+              'b4'     => [709,1002], # ISO intermediate paper size
+              'legal'  => [612,1008], # US intermediate paper size
+              'a3'     => [842,1190], # ISO double paper size
+              '11x17'  => [792,1224], # US double paper size
+              );
+
+#
+# Parse the command line
+#
+undef $input;
+while ( $arg = shift(@ARGV) ) {
+    if ( $arg =~ /^\-(|no\-)(.*)$/ ) {
+       $parm = $2;
+       $true = ($1 eq '') ? 1 : 0;
+       if ( $true && defined($papersizes{$parm}) ) {
+           $psconf{pagewidth}  = $papersizes{$parm}->[0];
+           $psconf{pageheight} = $papersizes{$parm}->[1];
+       } elsif ( defined($psbool{$parm}) ) {
+           $psbool{$parm} = $true;
+       } elsif ( $true && defined($psconf{$parm}) ) {
+           $psconf{$parm} = shift(@ARGV);
+       } elsif ( $parm =~ /^(title|subtitle|year|author|license)$/ ) {
+           $metadata{$parm} = shift(@ARGV);
+       } else {
+           die "$0: Unknown option: $arg\n";
+       }
+    } else {
+       $input = $arg;
+    }
+}
+
+#
+# Document formatting parameters
+#
+$paraskip = 6;                 # Space between paragraphs
+$chapstart = 30;               # Space before a chapter heading
+$chapskip = 24;                        # Space after a chapter heading
+$tocskip = 6;                  # Space between TOC entries
+
+# Configure post-paragraph skips for each kind of paragraph
+%skiparray = ('chap' => $chapskip, 'appn' => $chapstart,
+             'head' => $paraskip, 'subh' => $paraskip,
+             'norm' => $paraskip, 'bull' => $paraskip,
+             'code' => $paraskip, 'toc0' => $tocskip,
+             'toc1' => $tocskip,  'toc2' => $tocskip);
+
+# Custom encoding vector.  This is basically the same as
+# ISOLatin1Encoding (a level 2 feature, so we dont want to use it),
+# but with the "naked" accents at \200-\237 moved to the \000-\037
+# range (ASCII control characters), and a few extra characters thrown
+# in.  It is basically a modified Windows 1252 codepage, minus, for
+# now, the euro sign (\200 is reserved for euro.)
+
+@NASMEncoding =
+(
+ undef, undef, undef, undef, undef, undef, undef, undef, undef, undef,
+ undef, undef, undef, undef, undef, undef, 'dotlessi', 'grave',
+ 'acute', 'circumflex', 'tilde', 'macron', 'breve', 'dotaccent',
+ 'dieresis', undef, 'ring', 'cedilla', undef, 'hungarumlaut',
+ 'ogonek', 'caron', 'space', 'exclam', 'quotedbl', 'numbersign',
+ 'dollar', 'percent', 'ampersand', 'quoteright', 'parenleft',
+ 'parenright', 'asterisk', 'plus', 'comma', 'minus', 'period',
+ 'slash', 'zero', 'one', 'two', 'three', 'four', 'five', 'six',
+ 'seven', 'eight', 'nine', 'colon', 'semicolon', 'less', 'equal',
+ 'greater', 'question', 'at', 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H',
+ 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V',
+ 'W', 'X', 'Y', 'Z', 'bracketleft', 'backslash', 'bracketright',
+ 'asciicircum', 'underscore', 'quoteleft', 'a', 'b', 'c', 'd', 'e',
+ 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's',
+ 't', 'u', 'v', 'w', 'x', 'y', 'z', 'braceleft', 'bar', 'braceright',
+ 'asciitilde', undef, undef, undef, 'quotesinglbase', 'florin',
+ 'quotedblbase', 'ellipsis', 'dagger', 'dbldagger', 'circumflex',
+ 'perthousand', 'Scaron', 'guilsinglleft', 'OE', undef, 'Zcaron',
+ undef, undef, 'grave', 'quotesingle', 'quotedblleft',
+ 'quotedblright', 'bullet', 'endash', 'emdash', 'tilde', 'trademark',
+ 'scaron', 'guilsignlright', 'oe', undef, 'zcaron', 'Ydieresis',
+ 'space', 'exclamdown', 'cent', 'sterling', 'currency', 'yen',
+ 'brokenbar', 'section', 'dieresis', 'copyright', 'ordfeminine',
+ 'guillemotleft', 'logicalnot', 'hyphen', 'registered', 'macron',
+ 'degree', 'plusminus', 'twosuperior', 'threesuperior', 'acute', 'mu',
+ 'paragraph', 'periodcentered', 'cedilla', 'onesuperior',
+ 'ordmasculine', 'guillemotright', 'onequarter', 'onehalf',
+ 'threequarters', 'questiondown', 'Agrave', 'Aacute', 'Acircumflex',
+ 'Atilde', 'Adieresis', 'Aring', 'AE', 'Ccedilla', 'Egrave', 'Eacute',
+ 'Ecircumflex', 'Edieresis', 'Igrave', 'Iacute', 'Icircumflex',
+ 'Idieresis', 'Eth', 'Ntilde', 'Ograve', 'Oacute', 'Ocircumflex',
+ 'Otilde', 'Odieresis', 'multiply', 'Oslash', 'Ugrave', 'Uacute',
+ 'Ucircumflex', 'Udieresis', 'Yacute', 'Thorn', 'germandbls',
+ 'agrave', 'aacute', 'acircumflex', 'atilde', 'adieresis', 'aring',
+ 'ae', 'ccedilla', 'egrave', 'eacute', 'ecircumflex', 'edieresis',
+ 'igrave', 'iacute', 'icircumflex', 'idieresis', 'eth', 'ntilde',
+ 'ograve', 'oacute', 'ocircumflex', 'otilde', 'odieresis', 'divide',
+ 'oslash', 'ugrave', 'uacute', 'ucircumflex', 'udieresis', 'yacute',
+ 'thorn', 'ydieresis'
+);
+
+# Name-to-byte lookup hash
+%charcode = ();
+for ( $i = 0 ; $i < 256 ; $i++ ) {
+    $charcode{$NASMEncoding[$i]} = chr($i);
+}
+
+#
+# First, format the stuff coming from the front end into
+# a cleaner representation
+#
+if ( defined($input) ) {
+    sysopen(PARAS, $input, O_RDONLY) or
+       die "$0: cannot open $input: $!\n";
+} else {
+    open(PARAS, "<&STDIN") or die "$0: $!\n";
+}
+while ( defined($line = <PARAS>) ) {
+    chomp $line;
+    $data = <PARAS>;
+    chomp $data;
+    if ( $line =~ /^meta :(.*)$/ ) {
+       $metakey = $1;
+       $metadata{$metakey} = $data;
+    } elsif ( $line =~ /^indx :(.*)$/ ) {
+       $ixentry = $1;
+       push(@ixentries, $ixentry);
+       $ixterms{$ixentry} = [split(/\037/, $data)];
+       # Look for commas.  This is easier done on the string
+       # representation, so do it now.
+       if ( $data =~ /^(.*)\,\037sp\037/ ) {
+           $ixprefix = $1;
+           $ixprefix =~ s/\037n $//; # Discard possible font change at end
+           $ixhasprefix{$ixentry} = $ixprefix;
+           if ( !$ixprefixes{$ixprefix} ) {
+               $ixcommafirst{$ixentry}++;
+           }
+           $ixprefixes{$ixprefix}++;
+       } else {
+           # A complete term can also be used as a prefix
+           $ixprefixes{$data}++;
+       }
+    } else {
+       push(@ptypes, $line);
+       push(@paras, [split(/\037/, $data)]);
+    }
+}
+close(PARAS);
+
+#
+# Convert an integer to a chosen base
+#
+sub int2base($$) {
+    my($i,$b) = @_;
+    my($s) = '';
+    my($n) = '';
+    my($z) = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ';
+    return '0' if ($i == 0);
+    if ( $i < 0 ) { $n = '-'; $i = -$i; }
+    while ( $i ) {
+       $s = substr($z,$i%$b,1) . $s;
+       $i = int($i/$b);
+    }
+    return $n.$s;
+}
+
+#
+# Convert a string to a rendering array
+#
+sub string2array($)
+{
+    my($s) = @_;
+    my(@a) = ();
+
+    $s =~ s/\B\-\-\B/$charcode{'emdash'}/g;
+    $s =~ s/\B\-\B/ $charcode{'endash'} /g;
+
+    while ( $s =~ /^(\s+|\S+)(.*)$/ ) {
+       push(@a, [0,$1]);
+       $s = $2;
+    }
+
+    return @a;
+}
+
+#
+# Take a crossreference name and generate the PostScript name for it.
+#
+# This hack produces a somewhat smaller PDF...
+#%ps_xref_list = ();
+#$ps_xref_next = 0;
+#sub ps_xref($) {
+#    my($s) = @_;
+#    my $q = $ps_xref_list{$s};
+#    return $q if ( defined($ps_xref_list{$s}) );
+#    $q = 'X'.int2base($ps_xref_next++, 52);
+#    $ps_xref_list{$s} = $q;
+#    return $q;
+#}
+
+# Somewhat bigger PDF, but one which obeys # URLs
+sub ps_xref($) {
+    return @_[0];
+}
+
+#
+# Flow lines according to a particular font set and width
+#
+# A "font set" is represented as an array containing
+# arrays of pairs: [<size>, <metricref>]
+#
+# Each line is represented as:
+# [ [type,first|last,aux,fontset,page,ypos,optional col],
+#   [rendering array] ]
+#
+# A space character may be "squeezed" by up to this much
+# (as a fraction of the normal width of a space.)
+#
+$ps_space_squeeze = 0.00;      # Min space width 100%
+sub ps_flow_lines($$$@) {
+    my($wid, $fontset, $type, @data) = @_;
+    my($fonts) = $$fontset{fonts};
+    my($e);
+    my($w)  = 0;               # Width of current line
+    my($sw) = 0;               # Width of current line due to spaces
+    my(@l)  = ();              # Current line
+    my(@ls) = ();              # Accumulated output lines
+    my(@xd) = ();              # Metadata that goes with subsequent text
+    my $hasmarker = 0;         # Line has -6 marker
+    my $pastmarker = 0;                # -6 marker found
+
+    # If there is a -6 marker anywhere in the paragraph,
+    # *each line* output needs to have a -6 marker
+    foreach $e ( @data ) {
+       $hasmarker = 1 if ( $$e[0] == -6 );
+    }
+
+    $w = 0;
+    foreach $e ( @data ) {
+       if ( $$e[0] < 0 ) {
+           # Type is metadata.  Zero width.
+           if ( $$e[0] == -6 ) {
+               $pastmarker = 1;
+           }
+           if ( $$e[0] == -1 || $$e[0] == -6 ) {
+               # -1 (end anchor) or -6 (marker) goes with the preceeding
+               # text, otherwise with the subsequent text
+               push(@l, $e);
+           } else {
+               push(@xd, $e);
+           }
+       } else {
+           my $ew = ps_width($$e[1], $fontset->{fonts}->[$$e[0]][1],
+                             \@NASMEncoding) *
+               ($fontset->{fonts}->[$$e[0]][0]/1000);
+           my $sp = $$e[1];
+           $sp =~ tr/[^ ]//d;  # Delete nonspaces
+           my $esw = ps_width($sp, $fontset->{fonts}->[$$e[0]][1],
+                              \@NASMEncoding) *
+               ($fontset->{fonts}->[$$e[0]][0]/1000);
+
+           if ( ($w+$ew) - $ps_space_squeeze*($sw+$esw) > $wid ) {
+               # Begin new line
+               # Search backwards for previous space chunk
+               my $lx = scalar(@l)-1;
+               my @rm = ();
+               while ( $lx >= 0 ) {
+                   while ( $lx >= 0 && $l[$lx]->[0] < 0 ) {
+                       # Skip metadata
+                       $pastmarker = 0 if ( $l[$lx]->[0] == -6 );
+                       $lx--;
+                   };
+                   if ( $lx >= 0 ) {
+                       if ( $l[$lx]->[1] eq ' ' ) {
+                           splice(@l, $lx, 1);
+                           @rm = splice(@l, $lx);
+                           last; # Found place to break
+                       } else {
+                           $lx--;
+                       }
+                   }
+               }
+
+               # Now @l contains the stuff to remain on the old line
+               # If we broke the line inside a link, then split the link
+               # into two.
+               my $lkref = undef;
+               foreach my $lc ( @l ) {
+                   if ( $$lc[0] == -2 || $$lc[0] == -3 || $lc[0] == -7 ) {
+                       $lkref = $lc;
+                   } elsif ( $$lc[0] == -1 ) {
+                       undef $lkref;
+                   }
+               }
+
+               if ( defined($lkref) ) {
+                   push(@l, [-1,undef]); # Terminate old reference
+                   unshift(@rm, $lkref); # Duplicate reference on new line
+               }
+
+               if ( $hasmarker ) {
+                   if ( $pastmarker ) {
+                       unshift(@rm,[-6,undef]); # New line starts with marker
+                   } else {
+                       push(@l,[-6,undef]); # Old line ends with marker
+                   }
+               }
+
+               push(@ls, [[$type,0,undef,$fontset,0,0],[@l]]);
+               @l = @rm;
+
+               $w = $sw = 0;
+               # Compute the width of the remainder array
+               for my $le ( @l ) {
+                   if ( $$le[0] >= 0 ) {
+                       my $xew = ps_width($$le[1],
+                                          $fontset->{fonts}->[$$le[0]][1],
+                                          \@NASMEncoding) *
+                           ($fontset->{fonts}->[$$le[0]][0]/1000);
+                       my $xsp = $$le[1];
+                       $xsp =~ tr/[^ ]//d;     # Delete nonspaces
+                       my $xsw = ps_width($xsp,
+                                          $fontset->{fonts}->[$$le[0]][1],
+                                          \@NASMEncoding) *
+                           ($fontset->{fonts}->[$$le[0]][0]/1000);
+                       $w += $xew;  $sw += $xsw;
+                   }
+               }
+           }
+           push(@l, @xd);      # Accumulated metadata
+           @xd = ();
+           if ( $$e[1] ne '' ) {
+               push(@l, $e);
+               $w += $ew; $sw += $esw;
+           }
+       }
+    }
+    push(@l,@xd);
+    if ( scalar(@l) ) {
+       push(@ls, [[$type,0,undef,$fontset,0,0],[@l]]); # Final line
+    }
+
+    # Mark the first line as first and the last line as last
+    if ( scalar(@ls) ) {
+       $ls[0]->[0]->[1] |= 1;     # First in para
+       $ls[-1]->[0]->[1] |= 2;    # Last in para
+    }
+    return @ls;
+}
+
+#
+# Once we have broken things into lines, having multiple chunks
+# with the same font index is no longer meaningful.  Merge
+# adjacent chunks to keep down the size of the whole file.
+#
+sub ps_merge_chunks(@) {
+    my(@ci) = @_;
+    my($c, $lc);
+    my(@co, $eco);
+
+    undef $lc;
+    @co = ();
+    $eco = -1;                 # Index of the last entry in @co
+    foreach $c ( @ci ) {
+       if ( defined($lc) && $$c[0] == $lc && $$c[0] >= 0 ) {
+           $co[$eco]->[1] .= $$c[1];
+       } else {
+           push(@co, $c);  $eco++;
+           $lc = $$c[0];
+       }
+    }
+    return @co;
+}
+
+#
+# Convert paragraphs to rendering arrays.  Each
+# element in the array contains (font, string),
+# where font can be one of:
+# -1 end link
+# -2 begin crossref
+# -3 begin weblink
+# -4 index item anchor
+# -5 crossref anchor
+# -6 left/right marker (used in the index)
+# -7 page link (used in the index)
+#  0 normal
+#  1 empatic (italic)
+#  2 code (fixed spacing)
+#
+
+sub mkparaarray($@) {
+    my($ptype, @chunks) = @_;
+
+    my @para = ();
+    my $in_e = 0;
+    my $chunk;
+
+    if ( $ptype =~ /^code/ ) {
+       foreach $chunk ( @chunks ) {
+           push(@para, [2, $chunk]);
+       }
+    } else {
+       foreach $chunk ( @chunks ) {
+           my $type = substr($chunk,0,2);
+           my $text = substr($chunk,2);
+
+           if ( $type eq 'sp' ) {
+               push(@para, [$in_e?1:0, ' ']);
+           } elsif ( $type eq 'da' ) {
+               push(@para, [$in_e?1:0, $charcode{'endash'}]);
+           } elsif ( $type eq 'n ' ) {
+               push(@para, [0, $text]);
+               $in_e = 0;
+           } elsif ( $type =~ '^e' ) {
+               push(@para, [1, $text]);
+               $in_e = ($type eq 'es' || $type eq 'e ');
+           } elsif ( $type eq 'c ' ) {
+               push(@para, [2, $text]);
+               $in_e = 0;
+           } elsif ( $type eq 'x ' ) {
+               push(@para, [-2, ps_xref($text)]);
+           } elsif ( $type eq 'xe' ) {
+               push(@para, [-1, undef]);
+           } elsif ( $type eq 'wc' || $type eq 'w ' ) {
+               $text =~ /\<(.*)\>(.*)$/;
+               my $link = $1; $text = $2;
+               push(@para, [-3, $link]);
+               push(@para, [($type eq 'wc') ? 2:0, $text]);
+               push(@para, [-1, undef]);
+               $in_e = 0;
+           } elsif ( $type eq 'i ' ) {
+               push(@para, [-4, $text]);
+           } else {
+               die "Unexpected paragraph chunk: $chunk";
+           }
+       }
+    }
+    return @para;
+}
+
+$npara = scalar(@paras);
+for ( $i = 0 ; $i < $npara ; $i++ ) {
+    $paras[$i] = [mkparaarray($ptypes[$i], @{$paras[$i]})];
+}
+
+#
+# This converts a rendering array to a simple string
+#
+sub ps_arraytostr(@) {
+    my $s = '';
+    my $c;
+    foreach $c ( @_ ) {
+       $s .= $$c[1] if ( $$c[0] >= 0 );
+    }
+    return $s;
+}
+
+#
+# This generates a duplicate of a paragraph
+#
+sub ps_dup_para(@) {
+    my(@i) = @_;
+    my(@o) = ();
+    my($c);
+
+    foreach $c ( @i ) {
+       my @cc = @{$c};
+       push(@o, [@cc]);
+    }
+    return @o;
+}
+
+#
+# This generates a duplicate of a paragraph, stripping anchor
+# tags (-4 and -5)
+#
+sub ps_dup_para_noanchor(@) {
+    my(@i) = @_;
+    my(@o) = ();
+    my($c);
+
+    foreach $c ( @i ) {
+       my @cc = @{$c};
+       push(@o, [@cc]) unless ( $cc[0] == -4 || $cc[0] == -5 );
+    }
+    return @o;
+}
+
+#
+# Scan for header paragraphs and fix up their contents;
+# also generate table of contents and PDF bookmarks.
+#
+@tocparas = ([[-5, 'contents'], [0,'Contents']]);
+@tocptypes = ('chap');
+@bookmarks = (['title', 0, 'Title'], ['contents', 0, 'Contents']);
+%bookref = ();
+for ( $i = 0 ; $i < $npara ; $i++ ) {
+    my $xtype = $ptypes[$i];
+    my $ptype = substr($xtype,0,4);
+    my $str;
+    my $book;
+
+    if ( $ptype eq 'chap' || $ptype eq 'appn' ) {
+       unless ( $xtype =~ /^\S+ (\S+) :(.*)$/ ) {
+           die "Bad para";
+       }
+       my $secn = $1;
+       my $sech = $2;
+       my $xref = ps_xref($sech);
+       my $chap = ($ptype eq 'chap')?'Chapter':'Appendix';
+
+       $book = [$xref, 0, ps_arraytostr(@{$paras[$i]})];
+       push(@bookmarks, $book);
+       $bookref{$secn} = $book;
+
+       push(@tocparas, [ps_dup_para_noanchor(@{$paras[$i]})]);
+       push(@tocptypes, 'toc0'.' :'.$sech.':'.$chap.' '.$secn.':');
+
+       unshift(@{$paras[$i]},
+               [-5, $xref], [0,$chap.' '.$secn.':'], [0, ' ']);
+    } elsif ( $ptype eq 'head' || $ptype eq 'subh' ) {
+       unless ( $xtype =~ /^\S+ (\S+) :(.*)$/ ) {
+           die "Bad para";
+       }
+       my $secn = $1;
+       my $sech = $2;
+       my $xref = ps_xref($sech);
+       my $pref;
+       $pref = $secn; $pref =~ s/\.[^\.]+$//; # Find parent node
+
+       $book = [$xref, 0, ps_arraytostr(@{$paras[$i]})];
+       push(@bookmarks, $book);
+       $bookref{$secn} = $book;
+       $bookref{$pref}->[1]--; # Adjust count for parent node
+
+       push(@tocparas, [ps_dup_para_noanchor(@{$paras[$i]})]);
+       push(@tocptypes,
+            (($ptype eq 'subh') ? 'toc2':'toc1').' :'.$sech.':'.$secn);
+
+       unshift(@{$paras[$i]}, [-5, $xref]);
+    }
+}
+
+#
+# Add TOC to beginning of paragraph list
+#
+unshift(@paras,  @tocparas);  undef @tocparas;
+unshift(@ptypes, @tocptypes); undef @tocptypes;
+
+#
+# Add copyright notice to the beginning
+#
+@copyright_page =
+([[0, $charcode{'copyright'}],
+  [0, ' '], [0, $metadata{'year'}],
+  [0, ' '], string2array($metadata{'author'}),
+  [0, ' '], string2array($metadata{'copyright_tail'})],
+ [string2array($metadata{'license'})],
+ [string2array($metadata{'auxinfo'})]);
+
+unshift(@paras, @copyright_page);
+unshift(@ptypes, ('norm') x scalar(@copyright_page));
+
+$npara = scalar(@paras);
+
+#
+# No lines generated, yet.
+#
+@pslines    = ();
+
+#
+# Line Auxilliary Information Types
+#
+$AuxStr            = 1;                # String
+$AuxPage    = 2;               # Page number (from xref)
+$AuxPageStr = 3;               # Page number as a PostScript string
+$AuxXRef    = 4;               # Cross reference as a name
+$AuxNum     = 5;               # Number
+
+#
+# Break or convert paragraphs into lines, and push them
+# onto the @pslines array.
+#
+sub ps_break_lines($$) {
+    my ($paras,$ptypes) = @_;
+
+    my $linewidth  = $psconf{pagewidth}-$psconf{lmarg}-$psconf{rmarg};
+    my $bullwidth  = $linewidth-$psconf{bulladj};
+    my $indxwidth  = ($linewidth-$psconf{idxgutter})/$psconf{idxcolumns}
+                     -$psconf{idxspace};
+
+    my $npara = scalar(@{$paras});
+    my $i;
+
+    for ( $i = 0 ; $i < $npara ; $i++ ) {
+       my $xtype = $ptypes->[$i];
+       my $ptype = substr($xtype,0,4);
+       my @data = @{$paras->[$i]};
+       my @ls = ();
+       if ( $ptype eq 'code' ) {
+           my $p;
+           # Code paragraph; each chunk is a line
+           foreach $p ( @data ) {
+               push(@ls, [[$ptype,0,undef,\%BodyFont,0,0],[$p]]);
+           }
+           $ls[0]->[0]->[1] |= 1;           # First in para
+           $ls[-1]->[0]->[1] |= 2;      # Last in para
+       } elsif ( $ptype eq 'chap' || $ptype eq 'appn' ) {
+           # Chapters are flowed normally, but in an unusual font
+           @ls = ps_flow_lines($linewidth, \%ChapFont, $ptype, @data);
+       } elsif ( $ptype eq 'head' || $ptype eq 'subh' ) {
+           unless ( $xtype =~ /^\S+ (\S+) :(.*)$/ ) {
+               die "Bad para";
+           }
+           my $secn = $1;
+           my $sech = $2;
+           my $font = ($ptype eq 'head') ? \%HeadFont : \%SubhFont;
+           @ls = ps_flow_lines($linewidth, $font, $ptype, @data);
+           # We need the heading number as auxillary data
+           $ls[0]->[0]->[2] = [[$AuxStr,$secn]];
+       } elsif ( $ptype eq 'norm' ) {
+           @ls = ps_flow_lines($linewidth, \%BodyFont, $ptype, @data);
+       } elsif ( $ptype eq 'bull' ) {
+           @ls = ps_flow_lines($bullwidth, \%BodyFont, $ptype, @data);
+       } elsif ( $ptype =~ /^toc/ ) {
+           unless ( $xtype =~/^\S+ :([^:]*):(.*)$/ ) {
+               die "Bad para";
+           }
+           my $xref = $1;
+           my $refname = $2.' ';
+           my $ntoc = substr($ptype,3,1)+0;
+           my $refwidth = ps_width($refname, $BodyFont{fonts}->[0][1],
+                                   \@NASMEncoding) *
+               ($BodyFont{fonts}->[0][0]/1000);
+
+           @ls = ps_flow_lines($linewidth-$ntoc*$psconf{tocind}-
+                               $psconf{tocpnz}-$refwidth,
+                               \%BodyFont, $ptype, @data);
+
+           # Auxilliary data: for the first line, the cross reference symbol
+           # and the reference name; for all lines but the first, the
+           # reference width; and for the last line, the page number
+           # as a string.
+           my $nl = scalar(@ls);
+           $ls[0]->[0]->[2] = [[$AuxStr,$refname], [$AuxXRef,$xref]];
+           for ( $j = 1 ; $j < $nl ; $j++ ) {
+               $ls[$j]->[0]->[2] = [[$AuxNum,$refwidth]];
+           }
+           push(@{$ls[$nl-1]->[0]->[2]}, [$AuxPageStr,$xref]);
+       } elsif ( $ptype =~ /^idx/ ) {
+           my $lvl = substr($ptype,3,1)+0;
+
+           @ls = ps_flow_lines($indxwidth-$lvl*$psconf{idxindent},
+                               \%BodyFont, $ptype, @data);
+       } else {
+           die "Unknown para type: $ptype";
+       }
+       # Merge adjacent identical chunks
+       foreach $l ( @ls ) {
+           @{$$l[1]} = ps_merge_chunks(@{$$l[1]});
+       }
+       push(@pslines,@ls);
+    }
+}
+
+# Break the main body text into lines.
+ps_break_lines(\@paras, \@ptypes);
+
+#
+# Break lines in to pages
+#
+
+# Where to start on page 2, the copyright page
+$curpage = 2;                  # Start on page 2
+$curypos = $psconf{pageheight}-$psconf{topmarg}-$psconf{botmarg}-
+    $psconf{startcopyright};
+undef $columnstart;            # Not outputting columnar text
+undef $curcolumn;              # Current column
+$nlines = scalar(@pslines);
+
+#
+# This formats lines inside the global @pslines array into pages,
+# updating the page and y-coordinate entries.  Start at the
+# $startline position in @pslines and go to but not including
+# $endline.  The global variables $curpage, $curypos, $columnstart
+# and $curcolumn are updated appropriately.
+#
+sub ps_break_pages($$) {
+    my($startline, $endline) = @_;
+
+    # Paragraph types which should never be broken
+    my $nobreakregexp = "^(chap|appn|head|subh|toc.|idx.)\$";
+    # Paragraph types which are heading (meaning they should not be broken
+    # immediately after)
+    my $nobreakafter = "^(chap|appn|head|subh)\$";
+    # Paragraph types which should never be broken *before*
+    my $nobreakbefore = "^idx[1-9]\$";
+    # Paragraph types which are set in columnar format
+    my $columnregexp = "^idx.\$";
+
+    my $upageheight = $psconf{pageheight}-$psconf{topmarg}-$psconf{botmarg};
+
+    my $i;
+
+    for ( $i = $startline ; $i < $endline ; $i++ ) {
+       my $linfo = $pslines[$i]->[0];
+       if ( ($$linfo[0] eq 'chap' || $$linfo[0] eq 'appn' )
+            && ($$linfo[1] & 1) ) {
+           # First line of a new chapter heading.  Start a new page.
+           undef $columnstart;
+           $curpage++ if ( $curypos > 0 || defined($columnstart) );
+           $curypos = $chapstart;
+       } elsif ( defined($columnstart) && $$linfo[0] !~ /$columnregexp/o ) {
+           undef $columnstart;
+           $curpage++;
+           $curypos = 0;
+       }
+
+       if ( $$linfo[0] =~ /$columnregexp/o && !defined($columnstart) ) {
+           $columnstart = $curypos;
+           $curcolumn = 0;
+       }
+
+       # Adjust position by the appropriate leading
+       $curypos += $$linfo[3]->{leading};
+
+       # Record the page and y-position
+       $$linfo[4] = $curpage;
+       $$linfo[5] = $curypos;
+       $$linfo[6] = $curcolumn if ( defined($columnstart) );
+
+       if ( $curypos > $upageheight ) {
+           # We need to break the page before this line.
+           my $broken = 0;             # No place found yet
+           while ( !$broken && $pslines[$i]->[0]->[4] == $curpage ) {
+               my $linfo = $pslines[$i]->[0];
+               my $pinfo = $pslines[$i-1]->[0];
+
+               if ( $$linfo[1] == 2 ) {
+                   # This would be an orphan, don't break.
+               } elsif ( $$linfo[1] & 1 ) {
+                   # Sole line or start of paragraph.  Break unless
+                   # the previous line was part of a heading.
+                   $broken = 1 if ( $$pinfo[0] !~ /$nobreakafter/o &&
+                                    $$linfo[0] !~ /$nobreakbefore/o );
+               } else {
+                   # Middle of paragraph.  Break unless we're in a
+                   # no-break paragraph, or the previous line would
+                   # end up being a widow.
+                   $broken = 1 if ( $$linfo[0] !~ /$nobreakregexp/o &&
+                                    $$pinfo[1] != 1 );
+               }
+               $i--;
+           }
+           die "Nowhere to break page $curpage\n" if ( !$broken );
+           # Now $i should point to line immediately before the break, i.e.
+           # the next paragraph should be the first on the new page
+           if ( defined($columnstart) &&
+                ++$curcolumn < $psconf{idxcolumns} ) {
+               # We're actually breaking text into columns, not pages
+               $curypos = $columnstart;
+           } else {
+               undef $columnstart;
+               $curpage++;
+               $curypos = 0;
+           }
+           next;
+       }
+
+       # Add end of paragraph skip
+       if ( $$linfo[1] & 2 ) {
+           $curypos += $skiparray{$$linfo[0]};
+       }
+    }
+}
+
+ps_break_pages(0,$nlines);     # Break the main text body into pages
+
+#
+# Find the page number of all the indices
+#
+%ps_xref_page   = ();          # Crossref anchor pages
+%ps_index_pages = ();          # Index item pages
+$nlines = scalar(@pslines);
+for ( $i = 0 ; $i < $nlines ; $i++ ) {
+    my $linfo = $pslines[$i]->[0];
+    foreach my $c ( @{$pslines[$i]->[1]} ) {
+       if ( $$c[0] == -4 ) {
+           if ( !defined($ps_index_pages{$$c[1]}) ) {
+               $ps_index_pages{$$c[1]} = [];
+           } elsif ( $ps_index_pages{$$c[1]}->[-1] eq $$linfo[4] ) {
+               # Pages are emitted in order; if this is a duplicated
+               # entry it will be the last one
+               next;           # Duplicate
+           }
+           push(@{$ps_index_pages{$$c[1]}}, $$linfo[4]);
+       } elsif ( $$c[0] == -5 ) {
+           $ps_xref_page{$$c[1]} = $$linfo[4];
+       }
+    }
+}
+
+#
+# Emit index paragraphs
+#
+$startofindex = scalar(@pslines);
+@ixparas = ([[-5,'index'],[0,'Index']]);
+@ixptypes = ('chap');
+
+foreach $k ( @ixentries ) {
+    my $n,$i;
+    my $ixptype = 'idx0';
+    my $prefix = $ixhasprefix{$k};
+    my @ixpara = mkparaarray($ixptype,@{$ixterms{$k}});
+    my $commapos = undef;
+
+    if ( defined($prefix) && $ixprefixes{$prefix} > 1 ) {
+       # This entry has a "hanging comma"
+       for ( $i = 0 ; $i < scalar(@ixpara)-1 ; $i++ ) {
+           if ( substr($ixpara[$i]->[1],-1,1) eq ',' &&
+                $ixpara[$i+1]->[1] eq ' ' ) {
+               $commapos = $i;
+               last;
+           }
+       }
+    }
+    if ( defined($commapos) ) {
+       if ( $ixcommafirst{$k} ) {
+           # This is the first entry; generate the
+           # "hanging comma" entry
+           my @precomma = splice(@ixpara,0,$commapos);
+           if ( $ixpara[0]->[1] eq ',' ) {
+               shift(@ixpara); # Discard lone comma
+           } else {
+               # Discard attached comma
+               $ixpara[0]->[1] =~ s/\,$//;
+               push(@precomma,shift(@ixpara));
+           }
+           push(@precomma, [-6,undef]);
+           push(@ixparas, [@precomma]);
+           push(@ixptypes, $ixptype);
+           shift(@ixpara);     # Remove space
+       } else {
+           splice(@ixpara,0,$commapos+2);
+       }
+       $ixptype = 'idx1';
+    }
+
+    push(@ixpara, [-6,undef]); # Left/right marker
+    $i = 1;  $n = scalar(@{$ps_index_pages{$k}});
+    foreach $p ( @{$ps_index_pages{$k}} ) {
+       if ( $i++ == $n ) {
+           push(@ixpara,[-7,$p],[0,"$p"],[-1,undef]);
+       } else {
+           push(@ixpara,[-7,$p],[0,"$p,"],[-1,undef],[0,' ']);
+       }
+    }
+
+    push(@ixparas, [@ixpara]);
+    push(@ixptypes, $ixptype);
+}
+
+#
+# Flow index paragraphs into lines
+#
+ps_break_lines(\@ixparas, \@ixptypes);
+
+#
+# Format index into pages
+#
+$nlines = scalar(@pslines);
+ps_break_pages($startofindex, $nlines);
+
+#
+# Push index onto bookmark list
+#
+push(@bookmarks, ['index', 0, 'Index']);
+
+# Get the list of fonts used
+%ps_all_fonts = ();
+foreach $fset ( @AllFonts ) {
+    foreach $font ( @{$fset->{fonts}} ) {
+       $ps_all_fonts{$font->[1]->{name}}++;
+    }
+}
+
+# Emit the PostScript DSC header
+print "%!PS-Adobe-3.0\n";
+print "%%Pages: $curpage\n";
+print "%%BoundingBox: 0 0 ", $psconf{pagewidth}, ' ', $psconf{pageheight}, "\n";
+print "%%Creator: (NASM psflow.pl)\n";
+print "%%DocumentData: Clean7Bit\n";
+print "%%DocumentFonts: ", join(' ', keys(%ps_all_fonts)), "\n";
+print "%%DocumentNeededFonts: ", join(' ', keys(%ps_all_fonts)), "\n";
+print "%%Orientation: Portrait\n";
+print "%%PageOrder: Ascend\n";
+print "%%EndComments\n";
+print "%%BeginProlog\n";
+
+# Emit the configurables as PostScript tokens
+foreach $c ( keys(%psconf) ) {
+    print "/$c ", $psconf{$c}, " def\n";
+}
+foreach $c ( keys(%psbool) ) {
+    print "/$c ", ($psbool{$c}?'true':'false'), " def\n";
+}
+
+# Emit custom encoding vector
+$zstr = '/NASMEncoding [ ';
+foreach $c ( @NASMEncoding ) {
+    my $z = '/'.(defined($c)?$c:'.notdef ').' ';
+    if ( length($zstr)+length($z) > 72 ) {
+       print $zstr,"\n";
+       $zstr = ' ';
+    }
+    $zstr .= $z;
+}
+print $zstr, "] def\n";
+
+# Font recoding routine
+# newname fontname --
+print "/nasmenc {\n";
+print "  findfont dup length dict begin\n";
+print "    { 1 index /FID ne {def}{pop pop} ifelse } forall\n";
+print "    /Encoding NASMEncoding def\n";
+print "    currentdict\n";
+print "  end\n";
+print "  definefont pop\n";
+print "} def\n";
+
+# Emit fontset definitions
+foreach $font ( keys(%ps_all_fonts) ) {
+    print '/',$font,'-NASM /',$font," nasmenc\n";
+}
+
+foreach $fset ( @AllFonts ) {
+    my $i = 0;
+    my @zfonts = ();
+    foreach $font ( @{$fset->{fonts}} ) {
+       print '/', $fset->{name}, $i, ' ',
+       '/', $font->[1]->{name}, '-NASM findfont ',
+       $font->[0], " scalefont def\n";
+       push(@zfonts, $fset->{name}.$i);
+       $i++;
+    }
+    print '/', $fset->{name}, ' [', join(' ',@zfonts), "] def\n";
+}
+
+# This is used by the bullet-paragraph PostScript methods
+print "/bullet [",ps_string($charcode{'bullet'}),"] def\n";
+
+# Emit the canned PostScript prologue
+open(PSHEAD, "< head.ps");
+while ( defined($line = <PSHEAD>) ) {
+    print $line;
+}
+close(PSHEAD);
+print "%%EndProlog\n";
+
+# Generate a PostScript string
+sub ps_string($) {
+    my ($s) = @_;
+    my ($i,$c);
+    my ($o) = '(';
+    my ($l) = length($s);
+    for ( $i = 0 ; $i < $l ; $i++ ) {
+       $c = substr($s,$i,1);
+       if ( ord($c) < 32 || ord($c) > 126 ) {
+           $o .= sprintf("\\%03o", ord($c));
+       } elsif ( $c eq '(' || $c eq ')' || $c eq "\\" ) {
+           $o .= "\\".$c;
+       } else {
+           $o .= $c;
+       }
+    }
+    return $o.')';
+}
+
+# Generate PDF bookmarks
+print "%%BeginSetup\n";
+foreach $b ( @bookmarks ) {
+    print '[/Title ', ps_string($b->[2]), "\n";
+    print '/Count ', $b->[1], ' ' if ( $b->[1] );
+    print '/Dest /',$b->[0]," /OUT pdfmark\n";
+}
+
+# Ask the PostScript interpreter for the proper size media
+print "setpagesize\n";
+print "%%EndSetup\n";
+
+# Start a PostScript page
+sub ps_start_page() {
+    $ps_page++;
+    print "%%Page: $ps_page $ps_page\n";
+    print "%%BeginPageSetup\n";
+    print "save\n";
+    print "%%EndPageSetup\n";
+    print '/', $ps_page, " pa\n";
+}
+
+# End a PostScript page
+sub ps_end_page($) {
+    my($pn) = @_;
+    if ( $pn ) {
+       print "($ps_page)", (($ps_page & 1) ? 'pageodd' : 'pageeven'), "\n";
+    }
+    print "restore showpage\n";
+}
+
+$ps_page = 0;
+
+# Title page
+ps_start_page();
+$title = $metadata{'title'} || '';
+$title =~ s/ \- / $charcode{'emdash'} /;
+
+$subtitle = $metadata{'subtitle'} || '';
+$subtitle =~ s/ \- / $charcode{'emdash'} /;
+
+# Print title
+print "/ti ", ps_string($title), " def\n";
+print "/sti ", ps_string($subtitle), " def\n";
+print "lmarg pageheight 2 mul 3 div moveto\n";
+print "tfont0 setfont\n";
+print "/title linkdest ti show\n";
+print "lmarg pageheight 2 mul 3 div 10 sub moveto\n";
+print "0 setlinecap 3 setlinewidth\n";
+print "pagewidth lmarg sub rmarg sub 0 rlineto currentpoint stroke moveto\n";
+print "hfont1 setfont sti stringwidth pop neg ",
+    -$HeadFont{leading}, " rmoveto\n";
+print "sti show\n";
+
+# Print logo, if there is one
+# FIX: To be 100% correct, this should look for DocumentNeeded*
+# and DocumentFonts in the header of the EPSF and add those to the
+# global header.
+if ( defined($metadata{epslogo}) &&
+     sysopen(EPS, $metadata{epslogo}, O_RDONLY) ) {
+    my @eps = ();
+    my ($bbllx,$bblly,$bburx,$bbury) = (undef,undef,undef,undef);
+    my $line;
+    my $scale = 1;
+    my $maxwidth = $psconf{pagewidth}-$psconf{lmarg}-$psconf{rmarg};
+    my $maxheight = $psconf{pageheight}/3-40;
+    my $width, $height;
+    my $x, $y;
+
+    while ( defined($line = <EPS>) ) {
+       last if ( $line =~ /^%%EOF/ );
+       if ( !defined($bbllx) &&
+            $line =~ /^\%\%BoundingBox\:\s*([0-9\.]+)\s+([0-9\.]+)\s+([0-9\.]+)\s+([0-9\.]+)/i ) {
+           $bbllx = $1+0; $bblly = $2+0;
+           $bburx = $3+0; $bbury = $4+0;
+       }
+       push(@eps,$line);
+    }
+    close(EPS);
+
+    if ( defined($bbllx) ) {
+       $width = $bburx-$bbllx;
+       $height = $bbury-$bblly;
+
+       if ( $width > $maxwidth ) {
+           $scale = $maxwidth/$width;
+       }
+       if ( $height*$scale > $maxheight ) {
+           $scale = $maxheight/$height;
+       }
+
+       $x = ($psconf{pagewidth}-$width*$scale)/2;
+       $y = ($psconf{pageheight}-$height*$scale)/2;
+
+       print "BeginEPSF\n";
+       print $x, ' ', $y, " translate\n";
+       print $scale, " dup scale\n" unless ( $scale == 1 );
+       print -$bbllx, ' ', -$bblly, " translate\n";
+       print "$bbllx $bblly moveto\n";
+       print "$bburx $bblly lineto\n";
+       print "$bburx $bbury lineto\n";
+       print "$bbllx $bbury lineto\n";
+       print "$bbllx $bblly lineto clip newpath\n";
+       print "%%BeginDocument: ",ps_string($metadata{epslogo}),"\n";
+       print @eps;
+       print "%%EndDocument\n";
+       print "EndEPSF\n";
+    }
+}
+ps_end_page(0);
+
+# Emit the rest of the document (page 2 and on)
+$curpage = 2;
+ps_start_page();
+foreach $line ( @pslines ) {
+    my $linfo = $line->[0];
+
+    if ( $$linfo[4] != $curpage ) {
+        ps_end_page($curpage > 2);
+        ps_start_page();
+        $curpage = $$linfo[4];
+    }
+
+    print '[';
+    my $curfont = 0;
+    foreach my $c ( @{$line->[1]} ) {
+        if ( $$c[0] >= 0 ) {
+           if ( $curfont != $$c[0] ) {
+               print ($curfont = $$c[0]);
+           }
+           print ps_string($$c[1]);
+       } elsif ( $$c[0] == -1 ) {
+           print '{el}';       # End link
+       } elsif ( $$c[0] == -2 ) {
+           print '{/',$$c[1],' xl}'; # xref link
+       } elsif ( $$c[0] == -3 ) {
+           print '{',ps_string($$c[1]),'wl}'; # web link
+       } elsif ( $$c[0] == -4 ) {
+           # Index anchor -- ignore
+       } elsif ( $$c[0] == -5 ) {
+           print '{/',$$c[1],' xa}'; #xref anchor
+       } elsif ( $$c[0] == -6 ) {
+           print '][';         # Start a new array
+           $curfont = 0;
+       } elsif ( $$c[0] == -7 ) {
+           print '{/',$$c[1],' pl}'; # page link
+       } else {
+           die "Unknown annotation";
+       }
+    }
+    print ']';
+    if ( defined($$linfo[2]) ) {
+       foreach my $x ( @{$$linfo[2]} ) {
+           if ( $$x[0] == $AuxStr ) {
+               print ps_string($$x[1]);
+           } elsif ( $$x[0] == $AuxPage ) {
+               print $ps_xref_page{$$x[1]},' ';
+           } elsif ( $$x[0] == $AuxPageStr ) {
+               print ps_string($ps_xref_page{$$x[1]});
+           } elsif ( $$x[0] == $AuxXRef ) {
+               print '/',ps_xref($$x[1]),' ';
+           } elsif ( $$x[0] == $AuxNum ) {
+               print $$x[1],' ';
+           } else {
+               die "Unknown auxilliary data type";
+           }
+       }
+    }
+    print ($psconf{pageheight}-$psconf{topmarg}-$$linfo[5]);
+    print ' ', $$linfo[6] if ( defined($$linfo[6]) );
+    print ' ', $$linfo[0].$$linfo[1], "\n";
+}
+
+ps_end_page(1);
+print "%%EOF\n";
diff --git a/doc/genpsdriver.pl b/doc/genpsdriver.pl
new file mode 100644 (file)
index 0000000..58e1f9a
--- /dev/null
@@ -0,0 +1,64 @@
+#!/usr/bin/perl
+## --------------------------------------------------------------------------
+##   
+##   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.
+##
+## --------------------------------------------------------------------------
+
+#
+# Runs the equivalent of the following command line:
+#
+#       $(PERL) $(srcdir)/genps.pl -subtitle "version `cat ../version`" \
+#                nasmdoc.dip
+#
+# This is implemented as a Perl script since `cat ...` doesn't
+# necessarily work on non-Unix systems.
+#
+
+use File::Spec;
+use Fcntl;
+use Env;
+
+$perl   = $ENV{PERL}   || 'perl';
+$srcdir = $ENV{srcdir} || File::Spec->curdir();
+
+$versionfile = File::Spec->catfile($srcdir, File::Spec->updir(), 'version');
+$genps = File::Spec->catfile($srcdir, 'genps.pl');
+
+sysopen(VERSION, $versionfile, O_RDONLY)
+    or die "$0: cannot open $versionfile\n";
+$version = <VERSION>;
+chomp $version;
+close(VERSION);
+
+# \240 = no-break space, see @NASMEncoding in genps.pl.
+# If we use a normal space, it breaks on 'doze platforms...
+system($perl, $genps, '-subtitle', "version\240".$version,
+       @ARGV, 'nasmdoc.dip');
diff --git a/doc/head.ps b/doc/head.ps
new file mode 100644 (file)
index 0000000..48b7af2
--- /dev/null
@@ -0,0 +1,391 @@
+%
+% PostScript header for NASM documentation
+%
+
+% Avoid barfing on old PS implementations
+/pdfmark where
+{pop} {userdict /pdfmark /cleartomark load put} ifelse
+/setpagedevice where
+{pop} {userdict /setpagedevice /pop load put} ifelse
+
+% Useful definition
+/space 32 def
+
+%
+% This asks the PostScript interpreter for the proper size paper
+%
+/setpagesize {
+  1 dict dup /PageSize [pagewidth pageheight] put setpagedevice
+} def
+
+%
+% Code to handle links
+%
+/min { 2 copy gt { exch } if pop } def
+/max { 2 copy lt { exch } if pop } def
+
+/lkbegun 0 def
+/lktype null def
+/lkury 0 def
+/lkurx 0 def
+/lklly 0 def
+/lkllx 0 def
+/lkxmarg 1 def % Extra space for link in x dir
+/lkymarg 1 def % Extra space for link in y dir
+/lktarget () def
+
+% target type --
+/linkbegin {
+  userdict begin
+    /lkbegun 1 def
+    /lktype exch def
+    /lktarget exch def
+    colorlinks { 0 0 0.4 setrgbcolor } if
+  end
+} def
+
+% target --
+/linkbegindest {
+  /Dest linkbegin
+} def
+
+% uristring --
+/linkbeginuri {
+  /URI linkbegin
+} def
+
+% pageno --
+/linkbeginpage {
+  /Page linkbegin
+} def
+
+% string spacepadding --
+/linkshow {
+  userdict begin
+    /lspad exch def /lss exch def
+    lkbegun 0 ne {
+      gsave lss true charpath flattenpath pathbbox grestore
+      lkbegun 1 eq {
+        /lkury exch def
+        lss spacecount lspad mul add /lkurx exch def
+        /lklly exch def
+        /lkllx exch def
+        /lkbegun 2 def
+      } {
+        lkury max /lkury exch def
+        lss spacecount lspad mul add lkurx max /lkurx exch def
+        lklly min /lklly exch def
+        lkllx min /lkllx exch def
+      } ifelse
+    } if
+    lspad 0 space lss widthshow
+  end
+} def
+
+% --
+/linkend {
+  userdict begin
+    [ lktype /URI eq {
+        /Action 2 dict dup /Subtype /URI put dup /URI lktarget put
+      } {
+       /Dest lktarget
+      } ifelse
+      /Border [0 0 0]
+      /Rect [ lkllx lkxmarg sub
+              lklly lkymarg sub
+              lkurx lkxmarg add
+              lkury lkymarg add ]
+      /Subtype /Link
+      /ANN pdfmark
+    /lkbegun 0 def
+    colorlinks { 0 setgray } if
+  end
+} def
+
+% targetname --
+/linkdest {
+  [ /Dest 3 -1 roll
+    /View [ /XYZ currentpoint null ]
+    /DEST pdfmark
+} def
+
+% A "fontset" is an array of fonts; a "stream" is an array of strings
+% and numbers or procedures:
+% [ 0 (Foo) ( ) (mani) ( ) 1 (padme) 0 ( ) (hum.) ]
+% A number choses a font from the current fontset.
+% A procedure is invoked as-is when printing the stream.
+%
+% When printing justified, an equal amount of space is added in
+% between each string.
+
+% string -- spacecount
+% Count space characters in a string
+/spacecount {
+  0 exch {
+    space eq { 1 add } if
+  } forall
+} def
+
+% stream fontset -- spacecount width
+% Get the width of a stream in the given fontset, and the
+% number of space characters in the stream
+/streamwidth {
+  gsave
+    6 dict begin
+      /f exch def
+      /w 0 def
+      /s 0 def
+      f 0 get setfont
+      /integertype {
+        f exch get setfont
+      } def
+      /stringtype {
+        dup stringwidth pop w add /w exch def
+        spacecount s add /s exch def
+      } def
+      /arraytype { pop } def
+      % The input stream is on the top of the stack now
+      {
+        dup type exec
+      } forall
+      s w
+    end
+  grestore
+} def
+
+% stream fontset spacer --
+% Show the stream in the given fontset, but add a certain amount
+% of space to each space character
+/showstreamspc {
+  5 dict begin
+    /spc exch def
+    /f exch def
+    f 0 get setfont
+    /integertype {
+      f exch get setfont
+    } def
+    /stringtype {
+      spc linkshow
+    } def
+    /arraytype {
+      exec
+    } def
+    % Now stream is on the top of the stack
+    {
+      dup type exec
+    } forall
+  end
+} def
+
+% stream fontset --
+% Show the stream in the given fontset, with no extra spacing
+/showstream {
+  0 showstreamspc
+} def
+
+% stream fontset totalspace --
+% Show the stream justified to fit into a certain number of pixels
+/showstreamjust {
+  userdict begin
+    /ts exch def /fs exch def /st exch def
+      st fs
+        st fs streamwidth ts exch sub exch
+       dup 0 gt { div } { pop } ifelse
+      showstreamspc
+    end
+} def
+
+/bullmarg lmarg bulladj add def
+/lwidth pagewidth lmarg sub rmarg sub def
+/bwidth lwidth bulladj sub def
+
+%
+% The various paragraph types
+% The number at the end indicates start (1) of para, end (2) of para
+%
+/chapline {
+       currentpoint exch pop 10 sub lmarg exch moveto
+       0 setlinecap 3 setlinewidth
+       lwidth 0 rlineto stroke
+} def
+
+/chap0 { lmarg exch moveto cfont lwidth showstreamjust } def
+/chap1 { lmarg exch moveto cfont lwidth showstreamjust } def
+/chap2 { lmarg exch moveto cfont showstream chapline } def
+/chap3 { lmarg exch moveto cfont showstream chapline } def
+
+/appn0 {chap0} def
+/appn1 {chap1} def
+/appn2 {chap2} def
+/appn3 {chap3} def
+
+% lbl ypos fontset -- ypos
+/headlbl {
+  3 -1 roll [exch (  )] exch % ypos strm fontset
+  2 copy % ypos strm fontset strm fontset
+  streamwidth % ypos strm fontset spccount width
+  lmarg exch sub % ypos strm fontset spccount xpos
+  4 index % ypos strm fontset spccount xpos ypos
+  moveto % ypos strm fontset spccount
+  pop % ypos strm fontset spccount
+  showstream % ypos
+} def
+
+/head0 { lmarg exch moveto hfont lwidth showstreamjust } def
+/head1 { hfont headlbl lmarg exch moveto hfont lwidth showstreamjust } def
+/head2 { lmarg exch moveto hfont showstream } def
+/head3 { hfont headlbl lmarg exch moveto hfont showstream } def
+
+/subh0 { lmarg exch moveto sfont lwidth showstreamjust } def
+/subh1 { sfont headlbl lmarg exch moveto sfont lwidth showstreamjust } def
+/subh2 { lmarg exch moveto sfont showstream } def
+/subh3 { sfont headlbl lmarg exch moveto sfont showstream } def
+
+/norm0 { lmarg exch moveto bfont lwidth showstreamjust } def
+/norm1 { lmarg exch moveto bfont lwidth showstreamjust } def
+/norm2 { lmarg exch moveto bfont showstream } def
+/norm3 { lmarg exch moveto bfont showstream } def
+
+/code0 { lmarg exch moveto bfont showstream } def
+/code1 { lmarg exch moveto bfont showstream } def
+/code2 { lmarg exch moveto bfont showstream } def
+/code3 { lmarg exch moveto bfont showstream } def
+
+/bull0 { bullmarg exch moveto bfont bwidth showstreamjust } def
+/bull1 { dup lmarg exch moveto bullet bfont showstream
+        bullmarg exch moveto bfont bwidth showstreamjust } def
+/bull2 { bullmarg exch moveto bfont showstream } def
+/bull3 { dup lmarg exch moveto bullet bfont showstream
+        bullmarg exch moveto bfont showstream } def
+
+/tocw0 lwidth tocpnz sub def
+/tocw1 tocw0 tocind sub def
+/tocw2 tocw1 tocind sub def
+
+/tocx0 lmarg def
+/tocx1 tocx0 tocind add def
+/tocx2 tocx1 tocind add def
+
+/tocpn {
+  bfont0 setfont
+  3 dict begin
+    /s exch def
+    /x s stringwidth pop pagewidth rmarg sub exch sub def
+    currentpoint /y exch def
+    lmarg sub tocdots div ceiling tocdots mul lmarg add
+    tocdots x {
+      y moveto (.) 0 linkshow
+    } for
+    x y moveto s 0 linkshow
+  end
+  linkend
+} def
+
+/toc00 { tocx0 exch moveto 0 rmoveto bfont showstream } def
+/toc01 { tocx0 exch moveto
+        linkbegindest bfont0 setfont 0 linkshow bfont showstream } def
+/toc02 { tocx0 exch moveto 3 1 roll
+        0 rmoveto bfont showstream tocpn } def
+/toc03 { tocx0 exch moveto 4 1 roll
+        linkbegindest bfont0 setfont 0 linkshow bfont showstream tocpn } def
+
+/toc10 { tocx1 exch moveto 0 rmoveto bfont showstream } def
+/toc11 { tocx1 exch moveto
+        linkbegindest bfont0 setfont 0 linkshow bfont showstream } def
+/toc12 { tocx1 exch moveto 3 1 roll
+        0 rmoveto bfont showstream tocpn } def
+/toc13 { tocx1 exch moveto 4 1 roll
+        linkbegindest bfont0 setfont 0 linkshow bfont showstream tocpn } def
+
+/toc20 { tocx2 exch moveto 0 rmoveto bfont showstream } def
+/toc21 { tocx2 exch moveto
+        linkbegindest bfont0 setfont 0 linkshow bfont showstream } def
+/toc22 { tocx2 exch moveto 3 1 roll
+        0 rmoveto bfont showstream tocpn } def
+/toc23 { tocx2 exch moveto 4 1 roll
+        linkbegindest bfont0 setfont 0 linkshow bfont showstream tocpn } def
+
+% Spacing between index columns
+/indexcolumn pagewidth lmarg sub rmarg sub idxgutter add idxcolumns div def
+% Width of an individual index column
+/indexcolwid indexcolumn idxgutter sub def
+
+/idx03 {
+  2 dict begin
+    indexcolumn mul lmarg add
+    /x exch def /y exch def x y moveto
+    exch bfont showstream
+    dup bfont streamwidth
+    x indexcolwid add exch sub exch pop y moveto
+    bfont showstream
+  end
+} def
+/idx00 {idx03} def
+/idx01 {idx03} def
+/idx02 {idx03} def
+
+/idx13 {
+  2 dict begin
+    indexcolumn mul lmarg add idxindent add
+    /x exch def /y exch def x y moveto
+    exch bfont showstream
+    dup bfont streamwidth
+    x indexcolwid idxindent sub add exch sub exch pop y moveto
+    bfont showstream
+  end
+} def
+/idx10 {idx13} def
+/idx11 {idx13} def
+/idx12 {idx13} def
+
+%
+% Page numbers
+%
+/pagey botmarg pymarg sub def
+/pagel lmarg plmarg sub def
+/pager pagewidth rmarg sub prmarg add def
+
+/pageeven { pagel pagey moveto bfont1 setfont show } def
+/pageodd  { bfont1 setfont dup stringwidth pop pager exch sub
+           pagey moveto show } def
+
+%
+% Functions invoked during parsing
+%
+/xa { linkdest } def
+/pa { 0 pageheight moveto linkdest } def
+/xl { linkbegindest } def
+/wl { linkbeginuri } def
+/pl { linkbeginpage } def
+/el { linkend } def
+
+%
+% PDF viewer options
+%
+[/PageMode /UseOutlines /DOCVIEW pdfmark       % Display bookmarks
+
+%
+% Functions to include EPS
+%
+/BeginEPSF {
+  /Before_EPSF_State save def
+  /dict_count countdictstack def
+  /op_count count 1 sub def
+  userdict begin
+  /showpage {} def
+  0 setgray 0 setlinecap
+  1 setlinewidth 0 setlinejoin
+  10 setmiterlimit [ ] 0 setdash newpath
+  /languagelevel where
+  {
+    pop languagelevel
+    1 ne {
+      false setstrokeadjust false setoverprint
+    } if
+  } if
+} bind def
+/EndEPSF {
+  count op_count sub {pop} repeat
+  countdictstack dict_count sub {end} repeat
+  Before_EPSF_State restore
+} bind def
diff --git a/doc/inslist.pl b/doc/inslist.pl
new file mode 100644 (file)
index 0000000..509de00
--- /dev/null
@@ -0,0 +1,98 @@
+#!/usr/bin/perl
+## --------------------------------------------------------------------------
+##   
+##   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.
+##
+## --------------------------------------------------------------------------
+
+#
+# inslist.pl   produce inslist.src
+#
+
+# Opcode prefixes which need their own opcode tables
+# LONGER PREFIXES FIRST!
+@disasm_prefixes = qw(0F24 0F25 0F38 0F3A 0F7A 0FA6 0FA7 0F);
+
+print STDERR "Reading insns.dat...\n";
+
+@args   = ();
+undef $output;
+foreach $arg ( @ARGV ) {
+    if ( $arg =~ /^\-/ ) {
+       if  ( $arg =~ /^\-([adins])$/ ) {
+           $output = $1;
+       } else {
+           die "$0: Unknown option: ${arg}\n";
+       }
+    } else {
+       push (@args, $arg);
+    }
+}
+
+$fname = "../insns.dat" unless $fname = $args[0];
+open (F, $fname) || die "unable to open $fname";
+print STDERR "Writing inslist.src...\n";
+open S, ">inslist.src";
+$line = 0;
+$insns = 0;
+while (<F>) {
+  $line++;
+  next if (/^\s*$/);           # blank lines
+  if ( /^\s*;/ )               # comments
+  {
+    if ( /^\s*;\#\s*(.+)/ )    # section subheader
+    {
+      print S "\n\\S{} $1\n\n";
+    }
+    next;
+  }
+  chomp;
+  unless (/^\s*(\S+)\s+(\S+)\s+(\S+|\[.*\])\s+(\S+)\s*$/) {
+      warn "line $line does not contain four fields\n";
+      next;
+  }
+  my @entry = ($1, $2, $3, $4);
+
+  $entry[1] =~ s/ignore//;
+  $entry[1] =~ s/void//;
+  $entry[3] =~ s/ignore//;
+  $entry[3] =~ s/,SB//;
+  $entry[3] =~ s/,SM//;
+  $entry[3] =~ s/,SM2//;
+  $entry[3] =~ s/,SQ//;
+  $entry[3] =~ s/,AR2//;
+  printf S "\\c %-16s %-24s %s\n",$entry[0],$entry[1],$entry[3];
+  $insns++;
+}
+print S "\n";
+close S;
+close F;
+printf STDERR "Done: %d instructions\n", $insns;
+
diff --git a/doc/internal.doc b/doc/internal.doc
new file mode 100644 (file)
index 0000000..88f06bc
--- /dev/null
@@ -0,0 +1,290 @@
+Internals of the Netwide Assembler
+==================================
+
+The Netwide Assembler is intended to be a modular, re-usable x86
+assembler, which can be embedded in other programs, for example as
+the back end to a compiler.
+
+The assembler is composed of modules. The interfaces between them
+look like:
+
+                 +--- preproc.c ----+
+                 |                  |
+                 +---- parser.c ----+
+                 |        |         |
+                 |     float.c      |
+                 |                  |
+                 +--- assemble.c ---+
+                 |        |         |
+       nasm.c ---+     insnsa.c     +--- nasmlib.c
+                 |                  |
+                 +--- listing.c ----+
+                 |                  |
+                 +---- labels.c ----+
+                 |                  |
+                 +--- outform.c ----+
+                 |                  |
+                 +----- *out.c -----+
+
+In other words, each of `preproc.c', `parser.c', `assemble.c',
+`labels.c', `listing.c', `outform.c' and each of the output format
+modules `*out.c' are independent modules, which do not directly
+inter-communicate except through the main program.
+
+The Netwide *Disassembler* is not intended to be particularly
+portable or reusable or anything, however. So I won't bother
+documenting it here. :-)
+
+nasmlib.c
+---------
+
+This is a library module; it contains simple library routines which
+may be referenced by all other modules. Among these are a set of
+wrappers around the standard `malloc' routines, which will report a
+fatal error if they run out of memory, rather than returning NULL.
+
+preproc.c
+---------
+
+This contains a macro preprocessor, which takes a file name as input
+and returns a sequence of preprocessed source lines. The only symbol
+exported from the module is `nasmpp', which is a data structure of
+type `Preproc', declared in nasm.h. This structure contains pointers
+to all the functions designed to be callable from outside the
+module.
+
+parser.c
+--------
+
+This contains a source-line parser. It parses `canonical' assembly
+source lines, containing some combination of the `label', `opcode',
+`operand' and `comment' fields: it does not process directives or
+macros. It exports two functions: `parse_line' and `cleanup_insn'.
+
+`parse_line' is the main parser function: you pass it a source line
+in ASCII text form, and it returns you an `insn' structure
+containing all the details of the instruction on that line. The
+parameters it requires are:
+
+- The location (segment, offset) where the instruction on this line
+  will eventually be placed. This is necessary in order to evaluate
+  expressions containing the Here token, `$'.
+
+- A function which can be called to retrieve the value of any
+  symbols the source line references.
+
+- Which pass the assembler is on: an undefined symbol only causes an
+  error condition on pass two.
+
+- The source line to be parsed.
+
+- A structure to fill with the results of the parse.
+
+- A function which can be called to report errors.
+
+Some instructions (DB, DW, DD for example) can require an arbitrary
+amount of storage, and so some of the members of the resulting
+`insn' structure will be dynamically allocated. The other function
+exported by `parser.c' is `cleanup_insn', which can be called to
+deallocate any dynamic storage associated with the results of a
+parse.
+
+names.c
+-------
+
+This doesn't count as a module - it defines a few arrays which are
+shared between NASM and NDISASM, so it's a separate file which is
+#included by both parser.c and disasm.c.
+
+float.c
+-------
+
+This is essentially a library module: it exports one function,
+`float_const', which converts an ASCII representation of a
+floating-point number into an x86-compatible binary representation,
+without using any built-in floating-point arithmetic (so it will run
+on any platform, portably). It calls nothing, and is called only by
+`parser.c'. Note that the function `float_const' must be passed an
+error reporting routine.
+
+assemble.c
+----------
+
+This module contains the code generator: it translates `insn'
+structures as returned from the parser module into actual generated
+code which can be placed in an output file. It exports two
+functions, `assemble' and `insn_size'.
+
+`insn_size' is designed to be called on pass one of assembly: it
+takes an `insn' structure as input, and returns the amount of space
+that would be taken up if the instruction described in the structure
+were to be converted to real machine code. `insn_size' also requires
+to be told the location (as a segment/offset pair) where the
+instruction would be assembled, the mode of assembly (16/32 bit
+default), and a function it can call to report errors.
+
+`assemble' is designed to be called on pass two: it takes all the
+parameters that `insn_size' does, but has an extra parameter which
+is an output driver. `assemble' actually converts the input
+instruction into machine code, and outputs the machine code by means
+of calling the `output' function of the driver.
+
+insnsa.c
+--------
+
+This is another library module: it exports one very big array of
+instruction translations. It is generated automatically from the
+insns.dat file by the insns.pl script.
+
+labels.c
+--------
+
+This module contains a label manager. It exports six functions:
+
+`init_labels' should be called before any other function in the
+module. `cleanup_labels' may be called after all other use of the
+module has finished, to deallocate storage.
+
+`define_label' is called to define new labels: you pass it the name
+of the label to be defined, and the (segment,offset) pair giving the
+value of the label. It is also passed an error-reporting function,
+and an output driver structure (so that it can call the output
+driver's label-definition function). `define_label' mentally
+prepends the name of the most recently defined non-local label to
+any label beginning with a period.
+
+`define_label_stub' is designed to be called in pass two, once all
+the labels have already been defined: it does nothing except to
+update the "most-recently-defined-non-local-label" status, so that
+references to local labels in pass two will work correctly.
+
+`declare_as_global' is used to declare that a label should be
+global. It must be called _before_ the label in question is defined.
+
+Finally, `lookup_label' attempts to translate a label name into a
+(segment,offset) pair. It returns non-zero on success.
+
+The label manager module is (theoretically :) restartable: after
+calling `cleanup_labels', you can call `init_labels' again, and
+start a new assembly with a new set of symbols.
+
+listing.c
+---------
+
+This file contains the listing file generator. The interface to the
+module is through the one symbol it exports, `nasmlist', which is a
+structure containing six function pointers. The calling semantics of
+these functions isn't terribly well thought out, as yet, but it
+works (just about) so it's going to get left alone for now...
+
+outform.c
+---------
+
+This small module contains a set of routines to manage a list of
+output formats, and select one given a keyword. It contains three
+small routines: `ofmt_register' which registers an output driver as
+part of the managed list, `ofmt_list' which lists the available
+drivers on stdout, and `ofmt_find' which tries to find the driver
+corresponding to a given name.
+
+The output modules
+------------------
+
+Each of the output modules, `outbin.o', `outelf.o' and so on,
+exports only one symbol, which is an output driver data structure
+containing pointers to all the functions needed to produce output
+files of the appropriate type.
+
+The exception to this is `outcoff.o', which exports _two_ output
+driver structures, since COFF and Win32 object file formats are very
+similar and most of the code is shared between them.
+
+nasm.c
+------
+
+This is the main program: it calls all the functions in the above
+modules, and puts them together to form a working assembler. We
+hope. :-)
+
+Segment Mechanism
+-----------------
+
+In NASM, the term `segment' is used to separate the different
+sections/segments/groups of which an object file is composed.
+Essentially, every address NASM is capable of understanding is
+expressed as an offset from the beginning of some segment.
+
+The defining property of a segment is that if two symbols are
+declared in the same segment, then the distance between them is
+fixed at assembly time. Hence every externally-declared variable
+must be declared in its own segment, since none of the locations of
+these are known, and so no distances may be computed at assembly
+time.
+
+The special segment value NO_SEG (-1) is used to denote an absolute
+value, e.g. a constant whose value does not depend on relocation,
+such as the _size_ of a data object.
+
+Apart from NO_SEG, segment indices all have their least significant
+bit clear, if they refer to actual in-memory segments. For each
+segment of this type, there is an auxiliary segment value, defined
+to be the same number but with the LSB set, which denotes the
+segment-base value of that segment, for object formats which support
+it (Microsoft .OBJ, for example).
+
+Hence, if `textsym' is declared in a code segment with index 2, then
+referencing `SEG textsym' would return zero offset from
+segment-index 3. Or, in object formats which don't understand such
+references, it would return an error instead.
+
+The next twist is SEG_ABS. Some symbols may be declared with a
+segment value of SEG_ABS plus a 16-bit constant: this indicates that
+they are far-absolute symbols, such as the BIOS keyboard buffer
+under MS-DOS, which always resides at 0040h:001Eh. Far-absolutes are
+handled with care in the parser, since they are supposed to evaluate
+simply to their offset part within expressions, but applying SEG to
+one should yield its segment part. A far-absolute should never find
+its way _out_ of the parser, unless it is enclosed in a WRT clause,
+in which case Microsoft 16-bit object formats will want to know
+about it.
+
+Porting Issues
+--------------
+
+We have tried to write NASM in portable ANSI C: we do not assume
+little-endianness or any hardware characteristics (in order that
+NASM should work as a cross-assembler for x86 platforms, even when
+run on other, stranger machines).
+
+Assumptions we _have_ made are:
+
+- We assume that `short' is at least 16 bits, and `long' at least
+  32. This really _shouldn't_ be a problem, since Kernighan and
+  Ritchie tell us we are entitled to do so.
+
+- We rely on having more than 6 characters of significance on
+  externally linked symbols in the NASM sources. This may get fixed
+  at some point. We haven't yet come across a linker brain-dead
+  enough to get it wrong anyway.
+
+- We assume that `fopen' using the mode "wb" can be used to write
+  binary data files. This may be wrong on systems like VMS, with a
+  strange file system. Though why you'd want to run NASM on VMS is
+  beyond me anyway.
+
+That's it. Subject to those caveats, NASM should be completely
+portable. If not, we _really_ want to know about it.
+
+Porting Non-Issues
+------------------
+
+The following is _not_ a portability problem, although it looks like
+one.
+
+- When compiling with some versions of DJGPP, you may get errors
+  such as `warning: ANSI C forbids braced-groups within
+  expressions'. This isn't NASM's fault - the problem seems to be
+  that DJGPP's definitions of the <ctype.h> macros include a
+  GNU-specific C extension. So when compiling using -ansi and
+  -pedantic, DJGPP complains about its own header files. It isn't a
+  problem anyway, since it still generates correct code.
diff --git a/doc/makedocs.bat b/doc/makedocs.bat
new file mode 100644 (file)
index 0000000..5372394
--- /dev/null
@@ -0,0 +1,255 @@
+@echo off
+if "%1"=="clean" goto makeclean
+if "%1"=="CLEAN" goto makeclean
+if "%1"=="spotless" goto spotless
+if "%1"=="SPOTLESS" goto spotless
+if "%1"=="install" goto install
+if "%1"=="INSTALL" goto install
+
+cls
+echo.
+echo.
+echo.
+echo    Usage:
+echo.
+echo        makedocs - no parameters - makes all Docs
+echo        makedocs install - installs already made docs in subdirectories
+echo        makedocs clean - removes docs from current directory
+echo        makedocs spotless - removes all - including default install dirs
+echo.
+echo.
+echo.
+echo.
+echo        Makedocs(.bat), with no parameters will create Nasm Documentation
+echo        in several formats: plain ascii text, ps, html, rtf, Windows help
+echo        format, and if you've got an "info" system installed, info format.
+echo.
+echo.
+echo                This requires Perl, and almost 4MB disk space.
+echo.
+echo.
+choice "                     Proceed with making docs? "
+if errorlevel 2 goto exit
+
+:makeall
+
+echo.
+echo.
+echo                        This takes a while. Stretch!
+echo.
+echo.
+
+perl inslist.pl
+perl rdsrc.pl<nasmdoc.src
+echo.
+echo.
+choice "                       Make *info* files? "
+if errorlevel 2 goto noinfo
+:makeinfo
+echo.
+echo.
+makeinfo nasmdoc.tex
+
+:noinfo
+
+:install
+
+if not exist nasmdoc.txt goto nofiles
+if not exist nasmdoc0.htm goto nofiles
+if not exist nasmdo10.htm goto nofiles
+if not exist nasmdoc.hpj goto nofiles
+if not exist nasmdoc.rtf goto nofiles
+if not exist nasmdoc.ps goto nofiles
+if not exist nasmdoc.tex goto nofiles
+goto gotfiles
+:nofiles
+echo.
+echo.
+echo.
+echo.
+echo                       Alert!      Files missing!
+echo.
+echo.
+choice "               Would you like to make them now? "
+if errorlevel 2 goto exit
+goto makeall
+
+:gotfiles
+
+:: get current path
+
+set oldprompt=%prompt%
+echo @prompt set nasdoc=$p>temp1.bat
+command /c temp1.bat>temp2.bat
+call temp2
+del temp1.bat
+del temp2.bat
+set prompt=%oldprompt%
+set oldprompt=
+
+echo.
+echo.
+echo.
+echo.
+echo        Current Directory is %nasdoc%
+echo        Nasm Documentation will be installed under this
+echo        as %nasdoc%\text\nasmdoc.txt, etc.
+echo.
+echo.
+choice "                   Change this directory? "
+if errorlevel 2 goto dirok
+
+echo.
+echo.
+echo.
+echo.
+echo      Directory *above* the directory you name (at least) should exist.
+echo      Nasm documentation will be installed *under* the directory you
+echo      name. E.G. \docs\nasm\html, etc. No trailing backslash!
+echo.
+echo.
+
+echo                Enter new name for base directory:
+set input=
+fc con nul /lb1 /n|date|find "1:">magic.bat
+echo set input=%%5>enter.bat
+call magic
+set nasdoc=%input%
+del magic.bat
+del enter.bat
+set input=
+
+echo.
+echo.
+md %nasdoc%
+echo.
+echo.
+
+choice "  Install Text docs in %nasdoc%\text ? "
+if errorlevel 2 goto notext
+md %nasdoc%\text
+copy nasmdoc.txt %nasdoc%\text
+:notext
+
+choice "  Install Html docs in %nasdoc%\html ? "
+if errorlevel 2 goto nohtml
+md %nasdoc%\html
+copy *.htm %nasdoc%\html
+:nohtml
+
+choice "  Install Info docs in %nasdoc%\info ? "
+if errorlevel 2 goto noinfodocs
+if not exist nasm.inf goto inofiles
+if not exist nasm.i9 goto inofiles
+goto gotifiles
+:inofiles
+echo.
+echo.
+echo                       Alert!      Files missing!
+echo.
+echo.
+choice "               Would you like to make them now? "
+if errorlevel 2 goto noinfodocs
+if not exist nasmdoc.tex goto makeall
+goto makeinfo
+
+:gotifiles
+
+md %nasdoc%\info
+copy nasm.i* %nasdoc%\info
+:noinfodocs
+
+choice "  Install Winhelp docs in %nasdoc%\winhelp ? "
+if errorlevel 2 goto nowinhelp
+md %nasdoc%\winhelp
+copy nasmdoc.rtf %nasdoc%\winhelp
+copy nasmdoc.hpj %nasdoc%\winhelp
+:nowinhelp
+
+choice "  Install Postscript docs in %nasdoc%\ps ? "
+if errorlevel 2 goto nops
+md %nasdoc%\ps
+copy nasmdoc.ps %nasdoc%\ps
+:nops
+goto cleanup
+
+:dirok
+
+choice "  Install Text docs in .\text ? "
+if errorlevel 2 goto notext2
+md text
+copy nasmdoc.txt text
+:notext2
+
+choice "  Install Html docs in .\html ? "
+if errorlevel 2 goto nohtml2
+md html
+copy *.htm html
+:nohtml2
+
+choice "  Install Info docs in .\info ? "
+if errorlevel 2 goto nid2
+
+if not exist nasm.inf goto inof2
+if not exist nasm.i9 goto inof2
+goto gifiles2
+:inof2
+echo.
+echo.
+echo                       Alert!      Files missing!
+echo.
+echo.
+choice "               Would you like to make them now? "
+if errorlevel 2 goto nid2
+if not exist nasmdoc.tex goto makeall
+goto makeinfo
+
+:gifiles2
+
+md info
+copy nasm.i* info
+:nid2
+
+choice "  Install Winhelp docs in .\winhelp ? "
+if errorlevel 2 goto nwhelp2
+md winhelp
+copy nasmdoc.rtf winhelp
+copy nasmdoc.hpj winhelp
+:nwhelp2
+
+choice "  Install Postscript docs in .\ps ? "
+if errorlevel 2 goto nops2
+md ps
+copy nasmdoc.ps ps
+:nops2
+
+
+:cleanup
+set nasdoc=
+
+echo.
+echo.
+echo.
+echo.
+choice "        Remove all files created, but not installed?"
+if not errorlevel 2 goto makeclean
+
+goto exit
+
+:spotless
+deltree /y text
+deltree /y html
+deltree /y info
+deltree /y winhelp
+deltree /y ps
+
+:makeclean
+del *.htm
+del *.rtf
+del *.hpj
+del *.txt
+del *.tex
+del *.ps
+del nasm.i*
+
+:exit
diff --git a/doc/metrics/pagd8a.ph b/doc/metrics/pagd8a.ph
new file mode 100644 (file)
index 0000000..729ba29
--- /dev/null
@@ -0,0 +1,72 @@
+%PS_AvantGarde_Demi = (
+  name => 'AvantGarde-Demi',
+  widths => {
+    "multiply" => 600, "Ntilde" => 740, "zero" => 560, "eth" => 640, 
+    "Ograve" => 840, "uacute" => 600, "braceleft" => 340, 
+    "Thorn" => 560, "zcaron" => 460, "comma" => 280, "cedilla" => 340, 
+    "plusminus" => 600, "ccedilla" => 640, "circumflex" => 540, 
+    "dotaccent" => 280, "asciitilde" => 600, "colon" => 280, 
+    "onehalf" => 840, "dollar" => 560, "ntilde" => 600, 
+    "Ocircumflex" => 840, "Oacute" => 840, "ogonek" => 340, 
+    "ograve" => 640, "thorn" => 660, "minus" => 600, "degree" => 400, 
+    "yen" => 560, "space" => 280, "registered" => 740, 
+    "questiondown" => 560, "Aring" => 740, "percent" => 860, 
+    "emdash" => 1000, "six" => 560, "Agrave" => 740, 
+    "paragraph" => 600, "three" => 560, "numbersign" => 560, 
+    "two" => 560, "Igrave" => 280, "oacute" => 640, 
+    "ocircumflex" => 640, "A" => 740, "B" => 580, "C" => 780, 
+    "D" => 700, "E" => 520, "onequarter" => 840, "F" => 480, 
+    "G" => 840, "H" => 680, "I" => 280, "J" => 480, "K" => 620, 
+    "L" => 440, "backslash" => 640, "asciicircum" => 600, 
+    "periodcentered" => 280, "M" => 900, "N" => 740, "O" => 840, 
+    "P" => 560, "aring" => 660, "Q" => 840, "R" => 580, 
+    "Aacute" => 740, "caron" => 540, "S" => 520, "T" => 420, 
+    "grave" => 420, "U" => 640, "agrave" => 660, "V" => 700, 
+    "W" => 900, "equal" => 600, "question" => 560, "X" => 680, 
+    "Y" => 620, "Z" => 500, "bracketright" => 320, "Iacute" => 280, 
+    "ampersand" => 680, "four" => 560, "igrave" => 240, "a" => 660, 
+    "b" => 660, "c" => 640, "d" => 660, "plus" => 600, "e" => 640, 
+    "quotesinglbase" => 280, "f" => 280, "g" => 660, "bullet" => 600, 
+    "h" => 600, "i" => 240, "Oslash" => 840, "dagger" => 560, 
+    "j" => 260, "Yacute" => 620, "k" => 580, "l" => 240, "m" => 940, 
+    "n" => 600, "o" => 640, "ordfeminine" => 360, "ring" => 360, 
+    "p" => 660, "threesuperior" => 336, "q" => 660, "acute" => 420, 
+    "r" => 320, "twosuperior" => 336, "aacute" => 660, "s" => 440, 
+    "OE" => 1060, "t" => 300, "divide" => 600, "section" => 560, 
+    "u" => 600, "v" => 560, "w" => 800, "dieresis" => 500, "x" => 560, 
+    "y" => 580, "z" => 460, "iacute" => 240, "quotedblbase" => 480, 
+    "hungarumlaut" => 700, "quotedbl" => 360, "mu" => 576, 
+    "Scaron" => 520, "Lslash" => 480, "semicolon" => 280, 
+    "oslash" => 660, "florin" => 560, "yacute" => 580, "fi" => 520, 
+    "fl" => 520, "Acircumflex" => 740, "parenright" => 380, 
+    "Ecircumflex" => 520, "trademark" => 1000, "Icircumflex" => 280, 
+    "daggerdbl" => 560, "guillemotleft" => 460, "germandbls" => 600, 
+    "macron" => 420, "Otilde" => 840, "seven" => 560, 
+    "ellipsis" => 1000, "scaron" => 440, "ordmasculine" => 360, 
+    "AE" => 900, "Ucircumflex" => 640, "lslash" => 320, 
+    "dotlessi" => 240, "sterling" => 560, "quotedblleft" => 480, 
+    "hyphen" => 420, "guilsinglright" => 240, "quotesingle" => 220, 
+    "eight" => 560, "exclamdown" => 280, "acircumflex" => 660, 
+    "endash" => 500, "oe" => 1080, "ecircumflex" => 640, 
+    "copyright" => 740, "Adieresis" => 740, "Egrave" => 520, 
+    "icircumflex" => 240, "slash" => 460, "braceright" => 340, 
+    "Edieresis" => 520, "quotedblright" => 480, "otilde" => 640, 
+    "Idieresis" => 280, "parenleft" => 380, "one" => 560, 
+    "Odieresis" => 840, "ucircumflex" => 600, "bracketleft" => 320, 
+    "Ugrave" => 640, "cent" => 560, "currency" => 560, 
+    "logicalnot" => 600, "quoteright" => 280, "Udieresis" => 640, 
+    "perthousand" => 1280, "Ydieresis" => 620, "Atilde" => 740, 
+    "breve" => 480, "bar" => 600, "fraction" => 160, "Eacute" => 520, 
+    "less" => 600, "adieresis" => 660, "guilsinglleft" => 240, 
+    "egrave" => 640, "exclam" => 280, "edieresis" => 640, "Eth" => 742, 
+    "idieresis" => 240, "period" => 280, "ae" => 1080, 
+    "asterisk" => 440, "odieresis" => 640, "Uacute" => 640, 
+    "ugrave" => 600, "five" => 560, "nine" => 560, "greater" => 600, 
+    "Zcaron" => 500, "udieresis" => 600, "threequarters" => 840, 
+    "guillemotright" => 460, "Ccedilla" => 780, "ydieresis" => 580, 
+    "tilde" => 480, "atilde" => 660, "at" => 740, "brokenbar" => 600, 
+    "eacute" => 640, "quoteleft" => 280, "underscore" => 500, 
+    "onesuperior" => 336, 
+  }
+);
+1;
diff --git a/doc/metrics/pagdo8a.ph b/doc/metrics/pagdo8a.ph
new file mode 100644 (file)
index 0000000..727ea00
--- /dev/null
@@ -0,0 +1,72 @@
+%PS_AvantGarde_DemiOblique = (
+  name => 'AvantGarde-DemiOblique',
+  widths => {
+    "multiply" => 600, "Ntilde" => 740, "zero" => 560, "eth" => 640, 
+    "Ograve" => 840, "uacute" => 600, "braceleft" => 340, 
+    "Thorn" => 560, "zcaron" => 460, "comma" => 280, "cedilla" => 340, 
+    "plusminus" => 600, "ccedilla" => 640, "circumflex" => 540, 
+    "dotaccent" => 280, "asciitilde" => 600, "colon" => 280, 
+    "onehalf" => 840, "dollar" => 560, "ntilde" => 600, 
+    "Ocircumflex" => 840, "Oacute" => 840, "ogonek" => 340, 
+    "ograve" => 640, "thorn" => 660, "minus" => 600, "degree" => 400, 
+    "yen" => 560, "space" => 280, "registered" => 740, 
+    "questiondown" => 560, "Aring" => 740, "percent" => 860, 
+    "emdash" => 1000, "six" => 560, "Agrave" => 740, 
+    "paragraph" => 600, "three" => 560, "numbersign" => 560, 
+    "two" => 560, "Igrave" => 280, "oacute" => 640, 
+    "ocircumflex" => 640, "A" => 740, "B" => 580, "C" => 780, 
+    "D" => 700, "E" => 520, "onequarter" => 840, "F" => 480, 
+    "G" => 840, "H" => 680, "I" => 280, "J" => 480, "K" => 620, 
+    "L" => 440, "backslash" => 640, "asciicircum" => 600, 
+    "periodcentered" => 280, "M" => 900, "N" => 740, "O" => 840, 
+    "P" => 560, "aring" => 660, "Q" => 840, "R" => 580, 
+    "Aacute" => 740, "caron" => 540, "S" => 520, "T" => 420, 
+    "grave" => 420, "U" => 640, "agrave" => 660, "V" => 700, 
+    "W" => 900, "equal" => 600, "question" => 560, "X" => 680, 
+    "Y" => 620, "Z" => 500, "bracketright" => 320, "Iacute" => 280, 
+    "ampersand" => 680, "four" => 560, "igrave" => 240, "a" => 660, 
+    "b" => 660, "c" => 640, "d" => 660, "plus" => 600, "e" => 640, 
+    "quotesinglbase" => 280, "f" => 280, "g" => 660, "bullet" => 600, 
+    "h" => 600, "i" => 240, "Oslash" => 840, "dagger" => 560, 
+    "j" => 260, "Yacute" => 620, "k" => 580, "l" => 240, "m" => 940, 
+    "n" => 600, "o" => 640, "ordfeminine" => 360, "ring" => 360, 
+    "p" => 660, "threesuperior" => 336, "q" => 660, "acute" => 420, 
+    "r" => 320, "twosuperior" => 336, "aacute" => 660, "s" => 440, 
+    "OE" => 1060, "t" => 300, "divide" => 600, "section" => 560, 
+    "u" => 600, "v" => 560, "w" => 800, "dieresis" => 500, "x" => 560, 
+    "y" => 580, "z" => 460, "iacute" => 240, "quotedblbase" => 480, 
+    "hungarumlaut" => 700, "quotedbl" => 360, "mu" => 576, 
+    "Scaron" => 520, "Lslash" => 480, "semicolon" => 280, 
+    "oslash" => 660, "florin" => 560, "yacute" => 580, "fi" => 520, 
+    "fl" => 520, "Acircumflex" => 740, "parenright" => 380, 
+    "Ecircumflex" => 520, "trademark" => 1000, "Icircumflex" => 280, 
+    "daggerdbl" => 560, "guillemotleft" => 460, "germandbls" => 600, 
+    "macron" => 420, "Otilde" => 840, "seven" => 560, 
+    "ellipsis" => 1000, "scaron" => 440, "ordmasculine" => 360, 
+    "AE" => 900, "Ucircumflex" => 640, "lslash" => 320, 
+    "dotlessi" => 240, "sterling" => 560, "quotedblleft" => 480, 
+    "hyphen" => 420, "guilsinglright" => 240, "quotesingle" => 220, 
+    "eight" => 560, "exclamdown" => 280, "acircumflex" => 660, 
+    "endash" => 500, "oe" => 1080, "ecircumflex" => 640, 
+    "copyright" => 740, "Adieresis" => 740, "Egrave" => 520, 
+    "icircumflex" => 240, "slash" => 460, "braceright" => 340, 
+    "Edieresis" => 520, "quotedblright" => 480, "otilde" => 640, 
+    "Idieresis" => 280, "parenleft" => 380, "one" => 560, 
+    "Odieresis" => 840, "ucircumflex" => 600, "bracketleft" => 320, 
+    "Ugrave" => 640, "cent" => 560, "currency" => 560, 
+    "logicalnot" => 600, "quoteright" => 280, "Udieresis" => 640, 
+    "perthousand" => 1280, "Ydieresis" => 620, "Atilde" => 740, 
+    "breve" => 480, "bar" => 600, "fraction" => 160, "Eacute" => 520, 
+    "less" => 600, "adieresis" => 660, "guilsinglleft" => 240, 
+    "egrave" => 640, "exclam" => 280, "edieresis" => 640, "Eth" => 742, 
+    "idieresis" => 240, "period" => 280, "ae" => 1080, 
+    "asterisk" => 440, "odieresis" => 640, "Uacute" => 640, 
+    "ugrave" => 600, "five" => 560, "nine" => 560, "greater" => 600, 
+    "Zcaron" => 500, "udieresis" => 600, "threequarters" => 840, 
+    "guillemotright" => 460, "Ccedilla" => 780, "ydieresis" => 580, 
+    "tilde" => 480, "atilde" => 660, "at" => 740, "brokenbar" => 600, 
+    "eacute" => 640, "quoteleft" => 280, "underscore" => 500, 
+    "onesuperior" => 336, 
+  }
+);
+1;
diff --git a/doc/metrics/pagk8a.ph b/doc/metrics/pagk8a.ph
new file mode 100644 (file)
index 0000000..df90997
--- /dev/null
@@ -0,0 +1,72 @@
+%PS_AvantGarde_Book = (
+  name => 'AvantGarde-Book',
+  widths => {
+    "multiply" => 606, "Ntilde" => 740, "zero" => 554, "eth" => 655, 
+    "Ograve" => 869, "uacute" => 608, "braceleft" => 351, 
+    "Thorn" => 592, "zcaron" => 425, "comma" => 277, "cedilla" => 324, 
+    "plusminus" => 606, "ccedilla" => 647, "circumflex" => 502, 
+    "dotaccent" => 222, "asciitilde" => 606, "colon" => 277, 
+    "onehalf" => 831, "dollar" => 554, "ntilde" => 610, 
+    "Ocircumflex" => 869, "Oacute" => 869, "ogonek" => 302, 
+    "ograve" => 655, "thorn" => 682, "minus" => 606, "degree" => 400, 
+    "yen" => 554, "space" => 277, "registered" => 747, 
+    "questiondown" => 591, "Aring" => 740, "percent" => 775, 
+    "emdash" => 1000, "six" => 554, "Agrave" => 740, 
+    "paragraph" => 564, "three" => 554, "numbersign" => 554, 
+    "two" => 554, "Igrave" => 226, "oacute" => 655, 
+    "ocircumflex" => 655, "A" => 740, "B" => 574, "C" => 813, 
+    "D" => 744, "E" => 536, "onequarter" => 831, "F" => 485, 
+    "G" => 872, "H" => 683, "I" => 226, "J" => 482, "K" => 591, 
+    "L" => 462, "backslash" => 605, "asciicircum" => 606, 
+    "periodcentered" => 277, "M" => 919, "N" => 740, "O" => 869, 
+    "P" => 592, "aring" => 683, "Q" => 871, "R" => 607, 
+    "Aacute" => 740, "caron" => 502, "S" => 498, "T" => 426, 
+    "grave" => 378, "U" => 655, "agrave" => 683, "V" => 702, 
+    "W" => 960, "equal" => 606, "question" => 591, "X" => 609, 
+    "Y" => 592, "Z" => 480, "bracketright" => 351, "Iacute" => 226, 
+    "ampersand" => 757, "four" => 554, "igrave" => 200, "a" => 683, 
+    "b" => 682, "c" => 647, "d" => 685, "plus" => 606, "e" => 650, 
+    "quotesinglbase" => 354, "f" => 314, "g" => 673, "bullet" => 606, 
+    "h" => 610, "i" => 200, "Oslash" => 868, "dagger" => 553, 
+    "j" => 203, "Yacute" => 592, "k" => 502, "l" => 200, "m" => 938, 
+    "n" => 610, "o" => 655, "ordfeminine" => 369, "ring" => 332, 
+    "p" => 682, "threesuperior" => 332, "q" => 682, "acute" => 375, 
+    "r" => 301, "twosuperior" => 332, "aacute" => 683, "s" => 388, 
+    "OE" => 1194, "t" => 339, "divide" => 606, "section" => 615, 
+    "u" => 608, "v" => 554, "w" => 831, "dieresis" => 369, "x" => 480, 
+    "y" => 536, "z" => 425, "iacute" => 200, "quotedblbase" => 502, 
+    "hungarumlaut" => 552, "quotedbl" => 309, "mu" => 608, 
+    "Scaron" => 498, "Lslash" => 517, "semicolon" => 277, 
+    "oslash" => 653, "florin" => 554, "yacute" => 536, "fi" => 487, 
+    "fl" => 485, "Acircumflex" => 740, "parenright" => 369, 
+    "Ecircumflex" => 536, "trademark" => 1000, "Icircumflex" => 226, 
+    "daggerdbl" => 553, "guillemotleft" => 425, "germandbls" => 554, 
+    "macron" => 485, "Otilde" => 869, "seven" => 554, 
+    "ellipsis" => 1000, "scaron" => 388, "ordmasculine" => 369, 
+    "AE" => 992, "Ucircumflex" => 655, "lslash" => 300, 
+    "dotlessi" => 200, "sterling" => 554, "quotedblleft" => 502, 
+    "hyphen" => 332, "guilsinglright" => 251, "quotesingle" => 198, 
+    "eight" => 554, "exclamdown" => 295, "acircumflex" => 683, 
+    "endash" => 500, "oe" => 1137, "ecircumflex" => 650, 
+    "copyright" => 747, "Adieresis" => 740, "Egrave" => 536, 
+    "icircumflex" => 200, "slash" => 437, "braceright" => 351, 
+    "Edieresis" => 536, "quotedblright" => 484, "otilde" => 655, 
+    "Idieresis" => 226, "parenleft" => 369, "one" => 554, 
+    "Odieresis" => 869, "ucircumflex" => 608, "bracketleft" => 351, 
+    "Ugrave" => 655, "cent" => 554, "currency" => 554, 
+    "logicalnot" => 606, "quoteright" => 351, "Udieresis" => 655, 
+    "perthousand" => 1174, "Ydieresis" => 592, "Atilde" => 740, 
+    "breve" => 453, "bar" => 672, "fraction" => 166, "Eacute" => 536, 
+    "less" => 606, "adieresis" => 683, "guilsinglleft" => 251, 
+    "egrave" => 650, "exclam" => 295, "edieresis" => 650, "Eth" => 790, 
+    "idieresis" => 200, "period" => 277, "ae" => 1157, 
+    "asterisk" => 425, "odieresis" => 655, "Uacute" => 655, 
+    "ugrave" => 608, "five" => 554, "nine" => 554, "greater" => 606, 
+    "Zcaron" => 480, "udieresis" => 608, "threequarters" => 831, 
+    "guillemotright" => 425, "Ccedilla" => 813, "ydieresis" => 536, 
+    "tilde" => 439, "atilde" => 683, "at" => 867, "brokenbar" => 672, 
+    "eacute" => 650, "quoteleft" => 351, "underscore" => 500, 
+    "onesuperior" => 332, 
+  }
+);
+1;
diff --git a/doc/metrics/pagko8a.ph b/doc/metrics/pagko8a.ph
new file mode 100644 (file)
index 0000000..0e9ae31
--- /dev/null
@@ -0,0 +1,72 @@
+%PS_AvantGarde_BookOblique = (
+  name => 'AvantGarde-BookOblique',
+  widths => {
+    "multiply" => 606, "Ntilde" => 740, "zero" => 554, "eth" => 655, 
+    "Ograve" => 869, "uacute" => 608, "braceleft" => 351, 
+    "Thorn" => 592, "zcaron" => 425, "comma" => 277, "cedilla" => 324, 
+    "plusminus" => 606, "ccedilla" => 647, "circumflex" => 502, 
+    "dotaccent" => 222, "asciitilde" => 606, "colon" => 277, 
+    "onehalf" => 831, "dollar" => 554, "ntilde" => 610, 
+    "Ocircumflex" => 869, "Oacute" => 869, "ogonek" => 302, 
+    "ograve" => 655, "thorn" => 682, "minus" => 606, "degree" => 400, 
+    "yen" => 554, "space" => 277, "registered" => 747, 
+    "questiondown" => 591, "Aring" => 740, "percent" => 775, 
+    "emdash" => 1000, "six" => 554, "Agrave" => 740, 
+    "paragraph" => 564, "three" => 554, "numbersign" => 554, 
+    "two" => 554, "Igrave" => 226, "oacute" => 655, 
+    "ocircumflex" => 655, "A" => 740, "B" => 574, "C" => 813, 
+    "D" => 744, "E" => 536, "onequarter" => 831, "F" => 485, 
+    "G" => 872, "H" => 683, "I" => 226, "J" => 482, "K" => 591, 
+    "L" => 462, "backslash" => 605, "asciicircum" => 606, 
+    "periodcentered" => 277, "M" => 919, "N" => 740, "O" => 869, 
+    "P" => 592, "aring" => 683, "Q" => 871, "R" => 607, 
+    "Aacute" => 740, "caron" => 502, "S" => 498, "T" => 426, 
+    "grave" => 378, "U" => 655, "agrave" => 683, "V" => 702, 
+    "W" => 960, "equal" => 606, "question" => 591, "X" => 609, 
+    "Y" => 592, "Z" => 480, "bracketright" => 351, "Iacute" => 226, 
+    "ampersand" => 757, "four" => 554, "igrave" => 200, "a" => 683, 
+    "b" => 682, "c" => 647, "d" => 685, "plus" => 606, "e" => 650, 
+    "quotesinglbase" => 354, "f" => 314, "g" => 673, "bullet" => 606, 
+    "h" => 610, "i" => 200, "Oslash" => 868, "dagger" => 553, 
+    "j" => 203, "Yacute" => 592, "k" => 502, "l" => 200, "m" => 938, 
+    "n" => 610, "o" => 655, "ordfeminine" => 369, "ring" => 332, 
+    "p" => 682, "threesuperior" => 332, "q" => 682, "acute" => 375, 
+    "r" => 301, "twosuperior" => 332, "aacute" => 683, "s" => 388, 
+    "OE" => 1194, "t" => 339, "divide" => 606, "section" => 615, 
+    "u" => 608, "v" => 554, "w" => 831, "dieresis" => 369, "x" => 480, 
+    "y" => 536, "z" => 425, "iacute" => 200, "quotedblbase" => 502, 
+    "hungarumlaut" => 552, "quotedbl" => 309, "mu" => 608, 
+    "Scaron" => 498, "Lslash" => 517, "semicolon" => 277, 
+    "oslash" => 653, "florin" => 554, "yacute" => 536, "fi" => 487, 
+    "fl" => 485, "Acircumflex" => 740, "parenright" => 369, 
+    "Ecircumflex" => 536, "trademark" => 1000, "Icircumflex" => 226, 
+    "daggerdbl" => 553, "guillemotleft" => 425, "germandbls" => 554, 
+    "macron" => 485, "Otilde" => 869, "seven" => 554, 
+    "ellipsis" => 1000, "scaron" => 388, "ordmasculine" => 369, 
+    "AE" => 992, "Ucircumflex" => 655, "lslash" => 300, 
+    "dotlessi" => 200, "sterling" => 554, "quotedblleft" => 502, 
+    "hyphen" => 332, "guilsinglright" => 251, "quotesingle" => 198, 
+    "eight" => 554, "exclamdown" => 295, "acircumflex" => 683, 
+    "endash" => 500, "oe" => 1137, "ecircumflex" => 650, 
+    "copyright" => 747, "Adieresis" => 740, "Egrave" => 536, 
+    "icircumflex" => 200, "slash" => 437, "braceright" => 351, 
+    "Edieresis" => 536, "quotedblright" => 484, "otilde" => 655, 
+    "Idieresis" => 226, "parenleft" => 369, "one" => 554, 
+    "Odieresis" => 869, "ucircumflex" => 608, "bracketleft" => 351, 
+    "Ugrave" => 655, "cent" => 554, "currency" => 554, 
+    "logicalnot" => 606, "quoteright" => 351, "Udieresis" => 655, 
+    "perthousand" => 1174, "Ydieresis" => 592, "Atilde" => 740, 
+    "breve" => 453, "bar" => 672, "fraction" => 166, "Eacute" => 536, 
+    "less" => 606, "adieresis" => 683, "guilsinglleft" => 251, 
+    "egrave" => 650, "exclam" => 295, "edieresis" => 650, "Eth" => 790, 
+    "idieresis" => 200, "period" => 277, "ae" => 1157, 
+    "asterisk" => 425, "odieresis" => 655, "Uacute" => 655, 
+    "ugrave" => 608, "five" => 554, "nine" => 554, "greater" => 606, 
+    "Zcaron" => 480, "udieresis" => 608, "threequarters" => 831, 
+    "guillemotright" => 425, "Ccedilla" => 813, "ydieresis" => 536, 
+    "tilde" => 439, "atilde" => 683, "at" => 867, "brokenbar" => 672, 
+    "eacute" => 650, "quoteleft" => 351, "underscore" => 500, 
+    "onesuperior" => 332, 
+  }
+);
+1;
diff --git a/doc/metrics/pbkd8a.ph b/doc/metrics/pbkd8a.ph
new file mode 100644 (file)
index 0000000..5d80089
--- /dev/null
@@ -0,0 +1,72 @@
+%PS_Bookman_Demi = (
+  name => 'Bookman-Demi',
+  widths => {
+    "multiply" => 600, "Ntilde" => 740, "zero" => 660, "eth" => 620, 
+    "Ograve" => 800, "uacute" => 660, "braceleft" => 320, 
+    "Thorn" => 660, "zcaron" => 560, "comma" => 340, "cedilla" => 360, 
+    "plusminus" => 600, "ccedilla" => 580, "circumflex" => 500, 
+    "dotaccent" => 320, "asciitilde" => 600, "colon" => 340, 
+    "onehalf" => 990, "dollar" => 660, "ntilde" => 680, 
+    "Ocircumflex" => 800, "Oacute" => 800, "ogonek" => 320, 
+    "ograve" => 620, "thorn" => 640, "minus" => 600, "degree" => 400, 
+    "yen" => 660, "space" => 340, "registered" => 740, 
+    "questiondown" => 660, "Aring" => 720, "percent" => 940, 
+    "emdash" => 1000, "six" => 660, "Agrave" => 720, 
+    "paragraph" => 800, "three" => 660, "numbersign" => 660, 
+    "two" => 660, "Igrave" => 400, "oacute" => 620, 
+    "ocircumflex" => 620, "A" => 720, "B" => 720, "C" => 740, 
+    "D" => 780, "E" => 720, "onequarter" => 990, "F" => 680, 
+    "G" => 780, "H" => 820, "I" => 400, "J" => 640, "K" => 800, 
+    "L" => 640, "backslash" => 600, "asciicircum" => 600, 
+    "periodcentered" => 340, "M" => 940, "N" => 740, "O" => 800, 
+    "P" => 660, "aring" => 580, "Q" => 800, "R" => 780, 
+    "Aacute" => 720, "caron" => 500, "S" => 660, "T" => 700, 
+    "grave" => 400, "U" => 740, "agrave" => 580, "V" => 720, 
+    "W" => 940, "equal" => 600, "question" => 660, "X" => 780, 
+    "Y" => 700, "Z" => 640, "bracketright" => 300, "Iacute" => 400, 
+    "ampersand" => 800, "four" => 660, "igrave" => 360, "a" => 580, 
+    "b" => 600, "c" => 580, "d" => 640, "plus" => 600, "e" => 580, 
+    "quotesinglbase" => 320, "f" => 380, "g" => 580, "bullet" => 460, 
+    "h" => 680, "i" => 360, "Oslash" => 800, "dagger" => 440, 
+    "j" => 340, "Yacute" => 700, "k" => 660, "l" => 340, "m" => 1000, 
+    "n" => 680, "o" => 620, "ordfeminine" => 400, "ring" => 340, 
+    "p" => 640, "threesuperior" => 396, "q" => 620, "acute" => 400, 
+    "r" => 460, "twosuperior" => 396, "aacute" => 580, "s" => 520, 
+    "OE" => 1220, "t" => 460, "divide" => 600, "section" => 600, 
+    "u" => 660, "v" => 600, "w" => 800, "dieresis" => 500, "x" => 600, 
+    "y" => 620, "z" => 560, "iacute" => 360, "quotedblbase" => 540, 
+    "hungarumlaut" => 440, "quotedbl" => 420, "mu" => 660, 
+    "Scaron" => 660, "Lslash" => 640, "semicolon" => 340, 
+    "oslash" => 620, "florin" => 660, "yacute" => 620, "fi" => 740, 
+    "fl" => 740, "Acircumflex" => 720, "parenright" => 320, 
+    "Ecircumflex" => 720, "trademark" => 980, "Icircumflex" => 400, 
+    "daggerdbl" => 380, "guillemotleft" => 400, "germandbls" => 660, 
+    "macron" => 460, "Otilde" => 800, "seven" => 660, 
+    "ellipsis" => 1000, "scaron" => 520, "ordmasculine" => 400, 
+    "AE" => 1140, "Ucircumflex" => 740, "lslash" => 340, 
+    "dotlessi" => 360, "sterling" => 660, "quotedblleft" => 540, 
+    "hyphen" => 360, "guilsinglright" => 220, "quotesingle" => 240, 
+    "eight" => 660, "exclamdown" => 360, "acircumflex" => 580, 
+    "endash" => 500, "oe" => 940, "ecircumflex" => 580, 
+    "copyright" => 740, "Adieresis" => 720, "Egrave" => 720, 
+    "icircumflex" => 360, "slash" => 600, "braceright" => 320, 
+    "Edieresis" => 720, "quotedblright" => 540, "otilde" => 620, 
+    "Idieresis" => 400, "parenleft" => 320, "one" => 660, 
+    "Odieresis" => 800, "ucircumflex" => 660, "bracketleft" => 300, 
+    "Ugrave" => 740, "cent" => 660, "currency" => 660, 
+    "logicalnot" => 600, "quoteright" => 320, "Udieresis" => 740, 
+    "perthousand" => 1360, "Ydieresis" => 700, "Atilde" => 720, 
+    "breve" => 500, "bar" => 600, "fraction" => 120, "Eacute" => 720, 
+    "less" => 600, "adieresis" => 580, "guilsinglleft" => 220, 
+    "egrave" => 580, "exclam" => 360, "edieresis" => 580, "Eth" => 780, 
+    "idieresis" => 360, "period" => 340, "ae" => 880, 
+    "asterisk" => 460, "odieresis" => 620, "Uacute" => 740, 
+    "ugrave" => 660, "five" => 660, "nine" => 660, "greater" => 600, 
+    "Zcaron" => 640, "udieresis" => 660, "threequarters" => 990, 
+    "guillemotright" => 400, "Ccedilla" => 740, "ydieresis" => 620, 
+    "tilde" => 480, "atilde" => 580, "at" => 820, "brokenbar" => 600, 
+    "eacute" => 580, "quoteleft" => 320, "underscore" => 500, 
+    "onesuperior" => 396, 
+  }
+);
+1;
diff --git a/doc/metrics/pbkdi8a.ph b/doc/metrics/pbkdi8a.ph
new file mode 100644 (file)
index 0000000..8bf5e25
--- /dev/null
@@ -0,0 +1,72 @@
+%PS_Bookman_DemiItalic = (
+  name => 'Bookman-DemiItalic',
+  widths => {
+    "multiply" => 600, "Ntilde" => 740, "zero" => 680, "eth" => 600, 
+    "Ograve" => 760, "uacute" => 680, "braceleft" => 300, 
+    "Thorn" => 640, "zcaron" => 560, "comma" => 340, "cedilla" => 360, 
+    "plusminus" => 600, "ccedilla" => 560, "circumflex" => 480, 
+    "dotaccent" => 380, "asciitilde" => 620, "colon" => 340, 
+    "onehalf" => 1020, "dollar" => 680, "ntilde" => 680, 
+    "Ocircumflex" => 760, "Oacute" => 760, "ogonek" => 320, 
+    "ograve" => 600, "thorn" => 660, "minus" => 600, "degree" => 400, 
+    "yen" => 680, "space" => 340, "registered" => 780, 
+    "questiondown" => 620, "Aring" => 720, "percent" => 880, 
+    "emdash" => 1000, "six" => 680, "Agrave" => 720, 
+    "paragraph" => 680, "three" => 680, "numbersign" => 680, 
+    "two" => 680, "Igrave" => 380, "oacute" => 600, 
+    "ocircumflex" => 600, "A" => 720, "B" => 720, "C" => 700, 
+    "D" => 760, "E" => 720, "onequarter" => 1020, "F" => 660, 
+    "G" => 760, "H" => 800, "I" => 380, "J" => 620, "K" => 780, 
+    "L" => 640, "backslash" => 580, "asciicircum" => 620, 
+    "periodcentered" => 340, "M" => 860, "N" => 740, "O" => 760, 
+    "P" => 640, "aring" => 680, "Q" => 760, "R" => 740, 
+    "Aacute" => 720, "caron" => 480, "S" => 700, "T" => 700, 
+    "grave" => 380, "U" => 740, "agrave" => 680, "V" => 660, 
+    "W" => 1000, "equal" => 600, "question" => 620, "X" => 740, 
+    "Y" => 660, "Z" => 680, "bracketright" => 260, "Iacute" => 380, 
+    "ampersand" => 980, "four" => 680, "igrave" => 380, "a" => 680, 
+    "b" => 600, "c" => 560, "d" => 680, "plus" => 600, "e" => 560, 
+    "quotesinglbase" => 300, "f" => 420, "g" => 620, "bullet" => 360, 
+    "h" => 700, "i" => 380, "Oslash" => 760, "dagger" => 420, 
+    "j" => 320, "Yacute" => 660, "k" => 700, "l" => 380, "m" => 960, 
+    "n" => 680, "o" => 600, "ordfeminine" => 440, "ring" => 360, 
+    "p" => 660, "threesuperior" => 408, "q" => 620, "acute" => 340, 
+    "r" => 500, "twosuperior" => 408, "aacute" => 680, "s" => 540, 
+    "OE" => 1180, "t" => 440, "divide" => 600, "section" => 620, 
+    "u" => 680, "v" => 540, "w" => 860, "dieresis" => 520, "x" => 620, 
+    "y" => 600, "z" => 560, "iacute" => 380, "quotedblbase" => 520, 
+    "hungarumlaut" => 560, "quotedbl" => 380, "mu" => 680, 
+    "Scaron" => 700, "Lslash" => 640, "semicolon" => 340, 
+    "oslash" => 600, "florin" => 680, "yacute" => 600, "fi" => 820, 
+    "fl" => 820, "Acircumflex" => 720, "parenright" => 260, 
+    "Ecircumflex" => 720, "trademark" => 940, "Icircumflex" => 380, 
+    "daggerdbl" => 420, "guillemotleft" => 380, "germandbls" => 660, 
+    "macron" => 480, "Otilde" => 760, "seven" => 680, 
+    "ellipsis" => 1000, "scaron" => 540, "ordmasculine" => 440, 
+    "AE" => 1140, "Ucircumflex" => 740, "lslash" => 380, 
+    "dotlessi" => 380, "sterling" => 680, "quotedblleft" => 520, 
+    "hyphen" => 280, "guilsinglright" => 220, "quotesingle" => 180, 
+    "eight" => 680, "exclamdown" => 320, "acircumflex" => 680, 
+    "endash" => 500, "oe" => 920, "ecircumflex" => 560, 
+    "copyright" => 780, "Adieresis" => 720, "Egrave" => 720, 
+    "icircumflex" => 380, "slash" => 360, "braceright" => 300, 
+    "Edieresis" => 720, "quotedblright" => 520, "otilde" => 600, 
+    "Idieresis" => 380, "parenleft" => 260, "one" => 680, 
+    "Odieresis" => 760, "ucircumflex" => 680, "bracketleft" => 260, 
+    "Ugrave" => 740, "cent" => 680, "currency" => 680, 
+    "logicalnot" => 620, "quoteright" => 320, "Udieresis" => 740, 
+    "perthousand" => 1360, "Ydieresis" => 660, "Atilde" => 720, 
+    "breve" => 460, "bar" => 620, "fraction" => 120, "Eacute" => 720, 
+    "less" => 620, "adieresis" => 680, "guilsinglleft" => 220, 
+    "egrave" => 560, "exclam" => 320, "edieresis" => 560, "Eth" => 760, 
+    "idieresis" => 380, "period" => 340, "ae" => 880, 
+    "asterisk" => 460, "odieresis" => 600, "Uacute" => 740, 
+    "ugrave" => 680, "five" => 680, "nine" => 680, "greater" => 620, 
+    "Zcaron" => 680, "udieresis" => 680, "threequarters" => 1020, 
+    "guillemotright" => 380, "Ccedilla" => 700, "ydieresis" => 600, 
+    "tilde" => 480, "atilde" => 680, "at" => 780, "brokenbar" => 620, 
+    "eacute" => 560, "quoteleft" => 320, "underscore" => 500, 
+    "onesuperior" => 408, 
+  }
+);
+1;
diff --git a/doc/metrics/pbkl8a.ph b/doc/metrics/pbkl8a.ph
new file mode 100644 (file)
index 0000000..bcc2a74
--- /dev/null
@@ -0,0 +1,72 @@
+%PS_Bookman_Light = (
+  name => 'Bookman-Light',
+  widths => {
+    "multiply" => 600, "Ntilde" => 740, "zero" => 620, "eth" => 560, 
+    "Ograve" => 800, "uacute" => 680, "braceleft" => 280, 
+    "Thorn" => 620, "zcaron" => 480, "comma" => 320, "cedilla" => 320, 
+    "plusminus" => 600, "ccedilla" => 520, "circumflex" => 420, 
+    "dotaccent" => 260, "asciitilde" => 600, "colon" => 320, 
+    "onehalf" => 930, "dollar" => 620, "ntilde" => 660, 
+    "Ocircumflex" => 800, "Oacute" => 800, "ogonek" => 320, 
+    "ograve" => 560, "thorn" => 620, "minus" => 600, "degree" => 400, 
+    "yen" => 620, "space" => 320, "registered" => 740, 
+    "questiondown" => 540, "Aring" => 680, "percent" => 900, 
+    "emdash" => 1000, "six" => 620, "Agrave" => 680, 
+    "paragraph" => 600, "three" => 620, "numbersign" => 620, 
+    "two" => 620, "Igrave" => 340, "oacute" => 560, 
+    "ocircumflex" => 560, "A" => 680, "B" => 740, "C" => 740, 
+    "D" => 800, "E" => 720, "onequarter" => 930, "F" => 640, 
+    "G" => 800, "H" => 800, "I" => 340, "J" => 600, "K" => 720, 
+    "L" => 600, "backslash" => 600, "asciicircum" => 600, 
+    "periodcentered" => 320, "M" => 920, "N" => 740, "O" => 800, 
+    "P" => 620, "aring" => 580, "Q" => 820, "R" => 720, 
+    "Aacute" => 680, "caron" => 420, "S" => 660, "T" => 620, 
+    "grave" => 340, "U" => 780, "agrave" => 580, "V" => 700, 
+    "W" => 960, "equal" => 600, "question" => 540, "X" => 720, 
+    "Y" => 640, "Z" => 640, "bracketright" => 300, "Iacute" => 340, 
+    "ampersand" => 800, "four" => 620, "igrave" => 300, "a" => 580, 
+    "b" => 620, "c" => 520, "d" => 620, "plus" => 600, "e" => 520, 
+    "quotesinglbase" => 220, "f" => 320, "g" => 540, "bullet" => 460, 
+    "h" => 660, "i" => 300, "Oslash" => 800, "dagger" => 540, 
+    "j" => 300, "Yacute" => 640, "k" => 620, "l" => 300, "m" => 940, 
+    "n" => 660, "o" => 560, "ordfeminine" => 420, "ring" => 320, 
+    "p" => 620, "threesuperior" => 372, "q" => 580, "acute" => 340, 
+    "r" => 440, "twosuperior" => 372, "aacute" => 580, "s" => 520, 
+    "OE" => 1240, "t" => 380, "divide" => 600, "section" => 520, 
+    "u" => 680, "v" => 520, "w" => 780, "dieresis" => 420, "x" => 560, 
+    "y" => 540, "z" => 480, "iacute" => 300, "quotedblbase" => 400, 
+    "hungarumlaut" => 380, "quotedbl" => 380, "mu" => 680, 
+    "Scaron" => 660, "Lslash" => 600, "semicolon" => 320, 
+    "oslash" => 560, "florin" => 620, "yacute" => 540, "fi" => 620, 
+    "fl" => 620, "Acircumflex" => 680, "parenright" => 300, 
+    "Ecircumflex" => 720, "trademark" => 980, "Icircumflex" => 340, 
+    "daggerdbl" => 540, "guillemotleft" => 360, "germandbls" => 660, 
+    "macron" => 440, "Otilde" => 800, "seven" => 620, 
+    "ellipsis" => 1000, "scaron" => 520, "ordmasculine" => 420, 
+    "AE" => 1260, "Ucircumflex" => 780, "lslash" => 320, 
+    "dotlessi" => 300, "sterling" => 620, "quotedblleft" => 400, 
+    "hyphen" => 400, "guilsinglright" => 240, "quotesingle" => 220, 
+    "eight" => 620, "exclamdown" => 300, "acircumflex" => 580, 
+    "endash" => 500, "oe" => 900, "ecircumflex" => 520, 
+    "copyright" => 740, "Adieresis" => 680, "Egrave" => 720, 
+    "icircumflex" => 300, "slash" => 600, "braceright" => 280, 
+    "Edieresis" => 720, "quotedblright" => 400, "otilde" => 560, 
+    "Idieresis" => 340, "parenleft" => 300, "one" => 620, 
+    "Odieresis" => 800, "ucircumflex" => 680, "bracketleft" => 300, 
+    "Ugrave" => 780, "cent" => 620, "currency" => 620, 
+    "logicalnot" => 600, "quoteright" => 220, "Udieresis" => 780, 
+    "perthousand" => 1280, "Ydieresis" => 640, "Atilde" => 680, 
+    "breve" => 460, "bar" => 600, "fraction" => 140, "Eacute" => 720, 
+    "less" => 600, "adieresis" => 580, "guilsinglleft" => 240, 
+    "egrave" => 520, "exclam" => 300, "edieresis" => 520, "Eth" => 800, 
+    "idieresis" => 300, "period" => 320, "ae" => 860, 
+    "asterisk" => 440, "odieresis" => 560, "Uacute" => 780, 
+    "ugrave" => 680, "five" => 620, "nine" => 620, "greater" => 600, 
+    "Zcaron" => 640, "udieresis" => 680, "threequarters" => 930, 
+    "guillemotright" => 360, "Ccedilla" => 740, "ydieresis" => 540, 
+    "tilde" => 440, "atilde" => 580, "at" => 820, "brokenbar" => 600, 
+    "eacute" => 520, "quoteleft" => 220, "underscore" => 500, 
+    "onesuperior" => 372, 
+  }
+);
+1;
diff --git a/doc/metrics/pbkli8a.ph b/doc/metrics/pbkli8a.ph
new file mode 100644 (file)
index 0000000..7c5ded3
--- /dev/null
@@ -0,0 +1,72 @@
+%PS_Bookman_LightItalic = (
+  name => 'Bookman-LightItalic',
+  widths => {
+    "multiply" => 600, "Ntilde" => 720, "zero" => 620, "eth" => 540, 
+    "Ograve" => 760, "uacute" => 620, "braceleft" => 360, 
+    "Thorn" => 600, "zcaron" => 520, "comma" => 300, "cedilla" => 320, 
+    "plusminus" => 600, "ccedilla" => 480, "circumflex" => 440, 
+    "dotaccent" => 260, "asciitilde" => 600, "colon" => 300, 
+    "onehalf" => 930, "dollar" => 620, "ntilde" => 620, 
+    "Ocircumflex" => 760, "Oacute" => 760, "ogonek" => 260, 
+    "ograve" => 540, "thorn" => 600, "minus" => 600, "degree" => 400, 
+    "yen" => 620, "space" => 300, "registered" => 740, 
+    "questiondown" => 540, "Aring" => 700, "percent" => 800, 
+    "emdash" => 1000, "six" => 620, "Agrave" => 700, 
+    "paragraph" => 620, "three" => 620, "numbersign" => 620, 
+    "two" => 620, "Igrave" => 320, "oacute" => 540, 
+    "ocircumflex" => 540, "A" => 700, "B" => 720, "C" => 720, 
+    "D" => 740, "E" => 680, "onequarter" => 930, "F" => 620, 
+    "G" => 760, "H" => 800, "I" => 320, "J" => 560, "K" => 720, 
+    "L" => 580, "backslash" => 600, "asciicircum" => 600, 
+    "periodcentered" => 300, "M" => 860, "N" => 720, "O" => 760, 
+    "P" => 600, "aring" => 620, "Q" => 780, "R" => 700, 
+    "Aacute" => 700, "caron" => 440, "S" => 640, "T" => 600, 
+    "grave" => 340, "U" => 720, "agrave" => 620, "V" => 680, 
+    "W" => 960, "equal" => 600, "question" => 540, "X" => 700, 
+    "Y" => 660, "Z" => 580, "bracketright" => 260, "Iacute" => 320, 
+    "ampersand" => 820, "four" => 620, "igrave" => 280, "a" => 620, 
+    "b" => 600, "c" => 480, "d" => 640, "plus" => 600, "e" => 540, 
+    "quotesinglbase" => 320, "f" => 340, "g" => 560, "bullet" => 460, 
+    "h" => 620, "i" => 280, "Oslash" => 760, "dagger" => 620, 
+    "j" => 280, "Yacute" => 660, "k" => 600, "l" => 280, "m" => 880, 
+    "n" => 620, "o" => 540, "ordfeminine" => 440, "ring" => 300, 
+    "p" => 600, "threesuperior" => 372, "q" => 560, "acute" => 320, 
+    "r" => 400, "twosuperior" => 372, "aacute" => 620, "s" => 540, 
+    "OE" => 1180, "t" => 340, "divide" => 600, "section" => 620, 
+    "u" => 620, "v" => 540, "w" => 880, "dieresis" => 420, "x" => 540, 
+    "y" => 600, "z" => 520, "iacute" => 280, "quotedblbase" => 480, 
+    "hungarumlaut" => 340, "quotedbl" => 360, "mu" => 620, 
+    "Scaron" => 640, "Lslash" => 580, "semicolon" => 300, 
+    "oslash" => 540, "florin" => 620, "yacute" => 600, "fi" => 640, 
+    "fl" => 660, "Acircumflex" => 700, "parenright" => 280, 
+    "Ecircumflex" => 680, "trademark" => 980, "Icircumflex" => 320, 
+    "daggerdbl" => 620, "guillemotleft" => 300, "germandbls" => 620, 
+    "macron" => 440, "Otilde" => 760, "seven" => 620, 
+    "ellipsis" => 1000, "scaron" => 540, "ordmasculine" => 400, 
+    "AE" => 1220, "Ucircumflex" => 720, "lslash" => 340, 
+    "dotlessi" => 280, "sterling" => 620, "quotedblleft" => 440, 
+    "hyphen" => 320, "guilsinglright" => 180, "quotesingle" => 200, 
+    "eight" => 620, "exclamdown" => 320, "acircumflex" => 620, 
+    "endash" => 500, "oe" => 900, "ecircumflex" => 540, 
+    "copyright" => 740, "Adieresis" => 700, "Egrave" => 680, 
+    "icircumflex" => 280, "slash" => 600, "braceright" => 380, 
+    "Edieresis" => 680, "quotedblright" => 440, "otilde" => 540, 
+    "Idieresis" => 320, "parenleft" => 280, "one" => 620, 
+    "Odieresis" => 760, "ucircumflex" => 620, "bracketleft" => 260, 
+    "Ugrave" => 720, "cent" => 620, "currency" => 620, 
+    "logicalnot" => 600, "quoteright" => 280, "Udieresis" => 720, 
+    "perthousand" => 1180, "Ydieresis" => 660, "Atilde" => 700, 
+    "breve" => 440, "bar" => 600, "fraction" => 20, "Eacute" => 680, 
+    "less" => 600, "adieresis" => 620, "guilsinglleft" => 180, 
+    "egrave" => 540, "exclam" => 320, "edieresis" => 540, "Eth" => 740, 
+    "idieresis" => 280, "period" => 300, "ae" => 880, 
+    "asterisk" => 440, "odieresis" => 540, "Uacute" => 720, 
+    "ugrave" => 620, "five" => 620, "nine" => 620, "greater" => 600, 
+    "Zcaron" => 580, "udieresis" => 620, "threequarters" => 930, 
+    "guillemotright" => 300, "Ccedilla" => 720, "ydieresis" => 600, 
+    "tilde" => 440, "atilde" => 620, "at" => 780, "brokenbar" => 600, 
+    "eacute" => 540, "quoteleft" => 280, "underscore" => 500, 
+    "onesuperior" => 372, 
+  }
+);
+1;
diff --git a/doc/metrics/pcrb8a.ph b/doc/metrics/pcrb8a.ph
new file mode 100644 (file)
index 0000000..e4300d7
--- /dev/null
@@ -0,0 +1,82 @@
+%PS_Courier_Bold = (
+  name => 'Courier-Bold',
+  widths => {
+    "Ntilde" => 600, "comma" => 600, "cedilla" => 600, 
+    "arrowup" => 600, "plusminus" => 600, "circumflex" => 600, 
+    "dotaccent" => 600, "LL" => 600, "asciitilde" => 600, 
+    "colon" => 600, "onehalf" => 600, "dollar" => 600, "ntilde" => 600, 
+    "left" => 600, "minus" => 600, "yen" => 600, "space" => 600, 
+    "questiondown" => 600, "emdash" => 600, "Agrave" => 600, 
+    "three" => 600, "numbersign" => 600, "A" => 600, "B" => 600, 
+    "C" => 600, "D" => 600, "E" => 600, "onequarter" => 600, 
+    "F" => 600, "G" => 600, "H" => 600, "I" => 600, "J" => 600, 
+    "K" => 600, "L" => 600, "backslash" => 600, 
+    "periodcentered" => 600, "M" => 600, "N" => 600, "O" => 600, 
+    "P" => 600, "Q" => 600, "R" => 600, "Aacute" => 600, 
+    "caron" => 600, "S" => 600, "T" => 600, "U" => 600, 
+    "agrave" => 600, "V" => 600, "tab" => 600, "W" => 600, "ll" => 600, 
+    "equal" => 600, "question" => 600, "X" => 600, "Y" => 600, 
+    "Z" => 600, "four" => 600, "a" => 600, "b" => 600, "c" => 600, 
+    "d" => 600, "e" => 600, "f" => 600, "g" => 600, "bullet" => 600, 
+    "h" => 600, "i" => 600, "Oslash" => 600, "dagger" => 600, 
+    "j" => 600, "k" => 600, "l" => 600, "m" => 600, "n" => 600, 
+    "o" => 600, "ordfeminine" => 600, "ring" => 600, "p" => 600, 
+    "q" => 600, "r" => 600, "aacute" => 600, "largebullet" => 600, 
+    "twosuperior" => 600, "s" => 600, "OE" => 600, "t" => 600, 
+    "divide" => 600, "u" => 600, "v" => 600, "w" => 600, "x" => 600, 
+    "y" => 600, "z" => 600, "hungarumlaut" => 600, "quotedbl" => 600, 
+    "mu" => 600, "Scaron" => 600, "Lslash" => 600, "semicolon" => 600, 
+    "oslash" => 600, "parenright" => 600, "Ecircumflex" => 600, 
+    "trademark" => 600, "daggerdbl" => 600, "macron" => 600, 
+    "Otilde" => 600, "ellipsis" => 600, "scaron" => 600, "AE" => 600, 
+    "Ucircumflex" => 600, "lslash" => 600, "lira" => 600, 
+    "quotedblleft" => 600, "hyphen" => 600, "guilsinglright" => 600, 
+    "quotesingle" => 600, "eight" => 600, "exclamdown" => 600, 
+    "endash" => 600, "oe" => 600, "ecircumflex" => 600, 
+    "Adieresis" => 600, "copyright" => 600, "Egrave" => 600, 
+    "slash" => 600, "Edieresis" => 600, "otilde" => 600, 
+    "Idieresis" => 600, "parenleft" => 600, "one" => 600, 
+    "ucircumflex" => 600, "Odieresis" => 600, "bracketleft" => 600, 
+    "Ugrave" => 600, "quoteright" => 600, "Udieresis" => 600, 
+    "perthousand" => 600, "Ydieresis" => 600, "Eacute" => 600, 
+    "adieresis" => 600, "egrave" => 600, "edieresis" => 600, 
+    "idieresis" => 600, "Eth" => 600, "ae" => 600, "asterisk" => 600, 
+    "Uacute" => 600, "odieresis" => 600, "ugrave" => 600, 
+    "five" => 600, "nine" => 600, "udieresis" => 600, "Zcaron" => 600, 
+    "threequarters" => 600, "guillemotright" => 600, 
+    "ydieresis" => 600, "Ccedilla" => 600, "tilde" => 600, "at" => 600, 
+    "eacute" => 600, "Gcaron" => 600, "underscore" => 600, 
+    "zero" => 600, "multiply" => 600, "eth" => 600, "Scedilla" => 600, 
+    "Ograve" => 600, "uacute" => 600, "braceleft" => 600, 
+    "Thorn" => 600, "zcaron" => 600, "ccedilla" => 600, 
+    "gcaron" => 600, "Ocircumflex" => 600, "Oacute" => 600, 
+    "scedilla" => 600, "ogonek" => 600, "arrowdown" => 600, 
+    "ograve" => 600, "thorn" => 600, "degree" => 600, 
+    "registered" => 600, "percent" => 600, "Aring" => 600, 
+    "six" => 600, "paragraph" => 600, "two" => 600, "Igrave" => 600, 
+    "oacute" => 600, "ocircumflex" => 600, "asciicircum" => 600, 
+    "aring" => 600, "square" => 600, "grave" => 600, 
+    "bracketright" => 600, "ampersand" => 600, "Iacute" => 600, 
+    "igrave" => 600, "return" => 600, "plus" => 600, 
+    "quotesinglbase" => 600, "Yacute" => 600, "threesuperior" => 600, 
+    "acute" => 600, "notegraphic" => 600, "section" => 600, 
+    "arrowleft" => 600, "dieresis" => 600, "quotedblbase" => 600, 
+    "iacute" => 600, "up" => 600, "florin" => 600, "yacute" => 600, 
+    "fi" => 600, "fl" => 600, "Acircumflex" => 600, 
+    "Icircumflex" => 600, "guillemotleft" => 600, "germandbls" => 600, 
+    "seven" => 600, "prescription" => 600, "indent" => 600, 
+    "dectab" => 600, "ordmasculine" => 600, "dotlessi" => 600, 
+    "sterling" => 600, "IJ" => 600, "acircumflex" => 600, 
+    "overscore" => 600, "icircumflex" => 600, "braceright" => 600, 
+    "graybox" => 600, "quotedblright" => 600, "center" => 600, 
+    "stop" => 600, "cent" => 600, "currency" => 600, 
+    "logicalnot" => 600, "merge" => 600, "Idot" => 600, 
+    "Atilde" => 600, "breve" => 600, "bar" => 600, "fraction" => 600, 
+    "less" => 600, "down" => 600, "guilsinglleft" => 600, 
+    "exclam" => 600, "period" => 600, "format" => 600, 
+    "arrowright" => 600, "greater" => 600, "ij" => 600, 
+    "atilde" => 600, "brokenbar" => 600, "arrowboth" => 600, 
+    "quoteleft" => 600, "onesuperior" => 600, 
+  }
+);
+1;
diff --git a/doc/metrics/pcrbo8a.ph b/doc/metrics/pcrbo8a.ph
new file mode 100644 (file)
index 0000000..c1554b2
--- /dev/null
@@ -0,0 +1,82 @@
+%PS_Courier_BoldOblique = (
+  name => 'Courier-BoldOblique',
+  widths => {
+    "Ntilde" => 600, "comma" => 600, "cedilla" => 600, 
+    "arrowup" => 600, "plusminus" => 600, "circumflex" => 600, 
+    "dotaccent" => 600, "LL" => 600, "asciitilde" => 600, 
+    "colon" => 600, "onehalf" => 600, "dollar" => 600, "ntilde" => 600, 
+    "left" => 600, "minus" => 600, "yen" => 600, "space" => 600, 
+    "questiondown" => 600, "emdash" => 600, "Agrave" => 600, 
+    "three" => 600, "numbersign" => 600, "A" => 600, "B" => 600, 
+    "C" => 600, "D" => 600, "E" => 600, "onequarter" => 600, 
+    "F" => 600, "G" => 600, "H" => 600, "I" => 600, "J" => 600, 
+    "K" => 600, "L" => 600, "backslash" => 600, 
+    "periodcentered" => 600, "M" => 600, "N" => 600, "O" => 600, 
+    "P" => 600, "Q" => 600, "R" => 600, "Aacute" => 600, 
+    "caron" => 600, "S" => 600, "T" => 600, "U" => 600, 
+    "agrave" => 600, "V" => 600, "tab" => 600, "W" => 600, "ll" => 600, 
+    "equal" => 600, "question" => 600, "X" => 600, "Y" => 600, 
+    "Z" => 600, "four" => 600, "a" => 600, "b" => 600, "c" => 600, 
+    "d" => 600, "e" => 600, "f" => 600, "g" => 600, "bullet" => 600, 
+    "h" => 600, "i" => 600, "Oslash" => 600, "dagger" => 600, 
+    "j" => 600, "k" => 600, "l" => 600, "m" => 600, "n" => 600, 
+    "o" => 600, "ordfeminine" => 600, "ring" => 600, "p" => 600, 
+    "q" => 600, "r" => 600, "aacute" => 600, "largebullet" => 600, 
+    "twosuperior" => 600, "s" => 600, "OE" => 600, "t" => 600, 
+    "divide" => 600, "u" => 600, "v" => 600, "w" => 600, "x" => 600, 
+    "y" => 600, "z" => 600, "hungarumlaut" => 600, "quotedbl" => 600, 
+    "mu" => 600, "Scaron" => 600, "Lslash" => 600, "semicolon" => 600, 
+    "oslash" => 600, "parenright" => 600, "Ecircumflex" => 600, 
+    "trademark" => 600, "daggerdbl" => 600, "macron" => 600, 
+    "Otilde" => 600, "ellipsis" => 600, "scaron" => 600, "AE" => 600, 
+    "Ucircumflex" => 600, "lslash" => 600, "lira" => 600, 
+    "quotedblleft" => 600, "hyphen" => 600, "guilsinglright" => 600, 
+    "quotesingle" => 600, "eight" => 600, "exclamdown" => 600, 
+    "endash" => 600, "oe" => 600, "ecircumflex" => 600, 
+    "Adieresis" => 600, "copyright" => 600, "Egrave" => 600, 
+    "slash" => 600, "Edieresis" => 600, "otilde" => 600, 
+    "Idieresis" => 600, "parenleft" => 600, "one" => 600, 
+    "ucircumflex" => 600, "Odieresis" => 600, "bracketleft" => 600, 
+    "Ugrave" => 600, "quoteright" => 600, "Udieresis" => 600, 
+    "perthousand" => 600, "Ydieresis" => 600, "Eacute" => 600, 
+    "adieresis" => 600, "egrave" => 600, "edieresis" => 600, 
+    "idieresis" => 600, "Eth" => 600, "ae" => 600, "asterisk" => 600, 
+    "Uacute" => 600, "odieresis" => 600, "ugrave" => 600, 
+    "five" => 600, "nine" => 600, "udieresis" => 600, "Zcaron" => 600, 
+    "threequarters" => 600, "guillemotright" => 600, 
+    "ydieresis" => 600, "Ccedilla" => 600, "tilde" => 600, "at" => 600, 
+    "eacute" => 600, "Gcaron" => 600, "underscore" => 600, 
+    "zero" => 600, "multiply" => 600, "eth" => 600, "Scedilla" => 600, 
+    "Ograve" => 600, "uacute" => 600, "braceleft" => 600, 
+    "Thorn" => 600, "zcaron" => 600, "ccedilla" => 600, 
+    "gcaron" => 600, "Ocircumflex" => 600, "Oacute" => 600, 
+    "scedilla" => 600, "ogonek" => 600, "arrowdown" => 600, 
+    "ograve" => 600, "thorn" => 600, "degree" => 600, 
+    "registered" => 600, "percent" => 600, "Aring" => 600, 
+    "six" => 600, "paragraph" => 600, "two" => 600, "Igrave" => 600, 
+    "oacute" => 600, "ocircumflex" => 600, "asciicircum" => 600, 
+    "aring" => 600, "square" => 600, "grave" => 600, 
+    "bracketright" => 600, "ampersand" => 600, "Iacute" => 600, 
+    "igrave" => 600, "return" => 600, "plus" => 600, 
+    "quotesinglbase" => 600, "Yacute" => 600, "threesuperior" => 600, 
+    "acute" => 600, "notegraphic" => 600, "section" => 600, 
+    "arrowleft" => 600, "dieresis" => 600, "quotedblbase" => 600, 
+    "iacute" => 600, "up" => 600, "florin" => 600, "yacute" => 600, 
+    "fi" => 600, "fl" => 600, "Acircumflex" => 600, 
+    "Icircumflex" => 600, "guillemotleft" => 600, "germandbls" => 600, 
+    "seven" => 600, "prescription" => 600, "indent" => 600, 
+    "dectab" => 600, "ordmasculine" => 600, "dotlessi" => 600, 
+    "sterling" => 600, "IJ" => 600, "acircumflex" => 600, 
+    "overscore" => 600, "icircumflex" => 600, "braceright" => 600, 
+    "graybox" => 600, "quotedblright" => 600, "center" => 600, 
+    "stop" => 600, "cent" => 600, "currency" => 600, 
+    "logicalnot" => 600, "merge" => 600, "Idot" => 600, 
+    "Atilde" => 600, "breve" => 600, "bar" => 600, "fraction" => 600, 
+    "less" => 600, "down" => 600, "guilsinglleft" => 600, 
+    "exclam" => 600, "period" => 600, "format" => 600, 
+    "arrowright" => 600, "greater" => 600, "ij" => 600, 
+    "atilde" => 600, "brokenbar" => 600, "arrowboth" => 600, 
+    "quoteleft" => 600, "onesuperior" => 600, 
+  }
+);
+1;
diff --git a/doc/metrics/pcrr8a.ph b/doc/metrics/pcrr8a.ph
new file mode 100644 (file)
index 0000000..a8fbb14
--- /dev/null
@@ -0,0 +1,82 @@
+%PS_Courier = (
+  name => 'Courier',
+  widths => {
+    "Ntilde" => 600, "comma" => 600, "cedilla" => 600, 
+    "arrowup" => 600, "plusminus" => 600, "circumflex" => 600, 
+    "dotaccent" => 600, "LL" => 600, "asciitilde" => 600, 
+    "colon" => 600, "onehalf" => 600, "dollar" => 600, "ntilde" => 600, 
+    "left" => 600, "minus" => 600, "yen" => 600, "space" => 600, 
+    "questiondown" => 600, "emdash" => 600, "Agrave" => 600, 
+    "three" => 600, "numbersign" => 600, "A" => 600, "B" => 600, 
+    "C" => 600, "D" => 600, "E" => 600, "onequarter" => 600, 
+    "F" => 600, "G" => 600, "H" => 600, "I" => 600, "J" => 600, 
+    "K" => 600, "L" => 600, "backslash" => 600, 
+    "periodcentered" => 600, "M" => 600, "N" => 600, "O" => 600, 
+    "P" => 600, "Q" => 600, "R" => 600, "Aacute" => 600, 
+    "caron" => 600, "S" => 600, "T" => 600, "U" => 600, 
+    "agrave" => 600, "V" => 600, "tab" => 600, "W" => 600, "ll" => 600, 
+    "equal" => 600, "question" => 600, "X" => 600, "Y" => 600, 
+    "Z" => 600, "four" => 600, "a" => 600, "b" => 600, "c" => 600, 
+    "d" => 600, "e" => 600, "f" => 600, "g" => 600, "bullet" => 600, 
+    "h" => 600, "i" => 600, "Oslash" => 600, "dagger" => 600, 
+    "j" => 600, "k" => 600, "l" => 600, "m" => 600, "n" => 600, 
+    "o" => 600, "ordfeminine" => 600, "ring" => 600, "p" => 600, 
+    "q" => 600, "r" => 600, "aacute" => 600, "largebullet" => 600, 
+    "twosuperior" => 600, "s" => 600, "OE" => 600, "t" => 600, 
+    "divide" => 600, "u" => 600, "v" => 600, "w" => 600, "x" => 600, 
+    "y" => 600, "z" => 600, "hungarumlaut" => 600, "quotedbl" => 600, 
+    "mu" => 600, "Scaron" => 600, "Lslash" => 600, "semicolon" => 600, 
+    "oslash" => 600, "parenright" => 600, "Ecircumflex" => 600, 
+    "trademark" => 600, "daggerdbl" => 600, "macron" => 600, 
+    "Otilde" => 600, "ellipsis" => 600, "scaron" => 600, "AE" => 600, 
+    "Ucircumflex" => 600, "lslash" => 600, "lira" => 600, 
+    "quotedblleft" => 600, "hyphen" => 600, "guilsinglright" => 600, 
+    "quotesingle" => 600, "eight" => 600, "exclamdown" => 600, 
+    "endash" => 600, "oe" => 600, "ecircumflex" => 600, 
+    "Adieresis" => 600, "copyright" => 600, "Egrave" => 600, 
+    "slash" => 600, "Edieresis" => 600, "otilde" => 600, 
+    "Idieresis" => 600, "parenleft" => 600, "one" => 600, 
+    "ucircumflex" => 600, "Odieresis" => 600, "bracketleft" => 600, 
+    "Ugrave" => 600, "quoteright" => 600, "Udieresis" => 600, 
+    "perthousand" => 600, "Ydieresis" => 600, "Eacute" => 600, 
+    "adieresis" => 600, "egrave" => 600, "edieresis" => 600, 
+    "idieresis" => 600, "Eth" => 600, "ae" => 600, "asterisk" => 600, 
+    "Uacute" => 600, "odieresis" => 600, "ugrave" => 600, 
+    "five" => 600, "nine" => 600, "udieresis" => 600, "Zcaron" => 600, 
+    "threequarters" => 600, "guillemotright" => 600, 
+    "ydieresis" => 600, "Ccedilla" => 600, "tilde" => 600, "at" => 600, 
+    "eacute" => 600, "Gcaron" => 600, "underscore" => 600, 
+    "zero" => 600, "multiply" => 600, "eth" => 600, "Scedilla" => 600, 
+    "Ograve" => 600, "uacute" => 600, "braceleft" => 600, 
+    "Thorn" => 600, "zcaron" => 600, "ccedilla" => 600, 
+    "gcaron" => 600, "Ocircumflex" => 600, "Oacute" => 600, 
+    "scedilla" => 600, "ogonek" => 600, "arrowdown" => 600, 
+    "ograve" => 600, "thorn" => 600, "degree" => 600, 
+    "registered" => 600, "percent" => 600, "Aring" => 600, 
+    "six" => 600, "paragraph" => 600, "two" => 600, "Igrave" => 600, 
+    "oacute" => 600, "ocircumflex" => 600, "asciicircum" => 600, 
+    "aring" => 600, "square" => 600, "grave" => 600, 
+    "bracketright" => 600, "ampersand" => 600, "Iacute" => 600, 
+    "igrave" => 600, "return" => 600, "plus" => 600, 
+    "quotesinglbase" => 600, "Yacute" => 600, "threesuperior" => 600, 
+    "acute" => 600, "notegraphic" => 600, "section" => 600, 
+    "arrowleft" => 600, "dieresis" => 600, "quotedblbase" => 600, 
+    "iacute" => 600, "up" => 600, "florin" => 600, "yacute" => 600, 
+    "fi" => 600, "fl" => 600, "Acircumflex" => 600, 
+    "Icircumflex" => 600, "guillemotleft" => 600, "germandbls" => 600, 
+    "seven" => 600, "prescription" => 600, "indent" => 600, 
+    "dectab" => 600, "ordmasculine" => 600, "dotlessi" => 600, 
+    "sterling" => 600, "IJ" => 600, "acircumflex" => 600, 
+    "overscore" => 600, "icircumflex" => 600, "braceright" => 600, 
+    "graybox" => 600, "quotedblright" => 600, "center" => 600, 
+    "stop" => 600, "cent" => 600, "currency" => 600, 
+    "logicalnot" => 600, "merge" => 600, "Idot" => 600, 
+    "Atilde" => 600, "breve" => 600, "bar" => 600, "fraction" => 600, 
+    "less" => 600, "down" => 600, "guilsinglleft" => 600, 
+    "exclam" => 600, "period" => 600, "format" => 600, 
+    "arrowright" => 600, "greater" => 600, "ij" => 600, 
+    "atilde" => 600, "brokenbar" => 600, "arrowboth" => 600, 
+    "quoteleft" => 600, "onesuperior" => 600, 
+  }
+);
+1;
diff --git a/doc/metrics/pcrro8a.ph b/doc/metrics/pcrro8a.ph
new file mode 100644 (file)
index 0000000..59e5026
--- /dev/null
@@ -0,0 +1,82 @@
+%PS_Courier_Oblique = (
+  name => 'Courier-Oblique',
+  widths => {
+    "Ntilde" => 600, "comma" => 600, "cedilla" => 600, 
+    "arrowup" => 600, "plusminus" => 600, "circumflex" => 600, 
+    "dotaccent" => 600, "LL" => 600, "asciitilde" => 600, 
+    "colon" => 600, "onehalf" => 600, "dollar" => 600, "ntilde" => 600, 
+    "left" => 600, "minus" => 600, "yen" => 600, "space" => 600, 
+    "questiondown" => 600, "emdash" => 600, "Agrave" => 600, 
+    "three" => 600, "numbersign" => 600, "A" => 600, "B" => 600, 
+    "C" => 600, "D" => 600, "E" => 600, "onequarter" => 600, 
+    "F" => 600, "G" => 600, "H" => 600, "I" => 600, "J" => 600, 
+    "K" => 600, "L" => 600, "backslash" => 600, 
+    "periodcentered" => 600, "M" => 600, "N" => 600, "O" => 600, 
+    "P" => 600, "Q" => 600, "R" => 600, "Aacute" => 600, 
+    "caron" => 600, "S" => 600, "T" => 600, "U" => 600, 
+    "agrave" => 600, "V" => 600, "tab" => 600, "W" => 600, "ll" => 600, 
+    "equal" => 600, "question" => 600, "X" => 600, "Y" => 600, 
+    "Z" => 600, "four" => 600, "a" => 600, "b" => 600, "c" => 600, 
+    "d" => 600, "e" => 600, "f" => 600, "g" => 600, "bullet" => 600, 
+    "h" => 600, "i" => 600, "Oslash" => 600, "dagger" => 600, 
+    "j" => 600, "k" => 600, "l" => 600, "m" => 600, "n" => 600, 
+    "o" => 600, "ordfeminine" => 600, "ring" => 600, "p" => 600, 
+    "q" => 600, "r" => 600, "aacute" => 600, "largebullet" => 600, 
+    "twosuperior" => 600, "s" => 600, "OE" => 600, "t" => 600, 
+    "divide" => 600, "u" => 600, "v" => 600, "w" => 600, "x" => 600, 
+    "y" => 600, "z" => 600, "hungarumlaut" => 600, "quotedbl" => 600, 
+    "mu" => 600, "Scaron" => 600, "Lslash" => 600, "semicolon" => 600, 
+    "oslash" => 600, "parenright" => 600, "Ecircumflex" => 600, 
+    "trademark" => 600, "daggerdbl" => 600, "macron" => 600, 
+    "Otilde" => 600, "ellipsis" => 600, "scaron" => 600, "AE" => 600, 
+    "Ucircumflex" => 600, "lslash" => 600, "lira" => 600, 
+    "quotedblleft" => 600, "hyphen" => 600, "guilsinglright" => 600, 
+    "quotesingle" => 600, "eight" => 600, "exclamdown" => 600, 
+    "endash" => 600, "oe" => 600, "ecircumflex" => 600, 
+    "Adieresis" => 600, "copyright" => 600, "Egrave" => 600, 
+    "slash" => 600, "Edieresis" => 600, "otilde" => 600, 
+    "Idieresis" => 600, "parenleft" => 600, "one" => 600, 
+    "ucircumflex" => 600, "Odieresis" => 600, "bracketleft" => 600, 
+    "Ugrave" => 600, "quoteright" => 600, "Udieresis" => 600, 
+    "perthousand" => 600, "Ydieresis" => 600, "Eacute" => 600, 
+    "adieresis" => 600, "egrave" => 600, "edieresis" => 600, 
+    "idieresis" => 600, "Eth" => 600, "ae" => 600, "asterisk" => 600, 
+    "Uacute" => 600, "odieresis" => 600, "ugrave" => 600, 
+    "five" => 600, "nine" => 600, "udieresis" => 600, "Zcaron" => 600, 
+    "threequarters" => 600, "guillemotright" => 600, 
+    "ydieresis" => 600, "Ccedilla" => 600, "tilde" => 600, "at" => 600, 
+    "eacute" => 600, "Gcaron" => 600, "underscore" => 600, 
+    "zero" => 600, "multiply" => 600, "eth" => 600, "Scedilla" => 600, 
+    "Ograve" => 600, "uacute" => 600, "braceleft" => 600, 
+    "Thorn" => 600, "zcaron" => 600, "ccedilla" => 600, 
+    "gcaron" => 600, "Ocircumflex" => 600, "Oacute" => 600, 
+    "scedilla" => 600, "ogonek" => 600, "arrowdown" => 600, 
+    "ograve" => 600, "thorn" => 600, "degree" => 600, 
+    "registered" => 600, "percent" => 600, "Aring" => 600, 
+    "six" => 600, "paragraph" => 600, "two" => 600, "Igrave" => 600, 
+    "oacute" => 600, "ocircumflex" => 600, "asciicircum" => 600, 
+    "aring" => 600, "square" => 600, "grave" => 600, 
+    "bracketright" => 600, "ampersand" => 600, "Iacute" => 600, 
+    "igrave" => 600, "return" => 600, "plus" => 600, 
+    "quotesinglbase" => 600, "Yacute" => 600, "threesuperior" => 600, 
+    "acute" => 600, "notegraphic" => 600, "section" => 600, 
+    "arrowleft" => 600, "dieresis" => 600, "quotedblbase" => 600, 
+    "iacute" => 600, "up" => 600, "florin" => 600, "yacute" => 600, 
+    "fi" => 600, "fl" => 600, "Acircumflex" => 600, 
+    "Icircumflex" => 600, "guillemotleft" => 600, "germandbls" => 600, 
+    "seven" => 600, "prescription" => 600, "indent" => 600, 
+    "dectab" => 600, "ordmasculine" => 600, "dotlessi" => 600, 
+    "sterling" => 600, "IJ" => 600, "acircumflex" => 600, 
+    "overscore" => 600, "icircumflex" => 600, "braceright" => 600, 
+    "graybox" => 600, "quotedblright" => 600, "center" => 600, 
+    "stop" => 600, "cent" => 600, "currency" => 600, 
+    "logicalnot" => 600, "merge" => 600, "Idot" => 600, 
+    "Atilde" => 600, "breve" => 600, "bar" => 600, "fraction" => 600, 
+    "less" => 600, "down" => 600, "guilsinglleft" => 600, 
+    "exclam" => 600, "period" => 600, "format" => 600, 
+    "arrowright" => 600, "greater" => 600, "ij" => 600, 
+    "atilde" => 600, "brokenbar" => 600, "arrowboth" => 600, 
+    "quoteleft" => 600, "onesuperior" => 600, 
+  }
+);
+1;
diff --git a/doc/metrics/phvb8a.ph b/doc/metrics/phvb8a.ph
new file mode 100644 (file)
index 0000000..3c692f1
--- /dev/null
@@ -0,0 +1,72 @@
+%PS_Helvetica_Bold = (
+  name => 'Helvetica-Bold',
+  widths => {
+    "multiply" => 584, "Ntilde" => 722, "zero" => 556, "eth" => 611, 
+    "Ograve" => 778, "uacute" => 611, "braceleft" => 389, 
+    "Thorn" => 667, "zcaron" => 500, "comma" => 278, "cedilla" => 333, 
+    "plusminus" => 584, "ccedilla" => 556, "circumflex" => 333, 
+    "dotaccent" => 333, "asciitilde" => 584, "colon" => 333, 
+    "onehalf" => 834, "dollar" => 556, "ntilde" => 611, 
+    "Oacute" => 778, "Ocircumflex" => 778, "ogonek" => 333, 
+    "ograve" => 611, "thorn" => 611, "degree" => 400, "minus" => 584, 
+    "yen" => 556, "space" => 278, "registered" => 737, 
+    "questiondown" => 611, "Aring" => 722, "percent" => 889, 
+    "emdash" => 1000, "six" => 556, "Agrave" => 722, 
+    "paragraph" => 556, "three" => 556, "numbersign" => 556, 
+    "two" => 556, "Igrave" => 278, "oacute" => 611, 
+    "ocircumflex" => 611, "A" => 722, "B" => 722, "C" => 722, 
+    "D" => 722, "E" => 667, "onequarter" => 834, "F" => 611, 
+    "G" => 778, "H" => 722, "I" => 278, "J" => 556, "K" => 722, 
+    "L" => 611, "backslash" => 278, "asciicircum" => 584, 
+    "periodcentered" => 278, "M" => 833, "N" => 722, "O" => 778, 
+    "P" => 667, "aring" => 556, "Q" => 778, "R" => 722, 
+    "Aacute" => 722, "caron" => 333, "S" => 667, "T" => 611, 
+    "grave" => 333, "U" => 722, "agrave" => 556, "V" => 667, 
+    "W" => 944, "equal" => 584, "question" => 611, "X" => 667, 
+    "Y" => 667, "Z" => 611, "bracketright" => 333, "Iacute" => 278, 
+    "ampersand" => 722, "four" => 556, "igrave" => 278, "a" => 556, 
+    "b" => 611, "c" => 556, "d" => 611, "plus" => 584, "e" => 556, 
+    "quotesinglbase" => 278, "f" => 333, "g" => 611, "bullet" => 350, 
+    "h" => 611, "i" => 278, "Oslash" => 778, "dagger" => 556, 
+    "j" => 278, "Yacute" => 667, "k" => 556, "l" => 278, "m" => 889, 
+    "n" => 611, "o" => 611, "ordfeminine" => 370, "ring" => 333, 
+    "p" => 611, "threesuperior" => 333, "q" => 611, "acute" => 333, 
+    "r" => 389, "aacute" => 556, "twosuperior" => 333, "s" => 556, 
+    "OE" => 1000, "t" => 333, "divide" => 584, "section" => 556, 
+    "u" => 611, "v" => 556, "w" => 778, "dieresis" => 333, "x" => 556, 
+    "y" => 556, "z" => 500, "iacute" => 278, "quotedblbase" => 500, 
+    "hungarumlaut" => 333, "quotedbl" => 474, "mu" => 611, 
+    "Scaron" => 667, "Lslash" => 611, "semicolon" => 333, 
+    "oslash" => 611, "florin" => 556, "yacute" => 556, "fi" => 611, 
+    "fl" => 611, "Acircumflex" => 722, "parenright" => 333, 
+    "Ecircumflex" => 667, "Icircumflex" => 278, "trademark" => 1000, 
+    "daggerdbl" => 556, "guillemotleft" => 556, "germandbls" => 611, 
+    "macron" => 333, "Otilde" => 778, "seven" => 556, 
+    "ellipsis" => 1000, "scaron" => 556, "ordmasculine" => 365, 
+    "AE" => 1000, "Ucircumflex" => 722, "lslash" => 278, 
+    "dotlessi" => 278, "sterling" => 556, "quotedblleft" => 500, 
+    "hyphen" => 333, "guilsinglright" => 333, "quotesingle" => 238, 
+    "eight" => 556, "exclamdown" => 333, "acircumflex" => 556, 
+    "endash" => 556, "oe" => 944, "ecircumflex" => 556, 
+    "Adieresis" => 722, "copyright" => 737, "Egrave" => 667, 
+    "icircumflex" => 278, "slash" => 278, "braceright" => 389, 
+    "Edieresis" => 667, "quotedblright" => 500, "Idieresis" => 278, 
+    "otilde" => 611, "parenleft" => 333, "one" => 556, 
+    "Odieresis" => 778, "ucircumflex" => 611, "bracketleft" => 333, 
+    "Ugrave" => 722, "cent" => 556, "currency" => 556, 
+    "logicalnot" => 584, "quoteright" => 278, "Udieresis" => 722, 
+    "perthousand" => 1000, "Ydieresis" => 667, "Atilde" => 722, 
+    "breve" => 333, "bar" => 280, "fraction" => 167, "Eacute" => 667, 
+    "less" => 584, "adieresis" => 556, "guilsinglleft" => 333, 
+    "egrave" => 556, "exclam" => 333, "edieresis" => 556, 
+    "idieresis" => 278, "Eth" => 722, "period" => 278, "ae" => 889, 
+    "asterisk" => 389, "odieresis" => 611, "Uacute" => 722, 
+    "ugrave" => 611, "five" => 556, "nine" => 556, "greater" => 584, 
+    "udieresis" => 611, "Zcaron" => 611, "threequarters" => 834, 
+    "guillemotright" => 556, "Ccedilla" => 722, "ydieresis" => 556, 
+    "tilde" => 333, "atilde" => 556, "at" => 975, "brokenbar" => 280, 
+    "eacute" => 556, "quoteleft" => 278, "underscore" => 556, 
+    "onesuperior" => 333, 
+  }
+);
+1;
diff --git a/doc/metrics/phvb8an.ph b/doc/metrics/phvb8an.ph
new file mode 100644 (file)
index 0000000..cb2c96f
--- /dev/null
@@ -0,0 +1,71 @@
+%PS_Helvetica_Narrow_Bold = (
+  name => 'Helvetica-Narrow-Bold',
+  widths => {
+    "multiply" => 479, "Ntilde" => 592, "zero" => 456, "eth" => 501, 
+    "Ograve" => 638, "uacute" => 501, "braceleft" => 319, 
+    "Thorn" => 547, "zcaron" => 410, "comma" => 228, "cedilla" => 273, 
+    "plusminus" => 479, "ccedilla" => 456, "circumflex" => 273, 
+    "dotaccent" => 273, "asciitilde" => 479, "colon" => 273, 
+    "onehalf" => 684, "dollar" => 456, "ntilde" => 501, 
+    "Oacute" => 638, "Ocircumflex" => 638, "ogonek" => 273, 
+    "ograve" => 501, "thorn" => 501, "degree" => 328, "minus" => 479, 
+    "yen" => 456, "space" => 228, "registered" => 604, 
+    "questiondown" => 501, "Aring" => 592, "percent" => 729, 
+    "emdash" => 820, "six" => 456, "Agrave" => 592, "paragraph" => 456, 
+    "three" => 456, "numbersign" => 456, "two" => 456, "Igrave" => 228, 
+    "oacute" => 501, "ocircumflex" => 501, "A" => 592, "B" => 592, 
+    "C" => 592, "D" => 592, "E" => 547, "onequarter" => 684, 
+    "F" => 501, "G" => 638, "H" => 592, "I" => 228, "J" => 456, 
+    "K" => 592, "L" => 501, "backslash" => 228, "asciicircum" => 479, 
+    "periodcentered" => 228, "M" => 683, "N" => 592, "O" => 638, 
+    "P" => 547, "aring" => 456, "Q" => 638, "R" => 592, 
+    "Aacute" => 592, "caron" => 273, "S" => 547, "T" => 501, 
+    "grave" => 273, "U" => 592, "agrave" => 456, "V" => 547, 
+    "W" => 774, "equal" => 479, "question" => 501, "X" => 547, 
+    "Y" => 547, "Z" => 501, "bracketright" => 273, "Iacute" => 228, 
+    "ampersand" => 592, "four" => 456, "igrave" => 228, "a" => 456, 
+    "b" => 501, "c" => 456, "d" => 501, "plus" => 479, "e" => 456, 
+    "quotesinglbase" => 228, "f" => 273, "g" => 501, "bullet" => 287, 
+    "h" => 501, "i" => 228, "Oslash" => 638, "dagger" => 456, 
+    "j" => 228, "Yacute" => 547, "k" => 456, "l" => 228, "m" => 729, 
+    "n" => 501, "o" => 501, "ordfeminine" => 303, "ring" => 273, 
+    "p" => 501, "threesuperior" => 273, "q" => 501, "acute" => 273, 
+    "r" => 319, "aacute" => 456, "twosuperior" => 273, "s" => 456, 
+    "OE" => 820, "t" => 273, "divide" => 479, "section" => 456, 
+    "u" => 501, "v" => 456, "w" => 638, "dieresis" => 273, "x" => 456, 
+    "y" => 456, "z" => 410, "iacute" => 228, "quotedblbase" => 410, 
+    "hungarumlaut" => 273, "quotedbl" => 389, "mu" => 501, 
+    "Scaron" => 547, "Lslash" => 501, "semicolon" => 273, 
+    "oslash" => 501, "florin" => 456, "yacute" => 456, "fi" => 501, 
+    "fl" => 501, "Acircumflex" => 592, "parenright" => 273, 
+    "Ecircumflex" => 547, "Icircumflex" => 228, "trademark" => 820, 
+    "daggerdbl" => 456, "guillemotleft" => 456, "germandbls" => 501, 
+    "macron" => 273, "Otilde" => 638, "seven" => 456, 
+    "ellipsis" => 820, "scaron" => 456, "ordmasculine" => 299, 
+    "AE" => 820, "Ucircumflex" => 592, "lslash" => 228, 
+    "dotlessi" => 228, "sterling" => 456, "quotedblleft" => 410, 
+    "hyphen" => 273, "guilsinglright" => 273, "quotesingle" => 195, 
+    "eight" => 456, "exclamdown" => 273, "acircumflex" => 456, 
+    "endash" => 456, "oe" => 774, "ecircumflex" => 456, 
+    "Adieresis" => 592, "copyright" => 604, "Egrave" => 547, 
+    "icircumflex" => 228, "slash" => 228, "braceright" => 319, 
+    "Edieresis" => 547, "quotedblright" => 410, "Idieresis" => 228, 
+    "otilde" => 501, "parenleft" => 273, "one" => 456, 
+    "Odieresis" => 638, "ucircumflex" => 501, "bracketleft" => 273, 
+    "Ugrave" => 592, "cent" => 456, "currency" => 456, 
+    "logicalnot" => 479, "quoteright" => 228, "Udieresis" => 592, 
+    "perthousand" => 820, "Ydieresis" => 547, "Atilde" => 592, 
+    "breve" => 273, "bar" => 230, "fraction" => 137, "Eacute" => 547, 
+    "less" => 479, "adieresis" => 456, "guilsinglleft" => 273, 
+    "egrave" => 456, "exclam" => 273, "edieresis" => 456, 
+    "idieresis" => 228, "Eth" => 592, "period" => 228, "ae" => 729, 
+    "asterisk" => 319, "odieresis" => 501, "Uacute" => 592, 
+    "ugrave" => 501, "five" => 456, "nine" => 456, "greater" => 479, 
+    "udieresis" => 501, "Zcaron" => 501, "threequarters" => 684, 
+    "guillemotright" => 456, "Ccedilla" => 592, "ydieresis" => 456, 
+    "tilde" => 273, "atilde" => 456, "at" => 800, "brokenbar" => 230, 
+    "eacute" => 456, "quoteleft" => 228, "underscore" => 456, 
+    "onesuperior" => 273, 
+  }
+);
+1;
diff --git a/doc/metrics/phvbo8a.ph b/doc/metrics/phvbo8a.ph
new file mode 100644 (file)
index 0000000..644a0f9
--- /dev/null
@@ -0,0 +1,72 @@
+%PS_Helvetica_BoldOblique = (
+  name => 'Helvetica-BoldOblique',
+  widths => {
+    "multiply" => 584, "Ntilde" => 722, "zero" => 556, "eth" => 611, 
+    "Ograve" => 778, "uacute" => 611, "braceleft" => 389, 
+    "Thorn" => 667, "zcaron" => 500, "comma" => 278, "cedilla" => 333, 
+    "plusminus" => 584, "ccedilla" => 556, "circumflex" => 333, 
+    "dotaccent" => 333, "asciitilde" => 584, "colon" => 333, 
+    "onehalf" => 834, "dollar" => 556, "ntilde" => 611, 
+    "Oacute" => 778, "Ocircumflex" => 778, "ogonek" => 333, 
+    "ograve" => 611, "thorn" => 611, "degree" => 400, "minus" => 584, 
+    "yen" => 556, "space" => 278, "registered" => 737, 
+    "questiondown" => 611, "Aring" => 722, "percent" => 889, 
+    "emdash" => 1000, "six" => 556, "Agrave" => 722, 
+    "paragraph" => 556, "three" => 556, "numbersign" => 556, 
+    "two" => 556, "Igrave" => 278, "oacute" => 611, 
+    "ocircumflex" => 611, "A" => 722, "B" => 722, "C" => 722, 
+    "D" => 722, "E" => 667, "onequarter" => 834, "F" => 611, 
+    "G" => 778, "H" => 722, "I" => 278, "J" => 556, "K" => 722, 
+    "L" => 611, "backslash" => 278, "asciicircum" => 584, 
+    "periodcentered" => 278, "M" => 833, "N" => 722, "O" => 778, 
+    "P" => 667, "aring" => 556, "Q" => 778, "R" => 722, 
+    "Aacute" => 722, "caron" => 333, "S" => 667, "T" => 611, 
+    "grave" => 333, "U" => 722, "agrave" => 556, "V" => 667, 
+    "W" => 944, "equal" => 584, "question" => 611, "X" => 667, 
+    "Y" => 667, "Z" => 611, "bracketright" => 333, "Iacute" => 278, 
+    "ampersand" => 722, "four" => 556, "igrave" => 278, "a" => 556, 
+    "b" => 611, "c" => 556, "d" => 611, "plus" => 584, "e" => 556, 
+    "quotesinglbase" => 278, "f" => 333, "g" => 611, "bullet" => 350, 
+    "h" => 611, "i" => 278, "Oslash" => 778, "dagger" => 556, 
+    "j" => 278, "Yacute" => 667, "k" => 556, "l" => 278, "m" => 889, 
+    "n" => 611, "o" => 611, "ordfeminine" => 370, "ring" => 333, 
+    "p" => 611, "threesuperior" => 333, "q" => 611, "acute" => 333, 
+    "r" => 389, "aacute" => 556, "twosuperior" => 333, "s" => 556, 
+    "OE" => 1000, "t" => 333, "divide" => 584, "section" => 556, 
+    "u" => 611, "v" => 556, "w" => 778, "dieresis" => 333, "x" => 556, 
+    "y" => 556, "z" => 500, "iacute" => 278, "quotedblbase" => 500, 
+    "hungarumlaut" => 333, "quotedbl" => 474, "mu" => 611, 
+    "Scaron" => 667, "Lslash" => 611, "semicolon" => 333, 
+    "oslash" => 611, "florin" => 556, "yacute" => 556, "fi" => 611, 
+    "fl" => 611, "Acircumflex" => 722, "parenright" => 333, 
+    "Ecircumflex" => 667, "Icircumflex" => 278, "trademark" => 1000, 
+    "daggerdbl" => 556, "guillemotleft" => 556, "germandbls" => 611, 
+    "macron" => 333, "Otilde" => 778, "seven" => 556, 
+    "ellipsis" => 1000, "scaron" => 556, "ordmasculine" => 365, 
+    "AE" => 1000, "Ucircumflex" => 722, "lslash" => 278, 
+    "dotlessi" => 278, "sterling" => 556, "quotedblleft" => 500, 
+    "hyphen" => 333, "guilsinglright" => 333, "quotesingle" => 238, 
+    "eight" => 556, "exclamdown" => 333, "acircumflex" => 556, 
+    "endash" => 556, "oe" => 944, "ecircumflex" => 556, 
+    "Adieresis" => 722, "copyright" => 737, "Egrave" => 667, 
+    "icircumflex" => 278, "slash" => 278, "braceright" => 389, 
+    "Edieresis" => 667, "quotedblright" => 500, "Idieresis" => 278, 
+    "otilde" => 611, "parenleft" => 333, "one" => 556, 
+    "Odieresis" => 778, "ucircumflex" => 611, "bracketleft" => 333, 
+    "Ugrave" => 722, "cent" => 556, "currency" => 556, 
+    "logicalnot" => 584, "quoteright" => 278, "Udieresis" => 722, 
+    "perthousand" => 1000, "Ydieresis" => 667, "Atilde" => 722, 
+    "breve" => 333, "bar" => 280, "fraction" => 167, "Eacute" => 667, 
+    "less" => 584, "adieresis" => 556, "guilsinglleft" => 333, 
+    "egrave" => 556, "exclam" => 333, "edieresis" => 556, 
+    "idieresis" => 278, "Eth" => 722, "period" => 278, "ae" => 889, 
+    "asterisk" => 389, "odieresis" => 611, "Uacute" => 722, 
+    "ugrave" => 611, "five" => 556, "nine" => 556, "greater" => 584, 
+    "udieresis" => 611, "Zcaron" => 611, "threequarters" => 834, 
+    "guillemotright" => 556, "Ccedilla" => 722, "ydieresis" => 556, 
+    "tilde" => 333, "atilde" => 556, "at" => 975, "brokenbar" => 280, 
+    "eacute" => 556, "quoteleft" => 278, "underscore" => 556, 
+    "onesuperior" => 333, 
+  }
+);
+1;
diff --git a/doc/metrics/phvbo8an.ph b/doc/metrics/phvbo8an.ph
new file mode 100644 (file)
index 0000000..6e8b448
--- /dev/null
@@ -0,0 +1,71 @@
+%PS_Helvetica_Narrow_BoldOblique = (
+  name => 'Helvetica-Narrow-BoldOblique',
+  widths => {
+    "multiply" => 479, "Ntilde" => 592, "zero" => 456, "eth" => 501, 
+    "Ograve" => 638, "uacute" => 501, "braceleft" => 319, 
+    "Thorn" => 547, "zcaron" => 410, "comma" => 228, "cedilla" => 273, 
+    "plusminus" => 479, "ccedilla" => 456, "circumflex" => 273, 
+    "dotaccent" => 273, "asciitilde" => 479, "colon" => 273, 
+    "onehalf" => 684, "dollar" => 456, "ntilde" => 501, 
+    "Oacute" => 638, "Ocircumflex" => 638, "ogonek" => 273, 
+    "ograve" => 501, "thorn" => 501, "degree" => 328, "minus" => 479, 
+    "yen" => 456, "space" => 228, "registered" => 604, 
+    "questiondown" => 501, "Aring" => 592, "percent" => 729, 
+    "emdash" => 820, "six" => 456, "Agrave" => 592, "paragraph" => 456, 
+    "three" => 456, "numbersign" => 456, "two" => 456, "Igrave" => 228, 
+    "oacute" => 501, "ocircumflex" => 501, "A" => 592, "B" => 592, 
+    "C" => 592, "D" => 592, "E" => 547, "onequarter" => 684, 
+    "F" => 501, "G" => 638, "H" => 592, "I" => 228, "J" => 456, 
+    "K" => 592, "L" => 501, "backslash" => 228, "asciicircum" => 479, 
+    "periodcentered" => 228, "M" => 683, "N" => 592, "O" => 638, 
+    "P" => 547, "aring" => 456, "Q" => 638, "R" => 592, 
+    "Aacute" => 592, "caron" => 273, "S" => 547, "T" => 501, 
+    "grave" => 273, "U" => 592, "agrave" => 456, "V" => 547, 
+    "W" => 774, "equal" => 479, "question" => 501, "X" => 547, 
+    "Y" => 547, "Z" => 501, "bracketright" => 273, "Iacute" => 228, 
+    "ampersand" => 592, "four" => 456, "igrave" => 228, "a" => 456, 
+    "b" => 501, "c" => 456, "d" => 501, "plus" => 479, "e" => 456, 
+    "quotesinglbase" => 228, "f" => 273, "g" => 501, "bullet" => 287, 
+    "h" => 501, "i" => 228, "Oslash" => 638, "dagger" => 456, 
+    "j" => 228, "Yacute" => 547, "k" => 456, "l" => 228, "m" => 729, 
+    "n" => 501, "o" => 501, "ordfeminine" => 303, "ring" => 273, 
+    "p" => 501, "threesuperior" => 273, "q" => 501, "acute" => 273, 
+    "r" => 319, "aacute" => 456, "twosuperior" => 273, "s" => 456, 
+    "OE" => 820, "t" => 273, "divide" => 479, "section" => 456, 
+    "u" => 501, "v" => 456, "w" => 638, "dieresis" => 273, "x" => 456, 
+    "y" => 456, "z" => 410, "iacute" => 228, "quotedblbase" => 410, 
+    "hungarumlaut" => 273, "quotedbl" => 389, "mu" => 501, 
+    "Scaron" => 547, "Lslash" => 501, "semicolon" => 273, 
+    "oslash" => 501, "florin" => 456, "yacute" => 456, "fi" => 501, 
+    "fl" => 501, "Acircumflex" => 592, "parenright" => 273, 
+    "Ecircumflex" => 547, "Icircumflex" => 228, "trademark" => 820, 
+    "daggerdbl" => 456, "guillemotleft" => 456, "germandbls" => 501, 
+    "macron" => 273, "Otilde" => 638, "seven" => 456, 
+    "ellipsis" => 820, "scaron" => 456, "ordmasculine" => 299, 
+    "AE" => 820, "Ucircumflex" => 592, "lslash" => 228, 
+    "dotlessi" => 228, "sterling" => 456, "quotedblleft" => 410, 
+    "hyphen" => 273, "guilsinglright" => 273, "quotesingle" => 195, 
+    "eight" => 456, "exclamdown" => 273, "acircumflex" => 456, 
+    "endash" => 456, "oe" => 774, "ecircumflex" => 456, 
+    "Adieresis" => 592, "copyright" => 604, "Egrave" => 547, 
+    "icircumflex" => 228, "slash" => 228, "braceright" => 319, 
+    "Edieresis" => 547, "quotedblright" => 410, "Idieresis" => 228, 
+    "otilde" => 501, "parenleft" => 273, "one" => 456, 
+    "Odieresis" => 638, "ucircumflex" => 501, "bracketleft" => 273, 
+    "Ugrave" => 592, "cent" => 456, "currency" => 456, 
+    "logicalnot" => 479, "quoteright" => 228, "Udieresis" => 592, 
+    "perthousand" => 820, "Ydieresis" => 547, "Atilde" => 592, 
+    "breve" => 273, "bar" => 230, "fraction" => 137, "Eacute" => 547, 
+    "less" => 479, "adieresis" => 456, "guilsinglleft" => 273, 
+    "egrave" => 456, "exclam" => 273, "edieresis" => 456, 
+    "idieresis" => 228, "Eth" => 592, "period" => 228, "ae" => 729, 
+    "asterisk" => 319, "odieresis" => 501, "Uacute" => 592, 
+    "ugrave" => 501, "five" => 456, "nine" => 456, "greater" => 479, 
+    "udieresis" => 501, "Zcaron" => 501, "threequarters" => 684, 
+    "guillemotright" => 456, "Ccedilla" => 592, "ydieresis" => 456, 
+    "tilde" => 273, "atilde" => 456, "at" => 800, "brokenbar" => 230, 
+    "eacute" => 456, "quoteleft" => 228, "underscore" => 456, 
+    "onesuperior" => 273, 
+  }
+);
+1;
diff --git a/doc/metrics/phvl8a.ph b/doc/metrics/phvl8a.ph
new file mode 100644 (file)
index 0000000..bcd1a18
--- /dev/null
@@ -0,0 +1,72 @@
+%PS_Helvetica_Light = (
+  name => 'Helvetica-Light',
+  widths => {
+    "multiply" => 660, "Ntilde" => 722, "zero" => 556, "eth" => 556, 
+    "Ograve" => 778, "uacute" => 556, "braceleft" => 333, 
+    "Thorn" => 611, "zcaron" => 500, "comma" => 278, "cedilla" => 333, 
+    "plusminus" => 660, "ccedilla" => 556, "circumflex" => 333, 
+    "dotaccent" => 333, "asciitilde" => 660, "colon" => 278, 
+    "onehalf" => 834, "dollar" => 556, "ntilde" => 556, 
+    "Ocircumflex" => 778, "Oacute" => 778, "ogonek" => 333, 
+    "ograve" => 556, "thorn" => 611, "minus" => 660, "degree" => 400, 
+    "yen" => 556, "space" => 278, "registered" => 800, 
+    "questiondown" => 500, "Aring" => 667, "percent" => 889, 
+    "emdash" => 1000, "six" => 556, "Agrave" => 667, 
+    "paragraph" => 650, "three" => 556, "numbersign" => 556, 
+    "two" => 556, "Igrave" => 278, "ocircumflex" => 556, 
+    "oacute" => 556, "A" => 667, "B" => 667, "C" => 722, "D" => 722, 
+    "E" => 611, "onequarter" => 834, "F" => 556, "G" => 778, 
+    "H" => 722, "I" => 278, "J" => 500, "K" => 667, "L" => 556, 
+    "backslash" => 278, "asciicircum" => 660, "periodcentered" => 278, 
+    "M" => 833, "N" => 722, "O" => 778, "P" => 611, "aring" => 556, 
+    "Q" => 778, "R" => 667, "Aacute" => 667, "caron" => 333, 
+    "S" => 611, "T" => 556, "grave" => 333, "U" => 722, 
+    "agrave" => 556, "V" => 611, "W" => 889, "equal" => 660, 
+    "question" => 500, "X" => 611, "Y" => 611, "Z" => 611, 
+    "bracketright" => 333, "Iacute" => 278, "ampersand" => 667, 
+    "four" => 556, "igrave" => 222, "a" => 556, "b" => 611, "c" => 556, 
+    "d" => 611, "plus" => 660, "e" => 556, "quotesinglbase" => 222, 
+    "f" => 278, "g" => 611, "bullet" => 500, "h" => 556, "i" => 222, 
+    "Oslash" => 778, "dagger" => 556, "j" => 222, "Yacute" => 611, 
+    "k" => 500, "l" => 222, "m" => 833, "n" => 556, "o" => 556, 
+    "ordfeminine" => 334, "ring" => 333, "p" => 611, 
+    "threesuperior" => 333, "q" => 611, "acute" => 333, "r" => 333, 
+    "twosuperior" => 333, "aacute" => 556, "s" => 500, "OE" => 1000, 
+    "t" => 278, "divide" => 660, "section" => 556, "u" => 556, 
+    "v" => 500, "w" => 722, "dieresis" => 333, "x" => 500, "y" => 500, 
+    "z" => 500, "iacute" => 222, "quotedblbase" => 389, 
+    "hungarumlaut" => 333, "quotedbl" => 278, "mu" => 556, 
+    "Scaron" => 611, "Lslash" => 556, "semicolon" => 278, 
+    "oslash" => 556, "florin" => 556, "yacute" => 500, "fi" => 500, 
+    "fl" => 500, "Acircumflex" => 667, "parenright" => 333, 
+    "Ecircumflex" => 611, "trademark" => 940, "Icircumflex" => 278, 
+    "daggerdbl" => 556, "guillemotleft" => 556, "germandbls" => 500, 
+    "macron" => 333, "Otilde" => 778, "seven" => 556, 
+    "ellipsis" => 1000, "scaron" => 500, "ordmasculine" => 334, 
+    "AE" => 1000, "Ucircumflex" => 722, "lslash" => 222, 
+    "dotlessi" => 222, "sterling" => 556, "quotedblleft" => 389, 
+    "hyphen" => 333, "guilsinglright" => 389, "quotesingle" => 222, 
+    "eight" => 556, "exclamdown" => 333, "acircumflex" => 556, 
+    "endash" => 500, "oe" => 944, "ecircumflex" => 556, 
+    "copyright" => 800, "Adieresis" => 667, "Egrave" => 611, 
+    "icircumflex" => 222, "slash" => 278, "braceright" => 333, 
+    "Edieresis" => 611, "quotedblright" => 389, "otilde" => 556, 
+    "Idieresis" => 278, "parenleft" => 333, "one" => 556, 
+    "ucircumflex" => 556, "Odieresis" => 778, "bracketleft" => 333, 
+    "Ugrave" => 722, "cent" => 556, "currency" => 556, 
+    "logicalnot" => 660, "quoteright" => 222, "Udieresis" => 722, 
+    "perthousand" => 1000, "Ydieresis" => 611, "Atilde" => 667, 
+    "breve" => 333, "bar" => 222, "fraction" => 167, "Eacute" => 611, 
+    "less" => 660, "adieresis" => 556, "guilsinglleft" => 389, 
+    "egrave" => 556, "exclam" => 333, "edieresis" => 556, 
+    "idieresis" => 222, "Eth" => 722, "period" => 278, "ae" => 889, 
+    "asterisk" => 389, "odieresis" => 556, "Uacute" => 722, 
+    "ugrave" => 556, "five" => 556, "nine" => 556, "greater" => 660, 
+    "udieresis" => 556, "Zcaron" => 611, "threequarters" => 834, 
+    "guillemotright" => 556, "ydieresis" => 500, "Ccedilla" => 722, 
+    "tilde" => 333, "atilde" => 556, "at" => 800, "brokenbar" => 222, 
+    "eacute" => 556, "quoteleft" => 222, "underscore" => 500, 
+    "onesuperior" => 333, 
+  }
+);
+1;
diff --git a/doc/metrics/phvlo8a.ph b/doc/metrics/phvlo8a.ph
new file mode 100644 (file)
index 0000000..af45efd
--- /dev/null
@@ -0,0 +1,72 @@
+%PS_Helvetica_LightOblique = (
+  name => 'Helvetica-LightOblique',
+  widths => {
+    "multiply" => 660, "Ntilde" => 722, "zero" => 556, "eth" => 556, 
+    "Ograve" => 778, "uacute" => 556, "braceleft" => 333, 
+    "Thorn" => 611, "zcaron" => 500, "comma" => 278, "cedilla" => 333, 
+    "plusminus" => 660, "ccedilla" => 556, "circumflex" => 333, 
+    "dotaccent" => 333, "asciitilde" => 660, "colon" => 278, 
+    "onehalf" => 834, "dollar" => 556, "ntilde" => 556, 
+    "Ocircumflex" => 778, "Oacute" => 778, "ogonek" => 333, 
+    "ograve" => 556, "thorn" => 611, "minus" => 660, "degree" => 400, 
+    "yen" => 556, "space" => 278, "registered" => 800, 
+    "questiondown" => 500, "Aring" => 667, "percent" => 889, 
+    "emdash" => 1000, "six" => 556, "Agrave" => 667, 
+    "paragraph" => 650, "three" => 556, "numbersign" => 556, 
+    "two" => 556, "Igrave" => 278, "ocircumflex" => 556, 
+    "oacute" => 556, "A" => 667, "B" => 667, "C" => 722, "D" => 722, 
+    "E" => 611, "onequarter" => 834, "F" => 556, "G" => 778, 
+    "H" => 722, "I" => 278, "J" => 500, "K" => 667, "L" => 556, 
+    "backslash" => 278, "asciicircum" => 660, "periodcentered" => 278, 
+    "M" => 833, "N" => 722, "O" => 778, "P" => 611, "aring" => 556, 
+    "Q" => 778, "R" => 667, "Aacute" => 667, "caron" => 333, 
+    "S" => 611, "T" => 556, "grave" => 333, "U" => 722, 
+    "agrave" => 556, "V" => 611, "W" => 889, "equal" => 660, 
+    "question" => 500, "X" => 611, "Y" => 611, "Z" => 611, 
+    "bracketright" => 333, "Iacute" => 278, "ampersand" => 667, 
+    "four" => 556, "igrave" => 222, "a" => 556, "b" => 611, "c" => 556, 
+    "d" => 611, "plus" => 660, "e" => 556, "quotesinglbase" => 222, 
+    "f" => 278, "g" => 611, "bullet" => 500, "h" => 556, "i" => 222, 
+    "Oslash" => 778, "dagger" => 556, "j" => 222, "Yacute" => 611, 
+    "k" => 500, "l" => 222, "m" => 833, "n" => 556, "o" => 556, 
+    "ordfeminine" => 334, "ring" => 333, "p" => 611, 
+    "threesuperior" => 333, "q" => 611, "acute" => 333, "r" => 333, 
+    "twosuperior" => 333, "aacute" => 556, "s" => 500, "OE" => 1000, 
+    "t" => 278, "divide" => 660, "section" => 556, "u" => 556, 
+    "v" => 500, "w" => 722, "dieresis" => 333, "x" => 500, "y" => 500, 
+    "z" => 500, "iacute" => 222, "quotedblbase" => 389, 
+    "hungarumlaut" => 333, "quotedbl" => 278, "mu" => 556, 
+    "Scaron" => 611, "Lslash" => 556, "semicolon" => 278, 
+    "oslash" => 556, "florin" => 556, "yacute" => 500, "fi" => 500, 
+    "fl" => 500, "Acircumflex" => 667, "parenright" => 333, 
+    "Ecircumflex" => 611, "trademark" => 940, "Icircumflex" => 278, 
+    "daggerdbl" => 556, "guillemotleft" => 556, "germandbls" => 500, 
+    "macron" => 333, "Otilde" => 778, "seven" => 556, 
+    "ellipsis" => 1000, "scaron" => 500, "ordmasculine" => 334, 
+    "AE" => 1000, "Ucircumflex" => 722, "lslash" => 222, 
+    "dotlessi" => 222, "sterling" => 556, "quotedblleft" => 389, 
+    "hyphen" => 333, "guilsinglright" => 389, "quotesingle" => 222, 
+    "eight" => 556, "exclamdown" => 333, "acircumflex" => 556, 
+    "endash" => 500, "oe" => 944, "ecircumflex" => 556, 
+    "copyright" => 800, "Adieresis" => 667, "Egrave" => 611, 
+    "icircumflex" => 222, "slash" => 278, "braceright" => 333, 
+    "Edieresis" => 611, "quotedblright" => 389, "otilde" => 556, 
+    "Idieresis" => 278, "parenleft" => 333, "one" => 556, 
+    "ucircumflex" => 556, "Odieresis" => 778, "bracketleft" => 333, 
+    "Ugrave" => 722, "cent" => 556, "currency" => 556, 
+    "logicalnot" => 660, "quoteright" => 222, "Udieresis" => 722, 
+    "perthousand" => 1000, "Ydieresis" => 611, "Atilde" => 667, 
+    "breve" => 333, "bar" => 222, "fraction" => 167, "Eacute" => 611, 
+    "less" => 660, "adieresis" => 556, "guilsinglleft" => 389, 
+    "egrave" => 556, "exclam" => 333, "edieresis" => 556, 
+    "idieresis" => 222, "Eth" => 722, "period" => 278, "ae" => 889, 
+    "asterisk" => 389, "odieresis" => 556, "Uacute" => 722, 
+    "ugrave" => 556, "five" => 556, "nine" => 556, "greater" => 660, 
+    "udieresis" => 556, "Zcaron" => 611, "threequarters" => 834, 
+    "guillemotright" => 556, "ydieresis" => 500, "Ccedilla" => 722, 
+    "tilde" => 333, "atilde" => 556, "at" => 800, "brokenbar" => 222, 
+    "eacute" => 556, "quoteleft" => 222, "underscore" => 500, 
+    "onesuperior" => 333, 
+  }
+);
+1;
diff --git a/doc/metrics/phvr8a.ph b/doc/metrics/phvr8a.ph
new file mode 100644 (file)
index 0000000..70dad5b
--- /dev/null
@@ -0,0 +1,72 @@
+%PS_Helvetica = (
+  name => 'Helvetica',
+  widths => {
+    "multiply" => 584, "Ntilde" => 722, "zero" => 556, "eth" => 556, 
+    "Ograve" => 778, "uacute" => 556, "braceleft" => 334, 
+    "Thorn" => 667, "zcaron" => 500, "comma" => 278, "cedilla" => 333, 
+    "plusminus" => 584, "ccedilla" => 500, "circumflex" => 333, 
+    "dotaccent" => 333, "asciitilde" => 584, "colon" => 278, 
+    "onehalf" => 834, "dollar" => 556, "ntilde" => 556, 
+    "Oacute" => 778, "Ocircumflex" => 778, "ogonek" => 333, 
+    "ograve" => 556, "thorn" => 556, "degree" => 400, "minus" => 584, 
+    "yen" => 556, "space" => 278, "registered" => 737, 
+    "questiondown" => 611, "Aring" => 667, "percent" => 889, 
+    "emdash" => 1000, "six" => 556, "Agrave" => 667, 
+    "paragraph" => 537, "three" => 556, "numbersign" => 556, 
+    "two" => 556, "Igrave" => 278, "oacute" => 556, 
+    "ocircumflex" => 556, "A" => 667, "B" => 667, "C" => 722, 
+    "D" => 722, "E" => 667, "onequarter" => 834, "F" => 611, 
+    "G" => 778, "H" => 722, "I" => 278, "J" => 500, "K" => 667, 
+    "L" => 556, "backslash" => 278, "asciicircum" => 469, 
+    "periodcentered" => 278, "M" => 833, "N" => 722, "O" => 778, 
+    "P" => 667, "aring" => 556, "Q" => 778, "R" => 722, 
+    "Aacute" => 667, "caron" => 333, "S" => 667, "T" => 611, 
+    "grave" => 333, "U" => 722, "agrave" => 556, "V" => 667, 
+    "W" => 944, "equal" => 584, "question" => 556, "X" => 667, 
+    "Y" => 667, "Z" => 611, "bracketright" => 278, "Iacute" => 278, 
+    "ampersand" => 667, "four" => 556, "igrave" => 278, "a" => 556, 
+    "b" => 556, "c" => 500, "d" => 556, "plus" => 584, "e" => 556, 
+    "quotesinglbase" => 222, "f" => 278, "g" => 556, "bullet" => 350, 
+    "h" => 556, "i" => 222, "Oslash" => 778, "dagger" => 556, 
+    "j" => 222, "Yacute" => 667, "k" => 500, "l" => 222, "m" => 833, 
+    "n" => 556, "o" => 556, "ordfeminine" => 370, "ring" => 333, 
+    "p" => 556, "threesuperior" => 333, "q" => 556, "acute" => 333, 
+    "r" => 333, "aacute" => 556, "twosuperior" => 333, "s" => 500, 
+    "OE" => 1000, "t" => 278, "divide" => 584, "section" => 556, 
+    "u" => 556, "v" => 500, "w" => 722, "dieresis" => 333, "x" => 500, 
+    "y" => 500, "z" => 500, "iacute" => 278, "quotedblbase" => 333, 
+    "hungarumlaut" => 333, "quotedbl" => 355, "mu" => 556, 
+    "Scaron" => 667, "Lslash" => 556, "semicolon" => 278, 
+    "oslash" => 611, "florin" => 556, "yacute" => 500, "fi" => 500, 
+    "fl" => 500, "Acircumflex" => 667, "parenright" => 333, 
+    "Ecircumflex" => 667, "Icircumflex" => 278, "trademark" => 1000, 
+    "daggerdbl" => 556, "guillemotleft" => 556, "germandbls" => 611, 
+    "macron" => 333, "Otilde" => 778, "seven" => 556, 
+    "ellipsis" => 1000, "scaron" => 500, "ordmasculine" => 365, 
+    "AE" => 1000, "Ucircumflex" => 722, "lslash" => 222, 
+    "dotlessi" => 278, "sterling" => 556, "quotedblleft" => 333, 
+    "hyphen" => 333, "guilsinglright" => 333, "quotesingle" => 191, 
+    "eight" => 556, "exclamdown" => 333, "acircumflex" => 556, 
+    "endash" => 556, "oe" => 944, "ecircumflex" => 556, 
+    "Adieresis" => 667, "copyright" => 737, "Egrave" => 667, 
+    "icircumflex" => 278, "slash" => 278, "braceright" => 334, 
+    "Edieresis" => 667, "quotedblright" => 333, "Idieresis" => 278, 
+    "otilde" => 556, "parenleft" => 333, "one" => 556, 
+    "Odieresis" => 778, "ucircumflex" => 556, "bracketleft" => 278, 
+    "Ugrave" => 722, "cent" => 556, "currency" => 556, 
+    "logicalnot" => 584, "quoteright" => 222, "Udieresis" => 722, 
+    "perthousand" => 1000, "Ydieresis" => 667, "Atilde" => 667, 
+    "breve" => 333, "bar" => 260, "fraction" => 167, "Eacute" => 667, 
+    "less" => 584, "adieresis" => 556, "guilsinglleft" => 333, 
+    "egrave" => 556, "exclam" => 278, "edieresis" => 556, 
+    "idieresis" => 278, "Eth" => 722, "period" => 278, "ae" => 889, 
+    "asterisk" => 389, "odieresis" => 556, "Uacute" => 722, 
+    "ugrave" => 556, "five" => 556, "nine" => 556, "greater" => 584, 
+    "udieresis" => 556, "Zcaron" => 611, "threequarters" => 834, 
+    "guillemotright" => 556, "Ccedilla" => 722, "ydieresis" => 500, 
+    "tilde" => 333, "atilde" => 556, "at" => 1015, "brokenbar" => 260, 
+    "eacute" => 556, "quoteleft" => 222, "underscore" => 556, 
+    "onesuperior" => 333, 
+  }
+);
+1;
diff --git a/doc/metrics/phvr8an.ph b/doc/metrics/phvr8an.ph
new file mode 100644 (file)
index 0000000..7112c03
--- /dev/null
@@ -0,0 +1,71 @@
+%PS_Helvetica_Narrow = (
+  name => 'Helvetica-Narrow',
+  widths => {
+    "multiply" => 479, "Ntilde" => 592, "zero" => 456, "eth" => 456, 
+    "Ograve" => 638, "uacute" => 456, "braceleft" => 274, 
+    "Thorn" => 547, "zcaron" => 410, "comma" => 228, "cedilla" => 273, 
+    "plusminus" => 479, "ccedilla" => 410, "circumflex" => 273, 
+    "dotaccent" => 273, "asciitilde" => 479, "colon" => 228, 
+    "onehalf" => 684, "dollar" => 456, "ntilde" => 456, 
+    "Oacute" => 638, "Ocircumflex" => 638, "ogonek" => 273, 
+    "ograve" => 456, "thorn" => 456, "degree" => 328, "minus" => 479, 
+    "yen" => 456, "space" => 228, "registered" => 604, 
+    "questiondown" => 501, "Aring" => 547, "percent" => 729, 
+    "emdash" => 820, "six" => 456, "Agrave" => 547, "paragraph" => 440, 
+    "three" => 456, "numbersign" => 456, "two" => 456, "Igrave" => 228, 
+    "oacute" => 456, "ocircumflex" => 456, "A" => 547, "B" => 547, 
+    "C" => 592, "D" => 592, "E" => 547, "onequarter" => 684, 
+    "F" => 501, "G" => 638, "H" => 592, "I" => 228, "J" => 410, 
+    "K" => 547, "L" => 456, "backslash" => 228, "asciicircum" => 385, 
+    "periodcentered" => 228, "M" => 683, "N" => 592, "O" => 638, 
+    "P" => 547, "aring" => 456, "Q" => 638, "R" => 592, 
+    "Aacute" => 547, "caron" => 273, "S" => 547, "T" => 501, 
+    "grave" => 273, "U" => 592, "agrave" => 456, "V" => 547, 
+    "W" => 774, "equal" => 479, "question" => 456, "X" => 547, 
+    "Y" => 547, "Z" => 501, "bracketright" => 228, "Iacute" => 228, 
+    "ampersand" => 547, "four" => 456, "igrave" => 228, "a" => 456, 
+    "b" => 456, "c" => 410, "d" => 456, "plus" => 479, "e" => 456, 
+    "quotesinglbase" => 182, "f" => 228, "g" => 456, "bullet" => 287, 
+    "h" => 456, "i" => 182, "Oslash" => 638, "dagger" => 456, 
+    "j" => 182, "Yacute" => 547, "k" => 410, "l" => 182, "m" => 683, 
+    "n" => 456, "o" => 456, "ordfeminine" => 303, "ring" => 273, 
+    "p" => 456, "threesuperior" => 273, "q" => 456, "acute" => 273, 
+    "r" => 273, "aacute" => 456, "twosuperior" => 273, "s" => 410, 
+    "OE" => 820, "t" => 228, "divide" => 479, "section" => 456, 
+    "u" => 456, "v" => 410, "w" => 592, "dieresis" => 273, "x" => 410, 
+    "y" => 410, "z" => 410, "iacute" => 228, "quotedblbase" => 273, 
+    "hungarumlaut" => 273, "quotedbl" => 291, "mu" => 456, 
+    "Scaron" => 547, "Lslash" => 456, "semicolon" => 228, 
+    "oslash" => 501, "florin" => 456, "yacute" => 410, "fi" => 410, 
+    "fl" => 410, "Acircumflex" => 547, "parenright" => 273, 
+    "Ecircumflex" => 547, "Icircumflex" => 228, "trademark" => 820, 
+    "daggerdbl" => 456, "guillemotleft" => 456, "germandbls" => 501, 
+    "macron" => 273, "Otilde" => 638, "seven" => 456, 
+    "ellipsis" => 820, "scaron" => 410, "ordmasculine" => 299, 
+    "AE" => 820, "Ucircumflex" => 592, "lslash" => 182, 
+    "dotlessi" => 228, "sterling" => 456, "quotedblleft" => 273, 
+    "hyphen" => 273, "guilsinglright" => 273, "quotesingle" => 157, 
+    "eight" => 456, "exclamdown" => 273, "acircumflex" => 456, 
+    "endash" => 456, "oe" => 774, "ecircumflex" => 456, 
+    "Adieresis" => 547, "copyright" => 604, "Egrave" => 547, 
+    "icircumflex" => 228, "slash" => 228, "braceright" => 274, 
+    "Edieresis" => 547, "quotedblright" => 273, "Idieresis" => 228, 
+    "otilde" => 456, "parenleft" => 273, "one" => 456, 
+    "Odieresis" => 638, "ucircumflex" => 456, "bracketleft" => 228, 
+    "Ugrave" => 592, "cent" => 456, "currency" => 456, 
+    "logicalnot" => 479, "quoteright" => 182, "Udieresis" => 592, 
+    "perthousand" => 820, "Ydieresis" => 547, "Atilde" => 547, 
+    "breve" => 273, "bar" => 213, "fraction" => 137, "Eacute" => 547, 
+    "less" => 479, "adieresis" => 456, "guilsinglleft" => 273, 
+    "egrave" => 456, "exclam" => 228, "edieresis" => 456, 
+    "idieresis" => 228, "Eth" => 592, "period" => 228, "ae" => 729, 
+    "asterisk" => 319, "odieresis" => 456, "Uacute" => 592, 
+    "ugrave" => 456, "five" => 456, "nine" => 456, "greater" => 479, 
+    "udieresis" => 456, "Zcaron" => 501, "threequarters" => 684, 
+    "guillemotright" => 456, "Ccedilla" => 592, "ydieresis" => 410, 
+    "tilde" => 273, "atilde" => 456, "at" => 832, "brokenbar" => 213, 
+    "eacute" => 456, "quoteleft" => 182, "underscore" => 456, 
+    "onesuperior" => 273, 
+  }
+);
+1;
diff --git a/doc/metrics/phvro8a.ph b/doc/metrics/phvro8a.ph
new file mode 100644 (file)
index 0000000..010903e
--- /dev/null
@@ -0,0 +1,72 @@
+%PS_Helvetica_Oblique = (
+  name => 'Helvetica-Oblique',
+  widths => {
+    "multiply" => 584, "Ntilde" => 722, "zero" => 556, "eth" => 556, 
+    "Ograve" => 778, "uacute" => 556, "braceleft" => 334, 
+    "Thorn" => 667, "zcaron" => 500, "comma" => 278, "cedilla" => 333, 
+    "plusminus" => 584, "ccedilla" => 500, "circumflex" => 333, 
+    "dotaccent" => 333, "asciitilde" => 584, "colon" => 278, 
+    "onehalf" => 834, "dollar" => 556, "ntilde" => 556, 
+    "Oacute" => 778, "Ocircumflex" => 778, "ogonek" => 333, 
+    "ograve" => 556, "thorn" => 556, "degree" => 400, "minus" => 584, 
+    "yen" => 556, "space" => 278, "registered" => 737, 
+    "questiondown" => 611, "Aring" => 667, "percent" => 889, 
+    "emdash" => 1000, "six" => 556, "Agrave" => 667, 
+    "paragraph" => 537, "three" => 556, "numbersign" => 556, 
+    "two" => 556, "Igrave" => 278, "oacute" => 556, 
+    "ocircumflex" => 556, "A" => 667, "B" => 667, "C" => 722, 
+    "D" => 722, "E" => 667, "onequarter" => 834, "F" => 611, 
+    "G" => 778, "H" => 722, "I" => 278, "J" => 500, "K" => 667, 
+    "L" => 556, "backslash" => 278, "asciicircum" => 469, 
+    "periodcentered" => 278, "M" => 833, "N" => 722, "O" => 778, 
+    "P" => 667, "aring" => 556, "Q" => 778, "R" => 722, 
+    "Aacute" => 667, "caron" => 333, "S" => 667, "T" => 611, 
+    "grave" => 333, "U" => 722, "agrave" => 556, "V" => 667, 
+    "W" => 944, "equal" => 584, "question" => 556, "X" => 667, 
+    "Y" => 667, "Z" => 611, "bracketright" => 278, "Iacute" => 278, 
+    "ampersand" => 667, "four" => 556, "igrave" => 278, "a" => 556, 
+    "b" => 556, "c" => 500, "d" => 556, "plus" => 584, "e" => 556, 
+    "quotesinglbase" => 222, "f" => 278, "g" => 556, "bullet" => 350, 
+    "h" => 556, "i" => 222, "Oslash" => 778, "dagger" => 556, 
+    "j" => 222, "Yacute" => 667, "k" => 500, "l" => 222, "m" => 833, 
+    "n" => 556, "o" => 556, "ordfeminine" => 370, "ring" => 333, 
+    "p" => 556, "threesuperior" => 333, "q" => 556, "acute" => 333, 
+    "r" => 333, "aacute" => 556, "twosuperior" => 333, "s" => 500, 
+    "OE" => 1000, "t" => 278, "divide" => 584, "section" => 556, 
+    "u" => 556, "v" => 500, "w" => 722, "dieresis" => 333, "x" => 500, 
+    "y" => 500, "z" => 500, "iacute" => 278, "quotedblbase" => 333, 
+    "hungarumlaut" => 333, "quotedbl" => 355, "mu" => 556, 
+    "Scaron" => 667, "Lslash" => 556, "semicolon" => 278, 
+    "oslash" => 611, "florin" => 556, "yacute" => 500, "fi" => 500, 
+    "fl" => 500, "Acircumflex" => 667, "parenright" => 333, 
+    "Ecircumflex" => 667, "Icircumflex" => 278, "trademark" => 1000, 
+    "daggerdbl" => 556, "guillemotleft" => 556, "germandbls" => 611, 
+    "macron" => 333, "Otilde" => 778, "seven" => 556, 
+    "ellipsis" => 1000, "scaron" => 500, "ordmasculine" => 365, 
+    "AE" => 1000, "Ucircumflex" => 722, "lslash" => 222, 
+    "dotlessi" => 278, "sterling" => 556, "quotedblleft" => 333, 
+    "hyphen" => 333, "guilsinglright" => 333, "quotesingle" => 191, 
+    "eight" => 556, "exclamdown" => 333, "acircumflex" => 556, 
+    "endash" => 556, "oe" => 944, "ecircumflex" => 556, 
+    "Adieresis" => 667, "copyright" => 737, "Egrave" => 667, 
+    "icircumflex" => 278, "slash" => 278, "braceright" => 334, 
+    "Edieresis" => 667, "quotedblright" => 333, "Idieresis" => 278, 
+    "otilde" => 556, "parenleft" => 333, "one" => 556, 
+    "Odieresis" => 778, "ucircumflex" => 556, "bracketleft" => 278, 
+    "Ugrave" => 722, "cent" => 556, "currency" => 556, 
+    "logicalnot" => 584, "quoteright" => 222, "Udieresis" => 722, 
+    "perthousand" => 1000, "Ydieresis" => 667, "Atilde" => 667, 
+    "breve" => 333, "bar" => 260, "fraction" => 167, "Eacute" => 667, 
+    "less" => 584, "adieresis" => 556, "guilsinglleft" => 333, 
+    "egrave" => 556, "exclam" => 278, "edieresis" => 556, 
+    "idieresis" => 278, "Eth" => 722, "period" => 278, "ae" => 889, 
+    "asterisk" => 389, "odieresis" => 556, "Uacute" => 722, 
+    "ugrave" => 556, "five" => 556, "nine" => 556, "greater" => 584, 
+    "udieresis" => 556, "Zcaron" => 611, "threequarters" => 834, 
+    "guillemotright" => 556, "Ccedilla" => 722, "ydieresis" => 500, 
+    "tilde" => 333, "atilde" => 556, "at" => 1015, "brokenbar" => 260, 
+    "eacute" => 556, "quoteleft" => 222, "underscore" => 556, 
+    "onesuperior" => 333, 
+  }
+);
+1;
diff --git a/doc/metrics/phvro8an.ph b/doc/metrics/phvro8an.ph
new file mode 100644 (file)
index 0000000..717e18e
--- /dev/null
@@ -0,0 +1,71 @@
+%PS_Helvetica_Narrow_Oblique = (
+  name => 'Helvetica-Narrow-Oblique',
+  widths => {
+    "multiply" => 479, "Ntilde" => 592, "zero" => 456, "eth" => 456, 
+    "Ograve" => 638, "uacute" => 456, "braceleft" => 274, 
+    "Thorn" => 547, "zcaron" => 410, "comma" => 228, "cedilla" => 273, 
+    "plusminus" => 479, "ccedilla" => 410, "circumflex" => 273, 
+    "dotaccent" => 273, "asciitilde" => 479, "colon" => 228, 
+    "onehalf" => 684, "dollar" => 456, "ntilde" => 456, 
+    "Oacute" => 638, "Ocircumflex" => 638, "ogonek" => 273, 
+    "ograve" => 456, "thorn" => 456, "degree" => 328, "minus" => 479, 
+    "yen" => 456, "space" => 228, "registered" => 604, 
+    "questiondown" => 501, "Aring" => 547, "percent" => 729, 
+    "emdash" => 820, "six" => 456, "Agrave" => 547, "paragraph" => 440, 
+    "three" => 456, "numbersign" => 456, "two" => 456, "Igrave" => 228, 
+    "oacute" => 456, "ocircumflex" => 456, "A" => 547, "B" => 547, 
+    "C" => 592, "D" => 592, "E" => 547, "onequarter" => 684, 
+    "F" => 501, "G" => 638, "H" => 592, "I" => 228, "J" => 410, 
+    "K" => 547, "L" => 456, "backslash" => 228, "asciicircum" => 385, 
+    "periodcentered" => 228, "M" => 683, "N" => 592, "O" => 638, 
+    "P" => 547, "aring" => 456, "Q" => 638, "R" => 592, 
+    "Aacute" => 547, "caron" => 273, "S" => 547, "T" => 501, 
+    "grave" => 273, "U" => 592, "agrave" => 456, "V" => 547, 
+    "W" => 774, "equal" => 479, "question" => 456, "X" => 547, 
+    "Y" => 547, "Z" => 501, "bracketright" => 228, "Iacute" => 228, 
+    "ampersand" => 547, "four" => 456, "igrave" => 228, "a" => 456, 
+    "b" => 456, "c" => 410, "d" => 456, "plus" => 479, "e" => 456, 
+    "quotesinglbase" => 182, "f" => 228, "g" => 456, "bullet" => 287, 
+    "h" => 456, "i" => 182, "Oslash" => 638, "dagger" => 456, 
+    "j" => 182, "Yacute" => 547, "k" => 410, "l" => 182, "m" => 683, 
+    "n" => 456, "o" => 456, "ordfeminine" => 303, "ring" => 273, 
+    "p" => 456, "threesuperior" => 273, "q" => 456, "acute" => 273, 
+    "r" => 273, "aacute" => 456, "twosuperior" => 273, "s" => 410, 
+    "OE" => 820, "t" => 228, "divide" => 479, "section" => 456, 
+    "u" => 456, "v" => 410, "w" => 592, "dieresis" => 273, "x" => 410, 
+    "y" => 410, "z" => 410, "iacute" => 228, "quotedblbase" => 273, 
+    "hungarumlaut" => 273, "quotedbl" => 291, "mu" => 456, 
+    "Scaron" => 547, "Lslash" => 456, "semicolon" => 228, 
+    "oslash" => 501, "florin" => 456, "yacute" => 410, "fi" => 410, 
+    "fl" => 410, "Acircumflex" => 547, "parenright" => 273, 
+    "Ecircumflex" => 547, "Icircumflex" => 228, "trademark" => 820, 
+    "daggerdbl" => 456, "guillemotleft" => 456, "germandbls" => 501, 
+    "macron" => 273, "Otilde" => 638, "seven" => 456, 
+    "ellipsis" => 820, "scaron" => 410, "ordmasculine" => 299, 
+    "AE" => 820, "Ucircumflex" => 592, "lslash" => 182, 
+    "dotlessi" => 228, "sterling" => 456, "quotedblleft" => 273, 
+    "hyphen" => 273, "guilsinglright" => 273, "quotesingle" => 157, 
+    "eight" => 456, "exclamdown" => 273, "acircumflex" => 456, 
+    "endash" => 456, "oe" => 774, "ecircumflex" => 456, 
+    "Adieresis" => 547, "copyright" => 604, "Egrave" => 547, 
+    "icircumflex" => 228, "slash" => 228, "braceright" => 274, 
+    "Edieresis" => 547, "quotedblright" => 273, "Idieresis" => 228, 
+    "otilde" => 456, "parenleft" => 273, "one" => 456, 
+    "Odieresis" => 638, "ucircumflex" => 456, "bracketleft" => 228, 
+    "Ugrave" => 592, "cent" => 456, "currency" => 456, 
+    "logicalnot" => 479, "quoteright" => 182, "Udieresis" => 592, 
+    "perthousand" => 820, "Ydieresis" => 547, "Atilde" => 547, 
+    "breve" => 273, "bar" => 213, "fraction" => 137, "Eacute" => 547, 
+    "less" => 479, "adieresis" => 456, "guilsinglleft" => 273, 
+    "egrave" => 456, "exclam" => 228, "edieresis" => 456, 
+    "idieresis" => 228, "Eth" => 592, "period" => 228, "ae" => 729, 
+    "asterisk" => 319, "odieresis" => 456, "Uacute" => 592, 
+    "ugrave" => 456, "five" => 456, "nine" => 456, "greater" => 479, 
+    "udieresis" => 456, "Zcaron" => 501, "threequarters" => 684, 
+    "guillemotright" => 456, "Ccedilla" => 592, "ydieresis" => 410, 
+    "tilde" => 273, "atilde" => 456, "at" => 832, "brokenbar" => 213, 
+    "eacute" => 456, "quoteleft" => 182, "underscore" => 456, 
+    "onesuperior" => 273, 
+  }
+);
+1;
diff --git a/doc/metrics/pncb8a.ph b/doc/metrics/pncb8a.ph
new file mode 100644 (file)
index 0000000..009ab6d
--- /dev/null
@@ -0,0 +1,72 @@
+%PS_NewCenturySchlbk_Bold = (
+  name => 'NewCenturySchlbk-Bold',
+  widths => {
+    "multiply" => 606, "Ntilde" => 833, "zero" => 574, "eth" => 611, 
+    "Ograve" => 833, "uacute" => 685, "braceleft" => 389, 
+    "Thorn" => 759, "zcaron" => 537, "comma" => 278, "cedilla" => 333, 
+    "plusminus" => 606, "ccedilla" => 556, "circumflex" => 333, 
+    "dotaccent" => 333, "asciitilde" => 606, "colon" => 278, 
+    "onehalf" => 861, "dollar" => 574, "ntilde" => 685, 
+    "Ocircumflex" => 833, "Oacute" => 833, "ogonek" => 333, 
+    "ograve" => 611, "thorn" => 667, "minus" => 606, "degree" => 400, 
+    "yen" => 574, "space" => 287, "registered" => 747, 
+    "questiondown" => 500, "Aring" => 759, "percent" => 833, 
+    "emdash" => 1000, "six" => 574, "Agrave" => 759, 
+    "paragraph" => 747, "three" => 574, "numbersign" => 574, 
+    "two" => 574, "Igrave" => 444, "oacute" => 611, 
+    "ocircumflex" => 611, "A" => 759, "B" => 778, "C" => 778, 
+    "D" => 833, "E" => 759, "onequarter" => 861, "F" => 722, 
+    "G" => 833, "H" => 870, "I" => 444, "J" => 648, "K" => 815, 
+    "L" => 722, "backslash" => 606, "asciicircum" => 606, 
+    "periodcentered" => 278, "M" => 981, "N" => 833, "O" => 833, 
+    "P" => 759, "aring" => 611, "Q" => 833, "R" => 815, 
+    "Aacute" => 759, "caron" => 333, "S" => 667, "T" => 722, 
+    "grave" => 333, "U" => 833, "agrave" => 611, "V" => 759, 
+    "W" => 981, "equal" => 606, "question" => 500, "X" => 722, 
+    "Y" => 722, "Z" => 667, "bracketright" => 389, "Iacute" => 444, 
+    "ampersand" => 852, "four" => 574, "igrave" => 370, "a" => 611, 
+    "b" => 648, "c" => 556, "d" => 667, "plus" => 606, "e" => 574, 
+    "quotesinglbase" => 241, "f" => 389, "g" => 611, "bullet" => 606, 
+    "h" => 685, "i" => 370, "Oslash" => 833, "dagger" => 500, 
+    "j" => 352, "Yacute" => 722, "k" => 667, "l" => 352, "m" => 963, 
+    "n" => 685, "o" => 611, "ordfeminine" => 367, "ring" => 333, 
+    "p" => 667, "threesuperior" => 344, "q" => 648, "acute" => 333, 
+    "r" => 519, "twosuperior" => 344, "aacute" => 611, "s" => 500, 
+    "OE" => 1000, "t" => 426, "divide" => 606, "section" => 500, 
+    "u" => 685, "v" => 611, "w" => 889, "dieresis" => 333, "x" => 611, 
+    "y" => 611, "z" => 537, "iacute" => 370, "quotedblbase" => 481, 
+    "hungarumlaut" => 333, "quotedbl" => 333, "mu" => 685, 
+    "Scaron" => 667, "Lslash" => 722, "semicolon" => 278, 
+    "oslash" => 611, "florin" => 574, "yacute" => 611, "fi" => 685, 
+    "fl" => 685, "Acircumflex" => 759, "parenright" => 389, 
+    "Ecircumflex" => 759, "trademark" => 1000, "Icircumflex" => 444, 
+    "daggerdbl" => 500, "guillemotleft" => 500, "germandbls" => 611, 
+    "macron" => 333, "Otilde" => 833, "seven" => 574, 
+    "ellipsis" => 1000, "scaron" => 500, "ordmasculine" => 367, 
+    "AE" => 981, "Ucircumflex" => 833, "lslash" => 352, 
+    "dotlessi" => 370, "sterling" => 574, "quotedblleft" => 481, 
+    "hyphen" => 333, "guilsinglright" => 333, "quotesingle" => 241, 
+    "eight" => 574, "exclamdown" => 296, "acircumflex" => 611, 
+    "endash" => 500, "oe" => 907, "ecircumflex" => 574, 
+    "copyright" => 747, "Adieresis" => 759, "Egrave" => 759, 
+    "icircumflex" => 370, "slash" => 278, "braceright" => 389, 
+    "Edieresis" => 759, "quotedblright" => 481, "otilde" => 611, 
+    "Idieresis" => 444, "parenleft" => 389, "one" => 574, 
+    "Odieresis" => 833, "ucircumflex" => 685, "bracketleft" => 389, 
+    "Ugrave" => 833, "cent" => 574, "currency" => 574, 
+    "logicalnot" => 606, "quoteright" => 241, "Udieresis" => 833, 
+    "perthousand" => 1000, "Ydieresis" => 722, "Atilde" => 759, 
+    "breve" => 333, "bar" => 606, "fraction" => 167, "Eacute" => 759, 
+    "less" => 606, "adieresis" => 611, "guilsinglleft" => 333, 
+    "egrave" => 574, "exclam" => 296, "edieresis" => 574, "Eth" => 833, 
+    "idieresis" => 370, "period" => 278, "ae" => 870, 
+    "asterisk" => 500, "odieresis" => 611, "Uacute" => 833, 
+    "ugrave" => 685, "five" => 574, "nine" => 574, "greater" => 606, 
+    "Zcaron" => 667, "udieresis" => 685, "threequarters" => 861, 
+    "guillemotright" => 500, "Ccedilla" => 778, "ydieresis" => 611, 
+    "tilde" => 333, "atilde" => 611, "at" => 747, "brokenbar" => 606, 
+    "eacute" => 574, "quoteleft" => 241, "underscore" => 500, 
+    "onesuperior" => 344, 
+  }
+);
+1;
diff --git a/doc/metrics/pncbi8a.ph b/doc/metrics/pncbi8a.ph
new file mode 100644 (file)
index 0000000..76ce18b
--- /dev/null
@@ -0,0 +1,72 @@
+%PS_NewCenturySchlbk_BoldItalic = (
+  name => 'NewCenturySchlbk-BoldItalic',
+  widths => {
+    "multiply" => 606, "Ntilde" => 852, "zero" => 574, "eth" => 574, 
+    "Ograve" => 833, "uacute" => 685, "braceleft" => 407, 
+    "Thorn" => 741, "zcaron" => 519, "comma" => 287, "cedilla" => 333, 
+    "plusminus" => 606, "ccedilla" => 537, "circumflex" => 333, 
+    "dotaccent" => 333, "asciitilde" => 606, "colon" => 287, 
+    "onehalf" => 861, "dollar" => 574, "ntilde" => 685, 
+    "Ocircumflex" => 833, "Oacute" => 833, "ogonek" => 333, 
+    "ograve" => 574, "thorn" => 648, "minus" => 606, "degree" => 400, 
+    "yen" => 574, "space" => 287, "registered" => 747, 
+    "questiondown" => 481, "Aring" => 741, "percent" => 889, 
+    "emdash" => 1000, "six" => 574, "Agrave" => 741, 
+    "paragraph" => 650, "three" => 574, "numbersign" => 574, 
+    "two" => 574, "Igrave" => 444, "oacute" => 574, 
+    "ocircumflex" => 574, "A" => 741, "B" => 759, "C" => 759, 
+    "D" => 833, "E" => 741, "onequarter" => 861, "F" => 704, 
+    "G" => 815, "H" => 870, "I" => 444, "J" => 667, "K" => 778, 
+    "L" => 704, "backslash" => 606, "asciicircum" => 606, 
+    "periodcentered" => 287, "M" => 944, "N" => 852, "O" => 833, 
+    "P" => 741, "aring" => 667, "Q" => 833, "R" => 796, 
+    "Aacute" => 741, "caron" => 333, "S" => 685, "T" => 722, 
+    "grave" => 333, "U" => 833, "agrave" => 667, "V" => 741, 
+    "W" => 944, "equal" => 606, "question" => 481, "X" => 741, 
+    "Y" => 704, "Z" => 704, "bracketright" => 407, "Iacute" => 444, 
+    "ampersand" => 889, "four" => 574, "igrave" => 389, "a" => 667, 
+    "b" => 611, "c" => 537, "d" => 667, "plus" => 606, "e" => 519, 
+    "quotesinglbase" => 259, "f" => 389, "g" => 611, "bullet" => 606, 
+    "h" => 685, "i" => 389, "Oslash" => 833, "dagger" => 500, 
+    "j" => 370, "Yacute" => 704, "k" => 648, "l" => 389, "m" => 944, 
+    "n" => 685, "o" => 574, "ordfeminine" => 412, "ring" => 333, 
+    "p" => 648, "threesuperior" => 344, "q" => 630, "acute" => 333, 
+    "r" => 519, "twosuperior" => 344, "aacute" => 667, "s" => 481, 
+    "OE" => 963, "t" => 407, "divide" => 606, "section" => 500, 
+    "u" => 685, "v" => 556, "w" => 833, "dieresis" => 333, "x" => 574, 
+    "y" => 519, "z" => 519, "iacute" => 389, "quotedblbase" => 481, 
+    "hungarumlaut" => 333, "quotedbl" => 400, "mu" => 685, 
+    "Scaron" => 685, "Lslash" => 704, "semicolon" => 287, 
+    "oslash" => 574, "florin" => 574, "yacute" => 519, "fi" => 685, 
+    "fl" => 685, "Acircumflex" => 741, "parenright" => 407, 
+    "Ecircumflex" => 741, "trademark" => 950, "Icircumflex" => 444, 
+    "daggerdbl" => 500, "guillemotleft" => 481, "germandbls" => 574, 
+    "macron" => 333, "Otilde" => 833, "seven" => 574, 
+    "ellipsis" => 1000, "scaron" => 481, "ordmasculine" => 356, 
+    "AE" => 889, "Ucircumflex" => 833, "lslash" => 389, 
+    "dotlessi" => 389, "sterling" => 574, "quotedblleft" => 481, 
+    "hyphen" => 333, "guilsinglright" => 278, "quotesingle" => 287, 
+    "eight" => 574, "exclamdown" => 333, "acircumflex" => 667, 
+    "endash" => 500, "oe" => 852, "ecircumflex" => 519, 
+    "copyright" => 747, "Adieresis" => 741, "Egrave" => 741, 
+    "icircumflex" => 389, "slash" => 278, "braceright" => 407, 
+    "Edieresis" => 741, "quotedblright" => 481, "otilde" => 574, 
+    "Idieresis" => 444, "parenleft" => 407, "one" => 574, 
+    "Odieresis" => 833, "ucircumflex" => 685, "bracketleft" => 407, 
+    "Ugrave" => 833, "cent" => 574, "currency" => 574, 
+    "logicalnot" => 606, "quoteright" => 259, "Udieresis" => 833, 
+    "perthousand" => 1167, "Ydieresis" => 704, "Atilde" => 741, 
+    "breve" => 333, "bar" => 606, "fraction" => 167, "Eacute" => 741, 
+    "less" => 606, "adieresis" => 667, "guilsinglleft" => 278, 
+    "egrave" => 519, "exclam" => 333, "edieresis" => 519, "Eth" => 833, 
+    "idieresis" => 389, "period" => 287, "ae" => 815, 
+    "asterisk" => 500, "odieresis" => 574, "Uacute" => 833, 
+    "ugrave" => 685, "five" => 574, "nine" => 574, "greater" => 606, 
+    "Zcaron" => 704, "udieresis" => 685, "threequarters" => 861, 
+    "guillemotright" => 481, "Ccedilla" => 759, "ydieresis" => 519, 
+    "tilde" => 333, "atilde" => 667, "at" => 747, "brokenbar" => 606, 
+    "eacute" => 519, "quoteleft" => 259, "underscore" => 500, 
+    "onesuperior" => 344, 
+  }
+);
+1;
diff --git a/doc/metrics/pncr8a.ph b/doc/metrics/pncr8a.ph
new file mode 100644 (file)
index 0000000..d42c2f9
--- /dev/null
@@ -0,0 +1,72 @@
+%PS_NewCenturySchlbk_Roman = (
+  name => 'NewCenturySchlbk-Roman',
+  widths => {
+    "multiply" => 606, "Ntilde" => 815, "zero" => 556, "eth" => 500, 
+    "Ograve" => 778, "uacute" => 611, "braceleft" => 333, 
+    "Thorn" => 667, "zcaron" => 481, "comma" => 278, "cedilla" => 333, 
+    "plusminus" => 606, "ccedilla" => 444, "circumflex" => 333, 
+    "dotaccent" => 333, "asciitilde" => 606, "colon" => 278, 
+    "onehalf" => 834, "dollar" => 556, "ntilde" => 611, 
+    "Ocircumflex" => 778, "Oacute" => 778, "ogonek" => 333, 
+    "ograve" => 500, "thorn" => 574, "minus" => 606, "degree" => 400, 
+    "yen" => 556, "space" => 278, "registered" => 737, 
+    "questiondown" => 444, "Aring" => 722, "percent" => 833, 
+    "emdash" => 1000, "six" => 556, "Agrave" => 722, 
+    "paragraph" => 606, "three" => 556, "numbersign" => 556, 
+    "two" => 556, "Igrave" => 407, "oacute" => 500, 
+    "ocircumflex" => 500, "A" => 722, "B" => 722, "C" => 722, 
+    "D" => 778, "E" => 722, "onequarter" => 834, "F" => 667, 
+    "G" => 778, "H" => 833, "I" => 407, "J" => 556, "K" => 778, 
+    "L" => 667, "backslash" => 606, "asciicircum" => 606, 
+    "periodcentered" => 278, "M" => 944, "N" => 815, "O" => 778, 
+    "P" => 667, "aring" => 556, "Q" => 778, "R" => 722, 
+    "Aacute" => 722, "caron" => 333, "S" => 630, "T" => 667, 
+    "grave" => 333, "U" => 815, "agrave" => 556, "V" => 722, 
+    "W" => 981, "equal" => 606, "question" => 444, "X" => 704, 
+    "Y" => 704, "Z" => 611, "bracketright" => 333, "Iacute" => 407, 
+    "ampersand" => 815, "four" => 556, "igrave" => 315, "a" => 556, 
+    "b" => 556, "c" => 444, "d" => 574, "plus" => 606, "e" => 500, 
+    "quotesinglbase" => 204, "f" => 333, "g" => 537, "bullet" => 606, 
+    "h" => 611, "i" => 315, "Oslash" => 778, "dagger" => 500, 
+    "j" => 296, "Yacute" => 704, "k" => 593, "l" => 315, "m" => 889, 
+    "n" => 611, "o" => 500, "ordfeminine" => 334, "ring" => 333, 
+    "p" => 574, "threesuperior" => 333, "q" => 556, "acute" => 333, 
+    "r" => 444, "twosuperior" => 333, "aacute" => 556, "s" => 463, 
+    "OE" => 1000, "t" => 389, "divide" => 606, "section" => 500, 
+    "u" => 611, "v" => 537, "w" => 778, "dieresis" => 333, "x" => 537, 
+    "y" => 537, "z" => 481, "iacute" => 315, "quotedblbase" => 389, 
+    "hungarumlaut" => 333, "quotedbl" => 389, "mu" => 611, 
+    "Scaron" => 630, "Lslash" => 667, "semicolon" => 278, 
+    "oslash" => 500, "florin" => 556, "yacute" => 537, "fi" => 611, 
+    "fl" => 611, "Acircumflex" => 722, "parenright" => 333, 
+    "Ecircumflex" => 722, "trademark" => 1000, "Icircumflex" => 407, 
+    "daggerdbl" => 500, "guillemotleft" => 426, "germandbls" => 574, 
+    "macron" => 333, "Otilde" => 778, "seven" => 556, 
+    "ellipsis" => 1000, "scaron" => 463, "ordmasculine" => 300, 
+    "AE" => 1000, "Ucircumflex" => 815, "lslash" => 315, 
+    "dotlessi" => 315, "sterling" => 556, "quotedblleft" => 389, 
+    "hyphen" => 333, "guilsinglright" => 259, "quotesingle" => 204, 
+    "eight" => 556, "exclamdown" => 296, "acircumflex" => 556, 
+    "endash" => 556, "oe" => 833, "ecircumflex" => 500, 
+    "copyright" => 737, "Adieresis" => 722, "Egrave" => 722, 
+    "icircumflex" => 315, "slash" => 278, "braceright" => 333, 
+    "Edieresis" => 722, "quotedblright" => 389, "otilde" => 500, 
+    "Idieresis" => 407, "parenleft" => 333, "one" => 556, 
+    "Odieresis" => 778, "ucircumflex" => 611, "bracketleft" => 333, 
+    "Ugrave" => 815, "cent" => 556, "currency" => 556, 
+    "logicalnot" => 606, "quoteright" => 204, "Udieresis" => 815, 
+    "perthousand" => 1000, "Ydieresis" => 704, "Atilde" => 722, 
+    "breve" => 333, "bar" => 606, "fraction" => 167, "Eacute" => 722, 
+    "less" => 606, "adieresis" => 556, "guilsinglleft" => 259, 
+    "egrave" => 500, "exclam" => 296, "edieresis" => 500, "Eth" => 778, 
+    "idieresis" => 315, "period" => 278, "ae" => 796, 
+    "asterisk" => 500, "odieresis" => 500, "Uacute" => 815, 
+    "ugrave" => 611, "five" => 556, "nine" => 556, "greater" => 606, 
+    "Zcaron" => 611, "udieresis" => 611, "threequarters" => 834, 
+    "guillemotright" => 426, "Ccedilla" => 722, "ydieresis" => 537, 
+    "tilde" => 333, "atilde" => 556, "at" => 737, "brokenbar" => 606, 
+    "eacute" => 500, "quoteleft" => 204, "underscore" => 500, 
+    "onesuperior" => 333, 
+  }
+);
+1;
diff --git a/doc/metrics/pncri8a.ph b/doc/metrics/pncri8a.ph
new file mode 100644 (file)
index 0000000..c4c700f
--- /dev/null
@@ -0,0 +1,72 @@
+%PS_NewCenturySchlbk_Italic = (
+  name => 'NewCenturySchlbk-Italic',
+  widths => {
+    "multiply" => 606, "Ntilde" => 815, "zero" => 556, "eth" => 500, 
+    "Ograve" => 778, "uacute" => 611, "braceleft" => 333, 
+    "Thorn" => 667, "zcaron" => 463, "comma" => 278, "cedilla" => 333, 
+    "plusminus" => 606, "ccedilla" => 444, "circumflex" => 333, 
+    "dotaccent" => 333, "asciitilde" => 606, "colon" => 278, 
+    "onehalf" => 834, "dollar" => 556, "ntilde" => 611, 
+    "Ocircumflex" => 778, "Oacute" => 778, "ogonek" => 333, 
+    "ograve" => 500, "thorn" => 574, "minus" => 606, "degree" => 400, 
+    "yen" => 556, "space" => 278, "registered" => 747, 
+    "questiondown" => 444, "Aring" => 704, "percent" => 833, 
+    "emdash" => 1000, "six" => 556, "Agrave" => 704, 
+    "paragraph" => 650, "three" => 556, "numbersign" => 556, 
+    "two" => 556, "Igrave" => 407, "oacute" => 500, 
+    "ocircumflex" => 500, "A" => 704, "B" => 722, "C" => 722, 
+    "D" => 778, "E" => 722, "onequarter" => 834, "F" => 667, 
+    "G" => 778, "H" => 833, "I" => 407, "J" => 611, "K" => 741, 
+    "L" => 667, "backslash" => 606, "asciicircum" => 606, 
+    "periodcentered" => 278, "M" => 944, "N" => 815, "O" => 778, 
+    "P" => 667, "aring" => 574, "Q" => 778, "R" => 741, 
+    "Aacute" => 704, "caron" => 333, "S" => 667, "T" => 685, 
+    "grave" => 333, "U" => 815, "agrave" => 574, "V" => 704, 
+    "W" => 926, "equal" => 606, "question" => 444, "X" => 704, 
+    "Y" => 685, "Z" => 667, "bracketright" => 333, "Iacute" => 407, 
+    "ampersand" => 852, "four" => 556, "igrave" => 333, "a" => 574, 
+    "b" => 556, "c" => 444, "d" => 611, "plus" => 606, "e" => 444, 
+    "quotesinglbase" => 204, "f" => 333, "g" => 537, "bullet" => 606, 
+    "h" => 611, "i" => 333, "Oslash" => 778, "dagger" => 500, 
+    "j" => 315, "Yacute" => 685, "k" => 556, "l" => 333, "m" => 889, 
+    "n" => 611, "o" => 500, "ordfeminine" => 422, "ring" => 333, 
+    "p" => 574, "threesuperior" => 333, "q" => 556, "acute" => 333, 
+    "r" => 444, "twosuperior" => 333, "aacute" => 574, "s" => 444, 
+    "OE" => 981, "t" => 352, "divide" => 606, "section" => 500, 
+    "u" => 611, "v" => 519, "w" => 778, "dieresis" => 333, "x" => 500, 
+    "y" => 500, "z" => 463, "iacute" => 333, "quotedblbase" => 389, 
+    "hungarumlaut" => 333, "quotedbl" => 400, "mu" => 611, 
+    "Scaron" => 667, "Lslash" => 667, "semicolon" => 278, 
+    "oslash" => 500, "florin" => 556, "yacute" => 500, "fi" => 611, 
+    "fl" => 611, "Acircumflex" => 704, "parenright" => 333, 
+    "Ecircumflex" => 722, "trademark" => 950, "Icircumflex" => 407, 
+    "daggerdbl" => 500, "guillemotleft" => 426, "germandbls" => 556, 
+    "macron" => 333, "Otilde" => 778, "seven" => 556, 
+    "ellipsis" => 1000, "scaron" => 444, "ordmasculine" => 372, 
+    "AE" => 870, "Ucircumflex" => 815, "lslash" => 333, 
+    "dotlessi" => 333, "sterling" => 556, "quotedblleft" => 389, 
+    "hyphen" => 333, "guilsinglright" => 333, "quotesingle" => 278, 
+    "eight" => 556, "exclamdown" => 333, "acircumflex" => 574, 
+    "endash" => 500, "oe" => 778, "ecircumflex" => 444, 
+    "copyright" => 747, "Adieresis" => 704, "Egrave" => 722, 
+    "icircumflex" => 333, "slash" => 606, "braceright" => 333, 
+    "Edieresis" => 722, "quotedblright" => 389, "otilde" => 500, 
+    "Idieresis" => 407, "parenleft" => 333, "one" => 556, 
+    "Odieresis" => 778, "ucircumflex" => 611, "bracketleft" => 333, 
+    "Ugrave" => 815, "cent" => 556, "currency" => 556, 
+    "logicalnot" => 606, "quoteright" => 204, "Udieresis" => 815, 
+    "perthousand" => 1000, "Ydieresis" => 685, "Atilde" => 704, 
+    "breve" => 333, "bar" => 606, "fraction" => 167, "Eacute" => 722, 
+    "less" => 606, "adieresis" => 574, "guilsinglleft" => 333, 
+    "egrave" => 444, "exclam" => 333, "edieresis" => 444, "Eth" => 778, 
+    "idieresis" => 333, "period" => 278, "ae" => 722, 
+    "asterisk" => 500, "odieresis" => 500, "Uacute" => 815, 
+    "ugrave" => 611, "five" => 556, "nine" => 556, "greater" => 606, 
+    "Zcaron" => 667, "udieresis" => 611, "threequarters" => 834, 
+    "guillemotright" => 426, "Ccedilla" => 722, "ydieresis" => 500, 
+    "tilde" => 333, "atilde" => 574, "at" => 747, "brokenbar" => 606, 
+    "eacute" => 444, "quoteleft" => 204, "underscore" => 500, 
+    "onesuperior" => 333, 
+  }
+);
+1;
diff --git a/doc/metrics/pplb8a.ph b/doc/metrics/pplb8a.ph
new file mode 100644 (file)
index 0000000..c624356
--- /dev/null
@@ -0,0 +1,72 @@
+%PS_Palatino_Bold = (
+  name => 'Palatino-Bold',
+  widths => {
+    "multiply" => 606, "Ntilde" => 833, "zero" => 500, "eth" => 556, 
+    "Ograve" => 833, "uacute" => 611, "braceleft" => 310, 
+    "Thorn" => 611, "zcaron" => 500, "comma" => 250, "cedilla" => 333, 
+    "plusminus" => 606, "ccedilla" => 444, "circumflex" => 333, 
+    "dotaccent" => 333, "asciitilde" => 606, "colon" => 250, 
+    "onehalf" => 750, "dollar" => 500, "ntilde" => 611, 
+    "Oacute" => 833, "Ocircumflex" => 833, "ogonek" => 333, 
+    "ograve" => 556, "thorn" => 611, "degree" => 400, "minus" => 606, 
+    "yen" => 500, "space" => 250, "registered" => 747, 
+    "questiondown" => 444, "Aring" => 778, "percent" => 889, 
+    "emdash" => 1000, "six" => 500, "Agrave" => 778, 
+    "paragraph" => 641, "three" => 500, "numbersign" => 500, 
+    "two" => 500, "Igrave" => 389, "oacute" => 556, 
+    "ocircumflex" => 556, "A" => 778, "B" => 667, "C" => 722, 
+    "D" => 833, "E" => 611, "onequarter" => 750, "F" => 556, 
+    "G" => 833, "H" => 833, "I" => 389, "J" => 389, "K" => 778, 
+    "L" => 611, "backslash" => 606, "asciicircum" => 606, 
+    "periodcentered" => 250, "M" => 1000, "N" => 833, "O" => 833, 
+    "P" => 611, "aring" => 500, "Q" => 833, "R" => 722, 
+    "Aacute" => 778, "caron" => 333, "S" => 611, "T" => 667, 
+    "grave" => 333, "U" => 778, "agrave" => 500, "V" => 778, 
+    "W" => 1000, "equal" => 606, "question" => 444, "X" => 667, 
+    "Y" => 667, "Z" => 667, "bracketright" => 333, "Iacute" => 389, 
+    "ampersand" => 833, "four" => 500, "igrave" => 333, "a" => 500, 
+    "b" => 611, "c" => 444, "d" => 611, "plus" => 606, "e" => 500, 
+    "quotesinglbase" => 333, "f" => 389, "g" => 556, "bullet" => 606, 
+    "h" => 611, "i" => 333, "Oslash" => 833, "dagger" => 500, 
+    "j" => 333, "Yacute" => 667, "k" => 611, "l" => 333, "m" => 889, 
+    "n" => 611, "o" => 556, "ordfeminine" => 438, "ring" => 333, 
+    "p" => 611, "threesuperior" => 300, "q" => 611, "acute" => 333, 
+    "r" => 389, "aacute" => 500, "twosuperior" => 300, "s" => 444, 
+    "OE" => 1000, "t" => 333, "divide" => 606, "section" => 500, 
+    "u" => 611, "v" => 556, "w" => 833, "dieresis" => 333, "x" => 500, 
+    "y" => 556, "z" => 500, "iacute" => 333, "quotedblbase" => 500, 
+    "hungarumlaut" => 333, "quotedbl" => 402, "mu" => 611, 
+    "Scaron" => 611, "Lslash" => 611, "semicolon" => 250, 
+    "oslash" => 556, "florin" => 500, "yacute" => 556, "fi" => 611, 
+    "fl" => 611, "Acircumflex" => 778, "parenright" => 333, 
+    "Ecircumflex" => 611, "Icircumflex" => 389, "trademark" => 998, 
+    "daggerdbl" => 500, "guillemotleft" => 500, "germandbls" => 611, 
+    "macron" => 333, "Otilde" => 833, "seven" => 500, 
+    "ellipsis" => 1000, "scaron" => 444, "ordmasculine" => 488, 
+    "AE" => 1000, "Ucircumflex" => 778, "lslash" => 333, 
+    "dotlessi" => 333, "sterling" => 500, "quotedblleft" => 500, 
+    "hyphen" => 333, "guilsinglright" => 389, "quotesingle" => 227, 
+    "eight" => 500, "exclamdown" => 278, "acircumflex" => 500, 
+    "endash" => 500, "oe" => 833, "ecircumflex" => 500, 
+    "Adieresis" => 778, "copyright" => 747, "Egrave" => 611, 
+    "icircumflex" => 333, "slash" => 296, "braceright" => 310, 
+    "Edieresis" => 611, "quotedblright" => 500, "Idieresis" => 389, 
+    "otilde" => 556, "parenleft" => 333, "one" => 500, 
+    "Odieresis" => 833, "ucircumflex" => 611, "bracketleft" => 333, 
+    "Ugrave" => 778, "cent" => 500, "currency" => 500, 
+    "logicalnot" => 606, "quoteright" => 278, "Udieresis" => 778, 
+    "perthousand" => 1000, "Ydieresis" => 667, "Atilde" => 778, 
+    "breve" => 333, "bar" => 606, "fraction" => 167, "Eacute" => 611, 
+    "less" => 606, "adieresis" => 500, "guilsinglleft" => 389, 
+    "egrave" => 500, "exclam" => 278, "edieresis" => 500, 
+    "idieresis" => 333, "Eth" => 833, "period" => 250, "ae" => 778, 
+    "asterisk" => 444, "odieresis" => 556, "Uacute" => 778, 
+    "ugrave" => 611, "five" => 500, "nine" => 500, "greater" => 606, 
+    "udieresis" => 611, "Zcaron" => 667, "threequarters" => 750, 
+    "guillemotright" => 500, "Ccedilla" => 722, "ydieresis" => 556, 
+    "tilde" => 333, "atilde" => 500, "at" => 747, "brokenbar" => 606, 
+    "eacute" => 500, "quoteleft" => 278, "underscore" => 500, 
+    "onesuperior" => 300, 
+  }
+);
+1;
diff --git a/doc/metrics/pplbi8a.ph b/doc/metrics/pplbi8a.ph
new file mode 100644 (file)
index 0000000..31cf0a7
--- /dev/null
@@ -0,0 +1,72 @@
+%PS_Palatino_BoldItalic = (
+  name => 'Palatino-BoldItalic',
+  widths => {
+    "multiply" => 606, "Ntilde" => 778, "zero" => 500, "eth" => 556, 
+    "Ograve" => 833, "uacute" => 556, "braceleft" => 333, 
+    "Thorn" => 667, "zcaron" => 500, "comma" => 250, "cedilla" => 333, 
+    "plusminus" => 606, "ccedilla" => 444, "circumflex" => 333, 
+    "dotaccent" => 333, "asciitilde" => 606, "colon" => 250, 
+    "onehalf" => 750, "dollar" => 500, "ntilde" => 556, 
+    "Oacute" => 833, "Ocircumflex" => 833, "ogonek" => 333, 
+    "ograve" => 556, "thorn" => 556, "degree" => 400, "minus" => 606, 
+    "yen" => 500, "space" => 250, "registered" => 747, 
+    "questiondown" => 444, "Aring" => 722, "percent" => 889, 
+    "emdash" => 1000, "six" => 500, "Agrave" => 722, 
+    "paragraph" => 556, "three" => 500, "numbersign" => 500, 
+    "two" => 500, "Igrave" => 389, "oacute" => 556, 
+    "ocircumflex" => 556, "A" => 722, "B" => 667, "C" => 685, 
+    "D" => 778, "E" => 611, "onequarter" => 750, "F" => 556, 
+    "G" => 778, "H" => 778, "I" => 389, "J" => 389, "K" => 722, 
+    "L" => 611, "backslash" => 606, "asciicircum" => 606, 
+    "periodcentered" => 250, "M" => 944, "N" => 778, "O" => 833, 
+    "P" => 667, "aring" => 556, "Q" => 833, "R" => 722, 
+    "Aacute" => 722, "caron" => 333, "S" => 556, "T" => 611, 
+    "grave" => 333, "U" => 778, "agrave" => 556, "V" => 667, 
+    "W" => 1000, "equal" => 606, "question" => 444, "X" => 722, 
+    "Y" => 611, "Z" => 667, "bracketright" => 333, "Iacute" => 389, 
+    "ampersand" => 833, "four" => 500, "igrave" => 333, "a" => 556, 
+    "b" => 537, "c" => 444, "d" => 556, "plus" => 606, "e" => 444, 
+    "quotesinglbase" => 250, "f" => 333, "g" => 500, "bullet" => 606, 
+    "h" => 556, "i" => 333, "Oslash" => 833, "dagger" => 556, 
+    "j" => 333, "Yacute" => 611, "k" => 556, "l" => 333, "m" => 833, 
+    "n" => 556, "o" => 556, "ordfeminine" => 333, "ring" => 556, 
+    "p" => 556, "threesuperior" => 300, "q" => 537, "acute" => 333, 
+    "r" => 389, "aacute" => 556, "twosuperior" => 300, "s" => 444, 
+    "OE" => 944, "t" => 389, "divide" => 606, "section" => 556, 
+    "u" => 556, "v" => 556, "w" => 833, "dieresis" => 333, "x" => 500, 
+    "y" => 556, "z" => 500, "iacute" => 333, "quotedblbase" => 500, 
+    "hungarumlaut" => 333, "quotedbl" => 500, "mu" => 556, 
+    "Scaron" => 556, "Lslash" => 611, "semicolon" => 250, 
+    "oslash" => 556, "florin" => 500, "yacute" => 556, "fi" => 611, 
+    "fl" => 611, "Acircumflex" => 722, "parenright" => 333, 
+    "Ecircumflex" => 611, "Icircumflex" => 389, "trademark" => 1000, 
+    "daggerdbl" => 556, "guillemotleft" => 500, "germandbls" => 556, 
+    "macron" => 333, "Otilde" => 833, "seven" => 500, 
+    "ellipsis" => 1000, "scaron" => 444, "ordmasculine" => 333, 
+    "AE" => 944, "Ucircumflex" => 778, "lslash" => 333, 
+    "dotlessi" => 333, "sterling" => 500, "quotedblleft" => 500, 
+    "hyphen" => 389, "guilsinglright" => 333, "quotesingle" => 250, 
+    "eight" => 500, "exclamdown" => 333, "acircumflex" => 556, 
+    "endash" => 500, "oe" => 778, "ecircumflex" => 444, 
+    "Adieresis" => 722, "copyright" => 747, "Egrave" => 611, 
+    "icircumflex" => 333, "slash" => 315, "braceright" => 333, 
+    "Edieresis" => 611, "quotedblright" => 500, "Idieresis" => 389, 
+    "otilde" => 556, "parenleft" => 333, "one" => 500, 
+    "Odieresis" => 833, "ucircumflex" => 556, "bracketleft" => 333, 
+    "Ugrave" => 778, "cent" => 500, "currency" => 500, 
+    "logicalnot" => 606, "quoteright" => 278, "Udieresis" => 778, 
+    "perthousand" => 1000, "Ydieresis" => 611, "Atilde" => 722, 
+    "breve" => 333, "bar" => 606, "fraction" => 167, "Eacute" => 611, 
+    "less" => 606, "adieresis" => 556, "guilsinglleft" => 333, 
+    "egrave" => 444, "exclam" => 333, "edieresis" => 444, 
+    "idieresis" => 333, "Eth" => 778, "period" => 250, "ae" => 738, 
+    "asterisk" => 444, "odieresis" => 556, "Uacute" => 778, 
+    "ugrave" => 556, "five" => 500, "nine" => 500, "greater" => 606, 
+    "udieresis" => 556, "Zcaron" => 667, "threequarters" => 750, 
+    "guillemotright" => 500, "Ccedilla" => 685, "ydieresis" => 556, 
+    "tilde" => 333, "atilde" => 556, "at" => 833, "brokenbar" => 606, 
+    "eacute" => 444, "quoteleft" => 278, "underscore" => 500, 
+    "onesuperior" => 300, 
+  }
+);
+1;
diff --git a/doc/metrics/pplr8a.ph b/doc/metrics/pplr8a.ph
new file mode 100644 (file)
index 0000000..4cbd1c9
--- /dev/null
@@ -0,0 +1,72 @@
+%PS_Palatino_Roman = (
+  name => 'Palatino-Roman',
+  widths => {
+    "multiply" => 606, "Ntilde" => 831, "zero" => 500, "eth" => 546, 
+    "Ograve" => 786, "uacute" => 603, "braceleft" => 333, 
+    "Thorn" => 604, "zcaron" => 500, "comma" => 250, "cedilla" => 333, 
+    "plusminus" => 606, "ccedilla" => 444, "circumflex" => 333, 
+    "dotaccent" => 250, "asciitilde" => 606, "colon" => 250, 
+    "onehalf" => 750, "dollar" => 500, "ntilde" => 582, 
+    "Oacute" => 786, "Ocircumflex" => 786, "ogonek" => 313, 
+    "ograve" => 546, "thorn" => 601, "degree" => 400, "minus" => 606, 
+    "yen" => 500, "space" => 250, "registered" => 747, 
+    "questiondown" => 444, "Aring" => 778, "percent" => 840, 
+    "emdash" => 1000, "six" => 500, "Agrave" => 778, 
+    "paragraph" => 628, "three" => 500, "numbersign" => 500, 
+    "two" => 500, "Igrave" => 337, "oacute" => 546, 
+    "ocircumflex" => 546, "A" => 778, "B" => 611, "C" => 709, 
+    "D" => 774, "E" => 611, "onequarter" => 750, "F" => 556, 
+    "G" => 763, "H" => 832, "I" => 337, "J" => 333, "K" => 726, 
+    "L" => 611, "backslash" => 606, "asciicircum" => 606, 
+    "periodcentered" => 250, "M" => 946, "N" => 831, "O" => 786, 
+    "P" => 604, "aring" => 500, "Q" => 786, "R" => 668, 
+    "Aacute" => 778, "caron" => 333, "S" => 525, "T" => 613, 
+    "grave" => 333, "U" => 778, "agrave" => 500, "V" => 722, 
+    "W" => 1000, "equal" => 606, "question" => 444, "X" => 667, 
+    "Y" => 667, "Z" => 667, "bracketright" => 333, "Iacute" => 337, 
+    "ampersand" => 778, "four" => 500, "igrave" => 287, "a" => 500, 
+    "b" => 553, "c" => 444, "d" => 611, "plus" => 606, "e" => 479, 
+    "quotesinglbase" => 278, "f" => 333, "g" => 556, "bullet" => 606, 
+    "h" => 582, "i" => 291, "Oslash" => 833, "dagger" => 500, 
+    "j" => 234, "Yacute" => 667, "k" => 556, "l" => 291, "m" => 883, 
+    "n" => 582, "o" => 546, "ordfeminine" => 333, "ring" => 333, 
+    "p" => 601, "threesuperior" => 300, "q" => 560, "acute" => 333, 
+    "r" => 395, "aacute" => 500, "twosuperior" => 300, "s" => 424, 
+    "OE" => 998, "t" => 326, "divide" => 606, "section" => 500, 
+    "u" => 603, "v" => 565, "w" => 834, "dieresis" => 333, "x" => 516, 
+    "y" => 556, "z" => 500, "iacute" => 287, "quotedblbase" => 500, 
+    "hungarumlaut" => 380, "quotedbl" => 371, "mu" => 603, 
+    "Scaron" => 525, "Lslash" => 611, "semicolon" => 250, 
+    "oslash" => 556, "florin" => 500, "yacute" => 556, "fi" => 605, 
+    "fl" => 608, "Acircumflex" => 778, "parenright" => 333, 
+    "Ecircumflex" => 611, "Icircumflex" => 337, "trademark" => 979, 
+    "daggerdbl" => 500, "guillemotleft" => 500, "germandbls" => 556, 
+    "macron" => 333, "Otilde" => 786, "seven" => 500, 
+    "ellipsis" => 1000, "scaron" => 424, "ordmasculine" => 333, 
+    "AE" => 944, "Ucircumflex" => 778, "lslash" => 291, 
+    "dotlessi" => 287, "sterling" => 500, "quotedblleft" => 500, 
+    "hyphen" => 333, "guilsinglright" => 331, "quotesingle" => 208, 
+    "eight" => 500, "exclamdown" => 278, "acircumflex" => 500, 
+    "endash" => 500, "oe" => 827, "ecircumflex" => 479, 
+    "Adieresis" => 778, "copyright" => 747, "Egrave" => 611, 
+    "icircumflex" => 287, "slash" => 606, "braceright" => 333, 
+    "Edieresis" => 611, "quotedblright" => 500, "Idieresis" => 337, 
+    "otilde" => 546, "parenleft" => 333, "one" => 500, 
+    "Odieresis" => 786, "ucircumflex" => 603, "bracketleft" => 333, 
+    "Ugrave" => 778, "cent" => 500, "currency" => 500, 
+    "logicalnot" => 606, "quoteright" => 278, "Udieresis" => 778, 
+    "perthousand" => 1144, "Ydieresis" => 667, "Atilde" => 778, 
+    "breve" => 333, "bar" => 606, "fraction" => 167, "Eacute" => 611, 
+    "less" => 606, "adieresis" => 500, "guilsinglleft" => 331, 
+    "egrave" => 479, "exclam" => 278, "edieresis" => 479, 
+    "idieresis" => 287, "Eth" => 774, "period" => 250, "ae" => 758, 
+    "asterisk" => 389, "odieresis" => 546, "Uacute" => 778, 
+    "ugrave" => 603, "five" => 500, "nine" => 500, "greater" => 606, 
+    "udieresis" => 603, "Zcaron" => 667, "threequarters" => 750, 
+    "guillemotright" => 500, "Ccedilla" => 709, "ydieresis" => 556, 
+    "tilde" => 333, "atilde" => 500, "at" => 747, "brokenbar" => 606, 
+    "eacute" => 479, "quoteleft" => 278, "underscore" => 500, 
+    "onesuperior" => 300, 
+  }
+);
+1;
diff --git a/doc/metrics/pplri8a.ph b/doc/metrics/pplri8a.ph
new file mode 100644 (file)
index 0000000..b4a5224
--- /dev/null
@@ -0,0 +1,72 @@
+%PS_Palatino_Italic = (
+  name => 'Palatino-Italic',
+  widths => {
+    "multiply" => 606, "Ntilde" => 778, "zero" => 500, "eth" => 444, 
+    "Ograve" => 778, "uacute" => 556, "braceleft" => 333, 
+    "Thorn" => 611, "zcaron" => 444, "comma" => 250, "cedilla" => 333, 
+    "plusminus" => 606, "ccedilla" => 407, "circumflex" => 333, 
+    "dotaccent" => 333, "asciitilde" => 606, "colon" => 250, 
+    "onehalf" => 750, "dollar" => 500, "ntilde" => 556, 
+    "Oacute" => 778, "Ocircumflex" => 778, "ogonek" => 333, 
+    "ograve" => 444, "thorn" => 500, "degree" => 400, "minus" => 606, 
+    "yen" => 500, "space" => 250, "registered" => 747, 
+    "questiondown" => 500, "Aring" => 722, "percent" => 889, 
+    "emdash" => 1000, "six" => 500, "Agrave" => 722, 
+    "paragraph" => 500, "three" => 500, "numbersign" => 500, 
+    "two" => 500, "Igrave" => 333, "oacute" => 444, 
+    "ocircumflex" => 444, "A" => 722, "B" => 611, "C" => 667, 
+    "D" => 778, "E" => 611, "onequarter" => 750, "F" => 556, 
+    "G" => 722, "H" => 778, "I" => 333, "J" => 333, "K" => 667, 
+    "L" => 556, "backslash" => 606, "asciicircum" => 606, 
+    "periodcentered" => 250, "M" => 944, "N" => 778, "O" => 778, 
+    "P" => 611, "aring" => 444, "Q" => 778, "R" => 667, 
+    "Aacute" => 722, "caron" => 333, "S" => 556, "T" => 611, 
+    "grave" => 333, "U" => 778, "agrave" => 444, "V" => 722, 
+    "W" => 944, "equal" => 606, "question" => 500, "X" => 722, 
+    "Y" => 667, "Z" => 667, "bracketright" => 333, "Iacute" => 333, 
+    "ampersand" => 778, "four" => 500, "igrave" => 278, "a" => 444, 
+    "b" => 463, "c" => 407, "d" => 500, "plus" => 606, "e" => 389, 
+    "quotesinglbase" => 278, "f" => 278, "g" => 500, "bullet" => 500, 
+    "h" => 500, "i" => 278, "Oslash" => 778, "dagger" => 500, 
+    "j" => 278, "Yacute" => 667, "k" => 444, "l" => 278, "m" => 778, 
+    "n" => 556, "o" => 444, "ordfeminine" => 333, "ring" => 333, 
+    "p" => 500, "threesuperior" => 300, "q" => 463, "acute" => 333, 
+    "r" => 389, "aacute" => 444, "twosuperior" => 300, "s" => 389, 
+    "OE" => 1028, "t" => 333, "divide" => 606, "section" => 500, 
+    "u" => 556, "v" => 500, "w" => 722, "dieresis" => 333, "x" => 500, 
+    "y" => 500, "z" => 444, "iacute" => 278, "quotedblbase" => 500, 
+    "hungarumlaut" => 333, "quotedbl" => 500, "mu" => 556, 
+    "Scaron" => 556, "Lslash" => 556, "semicolon" => 250, 
+    "oslash" => 444, "florin" => 500, "yacute" => 500, "fi" => 528, 
+    "fl" => 545, "Acircumflex" => 722, "parenright" => 333, 
+    "Ecircumflex" => 611, "Icircumflex" => 333, "trademark" => 1000, 
+    "daggerdbl" => 500, "guillemotleft" => 500, "germandbls" => 500, 
+    "macron" => 333, "Otilde" => 778, "seven" => 500, 
+    "ellipsis" => 1000, "scaron" => 389, "ordmasculine" => 333, 
+    "AE" => 941, "Ucircumflex" => 778, "lslash" => 278, 
+    "dotlessi" => 278, "sterling" => 500, "quotedblleft" => 500, 
+    "hyphen" => 333, "guilsinglright" => 333, "quotesingle" => 333, 
+    "eight" => 500, "exclamdown" => 333, "acircumflex" => 444, 
+    "endash" => 500, "oe" => 669, "ecircumflex" => 389, 
+    "Adieresis" => 722, "copyright" => 747, "Egrave" => 611, 
+    "icircumflex" => 278, "slash" => 296, "braceright" => 333, 
+    "Edieresis" => 611, "quotedblright" => 500, "Idieresis" => 333, 
+    "otilde" => 444, "parenleft" => 333, "one" => 500, 
+    "Odieresis" => 778, "ucircumflex" => 556, "bracketleft" => 333, 
+    "Ugrave" => 778, "cent" => 500, "currency" => 500, 
+    "logicalnot" => 606, "quoteright" => 278, "Udieresis" => 778, 
+    "perthousand" => 1000, "Ydieresis" => 667, "Atilde" => 722, 
+    "breve" => 333, "bar" => 606, "fraction" => 167, "Eacute" => 611, 
+    "less" => 606, "adieresis" => 444, "guilsinglleft" => 333, 
+    "egrave" => 389, "exclam" => 333, "edieresis" => 389, 
+    "idieresis" => 278, "Eth" => 778, "period" => 250, "ae" => 638, 
+    "asterisk" => 389, "odieresis" => 444, "Uacute" => 778, 
+    "ugrave" => 556, "five" => 500, "nine" => 500, "greater" => 606, 
+    "udieresis" => 556, "Zcaron" => 667, "threequarters" => 750, 
+    "guillemotright" => 500, "Ccedilla" => 667, "ydieresis" => 500, 
+    "tilde" => 333, "atilde" => 444, "at" => 747, "brokenbar" => 606, 
+    "eacute" => 389, "quoteleft" => 278, "underscore" => 500, 
+    "onesuperior" => 300, 
+  }
+);
+1;
diff --git a/doc/metrics/psyr.ph b/doc/metrics/psyr.ph
new file mode 100644 (file)
index 0000000..86dd97b
--- /dev/null
@@ -0,0 +1,68 @@
+%PS_Symbol = (
+  name => 'Symbol',
+  widths => {
+    "multiply" => 549, "zero" => 500, "bracketleftex" => 384, 
+    "partialdiff" => 494, "alpha" => 631, "angle" => 768, 
+    "arrowdblleft" => 987, "braceleft" => 480, "union" => 768, 
+    "infinity" => 713, "comma" => 250, "copyrightsans" => 790, 
+    "plusminus" => 549, "arrowup" => 603, "parenrightex" => 384, 
+    "Rfraktur" => 795, "apple" => 790, "Zeta" => 611, 
+    "parenleftbt" => 384, "braceex" => 494, "notelement" => 713, 
+    "colon" => 278, "beta" => 549, "braceleftbt" => 494, 
+    "Lambda" => 686, "Phi" => 763, "arrowdblup" => 603, 
+    "arrowdown" => 603, "Ifraktur" => 686, "degree" => 400, 
+    "space" => 250, "minus" => 549, "Iota" => 333, 
+    "perpendicular" => 658, "radical" => 549, "asteriskmath" => 500, 
+    "Sigma" => 592, "percent" => 833, "approxequal" => 549, 
+    "minute" => 247, "zeta" => 494, "six" => 500, "circleplus" => 768, 
+    "Omicron" => 722, "three" => 500, "numbersign" => 500, 
+    "two" => 500, "weierstrass" => 987, "summation" => 713, 
+    "bracketrighttp" => 384, "carriagereturn" => 658, "lambda" => 549, 
+    "phi" => 521, "suchthat" => 439, "arrowvertex" => 603, 
+    "aleph" => 823, "Delta" => 612, "Tau" => 611, "spade" => 753, 
+    "iota" => 329, "logicaland" => 603, "sigma" => 603, 
+    "propersuperset" => 713, "arrowhorizex" => 1000, 
+    "bracketrightex" => 384, "omicron" => 549, "equal" => 549, 
+    "question" => 444, "Epsilon" => 611, "bracketright" => 333, 
+    "emptyset" => 823, "ampersand" => 778, "diamond" => 753, 
+    "four" => 500, "Mu" => 889, "plus" => 549, "parenlefttp" => 384, 
+    "club" => 753, "bullet" => 460, "proportional" => 713, 
+    "Omega" => 768, "tau" => 439, "delta" => 494, "Upsilon" => 690, 
+    "bracelefttp" => 494, "copyrightserif" => 790, "heart" => 753, 
+    "bracerightmid" => 494, "divide" => 549, "arrowleft" => 987, 
+    "epsilon" => 439, "logicalor" => 603, "second" => 411, 
+    "parenleftex" => 384, "mu" => 576, "greaterequal" => 549, 
+    "Nu" => 722, "therefore" => 863, "notsubset" => 713, 
+    "semicolon" => 278, "omega" => 686, "arrowdblboth" => 1042, 
+    "element" => 713, "existential" => 549, "upsilon" => 576, 
+    "florin" => 500, "integralbt" => 686, "Psi" => 795, 
+    "lessequal" => 549, "bracerightbt" => 494, "phi1" => 603, 
+    "lozenge" => 494, "trademarkserif" => 890, "parenright" => 333, 
+    "bracketleftbt" => 384, "reflexsuperset" => 713, "seven" => 500, 
+    "braceleftmid" => 494, "sigma1" => 439, "Gamma" => 603, 
+    "nu" => 521, "angleright" => 329, "ellipsis" => 1000, "Rho" => 556, 
+    "notequal" => 549, "parenrightbt" => 384, "psi" => 686, 
+    "radicalex" => 500, "eight" => 500, "angleleft" => 329, 
+    "equivalence" => 549, "arrowdbldown" => 603, "congruent" => 549, 
+    "Theta" => 741, "intersection" => 768, "universal" => 713, 
+    "Pi" => 768, "arrowdblright" => 987, "slash" => 278, 
+    "braceright" => 480, "reflexsubset" => 713, "registerserif" => 790, 
+    "Xi" => 645, "parenleft" => 333, "one" => 500, "gamma" => 411, 
+    "bracketleft" => 333, "theta1" => 631, "rho" => 549, 
+    "logicalnot" => 713, "Kappa" => 722, "similar" => 549, 
+    "circlemultiply" => 768, "Chi" => 722, "bar" => 200, 
+    "theta" => 521, "fraction" => 167, "less" => 549, "pi" => 549, 
+    "integraltp" => 686, "registersans" => 790, "Eta" => 722, 
+    "exclam" => 333, "omega1" => 713, "Upsilon1" => 620, 
+    "bracerighttp" => 494, "product" => 823, "xi" => 493, 
+    "period" => 250, "Alpha" => 722, "arrowright" => 987, 
+    "five" => 500, "nine" => 500, "greater" => 549, 
+    "bracketlefttp" => 384, "kappa" => 549, "gradient" => 713, 
+    "propersubset" => 713, "bracketrightbt" => 384, 
+    "trademarksans" => 786, "dotmath" => 250, "integralex" => 686, 
+    "chi" => 549, "integral" => 274, "parenrighttp" => 384, 
+    "arrowboth" => 1042, "underscore" => 500, "eta" => 603, 
+    "Beta" => 667, 
+  }
+);
+1;
diff --git a/doc/metrics/ptmb8a.ph b/doc/metrics/ptmb8a.ph
new file mode 100644 (file)
index 0000000..5cf9564
--- /dev/null
@@ -0,0 +1,72 @@
+%PS_Times_Bold = (
+  name => 'Times-Bold',
+  widths => {
+    "multiply" => 570, "Ntilde" => 722, "zero" => 500, "eth" => 500, 
+    "Ograve" => 778, "uacute" => 556, "braceleft" => 394, 
+    "Thorn" => 611, "zcaron" => 444, "comma" => 250, "cedilla" => 333, 
+    "plusminus" => 570, "ccedilla" => 444, "circumflex" => 333, 
+    "dotaccent" => 333, "asciitilde" => 520, "colon" => 333, 
+    "onehalf" => 750, "dollar" => 500, "ntilde" => 556, 
+    "Oacute" => 778, "Ocircumflex" => 778, "ogonek" => 333, 
+    "ograve" => 500, "thorn" => 556, "degree" => 400, "minus" => 570, 
+    "yen" => 500, "space" => 250, "registered" => 747, 
+    "questiondown" => 500, "Aring" => 722, "percent" => 1000, 
+    "emdash" => 1000, "six" => 500, "Agrave" => 722, 
+    "paragraph" => 540, "three" => 500, "numbersign" => 500, 
+    "two" => 500, "Igrave" => 389, "oacute" => 500, 
+    "ocircumflex" => 500, "A" => 722, "B" => 667, "C" => 722, 
+    "D" => 722, "E" => 667, "onequarter" => 750, "F" => 611, 
+    "G" => 778, "H" => 778, "I" => 389, "J" => 500, "K" => 778, 
+    "L" => 667, "backslash" => 278, "asciicircum" => 581, 
+    "periodcentered" => 250, "M" => 944, "N" => 722, "O" => 778, 
+    "P" => 611, "aring" => 500, "Q" => 778, "R" => 722, 
+    "Aacute" => 722, "caron" => 333, "S" => 556, "T" => 667, 
+    "grave" => 333, "U" => 722, "agrave" => 500, "V" => 722, 
+    "W" => 1000, "equal" => 570, "question" => 500, "X" => 722, 
+    "Y" => 722, "Z" => 667, "bracketright" => 333, "Iacute" => 389, 
+    "ampersand" => 833, "four" => 500, "igrave" => 278, "a" => 500, 
+    "b" => 556, "c" => 444, "d" => 556, "plus" => 570, "e" => 444, 
+    "quotesinglbase" => 333, "f" => 333, "g" => 500, "bullet" => 350, 
+    "h" => 556, "i" => 278, "Oslash" => 778, "dagger" => 500, 
+    "j" => 333, "Yacute" => 722, "k" => 556, "l" => 278, "m" => 833, 
+    "n" => 556, "o" => 500, "ordfeminine" => 300, "ring" => 333, 
+    "p" => 556, "threesuperior" => 300, "q" => 556, "acute" => 333, 
+    "r" => 444, "aacute" => 500, "twosuperior" => 300, "s" => 389, 
+    "OE" => 1000, "t" => 333, "divide" => 570, "section" => 500, 
+    "u" => 556, "v" => 500, "w" => 722, "dieresis" => 333, "x" => 500, 
+    "y" => 500, "z" => 444, "iacute" => 278, "quotedblbase" => 500, 
+    "hungarumlaut" => 333, "quotedbl" => 555, "mu" => 556, 
+    "Scaron" => 556, "Lslash" => 667, "semicolon" => 333, 
+    "oslash" => 500, "florin" => 500, "yacute" => 500, "fi" => 556, 
+    "fl" => 556, "Acircumflex" => 722, "parenright" => 333, 
+    "Ecircumflex" => 667, "Icircumflex" => 389, "trademark" => 1000, 
+    "daggerdbl" => 500, "guillemotleft" => 500, "germandbls" => 556, 
+    "macron" => 333, "Otilde" => 778, "seven" => 500, 
+    "ellipsis" => 1000, "scaron" => 389, "ordmasculine" => 330, 
+    "AE" => 1000, "Ucircumflex" => 722, "lslash" => 278, 
+    "dotlessi" => 278, "sterling" => 500, "quotedblleft" => 500, 
+    "hyphen" => 333, "guilsinglright" => 333, "quotesingle" => 278, 
+    "eight" => 500, "exclamdown" => 333, "acircumflex" => 500, 
+    "endash" => 500, "oe" => 722, "ecircumflex" => 444, 
+    "Adieresis" => 722, "copyright" => 747, "Egrave" => 667, 
+    "icircumflex" => 278, "slash" => 278, "braceright" => 394, 
+    "Edieresis" => 667, "quotedblright" => 500, "Idieresis" => 389, 
+    "otilde" => 500, "parenleft" => 333, "one" => 500, 
+    "Odieresis" => 778, "ucircumflex" => 556, "bracketleft" => 333, 
+    "Ugrave" => 722, "cent" => 500, "currency" => 500, 
+    "logicalnot" => 570, "quoteright" => 333, "Udieresis" => 722, 
+    "perthousand" => 1000, "Ydieresis" => 722, "Atilde" => 722, 
+    "breve" => 333, "bar" => 220, "fraction" => 167, "Eacute" => 667, 
+    "less" => 570, "adieresis" => 500, "guilsinglleft" => 333, 
+    "egrave" => 444, "exclam" => 333, "edieresis" => 444, 
+    "idieresis" => 278, "Eth" => 722, "period" => 250, "ae" => 722, 
+    "asterisk" => 500, "odieresis" => 500, "Uacute" => 722, 
+    "ugrave" => 556, "five" => 500, "nine" => 500, "greater" => 570, 
+    "udieresis" => 556, "Zcaron" => 667, "threequarters" => 750, 
+    "guillemotright" => 500, "Ccedilla" => 722, "ydieresis" => 500, 
+    "tilde" => 333, "atilde" => 500, "at" => 930, "brokenbar" => 220, 
+    "eacute" => 444, "quoteleft" => 333, "underscore" => 500, 
+    "onesuperior" => 300, 
+  }
+);
+1;
diff --git a/doc/metrics/ptmbi8a.ph b/doc/metrics/ptmbi8a.ph
new file mode 100644 (file)
index 0000000..ada7e23
--- /dev/null
@@ -0,0 +1,72 @@
+%PS_Times_BoldItalic = (
+  name => 'Times-BoldItalic',
+  widths => {
+    "multiply" => 570, "Ntilde" => 722, "zero" => 500, "eth" => 500, 
+    "Ograve" => 722, "uacute" => 556, "braceleft" => 348, 
+    "Thorn" => 611, "zcaron" => 389, "comma" => 250, "cedilla" => 333, 
+    "plusminus" => 570, "ccedilla" => 444, "circumflex" => 333, 
+    "dotaccent" => 333, "asciitilde" => 570, "colon" => 333, 
+    "onehalf" => 750, "dollar" => 500, "ntilde" => 556, 
+    "Oacute" => 722, "Ocircumflex" => 722, "ogonek" => 333, 
+    "ograve" => 500, "thorn" => 500, "degree" => 400, "minus" => 606, 
+    "yen" => 500, "space" => 250, "registered" => 747, 
+    "questiondown" => 500, "Aring" => 667, "percent" => 833, 
+    "emdash" => 1000, "six" => 500, "Agrave" => 667, 
+    "paragraph" => 500, "three" => 500, "numbersign" => 500, 
+    "two" => 500, "Igrave" => 389, "oacute" => 500, 
+    "ocircumflex" => 500, "A" => 667, "B" => 667, "C" => 667, 
+    "D" => 722, "E" => 667, "onequarter" => 750, "F" => 667, 
+    "G" => 722, "H" => 778, "I" => 389, "J" => 500, "K" => 667, 
+    "L" => 611, "backslash" => 278, "asciicircum" => 570, 
+    "periodcentered" => 250, "M" => 889, "N" => 722, "O" => 722, 
+    "P" => 611, "aring" => 500, "Q" => 722, "R" => 667, 
+    "Aacute" => 667, "caron" => 333, "S" => 556, "T" => 611, 
+    "grave" => 333, "U" => 722, "agrave" => 500, "V" => 667, 
+    "W" => 889, "equal" => 570, "question" => 500, "X" => 667, 
+    "Y" => 611, "Z" => 611, "bracketright" => 333, "Iacute" => 389, 
+    "ampersand" => 778, "four" => 500, "igrave" => 278, "a" => 500, 
+    "b" => 500, "c" => 444, "d" => 500, "plus" => 570, "e" => 444, 
+    "quotesinglbase" => 333, "f" => 333, "g" => 500, "bullet" => 350, 
+    "h" => 556, "i" => 278, "Oslash" => 722, "dagger" => 500, 
+    "j" => 278, "Yacute" => 611, "k" => 500, "l" => 278, "m" => 778, 
+    "n" => 556, "o" => 500, "ordfeminine" => 266, "ring" => 333, 
+    "p" => 500, "threesuperior" => 300, "q" => 500, "acute" => 333, 
+    "r" => 389, "aacute" => 500, "twosuperior" => 300, "s" => 389, 
+    "OE" => 944, "t" => 278, "divide" => 570, "section" => 500, 
+    "u" => 556, "v" => 444, "w" => 667, "dieresis" => 333, "x" => 500, 
+    "y" => 444, "z" => 389, "iacute" => 278, "quotedblbase" => 500, 
+    "hungarumlaut" => 333, "quotedbl" => 555, "mu" => 576, 
+    "Scaron" => 556, "Lslash" => 611, "semicolon" => 333, 
+    "oslash" => 500, "florin" => 500, "yacute" => 444, "fi" => 556, 
+    "fl" => 556, "Acircumflex" => 667, "parenright" => 333, 
+    "Ecircumflex" => 667, "Icircumflex" => 389, "trademark" => 1000, 
+    "daggerdbl" => 500, "guillemotleft" => 500, "germandbls" => 500, 
+    "macron" => 333, "Otilde" => 722, "seven" => 500, 
+    "ellipsis" => 1000, "scaron" => 389, "ordmasculine" => 300, 
+    "AE" => 944, "Ucircumflex" => 722, "lslash" => 278, 
+    "dotlessi" => 278, "sterling" => 500, "quotedblleft" => 500, 
+    "hyphen" => 333, "guilsinglright" => 333, "quotesingle" => 278, 
+    "eight" => 500, "exclamdown" => 389, "acircumflex" => 500, 
+    "endash" => 500, "oe" => 722, "ecircumflex" => 444, 
+    "Adieresis" => 667, "copyright" => 747, "Egrave" => 667, 
+    "icircumflex" => 278, "slash" => 278, "braceright" => 348, 
+    "Edieresis" => 667, "quotedblright" => 500, "Idieresis" => 389, 
+    "otilde" => 500, "parenleft" => 333, "one" => 500, 
+    "Odieresis" => 722, "ucircumflex" => 556, "bracketleft" => 333, 
+    "Ugrave" => 722, "cent" => 500, "currency" => 500, 
+    "logicalnot" => 606, "quoteright" => 333, "Udieresis" => 722, 
+    "perthousand" => 1000, "Ydieresis" => 611, "Atilde" => 667, 
+    "breve" => 333, "bar" => 220, "fraction" => 167, "Eacute" => 667, 
+    "less" => 570, "adieresis" => 500, "guilsinglleft" => 333, 
+    "egrave" => 444, "exclam" => 389, "edieresis" => 444, 
+    "idieresis" => 278, "Eth" => 722, "period" => 250, "ae" => 722, 
+    "asterisk" => 500, "odieresis" => 500, "Uacute" => 722, 
+    "ugrave" => 556, "five" => 500, "nine" => 500, "greater" => 570, 
+    "udieresis" => 556, "Zcaron" => 611, "threequarters" => 750, 
+    "guillemotright" => 500, "Ccedilla" => 667, "ydieresis" => 444, 
+    "tilde" => 333, "atilde" => 500, "at" => 832, "brokenbar" => 220, 
+    "eacute" => 444, "quoteleft" => 333, "underscore" => 500, 
+    "onesuperior" => 300, 
+  }
+);
+1;
diff --git a/doc/metrics/ptmr8a.ph b/doc/metrics/ptmr8a.ph
new file mode 100644 (file)
index 0000000..a25fd3e
--- /dev/null
@@ -0,0 +1,72 @@
+%PS_Times_Roman = (
+  name => 'Times-Roman',
+  widths => {
+    "multiply" => 564, "Ntilde" => 722, "zero" => 500, "eth" => 500, 
+    "Ograve" => 722, "uacute" => 500, "braceleft" => 480, 
+    "Thorn" => 556, "zcaron" => 444, "comma" => 250, "cedilla" => 333, 
+    "plusminus" => 564, "ccedilla" => 444, "circumflex" => 333, 
+    "dotaccent" => 333, "asciitilde" => 541, "colon" => 278, 
+    "onehalf" => 750, "dollar" => 500, "ntilde" => 500, 
+    "Oacute" => 722, "Ocircumflex" => 722, "ogonek" => 333, 
+    "ograve" => 500, "thorn" => 500, "degree" => 400, "minus" => 564, 
+    "yen" => 500, "space" => 250, "registered" => 760, 
+    "questiondown" => 444, "Aring" => 722, "percent" => 833, 
+    "emdash" => 1000, "six" => 500, "Agrave" => 722, 
+    "paragraph" => 453, "three" => 500, "numbersign" => 500, 
+    "two" => 500, "Igrave" => 333, "oacute" => 500, 
+    "ocircumflex" => 500, "A" => 722, "B" => 667, "C" => 667, 
+    "D" => 722, "E" => 611, "onequarter" => 750, "F" => 556, 
+    "G" => 722, "H" => 722, "I" => 333, "J" => 389, "K" => 722, 
+    "L" => 611, "backslash" => 278, "asciicircum" => 469, 
+    "periodcentered" => 250, "M" => 889, "N" => 722, "O" => 722, 
+    "P" => 556, "aring" => 444, "Q" => 722, "R" => 667, 
+    "Aacute" => 722, "caron" => 333, "S" => 556, "T" => 611, 
+    "grave" => 333, "U" => 722, "agrave" => 444, "V" => 722, 
+    "W" => 944, "equal" => 564, "question" => 444, "X" => 722, 
+    "Y" => 722, "Z" => 611, "bracketright" => 333, "Iacute" => 333, 
+    "ampersand" => 778, "four" => 500, "igrave" => 278, "a" => 444, 
+    "b" => 500, "c" => 444, "d" => 500, "plus" => 564, "e" => 444, 
+    "quotesinglbase" => 333, "f" => 333, "g" => 500, "bullet" => 350, 
+    "h" => 500, "i" => 278, "Oslash" => 722, "dagger" => 500, 
+    "j" => 278, "Yacute" => 722, "k" => 500, "l" => 278, "m" => 778, 
+    "n" => 500, "o" => 500, "ordfeminine" => 276, "ring" => 333, 
+    "p" => 500, "threesuperior" => 300, "q" => 500, "acute" => 333, 
+    "r" => 333, "aacute" => 444, "twosuperior" => 300, "s" => 389, 
+    "OE" => 889, "t" => 278, "divide" => 564, "section" => 500, 
+    "u" => 500, "v" => 500, "w" => 722, "dieresis" => 333, "x" => 500, 
+    "y" => 500, "z" => 444, "iacute" => 278, "quotedblbase" => 444, 
+    "hungarumlaut" => 333, "quotedbl" => 408, "mu" => 500, 
+    "Scaron" => 556, "Lslash" => 611, "semicolon" => 278, 
+    "oslash" => 500, "florin" => 500, "yacute" => 500, "fi" => 556, 
+    "fl" => 556, "Acircumflex" => 722, "parenright" => 333, 
+    "Ecircumflex" => 611, "Icircumflex" => 333, "trademark" => 980, 
+    "daggerdbl" => 500, "guillemotleft" => 500, "germandbls" => 500, 
+    "macron" => 333, "Otilde" => 722, "seven" => 500, 
+    "ellipsis" => 1000, "scaron" => 389, "ordmasculine" => 310, 
+    "AE" => 889, "Ucircumflex" => 722, "lslash" => 278, 
+    "dotlessi" => 278, "sterling" => 500, "quotedblleft" => 444, 
+    "hyphen" => 333, "guilsinglright" => 333, "quotesingle" => 180, 
+    "eight" => 500, "exclamdown" => 333, "acircumflex" => 444, 
+    "endash" => 500, "oe" => 722, "ecircumflex" => 444, 
+    "Adieresis" => 722, "copyright" => 760, "Egrave" => 611, 
+    "icircumflex" => 278, "slash" => 278, "braceright" => 480, 
+    "Edieresis" => 611, "quotedblright" => 444, "Idieresis" => 333, 
+    "otilde" => 500, "parenleft" => 333, "one" => 500, 
+    "Odieresis" => 722, "ucircumflex" => 500, "bracketleft" => 333, 
+    "Ugrave" => 722, "cent" => 500, "currency" => 500, 
+    "logicalnot" => 564, "quoteright" => 333, "Udieresis" => 722, 
+    "perthousand" => 1000, "Ydieresis" => 722, "Atilde" => 722, 
+    "breve" => 333, "bar" => 200, "fraction" => 167, "Eacute" => 611, 
+    "less" => 564, "adieresis" => 444, "guilsinglleft" => 333, 
+    "egrave" => 444, "exclam" => 333, "edieresis" => 444, 
+    "idieresis" => 278, "Eth" => 722, "period" => 250, "ae" => 667, 
+    "asterisk" => 500, "odieresis" => 500, "Uacute" => 722, 
+    "ugrave" => 500, "five" => 500, "nine" => 500, "greater" => 564, 
+    "udieresis" => 500, "Zcaron" => 611, "threequarters" => 750, 
+    "guillemotright" => 500, "Ccedilla" => 667, "ydieresis" => 500, 
+    "tilde" => 333, "atilde" => 444, "at" => 921, "brokenbar" => 200, 
+    "eacute" => 444, "quoteleft" => 333, "underscore" => 500, 
+    "onesuperior" => 300, 
+  }
+);
+1;
diff --git a/doc/metrics/ptmri8a.ph b/doc/metrics/ptmri8a.ph
new file mode 100644 (file)
index 0000000..2edb4ff
--- /dev/null
@@ -0,0 +1,71 @@
+%PS_Times_Italic = (
+  name => 'Times-Italic',
+  widths => {
+    "multiply" => 675, "Ntilde" => 667, "zero" => 500, "eth" => 500, 
+    "Ograve" => 722, "uacute" => 500, "braceleft" => 400, 
+    "Thorn" => 611, "zcaron" => 389, "comma" => 250, "cedilla" => 333, 
+    "plusminus" => 675, "ccedilla" => 444, "circumflex" => 333, 
+    "dotaccent" => 333, "asciitilde" => 541, "colon" => 333, 
+    "onehalf" => 750, "dollar" => 500, "ntilde" => 500, 
+    "Oacute" => 722, "Ocircumflex" => 722, "ogonek" => 333, 
+    "ograve" => 500, "thorn" => 500, "degree" => 400, "minus" => 675, 
+    "yen" => 500, "space" => 250, "registered" => 760, 
+    "questiondown" => 500, "Aring" => 611, "percent" => 833, 
+    "emdash" => 889, "six" => 500, "Agrave" => 611, "paragraph" => 523, 
+    "three" => 500, "numbersign" => 500, "two" => 500, "Igrave" => 333, 
+    "oacute" => 500, "ocircumflex" => 500, "A" => 611, "B" => 611, 
+    "C" => 667, "D" => 722, "E" => 611, "onequarter" => 750, 
+    "F" => 611, "G" => 722, "H" => 722, "I" => 333, "J" => 444, 
+    "K" => 667, "L" => 556, "backslash" => 278, "asciicircum" => 422, 
+    "periodcentered" => 250, "M" => 833, "N" => 667, "O" => 722, 
+    "P" => 611, "aring" => 500, "Q" => 722, "R" => 611, 
+    "Aacute" => 611, "caron" => 333, "S" => 500, "T" => 556, 
+    "grave" => 333, "U" => 722, "agrave" => 500, "V" => 611, 
+    "W" => 833, "equal" => 675, "question" => 500, "X" => 611, 
+    "Y" => 556, "Z" => 556, "bracketright" => 389, "Iacute" => 333, 
+    "ampersand" => 778, "four" => 500, "igrave" => 278, "a" => 500, 
+    "b" => 500, "c" => 444, "d" => 500, "plus" => 675, "e" => 444, 
+    "quotesinglbase" => 333, "f" => 278, "g" => 500, "bullet" => 350, 
+    "h" => 500, "i" => 278, "Oslash" => 722, "dagger" => 500, 
+    "j" => 278, "Yacute" => 556, "k" => 444, "l" => 278, "m" => 722, 
+    "n" => 500, "o" => 500, "ordfeminine" => 276, "ring" => 333, 
+    "p" => 500, "threesuperior" => 300, "q" => 500, "acute" => 333, 
+    "r" => 389, "aacute" => 500, "twosuperior" => 300, "s" => 389, 
+    "OE" => 944, "t" => 278, "divide" => 675, "section" => 500, 
+    "u" => 500, "v" => 444, "w" => 667, "dieresis" => 333, "x" => 444, 
+    "y" => 444, "z" => 389, "iacute" => 278, "quotedblbase" => 556, 
+    "hungarumlaut" => 333, "quotedbl" => 420, "mu" => 500, 
+    "Scaron" => 500, "Lslash" => 556, "semicolon" => 333, 
+    "oslash" => 500, "florin" => 500, "yacute" => 444, "fi" => 500, 
+    "fl" => 500, "Acircumflex" => 611, "parenright" => 333, 
+    "Ecircumflex" => 611, "Icircumflex" => 333, "trademark" => 980, 
+    "daggerdbl" => 500, "guillemotleft" => 500, "germandbls" => 500, 
+    "macron" => 333, "Otilde" => 722, "seven" => 500, 
+    "ellipsis" => 889, "scaron" => 389, "ordmasculine" => 310, 
+    "AE" => 889, "Ucircumflex" => 722, "lslash" => 278, 
+    "dotlessi" => 278, "sterling" => 500, "quotedblleft" => 556, 
+    "hyphen" => 333, "guilsinglright" => 333, "quotesingle" => 214, 
+    "eight" => 500, "exclamdown" => 389, "acircumflex" => 500, 
+    "endash" => 500, "oe" => 667, "ecircumflex" => 444, 
+    "Adieresis" => 611, "copyright" => 760, "Egrave" => 611, 
+    "icircumflex" => 278, "slash" => 278, "braceright" => 400, 
+    "Edieresis" => 611, "quotedblright" => 556, "Idieresis" => 333, 
+    "otilde" => 500, "parenleft" => 333, "one" => 500, 
+    "Odieresis" => 722, "ucircumflex" => 500, "bracketleft" => 389, 
+    "Ugrave" => 722, "cent" => 500, "currency" => 500, 
+    "logicalnot" => 675, "quoteright" => 333, "Udieresis" => 722, 
+    "perthousand" => 1000, "Ydieresis" => 556, "Atilde" => 611, 
+    "breve" => 333, "bar" => 275, "fraction" => 167, "Eacute" => 611, 
+    "less" => 675, "adieresis" => 500, "guilsinglleft" => 333, 
+    "egrave" => 444, "exclam" => 333, "edieresis" => 444, 
+    "idieresis" => 278, "Eth" => 722, "period" => 250, "ae" => 667, 
+    "asterisk" => 500, "odieresis" => 500, "Uacute" => 722, 
+    "ugrave" => 500, "five" => 500, "nine" => 500, "greater" => 675, 
+    "udieresis" => 500, "Zcaron" => 556, "threequarters" => 750, 
+    "guillemotright" => 500, "Ccedilla" => 667, "ydieresis" => 444, 
+    "tilde" => 333, "atilde" => 500, "at" => 920, "brokenbar" => 275, 
+    "eacute" => 444, "quoteleft" => 333, "underscore" => 500, 
+    "onesuperior" => 300, 
+  }
+);
+1;
diff --git a/doc/metrics/putb8a.ph b/doc/metrics/putb8a.ph
new file mode 100644 (file)
index 0000000..fe8b24d
--- /dev/null
@@ -0,0 +1,72 @@
+%PS_Utopia_Bold = (
+  name => 'Utopia-Bold',
+  widths => {
+    "Ntilde" => 739, "multiply" => 600, "zero" => 560, "eth" => 585, 
+    "Ograve" => 768, "uacute" => 629, "braceleft" => 365, 
+    "Thorn" => 640, "zcaron" => 483, "comma" => 280, "cedilla" => 430, 
+    "plusminus" => 600, "ccedilla" => 494, "circumflex" => 430, 
+    "dotaccent" => 430, "asciitilde" => 600, "colon" => 280, 
+    "onehalf" => 900, "dollar" => 560, "ntilde" => 638, 
+    "Ocircumflex" => 768, "Oacute" => 768, "ogonek" => 430, 
+    "ograve" => 585, "thorn" => 609, "degree" => 396, "minus" => 600, 
+    "yen" => 560, "space" => 210, "registered" => 800, 
+    "questiondown" => 456, "Aring" => 644, "percent" => 887, 
+    "emdash" => 1000, "six" => 560, "Agrave" => 644, 
+    "paragraph" => 552, "three" => 560, "numbersign" => 560, 
+    "two" => 560, "Igrave" => 384, "ocircumflex" => 585, 
+    "oacute" => 585, "A" => 644, "B" => 683, "C" => 689, "D" => 777, 
+    "E" => 629, "onequarter" => 900, "F" => 593, "G" => 726, 
+    "H" => 807, "I" => 384, "J" => 386, "K" => 707, "L" => 585, 
+    "backslash" => 379, "asciicircum" => 600, "periodcentered" => 280, 
+    "M" => 918, "N" => 739, "O" => 768, "P" => 650, "aring" => 544, 
+    "Q" => 768, "R" => 684, "Aacute" => 644, "caron" => 430, 
+    "S" => 561, "T" => 624, "grave" => 430, "U" => 786, 
+    "agrave" => 544, "V" => 645, "W" => 933, "equal" => 600, 
+    "question" => 456, "X" => 634, "Y" => 617, "Z" => 614, 
+    "bracketright" => 335, "Iacute" => 384, "ampersand" => 748, 
+    "four" => 560, "igrave" => 316, "a" => 544, "b" => 605, "c" => 494, 
+    "d" => 605, "plus" => 600, "e" => 519, "quotesinglbase" => 252, 
+    "f" => 342, "g" => 533, "bullet" => 455, "h" => 631, "i" => 316, 
+    "Oslash" => 768, "dagger" => 510, "j" => 316, "Yacute" => 617, 
+    "k" => 582, "l" => 309, "m" => 948, "n" => 638, "o" => 585, 
+    "ordfeminine" => 405, "ring" => 430, "p" => 615, 
+    "threesuperior" => 402, "q" => 597, "acute" => 430, "r" => 440, 
+    "aacute" => 544, "twosuperior" => 402, "s" => 446, "OE" => 1049, 
+    "t" => 370, "divide" => 600, "section" => 566, "u" => 629, 
+    "v" => 520, "w" => 774, "dieresis" => 430, "x" => 522, "y" => 524, 
+    "z" => 483, "iacute" => 316, "quotedblbase" => 473, 
+    "hungarumlaut" => 430, "quotedbl" => 473, "mu" => 629, 
+    "Scaron" => 561, "Lslash" => 591, "semicolon" => 280, 
+    "oslash" => 585, "florin" => 560, "yacute" => 524, "fi" => 639, 
+    "fl" => 639, "Acircumflex" => 644, "parenright" => 365, 
+    "Ecircumflex" => 629, "Icircumflex" => 384, "trademark" => 1090, 
+    "daggerdbl" => 486, "guillemotleft" => 487, "germandbls" => 662, 
+    "macron" => 430, "Otilde" => 768, "seven" => 560, 
+    "ellipsis" => 1000, "scaron" => 446, "ordmasculine" => 427, 
+    "AE" => 879, "Ucircumflex" => 786, "lslash" => 321, 
+    "dotlessi" => 316, "sterling" => 560, "quotedblleft" => 473, 
+    "hyphen" => 392, "guilsinglright" => 287, "quotesingle" => 252, 
+    "eight" => 560, "exclamdown" => 278, "acircumflex" => 544, 
+    "endash" => 500, "oe" => 866, "ecircumflex" => 519, 
+    "copyright" => 800, "Adieresis" => 644, "Egrave" => 629, 
+    "icircumflex" => 316, "slash" => 378, "braceright" => 365, 
+    "Edieresis" => 629, "quotedblright" => 473, "Idieresis" => 384, 
+    "otilde" => 585, "parenleft" => 365, "one" => 560, 
+    "ucircumflex" => 629, "Odieresis" => 768, "bracketleft" => 335, 
+    "Ugrave" => 786, "cent" => 560, "currency" => 560, 
+    "logicalnot" => 600, "quoteright" => 252, "Udieresis" => 786, 
+    "perthousand" => 1289, "Ydieresis" => 617, "Atilde" => 644, 
+    "breve" => 430, "bar" => 284, "fraction" => 100, "Eacute" => 629, 
+    "less" => 600, "adieresis" => 544, "guilsinglleft" => 287, 
+    "egrave" => 519, "exclam" => 278, "edieresis" => 519, "Eth" => 783, 
+    "idieresis" => 316, "period" => 280, "ae" => 806, 
+    "asterisk" => 442, "Uacute" => 786, "odieresis" => 585, 
+    "ugrave" => 629, "five" => 560, "nine" => 560, "greater" => 600, 
+    "udieresis" => 629, "Zcaron" => 614, "threequarters" => 900, 
+    "guillemotright" => 487, "Ccedilla" => 689, "ydieresis" => 524, 
+    "tilde" => 430, "atilde" => 544, "at" => 833, "brokenbar" => 284, 
+    "eacute" => 519, "quoteleft" => 252, "underscore" => 500, 
+    "onesuperior" => 402, 
+  }
+);
+1;
diff --git a/doc/metrics/putbi8a.ph b/doc/metrics/putbi8a.ph
new file mode 100644 (file)
index 0000000..aeb8174
--- /dev/null
@@ -0,0 +1,72 @@
+%PS_Utopia_BoldItalic = (
+  name => 'Utopia-BoldItalic',
+  widths => {
+    "Ntilde" => 741, "multiply" => 600, "zero" => 560, "eth" => 562, 
+    "Ograve" => 761, "uacute" => 634, "braceleft" => 340, 
+    "Thorn" => 629, "zcaron" => 466, "comma" => 280, "cedilla" => 400, 
+    "plusminus" => 600, "ccedilla" => 456, "circumflex" => 400, 
+    "dotaccent" => 402, "asciitilde" => 600, "colon" => 280, 
+    "onehalf" => 940, "dollar" => 560, "ntilde" => 635, 
+    "Ocircumflex" => 761, "Oacute" => 761, "ogonek" => 350, 
+    "ograve" => 562, "thorn" => 600, "degree" => 375, "minus" => 600, 
+    "yen" => 560, "space" => 210, "registered" => 824, 
+    "questiondown" => 454, "Aring" => 634, "percent" => 896, 
+    "emdash" => 1000, "six" => 560, "Agrave" => 634, 
+    "paragraph" => 580, "three" => 560, "numbersign" => 560, 
+    "two" => 560, "Igrave" => 386, "ocircumflex" => 562, 
+    "oacute" => 562, "A" => 634, "B" => 680, "C" => 672, "D" => 774, 
+    "E" => 622, "onequarter" => 940, "F" => 585, "G" => 726, 
+    "H" => 800, "I" => 386, "J" => 388, "K" => 688, "L" => 586, 
+    "backslash" => 460, "asciicircum" => 600, "periodcentered" => 280, 
+    "M" => 921, "N" => 741, "O" => 761, "P" => 660, "aring" => 596, 
+    "Q" => 761, "R" => 681, "Aacute" => 634, "caron" => 400, 
+    "S" => 551, "T" => 616, "grave" => 400, "U" => 776, 
+    "agrave" => 596, "V" => 630, "W" => 920, "equal" => 600, 
+    "question" => 454, "X" => 630, "Y" => 622, "Z" => 618, 
+    "bracketright" => 350, "Iacute" => 386, "ampersand" => 752, 
+    "four" => 560, "igrave" => 339, "a" => 596, "b" => 586, "c" => 456, 
+    "d" => 609, "plus" => 600, "e" => 476, "quotesinglbase" => 246, 
+    "f" => 348, "g" => 522, "bullet" => 465, "h" => 629, "i" => 339, 
+    "Oslash" => 761, "dagger" => 514, "j" => 333, "Yacute" => 622, 
+    "k" => 570, "l" => 327, "m" => 914, "n" => 635, "o" => 562, 
+    "ordfeminine" => 444, "ring" => 400, "p" => 606, 
+    "threesuperior" => 402, "q" => 584, "acute" => 400, "r" => 440, 
+    "aacute" => 596, "twosuperior" => 402, "s" => 417, "OE" => 1016, 
+    "t" => 359, "divide" => 600, "section" => 568, "u" => 634, 
+    "v" => 518, "w" => 795, "dieresis" => 400, "x" => 516, "y" => 489, 
+    "z" => 466, "iacute" => 339, "quotedblbase" => 455, 
+    "hungarumlaut" => 400, "quotedbl" => 455, "mu" => 634, 
+    "Scaron" => 551, "Lslash" => 592, "semicolon" => 280, 
+    "oslash" => 562, "florin" => 560, "yacute" => 489, "fi" => 651, 
+    "fl" => 652, "Acircumflex" => 634, "parenright" => 350, 
+    "Ecircumflex" => 622, "Icircumflex" => 386, "trademark" => 1100, 
+    "daggerdbl" => 490, "guillemotleft" => 560, "germandbls" => 628, 
+    "macron" => 400, "Otilde" => 761, "seven" => 560, 
+    "ellipsis" => 1000, "scaron" => 417, "ordmasculine" => 412, 
+    "AE" => 890, "Ucircumflex" => 776, "lslash" => 339, 
+    "dotlessi" => 339, "sterling" => 560, "quotedblleft" => 455, 
+    "hyphen" => 392, "guilsinglright" => 360, "quotesingle" => 246, 
+    "eight" => 560, "exclamdown" => 285, "acircumflex" => 596, 
+    "endash" => 500, "oe" => 811, "ecircumflex" => 476, 
+    "copyright" => 824, "Adieresis" => 634, "Egrave" => 622, 
+    "icircumflex" => 339, "slash" => 260, "braceright" => 340, 
+    "Edieresis" => 622, "quotedblright" => 455, "Idieresis" => 386, 
+    "otilde" => 562, "parenleft" => 350, "one" => 560, 
+    "ucircumflex" => 634, "Odieresis" => 761, "bracketleft" => 350, 
+    "Ugrave" => 776, "cent" => 560, "currency" => 560, 
+    "logicalnot" => 600, "quoteright" => 246, "Udieresis" => 776, 
+    "perthousand" => 1297, "Ydieresis" => 622, "Atilde" => 634, 
+    "breve" => 400, "bar" => 265, "fraction" => 100, "Eacute" => 622, 
+    "less" => 600, "adieresis" => 596, "guilsinglleft" => 360, 
+    "egrave" => 476, "exclam" => 285, "edieresis" => 476, "Eth" => 780, 
+    "idieresis" => 339, "period" => 280, "ae" => 789, 
+    "asterisk" => 500, "Uacute" => 776, "odieresis" => 562, 
+    "ugrave" => 634, "five" => 560, "nine" => 560, "greater" => 600, 
+    "udieresis" => 634, "Zcaron" => 618, "threequarters" => 940, 
+    "guillemotright" => 560, "Ccedilla" => 672, "ydieresis" => 489, 
+    "tilde" => 400, "atilde" => 596, "at" => 828, "brokenbar" => 265, 
+    "eacute" => 476, "quoteleft" => 246, "underscore" => 500, 
+    "onesuperior" => 402, 
+  }
+);
+1;
diff --git a/doc/metrics/putr8a.ph b/doc/metrics/putr8a.ph
new file mode 100644 (file)
index 0000000..7f305b8
--- /dev/null
@@ -0,0 +1,72 @@
+%PS_Utopia_Regular = (
+  name => 'Utopia-Regular',
+  widths => {
+    "Ntilde" => 780, "multiply" => 570, "zero" => 530, "eth" => 577, 
+    "Ograve" => 762, "uacute" => 606, "braceleft" => 340, 
+    "Thorn" => 593, "zcaron" => 480, "comma" => 265, "cedilla" => 400, 
+    "plusminus" => 570, "ccedilla" => 496, "circumflex" => 400, 
+    "dotaccent" => 400, "asciitilde" => 570, "colon" => 265, 
+    "onehalf" => 860, "dollar" => 530, "ntilde" => 619, 
+    "Ocircumflex" => 762, "Oacute" => 762, "ogonek" => 400, 
+    "ograve" => 577, "thorn" => 606, "degree" => 350, "minus" => 570, 
+    "yen" => 530, "space" => 225, "registered" => 818, 
+    "questiondown" => 389, "Aring" => 627, "percent" => 838, 
+    "emdash" => 1000, "six" => 530, "Agrave" => 635, 
+    "paragraph" => 555, "three" => 530, "numbersign" => 530, 
+    "two" => 530, "Igrave" => 349, "ocircumflex" => 577, 
+    "oacute" => 577, "A" => 635, "B" => 646, "C" => 684, "D" => 779, 
+    "E" => 606, "onequarter" => 860, "F" => 580, "G" => 734, 
+    "H" => 798, "I" => 349, "J" => 350, "K" => 658, "L" => 568, 
+    "backslash" => 460, "asciicircum" => 570, "periodcentered" => 265, 
+    "M" => 944, "N" => 780, "O" => 762, "P" => 600, "aring" => 523, 
+    "Q" => 762, "R" => 644, "Aacute" => 635, "caron" => 400, 
+    "S" => 541, "T" => 621, "grave" => 400, "U" => 791, 
+    "agrave" => 523, "V" => 634, "W" => 940, "equal" => 570, 
+    "question" => 389, "X" => 624, "Y" => 588, "Z" => 610, 
+    "bracketright" => 330, "Iacute" => 349, "ampersand" => 706, 
+    "four" => 530, "igrave" => 291, "a" => 523, "b" => 598, "c" => 496, 
+    "d" => 598, "plus" => 570, "e" => 514, "quotesinglbase" => 278, 
+    "f" => 319, "g" => 520, "bullet" => 409, "h" => 607, "i" => 291, 
+    "Oslash" => 762, "dagger" => 504, "j" => 280, "Yacute" => 588, 
+    "k" => 524, "l" => 279, "m" => 923, "n" => 619, "o" => 577, 
+    "ordfeminine" => 390, "ring" => 400, "p" => 608, 
+    "threesuperior" => 380, "q" => 591, "acute" => 400, "r" => 389, 
+    "aacute" => 523, "twosuperior" => 380, "s" => 436, "OE" => 1025, 
+    "t" => 344, "divide" => 570, "section" => 554, "u" => 606, 
+    "v" => 504, "w" => 768, "dieresis" => 400, "x" => 486, "y" => 506, 
+    "z" => 480, "iacute" => 291, "quotedblbase" => 458, 
+    "hungarumlaut" => 400, "quotedbl" => 458, "mu" => 606, 
+    "Scaron" => 541, "Lslash" => 574, "semicolon" => 265, 
+    "oslash" => 577, "florin" => 530, "yacute" => 506, "fi" => 610, 
+    "fl" => 610, "Acircumflex" => 635, "parenright" => 350, 
+    "Ecircumflex" => 606, "Icircumflex" => 349, "trademark" => 1100, 
+    "daggerdbl" => 488, "guillemotleft" => 442, "germandbls" => 601, 
+    "macron" => 400, "Otilde" => 762, "seven" => 530, 
+    "ellipsis" => 1000, "scaron" => 436, "ordmasculine" => 398, 
+    "AE" => 876, "Ucircumflex" => 791, "lslash" => 294, 
+    "dotlessi" => 291, "sterling" => 530, "quotedblleft" => 458, 
+    "hyphen" => 392, "guilsinglright" => 257, "quotesingle" => 278, 
+    "eight" => 530, "exclamdown" => 242, "acircumflex" => 523, 
+    "endash" => 500, "oe" => 882, "ecircumflex" => 514, 
+    "copyright" => 818, "Adieresis" => 635, "Egrave" => 606, 
+    "icircumflex" => 291, "slash" => 460, "braceright" => 340, 
+    "Edieresis" => 606, "quotedblright" => 458, "Idieresis" => 349, 
+    "otilde" => 577, "parenleft" => 350, "one" => 530, 
+    "ucircumflex" => 606, "Odieresis" => 762, "bracketleft" => 330, 
+    "Ugrave" => 791, "cent" => 530, "currency" => 530, 
+    "logicalnot" => 570, "quoteright" => 278, "Udieresis" => 791, 
+    "perthousand" => 1208, "Ydieresis" => 588, "Atilde" => 635, 
+    "breve" => 400, "bar" => 228, "fraction" => 150, "Eacute" => 606, 
+    "less" => 570, "adieresis" => 523, "guilsinglleft" => 257, 
+    "egrave" => 514, "exclam" => 242, "edieresis" => 514, "Eth" => 785, 
+    "idieresis" => 291, "period" => 265, "ae" => 797, 
+    "asterisk" => 412, "Uacute" => 791, "odieresis" => 577, 
+    "ugrave" => 606, "five" => 530, "nine" => 530, "greater" => 570, 
+    "udieresis" => 606, "Zcaron" => 610, "threequarters" => 860, 
+    "guillemotright" => 442, "Ccedilla" => 680, "ydieresis" => 506, 
+    "tilde" => 400, "atilde" => 523, "at" => 793, "brokenbar" => 228, 
+    "eacute" => 514, "quoteleft" => 278, "underscore" => 500, 
+    "onesuperior" => 380, 
+  }
+);
+1;
diff --git a/doc/metrics/putri8a.ph b/doc/metrics/putri8a.ph
new file mode 100644 (file)
index 0000000..7cb5321
--- /dev/null
@@ -0,0 +1,72 @@
+%PS_Utopia_Italic = (
+  name => 'Utopia-Italic',
+  widths => {
+    "Ntilde" => 763, "multiply" => 570, "zero" => 530, "eth" => 537, 
+    "Ograve" => 753, "uacute" => 618, "braceleft" => 340, 
+    "Thorn" => 604, "zcaron" => 468, "comma" => 265, "cedilla" => 400, 
+    "plusminus" => 570, "ccedilla" => 441, "circumflex" => 400, 
+    "dotaccent" => 402, "asciitilde" => 570, "colon" => 265, 
+    "onehalf" => 890, "dollar" => 530, "ntilde" => 618, 
+    "Ocircumflex" => 753, "Oacute" => 753, "ogonek" => 350, 
+    "ograve" => 537, "thorn" => 584, "degree" => 400, "minus" => 570, 
+    "yen" => 530, "space" => 225, "registered" => 836, 
+    "questiondown" => 425, "Aring" => 624, "percent" => 826, 
+    "emdash" => 1000, "six" => 530, "Agrave" => 624, 
+    "paragraph" => 560, "three" => 530, "numbersign" => 530, 
+    "two" => 530, "Igrave" => 345, "ocircumflex" => 537, 
+    "oacute" => 537, "A" => 624, "B" => 632, "C" => 661, "D" => 763, 
+    "E" => 596, "onequarter" => 890, "F" => 571, "G" => 709, 
+    "H" => 775, "I" => 345, "J" => 352, "K" => 650, "L" => 565, 
+    "backslash" => 390, "asciicircum" => 570, "periodcentered" => 265, 
+    "M" => 920, "N" => 763, "O" => 753, "P" => 614, "aring" => 561, 
+    "Q" => 753, "R" => 640, "Aacute" => 624, "caron" => 400, 
+    "S" => 533, "T" => 606, "grave" => 400, "U" => 794, 
+    "agrave" => 561, "V" => 637, "W" => 946, "equal" => 570, 
+    "question" => 425, "X" => 632, "Y" => 591, "Z" => 622, 
+    "bracketright" => 330, "Iacute" => 345, "ampersand" => 725, 
+    "four" => 530, "igrave" => 317, "a" => 561, "b" => 559, "c" => 441, 
+    "d" => 587, "plus" => 570, "e" => 453, "quotesinglbase" => 216, 
+    "f" => 315, "g" => 499, "bullet" => 500, "h" => 607, "i" => 317, 
+    "Oslash" => 753, "dagger" => 500, "j" => 309, "Yacute" => 591, 
+    "k" => 545, "l" => 306, "m" => 912, "n" => 618, "o" => 537, 
+    "ordfeminine" => 425, "ring" => 400, "p" => 590, 
+    "threesuperior" => 370, "q" => 559, "acute" => 400, "r" => 402, 
+    "aacute" => 561, "twosuperior" => 370, "s" => 389, "OE" => 1020, 
+    "t" => 341, "divide" => 570, "section" => 530, "u" => 618, 
+    "v" => 510, "w" => 785, "dieresis" => 400, "x" => 516, "y" => 468, 
+    "z" => 468, "iacute" => 317, "quotedblbase" => 402, 
+    "hungarumlaut" => 400, "quotedbl" => 402, "mu" => 618, 
+    "Scaron" => 533, "Lslash" => 571, "semicolon" => 265, 
+    "oslash" => 537, "florin" => 530, "yacute" => 468, "fi" => 607, 
+    "fl" => 603, "Acircumflex" => 624, "parenright" => 350, 
+    "Ecircumflex" => 596, "Icircumflex" => 345, "trademark" => 1100, 
+    "daggerdbl" => 490, "guillemotleft" => 462, "germandbls" => 577, 
+    "macron" => 400, "Otilde" => 753, "seven" => 530, 
+    "ellipsis" => 1000, "scaron" => 389, "ordmasculine" => 389, 
+    "AE" => 880, "Ucircumflex" => 794, "lslash" => 318, 
+    "dotlessi" => 317, "sterling" => 530, "quotedblleft" => 402, 
+    "hyphen" => 392, "guilsinglright" => 277, "quotesingle" => 216, 
+    "eight" => 530, "exclamdown" => 240, "acircumflex" => 561, 
+    "endash" => 500, "oe" => 806, "ecircumflex" => 453, 
+    "copyright" => 836, "Adieresis" => 624, "Egrave" => 596, 
+    "icircumflex" => 317, "slash" => 270, "braceright" => 340, 
+    "Edieresis" => 596, "quotedblright" => 402, "Idieresis" => 345, 
+    "otilde" => 537, "parenleft" => 350, "one" => 530, 
+    "ucircumflex" => 618, "Odieresis" => 753, "bracketleft" => 330, 
+    "Ugrave" => 794, "cent" => 530, "currency" => 530, 
+    "logicalnot" => 570, "quoteright" => 216, "Udieresis" => 794, 
+    "perthousand" => 1200, "Ydieresis" => 591, "Atilde" => 624, 
+    "breve" => 400, "bar" => 270, "fraction" => 100, "Eacute" => 596, 
+    "less" => 570, "adieresis" => 561, "guilsinglleft" => 277, 
+    "egrave" => 453, "exclam" => 240, "edieresis" => 453, "Eth" => 770, 
+    "idieresis" => 317, "period" => 265, "ae" => 779, 
+    "asterisk" => 412, "Uacute" => 794, "odieresis" => 537, 
+    "ugrave" => 618, "five" => 530, "nine" => 530, "greater" => 570, 
+    "udieresis" => 618, "Zcaron" => 622, "threequarters" => 890, 
+    "guillemotright" => 462, "Ccedilla" => 661, "ydieresis" => 468, 
+    "tilde" => 400, "atilde" => 561, "at" => 794, "brokenbar" => 270, 
+    "eacute" => 453, "quoteleft" => 216, "underscore" => 500, 
+    "onesuperior" => 370, 
+  }
+);
+1;
diff --git a/doc/metrics/pzcmi8a.ph b/doc/metrics/pzcmi8a.ph
new file mode 100644 (file)
index 0000000..a840d26
--- /dev/null
@@ -0,0 +1,72 @@
+%PS_ZapfChancery_MediumItalic = (
+  name => 'ZapfChancery-MediumItalic',
+  widths => {
+    "multiply" => 520, "Ntilde" => 700, "zero" => 440, "eth" => 400, 
+    "Ograve" => 600, "uacute" => 460, "braceleft" => 240, 
+    "Thorn" => 540, "zcaron" => 440, "comma" => 220, "cedilla" => 300, 
+    "plusminus" => 520, "ccedilla" => 340, "circumflex" => 340, 
+    "dotaccent" => 220, "asciitilde" => 520, "colon" => 260, 
+    "onehalf" => 660, "dollar" => 440, "ntilde" => 460, 
+    "Ocircumflex" => 600, "Oacute" => 600, "ogonek" => 280, 
+    "ograve" => 400, "thorn" => 440, "minus" => 520, "degree" => 400, 
+    "yen" => 440, "space" => 220, "registered" => 740, 
+    "questiondown" => 400, "Aring" => 620, "percent" => 680, 
+    "emdash" => 1000, "six" => 440, "Agrave" => 620, 
+    "paragraph" => 500, "three" => 440, "numbersign" => 440, 
+    "two" => 440, "Igrave" => 380, "oacute" => 400, 
+    "ocircumflex" => 400, "A" => 620, "B" => 600, "C" => 520, 
+    "D" => 700, "E" => 620, "onequarter" => 660, "F" => 580, 
+    "G" => 620, "H" => 680, "I" => 380, "J" => 400, "K" => 660, 
+    "L" => 580, "backslash" => 480, "asciicircum" => 520, 
+    "periodcentered" => 220, "M" => 840, "N" => 700, "O" => 600, 
+    "P" => 540, "aring" => 420, "Q" => 600, "R" => 600, 
+    "Aacute" => 620, "caron" => 340, "S" => 460, "T" => 500, 
+    "grave" => 220, "U" => 740, "agrave" => 420, "V" => 640, 
+    "W" => 880, "equal" => 520, "question" => 380, "X" => 560, 
+    "Y" => 560, "Z" => 620, "bracketright" => 320, "Iacute" => 380, 
+    "ampersand" => 780, "four" => 440, "igrave" => 240, "a" => 420, 
+    "b" => 420, "c" => 340, "d" => 440, "plus" => 520, "e" => 340, 
+    "quotesinglbase" => 180, "f" => 320, "g" => 400, "bullet" => 600, 
+    "h" => 440, "i" => 240, "Oslash" => 660, "dagger" => 460, 
+    "j" => 220, "Yacute" => 560, "k" => 440, "l" => 240, "m" => 620, 
+    "n" => 460, "o" => 400, "ordfeminine" => 260, "ring" => 300, 
+    "p" => 440, "threesuperior" => 264, "q" => 400, "acute" => 300, 
+    "r" => 300, "twosuperior" => 264, "aacute" => 420, "s" => 320, 
+    "OE" => 820, "t" => 320, "divide" => 520, "section" => 420, 
+    "u" => 460, "v" => 440, "w" => 680, "dieresis" => 360, "x" => 420, 
+    "y" => 400, "z" => 440, "iacute" => 240, "quotedblbase" => 280, 
+    "hungarumlaut" => 400, "quotedbl" => 220, "mu" => 460, 
+    "Scaron" => 460, "Lslash" => 580, "semicolon" => 240, 
+    "oslash" => 440, "florin" => 440, "yacute" => 400, "fi" => 520, 
+    "fl" => 520, "Acircumflex" => 620, "parenright" => 220, 
+    "Ecircumflex" => 620, "trademark" => 1000, "Icircumflex" => 380, 
+    "daggerdbl" => 480, "guillemotleft" => 340, "germandbls" => 420, 
+    "macron" => 440, "Otilde" => 600, "seven" => 440, 
+    "ellipsis" => 1000, "scaron" => 320, "ordmasculine" => 260, 
+    "AE" => 740, "Ucircumflex" => 740, "lslash" => 300, 
+    "dotlessi" => 240, "sterling" => 440, "quotedblleft" => 340, 
+    "hyphen" => 280, "guilsinglright" => 260, "quotesingle" => 160, 
+    "eight" => 440, "exclamdown" => 280, "acircumflex" => 420, 
+    "endash" => 500, "oe" => 560, "ecircumflex" => 340, 
+    "copyright" => 740, "Adieresis" => 620, "Egrave" => 620, 
+    "icircumflex" => 240, "slash" => 340, "braceright" => 240, 
+    "Edieresis" => 620, "quotedblright" => 360, "otilde" => 400, 
+    "Idieresis" => 380, "parenleft" => 260, "one" => 440, 
+    "Odieresis" => 600, "ucircumflex" => 460, "bracketleft" => 240, 
+    "Ugrave" => 740, "cent" => 440, "currency" => 440, 
+    "logicalnot" => 520, "quoteright" => 240, "Udieresis" => 740, 
+    "perthousand" => 960, "Ydieresis" => 560, "Atilde" => 620, 
+    "breve" => 440, "bar" => 520, "fraction" => 60, "Eacute" => 620, 
+    "less" => 520, "adieresis" => 420, "guilsinglleft" => 240, 
+    "egrave" => 340, "exclam" => 280, "edieresis" => 340, "Eth" => 700, 
+    "idieresis" => 240, "period" => 220, "ae" => 540, 
+    "asterisk" => 420, "odieresis" => 400, "Uacute" => 740, 
+    "ugrave" => 460, "five" => 440, "nine" => 440, "greater" => 520, 
+    "Zcaron" => 620, "udieresis" => 460, "threequarters" => 660, 
+    "guillemotright" => 380, "Ccedilla" => 520, "ydieresis" => 400, 
+    "tilde" => 440, "atilde" => 420, "at" => 700, "brokenbar" => 520, 
+    "eacute" => 340, "quoteleft" => 240, "underscore" => 500, 
+    "onesuperior" => 264, 
+  }
+);
+1;
diff --git a/doc/metrics/pzdr.ph b/doc/metrics/pzdr.ph
new file mode 100644 (file)
index 0000000..115caac
--- /dev/null
@@ -0,0 +1,57 @@
+%PS_ZapfDingbats = (
+  name => 'ZapfDingbats',
+  widths => {
+    "a81" => 438, "a82" => 138, "a83" => 277, "a84" => 415, 
+    "a85" => 509, "a86" => 410, "a87" => 234, "a88" => 234, 
+    "a89" => 390, "a140" => 788, "a141" => 788, "a142" => 788, 
+    "a143" => 788, "a144" => 788, "a145" => 788, "a146" => 788, 
+    "a147" => 788, "a148" => 788, "a149" => 788, "a10" => 692, 
+    "a11" => 960, "a12" => 939, "a13" => 549, "a14" => 855, 
+    "a15" => 911, "a16" => 933, "a17" => 945, "a90" => 390, 
+    "a18" => 974, "a91" => 276, "a19" => 755, "a92" => 276, 
+    "space" => 278, "a93" => 317, "a94" => 317, "a95" => 334, 
+    "a96" => 334, "a97" => 392, "a98" => 392, "a99" => 668, 
+    "a150" => 788, "a151" => 788, "a152" => 788, "a153" => 788, 
+    "a154" => 788, "a155" => 788, "a156" => 788, "a157" => 788, 
+    "a158" => 788, "a159" => 788, "a20" => 846, "a21" => 762, 
+    "a22" => 761, "a23" => 571, "a24" => 677, "a25" => 763, 
+    "a26" => 760, "a27" => 759, "a28" => 754, "a29" => 786, 
+    "a160" => 894, "a161" => 838, "a162" => 924, "a163" => 1016, 
+    "a164" => 458, "a165" => 924, "a166" => 918, "a167" => 927, 
+    "a168" => 928, "a169" => 928, "a30" => 788, "a31" => 788, 
+    "a32" => 790, "a33" => 793, "a34" => 794, "a35" => 816, 
+    "a36" => 823, "a37" => 789, "a38" => 841, "a39" => 823, 
+    "a170" => 834, "a171" => 873, "a172" => 828, "a173" => 924, 
+    "a174" => 917, "a175" => 930, "a176" => 931, "a177" => 463, 
+    "a178" => 883, "a179" => 836, "a40" => 833, "a41" => 816, 
+    "a42" => 831, "a43" => 923, "a44" => 744, "a45" => 723, 
+    "a46" => 749, "a47" => 790, "a48" => 792, "a49" => 695, 
+    "a100" => 668, "a101" => 732, "a102" => 544, "a103" => 544, 
+    "a104" => 910, "a105" => 911, "a106" => 667, "a107" => 760, 
+    "a180" => 867, "a108" => 760, "a181" => 696, "a109" => 626, 
+    "a182" => 874, "a183" => 760, "a184" => 946, "a185" => 865, 
+    "a186" => 967, "a187" => 831, "a188" => 873, "a189" => 927, 
+    "a50" => 776, "a51" => 768, "a52" => 792, "a53" => 759, 
+    "a54" => 707, "a55" => 708, "a56" => 682, "a57" => 701, 
+    "a58" => 826, "a59" => 815, "a1" => 974, "a2" => 961, 
+    "a110" => 694, "a3" => 980, "a111" => 595, "a4" => 719, 
+    "a112" => 776, "a5" => 789, "a6" => 494, "a7" => 552, "a8" => 537, 
+    "a117" => 690, "a9" => 577, "a190" => 970, "a118" => 791, 
+    "a191" => 918, "a119" => 790, "a192" => 748, "a193" => 836, 
+    "a194" => 771, "a195" => 888, "a196" => 748, "a197" => 771, 
+    "a198" => 888, "a199" => 867, "a60" => 789, "a61" => 789, 
+    "a62" => 707, "a63" => 687, "a64" => 696, "a65" => 689, 
+    "a66" => 786, "a67" => 787, "a68" => 713, "a69" => 791, 
+    "a200" => 696, "a201" => 874, "a120" => 788, "a202" => 974, 
+    "a121" => 788, "a203" => 762, "a122" => 788, "a204" => 759, 
+    "a123" => 788, "a205" => 509, "a124" => 788, "a206" => 410, 
+    "a125" => 788, "a126" => 788, "a127" => 788, "a128" => 788, 
+    "a129" => 788, "a70" => 785, "a71" => 791, "a72" => 873, 
+    "a73" => 761, "a74" => 762, "a75" => 759, "a76" => 892, 
+    "a77" => 892, "a78" => 788, "a79" => 784, "a130" => 788, 
+    "a131" => 788, "a132" => 788, "a133" => 788, "a134" => 788, 
+    "a135" => 788, "a136" => 788, "a137" => 788, "a138" => 788, 
+    "a139" => 788, 
+  }
+);
+1;
diff --git a/doc/nasmdoc.src b/doc/nasmdoc.src
new file mode 100644 (file)
index 0000000..b98c3be
--- /dev/null
@@ -0,0 +1,7930 @@
+\# --------------------------------------------------------------------------
+\#   
+\#   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.
+\#
+\# --------------------------------------------------------------------------
+\#
+\# Source code to NASM documentation
+\#
+\M{category}{Programming}
+\M{title}{NASM - The Netwide Assembler}
+\M{year}{1996-2009}
+\M{author}{The NASM Development Team}
+\M{copyright_tail}{-- All Rights Reserved}
+\M{license}{This document is redistributable under the license given in the file "COPYING" distributed in the NASM archive.}
+\M{auxinfo}{This release is dedicated to the memory of Charles A. Crayne.  We miss you, Chuck.}
+\M{summary}{This file documents NASM, the Netwide Assembler: an assembler targetting the Intel x86 series of processors, with portable source.}
+\M{infoname}{NASM}
+\M{infofile}{nasm}
+\M{infotitle}{The Netwide Assembler for x86}
+\M{epslogo}{nasmlogo.eps}
+\IR{-D} \c{-D} option
+\IR{-E} \c{-E} option
+\IR{-F} \c{-F} option
+\IR{-I} \c{-I} option
+\IR{-M} \c{-M} option
+\IR{-MD} \c{-MD} option
+\IR{-MF} \c{-MF} option
+\IR{-MG} \c{-MG} option
+\IR{-MP} \c{-MP} option
+\IR{-MQ} \c{-MQ} option
+\IR{-MT} \c{-MT} option
+\IR{-O} \c{-O} option
+\IR{-P} \c{-P} option
+\IR{-U} \c{-U} option
+\IR{-X} \c{-X} option
+\IR{-a} \c{-a} option
+\IR{-d} \c{-d} option
+\IR{-e} \c{-e} option
+\IR{-f} \c{-f} option
+\IR{-g} \c{-g} option
+\IR{-i} \c{-i} option
+\IR{-l} \c{-l} option
+\IR{-o} \c{-o} option
+\IR{-p} \c{-p} option
+\IR{-s} \c{-s} option
+\IR{-u} \c{-u} option
+\IR{-v} \c{-v} option
+\IR{-W} \c{-W} 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
+\IR{$$} \c{$$} token
+\IR{%} \c{%} operator
+\IR{%%} \c{%%} operator
+\IR{%+1} \c{%+1} and \c{%-1} syntax
+\IA{%-1}{%+1}
+\IR{%0} \c{%0} parameter count
+\IR{&} \c{&} operator
+\IR{&&} \c{&&} operator
+\IR{*} \c{*} operator
+\IR{..@} \c{..@} symbol prefix
+\IR{/} \c{/} operator
+\IR{//} \c{//} operator
+\IR{<} \c{<} operator
+\IR{<<} \c{<<} operator
+\IR{<=} \c{<=} operator
+\IR{<>} \c{<>} operator
+\IR{=} \c{=} operator
+\IR{==} \c{==} operator
+\IR{>} \c{>} operator
+\IR{>=} \c{>=} operator
+\IR{>>} \c{>>} operator
+\IR{?} \c{?} MASM syntax
+\IR{^} \c{^} operator
+\IR{^^} \c{^^} operator
+\IR{|} \c{|} operator
+\IR{||} \c{||} operator
+\IR{~} \c{~} operator
+\IR{%$} \c{%$} and \c{%$$} prefixes
+\IA{%$$}{%$}
+\IR{+ opaddition} \c{+} operator, binary
+\IR{+ opunary} \c{+} operator, unary
+\IR{+ modifier} \c{+} modifier
+\IR{- opsubtraction} \c{-} operator, binary
+\IR{- opunary} \c{-} operator, unary
+\IR{! opunary} \c{!} operator, unary
+\IR{alignment, in bin sections} alignment, in \c{bin} sections
+\IR{alignment, in elf sections} alignment, in \c{elf} sections
+\IR{alignment, in win32 sections} alignment, in \c{win32} sections
+\IR{alignment, of elf common variables} alignment, of \c{elf} common
+variables
+\IR{alignment, in obj sections} alignment, in \c{obj} sections
+\IR{a.out, bsd version} \c{a.out}, BSD version
+\IR{a.out, linux version} \c{a.out}, Linux version
+\IR{autoconf} Autoconf
+\IR{bin} bin
+\IR{bitwise and} bitwise AND
+\IR{bitwise or} bitwise OR
+\IR{bitwise xor} bitwise XOR
+\IR{block ifs} block IFs
+\IR{borland pascal} Borland, Pascal
+\IR{borland's win32 compilers} Borland, Win32 compilers
+\IR{braces, after % sign} braces, after \c{%} sign
+\IR{bsd} BSD
+\IR{c calling convention} C calling convention
+\IR{c symbol names} C symbol names
+\IA{critical expressions}{critical expression}
+\IA{command line}{command-line}
+\IA{case sensitivity}{case sensitive}
+\IA{case-sensitive}{case sensitive}
+\IA{case-insensitive}{case sensitive}
+\IA{character constants}{character constant}
+\IR{common object file format} Common Object File Format
+\IR{common variables, alignment in elf} common variables, alignment
+in \c{elf}
+\IR{common, elf extensions to} \c{COMMON}, \c{elf} extensions to
+\IR{common, obj extensions to} \c{COMMON}, \c{obj} extensions to
+\IR{declaring structure} declaring structures
+\IR{default-wrt mechanism} default-\c{WRT} mechanism
+\IR{devpac} DevPac
+\IR{djgpp} DJGPP
+\IR{dll symbols, exporting} DLL symbols, exporting
+\IR{dll symbols, importing} DLL symbols, importing
+\IR{dos} DOS
+\IR{dos archive} DOS archive
+\IR{dos source archive} DOS source archive
+\IA{effective address}{effective addresses}
+\IA{effective-address}{effective addresses}
+\IR{elf} ELF
+\IR{elf, 16-bit code and} ELF, 16-bit code and
+\IR{elf shared libraries} ELF, shared libraries
+\IR{elf32} \c{elf32}
+\IR{elf64} \c{elf64}
+\IR{executable and linkable format} Executable and Linkable Format
+\IR{extern, obj extensions to} \c{EXTERN}, \c{obj} extensions to
+\IR{extern, rdf extensions to} \c{EXTERN}, \c{rdf} extensions to
+\IR{floating-point, constants} floating-point, constants
+\IR{floating-point, packed bcd constants} floating-point, packed BCD constants
+\IR{freebsd} FreeBSD
+\IR{freelink} FreeLink
+\IR{functions, c calling convention} functions, C calling convention
+\IR{functions, pascal calling convention} functions, Pascal calling
+convention
+\IR{global, aoutb extensions to} \c{GLOBAL}, \c{aoutb} extensions to
+\IR{global, elf extensions to} \c{GLOBAL}, \c{elf} extensions to
+\IR{global, rdf extensions to} \c{GLOBAL}, \c{rdf} extensions to
+\IR{got} GOT
+\IR{got relocations} \c{GOT} relocations
+\IR{gotoff relocation} \c{GOTOFF} relocations
+\IR{gotpc relocation} \c{GOTPC} relocations
+\IR{intel number formats} Intel number formats
+\IR{linux, elf} Linux, ELF
+\IR{linux, a.out} Linux, \c{a.out}
+\IR{linux, as86} Linux, \c{as86}
+\IR{logical and} logical AND
+\IR{logical or} logical OR
+\IR{logical xor} logical XOR
+\IR{mach object file format} Mach, object file format
+\IR{mach-o} Mach-O
+\IR{macho32} \c{macho32}
+\IR{macho64} \c{macho64}
+\IR{macos x} MacOS X
+\IR{masm} MASM
+\IA{memory reference}{memory references}
+\IR{minix} Minix
+\IA{misc directory}{misc subdirectory}
+\IR{misc subdirectory} \c{misc} subdirectory
+\IR{microsoft omf} Microsoft OMF
+\IR{mmx registers} MMX registers
+\IA{modr/m}{modr/m byte}
+\IR{modr/m byte} ModR/M byte
+\IR{ms-dos} MS-DOS
+\IR{ms-dos device drivers} MS-DOS device drivers
+\IR{multipush} \c{multipush} macro
+\IR{nan} NaN
+\IR{nasm version} NASM version
+\IR{netbsd} NetBSD
+\IR{omf} OMF
+\IR{openbsd} OpenBSD
+\IR{operating system} operating system
+\IR{os/2} OS/2
+\IR{pascal calling convention}Pascal calling convention
+\IR{passes} passes, assembly
+\IR{perl} Perl
+\IR{pic} PIC
+\IR{pharlap} PharLap
+\IR{plt} PLT
+\IR{plt} \c{PLT} relocations
+\IA{pre-defining macros}{pre-define}
+\IA{preprocessor expressions}{preprocessor, expressions}
+\IA{preprocessor loops}{preprocessor, loops}
+\IA{preprocessor variables}{preprocessor, variables}
+\IA{rdoff subdirectory}{rdoff}
+\IR{rdoff} \c{rdoff} subdirectory
+\IR{relocatable dynamic object file format} Relocatable Dynamic
+Object File Format
+\IR{relocations, pic-specific} relocations, PIC-specific
+\IA{repeating}{repeating code}
+\IR{section alignment, in elf} section alignment, in \c{elf}
+\IR{section alignment, in bin} section alignment, in \c{bin}
+\IR{section alignment, in obj} section alignment, in \c{obj}
+\IR{section alignment, in win32} section alignment, in \c{win32}
+\IR{section, elf extensions to} \c{SECTION}, \c{elf} extensions to
+\IR{section, win32 extensions to} \c{SECTION}, \c{win32} extensions to
+\IR{segment alignment, in bin} segment alignment, in \c{bin}
+\IR{segment alignment, in obj} segment alignment, in \c{obj}
+\IR{segment, obj extensions to} \c{SEGMENT}, \c{elf} extensions to
+\IR{segment names, borland pascal} segment names, Borland Pascal
+\IR{shift command} \c{shift} command
+\IA{sib}{sib byte}
+\IR{sib byte} SIB byte
+\IR{align, smart} \c{ALIGN}, smart
+\IR{solaris x86} Solaris x86
+\IA{standard section names}{standardized section names}
+\IR{symbols, exporting from dlls} symbols, exporting from DLLs
+\IR{symbols, importing from dlls} symbols, importing from DLLs
+\IR{test subdirectory} \c{test} subdirectory
+\IR{tlink} \c{TLINK}
+\IR{underscore, in c symbols} underscore, in C symbols
+\IR{unicode} Unicode
+\IR{unix} Unix
+\IR{utf-8} UTF-8
+\IR{utf-16} UTF-16
+\IR{utf-32} UTF-32
+\IA{sco unix}{unix, sco}
+\IR{unix, sco} Unix, SCO
+\IA{unix source archive}{unix, source archive}
+\IR{unix, source archive} Unix, source archive
+\IA{unix system v}{unix, system v}
+\IR{unix, system v} Unix, System V
+\IR{unixware} UnixWare
+\IR{val} VAL
+\IR{version number of nasm} version number of NASM
+\IR{visual c++} Visual C++
+\IR{www page} WWW page
+\IR{win32} Win32
+\IR{win32} Win64
+\IR{windows} Windows
+\IR{windows 95} Windows 95
+\IR{windows nt} Windows NT
+\# \IC{program entry point}{entry point, program}
+\# \IC{program entry point}{start point, program}
+\# \IC{MS-DOS device drivers}{device drivers, MS-DOS}
+\# \IC{16-bit mode, versus 32-bit mode}{32-bit mode, versus 16-bit mode}
+\# \IC{c symbol names}{symbol names, in C}
+
+
+\C{intro} Introduction
+
+\H{whatsnasm} What Is NASM?
+
+The Netwide Assembler, NASM, is an 80x86 and x86-64 assembler designed
+for portability and modularity. It supports a range of object file
+formats, including Linux and \c{*BSD} \c{a.out}, \c{ELF}, \c{COFF},
+\c{Mach-O}, Microsoft 16-bit \c{OBJ}, \c{Win32} and \c{Win64}. It will
+also output plain binary files. Its syntax is designed to be simple
+and easy to understand, similar to Intel's but less complex. It
+supports all currently known x86 architectural extensions, and has
+strong support for macros.
+
+
+\S{yaasm} Why Yet Another Assembler?
+
+The Netwide Assembler grew out of an idea on \i\c{comp.lang.asm.x86}
+(or possibly \i\c{alt.lang.asm} - I forget which), which was
+essentially that there didn't seem to be a good \e{free} x86-series
+assembler around, and that maybe someone ought to write one.
+
+\b \i\c{a86} is good, but not free, and in particular you don't get any
+32-bit capability until you pay. It's DOS only, too.
+
+\b \i\c{gas} is free, and ports over to DOS and Unix, but it's not
+very good, since it's designed to be a back end to \i\c{gcc}, which
+always feeds it correct code. So its error checking is minimal. Also,
+its syntax is horrible, from the point of view of anyone trying to
+actually \e{write} anything in it. Plus you can't write 16-bit code in
+it (properly.)
+
+\b \i\c{as86} is specific to Minix and Linux, and (my version at least)
+doesn't seem to have much (or any) documentation.
+
+\b \i\c{MASM} isn't very good, and it's (was) expensive, and it runs only under
+DOS.
+
+\b \i\c{TASM} is better, but still strives for MASM compatibility,
+which means millions of directives and tons of red tape. And its syntax
+is essentially MASM's, with the contradictions and quirks that
+entails (although it sorts out some of those by means of Ideal mode.)
+It's expensive too. And it's DOS-only.
+
+So here, for your coding pleasure, is NASM. At present it's
+still in prototype stage - we don't promise that it can outperform
+any of these assemblers. But please, \e{please} send us bug reports,
+fixes, helpful information, and anything else you can get your hands
+on (and thanks to the many people who've done this already! You all
+know who you are), and we'll improve it out of all recognition.
+Again.
+
+
+\S{legal} \i{License} Conditions
+
+Please see the file \c{LICENSE}, supplied as part of any NASM
+distribution archive, for the license conditions under which you may
+use NASM.  NASM is now under the so-called 2-clause BSD license, also
+known as the simplified BSD license.
+
+Copyright 1996-2009 the NASM Authors - All rights reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions are
+met:
+
+\b Redistributions of source code must retain the above copyright
+notice, this list of conditions and the following disclaimer.
+
+\b 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.
+
+
+\H{contact} Contact Information
+
+The current version of NASM (since about 0.98.08) is maintained by a
+team of developers, accessible through the \c{nasm-devel} mailing list
+(see below for the link).
+If you want to report a bug, please read \k{bugs} first.
+
+NASM has a \i{website} at
+\W{http://www.nasm.us/}\c{http://www.nasm.us/}. If it's not there,
+google for us!
+
+\i{New releases}, \i{release candidates}, and \I{snapshots, daily
+development}\i{daily development snapshots} of NASM are available from
+the official web site.
+
+Announcements are posted to
+\W{news:comp.lang.asm.x86}\i\c{comp.lang.asm.x86},
+and to the web site
+\W{http://www.freshmeat.net/}\c{http://www.freshmeat.net/}.
+
+If you want information about the current development status, please
+subscribe to the \i\c{nasm-devel} email list; see link from the
+website.
+
+
+\H{install} Installation
+
+\S{instdos} \i{Installing} NASM under MS-\i{DOS} or Windows
+
+Once you've obtained the appropriate archive for NASM,
+\i\c{nasm-XXX-dos.zip} or \i\c{nasm-XXX-win32.zip} (where \c{XXX}
+denotes the version number of NASM contained in the archive), unpack
+it into its own directory (for example \c{c:\\nasm}).
+
+The archive will contain a set of executable files: the NASM
+executable file \i\c{nasm.exe}, the NDISASM executable file
+\i\c{ndisasm.exe}, and possibly additional utilities to handle the
+RDOFF file format.
+
+The only file NASM needs to run is its own executable, so copy
+\c{nasm.exe} to a directory on your PATH, or alternatively edit
+\i\c{autoexec.bat} to add the \c{nasm} directory to your
+\i\c{PATH} (to do that under Windows XP, go to Start > Control Panel >
+System > Advanced > Environment Variables; these instructions may work
+under other versions of Windows as well.)
+
+That's it - NASM is installed. You don't need the nasm directory
+to be present to run NASM (unless you've added it to your \c{PATH}),
+so you can delete it if you need to save space; however, you may
+want to keep the documentation or test programs.
+
+If you've downloaded the \i{DOS source archive}, \i\c{nasm-XXX.zip},
+the \c{nasm} directory will also contain the full NASM \i{source
+code}, and a selection of \i{Makefiles} you can (hopefully) use to
+rebuild your copy of NASM from scratch.  See the file \c{INSTALL} in
+the source archive.
+
+Note that a number of files are generated from other files by Perl
+scripts.  Although the NASM source distribution includes these
+generated files, you will need to rebuild them (and hence, will need a
+Perl interpreter) if you change insns.dat, standard.mac or the
+documentation. It is possible future source distributions may not
+include these files at all. Ports of \i{Perl} for a variety of
+platforms, including DOS and Windows, are available from
+\W{http://www.cpan.org/ports/}\i{www.cpan.org}.
+
+
+\S{instdos} Installing NASM under \i{Unix}
+
+Once you've obtained the \i{Unix source archive} for NASM,
+\i\c{nasm-XXX.tar.gz} (where \c{XXX} denotes the version number of
+NASM contained in the archive), unpack it into a directory such
+as \c{/usr/local/src}. The archive, when unpacked, will create its
+own subdirectory \c{nasm-XXX}.
+
+NASM is an \I{Autoconf}\I\c{configure}auto-configuring package: once
+you've unpacked it, \c{cd} to the directory it's been unpacked into
+and type \c{./configure}. This shell script will find the best C
+compiler to use for building NASM and set up \i{Makefiles}
+accordingly.
+
+Once NASM has auto-configured, you can type \i\c{make} to build the
+\c{nasm} and \c{ndisasm} binaries, and then \c{make install} to
+install them in \c{/usr/local/bin} and install the \i{man pages}
+\i\c{nasm.1} and \i\c{ndisasm.1} in \c{/usr/local/man/man1}.
+Alternatively, you can give options such as \c{--prefix} to the
+configure script (see the file \i\c{INSTALL} for more details), or
+install the programs yourself.
+
+NASM also comes with a set of utilities for handling the \c{RDOFF}
+custom object-file format, which are in the \i\c{rdoff} subdirectory
+of the NASM archive. You can build these with \c{make rdf} and
+install them with \c{make rdf_install}, if you want them.
+
+
+\C{running} Running NASM
+
+\H{syntax} NASM \i{Command-Line} Syntax
+
+To assemble a file, you issue a command of the form
+
+\c nasm -f <format> <filename> [-o <output>]
+
+For example,
+
+\c nasm -f elf myfile.asm
+
+will assemble \c{myfile.asm} into an \c{ELF} object file \c{myfile.o}. And
+
+\c nasm -f bin myfile.asm -o myfile.com
+
+will assemble \c{myfile.asm} into a raw binary file \c{myfile.com}.
+
+To produce a listing file, with the hex codes output from NASM
+displayed on the left of the original sources, use the \c{-l} option
+to give a listing file name, for example:
+
+\c nasm -f coff myfile.asm -l myfile.lst
+
+To get further usage instructions from NASM, try typing
+
+\c nasm -h
+
+As \c{-hf}, this will also list the available output file formats, and what they
+are.
+
+If you use Linux but aren't sure whether your system is \c{a.out}
+or \c{ELF}, type
+
+\c file nasm
+
+(in the directory in which you put the NASM binary when you
+installed it). If it says something like
+
+\c nasm: ELF 32-bit LSB executable i386 (386 and up) Version 1
+
+then your system is \c{ELF}, and you should use the option \c{-f elf}
+when you want NASM to produce Linux object files. If it says
+
+\c nasm: Linux/i386 demand-paged executable (QMAGIC)
+
+or something similar, your system is \c{a.out}, and you should use
+\c{-f aout} instead (Linux \c{a.out} systems have long been obsolete,
+and are rare these days.)
+
+Like Unix compilers and assemblers, NASM is silent unless it
+goes wrong: you won't see any output at all, unless it gives error
+messages.
+
+
+\S{opt-o} The \i\c{-o} Option: Specifying the Output File Name
+
+NASM will normally choose the name of your output file for you;
+precisely how it does this is dependent on the object file format.
+For Microsoft object file formats (\c{obj}, \c{win32} and \c{win64}),
+it will remove the \c{.asm} \i{extension} (or whatever extension you
+like to use - NASM doesn't care) from your source file name and
+substitute \c{.obj}. For Unix object file formats (\c{aout}, \c{as86},
+\c{coff}, \c{elf32}, \c{elf64}, \c{ieee}, \c{macho32} and \c{macho64})
+it will substitute \c{.o}. For \c{dbg}, \c{rdf}, \c{ith} and \c{srec},
+it will use \c{.dbg}, \c{.rdf}, \c{.ith} and \c{.srec}, respectively,
+and for the \c{bin} format it will simply remove the extension, so
+that \c{myfile.asm} produces the output file \c{myfile}.
+
+If the output file already exists, NASM will overwrite it, unless it
+has the same name as the input file, in which case it will give a
+warning and use \i\c{nasm.out} as the output file name instead.
+
+For situations in which this behaviour is unacceptable, NASM
+provides the \c{-o} command-line option, which allows you to specify
+your desired output file name. You invoke \c{-o} by following it
+with the name you wish for the output file, either with or without
+an intervening space. For example:
+
+\c nasm -f bin program.asm -o program.com
+\c nasm -f bin driver.asm -odriver.sys
+
+Note that this is a small o, and is different from a capital O , which
+is used to specify the number of optimisation passes required. See \k{opt-O}.
+
+
+\S{opt-f} The \i\c{-f} Option: Specifying the \i{Output File Format}
+
+If you do not supply the \c{-f} option to NASM, it will choose an
+output file format for you itself. In the distribution versions of
+NASM, the default is always \i\c{bin}; if you've compiled your own
+copy of NASM, you can redefine \i\c{OF_DEFAULT} at compile time and
+choose what you want the default to be.
+
+Like \c{-o}, the intervening space between \c{-f} and the output
+file format is optional; so \c{-f elf} and \c{-felf} are both valid.
+
+A complete list of the available output file formats can be given by
+issuing the command \i\c{nasm -hf}.
+
+
+\S{opt-l} The \i\c{-l} Option: Generating a \i{Listing File}
+
+If you supply the \c{-l} option to NASM, followed (with the usual
+optional space) by a file name, NASM will generate a
+\i{source-listing file} for you, in which addresses and generated
+code are listed on the left, and the actual source code, with
+expansions of multi-line macros (except those which specifically
+request no expansion in source listings: see \k{nolist}) on the
+right. For example:
+
+\c nasm -f elf myfile.asm -l myfile.lst
+
+If a list file is selected, you may turn off listing for a
+section of your source with \c{[list -]}, and turn it back on
+with \c{[list +]}, (the default, obviously). There is no "user
+form" (without the brackets). This can be used to list only
+sections of interest, avoiding excessively long listings.
+
+
+\S{opt-M} The \i\c{-M} Option: Generate \i{Makefile Dependencies}
+
+This option can be used to generate makefile dependencies on stdout.
+This can be redirected to a file for further processing. For example:
+
+\c nasm -M myfile.asm > myfile.dep
+
+
+\S{opt-MG} The \i\c{-MG} Option: Generate \i{Makefile Dependencies}
+
+This option can be used to generate makefile dependencies on stdout.
+This differs from the \c{-M} option in that if a nonexisting file is
+encountered, it is assumed to be a generated file and is added to the
+dependency list without a prefix.
+
+
+\S{opt-MF} The \i\c\{-MF} Option: Set Makefile Dependency File
+
+This option can be used with the \c{-M} or \c{-MG} options to send the
+output to a file, rather than to stdout.  For example:
+
+\c nasm -M -MF myfile.dep myfile.asm
+
+
+\S{opt-MD} The \i\c{-MD} Option: Assemble and Generate Dependencies
+
+The \c{-MD} option acts as the combination of the \c{-M} and \c{-MF}
+options (i.e. a filename has to be specified.)  However, unlike the
+\c{-M} or \c{-MG} options, \c{-MD} does \e{not} inhibit the normal
+operation of the assembler.  Use this to automatically generate
+updated dependencies with every assembly session.  For example:
+
+\c nasm -f elf -o myfile.o -MD myfile.dep myfile.asm
+
+
+\S{opt-MT} The \i\c{-MT} Option: Dependency Target Name
+
+The \c{-MT} option can be used to override the default name of the
+dependency target.  This is normally the same as the output filename,
+specified by the \c{-o} option.
+
+
+\S{opt-MQ} The \i\c{-MQ} Option: Dependency Target Name (Quoted)
+
+The \c{-MQ} option acts as the \c{-MT} option, except it tries to
+quote characters that have special meaning in Makefile syntax.  This
+is not foolproof, as not all characters with special meaning are
+quotable in Make.
+
+
+\S{opt-MP} The \i\c{-MP} Option: Emit phony targets
+
+When used with any of the dependency generation options, the \c{-MP}
+option causes NASM to emit a phony target without dependencies for
+each header file.  This prevents Make from complaining if a header
+file has been removed.
+
+
+\S{opt-F} The \i\c{-F} Option: Selecting a \i{Debug Information Format}
+
+This option is used to select the format of the debug information
+emitted into the output file, to be used by a debugger (or \e{will}
+be). Prior to version 2.03.01, the use of this switch did \e{not} enable
+output of the selected debug info format.  Use \c{-g}, see \k{opt-g},
+to enable output.  Versions 2.03.01 and later automatically enable \c{-g}
+if \c{-F} is specified.
+
+A complete list of the available debug file formats for an output
+format can be seen by issuing the command \c{nasm -f <format> -y}.  Not
+all output formats currently support debugging output.  See \k{opt-y}.
+
+This should not be confused with the \c{-f dbg} output format option which
+is not built into NASM by default. For information on how
+to enable it when building from the sources, see \k{dbgfmt}.
+
+
+\S{opt-g} The \i\c{-g} Option: Enabling \i{Debug Information}.
+
+This option can be used to generate debugging information in the specified
+format. See \k{opt-F}. Using \c{-g} without \c{-F} results in emitting
+debug info in the default format, if any, for the selected output format.
+If no debug information is currently implemented in the selected output
+format, \c{-g} is \e{silently ignored}.
+
+
+\S{opt-X} The \i\c{-X} Option: Selecting an \i{Error Reporting Format}
+
+This option can be used to select an error reporting format for any
+error messages that might be produced by NASM.
+
+Currently, two error reporting formats may be selected.  They are
+the \c{-Xvc} option and the \c{-Xgnu} option.  The GNU format is
+the default and looks like this:
+
+\c filename.asm:65: error: specific error message
+
+where \c{filename.asm} is the name of the source file in which the
+error was detected, \c{65} is the source file line number on which
+the error was detected, \c{error} is the severity of the error (this
+could be \c{warning}), and \c{specific error message} is a more
+detailed text message which should help pinpoint the exact problem.
+
+The other format, specified by \c{-Xvc} is the style used by Microsoft
+Visual C++ and some other programs.  It looks like this:
+
+\c filename.asm(65) : error: specific error message
+
+where the only difference is that the line number is in parentheses
+instead of being delimited by colons.
+
+See also the \c{Visual C++} output format, \k{win32fmt}.
+
+\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
+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{-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 -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}
+
+The \c{-s} option redirects \i{error messages} to \c{stdout} rather
+than \c{stderr}, so it can be redirected under \I{DOS}\c{MS-DOS}. To
+assemble the file \c{myfile.asm} and pipe its output to the \c{more}
+program, you can type:
+
+\c nasm -s -f obj myfile.asm | more
+
+See also the \c{-Z} option, \k{opt-Z}.
+
+
+\S{opt-i} The \i\c{-i}\I\c{-I} Option: Include File Search Directories
+
+When NASM sees the \i\c{%include} or \i\c{%pathsearch} directive in a
+source file (see \k{include}, \k{pathsearch} or \k{incbin}), it will
+search for the given file not only in the current directory, but also
+in any directories specified on the command line by the use of the
+\c{-i} option. Therefore you can include files from a \i{macro
+library}, for example, by typing
+
+\c nasm -ic:\macrolib\ -f obj myfile.asm
+
+(As usual, a space between \c{-i} and the path name is allowed, and
+optional).
+
+NASM, in the interests of complete source-code portability, does not
+understand the file naming conventions of the OS it is running on;
+the string you provide as an argument to the \c{-i} option will be
+prepended exactly as written to the name of the include file.
+Therefore the trailing backslash in the above example is necessary.
+Under Unix, a trailing forward slash is similarly necessary.
+
+(You can use this to your advantage, if you're really \i{perverse},
+by noting that the option \c{-ifoo} will cause \c{%include "bar.i"}
+to search for the file \c{foobar.i}...)
+
+If you want to define a \e{standard} \i{include search path},
+similar to \c{/usr/include} on Unix systems, you should place one or
+more \c{-i} directives in the \c{NASMENV} environment variable (see
+\k{nasmenv}).
+
+For Makefile compatibility with many C compilers, this option can also
+be specified as \c{-I}.
+
+
+\S{opt-p} The \i\c{-p}\I\c{-P} Option: \I{pre-including files}Pre-Include a File
+
+\I\c{%include}NASM allows you to specify files to be
+\e{pre-included} into your source file, by the use of the \c{-p}
+option. So running
+
+\c nasm myfile.asm -p myinc.inc
+
+is equivalent to running \c{nasm myfile.asm} and placing the
+directive \c{%include "myinc.inc"} at the start of the file.
+
+For consistency with the \c{-I}, \c{-D} and \c{-U} options, this
+option can also be specified as \c{-P}.
+
+
+\S{opt-d} The \i\c{-d}\I\c{-D} Option: \I{pre-defining macros}Pre-Define a Macro
+
+\I\c{%define}Just as the \c{-p} option gives an alternative to placing
+\c{%include} directives at the start of a source file, the \c{-d}
+option gives an alternative to placing a \c{%define} directive. You
+could code
+
+\c nasm myfile.asm -dFOO=100
+
+as an alternative to placing the directive
+
+\c %define FOO 100
+
+at the start of the file. You can miss off the macro value, as well:
+the option \c{-dFOO} is equivalent to coding \c{%define FOO}. This
+form of the directive may be useful for selecting \i{assembly-time
+options} which are then tested using \c{%ifdef}, for example
+\c{-dDEBUG}.
+
+For Makefile compatibility with many C compilers, this option can also
+be specified as \c{-D}.
+
+
+\S{opt-u} The \i\c{-u}\I\c{-U} Option: \I{Undefining macros}Undefine a Macro
+
+\I\c{%undef}The \c{-u} option undefines a macro that would otherwise
+have been pre-defined, either automatically or by a \c{-p} or \c{-d}
+option specified earlier on the command lines.
+
+For example, the following command line:
+
+\c nasm myfile.asm -dFOO=100 -uFOO
+
+would result in \c{FOO} \e{not} being a predefined macro in the
+program. This is useful to override options specified at a different
+point in a Makefile.
+
+For Makefile compatibility with many C compilers, this option can also
+be specified as \c{-U}.
+
+
+\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
+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,
+if the \c{-o} option is also used).
+
+This option cannot be applied to programs which require the
+preprocessor to evaluate \I{preprocessor expressions}\i{expressions}
+which depend on the values of symbols: so code such as
+
+\c %assign tablesize ($-tablestart)
+
+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
+
+If NASM is being used as the back end to a compiler, it might be
+desirable to \I{suppressing preprocessing}suppress preprocessing
+completely and assume the compiler has already done it, to save time
+and increase compilation speeds. The \c{-a} option, requiring no
+argument, instructs NASM to replace its powerful \i{preprocessor}
+with a \i{stub preprocessor} which does nothing.
+
+
+\S{opt-O} The \i\c{-O} Option: Specifying \i{Multipass Optimization}
+
+NASM defaults to not optimizing operands which can fit into a signed byte.
+This means that if you want the shortest possible object code,
+you have to enable optimization.
+
+Using the \c{-O} option, you can tell NASM to carry out different
+levels of optimization.  The syntax is:
+
+\b \c{-O0}: No optimization. All operands take their long forms,
+        if a short form is not specified, except conditional jumps.
+        This is intended to match NASM 0.98 behavior.
+
+\b \c{-O1}: Minimal optimization. As above, but immediate operands
+        which will fit in a signed byte are optimized,
+        unless the long form is specified.  Conditional jumps default
+        to the long form unless otherwise specified.
+
+\b \c{-Ox} (where \c{x} is the actual letter \c{x}): Multipass optimization.
+        Minimize branch offsets and signed immediate bytes,
+        overriding size specification unless the \c{strict} keyword
+        has been used (see \k{strict}).  For compatability with earlier
+        releases, the letter \c{x} may also be any number greater than
+        one. This number has no effect on the actual number of passes.
+
+The \c{-Ox} mode is recommended for most uses.
+
+Note that this is a capital \c{O}, and is different from a small \c{o}, which
+is used to specify the output file name. See \k{opt-o}.
+
+
+\S{opt-t} The \i\c{-t} Option: Enable TASM Compatibility Mode
+
+NASM includes a limited form of compatibility with Borland's \i\c{TASM}.
+When NASM's \c{-t} option is used, the following changes are made:
+
+\b local labels may be prefixed with \c{@@} instead of \c{.}
+
+\b size override is supported within brackets. In TASM compatible mode,
+a size override inside square brackets changes the size of the operand,
+and not the address type of the operand as it does in NASM syntax. E.g.
+\c{mov eax,[DWORD val]} is valid syntax in TASM compatibility mode.
+Note that you lose the ability to override the default address type for
+the instruction.
+
+\b unprefixed forms of some directives supported (\c{arg}, \c{elif},
+\c{else}, \c{endif}, \c{if}, \c{ifdef}, \c{ifdifi}, \c{ifndef},
+\c{include}, \c{local})
+
+\S{opt-w} The \i\c{-w} and \i\c{-W} Options: Enable or Disable Assembly \i{Warnings}
+
+NASM can observe many conditions during the course of assembly which
+are worth mentioning to the user, but not a sufficiently severe
+error to justify NASM refusing to generate an output file. These
+conditions are reported like errors, but come up with the word
+`warning' before the message. Warnings do not prevent NASM from
+generating an output file and returning a success status to the
+operating system.
+
+Some conditions are even less severe than that: they are only
+sometimes worth mentioning to the user. Therefore NASM supports the
+\c{-w} command-line option, which enables or disables certain
+classes of assembly warning. Such warning classes are described by a
+name, for example \c{orphan-labels}; you can enable warnings of
+this class by the command-line option \c{-w+orphan-labels} and
+disable it by \c{-w-orphan-labels}.
+
+The \i{suppressible warning} classes are:
+
+\b \i\c{macro-params} covers warnings about \i{multi-line macros}
+being invoked with the wrong number of parameters. This warning
+class is enabled by default; see \k{mlmacover} for an example of why
+you might want to disable it.
+
+\b \i\c{macro-selfref} warns if a macro references itself. This
+warning class is disabled by default.
+
+\b\i\c{macro-defaults} warns when a macro has more default
+parameters than optional parameters. This warning class
+is enabled by default; see \k{mlmacdef} for why you might want to disable it.
+
+\b \i\c{orphan-labels} covers warnings about source lines which
+contain no instruction but define a label without a trailing colon.
+NASM warns about this somewhat obscure condition by default;
+see \k{syntax} for more information.
+
+\b \i\c{number-overflow} covers warnings about numeric constants which
+don't fit in 64 bits. This warning class is enabled by default.
+
+\b \i\c{gnu-elf-extensions} warns if 8-bit or 16-bit relocations
+are used in \c{-f elf} format. The GNU extensions allow this.
+This warning class is disabled by default.
+
+\b \i\c{float-overflow} warns about floating point overflow.
+Enabled by default.
+
+\b \i\c{float-denorm} warns about floating point denormals.
+Disabled by default.
+
+\b \i\c{float-underflow} warns about floating point underflow.
+Disabled by default.
+
+\b \i\c{float-toolong} warns about too many digits in floating-point numbers.
+Enabled by default.
+
+\b \i\c{user} controls \c{%warning} directives (see \k{pperror}).
+Enabled by default.
+
+\b \i\c{error} causes warnings to be treated as errors.  Disabled by
+default.
+
+\b \i\c{all} is an alias for \e{all} suppressible warning classes (not
+including \c{error}).  Thus, \c{-w+all} enables all available warnings.
+
+In addition, you can set warning classes across sections.
+Warning classes may be enabled with \i\c{[warning +warning-name]},
+disabled with \i\c{[warning -warning-name]} or reset to their
+original value with \i\c{[warning *warning-name]}. No "user form"
+(without the brackets) exists.
+
+Since version 2.00, NASM has also supported the gcc-like syntax
+\c{-Wwarning} and \c{-Wno-warning} instead of \c{-w+warning} and
+\c{-w-warning}, respectively.
+
+
+\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.
+
+You will need the version number if you report a bug.
+
+\S{opt-y} The \i\c{-y} Option: Display Available Debug Info Formats
+
+Typing \c{nasm -f <option> -y} will display a list of the available
+debug info formats for the given output format. The default format
+is indicated by an asterisk. For example:
+
+\c nasm -f elf -y
+
+\c valid debug formats for 'elf32' output format are
+\c   ('*' denotes default):
+\c   * stabs     ELF32 (i386) stabs debug format for Linux
+\c     dwarf     elf32 (i386) dwarf debug format for Linux
+
+
+\S{opt-pfix} The \i\c{--prefix} and \i\c{--postfix} Options.
+
+The \c{--prefix} and \c{--postfix} options prepend or append
+(respectively) the given argument to all \c{global} or
+\c{extern} variables. E.g. \c{--prefix _} will prepend the
+underscore to all global and external variables, as C sometimes
+(but not always) likes it.
+
+
+\S{nasmenv} The \i\c{NASMENV} \i{Environment} Variable
+
+If you define an environment variable called \c{NASMENV}, the program
+will interpret it as a list of extra command-line options, which are
+processed before the real command line. You can use this to define
+standard search directories for include files, by putting \c{-i}
+options in the \c{NASMENV} variable.
+
+The value of the variable is split up at white space, so that the
+value \c{-s -ic:\\nasmlib\\} will be treated as two separate options.
+However, that means that the value \c{-dNAME="my name"} won't do
+what you might want, because it will be split at the space and the
+NASM command-line processing will get confused by the two
+nonsensical words \c{-dNAME="my} and \c{name"}.
+
+To get round this, NASM provides a feature whereby, if you begin the
+\c{NASMENV} environment variable with some character that isn't a minus
+sign, then NASM will treat this character as the \i{separator
+character} for options. So setting the \c{NASMENV} variable to the
+value \c{!-s!-ic:\\nasmlib\\} is equivalent to setting it to \c{-s
+-ic:\\nasmlib\\}, but \c{!-dNAME="my name"} will work.
+
+This environment variable was previously called \c{NASM}. This was
+changed with version 0.98.31.
+
+
+\H{qstart} \i{Quick Start} for \i{MASM} Users
+
+If you're used to writing programs with MASM, or with \i{TASM} in
+MASM-compatible (non-Ideal) mode, or with \i\c{a86}, this section
+attempts to outline the major differences between MASM's syntax and
+NASM's. If you're not already used to MASM, it's probably worth
+skipping this section.
+
+
+\S{qscs} NASM Is \I{case sensitivity}Case-Sensitive
+
+One simple difference is that NASM is case-sensitive. It makes a
+difference whether you call your label \c{foo}, \c{Foo} or \c{FOO}.
+If you're assembling to \c{DOS} or \c{OS/2} \c{.OBJ} files, you can
+invoke the \i\c{UPPERCASE} directive (documented in \k{objfmt}) to
+ensure that all symbols exported to other code modules are forced
+to be upper case; but even then, \e{within} a single module, NASM
+will distinguish between labels differing only in case.
+
+
+\S{qsbrackets} NASM Requires \i{Square Brackets} For \i{Memory References}
+
+NASM was designed with simplicity of syntax in mind. One of the
+\i{design goals} of NASM is that it should be possible, as far as is
+practical, for the user to look at a single line of NASM code
+and tell what opcode is generated by it. You can't do this in MASM:
+if you declare, for example,
+
+\c foo     equ     1
+\c bar     dw      2
+
+then the two lines of code
+
+\c         mov     ax,foo
+\c         mov     ax,bar
+
+generate completely different opcodes, despite having
+identical-looking syntaxes.
+
+NASM avoids this undesirable situation by having a much simpler
+syntax for memory references. The rule is simply that any access to
+the \e{contents} of a memory location requires square brackets
+around the address, and any access to the \e{address} of a variable
+doesn't. So an instruction of the form \c{mov ax,foo} will
+\e{always} refer to a compile-time constant, whether it's an \c{EQU}
+or the address of a variable; and to access the \e{contents} of the
+variable \c{bar}, you must code \c{mov ax,[bar]}.
+
+This also means that NASM has no need for MASM's \i\c{OFFSET}
+keyword, since the MASM code \c{mov ax,offset bar} means exactly the
+same thing as NASM's \c{mov ax,bar}. If you're trying to get
+large amounts of MASM code to assemble sensibly under NASM, you
+can always code \c{%idefine offset} to make the preprocessor treat
+the \c{OFFSET} keyword as a no-op.
+
+This issue is even more confusing in \i\c{a86}, where declaring a
+label with a trailing colon defines it to be a `label' as opposed to
+a `variable' and causes \c{a86} to adopt NASM-style semantics; so in
+\c{a86}, \c{mov ax,var} has different behaviour depending on whether
+\c{var} was declared as \c{var: dw 0} (a label) or \c{var dw 0} (a
+word-size variable). NASM is very simple by comparison:
+\e{everything} is a label.
+
+NASM, in the interests of simplicity, also does not support the
+\i{hybrid syntaxes} supported by MASM and its clones, such as
+\c{mov ax,table[bx]}, where a memory reference is denoted by one
+portion outside square brackets and another portion inside. The
+correct syntax for the above is \c{mov ax,[table+bx]}. Likewise,
+\c{mov ax,es:[di]} is wrong and \c{mov ax,[es:di]} is right.
+
+
+\S{qstypes} NASM Doesn't Store \i{Variable Types}
+
+NASM, by design, chooses not to remember the types of variables you
+declare. Whereas MASM will remember, on seeing \c{var dw 0}, that
+you declared \c{var} as a word-size variable, and will then be able
+to fill in the \i{ambiguity} in the size of the instruction \c{mov
+var,2}, NASM will deliberately remember nothing about the symbol
+\c{var} except where it begins, and so you must explicitly code
+\c{mov word [var],2}.
+
+For this reason, NASM doesn't support the \c{LODS}, \c{MOVS},
+\c{STOS}, \c{SCAS}, \c{CMPS}, \c{INS}, or \c{OUTS} instructions,
+but only supports the forms such as \c{LODSB}, \c{MOVSW}, and
+\c{SCASD}, which explicitly specify the size of the components of
+the strings being manipulated.
+
+
+\S{qsassume} NASM Doesn't \i\c{ASSUME}
+
+As part of NASM's drive for simplicity, it also does not support the
+\c{ASSUME} directive. NASM will not keep track of what values you
+choose to put in your segment registers, and will never
+\e{automatically} generate a \i{segment override} prefix.
+
+
+\S{qsmodel} NASM Doesn't Support \i{Memory Models}
+
+NASM also does not have any directives to support different 16-bit
+memory models. The programmer has to keep track of which functions
+are supposed to be called with a \i{far call} and which with a
+\i{near call}, and is responsible for putting the correct form of
+\c{RET} instruction (\c{RETN} or \c{RETF}; NASM accepts \c{RET}
+itself as an alternate form for \c{RETN}); in addition, the
+programmer is responsible for coding CALL FAR instructions where
+necessary when calling \e{external} functions, and must also keep
+track of which external variable definitions are far and which are
+near.
+
+
+\S{qsfpu} \i{Floating-Point} Differences
+
+NASM uses different names to refer to floating-point registers from
+MASM: where MASM would call them \c{ST(0)}, \c{ST(1)} and so on, and
+\i\c{a86} would call them simply \c{0}, \c{1} and so on, NASM
+chooses to call them \c{st0}, \c{st1} etc.
+
+As of version 0.96, NASM now treats the instructions with
+\i{`nowait'} forms in the same way as MASM-compatible assemblers.
+The idiosyncratic treatment employed by 0.95 and earlier was based
+on a misunderstanding by the authors.
+
+
+\S{qsother} Other Differences
+
+For historical reasons, NASM uses the keyword \i\c{TWORD} where MASM
+and compatible assemblers use \i\c{TBYTE}.
+
+NASM does not declare \i{uninitialized storage} in the same way as
+MASM: where a MASM programmer might use \c{stack db 64 dup (?)},
+NASM requires \c{stack resb 64}, intended to be read as `reserve 64
+bytes'. For a limited amount of compatibility, since NASM treats
+\c{?} as a valid character in symbol names, you can code \c{? equ 0}
+and then writing \c{dw ?} will at least do something vaguely useful.
+\I\c{RESB}\i\c{DUP} is still not a supported syntax, however.
+
+In addition to all of this, macros and directives work completely
+differently to MASM. See \k{preproc} and \k{directive} for further
+details.
+
+
+\C{lang} The NASM Language
+
+\H{syntax} Layout of a NASM Source Line
+
+Like most assemblers, each NASM source line contains (unless it
+is a macro, a preprocessor directive or an assembler directive: see
+\k{preproc} and \k{directive}) some combination of the four fields
+
+\c label:    instruction operands        ; comment
+
+As usual, most of these fields are optional; the presence or absence
+of any combination of a label, an instruction and a comment is allowed.
+Of course, the operand field is either required or forbidden by the
+presence and nature of the instruction field.
+
+NASM uses backslash (\\) as the line continuation character; if a line
+ends with backslash, the next line is considered to be a part of the
+backslash-ended line.
+
+NASM places no restrictions on white space within a line: labels may
+have white space before them, or instructions may have no space
+before them, or anything. The \i{colon} after a label is also
+optional. (Note that this means that if you intend to code \c{lodsb}
+alone on a line, and type \c{lodab} by accident, then that's still a
+valid source line which does nothing but define a label. Running
+NASM with the command-line option
+\I{orphan-labels}\c{-w+orphan-labels} will cause it to warn you if
+you define a label alone on a line without a \i{trailing colon}.)
+
+\i{Valid characters} in labels are letters, numbers, \c{_}, \c{$},
+\c{#}, \c{@}, \c{~}, \c{.}, and \c{?}. The only characters which may
+be used as the \e{first} character of an identifier are letters,
+\c{.} (with special meaning: see \k{locallab}), \c{_} and \c{?}.
+An identifier may also be prefixed with a \I{$, prefix}\c{$} to
+indicate that it is intended to be read as an identifier and not a
+reserved word; thus, if some other module you are linking with
+defines a symbol called \c{eax}, you can refer to \c{$eax} in NASM
+code to distinguish the symbol from the register. Maximum length of
+an identifier is 4095 characters.
+
+The instruction field may contain any machine instruction: Pentium
+and P6 instructions, FPU instructions, MMX instructions and even
+undocumented instructions are all supported. The instruction may be
+prefixed by \c{LOCK}, \c{REP}, \c{REPE}/\c{REPZ} or
+\c{REPNE}/\c{REPNZ}, in the usual way. Explicit \I{address-size
+prefixes}address-size and \i{operand-size prefixes} \i\c{A16},
+\i\c{A32}, \i\c{A64}, \i\c{O16} and \i\c{O32}, \i\c{O64} are provided - one example of their use
+is given in \k{mixsize}. You can also use the name of a \I{segment
+override}segment register as an instruction prefix: coding
+\c{es mov [bx],ax} is equivalent to coding \c{mov [es:bx],ax}. We
+recommend the latter syntax, since it is consistent with other
+syntactic features of the language, but for instructions such as
+\c{LODSB}, which has no operands and yet can require a segment
+override, there is no clean syntactic way to proceed apart from
+\c{es lodsb}.
+
+An instruction is not required to use a prefix: prefixes such as
+\c{CS}, \c{A32}, \c{LOCK} or \c{REPE} can appear on a line by
+themselves, and NASM will just generate the prefix bytes.
+
+In addition to actual machine instructions, NASM also supports a
+number of pseudo-instructions, described in \k{pseudop}.
+
+Instruction \i{operands} may take a number of forms: they can be
+registers, described simply by the register name (e.g. \c{ax},
+\c{bp}, \c{ebx}, \c{cr0}: NASM does not use the \c{gas}-style
+syntax in which register names must be prefixed by a \c{%} sign), or
+they can be \i{effective addresses} (see \k{effaddr}), constants
+(\k{const}) or expressions (\k{expr}).
+
+For x87 \i{floating-point} instructions, NASM accepts a wide range of
+syntaxes: you can use two-operand forms like MASM supports, or you
+can use NASM's native single-operand forms in most cases.
+\# Details of
+\# all forms of each supported instruction are given in
+\# \k{iref}.
+For example, you can code:
+
+\c         fadd    st1             ; this sets st0 := st0 + st1
+\c         fadd    st0,st1         ; so does this
+\c
+\c         fadd    st1,st0         ; this sets st1 := st1 + st0
+\c         fadd    to st1          ; so does this
+
+Almost any x87 floating-point instruction that references memory must
+use one of the prefixes \i\c{DWORD}, \i\c{QWORD} or \i\c{TWORD} to
+indicate what size of \i{memory operand} it refers to.
+
+
+\H{pseudop} \i{Pseudo-Instructions}
+
+Pseudo-instructions are things which, though not real x86 machine
+instructions, are used in the instruction field anyway because that's
+the most convenient place to put them. The current pseudo-instructions
+are \i\c{DB}, \i\c{DW}, \i\c{DD}, \i\c{DQ}, \i\c{DT}, \i\c{DO} and
+\i\c{DY}; their \i{uninitialized} counterparts \i\c{RESB}, \i\c{RESW},
+\i\c{RESD}, \i\c{RESQ}, \i\c{REST}, \i\c{RESO} and \i\c{RESY}; the
+\i\c{INCBIN} command, the \i\c{EQU} command, and the \i\c{TIMES}
+prefix.
+
+
+\S{db} \c{DB} and Friends: Declaring Initialized Data
+
+\i\c{DB}, \i\c{DW}, \i\c{DD}, \i\c{DQ}, \i\c{DT}, \i\c{DO} and
+\i\c{DY} are used, much as in MASM, to declare initialized data in the
+output file. They can be invoked in a wide range of ways:
+\I{floating-point}\I{character constant}\I{string constant}
+
+\c       db    0x55                ; just the byte 0x55
+\c       db    0x55,0x56,0x57      ; three bytes in succession
+\c       db    'a',0x55            ; character constants are OK
+\c       db    'hello',13,10,'$'   ; so are string constants
+\c       dw    0x1234              ; 0x34 0x12
+\c       dw    'a'                 ; 0x61 0x00 (it's just a number)
+\c       dw    'ab'                ; 0x61 0x62 (character constant)
+\c       dw    'abc'               ; 0x61 0x62 0x63 0x00 (string)
+\c       dd    0x12345678          ; 0x78 0x56 0x34 0x12
+\c       dd    1.234567e20         ; floating-point constant
+\c       dq    0x123456789abcdef0  ; eight byte constant
+\c       dq    1.234567e20         ; double-precision float
+\c       dt    1.234567e20         ; extended-precision float
+
+\c{DT}, \c{DO} and \c{DY} do not accept \i{numeric constants} as operands.
+
+
+\S{resb} \c{RESB} and Friends: Declaring \i{Uninitialized} Data
+
+\i\c{RESB}, \i\c{RESW}, \i\c{RESD}, \i\c{RESQ}, \i\c{REST}, \i\c{RESO}
+and \i\c{RESY} are designed to be used in the BSS section of a module:
+they declare \e{uninitialized} storage space. Each takes a single
+operand, which is the number of bytes, words, doublewords or whatever
+to reserve.  As stated in \k{qsother}, NASM does not support the
+MASM/TASM syntax of reserving uninitialized space by writing
+\I\c{?}\c{DW ?} or similar things: this is what it does instead. The
+operand to a \c{RESB}-type pseudo-instruction is a \i\e{critical
+expression}: see \k{crit}.
+
+For example:
+
+\c buffer:         resb    64              ; reserve 64 bytes
+\c wordvar:        resw    1               ; reserve a word
+\c realarray       resq    10              ; array of ten reals
+\c ymmval:         resy    1               ; one YMM register
+
+\S{incbin} \i\c{INCBIN}: Including External \i{Binary Files}
+
+\c{INCBIN} is borrowed from the old Amiga assembler \i{DevPac}: it
+includes a binary file verbatim into the output file. This can be
+handy for (for example) including \i{graphics} and \i{sound} data
+directly into a game executable file. It can be called in one of
+these three ways:
+
+\c     incbin  "file.dat"             ; include the whole file
+\c     incbin  "file.dat",1024        ; skip the first 1024 bytes
+\c     incbin  "file.dat",1024,512    ; skip the first 1024, and
+\c                                    ; actually include at most 512
+
+\c{INCBIN} is both a directive and a standard macro; the standard
+macro version searches for the file in the include file search path
+and adds the file to the dependency lists.  This macro can be
+overridden if desired.
+
+
+\S{equ} \i\c{EQU}: Defining Constants
+
+\c{EQU} defines a symbol to a given constant value: when \c{EQU} is
+used, the source line must contain a label. The action of \c{EQU} is
+to define the given label name to the value of its (only) operand.
+This definition is absolute, and cannot change later. So, for
+example,
+
+\c message         db      'hello, world'
+\c msglen          equ     $-message
+
+defines \c{msglen} to be the constant 12. \c{msglen} may not then be
+redefined later. This is not a \i{preprocessor} definition either:
+the value of \c{msglen} is evaluated \e{once}, using the value of
+\c{$} (see \k{expr} for an explanation of \c{$}) at the point of
+definition, rather than being evaluated wherever it is referenced
+and using the value of \c{$} at the point of reference.
+
+
+\S{times} \i\c{TIMES}: \i{Repeating} Instructions or Data
+
+The \c{TIMES} prefix causes the instruction to be assembled multiple
+times. This is partly present as NASM's equivalent of the \i\c{DUP}
+syntax supported by \i{MASM}-compatible assemblers, in that you can
+code
+
+\c zerobuf:        times 64 db 0
+
+or similar things; but \c{TIMES} is more versatile than that. The
+argument to \c{TIMES} is not just a numeric constant, but a numeric
+\e{expression}, so you can do things like
+
+\c buffer: db      'hello, world'
+\c         times 64-$+buffer db ' '
+
+which will store exactly enough spaces to make the total length of
+\c{buffer} up to 64. Finally, \c{TIMES} can be applied to ordinary
+instructions, so you can code trivial \i{unrolled loops} in it:
+
+\c         times 100 movsb
+
+Note that there is no effective difference between \c{times 100 resb
+1} and \c{resb 100}, except that the latter will be assembled about
+100 times faster due to the internal structure of the assembler.
+
+The operand to \c{TIMES} is a critical expression (\k{crit}).
+
+Note also that \c{TIMES} can't be applied to \i{macros}: the reason
+for this is that \c{TIMES} is processed after the macro phase, which
+allows the argument to \c{TIMES} to contain expressions such as
+\c{64-$+buffer} as above. To repeat more than one line of code, or a
+complex macro, use the preprocessor \i\c{%rep} directive.
+
+
+\H{effaddr} Effective Addresses
+
+An \i{effective address} is any operand to an instruction which
+\I{memory reference}references memory. Effective addresses, in NASM,
+have a very simple syntax: they consist of an expression evaluating
+to the desired address, enclosed in \i{square brackets}. For
+example:
+
+\c wordvar dw      123
+\c         mov     ax,[wordvar]
+\c         mov     ax,[wordvar+1]
+\c         mov     ax,[es:wordvar+bx]
+
+Anything not conforming to this simple system is not a valid memory
+reference in NASM, for example \c{es:wordvar[bx]}.
+
+More complicated effective addresses, such as those involving more
+than one register, work in exactly the same way:
+
+\c         mov     eax,[ebx*2+ecx+offset]
+\c         mov     ax,[bp+di+8]
+
+NASM is capable of doing \i{algebra} on these effective addresses,
+so that things which don't necessarily \e{look} legal are perfectly
+all right:
+
+\c     mov     eax,[ebx*5]             ; assembles as [ebx*4+ebx]
+\c     mov     eax,[label1*2-label2]   ; ie [label1+(label1-label2)]
+
+Some forms of effective address have more than one assembled form;
+in most such cases NASM will generate the smallest form it can. For
+example, there are distinct assembled forms for the 32-bit effective
+addresses \c{[eax*2+0]} and \c{[eax+eax]}, and NASM will generally
+generate the latter on the grounds that the former requires four
+bytes to store a zero offset.
+
+NASM has a hinting mechanism which will cause \c{[eax+ebx]} and
+\c{[ebx+eax]} to generate different opcodes; this is occasionally
+useful because \c{[esi+ebp]} and \c{[ebp+esi]} have different
+default segment registers.
+
+However, you can force NASM to generate an effective address in a
+particular form by the use of the keywords \c{BYTE}, \c{WORD},
+\c{DWORD} and \c{NOSPLIT}. If you need \c{[eax+3]} to be assembled
+using a double-word offset field instead of the one byte NASM will
+normally generate, you can code \c{[dword eax+3]}. Similarly, you
+can force NASM to use a byte offset for a small value which it
+hasn't seen on the first pass (see \k{crit} for an example of such a
+code fragment) by using \c{[byte eax+offset]}. As special cases,
+\c{[byte eax]} will code \c{[eax+0]} with a byte offset of zero, and
+\c{[dword eax]} will code it with a double-word offset of zero. The
+normal form, \c{[eax]}, will be coded with no offset field.
+
+The form described in the previous paragraph is also useful if you
+are trying to access data in a 32-bit segment from within 16 bit code.
+For more information on this see the section on mixed-size addressing
+(\k{mixaddr}). In particular, if you need to access data with a known
+offset that is larger than will fit in a 16-bit value, if you don't
+specify that it is a dword offset, nasm will cause the high word of
+the offset to be lost.
+
+Similarly, NASM will split \c{[eax*2]} into \c{[eax+eax]} because
+that allows the offset field to be absent and space to be saved; in
+fact, it will also split \c{[eax*2+offset]} into
+\c{[eax+eax+offset]}. You can combat this behaviour by the use of
+the \c{NOSPLIT} keyword: \c{[nosplit eax*2]} will force
+\c{[eax*2+0]} to be generated literally.
+
+In 64-bit mode, NASM will by default generate absolute addresses.  The
+\i\c{REL} keyword makes it produce \c{RIP}-relative addresses. Since
+this is frequently the normally desired behaviour, see the \c{DEFAULT}
+directive (\k{default}). The keyword \i\c{ABS} overrides \i\c{REL}.
+
+
+\H{const} \i{Constants}
+
+NASM understands four different types of constant: numeric,
+character, string and floating-point.
+
+
+\S{numconst} \i{Numeric Constants}
+
+A numeric constant is simply a number. NASM allows you to specify
+numbers in a variety of number bases, in a variety of ways: you can
+suffix \c{H} or \c{X}, \c{Q} or \c{O}, and \c{B} for \i{hexadecimal},
+\i{octal} and \i{binary} respectively, or you can prefix \c{0x} for
+hexadecimal in the style of C, or you can prefix \c{$} for hexadecimal
+in the style of Borland Pascal. Note, though, that the \I{$,
+prefix}\c{$} prefix does double duty as a prefix on identifiers (see
+\k{syntax}), so a hex number prefixed with a \c{$} sign must have a
+digit after the \c{$} rather than a letter.  In addition, current
+versions of NASM accept the prefix \c{0h} for hexadecimal, \c{0o} or
+\c{0q} for octal, and \c{0b} for binary.  Please note that unlike C, a
+\c{0} prefix by itself does \e{not} imply an octal constant!
+
+Numeric constants can have underscores (\c{_}) interspersed to break
+up long strings.
+
+Some examples (all producing exactly the same code):
+
+\c         mov     ax,200          ; decimal
+\c         mov     ax,0200         ; still decimal
+\c         mov     ax,0200d        ; explicitly decimal
+\c         mov     ax,0d200        ; also decimal
+\c         mov     ax,0c8h         ; hex
+\c         mov     ax,$0c8         ; hex again: the 0 is required
+\c         mov     ax,0xc8         ; hex yet again
+\c         mov     ax,0hc8         ; still hex
+\c         mov     ax,310q         ; octal
+\c         mov     ax,310o         ; octal again
+\c         mov     ax,0o310        ; octal yet again
+\c         mov     ax,0q310        ; hex yet again
+\c         mov     ax,11001000b    ; binary
+\c         mov     ax,1100_1000b   ; same binary constant
+\c         mov     ax,0b1100_1000  ; same binary constant yet again
+
+\S{strings} \I{Strings}\i{Character Strings}
+
+A character string consists of up to eight characters enclosed in
+either single quotes (\c{'...'}), double quotes (\c{"..."}) or
+backquotes (\c{`...`}).  Single or double quotes are equivalent to
+NASM (except of course that surrounding the constant with single
+quotes allows double quotes to appear within it and vice versa); the
+contents of those are represented verbatim.  Strings enclosed in
+backquotes support C-style \c{\\}-escapes for special characters.
+
+
+The following \i{escape sequences} are recognized by backquoted strings:
+
+\c       \'          single quote (')
+\c       \"          double quote (")
+\c       \`          backquote (`)
+\c       \\\          backslash (\)
+\c       \?          question mark (?)
+\c       \a          BEL (ASCII 7)
+\c       \b          BS  (ASCII 8)
+\c       \t          TAB (ASCII 9)
+\c       \n          LF  (ASCII 10)
+\c       \v          VT  (ASCII 11)
+\c       \f          FF  (ASCII 12)
+\c       \r          CR  (ASCII 13)
+\c       \e          ESC (ASCII 27)
+\c       \377        Up to 3 octal digits - literal byte
+\c       \xFF        Up to 2 hexadecimal digits - literal byte
+\c       \u1234      4 hexadecimal digits - Unicode character
+\c       \U12345678  8 hexadecimal digits - Unicode character
+
+All other escape sequences are reserved.  Note that \c{\\0}, meaning a
+\c{NUL} character (ASCII 0), is a special case of the octal escape
+sequence.
+
+\i{Unicode} characters specified with \c{\\u} or \c{\\U} are converted to
+\i{UTF-8}.  For example, the following lines are all equivalent:
+
+\c       db `\u263a`            ; UTF-8 smiley face
+\c       db `\xe2\x98\xba`      ; UTF-8 smiley face
+\c       db 0E2h, 098h, 0BAh    ; UTF-8 smiley face
+
+
+\S{chrconst} \i{Character Constants}
+
+A character constant consists of a string up to eight bytes long, used
+in an expression context.  It is treated as if it was an integer.
+
+A character constant with more than one byte will be arranged
+with \i{little-endian} order in mind: if you code
+
+\c           mov eax,'abcd'
+
+then the constant generated is not \c{0x61626364}, but
+\c{0x64636261}, so that if you were then to store the value into
+memory, it would read \c{abcd} rather than \c{dcba}. This is also
+the sense of character constants understood by the Pentium's
+\i\c{CPUID} instruction.
+
+
+\S{strconst} \i{String Constants}
+
+String constants are character strings used in the context of some
+pseudo-instructions, namely the
+\I\c{DW}\I\c{DD}\I\c{DQ}\I\c{DT}\I\c{DO}\I\c{DY}\i\c{DB} family and
+\i\c{INCBIN} (where it represents a filename.)  They are also used in
+certain preprocessor directives.
+
+A string constant looks like a character constant, only longer. It
+is treated as a concatenation of maximum-size character constants
+for the conditions. So the following are equivalent:
+
+\c       db    'hello'               ; string constant
+\c       db    'h','e','l','l','o'   ; equivalent character constants
+
+And the following are also equivalent:
+
+\c       dd    'ninechars'           ; doubleword string constant
+\c       dd    'nine','char','s'     ; becomes three doublewords
+\c       db    'ninechars',0,0,0     ; and really looks like this
+
+Note that when used in a string-supporting context, quoted strings are
+treated as a string constants even if they are short enough to be a
+character constant, because otherwise \c{db 'ab'} would have the same
+effect as \c{db 'a'}, which would be silly. Similarly, three-character
+or four-character constants are treated as strings when they are
+operands to \c{DW}, and so forth.
+
+\S{unicode} \I{UTF-16}\I{UTF-32}\i{Unicode} Strings
+
+The special operators \i\c{__utf16__} and \i\c{__utf32__} allows
+definition of Unicode strings.  They take a string in UTF-8 format and
+converts it to (littleendian) UTF-16 or UTF-32, respectively.
+
+For example:
+
+\c %define u(x) __utf16__(x)
+\c %define w(x) __utf32__(x)
+\c
+\c       dw u('C:\WINDOWS'), 0       ; Pathname in UTF-16
+\c       dd w(`A + B = \u206a`), 0   ; String in UTF-32
+
+\c{__utf16__} and \c{__utf32__} can be applied either to strings
+passed to the \c{DB} family instructions, or to character constants in
+an expression context.
+
+\S{fltconst} \I{floating-point, constants}Floating-Point Constants
+
+\i{Floating-point} constants are acceptable only as arguments to
+\i\c{DB}, \i\c{DW}, \i\c{DD}, \i\c{DQ}, \i\c{DT}, and \i\c{DO}, or as
+arguments to the special operators \i\c{__float8__},
+\i\c{__float16__}, \i\c{__float32__}, \i\c{__float64__},
+\i\c{__float80m__}, \i\c{__float80e__}, \i\c{__float128l__}, and
+\i\c{__float128h__}.
+
+Floating-point constants are expressed in the traditional form:
+digits, then a period, then optionally more digits, then optionally an
+\c{E} followed by an exponent. The period is mandatory, so that NASM
+can distinguish between \c{dd 1}, which declares an integer constant,
+and \c{dd 1.0} which declares a floating-point constant.  NASM also
+support C99-style hexadecimal floating-point: \c{0x}, hexadecimal
+digits, period, optionally more hexadeximal digits, then optionally a
+\c{P} followed by a \e{binary} (not hexadecimal) exponent in decimal
+notation.
+
+Underscores to break up groups of digits are permitted in
+floating-point constants as well.
+
+Some examples:
+
+\c       db    -0.2                    ; "Quarter precision"
+\c       dw    -0.5                    ; IEEE 754r/SSE5 half precision
+\c       dd    1.2                     ; an easy one
+\c       dd    1.222_222_222           ; underscores are permitted
+\c       dd    0x1p+2                  ; 1.0x2^2 = 4.0
+\c       dq    0x1p+32                 ; 1.0x2^32 = 4 294 967 296.0
+\c       dq    1.e10                   ; 10 000 000 000.0
+\c       dq    1.e+10                  ; synonymous with 1.e10
+\c       dq    1.e-10                  ; 0.000 000 000 1
+\c       dt    3.141592653589793238462 ; pi
+\c       do    1.e+4000                ; IEEE 754r quad precision
+
+The 8-bit "quarter-precision" floating-point format is
+sign:exponent:mantissa = 1:4:3 with an exponent bias of 7.  This
+appears to be the most frequently used 8-bit floating-point format,
+although it is not covered by any formal standard.  This is sometimes
+called a "\i{minifloat}."
+
+The special operators are used to produce floating-point numbers in
+other contexts.  They produce the binary representation of a specific
+floating-point number as an integer, and can use anywhere integer
+constants are used in an expression.  \c{__float80m__} and
+\c{__float80e__} produce the 64-bit mantissa and 16-bit exponent of an
+80-bit floating-point number, and \c{__float128l__} and
+\c{__float128h__} produce the lower and upper 64-bit halves of a 128-bit
+floating-point number, respectively.
+
+For example:
+
+\c       mov    rax,__float64__(3.141592653589793238462)
+
+... would assign the binary representation of pi as a 64-bit floating
+point number into \c{RAX}.  This is exactly equivalent to:
+
+\c       mov    rax,0x400921fb54442d18
+
+NASM cannot do compile-time arithmetic on floating-point constants.
+This is because NASM is designed to be portable - although it always
+generates code to run on x86 processors, the assembler itself can
+run on any system with an ANSI C compiler. Therefore, the assembler
+cannot guarantee the presence of a floating-point unit capable of
+handling the \i{Intel number formats}, and so for NASM to be able to
+do floating arithmetic it would have to include its own complete set
+of floating-point routines, which would significantly increase the
+size of the assembler for very little benefit.
+
+The special tokens \i\c{__Infinity__}, \i\c{__QNaN__} (or
+\i\c{__NaN__}) and \i\c{__SNaN__} can be used to generate
+\I{infinity}infinities, quiet \i{NaN}s, and signalling NaNs,
+respectively.  These are normally used as macros:
+
+\c %define Inf __Infinity__
+\c %define NaN __QNaN__
+\c
+\c       dq    +1.5, -Inf, NaN         ; Double-precision constants
+
+\S{bcdconst} \I{floating-point, packed BCD constants}Packed BCD Constants
+
+x87-style packed BCD constants can be used in the same contexts as
+80-bit floating-point numbers.  They are suffixed with \c{p} or
+prefixed with \c{0p}, and can include up to 18 decimal digits.
+
+As with other numeric constants, underscores can be used to separate
+digits.
+
+For example:
+
+\c       dt 12_345_678_901_245_678p
+\c       dt -12_345_678_901_245_678p
+\c       dt +0p33
+\c       dt 33p
+
+
+\H{expr} \i{Expressions}
+
+Expressions in NASM are similar in syntax to those in C.  Expressions
+are evaluated as 64-bit integers which are then adjusted to the
+appropriate size.
+
+NASM supports two special tokens in expressions, allowing
+calculations to involve the current assembly position: the
+\I{$, here}\c{$} and \i\c{$$} tokens. \c{$} evaluates to the assembly
+position at the beginning of the line containing the expression; so
+you can code an \i{infinite loop} using \c{JMP $}. \c{$$} evaluates
+to the beginning of the current section; so you can tell how far
+into the section you are by using \c{($-$$)}.
+
+The arithmetic \i{operators} provided by NASM are listed here, in
+increasing order of \i{precedence}.
+
+
+\S{expor} \i\c{|}: \i{Bitwise OR} Operator
+
+The \c{|} operator gives a bitwise OR, exactly as performed by the
+\c{OR} machine instruction. Bitwise OR is the lowest-priority
+arithmetic operator supported by NASM.
+
+
+\S{expxor} \i\c{^}: \i{Bitwise XOR} Operator
+
+\c{^} provides the bitwise XOR operation.
+
+
+\S{expand} \i\c{&}: \i{Bitwise AND} Operator
+
+\c{&} provides the bitwise AND operation.
+
+
+\S{expshift} \i\c{<<} and \i\c{>>}: \i{Bit Shift} Operators
+
+\c{<<} gives a bit-shift to the left, just as it does in C. So \c{5<<3}
+evaluates to 5 times 8, or 40. \c{>>} gives a bit-shift to the
+right; in NASM, such a shift is \e{always} unsigned, so that
+the bits shifted in from the left-hand end are filled with zero
+rather than a sign-extension of the previous highest bit.
+
+
+\S{expplmi} \I{+ opaddition}\c{+} and \I{- opsubtraction}\c{-}:
+\i{Addition} and \i{Subtraction} Operators
+
+The \c{+} and \c{-} operators do perfectly ordinary addition and
+subtraction.
+
+
+\S{expmul} \i\c{*}, \i\c{/}, \i\c{//}, \i\c{%} and \i\c{%%}:
+\i{Multiplication} and \i{Division}
+
+\c{*} is the multiplication operator. \c{/} and \c{//} are both
+division operators: \c{/} is \i{unsigned division} and \c{//} is
+\i{signed division}. Similarly, \c{%} and \c{%%} provide \I{unsigned
+modulo}\I{modulo operators}unsigned and
+\i{signed modulo} operators respectively.
+
+NASM, like ANSI C, provides no guarantees about the sensible
+operation of the signed modulo operator.
+
+Since the \c{%} character is used extensively by the macro
+\i{preprocessor}, you should ensure that both the signed and unsigned
+modulo operators are followed by white space wherever they appear.
+
+
+\S{expmul} \i{Unary Operators}: \I{+ opunary}\c{+}, \I{- opunary}\c{-},
+\i\c{~}, \I{! opunary}\c{!} and \i\c{SEG}
+
+The highest-priority operators in NASM's expression grammar are
+those which only apply to one argument. \c{-} negates its operand,
+\c{+} does nothing (it's provided for symmetry with \c{-}), \c{~}
+computes the \i{one's complement} of its operand, \c{!} is the
+\i{logical negation} operator, and \c{SEG} provides the \i{segment address}
+of its operand (explained in more detail in \k{segwrt}).
+
+
+\H{segwrt} \i\c{SEG} and \i\c{WRT}
+
+When writing large 16-bit programs, which must be split into
+multiple \i{segments}, it is often necessary to be able to refer to
+the \I{segment address}segment part of the address of a symbol. NASM
+supports the \c{SEG} operator to perform this function.
+
+The \c{SEG} operator returns the \i\e{preferred} segment base of a
+symbol, defined as the segment base relative to which the offset of
+the symbol makes sense. So the code
+
+\c         mov     ax,seg symbol
+\c         mov     es,ax
+\c         mov     bx,symbol
+
+will load \c{ES:BX} with a valid pointer to the symbol \c{symbol}.
+
+Things can be more complex than this: since 16-bit segments and
+\i{groups} may \I{overlapping segments}overlap, you might occasionally
+want to refer to some symbol using a different segment base from the
+preferred one. NASM lets you do this, by the use of the \c{WRT}
+(With Reference To) keyword. So you can do things like
+
+\c         mov     ax,weird_seg        ; weird_seg is a segment base
+\c         mov     es,ax
+\c         mov     bx,symbol wrt weird_seg
+
+to load \c{ES:BX} with a different, but functionally equivalent,
+pointer to the symbol \c{symbol}.
+
+NASM supports far (inter-segment) calls and jumps by means of the
+syntax \c{call segment:offset}, where \c{segment} and \c{offset}
+both represent immediate values. So to call a far procedure, you
+could code either of
+
+\c         call    (seg procedure):procedure
+\c         call    weird_seg:(procedure wrt weird_seg)
+
+(The parentheses are included for clarity, to show the intended
+parsing of the above instructions. They are not necessary in
+practice.)
+
+NASM supports the syntax \I\c{CALL FAR}\c{call far procedure} as a
+synonym for the first of the above usages. \c{JMP} works identically
+to \c{CALL} in these examples.
+
+To declare a \i{far pointer} to a data item in a data segment, you
+must code
+
+\c         dw      symbol, seg symbol
+
+NASM supports no convenient synonym for this, though you can always
+invent one using the macro processor.
+
+
+\H{strict} \i\c{STRICT}: Inhibiting Optimization
+
+When assembling with the optimizer set to level 2 or higher (see
+\k{opt-O}), NASM will use size specifiers (\c{BYTE}, \c{WORD},
+\c{DWORD}, \c{QWORD}, \c{TWORD}, \c{OWORD} or \c{YWORD}), but will
+give them the smallest possible size. The keyword \c{STRICT} can be
+used to inhibit optimization and force a particular operand to be
+emitted in the specified size. For example, with the optimizer on, and
+in \c{BITS 16} mode,
+
+\c         push dword 33
+
+is encoded in three bytes \c{66 6A 21}, whereas
+
+\c         push strict dword 33
+
+is encoded in six bytes, with a full dword immediate operand \c{66 68
+21 00 00 00}.
+
+With the optimizer off, the same code (six bytes) is generated whether
+the \c{STRICT} keyword was used or not.
+
+
+\H{crit} \i{Critical Expressions}
+
+Although NASM has an optional multi-pass optimizer, there are some
+expressions which must be resolvable on the first pass. These are
+called \e{Critical Expressions}.
+
+The first pass is used to determine the size of all the assembled
+code and data, so that the second pass, when generating all the
+code, knows all the symbol addresses the code refers to. So one
+thing NASM can't handle is code whose size depends on the value of a
+symbol declared after the code in question. For example,
+
+\c         times (label-$) db 0
+\c label:  db      'Where am I?'
+
+The argument to \i\c{TIMES} in this case could equally legally
+evaluate to anything at all; NASM will reject this example because
+it cannot tell the size of the \c{TIMES} line when it first sees it.
+It will just as firmly reject the slightly \I{paradox}paradoxical
+code
+
+\c         times (label-$+1) db 0
+\c label:  db      'NOW where am I?'
+
+in which \e{any} value for the \c{TIMES} argument is by definition
+wrong!
+
+NASM rejects these examples by means of a concept called a
+\e{critical expression}, which is defined to be an expression whose
+value is required to be computable in the first pass, and which must
+therefore depend only on symbols defined before it. The argument to
+the \c{TIMES} prefix is a critical expression.
+
+\H{locallab} \i{Local Labels}
+
+NASM gives special treatment to symbols beginning with a \i{period}.
+A label beginning with a single period is treated as a \e{local}
+label, which means that it is associated with the previous non-local
+label. So, for example:
+
+\c label1  ; some code
+\c
+\c .loop
+\c         ; some more code
+\c
+\c         jne     .loop
+\c         ret
+\c
+\c label2  ; some code
+\c
+\c .loop
+\c         ; some more code
+\c
+\c         jne     .loop
+\c         ret
+
+In the above code fragment, each \c{JNE} instruction jumps to the
+line immediately before it, because the two definitions of \c{.loop}
+are kept separate by virtue of each being associated with the
+previous non-local label.
+
+This form of local label handling is borrowed from the old Amiga
+assembler \i{DevPac}; however, NASM goes one step further, in
+allowing access to local labels from other parts of the code. This
+is achieved by means of \e{defining} a local label in terms of the
+previous non-local label: the first definition of \c{.loop} above is
+really defining a symbol called \c{label1.loop}, and the second
+defines a symbol called \c{label2.loop}. So, if you really needed
+to, you could write
+
+\c label3  ; some more code
+\c         ; and some more
+\c
+\c         jmp label1.loop
+
+Sometimes it is useful - in a macro, for instance - to be able to
+define a label which can be referenced from anywhere but which
+doesn't interfere with the normal local-label mechanism. Such a
+label can't be non-local because it would interfere with subsequent
+definitions of, and references to, local labels; and it can't be
+local because the macro that defined it wouldn't know the label's
+full name. NASM therefore introduces a third type of label, which is
+probably only useful in macro definitions: if a label begins with
+the \I{label prefix}special prefix \i\c{..@}, then it does nothing
+to the local label mechanism. So you could code
+
+\c label1:                         ; a non-local label
+\c .local:                         ; this is really label1.local
+\c ..@foo:                         ; this is a special symbol
+\c label2:                         ; another non-local label
+\c .local:                         ; this is really label2.local
+\c
+\c         jmp     ..@foo          ; this will jump three lines up
+
+NASM has the capacity to define other special symbols beginning with
+a double period: for example, \c{..start} is used to specify the
+entry point in the \c{obj} output format (see \k{dotdotstart}).
+
+
+\C{preproc} The NASM \i{Preprocessor}
+
+NASM contains a powerful \i{macro processor}, which supports
+conditional assembly, multi-level file inclusion, two forms of macro
+(single-line and multi-line), and a `context stack' mechanism for
+extra macro power. Preprocessor directives all begin with a \c{%}
+sign.
+
+The preprocessor collapses all lines which end with a backslash (\\)
+character into a single line.  Thus:
+
+\c %define THIS_VERY_LONG_MACRO_NAME_IS_DEFINED_TO \\
+\c         THIS_VALUE
+
+will work like a single-line macro without the backslash-newline
+sequence.
+
+\H{slmacro} \i{Single-Line Macros}
+
+\S{define} The Normal Way: \I\c{%idefine}\i\c{%define}
+
+Single-line macros are defined using the \c{%define} preprocessor
+directive. The definitions work in a similar way to C; so you can do
+things like
+
+\c %define ctrl    0x1F &
+\c %define param(a,b) ((a)+(a)*(b))
+\c
+\c         mov     byte [param(2,ebx)], ctrl 'D'
+
+which will expand to
+
+\c         mov     byte [(2)+(2)*(ebx)], 0x1F & 'D'
+
+When the expansion of a single-line macro contains tokens which
+invoke another macro, the expansion is performed at invocation time,
+not at definition time. Thus the code
+
+\c %define a(x)    1+b(x)
+\c %define b(x)    2*x
+\c
+\c         mov     ax,a(8)
+
+will evaluate in the expected way to \c{mov ax,1+2*8}, even though
+the macro \c{b} wasn't defined at the time of definition of \c{a}.
+
+Macros defined with \c{%define} are \i{case sensitive}: after
+\c{%define foo bar}, only \c{foo} will expand to \c{bar}: \c{Foo} or
+\c{FOO} will not. By using \c{%idefine} instead of \c{%define} (the
+`i' stands for `insensitive') you can define all the case variants
+of a macro at once, so that \c{%idefine foo bar} would cause
+\c{foo}, \c{Foo}, \c{FOO}, \c{fOO} and so on all to expand to
+\c{bar}.
+
+There is a mechanism which detects when a macro call has occurred as
+a result of a previous expansion of the same macro, to guard against
+\i{circular references} and infinite loops. If this happens, the
+preprocessor will only expand the first occurrence of the macro.
+Hence, if you code
+
+\c %define a(x)    1+a(x)
+\c
+\c         mov     ax,a(3)
+
+the macro \c{a(3)} will expand once, becoming \c{1+a(3)}, and will
+then expand no further. This behaviour can be useful: see \k{32c}
+for an example of its use.
+
+You can \I{overloading, single-line macros}overload single-line
+macros: if you write
+
+\c %define foo(x)   1+x
+\c %define foo(x,y) 1+x*y
+
+the preprocessor will be able to handle both types of macro call,
+by counting the parameters you pass; so \c{foo(3)} will become
+\c{1+3} whereas \c{foo(ebx,2)} will become \c{1+ebx*2}. However, if
+you define
+
+\c %define foo bar
+
+then no other definition of \c{foo} will be accepted: a macro with
+no parameters prohibits the definition of the same name as a macro
+\e{with} parameters, and vice versa.
+
+This doesn't prevent single-line macros being \e{redefined}: you can
+perfectly well define a macro with
+
+\c %define foo bar
+
+and then re-define it later in the same source file with
+
+\c %define foo baz
+
+Then everywhere the macro \c{foo} is invoked, it will be expanded
+according to the most recent definition. This is particularly useful
+when defining single-line macros with \c{%assign} (see \k{assign}).
+
+You can \i{pre-define} single-line macros using the `-d' option on
+the NASM command line: see \k{opt-d}.
+
+
+\S{xdefine} Resolving \c{%define}: \I\c{%ixdefine}\i\c{%xdefine}
+
+To have a reference to an embedded single-line macro resolved at the
+time that the embedding macro is \e{defined}, as opposed to when the
+embedding macro is \e{expanded}, you need a different mechanism to the
+one offered by \c{%define}. The solution is to use \c{%xdefine}, or
+it's \I{case sensitive}case-insensitive counterpart \c{%ixdefine}.
+
+Suppose you have the following code:
+
+\c %define  isTrue  1
+\c %define  isFalse isTrue
+\c %define  isTrue  0
+\c
+\c val1:    db      isFalse
+\c
+\c %define  isTrue  1
+\c
+\c val2:    db      isFalse
+
+In this case, \c{val1} is equal to 0, and \c{val2} is equal to 1.
+This is because, when a single-line macro is defined using
+\c{%define}, it is expanded only when it is called. As \c{isFalse}
+expands to \c{isTrue}, the expansion will be the current value of
+\c{isTrue}. The first time it is called that is 0, and the second
+time it is 1.
+
+If you wanted \c{isFalse} to expand to the value assigned to the
+embedded macro \c{isTrue} at the time that \c{isFalse} was defined,
+you need to change the above code to use \c{%xdefine}.
+
+\c %xdefine isTrue  1
+\c %xdefine isFalse isTrue
+\c %xdefine isTrue  0
+\c
+\c val1:    db      isFalse
+\c
+\c %xdefine isTrue  1
+\c
+\c val2:    db      isFalse
+
+Now, each time that \c{isFalse} is called, it expands to 1,
+as that is what the embedded macro \c{isTrue} expanded to at
+the time that \c{isFalse} was defined.
+
+
+\S{indmacro} \i{Macro Indirection}: \I\c{%[}\c{%[...]}
+
+The \c{%[...]} construct can be used to expand macros in contexts
+where macro expansion would otherwise not occur, including in the
+names other macros.  For example, if you have a set of macros named
+\c{Foo16}, \c{Foo32} and \c{Foo64}, you could write:
+
+\c     mov ax,Foo%[__BITS__]   ; The Foo value
+
+to use the builtin macro \c{__BITS__} (see \k{bitsm}) to automatically
+select between them.  Similarly, the two statements:
+
+\c %xdefine Bar                Quux    ; Expands due to %xdefine
+\c %define  Bar                %[Quux] ; Expands due to %[...]
+
+have, in fact, exactly the same effect.
+
+\c{%[...]} concatenates to adjacent tokens in the same way that
+multi-line macro parameters do, see \k{concat} for details.
+
+
+\S{concat%+} Concatenating Single Line Macro Tokens: \i\c{%+}
+
+Individual tokens in single line macros can be concatenated, to produce
+longer tokens for later processing. This can be useful if there are
+several similar macros that perform similar functions.
+
+Please note that a space is required after \c{%+}, in order to
+disambiguate it from the syntax \c{%+1} used in multiline macros.
+
+As an example, consider the following:
+
+\c %define BDASTART 400h                ; Start of BIOS data area
+
+\c struc   tBIOSDA                      ; its structure
+\c         .COM1addr       RESW    1
+\c         .COM2addr       RESW    1
+\c         ; ..and so on
+\c endstruc
+
+Now, if we need to access the elements of tBIOSDA in different places,
+we can end up with:
+
+\c         mov     ax,BDASTART + tBIOSDA.COM1addr
+\c         mov     bx,BDASTART + tBIOSDA.COM2addr
+
+This will become pretty ugly (and tedious) if used in many places, and
+can be reduced in size significantly by using the following macro:
+
+\c ; Macro to access BIOS variables by their names (from tBDA):
+
+\c %define BDA(x)  BDASTART + tBIOSDA. %+ x
+
+Now the above code can be written as:
+
+\c         mov     ax,BDA(COM1addr)
+\c         mov     bx,BDA(COM2addr)
+
+Using this feature, we can simplify references to a lot of macros (and,
+in turn, reduce typing errors).
+
+
+\S{selfref%?} The Macro Name Itself: \i\c{%?} and \i\c{%??}
+
+The special symbols \c{%?} and \c{%??} can be used to reference the
+macro name itself inside a macro expansion, this is supported for both
+single-and multi-line macros.  \c{%?} refers to the macro name as
+\e{invoked}, whereas \c{%??} refers to the macro name as
+\e{declared}.  The two are always the same for case-sensitive
+macros, but for case-insensitive macros, they can differ.
+
+For example:
+
+\c %idefine Foo mov %?,%??
+\c
+\c         foo
+\c         FOO
+
+will expand to:
+
+\c         mov foo,Foo
+\c         mov FOO,Foo
+
+The sequence:
+
+\c %idefine keyword $%?
+
+can be used to make a keyword "disappear", for example in case a new
+instruction has been used as a label in older code.  For example:
+
+\c %idefine pause $%?                  ; Hide the PAUSE instruction
+
+
+\S{undef} Undefining Single-Line Macros: \i\c{%undef}
+
+Single-line macros can be removed with the \c{%undef} directive.  For
+example, the following sequence:
+
+\c %define foo bar
+\c %undef  foo
+\c
+\c         mov     eax, foo
+
+will expand to the instruction \c{mov eax, foo}, since after
+\c{%undef} the macro \c{foo} is no longer defined.
+
+Macros that would otherwise be pre-defined can be undefined on the
+command-line using the `-u' option on the NASM command line: see
+\k{opt-u}.
+
+
+\S{assign} \i{Preprocessor Variables}: \i\c{%assign}
+
+An alternative way to define single-line macros is by means of the
+\c{%assign} command (and its \I{case sensitive}case-insensitive
+counterpart \i\c{%iassign}, which differs from \c{%assign} in
+exactly the same way that \c{%idefine} differs from \c{%define}).
+
+\c{%assign} is used to define single-line macros which take no
+parameters and have a numeric value. This value can be specified in
+the form of an expression, and it will be evaluated once, when the
+\c{%assign} directive is processed.
+
+Like \c{%define}, macros defined using \c{%assign} can be re-defined
+later, so you can do things like
+
+\c %assign i i+1
+
+to increment the numeric value of a macro.
+
+\c{%assign} is useful for controlling the termination of \c{%rep}
+preprocessor loops: see \k{rep} for an example of this. Another
+use for \c{%assign} is given in \k{16c} and \k{32c}.
+
+The expression passed to \c{%assign} is a \i{critical expression}
+(see \k{crit}), and must also evaluate to a pure number (rather than
+a relocatable reference such as a code or data address, or anything
+involving a register).
+
+
+\S{defstr} Defining Strings: \I\c{%idefstr}\i\c{%defstr}
+
+\c{%defstr}, and its case-insensitive counterpart \c{%idefstr}, define
+or redefine a single-line macro without parameters but converts the
+entire right-hand side, after macro expansion, to a quoted string
+before definition.
+
+For example:
+
+\c %defstr test TEST
+
+is equivalent to
+
+\c %define test 'TEST'
+
+This can be used, for example, with the \c{%!} construct (see
+\k{getenv}):
+
+\c %defstr PATH %!PATH          ; The operating system PATH variable
+
+
+\S{deftok} Defining Tokens: \I\c{%ideftok}\i\c{%deftok}
+
+\c{%deftok}, and its case-insensitive counterpart \c{%ideftok}, define
+or redefine a single-line macro without parameters but converts the
+second parameter, after string conversion, to a sequence of tokens.
+
+For example:
+
+\c %deftok test 'TEST'
+
+is equivalent to
+
+\c %define test TEST
+
+
+\H{strlen} \i{String Manipulation in Macros}
+
+It's often useful to be able to handle strings in macros. NASM
+supports a few simple string handling macro operators from which
+more complex operations can be constructed.
+
+All the string operators define or redefine a value (either a string
+or a numeric value) to a single-line macro.  When producing a string
+value, it may change the style of quoting of the input string or
+strings, and possibly use \c{\\}-escapes inside \c{`}-quoted strings.
+
+\S{strcat} \i{Concatenating Strings}: \i\c{%strcat}
+
+The \c{%strcat} operator concatenates quoted strings and assign them to
+a single-line macro.
+
+For example:
+
+\c %strcat alpha "Alpha: ", '12" screen'
+
+... would assign the value \c{'Alpha: 12" screen'} to \c{alpha}.
+Similarly:
+
+\c %strcat beta '"foo"\', "'bar'"
+
+... would assign the value \c{`"foo"\\\\'bar'`} to \c{beta}.
+
+The use of commas to separate strings is permitted but optional.
+
+
+\S{strlen} \i{String Length}: \i\c{%strlen}
+
+The \c{%strlen} operator assigns the length of a string to a macro.
+For example:
+
+\c %strlen charcnt 'my string'
+
+In this example, \c{charcnt} would receive the value 9, just as
+if an \c{%assign} had been used. In this example, \c{'my string'}
+was a literal string but it could also have been a single-line
+macro that expands to a string, as in the following example:
+
+\c %define sometext 'my string'
+\c %strlen charcnt sometext
+
+As in the first case, this would result in \c{charcnt} being
+assigned the value of 9.
+
+
+\S{substr} \i{Extracting Substrings}: \i\c{%substr}
+
+Individual letters or substrings in strings can be extracted using the
+\c{%substr} operator.  An example of its use is probably more useful
+than the description:
+
+\c %substr mychar 'xyzw' 1       ; equivalent to %define mychar 'x'
+\c %substr mychar 'xyzw' 2       ; equivalent to %define mychar 'y'
+\c %substr mychar 'xyzw' 3       ; equivalent to %define mychar 'z'
+\c %substr mychar 'xyzw' 2,2     ; equivalent to %define mychar 'yz'
+\c %substr mychar 'xyzw' 2,-1    ; equivalent to %define mychar 'yzw'
+\c %substr mychar 'xyzw' 2,-2    ; equivalent to %define mychar 'yz'
+
+As with \c{%strlen} (see \k{strlen}), the first parameter is the
+single-line macro to be created and the second is the string. The
+third parameter specifies the first character to be selected, and the
+optional fourth parameter preceeded by comma) is the length.  Note
+that the first index is 1, not 0 and the last index is equal to the
+value that \c{%strlen} would assign given the same string. Index
+values out of range result in an empty string.  A negative length
+means "until N-1 characters before the end of string", i.e. \c{-1}
+means until end of string, \c{-2} until one character before, etc.
+
+
+\H{mlmacro} \i{Multi-Line Macros}: \I\c{%imacro}\i\c{%macro}
+
+Multi-line macros are much more like the type of macro seen in MASM
+and TASM: a multi-line macro definition in NASM looks something like
+this.
+
+\c %macro  prologue 1
+\c
+\c         push    ebp
+\c         mov     ebp,esp
+\c         sub     esp,%1
+\c
+\c %endmacro
+
+This defines a C-like function prologue as a macro: so you would
+invoke the macro with a call such as
+
+\c myfunc:   prologue 12
+
+which would expand to the three lines of code
+
+\c myfunc: push    ebp
+\c         mov     ebp,esp
+\c         sub     esp,12
+
+The number \c{1} after the macro name in the \c{%macro} line defines
+the number of parameters the macro \c{prologue} expects to receive.
+The use of \c{%1} inside the macro definition refers to the first
+parameter to the macro call. With a macro taking more than one
+parameter, subsequent parameters would be referred to as \c{%2},
+\c{%3} and so on.
+
+Multi-line macros, like single-line macros, are \i{case-sensitive},
+unless you define them using the alternative directive \c{%imacro}.
+
+If you need to pass a comma as \e{part} of a parameter to a
+multi-line macro, you can do that by enclosing the entire parameter
+in \I{braces, around macro parameters}braces. So you could code
+things like
+
+\c %macro  silly 2
+\c
+\c     %2: db      %1
+\c
+\c %endmacro
+\c
+\c         silly 'a', letter_a             ; letter_a:  db 'a'
+\c         silly 'ab', string_ab           ; string_ab: db 'ab'
+\c         silly {13,10}, crlf             ; crlf:      db 13,10
+
+
+\S{mlrmacro} \i{Recursive Multi-Line Macros}: \I\c{%irmacro}\i\c{%rmacro}
+
+A multi-line macro cannot be referenced within itself, in order to
+prevent accidental infinite recursion.
+
+Recursive multi-line macros allow for self-referencing, with the
+caveat that the user is aware of the existence, use and purpose of
+recursive multi-line macros. There is also a generous, but sane, upper
+limit to the number of recursions, in order to prevent run-away memory
+consumption in case of accidental infinite recursion.
+
+As with non-recursive multi-line macros, recursive multi-line macros are
+\i{case-sensitive}, unless you define them using the alternative
+directive \c{%irmacro}.
+
+
+\S{mlmacover} Overloading Multi-Line Macros\I{overloading, multi-line macros}
+
+As with single-line macros, multi-line macros can be overloaded by
+defining the same macro name several times with different numbers of
+parameters. This time, no exception is made for macros with no
+parameters at all. So you could define
+
+\c %macro  prologue 0
+\c
+\c         push    ebp
+\c         mov     ebp,esp
+\c
+\c %endmacro
+
+to define an alternative form of the function prologue which
+allocates no local stack space.
+
+Sometimes, however, you might want to `overload' a machine
+instruction; for example, you might want to define
+
+\c %macro  push 2
+\c
+\c         push    %1
+\c         push    %2
+\c
+\c %endmacro
+
+so that you could code
+
+\c         push    ebx             ; this line is not a macro call
+\c         push    eax,ecx         ; but this one is
+
+Ordinarily, NASM will give a warning for the first of the above two
+lines, since \c{push} is now defined to be a macro, and is being
+invoked with a number of parameters for which no definition has been
+given. The correct code will still be generated, but the assembler
+will give a warning. This warning can be disabled by the use of the
+\c{-w-macro-params} command-line option (see \k{opt-w}).
+
+
+\S{maclocal} \i{Macro-Local Labels}
+
+NASM allows you to define labels within a multi-line macro
+definition in such a way as to make them local to the macro call: so
+calling the same macro multiple times will use a different label
+each time. You do this by prefixing \i\c{%%} to the label name. So
+you can invent an instruction which executes a \c{RET} if the \c{Z}
+flag is set by doing this:
+
+\c %macro  retz 0
+\c
+\c         jnz     %%skip
+\c         ret
+\c     %%skip:
+\c
+\c %endmacro
+
+You can call this macro as many times as you want, and every time
+you call it NASM will make up a different `real' name to substitute
+for the label \c{%%skip}. The names NASM invents are of the form
+\c{..@2345.skip}, where the number 2345 changes with every macro
+call. The \i\c{..@} prefix prevents macro-local labels from
+interfering with the local label mechanism, as described in
+\k{locallab}. You should avoid defining your own labels in this form
+(the \c{..@} prefix, then a number, then another period) in case
+they interfere with macro-local labels.
+
+
+\S{mlmacgre} \i{Greedy Macro Parameters}
+
+Occasionally it is useful to define a macro which lumps its entire
+command line into one parameter definition, possibly after
+extracting one or two smaller parameters from the front. An example
+might be a macro to write a text string to a file in MS-DOS, where
+you might want to be able to write
+
+\c         writefile [filehandle],"hello, world",13,10
+
+NASM allows you to define the last parameter of a macro to be
+\e{greedy}, meaning that if you invoke the macro with more
+parameters than it expects, all the spare parameters get lumped into
+the last defined one along with the separating commas. So if you
+code:
+
+\c %macro  writefile 2+
+\c
+\c         jmp     %%endstr
+\c   %%str:        db      %2
+\c   %%endstr:
+\c         mov     dx,%%str
+\c         mov     cx,%%endstr-%%str
+\c         mov     bx,%1
+\c         mov     ah,0x40
+\c         int     0x21
+\c
+\c %endmacro
+
+then the example call to \c{writefile} above will work as expected:
+the text before the first comma, \c{[filehandle]}, is used as the
+first macro parameter and expanded when \c{%1} is referred to, and
+all the subsequent text is lumped into \c{%2} and placed after the
+\c{db}.
+
+The greedy nature of the macro is indicated to NASM by the use of
+the \I{+ modifier}\c{+} sign after the parameter count on the
+\c{%macro} line.
+
+If you define a greedy macro, you are effectively telling NASM how
+it should expand the macro given \e{any} number of parameters from
+the actual number specified up to infinity; in this case, for
+example, NASM now knows what to do when it sees a call to
+\c{writefile} with 2, 3, 4 or more parameters. NASM will take this
+into account when overloading macros, and will not allow you to
+define another form of \c{writefile} taking 4 parameters (for
+example).
+
+Of course, the above macro could have been implemented as a
+non-greedy macro, in which case the call to it would have had to
+look like
+
+\c           writefile [filehandle], {"hello, world",13,10}
+
+NASM provides both mechanisms for putting \i{commas in macro
+parameters}, and you choose which one you prefer for each macro
+definition.
+
+See \k{sectmac} for a better way to write the above macro.
+
+
+\S{mlmacdef} \i{Default Macro Parameters}
+
+NASM also allows you to define a multi-line macro with a \e{range}
+of allowable parameter counts. If you do this, you can specify
+defaults for \i{omitted parameters}. So, for example:
+
+\c %macro  die 0-1 "Painful program death has occurred."
+\c
+\c         writefile 2,%1
+\c         mov     ax,0x4c01
+\c         int     0x21
+\c
+\c %endmacro
+
+This macro (which makes use of the \c{writefile} macro defined in
+\k{mlmacgre}) can be called with an explicit error message, which it
+will display on the error output stream before exiting, or it can be
+called with no parameters, in which case it will use the default
+error message supplied in the macro definition.
+
+In general, you supply a minimum and maximum number of parameters
+for a macro of this type; the minimum number of parameters are then
+required in the macro call, and then you provide defaults for the
+optional ones. So if a macro definition began with the line
+
+\c %macro foobar 1-3 eax,[ebx+2]
+
+then it could be called with between one and three parameters, and
+\c{%1} would always be taken from the macro call. \c{%2}, if not
+specified by the macro call, would default to \c{eax}, and \c{%3} if
+not specified would default to \c{[ebx+2]}.
+
+You can provide extra information to a macro by providing
+too many default parameters:
+
+\c %macro quux 1 something
+
+This will trigger a warning by default; see \k{opt-w} for
+more information.
+When \c{quux} is invoked, it receives not one but two parameters.
+\c{something} can be referred to as \c{%2}. The difference
+between passing \c{something} this way and writing \c{something}
+in the macro body is that with this way \c{something} is evaluated
+when the macro is defined, not when it is expanded.
+
+You may omit parameter defaults from the macro definition, in which
+case the parameter default is taken to be blank. This can be useful
+for macros which can take a variable number of parameters, since the
+\i\c{%0} token (see \k{percent0}) allows you to determine how many
+parameters were really passed to the macro call.
+
+This defaulting mechanism can be combined with the greedy-parameter
+mechanism; so the \c{die} macro above could be made more powerful,
+and more useful, by changing the first line of the definition to
+
+\c %macro die 0-1+ "Painful program death has occurred.",13,10
+
+The maximum parameter count can be infinite, denoted by \c{*}. In
+this case, of course, it is impossible to provide a \e{full} set of
+default parameters. Examples of this usage are shown in \k{rotate}.
+
+
+\S{percent0} \i\c{%0}: \I{counting macro parameters}Macro Parameter Counter
+
+The parameter reference \c{%0} will return a numeric constant giving the
+number of parameters received, that is, if \c{%0} is n then \c{%}n is the
+last parameter. \c{%0} is mostly useful for macros that can take a variable
+number of parameters. It can be used as an argument to \c{%rep}
+(see \k{rep}) in order to iterate through all the parameters of a macro.
+Examples are given in \k{rotate}.
+
+
+\S{rotate} \i\c{%rotate}: \i{Rotating Macro Parameters}
+
+Unix shell programmers will be familiar with the \I{shift
+command}\c{shift} shell command, which allows the arguments passed
+to a shell script (referenced as \c{$1}, \c{$2} and so on) to be
+moved left by one place, so that the argument previously referenced
+as \c{$2} becomes available as \c{$1}, and the argument previously
+referenced as \c{$1} is no longer available at all.
+
+NASM provides a similar mechanism, in the form of \c{%rotate}. As
+its name suggests, it differs from the Unix \c{shift} in that no
+parameters are lost: parameters rotated off the left end of the
+argument list reappear on the right, and vice versa.
+
+\c{%rotate} is invoked with a single numeric argument (which may be
+an expression). The macro parameters are rotated to the left by that
+many places. If the argument to \c{%rotate} is negative, the macro
+parameters are rotated to the right.
+
+\I{iterating over macro parameters}So a pair of macros to save and
+restore a set of registers might work as follows:
+
+\c %macro  multipush 1-*
+\c
+\c   %rep  %0
+\c         push    %1
+\c   %rotate 1
+\c   %endrep
+\c
+\c %endmacro
+
+This macro invokes the \c{PUSH} instruction on each of its arguments
+in turn, from left to right. It begins by pushing its first
+argument, \c{%1}, then invokes \c{%rotate} to move all the arguments
+one place to the left, so that the original second argument is now
+available as \c{%1}. Repeating this procedure as many times as there
+were arguments (achieved by supplying \c{%0} as the argument to
+\c{%rep}) causes each argument in turn to be pushed.
+
+Note also the use of \c{*} as the maximum parameter count,
+indicating that there is no upper limit on the number of parameters
+you may supply to the \i\c{multipush} macro.
+
+It would be convenient, when using this macro, to have a \c{POP}
+equivalent, which \e{didn't} require the arguments to be given in
+reverse order. Ideally, you would write the \c{multipush} macro
+call, then cut-and-paste the line to where the pop needed to be
+done, and change the name of the called macro to \c{multipop}, and
+the macro would take care of popping the registers in the opposite
+order from the one in which they were pushed.
+
+This can be done by the following definition:
+
+\c %macro  multipop 1-*
+\c
+\c   %rep %0
+\c   %rotate -1
+\c         pop     %1
+\c   %endrep
+\c
+\c %endmacro
+
+This macro begins by rotating its arguments one place to the
+\e{right}, so that the original \e{last} argument appears as \c{%1}.
+This is then popped, and the arguments are rotated right again, so
+the second-to-last argument becomes \c{%1}. Thus the arguments are
+iterated through in reverse order.
+
+
+\S{concat} \i{Concatenating Macro Parameters}
+
+NASM can concatenate macro parameters and macro indirection constructs
+on to other text surrounding them. This allows you to declare a family
+of symbols, for example, in a macro definition. If, for example, you
+wanted to generate a table of key codes along with offsets into the
+table, you could code something like
+
+\c %macro keytab_entry 2
+\c
+\c     keypos%1    equ     $-keytab
+\c                 db      %2
+\c
+\c %endmacro
+\c
+\c keytab:
+\c           keytab_entry F1,128+1
+\c           keytab_entry F2,128+2
+\c           keytab_entry Return,13
+
+which would expand to
+
+\c keytab:
+\c keyposF1        equ     $-keytab
+\c                 db     128+1
+\c keyposF2        equ     $-keytab
+\c                 db      128+2
+\c keyposReturn    equ     $-keytab
+\c                 db      13
+
+You can just as easily concatenate text on to the other end of a
+macro parameter, by writing \c{%1foo}.
+
+If you need to append a \e{digit} to a macro parameter, for example
+defining labels \c{foo1} and \c{foo2} when passed the parameter
+\c{foo}, you can't code \c{%11} because that would be taken as the
+eleventh macro parameter. Instead, you must code
+\I{braces, after % sign}\c{%\{1\}1}, which will separate the first
+\c{1} (giving the number of the macro parameter) from the second
+(literal text to be concatenated to the parameter).
+
+This concatenation can also be applied to other preprocessor in-line
+objects, such as macro-local labels (\k{maclocal}) and context-local
+labels (\k{ctxlocal}). In all cases, ambiguities in syntax can be
+resolved by enclosing everything after the \c{%} sign and before the
+literal text in braces: so \c{%\{%foo\}bar} concatenates the text
+\c{bar} to the end of the real name of the macro-local label
+\c{%%foo}. (This is unnecessary, since the form NASM uses for the
+real names of macro-local labels means that the two usages
+\c{%\{%foo\}bar} and \c{%%foobar} would both expand to the same
+thing anyway; nevertheless, the capability is there.)
+
+The single-line macro indirection construct, \c{%[...]}
+(\k{indmacro}), behaves the same way as macro parameters for the
+purpose of concatenation.
+
+See also the \c{%+} operator, \k{concat%+}.
+
+
+\S{mlmaccc} \i{Condition Codes as Macro Parameters}
+
+NASM can give special treatment to a macro parameter which contains
+a condition code. For a start, you can refer to the macro parameter
+\c{%1} by means of the alternative syntax \i\c{%+1}, which informs
+NASM that this macro parameter is supposed to contain a condition
+code, and will cause the preprocessor to report an error message if
+the macro is called with a parameter which is \e{not} a valid
+condition code.
+
+Far more usefully, though, you can refer to the macro parameter by
+means of \i\c{%-1}, which NASM will expand as the \e{inverse}
+condition code. So the \c{retz} macro defined in \k{maclocal} can be
+replaced by a general \i{conditional-return macro} like this:
+
+\c %macro  retc 1
+\c
+\c         j%-1    %%skip
+\c         ret
+\c   %%skip:
+\c
+\c %endmacro
+
+This macro can now be invoked using calls like \c{retc ne}, which
+will cause the conditional-jump instruction in the macro expansion
+to come out as \c{JE}, or \c{retc po} which will make the jump a
+\c{JPE}.
+
+The \c{%+1} macro-parameter reference is quite happy to interpret
+the arguments \c{CXZ} and \c{ECXZ} as valid condition codes;
+however, \c{%-1} will report an error if passed either of these,
+because no inverse condition code exists.
+
+
+\S{nolist} \i{Disabling Listing Expansion}\I\c{.nolist}
+
+When NASM is generating a listing file from your program, it will
+generally expand multi-line macros by means of writing the macro
+call and then listing each line of the expansion. This allows you to
+see which instructions in the macro expansion are generating what
+code; however, for some macros this clutters the listing up
+unnecessarily.
+
+NASM therefore provides the \c{.nolist} qualifier, which you can
+include in a macro definition to inhibit the expansion of the macro
+in the listing file. The \c{.nolist} qualifier comes directly after
+the number of parameters, like this:
+
+\c %macro foo 1.nolist
+
+Or like this:
+
+\c %macro bar 1-5+.nolist a,b,c,d,e,f,g,h
+
+\S{unmacro} Undefining Multi-Line Macros: \i\c{%unmacro}
+
+Multi-line macros can be removed with the \c{%unmacro} directive.
+Unlike the \c{%undef} directive, however, \c{%unmacro} takes an
+argument specification, and will only remove \i{exact matches} with
+that argument specification.
+
+For example:
+
+\c %macro foo 1-3
+\c         ; Do something
+\c %endmacro
+\c %unmacro foo 1-3
+
+removes the previously defined macro \c{foo}, but
+
+\c %macro bar 1-3
+\c         ; Do something
+\c %endmacro
+\c %unmacro bar 1
+
+does \e{not} remove the macro \c{bar}, since the argument
+specification does not match exactly.
+
+
+\S{exitmacro} Exiting Multi-Line Macros: \i\c{%exitmacro}
+
+Multi-line macro expansions can be arbitrarily terminated with
+the \c{%exitmacro} directive.
+
+For example:
+
+\c %macro foo 1-3
+\c         ; Do something
+\c     %if<condition>
+\c         %exitmacro
+\c     %endif
+\c         ; Do something
+\c %endmacro
+
+\H{condasm} \i{Conditional Assembly}\I\c{%if}
+
+Similarly to the C preprocessor, NASM allows sections of a source
+file to be assembled only if certain conditions are met. The general
+syntax of this feature looks like this:
+
+\c %if<condition>
+\c     ; some code which only appears if <condition> is met
+\c %elif<condition2>
+\c     ; only appears if <condition> is not met but <condition2> is
+\c %else
+\c     ; this appears if neither <condition> nor <condition2> was met
+\c %endif
+
+The inverse forms \i\c{%ifn} and \i\c{%elifn} are also supported.
+
+The \i\c{%else} clause is optional, as is the \i\c{%elif} clause.
+You can have more than one \c{%elif} clause as well.
+
+There are a number of variants of the \c{%if} directive.  Each has its
+corresponding \c{%elif}, \c{%ifn}, and \c{%elifn} directives; for
+example, the equivalents to the \c{%ifdef} directive are \c{%elifdef},
+\c{%ifndef}, and \c{%elifndef}.
+
+\S{ifdef} \i\c{%ifdef}: Testing Single-Line Macro Existence\I{testing,
+single-line macro existence}
+
+Beginning a conditional-assembly block with the line \c{%ifdef
+MACRO} will assemble the subsequent code if, and only if, a
+single-line macro called \c{MACRO} is defined. If not, then the
+\c{%elif} and \c{%else} blocks (if any) will be processed instead.
+
+For example, when debugging a program, you might want to write code
+such as
+
+\c           ; perform some function
+\c %ifdef DEBUG
+\c           writefile 2,"Function performed successfully",13,10
+\c %endif
+\c           ; go and do something else
+
+Then you could use the command-line option \c{-dDEBUG} to create a
+version of the program which produced debugging messages, and remove
+the option to generate the final release version of the program.
+
+You can test for a macro \e{not} being defined by using
+\i\c{%ifndef} instead of \c{%ifdef}. You can also test for macro
+definitions in \c{%elif} blocks by using \i\c{%elifdef} and
+\i\c{%elifndef}.
+
+
+\S{ifmacro} \i\c{%ifmacro}: Testing Multi-Line Macro
+Existence\I{testing, multi-line macro existence}
+
+The \c{%ifmacro} directive operates in the same way as the \c{%ifdef}
+directive, except that it checks for the existence of a multi-line macro.
+
+For example, you may be working with a large project and not have control
+over the macros in a library. You may want to create a macro with one
+name if it doesn't already exist, and another name if one with that name
+does exist.
+
+The \c{%ifmacro} is considered true if defining a macro with the given name
+and number of arguments would cause a definitions conflict. For example:
+
+\c %ifmacro MyMacro 1-3
+\c
+\c      %error "MyMacro 1-3" causes a conflict with an existing macro.
+\c
+\c %else
+\c
+\c      %macro MyMacro 1-3
+\c
+\c              ; insert code to define the macro
+\c
+\c      %endmacro
+\c
+\c %endif
+
+This will create the macro "MyMacro 1-3" if no macro already exists which
+would conflict with it, and emits a warning if there would be a definition
+conflict.
+
+You can test for the macro not existing by using the \i\c{%ifnmacro} instead
+of \c{%ifmacro}. Additional tests can be performed in \c{%elif} blocks by using
+\i\c{%elifmacro} and \i\c{%elifnmacro}.
+
+
+\S{ifctx} \i\c{%ifctx}: Testing the Context Stack\I{testing, context
+stack}
+
+The conditional-assembly construct \c{%ifctx} will cause the
+subsequent code to be assembled if and only if the top context on
+the preprocessor's context stack has the same name as one of the arguments.
+As with \c{%ifdef}, the inverse and \c{%elif} forms \i\c{%ifnctx},
+\i\c{%elifctx} and \i\c{%elifnctx} are also supported.
+
+For more details of the context stack, see \k{ctxstack}. For a
+sample use of \c{%ifctx}, see \k{blockif}.
+
+
+\S{if} \i\c{%if}: Testing Arbitrary Numeric Expressions\I{testing,
+arbitrary numeric expressions}
+
+The conditional-assembly construct \c{%if expr} will cause the
+subsequent code to be assembled if and only if the value of the
+numeric expression \c{expr} is non-zero. An example of the use of
+this feature is in deciding when to break out of a \c{%rep}
+preprocessor loop: see \k{rep} for a detailed example.
+
+The expression given to \c{%if}, and its counterpart \i\c{%elif}, is
+a critical expression (see \k{crit}).
+
+\c{%if} extends the normal NASM expression syntax, by providing a
+set of \i{relational operators} which are not normally available in
+expressions. The operators \i\c{=}, \i\c{<}, \i\c{>}, \i\c{<=},
+\i\c{>=} and \i\c{<>} test equality, less-than, greater-than,
+less-or-equal, greater-or-equal and not-equal respectively. The
+C-like forms \i\c{==} and \i\c{!=} are supported as alternative
+forms of \c{=} and \c{<>}. In addition, low-priority logical
+operators \i\c{&&}, \i\c{^^} and \i\c{||} are provided, supplying
+\i{logical AND}, \i{logical XOR} and \i{logical OR}. These work like
+the C logical operators (although C has no logical XOR), in that
+they always return either 0 or 1, and treat any non-zero input as 1
+(so that \c{^^}, for example, returns 1 if exactly one of its inputs
+is zero, and 0 otherwise). The relational operators also return 1
+for true and 0 for false.
+
+Like other \c{%if} constructs, \c{%if} has a counterpart
+\i\c{%elif}, and negative forms \i\c{%ifn} and \i\c{%elifn}.
+
+\S{ifidn} \i\c{%ifidn} and \i\c{%ifidni}: Testing Exact Text
+Identity\I{testing, exact text identity}
+
+The construct \c{%ifidn text1,text2} will cause the subsequent code
+to be assembled if and only if \c{text1} and \c{text2}, after
+expanding single-line macros, are identical pieces of text.
+Differences in white space are not counted.
+
+\c{%ifidni} is similar to \c{%ifidn}, but is \i{case-insensitive}.
+
+For example, the following macro pushes a register or number on the
+stack, and allows you to treat \c{IP} as a real register:
+
+\c %macro  pushparam 1
+\c
+\c   %ifidni %1,ip
+\c         call    %%label
+\c   %%label:
+\c   %else
+\c         push    %1
+\c   %endif
+\c
+\c %endmacro
+
+Like other \c{%if} constructs, \c{%ifidn} has a counterpart
+\i\c{%elifidn}, and negative forms \i\c{%ifnidn} and \i\c{%elifnidn}.
+Similarly, \c{%ifidni} has counterparts \i\c{%elifidni},
+\i\c{%ifnidni} and \i\c{%elifnidni}.
+
+\S{iftyp} \i\c{%ifid}, \i\c{%ifnum}, \i\c{%ifstr}: Testing Token
+Types\I{testing, token types}
+
+Some macros will want to perform different tasks depending on
+whether they are passed a number, a string, or an identifier. For
+example, a string output macro might want to be able to cope with
+being passed either a string constant or a pointer to an existing
+string.
+
+The conditional assembly construct \c{%ifid}, taking one parameter
+(which may be blank), assembles the subsequent code if and only if
+the first token in the parameter exists and is an identifier.
+\c{%ifnum} works similarly, but tests for the token being a numeric
+constant; \c{%ifstr} tests for it being a string.
+
+For example, the \c{writefile} macro defined in \k{mlmacgre} can be
+extended to take advantage of \c{%ifstr} in the following fashion:
+
+\c %macro writefile 2-3+
+\c
+\c   %ifstr %2
+\c         jmp     %%endstr
+\c     %if %0 = 3
+\c       %%str:    db      %2,%3
+\c     %else
+\c       %%str:    db      %2
+\c     %endif
+\c       %%endstr: mov     dx,%%str
+\c                 mov     cx,%%endstr-%%str
+\c   %else
+\c                 mov     dx,%2
+\c                 mov     cx,%3
+\c   %endif
+\c                 mov     bx,%1
+\c                 mov     ah,0x40
+\c                 int     0x21
+\c
+\c %endmacro
+
+Then the \c{writefile} macro can cope with being called in either of
+the following two ways:
+
+\c         writefile [file], strpointer, length
+\c         writefile [file], "hello", 13, 10
+
+In the first, \c{strpointer} is used as the address of an
+already-declared string, and \c{length} is used as its length; in
+the second, a string is given to the macro, which therefore declares
+it itself and works out the address and length for itself.
+
+Note the use of \c{%if} inside the \c{%ifstr}: this is to detect
+whether the macro was passed two arguments (so the string would be a
+single string constant, and \c{db %2} would be adequate) or more (in
+which case, all but the first two would be lumped together into
+\c{%3}, and \c{db %2,%3} would be required).
+
+The usual \I\c{%elifid}\I\c{%elifnum}\I\c{%elifstr}\c{%elif}...,
+\I\c{%ifnid}\I\c{%ifnnum}\I\c{%ifnstr}\c{%ifn}..., and
+\I\c{%elifnid}\I\c{%elifnnum}\I\c{%elifnstr}\c{%elifn}... versions
+exist for each of \c{%ifid}, \c{%ifnum} and \c{%ifstr}.
+
+\S{iftoken} \i\c{%iftoken}: Test for a Single Token
+
+Some macros will want to do different things depending on if it is
+passed a single token (e.g. paste it to something else using \c{%+})
+versus a multi-token sequence.
+
+The conditional assembly construct \c{%iftoken} assembles the
+subsequent code if and only if the expanded parameters consist of
+exactly one token, possibly surrounded by whitespace.
+
+For example:
+
+\c %iftoken 1
+
+will assemble the subsequent code, but
+
+\c %iftoken -1
+
+will not, since \c{-1} contains two tokens: the unary minus operator
+\c{-}, and the number \c{1}.
+
+The usual \i\c{%eliftoken}, \i\c\{%ifntoken}, and \i\c{%elifntoken}
+variants are also provided.
+
+\S{ifempty} \i\c{%ifempty}: Test for Empty Expansion
+
+The conditional assembly construct \c{%ifempty} assembles the
+subsequent code if and only if the expanded parameters do not contain
+any tokens at all, whitespace excepted.
+
+The usual \i\c{%elifempty}, \i\c\{%ifnempty}, and \i\c{%elifnempty}
+variants are also provided.
+
+\H{rep} \i{Preprocessor Loops}\I{repeating code}: \i\c{%rep}
+
+NASM's \c{TIMES} prefix, though useful, cannot be used to invoke a
+multi-line macro multiple times, because it is processed by NASM
+after macros have already been expanded. Therefore NASM provides
+another form of loop, this time at the preprocessor level: \c{%rep}.
+
+The directives \c{%rep} and \i\c{%endrep} (\c{%rep} takes a numeric
+argument, which can be an expression; \c{%endrep} takes no
+arguments) can be used to enclose a chunk of code, which is then
+replicated as many times as specified by the preprocessor:
+
+\c %assign i 0
+\c %rep    64
+\c         inc     word [table+2*i]
+\c %assign i i+1
+\c %endrep
+
+This will generate a sequence of 64 \c{INC} instructions,
+incrementing every word of memory from \c{[table]} to
+\c{[table+126]}.
+
+For more complex termination conditions, or to break out of a repeat
+loop part way along, you can use the \i\c{%exitrep} directive to
+terminate the loop, like this:
+
+\c fibonacci:
+\c %assign i 0
+\c %assign j 1
+\c %rep 100
+\c %if j > 65535
+\c     %exitrep
+\c %endif
+\c         dw j
+\c %assign k j+i
+\c %assign i j
+\c %assign j k
+\c %endrep
+\c
+\c fib_number equ ($-fibonacci)/2
+
+This produces a list of all the Fibonacci numbers that will fit in
+16 bits. Note that a maximum repeat count must still be given to
+\c{%rep}. This is to prevent the possibility of NASM getting into an
+infinite loop in the preprocessor, which (on multitasking or
+multi-user systems) would typically cause all the system memory to
+be gradually used up and other applications to start crashing.
+
+
+\H{files} Source Files and Dependencies
+
+These commands allow you to split your sources into multiple files.
+
+\S{include} \i\c{%include}: \i{Including Other Files}
+
+Using, once again, a very similar syntax to the C preprocessor,
+NASM's preprocessor lets you include other source files into your
+code. This is done by the use of the \i\c{%include} directive:
+
+\c %include "macros.mac"
+
+will include the contents of the file \c{macros.mac} into the source
+file containing the \c{%include} directive.
+
+Include files are \I{searching for include files}searched for in the
+current directory (the directory you're in when you run NASM, as
+opposed to the location of the NASM executable or the location of
+the source file), plus any directories specified on the NASM command
+line using the \c{-i} option.
+
+The standard C idiom for preventing a file being included more than
+once is just as applicable in NASM: if the file \c{macros.mac} has
+the form
+
+\c %ifndef MACROS_MAC
+\c     %define MACROS_MAC
+\c     ; now define some macros
+\c %endif
+
+then including the file more than once will not cause errors,
+because the second time the file is included nothing will happen
+because the macro \c{MACROS_MAC} will already be defined.
+
+You can force a file to be included even if there is no \c{%include}
+directive that explicitly includes it, by using the \i\c{-p} option
+on the NASM command line (see \k{opt-p}).
+
+
+\S{pathsearch} \i\c{%pathsearch}: Search the Include Path
+
+The \c{%pathsearch} directive takes a single-line macro name and a
+filename, and declare or redefines the specified single-line macro to
+be the include-path-resolved version of the filename, if the file
+exists (otherwise, it is passed unchanged.)
+
+For example,
+
+\c %pathsearch MyFoo "foo.bin"
+
+... with \c{-Ibins/} in the include path may end up defining the macro
+\c{MyFoo} to be \c{"bins/foo.bin"}.
+
+
+\S{depend} \i\c{%depend}: Add Dependent Files
+
+The \c{%depend} directive takes a filename and adds it to the list of
+files to be emitted as dependency generation when the \c{-M} options
+and its relatives (see \k{opt-M}) are used.  It produces no output.
+
+This is generally used in conjunction with \c{%pathsearch}.  For
+example, a simplified version of the standard macro wrapper for the
+\c{INCBIN} directive looks like:
+
+\c %imacro incbin 1-2+ 0
+\c %pathsearch dep %1
+\c %depend dep
+\c         incbin dep,%2
+\c %endmacro
+
+This first resolves the location of the file into the macro \c{dep},
+then adds it to the dependency lists, and finally issues the
+assembler-level \c{INCBIN} directive.
+
+
+\S{use} \i\c{%use}: Include Standard Macro Package
+
+The \c{%use} directive is similar to \c{%include}, but rather than
+including the contents of a file, it includes a named standard macro
+package.  The standard macro packages are part of NASM, and are
+described in \k{macropkg}.
+
+Unlike the \c{%include} directive, package names for the \c{%use}
+directive do not require quotes, but quotes are permitted.  In NASM
+2.04 and 2.05 the unquoted form would be macro-expanded; this is no
+longer true.  Thus, the following lines are equivalent:
+
+\c %use altreg
+\c %use 'altreg'
+
+Standard macro packages are protected from multiple inclusion.  When a
+standard macro package is used, a testable single-line macro of the
+form \c{__USE_}\e{package}\c{__} is also defined, see \k{use_def}.
+
+\H{ctxstack} The \i{Context Stack}
+
+Having labels that are local to a macro definition is sometimes not
+quite powerful enough: sometimes you want to be able to share labels
+between several macro calls. An example might be a \c{REPEAT} ...
+\c{UNTIL} loop, in which the expansion of the \c{REPEAT} macro
+would need to be able to refer to a label which the \c{UNTIL} macro
+had defined. However, for such a macro you would also want to be
+able to nest these loops.
+
+NASM provides this level of power by means of a \e{context stack}.
+The preprocessor maintains a stack of \e{contexts}, each of which is
+characterized by a name. You add a new context to the stack using
+the \i\c{%push} directive, and remove one using \i\c{%pop}. You can
+define labels that are local to a particular context on the stack.
+
+
+\S{pushpop} \i\c{%push} and \i\c{%pop}: \I{creating
+contexts}\I{removing contexts}Creating and Removing Contexts
+
+The \c{%push} directive is used to create a new context and place it
+on the top of the context stack. \c{%push} takes an optional argument,
+which is the name of the context. For example:
+
+\c %push    foobar
+
+This pushes a new context called \c{foobar} on the stack. You can have
+several contexts on the stack with the same name: they can still be
+distinguished.  If no name is given, the context is unnamed (this is
+normally used when both the \c{%push} and the \c{%pop} are inside a
+single macro definition.)
+
+The directive \c{%pop}, taking one optional argument, removes the top
+context from the context stack and destroys it, along with any
+labels associated with it.  If an argument is given, it must match the
+name of the current context, otherwise it will issue an error.
+
+
+\S{ctxlocal} \i{Context-Local Labels}
+
+Just as the usage \c{%%foo} defines a label which is local to the
+particular macro call in which it is used, the usage \I{%$}\c{%$foo}
+is used to define a label which is local to the context on the top
+of the context stack. So the \c{REPEAT} and \c{UNTIL} example given
+above could be implemented by means of:
+
+\c %macro repeat 0
+\c
+\c     %push   repeat
+\c     %$begin:
+\c
+\c %endmacro
+\c
+\c %macro until 1
+\c
+\c         j%-1    %$begin
+\c     %pop
+\c
+\c %endmacro
+
+and invoked by means of, for example,
+
+\c         mov     cx,string
+\c         repeat
+\c         add     cx,3
+\c         scasb
+\c         until   e
+
+which would scan every fourth byte of a string in search of the byte
+in \c{AL}.
+
+If you need to define, or access, labels local to the context
+\e{below} the top one on the stack, you can use \I{%$$}\c{%$$foo}, or
+\c{%$$$foo} for the context below that, and so on.
+
+
+\S{ctxdefine} \i{Context-Local Single-Line Macros}
+
+NASM also allows you to define single-line macros which are local to
+a particular context, in just the same way:
+
+\c %define %$localmac 3
+
+will define the single-line macro \c{%$localmac} to be local to the
+top context on the stack. Of course, after a subsequent \c{%push},
+it can then still be accessed by the name \c{%$$localmac}.
+
+
+\S{ctxrepl} \i\c{%repl}: \I{renaming contexts}Renaming a Context
+
+If you need to change the name of the top context on the stack (in
+order, for example, to have it respond differently to \c{%ifctx}),
+you can execute a \c{%pop} followed by a \c{%push}; but this will
+have the side effect of destroying all context-local labels and
+macros associated with the context that was just popped.
+
+NASM provides the directive \c{%repl}, which \e{replaces} a context
+with a different name, without touching the associated macros and
+labels. So you could replace the destructive code
+
+\c %pop
+\c %push   newname
+
+with the non-destructive version \c{%repl newname}.
+
+
+\S{blockif} Example Use of the \i{Context Stack}: \i{Block IFs}
+
+This example makes use of almost all the context-stack features,
+including the conditional-assembly construct \i\c{%ifctx}, to
+implement a block IF statement as a set of macros.
+
+\c %macro if 1
+\c
+\c     %push if
+\c     j%-1  %$ifnot
+\c
+\c %endmacro
+\c
+\c %macro else 0
+\c
+\c   %ifctx if
+\c         %repl   else
+\c         jmp     %$ifend
+\c         %$ifnot:
+\c   %else
+\c         %error  "expected `if' before `else'"
+\c   %endif
+\c
+\c %endmacro
+\c
+\c %macro endif 0
+\c
+\c   %ifctx if
+\c         %$ifnot:
+\c         %pop
+\c   %elifctx      else
+\c         %$ifend:
+\c         %pop
+\c   %else
+\c         %error  "expected `if' or `else' before `endif'"
+\c   %endif
+\c
+\c %endmacro
+
+This code is more robust than the \c{REPEAT} and \c{UNTIL} macros
+given in \k{ctxlocal}, because it uses conditional assembly to check
+that the macros are issued in the right order (for example, not
+calling \c{endif} before \c{if}) and issues a \c{%error} if they're
+not.
+
+In addition, the \c{endif} macro has to be able to cope with the two
+distinct cases of either directly following an \c{if}, or following
+an \c{else}. It achieves this, again, by using conditional assembly
+to do different things depending on whether the context on top of
+the stack is \c{if} or \c{else}.
+
+The \c{else} macro has to preserve the context on the stack, in
+order to have the \c{%$ifnot} referred to by the \c{if} macro be the
+same as the one defined by the \c{endif} macro, but has to change
+the context's name so that \c{endif} will know there was an
+intervening \c{else}. It does this by the use of \c{%repl}.
+
+A sample usage of these macros might look like:
+
+\c         cmp     ax,bx
+\c
+\c         if ae
+\c                cmp     bx,cx
+\c
+\c                if ae
+\c                        mov     ax,cx
+\c                else
+\c                        mov     ax,bx
+\c                endif
+\c
+\c         else
+\c                cmp     ax,cx
+\c
+\c                if ae
+\c                        mov     ax,cx
+\c                endif
+\c
+\c         endif
+
+The block-\c{IF} macros handle nesting quite happily, by means of
+pushing another context, describing the inner \c{if}, on top of the
+one describing the outer \c{if}; thus \c{else} and \c{endif} always
+refer to the last unmatched \c{if} or \c{else}.
+
+
+\H{stackrel} \i{Stack Relative Preprocessor Directives}
+
+The following preprocessor directives provide a way to use
+labels to refer to local variables allocated on the stack.
+
+\b\c{%arg}  (see \k{arg})
+
+\b\c{%stacksize}  (see \k{stacksize})
+
+\b\c{%local}  (see \k{local})
+
+
+\S{arg} \i\c{%arg} Directive
+
+The \c{%arg} directive is used to simplify the handling of
+parameters passed on the stack. Stack based parameter passing
+is used by many high level languages, including C, C++ and Pascal.
+
+While NASM has macros which attempt to duplicate this
+functionality (see \k{16cmacro}), the syntax is not particularly
+convenient to use. and is not TASM compatible. Here is an example
+which shows the use of \c{%arg} without any external macros:
+
+\c some_function:
+\c
+\c     %push     mycontext        ; save the current context
+\c     %stacksize large           ; tell NASM to use bp
+\c     %arg      i:word, j_ptr:word
+\c
+\c         mov     ax,[i]
+\c         mov     bx,[j_ptr]
+\c         add     ax,[bx]
+\c         ret
+\c
+\c     %pop                       ; restore original context
+
+This is similar to the procedure defined in \k{16cmacro} and adds
+the value in i to the value pointed to by j_ptr and returns the
+sum in the ax register. See \k{pushpop} for an explanation of
+\c{push} and \c{pop} and the use of context stacks.
+
+
+\S{stacksize} \i\c{%stacksize} Directive
+
+The \c{%stacksize} directive is used in conjunction with the
+\c{%arg} (see \k{arg}) and the \c{%local} (see \k{local}) directives.
+It tells NASM the default size to use for subsequent \c{%arg} and
+\c{%local} directives. The \c{%stacksize} directive takes one
+required argument which is one of \c{flat}, \c{flat64}, \c{large} or \c{small}.
+
+\c %stacksize flat
+
+This form causes NASM to use stack-based parameter addressing
+relative to \c{ebp} and it assumes that a near form of call was used
+to get to this label (i.e. that \c{eip} is on the stack).
+
+\c %stacksize flat64
+
+This form causes NASM to use stack-based parameter addressing
+relative to \c{rbp} and it assumes that a near form of call was used
+to get to this label (i.e. that \c{rip} is on the stack).
+
+\c %stacksize large
+
+This form uses \c{bp} to do stack-based parameter addressing and
+assumes that a far form of call was used to get to this address
+(i.e. that \c{ip} and \c{cs} are on the stack).
+
+\c %stacksize small
+
+This form also uses \c{bp} to address stack parameters, but it is
+different from \c{large} because it also assumes that the old value
+of bp is pushed onto the stack (i.e. it expects an \c{ENTER}
+instruction). In other words, it expects that \c{bp}, \c{ip} and
+\c{cs} are on the top of the stack, underneath any local space which
+may have been allocated by \c{ENTER}. This form is probably most
+useful when used in combination with the \c{%local} directive
+(see \k{local}).
+
+
+\S{local} \i\c{%local} Directive
+
+The \c{%local} directive is used to simplify the use of local
+temporary stack variables allocated in a stack frame. Automatic
+local variables in C are an example of this kind of variable. The
+\c{%local} directive is most useful when used with the \c{%stacksize}
+(see \k{stacksize} and is also compatible with the \c{%arg} directive
+(see \k{arg}). It allows simplified reference to variables on the
+stack which have been allocated typically by using the \c{ENTER}
+instruction.
+\# (see \k{insENTER} for a description of that instruction).
+An example of its use is the following:
+
+\c silly_swap:
+\c
+\c     %push mycontext             ; save the current context
+\c     %stacksize small            ; tell NASM to use bp
+\c     %assign %$localsize 0       ; see text for explanation
+\c     %local old_ax:word, old_dx:word
+\c
+\c         enter   %$localsize,0   ; see text for explanation
+\c         mov     [old_ax],ax     ; swap ax & bx
+\c         mov     [old_dx],dx     ; and swap dx & cx
+\c         mov     ax,bx
+\c         mov     dx,cx
+\c         mov     bx,[old_ax]
+\c         mov     cx,[old_dx]
+\c         leave                   ; restore old bp
+\c         ret                     ;
+\c
+\c     %pop                        ; restore original context
+
+The \c{%$localsize} variable is used internally by the
+\c{%local} directive and \e{must} be defined within the
+current context before the \c{%local} directive may be used.
+Failure to do so will result in one expression syntax error for
+each \c{%local} variable declared. It then may be used in
+the construction of an appropriately sized ENTER instruction
+as shown in the example.
+
+
+\H{pperror} Reporting \i{User-Defined Errors}: \i\c{%error}, \i\c{%warning}, \i\c{%fatal}
+
+The preprocessor directive \c{%error} will cause NASM to report an
+error if it occurs in assembled code. So if other users are going to
+try to assemble your source files, you can ensure that they define the
+right macros by means of code like this:
+
+\c %ifdef F1
+\c     ; do some setup
+\c %elifdef F2
+\c     ; do some different setup
+\c %else
+\c     %error "Neither F1 nor F2 was defined."
+\c %endif
+
+Then any user who fails to understand the way your code is supposed
+to be assembled will be quickly warned of their mistake, rather than
+having to wait until the program crashes on being run and then not
+knowing what went wrong.
+
+Similarly, \c{%warning} issues a warning, but allows assembly to continue:
+
+\c %ifdef F1
+\c     ; do some setup
+\c %elifdef F2
+\c     ; do some different setup
+\c %else
+\c     %warning "Neither F1 nor F2 was defined, assuming F1."
+\c     %define F1
+\c %endif
+
+\c{%error} and \c{%warning} are issued only on the final assembly
+pass.  This makes them safe to use in conjunction with tests that
+depend on symbol values.
+
+\c{%fatal} terminates assembly immediately, regardless of pass.  This
+is useful when there is no point in continuing the assembly further,
+and doing so is likely just going to cause a spew of confusing error
+messages.
+
+It is optional for the message string after \c{%error}, \c{%warning}
+or \c{%fatal} to be quoted.  If it is \e{not}, then single-line macros
+are expanded in it, which can be used to display more information to
+the user.  For example:
+
+\c %if foo > 64
+\c     %assign foo_over foo-64
+\c     %error foo is foo_over bytes too large
+\c %endif
+
+
+\H{otherpreproc} \i{Other Preprocessor Directives}
+
+NASM also has preprocessor directives which allow access to
+information from external sources. Currently they include:
+
+\b\c{%line} enables NASM to correctly handle the output of another
+preprocessor (see \k{line}).
+
+\b\c{%!} enables NASM to read in the value of an environment variable,
+which can then be used in your program (see \k{getenv}).
+
+\S{line} \i\c{%line} Directive
+
+The \c{%line} directive is used to notify NASM that the input line
+corresponds to a specific line number in another file.  Typically
+this other file would be an original source file, with the current
+NASM input being the output of a pre-processor.  The \c{%line}
+directive allows NASM to output messages which indicate the line
+number of the original source file, instead of the file that is being
+read by NASM.
+
+This preprocessor directive is not generally of use to programmers,
+by may be of interest to preprocessor authors.  The usage of the
+\c{%line} preprocessor directive is as follows:
+
+\c %line nnn[+mmm] [filename]
+
+In this directive, \c{nnn} identifies the line of the original source
+file which this line corresponds to.  \c{mmm} is an optional parameter
+which specifies a line increment value; each line of the input file
+read in is considered to correspond to \c{mmm} lines of the original
+source file.  Finally, \c{filename} is an optional parameter which
+specifies the file name of the original source file.
+
+After reading a \c{%line} preprocessor directive, NASM will report
+all file name and line numbers relative to the values specified
+therein.
+
+
+\S{getenv} \i\c{%!}\c{<env>}: Read an environment variable.
+
+The \c{%!<env>} directive makes it possible to read the value of an
+environment variable at assembly time. This could, for example, be used
+to store the contents of an environment variable into a string, which
+could be used at some other point in your code.
+
+For example, suppose that you have an environment variable \c{FOO}, and
+you want the contents of \c{FOO} to be embedded in your program. You
+could do that as follows:
+
+\c %defstr FOO    %!FOO
+
+See \k{defstr} for notes on the \c{%defstr} directive.
+
+
+\H{stdmac} \i{Standard Macros}
+
+NASM defines a set of standard macros, which are already defined
+when it starts to process any source file. If you really need a
+program to be assembled with no pre-defined macros, you can use the
+\i\c{%clear} directive to empty the preprocessor of everything but
+context-local preprocessor variables and single-line macros.
+
+Most \i{user-level assembler directives} (see \k{directive}) are
+implemented as macros which invoke primitive directives; these are
+described in \k{directive}. The rest of the standard macro set is
+described here.
+
+
+\S{stdmacver} \i{NASM Version} Macros
+
+The single-line macros \i\c{__NASM_MAJOR__}, \i\c{__NASM_MINOR__},
+\i\c{__NASM_SUBMINOR__} and \i\c{___NASM_PATCHLEVEL__} expand to the
+major, minor, subminor and patch level parts of the \i{version
+number of NASM} being used. So, under NASM 0.98.32p1 for
+example, \c{__NASM_MAJOR__} would be defined to be 0, \c{__NASM_MINOR__}
+would be defined as 98, \c{__NASM_SUBMINOR__} would be defined to 32,
+and \c{___NASM_PATCHLEVEL__} would be defined as 1.
+
+Additionally, the macro \i\c{__NASM_SNAPSHOT__} is defined for
+automatically generated snapshot releases \e{only}.
+
+
+\S{stdmacverid} \i\c{__NASM_VERSION_ID__}: \i{NASM Version ID}
+
+The single-line macro \c{__NASM_VERSION_ID__} expands to a dword integer
+representing the full version number of the version of nasm being used.
+The value is the equivalent to \c{__NASM_MAJOR__}, \c{__NASM_MINOR__},
+\c{__NASM_SUBMINOR__} and \c{___NASM_PATCHLEVEL__} concatenated to
+produce a single doubleword. Hence, for 0.98.32p1, the returned number
+would be equivalent to:
+
+\c         dd      0x00622001
+
+or
+
+\c         db      1,32,98,0
+
+Note that the above lines are generate exactly the same code, the second
+line is used just to give an indication of the order that the separate
+values will be present in memory.
+
+
+\S{stdmacverstr} \i\c{__NASM_VER__}: \i{NASM Version string}
+
+The single-line macro \c{__NASM_VER__} expands to a string which defines
+the version number of nasm being used. So, under NASM 0.98.32 for example,
+
+\c         db      __NASM_VER__
+
+would expand to
+
+\c         db      "0.98.32"
+
+
+\S{fileline} \i\c{__FILE__} and \i\c{__LINE__}: File Name and Line Number
+
+Like the C preprocessor, NASM allows the user to find out the file
+name and line number containing the current instruction. The macro
+\c{__FILE__} expands to a string constant giving the name of the
+current input file (which may change through the course of assembly
+if \c{%include} directives are used), and \c{__LINE__} expands to a
+numeric constant giving the current line number in the input file.
+
+These macros could be used, for example, to communicate debugging
+information to a macro, since invoking \c{__LINE__} inside a macro
+definition (either single-line or multi-line) will return the line
+number of the macro \e{call}, rather than \e{definition}. So to
+determine where in a piece of code a crash is occurring, for
+example, one could write a routine \c{stillhere}, which is passed a
+line number in \c{EAX} and outputs something like `line 155: still
+here'. You could then write a macro
+
+\c %macro  notdeadyet 0
+\c
+\c         push    eax
+\c         mov     eax,__LINE__
+\c         call    stillhere
+\c         pop     eax
+\c
+\c %endmacro
+
+and then pepper your code with calls to \c{notdeadyet} until you
+find the crash point.
+
+
+\S{bitsm} \i\c{__BITS__}: Current BITS Mode
+
+The \c{__BITS__} standard macro is updated every time that the BITS mode is
+set using the \c{BITS XX} or \c{[BITS XX]} directive, where XX is a valid mode
+number of 16, 32 or 64. \c{__BITS__} receives the specified mode number and
+makes it globally available. This can be very useful for those who utilize
+mode-dependent macros.
+
+\S{ofmtm} \i\c{__OUTPUT_FORMAT__}: Current Output Format
+
+The \c{__OUTPUT_FORMAT__} standard macro holds the current Output Format,
+as given by the \c{-f} option or NASM's default. Type \c{nasm -hf} for a
+list.
+
+\c %ifidn __OUTPUT_FORMAT__, win32
+\c  %define NEWLINE 13, 10
+\c %elifidn __OUTPUT_FORMAT__, elf32
+\c  %define NEWLINE 10
+\c %endif
+
+
+\S{datetime} Assembly Date and Time Macros
+
+NASM provides a variety of macros that represent the timestamp of the
+assembly session.
+
+\b The \i\c{__DATE__} and \i\c{__TIME__} macros give the assembly date and
+time as strings, in ISO 8601 format (\c{"YYYY-MM-DD"} and \c{"HH:MM:SS"},
+respectively.)
+
+\b The \i\c{__DATE_NUM__} and \i\c{__TIME_NUM__} macros give the assembly
+date and time in numeric form; in the format \c{YYYYMMDD} and
+\c{HHMMSS} respectively.
+
+\b The \i\c{__UTC_DATE__} and \i\c{__UTC_TIME__} macros give the assembly
+date and time in universal time (UTC) as strings, in ISO 8601 format
+(\c{"YYYY-MM-DD"} and \c{"HH:MM:SS"}, respectively.)  If the host
+platform doesn't provide UTC time, these macros are undefined.
+
+\b The \i\c{__UTC_DATE_NUM__} and \i\c{__UTC_TIME_NUM__} macros give the
+assembly date and time universal time (UTC) in numeric form; in the
+format \c{YYYYMMDD} and \c{HHMMSS} respectively.  If the
+host platform doesn't provide UTC time, these macros are
+undefined.
+
+\b The \c{__POSIX_TIME__} macro is defined as a number containing the
+number of seconds since the POSIX epoch, 1 January 1970 00:00:00 UTC;
+excluding any leap seconds.  This is computed using UTC time if
+available on the host platform, otherwise it is computed using the
+local time as if it was UTC.
+
+All instances of time and date macros in the same assembly session
+produce consistent output.  For example, in an assembly session
+started at 42 seconds after midnight on January 1, 2010 in Moscow
+(timezone UTC+3) these macros would have the following values,
+assuming, of course, a properly configured environment with a correct
+clock:
+
+\c       __DATE__             "2010-01-01"
+\c       __TIME__             "00:00:42"
+\c       __DATE_NUM__         20100101
+\c       __TIME_NUM__         000042
+\c       __UTC_DATE__         "2009-12-31"
+\c       __UTC_TIME__         "21:00:42"
+\c       __UTC_DATE_NUM__     20091231
+\c       __UTC_TIME_NUM__     210042
+\c       __POSIX_TIME__       1262293242
+
+
+\S{use_def} \I\c{__USE_*__}\c{__USE_}\e{package}\c{__}: Package
+Include Test
+
+When a standard macro package (see \k{macropkg}) is included with the
+\c{%use} directive (see \k{use}), a single-line macro of the form
+\c{__USE_}\e{package}\c{__} is automatically defined.  This allows
+testing if a particular package is invoked or not.
+
+For example, if the \c{altreg} package is included (see
+\k{pkg_altreg}), then the macro \c{__USE_ALTREG__} is defined.
+
+
+\S{pass_macro} \i\c{__PASS__}: Assembly Pass
+
+The macro \c{__PASS__} is defined to be \c{1} on preparatory passes,
+and \c{2} on the final pass.  In preprocess-only mode, it is set to
+\c{3}, and when running only to generate dependencies (due to the
+\c{-M} or \c{-MG} option, see \k{opt-M}) it is set to \c{0}.
+
+\e{Avoid using this macro if at all possible.  It is tremendously easy
+to generate very strange errors by misusing it, and the semantics may
+change in future versions of NASM.}
+
+
+\S{struc} \i\c{STRUC} and \i\c{ENDSTRUC}: \i{Declaring Structure} Data Types
+
+The core of NASM contains no intrinsic means of defining data
+structures; instead, the preprocessor is sufficiently powerful that
+data structures can be implemented as a set of macros. The macros
+\c{STRUC} and \c{ENDSTRUC} are used to define a structure data type.
+
+\c{STRUC} takes one or two parameters. The first parameter is the name
+of the data type. The second, optional parameter is the base offset of
+the structure. The name of the data type is defined as a symbol with
+the value of the base offset, and the name of the data type with the
+suffix \c{_size} appended to it is defined as an \c{EQU} giving the
+size of the structure. Once \c{STRUC} has been issued, you are
+defining the structure, and should define fields using the \c{RESB}
+family of pseudo-instructions, and then invoke \c{ENDSTRUC} to finish
+the definition.
+
+For example, to define a structure called \c{mytype} containing a
+longword, a word, a byte and a string of bytes, you might code
+
+\c struc   mytype
+\c
+\c   mt_long:      resd    1
+\c   mt_word:      resw    1
+\c   mt_byte:      resb    1
+\c   mt_str:       resb    32
+\c
+\c endstruc
+
+The above code defines six symbols: \c{mt_long} as 0 (the offset
+from the beginning of a \c{mytype} structure to the longword field),
+\c{mt_word} as 4, \c{mt_byte} as 6, \c{mt_str} as 7, \c{mytype_size}
+as 39, and \c{mytype} itself as zero.
+
+The reason why the structure type name is defined at zero by default
+is a side effect of allowing structures to work with the local label
+mechanism: if your structure members tend to have the same names in
+more than one structure, you can define the above structure like this:
+
+\c struc mytype
+\c
+\c   .long:        resd    1
+\c   .word:        resw    1
+\c   .byte:        resb    1
+\c   .str:         resb    32
+\c
+\c endstruc
+
+This defines the offsets to the structure fields as \c{mytype.long},
+\c{mytype.word}, \c{mytype.byte} and \c{mytype.str}.
+
+NASM, since it has no \e{intrinsic} structure support, does not
+support any form of period notation to refer to the elements of a
+structure once you have one (except the above local-label notation),
+so code such as \c{mov ax,[mystruc.mt_word]} is not valid.
+\c{mt_word} is a constant just like any other constant, so the
+correct syntax is \c{mov ax,[mystruc+mt_word]} or \c{mov
+ax,[mystruc+mytype.word]}.
+
+Sometimes you only have the address of the structure displaced by an
+offset. For example, consider this standard stack frame setup:
+
+\c push ebp
+\c mov ebp, esp
+\c sub esp, 40
+
+In this case, you could access an element by subtracting the offset:
+
+\c mov [ebp - 40 + mytype.word], ax
+
+However, if you do not want to repeat this offset, you can use -40 as
+a base offset:
+
+\c struc mytype, -40
+
+And access an element this way:
+
+\c mov [ebp + mytype.word], ax
+
+
+\S{istruc} \i\c{ISTRUC}, \i\c{AT} and \i\c{IEND}: Declaring
+\i{Instances of Structures}
+
+Having defined a structure type, the next thing you typically want
+to do is to declare instances of that structure in your data
+segment. NASM provides an easy way to do this in the \c{ISTRUC}
+mechanism. To declare a structure of type \c{mytype} in a program,
+you code something like this:
+
+\c mystruc:
+\c     istruc mytype
+\c
+\c         at mt_long, dd      123456
+\c         at mt_word, dw      1024
+\c         at mt_byte, db      'x'
+\c         at mt_str,  db      'hello, world', 13, 10, 0
+\c
+\c     iend
+
+The function of the \c{AT} macro is to make use of the \c{TIMES}
+prefix to advance the assembly position to the correct point for the
+specified structure field, and then to declare the specified data.
+Therefore the structure fields must be declared in the same order as
+they were specified in the structure definition.
+
+If the data to go in a structure field requires more than one source
+line to specify, the remaining source lines can easily come after
+the \c{AT} line. For example:
+
+\c         at mt_str,  db      123,134,145,156,167,178,189
+\c                     db      190,100,0
+
+Depending on personal taste, you can also omit the code part of the
+\c{AT} line completely, and start the structure field on the next
+line:
+
+\c         at mt_str
+\c                 db      'hello, world'
+\c                 db      13,10,0
+
+
+\S{align} \i\c{ALIGN} and \i\c{ALIGNB}: Data Alignment
+
+The \c{ALIGN} and \c{ALIGNB} macros provides a convenient way to
+align code or data on a word, longword, paragraph or other boundary.
+(Some assemblers call this directive \i\c{EVEN}.) The syntax of the
+\c{ALIGN} and \c{ALIGNB} macros is
+
+\c         align   4               ; align on 4-byte boundary
+\c         align   16              ; align on 16-byte boundary
+\c         align   8,db 0          ; pad with 0s rather than NOPs
+\c         align   4,resb 1        ; align to 4 in the BSS
+\c         alignb  4               ; equivalent to previous line
+
+Both macros require their first argument to be a power of two; they
+both compute the number of additional bytes required to bring the
+length of the current section up to a multiple of that power of two,
+and then apply the \c{TIMES} prefix to their second argument to
+perform the alignment.
+
+If the second argument is not specified, the default for \c{ALIGN}
+is \c{NOP}, and the default for \c{ALIGNB} is \c{RESB 1}. So if the
+second argument is specified, the two macros are equivalent.
+Normally, you can just use \c{ALIGN} in code and data sections and
+\c{ALIGNB} in BSS sections, and never need the second argument
+except for special purposes.
+
+\c{ALIGN} and \c{ALIGNB}, being simple macros, perform no error
+checking: they cannot warn you if their first argument fails to be a
+power of two, or if their second argument generates more than one
+byte of code. In each of these cases they will silently do the wrong
+thing.
+
+\c{ALIGNB} (or \c{ALIGN} with a second argument of \c{RESB 1}) can
+be used within structure definitions:
+
+\c struc mytype2
+\c
+\c   mt_byte:
+\c         resb 1
+\c         alignb 2
+\c   mt_word:
+\c         resw 1
+\c         alignb 4
+\c   mt_long:
+\c         resd 1
+\c   mt_str:
+\c         resb 32
+\c
+\c endstruc
+
+This will ensure that the structure members are sensibly aligned
+relative to the base of the structure.
+
+A final caveat: \c{ALIGN} and \c{ALIGNB} work relative to the
+beginning of the \e{section}, not the beginning of the address space
+in the final executable. Aligning to a 16-byte boundary when the
+section you're in is only guaranteed to be aligned to a 4-byte
+boundary, for example, is a waste of effort. Again, NASM does not
+check that the section's alignment characteristics are sensible for
+the use of \c{ALIGN} or \c{ALIGNB}.
+
+See also the \c{smartalign} standard macro package, \k{pkg_smartalign}.
+
+
+\C{macropkg} \i{Standard Macro Packages}
+
+The \i\c{%use} directive (see \k{use}) includes one of the standard
+macro packages included with the NASM distribution and compiled into
+the NASM binary.  It operates like the \c{%include} directive (see
+\k{include}), but the included contents is provided by NASM itself.
+
+The names of standard macro packages are case insensitive, and can be
+quoted or not.
+
+
+\H{pkg_altreg} \i\c{altreg}: \i{Alternate Register Names}
+
+The \c{altreg} standard macro package provides alternate register
+names.  It provides numeric register names for all registers (not just
+\c{R8}-\c{R15}), the Intel-defined aliases \c{R8L}-\c{R15L} for the
+low bytes of register (as opposed to the NASM/AMD standard names
+\c{R8B}-\c{R15B}), and the names \c{R0H}-\c{R3H} (by analogy with
+\c{R0L}-\c{R3L}) for \c{AH}, \c{CH}, \c{DH}, and \c{BH}.
+
+Example use:
+
+\c %use altreg
+\c
+\c proc:
+\c       mov r0l,r3h                    ; mov al,bh
+\c       ret
+
+See also \k{reg64}.
+
+
+\H{pkg_smartalign} \i\c{smartalign}\I{align, smart}: Smart \c{ALIGN} Macro
+
+The \c{smartalign} standard macro package provides for an \i\c{ALIGN}
+macro which is more powerful than the default (and
+backwards-compatible) one (see \k{align}).  When the \c{smartalign}
+package is enabled, when \c{ALIGN} is used without a second argument,
+NASM will generate a sequence of instructions more efficient than a
+series of \c{NOP}.  Furthermore, if the padding exceeds a specific
+threshold, then NASM will generate a jump over the entire padding
+sequence.
+
+The specific instructions generated can be controlled with the
+new \i\c{ALIGNMODE} macro.  This macro takes two parameters: one mode,
+and an optional jump threshold override.  The modes are as
+follows:
+
+\b \c{generic}: Works on all x86 CPUs and should have reasonable
+performance.  The default jump threshold is 8.  This is the
+default.
+
+\b \c{nop}: Pad out with \c{NOP} instructions.  The only difference
+compared to the standard \c{ALIGN} macro is that NASM can still jump
+over a large padding area.  The default jump threshold is 16.
+
+\b \c{k7}: Optimize for the AMD K7 (Athlon/Althon XP).  These
+instructions should still work on all x86 CPUs.  The default jump
+threshold is 16.
+
+\b \c{k8}: Optimize for the AMD K8 (Opteron/Althon 64).  These
+instructions should still work on all x86 CPUs.  The default jump
+threshold is 16.
+
+\b \c{p6}: Optimize for Intel CPUs.  This uses the long \c{NOP}
+instructions first introduced in Pentium Pro.  This is incompatible
+with all CPUs of family 5 or lower, as well as some VIA CPUs and
+several virtualization solutions.  The default jump threshold is 16.
+
+The macro \i\c{__ALIGNMODE__} is defined to contain the current
+alignment mode.  A number of other macros beginning with \c{__ALIGN_}
+are used internally by this macro package.
+
+
+\C{directive} \i{Assembler Directives}
+
+NASM, though it attempts to avoid the bureaucracy of assemblers like
+MASM and TASM, is nevertheless forced to support a \e{few}
+directives. These are described in this chapter.
+
+NASM's directives come in two types: \I{user-level
+directives}\e{user-level} directives and \I{primitive
+directives}\e{primitive} directives. Typically, each directive has a
+user-level form and a primitive form. In almost all cases, we
+recommend that users use the user-level forms of the directives,
+which are implemented as macros which call the primitive forms.
+
+Primitive directives are enclosed in square brackets; user-level
+directives are not.
+
+In addition to the universal directives described in this chapter,
+each object file format can optionally supply extra directives in
+order to control particular features of that file format. These
+\I{format-specific directives}\e{format-specific} directives are
+documented along with the formats that implement them, in \k{outfmt}.
+
+
+\H{bits} \i\c{BITS}: Specifying Target \i{Processor Mode}
+
+The \c{BITS} directive specifies whether NASM should generate code
+\I{16-bit mode, versus 32-bit mode}designed to run on a processor
+operating in 16-bit mode, 32-bit mode or 64-bit mode. The syntax is
+\c{BITS XX}, where XX is 16, 32 or 64.
+
+In most cases, you should not need to use \c{BITS} explicitly. The
+\c{aout}, \c{coff}, \c{elf}, \c{macho}, \c{win32} and \c{win64}
+object formats, which are designed for use in 32-bit or 64-bit
+operating systems, all cause NASM to select 32-bit or 64-bit mode,
+respectively, by default. The \c{obj} object format allows you
+to specify each segment you define as either \c{USE16} or \c{USE32},
+and NASM will set its operating mode accordingly, so the use of the
+\c{BITS} directive is once again unnecessary.
+
+The most likely reason for using the \c{BITS} directive is to write
+32-bit or 64-bit code in a flat binary file; this is because the \c{bin}
+output format defaults to 16-bit mode in anticipation of it being
+used most frequently to write DOS \c{.COM} programs, DOS \c{.SYS}
+device drivers and boot loader software.
+
+You do \e{not} need to specify \c{BITS 32} merely in order to use
+32-bit instructions in a 16-bit DOS program; if you do, the
+assembler will generate incorrect code because it will be writing
+code targeted at a 32-bit platform, to be run on a 16-bit one.
+
+When NASM is in \c{BITS 16} mode, instructions which use 32-bit
+data are prefixed with an 0x66 byte, and those referring to 32-bit
+addresses have an 0x67 prefix. In \c{BITS 32} mode, the reverse is
+true: 32-bit instructions require no prefixes, whereas instructions
+using 16-bit data need an 0x66 and those working on 16-bit addresses
+need an 0x67.
+
+When NASM is in \c{BITS 64} mode, most instructions operate the same
+as they do for \c{BITS 32} mode. However, there are 8 more general and
+SSE registers, and 16-bit addressing is no longer supported.
+
+The default address size is 64 bits; 32-bit addressing can be selected
+with the 0x67 prefix.  The default operand size is still 32 bits,
+however, and the 0x66 prefix selects 16-bit operand size.  The \c{REX}
+prefix is used both to select 64-bit operand size, and to access the
+new registers. NASM automatically inserts REX prefixes when
+necessary.
+
+When the \c{REX} prefix is used, the processor does not know how to
+address the AH, BH, CH or DH (high 8-bit legacy) registers. Instead,
+it is possible to access the the low 8-bits of the SP, BP SI and DI
+registers as SPL, BPL, SIL and DIL, respectively; but only when the
+REX prefix is used.
+
+The \c{BITS} directive has an exactly equivalent primitive form,
+\c{[BITS 16]}, \c{[BITS 32]} and \c{[BITS 64]}. The user-level form is
+a macro which has no function other than to call the primitive form.
+
+Note that the space is neccessary, e.g. \c{BITS32} will \e{not} work!
+
+\S{USE16 & USE32} \i\c{USE16} & \i\c{USE32}: Aliases for BITS
+
+The `\c{USE16}' and `\c{USE32}' directives can be used in place of
+`\c{BITS 16}' and `\c{BITS 32}', for compatibility with other assemblers.
+
+
+\H{default} \i\c{DEFAULT}: Change the assembler defaults
+
+The \c{DEFAULT} directive changes the assembler defaults.  Normally,
+NASM defaults to a mode where the programmer is expected to explicitly
+specify most features directly.  However, this is occationally
+obnoxious, as the explicit form is pretty much the only one one wishes
+to use.
+
+Currently, the only \c{DEFAULT} that is settable is whether or not
+registerless instructions in 64-bit mode are \c{RIP}-relative or not.
+By default, they are absolute unless overridden with the \i\c{REL}
+specifier (see \k{effaddr}).  However, if \c{DEFAULT REL} is
+specified, \c{REL} is default, unless overridden with the \c{ABS}
+specifier, \e{except when used with an FS or GS segment override}.
+
+The special handling of \c{FS} and \c{GS} overrides are due to the
+fact that these registers are generally used as thread pointers or
+other special functions in 64-bit mode, and generating
+\c{RIP}-relative addresses would be extremely confusing.
+
+\c{DEFAULT REL} is disabled with \c{DEFAULT ABS}.
+
+\H{section} \i\c{SECTION} or \i\c{SEGMENT}: Changing and \i{Defining
+Sections}
+
+\I{changing sections}\I{switching between sections}The \c{SECTION}
+directive (\c{SEGMENT} is an exactly equivalent synonym) changes
+which section of the output file the code you write will be
+assembled into. In some object file formats, the number and names of
+sections are fixed; in others, the user may make up as many as they
+wish. Hence \c{SECTION} may sometimes give an error message, or may
+define a new section, if you try to switch to a section that does
+not (yet) exist.
+
+The Unix object formats, and the \c{bin} object format (but see
+\k{multisec}, all support
+the \i{standardized section names} \c{.text}, \c{.data} and \c{.bss}
+for the code, data and uninitialized-data sections. The \c{obj}
+format, by contrast, does not recognize these section names as being
+special, and indeed will strip off the leading period of any section
+name that has one.
+
+
+\S{sectmac} The \i\c{__SECT__} Macro
+
+The \c{SECTION} directive is unusual in that its user-level form
+functions differently from its primitive form. The primitive form,
+\c{[SECTION xyz]}, simply switches the current target section to the
+one given. The user-level form, \c{SECTION xyz}, however, first
+defines the single-line macro \c{__SECT__} to be the primitive
+\c{[SECTION]} directive which it is about to issue, and then issues
+it. So the user-level directive
+
+\c         SECTION .text
+
+expands to the two lines
+
+\c %define __SECT__        [SECTION .text]
+\c         [SECTION .text]
+
+Users may find it useful to make use of this in their own macros.
+For example, the \c{writefile} macro defined in \k{mlmacgre} can be
+usefully rewritten in the following more sophisticated form:
+
+\c %macro  writefile 2+
+\c
+\c         [section .data]
+\c
+\c   %%str:        db      %2
+\c   %%endstr:
+\c
+\c         __SECT__
+\c
+\c         mov     dx,%%str
+\c         mov     cx,%%endstr-%%str
+\c         mov     bx,%1
+\c         mov     ah,0x40
+\c         int     0x21
+\c
+\c %endmacro
+
+This form of the macro, once passed a string to output, first
+switches temporarily to the data section of the file, using the
+primitive form of the \c{SECTION} directive so as not to modify
+\c{__SECT__}. It then declares its string in the data section, and
+then invokes \c{__SECT__} to switch back to \e{whichever} section
+the user was previously working in. It thus avoids the need, in the
+previous version of the macro, to include a \c{JMP} instruction to
+jump over the data, and also does not fail if, in a complicated
+\c{OBJ} format module, the user could potentially be assembling the
+code in any of several separate code sections.
+
+
+\H{absolute} \i\c{ABSOLUTE}: Defining Absolute Labels
+
+The \c{ABSOLUTE} directive can be thought of as an alternative form
+of \c{SECTION}: it causes the subsequent code to be directed at no
+physical section, but at the hypothetical section starting at the
+given absolute address. The only instructions you can use in this
+mode are the \c{RESB} family.
+
+\c{ABSOLUTE} is used as follows:
+
+\c absolute 0x1A
+\c
+\c     kbuf_chr    resw    1
+\c     kbuf_free   resw    1
+\c     kbuf        resw    16
+
+This example describes a section of the PC BIOS data area, at
+segment address 0x40: the above code defines \c{kbuf_chr} to be
+0x1A, \c{kbuf_free} to be 0x1C, and \c{kbuf} to be 0x1E.
+
+The user-level form of \c{ABSOLUTE}, like that of \c{SECTION},
+redefines the \i\c{__SECT__} macro when it is invoked.
+
+\i\c{STRUC} and \i\c{ENDSTRUC} are defined as macros which use
+\c{ABSOLUTE} (and also \c{__SECT__}).
+
+\c{ABSOLUTE} doesn't have to take an absolute constant as an
+argument: it can take an expression (actually, a \i{critical
+expression}: see \k{crit}) and it can be a value in a segment. For
+example, a TSR can re-use its setup code as run-time BSS like this:
+
+\c         org     100h               ; it's a .COM program
+\c
+\c         jmp     setup              ; setup code comes last
+\c
+\c         ; the resident part of the TSR goes here
+\c setup:
+\c         ; now write the code that installs the TSR here
+\c
+\c absolute setup
+\c
+\c runtimevar1     resw    1
+\c runtimevar2     resd    20
+\c
+\c tsr_end:
+
+This defines some variables `on top of' the setup code, so that
+after the setup has finished running, the space it took up can be
+re-used as data storage for the running TSR. The symbol `tsr_end'
+can be used to calculate the total size of the part of the TSR that
+needs to be made resident.
+
+
+\H{extern} \i\c{EXTERN}: \i{Importing Symbols} from Other Modules
+
+\c{EXTERN} is similar to the MASM directive \c{EXTRN} and the C
+keyword \c{extern}: it is used to declare a symbol which is not
+defined anywhere in the module being assembled, but is assumed to be
+defined in some other module and needs to be referred to by this
+one. Not every object-file format can support external variables:
+the \c{bin} format cannot.
+
+The \c{EXTERN} directive takes as many arguments as you like. Each
+argument is the name of a symbol:
+
+\c extern  _printf
+\c extern  _sscanf,_fscanf
+
+Some object-file formats provide extra features to the \c{EXTERN}
+directive. In all cases, the extra features are used by suffixing a
+colon to the symbol name followed by object-format specific text.
+For example, the \c{obj} format allows you to declare that the
+default segment base of an external should be the group \c{dgroup}
+by means of the directive
+
+\c extern  _variable:wrt dgroup
+
+The primitive form of \c{EXTERN} differs from the user-level form
+only in that it can take only one argument at a time: the support
+for multiple arguments is implemented at the preprocessor level.
+
+You can declare the same variable as \c{EXTERN} more than once: NASM
+will quietly ignore the second and later redeclarations. You can't
+declare a variable as \c{EXTERN} as well as something else, though.
+
+
+\H{global} \i\c{GLOBAL}: \i{Exporting Symbols} to Other Modules
+
+\c{GLOBAL} is the other end of \c{EXTERN}: if one module declares a
+symbol as \c{EXTERN} and refers to it, then in order to prevent
+linker errors, some other module must actually \e{define} the
+symbol and declare it as \c{GLOBAL}. Some assemblers use the name
+\i\c{PUBLIC} for this purpose.
+
+The \c{GLOBAL} directive applying to a symbol must appear \e{before}
+the definition of the symbol.
+
+\c{GLOBAL} uses the same syntax as \c{EXTERN}, except that it must
+refer to symbols which \e{are} defined in the same module as the
+\c{GLOBAL} directive. For example:
+
+\c global _main
+\c _main:
+\c         ; some code
+
+\c{GLOBAL}, like \c{EXTERN}, allows object formats to define private
+extensions by means of a colon. The \c{elf} object format, for
+example, lets you specify whether global data items are functions or
+data:
+
+\c global  hashlookup:function, hashtable:data
+
+Like \c{EXTERN}, the primitive form of \c{GLOBAL} differs from the
+user-level form only in that it can take only one argument at a
+time.
+
+
+\H{common} \i\c{COMMON}: Defining Common Data Areas
+
+The \c{COMMON} directive is used to declare \i\e{common variables}.
+A common variable is much like a global variable declared in the
+uninitialized data section, so that
+
+\c common  intvar  4
+
+is similar in function to
+
+\c global  intvar
+\c section .bss
+\c
+\c intvar  resd    1
+
+The difference is that if more than one module defines the same
+common variable, then at link time those variables will be
+\e{merged}, and references to \c{intvar} in all modules will point
+at the same piece of memory.
+
+Like \c{GLOBAL} and \c{EXTERN}, \c{COMMON} supports object-format
+specific extensions. For example, the \c{obj} format allows common
+variables to be NEAR or FAR, and the \c{elf} format allows you to
+specify the alignment requirements of a common variable:
+
+\c common  commvar  4:near  ; works in OBJ
+\c common  intarray 100:4   ; works in ELF: 4 byte aligned
+
+Once again, like \c{EXTERN} and \c{GLOBAL}, the primitive form of
+\c{COMMON} differs from the user-level form only in that it can take
+only one argument at a time.
+
+
+\H{CPU} \i\c{CPU}: Defining CPU Dependencies
+
+The \i\c{CPU} directive restricts assembly to those instructions which
+are available on the specified CPU.
+
+Options are:
+
+\b\c{CPU 8086}          Assemble only 8086 instruction set
+
+\b\c{CPU 186}           Assemble instructions up to the 80186 instruction set
+
+\b\c{CPU 286}           Assemble instructions up to the 286 instruction set
+
+\b\c{CPU 386}           Assemble instructions up to the 386 instruction set
+
+\b\c{CPU 486}           486 instruction set
+
+\b\c{CPU 586}           Pentium instruction set
+
+\b\c{CPU PENTIUM}       Same as 586
+
+\b\c{CPU 686}           P6 instruction set
+
+\b\c{CPU PPRO}          Same as 686
+
+\b\c{CPU P2}            Same as 686
+
+\b\c{CPU P3}            Pentium III (Katmai) instruction sets
+
+\b\c{CPU KATMAI}        Same as P3
+
+\b\c{CPU P4}            Pentium 4 (Willamette) instruction set
+
+\b\c{CPU WILLAMETTE}    Same as P4
+
+\b\c{CPU PRESCOTT}      Prescott instruction set
+
+\b\c{CPU X64}           x86-64 (x64/AMD64/Intel 64) instruction set
+
+\b\c{CPU IA64}          IA64 CPU (in x86 mode) instruction set
+
+All options are case insensitive.  All instructions will be selected
+only if they apply to the selected CPU or lower.  By default, all
+instructions are available.
+
+
+\H{FLOAT} \i\c{FLOAT}: Handling of \I{floating-point, constants}floating-point constants
+
+By default, floating-point constants are rounded to nearest, and IEEE
+denormals are supported.  The following options can be set to alter
+this behaviour:
+
+\b\c{FLOAT DAZ}         Flush denormals to zero
+
+\b\c{FLOAT NODAZ}       Do not flush denormals to zero (default)
+
+\b\c{FLOAT NEAR}        Round to nearest (default)
+
+\b\c{FLOAT UP}          Round up (toward +Infinity)
+
+\b\c{FLOAT DOWN}        Round down (toward -Infinity)
+
+\b\c{FLOAT ZERO}        Round toward zero
+
+\b\c{FLOAT DEFAULT}     Restore default settings
+
+The standard macros \i\c{__FLOAT_DAZ__}, \i\c{__FLOAT_ROUND__}, and
+\i\c{__FLOAT__} contain the current state, as long as the programmer
+has avoided the use of the brackeded primitive form, (\c{[FLOAT]}).
+
+\c{__FLOAT__} contains the full set of floating-point settings; this
+value can be saved away and invoked later to restore the setting.
+
+
+\C{outfmt} \i{Output Formats}
+
+NASM is a portable assembler, designed to be able to compile on any
+ANSI C-supporting platform and produce output to run on a variety of
+Intel x86 operating systems. For this reason, it has a large number
+of available output formats, selected using the \i\c{-f} option on
+the NASM \i{command line}. Each of these formats, along with its
+extensions to the base NASM syntax, is detailed in this chapter.
+
+As stated in \k{opt-o}, NASM chooses a \i{default name} for your
+output file based on the input file name and the chosen output
+format. This will be generated by removing the \i{extension}
+(\c{.asm}, \c{.s}, or whatever you like to use) from the input file
+name, and substituting an extension defined by the output format.
+The extensions are given with each format below.
+
+
+\H{binfmt} \i\c{bin}: \i{Flat-Form Binary}\I{pure binary} Output
+
+The \c{bin} format does not produce object files: it generates
+nothing in the output file except the code you wrote. Such `pure
+binary' files are used by \i{MS-DOS}: \i\c{.COM} executables and
+\i\c{.SYS} device drivers are pure binary files. Pure binary output
+is also useful for \i{operating system} and \i{boot loader}
+development.
+
+The \c{bin} format supports \i{multiple section names}. For details of
+how NASM handles sections in the \c{bin} format, see \k{multisec}.
+
+Using the \c{bin} format puts NASM by default into 16-bit mode (see
+\k{bits}). In order to use \c{bin} to write 32-bit or 64-bit code,
+such as an OS kernel, you need to explicitly issue the \I\c{BITS}\c{BITS 32}
+or \I\c{BITS}\c{BITS 64} directive.
+
+\c{bin} has no default output file name extension: instead, it
+leaves your file name as it is once the original extension has been
+removed. Thus, the default is for NASM to assemble \c{binprog.asm}
+into a binary file called \c{binprog}.
+
+
+\S{org} \i\c{ORG}: Binary File \i{Program Origin}
+
+The \c{bin} format provides an additional directive to the list
+given in \k{directive}: \c{ORG}. The function of the \c{ORG}
+directive is to specify the origin address which NASM will assume
+the program begins at when it is loaded into memory.
+
+For example, the following code will generate the longword
+\c{0x00000104}:
+
+\c         org     0x100
+\c         dd      label
+\c label:
+
+Unlike the \c{ORG} directive provided by MASM-compatible assemblers,
+which allows you to jump around in the object file and overwrite
+code you have already generated, NASM's \c{ORG} does exactly what
+the directive says: \e{origin}. Its sole function is to specify one
+offset which is added to all internal address references within the
+section; it does not permit any of the trickery that MASM's version
+does. See \k{proborg} for further comments.
+
+
+\S{binseg} \c{bin} Extensions to the \c{SECTION}
+Directive\I{SECTION, bin extensions to}
+
+The \c{bin} output format extends the \c{SECTION} (or \c{SEGMENT})
+directive to allow you to specify the alignment requirements of
+segments. This is done by appending the \i\c{ALIGN} qualifier to the
+end of the section-definition line. For example,
+
+\c section .data   align=16
+
+switches to the section \c{.data} and also specifies that it must be
+aligned on a 16-byte boundary.
+
+The parameter to \c{ALIGN} specifies how many low bits of the
+section start address must be forced to zero. The alignment value
+given may be any power of two.\I{section alignment, in
+bin}\I{segment alignment, in bin}\I{alignment, in bin sections}
+
+
+\S{multisec} \i{Multisection}\I{bin, multisection} Support for the \c{bin} Format
+
+The \c{bin} format allows the use of multiple sections, of arbitrary names,
+besides the "known" \c{.text}, \c{.data}, and \c{.bss} names.
+
+\b Sections may be designated \i\c{progbits} or \i\c{nobits}. Default
+is \c{progbits} (except \c{.bss}, which defaults to \c{nobits},
+of course).
+
+\b Sections can be aligned at a specified boundary following the previous
+section with \c{align=}, or at an arbitrary byte-granular position with
+\i\c{start=}.
+
+\b Sections can be given a virtual start address, which will be used
+for the calculation of all memory references within that section
+with \i\c{vstart=}.
+
+\b Sections can be ordered using \i\c{follows=}\c{<section>} or
+\i\c{vfollows=}\c{<section>} as an alternative to specifying an explicit
+start address.
+
+\b Arguments to \c{org}, \c{start}, \c{vstart}, and \c{align=} are
+critical expressions. See \k{crit}. E.g. \c{align=(1 << ALIGN_SHIFT)}
+- \c{ALIGN_SHIFT} must be defined before it is used here.
+
+\b Any code which comes before an explicit \c{SECTION} directive
+is directed by default into the \c{.text} section.
+
+\b If an \c{ORG} statement is not given, \c{ORG 0} is used
+by default.
+
+\b The \c{.bss} section will be placed after the last \c{progbits}
+section, unless \c{start=}, \c{vstart=}, \c{follows=}, or \c{vfollows=}
+has been specified.
+
+\b All sections are aligned on dword boundaries, unless a different
+alignment has been specified.
+
+\b Sections may not overlap.
+
+\b NASM creates the \c{section.<secname>.start} for each section,
+which may be used in your code.
+
+\S{map}\i{Map Files}
+
+Map files can be generated in \c{-f bin} format by means of the \c{[map]}
+option. Map types of \c{all} (default), \c{brief}, \c{sections}, \c{segments},
+or \c{symbols} may be specified. Output may be directed to \c{stdout}
+(default), \c{stderr}, or a specified file. E.g.
+\c{[map symbols myfile.map]}. No "user form" exists, the square
+brackets must be used.
+
+
+\H{ithfmt} \i\c{ith}: \i{Intel Hex} Output
+
+The \c{ith} file format produces Intel hex-format files.  Just as the
+\c{bin} format, this is a flat memory image format with no support for
+relocation or linking.  It is usually used with ROM programmers and
+similar utilities.
+
+All extensions supported by the \c{bin} file format is also supported by
+the \c{ith} file format.
+
+\c{ith} provides a default output file-name extension of \c{.ith}.
+
+
+\H{srecfmt} \i\c{srec}: \i{Motorola S-Records} Output
+
+The \c{srec} file format produces Motorola S-records files.  Just as the
+\c{bin} format, this is a flat memory image format with no support for
+relocation or linking.  It is usually used with ROM programmers and
+similar utilities.
+
+All extensions supported by the \c{bin} file format is also supported by
+the \c{srec} file format.
+
+\c{srec} provides a default output file-name extension of \c{.srec}.
+
+
+\H{objfmt} \i\c{obj}: \i{Microsoft OMF}\I{OMF} Object Files
+
+The \c{obj} file format (NASM calls it \c{obj} rather than \c{omf}
+for historical reasons) is the one produced by \i{MASM} and
+\i{TASM}, which is typically fed to 16-bit DOS linkers to produce
+\i\c{.EXE} files. It is also the format used by \i{OS/2}.
+
+\c{obj} provides a default output file-name extension of \c{.obj}.
+
+\c{obj} is not exclusively a 16-bit format, though: NASM has full
+support for the 32-bit extensions to the format. In particular,
+32-bit \c{obj} format files are used by \i{Borland's Win32
+compilers}, instead of using Microsoft's newer \i\c{win32} object
+file format.
+
+The \c{obj} format does not define any special segment names: you
+can call your segments anything you like. Typical names for segments
+in \c{obj} format files are \c{CODE}, \c{DATA} and \c{BSS}.
+
+If your source file contains code before specifying an explicit
+\c{SEGMENT} directive, then NASM will invent its own segment called
+\i\c{__NASMDEFSEG} for you.
+
+When you define a segment in an \c{obj} file, NASM defines the
+segment name as a symbol as well, so that you can access the segment
+address of the segment. So, for example:
+
+\c segment data
+\c
+\c dvar:   dw      1234
+\c
+\c segment code
+\c
+\c function:
+\c         mov     ax,data         ; get segment address of data
+\c         mov     ds,ax           ; and move it into DS
+\c         inc     word [dvar]     ; now this reference will work
+\c         ret
+
+The \c{obj} format also enables the use of the \i\c{SEG} and
+\i\c{WRT} operators, so that you can write code which does things
+like
+
+\c extern  foo
+\c
+\c       mov   ax,seg foo            ; get preferred segment of foo
+\c       mov   ds,ax
+\c       mov   ax,data               ; a different segment
+\c       mov   es,ax
+\c       mov   ax,[ds:foo]           ; this accesses `foo'
+\c       mov   [es:foo wrt data],bx  ; so does this
+
+
+\S{objseg} \c{obj} Extensions to the \c{SEGMENT}
+Directive\I{SEGMENT, obj extensions to}
+
+The \c{obj} output format extends the \c{SEGMENT} (or \c{SECTION})
+directive to allow you to specify various properties of the segment
+you are defining. This is done by appending extra qualifiers to the
+end of the segment-definition line. For example,
+
+\c segment code private align=16
+
+defines the segment \c{code}, but also declares it to be a private
+segment, and requires that the portion of it described in this code
+module must be aligned on a 16-byte boundary.
+
+The available qualifiers are:
+
+\b \i\c{PRIVATE}, \i\c{PUBLIC}, \i\c{COMMON} and \i\c{STACK} specify
+the combination characteristics of the segment. \c{PRIVATE} segments
+do not get combined with any others by the linker; \c{PUBLIC} and
+\c{STACK} segments get concatenated together at link time; and
+\c{COMMON} segments all get overlaid on top of each other rather
+than stuck end-to-end.
+
+\b \i\c{ALIGN} is used, as shown above, to specify how many low bits
+of the segment start address must be forced to zero. The alignment
+value given may be any power of two from 1 to 4096; in reality, the
+only values supported are 1, 2, 4, 16, 256 and 4096, so if 8 is
+specified it will be rounded up to 16, and 32, 64 and 128 will all
+be rounded up to 256, and so on. Note that alignment to 4096-byte
+boundaries is a \i{PharLap} extension to the format and may not be
+supported by all linkers.\I{section alignment, in OBJ}\I{segment
+alignment, in OBJ}\I{alignment, in OBJ sections}
+
+\b \i\c{CLASS} can be used to specify the segment class; this feature
+indicates to the linker that segments of the same class should be
+placed near each other in the output file. The class name can be any
+word, e.g. \c{CLASS=CODE}.
+
+\b \i\c{OVERLAY}, like \c{CLASS}, is specified with an arbitrary word
+as an argument, and provides overlay information to an
+overlay-capable linker.
+
+\b Segments can be declared as \i\c{USE16} or \i\c{USE32}, which has
+the effect of recording the choice in the object file and also
+ensuring that NASM's default assembly mode when assembling in that
+segment is 16-bit or 32-bit respectively.
+
+\b When writing \i{OS/2} object files, you should declare 32-bit
+segments as \i\c{FLAT}, which causes the default segment base for
+anything in the segment to be the special group \c{FLAT}, and also
+defines the group if it is not already defined.
+
+\b The \c{obj} file format also allows segments to be declared as
+having a pre-defined absolute segment address, although no linkers
+are currently known to make sensible use of this feature;
+nevertheless, NASM allows you to declare a segment such as
+\c{SEGMENT SCREEN ABSOLUTE=0xB800} if you need to. The \i\c{ABSOLUTE}
+and \c{ALIGN} keywords are mutually exclusive.
+
+NASM's default segment attributes are \c{PUBLIC}, \c{ALIGN=1}, no
+class, no overlay, and \c{USE16}.
+
+
+\S{group} \i\c{GROUP}: Defining Groups of Segments\I{segments, groups of}
+
+The \c{obj} format also allows segments to be grouped, so that a
+single segment register can be used to refer to all the segments in
+a group. NASM therefore supplies the \c{GROUP} directive, whereby
+you can code
+
+\c segment data
+\c
+\c         ; some data
+\c
+\c segment bss
+\c
+\c         ; some uninitialized data
+\c
+\c group dgroup data bss
+
+which will define a group called \c{dgroup} to contain the segments
+\c{data} and \c{bss}. Like \c{SEGMENT}, \c{GROUP} causes the group
+name to be defined as a symbol, so that you can refer to a variable
+\c{var} in the \c{data} segment as \c{var wrt data} or as \c{var wrt
+dgroup}, depending on which segment value is currently in your
+segment register.
+
+If you just refer to \c{var}, however, and \c{var} is declared in a
+segment which is part of a group, then NASM will default to giving
+you the offset of \c{var} from the beginning of the \e{group}, not
+the \e{segment}. Therefore \c{SEG var}, also, will return the group
+base rather than the segment base.
+
+NASM will allow a segment to be part of more than one group, but
+will generate a warning if you do this. Variables declared in a
+segment which is part of more than one group will default to being
+relative to the first group that was defined to contain the segment.
+
+A group does not have to contain any segments; you can still make
+\c{WRT} references to a group which does not contain the variable
+you are referring to. OS/2, for example, defines the special group
+\c{FLAT} with no segments in it.
+
+
+\S{uppercase} \i\c{UPPERCASE}: Disabling Case Sensitivity in Output
+
+Although NASM itself is \i{case sensitive}, some OMF linkers are
+not; therefore it can be useful for NASM to output single-case
+object files. The \c{UPPERCASE} format-specific directive causes all
+segment, group and symbol names that are written to the object file
+to be forced to upper case just before being written. Within a
+source file, NASM is still case-sensitive; but the object file can
+be written entirely in upper case if desired.
+
+\c{UPPERCASE} is used alone on a line; it requires no parameters.
+
+
+\S{import} \i\c{IMPORT}: Importing DLL Symbols\I{DLL symbols,
+importing}\I{symbols, importing from DLLs}
+
+The \c{IMPORT} format-specific directive defines a symbol to be
+imported from a DLL, for use if you are writing a DLL's \i{import
+library} in NASM. You still need to declare the symbol as \c{EXTERN}
+as well as using the \c{IMPORT} directive.
+
+The \c{IMPORT} directive takes two required parameters, separated by
+white space, which are (respectively) the name of the symbol you
+wish to import and the name of the library you wish to import it
+from. For example:
+
+\c     import  WSAStartup wsock32.dll
+
+A third optional parameter gives the name by which the symbol is
+known in the library you are importing it from, in case this is not
+the same as the name you wish the symbol to be known by to your code
+once you have imported it. For example:
+
+\c     import  asyncsel wsock32.dll WSAAsyncSelect
+
+
+\S{export} \i\c{EXPORT}: Exporting DLL Symbols\I{DLL symbols,
+exporting}\I{symbols, exporting from DLLs}
+
+The \c{EXPORT} format-specific directive defines a global symbol to
+be exported as a DLL symbol, for use if you are writing a DLL in
+NASM. You still need to declare the symbol as \c{GLOBAL} as well as
+using the \c{EXPORT} directive.
+
+\c{EXPORT} takes one required parameter, which is the name of the
+symbol you wish to export, as it was defined in your source file. An
+optional second parameter (separated by white space from the first)
+gives the \e{external} name of the symbol: the name by which you
+wish the symbol to be known to programs using the DLL. If this name
+is the same as the internal name, you may leave the second parameter
+off.
+
+Further parameters can be given to define attributes of the exported
+symbol. These parameters, like the second, are separated by white
+space. If further parameters are given, the external name must also
+be specified, even if it is the same as the internal name. The
+available attributes are:
+
+\b \c{resident} indicates that the exported name is to be kept
+resident by the system loader. This is an optimisation for
+frequently used symbols imported by name.
+
+\b \c{nodata} indicates that the exported symbol is a function which
+does not make use of any initialized data.
+
+\b \c{parm=NNN}, where \c{NNN} is an integer, sets the number of
+parameter words for the case in which the symbol is a call gate
+between 32-bit and 16-bit segments.
+
+\b An attribute which is just a number indicates that the symbol
+should be exported with an identifying number (ordinal), and gives
+the desired number.
+
+For example:
+
+\c     export  myfunc
+\c     export  myfunc TheRealMoreFormalLookingFunctionName
+\c     export  myfunc myfunc 1234  ; export by ordinal
+\c     export  myfunc myfunc resident parm=23 nodata
+
+
+\S{dotdotstart} \i\c{..start}: Defining the \i{Program Entry
+Point}
+
+\c{OMF} linkers require exactly one of the object files being linked to
+define the program entry point, where execution will begin when the
+program is run. If the object file that defines the entry point is
+assembled using NASM, you specify the entry point by declaring the
+special symbol \c{..start} at the point where you wish execution to
+begin.
+
+
+\S{objextern} \c{obj} Extensions to the \c{EXTERN}
+Directive\I{EXTERN, obj extensions to}
+
+If you declare an external symbol with the directive
+
+\c     extern  foo
+
+then references such as \c{mov ax,foo} will give you the offset of
+\c{foo} from its preferred segment base (as specified in whichever
+module \c{foo} is actually defined in). So to access the contents of
+\c{foo} you will usually need to do something like
+
+\c         mov     ax,seg foo      ; get preferred segment base
+\c         mov     es,ax           ; move it into ES
+\c         mov     ax,[es:foo]     ; and use offset `foo' from it
+
+This is a little unwieldy, particularly if you know that an external
+is going to be accessible from a given segment or group, say
+\c{dgroup}. So if \c{DS} already contained \c{dgroup}, you could
+simply code
+
+\c         mov     ax,[foo wrt dgroup]
+
+However, having to type this every time you want to access \c{foo}
+can be a pain; so NASM allows you to declare \c{foo} in the
+alternative form
+
+\c     extern  foo:wrt dgroup
+
+This form causes NASM to pretend that the preferred segment base of
+\c{foo} is in fact \c{dgroup}; so the expression \c{seg foo} will
+now return \c{dgroup}, and the expression \c{foo} is equivalent to
+\c{foo wrt dgroup}.
+
+This \I{default-WRT mechanism}default-\c{WRT} mechanism can be used
+to make externals appear to be relative to any group or segment in
+your program. It can also be applied to common variables: see
+\k{objcommon}.
+
+
+\S{objcommon} \c{obj} Extensions to the \c{COMMON}
+Directive\I{COMMON, obj extensions to}
+
+The \c{obj} format allows common variables to be either near\I{near
+common variables} or far\I{far common variables}; NASM allows you to
+specify which your variables should be by the use of the syntax
+
+\c common  nearvar 2:near   ; `nearvar' is a near common
+\c common  farvar  10:far   ; and `farvar' is far
+
+Far common variables may be greater in size than 64Kb, and so the
+OMF specification says that they are declared as a number of
+\e{elements} of a given size. So a 10-byte far common variable could
+be declared as ten one-byte elements, five two-byte elements, two
+five-byte elements or one ten-byte element.
+
+Some \c{OMF} linkers require the \I{element size, in common
+variables}\I{common variables, element size}element size, as well as
+the variable size, to match when resolving common variables declared
+in more than one module. Therefore NASM must allow you to specify
+the element size on your far common variables. This is done by the
+following syntax:
+
+\c common  c_5by2  10:far 5        ; two five-byte elements
+\c common  c_2by5  10:far 2        ; five two-byte elements
+
+If no element size is specified, the default is 1. Also, the \c{FAR}
+keyword is not required when an element size is specified, since
+only far commons may have element sizes at all. So the above
+declarations could equivalently be
+
+\c common  c_5by2  10:5            ; two five-byte elements
+\c common  c_2by5  10:2            ; five two-byte elements
+
+In addition to these extensions, the \c{COMMON} directive in \c{obj}
+also supports default-\c{WRT} specification like \c{EXTERN} does
+(explained in \k{objextern}). So you can also declare things like
+
+\c common  foo     10:wrt dgroup
+\c common  bar     16:far 2:wrt data
+\c common  baz     24:wrt data:6
+
+
+\H{win32fmt} \i\c{win32}: Microsoft Win32 Object Files
+
+The \c{win32} output format generates Microsoft Win32 object files,
+suitable for passing to Microsoft linkers such as \i{Visual C++}.
+Note that Borland Win32 compilers do not use this format, but use
+\c{obj} instead (see \k{objfmt}).
+
+\c{win32} provides a default output file-name extension of \c{.obj}.
+
+Note that although Microsoft say that Win32 object files follow the
+\c{COFF} (Common Object File Format) standard, the object files produced
+by Microsoft Win32 compilers are not compatible with COFF linkers
+such as DJGPP's, and vice versa. This is due to a difference of
+opinion over the precise semantics of PC-relative relocations. To
+produce COFF files suitable for DJGPP, use NASM's \c{coff} output
+format; conversely, the \c{coff} format does not produce object
+files that Win32 linkers can generate correct output from.
+
+
+\S{win32sect} \c{win32} Extensions to the \c{SECTION}
+Directive\I{SECTION, win32 extensions to}
+
+Like the \c{obj} format, \c{win32} allows you to specify additional
+information on the \c{SECTION} directive line, to control the type
+and properties of sections you declare. Section types and properties
+are generated automatically by NASM for the \i{standard section names}
+\c{.text}, \c{.data} and \c{.bss}, but may still be overridden by
+these qualifiers.
+
+The available qualifiers are:
+
+\b \c{code}, or equivalently \c{text}, defines the section to be a
+code section. This marks the section as readable and executable, but
+not writable, and also indicates to the linker that the type of the
+section is code.
+
+\b \c{data} and \c{bss} define the section to be a data section,
+analogously to \c{code}. Data sections are marked as readable and
+writable, but not executable. \c{data} declares an initialized data
+section, whereas \c{bss} declares an uninitialized data section.
+
+\b \c{rdata} declares an initialized data section that is readable
+but not writable. Microsoft compilers use this section to place
+constants in it.
+
+\b \c{info} defines the section to be an \i{informational section},
+which is not included in the executable file by the linker, but may
+(for example) pass information \e{to} the linker. For example,
+declaring an \c{info}-type section called \i\c{.drectve} causes the
+linker to interpret the contents of the section as command-line
+options.
+
+\b \c{align=}, used with a trailing number as in \c{obj}, gives the
+\I{section alignment, in win32}\I{alignment, in win32
+sections}alignment requirements of the section. The maximum you may
+specify is 64: the Win32 object file format contains no means to
+request a greater section alignment than this. If alignment is not
+explicitly specified, the defaults are 16-byte alignment for code
+sections, 8-byte alignment for rdata sections and 4-byte alignment
+for data (and BSS) sections.
+Informational sections get a default alignment of 1 byte (no
+alignment), though the value does not matter.
+
+The defaults assumed by NASM if you do not specify the above
+qualifiers are:
+
+\c section .text    code  align=16
+\c section .data    data  align=4
+\c section .rdata   rdata align=8
+\c section .bss     bss   align=4
+
+Any other section name is treated by default like \c{.text}.
+
+\S{win32safeseh} \c{win32}: Safe Structured Exception Handling
+
+Among other improvements in Windows XP SP2 and Windows Server 2003
+Microsoft has introduced concept of "safe structured exception
+handling." General idea is to collect handlers' entry points in
+designated read-only table and have alleged entry point verified
+against this table prior exception control is passed to the handler. In
+order for an executable module to be equipped with such "safe exception
+handler table," all object modules on linker command line has to comply
+with certain criteria. If one single module among them does not, then
+the table in question is omitted and above mentioned run-time checks
+will not be performed for application in question. Table omission is by
+default silent and therefore can be easily overlooked. One can instruct
+linker to refuse to produce binary without such table by passing
+\c{/safeseh} command line option.
+
+Without regard to this run-time check merits it's natural to expect
+NASM to be capable of generating modules suitable for \c{/safeseh}
+linking. From developer's viewpoint the problem is two-fold:
+
+\b how to adapt modules not deploying exception handlers of their own;
+
+\b how to adapt/develop modules utilizing custom exception handling;
+
+Former can be easily achieved with any NASM version by adding following
+line to source code:
+
+\c $@feat.00 equ 1
+
+As of version 2.03 NASM adds this absolute symbol automatically. If
+it's not already present to be precise. I.e. if for whatever reason
+developer would choose to assign another value in source file, it would
+still be perfectly possible.
+
+Registering custom exception handler on the other hand requires certain
+"magic." As of version 2.03 additional directive is implemented,
+\c{safeseh}, which instructs the assembler to produce appropriately
+formatted input data for above mentioned "safe exception handler
+table." Its typical use would be:
+
+\c section .text
+\c extern  _MessageBoxA@16
+\c %if     __NASM_VERSION_ID__ >= 0x02030000
+\c safeseh handler         ; register handler as "safe handler"
+\c %endif
+\c handler:
+\c         push    DWORD 1 ; MB_OKCANCEL
+\c         push    DWORD caption
+\c         push    DWORD text
+\c         push    DWORD 0
+\c         call    _MessageBoxA@16
+\c         sub     eax,1   ; incidentally suits as return value
+\c                         ; for exception handler
+\c         ret
+\c global  _main
+\c _main:
+\c         push    DWORD handler
+\c         push    DWORD [fs:0]
+\c         mov     DWORD [fs:0],esp ; engage exception handler
+\c         xor     eax,eax
+\c         mov     eax,DWORD[eax]   ; cause exception
+\c         pop     DWORD [fs:0]     ; disengage exception handler
+\c         add     esp,4
+\c         ret
+\c text:   db      'OK to rethrow, CANCEL to generate core dump',0
+\c caption:db      'SEGV',0
+\c
+\c section .drectve info
+\c         db      '/defaultlib:user32.lib /defaultlib:msvcrt.lib '
+
+As you might imagine, it's perfectly possible to produce .exe binary
+with "safe exception handler table" and yet engage unregistered
+exception handler. Indeed, handler is engaged by simply manipulating
+\c{[fs:0]} location at run-time, something linker has no power over,
+run-time that is. It should be explicitly mentioned that such failure
+to register handler's entry point with \c{safeseh} directive has
+undesired side effect at run-time. If exception is raised and
+unregistered handler is to be executed, the application is abruptly
+terminated without any notification whatsoever. One can argue that
+system could  at least have logged some kind "non-safe exception
+handler in x.exe at address n" message in event log, but no, literally
+no notification is provided and user is left with no clue on what
+caused application failure.
+
+Finally, all mentions of linker in this paragraph refer to Microsoft
+linker version 7.x and later. Presence of \c{@feat.00} symbol and input
+data for "safe exception handler table" causes no backward
+incompatibilities and "safeseh" modules generated by NASM 2.03 and
+later can still be linked by earlier versions or non-Microsoft linkers.
+
+
+\H{win64fmt} \i\c{win64}: Microsoft Win64 Object Files
+
+The \c{win64} output format generates Microsoft Win64 object files,
+which is nearly 100% identical to the \c{win32} object format (\k{win32fmt})
+with the exception that it is meant to target 64-bit code and the x86-64
+platform altogether. This object file is used exactly the same as the \c{win32}
+object format (\k{win32fmt}), in NASM, with regard to this exception.
+
+\S{win64pic} \c{win64}: Writing Position-Independent Code
+
+While \c{REL} takes good care of RIP-relative addressing, there is one
+aspect that is easy to overlook for a Win64 programmer: indirect
+references. Consider a switch dispatch table:
+
+\c         jmp     QWORD[dsptch+rax*8]
+\c         ...
+\c dsptch: dq      case0
+\c         dq      case1
+\c         ...
+
+Even novice Win64 assembler programmer will soon realize that the code
+is not 64-bit savvy. Most notably linker will refuse to link it with
+"\c{'ADDR32' relocation to '.text' invalid without
+/LARGEADDRESSAWARE:NO}". So [s]he will have to split jmp instruction as
+following:
+
+\c         lea     rbx,[rel dsptch]
+\c         jmp     QWORD[rbx+rax*8]
+
+What happens behind the scene is that effective address in \c{lea} is
+encoded relative to instruction pointer, or in perfectly
+position-independent manner. But this is only part of the problem!
+Trouble is that in .dll context \c{caseN} relocations will make their
+way to the final module and might have to be adjusted at .dll load
+time. To be specific when it can't be loaded at preferred address. And
+when this occurs, pages with such relocations will be rendered private
+to current process, which kind of undermines the idea of sharing .dll.
+But no worry, it's trivial to fix:
+
+\c         lea     rbx,[rel dsptch]
+\c         add     rbx,QWORD[rbx+rax*8]
+\c         jmp     rbx
+\c         ...
+\c dsptch: dq      case0-dsptch
+\c         dq      case1-dsptch
+\c         ...
+
+NASM version 2.03 and later provides another alternative, \c{wrt
+..imagebase} operator, which returns offset from base address of the
+current image, be it .exe or .dll module, therefore the name. For those
+acquainted with PE-COFF format base address denotes start of
+\c{IMAGE_DOS_HEADER} structure. Here is how to implement switch with
+these image-relative references:
+
+\c         lea     rbx,[rel dsptch]
+\c         mov     eax,DWORD[rbx+rax*4]
+\c         sub     rbx,dsptch wrt ..imagebase
+\c         add     rbx,rax
+\c         jmp     rbx
+\c         ...
+\c dsptch: dd      case0 wrt ..imagebase
+\c         dd      case1 wrt ..imagebase
+
+One can argue that the operator is redundant. Indeed,  snippet before
+last works just fine with any NASM version and is not even Windows
+specific... The real reason for implementing \c{wrt ..imagebase} will
+become apparent in next paragraph.
+
+It should be noted that \c{wrt ..imagebase} is defined as 32-bit
+operand only:
+
+\c         dd      label wrt ..imagebase           ; ok
+\c         dq      label wrt ..imagebase           ; bad
+\c         mov     eax,label wrt ..imagebase       ; ok
+\c         mov     rax,label wrt ..imagebase       ; bad
+
+\S{win64seh} \c{win64}: Structured Exception Handling
+
+Structured exception handing in Win64 is completely different matter
+from Win32. Upon exception program counter value is noted, and
+linker-generated table comprising start and end addresses of all the
+functions [in given executable module] is traversed and compared to the
+saved program counter. Thus so called \c{UNWIND_INFO} structure is
+identified. If it's not found, then offending subroutine is assumed to
+be "leaf" and just mentioned lookup procedure is attempted for its
+caller. In Win64 leaf function is such function that does not call any
+other function \e{nor} modifies any Win64 non-volatile registers,
+including stack pointer. The latter ensures that it's possible to
+identify leaf function's caller by simply pulling the value from the
+top of the stack.
+
+While majority of subroutines written in assembler are not calling any
+other function, requirement for non-volatile registers' immutability
+leaves developer with not more than 7 registers and no stack frame,
+which is not necessarily what [s]he counted with. Customarily one would
+meet the requirement by saving non-volatile registers on stack and
+restoring them upon return, so what can go wrong? If [and only if] an
+exception is raised at run-time and no \c{UNWIND_INFO} structure is
+associated with such "leaf" function, the stack unwind procedure will
+expect to find caller's return address on the top of stack immediately
+followed by its frame. Given that developer pushed caller's
+non-volatile registers on stack, would the value on top point at some
+code segment or even addressable space? Well, developer can attempt
+copying caller's return address to the top of stack and this would
+actually work in some very specific circumstances. But unless developer
+can guarantee that these circumstances are always met, it's more
+appropriate to assume worst case scenario, i.e. stack unwind procedure
+going berserk. Relevant question is what happens then? Application is
+abruptly terminated without any notification whatsoever. Just like in
+Win32 case, one can argue that system could at least have logged
+"unwind procedure went berserk in x.exe at address n" in event log, but
+no, no trace of failure is left.
+
+Now, when we understand significance of the \c{UNWIND_INFO} structure,
+let's discuss what's in it and/or how it's processed. First of all it
+is checked for presence of reference to custom language-specific
+exception handler. If there is one, then it's invoked. Depending on the
+return value, execution flow is resumed (exception is said to be
+"handled"), \e{or} rest of \c{UNWIND_INFO} structure is processed as
+following. Beside optional reference to custom handler, it carries
+information about current callee's stack frame and where non-volatile
+registers are saved. Information is detailed enough to be able to
+reconstruct contents of caller's non-volatile registers upon call to
+current callee. And so caller's context is reconstructed, and then
+unwind procedure is repeated, i.e. another \c{UNWIND_INFO} structure is
+associated, this time, with caller's instruction pointer, which is then
+checked for presence of reference to language-specific handler, etc.
+The procedure is recursively repeated till exception is handled. As
+last resort system "handles" it by generating memory core dump and
+terminating the application.
+
+As for the moment of this writing NASM unfortunately does not
+facilitate generation of above mentioned detailed information about
+stack frame layout. But as of version 2.03 it implements building
+blocks for generating structures involved in stack unwinding. As
+simplest example, here is how to deploy custom exception handler for
+leaf function:
+
+\c default rel
+\c section .text
+\c extern  MessageBoxA
+\c handler:
+\c         sub     rsp,40
+\c         mov     rcx,0
+\c         lea     rdx,[text]
+\c         lea     r8,[caption]
+\c         mov     r9,1    ; MB_OKCANCEL
+\c         call    MessageBoxA
+\c         sub     eax,1   ; incidentally suits as return value
+\c                         ; for exception handler
+\c         add     rsp,40
+\c         ret
+\c global  main
+\c main:
+\c         xor     rax,rax
+\c         mov     rax,QWORD[rax]  ; cause exception
+\c         ret
+\c main_end:
+\c text:   db      'OK to rethrow, CANCEL to generate core dump',0
+\c caption:db      'SEGV',0
+\c
+\c section .pdata  rdata align=4
+\c         dd      main wrt ..imagebase
+\c         dd      main_end wrt ..imagebase
+\c         dd      xmain wrt ..imagebase
+\c section .xdata  rdata align=8
+\c xmain:  db      9,0,0,0
+\c         dd      handler wrt ..imagebase
+\c section .drectve info
+\c         db      '/defaultlib:user32.lib /defaultlib:msvcrt.lib '
+
+What you see in \c{.pdata} section is element of the "table comprising
+start and end addresses of function" along with reference to associated
+\c{UNWIND_INFO} structure. And what you see in \c{.xdata} section is
+\c{UNWIND_INFO} structure describing function with no frame, but with
+designated exception handler. References are \e{required} to be
+image-relative (which is the real reason for implementing \c{wrt
+..imagebase} operator). It should be noted that \c{rdata align=n}, as
+well as \c{wrt ..imagebase}, are optional in these two segments'
+contexts, i.e. can be omitted. Latter means that \e{all} 32-bit
+references, not only above listed required ones, placed into these two
+segments turn out image-relative. Why is it important to understand?
+Developer is allowed to append handler-specific data to \c{UNWIND_INFO}
+structure, and if [s]he adds a 32-bit reference, then [s]he will have
+to remember to adjust its value to obtain the real pointer.
+
+As already mentioned, in Win64 terms leaf function is one that does not
+call any other function \e{nor} modifies any non-volatile register,
+including stack pointer. But it's not uncommon that assembler
+programmer plans to utilize every single register and sometimes even
+have variable stack frame. Is there anything one can do with bare
+building blocks? I.e. besides manually composing fully-fledged
+\c{UNWIND_INFO} structure, which would surely be considered
+error-prone? Yes, there is. Recall that exception handler is called
+first, before stack layout is analyzed. As it turned out, it's
+perfectly possible to manipulate current callee's context in custom
+handler in manner that permits further stack unwinding. General idea is
+that handler would not actually "handle" the exception, but instead
+restore callee's context, as it was at its entry point and thus mimic
+leaf function. In other words, handler would simply undertake part of
+unwinding procedure. Consider following example:
+
+\c function:
+\c         mov     rax,rsp         ; copy rsp to volatile register
+\c         push    r15             ; save non-volatile registers
+\c         push    rbx
+\c         push    rbp
+\c         mov     r11,rsp         ; prepare variable stack frame
+\c         sub     r11,rcx
+\c         and     r11,-64
+\c         mov     QWORD[r11],rax  ; check for exceptions
+\c         mov     rsp,r11         ; allocate stack frame
+\c         mov     QWORD[rsp],rax  ; save original rsp value
+\c magic_point:
+\c         ...
+\c         mov     r11,QWORD[rsp]  ; pull original rsp value
+\c         mov     rbp,QWORD[r11-24]
+\c         mov     rbx,QWORD[r11-16]
+\c         mov     r15,QWORD[r11-8]
+\c         mov     rsp,r11         ; destroy frame
+\c         ret
+
+The keyword is that up to \c{magic_point} original \c{rsp} value
+remains in chosen volatile register and no non-volatile register,
+except for \c{rsp}, is modified. While past \c{magic_point} \c{rsp}
+remains constant till the very end of the \c{function}. In this case
+custom language-specific exception handler would look like this:
+
+\c EXCEPTION_DISPOSITION handler (EXCEPTION_RECORD *rec,ULONG64 frame,
+\c         CONTEXT *context,DISPATCHER_CONTEXT *disp)
+\c {   ULONG64 *rsp;
+\c     if (context->Rip<(ULONG64)magic_point)
+\c         rsp = (ULONG64 *)context->Rax;
+\c     else
+\c     {   rsp = ((ULONG64 **)context->Rsp)[0];
+\c         context->Rbp = rsp[-3];
+\c         context->Rbx = rsp[-2];
+\c         context->R15 = rsp[-1];
+\c     }
+\c     context->Rsp = (ULONG64)rsp;
+\c
+\c     memcpy (disp->ContextRecord,context,sizeof(CONTEXT));
+\c     RtlVirtualUnwind(UNW_FLAG_NHANDLER,disp->ImageBase,
+\c         dips->ControlPc,disp->FunctionEntry,disp->ContextRecord,
+\c         &disp->HandlerData,&disp->EstablisherFrame,NULL);
+\c     return ExceptionContinueSearch;
+\c }
+
+As custom handler mimics leaf function, corresponding \c{UNWIND_INFO}
+structure does not have to contain any information about stack frame
+and its layout.
+
+\H{cofffmt} \i\c{coff}: \i{Common Object File Format}
+
+The \c{coff} output type produces \c{COFF} object files suitable for
+linking with the \i{DJGPP} linker.
+
+\c{coff} provides a default output file-name extension of \c{.o}.
+
+The \c{coff} format supports the same extensions to the \c{SECTION}
+directive as \c{win32} does, except that the \c{align} qualifier and
+the \c{info} section type are not supported.
+
+\H{machofmt} \I{Mach-O}\i\c{macho32} and \i\c{macho64}: \i{Mach Object File Format}
+
+The \c{macho32} and \c{macho64} output formts produces \c{Mach-O}
+object files suitable for linking with the \i{MacOS X} linker.
+\i\c{macho} is a synonym for \c{macho32}.
+
+\c{macho} provides a default output file-name extension of \c{.o}.
+
+\H{elffmt} \i\c{elf32} and \i\c{elf64}: \I{ELF}\I{linux, elf}\i{Executable and Linkable
+Format} Object Files
+
+The \c{elf32} and \c{elf64} output formats generate \c{ELF32 and ELF64} (Executable and Linkable Format) object files, as used by Linux as well as \i{Unix System V},
+including \i{Solaris x86}, \i{UnixWare} and \i{SCO Unix}. \c{elf}
+provides a default output file-name extension of \c{.o}.
+\c{elf} is a synonym for \c{elf32}.
+
+\S{abisect} ELF specific directive \i\c{osabi}
+
+The ELF header specifies the application binary interface for the target operating system (OSABI).
+This field can be set by using the \c{osabi} directive with the numeric value (0-255) of the target
+ system. If this directive is not used, the default value will be "UNIX System V ABI" (0) which will work on
+ most systems which support ELF.
+
+\S{elfsect} \c{elf} Extensions to the \c{SECTION}
+Directive\I{SECTION, elf extensions to}
+
+Like the \c{obj} format, \c{elf} allows you to specify additional
+information on the \c{SECTION} directive line, to control the type
+and properties of sections you declare. Section types and properties
+are generated automatically by NASM for the \i{standard section
+names}, but may still be
+overridden by these qualifiers.
+
+The available qualifiers are:
+
+\b \i\c{alloc} defines the section to be one which is loaded into
+memory when the program is run. \i\c{noalloc} defines it to be one
+which is not, such as an informational or comment section.
+
+\b \i\c{exec} defines the section to be one which should have execute
+permission when the program is run. \i\c{noexec} defines it as one
+which should not.
+
+\b \i\c{write} defines the section to be one which should be writable
+when the program is run. \i\c{nowrite} defines it as one which should
+not.
+
+\b \i\c{progbits} defines the section to be one with explicit contents
+stored in the object file: an ordinary code or data section, for
+example, \i\c{nobits} defines the section to be one with no explicit
+contents given, such as a BSS section.
+
+\b \c{align=}, used with a trailing number as in \c{obj}, gives the
+\I{section alignment, in elf}\I{alignment, in elf sections}alignment
+requirements of the section.
+
+\b \i\c{tls} defines the section to be one which contains
+thread local variables.
+
+The defaults assumed by NASM if you do not specify the above
+qualifiers are:
+
+\I\c{.text} \I\c{.rodata} \I\c{.lrodata} \I\c{.data} \I\c{.ldata}
+\I\c{.bss} \I\c{.lbss} \I\c{.tdata} \I\c{.tbss} \I\c\{.comment}
+
+\c section .text    progbits  alloc   exec    nowrite  align=16
+\c section .rodata  progbits  alloc   noexec  nowrite  align=4
+\c section .lrodata progbits  alloc   noexec  nowrite  align=4
+\c section .data    progbits  alloc   noexec  write    align=4
+\c section .ldata   progbits  alloc   noexec  write    align=4
+\c section .bss     nobits    alloc   noexec  write    align=4
+\c section .lbss    nobits    alloc   noexec  write    align=4
+\c section .tdata   progbits  alloc   noexec  write    align=4    tls
+\c section .tbss    nobits    alloc   noexec  write    align=4    tls
+\c section .comment progbits  noalloc noexec  nowrite  align=1
+\c section other    progbits  alloc   noexec  nowrite  align=1
+
+(Any section name other than those in the above table
+ is treated by default like \c{other} in the above table.
+ Please note that section names are case sensitive.)
+
+
+\S{elfwrt} \i{Position-Independent Code}\I{PIC}: \c{elf} Special
+Symbols and \i\c{WRT}
+
+The \c{ELF} specification contains enough features to allow
+position-independent code (PIC) to be written, which makes \i{ELF
+shared libraries} very flexible. However, it also means NASM has to
+be able to generate a variety of ELF specific relocation types in ELF
+object files, if it is to be an assembler which can write PIC.
+
+Since \c{ELF} does not support segment-base references, the \c{WRT}
+operator is not used for its normal purpose; therefore NASM's
+\c{elf} output format makes use of \c{WRT} for a different purpose,
+namely the PIC-specific \I{relocations, PIC-specific}relocation
+types.
+
+\c{elf} defines five special symbols which you can use as the
+right-hand side of the \c{WRT} operator to obtain PIC relocation
+types. They are \i\c{..gotpc}, \i\c{..gotoff}, \i\c{..got},
+\i\c{..plt} and \i\c{..sym}. Their functions are summarized here:
+
+\b Referring to the symbol marking the global offset table base
+using \c{wrt ..gotpc} will end up giving the distance from the
+beginning of the current section to the global offset table.
+(\i\c{_GLOBAL_OFFSET_TABLE_} is the standard symbol name used to
+refer to the \i{GOT}.) So you would then need to add \i\c{$$} to the
+result to get the real address of the GOT.
+
+\b Referring to a location in one of your own sections using \c{wrt
+..gotoff} will give the distance from the beginning of the GOT to
+the specified location, so that adding on the address of the GOT
+would give the real address of the location you wanted.
+
+\b Referring to an external or global symbol using \c{wrt ..got}
+causes the linker to build an entry \e{in} the GOT containing the
+address of the symbol, and the reference gives the distance from the
+beginning of the GOT to the entry; so you can add on the address of
+the GOT, load from the resulting address, and end up with the
+address of the symbol.
+
+\b Referring to a procedure name using \c{wrt ..plt} causes the
+linker to build a \i{procedure linkage table} entry for the symbol,
+and the reference gives the address of the \i{PLT} entry. You can
+only use this in contexts which would generate a PC-relative
+relocation normally (i.e. as the destination for \c{CALL} or
+\c{JMP}), since ELF contains no relocation type to refer to PLT
+entries absolutely.
+
+\b Referring to a symbol name using \c{wrt ..sym} causes NASM to
+write an ordinary relocation, but instead of making the relocation
+relative to the start of the section and then adding on the offset
+to the symbol, it will write a relocation record aimed directly at
+the symbol in question. The distinction is a necessary one due to a
+peculiarity of the dynamic linker.
+
+A fuller explanation of how to use these relocation types to write
+shared libraries entirely in NASM is given in \k{picdll}.
+
+\S{elftls} \i{Thread Local Storage}\I{TLS}: \c{elf} Special
+Symbols and \i\c{WRT}
+
+\b In ELF32 mode, referring to an external or global symbol using
+\c{wrt ..tlsie} \I\c{..tlsie}
+causes the linker to build an entry \e{in} the GOT containing the
+offset of the symbol within the TLS block, so you can access the value
+of the symbol with code such as:
+
+\c       mov  eax,[tid wrt ..tlsie]
+\c       mov  [gs:eax],ebx
+
+
+\b In ELF64 mode, referring to an external or global symbol using
+\c{wrt ..gottpoff} \I\c{..gottpoff}
+causes the linker to build an entry \e{in} the GOT containing the
+offset of the symbol within the TLS block, so you can access the value
+of the symbol with code such as:
+
+\c       mov   rax,[rel tid wrt ..gottpoff]
+\c       mov   rcx,[fs:rax]
+
+
+\S{elfglob} \c{elf} Extensions to the \c{GLOBAL} Directive\I{GLOBAL,
+elf extensions to}\I{GLOBAL, aoutb extensions to}
+
+\c{ELF} object files can contain more information about a global symbol
+than just its address: they can contain the \I{symbol sizes,
+specifying}\I{size, of symbols}size of the symbol and its \I{symbol
+types, specifying}\I{type, of symbols}type as well. These are not
+merely debugger conveniences, but are actually necessary when the
+program being written is a \i{shared library}. NASM therefore
+supports some extensions to the \c{GLOBAL} directive, allowing you
+to specify these features.
+
+You can specify whether a global variable is a function or a data
+object by suffixing the name with a colon and the word
+\i\c{function} or \i\c{data}. (\i\c{object} is a synonym for
+\c{data}.) For example:
+
+\c global   hashlookup:function, hashtable:data
+
+exports the global symbol \c{hashlookup} as a function and
+\c{hashtable} as a data object.
+
+Optionally, you can control the ELF visibility of the symbol.  Just
+add one of the visibility keywords: \i\c{default}, \i\c{internal},
+\i\c{hidden}, or \i\c{protected}.  The default is \i\c{default} of
+course.  For example, to make \c{hashlookup} hidden:
+
+\c global   hashlookup:function hidden
+
+You can also specify the size of the data associated with the
+symbol, as a numeric expression (which may involve labels, and even
+forward references) after the type specifier. Like this:
+
+\c global  hashtable:data (hashtable.end - hashtable)
+\c
+\c hashtable:
+\c         db this,that,theother  ; some data here
+\c .end:
+
+This makes NASM automatically calculate the length of the table and
+place that information into the \c{ELF} symbol table.
+
+Declaring the type and size of global symbols is necessary when
+writing shared library code. For more information, see
+\k{picglobal}.
+
+
+\S{elfcomm} \c{elf} Extensions to the \c{COMMON} Directive
+\I{COMMON, elf extensions to}
+
+\c{ELF} also allows you to specify alignment requirements \I{common
+variables, alignment in elf}\I{alignment, of elf common variables}on
+common variables. This is done by putting a number (which must be a
+power of two) after the name and size of the common variable,
+separated (as usual) by a colon. For example, an array of
+doublewords would benefit from 4-byte alignment:
+
+\c common  dwordarray 128:4
+
+This declares the total size of the array to be 128 bytes, and
+requires that it be aligned on a 4-byte boundary.
+
+
+\S{elf16} 16-bit code and ELF
+\I{ELF, 16-bit code and}
+
+The \c{ELF32} specification doesn't provide relocations for 8- and
+16-bit values, but the GNU \c{ld} linker adds these as an extension.
+NASM can generate GNU-compatible relocations, to allow 16-bit code to
+be linked as ELF using GNU \c{ld}. If NASM is used with the
+\c{-w+gnu-elf-extensions} option, a warning is issued when one of
+these relocations is generated.
+
+\S{elfdbg} Debug formats and ELF
+\I{ELF, Debug formats and}
+
+\c{ELF32} and \c{ELF64} provide debug information in \c{STABS} and \c{DWARF} formats.
+Line number information is generated for all executable sections, but please
+note that only the ".text" section is executable by default.
+
+\H{aoutfmt} \i\c{aout}: Linux \I{a.out, Linux version}\I{linux, a.out}\c{a.out} Object Files
+
+The \c{aout} format generates \c{a.out} object files, in the form used
+by early Linux systems (current Linux systems use ELF, see
+\k{elffmt}.) These differ from other \c{a.out} object files in that
+the magic number in the first four bytes of the file is
+different; also, some implementations of \c{a.out}, for example
+NetBSD's, support position-independent code, which Linux's
+implementation does not.
+
+\c{a.out} provides a default output file-name extension of \c{.o}.
+
+\c{a.out} is a very simple object format. It supports no special
+directives, no special symbols, no use of \c{SEG} or \c{WRT}, and no
+extensions to any standard directives. It supports only the three
+\i{standard section names} \i\c{.text}, \i\c{.data} and \i\c{.bss}.
+
+
+\H{aoutfmt} \i\c{aoutb}: \i{NetBSD}/\i{FreeBSD}/\i{OpenBSD}
+\I{a.out, BSD version}\c{a.out} Object Files
+
+The \c{aoutb} format generates \c{a.out} object files, in the form
+used by the various free \c{BSD Unix} clones, \c{NetBSD}, \c{FreeBSD}
+and \c{OpenBSD}. For simple object files, this object format is exactly
+the same as \c{aout} except for the magic number in the first four bytes
+of the file. However, the \c{aoutb} format supports
+\I{PIC}\i{position-independent code} in the same way as the \c{elf}
+format, so you can use it to write \c{BSD} \i{shared libraries}.
+
+\c{aoutb} provides a default output file-name extension of \c{.o}.
+
+\c{aoutb} supports no special directives, no special symbols, and
+only the three \i{standard section names} \i\c{.text}, \i\c{.data}
+and \i\c{.bss}. However, it also supports the same use of \i\c{WRT} as
+\c{elf} does, to provide position-independent code relocation types.
+See \k{elfwrt} for full documentation of this feature.
+
+\c{aoutb} also supports the same extensions to the \c{GLOBAL}
+directive as \c{elf} does: see \k{elfglob} for documentation of
+this.
+
+
+\H{as86fmt} \c{as86}: \i{Minix}/Linux\I{linux, as86} \i\c{as86} Object Files
+
+The Minix/Linux 16-bit assembler \c{as86} has its own non-standard
+object file format. Although its companion linker \i\c{ld86} produces
+something close to ordinary \c{a.out} binaries as output, the object
+file format used to communicate between \c{as86} and \c{ld86} is not
+itself \c{a.out}.
+
+NASM supports this format, just in case it is useful, as \c{as86}.
+\c{as86} provides a default output file-name extension of \c{.o}.
+
+\c{as86} is a very simple object format (from the NASM user's point
+of view). It supports no special directives, no use of \c{SEG} or \c{WRT},
+and no extensions to any standard directives. It supports only the three
+\i{standard section names} \i\c{.text}, \i\c{.data} and \i\c{.bss}.  The
+only special symbol supported is \c{..start}.
+
+
+\H{rdffmt} \I{RDOFF}\i\c{rdf}: \i{Relocatable Dynamic Object File
+Format}
+
+The \c{rdf} output format produces \c{RDOFF} object files. \c{RDOFF}
+(Relocatable Dynamic Object File Format) is a home-grown object-file
+format, designed alongside NASM itself and reflecting in its file
+format the internal structure of the assembler.
+
+\c{RDOFF} is not used by any well-known operating systems. Those
+writing their own systems, however, may well wish to use \c{RDOFF}
+as their object format, on the grounds that it is designed primarily
+for simplicity and contains very little file-header bureaucracy.
+
+The Unix NASM archive, and the DOS archive which includes sources,
+both contain an \I{rdoff subdirectory}\c{rdoff} subdirectory holding
+a set of RDOFF utilities: an RDF linker, an \c{RDF} static-library
+manager, an RDF file dump utility, and a program which will load and
+execute an RDF executable under Linux.
+
+\c{rdf} supports only the \i{standard section names} \i\c{.text},
+\i\c{.data} and \i\c{.bss}.
+
+
+\S{rdflib} Requiring a Library: The \i\c{LIBRARY} Directive
+
+\c{RDOFF} contains a mechanism for an object file to demand a given
+library to be linked to the module, either at load time or run time.
+This is done by the \c{LIBRARY} directive, which takes one argument
+which is the name of the module:
+
+\c     library  mylib.rdl
+
+
+\S{rdfmod} Specifying a Module Name: The \i\c{MODULE} Directive
+
+Special \c{RDOFF} header record is used to store the name of the module.
+It can be used, for example, by run-time loader to perform dynamic
+linking. \c{MODULE} directive takes one argument which is the name
+of current module:
+
+\c     module  mymodname
+
+Note that when you statically link modules and tell linker to strip
+the symbols from output file, all module names will be stripped too.
+To avoid it, you should start module names with \I{$, prefix}\c{$}, like:
+
+\c     module  $kernel.core
+
+
+\S{rdfglob} \c{rdf} Extensions to the \c{GLOBAL} Directive\I{GLOBAL,
+rdf extensions to}
+
+\c{RDOFF} global symbols can contain additional information needed by
+the static linker. You can mark a global symbol as exported, thus
+telling the linker do not strip it from target executable or library
+file. Like in \c{ELF}, you can also specify whether an exported symbol
+is a procedure (function) or data object.
+
+Suffixing the name with a colon and the word \i\c{export} you make the
+symbol exported:
+
+\c     global  sys_open:export
+
+To specify that exported symbol is a procedure (function), you add the
+word \i\c{proc} or \i\c{function} after declaration:
+
+\c     global  sys_open:export proc
+
+Similarly, to specify exported data object, add the word \i\c{data}
+or \i\c{object} to the directive:
+
+\c     global  kernel_ticks:export data
+
+
+\S{rdfimpt} \c{rdf} Extensions to the \c{EXTERN} Directive\I{EXTERN,
+rdf extensions to}
+
+By default the \c{EXTERN} directive in \c{RDOFF} declares a "pure external"
+symbol (i.e. the static linker will complain if such a symbol is not resolved).
+To declare an "imported" symbol, which must be resolved later during a dynamic
+linking phase, \c{RDOFF} offers an additional \c{import} modifier. As in
+\c{GLOBAL}, you can also specify whether an imported symbol is a procedure
+(function) or data object. For example:
+
+\c     library $libc
+\c     extern  _open:import
+\c     extern  _printf:import proc
+\c     extern  _errno:import data
+
+Here the directive \c{LIBRARY} is also included, which gives the dynamic linker
+a hint as to where to find requested symbols.
+
+
+\H{dbgfmt} \i\c{dbg}: Debugging Format
+
+The \c{dbg} output format is not built into NASM in the default
+configuration. If you are building your own NASM executable from the
+sources, you can define \i\c{OF_DBG} in \c{output/outform.h} or on the
+compiler command line, and obtain the \c{dbg} output format.
+
+The \c{dbg} format does not output an object file as such; instead,
+it outputs a text file which contains a complete list of all the
+transactions between the main body of NASM and the output-format
+back end module. It is primarily intended to aid people who want to
+write their own output drivers, so that they can get a clearer idea
+of the various requests the main program makes of the output driver,
+and in what order they happen.
+
+For simple files, one can easily use the \c{dbg} format like this:
+
+\c nasm -f dbg filename.asm
+
+which will generate a diagnostic file called \c{filename.dbg}.
+However, this will not work well on files which were designed for a
+different object format, because each object format defines its own
+macros (usually user-level forms of directives), and those macros
+will not be defined in the \c{dbg} format. Therefore it can be
+useful to run NASM twice, in order to do the preprocessing with the
+native object format selected:
+
+\c nasm -e -f rdf -o rdfprog.i rdfprog.asm
+\c nasm -a -f dbg rdfprog.i
+
+This preprocesses \c{rdfprog.asm} into \c{rdfprog.i}, keeping the
+\c{rdf} object format selected in order to make sure RDF special
+directives are converted into primitive form correctly. Then the
+preprocessed source is fed through the \c{dbg} format to generate
+the final diagnostic output.
+
+This workaround will still typically not work for programs intended
+for \c{obj} format, because the \c{obj} \c{SEGMENT} and \c{GROUP}
+directives have side effects of defining the segment and group names
+as symbols; \c{dbg} will not do this, so the program will not
+assemble. You will have to work around that by defining the symbols
+yourself (using \c{EXTERN}, for example) if you really need to get a
+\c{dbg} trace of an \c{obj}-specific source file.
+
+\c{dbg} accepts any section name and any directives at all, and logs
+them all to its output file.
+
+
+\C{16bit} Writing 16-bit Code (DOS, Windows 3/3.1)
+
+This chapter attempts to cover some of the common issues encountered
+when writing 16-bit code to run under \c{MS-DOS} or \c{Windows 3.x}. It
+covers how to link programs to produce \c{.EXE} or \c{.COM} files,
+how to write \c{.SYS} device drivers, and how to interface assembly
+language code with 16-bit C compilers and with Borland Pascal.
+
+
+\H{exefiles} Producing \i\c{.EXE} Files
+
+Any large program written under DOS needs to be built as a \c{.EXE}
+file: only \c{.EXE} files have the necessary internal structure
+required to span more than one 64K segment. \i{Windows} programs,
+also, have to be built as \c{.EXE} files, since Windows does not
+support the \c{.COM} format.
+
+In general, you generate \c{.EXE} files by using the \c{obj} output
+format to produce one or more \i\c{.OBJ} files, and then linking
+them together using a linker. However, NASM also supports the direct
+generation of simple DOS \c{.EXE} files using the \c{bin} output
+format (by using \c{DB} and \c{DW} to construct the \c{.EXE} file
+header), and a macro package is supplied to do this. Thanks to
+Yann Guidon for contributing the code for this.
+
+NASM may also support \c{.EXE} natively as another output format in
+future releases.
+
+
+\S{objexe} Using the \c{obj} Format To Generate \c{.EXE} Files
+
+This section describes the usual method of generating \c{.EXE} files
+by linking \c{.OBJ} files together.
+
+Most 16-bit programming language packages come with a suitable
+linker; if you have none of these, there is a free linker called
+\i{VAL}\I{linker, free}, available in \c{LZH} archive format from
+\W{ftp://x2ftp.oulu.fi/pub/msdos/programming/lang/}\i\c{x2ftp.oulu.fi}.
+An LZH archiver can be found at
+\W{ftp://ftp.simtel.net/pub/simtelnet/msdos/arcers}\i\c{ftp.simtel.net}.
+There is another `free' linker (though this one doesn't come with
+sources) called \i{FREELINK}, available from
+\W{http://www.pcorner.com/tpc/old/3-101.html}\i\c{www.pcorner.com}.
+A third, \i\c{djlink}, written by DJ Delorie, is available at
+\W{http://www.delorie.com/djgpp/16bit/djlink/}\i\c{www.delorie.com}.
+A fourth linker, \i\c{ALINK}, written by Anthony A.J. Williams, is
+available at \W{http://alink.sourceforge.net}\i\c{alink.sourceforge.net}.
+
+When linking several \c{.OBJ} files into a \c{.EXE} file, you should
+ensure that exactly one of them has a start point defined (using the
+\I{program entry point}\i\c{..start} special symbol defined by the
+\c{obj} format: see \k{dotdotstart}). If no module defines a start
+point, the linker will not know what value to give the entry-point
+field in the output file header; if more than one defines a start
+point, the linker will not know \e{which} value to use.
+
+An example of a NASM source file which can be assembled to a
+\c{.OBJ} file and linked on its own to a \c{.EXE} is given here. It
+demonstrates the basic principles of defining a stack, initialising
+the segment registers, and declaring a start point. This file is
+also provided in the \I{test subdirectory}\c{test} subdirectory of
+the NASM archives, under the name \c{objexe.asm}.
+
+\c segment code
+\c
+\c ..start:
+\c         mov     ax,data
+\c         mov     ds,ax
+\c         mov     ax,stack
+\c         mov     ss,ax
+\c         mov     sp,stacktop
+
+This initial piece of code sets up \c{DS} to point to the data
+segment, and initializes \c{SS} and \c{SP} to point to the top of
+the provided stack. Notice that interrupts are implicitly disabled
+for one instruction after a move into \c{SS}, precisely for this
+situation, so that there's no chance of an interrupt occurring
+between the loads of \c{SS} and \c{SP} and not having a stack to
+execute on.
+
+Note also that the special symbol \c{..start} is defined at the
+beginning of this code, which means that will be the entry point
+into the resulting executable file.
+
+\c         mov     dx,hello
+\c         mov     ah,9
+\c         int     0x21
+
+The above is the main program: load \c{DS:DX} with a pointer to the
+greeting message (\c{hello} is implicitly relative to the segment
+\c{data}, which was loaded into \c{DS} in the setup code, so the
+full pointer is valid), and call the DOS print-string function.
+
+\c         mov     ax,0x4c00
+\c         int     0x21
+
+This terminates the program using another DOS system call.
+
+\c segment data
+\c
+\c hello:  db      'hello, world', 13, 10, '$'
+
+The data segment contains the string we want to display.
+
+\c segment stack stack
+\c         resb 64
+\c stacktop:
+
+The above code declares a stack segment containing 64 bytes of
+uninitialized stack space, and points \c{stacktop} at the top of it.
+The directive \c{segment stack stack} defines a segment \e{called}
+\c{stack}, and also of \e{type} \c{STACK}. The latter is not
+necessary to the correct running of the program, but linkers are
+likely to issue warnings or errors if your program has no segment of
+type \c{STACK}.
+
+The above file, when assembled into a \c{.OBJ} file, will link on
+its own to a valid \c{.EXE} file, which when run will print `hello,
+world' and then exit.
+
+
+\S{binexe} Using the \c{bin} Format To Generate \c{.EXE} Files
+
+The \c{.EXE} file format is simple enough that it's possible to
+build a \c{.EXE} file by writing a pure-binary program and sticking
+a 32-byte header on the front. This header is simple enough that it
+can be generated using \c{DB} and \c{DW} commands by NASM itself, so
+that you can use the \c{bin} output format to directly generate
+\c{.EXE} files.
+
+Included in the NASM archives, in the \I{misc subdirectory}\c{misc}
+subdirectory, is a file \i\c{exebin.mac} of macros. It defines three
+macros: \i\c{EXE_begin}, \i\c{EXE_stack} and \i\c{EXE_end}.
+
+To produce a \c{.EXE} file using this method, you should start by
+using \c{%include} to load the \c{exebin.mac} macro package into
+your source file. You should then issue the \c{EXE_begin} macro call
+(which takes no arguments) to generate the file header data. Then
+write code as normal for the \c{bin} format - you can use all three
+standard sections \c{.text}, \c{.data} and \c{.bss}. At the end of
+the file you should call the \c{EXE_end} macro (again, no arguments),
+which defines some symbols to mark section sizes, and these symbols
+are referred to in the header code generated by \c{EXE_begin}.
+
+In this model, the code you end up writing starts at \c{0x100}, just
+like a \c{.COM} file - in fact, if you strip off the 32-byte header
+from the resulting \c{.EXE} file, you will have a valid \c{.COM}
+program. All the segment bases are the same, so you are limited to a
+64K program, again just like a \c{.COM} file. Note that an \c{ORG}
+directive is issued by the \c{EXE_begin} macro, so you should not
+explicitly issue one of your own.
+
+You can't directly refer to your segment base value, unfortunately,
+since this would require a relocation in the header, and things
+would get a lot more complicated. So you should get your segment
+base by copying it out of \c{CS} instead.
+
+On entry to your \c{.EXE} file, \c{SS:SP} are already set up to
+point to the top of a 2Kb stack. You can adjust the default stack
+size of 2Kb by calling the \c{EXE_stack} macro. For example, to
+change the stack size of your program to 64 bytes, you would call
+\c{EXE_stack 64}.
+
+A sample program which generates a \c{.EXE} file in this way is
+given in the \c{test} subdirectory of the NASM archive, as
+\c{binexe.asm}.
+
+
+\H{comfiles} Producing \i\c{.COM} Files
+
+While large DOS programs must be written as \c{.EXE} files, small
+ones are often better written as \c{.COM} files. \c{.COM} files are
+pure binary, and therefore most easily produced using the \c{bin}
+output format.
+
+
+\S{combinfmt} Using the \c{bin} Format To Generate \c{.COM} Files
+
+\c{.COM} files expect to be loaded at offset \c{100h} into their
+segment (though the segment may change). Execution then begins at
+\I\c{ORG}\c{100h}, i.e. right at the start of the program. So to
+write a \c{.COM} program, you would create a source file looking
+like
+
+\c         org 100h
+\c
+\c section .text
+\c
+\c start:
+\c         ; put your code here
+\c
+\c section .data
+\c
+\c         ; put data items here
+\c
+\c section .bss
+\c
+\c         ; put uninitialized data here
+
+The \c{bin} format puts the \c{.text} section first in the file, so
+you can declare data or BSS items before beginning to write code if
+you want to and the code will still end up at the front of the file
+where it belongs.
+
+The BSS (uninitialized data) section does not take up space in the
+\c{.COM} file itself: instead, addresses of BSS items are resolved
+to point at space beyond the end of the file, on the grounds that
+this will be free memory when the program is run. Therefore you
+should not rely on your BSS being initialized to all zeros when you
+run.
+
+To assemble the above program, you should use a command line like
+
+\c nasm myprog.asm -fbin -o myprog.com
+
+The \c{bin} format would produce a file called \c{myprog} if no
+explicit output file name were specified, so you have to override it
+and give the desired file name.
+
+
+\S{comobjfmt} Using the \c{obj} Format To Generate \c{.COM} Files
+
+If you are writing a \c{.COM} program as more than one module, you
+may wish to assemble several \c{.OBJ} files and link them together
+into a \c{.COM} program. You can do this, provided you have a linker
+capable of outputting \c{.COM} files directly (\i{TLINK} does this),
+or alternatively a converter program such as \i\c{EXE2BIN} to
+transform the \c{.EXE} file output from the linker into a \c{.COM}
+file.
+
+If you do this, you need to take care of several things:
+
+\b The first object file containing code should start its code
+segment with a line like \c{RESB 100h}. This is to ensure that the
+code begins at offset \c{100h} relative to the beginning of the code
+segment, so that the linker or converter program does not have to
+adjust address references within the file when generating the
+\c{.COM} file. Other assemblers use an \i\c{ORG} directive for this
+purpose, but \c{ORG} in NASM is a format-specific directive to the
+\c{bin} output format, and does not mean the same thing as it does
+in MASM-compatible assemblers.
+
+\b You don't need to define a stack segment.
+
+\b All your segments should be in the same group, so that every time
+your code or data references a symbol offset, all offsets are
+relative to the same segment base. This is because, when a \c{.COM}
+file is loaded, all the segment registers contain the same value.
+
+
+\H{sysfiles} Producing \i\c{.SYS} Files
+
+\i{MS-DOS device drivers} - \c{.SYS} files - are pure binary files,
+similar to \c{.COM} files, except that they start at origin zero
+rather than \c{100h}. Therefore, if you are writing a device driver
+using the \c{bin} format, you do not need the \c{ORG} directive,
+since the default origin for \c{bin} is zero. Similarly, if you are
+using \c{obj}, you do not need the \c{RESB 100h} at the start of
+your code segment.
+
+\c{.SYS} files start with a header structure, containing pointers to
+the various routines inside the driver which do the work. This
+structure should be defined at the start of the code segment, even
+though it is not actually code.
+
+For more information on the format of \c{.SYS} files, and the data
+which has to go in the header structure, a list of books is given in
+the Frequently Asked Questions list for the newsgroup
+\W{news:comp.os.msdos.programmer}\i\c{comp.os.msdos.programmer}.
+
+
+\H{16c} Interfacing to 16-bit C Programs
+
+This section covers the basics of writing assembly routines that
+call, or are called from, C programs. To do this, you would
+typically write an assembly module as a \c{.OBJ} file, and link it
+with your C modules to produce a \i{mixed-language program}.
+
+
+\S{16cunder} External Symbol Names
+
+\I{C symbol names}\I{underscore, in C symbols}C compilers have the
+convention that the names of all global symbols (functions or data)
+they define are formed by prefixing an underscore to the name as it
+appears in the C program. So, for example, the function a C
+programmer thinks of as \c{printf} appears to an assembly language
+programmer as \c{_printf}. This means that in your assembly
+programs, you can define symbols without a leading underscore, and
+not have to worry about name clashes with C symbols.
+
+If you find the underscores inconvenient, you can define macros to
+replace the \c{GLOBAL} and \c{EXTERN} directives as follows:
+
+\c %macro  cglobal 1
+\c
+\c   global  _%1
+\c   %define %1 _%1
+\c
+\c %endmacro
+\c
+\c %macro  cextern 1
+\c
+\c   extern  _%1
+\c   %define %1 _%1
+\c
+\c %endmacro
+
+(These forms of the macros only take one argument at a time; a
+\c{%rep} construct could solve this.)
+
+If you then declare an external like this:
+
+\c cextern printf
+
+then the macro will expand it as
+
+\c extern  _printf
+\c %define printf _printf
+
+Thereafter, you can reference \c{printf} as if it was a symbol, and
+the preprocessor will put the leading underscore on where necessary.
+
+The \c{cglobal} macro works similarly. You must use \c{cglobal}
+before defining the symbol in question, but you would have had to do
+that anyway if you used \c{GLOBAL}.
+
+Also see \k{opt-pfix}.
+
+\S{16cmodels} \i{Memory Models}
+
+NASM contains no mechanism to support the various C memory models
+directly; you have to keep track yourself of which one you are
+writing for. This means you have to keep track of the following
+things:
+
+\b In models using a single code segment (tiny, small and compact),
+functions are near. This means that function pointers, when stored
+in data segments or pushed on the stack as function arguments, are
+16 bits long and contain only an offset field (the \c{CS} register
+never changes its value, and always gives the segment part of the
+full function address), and that functions are called using ordinary
+near \c{CALL} instructions and return using \c{RETN} (which, in
+NASM, is synonymous with \c{RET} anyway). This means both that you
+should write your own routines to return with \c{RETN}, and that you
+should call external C routines with near \c{CALL} instructions.
+
+\b In models using more than one code segment (medium, large and
+huge), functions are far. This means that function pointers are 32
+bits long (consisting of a 16-bit offset followed by a 16-bit
+segment), and that functions are called using \c{CALL FAR} (or
+\c{CALL seg:offset}) and return using \c{RETF}. Again, you should
+therefore write your own routines to return with \c{RETF} and use
+\c{CALL FAR} to call external routines.
+
+\b In models using a single data segment (tiny, small and medium),
+data pointers are 16 bits long, containing only an offset field (the
+\c{DS} register doesn't change its value, and always gives the
+segment part of the full data item address).
+
+\b In models using more than one data segment (compact, large and
+huge), data pointers are 32 bits long, consisting of a 16-bit offset
+followed by a 16-bit segment. You should still be careful not to
+modify \c{DS} in your routines without restoring it afterwards, but
+\c{ES} is free for you to use to access the contents of 32-bit data
+pointers you are passed.
+
+\b The huge memory model allows single data items to exceed 64K in
+size. In all other memory models, you can access the whole of a data
+item just by doing arithmetic on the offset field of the pointer you
+are given, whether a segment field is present or not; in huge model,
+you have to be more careful of your pointer arithmetic.
+
+\b In most memory models, there is a \e{default} data segment, whose
+segment address is kept in \c{DS} throughout the program. This data
+segment is typically the same segment as the stack, kept in \c{SS},
+so that functions' local variables (which are stored on the stack)
+and global data items can both be accessed easily without changing
+\c{DS}. Particularly large data items are typically stored in other
+segments. However, some memory models (though not the standard
+ones, usually) allow the assumption that \c{SS} and \c{DS} hold the
+same value to be removed. Be careful about functions' local
+variables in this latter case.
+
+In models with a single code segment, the segment is called
+\i\c{_TEXT}, so your code segment must also go by this name in order
+to be linked into the same place as the main code segment. In models
+with a single data segment, or with a default data segment, it is
+called \i\c{_DATA}.
+
+
+\S{16cfunc} Function Definitions and Function Calls
+
+\I{functions, C calling convention}The \i{C calling convention} in
+16-bit programs is as follows. In the following description, the
+words \e{caller} and \e{callee} are used to denote the function
+doing the calling and the function which gets called.
+
+\b The caller pushes the function's parameters on the stack, one
+after another, in reverse order (right to left, so that the first
+argument specified to the function is pushed last).
+
+\b The caller then executes a \c{CALL} instruction to pass control
+to the callee. This \c{CALL} is either near or far depending on the
+memory model.
+
+\b The callee receives control, and typically (although this is not
+actually necessary, in functions which do not need to access their
+parameters) starts by saving the value of \c{SP} in \c{BP} so as to
+be able to use \c{BP} as a base pointer to find its parameters on
+the stack. However, the caller was probably doing this too, so part
+of the calling convention states that \c{BP} must be preserved by
+any C function. Hence the callee, if it is going to set up \c{BP} as
+a \i\e{frame pointer}, must push the previous value first.
+
+\b The callee may then access its parameters relative to \c{BP}.
+The word at \c{[BP]} holds the previous value of \c{BP} as it was
+pushed; the next word, at \c{[BP+2]}, holds the offset part of the
+return address, pushed implicitly by \c{CALL}. In a small-model
+(near) function, the parameters start after that, at \c{[BP+4]}; in
+a large-model (far) function, the segment part of the return address
+lives at \c{[BP+4]}, and the parameters begin at \c{[BP+6]}. The
+leftmost parameter of the function, since it was pushed last, is
+accessible at this offset from \c{BP}; the others follow, at
+successively greater offsets. Thus, in a function such as \c{printf}
+which takes a variable number of parameters, the pushing of the
+parameters in reverse order means that the function knows where to
+find its first parameter, which tells it the number and type of the
+remaining ones.
+
+\b The callee may also wish to decrease \c{SP} further, so as to
+allocate space on the stack for local variables, which will then be
+accessible at negative offsets from \c{BP}.
+
+\b The callee, if it wishes to return a value to the caller, should
+leave the value in \c{AL}, \c{AX} or \c{DX:AX} depending on the size
+of the value. Floating-point results are sometimes (depending on the
+compiler) returned in \c{ST0}.
+
+\b Once the callee has finished processing, it restores \c{SP} from
+\c{BP} if it had allocated local stack space, then pops the previous
+value of \c{BP}, and returns via \c{RETN} or \c{RETF} depending on
+memory model.
+
+\b When the caller regains control from the callee, the function
+parameters are still on the stack, so it typically adds an immediate
+constant to \c{SP} to remove them (instead of executing a number of
+slow \c{POP} instructions). Thus, if a function is accidentally
+called with the wrong number of parameters due to a prototype
+mismatch, the stack will still be returned to a sensible state since
+the caller, which \e{knows} how many parameters it pushed, does the
+removing.
+
+It is instructive to compare this calling convention with that for
+Pascal programs (described in \k{16bpfunc}). Pascal has a simpler
+convention, since no functions have variable numbers of parameters.
+Therefore the callee knows how many parameters it should have been
+passed, and is able to deallocate them from the stack itself by
+passing an immediate argument to the \c{RET} or \c{RETF}
+instruction, so the caller does not have to do it. Also, the
+parameters are pushed in left-to-right order, not right-to-left,
+which means that a compiler can give better guarantees about
+sequence points without performance suffering.
+
+Thus, you would define a function in C style in the following way.
+The following example is for small model:
+
+\c global  _myfunc
+\c
+\c _myfunc:
+\c         push    bp
+\c         mov     bp,sp
+\c         sub     sp,0x40         ; 64 bytes of local stack space
+\c         mov     bx,[bp+4]       ; first parameter to function
+\c
+\c         ; some more code
+\c
+\c         mov     sp,bp           ; undo "sub sp,0x40" above
+\c         pop     bp
+\c         ret
+
+For a large-model function, you would replace \c{RET} by \c{RETF},
+and look for the first parameter at \c{[BP+6]} instead of
+\c{[BP+4]}. Of course, if one of the parameters is a pointer, then
+the offsets of \e{subsequent} parameters will change depending on
+the memory model as well: far pointers take up four bytes on the
+stack when passed as a parameter, whereas near pointers take up two.
+
+At the other end of the process, to call a C function from your
+assembly code, you would do something like this:
+
+\c extern  _printf
+\c
+\c       ; and then, further down...
+\c
+\c       push    word [myint]        ; one of my integer variables
+\c       push    word mystring       ; pointer into my data segment
+\c       call    _printf
+\c       add     sp,byte 4           ; `byte' saves space
+\c
+\c       ; then those data items...
+\c
+\c segment _DATA
+\c
+\c myint         dw    1234
+\c mystring      db    'This number -> %d <- should be 1234',10,0
+
+This piece of code is the small-model assembly equivalent of the C
+code
+
+\c     int myint = 1234;
+\c     printf("This number -> %d <- should be 1234\n", myint);
+
+In large model, the function-call code might look more like this. In
+this example, it is assumed that \c{DS} already holds the segment
+base of the segment \c{_DATA}. If not, you would have to initialize
+it first.
+
+\c       push    word [myint]
+\c       push    word seg mystring   ; Now push the segment, and...
+\c       push    word mystring       ; ... offset of "mystring"
+\c       call    far _printf
+\c       add    sp,byte 6
+
+The integer value still takes up one word on the stack, since large
+model does not affect the size of the \c{int} data type. The first
+argument (pushed last) to \c{printf}, however, is a data pointer,
+and therefore has to contain a segment and offset part. The segment
+should be stored second in memory, and therefore must be pushed
+first. (Of course, \c{PUSH DS} would have been a shorter instruction
+than \c{PUSH WORD SEG mystring}, if \c{DS} was set up as the above
+example assumed.) Then the actual call becomes a far call, since
+functions expect far calls in large model; and \c{SP} has to be
+increased by 6 rather than 4 afterwards to make up for the extra
+word of parameters.
+
+
+\S{16cdata} Accessing Data Items
+
+To get at the contents of C variables, or to declare variables which
+C can access, you need only declare the names as \c{GLOBAL} or
+\c{EXTERN}. (Again, the names require leading underscores, as stated
+in \k{16cunder}.) Thus, a C variable declared as \c{int i} can be
+accessed from assembler as
+
+\c extern _i
+\c
+\c         mov ax,[_i]
+
+And to declare your own integer variable which C programs can access
+as \c{extern int j}, you do this (making sure you are assembling in
+the \c{_DATA} segment, if necessary):
+
+\c global  _j
+\c
+\c _j      dw      0
+
+To access a C array, you need to know the size of the components of
+the array. For example, \c{int} variables are two bytes long, so if
+a C program declares an array as \c{int a[10]}, you can access
+\c{a[3]} by coding \c{mov ax,[_a+6]}. (The byte offset 6 is obtained
+by multiplying the desired array index, 3, by the size of the array
+element, 2.) The sizes of the C base types in 16-bit compilers are:
+1 for \c{char}, 2 for \c{short} and \c{int}, 4 for \c{long} and
+\c{float}, and 8 for \c{double}.
+
+To access a C \i{data structure}, you need to know the offset from
+the base of the structure to the field you are interested in. You
+can either do this by converting the C structure definition into a
+NASM structure definition (using \i\c{STRUC}), or by calculating the
+one offset and using just that.
+
+To do either of these, you should read your C compiler's manual to
+find out how it organizes data structures. NASM gives no special
+alignment to structure members in its own \c{STRUC} macro, so you
+have to specify alignment yourself if the C compiler generates it.
+Typically, you might find that a structure like
+
+\c struct {
+\c     char c;
+\c     int i;
+\c } foo;
+
+might be four bytes long rather than three, since the \c{int} field
+would be aligned to a two-byte boundary. However, this sort of
+feature tends to be a configurable option in the C compiler, either
+using command-line options or \c{#pragma} lines, so you have to find
+out how your own compiler does it.
+
+
+\S{16cmacro} \i\c{c16.mac}: Helper Macros for the 16-bit C Interface
+
+Included in the NASM archives, in the \I{misc subdirectory}\c{misc}
+directory, is a file \c{c16.mac} of macros. It defines three macros:
+\i\c{proc}, \i\c{arg} and \i\c{endproc}. These are intended to be
+used for C-style procedure definitions, and they automate a lot of
+the work involved in keeping track of the calling convention.
+
+(An alternative, TASM compatible form of \c{arg} is also now built
+into NASM's preprocessor. See \k{stackrel} for details.)
+
+An example of an assembly function using the macro set is given
+here:
+
+\c proc    _nearproc
+\c
+\c %$i     arg
+\c %$j     arg
+\c         mov     ax,[bp + %$i]
+\c         mov     bx,[bp + %$j]
+\c         add     ax,[bx]
+\c
+\c endproc
+
+This defines \c{_nearproc} to be a procedure taking two arguments,
+the first (\c{i}) an integer and the second (\c{j}) a pointer to an
+integer. It returns \c{i + *j}.
+
+Note that the \c{arg} macro has an \c{EQU} as the first line of its
+expansion, and since the label before the macro call gets prepended
+to the first line of the expanded macro, the \c{EQU} works, defining
+\c{%$i} to be an offset from \c{BP}. A context-local variable is
+used, local to the context pushed by the \c{proc} macro and popped
+by the \c{endproc} macro, so that the same argument name can be used
+in later procedures. Of course, you don't \e{have} to do that.
+
+The macro set produces code for near functions (tiny, small and
+compact-model code) by default. You can have it generate far
+functions (medium, large and huge-model code) by means of coding
+\I\c{FARCODE}\c{%define FARCODE}. This changes the kind of return
+instruction generated by \c{endproc}, and also changes the starting
+point for the argument offsets. The macro set contains no intrinsic
+dependency on whether data pointers are far or not.
+
+\c{arg} can take an optional parameter, giving the size of the
+argument. If no size is given, 2 is assumed, since it is likely that
+many function parameters will be of type \c{int}.
+
+The large-model equivalent of the above function would look like this:
+
+\c %define FARCODE
+\c
+\c proc    _farproc
+\c
+\c %$i     arg
+\c %$j     arg     4
+\c         mov     ax,[bp + %$i]
+\c         mov     bx,[bp + %$j]
+\c         mov     es,[bp + %$j + 2]
+\c         add     ax,[bx]
+\c
+\c endproc
+
+This makes use of the argument to the \c{arg} macro to define a
+parameter of size 4, because \c{j} is now a far pointer. When we
+load from \c{j}, we must load a segment and an offset.
+
+
+\H{16bp} Interfacing to \i{Borland Pascal} Programs
+
+Interfacing to Borland Pascal programs is similar in concept to
+interfacing to 16-bit C programs. The differences are:
+
+\b The leading underscore required for interfacing to C programs is
+not required for Pascal.
+
+\b The memory model is always large: functions are far, data
+pointers are far, and no data item can be more than 64K long.
+(Actually, some functions are near, but only those functions that
+are local to a Pascal unit and never called from outside it. All
+assembly functions that Pascal calls, and all Pascal functions that
+assembly routines are able to call, are far.) However, all static
+data declared in a Pascal program goes into the default data
+segment, which is the one whose segment address will be in \c{DS}
+when control is passed to your assembly code. The only things that
+do not live in the default data segment are local variables (they
+live in the stack segment) and dynamically allocated variables. All
+data \e{pointers}, however, are far.
+
+\b The function calling convention is different - described below.
+
+\b Some data types, such as strings, are stored differently.
+
+\b There are restrictions on the segment names you are allowed to
+use - Borland Pascal will ignore code or data declared in a segment
+it doesn't like the name of. The restrictions are described below.
+
+
+\S{16bpfunc} The Pascal Calling Convention
+
+\I{functions, Pascal calling convention}\I{Pascal calling
+convention}The 16-bit Pascal calling convention is as follows. In
+the following description, the words \e{caller} and \e{callee} are
+used to denote the function doing the calling and the function which
+gets called.
+
+\b The caller pushes the function's parameters on the stack, one
+after another, in normal order (left to right, so that the first
+argument specified to the function is pushed first).
+
+\b The caller then executes a far \c{CALL} instruction to pass
+control to the callee.
+
+\b The callee receives control, and typically (although this is not
+actually necessary, in functions which do not need to access their
+parameters) starts by saving the value of \c{SP} in \c{BP} so as to
+be able to use \c{BP} as a base pointer to find its parameters on
+the stack. However, the caller was probably doing this too, so part
+of the calling convention states that \c{BP} must be preserved by
+any function. Hence the callee, if it is going to set up \c{BP} as a
+\i{frame pointer}, must push the previous value first.
+
+\b The callee may then access its parameters relative to \c{BP}.
+The word at \c{[BP]} holds the previous value of \c{BP} as it was
+pushed. The next word, at \c{[BP+2]}, holds the offset part of the
+return address, and the next one at \c{[BP+4]} the segment part. The
+parameters begin at \c{[BP+6]}. The rightmost parameter of the
+function, since it was pushed last, is accessible at this offset
+from \c{BP}; the others follow, at successively greater offsets.
+
+\b The callee may also wish to decrease \c{SP} further, so as to
+allocate space on the stack for local variables, which will then be
+accessible at negative offsets from \c{BP}.
+
+\b The callee, if it wishes to return a value to the caller, should
+leave the value in \c{AL}, \c{AX} or \c{DX:AX} depending on the size
+of the value. Floating-point results are returned in \c{ST0}.
+Results of type \c{Real} (Borland's own custom floating-point data
+type, not handled directly by the FPU) are returned in \c{DX:BX:AX}.
+To return a result of type \c{String}, the caller pushes a pointer
+to a temporary string before pushing the parameters, and the callee
+places the returned string value at that location. The pointer is
+not a parameter, and should not be removed from the stack by the
+\c{RETF} instruction.
+
+\b Once the callee has finished processing, it restores \c{SP} from
+\c{BP} if it had allocated local stack space, then pops the previous
+value of \c{BP}, and returns via \c{RETF}. It uses the form of
+\c{RETF} with an immediate parameter, giving the number of bytes
+taken up by the parameters on the stack. This causes the parameters
+to be removed from the stack as a side effect of the return
+instruction.
+
+\b When the caller regains control from the callee, the function
+parameters have already been removed from the stack, so it needs to
+do nothing further.
+
+Thus, you would define a function in Pascal style, taking two
+\c{Integer}-type parameters, in the following way:
+
+\c global  myfunc
+\c
+\c myfunc: push    bp
+\c         mov     bp,sp
+\c         sub     sp,0x40         ; 64 bytes of local stack space
+\c         mov     bx,[bp+8]       ; first parameter to function
+\c         mov     bx,[bp+6]       ; second parameter to function
+\c
+\c         ; some more code
+\c
+\c         mov     sp,bp           ; undo "sub sp,0x40" above
+\c         pop     bp
+\c         retf    4               ; total size of params is 4
+
+At the other end of the process, to call a Pascal function from your
+assembly code, you would do something like this:
+
+\c extern  SomeFunc
+\c
+\c        ; and then, further down...
+\c
+\c        push   word seg mystring   ; Now push the segment, and...
+\c        push   word mystring       ; ... offset of "mystring"
+\c        push   word [myint]        ; one of my variables
+\c        call   far SomeFunc
+
+This is equivalent to the Pascal code
+
+\c procedure SomeFunc(String: PChar; Int: Integer);
+\c     SomeFunc(@mystring, myint);
+
+
+\S{16bpseg} Borland Pascal \I{segment names, Borland Pascal}Segment
+Name Restrictions
+
+Since Borland Pascal's internal unit file format is completely
+different from \c{OBJ}, it only makes a very sketchy job of actually
+reading and understanding the various information contained in a
+real \c{OBJ} file when it links that in. Therefore an object file
+intended to be linked to a Pascal program must obey a number of
+restrictions:
+
+\b Procedures and functions must be in a segment whose name is
+either \c{CODE}, \c{CSEG}, or something ending in \c{_TEXT}.
+
+\b initialized data must be in a segment whose name is either
+\c{CONST} or something ending in \c{_DATA}.
+
+\b Uninitialized data must be in a segment whose name is either
+\c{DATA}, \c{DSEG}, or something ending in \c{_BSS}.
+
+\b Any other segments in the object file are completely ignored.
+\c{GROUP} directives and segment attributes are also ignored.
+
+
+\S{16bpmacro} Using \i\c{c16.mac} With Pascal Programs
+
+The \c{c16.mac} macro package, described in \k{16cmacro}, can also
+be used to simplify writing functions to be called from Pascal
+programs, if you code \I\c{PASCAL}\c{%define PASCAL}. This
+definition ensures that functions are far (it implies
+\i\c{FARCODE}), and also causes procedure return instructions to be
+generated with an operand.
+
+Defining \c{PASCAL} does not change the code which calculates the
+argument offsets; you must declare your function's arguments in
+reverse order. For example:
+
+\c %define PASCAL
+\c
+\c proc    _pascalproc
+\c
+\c %$j     arg 4
+\c %$i     arg
+\c         mov     ax,[bp + %$i]
+\c         mov     bx,[bp + %$j]
+\c         mov     es,[bp + %$j + 2]
+\c         add     ax,[bx]
+\c
+\c endproc
+
+This defines the same routine, conceptually, as the example in
+\k{16cmacro}: it defines a function taking two arguments, an integer
+and a pointer to an integer, which returns the sum of the integer
+and the contents of the pointer. The only difference between this
+code and the large-model C version is that \c{PASCAL} is defined
+instead of \c{FARCODE}, and that the arguments are declared in
+reverse order.
+
+
+\C{32bit} Writing 32-bit Code (Unix, Win32, DJGPP)
+
+This chapter attempts to cover some of the common issues involved
+when writing 32-bit code, to run under \i{Win32} or Unix, or to be
+linked with C code generated by a Unix-style C compiler such as
+\i{DJGPP}. It covers how to write assembly code to interface with
+32-bit C routines, and how to write position-independent code for
+shared libraries.
+
+Almost all 32-bit code, and in particular all code running under
+\c{Win32}, \c{DJGPP} or any of the PC Unix variants, runs in \I{flat
+memory model}\e{flat} memory model. This means that the segment registers
+and paging have already been set up to give you the same 32-bit 4Gb
+address space no matter what segment you work relative to, and that
+you should ignore all segment registers completely. When writing
+flat-model application code, you never need to use a segment
+override or modify any segment register, and the code-section
+addresses you pass to \c{CALL} and \c{JMP} live in the same address
+space as the data-section addresses you access your variables by and
+the stack-section addresses you access local variables and procedure
+parameters by. Every address is 32 bits long and contains only an
+offset part.
+
+
+\H{32c} Interfacing to 32-bit C Programs
+
+A lot of the discussion in \k{16c}, about interfacing to 16-bit C
+programs, still applies when working in 32 bits. The absence of
+memory models or segmentation worries simplifies things a lot.
+
+
+\S{32cunder} External Symbol Names
+
+Most 32-bit C compilers share the convention used by 16-bit
+compilers, that the names of all global symbols (functions or data)
+they define are formed by prefixing an underscore to the name as it
+appears in the C program. However, not all of them do: the \c{ELF}
+specification states that C symbols do \e{not} have a leading
+underscore on their assembly-language names.
+
+The older Linux \c{a.out} C compiler, all \c{Win32} compilers,
+\c{DJGPP}, and \c{NetBSD} and \c{FreeBSD}, all use the leading
+underscore; for these compilers, the macros \c{cextern} and
+\c{cglobal}, as given in \k{16cunder}, will still work. For \c{ELF},
+though, the leading underscore should not be used.
+
+See also \k{opt-pfix}.
+
+\S{32cfunc} Function Definitions and Function Calls
+
+\I{functions, C calling convention}The \i{C calling convention}
+in 32-bit programs is as follows. In the following description,
+the words \e{caller} and \e{callee} are used to denote
+the function doing the calling and the function which gets called.
+
+\b The caller pushes the function's parameters on the stack, one
+after another, in reverse order (right to left, so that the first
+argument specified to the function is pushed last).
+
+\b The caller then executes a near \c{CALL} instruction to pass
+control to the callee.
+
+\b The callee receives control, and typically (although this is not
+actually necessary, in functions which do not need to access their
+parameters) starts by saving the value of \c{ESP} in \c{EBP} so as
+to be able to use \c{EBP} as a base pointer to find its parameters
+on the stack. However, the caller was probably doing this too, so
+part of the calling convention states that \c{EBP} must be preserved
+by any C function. Hence the callee, if it is going to set up
+\c{EBP} as a \i{frame pointer}, must push the previous value first.
+
+\b The callee may then access its parameters relative to \c{EBP}.
+The doubleword at \c{[EBP]} holds the previous value of \c{EBP} as
+it was pushed; the next doubleword, at \c{[EBP+4]}, holds the return
+address, pushed implicitly by \c{CALL}. The parameters start after
+that, at \c{[EBP+8]}. The leftmost parameter of the function, since
+it was pushed last, is accessible at this offset from \c{EBP}; the
+others follow, at successively greater offsets. Thus, in a function
+such as \c{printf} which takes a variable number of parameters, the
+pushing of the parameters in reverse order means that the function
+knows where to find its first parameter, which tells it the number
+and type of the remaining ones.
+
+\b The callee may also wish to decrease \c{ESP} further, so as to
+allocate space on the stack for local variables, which will then be
+accessible at negative offsets from \c{EBP}.
+
+\b The callee, if it wishes to return a value to the caller, should
+leave the value in \c{AL}, \c{AX} or \c{EAX} depending on the size
+of the value. Floating-point results are typically returned in
+\c{ST0}.
+
+\b Once the callee has finished processing, it restores \c{ESP} from
+\c{EBP} if it had allocated local stack space, then pops the previous
+value of \c{EBP}, and returns via \c{RET} (equivalently, \c{RETN}).
+
+\b When the caller regains control from the callee, the function
+parameters are still on the stack, so it typically adds an immediate
+constant to \c{ESP} to remove them (instead of executing a number of
+slow \c{POP} instructions). Thus, if a function is accidentally
+called with the wrong number of parameters due to a prototype
+mismatch, the stack will still be returned to a sensible state since
+the caller, which \e{knows} how many parameters it pushed, does the
+removing.
+
+There is an alternative calling convention used by Win32 programs
+for Windows API calls, and also for functions called \e{by} the
+Windows API such as window procedures: they follow what Microsoft
+calls the \c{__stdcall} convention. This is slightly closer to the
+Pascal convention, in that the callee clears the stack by passing a
+parameter to the \c{RET} instruction. However, the parameters are
+still pushed in right-to-left order.
+
+Thus, you would define a function in C style in the following way:
+
+\c global  _myfunc
+\c
+\c _myfunc:
+\c         push    ebp
+\c         mov     ebp,esp
+\c         sub     esp,0x40        ; 64 bytes of local stack space
+\c         mov     ebx,[ebp+8]     ; first parameter to function
+\c
+\c         ; some more code
+\c
+\c         leave                   ; mov esp,ebp / pop ebp
+\c         ret
+
+At the other end of the process, to call a C function from your
+assembly code, you would do something like this:
+
+\c extern  _printf
+\c
+\c         ; and then, further down...
+\c
+\c         push    dword [myint]   ; one of my integer variables
+\c         push    dword mystring  ; pointer into my data segment
+\c         call    _printf
+\c         add     esp,byte 8      ; `byte' saves space
+\c
+\c         ; then those data items...
+\c
+\c segment _DATA
+\c
+\c myint       dd   1234
+\c mystring    db   'This number -> %d <- should be 1234',10,0
+
+This piece of code is the assembly equivalent of the C code
+
+\c     int myint = 1234;
+\c     printf("This number -> %d <- should be 1234\n", myint);
+
+
+\S{32cdata} Accessing Data Items
+
+To get at the contents of C variables, or to declare variables which
+C can access, you need only declare the names as \c{GLOBAL} or
+\c{EXTERN}. (Again, the names require leading underscores, as stated
+in \k{32cunder}.) Thus, a C variable declared as \c{int i} can be
+accessed from assembler as
+
+\c           extern _i
+\c           mov eax,[_i]
+
+And to declare your own integer variable which C programs can access
+as \c{extern int j}, you do this (making sure you are assembling in
+the \c{_DATA} segment, if necessary):
+
+\c           global _j
+\c _j        dd 0
+
+To access a C array, you need to know the size of the components of
+the array. For example, \c{int} variables are four bytes long, so if
+a C program declares an array as \c{int a[10]}, you can access
+\c{a[3]} by coding \c{mov ax,[_a+12]}. (The byte offset 12 is obtained
+by multiplying the desired array index, 3, by the size of the array
+element, 4.) The sizes of the C base types in 32-bit compilers are:
+1 for \c{char}, 2 for \c{short}, 4 for \c{int}, \c{long} and
+\c{float}, and 8 for \c{double}. Pointers, being 32-bit addresses,
+are also 4 bytes long.
+
+To access a C \i{data structure}, you need to know the offset from
+the base of the structure to the field you are interested in. You
+can either do this by converting the C structure definition into a
+NASM structure definition (using \c{STRUC}), or by calculating the
+one offset and using just that.
+
+To do either of these, you should read your C compiler's manual to
+find out how it organizes data structures. NASM gives no special
+alignment to structure members in its own \i\c{STRUC} macro, so you
+have to specify alignment yourself if the C compiler generates it.
+Typically, you might find that a structure like
+
+\c struct {
+\c     char c;
+\c     int i;
+\c } foo;
+
+might be eight bytes long rather than five, since the \c{int} field
+would be aligned to a four-byte boundary. However, this sort of
+feature is sometimes a configurable option in the C compiler, either
+using command-line options or \c{#pragma} lines, so you have to find
+out how your own compiler does it.
+
+
+\S{32cmacro} \i\c{c32.mac}: Helper Macros for the 32-bit C Interface
+
+Included in the NASM archives, in the \I{misc directory}\c{misc}
+directory, is a file \c{c32.mac} of macros. It defines three macros:
+\i\c{proc}, \i\c{arg} and \i\c{endproc}. These are intended to be
+used for C-style procedure definitions, and they automate a lot of
+the work involved in keeping track of the calling convention.
+
+An example of an assembly function using the macro set is given
+here:
+
+\c proc    _proc32
+\c
+\c %$i     arg
+\c %$j     arg
+\c         mov     eax,[ebp + %$i]
+\c         mov     ebx,[ebp + %$j]
+\c         add     eax,[ebx]
+\c
+\c endproc
+
+This defines \c{_proc32} to be a procedure taking two arguments, the
+first (\c{i}) an integer and the second (\c{j}) a pointer to an
+integer. It returns \c{i + *j}.
+
+Note that the \c{arg} macro has an \c{EQU} as the first line of its
+expansion, and since the label before the macro call gets prepended
+to the first line of the expanded macro, the \c{EQU} works, defining
+\c{%$i} to be an offset from \c{BP}. A context-local variable is
+used, local to the context pushed by the \c{proc} macro and popped
+by the \c{endproc} macro, so that the same argument name can be used
+in later procedures. Of course, you don't \e{have} to do that.
+
+\c{arg} can take an optional parameter, giving the size of the
+argument. If no size is given, 4 is assumed, since it is likely that
+many function parameters will be of type \c{int} or pointers.
+
+
+\H{picdll} Writing NetBSD/FreeBSD/OpenBSD and Linux/ELF \i{Shared
+Libraries}
+
+\c{ELF} replaced the older \c{a.out} object file format under Linux
+because it contains support for \i{position-independent code}
+(\i{PIC}), which makes writing shared libraries much easier. NASM
+supports the \c{ELF} position-independent code features, so you can
+write Linux \c{ELF} shared libraries in NASM.
+
+\i{NetBSD}, and its close cousins \i{FreeBSD} and \i{OpenBSD}, take
+a different approach by hacking PIC support into the \c{a.out}
+format. NASM supports this as the \i\c{aoutb} output format, so you
+can write \i{BSD} shared libraries in NASM too.
+
+The operating system loads a PIC shared library by memory-mapping
+the library file at an arbitrarily chosen point in the address space
+of the running process. The contents of the library's code section
+must therefore not depend on where it is loaded in memory.
+
+Therefore, you cannot get at your variables by writing code like
+this:
+
+\c         mov     eax,[myvar]             ; WRONG
+
+Instead, the linker provides an area of memory called the
+\i\e{global offset table}, or \i{GOT}; the GOT is situated at a
+constant distance from your library's code, so if you can find out
+where your library is loaded (which is typically done using a
+\c{CALL} and \c{POP} combination), you can obtain the address of the
+GOT, and you can then load the addresses of your variables out of
+linker-generated entries in the GOT.
+
+The \e{data} section of a PIC shared library does not have these
+restrictions: since the data section is writable, it has to be
+copied into memory anyway rather than just paged in from the library
+file, so as long as it's being copied it can be relocated too. So
+you can put ordinary types of relocation in the data section without
+too much worry (but see \k{picglobal} for a caveat).
+
+
+\S{picgot} Obtaining the Address of the GOT
+
+Each code module in your shared library should define the GOT as an
+external symbol:
+
+\c extern  _GLOBAL_OFFSET_TABLE_   ; in ELF
+\c extern  __GLOBAL_OFFSET_TABLE_  ; in BSD a.out
+
+At the beginning of any function in your shared library which plans
+to access your data or BSS sections, you must first calculate the
+address of the GOT. This is typically done by writing the function
+in this form:
+
+\c func:   push    ebp
+\c         mov     ebp,esp
+\c         push    ebx
+\c         call    .get_GOT
+\c .get_GOT:
+\c         pop     ebx
+\c         add     ebx,_GLOBAL_OFFSET_TABLE_+$$-.get_GOT wrt ..gotpc
+\c
+\c         ; the function body comes here
+\c
+\c         mov     ebx,[ebp-4]
+\c         mov     esp,ebp
+\c         pop     ebp
+\c         ret
+
+(For BSD, again, the symbol \c{_GLOBAL_OFFSET_TABLE} requires a
+second leading underscore.)
+
+The first two lines of this function are simply the standard C
+prologue to set up a stack frame, and the last three lines are
+standard C function epilogue. The third line, and the fourth to last
+line, save and restore the \c{EBX} register, because PIC shared
+libraries use this register to store the address of the GOT.
+
+The interesting bit is the \c{CALL} instruction and the following
+two lines. The \c{CALL} and \c{POP} combination obtains the address
+of the label \c{.get_GOT}, without having to know in advance where
+the program was loaded (since the \c{CALL} instruction is encoded
+relative to the current position). The \c{ADD} instruction makes use
+of one of the special PIC relocation types: \i{GOTPC relocation}.
+With the \i\c{WRT ..gotpc} qualifier specified, the symbol
+referenced (here \c{_GLOBAL_OFFSET_TABLE_}, the special symbol
+assigned to the GOT) is given as an offset from the beginning of the
+section. (Actually, \c{ELF} encodes it as the offset from the operand
+field of the \c{ADD} instruction, but NASM simplifies this
+deliberately, so you do things the same way for both \c{ELF} and
+\c{BSD}.) So the instruction then \e{adds} the beginning of the section,
+to get the real address of the GOT, and subtracts the value of
+\c{.get_GOT} which it knows is in \c{EBX}. Therefore, by the time
+that instruction has finished, \c{EBX} contains the address of the GOT.
+
+If you didn't follow that, don't worry: it's never necessary to
+obtain the address of the GOT by any other means, so you can put
+those three instructions into a macro and safely ignore them:
+
+\c %macro  get_GOT 0
+\c
+\c         call    %%getgot
+\c   %%getgot:
+\c         pop     ebx
+\c         add     ebx,_GLOBAL_OFFSET_TABLE_+$$-%%getgot wrt ..gotpc
+\c
+\c %endmacro
+
+\S{piclocal} Finding Your Local Data Items
+
+Having got the GOT, you can then use it to obtain the addresses of
+your data items. Most variables will reside in the sections you have
+declared; they can be accessed using the \I{GOTOFF
+relocation}\c{..gotoff} special \I\c{WRT ..gotoff}\c{WRT} type. The
+way this works is like this:
+
+\c         lea     eax,[ebx+myvar wrt ..gotoff]
+
+The expression \c{myvar wrt ..gotoff} is calculated, when the shared
+library is linked, to be the offset to the local variable \c{myvar}
+from the beginning of the GOT. Therefore, adding it to \c{EBX} as
+above will place the real address of \c{myvar} in \c{EAX}.
+
+If you declare variables as \c{GLOBAL} without specifying a size for
+them, they are shared between code modules in the library, but do
+not get exported from the library to the program that loaded it.
+They will still be in your ordinary data and BSS sections, so you
+can access them in the same way as local variables, using the above
+\c{..gotoff} mechanism.
+
+Note that due to a peculiarity of the way BSD \c{a.out} format
+handles this relocation type, there must be at least one non-local
+symbol in the same section as the address you're trying to access.
+
+
+\S{picextern} Finding External and Common Data Items
+
+If your library needs to get at an external variable (external to
+the \e{library}, not just to one of the modules within it), you must
+use the \I{GOT relocations}\I\c{WRT ..got}\c{..got} type to get at
+it. The \c{..got} type, instead of giving you the offset from the
+GOT base to the variable, gives you the offset from the GOT base to
+a GOT \e{entry} containing the address of the variable. The linker
+will set up this GOT entry when it builds the library, and the
+dynamic linker will place the correct address in it at load time. So
+to obtain the address of an external variable \c{extvar} in \c{EAX},
+you would code
+
+\c         mov     eax,[ebx+extvar wrt ..got]
+
+This loads the address of \c{extvar} out of an entry in the GOT. The
+linker, when it builds the shared library, collects together every
+relocation of type \c{..got}, and builds the GOT so as to ensure it
+has every necessary entry present.
+
+Common variables must also be accessed in this way.
+
+
+\S{picglobal} Exporting Symbols to the Library User
+
+If you want to export symbols to the user of the library, you have
+to declare whether they are functions or data, and if they are data,
+you have to give the size of the data item. This is because the
+dynamic linker has to build \I{PLT}\i{procedure linkage table}
+entries for any exported functions, and also moves exported data
+items away from the library's data section in which they were
+declared.
+
+So to export a function to users of the library, you must use
+
+\c global  func:function           ; declare it as a function
+\c
+\c func:   push    ebp
+\c
+\c         ; etc.
+
+And to export a data item such as an array, you would have to code
+
+\c global  array:data array.end-array      ; give the size too
+\c
+\c array:  resd    128
+\c .end:
+
+Be careful: If you export a variable to the library user, by
+declaring it as \c{GLOBAL} and supplying a size, the variable will
+end up living in the data section of the main program, rather than
+in your library's data section, where you declared it. So you will
+have to access your own global variable with the \c{..got} mechanism
+rather than \c{..gotoff}, as if it were external (which,
+effectively, it has become).
+
+Equally, if you need to store the address of an exported global in
+one of your data sections, you can't do it by means of the standard
+sort of code:
+
+\c dataptr:        dd      global_data_item        ; WRONG
+
+NASM will interpret this code as an ordinary relocation, in which
+\c{global_data_item} is merely an offset from the beginning of the
+\c{.data} section (or whatever); so this reference will end up
+pointing at your data section instead of at the exported global
+which resides elsewhere.
+
+Instead of the above code, then, you must write
+
+\c dataptr:        dd      global_data_item wrt ..sym
+
+which makes use of the special \c{WRT} type \I\c{WRT ..sym}\c{..sym}
+to instruct NASM to search the symbol table for a particular symbol
+at that address, rather than just relocating by section base.
+
+Either method will work for functions: referring to one of your
+functions by means of
+
+\c funcptr:        dd      my_function
+
+will give the user the address of the code you wrote, whereas
+
+\c funcptr:        dd      my_function wrt .sym
+
+will give the address of the procedure linkage table for the
+function, which is where the calling program will \e{believe} the
+function lives. Either address is a valid way to call the function.
+
+
+\S{picproc} Calling Procedures Outside the Library
+
+Calling procedures outside your shared library has to be done by
+means of a \i\e{procedure linkage table}, or \i{PLT}. The PLT is
+placed at a known offset from where the library is loaded, so the
+library code can make calls to the PLT in a position-independent
+way. Within the PLT there is code to jump to offsets contained in
+the GOT, so function calls to other shared libraries or to routines
+in the main program can be transparently passed off to their real
+destinations.
+
+To call an external routine, you must use another special PIC
+relocation type, \I{PLT relocations}\i\c{WRT ..plt}. This is much
+easier than the GOT-based ones: you simply replace calls such as
+\c{CALL printf} with the PLT-relative version \c{CALL printf WRT
+..plt}.
+
+
+\S{link} Generating the Library File
+
+Having written some code modules and assembled them to \c{.o} files,
+you then generate your shared library with a command such as
+
+\c ld -shared -o library.so module1.o module2.o       # for ELF
+\c ld -Bshareable -o library.so module1.o module2.o   # for BSD
+
+For ELF, if your shared library is going to reside in system
+directories such as \c{/usr/lib} or \c{/lib}, it is usually worth
+using the \i\c{-soname} flag to the linker, to store the final
+library file name, with a version number, into the library:
+
+\c ld -shared -soname library.so.1 -o library.so.1.2 *.o
+
+You would then copy \c{library.so.1.2} into the library directory,
+and create \c{library.so.1} as a symbolic link to it.
+
+
+\C{mixsize} Mixing 16 and 32 Bit Code
+
+This chapter tries to cover some of the issues, largely related to
+unusual forms of addressing and jump instructions, encountered when
+writing operating system code such as protected-mode initialisation
+routines, which require code that operates in mixed segment sizes,
+such as code in a 16-bit segment trying to modify data in a 32-bit
+one, or jumps between different-size segments.
+
+
+\H{mixjump} Mixed-Size Jumps\I{jumps, mixed-size}
+
+\I{operating system, writing}\I{writing operating systems}The most
+common form of \i{mixed-size instruction} is the one used when
+writing a 32-bit OS: having done your setup in 16-bit mode, such as
+loading the kernel, you then have to boot it by switching into
+protected mode and jumping to the 32-bit kernel start address. In a
+fully 32-bit OS, this tends to be the \e{only} mixed-size
+instruction you need, since everything before it can be done in pure
+16-bit code, and everything after it can be pure 32-bit.
+
+This jump must specify a 48-bit far address, since the target
+segment is a 32-bit one. However, it must be assembled in a 16-bit
+segment, so just coding, for example,
+
+\c         jmp     0x1234:0x56789ABC       ; wrong!
+
+will not work, since the offset part of the address will be
+truncated to \c{0x9ABC} and the jump will be an ordinary 16-bit far
+one.
+
+The Linux kernel setup code gets round the inability of \c{as86} to
+generate the required instruction by coding it manually, using
+\c{DB} instructions. NASM can go one better than that, by actually
+generating the right instruction itself. Here's how to do it right:
+
+\c         jmp     dword 0x1234:0x56789ABC         ; right
+
+\I\c{JMP DWORD}The \c{DWORD} prefix (strictly speaking, it should
+come \e{after} the colon, since it is declaring the \e{offset} field
+to be a doubleword; but NASM will accept either form, since both are
+unambiguous) forces the offset part to be treated as far, in the
+assumption that you are deliberately writing a jump from a 16-bit
+segment to a 32-bit one.
+
+You can do the reverse operation, jumping from a 32-bit segment to a
+16-bit one, by means of the \c{WORD} prefix:
+
+\c         jmp     word 0x8765:0x4321      ; 32 to 16 bit
+
+If the \c{WORD} prefix is specified in 16-bit mode, or the \c{DWORD}
+prefix in 32-bit mode, they will be ignored, since each is
+explicitly forcing NASM into a mode it was in anyway.
+
+
+\H{mixaddr} Addressing Between Different-Size Segments\I{addressing,
+mixed-size}\I{mixed-size addressing}
+
+If your OS is mixed 16 and 32-bit, or if you are writing a DOS
+extender, you are likely to have to deal with some 16-bit segments
+and some 32-bit ones. At some point, you will probably end up
+writing code in a 16-bit segment which has to access data in a
+32-bit segment, or vice versa.
+
+If the data you are trying to access in a 32-bit segment lies within
+the first 64K of the segment, you may be able to get away with using
+an ordinary 16-bit addressing operation for the purpose; but sooner
+or later, you will want to do 32-bit addressing from 16-bit mode.
+
+The easiest way to do this is to make sure you use a register for
+the address, since any effective address containing a 32-bit
+register is forced to be a 32-bit address. So you can do
+
+\c         mov     eax,offset_into_32_bit_segment_specified_by_fs
+\c         mov     dword [fs:eax],0x11223344
+
+This is fine, but slightly cumbersome (since it wastes an
+instruction and a register) if you already know the precise offset
+you are aiming at. The x86 architecture does allow 32-bit effective
+addresses to specify nothing but a 4-byte offset, so why shouldn't
+NASM be able to generate the best instruction for the purpose?
+
+It can. As in \k{mixjump}, you need only prefix the address with the
+\c{DWORD} keyword, and it will be forced to be a 32-bit address:
+
+\c         mov     dword [fs:dword my_offset],0x11223344
+
+Also as in \k{mixjump}, NASM is not fussy about whether the
+\c{DWORD} prefix comes before or after the segment override, so
+arguably a nicer-looking way to code the above instruction is
+
+\c         mov     dword [dword fs:my_offset],0x11223344
+
+Don't confuse the \c{DWORD} prefix \e{outside} the square brackets,
+which controls the size of the data stored at the address, with the
+one \c{inside} the square brackets which controls the length of the
+address itself. The two can quite easily be different:
+
+\c         mov     word [dword 0x12345678],0x9ABC
+
+This moves 16 bits of data to an address specified by a 32-bit
+offset.
+
+You can also specify \c{WORD} or \c{DWORD} prefixes along with the
+\c{FAR} prefix to indirect far jumps or calls. For example:
+
+\c         call    dword far [fs:word 0x4321]
+
+This instruction contains an address specified by a 16-bit offset;
+it loads a 48-bit far pointer from that (16-bit segment and 32-bit
+offset), and calls that address.
+
+
+\H{mixother} Other Mixed-Size Instructions
+
+The other way you might want to access data might be using the
+string instructions (\c{LODSx}, \c{STOSx} and so on) or the
+\c{XLATB} instruction. These instructions, since they take no
+parameters, might seem to have no easy way to make them perform
+32-bit addressing when assembled in a 16-bit segment.
+
+This is the purpose of NASM's \i\c{a16}, \i\c{a32} and \i\c{a64} prefixes. If
+you are coding \c{LODSB} in a 16-bit segment but it is supposed to
+be accessing a string in a 32-bit segment, you should load the
+desired address into \c{ESI} and then code
+
+\c         a32     lodsb
+
+The prefix forces the addressing size to 32 bits, meaning that
+\c{LODSB} loads from \c{[DS:ESI]} instead of \c{[DS:SI]}. To access
+a string in a 16-bit segment when coding in a 32-bit one, the
+corresponding \c{a16} prefix can be used.
+
+The \c{a16}, \c{a32} and \c{a64} prefixes can be applied to any instruction
+in NASM's instruction table, but most of them can generate all the
+useful forms without them. The prefixes are necessary only for
+instructions with implicit addressing:
+\# \c{CMPSx} (\k{insCMPSB}),
+\# \c{SCASx} (\k{insSCASB}), \c{LODSx} (\k{insLODSB}), \c{STOSx}
+\# (\k{insSTOSB}), \c{MOVSx} (\k{insMOVSB}), \c{INSx} (\k{insINSB}),
+\# \c{OUTSx} (\k{insOUTSB}), and \c{XLATB} (\k{insXLATB}).
+\c{CMPSx}, \c{SCASx}, \c{LODSx}, \c{STOSx}, \c{MOVSx}, \c{INSx},
+\c{OUTSx}, and \c{XLATB}.
+Also, the
+various push and pop instructions (\c{PUSHA} and \c{POPF} as well as
+the more usual \c{PUSH} and \c{POP}) can accept \c{a16}, \c{a32} or \c{a64}
+prefixes to force a particular one of \c{SP}, \c{ESP} or \c{RSP} to be used
+as a stack pointer, in case the stack segment in use is a different
+size from the code segment.
+
+\c{PUSH} and \c{POP}, when applied to segment registers in 32-bit
+mode, also have the slightly odd behaviour that they push and pop 4
+bytes at a time, of which the top two are ignored and the bottom two
+give the value of the segment register being manipulated. To force
+the 16-bit behaviour of segment-register push and pop instructions,
+you can use the operand-size prefix \i\c{o16}:
+
+\c         o16 push    ss
+\c         o16 push    ds
+
+This code saves a doubleword of stack space by fitting two segment
+registers into the space which would normally be consumed by pushing
+one.
+
+(You can also use the \i\c{o32} prefix to force the 32-bit behaviour
+when in 16-bit mode, but this seems less useful.)
+
+
+\C{64bit} Writing 64-bit Code (Unix, Win64)
+
+This chapter attempts to cover some of the common issues involved when
+writing 64-bit code, to run under \i{Win64} or Unix.  It covers how to
+write assembly code to interface with 64-bit C routines, and how to
+write position-independent code for shared libraries.
+
+All 64-bit code uses a flat memory model, since segmentation is not
+available in 64-bit mode.  The one exception is the \c{FS} and \c{GS}
+registers, which still add their bases.
+
+Position independence in 64-bit mode is significantly simpler, since
+the processor supports \c{RIP}-relative addressing directly; see the
+\c{REL} keyword (\k{effaddr}).  On most 64-bit platforms, it is
+probably desirable to make that the default, using the directive
+\c{DEFAULT REL} (\k{default}).
+
+64-bit programming is relatively similar to 32-bit programming, but
+of course pointers are 64 bits long; additionally, all existing
+platforms pass arguments in registers rather than on the stack.
+Furthermore, 64-bit platforms use SSE2 by default for floating point.
+Please see the ABI documentation for your platform.
+
+64-bit platforms differ in the sizes of the fundamental datatypes, not
+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{reg64} Register Names in 64-bit Mode
+
+NASM uses the following names for general-purpose registers in 64-bit
+mode, for 8-, 16-, 32- and 64-bit references, respecitively:
+
+\c      AL/AH, CL/CH, DL/DH, BL/BH, SPL, BPL, SIL, DIL, R8B-R15B
+\c      AX, CX, DX, BX, SP, BP, SI, DI, R8W-R15W
+\c      EAX, ECX, EDX, EBX, ESP, EBP, ESI, EDI, R8D-R15D
+\c      RAX, RCX, RDX, RBX, RSP, RBP, RSI, RDI, R8-R15
+
+This is consistent with the AMD documentation and most other
+assemblers.  The Intel documentation, however, uses the names
+\c{R8L-R15L} for 8-bit references to the higher registers.  It is
+possible to use those names by definiting them as macros; similarly,
+if one wants to use numeric names for the low 8 registers, define them
+as macros.  The standard macro package \c{altreg} (see \k{pkg_altreg})
+can be used for this purpose.
+
+\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 displacement}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.
+
+\H{unix64} Interfacing to 64-bit C Programs (Unix)
+
+On Unix, the 64-bit ABI is defined by the document:
+
+\W{http://www.x86-64.org/documentation/abi.pdf}\c{http://www.x86-64.org/documentation/abi.pdf}
+
+Although written for AT&T-syntax assembly, the concepts apply equally
+well for NASM-style assembly.  What follows is a simplified summary.
+
+The first six integer arguments (from the left) are passed in \c{RDI},
+\c{RSI}, \c{RDX}, \c{RCX}, \c{R8}, and \c{R9}, in that order.
+Additional integer arguments are passed on the stack.  These
+registers, plus \c{RAX}, \c{R10} and \c{R11} are destroyed by function
+calls, and thus are available for use by the function without saving.
+
+Integer return values are passed in \c{RAX} and \c{RDX}, in that order.
+
+Floating point is done using SSE registers, except for \c{long
+double}.  Floating-point arguments are passed in \c{XMM0} to \c{XMM7};
+return is \c{XMM0} and \c{XMM1}.  \c{long double} are passed on the
+stack, and returned in \c{ST0} and \c{ST1}.
+
+All SSE and x87 registers are destroyed by function calls.
+
+On 64-bit Unix, \c{long} is 64 bits.
+
+Integer and SSE register arguments are counted separately, so for the case of
+
+\c      void foo(long a, double b, int c)
+
+\c{a} is passed in \c{RDI}, \c{b} in \c{XMM0}, and \c{c} in \c{ESI}.
+
+\H{win64} Interfacing to 64-bit C Programs (Win64)
+
+The Win64 ABI is described at:
+
+\W{http://msdn2.microsoft.com/en-gb/library/ms794533.aspx}\c{http://msdn2.microsoft.com/en-gb/library/ms794533.aspx}
+
+What follows is a simplified summary.
+
+The first four integer arguments are passed in \c{RCX}, \c{RDX},
+\c{R8} and \c{R9}, in that order.  Additional integer arguments are
+passed on the stack.  These registers, plus \c{RAX}, \c{R10} and
+\c{R11} are destroyed by function calls, and thus are available for
+use by the function without saving.
+
+Integer return values are passed in \c{RAX} only.
+
+Floating point is done using SSE registers, except for \c{long
+double}.  Floating-point arguments are passed in \c{XMM0} to \c{XMM3};
+return is \c{XMM0} only.
+
+On Win64, \c{long} is 32 bits; \c{long long} or \c{_int64} is 64 bits.
+
+Integer and SSE register arguments are counted together, so for the case of
+
+\c      void foo(long long a, double b, int c)
+
+\c{a} is passed in \c{RCX}, \c{b} in \c{XMM1}, and \c{c} in \c{R8D}.
+
+\C{trouble} Troubleshooting
+
+This chapter describes some of the common problems that users have
+been known to encounter with NASM, and answers them. It also gives
+instructions for reporting bugs in NASM if you find a difficulty
+that isn't listed here.
+
+
+\H{problems} Common Problems
+
+\S{inefficient} NASM Generates \i{Inefficient Code}
+
+We sometimes get `bug' reports about NASM generating inefficient, or
+even `wrong', code on instructions such as \c{ADD ESP,8}. This is a
+deliberate design feature, connected to predictability of output:
+NASM, on seeing \c{ADD ESP,8}, will generate the form of the
+instruction which leaves room for a 32-bit offset. You need to code
+\I\c{BYTE}\c{ADD ESP,BYTE 8} if you want the space-efficient form of
+the instruction. This isn't a bug, it's user error: if you prefer to
+have NASM produce the more efficient code automatically enable
+optimization with the \c{-O} option (see \k{opt-O}).
+
+
+\S{jmprange} My Jumps are Out of Range\I{out of range, jumps}
+
+Similarly, people complain that when they issue \i{conditional
+jumps} (which are \c{SHORT} by default) that try to jump too far,
+NASM reports `short jump out of range' instead of making the jumps
+longer.
+
+This, again, is partly a predictability issue, but in fact has a
+more practical reason as well. NASM has no means of being told what
+type of processor the code it is generating will be run on; so it
+cannot decide for itself that it should generate \i\c{Jcc NEAR} type
+instructions, because it doesn't know that it's working for a 386 or
+above. Alternatively, it could replace the out-of-range short
+\c{JNE} instruction with a very short \c{JE} instruction that jumps
+over a \c{JMP NEAR}; this is a sensible solution for processors
+below a 386, but hardly efficient on processors which have good
+branch prediction \e{and} could have used \c{JNE NEAR} instead. So,
+once again, it's up to the user, not the assembler, to decide what
+instructions should be generated. See \k{opt-O}.
+
+
+\S{proborg} \i\c{ORG} Doesn't Work
+
+People writing \i{boot sector} programs in the \c{bin} format often
+complain that \c{ORG} doesn't work the way they'd like: in order to
+place the \c{0xAA55} signature word at the end of a 512-byte boot
+sector, people who are used to MASM tend to code
+
+\c         ORG 0
+\c
+\c         ; some boot sector code
+\c
+\c         ORG 510
+\c         DW 0xAA55
+
+This is not the intended use of the \c{ORG} directive in NASM, and
+will not work. The correct way to solve this problem in NASM is to
+use the \i\c{TIMES} directive, like this:
+
+\c         ORG 0
+\c
+\c         ; some boot sector code
+\c
+\c         TIMES 510-($-$$) DB 0
+\c         DW 0xAA55
+
+The \c{TIMES} directive will insert exactly enough zero bytes into
+the output to move the assembly point up to 510. This method also
+has the advantage that if you accidentally fill your boot sector too
+full, NASM will catch the problem at assembly time and report it, so
+you won't end up with a boot sector that you have to disassemble to
+find out what's wrong with it.
+
+
+\S{probtimes} \i\c{TIMES} Doesn't Work
+
+The other common problem with the above code is people who write the
+\c{TIMES} line as
+
+\c         TIMES 510-$ DB 0
+
+by reasoning that \c{$} should be a pure number, just like 510, so
+the difference between them is also a pure number and can happily be
+fed to \c{TIMES}.
+
+NASM is a \e{modular} assembler: the various component parts are
+designed to be easily separable for re-use, so they don't exchange
+information unnecessarily. In consequence, the \c{bin} output
+format, even though it has been told by the \c{ORG} directive that
+the \c{.text} section should start at 0, does not pass that
+information back to the expression evaluator. So from the
+evaluator's point of view, \c{$} isn't a pure number: it's an offset
+from a section base. Therefore the difference between \c{$} and 510
+is also not a pure number, but involves a section base. Values
+involving section bases cannot be passed as arguments to \c{TIMES}.
+
+The solution, as in the previous section, is to code the \c{TIMES}
+line in the form
+
+\c         TIMES 510-($-$$) DB 0
+
+in which \c{$} and \c{$$} are offsets from the same section base,
+and so their difference is a pure number. This will solve the
+problem and generate sensible code.
+
+
+\H{bugs} \i{Bugs}\I{reporting bugs}
+
+We have never yet released a version of NASM with any \e{known}
+bugs. That doesn't usually stop there being plenty we didn't know
+about, though. Any that you find should be reported firstly via the
+\i\c{bugtracker} at
+\W{https://sourceforge.net/projects/nasm/}\c{https://sourceforge.net/projects/nasm/}
+(click on "Bugs"), or if that fails then through one of the
+contacts in \k{contact}.
+
+Please read \k{qstart} first, and don't report the bug if it's
+listed in there as a deliberate feature. (If you think the feature
+is badly thought out, feel free to send us reasons why you think it
+should be changed, but don't just send us mail saying `This is a
+bug' if the documentation says we did it on purpose.) Then read
+\k{problems}, and don't bother reporting the bug if it's listed
+there.
+
+If you do report a bug, \e{please} give us all of the following
+information:
+
+\b What operating system you're running NASM under. DOS, Linux,
+NetBSD, Win16, Win32, VMS (I'd be impressed), whatever.
+
+\b If you're running NASM under DOS or Win32, tell us whether you've
+compiled your own executable from the DOS source archive, or whether
+you were using the standard distribution binaries out of the
+archive. If you were using a locally built executable, try to
+reproduce the problem using one of the standard binaries, as this
+will make it easier for us to reproduce your problem prior to fixing
+it.
+
+\b Which version of NASM you're using, and exactly how you invoked
+it. Give us the precise command line, and the contents of the
+\c{NASMENV} environment variable if any.
+
+\b Which versions of any supplementary programs you're using, and
+how you invoked them. If the problem only becomes visible at link
+time, tell us what linker you're using, what version of it you've
+got, and the exact linker command line. If the problem involves
+linking against object files generated by a compiler, tell us what
+compiler, what version, and what command line or options you used.
+(If you're compiling in an IDE, please try to reproduce the problem
+with the command-line version of the compiler.)
+
+\b If at all possible, send us a NASM source file which exhibits the
+problem. If this causes copyright problems (e.g. you can only
+reproduce the bug in restricted-distribution code) then bear in mind
+the following two points: firstly, we guarantee that any source code
+sent to us for the purposes of debugging NASM will be used \e{only}
+for the purposes of debugging NASM, and that we will delete all our
+copies of it as soon as we have found and fixed the bug or bugs in
+question; and secondly, we would prefer \e{not} to be mailed large
+chunks of code anyway. The smaller the file, the better. A
+three-line sample file that does nothing useful \e{except}
+demonstrate the problem is much easier to work with than a
+fully fledged ten-thousand-line program. (Of course, some errors
+\e{do} only crop up in large files, so this may not be possible.)
+
+\b A description of what the problem actually \e{is}. `It doesn't
+work' is \e{not} a helpful description! Please describe exactly what
+is happening that shouldn't be, or what isn't happening that should.
+Examples might be: `NASM generates an error message saying Line 3
+for an error that's actually on Line 5'; `NASM generates an error
+message that I believe it shouldn't be generating at all'; `NASM
+fails to generate an error message that I believe it \e{should} be
+generating'; `the object file produced from this source code crashes
+my linker'; `the ninth byte of the output file is 66 and I think it
+should be 77 instead'.
+
+\b If you believe the output file from NASM to be faulty, send it to
+us. That allows us to determine whether our own copy of NASM
+generates the same file, or whether the problem is related to
+portability issues between our development platforms and yours. We
+can handle binary files mailed to us as MIME attachments, uuencoded,
+and even BinHex. Alternatively, we may be able to provide an FTP
+site you can upload the suspect files to; but mailing them is easier
+for us.
+
+\b Any other information or data files that might be helpful. If,
+for example, the problem involves NASM failing to generate an object
+file while TASM can generate an equivalent file without trouble,
+then send us \e{both} object files, so we can see what TASM is doing
+differently from us.
+
+
+\A{ndisasm} \i{Ndisasm}
+
+                  The Netwide Disassembler, NDISASM
+
+\H{ndisintro} Introduction
+
+
+The Netwide Disassembler is a small companion program to the Netwide
+Assembler, NASM. It seemed a shame to have an x86 assembler,
+complete with a full instruction table, and not make as much use of
+it as possible, so here's a disassembler which shares the
+instruction table (and some other bits of code) with NASM.
+
+The Netwide Disassembler does nothing except to produce
+disassemblies of \e{binary} source files. NDISASM does not have any
+understanding of object file formats, like \c{objdump}, and it will
+not understand \c{DOS .EXE} files like \c{debug} will. It just
+disassembles.
+
+
+\H{ndisstart} Getting Started: Installation
+
+See \k{install} for installation instructions. NDISASM, like NASM,
+has a \c{man page} which you may want to put somewhere useful, if you
+are on a Unix system.
+
+
+\H{ndisrun} Running NDISASM
+
+To disassemble a file, you will typically use a command of the form
+
+\c        ndisasm -b {16|32|64} filename
+
+NDISASM can disassemble 16-, 32- or 64-bit code equally easily,
+provided of course that you remember to specify which it is to work
+with. If no \i\c{-b} switch is present, NDISASM works in 16-bit mode
+by default. The \i\c{-u} switch (for USE32) also invokes 32-bit mode.
+
+Two more command line options are \i\c{-r} which reports the version
+number of NDISASM you are running, and \i\c{-h} which gives a short
+summary of command line options.
+
+
+\S{ndiscom} COM Files: Specifying an Origin
+
+To disassemble a \c{DOS .COM} file correctly, a disassembler must assume
+that the first instruction in the file is loaded at address \c{0x100},
+rather than at zero. NDISASM, which assumes by default that any file
+you give it is loaded at zero, will therefore need to be informed of
+this.
+
+The \i\c{-o} option allows you to declare a different origin for the
+file you are disassembling. Its argument may be expressed in any of
+the NASM numeric formats: decimal by default, if it begins with `\c{$}'
+or `\c{0x}' or ends in `\c{H}' it's \c{hex}, if it ends in `\c{Q}' it's
+\c{octal}, and if it ends in `\c{B}' it's \c{binary}.
+
+Hence, to disassemble a \c{.COM} file:
+
+\c        ndisasm -o100h filename.com
+
+will do the trick.
+
+
+\S{ndissync} Code Following Data: Synchronisation
+
+Suppose you are disassembling a file which contains some data which
+isn't machine code, and \e{then} contains some machine code. NDISASM
+will faithfully plough through the data section, producing machine
+instructions wherever it can (although most of them will look
+bizarre, and some may have unusual prefixes, e.g. `\c{FS OR AX,0x240A}'),
+and generating `DB' instructions ever so often if it's totally stumped.
+Then it will reach the code section.
+
+Supposing NDISASM has just finished generating a strange machine
+instruction from part of the data section, and its file position is
+now one byte \e{before} the beginning of the code section. It's
+entirely possible that another spurious instruction will get
+generated, starting with the final byte of the data section, and
+then the correct first instruction in the code section will not be
+seen because the starting point skipped over it. This isn't really
+ideal.
+
+To avoid this, you can specify a `\i\c{synchronisation}' point, or indeed
+as many synchronisation points as you like (although NDISASM can
+only handle 2147483647 sync points internally). The definition of a sync
+point is this: NDISASM guarantees to hit sync points exactly during
+disassembly. If it is thinking about generating an instruction which
+would cause it to jump over a sync point, it will discard that
+instruction and output a `\c{db}' instead. So it \e{will} start
+disassembly exactly from the sync point, and so you \e{will} see all
+the instructions in your code section.
+
+Sync points are specified using the \i\c{-s} option: they are measured
+in terms of the program origin, not the file position. So if you
+want to synchronize after 32 bytes of a \c{.COM} file, you would have to
+do
+
+\c        ndisasm -o100h -s120h file.com
+
+rather than
+
+\c        ndisasm -o100h -s20h file.com
+
+As stated above, you can specify multiple sync markers if you need
+to, just by repeating the \c{-s} option.
+
+
+\S{ndisisync} Mixed Code and Data: Automatic (Intelligent) Synchronisation
+\I\c{auto-sync}
+
+Suppose you are disassembling the boot sector of a \c{DOS} floppy (maybe
+it has a virus, and you need to understand the virus so that you
+know what kinds of damage it might have done you). Typically, this
+will contain a \c{JMP} instruction, then some data, then the rest of the
+code. So there is a very good chance of NDISASM being \e{misaligned}
+when the data ends and the code begins. Hence a sync point is
+needed.
+
+On the other hand, why should you have to specify the sync point
+manually? What you'd do in order to find where the sync point would
+be, surely, would be to read the \c{JMP} instruction, and then to use
+its target address as a sync point. So can NDISASM do that for you?
+
+The answer, of course, is yes: using either of the synonymous
+switches \i\c{-a} (for automatic sync) or \i\c{-i} (for intelligent
+sync) will enable \c{auto-sync} mode. Auto-sync mode automatically
+generates a sync point for any forward-referring PC-relative jump or
+call instruction that NDISASM encounters. (Since NDISASM is one-pass,
+if it encounters a PC-relative jump whose target has already been
+processed, there isn't much it can do about it...)
+
+Only PC-relative jumps are processed, since an absolute jump is
+either through a register (in which case NDISASM doesn't know what
+the register contains) or involves a segment address (in which case
+the target code isn't in the same segment that NDISASM is working
+in, and so the sync point can't be placed anywhere useful).
+
+For some kinds of file, this mechanism will automatically put sync
+points in all the right places, and save you from having to place
+any sync points manually. However, it should be stressed that
+auto-sync mode is \e{not} guaranteed to catch all the sync points, and
+you may still have to place some manually.
+
+Auto-sync mode doesn't prevent you from declaring manual sync
+points: it just adds automatically generated ones to the ones you
+provide. It's perfectly feasible to specify \c{-i} \e{and} some \c{-s}
+options.
+
+Another caveat with auto-sync mode is that if, by some unpleasant
+fluke, something in your data section should disassemble to a
+PC-relative call or jump instruction, NDISASM may obediently place a
+sync point in a totally random place, for example in the middle of
+one of the instructions in your code section. So you may end up with
+a wrong disassembly even if you use auto-sync. Again, there isn't
+much I can do about this. If you have problems, you'll have to use
+manual sync points, or use the \c{-k} option (documented below) to
+suppress disassembly of the data area.
+
+
+\S{ndisother} Other Options
+
+The \i\c{-e} option skips a header on the file, by ignoring the first N
+bytes. This means that the header is \e{not} counted towards the
+disassembly offset: if you give \c{-e10 -o10}, disassembly will start
+at byte 10 in the file, and this will be given offset 10, not 20.
+
+The \i\c{-k} option is provided with two comma-separated numeric
+arguments, the first of which is an assembly offset and the second
+is a number of bytes to skip. This \e{will} count the skipped bytes
+towards the assembly offset: its use is to suppress disassembly of a
+data section which wouldn't contain anything you wanted to see
+anyway.
+
+
+\H{ndisbugs} Bugs and Improvements
+
+There are no known bugs. However, any you find, with patches if
+possible, should be sent to
+\W{mailto:nasm-bugs@lists.sourceforge.net}\c{nasm-bugs@lists.sourceforge.net}, or to the
+developer's site at
+\W{https://sourceforge.net/projects/nasm/}\c{https://sourceforge.net/projects/nasm/}
+and we'll try to fix them. Feel free to send contributions and
+new features as well.
+
+\A{inslist} \i{Instruction List}
+
+\H{inslistintro} Introduction
+
+The following sections show the instructions which NASM currently supports. For each
+instruction, there is a separate entry for each supported addressing mode. The third
+column shows the processor type in which the instruction was introduced and,
+ when appropriate, one or more usage flags.
+
+\& inslist.src
+
+\A{changelog} \i{NASM Version History}
+
+\& changes.src
+
diff --git a/doc/nasmlogo.eps b/doc/nasmlogo.eps
new file mode 100644 (file)
index 0000000..deb5a2c
--- /dev/null
@@ -0,0 +1,35 @@
+%!PS-Adobe-3.0 EPSF-3.0
+%%BoundingBox: 99 45 385 111
+%%DocumentData: Clean7Bit
+%%DocumentFonts: Courier-Bold
+%%DocumentNeededFonts: Courier-Bold
+%%Title: (NASM logo)
+%%EndComments
+%%Page 1 1
+%%BeginPageSetup
+save
+newpath
+%%EndPageSetup
+% x y pointsize --
+/nasmlogo {
+gsave 1 dict begin
+/sz exch def
+/Courier-Bold findfont sz scalefont setfont
+moveto
+0.85 1.22 scale
+[(-~~..~:#;L       .-:#;L,.-   .~:#:;.T  -~~.~:;. .~:;. )
+( E8+U    *T     +U'   *T#  .97     *L   E8+'  *;T'  *;, )
+( D97     `*L  .97     '*L   "T;E+:,     D9     *L    *L )
+( H7       I#  T7       I#        "*:.   H7     I#    I# )
+( U:       :8  *#+    , :8  T,      79   U:     :8    :8 )
+(,#B.     .IE,  "T;E*  .IE, J *+;#:T*"  ,#B.   .IE,  .IE,)] {
+currentpoint 3 -1 roll
+sz -0.10 mul 0 3 -1 roll ashow
+sz 0.72 mul sub moveto
+} forall
+end grestore
+} def
+0.6 setgray 100 100 12 nasmlogo
+%%PageTrailer
+restore
+%%EOF
diff --git a/doc/opt_var.txt b/doc/opt_var.txt
new file mode 100644 (file)
index 0000000..4482e5d
--- /dev/null
@@ -0,0 +1,114 @@
+                     NASM Optimizer Usage of
+              Certain Variables to Control Assembly
+
+                  prepared by:  John R Coffman
+                       date:  07-Mar-2005
+
+
+GLOBAL variables:
+        optimizing      -1 flags nasm 0.98 compatible operation;
+                            offsets usually are explicit (short/near)
+                            no optimization passes
+                        0 flags non-optimized assembly; forward
+                            references generate long offsets; always
+                            assembles
+                            no optimization passes
+                        2 or more specifies optmization passes.  5 is
+                            the actual recommended minimum setting
+                            optimization passes (2 or more, plus
+                            passes 1 and 2 will be required)
+
+
+        pass0           0 flags an optimizer pass (multiple passes)
+                        1 flags pass1 (define labels)
+                        2 flags pass2 (spit out code)
+
+
+LOCAL variables:        local to 'assemble_file' (nasm.c)
+
+        pass_max        2 for non-optimized assembly
+                        4 or more for optimized assembly
+
+        pass            index of the FOR loop (1..pass_max)
+                        with optimized assembly, this variable is
+                            advanced to 'pass_max - 1' in the logic
+                            at the end of the loop to terminate
+                            an optimized assembly before all passes
+                            are used; i.e., when convergence has 
+                            occurred
+                
+
+        pass1           flag for making parts of the assembler do
+                            pass 1 behaviors on optimizer passes
+
+        pass2           flag for making parts of the assembler do
+                            pass 2 behaviors on optimizer passes
+
+        pass_cnt        benign counter for counting the actual
+                            number of passes taken.  Since 'pass'
+                            may be jerked upward early on optimized
+                            assembly, it does not accurately reflect
+                            the number of passes taken.
+                        always ends at 2 for non-optimized assembly
+
+
+
+        How the variables sequence:
+
+
+NON-OPTIMIZED assembly:
+
+                
+        pass0           1  2        all indicate, pass 1 and pass 2
+        pass1           1  2
+        pass2           1  2
+
+        pass            1  2
+   ----------------------------------------
+
+        pass_max        pre-set to 2
+        pass_cnt        ends at 2
+
+
+OPTIMIZED assembly:
+
+        optimizing      set to 2 or greater
+
+        pass0           0  0  0  0  0 ... 0  0  1  2
+        pass1           1  1  1  1  1 ... 1  1  1  2
+        pass2           1  2  2  2  2 ... 2  2  2  2
+
+        pass            1  2  3  4  5 ... 7  8  9  12
+
+        pass_max        pre-set to, say, 12
+        pass_cnt        ends at 10 for this assembly
+
+>From pass_cnt, the reported number of passes will be 1+8+1, meaning 
+8 optimization passes, plus pass 1, plus pass 2.
+
+Subroutines may check 'pass0' to see if an optimizer pass is in
+progress (pass0==0).  Many have arguments to tell what pass is in
+progress.  But these variables are passed in as 'pass1' or 'pass2'.
+
+>From the sequences above, 'pass' bears no relation to the desired
+pass 1 or pass 2 behavior of the assembler.  'pass1' is used to tell
+parts of the assembler, on multiple occasions, that pass 1 is in
+progress, and only once that pass 2 is being performed.  Other parts
+of the assembler need to be told only once that pass 1 is being
+performed, but may be told multiple times that pass 2 is being done.
+
+For instance, the preprocessor reset operation looks at pass1, and it
+thinks many pass 1 resets are being done, but only one pass 2 reset
+is done.  Also, certain errors are non-fatal on pass 1, but fatal on
+pass 2; hence, they are tied to the 'pass1' variable to determine the
+assembler pass number.
+
+Further, segment definitions look at the 'pass2' variable, since they
+do some initialization on pass 1, but are pretty much no-ops on pass
+2.  Hence, they should see pass 1 only once, but may see pass 2
+multiple times.
+
+
+[end]
+
diff --git a/doc/psfonts.ph b/doc/psfonts.ph
new file mode 100644 (file)
index 0000000..8d2f4e6
--- /dev/null
@@ -0,0 +1,112 @@
+#!/usr/bin/perl
+#
+# Font metrics for the PS code generator
+#
+
+# These files are generated from AFM files
+require 'metrics/ptmr8a.ph';   # Times-Roman
+require 'metrics/ptmb8a.ph';   # Times-Bold
+require 'metrics/ptmri8a.ph';  # Times-Italic
+require 'metrics/ptmbi8a.ph';  # Times-BoldItalic
+require 'metrics/pcrr8a.ph';   # Courier
+require 'metrics/pcrb8a.ph';   # Courier-Bold
+require 'metrics/phvr8a.ph';   # Helvetica
+require 'metrics/phvro8a.ph';  # Helvetica-Oblique
+require 'metrics/phvb8a.ph';   # Helvetica-Bold
+require 'metrics/phvbo8a.ph';  # Helvetica-BoldOblique
+
+# The fonts we want to use for various things
+# The order is: <normal> <emphatic> <code>
+
+if ( 1 ) {
+    # Times family fonts
+
+    %TitlFont = (name => 'tfont',
+                leading => 22,
+            fonts => [[20,\%PS_Times_Bold],
+                      [20,\%PS_Times_BoldItalic],
+                      [20,\%PS_Courier_Bold]]);
+    %ChapFont = (name => 'cfont',
+                leading => 19.2,
+                fonts => [[18,\%PS_Times_Bold],
+                          [18,\%PS_Times_BoldItalic],
+                          [18,\%PS_Courier_Bold]]);
+    %HeadFont = (name => 'hfont',
+                leading => 15.4,
+                fonts => [[14,\%PS_Times_Bold],
+                          [14,\%PS_Times_BoldItalic],
+                          [14,\%PS_Courier_Bold]]);
+    %SubhFont = (name => 'sfont',
+                leading => 13.2,
+                fonts => [[12,\%PS_Times_Bold],
+                          [12,\%PS_Times_BoldItalic],
+                          [12,\%PS_Courier_Bold]]);
+    %BodyFont = (name => 'bfont',
+                leading => 11,
+                fonts => [[10,\%PS_Times_Roman],
+                          [10,\%PS_Times_Italic],
+                          [10,\%PS_Courier]]);
+} elsif ( 0 ) {
+    # Helvetica family fonts
+
+    %TitlFont = (name => 'tfont',
+                leading => 22,
+                fonts => [[20,\%PS_Helvetica_Bold],
+                          [20,\%PS_Helvetica_BoldOblique],
+                          [20,\%PS_Courier_Bold]]);
+    %ChapFont = (name => 'cfont',
+                leading => 19.2,
+                fonts => [[18,\%PS_Helvetica_Bold],
+                          [18,\%PS_Helvetica_BoldOblique],
+                          [18,\%PS_Courier_Bold]]);
+    %HeadFont = (name => 'hfont',
+                leading => 15.4,
+                fonts => [[14,\%PS_Helvetica_Bold],
+                          [14,\%PS_Helvetica_BoldOblique],
+                          [14,\%PS_Courier_Bold]]);
+    %SubhFont = (name => 'sfont',
+                leading => 13.2,
+                fonts => [[12,\%PS_Helvetica_Bold],
+                          [12,\%PS_Helvetica_BoldOblique],
+                          [12,\%PS_Courier_Bold]]);
+    %BodyFont = (name => 'bfont',
+                leading => 11,
+                fonts => [[10,\%PS_Helvetica],
+                          [10,\%PS_Helvetica_Oblique],
+                          [10,\%PS_Courier]]);
+} else {
+    # Body text Times; headings Helvetica
+    %TitlFont = (name => 'tfont',
+                leading => 22,
+                fonts => [[20,\%PS_Helvetica_Bold],
+                          [20,\%PS_Helvetica_BoldOblique],
+                          [20,\%PS_Courier_Bold]]);
+    %ChapFont = (name => 'cfont',
+                leading => 19.2,
+                fonts => [[18,\%PS_Helvetica_Bold],
+                          [18,\%PS_Helvetica_BoldOblique],
+                          [18,\%PS_Courier_Bold]]);
+    %HeadFont = (name => 'hfont',
+                leading => 15.4,
+                fonts => [[14,\%PS_Helvetica_Bold],
+                          [14,\%PS_Helvetica_BoldOblique],
+                          [14,\%PS_Courier_Bold]]);
+    %SubhFont = (name => 'sfont',
+                leading => 13.2,
+                fonts => [[12,\%PS_Helvetica_Bold],
+                          [12,\%PS_Helvetica_BoldOblique],
+                          [12,\%PS_Courier_Bold]]);
+    %BodyFont = (name => 'bfont',
+                leading => 11,
+                fonts => [[10,\%PS_Times_Roman],
+                          [10,\%PS_Times_Italic],
+                          [10,\%PS_Courier]]);
+}
+
+#
+# List of all fontsets; used to compute the list of fonts needed
+#
+@AllFonts = ( \%TitlFont, \%ChapFont, \%HeadFont, \%SubhFont, \%BodyFont );
+
+# OK
+1;
diff --git a/doc/pswidth.ph b/doc/pswidth.ph
new file mode 100644 (file)
index 0000000..36fc07a
--- /dev/null
@@ -0,0 +1,26 @@
+#!/usr/bin/perl
+#
+# Get the width of a PostScript string in font units
+# (1000 font units == the font point height) given a set of
+# font metrics and an encoding vector.
+#
+sub ps_width($$$) {
+    my($str, $met, $encoding) = @_;
+    my($w) = 0;
+    my($i,$c,$p);
+
+    $l = length($str);
+    undef $p;
+    for ( $i = 0 ; $i < $l ; $i++ ) {
+       $c = substr($str,$i,1);
+       $w += $$met{widths}{$encoding->[ord($c)]};
+       # The standard PostScript "show" operator doesn't do kerning.
+       # $w += $$met{kern}{$p.$c};
+       $p = $c;
+    }
+    
+    return $w;
+}
+
+# OK
+1;
diff --git a/doc/rdsrc.pl b/doc/rdsrc.pl
new file mode 100644 (file)
index 0000000..de3a862
--- /dev/null
@@ -0,0 +1,1509 @@
+#!/usr/bin/perl
+## --------------------------------------------------------------------------
+##   
+##   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.
+##
+## --------------------------------------------------------------------------
+
+
+# Read the source-form of the NASM manual and generate the various
+# output forms.
+
+# TODO:
+#
+# Ellipsis support would be nice.
+
+# Source-form features:
+# ---------------------
+#
+# Bullet \b
+#   Bullets the paragraph. Rest of paragraph is indented to cope. In
+#   HTML, consecutive groups of bulleted paragraphs become unordered
+#   lists.
+#
+# Emphasis \e{foobar}
+#   produces `_foobar_' in text and italics in HTML, PS, RTF
+#
+# Inline code \c{foobar}
+#   produces ``foobar'' in text, and fixed-pitch font in HTML, PS, RTF
+#
+# Display code
+# \c  line one
+# \c   line two
+#   produces fixed-pitch font where appropriate, and doesn't break
+#   pages except sufficiently far into the middle of a display.
+#
+# Chapter, header and subheader
+# \C{intro} Introduction
+# \H{whatsnasm} What is NASM?
+# \S{free} NASM Is Free
+#   dealt with as appropriate. Chapters begin on new sides, possibly
+#   even new _pages_. (Sub)?headers are good places to begin new
+#   pages. Just _after_ a (sub)?header isn't.
+#   The keywords can be substituted with \K and \k.
+#
+# Keyword \K{cintro} \k{cintro}
+#   Expands to `Chapter 1', `Section 1.1', `Section 1.1.1'. \K has an
+#   initial capital whereas \k doesn't. In HTML, will produce
+#   hyperlinks.
+#
+# Web link \W{http://foobar/}{text} or \W{mailto:me@here}\c{me@here}
+#   the \W prefix is ignored except in HTML; in HTML the last part
+#   becomes a hyperlink to the first part.
+#
+# Literals \{ \} \\
+#   In case it's necessary, they expand to the real versions.
+#
+# Nonbreaking hyphen \-
+#   Need more be said?
+#
+# Source comment \#
+#   Causes everything after it on the line to be ignored by the
+#   source-form processor.
+#
+# Indexable word \i{foobar} (or \i\e{foobar} or \i\c{foobar}, equally)
+#   makes word appear in index, referenced to that point
+#   \i\c comes up in code style even in the index; \i\e doesn't come
+#   up in emphasised style.
+#
+# Indexable non-displayed word \I{foobar} or \I\c{foobar}
+#   just as \i{foobar} except that nothing is displayed for it
+#
+# Index rewrite
+# \IR{foobar} \c{foobar} operator, uses of
+#   tidies up the appearance in the index of something the \i or \I
+#   operator was applied to
+#
+# Index alias
+# \IA{foobar}{bazquux}
+#   aliases one index tag (as might be supplied to \i or \I) to
+#   another, so that \I{foobar} has the effect of \I{bazquux}, and
+#   \i{foobar} has the effect of \I{bazquux}foobar
+#
+# Metadata
+# \M{key}{something}
+#   defines document metadata, such as authorship, title and copyright;
+#   different output formats use this differently.
+#
+# Include subfile
+# \&{filename}
+#  Includes filename. Recursion is allowed.
+#
+use IO::File;
+
+$diag = 1, shift @ARGV if $ARGV[0] eq "-d";
+
+($out_format) = @ARGV;
+
+$| = 1;
+
+$tstruct_previtem = $node = "Top";
+$nodes = ($node);
+$tstruct_level{$tstruct_previtem} = 0;
+$tstruct_last[$tstruct_level{$tstruct_previtem}] = $tstruct_previtem;
+$MAXLEVEL = 10;  # really 3, but play safe ;-)
+
+# Read the file; pass a paragraph at a time to the paragraph processor.
+print "Reading input...";
+$pname = "para000000";
+@pnames = @pflags = ();
+$para = undef;
+while (defined($_ = <STDIN>)) {
+  $_ = &untabify($_);
+  &check_include($_);
+}
+&got_para($para);
+print "done.\n";
+
+# Now we've read in the entire document and we know what all the
+# heading keywords refer to. Go through and fix up the \k references.
+print "Fixing up cross-references...";
+&fixup_xrefs;
+print "done.\n";
+
+# Sort the index tags, according to the slightly odd order I've decided on.
+print "Sorting index tags...";
+&indexsort;
+print "done.\n";
+
+if ($diag) {
+  print "Writing index-diagnostic file...";
+  &indexdiag;
+  print "done.\n";
+}
+
+# OK. Write out the various output files.
+if ($out_format eq 'txt') {
+    print "Producing text output: ";
+    &write_txt;
+    print "done.\n";
+} elsif ($out_format eq 'html') {
+    print "Producing HTML output: ";
+    &write_html;
+    print "done.\n";
+} elsif ($out_format eq 'texi') {
+    print "Producing Texinfo output: ";
+    &write_texi;
+    print "done.\n";
+} elsif ($out_format eq 'hlp') {
+    print "Producing WinHelp output: ";
+    &write_hlp;
+    print "done.\n";
+} elsif ($out_format eq 'dip') {
+    print "Producing Documentation Intermediate Paragraphs: ";
+    &write_dip;
+    print "done.\n";
+} else {
+    die "$0: unknown output format: $out_format\n";
+}
+
+sub untabify($) {
+  my($s) = @_;
+  my $o = '';
+  my($c, $i, $p);
+
+  $p = 0;
+  for ($i = 0; $i < length($s); $i++) {
+    $c = substr($s, $i, 1);
+    if ($c eq "\t") {
+      do {
+       $o .= ' ';
+       $p++;
+      } while ($p & 7);
+    } else {
+      $o .= $c;
+      $p++;
+    }
+  }
+  return $o;
+}
+sub check_include {
+  local $_ = shift;
+  if (/\\& (\S+)/) {
+     &include($1);
+  } else {
+     &get_para($_);
+  }
+}
+sub get_para($_) {
+  chomp;
+  if (!/\S/ || /^\\(IA|IR|M)/) { # special case: \IA \IR \M imply new-paragraph
+    &got_para($para);
+    $para = undef;
+  }
+  if (/\S/) {
+    s/\\#.*$//; # strip comments
+    $para .= " " . $_;
+  }
+}
+sub include {
+  my $name = shift;
+  my $F = IO::File->new($name)
+     or die "Cannot open $name: $!";
+  while (<$F>) {
+     &check_include($_);
+  }
+}
+sub got_para {
+  local ($_) = @_;
+  my $pflags = "", $i, $w, $l, $t;
+  return if !/\S/;
+
+  @$pname = ();
+
+  # Strip off _leading_ spaces, then determine type of paragraph.
+  s/^\s*//;
+  $irewrite = undef;
+  if (/^\\c[^{]/) {
+    # A code paragraph. The paragraph-array will contain the simple
+    # strings which form each line of the paragraph.
+    $pflags = "code";
+    while (/^\\c (([^\\]|\\[^c])*)(.*)$/) {
+      $l = $1;
+      $_ = $3;
+      $l =~ s/\\{/{/g;
+      $l =~ s/\\}/}/g;
+      $l =~ s/\\\\/\\/g;
+      push @$pname, $l;
+    }
+    $_ = ''; # suppress word-by-word code
+  } elsif (/^\\C/) {
+    # A chapter heading. Define the keyword and allocate a chapter
+    # number.
+    $cnum++;
+    $hnum = 0;
+    $snum = 0;
+    $xref = "chapter-$cnum";
+    $pflags = "chap $cnum :$xref";
+    die "badly formatted chapter heading: $_\n" if !/^\\C{([^}]*)}\s*(.*)$/;
+    $refs{$1} = "chapter $cnum";
+    $node = "Chapter $cnum";
+    &add_item($node, 1);
+    $xrefnodes{$node} = $xref; $nodexrefs{$xref} = $node;
+    $xrefs{$1} = $xref;
+    $_ = $2;
+    # the standard word-by-word code will happen next
+  } elsif (/^\\A/) {
+    # An appendix heading. Define the keyword and allocate an appendix
+    # letter.
+    $cnum++;
+    $cnum = 'A' if $cnum =~ /[0-9]+/;
+    $hnum = 0;
+    $snum = 0;
+    $xref = "appendix-$cnum";
+    $pflags = "appn $cnum :$xref";
+    die "badly formatted appendix heading: $_\n" if !/^\\A{([^}]*)}\s*(.*)$/;
+    $refs{$1} = "appendix $cnum";
+    $node = "Appendix $cnum";
+    &add_item($node, 1);
+    $xrefnodes{$node} = $xref; $nodexrefs{$xref} = $node;
+    $xrefs{$1} = $xref;
+    $_ = $2;
+    # the standard word-by-word code will happen next
+  } elsif (/^\\H/) {
+    # A major heading. Define the keyword and allocate a section number.
+    $hnum++;
+    $snum = 0;
+    $xref = "section-$cnum.$hnum";
+    $pflags = "head $cnum.$hnum :$xref";
+    die "badly formatted heading: $_\n" if !/^\\[HP]{([^}]*)}\s*(.*)$/;
+    $refs{$1} = "section $cnum.$hnum";
+    $node = "Section $cnum.$hnum";
+    &add_item($node, 2);
+    $xrefnodes{$node} = $xref; $nodexrefs{$xref} = $node;
+    $xrefs{$1} = $xref;
+    $_ = $2;
+    # the standard word-by-word code will happen next
+  } elsif (/^\\S/) {
+    # A sub-heading. Define the keyword and allocate a section number.
+    $snum++;
+    $xref = "section-$cnum.$hnum.$snum";
+    $pflags = "subh $cnum.$hnum.$snum :$xref";
+    die "badly formatted subheading: $_\n" if !/^\\S{([^}]*)}\s*(.*)$/;
+    $refs{$1} = "section $cnum.$hnum.$snum";
+    $node = "Section $cnum.$hnum.$snum";
+    &add_item($node, 3);
+    $xrefnodes{$node} = $xref; $nodexrefs{$xref} = $node;
+    $xrefs{$1} = $xref;
+    $_ = $2;
+    # the standard word-by-word code will happen next
+  } elsif (/^\\IR/) {
+    # An index-rewrite.
+    die "badly formatted index rewrite: $_\n" if !/^\\IR{([^}]*)}\s*(.*)$/;
+    $irewrite = $1;
+    $_ = $2;
+    # the standard word-by-word code will happen next
+  } elsif (/^\\IA/) {
+    # An index-alias.
+    die "badly formatted index alias: $_\n" if !/^\\IA{([^}]*)}{([^}]*)}\s*$/;
+    $idxalias{$1} = $2;
+    return; # avoid word-by-word code
+  } elsif (/^\\M/) {
+    # Metadata
+    die "badly formed metadata: $_\n" if !/^\\M{([^}]*)}{([^}]*)}\s*$/;
+    $metadata{$1} = $2;
+    return; # avoid word-by-word code
+  } elsif (/^\\b/) {
+    # A bulleted paragraph. Strip off the initial \b and let the
+    # word-by-word code take care of the rest.
+    $pflags = "bull";
+    s/^\\b\s*//;
+  } else {
+    # A normal paragraph. Just set $pflags: the word-by-word code does
+    # the rest.
+    $pflags = "norm";
+  }
+
+  # The word-by-word code: unless @$pname is already defined (which it
+  # will be in the case of a code paragraph), split the paragraph up
+  # into words and push each on @$pname.
+  #
+  # Each thing pushed on @$pname should have a two-character type
+  # code followed by the text.
+  #
+  # Type codes are:
+  # "n " for normal
+  # "da" for a dash
+  # "es" for first emphasised word in emphasised bit
+  # "e " for emphasised in mid-emphasised-bit
+  # "ee" for last emphasised word in emphasised bit
+  # "eo" for single (only) emphasised word
+  # "c " for code
+  # "k " for cross-ref
+  # "kK" for capitalised cross-ref
+  # "w " for Web link
+  # "wc" for code-type Web link
+  # "x " for beginning of resolved cross-ref; generates no visible output,
+  #      and the text is the cross-reference code
+  # "xe" for end of resolved cross-ref; text is same as for "x ".
+  # "i " for point to be indexed: the text is the internal index into the
+  #      index-items arrays
+  # "sp" for space
+  while (/\S/) {
+    s/^\s*//, push @$pname, "sp" if /^\s/;
+    $indexing = $qindex = 0;
+    if (/^(\\[iI])?\\c/) {
+      $qindex = 1 if $1 eq "\\I";
+      $indexing = 1, s/^\\[iI]// if $1;
+      s/^\\c//;
+      die "badly formatted \\c: \\c$_\n" if !/{(([^\\}]|\\.)*)}(.*)$/;
+      $w = $1;
+      $_ = $3;
+      $w =~ s/\\{/{/g;
+      $w =~ s/\\}/}/g;
+      $w =~ s/\\-/-/g;
+      $w =~ s/\\\\/\\/g;
+      (push @$pname,"i"),$lastp = $#$pname if $indexing;
+      push @$pname,"c $w" if !$qindex;
+      $$pname[$lastp] = &addidx($node, $w, "c $w") if $indexing;
+    } elsif (/^\\[iIe]/) {
+      /^(\\[iI])?(\\e)?/;
+      $emph = 0;
+      $qindex = 1 if $1 eq "\\I";
+      $indexing = 1, $type = "\\i" if $1;
+      $emph = 1, $type = "\\e" if $2;
+      s/^(\\[iI])?(\\e?)//;
+      die "badly formatted $type: $type$_\n" if !/{(([^\\}]|\\.)*)}(.*)$/;
+      $w = $1;
+      $_ = $3;
+      $w =~ s/\\{/{/g;
+      $w =~ s/\\}/}/g;
+      $w =~ s/\\-/-/g;
+      $w =~ s/\\\\/\\/g;
+      $t = $emph ? "es" : "n ";
+      @ientry = ();
+      (push @$pname,"i"),$lastp = $#$pname if $indexing;
+      foreach $i (split /\s+/,$w) {  # \e and \i can be multiple words
+        push @$pname,"$t$i","sp" if !$qindex;
+       ($ii=$i) =~ tr/A-Z/a-z/, push @ientry,"n $ii","sp" if $indexing;
+       $t = $emph ? "e " : "n ";
+      }
+      $w =~ tr/A-Z/a-z/, pop @ientry if $indexing;
+      $$pname[$lastp] = &addidx($node, $w, @ientry) if $indexing;
+      pop @$pname if !$qindex; # remove final space
+      if (substr($$pname[$#$pname],0,2) eq "es" && !$qindex) {
+        substr($$pname[$#$pname],0,2) = "eo";
+      } elsif ($emph && !$qindex) {
+        substr($$pname[$#$pname],0,2) = "ee";
+      }
+    } elsif (/^\\[kK]/) {
+      $t = "k ";
+      $t = "kK" if /^\\K/;
+      s/^\\[kK]//;
+      die "badly formatted \\k: \\c$_\n" if !/{([^}]*)}(.*)$/;
+      $_ = $2;
+      push @$pname,"$t$1";
+    } elsif (/^\\W/) {
+      s/^\\W//;
+      die "badly formatted \\W: \\W$_\n"
+          if !/{([^}]*)}(\\i)?(\\c)?{(([^\\}]|\\.)*)}(.*)$/;
+      $l = $1;
+      $w = $4;
+      $_ = $6;
+      $t = "w ";
+      $t = "wc" if $3 eq "\\c";
+      $indexing = 1 if $2;
+      $w =~ s/\\{/{/g;
+      $w =~ s/\\}/}/g;
+      $w =~ s/\\-/-/g;
+      $w =~ s/\\\\/\\/g;
+      (push @$pname,"i"),$lastp = $#$pname if $indexing;
+      push @$pname,"$t<$l>$w";
+      $$pname[$lastp] = &addidx($node, $w, "c $w") if $indexing;
+    } else {
+      die "what the hell? $_\n" if !/^(([^\s\\\-]|\\[\\{}\-])*-?)(.*)$/;
+      die "painful death! $_\n" if !length $1;
+      $w = $1;
+      $_ = $3;
+      $w =~ s/\\{/{/g;
+      $w =~ s/\\}/}/g;
+      $w =~ s/\\-/-/g;
+      $w =~ s/\\\\/\\/g;
+      if ($w eq "-") {
+        push @$pname,"da";
+      } else {
+        push @$pname,"n $w";
+      }
+    }
+  }
+  if ($irewrite ne undef) {
+    &addidx(undef, $irewrite, @$pname);
+    @$pname = ();
+  } else {
+    push @pnames, $pname;
+    push @pflags, $pflags;
+    $pname++;
+  }
+}
+
+sub addidx {
+  my ($node, $text, @ientry) = @_;
+  $text = $idxalias{$text} || $text;
+  if ($node eq undef || !$idxmap{$text}) {
+    @$ientry = @ientry;
+    $idxmap{$text} = $ientry;
+    $ientry++;
+  }
+  if ($node) {
+    $idxnodes{$node,$text} = 1;
+    return "i $text";
+  }
+}
+
+sub indexsort {
+  my $iitem, $ientry, $i, $piitem, $pcval, $cval, $clrcval;
+
+  @itags = map { # get back the original data as the 1st elt of each list
+             $_->[0]
+          } sort { # compare auxiliary (non-first) elements of lists
+            $a->[1] cmp $b->[1] ||
+            $a->[2] cmp $b->[2] ||
+            $a->[0] cmp $b->[0]
+           } map { # transform array into list of 3-element lists
+            my $ientry = $idxmap{$_};
+            my $a = substr($$ientry[0],2);
+            $a =~ tr/A-Za-z0-9//cd;
+            [$_, uc($a), substr($$ientry[0],0,2)]
+          } keys %idxmap;
+
+  # Having done that, check for comma-hood.
+  $cval = 0;
+  foreach $iitem (@itags) {
+    $ientry = $idxmap{$iitem};
+    $clrcval = 1;
+    $pcval = $cval;
+    FL:for ($i=0; $i <= $#$ientry; $i++) {
+      if ($$ientry[$i] =~ /^(n .*,)(.*)/) {
+        $$ientry[$i] = $1;
+       splice @$ientry,$i+1,0,"n $2" if length $2;
+       $commapos{$iitem} = $i+1;
+       $cval = join("\002", @$ientry[0..$i]);
+       $clrcval = 0;
+       last FL;
+      }
+    }
+    $cval = undef if $clrcval;
+    $commanext{$iitem} = $commaafter{$piitem} = 1
+      if $cval and ($cval eq $pcval);
+    $piitem = $iitem;
+  }
+}
+
+sub indexdiag {
+  my $iitem,$ientry,$w,$ww,$foo,$node;
+  open INDEXDIAG,">index.diag";
+  foreach $iitem (@itags) {
+    $ientry = $idxmap{$iitem};
+    print INDEXDIAG "<$iitem> ";
+    foreach $w (@$ientry) {
+      $ww = &word_txt($w);
+      print INDEXDIAG $ww unless $ww eq "\001";
+    }
+    print INDEXDIAG ":";
+    $foo = " ";
+    foreach $node (@nodes) {
+      (print INDEXDIAG $foo,$node), $foo = ", " if $idxnodes{$node,$iitem};
+    }
+    print INDEXDIAG "\n";
+  }
+  close INDEXDIAG;
+}
+
+sub fixup_xrefs {
+  my $pname, $p, $i, $j, $k, $caps, @repl;
+
+  for ($p=0; $p<=$#pnames; $p++) {
+    next if $pflags[$p] eq "code";
+    $pname = $pnames[$p];
+    for ($i=$#$pname; $i >= 0; $i--) {
+      if ($$pname[$i] =~ /^k/) {
+        $k = $$pname[$i];
+        $caps = ($k =~ /^kK/);
+       $k = substr($k,2);
+        $repl = $refs{$k};
+       die "undefined keyword `$k'\n" unless $repl;
+       substr($repl,0,1) =~ tr/a-z/A-Z/ if $caps;
+       @repl = ();
+       push @repl,"x $xrefs{$k}";
+       foreach $j (split /\s+/,$repl) {
+         push @repl,"n $j";
+         push @repl,"sp";
+       }
+       pop @repl; # remove final space
+       push @repl,"xe$xrefs{$k}";
+       splice @$pname,$i,1,@repl;
+      }
+    }
+  }
+}
+
+sub write_txt {
+  # This is called from the top level, so I won't bother using
+  # my or local.
+
+  # Open file.
+  print "writing file...";
+  open TEXT,">nasmdoc.txt";
+  select TEXT;
+
+  # Preamble.
+  $title = "The Netwide Assembler: NASM";
+  $spaces = ' ' x ((75-(length $title))/2);
+  ($underscore = $title) =~ s/./=/g;
+  print "$spaces$title\n$spaces$underscore\n";
+
+  for ($para = 0; $para <= $#pnames; $para++) {
+    $pname = $pnames[$para];
+    $pflags = $pflags[$para];
+    $ptype = substr($pflags,0,4);
+
+    print "\n"; # always one of these before a new paragraph
+
+    if ($ptype eq "chap") {
+      # Chapter heading. "Chapter N: Title" followed by a line of
+      # minus signs.
+      $pflags =~ /chap (.*) :(.*)/;
+      $title = "Chapter $1: ";
+      foreach $i (@$pname) {
+        $ww = &word_txt($i);
+        $title .= $ww unless $ww eq "\001";
+      }
+      print "$title\n";
+      $title =~ s/./-/g;
+      print "$title\n";
+    } elsif ($ptype eq "appn") {
+      # Appendix heading. "Appendix N: Title" followed by a line of
+      # minus signs.
+      $pflags =~ /appn (.*) :(.*)/;
+      $title = "Appendix $1: ";
+      foreach $i (@$pname) {
+        $ww = &word_txt($i);
+        $title .= $ww unless $ww eq "\001";
+      }
+      print "$title\n";
+      $title =~ s/./-/g;
+      print "$title\n";
+    } elsif ($ptype eq "head" || $ptype eq "subh") {
+      # Heading or subheading. Just a number and some text.
+      $pflags =~ /.... (.*) :(.*)/;
+      $title = sprintf "%6s ", $1;
+      foreach $i (@$pname) {
+        $ww = &word_txt($i);
+        $title .= $ww unless $ww eq "\001";
+      }
+      print "$title\n";
+    } elsif ($ptype eq "code") {
+      # Code paragraph. Emit each line with a seven character indent.
+      foreach $i (@$pname) {
+        warn "code line longer than 68 chars: $i\n" if length $i > 68;
+        print ' 'x7, $i, "\n";
+      }
+    } elsif ($ptype eq "bull" || $ptype eq "norm") {
+      # Ordinary paragraph, optionally bulleted. We wrap, with ragged
+      # 75-char right margin and either 7 or 11 char left margin
+      # depending on bullets.
+      if ($ptype eq "bull") {
+        $line = ' 'x7 . '(*) ';
+       $next = ' 'x11;
+      } else {
+        $line = $next = ' 'x7;
+      }
+      @a = @$pname;
+      $wd = $wprev = '';
+      do {
+        do { $w = &word_txt(shift @a) } while $w eq "\001"; # nasty hack
+       $wd .= $wprev;
+       if ($wprev =~ /-$/ || $w eq ' ' || $w eq '' || $w eq undef) {
+         if (length ($line . $wd) > 75) {
+           $line =~ s/\s*$//; # trim trailing spaces
+           print "$line\n";
+           $line = $next;
+           $wd =~ s/^\s*//; # trim leading spaces
+         }
+         $line .= $wd;
+         $wd = '';
+       }
+       $wprev = $w;
+      } while ($w ne '' && $w ne undef);
+      if ($line =~ /\S/) {
+       $line =~ s/\s*$//; # trim trailing spaces
+       print "$line\n";
+      }
+    }
+  }
+
+  # Close file.
+  select STDOUT;
+  close TEXT;
+}
+
+sub word_txt {
+  my ($w) = @_;
+  my $wtype, $wmajt;
+
+  return undef if $w eq '' || $w eq undef;
+  $wtype = substr($w,0,2);
+  $wmajt = substr($wtype,0,1);
+  $w = substr($w,2);
+  $w =~ s/<.*>// if $wmajt eq "w"; # remove web links
+  if ($wmajt eq "n" || $wtype eq "e " || $wtype eq "w ") {
+    return $w;
+  } elsif ($wtype eq "sp") {
+    return ' ';
+  } elsif ($wtype eq "da") {
+    return '-';
+  } elsif ($wmajt eq "c" || $wtype eq "wc") {
+    return "`${w}'";
+  } elsif ($wtype eq "es") {
+    return "_${w}";
+  } elsif ($wtype eq "ee") {
+    return "${w}_";
+  } elsif ($wtype eq "eo") {
+    return "_${w}_";
+  } elsif ($wmajt eq "x" || $wmajt eq "i") {
+    return "\001";
+  } else {
+    die "panic in word_txt: $wtype$w\n";
+  }
+}
+
+sub write_html {
+  # This is called from the top level, so I won't bother using
+  # my or local.
+
+  # Write contents file. Just the preamble, then a menu of links to the
+  # separate chapter files and the nodes therein.
+  print "writing contents file...";
+  open TEXT,">nasmdoc0.html";
+  select TEXT;
+  &html_preamble(0);
+  print "<p>This manual documents NASM, the Netwide Assembler: an assembler\n";
+  print "targetting the Intel x86 series of processors, with portable source.\n";
+  print "<p>";
+  for ($node = $tstruct_next{'Top'}; $node; $node = $tstruct_next{$node}) {
+    if ($tstruct_level{$node} == 1) {
+      # Invent a file name.
+      ($number = lc($xrefnodes{$node})) =~ s/.*-//;
+      $fname="nasmdocx.html";
+      substr($fname,8 - length $number, length $number) = $number;
+      $html_fnames{$node} = $fname;
+      $link = $fname;
+      print "<p>";
+    } else {
+      # Use the preceding filename plus a marker point.
+      $link = $fname . "#$xrefnodes{$node}";
+    }
+    $title = "$node: ";
+    $pname = $tstruct_pname{$node};
+    foreach $i (@$pname) {
+      $ww = &word_html($i);
+      $title .= $ww unless $ww eq "\001";
+    }
+    print "<a href=\"$link\">$title</a><br>\n";
+  }
+  print "<p><a href=\"nasmdoci.html\">Index</a>\n";
+  print "</body></html>\n";
+  select STDOUT;
+  close TEXT;
+
+  # Open a null file, to ensure output (eg random &html_jumppoints calls)
+  # goes _somewhere_.
+  print "writing chapter files...";
+  open TEXT,">/dev/null";
+  select TEXT;
+  $html_lastf = '';
+
+  $in_list = 0;
+
+  for ($para = 0; $para <= $#pnames; $para++) {
+    $pname = $pnames[$para];
+    $pflags = $pflags[$para];
+    $ptype = substr($pflags,0,4);
+
+    $in_list = 0, print "</ul>\n" if $in_list && $ptype ne "bull";
+    if ($ptype eq "chap") {
+      # Chapter heading. Begin a new file.
+      $pflags =~ /chap (.*) :(.*)/;
+      $title = "Chapter $1: ";
+      $xref = $2;
+      &html_jumppoints; print "</body></html>\n"; select STDOUT; close TEXT;
+      $html_lastf = $html_fnames{$chapternode};
+      $chapternode = $nodexrefs{$xref};
+      $html_nextf = $html_fnames{$tstruct_mnext{$chapternode}};
+      open TEXT,">$html_fnames{$chapternode}"; select TEXT; &html_preamble(1);
+      foreach $i (@$pname) {
+        $ww = &word_html($i);
+        $title .= $ww unless $ww eq "\001";
+      }
+      $h = "<h2><a name=\"$xref\">$title</a></h2>\n";
+      print $h; print FULL $h;
+    } elsif ($ptype eq "appn") {
+      # Appendix heading. Begin a new file.
+      $pflags =~ /appn (.*) :(.*)/;
+      $title = "Appendix $1: ";
+      $xref = $2;
+      &html_jumppoints; print "</body></html>\n"; select STDOUT; close TEXT;
+      $html_lastf = $html_fnames{$chapternode};
+      $chapternode = $nodexrefs{$xref};
+      $html_nextf = $html_fnames{$tstruct_mnext{$chapternode}};
+      open TEXT,">$html_fnames{$chapternode}"; select TEXT; &html_preamble(1);
+      foreach $i (@$pname) {
+        $ww = &word_html($i);
+        $title .= $ww unless $ww eq "\001";
+      }
+      print "<h2><a name=\"$xref\">$title</a></h2>\n";
+    } elsif ($ptype eq "head" || $ptype eq "subh") {
+      # Heading or subheading.
+      $pflags =~ /.... (.*) :(.*)/;
+      $hdr = ($ptype eq "subh" ? "h4" : "h3");
+      $title = $1 . " ";
+      $xref = $2;
+      foreach $i (@$pname) {
+        $ww = &word_html($i);
+        $title .= $ww unless $ww eq "\001";
+      }
+      print "<$hdr><a name=\"$xref\">$title</a></$hdr>\n";
+    } elsif ($ptype eq "code") {
+      # Code paragraph.
+      print "<p><pre>\n";
+      foreach $i (@$pname) {
+       $w = $i;
+       $w =~ s/&/&amp;/g;
+       $w =~ s/</&lt;/g;
+       $w =~ s/>/&gt;/g;
+        print $w, "\n";
+      }
+      print "</pre>\n";
+    } elsif ($ptype eq "bull" || $ptype eq "norm") {
+      # Ordinary paragraph, optionally bulleted. We wrap, with ragged
+      # 75-char right margin and either 7 or 11 char left margin
+      # depending on bullets.
+      if ($ptype eq "bull") {
+        $in_list = 1, print "<ul>\n" unless $in_list;
+        $line = '<li>';
+      } else {
+        $line = '<p>';
+      }
+      @a = @$pname;
+      $wd = $wprev = '';
+      do {
+        do { $w = &word_html(shift @a) } while $w eq "\001"; # nasty hack
+       $wd .= $wprev;
+       if ($w eq ' ' || $w eq '' || $w eq undef) {
+         if (length ($line . $wd) > 75) {
+           $line =~ s/\s*$//; # trim trailing spaces
+           print "$line\n";
+           $line = '';
+           $wd =~ s/^\s*//; # trim leading spaces
+         }
+         $line .= $wd;
+         $wd = '';
+       }
+       $wprev = $w;
+      } while ($w ne '' && $w ne undef);
+      if ($line =~ /\S/) {
+       $line =~ s/\s*$//; # trim trailing spaces
+       print "$line\n";
+      }
+    }
+  }
+
+  # Close whichever file was open.
+  &html_jumppoints;
+  print "</body></html>\n";
+  select STDOUT;
+  close TEXT;
+
+  print "\n   writing index file...";
+  open TEXT,">nasmdoci.html";
+  select TEXT;
+  &html_preamble(0);
+  print "<p align=center><a href=\"nasmdoc0.html\">Contents</a>\n";
+  print "<p>";
+  &html_index;
+  print "<p align=center><a href=\"nasmdoc0.html\">Contents</a>\n";
+  print "</body></html>\n";
+  select STDOUT;
+  close TEXT;
+}
+
+sub html_preamble {
+  print "<html><head><title>NASM Manual</title></head>\n";
+  print "<body><h1 align=center>The Netwide Assembler: NASM</h1>\n\n";
+  &html_jumppoints if $_[0];
+}
+
+sub html_jumppoints {
+  print "<p align=center>";
+  print "<a href=\"$html_nextf\">Next Chapter</a> |\n" if $html_nextf;
+  print "<a href=\"$html_lastf\">Previous Chapter</a> |\n" if $html_lastf;
+  print "<a href=\"nasmdoc0.html\">Contents</a> |\n";
+  print "<a href=\"nasmdoci.html\">Index</a>\n";
+}
+
+sub html_index {
+  my $itag, $a, @ientry, $sep, $w, $wd, $wprev, $line;
+
+  $chapternode = '';
+  foreach $itag (@itags) {
+    $ientry = $idxmap{$itag};
+    @a = @$ientry;
+    push @a, "n :";
+    $sep = 0;
+    foreach $node (@nodes) {
+      next if !$idxnodes{$node,$itag};
+      push @a, "n ," if $sep;
+      push @a, "sp", "x $xrefnodes{$node}", "n $node", "xe$xrefnodes{$node}";
+      $sep = 1;
+    }
+    $line = '';
+    do {
+      do { $w = &word_html(shift @a) } while $w eq "\001"; # nasty hack
+      $wd .= $wprev;
+      if ($w eq ' ' || $w eq '' || $w eq undef) {
+        if (length ($line . $wd) > 75) {
+         $line =~ s/\s*$//; # trim trailing spaces
+         print "$line\n";
+         $line = '';
+         $wd =~ s/^\s*//; # trim leading spaces
+       }
+       $line .= $wd;
+       $wd = '';
+      }
+      $wprev = $w;
+    } while ($w ne '' && $w ne undef);
+    if ($line =~ /\S/) {
+      $line =~ s/\s*$//; # trim trailing spaces
+      print "$line\n";
+    }
+    print "<br>\n";
+  }
+}
+
+sub word_html {
+  my ($w) = @_;
+  my $wtype, $wmajt, $pfx, $sfx;
+
+  return undef if $w eq '' || $w eq undef;
+
+  $wtype = substr($w,0,2);
+  $wmajt = substr($wtype,0,1);
+  $w = substr($w,2);
+  $pfx = $sfx = '';
+  $pfx = "<a href=\"$1\">", $sfx = "</a>", $w = $2
+    if $wmajt eq "w" && $w =~ /^<(.*)>(.*)$/;
+  $w =~ s/&/&amp;/g;
+  $w =~ s/</&lt;/g;
+  $w =~ s/>/&gt;/g;
+  if ($wmajt eq "n" || $wtype eq "e " || $wtype eq "w ") {
+    return $pfx . $w . $sfx;
+  } elsif ($wtype eq "sp") {
+    return ' ';
+  } elsif ($wtype eq "da") {
+    return '-'; # sadly, en-dashes are non-standard in HTML
+  } elsif ($wmajt eq "c" || $wtype eq "wc") {
+    return $pfx . "<code><nobr>${w}</nobr></code>" . $sfx;
+  } elsif ($wtype eq "es") {
+    return "<em>${w}";
+  } elsif ($wtype eq "ee") {
+    return "${w}</em>";
+  } elsif ($wtype eq "eo") {
+    return "<em>${w}</em>";
+  } elsif ($wtype eq "x ") {
+    # Magic: we must resolve the cross reference into file and marker
+    # parts, then dispose of the file part if it's us, and dispose of
+    # the marker part if the cross reference describes the top node of
+    # another file.
+    my $node = $nodexrefs{$w}; # find the node we're aiming at
+    my $level = $tstruct_level{$node}; # and its level
+    my $up = $node, $uplev = $level-1;
+    $up = $tstruct_up{$up} while $uplev--; # get top node of containing file
+    my $file = ($up ne $chapternode) ? $html_fnames{$up} : "";
+    my $marker = ($level == 1 and $file) ? "" : "#$w";
+    return "<a href=\"$file$marker\">";
+  } elsif ($wtype eq "xe") {
+    return "</a>";
+  } elsif ($wmajt eq "i") {
+    return "\001";
+  } else {
+    die "panic in word_html: $wtype$w\n";
+  }
+}
+
+sub write_texi {
+  # This is called from the top level, so I won't bother using
+  # my or local.
+
+  # Open file.
+  print "writing file...";
+  open TEXT,">nasmdoc.texi";
+  select TEXT;
+
+  # Preamble.
+  print "\\input texinfo   \@c -*-texinfo-*-\n";
+  print "\@c \%**start of header\n";
+  print "\@setfilename ",$metadata{'infofile'},".info\n";
+  print "\@dircategory ",$metadata{'category'},"\n";
+  print "\@direntry\n";
+  printf "* %-28s %s.\n",
+  sprintf('%s: (%s).', $metadata{'infoname'}, $metadata{'infofile'}),
+  $metadata{'infotitle'};
+  print "\@end direntry\n";
+  print "\@settitle ", $metadata{'title'},"\n";
+  print "\@setchapternewpage odd\n";
+  print "\@c \%**end of header\n";
+  print "\n";
+  print "\@ifinfo\n";
+  print $metadata{'summary'}, "\n";
+  print "\n";
+  print "Copyright ",$metadata{'year'}," ",$metadata{'author'},"\n";
+  print "\n";
+  print $metadata{'license'}, "\n";
+  print "\@end ifinfo\n";
+  print "\n";
+  print "\@titlepage\n";
+  $title = $metadata{'title'};
+  $title =~ s/ - / --- /g;
+  print "\@title ${title}\n";
+  print "\@author ",$metadata{'author'},"\n";
+  print "\n";
+  print "\@page\n";
+  print "\@vskip 0pt plus 1filll\n";
+  print "Copyright \@copyright{} ",$metadata{'year'},' ',$metadata{'author'},"\n";
+  print "\n";
+  print $metadata{'license'}, "\n";
+  print "\@end titlepage\n";
+  print "\n";
+  print "\@node Top, $tstruct_next{'Top'}, (dir), (dir)\n";
+  print "\@top ",$metadata{'infotitle'},"\n";
+  print "\n";
+  print "\@ifinfo\n";
+  print $metadata{'summary'}, "\n";
+  print "\@end ifinfo\n";
+
+  $node = "Top";
+
+  $bulleting = 0;
+  for ($para = 0; $para <= $#pnames; $para++) {
+    $pname = $pnames[$para];
+    $pflags = $pflags[$para];
+    $ptype = substr($pflags,0,4);
+
+    $bulleting = 0, print "\@end itemize\n" if $bulleting && $ptype ne "bull";
+    print "\n"; # always one of these before a new paragraph
+
+    if ($ptype eq "chap") {
+      # Chapter heading. Begin a new node.
+      &texi_menu($node)
+        if $tstruct_level{$tstruct_next{$node}} > $tstruct_level{$node};
+      $pflags =~ /chap (.*) :(.*)/;
+      $node = "Chapter $1";
+      $title = "Chapter $1: ";
+      foreach $i (@$pname) {
+        $ww = &word_texi($i);
+        $title .= $ww unless $ww eq "\001";
+      }
+      print "\@node $node, $tstruct_next{$node}, $tstruct_prev{$node},";
+      print " $tstruct_up{$node}\n\@unnumbered $title\n";
+    } elsif ($ptype eq "appn") {
+      # Appendix heading. Begin a new node.
+      &texi_menu($node)
+        if $tstruct_level{$tstruct_next{$node}} > $tstruct_level{$node};
+      $pflags =~ /appn (.*) :(.*)/;
+      $node = "Appendix $1";
+      $title = "Appendix $1: ";
+      foreach $i (@$pname) {
+        $ww = &word_texi($i);
+        $title .= $ww unless $ww eq "\001";
+      }
+      print "\@node $node, $tstruct_next{$node}, $tstruct_prev{$node},";
+      print " $tstruct_up{$node}\n\@unnumbered $title\n";
+    } elsif ($ptype eq "head" || $ptype eq "subh") {
+      # Heading or subheading. Begin a new node.
+      &texi_menu($node)
+        if $tstruct_level{$tstruct_next{$node}} > $tstruct_level{$node};
+      $pflags =~ /.... (.*) :(.*)/;
+      $node = "Section $1";
+      $title = "$1. ";
+      foreach $i (@$pname) {
+        $ww = &word_texi($i);
+        $title .= $ww unless $ww eq "\001";
+      }
+      print "\@node $node, $tstruct_next{$node}, $tstruct_prev{$node},";
+      print " $tstruct_up{$node}\n";
+      $hdr = ($ptype eq "subh" ? "\@unnumberedsubsec" : "\@unnumberedsec");
+      print "$hdr $title\n";
+    } elsif ($ptype eq "code") {
+      # Code paragraph. Surround with @example / @end example.
+      print "\@example\n";
+      foreach $i (@$pname) {
+        warn "code line longer than 68 chars: $i\n" if length $i > 68;
+       $i =~ s/\@/\@\@/g;
+       $i =~ s/\{/\@\{/g;
+       $i =~ s/\}/\@\}/g;
+        print "$i\n";
+      }
+      print "\@end example\n";
+    } elsif ($ptype eq "bull" || $ptype eq "norm") {
+      # Ordinary paragraph, optionally bulleted. We wrap, FWIW.
+      if ($ptype eq "bull") {
+        $bulleting = 1, print "\@itemize \@bullet\n" if !$bulleting;
+       print "\@item\n";
+      }
+      $line = '';
+      @a = @$pname;
+      $wd = $wprev = '';
+      do {
+        do { $w = &word_texi(shift @a); } while $w eq "\001"; # hack
+       $wd .= $wprev;
+       if ($wprev =~ /-$/ || $w eq ' ' || $w eq '' || $w eq undef) {
+         if (length ($line . $wd) > 75) {
+           $line =~ s/\s*$//; # trim trailing spaces
+           print "$line\n";
+           $line = '';
+           $wd =~ s/^\s*//; # trim leading spaces
+         }
+         $line .= $wd;
+         $wd = '';
+       }
+       $wprev = $w;
+      } while ($w ne '' && $w ne undef);
+      if ($line =~ /\S/) {
+       $line =~ s/\s*$//; # trim trailing spaces
+       print "$line\n";
+      }
+    }
+  }
+
+  # Write index.
+  &texi_index;
+
+  # Close file.
+  print "\n\@contents\n\@bye\n";
+  select STDOUT;
+  close TEXT;
+}
+
+# Side effect of this procedure: update global `texiwdlen' to be the length
+# in chars of the formatted version of the word.
+sub word_texi {
+  my ($w) = @_;
+  my $wtype, $wmajt;
+
+  return undef if $w eq '' || $w eq undef;
+  $wtype = substr($w,0,2);
+  $wmajt = substr($wtype,0,1);
+  $w = substr($w,2);
+  $wlen = length $w;
+  $w =~ s/\@/\@\@/g;
+  $w =~ s/\{/\@\{/g;
+  $w =~ s/\}/\@\}/g;
+  $w =~ s/<.*>// if $wmajt eq "w"; # remove web links
+  substr($w,0,1) =~ tr/a-z/A-Z/, $capital = 0 if $capital;
+  if ($wmajt eq "n" || $wtype eq "e " || $wtype eq "w ") {
+    $texiwdlen = $wlen;
+    return $w;
+  } elsif ($wtype eq "sp") {
+    $texiwdlen = 1;
+    return ' ';
+  } elsif ($wtype eq "da") {
+    $texiwdlen = 2;
+    return '--';
+  } elsif ($wmajt eq "c" || $wtype eq "wc") {
+    $texiwdlen = 2 + $wlen;
+    return "\@code\{$w\}";
+  } elsif ($wtype eq "es") {
+    $texiwdlen = 1 + $wlen;
+    return "\@emph\{${w}";
+  } elsif ($wtype eq "ee") {
+    $texiwdlen = 1 + $wlen;
+    return "${w}\}";
+  } elsif ($wtype eq "eo") {
+    $texiwdlen = 2 + $wlen;
+    return "\@emph\{${w}\}";
+  } elsif ($wtype eq "x ") {
+    $texiwdlen = 0; # we don't need it in this case
+    $capital = 1; # hack
+    return "\@ref\{";
+  } elsif ($wtype eq "xe") {
+    $texiwdlen = 0; # we don't need it in this case
+    return "\}";
+  } elsif ($wmajt eq "i") {
+    $texiwdlen = 0; # we don't need it in this case
+    return "\001";
+  } else {
+    die "panic in word_texi: $wtype$w\n";
+  }
+}
+
+sub texi_menu {
+  my ($topitem) = @_;
+  my $item, $i, $mpname, $title, $wd;
+
+  $item = $tstruct_next{$topitem};
+  print "\@menu\n";
+  while ($item) {
+    $title = "";
+    $mpname = $tstruct_pname{$item};
+    foreach $i (@$mpname) {
+      $wd = &word_texi($i);
+      $title .= $wd unless $wd eq "\001";
+    }
+    print "* ${item}:: $title\n";
+    $item = $tstruct_mnext{$item};
+  }
+  print "* Index::\n" if $topitem eq "Top";
+  print "\@end menu\n";
+}
+
+sub texi_index {
+  my $itag, $ientry, @a, $wd, $item, $len;
+  my $subnums = "123456789ABCDEFGHIJKLMNOPQRSTU" .
+                "VWXYZabcdefghijklmnopqrstuvwxyz";
+
+  print "\@ifinfo\n\@node Index, , $FIXMElastnode, Top\n";
+  print "\@unnumbered Index\n\n\@menu\n";
+
+  foreach $itag (@itags) {
+    $ientry = $idxmap{$itag};
+    @a = @$ientry;
+    $item = '';
+    $len = 0;
+    foreach $i (@a) {
+      $wd = &word_texi($i);
+      $item .= $wd, $len += $texiwdlen unless $wd eq "\001";
+    }
+    $i = 0;
+    foreach $node (@nodes) {
+      next if !$idxnodes{$node,$itag};
+      printf "* %s%s (%s): %s.\n",
+          $item, " " x (40-$len), substr($subnums,$i++,1), $node;
+    }
+  }
+  print "\@end menu\n\@end ifinfo\n";
+}
+
+sub write_hlp {
+  # This is called from the top level, so I won't bother using
+  # my or local.
+
+  # Build the index-tag text forms.
+  print "building index entries...";
+  @hlp_index = map {
+                 my $i,$ww;
+                my $ientry = $idxmap{$_};
+                my $title = "";
+                 foreach $i (@$ientry) {
+                  $ww = &word_hlp($i,0);
+                  $title .= $ww unless $ww eq "\001";
+                }
+                $title;
+               } @itags;
+
+  # Write the HPJ project-description file.
+  print "writing .hpj file...";
+  open HPJ,">nasmdoc.hpj";
+  print HPJ "[OPTIONS]\ncompress=true\n";
+  print HPJ "title=NASM: The Netwide Assembler\noldkeyphrase=no\n\n";
+  print HPJ "[FILES]\nnasmdoc.rtf\n\n";
+  print HPJ "[CONFIG]\n";
+  print HPJ 'CreateButton("btn_up", "&Up",'.
+            ' "JumpContents(`nasmdoc.hlp'."'".')")';
+  print HPJ "\nBrowseButtons()\n";
+  close HPJ;
+
+  # Open file.
+  print "\n   writing .rtf file...";
+  open TEXT,">nasmdoc.rtf";
+  select TEXT;
+
+  # Preamble.
+  print "{\\rtf1\\ansi{\\fonttbl\n";
+  print "\\f0\\froman Times New Roman;\\f1\\fmodern Courier New;\n";
+  print "\\f2\\fswiss Arial;\\f3\\ftech Wingdings}\\deff0\n";
+  print "#{\\footnote Top}\n";
+  print "\${\\footnote Contents}\n";
+  print "+{\\footnote browse:00000}\n";
+  print "!{\\footnote DisableButton(\"btn_up\")}\n";
+  print "\\keepn\\f2\\b\\fs30\\sb0\n";
+  print "NASM: The Netwide Assembler\n";
+  print "\\par\\pard\\plain\\sb120\n";
+  print "This file documents NASM, the Netwide Assembler: an assembler \n";
+  print "targetting the Intel x86 series of processors, with portable source.\n";
+
+  $node = "Top";
+  $browse = 0;
+
+  $newpar = "\\par\\sb120\n";
+  for ($para = 0; $para <= $#pnames; $para++) {
+    $pname = $pnames[$para];
+    $pflags = $pflags[$para];
+    $ptype = substr($pflags,0,4);
+
+    print $newpar;
+    $newpar = "\\par\\sb120\n";
+
+    if ($ptype eq "chap") {
+      # Chapter heading. Begin a new node.
+      &hlp_menu($node)
+        if $tstruct_level{$tstruct_next{$node}} > $tstruct_level{$node};
+      $pflags =~ /chap (.*) :(.*)/;
+      $node = "Chapter $1";
+      $title = $footnotetitle = "Chapter $1: ";
+      foreach $i (@$pname) {
+        $ww = &word_hlp($i,1);
+       $title .= $ww, $footnotetitle .= &word_hlp($i,0) unless $ww eq "\001";
+      }
+      print "\\page\n";
+      printf "#{\\footnote %s}\n", &hlp_sectkw($node);
+      print "\${\\footnote $footnotetitle}\n";
+      printf "+{\\footnote browse:%05d}\n", ++$browse;
+      printf "!{\\footnote ChangeButtonBinding(\"btn_up\"," .
+             "\"JumpId(\`nasmdoc.hlp',\`%s')\");\n",
+            &hlp_sectkw($tstruct_up{$node});
+      print "EnableButton(\"btn_up\")}\n";
+      &hlp_keywords($node);
+      print "\\keepn\\f2\\b\\fs30\\sb60\\sa60\n";
+      print "$title\n";
+      $newpar = "\\par\\pard\\plain\\sb120\n";
+    } elsif ($ptype eq "appn") {
+      # Appendix heading. Begin a new node.
+      &hlp_menu($node)
+        if $tstruct_level{$tstruct_next{$node}} > $tstruct_level{$node};
+      $pflags =~ /appn (.*) :(.*)/;
+      $node = "Appendix $1";
+      $title = $footnotetitle = "Appendix $1: ";
+      foreach $i (@$pname) {
+        $ww = &word_hlp($i,1);
+       $title .= $ww, $footnotetitle .= &word_hlp($i,0) unless $ww eq "\001";
+      }
+      print "\\page\n";
+      printf "#{\\footnote %s}\n", &hlp_sectkw($node);
+      print "\${\\footnote $footnotetitle}\n";
+      printf "+{\\footnote browse:%05d}\n", ++$browse;
+      printf "!{\\footnote ChangeButtonBinding(\"btn_up\"," .
+             "\"JumpId(\`nasmdoc.hlp',\`%s')\");\n",
+            &hlp_sectkw($tstruct_up{$node});
+      print "EnableButton(\"btn_up\")}\n";
+      &hlp_keywords($node);
+      print "\\keepn\\f2\\b\\fs30\\sb60\\sa60\n";
+      print "$title\n";
+      $newpar = "\\par\\pard\\plain\\sb120\n";
+    } elsif ($ptype eq "head" || $ptype eq "subh") {
+      # Heading or subheading. Begin a new node.
+      &hlp_menu($node)
+        if $tstruct_level{$tstruct_next{$node}} > $tstruct_level{$node};
+      $pflags =~ /.... (.*) :(.*)/;
+      $node = "Section $1";
+      $title = $footnotetitle = "$1. ";
+      foreach $i (@$pname) {
+        $ww = &word_hlp($i,1);
+       $title .= $ww, $footnotetitle .= &word_hlp($i,0) unless $ww eq "\001";
+      }
+      print "\\page\n";
+      printf "#{\\footnote %s}\n", &hlp_sectkw($node);
+      print "\${\\footnote $footnotetitle}\n";
+      printf "+{\\footnote browse:%05d}\n", ++$browse;
+      printf "!{\\footnote ChangeButtonBinding(\"btn_up\"," .
+             "\"JumpId(\`nasmdoc.hlp',\`%s')\");\n",
+            &hlp_sectkw($tstruct_up{$node});
+      print "EnableButton(\"btn_up\")}\n";
+      &hlp_keywords($node);
+      print "\\keepn\\f2\\b\\fs30\\sb60\\sa60\n";
+      print "$title\n";
+      $newpar = "\\par\\pard\\plain\\sb120\n";
+    } elsif ($ptype eq "code") {
+      # Code paragraph.
+      print "\\keep\\f1\\sb120\n";
+      foreach $i (@$pname) {
+       my $x = $i;
+        warn "code line longer than 68 chars: $i\n" if length $i > 68;
+       $x =~ s/\\/\\\\/g;
+       $x =~ s/\{/\\\{/g;
+       $x =~ s/\}/\\\}/g;
+        print "$x\\par\\sb0\n";
+      }
+      $newpar = "\\pard\\f0\\sb120\n";
+    } elsif ($ptype eq "bull" || $ptype eq "norm") {
+      # Ordinary paragraph, optionally bulleted. We wrap, FWIW.
+      if ($ptype eq "bull") {
+        print "\\tx360\\li360\\fi-360{\\f3\\'9F}\\tab\n";
+       $newpar = "\\par\\pard\\sb120\n";
+      } else {
+       $newpar = "\\par\\sb120\n";
+      }
+      $line = '';
+      @a = @$pname;
+      $wd = $wprev = '';
+      do {
+        do { $w = &word_hlp((shift @a),1); } while $w eq "\001"; # hack
+       $wd .= $wprev;
+       if ($w eq ' ' || $w eq '' || $w eq undef) {
+         if (length ($line . $wd) > 75) {
+           $line =~ s/\s*$//; # trim trailing spaces
+           print "$line \n"; # and put one back
+           $line = '';
+           $wd =~ s/^\s*//; # trim leading spaces
+         }
+         $line .= $wd;
+         $wd = '';
+       }
+       $wprev = $w;
+      } while ($w ne '' && $w ne undef);
+      if ($line =~ /\S/) {
+       $line =~ s/\s*$//; # trim trailing spaces
+       print "$line\n";
+      }
+    }
+  }
+
+  # Close file.
+  print "\\page}\n";
+  select STDOUT;
+  close TEXT;
+}
+
+sub word_hlp {
+  my ($w, $docode) = @_;
+  my $wtype, $wmajt;
+
+  return undef if $w eq '' || $w eq undef;
+  $wtype = substr($w,0,2);
+  $wmajt = substr($wtype,0,1);
+  $w = substr($w,2);
+  $w =~ s/\\/\\\\/g;
+  $w =~ s/\{/\\\{/g;
+  $w =~ s/\}/\\\}/g;
+  $w =~ s/<.*>// if $wmajt eq "w"; # remove web links
+  substr($w,0,length($w)-1) =~ s/-/\\\'AD/g if $wmajt ne "x"; #nonbreakhyphens
+  if ($wmajt eq "n" || $wtype eq "e " || $wtype eq "w ") {
+    return $w;
+  } elsif ($wtype eq "sp") {
+    return ' ';
+  } elsif ($wtype eq "da") {
+    return "\\'96";
+  } elsif ($wmajt eq "c" || $wtype eq "wc") {
+    $w =~ s/ /\\\'A0/g; # make spaces non-breaking
+    return $docode ? "{\\f1 ${w}}" : $w;
+  } elsif ($wtype eq "es") {
+    return "{\\i ${w}";
+  } elsif ($wtype eq "ee") {
+    return "${w}}";
+  } elsif ($wtype eq "eo") {
+    return "{\\i ${w}}";
+  } elsif ($wtype eq "x ") {
+    return "{\\uldb ";
+  } elsif ($wtype eq "xe") {
+    $w = &hlp_sectkw($w);
+    return "}{\\v ${w}}";
+  } elsif ($wmajt eq "i") {
+    return "\001";
+  } else {
+    die "panic in word_hlp: $wtype$w\n";
+  }
+}
+
+sub hlp_menu {
+  my ($topitem) = @_;
+  my $item, $kword, $i, $mpname, $title;
+
+  $item = $tstruct_next{$topitem};
+  print "\\li360\\fi-360\n";
+  while ($item) {
+    $title = "";
+    $mpname = $tstruct_pname{$item};
+    foreach $i (@$mpname) {
+      $ww = &word_hlp($i, 0);
+      $title .= $ww unless $ww eq "\001";
+    }
+    $kword = &hlp_sectkw($item);
+    print "{\\uldb ${item}: $title}{\\v $kword}\\par\\sb0\n";
+    $item = $tstruct_mnext{$item};
+  }
+  print "\\pard\\sb120\n";
+}
+
+sub hlp_sectkw {
+  my ($node) = @_;
+  $node =~ tr/A-Z/a-z/;
+  $node =~ tr/- ./___/;
+  $node;
+}
+
+sub hlp_keywords {
+  my ($node) = @_;
+  my $pfx = "K{\\footnote ";
+  my $done = 0;
+  foreach $i (0..$#itags) {
+    (print $pfx,$hlp_index[$i]), $pfx = ";\n", $done++
+        if $idxnodes{$node,$itags[$i]};
+  }
+  print "}\n" if $done;
+}
+
+# Make tree structures. $tstruct_* is top-level and global.
+sub add_item {
+  my ($item, $level) = @_;
+  my $i;
+
+  $tstruct_pname{$item} = $pname;
+  $tstruct_next{$tstruct_previtem} = $item;
+  $tstruct_prev{$item} = $tstruct_previtem;
+  $tstruct_level{$item} = $level;
+  $tstruct_up{$item} = $tstruct_last[$level-1];
+  $tstruct_mnext{$tstruct_last[$level]} = $item;
+  $tstruct_last[$level] = $item;
+  for ($i=$level+1; $i<$MAXLEVEL; $i++) { $tstruct_last[$i] = undef; }
+  $tstruct_previtem = $item;
+  push @nodes, $item;
+}
+
+#
+# This produces documentation intermediate paragraph format; this is
+# basically the digested output of the front end.  Intended for use
+# by future backends, instead of putting it all in the same script.
+#
+sub write_dip {
+  open(PARAS, "> nasmdoc.dip");
+  foreach $k (keys(%metadata)) {
+      print PARAS 'meta :', $k, "\n";
+      print PARAS $metadata{$k},"\n";
+  }
+  for ($para = 0; $para <= $#pnames; $para++) {
+      print PARAS $pflags[$para], "\n";
+      print PARAS join("\037", @{$pnames[$para]}, "\n");
+  }
+  foreach $k (@itags) {
+      print PARAS 'indx :', $k, "\n";
+      print PARAS join("\037", @{$idxmap{$k}}), "\n";
+  }
+  close(PARAS);
+}
diff --git a/eval.c b/eval.c
new file mode 100644 (file)
index 0000000..575824a
--- /dev/null
+++ b/eval.c
@@ -0,0 +1,977 @@
+/* ----------------------------------------------------------------------- *
+ *
+ *   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.
+ *
+ * ----------------------------------------------------------------------- */
+
+/*
+ * eval.c    expression evaluator for the Netwide Assembler
+ */
+
+#include "compiler.h"
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <stddef.h>
+#include <string.h>
+#include <ctype.h>
+#include <inttypes.h>
+
+#include "nasm.h"
+#include "nasmlib.h"
+#include "eval.h"
+#include "labels.h"
+#include "float.h"
+
+#define TEMPEXPRS_DELTA 128
+#define TEMPEXPR_DELTA 8
+
+static scanner scan;            /* Address of scanner routine */
+static efunc error;             /* Address of error reporting routine */
+static lfunc labelfunc;         /* Address of label routine */
+
+static struct ofmt *outfmt;     /* Structure of addresses of output routines */
+
+static expr **tempexprs = NULL;
+static int ntempexprs;
+static int tempexprs_size = 0;
+
+static expr *tempexpr;
+static int ntempexpr;
+static int tempexpr_size;
+
+static struct tokenval *tokval; /* The current token */
+static int i;                   /* The t_type of tokval */
+
+static void *scpriv;
+static struct location *location;         /* Pointer to current line's segment,offset */
+static int *opflags;
+
+static struct eval_hints *hint;
+
+extern int in_abs_seg;          /* ABSOLUTE segment flag */
+extern int32_t abs_seg;         /* ABSOLUTE segment */
+extern int32_t abs_offset;      /* ABSOLUTE segment offset */
+
+/*
+ * Unimportant cleanup is done to avoid confusing people who are trying
+ * to debug real memory leaks
+ */
+void eval_cleanup(void)
+{
+    while (ntempexprs)
+        nasm_free(tempexprs[--ntempexprs]);
+    nasm_free(tempexprs);
+}
+
+/*
+ * Construct a temporary expression.
+ */
+static void begintemp(void)
+{
+    tempexpr = NULL;
+    tempexpr_size = ntempexpr = 0;
+}
+
+static void addtotemp(int32_t type, int64_t value)
+{
+    while (ntempexpr >= tempexpr_size) {
+        tempexpr_size += TEMPEXPR_DELTA;
+        tempexpr = nasm_realloc(tempexpr,
+                                tempexpr_size * sizeof(*tempexpr));
+    }
+    tempexpr[ntempexpr].type = type;
+    tempexpr[ntempexpr++].value = value;
+}
+
+static expr *finishtemp(void)
+{
+    addtotemp(0L, 0L);          /* terminate */
+    while (ntempexprs >= tempexprs_size) {
+        tempexprs_size += TEMPEXPRS_DELTA;
+        tempexprs = nasm_realloc(tempexprs,
+                                 tempexprs_size * sizeof(*tempexprs));
+    }
+    return tempexprs[ntempexprs++] = tempexpr;
+}
+
+/*
+ * Add two vector datatypes. We have some bizarre behaviour on far-
+ * absolute segment types: we preserve them during addition _only_
+ * if one of the segments is a truly pure scalar.
+ */
+static expr *add_vectors(expr * p, expr * q)
+{
+    int preserve;
+
+    preserve = is_really_simple(p) || is_really_simple(q);
+
+    begintemp();
+
+    while (p->type && q->type &&
+           p->type < EXPR_SEGBASE + SEG_ABS &&
+           q->type < EXPR_SEGBASE + SEG_ABS) {
+        int lasttype;
+
+        if (p->type > q->type) {
+            addtotemp(q->type, q->value);
+            lasttype = q++->type;
+        } else if (p->type < q->type) {
+            addtotemp(p->type, p->value);
+            lasttype = p++->type;
+        } else {                /* *p and *q have same type */
+            int64_t sum = p->value + q->value;
+            if (sum)
+                addtotemp(p->type, sum);
+            lasttype = p->type;
+            p++, q++;
+        }
+        if (lasttype == EXPR_UNKNOWN) {
+            return finishtemp();
+        }
+    }
+    while (p->type && (preserve || p->type < EXPR_SEGBASE + SEG_ABS)) {
+        addtotemp(p->type, p->value);
+        p++;
+    }
+    while (q->type && (preserve || q->type < EXPR_SEGBASE + SEG_ABS)) {
+        addtotemp(q->type, q->value);
+        q++;
+    }
+
+    return finishtemp();
+}
+
+/*
+ * Multiply a vector by a scalar. Strip far-absolute segment part
+ * if present.
+ *
+ * Explicit treatment of UNKNOWN is not required in this routine,
+ * since it will silently do the Right Thing anyway.
+ *
+ * If `affect_hints' is set, we also change the hint type to
+ * NOTBASE if a MAKEBASE hint points at a register being
+ * multiplied. This allows [eax*1+ebx] to hint EBX rather than EAX
+ * as the base register.
+ */
+static expr *scalar_mult(expr * vect, int64_t scalar, int affect_hints)
+{
+    expr *p = vect;
+
+    while (p->type && p->type < EXPR_SEGBASE + SEG_ABS) {
+        p->value = scalar * (p->value);
+        if (hint && hint->type == EAH_MAKEBASE &&
+            p->type == hint->base && affect_hints)
+            hint->type = EAH_NOTBASE;
+        p++;
+    }
+    p->type = 0;
+
+    return vect;
+}
+
+static expr *scalarvect(int64_t scalar)
+{
+    begintemp();
+    addtotemp(EXPR_SIMPLE, scalar);
+    return finishtemp();
+}
+
+static expr *unknown_expr(void)
+{
+    begintemp();
+    addtotemp(EXPR_UNKNOWN, 1L);
+    return finishtemp();
+}
+
+/*
+ * The SEG operator: calculate the segment part of a relocatable
+ * value. Return NULL, as usual, if an error occurs. Report the
+ * error too.
+ */
+static expr *segment_part(expr * e)
+{
+    int32_t seg;
+
+    if (is_unknown(e))
+        return unknown_expr();
+
+    if (!is_reloc(e)) {
+        error(ERR_NONFATAL, "cannot apply SEG to a non-relocatable value");
+        return NULL;
+    }
+
+    seg = reloc_seg(e);
+    if (seg == NO_SEG) {
+        error(ERR_NONFATAL, "cannot apply SEG to a non-relocatable value");
+        return NULL;
+    } else if (seg & SEG_ABS) {
+        return scalarvect(seg & ~SEG_ABS);
+    } else if (seg & 1) {
+        error(ERR_NONFATAL, "SEG applied to something which"
+              " is already a segment base");
+        return NULL;
+    } else {
+        int32_t base = outfmt->segbase(seg + 1);
+
+        begintemp();
+        addtotemp((base == NO_SEG ? EXPR_UNKNOWN : EXPR_SEGBASE + base),
+                  1L);
+        return finishtemp();
+    }
+}
+
+/*
+ * Recursive-descent parser. Called with a single boolean operand,
+ * which is true if the evaluation is critical (i.e. unresolved
+ * symbols are an error condition). Must update the global `i' to
+ * reflect the token after the parsed string. May return NULL.
+ *
+ * evaluate() should report its own errors: on return it is assumed
+ * that if NULL has been returned, the error has already been
+ * reported.
+ */
+
+/*
+ * Grammar parsed is:
+ *
+ * expr  : bexpr [ WRT expr6 ]
+ * bexpr : rexp0 or expr0 depending on relative-mode setting
+ * rexp0 : rexp1 [ {||} rexp1...]
+ * rexp1 : rexp2 [ {^^} rexp2...]
+ * rexp2 : rexp3 [ {&&} rexp3...]
+ * rexp3 : expr0 [ {=,==,<>,!=,<,>,<=,>=} expr0 ]
+ * expr0 : expr1 [ {|} expr1...]
+ * expr1 : expr2 [ {^} expr2...]
+ * expr2 : expr3 [ {&} expr3...]
+ * expr3 : expr4 [ {<<,>>} expr4...]
+ * expr4 : expr5 [ {+,-} expr5...]
+ * expr5 : expr6 [ {*,/,%,//,%%} expr6...]
+ * expr6 : { ~,+,-,SEG } expr6
+ *       | (bexpr)
+ *       | symbol
+ *       | $
+ *       | number
+ */
+
+static expr *rexp0(int), *rexp1(int), *rexp2(int), *rexp3(int);
+
+static expr *expr0(int), *expr1(int), *expr2(int), *expr3(int);
+static expr *expr4(int), *expr5(int), *expr6(int);
+
+static expr *(*bexpr) (int);
+
+static expr *rexp0(int critical)
+{
+    expr *e, *f;
+
+    e = rexp1(critical);
+    if (!e)
+        return NULL;
+
+    while (i == TOKEN_DBL_OR) {
+        i = scan(scpriv, tokval);
+        f = rexp1(critical);
+        if (!f)
+            return NULL;
+        if (!(is_simple(e) || is_just_unknown(e)) ||
+            !(is_simple(f) || is_just_unknown(f))) {
+            error(ERR_NONFATAL, "`|' operator may only be applied to"
+                  " scalar values");
+        }
+
+        if (is_just_unknown(e) || is_just_unknown(f))
+            e = unknown_expr();
+        else
+            e = scalarvect((int64_t)(reloc_value(e) || reloc_value(f)));
+    }
+    return e;
+}
+
+static expr *rexp1(int critical)
+{
+    expr *e, *f;
+
+    e = rexp2(critical);
+    if (!e)
+        return NULL;
+
+    while (i == TOKEN_DBL_XOR) {
+        i = scan(scpriv, tokval);
+        f = rexp2(critical);
+        if (!f)
+            return NULL;
+        if (!(is_simple(e) || is_just_unknown(e)) ||
+            !(is_simple(f) || is_just_unknown(f))) {
+            error(ERR_NONFATAL, "`^' operator may only be applied to"
+                  " scalar values");
+        }
+
+        if (is_just_unknown(e) || is_just_unknown(f))
+            e = unknown_expr();
+        else
+            e = scalarvect((int64_t)(!reloc_value(e) ^ !reloc_value(f)));
+    }
+    return e;
+}
+
+static expr *rexp2(int critical)
+{
+    expr *e, *f;
+
+    e = rexp3(critical);
+    if (!e)
+        return NULL;
+    while (i == TOKEN_DBL_AND) {
+        i = scan(scpriv, tokval);
+        f = rexp3(critical);
+        if (!f)
+            return NULL;
+        if (!(is_simple(e) || is_just_unknown(e)) ||
+            !(is_simple(f) || is_just_unknown(f))) {
+            error(ERR_NONFATAL, "`&' operator may only be applied to"
+                  " scalar values");
+        }
+        if (is_just_unknown(e) || is_just_unknown(f))
+            e = unknown_expr();
+        else
+            e = scalarvect((int64_t)(reloc_value(e) && reloc_value(f)));
+    }
+    return e;
+}
+
+static expr *rexp3(int critical)
+{
+    expr *e, *f;
+    int64_t v;
+
+    e = expr0(critical);
+    if (!e)
+        return NULL;
+
+    while (i == TOKEN_EQ || i == TOKEN_LT || i == TOKEN_GT ||
+           i == TOKEN_NE || i == TOKEN_LE || i == TOKEN_GE) {
+        int j = i;
+        i = scan(scpriv, tokval);
+        f = expr0(critical);
+        if (!f)
+            return NULL;
+
+        e = add_vectors(e, scalar_mult(f, -1L, false));
+
+        switch (j) {
+        case TOKEN_EQ:
+        case TOKEN_NE:
+            if (is_unknown(e))
+                v = -1;         /* means unknown */
+            else if (!is_really_simple(e) || reloc_value(e) != 0)
+                v = (j == TOKEN_NE);    /* unequal, so return true if NE */
+            else
+                v = (j == TOKEN_EQ);    /* equal, so return true if EQ */
+            break;
+        default:
+            if (is_unknown(e))
+                v = -1;         /* means unknown */
+            else if (!is_really_simple(e)) {
+                error(ERR_NONFATAL,
+                      "`%s': operands differ by a non-scalar",
+                      (j == TOKEN_LE ? "<=" : j == TOKEN_LT ? "<" : j ==
+                       TOKEN_GE ? ">=" : ">"));
+                v = 0;          /* must set it to _something_ */
+            } else {
+                int vv = reloc_value(e);
+                if (vv == 0)
+                    v = (j == TOKEN_LE || j == TOKEN_GE);
+                else if (vv > 0)
+                    v = (j == TOKEN_GE || j == TOKEN_GT);
+                else            /* vv < 0 */
+                    v = (j == TOKEN_LE || j == TOKEN_LT);
+            }
+            break;
+        }
+
+        if (v == -1)
+            e = unknown_expr();
+        else
+            e = scalarvect(v);
+    }
+    return e;
+}
+
+static expr *expr0(int critical)
+{
+    expr *e, *f;
+
+    e = expr1(critical);
+    if (!e)
+        return NULL;
+
+    while (i == '|') {
+        i = scan(scpriv, tokval);
+        f = expr1(critical);
+        if (!f)
+            return NULL;
+        if (!(is_simple(e) || is_just_unknown(e)) ||
+            !(is_simple(f) || is_just_unknown(f))) {
+            error(ERR_NONFATAL, "`|' operator may only be applied to"
+                  " scalar values");
+        }
+        if (is_just_unknown(e) || is_just_unknown(f))
+            e = unknown_expr();
+        else
+            e = scalarvect(reloc_value(e) | reloc_value(f));
+    }
+    return e;
+}
+
+static expr *expr1(int critical)
+{
+    expr *e, *f;
+
+    e = expr2(critical);
+    if (!e)
+        return NULL;
+
+    while (i == '^') {
+        i = scan(scpriv, tokval);
+        f = expr2(critical);
+        if (!f)
+            return NULL;
+        if (!(is_simple(e) || is_just_unknown(e)) ||
+            !(is_simple(f) || is_just_unknown(f))) {
+            error(ERR_NONFATAL, "`^' operator may only be applied to"
+                  " scalar values");
+        }
+        if (is_just_unknown(e) || is_just_unknown(f))
+            e = unknown_expr();
+        else
+            e = scalarvect(reloc_value(e) ^ reloc_value(f));
+    }
+    return e;
+}
+
+static expr *expr2(int critical)
+{
+    expr *e, *f;
+
+    e = expr3(critical);
+    if (!e)
+        return NULL;
+
+    while (i == '&') {
+        i = scan(scpriv, tokval);
+        f = expr3(critical);
+        if (!f)
+            return NULL;
+        if (!(is_simple(e) || is_just_unknown(e)) ||
+            !(is_simple(f) || is_just_unknown(f))) {
+            error(ERR_NONFATAL, "`&' operator may only be applied to"
+                  " scalar values");
+        }
+        if (is_just_unknown(e) || is_just_unknown(f))
+            e = unknown_expr();
+        else
+            e = scalarvect(reloc_value(e) & reloc_value(f));
+    }
+    return e;
+}
+
+static expr *expr3(int critical)
+{
+    expr *e, *f;
+
+    e = expr4(critical);
+    if (!e)
+        return NULL;
+
+    while (i == TOKEN_SHL || i == TOKEN_SHR) {
+        int j = i;
+        i = scan(scpriv, tokval);
+        f = expr4(critical);
+        if (!f)
+            return NULL;
+        if (!(is_simple(e) || is_just_unknown(e)) ||
+            !(is_simple(f) || is_just_unknown(f))) {
+            error(ERR_NONFATAL, "shift operator may only be applied to"
+                  " scalar values");
+        } else if (is_just_unknown(e) || is_just_unknown(f)) {
+            e = unknown_expr();
+        } else
+            switch (j) {
+            case TOKEN_SHL:
+                e = scalarvect(reloc_value(e) << reloc_value(f));
+                break;
+            case TOKEN_SHR:
+                e = scalarvect(((uint64_t)reloc_value(e)) >>
+                               reloc_value(f));
+                break;
+            }
+    }
+    return e;
+}
+
+static expr *expr4(int critical)
+{
+    expr *e, *f;
+
+    e = expr5(critical);
+    if (!e)
+        return NULL;
+    while (i == '+' || i == '-') {
+        int j = i;
+        i = scan(scpriv, tokval);
+        f = expr5(critical);
+        if (!f)
+            return NULL;
+        switch (j) {
+        case '+':
+            e = add_vectors(e, f);
+            break;
+        case '-':
+            e = add_vectors(e, scalar_mult(f, -1L, false));
+            break;
+        }
+    }
+    return e;
+}
+
+static expr *expr5(int critical)
+{
+    expr *e, *f;
+
+    e = expr6(critical);
+    if (!e)
+        return NULL;
+    while (i == '*' || i == '/' || i == '%' ||
+           i == TOKEN_SDIV || i == TOKEN_SMOD) {
+        int j = i;
+        i = scan(scpriv, tokval);
+        f = expr6(critical);
+        if (!f)
+            return NULL;
+        if (j != '*' && (!(is_simple(e) || is_just_unknown(e)) ||
+                         !(is_simple(f) || is_just_unknown(f)))) {
+            error(ERR_NONFATAL, "division operator may only be applied to"
+                  " scalar values");
+            return NULL;
+        }
+        if (j != '*' && !is_unknown(f) && reloc_value(f) == 0) {
+            error(ERR_NONFATAL, "division by zero");
+            return NULL;
+        }
+        switch (j) {
+        case '*':
+            if (is_simple(e))
+                e = scalar_mult(f, reloc_value(e), true);
+            else if (is_simple(f))
+                e = scalar_mult(e, reloc_value(f), true);
+            else if (is_just_unknown(e) && is_just_unknown(f))
+                e = unknown_expr();
+            else {
+                error(ERR_NONFATAL, "unable to multiply two "
+                      "non-scalar objects");
+                return NULL;
+            }
+            break;
+        case '/':
+            if (is_just_unknown(e) || is_just_unknown(f))
+                e = unknown_expr();
+            else
+                e = scalarvect(((uint64_t)reloc_value(e)) /
+                               ((uint64_t)reloc_value(f)));
+            break;
+        case '%':
+            if (is_just_unknown(e) || is_just_unknown(f))
+                e = unknown_expr();
+            else
+                e = scalarvect(((uint64_t)reloc_value(e)) %
+                               ((uint64_t)reloc_value(f)));
+            break;
+        case TOKEN_SDIV:
+            if (is_just_unknown(e) || is_just_unknown(f))
+                e = unknown_expr();
+            else
+                e = scalarvect(((int64_t)reloc_value(e)) /
+                               ((int64_t)reloc_value(f)));
+            break;
+        case TOKEN_SMOD:
+            if (is_just_unknown(e) || is_just_unknown(f))
+                e = unknown_expr();
+            else
+                e = scalarvect(((int64_t)reloc_value(e)) %
+                               ((int64_t)reloc_value(f)));
+            break;
+        }
+    }
+    return e;
+}
+
+static expr *eval_floatize(enum floatize type)
+{
+    uint8_t result[16], *p;     /* Up to 128 bits */
+    static const struct {
+        int bytes, start, len;
+    } formats[] = {
+        {  1, 0, 1 },           /* FLOAT_8 */
+        {  2, 0, 2 },           /* FLOAT_16 */
+        {  4, 0, 4 },           /* FLOAT_32 */
+        {  8, 0, 8 },           /* FLOAT_64 */
+        { 10, 0, 8 },           /* FLOAT_80M */
+        { 10, 8, 2 },           /* FLOAT_80E */
+        { 16, 0, 8 },           /* FLOAT_128L */
+        { 16, 8, 8 },           /* FLOAT_128H */
+    };
+    int sign = 1;
+    int64_t val;
+    int j;
+
+    i = scan(scpriv, tokval);
+    if (i != '(') {
+        error(ERR_NONFATAL, "expecting `('");
+        return NULL;
+    }
+    i = scan(scpriv, tokval);
+    if (i == '-' || i == '+') {
+        sign = (i == '-') ? -1 : 1;
+        i = scan(scpriv, tokval);
+    }
+    if (i != TOKEN_FLOAT) {
+        error(ERR_NONFATAL, "expecting floating-point number");
+        return NULL;
+    }
+    if (!float_const(tokval->t_charptr, sign, result,
+                     formats[type].bytes, error))
+        return NULL;
+    i = scan(scpriv, tokval);
+    if (i != ')') {
+        error(ERR_NONFATAL, "expecting `)'");
+        return NULL;
+    }
+
+    p = result+formats[type].start+formats[type].len;
+    val = 0;
+    for (j = formats[type].len; j; j--) {
+        p--;
+        val = (val << 8) + *p;
+    }
+
+    begintemp();
+    addtotemp(EXPR_SIMPLE, val);
+
+    i = scan(scpriv, tokval);
+    return finishtemp();
+}
+
+static expr *eval_strfunc(enum strfunc type)
+{
+    char *string;
+    size_t string_len;
+    int64_t val;
+    bool parens, rn_warn;
+
+    parens = false;
+    i = scan(scpriv, tokval);
+    if (i == '(') {
+        parens = true;
+        i = scan(scpriv, tokval);
+    }
+    if (i != TOKEN_STR) {
+        error(ERR_NONFATAL, "expecting string");
+        return NULL;
+    }
+    string_len = string_transform(tokval->t_charptr, tokval->t_inttwo,
+                                  &string, type);
+    if (string_len == (size_t)-1) {
+        error(ERR_NONFATAL, "invalid string for transform");
+        return NULL;
+    }
+
+    val = readstrnum(string, string_len, &rn_warn);
+    if (parens) {
+        i = scan(scpriv, tokval);
+        if (i != ')') {
+            error(ERR_NONFATAL, "expecting `)'");
+            return NULL;
+        }
+    }
+
+    if (rn_warn)
+        error(ERR_WARNING|ERR_PASS1, "character constant too long");
+
+    begintemp();
+    addtotemp(EXPR_SIMPLE, val);
+
+    i = scan(scpriv, tokval);
+    return finishtemp();
+}
+
+static expr *expr6(int critical)
+{
+    int32_t type;
+    expr *e;
+    int32_t label_seg;
+    int64_t label_ofs;
+    int64_t tmpval;
+    bool rn_warn;
+    char *scope;
+
+    switch (i) {
+    case '-':
+        i = scan(scpriv, tokval);
+        e = expr6(critical);
+        if (!e)
+            return NULL;
+        return scalar_mult(e, -1L, false);
+
+    case '+':
+        i = scan(scpriv, tokval);
+        return expr6(critical);
+
+    case '~':
+        i = scan(scpriv, tokval);
+        e = expr6(critical);
+        if (!e)
+            return NULL;
+        if (is_just_unknown(e))
+            return unknown_expr();
+        else if (!is_simple(e)) {
+            error(ERR_NONFATAL, "`~' operator may only be applied to"
+                  " scalar values");
+            return NULL;
+        }
+        return scalarvect(~reloc_value(e));
+
+    case '!':
+        i = scan(scpriv, tokval);
+        e = expr6(critical);
+        if (!e)
+            return NULL;
+        if (is_just_unknown(e))
+            return unknown_expr();
+        else if (!is_simple(e)) {
+            error(ERR_NONFATAL, "`!' operator may only be applied to"
+                  " scalar values");
+            return NULL;
+        }
+        return scalarvect(!reloc_value(e));
+
+    case TOKEN_SEG:
+        i = scan(scpriv, tokval);
+        e = expr6(critical);
+        if (!e)
+            return NULL;
+        e = segment_part(e);
+        if (!e)
+            return NULL;
+        if (is_unknown(e) && critical) {
+            error(ERR_NONFATAL, "unable to determine segment base");
+            return NULL;
+        }
+        return e;
+
+    case TOKEN_FLOATIZE:
+        return eval_floatize(tokval->t_integer);
+
+    case TOKEN_STRFUNC:
+        return eval_strfunc(tokval->t_integer);
+
+    case '(':
+        i = scan(scpriv, tokval);
+        e = bexpr(critical);
+        if (!e)
+            return NULL;
+        if (i != ')') {
+            error(ERR_NONFATAL, "expecting `)'");
+            return NULL;
+        }
+        i = scan(scpriv, tokval);
+        return e;
+
+    case TOKEN_NUM:
+    case TOKEN_STR:
+    case TOKEN_REG:
+    case TOKEN_ID:
+    case TOKEN_INSN:            /* Opcodes that occur here are really labels */
+    case TOKEN_HERE:
+    case TOKEN_BASE:
+        begintemp();
+        switch (i) {
+        case TOKEN_NUM:
+            addtotemp(EXPR_SIMPLE, tokval->t_integer);
+            break;
+        case TOKEN_STR:
+            tmpval = readstrnum(tokval->t_charptr, tokval->t_inttwo, &rn_warn);
+            if (rn_warn)
+                error(ERR_WARNING|ERR_PASS1, "character constant too long");
+            addtotemp(EXPR_SIMPLE, tmpval);
+            break;
+        case TOKEN_REG:
+            addtotemp(tokval->t_integer, 1L);
+            if (hint && hint->type == EAH_NOHINT)
+                hint->base = tokval->t_integer, hint->type = EAH_MAKEBASE;
+            break;
+        case TOKEN_ID:
+        case TOKEN_INSN:
+        case TOKEN_HERE:
+        case TOKEN_BASE:
+            /*
+             * If !location->known, this indicates that no
+             * symbol, Here or Base references are valid because we
+             * are in preprocess-only mode.
+             */
+            if (!location->known) {
+                error(ERR_NONFATAL,
+                      "%s not supported in preprocess-only mode",
+                      (i == TOKEN_HERE ? "`$'" :
+                       i == TOKEN_BASE ? "`$$'" :
+                       "symbol references"));
+                addtotemp(EXPR_UNKNOWN, 1L);
+                break;
+            }
+
+            type = EXPR_SIMPLE; /* might get overridden by UNKNOWN */
+            if (i == TOKEN_BASE) {
+                label_seg = in_abs_seg ? abs_seg : location->segment;
+                label_ofs = 0;
+            } else if (i == TOKEN_HERE) {
+                label_seg = in_abs_seg ? abs_seg : location->segment;
+                label_ofs = in_abs_seg ? abs_offset : location->offset;
+            } else {
+                if (!labelfunc(tokval->t_charptr, &label_seg, &label_ofs)) {
+                    scope = local_scope(tokval->t_charptr);
+                    if (critical == 2) {
+                        error(ERR_NONFATAL, "symbol `%s%s' undefined",
+                              scope,tokval->t_charptr);
+                        return NULL;
+                    } else if (critical == 1) {
+                        error(ERR_NONFATAL,
+                              "symbol `%s%s' not defined before use",
+                              scope,tokval->t_charptr);
+                        return NULL;
+                    } else {
+                        if (opflags)
+                            *opflags |= 1;
+                        type = EXPR_UNKNOWN;
+                        label_seg = NO_SEG;
+                        label_ofs = 1;
+                    }
+                }
+                if (opflags && is_extern(tokval->t_charptr))
+                    *opflags |= OPFLAG_EXTERN;
+            }
+            addtotemp(type, label_ofs);
+            if (label_seg != NO_SEG)
+                addtotemp(EXPR_SEGBASE + label_seg, 1L);
+            break;
+        }
+        i = scan(scpriv, tokval);
+        return finishtemp();
+
+    default:
+        error(ERR_NONFATAL, "expression syntax error");
+        return NULL;
+    }
+}
+
+void eval_global_info(struct ofmt *output, lfunc lookup_label,
+                      struct location * locp)
+{
+    outfmt = output;
+    labelfunc = lookup_label;
+    location = locp;
+}
+
+expr *evaluate(scanner sc, void *scprivate, struct tokenval *tv,
+               int *fwref, int critical, efunc report_error,
+               struct eval_hints *hints)
+{
+    expr *e;
+    expr *f = NULL;
+
+    hint = hints;
+    if (hint)
+        hint->type = EAH_NOHINT;
+
+    if (critical & CRITICAL) {
+        critical &= ~CRITICAL;
+        bexpr = rexp0;
+    } else
+        bexpr = expr0;
+
+    scan = sc;
+    scpriv = scprivate;
+    tokval = tv;
+    error = report_error;
+    opflags = fwref;
+
+    if (tokval->t_type == TOKEN_INVALID)
+        i = scan(scpriv, tokval);
+    else
+        i = tokval->t_type;
+
+    while (ntempexprs)          /* initialize temporary storage */
+        nasm_free(tempexprs[--ntempexprs]);
+
+    e = bexpr(critical);
+    if (!e)
+        return NULL;
+
+    if (i == TOKEN_WRT) {
+        i = scan(scpriv, tokval);       /* eat the WRT */
+        f = expr6(critical);
+        if (!f)
+            return NULL;
+    }
+    e = scalar_mult(e, 1L, false);      /* strip far-absolute segment part */
+    if (f) {
+        expr *g;
+        if (is_just_unknown(f))
+            g = unknown_expr();
+        else {
+            int64_t value;
+            begintemp();
+            if (!is_reloc(f)) {
+                error(ERR_NONFATAL, "invalid right-hand operand to WRT");
+                return NULL;
+            }
+            value = reloc_seg(f);
+            if (value == NO_SEG)
+                value = reloc_value(f) | SEG_ABS;
+            else if (!(value & SEG_ABS) && !(value % 2) && critical) {
+                error(ERR_NONFATAL, "invalid right-hand operand to WRT");
+                return NULL;
+            }
+            addtotemp(EXPR_WRT, value);
+            g = finishtemp();
+        }
+        e = add_vectors(e, g);
+    }
+    return e;
+}
diff --git a/eval.h b/eval.h
new file mode 100644 (file)
index 0000000..0ea59d1
--- /dev/null
+++ b/eval.h
@@ -0,0 +1,58 @@
+/* ----------------------------------------------------------------------- *
+ *   
+ *   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.
+ *
+ * ----------------------------------------------------------------------- */
+
+/* 
+ * eval.h   header file for eval.c
+ */
+
+#ifndef NASM_EVAL_H
+#define NASM_EVAL_H
+
+/*
+ * Called once to tell the evaluator what output format is
+ * providing segment-base details, and what function can be used to
+ * look labels up.
+ */
+void eval_global_info(struct ofmt *output, lfunc lookup_label,
+                      struct location * locp);
+
+/*
+ * The evaluator itself.
+ */
+expr *evaluate(scanner sc, void *scprivate, struct tokenval *tv,
+               int *fwref, int critical, efunc report_error,
+               struct eval_hints *hints);
+
+void eval_cleanup(void);
+
+#endif
diff --git a/exprlib.c b/exprlib.c
new file mode 100644 (file)
index 0000000..7eb3436
--- /dev/null
+++ b/exprlib.c
@@ -0,0 +1,186 @@
+/* ----------------------------------------------------------------------- *
+ *   
+ *   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.
+ *
+ * ----------------------------------------------------------------------- */
+
+/*
+ * exprlib.c
+ *
+ * Library routines to manipulate expression data types.
+ */
+
+#include "nasm.h"
+
+/*
+ * Return true if the argument is a simple scalar. (Or a far-
+ * absolute, which counts.)
+ */
+int is_simple(expr * vect)
+{
+    while (vect->type && !vect->value)
+        vect++;
+    if (!vect->type)
+        return 1;
+    if (vect->type != EXPR_SIMPLE)
+        return 0;
+    do {
+        vect++;
+    } while (vect->type && !vect->value);
+    if (vect->type && vect->type < EXPR_SEGBASE + SEG_ABS)
+        return 0;
+    return 1;
+}
+
+/*
+ * Return true if the argument is a simple scalar, _NOT_ a far-
+ * absolute.
+ */
+int is_really_simple(expr * vect)
+{
+    while (vect->type && !vect->value)
+        vect++;
+    if (!vect->type)
+        return 1;
+    if (vect->type != EXPR_SIMPLE)
+        return 0;
+    do {
+        vect++;
+    } while (vect->type && !vect->value);
+    if (vect->type)
+        return 0;
+    return 1;
+}
+
+/*
+ * Return true if the argument is relocatable (i.e. a simple
+ * scalar, plus at most one segment-base, plus possibly a WRT).
+ */
+int is_reloc(expr * vect)
+{
+    while (vect->type && !vect->value)  /* skip initial value-0 terms */
+        vect++;
+    if (!vect->type)            /* trivially return true if nothing */
+        return 1;               /* is present apart from value-0s */
+    if (vect->type < EXPR_SIMPLE)       /* false if a register is present */
+        return 0;
+    if (vect->type == EXPR_SIMPLE) {    /* skip over a pure number term... */
+        do {
+            vect++;
+        } while (vect->type && !vect->value);
+        if (!vect->type)        /* ...returning true if that's all */
+            return 1;
+    }
+    if (vect->type == EXPR_WRT) {       /* skip over a WRT term... */
+        do {
+            vect++;
+        } while (vect->type && !vect->value);
+        if (!vect->type)        /* ...returning true if that's all */
+            return 1;
+    }
+    if (vect->value != 0 && vect->value != 1)
+        return 0;               /* segment base multiplier non-unity */
+    do {                        /* skip over _one_ seg-base term... */
+        vect++;
+    } while (vect->type && !vect->value);
+    if (!vect->type)            /* ...returning true if that's all */
+        return 1;
+    return 0;                   /* And return false if there's more */
+}
+
+/*
+ * Return true if the argument contains an `unknown' part.
+ */
+int is_unknown(expr * vect)
+{
+    while (vect->type && vect->type < EXPR_UNKNOWN)
+        vect++;
+    return (vect->type == EXPR_UNKNOWN);
+}
+
+/*
+ * Return true if the argument contains nothing but an `unknown'
+ * part.
+ */
+int is_just_unknown(expr * vect)
+{
+    while (vect->type && !vect->value)
+        vect++;
+    return (vect->type == EXPR_UNKNOWN);
+}
+
+/*
+ * Return the scalar part of a relocatable vector. (Including
+ * simple scalar vectors - those qualify as relocatable.)
+ */
+int64_t reloc_value(expr * vect)
+{
+    while (vect->type && !vect->value)
+        vect++;
+    if (!vect->type)
+        return 0;
+    if (vect->type == EXPR_SIMPLE)
+        return vect->value;
+    else
+        return 0;
+}
+
+/*
+ * Return the segment number of a relocatable vector, or NO_SEG for
+ * simple scalars.
+ */
+int32_t reloc_seg(expr * vect)
+{
+    while (vect->type && (vect->type == EXPR_WRT || !vect->value))
+        vect++;
+    if (vect->type == EXPR_SIMPLE) {
+        do {
+            vect++;
+        } while (vect->type && (vect->type == EXPR_WRT || !vect->value));
+    }
+    if (!vect->type)
+        return NO_SEG;
+    else
+        return vect->type - EXPR_SEGBASE;
+}
+
+/*
+ * Return the WRT segment number of a relocatable vector, or NO_SEG
+ * if no WRT part is present.
+ */
+int32_t reloc_wrt(expr * vect)
+{
+    while (vect->type && vect->type < EXPR_WRT)
+        vect++;
+    if (vect->type == EXPR_WRT) {
+        return vect->value;
+    } else
+        return NO_SEG;
+}
diff --git a/float.c b/float.c
new file mode 100644 (file)
index 0000000..7a4f8cb
--- /dev/null
+++ b/float.c
@@ -0,0 +1,956 @@
+/* ----------------------------------------------------------------------- *
+ *
+ *   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.
+ *
+ * ----------------------------------------------------------------------- */
+
+/*
+ * float.c     floating-point constant support for the Netwide Assembler
+ */
+
+#include "compiler.h"
+
+#include <ctype.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <inttypes.h>
+
+#include "nasm.h"
+#include "float.h"
+
+/*
+ * -----------------
+ *  local variables
+ * -----------------
+ */
+static efunc error;
+static bool daz = false;        /* denormals as zero */
+static enum float_round rc = FLOAT_RC_NEAR;     /* rounding control */
+
+/*
+ * -----------
+ *  constants
+ * -----------
+ */
+
+/* "A limb is like a digit but bigger */
+typedef uint32_t fp_limb;
+typedef uint64_t fp_2limb;
+
+#define LIMB_BITS       32
+#define LIMB_BYTES      (LIMB_BITS/8)
+#define LIMB_TOP_BIT    ((fp_limb)1 << (LIMB_BITS-1))
+#define LIMB_MASK       ((fp_limb)(~0))
+#define LIMB_ALL_BYTES  ((fp_limb)0x01010101)
+#define LIMB_BYTE(x)    ((x)*LIMB_ALL_BYTES)
+
+/* 112 bits + 64 bits for accuracy + 16 bits for rounding */
+#define MANT_LIMBS 6
+
+/* 52 digits fit in 176 bits because 10^53 > 2^176 > 10^52 */
+#define MANT_DIGITS 52
+
+/* the format and the argument list depend on MANT_LIMBS */
+#define MANT_FMT "%08x_%08x_%08x_%08x_%08x_%08x"
+#define MANT_ARG SOME_ARG(mant, 0)
+
+#define SOME_ARG(a,i) (a)[(i)+0], (a)[(i)+1], (a)[(i)+2], \
+                      (a)[(i)+3], (a)[(i)+4], (a)[(i)+5]
+
+/*
+ * ---------------------------------------------------------------------------
+ *  emit a printf()-like debug message... but only if DEBUG_FLOAT was defined
+ * ---------------------------------------------------------------------------
+ */
+
+#ifdef DEBUG_FLOAT
+#define dprintf(x) printf x
+#else
+#define dprintf(x) do { } while (0)
+#endif
+
+/*
+ * ---------------------------------------------------------------------------
+ *  multiply
+ * ---------------------------------------------------------------------------
+ */
+static int float_multiply(fp_limb *to, fp_limb *from)
+{
+    fp_2limb temp[MANT_LIMBS * 2];
+    int i, j;
+
+    /*
+     * guaranteed that top bit of 'from' is set -- so we only have
+     * to worry about _one_ bit shift to the left
+     */
+    dprintf(("%s=" MANT_FMT "\n", "mul1", SOME_ARG(to, 0)));
+    dprintf(("%s=" MANT_FMT "\n", "mul2", SOME_ARG(from, 0)));
+
+    memset(temp, 0, sizeof temp);
+
+    for (i = 0; i < MANT_LIMBS; i++) {
+        for (j = 0; j < MANT_LIMBS; j++) {
+            fp_2limb n;
+            n = (fp_2limb) to[i] * (fp_2limb) from[j];
+            temp[i + j] += n >> LIMB_BITS;
+            temp[i + j + 1] += (fp_limb)n;
+        }
+    }
+
+    for (i = MANT_LIMBS * 2; --i;) {
+        temp[i - 1] += temp[i] >> LIMB_BITS;
+        temp[i] &= LIMB_MASK;
+    }
+
+    dprintf(("%s=" MANT_FMT "_" MANT_FMT "\n", "temp", SOME_ARG(temp, 0),
+             SOME_ARG(temp, MANT_LIMBS)));
+
+    if (temp[0] & LIMB_TOP_BIT) {
+        for (i = 0; i < MANT_LIMBS; i++) {
+            to[i] = temp[i] & LIMB_MASK;
+        }
+        dprintf(("%s=" MANT_FMT " (%i)\n", "prod", SOME_ARG(to, 0), 0));
+        return 0;
+    } else {
+        for (i = 0; i < MANT_LIMBS; i++) {
+            to[i] = (temp[i] << 1) + !!(temp[i + 1] & LIMB_TOP_BIT);
+        }
+        dprintf(("%s=" MANT_FMT " (%i)\n", "prod", SOME_ARG(to, 0), -1));
+        return -1;
+    }
+}
+
+/*
+ * ---------------------------------------------------------------------------
+ *  read an exponent; returns INT32_MAX on error
+ * ---------------------------------------------------------------------------
+ */
+static int32_t read_exponent(const char *string, int32_t max)
+{
+    int32_t i = 0;
+    bool neg = false;
+
+    if (*string == '+') {
+        string++;
+    } else if (*string == '-') {
+        neg = true;
+        string++;
+    }
+    while (*string) {
+        if (*string >= '0' && *string <= '9') {
+            i = (i * 10) + (*string - '0');
+
+            /*
+             * To ensure that underflows and overflows are
+             * handled properly we must avoid wraparounds of
+             * the signed integer value that is used to hold
+             * the exponent. Therefore we cap the exponent at
+             * +/-5000, which is slightly more/less than
+             * what's required for normal and denormal numbers
+             * in single, double, and extended precision, but
+             * sufficient to avoid signed integer wraparound.
+             */
+            if (i > max)
+                i = max;
+        } else if (*string == '_') {
+            /* do nothing */
+        } else {
+            error(ERR_NONFATAL|ERR_PASS1,
+                  "invalid character in floating-point constant %s: '%c'",
+                  "exponent", *string);
+            return INT32_MAX;
+        }
+        string++;
+    }
+
+    return neg ? -i : i;
+}
+
+/*
+ * ---------------------------------------------------------------------------
+ *  convert
+ * ---------------------------------------------------------------------------
+ */
+static bool ieee_flconvert(const char *string, fp_limb *mant,
+                           int32_t * exponent)
+{
+    char digits[MANT_DIGITS];
+    char *p, *q, *r;
+    fp_limb mult[MANT_LIMBS], bit;
+    fp_limb *m;
+    int32_t tenpwr, twopwr;
+    int32_t extratwos;
+    bool started, seendot, warned;
+
+    warned = false;
+    p = digits;
+    tenpwr = 0;
+    started = seendot = false;
+
+    while (*string && *string != 'E' && *string != 'e') {
+        if (*string == '.') {
+            if (!seendot) {
+                seendot = true;
+            } else {
+                error(ERR_NONFATAL|ERR_PASS1,
+                      "too many periods in floating-point constant");
+                return false;
+            }
+        } else if (*string >= '0' && *string <= '9') {
+            if (*string == '0' && !started) {
+                if (seendot) {
+                    tenpwr--;
+                }
+            } else {
+                started = true;
+                if (p < digits + sizeof(digits)) {
+                    *p++ = *string - '0';
+                } else {
+                    if (!warned) {
+                        error(ERR_WARNING|ERR_WARN_FL_TOOLONG|ERR_PASS1,
+                              "floating-point constant significand contains "
+                              "more than %i digits", MANT_DIGITS);
+                        warned = true;
+                    }
+                }
+                if (!seendot) {
+                    tenpwr++;
+                }
+            }
+        } else if (*string == '_') {
+            /* do nothing */
+        } else {
+            error(ERR_NONFATAL|ERR_PASS1,
+                  "invalid character in floating-point constant %s: '%c'",
+                  "significand", *string);
+            return false;
+        }
+        string++;
+    }
+
+    if (*string) {
+        int32_t e;
+
+        string++;               /* eat the E */
+        e = read_exponent(string, 5000);
+        if (e == INT32_MAX)
+            return false;
+        tenpwr += e;
+    }
+
+    /*
+     * At this point, the memory interval [digits,p) contains a
+     * series of decimal digits zzzzzzz, such that our number X
+     * satisfies X = 0.zzzzzzz * 10^tenpwr.
+     */
+    q = digits;
+    dprintf(("X = 0."));
+    while (q < p) {
+        dprintf(("%c", *q + '0'));
+        q++;
+    }
+    dprintf((" * 10^%i\n", tenpwr));
+
+    /*
+     * Now convert [digits,p) to our internal representation.
+     */
+    bit = LIMB_TOP_BIT;
+    for (m = mant; m < mant + MANT_LIMBS; m++) {
+        *m = 0;
+    }
+    m = mant;
+    q = digits;
+    started = false;
+    twopwr = 0;
+    while (m < mant + MANT_LIMBS) {
+        fp_limb carry = 0;
+        while (p > q && !p[-1]) {
+            p--;
+        }
+        if (p <= q) {
+            break;
+        }
+        for (r = p; r-- > q;) {
+            int32_t i;
+            i = 2 * *r + carry;
+            if (i >= 10) {
+                carry = 1;
+                i -= 10;
+            } else {
+                carry = 0;
+            }
+            *r = i;
+        }
+        if (carry) {
+            *m |= bit;
+            started = true;
+        }
+        if (started) {
+            if (bit == 1) {
+                bit = LIMB_TOP_BIT;
+                m++;
+            } else {
+                bit >>= 1;
+            }
+        } else {
+            twopwr--;
+        }
+    }
+    twopwr += tenpwr;
+
+    /*
+     * At this point, the 'mant' array contains the first frac-
+     * tional places of a base-2^16 real number which when mul-
+     * tiplied by 2^twopwr and 5^tenpwr gives X.
+     */
+    dprintf(("X = " MANT_FMT " * 2^%i * 5^%i\n", MANT_ARG, twopwr,
+             tenpwr));
+
+    /*
+     * Now multiply 'mant' by 5^tenpwr.
+     */
+    if (tenpwr < 0) {           /* mult = 5^-1 = 0.2 */
+        for (m = mult; m < mult + MANT_LIMBS - 1; m++) {
+            *m = LIMB_BYTE(0xcc);
+        }
+        mult[MANT_LIMBS - 1] = LIMB_BYTE(0xcc)+1;
+        extratwos = -2;
+        tenpwr = -tenpwr;
+
+        /*
+         * If tenpwr was 1000...000b, then it becomes 1000...000b. See
+         * the "ANSI C" comment below for more details on that case.
+         *
+         * Because we already truncated tenpwr to +5000...-5000 inside
+         * the exponent parsing code, this shouldn't happen though.
+         */
+    } else if (tenpwr > 0) {    /* mult = 5^+1 = 5.0 */
+        mult[0] = (fp_limb)5 << (LIMB_BITS-3); /* 0xA000... */
+        for (m = mult + 1; m < mult + MANT_LIMBS; m++) {
+            *m = 0;
+        }
+        extratwos = 3;
+    } else {
+        extratwos = 0;
+    }
+    while (tenpwr) {
+        dprintf(("loop=" MANT_FMT " * 2^%i * 5^%i (%i)\n", MANT_ARG,
+                 twopwr, tenpwr, extratwos));
+        if (tenpwr & 1) {
+            dprintf(("mant*mult\n"));
+            twopwr += extratwos + float_multiply(mant, mult);
+        }
+        dprintf(("mult*mult\n"));
+        extratwos = extratwos * 2 + float_multiply(mult, mult);
+        tenpwr >>= 1;
+
+        /*
+         * In ANSI C, the result of right-shifting a signed integer is
+         * considered implementation-specific. To ensure that the loop
+         * terminates even if tenpwr was 1000...000b to begin with, we
+         * manually clear the MSB, in case a 1 was shifted in.
+         *
+         * Because we already truncated tenpwr to +5000...-5000 inside
+         * the exponent parsing code, this shouldn't matter; neverthe-
+         * less it is the right thing to do here.
+         */
+        tenpwr &= (uint32_t) - 1 >> 1;
+    }
+
+    /*
+     * At this point, the 'mant' array contains the first frac-
+     * tional places of a base-2^16 real number in [0.5,1) that
+     * when multiplied by 2^twopwr gives X. Or it contains zero
+     * of course. We are done.
+     */
+    *exponent = twopwr;
+    return true;
+}
+
+/*
+ * ---------------------------------------------------------------------------
+ *  operations of specific bits
+ * ---------------------------------------------------------------------------
+ */
+
+/* Set a bit, using *bigendian* bit numbering (0 = MSB) */
+static void set_bit(fp_limb *mant, int bit)
+{
+    mant[bit/LIMB_BITS] |= LIMB_TOP_BIT >> (bit & (LIMB_BITS-1));
+}
+
+/* Test a single bit */
+static int test_bit(const fp_limb *mant, int bit)
+{
+    return (mant[bit/LIMB_BITS] >> (~bit & (LIMB_BITS-1))) & 1;
+}
+
+/* Report if the mantissa value is all zero */
+static bool is_zero(const fp_limb *mant)
+{
+    int i;
+
+    for (i = 0; i < MANT_LIMBS; i++)
+        if (mant[i])
+            return false;
+
+    return true;
+}
+
+/*
+ * ---------------------------------------------------------------------------
+ *  round a mantissa off after i words
+ * ---------------------------------------------------------------------------
+ */
+
+#define ROUND_COLLECT_BITS                      \
+    do {                                        \
+        m = mant[i] & (2*bit-1);                \
+        for (j = i+1; j < MANT_LIMBS; j++)      \
+            m = m | mant[j];                    \
+    } while (0)
+
+#define ROUND_ABS_DOWN                          \
+    do {                                        \
+        mant[i] &= ~(bit-1);                    \
+        for (j = i+1; j < MANT_LIMBS; j++)      \
+            mant[j] = 0;                        \
+        return false;                           \
+    } while (0)
+
+#define ROUND_ABS_UP                            \
+    do {                                        \
+        mant[i] = (mant[i] & ~(bit-1)) + bit;   \
+        for (j = i+1; j < MANT_LIMBS; j++)      \
+            mant[j] = 0;                        \
+        while (i > 0 && !mant[i])               \
+            ++mant[--i];                        \
+        return !mant[0];                        \
+    } while (0)
+
+static bool ieee_round(bool minus, fp_limb *mant, int bits)
+{
+    fp_limb m = 0;
+    int32_t j;
+    int i = bits / LIMB_BITS;
+    int p = bits % LIMB_BITS;
+    fp_limb bit = LIMB_TOP_BIT >> p;
+
+    if (rc == FLOAT_RC_NEAR) {
+        if (mant[i] & bit) {
+            mant[i] &= ~bit;
+            ROUND_COLLECT_BITS;
+            mant[i] |= bit;
+            if (m) {
+                ROUND_ABS_UP;
+            } else {
+                if (test_bit(mant, bits-1)) {
+                    ROUND_ABS_UP;
+                } else {
+                    ROUND_ABS_DOWN;
+                }
+            }
+        } else {
+            ROUND_ABS_DOWN;
+        }
+    } else if (rc == FLOAT_RC_ZERO ||
+               rc == (minus ? FLOAT_RC_UP : FLOAT_RC_DOWN)) {
+        ROUND_ABS_DOWN;
+    } else {
+        /* rc == (minus ? FLOAT_RC_DOWN : FLOAT_RC_UP) */
+        /* Round toward +/- infinity */
+        ROUND_COLLECT_BITS;
+        if (m) {
+            ROUND_ABS_UP;
+        } else {
+            ROUND_ABS_DOWN;
+        }
+    }
+    return false;
+}
+
+/* Returns a value >= 16 if not a valid hex digit */
+static unsigned int hexval(char c)
+{
+    unsigned int v = (unsigned char) c;
+
+    if (v >= '0' && v <= '9')
+        return v - '0';
+    else
+        return (v|0x20) - 'a' + 10;
+}
+
+/* Handle floating-point numbers with radix 2^bits and binary exponent */
+static bool ieee_flconvert_bin(const char *string, int bits,
+                               fp_limb *mant, int32_t *exponent)
+{
+    static const int log2tbl[16] =
+        { -1, 0, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 3 };
+    fp_limb mult[MANT_LIMBS + 1], *mp;
+    int ms;
+    int32_t twopwr;
+    bool seendot, seendigit;
+    unsigned char c;
+    const int radix = 1 << bits;
+    fp_limb v;
+
+    twopwr = 0;
+    seendot = seendigit = false;
+    ms = 0;
+    mp = NULL;
+
+    memset(mult, 0, sizeof mult);
+
+    while ((c = *string++) != '\0') {
+        if (c == '.') {
+            if (!seendot)
+                seendot = true;
+            else {
+                error(ERR_NONFATAL|ERR_PASS1,
+                      "too many periods in floating-point constant");
+                return false;
+            }
+        } else if ((v = hexval(c)) < (unsigned int)radix) {
+            if (!seendigit && v) {
+                int l = log2tbl[v];
+
+                seendigit = true;
+                mp = mult;
+                ms = (LIMB_BITS-1)-l;
+
+                twopwr = seendot ? twopwr-bits+l : l+1-bits;
+            }
+
+            if (seendigit) {
+                if (ms <= 0) {
+                    *mp |= v >> -ms;
+                    mp++;
+                    if (mp > &mult[MANT_LIMBS])
+                        mp = &mult[MANT_LIMBS]; /* Guard slot */
+                    ms += LIMB_BITS;
+                }
+                *mp |= v << ms;
+                ms -= bits;
+
+                if (!seendot)
+                    twopwr += bits;
+            } else {
+                if (seendot)
+                    twopwr -= bits;
+            }
+        } else if (c == 'p' || c == 'P') {
+            int32_t e;
+            e = read_exponent(string, 20000);
+            if (e == INT32_MAX)
+                return false;
+            twopwr += e;
+            break;
+        } else if (c == '_') {
+            /* ignore */
+        } else {
+            error(ERR_NONFATAL|ERR_PASS1,
+                  "floating-point constant: `%c' is invalid character", c);
+            return false;
+        }
+    }
+
+    if (!seendigit) {
+        memset(mant, 0, MANT_LIMBS*sizeof(fp_limb)); /* Zero */
+        *exponent = 0;
+    } else {
+        memcpy(mant, mult, MANT_LIMBS*sizeof(fp_limb));
+        *exponent = twopwr;
+    }
+
+    return true;
+}
+
+/*
+ * Shift a mantissa to the right by i bits.
+ */
+static void ieee_shr(fp_limb *mant, int i)
+{
+    fp_limb n, m;
+    int j = 0;
+    int sr, sl, offs;
+
+    sr = i % LIMB_BITS; sl = LIMB_BITS-sr;
+    offs = i/LIMB_BITS;
+
+    if (sr == 0) {
+        if (offs)
+            for (j = MANT_LIMBS-1; j >= offs; j--)
+                mant[j] = mant[j-offs];
+    } else {
+        n = mant[MANT_LIMBS-1-offs] >> sr;
+        for (j = MANT_LIMBS-1; j > offs; j--) {
+            m = mant[j-offs-1];
+            mant[j] = (m << sl) | n;
+            n = m >> sr;
+        }
+        mant[j--] = n;
+    }
+    while (j >= 0)
+        mant[j--] = 0;
+}
+
+/* Produce standard IEEE formats, with implicit or explicit integer
+   bit; this makes the following assumptions:
+
+   - the sign bit is the MSB, followed by the exponent,
+     followed by the integer bit if present.
+   - the sign bit plus exponent fit in 16 bits.
+   - the exponent bias is 2^(n-1)-1 for an n-bit exponent */
+
+struct ieee_format {
+    int bytes;
+    int mantissa;               /* Fractional bits in the mantissa */
+    int explicit;               /* Explicit integer */
+    int exponent;               /* Bits in the exponent */
+};
+
+/*
+ * The 16- and 128-bit formats are expected to be in IEEE 754r.
+ * AMD SSE5 uses the 16-bit format.
+ *
+ * The 32- and 64-bit formats are the original IEEE 754 formats.
+ *
+ * The 80-bit format is x87-specific, but widely used.
+ *
+ * The 8-bit format appears to be the consensus 8-bit floating-point
+ * format.  It is apparently used in graphics applications.
+ */
+static const struct ieee_format ieee_8   = {  1,   3, 0,  4 };
+static const struct ieee_format ieee_16  = {  2,  10, 0,  5 };
+static const struct ieee_format ieee_32  = {  4,  23, 0,  8 };
+static const struct ieee_format ieee_64  = {  8,  52, 0, 11 };
+static const struct ieee_format ieee_80  = { 10,  63, 1, 15 };
+static const struct ieee_format ieee_128 = { 16, 112, 0, 15 };
+
+/* Types of values we can generate */
+enum floats {
+    FL_ZERO,
+    FL_DENORMAL,
+    FL_NORMAL,
+    FL_INFINITY,
+    FL_QNAN,
+    FL_SNAN
+};
+
+static int to_packed_bcd(const char *str, const char *p,
+                         int s, uint8_t *result,
+                         const struct ieee_format *fmt)
+{
+    int n = 0;
+    char c;
+    int tv = -1;
+
+    if (fmt != &ieee_80) {
+        error(ERR_NONFATAL|ERR_PASS1,
+              "packed BCD requires an 80-bit format");
+        return 0;
+    }
+
+    while (p >= str) {
+        c = *p--;
+        if (c >= '0' && c <= '9') {
+            if (tv < 0) {
+                if (n == 9) {
+                    error(ERR_WARNING|ERR_PASS1,
+                          "packed BCD truncated to 18 digits");
+                }
+                tv = c-'0';
+            } else {
+                if (n < 9)
+                    *result++ = tv + ((c-'0') << 4);
+                n++;
+                tv = -1;
+            }
+        } else if (c == '_') {
+            /* do nothing */
+        } else {
+            error(ERR_NONFATAL|ERR_PASS1,
+                  "invalid character `%c' in packed BCD constant", c);
+            return 0;
+        }
+    }
+    if (tv >= 0) {
+        if (n < 9)
+            *result++ = tv;
+        n++;
+    }
+    while (n < 9) {
+        *result++ = 0;
+        n++;
+    }
+    *result = (s < 0) ? 0x80 : 0;
+
+    return 1;                   /* success */
+}
+
+static int to_float(const char *str, int s, uint8_t *result,
+                    const struct ieee_format *fmt)
+{
+    fp_limb mant[MANT_LIMBS];
+    int32_t exponent = 0;
+    const int32_t expmax = 1 << (fmt->exponent - 1);
+    fp_limb one_mask = LIMB_TOP_BIT >>
+        ((fmt->exponent+fmt->explicit) % LIMB_BITS);
+    const int one_pos = (fmt->exponent+fmt->explicit)/LIMB_BITS;
+    int i;
+    int shift;
+    enum floats type;
+    bool ok;
+    const bool minus = s < 0;
+    const int bits = fmt->bytes * 8;
+    const char *strend;
+
+    if (!str[0]) {
+        error(ERR_PANIC,
+              "internal errror: empty string passed to float_const");
+        return 0;
+    }
+
+    strend = strchr(str, '\0');
+    if (strend[-1] == 'P' || strend[-1] == 'p')
+        return to_packed_bcd(str, strend-2, s, result, fmt);
+
+    if (str[0] == '_') {
+        /* Special tokens */
+
+        switch (str[2]) {
+        case 'n':              /* __nan__ */
+        case 'N':
+        case 'q':              /* __qnan__ */
+        case 'Q':
+            type = FL_QNAN;
+            break;
+        case 's':              /* __snan__ */
+        case 'S':
+            type = FL_SNAN;
+            break;
+        case 'i':              /* __infinity__ */
+        case 'I':
+            type = FL_INFINITY;
+            break;
+        default:
+            error(ERR_NONFATAL|ERR_PASS1,
+                  "internal error: unknown FP constant token `%s'\n", str);
+            type = FL_QNAN;
+            break;
+        }
+    } else {
+        if (str[0] == '0') {
+            switch (str[1]) {
+            case 'x': case 'X':
+            case 'h': case 'H':
+                ok = ieee_flconvert_bin(str+2, 4, mant, &exponent);
+                break;
+            case 'o': case 'O':
+            case 'q': case 'Q':
+                ok = ieee_flconvert_bin(str+2, 3, mant, &exponent);
+                break;
+            case 'b': case 'B':
+            case 'y': case 'Y':
+                ok = ieee_flconvert_bin(str+2, 1, mant, &exponent);
+                break;
+            case 'd': case 'D':
+            case 't': case 'T':
+                ok = ieee_flconvert(str+2, mant, &exponent);
+                break;
+            case 'p': case 'P':
+                return to_packed_bcd(str+2, strend-1, s, result, fmt);
+            default:
+                /* Leading zero was just a zero? */
+                ok = ieee_flconvert(str, mant, &exponent);
+                break;
+            }
+        } else if (str[0] == '$') {
+            ok = ieee_flconvert_bin(str+1, 4, mant, &exponent);
+        } else {
+            ok = ieee_flconvert(str, mant, &exponent);
+        }
+
+        if (!ok) {
+            type = FL_QNAN;
+        } else if (mant[0] & LIMB_TOP_BIT) {
+            /*
+             * Non-zero.
+             */
+            exponent--;
+            if (exponent >= 2 - expmax && exponent <= expmax) {
+                type = FL_NORMAL;
+            } else if (exponent > 0) {
+                if (pass0 == 1)
+                    error(ERR_WARNING|ERR_WARN_FL_OVERFLOW|ERR_PASS1,
+                          "overflow in floating-point constant");
+                type = FL_INFINITY;
+            } else {
+                /* underflow or denormal; the denormal code handles
+                   actual underflow. */
+                type = FL_DENORMAL;
+            }
+        } else {
+            /* Zero */
+            type = FL_ZERO;
+        }
+    }
+
+    switch (type) {
+    case FL_ZERO:
+    zero:
+        memset(mant, 0, sizeof mant);
+        break;
+
+    case FL_DENORMAL:
+    {
+        shift = -(exponent + expmax - 2 - fmt->exponent)
+            + fmt->explicit;
+        ieee_shr(mant, shift);
+        ieee_round(minus, mant, bits);
+        if (mant[one_pos] & one_mask) {
+            /* One's position is set, we rounded up into normal range */
+            exponent = 1;
+            if (!fmt->explicit)
+                mant[one_pos] &= ~one_mask;     /* remove explicit one */
+            mant[0] |= exponent << (LIMB_BITS-1 - fmt->exponent);
+        } else {
+            if (daz || is_zero(mant)) {
+                /* Flush denormals to zero */
+                error(ERR_WARNING|ERR_WARN_FL_UNDERFLOW|ERR_PASS1,
+                      "underflow in floating-point constant");
+                goto zero;
+            } else {
+                error(ERR_WARNING|ERR_WARN_FL_DENORM|ERR_PASS1,
+                      "denormal floating-point constant");
+            }
+        }
+        break;
+    }
+
+    case FL_NORMAL:
+        exponent += expmax - 1;
+        ieee_shr(mant, fmt->exponent+fmt->explicit);
+        ieee_round(minus, mant, bits);
+        /* did we scale up by one? */
+        if (test_bit(mant, fmt->exponent+fmt->explicit-1)) {
+            ieee_shr(mant, 1);
+            exponent++;
+            if (exponent >= (expmax << 1)-1) {
+                    error(ERR_WARNING|ERR_WARN_FL_OVERFLOW|ERR_PASS1,
+                          "overflow in floating-point constant");
+                type = FL_INFINITY;
+                goto overflow;
+            }
+        }
+
+        if (!fmt->explicit)
+            mant[one_pos] &= ~one_mask; /* remove explicit one */
+        mant[0] |= exponent << (LIMB_BITS-1 - fmt->exponent);
+        break;
+
+    case FL_INFINITY:
+    case FL_QNAN:
+    case FL_SNAN:
+    overflow:
+        memset(mant, 0, sizeof mant);
+        mant[0] = (((fp_limb)1 << fmt->exponent)-1)
+            << (LIMB_BITS-1 - fmt->exponent);
+        if (fmt->explicit)
+            mant[one_pos] |= one_mask;
+        if (type == FL_QNAN)
+            set_bit(mant, fmt->exponent+fmt->explicit+1);
+        else if (type == FL_SNAN)
+            set_bit(mant, fmt->exponent+fmt->explicit+fmt->mantissa);
+        break;
+    }
+
+    mant[0] |= minus ? LIMB_TOP_BIT : 0;
+
+    for (i = fmt->bytes - 1; i >= 0; i--)
+        *result++ = mant[i/LIMB_BYTES] >> (((LIMB_BYTES-1)-(i%LIMB_BYTES))*8);
+
+    return 1;                   /* success */
+}
+
+int float_const(const char *number, int sign, uint8_t *result,
+                int bytes, efunc err)
+{
+    error = err;
+
+    switch (bytes) {
+    case 1:
+        return to_float(number, sign, result, &ieee_8);
+    case 2:
+        return to_float(number, sign, result, &ieee_16);
+    case 4:
+        return to_float(number, sign, result, &ieee_32);
+    case 8:
+        return to_float(number, sign, result, &ieee_64);
+    case 10:
+        return to_float(number, sign, result, &ieee_80);
+    case 16:
+        return to_float(number, sign, result, &ieee_128);
+    default:
+        error(ERR_PANIC, "strange value %d passed to float_const", bytes);
+        return 0;
+    }
+}
+
+/* Set floating-point options */
+int float_option(const char *option)
+{
+    if (!nasm_stricmp(option, "daz")) {
+        daz = true;
+        return 0;
+    } else if (!nasm_stricmp(option, "nodaz")) {
+        daz = false;
+        return 0;
+    } else if (!nasm_stricmp(option, "near")) {
+        rc = FLOAT_RC_NEAR;
+        return 0;
+    } else if (!nasm_stricmp(option, "down")) {
+        rc = FLOAT_RC_DOWN;
+        return 0;
+    } else if (!nasm_stricmp(option, "up")) {
+        rc = FLOAT_RC_UP;
+        return 0;
+    } else if (!nasm_stricmp(option, "zero")) {
+        rc = FLOAT_RC_ZERO;
+        return 0;
+    } else if (!nasm_stricmp(option, "default")) {
+        rc = FLOAT_RC_NEAR;
+        daz = false;
+        return 0;
+    } else {
+        return -1;              /* Unknown option */
+    }
+}
diff --git a/float.h b/float.h
new file mode 100644 (file)
index 0000000..6f94cc6
--- /dev/null
+++ b/float.h
@@ -0,0 +1,55 @@
+/* ----------------------------------------------------------------------- *
+ *   
+ *   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.
+ *
+ * ----------------------------------------------------------------------- */
+
+/* 
+ * float.h   header file for the floating-point constant module of
+ *          the Netwide Assembler
+ */
+
+#ifndef NASM_FLOAT_H
+#define NASM_FLOAT_H
+
+#include "nasm.h"
+
+enum float_round {
+    FLOAT_RC_NEAR,
+    FLOAT_RC_ZERO,
+    FLOAT_RC_DOWN,
+    FLOAT_RC_UP,
+};
+
+int float_const(const char *string, int sign, uint8_t *result, int bytes,
+                efunc error);
+int float_option(const char *option);
+
+#endif
diff --git a/hashtbl.c b/hashtbl.c
new file mode 100644 (file)
index 0000000..348bc40
--- /dev/null
+++ b/hashtbl.c
@@ -0,0 +1,233 @@
+/* ----------------------------------------------------------------------- *
+ *
+ *   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.
+ *
+ * ----------------------------------------------------------------------- */
+
+/*
+ * hashtbl.c
+ *
+ * Efficient dictionary hash table class.
+ */
+
+#include "compiler.h"
+
+#include <inttypes.h>
+#include <string.h>
+#include "nasm.h"
+#include "hashtbl.h"
+
+#define HASH_MAX_LOAD   2 /* Higher = more memory-efficient, slower */
+
+#define hash_calc(key)          crc64(CRC64_INIT, (key))
+#define hash_calci(key)         crc64i(CRC64_INIT, (key))
+#define hash_max_load(size)     ((size) * (HASH_MAX_LOAD - 1) / HASH_MAX_LOAD)
+#define hash_expand(size)       ((size) << 1)
+#define hash_mask(size)         ((size) - 1)
+#define hash_pos(hash, mask)    ((hash) & (mask))
+#define hash_inc(hash, mask)    ((((hash) >> 32) & (mask)) | 1) /* always odd */
+#define hash_pos_next(pos, inc, mask) (((pos) + (inc)) & (mask))
+
+static struct hash_tbl_node *alloc_table(size_t newsize)
+{
+    size_t bytes = newsize * sizeof(struct hash_tbl_node);
+    return nasm_zalloc(bytes);
+}
+
+void hash_init(struct hash_table *head, size_t size)
+{
+    nasm_assert(is_power2(size));
+    head->table    = alloc_table(size);
+    head->load     = 0;
+    head->size     = size;
+    head->max_load = hash_max_load(size);
+}
+
+/*
+ * Find an entry in a hash table.
+ *
+ * On failure, if "insert" is non-NULL, store data in that structure
+ * which can be used to insert that node using hash_add().
+ *
+ * WARNING: this data is only valid until the very next call of
+ * hash_add(); it cannot be "saved" to a later date.
+ *
+ * On success, return a pointer to the "data" element of the hash
+ * structure.
+ */
+void **hash_find(struct hash_table *head, const char *key,
+                 struct hash_insert *insert)
+{
+    struct hash_tbl_node *np;
+    struct hash_tbl_node *tbl = head->table;
+    uint64_t hash = hash_calc(key);
+    size_t mask = hash_mask(head->size);
+    size_t pos = hash_pos(hash, mask);
+    size_t inc = hash_inc(hash, mask);
+
+    while ((np = &tbl[pos])->key) {
+        if (hash == np->hash && !strcmp(key, np->key))
+            return &np->data;
+        pos = hash_pos_next(pos, inc, mask);
+    }
+
+    /* Not found.  Store info for insert if requested. */
+    if (insert) {
+        insert->head  = head;
+        insert->hash  = hash;
+        insert->where = np;
+    }
+    return NULL;
+}
+
+/*
+ * Same as hash_find, but for case-insensitive hashing.
+ */
+void **hash_findi(struct hash_table *head, const char *key,
+                  struct hash_insert *insert)
+{
+    struct hash_tbl_node *np;
+    struct hash_tbl_node *tbl = head->table;
+    uint64_t hash = hash_calci(key);
+    size_t mask = hash_mask(head->size);
+    size_t pos = hash_pos(hash, mask);
+    size_t inc = hash_inc(hash, mask);
+
+    while ((np = &tbl[pos])->key) {
+        if (hash == np->hash && !nasm_stricmp(key, np->key))
+            return &np->data;
+        pos = hash_pos_next(pos, inc, mask);
+    }
+
+    /* Not found.  Store info for insert if requested. */
+    if (insert) {
+        insert->head  = head;
+        insert->hash  = hash;
+        insert->where = np;
+    }
+    return NULL;
+}
+
+/*
+ * Insert node.  Return a pointer to the "data" element of the newly
+ * created hash node.
+ */
+void **hash_add(struct hash_insert *insert, const char *key, void *data)
+{
+    struct hash_table *head  = insert->head;
+    struct hash_tbl_node *np = insert->where;
+
+    /*
+     * Insert node.  We can always do this, even if we need to
+     * rebalance immediately after.
+     */
+    np->hash = insert->hash;
+    np->key  = key;
+    np->data = data;
+
+    if (++head->load > head->max_load) {
+        /* Need to expand the table */
+        size_t newsize                  = hash_expand(head->size);
+        struct hash_tbl_node *newtbl    = alloc_table(newsize);
+        size_t mask                     = hash_mask(newsize);
+
+        if (head->table) {
+            struct hash_tbl_node *op, *xp;
+            size_t i;
+
+            /* Rebalance all the entries */
+            for (i = 0, op = head->table; i < head->size; i++, op++) {
+                if (op->key) {
+                    size_t pos = hash_pos(op->hash, mask);
+                    size_t inc = hash_inc(op->hash, mask);
+
+                    while ((xp = &newtbl[pos])->key)
+                        pos = hash_pos_next(pos, inc, mask);
+
+                    *xp = *op;
+                    if (op == np)
+                        np = xp;
+                }
+            }
+            nasm_free(head->table);
+        }
+
+        head->table    = newtbl;
+        head->size     = newsize;
+        head->max_load = hash_max_load(newsize);
+    }
+
+    return &np->data;
+}
+
+/*
+ * Iterate over all members of a hash set.  For the first call,
+ * iterator should be initialized to NULL.  Returns the data pointer,
+ * or NULL on failure.
+ */
+void *hash_iterate(const struct hash_table *head,
+                   struct hash_tbl_node **iterator,
+                   const char **key)
+{
+    struct hash_tbl_node *np = *iterator;
+    struct hash_tbl_node *ep = head->table + head->size;
+
+    if (!np) {
+        np = head->table;
+        if (!np)
+            return NULL;        /* Uninitialized table */
+    }
+
+    while (np < ep) {
+        if (np->key) {
+            *iterator = np + 1;
+            if (key)
+                *key = np->key;
+            return np->data;
+        }
+        np++;
+    }
+
+    *iterator = NULL;
+    if (key)
+        *key = NULL;
+    return NULL;
+}
+
+/*
+ * Free the hash itself.  Doesn't free the data elements; use
+ * hash_iterate() to do that first, if needed.
+ */
+void hash_free(struct hash_table *head)
+{
+    void *p = head->table;
+    head->table = NULL;
+    nasm_free(p);
+}
diff --git a/hashtbl.h b/hashtbl.h
new file mode 100644 (file)
index 0000000..dd00ddb
--- /dev/null
+++ b/hashtbl.h
@@ -0,0 +1,86 @@
+/* ----------------------------------------------------------------------- *
+ *   
+ *   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.
+ *
+ * ----------------------------------------------------------------------- */
+
+/*
+ * hashtbl.h
+ *
+ * Efficient dictionary hash table class.
+ */
+
+#ifndef NASM_HASHTBL_H
+#define NASM_HASHTBL_H
+
+#include <inttypes.h>
+#include <stddef.h>
+#include "nasmlib.h"
+
+struct hash_tbl_node {
+    uint64_t hash;
+    const char *key;
+    void *data;
+};
+
+struct hash_table {
+    struct hash_tbl_node *table;
+    size_t load;
+    size_t size;
+    size_t max_load;
+};
+
+struct hash_insert {
+    uint64_t hash;
+    struct hash_table *head;
+    struct hash_tbl_node *where;
+};
+
+uint64_t crc64(uint64_t crc, const char *string);
+uint64_t crc64i(uint64_t crc, const char *string);
+#define CRC64_INIT UINT64_C(0xffffffffffffffff)
+
+/* Some reasonable initial sizes... */
+#define HASH_SMALL     4
+#define HASH_MEDIUM    16
+#define HASH_LARGE     256
+
+void hash_init(struct hash_table *head, size_t size);
+void **hash_find(struct hash_table *head, const char *string,
+               struct hash_insert *insert);
+void **hash_findi(struct hash_table *head, const char *string,
+               struct hash_insert *insert);
+void **hash_add(struct hash_insert *insert, const char *string, void *data);
+void *hash_iterate(const struct hash_table *head,
+                  struct hash_tbl_node **iterator,
+                  const char **key);
+void hash_free(struct hash_table *head);
+
+#endif /* NASM_HASHTBL_H */
diff --git a/headers/c b/headers/c
new file mode 100644 (file)
index 0000000..7ceab01
--- /dev/null
+++ b/headers/c
@@ -0,0 +1,33 @@
+/* ----------------------------------------------------------------------- *
+ *
+ *   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.
+ *
+ * ----------------------------------------------------------------------- */
+
diff --git a/headers/doc b/headers/doc
new file mode 100644 (file)
index 0000000..38ab133
--- /dev/null
@@ -0,0 +1,33 @@
+\# --------------------------------------------------------------------------
+\#   
+\#   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.
+\#
+\# --------------------------------------------------------------------------
+
diff --git a/headers/mac b/headers/mac
new file mode 100644 (file)
index 0000000..b68288f
--- /dev/null
@@ -0,0 +1,33 @@
+;; --------------------------------------------------------------------------
+;;   
+;;   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.
+;;
+;; --------------------------------------------------------------------------
+
diff --git a/headers/perl b/headers/perl
new file mode 100644 (file)
index 0000000..2317088
--- /dev/null
@@ -0,0 +1,33 @@
+## --------------------------------------------------------------------------
+##   
+##   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.
+##
+## --------------------------------------------------------------------------
+
diff --git a/insns.dat b/insns.dat
new file mode 100644 (file)
index 0000000..2873652
--- /dev/null
+++ b/insns.dat
@@ -0,0 +1,3243 @@
+;; --------------------------------------------------------------------------
+;;
+;;   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.
+;;
+;; --------------------------------------------------------------------------
+
+;
+; insns.dat    table of instructions for the Netwide Assembler
+;
+; Format of file: All four fields must be present on every functional
+; line. Hence `void' for no-operand instructions, and `\0' for such
+; as EQU. If the last three fields are all `ignore', no action is
+; taken except to register the opcode as being present.
+;
+; For a detailed description of the code string (third field), please
+; see the comment at the top of assemble.c.  For a detailed description
+; of the flags (fourth field), please see insns.h.
+;
+; Comments with a pound sign after the semicolon generate section
+; subheaders in the NASM documentation.
+;
+
+;# Special instructions...
+DB             ignore                          ignore                                          ignore
+DW             ignore                          ignore                                          ignore
+DD             ignore                          ignore                                          ignore
+DQ             ignore                          ignore                                          ignore
+DT             ignore                          ignore                                          ignore
+DO             ignore                          ignore                                          ignore
+DY             ignore                          ignore                                          ignore
+RESB           imm                             \340                                            8086
+RESW           ignore                          ignore                                          ignore
+RESD           ignore                          ignore                                          ignore
+RESQ           ignore                          ignore                                          ignore
+REST           ignore                          ignore                                          ignore
+RESO           ignore                          ignore                                          ignore
+RESY           ignore                          ignore                                          ignore
+
+;# Conventional instructions
+AAA            void                            \1\x37                                          8086,NOLONG
+AAD            void                            \2\xD5\x0A                                      8086,NOLONG
+AAD            imm                             \1\xD5\24                                       8086,SB,NOLONG
+AAM            void                            \2\xD4\x0A                                      8086,NOLONG
+AAM            imm                             \1\xD4\24                                       8086,SB,NOLONG
+AAS            void                            \1\x3F                                          8086,NOLONG
+ADC            mem,reg8                        \1\x10\101                                      8086,SM
+ADC            reg8,reg8                       \1\x10\101                                      8086
+ADC            mem,reg16                       \320\1\x11\101                                  8086,SM
+ADC            reg16,reg16                     \320\1\x11\101                                  8086
+ADC            mem,reg32                       \321\1\x11\101                                  386,SM
+ADC            reg32,reg32                     \321\1\x11\101                                  386
+ADC            mem,reg64                       \324\1\x11\101                                  X64,SM
+ADC            reg64,reg64                     \324\1\x11\101                                  X64
+ADC            reg8,mem                        \1\x12\110                                      8086,SM
+ADC            reg8,reg8                       \1\x12\110                                      8086
+ADC            reg16,mem                       \320\1\x13\110                                  8086,SM
+ADC            reg16,reg16                     \320\1\x13\110                                  8086
+ADC            reg32,mem                       \321\1\x13\110                                  386,SM
+ADC            reg32,reg32                     \321\1\x13\110                                  386
+ADC            reg64,mem                       \324\1\x13\110                                  X64,SM
+ADC            reg64,reg64                     \324\1\x13\110                                  X64
+ADC            rm16,imm8                       \320\1\x83\202\275                              8086
+ADC            rm32,imm8                       \321\1\x83\202\275                              386
+ADC            rm64,imm8                       \324\1\x83\202\275                              X64
+ADC            reg_al,imm                      \1\x14\21                                       8086,SM
+ADC            reg_ax,sbyte16                  \320\1\x83\202\275                              8086,SM
+ADC            reg_ax,imm                      \320\1\x15\31                                   8086,SM
+ADC            reg_eax,sbyte32                 \321\1\x83\202\275                              386,SM
+ADC            reg_eax,imm                     \321\1\x15\41                                   386,SM
+ADC            reg_rax,sbyte64                 \324\1\x83\202\275                              X64,SM
+ADC            reg_rax,imm                     \324\1\x15\255                                  X64,SM
+ADC            rm8,imm                         \1\x80\202\21                                   8086,SM
+ADC            rm16,imm                        \320\145\x81\202\141                            8086,SM
+ADC            rm32,imm                        \321\155\x81\202\151                            386,SM
+ADC            rm64,imm                        \324\155\x81\202\251                            X64,SM
+ADC            mem,imm8                        \1\x80\202\21                                   8086,SM
+ADC            mem,imm16                       \320\145\x81\202\141                            8086,SM
+ADC            mem,imm32                       \321\155\x81\202\151                            386,SM
+ADD            mem,reg8                        \1\x00\101                                      8086,SM
+ADD            reg8,reg8                       \1\x00\101                                      8086
+ADD            mem,reg16                       \320\1\x01\101                                  8086,SM
+ADD            reg16,reg16                     \320\1\x01\101                                  8086
+ADD            mem,reg32                       \321\1\x01\101                                  386,SM
+ADD            reg32,reg32                     \321\1\x01\101                                  386
+ADD            mem,reg64                       \324\1\x01\101                                  X64,SM
+ADD            reg64,reg64                     \324\1\x01\101                                  X64
+ADD            reg8,mem                        \1\x02\110                                      8086,SM
+ADD            reg8,reg8                       \1\x02\110                                      8086
+ADD            reg16,mem                       \320\1\x03\110                                  8086,SM
+ADD            reg16,reg16                     \320\1\x03\110                                  8086
+ADD            reg32,mem                       \321\1\x03\110                                  386,SM
+ADD            reg32,reg32                     \321\1\x03\110                                  386
+ADD            reg64,mem                       \324\1\x03\110                                  X64,SM
+ADD            reg64,reg64                     \324\1\x03\110                                  X64
+ADD            rm16,imm8                       \320\1\x83\200\275                              8086
+ADD            rm32,imm8                       \321\1\x83\200\275                              386
+ADD            rm64,imm8                       \324\1\x83\200\275                              X64
+ADD            reg_al,imm                      \1\x04\21                                       8086,SM
+ADD            reg_ax,sbyte16                  \320\1\x83\200\275                              8086,SM
+ADD            reg_ax,imm                      \320\1\x05\31                                   8086,SM
+ADD            reg_eax,sbyte32                 \321\1\x83\200\275                              386,SM
+ADD            reg_eax,imm                     \321\1\x05\41                                   386,SM
+ADD            reg_rax,sbyte64                 \324\1\x83\200\275                              X64,SM
+ADD            reg_rax,imm                     \324\1\x05\255                                  X64,SM
+ADD            rm8,imm                         \1\x80\200\21                                   8086,SM
+ADD            rm16,imm                        \320\145\x81\200\141                            8086,SM
+ADD            rm32,imm                        \321\155\x81\200\151                            386,SM
+ADD            rm64,imm                        \324\155\x81\200\251                            X64,SM
+ADD            mem,imm8                        \1\x80\200\21                                   8086,SM
+ADD            mem,imm16                       \320\145\x81\200\141                            8086,SM
+ADD            mem,imm32                       \321\155\x81\200\151                            386,SM
+AND            mem,reg8                        \1\x20\101                                      8086,SM
+AND            reg8,reg8                       \1\x20\101                                      8086
+AND            mem,reg16                       \320\1\x21\101                                  8086,SM
+AND            reg16,reg16                     \320\1\x21\101                                  8086
+AND            mem,reg32                       \321\1\x21\101                                  386,SM
+AND            reg32,reg32                     \321\1\x21\101                                  386
+AND            mem,reg64                       \324\1\x21\101                                  X64,SM
+AND            reg64,reg64                     \324\1\x21\101                                  X64
+AND            reg8,mem                        \1\x22\110                                      8086,SM
+AND            reg8,reg8                       \1\x22\110                                      8086
+AND            reg16,mem                       \320\1\x23\110                                  8086,SM
+AND            reg16,reg16                     \320\1\x23\110                                  8086
+AND            reg32,mem                       \321\1\x23\110                                  386,SM
+AND            reg32,reg32                     \321\1\x23\110                                  386
+AND            reg64,mem                       \324\1\x23\110                                  X64,SM
+AND            reg64,reg64                     \324\1\x23\110                                  X64
+AND            rm16,imm8                       \320\1\x83\204\275                              8086
+AND            rm32,imm8                       \321\1\x83\204\275                              386
+AND            rm64,imm8                       \324\1\x83\204\275                              X64
+AND            reg_al,imm                      \1\x24\21                                       8086,SM
+AND            reg_ax,sbyte16                  \320\1\x83\204\275                              8086,SM
+AND            reg_ax,imm                      \320\1\x25\31                                   8086,SM
+AND            reg_eax,sbyte32                 \321\1\x83\204\275                              386,SM
+AND            reg_eax,imm                     \321\1\x25\41                                   386,SM
+AND            reg_rax,sbyte64                 \324\1\x83\204\275                              X64,SM
+AND            reg_rax,imm                     \324\1\x25\255                                  X64,SM
+AND            rm8,imm                         \1\x80\204\21                                   8086,SM
+AND            rm16,imm                        \320\145\x81\204\141                            8086,SM
+AND            rm32,imm                        \321\155\x81\204\151                            386,SM
+AND            rm64,imm                        \324\155\x81\204\251                            X64,SM
+AND            mem,imm8                        \1\x80\204\21                                   8086,SM
+AND            mem,imm16                       \320\145\x81\204\141                            8086,SM
+AND            mem,imm32                       \321\155\x81\204\151                            386,SM
+ARPL           mem,reg16                       \1\x63\101                                      286,PROT,SM,NOLONG
+ARPL           reg16,reg16                     \1\x63\101                                      286,PROT,NOLONG
+BB0_RESET      void                            \2\x0F\x3A                                      PENT,CYRIX,ND
+BB1_RESET      void                            \2\x0F\x3B                                      PENT,CYRIX,ND
+BOUND          reg16,mem                       \320\1\x62\110                                  186,NOLONG
+BOUND          reg32,mem                       \321\1\x62\110                                  386,NOLONG
+BSF            reg16,mem                       \320\2\x0F\xBC\110                              386,SM
+BSF            reg16,reg16                     \320\2\x0F\xBC\110                              386
+BSF            reg32,mem                       \321\2\x0F\xBC\110                              386,SM
+BSF            reg32,reg32                     \321\2\x0F\xBC\110                              386
+BSF            reg64,mem                       \324\2\x0F\xBC\110                              X64,SM
+BSF            reg64,reg64                     \324\2\x0F\xBC\110                              X64
+BSR            reg16,mem                       \320\2\x0F\xBD\110                              386,SM
+BSR            reg16,reg16                     \320\2\x0F\xBD\110                              386
+BSR            reg32,mem                       \321\2\x0F\xBD\110                              386,SM
+BSR            reg32,reg32                     \321\2\x0F\xBD\110                              386
+BSR            reg64,mem                       \324\2\x0F\xBD\110                              X64,SM
+BSR            reg64,reg64                     \324\2\x0F\xBD\110                              X64
+BSWAP          reg32                           \321\1\x0F\10\xC8                               486
+BSWAP          reg64                           \324\1\x0F\10\xC8                               X64
+BT             mem,reg16                       \320\2\x0F\xA3\101                              386,SM
+BT             reg16,reg16                     \320\2\x0F\xA3\101                              386
+BT             mem,reg32                       \321\2\x0F\xA3\101                              386,SM
+BT             reg32,reg32                     \321\2\x0F\xA3\101                              386
+BT             mem,reg64                       \324\2\x0F\xA3\101                              X64,SM
+BT             reg64,reg64                     \324\2\x0F\xA3\101                              X64
+BT             rm16,imm                        \320\2\x0F\xBA\204\25                           386,SB
+BT             rm32,imm                        \321\2\x0F\xBA\204\25                           386,SB
+BT             rm64,imm                        \324\2\x0F\xBA\204\25                           X64,SB
+BTC            mem,reg16                       \320\2\x0F\xBB\101                              386,SM
+BTC            reg16,reg16                     \320\2\x0F\xBB\101                              386
+BTC            mem,reg32                       \321\2\x0F\xBB\101                              386,SM
+BTC            reg32,reg32                     \321\2\x0F\xBB\101                              386
+BTC            mem,reg64                       \324\2\x0F\xBB\101                              X64,SM
+BTC            reg64,reg64                     \324\2\x0F\xBB\101                              X64
+BTC            rm16,imm                        \320\2\x0F\xBA\207\25                           386,SB
+BTC            rm32,imm                        \321\2\x0F\xBA\207\25                           386,SB
+BTC            rm64,imm                        \324\2\x0F\xBA\207\25                           X64,SB
+BTR            mem,reg16                       \320\2\x0F\xB3\101                              386,SM
+BTR            reg16,reg16                     \320\2\x0F\xB3\101                              386
+BTR            mem,reg32                       \321\2\x0F\xB3\101                              386,SM
+BTR            reg32,reg32                     \321\2\x0F\xB3\101                              386
+BTR            mem,reg64                       \324\2\x0F\xB3\101                              X64,SM
+BTR            reg64,reg64                     \324\2\x0F\xB3\101                              X64
+BTR            rm16,imm                        \320\2\x0F\xBA\206\25                           386,SB
+BTR            rm32,imm                        \321\2\x0F\xBA\206\25                           386,SB
+BTR            rm64,imm                        \324\2\x0F\xBA\206\25                           X64,SB
+BTS            mem,reg16                       \320\2\x0F\xAB\101                              386,SM
+BTS            reg16,reg16                     \320\2\x0F\xAB\101                              386
+BTS            mem,reg32                       \321\2\x0F\xAB\101                              386,SM
+BTS            reg32,reg32                     \321\2\x0F\xAB\101                              386
+BTS            mem,reg64                       \324\2\x0F\xAB\101                              X64,SM
+BTS            reg64,reg64                     \324\2\x0F\xAB\101                              X64
+BTS            rm16,imm                        \320\2\x0F\xBA\205\25                           386,SB
+BTS            rm32,imm                        \321\2\x0F\xBA\205\25                           386,SB
+BTS            rm64,imm                        \324\2\x0F\xBA\205\25                           X64,SB
+CALL           imm                             \322\1\xE8\64                                   8086
+CALL           imm|near                        \322\1\xE8\64                                   8086
+CALL           imm|far                         \322\1\x9A\34\74                                8086,ND,NOLONG
+CALL           imm16                           \320\1\xE8\64                                   8086
+CALL           imm16|near                      \320\1\xE8\64                                   8086
+CALL           imm16|far                       \320\1\x9A\34\74                                8086,ND,NOLONG
+CALL           imm32                           \321\1\xE8\64                                   386
+CALL           imm32|near                      \321\1\xE8\64                                   386
+CALL           imm32|far                       \321\1\x9A\34\74                                386,ND,NOLONG
+CALL           imm:imm                         \322\1\x9A\35\30                                8086,NOLONG
+CALL           imm16:imm                       \320\1\x9A\31\30                                8086,NOLONG
+CALL           imm:imm16                       \320\1\x9A\31\30                                8086,NOLONG
+CALL           imm32:imm                       \321\1\x9A\41\30                                386,NOLONG
+CALL           imm:imm32                       \321\1\x9A\41\30                                386,NOLONG
+CALL           mem|far                         \322\1\xFF\203                                  8086,NOLONG
+CALL           mem|far                         \324\1\xFF\203                                  X64
+CALL           mem16|far                       \320\1\xFF\203                                  8086
+CALL           mem32|far                       \321\1\xFF\203                                  386
+CALL           mem64|far                       \324\1\xFF\203                                  X64
+CALL           mem|near                        \322\1\xFF\202                                  8086
+CALL           mem16|near                      \320\1\xFF\202                                  8086
+CALL           mem32|near                      \321\1\xFF\202                                  386,NOLONG
+CALL           mem64|near                      \324\1\xFF\202                                  X64
+CALL           reg16                           \320\1\xFF\202                                  8086
+CALL           reg32                           \321\1\xFF\202                                  386,NOLONG
+CALL           reg64                           \323\1\xFF\202                                  X64
+CALL           mem                             \322\1\xFF\202                                  8086
+CALL           mem16                           \320\1\xFF\202                                  8086
+CALL           mem32                           \321\1\xFF\202                                  386,NOLONG
+CALL           mem64                           \323\1\xFF\202                                  X64
+CBW            void                            \320\1\x98                                      8086
+CDQ            void                            \321\1\x99                                      386
+CDQE           void                            \324\1\x98                                      X64
+CLC            void                            \1\xF8                                          8086
+CLD            void                            \1\xFC                                          8086
+CLGI           void                            \3\x0F\x01\xDD                                  X64,AMD
+CLI            void                            \1\xFA                                          8086
+CLTS           void                            \2\x0F\x06                                      286,PRIV
+CMC            void                            \1\xF5                                          8086
+CMP            mem,reg8                        \1\x38\101                                      8086,SM
+CMP            reg8,reg8                       \1\x38\101                                      8086
+CMP            mem,reg16                       \320\1\x39\101                                  8086,SM
+CMP            reg16,reg16                     \320\1\x39\101                                  8086
+CMP            mem,reg32                       \321\1\x39\101                                  386,SM
+CMP            reg32,reg32                     \321\1\x39\101                                  386
+CMP            mem,reg64                       \324\1\x39\101                                  X64,SM
+CMP            reg64,reg64                     \324\1\x39\101                                  X64
+CMP            reg8,mem                        \1\x3A\110                                      8086,SM
+CMP            reg8,reg8                       \1\x3A\110                                      8086
+CMP            reg16,mem                       \320\1\x3B\110                                  8086,SM
+CMP            reg16,reg16                     \320\1\x3B\110                                  8086
+CMP            reg32,mem                       \321\1\x3B\110                                  386,SM
+CMP            reg32,reg32                     \321\1\x3B\110                                  386
+CMP            reg64,mem                       \324\1\x3B\110                                  X64,SM
+CMP            reg64,reg64                     \324\1\x3B\110                                  X64
+CMP            rm16,imm8                       \320\1\x83\207\275                              8086
+CMP            rm32,imm8                       \321\1\x83\207\275                              386
+CMP            rm64,imm8                       \324\1\x83\207\275                              X64
+CMP            reg_al,imm                      \1\x3C\21                                       8086,SM
+CMP            reg_ax,sbyte16                  \320\1\x83\207\275                              8086,SM
+CMP            reg_ax,imm                      \320\1\x3D\31                                   8086,SM
+CMP            reg_eax,sbyte32                 \321\1\x83\207\275                              386,SM
+CMP            reg_eax,imm                     \321\1\x3D\41                                   386,SM
+CMP            reg_rax,sbyte64                 \324\1\x83\207\275                              X64,SM
+CMP            reg_rax,imm                     \324\1\x3D\255                                  X64,SM
+CMP            rm8,imm                         \1\x80\207\21                                   8086,SM
+CMP            rm16,imm                        \320\145\x81\207\141                            8086,SM
+CMP            rm32,imm                        \321\155\x81\207\151                            386,SM
+CMP            rm64,imm                        \324\155\x81\207\251                            X64,SM
+CMP            mem,imm8                        \1\x80\207\21                                   8086,SM
+CMP            mem,imm16                       \320\145\x81\207\141                            8086,SM
+CMP            mem,imm32                       \321\155\x81\207\151                            386,SM
+CMPSB          void                            \335\1\xA6                                      8086
+CMPSD          void                            \335\321\1\xA7                                  386
+CMPSQ          void                            \335\324\1\xA7                                  X64
+CMPSW          void                            \335\320\1\xA7                                  8086
+CMPXCHG                mem,reg8                        \2\x0F\xB0\101                                  PENT,SM
+CMPXCHG                reg8,reg8                       \2\x0F\xB0\101                                  PENT
+CMPXCHG                mem,reg16                       \320\2\x0F\xB1\101                              PENT,SM
+CMPXCHG                reg16,reg16                     \320\2\x0F\xB1\101                              PENT
+CMPXCHG                mem,reg32                       \321\2\x0F\xB1\101                              PENT,SM
+CMPXCHG                reg32,reg32                     \321\2\x0F\xB1\101                              PENT
+CMPXCHG                mem,reg64                       \324\2\x0F\xB1\101                              X64,SM
+CMPXCHG                reg64,reg64                     \324\2\x0F\xB1\101                              X64
+CMPXCHG486     mem,reg8                        \2\x0F\xA6\101                                  486,SM,UNDOC,ND
+CMPXCHG486     reg8,reg8                       \2\x0F\xA6\101                                  486,UNDOC,ND
+CMPXCHG486     mem,reg16                       \320\2\x0F\xA7\101                              486,SM,UNDOC,ND
+CMPXCHG486     reg16,reg16                     \320\2\x0F\xA7\101                              486,UNDOC,ND
+CMPXCHG486     mem,reg32                       \321\2\x0F\xA7\101                              486,SM,UNDOC,ND
+CMPXCHG486     reg32,reg32                     \321\2\x0F\xA7\101                              486,UNDOC,ND
+CMPXCHG8B      mem                             \2\x0F\xC7\201                                  PENT
+CMPXCHG16B     mem                             \324\2\x0F\xC7\201                              X64
+CPUID          void                            \2\x0F\xA2                                      PENT
+CPU_READ       void                            \2\x0F\x3D                                      PENT,CYRIX
+CPU_WRITE      void                            \2\x0F\x3C                                      PENT,CYRIX
+CQO            void                            \324\1\x99                                      X64
+CWD            void                            \320\1\x99                                      8086
+CWDE           void                            \321\1\x98                                      386
+DAA            void                            \1\x27                                          8086,NOLONG
+DAS            void                            \1\x2F                                          8086,NOLONG
+DEC            reg16                           \320\10\x48                                     8086,NOLONG
+DEC            reg32                           \321\10\x48                                     386,NOLONG
+DEC            rm8                             \1\xFE\201                                      8086
+DEC            rm16                            \320\1\xFF\201                                  8086
+DEC            rm32                            \321\1\xFF\201                                  386
+DEC            rm64                            \324\1\xFF\201                                  X64
+DIV            rm8                             \1\xF6\206                                      8086
+DIV            rm16                            \320\1\xF7\206                                  8086
+DIV            rm32                            \321\1\xF7\206                                  386
+DIV            rm64                            \324\1\xF7\206                                  X64
+DMINT          void                            \2\x0F\x39                                      P6,CYRIX
+EMMS           void                            \2\x0F\x77                                      PENT,MMX
+ENTER          imm,imm                         \1\xC8\30\25                                    186
+EQU            imm                             \0                                              8086
+EQU            imm:imm                         \0                                              8086
+F2XM1          void                            \2\xD9\xF0                                      8086,FPU
+FABS           void                            \2\xD9\xE1                                      8086,FPU
+FADD           mem32                           \1\xD8\200                                      8086,FPU
+FADD           mem64                           \1\xDC\200                                      8086,FPU
+FADD           fpureg|to                       \1\xDC\10\xC0                                   8086,FPU
+FADD           fpureg                          \1\xD8\10\xC0                                   8086,FPU
+FADD           fpureg,fpu0                     \1\xDC\10\xC0                                   8086,FPU
+FADD           fpu0,fpureg                     \1\xD8\11\xC0                                   8086,FPU
+FADD           void                            \2\xDE\xC1                                      8086,FPU,ND
+FADDP          fpureg                          \1\xDE\10\xC0                                   8086,FPU
+FADDP          fpureg,fpu0                     \1\xDE\10\xC0                                   8086,FPU
+FADDP          void                            \2\xDE\xC1                                      8086,FPU,ND
+FBLD           mem80                           \1\xDF\204                                      8086,FPU
+FBLD           mem                             \1\xDF\204                                      8086,FPU
+FBSTP          mem80                           \1\xDF\206                                      8086,FPU
+FBSTP          mem                             \1\xDF\206                                      8086,FPU
+FCHS           void                            \2\xD9\xE0                                      8086,FPU
+FCLEX          void                            \341\2\xDB\xE2                                  8086,FPU
+FCMOVB         fpureg                          \1\xDA\10\xC0                                   P6,FPU
+FCMOVB         fpu0,fpureg                     \1\xDA\11\xC0                                   P6,FPU
+FCMOVB         void                            \2\xDA\xC1                                      P6,FPU,ND
+FCMOVBE                fpureg                          \1\xDA\10\xD0                                   P6,FPU
+FCMOVBE                fpu0,fpureg                     \1\xDA\11\xD0                                   P6,FPU
+FCMOVBE                void                            \2\xDA\xD1                                      P6,FPU,ND
+FCMOVE         fpureg                          \1\xDA\10\xC8                                   P6,FPU
+FCMOVE         fpu0,fpureg                     \1\xDA\11\xC8                                   P6,FPU
+FCMOVE         void                            \2\xDA\xC9                                      P6,FPU,ND
+FCMOVNB                fpureg                          \1\xDB\10\xC0                                   P6,FPU
+FCMOVNB                fpu0,fpureg                     \1\xDB\11\xC0                                   P6,FPU
+FCMOVNB                void                            \2\xDB\xC1                                      P6,FPU,ND
+FCMOVNBE       fpureg                          \1\xDB\10\xD0                                   P6,FPU
+FCMOVNBE       fpu0,fpureg                     \1\xDB\11\xD0                                   P6,FPU
+FCMOVNBE       void                            \2\xDB\xD1                                      P6,FPU,ND
+FCMOVNE                fpureg                          \1\xDB\10\xC8                                   P6,FPU
+FCMOVNE                fpu0,fpureg                     \1\xDB\11\xC8                                   P6,FPU
+FCMOVNE                void                            \2\xDB\xC9                                      P6,FPU,ND
+FCMOVNU                fpureg                          \1\xDB\10\xD8                                   P6,FPU
+FCMOVNU                fpu0,fpureg                     \1\xDB\11\xD8                                   P6,FPU
+FCMOVNU                void                            \2\xDB\xD9                                      P6,FPU,ND
+FCMOVU         fpureg                          \1\xDA\10\xD8                                   P6,FPU
+FCMOVU         fpu0,fpureg                     \1\xDA\11\xD8                                   P6,FPU
+FCMOVU         void                            \2\xDA\xD9                                      P6,FPU,ND
+FCOM           mem32                           \1\xD8\202                                      8086,FPU
+FCOM           mem64                           \1\xDC\202                                      8086,FPU
+FCOM           fpureg                          \1\xD8\10\xD0                                   8086,FPU
+FCOM           fpu0,fpureg                     \1\xD8\11\xD0                                   8086,FPU
+FCOM           void                            \2\xD8\xD1                                      8086,FPU,ND
+FCOMI          fpureg                          \1\xDB\10\xF0                                   P6,FPU
+FCOMI          fpu0,fpureg                     \1\xDB\11\xF0                                   P6,FPU
+FCOMI          void                            \2\xDB\xF1                                      P6,FPU,ND
+FCOMIP         fpureg                          \1\xDF\10\xF0                                   P6,FPU
+FCOMIP         fpu0,fpureg                     \1\xDF\11\xF0                                   P6,FPU
+FCOMIP         void                            \2\xDF\xF1                                      P6,FPU,ND
+FCOMP          mem32                           \1\xD8\203                                      8086,FPU
+FCOMP          mem64                           \1\xDC\203                                      8086,FPU
+FCOMP          fpureg                          \1\xD8\10\xD8                                   8086,FPU
+FCOMP          fpu0,fpureg                     \1\xD8\11\xD8                                   8086,FPU
+FCOMP          void                            \2\xD8\xD9                                      8086,FPU,ND
+FCOMPP         void                            \2\xDE\xD9                                      8086,FPU
+FCOS           void                            \2\xD9\xFF                                      386,FPU
+FDECSTP                void                            \2\xD9\xF6                                      8086,FPU
+FDISI          void                            \341\2\xDB\xE1                                  8086,FPU
+FDIV           mem32                           \1\xD8\206                                      8086,FPU
+FDIV           mem64                           \1\xDC\206                                      8086,FPU
+FDIV           fpureg|to                       \1\xDC\10\xF8                                   8086,FPU
+FDIV           fpureg                          \1\xD8\10\xF0                                   8086,FPU
+FDIV           fpureg,fpu0                     \1\xDC\10\xF8                                   8086,FPU
+FDIV           fpu0,fpureg                     \1\xD8\11\xF0                                   8086,FPU
+FDIV           void                            \2\xDE\xF9                                      8086,FPU,ND
+FDIVP          fpureg                          \1\xDE\10\xF8                                   8086,FPU
+FDIVP          fpureg,fpu0                     \1\xDE\10\xF8                                   8086,FPU
+FDIVP          void                            \2\xDE\xF9                                      8086,FPU,ND
+FDIVR          mem32                           \1\xD8\207                                      8086,FPU
+FDIVR          mem64                           \1\xDC\207                                      8086,FPU
+FDIVR          fpureg|to                       \1\xDC\10\xF0                                   8086,FPU
+FDIVR          fpureg,fpu0                     \1\xDC\10\xF0                                   8086,FPU
+FDIVR          fpureg                          \1\xD8\10\xF8                                   8086,FPU
+FDIVR          fpu0,fpureg                     \1\xD8\11\xF8                                   8086,FPU
+FDIVR          void                            \2\xDE\xF1                                      8086,FPU,ND
+FDIVRP         fpureg                          \1\xDE\10\xF0                                   8086,FPU
+FDIVRP         fpureg,fpu0                     \1\xDE\10\xF0                                   8086,FPU
+FDIVRP         void                            \2\xDE\xF1                                      8086,FPU,ND
+FEMMS          void                            \2\x0F\x0E                                      PENT,3DNOW
+FENI           void                            \341\2\xDB\xE0                                  8086,FPU
+FFREE          fpureg                          \1\xDD\10\xC0                                   8086,FPU
+FFREE          void                            \2\xDD\xC1                                      8086,FPU
+FFREEP         fpureg                          \1\xDF\10\xC0                                   286,FPU,UNDOC
+FFREEP         void                            \2\xDF\xC1                                      286,FPU,UNDOC
+FIADD          mem32                           \1\xDA\200                                      8086,FPU
+FIADD          mem16                           \1\xDE\200                                      8086,FPU
+FICOM          mem32                           \1\xDA\202                                      8086,FPU
+FICOM          mem16                           \1\xDE\202                                      8086,FPU
+FICOMP         mem32                           \1\xDA\203                                      8086,FPU
+FICOMP         mem16                           \1\xDE\203                                      8086,FPU
+FIDIV          mem32                           \1\xDA\206                                      8086,FPU
+FIDIV          mem16                           \1\xDE\206                                      8086,FPU
+FIDIVR         mem32                           \1\xDA\207                                      8086,FPU
+FIDIVR         mem16                           \1\xDE\207                                      8086,FPU
+FILD           mem32                           \1\xDB\200                                      8086,FPU
+FILD           mem16                           \1\xDF\200                                      8086,FPU
+FILD           mem64                           \1\xDF\205                                      8086,FPU
+FIMUL          mem32                           \1\xDA\201                                      8086,FPU
+FIMUL          mem16                           \1\xDE\201                                      8086,FPU
+FINCSTP                void                            \2\xD9\xF7                                      8086,FPU
+FINIT          void                            \341\2\xDB\xE3                                  8086,FPU
+FIST           mem32                           \1\xDB\202                                      8086,FPU
+FIST           mem16                           \1\xDF\202                                      8086,FPU
+FISTP          mem32                           \1\xDB\203                                      8086,FPU
+FISTP          mem16                           \1\xDF\203                                      8086,FPU
+FISTP          mem64                           \1\xDF\207                                      8086,FPU
+FISTTP         mem16                           \1\xDF\201                                      PRESCOTT,FPU
+FISTTP         mem32                           \1\xDB\201                                      PRESCOTT,FPU
+FISTTP         mem64                           \1\xDD\201                                      PRESCOTT,FPU
+FISUB          mem32                           \1\xDA\204                                      8086,FPU
+FISUB          mem16                           \1\xDE\204                                      8086,FPU
+FISUBR         mem32                           \1\xDA\205                                      8086,FPU
+FISUBR         mem16                           \1\xDE\205                                      8086,FPU
+FLD            mem32                           \1\xD9\200                                      8086,FPU
+FLD            mem64                           \1\xDD\200                                      8086,FPU
+FLD            mem80                           \1\xDB\205                                      8086,FPU
+FLD            fpureg                          \1\xD9\10\xC0                                   8086,FPU
+FLD            void                            \2\xD9\xC1                                      8086,FPU,ND
+FLD1           void                            \2\xD9\xE8                                      8086,FPU
+FLDCW          mem                             \1\xD9\205                                      8086,FPU,SW
+FLDENV         mem                             \1\xD9\204                                      8086,FPU
+FLDL2E         void                            \2\xD9\xEA                                      8086,FPU
+FLDL2T         void                            \2\xD9\xE9                                      8086,FPU
+FLDLG2         void                            \2\xD9\xEC                                      8086,FPU
+FLDLN2         void                            \2\xD9\xED                                      8086,FPU
+FLDPI          void                            \2\xD9\xEB                                      8086,FPU
+FLDZ           void                            \2\xD9\xEE                                      8086,FPU
+FMUL           mem32                           \1\xD8\201                                      8086,FPU
+FMUL           mem64                           \1\xDC\201                                      8086,FPU
+FMUL           fpureg|to                       \1\xDC\10\xC8                                   8086,FPU
+FMUL           fpureg,fpu0                     \1\xDC\10\xC8                                   8086,FPU
+FMUL           fpureg                          \1\xD8\10\xC8                                   8086,FPU
+FMUL           fpu0,fpureg                     \1\xD8\11\xC8                                   8086,FPU
+FMUL           void                            \2\xDE\xC9                                      8086,FPU,ND
+FMULP          fpureg                          \1\xDE\10\xC8                                   8086,FPU
+FMULP          fpureg,fpu0                     \1\xDE\10\xC8                                   8086,FPU
+FMULP          void                            \2\xDE\xC9                                      8086,FPU,ND
+FNCLEX         void                            \2\xDB\xE2                                      8086,FPU
+FNDISI         void                            \2\xDB\xE1                                      8086,FPU
+FNENI          void                            \2\xDB\xE0                                      8086,FPU
+FNINIT         void                            \2\xDB\xE3                                      8086,FPU
+FNOP           void                            \2\xD9\xD0                                      8086,FPU
+FNSAVE         mem                             \1\xDD\206                                      8086,FPU
+FNSTCW         mem                             \1\xD9\207                                      8086,FPU,SW
+FNSTENV                mem                             \1\xD9\206                                      8086,FPU
+FNSTSW         mem                             \1\xDD\207                                      8086,FPU,SW
+FNSTSW         reg_ax                          \2\xDF\xE0                                      286,FPU
+FPATAN         void                            \2\xD9\xF3                                      8086,FPU
+FPREM          void                            \2\xD9\xF8                                      8086,FPU
+FPREM1         void                            \2\xD9\xF5                                      386,FPU
+FPTAN          void                            \2\xD9\xF2                                      8086,FPU
+FRNDINT                void                            \2\xD9\xFC                                      8086,FPU
+FRSTOR         mem                             \1\xDD\204                                      8086,FPU
+FSAVE          mem                             \341\1\xDD\206                                  8086,FPU
+FSCALE         void                            \2\xD9\xFD                                      8086,FPU
+FSETPM         void                            \2\xDB\xE4                                      286,FPU
+FSIN           void                            \2\xD9\xFE                                      386,FPU
+FSINCOS                void                            \2\xD9\xFB                                      386,FPU
+FSQRT          void                            \2\xD9\xFA                                      8086,FPU
+FST            mem32                           \1\xD9\202                                      8086,FPU
+FST            mem64                           \1\xDD\202                                      8086,FPU
+FST            fpureg                          \1\xDD\10\xD0                                   8086,FPU
+FST            void                            \2\xDD\xD1                                      8086,FPU,ND
+FSTCW          mem                             \341\1\xD9\207                                  8086,FPU,SW
+FSTENV         mem                             \341\1\xD9\206                                  8086,FPU
+FSTP           mem32                           \1\xD9\203                                      8086,FPU
+FSTP           mem64                           \1\xDD\203                                      8086,FPU
+FSTP           mem80                           \1\xDB\207                                      8086,FPU
+FSTP           fpureg                          \1\xDD\10\xD8                                   8086,FPU
+FSTP           void                            \2\xDD\xD9                                      8086,FPU,ND
+FSTSW          mem                             \341\1\xDD\207                                  8086,FPU,SW
+FSTSW          reg_ax                          \341\2\xDF\xE0                                  286,FPU
+FSUB           mem32                           \1\xD8\204                                      8086,FPU
+FSUB           mem64                           \1\xDC\204                                      8086,FPU
+FSUB           fpureg|to                       \1\xDC\10\xE8                                   8086,FPU
+FSUB           fpureg,fpu0                     \1\xDC\10\xE8                                   8086,FPU
+FSUB           fpureg                          \1\xD8\10\xE0                                   8086,FPU
+FSUB           fpu0,fpureg                     \1\xD8\11\xE0                                   8086,FPU
+FSUB           void                            \2\xDE\xE9                                      8086,FPU,ND
+FSUBP          fpureg                          \1\xDE\10\xE8                                   8086,FPU
+FSUBP          fpureg,fpu0                     \1\xDE\10\xE8                                   8086,FPU
+FSUBP          void                            \2\xDE\xE9                                      8086,FPU,ND
+FSUBR          mem32                           \1\xD8\205                                      8086,FPU
+FSUBR          mem64                           \1\xDC\205                                      8086,FPU
+FSUBR          fpureg|to                       \1\xDC\10\xE0                                   8086,FPU
+FSUBR          fpureg,fpu0                     \1\xDC\10\xE0                                   8086,FPU
+FSUBR          fpureg                          \1\xD8\10\xE8                                   8086,FPU
+FSUBR          fpu0,fpureg                     \1\xD8\11\xE8                                   8086,FPU
+FSUBR          void                            \2\xDE\xE1                                      8086,FPU,ND
+FSUBRP         fpureg                          \1\xDE\10\xE0                                   8086,FPU
+FSUBRP         fpureg,fpu0                     \1\xDE\10\xE0                                   8086,FPU
+FSUBRP         void                            \2\xDE\xE1                                      8086,FPU,ND
+FTST           void                            \2\xD9\xE4                                      8086,FPU
+FUCOM          fpureg                          \1\xDD\10\xE0                                   386,FPU
+FUCOM          fpu0,fpureg                     \1\xDD\11\xE0                                   386,FPU
+FUCOM          void                            \2\xDD\xE1                                      386,FPU,ND
+FUCOMI         fpureg                          \1\xDB\10\xE8                                   P6,FPU
+FUCOMI         fpu0,fpureg                     \1\xDB\11\xE8                                   P6,FPU
+FUCOMI         void                            \2\xDB\xE9                                      P6,FPU,ND
+FUCOMIP                fpureg                          \1\xDF\10\xE8                                   P6,FPU
+FUCOMIP                fpu0,fpureg                     \1\xDF\11\xE8                                   P6,FPU
+FUCOMIP                void                            \2\xDF\xE9                                      P6,FPU,ND
+FUCOMP         fpureg                          \1\xDD\10\xE8                                   386,FPU
+FUCOMP         fpu0,fpureg                     \1\xDD\11\xE8                                   386,FPU
+FUCOMP         void                            \2\xDD\xE9                                      386,FPU,ND
+FUCOMPP                void                            \2\xDA\xE9                                      386,FPU
+FXAM           void                            \2\xD9\xE5                                      8086,FPU
+FXCH           fpureg                          \1\xD9\10\xC8                                   8086,FPU
+FXCH           fpureg,fpu0                     \1\xD9\10\xC8                                   8086,FPU
+FXCH           fpu0,fpureg                     \1\xD9\11\xC8                                   8086,FPU
+FXCH           void                            \2\xD9\xC9                                      8086,FPU,ND
+FXTRACT                void                            \2\xD9\xF4                                      8086,FPU
+FYL2X          void                            \2\xD9\xF1                                      8086,FPU
+FYL2XP1                void                            \2\xD9\xF9                                      8086,FPU
+HLT            void                            \1\xF4                                          8086,PRIV
+IBTS           mem,reg16                       \320\2\x0F\xA7\101                              386,SW,UNDOC,ND
+IBTS           reg16,reg16                     \320\2\x0F\xA7\101                              386,UNDOC,ND
+IBTS           mem,reg32                       \321\2\x0F\xA7\101                              386,SD,UNDOC,ND
+IBTS           reg32,reg32                     \321\2\x0F\xA7\101                              386,UNDOC,ND
+ICEBP          void                            \1\xF1                                          386,ND
+IDIV           rm8                             \1\xF6\207                                      8086
+IDIV           rm16                            \320\1\xF7\207                                  8086
+IDIV           rm32                            \321\1\xF7\207                                  386
+IDIV           rm64                            \324\1\xF7\207                                  X64
+IMUL           rm8                             \1\xF6\205                                      8086
+IMUL           rm16                            \320\1\xF7\205                                  8086
+IMUL           rm32                            \321\1\xF7\205                                  386
+IMUL           rm64                            \324\1\xF7\205                                  X64
+IMUL           reg16,mem                       \320\2\x0F\xAF\110                              386,SM
+IMUL           reg16,reg16                     \320\2\x0F\xAF\110                              386
+IMUL           reg32,mem                       \321\2\x0F\xAF\110                              386,SM
+IMUL           reg32,reg32                     \321\2\x0F\xAF\110                              386
+IMUL           reg64,mem                       \324\2\x0F\xAF\110                              X64,SM
+IMUL           reg64,reg64                     \324\2\x0F\xAF\110                              X64
+IMUL           reg16,mem,imm8                  \320\1\x6B\110\16                               186,SM
+IMUL           reg16,mem,sbyte16               \320\1\x6B\110\16                               186,SM,ND
+IMUL           reg16,mem,imm16                 \320\1\x69\110\32                               186,SM
+IMUL           reg16,mem,imm                   \320\146\x69\110\142                            186,SM,ND
+IMUL           reg16,reg16,imm8                \320\1\x6B\110\16                               186
+IMUL           reg16,reg16,sbyte16             \320\1\x6B\110\16                               186,SM,ND
+IMUL           reg16,reg16,imm16               \320\1\x69\110\32                               186
+IMUL           reg16,reg16,imm                 \320\146\x69\110\142                            186,SM,ND
+IMUL           reg32,mem,imm8                  \321\1\x6B\110\16                               386,SM
+IMUL           reg32,mem,sbyte32               \321\1\x6B\110\16                               386,SM,ND
+IMUL           reg32,mem,imm32                 \321\1\x69\110\42                               386,SM
+IMUL           reg32,mem,imm                   \321\156\x69\110\152                            386,SM,ND
+IMUL           reg32,reg32,imm8                \321\1\x6B\110\16                               386
+IMUL           reg32,reg32,sbyte32             \321\1\x6B\110\16                               386,SM,ND
+IMUL           reg32,reg32,imm32               \321\1\x69\110\42                               386
+IMUL           reg32,reg32,imm                 \321\156\x69\110\152                            386,SM,ND
+IMUL           reg64,mem,imm8                  \324\1\x6B\110\16                               X64,SM
+IMUL           reg64,mem,sbyte64               \324\1\x6B\110\16                               X64,SM,ND
+IMUL           reg64,mem,imm32                 \324\1\x69\110\42                               X64,SM
+IMUL           reg64,mem,imm                   \324\156\x69\110\252                            X64,SM,ND
+IMUL           reg64,reg64,imm8                \324\1\x6B\110\16                               X64
+IMUL           reg64,reg64,sbyte64             \324\1\x6B\110\16                               X64,SM,ND
+IMUL           reg64,reg64,imm32               \324\1\x69\110\42                               X64
+IMUL           reg64,reg64,imm                 \324\156\x69\110\252                            X64,SM,ND
+IMUL           reg16,imm8                      \320\1\x6B\100\15                               186
+IMUL           reg16,sbyte16                   \320\1\x6B\100\15                               186,SM,ND
+IMUL           reg16,imm16                     \320\1\x69\100\31                               186
+IMUL           reg16,imm                       \320\145\x69\100\141                            186,SM,ND
+IMUL           reg32,imm8                      \321\1\x6B\100\15                               386
+IMUL           reg32,sbyte32                   \321\1\x6B\100\15                               386,SM,ND
+IMUL           reg32,imm32                     \321\1\x69\100\41                               386
+IMUL           reg32,imm                       \321\155\x69\100\151                            386,SM,ND
+IMUL           reg64,imm8                      \324\1\x6B\100\15                               X64
+IMUL           reg64,sbyte64                   \324\1\x6B\100\15                               X64,SM,ND
+IMUL           reg64,imm32                     \324\1\x69\100\255                              X64
+IMUL           reg64,imm                       \324\155\x69\100\251                            X64,SM,ND
+IN             reg_al,imm                      \1\xE4\25                                       8086,SB
+IN             reg_ax,imm                      \320\1\xE5\25                                   8086,SB
+IN             reg_eax,imm                     \321\1\xE5\25                                   386,SB
+IN             reg_al,reg_dx                   \1\xEC                                          8086
+IN             reg_ax,reg_dx                   \320\1\xED                                      8086
+IN             reg_eax,reg_dx                  \321\1\xED                                      386
+INC            reg16                           \320\10\x40                                     8086,NOLONG
+INC            reg32                           \321\10\x40                                     386,NOLONG
+INC            rm8                             \1\xFE\200                                      8086
+INC            rm16                            \320\1\xFF\200                                  8086
+INC            rm32                            \321\1\xFF\200                                  386
+INC            rm64                            \324\1\xFF\200                                  X64
+INCBIN         ignore                          ignore                                          ignore
+INSB           void                            \1\x6C                                          186
+INSD           void                            \321\1\x6D                                      386
+INSW           void                            \320\1\x6D                                      186
+INT            imm                             \1\xCD\24                                       8086,SB
+INT01          void                            \1\xF1                                          386,ND
+INT1           void                            \1\xF1                                          386
+INT03          void                            \1\xCC                                          8086,ND
+INT3           void                            \1\xCC                                          8086
+INTO           void                            \1\xCE                                          8086,NOLONG
+INVD           void                            \2\x0F\x08                                      486,PRIV
+INVLPG         mem                             \2\x0F\x01\207                                  486,PRIV
+INVLPGA                reg_ax,reg_ecx                  \310\3\x0F\x01\xDF                              X86_64,AMD,NOLONG
+INVLPGA                reg_eax,reg_ecx                 \311\3\x0F\x01\xDF                              X86_64,AMD
+INVLPGA                reg_rax,reg_ecx                 \323\313\3\x0F\x01\xDF                          X64,AMD
+INVLPGA                void                            \3\x0F\x01\xDF                                  X86_64,AMD
+IRET           void                            \322\1\xCF                                      8086
+IRETD          void                            \321\1\xCF                                      386
+IRETQ          void                            \324\1\xCF                                      X64
+IRETW          void                            \320\1\xCF                                      8086
+JCXZ           imm                             \310\1\xE3\50                                   8086,NOLONG
+JECXZ          imm                             \311\1\xE3\50                                   386
+JRCXZ          imm                             \313\1\xE3\50                                   X64
+JMP            imm|short                       \1\xEB\50                                       8086
+JMP            imm                             \371\1\xEB\50                                   8086,ND
+JMP            imm                             \322\1\xE9\64                                   8086
+JMP            imm|near                        \322\1\xE9\64                                   8086,ND
+JMP            imm|far                         \322\1\xEA\34\74                                8086,ND,NOLONG
+JMP            imm16                           \320\1\xE9\64                                   8086
+JMP            imm16|near                      \320\1\xE9\64                                   8086,ND
+JMP            imm16|far                       \320\1\xEA\34\74                                8086,ND,NOLONG
+JMP            imm32                           \321\1\xE9\64                                   386
+JMP            imm32|near                      \321\1\xE9\64                                   386,ND
+JMP            imm32|far                       \321\1\xEA\34\74                                386,ND,NOLONG
+JMP            imm:imm                         \322\1\xEA\35\30                                8086,NOLONG
+JMP            imm16:imm                       \320\1\xEA\31\30                                8086,NOLONG
+JMP            imm:imm16                       \320\1\xEA\31\30                                8086,NOLONG
+JMP            imm32:imm                       \321\1\xEA\41\30                                386,NOLONG
+JMP            imm:imm32                       \321\1\xEA\41\30                                386,NOLONG
+JMP            mem|far                         \322\1\xFF\205                                  8086,NOLONG
+JMP            mem|far                         \324\1\xFF\205                                  X64
+JMP            mem16|far                       \320\1\xFF\205                                  8086
+JMP            mem32|far                       \321\1\xFF\205                                  386
+JMP            mem64|far                       \324\1\xFF\205                                  X64
+JMP            mem|near                        \322\1\xFF\204                                  8086
+JMP            mem16|near                      \320\1\xFF\204                                  8086
+JMP            mem32|near                      \321\1\xFF\204                                  386,NOLONG
+JMP            mem64|near                      \323\1\xFF\204                                  X64
+JMP            reg16                           \320\1\xFF\204                                  8086
+JMP            reg32                           \321\1\xFF\204                                  386,NOLONG
+JMP            reg64                           \323\1\xFF\204                                  X64
+JMP            mem                             \322\1\xFF\204                                  8086
+JMP            mem16                           \320\1\xFF\204                                  8086
+JMP            mem32                           \321\1\xFF\204                                  386,NOLONG
+JMP            mem64                           \323\1\xFF\204                                  X64
+JMPE           imm                             \322\2\x0F\xB8\64                               IA64
+JMPE           imm16                           \320\2\x0F\xB8\64                               IA64
+JMPE           imm32                           \321\2\x0F\xB8\64                               IA64
+JMPE           rm16                            \320\2\x0F\x00\206                              IA64
+JMPE           rm32                            \321\2\x0F\x00\206                              IA64
+LAHF           void                            \1\x9F                                          8086
+LAR            reg16,mem                       \320\2\x0F\x02\110                              286,PROT,SW
+LAR            reg16,reg16                     \320\2\x0F\x02\110                              286,PROT
+LAR            reg16,reg32                     \320\2\x0F\x02\110                              386,PROT
+LAR            reg16,reg64                     \320\323\2\x0F\x02\110                          X64,PROT,ND
+LAR            reg32,mem                       \321\2\x0F\x02\110                              386,PROT,SW
+LAR            reg32,reg16                     \321\2\x0F\x02\110                              386,PROT
+LAR            reg32,reg32                     \321\2\x0F\x02\110                              386,PROT
+LAR            reg32,reg64                     \321\323\2\x0F\x02\110                          X64,PROT,ND
+LAR            reg64,mem                       \324\2\x0F\x02\110                              X64,PROT,SW
+LAR            reg64,reg16                     \324\2\x0F\x02\110                              X64,PROT
+LAR            reg64,reg32                     \324\2\x0F\x02\110                              X64,PROT
+LAR            reg64,reg64                     \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
+LEA            reg32,mem                       \321\1\x8D\110                                  386
+LEA            reg64,mem                       \324\1\x8D\110                                  X64
+LEAVE          void                            \1\xC9                                          186
+LES            reg16,mem                       \320\1\xC4\110                                  8086,NOLONG
+LES            reg32,mem                       \321\1\xC4\110                                  386,NOLONG
+LFENCE         void                            \3\x0F\xAE\xE8                                  X64,AMD
+LFS            reg16,mem                       \320\2\x0F\xB4\110                              386
+LFS            reg32,mem                       \321\2\x0F\xB4\110                              386
+LGDT           mem                             \2\x0F\x01\202                                  286,PRIV
+LGS            reg16,mem                       \320\2\x0F\xB5\110                              386
+LGS            reg32,mem                       \321\2\x0F\xB5\110                              386
+LIDT           mem                             \2\x0F\x01\203                                  286,PRIV
+LLDT           mem                             \2\x0F\x00\202                                  286,PROT,PRIV
+LLDT           mem16                           \2\x0F\x00\202                                  286,PROT,PRIV
+LLDT           reg16                           \2\x0F\x00\202                                  286,PROT,PRIV
+LMSW           mem                             \2\x0F\x01\206                                  286,PRIV
+LMSW           mem16                           \2\x0F\x01\206                                  286,PRIV
+LMSW           reg16                           \2\x0F\x01\206                                  286,PRIV
+LOADALL                void                            \2\x0F\x07                                      386,UNDOC
+LOADALL286     void                            \2\x0F\x05                                      286,UNDOC
+LODSB          void                            \1\xAC                                          8086
+LODSD          void                            \321\1\xAD                                      386
+LODSQ          void                            \324\1\xAD                                      X64
+LODSW          void                            \320\1\xAD                                      8086
+LOOP           imm                             \312\1\xE2\50                                   8086
+LOOP           imm,reg_cx                      \310\1\xE2\50                                   8086,NOLONG
+LOOP           imm,reg_ecx                     \311\1\xE2\50                                   386
+LOOP           imm,reg_rcx                     \313\1\xE2\50                                   X64
+LOOPE          imm                             \312\1\xE1\50                                   8086
+LOOPE          imm,reg_cx                      \310\1\xE1\50                                   8086,NOLONG
+LOOPE          imm,reg_ecx                     \311\1\xE1\50                                   386
+LOOPE          imm,reg_rcx                     \313\1\xE1\50                                   X64
+LOOPNE         imm                             \312\1\xE0\50                                   8086
+LOOPNE         imm,reg_cx                      \310\1\xE0\50                                   8086,NOLONG
+LOOPNE         imm,reg_ecx                     \311\1\xE0\50                                   386
+LOOPNE         imm,reg_rcx                     \313\1\xE0\50                                   X64
+LOOPNZ         imm                             \312\1\xE0\50                                   8086
+LOOPNZ         imm,reg_cx                      \310\1\xE0\50                                   8086,NOLONG
+LOOPNZ         imm,reg_ecx                     \311\1\xE0\50                                   386
+LOOPNZ         imm,reg_rcx                     \313\1\xE0\50                                   X64
+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,SW
+LSL            reg16,reg16                     \320\2\x0F\x03\110                              286,PROT
+LSL            reg16,reg32                     \320\2\x0F\x03\110                              386,PROT
+LSL            reg16,reg64                     \320\323\2\x0F\x03\110                          X64,PROT,ND
+LSL            reg32,mem                       \321\2\x0F\x03\110                              386,PROT,SW
+LSL            reg32,reg16                     \321\2\x0F\x03\110                              386,PROT
+LSL            reg32,reg32                     \321\2\x0F\x03\110                              386,PROT
+LSL            reg32,reg64                     \321\323\2\x0F\x03\110                          X64,PROT,ND
+LSL            reg64,mem                       \324\2\x0F\x03\110                              X64,PROT,SW
+LSL            reg64,reg16                     \324\2\x0F\x03\110                              X64,PROT
+LSL            reg64,reg32                     \324\2\x0F\x03\110                              X64,PROT
+LSL            reg64,reg64                     \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                             \2\x0F\x00\203                                  286,PROT,PRIV
+LTR            mem16                           \2\x0F\x00\203                                  286,PROT,PRIV
+LTR            reg16                           \2\x0F\x00\203                                  286,PROT,PRIV
+MFENCE         void                            \3\x0F\xAE\xF0                                  X64,AMD
+MONITOR                void                            \3\x0F\x01\xC8                                  PRESCOTT
+MONITOR                reg_eax,reg_ecx,reg_edx         \3\x0F\x01\xC8                                  PRESCOTT,ND
+MONITOR                reg_rax,reg_ecx,reg_edx         \3\x0F\x01\xC8                                  X64,ND
+MOV            mem,reg_sreg                    \1\x8C\101                                      8086,SM
+MOV            reg16,reg_sreg                  \320\1\x8C\101                                  8086
+MOV            reg32,reg_sreg                  \321\1\x8C\101                                  386
+MOV            reg_sreg,mem                    \1\x8E\110                                      8086,SM
+MOV            reg_sreg,reg16                  \1\x8E\110                                      8086
+MOV            reg_sreg,reg32                  \1\x8E\110                                      386
+MOV            reg_al,mem_offs                 \1\xA0\45                                       8086,SM
+MOV            reg_ax,mem_offs                 \320\1\xA1\45                                   8086,SM
+MOV            reg_eax,mem_offs                \321\1\xA1\45                                   386,SM
+MOV            reg_rax,mem_offs                \324\1\xA1\45                                   X64,SM
+MOV            mem_offs,reg_al                 \1\xA2\44                                       8086,SM
+MOV            mem_offs,reg_ax                 \320\1\xA3\44                                   8086,SM
+MOV            mem_offs,reg_eax                \321\1\xA3\44                                   386,SM
+MOV            mem_offs,reg_rax                \324\1\xA3\44                                   X64,SM
+MOV            reg32,reg_creg                  \334\2\x0F\x20\101                              386,PRIV,NOLONG
+MOV            reg64,reg_creg                  \323\2\x0F\x20\101                              X64,PRIV
+MOV            reg_creg,reg32                  \334\2\x0F\x22\110                              386,PRIV,NOLONG
+MOV            reg_creg,reg64                  \323\2\x0F\x22\110                              X64,PRIV
+MOV            reg32,reg_dreg                  \2\x0F\x21\101                                  386,PRIV,NOLONG
+MOV            reg64,reg_dreg                  \323\2\x0F\x21\101                              X64,PRIV
+MOV            reg_dreg,reg32                  \2\x0F\x23\110                                  386,PRIV,NOLONG
+MOV            reg_dreg,reg64                  \323\2\x0F\x23\110                              X64,PRIV
+MOV            reg32,reg_treg                  \2\x0F\x24\101                                  386,NOLONG,ND
+MOV            reg_treg,reg32                  \2\x0F\x26\110                                  386,NOLONG,ND
+MOV            mem,reg8                        \1\x88\101                                      8086,SM
+MOV            reg8,reg8                       \1\x88\101                                      8086
+MOV            mem,reg16                       \320\1\x89\101                                  8086,SM
+MOV            reg16,reg16                     \320\1\x89\101                                  8086
+MOV            mem,reg32                       \321\1\x89\101                                  386,SM
+MOV            reg32,reg32                     \321\1\x89\101                                  386
+MOV            mem,reg64                       \324\1\x89\101                                  X64,SM
+MOV            reg64,reg64                     \324\1\x89\101                                  X64
+MOV            reg8,mem                        \1\x8A\110                                      8086,SM
+MOV            reg8,reg8                       \1\x8A\110                                      8086
+MOV            reg16,mem                       \320\1\x8B\110                                  8086,SM
+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            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,imm32                     \324\1\xC7\200\255                              X64
+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\255                              X64,SM
+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
+MOVD           mmxreg,mem                      \360\2\x0F\x6E\110                              PENT,MMX,SD
+MOVD           mmxreg,reg32                    \360\2\x0F\x6E\110                              PENT,MMX
+MOVD           mem,mmxreg                      \360\2\x0F\x7E\101                              PENT,MMX,SD
+MOVD           reg32,mmxreg                    \360\2\x0F\x7E\101                              PENT,MMX
+MOVD           xmmreg,mem                      \360\320\2\x0F\x6E\110                          X64,SD
+MOVD           xmmreg,reg32                    \360\320\2\x0F\x6E\110                          X64
+MOVD           mem,xmmreg                      \360\320\2\x0F\x7E\101                          X64,SD
+MOVD           reg32,xmmreg                    \360\320\2\x0F\x7E\101                          X64,SSE
+MOVQ           mmxreg,mmxrm                    \360\323\2\x0F\x6F\110                          PENT,MMX,SQ
+MOVQ           mmxrm,mmxreg                    \360\323\2\x0F\x7F\101                          PENT,MMX,SQ
+MOVQ           mmxreg,rm64                     \360\2\x0F\x6E\110                              X64,MMX
+MOVQ           rm64,mmxreg                     \360\2\x0F\x7E\101                              X64,MMX
+MOVSB          void                            \1\xA4                                          8086
+MOVSD          void                            \321\1\xA5                                      386
+MOVSQ          void                            \324\1\xA5                                      X64
+MOVSW          void                            \320\1\xA5                                      8086
+MOVSX          reg16,mem                       \320\2\x0F\xBE\110                              386,SB
+MOVSX          reg16,reg8                      \320\2\x0F\xBE\110                              386
+MOVSX          reg32,rm8                       \321\2\x0F\xBE\110                              386
+MOVSX          reg32,rm16                      \321\2\x0F\xBF\110                              386
+MOVSX          reg64,rm8                       \324\2\x0F\xBE\110                              X64
+MOVSX          reg64,rm16                      \324\2\x0F\xBF\110                              X64
+MOVSXD         reg64,rm32                      \324\1\x63\110                                  X64
+MOVSX          reg64,rm32                      \324\1\x63\110                                  X64,ND
+MOVZX          reg16,mem                       \320\2\x0F\xB6\110                              386,SB
+MOVZX          reg16,reg8                      \320\2\x0F\xB6\110                              386
+MOVZX          reg32,rm8                       \321\2\x0F\xB6\110                              386
+MOVZX          reg32,rm16                      \321\2\x0F\xB7\110                              386
+MOVZX          reg64,rm8                       \324\2\x0F\xB6\110                              X64
+MOVZX          reg64,rm16                      \324\2\x0F\xB7\110                              X64
+MUL            rm8                             \1\xF6\204                                      8086
+MUL            rm16                            \320\1\xF7\204                                  8086
+MUL            rm32                            \321\1\xF7\204                                  386
+MUL            rm64                            \324\1\xF7\204                                  X64
+MWAIT          void                            \3\x0F\x01\xC9                                  PRESCOTT
+MWAIT          reg_eax,reg_ecx                 \3\x0F\x01\xC9                                  PRESCOTT,ND
+NEG            rm8                             \1\xF6\203                                      8086
+NEG            rm16                            \320\1\xF7\203                                  8086
+NEG            rm32                            \321\1\xF7\203                                  386
+NEG            rm64                            \324\1\xF7\203                                  X64
+NOP            void                            \314\1\x90                                      8086
+NOP            rm16                            \320\2\x0F\x1F\200                              P6
+NOP            rm32                            \321\2\x0F\x1F\200                              P6
+NOP            rm64                            \324\2\x0F\x1F\200                              X64
+NOT            rm8                             \1\xF6\202                                      8086
+NOT            rm16                            \320\1\xF7\202                                  8086
+NOT            rm32                            \321\1\xF7\202                                  386
+NOT            rm64                            \324\1\xF7\202                                  X64
+OR             mem,reg8                        \1\x08\101                                      8086,SM
+OR             reg8,reg8                       \1\x08\101                                      8086
+OR             mem,reg16                       \320\1\x09\101                                  8086,SM
+OR             reg16,reg16                     \320\1\x09\101                                  8086
+OR             mem,reg32                       \321\1\x09\101                                  386,SM
+OR             reg32,reg32                     \321\1\x09\101                                  386
+OR             mem,reg64                       \324\1\x09\101                                  X64,SM
+OR             reg64,reg64                     \324\1\x09\101                                  X64
+OR             reg8,mem                        \1\x0A\110                                      8086,SM
+OR             reg8,reg8                       \1\x0A\110                                      8086
+OR             reg16,mem                       \320\1\x0B\110                                  8086,SM
+OR             reg16,reg16                     \320\1\x0B\110                                  8086
+OR             reg32,mem                       \321\1\x0B\110                                  386,SM
+OR             reg32,reg32                     \321\1\x0B\110                                  386
+OR             reg64,mem                       \324\1\x0B\110                                  X64,SM
+OR             reg64,reg64                     \324\1\x0B\110                                  X64
+OR             rm16,imm8                       \320\1\x83\201\275                              8086
+OR             rm32,imm8                       \321\1\x83\201\275                              386
+OR             rm64,imm8                       \324\1\x83\201\275                              X64
+OR             reg_al,imm                      \1\x0C\21                                       8086,SM
+OR             reg_ax,sbyte16                  \320\1\x83\201\275                              8086,SM
+OR             reg_ax,imm                      \320\1\x0D\31                                   8086,SM
+OR             reg_eax,sbyte32                 \321\1\x83\201\275                              386,SM
+OR             reg_eax,imm                     \321\1\x0D\41                                   386,SM
+OR             reg_rax,sbyte64                 \324\1\x83\201\275                              X64,SM
+OR             reg_rax,imm                     \324\1\x0D\255                                  X64,SM
+OR             rm8,imm                         \1\x80\201\21                                   8086,SM
+OR             rm16,imm                        \320\145\x81\201\141                            8086,SM
+OR             rm32,imm                        \321\155\x81\201\151                            386,SM
+OR             rm64,imm                        \324\155\x81\201\251                            X64,SM
+OR             mem,imm8                        \1\x80\201\21                                   8086,SM
+OR             mem,imm16                       \320\145\x81\201\141                            8086,SM
+OR             mem,imm32                       \321\155\x81\201\151                            386,SM
+OUT            imm,reg_al                      \1\xE6\24                                       8086,SB
+OUT            imm,reg_ax                      \320\1\xE7\24                                   8086,SB
+OUT            imm,reg_eax                     \321\1\xE7\24                                   386,SB
+OUT            reg_dx,reg_al                   \1\xEE                                          8086
+OUT            reg_dx,reg_ax                   \320\1\xEF                                      8086
+OUT            reg_dx,reg_eax                  \321\1\xEF                                      386
+OUTSB          void                            \1\x6E                                          186
+OUTSD          void                            \321\1\x6F                                      386
+OUTSW          void                            \320\1\x6F                                      186
+PACKSSDW       mmxreg,mmxrm                    \360\323\2\x0F\x6B\110                          PENT,MMX,SQ
+PACKSSWB       mmxreg,mmxrm                    \360\323\2\x0F\x63\110                          PENT,MMX,SQ
+PACKUSWB       mmxreg,mmxrm                    \360\323\2\x0F\x67\110                          PENT,MMX,SQ
+PADDB          mmxreg,mmxrm                    \360\323\2\x0F\xFC\110                          PENT,MMX,SQ
+PADDD          mmxreg,mmxrm                    \360\323\2\x0F\xFE\110                          PENT,MMX,SQ
+PADDSB         mmxreg,mmxrm                    \360\323\2\x0F\xEC\110                          PENT,MMX,SQ
+PADDSIW                mmxreg,mmxrm                    \323\2\x0F\x51\110                              PENT,MMX,SQ,CYRIX
+PADDSW         mmxreg,mmxrm                    \360\323\2\x0F\xED\110                          PENT,MMX,SQ
+PADDUSB                mmxreg,mmxrm                    \360\323\2\x0F\xDC\110                          PENT,MMX,SQ
+PADDUSW                mmxreg,mmxrm                    \360\323\2\x0F\xDD\110                          PENT,MMX,SQ
+PADDW          mmxreg,mmxrm                    \360\323\2\x0F\xFD\110                          PENT,MMX,SQ
+PAND           mmxreg,mmxrm                    \360\323\2\x0F\xDB\110                          PENT,MMX,SQ
+PANDN          mmxreg,mmxrm                    \360\323\2\x0F\xDF\110                          PENT,MMX,SQ
+PAUSE          void                            \314\333\1\x90                                  8086
+PAVEB          mmxreg,mmxrm                    \323\2\x0F\x50\110                              PENT,MMX,SQ,CYRIX
+PAVGUSB                mmxreg,mmxrm                    \323\2\x0F\x0F\110\01\xBF                       PENT,3DNOW,SQ
+PCMPEQB                mmxreg,mmxrm                    \360\323\2\x0F\x74\110                          PENT,MMX,SQ
+PCMPEQD                mmxreg,mmxrm                    \360\323\2\x0F\x76\110                          PENT,MMX,SQ
+PCMPEQW                mmxreg,mmxrm                    \360\323\2\x0F\x75\110                          PENT,MMX,SQ
+PCMPGTB                mmxreg,mmxrm                    \360\323\2\x0F\x64\110                          PENT,MMX,SQ
+PCMPGTD                mmxreg,mmxrm                    \360\323\2\x0F\x66\110                          PENT,MMX,SQ
+PCMPGTW                mmxreg,mmxrm                    \360\323\2\x0F\x65\110                          PENT,MMX,SQ
+PDISTIB                mmxreg,mem                      \2\x0F\x54\110                                  PENT,MMX,SM,CYRIX
+PF2ID          mmxreg,mmxrm                    \323\2\x0F\x0F\110\01\x1D                       PENT,3DNOW,SQ
+PFACC          mmxreg,mmxrm                    \323\2\x0F\x0F\110\01\xAE                       PENT,3DNOW,SQ
+PFADD          mmxreg,mmxrm                    \323\2\x0F\x0F\110\01\x9E                       PENT,3DNOW,SQ
+PFCMPEQ                mmxreg,mmxrm                    \323\2\x0F\x0F\110\01\xB0                       PENT,3DNOW,SQ
+PFCMPGE                mmxreg,mmxrm                    \323\2\x0F\x0F\110\01\x90                       PENT,3DNOW,SQ
+PFCMPGT                mmxreg,mmxrm                    \323\2\x0F\x0F\110\01\xA0                       PENT,3DNOW,SQ
+PFMAX          mmxreg,mmxrm                    \323\2\x0F\x0F\110\01\xA4                       PENT,3DNOW,SQ
+PFMIN          mmxreg,mmxrm                    \323\2\x0F\x0F\110\01\x94                       PENT,3DNOW,SQ
+PFMUL          mmxreg,mmxrm                    \323\2\x0F\x0F\110\01\xB4                       PENT,3DNOW,SQ
+PFRCP          mmxreg,mmxrm                    \323\2\x0F\x0F\110\01\x96                       PENT,3DNOW,SQ
+PFRCPIT1       mmxreg,mmxrm                    \323\2\x0F\x0F\110\01\xA6                       PENT,3DNOW,SQ
+PFRCPIT2       mmxreg,mmxrm                    \323\2\x0F\x0F\110\01\xB6                       PENT,3DNOW,SQ
+PFRSQIT1       mmxreg,mmxrm                    \323\2\x0F\x0F\110\01\xA7                       PENT,3DNOW,SQ
+PFRSQRT                mmxreg,mmxrm                    \323\2\x0F\x0F\110\01\x97                       PENT,3DNOW,SQ
+PFSUB          mmxreg,mmxrm                    \323\2\x0F\x0F\110\01\x9A                       PENT,3DNOW,SQ
+PFSUBR         mmxreg,mmxrm                    \323\2\x0F\x0F\110\01\xAA                       PENT,3DNOW,SQ
+PI2FD          mmxreg,mmxrm                    \323\2\x0F\x0F\110\01\x0D                       PENT,3DNOW,SQ
+PMACHRIW       mmxreg,mem                      \2\x0F\x5E\110                                  PENT,MMX,SM,CYRIX
+PMADDWD                mmxreg,mmxrm                    \360\323\2\x0F\xF5\110                          PENT,MMX,SQ
+PMAGW          mmxreg,mmxrm                    \323\2\x0F\x52\110                              PENT,MMX,SQ,CYRIX
+PMULHRIW       mmxreg,mmxrm                    \323\2\x0F\x5D\110                              PENT,MMX,SQ,CYRIX
+PMULHRWA       mmxreg,mmxrm                    \323\2\x0F\x0F\110\1\xB7                        PENT,3DNOW,SQ
+PMULHRWC       mmxreg,mmxrm                    \323\2\x0F\x59\110                              PENT,MMX,SQ,CYRIX
+PMULHW         mmxreg,mmxrm                    \360\323\2\x0F\xE5\110                          PENT,MMX,SQ
+PMULLW         mmxreg,mmxrm                    \360\323\2\x0F\xD5\110                          PENT,MMX,SQ
+PMVGEZB                mmxreg,mem                      \2\x0F\x5C\110                                  PENT,MMX,SQ,CYRIX
+PMVLZB         mmxreg,mem                      \2\x0F\x5B\110                                  PENT,MMX,SQ,CYRIX
+PMVNZB         mmxreg,mem                      \2\x0F\x5A\110                                  PENT,MMX,SQ,CYRIX
+PMVZB          mmxreg,mem                      \2\x0F\x58\110                                  PENT,MMX,SQ,CYRIX
+POP            reg16                           \320\10\x58                                     8086
+POP            reg32                           \321\10\x58                                     386,NOLONG
+POP            reg64                           \323\10\x58                                     X64
+POP            rm16                            \320\1\x8F\200                                  8086
+POP            rm32                            \321\1\x8F\200                                  386,NOLONG
+POP            rm64                            \323\1\x8F\200                                  X64
+POP            reg_cs                          \1\x0F                                          8086,UNDOC,ND
+POP            reg_dess                        \345                                            8086,NOLONG
+POP            reg_fsgs                        \1\x0F\347                                      386
+POPA           void                            \322\1\x61                                      186,NOLONG
+POPAD          void                            \321\1\x61                                      386,NOLONG
+POPAW          void                            \320\1\x61                                      186,NOLONG
+POPF           void                            \322\1\x9D                                      8086
+POPFD          void                            \321\1\x9D                                      386,NOLONG
+POPFQ          void                            \321\1\x9D                                      X64
+POPFW          void                            \320\1\x9D                                      8086
+POR            mmxreg,mmxrm                    \360\323\2\x0F\xEB\110                          PENT,MMX,SQ
+PREFETCH       mem                             \2\x0F\x0D\200                                  PENT,3DNOW,SQ
+PREFETCHW      mem                             \2\x0F\x0D\201                                  PENT,3DNOW,SQ
+PSLLD          mmxreg,mmxrm                    \360\323\2\x0F\xF2\110                          PENT,MMX,SQ
+PSLLD          mmxreg,imm                      \360\2\x0F\x72\206\25                           PENT,MMX
+PSLLQ          mmxreg,mmxrm                    \360\323\2\x0F\xF3\110                          PENT,MMX,SQ
+PSLLQ          mmxreg,imm                      \360\2\x0F\x73\206\25                           PENT,MMX
+PSLLW          mmxreg,mmxrm                    \360\323\2\x0F\xF1\110                          PENT,MMX,SQ
+PSLLW          mmxreg,imm                      \360\2\x0F\x71\206\25                           PENT,MMX
+PSRAD          mmxreg,mmxrm                    \360\323\2\x0F\xE2\110                          PENT,MMX,SQ
+PSRAD          mmxreg,imm                      \360\2\x0F\x72\204\25                           PENT,MMX
+PSRAW          mmxreg,mmxrm                    \360\323\2\x0F\xE1\110                          PENT,MMX,SQ
+PSRAW          mmxreg,imm                      \360\2\x0F\x71\204\25                           PENT,MMX
+PSRLD          mmxreg,mmxrm                    \360\323\2\x0F\xD2\110                          PENT,MMX,SQ
+PSRLD          mmxreg,imm                      \360\2\x0F\x72\202\25                           PENT,MMX
+PSRLQ          mmxreg,mmxrm                    \360\323\2\x0F\xD3\110                          PENT,MMX,SQ
+PSRLQ          mmxreg,imm                      \360\2\x0F\x73\202\25                           PENT,MMX
+PSRLW          mmxreg,mmxrm                    \360\323\2\x0F\xD1\110                          PENT,MMX,SQ
+PSRLW          mmxreg,imm                      \360\2\x0F\x71\202\25                           PENT,MMX
+PSUBB          mmxreg,mmxrm                    \360\323\2\x0F\xF8\110                          PENT,MMX,SQ
+PSUBD          mmxreg,mmxrm                    \360\323\2\x0F\xFA\110                          PENT,MMX,SQ
+PSUBSB         mmxreg,mmxrm                    \360\323\2\x0F\xE8\110                          PENT,MMX,SQ
+PSUBSIW                mmxreg,mmxrm                    \323\2\x0F\x55\110                              PENT,MMX,SQ,CYRIX
+PSUBSW         mmxreg,mmxrm                    \360\323\2\x0F\xE9\110                          PENT,MMX,SQ
+PSUBUSB                mmxreg,mmxrm                    \360\323\2\x0F\xD8\110                          PENT,MMX,SQ
+PSUBUSW                mmxreg,mmxrm                    \360\323\2\x0F\xD9\110                          PENT,MMX,SQ
+PSUBW          mmxreg,mmxrm                    \360\323\2\x0F\xF9\110                          PENT,MMX,SQ
+PUNPCKHBW      mmxreg,mmxrm                    \360\323\2\x0F\x68\110                          PENT,MMX,SQ
+PUNPCKHDQ      mmxreg,mmxrm                    \360\323\2\x0F\x6A\110                          PENT,MMX,SQ
+PUNPCKHWD      mmxreg,mmxrm                    \360\323\2\x0F\x69\110                          PENT,MMX,SQ
+PUNPCKLBW      mmxreg,mmxrm                    \360\323\2\x0F\x60\110                          PENT,MMX,SQ
+PUNPCKLDQ      mmxreg,mmxrm                    \360\323\2\x0F\x62\110                          PENT,MMX,SQ
+PUNPCKLWD      mmxreg,mmxrm                    \360\323\2\x0F\x61\110                          PENT,MMX,SQ
+PUSH           reg16                           \320\10\x50                                     8086
+PUSH           reg32                           \321\10\x50                                     386,NOLONG
+PUSH           reg64                           \323\10\x50                                     X64
+PUSH           rm16                            \320\1\xFF\206                                  8086
+PUSH           rm32                            \321\1\xFF\206                                  386,NOLONG
+PUSH           rm64                            \323\1\xFF\206                                  X64
+PUSH           reg_cs                          \344                                            8086,NOLONG
+PUSH           reg_dess                        \344                                            8086,NOLONG
+PUSH           reg_fsgs                        \1\x0F\346                                      386
+PUSH           imm8                            \1\x6A\274                                      186
+PUSH           imm16                           \320\144\x68\140                                186,AR0,SZ
+PUSH           imm32                           \321\154\x68\150                                386,NOLONG,AR0,SZ
+PUSH           imm32                           \321\154\x68\150                                386,NOLONG,SD
+PUSH           imm64                           \323\154\x68\250                                X64,AR0,SZ
+PUSHA          void                            \322\1\x60                                      186,NOLONG
+PUSHAD         void                            \321\1\x60                                      386,NOLONG
+PUSHAW         void                            \320\1\x60                                      186,NOLONG
+PUSHF          void                            \322\1\x9C                                      8086
+PUSHFD         void                            \321\1\x9C                                      386,NOLONG
+PUSHFQ         void                            \321\1\x9C                                      X64
+PUSHFW         void                            \320\1\x9C                                      8086
+PXOR           mmxreg,mmxrm                    \360\323\2\x0F\xEF\110                          PENT,MMX,SQ
+RCL            rm8,unity                       \1\xD0\202                                      8086
+RCL            rm8,reg_cl                      \1\xD2\202                                      8086
+RCL            rm8,imm                         \1\xC0\202\25                                   186,SB
+RCL            rm16,unity                      \320\1\xD1\202                                  8086
+RCL            rm16,reg_cl                     \320\1\xD3\202                                  8086
+RCL            rm16,imm                        \320\1\xC1\202\25                               186,SB
+RCL            rm32,unity                      \321\1\xD1\202                                  386
+RCL            rm32,reg_cl                     \321\1\xD3\202                                  386
+RCL            rm32,imm                        \321\1\xC1\202\25                               386,SB
+RCL            rm64,unity                      \324\1\xD1\202                                  X64
+RCL            rm64,reg_cl                     \324\1\xD3\202                                  X64
+RCL            rm64,imm                        \324\1\xC1\202\25                               X64,SB
+RCR            rm8,unity                       \1\xD0\203                                      8086
+RCR            rm8,reg_cl                      \1\xD2\203                                      8086
+RCR            rm8,imm                         \1\xC0\203\25                                   186,SB
+RCR            rm16,unity                      \320\1\xD1\203                                  8086
+RCR            rm16,reg_cl                     \320\1\xD3\203                                  8086
+RCR            rm16,imm                        \320\1\xC1\203\25                               186,SB
+RCR            rm32,unity                      \321\1\xD1\203                                  386
+RCR            rm32,reg_cl                     \321\1\xD3\203                                  386
+RCR            rm32,imm                        \321\1\xC1\203\25                               386,SB
+RCR            rm64,unity                      \324\1\xD1\203                                  X64
+RCR            rm64,reg_cl                     \324\1\xD3\203                                  X64
+RCR            rm64,imm                        \324\1\xC1\203\25                               X64,SB
+RDSHR          rm32                            \321\2\x0F\x36\200                              P6,CYRIX,SMM
+RDMSR          void                            \2\x0F\x32                                      PENT,PRIV
+RDPMC          void                            \2\x0F\x33                                      P6
+RDTSC          void                            \2\x0F\x31                                      PENT
+RDTSCP         void                            \3\x0F\x01\xF9                                  X86_64
+RET            void                            \1\xC3                                          8086
+RET            imm                             \1\xC2\30                                       8086,SW
+RETF           void                            \1\xCB                                          8086
+RETF           imm                             \1\xCA\30                                       8086,SW
+RETN           void                            \1\xC3                                          8086
+RETN           imm                             \1\xC2\30                                       8086,SW
+ROL            rm8,unity                       \1\xD0\200                                      8086
+ROL            rm8,reg_cl                      \1\xD2\200                                      8086
+ROL            rm8,imm                         \1\xC0\200\25                                   186,SB
+ROL            rm16,unity                      \320\1\xD1\200                                  8086
+ROL            rm16,reg_cl                     \320\1\xD3\200                                  8086
+ROL            rm16,imm                        \320\1\xC1\200\25                               186,SB
+ROL            rm32,unity                      \321\1\xD1\200                                  386
+ROL            rm32,reg_cl                     \321\1\xD3\200                                  386
+ROL            rm32,imm                        \321\1\xC1\200\25                               386,SB
+ROL            rm64,unity                      \324\1\xD1\200                                  X64
+ROL            rm64,reg_cl                     \324\1\xD3\200                                  X64
+ROL            rm64,imm                        \324\1\xC1\200\25                               X64,SB
+ROR            rm8,unity                       \1\xD0\201                                      8086
+ROR            rm8,reg_cl                      \1\xD2\201                                      8086
+ROR            rm8,imm                         \1\xC0\201\25                                   186,SB
+ROR            rm16,unity                      \320\1\xD1\201                                  8086
+ROR            rm16,reg_cl                     \320\1\xD3\201                                  8086
+ROR            rm16,imm                        \320\1\xC1\201\25                               186,SB
+ROR            rm32,unity                      \321\1\xD1\201                                  386
+ROR            rm32,reg_cl                     \321\1\xD3\201                                  386
+ROR            rm32,imm                        \321\1\xC1\201\25                               386,SB
+ROR            rm64,unity                      \324\1\xD1\201                                  X64
+ROR            rm64,reg_cl                     \324\1\xD3\201                                  X64
+ROR            rm64,imm                        \324\1\xC1\201\25                               X64,SB
+RDM            void                            \2\x0F\x3A                                      P6,CYRIX,ND
+RSDC           reg_sreg,mem80                  \2\x0F\x79\110                                  486,CYRIX,SMM
+RSLDT          mem80                           \2\x0F\x7B\200                                  486,CYRIX,SMM
+RSM            void                            \2\x0F\xAA                                      PENT,SMM
+RSTS           mem80                           \2\x0F\x7D\200                                  486,CYRIX,SMM
+SAHF           void                            \1\x9E                                          8086
+SAL            rm8,unity                       \1\xD0\204                                      8086,ND
+SAL            rm8,reg_cl                      \1\xD2\204                                      8086,ND
+SAL            rm8,imm                         \1\xC0\204\25                                   186,ND,SB
+SAL            rm16,unity                      \320\1\xD1\204                                  8086,ND
+SAL            rm16,reg_cl                     \320\1\xD3\204                                  8086,ND
+SAL            rm16,imm                        \320\1\xC1\204\25                               186,ND,SB
+SAL            rm32,unity                      \321\1\xD1\204                                  386,ND
+SAL            rm32,reg_cl                     \321\1\xD3\204                                  386,ND
+SAL            rm32,imm                        \321\1\xC1\204\25                               386,ND,SB
+SAL            rm64,unity                      \324\1\xD1\204                                  X64,ND
+SAL            rm64,reg_cl                     \324\1\xD3\204                                  X64,ND
+SAL            rm64,imm                        \324\1\xC1\204\25                               X64,ND,SB
+SALC           void                            \1\xD6                                          8086,UNDOC
+SAR            rm8,unity                       \1\xD0\207                                      8086
+SAR            rm8,reg_cl                      \1\xD2\207                                      8086
+SAR            rm8,imm                         \1\xC0\207\25                                   186,SB
+SAR            rm16,unity                      \320\1\xD1\207                                  8086
+SAR            rm16,reg_cl                     \320\1\xD3\207                                  8086
+SAR            rm16,imm                        \320\1\xC1\207\25                               186,SB
+SAR            rm32,unity                      \321\1\xD1\207                                  386
+SAR            rm32,reg_cl                     \321\1\xD3\207                                  386
+SAR            rm32,imm                        \321\1\xC1\207\25                               386,SB
+SAR            rm64,unity                      \324\1\xD1\207                                  X64
+SAR            rm64,reg_cl                     \324\1\xD3\207                                  X64
+SAR            rm64,imm                        \324\1\xC1\207\25                               X64,SB
+SBB            mem,reg8                        \1\x18\101                                      8086,SM
+SBB            reg8,reg8                       \1\x18\101                                      8086
+SBB            mem,reg16                       \320\1\x19\101                                  8086,SM
+SBB            reg16,reg16                     \320\1\x19\101                                  8086
+SBB            mem,reg32                       \321\1\x19\101                                  386,SM
+SBB            reg32,reg32                     \321\1\x19\101                                  386
+SBB            mem,reg64                       \324\1\x19\101                                  X64,SM
+SBB            reg64,reg64                     \324\1\x19\101                                  X64
+SBB            reg8,mem                        \1\x1A\110                                      8086,SM
+SBB            reg8,reg8                       \1\x1A\110                                      8086
+SBB            reg16,mem                       \320\1\x1B\110                                  8086,SM
+SBB            reg16,reg16                     \320\1\x1B\110                                  8086
+SBB            reg32,mem                       \321\1\x1B\110                                  386,SM
+SBB            reg32,reg32                     \321\1\x1B\110                                  386
+SBB            reg64,mem                       \324\1\x1B\110                                  X64,SM
+SBB            reg64,reg64                     \324\1\x1B\110                                  X64
+SBB            rm16,imm8                       \320\1\x83\203\275                              8086
+SBB            rm32,imm8                       \321\1\x83\203\275                              386
+SBB            rm64,imm8                       \324\1\x83\203\275                              X64
+SBB            reg_al,imm                      \1\x1C\21                                       8086,SM
+SBB            reg_ax,sbyte16                  \320\1\x83\203\275                              8086,SM
+SBB            reg_ax,imm                      \320\1\x1D\31                                   8086,SM
+SBB            reg_eax,sbyte32                 \321\1\x83\203\275                              386,SM
+SBB            reg_eax,imm                     \321\1\x1D\41                                   386,SM
+SBB            reg_rax,sbyte64                 \324\1\x83\203\275                              X64,SM
+SBB            reg_rax,imm                     \324\1\x1D\255                                  X64,SM
+SBB            rm8,imm                         \1\x80\203\21                                   8086,SM
+SBB            rm16,imm                        \320\145\x81\203\141                            8086,SM
+SBB            rm32,imm                        \321\155\x81\203\151                            386,SM
+SBB            rm64,imm                        \324\155\x81\203\251                            X64,SM
+SBB            mem,imm8                        \1\x80\203\21                                   8086,SM
+SBB            mem,imm16                       \320\145\x81\203\141                            8086,SM
+SBB            mem,imm32                       \321\155\x81\203\151                            386,SM
+SCASB          void                            \335\1\xAE                                      8086
+SCASD          void                            \335\321\1\xAF                                  386
+SCASQ          void                            \335\324\1\xAF                                  X64
+SCASW          void                            \335\320\1\xAF                                  8086
+SFENCE         void                            \3\x0F\xAE\xF8                                  X64,AMD
+SGDT           mem                             \2\x0F\x01\200                                  286
+SHL            rm8,unity                       \1\xD0\204                                      8086
+SHL            rm8,reg_cl                      \1\xD2\204                                      8086
+SHL            rm8,imm                         \1\xC0\204\25                                   186,SB
+SHL            rm16,unity                      \320\1\xD1\204                                  8086
+SHL            rm16,reg_cl                     \320\1\xD3\204                                  8086
+SHL            rm16,imm                        \320\1\xC1\204\25                               186,SB
+SHL            rm32,unity                      \321\1\xD1\204                                  386
+SHL            rm32,reg_cl                     \321\1\xD3\204                                  386
+SHL            rm32,imm                        \321\1\xC1\204\25                               386,SB
+SHL            rm64,unity                      \324\1\xD1\204                                  X64
+SHL            rm64,reg_cl                     \324\1\xD3\204                                  X64
+SHL            rm64,imm                        \324\1\xC1\204\25                               X64,SB
+SHLD           mem,reg16,imm                   \320\2\x0F\xA4\101\26                           386,SM2,SB,AR2
+SHLD           reg16,reg16,imm                 \320\2\x0F\xA4\101\26                           386,SM2,SB,AR2
+SHLD           mem,reg32,imm                   \321\2\x0F\xA4\101\26                           386,SM2,SB,AR2
+SHLD           reg32,reg32,imm                 \321\2\x0F\xA4\101\26                           386,SM2,SB,AR2
+SHLD           mem,reg64,imm                   \324\2\x0F\xA4\101\26                           X64,SM2,SB,AR2
+SHLD           reg64,reg64,imm                 \324\2\x0F\xA4\101\26                           X64,SM2,SB,AR2
+SHLD           mem,reg16,reg_cl                \320\2\x0F\xA5\101                              386,SM
+SHLD           reg16,reg16,reg_cl              \320\2\x0F\xA5\101                              386
+SHLD           mem,reg32,reg_cl                \321\2\x0F\xA5\101                              386,SM
+SHLD           reg32,reg32,reg_cl              \321\2\x0F\xA5\101                              386
+SHLD           mem,reg64,reg_cl                \324\2\x0F\xA5\101                              X64,SM
+SHLD           reg64,reg64,reg_cl              \324\2\x0F\xA5\101                              X64
+SHR            rm8,unity                       \1\xD0\205                                      8086
+SHR            rm8,reg_cl                      \1\xD2\205                                      8086
+SHR            rm8,imm                         \1\xC0\205\25                                   186,SB
+SHR            rm16,unity                      \320\1\xD1\205                                  8086
+SHR            rm16,reg_cl                     \320\1\xD3\205                                  8086
+SHR            rm16,imm                        \320\1\xC1\205\25                               186,SB
+SHR            rm32,unity                      \321\1\xD1\205                                  386
+SHR            rm32,reg_cl                     \321\1\xD3\205                                  386
+SHR            rm32,imm                        \321\1\xC1\205\25                               386,SB
+SHR            rm64,unity                      \324\1\xD1\205                                  X64
+SHR            rm64,reg_cl                     \324\1\xD3\205                                  X64
+SHR            rm64,imm                        \324\1\xC1\205\25                               X64,SB
+SHRD           mem,reg16,imm                   \320\2\x0F\xAC\101\26                           386,SM2,SB,AR2
+SHRD           reg16,reg16,imm                 \320\2\x0F\xAC\101\26                           386,SM2,SB,AR2
+SHRD           mem,reg32,imm                   \321\2\x0F\xAC\101\26                           386,SM2,SB,AR2
+SHRD           reg32,reg32,imm                 \321\2\x0F\xAC\101\26                           386,SM2,SB,AR2
+SHRD           mem,reg64,imm                   \324\2\x0F\xAC\101\26                           X64,SM2,SB,AR2
+SHRD           reg64,reg64,imm                 \324\2\x0F\xAC\101\26                           X64,SM2,SB,AR2
+SHRD           mem,reg16,reg_cl                \320\2\x0F\xAD\101                              386,SM
+SHRD           reg16,reg16,reg_cl              \320\2\x0F\xAD\101                              386
+SHRD           mem,reg32,reg_cl                \321\2\x0F\xAD\101                              386,SM
+SHRD           reg32,reg32,reg_cl              \321\2\x0F\xAD\101                              386
+SHRD           mem,reg64,reg_cl                \324\2\x0F\xAD\101                              X64,SM
+SHRD           reg64,reg64,reg_cl              \324\2\x0F\xAD\101                              X64
+SIDT           mem                             \2\x0F\x01\201                                  286
+SLDT           mem                             \2\x0F\x00\200                                  286
+SLDT           mem16                           \2\x0F\x00\200                                  286
+SLDT           reg16                           \320\2\x0F\x00\200                              286
+SLDT           reg32                           \321\2\x0F\x00\200                              386
+SLDT           reg64                           \323\2\x0F\x00\200                              X64,ND
+SLDT           reg64                           \324\2\x0F\x00\200                              X64
+SKINIT         void                            \3\x0F\x01\xDE                                  X64
+SMI            void                            \1\xF1                                          386,UNDOC
+SMINT          void                            \2\x0F\x38                                      P6,CYRIX,ND
+; Older Cyrix chips had this; they had to move due to conflict with MMX
+SMINTOLD       void                            \2\x0F\x7E                                      486,CYRIX,ND
+SMSW           mem                             \2\x0F\x01\204                                  286
+SMSW           mem16                           \2\x0F\x01\204                                  286
+SMSW           reg16                           \320\2\x0F\x01\204                              286
+SMSW           reg32                           \321\2\x0F\x01\204                              386
+STC            void                            \1\xF9                                          8086
+STD            void                            \1\xFD                                          8086
+STGI           void                            \3\x0F\x01\xDC                                  X64
+STI            void                            \1\xFB                                          8086
+STOSB          void                            \1\xAA                                          8086
+STOSD          void                            \321\1\xAB                                      386
+STOSQ          void                            \324\1\xAB                                      X64
+STOSW          void                            \320\1\xAB                                      8086
+STR            mem                             \2\x0F\x00\201                                  286,PROT
+STR            mem16                           \2\x0F\x00\201                                  286,PROT
+STR            reg16                           \320\2\x0F\x00\201                              286,PROT
+STR            reg32                           \321\2\x0F\x00\201                              386,PROT
+STR            reg64                           \324\2\x0F\x00\201                              X64
+SUB            mem,reg8                        \1\x28\101                                      8086,SM
+SUB            reg8,reg8                       \1\x28\101                                      8086
+SUB            mem,reg16                       \320\1\x29\101                                  8086,SM
+SUB            reg16,reg16                     \320\1\x29\101                                  8086
+SUB            mem,reg32                       \321\1\x29\101                                  386,SM
+SUB            reg32,reg32                     \321\1\x29\101                                  386
+SUB            mem,reg64                       \324\1\x29\101                                  X64,SM
+SUB            reg64,reg64                     \324\1\x29\101                                  X64
+SUB            reg8,mem                        \1\x2A\110                                      8086,SM
+SUB            reg8,reg8                       \1\x2A\110                                      8086
+SUB            reg16,mem                       \320\1\x2B\110                                  8086,SM
+SUB            reg16,reg16                     \320\1\x2B\110                                  8086
+SUB            reg32,mem                       \321\1\x2B\110                                  386,SM
+SUB            reg32,reg32                     \321\1\x2B\110                                  386
+SUB            reg64,mem                       \324\1\x2B\110                                  X64,SM
+SUB            reg64,reg64                     \324\1\x2B\110                                  X64
+SUB            rm16,imm8                       \320\1\x83\205\275                              8086
+SUB            rm32,imm8                       \321\1\x83\205\275                              386
+SUB            rm64,imm8                       \324\1\x83\205\275                              X64
+SUB            reg_al,imm                      \1\x2C\21                                       8086,SM
+SUB            reg_ax,sbyte16                  \320\1\x83\205\275                              8086,SM
+SUB            reg_ax,imm                      \320\1\x2D\31                                   8086,SM
+SUB            reg_eax,sbyte32                 \321\1\x83\205\275                              386,SM
+SUB            reg_eax,imm                     \321\1\x2D\41                                   386,SM
+SUB            reg_rax,sbyte64                 \324\1\x83\205\275                              X64,SM
+SUB            reg_rax,imm                     \324\1\x2D\255                                  X64,SM
+SUB            rm8,imm                         \1\x80\205\21                                   8086,SM
+SUB            rm16,imm                        \320\145\x81\205\141                            8086,SM
+SUB            rm32,imm                        \321\155\x81\205\151                            386,SM
+SUB            rm64,imm                        \324\155\x81\205\251                            X64,SM
+SUB            mem,imm8                        \1\x80\205\21                                   8086,SM
+SUB            mem,imm16                       \320\145\x81\205\141                            8086,SM
+SUB            mem,imm32                       \321\155\x81\205\151                            386,SM
+SVDC           mem80,reg_sreg                  \2\x0F\x78\101                                  486,CYRIX,SMM
+SVLDT          mem80                           \2\x0F\x7A\200                                  486,CYRIX,SMM,ND
+SVTS           mem80                           \2\x0F\x7C\200                                  486,CYRIX,SMM
+SWAPGS         void                            \3\x0F\x01\xF8                                  X64
+SYSCALL                void                            \2\x0F\x05                                      P6,AMD
+SYSENTER       void                            \2\x0F\x34                                      P6
+SYSEXIT                void                            \2\x0F\x35                                      P6,PRIV
+SYSRET         void                            \2\x0F\x07                                      P6,PRIV,AMD
+TEST           mem,reg8                        \1\x84\101                                      8086,SM
+TEST           reg8,reg8                       \1\x84\101                                      8086
+TEST           mem,reg16                       \320\1\x85\101                                  8086,SM
+TEST           reg16,reg16                     \320\1\x85\101                                  8086
+TEST           mem,reg32                       \321\1\x85\101                                  386,SM
+TEST           reg32,reg32                     \321\1\x85\101                                  386
+TEST           mem,reg64                       \324\1\x85\101                                  X64,SM
+TEST           reg64,reg64                     \324\1\x85\101                                  X64
+TEST           reg8,mem                        \1\x84\110                                      8086,SM
+TEST           reg16,mem                       \320\1\x85\110                                  8086,SM
+TEST           reg32,mem                       \321\1\x85\110                                  386,SM
+TEST           reg64,mem                       \324\1\x85\110                                  X64,SM
+TEST           reg_al,imm                      \1\xA8\21                                       8086,SM
+TEST           reg_ax,imm                      \320\1\xA9\31                                   8086,SM
+TEST           reg_eax,imm                     \321\1\xA9\41                                   386,SM
+TEST           reg_rax,imm                     \324\1\xA9\255                                  X64,SM
+TEST           rm8,imm                         \1\xF6\200\21                                   8086,SM
+TEST           rm16,imm                        \320\1\xF7\200\31                               8086,SM
+TEST           rm32,imm                        \321\1\xF7\200\41                               386,SM
+TEST           rm64,imm                        \324\1\xF7\200\255                              X64,SM
+TEST           mem,imm8                        \1\xF6\200\21                                   8086,SM
+TEST           mem,imm16                       \320\1\xF7\200\31                               8086,SM
+TEST           mem,imm32                       \321\1\xF7\200\41                               386,SM
+UD0            void                            \2\x0F\xFF                                      186,UNDOC
+UD1            void                            \2\x0F\xB9                                      186,UNDOC
+UD2B           void                            \2\x0F\xB9                                      186,UNDOC,ND
+UD2            void                            \2\x0F\x0B                                      186
+UD2A           void                            \2\x0F\x0B                                      186,ND
+UMOV           mem,reg8                        \360\2\x0F\x10\101                              386,UNDOC,SM,ND
+UMOV           reg8,reg8                       \360\2\x0F\x10\101                              386,UNDOC,ND
+UMOV           mem,reg16                       \360\320\2\x0F\x11\101                          386,UNDOC,SM,ND
+UMOV           reg16,reg16                     \360\320\2\x0F\x11\101                          386,UNDOC,ND
+UMOV           mem,reg32                       \360\321\2\x0F\x11\101                          386,UNDOC,SM,ND
+UMOV           reg32,reg32                     \360\321\2\x0F\x11\101                          386,UNDOC,ND
+UMOV           reg8,mem                        \360\2\x0F\x12\110                              386,UNDOC,SM,ND
+UMOV           reg8,reg8                       \360\2\x0F\x12\110                              386,UNDOC,ND
+UMOV           reg16,mem                       \360\320\2\x0F\x13\110                          386,UNDOC,SM,ND
+UMOV           reg16,reg16                     \360\320\2\x0F\x13\110                          386,UNDOC,ND
+UMOV           reg32,mem                       \360\321\2\x0F\x13\110                          386,UNDOC,SM,ND
+UMOV           reg32,reg32                     \360\321\2\x0F\x13\110                          386,UNDOC,ND
+VERR           mem                             \2\x0F\x00\204                                  286,PROT
+VERR           mem16                           \2\x0F\x00\204                                  286,PROT
+VERR           reg16                           \2\x0F\x00\204                                  286,PROT
+VERW           mem                             \2\x0F\x00\205                                  286,PROT
+VERW           mem16                           \2\x0F\x00\205                                  286,PROT
+VERW           reg16                           \2\x0F\x00\205                                  286,PROT
+FWAIT          void                            \341                                            8086
+WBINVD         void                            \2\x0F\x09                                      486,PRIV
+WRSHR          rm32                            \321\2\x0F\x37\200                              P6,CYRIX,SMM
+WRMSR          void                            \2\x0F\x30                                      PENT,PRIV
+XADD           mem,reg8                        \2\x0F\xC0\101                                  486,SM
+XADD           reg8,reg8                       \2\x0F\xC0\101                                  486
+XADD           mem,reg16                       \320\2\x0F\xC1\101                              486,SM
+XADD           reg16,reg16                     \320\2\x0F\xC1\101                              486
+XADD           mem,reg32                       \321\2\x0F\xC1\101                              486,SM
+XADD           reg32,reg32                     \321\2\x0F\xC1\101                              486
+XADD           mem,reg64                       \324\2\x0F\xC1\101                              X64,SM
+XADD           reg64,reg64                     \324\2\x0F\xC1\101                              X64
+XBTS           reg16,mem                       \320\2\x0F\xA6\110                              386,SW,UNDOC,ND
+XBTS           reg16,reg16                     \320\2\x0F\xA6\110                              386,UNDOC,ND
+XBTS           reg32,mem                       \321\2\x0F\xA6\110                              386,SD,UNDOC,ND
+XBTS           reg32,reg32                     \321\2\x0F\xA6\110                              386,UNDOC,ND
+XCHG           reg_ax,reg16                    \320\11\x90                                     8086
+XCHG           reg_eax,reg32na                 \321\11\x90                                     386
+XCHG           reg_rax,reg64                   \324\11\x90                                     X64
+XCHG           reg16,reg_ax                    \320\10\x90                                     8086
+XCHG           reg32na,reg_eax                 \321\10\x90                                     386
+XCHG           reg64,reg_rax                   \324\10\x90                                     X64
+; This must be NOLONG since opcode 90 is NOP, and in 64-bit mode
+; "xchg eax,eax" is *not* a NOP.
+XCHG           reg_eax,reg_eax                 \321\1\x90                                      386,NOLONG
+XCHG           reg8,mem                        \1\x86\110                                      8086,SM
+XCHG           reg8,reg8                       \1\x86\110                                      8086
+XCHG           reg16,mem                       \320\1\x87\110                                  8086,SM
+XCHG           reg16,reg16                     \320\1\x87\110                                  8086
+XCHG           reg32,mem                       \321\1\x87\110                                  386,SM
+XCHG           reg32,reg32                     \321\1\x87\110                                  386
+XCHG           reg64,mem                       \324\1\x87\110                                  X64,SM
+XCHG           reg64,reg64                     \324\1\x87\110                                  X64
+XCHG           mem,reg8                        \1\x86\101                                      8086,SM
+XCHG           reg8,reg8                       \1\x86\101                                      8086
+XCHG           mem,reg16                       \320\1\x87\101                                  8086,SM
+XCHG           reg16,reg16                     \320\1\x87\101                                  8086
+XCHG           mem,reg32                       \321\1\x87\101                                  386,SM
+XCHG           reg32,reg32                     \321\1\x87\101                                  386
+XCHG           mem,reg64                       \324\1\x87\101                                  X64,SM
+XCHG           reg64,reg64                     \324\1\x87\101                                  X64
+XLATB          void                            \1\xD7                                          8086
+XLAT           void                            \1\xD7                                          8086
+XOR            mem,reg8                        \1\x30\101                                      8086,SM
+XOR            reg8,reg8                       \1\x30\101                                      8086
+XOR            mem,reg16                       \320\1\x31\101                                  8086,SM
+XOR            reg16,reg16                     \320\1\x31\101                                  8086
+XOR            mem,reg32                       \321\1\x31\101                                  386,SM
+XOR            reg32,reg32                     \321\1\x31\101                                  386
+XOR            mem,reg64                       \324\1\x31\101                                  X64,SM
+XOR            reg64,reg64                     \324\1\x31\101                                  X64
+XOR            reg8,mem                        \1\x32\110                                      8086,SM
+XOR            reg8,reg8                       \1\x32\110                                      8086
+XOR            reg16,mem                       \320\1\x33\110                                  8086,SM
+XOR            reg16,reg16                     \320\1\x33\110                                  8086
+XOR            reg32,mem                       \321\1\x33\110                                  386,SM
+XOR            reg32,reg32                     \321\1\x33\110                                  386
+XOR            reg64,mem                       \324\1\x33\110                                  X64,SM
+XOR            reg64,reg64                     \324\1\x33\110                                  X64
+XOR            rm16,imm8                       \320\1\x83\206\275                              8086
+XOR            rm32,imm8                       \321\1\x83\206\275                              386
+XOR            rm64,imm8                       \324\1\x83\206\275                              X64
+XOR            reg_al,imm                      \1\x34\21                                       8086,SM
+XOR            reg_ax,sbyte16                  \320\1\x83\206\275                              8086,SM
+XOR            reg_ax,imm                      \320\1\x35\31                                   8086,SM
+XOR            reg_eax,sbyte32                 \321\1\x83\206\275                              386,SM
+XOR            reg_eax,imm                     \321\1\x35\41                                   386,SM
+XOR            reg_rax,sbyte64                 \324\1\x83\206\275                              X64,SM
+XOR            reg_rax,imm                     \324\1\x35\255                                  X64,SM
+XOR            rm8,imm                         \1\x80\206\21                                   8086,SM
+XOR            rm16,imm                        \320\145\x81\206\141                            8086,SM
+XOR            rm32,imm                        \321\155\x81\206\151                            386,SM
+XOR            rm64,imm                        \324\155\x81\206\251                            X64,SM
+XOR            mem,imm8                        \1\x80\206\21                                   8086,SM
+XOR            mem,imm16                       \320\145\x81\206\141                            8086,SM
+XOR            mem,imm32                       \321\155\x81\206\151                            386,SM
+CMOVcc         reg16,mem                       \320\1\x0F\330\x40\110                          P6,SM
+CMOVcc         reg16,reg16                     \320\1\x0F\330\x40\110                          P6
+CMOVcc         reg32,mem                       \321\1\x0F\330\x40\110                          P6,SM
+CMOVcc         reg32,reg32                     \321\1\x0F\330\x40\110                          P6
+CMOVcc         reg64,mem                       \324\1\x0F\330\x40\110                          X64,SM
+CMOVcc         reg64,reg64                     \324\1\x0F\330\x40\110                          X64
+Jcc            imm|near                        \322\1\x0F\330\x80\64                           386
+Jcc            imm16|near                      \320\1\x0F\330\x80\64                           386
+Jcc            imm32|near                      \321\1\x0F\330\x80\64                           386
+Jcc            imm|short                       \330\x70\50                                     8086,ND
+Jcc            imm                             \370\330\x70\50                                 8086,ND
+Jcc            imm                             \1\x0F\330\x80\64                               386,ND
+Jcc            imm                             \330\x71\373\1\xE9\64                           8086,ND
+Jcc            imm                             \330\x70\50                                     8086
+SETcc          mem                             \1\x0F\330\x90\200                              386,SB
+SETcc          reg8                            \1\x0F\330\x90\200                              386
+
+;# Katmai Streaming SIMD instructions (SSE -- a.k.a. KNI, XMM, MMX2)
+ADDPS          xmmreg,xmmrm                    \360\2\x0F\x58\110                              KATMAI,SSE
+ADDSS          xmmreg,xmmrm                    \363\2\x0F\x58\110                              KATMAI,SSE,SD
+ANDNPS         xmmreg,xmmrm                    \360\2\x0F\x55\110                              KATMAI,SSE
+ANDPS          xmmreg,xmmrm                    \360\2\x0F\x54\110                              KATMAI,SSE
+CMPEQPS                xmmreg,xmmrm                    \360\2\x0F\xC2\110\1\x00                        KATMAI,SSE
+CMPEQSS                xmmreg,xmmrm                    \363\2\x0F\xC2\110\1\x00                        KATMAI,SSE
+CMPLEPS                xmmreg,xmmrm                    \360\2\x0F\xC2\110\1\x02                        KATMAI,SSE
+CMPLESS                xmmreg,xmmrm                    \363\2\x0F\xC2\110\1\x02                        KATMAI,SSE
+CMPLTPS                xmmreg,xmmrm                    \360\2\x0F\xC2\110\1\x01                        KATMAI,SSE
+CMPLTSS                xmmreg,xmmrm                    \363\2\x0F\xC2\110\1\x01                        KATMAI,SSE
+CMPNEQPS       xmmreg,xmmrm                    \360\2\x0F\xC2\110\1\x04                        KATMAI,SSE
+CMPNEQSS       xmmreg,xmmrm                    \363\2\x0F\xC2\110\1\x04                        KATMAI,SSE
+CMPNLEPS       xmmreg,xmmrm                    \360\2\x0F\xC2\110\1\x06                        KATMAI,SSE
+CMPNLESS       xmmreg,xmmrm                    \363\2\x0F\xC2\110\1\x06                        KATMAI,SSE
+CMPNLTPS       xmmreg,xmmrm                    \360\2\x0F\xC2\110\1\x05                        KATMAI,SSE
+CMPNLTSS       xmmreg,xmmrm                    \363\2\x0F\xC2\110\1\x05                        KATMAI,SSE
+CMPORDPS       xmmreg,xmmrm                    \360\2\x0F\xC2\110\1\x07                        KATMAI,SSE
+CMPORDSS       xmmreg,xmmrm                    \363\2\x0F\xC2\110\1\x07                        KATMAI,SSE
+CMPUNORDPS     xmmreg,xmmrm                    \360\2\x0F\xC2\110\1\x03                        KATMAI,SSE
+CMPUNORDSS     xmmreg,xmmrm                    \363\2\x0F\xC2\110\1\x03                        KATMAI,SSE
+; CMPPS/CMPSS must come after the specific ops; that way the disassembler will find the
+; specific ops first and only disassemble illegal ones as cmpps/cmpss.
+CMPPS          xmmreg,mem,imm                  \360\2\x0F\xC2\110\26                           KATMAI,SSE,SB,AR2
+CMPPS          xmmreg,xmmreg,imm               \360\2\x0F\xC2\110\26                           KATMAI,SSE,SB,AR2
+CMPSS          xmmreg,mem,imm                  \363\2\x0F\xC2\110\26                           KATMAI,SSE,SB,AR2
+CMPSS          xmmreg,xmmreg,imm               \363\2\x0F\xC2\110\26                           KATMAI,SSE,SB,AR2
+COMISS         xmmreg,xmmrm                    \360\2\x0F\x2F\110                              KATMAI,SSE
+CVTPI2PS       xmmreg,mmxrm                    \360\2\x0F\x2A\110                              KATMAI,SSE,MMX,SQ
+CVTPS2PI       mmxreg,xmmrm                    \360\2\x0F\x2D\110                              KATMAI,SSE,MMX,SQ
+CVTSI2SS       xmmreg,mem                      \363\2\x0F\x2A\110                              KATMAI,SSE,SD,AR1,ND
+CVTSI2SS       xmmreg,rm32                     \363\2\x0F\x2A\110                              KATMAI,SSE,SD,AR1
+CVTSI2SS       xmmreg,rm64                     \324\363\2\x0F\x2A\110                          X64,SSE,SQ,AR1
+CVTSS2SI       reg32,xmmreg                    \363\2\x0F\x2D\110                              KATMAI,SSE,SD,AR1
+CVTSS2SI       reg32,mem                       \363\2\x0F\x2D\110                              KATMAI,SSE,SD,AR1
+CVTSS2SI       reg64,xmmreg                    \324\363\2\x0F\x2D\110                          X64,SSE,SD,AR1
+CVTSS2SI       reg64,mem                       \324\363\2\x0F\x2D\110                          X64,SSE,SD,AR1
+CVTTPS2PI      mmxreg,xmmrm                    \360\2\x0F\x2C\110                              KATMAI,SSE,MMX,SQ
+CVTTSS2SI      reg32,xmmrm                     \363\2\x0F\x2C\110                              KATMAI,SSE,SD,AR1
+CVTTSS2SI      reg64,xmmrm                     \324\363\2\x0F\x2C\110                          X64,SSE,SD,AR1
+DIVPS          xmmreg,xmmrm                    \360\2\x0F\x5E\110                              KATMAI,SSE
+DIVSS          xmmreg,xmmrm                    \363\2\x0F\x5E\110                              KATMAI,SSE
+LDMXCSR                mem                             \2\x0F\xAE\202                                  KATMAI,SSE,SD
+MAXPS          xmmreg,xmmrm                    \360\2\x0F\x5F\110                              KATMAI,SSE
+MAXSS          xmmreg,xmmrm                    \363\2\x0F\x5F\110                              KATMAI,SSE
+MINPS          xmmreg,xmmrm                    \360\2\x0F\x5D\110                              KATMAI,SSE
+MINSS          xmmreg,xmmrm                    \363\2\x0F\x5D\110                              KATMAI,SSE
+MOVAPS         xmmreg,mem                      \360\2\x0F\x28\110                              KATMAI,SSE
+MOVAPS         mem,xmmreg                      \360\2\x0F\x29\101                              KATMAI,SSE
+MOVAPS         xmmreg,xmmreg                   \360\2\x0F\x28\110                              KATMAI,SSE
+MOVAPS         xmmreg,xmmreg                   \360\2\x0F\x29\101                              KATMAI,SSE
+MOVHPS         xmmreg,mem                      \360\2\x0F\x16\110                              KATMAI,SSE
+MOVHPS         mem,xmmreg                      \360\2\x0F\x17\101                              KATMAI,SSE
+MOVLHPS                xmmreg,xmmreg                   \360\2\x0F\x16\110                              KATMAI,SSE
+MOVLPS         xmmreg,mem                      \360\2\x0F\x12\110                              KATMAI,SSE
+MOVLPS         mem,xmmreg                      \360\2\x0F\x13\101                              KATMAI,SSE
+MOVHLPS                xmmreg,xmmreg                   \360\2\x0F\x12\110                              KATMAI,SSE
+MOVMSKPS       reg32,xmmreg                    \360\2\x0F\x50\110                              KATMAI,SSE
+MOVMSKPS       reg64,xmmreg                    \360\324\2\x0F\x50\110                          X64,SSE
+MOVNTPS                mem,xmmreg                      \360\2\x0F\x2B\101                              KATMAI,SSE
+MOVSS          xmmreg,mem                      \363\2\x0F\x10\110                              KATMAI,SSE
+MOVSS          mem,xmmreg                      \363\2\x0F\x11\101                              KATMAI,SSE
+MOVSS          xmmreg,xmmreg                   \363\2\x0F\x10\110                              KATMAI,SSE
+MOVSS          xmmreg,xmmreg                   \363\2\x0F\x11\101                              KATMAI,SSE
+MOVUPS         xmmreg,mem                      \360\2\x0F\x10\110                              KATMAI,SSE
+MOVUPS         mem,xmmreg                      \360\2\x0F\x11\101                              KATMAI,SSE
+MOVUPS         xmmreg,xmmreg                   \360\2\x0F\x10\110                              KATMAI,SSE
+MOVUPS         xmmreg,xmmreg                   \360\2\x0F\x11\101                              KATMAI,SSE
+MULPS          xmmreg,xmmrm                    \360\2\x0F\x59\110                              KATMAI,SSE
+MULSS          xmmreg,xmmrm                    \363\2\x0F\x59\110                              KATMAI,SSE
+ORPS           xmmreg,xmmrm                    \360\2\x0F\x56\110                              KATMAI,SSE
+RCPPS          xmmreg,xmmrm                    \360\2\x0F\x53\110                              KATMAI,SSE
+RCPSS          xmmreg,xmmrm                    \363\2\x0F\x53\110                              KATMAI,SSE
+RSQRTPS                xmmreg,xmmrm                    \360\2\x0F\x52\110                              KATMAI,SSE
+RSQRTSS                xmmreg,xmmrm                    \363\2\x0F\x52\110                              KATMAI,SSE
+SHUFPS         xmmreg,mem,imm                  \360\2\x0F\xC6\110\26                           KATMAI,SSE,SB,AR2
+SHUFPS         xmmreg,xmmreg,imm               \360\2\x0F\xC6\110\26                           KATMAI,SSE,SB,AR2
+SQRTPS         xmmreg,xmmrm                    \360\2\x0F\x51\110                              KATMAI,SSE
+SQRTSS         xmmreg,xmmrm                    \363\2\x0F\x51\110                              KATMAI,SSE
+STMXCSR                mem                             \2\x0F\xAE\203                                  KATMAI,SSE,SD
+SUBPS          xmmreg,xmmrm                    \360\2\x0F\x5C\110                              KATMAI,SSE
+SUBSS          xmmreg,xmmrm                    \363\2\x0F\x5C\110                              KATMAI,SSE
+UCOMISS                xmmreg,xmmrm                    \360\2\x0F\x2E\110                              KATMAI,SSE
+UNPCKHPS       xmmreg,xmmrm                    \360\2\x0F\x15\110                              KATMAI,SSE
+UNPCKLPS       xmmreg,xmmrm                    \360\2\x0F\x14\110                              KATMAI,SSE
+XORPS          xmmreg,xmmrm                    \360\2\x0F\x57\110                              KATMAI,SSE
+
+;# Introduced in Deschutes but necessary for SSE support
+FXRSTOR                mem                             \2\x0F\xAE\201                                  P6,SSE,FPU
+FXSAVE         mem                             \2\x0F\xAE\200                                  P6,SSE,FPU
+
+;# XSAVE group (AVX and extended state)
+; Introduced in late Penryn ... we really need to clean up the handling
+; of CPU feature bits.
+XGETBV         void                            \360\3\x0F\x01\xD0                              NEHALEM
+XSETBV         void                            \360\3\x0F\x01\xD1                              NEHALEM,PRIV
+XSAVE          mem                             \360\2\x0F\xAE\204                              NEHALEM
+XRSTOR         mem                             \360\2\x0F\xAE\205                              NEHALEM
+
+; These instructions are not SSE-specific; they are
+;# Generic memory operations
+; and work even if CR4.OSFXFR == 0
+PREFETCHNTA    mem                             \2\x0F\x18\200                                  KATMAI
+PREFETCHT0     mem                             \2\x0F\x18\201                                  KATMAI
+PREFETCHT1     mem                             \2\x0F\x18\202                                  KATMAI
+PREFETCHT2     mem                             \2\x0F\x18\203                                  KATMAI
+SFENCE         void                            \3\x0F\xAE\xF8                                  KATMAI
+
+;# New MMX instructions introduced in Katmai
+MASKMOVQ       mmxreg,mmxreg                   \360\2\x0F\xF7\110                              KATMAI,MMX
+MOVNTQ         mem,mmxreg                      \360\2\x0F\xE7\101                              KATMAI,MMX,SQ
+PAVGB          mmxreg,mmxrm                    \360\323\2\x0F\xE0\110                          KATMAI,MMX,SQ
+PAVGW          mmxreg,mmxrm                    \360\323\2\x0F\xE3\110                          KATMAI,MMX,SQ
+PEXTRW         reg32,mmxreg,imm                \360\2\x0F\xC5\110\26                           KATMAI,MMX,SB,AR2
+; PINSRW is documented as using a reg32, but it's really using only 16 bit
+; -- accept either, but be truthful in disassembly
+PINSRW         mmxreg,mem,imm                  \360\2\x0F\xC4\110\26                           KATMAI,MMX,SB,AR2
+PINSRW         mmxreg,rm16,imm                 \360\2\x0F\xC4\110\26                           KATMAI,MMX,SB,AR2
+PINSRW         mmxreg,reg32,imm                \360\2\x0F\xC4\110\26                           KATMAI,MMX,SB,AR2
+PMAXSW         mmxreg,mmxrm                    \360\323\2\x0F\xEE\110                          KATMAI,MMX,SQ
+PMAXUB         mmxreg,mmxrm                    \360\323\2\x0F\xDE\110                          KATMAI,MMX,SQ
+PMINSW         mmxreg,mmxrm                    \360\323\2\x0F\xEA\110                          KATMAI,MMX,SQ
+PMINUB         mmxreg,mmxrm                    \360\323\2\x0F\xDA\110                          KATMAI,MMX,SQ
+PMOVMSKB       reg32,mmxreg                    \360\2\x0F\xD7\110                              KATMAI,MMX
+PMULHUW                mmxreg,mmxrm                    \360\323\2\x0F\xE4\110                          KATMAI,MMX,SQ
+PSADBW         mmxreg,mmxrm                    \360\323\2\x0F\xF6\110                          KATMAI,MMX,SQ
+PSHUFW         mmxreg,mmxrm,imm                \360\323\2\x0F\x70\110\22                       KATMAI,MMX,SM2,SB,AR2
+
+;# AMD Enhanced 3DNow! (Athlon) instructions
+PF2IW          mmxreg,mmxrm                    \323\2\x0F\x0F\110\01\x1C                       PENT,3DNOW,SQ
+PFNACC         mmxreg,mmxrm                    \323\2\x0F\x0F\110\01\x8A                       PENT,3DNOW,SQ
+PFPNACC                mmxreg,mmxrm                    \323\2\x0F\x0F\110\01\x8E                       PENT,3DNOW,SQ
+PI2FW          mmxreg,mmxrm                    \323\2\x0F\x0F\110\01\x0C                       PENT,3DNOW,SQ
+PSWAPD         mmxreg,mmxrm                    \323\2\x0F\x0F\110\01\xBB                       PENT,3DNOW,SQ
+
+;# Willamette SSE2 Cacheability Instructions
+MASKMOVDQU     xmmreg,xmmreg                   \361\2\x0F\xF7\110                              WILLAMETTE,SSE2
+; CLFLUSH needs its own feature flag implemented one day
+CLFLUSH                mem                             \2\x0F\xAE\207                                  WILLAMETTE,SSE2
+MOVNTDQ                mem,xmmreg                      \361\2\x0F\xE7\101                              WILLAMETTE,SSE2,SO
+MOVNTI         mem,reg32                       \360\2\x0F\xC3\101                              WILLAMETTE,SD
+MOVNTI         mem,reg64                       \324\360\2\x0F\xC3\101                          X64,SQ
+MOVNTPD                mem,xmmreg                      \361\2\x0F\x2B\101                              WILLAMETTE,SSE2,SO
+LFENCE         void                            \3\x0F\xAE\xE8                                  WILLAMETTE,SSE2
+MFENCE         void                            \3\x0F\xAE\xF0                                  WILLAMETTE,SSE2
+
+;# Willamette MMX instructions (SSE2 SIMD Integer Instructions)
+MOVD           mem,xmmreg                      \361\317\2\x0F\x7E\101                          WILLAMETTE,SSE2,SD
+MOVD           xmmreg,mem                      \361\317\2\x0F\x6E\110                          WILLAMETTE,SSE2,SD
+MOVD           xmmreg,rm32                     \361\317\2\x0F\x6E\110                          WILLAMETTE,SSE2
+MOVD           rm32,xmmreg                     \361\317\2\x0F\x7E\101                          WILLAMETTE,SSE2
+MOVDQA         xmmreg,xmmreg                   \361\2\x0F\x6F\110                              WILLAMETTE,SSE2
+MOVDQA         mem,xmmreg                      \361\2\x0F\x7F\101                              WILLAMETTE,SSE2,SO
+MOVDQA         xmmreg,mem                      \361\2\x0F\x6F\110                              WILLAMETTE,SSE2,SO
+MOVDQA         xmmreg,xmmreg                   \361\2\x0F\x7F\101                              WILLAMETTE,SSE2
+MOVDQU         xmmreg,xmmreg                   \363\2\x0F\x6F\110                              WILLAMETTE,SSE2
+MOVDQU         mem,xmmreg                      \363\2\x0F\x7F\101                              WILLAMETTE,SSE2,SO
+MOVDQU         xmmreg,mem                      \363\2\x0F\x6F\110                              WILLAMETTE,SSE2,SO
+MOVDQU         xmmreg,xmmreg                   \363\2\x0F\x7F\101                              WILLAMETTE,SSE2
+MOVDQ2Q                mmxreg,xmmreg                   \362\2\x0F\xD6\110                              WILLAMETTE,SSE2
+MOVQ           xmmreg,xmmreg                   \363\2\x0F\x7E\110                              WILLAMETTE,SSE2
+MOVQ           xmmreg,xmmreg                   \361\2\x0F\xD6\101                              WILLAMETTE,SSE2
+MOVQ           mem,xmmreg                      \361\2\x0F\xD6\101                              WILLAMETTE,SSE2,SQ
+MOVQ           xmmreg,mem                      \363\2\x0F\x7E\110                              WILLAMETTE,SSE2,SQ
+MOVQ           xmmreg,rm64                     \361\324\2\x0F\x6E\110                          X64,SSE2
+MOVQ           rm64,xmmreg                     \361\324\2\x0F\x7E\101                          X64,SSE2
+MOVQ2DQ                xmmreg,mmxreg                   \363\2\x0F\xD6\110                              WILLAMETTE,SSE2
+PACKSSWB       xmmreg,xmmrm                    \361\2\x0F\x63\110                              WILLAMETTE,SSE2,SO
+PACKSSDW       xmmreg,xmmrm                    \361\2\x0F\x6B\110                              WILLAMETTE,SSE2,SO
+PACKUSWB       xmmreg,xmmrm                    \361\2\x0F\x67\110                              WILLAMETTE,SSE2,SO
+PADDB          xmmreg,xmmrm                    \361\2\x0F\xFC\110                              WILLAMETTE,SSE2,SO
+PADDW          xmmreg,xmmrm                    \361\2\x0F\xFD\110                              WILLAMETTE,SSE2,SO
+PADDD          xmmreg,xmmrm                    \361\2\x0F\xFE\110                              WILLAMETTE,SSE2,SO
+PADDQ          mmxreg,mmxrm                    \360\2\x0F\xD4\110                              WILLAMETTE,MMX,SQ
+PADDQ          xmmreg,xmmrm                    \361\2\x0F\xD4\110                              WILLAMETTE,SSE2,SO
+PADDSB         xmmreg,xmmrm                    \361\2\x0F\xEC\110                              WILLAMETTE,SSE2,SO
+PADDSW         xmmreg,xmmrm                    \361\2\x0F\xED\110                              WILLAMETTE,SSE2,SO
+PADDUSB                xmmreg,xmmrm                    \361\2\x0F\xDC\110                              WILLAMETTE,SSE2,SO
+PADDUSW                xmmreg,xmmrm                    \361\2\x0F\xDD\110                              WILLAMETTE,SSE2,SO
+PAND           xmmreg,xmmrm                    \361\2\x0F\xDB\110                              WILLAMETTE,SSE2,SO
+PANDN          xmmreg,xmmrm                    \361\2\x0F\xDF\110                              WILLAMETTE,SSE2,SO
+PAVGB          xmmreg,xmmrm                    \361\2\x0F\xE0\110                              WILLAMETTE,SSE2,SO
+PAVGW          xmmreg,xmmrm                    \361\2\x0F\xE3\110                              WILLAMETTE,SSE2,SO
+PCMPEQB                xmmreg,xmmrm                    \361\2\x0F\x74\110                              WILLAMETTE,SSE2,SO
+PCMPEQW                xmmreg,xmmrm                    \361\2\x0F\x75\110                              WILLAMETTE,SSE2,SO
+PCMPEQD                xmmreg,xmmrm                    \361\2\x0F\x76\110                              WILLAMETTE,SSE2,SO
+PCMPGTB                xmmreg,xmmrm                    \361\2\x0F\x64\110                              WILLAMETTE,SSE2,SO
+PCMPGTW                xmmreg,xmmrm                    \361\2\x0F\x65\110                              WILLAMETTE,SSE2,SO
+PCMPGTD                xmmreg,xmmrm                    \361\2\x0F\x66\110                              WILLAMETTE,SSE2,SO
+PEXTRW         reg32,xmmreg,imm                \361\2\x0F\xC5\110\26                           WILLAMETTE,SSE2,SB,AR2
+PINSRW         xmmreg,reg16,imm                \361\2\x0F\xC4\110\26                           WILLAMETTE,SSE2,SB,AR2
+PINSRW         xmmreg,reg32,imm                \361\2\x0F\xC4\110\26                           WILLAMETTE,SSE2,SB,AR2,ND
+PINSRW         xmmreg,mem,imm                  \361\2\x0F\xC4\110\26                           WILLAMETTE,SSE2,SB,AR2
+PINSRW         xmmreg,mem16,imm                \361\2\x0F\xC4\110\26                           WILLAMETTE,SSE2,SB,AR2
+PMADDWD                xmmreg,xmmrm                    \361\2\x0F\xF5\110                              WILLAMETTE,SSE2,SO
+PMAXSW         xmmreg,xmmrm                    \361\2\x0F\xEE\110                              WILLAMETTE,SSE2,SO
+PMAXUB         xmmreg,xmmrm                    \361\2\x0F\xDE\110                              WILLAMETTE,SSE2,SO
+PMINSW         xmmreg,xmmrm                    \361\2\x0F\xEA\110                              WILLAMETTE,SSE2,SO
+PMINUB         xmmreg,xmmrm                    \361\2\x0F\xDA\110                              WILLAMETTE,SSE2,SO
+PMOVMSKB       reg32,xmmreg                    \361\2\x0F\xD7\110                              WILLAMETTE,SSE2
+PMULHUW                xmmreg,xmmrm                    \361\2\x0F\xE4\110                              WILLAMETTE,SSE2,SO
+PMULHW         xmmreg,xmmrm                    \361\2\x0F\xE5\110                              WILLAMETTE,SSE2,SO
+PMULLW         xmmreg,xmmrm                    \361\2\x0F\xD5\110                              WILLAMETTE,SSE2,SO
+PMULUDQ                mmxreg,mmxrm                    \360\323\2\x0F\xF4\110                          WILLAMETTE,SSE2,SO
+PMULUDQ                xmmreg,xmmrm                    \361\2\x0F\xF4\110                              WILLAMETTE,SSE2,SO
+POR            xmmreg,xmmrm                    \361\2\x0F\xEB\110                              WILLAMETTE,SSE2,SO
+PSADBW         xmmreg,xmmrm                    \361\2\x0F\xF6\110                              WILLAMETTE,SSE2,SO
+PSHUFD         xmmreg,xmmreg,imm               \361\2\x0F\x70\110\22                           WILLAMETTE,SSE2,SB,AR2
+PSHUFD         xmmreg,mem,imm                  \361\2\x0F\x70\110\22                           WILLAMETTE,SSE2,SM2,SB,AR2
+PSHUFHW                xmmreg,xmmreg,imm               \363\2\x0F\x70\110\22                           WILLAMETTE,SSE2,SB,AR2
+PSHUFHW                xmmreg,mem,imm                  \363\2\x0F\x70\110\22                           WILLAMETTE,SSE2,SM2,SB,AR2
+PSHUFLW                xmmreg,xmmreg,imm               \362\2\x0F\x70\110\22                           WILLAMETTE,SSE2,SB,AR2
+PSHUFLW                xmmreg,mem,imm                  \362\2\x0F\x70\110\22                           WILLAMETTE,SSE2,SM2,SB,AR2
+PSLLDQ         xmmreg,imm                      \361\2\x0F\x73\207\25                           WILLAMETTE,SSE2,SB,AR1
+PSLLW          xmmreg,xmmrm                    \361\2\x0F\xF1\110                              WILLAMETTE,SSE2,SO
+PSLLW          xmmreg,imm                      \361\2\x0F\x71\206\25                           WILLAMETTE,SSE2,SB,AR1
+PSLLD          xmmreg,xmmrm                    \361\2\x0F\xF2\110                              WILLAMETTE,SSE2,SO
+PSLLD          xmmreg,imm                      \361\2\x0F\x72\206\25                           WILLAMETTE,SSE2,SB,AR1
+PSLLQ          xmmreg,xmmrm                    \361\2\x0F\xF3\110                              WILLAMETTE,SSE2,SO
+PSLLQ          xmmreg,imm                      \361\2\x0F\x73\206\25                           WILLAMETTE,SSE2,SB,AR1
+PSRAW          xmmreg,xmmrm                    \361\2\x0F\xE1\110                              WILLAMETTE,SSE2,SO
+PSRAW          xmmreg,imm                      \361\2\x0F\x71\204\25                           WILLAMETTE,SSE2,SB,AR1
+PSRAD          xmmreg,xmmrm                    \361\2\x0F\xE2\110                              WILLAMETTE,SSE2,SO
+PSRAD          xmmreg,imm                      \361\2\x0F\x72\204\25                           WILLAMETTE,SSE2,SB,AR1
+PSRLDQ         xmmreg,imm                      \361\2\x0F\x73\203\25                           WILLAMETTE,SSE2,SB,AR1
+PSRLW          xmmreg,xmmrm                    \361\2\x0F\xD1\110                              WILLAMETTE,SSE2,SO
+PSRLW          xmmreg,imm                      \361\2\x0F\x71\202\25                           WILLAMETTE,SSE2,SB,AR1
+PSRLD          xmmreg,xmmrm                    \361\2\x0F\xD2\110                              WILLAMETTE,SSE2,SO
+PSRLD          xmmreg,imm                      \361\2\x0F\x72\202\25                           WILLAMETTE,SSE2,SB,AR1
+PSRLQ          xmmreg,xmmrm                    \361\2\x0F\xD3\110                              WILLAMETTE,SSE2,SO
+PSRLQ          xmmreg,imm                      \361\2\x0F\x73\202\25                           WILLAMETTE,SSE2,SB,AR1
+PSUBB          xmmreg,xmmrm                    \361\2\x0F\xF8\110                              WILLAMETTE,SSE2,SO
+PSUBW          xmmreg,xmmrm                    \361\2\x0F\xF9\110                              WILLAMETTE,SSE2,SO
+PSUBD          xmmreg,xmmrm                    \361\2\x0F\xFA\110                              WILLAMETTE,SSE2,SO
+PSUBQ          mmxreg,mmxrm                    \360\323\2\x0F\xFB\110                          WILLAMETTE,SSE2,SO
+PSUBQ          xmmreg,xmmrm                    \361\2\x0F\xFB\110                              WILLAMETTE,SSE2,SO
+PSUBSB         xmmreg,xmmrm                    \361\2\x0F\xE8\110                              WILLAMETTE,SSE2,SO
+PSUBSW         xmmreg,xmmrm                    \361\2\x0F\xE9\110                              WILLAMETTE,SSE2,SO
+PSUBUSB                xmmreg,xmmrm                    \361\2\x0F\xD8\110                              WILLAMETTE,SSE2,SO
+PSUBUSW                xmmreg,xmmrm                    \361\2\x0F\xD9\110                              WILLAMETTE,SSE2,SO
+PUNPCKHBW      xmmreg,xmmrm                    \361\2\x0F\x68\110                              WILLAMETTE,SSE2,SO
+PUNPCKHWD      xmmreg,xmmrm                    \361\2\x0F\x69\110                              WILLAMETTE,SSE2,SO
+PUNPCKHDQ      xmmreg,xmmrm                    \361\2\x0F\x6A\110                              WILLAMETTE,SSE2,SO
+PUNPCKHQDQ     xmmreg,xmmrm                    \361\2\x0F\x6D\110                              WILLAMETTE,SSE2,SO
+PUNPCKLBW      xmmreg,xmmrm                    \361\2\x0F\x60\110                              WILLAMETTE,SSE2,SO
+PUNPCKLWD      xmmreg,xmmrm                    \361\2\x0F\x61\110                              WILLAMETTE,SSE2,SO
+PUNPCKLDQ      xmmreg,xmmrm                    \361\2\x0F\x62\110                              WILLAMETTE,SSE2,SO
+PUNPCKLQDQ     xmmreg,xmmrm                    \361\2\x0F\x6C\110                              WILLAMETTE,SSE2,SO
+PXOR           xmmreg,xmmrm                    \361\2\x0F\xEF\110                              WILLAMETTE,SSE2,SO
+
+;# Willamette Streaming SIMD instructions (SSE2)
+ADDPD          xmmreg,xmmrm                    \361\2\x0F\x58\110                              WILLAMETTE,SSE2,SO
+ADDSD          xmmreg,xmmrm                    \362\2\x0F\x58\110                              WILLAMETTE,SSE2,SQ
+ANDNPD         xmmreg,xmmrm                    \361\2\x0F\x55\110                              WILLAMETTE,SSE2,SO
+ANDPD          xmmreg,xmmrm                    \361\2\x0F\x54\110                              WILLAMETTE,SSE2,SO
+CMPEQPD                xmmreg,xmmrm                    \361\2\x0F\xC2\110\1\x00                        WILLAMETTE,SSE2,SO
+CMPEQSD                xmmreg,xmmrm                    \362\2\x0F\xC2\110\1\x00                        WILLAMETTE,SSE2
+CMPLEPD                xmmreg,xmmrm                    \361\2\x0F\xC2\110\1\x02                        WILLAMETTE,SSE2,SO
+CMPLESD                xmmreg,xmmrm                    \362\2\x0F\xC2\110\1\x02                        WILLAMETTE,SSE2
+CMPLTPD                xmmreg,xmmrm                    \361\2\x0F\xC2\110\1\x01                        WILLAMETTE,SSE2,SO
+CMPLTSD                xmmreg,xmmrm                    \362\2\x0F\xC2\110\1\x01                        WILLAMETTE,SSE2
+CMPNEQPD       xmmreg,xmmrm                    \361\2\x0F\xC2\110\1\x04                        WILLAMETTE,SSE2,SO
+CMPNEQSD       xmmreg,xmmrm                    \362\2\x0F\xC2\110\1\x04                        WILLAMETTE,SSE2
+CMPNLEPD       xmmreg,xmmrm                    \361\2\x0F\xC2\110\1\x06                        WILLAMETTE,SSE2,SO
+CMPNLESD       xmmreg,xmmrm                    \362\2\x0F\xC2\110\1\x06                        WILLAMETTE,SSE2
+CMPNLTPD       xmmreg,xmmrm                    \361\2\x0F\xC2\110\1\x05                        WILLAMETTE,SSE2,SO
+CMPNLTSD       xmmreg,xmmrm                    \362\2\x0F\xC2\110\1\x05                        WILLAMETTE,SSE2
+CMPORDPD       xmmreg,xmmrm                    \361\2\x0F\xC2\110\1\x07                        WILLAMETTE,SSE2,SO
+CMPORDSD       xmmreg,xmmrm                    \362\2\x0F\xC2\110\1\x07                        WILLAMETTE,SSE2
+CMPUNORDPD     xmmreg,xmmrm                    \361\2\x0F\xC2\110\1\x03                        WILLAMETTE,SSE2,SO
+CMPUNORDSD     xmmreg,xmmrm                    \362\2\x0F\xC2\110\1\x03                        WILLAMETTE,SSE2
+; CMPPD/CMPSD must come after the specific ops; that way the disassembler will find the
+; specific ops first and only disassemble illegal ones as cmppd/cmpsd.
+CMPPD          xmmreg,xmmrm,imm                \361\2\x0F\xC2\110\26                           WILLAMETTE,SSE2,SM2,SB,AR2
+CMPSD          xmmreg,xmmrm,imm                \362\2\x0F\xC2\110\26                           WILLAMETTE,SSE2,SB,AR2
+COMISD         xmmreg,xmmrm                    \361\2\x0F\x2F\110                              WILLAMETTE,SSE2
+CVTDQ2PD       xmmreg,xmmrm                    \363\2\x0F\xE6\110                              WILLAMETTE,SSE2,SQ
+CVTDQ2PS       xmmreg,xmmrm                    \360\2\x0F\x5B\110                              WILLAMETTE,SSE2,SO
+CVTPD2DQ       xmmreg,xmmrm                    \362\2\x0F\xE6\110                              WILLAMETTE,SSE2,SO
+CVTPD2PI       mmxreg,xmmrm                    \361\2\x0F\x2D\110                              WILLAMETTE,SSE2,SO
+CVTPD2PS       xmmreg,xmmrm                    \361\2\x0F\x5A\110                              WILLAMETTE,SSE2,SO
+CVTPI2PD       xmmreg,mmxrm                    \361\2\x0F\x2A\110                              WILLAMETTE,SSE2,SQ
+CVTPS2DQ       xmmreg,xmmrm                    \361\2\x0F\x5B\110                              WILLAMETTE,SSE2,SO
+CVTPS2PD       xmmreg,xmmrm                    \360\2\x0F\x5A\110                              WILLAMETTE,SSE2,SQ
+CVTSD2SI       reg32,xmmreg                    \362\2\x0F\x2D\110                              WILLAMETTE,SSE2,SQ,AR1
+CVTSD2SI       reg32,mem                       \362\2\x0F\x2D\110                              WILLAMETTE,SSE2,SQ,AR1
+CVTSD2SI       reg64,xmmreg                    \324\362\2\x0F\x2D\110                          X64,SSE2,SQ,AR1
+CVTSD2SI       reg64,mem                       \324\362\2\x0F\x2D\110                          X64,SSE2,SQ,AR1
+CVTSD2SS       xmmreg,xmmrm                    \362\2\x0F\x5A\110                              WILLAMETTE,SSE2,SQ
+CVTSI2SD       xmmreg,mem                      \362\2\x0F\x2A\110                              WILLAMETTE,SSE2,SD,AR1,ND
+CVTSI2SD       xmmreg,rm32                     \362\2\x0F\x2A\110                              WILLAMETTE,SSE2,SD,AR1
+CVTSI2SD       xmmreg,rm64                     \324\362\2\x0F\x2A\110                          X64,SSE2,SQ,AR1
+CVTSS2SD       xmmreg,xmmrm                    \363\2\x0F\x5A\110                              WILLAMETTE,SSE2,SD
+CVTTPD2PI      mmxreg,xmmrm                    \361\2\x0F\x2C\110                              WILLAMETTE,SSE2,SO
+CVTTPD2DQ      xmmreg,xmmrm                    \361\2\x0F\xE6\110                              WILLAMETTE,SSE2,SO
+CVTTPS2DQ      xmmreg,xmmrm                    \363\2\x0F\x5B\110                              WILLAMETTE,SSE2,SO
+CVTTSD2SI      reg32,xmmreg                    \362\2\x0F\x2C\110                              WILLAMETTE,SSE2,SQ,AR1
+CVTTSD2SI      reg32,mem                       \362\2\x0F\x2C\110                              WILLAMETTE,SSE2,SQ,AR1
+CVTTSD2SI      reg64,xmmreg                    \324\362\2\x0F\x2C\110                          X64,SSE2,SQ,AR1
+CVTTSD2SI      reg64,mem                       \324\362\2\x0F\x2C\110                          X64,SSE2,SQ,AR1
+DIVPD          xmmreg,xmmrm                    \361\2\x0F\x5E\110                              WILLAMETTE,SSE2,SO
+DIVSD          xmmreg,xmmrm                    \362\2\x0F\x5E\110                              WILLAMETTE,SSE2
+MAXPD          xmmreg,xmmrm                    \361\2\x0F\x5F\110                              WILLAMETTE,SSE2,SO
+MAXSD          xmmreg,xmmrm                    \362\2\x0F\x5F\110                              WILLAMETTE,SSE2
+MINPD          xmmreg,xmmrm                    \361\2\x0F\x5D\110                              WILLAMETTE,SSE2,SO
+MINSD          xmmreg,xmmrm                    \362\2\x0F\x5D\110                              WILLAMETTE,SSE2
+MOVAPD         xmmreg,xmmreg                   \361\2\x0F\x28\110                              WILLAMETTE,SSE2
+MOVAPD         xmmreg,xmmreg                   \361\2\x0F\x29\101                              WILLAMETTE,SSE2
+MOVAPD         mem,xmmreg                      \361\2\x0F\x29\101                              WILLAMETTE,SSE2,SO
+MOVAPD         xmmreg,mem                      \361\2\x0F\x28\110                              WILLAMETTE,SSE2,SO
+MOVHPD         mem,xmmreg                      \361\2\x0F\x17\101                              WILLAMETTE,SSE2
+MOVHPD         xmmreg,mem                      \361\2\x0F\x16\110                              WILLAMETTE,SSE2
+MOVLPD         mem,xmmreg                      \361\2\x0F\x13\101                              WILLAMETTE,SSE2
+MOVLPD         xmmreg,mem                      \361\2\x0F\x12\110                              WILLAMETTE,SSE2
+MOVMSKPD       reg32,xmmreg                    \361\2\x0F\x50\110                              WILLAMETTE,SSE2
+MOVMSKPD       reg64,xmmreg                    \361\324\2\x0F\x50\110                          X64,SSE2
+MOVSD          xmmreg,xmmreg                   \362\2\x0F\x10\110                              WILLAMETTE,SSE2
+MOVSD          xmmreg,xmmreg                   \362\2\x0F\x11\101                              WILLAMETTE,SSE2
+MOVSD          mem,xmmreg                      \362\2\x0F\x11\101                              WILLAMETTE,SSE2
+MOVSD          xmmreg,mem                      \362\2\x0F\x10\110                              WILLAMETTE,SSE2
+MOVUPD         xmmreg,xmmreg                   \361\2\x0F\x10\110                              WILLAMETTE,SSE2
+MOVUPD         xmmreg,xmmreg                   \361\2\x0F\x11\101                              WILLAMETTE,SSE2
+MOVUPD         mem,xmmreg                      \361\2\x0F\x11\101                              WILLAMETTE,SSE2,SO
+MOVUPD         xmmreg,mem                      \361\2\x0F\x10\110                              WILLAMETTE,SSE2,SO
+MULPD          xmmreg,xmmrm                    \361\2\x0F\x59\110                              WILLAMETTE,SSE2,SO
+MULSD          xmmreg,xmmrm                    \362\2\x0F\x59\110                              WILLAMETTE,SSE2
+ORPD           xmmreg,xmmrm                    \361\2\x0F\x56\110                              WILLAMETTE,SSE2,SO
+SHUFPD         xmmreg,xmmreg,imm               \361\2\x0F\xC6\110\26                           WILLAMETTE,SSE2,SB,AR2
+SHUFPD         xmmreg,mem,imm                  \361\2\x0F\xC6\110\26                           WILLAMETTE,SSE2,SM,SB,AR2
+SQRTPD         xmmreg,xmmrm                    \361\2\x0F\x51\110                              WILLAMETTE,SSE2,SO
+SQRTSD         xmmreg,xmmrm                    \362\2\x0F\x51\110                              WILLAMETTE,SSE2
+SUBPD          xmmreg,xmmrm                    \361\2\x0F\x5C\110                              WILLAMETTE,SSE2,SO
+SUBSD          xmmreg,xmmrm                    \362\2\x0F\x5C\110                              WILLAMETTE,SSE2
+UCOMISD                xmmreg,xmmrm                    \361\2\x0F\x2E\110                              WILLAMETTE,SSE2
+UNPCKHPD       xmmreg,xmmrm                    \361\2\x0F\x15\110                              WILLAMETTE,SSE2,SO
+UNPCKLPD       xmmreg,xmmrm                    \361\2\x0F\x14\110                              WILLAMETTE,SSE2,SO
+XORPD          xmmreg,xmmrm                    \361\2\x0F\x57\110                              WILLAMETTE,SSE2,SO
+
+;# Prescott New Instructions (SSE3)
+ADDSUBPD       xmmreg,xmmrm                    \361\2\x0F\xD0\110                              PRESCOTT,SSE3,SO
+ADDSUBPS       xmmreg,xmmrm                    \362\2\x0F\xD0\110                              PRESCOTT,SSE3,SO
+HADDPD         xmmreg,xmmrm                    \361\2\x0F\x7C\110                              PRESCOTT,SSE3,SO
+HADDPS         xmmreg,xmmrm                    \362\2\x0F\x7C\110                              PRESCOTT,SSE3,SO
+HSUBPD         xmmreg,xmmrm                    \361\2\x0F\x7D\110                              PRESCOTT,SSE3,SO
+HSUBPS         xmmreg,xmmrm                    \362\2\x0F\x7D\110                              PRESCOTT,SSE3,SO
+LDDQU          xmmreg,mem                      \362\2\x0F\xF0\110                              PRESCOTT,SSE3,SO
+MOVDDUP                xmmreg,xmmrm                    \362\2\x0F\x12\110                              PRESCOTT,SSE3
+MOVSHDUP       xmmreg,xmmrm                    \363\2\x0F\x16\110                              PRESCOTT,SSE3
+MOVSLDUP       xmmreg,xmmrm                    \363\2\x0F\x12\110                              PRESCOTT,SSE3
+
+;# VMX Instructions
+VMCALL         void                            \3\x0F\x01\xC1                                  VMX
+VMCLEAR                mem                             \361\2\x0F\xC7\206                              VMX
+VMLAUNCH       void                            \3\x0F\x01\xC2                                  VMX
+VMLOAD         void                            \3\x0F\x01\xDA                                  X64,VMX
+VMMCALL                void                            \3\x0F\x01\xD9                                  X64,VMX
+VMPTRLD                mem                             \2\x0F\xC7\206                                  VMX
+VMPTRST                mem                             \2\x0F\xC7\207                                  VMX
+VMREAD         rm32,reg32                      \360\2\x0F\x78\101                              VMX,NOLONG,SD
+VMREAD         rm64,reg64                      \323\360\2\x0F\x78\101                          X64,VMX,SQ
+VMRESUME       void                            \3\x0F\x01\xC3                                  VMX
+VMRUN          void                            \3\x0F\x01\xD8                                  X64,VMX
+VMSAVE         void                            \3\x0F\x01\xDB                                  X64,VMX
+VMWRITE                reg32,rm32                      \360\2\x0F\x79\110                              VMX,NOLONG,SD
+VMWRITE                reg64,rm64                      \323\360\2\x0F\x79\110                          X64,VMX,SQ
+VMXOFF         void                            \3\x0F\x01\xC4                                  VMX
+VMXON          mem                             \363\2\x0F\xC7\206                              VMX
+;# Extended Page Tables VMX instructions
+INVEPT         reg32,mem                       [rm: 66 0f 38 80 /r]                            VMX,SO,NOLONG
+INVEPT         reg64,mem                       [rm: o64nw 66 0f 38 80 /r]                      VMX,SO,LONG
+INVVPID                reg32,mem                       [rm: 66 0f 38 81 /r]                            VMX,SO,NOLONG
+INVVPID                reg64,mem                       [rm: o64nw 66 0f 38 81 /r]                      VMX,SO,LONG
+
+;# Tejas New Instructions (SSSE3)
+PABSB          mmxreg,mmxrm                    \360\3\x0F\x38\x1C\110                          SSSE3,MMX,SQ
+PABSB          xmmreg,xmmrm                    \361\3\x0F\x38\x1C\110                          SSSE3
+PABSW          mmxreg,mmxrm                    \360\3\x0F\x38\x1D\110                          SSSE3,MMX,SQ
+PABSW          xmmreg,xmmrm                    \361\3\x0F\x38\x1D\110                          SSSE3
+PABSD          mmxreg,mmxrm                    \360\3\x0F\x38\x1E\110                          SSSE3,MMX,SQ
+PABSD          xmmreg,xmmrm                    \361\3\x0F\x38\x1E\110                          SSSE3
+PALIGNR                mmxreg,mmxrm,imm                \360\3\x0F\x3A\x0F\110\26                       SSSE3,MMX,SQ
+PALIGNR                xmmreg,xmmrm,imm                \361\3\x0F\x3A\x0F\110\26                       SSSE3
+PHADDW         mmxreg,mmxrm                    \360\3\x0F\x38\x01\110                          SSSE3,MMX,SQ
+PHADDW         xmmreg,xmmrm                    \361\3\x0F\x38\x01\110                          SSSE3
+PHADDD         mmxreg,mmxrm                    \360\3\x0F\x38\x02\110                          SSSE3,MMX,SQ
+PHADDD         xmmreg,xmmrm                    \361\3\x0F\x38\x02\110                          SSSE3
+PHADDSW                mmxreg,mmxrm                    \360\3\x0F\x38\x03\110                          SSSE3,MMX,SQ
+PHADDSW                xmmreg,xmmrm                    \361\3\x0F\x38\x03\110                          SSSE3
+PHSUBW         mmxreg,mmxrm                    \360\3\x0F\x38\x05\110                          SSSE3,MMX,SQ
+PHSUBW         xmmreg,xmmrm                    \361\3\x0F\x38\x05\110                          SSSE3
+PHSUBD         mmxreg,mmxrm                    \360\3\x0F\x38\x06\110                          SSSE3,MMX,SQ
+PHSUBD         xmmreg,xmmrm                    \361\3\x0F\x38\x06\110                          SSSE3
+PHSUBSW                mmxreg,mmxrm                    \360\3\x0F\x38\x07\110                          SSSE3,MMX,SQ
+PHSUBSW                xmmreg,xmmrm                    \361\3\x0F\x38\x07\110                          SSSE3
+PMADDUBSW      mmxreg,mmxrm                    \360\3\x0F\x38\x04\110                          SSSE3,MMX,SQ
+PMADDUBSW      xmmreg,xmmrm                    \361\3\x0F\x38\x04\110                          SSSE3
+PMULHRSW       mmxreg,mmxrm                    \360\3\x0F\x38\x0B\110                          SSSE3,MMX,SQ
+PMULHRSW       xmmreg,xmmrm                    \361\3\x0F\x38\x0B\110                          SSSE3
+PSHUFB         mmxreg,mmxrm                    \360\3\x0F\x38\x00\110                          SSSE3,MMX,SQ
+PSHUFB         xmmreg,xmmrm                    \361\3\x0F\x38\x00\110                          SSSE3
+PSIGNB         mmxreg,mmxrm                    \360\3\x0F\x38\x08\110                          SSSE3,MMX,SQ
+PSIGNB         xmmreg,xmmrm                    \361\3\x0F\x38\x08\110                          SSSE3
+PSIGNW         mmxreg,mmxrm                    \360\3\x0F\x38\x09\110                          SSSE3,MMX,SQ
+PSIGNW         xmmreg,xmmrm                    \361\3\x0F\x38\x09\110                          SSSE3
+PSIGND         mmxreg,mmxrm                    \360\3\x0F\x38\x0A\110                          SSSE3,MMX,SQ
+PSIGND         xmmreg,xmmrm                    \361\3\x0F\x38\x0A\110                          SSSE3
+
+;# AMD SSE4A
+EXTRQ          xmmreg,imm,imm                  \361\2\x0F\x78\200\25\26                        SSE4A,AMD
+EXTRQ          xmmreg,xmmreg                   \361\2\x0F\x79\110                              SSE4A,AMD
+INSERTQ                xmmreg,xmmreg,imm,imm           \362\2\x0F\x78\110\26\27                        SSE4A,AMD
+INSERTQ                xmmreg,xmmreg                   \362\2\x0F\x79\110                              SSE4A,AMD
+MOVNTSD                mem,xmmreg                      \362\2\x0F\x2B\101                              SSE4A,AMD,SQ
+MOVNTSS                mem,xmmreg                      \363\2\x0F\x2B\101                              SSE4A,AMD,SD
+
+;# New instructions in Barcelona
+LZCNT          reg16,rm16                      \320\333\2\x0F\xBD\110                          P6,AMD
+LZCNT          reg32,rm32                      \321\333\2\x0F\xBD\110                          P6,AMD
+LZCNT          reg64,rm64                      \324\333\2\x0F\xBD\110                          X64,AMD
+
+;# Penryn New Instructions (SSE4.1)
+BLENDPD                xmmreg,xmmrm,imm                \361\3\x0F\x3A\x0D\110\26                       SSE41
+BLENDPS                xmmreg,xmmrm,imm                \361\3\x0F\x3A\x0C\110\26                       SSE41
+BLENDVPD       xmmreg,xmmrm,xmm0               \361\3\x0F\x38\x15\110                          SSE41
+BLENDVPS       xmmreg,xmmrm,xmm0               \361\3\x0F\x38\x14\110                          SSE41
+DPPD           xmmreg,xmmrm,imm                \361\3\x0F\x3A\x41\110\26                       SSE41
+DPPS           xmmreg,xmmrm,imm                \361\3\x0F\x3A\x40\110\26                       SSE41
+EXTRACTPS      rm32,xmmreg,imm                 \361\3\x0F\x3A\x17\101\26                       SSE41
+EXTRACTPS      reg64,xmmreg,imm                \324\361\3\x0F\x3A\x17\101\26                   SSE41,X64
+INSERTPS       xmmreg,xmmrm,imm                \361\3\x0F\x3A\x21\110\26                       SSE41,SD
+MOVNTDQA       xmmreg,mem                      \361\3\x0F\x38\x2A\110                          SSE41
+MPSADBW                xmmreg,xmmrm,imm                \361\3\x0F\x3A\x42\110\26                       SSE41
+PACKUSDW       xmmreg,xmmrm                    \361\3\x0F\x38\x2B\110                          SSE41
+PBLENDVB       xmmreg,xmmrm,xmm0               \361\3\x0F\x38\x10\110                          SSE41
+PBLENDW                xmmreg,xmmrm,imm                \361\3\x0F\x3A\x0E\110\26                       SSE41
+PCMPEQQ                xmmreg,xmmrm                    \361\3\x0F\x38\x29\110                          SSE41
+PEXTRB         reg32,xmmreg,imm                \361\3\x0F\x3A\x14\101\26                       SSE41
+PEXTRB         mem8,xmmreg,imm                 \361\3\x0F\x3A\x14\101\26                       SSE41
+PEXTRB         reg64,xmmreg,imm                \324\361\3\x0F\x3A\x14\101\26                   SSE41,X64
+PEXTRD         rm32,xmmreg,imm                 \361\3\x0F\x3A\x16\101\26                       SSE41
+PEXTRQ         rm64,xmmreg,imm                 \324\361\3\x0F\x3A\x16\101\26                   SSE41,X64
+PEXTRW         reg32,xmmreg,imm                \361\3\x0F\x3A\x15\101\26                       SSE41
+PEXTRW         mem16,xmmreg,imm                \361\3\x0F\x3A\x15\101\26                       SSE41
+PEXTRW         reg64,xmmreg,imm                \324\361\3\x0F\x3A\x15\101\26                   SSE41,X64
+PHMINPOSUW     xmmreg,xmmrm                    \361\3\x0F\x38\x41\110                          SSE41
+PINSRB         xmmreg,mem,imm                  \361\3\x0F\x3A\x20\110\26                       SSE41,SB,AR2
+PINSRB         xmmreg,rm8,imm                  \325\361\3\x0F\x3A\x20\110\26                   SSE41,SB,AR2
+PINSRB         xmmreg,reg32,imm                \361\3\x0F\x3A\x20\110\26                       SSE41,SB,AR2
+PINSRD         xmmreg,mem,imm                  \361\3\x0F\x3A\x22\110\26                       SSE41,SB,AR2
+PINSRD         xmmreg,rm32,imm                 \361\3\x0F\x3A\x22\110\26                       SSE41,SB,AR2
+PINSRQ         xmmreg,mem,imm                  \324\361\3\x0F\x3A\x22\110\26                   SSE41,X64,SB,AR2
+PINSRQ         xmmreg,rm64,imm                 \324\361\3\x0F\x3A\x22\110\26                   SSE41,X64,SB,AR2
+PMAXSB         xmmreg,xmmrm                    \361\3\x0F\x38\x3C\110                          SSE41
+PMAXSD         xmmreg,xmmrm                    \361\3\x0F\x38\x3D\110                          SSE41
+PMAXUD         xmmreg,xmmrm                    \361\3\x0F\x38\x3F\110                          SSE41
+PMAXUW         xmmreg,xmmrm                    \361\3\x0F\x38\x3E\110                          SSE41
+PMINSB         xmmreg,xmmrm                    \361\3\x0F\x38\x38\110                          SSE41
+PMINSD         xmmreg,xmmrm                    \361\3\x0F\x38\x39\110                          SSE41
+PMINUD         xmmreg,xmmrm                    \361\3\x0F\x38\x3B\110                          SSE41
+PMINUW         xmmreg,xmmrm                    \361\3\x0F\x38\x3A\110                          SSE41
+PMOVSXBW       xmmreg,xmmrm                    \361\3\x0F\x38\x20\110                          SSE41,SQ
+PMOVSXBD       xmmreg,xmmrm                    \361\3\x0F\x38\x21\110                          SSE41,SD
+PMOVSXBQ       xmmreg,xmmrm                    \361\3\x0F\x38\x22\110                          SSE41,SW
+PMOVSXWD       xmmreg,xmmrm                    \361\3\x0F\x38\x23\110                          SSE41,SQ
+PMOVSXWQ       xmmreg,xmmrm                    \361\3\x0F\x38\x24\110                          SSE41,SD
+PMOVSXDQ       xmmreg,xmmrm                    \361\3\x0F\x38\x25\110                          SSE41,SQ
+PMOVZXBW       xmmreg,xmmrm                    \361\3\x0F\x38\x30\110                          SSE41,SQ
+PMOVZXBD       xmmreg,xmmrm                    \361\3\x0F\x38\x31\110                          SSE41,SD
+PMOVZXBQ       xmmreg,xmmrm                    \361\3\x0F\x38\x32\110                          SSE41,SW
+PMOVZXWD       xmmreg,xmmrm                    \361\3\x0F\x38\x33\110                          SSE41,SQ
+PMOVZXWQ       xmmreg,xmmrm                    \361\3\x0F\x38\x34\110                          SSE41,SD
+PMOVZXDQ       xmmreg,xmmrm                    \361\3\x0F\x38\x35\110                          SSE41,SQ
+PMULDQ         xmmreg,xmmrm                    \361\3\x0F\x38\x28\110                          SSE41
+PMULLD         xmmreg,xmmrm                    \361\3\x0F\x38\x40\110                          SSE41
+PTEST          xmmreg,xmmrm                    \361\3\x0F\x38\x17\110                          SSE41
+ROUNDPD                xmmreg,xmmrm,imm                \361\3\x0F\x3A\x09\110\26                       SSE41
+ROUNDPS                xmmreg,xmmrm,imm                \361\3\x0F\x3A\x08\110\26                       SSE41
+ROUNDSD                xmmreg,xmmrm,imm                \361\3\x0F\x3A\x0B\110\26                       SSE41
+ROUNDSS                xmmreg,xmmrm,imm                \361\3\x0F\x3A\x0A\110\26                       SSE41
+
+;# Nehalem New Instructions (SSE4.2)
+CRC32          reg32,rm8                       \332\3\x0F\x38\xF0\110                          SSE42
+CRC32          reg32,rm16                      \320\332\3\x0F\x38\xF1\110                      SSE42
+CRC32          reg32,rm32                      \321\332\3\x0F\x38\xF1\110                      SSE42
+CRC32          reg64,rm8                       \324\332\3\x0F\x38\xF0\110                      SSE42,X64
+CRC32          reg64,rm64                      \324\332\3\x0F\x38\xF1\110                      SSE42,X64
+PCMPESTRI      xmmreg,xmmrm,imm                \361\3\x0F\x3A\x61\110\26                       SSE42
+PCMPESTRM      xmmreg,xmmrm,imm                \361\3\x0F\x3A\x60\110\26                       SSE42
+PCMPISTRI      xmmreg,xmmrm,imm                \361\3\x0F\x3A\x63\110\26                       SSE42
+PCMPISTRM      xmmreg,xmmrm,imm                \361\3\x0F\x3A\x62\110\26                       SSE42
+PCMPGTQ                xmmreg,xmmrm                    \361\3\x0F\x38\x37\110                          SSE42
+POPCNT         reg16,rm16                      \320\333\2\x0F\xB8\110                          NEHALEM,SW
+POPCNT         reg32,rm32                      \321\333\2\x0F\xB8\110                          NEHALEM,SD
+POPCNT         reg64,rm64                      \324\333\2\x0F\xB8\110                          NEHALEM,SQ,X64
+
+;# Intel SMX
+GETSEC         void                            \2\x0F\x37                                      KATMAI
+
+;# Geode (Cyrix) 3DNow! additions
+PFRCPV         mmxreg,mmxrm                    \323\2\x0F\x0F\110\1\x86                        PENT,3DNOW,SQ,CYRIX
+PFRSQRTV       mmxreg,mmxrm                    \323\2\x0F\x0F\110\1\x87                        PENT,3DNOW,SQ,CYRIX
+
+;# Intel new instructions in ???
+; Is NEHALEM right here?
+MOVBE          reg16,mem16                     [rm:    o16 0f 38 f0 /r]                        NEHALEM,SM
+MOVBE          reg32,mem32                     [rm:    o32 0f 38 f0 /r]                        NEHALEM,SM
+MOVBE          reg64,mem64                     [rm:    o64 0f 38 f0 /r]                        NEHALEM,SM
+MOVBE          mem16,reg16                     [mr:    o16 0f 38 f1 /r]                        NEHALEM,SM
+MOVBE          mem32,reg32                     [mr:    o32 0f 38 f1 /r]                        NEHALEM,SM
+MOVBE          mem64,reg64                     [mr:    o64 0f 38 f1 /r]                        NEHALEM,SM
+
+;# Intel AES instructions
+AESENC         xmmreg,xmmrm128                 [rm:    66 0f 38 dc /r]                         SSE,WESTMERE
+AESENCLAST     xmmreg,xmmrm128                 [rm:    66 0f 38 dd /r]                         SSE,WESTMERE
+AESDEC         xmmreg,xmmrm128                 [rm:    66 0f 38 de /r]                         SSE,WESTMERE
+AESDECLAST     xmmreg,xmmrm128                 [rm:    66 0f 38 df /r]                         SSE,WESTMERE
+AESIMC         xmmreg,xmmrm128                 [rm:    66 0f 38 db /r]                         SSE,WESTMERE
+AESKEYGENASSIST        xmmreg,xmmrm128,imm8            [rmi:   66 0f 3a df /r ib]                      SSE,WESTMERE
+
+;# Intel AVX AES instructions
+VAESENC                xmmreg,xmmreg*,xmmrm128         [rvm:   vex.nds.128.66.0f38 dc /r]              AVX,SANDYBRIDGE
+VAESENCLAST    xmmreg,xmmreg*,xmmrm128         [rvm:   vex.nds.128.66.0f38 dd /r]              AVX,SANDYBRIDGE
+VAESDEC                xmmreg,xmmreg*,xmmrm128         [rvm:   vex.nds.128.66.0f38 de /r]              AVX,SANDYBRIDGE
+VAESDECLAST    xmmreg,xmmreg*,xmmrm128         [rvm:   vex.nds.128.66.0f38 df /r]              AVX,SANDYBRIDGE
+VAESIMC                xmmreg,xmmrm128                 [rm:    vex.128.66.0f38 db /r]                  AVX,SANDYBRIDGE
+VAESKEYGENASSIST xmmreg,xmmrm128,imm8          [rmi:   vex.128.66.0f3a df /r ib]               AVX,SANDYBRIDGE
+
+;# Intel AVX instructions
+VADDPD         xmmreg,xmmreg*,xmmrm128         [rvm:   vex.nds.128.66.0f 58 /r]                AVX,SANDYBRIDGE
+VADDPD         ymmreg,ymmreg*,ymmrm256         [rvm:   vex.nds.256.66.0f 58 /r]                AVX,SANDYBRIDGE
+VADDPS         xmmreg,xmmreg*,xmmrm128         [rvm:   vex.nds.128.0f 58 /r]                   AVX,SANDYBRIDGE
+VADDPS         ymmreg,ymmreg*,ymmrm256         [rvm:   vex.nds.256.0f 58 /r]                   AVX,SANDYBRIDGE
+VADDSD         xmmreg,xmmreg*,xmmrm64          [rvm:   vex.nds.128.f2.0f 58 /r]                AVX,SANDYBRIDGE
+VADDSS         xmmreg,xmmreg*,xmmrm32          [rvm:   vex.nds.128.f3.0f 58 /r]                AVX,SANDYBRIDGE
+VADDSUBPD      xmmreg,xmmreg*,xmmrm128         [rvm:   vex.nds.128.66.0f d0 /r]                AVX,SANDYBRIDGE
+VADDSUBPD      ymmreg,ymmreg*,ymmrm256         [rvm:   vex.nds.256.66.0f d0 /r]                AVX,SANDYBRIDGE
+VADDSUBPS      xmmreg,xmmreg*,xmmrm128         [rvm:   vex.nds.128.f2.0f d0 /r]                AVX,SANDYBRIDGE
+VADDSUBPS      ymmreg,ymmreg*,ymmrm256         [rvm:   vex.nds.256.f2.0f d0 /r]                AVX,SANDYBRIDGE
+VANDPD         xmmreg,xmmreg*,xmmrm128         [rvm:   vex.nds.128.66.0f 54 /r]                AVX,SANDYBRIDGE
+VANDPD         ymmreg,ymmreg*,ymmrm256         [rvm:   vex.nds.256.66.0f 54 /r]                AVX,SANDYBRIDGE
+VANDPS         xmmreg,xmmreg*,xmmrm128         [rvm:   vex.nds.128.0f 54 /r]                   AVX,SANDYBRIDGE
+VANDPS         ymmreg,ymmreg*,ymmrm256         [rvm:   vex.nds.256.0f 54 /r]                   AVX,SANDYBRIDGE
+VANDNPD                xmmreg,xmmreg*,xmmrm128         [rvm:   vex.nds.128.66.0f 55 /r]                AVX,SANDYBRIDGE
+VANDNPD                ymmreg,ymmreg*,ymmrm256         [rvm:   vex.nds.256.66.0f 55 /r]                AVX,SANDYBRIDGE
+VANDNPS                xmmreg,xmmreg*,xmmrm128         [rvm:   vex.nds.128.0f 55 /r]                   AVX,SANDYBRIDGE
+VANDNPS                ymmreg,ymmreg*,ymmrm256         [rvm:   vex.nds.256.0f 55 /r]                   AVX,SANDYBRIDGE
+VBLENDPD       xmmreg,xmmreg*,xmmrm128,imm8    [rvmi:  vex.nds.128.66.0f3a 0d /r ib]           AVX,SANDYBRIDGE
+VBLENDPD       ymmreg,ymmreg*,ymmrm256,imm8    [rvmi:  vex.nds.256.66.0f3a 0d /r ib]           AVX,SANDYBRIDGE
+VBLENDPS       xmmreg,xmmreg*,xmmrm128,imm8    [rvmi:  vex.nds.128.66.0f3a 0c /r ib]           AVX,SANDYBRIDGE
+VBLENDPS       ymmreg,ymmreg*,ymmrm256,imm8    [rvmi:  vex.nds.256.66.0f3a 0c /r ib]           AVX,SANDYBRIDGE
+VBLENDVPD      xmmreg,xmmreg,xmmrm128,xmmreg   [rvms:  vex.nds.128.66.0f3a 4b /r /is4]         AVX,SANDYBRIDGE
+VBLENDVPD      xmmreg,xmmrm128,xmm0            [rm-:   vex.128.66.0f38 15 /r]                  AVX,SANDYBRIDGE
+VBLENDVPD      ymmreg,ymmreg,ymmrm256,ymmreg   [rvms:  vex.nds.256.66.0f3a 4b /r /is4]         AVX,SANDYBRIDGE
+VBLENDVPD      ymmreg,ymmrm256,ymm0            [rm-:   vex.256.66.0f38 15 /r]                  AVX,SANDYBRIDGE
+VBLENDVPS      xmmreg,xmmreg,xmmrm128,xmmreg   [rvms:  vex.nds.128.66.0f3a 4a /r /is4]         AVX,SANDYBRIDGE
+VBLENDVPS      xmmreg,xmmrm128,xmm0            [rm-:   vex.128.66.0f38 14 /r]                  AVX,SANDYBRIDGE
+VBLENDVPS      ymmreg,ymmreg,ymmrm256,ymmreg   [rvms:  vex.nds.256.66.0f3a 4a /r /is4]         AVX,SANDYBRIDGE
+VBLENDVPD      ymmreg,ymmrm256,ymm0            [rm-:   vex.256.66.0f38 14 /r]                  AVX,SANDYBRIDGE
+VBROADCASTSS   xmmreg,mem32                    [rm:    vex.128.66.0f38 18 /r]                  AVX,SANDYBRIDGE
+VBROADCASTSS   ymmreg,mem32                    [rm:    vex.256.66.0f38 18 /r]                  AVX,SANDYBRIDGE
+VBROADCASTSD   ymmreg,mem64                    [rm:    vex.256.66.0f38 19 /r]                  AVX,SANDYBRIDGE
+VBROADCASTF128 ymmreg,mem128                   [rm:    vex.256.66.0f38 1a /r]                  AVX,SANDYBRIDGE
+; Specific aliases first, then the generic version, to keep the disassembler happy...
+VCMPEQPD       xmmreg,xmmreg*,xmmrm128         [rvm:   vex.nds.128.66.0f c2 /r 00]             AVX,SANDYBRIDGE
+VCMPEQPD       ymmreg,ymmreg*,ymmrm256         [rvm:   vex.nds.256.66.0f c2 /r 00]             AVX,SANDYBRIDGE
+VCMPLTPD       xmmreg,xmmreg*,xmmrm128         [rvm:   vex.nds.128.66.0f c2 /r 01]             AVX,SANDYBRIDGE
+VCMPLTPD       ymmreg,ymmreg*,ymmrm256         [rvm:   vex.nds.256.66.0f c2 /r 01]             AVX,SANDYBRIDGE
+VCMPLEPD       xmmreg,xmmreg*,xmmrm128         [rvm:   vex.nds.128.66.0f c2 /r 02]             AVX,SANDYBRIDGE
+VCMPLEPD       ymmreg,ymmreg*,ymmrm256         [rvm:   vex.nds.256.66.0f c2 /r 02]             AVX,SANDYBRIDGE
+VCMPUNORDPD    xmmreg,xmmreg*,xmmrm128         [rvm:   vex.nds.128.66.0f c2 /r 03]             AVX,SANDYBRIDGE
+VCMPUNORDPD    ymmreg,ymmreg*,ymmrm256         [rvm:   vex.nds.256.66.0f c2 /r 03]             AVX,SANDYBRIDGE
+VCMPNEQPD      xmmreg,xmmreg*,xmmrm128         [rvm:   vex.nds.128.66.0f c2 /r 04]             AVX,SANDYBRIDGE
+VCMPNEQPD      ymmreg,ymmreg*,ymmrm256         [rvm:   vex.nds.256.66.0f c2 /r 04]             AVX,SANDYBRIDGE
+VCMPNLTPD      xmmreg,xmmreg*,xmmrm128         [rvm:   vex.nds.128.66.0f c2 /r 05]             AVX,SANDYBRIDGE
+VCMPNLTPD      ymmreg,ymmreg*,ymmrm256         [rvm:   vex.nds.256.66.0f c2 /r 05]             AVX,SANDYBRIDGE
+VCMPNLEPD      xmmreg,xmmreg*,xmmrm128         [rvm:   vex.nds.128.66.0f c2 /r 06]             AVX,SANDYBRIDGE
+VCMPNLEPD      ymmreg,ymmreg*,ymmrm256         [rvm:   vex.nds.256.66.0f c2 /r 06]             AVX,SANDYBRIDGE
+VCMPORDPD      xmmreg,xmmreg*,xmmrm128         [rvm:   vex.nds.128.66.0f c2 /r 07]             AVX,SANDYBRIDGE
+VCMPORDPD      ymmreg,ymmreg*,ymmrm256         [rvm:   vex.nds.256.66.0f c2 /r 07]             AVX,SANDYBRIDGE
+VCMPEQ_UQPD    xmmreg,xmmreg*,xmmrm128         [rvm:   vex.nds.128.66.0f c2 /r 08]             AVX,SANDYBRIDGE
+VCMPEQ_UQPD    ymmreg,ymmreg*,ymmrm256         [rvm:   vex.nds.256.66.0f c2 /r 08]             AVX,SANDYBRIDGE
+VCMPNGEPD      xmmreg,xmmreg*,xmmrm128         [rvm:   vex.nds.128.66.0f c2 /r 09]             AVX,SANDYBRIDGE
+VCMPNGEPD      ymmreg,ymmreg*,ymmrm256         [rvm:   vex.nds.256.66.0f c2 /r 09]             AVX,SANDYBRIDGE
+VCMPNGTPD      xmmreg,xmmreg*,xmmrm128         [rvm:   vex.nds.128.66.0f c2 /r 0a]             AVX,SANDYBRIDGE
+VCMPNGTPD      ymmreg,ymmreg*,ymmrm256         [rvm:   vex.nds.256.66.0f c2 /r 0a]             AVX,SANDYBRIDGE
+VCMPFALSEPD    xmmreg,xmmreg*,xmmrm128         [rvm:   vex.nds.128.66.0f c2 /r 0b]             AVX,SANDYBRIDGE
+VCMPFALSEPD    ymmreg,ymmreg*,ymmrm256         [rvm:   vex.nds.256.66.0f c2 /r 0b]             AVX,SANDYBRIDGE
+VCMPNEQ_OQPD   xmmreg,xmmreg*,xmmrm128         [rvm:   vex.nds.128.66.0f c2 /r 0c]             AVX,SANDYBRIDGE
+VCMPNEQ_OQPD   ymmreg,ymmreg*,ymmrm256         [rvm:   vex.nds.256.66.0f c2 /r 0c]             AVX,SANDYBRIDGE
+VCMPGEPD       xmmreg,xmmreg*,xmmrm128         [rvm:   vex.nds.128.66.0f c2 /r 0d]             AVX,SANDYBRIDGE
+VCMPGEPD       ymmreg,ymmreg*,ymmrm256         [rvm:   vex.nds.256.66.0f c2 /r 0d]             AVX,SANDYBRIDGE
+VCMPGTPD       xmmreg,xmmreg*,xmmrm128         [rvm:   vex.nds.128.66.0f c2 /r 0e]             AVX,SANDYBRIDGE
+VCMPGTPD       ymmreg,ymmreg*,ymmrm256         [rvm:   vex.nds.256.66.0f c2 /r 0e]             AVX,SANDYBRIDGE
+VCMPTRUEPD     xmmreg,xmmreg*,xmmrm128         [rvm:   vex.nds.128.66.0f c2 /r 0f]             AVX,SANDYBRIDGE
+VCMPTRUEPD     ymmreg,ymmreg*,ymmrm256         [rvm:   vex.nds.256.66.0f c2 /r 0f]             AVX,SANDYBRIDGE
+VCMPEQ_OSPD    xmmreg,xmmreg*,xmmrm128         [rvm:   vex.nds.128.66.0f c2 /r 10]             AVX,SANDYBRIDGE
+VCMPEQ_OSPD    ymmreg,ymmreg*,ymmrm256         [rvm:   vex.nds.256.66.0f c2 /r 10]             AVX,SANDYBRIDGE
+VCMPLT_OQPD    xmmreg,xmmreg*,xmmrm128         [rvm:   vex.nds.128.66.0f c2 /r 11]             AVX,SANDYBRIDGE
+VCMPLT_OQPD    ymmreg,ymmreg*,ymmrm256         [rvm:   vex.nds.256.66.0f c2 /r 11]             AVX,SANDYBRIDGE
+VCMPLE_OQPD    xmmreg,xmmreg*,xmmrm128         [rvm:   vex.nds.128.66.0f c2 /r 12]             AVX,SANDYBRIDGE
+VCMPLE_OQPD    ymmreg,ymmreg*,ymmrm256         [rvm:   vex.nds.256.66.0f c2 /r 12]             AVX,SANDYBRIDGE
+VCMPUNORD_SPD  xmmreg,xmmreg*,xmmrm128         [rvm:   vex.nds.128.66.0f c2 /r 13]             AVX,SANDYBRIDGE
+VCMPUNORD_SPD  ymmreg,ymmreg*,ymmrm256         [rvm:   vex.nds.256.66.0f c2 /r 13]             AVX,SANDYBRIDGE
+VCMPNEQ_USPD   xmmreg,xmmreg*,xmmrm128         [rvm:   vex.nds.128.66.0f c2 /r 14]             AVX,SANDYBRIDGE
+VCMPNEQ_USPD   ymmreg,ymmreg*,ymmrm256         [rvm:   vex.nds.256.66.0f c2 /r 14]             AVX,SANDYBRIDGE
+VCMPNLT_UQPD   xmmreg,xmmreg*,xmmrm128         [rvm:   vex.nds.128.66.0f c2 /r 15]             AVX,SANDYBRIDGE
+VCMPNLT_UQPD   ymmreg,ymmreg*,ymmrm256         [rvm:   vex.nds.256.66.0f c2 /r 15]             AVX,SANDYBRIDGE
+VCMPNLE_UQPD   xmmreg,xmmreg*,xmmrm128         [rvm:   vex.nds.128.66.0f c2 /r 16]             AVX,SANDYBRIDGE
+VCMPNLE_UQPD   ymmreg,ymmreg*,ymmrm256         [rvm:   vex.nds.256.66.0f c2 /r 16]             AVX,SANDYBRIDGE
+VCMPORD_SPD    xmmreg,xmmreg*,xmmrm128         [rvm:   vex.nds.128.66.0f c2 /r 17]             AVX,SANDYBRIDGE
+VCMPORD_SPD    ymmreg,ymmreg*,ymmrm256         [rvm:   vex.nds.256.66.0f c2 /r 17]             AVX,SANDYBRIDGE
+VCMPEQ_USPD    xmmreg,xmmreg*,xmmrm128         [rvm:   vex.nds.128.66.0f c2 /r 18]             AVX,SANDYBRIDGE
+VCMPEQ_USPD    ymmreg,ymmreg*,ymmrm256         [rvm:   vex.nds.256.66.0f c2 /r 18]             AVX,SANDYBRIDGE
+VCMPNGE_UQPD   xmmreg,xmmreg*,xmmrm128         [rvm:   vex.nds.128.66.0f c2 /r 19]             AVX,SANDYBRIDGE
+VCMPNGE_UQPD   ymmreg,ymmreg*,ymmrm256         [rvm:   vex.nds.256.66.0f c2 /r 19]             AVX,SANDYBRIDGE
+VCMPNGT_UQPD   xmmreg,xmmreg*,xmmrm128         [rvm:   vex.nds.128.66.0f c2 /r 1a]             AVX,SANDYBRIDGE
+VCMPNGT_UQPD   ymmreg,ymmreg*,ymmrm256         [rvm:   vex.nds.256.66.0f c2 /r 1a]             AVX,SANDYBRIDGE
+VCMPFALSE_OSPD xmmreg,xmmreg*,xmmrm128         [rvm:   vex.nds.128.66.0f c2 /r 1b]             AVX,SANDYBRIDGE
+VCMPFALSE_OSPD ymmreg,ymmreg*,ymmrm256         [rvm:   vex.nds.256.66.0f c2 /r 1b]             AVX,SANDYBRIDGE
+VCMPNEQ_OSPD   xmmreg,xmmreg*,xmmrm128         [rvm:   vex.nds.128.66.0f c2 /r 1c]             AVX,SANDYBRIDGE
+VCMPNEQ_OSPD   ymmreg,ymmreg*,ymmrm256         [rvm:   vex.nds.256.66.0f c2 /r 1c]             AVX,SANDYBRIDGE
+VCMPGE_OQPD    xmmreg,xmmreg*,xmmrm128         [rvm:   vex.nds.128.66.0f c2 /r 1d]             AVX,SANDYBRIDGE
+VCMPGE_OQPD    ymmreg,ymmreg*,ymmrm256         [rvm:   vex.nds.256.66.0f c2 /r 1d]             AVX,SANDYBRIDGE
+VCMPGT_OQPD    xmmreg,xmmreg*,xmmrm128         [rvm:   vex.nds.128.66.0f c2 /r 1e]             AVX,SANDYBRIDGE
+VCMPGT_OQPD    ymmreg,ymmreg*,ymmrm256         [rvm:   vex.nds.256.66.0f c2 /r 1e]             AVX,SANDYBRIDGE
+VCMPTRUE_USPD  xmmreg,xmmreg*,xmmrm128         [rvm:   vex.nds.128.66.0f c2 /r 1f]             AVX,SANDYBRIDGE
+VCMPTRUE_USPD  ymmreg,ymmreg*,ymmrm256         [rvm:   vex.nds.256.66.0f c2 /r 1f]             AVX,SANDYBRIDGE
+VCMPPD         xmmreg,xmmreg*,xmmrm128,imm8    [rvmi:  vex.nds.128.66.0f c2 /r ib]             AVX,SANDYBRIDGE
+VCMPPD         ymmreg,ymmreg*,ymmrm256,imm8    [rvmi:  vex.nds.256.66.0f c2 /r ib]             AVX,SANDYBRIDGE
+; Specific aliases first, then the generic version, to keep the disassembler happy...
+VCMPEQPS       xmmreg,xmmreg*,xmmrm128         [rvm:   vex.nds.128.0f c2 /r 00]                AVX,SANDYBRIDGE
+VCMPEQPS       ymmreg,ymmreg*,ymmrm256         [rvm:   vex.nds.256.0f c2 /r 00]                AVX,SANDYBRIDGE
+VCMPLTPS       xmmreg,xmmreg*,xmmrm128         [rvm:   vex.nds.128.0f c2 /r 01]                AVX,SANDYBRIDGE
+VCMPLTPS       ymmreg,ymmreg*,ymmrm256         [rvm:   vex.nds.256.0f c2 /r 01]                AVX,SANDYBRIDGE
+VCMPLEPS       xmmreg,xmmreg*,xmmrm128         [rvm:   vex.nds.128.0f c2 /r 02]                AVX,SANDYBRIDGE
+VCMPLEPS       ymmreg,ymmreg*,ymmrm256         [rvm:   vex.nds.256.0f c2 /r 02]                AVX,SANDYBRIDGE
+VCMPUNORDPS    xmmreg,xmmreg*,xmmrm128         [rvm:   vex.nds.128.0f c2 /r 03]                AVX,SANDYBRIDGE
+VCMPUNORDPS    ymmreg,ymmreg*,ymmrm256         [rvm:   vex.nds.256.0f c2 /r 03]                AVX,SANDYBRIDGE
+VCMPNEQPS      xmmreg,xmmreg*,xmmrm128         [rvm:   vex.nds.128.0f c2 /r 04]                AVX,SANDYBRIDGE
+VCMPNEQPS      ymmreg,ymmreg*,ymmrm256         [rvm:   vex.nds.256.0f c2 /r 04]                AVX,SANDYBRIDGE
+VCMPNLTPS      xmmreg,xmmreg*,xmmrm128         [rvm:   vex.nds.128.0f c2 /r 05]                AVX,SANDYBRIDGE
+VCMPNLTPS      ymmreg,ymmreg*,ymmrm256         [rvm:   vex.nds.256.0f c2 /r 05]                AVX,SANDYBRIDGE
+VCMPNLEPS      xmmreg,xmmreg*,xmmrm128         [rvm:   vex.nds.128.0f c2 /r 06]                AVX,SANDYBRIDGE
+VCMPNLEPS      ymmreg,ymmreg*,ymmrm256         [rvm:   vex.nds.256.0f c2 /r 06]                AVX,SANDYBRIDGE
+VCMPORDPS      xmmreg,xmmreg*,xmmrm128         [rvm:   vex.nds.128.0f c2 /r 07]                AVX,SANDYBRIDGE
+VCMPORDPS      ymmreg,ymmreg*,ymmrm256         [rvm:   vex.nds.256.0f c2 /r 07]                AVX,SANDYBRIDGE
+VCMPEQ_UQPS    xmmreg,xmmreg*,xmmrm128         [rvm:   vex.nds.128.0f c2 /r 08]                AVX,SANDYBRIDGE
+VCMPEQ_UQPS    ymmreg,ymmreg*,ymmrm256         [rvm:   vex.nds.256.0f c2 /r 08]                AVX,SANDYBRIDGE
+VCMPNGEPS      xmmreg,xmmreg*,xmmrm128         [rvm:   vex.nds.128.0f c2 /r 09]                AVX,SANDYBRIDGE
+VCMPNGEPS      ymmreg,ymmreg*,ymmrm256         [rvm:   vex.nds.256.0f c2 /r 09]                AVX,SANDYBRIDGE
+VCMPNGTPS      xmmreg,xmmreg*,xmmrm128         [rvm:   vex.nds.128.0f c2 /r 0a]                AVX,SANDYBRIDGE
+VCMPNGTPS      ymmreg,ymmreg*,ymmrm256         [rvm:   vex.nds.256.0f c2 /r 0a]                AVX,SANDYBRIDGE
+VCMPFALSEPS    xmmreg,xmmreg*,xmmrm128         [rvm:   vex.nds.128.0f c2 /r 0b]                AVX,SANDYBRIDGE
+VCMPFALSEPS    ymmreg,ymmreg*,ymmrm256         [rvm:   vex.nds.256.0f c2 /r 0b]                AVX,SANDYBRIDGE
+VCMPNEQ_OQPS   xmmreg,xmmreg*,xmmrm128         [rvm:   vex.nds.128.0f c2 /r 0c]                AVX,SANDYBRIDGE
+VCMPNEQ_OQPS   ymmreg,ymmreg*,ymmrm256         [rvm:   vex.nds.256.0f c2 /r 0c]                AVX,SANDYBRIDGE
+VCMPGEPS       xmmreg,xmmreg*,xmmrm128         [rvm:   vex.nds.128.0f c2 /r 0d]                AVX,SANDYBRIDGE
+VCMPGEPS       ymmreg,ymmreg*,ymmrm256         [rvm:   vex.nds.256.0f c2 /r 0d]                AVX,SANDYBRIDGE
+VCMPGTPS       xmmreg,xmmreg*,xmmrm128         [rvm:   vex.nds.128.0f c2 /r 0e]                AVX,SANDYBRIDGE
+VCMPGTPS       ymmreg,ymmreg*,ymmrm256         [rvm:   vex.nds.256.0f c2 /r 0e]                AVX,SANDYBRIDGE
+VCMPTRUEPS     xmmreg,xmmreg*,xmmrm128         [rvm:   vex.nds.128.0f c2 /r 0f]                AVX,SANDYBRIDGE
+VCMPTRUEPS     ymmreg,ymmreg*,ymmrm256         [rvm:   vex.nds.256.0f c2 /r 0f]                AVX,SANDYBRIDGE
+VCMPEQ_OSPS    xmmreg,xmmreg*,xmmrm128         [rvm:   vex.nds.128.0f c2 /r 10]                AVX,SANDYBRIDGE
+VCMPEQ_OSPS    ymmreg,ymmreg*,ymmrm256         [rvm:   vex.nds.256.0f c2 /r 10]                AVX,SANDYBRIDGE
+VCMPLT_OQPS    xmmreg,xmmreg*,xmmrm128         [rvm:   vex.nds.128.0f c2 /r 11]                AVX,SANDYBRIDGE
+VCMPLT_OQPS    ymmreg,ymmreg*,ymmrm256         [rvm:   vex.nds.256.0f c2 /r 11]                AVX,SANDYBRIDGE
+VCMPLE_OQPS    xmmreg,xmmreg*,xmmrm128         [rvm:   vex.nds.128.0f c2 /r 12]                AVX,SANDYBRIDGE
+VCMPLE_OQPS    ymmreg,ymmreg*,ymmrm256         [rvm:   vex.nds.256.0f c2 /r 12]                AVX,SANDYBRIDGE
+VCMPUNORD_SPS  xmmreg,xmmreg*,xmmrm128         [rvm:   vex.nds.128.0f c2 /r 13]                AVX,SANDYBRIDGE
+VCMPUNORD_SPS  ymmreg,ymmreg*,ymmrm256         [rvm:   vex.nds.256.0f c2 /r 13]                AVX,SANDYBRIDGE
+VCMPNEQ_USPS   xmmreg,xmmreg*,xmmrm128         [rvm:   vex.nds.128.0f c2 /r 14]                AVX,SANDYBRIDGE
+VCMPNEQ_USPS   ymmreg,ymmreg*,ymmrm256         [rvm:   vex.nds.256.0f c2 /r 14]                AVX,SANDYBRIDGE
+VCMPNLT_UQPS   xmmreg,xmmreg*,xmmrm128         [rvm:   vex.nds.128.0f c2 /r 15]                AVX,SANDYBRIDGE
+VCMPNLT_UQPS   ymmreg,ymmreg*,ymmrm256         [rvm:   vex.nds.256.0f c2 /r 15]                AVX,SANDYBRIDGE
+VCMPNLE_UQPS   xmmreg,xmmreg*,xmmrm128         [rvm:   vex.nds.128.0f c2 /r 16]                AVX,SANDYBRIDGE
+VCMPNLE_UQPS   ymmreg,ymmreg*,ymmrm256         [rvm:   vex.nds.256.0f c2 /r 16]                AVX,SANDYBRIDGE
+VCMPORD_SPS    xmmreg,xmmreg*,xmmrm128         [rvm:   vex.nds.128.0f c2 /r 17]                AVX,SANDYBRIDGE
+VCMPORD_SPS    ymmreg,ymmreg*,ymmrm256         [rvm:   vex.nds.256.0f c2 /r 17]                AVX,SANDYBRIDGE
+VCMPEQ_USPS    xmmreg,xmmreg*,xmmrm128         [rvm:   vex.nds.128.0f c2 /r 18]                AVX,SANDYBRIDGE
+VCMPEQ_USPS    ymmreg,ymmreg*,ymmrm256         [rvm:   vex.nds.256.0f c2 /r 18]                AVX,SANDYBRIDGE
+VCMPNGE_UQPS   xmmreg,xmmreg*,xmmrm128         [rvm:   vex.nds.128.0f c2 /r 19]                AVX,SANDYBRIDGE
+VCMPNGE_UQPS   ymmreg,ymmreg*,ymmrm256         [rvm:   vex.nds.256.0f c2 /r 19]                AVX,SANDYBRIDGE
+VCMPNGT_UQPS   xmmreg,xmmreg*,xmmrm128         [rvm:   vex.nds.128.0f c2 /r 1a]                AVX,SANDYBRIDGE
+VCMPNGT_UQPS   ymmreg,ymmreg*,ymmrm256         [rvm:   vex.nds.256.0f c2 /r 1a]                AVX,SANDYBRIDGE
+VCMPFALSE_OSPS xmmreg,xmmreg*,xmmrm128         [rvm:   vex.nds.128.0f c2 /r 1b]                AVX,SANDYBRIDGE
+VCMPFALSE_OSPS ymmreg,ymmreg*,ymmrm256         [rvm:   vex.nds.256.0f c2 /r 1b]                AVX,SANDYBRIDGE
+VCMPNEQ_OSPS   xmmreg,xmmreg*,xmmrm128         [rvm:   vex.nds.128.0f c2 /r 1c]                AVX,SANDYBRIDGE
+VCMPNEQ_OSPS   ymmreg,ymmreg*,ymmrm256         [rvm:   vex.nds.256.0f c2 /r 1c]                AVX,SANDYBRIDGE
+VCMPGE_OQPS    xmmreg,xmmreg*,xmmrm128         [rvm:   vex.nds.128.0f c2 /r 1d]                AVX,SANDYBRIDGE
+VCMPGE_OQPS    ymmreg,ymmreg*,ymmrm256         [rvm:   vex.nds.256.0f c2 /r 1d]                AVX,SANDYBRIDGE
+VCMPGT_OQPS    xmmreg,xmmreg*,xmmrm128         [rvm:   vex.nds.128.0f c2 /r 1e]                AVX,SANDYBRIDGE
+VCMPGT_OQPS    ymmreg,ymmreg*,ymmrm256         [rvm:   vex.nds.256.0f c2 /r 1e]                AVX,SANDYBRIDGE
+VCMPTRUE_USPS  xmmreg,xmmreg*,xmmrm128         [rvm:   vex.nds.128.0f c2 /r 1f]                AVX,SANDYBRIDGE
+VCMPTRUE_USPS  ymmreg,ymmreg*,ymmrm256         [rvm:   vex.nds.256.0f c2 /r 1f]                AVX,SANDYBRIDGE
+VCMPPS         xmmreg,xmmreg*,xmmrm128,imm8    [rvmi:  vex.nds.128.0f c2 /r ib]                AVX,SANDYBRIDGE
+VCMPPS         ymmreg,ymmreg*,ymmrm256,imm8    [rvmi:  vex.nds.256.0f c2 /r ib]                AVX,SANDYBRIDGE
+; Specific aliases first, then the generic version, to keep the disassembler happy...
+VCMPEQSD       xmmreg,xmmreg*,xmmrm64          [rvm:   vex.nds.128.f2.0f c2 /r 00]             AVX,SANDYBRIDGE
+VCMPLTSD       xmmreg,xmmreg*,xmmrm64          [rvm:   vex.nds.128.f2.0f c2 /r 01]             AVX,SANDYBRIDGE
+VCMPLESD       xmmreg,xmmreg*,xmmrm64          [rvm:   vex.nds.128.f2.0f c2 /r 02]             AVX,SANDYBRIDGE
+VCMPUNORDSD    xmmreg,xmmreg*,xmmrm64          [rvm:   vex.nds.128.f2.0f c2 /r 03]             AVX,SANDYBRIDGE
+VCMPNEQSD      xmmreg,xmmreg*,xmmrm64          [rvm:   vex.nds.128.f2.0f c2 /r 04]             AVX,SANDYBRIDGE
+VCMPNLTSD      xmmreg,xmmreg*,xmmrm64          [rvm:   vex.nds.128.f2.0f c2 /r 05]             AVX,SANDYBRIDGE
+VCMPNLESD      xmmreg,xmmreg*,xmmrm64          [rvm:   vex.nds.128.f2.0f c2 /r 06]             AVX,SANDYBRIDGE
+VCMPORDSD      xmmreg,xmmreg*,xmmrm64          [rvm:   vex.nds.128.f2.0f c2 /r 07]             AVX,SANDYBRIDGE
+VCMPEQ_UQSD    xmmreg,xmmreg*,xmmrm64          [rvm:   vex.nds.128.f2.0f c2 /r 08]             AVX,SANDYBRIDGE
+VCMPNGESD      xmmreg,xmmreg*,xmmrm64          [rvm:   vex.nds.128.f2.0f c2 /r 09]             AVX,SANDYBRIDGE
+VCMPNGTSD      xmmreg,xmmreg*,xmmrm64          [rvm:   vex.nds.128.f2.0f c2 /r 0a]             AVX,SANDYBRIDGE
+VCMPFALSESD    xmmreg,xmmreg*,xmmrm64          [rvm:   vex.nds.128.f2.0f c2 /r 0b]             AVX,SANDYBRIDGE
+VCMPNEQ_OQSD   xmmreg,xmmreg*,xmmrm64          [rvm:   vex.nds.128.f2.0f c2 /r 0c]             AVX,SANDYBRIDGE
+VCMPGESD       xmmreg,xmmreg*,xmmrm64          [rvm:   vex.nds.128.f2.0f c2 /r 0d]             AVX,SANDYBRIDGE
+VCMPGTSD       xmmreg,xmmreg*,xmmrm64          [rvm:   vex.nds.128.f2.0f c2 /r 0e]             AVX,SANDYBRIDGE
+VCMPTRUESD     xmmreg,xmmreg*,xmmrm64          [rvm:   vex.nds.128.f2.0f c2 /r 0f]             AVX,SANDYBRIDGE
+VCMPEQ_OSSD    xmmreg,xmmreg*,xmmrm64          [rvm:   vex.nds.128.f2.0f c2 /r 10]             AVX,SANDYBRIDGE
+VCMPLT_OQSD    xmmreg,xmmreg*,xmmrm64          [rvm:   vex.nds.128.f2.0f c2 /r 11]             AVX,SANDYBRIDGE
+VCMPLE_OQSD    xmmreg,xmmreg*,xmmrm64          [rvm:   vex.nds.128.f2.0f c2 /r 12]             AVX,SANDYBRIDGE
+VCMPUNORD_SSD  xmmreg,xmmreg*,xmmrm64          [rvm:   vex.nds.128.f2.0f c2 /r 13]             AVX,SANDYBRIDGE
+VCMPNEQ_USSD   xmmreg,xmmreg*,xmmrm64          [rvm:   vex.nds.128.f2.0f c2 /r 14]             AVX,SANDYBRIDGE
+VCMPNLT_UQSD   xmmreg,xmmreg*,xmmrm64          [rvm:   vex.nds.128.f2.0f c2 /r 15]             AVX,SANDYBRIDGE
+VCMPNLE_UQSD   xmmreg,xmmreg*,xmmrm64          [rvm:   vex.nds.128.f2.0f c2 /r 16]             AVX,SANDYBRIDGE
+VCMPORD_SSD    xmmreg,xmmreg*,xmmrm64          [rvm:   vex.nds.128.f2.0f c2 /r 17]             AVX,SANDYBRIDGE
+VCMPEQ_USSD    xmmreg,xmmreg*,xmmrm64          [rvm:   vex.nds.128.f2.0f c2 /r 18]             AVX,SANDYBRIDGE
+VCMPNGE_UQSD   xmmreg,xmmreg*,xmmrm64          [rvm:   vex.nds.128.f2.0f c2 /r 19]             AVX,SANDYBRIDGE
+VCMPNGT_UQSD   xmmreg,xmmreg*,xmmrm64          [rvm:   vex.nds.128.f2.0f c2 /r 1a]             AVX,SANDYBRIDGE
+VCMPFALSE_OSSD xmmreg,xmmreg*,xmmrm64          [rvm:   vex.nds.128.f2.0f c2 /r 1b]             AVX,SANDYBRIDGE
+VCMPNEQ_OSSD   xmmreg,xmmreg*,xmmrm64          [rvm:   vex.nds.128.f2.0f c2 /r 1c]             AVX,SANDYBRIDGE
+VCMPGE_OQSD    xmmreg,xmmreg*,xmmrm64          [rvm:   vex.nds.128.f2.0f c2 /r 1d]             AVX,SANDYBRIDGE
+VCMPGT_OQSD    xmmreg,xmmreg*,xmmrm64          [rvm:   vex.nds.128.f2.0f c2 /r 1e]             AVX,SANDYBRIDGE
+VCMPTRUE_USSD  xmmreg,xmmreg*,xmmrm64          [rvm:   vex.nds.128.f2.0f c2 /r 1f]             AVX,SANDYBRIDGE
+VCMPSD         xmmreg,xmmreg*,xmmrm64,imm8     [rvmi:  vex.nds.128.f2.0f c2 /r ib]             AVX,SANDYBRIDGE
+; Specific aliases first, then the generic version, to keep the disassembler happy...
+VCMPEQSS       xmmreg,xmmreg*,xmmrm32          [rvm:   vex.nds.128.f3.0f c2 /r 00]             AVX,SANDYBRIDGE
+VCMPLTSS       xmmreg,xmmreg*,xmmrm32          [rvm:   vex.nds.128.f3.0f c2 /r 01]             AVX,SANDYBRIDGE
+VCMPLESS       xmmreg,xmmreg*,xmmrm32          [rvm:   vex.nds.128.f3.0f c2 /r 02]             AVX,SANDYBRIDGE
+VCMPUNORDSS    xmmreg,xmmreg*,xmmrm32          [rvm:   vex.nds.128.f3.0f c2 /r 03]             AVX,SANDYBRIDGE
+VCMPNEQSS      xmmreg,xmmreg*,xmmrm32          [rvm:   vex.nds.128.f3.0f c2 /r 04]             AVX,SANDYBRIDGE
+VCMPNLTSS      xmmreg,xmmreg*,xmmrm32          [rvm:   vex.nds.128.f3.0f c2 /r 05]             AVX,SANDYBRIDGE
+VCMPNLESS      xmmreg,xmmreg*,xmmrm32          [rvm:   vex.nds.128.f3.0f c2 /r 06]             AVX,SANDYBRIDGE
+VCMPORDSS      xmmreg,xmmreg*,xmmrm32          [rvm:   vex.nds.128.f3.0f c2 /r 07]             AVX,SANDYBRIDGE
+VCMPEQ_UQSS    xmmreg,xmmreg*,xmmrm32          [rvm:   vex.nds.128.f3.0f c2 /r 08]             AVX,SANDYBRIDGE
+VCMPNGESS      xmmreg,xmmreg*,xmmrm32          [rvm:   vex.nds.128.f3.0f c2 /r 09]             AVX,SANDYBRIDGE
+VCMPNGTSS      xmmreg,xmmreg*,xmmrm32          [rvm:   vex.nds.128.f3.0f c2 /r 0a]             AVX,SANDYBRIDGE
+VCMPFALSESS    xmmreg,xmmreg*,xmmrm32          [rvm:   vex.nds.128.f3.0f c2 /r 0b]             AVX,SANDYBRIDGE
+VCMPNEQ_OQSS   xmmreg,xmmreg*,xmmrm32          [rvm:   vex.nds.128.f3.0f c2 /r 0c]             AVX,SANDYBRIDGE
+VCMPGESS       xmmreg,xmmreg*,xmmrm32          [rvm:   vex.nds.128.f3.0f c2 /r 0d]             AVX,SANDYBRIDGE
+VCMPGTSS       xmmreg,xmmreg*,xmmrm32          [rvm:   vex.nds.128.f3.0f c2 /r 0e]             AVX,SANDYBRIDGE
+VCMPTRUESS     xmmreg,xmmreg*,xmmrm32          [rvm:   vex.nds.128.f3.0f c2 /r 0f]             AVX,SANDYBRIDGE
+VCMPEQ_OSSS    xmmreg,xmmreg*,xmmrm32          [rvm:   vex.nds.128.f3.0f c2 /r 10]             AVX,SANDYBRIDGE
+VCMPLT_OQSS    xmmreg,xmmreg*,xmmrm32          [rvm:   vex.nds.128.f3.0f c2 /r 11]             AVX,SANDYBRIDGE
+VCMPLE_OQSS    xmmreg,xmmreg*,xmmrm32          [rvm:   vex.nds.128.f3.0f c2 /r 12]             AVX,SANDYBRIDGE
+VCMPUNORD_SSS  xmmreg,xmmreg*,xmmrm32          [rvm:   vex.nds.128.f3.0f c2 /r 13]             AVX,SANDYBRIDGE
+VCMPNEQ_USSS   xmmreg,xmmreg*,xmmrm32          [rvm:   vex.nds.128.f3.0f c2 /r 14]             AVX,SANDYBRIDGE
+VCMPNLT_UQSS   xmmreg,xmmreg*,xmmrm32          [rvm:   vex.nds.128.f3.0f c2 /r 15]             AVX,SANDYBRIDGE
+VCMPNLE_UQSS   xmmreg,xmmreg*,xmmrm32          [rvm:   vex.nds.128.f3.0f c2 /r 16]             AVX,SANDYBRIDGE
+VCMPORD_SSS    xmmreg,xmmreg*,xmmrm32          [rvm:   vex.nds.128.f3.0f c2 /r 17]             AVX,SANDYBRIDGE
+VCMPEQ_USSS    xmmreg,xmmreg*,xmmrm32          [rvm:   vex.nds.128.f3.0f c2 /r 18]             AVX,SANDYBRIDGE
+VCMPNGE_UQSS   xmmreg,xmmreg*,xmmrm32          [rvm:   vex.nds.128.f3.0f c2 /r 19]             AVX,SANDYBRIDGE
+VCMPNGT_UQSS   xmmreg,xmmreg*,xmmrm32          [rvm:   vex.nds.128.f3.0f c2 /r 1a]             AVX,SANDYBRIDGE
+VCMPFALSE_OSSS xmmreg,xmmreg*,xmmrm32          [rvm:   vex.nds.128.f3.0f c2 /r 1b]             AVX,SANDYBRIDGE
+VCMPNEQ_OSSS   xmmreg,xmmreg*,xmmrm32          [rvm:   vex.nds.128.f3.0f c2 /r 1c]             AVX,SANDYBRIDGE
+VCMPGE_OQSS    xmmreg,xmmreg*,xmmrm32          [rvm:   vex.nds.128.f3.0f c2 /r 1d]             AVX,SANDYBRIDGE
+VCMPGT_OQSS    xmmreg,xmmreg*,xmmrm32          [rvm:   vex.nds.128.f3.0f c2 /r 1e]             AVX,SANDYBRIDGE
+VCMPTRUE_USSS  xmmreg,xmmreg*,xmmrm32          [rvm:   vex.nds.128.f3.0f c2 /r 1f]             AVX,SANDYBRIDGE
+VCMPSS         xmmreg,xmmreg*,xmmrm32,imm8     [rvmi:  vex.nds.128.f3.0f c2 /r ib]             AVX,SANDYBRIDGE
+VCOMISD                xmmreg,xmmrm64                  [rm:    vex.128.66.0f 2f /r]                    AVX,SANDYBRIDGE
+VCOMISS                xmmreg,xmmrm32                  [rm:    vex.128.0f 2f /r]                       AVX,SANDYBRIDGE
+VCVTDQ2PD      xmmreg,xmmrm64                  [rm:    vex.128.f3.0f e6 /r]                    AVX,SANDYBRIDGE
+VCVTDQ2PD      ymmreg,xmmrm128                 [rm:    vex.256.f3.0f e6 /r]                    AVX,SANDYBRIDGE
+VCVTDQ2PS      xmmreg,xmmrm128                 [rm:    vex.128.0f 5b /r]                       AVX,SANDYBRIDGE
+VCVTDQ2PS      ymmreg,ymmrm256                 [rm:    vex.256.0f 5b /r]                       AVX,SANDYBRIDGE
+VCVTPD2DQ      xmmreg,xmmreg                   [rm:    vex.128.f2.0f e6 /r]                    AVX,SANDYBRIDGE
+VCVTPD2DQ      xmmreg,mem128                   [rm:    vex.128.f2.0f e6 /r]                    AVX,SANDYBRIDGE,SO
+VCVTPD2DQ      xmmreg,ymmreg                   [rm:    vex.256.f2.0f e6 /r]                    AVX,SANDYBRIDGE
+VCVTPD2DQ      xmmreg,mem256                   [rm:    vex.256.f2.0f e6 /r]                    AVX,SANDYBRIDGE,SY
+VCVTPD2PS      xmmreg,xmmreg                   [rm:    vex.128.66.0f 5a /r]                    AVX,SANDYBRIDGE
+VCVTPD2PS      xmmreg,mem128                   [rm:    vex.128.66.0f 5a /r]                    AVX,SANDYBRIDGE,SO
+VCVTPD2PS      xmmreg,ymmreg                   [rm:    vex.256.66.0f 5a /r]                    AVX,SANDYBRIDGE
+VCVTPD2PS      xmmreg,mem256                   [rm:    vex.256.66.0f 5a /r]                    AVX,SANDYBRIDGE,SY
+VCVTPS2DQ      xmmreg,xmmrm128                 [rm:    vex.128.66.0f 5b /r]                    AVX,SANDYBRIDGE
+VCVTPS2DQ      ymmreg,ymmrm256                 [rm:    vex.256.66.0f 5b /r]                    AVX,SANDYBRIDGE
+VCVTPS2PD      xmmreg,xmmrm64                  [rm:    vex.128.0f 5a /r]                       AVX,SANDYBRIDGE
+VCVTPS2PD      ymmreg,xmmrm128                 [rm:    vex.256.0f 5a /r]                       AVX,SANDYBRIDGE
+VCVTSD2SI      reg32,xmmrm64                   [rm:    vex.128.f2.0f.w0 2d /r]                 AVX,SANDYBRIDGE
+VCVTSD2SI      reg64,xmmrm64                   [rm:    vex.128.f2.0f.w1 2d /r]                 AVX,SANDYBRIDGE,LONG
+VCVTSD2SS      xmmreg,xmmreg*,xmmrm64          [rvm:   vex.nds.128.f2.0f 5a /r]                AVX,SANDYBRIDGE
+VCVTSI2SD      xmmreg,xmmreg*,rm32             [rvm:   vex.nds.128.f2.0f.w0 2a /r]             AVX,SANDYBRIDGE,SD
+VCVTSI2SD      xmmreg,xmmreg*,mem32            [rvm:   vex.nds.128.f2.0f.w0 2a /r]             AVX,SANDYBRIDGE,ND,SD
+VCVTSI2SD      xmmreg,xmmreg*,rm64             [rvm:   vex.nds.128.f2.0f.w1 2a /r]             AVX,SANDYBRIDGE,LONG,SQ
+VCVTSI2SS      xmmreg,xmmreg*,rm32             [rvm:   vex.nds.128.f3.0f.w0 2a /r]             AVX,SANDYBRIDGE,SD
+VCVTSI2SS      xmmreg,xmmreg*,mem32            [rvm:   vex.nds.128.f3.0f.w0 2a /r]             AVX,SANDYBRIDGE,ND,SD
+VCVTSI2SS      xmmreg,xmmreg*,rm64             [rvm:   vex.nds.128.f3.0f.w1 2a /r]             AVX,SANDYBRIDGE,LONG,SQ
+VCVTSS2SD      xmmreg,xmmreg*,xmmrm32          [rvm:   vex.nds.128.f3.0f 5a /r]                AVX,SANDYBRIDGE
+VCVTSS2SI      reg32,xmmrm32                   [rm:    vex.128.f3.0f.w0 2d /r]                 AVX,SANDYBRIDGE
+VCVTSS2SI      reg64,xmmrm32                   [rm:    vex.128.f3.0f.w1 2d /r]                 AVX,SANDYBRIDGE,LONG
+VCVTTPD2DQ     xmmreg,xmmreg                   [rm:    vex.128.66.0f e6 /r]                    AVX,SANDYBRIDGE
+VCVTTPD2DQ     xmmreg,mem128                   [rm:    vex.128.66.0f e6 /r]                    AVX,SANDYBRIDGE,SO
+VCVTTPD2DQ     xmmreg,ymmreg                   [rm:    vex.256.66.0f e6 /r]                    AVX,SANDYBRIDGE
+VCVTTPD2DQ     xmmreg,mem256                   [rm:    vex.256.66.0f e6 /r]                    AVX,SANDYBRIDGE,SY
+VCVTTPS2DQ     xmmreg,xmmrm128                 [rm:    vex.128.f3.0f 5b /r]                    AVX,SANDYBRIDGE
+VCVTTPS2DQ     ymmreg,ymmrm256                 [rm:    vex.256.f3.0f 5b /r]                    AVX,SANDYBRIDGE
+VCVTTSD2SI     reg32,xmmrm64                   [rm:    vex.128.f2.0f.w0 2c /r]                 AVX,SANDYBRIDGE
+VCVTTSD2SI     reg64,xmmrm64                   [rm:    vex.128.f2.0f.w1 2c /r]                 AVX,SANDYBRIDGE,LONG
+VCVTTSS2SI     reg32,xmmrm32                   [rm:    vex.128.f3.0f.w0 2c /r]                 AVX,SANDYBRIDGE
+VCVTTSS2SI     reg64,xmmrm32                   [rm:    vex.128.f3.0f.w1 2c /r]                 AVX,SANDYBRIDGE,LONG
+VDIVPD         xmmreg,xmmreg*,xmmrm128         [rvm:   vex.nds.128.66.0f 5e /r]                AVX,SANDYBRIDGE
+VDIVPD         ymmreg,ymmreg*,ymmrm256         [rvm:   vex.nds.256.66.0f 5e /r]                AVX,SANDYBRIDGE
+VDIVPS         xmmreg,xmmreg*,xmmrm128         [rvm:   vex.nds.128.0f 5e /r]                   AVX,SANDYBRIDGE
+VDIVPS         ymmreg,ymmreg*,ymmrm256         [rvm:   vex.nds.256.0f 5e /r]                   AVX,SANDYBRIDGE
+VDIVSD         xmmreg,xmmreg*,xmmrm64          [rvm:   vex.nds.128.f2.0f 5e /r]                AVX,SANDYBRIDGE
+VDIVSS         xmmreg,xmmreg*,xmmrm32          [rvm:   vex.nds.128.f3.0f 5e /r]                AVX,SANDYBRIDGE
+VDPPD          xmmreg,xmmreg*,xmmrm128,imm8    [rvmi:  vex.nds.128.66.0f3a 41 /r ib]           AVX,SANDYBRIDGE
+VDPPS          xmmreg,xmmreg*,xmmrm128,imm8    [rvmi:  vex.nds.128.66.0f3a 40 /r ib]           AVX,SANDYBRIDGE
+VDPPS          ymmreg,ymmreg*,ymmrm256,imm8    [rvmi:  vex.nds.256.66.0f3a 40 /r ib]           AVX,SANDYBRIDGE
+VEXTRACTF128   xmmrm128,xmmreg,imm8            [mri:   vex.256.66.0f3a 19 /r ib]               AVX,SANDYBRIDGE
+VEXTRACTPS     rm32,xmmreg,imm8                [mri:   vex.128.66.0f3a 17 /r ib]               AVX,SANDYBRIDGE
+VHADDPD                xmmreg,xmmreg*,xmmrm128         [rvm:   vex.nds.128.66.0f 7c /r]                AVX,SANDYBRIDGE
+VHADDPD                ymmreg,ymmreg*,ymmrm256         [rvm:   vex.nds.256.66.0f 7c /r]                AVX,SANDYBRIDGE
+VHADDPS                xmmreg,xmmreg*,xmmrm128         [rvm:   vex.nds.128.f2.0f 7c /r]                AVX,SANDYBRIDGE
+VHADDPS                ymmreg,ymmreg*,ymmrm256         [rvm:   vex.nds.256.f2.0f 7c /r]                AVX,SANDYBRIDGE
+VHSUBPD                xmmreg,xmmreg*,xmmrm128         [rvm:   vex.nds.128.66.0f 7d /r]                AVX,SANDYBRIDGE
+VHSUBPD                ymmreg,ymmreg*,ymmrm256         [rvm:   vex.nds.256.66.0f 7d /r]                AVX,SANDYBRIDGE
+VHSUBPS                xmmreg,xmmreg*,xmmrm128         [rvm:   vex.nds.128.f2.0f 7d /r]                AVX,SANDYBRIDGE
+VHSUBPS                ymmreg,ymmreg*,ymmrm256         [rvm:   vex.nds.256.f2.0f 7d /r]                AVX,SANDYBRIDGE
+VINSERTF128    ymmreg,ymmreg,xmmrm128,imm8     [rvmi:  vex.nds.256.66.0f3a 18 /r ib]           AVX,SANDYBRIDGE
+VINSERTPS      xmmreg,xmmreg*,xmmrm32,imm8     [rvmi:  vex.nds.128.66.0f3a 21 /r ib]           AVX,SANDYBRIDGE
+VLDDQU         xmmreg,mem128                   [rm:    vex.128.f2.0f f0 /r]                    AVX,SANDYBRIDGE
+VLDQQU         ymmreg,mem256                   [rm:    vex.256.f2.0f f0 /r]                    AVX,SANDYBRIDGE
+VLDDQU         ymmreg,mem256                   [rm:    vex.256.f2.0f f0 /r]                    AVX,SANDYBRIDGE
+VLDMXCSR       mem32                           [m:     vex.128.0f ae /2]                       AVX,SANDYBRIDGE
+VMASKMOVDQU    xmmreg,xmmreg                   [rm:    vex.128.66.0f f7 /r]                    AVX,SANDYBRIDGE
+VMASKMOVPS     xmmreg,xmmreg,mem128            [rvm:   vex.nds.128.66.0f38 2c /r]              AVX,SANDYBRIDGE
+VMASKMOVPS     ymmreg,ymmreg,mem256            [rvm:   vex.nds.256.66.0f38 2c /r]              AVX,SANDYBRIDGE
+VMASKMOVPS     mem128,xmmreg,xmmreg            [mvr:   vex.nds.128.66.0f38 2e /r]              AVX,SANDYBRIDGE,SO
+VMASKMOVPS     mem256,xmmreg,xmmreg            [mvr:   vex.nds.256.66.0f38 2e /r]              AVX,SANDYBRIDGE,SY
+VMASKMOVPD     xmmreg,xmmreg,mem128            [rvm:   vex.nds.128.66.0f38 2d /r]              AVX,SANDYBRIDGE
+VMASKMOVPD     ymmreg,ymmreg,mem256            [rvm:   vex.nds.256.66.0f38 2d /r]              AVX,SANDYBRIDGE
+VMASKMOVPD     mem128,xmmreg,xmmreg            [mvr:   vex.nds.128.66.0f38 2f /r]              AVX,SANDYBRIDGE
+VMASKMOVPD     mem256,ymmreg,ymmreg            [mvr:   vex.nds.256.66.0f38 2f /r]              AVX,SANDYBRIDGE
+VMAXPD         xmmreg,xmmreg*,xmmrm128         [rvm:   vex.nds.128.66.0f 5f /r]                AVX,SANDYBRIDGE
+VMAXPD         ymmreg,ymmreg*,ymmrm256         [rvm:   vex.nds.256.66.0f 5f /r]                AVX,SANDYBRIDGE
+VMAXPS         xmmreg,xmmreg*,xmmrm128         [rvm:   vex.nds.128.0f 5f /r]                   AVX,SANDYBRIDGE
+VMAXPS         ymmreg,ymmreg*,ymmrm256         [rvm:   vex.nds.256.0f 5f /r]                   AVX,SANDYBRIDGE
+VMAXSD         xmmreg,xmmreg*,xmmrm64          [rvm:   vex.nds.128.f2.0f 5f /r]                AVX,SANDYBRIDGE
+VMAXSS         xmmreg,xmmreg*,xmmrm32          [rvm:   vex.nds.128.f3.0f 5f /r]                AVX,SANDYBRIDGE
+VMINPD         xmmreg,xmmreg*,xmmrm128         [rvm:   vex.nds.128.66.0f 5d /r]                AVX,SANDYBRIDGE
+VMINPD         ymmreg,ymmreg*,ymmrm256         [rvm:   vex.nds.256.66.0f 5d /r]                AVX,SANDYBRIDGE
+VMINPS         xmmreg,xmmreg*,xmmrm128         [rvm:   vex.nds.128.0f 5d /r]                   AVX,SANDYBRIDGE
+VMINPS         ymmreg,ymmreg*,ymmrm256         [rvm:   vex.nds.256.0f 5d /r]                   AVX,SANDYBRIDGE
+VMINSD         xmmreg,xmmreg*,xmmrm64          [rvm:   vex.nds.128.f2.0f 5d /r]                AVX,SANDYBRIDGE
+VMINSS         xmmreg,xmmreg*,xmmrm32          [rvm:   vex.nds.128.f3.0f 5d /r]                AVX,SANDYBRIDGE
+VMOVAPD                xmmreg,xmmrm128                 [rm:    vex.128.66.0f 28 /r]                    AVX,SANDYBRIDGE
+VMOVAPD                xmmrm128,xmmreg                 [mr:    vex.128.66.0f 29 /r]                    AVX,SANDYBRIDGE
+VMOVAPD                ymmreg,ymmrm256                 [rm:    vex.256.66.0f 28 /r]                    AVX,SANDYBRIDGE
+VMOVAPD                ymmrm256,ymmreg                 [mr:    vex.256.66.0f 29 /r]                    AVX,SANDYBRIDGE
+VMOVAPS                xmmreg,xmmrm128                 [rm:    vex.128.0f 28 /r]                       AVX,SANDYBRIDGE
+VMOVAPS                xmmrm128,xmmreg                 [mr:    vex.128.0f 29 /r]                       AVX,SANDYBRIDGE
+VMOVAPS                ymmreg,ymmrm256                 [rm:    vex.256.0f 28 /r]                       AVX,SANDYBRIDGE
+VMOVAPS                ymmrm256,ymmreg                 [mr:    vex.256.0f 29 /r]                       AVX,SANDYBRIDGE
+VMOVQ          xmmreg,xmmrm64                  [rm:    vex.128.f3.0f 7e /r]                    AVX,SANDYBRIDGE,SQ
+VMOVQ          xmmrm64,xmmreg                  [mr:    vex.128.66.0f d6 /r]                    AVX,SANDYBRIDGE,SQ
+VMOVQ          xmmreg,rm64                     [rm:    vex.128.66.0f.w1 6e /r]                 AVX,SANDYBRIDGE,LONG,SQ
+VMOVQ          rm64,xmmreg                     [mr:    vex.128.66.0f.w1 7e /r]                 AVX,SANDYBRIDGE,LONG,SQ
+VMOVD          xmmreg,rm32                     [rm:    vex.128.66.0f.w0 6e /r]                 AVX,SANDYBRIDGE
+VMOVD          rm32,xmmreg                     [mr:    vex.128.66.0f.w0 7e /r]                 AVX,SANDYBRIDGE
+VMOVDDUP       xmmreg,xmmrm64                  [rm:    vex.128.f2.0f 12 /r]                    AVX,SANDYBRIDGE
+VMOVDDUP       ymmreg,ymmrm256                 [rm:    vex.256.f2.0f 12 /r]                    AVX,SANDYBRIDGE
+VMOVDQA                xmmreg,xmmrm128                 [rm:    vex.128.66.0f 6f /r]                    AVX,SANDYBRIDGE
+VMOVDQA                xmmrm128,xmmreg                 [mr:    vex.128.66.0f 7f /r]                    AVX,SANDYBRIDGE
+; These are officially documented as VMOVDQA, but VMOVQQA seems more logical to me...
+VMOVQQA                ymmreg,ymmrm256                 [rm:    vex.256.66.0f 6f /r]                    AVX,SANDYBRIDGE
+VMOVQQA                ymmrm256,ymmreg                 [mr:    vex.256.66.0f 7f /r]                    AVX,SANDYBRIDGE
+VMOVDQA                ymmreg,ymmrm                    [rm:    vex.256.66.0f 6f /r]                    AVX,SANDYBRIDGE
+VMOVDQA                ymmrm256,ymmreg                 [mr:    vex.256.66.0f 7f /r]                    AVX,SANDYBRIDGE
+VMOVDQU                xmmreg,xmmrm128                 [rm:    vex.128.f3.0f 6f /r]                    AVX,SANDYBRIDGE
+VMOVDQU                xmmrm128,xmmreg                 [mr:    vex.128.f3.0f 7f /r]                    AVX,SANDYBRIDGE
+; These are officially documented as VMOVDQU, but VMOVQQU seems more logical to me...
+VMOVQQU                ymmreg,ymmrm256                 [rm:    vex.256.f3.0f 6f /r]                    AVX,SANDYBRIDGE
+VMOVQQU                ymmrm256,ymmreg                 [mr:    vex.256.f3.0f 7f /r]                    AVX,SANDYBRIDGE
+VMOVDQU                ymmreg,ymmrm256                 [rm:    vex.256.f3.0f 6f /r]                    AVX,SANDYBRIDGE
+VMOVDQU                ymmrm256,ymmreg                 [mr:    vex.256.f3.0f 7f /r]                    AVX,SANDYBRIDGE
+VMOVHLPS       xmmreg,xmmreg*,xmmreg           [rvm:   vex.nds.128.0f 12 /r]                   AVX,SANDYBRIDGE
+VMOVHPD                xmmreg,xmmreg*,mem64            [rvm:   vex.nds.128.66.0f 16 /r]                AVX,SANDYBRIDGE
+VMOVHPD                mem64,xmmreg                    [mr:    vex.128.66.0f 17 /r]                    AVX,SANDYBRIDGE
+VMOVHPS                xmmreg,xmmreg*,mem64            [rvm:   vex.nds.128.0f 16 /r]                   AVX,SANDYBRIDGE
+VMOVHPS                mem64,xmmreg                    [mr:    vex.128.0f 17 /r]                       AVX,SANDYBRIDGE
+VMOVLHPS       xmmreg,xmmreg*,xmmreg           [rvm:   vex.nds.128.0f 16 /r]                   AVX,SANDYBRIDGE
+VMOVLPD                xmmreg,xmmreg*,mem64            [rvm:   vex.nds.128.66.0f 12 /r]                AVX,SANDYBRIDGE
+VMOVLPD                mem64,xmmreg                    [mr:    vex.128.66.0f 13 /r]                    AVX,SANDYBRIDGE
+VMOVLPS                xmmreg,xmmreg*,mem64            [rvm:   vex.nds.128.0f 12 /r]                   AVX,SANDYBRIDGE
+VMOVLPS                mem64,xmmreg                    [mr:    vex.128.0f 13 /r]                       AVX,SANDYBRIDGE
+VMOVMSKPD      reg64,xmmreg                    [rm:    vex.128.66.0f 50 /r]                    AVX,SANDYBRIDGE,LONG
+VMOVMSKPD      reg32,xmmreg                    [rm:    vex.128.66.0f 50 /r]                    AVX,SANDYBRIDGE
+VMOVMSKPD      reg64,ymmreg                    [rm:    vex.256.66.0f 50 /r]                    AVX,SANDYBRIDGE,LONG
+VMOVMSKPD      reg32,ymmreg                    [rm:    vex.256.66.0f 50 /r]                    AVX,SANDYBRIDGE
+VMOVMSKPS      reg64,xmmreg                    [rm:    vex.128.0f 50 /r]                       AVX,SANDYBRIDGE,LONG
+VMOVMSKPS      reg32,xmmreg                    [rm:    vex.128.0f 50 /r]                       AVX,SANDYBRIDGE
+VMOVMSKPS      reg64,ymmreg                    [rm:    vex.256.0f 50 /r]                       AVX,SANDYBRIDGE,LONG
+VMOVMSKPS      reg32,ymmreg                    [rm:    vex.256.0f 50 /r]                       AVX,SANDYBRIDGE
+VMOVNTDQ       mem128,xmmreg                   [mr:    vex.128.66.0f e7 /r]                    AVX,SANDYBRIDGE
+; Officially VMOVNTDQ, but VMOVNTQQ seems more logical to me...
+VMOVNTQQ       mem256,ymmreg                   [mr:    vex.256.66.0f e7 /r]                    AVX,SANDYBRIDGE
+VMOVNTDQ       mem256,ymmreg                   [mr:    vex.256.66.0f e7 /r]                    AVX,SANDYBRIDGE
+VMOVNTDQA      xmmreg,mem128                   [rm:    vex.128.66.0f38 2a /r]                  AVX,SANDYBRIDGE
+VMOVNTPD       mem128,xmmreg                   [mr:    vex.128.66.0f 2b /r]                    AVX,SANDYBRIDGE
+VMOVNTPD       mem256,ymmreg                   [mr:    vex.256.66.0f 2b /r]                    AVX,SANDYBRIDGE
+VMOVNTPS       mem128,xmmreg                   [mr:    vex.128.0f 2b /r]                       AVX,SANDYBRIDGE
+VMOVNTPS       mem128,ymmreg                   [mr:    vex.256.0f 2b /r]                       AVX,SANDYBRIDGE
+VMOVSD         xmmreg,xmmreg*,xmmreg           [rvm:   vex.nds.128.f2.0f 10 /r]                AVX,SANDYBRIDGE
+VMOVSD         xmmreg,mem64                    [rm:    vex.128.f2.0f 10 /r]                    AVX,SANDYBRIDGE
+VMOVSD         xmmreg,xmmreg*,xmmreg           [mvr:   vex.nds.128.f2.0f 11 /r]                AVX,SANDYBRIDGE
+VMOVSD         mem64,xmmreg                    [mr:    vex.128.f2.0f 11 /r]                    AVX,SANDYBRIDGE
+VMOVSHDUP      xmmreg,xmmrm128                 [rm:    vex.128.f3.0f 16 /r]                    AVX,SANDYBRIDGE
+VMOVSHDUP      ymmreg,ymmrm256                 [rm:    vex.256.f3.0f 16 /r]                    AVX,SANDYBRIDGE
+VMOVSLDUP      xmmreg,xmmrm128                 [rm:    vex.128.f3.0f 12 /r]                    AVX,SANDYBRIDGE
+VMOVSLDUP      ymmreg,ymmrm256                 [rm:    vex.256.f3.0f 12 /r]                    AVX,SANDYBRIDGE
+VMOVSS         xmmreg,xmmreg*,xmmreg           [rvm:   vex.nds.128.f3.0f 10 /r]                AVX,SANDYBRIDGE
+VMOVSS         xmmreg,mem64                    [rm:    vex.128.f3.0f 10 /r]                    AVX,SANDYBRIDGE
+VMOVSS         xmmreg,xmmreg*,xmmreg           [mvr:   vex.nds.128.f3.0f 11 /r]                AVX,SANDYBRIDGE
+VMOVSS         mem64,xmmreg                    [mr:    vex.128.f3.0f 11 /r]                    AVX,SANDYBRIDGE
+VMOVUPD                xmmreg,xmmrm128                 [rm:    vex.128.66.0f 10 /r]                    AVX,SANDYBRIDGE
+VMOVUPD                xmmrm128,xmmreg                 [mr:    vex.128.66.0f 11 /r]                    AVX,SANDYBRIDGE
+VMOVUPD                ymmreg,ymmrm256                 [rm:    vex.256.66.0f 10 /r]                    AVX,SANDYBRIDGE
+VMOVUPD                ymmrm256,ymmreg                 [mr:    vex.256.66.0f 11 /r]                    AVX,SANDYBRIDGE
+VMOVUPS                xmmreg,xmmrm128                 [rm:    vex.128.0f 10 /r]                       AVX,SANDYBRIDGE
+VMOVUPS                xmmrm128,xmmreg                 [mr:    vex.128.0f 11 /r]                       AVX,SANDYBRIDGE
+VMOVUPS                ymmreg,ymmrm256                 [rm:    vex.256.0f 10 /r]                       AVX,SANDYBRIDGE
+VMOVUPS                ymmrm256,ymmreg                 [mr:    vex.256.0f 11 /r]                       AVX,SANDYBRIDGE
+VMPSADBW       xmmreg,xmmreg*,xmmrm128,imm8    [rvmi:  vex.nds.128.66.0f3a 42 /r ib]           AVX,SANDYBRIDGE
+VMULPD         xmmreg,xmmreg*,xmmrm128         [rvm:   vex.nds.128.66.0f 59 /r]                AVX,SANDYBRIDGE
+VMULPD         ymmreg,ymmreg*,ymmrm256         [rvm:   vex.nds.256.66.0f 59 /r]                AVX,SANDYBRIDGE
+VMULPS         xmmreg,xmmreg*,xmmrm128         [rvm:   vex.nds.128.0f 59 /r]                   AVX,SANDYBRIDGE
+VMULPS         ymmreg,ymmreg*,ymmrm256         [rvm:   vex.nds.256.0f 59 /r]                   AVX,SANDYBRIDGE
+VMULSD         xmmreg,xmmreg*,xmmrm64          [rvm:   vex.nds.128.f2.0f 59 /r]                AVX,SANDYBRIDGE
+VMULSS         xmmreg,xmmreg*,xmmrm32          [rvm:   vex.nds.128.f3.0f 59 /r]                AVX,SANDYBRIDGE
+VORPD          xmmreg,xmmreg*,xmmrm128         [rvm:   vex.nds.128.66.0f 56 /r]                AVX,SANDYBRIDGE
+VORPD          ymmreg,ymmreg*,ymmrm256         [rvm:   vex.nds.256.66.0f 56 /r]                AVX,SANDYBRIDGE
+VORPS          xmmreg,xmmreg*,xmmrm128         [rvm:   vex.nds.128.0f 56 /r]                   AVX,SANDYBRIDGE
+VORPS          ymmreg,ymmreg*,ymmrm256         [rvm:   vex.nds.256.0f 56 /r]                   AVX,SANDYBRIDGE
+VPABSB         xmmreg,xmmrm128                 [rm:    vex.128.66.0f38 1c /r]                  AVX,SANDYBRIDGE
+VPABSW         xmmreg,xmmrm128                 [rm:    vex.128.66.0f38 1d /r]                  AVX,SANDYBRIDGE
+VPABSD         xmmreg,xmmrm128                 [rm:    vex.128.66.0f38 1e /r]                  AVX,SANDYBRIDGE
+VPACKSSWB      xmmreg,xmmreg*,xmmrm128         [rvm:   vex.nds.128.66.0f 63 /r]                AVX,SANDYBRIDGE
+VPACKSSDW      xmmreg,xmmreg*,xmmrm128         [rvm:   vex.nds.128.66.0f 6b /r]                AVX,SANDYBRIDGE
+VPACKUSWB      xmmreg,xmmreg*,xmmrm128         [rvm:   vex.nds.128.66.0f 67 /r]                AVX,SANDYBRIDGE
+VPACKUSDW      xmmreg,xmmreg*,xmmrm128         [rvm:   vex.nds.128.66.0f38 2b /r]              AVX,SANDYBRIDGE
+VPADDB         xmmreg,xmmreg*,xmmrm128         [rvm:   vex.nds.128.66.0f fc /r]                AVX,SANDYBRIDGE
+VPADDW         xmmreg,xmmreg*,xmmrm128         [rvm:   vex.nds.128.66.0f fd /r]                AVX,SANDYBRIDGE
+VPADDD         xmmreg,xmmreg*,xmmrm128         [rvm:   vex.nds.128.66.0f fe /r]                AVX,SANDYBRIDGE
+VPADDQ         xmmreg,xmmreg*,xmmrm128         [rvm:   vex.nds.128.66.0f d4 /r]                AVX,SANDYBRIDGE
+VPADDSB                xmmreg,xmmreg*,xmmrm128         [rvm:   vex.nds.128.66.0f ec /r]                AVX,SANDYBRIDGE
+VPADDSW                xmmreg,xmmreg*,xmmrm128         [rvm:   vex.nds.128.66.0f ed /r]                AVX,SANDYBRIDGE
+VPADDUSB       xmmreg,xmmreg*,xmmrm128         [rvm:   vex.nds.128.66.0f dc /r]                AVX,SANDYBRIDGE
+VPADDUSW       xmmreg,xmmreg*,xmmrm128         [rvm:   vex.nds.128.66.0f dd /r]                AVX,SANDYBRIDGE
+VPALIGNR       xmmreg,xmmreg*,xmmrm128,imm8    [rvmi:  vex.nds.128.66.0f3a 0f /r ib]           AVX,SANDYBRIDGE
+VPAND          xmmreg,xmmreg*,xmmrm128         [rvm:   vex.nds.128.66.0f db /r]                AVX,SANDYBRIDGE
+VPANDN         xmmreg,xmmreg*,xmmrm128         [rvm:   vex.nds.128.66.0f df /r]                AVX,SANDYBRIDGE
+VPAVGB         xmmreg,xmmreg*,xmmrm128         [rvm:   vex.nds.128.66.0f e0 /r]                AVX,SANDYBRIDGE
+VPAVGW         xmmreg,xmmreg*,xmmrm128         [rvm:   vex.nds.128.66.0f e3 /r]                AVX,SANDYBRIDGE
+VPBLENDVB      xmmreg,xmmreg*,xmmrm128,xmmreg  [rvms:  vex.nds.128.66.0f3a 4c /r /is4]         AVX,SANDYBRIDGE
+VPBLENDW       xmmreg,xmmreg*,xmmrm128,imm8    [rvmi:  vex.nds.128.66.0f3a 0e /r ib]           AVX,SANDYBRIDGE
+VPCMPESTRI     xmmreg,xmmrm128,imm8            [rmi:   vex.128.66.0f3a 61 /r ib]               AVX,SANDYBRIDGE
+VPCMPESTRM     xmmreg,xmmrm128,imm8            [rmi:   vex.128.66.0f3a 60 /r ib]               AVX,SANDYBRIDGE
+VPCMPISTRI     xmmreg,xmmrm128,imm8            [rmi:   vex.128.66.0f3a 63 /r ib]               AVX,SANDYBRIDGE
+VPCMPISTRM     xmmreg,xmmrm128,imm8            [rmi:   vex.128.66.0f3a 62 /r ib]               AVX,SANDYBRIDGE
+VPCMPEQB       xmmreg,xmmreg*,xmmrm128         [rvm:   vex.nds.128.66.0f 74 /r]                AVX,SANDYBRIDGE
+VPCMPEQW       xmmreg,xmmreg*,xmmrm128         [rvm:   vex.nds.128.66.0f 75 /r]                AVX,SANDYBRIDGE
+VPCMPEQD       xmmreg,xmmreg*,xmmrm128         [rvm:   vex.nds.128.66.0f 76 /r]                AVX,SANDYBRIDGE
+VPCMPEQQ       xmmreg,xmmreg*,xmmrm128         [rvm:   vex.nds.128.66.0f 29 /r]                AVX,SANDYBRIDGE
+VPCMPGTB       xmmreg,xmmreg*,xmmrm128         [rvm:   vex.nds.128.66.0f 64 /r]                AVX,SANDYBRIDGE
+VPCMPGTW       xmmreg,xmmreg*,xmmrm128         [rvm:   vex.nds.128.66.0f 65 /r]                AVX,SANDYBRIDGE
+VPCMPGTD       xmmreg,xmmreg*,xmmrm128         [rvm:   vex.nds.128.66.0f 66 /r]                AVX,SANDYBRIDGE
+VPCMPGTQ       xmmreg,xmmreg*,xmmrm128         [rvm:   vex.nds.128.66.0f 37 /r]                AVX,SANDYBRIDGE
+VPERMILPD      xmmreg,xmmreg,xmmrm128          [rvm:   vex.nds.128.66.0f38 0d /r]              AVX,SANDYBRIDGE
+VPERMILPD      ymmreg,ymmreg,ymmrm256          [rvm:   vex.nds.256.66.0f38 0d /r]              AVX,SANDYBRIDGE
+VPERMILPD      xmmreg,xmmrm128,imm8            [rmi:   vex.128.66.0f3a 05 /r ib]               AVX,SANDYBRIDGE
+VPERMILPD      ymmreg,ymmrm256,imm8            [rmi:   vex.256.66.0f3a 05 /r ib]               AVX,SANDYBRIDGE
+VPERMILTD2PD   xmmreg,xmmreg,xmmrm128,xmmreg   [rvms:  vex.nds.128.66.0f3a.w0 49 /r /is4=0]    AVX,SANDYBRIDGE
+VPERMILTD2PD   xmmreg,xmmreg,xmmreg,xmmrm128   [rvsm:  vex.nds.128.66.0f3a.w1 49 /r /is4=0]    AVX,SANDYBRIDGE
+VPERMILTD2PD   ymmreg,ymmreg,ymmrm256,ymmreg   [rvms:  vex.nds.256.66.0f3a.w0 49 /r /is4=0]    AVX,SANDYBRIDGE
+VPERMILTD2PD   ymmreg,ymmreg,ymmreg,ymmrm256   [rvsm:  vex.nds.256.66.0f3a.w1 49 /r /is4=0]    AVX,SANDYBRIDGE
+VPERMILMO2PD   xmmreg,xmmreg,xmmrm128,xmmreg   [rvms:  vex.nds.128.66.0f3a.w0 49 /r /is4=2]    AVX,SANDYBRIDGE
+VPERMILMO2PD   xmmreg,xmmreg,xmmreg,xmmrm128   [rvsm:  vex.nds.128.66.0f3a.w1 49 /r /is4=2]    AVX,SANDYBRIDGE
+VPERMILMO2PD   ymmreg,ymmreg,ymmrm256,ymmreg   [rvms:  vex.nds.256.66.0f3a.w0 49 /r /is4=2]    AVX,SANDYBRIDGE
+VPERMILMO2PD   ymmreg,ymmreg,ymmreg,ymmrm256   [rvsm:  vex.nds.256.66.0f3a.w1 49 /r /is4=2]    AVX,SANDYBRIDGE
+VPERMILMZ2PD   xmmreg,xmmreg,xmmrm128,xmmreg   [rvms:  vex.nds.128.66.0f3a.w0 49 /r /is4=3]    AVX,SANDYBRIDGE
+VPERMILMZ2PD   xmmreg,xmmreg,xmmreg,xmmrm128   [rvsm:  vex.nds.128.66.0f3a.w1 49 /r /is4=3]    AVX,SANDYBRIDGE
+VPERMILMZ2PD   ymmreg,ymmreg,ymmrm256,ymmreg   [rvms:  vex.nds.256.66.0f3a.w0 49 /r /is4=3]    AVX,SANDYBRIDGE
+VPERMILMZ2PD   ymmreg,ymmreg,ymmreg,ymmrm256   [rvsm:  vex.nds.256.66.0f3a.w1 49 /r /is4=3]    AVX,SANDYBRIDGE
+VPERMIL2PD     xmmreg,xmmreg,xmmrm128,xmmreg,imm8      [rvmsi: vex.nds.128.66.0f3a.w0 49 /r /is4]      AVX,SANDYBRIDGE
+VPERMIL2PD     xmmreg,xmmreg,xmmreg,xmmrm128,imm8      [rvsmi: vex.nds.128.66.0f3a.w1 49 /r /is4]      AVX,SANDYBRIDGE
+VPERMIL2PD     ymmreg,ymmreg,ymmrm256,ymmreg,imm8      [rvmsi: vex.nds.256.66.0f3a.w0 49 /r /is4]      AVX,SANDYBRIDGE
+VPERMIL2PD     ymmreg,ymmreg,ymmreg,ymmrm256,imm8      [rvsmi: vex.nds.256.66.0f3a.w1 49 /r /is4]      AVX,SANDYBRIDGE
+VPERMILPS      xmmreg,xmmreg,xmmrm128          [rvm:   vex.nds.128.66.0f38 0c /r]              AVX,SANDYBRIDGE
+VPERMILPS      ymmreg,ymmreg,ymmrm256          [rvm:   vex.nds.256.66.0f38 0c /r]              AVX,SANDYBRIDGE
+VPERMILPS      xmmreg,xmmrm128,imm8            [rmi:   vex.128.66.0f3a 04 /r ib]               AVX,SANDYBRIDGE
+VPERMILPS      ymmreg,ymmrm256,imm8            [rmi:   vex.256.66.0f3a 04 /r ib]               AVX,SANDYBRIDGE
+VPERMILTD2PS   xmmreg,xmmreg,xmmrm128,xmmreg   [rvms:  vex.nds.128.66.0f3a.w0 48 /r /is4=0]    AVX,SANDYBRIDGE
+VPERMILTD2PS   xmmreg,xmmreg,xmmreg,xmmrm128   [rvsm:  vex.nds.128.66.0f3a.w1 48 /r /is4=0]    AVX,SANDYBRIDGE
+VPERMILTD2PS   ymmreg,ymmreg,ymmrm256,ymmreg   [rvms:  vex.nds.256.66.0f3a.w0 48 /r /is4=0]    AVX,SANDYBRIDGE
+VPERMILTD2PS   ymmreg,ymmreg,ymmreg,ymmrm256   [rvsm:  vex.nds.256.66.0f3a.w1 48 /r /is4=0]    AVX,SANDYBRIDGE
+VPERMILMO2PS   xmmreg,xmmreg,xmmrm128,xmmreg   [rvms:  vex.nds.128.66.0f3a.w0 48 /r /is4=2]    AVX,SANDYBRIDGE
+VPERMILMO2PS   xmmreg,xmmreg,xmmreg,xmmrm128   [rvsm:  vex.nds.128.66.0f3a.w1 48 /r /is4=2]    AVX,SANDYBRIDGE
+VPERMILMO2PS   ymmreg,ymmreg,ymmrm256,ymmreg   [rvms:  vex.nds.256.66.0f3a.w0 48 /r /is4=2]    AVX,SANDYBRIDGE
+VPERMILMO2PS   ymmreg,ymmreg,ymmreg,ymmrm256   [rvsm:  vex.nds.256.66.0f3a.w1 48 /r /is4=2]    AVX,SANDYBRIDGE
+VPERMILMZ2PS   xmmreg,xmmreg,xmmrm128,xmmreg   [rvms:  vex.nds.128.66.0f3a.w0 48 /r /is4=3]    AVX,SANDYBRIDGE
+VPERMILMZ2PS   xmmreg,xmmreg,xmmreg,xmmrm128   [rvsm:  vex.nds.128.66.0f3a.w1 48 /r /is4=3]    AVX,SANDYBRIDGE
+VPERMILMZ2PS   ymmreg,ymmreg,ymmrm256,ymmreg   [rvms:  vex.nds.256.66.0f3a.w0 48 /r /is4=3]    AVX,SANDYBRIDGE
+VPERMILMZ2PS   ymmreg,ymmreg,ymmreg,ymmrm256   [rvsm:  vex.nds.256.66.0f3a.w1 48 /r /is4=3]    AVX,SANDYBRIDGE
+VPERMIL2PS     xmmreg,xmmreg,xmmrm128,xmmreg,imm8      [rvmsi: vex.nds.128.66.0f3a.w0 48 /r /is4]      AVX,SANDYBRIDGE
+VPERMIL2PS     xmmreg,xmmreg,xmmreg,xmmrm128,imm8      [rvsmi: vex.nds.128.66.0f3a.w1 48 /r /is4]      AVX,SANDYBRIDGE
+VPERMIL2PS     ymmreg,ymmreg,ymmrm256,ymmreg,imm8      [rvmsi: vex.nds.256.66.0f3a.w0 48 /r /is4]      AVX,SANDYBRIDGE
+VPERMIL2PS     ymmreg,ymmreg,ymmreg,ymmrm256,imm8      [rvsmi: vex.nds.256.66.0f3a.w1 48 /r /is4]      AVX,SANDYBRIDGE
+VPERM2F128     ymmreg,ymmreg,ymmrm256,imm8             [rvmi:  vex.nds.256.66.0f3a 06 /r ib]           AVX,SANDYBRIDGE
+VPEXTRB                reg64,xmmreg,imm8               [mri:   vex.128.66.0f3a.w0 14 /r ib]            AVX,SANDYBRIDGE,LONG
+VPEXTRB                reg32,xmmreg,imm8               [mri:   vex.128.66.0f3a.w0 14 /r ib]            AVX,SANDYBRIDGE
+VPEXTRB                mem8,xmmreg,imm8                [mri:   vex.128.66.0f3a.w0 14 /r ib]            AVX,SANDYBRIDGE
+VPEXTRW                reg64,xmmreg,imm8               [mri:   vex.128.66.0f.w0 c5 /r ib]              AVX,SANDYBRIDGE,LONG
+VPEXTRW                reg32,xmmreg,imm8               [mri:   vex.128.66.0f.w0 c5 /r ib]              AVX,SANDYBRIDGE
+VPEXTRW                mem16,xmmreg,imm8               [mri:   vex.128.66.0f.w0 c5 /r ib]              AVX,SANDYBRIDGE
+VPEXTRW                reg64,xmmreg,imm8               [mri:   vex.128.66.0f3a.w0 15 /r ib]            AVX,SANDYBRIDGE,LONG
+VPEXTRW                reg32,xmmreg,imm8               [mri:   vex.128.66.0f3a.w0 15 /r ib]            AVX,SANDYBRIDGE
+VPEXTRW                mem16,xmmreg,imm8               [mri:   vex.128.66.0f3a.w0 15 /r ib]            AVX,SANDYBRIDGE
+VPEXTRD                reg64,xmmreg,imm8               [mri:   vex.128.66.0f3a.w0 16 /r ib]            AVX,SANDYBRIDGE,LONG
+VPEXTRD                rm32,xmmreg,imm8                [mri:   vex.128.66.0f3a.w0 16 /r ib]            AVX,SANDYBRIDGE
+VPEXTRQ                rm64,xmmreg,imm8                [mri:   vex.128.66.0f3a.w1 16 /r ib]            AVX,SANDYBRIDGE,LONG
+VPHADDW                xmmreg,xmmreg*,xmmrm128         [rvm:   vex.nds.128.66.0f38 01 /r]              AVX,SANDYBRIDGE
+VPHADDD                xmmreg,xmmreg*,xmmrm128         [rvm:   vex.nds.128.66.0f38 02 /r]              AVX,SANDYBRIDGE
+VPHADDSW       xmmreg,xmmreg*,xmmrm128         [rvm:   vex.nds.128.66.0f38 03 /r]              AVX,SANDYBRIDGE
+VPHMINPOSUW    xmmreg,xmmrm128                 [rm:    vex.128.66.0f38 41 /r]                  AVX,SANDYBRIDGE
+VPHSUBW                xmmreg,xmmreg*,xmmrm128         [rvm:   vex.nds.128.66.0f38 05 /r]              AVX,SANDYBRIDGE
+VPHSUBD                xmmreg,xmmreg*,xmmrm128         [rvm:   vex.nds.128.66.0f38 06 /r]              AVX,SANDYBRIDGE
+VPHSUBSW       xmmreg,xmmreg*,xmmrm128         [rvm:   vex.nds.128.66.0f38 07 /r]              AVX,SANDYBRIDGE
+VPINSRB                xmmreg,xmmreg*,mem8,imm8        [rvmi:  vex.nds.128.66.0f3a 20 /r ib]           AVX,SANDYBRIDGE
+VPINSRB                xmmreg,xmmreg*,rm8,imm8         [rvmi:  vex.nds.128.66.0f3a 20 /r ib]           AVX,SANDYBRIDGE
+VPINSRB                xmmreg,xmmreg*,reg32,imm8       [rvmi:  vex.nds.128.66.0f3a 20 /r ib]           AVX,SANDYBRIDGE
+VPINSRW                xmmreg,xmmreg*,mem16,imm8       [rvmi:  vex.nds.128.66.0f c4 /r ib]             AVX,SANDYBRIDGE
+VPINSRW                xmmreg,xmmreg*,rm16,imm8        [rvmi:  vex.nds.128.66.0f c4 /r ib]             AVX,SANDYBRIDGE
+VPINSRW                xmmreg,xmmreg*,reg32,imm8       [rvmi:  vex.nds.128.66.0f c4 /r ib]             AVX,SANDYBRIDGE
+VPINSRD                xmmreg,xmmreg*,mem32,imm8       [rvmi:  vex.nds.128.66.0f3a.w0 22 /r ib]        AVX,SANDYBRIDGE
+VPINSRD                xmmreg,xmmreg*,rm32,imm8        [rvmi:  vex.nds.128.66.0f3a.w0 22 /r ib]        AVX,SANDYBRIDGE
+VPINSRQ                xmmreg,xmmreg*,mem64,imm8       [rvmi:  vex.nds.128.66.0f3a.w1 22 /r ib]        AVX,SANDYBRIDGE,LONG
+VPINSRQ                xmmreg,xmmreg*,rm64,imm8        [rvmi:  vex.nds.128.66.0f3a.w1 22 /r ib]        AVX,SANDYBRIDGE,LONG
+VPMADDWD       xmmreg,xmmreg*,xmmrm128         [rvm:   vex.nds.128.66.0f f5 /r]                AVX,SANDYBRIDGE
+VPMADDUBSW     xmmreg,xmmreg*,xmmrm128         [rvm:   vex.nds.128.66.0f38 04 /r]              AVX,SANDYBRIDGE
+VPMAXSB                xmmreg,xmmreg*,xmmrm128         [rvm:   vex.nds.128.66.0f38 3c /r]              AVX,SANDYBRIDGE
+VPMAXSW                xmmreg,xmmreg*,xmmrm128         [rvm:   vex.nds.128.66.0f ee /r]                AVX,SANDYBRIDGE
+VPMAXSD                xmmreg,xmmreg*,xmmrm128         [rvm:   vex.nds.128.66.0f38 3d /r]              AVX,SANDYBRIDGE
+VPMAXUB                xmmreg,xmmreg*,xmmrm128         [rvm:   vex.nds.128.66.0f de /r]                AVX,SANDYBRIDGE
+VPMAXUW                xmmreg,xmmreg*,xmmrm128         [rvm:   vex.nds.128.66.0f38 3e /r]              AVX,SANDYBRIDGE
+VPMAXUD                xmmreg,xmmreg*,xmmrm128         [rvm:   vex.nds.128.66.0f38 3f /r]              AVX,SANDYBRIDGE
+VPMINSB                xmmreg,xmmreg*,xmmrm128         [rvm:   vex.nds.128.66.0f38 38 /r]              AVX,SANDYBRIDGE
+VPMINSW                xmmreg,xmmreg*,xmmrm128         [rvm:   vex.nds.128.66.0f ea /r]                AVX,SANDYBRIDGE
+VPMINSD                xmmreg,xmmreg*,xmmrm128         [rvm:   vex.nds.128.66.0f38 39 /r]              AVX,SANDYBRIDGE
+VPMINUB                xmmreg,xmmreg*,xmmrm128         [rvm:   vex.nds.128.66.0f da /r]                AVX,SANDYBRIDGE
+VPMINUW                xmmreg,xmmreg*,xmmrm128         [rvm:   vex.nds.128.66.0f38 3a /r]              AVX,SANDYBRIDGE
+VPMINUD                xmmreg,xmmreg*,xmmrm128         [rvm:   vex.nds.128.66.0f38 3b /r]              AVX,SANDYBRIDGE
+VPMOVMSKB      reg64,xmmreg                    [rm:    vex.128.66.0f d7 /r]                    AVX,SANDYBRIDGE,LONG
+VPMOVMSKB      reg32,xmmreg                    [rm:    vex.128.66.0f d7 /r]                    AVX,SANDYBRIDGE
+VPMOVSXBW      xmmreg,xmmrm64                  [rm:    vex.128.66.0f38 20 /r]                  AVX,SANDYBRIDGE
+VPMOVSXBD      xmmreg,xmmrm32                  [rm:    vex.128.66.0f38 21 /r]                  AVX,SANDYBRIDGE
+VPMOVSXBQ      xmmreg,xmmrm16                  [rm:    vex.128.66.0f38 22 /r]                  AVX,SANDYBRIDGE
+VPMOVSXWD      xmmreg,xmmrm64                  [rm:    vex.128.66.0f38 23 /r]                  AVX,SANDYBRIDGE
+VPMOVSXWQ      xmmreg,xmmrm32                  [rm:    vex.128.66.0f38 24 /r]                  AVX,SANDYBRIDGE
+VPMOVSXDQ      xmmreg,xmmrm64                  [rm:    vex.128.66.0f38 25 /r]                  AVX,SANDYBRIDGE
+VPMOVZXBW      xmmreg,xmmrm64                  [rm:    vex.128.66.0f38 30 /r]                  AVX,SANDYBRIDGE
+VPMOVZXBD      xmmreg,xmmrm32                  [rm:    vex.128.66.0f38 31 /r]                  AVX,SANDYBRIDGE
+VPMOVZXBQ      xmmreg,xmmrm16                  [rm:    vex.128.66.0f38 32 /r]                  AVX,SANDYBRIDGE
+VPMOVZXWD      xmmreg,xmmrm64                  [rm:    vex.128.66.0f38 33 /r]                  AVX,SANDYBRIDGE
+VPMOVZXWQ      xmmreg,xmmrm32                  [rm:    vex.128.66.0f38 34 /r]                  AVX,SANDYBRIDGE
+VPMOVZXDQ      xmmreg,xmmrm64                  [rm:    vex.128.66.0f38 35 /r]                  AVX,SANDYBRIDGE
+VPMULHUW       xmmreg,xmmreg*,xmmrm128         [rvm:   vex.nds.128.66.0f e4 /r]                AVX,SANDYBRIDGE
+VPMULHRSW      xmmreg,xmmreg*,xmmrm128         [rvm:   vex.nds.128.66.0f38 0b /r]              AVX,SANDYBRIDGE
+VPMULHW                xmmreg,xmmreg*,xmmrm128         [rvm:   vex.nds.128.66.0f e5 /r]                AVX,SANDYBRIDGE
+VPMULLW                xmmreg,xmmreg*,xmmrm128         [rvm:   vex.nds.128.66.0f d5 /r]                AVX,SANDYBRIDGE
+VPMULLD                xmmreg,xmmreg*,xmmrm128         [rvm:   vex.nds.128.66.0f38 40 /r]              AVX,SANDYBRIDGE
+VPMULUDQ       xmmreg,xmmreg*,xmmrm128         [rvm:   vex.nds.128.66.0f f4 /r]                AVX,SANDYBRIDGE
+VPMULDQ                xmmreg,xmmreg*,xmmrm128         [rvm:   vex.nds.128.66.0f38 28 /r]              AVX,SANDYBRIDGE
+VPOR           xmmreg,xmmreg*,xmmrm128         [rvm:   vex.nds.128.66.0f eb /r]                AVX,SANDYBRIDGE
+VPSADBW                xmmreg,xmmreg*,xmmrm128         [rvm:   vex.nds.128.66.0f f6 /r]                AVX,SANDYBRIDGE
+VPSHUFB                xmmreg,xmmreg*,xmmrm128         [rvm:   vex.nds.128.66.0f38 00 /r]              AVX,SANDYBRIDGE
+VPSHUFD                xmmreg,xmmrm128,imm8            [rmi:   vex.128.66.0f 70 /r ib]                 AVX,SANDYBRIDGE
+VPSHUFHW       xmmreg,xmmrm128,imm8            [rmi:   vex.128.f3.0f 70 /r ib]                 AVX,SANDYBRIDGE
+VPSHUFLW       xmmreg,xmmrm128,imm8            [rmi:   vex.128.f2.0f 70 /r ib]                 AVX,SANDYBRIDGE
+VPSIGNB                xmmreg,xmmreg*,xmmrm128         [rvm:   vex.nds.128.66.0f38 08 /r]              AVX,SANDYBRIDGE
+VPSIGNW                xmmreg,xmmreg*,xmmrm128         [rvm:   vex.nds.128.66.0f38 09 /r]              AVX,SANDYBRIDGE
+VPSIGND                xmmreg,xmmreg*,xmmrm128         [rvm:   vex.nds.128.66.0f38 0a /r]              AVX,SANDYBRIDGE
+VPSLLDQ                xmmreg,xmmreg*,imm8             [vmi:   vex.ndd.128.66.0f 73 /7 ib]             AVX,SANDYBRIDGE
+VPSRLDQ                xmmreg,xmmreg*,imm8             [vmi:   vex.ndd.128.66.0f 73 /3 ib]             AVX,SANDYBRIDGE
+VPSLLW         xmmreg,xmmreg*,xmmrm128         [rvm:   vex.nds.128.66.0f f1 /r]                AVX,SANDYBRIDGE
+VPSLLW         xmmreg,xmmreg*,imm8             [vmi:   vex.ndd.128.66.0f 71 /6 ib]             AVX,SANDYBRIDGE
+VPSLLD         xmmreg,xmmreg*,xmmrm128         [rvm:   vex.nds.128.66.0f f2 /r]                AVX,SANDYBRIDGE
+VPSLLD         xmmreg,xmmreg*,imm8             [vmi:   vex.ndd.128.66.0f 72 /6 ib]             AVX,SANDYBRIDGE
+VPSLLQ         xmmreg,xmmreg*,xmmrm128         [rvm:   vex.nds.128.66.0f f3 /r]                AVX,SANDYBRIDGE
+VPSLLQ         xmmreg,xmmreg*,imm8             [vmi:   vex.ndd.128.66.0f 73 /6 ib]             AVX,SANDYBRIDGE
+VPSRAW         xmmreg,xmmreg*,xmmrm128         [rvm:   vex.nds.128.66.0f e1 /r]                AVX,SANDYBRIDGE
+VPSRAW         xmmreg,xmmreg*,imm8             [vmi:   vex.ndd.128.66.0f 71 /4 ib]             AVX,SANDYBRIDGE
+VPSRAD         xmmreg,xmmreg*,xmmrm128         [rvm:   vex.nds.128.66.0f e2 /r]                AVX,SANDYBRIDGE
+VPSRAD         xmmreg,xmmreg*,imm8             [vmi:   vex.ndd.128.66.0f 72 /4 ib]             AVX,SANDYBRIDGE
+VPSRLW         xmmreg,xmmreg*,xmmrm128         [rvm:   vex.nds.128.66.0f d1 /r]                AVX,SANDYBRIDGE
+VPSRLW         xmmreg,xmmreg*,imm8             [vmi:   vex.ndd.128.66.0f 71 /2 ib]             AVX,SANDYBRIDGE
+VPSRLD         xmmreg,xmmreg*,xmmrm128         [rvm:   vex.nds.128.66.0f d2 /r]                AVX,SANDYBRIDGE
+VPSRLD         xmmreg,xmmreg*,imm8             [vmi:   vex.ndd.128.66.0f 72 /2 ib]             AVX,SANDYBRIDGE
+VPSRLQ         xmmreg,xmmreg*,xmmrm128         [rvm:   vex.nds.128.66.0f d3 /r]                AVX,SANDYBRIDGE
+VPSRLQ         xmmreg,xmmreg*,imm8             [vmi:   vex.ndd.128.66.0f 73 /2 ib]             AVX,SANDYBRIDGE
+VPTEST         xmmreg,xmmrm128                 [rm:    vex.128.66.0f38 17 /r]                  AVX,SANDYBRIDGE
+VPTEST         ymmreg,ymmrm256                 [rm:    vex.256.66.0f38 17 /r]                  AVX,SANDYBRIDGE
+VPSUBB         xmmreg,xmmreg*,xmmrm128         [rvm:   vex.nds.128.66.0f f8 /r]                AVX,SANDYBRIDGE
+VPSUBW         xmmreg,xmmreg*,xmmrm128         [rvm:   vex.nds.128.66.0f f9 /r]                AVX,SANDYBRIDGE
+VPSUBD         xmmreg,xmmreg*,xmmrm128         [rvm:   vex.nds.128.66.0f fa /r]                AVX,SANDYBRIDGE
+VPSUBQ         xmmreg,xmmreg*,xmmrm128         [rvm:   vex.nds.128.66.0f fb /r]                AVX,SANDYBRIDGE
+VPSUBSB                xmmreg,xmmreg*,xmmrm128         [rvm:   vex.nds.128.66.0f e8 /r]                AVX,SANDYBRIDGE
+VPSUBSW                xmmreg,xmmreg*,xmmrm128         [rvm:   vex.nds.128.66.0f e9 /r]                AVX,SANDYBRIDGE
+VPSUBUSB       xmmreg,xmmreg*,xmmrm128         [rvm:   vex.nds.128.66.0f d8 /r]                AVX,SANDYBRIDGE
+VPSUBUSW       xmmreg,xmmreg*,xmmrm128         [rvm:   vex.nds.128.66.0f d9 /r]                AVX,SANDYBRIDGE
+VPUNPCKHBW     xmmreg,xmmreg*,xmmrm128         [rvm:   vex.nds.128.66.0f 68 /r]                AVX,SANDYBRIDGE
+VPUNPCKHWD     xmmreg,xmmreg*,xmmrm128         [rvm:   vex.nds.128.66.0f 69 /r]                AVX,SANDYBRIDGE
+VPUNPCKHDQ     xmmreg,xmmreg*,xmmrm128         [rvm:   vex.nds.128.66.0f 6a /r]                AVX,SANDYBRIDGE
+VPUNPCKHQDQ    xmmreg,xmmreg*,xmmrm128         [rvm:   vex.nds.128.66.0f 6d /r]                AVX,SANDYBRIDGE
+VPUNPCKLBW     xmmreg,xmmreg*,xmmrm128         [rvm:   vex.nds.128.66.0f 60 /r]                AVX,SANDYBRIDGE
+VPUNPCKLWD     xmmreg,xmmreg*,xmmrm128         [rvm:   vex.nds.128.66.0f 61 /r]                AVX,SANDYBRIDGE
+VPUNPCKLDQ     xmmreg,xmmreg*,xmmrm128         [rvm:   vex.nds.128.66.0f 62 /r]                AVX,SANDYBRIDGE
+VPUNPCKLQDQ    xmmreg,xmmreg*,xmmrm128         [rvm:   vex.nds.128.66.0f 6c /r]                AVX,SANDYBRIDGE
+VPXOR          xmmreg,xmmreg*,xmmrm128         [rvm:   vex.nds.128.66.0f ef /r]                AVX,SANDYBRIDGE
+VRCPPS         xmmreg,xmmrm128                 [rm:    vex.128.0f 53 /r]                       AVX,SANDYBRIDGE
+VRCPPS         ymmreg,ymmrm256                 [rm:    vex.256.0f 53 /r]                       AVX,SANDYBRIDGE
+VRCPSS         xmmreg,xmmreg*,xmmrm32          [rvm:   vex.nds.128.f3.0f 53 /r]                AVX,SANDYBRIDGE
+VRSQRTPS       xmmreg,xmmrm128                 [rm:    vex.128.0f 52 /r]                       AVX,SANDYBRIDGE
+VRSQRTPS       ymmreg,ymmrm256                 [rm:    vex.256.0f 52 /r]                       AVX,SANDYBRIDGE
+VRSQRTSS       xmmreg,xmmreg*,xmmrm32          [rvm:   vex.nds.128.f3.0f 52 /r]                AVX,SANDYBRIDGE
+VROUNDPD       xmmreg,xmmrm128,imm8            [rmi:   vex.128.66.0f3a 09 /r ib]               AVX,SANDYBRIDGE
+VROUNDPD       ymmreg,ymmrm256,imm8            [rmi:   vex.256.66.0f3a 09 /r ib]               AVX,SANDYBRIDGE
+VROUNDPS       xmmreg,xmmrm128,imm8            [rmi:   vex.128.66.0f3a 08 /r ib]               AVX,SANDYBRIDGE
+VROUNDPS       ymmreg,ymmrm256,imm8            [rmi:   vex.256.66.0f3a 08 /r ib]               AVX,SANDYBRIDGE
+VROUNDSD       xmmreg,xmmreg*,xmmrm64,imm8     [rvmi:  vex.nds.128.66.0f3a 0b /r ib]           AVX,SANDYBRIDGE
+VROUNDSS       xmmreg,xmmreg*,xmmrm32,imm8     [rvmi:  vex.nds.128.66.0f3a 0a /r ib]           AVX,SANDYBRIDGE
+VSHUFPD                xmmreg,xmmreg*,xmmrm128,imm8    [rvmi:  vex.nds.128.66.0f c6 /r ib]             AVX,SANDYBRIDGE
+VSHUFPD                ymmreg,ymmreg*,ymmrm256,imm8    [rvmi:  vex.nds.256.66.0f c6 /r ib]             AVX,SANDYBRIDGE
+VSHUFPS                xmmreg,xmmreg*,xmmrm128,imm8    [rvmi:  vex.nds.128.0f c6 /r ib]                AVX,SANDYBRIDGE
+VSHUFPS                ymmreg,ymmreg*,ymmrm256,imm8    [rvmi:  vex.nds.256.0f c6 /r ib]                AVX,SANDYBRIDGE
+VSQRTPD                xmmreg,xmmrm128                 [rm:    vex.128.66.0f 51 /r]                    AVX,SANDYBRIDGE
+VSQRTPD                ymmreg,ymmrm256                 [rm:    vex.256.66.0f 51 /r]                    AVX,SANDYBRIDGE
+VSQRTPS                xmmreg,xmmrm128                 [rm:    vex.128.0f 51 /r]                       AVX,SANDYBRIDGE
+VSQRTPS                ymmreg,ymmrm256                 [rm:    vex.256.0f 51 /r]                       AVX,SANDYBRIDGE
+VSQRTSD                xmmreg,xmmreg*,xmmrm64          [rvm:   vex.nds.128.f2.0f 51 /r]                AVX,SANDYBRIDGE
+VSQRTSS                xmmreg,xmmreg*,xmmrm32          [rvm:   vex.nds.128.f3.0f 51 /r]                AVX,SANDYBRIDGE
+VSTMXCSR       mem32                           [m:     vex.128.0f ae /3]                       AVX,SANDYBRIDGE
+VSUBPD         xmmreg,xmmreg*,xmmrm128         [rvm:   vex.nds.128.66.0f 5c /r]                AVX,SANDYBRIDGE
+VSUBPD         ymmreg,ymmreg*,ymmrm256         [rvm:   vex.nds.256.66.0f 5c /r]                AVX,SANDYBRIDGE
+VSUBPS         xmmreg,xmmreg*,xmmrm128         [rvm:   vex.nds.128.0f 5c /r]                   AVX,SANDYBRIDGE
+VSUBPS         ymmreg,ymmreg*,ymmrm256         [rvm:   vex.nds.256.0f 5c /r]                   AVX,SANDYBRIDGE
+VSUBSD         xmmreg,xmmreg*,xmmrm64          [rvm:   vex.nds.128.f2.0f 5c /r]                AVX,SANDYBRIDGE
+VSUBSS         xmmreg,xmmreg*,xmmrm32          [rvm:   vex.nds.128.f3.0f 5c /r]                AVX,SANDYBRIDGE
+VTESTPS                xmmreg,xmmrm128                 [rm:    vex.128.66.0f38 0e /r]                  AVX,SANDYBRIDGE
+VTESTPS                ymmreg,ymmrm256                 [rm:    vex.256.66.0f38 0e /r]                  AVX,SANDYBRIDGE
+VTESTPD                xmmreg,xmmrm128                 [rm:    vex.128.66.0f38 0f /r]                  AVX,SANDYBRIDGE
+VTESTPD                ymmreg,ymmrm256                 [rm:    vex.256.66.0f38 0f /r]                  AVX,SANDYBRIDGE
+VUCOMISD       xmmreg,xmmrm64                  [rm:    vex.128.66.0f 2e /r]                    AVX,SANDYBRIDGE
+VUCOMISS       xmmreg,xmmrm32                  [rm:    vex.128.0f 2e /r]                       AVX,SANDYBRIDGE
+VUNPCKHPD      xmmreg,xmmreg*,xmmrm128         [rvm:   vex.nds.128.66.0f 15 /r]                AVX,SANDYBRIDGE
+VUNPCKHPD      ymmreg,ymmreg*,ymmrm256         [rvm:   vex.nds.256.66.0f 15 /r]                AVX,SANDYBRIDGE
+VUNPCKHPS      xmmreg,xmmreg*,xmmrm128         [rvm:   vex.nds.128.0f 15 /r]                   AVX,SANDYBRIDGE
+VUNPCKHPS      ymmreg,ymmreg*,ymmrm256         [rvm:   vex.nds.256.0f 15 /r]                   AVX,SANDYBRIDGE
+VUNPCKLPD      xmmreg,xmmreg*,xmmrm128         [rvm:   vex.nds.128.66.0f 14 /r]                AVX,SANDYBRIDGE
+VUNPCKLPD      ymmreg,ymmreg*,ymmrm256         [rvm:   vex.nds.256.66.0f 14 /r]                AVX,SANDYBRIDGE
+VUNPCKLPS      xmmreg,xmmreg*,xmmrm128         [rvm:   vex.nds.128.0f 14 /r]                   AVX,SANDYBRIDGE
+VUNPCKLPS      ymmreg,ymmreg*,ymmrm256         [rvm:   vex.nds.256.0f 14 /r]                   AVX,SANDYBRIDGE
+VXORPD         xmmreg,xmmreg*,xmmrm128         [rvm:   vex.nds.128.66.0f 57 /r]                AVX,SANDYBRIDGE
+VXORPD         ymmreg,ymmreg*,ymmrm256         [rvm:   vex.nds.256.66.0f 57 /r]                AVX,SANDYBRIDGE
+VXORPS         xmmreg,xmmreg*,xmmrm128         [rvm:   vex.nds.128.0f 57 /r]                   AVX,SANDYBRIDGE
+VXORPS         ymmreg,ymmreg*,ymmrm256         [rvm:   vex.nds.256.0f 57 /r]                   AVX,SANDYBRIDGE
+VZEROALL       void                            [       vex.256.0f 77]                          AVX,SANDYBRIDGE
+VZEROUPPER     void                            [       vex.128.0f 77]                          AVX,SANDYBRIDGE
+
+;# Intel Carry-Less Multiplication instructions (CLMUL)
+PCLMULLQLQDQ   xmmreg,xmmrm128                 [rm:    66 0f 3a 44 /r 00]                      SSE,WESTMERE
+PCLMULHQLQDQ   xmmreg,xmmrm128                 [rm:    66 0f 3a 44 /r 01]                      SSE,WESTMERE
+PCLMULLQHQDQ   xmmreg,xmmrm128                 [rm:    66 0f 3a 44 /r 10]                      SSE,WESTMERE
+PCLMULHQHQDQ   xmmreg,xmmrm128                 [rm:    66 0f 3a 44 /r 11]                      SSE,WESTMERE
+PCLMULQDQ      xmmreg,xmmrm128,imm8            [rmi:   66 0f 3a 44 /r ib]                      SSE,WESTMERE
+
+;# Intel AVX Carry-Less Multiplication instructions (CLMUL)
+VPCLMULLQLQDQ  xmmreg,xmmreg*,xmmrm128         [rvm:   vex.nds.128.66.0f3a 44 /r 00]           AVX,SANDYBRIDGE
+VPCLMULHQLQDQ  xmmreg,xmmreg*,xmmrm128         [rvm:   vex.nds.128.66.0f3a 44 /r 01]           AVX,SANDYBRIDGE
+VPCLMULLQHQDQ  xmmreg,xmmreg*,xmmrm128         [rvm:   vex.nds.128.66.0f3a 44 /r 10]           AVX,SANDYBRIDGE
+VPCLMULHQHQDQ  xmmreg,xmmreg*,xmmrm128         [rvm:   vex.nds.128.66.0f3a 44 /r 11]           AVX,SANDYBRIDGE
+VPCLMULQDQ     xmmreg,xmmreg*,xmmrm128,imm8    [rvmi:  vex.nds.128.66.0f3a 44 /r ib]           AVX,SANDYBRIDGE
+
+;# Intel Fused Multiply-Add instructions (FMA)
+VFMADD132PS    xmmreg,xmmreg,xmmrm128          [rvm:   vex.dds.128.66.0f38.w0 98 /r]           FMA,FUTURE
+VFMADD132PS    ymmreg,ymmreg,ymmrm256          [rvm:   vex.dds.256.66.0f38.w0 98 /r]           FMA,FUTURE
+VFMADD132PD    xmmreg,xmmreg,xmmrm128          [rvm:   vex.dds.128.66.0f38.w1 98 /r]           FMA,FUTURE
+VFMADD132PD    ymmreg,ymmreg,ymmrm256          [rvm:   vex.dds.256.66.0f38.w1 98 /r]           FMA,FUTURE
+VFMADD312PS    xmmreg,xmmreg,xmmrm128          [rvm:   vex.dds.128.66.0f38.w0 98 /r]           FMA,FUTURE
+VFMADD312PS    ymmreg,ymmreg,ymmrm256          [rvm:   vex.dds.256.66.0f38.w0 98 /r]           FMA,FUTURE
+VFMADD312PD    xmmreg,xmmreg,xmmrm128          [rvm:   vex.dds.128.66.0f38.w1 98 /r]           FMA,FUTURE
+VFMADD312PD    ymmreg,ymmreg,ymmrm256          [rvm:   vex.dds.256.66.0f38.w1 98 /r]           FMA,FUTURE
+VFMADD213PS    xmmreg,xmmreg,xmmrm128          [rvm:   vex.dds.128.66.0f38.w0 a8 /r]           FMA,FUTURE
+VFMADD213PS    ymmreg,ymmreg,ymmrm256          [rvm:   vex.dds.256.66.0f38.w0 a8 /r]           FMA,FUTURE
+VFMADD213PD    xmmreg,xmmreg,xmmrm128          [rvm:   vex.dds.128.66.0f38.w1 a8 /r]           FMA,FUTURE
+VFMADD213PD    ymmreg,ymmreg,ymmrm256          [rvm:   vex.dds.256.66.0f38.w1 a8 /r]           FMA,FUTURE
+VFMADD123PS    xmmreg,xmmreg,xmmrm128          [rvm:   vex.dds.128.66.0f38.w0 a8 /r]           FMA,FUTURE
+VFMADD123PS    ymmreg,ymmreg,ymmrm256          [rvm:   vex.dds.256.66.0f38.w0 a8 /r]           FMA,FUTURE
+VFMADD123PD    xmmreg,xmmreg,xmmrm128          [rvm:   vex.dds.128.66.0f38.w1 a8 /r]           FMA,FUTURE
+VFMADD123PD    ymmreg,ymmreg,ymmrm256          [rvm:   vex.dds.256.66.0f38.w1 a8 /r]           FMA,FUTURE
+VFMADD231PS    xmmreg,xmmreg,xmmrm128          [rvm:   vex.dds.128.66.0f38.w0 b8 /r]           FMA,FUTURE
+VFMADD231PS    ymmreg,ymmreg,ymmrm256          [rvm:   vex.dds.256.66.0f38.w0 b8 /r]           FMA,FUTURE
+VFMADD231PD    xmmreg,xmmreg,xmmrm128          [rvm:   vex.dds.128.66.0f38.w1 b8 /r]           FMA,FUTURE
+VFMADD231PD    ymmreg,ymmreg,ymmrm256          [rvm:   vex.dds.256.66.0f38.w1 b8 /r]           FMA,FUTURE
+VFMADD321PS    xmmreg,xmmreg,xmmrm128          [rvm:   vex.dds.128.66.0f38.w0 b8 /r]           FMA,FUTURE
+VFMADD321PS    ymmreg,ymmreg,ymmrm256          [rvm:   vex.dds.256.66.0f38.w0 b8 /r]           FMA,FUTURE
+VFMADD321PD    xmmreg,xmmreg,xmmrm128          [rvm:   vex.dds.128.66.0f38.w1 b8 /r]           FMA,FUTURE
+VFMADD321PD    ymmreg,ymmreg,ymmrm256          [rvm:   vex.dds.256.66.0f38.w1 b8 /r]           FMA,FUTURE
+VFMADDSUB132PS xmmreg,xmmreg,xmmrm128          [rvm:   vex.dds.128.66.0f38.w0 96 /r]           FMA,FUTURE
+VFMADDSUB132PS ymmreg,ymmreg,ymmrm256          [rvm:   vex.dds.256.66.0f38.w0 96 /r]           FMA,FUTURE
+VFMADDSUB132PD xmmreg,xmmreg,xmmrm128          [rvm:   vex.dds.128.66.0f38.w1 96 /r]           FMA,FUTURE
+VFMADDSUB132PD ymmreg,ymmreg,ymmrm256          [rvm:   vex.dds.256.66.0f38.w1 96 /r]           FMA,FUTURE
+VFMADDSUB312PS xmmreg,xmmreg,xmmrm128          [rvm:   vex.dds.128.66.0f38.w0 96 /r]           FMA,FUTURE
+VFMADDSUB312PS ymmreg,ymmreg,ymmrm256          [rvm:   vex.dds.256.66.0f38.w0 96 /r]           FMA,FUTURE
+VFMADDSUB312PD xmmreg,xmmreg,xmmrm128          [rvm:   vex.dds.128.66.0f38.w1 96 /r]           FMA,FUTURE
+VFMADDSUB312PD ymmreg,ymmreg,ymmrm256          [rvm:   vex.dds.256.66.0f38.w1 96 /r]           FMA,FUTURE
+VFMADDSUB213PS xmmreg,xmmreg,xmmrm128          [rvm:   vex.dds.128.66.0f38.w0 a6 /r]           FMA,FUTURE
+VFMADDSUB213PS ymmreg,ymmreg,ymmrm256          [rvm:   vex.dds.256.66.0f38.w0 a6 /r]           FMA,FUTURE
+VFMADDSUB213PD xmmreg,xmmreg,xmmrm128          [rvm:   vex.dds.128.66.0f38.w1 a6 /r]           FMA,FUTURE
+VFMADDSUB213PD ymmreg,ymmreg,ymmrm256          [rvm:   vex.dds.256.66.0f38.w1 a6 /r]           FMA,FUTURE
+VFMADDSUB123PS xmmreg,xmmreg,xmmrm128          [rvm:   vex.dds.128.66.0f38.w0 a6 /r]           FMA,FUTURE
+VFMADDSUB123PS ymmreg,ymmreg,ymmrm256          [rvm:   vex.dds.256.66.0f38.w0 a6 /r]           FMA,FUTURE
+VFMADDSUB123PD xmmreg,xmmreg,xmmrm128          [rvm:   vex.dds.128.66.0f38.w1 a6 /r]           FMA,FUTURE
+VFMADDSUB123PD ymmreg,ymmreg,ymmrm256          [rvm:   vex.dds.256.66.0f38.w1 a6 /r]           FMA,FUTURE
+VFMADDSUB231PS xmmreg,xmmreg,xmmrm128          [rvm:   vex.dds.128.66.0f38.w0 b6 /r]           FMA,FUTURE
+VFMADDSUB231PS ymmreg,ymmreg,ymmrm256          [rvm:   vex.dds.256.66.0f38.w0 b6 /r]           FMA,FUTURE
+VFMADDSUB231PD xmmreg,xmmreg,xmmrm128          [rvm:   vex.dds.128.66.0f38.w1 b6 /r]           FMA,FUTURE
+VFMADDSUB231PD ymmreg,ymmreg,ymmrm256          [rvm:   vex.dds.256.66.0f38.w1 b6 /r]           FMA,FUTURE
+VFMADDSUB321PS xmmreg,xmmreg,xmmrm128          [rvm:   vex.dds.128.66.0f38.w0 b6 /r]           FMA,FUTURE
+VFMADDSUB321PS ymmreg,ymmreg,ymmrm256          [rvm:   vex.dds.256.66.0f38.w0 b6 /r]           FMA,FUTURE
+VFMADDSUB321PD xmmreg,xmmreg,xmmrm128          [rvm:   vex.dds.128.66.0f38.w1 b6 /r]           FMA,FUTURE
+VFMADDSUB321PD ymmreg,ymmreg,ymmrm256          [rvm:   vex.dds.256.66.0f38.w1 b6 /r]           FMA,FUTURE
+VFMSUB132PS    xmmreg,xmmreg,xmmrm128          [rvm:   vex.dds.128.66.0f38.w0 9a /r]           FMA,FUTURE
+VFMSUB132PS    ymmreg,ymmreg,ymmrm256          [rvm:   vex.dds.256.66.0f38.w0 9a /r]           FMA,FUTURE
+VFMSUB132PD    xmmreg,xmmreg,xmmrm128          [rvm:   vex.dds.128.66.0f38.w1 9a /r]           FMA,FUTURE
+VFMSUB132PD    ymmreg,ymmreg,ymmrm256          [rvm:   vex.dds.256.66.0f38.w1 9a /r]           FMA,FUTURE
+VFMSUB312PS    xmmreg,xmmreg,xmmrm128          [rvm:   vex.dds.128.66.0f38.w0 9a /r]           FMA,FUTURE
+VFMSUB312PS    ymmreg,ymmreg,ymmrm256          [rvm:   vex.dds.256.66.0f38.w0 9a /r]           FMA,FUTURE
+VFMSUB312PD    xmmreg,xmmreg,xmmrm128          [rvm:   vex.dds.128.66.0f38.w1 9a /r]           FMA,FUTURE
+VFMSUB312PD    ymmreg,ymmreg,ymmrm256          [rvm:   vex.dds.256.66.0f38.w1 9a /r]           FMA,FUTURE
+VFMSUB213PS    xmmreg,xmmreg,xmmrm128          [rvm:   vex.dds.128.66.0f38.w0 aa /r]           FMA,FUTURE
+VFMSUB213PS    ymmreg,ymmreg,ymmrm256          [rvm:   vex.dds.256.66.0f38.w0 aa /r]           FMA,FUTURE
+VFMSUB213PD    xmmreg,xmmreg,xmmrm128          [rvm:   vex.dds.128.66.0f38.w1 aa /r]           FMA,FUTURE
+VFMSUB213PD    ymmreg,ymmreg,ymmrm256          [rvm:   vex.dds.256.66.0f38.w1 aa /r]           FMA,FUTURE
+VFMSUB123PS    xmmreg,xmmreg,xmmrm128          [rvm:   vex.dds.128.66.0f38.w0 aa /r]           FMA,FUTURE
+VFMSUB123PS    ymmreg,ymmreg,ymmrm256          [rvm:   vex.dds.256.66.0f38.w0 aa /r]           FMA,FUTURE
+VFMSUB123PD    xmmreg,xmmreg,xmmrm128          [rvm:   vex.dds.128.66.0f38.w1 aa /r]           FMA,FUTURE
+VFMSUB123PD    ymmreg,ymmreg,ymmrm256          [rvm:   vex.dds.256.66.0f38.w1 aa /r]           FMA,FUTURE
+VFMSUB231PS    xmmreg,xmmreg,xmmrm128          [rvm:   vex.dds.128.66.0f38.w0 ba /r]           FMA,FUTURE
+VFMSUB231PS    ymmreg,ymmreg,ymmrm256          [rvm:   vex.dds.256.66.0f38.w0 ba /r]           FMA,FUTURE
+VFMSUB231PD    xmmreg,xmmreg,xmmrm128          [rvm:   vex.dds.128.66.0f38.w1 ba /r]           FMA,FUTURE
+VFMSUB231PD    ymmreg,ymmreg,ymmrm256          [rvm:   vex.dds.256.66.0f38.w1 ba /r]           FMA,FUTURE
+VFMSUB321PS    xmmreg,xmmreg,xmmrm128          [rvm:   vex.dds.128.66.0f38.w0 ba /r]           FMA,FUTURE
+VFMSUB321PS    ymmreg,ymmreg,ymmrm256          [rvm:   vex.dds.256.66.0f38.w0 ba /r]           FMA,FUTURE
+VFMSUB321PD    xmmreg,xmmreg,xmmrm128          [rvm:   vex.dds.128.66.0f38.w1 ba /r]           FMA,FUTURE
+VFMSUB321PD    ymmreg,ymmreg,ymmrm256          [rvm:   vex.dds.256.66.0f38.w1 ba /r]           FMA,FUTURE
+VFMSUBADD132PS xmmreg,xmmreg,xmmrm128          [rvm:   vex.dds.128.66.0f38.w0 97 /r]           FMA,FUTURE
+VFMSUBADD132PS ymmreg,ymmreg,ymmrm256          [rvm:   vex.dds.256.66.0f38.w0 97 /r]           FMA,FUTURE
+VFMSUBADD132PD xmmreg,xmmreg,xmmrm128          [rvm:   vex.dds.128.66.0f38.w1 97 /r]           FMA,FUTURE
+VFMSUBADD132PD ymmreg,ymmreg,ymmrm256          [rvm:   vex.dds.256.66.0f38.w1 97 /r]           FMA,FUTURE
+VFMSUBADD312PS xmmreg,xmmreg,xmmrm128          [rvm:   vex.dds.128.66.0f38.w0 97 /r]           FMA,FUTURE
+VFMSUBADD312PS ymmreg,ymmreg,ymmrm256          [rvm:   vex.dds.256.66.0f38.w0 97 /r]           FMA,FUTURE
+VFMSUBADD312PD xmmreg,xmmreg,xmmrm128          [rvm:   vex.dds.128.66.0f38.w1 97 /r]           FMA,FUTURE
+VFMSUBADD312PD ymmreg,ymmreg,ymmrm256          [rvm:   vex.dds.256.66.0f38.w1 97 /r]           FMA,FUTURE
+VFMSUBADD213PS xmmreg,xmmreg,xmmrm128          [rvm:   vex.dds.128.66.0f38.w0 a7 /r]           FMA,FUTURE
+VFMSUBADD213PS ymmreg,ymmreg,ymmrm256          [rvm:   vex.dds.256.66.0f38.w0 a7 /r]           FMA,FUTURE
+VFMSUBADD213PD xmmreg,xmmreg,xmmrm128          [rvm:   vex.dds.128.66.0f38.w1 a7 /r]           FMA,FUTURE
+VFMSUBADD213PD ymmreg,ymmreg,ymmrm256          [rvm:   vex.dds.256.66.0f38.w1 a7 /r]           FMA,FUTURE
+VFMSUBADD123PS xmmreg,xmmreg,xmmrm128          [rvm:   vex.dds.128.66.0f38.w0 a7 /r]           FMA,FUTURE
+VFMSUBADD123PS ymmreg,ymmreg,ymmrm256          [rvm:   vex.dds.256.66.0f38.w0 a7 /r]           FMA,FUTURE
+VFMSUBADD123PD xmmreg,xmmreg,xmmrm128          [rvm:   vex.dds.128.66.0f38.w1 a7 /r]           FMA,FUTURE
+VFMSUBADD123PD ymmreg,ymmreg,ymmrm256          [rvm:   vex.dds.256.66.0f38.w1 a7 /r]           FMA,FUTURE
+VFMSUBADD231PS xmmreg,xmmreg,xmmrm128          [rvm:   vex.dds.128.66.0f38.w0 b7 /r]           FMA,FUTURE
+VFMSUBADD231PS ymmreg,ymmreg,ymmrm256          [rvm:   vex.dds.256.66.0f38.w0 b7 /r]           FMA,FUTURE
+VFMSUBADD231PD xmmreg,xmmreg,xmmrm128          [rvm:   vex.dds.128.66.0f38.w1 b7 /r]           FMA,FUTURE
+VFMSUBADD231PD ymmreg,ymmreg,ymmrm256          [rvm:   vex.dds.256.66.0f38.w1 b7 /r]           FMA,FUTURE
+VFMSUBADD321PS xmmreg,xmmreg,xmmrm128          [rvm:   vex.dds.128.66.0f38.w0 b7 /r]           FMA,FUTURE
+VFMSUBADD321PS ymmreg,ymmreg,ymmrm256          [rvm:   vex.dds.256.66.0f38.w0 b7 /r]           FMA,FUTURE
+VFMSUBADD321PD xmmreg,xmmreg,xmmrm128          [rvm:   vex.dds.128.66.0f38.w1 b7 /r]           FMA,FUTURE
+VFMSUBADD321PD ymmreg,ymmreg,ymmrm256          [rvm:   vex.dds.256.66.0f38.w1 b7 /r]           FMA,FUTURE
+VFNMADD132PS   xmmreg,xmmreg,xmmrm128          [rvm:   vex.dds.128.66.0f38.w0 9c /r]           FMA,FUTURE
+VFNMADD132PS   ymmreg,ymmreg,ymmrm256          [rvm:   vex.dds.256.66.0f38.w0 9c /r]           FMA,FUTURE
+VFNMADD132PD   xmmreg,xmmreg,xmmrm128          [rvm:   vex.dds.128.66.0f38.w1 9c /r]           FMA,FUTURE
+VFNMADD132PD   ymmreg,ymmreg,ymmrm256          [rvm:   vex.dds.256.66.0f38.w1 9c /r]           FMA,FUTURE
+VFNMADD312PS   xmmreg,xmmreg,xmmrm128          [rvm:   vex.dds.128.66.0f38.w0 9c /r]           FMA,FUTURE
+VFNMADD312PS   ymmreg,ymmreg,ymmrm256          [rvm:   vex.dds.256.66.0f38.w0 9c /r]           FMA,FUTURE
+VFNMADD312PD   xmmreg,xmmreg,xmmrm128          [rvm:   vex.dds.128.66.0f38.w1 9c /r]           FMA,FUTURE
+VFNMADD312PD   ymmreg,ymmreg,ymmrm256          [rvm:   vex.dds.256.66.0f38.w1 9c /r]           FMA,FUTURE
+VFNMADD213PS   xmmreg,xmmreg,xmmrm128          [rvm:   vex.dds.128.66.0f38.w0 ac /r]           FMA,FUTURE
+VFNMADD213PS   ymmreg,ymmreg,ymmrm256          [rvm:   vex.dds.256.66.0f38.w0 ac /r]           FMA,FUTURE
+VFNMADD213PD   xmmreg,xmmreg,xmmrm128          [rvm:   vex.dds.128.66.0f38.w1 ac /r]           FMA,FUTURE
+VFNMADD213PD   ymmreg,ymmreg,ymmrm256          [rvm:   vex.dds.256.66.0f38.w1 ac /r]           FMA,FUTURE
+VFNMADD123PS   xmmreg,xmmreg,xmmrm128          [rvm:   vex.dds.128.66.0f38.w0 ac /r]           FMA,FUTURE
+VFNMADD123PS   ymmreg,ymmreg,ymmrm256          [rvm:   vex.dds.256.66.0f38.w0 ac /r]           FMA,FUTURE
+VFNMADD123PD   xmmreg,xmmreg,xmmrm128          [rvm:   vex.dds.128.66.0f38.w1 ac /r]           FMA,FUTURE
+VFNMADD123PD   ymmreg,ymmreg,ymmrm256          [rvm:   vex.dds.256.66.0f38.w1 ac /r]           FMA,FUTURE
+VFNMADD231PS   xmmreg,xmmreg,xmmrm128          [rvm:   vex.dds.128.66.0f38.w0 bc /r]           FMA,FUTURE
+VFNMADD231PS   ymmreg,ymmreg,ymmrm256          [rvm:   vex.dds.256.66.0f38.w0 bc /r]           FMA,FUTURE
+VFNMADD231PD   xmmreg,xmmreg,xmmrm128          [rvm:   vex.dds.128.66.0f38.w1 bc /r]           FMA,FUTURE
+VFNMADD231PD   ymmreg,ymmreg,ymmrm256          [rvm:   vex.dds.256.66.0f38.w1 bc /r]           FMA,FUTURE
+VFNMADD321PS   xmmreg,xmmreg,xmmrm128          [rvm:   vex.dds.128.66.0f38.w0 bc /r]           FMA,FUTURE
+VFNMADD321PS   ymmreg,ymmreg,ymmrm256          [rvm:   vex.dds.256.66.0f38.w0 bc /r]           FMA,FUTURE
+VFNMADD321PD   xmmreg,xmmreg,xmmrm128          [rvm:   vex.dds.128.66.0f38.w1 bc /r]           FMA,FUTURE
+VFNMADD321PD   ymmreg,ymmreg,ymmrm256          [rvm:   vex.dds.256.66.0f38.w1 bc /r]           FMA,FUTURE
+VFNMSUB132PS   xmmreg,xmmreg,xmmrm128          [rvm:   vex.dds.128.66.0f38.w0 9e /r]           FMA,FUTURE
+VFNMSUB132PS   ymmreg,ymmreg,ymmrm256          [rvm:   vex.dds.256.66.0f38.w0 9e /r]           FMA,FUTURE
+VFNMSUB132PD   xmmreg,xmmreg,xmmrm128          [rvm:   vex.dds.128.66.0f38.w1 9e /r]           FMA,FUTURE
+VFNMSUB132PD   ymmreg,ymmreg,ymmrm256          [rvm:   vex.dds.256.66.0f38.w1 9e /r]           FMA,FUTURE
+VFNMSUB312PS   xmmreg,xmmreg,xmmrm128          [rvm:   vex.dds.128.66.0f38.w0 9e /r]           FMA,FUTURE
+VFNMSUB312PS   ymmreg,ymmreg,ymmrm256          [rvm:   vex.dds.256.66.0f38.w0 9e /r]           FMA,FUTURE
+VFNMSUB312PD   xmmreg,xmmreg,xmmrm128          [rvm:   vex.dds.128.66.0f38.w1 9e /r]           FMA,FUTURE
+VFNMSUB312PD   ymmreg,ymmreg,ymmrm256          [rvm:   vex.dds.256.66.0f38.w1 9e /r]           FMA,FUTURE
+VFNMSUB213PS   xmmreg,xmmreg,xmmrm128          [rvm:   vex.dds.128.66.0f38.w0 ae /r]           FMA,FUTURE
+VFNMSUB213PS   ymmreg,ymmreg,ymmrm256          [rvm:   vex.dds.256.66.0f38.w0 ae /r]           FMA,FUTURE
+VFNMSUB213PD   xmmreg,xmmreg,xmmrm128          [rvm:   vex.dds.128.66.0f38.w1 ae /r]           FMA,FUTURE
+VFNMSUB213PD   ymmreg,ymmreg,ymmrm256          [rvm:   vex.dds.256.66.0f38.w1 ae /r]           FMA,FUTURE
+VFNMSUB123PS   xmmreg,xmmreg,xmmrm128          [rvm:   vex.dds.128.66.0f38.w0 ae /r]           FMA,FUTURE
+VFNMSUB123PS   ymmreg,ymmreg,ymmrm256          [rvm:   vex.dds.256.66.0f38.w0 ae /r]           FMA,FUTURE
+VFNMSUB123PD   xmmreg,xmmreg,xmmrm128          [rvm:   vex.dds.128.66.0f38.w1 ae /r]           FMA,FUTURE
+VFNMSUB123PD   ymmreg,ymmreg,ymmrm256          [rvm:   vex.dds.256.66.0f38.w1 ae /r]           FMA,FUTURE
+VFNMSUB231PS   xmmreg,xmmreg,xmmrm128          [rvm:   vex.dds.128.66.0f38.w0 be /r]           FMA,FUTURE
+VFNMSUB231PS   ymmreg,ymmreg,ymmrm256          [rvm:   vex.dds.256.66.0f38.w0 be /r]           FMA,FUTURE
+VFNMSUB231PD   xmmreg,xmmreg,xmmrm128          [rvm:   vex.dds.128.66.0f38.w1 be /r]           FMA,FUTURE
+VFNMSUB231PD   ymmreg,ymmreg,ymmrm256          [rvm:   vex.dds.256.66.0f38.w1 be /r]           FMA,FUTURE
+VFNMSUB321PS   xmmreg,xmmreg,xmmrm128          [rvm:   vex.dds.128.66.0f38.w0 be /r]           FMA,FUTURE
+VFNMSUB321PS   ymmreg,ymmreg,ymmrm256          [rvm:   vex.dds.256.66.0f38.w0 be /r]           FMA,FUTURE
+VFNMSUB321PD   xmmreg,xmmreg,xmmrm128          [rvm:   vex.dds.128.66.0f38.w1 be /r]           FMA,FUTURE
+VFNMSUB321PD   ymmreg,ymmreg,ymmrm256          [rvm:   vex.dds.256.66.0f38.w1 be /r]           FMA,FUTURE
+VFMADD132SS    xmmreg,xmmreg,xmmrm32           [rvm:   vex.dds.128.66.0f38.w0 99 /r]           FMA,FUTURE
+VFMADD132SD    xmmreg,xmmreg,xmmrm64           [rvm:   vex.dds.128.66.0f38.w1 99 /r]           FMA,FUTURE
+VFMADD312SS    xmmreg,xmmreg,xmmrm32           [rvm:   vex.dds.128.66.0f38.w0 99 /r]           FMA,FUTURE
+VFMADD312SD    xmmreg,xmmreg,xmmrm64           [rvm:   vex.dds.128.66.0f38.w1 99 /r]           FMA,FUTURE
+VFMADD213SS    xmmreg,xmmreg,xmmrm32           [rvm:   vex.dds.128.66.0f38.w0 a9 /r]           FMA,FUTURE
+VFMADD213SD    xmmreg,xmmreg,xmmrm64           [rvm:   vex.dds.128.66.0f38.w1 a9 /r]           FMA,FUTURE
+VFMADD123SS    xmmreg,xmmreg,xmmrm32           [rvm:   vex.dds.128.66.0f38.w0 a9 /r]           FMA,FUTURE
+VFMADD123SD    xmmreg,xmmreg,xmmrm64           [rvm:   vex.dds.128.66.0f38.w1 a9 /r]           FMA,FUTURE
+VFMADD231SS    xmmreg,xmmreg,xmmrm32           [rvm:   vex.dds.128.66.0f38.w0 b9 /r]           FMA,FUTURE
+VFMADD231SD    xmmreg,xmmreg,xmmrm64           [rvm:   vex.dds.128.66.0f38.w1 b9 /r]           FMA,FUTURE
+VFMADD321SS    xmmreg,xmmreg,xmmrm32           [rvm:   vex.dds.128.66.0f38.w0 b9 /r]           FMA,FUTURE
+VFMADD321SD    xmmreg,xmmreg,xmmrm64           [rvm:   vex.dds.128.66.0f38.w1 b9 /r]           FMA,FUTURE
+VFMSUB132SS    xmmreg,xmmreg,xmmrm32           [rvm:   vex.dds.128.66.0f38.w0 9b /r]           FMA,FUTURE
+VFMSUB132SD    xmmreg,xmmreg,xmmrm64           [rvm:   vex.dds.128.66.0f38.w1 9b /r]           FMA,FUTURE
+VFMSUB312SS    xmmreg,xmmreg,xmmrm32           [rvm:   vex.dds.128.66.0f38.w0 9b /r]           FMA,FUTURE
+VFMSUB312SD    xmmreg,xmmreg,xmmrm64           [rvm:   vex.dds.128.66.0f38.w1 9b /r]           FMA,FUTURE
+VFMSUB213SS    xmmreg,xmmreg,xmmrm32           [rvm:   vex.dds.128.66.0f38.w0 ab /r]           FMA,FUTURE
+VFMSUB213SD    xmmreg,xmmreg,xmmrm64           [rvm:   vex.dds.128.66.0f38.w1 ab /r]           FMA,FUTURE
+VFMSUB123SS    xmmreg,xmmreg,xmmrm32           [rvm:   vex.dds.128.66.0f38.w0 ab /r]           FMA,FUTURE
+VFMSUB123SD    xmmreg,xmmreg,xmmrm64           [rvm:   vex.dds.128.66.0f38.w1 ab /r]           FMA,FUTURE
+VFMSUB231SS    xmmreg,xmmreg,xmmrm32           [rvm:   vex.dds.128.66.0f38.w0 bb /r]           FMA,FUTURE
+VFMSUB231SD    xmmreg,xmmreg,xmmrm64           [rvm:   vex.dds.128.66.0f38.w1 bb /r]           FMA,FUTURE
+VFMSUB321SS    xmmreg,xmmreg,xmmrm32           [rvm:   vex.dds.128.66.0f38.w0 bb /r]           FMA,FUTURE
+VFMSUB321SD    xmmreg,xmmreg,xmmrm64           [rvm:   vex.dds.128.66.0f38.w1 bb /r]           FMA,FUTURE
+VFNMADD132SS   xmmreg,xmmreg,xmmrm32           [rvm:   vex.dds.128.66.0f38.w0 9d /r]           FMA,FUTURE
+VFNMADD132SD   xmmreg,xmmreg,xmmrm64           [rvm:   vex.dds.128.66.0f38.w1 9d /r]           FMA,FUTURE
+VFNMADD312SS   xmmreg,xmmreg,xmmrm32           [rvm:   vex.dds.128.66.0f38.w0 9d /r]           FMA,FUTURE
+VFNMADD312SD   xmmreg,xmmreg,xmmrm64           [rvm:   vex.dds.128.66.0f38.w1 9d /r]           FMA,FUTURE
+VFNMADD213SS   xmmreg,xmmreg,xmmrm32           [rvm:   vex.dds.128.66.0f38.w0 ad /r]           FMA,FUTURE
+VFNMADD213SD   xmmreg,xmmreg,xmmrm64           [rvm:   vex.dds.128.66.0f38.w1 ad /r]           FMA,FUTURE
+VFNMADD123SS   xmmreg,xmmreg,xmmrm32           [rvm:   vex.dds.128.66.0f38.w0 ad /r]           FMA,FUTURE
+VFNMADD123SD   xmmreg,xmmreg,xmmrm64           [rvm:   vex.dds.128.66.0f38.w1 ad /r]           FMA,FUTURE
+VFNMADD231SS   xmmreg,xmmreg,xmmrm32           [rvm:   vex.dds.128.66.0f38.w0 bd /r]           FMA,FUTURE
+VFNMADD231SD   xmmreg,xmmreg,xmmrm64           [rvm:   vex.dds.128.66.0f38.w1 bd /r]           FMA,FUTURE
+VFNMADD321SS   xmmreg,xmmreg,xmmrm32           [rvm:   vex.dds.128.66.0f38.w0 bd /r]           FMA,FUTURE
+VFNMADD321SD   xmmreg,xmmreg,xmmrm64           [rvm:   vex.dds.128.66.0f38.w1 bd /r]           FMA,FUTURE
+VFNMSUB132SS   xmmreg,xmmreg,xmmrm32           [rvm:   vex.dds.128.66.0f38.w0 9f /r]           FMA,FUTURE
+VFNMSUB132SD   xmmreg,xmmreg,xmmrm64           [rvm:   vex.dds.128.66.0f38.w1 9f /r]           FMA,FUTURE
+VFNMSUB312SS   xmmreg,xmmreg,xmmrm32           [rvm:   vex.dds.128.66.0f38.w0 9f /r]           FMA,FUTURE
+VFNMSUB312SD   xmmreg,xmmreg,xmmrm64           [rvm:   vex.dds.128.66.0f38.w1 9f /r]           FMA,FUTURE
+VFNMSUB213SS   xmmreg,xmmreg,xmmrm32           [rvm:   vex.dds.128.66.0f38.w0 af /r]           FMA,FUTURE
+VFNMSUB213SD   xmmreg,xmmreg,xmmrm64           [rvm:   vex.dds.128.66.0f38.w1 af /r]           FMA,FUTURE
+VFNMSUB123SS   xmmreg,xmmreg,xmmrm32           [rvm:   vex.dds.128.66.0f38.w0 af /r]           FMA,FUTURE
+VFNMSUB123SD   xmmreg,xmmreg,xmmrm64           [rvm:   vex.dds.128.66.0f38.w1 af /r]           FMA,FUTURE
+VFNMSUB231SS   xmmreg,xmmreg,xmmrm32           [rvm:   vex.dds.128.66.0f38.w0 bf /r]           FMA,FUTURE
+VFNMSUB231SD   xmmreg,xmmreg,xmmrm64           [rvm:   vex.dds.128.66.0f38.w1 bf /r]           FMA,FUTURE
+VFNMSUB321SS   xmmreg,xmmreg,xmmrm32           [rvm:   vex.dds.128.66.0f38.w0 bf /r]           FMA,FUTURE
+VFNMSUB321SD   xmmreg,xmmreg,xmmrm64           [rvm:   vex.dds.128.66.0f38.w1 bf /r]           FMA,FUTURE
+
+;# VIA (Centaur) security instructions
+XSTORE         void                            \3\x0F\xA7\xC0                                  PENT,CYRIX
+XCRYPTECB      void                            \336\3\x0F\xA7\xC8                              PENT,CYRIX
+XCRYPTCBC      void                            \336\3\x0F\xA7\xD0                              PENT,CYRIX
+XCRYPTCTR      void                            \336\3\x0F\xA7\xD8                              PENT,CYRIX
+XCRYPTCFB      void                            \336\3\x0F\xA7\xE0                              PENT,CYRIX
+XCRYPTOFB      void                            \336\3\x0F\xA7\xE8                              PENT,CYRIX
+MONTMUL                void                            \336\3\x0F\xA6\xC0                              PENT,CYRIX
+XSHA1          void                            \336\3\x0F\xA6\xC8                              PENT,CYRIX
+XSHA256                void                            \336\3\x0F\xA6\xD0                              PENT,CYRIX
+
+;# AMD Lightweight Profiling (LWP) instructions
+;
+; based on pub number 43724 revision 3.04 date August 2009
+;
+LLWPCB         reg16                           [m: xop.m9.w0.l0.p0 12 /0]                      AMD
+LLWPCB         reg32                           [m: xop.m9.w0.l1.p0 12 /0]                      AMD,386
+LLWPCB         reg64                           [m: xop.m9.w1.l0.p0 12 /0]                      AMD,X64
+
+SLWPCB         reg16                           [m: xop.m9.w0.l0.p0 12 /1]                      AMD
+SLWPCB         reg32                           [m: xop.m9.w0.l1.p0 12 /1]                      AMD,386
+SLWPCB         reg64                           [m: xop.m9.w1.l0.p0 12 /1]                      AMD,X64
+
+LWPVAL         reg16,rm32,imm16                [vmi: xop.m10.w0.ndd.l0.p0 12 /1 iw]            AMD,386
+LWPVAL         reg32,rm32,imm32                [vmi: xop.m10.w0.ndd.l1.p0 12 /1 id]            AMD,386
+LWPVAL         reg64,rm32,imm32                [vmi: xop.m10.w1.ndd.l0.p0 12 /1 id]            AMD,X64
+
+LWPINS         reg16,rm32,imm16                [vmi: xop.m10.w0.ndd.l0.p0 12 /0 iw]            AMD,386
+LWPINS         reg32,rm32,imm32                [vmi: xop.m10.w0.ndd.l1.p0 12 /0 id]            AMD,386
+LWPINS         reg64,rm32,imm32                [vmi: xop.m10.w1.ndd.l0.p0 12 /0 id]            AMD,X64
+
+;# AMD XOP, FMA4 and CVT16 instructions (SSE5)
+;
+; based on pub number 43479 revision 3.03 date May 2009
+;
+VCVTPH2PS      xmmreg,xmmrm64*,imm8            [rmi:   xop.m8.w0.l0 a0 /r ib]                  AMD,SSE5
+VCVTPH2PS      ymmreg,xmmrm128,imm8            [rmi:   xop.m8.w0.l1 a0 /r ib]                  AMD,SSE5
+VCVTPH2PS      ymmreg,ymmrm128*,imm8           [rmi:   xop.m8.w0.l1 a0 /r ib]                  AMD,SSE5
+
+VCVTPS2PH      xmmrm64,xmmreg*,imm8            [mri:   xop.m8.w0.l0 a1 /r ib]                  AMD,SSE5
+VCVTPS2PH      xmmrm128,ymmreg,imm8            [mri:   xop.m8.w0.l1 a1 /r ib]                  AMD,SSE5
+VCVTPS2PH      ymmrm128,ymmreg*,imm8           [mri:   xop.m8.w0.l1 a1 /r ib]                  AMD,SSE5
+
+VFMADDPD       xmmreg,xmmreg*,xmmrm128,xmmreg  [rvms:  vex.m3.w0.nds.l0.p1 69 /r /is4]         AMD,SSE5
+VFMADDPD       ymmreg,ymmreg*,ymmrm256,ymmreg  [rvms:  vex.m3.w0.nds.l1.p1 69 /r /is4]         AMD,SSE5
+VFMADDPD       xmmreg,xmmreg*,xmmreg,xmmrm128  [rvsm:  vex.m3.w1.nds.l0.p1 69 /r /is4]         AMD,SSE5
+VFMADDPD       ymmreg,ymmreg*,ymmreg,ymmrm256  [rvsm:  vex.m3.w1.nds.l1.p1 69 /r /is4]         AMD,SSE5
+
+VFMADDPS       xmmreg,xmmreg*,xmmrm128,xmmreg  [rvms:  vex.m3.w0.nds.l0.p1 68 /r /is4]         AMD,SSE5
+VFMADDPS       ymmreg,ymmreg*,ymmrm256,ymmreg  [rvms:  vex.m3.w0.nds.l1.p1 68 /r /is4]         AMD,SSE5
+VFMADDPS       xmmreg,xmmreg*,xmmreg,xmmrm128  [rvsm:  vex.m3.w1.nds.l0.p1 68 /r /is4]         AMD,SSE5
+VFMADDPS       ymmreg,ymmreg*,ymmreg,ymmrm256  [rvsm:  vex.m3.w1.nds.l1.p1 68 /r /is4]         AMD,SSE5
+
+VFMADDSD       xmmreg,xmmreg*,xmmrm64,xmmreg   [rvms:  vex.m3.w0.nds.l0.p1 6b /r /is4]         AMD,SSE5
+VFMADDSD       xmmreg,xmmreg*,xmmreg,xmmrm64   [rvsm:  vex.m3.w1.nds.l0.p1 6b /r /is4]         AMD,SSE5
+
+VFMADDSS       xmmreg,xmmreg*,xmmrm32,xmmreg   [rvms:  vex.m3.w0.nds.l0.p1 6a /r /is4]         AMD,SSE5
+VFMADDSS       xmmreg,xmmreg*,xmmreg,xmmrm32   [rvsm:  vex.m3.w1.nds.l0.p1 6a /r /is4]         AMD,SSE5
+
+VFMADDSUBPD    xmmreg,xmmreg*,xmmrm128,xmmreg  [rvms:  vex.m3.w0.nds.l0.p1 5d /r /is4]         AMD,SSE5
+VFMADDSUBPD    ymmreg,ymmreg*,ymmrm256,ymmreg  [rvms:  vex.m3.w0.nds.l1.p1 5d /r /is4]         AMD,SSE5
+VFMADDSUBPD    xmmreg,xmmreg*,xmmreg,xmmrm128  [rvsm:  vex.m3.w1.nds.l0.p1 5d /r /is4]         AMD,SSE5
+VFMADDSUBPD    ymmreg,ymmreg*,ymmreg,ymmrm256  [rvsm:  vex.m3.w1.nds.l1.p1 5d /r /is4]         AMD,SSE5
+
+VFMADDSUBPS    xmmreg,xmmreg*,xmmrm128,xmmreg  [rvms:  vex.m3.w0.nds.l0.p1 5c /r /is4]         AMD,SSE5
+VFMADDSUBPS    ymmreg,ymmreg*,ymmrm256,ymmreg  [rvms:  vex.m3.w0.nds.l1.p1 5c /r /is4]         AMD,SSE5
+VFMADDSUBPS    xmmreg,xmmreg*,xmmreg,xmmrm128  [rvsm:  vex.m3.w1.nds.l0.p1 5c /r /is4]         AMD,SSE5
+VFMADDSUBPS    ymmreg,ymmreg*,ymmreg,ymmrm256  [rvsm:  vex.m3.w1.nds.l1.p1 5c /r /is4]         AMD,SSE5
+
+VFMSUBADDPD    xmmreg,xmmreg*,xmmrm128,xmmreg  [rvms:  vex.m3.w0.nds.l0.p1 5f /r /is4]         AMD,SSE5
+VFMSUBADDPD    ymmreg,ymmreg*,ymmrm256,ymmreg  [rvms:  vex.m3.w0.nds.l1.p1 5f /r /is4]         AMD,SSE5
+VFMSUBADDPD    xmmreg,xmmreg*,xmmreg,xmmrm128  [rvsm:  vex.m3.w1.nds.l0.p1 5f /r /is4]         AMD,SSE5
+VFMSUBADDPD    ymmreg,ymmreg*,ymmreg,ymmrm256  [rvsm:  vex.m3.w1.nds.l1.p1 5f /r /is4]         AMD,SSE5
+
+VFMSUBADDPS    xmmreg,xmmreg*,xmmrm128,xmmreg  [rvms:  vex.m3.w0.nds.l0.p1 5e /r /is4]         AMD,SSE5
+VFMSUBADDPS    ymmreg,ymmreg*,ymmrm256,ymmreg  [rvms:  vex.m3.w0.nds.l1.p1 5e /r /is4]         AMD,SSE5
+VFMSUBADDPS    xmmreg,xmmreg*,xmmreg,xmmrm128  [rvsm:  vex.m3.w1.nds.l0.p1 5e /r /is4]         AMD,SSE5
+VFMSUBADDPS    ymmreg,ymmreg*,ymmreg,ymmrm256  [rvsm:  vex.m3.w1.nds.l1.p1 5e /r /is4]         AMD,SSE5
+
+VFMSUBPD       xmmreg,xmmreg*,xmmrm128,xmmreg  [rvms:  vex.m3.w0.nds.l0.p1 6d /r /is4]         AMD,SSE5
+VFMSUBPD       ymmreg,ymmreg*,ymmrm256,ymmreg  [rvms:  vex.m3.w0.nds.l1.p1 6d /r /is4]         AMD,SSE5
+VFMSUBPD       xmmreg,xmmreg*,xmmreg,xmmrm128  [rvsm:  vex.m3.w1.nds.l0.p1 6d /r /is4]         AMD,SSE5
+VFMSUBPD       ymmreg,ymmreg*,ymmreg,ymmrm256  [rvsm:  vex.m3.w1.nds.l1.p1 6d /r /is4]         AMD,SSE5
+
+VFMSUBPS       xmmreg,xmmreg*,xmmrm128,xmmreg  [rvms:  vex.m3.w0.nds.l0.p1 6c /r /is4]         AMD,SSE5
+VFMSUBPS       ymmreg,ymmreg*,ymmrm256,ymmreg  [rvms:  vex.m3.w0.nds.l1.p1 6c /r /is4]         AMD,SSE5
+VFMSUBPS       xmmreg,xmmreg*,xmmreg,xmmrm128  [rvsm:  vex.m3.w1.nds.l0.p1 6c /r /is4]         AMD,SSE5
+VFMSUBPS       ymmreg,ymmreg*,ymmreg,ymmrm256  [rvsm:  vex.m3.w1.nds.l1.p1 6c /r /is4]         AMD,SSE5
+
+VFMSUBSD       xmmreg,xmmreg*,xmmrm64,xmmreg   [rvms:  vex.m3.w0.nds.l0.p1 6f /r /is4]         AMD,SSE5
+VFMSUBSD       xmmreg,xmmreg*,xmmreg,xmmrm64   [rvsm:  vex.m3.w1.nds.l0.p1 6f /r /is4]         AMD,SSE5
+
+VFMSUBSS       xmmreg,xmmreg*,xmmrm32,xmmreg   [rvms:  vex.m3.w0.nds.l0.p1 6e /r /is4]         AMD,SSE5
+VFMSUBSS       xmmreg,xmmreg*,xmmreg,xmmrm32   [rvsm:  vex.m3.w1.nds.l0.p1 6e /r /is4]         AMD,SSE5
+
+VFNMADDPD      xmmreg,xmmreg*,xmmrm128,xmmreg  [rvms:  vex.m3.w0.nds.l0.p1 79 /r /is4]         AMD,SSE5
+VFNMADDPD      ymmreg,ymmreg*,ymmrm256,ymmreg  [rvms:  vex.m3.w0.nds.l1.p1 79 /r /is4]         AMD,SSE5
+VFNMADDPD      xmmreg,xmmreg*,xmmreg,xmmrm128  [rvsm:  vex.m3.w1.nds.l0.p1 79 /r /is4]         AMD,SSE5
+VFNMADDPD      ymmreg,ymmreg*,ymmreg,ymmrm256  [rvsm:  vex.m3.w1.nds.l1.p1 79 /r /is4]         AMD,SSE5
+
+VFNMADDPS      xmmreg,xmmreg*,xmmrm128,xmmreg  [rvms:  vex.m3.w0.nds.l0.p1 78 /r /is4]         AMD,SSE5
+VFNMADDPS      ymmreg,ymmreg*,ymmrm256,ymmreg  [rvms:  vex.m3.w0.nds.l1.p1 78 /r /is4]         AMD,SSE5
+VFNMADDPS      xmmreg,xmmreg*,xmmreg,xmmrm128  [rvsm:  vex.m3.w1.nds.l0.p1 78 /r /is4]         AMD,SSE5
+VFNMADDPS      ymmreg,ymmreg*,ymmreg,ymmrm256  [rvsm:  vex.m3.w1.nds.l1.p1 78 /r /is4]         AMD,SSE5
+
+VFNMADDSD      xmmreg,xmmreg*,xmmrm64,xmmreg   [rvms:  vex.m3.w0.nds.l0.p1 7b /r /is4]         AMD,SSE5
+VFNMADDSD      xmmreg,xmmreg*,xmmreg,xmmrm64   [rvsm:  vex.m3.w1.nds.l0.p1 7b /r /is4]         AMD,SSE5
+
+VFNMADDSS      xmmreg,xmmreg*,xmmrm32,xmmreg   [rvms:  vex.m3.w0.nds.l0.p1 7a /r /is4]         AMD,SSE5
+VFNMADDSS      xmmreg,xmmreg*,xmmreg,xmmrm32   [rvsm:  vex.m3.w1.nds.l0.p1 7a /r /is4]         AMD,SSE5
+
+VFNMSUBPD      xmmreg,xmmreg*,xmmrm128,xmmreg  [rvms:  vex.m3.w0.nds.l0.p1 7d /r /is4]         AMD,SSE5
+VFNMSUBPD      ymmreg,ymmreg*,ymmrm256,ymmreg  [rvms:  vex.m3.w0.nds.l1.p1 7d /r /is4]         AMD,SSE5
+VFNMSUBPD      xmmreg,xmmreg*,xmmreg,xmmrm128  [rvsm:  vex.m3.w1.nds.l0.p1 7d /r /is4]         AMD,SSE5
+VFNMSUBPD      ymmreg,ymmreg*,ymmreg,ymmrm256  [rvsm:  vex.m3.w1.nds.l1.p1 7d /r /is4]         AMD,SSE5
+
+VFNMSUBPS      xmmreg,xmmreg*,xmmrm128,xmmreg  [rvms:  vex.m3.w0.nds.l0.p1 7c /r /is4]         AMD,SSE5
+VFNMSUBPS      ymmreg,ymmreg*,ymmrm256,ymmreg  [rvms:  vex.m3.w0.nds.l1.p1 7c /r /is4]         AMD,SSE5
+VFNMSUBPS      xmmreg,xmmreg*,xmmreg,xmmrm128  [rvsm:  vex.m3.w1.nds.l0.p1 7c /r /is4]         AMD,SSE5
+VFNMSUBPS      ymmreg,ymmreg*,ymmreg,ymmrm256  [rvsm:  vex.m3.w1.nds.l1.p1 7c /r /is4]         AMD,SSE5
+
+VFNMSUBSD      xmmreg,xmmreg*,xmmrm64,xmmreg   [rvms:  vex.m3.w0.nds.l0.p1 7f /r /is4]         AMD,SSE5
+VFNMSUBSD      xmmreg,xmmreg*,xmmreg,xmmrm64   [rvsm:  vex.m3.w1.nds.l0.p1 7f /r /is4]         AMD,SSE5
+
+VFNMSUBSS      xmmreg,xmmreg*,xmmrm32,xmmreg   [rvms:  vex.m3.w0.nds.l0.p1 7e /r /is4]         AMD,SSE5
+VFNMSUBSS      xmmreg,xmmreg*,xmmreg,xmmrm32   [rvsm:  vex.m3.w1.nds.l0.p1 7e /r /is4]         AMD,SSE5
+
+VFRCZPD                xmmreg,xmmrm128*                [rm:    xop.m9.w0.l0.p0 81 /r]                  AMD,SSE5
+VFRCZPD                ymmreg,ymmrm256*                [rm:    xop.m9.w0.l1.p0 81 /r]                  AMD,SSE5
+
+VFRCZPS                xmmreg,xmmrm128*                [rm:    xop.m9.w0.l0.p0 80 /r]                  AMD,SSE5
+VFRCZPS                ymmreg,ymmrm256*                [rm:    xop.m9.w0.l1.p0 80 /r]                  AMD,SSE5
+
+VFRCZSD                xmmreg,xmmrm64*                 [rm:    xop.m9.w0.l0.p0 83 /r]                  AMD,SSE5
+
+VFRCZSS                xmmreg,xmmrm32*                 [rm:    xop.m9.w0.l0.p0 82 /r]                  AMD,SSE5
+;
+; fixed: spec mention imm[7:4] though it should be /is4 even in spec
+VPCMOV         xmmreg,xmmreg*,xmmrm128,xmmreg  [rvms:  xop.m8.w0.nds.l0.p0 a2 /r /is4]         AMD,SSE5
+VPCMOV         ymmreg,ymmreg*,ymmrm256,ymmreg  [rvms:  xop.m8.w0.nds.l1.p0 a2 /r /is4]         AMD,SSE5
+VPCMOV         xmmreg,xmmreg*,xmmreg,xmmrm128  [rvsm:  xop.m8.w1.nds.l0.p0 a2 /r /is4]         AMD,SSE5
+VPCMOV         ymmreg,ymmreg*,ymmreg,ymmrm256  [rvsm:  xop.m8.w1.nds.l1.p0 a2 /r /is4]         AMD,SSE5
+
+VPCOMB         xmmreg,xmmreg*,xmmrm128,imm8    [rvmi:  xop.m8.w0.nds.l0.p0 cc /r ib]           AMD,SSE5
+VPCOMD         xmmreg,xmmreg*,xmmrm128,imm8    [rvmi:  xop.m8.w0.nds.l0.p0 ce /r ib]           AMD,SSE5
+VPCOMQ         xmmreg,xmmreg*,xmmrm128,imm8    [rvmi:  xop.m8.w0.nds.l0.p0 cf /r ib]           AMD,SSE5
+;
+; fixed: spec mention only 3 operands in mnemonics
+VPCOMUB                xmmreg,xmmreg*,xmmrm128,imm8    [rvmi:  xop.m8.w0.nds.l0.p0 ec /r ib]           AMD,SSE5
+VPCOMUD                xmmreg,xmmreg*,xmmrm128,imm8    [rvmi:  xop.m8.w0.nds.l0.p0 ee /r ib]           AMD,SSE5
+VPCOMUQ                xmmreg,xmmreg*,xmmrm128,imm8    [rvmi:  xop.m8.w0.nds.l0.p0 ef /r ib]           AMD,SSE5
+;
+; fixed: spec point wrong VPCOMB in mnemonic
+VPCOMUW                xmmreg,xmmreg*,xmmrm128,imm8    [rvmi:  xop.m8.w0.nds.l0.p0 ed /r ib]           AMD,SSE5
+VPCOMW         xmmreg,xmmreg*,xmmrm128,imm8    [rvmi:  xop.m8.w0.nds.l0.p0 cd /r ib]           AMD,SSE5
+
+VPHADDBD       xmmreg,xmmrm128*                [rm:    xop.m9.w0.l0.p0 c2 /r]                  AMD,SSE5
+VPHADDBQ       xmmreg,xmmrm128*                [rm:    xop.m9.w0.l0.p0 c3 /r]                  AMD,SSE5
+VPHADDBW       xmmreg,xmmrm128*                [rm:    xop.m9.w0.l0.p0 c1 /r]                  AMD,SSE5
+VPHADDDQ       xmmreg,xmmrm128*                [rm:    xop.m9.w0.l0.p0 cb /r]                  AMD,SSE5
+;
+; fixed: spec has ymmreg for l0
+VPHADDUBD      xmmreg,xmmrm128*                [rm:    xop.m9.w0.l0.p0 d2 /r]                  AMD,SSE5
+VPHADDUBQ      xmmreg,xmmrm128*                [rm:    xop.m9.w0.l0.p0 d3 /r]                  AMD,SSE5
+;
+; fixed: spec has VPHADDUBWD
+VPHADDUBW      xmmreg,xmmrm128*                [rm:    xop.m9.w0.l0.p0 d1 /r]                  AMD,SSE5
+;
+; fixed: opcode db
+VPHADDUDQ      xmmreg,xmmrm128*                [rm:    xop.m9.w0.l0.p0 db /r]                  AMD,SSE5
+VPHADDUWD      xmmreg,xmmrm128*                [rm:    xop.m9.w0.l0.p0 d6 /r]                  AMD,SSE5
+VPHADDUWQ      xmmreg,xmmrm128*                [rm:    xop.m9.w0.l0.p0 d7 /r]                  AMD,SSE5
+;
+; fixed: spec has ymmreg for l0
+VPHADDWD       xmmreg,xmmrm128*                [rm:    xop.m9.w0.l0.p0 c6 /r]                  AMD,SSE5
+;
+; fixed: spec has d7 opcode
+VPHADDWQ       xmmreg,xmmrm128*                [rm:    xop.m9.w0.l0.p0 c7 /r]                  AMD,SSE5
+
+VPHSUBBW       xmmreg,xmmrm128*                [rm:    xop.m9.w0.l0.p0 e1 /r]                  AMD,SSE5
+VPHSUBDQ       xmmreg,xmmrm128*                [rm:    xop.m9.w0.l0.p0 e3 /r]                  AMD,SSE5
+VPHSUBWD       xmmreg,xmmrm128*                [rm:    xop.m9.w0.l0.p0 e2 /r]                  AMD,SSE5
+
+VPMACSDD       xmmreg,xmmreg*,xmmrm128,xmmreg  [rvms:  xop.m8.w0.nds.l0.p0 9e /r /is4]         AMD,SSE5
+;
+; fixed: spec has 97,9f opcodes here
+VPMACSDQH      xmmreg,xmmreg*,xmmrm128,xmmreg  [rvms:  xop.m8.w0.nds.l0.p0 9f /r /is4]         AMD,SSE5
+VPMACSDQL      xmmreg,xmmreg*,xmmrm128,xmmreg  [rvms:  xop.m8.w0.nds.l0.p0 97 /r /is4]         AMD,SSE5
+VPMACSSDD      xmmreg,xmmreg*,xmmrm128,xmmreg  [rvms:  xop.m8.w0.nds.l0.p0 8e /r /is4]         AMD,SSE5
+VPMACSSDQH     xmmreg,xmmreg*,xmmrm128,xmmreg  [rvms:  xop.m8.w0.nds.l0.p0 8f /r /is4]         AMD,SSE5
+VPMACSSDQL     xmmreg,xmmreg*,xmmrm128,xmmreg  [rvms:  xop.m8.w0.nds.l0.p0 87 /r /is4]         AMD,SSE5
+VPMACSSWD      xmmreg,xmmreg*,xmmrm128,xmmreg  [rvms:  xop.m8.w0.nds.l0.p0 86 /r /is4]         AMD,SSE5
+VPMACSSWW      xmmreg,xmmreg*,xmmrm128,xmmreg  [rvms:  xop.m8.w0.nds.l0.p0 85 /r /is4]         AMD,SSE5
+VPMACSWD       xmmreg,xmmreg*,xmmrm128,xmmreg  [rvms:  xop.m8.w0.nds.l0.p0 96 /r /is4]         AMD,SSE5
+VPMACSWW       xmmreg,xmmreg*,xmmrm128,xmmreg  [rvms:  xop.m8.w0.nds.l0.p0 95 /r /is4]         AMD,SSE5
+VPMADCSSWD     xmmreg,xmmreg*,xmmrm128,xmmreg  [rvms:  xop.m8.w0.nds.l0.p0 a6 /r /is4]         AMD,SSE5
+VPMADCSWD      xmmreg,xmmreg*,xmmrm128,xmmreg  [rvms:  xop.m8.w0.nds.l0.p0 b6 /r /is4]         AMD,SSE5
+
+VPPERM         xmmreg,xmmreg*,xmmreg,xmmrm128  [rvsm:  xop.m8.w1.nds.l0.p0 a3 /r /is4]         AMD,SSE5
+VPPERM         xmmreg,xmmreg*,xmmrm128,xmmreg  [rvms:  xop.m8.w0.nds.l0.p0 a3 /r /is4]         AMD,SSE5
+
+VPROTB         xmmreg,xmmrm128*,xmmreg         [rmv:   xop.m9.w0.nds.l0.p0 90 /r]              AMD,SSE5
+VPROTB         xmmreg,xmmreg*,xmmrm128         [rvm:   xop.m9.w1.nds.l0.p0 90 /r]              AMD,SSE5
+;
+; fixed: spec point xmmreg instead of reg/mem
+VPROTB         xmmreg,xmmrm128*,imm8           [rmi:   xop.m8.w0.l0.p0 c0 /r ib]               AMD,SSE5
+
+VPROTD         xmmreg,xmmrm128*,xmmreg         [rmv:   xop.m9.w0.nds.l0.p0 92 /r]              AMD,SSE5
+VPROTD         xmmreg,xmmreg*,xmmrm128         [rvm:   xop.m9.w1.nds.l0.p0 92 /r]              AMD,SSE5
+;
+; fixed: spec error /r is needed
+VPROTD         xmmreg,xmmrm128*,imm8           [rmi:   xop.m8.w0.l0.p0 c2 /r ib]               AMD,SSE5
+VPROTQ         xmmreg,xmmrm128*,xmmreg         [rmv:   xop.m9.w0.nds.l0.p0 93 /r]              AMD,SSE5
+VPROTQ         xmmreg,xmmreg*,xmmrm128         [rvm:   xop.m9.w1.nds.l0.p0 93 /r]              AMD,SSE5
+;
+; fixed: spec error /r is needed
+VPROTQ         xmmreg,xmmrm128*,imm8           [rmi:   xop.m8.w0.l0.p0 c3 /r ib]               AMD,SSE5
+VPROTW         xmmreg,xmmrm128*,xmmreg         [rmv:   xop.m9.w0.nds.l0.p0 91 /r]              AMD,SSE5
+VPROTW         xmmreg,xmmreg*,xmmrm128         [rvm:   xop.m9.w1.nds.l0.p0 91 /r]              AMD,SSE5
+VPROTW         xmmreg,xmmrm128*,imm8           [rmi:   xop.m8.w0.l0.p0 c1 /r ib]               AMD,SSE5
+
+VPSHAB         xmmreg,xmmrm128*,xmmreg         [rmv:   xop.m9.w0.nds.l0.p0 98 /r]              AMD,SSE5
+VPSHAB         xmmreg,xmmreg*,xmmrm128         [rvm:   xop.m9.w1.nds.l0.p0 98 /r]              AMD,SSE5
+
+VPSHAD         xmmreg,xmmrm128*,xmmreg         [rmv:   xop.m9.w0.nds.l0.p0 9a /r]              AMD,SSE5
+VPSHAD         xmmreg,xmmreg*,xmmrm128         [rvm:   xop.m9.w1.nds.l0.p0 9a /r]              AMD,SSE5
+
+VPSHAQ         xmmreg,xmmrm128*,xmmreg         [rmv:   xop.m9.w0.nds.l0.p0 9b /r]              AMD,SSE5
+VPSHAQ         xmmreg,xmmreg*,xmmrm128         [rvm:   xop.m9.w1.nds.l0.p0 9b /r]              AMD,SSE5
+
+VPSHAW         xmmreg,xmmrm128*,xmmreg         [rmv:   xop.m9.w0.nds.l0.p0 99 /r]              AMD,SSE5
+VPSHAW         xmmreg,xmmreg*,xmmrm128         [rvm:   xop.m9.w1.nds.l0.p0 99 /r]              AMD,SSE5
+
+VPSHLB         xmmreg,xmmrm128*,xmmreg         [rmv:   xop.m9.w0.nds.l0.p0 94 /r]              AMD,SSE5
+VPSHLB         xmmreg,xmmreg*,xmmrm128         [rvm:   xop.m9.w1.nds.l0.p0 94 /r]              AMD,SSE5
+
+;
+; fixed: spec has ymmreg for l0
+VPSHLD         xmmreg,xmmrm128*,xmmreg         [rmv:   xop.m9.w0.nds.l0.p0 96 /r]              AMD,SSE5
+VPSHLD         xmmreg,xmmreg*,xmmrm128         [rvm:   xop.m9.w1.nds.l0.p0 96 /r]              AMD,SSE5
+
+VPSHLQ         xmmreg,xmmrm128*,xmmreg         [rmv:   xop.m9.w0.nds.l0.p0 97 /r]              AMD,SSE5
+VPSHLQ         xmmreg,xmmreg*,xmmrm128         [rvm:   xop.m9.w1.nds.l0.p0 97 /r]              AMD,SSE5
+
+VPSHLW         xmmreg,xmmrm128*,xmmreg         [rmv:   xop.m9.w0.nds.l0.p0 95 /r]              AMD,SSE5
+VPSHLW         xmmreg,xmmreg*,xmmrm128         [rvm:   xop.m9.w1.nds.l0.p0 95 /r]              AMD,SSE5
+
+
+;# Systematic names for the hinting nop instructions
+; These should be last in the file
+HINT_NOP0      rm16                            \320\2\x0F\x18\200                              P6,UNDOC
+HINT_NOP0      rm32                            \321\2\x0F\x18\200                              P6,UNDOC
+HINT_NOP0      rm64                            \324\2\x0F\x18\200                              X64,UNDOC
+HINT_NOP1      rm16                            \320\2\x0F\x18\201                              P6,UNDOC
+HINT_NOP1      rm32                            \321\2\x0F\x18\201                              P6,UNDOC
+HINT_NOP1      rm64                            \324\2\x0F\x18\201                              X64,UNDOC
+HINT_NOP2      rm16                            \320\2\x0F\x18\202                              P6,UNDOC
+HINT_NOP2      rm32                            \321\2\x0F\x18\202                              P6,UNDOC
+HINT_NOP2      rm64                            \324\2\x0F\x18\202                              X64,UNDOC
+HINT_NOP3      rm16                            \320\2\x0F\x18\203                              P6,UNDOC
+HINT_NOP3      rm32                            \321\2\x0F\x18\203                              P6,UNDOC
+HINT_NOP3      rm64                            \324\2\x0F\x18\203                              X64,UNDOC
+HINT_NOP4      rm16                            \320\2\x0F\x18\204                              P6,UNDOC
+HINT_NOP4      rm32                            \321\2\x0F\x18\204                              P6,UNDOC
+HINT_NOP4      rm64                            \324\2\x0F\x18\204                              X64,UNDOC
+HINT_NOP5      rm16                            \320\2\x0F\x18\205                              P6,UNDOC
+HINT_NOP5      rm32                            \321\2\x0F\x18\205                              P6,UNDOC
+HINT_NOP5      rm64                            \324\2\x0F\x18\205                              X64,UNDOC
+HINT_NOP6      rm16                            \320\2\x0F\x18\206                              P6,UNDOC
+HINT_NOP6      rm32                            \321\2\x0F\x18\206                              P6,UNDOC
+HINT_NOP6      rm64                            \324\2\x0F\x18\206                              X64,UNDOC
+HINT_NOP7      rm16                            \320\2\x0F\x18\207                              P6,UNDOC
+HINT_NOP7      rm32                            \321\2\x0F\x18\207                              P6,UNDOC
+HINT_NOP7      rm64                            \324\2\x0F\x18\207                              X64,UNDOC
+HINT_NOP8      rm16                            \320\2\x0F\x19\200                              P6,UNDOC
+HINT_NOP8      rm32                            \321\2\x0F\x19\200                              P6,UNDOC
+HINT_NOP8      rm64                            \324\2\x0F\x19\200                              X64,UNDOC
+HINT_NOP9      rm16                            \320\2\x0F\x19\201                              P6,UNDOC
+HINT_NOP9      rm32                            \321\2\x0F\x19\201                              P6,UNDOC
+HINT_NOP9      rm64                            \324\2\x0F\x19\201                              X64,UNDOC
+HINT_NOP10     rm16                            \320\2\x0F\x19\202                              P6,UNDOC
+HINT_NOP10     rm32                            \321\2\x0F\x19\202                              P6,UNDOC
+HINT_NOP10     rm64                            \324\2\x0F\x19\202                              X64,UNDOC
+HINT_NOP11     rm16                            \320\2\x0F\x19\203                              P6,UNDOC
+HINT_NOP11     rm32                            \321\2\x0F\x19\203                              P6,UNDOC
+HINT_NOP11     rm64                            \324\2\x0F\x19\203                              X64,UNDOC
+HINT_NOP12     rm16                            \320\2\x0F\x19\204                              P6,UNDOC
+HINT_NOP12     rm32                            \321\2\x0F\x19\204                              P6,UNDOC
+HINT_NOP12     rm64                            \324\2\x0F\x19\204                              X64,UNDOC
+HINT_NOP13     rm16                            \320\2\x0F\x19\205                              P6,UNDOC
+HINT_NOP13     rm32                            \321\2\x0F\x19\205                              P6,UNDOC
+HINT_NOP13     rm64                            \324\2\x0F\x19\205                              X64,UNDOC
+HINT_NOP14     rm16                            \320\2\x0F\x19\206                              P6,UNDOC
+HINT_NOP14     rm32                            \321\2\x0F\x19\206                              P6,UNDOC
+HINT_NOP14     rm64                            \324\2\x0F\x19\206                              X64,UNDOC
+HINT_NOP15     rm16                            \320\2\x0F\x19\207                              P6,UNDOC
+HINT_NOP15     rm32                            \321\2\x0F\x19\207                              P6,UNDOC
+HINT_NOP15     rm64                            \324\2\x0F\x19\207                              X64,UNDOC
+HINT_NOP16     rm16                            \320\2\x0F\x1A\200                              P6,UNDOC
+HINT_NOP16     rm32                            \321\2\x0F\x1A\200                              P6,UNDOC
+HINT_NOP16     rm64                            \324\2\x0F\x1A\200                              X64,UNDOC
+HINT_NOP17     rm16                            \320\2\x0F\x1A\201                              P6,UNDOC
+HINT_NOP17     rm32                            \321\2\x0F\x1A\201                              P6,UNDOC
+HINT_NOP17     rm64                            \324\2\x0F\x1A\201                              X64,UNDOC
+HINT_NOP18     rm16                            \320\2\x0F\x1A\202                              P6,UNDOC
+HINT_NOP18     rm32                            \321\2\x0F\x1A\202                              P6,UNDOC
+HINT_NOP18     rm64                            \324\2\x0F\x1A\202                              X64,UNDOC
+HINT_NOP19     rm16                            \320\2\x0F\x1A\203                              P6,UNDOC
+HINT_NOP19     rm32                            \321\2\x0F\x1A\203                              P6,UNDOC
+HINT_NOP19     rm64                            \324\2\x0F\x1A\203                              X64,UNDOC
+HINT_NOP20     rm16                            \320\2\x0F\x1A\204                              P6,UNDOC
+HINT_NOP20     rm32                            \321\2\x0F\x1A\204                              P6,UNDOC
+HINT_NOP20     rm64                            \324\2\x0F\x1A\204                              X64,UNDOC
+HINT_NOP21     rm16                            \320\2\x0F\x1A\205                              P6,UNDOC
+HINT_NOP21     rm32                            \321\2\x0F\x1A\205                              P6,UNDOC
+HINT_NOP21     rm64                            \324\2\x0F\x1A\205                              X64,UNDOC
+HINT_NOP22     rm16                            \320\2\x0F\x1A\206                              P6,UNDOC
+HINT_NOP22     rm32                            \321\2\x0F\x1A\206                              P6,UNDOC
+HINT_NOP22     rm64                            \324\2\x0F\x1A\206                              X64,UNDOC
+HINT_NOP23     rm16                            \320\2\x0F\x1A\207                              P6,UNDOC
+HINT_NOP23     rm32                            \321\2\x0F\x1A\207                              P6,UNDOC
+HINT_NOP23     rm64                            \324\2\x0F\x1A\207                              X64,UNDOC
+HINT_NOP24     rm16                            \320\2\x0F\x1B\200                              P6,UNDOC
+HINT_NOP24     rm32                            \321\2\x0F\x1B\200                              P6,UNDOC
+HINT_NOP24     rm64                            \324\2\x0F\x1B\200                              X64,UNDOC
+HINT_NOP25     rm16                            \320\2\x0F\x1B\201                              P6,UNDOC
+HINT_NOP25     rm32                            \321\2\x0F\x1B\201                              P6,UNDOC
+HINT_NOP25     rm64                            \324\2\x0F\x1B\201                              X64,UNDOC
+HINT_NOP26     rm16                            \320\2\x0F\x1B\202                              P6,UNDOC
+HINT_NOP26     rm32                            \321\2\x0F\x1B\202                              P6,UNDOC
+HINT_NOP26     rm64                            \324\2\x0F\x1B\202                              X64,UNDOC
+HINT_NOP27     rm16                            \320\2\x0F\x1B\203                              P6,UNDOC
+HINT_NOP27     rm32                            \321\2\x0F\x1B\203                              P6,UNDOC
+HINT_NOP27     rm64                            \324\2\x0F\x1B\203                              X64,UNDOC
+HINT_NOP28     rm16                            \320\2\x0F\x1B\204                              P6,UNDOC
+HINT_NOP28     rm32                            \321\2\x0F\x1B\204                              P6,UNDOC
+HINT_NOP28     rm64                            \324\2\x0F\x1B\204                              X64,UNDOC
+HINT_NOP29     rm16                            \320\2\x0F\x1B\205                              P6,UNDOC
+HINT_NOP29     rm32                            \321\2\x0F\x1B\205                              P6,UNDOC
+HINT_NOP29     rm64                            \324\2\x0F\x1B\205                              X64,UNDOC
+HINT_NOP30     rm16                            \320\2\x0F\x1B\206                              P6,UNDOC
+HINT_NOP30     rm32                            \321\2\x0F\x1B\206                              P6,UNDOC
+HINT_NOP30     rm64                            \324\2\x0F\x1B\206                              X64,UNDOC
+HINT_NOP31     rm16                            \320\2\x0F\x1B\207                              P6,UNDOC
+HINT_NOP31     rm32                            \321\2\x0F\x1B\207                              P6,UNDOC
+HINT_NOP31     rm64                            \324\2\x0F\x1B\207                              X64,UNDOC
+HINT_NOP32     rm16                            \320\2\x0F\x1C\200                              P6,UNDOC
+HINT_NOP32     rm32                            \321\2\x0F\x1C\200                              P6,UNDOC
+HINT_NOP32     rm64                            \324\2\x0F\x1C\200                              X64,UNDOC
+HINT_NOP33     rm16                            \320\2\x0F\x1C\201                              P6,UNDOC
+HINT_NOP33     rm32                            \321\2\x0F\x1C\201                              P6,UNDOC
+HINT_NOP33     rm64                            \324\2\x0F\x1C\201                              X64,UNDOC
+HINT_NOP34     rm16                            \320\2\x0F\x1C\202                              P6,UNDOC
+HINT_NOP34     rm32                            \321\2\x0F\x1C\202                              P6,UNDOC
+HINT_NOP34     rm64                            \324\2\x0F\x1C\202                              X64,UNDOC
+HINT_NOP35     rm16                            \320\2\x0F\x1C\203                              P6,UNDOC
+HINT_NOP35     rm32                            \321\2\x0F\x1C\203                              P6,UNDOC
+HINT_NOP35     rm64                            \324\2\x0F\x1C\203                              X64,UNDOC
+HINT_NOP36     rm16                            \320\2\x0F\x1C\204                              P6,UNDOC
+HINT_NOP36     rm32                            \321\2\x0F\x1C\204                              P6,UNDOC
+HINT_NOP36     rm64                            \324\2\x0F\x1C\204                              X64,UNDOC
+HINT_NOP37     rm16                            \320\2\x0F\x1C\205                              P6,UNDOC
+HINT_NOP37     rm32                            \321\2\x0F\x1C\205                              P6,UNDOC
+HINT_NOP37     rm64                            \324\2\x0F\x1C\205                              X64,UNDOC
+HINT_NOP38     rm16                            \320\2\x0F\x1C\206                              P6,UNDOC
+HINT_NOP38     rm32                            \321\2\x0F\x1C\206                              P6,UNDOC
+HINT_NOP38     rm64                            \324\2\x0F\x1C\206                              X64,UNDOC
+HINT_NOP39     rm16                            \320\2\x0F\x1C\207                              P6,UNDOC
+HINT_NOP39     rm32                            \321\2\x0F\x1C\207                              P6,UNDOC
+HINT_NOP39     rm64                            \324\2\x0F\x1C\207                              X64,UNDOC
+HINT_NOP40     rm16                            \320\2\x0F\x1D\200                              P6,UNDOC
+HINT_NOP40     rm32                            \321\2\x0F\x1D\200                              P6,UNDOC
+HINT_NOP40     rm64                            \324\2\x0F\x1D\200                              X64,UNDOC
+HINT_NOP41     rm16                            \320\2\x0F\x1D\201                              P6,UNDOC
+HINT_NOP41     rm32                            \321\2\x0F\x1D\201                              P6,UNDOC
+HINT_NOP41     rm64                            \324\2\x0F\x1D\201                              X64,UNDOC
+HINT_NOP42     rm16                            \320\2\x0F\x1D\202                              P6,UNDOC
+HINT_NOP42     rm32                            \321\2\x0F\x1D\202                              P6,UNDOC
+HINT_NOP42     rm64                            \324\2\x0F\x1D\202                              X64,UNDOC
+HINT_NOP43     rm16                            \320\2\x0F\x1D\203                              P6,UNDOC
+HINT_NOP43     rm32                            \321\2\x0F\x1D\203                              P6,UNDOC
+HINT_NOP43     rm64                            \324\2\x0F\x1D\203                              X64,UNDOC
+HINT_NOP44     rm16                            \320\2\x0F\x1D\204                              P6,UNDOC
+HINT_NOP44     rm32                            \321\2\x0F\x1D\204                              P6,UNDOC
+HINT_NOP44     rm64                            \324\2\x0F\x1D\204                              X64,UNDOC
+HINT_NOP45     rm16                            \320\2\x0F\x1D\205                              P6,UNDOC
+HINT_NOP45     rm32                            \321\2\x0F\x1D\205                              P6,UNDOC
+HINT_NOP45     rm64                            \324\2\x0F\x1D\205                              X64,UNDOC
+HINT_NOP46     rm16                            \320\2\x0F\x1D\206                              P6,UNDOC
+HINT_NOP46     rm32                            \321\2\x0F\x1D\206                              P6,UNDOC
+HINT_NOP46     rm64                            \324\2\x0F\x1D\206                              X64,UNDOC
+HINT_NOP47     rm16                            \320\2\x0F\x1D\207                              P6,UNDOC
+HINT_NOP47     rm32                            \321\2\x0F\x1D\207                              P6,UNDOC
+HINT_NOP47     rm64                            \324\2\x0F\x1D\207                              X64,UNDOC
+HINT_NOP48     rm16                            \320\2\x0F\x1E\200                              P6,UNDOC
+HINT_NOP48     rm32                            \321\2\x0F\x1E\200                              P6,UNDOC
+HINT_NOP48     rm64                            \324\2\x0F\x1E\200                              X64,UNDOC
+HINT_NOP49     rm16                            \320\2\x0F\x1E\201                              P6,UNDOC
+HINT_NOP49     rm32                            \321\2\x0F\x1E\201                              P6,UNDOC
+HINT_NOP49     rm64                            \324\2\x0F\x1E\201                              X64,UNDOC
+HINT_NOP50     rm16                            \320\2\x0F\x1E\202                              P6,UNDOC
+HINT_NOP50     rm32                            \321\2\x0F\x1E\202                              P6,UNDOC
+HINT_NOP50     rm64                            \324\2\x0F\x1E\202                              X64,UNDOC
+HINT_NOP51     rm16                            \320\2\x0F\x1E\203                              P6,UNDOC
+HINT_NOP51     rm32                            \321\2\x0F\x1E\203                              P6,UNDOC
+HINT_NOP51     rm64                            \324\2\x0F\x1E\203                              X64,UNDOC
+HINT_NOP52     rm16                            \320\2\x0F\x1E\204                              P6,UNDOC
+HINT_NOP52     rm32                            \321\2\x0F\x1E\204                              P6,UNDOC
+HINT_NOP52     rm64                            \324\2\x0F\x1E\204                              X64,UNDOC
+HINT_NOP53     rm16                            \320\2\x0F\x1E\205                              P6,UNDOC
+HINT_NOP53     rm32                            \321\2\x0F\x1E\205                              P6,UNDOC
+HINT_NOP53     rm64                            \324\2\x0F\x1E\205                              X64,UNDOC
+HINT_NOP54     rm16                            \320\2\x0F\x1E\206                              P6,UNDOC
+HINT_NOP54     rm32                            \321\2\x0F\x1E\206                              P6,UNDOC
+HINT_NOP54     rm64                            \324\2\x0F\x1E\206                              X64,UNDOC
+HINT_NOP55     rm16                            \320\2\x0F\x1E\207                              P6,UNDOC
+HINT_NOP55     rm32                            \321\2\x0F\x1E\207                              P6,UNDOC
+HINT_NOP55     rm64                            \324\2\x0F\x1E\207                              X64,UNDOC
+HINT_NOP56     rm16                            \320\2\x0F\x1F\200                              P6,UNDOC
+HINT_NOP56     rm32                            \321\2\x0F\x1F\200                              P6,UNDOC
+HINT_NOP56     rm64                            \324\2\x0F\x1F\200                              X64,UNDOC
+HINT_NOP57     rm16                            \320\2\x0F\x1F\201                              P6,UNDOC
+HINT_NOP57     rm32                            \321\2\x0F\x1F\201                              P6,UNDOC
+HINT_NOP57     rm64                            \324\2\x0F\x1F\201                              X64,UNDOC
+HINT_NOP58     rm16                            \320\2\x0F\x1F\202                              P6,UNDOC
+HINT_NOP58     rm32                            \321\2\x0F\x1F\202                              P6,UNDOC
+HINT_NOP58     rm64                            \324\2\x0F\x1F\202                              X64,UNDOC
+HINT_NOP59     rm16                            \320\2\x0F\x1F\203                              P6,UNDOC
+HINT_NOP59     rm32                            \321\2\x0F\x1F\203                              P6,UNDOC
+HINT_NOP59     rm64                            \324\2\x0F\x1F\203                              X64,UNDOC
+HINT_NOP60     rm16                            \320\2\x0F\x1F\204                              P6,UNDOC
+HINT_NOP60     rm32                            \321\2\x0F\x1F\204                              P6,UNDOC
+HINT_NOP60     rm64                            \324\2\x0F\x1F\204                              X64,UNDOC
+HINT_NOP61     rm16                            \320\2\x0F\x1F\205                              P6,UNDOC
+HINT_NOP61     rm32                            \321\2\x0F\x1F\205                              P6,UNDOC
+HINT_NOP61     rm64                            \324\2\x0F\x1F\205                              X64,UNDOC
+HINT_NOP62     rm16                            \320\2\x0F\x1F\206                              P6,UNDOC
+HINT_NOP62     rm32                            \321\2\x0F\x1F\206                              P6,UNDOC
+HINT_NOP62     rm64                            \324\2\x0F\x1F\206                              X64,UNDOC
+HINT_NOP63     rm16                            \320\2\x0F\x1F\207                              P6,UNDOC
+HINT_NOP63     rm32                            \321\2\x0F\x1F\207                              P6,UNDOC
+HINT_NOP63     rm64                            \324\2\x0F\x1F\207                              X64,UNDOC
diff --git a/insns.h b/insns.h
new file mode 100644 (file)
index 0000000..4ae2499
--- /dev/null
+++ b/insns.h
@@ -0,0 +1,135 @@
+/* insns.h   header file for insns.c
+ *
+ * The Netwide Assembler is copyright (C) 1996 Simon Tatham and
+ * Julian Hall. All rights reserved. The software is
+ * redistributable under the license given in the file "LICENSE"
+ * distributed in the NASM archive.
+ */
+
+#ifndef NASM_INSNS_H
+#define NASM_INSNS_H
+
+#include "nasm.h"
+#include "tokens.h"
+
+struct itemplate {
+    enum opcode opcode;                /* the token, passed from "parser.c" */
+    int operands;              /* number of operands */
+    opflags_t opd[MAX_OPERANDS]; /* bit flags for operand types */
+    const uint8_t *code;       /* the code it assembles to */
+    uint32_t flags;            /* some flags */
+};
+
+/* Disassembler table structure */
+/* If n == -1, then p points to another table of 256
+   struct disasm_index, otherwise p points to a list of n
+   struct itemplates to consider. */
+struct disasm_index {
+    const void *p;
+    int n;
+};
+
+/* Tables for the assembler and disassembler, respectively */
+extern const struct itemplate * const nasm_instructions[];
+extern const struct disasm_index itable[256];
+extern const struct disasm_index * const itable_vex[2][32][8];
+
+/* Common table for the byte codes */
+extern const uint8_t nasm_bytecodes[];
+
+/*
+ * this define is used to signify the end of an itemplate
+ */
+#define ITEMPLATE_END {-1,-1,{-1,-1,-1},NULL,0}
+
+/*
+ * Instruction template flags. These specify which processor
+ * targets the instruction is eligible for, whether it is
+ * privileged or undocumented, and also specify extra error
+ * checking on the matching of the instruction.
+ *
+ * IF_SM stands for Size Match: any operand whose size is not
+ * explicitly specified by the template is `really' intended to be
+ * the same size as the first size-specified operand.
+ * Non-specification is tolerated in the input instruction, but
+ * _wrong_ specification is not.
+ *
+ * IF_SM2 invokes Size Match on only the first _two_ operands, for
+ * three-operand instructions such as SHLD: it implies that the
+ * first two operands must match in size, but that the third is
+ * required to be _unspecified_.
+ *
+ * IF_SB invokes Size Byte: operands with unspecified size in the
+ * template are really bytes, and so no non-byte specification in
+ * the input instruction will be tolerated. IF_SW similarly invokes
+ * Size Word, and IF_SD invokes Size Doubleword.
+ *
+ * (The default state if neither IF_SM nor IF_SM2 is specified is
+ * that any operand with unspecified size in the template is
+ * required to have unspecified size in the instruction too...)
+ */
+
+#define IF_SM     0x00000001UL  /* size match */
+#define IF_SM2    0x00000002UL  /* size match first two operands */
+#define IF_SB     0x00000004UL  /* unsized operands can't be non-byte */
+#define IF_SW     0x00000008UL  /* unsized operands can't be non-word */
+#define IF_SD     0x0000000CUL  /* unsized operands can't be non-dword */
+#define IF_SQ     0x00000010UL  /* unsized operands can't be non-qword */
+#define IF_SO     0x00000014UL  /* unsized operands can't be non-oword */
+#define IF_SY     0x00000018UL  /* unsized operands can't be non-yword */
+#define IF_SZ     0x00000038UL  /* unsized operands must match the bitsize */
+#define IF_SX    0x0000003CUL  /* unsized operands not allowed */
+#define IF_SMASK  0x0000003CUL  /* mask for unsized argument size */
+#define IF_AR0   0x00000040UL  /* SB, SW, SD applies to argument 0 */
+#define IF_AR1   0x00000080UL  /* SB, SW, SD applies to argument 1 */
+#define IF_AR2   0x000000C0UL  /* SB, SW, SD applies to argument 2 */
+#define IF_AR3   0x00000100UL  /* SB, SW, SD applies to argument 3 */
+#define IF_AR4   0x00000140UL  /* SB, SW, SD applies to argument 4 */
+#define IF_ARMASK 0x000001C0UL  /* mask for unsized argument spec */
+#define IF_ARSHFT 6            /* LSB in IF_ARMASK */
+/* The next 3 bits aren't actually used for anything */
+#define IF_PRIV   0x00000000UL  /* it's a privileged instruction */
+#define IF_SMM    0x00000000UL  /* it's only valid in SMM */
+#define IF_PROT   0x00000000UL  /* it's protected mode only */
+#define IF_NOLONG 0x00000800UL  /* it's not available in long mode */
+#define IF_UNDOC  0x00001000UL  /* it's an undocumented instruction */
+#define IF_FPU    0x00002000UL  /* it's an FPU instruction */
+#define IF_MMX    0x00004000UL  /* it's an MMX instruction */
+#define IF_3DNOW  0x00008000UL  /* it's a 3DNow! instruction */
+#define IF_SSE    0x00010000UL  /* it's a SSE (KNI, MMX2) instruction */
+#define IF_SSE2   0x00020000UL  /* it's a SSE2 instruction */
+#define IF_SSE3   0x00040000UL  /* it's a SSE3 (PNI) instruction */
+#define IF_VMX   0x00080000UL  /* it's a VMX instruction */
+#define IF_LONG   0x00100000UL /* long mode instruction */
+#define IF_SSSE3  0x00200000UL  /* it's an SSSE3 instruction */
+#define IF_SSE4A  0x00400000UL  /* AMD SSE4a */
+#define IF_SSE41  0x00800000UL  /* it's an SSE4.1 instruction */
+#define IF_SSE42  0x00800000UL  /* HACK NEED TO REORGANIZE THESE BITS */
+#define IF_SSE5   0x00800000UL  /* HACK NEED TO REORGANIZE THESE BITS */
+#define IF_AVX    0x00800000UL  /* HACK NEED TO REORGANIZE THESE BITS */
+#define IF_FMA    0x00800000UL  /* HACK NEED TO REORGANIZE THESE BITS */
+#define IF_PMASK  0xFF000000UL  /* the mask for processor types */
+#define IF_PLEVEL 0x0F000000UL  /* the mask for processor instr. level */
+                                /* also the highest possible processor */
+#define IF_PFMASK 0xF01FFF00UL  /* the mask for disassembly "prefer" */
+#define IF_8086   0x00000000UL  /* 8086 instruction */
+#define IF_186    0x01000000UL  /* 186+ instruction */
+#define IF_286    0x02000000UL  /* 286+ instruction */
+#define IF_386    0x03000000UL  /* 386+ instruction */
+#define IF_486    0x04000000UL  /* 486+ instruction */
+#define IF_PENT   0x05000000UL  /* Pentium instruction */
+#define IF_P6     0x06000000UL  /* P6 instruction */
+#define IF_KATMAI 0x07000000UL  /* Katmai instructions */
+#define IF_WILLAMETTE 0x08000000UL      /* Willamette instructions */
+#define IF_PRESCOTT   0x09000000UL      /* Prescott instructions */
+#define IF_X86_64 0x0A000000UL /* x86-64 instruction (long or legacy mode) */
+#define IF_NEHALEM 0x0B000000UL  /* Nehalem instruction */
+#define IF_WESTMERE 0x0C000000UL   /* Westmere instruction */
+#define IF_SANDYBRIDGE 0x0D000000UL /* Sandy Bridge instruction */
+#define IF_FUTURE 0x0E000000UL /* Future processor (not yet disclosed) */
+#define IF_X64   (IF_LONG|IF_X86_64)
+#define IF_IA64   0x0F000000UL  /* IA64 instructions (in x86 mode) */
+#define IF_CYRIX  0x10000000UL  /* Cyrix-specific instruction */
+#define IF_AMD    0x20000000UL  /* AMD-specific instruction */
+
+#endif
diff --git a/insns.pl b/insns.pl
new file mode 100755 (executable)
index 0000000..8875872
--- /dev/null
+++ b/insns.pl
@@ -0,0 +1,936 @@
+#!/usr/bin/perl
+## --------------------------------------------------------------------------
+##   
+##   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.
+##
+## --------------------------------------------------------------------------
+
+#
+# insns.pl
+#
+# Parse insns.dat and produce generated source code files
+
+# Opcode prefixes which need their own opcode tables
+# LONGER PREFIXES FIRST!
+@disasm_prefixes = qw(0F24 0F25 0F38 0F3A 0F7A 0FA6 0FA7 0F);
+
+# This should match MAX_OPERANDS from nasm.h
+$MAX_OPERANDS = 5;
+
+# Add VEX/XOP prefixes
+@vex_class = ( 'vex', 'xop' );
+$vex_classes = scalar(@vex_class);
+@vexlist = ();
+%vexmap = ();
+for ($c = 0; $c < $vex_classes; $c++) {
+    $vexmap{$vex_class[$c]} = $c;
+    for ($m = 0; $m < 32; $m++) {
+       for ($lp = 0; $lp < 8; $lp++) {
+           push(@vexlist, sprintf("%s%02X%01X", $vex_class[$c], $m, $lp));
+       }
+    }
+}
+@disasm_prefixes = (@vexlist, @disasm_prefixes);
+
+@bytecode_count = (0) x 256;
+
+print STDERR "Reading insns.dat...\n";
+
+@args   = ();
+undef $output;
+foreach $arg ( @ARGV ) {
+    if ( $arg =~ /^\-/ ) {
+       if  ( $arg =~ /^\-([abdin])$/ ) {
+           $output = $1;
+       } else {
+           die "$0: Unknown option: ${arg}\n";
+       }
+    } else {
+       push (@args, $arg);
+    }
+}
+
+$fname = "insns.dat" unless $fname = $args[0];
+open (F, $fname) || die "unable to open $fname";
+
+%dinstables = ();
+@bytecode_list = ();
+
+$line = 0;
+$insns = 0;
+while (<F>) {
+    $line++;
+    chomp;
+    next if ( /^\s*(\;.*|)$/ );   # comments or blank lines
+
+    unless (/^\s*(\S+)\s+(\S+)\s+(\S+|\[.*\])\s+(\S+)\s*$/) {
+       warn "line $line does not contain four fields\n";
+       next;
+    }
+    @fields = ($1, $2, $3, $4);
+    @field_list = ([@fields, 0]);
+
+    if ($fields[1] =~ /\*/) {
+       # This instruction has relaxed form(s)
+       if ($fields[2] !~ /^\[/) {
+           warn "line $line has an * operand but uses raw bytecodes\n";
+           next;
+       }
+
+       $opmask = 0;
+       @ops = split(/,/, $fields[1]);
+       for ($oi = 0; $oi < scalar @ops; $oi++) {
+           if ($ops[$oi] =~ /\*$/) {
+               if ($oi == 0) {
+                   warn "line $line has a first operand with a *\n";
+                   next;
+               }
+               $opmask |= 1 << $oi;
+           }
+       }
+
+       for ($oi = 1; $oi < (1 << scalar @ops); $oi++) {
+           if (($oi & ~$opmask) == 0) {
+               my @xops = ();
+               my $omask = ~$oi;
+               for ($oj = 0; $oj < scalar(@ops); $oj++) {
+                   if ($omask & 1) {
+                       push(@xops, $ops[$oj]);
+                   }
+                   $omask >>= 1;
+               }
+               push(@field_list, [$fields[0], join(',', @xops),
+                                  $fields[2], $fields[3], $oi]);
+           }
+       }
+    }
+
+    foreach $fptr (@field_list) {
+       @fields = @$fptr;
+       ($formatted, $nd) = format_insn(@fields);
+       if ($formatted) {
+           $insns++;
+           $aname = "aa_$fields[0]";
+           push @$aname, $formatted;
+       }
+       if ( $fields[0] =~ /cc$/ ) {
+           # Conditional instruction
+           $k_opcodes_cc{$fields[0]}++;
+       } else {
+           # Unconditional instruction
+           $k_opcodes{$fields[0]}++;
+       }
+       if ($formatted && !$nd) {
+           push @big, $formatted;
+           my @sseq = startseq($fields[2], $fields[4]);
+           foreach $i (@sseq) {
+               if (!defined($dinstables{$i})) {
+                   $dinstables{$i} = [];
+               }
+               push(@{$dinstables{$i}}, $#big);
+           }
+       }
+    }
+}
+
+close F;
+
+#
+# Generate the bytecode array.  At this point, @bytecode_list contains
+# the full set of bytecodes.
+#
+
+# Sort by descending length
+@bytecode_list = sort { scalar(@$b) <=> scalar(@$a) } @bytecode_list;
+@bytecode_array = ();
+%bytecode_pos = ();
+$bytecode_next = 0;
+foreach $bl (@bytecode_list) {
+    my $h = hexstr(@$bl);
+    next if (defined($bytecode_pos{$h}));
+
+    push(@bytecode_array, $bl);
+    while ($h ne '') {
+       $bytecode_pos{$h} = $bytecode_next;
+       $h = substr($h, 2);
+       $bytecode_next++;
+    }
+}
+undef @bytecode_list;
+
+@opcodes    = sort keys(%k_opcodes);
+@opcodes_cc = sort keys(%k_opcodes_cc);
+
+if ( !defined($output) || $output eq 'b') {
+    print STDERR "Writing insnsb.c...\n";
+
+    open B, ">insnsb.c";
+
+    print B "/* This file auto-generated from insns.dat by insns.pl" .
+        " - don't edit it */\n\n";
+
+    print B "#include \"nasm.h\"\n";
+    print B "#include \"insns.h\"\n\n";
+
+    print B "const uint8_t nasm_bytecodes[$bytecode_next] = {\n";
+
+    $p = 0;
+    foreach $bl (@bytecode_array) {
+       printf B "    /* %5d */ ", $p;
+       foreach $d (@$bl) {
+           printf B "%#o,", $d;
+           $p++;
+       }
+       printf B "\n";
+    }
+    print B "};\n";
+
+    print B "\n";
+    print B "/*\n";
+    print B " * Bytecode frequencies (including reuse):\n";
+    print B " *\n";
+    for ($i = 0; $i < 32; $i++) {
+       print B " *";
+       for ($j = 0; $j < 256; $j += 32) {
+           print B " |" if ($j);
+           printf B " %3o:%4d", $i+$j, $bytecode_count[$i+$j];
+       }
+       print B "\n";
+    }
+    print B " */\n";
+
+    close B;
+}
+
+if ( !defined($output) || $output eq 'a' ) {
+    print STDERR "Writing insnsa.c...\n";
+
+    open A, ">insnsa.c";
+
+    print A "/* This file auto-generated from insns.dat by insns.pl" .
+        " - don't edit it */\n\n";
+
+    print A "#include \"nasm.h\"\n";
+    print A "#include \"insns.h\"\n\n";
+
+    foreach $i (@opcodes, @opcodes_cc) {
+       print A "static const struct itemplate instrux_${i}[] = {\n";
+       $aname = "aa_$i";
+       foreach $j (@$aname) {
+           print A "    ", codesubst($j), "\n";
+       }
+       print A "    ITEMPLATE_END\n};\n\n";
+    }
+    print A "const struct itemplate * const nasm_instructions[] = {\n";
+    foreach $i (@opcodes, @opcodes_cc) {
+       print A "    instrux_${i},\n";
+    }
+    print A "};\n";
+
+    close A;
+}
+
+if ( !defined($output) || $output eq 'd' ) {
+    print STDERR "Writing insnsd.c...\n";
+
+    open D, ">insnsd.c";
+
+    print D "/* This file auto-generated from insns.dat by insns.pl" .
+        " - don't edit it */\n\n";
+
+    print D "#include \"nasm.h\"\n";
+    print D "#include \"insns.h\"\n\n";
+
+    print D "static const struct itemplate instrux[] = {\n";
+    $n = 0;
+    foreach $j (@big) {
+       printf D "    /* %4d */ %s\n", $n++, codesubst($j);
+    }
+    print D "};\n";
+
+    foreach $h (sort(keys(%dinstables))) {
+       next if ($h eq '');     # Skip pseudo-instructions
+       print D "\nstatic const struct itemplate * const itable_${h}[] = {\n";
+       foreach $j (@{$dinstables{$h}}) {
+           print D "    instrux + $j,\n";
+       }
+       print D "};\n";
+    }
+
+    @prefix_list = ();
+    foreach $h (@disasm_prefixes, '') {
+       for ($c = 0; $c < 256; $c++) {
+           $nn = sprintf("%s%02X", $h, $c);
+           if ($is_prefix{$nn} || defined($dinstables{$nn})) {
+               # At least one entry in this prefix table
+               push(@prefix_list, $h);
+               $is_prefix{$h} = 1;
+               last;
+           }
+       }
+    }
+
+    foreach $h (@prefix_list) {
+       print D "\n";
+       print D "static " unless ($h eq '');
+       print D "const struct disasm_index ";
+       print D ($h eq '') ? 'itable' : "itable_$h";
+       print D "[256] = {\n";
+       for ($c = 0; $c < 256; $c++) {
+           $nn = sprintf("%s%02X", $h, $c);
+           if ($is_prefix{$nn}) {
+               die "$fname: ambiguous decoding of $nn\n"
+                   if (defined($dinstables{$nn}));
+               printf D "    { itable_%s, -1 },\n", $nn;
+           } elsif (defined($dinstables{$nn})) {
+               printf D "    { itable_%s, %u },\n",
+               $nn, scalar(@{$dinstables{$nn}});
+           } else {
+               printf D "    { NULL, 0 },\n";
+           }
+       }
+       print D "};\n";
+    }
+
+    printf D "\nconst struct disasm_index * const itable_vex[%d][32][8] =\n",
+        $vex_classes;
+    print D "{\n";
+    for ($c = 0; $c < $vex_classes; $c++) {
+       print D "    {\n";
+       for ($m = 0; $m < 32; $m++) {
+           print D "        {\n";
+           for ($lp = 0; $lp < 8; $lp++) {
+               $vp = sprintf("%s%02X%01X", $vex_class[$c], $m, $lp);
+               if ($is_prefix{$vp}) {
+                   printf D "            itable_%s,\n", $vp;
+               } else {
+                   print  D "            NULL,\n";
+               }
+           }
+           print D "        },\n";
+       }
+       print D "    },\n";
+    }
+    print D "};\n";
+
+    close D;
+}
+
+if ( !defined($output) || $output eq 'i' ) {
+    print STDERR "Writing insnsi.h...\n";
+
+    open I, ">insnsi.h";
+
+    print I "/* This file is auto-generated from insns.dat by insns.pl" .
+        " - don't edit it */\n\n";
+    print I "/* This file in included by nasm.h */\n\n";
+
+    print I "/* Instruction names */\n\n";
+    print I "#ifndef NASM_INSNSI_H\n";
+    print I "#define NASM_INSNSI_H 1\n\n";
+    print I "enum opcode {\n";
+    $maxlen = 0;
+    foreach $i (@opcodes, @opcodes_cc) {
+       print I "\tI_${i},\n";
+       $len = length($i);
+       $len++ if ( $i =~ /cc$/ ); # Condition codes can be 3 characters long
+       $maxlen = $len if ( $len > $maxlen );
+    }
+    print I "\tI_none = -1\n";
+    print I "};\n\n";
+    print I "#define MAX_INSLEN ", $maxlen, "\n";
+    print I "#define FIRST_COND_OPCODE I_", $opcodes_cc[0], "\n\n";
+    print I "#endif /* NASM_INSNSI_H */\n";
+
+    close I;
+}
+
+if ( !defined($output) || $output eq 'n' ) {
+    print STDERR "Writing insnsn.c...\n";
+
+    open N, ">insnsn.c";
+
+    print N "/* This file is auto-generated from insns.dat by insns.pl" .
+        " - don't edit it */\n\n";
+    print N "#include \"tables.h\"\n\n";
+
+    print N "const char * const nasm_insn_names[] = {";
+    $first = 1;
+    foreach $i (@opcodes, @opcodes_cc) {
+       print N "," if ( !$first );
+       $first = 0;
+       $ilower = $i;
+       $ilower =~ s/cc$//;     # Remove conditional cc suffix
+       $ilower =~ tr/A-Z/a-z/; # Change to lower case (Perl 4 compatible)
+       print N "\n\t\"${ilower}\"";
+    }
+    print N "\n};\n";
+    close N;
+}
+
+printf STDERR "Done: %d instructions\n", $insns;
+
+# Count primary bytecodes, for statistics
+sub count_bytecodes(@) {
+    my $skip = 0;
+    foreach my $bc (@_) {
+       if ($skip) {
+           $skip--;
+           next;
+       }
+       $bytecode_count[$bc]++;
+       if ($bc >= 01 && $bc <= 04) {
+           $skip = $bc;
+       } elsif (($bc & ~03) == 010) {
+           $skip = 1;
+       } elsif (($bc & ~013) == 0144) {
+           $skip = 1;
+       } elsif ($bc == 0172) {
+           $skip = 1;
+       } elsif ($bc >= 0260 && $bc <= 0270) {
+           $skip = 2;
+       } elsif ($bc == 0330) {
+           $skip = 1;
+       }
+    }
+}
+
+sub format_insn($$$$$) {
+    my ($opcode, $operands, $codes, $flags, $relax) = @_;
+    my $num, $nd = 0;
+    my @bytecode;
+    my $op, @ops, $opp, @opx, @oppx;
+
+    return (undef, undef) if $operands eq "ignore";
+
+    # format the operands
+    $operands =~ s/\*//g;
+    $operands =~ s/:/|colon,/g;
+    @ops = ();
+    if ($operands ne 'void') {
+       foreach $op (split(/,/, $operands)) {
+           if ($op =~ /^\=([0-9]+)$/) {
+               $op = "same_as|$1";
+           } else {
+               @opx = ();
+               foreach $opp (split(/\|/, $op)) {
+                   @oppx = ();
+                   if ($opp =~ /^(.*[^\d])(8|16|32|64|80|128|256)$/) {
+                       my $ox = $1;
+                       my $on = $2;
+                       if ($ox !~ /^sbyte$/) {
+                           $opp = $ox;
+                           push(@oppx, "bits$on");
+                       }
+                   }
+                   $opp =~ s/^mem$/memory/;
+                   $opp =~ s/^memory_offs$/mem_offs/;
+                   $opp =~ s/^imm$/immediate/;
+                   $opp =~ s/^([a-z]+)rm$/rm_$1/;
+                   $opp =~ s/^rm$/rm_gpr/;
+                   $opp =~ s/^reg$/reg_gpr/;
+                   push(@opx, $opp, @oppx);
+               }
+               $op = join('|', @opx);
+           }
+           push(@ops, $op);
+       }
+    }
+
+    $num = scalar(@ops);
+    while (scalar(@ops) < $MAX_OPERANDS) {
+       push(@ops, '0');
+    }
+    $operands = join(',', @ops);
+    $operands =~ tr/a-z/A-Z/;
+
+    # format the flags
+    $flags =~ s/,/|IF_/g;
+    $flags =~ s/(\|IF_ND|IF_ND\|)//, $nd = 1 if $flags =~ /IF_ND/;
+    $flags = "IF_" . $flags;
+
+    @bytecode = (decodify($codes, $relax), 0);
+    push(@bytecode_list, [@bytecode]);
+    $codes = hexstr(@bytecode);
+    count_bytecodes(@bytecode);
+
+    ("{I_$opcode, $num, {$operands}, \@\@CODES-$codes\@\@, $flags},", $nd);
+}
+
+#
+# Look for @@CODES-xxx@@ sequences and replace them with the appropriate
+# offset into nasm_bytecodes
+#
+sub codesubst($) {
+    my($s) = @_;
+    my $n;
+
+    while ($s =~ /\@\@CODES-([0-9A-F]+)\@\@/) {
+       my $pos = $bytecode_pos{$1};
+       if (!defined($pos)) {
+           die "$fname: no position assigned to byte code $1\n";
+       }
+       $s = $` . "nasm_bytecodes+${pos}" . "$'";
+    }
+    return $s;
+}
+
+sub addprefix ($@) {
+    my ($prefix, @list) = @_;
+    my $x;
+    my @l = ();
+
+    foreach $x (@list) {
+       push(@l, sprintf("%s%02X", $prefix, $x));
+    }
+
+    return @l;
+}
+
+#
+# Turn a code string into a sequence of bytes
+#
+sub decodify($$) {
+  # Although these are C-syntax strings, by convention they should have
+  # only octal escapes (for directives) and hexadecimal escapes
+  # (for verbatim bytes)
+    my($codestr, $relax) = @_;
+
+    if ($codestr =~ /^\s*\[([^\]]*)\]\s*$/) {
+       return byte_code_compile($1, $relax);
+    }
+
+    my $c = $codestr;
+    my @codes = ();
+
+    while ($c ne '') {
+       if ($c =~ /^\\x([0-9a-f]+)(.*)$/i) {
+           push(@codes, hex $1);
+           $c = $2;
+           next;
+       } elsif ($c =~ /^\\([0-7]{1,3})(.*)$/) {
+           push(@codes, oct $1);
+           $c = $2;
+           next;
+       } else {
+           die "$fname: unknown code format in \"$codestr\"\n";
+       }
+    }
+
+    return @codes;
+}
+
+# Turn a numeric list into a hex string
+sub hexstr(@) {
+    my $s = '';
+    my $c;
+
+    foreach $c (@_) {
+       $s .= sprintf("%02X", $c);
+    }
+    return $s;
+}
+
+# Here we determine the range of possible starting bytes for a given
+# instruction. We need only consider the codes:
+# \[1234]      mean literal bytes, of course
+# \1[0123]     mean byte plus register value
+# \330         means byte plus condition code
+# \0 or \340   mean give up and return empty set
+# \34[4567]    mean PUSH/POP of segment registers: special case
+# \17[234]     skip is4 control byte
+# \26x \270    skip VEX control bytes
+sub startseq($$) {
+    my ($codestr, $relax) = @_;
+    my $word, @range;
+    my @codes = ();
+    my $c = $codestr;
+    my $c0, $c1, $i;
+    my $prefix = '';
+
+    @codes = decodify($codestr, $relax);
+
+    while ($c0 = shift(@codes)) {
+       $c1 = $codes[0];
+       if ($c0 >= 01 && $c0 <= 04) {
+           # Fixed byte string
+           my $fbs = $prefix;
+           while (1) {
+               if ($c0 >= 01 && $c0 <= 04) {
+                   while ($c0--) {
+                       $fbs .= sprintf("%02X", shift(@codes));
+                   }
+               } else {
+                   last;
+               }
+               $c0 = shift(@codes);
+           }
+
+           foreach $pfx (@disasm_prefixes) {
+               if (substr($fbs, 0, length($pfx)) eq $pfx) {
+                   $prefix = $pfx;
+                   $fbs = substr($fbs, length($pfx));
+                   last;
+               }
+           }
+
+           if ($fbs ne '') {
+               return ($prefix.substr($fbs,0,2));
+           }
+
+           unshift(@codes, $c0);
+       } elsif ($c0 >= 010 && $c0 <= 013) {
+           return addprefix($prefix, $c1..($c1+7));
+       } elsif (($c0 & ~013) == 0144) {
+           return addprefix($prefix, $c1, $c1|2);
+       } elsif ($c0 == 0330) {
+           return addprefix($prefix, $c1..($c1+15));
+       } elsif ($c0 == 0 || $c0 == 0340) {
+           return $prefix;
+       } elsif ($c0 == 0344) {
+           return addprefix($prefix, 0x06, 0x0E, 0x16, 0x1E);
+       } elsif ($c0 == 0345) {
+           return addprefix($prefix, 0x07, 0x17, 0x1F);
+       } elsif ($c0 == 0346) {
+           return addprefix($prefix, 0xA0, 0xA8);
+       } elsif ($c0 == 0347) {
+           return addprefix($prefix, 0xA1, 0xA9);
+       } elsif (($c0 & ~3) == 0260 || $c0 == 0270) {
+           my $c,$m,$wlp;
+           $m   = shift(@codes);
+           $wlp = shift(@codes);
+           $c = ($m >> 6);
+           $m = $m & 31;
+           $prefix .= sprintf('%s%02X%01X', $vex_class[$c], $m, $wlp & 7);
+       } elsif ($c0 >= 0172 && $c0 <= 174) {
+           shift(@codes);      # Skip is4 control byte
+       } else {
+           # We really need to be able to distinguish "forbidden"
+           # and "ignorable" codes here
+       }
+    }
+    return $prefix;
+}
+
+#
+# This function takes a series of byte codes in a format which is more
+# typical of the Intel documentation, and encode it.
+#
+# The format looks like:
+#
+# [operands: opcodes]
+#
+# The operands word lists the order of the operands:
+#
+# r = register field in the modr/m
+# m = modr/m
+# v = VEX "v" field
+# d = DREX "dst" field
+# i = immediate
+# s = register field of is4/imz2 field
+# - = implicit (unencoded) operand
+#
+# For an operand that should be filled into more than one field,
+# enter it as e.g. "r+v".
+#
+sub byte_code_compile($$) {
+    my($str, $relax) = @_;
+    my $opr;
+    my $opc;
+    my @codes = ();
+    my $litix = undef;
+    my %oppos = ();
+    my $i;
+    my $op, $oq;
+    my $opex;
+
+    unless ($str =~ /^(([^\s:]*)\:|)\s*(.*\S)\s*$/) {
+       die "$fname: $line: cannot parse: [$str]\n";
+    }
+    $opr = "\L$2";
+    $opc = "\L$3";
+
+    my $op = 0;
+    for ($i = 0; $i < length($opr); $i++) {
+       my $c = substr($opr,$i,1);
+       if ($c eq '+') {
+           $op--;
+       } else {
+           if ($relax & 1) {
+               $op--;
+           }
+           $relax >>= 1;
+           $oppos{$c} = $op++;
+       }
+    }
+
+    $prefix_ok = 1;
+    foreach $op (split(/\s*(?:\s|(?=[\/\\]))/, $opc)) {
+       if ($op eq 'o16') {
+           push(@codes, 0320);
+       } elsif ($op eq 'o32') {
+           push(@codes, 0321);
+       } elsif ($op eq 'o64') {  # 64-bit operand size requiring REX.W
+           push(@codes, 0324);
+       } elsif ($op eq 'o64nw') { # Implied 64-bit operand size (no REX.W)
+           push(@codes, 0323);
+       } elsif ($op eq 'a16') {
+           push(@codes, 0310);
+       } elsif ($op eq 'a32') {
+           push(@codes, 0311);
+       } elsif ($op eq 'a64') {
+           push(@codes, 0313);
+       } elsif ($op eq '!osp') {
+           push(@codes, 0364);
+       } elsif ($op eq '!asp') {
+           push(@codes, 0365);
+       } elsif ($op eq 'rex.l') {
+           push(@codes, 0334);
+       } elsif ($op eq 'repe') {
+           push(@codes, 0335);
+       } elsif ($op eq 'nohi') { # Use spl/bpl/sil/dil even without REX
+           push(@codes, 0325);
+       } elsif ($prefix_ok && $op =~ /^(66|f2|f3|np)$/) {
+           # 66/F2/F3 prefix used as an opcode extension, or np = no prefix
+           if ($op eq '66') {
+               push(@codes, 0361);
+           } elsif ($op eq 'f2') {
+               push(@codes, 0362);
+           } elsif ($op eq 'f3') {
+               push(@codes, 0363);
+           } else {
+               push(@codes, 0360);
+           }
+       } elsif ($op =~ /^[0-9a-f]{2}$/) {
+           if (defined($litix) && $litix+$codes[$litix]+1 == scalar @codes &&
+               $codes[$litix] < 4) {
+               $codes[$litix]++;
+               push(@codes, hex $op);
+           } else {
+               $litix = scalar(@codes);
+               push(@codes, 01, hex $op);
+           }
+           $prefix_ok = 0;
+       } elsif ($op eq '/r') {
+           if (!defined($oppos{'r'}) || !defined($oppos{'m'})) {
+               die "$fname: $line: $op requires r and m operands\n";
+           }
+           $opex = (($oppos{'m'} & 4) ? 06 : 0) |
+                   (($oppos{'r'} & 4) ? 05 : 0);
+           push(@codes, $opex) if ($opex);
+           push(@codes, 0100 + (($oppos{'m'} & 3) << 3) + ($oppos{'r'} & 3));
+           $prefix_ok = 0;
+       } elsif ($op =~ m:^/([0-7])$:) {
+           if (!defined($oppos{'m'})) {
+               die "$fname: $line: $op requires m operand\n";
+           }
+           push(@codes, 06) if ($oppos{'m'} & 4);
+           push(@codes, 0200 + (($oppos{'m'} & 3) << 3) + $1);
+           $prefix_ok = 0;
+       } elsif ($op =~ /^(vex|xop)(|\..*)$/) {
+           my $c = $vexmap{$1};
+           my ($m,$w,$l,$p) = (undef,2,undef,0);
+           my $has_nds = 0;
+           my @subops = split(/\./, $op);
+           shift @subops;      # Drop prefix
+           foreach $oq (@subops) {
+               if ($oq eq '128' || $oq eq 'l0') {
+                   $l = 0;
+               } elsif ($oq eq '256' || $oq eq 'l1') {
+                   $l = 1;
+               } elsif ($oq eq 'w0') {
+                   $w = 0;
+               } elsif ($oq eq 'w1') {
+                   $w = 1;
+               } elsif ($oq eq 'wx') {
+                   $w = 2;
+               } elsif ($oq eq 'ww') {
+                   $w = 3;
+               } elsif ($oq eq 'p0') {
+                   $p = 0;
+               } elsif ($oq eq '66' || $oq eq 'p1') {
+                   $p = 1;
+               } elsif ($oq eq 'f3' || $oq eq 'p2') {
+                   $p = 2;
+               } elsif ($oq eq 'f2' || $oq eq 'p3') {
+                   $p = 3;
+               } elsif ($oq eq '0f') {
+                   $m = 1;
+               } elsif ($oq eq '0f38') {
+                   $m = 2;
+               } elsif ($oq eq '0f3a') {
+                   $m = 3;
+               } elsif ($oq =~ /^m([0-9]+)$/) {
+                   $m = $1+0;
+               } elsif ($oq eq 'nds' || $oq eq 'ndd' || $oq eq 'dds') {
+                   if (!defined($oppos{'v'})) {
+                       die "$fname: $line: vex.$oq without 'v' operand\n";
+                   }
+                   $has_nds = 1;
+               } else {
+                   die "$fname: $line: undefined VEX subcode: $oq\n";
+               }
+           }
+           if (!defined($m) || !defined($w) || !defined($l) || !defined($p)) {
+               die "$fname: $line: missing fields in VEX specification\n";
+           }
+           if (defined($oppos{'v'}) && !$has_nds) {
+               die "$fname: $line: 'v' operand without vex.nds or vex.ndd\n";
+           }
+           push(@codes, defined($oppos{'v'}) ? 0260+($oppos{'v'} & 3) : 0270,
+                ($c << 6)+$m, ($w << 3)+($l << 2)+$p);
+           $prefix_ok = 0;
+       } elsif ($op =~ /^\/drex([01])$/) {
+           my $oc0 = $1;
+           if (!defined($oppos{'d'})) {
+               die "$fname: $line: DREX without a 'd' operand\n";
+           }
+           # Note the use of *unshift* here, as opposed to *push*.
+           # This is because NASM want this byte code at the start of
+           # the instruction sequence, but the AMD documentation puts
+           # this at (roughly) the position of the drex byte itself.
+           # This allows us to match the AMD documentation and still
+           # do the right thing.
+           unshift(@codes, 0160+($oppos{'d'} & 3)+($oc0 ? 4 : 0));
+           unshift(@codes, 05) if ($oppos{'d'} & 4);
+       } elsif ($op =~ /^(ib\,s|ib|ibx|ib\,w|iw|iwd|id|idx|iwdq|rel|rel8|rel16|rel32|iq|seg|ibw|ibd|ibd,s)$/) {
+           if (!defined($oppos{'i'})) {
+               die "$fname: $line: $op without 'i' operand\n";
+           }
+           if ($op eq 'ib,s') { # Signed imm8
+               push(@codes, 05) if ($oppos{'i'} & 4);
+               push(@codes, 014+($oppos{'i'} & 3));
+           } elsif ($op eq 'ib') { # imm8
+               push(@codes, 05) if ($oppos{'i'} & 4);
+               push(@codes, 020+($oppos{'i'} & 3));
+           } elsif ($op eq 'ib,u') { # Unsigned imm8
+               push(@codes, 05) if ($oppos{'i'} & 4);
+               push(@codes, 024+($oppos{'i'} & 3));
+           } elsif ($op eq 'iw') { # imm16
+               push(@codes, 05) if ($oppos{'i'} & 4);
+               push(@codes, 030+($oppos{'i'} & 3));
+           } elsif ($op eq 'ibx') { # imm8 sign-extended to opsize
+               push(@codes, 05) if ($oppos{'i'} & 4);
+               push(@codes, 0274+($oppos{'i'} & 3));
+           } elsif ($op eq 'iwd') { # imm16 or imm32, depending on opsize
+               push(@codes, 05) if ($oppos{'i'} & 4);
+               push(@codes, 034+($oppos{'i'} & 3));
+           } elsif ($op eq 'id') { # imm32
+               push(@codes, 05) if ($oppos{'i'} & 4);
+               push(@codes, 040+($oppos{'i'} & 3));
+           } elsif ($op eq 'idx') { # imm32 extended to 64 bits
+               push(@codes, 05) if ($oppos{'i'} & 4);
+               push(@codes, 0254+($oppos{'i'} & 3));
+           } elsif ($op eq 'iwdq') { # imm16/32/64, depending on opsize
+               push(@codes, 05) if ($oppos{'i'} & 4);
+               push(@codes, 044+($oppos{'i'} & 3));
+           } elsif ($op eq 'rel8') {
+               push(@codes, 05) if ($oppos{'i'} & 4);
+               push(@codes, 050+($oppos{'i'} & 3));
+           } elsif ($op eq 'iq') {
+               push(@codes, 05) if ($oppos{'i'} & 4);
+               push(@codes, 054+($oppos{'i'} & 3));
+           } elsif ($op eq 'rel16') {
+               push(@codes, 05) if ($oppos{'i'} & 4);
+               push(@codes, 060+($oppos{'i'} & 3));
+           } elsif ($op eq 'rel') { # 16 or 32 bit relative operand
+               push(@codes, 05) if ($oppos{'i'} & 4);
+               push(@codes, 064+($oppos{'i'} & 3));
+           } elsif ($op eq 'rel32') {
+               push(@codes, 05) if ($oppos{'i'} & 4);
+               push(@codes, 070+($oppos{'i'} & 3));
+           } elsif ($op eq 'seg') {
+               push(@codes, 05) if ($oppos{'i'} & 4);
+               push(@codes, 074+($oppos{'i'} & 3));
+           } elsif ($op eq 'ibw') { # imm16 that can be bytified
+               if (!defined($s_pos)) {
+                   die "$fname: $line: $op without a +s byte\n";
+               }
+               $codes[$s_pos] += 0144;
+               push(@codes, 05) if ($oppos{'i'} & 4);
+               push(@codes, 0140+($oppos{'i'} & 3));
+           } elsif ($op eq 'ibd') { # imm32 that can be bytified
+               if (!defined($s_pos)) {
+                   die "$fname: $line: $op without a +s byte\n";
+               }
+               $codes[$s_pos] += 0154;
+               push(@codes, 05) if ($oppos{'i'} & 4);
+               push(@codes, 0150+($oppos{'i'} & 3));
+           } elsif ($op eq 'ibd,s') {
+               # imm32 that can be bytified, sign extended to 64 bits
+               if (!defined($s_pos)) {
+                   die "$fname: $line: $op without a +s byte\n";
+               }
+               $codes[$s_pos] += 0154;
+               push(@codes, 05) if ($oppos{'i'} & 4);
+               push(@codes, 0250+($oppos{'i'} & 3));
+           }
+           $prefix_ok = 0;
+       } elsif ($op eq '/is4') {
+           if (!defined($oppos{'s'})) {
+               die "$fname: $line: $op without 's' operand\n";
+           }
+           if (defined($oppos{'i'})) {
+               push(@codes, 0172, ($oppos{'s'} << 3)+$oppos{'i'});
+           } else {
+               push(@codes, 0174, $oppos{'s'});
+           }
+           $prefix_ok = 0;
+       } elsif ($op =~ /^\/is4\=([0-9]+)$/) {
+           my $imm = $1;
+           if (!defined($oppos{'s'})) {
+               die "$fname: $line: $op without 's' operand\n";
+           }
+           if ($imm < 0 || $imm > 15) {
+               die "$fname: $line: invalid imm4 value for $op: $imm\n";
+           }
+           push(@codes, 0173, ($oppos{'s'} << 4) + $imm);
+           $prefix_ok = 0;
+       } elsif ($op =~ /^([0-9a-f]{2})\+s$/) {
+           if (!defined($oppos{'i'})) {
+               die "$fname: $line: $op without 'i' operand\n";
+           }
+           $s_pos = scalar @codes;
+           push(@codes, 05) if ($oppos{'i'} & 4);
+           push(@codes, $oppos{'i'} & 3, hex $1);
+           $prefix_ok = 0;
+       } elsif ($op =~ /^([0-9a-f]{2})\+c$/) {
+           push(@codes, 0330, hex $1);
+           $prefix_ok = 0;
+       } elsif ($op =~ /^\\([0-7]+|x[0-9a-f]{2})$/) {
+           # Escape to enter literal bytecodes
+           push(@codes, oct $1);
+       } else {
+           die "$fname: $line: unknown operation: $op\n";
+       }
+    }
+
+    return @codes;
+}
diff --git a/insnsa.c b/insnsa.c
new file mode 100644 (file)
index 0000000..be66910
--- /dev/null
+++ b/insnsa.c
@@ -0,0 +1,10480 @@
+/* This file auto-generated from insns.dat by insns.pl - don't edit it */
+
+#include "nasm.h"
+#include "insns.h"
+
+static const struct itemplate instrux_AAA[] = {
+    {I_AAA, 0, {0,0,0,0,0}, nasm_bytecodes+19962, IF_8086|IF_NOLONG},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_AAD[] = {
+    {I_AAD, 0, {0,0,0,0,0}, nasm_bytecodes+18914, IF_8086|IF_NOLONG},
+    {I_AAD, 1, {IMMEDIATE,0,0,0,0}, nasm_bytecodes+18918, IF_8086|IF_SB|IF_NOLONG},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_AAM[] = {
+    {I_AAM, 0, {0,0,0,0,0}, nasm_bytecodes+18922, IF_8086|IF_NOLONG},
+    {I_AAM, 1, {IMMEDIATE,0,0,0,0}, nasm_bytecodes+18926, IF_8086|IF_SB|IF_NOLONG},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_AAS[] = {
+    {I_AAS, 0, {0,0,0,0,0}, nasm_bytecodes+19965, IF_8086|IF_NOLONG},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_ADC[] = {
+    {I_ADC, 2, {MEMORY,REG_GPR|BITS8,0,0,0}, nasm_bytecodes+18930, IF_8086|IF_SM},
+    {I_ADC, 2, {REG_GPR|BITS8,REG_GPR|BITS8,0,0,0}, nasm_bytecodes+18930, IF_8086},
+    {I_ADC, 2, {MEMORY,REG_GPR|BITS16,0,0,0}, nasm_bytecodes+17034, IF_8086|IF_SM},
+    {I_ADC, 2, {REG_GPR|BITS16,REG_GPR|BITS16,0,0,0}, nasm_bytecodes+17034, IF_8086},
+    {I_ADC, 2, {MEMORY,REG_GPR|BITS32,0,0,0}, nasm_bytecodes+17039, IF_386|IF_SM},
+    {I_ADC, 2, {REG_GPR|BITS32,REG_GPR|BITS32,0,0,0}, nasm_bytecodes+17039, IF_386},
+    {I_ADC, 2, {MEMORY,REG_GPR|BITS64,0,0,0}, nasm_bytecodes+17044, IF_X64|IF_SM},
+    {I_ADC, 2, {REG_GPR|BITS64,REG_GPR|BITS64,0,0,0}, nasm_bytecodes+17044, IF_X64},
+    {I_ADC, 2, {REG_GPR|BITS8,MEMORY,0,0,0}, nasm_bytecodes+10228, IF_8086|IF_SM},
+    {I_ADC, 2, {REG_GPR|BITS8,REG_GPR|BITS8,0,0,0}, nasm_bytecodes+10228, IF_8086},
+    {I_ADC, 2, {REG_GPR|BITS16,MEMORY,0,0,0}, nasm_bytecodes+17049, IF_8086|IF_SM},
+    {I_ADC, 2, {REG_GPR|BITS16,REG_GPR|BITS16,0,0,0}, nasm_bytecodes+17049, IF_8086},
+    {I_ADC, 2, {REG_GPR|BITS32,MEMORY,0,0,0}, nasm_bytecodes+17054, IF_386|IF_SM},
+    {I_ADC, 2, {REG_GPR|BITS32,REG_GPR|BITS32,0,0,0}, nasm_bytecodes+17054, IF_386},
+    {I_ADC, 2, {REG_GPR|BITS64,MEMORY,0,0,0}, nasm_bytecodes+17059, IF_X64|IF_SM},
+    {I_ADC, 2, {REG_GPR|BITS64,REG_GPR|BITS64,0,0,0}, nasm_bytecodes+17059, IF_X64},
+    {I_ADC, 2, {RM_GPR|BITS16,IMMEDIATE|BITS8,0,0,0}, nasm_bytecodes+13536, IF_8086},
+    {I_ADC, 2, {RM_GPR|BITS32,IMMEDIATE|BITS8,0,0,0}, nasm_bytecodes+13542, IF_386},
+    {I_ADC, 2, {RM_GPR|BITS64,IMMEDIATE|BITS8,0,0,0}, nasm_bytecodes+13548, IF_X64},
+    {I_ADC, 2, {REG_AL,IMMEDIATE,0,0,0}, nasm_bytecodes+18934, IF_8086|IF_SM},
+    {I_ADC, 2, {REG_AX,SBYTE16,0,0,0}, nasm_bytecodes+13536, IF_8086|IF_SM},
+    {I_ADC, 2, {REG_AX,IMMEDIATE,0,0,0}, nasm_bytecodes+17064, IF_8086|IF_SM},
+    {I_ADC, 2, {REG_EAX,SBYTE32,0,0,0}, nasm_bytecodes+13542, IF_386|IF_SM},
+    {I_ADC, 2, {REG_EAX,IMMEDIATE,0,0,0}, nasm_bytecodes+17069, IF_386|IF_SM},
+    {I_ADC, 2, {REG_RAX,SBYTE64,0,0,0}, nasm_bytecodes+13548, IF_X64|IF_SM},
+    {I_ADC, 2, {REG_RAX,IMMEDIATE,0,0,0}, nasm_bytecodes+17074, IF_X64|IF_SM},
+    {I_ADC, 2, {RM_GPR|BITS8,IMMEDIATE,0,0,0}, nasm_bytecodes+17079, IF_8086|IF_SM},
+    {I_ADC, 2, {RM_GPR|BITS16,IMMEDIATE,0,0,0}, nasm_bytecodes+13554, IF_8086|IF_SM},
+    {I_ADC, 2, {RM_GPR|BITS32,IMMEDIATE,0,0,0}, nasm_bytecodes+13560, IF_386|IF_SM},
+    {I_ADC, 2, {RM_GPR|BITS64,IMMEDIATE,0,0,0}, nasm_bytecodes+13566, IF_X64|IF_SM},
+    {I_ADC, 2, {MEMORY,IMMEDIATE|BITS8,0,0,0}, nasm_bytecodes+17079, IF_8086|IF_SM},
+    {I_ADC, 2, {MEMORY,IMMEDIATE|BITS16,0,0,0}, nasm_bytecodes+13554, IF_8086|IF_SM},
+    {I_ADC, 2, {MEMORY,IMMEDIATE|BITS32,0,0,0}, nasm_bytecodes+13560, IF_386|IF_SM},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_ADD[] = {
+    {I_ADD, 2, {MEMORY,REG_GPR|BITS8,0,0,0}, nasm_bytecodes+18938, IF_8086|IF_SM},
+    {I_ADD, 2, {REG_GPR|BITS8,REG_GPR|BITS8,0,0,0}, nasm_bytecodes+18938, IF_8086},
+    {I_ADD, 2, {MEMORY,REG_GPR|BITS16,0,0,0}, nasm_bytecodes+17084, IF_8086|IF_SM},
+    {I_ADD, 2, {REG_GPR|BITS16,REG_GPR|BITS16,0,0,0}, nasm_bytecodes+17084, IF_8086},
+    {I_ADD, 2, {MEMORY,REG_GPR|BITS32,0,0,0}, nasm_bytecodes+17089, IF_386|IF_SM},
+    {I_ADD, 2, {REG_GPR|BITS32,REG_GPR|BITS32,0,0,0}, nasm_bytecodes+17089, IF_386},
+    {I_ADD, 2, {MEMORY,REG_GPR|BITS64,0,0,0}, nasm_bytecodes+17094, IF_X64|IF_SM},
+    {I_ADD, 2, {REG_GPR|BITS64,REG_GPR|BITS64,0,0,0}, nasm_bytecodes+17094, IF_X64},
+    {I_ADD, 2, {REG_GPR|BITS8,MEMORY,0,0,0}, nasm_bytecodes+10879, IF_8086|IF_SM},
+    {I_ADD, 2, {REG_GPR|BITS8,REG_GPR|BITS8,0,0,0}, nasm_bytecodes+10879, IF_8086},
+    {I_ADD, 2, {REG_GPR|BITS16,MEMORY,0,0,0}, nasm_bytecodes+17099, IF_8086|IF_SM},
+    {I_ADD, 2, {REG_GPR|BITS16,REG_GPR|BITS16,0,0,0}, nasm_bytecodes+17099, IF_8086},
+    {I_ADD, 2, {REG_GPR|BITS32,MEMORY,0,0,0}, nasm_bytecodes+17104, IF_386|IF_SM},
+    {I_ADD, 2, {REG_GPR|BITS32,REG_GPR|BITS32,0,0,0}, nasm_bytecodes+17104, IF_386},
+    {I_ADD, 2, {REG_GPR|BITS64,MEMORY,0,0,0}, nasm_bytecodes+17109, IF_X64|IF_SM},
+    {I_ADD, 2, {REG_GPR|BITS64,REG_GPR|BITS64,0,0,0}, nasm_bytecodes+17109, IF_X64},
+    {I_ADD, 2, {RM_GPR|BITS16,IMMEDIATE|BITS8,0,0,0}, nasm_bytecodes+13572, IF_8086},
+    {I_ADD, 2, {RM_GPR|BITS32,IMMEDIATE|BITS8,0,0,0}, nasm_bytecodes+13578, IF_386},
+    {I_ADD, 2, {RM_GPR|BITS64,IMMEDIATE|BITS8,0,0,0}, nasm_bytecodes+13584, IF_X64},
+    {I_ADD, 2, {REG_AL,IMMEDIATE,0,0,0}, nasm_bytecodes+18942, IF_8086|IF_SM},
+    {I_ADD, 2, {REG_AX,SBYTE16,0,0,0}, nasm_bytecodes+13572, IF_8086|IF_SM},
+    {I_ADD, 2, {REG_AX,IMMEDIATE,0,0,0}, nasm_bytecodes+17114, IF_8086|IF_SM},
+    {I_ADD, 2, {REG_EAX,SBYTE32,0,0,0}, nasm_bytecodes+13578, IF_386|IF_SM},
+    {I_ADD, 2, {REG_EAX,IMMEDIATE,0,0,0}, nasm_bytecodes+17119, IF_386|IF_SM},
+    {I_ADD, 2, {REG_RAX,SBYTE64,0,0,0}, nasm_bytecodes+13584, IF_X64|IF_SM},
+    {I_ADD, 2, {REG_RAX,IMMEDIATE,0,0,0}, nasm_bytecodes+17124, IF_X64|IF_SM},
+    {I_ADD, 2, {RM_GPR|BITS8,IMMEDIATE,0,0,0}, nasm_bytecodes+17129, IF_8086|IF_SM},
+    {I_ADD, 2, {RM_GPR|BITS16,IMMEDIATE,0,0,0}, nasm_bytecodes+13590, IF_8086|IF_SM},
+    {I_ADD, 2, {RM_GPR|BITS32,IMMEDIATE,0,0,0}, nasm_bytecodes+13596, IF_386|IF_SM},
+    {I_ADD, 2, {RM_GPR|BITS64,IMMEDIATE,0,0,0}, nasm_bytecodes+13602, IF_X64|IF_SM},
+    {I_ADD, 2, {MEMORY,IMMEDIATE|BITS8,0,0,0}, nasm_bytecodes+17129, IF_8086|IF_SM},
+    {I_ADD, 2, {MEMORY,IMMEDIATE|BITS16,0,0,0}, nasm_bytecodes+13590, IF_8086|IF_SM},
+    {I_ADD, 2, {MEMORY,IMMEDIATE|BITS32,0,0,0}, nasm_bytecodes+13596, IF_386|IF_SM},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_ADDPD[] = {
+    {I_ADDPD, 2, {XMMREG,RM_XMM,0,0,0}, nasm_bytecodes+15468, IF_WILLAMETTE|IF_SSE2|IF_SO},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_ADDPS[] = {
+    {I_ADDPS, 2, {XMMREG,RM_XMM,0,0,0}, nasm_bytecodes+14766, IF_KATMAI|IF_SSE},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_ADDSD[] = {
+    {I_ADDSD, 2, {XMMREG,RM_XMM,0,0,0}, nasm_bytecodes+15474, IF_WILLAMETTE|IF_SSE2|IF_SQ},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_ADDSS[] = {
+    {I_ADDSS, 2, {XMMREG,RM_XMM,0,0,0}, nasm_bytecodes+14772, IF_KATMAI|IF_SSE|IF_SD},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_ADDSUBPD[] = {
+    {I_ADDSUBPD, 2, {XMMREG,RM_XMM,0,0,0}, nasm_bytecodes+15744, IF_PRESCOTT|IF_SSE3|IF_SO},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_ADDSUBPS[] = {
+    {I_ADDSUBPS, 2, {XMMREG,RM_XMM,0,0,0}, nasm_bytecodes+15750, IF_PRESCOTT|IF_SSE3|IF_SO},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_AESDEC[] = {
+    {I_AESDEC, 2, {XMMREG,RM_XMM|BITS128,0,0,0}, nasm_bytecodes+8727, IF_SSE|IF_WESTMERE},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_AESDECLAST[] = {
+    {I_AESDECLAST, 2, {XMMREG,RM_XMM|BITS128,0,0,0}, nasm_bytecodes+8734, IF_SSE|IF_WESTMERE},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_AESENC[] = {
+    {I_AESENC, 2, {XMMREG,RM_XMM|BITS128,0,0,0}, nasm_bytecodes+8713, IF_SSE|IF_WESTMERE},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_AESENCLAST[] = {
+    {I_AESENCLAST, 2, {XMMREG,RM_XMM|BITS128,0,0,0}, nasm_bytecodes+8720, IF_SSE|IF_WESTMERE},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_AESIMC[] = {
+    {I_AESIMC, 2, {XMMREG,RM_XMM|BITS128,0,0,0}, nasm_bytecodes+8741, IF_SSE|IF_WESTMERE},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_AESKEYGENASSIST[] = {
+    {I_AESKEYGENASSIST, 3, {XMMREG,RM_XMM|BITS128,IMMEDIATE|BITS8,0,0}, nasm_bytecodes+6108, IF_SSE|IF_WESTMERE},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_AND[] = {
+    {I_AND, 2, {MEMORY,REG_GPR|BITS8,0,0,0}, nasm_bytecodes+18946, IF_8086|IF_SM},
+    {I_AND, 2, {REG_GPR|BITS8,REG_GPR|BITS8,0,0,0}, nasm_bytecodes+18946, IF_8086},
+    {I_AND, 2, {MEMORY,REG_GPR|BITS16,0,0,0}, nasm_bytecodes+17134, IF_8086|IF_SM},
+    {I_AND, 2, {REG_GPR|BITS16,REG_GPR|BITS16,0,0,0}, nasm_bytecodes+17134, IF_8086},
+    {I_AND, 2, {MEMORY,REG_GPR|BITS32,0,0,0}, nasm_bytecodes+17139, IF_386|IF_SM},
+    {I_AND, 2, {REG_GPR|BITS32,REG_GPR|BITS32,0,0,0}, nasm_bytecodes+17139, IF_386},
+    {I_AND, 2, {MEMORY,REG_GPR|BITS64,0,0,0}, nasm_bytecodes+17144, IF_X64|IF_SM},
+    {I_AND, 2, {REG_GPR|BITS64,REG_GPR|BITS64,0,0,0}, nasm_bytecodes+17144, IF_X64},
+    {I_AND, 2, {REG_GPR|BITS8,MEMORY,0,0,0}, nasm_bytecodes+11166, IF_8086|IF_SM},
+    {I_AND, 2, {REG_GPR|BITS8,REG_GPR|BITS8,0,0,0}, nasm_bytecodes+11166, IF_8086},
+    {I_AND, 2, {REG_GPR|BITS16,MEMORY,0,0,0}, nasm_bytecodes+17149, IF_8086|IF_SM},
+    {I_AND, 2, {REG_GPR|BITS16,REG_GPR|BITS16,0,0,0}, nasm_bytecodes+17149, IF_8086},
+    {I_AND, 2, {REG_GPR|BITS32,MEMORY,0,0,0}, nasm_bytecodes+17154, IF_386|IF_SM},
+    {I_AND, 2, {REG_GPR|BITS32,REG_GPR|BITS32,0,0,0}, nasm_bytecodes+17154, IF_386},
+    {I_AND, 2, {REG_GPR|BITS64,MEMORY,0,0,0}, nasm_bytecodes+17159, IF_X64|IF_SM},
+    {I_AND, 2, {REG_GPR|BITS64,REG_GPR|BITS64,0,0,0}, nasm_bytecodes+17159, IF_X64},
+    {I_AND, 2, {RM_GPR|BITS16,IMMEDIATE|BITS8,0,0,0}, nasm_bytecodes+13608, IF_8086},
+    {I_AND, 2, {RM_GPR|BITS32,IMMEDIATE|BITS8,0,0,0}, nasm_bytecodes+13614, IF_386},
+    {I_AND, 2, {RM_GPR|BITS64,IMMEDIATE|BITS8,0,0,0}, nasm_bytecodes+13620, IF_X64},
+    {I_AND, 2, {REG_AL,IMMEDIATE,0,0,0}, nasm_bytecodes+18950, IF_8086|IF_SM},
+    {I_AND, 2, {REG_AX,SBYTE16,0,0,0}, nasm_bytecodes+13608, IF_8086|IF_SM},
+    {I_AND, 2, {REG_AX,IMMEDIATE,0,0,0}, nasm_bytecodes+17164, IF_8086|IF_SM},
+    {I_AND, 2, {REG_EAX,SBYTE32,0,0,0}, nasm_bytecodes+13614, IF_386|IF_SM},
+    {I_AND, 2, {REG_EAX,IMMEDIATE,0,0,0}, nasm_bytecodes+17169, IF_386|IF_SM},
+    {I_AND, 2, {REG_RAX,SBYTE64,0,0,0}, nasm_bytecodes+13620, IF_X64|IF_SM},
+    {I_AND, 2, {REG_RAX,IMMEDIATE,0,0,0}, nasm_bytecodes+17174, IF_X64|IF_SM},
+    {I_AND, 2, {RM_GPR|BITS8,IMMEDIATE,0,0,0}, nasm_bytecodes+17179, IF_8086|IF_SM},
+    {I_AND, 2, {RM_GPR|BITS16,IMMEDIATE,0,0,0}, nasm_bytecodes+13626, IF_8086|IF_SM},
+    {I_AND, 2, {RM_GPR|BITS32,IMMEDIATE,0,0,0}, nasm_bytecodes+13632, IF_386|IF_SM},
+    {I_AND, 2, {RM_GPR|BITS64,IMMEDIATE,0,0,0}, nasm_bytecodes+13638, IF_X64|IF_SM},
+    {I_AND, 2, {MEMORY,IMMEDIATE|BITS8,0,0,0}, nasm_bytecodes+17179, IF_8086|IF_SM},
+    {I_AND, 2, {MEMORY,IMMEDIATE|BITS16,0,0,0}, nasm_bytecodes+13626, IF_8086|IF_SM},
+    {I_AND, 2, {MEMORY,IMMEDIATE|BITS32,0,0,0}, nasm_bytecodes+13632, IF_386|IF_SM},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_ANDNPD[] = {
+    {I_ANDNPD, 2, {XMMREG,RM_XMM,0,0,0}, nasm_bytecodes+15480, IF_WILLAMETTE|IF_SSE2|IF_SO},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_ANDNPS[] = {
+    {I_ANDNPS, 2, {XMMREG,RM_XMM,0,0,0}, nasm_bytecodes+14778, IF_KATMAI|IF_SSE},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_ANDPD[] = {
+    {I_ANDPD, 2, {XMMREG,RM_XMM,0,0,0}, nasm_bytecodes+15486, IF_WILLAMETTE|IF_SSE2|IF_SO},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_ANDPS[] = {
+    {I_ANDPS, 2, {XMMREG,RM_XMM,0,0,0}, nasm_bytecodes+14784, IF_KATMAI|IF_SSE},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_ARPL[] = {
+    {I_ARPL, 2, {MEMORY,REG_GPR|BITS16,0,0,0}, nasm_bytecodes+18954, IF_286|IF_PROT|IF_SM|IF_NOLONG},
+    {I_ARPL, 2, {REG_GPR|BITS16,REG_GPR|BITS16,0,0,0}, nasm_bytecodes+18954, IF_286|IF_PROT|IF_NOLONG},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_BB0_RESET[] = {
+    {I_BB0_RESET, 0, {0,0,0,0,0}, nasm_bytecodes+18958, IF_PENT|IF_CYRIX},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_BB1_RESET[] = {
+    {I_BB1_RESET, 0, {0,0,0,0,0}, nasm_bytecodes+18962, IF_PENT|IF_CYRIX},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_BLENDPD[] = {
+    {I_BLENDPD, 3, {XMMREG,RM_XMM,IMMEDIATE,0,0}, nasm_bytecodes+5940, IF_SSE41},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_BLENDPS[] = {
+    {I_BLENDPS, 3, {XMMREG,RM_XMM,IMMEDIATE,0,0}, nasm_bytecodes+5948, IF_SSE41},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_BLENDVPD[] = {
+    {I_BLENDVPD, 3, {XMMREG,RM_XMM,XMM0,0,0}, nasm_bytecodes+8433, IF_SSE41},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_BLENDVPS[] = {
+    {I_BLENDVPS, 3, {XMMREG,RM_XMM,XMM0,0,0}, nasm_bytecodes+8440, IF_SSE41},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_BOUND[] = {
+    {I_BOUND, 2, {REG_GPR|BITS16,MEMORY,0,0,0}, nasm_bytecodes+17184, IF_186|IF_NOLONG},
+    {I_BOUND, 2, {REG_GPR|BITS32,MEMORY,0,0,0}, nasm_bytecodes+17189, IF_386|IF_NOLONG},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_BSF[] = {
+    {I_BSF, 2, {REG_GPR|BITS16,MEMORY,0,0,0}, nasm_bytecodes+13644, IF_386|IF_SM},
+    {I_BSF, 2, {REG_GPR|BITS16,REG_GPR|BITS16,0,0,0}, nasm_bytecodes+13644, IF_386},
+    {I_BSF, 2, {REG_GPR|BITS32,MEMORY,0,0,0}, nasm_bytecodes+13650, IF_386|IF_SM},
+    {I_BSF, 2, {REG_GPR|BITS32,REG_GPR|BITS32,0,0,0}, nasm_bytecodes+13650, IF_386},
+    {I_BSF, 2, {REG_GPR|BITS64,MEMORY,0,0,0}, nasm_bytecodes+13656, IF_X64|IF_SM},
+    {I_BSF, 2, {REG_GPR|BITS64,REG_GPR|BITS64,0,0,0}, nasm_bytecodes+13656, IF_X64},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_BSR[] = {
+    {I_BSR, 2, {REG_GPR|BITS16,MEMORY,0,0,0}, nasm_bytecodes+13662, IF_386|IF_SM},
+    {I_BSR, 2, {REG_GPR|BITS16,REG_GPR|BITS16,0,0,0}, nasm_bytecodes+13662, IF_386},
+    {I_BSR, 2, {REG_GPR|BITS32,MEMORY,0,0,0}, nasm_bytecodes+13668, IF_386|IF_SM},
+    {I_BSR, 2, {REG_GPR|BITS32,REG_GPR|BITS32,0,0,0}, nasm_bytecodes+13668, IF_386},
+    {I_BSR, 2, {REG_GPR|BITS64,MEMORY,0,0,0}, nasm_bytecodes+13674, IF_X64|IF_SM},
+    {I_BSR, 2, {REG_GPR|BITS64,REG_GPR|BITS64,0,0,0}, nasm_bytecodes+13674, IF_X64},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_BSWAP[] = {
+    {I_BSWAP, 1, {REG_GPR|BITS32,0,0,0,0}, nasm_bytecodes+13680, IF_486},
+    {I_BSWAP, 1, {REG_GPR|BITS64,0,0,0,0}, nasm_bytecodes+13686, IF_X64},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_BT[] = {
+    {I_BT, 2, {MEMORY,REG_GPR|BITS16,0,0,0}, nasm_bytecodes+13692, IF_386|IF_SM},
+    {I_BT, 2, {REG_GPR|BITS16,REG_GPR|BITS16,0,0,0}, nasm_bytecodes+13692, IF_386},
+    {I_BT, 2, {MEMORY,REG_GPR|BITS32,0,0,0}, nasm_bytecodes+13698, IF_386|IF_SM},
+    {I_BT, 2, {REG_GPR|BITS32,REG_GPR|BITS32,0,0,0}, nasm_bytecodes+13698, IF_386},
+    {I_BT, 2, {MEMORY,REG_GPR|BITS64,0,0,0}, nasm_bytecodes+13704, IF_X64|IF_SM},
+    {I_BT, 2, {REG_GPR|BITS64,REG_GPR|BITS64,0,0,0}, nasm_bytecodes+13704, IF_X64},
+    {I_BT, 2, {RM_GPR|BITS16,IMMEDIATE,0,0,0}, nasm_bytecodes+7236, IF_386|IF_SB},
+    {I_BT, 2, {RM_GPR|BITS32,IMMEDIATE,0,0,0}, nasm_bytecodes+7243, IF_386|IF_SB},
+    {I_BT, 2, {RM_GPR|BITS64,IMMEDIATE,0,0,0}, nasm_bytecodes+7250, IF_X64|IF_SB},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_BTC[] = {
+    {I_BTC, 2, {MEMORY,REG_GPR|BITS16,0,0,0}, nasm_bytecodes+13710, IF_386|IF_SM},
+    {I_BTC, 2, {REG_GPR|BITS16,REG_GPR|BITS16,0,0,0}, nasm_bytecodes+13710, IF_386},
+    {I_BTC, 2, {MEMORY,REG_GPR|BITS32,0,0,0}, nasm_bytecodes+13716, IF_386|IF_SM},
+    {I_BTC, 2, {REG_GPR|BITS32,REG_GPR|BITS32,0,0,0}, nasm_bytecodes+13716, IF_386},
+    {I_BTC, 2, {MEMORY,REG_GPR|BITS64,0,0,0}, nasm_bytecodes+13722, IF_X64|IF_SM},
+    {I_BTC, 2, {REG_GPR|BITS64,REG_GPR|BITS64,0,0,0}, nasm_bytecodes+13722, IF_X64},
+    {I_BTC, 2, {RM_GPR|BITS16,IMMEDIATE,0,0,0}, nasm_bytecodes+7257, IF_386|IF_SB},
+    {I_BTC, 2, {RM_GPR|BITS32,IMMEDIATE,0,0,0}, nasm_bytecodes+7264, IF_386|IF_SB},
+    {I_BTC, 2, {RM_GPR|BITS64,IMMEDIATE,0,0,0}, nasm_bytecodes+7271, IF_X64|IF_SB},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_BTR[] = {
+    {I_BTR, 2, {MEMORY,REG_GPR|BITS16,0,0,0}, nasm_bytecodes+13728, IF_386|IF_SM},
+    {I_BTR, 2, {REG_GPR|BITS16,REG_GPR|BITS16,0,0,0}, nasm_bytecodes+13728, IF_386},
+    {I_BTR, 2, {MEMORY,REG_GPR|BITS32,0,0,0}, nasm_bytecodes+13734, IF_386|IF_SM},
+    {I_BTR, 2, {REG_GPR|BITS32,REG_GPR|BITS32,0,0,0}, nasm_bytecodes+13734, IF_386},
+    {I_BTR, 2, {MEMORY,REG_GPR|BITS64,0,0,0}, nasm_bytecodes+13740, IF_X64|IF_SM},
+    {I_BTR, 2, {REG_GPR|BITS64,REG_GPR|BITS64,0,0,0}, nasm_bytecodes+13740, IF_X64},
+    {I_BTR, 2, {RM_GPR|BITS16,IMMEDIATE,0,0,0}, nasm_bytecodes+7278, IF_386|IF_SB},
+    {I_BTR, 2, {RM_GPR|BITS32,IMMEDIATE,0,0,0}, nasm_bytecodes+7285, IF_386|IF_SB},
+    {I_BTR, 2, {RM_GPR|BITS64,IMMEDIATE,0,0,0}, nasm_bytecodes+7292, IF_X64|IF_SB},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_BTS[] = {
+    {I_BTS, 2, {MEMORY,REG_GPR|BITS16,0,0,0}, nasm_bytecodes+13746, IF_386|IF_SM},
+    {I_BTS, 2, {REG_GPR|BITS16,REG_GPR|BITS16,0,0,0}, nasm_bytecodes+13746, IF_386},
+    {I_BTS, 2, {MEMORY,REG_GPR|BITS32,0,0,0}, nasm_bytecodes+13752, IF_386|IF_SM},
+    {I_BTS, 2, {REG_GPR|BITS32,REG_GPR|BITS32,0,0,0}, nasm_bytecodes+13752, IF_386},
+    {I_BTS, 2, {MEMORY,REG_GPR|BITS64,0,0,0}, nasm_bytecodes+13758, IF_X64|IF_SM},
+    {I_BTS, 2, {REG_GPR|BITS64,REG_GPR|BITS64,0,0,0}, nasm_bytecodes+13758, IF_X64},
+    {I_BTS, 2, {RM_GPR|BITS16,IMMEDIATE,0,0,0}, nasm_bytecodes+7299, IF_386|IF_SB},
+    {I_BTS, 2, {RM_GPR|BITS32,IMMEDIATE,0,0,0}, nasm_bytecodes+7306, IF_386|IF_SB},
+    {I_BTS, 2, {RM_GPR|BITS64,IMMEDIATE,0,0,0}, nasm_bytecodes+7313, IF_X64|IF_SB},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_CALL[] = {
+    {I_CALL, 1, {IMMEDIATE,0,0,0,0}, nasm_bytecodes+17194, IF_8086},
+    {I_CALL, 1, {IMMEDIATE|NEAR,0,0,0,0}, nasm_bytecodes+17194, IF_8086},
+    {I_CALL, 1, {IMMEDIATE|FAR,0,0,0,0}, nasm_bytecodes+13764, IF_8086|IF_NOLONG},
+    {I_CALL, 1, {IMMEDIATE|BITS16,0,0,0,0}, nasm_bytecodes+17199, IF_8086},
+    {I_CALL, 1, {IMMEDIATE|BITS16|NEAR,0,0,0,0}, nasm_bytecodes+17199, IF_8086},
+    {I_CALL, 1, {IMMEDIATE|BITS16|FAR,0,0,0,0}, nasm_bytecodes+13770, IF_8086|IF_NOLONG},
+    {I_CALL, 1, {IMMEDIATE|BITS32,0,0,0,0}, nasm_bytecodes+17204, IF_386},
+    {I_CALL, 1, {IMMEDIATE|BITS32|NEAR,0,0,0,0}, nasm_bytecodes+17204, IF_386},
+    {I_CALL, 1, {IMMEDIATE|BITS32|FAR,0,0,0,0}, nasm_bytecodes+13776, IF_386|IF_NOLONG},
+    {I_CALL, 2, {IMMEDIATE|COLON,IMMEDIATE,0,0,0}, nasm_bytecodes+13782, IF_8086|IF_NOLONG},
+    {I_CALL, 2, {IMMEDIATE|BITS16|COLON,IMMEDIATE,0,0,0}, nasm_bytecodes+13788, IF_8086|IF_NOLONG},
+    {I_CALL, 2, {IMMEDIATE|COLON,IMMEDIATE|BITS16,0,0,0}, nasm_bytecodes+13788, IF_8086|IF_NOLONG},
+    {I_CALL, 2, {IMMEDIATE|BITS32|COLON,IMMEDIATE,0,0,0}, nasm_bytecodes+13794, IF_386|IF_NOLONG},
+    {I_CALL, 2, {IMMEDIATE|COLON,IMMEDIATE|BITS32,0,0,0}, nasm_bytecodes+13794, IF_386|IF_NOLONG},
+    {I_CALL, 1, {MEMORY|FAR,0,0,0,0}, nasm_bytecodes+17209, IF_8086|IF_NOLONG},
+    {I_CALL, 1, {MEMORY|FAR,0,0,0,0}, nasm_bytecodes+17214, IF_X64},
+    {I_CALL, 1, {MEMORY|BITS16|FAR,0,0,0,0}, nasm_bytecodes+17219, IF_8086},
+    {I_CALL, 1, {MEMORY|BITS32|FAR,0,0,0,0}, nasm_bytecodes+17224, IF_386},
+    {I_CALL, 1, {MEMORY|BITS64|FAR,0,0,0,0}, nasm_bytecodes+17214, IF_X64},
+    {I_CALL, 1, {MEMORY|NEAR,0,0,0,0}, nasm_bytecodes+17229, IF_8086},
+    {I_CALL, 1, {MEMORY|BITS16|NEAR,0,0,0,0}, nasm_bytecodes+17234, IF_8086},
+    {I_CALL, 1, {MEMORY|BITS32|NEAR,0,0,0,0}, nasm_bytecodes+17239, IF_386|IF_NOLONG},
+    {I_CALL, 1, {MEMORY|BITS64|NEAR,0,0,0,0}, nasm_bytecodes+17244, IF_X64},
+    {I_CALL, 1, {REG_GPR|BITS16,0,0,0,0}, nasm_bytecodes+17234, IF_8086},
+    {I_CALL, 1, {REG_GPR|BITS32,0,0,0,0}, nasm_bytecodes+17239, IF_386|IF_NOLONG},
+    {I_CALL, 1, {REG_GPR|BITS64,0,0,0,0}, nasm_bytecodes+17249, IF_X64},
+    {I_CALL, 1, {MEMORY,0,0,0,0}, nasm_bytecodes+17229, IF_8086},
+    {I_CALL, 1, {MEMORY|BITS16,0,0,0,0}, nasm_bytecodes+17234, IF_8086},
+    {I_CALL, 1, {MEMORY|BITS32,0,0,0,0}, nasm_bytecodes+17239, IF_386|IF_NOLONG},
+    {I_CALL, 1, {MEMORY|BITS64,0,0,0,0}, nasm_bytecodes+17249, IF_X64},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_CBW[] = {
+    {I_CBW, 0, {0,0,0,0,0}, nasm_bytecodes+18966, IF_8086},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_CDQ[] = {
+    {I_CDQ, 0, {0,0,0,0,0}, nasm_bytecodes+18970, IF_386},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_CDQE[] = {
+    {I_CDQE, 0, {0,0,0,0,0}, nasm_bytecodes+18974, IF_X64},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_CLC[] = {
+    {I_CLC, 0, {0,0,0,0,0}, nasm_bytecodes+18686, IF_8086},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_CLD[] = {
+    {I_CLD, 0, {0,0,0,0,0}, nasm_bytecodes+19968, IF_8086},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_CLFLUSH[] = {
+    {I_CLFLUSH, 1, {MEMORY,0,0,0,0}, nasm_bytecodes+18859, IF_WILLAMETTE|IF_SSE2},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_CLGI[] = {
+    {I_CLGI, 0, {0,0,0,0,0}, nasm_bytecodes+17254, IF_X64|IF_AMD},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_CLI[] = {
+    {I_CLI, 0, {0,0,0,0,0}, nasm_bytecodes+19971, IF_8086},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_CLTS[] = {
+    {I_CLTS, 0, {0,0,0,0,0}, nasm_bytecodes+18978, IF_286|IF_PRIV},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_CMC[] = {
+    {I_CMC, 0, {0,0,0,0,0}, nasm_bytecodes+19974, IF_8086},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_CMP[] = {
+    {I_CMP, 2, {MEMORY,REG_GPR|BITS8,0,0,0}, nasm_bytecodes+18982, IF_8086|IF_SM},
+    {I_CMP, 2, {REG_GPR|BITS8,REG_GPR|BITS8,0,0,0}, nasm_bytecodes+18982, IF_8086},
+    {I_CMP, 2, {MEMORY,REG_GPR|BITS16,0,0,0}, nasm_bytecodes+17259, IF_8086|IF_SM},
+    {I_CMP, 2, {REG_GPR|BITS16,REG_GPR|BITS16,0,0,0}, nasm_bytecodes+17259, IF_8086},
+    {I_CMP, 2, {MEMORY,REG_GPR|BITS32,0,0,0}, nasm_bytecodes+17264, IF_386|IF_SM},
+    {I_CMP, 2, {REG_GPR|BITS32,REG_GPR|BITS32,0,0,0}, nasm_bytecodes+17264, IF_386},
+    {I_CMP, 2, {MEMORY,REG_GPR|BITS64,0,0,0}, nasm_bytecodes+17269, IF_X64|IF_SM},
+    {I_CMP, 2, {REG_GPR|BITS64,REG_GPR|BITS64,0,0,0}, nasm_bytecodes+17269, IF_X64},
+    {I_CMP, 2, {REG_GPR|BITS8,MEMORY,0,0,0}, nasm_bytecodes+11124, IF_8086|IF_SM},
+    {I_CMP, 2, {REG_GPR|BITS8,REG_GPR|BITS8,0,0,0}, nasm_bytecodes+11124, IF_8086},
+    {I_CMP, 2, {REG_GPR|BITS16,MEMORY,0,0,0}, nasm_bytecodes+17274, IF_8086|IF_SM},
+    {I_CMP, 2, {REG_GPR|BITS16,REG_GPR|BITS16,0,0,0}, nasm_bytecodes+17274, IF_8086},
+    {I_CMP, 2, {REG_GPR|BITS32,MEMORY,0,0,0}, nasm_bytecodes+17279, IF_386|IF_SM},
+    {I_CMP, 2, {REG_GPR|BITS32,REG_GPR|BITS32,0,0,0}, nasm_bytecodes+17279, IF_386},
+    {I_CMP, 2, {REG_GPR|BITS64,MEMORY,0,0,0}, nasm_bytecodes+17284, IF_X64|IF_SM},
+    {I_CMP, 2, {REG_GPR|BITS64,REG_GPR|BITS64,0,0,0}, nasm_bytecodes+17284, IF_X64},
+    {I_CMP, 2, {RM_GPR|BITS16,IMMEDIATE|BITS8,0,0,0}, nasm_bytecodes+13800, IF_8086},
+    {I_CMP, 2, {RM_GPR|BITS32,IMMEDIATE|BITS8,0,0,0}, nasm_bytecodes+13806, IF_386},
+    {I_CMP, 2, {RM_GPR|BITS64,IMMEDIATE|BITS8,0,0,0}, nasm_bytecodes+13812, IF_X64},
+    {I_CMP, 2, {REG_AL,IMMEDIATE,0,0,0}, nasm_bytecodes+18986, IF_8086|IF_SM},
+    {I_CMP, 2, {REG_AX,SBYTE16,0,0,0}, nasm_bytecodes+13800, IF_8086|IF_SM},
+    {I_CMP, 2, {REG_AX,IMMEDIATE,0,0,0}, nasm_bytecodes+17289, IF_8086|IF_SM},
+    {I_CMP, 2, {REG_EAX,SBYTE32,0,0,0}, nasm_bytecodes+13806, IF_386|IF_SM},
+    {I_CMP, 2, {REG_EAX,IMMEDIATE,0,0,0}, nasm_bytecodes+17294, IF_386|IF_SM},
+    {I_CMP, 2, {REG_RAX,SBYTE64,0,0,0}, nasm_bytecodes+13812, IF_X64|IF_SM},
+    {I_CMP, 2, {REG_RAX,IMMEDIATE,0,0,0}, nasm_bytecodes+17299, IF_X64|IF_SM},
+    {I_CMP, 2, {RM_GPR|BITS8,IMMEDIATE,0,0,0}, nasm_bytecodes+17304, IF_8086|IF_SM},
+    {I_CMP, 2, {RM_GPR|BITS16,IMMEDIATE,0,0,0}, nasm_bytecodes+13818, IF_8086|IF_SM},
+    {I_CMP, 2, {RM_GPR|BITS32,IMMEDIATE,0,0,0}, nasm_bytecodes+13824, IF_386|IF_SM},
+    {I_CMP, 2, {RM_GPR|BITS64,IMMEDIATE,0,0,0}, nasm_bytecodes+13830, IF_X64|IF_SM},
+    {I_CMP, 2, {MEMORY,IMMEDIATE|BITS8,0,0,0}, nasm_bytecodes+17304, IF_8086|IF_SM},
+    {I_CMP, 2, {MEMORY,IMMEDIATE|BITS16,0,0,0}, nasm_bytecodes+13818, IF_8086|IF_SM},
+    {I_CMP, 2, {MEMORY,IMMEDIATE|BITS32,0,0,0}, nasm_bytecodes+13824, IF_386|IF_SM},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_CMPEQPD[] = {
+    {I_CMPEQPD, 2, {XMMREG,RM_XMM,0,0,0}, nasm_bytecodes+5764, IF_WILLAMETTE|IF_SSE2|IF_SO},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_CMPEQPS[] = {
+    {I_CMPEQPS, 2, {XMMREG,RM_XMM,0,0,0}, nasm_bytecodes+5588, IF_KATMAI|IF_SSE},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_CMPEQSD[] = {
+    {I_CMPEQSD, 2, {XMMREG,RM_XMM,0,0,0}, nasm_bytecodes+5772, IF_WILLAMETTE|IF_SSE2},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_CMPEQSS[] = {
+    {I_CMPEQSS, 2, {XMMREG,RM_XMM,0,0,0}, nasm_bytecodes+5596, IF_KATMAI|IF_SSE},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_CMPLEPD[] = {
+    {I_CMPLEPD, 2, {XMMREG,RM_XMM,0,0,0}, nasm_bytecodes+5780, IF_WILLAMETTE|IF_SSE2|IF_SO},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_CMPLEPS[] = {
+    {I_CMPLEPS, 2, {XMMREG,RM_XMM,0,0,0}, nasm_bytecodes+5604, IF_KATMAI|IF_SSE},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_CMPLESD[] = {
+    {I_CMPLESD, 2, {XMMREG,RM_XMM,0,0,0}, nasm_bytecodes+5788, IF_WILLAMETTE|IF_SSE2},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_CMPLESS[] = {
+    {I_CMPLESS, 2, {XMMREG,RM_XMM,0,0,0}, nasm_bytecodes+5612, IF_KATMAI|IF_SSE},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_CMPLTPD[] = {
+    {I_CMPLTPD, 2, {XMMREG,RM_XMM,0,0,0}, nasm_bytecodes+5796, IF_WILLAMETTE|IF_SSE2|IF_SO},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_CMPLTPS[] = {
+    {I_CMPLTPS, 2, {XMMREG,RM_XMM,0,0,0}, nasm_bytecodes+5620, IF_KATMAI|IF_SSE},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_CMPLTSD[] = {
+    {I_CMPLTSD, 2, {XMMREG,RM_XMM,0,0,0}, nasm_bytecodes+5804, IF_WILLAMETTE|IF_SSE2},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_CMPLTSS[] = {
+    {I_CMPLTSS, 2, {XMMREG,RM_XMM,0,0,0}, nasm_bytecodes+5628, IF_KATMAI|IF_SSE},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_CMPNEQPD[] = {
+    {I_CMPNEQPD, 2, {XMMREG,RM_XMM,0,0,0}, nasm_bytecodes+5812, IF_WILLAMETTE|IF_SSE2|IF_SO},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_CMPNEQPS[] = {
+    {I_CMPNEQPS, 2, {XMMREG,RM_XMM,0,0,0}, nasm_bytecodes+5636, IF_KATMAI|IF_SSE},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_CMPNEQSD[] = {
+    {I_CMPNEQSD, 2, {XMMREG,RM_XMM,0,0,0}, nasm_bytecodes+5820, IF_WILLAMETTE|IF_SSE2},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_CMPNEQSS[] = {
+    {I_CMPNEQSS, 2, {XMMREG,RM_XMM,0,0,0}, nasm_bytecodes+5644, IF_KATMAI|IF_SSE},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_CMPNLEPD[] = {
+    {I_CMPNLEPD, 2, {XMMREG,RM_XMM,0,0,0}, nasm_bytecodes+5828, IF_WILLAMETTE|IF_SSE2|IF_SO},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_CMPNLEPS[] = {
+    {I_CMPNLEPS, 2, {XMMREG,RM_XMM,0,0,0}, nasm_bytecodes+5652, IF_KATMAI|IF_SSE},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_CMPNLESD[] = {
+    {I_CMPNLESD, 2, {XMMREG,RM_XMM,0,0,0}, nasm_bytecodes+5836, IF_WILLAMETTE|IF_SSE2},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_CMPNLESS[] = {
+    {I_CMPNLESS, 2, {XMMREG,RM_XMM,0,0,0}, nasm_bytecodes+5660, IF_KATMAI|IF_SSE},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_CMPNLTPD[] = {
+    {I_CMPNLTPD, 2, {XMMREG,RM_XMM,0,0,0}, nasm_bytecodes+5844, IF_WILLAMETTE|IF_SSE2|IF_SO},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_CMPNLTPS[] = {
+    {I_CMPNLTPS, 2, {XMMREG,RM_XMM,0,0,0}, nasm_bytecodes+5668, IF_KATMAI|IF_SSE},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_CMPNLTSD[] = {
+    {I_CMPNLTSD, 2, {XMMREG,RM_XMM,0,0,0}, nasm_bytecodes+5852, IF_WILLAMETTE|IF_SSE2},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_CMPNLTSS[] = {
+    {I_CMPNLTSS, 2, {XMMREG,RM_XMM,0,0,0}, nasm_bytecodes+5676, IF_KATMAI|IF_SSE},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_CMPORDPD[] = {
+    {I_CMPORDPD, 2, {XMMREG,RM_XMM,0,0,0}, nasm_bytecodes+5860, IF_WILLAMETTE|IF_SSE2|IF_SO},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_CMPORDPS[] = {
+    {I_CMPORDPS, 2, {XMMREG,RM_XMM,0,0,0}, nasm_bytecodes+5684, IF_KATMAI|IF_SSE},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_CMPORDSD[] = {
+    {I_CMPORDSD, 2, {XMMREG,RM_XMM,0,0,0}, nasm_bytecodes+5868, IF_WILLAMETTE|IF_SSE2},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_CMPORDSS[] = {
+    {I_CMPORDSS, 2, {XMMREG,RM_XMM,0,0,0}, nasm_bytecodes+5692, IF_KATMAI|IF_SSE},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_CMPPD[] = {
+    {I_CMPPD, 3, {XMMREG,RM_XMM,IMMEDIATE,0,0}, nasm_bytecodes+8139, IF_WILLAMETTE|IF_SSE2|IF_SM2|IF_SB|IF_AR2},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_CMPPS[] = {
+    {I_CMPPS, 3, {XMMREG,MEMORY,IMMEDIATE,0,0}, nasm_bytecodes+7866, IF_KATMAI|IF_SSE|IF_SB|IF_AR2},
+    {I_CMPPS, 3, {XMMREG,XMMREG,IMMEDIATE,0,0}, nasm_bytecodes+7866, IF_KATMAI|IF_SSE|IF_SB|IF_AR2},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_CMPSB[] = {
+    {I_CMPSB, 0, {0,0,0,0,0}, nasm_bytecodes+18990, IF_8086},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_CMPSD[] = {
+    {I_CMPSD, 0, {0,0,0,0,0}, nasm_bytecodes+17309, IF_386},
+    {I_CMPSD, 3, {XMMREG,RM_XMM,IMMEDIATE,0,0}, nasm_bytecodes+8146, IF_WILLAMETTE|IF_SSE2|IF_SB|IF_AR2},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_CMPSQ[] = {
+    {I_CMPSQ, 0, {0,0,0,0,0}, nasm_bytecodes+17314, IF_X64},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_CMPSS[] = {
+    {I_CMPSS, 3, {XMMREG,MEMORY,IMMEDIATE,0,0}, nasm_bytecodes+7873, IF_KATMAI|IF_SSE|IF_SB|IF_AR2},
+    {I_CMPSS, 3, {XMMREG,XMMREG,IMMEDIATE,0,0}, nasm_bytecodes+7873, IF_KATMAI|IF_SSE|IF_SB|IF_AR2},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_CMPSW[] = {
+    {I_CMPSW, 0, {0,0,0,0,0}, nasm_bytecodes+17319, IF_8086},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_CMPUNORDPD[] = {
+    {I_CMPUNORDPD, 2, {XMMREG,RM_XMM,0,0,0}, nasm_bytecodes+5876, IF_WILLAMETTE|IF_SSE2|IF_SO},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_CMPUNORDPS[] = {
+    {I_CMPUNORDPS, 2, {XMMREG,RM_XMM,0,0,0}, nasm_bytecodes+5700, IF_KATMAI|IF_SSE},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_CMPUNORDSD[] = {
+    {I_CMPUNORDSD, 2, {XMMREG,RM_XMM,0,0,0}, nasm_bytecodes+5884, IF_WILLAMETTE|IF_SSE2},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_CMPUNORDSS[] = {
+    {I_CMPUNORDSS, 2, {XMMREG,RM_XMM,0,0,0}, nasm_bytecodes+5708, IF_KATMAI|IF_SSE},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_CMPXCHG[] = {
+    {I_CMPXCHG, 2, {MEMORY,REG_GPR|BITS8,0,0,0}, nasm_bytecodes+17324, IF_PENT|IF_SM},
+    {I_CMPXCHG, 2, {REG_GPR|BITS8,REG_GPR|BITS8,0,0,0}, nasm_bytecodes+17324, IF_PENT},
+    {I_CMPXCHG, 2, {MEMORY,REG_GPR|BITS16,0,0,0}, nasm_bytecodes+13836, IF_PENT|IF_SM},
+    {I_CMPXCHG, 2, {REG_GPR|BITS16,REG_GPR|BITS16,0,0,0}, nasm_bytecodes+13836, IF_PENT},
+    {I_CMPXCHG, 2, {MEMORY,REG_GPR|BITS32,0,0,0}, nasm_bytecodes+13842, IF_PENT|IF_SM},
+    {I_CMPXCHG, 2, {REG_GPR|BITS32,REG_GPR|BITS32,0,0,0}, nasm_bytecodes+13842, IF_PENT},
+    {I_CMPXCHG, 2, {MEMORY,REG_GPR|BITS64,0,0,0}, nasm_bytecodes+13848, IF_X64|IF_SM},
+    {I_CMPXCHG, 2, {REG_GPR|BITS64,REG_GPR|BITS64,0,0,0}, nasm_bytecodes+13848, IF_X64},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_CMPXCHG16B[] = {
+    {I_CMPXCHG16B, 1, {MEMORY,0,0,0,0}, nasm_bytecodes+13866, IF_X64},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_CMPXCHG486[] = {
+    {I_CMPXCHG486, 2, {MEMORY,REG_GPR|BITS8,0,0,0}, nasm_bytecodes+17329, IF_486|IF_SM|IF_UNDOC},
+    {I_CMPXCHG486, 2, {REG_GPR|BITS8,REG_GPR|BITS8,0,0,0}, nasm_bytecodes+17329, IF_486|IF_UNDOC},
+    {I_CMPXCHG486, 2, {MEMORY,REG_GPR|BITS16,0,0,0}, nasm_bytecodes+13854, IF_486|IF_SM|IF_UNDOC},
+    {I_CMPXCHG486, 2, {REG_GPR|BITS16,REG_GPR|BITS16,0,0,0}, nasm_bytecodes+13854, IF_486|IF_UNDOC},
+    {I_CMPXCHG486, 2, {MEMORY,REG_GPR|BITS32,0,0,0}, nasm_bytecodes+13860, IF_486|IF_SM|IF_UNDOC},
+    {I_CMPXCHG486, 2, {REG_GPR|BITS32,REG_GPR|BITS32,0,0,0}, nasm_bytecodes+13860, IF_486|IF_UNDOC},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_CMPXCHG8B[] = {
+    {I_CMPXCHG8B, 1, {MEMORY,0,0,0,0}, nasm_bytecodes+13867, IF_PENT},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_COMISD[] = {
+    {I_COMISD, 2, {XMMREG,RM_XMM,0,0,0}, nasm_bytecodes+15492, IF_WILLAMETTE|IF_SSE2},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_COMISS[] = {
+    {I_COMISS, 2, {XMMREG,RM_XMM,0,0,0}, nasm_bytecodes+14790, IF_KATMAI|IF_SSE},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_CPUID[] = {
+    {I_CPUID, 0, {0,0,0,0,0}, nasm_bytecodes+18994, IF_PENT},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_CPU_READ[] = {
+    {I_CPU_READ, 0, {0,0,0,0,0}, nasm_bytecodes+18998, IF_PENT|IF_CYRIX},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_CPU_WRITE[] = {
+    {I_CPU_WRITE, 0, {0,0,0,0,0}, nasm_bytecodes+19002, IF_PENT|IF_CYRIX},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_CQO[] = {
+    {I_CQO, 0, {0,0,0,0,0}, nasm_bytecodes+19006, IF_X64},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_CRC32[] = {
+    {I_CRC32, 2, {REG_GPR|BITS32,RM_GPR|BITS8,0,0,0}, nasm_bytecodes+6045, IF_SSE42},
+    {I_CRC32, 2, {REG_GPR|BITS32,RM_GPR|BITS16,0,0,0}, nasm_bytecodes+6028, IF_SSE42},
+    {I_CRC32, 2, {REG_GPR|BITS32,RM_GPR|BITS32,0,0,0}, nasm_bytecodes+6036, IF_SSE42},
+    {I_CRC32, 2, {REG_GPR|BITS64,RM_GPR|BITS8,0,0,0}, nasm_bytecodes+6044, IF_SSE42|IF_X64},
+    {I_CRC32, 2, {REG_GPR|BITS64,RM_GPR|BITS64,0,0,0}, nasm_bytecodes+6052, IF_SSE42|IF_X64},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_CVTDQ2PD[] = {
+    {I_CVTDQ2PD, 2, {XMMREG,RM_XMM,0,0,0}, nasm_bytecodes+15498, IF_WILLAMETTE|IF_SSE2|IF_SQ},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_CVTDQ2PS[] = {
+    {I_CVTDQ2PS, 2, {XMMREG,RM_XMM,0,0,0}, nasm_bytecodes+15504, IF_WILLAMETTE|IF_SSE2|IF_SO},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_CVTPD2DQ[] = {
+    {I_CVTPD2DQ, 2, {XMMREG,RM_XMM,0,0,0}, nasm_bytecodes+15510, IF_WILLAMETTE|IF_SSE2|IF_SO},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_CVTPD2PI[] = {
+    {I_CVTPD2PI, 2, {MMXREG,RM_XMM,0,0,0}, nasm_bytecodes+15516, IF_WILLAMETTE|IF_SSE2|IF_SO},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_CVTPD2PS[] = {
+    {I_CVTPD2PS, 2, {XMMREG,RM_XMM,0,0,0}, nasm_bytecodes+15522, IF_WILLAMETTE|IF_SSE2|IF_SO},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_CVTPI2PD[] = {
+    {I_CVTPI2PD, 2, {XMMREG,RM_MMX,0,0,0}, nasm_bytecodes+15528, IF_WILLAMETTE|IF_SSE2|IF_SQ},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_CVTPI2PS[] = {
+    {I_CVTPI2PS, 2, {XMMREG,RM_MMX,0,0,0}, nasm_bytecodes+14796, IF_KATMAI|IF_SSE|IF_MMX|IF_SQ},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_CVTPS2DQ[] = {
+    {I_CVTPS2DQ, 2, {XMMREG,RM_XMM,0,0,0}, nasm_bytecodes+15534, IF_WILLAMETTE|IF_SSE2|IF_SO},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_CVTPS2PD[] = {
+    {I_CVTPS2PD, 2, {XMMREG,RM_XMM,0,0,0}, nasm_bytecodes+15540, IF_WILLAMETTE|IF_SSE2|IF_SQ},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_CVTPS2PI[] = {
+    {I_CVTPS2PI, 2, {MMXREG,RM_XMM,0,0,0}, nasm_bytecodes+14802, IF_KATMAI|IF_SSE|IF_MMX|IF_SQ},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_CVTSD2SI[] = {
+    {I_CVTSD2SI, 2, {REG_GPR|BITS32,XMMREG,0,0,0}, nasm_bytecodes+8154, IF_WILLAMETTE|IF_SSE2|IF_SQ|IF_AR1},
+    {I_CVTSD2SI, 2, {REG_GPR|BITS32,MEMORY,0,0,0}, nasm_bytecodes+8154, IF_WILLAMETTE|IF_SSE2|IF_SQ|IF_AR1},
+    {I_CVTSD2SI, 2, {REG_GPR|BITS64,XMMREG,0,0,0}, nasm_bytecodes+8153, IF_X64|IF_SSE2|IF_SQ|IF_AR1},
+    {I_CVTSD2SI, 2, {REG_GPR|BITS64,MEMORY,0,0,0}, nasm_bytecodes+8153, IF_X64|IF_SSE2|IF_SQ|IF_AR1},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_CVTSD2SS[] = {
+    {I_CVTSD2SS, 2, {XMMREG,RM_XMM,0,0,0}, nasm_bytecodes+15546, IF_WILLAMETTE|IF_SSE2|IF_SQ},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_CVTSI2SD[] = {
+    {I_CVTSI2SD, 2, {XMMREG,MEMORY,0,0,0}, nasm_bytecodes+8161, IF_WILLAMETTE|IF_SSE2|IF_SD|IF_AR1},
+    {I_CVTSI2SD, 2, {XMMREG,RM_GPR|BITS32,0,0,0}, nasm_bytecodes+8161, IF_WILLAMETTE|IF_SSE2|IF_SD|IF_AR1},
+    {I_CVTSI2SD, 2, {XMMREG,RM_GPR|BITS64,0,0,0}, nasm_bytecodes+8160, IF_X64|IF_SSE2|IF_SQ|IF_AR1},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_CVTSI2SS[] = {
+    {I_CVTSI2SS, 2, {XMMREG,MEMORY,0,0,0}, nasm_bytecodes+7881, IF_KATMAI|IF_SSE|IF_SD|IF_AR1},
+    {I_CVTSI2SS, 2, {XMMREG,RM_GPR|BITS32,0,0,0}, nasm_bytecodes+7881, IF_KATMAI|IF_SSE|IF_SD|IF_AR1},
+    {I_CVTSI2SS, 2, {XMMREG,RM_GPR|BITS64,0,0,0}, nasm_bytecodes+7880, IF_X64|IF_SSE|IF_SQ|IF_AR1},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_CVTSS2SD[] = {
+    {I_CVTSS2SD, 2, {XMMREG,RM_XMM,0,0,0}, nasm_bytecodes+15552, IF_WILLAMETTE|IF_SSE2|IF_SD},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_CVTSS2SI[] = {
+    {I_CVTSS2SI, 2, {REG_GPR|BITS32,XMMREG,0,0,0}, nasm_bytecodes+7888, IF_KATMAI|IF_SSE|IF_SD|IF_AR1},
+    {I_CVTSS2SI, 2, {REG_GPR|BITS32,MEMORY,0,0,0}, nasm_bytecodes+7888, IF_KATMAI|IF_SSE|IF_SD|IF_AR1},
+    {I_CVTSS2SI, 2, {REG_GPR|BITS64,XMMREG,0,0,0}, nasm_bytecodes+7887, IF_X64|IF_SSE|IF_SD|IF_AR1},
+    {I_CVTSS2SI, 2, {REG_GPR|BITS64,MEMORY,0,0,0}, nasm_bytecodes+7887, IF_X64|IF_SSE|IF_SD|IF_AR1},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_CVTTPD2DQ[] = {
+    {I_CVTTPD2DQ, 2, {XMMREG,RM_XMM,0,0,0}, nasm_bytecodes+15564, IF_WILLAMETTE|IF_SSE2|IF_SO},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_CVTTPD2PI[] = {
+    {I_CVTTPD2PI, 2, {MMXREG,RM_XMM,0,0,0}, nasm_bytecodes+15558, IF_WILLAMETTE|IF_SSE2|IF_SO},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_CVTTPS2DQ[] = {
+    {I_CVTTPS2DQ, 2, {XMMREG,RM_XMM,0,0,0}, nasm_bytecodes+15570, IF_WILLAMETTE|IF_SSE2|IF_SO},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_CVTTPS2PI[] = {
+    {I_CVTTPS2PI, 2, {MMXREG,RM_XMM,0,0,0}, nasm_bytecodes+14808, IF_KATMAI|IF_SSE|IF_MMX|IF_SQ},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_CVTTSD2SI[] = {
+    {I_CVTTSD2SI, 2, {REG_GPR|BITS32,XMMREG,0,0,0}, nasm_bytecodes+8168, IF_WILLAMETTE|IF_SSE2|IF_SQ|IF_AR1},
+    {I_CVTTSD2SI, 2, {REG_GPR|BITS32,MEMORY,0,0,0}, nasm_bytecodes+8168, IF_WILLAMETTE|IF_SSE2|IF_SQ|IF_AR1},
+    {I_CVTTSD2SI, 2, {REG_GPR|BITS64,XMMREG,0,0,0}, nasm_bytecodes+8167, IF_X64|IF_SSE2|IF_SQ|IF_AR1},
+    {I_CVTTSD2SI, 2, {REG_GPR|BITS64,MEMORY,0,0,0}, nasm_bytecodes+8167, IF_X64|IF_SSE2|IF_SQ|IF_AR1},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_CVTTSS2SI[] = {
+    {I_CVTTSS2SI, 2, {REG_GPR|BITS32,RM_XMM,0,0,0}, nasm_bytecodes+7895, IF_KATMAI|IF_SSE|IF_SD|IF_AR1},
+    {I_CVTTSS2SI, 2, {REG_GPR|BITS64,RM_XMM,0,0,0}, nasm_bytecodes+7894, IF_X64|IF_SSE|IF_SD|IF_AR1},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_CWD[] = {
+    {I_CWD, 0, {0,0,0,0,0}, nasm_bytecodes+19010, IF_8086},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_CWDE[] = {
+    {I_CWDE, 0, {0,0,0,0,0}, nasm_bytecodes+19014, IF_386},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_DAA[] = {
+    {I_DAA, 0, {0,0,0,0,0}, nasm_bytecodes+19977, IF_8086|IF_NOLONG},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_DAS[] = {
+    {I_DAS, 0, {0,0,0,0,0}, nasm_bytecodes+19980, IF_8086|IF_NOLONG},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_DB[] = {
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_DD[] = {
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_DEC[] = {
+    {I_DEC, 1, {REG_GPR|BITS16,0,0,0,0}, nasm_bytecodes+19018, IF_8086|IF_NOLONG},
+    {I_DEC, 1, {REG_GPR|BITS32,0,0,0,0}, nasm_bytecodes+19022, IF_386|IF_NOLONG},
+    {I_DEC, 1, {RM_GPR|BITS8,0,0,0,0}, nasm_bytecodes+19026, IF_8086},
+    {I_DEC, 1, {RM_GPR|BITS16,0,0,0,0}, nasm_bytecodes+17334, IF_8086},
+    {I_DEC, 1, {RM_GPR|BITS32,0,0,0,0}, nasm_bytecodes+17339, IF_386},
+    {I_DEC, 1, {RM_GPR|BITS64,0,0,0,0}, nasm_bytecodes+17344, IF_X64},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_DIV[] = {
+    {I_DIV, 1, {RM_GPR|BITS8,0,0,0,0}, nasm_bytecodes+19030, IF_8086},
+    {I_DIV, 1, {RM_GPR|BITS16,0,0,0,0}, nasm_bytecodes+17349, IF_8086},
+    {I_DIV, 1, {RM_GPR|BITS32,0,0,0,0}, nasm_bytecodes+17354, IF_386},
+    {I_DIV, 1, {RM_GPR|BITS64,0,0,0,0}, nasm_bytecodes+17359, IF_X64},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_DIVPD[] = {
+    {I_DIVPD, 2, {XMMREG,RM_XMM,0,0,0}, nasm_bytecodes+15576, IF_WILLAMETTE|IF_SSE2|IF_SO},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_DIVPS[] = {
+    {I_DIVPS, 2, {XMMREG,RM_XMM,0,0,0}, nasm_bytecodes+14814, IF_KATMAI|IF_SSE},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_DIVSD[] = {
+    {I_DIVSD, 2, {XMMREG,RM_XMM,0,0,0}, nasm_bytecodes+15582, IF_WILLAMETTE|IF_SSE2},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_DIVSS[] = {
+    {I_DIVSS, 2, {XMMREG,RM_XMM,0,0,0}, nasm_bytecodes+14820, IF_KATMAI|IF_SSE},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_DMINT[] = {
+    {I_DMINT, 0, {0,0,0,0,0}, nasm_bytecodes+19034, IF_P6|IF_CYRIX},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_DO[] = {
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_DPPD[] = {
+    {I_DPPD, 3, {XMMREG,RM_XMM,IMMEDIATE,0,0}, nasm_bytecodes+5956, IF_SSE41},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_DPPS[] = {
+    {I_DPPS, 3, {XMMREG,RM_XMM,IMMEDIATE,0,0}, nasm_bytecodes+5964, IF_SSE41},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_DQ[] = {
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_DT[] = {
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_DW[] = {
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_DY[] = {
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_EMMS[] = {
+    {I_EMMS, 0, {0,0,0,0,0}, nasm_bytecodes+19038, IF_PENT|IF_MMX},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_ENTER[] = {
+    {I_ENTER, 2, {IMMEDIATE,IMMEDIATE,0,0,0}, nasm_bytecodes+17364, IF_186},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_EQU[] = {
+    {I_EQU, 1, {IMMEDIATE,0,0,0,0}, nasm_bytecodes+5778, IF_8086},
+    {I_EQU, 2, {IMMEDIATE|COLON,IMMEDIATE,0,0,0}, nasm_bytecodes+5778, IF_8086},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_EXTRACTPS[] = {
+    {I_EXTRACTPS, 3, {RM_GPR|BITS32,XMMREG,IMMEDIATE,0,0}, nasm_bytecodes+1, IF_SSE41},
+    {I_EXTRACTPS, 3, {REG_GPR|BITS64,XMMREG,IMMEDIATE,0,0}, nasm_bytecodes+0, IF_SSE41|IF_X64},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_EXTRQ[] = {
+    {I_EXTRQ, 3, {XMMREG,IMMEDIATE,IMMEDIATE,0,0}, nasm_bytecodes+5924, IF_SSE4A|IF_AMD},
+    {I_EXTRQ, 2, {XMMREG,XMMREG,0,0,0}, nasm_bytecodes+15816, IF_SSE4A|IF_AMD},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_F2XM1[] = {
+    {I_F2XM1, 0, {0,0,0,0,0}, nasm_bytecodes+19042, IF_8086|IF_FPU},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_FABS[] = {
+    {I_FABS, 0, {0,0,0,0,0}, nasm_bytecodes+19046, IF_8086|IF_FPU},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_FADD[] = {
+    {I_FADD, 1, {MEMORY|BITS32,0,0,0,0}, nasm_bytecodes+19050, IF_8086|IF_FPU},
+    {I_FADD, 1, {MEMORY|BITS64,0,0,0,0}, nasm_bytecodes+19054, IF_8086|IF_FPU},
+    {I_FADD, 1, {FPUREG|TO,0,0,0,0}, nasm_bytecodes+17369, IF_8086|IF_FPU},
+    {I_FADD, 1, {FPUREG,0,0,0,0}, nasm_bytecodes+17374, IF_8086|IF_FPU},
+    {I_FADD, 2, {FPUREG,FPU0,0,0,0}, nasm_bytecodes+17369, IF_8086|IF_FPU},
+    {I_FADD, 2, {FPU0,FPUREG,0,0,0}, nasm_bytecodes+17379, IF_8086|IF_FPU},
+    {I_FADD, 0, {0,0,0,0,0}, nasm_bytecodes+19058, IF_8086|IF_FPU},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_FADDP[] = {
+    {I_FADDP, 1, {FPUREG,0,0,0,0}, nasm_bytecodes+17384, IF_8086|IF_FPU},
+    {I_FADDP, 2, {FPUREG,FPU0,0,0,0}, nasm_bytecodes+17384, IF_8086|IF_FPU},
+    {I_FADDP, 0, {0,0,0,0,0}, nasm_bytecodes+19058, IF_8086|IF_FPU},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_FBLD[] = {
+    {I_FBLD, 1, {MEMORY|BITS80,0,0,0,0}, nasm_bytecodes+19062, IF_8086|IF_FPU},
+    {I_FBLD, 1, {MEMORY,0,0,0,0}, nasm_bytecodes+19062, IF_8086|IF_FPU},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_FBSTP[] = {
+    {I_FBSTP, 1, {MEMORY|BITS80,0,0,0,0}, nasm_bytecodes+19066, IF_8086|IF_FPU},
+    {I_FBSTP, 1, {MEMORY,0,0,0,0}, nasm_bytecodes+19066, IF_8086|IF_FPU},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_FCHS[] = {
+    {I_FCHS, 0, {0,0,0,0,0}, nasm_bytecodes+19070, IF_8086|IF_FPU},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_FCLEX[] = {
+    {I_FCLEX, 0, {0,0,0,0,0}, nasm_bytecodes+17389, IF_8086|IF_FPU},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_FCMOVB[] = {
+    {I_FCMOVB, 1, {FPUREG,0,0,0,0}, nasm_bytecodes+17394, IF_P6|IF_FPU},
+    {I_FCMOVB, 2, {FPU0,FPUREG,0,0,0}, nasm_bytecodes+17399, IF_P6|IF_FPU},
+    {I_FCMOVB, 0, {0,0,0,0,0}, nasm_bytecodes+19074, IF_P6|IF_FPU},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_FCMOVBE[] = {
+    {I_FCMOVBE, 1, {FPUREG,0,0,0,0}, nasm_bytecodes+17404, IF_P6|IF_FPU},
+    {I_FCMOVBE, 2, {FPU0,FPUREG,0,0,0}, nasm_bytecodes+17409, IF_P6|IF_FPU},
+    {I_FCMOVBE, 0, {0,0,0,0,0}, nasm_bytecodes+19078, IF_P6|IF_FPU},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_FCMOVE[] = {
+    {I_FCMOVE, 1, {FPUREG,0,0,0,0}, nasm_bytecodes+17414, IF_P6|IF_FPU},
+    {I_FCMOVE, 2, {FPU0,FPUREG,0,0,0}, nasm_bytecodes+17419, IF_P6|IF_FPU},
+    {I_FCMOVE, 0, {0,0,0,0,0}, nasm_bytecodes+19082, IF_P6|IF_FPU},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_FCMOVNB[] = {
+    {I_FCMOVNB, 1, {FPUREG,0,0,0,0}, nasm_bytecodes+17424, IF_P6|IF_FPU},
+    {I_FCMOVNB, 2, {FPU0,FPUREG,0,0,0}, nasm_bytecodes+17429, IF_P6|IF_FPU},
+    {I_FCMOVNB, 0, {0,0,0,0,0}, nasm_bytecodes+19086, IF_P6|IF_FPU},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_FCMOVNBE[] = {
+    {I_FCMOVNBE, 1, {FPUREG,0,0,0,0}, nasm_bytecodes+17434, IF_P6|IF_FPU},
+    {I_FCMOVNBE, 2, {FPU0,FPUREG,0,0,0}, nasm_bytecodes+17439, IF_P6|IF_FPU},
+    {I_FCMOVNBE, 0, {0,0,0,0,0}, nasm_bytecodes+19090, IF_P6|IF_FPU},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_FCMOVNE[] = {
+    {I_FCMOVNE, 1, {FPUREG,0,0,0,0}, nasm_bytecodes+17444, IF_P6|IF_FPU},
+    {I_FCMOVNE, 2, {FPU0,FPUREG,0,0,0}, nasm_bytecodes+17449, IF_P6|IF_FPU},
+    {I_FCMOVNE, 0, {0,0,0,0,0}, nasm_bytecodes+19094, IF_P6|IF_FPU},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_FCMOVNU[] = {
+    {I_FCMOVNU, 1, {FPUREG,0,0,0,0}, nasm_bytecodes+17454, IF_P6|IF_FPU},
+    {I_FCMOVNU, 2, {FPU0,FPUREG,0,0,0}, nasm_bytecodes+17459, IF_P6|IF_FPU},
+    {I_FCMOVNU, 0, {0,0,0,0,0}, nasm_bytecodes+19098, IF_P6|IF_FPU},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_FCMOVU[] = {
+    {I_FCMOVU, 1, {FPUREG,0,0,0,0}, nasm_bytecodes+17464, IF_P6|IF_FPU},
+    {I_FCMOVU, 2, {FPU0,FPUREG,0,0,0}, nasm_bytecodes+17469, IF_P6|IF_FPU},
+    {I_FCMOVU, 0, {0,0,0,0,0}, nasm_bytecodes+19102, IF_P6|IF_FPU},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_FCOM[] = {
+    {I_FCOM, 1, {MEMORY|BITS32,0,0,0,0}, nasm_bytecodes+19106, IF_8086|IF_FPU},
+    {I_FCOM, 1, {MEMORY|BITS64,0,0,0,0}, nasm_bytecodes+19110, IF_8086|IF_FPU},
+    {I_FCOM, 1, {FPUREG,0,0,0,0}, nasm_bytecodes+17474, IF_8086|IF_FPU},
+    {I_FCOM, 2, {FPU0,FPUREG,0,0,0}, nasm_bytecodes+17479, IF_8086|IF_FPU},
+    {I_FCOM, 0, {0,0,0,0,0}, nasm_bytecodes+19114, IF_8086|IF_FPU},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_FCOMI[] = {
+    {I_FCOMI, 1, {FPUREG,0,0,0,0}, nasm_bytecodes+17484, IF_P6|IF_FPU},
+    {I_FCOMI, 2, {FPU0,FPUREG,0,0,0}, nasm_bytecodes+17489, IF_P6|IF_FPU},
+    {I_FCOMI, 0, {0,0,0,0,0}, nasm_bytecodes+19118, IF_P6|IF_FPU},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_FCOMIP[] = {
+    {I_FCOMIP, 1, {FPUREG,0,0,0,0}, nasm_bytecodes+17494, IF_P6|IF_FPU},
+    {I_FCOMIP, 2, {FPU0,FPUREG,0,0,0}, nasm_bytecodes+17499, IF_P6|IF_FPU},
+    {I_FCOMIP, 0, {0,0,0,0,0}, nasm_bytecodes+19122, IF_P6|IF_FPU},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_FCOMP[] = {
+    {I_FCOMP, 1, {MEMORY|BITS32,0,0,0,0}, nasm_bytecodes+19126, IF_8086|IF_FPU},
+    {I_FCOMP, 1, {MEMORY|BITS64,0,0,0,0}, nasm_bytecodes+19130, IF_8086|IF_FPU},
+    {I_FCOMP, 1, {FPUREG,0,0,0,0}, nasm_bytecodes+17504, IF_8086|IF_FPU},
+    {I_FCOMP, 2, {FPU0,FPUREG,0,0,0}, nasm_bytecodes+17509, IF_8086|IF_FPU},
+    {I_FCOMP, 0, {0,0,0,0,0}, nasm_bytecodes+19134, IF_8086|IF_FPU},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_FCOMPP[] = {
+    {I_FCOMPP, 0, {0,0,0,0,0}, nasm_bytecodes+19138, IF_8086|IF_FPU},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_FCOS[] = {
+    {I_FCOS, 0, {0,0,0,0,0}, nasm_bytecodes+19142, IF_386|IF_FPU},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_FDECSTP[] = {
+    {I_FDECSTP, 0, {0,0,0,0,0}, nasm_bytecodes+19146, IF_8086|IF_FPU},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_FDISI[] = {
+    {I_FDISI, 0, {0,0,0,0,0}, nasm_bytecodes+17514, IF_8086|IF_FPU},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_FDIV[] = {
+    {I_FDIV, 1, {MEMORY|BITS32,0,0,0,0}, nasm_bytecodes+19150, IF_8086|IF_FPU},
+    {I_FDIV, 1, {MEMORY|BITS64,0,0,0,0}, nasm_bytecodes+19154, IF_8086|IF_FPU},
+    {I_FDIV, 1, {FPUREG|TO,0,0,0,0}, nasm_bytecodes+17519, IF_8086|IF_FPU},
+    {I_FDIV, 1, {FPUREG,0,0,0,0}, nasm_bytecodes+17524, IF_8086|IF_FPU},
+    {I_FDIV, 2, {FPUREG,FPU0,0,0,0}, nasm_bytecodes+17519, IF_8086|IF_FPU},
+    {I_FDIV, 2, {FPU0,FPUREG,0,0,0}, nasm_bytecodes+17529, IF_8086|IF_FPU},
+    {I_FDIV, 0, {0,0,0,0,0}, nasm_bytecodes+19158, IF_8086|IF_FPU},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_FDIVP[] = {
+    {I_FDIVP, 1, {FPUREG,0,0,0,0}, nasm_bytecodes+17534, IF_8086|IF_FPU},
+    {I_FDIVP, 2, {FPUREG,FPU0,0,0,0}, nasm_bytecodes+17534, IF_8086|IF_FPU},
+    {I_FDIVP, 0, {0,0,0,0,0}, nasm_bytecodes+19158, IF_8086|IF_FPU},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_FDIVR[] = {
+    {I_FDIVR, 1, {MEMORY|BITS32,0,0,0,0}, nasm_bytecodes+19162, IF_8086|IF_FPU},
+    {I_FDIVR, 1, {MEMORY|BITS64,0,0,0,0}, nasm_bytecodes+19166, IF_8086|IF_FPU},
+    {I_FDIVR, 1, {FPUREG|TO,0,0,0,0}, nasm_bytecodes+17539, IF_8086|IF_FPU},
+    {I_FDIVR, 2, {FPUREG,FPU0,0,0,0}, nasm_bytecodes+17539, IF_8086|IF_FPU},
+    {I_FDIVR, 1, {FPUREG,0,0,0,0}, nasm_bytecodes+17544, IF_8086|IF_FPU},
+    {I_FDIVR, 2, {FPU0,FPUREG,0,0,0}, nasm_bytecodes+17549, IF_8086|IF_FPU},
+    {I_FDIVR, 0, {0,0,0,0,0}, nasm_bytecodes+19170, IF_8086|IF_FPU},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_FDIVRP[] = {
+    {I_FDIVRP, 1, {FPUREG,0,0,0,0}, nasm_bytecodes+17554, IF_8086|IF_FPU},
+    {I_FDIVRP, 2, {FPUREG,FPU0,0,0,0}, nasm_bytecodes+17554, IF_8086|IF_FPU},
+    {I_FDIVRP, 0, {0,0,0,0,0}, nasm_bytecodes+19170, IF_8086|IF_FPU},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_FEMMS[] = {
+    {I_FEMMS, 0, {0,0,0,0,0}, nasm_bytecodes+19174, IF_PENT|IF_3DNOW},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_FENI[] = {
+    {I_FENI, 0, {0,0,0,0,0}, nasm_bytecodes+17559, IF_8086|IF_FPU},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_FFREE[] = {
+    {I_FFREE, 1, {FPUREG,0,0,0,0}, nasm_bytecodes+17564, IF_8086|IF_FPU},
+    {I_FFREE, 0, {0,0,0,0,0}, nasm_bytecodes+19178, IF_8086|IF_FPU},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_FFREEP[] = {
+    {I_FFREEP, 1, {FPUREG,0,0,0,0}, nasm_bytecodes+17569, IF_286|IF_FPU|IF_UNDOC},
+    {I_FFREEP, 0, {0,0,0,0,0}, nasm_bytecodes+19182, IF_286|IF_FPU|IF_UNDOC},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_FIADD[] = {
+    {I_FIADD, 1, {MEMORY|BITS32,0,0,0,0}, nasm_bytecodes+19186, IF_8086|IF_FPU},
+    {I_FIADD, 1, {MEMORY|BITS16,0,0,0,0}, nasm_bytecodes+19190, IF_8086|IF_FPU},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_FICOM[] = {
+    {I_FICOM, 1, {MEMORY|BITS32,0,0,0,0}, nasm_bytecodes+19194, IF_8086|IF_FPU},
+    {I_FICOM, 1, {MEMORY|BITS16,0,0,0,0}, nasm_bytecodes+19198, IF_8086|IF_FPU},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_FICOMP[] = {
+    {I_FICOMP, 1, {MEMORY|BITS32,0,0,0,0}, nasm_bytecodes+19202, IF_8086|IF_FPU},
+    {I_FICOMP, 1, {MEMORY|BITS16,0,0,0,0}, nasm_bytecodes+19206, IF_8086|IF_FPU},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_FIDIV[] = {
+    {I_FIDIV, 1, {MEMORY|BITS32,0,0,0,0}, nasm_bytecodes+19210, IF_8086|IF_FPU},
+    {I_FIDIV, 1, {MEMORY|BITS16,0,0,0,0}, nasm_bytecodes+19214, IF_8086|IF_FPU},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_FIDIVR[] = {
+    {I_FIDIVR, 1, {MEMORY|BITS32,0,0,0,0}, nasm_bytecodes+19218, IF_8086|IF_FPU},
+    {I_FIDIVR, 1, {MEMORY|BITS16,0,0,0,0}, nasm_bytecodes+19222, IF_8086|IF_FPU},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_FILD[] = {
+    {I_FILD, 1, {MEMORY|BITS32,0,0,0,0}, nasm_bytecodes+19226, IF_8086|IF_FPU},
+    {I_FILD, 1, {MEMORY|BITS16,0,0,0,0}, nasm_bytecodes+19230, IF_8086|IF_FPU},
+    {I_FILD, 1, {MEMORY|BITS64,0,0,0,0}, nasm_bytecodes+19234, IF_8086|IF_FPU},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_FIMUL[] = {
+    {I_FIMUL, 1, {MEMORY|BITS32,0,0,0,0}, nasm_bytecodes+19238, IF_8086|IF_FPU},
+    {I_FIMUL, 1, {MEMORY|BITS16,0,0,0,0}, nasm_bytecodes+19242, IF_8086|IF_FPU},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_FINCSTP[] = {
+    {I_FINCSTP, 0, {0,0,0,0,0}, nasm_bytecodes+19246, IF_8086|IF_FPU},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_FINIT[] = {
+    {I_FINIT, 0, {0,0,0,0,0}, nasm_bytecodes+17574, IF_8086|IF_FPU},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_FIST[] = {
+    {I_FIST, 1, {MEMORY|BITS32,0,0,0,0}, nasm_bytecodes+19250, IF_8086|IF_FPU},
+    {I_FIST, 1, {MEMORY|BITS16,0,0,0,0}, nasm_bytecodes+19254, IF_8086|IF_FPU},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_FISTP[] = {
+    {I_FISTP, 1, {MEMORY|BITS32,0,0,0,0}, nasm_bytecodes+19258, IF_8086|IF_FPU},
+    {I_FISTP, 1, {MEMORY|BITS16,0,0,0,0}, nasm_bytecodes+19262, IF_8086|IF_FPU},
+    {I_FISTP, 1, {MEMORY|BITS64,0,0,0,0}, nasm_bytecodes+19266, IF_8086|IF_FPU},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_FISTTP[] = {
+    {I_FISTTP, 1, {MEMORY|BITS16,0,0,0,0}, nasm_bytecodes+19270, IF_PRESCOTT|IF_FPU},
+    {I_FISTTP, 1, {MEMORY|BITS32,0,0,0,0}, nasm_bytecodes+19274, IF_PRESCOTT|IF_FPU},
+    {I_FISTTP, 1, {MEMORY|BITS64,0,0,0,0}, nasm_bytecodes+19278, IF_PRESCOTT|IF_FPU},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_FISUB[] = {
+    {I_FISUB, 1, {MEMORY|BITS32,0,0,0,0}, nasm_bytecodes+19282, IF_8086|IF_FPU},
+    {I_FISUB, 1, {MEMORY|BITS16,0,0,0,0}, nasm_bytecodes+19286, IF_8086|IF_FPU},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_FISUBR[] = {
+    {I_FISUBR, 1, {MEMORY|BITS32,0,0,0,0}, nasm_bytecodes+19290, IF_8086|IF_FPU},
+    {I_FISUBR, 1, {MEMORY|BITS16,0,0,0,0}, nasm_bytecodes+19294, IF_8086|IF_FPU},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_FLD[] = {
+    {I_FLD, 1, {MEMORY|BITS32,0,0,0,0}, nasm_bytecodes+19298, IF_8086|IF_FPU},
+    {I_FLD, 1, {MEMORY|BITS64,0,0,0,0}, nasm_bytecodes+19302, IF_8086|IF_FPU},
+    {I_FLD, 1, {MEMORY|BITS80,0,0,0,0}, nasm_bytecodes+19306, IF_8086|IF_FPU},
+    {I_FLD, 1, {FPUREG,0,0,0,0}, nasm_bytecodes+17579, IF_8086|IF_FPU},
+    {I_FLD, 0, {0,0,0,0,0}, nasm_bytecodes+19310, IF_8086|IF_FPU},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_FLD1[] = {
+    {I_FLD1, 0, {0,0,0,0,0}, nasm_bytecodes+19314, IF_8086|IF_FPU},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_FLDCW[] = {
+    {I_FLDCW, 1, {MEMORY,0,0,0,0}, nasm_bytecodes+19318, IF_8086|IF_FPU|IF_SW},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_FLDENV[] = {
+    {I_FLDENV, 1, {MEMORY,0,0,0,0}, nasm_bytecodes+19322, IF_8086|IF_FPU},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_FLDL2E[] = {
+    {I_FLDL2E, 0, {0,0,0,0,0}, nasm_bytecodes+19326, IF_8086|IF_FPU},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_FLDL2T[] = {
+    {I_FLDL2T, 0, {0,0,0,0,0}, nasm_bytecodes+19330, IF_8086|IF_FPU},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_FLDLG2[] = {
+    {I_FLDLG2, 0, {0,0,0,0,0}, nasm_bytecodes+19334, IF_8086|IF_FPU},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_FLDLN2[] = {
+    {I_FLDLN2, 0, {0,0,0,0,0}, nasm_bytecodes+19338, IF_8086|IF_FPU},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_FLDPI[] = {
+    {I_FLDPI, 0, {0,0,0,0,0}, nasm_bytecodes+19342, IF_8086|IF_FPU},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_FLDZ[] = {
+    {I_FLDZ, 0, {0,0,0,0,0}, nasm_bytecodes+19346, IF_8086|IF_FPU},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_FMUL[] = {
+    {I_FMUL, 1, {MEMORY|BITS32,0,0,0,0}, nasm_bytecodes+19350, IF_8086|IF_FPU},
+    {I_FMUL, 1, {MEMORY|BITS64,0,0,0,0}, nasm_bytecodes+19354, IF_8086|IF_FPU},
+    {I_FMUL, 1, {FPUREG|TO,0,0,0,0}, nasm_bytecodes+17584, IF_8086|IF_FPU},
+    {I_FMUL, 2, {FPUREG,FPU0,0,0,0}, nasm_bytecodes+17584, IF_8086|IF_FPU},
+    {I_FMUL, 1, {FPUREG,0,0,0,0}, nasm_bytecodes+17589, IF_8086|IF_FPU},
+    {I_FMUL, 2, {FPU0,FPUREG,0,0,0}, nasm_bytecodes+17594, IF_8086|IF_FPU},
+    {I_FMUL, 0, {0,0,0,0,0}, nasm_bytecodes+19358, IF_8086|IF_FPU},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_FMULP[] = {
+    {I_FMULP, 1, {FPUREG,0,0,0,0}, nasm_bytecodes+17599, IF_8086|IF_FPU},
+    {I_FMULP, 2, {FPUREG,FPU0,0,0,0}, nasm_bytecodes+17599, IF_8086|IF_FPU},
+    {I_FMULP, 0, {0,0,0,0,0}, nasm_bytecodes+19358, IF_8086|IF_FPU},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_FNCLEX[] = {
+    {I_FNCLEX, 0, {0,0,0,0,0}, nasm_bytecodes+17390, IF_8086|IF_FPU},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_FNDISI[] = {
+    {I_FNDISI, 0, {0,0,0,0,0}, nasm_bytecodes+17515, IF_8086|IF_FPU},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_FNENI[] = {
+    {I_FNENI, 0, {0,0,0,0,0}, nasm_bytecodes+17560, IF_8086|IF_FPU},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_FNINIT[] = {
+    {I_FNINIT, 0, {0,0,0,0,0}, nasm_bytecodes+17575, IF_8086|IF_FPU},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_FNOP[] = {
+    {I_FNOP, 0, {0,0,0,0,0}, nasm_bytecodes+19362, IF_8086|IF_FPU},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_FNSAVE[] = {
+    {I_FNSAVE, 1, {MEMORY,0,0,0,0}, nasm_bytecodes+17605, IF_8086|IF_FPU},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_FNSTCW[] = {
+    {I_FNSTCW, 1, {MEMORY,0,0,0,0}, nasm_bytecodes+17615, IF_8086|IF_FPU|IF_SW},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_FNSTENV[] = {
+    {I_FNSTENV, 1, {MEMORY,0,0,0,0}, nasm_bytecodes+17620, IF_8086|IF_FPU},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_FNSTSW[] = {
+    {I_FNSTSW, 1, {MEMORY,0,0,0,0}, nasm_bytecodes+17630, IF_8086|IF_FPU|IF_SW},
+    {I_FNSTSW, 1, {REG_AX,0,0,0,0}, nasm_bytecodes+17635, IF_286|IF_FPU},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_FPATAN[] = {
+    {I_FPATAN, 0, {0,0,0,0,0}, nasm_bytecodes+19366, IF_8086|IF_FPU},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_FPREM[] = {
+    {I_FPREM, 0, {0,0,0,0,0}, nasm_bytecodes+19370, IF_8086|IF_FPU},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_FPREM1[] = {
+    {I_FPREM1, 0, {0,0,0,0,0}, nasm_bytecodes+19374, IF_386|IF_FPU},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_FPTAN[] = {
+    {I_FPTAN, 0, {0,0,0,0,0}, nasm_bytecodes+19378, IF_8086|IF_FPU},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_FRNDINT[] = {
+    {I_FRNDINT, 0, {0,0,0,0,0}, nasm_bytecodes+19382, IF_8086|IF_FPU},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_FRSTOR[] = {
+    {I_FRSTOR, 1, {MEMORY,0,0,0,0}, nasm_bytecodes+19386, IF_8086|IF_FPU},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_FSAVE[] = {
+    {I_FSAVE, 1, {MEMORY,0,0,0,0}, nasm_bytecodes+17604, IF_8086|IF_FPU},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_FSCALE[] = {
+    {I_FSCALE, 0, {0,0,0,0,0}, nasm_bytecodes+19390, IF_8086|IF_FPU},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_FSETPM[] = {
+    {I_FSETPM, 0, {0,0,0,0,0}, nasm_bytecodes+19394, IF_286|IF_FPU},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_FSIN[] = {
+    {I_FSIN, 0, {0,0,0,0,0}, nasm_bytecodes+19398, IF_386|IF_FPU},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_FSINCOS[] = {
+    {I_FSINCOS, 0, {0,0,0,0,0}, nasm_bytecodes+19402, IF_386|IF_FPU},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_FSQRT[] = {
+    {I_FSQRT, 0, {0,0,0,0,0}, nasm_bytecodes+19406, IF_8086|IF_FPU},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_FST[] = {
+    {I_FST, 1, {MEMORY|BITS32,0,0,0,0}, nasm_bytecodes+19410, IF_8086|IF_FPU},
+    {I_FST, 1, {MEMORY|BITS64,0,0,0,0}, nasm_bytecodes+19414, IF_8086|IF_FPU},
+    {I_FST, 1, {FPUREG,0,0,0,0}, nasm_bytecodes+17609, IF_8086|IF_FPU},
+    {I_FST, 0, {0,0,0,0,0}, nasm_bytecodes+19418, IF_8086|IF_FPU},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_FSTCW[] = {
+    {I_FSTCW, 1, {MEMORY,0,0,0,0}, nasm_bytecodes+17614, IF_8086|IF_FPU|IF_SW},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_FSTENV[] = {
+    {I_FSTENV, 1, {MEMORY,0,0,0,0}, nasm_bytecodes+17619, IF_8086|IF_FPU},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_FSTP[] = {
+    {I_FSTP, 1, {MEMORY|BITS32,0,0,0,0}, nasm_bytecodes+19422, IF_8086|IF_FPU},
+    {I_FSTP, 1, {MEMORY|BITS64,0,0,0,0}, nasm_bytecodes+19426, IF_8086|IF_FPU},
+    {I_FSTP, 1, {MEMORY|BITS80,0,0,0,0}, nasm_bytecodes+19430, IF_8086|IF_FPU},
+    {I_FSTP, 1, {FPUREG,0,0,0,0}, nasm_bytecodes+17624, IF_8086|IF_FPU},
+    {I_FSTP, 0, {0,0,0,0,0}, nasm_bytecodes+19434, IF_8086|IF_FPU},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_FSTSW[] = {
+    {I_FSTSW, 1, {MEMORY,0,0,0,0}, nasm_bytecodes+17629, IF_8086|IF_FPU|IF_SW},
+    {I_FSTSW, 1, {REG_AX,0,0,0,0}, nasm_bytecodes+17634, IF_286|IF_FPU},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_FSUB[] = {
+    {I_FSUB, 1, {MEMORY|BITS32,0,0,0,0}, nasm_bytecodes+19438, IF_8086|IF_FPU},
+    {I_FSUB, 1, {MEMORY|BITS64,0,0,0,0}, nasm_bytecodes+19442, IF_8086|IF_FPU},
+    {I_FSUB, 1, {FPUREG|TO,0,0,0,0}, nasm_bytecodes+17639, IF_8086|IF_FPU},
+    {I_FSUB, 2, {FPUREG,FPU0,0,0,0}, nasm_bytecodes+17639, IF_8086|IF_FPU},
+    {I_FSUB, 1, {FPUREG,0,0,0,0}, nasm_bytecodes+17644, IF_8086|IF_FPU},
+    {I_FSUB, 2, {FPU0,FPUREG,0,0,0}, nasm_bytecodes+17649, IF_8086|IF_FPU},
+    {I_FSUB, 0, {0,0,0,0,0}, nasm_bytecodes+19446, IF_8086|IF_FPU},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_FSUBP[] = {
+    {I_FSUBP, 1, {FPUREG,0,0,0,0}, nasm_bytecodes+17654, IF_8086|IF_FPU},
+    {I_FSUBP, 2, {FPUREG,FPU0,0,0,0}, nasm_bytecodes+17654, IF_8086|IF_FPU},
+    {I_FSUBP, 0, {0,0,0,0,0}, nasm_bytecodes+19446, IF_8086|IF_FPU},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_FSUBR[] = {
+    {I_FSUBR, 1, {MEMORY|BITS32,0,0,0,0}, nasm_bytecodes+19450, IF_8086|IF_FPU},
+    {I_FSUBR, 1, {MEMORY|BITS64,0,0,0,0}, nasm_bytecodes+19454, IF_8086|IF_FPU},
+    {I_FSUBR, 1, {FPUREG|TO,0,0,0,0}, nasm_bytecodes+17659, IF_8086|IF_FPU},
+    {I_FSUBR, 2, {FPUREG,FPU0,0,0,0}, nasm_bytecodes+17659, IF_8086|IF_FPU},
+    {I_FSUBR, 1, {FPUREG,0,0,0,0}, nasm_bytecodes+17664, IF_8086|IF_FPU},
+    {I_FSUBR, 2, {FPU0,FPUREG,0,0,0}, nasm_bytecodes+17669, IF_8086|IF_FPU},
+    {I_FSUBR, 0, {0,0,0,0,0}, nasm_bytecodes+19458, IF_8086|IF_FPU},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_FSUBRP[] = {
+    {I_FSUBRP, 1, {FPUREG,0,0,0,0}, nasm_bytecodes+17674, IF_8086|IF_FPU},
+    {I_FSUBRP, 2, {FPUREG,FPU0,0,0,0}, nasm_bytecodes+17674, IF_8086|IF_FPU},
+    {I_FSUBRP, 0, {0,0,0,0,0}, nasm_bytecodes+19458, IF_8086|IF_FPU},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_FTST[] = {
+    {I_FTST, 0, {0,0,0,0,0}, nasm_bytecodes+19462, IF_8086|IF_FPU},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_FUCOM[] = {
+    {I_FUCOM, 1, {FPUREG,0,0,0,0}, nasm_bytecodes+17679, IF_386|IF_FPU},
+    {I_FUCOM, 2, {FPU0,FPUREG,0,0,0}, nasm_bytecodes+17684, IF_386|IF_FPU},
+    {I_FUCOM, 0, {0,0,0,0,0}, nasm_bytecodes+19466, IF_386|IF_FPU},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_FUCOMI[] = {
+    {I_FUCOMI, 1, {FPUREG,0,0,0,0}, nasm_bytecodes+17689, IF_P6|IF_FPU},
+    {I_FUCOMI, 2, {FPU0,FPUREG,0,0,0}, nasm_bytecodes+17694, IF_P6|IF_FPU},
+    {I_FUCOMI, 0, {0,0,0,0,0}, nasm_bytecodes+19470, IF_P6|IF_FPU},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_FUCOMIP[] = {
+    {I_FUCOMIP, 1, {FPUREG,0,0,0,0}, nasm_bytecodes+17699, IF_P6|IF_FPU},
+    {I_FUCOMIP, 2, {FPU0,FPUREG,0,0,0}, nasm_bytecodes+17704, IF_P6|IF_FPU},
+    {I_FUCOMIP, 0, {0,0,0,0,0}, nasm_bytecodes+19474, IF_P6|IF_FPU},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_FUCOMP[] = {
+    {I_FUCOMP, 1, {FPUREG,0,0,0,0}, nasm_bytecodes+17709, IF_386|IF_FPU},
+    {I_FUCOMP, 2, {FPU0,FPUREG,0,0,0}, nasm_bytecodes+17714, IF_386|IF_FPU},
+    {I_FUCOMP, 0, {0,0,0,0,0}, nasm_bytecodes+19478, IF_386|IF_FPU},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_FUCOMPP[] = {
+    {I_FUCOMPP, 0, {0,0,0,0,0}, nasm_bytecodes+19482, IF_386|IF_FPU},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_FWAIT[] = {
+    {I_FWAIT, 0, {0,0,0,0,0}, nasm_bytecodes+19468, IF_8086},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_FXAM[] = {
+    {I_FXAM, 0, {0,0,0,0,0}, nasm_bytecodes+19486, IF_8086|IF_FPU},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_FXCH[] = {
+    {I_FXCH, 1, {FPUREG,0,0,0,0}, nasm_bytecodes+17719, IF_8086|IF_FPU},
+    {I_FXCH, 2, {FPUREG,FPU0,0,0,0}, nasm_bytecodes+17719, IF_8086|IF_FPU},
+    {I_FXCH, 2, {FPU0,FPUREG,0,0,0}, nasm_bytecodes+17724, IF_8086|IF_FPU},
+    {I_FXCH, 0, {0,0,0,0,0}, nasm_bytecodes+19490, IF_8086|IF_FPU},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_FXRSTOR[] = {
+    {I_FXRSTOR, 1, {MEMORY,0,0,0,0}, nasm_bytecodes+18849, IF_P6|IF_SSE|IF_FPU},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_FXSAVE[] = {
+    {I_FXSAVE, 1, {MEMORY,0,0,0,0}, nasm_bytecodes+18854, IF_P6|IF_SSE|IF_FPU},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_FXTRACT[] = {
+    {I_FXTRACT, 0, {0,0,0,0,0}, nasm_bytecodes+19494, IF_8086|IF_FPU},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_FYL2X[] = {
+    {I_FYL2X, 0, {0,0,0,0,0}, nasm_bytecodes+19498, IF_8086|IF_FPU},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_FYL2XP1[] = {
+    {I_FYL2XP1, 0, {0,0,0,0,0}, nasm_bytecodes+19502, IF_8086|IF_FPU},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_GETSEC[] = {
+    {I_GETSEC, 0, {0,0,0,0,0}, nasm_bytecodes+19958, IF_KATMAI},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_HADDPD[] = {
+    {I_HADDPD, 2, {XMMREG,RM_XMM,0,0,0}, nasm_bytecodes+15756, IF_PRESCOTT|IF_SSE3|IF_SO},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_HADDPS[] = {
+    {I_HADDPS, 2, {XMMREG,RM_XMM,0,0,0}, nasm_bytecodes+15762, IF_PRESCOTT|IF_SSE3|IF_SO},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_HINT_NOP0[] = {
+    {I_HINT_NOP0, 1, {RM_GPR|BITS16,0,0,0,0}, nasm_bytecodes+15900, IF_P6|IF_UNDOC},
+    {I_HINT_NOP0, 1, {RM_GPR|BITS32,0,0,0,0}, nasm_bytecodes+15906, IF_P6|IF_UNDOC},
+    {I_HINT_NOP0, 1, {RM_GPR|BITS64,0,0,0,0}, nasm_bytecodes+15912, IF_X64|IF_UNDOC},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_HINT_NOP1[] = {
+    {I_HINT_NOP1, 1, {RM_GPR|BITS16,0,0,0,0}, nasm_bytecodes+15918, IF_P6|IF_UNDOC},
+    {I_HINT_NOP1, 1, {RM_GPR|BITS32,0,0,0,0}, nasm_bytecodes+15924, IF_P6|IF_UNDOC},
+    {I_HINT_NOP1, 1, {RM_GPR|BITS64,0,0,0,0}, nasm_bytecodes+15930, IF_X64|IF_UNDOC},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_HINT_NOP10[] = {
+    {I_HINT_NOP10, 1, {RM_GPR|BITS16,0,0,0,0}, nasm_bytecodes+16080, IF_P6|IF_UNDOC},
+    {I_HINT_NOP10, 1, {RM_GPR|BITS32,0,0,0,0}, nasm_bytecodes+16086, IF_P6|IF_UNDOC},
+    {I_HINT_NOP10, 1, {RM_GPR|BITS64,0,0,0,0}, nasm_bytecodes+16092, IF_X64|IF_UNDOC},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_HINT_NOP11[] = {
+    {I_HINT_NOP11, 1, {RM_GPR|BITS16,0,0,0,0}, nasm_bytecodes+16098, IF_P6|IF_UNDOC},
+    {I_HINT_NOP11, 1, {RM_GPR|BITS32,0,0,0,0}, nasm_bytecodes+16104, IF_P6|IF_UNDOC},
+    {I_HINT_NOP11, 1, {RM_GPR|BITS64,0,0,0,0}, nasm_bytecodes+16110, IF_X64|IF_UNDOC},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_HINT_NOP12[] = {
+    {I_HINT_NOP12, 1, {RM_GPR|BITS16,0,0,0,0}, nasm_bytecodes+16116, IF_P6|IF_UNDOC},
+    {I_HINT_NOP12, 1, {RM_GPR|BITS32,0,0,0,0}, nasm_bytecodes+16122, IF_P6|IF_UNDOC},
+    {I_HINT_NOP12, 1, {RM_GPR|BITS64,0,0,0,0}, nasm_bytecodes+16128, IF_X64|IF_UNDOC},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_HINT_NOP13[] = {
+    {I_HINT_NOP13, 1, {RM_GPR|BITS16,0,0,0,0}, nasm_bytecodes+16134, IF_P6|IF_UNDOC},
+    {I_HINT_NOP13, 1, {RM_GPR|BITS32,0,0,0,0}, nasm_bytecodes+16140, IF_P6|IF_UNDOC},
+    {I_HINT_NOP13, 1, {RM_GPR|BITS64,0,0,0,0}, nasm_bytecodes+16146, IF_X64|IF_UNDOC},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_HINT_NOP14[] = {
+    {I_HINT_NOP14, 1, {RM_GPR|BITS16,0,0,0,0}, nasm_bytecodes+16152, IF_P6|IF_UNDOC},
+    {I_HINT_NOP14, 1, {RM_GPR|BITS32,0,0,0,0}, nasm_bytecodes+16158, IF_P6|IF_UNDOC},
+    {I_HINT_NOP14, 1, {RM_GPR|BITS64,0,0,0,0}, nasm_bytecodes+16164, IF_X64|IF_UNDOC},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_HINT_NOP15[] = {
+    {I_HINT_NOP15, 1, {RM_GPR|BITS16,0,0,0,0}, nasm_bytecodes+16170, IF_P6|IF_UNDOC},
+    {I_HINT_NOP15, 1, {RM_GPR|BITS32,0,0,0,0}, nasm_bytecodes+16176, IF_P6|IF_UNDOC},
+    {I_HINT_NOP15, 1, {RM_GPR|BITS64,0,0,0,0}, nasm_bytecodes+16182, IF_X64|IF_UNDOC},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_HINT_NOP16[] = {
+    {I_HINT_NOP16, 1, {RM_GPR|BITS16,0,0,0,0}, nasm_bytecodes+16188, IF_P6|IF_UNDOC},
+    {I_HINT_NOP16, 1, {RM_GPR|BITS32,0,0,0,0}, nasm_bytecodes+16194, IF_P6|IF_UNDOC},
+    {I_HINT_NOP16, 1, {RM_GPR|BITS64,0,0,0,0}, nasm_bytecodes+16200, IF_X64|IF_UNDOC},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_HINT_NOP17[] = {
+    {I_HINT_NOP17, 1, {RM_GPR|BITS16,0,0,0,0}, nasm_bytecodes+16206, IF_P6|IF_UNDOC},
+    {I_HINT_NOP17, 1, {RM_GPR|BITS32,0,0,0,0}, nasm_bytecodes+16212, IF_P6|IF_UNDOC},
+    {I_HINT_NOP17, 1, {RM_GPR|BITS64,0,0,0,0}, nasm_bytecodes+16218, IF_X64|IF_UNDOC},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_HINT_NOP18[] = {
+    {I_HINT_NOP18, 1, {RM_GPR|BITS16,0,0,0,0}, nasm_bytecodes+16224, IF_P6|IF_UNDOC},
+    {I_HINT_NOP18, 1, {RM_GPR|BITS32,0,0,0,0}, nasm_bytecodes+16230, IF_P6|IF_UNDOC},
+    {I_HINT_NOP18, 1, {RM_GPR|BITS64,0,0,0,0}, nasm_bytecodes+16236, IF_X64|IF_UNDOC},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_HINT_NOP19[] = {
+    {I_HINT_NOP19, 1, {RM_GPR|BITS16,0,0,0,0}, nasm_bytecodes+16242, IF_P6|IF_UNDOC},
+    {I_HINT_NOP19, 1, {RM_GPR|BITS32,0,0,0,0}, nasm_bytecodes+16248, IF_P6|IF_UNDOC},
+    {I_HINT_NOP19, 1, {RM_GPR|BITS64,0,0,0,0}, nasm_bytecodes+16254, IF_X64|IF_UNDOC},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_HINT_NOP2[] = {
+    {I_HINT_NOP2, 1, {RM_GPR|BITS16,0,0,0,0}, nasm_bytecodes+15936, IF_P6|IF_UNDOC},
+    {I_HINT_NOP2, 1, {RM_GPR|BITS32,0,0,0,0}, nasm_bytecodes+15942, IF_P6|IF_UNDOC},
+    {I_HINT_NOP2, 1, {RM_GPR|BITS64,0,0,0,0}, nasm_bytecodes+15948, IF_X64|IF_UNDOC},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_HINT_NOP20[] = {
+    {I_HINT_NOP20, 1, {RM_GPR|BITS16,0,0,0,0}, nasm_bytecodes+16260, IF_P6|IF_UNDOC},
+    {I_HINT_NOP20, 1, {RM_GPR|BITS32,0,0,0,0}, nasm_bytecodes+16266, IF_P6|IF_UNDOC},
+    {I_HINT_NOP20, 1, {RM_GPR|BITS64,0,0,0,0}, nasm_bytecodes+16272, IF_X64|IF_UNDOC},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_HINT_NOP21[] = {
+    {I_HINT_NOP21, 1, {RM_GPR|BITS16,0,0,0,0}, nasm_bytecodes+16278, IF_P6|IF_UNDOC},
+    {I_HINT_NOP21, 1, {RM_GPR|BITS32,0,0,0,0}, nasm_bytecodes+16284, IF_P6|IF_UNDOC},
+    {I_HINT_NOP21, 1, {RM_GPR|BITS64,0,0,0,0}, nasm_bytecodes+16290, IF_X64|IF_UNDOC},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_HINT_NOP22[] = {
+    {I_HINT_NOP22, 1, {RM_GPR|BITS16,0,0,0,0}, nasm_bytecodes+16296, IF_P6|IF_UNDOC},
+    {I_HINT_NOP22, 1, {RM_GPR|BITS32,0,0,0,0}, nasm_bytecodes+16302, IF_P6|IF_UNDOC},
+    {I_HINT_NOP22, 1, {RM_GPR|BITS64,0,0,0,0}, nasm_bytecodes+16308, IF_X64|IF_UNDOC},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_HINT_NOP23[] = {
+    {I_HINT_NOP23, 1, {RM_GPR|BITS16,0,0,0,0}, nasm_bytecodes+16314, IF_P6|IF_UNDOC},
+    {I_HINT_NOP23, 1, {RM_GPR|BITS32,0,0,0,0}, nasm_bytecodes+16320, IF_P6|IF_UNDOC},
+    {I_HINT_NOP23, 1, {RM_GPR|BITS64,0,0,0,0}, nasm_bytecodes+16326, IF_X64|IF_UNDOC},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_HINT_NOP24[] = {
+    {I_HINT_NOP24, 1, {RM_GPR|BITS16,0,0,0,0}, nasm_bytecodes+16332, IF_P6|IF_UNDOC},
+    {I_HINT_NOP24, 1, {RM_GPR|BITS32,0,0,0,0}, nasm_bytecodes+16338, IF_P6|IF_UNDOC},
+    {I_HINT_NOP24, 1, {RM_GPR|BITS64,0,0,0,0}, nasm_bytecodes+16344, IF_X64|IF_UNDOC},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_HINT_NOP25[] = {
+    {I_HINT_NOP25, 1, {RM_GPR|BITS16,0,0,0,0}, nasm_bytecodes+16350, IF_P6|IF_UNDOC},
+    {I_HINT_NOP25, 1, {RM_GPR|BITS32,0,0,0,0}, nasm_bytecodes+16356, IF_P6|IF_UNDOC},
+    {I_HINT_NOP25, 1, {RM_GPR|BITS64,0,0,0,0}, nasm_bytecodes+16362, IF_X64|IF_UNDOC},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_HINT_NOP26[] = {
+    {I_HINT_NOP26, 1, {RM_GPR|BITS16,0,0,0,0}, nasm_bytecodes+16368, IF_P6|IF_UNDOC},
+    {I_HINT_NOP26, 1, {RM_GPR|BITS32,0,0,0,0}, nasm_bytecodes+16374, IF_P6|IF_UNDOC},
+    {I_HINT_NOP26, 1, {RM_GPR|BITS64,0,0,0,0}, nasm_bytecodes+16380, IF_X64|IF_UNDOC},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_HINT_NOP27[] = {
+    {I_HINT_NOP27, 1, {RM_GPR|BITS16,0,0,0,0}, nasm_bytecodes+16386, IF_P6|IF_UNDOC},
+    {I_HINT_NOP27, 1, {RM_GPR|BITS32,0,0,0,0}, nasm_bytecodes+16392, IF_P6|IF_UNDOC},
+    {I_HINT_NOP27, 1, {RM_GPR|BITS64,0,0,0,0}, nasm_bytecodes+16398, IF_X64|IF_UNDOC},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_HINT_NOP28[] = {
+    {I_HINT_NOP28, 1, {RM_GPR|BITS16,0,0,0,0}, nasm_bytecodes+16404, IF_P6|IF_UNDOC},
+    {I_HINT_NOP28, 1, {RM_GPR|BITS32,0,0,0,0}, nasm_bytecodes+16410, IF_P6|IF_UNDOC},
+    {I_HINT_NOP28, 1, {RM_GPR|BITS64,0,0,0,0}, nasm_bytecodes+16416, IF_X64|IF_UNDOC},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_HINT_NOP29[] = {
+    {I_HINT_NOP29, 1, {RM_GPR|BITS16,0,0,0,0}, nasm_bytecodes+16422, IF_P6|IF_UNDOC},
+    {I_HINT_NOP29, 1, {RM_GPR|BITS32,0,0,0,0}, nasm_bytecodes+16428, IF_P6|IF_UNDOC},
+    {I_HINT_NOP29, 1, {RM_GPR|BITS64,0,0,0,0}, nasm_bytecodes+16434, IF_X64|IF_UNDOC},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_HINT_NOP3[] = {
+    {I_HINT_NOP3, 1, {RM_GPR|BITS16,0,0,0,0}, nasm_bytecodes+15954, IF_P6|IF_UNDOC},
+    {I_HINT_NOP3, 1, {RM_GPR|BITS32,0,0,0,0}, nasm_bytecodes+15960, IF_P6|IF_UNDOC},
+    {I_HINT_NOP3, 1, {RM_GPR|BITS64,0,0,0,0}, nasm_bytecodes+15966, IF_X64|IF_UNDOC},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_HINT_NOP30[] = {
+    {I_HINT_NOP30, 1, {RM_GPR|BITS16,0,0,0,0}, nasm_bytecodes+16440, IF_P6|IF_UNDOC},
+    {I_HINT_NOP30, 1, {RM_GPR|BITS32,0,0,0,0}, nasm_bytecodes+16446, IF_P6|IF_UNDOC},
+    {I_HINT_NOP30, 1, {RM_GPR|BITS64,0,0,0,0}, nasm_bytecodes+16452, IF_X64|IF_UNDOC},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_HINT_NOP31[] = {
+    {I_HINT_NOP31, 1, {RM_GPR|BITS16,0,0,0,0}, nasm_bytecodes+16458, IF_P6|IF_UNDOC},
+    {I_HINT_NOP31, 1, {RM_GPR|BITS32,0,0,0,0}, nasm_bytecodes+16464, IF_P6|IF_UNDOC},
+    {I_HINT_NOP31, 1, {RM_GPR|BITS64,0,0,0,0}, nasm_bytecodes+16470, IF_X64|IF_UNDOC},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_HINT_NOP32[] = {
+    {I_HINT_NOP32, 1, {RM_GPR|BITS16,0,0,0,0}, nasm_bytecodes+16476, IF_P6|IF_UNDOC},
+    {I_HINT_NOP32, 1, {RM_GPR|BITS32,0,0,0,0}, nasm_bytecodes+16482, IF_P6|IF_UNDOC},
+    {I_HINT_NOP32, 1, {RM_GPR|BITS64,0,0,0,0}, nasm_bytecodes+16488, IF_X64|IF_UNDOC},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_HINT_NOP33[] = {
+    {I_HINT_NOP33, 1, {RM_GPR|BITS16,0,0,0,0}, nasm_bytecodes+16494, IF_P6|IF_UNDOC},
+    {I_HINT_NOP33, 1, {RM_GPR|BITS32,0,0,0,0}, nasm_bytecodes+16500, IF_P6|IF_UNDOC},
+    {I_HINT_NOP33, 1, {RM_GPR|BITS64,0,0,0,0}, nasm_bytecodes+16506, IF_X64|IF_UNDOC},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_HINT_NOP34[] = {
+    {I_HINT_NOP34, 1, {RM_GPR|BITS16,0,0,0,0}, nasm_bytecodes+16512, IF_P6|IF_UNDOC},
+    {I_HINT_NOP34, 1, {RM_GPR|BITS32,0,0,0,0}, nasm_bytecodes+16518, IF_P6|IF_UNDOC},
+    {I_HINT_NOP34, 1, {RM_GPR|BITS64,0,0,0,0}, nasm_bytecodes+16524, IF_X64|IF_UNDOC},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_HINT_NOP35[] = {
+    {I_HINT_NOP35, 1, {RM_GPR|BITS16,0,0,0,0}, nasm_bytecodes+16530, IF_P6|IF_UNDOC},
+    {I_HINT_NOP35, 1, {RM_GPR|BITS32,0,0,0,0}, nasm_bytecodes+16536, IF_P6|IF_UNDOC},
+    {I_HINT_NOP35, 1, {RM_GPR|BITS64,0,0,0,0}, nasm_bytecodes+16542, IF_X64|IF_UNDOC},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_HINT_NOP36[] = {
+    {I_HINT_NOP36, 1, {RM_GPR|BITS16,0,0,0,0}, nasm_bytecodes+16548, IF_P6|IF_UNDOC},
+    {I_HINT_NOP36, 1, {RM_GPR|BITS32,0,0,0,0}, nasm_bytecodes+16554, IF_P6|IF_UNDOC},
+    {I_HINT_NOP36, 1, {RM_GPR|BITS64,0,0,0,0}, nasm_bytecodes+16560, IF_X64|IF_UNDOC},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_HINT_NOP37[] = {
+    {I_HINT_NOP37, 1, {RM_GPR|BITS16,0,0,0,0}, nasm_bytecodes+16566, IF_P6|IF_UNDOC},
+    {I_HINT_NOP37, 1, {RM_GPR|BITS32,0,0,0,0}, nasm_bytecodes+16572, IF_P6|IF_UNDOC},
+    {I_HINT_NOP37, 1, {RM_GPR|BITS64,0,0,0,0}, nasm_bytecodes+16578, IF_X64|IF_UNDOC},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_HINT_NOP38[] = {
+    {I_HINT_NOP38, 1, {RM_GPR|BITS16,0,0,0,0}, nasm_bytecodes+16584, IF_P6|IF_UNDOC},
+    {I_HINT_NOP38, 1, {RM_GPR|BITS32,0,0,0,0}, nasm_bytecodes+16590, IF_P6|IF_UNDOC},
+    {I_HINT_NOP38, 1, {RM_GPR|BITS64,0,0,0,0}, nasm_bytecodes+16596, IF_X64|IF_UNDOC},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_HINT_NOP39[] = {
+    {I_HINT_NOP39, 1, {RM_GPR|BITS16,0,0,0,0}, nasm_bytecodes+16602, IF_P6|IF_UNDOC},
+    {I_HINT_NOP39, 1, {RM_GPR|BITS32,0,0,0,0}, nasm_bytecodes+16608, IF_P6|IF_UNDOC},
+    {I_HINT_NOP39, 1, {RM_GPR|BITS64,0,0,0,0}, nasm_bytecodes+16614, IF_X64|IF_UNDOC},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_HINT_NOP4[] = {
+    {I_HINT_NOP4, 1, {RM_GPR|BITS16,0,0,0,0}, nasm_bytecodes+15972, IF_P6|IF_UNDOC},
+    {I_HINT_NOP4, 1, {RM_GPR|BITS32,0,0,0,0}, nasm_bytecodes+15978, IF_P6|IF_UNDOC},
+    {I_HINT_NOP4, 1, {RM_GPR|BITS64,0,0,0,0}, nasm_bytecodes+15984, IF_X64|IF_UNDOC},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_HINT_NOP40[] = {
+    {I_HINT_NOP40, 1, {RM_GPR|BITS16,0,0,0,0}, nasm_bytecodes+16620, IF_P6|IF_UNDOC},
+    {I_HINT_NOP40, 1, {RM_GPR|BITS32,0,0,0,0}, nasm_bytecodes+16626, IF_P6|IF_UNDOC},
+    {I_HINT_NOP40, 1, {RM_GPR|BITS64,0,0,0,0}, nasm_bytecodes+16632, IF_X64|IF_UNDOC},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_HINT_NOP41[] = {
+    {I_HINT_NOP41, 1, {RM_GPR|BITS16,0,0,0,0}, nasm_bytecodes+16638, IF_P6|IF_UNDOC},
+    {I_HINT_NOP41, 1, {RM_GPR|BITS32,0,0,0,0}, nasm_bytecodes+16644, IF_P6|IF_UNDOC},
+    {I_HINT_NOP41, 1, {RM_GPR|BITS64,0,0,0,0}, nasm_bytecodes+16650, IF_X64|IF_UNDOC},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_HINT_NOP42[] = {
+    {I_HINT_NOP42, 1, {RM_GPR|BITS16,0,0,0,0}, nasm_bytecodes+16656, IF_P6|IF_UNDOC},
+    {I_HINT_NOP42, 1, {RM_GPR|BITS32,0,0,0,0}, nasm_bytecodes+16662, IF_P6|IF_UNDOC},
+    {I_HINT_NOP42, 1, {RM_GPR|BITS64,0,0,0,0}, nasm_bytecodes+16668, IF_X64|IF_UNDOC},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_HINT_NOP43[] = {
+    {I_HINT_NOP43, 1, {RM_GPR|BITS16,0,0,0,0}, nasm_bytecodes+16674, IF_P6|IF_UNDOC},
+    {I_HINT_NOP43, 1, {RM_GPR|BITS32,0,0,0,0}, nasm_bytecodes+16680, IF_P6|IF_UNDOC},
+    {I_HINT_NOP43, 1, {RM_GPR|BITS64,0,0,0,0}, nasm_bytecodes+16686, IF_X64|IF_UNDOC},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_HINT_NOP44[] = {
+    {I_HINT_NOP44, 1, {RM_GPR|BITS16,0,0,0,0}, nasm_bytecodes+16692, IF_P6|IF_UNDOC},
+    {I_HINT_NOP44, 1, {RM_GPR|BITS32,0,0,0,0}, nasm_bytecodes+16698, IF_P6|IF_UNDOC},
+    {I_HINT_NOP44, 1, {RM_GPR|BITS64,0,0,0,0}, nasm_bytecodes+16704, IF_X64|IF_UNDOC},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_HINT_NOP45[] = {
+    {I_HINT_NOP45, 1, {RM_GPR|BITS16,0,0,0,0}, nasm_bytecodes+16710, IF_P6|IF_UNDOC},
+    {I_HINT_NOP45, 1, {RM_GPR|BITS32,0,0,0,0}, nasm_bytecodes+16716, IF_P6|IF_UNDOC},
+    {I_HINT_NOP45, 1, {RM_GPR|BITS64,0,0,0,0}, nasm_bytecodes+16722, IF_X64|IF_UNDOC},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_HINT_NOP46[] = {
+    {I_HINT_NOP46, 1, {RM_GPR|BITS16,0,0,0,0}, nasm_bytecodes+16728, IF_P6|IF_UNDOC},
+    {I_HINT_NOP46, 1, {RM_GPR|BITS32,0,0,0,0}, nasm_bytecodes+16734, IF_P6|IF_UNDOC},
+    {I_HINT_NOP46, 1, {RM_GPR|BITS64,0,0,0,0}, nasm_bytecodes+16740, IF_X64|IF_UNDOC},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_HINT_NOP47[] = {
+    {I_HINT_NOP47, 1, {RM_GPR|BITS16,0,0,0,0}, nasm_bytecodes+16746, IF_P6|IF_UNDOC},
+    {I_HINT_NOP47, 1, {RM_GPR|BITS32,0,0,0,0}, nasm_bytecodes+16752, IF_P6|IF_UNDOC},
+    {I_HINT_NOP47, 1, {RM_GPR|BITS64,0,0,0,0}, nasm_bytecodes+16758, IF_X64|IF_UNDOC},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_HINT_NOP48[] = {
+    {I_HINT_NOP48, 1, {RM_GPR|BITS16,0,0,0,0}, nasm_bytecodes+16764, IF_P6|IF_UNDOC},
+    {I_HINT_NOP48, 1, {RM_GPR|BITS32,0,0,0,0}, nasm_bytecodes+16770, IF_P6|IF_UNDOC},
+    {I_HINT_NOP48, 1, {RM_GPR|BITS64,0,0,0,0}, nasm_bytecodes+16776, IF_X64|IF_UNDOC},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_HINT_NOP49[] = {
+    {I_HINT_NOP49, 1, {RM_GPR|BITS16,0,0,0,0}, nasm_bytecodes+16782, IF_P6|IF_UNDOC},
+    {I_HINT_NOP49, 1, {RM_GPR|BITS32,0,0,0,0}, nasm_bytecodes+16788, IF_P6|IF_UNDOC},
+    {I_HINT_NOP49, 1, {RM_GPR|BITS64,0,0,0,0}, nasm_bytecodes+16794, IF_X64|IF_UNDOC},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_HINT_NOP5[] = {
+    {I_HINT_NOP5, 1, {RM_GPR|BITS16,0,0,0,0}, nasm_bytecodes+15990, IF_P6|IF_UNDOC},
+    {I_HINT_NOP5, 1, {RM_GPR|BITS32,0,0,0,0}, nasm_bytecodes+15996, IF_P6|IF_UNDOC},
+    {I_HINT_NOP5, 1, {RM_GPR|BITS64,0,0,0,0}, nasm_bytecodes+16002, IF_X64|IF_UNDOC},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_HINT_NOP50[] = {
+    {I_HINT_NOP50, 1, {RM_GPR|BITS16,0,0,0,0}, nasm_bytecodes+16800, IF_P6|IF_UNDOC},
+    {I_HINT_NOP50, 1, {RM_GPR|BITS32,0,0,0,0}, nasm_bytecodes+16806, IF_P6|IF_UNDOC},
+    {I_HINT_NOP50, 1, {RM_GPR|BITS64,0,0,0,0}, nasm_bytecodes+16812, IF_X64|IF_UNDOC},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_HINT_NOP51[] = {
+    {I_HINT_NOP51, 1, {RM_GPR|BITS16,0,0,0,0}, nasm_bytecodes+16818, IF_P6|IF_UNDOC},
+    {I_HINT_NOP51, 1, {RM_GPR|BITS32,0,0,0,0}, nasm_bytecodes+16824, IF_P6|IF_UNDOC},
+    {I_HINT_NOP51, 1, {RM_GPR|BITS64,0,0,0,0}, nasm_bytecodes+16830, IF_X64|IF_UNDOC},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_HINT_NOP52[] = {
+    {I_HINT_NOP52, 1, {RM_GPR|BITS16,0,0,0,0}, nasm_bytecodes+16836, IF_P6|IF_UNDOC},
+    {I_HINT_NOP52, 1, {RM_GPR|BITS32,0,0,0,0}, nasm_bytecodes+16842, IF_P6|IF_UNDOC},
+    {I_HINT_NOP52, 1, {RM_GPR|BITS64,0,0,0,0}, nasm_bytecodes+16848, IF_X64|IF_UNDOC},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_HINT_NOP53[] = {
+    {I_HINT_NOP53, 1, {RM_GPR|BITS16,0,0,0,0}, nasm_bytecodes+16854, IF_P6|IF_UNDOC},
+    {I_HINT_NOP53, 1, {RM_GPR|BITS32,0,0,0,0}, nasm_bytecodes+16860, IF_P6|IF_UNDOC},
+    {I_HINT_NOP53, 1, {RM_GPR|BITS64,0,0,0,0}, nasm_bytecodes+16866, IF_X64|IF_UNDOC},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_HINT_NOP54[] = {
+    {I_HINT_NOP54, 1, {RM_GPR|BITS16,0,0,0,0}, nasm_bytecodes+16872, IF_P6|IF_UNDOC},
+    {I_HINT_NOP54, 1, {RM_GPR|BITS32,0,0,0,0}, nasm_bytecodes+16878, IF_P6|IF_UNDOC},
+    {I_HINT_NOP54, 1, {RM_GPR|BITS64,0,0,0,0}, nasm_bytecodes+16884, IF_X64|IF_UNDOC},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_HINT_NOP55[] = {
+    {I_HINT_NOP55, 1, {RM_GPR|BITS16,0,0,0,0}, nasm_bytecodes+16890, IF_P6|IF_UNDOC},
+    {I_HINT_NOP55, 1, {RM_GPR|BITS32,0,0,0,0}, nasm_bytecodes+16896, IF_P6|IF_UNDOC},
+    {I_HINT_NOP55, 1, {RM_GPR|BITS64,0,0,0,0}, nasm_bytecodes+16902, IF_X64|IF_UNDOC},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_HINT_NOP56[] = {
+    {I_HINT_NOP56, 1, {RM_GPR|BITS16,0,0,0,0}, nasm_bytecodes+14274, IF_P6|IF_UNDOC},
+    {I_HINT_NOP56, 1, {RM_GPR|BITS32,0,0,0,0}, nasm_bytecodes+14280, IF_P6|IF_UNDOC},
+    {I_HINT_NOP56, 1, {RM_GPR|BITS64,0,0,0,0}, nasm_bytecodes+14286, IF_X64|IF_UNDOC},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_HINT_NOP57[] = {
+    {I_HINT_NOP57, 1, {RM_GPR|BITS16,0,0,0,0}, nasm_bytecodes+16908, IF_P6|IF_UNDOC},
+    {I_HINT_NOP57, 1, {RM_GPR|BITS32,0,0,0,0}, nasm_bytecodes+16914, IF_P6|IF_UNDOC},
+    {I_HINT_NOP57, 1, {RM_GPR|BITS64,0,0,0,0}, nasm_bytecodes+16920, IF_X64|IF_UNDOC},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_HINT_NOP58[] = {
+    {I_HINT_NOP58, 1, {RM_GPR|BITS16,0,0,0,0}, nasm_bytecodes+16926, IF_P6|IF_UNDOC},
+    {I_HINT_NOP58, 1, {RM_GPR|BITS32,0,0,0,0}, nasm_bytecodes+16932, IF_P6|IF_UNDOC},
+    {I_HINT_NOP58, 1, {RM_GPR|BITS64,0,0,0,0}, nasm_bytecodes+16938, IF_X64|IF_UNDOC},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_HINT_NOP59[] = {
+    {I_HINT_NOP59, 1, {RM_GPR|BITS16,0,0,0,0}, nasm_bytecodes+16944, IF_P6|IF_UNDOC},
+    {I_HINT_NOP59, 1, {RM_GPR|BITS32,0,0,0,0}, nasm_bytecodes+16950, IF_P6|IF_UNDOC},
+    {I_HINT_NOP59, 1, {RM_GPR|BITS64,0,0,0,0}, nasm_bytecodes+16956, IF_X64|IF_UNDOC},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_HINT_NOP6[] = {
+    {I_HINT_NOP6, 1, {RM_GPR|BITS16,0,0,0,0}, nasm_bytecodes+16008, IF_P6|IF_UNDOC},
+    {I_HINT_NOP6, 1, {RM_GPR|BITS32,0,0,0,0}, nasm_bytecodes+16014, IF_P6|IF_UNDOC},
+    {I_HINT_NOP6, 1, {RM_GPR|BITS64,0,0,0,0}, nasm_bytecodes+16020, IF_X64|IF_UNDOC},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_HINT_NOP60[] = {
+    {I_HINT_NOP60, 1, {RM_GPR|BITS16,0,0,0,0}, nasm_bytecodes+16962, IF_P6|IF_UNDOC},
+    {I_HINT_NOP60, 1, {RM_GPR|BITS32,0,0,0,0}, nasm_bytecodes+16968, IF_P6|IF_UNDOC},
+    {I_HINT_NOP60, 1, {RM_GPR|BITS64,0,0,0,0}, nasm_bytecodes+16974, IF_X64|IF_UNDOC},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_HINT_NOP61[] = {
+    {I_HINT_NOP61, 1, {RM_GPR|BITS16,0,0,0,0}, nasm_bytecodes+16980, IF_P6|IF_UNDOC},
+    {I_HINT_NOP61, 1, {RM_GPR|BITS32,0,0,0,0}, nasm_bytecodes+16986, IF_P6|IF_UNDOC},
+    {I_HINT_NOP61, 1, {RM_GPR|BITS64,0,0,0,0}, nasm_bytecodes+16992, IF_X64|IF_UNDOC},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_HINT_NOP62[] = {
+    {I_HINT_NOP62, 1, {RM_GPR|BITS16,0,0,0,0}, nasm_bytecodes+16998, IF_P6|IF_UNDOC},
+    {I_HINT_NOP62, 1, {RM_GPR|BITS32,0,0,0,0}, nasm_bytecodes+17004, IF_P6|IF_UNDOC},
+    {I_HINT_NOP62, 1, {RM_GPR|BITS64,0,0,0,0}, nasm_bytecodes+17010, IF_X64|IF_UNDOC},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_HINT_NOP63[] = {
+    {I_HINT_NOP63, 1, {RM_GPR|BITS16,0,0,0,0}, nasm_bytecodes+17016, IF_P6|IF_UNDOC},
+    {I_HINT_NOP63, 1, {RM_GPR|BITS32,0,0,0,0}, nasm_bytecodes+17022, IF_P6|IF_UNDOC},
+    {I_HINT_NOP63, 1, {RM_GPR|BITS64,0,0,0,0}, nasm_bytecodes+17028, IF_X64|IF_UNDOC},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_HINT_NOP7[] = {
+    {I_HINT_NOP7, 1, {RM_GPR|BITS16,0,0,0,0}, nasm_bytecodes+16026, IF_P6|IF_UNDOC},
+    {I_HINT_NOP7, 1, {RM_GPR|BITS32,0,0,0,0}, nasm_bytecodes+16032, IF_P6|IF_UNDOC},
+    {I_HINT_NOP7, 1, {RM_GPR|BITS64,0,0,0,0}, nasm_bytecodes+16038, IF_X64|IF_UNDOC},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_HINT_NOP8[] = {
+    {I_HINT_NOP8, 1, {RM_GPR|BITS16,0,0,0,0}, nasm_bytecodes+16044, IF_P6|IF_UNDOC},
+    {I_HINT_NOP8, 1, {RM_GPR|BITS32,0,0,0,0}, nasm_bytecodes+16050, IF_P6|IF_UNDOC},
+    {I_HINT_NOP8, 1, {RM_GPR|BITS64,0,0,0,0}, nasm_bytecodes+16056, IF_X64|IF_UNDOC},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_HINT_NOP9[] = {
+    {I_HINT_NOP9, 1, {RM_GPR|BITS16,0,0,0,0}, nasm_bytecodes+16062, IF_P6|IF_UNDOC},
+    {I_HINT_NOP9, 1, {RM_GPR|BITS32,0,0,0,0}, nasm_bytecodes+16068, IF_P6|IF_UNDOC},
+    {I_HINT_NOP9, 1, {RM_GPR|BITS64,0,0,0,0}, nasm_bytecodes+16074, IF_X64|IF_UNDOC},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_HLT[] = {
+    {I_HLT, 0, {0,0,0,0,0}, nasm_bytecodes+19983, IF_8086|IF_PRIV},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_HSUBPD[] = {
+    {I_HSUBPD, 2, {XMMREG,RM_XMM,0,0,0}, nasm_bytecodes+15768, IF_PRESCOTT|IF_SSE3|IF_SO},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_HSUBPS[] = {
+    {I_HSUBPS, 2, {XMMREG,RM_XMM,0,0,0}, nasm_bytecodes+15774, IF_PRESCOTT|IF_SSE3|IF_SO},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_IBTS[] = {
+    {I_IBTS, 2, {MEMORY,REG_GPR|BITS16,0,0,0}, nasm_bytecodes+13854, IF_386|IF_SW|IF_UNDOC},
+    {I_IBTS, 2, {REG_GPR|BITS16,REG_GPR|BITS16,0,0,0}, nasm_bytecodes+13854, IF_386|IF_UNDOC},
+    {I_IBTS, 2, {MEMORY,REG_GPR|BITS32,0,0,0}, nasm_bytecodes+13860, IF_386|IF_SD|IF_UNDOC},
+    {I_IBTS, 2, {REG_GPR|BITS32,REG_GPR|BITS32,0,0,0}, nasm_bytecodes+13860, IF_386|IF_UNDOC},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_ICEBP[] = {
+    {I_ICEBP, 0, {0,0,0,0,0}, nasm_bytecodes+19986, IF_386},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_IDIV[] = {
+    {I_IDIV, 1, {RM_GPR|BITS8,0,0,0,0}, nasm_bytecodes+19506, IF_8086},
+    {I_IDIV, 1, {RM_GPR|BITS16,0,0,0,0}, nasm_bytecodes+17729, IF_8086},
+    {I_IDIV, 1, {RM_GPR|BITS32,0,0,0,0}, nasm_bytecodes+17734, IF_386},
+    {I_IDIV, 1, {RM_GPR|BITS64,0,0,0,0}, nasm_bytecodes+17739, IF_X64},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_IMUL[] = {
+    {I_IMUL, 1, {RM_GPR|BITS8,0,0,0,0}, nasm_bytecodes+19510, IF_8086},
+    {I_IMUL, 1, {RM_GPR|BITS16,0,0,0,0}, nasm_bytecodes+17744, IF_8086},
+    {I_IMUL, 1, {RM_GPR|BITS32,0,0,0,0}, nasm_bytecodes+17749, IF_386},
+    {I_IMUL, 1, {RM_GPR|BITS64,0,0,0,0}, nasm_bytecodes+17754, IF_X64},
+    {I_IMUL, 2, {REG_GPR|BITS16,MEMORY,0,0,0}, nasm_bytecodes+13872, IF_386|IF_SM},
+    {I_IMUL, 2, {REG_GPR|BITS16,REG_GPR|BITS16,0,0,0}, nasm_bytecodes+13872, IF_386},
+    {I_IMUL, 2, {REG_GPR|BITS32,MEMORY,0,0,0}, nasm_bytecodes+13878, IF_386|IF_SM},
+    {I_IMUL, 2, {REG_GPR|BITS32,REG_GPR|BITS32,0,0,0}, nasm_bytecodes+13878, IF_386},
+    {I_IMUL, 2, {REG_GPR|BITS64,MEMORY,0,0,0}, nasm_bytecodes+13884, IF_X64|IF_SM},
+    {I_IMUL, 2, {REG_GPR|BITS64,REG_GPR|BITS64,0,0,0}, nasm_bytecodes+13884, IF_X64},
+    {I_IMUL, 3, {REG_GPR|BITS16,MEMORY,IMMEDIATE|BITS8,0,0}, nasm_bytecodes+13890, IF_186|IF_SM},
+    {I_IMUL, 3, {REG_GPR|BITS16,MEMORY,SBYTE16,0,0}, nasm_bytecodes+13890, IF_186|IF_SM},
+    {I_IMUL, 3, {REG_GPR|BITS16,MEMORY,IMMEDIATE|BITS16,0,0}, nasm_bytecodes+13896, IF_186|IF_SM},
+    {I_IMUL, 3, {REG_GPR|BITS16,MEMORY,IMMEDIATE,0,0}, nasm_bytecodes+13902, IF_186|IF_SM},
+    {I_IMUL, 3, {REG_GPR|BITS16,REG_GPR|BITS16,IMMEDIATE|BITS8,0,0}, nasm_bytecodes+13890, IF_186},
+    {I_IMUL, 3, {REG_GPR|BITS16,REG_GPR|BITS16,SBYTE16,0,0}, nasm_bytecodes+13890, IF_186|IF_SM},
+    {I_IMUL, 3, {REG_GPR|BITS16,REG_GPR|BITS16,IMMEDIATE|BITS16,0,0}, nasm_bytecodes+13896, IF_186},
+    {I_IMUL, 3, {REG_GPR|BITS16,REG_GPR|BITS16,IMMEDIATE,0,0}, nasm_bytecodes+13902, IF_186|IF_SM},
+    {I_IMUL, 3, {REG_GPR|BITS32,MEMORY,IMMEDIATE|BITS8,0,0}, nasm_bytecodes+13908, IF_386|IF_SM},
+    {I_IMUL, 3, {REG_GPR|BITS32,MEMORY,SBYTE32,0,0}, nasm_bytecodes+13908, IF_386|IF_SM},
+    {I_IMUL, 3, {REG_GPR|BITS32,MEMORY,IMMEDIATE|BITS32,0,0}, nasm_bytecodes+13914, IF_386|IF_SM},
+    {I_IMUL, 3, {REG_GPR|BITS32,MEMORY,IMMEDIATE,0,0}, nasm_bytecodes+13920, IF_386|IF_SM},
+    {I_IMUL, 3, {REG_GPR|BITS32,REG_GPR|BITS32,IMMEDIATE|BITS8,0,0}, nasm_bytecodes+13908, IF_386},
+    {I_IMUL, 3, {REG_GPR|BITS32,REG_GPR|BITS32,SBYTE32,0,0}, nasm_bytecodes+13908, IF_386|IF_SM},
+    {I_IMUL, 3, {REG_GPR|BITS32,REG_GPR|BITS32,IMMEDIATE|BITS32,0,0}, nasm_bytecodes+13914, IF_386},
+    {I_IMUL, 3, {REG_GPR|BITS32,REG_GPR|BITS32,IMMEDIATE,0,0}, nasm_bytecodes+13920, IF_386|IF_SM},
+    {I_IMUL, 3, {REG_GPR|BITS64,MEMORY,IMMEDIATE|BITS8,0,0}, nasm_bytecodes+13926, IF_X64|IF_SM},
+    {I_IMUL, 3, {REG_GPR|BITS64,MEMORY,SBYTE64,0,0}, nasm_bytecodes+13926, IF_X64|IF_SM},
+    {I_IMUL, 3, {REG_GPR|BITS64,MEMORY,IMMEDIATE|BITS32,0,0}, nasm_bytecodes+13932, IF_X64|IF_SM},
+    {I_IMUL, 3, {REG_GPR|BITS64,MEMORY,IMMEDIATE,0,0}, nasm_bytecodes+13938, IF_X64|IF_SM},
+    {I_IMUL, 3, {REG_GPR|BITS64,REG_GPR|BITS64,IMMEDIATE|BITS8,0,0}, nasm_bytecodes+13926, IF_X64},
+    {I_IMUL, 3, {REG_GPR|BITS64,REG_GPR|BITS64,SBYTE64,0,0}, nasm_bytecodes+13926, IF_X64|IF_SM},
+    {I_IMUL, 3, {REG_GPR|BITS64,REG_GPR|BITS64,IMMEDIATE|BITS32,0,0}, nasm_bytecodes+13932, IF_X64},
+    {I_IMUL, 3, {REG_GPR|BITS64,REG_GPR|BITS64,IMMEDIATE,0,0}, nasm_bytecodes+13938, IF_X64|IF_SM},
+    {I_IMUL, 2, {REG_GPR|BITS16,IMMEDIATE|BITS8,0,0,0}, nasm_bytecodes+13944, IF_186},
+    {I_IMUL, 2, {REG_GPR|BITS16,SBYTE16,0,0,0}, nasm_bytecodes+13944, IF_186|IF_SM},
+    {I_IMUL, 2, {REG_GPR|BITS16,IMMEDIATE|BITS16,0,0,0}, nasm_bytecodes+13950, IF_186},
+    {I_IMUL, 2, {REG_GPR|BITS16,IMMEDIATE,0,0,0}, nasm_bytecodes+13956, IF_186|IF_SM},
+    {I_IMUL, 2, {REG_GPR|BITS32,IMMEDIATE|BITS8,0,0,0}, nasm_bytecodes+13962, IF_386},
+    {I_IMUL, 2, {REG_GPR|BITS32,SBYTE32,0,0,0}, nasm_bytecodes+13962, IF_386|IF_SM},
+    {I_IMUL, 2, {REG_GPR|BITS32,IMMEDIATE|BITS32,0,0,0}, nasm_bytecodes+13968, IF_386},
+    {I_IMUL, 2, {REG_GPR|BITS32,IMMEDIATE,0,0,0}, nasm_bytecodes+13974, IF_386|IF_SM},
+    {I_IMUL, 2, {REG_GPR|BITS64,IMMEDIATE|BITS8,0,0,0}, nasm_bytecodes+13980, IF_X64},
+    {I_IMUL, 2, {REG_GPR|BITS64,SBYTE64,0,0,0}, nasm_bytecodes+13980, IF_X64|IF_SM},
+    {I_IMUL, 2, {REG_GPR|BITS64,IMMEDIATE|BITS32,0,0,0}, nasm_bytecodes+13986, IF_X64},
+    {I_IMUL, 2, {REG_GPR|BITS64,IMMEDIATE,0,0,0}, nasm_bytecodes+13992, IF_X64|IF_SM},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_IN[] = {
+    {I_IN, 2, {REG_AL,IMMEDIATE,0,0,0}, nasm_bytecodes+19514, IF_8086|IF_SB},
+    {I_IN, 2, {REG_AX,IMMEDIATE,0,0,0}, nasm_bytecodes+17759, IF_8086|IF_SB},
+    {I_IN, 2, {REG_EAX,IMMEDIATE,0,0,0}, nasm_bytecodes+17764, IF_386|IF_SB},
+    {I_IN, 2, {REG_AL,REG_DX,0,0,0}, nasm_bytecodes+19989, IF_8086},
+    {I_IN, 2, {REG_AX,REG_DX,0,0,0}, nasm_bytecodes+19518, IF_8086},
+    {I_IN, 2, {REG_EAX,REG_DX,0,0,0}, nasm_bytecodes+19522, IF_386},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_INC[] = {
+    {I_INC, 1, {REG_GPR|BITS16,0,0,0,0}, nasm_bytecodes+19526, IF_8086|IF_NOLONG},
+    {I_INC, 1, {REG_GPR|BITS32,0,0,0,0}, nasm_bytecodes+19530, IF_386|IF_NOLONG},
+    {I_INC, 1, {RM_GPR|BITS8,0,0,0,0}, nasm_bytecodes+19534, IF_8086},
+    {I_INC, 1, {RM_GPR|BITS16,0,0,0,0}, nasm_bytecodes+17769, IF_8086},
+    {I_INC, 1, {RM_GPR|BITS32,0,0,0,0}, nasm_bytecodes+17774, IF_386},
+    {I_INC, 1, {RM_GPR|BITS64,0,0,0,0}, nasm_bytecodes+17779, IF_X64},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_INCBIN[] = {
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_INSB[] = {
+    {I_INSB, 0, {0,0,0,0,0}, nasm_bytecodes+19992, IF_186},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_INSD[] = {
+    {I_INSD, 0, {0,0,0,0,0}, nasm_bytecodes+19538, IF_386},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_INSERTPS[] = {
+    {I_INSERTPS, 3, {XMMREG,RM_XMM,IMMEDIATE,0,0}, nasm_bytecodes+5972, IF_SSE41|IF_SD},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_INSERTQ[] = {
+    {I_INSERTQ, 4, {XMMREG,XMMREG,IMMEDIATE,IMMEDIATE,0}, nasm_bytecodes+5932, IF_SSE4A|IF_AMD},
+    {I_INSERTQ, 2, {XMMREG,XMMREG,0,0,0}, nasm_bytecodes+15822, IF_SSE4A|IF_AMD},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_INSW[] = {
+    {I_INSW, 0, {0,0,0,0,0}, nasm_bytecodes+19542, IF_186},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_INT[] = {
+    {I_INT, 1, {IMMEDIATE,0,0,0,0}, nasm_bytecodes+19546, IF_8086|IF_SB},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_INT01[] = {
+    {I_INT01, 0, {0,0,0,0,0}, nasm_bytecodes+19986, IF_386},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_INT03[] = {
+    {I_INT03, 0, {0,0,0,0,0}, nasm_bytecodes+19995, IF_8086},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_INT1[] = {
+    {I_INT1, 0, {0,0,0,0,0}, nasm_bytecodes+19986, IF_386},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_INT3[] = {
+    {I_INT3, 0, {0,0,0,0,0}, nasm_bytecodes+19995, IF_8086},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_INTO[] = {
+    {I_INTO, 0, {0,0,0,0,0}, nasm_bytecodes+19998, IF_8086|IF_NOLONG},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_INVD[] = {
+    {I_INVD, 0, {0,0,0,0,0}, nasm_bytecodes+19550, IF_486|IF_PRIV},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_INVEPT[] = {
+    {I_INVEPT, 2, {REG_GPR|BITS32,MEMORY,0,0,0}, nasm_bytecodes+5893, IF_VMX|IF_SO|IF_NOLONG},
+    {I_INVEPT, 2, {REG_GPR|BITS64,MEMORY,0,0,0}, nasm_bytecodes+5892, IF_VMX|IF_SO|IF_LONG},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_INVLPG[] = {
+    {I_INVLPG, 1, {MEMORY,0,0,0,0}, nasm_bytecodes+17784, IF_486|IF_PRIV},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_INVLPGA[] = {
+    {I_INVLPGA, 2, {REG_AX,REG_ECX,0,0,0}, nasm_bytecodes+13998, IF_X86_64|IF_AMD|IF_NOLONG},
+    {I_INVLPGA, 2, {REG_EAX,REG_ECX,0,0,0}, nasm_bytecodes+14004, IF_X86_64|IF_AMD},
+    {I_INVLPGA, 2, {REG_RAX,REG_ECX,0,0,0}, nasm_bytecodes+7320, IF_X64|IF_AMD},
+    {I_INVLPGA, 0, {0,0,0,0,0}, nasm_bytecodes+14005, IF_X86_64|IF_AMD},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_INVVPID[] = {
+    {I_INVVPID, 2, {REG_GPR|BITS32,MEMORY,0,0,0}, nasm_bytecodes+5901, IF_VMX|IF_SO|IF_NOLONG},
+    {I_INVVPID, 2, {REG_GPR|BITS64,MEMORY,0,0,0}, nasm_bytecodes+5900, IF_VMX|IF_SO|IF_LONG},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_IRET[] = {
+    {I_IRET, 0, {0,0,0,0,0}, nasm_bytecodes+19554, IF_8086},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_IRETD[] = {
+    {I_IRETD, 0, {0,0,0,0,0}, nasm_bytecodes+19558, IF_386},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_IRETQ[] = {
+    {I_IRETQ, 0, {0,0,0,0,0}, nasm_bytecodes+19562, IF_X64},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_IRETW[] = {
+    {I_IRETW, 0, {0,0,0,0,0}, nasm_bytecodes+19566, IF_8086},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_JCXZ[] = {
+    {I_JCXZ, 1, {IMMEDIATE,0,0,0,0}, nasm_bytecodes+17789, IF_8086|IF_NOLONG},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_JECXZ[] = {
+    {I_JECXZ, 1, {IMMEDIATE,0,0,0,0}, nasm_bytecodes+17794, IF_386},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_JMP[] = {
+    {I_JMP, 1, {IMMEDIATE|SHORT,0,0,0,0}, nasm_bytecodes+17805, IF_8086},
+    {I_JMP, 1, {IMMEDIATE,0,0,0,0}, nasm_bytecodes+17804, IF_8086},
+    {I_JMP, 1, {IMMEDIATE,0,0,0,0}, nasm_bytecodes+17809, IF_8086},
+    {I_JMP, 1, {IMMEDIATE|NEAR,0,0,0,0}, nasm_bytecodes+17809, IF_8086},
+    {I_JMP, 1, {IMMEDIATE|FAR,0,0,0,0}, nasm_bytecodes+14010, IF_8086|IF_NOLONG},
+    {I_JMP, 1, {IMMEDIATE|BITS16,0,0,0,0}, nasm_bytecodes+17814, IF_8086},
+    {I_JMP, 1, {IMMEDIATE|BITS16|NEAR,0,0,0,0}, nasm_bytecodes+17814, IF_8086},
+    {I_JMP, 1, {IMMEDIATE|BITS16|FAR,0,0,0,0}, nasm_bytecodes+14016, IF_8086|IF_NOLONG},
+    {I_JMP, 1, {IMMEDIATE|BITS32,0,0,0,0}, nasm_bytecodes+17819, IF_386},
+    {I_JMP, 1, {IMMEDIATE|BITS32|NEAR,0,0,0,0}, nasm_bytecodes+17819, IF_386},
+    {I_JMP, 1, {IMMEDIATE|BITS32|FAR,0,0,0,0}, nasm_bytecodes+14022, IF_386|IF_NOLONG},
+    {I_JMP, 2, {IMMEDIATE|COLON,IMMEDIATE,0,0,0}, nasm_bytecodes+14028, IF_8086|IF_NOLONG},
+    {I_JMP, 2, {IMMEDIATE|BITS16|COLON,IMMEDIATE,0,0,0}, nasm_bytecodes+14034, IF_8086|IF_NOLONG},
+    {I_JMP, 2, {IMMEDIATE|COLON,IMMEDIATE|BITS16,0,0,0}, nasm_bytecodes+14034, IF_8086|IF_NOLONG},
+    {I_JMP, 2, {IMMEDIATE|BITS32|COLON,IMMEDIATE,0,0,0}, nasm_bytecodes+14040, IF_386|IF_NOLONG},
+    {I_JMP, 2, {IMMEDIATE|COLON,IMMEDIATE|BITS32,0,0,0}, nasm_bytecodes+14040, IF_386|IF_NOLONG},
+    {I_JMP, 1, {MEMORY|FAR,0,0,0,0}, nasm_bytecodes+17824, IF_8086|IF_NOLONG},
+    {I_JMP, 1, {MEMORY|FAR,0,0,0,0}, nasm_bytecodes+17829, IF_X64},
+    {I_JMP, 1, {MEMORY|BITS16|FAR,0,0,0,0}, nasm_bytecodes+17834, IF_8086},
+    {I_JMP, 1, {MEMORY|BITS32|FAR,0,0,0,0}, nasm_bytecodes+17839, IF_386},
+    {I_JMP, 1, {MEMORY|BITS64|FAR,0,0,0,0}, nasm_bytecodes+17829, IF_X64},
+    {I_JMP, 1, {MEMORY|NEAR,0,0,0,0}, nasm_bytecodes+17844, IF_8086},
+    {I_JMP, 1, {MEMORY|BITS16|NEAR,0,0,0,0}, nasm_bytecodes+17849, IF_8086},
+    {I_JMP, 1, {MEMORY|BITS32|NEAR,0,0,0,0}, nasm_bytecodes+17854, IF_386|IF_NOLONG},
+    {I_JMP, 1, {MEMORY|BITS64|NEAR,0,0,0,0}, nasm_bytecodes+17859, IF_X64},
+    {I_JMP, 1, {REG_GPR|BITS16,0,0,0,0}, nasm_bytecodes+17849, IF_8086},
+    {I_JMP, 1, {REG_GPR|BITS32,0,0,0,0}, nasm_bytecodes+17854, IF_386|IF_NOLONG},
+    {I_JMP, 1, {REG_GPR|BITS64,0,0,0,0}, nasm_bytecodes+17859, IF_X64},
+    {I_JMP, 1, {MEMORY,0,0,0,0}, nasm_bytecodes+17844, IF_8086},
+    {I_JMP, 1, {MEMORY|BITS16,0,0,0,0}, nasm_bytecodes+17849, IF_8086},
+    {I_JMP, 1, {MEMORY|BITS32,0,0,0,0}, nasm_bytecodes+17854, IF_386|IF_NOLONG},
+    {I_JMP, 1, {MEMORY|BITS64,0,0,0,0}, nasm_bytecodes+17859, IF_X64},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_JMPE[] = {
+    {I_JMPE, 1, {IMMEDIATE,0,0,0,0}, nasm_bytecodes+14046, IF_IA64},
+    {I_JMPE, 1, {IMMEDIATE|BITS16,0,0,0,0}, nasm_bytecodes+14052, IF_IA64},
+    {I_JMPE, 1, {IMMEDIATE|BITS32,0,0,0,0}, nasm_bytecodes+14058, IF_IA64},
+    {I_JMPE, 1, {RM_GPR|BITS16,0,0,0,0}, nasm_bytecodes+14064, IF_IA64},
+    {I_JMPE, 1, {RM_GPR|BITS32,0,0,0,0}, nasm_bytecodes+14070, IF_IA64},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_JRCXZ[] = {
+    {I_JRCXZ, 1, {IMMEDIATE,0,0,0,0}, nasm_bytecodes+17799, IF_X64},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_LAHF[] = {
+    {I_LAHF, 0, {0,0,0,0,0}, nasm_bytecodes+20001, IF_8086},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_LAR[] = {
+    {I_LAR, 2, {REG_GPR|BITS16,MEMORY,0,0,0}, nasm_bytecodes+14076, IF_286|IF_PROT|IF_SW},
+    {I_LAR, 2, {REG_GPR|BITS16,REG_GPR|BITS16,0,0,0}, nasm_bytecodes+14076, IF_286|IF_PROT},
+    {I_LAR, 2, {REG_GPR|BITS16,REG_GPR|BITS32,0,0,0}, nasm_bytecodes+14076, IF_386|IF_PROT},
+    {I_LAR, 2, {REG_GPR|BITS16,REG_GPR|BITS64,0,0,0}, nasm_bytecodes+7327, IF_X64|IF_PROT},
+    {I_LAR, 2, {REG_GPR|BITS32,MEMORY,0,0,0}, nasm_bytecodes+14082, IF_386|IF_PROT|IF_SW},
+    {I_LAR, 2, {REG_GPR|BITS32,REG_GPR|BITS16,0,0,0}, nasm_bytecodes+14082, IF_386|IF_PROT},
+    {I_LAR, 2, {REG_GPR|BITS32,REG_GPR|BITS32,0,0,0}, nasm_bytecodes+14082, IF_386|IF_PROT},
+    {I_LAR, 2, {REG_GPR|BITS32,REG_GPR|BITS64,0,0,0}, nasm_bytecodes+7334, IF_X64|IF_PROT},
+    {I_LAR, 2, {REG_GPR|BITS64,MEMORY,0,0,0}, nasm_bytecodes+14088, IF_X64|IF_PROT|IF_SW},
+    {I_LAR, 2, {REG_GPR|BITS64,REG_GPR|BITS16,0,0,0}, nasm_bytecodes+14088, IF_X64|IF_PROT},
+    {I_LAR, 2, {REG_GPR|BITS64,REG_GPR|BITS32,0,0,0}, nasm_bytecodes+14088, IF_X64|IF_PROT},
+    {I_LAR, 2, {REG_GPR|BITS64,REG_GPR|BITS64,0,0,0}, nasm_bytecodes+14088, IF_X64|IF_PROT},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_LDDQU[] = {
+    {I_LDDQU, 2, {XMMREG,MEMORY,0,0,0}, nasm_bytecodes+15780, IF_PRESCOTT|IF_SSE3|IF_SO},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_LDMXCSR[] = {
+    {I_LDMXCSR, 1, {MEMORY,0,0,0,0}, nasm_bytecodes+18839, IF_KATMAI|IF_SSE|IF_SD},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_LDS[] = {
+    {I_LDS, 2, {REG_GPR|BITS16,MEMORY,0,0,0}, nasm_bytecodes+17864, IF_8086|IF_NOLONG},
+    {I_LDS, 2, {REG_GPR|BITS32,MEMORY,0,0,0}, nasm_bytecodes+17869, IF_386|IF_NOLONG},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_LEA[] = {
+    {I_LEA, 2, {REG_GPR|BITS16,MEMORY,0,0,0}, nasm_bytecodes+17874, IF_8086},
+    {I_LEA, 2, {REG_GPR|BITS32,MEMORY,0,0,0}, nasm_bytecodes+17879, IF_386},
+    {I_LEA, 2, {REG_GPR|BITS64,MEMORY,0,0,0}, nasm_bytecodes+17884, IF_X64},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_LEAVE[] = {
+    {I_LEAVE, 0, {0,0,0,0,0}, nasm_bytecodes+18121, IF_186},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_LES[] = {
+    {I_LES, 2, {REG_GPR|BITS16,MEMORY,0,0,0}, nasm_bytecodes+17889, IF_8086|IF_NOLONG},
+    {I_LES, 2, {REG_GPR|BITS32,MEMORY,0,0,0}, nasm_bytecodes+17894, IF_386|IF_NOLONG},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_LFENCE[] = {
+    {I_LFENCE, 0, {0,0,0,0,0}, nasm_bytecodes+17899, IF_X64|IF_AMD},
+    {I_LFENCE, 0, {0,0,0,0,0}, nasm_bytecodes+17899, IF_WILLAMETTE|IF_SSE2},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_LFS[] = {
+    {I_LFS, 2, {REG_GPR|BITS16,MEMORY,0,0,0}, nasm_bytecodes+14094, IF_386},
+    {I_LFS, 2, {REG_GPR|BITS32,MEMORY,0,0,0}, nasm_bytecodes+14100, IF_386},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_LGDT[] = {
+    {I_LGDT, 1, {MEMORY,0,0,0,0}, nasm_bytecodes+17904, IF_286|IF_PRIV},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_LGS[] = {
+    {I_LGS, 2, {REG_GPR|BITS16,MEMORY,0,0,0}, nasm_bytecodes+14106, IF_386},
+    {I_LGS, 2, {REG_GPR|BITS32,MEMORY,0,0,0}, nasm_bytecodes+14112, IF_386},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_LIDT[] = {
+    {I_LIDT, 1, {MEMORY,0,0,0,0}, nasm_bytecodes+17909, IF_286|IF_PRIV},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_LLDT[] = {
+    {I_LLDT, 1, {MEMORY,0,0,0,0}, nasm_bytecodes+17914, IF_286|IF_PROT|IF_PRIV},
+    {I_LLDT, 1, {MEMORY|BITS16,0,0,0,0}, nasm_bytecodes+17914, IF_286|IF_PROT|IF_PRIV},
+    {I_LLDT, 1, {REG_GPR|BITS16,0,0,0,0}, nasm_bytecodes+17914, IF_286|IF_PROT|IF_PRIV},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_LLWPCB[] = {
+    {I_LLWPCB, 1, {REG_GPR|BITS16,0,0,0,0}, nasm_bytecodes+12864, IF_AMD},
+    {I_LLWPCB, 1, {REG_GPR|BITS32,0,0,0,0}, nasm_bytecodes+12871, IF_AMD|IF_386},
+    {I_LLWPCB, 1, {REG_GPR|BITS64,0,0,0,0}, nasm_bytecodes+12878, IF_AMD|IF_X64},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_LMSW[] = {
+    {I_LMSW, 1, {MEMORY,0,0,0,0}, nasm_bytecodes+17919, IF_286|IF_PRIV},
+    {I_LMSW, 1, {MEMORY|BITS16,0,0,0,0}, nasm_bytecodes+17919, IF_286|IF_PRIV},
+    {I_LMSW, 1, {REG_GPR|BITS16,0,0,0,0}, nasm_bytecodes+17919, IF_286|IF_PRIV},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_LOADALL[] = {
+    {I_LOADALL, 0, {0,0,0,0,0}, nasm_bytecodes+19570, IF_386|IF_UNDOC},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_LOADALL286[] = {
+    {I_LOADALL286, 0, {0,0,0,0,0}, nasm_bytecodes+19574, IF_286|IF_UNDOC},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_LODSB[] = {
+    {I_LODSB, 0, {0,0,0,0,0}, nasm_bytecodes+20004, IF_8086},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_LODSD[] = {
+    {I_LODSD, 0, {0,0,0,0,0}, nasm_bytecodes+19578, IF_386},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_LODSQ[] = {
+    {I_LODSQ, 0, {0,0,0,0,0}, nasm_bytecodes+19582, IF_X64},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_LODSW[] = {
+    {I_LODSW, 0, {0,0,0,0,0}, nasm_bytecodes+19586, IF_8086},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_LOOP[] = {
+    {I_LOOP, 1, {IMMEDIATE,0,0,0,0}, nasm_bytecodes+17924, IF_8086},
+    {I_LOOP, 2, {IMMEDIATE,REG_CX,0,0,0}, nasm_bytecodes+17929, IF_8086|IF_NOLONG},
+    {I_LOOP, 2, {IMMEDIATE,REG_ECX,0,0,0}, nasm_bytecodes+17934, IF_386},
+    {I_LOOP, 2, {IMMEDIATE,REG_RCX,0,0,0}, nasm_bytecodes+17939, IF_X64},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_LOOPE[] = {
+    {I_LOOPE, 1, {IMMEDIATE,0,0,0,0}, nasm_bytecodes+17944, IF_8086},
+    {I_LOOPE, 2, {IMMEDIATE,REG_CX,0,0,0}, nasm_bytecodes+17949, IF_8086|IF_NOLONG},
+    {I_LOOPE, 2, {IMMEDIATE,REG_ECX,0,0,0}, nasm_bytecodes+17954, IF_386},
+    {I_LOOPE, 2, {IMMEDIATE,REG_RCX,0,0,0}, nasm_bytecodes+17959, IF_X64},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_LOOPNE[] = {
+    {I_LOOPNE, 1, {IMMEDIATE,0,0,0,0}, nasm_bytecodes+17964, IF_8086},
+    {I_LOOPNE, 2, {IMMEDIATE,REG_CX,0,0,0}, nasm_bytecodes+17969, IF_8086|IF_NOLONG},
+    {I_LOOPNE, 2, {IMMEDIATE,REG_ECX,0,0,0}, nasm_bytecodes+17974, IF_386},
+    {I_LOOPNE, 2, {IMMEDIATE,REG_RCX,0,0,0}, nasm_bytecodes+17979, IF_X64},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_LOOPNZ[] = {
+    {I_LOOPNZ, 1, {IMMEDIATE,0,0,0,0}, nasm_bytecodes+17964, IF_8086},
+    {I_LOOPNZ, 2, {IMMEDIATE,REG_CX,0,0,0}, nasm_bytecodes+17969, IF_8086|IF_NOLONG},
+    {I_LOOPNZ, 2, {IMMEDIATE,REG_ECX,0,0,0}, nasm_bytecodes+17974, IF_386},
+    {I_LOOPNZ, 2, {IMMEDIATE,REG_RCX,0,0,0}, nasm_bytecodes+17979, IF_X64},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_LOOPZ[] = {
+    {I_LOOPZ, 1, {IMMEDIATE,0,0,0,0}, nasm_bytecodes+17944, IF_8086},
+    {I_LOOPZ, 2, {IMMEDIATE,REG_CX,0,0,0}, nasm_bytecodes+17949, IF_8086|IF_NOLONG},
+    {I_LOOPZ, 2, {IMMEDIATE,REG_ECX,0,0,0}, nasm_bytecodes+17954, IF_386},
+    {I_LOOPZ, 2, {IMMEDIATE,REG_RCX,0,0,0}, nasm_bytecodes+17959, IF_X64},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_LSL[] = {
+    {I_LSL, 2, {REG_GPR|BITS16,MEMORY,0,0,0}, nasm_bytecodes+14118, IF_286|IF_PROT|IF_SW},
+    {I_LSL, 2, {REG_GPR|BITS16,REG_GPR|BITS16,0,0,0}, nasm_bytecodes+14118, IF_286|IF_PROT},
+    {I_LSL, 2, {REG_GPR|BITS16,REG_GPR|BITS32,0,0,0}, nasm_bytecodes+14118, IF_386|IF_PROT},
+    {I_LSL, 2, {REG_GPR|BITS16,REG_GPR|BITS64,0,0,0}, nasm_bytecodes+7341, IF_X64|IF_PROT},
+    {I_LSL, 2, {REG_GPR|BITS32,MEMORY,0,0,0}, nasm_bytecodes+14124, IF_386|IF_PROT|IF_SW},
+    {I_LSL, 2, {REG_GPR|BITS32,REG_GPR|BITS16,0,0,0}, nasm_bytecodes+14124, IF_386|IF_PROT},
+    {I_LSL, 2, {REG_GPR|BITS32,REG_GPR|BITS32,0,0,0}, nasm_bytecodes+14124, IF_386|IF_PROT},
+    {I_LSL, 2, {REG_GPR|BITS32,REG_GPR|BITS64,0,0,0}, nasm_bytecodes+7348, IF_X64|IF_PROT},
+    {I_LSL, 2, {REG_GPR|BITS64,MEMORY,0,0,0}, nasm_bytecodes+14130, IF_X64|IF_PROT|IF_SW},
+    {I_LSL, 2, {REG_GPR|BITS64,REG_GPR|BITS16,0,0,0}, nasm_bytecodes+14130, IF_X64|IF_PROT},
+    {I_LSL, 2, {REG_GPR|BITS64,REG_GPR|BITS32,0,0,0}, nasm_bytecodes+14130, IF_X64|IF_PROT},
+    {I_LSL, 2, {REG_GPR|BITS64,REG_GPR|BITS64,0,0,0}, nasm_bytecodes+14130, IF_X64|IF_PROT},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_LSS[] = {
+    {I_LSS, 2, {REG_GPR|BITS16,MEMORY,0,0,0}, nasm_bytecodes+14136, IF_386},
+    {I_LSS, 2, {REG_GPR|BITS32,MEMORY,0,0,0}, nasm_bytecodes+14142, IF_386},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_LTR[] = {
+    {I_LTR, 1, {MEMORY,0,0,0,0}, nasm_bytecodes+17984, IF_286|IF_PROT|IF_PRIV},
+    {I_LTR, 1, {MEMORY|BITS16,0,0,0,0}, nasm_bytecodes+17984, IF_286|IF_PROT|IF_PRIV},
+    {I_LTR, 1, {REG_GPR|BITS16,0,0,0,0}, nasm_bytecodes+17984, IF_286|IF_PROT|IF_PRIV},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_LWPINS[] = {
+    {I_LWPINS, 3, {REG_GPR|BITS16,RM_GPR|BITS32,IMMEDIATE|BITS16,0,0}, nasm_bytecodes+6956, IF_AMD|IF_386},
+    {I_LWPINS, 3, {REG_GPR|BITS32,RM_GPR|BITS32,IMMEDIATE|BITS32,0,0}, nasm_bytecodes+6964, IF_AMD|IF_386},
+    {I_LWPINS, 3, {REG_GPR|BITS64,RM_GPR|BITS32,IMMEDIATE|BITS32,0,0}, nasm_bytecodes+6972, IF_AMD|IF_X64},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_LWPVAL[] = {
+    {I_LWPVAL, 3, {REG_GPR|BITS16,RM_GPR|BITS32,IMMEDIATE|BITS16,0,0}, nasm_bytecodes+6932, IF_AMD|IF_386},
+    {I_LWPVAL, 3, {REG_GPR|BITS32,RM_GPR|BITS32,IMMEDIATE|BITS32,0,0}, nasm_bytecodes+6940, IF_AMD|IF_386},
+    {I_LWPVAL, 3, {REG_GPR|BITS64,RM_GPR|BITS32,IMMEDIATE|BITS32,0,0}, nasm_bytecodes+6948, IF_AMD|IF_X64},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_LZCNT[] = {
+    {I_LZCNT, 2, {REG_GPR|BITS16,RM_GPR|BITS16,0,0,0}, nasm_bytecodes+8412, IF_P6|IF_AMD},
+    {I_LZCNT, 2, {REG_GPR|BITS32,RM_GPR|BITS32,0,0,0}, nasm_bytecodes+8419, IF_P6|IF_AMD},
+    {I_LZCNT, 2, {REG_GPR|BITS64,RM_GPR|BITS64,0,0,0}, nasm_bytecodes+8426, IF_X64|IF_AMD},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_MASKMOVDQU[] = {
+    {I_MASKMOVDQU, 2, {XMMREG,XMMREG,0,0,0}, nasm_bytecodes+15048, IF_WILLAMETTE|IF_SSE2},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_MASKMOVQ[] = {
+    {I_MASKMOVQ, 2, {MMXREG,MMXREG,0,0,0}, nasm_bytecodes+15030, IF_KATMAI|IF_MMX},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_MAXPD[] = {
+    {I_MAXPD, 2, {XMMREG,RM_XMM,0,0,0}, nasm_bytecodes+15588, IF_WILLAMETTE|IF_SSE2|IF_SO},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_MAXPS[] = {
+    {I_MAXPS, 2, {XMMREG,RM_XMM,0,0,0}, nasm_bytecodes+14826, IF_KATMAI|IF_SSE},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_MAXSD[] = {
+    {I_MAXSD, 2, {XMMREG,RM_XMM,0,0,0}, nasm_bytecodes+15594, IF_WILLAMETTE|IF_SSE2},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_MAXSS[] = {
+    {I_MAXSS, 2, {XMMREG,RM_XMM,0,0,0}, nasm_bytecodes+14832, IF_KATMAI|IF_SSE},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_MFENCE[] = {
+    {I_MFENCE, 0, {0,0,0,0,0}, nasm_bytecodes+17989, IF_X64|IF_AMD},
+    {I_MFENCE, 0, {0,0,0,0,0}, nasm_bytecodes+17989, IF_WILLAMETTE|IF_SSE2},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_MINPD[] = {
+    {I_MINPD, 2, {XMMREG,RM_XMM,0,0,0}, nasm_bytecodes+15600, IF_WILLAMETTE|IF_SSE2|IF_SO},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_MINPS[] = {
+    {I_MINPS, 2, {XMMREG,RM_XMM,0,0,0}, nasm_bytecodes+14838, IF_KATMAI|IF_SSE},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_MINSD[] = {
+    {I_MINSD, 2, {XMMREG,RM_XMM,0,0,0}, nasm_bytecodes+15606, IF_WILLAMETTE|IF_SSE2},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_MINSS[] = {
+    {I_MINSS, 2, {XMMREG,RM_XMM,0,0,0}, nasm_bytecodes+14844, IF_KATMAI|IF_SSE},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_MONITOR[] = {
+    {I_MONITOR, 0, {0,0,0,0,0}, nasm_bytecodes+17994, IF_PRESCOTT},
+    {I_MONITOR, 3, {REG_EAX,REG_ECX,REG_EDX,0,0}, nasm_bytecodes+17994, IF_PRESCOTT},
+    {I_MONITOR, 3, {REG_RAX,REG_ECX,REG_EDX,0,0}, nasm_bytecodes+17994, IF_X64},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_MONTMUL[] = {
+    {I_MONTMUL, 0, {0,0,0,0,0}, nasm_bytecodes+15882, IF_PENT|IF_CYRIX},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_MOV[] = {
+    {I_MOV, 2, {MEMORY,REG_SREG,0,0,0}, nasm_bytecodes+18005, IF_8086|IF_SM},
+    {I_MOV, 2, {REG_GPR|BITS16,REG_SREG,0,0,0}, nasm_bytecodes+17999, IF_8086},
+    {I_MOV, 2, {REG_GPR|BITS32,REG_SREG,0,0,0}, nasm_bytecodes+18004, IF_386},
+    {I_MOV, 2, {REG_SREG,MEMORY,0,0,0}, nasm_bytecodes+19590, IF_8086|IF_SM},
+    {I_MOV, 2, {REG_SREG,REG_GPR|BITS16,0,0,0}, nasm_bytecodes+19590, IF_8086},
+    {I_MOV, 2, {REG_SREG,REG_GPR|BITS32,0,0,0}, nasm_bytecodes+19590, IF_386},
+    {I_MOV, 2, {REG_AL,MEM_OFFS,0,0,0}, nasm_bytecodes+19594, IF_8086|IF_SM},
+    {I_MOV, 2, {REG_AX,MEM_OFFS,0,0,0}, nasm_bytecodes+18009, IF_8086|IF_SM},
+    {I_MOV, 2, {REG_EAX,MEM_OFFS,0,0,0}, nasm_bytecodes+18014, IF_386|IF_SM},
+    {I_MOV, 2, {REG_RAX,MEM_OFFS,0,0,0}, nasm_bytecodes+18019, IF_X64|IF_SM},
+    {I_MOV, 2, {MEM_OFFS,REG_AL,0,0,0}, nasm_bytecodes+19598, IF_8086|IF_SM},
+    {I_MOV, 2, {MEM_OFFS,REG_AX,0,0,0}, nasm_bytecodes+18024, IF_8086|IF_SM},
+    {I_MOV, 2, {MEM_OFFS,REG_EAX,0,0,0}, nasm_bytecodes+18029, IF_386|IF_SM},
+    {I_MOV, 2, {MEM_OFFS,REG_RAX,0,0,0}, nasm_bytecodes+18034, IF_X64|IF_SM},
+    {I_MOV, 2, {REG_GPR|BITS32,REG_CREG,0,0,0}, nasm_bytecodes+14148, IF_386|IF_PRIV|IF_NOLONG},
+    {I_MOV, 2, {REG_GPR|BITS64,REG_CREG,0,0,0}, nasm_bytecodes+14154, IF_X64|IF_PRIV},
+    {I_MOV, 2, {REG_CREG,REG_GPR|BITS32,0,0,0}, nasm_bytecodes+14160, IF_386|IF_PRIV|IF_NOLONG},
+    {I_MOV, 2, {REG_CREG,REG_GPR|BITS64,0,0,0}, nasm_bytecodes+14166, IF_X64|IF_PRIV},
+    {I_MOV, 2, {REG_GPR|BITS32,REG_DREG,0,0,0}, nasm_bytecodes+14173, IF_386|IF_PRIV|IF_NOLONG},
+    {I_MOV, 2, {REG_GPR|BITS64,REG_DREG,0,0,0}, nasm_bytecodes+14172, IF_X64|IF_PRIV},
+    {I_MOV, 2, {REG_DREG,REG_GPR|BITS32,0,0,0}, nasm_bytecodes+14179, IF_386|IF_PRIV|IF_NOLONG},
+    {I_MOV, 2, {REG_DREG,REG_GPR|BITS64,0,0,0}, nasm_bytecodes+14178, IF_X64|IF_PRIV},
+    {I_MOV, 2, {REG_GPR|BITS32,REG_TREG,0,0,0}, nasm_bytecodes+18039, IF_386|IF_NOLONG},
+    {I_MOV, 2, {REG_TREG,REG_GPR|BITS32,0,0,0}, nasm_bytecodes+18044, IF_386|IF_NOLONG},
+    {I_MOV, 2, {MEMORY,REG_GPR|BITS8,0,0,0}, nasm_bytecodes+19602, IF_8086|IF_SM},
+    {I_MOV, 2, {REG_GPR|BITS8,REG_GPR|BITS8,0,0,0}, nasm_bytecodes+19602, IF_8086},
+    {I_MOV, 2, {MEMORY,REG_GPR|BITS16,0,0,0}, nasm_bytecodes+18049, IF_8086|IF_SM},
+    {I_MOV, 2, {REG_GPR|BITS16,REG_GPR|BITS16,0,0,0}, nasm_bytecodes+18049, IF_8086},
+    {I_MOV, 2, {MEMORY,REG_GPR|BITS32,0,0,0}, nasm_bytecodes+18054, IF_386|IF_SM},
+    {I_MOV, 2, {REG_GPR|BITS32,REG_GPR|BITS32,0,0,0}, nasm_bytecodes+18054, IF_386},
+    {I_MOV, 2, {MEMORY,REG_GPR|BITS64,0,0,0}, nasm_bytecodes+18059, IF_X64|IF_SM},
+    {I_MOV, 2, {REG_GPR|BITS64,REG_GPR|BITS64,0,0,0}, nasm_bytecodes+18059, IF_X64},
+    {I_MOV, 2, {REG_GPR|BITS8,MEMORY,0,0,0}, nasm_bytecodes+19606, IF_8086|IF_SM},
+    {I_MOV, 2, {REG_GPR|BITS8,REG_GPR|BITS8,0,0,0}, nasm_bytecodes+19606, IF_8086},
+    {I_MOV, 2, {REG_GPR|BITS16,MEMORY,0,0,0}, nasm_bytecodes+18064, IF_8086|IF_SM},
+    {I_MOV, 2, {REG_GPR|BITS16,REG_GPR|BITS16,0,0,0}, nasm_bytecodes+18064, IF_8086},
+    {I_MOV, 2, {REG_GPR|BITS32,MEMORY,0,0,0}, nasm_bytecodes+18069, IF_386|IF_SM},
+    {I_MOV, 2, {REG_GPR|BITS32,REG_GPR|BITS32,0,0,0}, nasm_bytecodes+18069, IF_386},
+    {I_MOV, 2, {REG_GPR|BITS64,MEMORY,0,0,0}, nasm_bytecodes+18074, IF_X64|IF_SM},
+    {I_MOV, 2, {REG_GPR|BITS64,REG_GPR|BITS64,0,0,0}, nasm_bytecodes+18074, IF_X64},
+    {I_MOV, 2, {REG_GPR|BITS8,IMMEDIATE,0,0,0}, nasm_bytecodes+19610, IF_8086|IF_SM},
+    {I_MOV, 2, {REG_GPR|BITS16,IMMEDIATE,0,0,0}, nasm_bytecodes+18079, IF_8086|IF_SM},
+    {I_MOV, 2, {REG_GPR|BITS32,IMMEDIATE,0,0,0}, nasm_bytecodes+18084, IF_386|IF_SM},
+    {I_MOV, 2, {REG_GPR|BITS64,IMMEDIATE,0,0,0}, nasm_bytecodes+18089, IF_X64|IF_SM},
+    {I_MOV, 2, {REG_GPR|BITS64,IMMEDIATE|BITS32,0,0,0}, nasm_bytecodes+14184, IF_X64},
+    {I_MOV, 2, {RM_GPR|BITS8,IMMEDIATE,0,0,0}, nasm_bytecodes+18094, IF_8086|IF_SM},
+    {I_MOV, 2, {RM_GPR|BITS16,IMMEDIATE,0,0,0}, nasm_bytecodes+14190, IF_8086|IF_SM},
+    {I_MOV, 2, {RM_GPR|BITS32,IMMEDIATE,0,0,0}, nasm_bytecodes+14196, IF_386|IF_SM},
+    {I_MOV, 2, {RM_GPR|BITS64,IMMEDIATE,0,0,0}, nasm_bytecodes+14184, IF_X64|IF_SM},
+    {I_MOV, 2, {MEMORY,IMMEDIATE|BITS8,0,0,0}, nasm_bytecodes+18094, IF_8086|IF_SM},
+    {I_MOV, 2, {MEMORY,IMMEDIATE|BITS16,0,0,0}, nasm_bytecodes+14190, IF_8086|IF_SM},
+    {I_MOV, 2, {MEMORY,IMMEDIATE|BITS32,0,0,0}, nasm_bytecodes+14196, IF_386|IF_SM},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_MOVAPD[] = {
+    {I_MOVAPD, 2, {XMMREG,XMMREG,0,0,0}, nasm_bytecodes+15612, IF_WILLAMETTE|IF_SSE2},
+    {I_MOVAPD, 2, {XMMREG,XMMREG,0,0,0}, nasm_bytecodes+15618, IF_WILLAMETTE|IF_SSE2},
+    {I_MOVAPD, 2, {MEMORY,XMMREG,0,0,0}, nasm_bytecodes+15618, IF_WILLAMETTE|IF_SSE2|IF_SO},
+    {I_MOVAPD, 2, {XMMREG,MEMORY,0,0,0}, nasm_bytecodes+15612, IF_WILLAMETTE|IF_SSE2|IF_SO},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_MOVAPS[] = {
+    {I_MOVAPS, 2, {XMMREG,MEMORY,0,0,0}, nasm_bytecodes+14850, IF_KATMAI|IF_SSE},
+    {I_MOVAPS, 2, {MEMORY,XMMREG,0,0,0}, nasm_bytecodes+14856, IF_KATMAI|IF_SSE},
+    {I_MOVAPS, 2, {XMMREG,XMMREG,0,0,0}, nasm_bytecodes+14850, IF_KATMAI|IF_SSE},
+    {I_MOVAPS, 2, {XMMREG,XMMREG,0,0,0}, nasm_bytecodes+14856, IF_KATMAI|IF_SSE},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_MOVBE[] = {
+    {I_MOVBE, 2, {REG_GPR|BITS16,MEMORY|BITS16,0,0,0}, nasm_bytecodes+8671, IF_NEHALEM|IF_SM},
+    {I_MOVBE, 2, {REG_GPR|BITS32,MEMORY|BITS32,0,0,0}, nasm_bytecodes+8678, IF_NEHALEM|IF_SM},
+    {I_MOVBE, 2, {REG_GPR|BITS64,MEMORY|BITS64,0,0,0}, nasm_bytecodes+8685, IF_NEHALEM|IF_SM},
+    {I_MOVBE, 2, {MEMORY|BITS16,REG_GPR|BITS16,0,0,0}, nasm_bytecodes+8692, IF_NEHALEM|IF_SM},
+    {I_MOVBE, 2, {MEMORY|BITS32,REG_GPR|BITS32,0,0,0}, nasm_bytecodes+8699, IF_NEHALEM|IF_SM},
+    {I_MOVBE, 2, {MEMORY|BITS64,REG_GPR|BITS64,0,0,0}, nasm_bytecodes+8706, IF_NEHALEM|IF_SM},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_MOVD[] = {
+    {I_MOVD, 2, {MMXREG,MEMORY,0,0,0}, nasm_bytecodes+14202, IF_PENT|IF_MMX|IF_SD},
+    {I_MOVD, 2, {MMXREG,REG_GPR|BITS32,0,0,0}, nasm_bytecodes+14202, IF_PENT|IF_MMX},
+    {I_MOVD, 2, {MEMORY,MMXREG,0,0,0}, nasm_bytecodes+14208, IF_PENT|IF_MMX|IF_SD},
+    {I_MOVD, 2, {REG_GPR|BITS32,MMXREG,0,0,0}, nasm_bytecodes+14208, IF_PENT|IF_MMX},
+    {I_MOVD, 2, {XMMREG,MEMORY,0,0,0}, nasm_bytecodes+7355, IF_X64|IF_SD},
+    {I_MOVD, 2, {XMMREG,REG_GPR|BITS32,0,0,0}, nasm_bytecodes+7355, IF_X64},
+    {I_MOVD, 2, {MEMORY,XMMREG,0,0,0}, nasm_bytecodes+7362, IF_X64|IF_SD},
+    {I_MOVD, 2, {REG_GPR|BITS32,XMMREG,0,0,0}, nasm_bytecodes+7362, IF_X64|IF_SSE},
+    {I_MOVD, 2, {MEMORY,XMMREG,0,0,0}, nasm_bytecodes+7992, IF_WILLAMETTE|IF_SSE2|IF_SD},
+    {I_MOVD, 2, {XMMREG,MEMORY,0,0,0}, nasm_bytecodes+7999, IF_WILLAMETTE|IF_SSE2|IF_SD},
+    {I_MOVD, 2, {XMMREG,RM_GPR|BITS32,0,0,0}, nasm_bytecodes+7999, IF_WILLAMETTE|IF_SSE2},
+    {I_MOVD, 2, {RM_GPR|BITS32,XMMREG,0,0,0}, nasm_bytecodes+7992, IF_WILLAMETTE|IF_SSE2},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_MOVDDUP[] = {
+    {I_MOVDDUP, 2, {XMMREG,RM_XMM,0,0,0}, nasm_bytecodes+15786, IF_PRESCOTT|IF_SSE3},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_MOVDQ2Q[] = {
+    {I_MOVDQ2Q, 2, {MMXREG,XMMREG,0,0,0}, nasm_bytecodes+15090, IF_WILLAMETTE|IF_SSE2},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_MOVDQA[] = {
+    {I_MOVDQA, 2, {XMMREG,XMMREG,0,0,0}, nasm_bytecodes+15066, IF_WILLAMETTE|IF_SSE2},
+    {I_MOVDQA, 2, {MEMORY,XMMREG,0,0,0}, nasm_bytecodes+15072, IF_WILLAMETTE|IF_SSE2|IF_SO},
+    {I_MOVDQA, 2, {XMMREG,MEMORY,0,0,0}, nasm_bytecodes+15066, IF_WILLAMETTE|IF_SSE2|IF_SO},
+    {I_MOVDQA, 2, {XMMREG,XMMREG,0,0,0}, nasm_bytecodes+15072, IF_WILLAMETTE|IF_SSE2},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_MOVDQU[] = {
+    {I_MOVDQU, 2, {XMMREG,XMMREG,0,0,0}, nasm_bytecodes+15078, IF_WILLAMETTE|IF_SSE2},
+    {I_MOVDQU, 2, {MEMORY,XMMREG,0,0,0}, nasm_bytecodes+15084, IF_WILLAMETTE|IF_SSE2|IF_SO},
+    {I_MOVDQU, 2, {XMMREG,MEMORY,0,0,0}, nasm_bytecodes+15078, IF_WILLAMETTE|IF_SSE2|IF_SO},
+    {I_MOVDQU, 2, {XMMREG,XMMREG,0,0,0}, nasm_bytecodes+15084, IF_WILLAMETTE|IF_SSE2},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_MOVHLPS[] = {
+    {I_MOVHLPS, 2, {XMMREG,XMMREG,0,0,0}, nasm_bytecodes+14682, IF_KATMAI|IF_SSE},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_MOVHPD[] = {
+    {I_MOVHPD, 2, {MEMORY,XMMREG,0,0,0}, nasm_bytecodes+15624, IF_WILLAMETTE|IF_SSE2},
+    {I_MOVHPD, 2, {XMMREG,MEMORY,0,0,0}, nasm_bytecodes+15630, IF_WILLAMETTE|IF_SSE2},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_MOVHPS[] = {
+    {I_MOVHPS, 2, {XMMREG,MEMORY,0,0,0}, nasm_bytecodes+14862, IF_KATMAI|IF_SSE},
+    {I_MOVHPS, 2, {MEMORY,XMMREG,0,0,0}, nasm_bytecodes+14868, IF_KATMAI|IF_SSE},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_MOVLHPS[] = {
+    {I_MOVLHPS, 2, {XMMREG,XMMREG,0,0,0}, nasm_bytecodes+14862, IF_KATMAI|IF_SSE},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_MOVLPD[] = {
+    {I_MOVLPD, 2, {MEMORY,XMMREG,0,0,0}, nasm_bytecodes+15636, IF_WILLAMETTE|IF_SSE2},
+    {I_MOVLPD, 2, {XMMREG,MEMORY,0,0,0}, nasm_bytecodes+15642, IF_WILLAMETTE|IF_SSE2},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_MOVLPS[] = {
+    {I_MOVLPS, 2, {XMMREG,MEMORY,0,0,0}, nasm_bytecodes+14682, IF_KATMAI|IF_SSE},
+    {I_MOVLPS, 2, {MEMORY,XMMREG,0,0,0}, nasm_bytecodes+14874, IF_KATMAI|IF_SSE},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_MOVMSKPD[] = {
+    {I_MOVMSKPD, 2, {REG_GPR|BITS32,XMMREG,0,0,0}, nasm_bytecodes+15648, IF_WILLAMETTE|IF_SSE2},
+    {I_MOVMSKPD, 2, {REG_GPR|BITS64,XMMREG,0,0,0}, nasm_bytecodes+8174, IF_X64|IF_SSE2},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_MOVMSKPS[] = {
+    {I_MOVMSKPS, 2, {REG_GPR|BITS32,XMMREG,0,0,0}, nasm_bytecodes+14880, IF_KATMAI|IF_SSE},
+    {I_MOVMSKPS, 2, {REG_GPR|BITS64,XMMREG,0,0,0}, nasm_bytecodes+7901, IF_X64|IF_SSE},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_MOVNTDQ[] = {
+    {I_MOVNTDQ, 2, {MEMORY,XMMREG,0,0,0}, nasm_bytecodes+15054, IF_WILLAMETTE|IF_SSE2|IF_SO},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_MOVNTDQA[] = {
+    {I_MOVNTDQA, 2, {XMMREG,MEMORY,0,0,0}, nasm_bytecodes+8447, IF_SSE41},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_MOVNTI[] = {
+    {I_MOVNTI, 2, {MEMORY,REG_GPR|BITS32,0,0,0}, nasm_bytecodes+7986, IF_WILLAMETTE|IF_SD},
+    {I_MOVNTI, 2, {MEMORY,REG_GPR|BITS64,0,0,0}, nasm_bytecodes+7985, IF_X64|IF_SQ},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_MOVNTPD[] = {
+    {I_MOVNTPD, 2, {MEMORY,XMMREG,0,0,0}, nasm_bytecodes+15060, IF_WILLAMETTE|IF_SSE2|IF_SO},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_MOVNTPS[] = {
+    {I_MOVNTPS, 2, {MEMORY,XMMREG,0,0,0}, nasm_bytecodes+14886, IF_KATMAI|IF_SSE},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_MOVNTQ[] = {
+    {I_MOVNTQ, 2, {MEMORY,MMXREG,0,0,0}, nasm_bytecodes+15036, IF_KATMAI|IF_MMX|IF_SQ},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_MOVNTSD[] = {
+    {I_MOVNTSD, 2, {MEMORY,XMMREG,0,0,0}, nasm_bytecodes+15828, IF_SSE4A|IF_AMD|IF_SQ},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_MOVNTSS[] = {
+    {I_MOVNTSS, 2, {MEMORY,XMMREG,0,0,0}, nasm_bytecodes+15834, IF_SSE4A|IF_AMD|IF_SD},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_MOVQ[] = {
+    {I_MOVQ, 2, {MMXREG,RM_MMX,0,0,0}, nasm_bytecodes+7369, IF_PENT|IF_MMX|IF_SQ},
+    {I_MOVQ, 2, {RM_MMX,MMXREG,0,0,0}, nasm_bytecodes+7376, IF_PENT|IF_MMX|IF_SQ},
+    {I_MOVQ, 2, {MMXREG,RM_GPR|BITS64,0,0,0}, nasm_bytecodes+14202, IF_X64|IF_MMX},
+    {I_MOVQ, 2, {RM_GPR|BITS64,MMXREG,0,0,0}, nasm_bytecodes+14208, IF_X64|IF_MMX},
+    {I_MOVQ, 2, {XMMREG,XMMREG,0,0,0}, nasm_bytecodes+15096, IF_WILLAMETTE|IF_SSE2},
+    {I_MOVQ, 2, {XMMREG,XMMREG,0,0,0}, nasm_bytecodes+15102, IF_WILLAMETTE|IF_SSE2},
+    {I_MOVQ, 2, {MEMORY,XMMREG,0,0,0}, nasm_bytecodes+15102, IF_WILLAMETTE|IF_SSE2|IF_SQ},
+    {I_MOVQ, 2, {XMMREG,MEMORY,0,0,0}, nasm_bytecodes+15096, IF_WILLAMETTE|IF_SSE2|IF_SQ},
+    {I_MOVQ, 2, {XMMREG,RM_GPR|BITS64,0,0,0}, nasm_bytecodes+8006, IF_X64|IF_SSE2},
+    {I_MOVQ, 2, {RM_GPR|BITS64,XMMREG,0,0,0}, nasm_bytecodes+8013, IF_X64|IF_SSE2},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_MOVQ2DQ[] = {
+    {I_MOVQ2DQ, 2, {XMMREG,MMXREG,0,0,0}, nasm_bytecodes+15108, IF_WILLAMETTE|IF_SSE2},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_MOVSB[] = {
+    {I_MOVSB, 0, {0,0,0,0,0}, nasm_bytecodes+5497, IF_8086},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_MOVSD[] = {
+    {I_MOVSD, 0, {0,0,0,0,0}, nasm_bytecodes+19614, IF_386},
+    {I_MOVSD, 2, {XMMREG,XMMREG,0,0,0}, nasm_bytecodes+15654, IF_WILLAMETTE|IF_SSE2},
+    {I_MOVSD, 2, {XMMREG,XMMREG,0,0,0}, nasm_bytecodes+15660, IF_WILLAMETTE|IF_SSE2},
+    {I_MOVSD, 2, {MEMORY,XMMREG,0,0,0}, nasm_bytecodes+15660, IF_WILLAMETTE|IF_SSE2},
+    {I_MOVSD, 2, {XMMREG,MEMORY,0,0,0}, nasm_bytecodes+15654, IF_WILLAMETTE|IF_SSE2},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_MOVSHDUP[] = {
+    {I_MOVSHDUP, 2, {XMMREG,RM_XMM,0,0,0}, nasm_bytecodes+15792, IF_PRESCOTT|IF_SSE3},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_MOVSLDUP[] = {
+    {I_MOVSLDUP, 2, {XMMREG,RM_XMM,0,0,0}, nasm_bytecodes+15798, IF_PRESCOTT|IF_SSE3},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_MOVSQ[] = {
+    {I_MOVSQ, 0, {0,0,0,0,0}, nasm_bytecodes+19618, IF_X64},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_MOVSS[] = {
+    {I_MOVSS, 2, {XMMREG,MEMORY,0,0,0}, nasm_bytecodes+14892, IF_KATMAI|IF_SSE},
+    {I_MOVSS, 2, {MEMORY,XMMREG,0,0,0}, nasm_bytecodes+14898, IF_KATMAI|IF_SSE},
+    {I_MOVSS, 2, {XMMREG,XMMREG,0,0,0}, nasm_bytecodes+14892, IF_KATMAI|IF_SSE},
+    {I_MOVSS, 2, {XMMREG,XMMREG,0,0,0}, nasm_bytecodes+14898, IF_KATMAI|IF_SSE},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_MOVSW[] = {
+    {I_MOVSW, 0, {0,0,0,0,0}, nasm_bytecodes+19622, IF_8086},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_MOVSX[] = {
+    {I_MOVSX, 2, {REG_GPR|BITS16,MEMORY,0,0,0}, nasm_bytecodes+14214, IF_386|IF_SB},
+    {I_MOVSX, 2, {REG_GPR|BITS16,REG_GPR|BITS8,0,0,0}, nasm_bytecodes+14214, IF_386},
+    {I_MOVSX, 2, {REG_GPR|BITS32,RM_GPR|BITS8,0,0,0}, nasm_bytecodes+14220, IF_386},
+    {I_MOVSX, 2, {REG_GPR|BITS32,RM_GPR|BITS16,0,0,0}, nasm_bytecodes+14226, IF_386},
+    {I_MOVSX, 2, {REG_GPR|BITS64,RM_GPR|BITS8,0,0,0}, nasm_bytecodes+14232, IF_X64},
+    {I_MOVSX, 2, {REG_GPR|BITS64,RM_GPR|BITS16,0,0,0}, nasm_bytecodes+14238, IF_X64},
+    {I_MOVSX, 2, {REG_GPR|BITS64,RM_GPR|BITS32,0,0,0}, nasm_bytecodes+18099, IF_X64},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_MOVSXD[] = {
+    {I_MOVSXD, 2, {REG_GPR|BITS64,RM_GPR|BITS32,0,0,0}, nasm_bytecodes+18099, IF_X64},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_MOVUPD[] = {
+    {I_MOVUPD, 2, {XMMREG,XMMREG,0,0,0}, nasm_bytecodes+15666, IF_WILLAMETTE|IF_SSE2},
+    {I_MOVUPD, 2, {XMMREG,XMMREG,0,0,0}, nasm_bytecodes+15672, IF_WILLAMETTE|IF_SSE2},
+    {I_MOVUPD, 2, {MEMORY,XMMREG,0,0,0}, nasm_bytecodes+15672, IF_WILLAMETTE|IF_SSE2|IF_SO},
+    {I_MOVUPD, 2, {XMMREG,MEMORY,0,0,0}, nasm_bytecodes+15666, IF_WILLAMETTE|IF_SSE2|IF_SO},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_MOVUPS[] = {
+    {I_MOVUPS, 2, {XMMREG,MEMORY,0,0,0}, nasm_bytecodes+14904, IF_KATMAI|IF_SSE},
+    {I_MOVUPS, 2, {MEMORY,XMMREG,0,0,0}, nasm_bytecodes+14910, IF_KATMAI|IF_SSE},
+    {I_MOVUPS, 2, {XMMREG,XMMREG,0,0,0}, nasm_bytecodes+14904, IF_KATMAI|IF_SSE},
+    {I_MOVUPS, 2, {XMMREG,XMMREG,0,0,0}, nasm_bytecodes+14910, IF_KATMAI|IF_SSE},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_MOVZX[] = {
+    {I_MOVZX, 2, {REG_GPR|BITS16,MEMORY,0,0,0}, nasm_bytecodes+14244, IF_386|IF_SB},
+    {I_MOVZX, 2, {REG_GPR|BITS16,REG_GPR|BITS8,0,0,0}, nasm_bytecodes+14244, IF_386},
+    {I_MOVZX, 2, {REG_GPR|BITS32,RM_GPR|BITS8,0,0,0}, nasm_bytecodes+14250, IF_386},
+    {I_MOVZX, 2, {REG_GPR|BITS32,RM_GPR|BITS16,0,0,0}, nasm_bytecodes+14256, IF_386},
+    {I_MOVZX, 2, {REG_GPR|BITS64,RM_GPR|BITS8,0,0,0}, nasm_bytecodes+14262, IF_X64},
+    {I_MOVZX, 2, {REG_GPR|BITS64,RM_GPR|BITS16,0,0,0}, nasm_bytecodes+14268, IF_X64},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_MPSADBW[] = {
+    {I_MPSADBW, 3, {XMMREG,RM_XMM,IMMEDIATE,0,0}, nasm_bytecodes+5980, IF_SSE41},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_MUL[] = {
+    {I_MUL, 1, {RM_GPR|BITS8,0,0,0,0}, nasm_bytecodes+19626, IF_8086},
+    {I_MUL, 1, {RM_GPR|BITS16,0,0,0,0}, nasm_bytecodes+18104, IF_8086},
+    {I_MUL, 1, {RM_GPR|BITS32,0,0,0,0}, nasm_bytecodes+18109, IF_386},
+    {I_MUL, 1, {RM_GPR|BITS64,0,0,0,0}, nasm_bytecodes+18114, IF_X64},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_MULPD[] = {
+    {I_MULPD, 2, {XMMREG,RM_XMM,0,0,0}, nasm_bytecodes+15678, IF_WILLAMETTE|IF_SSE2|IF_SO},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_MULPS[] = {
+    {I_MULPS, 2, {XMMREG,RM_XMM,0,0,0}, nasm_bytecodes+14916, IF_KATMAI|IF_SSE},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_MULSD[] = {
+    {I_MULSD, 2, {XMMREG,RM_XMM,0,0,0}, nasm_bytecodes+15684, IF_WILLAMETTE|IF_SSE2},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_MULSS[] = {
+    {I_MULSS, 2, {XMMREG,RM_XMM,0,0,0}, nasm_bytecodes+14922, IF_KATMAI|IF_SSE},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_MWAIT[] = {
+    {I_MWAIT, 0, {0,0,0,0,0}, nasm_bytecodes+18119, IF_PRESCOTT},
+    {I_MWAIT, 2, {REG_EAX,REG_ECX,0,0,0}, nasm_bytecodes+18119, IF_PRESCOTT},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_NEG[] = {
+    {I_NEG, 1, {RM_GPR|BITS8,0,0,0,0}, nasm_bytecodes+19630, IF_8086},
+    {I_NEG, 1, {RM_GPR|BITS16,0,0,0,0}, nasm_bytecodes+18124, IF_8086},
+    {I_NEG, 1, {RM_GPR|BITS32,0,0,0,0}, nasm_bytecodes+18129, IF_386},
+    {I_NEG, 1, {RM_GPR|BITS64,0,0,0,0}, nasm_bytecodes+18134, IF_X64},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_NOP[] = {
+    {I_NOP, 0, {0,0,0,0,0}, nasm_bytecodes+19634, IF_8086},
+    {I_NOP, 1, {RM_GPR|BITS16,0,0,0,0}, nasm_bytecodes+14274, IF_P6},
+    {I_NOP, 1, {RM_GPR|BITS32,0,0,0,0}, nasm_bytecodes+14280, IF_P6},
+    {I_NOP, 1, {RM_GPR|BITS64,0,0,0,0}, nasm_bytecodes+14286, IF_X64},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_NOT[] = {
+    {I_NOT, 1, {RM_GPR|BITS8,0,0,0,0}, nasm_bytecodes+19638, IF_8086},
+    {I_NOT, 1, {RM_GPR|BITS16,0,0,0,0}, nasm_bytecodes+18139, IF_8086},
+    {I_NOT, 1, {RM_GPR|BITS32,0,0,0,0}, nasm_bytecodes+18144, IF_386},
+    {I_NOT, 1, {RM_GPR|BITS64,0,0,0,0}, nasm_bytecodes+18149, IF_X64},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_OR[] = {
+    {I_OR, 2, {MEMORY,REG_GPR|BITS8,0,0,0}, nasm_bytecodes+19642, IF_8086|IF_SM},
+    {I_OR, 2, {REG_GPR|BITS8,REG_GPR|BITS8,0,0,0}, nasm_bytecodes+19642, IF_8086},
+    {I_OR, 2, {MEMORY,REG_GPR|BITS16,0,0,0}, nasm_bytecodes+18154, IF_8086|IF_SM},
+    {I_OR, 2, {REG_GPR|BITS16,REG_GPR|BITS16,0,0,0}, nasm_bytecodes+18154, IF_8086},
+    {I_OR, 2, {MEMORY,REG_GPR|BITS32,0,0,0}, nasm_bytecodes+18159, IF_386|IF_SM},
+    {I_OR, 2, {REG_GPR|BITS32,REG_GPR|BITS32,0,0,0}, nasm_bytecodes+18159, IF_386},
+    {I_OR, 2, {MEMORY,REG_GPR|BITS64,0,0,0}, nasm_bytecodes+18164, IF_X64|IF_SM},
+    {I_OR, 2, {REG_GPR|BITS64,REG_GPR|BITS64,0,0,0}, nasm_bytecodes+18164, IF_X64},
+    {I_OR, 2, {REG_GPR|BITS8,MEMORY,0,0,0}, nasm_bytecodes+11411, IF_8086|IF_SM},
+    {I_OR, 2, {REG_GPR|BITS8,REG_GPR|BITS8,0,0,0}, nasm_bytecodes+11411, IF_8086},
+    {I_OR, 2, {REG_GPR|BITS16,MEMORY,0,0,0}, nasm_bytecodes+18169, IF_8086|IF_SM},
+    {I_OR, 2, {REG_GPR|BITS16,REG_GPR|BITS16,0,0,0}, nasm_bytecodes+18169, IF_8086},
+    {I_OR, 2, {REG_GPR|BITS32,MEMORY,0,0,0}, nasm_bytecodes+18174, IF_386|IF_SM},
+    {I_OR, 2, {REG_GPR|BITS32,REG_GPR|BITS32,0,0,0}, nasm_bytecodes+18174, IF_386},
+    {I_OR, 2, {REG_GPR|BITS64,MEMORY,0,0,0}, nasm_bytecodes+18179, IF_X64|IF_SM},
+    {I_OR, 2, {REG_GPR|BITS64,REG_GPR|BITS64,0,0,0}, nasm_bytecodes+18179, IF_X64},
+    {I_OR, 2, {RM_GPR|BITS16,IMMEDIATE|BITS8,0,0,0}, nasm_bytecodes+14292, IF_8086},
+    {I_OR, 2, {RM_GPR|BITS32,IMMEDIATE|BITS8,0,0,0}, nasm_bytecodes+14298, IF_386},
+    {I_OR, 2, {RM_GPR|BITS64,IMMEDIATE|BITS8,0,0,0}, nasm_bytecodes+14304, IF_X64},
+    {I_OR, 2, {REG_AL,IMMEDIATE,0,0,0}, nasm_bytecodes+19646, IF_8086|IF_SM},
+    {I_OR, 2, {REG_AX,SBYTE16,0,0,0}, nasm_bytecodes+14292, IF_8086|IF_SM},
+    {I_OR, 2, {REG_AX,IMMEDIATE,0,0,0}, nasm_bytecodes+18184, IF_8086|IF_SM},
+    {I_OR, 2, {REG_EAX,SBYTE32,0,0,0}, nasm_bytecodes+14298, IF_386|IF_SM},
+    {I_OR, 2, {REG_EAX,IMMEDIATE,0,0,0}, nasm_bytecodes+18189, IF_386|IF_SM},
+    {I_OR, 2, {REG_RAX,SBYTE64,0,0,0}, nasm_bytecodes+14304, IF_X64|IF_SM},
+    {I_OR, 2, {REG_RAX,IMMEDIATE,0,0,0}, nasm_bytecodes+18194, IF_X64|IF_SM},
+    {I_OR, 2, {RM_GPR|BITS8,IMMEDIATE,0,0,0}, nasm_bytecodes+18199, IF_8086|IF_SM},
+    {I_OR, 2, {RM_GPR|BITS16,IMMEDIATE,0,0,0}, nasm_bytecodes+14310, IF_8086|IF_SM},
+    {I_OR, 2, {RM_GPR|BITS32,IMMEDIATE,0,0,0}, nasm_bytecodes+14316, IF_386|IF_SM},
+    {I_OR, 2, {RM_GPR|BITS64,IMMEDIATE,0,0,0}, nasm_bytecodes+14322, IF_X64|IF_SM},
+    {I_OR, 2, {MEMORY,IMMEDIATE|BITS8,0,0,0}, nasm_bytecodes+18199, IF_8086|IF_SM},
+    {I_OR, 2, {MEMORY,IMMEDIATE|BITS16,0,0,0}, nasm_bytecodes+14310, IF_8086|IF_SM},
+    {I_OR, 2, {MEMORY,IMMEDIATE|BITS32,0,0,0}, nasm_bytecodes+14316, IF_386|IF_SM},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_ORPD[] = {
+    {I_ORPD, 2, {XMMREG,RM_XMM,0,0,0}, nasm_bytecodes+15690, IF_WILLAMETTE|IF_SSE2|IF_SO},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_ORPS[] = {
+    {I_ORPS, 2, {XMMREG,RM_XMM,0,0,0}, nasm_bytecodes+14928, IF_KATMAI|IF_SSE},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_OUT[] = {
+    {I_OUT, 2, {IMMEDIATE,REG_AL,0,0,0}, nasm_bytecodes+19650, IF_8086|IF_SB},
+    {I_OUT, 2, {IMMEDIATE,REG_AX,0,0,0}, nasm_bytecodes+18204, IF_8086|IF_SB},
+    {I_OUT, 2, {IMMEDIATE,REG_EAX,0,0,0}, nasm_bytecodes+18209, IF_386|IF_SB},
+    {I_OUT, 2, {REG_DX,REG_AL,0,0,0}, nasm_bytecodes+20007, IF_8086},
+    {I_OUT, 2, {REG_DX,REG_AX,0,0,0}, nasm_bytecodes+19654, IF_8086},
+    {I_OUT, 2, {REG_DX,REG_EAX,0,0,0}, nasm_bytecodes+19658, IF_386},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_OUTSB[] = {
+    {I_OUTSB, 0, {0,0,0,0,0}, nasm_bytecodes+20010, IF_186},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_OUTSD[] = {
+    {I_OUTSD, 0, {0,0,0,0,0}, nasm_bytecodes+19662, IF_386},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_OUTSW[] = {
+    {I_OUTSW, 0, {0,0,0,0,0}, nasm_bytecodes+19666, IF_186},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_PABSB[] = {
+    {I_PABSB, 2, {MMXREG,RM_MMX,0,0,0}, nasm_bytecodes+8202, IF_SSSE3|IF_MMX|IF_SQ},
+    {I_PABSB, 2, {XMMREG,RM_XMM,0,0,0}, nasm_bytecodes+8209, IF_SSSE3},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_PABSD[] = {
+    {I_PABSD, 2, {MMXREG,RM_MMX,0,0,0}, nasm_bytecodes+8230, IF_SSSE3|IF_MMX|IF_SQ},
+    {I_PABSD, 2, {XMMREG,RM_XMM,0,0,0}, nasm_bytecodes+8237, IF_SSSE3},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_PABSW[] = {
+    {I_PABSW, 2, {MMXREG,RM_MMX,0,0,0}, nasm_bytecodes+8216, IF_SSSE3|IF_MMX|IF_SQ},
+    {I_PABSW, 2, {XMMREG,RM_XMM,0,0,0}, nasm_bytecodes+8223, IF_SSSE3},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_PACKSSDW[] = {
+    {I_PACKSSDW, 2, {MMXREG,RM_MMX,0,0,0}, nasm_bytecodes+7383, IF_PENT|IF_MMX|IF_SQ},
+    {I_PACKSSDW, 2, {XMMREG,RM_XMM,0,0,0}, nasm_bytecodes+15120, IF_WILLAMETTE|IF_SSE2|IF_SO},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_PACKSSWB[] = {
+    {I_PACKSSWB, 2, {MMXREG,RM_MMX,0,0,0}, nasm_bytecodes+7390, IF_PENT|IF_MMX|IF_SQ},
+    {I_PACKSSWB, 2, {XMMREG,RM_XMM,0,0,0}, nasm_bytecodes+15114, IF_WILLAMETTE|IF_SSE2|IF_SO},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_PACKUSDW[] = {
+    {I_PACKUSDW, 2, {XMMREG,RM_XMM,0,0,0}, nasm_bytecodes+8454, IF_SSE41},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_PACKUSWB[] = {
+    {I_PACKUSWB, 2, {MMXREG,RM_MMX,0,0,0}, nasm_bytecodes+7397, IF_PENT|IF_MMX|IF_SQ},
+    {I_PACKUSWB, 2, {XMMREG,RM_XMM,0,0,0}, nasm_bytecodes+15126, IF_WILLAMETTE|IF_SSE2|IF_SO},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_PADDB[] = {
+    {I_PADDB, 2, {MMXREG,RM_MMX,0,0,0}, nasm_bytecodes+7404, IF_PENT|IF_MMX|IF_SQ},
+    {I_PADDB, 2, {XMMREG,RM_XMM,0,0,0}, nasm_bytecodes+15132, IF_WILLAMETTE|IF_SSE2|IF_SO},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_PADDD[] = {
+    {I_PADDD, 2, {MMXREG,RM_MMX,0,0,0}, nasm_bytecodes+7411, IF_PENT|IF_MMX|IF_SQ},
+    {I_PADDD, 2, {XMMREG,RM_XMM,0,0,0}, nasm_bytecodes+15144, IF_WILLAMETTE|IF_SSE2|IF_SO},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_PADDQ[] = {
+    {I_PADDQ, 2, {MMXREG,RM_MMX,0,0,0}, nasm_bytecodes+15150, IF_WILLAMETTE|IF_MMX|IF_SQ},
+    {I_PADDQ, 2, {XMMREG,RM_XMM,0,0,0}, nasm_bytecodes+15156, IF_WILLAMETTE|IF_SSE2|IF_SO},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_PADDSB[] = {
+    {I_PADDSB, 2, {MMXREG,RM_MMX,0,0,0}, nasm_bytecodes+7418, IF_PENT|IF_MMX|IF_SQ},
+    {I_PADDSB, 2, {XMMREG,RM_XMM,0,0,0}, nasm_bytecodes+15162, IF_WILLAMETTE|IF_SSE2|IF_SO},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_PADDSIW[] = {
+    {I_PADDSIW, 2, {MMXREG,RM_MMX,0,0,0}, nasm_bytecodes+14328, IF_PENT|IF_MMX|IF_SQ|IF_CYRIX},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_PADDSW[] = {
+    {I_PADDSW, 2, {MMXREG,RM_MMX,0,0,0}, nasm_bytecodes+7425, IF_PENT|IF_MMX|IF_SQ},
+    {I_PADDSW, 2, {XMMREG,RM_XMM,0,0,0}, nasm_bytecodes+15168, IF_WILLAMETTE|IF_SSE2|IF_SO},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_PADDUSB[] = {
+    {I_PADDUSB, 2, {MMXREG,RM_MMX,0,0,0}, nasm_bytecodes+7432, IF_PENT|IF_MMX|IF_SQ},
+    {I_PADDUSB, 2, {XMMREG,RM_XMM,0,0,0}, nasm_bytecodes+15174, IF_WILLAMETTE|IF_SSE2|IF_SO},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_PADDUSW[] = {
+    {I_PADDUSW, 2, {MMXREG,RM_MMX,0,0,0}, nasm_bytecodes+7439, IF_PENT|IF_MMX|IF_SQ},
+    {I_PADDUSW, 2, {XMMREG,RM_XMM,0,0,0}, nasm_bytecodes+15180, IF_WILLAMETTE|IF_SSE2|IF_SO},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_PADDW[] = {
+    {I_PADDW, 2, {MMXREG,RM_MMX,0,0,0}, nasm_bytecodes+7446, IF_PENT|IF_MMX|IF_SQ},
+    {I_PADDW, 2, {XMMREG,RM_XMM,0,0,0}, nasm_bytecodes+15138, IF_WILLAMETTE|IF_SSE2|IF_SO},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_PALIGNR[] = {
+    {I_PALIGNR, 3, {MMXREG,RM_MMX,IMMEDIATE,0,0}, nasm_bytecodes+5908, IF_SSSE3|IF_MMX|IF_SQ},
+    {I_PALIGNR, 3, {XMMREG,RM_XMM,IMMEDIATE,0,0}, nasm_bytecodes+5916, IF_SSSE3},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_PAND[] = {
+    {I_PAND, 2, {MMXREG,RM_MMX,0,0,0}, nasm_bytecodes+7453, IF_PENT|IF_MMX|IF_SQ},
+    {I_PAND, 2, {XMMREG,RM_XMM,0,0,0}, nasm_bytecodes+15186, IF_WILLAMETTE|IF_SSE2|IF_SO},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_PANDN[] = {
+    {I_PANDN, 2, {MMXREG,RM_MMX,0,0,0}, nasm_bytecodes+7460, IF_PENT|IF_MMX|IF_SQ},
+    {I_PANDN, 2, {XMMREG,RM_XMM,0,0,0}, nasm_bytecodes+15192, IF_WILLAMETTE|IF_SSE2|IF_SO},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_PAUSE[] = {
+    {I_PAUSE, 0, {0,0,0,0,0}, nasm_bytecodes+18214, IF_8086},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_PAVEB[] = {
+    {I_PAVEB, 2, {MMXREG,RM_MMX,0,0,0}, nasm_bytecodes+14334, IF_PENT|IF_MMX|IF_SQ|IF_CYRIX},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_PAVGB[] = {
+    {I_PAVGB, 2, {MMXREG,RM_MMX,0,0,0}, nasm_bytecodes+7915, IF_KATMAI|IF_MMX|IF_SQ},
+    {I_PAVGB, 2, {XMMREG,RM_XMM,0,0,0}, nasm_bytecodes+15198, IF_WILLAMETTE|IF_SSE2|IF_SO},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_PAVGUSB[] = {
+    {I_PAVGUSB, 2, {MMXREG,RM_MMX,0,0,0}, nasm_bytecodes+5436, IF_PENT|IF_3DNOW|IF_SQ},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_PAVGW[] = {
+    {I_PAVGW, 2, {MMXREG,RM_MMX,0,0,0}, nasm_bytecodes+7922, IF_KATMAI|IF_MMX|IF_SQ},
+    {I_PAVGW, 2, {XMMREG,RM_XMM,0,0,0}, nasm_bytecodes+15204, IF_WILLAMETTE|IF_SSE2|IF_SO},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_PBLENDVB[] = {
+    {I_PBLENDVB, 3, {XMMREG,RM_XMM,XMM0,0,0}, nasm_bytecodes+8461, IF_SSE41},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_PBLENDW[] = {
+    {I_PBLENDW, 3, {XMMREG,RM_XMM,IMMEDIATE,0,0}, nasm_bytecodes+5988, IF_SSE41},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_PCLMULHQHQDQ[] = {
+    {I_PCLMULHQHQDQ, 2, {XMMREG,RM_XMM|BITS128,0,0,0}, nasm_bytecodes+3879, IF_SSE|IF_WESTMERE},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_PCLMULHQLQDQ[] = {
+    {I_PCLMULHQLQDQ, 2, {XMMREG,RM_XMM|BITS128,0,0,0}, nasm_bytecodes+3861, IF_SSE|IF_WESTMERE},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_PCLMULLQHQDQ[] = {
+    {I_PCLMULLQHQDQ, 2, {XMMREG,RM_XMM|BITS128,0,0,0}, nasm_bytecodes+3870, IF_SSE|IF_WESTMERE},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_PCLMULLQLQDQ[] = {
+    {I_PCLMULLQLQDQ, 2, {XMMREG,RM_XMM|BITS128,0,0,0}, nasm_bytecodes+3852, IF_SSE|IF_WESTMERE},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_PCLMULQDQ[] = {
+    {I_PCLMULQDQ, 3, {XMMREG,RM_XMM|BITS128,IMMEDIATE|BITS8,0,0}, nasm_bytecodes+6908, IF_SSE|IF_WESTMERE},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_PCMPEQB[] = {
+    {I_PCMPEQB, 2, {MMXREG,RM_MMX,0,0,0}, nasm_bytecodes+7467, IF_PENT|IF_MMX|IF_SQ},
+    {I_PCMPEQB, 2, {XMMREG,RM_XMM,0,0,0}, nasm_bytecodes+15210, IF_WILLAMETTE|IF_SSE2|IF_SO},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_PCMPEQD[] = {
+    {I_PCMPEQD, 2, {MMXREG,RM_MMX,0,0,0}, nasm_bytecodes+7474, IF_PENT|IF_MMX|IF_SQ},
+    {I_PCMPEQD, 2, {XMMREG,RM_XMM,0,0,0}, nasm_bytecodes+15222, IF_WILLAMETTE|IF_SSE2|IF_SO},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_PCMPEQQ[] = {
+    {I_PCMPEQQ, 2, {XMMREG,RM_XMM,0,0,0}, nasm_bytecodes+8468, IF_SSE41},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_PCMPEQW[] = {
+    {I_PCMPEQW, 2, {MMXREG,RM_MMX,0,0,0}, nasm_bytecodes+7481, IF_PENT|IF_MMX|IF_SQ},
+    {I_PCMPEQW, 2, {XMMREG,RM_XMM,0,0,0}, nasm_bytecodes+15216, IF_WILLAMETTE|IF_SSE2|IF_SO},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_PCMPESTRI[] = {
+    {I_PCMPESTRI, 3, {XMMREG,RM_XMM,IMMEDIATE,0,0}, nasm_bytecodes+6060, IF_SSE42},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_PCMPESTRM[] = {
+    {I_PCMPESTRM, 3, {XMMREG,RM_XMM,IMMEDIATE,0,0}, nasm_bytecodes+6068, IF_SSE42},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_PCMPGTB[] = {
+    {I_PCMPGTB, 2, {MMXREG,RM_MMX,0,0,0}, nasm_bytecodes+7488, IF_PENT|IF_MMX|IF_SQ},
+    {I_PCMPGTB, 2, {XMMREG,RM_XMM,0,0,0}, nasm_bytecodes+15228, IF_WILLAMETTE|IF_SSE2|IF_SO},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_PCMPGTD[] = {
+    {I_PCMPGTD, 2, {MMXREG,RM_MMX,0,0,0}, nasm_bytecodes+7495, IF_PENT|IF_MMX|IF_SQ},
+    {I_PCMPGTD, 2, {XMMREG,RM_XMM,0,0,0}, nasm_bytecodes+15240, IF_WILLAMETTE|IF_SSE2|IF_SO},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_PCMPGTQ[] = {
+    {I_PCMPGTQ, 2, {XMMREG,RM_XMM,0,0,0}, nasm_bytecodes+8643, IF_SSE42},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_PCMPGTW[] = {
+    {I_PCMPGTW, 2, {MMXREG,RM_MMX,0,0,0}, nasm_bytecodes+7502, IF_PENT|IF_MMX|IF_SQ},
+    {I_PCMPGTW, 2, {XMMREG,RM_XMM,0,0,0}, nasm_bytecodes+15234, IF_WILLAMETTE|IF_SSE2|IF_SO},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_PCMPISTRI[] = {
+    {I_PCMPISTRI, 3, {XMMREG,RM_XMM,IMMEDIATE,0,0}, nasm_bytecodes+6076, IF_SSE42},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_PCMPISTRM[] = {
+    {I_PCMPISTRM, 3, {XMMREG,RM_XMM,IMMEDIATE,0,0}, nasm_bytecodes+6084, IF_SSE42},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_PDISTIB[] = {
+    {I_PDISTIB, 2, {MMXREG,MEMORY,0,0,0}, nasm_bytecodes+15487, IF_PENT|IF_MMX|IF_SM|IF_CYRIX},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_PEXTRB[] = {
+    {I_PEXTRB, 3, {REG_GPR|BITS32,XMMREG,IMMEDIATE,0,0}, nasm_bytecodes+10, IF_SSE41},
+    {I_PEXTRB, 3, {MEMORY|BITS8,XMMREG,IMMEDIATE,0,0}, nasm_bytecodes+10, IF_SSE41},
+    {I_PEXTRB, 3, {REG_GPR|BITS64,XMMREG,IMMEDIATE,0,0}, nasm_bytecodes+9, IF_SSE41|IF_X64},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_PEXTRD[] = {
+    {I_PEXTRD, 3, {RM_GPR|BITS32,XMMREG,IMMEDIATE,0,0}, nasm_bytecodes+19, IF_SSE41},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_PEXTRQ[] = {
+    {I_PEXTRQ, 3, {RM_GPR|BITS64,XMMREG,IMMEDIATE,0,0}, nasm_bytecodes+18, IF_SSE41|IF_X64},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_PEXTRW[] = {
+    {I_PEXTRW, 3, {REG_GPR|BITS32,MMXREG,IMMEDIATE,0,0}, nasm_bytecodes+7929, IF_KATMAI|IF_MMX|IF_SB|IF_AR2},
+    {I_PEXTRW, 3, {REG_GPR|BITS32,XMMREG,IMMEDIATE,0,0}, nasm_bytecodes+8020, IF_WILLAMETTE|IF_SSE2|IF_SB|IF_AR2},
+    {I_PEXTRW, 3, {REG_GPR|BITS32,XMMREG,IMMEDIATE,0,0}, nasm_bytecodes+28, IF_SSE41},
+    {I_PEXTRW, 3, {MEMORY|BITS16,XMMREG,IMMEDIATE,0,0}, nasm_bytecodes+28, IF_SSE41},
+    {I_PEXTRW, 3, {REG_GPR|BITS64,XMMREG,IMMEDIATE,0,0}, nasm_bytecodes+27, IF_SSE41|IF_X64},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_PF2ID[] = {
+    {I_PF2ID, 2, {MMXREG,RM_MMX,0,0,0}, nasm_bytecodes+5444, IF_PENT|IF_3DNOW|IF_SQ},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_PF2IW[] = {
+    {I_PF2IW, 2, {MMXREG,RM_MMX,0,0,0}, nasm_bytecodes+5724, IF_PENT|IF_3DNOW|IF_SQ},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_PFACC[] = {
+    {I_PFACC, 2, {MMXREG,RM_MMX,0,0,0}, nasm_bytecodes+5452, IF_PENT|IF_3DNOW|IF_SQ},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_PFADD[] = {
+    {I_PFADD, 2, {MMXREG,RM_MMX,0,0,0}, nasm_bytecodes+5460, IF_PENT|IF_3DNOW|IF_SQ},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_PFCMPEQ[] = {
+    {I_PFCMPEQ, 2, {MMXREG,RM_MMX,0,0,0}, nasm_bytecodes+5468, IF_PENT|IF_3DNOW|IF_SQ},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_PFCMPGE[] = {
+    {I_PFCMPGE, 2, {MMXREG,RM_MMX,0,0,0}, nasm_bytecodes+5476, IF_PENT|IF_3DNOW|IF_SQ},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_PFCMPGT[] = {
+    {I_PFCMPGT, 2, {MMXREG,RM_MMX,0,0,0}, nasm_bytecodes+5484, IF_PENT|IF_3DNOW|IF_SQ},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_PFMAX[] = {
+    {I_PFMAX, 2, {MMXREG,RM_MMX,0,0,0}, nasm_bytecodes+5492, IF_PENT|IF_3DNOW|IF_SQ},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_PFMIN[] = {
+    {I_PFMIN, 2, {MMXREG,RM_MMX,0,0,0}, nasm_bytecodes+5500, IF_PENT|IF_3DNOW|IF_SQ},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_PFMUL[] = {
+    {I_PFMUL, 2, {MMXREG,RM_MMX,0,0,0}, nasm_bytecodes+5508, IF_PENT|IF_3DNOW|IF_SQ},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_PFNACC[] = {
+    {I_PFNACC, 2, {MMXREG,RM_MMX,0,0,0}, nasm_bytecodes+5732, IF_PENT|IF_3DNOW|IF_SQ},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_PFPNACC[] = {
+    {I_PFPNACC, 2, {MMXREG,RM_MMX,0,0,0}, nasm_bytecodes+5740, IF_PENT|IF_3DNOW|IF_SQ},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_PFRCP[] = {
+    {I_PFRCP, 2, {MMXREG,RM_MMX,0,0,0}, nasm_bytecodes+5516, IF_PENT|IF_3DNOW|IF_SQ},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_PFRCPIT1[] = {
+    {I_PFRCPIT1, 2, {MMXREG,RM_MMX,0,0,0}, nasm_bytecodes+5524, IF_PENT|IF_3DNOW|IF_SQ},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_PFRCPIT2[] = {
+    {I_PFRCPIT2, 2, {MMXREG,RM_MMX,0,0,0}, nasm_bytecodes+5532, IF_PENT|IF_3DNOW|IF_SQ},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_PFRCPV[] = {
+    {I_PFRCPV, 2, {MMXREG,RM_MMX,0,0,0}, nasm_bytecodes+6092, IF_PENT|IF_3DNOW|IF_SQ|IF_CYRIX},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_PFRSQIT1[] = {
+    {I_PFRSQIT1, 2, {MMXREG,RM_MMX,0,0,0}, nasm_bytecodes+5540, IF_PENT|IF_3DNOW|IF_SQ},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_PFRSQRT[] = {
+    {I_PFRSQRT, 2, {MMXREG,RM_MMX,0,0,0}, nasm_bytecodes+5548, IF_PENT|IF_3DNOW|IF_SQ},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_PFRSQRTV[] = {
+    {I_PFRSQRTV, 2, {MMXREG,RM_MMX,0,0,0}, nasm_bytecodes+6100, IF_PENT|IF_3DNOW|IF_SQ|IF_CYRIX},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_PFSUB[] = {
+    {I_PFSUB, 2, {MMXREG,RM_MMX,0,0,0}, nasm_bytecodes+5556, IF_PENT|IF_3DNOW|IF_SQ},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_PFSUBR[] = {
+    {I_PFSUBR, 2, {MMXREG,RM_MMX,0,0,0}, nasm_bytecodes+5564, IF_PENT|IF_3DNOW|IF_SQ},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_PHADDD[] = {
+    {I_PHADDD, 2, {MMXREG,RM_MMX,0,0,0}, nasm_bytecodes+8258, IF_SSSE3|IF_MMX|IF_SQ},
+    {I_PHADDD, 2, {XMMREG,RM_XMM,0,0,0}, nasm_bytecodes+8265, IF_SSSE3},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_PHADDSW[] = {
+    {I_PHADDSW, 2, {MMXREG,RM_MMX,0,0,0}, nasm_bytecodes+8272, IF_SSSE3|IF_MMX|IF_SQ},
+    {I_PHADDSW, 2, {XMMREG,RM_XMM,0,0,0}, nasm_bytecodes+8279, IF_SSSE3},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_PHADDW[] = {
+    {I_PHADDW, 2, {MMXREG,RM_MMX,0,0,0}, nasm_bytecodes+8244, IF_SSSE3|IF_MMX|IF_SQ},
+    {I_PHADDW, 2, {XMMREG,RM_XMM,0,0,0}, nasm_bytecodes+8251, IF_SSSE3},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_PHMINPOSUW[] = {
+    {I_PHMINPOSUW, 2, {XMMREG,RM_XMM,0,0,0}, nasm_bytecodes+8475, IF_SSE41},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_PHSUBD[] = {
+    {I_PHSUBD, 2, {MMXREG,RM_MMX,0,0,0}, nasm_bytecodes+8300, IF_SSSE3|IF_MMX|IF_SQ},
+    {I_PHSUBD, 2, {XMMREG,RM_XMM,0,0,0}, nasm_bytecodes+8307, IF_SSSE3},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_PHSUBSW[] = {
+    {I_PHSUBSW, 2, {MMXREG,RM_MMX,0,0,0}, nasm_bytecodes+8314, IF_SSSE3|IF_MMX|IF_SQ},
+    {I_PHSUBSW, 2, {XMMREG,RM_XMM,0,0,0}, nasm_bytecodes+8321, IF_SSSE3},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_PHSUBW[] = {
+    {I_PHSUBW, 2, {MMXREG,RM_MMX,0,0,0}, nasm_bytecodes+8286, IF_SSSE3|IF_MMX|IF_SQ},
+    {I_PHSUBW, 2, {XMMREG,RM_XMM,0,0,0}, nasm_bytecodes+8293, IF_SSSE3},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_PI2FD[] = {
+    {I_PI2FD, 2, {MMXREG,RM_MMX,0,0,0}, nasm_bytecodes+5572, IF_PENT|IF_3DNOW|IF_SQ},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_PI2FW[] = {
+    {I_PI2FW, 2, {MMXREG,RM_MMX,0,0,0}, nasm_bytecodes+5748, IF_PENT|IF_3DNOW|IF_SQ},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_PINSRB[] = {
+    {I_PINSRB, 3, {XMMREG,MEMORY,IMMEDIATE,0,0}, nasm_bytecodes+37, IF_SSE41|IF_SB|IF_AR2},
+    {I_PINSRB, 3, {XMMREG,RM_GPR|BITS8,IMMEDIATE,0,0}, nasm_bytecodes+36, IF_SSE41|IF_SB|IF_AR2},
+    {I_PINSRB, 3, {XMMREG,REG_GPR|BITS32,IMMEDIATE,0,0}, nasm_bytecodes+37, IF_SSE41|IF_SB|IF_AR2},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_PINSRD[] = {
+    {I_PINSRD, 3, {XMMREG,MEMORY,IMMEDIATE,0,0}, nasm_bytecodes+46, IF_SSE41|IF_SB|IF_AR2},
+    {I_PINSRD, 3, {XMMREG,RM_GPR|BITS32,IMMEDIATE,0,0}, nasm_bytecodes+46, IF_SSE41|IF_SB|IF_AR2},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_PINSRQ[] = {
+    {I_PINSRQ, 3, {XMMREG,MEMORY,IMMEDIATE,0,0}, nasm_bytecodes+45, IF_SSE41|IF_X64|IF_SB|IF_AR2},
+    {I_PINSRQ, 3, {XMMREG,RM_GPR|BITS64,IMMEDIATE,0,0}, nasm_bytecodes+45, IF_SSE41|IF_X64|IF_SB|IF_AR2},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_PINSRW[] = {
+    {I_PINSRW, 3, {MMXREG,MEMORY,IMMEDIATE,0,0}, nasm_bytecodes+7936, IF_KATMAI|IF_MMX|IF_SB|IF_AR2},
+    {I_PINSRW, 3, {MMXREG,RM_GPR|BITS16,IMMEDIATE,0,0}, nasm_bytecodes+7936, IF_KATMAI|IF_MMX|IF_SB|IF_AR2},
+    {I_PINSRW, 3, {MMXREG,REG_GPR|BITS32,IMMEDIATE,0,0}, nasm_bytecodes+7936, IF_KATMAI|IF_MMX|IF_SB|IF_AR2},
+    {I_PINSRW, 3, {XMMREG,REG_GPR|BITS16,IMMEDIATE,0,0}, nasm_bytecodes+8027, IF_WILLAMETTE|IF_SSE2|IF_SB|IF_AR2},
+    {I_PINSRW, 3, {XMMREG,REG_GPR|BITS32,IMMEDIATE,0,0}, nasm_bytecodes+8027, IF_WILLAMETTE|IF_SSE2|IF_SB|IF_AR2},
+    {I_PINSRW, 3, {XMMREG,MEMORY,IMMEDIATE,0,0}, nasm_bytecodes+8027, IF_WILLAMETTE|IF_SSE2|IF_SB|IF_AR2},
+    {I_PINSRW, 3, {XMMREG,MEMORY|BITS16,IMMEDIATE,0,0}, nasm_bytecodes+8027, IF_WILLAMETTE|IF_SSE2|IF_SB|IF_AR2},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_PMACHRIW[] = {
+    {I_PMACHRIW, 2, {MMXREG,MEMORY,0,0,0}, nasm_bytecodes+15583, IF_PENT|IF_MMX|IF_SM|IF_CYRIX},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_PMADDUBSW[] = {
+    {I_PMADDUBSW, 2, {MMXREG,RM_MMX,0,0,0}, nasm_bytecodes+8328, IF_SSSE3|IF_MMX|IF_SQ},
+    {I_PMADDUBSW, 2, {XMMREG,RM_XMM,0,0,0}, nasm_bytecodes+8335, IF_SSSE3},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_PMADDWD[] = {
+    {I_PMADDWD, 2, {MMXREG,RM_MMX,0,0,0}, nasm_bytecodes+7509, IF_PENT|IF_MMX|IF_SQ},
+    {I_PMADDWD, 2, {XMMREG,RM_XMM,0,0,0}, nasm_bytecodes+15246, IF_WILLAMETTE|IF_SSE2|IF_SO},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_PMAGW[] = {
+    {I_PMAGW, 2, {MMXREG,RM_MMX,0,0,0}, nasm_bytecodes+14340, IF_PENT|IF_MMX|IF_SQ|IF_CYRIX},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_PMAXSB[] = {
+    {I_PMAXSB, 2, {XMMREG,RM_XMM,0,0,0}, nasm_bytecodes+8482, IF_SSE41},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_PMAXSD[] = {
+    {I_PMAXSD, 2, {XMMREG,RM_XMM,0,0,0}, nasm_bytecodes+8489, IF_SSE41},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_PMAXSW[] = {
+    {I_PMAXSW, 2, {MMXREG,RM_MMX,0,0,0}, nasm_bytecodes+7943, IF_KATMAI|IF_MMX|IF_SQ},
+    {I_PMAXSW, 2, {XMMREG,RM_XMM,0,0,0}, nasm_bytecodes+15252, IF_WILLAMETTE|IF_SSE2|IF_SO},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_PMAXUB[] = {
+    {I_PMAXUB, 2, {MMXREG,RM_MMX,0,0,0}, nasm_bytecodes+7950, IF_KATMAI|IF_MMX|IF_SQ},
+    {I_PMAXUB, 2, {XMMREG,RM_XMM,0,0,0}, nasm_bytecodes+15258, IF_WILLAMETTE|IF_SSE2|IF_SO},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_PMAXUD[] = {
+    {I_PMAXUD, 2, {XMMREG,RM_XMM,0,0,0}, nasm_bytecodes+8496, IF_SSE41},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_PMAXUW[] = {
+    {I_PMAXUW, 2, {XMMREG,RM_XMM,0,0,0}, nasm_bytecodes+8503, IF_SSE41},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_PMINSB[] = {
+    {I_PMINSB, 2, {XMMREG,RM_XMM,0,0,0}, nasm_bytecodes+8510, IF_SSE41},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_PMINSD[] = {
+    {I_PMINSD, 2, {XMMREG,RM_XMM,0,0,0}, nasm_bytecodes+8517, IF_SSE41},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_PMINSW[] = {
+    {I_PMINSW, 2, {MMXREG,RM_MMX,0,0,0}, nasm_bytecodes+7957, IF_KATMAI|IF_MMX|IF_SQ},
+    {I_PMINSW, 2, {XMMREG,RM_XMM,0,0,0}, nasm_bytecodes+15264, IF_WILLAMETTE|IF_SSE2|IF_SO},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_PMINUB[] = {
+    {I_PMINUB, 2, {MMXREG,RM_MMX,0,0,0}, nasm_bytecodes+7964, IF_KATMAI|IF_MMX|IF_SQ},
+    {I_PMINUB, 2, {XMMREG,RM_XMM,0,0,0}, nasm_bytecodes+15270, IF_WILLAMETTE|IF_SSE2|IF_SO},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_PMINUD[] = {
+    {I_PMINUD, 2, {XMMREG,RM_XMM,0,0,0}, nasm_bytecodes+8524, IF_SSE41},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_PMINUW[] = {
+    {I_PMINUW, 2, {XMMREG,RM_XMM,0,0,0}, nasm_bytecodes+8531, IF_SSE41},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_PMOVMSKB[] = {
+    {I_PMOVMSKB, 2, {REG_GPR|BITS32,MMXREG,0,0,0}, nasm_bytecodes+15042, IF_KATMAI|IF_MMX},
+    {I_PMOVMSKB, 2, {REG_GPR|BITS32,XMMREG,0,0,0}, nasm_bytecodes+15276, IF_WILLAMETTE|IF_SSE2},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_PMOVSXBD[] = {
+    {I_PMOVSXBD, 2, {XMMREG,RM_XMM,0,0,0}, nasm_bytecodes+8545, IF_SSE41|IF_SD},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_PMOVSXBQ[] = {
+    {I_PMOVSXBQ, 2, {XMMREG,RM_XMM,0,0,0}, nasm_bytecodes+8552, IF_SSE41|IF_SW},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_PMOVSXBW[] = {
+    {I_PMOVSXBW, 2, {XMMREG,RM_XMM,0,0,0}, nasm_bytecodes+8538, IF_SSE41|IF_SQ},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_PMOVSXDQ[] = {
+    {I_PMOVSXDQ, 2, {XMMREG,RM_XMM,0,0,0}, nasm_bytecodes+8573, IF_SSE41|IF_SQ},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_PMOVSXWD[] = {
+    {I_PMOVSXWD, 2, {XMMREG,RM_XMM,0,0,0}, nasm_bytecodes+8559, IF_SSE41|IF_SQ},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_PMOVSXWQ[] = {
+    {I_PMOVSXWQ, 2, {XMMREG,RM_XMM,0,0,0}, nasm_bytecodes+8566, IF_SSE41|IF_SD},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_PMOVZXBD[] = {
+    {I_PMOVZXBD, 2, {XMMREG,RM_XMM,0,0,0}, nasm_bytecodes+8587, IF_SSE41|IF_SD},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_PMOVZXBQ[] = {
+    {I_PMOVZXBQ, 2, {XMMREG,RM_XMM,0,0,0}, nasm_bytecodes+8594, IF_SSE41|IF_SW},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_PMOVZXBW[] = {
+    {I_PMOVZXBW, 2, {XMMREG,RM_XMM,0,0,0}, nasm_bytecodes+8580, IF_SSE41|IF_SQ},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_PMOVZXDQ[] = {
+    {I_PMOVZXDQ, 2, {XMMREG,RM_XMM,0,0,0}, nasm_bytecodes+8615, IF_SSE41|IF_SQ},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_PMOVZXWD[] = {
+    {I_PMOVZXWD, 2, {XMMREG,RM_XMM,0,0,0}, nasm_bytecodes+8601, IF_SSE41|IF_SQ},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_PMOVZXWQ[] = {
+    {I_PMOVZXWQ, 2, {XMMREG,RM_XMM,0,0,0}, nasm_bytecodes+8608, IF_SSE41|IF_SD},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_PMULDQ[] = {
+    {I_PMULDQ, 2, {XMMREG,RM_XMM,0,0,0}, nasm_bytecodes+8622, IF_SSE41},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_PMULHRIW[] = {
+    {I_PMULHRIW, 2, {MMXREG,RM_MMX,0,0,0}, nasm_bytecodes+14346, IF_PENT|IF_MMX|IF_SQ|IF_CYRIX},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_PMULHRSW[] = {
+    {I_PMULHRSW, 2, {MMXREG,RM_MMX,0,0,0}, nasm_bytecodes+8342, IF_SSSE3|IF_MMX|IF_SQ},
+    {I_PMULHRSW, 2, {XMMREG,RM_XMM,0,0,0}, nasm_bytecodes+8349, IF_SSSE3},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_PMULHRWA[] = {
+    {I_PMULHRWA, 2, {MMXREG,RM_MMX,0,0,0}, nasm_bytecodes+5580, IF_PENT|IF_3DNOW|IF_SQ},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_PMULHRWC[] = {
+    {I_PMULHRWC, 2, {MMXREG,RM_MMX,0,0,0}, nasm_bytecodes+14352, IF_PENT|IF_MMX|IF_SQ|IF_CYRIX},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_PMULHUW[] = {
+    {I_PMULHUW, 2, {MMXREG,RM_MMX,0,0,0}, nasm_bytecodes+7971, IF_KATMAI|IF_MMX|IF_SQ},
+    {I_PMULHUW, 2, {XMMREG,RM_XMM,0,0,0}, nasm_bytecodes+15282, IF_WILLAMETTE|IF_SSE2|IF_SO},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_PMULHW[] = {
+    {I_PMULHW, 2, {MMXREG,RM_MMX,0,0,0}, nasm_bytecodes+7516, IF_PENT|IF_MMX|IF_SQ},
+    {I_PMULHW, 2, {XMMREG,RM_XMM,0,0,0}, nasm_bytecodes+15288, IF_WILLAMETTE|IF_SSE2|IF_SO},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_PMULLD[] = {
+    {I_PMULLD, 2, {XMMREG,RM_XMM,0,0,0}, nasm_bytecodes+8629, IF_SSE41},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_PMULLW[] = {
+    {I_PMULLW, 2, {MMXREG,RM_MMX,0,0,0}, nasm_bytecodes+7523, IF_PENT|IF_MMX|IF_SQ},
+    {I_PMULLW, 2, {XMMREG,RM_XMM,0,0,0}, nasm_bytecodes+15294, IF_WILLAMETTE|IF_SSE2|IF_SO},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_PMULUDQ[] = {
+    {I_PMULUDQ, 2, {MMXREG,RM_MMX,0,0,0}, nasm_bytecodes+8034, IF_WILLAMETTE|IF_SSE2|IF_SO},
+    {I_PMULUDQ, 2, {XMMREG,RM_XMM,0,0,0}, nasm_bytecodes+15300, IF_WILLAMETTE|IF_SSE2|IF_SO},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_PMVGEZB[] = {
+    {I_PMVGEZB, 2, {MMXREG,MEMORY,0,0,0}, nasm_bytecodes+15715, IF_PENT|IF_MMX|IF_SQ|IF_CYRIX},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_PMVLZB[] = {
+    {I_PMVLZB, 2, {MMXREG,MEMORY,0,0,0}, nasm_bytecodes+15571, IF_PENT|IF_MMX|IF_SQ|IF_CYRIX},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_PMVNZB[] = {
+    {I_PMVNZB, 2, {MMXREG,MEMORY,0,0,0}, nasm_bytecodes+15553, IF_PENT|IF_MMX|IF_SQ|IF_CYRIX},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_PMVZB[] = {
+    {I_PMVZB, 2, {MMXREG,MEMORY,0,0,0}, nasm_bytecodes+15475, IF_PENT|IF_MMX|IF_SQ|IF_CYRIX},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_POP[] = {
+    {I_POP, 1, {REG_GPR|BITS16,0,0,0,0}, nasm_bytecodes+19670, IF_8086},
+    {I_POP, 1, {REG_GPR|BITS32,0,0,0,0}, nasm_bytecodes+19674, IF_386|IF_NOLONG},
+    {I_POP, 1, {REG_GPR|BITS64,0,0,0,0}, nasm_bytecodes+19678, IF_X64},
+    {I_POP, 1, {RM_GPR|BITS16,0,0,0,0}, nasm_bytecodes+18219, IF_8086},
+    {I_POP, 1, {RM_GPR|BITS32,0,0,0,0}, nasm_bytecodes+18224, IF_386|IF_NOLONG},
+    {I_POP, 1, {RM_GPR|BITS64,0,0,0,0}, nasm_bytecodes+18229, IF_X64},
+    {I_POP, 1, {REG_CS,0,0,0,0}, nasm_bytecodes+3255, IF_8086|IF_UNDOC},
+    {I_POP, 1, {REG_DESS,0,0,0,0}, nasm_bytecodes+19488, IF_8086|IF_NOLONG},
+    {I_POP, 1, {REG_FSGS,0,0,0,0}, nasm_bytecodes+19682, IF_386},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_POPA[] = {
+    {I_POPA, 0, {0,0,0,0,0}, nasm_bytecodes+19686, IF_186|IF_NOLONG},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_POPAD[] = {
+    {I_POPAD, 0, {0,0,0,0,0}, nasm_bytecodes+19690, IF_386|IF_NOLONG},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_POPAW[] = {
+    {I_POPAW, 0, {0,0,0,0,0}, nasm_bytecodes+19694, IF_186|IF_NOLONG},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_POPCNT[] = {
+    {I_POPCNT, 2, {REG_GPR|BITS16,RM_GPR|BITS16,0,0,0}, nasm_bytecodes+8650, IF_NEHALEM|IF_SW},
+    {I_POPCNT, 2, {REG_GPR|BITS32,RM_GPR|BITS32,0,0,0}, nasm_bytecodes+8657, IF_NEHALEM|IF_SD},
+    {I_POPCNT, 2, {REG_GPR|BITS64,RM_GPR|BITS64,0,0,0}, nasm_bytecodes+8664, IF_NEHALEM|IF_SQ|IF_X64},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_POPF[] = {
+    {I_POPF, 0, {0,0,0,0,0}, nasm_bytecodes+19698, IF_8086},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_POPFD[] = {
+    {I_POPFD, 0, {0,0,0,0,0}, nasm_bytecodes+19702, IF_386|IF_NOLONG},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_POPFQ[] = {
+    {I_POPFQ, 0, {0,0,0,0,0}, nasm_bytecodes+19702, IF_X64},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_POPFW[] = {
+    {I_POPFW, 0, {0,0,0,0,0}, nasm_bytecodes+19706, IF_8086},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_POR[] = {
+    {I_POR, 2, {MMXREG,RM_MMX,0,0,0}, nasm_bytecodes+7530, IF_PENT|IF_MMX|IF_SQ},
+    {I_POR, 2, {XMMREG,RM_XMM,0,0,0}, nasm_bytecodes+15306, IF_WILLAMETTE|IF_SSE2|IF_SO},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_PREFETCH[] = {
+    {I_PREFETCH, 1, {MEMORY,0,0,0,0}, nasm_bytecodes+18234, IF_PENT|IF_3DNOW|IF_SQ},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_PREFETCHNTA[] = {
+    {I_PREFETCHNTA, 1, {MEMORY,0,0,0,0}, nasm_bytecodes+15913, IF_KATMAI},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_PREFETCHT0[] = {
+    {I_PREFETCHT0, 1, {MEMORY,0,0,0,0}, nasm_bytecodes+15931, IF_KATMAI},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_PREFETCHT1[] = {
+    {I_PREFETCHT1, 1, {MEMORY,0,0,0,0}, nasm_bytecodes+15949, IF_KATMAI},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_PREFETCHT2[] = {
+    {I_PREFETCHT2, 1, {MEMORY,0,0,0,0}, nasm_bytecodes+15967, IF_KATMAI},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_PREFETCHW[] = {
+    {I_PREFETCHW, 1, {MEMORY,0,0,0,0}, nasm_bytecodes+18239, IF_PENT|IF_3DNOW|IF_SQ},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_PSADBW[] = {
+    {I_PSADBW, 2, {MMXREG,RM_MMX,0,0,0}, nasm_bytecodes+7978, IF_KATMAI|IF_MMX|IF_SQ},
+    {I_PSADBW, 2, {XMMREG,RM_XMM,0,0,0}, nasm_bytecodes+15312, IF_WILLAMETTE|IF_SSE2|IF_SO},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_PSHUFB[] = {
+    {I_PSHUFB, 2, {MMXREG,RM_MMX,0,0,0}, nasm_bytecodes+8356, IF_SSSE3|IF_MMX|IF_SQ},
+    {I_PSHUFB, 2, {XMMREG,RM_XMM,0,0,0}, nasm_bytecodes+8363, IF_SSSE3},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_PSHUFD[] = {
+    {I_PSHUFD, 3, {XMMREG,XMMREG,IMMEDIATE,0,0}, nasm_bytecodes+8041, IF_WILLAMETTE|IF_SSE2|IF_SB|IF_AR2},
+    {I_PSHUFD, 3, {XMMREG,MEMORY,IMMEDIATE,0,0}, nasm_bytecodes+8041, IF_WILLAMETTE|IF_SSE2|IF_SM2|IF_SB|IF_AR2},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_PSHUFHW[] = {
+    {I_PSHUFHW, 3, {XMMREG,XMMREG,IMMEDIATE,0,0}, nasm_bytecodes+8048, IF_WILLAMETTE|IF_SSE2|IF_SB|IF_AR2},
+    {I_PSHUFHW, 3, {XMMREG,MEMORY,IMMEDIATE,0,0}, nasm_bytecodes+8048, IF_WILLAMETTE|IF_SSE2|IF_SM2|IF_SB|IF_AR2},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_PSHUFLW[] = {
+    {I_PSHUFLW, 3, {XMMREG,XMMREG,IMMEDIATE,0,0}, nasm_bytecodes+8055, IF_WILLAMETTE|IF_SSE2|IF_SB|IF_AR2},
+    {I_PSHUFLW, 3, {XMMREG,MEMORY,IMMEDIATE,0,0}, nasm_bytecodes+8055, IF_WILLAMETTE|IF_SSE2|IF_SM2|IF_SB|IF_AR2},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_PSHUFW[] = {
+    {I_PSHUFW, 3, {MMXREG,RM_MMX,IMMEDIATE,0,0}, nasm_bytecodes+5716, IF_KATMAI|IF_MMX|IF_SM2|IF_SB|IF_AR2},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_PSIGNB[] = {
+    {I_PSIGNB, 2, {MMXREG,RM_MMX,0,0,0}, nasm_bytecodes+8370, IF_SSSE3|IF_MMX|IF_SQ},
+    {I_PSIGNB, 2, {XMMREG,RM_XMM,0,0,0}, nasm_bytecodes+8377, IF_SSSE3},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_PSIGND[] = {
+    {I_PSIGND, 2, {MMXREG,RM_MMX,0,0,0}, nasm_bytecodes+8398, IF_SSSE3|IF_MMX|IF_SQ},
+    {I_PSIGND, 2, {XMMREG,RM_XMM,0,0,0}, nasm_bytecodes+8405, IF_SSSE3},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_PSIGNW[] = {
+    {I_PSIGNW, 2, {MMXREG,RM_MMX,0,0,0}, nasm_bytecodes+8384, IF_SSSE3|IF_MMX|IF_SQ},
+    {I_PSIGNW, 2, {XMMREG,RM_XMM,0,0,0}, nasm_bytecodes+8391, IF_SSSE3},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_PSLLD[] = {
+    {I_PSLLD, 2, {MMXREG,RM_MMX,0,0,0}, nasm_bytecodes+7537, IF_PENT|IF_MMX|IF_SQ},
+    {I_PSLLD, 2, {MMXREG,IMMEDIATE,0,0,0}, nasm_bytecodes+7544, IF_PENT|IF_MMX},
+    {I_PSLLD, 2, {XMMREG,RM_XMM,0,0,0}, nasm_bytecodes+15324, IF_WILLAMETTE|IF_SSE2|IF_SO},
+    {I_PSLLD, 2, {XMMREG,IMMEDIATE,0,0,0}, nasm_bytecodes+8076, IF_WILLAMETTE|IF_SSE2|IF_SB|IF_AR1},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_PSLLDQ[] = {
+    {I_PSLLDQ, 2, {XMMREG,IMMEDIATE,0,0,0}, nasm_bytecodes+8062, IF_WILLAMETTE|IF_SSE2|IF_SB|IF_AR1},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_PSLLQ[] = {
+    {I_PSLLQ, 2, {MMXREG,RM_MMX,0,0,0}, nasm_bytecodes+7551, IF_PENT|IF_MMX|IF_SQ},
+    {I_PSLLQ, 2, {MMXREG,IMMEDIATE,0,0,0}, nasm_bytecodes+7558, IF_PENT|IF_MMX},
+    {I_PSLLQ, 2, {XMMREG,RM_XMM,0,0,0}, nasm_bytecodes+15330, IF_WILLAMETTE|IF_SSE2|IF_SO},
+    {I_PSLLQ, 2, {XMMREG,IMMEDIATE,0,0,0}, nasm_bytecodes+8083, IF_WILLAMETTE|IF_SSE2|IF_SB|IF_AR1},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_PSLLW[] = {
+    {I_PSLLW, 2, {MMXREG,RM_MMX,0,0,0}, nasm_bytecodes+7565, IF_PENT|IF_MMX|IF_SQ},
+    {I_PSLLW, 2, {MMXREG,IMMEDIATE,0,0,0}, nasm_bytecodes+7572, IF_PENT|IF_MMX},
+    {I_PSLLW, 2, {XMMREG,RM_XMM,0,0,0}, nasm_bytecodes+15318, IF_WILLAMETTE|IF_SSE2|IF_SO},
+    {I_PSLLW, 2, {XMMREG,IMMEDIATE,0,0,0}, nasm_bytecodes+8069, IF_WILLAMETTE|IF_SSE2|IF_SB|IF_AR1},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_PSRAD[] = {
+    {I_PSRAD, 2, {MMXREG,RM_MMX,0,0,0}, nasm_bytecodes+7579, IF_PENT|IF_MMX|IF_SQ},
+    {I_PSRAD, 2, {MMXREG,IMMEDIATE,0,0,0}, nasm_bytecodes+7586, IF_PENT|IF_MMX},
+    {I_PSRAD, 2, {XMMREG,RM_XMM,0,0,0}, nasm_bytecodes+15342, IF_WILLAMETTE|IF_SSE2|IF_SO},
+    {I_PSRAD, 2, {XMMREG,IMMEDIATE,0,0,0}, nasm_bytecodes+8097, IF_WILLAMETTE|IF_SSE2|IF_SB|IF_AR1},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_PSRAW[] = {
+    {I_PSRAW, 2, {MMXREG,RM_MMX,0,0,0}, nasm_bytecodes+7593, IF_PENT|IF_MMX|IF_SQ},
+    {I_PSRAW, 2, {MMXREG,IMMEDIATE,0,0,0}, nasm_bytecodes+7600, IF_PENT|IF_MMX},
+    {I_PSRAW, 2, {XMMREG,RM_XMM,0,0,0}, nasm_bytecodes+15336, IF_WILLAMETTE|IF_SSE2|IF_SO},
+    {I_PSRAW, 2, {XMMREG,IMMEDIATE,0,0,0}, nasm_bytecodes+8090, IF_WILLAMETTE|IF_SSE2|IF_SB|IF_AR1},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_PSRLD[] = {
+    {I_PSRLD, 2, {MMXREG,RM_MMX,0,0,0}, nasm_bytecodes+7607, IF_PENT|IF_MMX|IF_SQ},
+    {I_PSRLD, 2, {MMXREG,IMMEDIATE,0,0,0}, nasm_bytecodes+7614, IF_PENT|IF_MMX},
+    {I_PSRLD, 2, {XMMREG,RM_XMM,0,0,0}, nasm_bytecodes+15354, IF_WILLAMETTE|IF_SSE2|IF_SO},
+    {I_PSRLD, 2, {XMMREG,IMMEDIATE,0,0,0}, nasm_bytecodes+8118, IF_WILLAMETTE|IF_SSE2|IF_SB|IF_AR1},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_PSRLDQ[] = {
+    {I_PSRLDQ, 2, {XMMREG,IMMEDIATE,0,0,0}, nasm_bytecodes+8104, IF_WILLAMETTE|IF_SSE2|IF_SB|IF_AR1},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_PSRLQ[] = {
+    {I_PSRLQ, 2, {MMXREG,RM_MMX,0,0,0}, nasm_bytecodes+7621, IF_PENT|IF_MMX|IF_SQ},
+    {I_PSRLQ, 2, {MMXREG,IMMEDIATE,0,0,0}, nasm_bytecodes+7628, IF_PENT|IF_MMX},
+    {I_PSRLQ, 2, {XMMREG,RM_XMM,0,0,0}, nasm_bytecodes+15360, IF_WILLAMETTE|IF_SSE2|IF_SO},
+    {I_PSRLQ, 2, {XMMREG,IMMEDIATE,0,0,0}, nasm_bytecodes+8125, IF_WILLAMETTE|IF_SSE2|IF_SB|IF_AR1},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_PSRLW[] = {
+    {I_PSRLW, 2, {MMXREG,RM_MMX,0,0,0}, nasm_bytecodes+7635, IF_PENT|IF_MMX|IF_SQ},
+    {I_PSRLW, 2, {MMXREG,IMMEDIATE,0,0,0}, nasm_bytecodes+7642, IF_PENT|IF_MMX},
+    {I_PSRLW, 2, {XMMREG,RM_XMM,0,0,0}, nasm_bytecodes+15348, IF_WILLAMETTE|IF_SSE2|IF_SO},
+    {I_PSRLW, 2, {XMMREG,IMMEDIATE,0,0,0}, nasm_bytecodes+8111, IF_WILLAMETTE|IF_SSE2|IF_SB|IF_AR1},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_PSUBB[] = {
+    {I_PSUBB, 2, {MMXREG,RM_MMX,0,0,0}, nasm_bytecodes+7649, IF_PENT|IF_MMX|IF_SQ},
+    {I_PSUBB, 2, {XMMREG,RM_XMM,0,0,0}, nasm_bytecodes+15366, IF_WILLAMETTE|IF_SSE2|IF_SO},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_PSUBD[] = {
+    {I_PSUBD, 2, {MMXREG,RM_MMX,0,0,0}, nasm_bytecodes+7656, IF_PENT|IF_MMX|IF_SQ},
+    {I_PSUBD, 2, {XMMREG,RM_XMM,0,0,0}, nasm_bytecodes+15378, IF_WILLAMETTE|IF_SSE2|IF_SO},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_PSUBQ[] = {
+    {I_PSUBQ, 2, {MMXREG,RM_MMX,0,0,0}, nasm_bytecodes+8132, IF_WILLAMETTE|IF_SSE2|IF_SO},
+    {I_PSUBQ, 2, {XMMREG,RM_XMM,0,0,0}, nasm_bytecodes+15384, IF_WILLAMETTE|IF_SSE2|IF_SO},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_PSUBSB[] = {
+    {I_PSUBSB, 2, {MMXREG,RM_MMX,0,0,0}, nasm_bytecodes+7663, IF_PENT|IF_MMX|IF_SQ},
+    {I_PSUBSB, 2, {XMMREG,RM_XMM,0,0,0}, nasm_bytecodes+15390, IF_WILLAMETTE|IF_SSE2|IF_SO},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_PSUBSIW[] = {
+    {I_PSUBSIW, 2, {MMXREG,RM_MMX,0,0,0}, nasm_bytecodes+14358, IF_PENT|IF_MMX|IF_SQ|IF_CYRIX},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_PSUBSW[] = {
+    {I_PSUBSW, 2, {MMXREG,RM_MMX,0,0,0}, nasm_bytecodes+7670, IF_PENT|IF_MMX|IF_SQ},
+    {I_PSUBSW, 2, {XMMREG,RM_XMM,0,0,0}, nasm_bytecodes+15396, IF_WILLAMETTE|IF_SSE2|IF_SO},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_PSUBUSB[] = {
+    {I_PSUBUSB, 2, {MMXREG,RM_MMX,0,0,0}, nasm_bytecodes+7677, IF_PENT|IF_MMX|IF_SQ},
+    {I_PSUBUSB, 2, {XMMREG,RM_XMM,0,0,0}, nasm_bytecodes+15402, IF_WILLAMETTE|IF_SSE2|IF_SO},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_PSUBUSW[] = {
+    {I_PSUBUSW, 2, {MMXREG,RM_MMX,0,0,0}, nasm_bytecodes+7684, IF_PENT|IF_MMX|IF_SQ},
+    {I_PSUBUSW, 2, {XMMREG,RM_XMM,0,0,0}, nasm_bytecodes+15408, IF_WILLAMETTE|IF_SSE2|IF_SO},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_PSUBW[] = {
+    {I_PSUBW, 2, {MMXREG,RM_MMX,0,0,0}, nasm_bytecodes+7691, IF_PENT|IF_MMX|IF_SQ},
+    {I_PSUBW, 2, {XMMREG,RM_XMM,0,0,0}, nasm_bytecodes+15372, IF_WILLAMETTE|IF_SSE2|IF_SO},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_PSWAPD[] = {
+    {I_PSWAPD, 2, {MMXREG,RM_MMX,0,0,0}, nasm_bytecodes+5756, IF_PENT|IF_3DNOW|IF_SQ},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_PTEST[] = {
+    {I_PTEST, 2, {XMMREG,RM_XMM,0,0,0}, nasm_bytecodes+8636, IF_SSE41},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_PUNPCKHBW[] = {
+    {I_PUNPCKHBW, 2, {MMXREG,RM_MMX,0,0,0}, nasm_bytecodes+7698, IF_PENT|IF_MMX|IF_SQ},
+    {I_PUNPCKHBW, 2, {XMMREG,RM_XMM,0,0,0}, nasm_bytecodes+15414, IF_WILLAMETTE|IF_SSE2|IF_SO},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_PUNPCKHDQ[] = {
+    {I_PUNPCKHDQ, 2, {MMXREG,RM_MMX,0,0,0}, nasm_bytecodes+7705, IF_PENT|IF_MMX|IF_SQ},
+    {I_PUNPCKHDQ, 2, {XMMREG,RM_XMM,0,0,0}, nasm_bytecodes+15426, IF_WILLAMETTE|IF_SSE2|IF_SO},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_PUNPCKHQDQ[] = {
+    {I_PUNPCKHQDQ, 2, {XMMREG,RM_XMM,0,0,0}, nasm_bytecodes+15432, IF_WILLAMETTE|IF_SSE2|IF_SO},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_PUNPCKHWD[] = {
+    {I_PUNPCKHWD, 2, {MMXREG,RM_MMX,0,0,0}, nasm_bytecodes+7712, IF_PENT|IF_MMX|IF_SQ},
+    {I_PUNPCKHWD, 2, {XMMREG,RM_XMM,0,0,0}, nasm_bytecodes+15420, IF_WILLAMETTE|IF_SSE2|IF_SO},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_PUNPCKLBW[] = {
+    {I_PUNPCKLBW, 2, {MMXREG,RM_MMX,0,0,0}, nasm_bytecodes+7719, IF_PENT|IF_MMX|IF_SQ},
+    {I_PUNPCKLBW, 2, {XMMREG,RM_XMM,0,0,0}, nasm_bytecodes+15438, IF_WILLAMETTE|IF_SSE2|IF_SO},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_PUNPCKLDQ[] = {
+    {I_PUNPCKLDQ, 2, {MMXREG,RM_MMX,0,0,0}, nasm_bytecodes+7726, IF_PENT|IF_MMX|IF_SQ},
+    {I_PUNPCKLDQ, 2, {XMMREG,RM_XMM,0,0,0}, nasm_bytecodes+15450, IF_WILLAMETTE|IF_SSE2|IF_SO},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_PUNPCKLQDQ[] = {
+    {I_PUNPCKLQDQ, 2, {XMMREG,RM_XMM,0,0,0}, nasm_bytecodes+15456, IF_WILLAMETTE|IF_SSE2|IF_SO},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_PUNPCKLWD[] = {
+    {I_PUNPCKLWD, 2, {MMXREG,RM_MMX,0,0,0}, nasm_bytecodes+7733, IF_PENT|IF_MMX|IF_SQ},
+    {I_PUNPCKLWD, 2, {XMMREG,RM_XMM,0,0,0}, nasm_bytecodes+15444, IF_WILLAMETTE|IF_SSE2|IF_SO},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_PUSH[] = {
+    {I_PUSH, 1, {REG_GPR|BITS16,0,0,0,0}, nasm_bytecodes+19710, IF_8086},
+    {I_PUSH, 1, {REG_GPR|BITS32,0,0,0,0}, nasm_bytecodes+19714, IF_386|IF_NOLONG},
+    {I_PUSH, 1, {REG_GPR|BITS64,0,0,0,0}, nasm_bytecodes+19718, IF_X64},
+    {I_PUSH, 1, {RM_GPR|BITS16,0,0,0,0}, nasm_bytecodes+18244, IF_8086},
+    {I_PUSH, 1, {RM_GPR|BITS32,0,0,0,0}, nasm_bytecodes+18249, IF_386|IF_NOLONG},
+    {I_PUSH, 1, {RM_GPR|BITS64,0,0,0,0}, nasm_bytecodes+18254, IF_X64},
+    {I_PUSH, 1, {REG_CS,0,0,0,0}, nasm_bytecodes+19464, IF_8086|IF_NOLONG},
+    {I_PUSH, 1, {REG_DESS,0,0,0,0}, nasm_bytecodes+19464, IF_8086|IF_NOLONG},
+    {I_PUSH, 1, {REG_FSGS,0,0,0,0}, nasm_bytecodes+19722, IF_386},
+    {I_PUSH, 1, {IMMEDIATE|BITS8,0,0,0,0}, nasm_bytecodes+19726, IF_186},
+    {I_PUSH, 1, {IMMEDIATE|BITS16,0,0,0,0}, nasm_bytecodes+18259, IF_186|IF_AR0|IF_SZ},
+    {I_PUSH, 1, {IMMEDIATE|BITS32,0,0,0,0}, nasm_bytecodes+18264, IF_386|IF_NOLONG|IF_AR0|IF_SZ},
+    {I_PUSH, 1, {IMMEDIATE|BITS32,0,0,0,0}, nasm_bytecodes+18264, IF_386|IF_NOLONG|IF_SD},
+    {I_PUSH, 1, {IMMEDIATE|BITS64,0,0,0,0}, nasm_bytecodes+18269, IF_X64|IF_AR0|IF_SZ},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_PUSHA[] = {
+    {I_PUSHA, 0, {0,0,0,0,0}, nasm_bytecodes+19730, IF_186|IF_NOLONG},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_PUSHAD[] = {
+    {I_PUSHAD, 0, {0,0,0,0,0}, nasm_bytecodes+19734, IF_386|IF_NOLONG},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_PUSHAW[] = {
+    {I_PUSHAW, 0, {0,0,0,0,0}, nasm_bytecodes+19738, IF_186|IF_NOLONG},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_PUSHF[] = {
+    {I_PUSHF, 0, {0,0,0,0,0}, nasm_bytecodes+19742, IF_8086},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_PUSHFD[] = {
+    {I_PUSHFD, 0, {0,0,0,0,0}, nasm_bytecodes+19746, IF_386|IF_NOLONG},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_PUSHFQ[] = {
+    {I_PUSHFQ, 0, {0,0,0,0,0}, nasm_bytecodes+19746, IF_X64},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_PUSHFW[] = {
+    {I_PUSHFW, 0, {0,0,0,0,0}, nasm_bytecodes+19750, IF_8086},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_PXOR[] = {
+    {I_PXOR, 2, {MMXREG,RM_MMX,0,0,0}, nasm_bytecodes+7740, IF_PENT|IF_MMX|IF_SQ},
+    {I_PXOR, 2, {XMMREG,RM_XMM,0,0,0}, nasm_bytecodes+15462, IF_WILLAMETTE|IF_SSE2|IF_SO},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_RCL[] = {
+    {I_RCL, 2, {RM_GPR|BITS8,UNITY,0,0,0}, nasm_bytecodes+19754, IF_8086},
+    {I_RCL, 2, {RM_GPR|BITS8,REG_CL,0,0,0}, nasm_bytecodes+19758, IF_8086},
+    {I_RCL, 2, {RM_GPR|BITS8,IMMEDIATE,0,0,0}, nasm_bytecodes+18274, IF_186|IF_SB},
+    {I_RCL, 2, {RM_GPR|BITS16,UNITY,0,0,0}, nasm_bytecodes+18279, IF_8086},
+    {I_RCL, 2, {RM_GPR|BITS16,REG_CL,0,0,0}, nasm_bytecodes+18284, IF_8086},
+    {I_RCL, 2, {RM_GPR|BITS16,IMMEDIATE,0,0,0}, nasm_bytecodes+14364, IF_186|IF_SB},
+    {I_RCL, 2, {RM_GPR|BITS32,UNITY,0,0,0}, nasm_bytecodes+18289, IF_386},
+    {I_RCL, 2, {RM_GPR|BITS32,REG_CL,0,0,0}, nasm_bytecodes+18294, IF_386},
+    {I_RCL, 2, {RM_GPR|BITS32,IMMEDIATE,0,0,0}, nasm_bytecodes+14370, IF_386|IF_SB},
+    {I_RCL, 2, {RM_GPR|BITS64,UNITY,0,0,0}, nasm_bytecodes+18299, IF_X64},
+    {I_RCL, 2, {RM_GPR|BITS64,REG_CL,0,0,0}, nasm_bytecodes+18304, IF_X64},
+    {I_RCL, 2, {RM_GPR|BITS64,IMMEDIATE,0,0,0}, nasm_bytecodes+14376, IF_X64|IF_SB},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_RCPPS[] = {
+    {I_RCPPS, 2, {XMMREG,RM_XMM,0,0,0}, nasm_bytecodes+14934, IF_KATMAI|IF_SSE},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_RCPSS[] = {
+    {I_RCPSS, 2, {XMMREG,RM_XMM,0,0,0}, nasm_bytecodes+14940, IF_KATMAI|IF_SSE},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_RCR[] = {
+    {I_RCR, 2, {RM_GPR|BITS8,UNITY,0,0,0}, nasm_bytecodes+19762, IF_8086},
+    {I_RCR, 2, {RM_GPR|BITS8,REG_CL,0,0,0}, nasm_bytecodes+19766, IF_8086},
+    {I_RCR, 2, {RM_GPR|BITS8,IMMEDIATE,0,0,0}, nasm_bytecodes+18309, IF_186|IF_SB},
+    {I_RCR, 2, {RM_GPR|BITS16,UNITY,0,0,0}, nasm_bytecodes+18314, IF_8086},
+    {I_RCR, 2, {RM_GPR|BITS16,REG_CL,0,0,0}, nasm_bytecodes+18319, IF_8086},
+    {I_RCR, 2, {RM_GPR|BITS16,IMMEDIATE,0,0,0}, nasm_bytecodes+14382, IF_186|IF_SB},
+    {I_RCR, 2, {RM_GPR|BITS32,UNITY,0,0,0}, nasm_bytecodes+18324, IF_386},
+    {I_RCR, 2, {RM_GPR|BITS32,REG_CL,0,0,0}, nasm_bytecodes+18329, IF_386},
+    {I_RCR, 2, {RM_GPR|BITS32,IMMEDIATE,0,0,0}, nasm_bytecodes+14388, IF_386|IF_SB},
+    {I_RCR, 2, {RM_GPR|BITS64,UNITY,0,0,0}, nasm_bytecodes+18334, IF_X64},
+    {I_RCR, 2, {RM_GPR|BITS64,REG_CL,0,0,0}, nasm_bytecodes+18339, IF_X64},
+    {I_RCR, 2, {RM_GPR|BITS64,IMMEDIATE,0,0,0}, nasm_bytecodes+14394, IF_X64|IF_SB},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_RDM[] = {
+    {I_RDM, 0, {0,0,0,0,0}, nasm_bytecodes+18958, IF_P6|IF_CYRIX},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_RDMSR[] = {
+    {I_RDMSR, 0, {0,0,0,0,0}, nasm_bytecodes+19770, IF_PENT|IF_PRIV},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_RDPMC[] = {
+    {I_RDPMC, 0, {0,0,0,0,0}, nasm_bytecodes+19774, IF_P6},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_RDSHR[] = {
+    {I_RDSHR, 1, {RM_GPR|BITS32,0,0,0,0}, nasm_bytecodes+14400, IF_P6|IF_CYRIX|IF_SMM},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_RDTSC[] = {
+    {I_RDTSC, 0, {0,0,0,0,0}, nasm_bytecodes+19778, IF_PENT},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_RDTSCP[] = {
+    {I_RDTSCP, 0, {0,0,0,0,0}, nasm_bytecodes+18344, IF_X86_64},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_RESB[] = {
+    {I_RESB, 1, {IMMEDIATE,0,0,0,0}, nasm_bytecodes+19072, IF_8086},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_RESD[] = {
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_RESO[] = {
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_RESQ[] = {
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_REST[] = {
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_RESW[] = {
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_RESY[] = {
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_RET[] = {
+    {I_RET, 0, {0,0,0,0,0}, nasm_bytecodes+18891, IF_8086},
+    {I_RET, 1, {IMMEDIATE,0,0,0,0}, nasm_bytecodes+19782, IF_8086|IF_SW},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_RETF[] = {
+    {I_RETF, 0, {0,0,0,0,0}, nasm_bytecodes+20013, IF_8086},
+    {I_RETF, 1, {IMMEDIATE,0,0,0,0}, nasm_bytecodes+19786, IF_8086|IF_SW},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_RETN[] = {
+    {I_RETN, 0, {0,0,0,0,0}, nasm_bytecodes+18891, IF_8086},
+    {I_RETN, 1, {IMMEDIATE,0,0,0,0}, nasm_bytecodes+19782, IF_8086|IF_SW},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_ROL[] = {
+    {I_ROL, 2, {RM_GPR|BITS8,UNITY,0,0,0}, nasm_bytecodes+19790, IF_8086},
+    {I_ROL, 2, {RM_GPR|BITS8,REG_CL,0,0,0}, nasm_bytecodes+19794, IF_8086},
+    {I_ROL, 2, {RM_GPR|BITS8,IMMEDIATE,0,0,0}, nasm_bytecodes+18349, IF_186|IF_SB},
+    {I_ROL, 2, {RM_GPR|BITS16,UNITY,0,0,0}, nasm_bytecodes+18354, IF_8086},
+    {I_ROL, 2, {RM_GPR|BITS16,REG_CL,0,0,0}, nasm_bytecodes+18359, IF_8086},
+    {I_ROL, 2, {RM_GPR|BITS16,IMMEDIATE,0,0,0}, nasm_bytecodes+14406, IF_186|IF_SB},
+    {I_ROL, 2, {RM_GPR|BITS32,UNITY,0,0,0}, nasm_bytecodes+18364, IF_386},
+    {I_ROL, 2, {RM_GPR|BITS32,REG_CL,0,0,0}, nasm_bytecodes+18369, IF_386},
+    {I_ROL, 2, {RM_GPR|BITS32,IMMEDIATE,0,0,0}, nasm_bytecodes+14412, IF_386|IF_SB},
+    {I_ROL, 2, {RM_GPR|BITS64,UNITY,0,0,0}, nasm_bytecodes+18374, IF_X64},
+    {I_ROL, 2, {RM_GPR|BITS64,REG_CL,0,0,0}, nasm_bytecodes+18379, IF_X64},
+    {I_ROL, 2, {RM_GPR|BITS64,IMMEDIATE,0,0,0}, nasm_bytecodes+14418, IF_X64|IF_SB},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_ROR[] = {
+    {I_ROR, 2, {RM_GPR|BITS8,UNITY,0,0,0}, nasm_bytecodes+19798, IF_8086},
+    {I_ROR, 2, {RM_GPR|BITS8,REG_CL,0,0,0}, nasm_bytecodes+19802, IF_8086},
+    {I_ROR, 2, {RM_GPR|BITS8,IMMEDIATE,0,0,0}, nasm_bytecodes+18384, IF_186|IF_SB},
+    {I_ROR, 2, {RM_GPR|BITS16,UNITY,0,0,0}, nasm_bytecodes+18389, IF_8086},
+    {I_ROR, 2, {RM_GPR|BITS16,REG_CL,0,0,0}, nasm_bytecodes+18394, IF_8086},
+    {I_ROR, 2, {RM_GPR|BITS16,IMMEDIATE,0,0,0}, nasm_bytecodes+14424, IF_186|IF_SB},
+    {I_ROR, 2, {RM_GPR|BITS32,UNITY,0,0,0}, nasm_bytecodes+18399, IF_386},
+    {I_ROR, 2, {RM_GPR|BITS32,REG_CL,0,0,0}, nasm_bytecodes+18404, IF_386},
+    {I_ROR, 2, {RM_GPR|BITS32,IMMEDIATE,0,0,0}, nasm_bytecodes+14430, IF_386|IF_SB},
+    {I_ROR, 2, {RM_GPR|BITS64,UNITY,0,0,0}, nasm_bytecodes+18409, IF_X64},
+    {I_ROR, 2, {RM_GPR|BITS64,REG_CL,0,0,0}, nasm_bytecodes+18414, IF_X64},
+    {I_ROR, 2, {RM_GPR|BITS64,IMMEDIATE,0,0,0}, nasm_bytecodes+14436, IF_X64|IF_SB},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_ROUNDPD[] = {
+    {I_ROUNDPD, 3, {XMMREG,RM_XMM,IMMEDIATE,0,0}, nasm_bytecodes+5996, IF_SSE41},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_ROUNDPS[] = {
+    {I_ROUNDPS, 3, {XMMREG,RM_XMM,IMMEDIATE,0,0}, nasm_bytecodes+6004, IF_SSE41},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_ROUNDSD[] = {
+    {I_ROUNDSD, 3, {XMMREG,RM_XMM,IMMEDIATE,0,0}, nasm_bytecodes+6012, IF_SSE41},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_ROUNDSS[] = {
+    {I_ROUNDSS, 3, {XMMREG,RM_XMM,IMMEDIATE,0,0}, nasm_bytecodes+6020, IF_SSE41},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_RSDC[] = {
+    {I_RSDC, 2, {REG_SREG,MEMORY|BITS80,0,0,0}, nasm_bytecodes+15823, IF_486|IF_CYRIX|IF_SMM},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_RSLDT[] = {
+    {I_RSLDT, 1, {MEMORY|BITS80,0,0,0,0}, nasm_bytecodes+18419, IF_486|IF_CYRIX|IF_SMM},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_RSM[] = {
+    {I_RSM, 0, {0,0,0,0,0}, nasm_bytecodes+19806, IF_PENT|IF_SMM},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_RSQRTPS[] = {
+    {I_RSQRTPS, 2, {XMMREG,RM_XMM,0,0,0}, nasm_bytecodes+14946, IF_KATMAI|IF_SSE},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_RSQRTSS[] = {
+    {I_RSQRTSS, 2, {XMMREG,RM_XMM,0,0,0}, nasm_bytecodes+14952, IF_KATMAI|IF_SSE},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_RSTS[] = {
+    {I_RSTS, 1, {MEMORY|BITS80,0,0,0,0}, nasm_bytecodes+18424, IF_486|IF_CYRIX|IF_SMM},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_SAHF[] = {
+    {I_SAHF, 0, {0,0,0,0,0}, nasm_bytecodes+5465, IF_8086},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_SAL[] = {
+    {I_SAL, 2, {RM_GPR|BITS8,UNITY,0,0,0}, nasm_bytecodes+19810, IF_8086},
+    {I_SAL, 2, {RM_GPR|BITS8,REG_CL,0,0,0}, nasm_bytecodes+19814, IF_8086},
+    {I_SAL, 2, {RM_GPR|BITS8,IMMEDIATE,0,0,0}, nasm_bytecodes+18429, IF_186|IF_SB},
+    {I_SAL, 2, {RM_GPR|BITS16,UNITY,0,0,0}, nasm_bytecodes+18434, IF_8086},
+    {I_SAL, 2, {RM_GPR|BITS16,REG_CL,0,0,0}, nasm_bytecodes+18439, IF_8086},
+    {I_SAL, 2, {RM_GPR|BITS16,IMMEDIATE,0,0,0}, nasm_bytecodes+14442, IF_186|IF_SB},
+    {I_SAL, 2, {RM_GPR|BITS32,UNITY,0,0,0}, nasm_bytecodes+18444, IF_386},
+    {I_SAL, 2, {RM_GPR|BITS32,REG_CL,0,0,0}, nasm_bytecodes+18449, IF_386},
+    {I_SAL, 2, {RM_GPR|BITS32,IMMEDIATE,0,0,0}, nasm_bytecodes+14448, IF_386|IF_SB},
+    {I_SAL, 2, {RM_GPR|BITS64,UNITY,0,0,0}, nasm_bytecodes+18454, IF_X64},
+    {I_SAL, 2, {RM_GPR|BITS64,REG_CL,0,0,0}, nasm_bytecodes+18459, IF_X64},
+    {I_SAL, 2, {RM_GPR|BITS64,IMMEDIATE,0,0,0}, nasm_bytecodes+14454, IF_X64|IF_SB},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_SALC[] = {
+    {I_SALC, 0, {0,0,0,0,0}, nasm_bytecodes+20016, IF_8086|IF_UNDOC},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_SAR[] = {
+    {I_SAR, 2, {RM_GPR|BITS8,UNITY,0,0,0}, nasm_bytecodes+19818, IF_8086},
+    {I_SAR, 2, {RM_GPR|BITS8,REG_CL,0,0,0}, nasm_bytecodes+19822, IF_8086},
+    {I_SAR, 2, {RM_GPR|BITS8,IMMEDIATE,0,0,0}, nasm_bytecodes+18464, IF_186|IF_SB},
+    {I_SAR, 2, {RM_GPR|BITS16,UNITY,0,0,0}, nasm_bytecodes+18469, IF_8086},
+    {I_SAR, 2, {RM_GPR|BITS16,REG_CL,0,0,0}, nasm_bytecodes+18474, IF_8086},
+    {I_SAR, 2, {RM_GPR|BITS16,IMMEDIATE,0,0,0}, nasm_bytecodes+14460, IF_186|IF_SB},
+    {I_SAR, 2, {RM_GPR|BITS32,UNITY,0,0,0}, nasm_bytecodes+18479, IF_386},
+    {I_SAR, 2, {RM_GPR|BITS32,REG_CL,0,0,0}, nasm_bytecodes+18484, IF_386},
+    {I_SAR, 2, {RM_GPR|BITS32,IMMEDIATE,0,0,0}, nasm_bytecodes+14466, IF_386|IF_SB},
+    {I_SAR, 2, {RM_GPR|BITS64,UNITY,0,0,0}, nasm_bytecodes+18489, IF_X64},
+    {I_SAR, 2, {RM_GPR|BITS64,REG_CL,0,0,0}, nasm_bytecodes+18494, IF_X64},
+    {I_SAR, 2, {RM_GPR|BITS64,IMMEDIATE,0,0,0}, nasm_bytecodes+14472, IF_X64|IF_SB},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_SBB[] = {
+    {I_SBB, 2, {MEMORY,REG_GPR|BITS8,0,0,0}, nasm_bytecodes+19826, IF_8086|IF_SM},
+    {I_SBB, 2, {REG_GPR|BITS8,REG_GPR|BITS8,0,0,0}, nasm_bytecodes+19826, IF_8086},
+    {I_SBB, 2, {MEMORY,REG_GPR|BITS16,0,0,0}, nasm_bytecodes+18499, IF_8086|IF_SM},
+    {I_SBB, 2, {REG_GPR|BITS16,REG_GPR|BITS16,0,0,0}, nasm_bytecodes+18499, IF_8086},
+    {I_SBB, 2, {MEMORY,REG_GPR|BITS32,0,0,0}, nasm_bytecodes+18504, IF_386|IF_SM},
+    {I_SBB, 2, {REG_GPR|BITS32,REG_GPR|BITS32,0,0,0}, nasm_bytecodes+18504, IF_386},
+    {I_SBB, 2, {MEMORY,REG_GPR|BITS64,0,0,0}, nasm_bytecodes+18509, IF_X64|IF_SM},
+    {I_SBB, 2, {REG_GPR|BITS64,REG_GPR|BITS64,0,0,0}, nasm_bytecodes+18509, IF_X64},
+    {I_SBB, 2, {REG_GPR|BITS8,MEMORY,0,0,0}, nasm_bytecodes+9115, IF_8086|IF_SM},
+    {I_SBB, 2, {REG_GPR|BITS8,REG_GPR|BITS8,0,0,0}, nasm_bytecodes+9115, IF_8086},
+    {I_SBB, 2, {REG_GPR|BITS16,MEMORY,0,0,0}, nasm_bytecodes+18514, IF_8086|IF_SM},
+    {I_SBB, 2, {REG_GPR|BITS16,REG_GPR|BITS16,0,0,0}, nasm_bytecodes+18514, IF_8086},
+    {I_SBB, 2, {REG_GPR|BITS32,MEMORY,0,0,0}, nasm_bytecodes+18519, IF_386|IF_SM},
+    {I_SBB, 2, {REG_GPR|BITS32,REG_GPR|BITS32,0,0,0}, nasm_bytecodes+18519, IF_386},
+    {I_SBB, 2, {REG_GPR|BITS64,MEMORY,0,0,0}, nasm_bytecodes+18524, IF_X64|IF_SM},
+    {I_SBB, 2, {REG_GPR|BITS64,REG_GPR|BITS64,0,0,0}, nasm_bytecodes+18524, IF_X64},
+    {I_SBB, 2, {RM_GPR|BITS16,IMMEDIATE|BITS8,0,0,0}, nasm_bytecodes+14478, IF_8086},
+    {I_SBB, 2, {RM_GPR|BITS32,IMMEDIATE|BITS8,0,0,0}, nasm_bytecodes+14484, IF_386},
+    {I_SBB, 2, {RM_GPR|BITS64,IMMEDIATE|BITS8,0,0,0}, nasm_bytecodes+14490, IF_X64},
+    {I_SBB, 2, {REG_AL,IMMEDIATE,0,0,0}, nasm_bytecodes+19830, IF_8086|IF_SM},
+    {I_SBB, 2, {REG_AX,SBYTE16,0,0,0}, nasm_bytecodes+14478, IF_8086|IF_SM},
+    {I_SBB, 2, {REG_AX,IMMEDIATE,0,0,0}, nasm_bytecodes+18529, IF_8086|IF_SM},
+    {I_SBB, 2, {REG_EAX,SBYTE32,0,0,0}, nasm_bytecodes+14484, IF_386|IF_SM},
+    {I_SBB, 2, {REG_EAX,IMMEDIATE,0,0,0}, nasm_bytecodes+18534, IF_386|IF_SM},
+    {I_SBB, 2, {REG_RAX,SBYTE64,0,0,0}, nasm_bytecodes+14490, IF_X64|IF_SM},
+    {I_SBB, 2, {REG_RAX,IMMEDIATE,0,0,0}, nasm_bytecodes+18539, IF_X64|IF_SM},
+    {I_SBB, 2, {RM_GPR|BITS8,IMMEDIATE,0,0,0}, nasm_bytecodes+18544, IF_8086|IF_SM},
+    {I_SBB, 2, {RM_GPR|BITS16,IMMEDIATE,0,0,0}, nasm_bytecodes+14496, IF_8086|IF_SM},
+    {I_SBB, 2, {RM_GPR|BITS32,IMMEDIATE,0,0,0}, nasm_bytecodes+14502, IF_386|IF_SM},
+    {I_SBB, 2, {RM_GPR|BITS64,IMMEDIATE,0,0,0}, nasm_bytecodes+14508, IF_X64|IF_SM},
+    {I_SBB, 2, {MEMORY,IMMEDIATE|BITS8,0,0,0}, nasm_bytecodes+18544, IF_8086|IF_SM},
+    {I_SBB, 2, {MEMORY,IMMEDIATE|BITS16,0,0,0}, nasm_bytecodes+14496, IF_8086|IF_SM},
+    {I_SBB, 2, {MEMORY,IMMEDIATE|BITS32,0,0,0}, nasm_bytecodes+14502, IF_386|IF_SM},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_SCASB[] = {
+    {I_SCASB, 0, {0,0,0,0,0}, nasm_bytecodes+19834, IF_8086},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_SCASD[] = {
+    {I_SCASD, 0, {0,0,0,0,0}, nasm_bytecodes+18549, IF_386},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_SCASQ[] = {
+    {I_SCASQ, 0, {0,0,0,0,0}, nasm_bytecodes+18554, IF_X64},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_SCASW[] = {
+    {I_SCASW, 0, {0,0,0,0,0}, nasm_bytecodes+18559, IF_8086},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_SFENCE[] = {
+    {I_SFENCE, 0, {0,0,0,0,0}, nasm_bytecodes+18564, IF_X64|IF_AMD},
+    {I_SFENCE, 0, {0,0,0,0,0}, nasm_bytecodes+18564, IF_KATMAI},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_SGDT[] = {
+    {I_SGDT, 1, {MEMORY,0,0,0,0}, nasm_bytecodes+18569, IF_286},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_SHL[] = {
+    {I_SHL, 2, {RM_GPR|BITS8,UNITY,0,0,0}, nasm_bytecodes+19810, IF_8086},
+    {I_SHL, 2, {RM_GPR|BITS8,REG_CL,0,0,0}, nasm_bytecodes+19814, IF_8086},
+    {I_SHL, 2, {RM_GPR|BITS8,IMMEDIATE,0,0,0}, nasm_bytecodes+18429, IF_186|IF_SB},
+    {I_SHL, 2, {RM_GPR|BITS16,UNITY,0,0,0}, nasm_bytecodes+18434, IF_8086},
+    {I_SHL, 2, {RM_GPR|BITS16,REG_CL,0,0,0}, nasm_bytecodes+18439, IF_8086},
+    {I_SHL, 2, {RM_GPR|BITS16,IMMEDIATE,0,0,0}, nasm_bytecodes+14442, IF_186|IF_SB},
+    {I_SHL, 2, {RM_GPR|BITS32,UNITY,0,0,0}, nasm_bytecodes+18444, IF_386},
+    {I_SHL, 2, {RM_GPR|BITS32,REG_CL,0,0,0}, nasm_bytecodes+18449, IF_386},
+    {I_SHL, 2, {RM_GPR|BITS32,IMMEDIATE,0,0,0}, nasm_bytecodes+14448, IF_386|IF_SB},
+    {I_SHL, 2, {RM_GPR|BITS64,UNITY,0,0,0}, nasm_bytecodes+18454, IF_X64},
+    {I_SHL, 2, {RM_GPR|BITS64,REG_CL,0,0,0}, nasm_bytecodes+18459, IF_X64},
+    {I_SHL, 2, {RM_GPR|BITS64,IMMEDIATE,0,0,0}, nasm_bytecodes+14454, IF_X64|IF_SB},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_SHLD[] = {
+    {I_SHLD, 3, {MEMORY,REG_GPR|BITS16,IMMEDIATE,0,0}, nasm_bytecodes+7747, IF_386|IF_SM2|IF_SB|IF_AR2},
+    {I_SHLD, 3, {REG_GPR|BITS16,REG_GPR|BITS16,IMMEDIATE,0,0}, nasm_bytecodes+7747, IF_386|IF_SM2|IF_SB|IF_AR2},
+    {I_SHLD, 3, {MEMORY,REG_GPR|BITS32,IMMEDIATE,0,0}, nasm_bytecodes+7754, IF_386|IF_SM2|IF_SB|IF_AR2},
+    {I_SHLD, 3, {REG_GPR|BITS32,REG_GPR|BITS32,IMMEDIATE,0,0}, nasm_bytecodes+7754, IF_386|IF_SM2|IF_SB|IF_AR2},
+    {I_SHLD, 3, {MEMORY,REG_GPR|BITS64,IMMEDIATE,0,0}, nasm_bytecodes+7761, IF_X64|IF_SM2|IF_SB|IF_AR2},
+    {I_SHLD, 3, {REG_GPR|BITS64,REG_GPR|BITS64,IMMEDIATE,0,0}, nasm_bytecodes+7761, IF_X64|IF_SM2|IF_SB|IF_AR2},
+    {I_SHLD, 3, {MEMORY,REG_GPR|BITS16,REG_CL,0,0}, nasm_bytecodes+14514, IF_386|IF_SM},
+    {I_SHLD, 3, {REG_GPR|BITS16,REG_GPR|BITS16,REG_CL,0,0}, nasm_bytecodes+14514, IF_386},
+    {I_SHLD, 3, {MEMORY,REG_GPR|BITS32,REG_CL,0,0}, nasm_bytecodes+14520, IF_386|IF_SM},
+    {I_SHLD, 3, {REG_GPR|BITS32,REG_GPR|BITS32,REG_CL,0,0}, nasm_bytecodes+14520, IF_386},
+    {I_SHLD, 3, {MEMORY,REG_GPR|BITS64,REG_CL,0,0}, nasm_bytecodes+14526, IF_X64|IF_SM},
+    {I_SHLD, 3, {REG_GPR|BITS64,REG_GPR|BITS64,REG_CL,0,0}, nasm_bytecodes+14526, IF_X64},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_SHR[] = {
+    {I_SHR, 2, {RM_GPR|BITS8,UNITY,0,0,0}, nasm_bytecodes+19838, IF_8086},
+    {I_SHR, 2, {RM_GPR|BITS8,REG_CL,0,0,0}, nasm_bytecodes+19842, IF_8086},
+    {I_SHR, 2, {RM_GPR|BITS8,IMMEDIATE,0,0,0}, nasm_bytecodes+18574, IF_186|IF_SB},
+    {I_SHR, 2, {RM_GPR|BITS16,UNITY,0,0,0}, nasm_bytecodes+18579, IF_8086},
+    {I_SHR, 2, {RM_GPR|BITS16,REG_CL,0,0,0}, nasm_bytecodes+18584, IF_8086},
+    {I_SHR, 2, {RM_GPR|BITS16,IMMEDIATE,0,0,0}, nasm_bytecodes+14532, IF_186|IF_SB},
+    {I_SHR, 2, {RM_GPR|BITS32,UNITY,0,0,0}, nasm_bytecodes+18589, IF_386},
+    {I_SHR, 2, {RM_GPR|BITS32,REG_CL,0,0,0}, nasm_bytecodes+18594, IF_386},
+    {I_SHR, 2, {RM_GPR|BITS32,IMMEDIATE,0,0,0}, nasm_bytecodes+14538, IF_386|IF_SB},
+    {I_SHR, 2, {RM_GPR|BITS64,UNITY,0,0,0}, nasm_bytecodes+18599, IF_X64},
+    {I_SHR, 2, {RM_GPR|BITS64,REG_CL,0,0,0}, nasm_bytecodes+18604, IF_X64},
+    {I_SHR, 2, {RM_GPR|BITS64,IMMEDIATE,0,0,0}, nasm_bytecodes+14544, IF_X64|IF_SB},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_SHRD[] = {
+    {I_SHRD, 3, {MEMORY,REG_GPR|BITS16,IMMEDIATE,0,0}, nasm_bytecodes+7768, IF_386|IF_SM2|IF_SB|IF_AR2},
+    {I_SHRD, 3, {REG_GPR|BITS16,REG_GPR|BITS16,IMMEDIATE,0,0}, nasm_bytecodes+7768, IF_386|IF_SM2|IF_SB|IF_AR2},
+    {I_SHRD, 3, {MEMORY,REG_GPR|BITS32,IMMEDIATE,0,0}, nasm_bytecodes+7775, IF_386|IF_SM2|IF_SB|IF_AR2},
+    {I_SHRD, 3, {REG_GPR|BITS32,REG_GPR|BITS32,IMMEDIATE,0,0}, nasm_bytecodes+7775, IF_386|IF_SM2|IF_SB|IF_AR2},
+    {I_SHRD, 3, {MEMORY,REG_GPR|BITS64,IMMEDIATE,0,0}, nasm_bytecodes+7782, IF_X64|IF_SM2|IF_SB|IF_AR2},
+    {I_SHRD, 3, {REG_GPR|BITS64,REG_GPR|BITS64,IMMEDIATE,0,0}, nasm_bytecodes+7782, IF_X64|IF_SM2|IF_SB|IF_AR2},
+    {I_SHRD, 3, {MEMORY,REG_GPR|BITS16,REG_CL,0,0}, nasm_bytecodes+14550, IF_386|IF_SM},
+    {I_SHRD, 3, {REG_GPR|BITS16,REG_GPR|BITS16,REG_CL,0,0}, nasm_bytecodes+14550, IF_386},
+    {I_SHRD, 3, {MEMORY,REG_GPR|BITS32,REG_CL,0,0}, nasm_bytecodes+14556, IF_386|IF_SM},
+    {I_SHRD, 3, {REG_GPR|BITS32,REG_GPR|BITS32,REG_CL,0,0}, nasm_bytecodes+14556, IF_386},
+    {I_SHRD, 3, {MEMORY,REG_GPR|BITS64,REG_CL,0,0}, nasm_bytecodes+14562, IF_X64|IF_SM},
+    {I_SHRD, 3, {REG_GPR|BITS64,REG_GPR|BITS64,REG_CL,0,0}, nasm_bytecodes+14562, IF_X64},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_SHUFPD[] = {
+    {I_SHUFPD, 3, {XMMREG,XMMREG,IMMEDIATE,0,0}, nasm_bytecodes+8181, IF_WILLAMETTE|IF_SSE2|IF_SB|IF_AR2},
+    {I_SHUFPD, 3, {XMMREG,MEMORY,IMMEDIATE,0,0}, nasm_bytecodes+8181, IF_WILLAMETTE|IF_SSE2|IF_SM|IF_SB|IF_AR2},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_SHUFPS[] = {
+    {I_SHUFPS, 3, {XMMREG,MEMORY,IMMEDIATE,0,0}, nasm_bytecodes+7908, IF_KATMAI|IF_SSE|IF_SB|IF_AR2},
+    {I_SHUFPS, 3, {XMMREG,XMMREG,IMMEDIATE,0,0}, nasm_bytecodes+7908, IF_KATMAI|IF_SSE|IF_SB|IF_AR2},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_SIDT[] = {
+    {I_SIDT, 1, {MEMORY,0,0,0,0}, nasm_bytecodes+18609, IF_286},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_SKINIT[] = {
+    {I_SKINIT, 0, {0,0,0,0,0}, nasm_bytecodes+18614, IF_X64},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_SLDT[] = {
+    {I_SLDT, 1, {MEMORY,0,0,0,0}, nasm_bytecodes+14587, IF_286},
+    {I_SLDT, 1, {MEMORY|BITS16,0,0,0,0}, nasm_bytecodes+14587, IF_286},
+    {I_SLDT, 1, {REG_GPR|BITS16,0,0,0,0}, nasm_bytecodes+14568, IF_286},
+    {I_SLDT, 1, {REG_GPR|BITS32,0,0,0,0}, nasm_bytecodes+14574, IF_386},
+    {I_SLDT, 1, {REG_GPR|BITS64,0,0,0,0}, nasm_bytecodes+14580, IF_X64},
+    {I_SLDT, 1, {REG_GPR|BITS64,0,0,0,0}, nasm_bytecodes+14586, IF_X64},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_SLWPCB[] = {
+    {I_SLWPCB, 1, {REG_GPR|BITS16,0,0,0,0}, nasm_bytecodes+12885, IF_AMD},
+    {I_SLWPCB, 1, {REG_GPR|BITS32,0,0,0,0}, nasm_bytecodes+12892, IF_AMD|IF_386},
+    {I_SLWPCB, 1, {REG_GPR|BITS64,0,0,0,0}, nasm_bytecodes+12899, IF_AMD|IF_X64},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_SMI[] = {
+    {I_SMI, 0, {0,0,0,0,0}, nasm_bytecodes+19986, IF_386|IF_UNDOC},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_SMINT[] = {
+    {I_SMINT, 0, {0,0,0,0,0}, nasm_bytecodes+19846, IF_P6|IF_CYRIX},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_SMINTOLD[] = {
+    {I_SMINTOLD, 0, {0,0,0,0,0}, nasm_bytecodes+19850, IF_486|IF_CYRIX},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_SMSW[] = {
+    {I_SMSW, 1, {MEMORY,0,0,0,0}, nasm_bytecodes+14599, IF_286},
+    {I_SMSW, 1, {MEMORY|BITS16,0,0,0,0}, nasm_bytecodes+14599, IF_286},
+    {I_SMSW, 1, {REG_GPR|BITS16,0,0,0,0}, nasm_bytecodes+14592, IF_286},
+    {I_SMSW, 1, {REG_GPR|BITS32,0,0,0,0}, nasm_bytecodes+14598, IF_386},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_SQRTPD[] = {
+    {I_SQRTPD, 2, {XMMREG,RM_XMM,0,0,0}, nasm_bytecodes+15696, IF_WILLAMETTE|IF_SSE2|IF_SO},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_SQRTPS[] = {
+    {I_SQRTPS, 2, {XMMREG,RM_XMM,0,0,0}, nasm_bytecodes+14958, IF_KATMAI|IF_SSE},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_SQRTSD[] = {
+    {I_SQRTSD, 2, {XMMREG,RM_XMM,0,0,0}, nasm_bytecodes+15702, IF_WILLAMETTE|IF_SSE2},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_SQRTSS[] = {
+    {I_SQRTSS, 2, {XMMREG,RM_XMM,0,0,0}, nasm_bytecodes+14964, IF_KATMAI|IF_SSE},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_STC[] = {
+    {I_STC, 0, {0,0,0,0,0}, nasm_bytecodes+18346, IF_8086},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_STD[] = {
+    {I_STD, 0, {0,0,0,0,0}, nasm_bytecodes+20019, IF_8086},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_STGI[] = {
+    {I_STGI, 0, {0,0,0,0,0}, nasm_bytecodes+18619, IF_X64},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_STI[] = {
+    {I_STI, 0, {0,0,0,0,0}, nasm_bytecodes+20022, IF_8086},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_STMXCSR[] = {
+    {I_STMXCSR, 1, {MEMORY,0,0,0,0}, nasm_bytecodes+18844, IF_KATMAI|IF_SSE|IF_SD},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_STOSB[] = {
+    {I_STOSB, 0, {0,0,0,0,0}, nasm_bytecodes+5569, IF_8086},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_STOSD[] = {
+    {I_STOSD, 0, {0,0,0,0,0}, nasm_bytecodes+19854, IF_386},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_STOSQ[] = {
+    {I_STOSQ, 0, {0,0,0,0,0}, nasm_bytecodes+19858, IF_X64},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_STOSW[] = {
+    {I_STOSW, 0, {0,0,0,0,0}, nasm_bytecodes+19862, IF_8086},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_STR[] = {
+    {I_STR, 1, {MEMORY,0,0,0,0}, nasm_bytecodes+14617, IF_286|IF_PROT},
+    {I_STR, 1, {MEMORY|BITS16,0,0,0,0}, nasm_bytecodes+14617, IF_286|IF_PROT},
+    {I_STR, 1, {REG_GPR|BITS16,0,0,0,0}, nasm_bytecodes+14604, IF_286|IF_PROT},
+    {I_STR, 1, {REG_GPR|BITS32,0,0,0,0}, nasm_bytecodes+14610, IF_386|IF_PROT},
+    {I_STR, 1, {REG_GPR|BITS64,0,0,0,0}, nasm_bytecodes+14616, IF_X64},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_SUB[] = {
+    {I_SUB, 2, {MEMORY,REG_GPR|BITS8,0,0,0}, nasm_bytecodes+19866, IF_8086|IF_SM},
+    {I_SUB, 2, {REG_GPR|BITS8,REG_GPR|BITS8,0,0,0}, nasm_bytecodes+19866, IF_8086},
+    {I_SUB, 2, {MEMORY,REG_GPR|BITS16,0,0,0}, nasm_bytecodes+18624, IF_8086|IF_SM},
+    {I_SUB, 2, {REG_GPR|BITS16,REG_GPR|BITS16,0,0,0}, nasm_bytecodes+18624, IF_8086},
+    {I_SUB, 2, {MEMORY,REG_GPR|BITS32,0,0,0}, nasm_bytecodes+18629, IF_386|IF_SM},
+    {I_SUB, 2, {REG_GPR|BITS32,REG_GPR|BITS32,0,0,0}, nasm_bytecodes+18629, IF_386},
+    {I_SUB, 2, {MEMORY,REG_GPR|BITS64,0,0,0}, nasm_bytecodes+18634, IF_X64|IF_SM},
+    {I_SUB, 2, {REG_GPR|BITS64,REG_GPR|BITS64,0,0,0}, nasm_bytecodes+18634, IF_X64},
+    {I_SUB, 2, {REG_GPR|BITS8,MEMORY,0,0,0}, nasm_bytecodes+10130, IF_8086|IF_SM},
+    {I_SUB, 2, {REG_GPR|BITS8,REG_GPR|BITS8,0,0,0}, nasm_bytecodes+10130, IF_8086},
+    {I_SUB, 2, {REG_GPR|BITS16,MEMORY,0,0,0}, nasm_bytecodes+18639, IF_8086|IF_SM},
+    {I_SUB, 2, {REG_GPR|BITS16,REG_GPR|BITS16,0,0,0}, nasm_bytecodes+18639, IF_8086},
+    {I_SUB, 2, {REG_GPR|BITS32,MEMORY,0,0,0}, nasm_bytecodes+18644, IF_386|IF_SM},
+    {I_SUB, 2, {REG_GPR|BITS32,REG_GPR|BITS32,0,0,0}, nasm_bytecodes+18644, IF_386},
+    {I_SUB, 2, {REG_GPR|BITS64,MEMORY,0,0,0}, nasm_bytecodes+18649, IF_X64|IF_SM},
+    {I_SUB, 2, {REG_GPR|BITS64,REG_GPR|BITS64,0,0,0}, nasm_bytecodes+18649, IF_X64},
+    {I_SUB, 2, {RM_GPR|BITS16,IMMEDIATE|BITS8,0,0,0}, nasm_bytecodes+14622, IF_8086},
+    {I_SUB, 2, {RM_GPR|BITS32,IMMEDIATE|BITS8,0,0,0}, nasm_bytecodes+14628, IF_386},
+    {I_SUB, 2, {RM_GPR|BITS64,IMMEDIATE|BITS8,0,0,0}, nasm_bytecodes+14634, IF_X64},
+    {I_SUB, 2, {REG_AL,IMMEDIATE,0,0,0}, nasm_bytecodes+19870, IF_8086|IF_SM},
+    {I_SUB, 2, {REG_AX,SBYTE16,0,0,0}, nasm_bytecodes+14622, IF_8086|IF_SM},
+    {I_SUB, 2, {REG_AX,IMMEDIATE,0,0,0}, nasm_bytecodes+18654, IF_8086|IF_SM},
+    {I_SUB, 2, {REG_EAX,SBYTE32,0,0,0}, nasm_bytecodes+14628, IF_386|IF_SM},
+    {I_SUB, 2, {REG_EAX,IMMEDIATE,0,0,0}, nasm_bytecodes+18659, IF_386|IF_SM},
+    {I_SUB, 2, {REG_RAX,SBYTE64,0,0,0}, nasm_bytecodes+14634, IF_X64|IF_SM},
+    {I_SUB, 2, {REG_RAX,IMMEDIATE,0,0,0}, nasm_bytecodes+18664, IF_X64|IF_SM},
+    {I_SUB, 2, {RM_GPR|BITS8,IMMEDIATE,0,0,0}, nasm_bytecodes+18669, IF_8086|IF_SM},
+    {I_SUB, 2, {RM_GPR|BITS16,IMMEDIATE,0,0,0}, nasm_bytecodes+14640, IF_8086|IF_SM},
+    {I_SUB, 2, {RM_GPR|BITS32,IMMEDIATE,0,0,0}, nasm_bytecodes+14646, IF_386|IF_SM},
+    {I_SUB, 2, {RM_GPR|BITS64,IMMEDIATE,0,0,0}, nasm_bytecodes+14652, IF_X64|IF_SM},
+    {I_SUB, 2, {MEMORY,IMMEDIATE|BITS8,0,0,0}, nasm_bytecodes+18669, IF_8086|IF_SM},
+    {I_SUB, 2, {MEMORY,IMMEDIATE|BITS16,0,0,0}, nasm_bytecodes+14640, IF_8086|IF_SM},
+    {I_SUB, 2, {MEMORY,IMMEDIATE|BITS32,0,0,0}, nasm_bytecodes+14646, IF_386|IF_SM},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_SUBPD[] = {
+    {I_SUBPD, 2, {XMMREG,RM_XMM,0,0,0}, nasm_bytecodes+15708, IF_WILLAMETTE|IF_SSE2|IF_SO},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_SUBPS[] = {
+    {I_SUBPS, 2, {XMMREG,RM_XMM,0,0,0}, nasm_bytecodes+14970, IF_KATMAI|IF_SSE},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_SUBSD[] = {
+    {I_SUBSD, 2, {XMMREG,RM_XMM,0,0,0}, nasm_bytecodes+15714, IF_WILLAMETTE|IF_SSE2},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_SUBSS[] = {
+    {I_SUBSS, 2, {XMMREG,RM_XMM,0,0,0}, nasm_bytecodes+14976, IF_KATMAI|IF_SSE},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_SVDC[] = {
+    {I_SVDC, 2, {MEMORY|BITS80,REG_SREG,0,0,0}, nasm_bytecodes+8190, IF_486|IF_CYRIX|IF_SMM},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_SVLDT[] = {
+    {I_SVLDT, 1, {MEMORY|BITS80,0,0,0,0}, nasm_bytecodes+18674, IF_486|IF_CYRIX|IF_SMM},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_SVTS[] = {
+    {I_SVTS, 1, {MEMORY|BITS80,0,0,0,0}, nasm_bytecodes+18679, IF_486|IF_CYRIX|IF_SMM},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_SWAPGS[] = {
+    {I_SWAPGS, 0, {0,0,0,0,0}, nasm_bytecodes+18684, IF_X64},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_SYSCALL[] = {
+    {I_SYSCALL, 0, {0,0,0,0,0}, nasm_bytecodes+19574, IF_P6|IF_AMD},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_SYSENTER[] = {
+    {I_SYSENTER, 0, {0,0,0,0,0}, nasm_bytecodes+19874, IF_P6},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_SYSEXIT[] = {
+    {I_SYSEXIT, 0, {0,0,0,0,0}, nasm_bytecodes+19878, IF_P6|IF_PRIV},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_SYSRET[] = {
+    {I_SYSRET, 0, {0,0,0,0,0}, nasm_bytecodes+19570, IF_P6|IF_PRIV|IF_AMD},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_TEST[] = {
+    {I_TEST, 2, {MEMORY,REG_GPR|BITS8,0,0,0}, nasm_bytecodes+19882, IF_8086|IF_SM},
+    {I_TEST, 2, {REG_GPR|BITS8,REG_GPR|BITS8,0,0,0}, nasm_bytecodes+19882, IF_8086},
+    {I_TEST, 2, {MEMORY,REG_GPR|BITS16,0,0,0}, nasm_bytecodes+18689, IF_8086|IF_SM},
+    {I_TEST, 2, {REG_GPR|BITS16,REG_GPR|BITS16,0,0,0}, nasm_bytecodes+18689, IF_8086},
+    {I_TEST, 2, {MEMORY,REG_GPR|BITS32,0,0,0}, nasm_bytecodes+18694, IF_386|IF_SM},
+    {I_TEST, 2, {REG_GPR|BITS32,REG_GPR|BITS32,0,0,0}, nasm_bytecodes+18694, IF_386},
+    {I_TEST, 2, {MEMORY,REG_GPR|BITS64,0,0,0}, nasm_bytecodes+18699, IF_X64|IF_SM},
+    {I_TEST, 2, {REG_GPR|BITS64,REG_GPR|BITS64,0,0,0}, nasm_bytecodes+18699, IF_X64},
+    {I_TEST, 2, {REG_GPR|BITS8,MEMORY,0,0,0}, nasm_bytecodes+19886, IF_8086|IF_SM},
+    {I_TEST, 2, {REG_GPR|BITS16,MEMORY,0,0,0}, nasm_bytecodes+18704, IF_8086|IF_SM},
+    {I_TEST, 2, {REG_GPR|BITS32,MEMORY,0,0,0}, nasm_bytecodes+18709, IF_386|IF_SM},
+    {I_TEST, 2, {REG_GPR|BITS64,MEMORY,0,0,0}, nasm_bytecodes+18714, IF_X64|IF_SM},
+    {I_TEST, 2, {REG_AL,IMMEDIATE,0,0,0}, nasm_bytecodes+19890, IF_8086|IF_SM},
+    {I_TEST, 2, {REG_AX,IMMEDIATE,0,0,0}, nasm_bytecodes+18719, IF_8086|IF_SM},
+    {I_TEST, 2, {REG_EAX,IMMEDIATE,0,0,0}, nasm_bytecodes+18724, IF_386|IF_SM},
+    {I_TEST, 2, {REG_RAX,IMMEDIATE,0,0,0}, nasm_bytecodes+18729, IF_X64|IF_SM},
+    {I_TEST, 2, {RM_GPR|BITS8,IMMEDIATE,0,0,0}, nasm_bytecodes+18734, IF_8086|IF_SM},
+    {I_TEST, 2, {RM_GPR|BITS16,IMMEDIATE,0,0,0}, nasm_bytecodes+14658, IF_8086|IF_SM},
+    {I_TEST, 2, {RM_GPR|BITS32,IMMEDIATE,0,0,0}, nasm_bytecodes+14664, IF_386|IF_SM},
+    {I_TEST, 2, {RM_GPR|BITS64,IMMEDIATE,0,0,0}, nasm_bytecodes+14670, IF_X64|IF_SM},
+    {I_TEST, 2, {MEMORY,IMMEDIATE|BITS8,0,0,0}, nasm_bytecodes+18734, IF_8086|IF_SM},
+    {I_TEST, 2, {MEMORY,IMMEDIATE|BITS16,0,0,0}, nasm_bytecodes+14658, IF_8086|IF_SM},
+    {I_TEST, 2, {MEMORY,IMMEDIATE|BITS32,0,0,0}, nasm_bytecodes+14664, IF_386|IF_SM},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_UCOMISD[] = {
+    {I_UCOMISD, 2, {XMMREG,RM_XMM,0,0,0}, nasm_bytecodes+15720, IF_WILLAMETTE|IF_SSE2},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_UCOMISS[] = {
+    {I_UCOMISS, 2, {XMMREG,RM_XMM,0,0,0}, nasm_bytecodes+14982, IF_KATMAI|IF_SSE},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_UD0[] = {
+    {I_UD0, 0, {0,0,0,0,0}, nasm_bytecodes+19894, IF_186|IF_UNDOC},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_UD1[] = {
+    {I_UD1, 0, {0,0,0,0,0}, nasm_bytecodes+19898, IF_186|IF_UNDOC},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_UD2[] = {
+    {I_UD2, 0, {0,0,0,0,0}, nasm_bytecodes+19902, IF_186},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_UD2A[] = {
+    {I_UD2A, 0, {0,0,0,0,0}, nasm_bytecodes+19902, IF_186},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_UD2B[] = {
+    {I_UD2B, 0, {0,0,0,0,0}, nasm_bytecodes+19898, IF_186|IF_UNDOC},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_UMOV[] = {
+    {I_UMOV, 2, {MEMORY,REG_GPR|BITS8,0,0,0}, nasm_bytecodes+14676, IF_386|IF_UNDOC|IF_SM},
+    {I_UMOV, 2, {REG_GPR|BITS8,REG_GPR|BITS8,0,0,0}, nasm_bytecodes+14676, IF_386|IF_UNDOC},
+    {I_UMOV, 2, {MEMORY,REG_GPR|BITS16,0,0,0}, nasm_bytecodes+7789, IF_386|IF_UNDOC|IF_SM},
+    {I_UMOV, 2, {REG_GPR|BITS16,REG_GPR|BITS16,0,0,0}, nasm_bytecodes+7789, IF_386|IF_UNDOC},
+    {I_UMOV, 2, {MEMORY,REG_GPR|BITS32,0,0,0}, nasm_bytecodes+7796, IF_386|IF_UNDOC|IF_SM},
+    {I_UMOV, 2, {REG_GPR|BITS32,REG_GPR|BITS32,0,0,0}, nasm_bytecodes+7796, IF_386|IF_UNDOC},
+    {I_UMOV, 2, {REG_GPR|BITS8,MEMORY,0,0,0}, nasm_bytecodes+14682, IF_386|IF_UNDOC|IF_SM},
+    {I_UMOV, 2, {REG_GPR|BITS8,REG_GPR|BITS8,0,0,0}, nasm_bytecodes+14682, IF_386|IF_UNDOC},
+    {I_UMOV, 2, {REG_GPR|BITS16,MEMORY,0,0,0}, nasm_bytecodes+7803, IF_386|IF_UNDOC|IF_SM},
+    {I_UMOV, 2, {REG_GPR|BITS16,REG_GPR|BITS16,0,0,0}, nasm_bytecodes+7803, IF_386|IF_UNDOC},
+    {I_UMOV, 2, {REG_GPR|BITS32,MEMORY,0,0,0}, nasm_bytecodes+7810, IF_386|IF_UNDOC|IF_SM},
+    {I_UMOV, 2, {REG_GPR|BITS32,REG_GPR|BITS32,0,0,0}, nasm_bytecodes+7810, IF_386|IF_UNDOC},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_UNPCKHPD[] = {
+    {I_UNPCKHPD, 2, {XMMREG,RM_XMM,0,0,0}, nasm_bytecodes+15726, IF_WILLAMETTE|IF_SSE2|IF_SO},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_UNPCKHPS[] = {
+    {I_UNPCKHPS, 2, {XMMREG,RM_XMM,0,0,0}, nasm_bytecodes+14988, IF_KATMAI|IF_SSE},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_UNPCKLPD[] = {
+    {I_UNPCKLPD, 2, {XMMREG,RM_XMM,0,0,0}, nasm_bytecodes+15732, IF_WILLAMETTE|IF_SSE2|IF_SO},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_UNPCKLPS[] = {
+    {I_UNPCKLPS, 2, {XMMREG,RM_XMM,0,0,0}, nasm_bytecodes+14994, IF_KATMAI|IF_SSE},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VADDPD[] = {
+    {I_VADDPD, 3, {XMMREG,XMMREG,RM_XMM|BITS128,0,0}, nasm_bytecodes+8811, IF_AVX|IF_SANDYBRIDGE},
+    {I_VADDPD, 2, {XMMREG,RM_XMM|BITS128,0,0,0}, nasm_bytecodes+8818, IF_AVX|IF_SANDYBRIDGE},
+    {I_VADDPD, 3, {YMMREG,YMMREG,RM_YMM|BITS256,0,0}, nasm_bytecodes+8825, IF_AVX|IF_SANDYBRIDGE},
+    {I_VADDPD, 2, {YMMREG,RM_YMM|BITS256,0,0,0}, nasm_bytecodes+8832, IF_AVX|IF_SANDYBRIDGE},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VADDPS[] = {
+    {I_VADDPS, 3, {XMMREG,XMMREG,RM_XMM|BITS128,0,0}, nasm_bytecodes+8839, IF_AVX|IF_SANDYBRIDGE},
+    {I_VADDPS, 2, {XMMREG,RM_XMM|BITS128,0,0,0}, nasm_bytecodes+8846, IF_AVX|IF_SANDYBRIDGE},
+    {I_VADDPS, 3, {YMMREG,YMMREG,RM_YMM|BITS256,0,0}, nasm_bytecodes+8853, IF_AVX|IF_SANDYBRIDGE},
+    {I_VADDPS, 2, {YMMREG,RM_YMM|BITS256,0,0,0}, nasm_bytecodes+8860, IF_AVX|IF_SANDYBRIDGE},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VADDSD[] = {
+    {I_VADDSD, 3, {XMMREG,XMMREG,RM_XMM|BITS64,0,0}, nasm_bytecodes+8867, IF_AVX|IF_SANDYBRIDGE},
+    {I_VADDSD, 2, {XMMREG,RM_XMM|BITS64,0,0,0}, nasm_bytecodes+8874, IF_AVX|IF_SANDYBRIDGE},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VADDSS[] = {
+    {I_VADDSS, 3, {XMMREG,XMMREG,RM_XMM|BITS32,0,0}, nasm_bytecodes+8881, IF_AVX|IF_SANDYBRIDGE},
+    {I_VADDSS, 2, {XMMREG,RM_XMM|BITS32,0,0,0}, nasm_bytecodes+8888, IF_AVX|IF_SANDYBRIDGE},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VADDSUBPD[] = {
+    {I_VADDSUBPD, 3, {XMMREG,XMMREG,RM_XMM|BITS128,0,0}, nasm_bytecodes+8895, IF_AVX|IF_SANDYBRIDGE},
+    {I_VADDSUBPD, 2, {XMMREG,RM_XMM|BITS128,0,0,0}, nasm_bytecodes+8902, IF_AVX|IF_SANDYBRIDGE},
+    {I_VADDSUBPD, 3, {YMMREG,YMMREG,RM_YMM|BITS256,0,0}, nasm_bytecodes+8909, IF_AVX|IF_SANDYBRIDGE},
+    {I_VADDSUBPD, 2, {YMMREG,RM_YMM|BITS256,0,0,0}, nasm_bytecodes+8916, IF_AVX|IF_SANDYBRIDGE},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VADDSUBPS[] = {
+    {I_VADDSUBPS, 3, {XMMREG,XMMREG,RM_XMM|BITS128,0,0}, nasm_bytecodes+8923, IF_AVX|IF_SANDYBRIDGE},
+    {I_VADDSUBPS, 2, {XMMREG,RM_XMM|BITS128,0,0,0}, nasm_bytecodes+8930, IF_AVX|IF_SANDYBRIDGE},
+    {I_VADDSUBPS, 3, {YMMREG,YMMREG,RM_YMM|BITS256,0,0}, nasm_bytecodes+8937, IF_AVX|IF_SANDYBRIDGE},
+    {I_VADDSUBPS, 2, {YMMREG,RM_YMM|BITS256,0,0,0}, nasm_bytecodes+8944, IF_AVX|IF_SANDYBRIDGE},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VAESDEC[] = {
+    {I_VAESDEC, 3, {XMMREG,XMMREG,RM_XMM|BITS128,0,0}, nasm_bytecodes+8776, IF_AVX|IF_SANDYBRIDGE},
+    {I_VAESDEC, 2, {XMMREG,RM_XMM|BITS128,0,0,0}, nasm_bytecodes+8783, IF_AVX|IF_SANDYBRIDGE},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VAESDECLAST[] = {
+    {I_VAESDECLAST, 3, {XMMREG,XMMREG,RM_XMM|BITS128,0,0}, nasm_bytecodes+8790, IF_AVX|IF_SANDYBRIDGE},
+    {I_VAESDECLAST, 2, {XMMREG,RM_XMM|BITS128,0,0,0}, nasm_bytecodes+8797, IF_AVX|IF_SANDYBRIDGE},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VAESENC[] = {
+    {I_VAESENC, 3, {XMMREG,XMMREG,RM_XMM|BITS128,0,0}, nasm_bytecodes+8748, IF_AVX|IF_SANDYBRIDGE},
+    {I_VAESENC, 2, {XMMREG,RM_XMM|BITS128,0,0,0}, nasm_bytecodes+8755, IF_AVX|IF_SANDYBRIDGE},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VAESENCLAST[] = {
+    {I_VAESENCLAST, 3, {XMMREG,XMMREG,RM_XMM|BITS128,0,0}, nasm_bytecodes+8762, IF_AVX|IF_SANDYBRIDGE},
+    {I_VAESENCLAST, 2, {XMMREG,RM_XMM|BITS128,0,0,0}, nasm_bytecodes+8769, IF_AVX|IF_SANDYBRIDGE},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VAESIMC[] = {
+    {I_VAESIMC, 2, {XMMREG,RM_XMM|BITS128,0,0,0}, nasm_bytecodes+8804, IF_AVX|IF_SANDYBRIDGE},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VAESKEYGENASSIST[] = {
+    {I_VAESKEYGENASSIST, 3, {XMMREG,RM_XMM|BITS128,IMMEDIATE|BITS8,0,0}, nasm_bytecodes+6116, IF_AVX|IF_SANDYBRIDGE},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VANDNPD[] = {
+    {I_VANDNPD, 3, {XMMREG,XMMREG,RM_XMM|BITS128,0,0}, nasm_bytecodes+9007, IF_AVX|IF_SANDYBRIDGE},
+    {I_VANDNPD, 2, {XMMREG,RM_XMM|BITS128,0,0,0}, nasm_bytecodes+9014, IF_AVX|IF_SANDYBRIDGE},
+    {I_VANDNPD, 3, {YMMREG,YMMREG,RM_YMM|BITS256,0,0}, nasm_bytecodes+9021, IF_AVX|IF_SANDYBRIDGE},
+    {I_VANDNPD, 2, {YMMREG,RM_YMM|BITS256,0,0,0}, nasm_bytecodes+9028, IF_AVX|IF_SANDYBRIDGE},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VANDNPS[] = {
+    {I_VANDNPS, 3, {XMMREG,XMMREG,RM_XMM|BITS128,0,0}, nasm_bytecodes+9035, IF_AVX|IF_SANDYBRIDGE},
+    {I_VANDNPS, 2, {XMMREG,RM_XMM|BITS128,0,0,0}, nasm_bytecodes+9042, IF_AVX|IF_SANDYBRIDGE},
+    {I_VANDNPS, 3, {YMMREG,YMMREG,RM_YMM|BITS256,0,0}, nasm_bytecodes+9049, IF_AVX|IF_SANDYBRIDGE},
+    {I_VANDNPS, 2, {YMMREG,RM_YMM|BITS256,0,0,0}, nasm_bytecodes+9056, IF_AVX|IF_SANDYBRIDGE},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VANDPD[] = {
+    {I_VANDPD, 3, {XMMREG,XMMREG,RM_XMM|BITS128,0,0}, nasm_bytecodes+8951, IF_AVX|IF_SANDYBRIDGE},
+    {I_VANDPD, 2, {XMMREG,RM_XMM|BITS128,0,0,0}, nasm_bytecodes+8958, IF_AVX|IF_SANDYBRIDGE},
+    {I_VANDPD, 3, {YMMREG,YMMREG,RM_YMM|BITS256,0,0}, nasm_bytecodes+8965, IF_AVX|IF_SANDYBRIDGE},
+    {I_VANDPD, 2, {YMMREG,RM_YMM|BITS256,0,0,0}, nasm_bytecodes+8972, IF_AVX|IF_SANDYBRIDGE},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VANDPS[] = {
+    {I_VANDPS, 3, {XMMREG,XMMREG,RM_XMM|BITS128,0,0}, nasm_bytecodes+8979, IF_AVX|IF_SANDYBRIDGE},
+    {I_VANDPS, 2, {XMMREG,RM_XMM|BITS128,0,0,0}, nasm_bytecodes+8986, IF_AVX|IF_SANDYBRIDGE},
+    {I_VANDPS, 3, {YMMREG,YMMREG,RM_YMM|BITS256,0,0}, nasm_bytecodes+8993, IF_AVX|IF_SANDYBRIDGE},
+    {I_VANDPS, 2, {YMMREG,RM_YMM|BITS256,0,0,0}, nasm_bytecodes+9000, IF_AVX|IF_SANDYBRIDGE},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VBLENDPD[] = {
+    {I_VBLENDPD, 4, {XMMREG,XMMREG,RM_XMM|BITS128,IMMEDIATE|BITS8,0}, nasm_bytecodes+6124, IF_AVX|IF_SANDYBRIDGE},
+    {I_VBLENDPD, 3, {XMMREG,RM_XMM|BITS128,IMMEDIATE|BITS8,0,0}, nasm_bytecodes+6132, IF_AVX|IF_SANDYBRIDGE},
+    {I_VBLENDPD, 4, {YMMREG,YMMREG,RM_YMM|BITS256,IMMEDIATE|BITS8,0}, nasm_bytecodes+6140, IF_AVX|IF_SANDYBRIDGE},
+    {I_VBLENDPD, 3, {YMMREG,RM_YMM|BITS256,IMMEDIATE|BITS8,0,0}, nasm_bytecodes+6148, IF_AVX|IF_SANDYBRIDGE},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VBLENDPS[] = {
+    {I_VBLENDPS, 4, {XMMREG,XMMREG,RM_XMM|BITS128,IMMEDIATE|BITS8,0}, nasm_bytecodes+6156, IF_AVX|IF_SANDYBRIDGE},
+    {I_VBLENDPS, 3, {XMMREG,RM_XMM|BITS128,IMMEDIATE|BITS8,0,0}, nasm_bytecodes+6164, IF_AVX|IF_SANDYBRIDGE},
+    {I_VBLENDPS, 4, {YMMREG,YMMREG,RM_YMM|BITS256,IMMEDIATE|BITS8,0}, nasm_bytecodes+6172, IF_AVX|IF_SANDYBRIDGE},
+    {I_VBLENDPS, 3, {YMMREG,RM_YMM|BITS256,IMMEDIATE|BITS8,0,0}, nasm_bytecodes+6180, IF_AVX|IF_SANDYBRIDGE},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VBLENDVPD[] = {
+    {I_VBLENDVPD, 4, {XMMREG,XMMREG,RM_XMM|BITS128,XMMREG,0}, nasm_bytecodes+54, IF_AVX|IF_SANDYBRIDGE},
+    {I_VBLENDVPD, 3, {XMMREG,RM_XMM|BITS128,XMM0,0,0}, nasm_bytecodes+9063, IF_AVX|IF_SANDYBRIDGE},
+    {I_VBLENDVPD, 4, {YMMREG,YMMREG,RM_YMM|BITS256,YMMREG,0}, nasm_bytecodes+63, IF_AVX|IF_SANDYBRIDGE},
+    {I_VBLENDVPD, 3, {YMMREG,RM_YMM|BITS256,YMM0,0,0}, nasm_bytecodes+9070, IF_AVX|IF_SANDYBRIDGE},
+    {I_VBLENDVPD, 3, {YMMREG,RM_YMM|BITS256,YMM0,0,0}, nasm_bytecodes+9084, IF_AVX|IF_SANDYBRIDGE},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VBLENDVPS[] = {
+    {I_VBLENDVPS, 4, {XMMREG,XMMREG,RM_XMM|BITS128,XMMREG,0}, nasm_bytecodes+72, IF_AVX|IF_SANDYBRIDGE},
+    {I_VBLENDVPS, 3, {XMMREG,RM_XMM|BITS128,XMM0,0,0}, nasm_bytecodes+9077, IF_AVX|IF_SANDYBRIDGE},
+    {I_VBLENDVPS, 4, {YMMREG,YMMREG,RM_YMM|BITS256,YMMREG,0}, nasm_bytecodes+81, IF_AVX|IF_SANDYBRIDGE},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VBROADCASTF128[] = {
+    {I_VBROADCASTF128, 2, {YMMREG,MEMORY|BITS128,0,0,0}, nasm_bytecodes+9112, IF_AVX|IF_SANDYBRIDGE},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VBROADCASTSD[] = {
+    {I_VBROADCASTSD, 2, {YMMREG,MEMORY|BITS64,0,0,0}, nasm_bytecodes+9105, IF_AVX|IF_SANDYBRIDGE},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VBROADCASTSS[] = {
+    {I_VBROADCASTSS, 2, {XMMREG,MEMORY|BITS32,0,0,0}, nasm_bytecodes+9091, IF_AVX|IF_SANDYBRIDGE},
+    {I_VBROADCASTSS, 2, {YMMREG,MEMORY|BITS32,0,0,0}, nasm_bytecodes+9098, IF_AVX|IF_SANDYBRIDGE},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VCMPEQPD[] = {
+    {I_VCMPEQPD, 3, {XMMREG,XMMREG,RM_XMM|BITS128,0,0}, nasm_bytecodes+90, IF_AVX|IF_SANDYBRIDGE},
+    {I_VCMPEQPD, 2, {XMMREG,RM_XMM|BITS128,0,0,0}, nasm_bytecodes+99, IF_AVX|IF_SANDYBRIDGE},
+    {I_VCMPEQPD, 3, {YMMREG,YMMREG,RM_YMM|BITS256,0,0}, nasm_bytecodes+108, IF_AVX|IF_SANDYBRIDGE},
+    {I_VCMPEQPD, 2, {YMMREG,RM_YMM|BITS256,0,0,0}, nasm_bytecodes+117, IF_AVX|IF_SANDYBRIDGE},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VCMPEQPS[] = {
+    {I_VCMPEQPS, 3, {XMMREG,XMMREG,RM_XMM|BITS128,0,0}, nasm_bytecodes+1242, IF_AVX|IF_SANDYBRIDGE},
+    {I_VCMPEQPS, 2, {XMMREG,RM_XMM|BITS128,0,0,0}, nasm_bytecodes+1251, IF_AVX|IF_SANDYBRIDGE},
+    {I_VCMPEQPS, 3, {YMMREG,YMMREG,RM_YMM|BITS256,0,0}, nasm_bytecodes+1260, IF_AVX|IF_SANDYBRIDGE},
+    {I_VCMPEQPS, 2, {YMMREG,RM_YMM|BITS256,0,0,0}, nasm_bytecodes+1269, IF_AVX|IF_SANDYBRIDGE},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VCMPEQSD[] = {
+    {I_VCMPEQSD, 3, {XMMREG,XMMREG,RM_XMM|BITS64,0,0}, nasm_bytecodes+2394, IF_AVX|IF_SANDYBRIDGE},
+    {I_VCMPEQSD, 2, {XMMREG,RM_XMM|BITS64,0,0,0}, nasm_bytecodes+2403, IF_AVX|IF_SANDYBRIDGE},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VCMPEQSS[] = {
+    {I_VCMPEQSS, 3, {XMMREG,XMMREG,RM_XMM|BITS32,0,0}, nasm_bytecodes+2970, IF_AVX|IF_SANDYBRIDGE},
+    {I_VCMPEQSS, 2, {XMMREG,RM_XMM|BITS32,0,0,0}, nasm_bytecodes+2979, IF_AVX|IF_SANDYBRIDGE},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VCMPEQ_OSPD[] = {
+    {I_VCMPEQ_OSPD, 3, {XMMREG,XMMREG,RM_XMM|BITS128,0,0}, nasm_bytecodes+666, IF_AVX|IF_SANDYBRIDGE},
+    {I_VCMPEQ_OSPD, 2, {XMMREG,RM_XMM|BITS128,0,0,0}, nasm_bytecodes+675, IF_AVX|IF_SANDYBRIDGE},
+    {I_VCMPEQ_OSPD, 3, {YMMREG,YMMREG,RM_YMM|BITS256,0,0}, nasm_bytecodes+684, IF_AVX|IF_SANDYBRIDGE},
+    {I_VCMPEQ_OSPD, 2, {YMMREG,RM_YMM|BITS256,0,0,0}, nasm_bytecodes+693, IF_AVX|IF_SANDYBRIDGE},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VCMPEQ_OSPS[] = {
+    {I_VCMPEQ_OSPS, 3, {XMMREG,XMMREG,RM_XMM|BITS128,0,0}, nasm_bytecodes+1818, IF_AVX|IF_SANDYBRIDGE},
+    {I_VCMPEQ_OSPS, 2, {XMMREG,RM_XMM|BITS128,0,0,0}, nasm_bytecodes+1827, IF_AVX|IF_SANDYBRIDGE},
+    {I_VCMPEQ_OSPS, 3, {YMMREG,YMMREG,RM_YMM|BITS256,0,0}, nasm_bytecodes+1836, IF_AVX|IF_SANDYBRIDGE},
+    {I_VCMPEQ_OSPS, 2, {YMMREG,RM_YMM|BITS256,0,0,0}, nasm_bytecodes+1845, IF_AVX|IF_SANDYBRIDGE},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VCMPEQ_OSSD[] = {
+    {I_VCMPEQ_OSSD, 3, {XMMREG,XMMREG,RM_XMM|BITS64,0,0}, nasm_bytecodes+2682, IF_AVX|IF_SANDYBRIDGE},
+    {I_VCMPEQ_OSSD, 2, {XMMREG,RM_XMM|BITS64,0,0,0}, nasm_bytecodes+2691, IF_AVX|IF_SANDYBRIDGE},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VCMPEQ_OSSS[] = {
+    {I_VCMPEQ_OSSS, 3, {XMMREG,XMMREG,RM_XMM|BITS32,0,0}, nasm_bytecodes+3258, IF_AVX|IF_SANDYBRIDGE},
+    {I_VCMPEQ_OSSS, 2, {XMMREG,RM_XMM|BITS32,0,0,0}, nasm_bytecodes+3267, IF_AVX|IF_SANDYBRIDGE},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VCMPEQ_UQPD[] = {
+    {I_VCMPEQ_UQPD, 3, {XMMREG,XMMREG,RM_XMM|BITS128,0,0}, nasm_bytecodes+378, IF_AVX|IF_SANDYBRIDGE},
+    {I_VCMPEQ_UQPD, 2, {XMMREG,RM_XMM|BITS128,0,0,0}, nasm_bytecodes+387, IF_AVX|IF_SANDYBRIDGE},
+    {I_VCMPEQ_UQPD, 3, {YMMREG,YMMREG,RM_YMM|BITS256,0,0}, nasm_bytecodes+396, IF_AVX|IF_SANDYBRIDGE},
+    {I_VCMPEQ_UQPD, 2, {YMMREG,RM_YMM|BITS256,0,0,0}, nasm_bytecodes+405, IF_AVX|IF_SANDYBRIDGE},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VCMPEQ_UQPS[] = {
+    {I_VCMPEQ_UQPS, 3, {XMMREG,XMMREG,RM_XMM|BITS128,0,0}, nasm_bytecodes+1530, IF_AVX|IF_SANDYBRIDGE},
+    {I_VCMPEQ_UQPS, 2, {XMMREG,RM_XMM|BITS128,0,0,0}, nasm_bytecodes+1539, IF_AVX|IF_SANDYBRIDGE},
+    {I_VCMPEQ_UQPS, 3, {YMMREG,YMMREG,RM_YMM|BITS256,0,0}, nasm_bytecodes+1548, IF_AVX|IF_SANDYBRIDGE},
+    {I_VCMPEQ_UQPS, 2, {YMMREG,RM_YMM|BITS256,0,0,0}, nasm_bytecodes+1557, IF_AVX|IF_SANDYBRIDGE},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VCMPEQ_UQSD[] = {
+    {I_VCMPEQ_UQSD, 3, {XMMREG,XMMREG,RM_XMM|BITS64,0,0}, nasm_bytecodes+2538, IF_AVX|IF_SANDYBRIDGE},
+    {I_VCMPEQ_UQSD, 2, {XMMREG,RM_XMM|BITS64,0,0,0}, nasm_bytecodes+2547, IF_AVX|IF_SANDYBRIDGE},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VCMPEQ_UQSS[] = {
+    {I_VCMPEQ_UQSS, 3, {XMMREG,XMMREG,RM_XMM|BITS32,0,0}, nasm_bytecodes+3114, IF_AVX|IF_SANDYBRIDGE},
+    {I_VCMPEQ_UQSS, 2, {XMMREG,RM_XMM|BITS32,0,0,0}, nasm_bytecodes+3123, IF_AVX|IF_SANDYBRIDGE},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VCMPEQ_USPD[] = {
+    {I_VCMPEQ_USPD, 3, {XMMREG,XMMREG,RM_XMM|BITS128,0,0}, nasm_bytecodes+954, IF_AVX|IF_SANDYBRIDGE},
+    {I_VCMPEQ_USPD, 2, {XMMREG,RM_XMM|BITS128,0,0,0}, nasm_bytecodes+963, IF_AVX|IF_SANDYBRIDGE},
+    {I_VCMPEQ_USPD, 3, {YMMREG,YMMREG,RM_YMM|BITS256,0,0}, nasm_bytecodes+972, IF_AVX|IF_SANDYBRIDGE},
+    {I_VCMPEQ_USPD, 2, {YMMREG,RM_YMM|BITS256,0,0,0}, nasm_bytecodes+981, IF_AVX|IF_SANDYBRIDGE},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VCMPEQ_USPS[] = {
+    {I_VCMPEQ_USPS, 3, {XMMREG,XMMREG,RM_XMM|BITS128,0,0}, nasm_bytecodes+2106, IF_AVX|IF_SANDYBRIDGE},
+    {I_VCMPEQ_USPS, 2, {XMMREG,RM_XMM|BITS128,0,0,0}, nasm_bytecodes+2115, IF_AVX|IF_SANDYBRIDGE},
+    {I_VCMPEQ_USPS, 3, {YMMREG,YMMREG,RM_YMM|BITS256,0,0}, nasm_bytecodes+2124, IF_AVX|IF_SANDYBRIDGE},
+    {I_VCMPEQ_USPS, 2, {YMMREG,RM_YMM|BITS256,0,0,0}, nasm_bytecodes+2133, IF_AVX|IF_SANDYBRIDGE},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VCMPEQ_USSD[] = {
+    {I_VCMPEQ_USSD, 3, {XMMREG,XMMREG,RM_XMM|BITS64,0,0}, nasm_bytecodes+2826, IF_AVX|IF_SANDYBRIDGE},
+    {I_VCMPEQ_USSD, 2, {XMMREG,RM_XMM|BITS64,0,0,0}, nasm_bytecodes+2835, IF_AVX|IF_SANDYBRIDGE},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VCMPEQ_USSS[] = {
+    {I_VCMPEQ_USSS, 3, {XMMREG,XMMREG,RM_XMM|BITS32,0,0}, nasm_bytecodes+3402, IF_AVX|IF_SANDYBRIDGE},
+    {I_VCMPEQ_USSS, 2, {XMMREG,RM_XMM|BITS32,0,0,0}, nasm_bytecodes+3411, IF_AVX|IF_SANDYBRIDGE},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VCMPFALSEPD[] = {
+    {I_VCMPFALSEPD, 3, {XMMREG,XMMREG,RM_XMM|BITS128,0,0}, nasm_bytecodes+486, IF_AVX|IF_SANDYBRIDGE},
+    {I_VCMPFALSEPD, 2, {XMMREG,RM_XMM|BITS128,0,0,0}, nasm_bytecodes+495, IF_AVX|IF_SANDYBRIDGE},
+    {I_VCMPFALSEPD, 3, {YMMREG,YMMREG,RM_YMM|BITS256,0,0}, nasm_bytecodes+504, IF_AVX|IF_SANDYBRIDGE},
+    {I_VCMPFALSEPD, 2, {YMMREG,RM_YMM|BITS256,0,0,0}, nasm_bytecodes+513, IF_AVX|IF_SANDYBRIDGE},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VCMPFALSEPS[] = {
+    {I_VCMPFALSEPS, 3, {XMMREG,XMMREG,RM_XMM|BITS128,0,0}, nasm_bytecodes+1638, IF_AVX|IF_SANDYBRIDGE},
+    {I_VCMPFALSEPS, 2, {XMMREG,RM_XMM|BITS128,0,0,0}, nasm_bytecodes+1647, IF_AVX|IF_SANDYBRIDGE},
+    {I_VCMPFALSEPS, 3, {YMMREG,YMMREG,RM_YMM|BITS256,0,0}, nasm_bytecodes+1656, IF_AVX|IF_SANDYBRIDGE},
+    {I_VCMPFALSEPS, 2, {YMMREG,RM_YMM|BITS256,0,0,0}, nasm_bytecodes+1665, IF_AVX|IF_SANDYBRIDGE},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VCMPFALSESD[] = {
+    {I_VCMPFALSESD, 3, {XMMREG,XMMREG,RM_XMM|BITS64,0,0}, nasm_bytecodes+2592, IF_AVX|IF_SANDYBRIDGE},
+    {I_VCMPFALSESD, 2, {XMMREG,RM_XMM|BITS64,0,0,0}, nasm_bytecodes+2601, IF_AVX|IF_SANDYBRIDGE},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VCMPFALSESS[] = {
+    {I_VCMPFALSESS, 3, {XMMREG,XMMREG,RM_XMM|BITS32,0,0}, nasm_bytecodes+3168, IF_AVX|IF_SANDYBRIDGE},
+    {I_VCMPFALSESS, 2, {XMMREG,RM_XMM|BITS32,0,0,0}, nasm_bytecodes+3177, IF_AVX|IF_SANDYBRIDGE},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VCMPFALSE_OSPD[] = {
+    {I_VCMPFALSE_OSPD, 3, {XMMREG,XMMREG,RM_XMM|BITS128,0,0}, nasm_bytecodes+1062, IF_AVX|IF_SANDYBRIDGE},
+    {I_VCMPFALSE_OSPD, 2, {XMMREG,RM_XMM|BITS128,0,0,0}, nasm_bytecodes+1071, IF_AVX|IF_SANDYBRIDGE},
+    {I_VCMPFALSE_OSPD, 3, {YMMREG,YMMREG,RM_YMM|BITS256,0,0}, nasm_bytecodes+1080, IF_AVX|IF_SANDYBRIDGE},
+    {I_VCMPFALSE_OSPD, 2, {YMMREG,RM_YMM|BITS256,0,0,0}, nasm_bytecodes+1089, IF_AVX|IF_SANDYBRIDGE},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VCMPFALSE_OSPS[] = {
+    {I_VCMPFALSE_OSPS, 3, {XMMREG,XMMREG,RM_XMM|BITS128,0,0}, nasm_bytecodes+2214, IF_AVX|IF_SANDYBRIDGE},
+    {I_VCMPFALSE_OSPS, 2, {XMMREG,RM_XMM|BITS128,0,0,0}, nasm_bytecodes+2223, IF_AVX|IF_SANDYBRIDGE},
+    {I_VCMPFALSE_OSPS, 3, {YMMREG,YMMREG,RM_YMM|BITS256,0,0}, nasm_bytecodes+2232, IF_AVX|IF_SANDYBRIDGE},
+    {I_VCMPFALSE_OSPS, 2, {YMMREG,RM_YMM|BITS256,0,0,0}, nasm_bytecodes+2241, IF_AVX|IF_SANDYBRIDGE},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VCMPFALSE_OSSD[] = {
+    {I_VCMPFALSE_OSSD, 3, {XMMREG,XMMREG,RM_XMM|BITS64,0,0}, nasm_bytecodes+2880, IF_AVX|IF_SANDYBRIDGE},
+    {I_VCMPFALSE_OSSD, 2, {XMMREG,RM_XMM|BITS64,0,0,0}, nasm_bytecodes+2889, IF_AVX|IF_SANDYBRIDGE},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VCMPFALSE_OSSS[] = {
+    {I_VCMPFALSE_OSSS, 3, {XMMREG,XMMREG,RM_XMM|BITS32,0,0}, nasm_bytecodes+3456, IF_AVX|IF_SANDYBRIDGE},
+    {I_VCMPFALSE_OSSS, 2, {XMMREG,RM_XMM|BITS32,0,0,0}, nasm_bytecodes+3465, IF_AVX|IF_SANDYBRIDGE},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VCMPGEPD[] = {
+    {I_VCMPGEPD, 3, {XMMREG,XMMREG,RM_XMM|BITS128,0,0}, nasm_bytecodes+558, IF_AVX|IF_SANDYBRIDGE},
+    {I_VCMPGEPD, 2, {XMMREG,RM_XMM|BITS128,0,0,0}, nasm_bytecodes+567, IF_AVX|IF_SANDYBRIDGE},
+    {I_VCMPGEPD, 3, {YMMREG,YMMREG,RM_YMM|BITS256,0,0}, nasm_bytecodes+576, IF_AVX|IF_SANDYBRIDGE},
+    {I_VCMPGEPD, 2, {YMMREG,RM_YMM|BITS256,0,0,0}, nasm_bytecodes+585, IF_AVX|IF_SANDYBRIDGE},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VCMPGEPS[] = {
+    {I_VCMPGEPS, 3, {XMMREG,XMMREG,RM_XMM|BITS128,0,0}, nasm_bytecodes+1710, IF_AVX|IF_SANDYBRIDGE},
+    {I_VCMPGEPS, 2, {XMMREG,RM_XMM|BITS128,0,0,0}, nasm_bytecodes+1719, IF_AVX|IF_SANDYBRIDGE},
+    {I_VCMPGEPS, 3, {YMMREG,YMMREG,RM_YMM|BITS256,0,0}, nasm_bytecodes+1728, IF_AVX|IF_SANDYBRIDGE},
+    {I_VCMPGEPS, 2, {YMMREG,RM_YMM|BITS256,0,0,0}, nasm_bytecodes+1737, IF_AVX|IF_SANDYBRIDGE},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VCMPGESD[] = {
+    {I_VCMPGESD, 3, {XMMREG,XMMREG,RM_XMM|BITS64,0,0}, nasm_bytecodes+2628, IF_AVX|IF_SANDYBRIDGE},
+    {I_VCMPGESD, 2, {XMMREG,RM_XMM|BITS64,0,0,0}, nasm_bytecodes+2637, IF_AVX|IF_SANDYBRIDGE},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VCMPGESS[] = {
+    {I_VCMPGESS, 3, {XMMREG,XMMREG,RM_XMM|BITS32,0,0}, nasm_bytecodes+3204, IF_AVX|IF_SANDYBRIDGE},
+    {I_VCMPGESS, 2, {XMMREG,RM_XMM|BITS32,0,0,0}, nasm_bytecodes+3213, IF_AVX|IF_SANDYBRIDGE},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VCMPGE_OQPD[] = {
+    {I_VCMPGE_OQPD, 3, {XMMREG,XMMREG,RM_XMM|BITS128,0,0}, nasm_bytecodes+1134, IF_AVX|IF_SANDYBRIDGE},
+    {I_VCMPGE_OQPD, 2, {XMMREG,RM_XMM|BITS128,0,0,0}, nasm_bytecodes+1143, IF_AVX|IF_SANDYBRIDGE},
+    {I_VCMPGE_OQPD, 3, {YMMREG,YMMREG,RM_YMM|BITS256,0,0}, nasm_bytecodes+1152, IF_AVX|IF_SANDYBRIDGE},
+    {I_VCMPGE_OQPD, 2, {YMMREG,RM_YMM|BITS256,0,0,0}, nasm_bytecodes+1161, IF_AVX|IF_SANDYBRIDGE},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VCMPGE_OQPS[] = {
+    {I_VCMPGE_OQPS, 3, {XMMREG,XMMREG,RM_XMM|BITS128,0,0}, nasm_bytecodes+2286, IF_AVX|IF_SANDYBRIDGE},
+    {I_VCMPGE_OQPS, 2, {XMMREG,RM_XMM|BITS128,0,0,0}, nasm_bytecodes+2295, IF_AVX|IF_SANDYBRIDGE},
+    {I_VCMPGE_OQPS, 3, {YMMREG,YMMREG,RM_YMM|BITS256,0,0}, nasm_bytecodes+2304, IF_AVX|IF_SANDYBRIDGE},
+    {I_VCMPGE_OQPS, 2, {YMMREG,RM_YMM|BITS256,0,0,0}, nasm_bytecodes+2313, IF_AVX|IF_SANDYBRIDGE},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VCMPGE_OQSD[] = {
+    {I_VCMPGE_OQSD, 3, {XMMREG,XMMREG,RM_XMM|BITS64,0,0}, nasm_bytecodes+2916, IF_AVX|IF_SANDYBRIDGE},
+    {I_VCMPGE_OQSD, 2, {XMMREG,RM_XMM|BITS64,0,0,0}, nasm_bytecodes+2925, IF_AVX|IF_SANDYBRIDGE},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VCMPGE_OQSS[] = {
+    {I_VCMPGE_OQSS, 3, {XMMREG,XMMREG,RM_XMM|BITS32,0,0}, nasm_bytecodes+3492, IF_AVX|IF_SANDYBRIDGE},
+    {I_VCMPGE_OQSS, 2, {XMMREG,RM_XMM|BITS32,0,0,0}, nasm_bytecodes+3501, IF_AVX|IF_SANDYBRIDGE},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VCMPGTPD[] = {
+    {I_VCMPGTPD, 3, {XMMREG,XMMREG,RM_XMM|BITS128,0,0}, nasm_bytecodes+594, IF_AVX|IF_SANDYBRIDGE},
+    {I_VCMPGTPD, 2, {XMMREG,RM_XMM|BITS128,0,0,0}, nasm_bytecodes+603, IF_AVX|IF_SANDYBRIDGE},
+    {I_VCMPGTPD, 3, {YMMREG,YMMREG,RM_YMM|BITS256,0,0}, nasm_bytecodes+612, IF_AVX|IF_SANDYBRIDGE},
+    {I_VCMPGTPD, 2, {YMMREG,RM_YMM|BITS256,0,0,0}, nasm_bytecodes+621, IF_AVX|IF_SANDYBRIDGE},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VCMPGTPS[] = {
+    {I_VCMPGTPS, 3, {XMMREG,XMMREG,RM_XMM|BITS128,0,0}, nasm_bytecodes+1746, IF_AVX|IF_SANDYBRIDGE},
+    {I_VCMPGTPS, 2, {XMMREG,RM_XMM|BITS128,0,0,0}, nasm_bytecodes+1755, IF_AVX|IF_SANDYBRIDGE},
+    {I_VCMPGTPS, 3, {YMMREG,YMMREG,RM_YMM|BITS256,0,0}, nasm_bytecodes+1764, IF_AVX|IF_SANDYBRIDGE},
+    {I_VCMPGTPS, 2, {YMMREG,RM_YMM|BITS256,0,0,0}, nasm_bytecodes+1773, IF_AVX|IF_SANDYBRIDGE},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VCMPGTSD[] = {
+    {I_VCMPGTSD, 3, {XMMREG,XMMREG,RM_XMM|BITS64,0,0}, nasm_bytecodes+2646, IF_AVX|IF_SANDYBRIDGE},
+    {I_VCMPGTSD, 2, {XMMREG,RM_XMM|BITS64,0,0,0}, nasm_bytecodes+2655, IF_AVX|IF_SANDYBRIDGE},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VCMPGTSS[] = {
+    {I_VCMPGTSS, 3, {XMMREG,XMMREG,RM_XMM|BITS32,0,0}, nasm_bytecodes+3222, IF_AVX|IF_SANDYBRIDGE},
+    {I_VCMPGTSS, 2, {XMMREG,RM_XMM|BITS32,0,0,0}, nasm_bytecodes+3231, IF_AVX|IF_SANDYBRIDGE},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VCMPGT_OQPD[] = {
+    {I_VCMPGT_OQPD, 3, {XMMREG,XMMREG,RM_XMM|BITS128,0,0}, nasm_bytecodes+1170, IF_AVX|IF_SANDYBRIDGE},
+    {I_VCMPGT_OQPD, 2, {XMMREG,RM_XMM|BITS128,0,0,0}, nasm_bytecodes+1179, IF_AVX|IF_SANDYBRIDGE},
+    {I_VCMPGT_OQPD, 3, {YMMREG,YMMREG,RM_YMM|BITS256,0,0}, nasm_bytecodes+1188, IF_AVX|IF_SANDYBRIDGE},
+    {I_VCMPGT_OQPD, 2, {YMMREG,RM_YMM|BITS256,0,0,0}, nasm_bytecodes+1197, IF_AVX|IF_SANDYBRIDGE},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VCMPGT_OQPS[] = {
+    {I_VCMPGT_OQPS, 3, {XMMREG,XMMREG,RM_XMM|BITS128,0,0}, nasm_bytecodes+2322, IF_AVX|IF_SANDYBRIDGE},
+    {I_VCMPGT_OQPS, 2, {XMMREG,RM_XMM|BITS128,0,0,0}, nasm_bytecodes+2331, IF_AVX|IF_SANDYBRIDGE},
+    {I_VCMPGT_OQPS, 3, {YMMREG,YMMREG,RM_YMM|BITS256,0,0}, nasm_bytecodes+2340, IF_AVX|IF_SANDYBRIDGE},
+    {I_VCMPGT_OQPS, 2, {YMMREG,RM_YMM|BITS256,0,0,0}, nasm_bytecodes+2349, IF_AVX|IF_SANDYBRIDGE},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VCMPGT_OQSD[] = {
+    {I_VCMPGT_OQSD, 3, {XMMREG,XMMREG,RM_XMM|BITS64,0,0}, nasm_bytecodes+2934, IF_AVX|IF_SANDYBRIDGE},
+    {I_VCMPGT_OQSD, 2, {XMMREG,RM_XMM|BITS64,0,0,0}, nasm_bytecodes+2943, IF_AVX|IF_SANDYBRIDGE},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VCMPGT_OQSS[] = {
+    {I_VCMPGT_OQSS, 3, {XMMREG,XMMREG,RM_XMM|BITS32,0,0}, nasm_bytecodes+3510, IF_AVX|IF_SANDYBRIDGE},
+    {I_VCMPGT_OQSS, 2, {XMMREG,RM_XMM|BITS32,0,0,0}, nasm_bytecodes+3519, IF_AVX|IF_SANDYBRIDGE},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VCMPLEPD[] = {
+    {I_VCMPLEPD, 3, {XMMREG,XMMREG,RM_XMM|BITS128,0,0}, nasm_bytecodes+162, IF_AVX|IF_SANDYBRIDGE},
+    {I_VCMPLEPD, 2, {XMMREG,RM_XMM|BITS128,0,0,0}, nasm_bytecodes+171, IF_AVX|IF_SANDYBRIDGE},
+    {I_VCMPLEPD, 3, {YMMREG,YMMREG,RM_YMM|BITS256,0,0}, nasm_bytecodes+180, IF_AVX|IF_SANDYBRIDGE},
+    {I_VCMPLEPD, 2, {YMMREG,RM_YMM|BITS256,0,0,0}, nasm_bytecodes+189, IF_AVX|IF_SANDYBRIDGE},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VCMPLEPS[] = {
+    {I_VCMPLEPS, 3, {XMMREG,XMMREG,RM_XMM|BITS128,0,0}, nasm_bytecodes+1314, IF_AVX|IF_SANDYBRIDGE},
+    {I_VCMPLEPS, 2, {XMMREG,RM_XMM|BITS128,0,0,0}, nasm_bytecodes+1323, IF_AVX|IF_SANDYBRIDGE},
+    {I_VCMPLEPS, 3, {YMMREG,YMMREG,RM_YMM|BITS256,0,0}, nasm_bytecodes+1332, IF_AVX|IF_SANDYBRIDGE},
+    {I_VCMPLEPS, 2, {YMMREG,RM_YMM|BITS256,0,0,0}, nasm_bytecodes+1341, IF_AVX|IF_SANDYBRIDGE},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VCMPLESD[] = {
+    {I_VCMPLESD, 3, {XMMREG,XMMREG,RM_XMM|BITS64,0,0}, nasm_bytecodes+2430, IF_AVX|IF_SANDYBRIDGE},
+    {I_VCMPLESD, 2, {XMMREG,RM_XMM|BITS64,0,0,0}, nasm_bytecodes+2439, IF_AVX|IF_SANDYBRIDGE},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VCMPLESS[] = {
+    {I_VCMPLESS, 3, {XMMREG,XMMREG,RM_XMM|BITS32,0,0}, nasm_bytecodes+3006, IF_AVX|IF_SANDYBRIDGE},
+    {I_VCMPLESS, 2, {XMMREG,RM_XMM|BITS32,0,0,0}, nasm_bytecodes+3015, IF_AVX|IF_SANDYBRIDGE},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VCMPLE_OQPD[] = {
+    {I_VCMPLE_OQPD, 3, {XMMREG,XMMREG,RM_XMM|BITS128,0,0}, nasm_bytecodes+738, IF_AVX|IF_SANDYBRIDGE},
+    {I_VCMPLE_OQPD, 2, {XMMREG,RM_XMM|BITS128,0,0,0}, nasm_bytecodes+747, IF_AVX|IF_SANDYBRIDGE},
+    {I_VCMPLE_OQPD, 3, {YMMREG,YMMREG,RM_YMM|BITS256,0,0}, nasm_bytecodes+756, IF_AVX|IF_SANDYBRIDGE},
+    {I_VCMPLE_OQPD, 2, {YMMREG,RM_YMM|BITS256,0,0,0}, nasm_bytecodes+765, IF_AVX|IF_SANDYBRIDGE},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VCMPLE_OQPS[] = {
+    {I_VCMPLE_OQPS, 3, {XMMREG,XMMREG,RM_XMM|BITS128,0,0}, nasm_bytecodes+1890, IF_AVX|IF_SANDYBRIDGE},
+    {I_VCMPLE_OQPS, 2, {XMMREG,RM_XMM|BITS128,0,0,0}, nasm_bytecodes+1899, IF_AVX|IF_SANDYBRIDGE},
+    {I_VCMPLE_OQPS, 3, {YMMREG,YMMREG,RM_YMM|BITS256,0,0}, nasm_bytecodes+1908, IF_AVX|IF_SANDYBRIDGE},
+    {I_VCMPLE_OQPS, 2, {YMMREG,RM_YMM|BITS256,0,0,0}, nasm_bytecodes+1917, IF_AVX|IF_SANDYBRIDGE},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VCMPLE_OQSD[] = {
+    {I_VCMPLE_OQSD, 3, {XMMREG,XMMREG,RM_XMM|BITS64,0,0}, nasm_bytecodes+2718, IF_AVX|IF_SANDYBRIDGE},
+    {I_VCMPLE_OQSD, 2, {XMMREG,RM_XMM|BITS64,0,0,0}, nasm_bytecodes+2727, IF_AVX|IF_SANDYBRIDGE},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VCMPLE_OQSS[] = {
+    {I_VCMPLE_OQSS, 3, {XMMREG,XMMREG,RM_XMM|BITS32,0,0}, nasm_bytecodes+3294, IF_AVX|IF_SANDYBRIDGE},
+    {I_VCMPLE_OQSS, 2, {XMMREG,RM_XMM|BITS32,0,0,0}, nasm_bytecodes+3303, IF_AVX|IF_SANDYBRIDGE},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VCMPLTPD[] = {
+    {I_VCMPLTPD, 3, {XMMREG,XMMREG,RM_XMM|BITS128,0,0}, nasm_bytecodes+126, IF_AVX|IF_SANDYBRIDGE},
+    {I_VCMPLTPD, 2, {XMMREG,RM_XMM|BITS128,0,0,0}, nasm_bytecodes+135, IF_AVX|IF_SANDYBRIDGE},
+    {I_VCMPLTPD, 3, {YMMREG,YMMREG,RM_YMM|BITS256,0,0}, nasm_bytecodes+144, IF_AVX|IF_SANDYBRIDGE},
+    {I_VCMPLTPD, 2, {YMMREG,RM_YMM|BITS256,0,0,0}, nasm_bytecodes+153, IF_AVX|IF_SANDYBRIDGE},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VCMPLTPS[] = {
+    {I_VCMPLTPS, 3, {XMMREG,XMMREG,RM_XMM|BITS128,0,0}, nasm_bytecodes+1278, IF_AVX|IF_SANDYBRIDGE},
+    {I_VCMPLTPS, 2, {XMMREG,RM_XMM|BITS128,0,0,0}, nasm_bytecodes+1287, IF_AVX|IF_SANDYBRIDGE},
+    {I_VCMPLTPS, 3, {YMMREG,YMMREG,RM_YMM|BITS256,0,0}, nasm_bytecodes+1296, IF_AVX|IF_SANDYBRIDGE},
+    {I_VCMPLTPS, 2, {YMMREG,RM_YMM|BITS256,0,0,0}, nasm_bytecodes+1305, IF_AVX|IF_SANDYBRIDGE},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VCMPLTSD[] = {
+    {I_VCMPLTSD, 3, {XMMREG,XMMREG,RM_XMM|BITS64,0,0}, nasm_bytecodes+2412, IF_AVX|IF_SANDYBRIDGE},
+    {I_VCMPLTSD, 2, {XMMREG,RM_XMM|BITS64,0,0,0}, nasm_bytecodes+2421, IF_AVX|IF_SANDYBRIDGE},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VCMPLTSS[] = {
+    {I_VCMPLTSS, 3, {XMMREG,XMMREG,RM_XMM|BITS32,0,0}, nasm_bytecodes+2988, IF_AVX|IF_SANDYBRIDGE},
+    {I_VCMPLTSS, 2, {XMMREG,RM_XMM|BITS32,0,0,0}, nasm_bytecodes+2997, IF_AVX|IF_SANDYBRIDGE},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VCMPLT_OQPD[] = {
+    {I_VCMPLT_OQPD, 3, {XMMREG,XMMREG,RM_XMM|BITS128,0,0}, nasm_bytecodes+702, IF_AVX|IF_SANDYBRIDGE},
+    {I_VCMPLT_OQPD, 2, {XMMREG,RM_XMM|BITS128,0,0,0}, nasm_bytecodes+711, IF_AVX|IF_SANDYBRIDGE},
+    {I_VCMPLT_OQPD, 3, {YMMREG,YMMREG,RM_YMM|BITS256,0,0}, nasm_bytecodes+720, IF_AVX|IF_SANDYBRIDGE},
+    {I_VCMPLT_OQPD, 2, {YMMREG,RM_YMM|BITS256,0,0,0}, nasm_bytecodes+729, IF_AVX|IF_SANDYBRIDGE},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VCMPLT_OQPS[] = {
+    {I_VCMPLT_OQPS, 3, {XMMREG,XMMREG,RM_XMM|BITS128,0,0}, nasm_bytecodes+1854, IF_AVX|IF_SANDYBRIDGE},
+    {I_VCMPLT_OQPS, 2, {XMMREG,RM_XMM|BITS128,0,0,0}, nasm_bytecodes+1863, IF_AVX|IF_SANDYBRIDGE},
+    {I_VCMPLT_OQPS, 3, {YMMREG,YMMREG,RM_YMM|BITS256,0,0}, nasm_bytecodes+1872, IF_AVX|IF_SANDYBRIDGE},
+    {I_VCMPLT_OQPS, 2, {YMMREG,RM_YMM|BITS256,0,0,0}, nasm_bytecodes+1881, IF_AVX|IF_SANDYBRIDGE},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VCMPLT_OQSD[] = {
+    {I_VCMPLT_OQSD, 3, {XMMREG,XMMREG,RM_XMM|BITS64,0,0}, nasm_bytecodes+2700, IF_AVX|IF_SANDYBRIDGE},
+    {I_VCMPLT_OQSD, 2, {XMMREG,RM_XMM|BITS64,0,0,0}, nasm_bytecodes+2709, IF_AVX|IF_SANDYBRIDGE},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VCMPLT_OQSS[] = {
+    {I_VCMPLT_OQSS, 3, {XMMREG,XMMREG,RM_XMM|BITS32,0,0}, nasm_bytecodes+3276, IF_AVX|IF_SANDYBRIDGE},
+    {I_VCMPLT_OQSS, 2, {XMMREG,RM_XMM|BITS32,0,0,0}, nasm_bytecodes+3285, IF_AVX|IF_SANDYBRIDGE},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VCMPNEQPD[] = {
+    {I_VCMPNEQPD, 3, {XMMREG,XMMREG,RM_XMM|BITS128,0,0}, nasm_bytecodes+234, IF_AVX|IF_SANDYBRIDGE},
+    {I_VCMPNEQPD, 2, {XMMREG,RM_XMM|BITS128,0,0,0}, nasm_bytecodes+243, IF_AVX|IF_SANDYBRIDGE},
+    {I_VCMPNEQPD, 3, {YMMREG,YMMREG,RM_YMM|BITS256,0,0}, nasm_bytecodes+252, IF_AVX|IF_SANDYBRIDGE},
+    {I_VCMPNEQPD, 2, {YMMREG,RM_YMM|BITS256,0,0,0}, nasm_bytecodes+261, IF_AVX|IF_SANDYBRIDGE},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VCMPNEQPS[] = {
+    {I_VCMPNEQPS, 3, {XMMREG,XMMREG,RM_XMM|BITS128,0,0}, nasm_bytecodes+1386, IF_AVX|IF_SANDYBRIDGE},
+    {I_VCMPNEQPS, 2, {XMMREG,RM_XMM|BITS128,0,0,0}, nasm_bytecodes+1395, IF_AVX|IF_SANDYBRIDGE},
+    {I_VCMPNEQPS, 3, {YMMREG,YMMREG,RM_YMM|BITS256,0,0}, nasm_bytecodes+1404, IF_AVX|IF_SANDYBRIDGE},
+    {I_VCMPNEQPS, 2, {YMMREG,RM_YMM|BITS256,0,0,0}, nasm_bytecodes+1413, IF_AVX|IF_SANDYBRIDGE},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VCMPNEQSD[] = {
+    {I_VCMPNEQSD, 3, {XMMREG,XMMREG,RM_XMM|BITS64,0,0}, nasm_bytecodes+2466, IF_AVX|IF_SANDYBRIDGE},
+    {I_VCMPNEQSD, 2, {XMMREG,RM_XMM|BITS64,0,0,0}, nasm_bytecodes+2475, IF_AVX|IF_SANDYBRIDGE},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VCMPNEQSS[] = {
+    {I_VCMPNEQSS, 3, {XMMREG,XMMREG,RM_XMM|BITS32,0,0}, nasm_bytecodes+3042, IF_AVX|IF_SANDYBRIDGE},
+    {I_VCMPNEQSS, 2, {XMMREG,RM_XMM|BITS32,0,0,0}, nasm_bytecodes+3051, IF_AVX|IF_SANDYBRIDGE},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VCMPNEQ_OQPD[] = {
+    {I_VCMPNEQ_OQPD, 3, {XMMREG,XMMREG,RM_XMM|BITS128,0,0}, nasm_bytecodes+522, IF_AVX|IF_SANDYBRIDGE},
+    {I_VCMPNEQ_OQPD, 2, {XMMREG,RM_XMM|BITS128,0,0,0}, nasm_bytecodes+531, IF_AVX|IF_SANDYBRIDGE},
+    {I_VCMPNEQ_OQPD, 3, {YMMREG,YMMREG,RM_YMM|BITS256,0,0}, nasm_bytecodes+540, IF_AVX|IF_SANDYBRIDGE},
+    {I_VCMPNEQ_OQPD, 2, {YMMREG,RM_YMM|BITS256,0,0,0}, nasm_bytecodes+549, IF_AVX|IF_SANDYBRIDGE},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VCMPNEQ_OQPS[] = {
+    {I_VCMPNEQ_OQPS, 3, {XMMREG,XMMREG,RM_XMM|BITS128,0,0}, nasm_bytecodes+1674, IF_AVX|IF_SANDYBRIDGE},
+    {I_VCMPNEQ_OQPS, 2, {XMMREG,RM_XMM|BITS128,0,0,0}, nasm_bytecodes+1683, IF_AVX|IF_SANDYBRIDGE},
+    {I_VCMPNEQ_OQPS, 3, {YMMREG,YMMREG,RM_YMM|BITS256,0,0}, nasm_bytecodes+1692, IF_AVX|IF_SANDYBRIDGE},
+    {I_VCMPNEQ_OQPS, 2, {YMMREG,RM_YMM|BITS256,0,0,0}, nasm_bytecodes+1701, IF_AVX|IF_SANDYBRIDGE},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VCMPNEQ_OQSD[] = {
+    {I_VCMPNEQ_OQSD, 3, {XMMREG,XMMREG,RM_XMM|BITS64,0,0}, nasm_bytecodes+2610, IF_AVX|IF_SANDYBRIDGE},
+    {I_VCMPNEQ_OQSD, 2, {XMMREG,RM_XMM|BITS64,0,0,0}, nasm_bytecodes+2619, IF_AVX|IF_SANDYBRIDGE},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VCMPNEQ_OQSS[] = {
+    {I_VCMPNEQ_OQSS, 3, {XMMREG,XMMREG,RM_XMM|BITS32,0,0}, nasm_bytecodes+3186, IF_AVX|IF_SANDYBRIDGE},
+    {I_VCMPNEQ_OQSS, 2, {XMMREG,RM_XMM|BITS32,0,0,0}, nasm_bytecodes+3195, IF_AVX|IF_SANDYBRIDGE},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VCMPNEQ_OSPD[] = {
+    {I_VCMPNEQ_OSPD, 3, {XMMREG,XMMREG,RM_XMM|BITS128,0,0}, nasm_bytecodes+1098, IF_AVX|IF_SANDYBRIDGE},
+    {I_VCMPNEQ_OSPD, 2, {XMMREG,RM_XMM|BITS128,0,0,0}, nasm_bytecodes+1107, IF_AVX|IF_SANDYBRIDGE},
+    {I_VCMPNEQ_OSPD, 3, {YMMREG,YMMREG,RM_YMM|BITS256,0,0}, nasm_bytecodes+1116, IF_AVX|IF_SANDYBRIDGE},
+    {I_VCMPNEQ_OSPD, 2, {YMMREG,RM_YMM|BITS256,0,0,0}, nasm_bytecodes+1125, IF_AVX|IF_SANDYBRIDGE},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VCMPNEQ_OSPS[] = {
+    {I_VCMPNEQ_OSPS, 3, {XMMREG,XMMREG,RM_XMM|BITS128,0,0}, nasm_bytecodes+2250, IF_AVX|IF_SANDYBRIDGE},
+    {I_VCMPNEQ_OSPS, 2, {XMMREG,RM_XMM|BITS128,0,0,0}, nasm_bytecodes+2259, IF_AVX|IF_SANDYBRIDGE},
+    {I_VCMPNEQ_OSPS, 3, {YMMREG,YMMREG,RM_YMM|BITS256,0,0}, nasm_bytecodes+2268, IF_AVX|IF_SANDYBRIDGE},
+    {I_VCMPNEQ_OSPS, 2, {YMMREG,RM_YMM|BITS256,0,0,0}, nasm_bytecodes+2277, IF_AVX|IF_SANDYBRIDGE},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VCMPNEQ_OSSD[] = {
+    {I_VCMPNEQ_OSSD, 3, {XMMREG,XMMREG,RM_XMM|BITS64,0,0}, nasm_bytecodes+2898, IF_AVX|IF_SANDYBRIDGE},
+    {I_VCMPNEQ_OSSD, 2, {XMMREG,RM_XMM|BITS64,0,0,0}, nasm_bytecodes+2907, IF_AVX|IF_SANDYBRIDGE},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VCMPNEQ_OSSS[] = {
+    {I_VCMPNEQ_OSSS, 3, {XMMREG,XMMREG,RM_XMM|BITS32,0,0}, nasm_bytecodes+3474, IF_AVX|IF_SANDYBRIDGE},
+    {I_VCMPNEQ_OSSS, 2, {XMMREG,RM_XMM|BITS32,0,0,0}, nasm_bytecodes+3483, IF_AVX|IF_SANDYBRIDGE},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VCMPNEQ_USPD[] = {
+    {I_VCMPNEQ_USPD, 3, {XMMREG,XMMREG,RM_XMM|BITS128,0,0}, nasm_bytecodes+810, IF_AVX|IF_SANDYBRIDGE},
+    {I_VCMPNEQ_USPD, 2, {XMMREG,RM_XMM|BITS128,0,0,0}, nasm_bytecodes+819, IF_AVX|IF_SANDYBRIDGE},
+    {I_VCMPNEQ_USPD, 3, {YMMREG,YMMREG,RM_YMM|BITS256,0,0}, nasm_bytecodes+828, IF_AVX|IF_SANDYBRIDGE},
+    {I_VCMPNEQ_USPD, 2, {YMMREG,RM_YMM|BITS256,0,0,0}, nasm_bytecodes+837, IF_AVX|IF_SANDYBRIDGE},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VCMPNEQ_USPS[] = {
+    {I_VCMPNEQ_USPS, 3, {XMMREG,XMMREG,RM_XMM|BITS128,0,0}, nasm_bytecodes+1962, IF_AVX|IF_SANDYBRIDGE},
+    {I_VCMPNEQ_USPS, 2, {XMMREG,RM_XMM|BITS128,0,0,0}, nasm_bytecodes+1971, IF_AVX|IF_SANDYBRIDGE},
+    {I_VCMPNEQ_USPS, 3, {YMMREG,YMMREG,RM_YMM|BITS256,0,0}, nasm_bytecodes+1980, IF_AVX|IF_SANDYBRIDGE},
+    {I_VCMPNEQ_USPS, 2, {YMMREG,RM_YMM|BITS256,0,0,0}, nasm_bytecodes+1989, IF_AVX|IF_SANDYBRIDGE},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VCMPNEQ_USSD[] = {
+    {I_VCMPNEQ_USSD, 3, {XMMREG,XMMREG,RM_XMM|BITS64,0,0}, nasm_bytecodes+2754, IF_AVX|IF_SANDYBRIDGE},
+    {I_VCMPNEQ_USSD, 2, {XMMREG,RM_XMM|BITS64,0,0,0}, nasm_bytecodes+2763, IF_AVX|IF_SANDYBRIDGE},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VCMPNEQ_USSS[] = {
+    {I_VCMPNEQ_USSS, 3, {XMMREG,XMMREG,RM_XMM|BITS32,0,0}, nasm_bytecodes+3330, IF_AVX|IF_SANDYBRIDGE},
+    {I_VCMPNEQ_USSS, 2, {XMMREG,RM_XMM|BITS32,0,0,0}, nasm_bytecodes+3339, IF_AVX|IF_SANDYBRIDGE},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VCMPNGEPD[] = {
+    {I_VCMPNGEPD, 3, {XMMREG,XMMREG,RM_XMM|BITS128,0,0}, nasm_bytecodes+414, IF_AVX|IF_SANDYBRIDGE},
+    {I_VCMPNGEPD, 2, {XMMREG,RM_XMM|BITS128,0,0,0}, nasm_bytecodes+423, IF_AVX|IF_SANDYBRIDGE},
+    {I_VCMPNGEPD, 3, {YMMREG,YMMREG,RM_YMM|BITS256,0,0}, nasm_bytecodes+432, IF_AVX|IF_SANDYBRIDGE},
+    {I_VCMPNGEPD, 2, {YMMREG,RM_YMM|BITS256,0,0,0}, nasm_bytecodes+441, IF_AVX|IF_SANDYBRIDGE},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VCMPNGEPS[] = {
+    {I_VCMPNGEPS, 3, {XMMREG,XMMREG,RM_XMM|BITS128,0,0}, nasm_bytecodes+1566, IF_AVX|IF_SANDYBRIDGE},
+    {I_VCMPNGEPS, 2, {XMMREG,RM_XMM|BITS128,0,0,0}, nasm_bytecodes+1575, IF_AVX|IF_SANDYBRIDGE},
+    {I_VCMPNGEPS, 3, {YMMREG,YMMREG,RM_YMM|BITS256,0,0}, nasm_bytecodes+1584, IF_AVX|IF_SANDYBRIDGE},
+    {I_VCMPNGEPS, 2, {YMMREG,RM_YMM|BITS256,0,0,0}, nasm_bytecodes+1593, IF_AVX|IF_SANDYBRIDGE},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VCMPNGESD[] = {
+    {I_VCMPNGESD, 3, {XMMREG,XMMREG,RM_XMM|BITS64,0,0}, nasm_bytecodes+2556, IF_AVX|IF_SANDYBRIDGE},
+    {I_VCMPNGESD, 2, {XMMREG,RM_XMM|BITS64,0,0,0}, nasm_bytecodes+2565, IF_AVX|IF_SANDYBRIDGE},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VCMPNGESS[] = {
+    {I_VCMPNGESS, 3, {XMMREG,XMMREG,RM_XMM|BITS32,0,0}, nasm_bytecodes+3132, IF_AVX|IF_SANDYBRIDGE},
+    {I_VCMPNGESS, 2, {XMMREG,RM_XMM|BITS32,0,0,0}, nasm_bytecodes+3141, IF_AVX|IF_SANDYBRIDGE},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VCMPNGE_UQPD[] = {
+    {I_VCMPNGE_UQPD, 3, {XMMREG,XMMREG,RM_XMM|BITS128,0,0}, nasm_bytecodes+990, IF_AVX|IF_SANDYBRIDGE},
+    {I_VCMPNGE_UQPD, 2, {XMMREG,RM_XMM|BITS128,0,0,0}, nasm_bytecodes+999, IF_AVX|IF_SANDYBRIDGE},
+    {I_VCMPNGE_UQPD, 3, {YMMREG,YMMREG,RM_YMM|BITS256,0,0}, nasm_bytecodes+1008, IF_AVX|IF_SANDYBRIDGE},
+    {I_VCMPNGE_UQPD, 2, {YMMREG,RM_YMM|BITS256,0,0,0}, nasm_bytecodes+1017, IF_AVX|IF_SANDYBRIDGE},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VCMPNGE_UQPS[] = {
+    {I_VCMPNGE_UQPS, 3, {XMMREG,XMMREG,RM_XMM|BITS128,0,0}, nasm_bytecodes+2142, IF_AVX|IF_SANDYBRIDGE},
+    {I_VCMPNGE_UQPS, 2, {XMMREG,RM_XMM|BITS128,0,0,0}, nasm_bytecodes+2151, IF_AVX|IF_SANDYBRIDGE},
+    {I_VCMPNGE_UQPS, 3, {YMMREG,YMMREG,RM_YMM|BITS256,0,0}, nasm_bytecodes+2160, IF_AVX|IF_SANDYBRIDGE},
+    {I_VCMPNGE_UQPS, 2, {YMMREG,RM_YMM|BITS256,0,0,0}, nasm_bytecodes+2169, IF_AVX|IF_SANDYBRIDGE},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VCMPNGE_UQSD[] = {
+    {I_VCMPNGE_UQSD, 3, {XMMREG,XMMREG,RM_XMM|BITS64,0,0}, nasm_bytecodes+2844, IF_AVX|IF_SANDYBRIDGE},
+    {I_VCMPNGE_UQSD, 2, {XMMREG,RM_XMM|BITS64,0,0,0}, nasm_bytecodes+2853, IF_AVX|IF_SANDYBRIDGE},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VCMPNGE_UQSS[] = {
+    {I_VCMPNGE_UQSS, 3, {XMMREG,XMMREG,RM_XMM|BITS32,0,0}, nasm_bytecodes+3420, IF_AVX|IF_SANDYBRIDGE},
+    {I_VCMPNGE_UQSS, 2, {XMMREG,RM_XMM|BITS32,0,0,0}, nasm_bytecodes+3429, IF_AVX|IF_SANDYBRIDGE},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VCMPNGTPD[] = {
+    {I_VCMPNGTPD, 3, {XMMREG,XMMREG,RM_XMM|BITS128,0,0}, nasm_bytecodes+450, IF_AVX|IF_SANDYBRIDGE},
+    {I_VCMPNGTPD, 2, {XMMREG,RM_XMM|BITS128,0,0,0}, nasm_bytecodes+459, IF_AVX|IF_SANDYBRIDGE},
+    {I_VCMPNGTPD, 3, {YMMREG,YMMREG,RM_YMM|BITS256,0,0}, nasm_bytecodes+468, IF_AVX|IF_SANDYBRIDGE},
+    {I_VCMPNGTPD, 2, {YMMREG,RM_YMM|BITS256,0,0,0}, nasm_bytecodes+477, IF_AVX|IF_SANDYBRIDGE},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VCMPNGTPS[] = {
+    {I_VCMPNGTPS, 3, {XMMREG,XMMREG,RM_XMM|BITS128,0,0}, nasm_bytecodes+1602, IF_AVX|IF_SANDYBRIDGE},
+    {I_VCMPNGTPS, 2, {XMMREG,RM_XMM|BITS128,0,0,0}, nasm_bytecodes+1611, IF_AVX|IF_SANDYBRIDGE},
+    {I_VCMPNGTPS, 3, {YMMREG,YMMREG,RM_YMM|BITS256,0,0}, nasm_bytecodes+1620, IF_AVX|IF_SANDYBRIDGE},
+    {I_VCMPNGTPS, 2, {YMMREG,RM_YMM|BITS256,0,0,0}, nasm_bytecodes+1629, IF_AVX|IF_SANDYBRIDGE},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VCMPNGTSD[] = {
+    {I_VCMPNGTSD, 3, {XMMREG,XMMREG,RM_XMM|BITS64,0,0}, nasm_bytecodes+2574, IF_AVX|IF_SANDYBRIDGE},
+    {I_VCMPNGTSD, 2, {XMMREG,RM_XMM|BITS64,0,0,0}, nasm_bytecodes+2583, IF_AVX|IF_SANDYBRIDGE},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VCMPNGTSS[] = {
+    {I_VCMPNGTSS, 3, {XMMREG,XMMREG,RM_XMM|BITS32,0,0}, nasm_bytecodes+3150, IF_AVX|IF_SANDYBRIDGE},
+    {I_VCMPNGTSS, 2, {XMMREG,RM_XMM|BITS32,0,0,0}, nasm_bytecodes+3159, IF_AVX|IF_SANDYBRIDGE},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VCMPNGT_UQPD[] = {
+    {I_VCMPNGT_UQPD, 3, {XMMREG,XMMREG,RM_XMM|BITS128,0,0}, nasm_bytecodes+1026, IF_AVX|IF_SANDYBRIDGE},
+    {I_VCMPNGT_UQPD, 2, {XMMREG,RM_XMM|BITS128,0,0,0}, nasm_bytecodes+1035, IF_AVX|IF_SANDYBRIDGE},
+    {I_VCMPNGT_UQPD, 3, {YMMREG,YMMREG,RM_YMM|BITS256,0,0}, nasm_bytecodes+1044, IF_AVX|IF_SANDYBRIDGE},
+    {I_VCMPNGT_UQPD, 2, {YMMREG,RM_YMM|BITS256,0,0,0}, nasm_bytecodes+1053, IF_AVX|IF_SANDYBRIDGE},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VCMPNGT_UQPS[] = {
+    {I_VCMPNGT_UQPS, 3, {XMMREG,XMMREG,RM_XMM|BITS128,0,0}, nasm_bytecodes+2178, IF_AVX|IF_SANDYBRIDGE},
+    {I_VCMPNGT_UQPS, 2, {XMMREG,RM_XMM|BITS128,0,0,0}, nasm_bytecodes+2187, IF_AVX|IF_SANDYBRIDGE},
+    {I_VCMPNGT_UQPS, 3, {YMMREG,YMMREG,RM_YMM|BITS256,0,0}, nasm_bytecodes+2196, IF_AVX|IF_SANDYBRIDGE},
+    {I_VCMPNGT_UQPS, 2, {YMMREG,RM_YMM|BITS256,0,0,0}, nasm_bytecodes+2205, IF_AVX|IF_SANDYBRIDGE},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VCMPNGT_UQSD[] = {
+    {I_VCMPNGT_UQSD, 3, {XMMREG,XMMREG,RM_XMM|BITS64,0,0}, nasm_bytecodes+2862, IF_AVX|IF_SANDYBRIDGE},
+    {I_VCMPNGT_UQSD, 2, {XMMREG,RM_XMM|BITS64,0,0,0}, nasm_bytecodes+2871, IF_AVX|IF_SANDYBRIDGE},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VCMPNGT_UQSS[] = {
+    {I_VCMPNGT_UQSS, 3, {XMMREG,XMMREG,RM_XMM|BITS32,0,0}, nasm_bytecodes+3438, IF_AVX|IF_SANDYBRIDGE},
+    {I_VCMPNGT_UQSS, 2, {XMMREG,RM_XMM|BITS32,0,0,0}, nasm_bytecodes+3447, IF_AVX|IF_SANDYBRIDGE},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VCMPNLEPD[] = {
+    {I_VCMPNLEPD, 3, {XMMREG,XMMREG,RM_XMM|BITS128,0,0}, nasm_bytecodes+306, IF_AVX|IF_SANDYBRIDGE},
+    {I_VCMPNLEPD, 2, {XMMREG,RM_XMM|BITS128,0,0,0}, nasm_bytecodes+315, IF_AVX|IF_SANDYBRIDGE},
+    {I_VCMPNLEPD, 3, {YMMREG,YMMREG,RM_YMM|BITS256,0,0}, nasm_bytecodes+324, IF_AVX|IF_SANDYBRIDGE},
+    {I_VCMPNLEPD, 2, {YMMREG,RM_YMM|BITS256,0,0,0}, nasm_bytecodes+333, IF_AVX|IF_SANDYBRIDGE},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VCMPNLEPS[] = {
+    {I_VCMPNLEPS, 3, {XMMREG,XMMREG,RM_XMM|BITS128,0,0}, nasm_bytecodes+1458, IF_AVX|IF_SANDYBRIDGE},
+    {I_VCMPNLEPS, 2, {XMMREG,RM_XMM|BITS128,0,0,0}, nasm_bytecodes+1467, IF_AVX|IF_SANDYBRIDGE},
+    {I_VCMPNLEPS, 3, {YMMREG,YMMREG,RM_YMM|BITS256,0,0}, nasm_bytecodes+1476, IF_AVX|IF_SANDYBRIDGE},
+    {I_VCMPNLEPS, 2, {YMMREG,RM_YMM|BITS256,0,0,0}, nasm_bytecodes+1485, IF_AVX|IF_SANDYBRIDGE},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VCMPNLESD[] = {
+    {I_VCMPNLESD, 3, {XMMREG,XMMREG,RM_XMM|BITS64,0,0}, nasm_bytecodes+2502, IF_AVX|IF_SANDYBRIDGE},
+    {I_VCMPNLESD, 2, {XMMREG,RM_XMM|BITS64,0,0,0}, nasm_bytecodes+2511, IF_AVX|IF_SANDYBRIDGE},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VCMPNLESS[] = {
+    {I_VCMPNLESS, 3, {XMMREG,XMMREG,RM_XMM|BITS32,0,0}, nasm_bytecodes+3078, IF_AVX|IF_SANDYBRIDGE},
+    {I_VCMPNLESS, 2, {XMMREG,RM_XMM|BITS32,0,0,0}, nasm_bytecodes+3087, IF_AVX|IF_SANDYBRIDGE},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VCMPNLE_UQPD[] = {
+    {I_VCMPNLE_UQPD, 3, {XMMREG,XMMREG,RM_XMM|BITS128,0,0}, nasm_bytecodes+882, IF_AVX|IF_SANDYBRIDGE},
+    {I_VCMPNLE_UQPD, 2, {XMMREG,RM_XMM|BITS128,0,0,0}, nasm_bytecodes+891, IF_AVX|IF_SANDYBRIDGE},
+    {I_VCMPNLE_UQPD, 3, {YMMREG,YMMREG,RM_YMM|BITS256,0,0}, nasm_bytecodes+900, IF_AVX|IF_SANDYBRIDGE},
+    {I_VCMPNLE_UQPD, 2, {YMMREG,RM_YMM|BITS256,0,0,0}, nasm_bytecodes+909, IF_AVX|IF_SANDYBRIDGE},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VCMPNLE_UQPS[] = {
+    {I_VCMPNLE_UQPS, 3, {XMMREG,XMMREG,RM_XMM|BITS128,0,0}, nasm_bytecodes+2034, IF_AVX|IF_SANDYBRIDGE},
+    {I_VCMPNLE_UQPS, 2, {XMMREG,RM_XMM|BITS128,0,0,0}, nasm_bytecodes+2043, IF_AVX|IF_SANDYBRIDGE},
+    {I_VCMPNLE_UQPS, 3, {YMMREG,YMMREG,RM_YMM|BITS256,0,0}, nasm_bytecodes+2052, IF_AVX|IF_SANDYBRIDGE},
+    {I_VCMPNLE_UQPS, 2, {YMMREG,RM_YMM|BITS256,0,0,0}, nasm_bytecodes+2061, IF_AVX|IF_SANDYBRIDGE},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VCMPNLE_UQSD[] = {
+    {I_VCMPNLE_UQSD, 3, {XMMREG,XMMREG,RM_XMM|BITS64,0,0}, nasm_bytecodes+2790, IF_AVX|IF_SANDYBRIDGE},
+    {I_VCMPNLE_UQSD, 2, {XMMREG,RM_XMM|BITS64,0,0,0}, nasm_bytecodes+2799, IF_AVX|IF_SANDYBRIDGE},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VCMPNLE_UQSS[] = {
+    {I_VCMPNLE_UQSS, 3, {XMMREG,XMMREG,RM_XMM|BITS32,0,0}, nasm_bytecodes+3366, IF_AVX|IF_SANDYBRIDGE},
+    {I_VCMPNLE_UQSS, 2, {XMMREG,RM_XMM|BITS32,0,0,0}, nasm_bytecodes+3375, IF_AVX|IF_SANDYBRIDGE},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VCMPNLTPD[] = {
+    {I_VCMPNLTPD, 3, {XMMREG,XMMREG,RM_XMM|BITS128,0,0}, nasm_bytecodes+270, IF_AVX|IF_SANDYBRIDGE},
+    {I_VCMPNLTPD, 2, {XMMREG,RM_XMM|BITS128,0,0,0}, nasm_bytecodes+279, IF_AVX|IF_SANDYBRIDGE},
+    {I_VCMPNLTPD, 3, {YMMREG,YMMREG,RM_YMM|BITS256,0,0}, nasm_bytecodes+288, IF_AVX|IF_SANDYBRIDGE},
+    {I_VCMPNLTPD, 2, {YMMREG,RM_YMM|BITS256,0,0,0}, nasm_bytecodes+297, IF_AVX|IF_SANDYBRIDGE},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VCMPNLTPS[] = {
+    {I_VCMPNLTPS, 3, {XMMREG,XMMREG,RM_XMM|BITS128,0,0}, nasm_bytecodes+1422, IF_AVX|IF_SANDYBRIDGE},
+    {I_VCMPNLTPS, 2, {XMMREG,RM_XMM|BITS128,0,0,0}, nasm_bytecodes+1431, IF_AVX|IF_SANDYBRIDGE},
+    {I_VCMPNLTPS, 3, {YMMREG,YMMREG,RM_YMM|BITS256,0,0}, nasm_bytecodes+1440, IF_AVX|IF_SANDYBRIDGE},
+    {I_VCMPNLTPS, 2, {YMMREG,RM_YMM|BITS256,0,0,0}, nasm_bytecodes+1449, IF_AVX|IF_SANDYBRIDGE},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VCMPNLTSD[] = {
+    {I_VCMPNLTSD, 3, {XMMREG,XMMREG,RM_XMM|BITS64,0,0}, nasm_bytecodes+2484, IF_AVX|IF_SANDYBRIDGE},
+    {I_VCMPNLTSD, 2, {XMMREG,RM_XMM|BITS64,0,0,0}, nasm_bytecodes+2493, IF_AVX|IF_SANDYBRIDGE},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VCMPNLTSS[] = {
+    {I_VCMPNLTSS, 3, {XMMREG,XMMREG,RM_XMM|BITS32,0,0}, nasm_bytecodes+3060, IF_AVX|IF_SANDYBRIDGE},
+    {I_VCMPNLTSS, 2, {XMMREG,RM_XMM|BITS32,0,0,0}, nasm_bytecodes+3069, IF_AVX|IF_SANDYBRIDGE},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VCMPNLT_UQPD[] = {
+    {I_VCMPNLT_UQPD, 3, {XMMREG,XMMREG,RM_XMM|BITS128,0,0}, nasm_bytecodes+846, IF_AVX|IF_SANDYBRIDGE},
+    {I_VCMPNLT_UQPD, 2, {XMMREG,RM_XMM|BITS128,0,0,0}, nasm_bytecodes+855, IF_AVX|IF_SANDYBRIDGE},
+    {I_VCMPNLT_UQPD, 3, {YMMREG,YMMREG,RM_YMM|BITS256,0,0}, nasm_bytecodes+864, IF_AVX|IF_SANDYBRIDGE},
+    {I_VCMPNLT_UQPD, 2, {YMMREG,RM_YMM|BITS256,0,0,0}, nasm_bytecodes+873, IF_AVX|IF_SANDYBRIDGE},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VCMPNLT_UQPS[] = {
+    {I_VCMPNLT_UQPS, 3, {XMMREG,XMMREG,RM_XMM|BITS128,0,0}, nasm_bytecodes+1998, IF_AVX|IF_SANDYBRIDGE},
+    {I_VCMPNLT_UQPS, 2, {XMMREG,RM_XMM|BITS128,0,0,0}, nasm_bytecodes+2007, IF_AVX|IF_SANDYBRIDGE},
+    {I_VCMPNLT_UQPS, 3, {YMMREG,YMMREG,RM_YMM|BITS256,0,0}, nasm_bytecodes+2016, IF_AVX|IF_SANDYBRIDGE},
+    {I_VCMPNLT_UQPS, 2, {YMMREG,RM_YMM|BITS256,0,0,0}, nasm_bytecodes+2025, IF_AVX|IF_SANDYBRIDGE},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VCMPNLT_UQSD[] = {
+    {I_VCMPNLT_UQSD, 3, {XMMREG,XMMREG,RM_XMM|BITS64,0,0}, nasm_bytecodes+2772, IF_AVX|IF_SANDYBRIDGE},
+    {I_VCMPNLT_UQSD, 2, {XMMREG,RM_XMM|BITS64,0,0,0}, nasm_bytecodes+2781, IF_AVX|IF_SANDYBRIDGE},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VCMPNLT_UQSS[] = {
+    {I_VCMPNLT_UQSS, 3, {XMMREG,XMMREG,RM_XMM|BITS32,0,0}, nasm_bytecodes+3348, IF_AVX|IF_SANDYBRIDGE},
+    {I_VCMPNLT_UQSS, 2, {XMMREG,RM_XMM|BITS32,0,0,0}, nasm_bytecodes+3357, IF_AVX|IF_SANDYBRIDGE},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VCMPORDPD[] = {
+    {I_VCMPORDPD, 3, {XMMREG,XMMREG,RM_XMM|BITS128,0,0}, nasm_bytecodes+342, IF_AVX|IF_SANDYBRIDGE},
+    {I_VCMPORDPD, 2, {XMMREG,RM_XMM|BITS128,0,0,0}, nasm_bytecodes+351, IF_AVX|IF_SANDYBRIDGE},
+    {I_VCMPORDPD, 3, {YMMREG,YMMREG,RM_YMM|BITS256,0,0}, nasm_bytecodes+360, IF_AVX|IF_SANDYBRIDGE},
+    {I_VCMPORDPD, 2, {YMMREG,RM_YMM|BITS256,0,0,0}, nasm_bytecodes+369, IF_AVX|IF_SANDYBRIDGE},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VCMPORDPS[] = {
+    {I_VCMPORDPS, 3, {XMMREG,XMMREG,RM_XMM|BITS128,0,0}, nasm_bytecodes+1494, IF_AVX|IF_SANDYBRIDGE},
+    {I_VCMPORDPS, 2, {XMMREG,RM_XMM|BITS128,0,0,0}, nasm_bytecodes+1503, IF_AVX|IF_SANDYBRIDGE},
+    {I_VCMPORDPS, 3, {YMMREG,YMMREG,RM_YMM|BITS256,0,0}, nasm_bytecodes+1512, IF_AVX|IF_SANDYBRIDGE},
+    {I_VCMPORDPS, 2, {YMMREG,RM_YMM|BITS256,0,0,0}, nasm_bytecodes+1521, IF_AVX|IF_SANDYBRIDGE},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VCMPORDSD[] = {
+    {I_VCMPORDSD, 3, {XMMREG,XMMREG,RM_XMM|BITS64,0,0}, nasm_bytecodes+2520, IF_AVX|IF_SANDYBRIDGE},
+    {I_VCMPORDSD, 2, {XMMREG,RM_XMM|BITS64,0,0,0}, nasm_bytecodes+2529, IF_AVX|IF_SANDYBRIDGE},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VCMPORDSS[] = {
+    {I_VCMPORDSS, 3, {XMMREG,XMMREG,RM_XMM|BITS32,0,0}, nasm_bytecodes+3096, IF_AVX|IF_SANDYBRIDGE},
+    {I_VCMPORDSS, 2, {XMMREG,RM_XMM|BITS32,0,0,0}, nasm_bytecodes+3105, IF_AVX|IF_SANDYBRIDGE},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VCMPORD_SPD[] = {
+    {I_VCMPORD_SPD, 3, {XMMREG,XMMREG,RM_XMM|BITS128,0,0}, nasm_bytecodes+918, IF_AVX|IF_SANDYBRIDGE},
+    {I_VCMPORD_SPD, 2, {XMMREG,RM_XMM|BITS128,0,0,0}, nasm_bytecodes+927, IF_AVX|IF_SANDYBRIDGE},
+    {I_VCMPORD_SPD, 3, {YMMREG,YMMREG,RM_YMM|BITS256,0,0}, nasm_bytecodes+936, IF_AVX|IF_SANDYBRIDGE},
+    {I_VCMPORD_SPD, 2, {YMMREG,RM_YMM|BITS256,0,0,0}, nasm_bytecodes+945, IF_AVX|IF_SANDYBRIDGE},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VCMPORD_SPS[] = {
+    {I_VCMPORD_SPS, 3, {XMMREG,XMMREG,RM_XMM|BITS128,0,0}, nasm_bytecodes+2070, IF_AVX|IF_SANDYBRIDGE},
+    {I_VCMPORD_SPS, 2, {XMMREG,RM_XMM|BITS128,0,0,0}, nasm_bytecodes+2079, IF_AVX|IF_SANDYBRIDGE},
+    {I_VCMPORD_SPS, 3, {YMMREG,YMMREG,RM_YMM|BITS256,0,0}, nasm_bytecodes+2088, IF_AVX|IF_SANDYBRIDGE},
+    {I_VCMPORD_SPS, 2, {YMMREG,RM_YMM|BITS256,0,0,0}, nasm_bytecodes+2097, IF_AVX|IF_SANDYBRIDGE},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VCMPORD_SSD[] = {
+    {I_VCMPORD_SSD, 3, {XMMREG,XMMREG,RM_XMM|BITS64,0,0}, nasm_bytecodes+2808, IF_AVX|IF_SANDYBRIDGE},
+    {I_VCMPORD_SSD, 2, {XMMREG,RM_XMM|BITS64,0,0,0}, nasm_bytecodes+2817, IF_AVX|IF_SANDYBRIDGE},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VCMPORD_SSS[] = {
+    {I_VCMPORD_SSS, 3, {XMMREG,XMMREG,RM_XMM|BITS32,0,0}, nasm_bytecodes+3384, IF_AVX|IF_SANDYBRIDGE},
+    {I_VCMPORD_SSS, 2, {XMMREG,RM_XMM|BITS32,0,0,0}, nasm_bytecodes+3393, IF_AVX|IF_SANDYBRIDGE},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VCMPPD[] = {
+    {I_VCMPPD, 4, {XMMREG,XMMREG,RM_XMM|BITS128,IMMEDIATE|BITS8,0}, nasm_bytecodes+6188, IF_AVX|IF_SANDYBRIDGE},
+    {I_VCMPPD, 3, {XMMREG,RM_XMM|BITS128,IMMEDIATE|BITS8,0,0}, nasm_bytecodes+6196, IF_AVX|IF_SANDYBRIDGE},
+    {I_VCMPPD, 4, {YMMREG,YMMREG,RM_YMM|BITS256,IMMEDIATE|BITS8,0}, nasm_bytecodes+6204, IF_AVX|IF_SANDYBRIDGE},
+    {I_VCMPPD, 3, {YMMREG,RM_YMM|BITS256,IMMEDIATE|BITS8,0,0}, nasm_bytecodes+6212, IF_AVX|IF_SANDYBRIDGE},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VCMPPS[] = {
+    {I_VCMPPS, 4, {XMMREG,XMMREG,RM_XMM|BITS128,IMMEDIATE|BITS8,0}, nasm_bytecodes+6220, IF_AVX|IF_SANDYBRIDGE},
+    {I_VCMPPS, 3, {XMMREG,RM_XMM|BITS128,IMMEDIATE|BITS8,0,0}, nasm_bytecodes+6228, IF_AVX|IF_SANDYBRIDGE},
+    {I_VCMPPS, 4, {YMMREG,YMMREG,RM_YMM|BITS256,IMMEDIATE|BITS8,0}, nasm_bytecodes+6236, IF_AVX|IF_SANDYBRIDGE},
+    {I_VCMPPS, 3, {YMMREG,RM_YMM|BITS256,IMMEDIATE|BITS8,0,0}, nasm_bytecodes+6244, IF_AVX|IF_SANDYBRIDGE},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VCMPSD[] = {
+    {I_VCMPSD, 4, {XMMREG,XMMREG,RM_XMM|BITS64,IMMEDIATE|BITS8,0}, nasm_bytecodes+6252, IF_AVX|IF_SANDYBRIDGE},
+    {I_VCMPSD, 3, {XMMREG,RM_XMM|BITS64,IMMEDIATE|BITS8,0,0}, nasm_bytecodes+6260, IF_AVX|IF_SANDYBRIDGE},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VCMPSS[] = {
+    {I_VCMPSS, 4, {XMMREG,XMMREG,RM_XMM|BITS32,IMMEDIATE|BITS8,0}, nasm_bytecodes+6268, IF_AVX|IF_SANDYBRIDGE},
+    {I_VCMPSS, 3, {XMMREG,RM_XMM|BITS32,IMMEDIATE|BITS8,0,0}, nasm_bytecodes+6276, IF_AVX|IF_SANDYBRIDGE},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VCMPTRUEPD[] = {
+    {I_VCMPTRUEPD, 3, {XMMREG,XMMREG,RM_XMM|BITS128,0,0}, nasm_bytecodes+630, IF_AVX|IF_SANDYBRIDGE},
+    {I_VCMPTRUEPD, 2, {XMMREG,RM_XMM|BITS128,0,0,0}, nasm_bytecodes+639, IF_AVX|IF_SANDYBRIDGE},
+    {I_VCMPTRUEPD, 3, {YMMREG,YMMREG,RM_YMM|BITS256,0,0}, nasm_bytecodes+648, IF_AVX|IF_SANDYBRIDGE},
+    {I_VCMPTRUEPD, 2, {YMMREG,RM_YMM|BITS256,0,0,0}, nasm_bytecodes+657, IF_AVX|IF_SANDYBRIDGE},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VCMPTRUEPS[] = {
+    {I_VCMPTRUEPS, 3, {XMMREG,XMMREG,RM_XMM|BITS128,0,0}, nasm_bytecodes+1782, IF_AVX|IF_SANDYBRIDGE},
+    {I_VCMPTRUEPS, 2, {XMMREG,RM_XMM|BITS128,0,0,0}, nasm_bytecodes+1791, IF_AVX|IF_SANDYBRIDGE},
+    {I_VCMPTRUEPS, 3, {YMMREG,YMMREG,RM_YMM|BITS256,0,0}, nasm_bytecodes+1800, IF_AVX|IF_SANDYBRIDGE},
+    {I_VCMPTRUEPS, 2, {YMMREG,RM_YMM|BITS256,0,0,0}, nasm_bytecodes+1809, IF_AVX|IF_SANDYBRIDGE},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VCMPTRUESD[] = {
+    {I_VCMPTRUESD, 3, {XMMREG,XMMREG,RM_XMM|BITS64,0,0}, nasm_bytecodes+2664, IF_AVX|IF_SANDYBRIDGE},
+    {I_VCMPTRUESD, 2, {XMMREG,RM_XMM|BITS64,0,0,0}, nasm_bytecodes+2673, IF_AVX|IF_SANDYBRIDGE},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VCMPTRUESS[] = {
+    {I_VCMPTRUESS, 3, {XMMREG,XMMREG,RM_XMM|BITS32,0,0}, nasm_bytecodes+3240, IF_AVX|IF_SANDYBRIDGE},
+    {I_VCMPTRUESS, 2, {XMMREG,RM_XMM|BITS32,0,0,0}, nasm_bytecodes+3249, IF_AVX|IF_SANDYBRIDGE},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VCMPTRUE_USPD[] = {
+    {I_VCMPTRUE_USPD, 3, {XMMREG,XMMREG,RM_XMM|BITS128,0,0}, nasm_bytecodes+1206, IF_AVX|IF_SANDYBRIDGE},
+    {I_VCMPTRUE_USPD, 2, {XMMREG,RM_XMM|BITS128,0,0,0}, nasm_bytecodes+1215, IF_AVX|IF_SANDYBRIDGE},
+    {I_VCMPTRUE_USPD, 3, {YMMREG,YMMREG,RM_YMM|BITS256,0,0}, nasm_bytecodes+1224, IF_AVX|IF_SANDYBRIDGE},
+    {I_VCMPTRUE_USPD, 2, {YMMREG,RM_YMM|BITS256,0,0,0}, nasm_bytecodes+1233, IF_AVX|IF_SANDYBRIDGE},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VCMPTRUE_USPS[] = {
+    {I_VCMPTRUE_USPS, 3, {XMMREG,XMMREG,RM_XMM|BITS128,0,0}, nasm_bytecodes+2358, IF_AVX|IF_SANDYBRIDGE},
+    {I_VCMPTRUE_USPS, 2, {XMMREG,RM_XMM|BITS128,0,0,0}, nasm_bytecodes+2367, IF_AVX|IF_SANDYBRIDGE},
+    {I_VCMPTRUE_USPS, 3, {YMMREG,YMMREG,RM_YMM|BITS256,0,0}, nasm_bytecodes+2376, IF_AVX|IF_SANDYBRIDGE},
+    {I_VCMPTRUE_USPS, 2, {YMMREG,RM_YMM|BITS256,0,0,0}, nasm_bytecodes+2385, IF_AVX|IF_SANDYBRIDGE},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VCMPTRUE_USSD[] = {
+    {I_VCMPTRUE_USSD, 3, {XMMREG,XMMREG,RM_XMM|BITS64,0,0}, nasm_bytecodes+2952, IF_AVX|IF_SANDYBRIDGE},
+    {I_VCMPTRUE_USSD, 2, {XMMREG,RM_XMM|BITS64,0,0,0}, nasm_bytecodes+2961, IF_AVX|IF_SANDYBRIDGE},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VCMPTRUE_USSS[] = {
+    {I_VCMPTRUE_USSS, 3, {XMMREG,XMMREG,RM_XMM|BITS32,0,0}, nasm_bytecodes+3528, IF_AVX|IF_SANDYBRIDGE},
+    {I_VCMPTRUE_USSS, 2, {XMMREG,RM_XMM|BITS32,0,0,0}, nasm_bytecodes+3537, IF_AVX|IF_SANDYBRIDGE},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VCMPUNORDPD[] = {
+    {I_VCMPUNORDPD, 3, {XMMREG,XMMREG,RM_XMM|BITS128,0,0}, nasm_bytecodes+198, IF_AVX|IF_SANDYBRIDGE},
+    {I_VCMPUNORDPD, 2, {XMMREG,RM_XMM|BITS128,0,0,0}, nasm_bytecodes+207, IF_AVX|IF_SANDYBRIDGE},
+    {I_VCMPUNORDPD, 3, {YMMREG,YMMREG,RM_YMM|BITS256,0,0}, nasm_bytecodes+216, IF_AVX|IF_SANDYBRIDGE},
+    {I_VCMPUNORDPD, 2, {YMMREG,RM_YMM|BITS256,0,0,0}, nasm_bytecodes+225, IF_AVX|IF_SANDYBRIDGE},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VCMPUNORDPS[] = {
+    {I_VCMPUNORDPS, 3, {XMMREG,XMMREG,RM_XMM|BITS128,0,0}, nasm_bytecodes+1350, IF_AVX|IF_SANDYBRIDGE},
+    {I_VCMPUNORDPS, 2, {XMMREG,RM_XMM|BITS128,0,0,0}, nasm_bytecodes+1359, IF_AVX|IF_SANDYBRIDGE},
+    {I_VCMPUNORDPS, 3, {YMMREG,YMMREG,RM_YMM|BITS256,0,0}, nasm_bytecodes+1368, IF_AVX|IF_SANDYBRIDGE},
+    {I_VCMPUNORDPS, 2, {YMMREG,RM_YMM|BITS256,0,0,0}, nasm_bytecodes+1377, IF_AVX|IF_SANDYBRIDGE},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VCMPUNORDSD[] = {
+    {I_VCMPUNORDSD, 3, {XMMREG,XMMREG,RM_XMM|BITS64,0,0}, nasm_bytecodes+2448, IF_AVX|IF_SANDYBRIDGE},
+    {I_VCMPUNORDSD, 2, {XMMREG,RM_XMM|BITS64,0,0,0}, nasm_bytecodes+2457, IF_AVX|IF_SANDYBRIDGE},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VCMPUNORDSS[] = {
+    {I_VCMPUNORDSS, 3, {XMMREG,XMMREG,RM_XMM|BITS32,0,0}, nasm_bytecodes+3024, IF_AVX|IF_SANDYBRIDGE},
+    {I_VCMPUNORDSS, 2, {XMMREG,RM_XMM|BITS32,0,0,0}, nasm_bytecodes+3033, IF_AVX|IF_SANDYBRIDGE},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VCMPUNORD_SPD[] = {
+    {I_VCMPUNORD_SPD, 3, {XMMREG,XMMREG,RM_XMM|BITS128,0,0}, nasm_bytecodes+774, IF_AVX|IF_SANDYBRIDGE},
+    {I_VCMPUNORD_SPD, 2, {XMMREG,RM_XMM|BITS128,0,0,0}, nasm_bytecodes+783, IF_AVX|IF_SANDYBRIDGE},
+    {I_VCMPUNORD_SPD, 3, {YMMREG,YMMREG,RM_YMM|BITS256,0,0}, nasm_bytecodes+792, IF_AVX|IF_SANDYBRIDGE},
+    {I_VCMPUNORD_SPD, 2, {YMMREG,RM_YMM|BITS256,0,0,0}, nasm_bytecodes+801, IF_AVX|IF_SANDYBRIDGE},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VCMPUNORD_SPS[] = {
+    {I_VCMPUNORD_SPS, 3, {XMMREG,XMMREG,RM_XMM|BITS128,0,0}, nasm_bytecodes+1926, IF_AVX|IF_SANDYBRIDGE},
+    {I_VCMPUNORD_SPS, 2, {XMMREG,RM_XMM|BITS128,0,0,0}, nasm_bytecodes+1935, IF_AVX|IF_SANDYBRIDGE},
+    {I_VCMPUNORD_SPS, 3, {YMMREG,YMMREG,RM_YMM|BITS256,0,0}, nasm_bytecodes+1944, IF_AVX|IF_SANDYBRIDGE},
+    {I_VCMPUNORD_SPS, 2, {YMMREG,RM_YMM|BITS256,0,0,0}, nasm_bytecodes+1953, IF_AVX|IF_SANDYBRIDGE},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VCMPUNORD_SSD[] = {
+    {I_VCMPUNORD_SSD, 3, {XMMREG,XMMREG,RM_XMM|BITS64,0,0}, nasm_bytecodes+2736, IF_AVX|IF_SANDYBRIDGE},
+    {I_VCMPUNORD_SSD, 2, {XMMREG,RM_XMM|BITS64,0,0,0}, nasm_bytecodes+2745, IF_AVX|IF_SANDYBRIDGE},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VCMPUNORD_SSS[] = {
+    {I_VCMPUNORD_SSS, 3, {XMMREG,XMMREG,RM_XMM|BITS32,0,0}, nasm_bytecodes+3312, IF_AVX|IF_SANDYBRIDGE},
+    {I_VCMPUNORD_SSS, 2, {XMMREG,RM_XMM|BITS32,0,0,0}, nasm_bytecodes+3321, IF_AVX|IF_SANDYBRIDGE},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VCOMISD[] = {
+    {I_VCOMISD, 2, {XMMREG,RM_XMM|BITS64,0,0,0}, nasm_bytecodes+9119, IF_AVX|IF_SANDYBRIDGE},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VCOMISS[] = {
+    {I_VCOMISS, 2, {XMMREG,RM_XMM|BITS32,0,0,0}, nasm_bytecodes+9126, IF_AVX|IF_SANDYBRIDGE},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VCVTDQ2PD[] = {
+    {I_VCVTDQ2PD, 2, {XMMREG,RM_XMM|BITS64,0,0,0}, nasm_bytecodes+9133, IF_AVX|IF_SANDYBRIDGE},
+    {I_VCVTDQ2PD, 2, {YMMREG,RM_XMM|BITS128,0,0,0}, nasm_bytecodes+9140, IF_AVX|IF_SANDYBRIDGE},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VCVTDQ2PS[] = {
+    {I_VCVTDQ2PS, 2, {XMMREG,RM_XMM|BITS128,0,0,0}, nasm_bytecodes+9147, IF_AVX|IF_SANDYBRIDGE},
+    {I_VCVTDQ2PS, 2, {YMMREG,RM_YMM|BITS256,0,0,0}, nasm_bytecodes+9154, IF_AVX|IF_SANDYBRIDGE},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VCVTPD2DQ[] = {
+    {I_VCVTPD2DQ, 2, {XMMREG,XMMREG,0,0,0}, nasm_bytecodes+9161, IF_AVX|IF_SANDYBRIDGE},
+    {I_VCVTPD2DQ, 2, {XMMREG,MEMORY|BITS128,0,0,0}, nasm_bytecodes+9161, IF_AVX|IF_SANDYBRIDGE|IF_SO},
+    {I_VCVTPD2DQ, 2, {XMMREG,YMMREG,0,0,0}, nasm_bytecodes+9168, IF_AVX|IF_SANDYBRIDGE},
+    {I_VCVTPD2DQ, 2, {XMMREG,MEMORY|BITS256,0,0,0}, nasm_bytecodes+9168, IF_AVX|IF_SANDYBRIDGE|IF_SY},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VCVTPD2PS[] = {
+    {I_VCVTPD2PS, 2, {XMMREG,XMMREG,0,0,0}, nasm_bytecodes+9175, IF_AVX|IF_SANDYBRIDGE},
+    {I_VCVTPD2PS, 2, {XMMREG,MEMORY|BITS128,0,0,0}, nasm_bytecodes+9175, IF_AVX|IF_SANDYBRIDGE|IF_SO},
+    {I_VCVTPD2PS, 2, {XMMREG,YMMREG,0,0,0}, nasm_bytecodes+9182, IF_AVX|IF_SANDYBRIDGE},
+    {I_VCVTPD2PS, 2, {XMMREG,MEMORY|BITS256,0,0,0}, nasm_bytecodes+9182, IF_AVX|IF_SANDYBRIDGE|IF_SY},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VCVTPH2PS[] = {
+    {I_VCVTPH2PS, 3, {XMMREG,RM_XMM|BITS64,IMMEDIATE|BITS8,0,0}, nasm_bytecodes+6980, IF_AMD|IF_SSE5},
+    {I_VCVTPH2PS, 2, {XMMREG,IMMEDIATE|BITS8,0,0,0}, nasm_bytecodes+6988, IF_AMD|IF_SSE5},
+    {I_VCVTPH2PS, 3, {YMMREG,RM_XMM|BITS128,IMMEDIATE|BITS8,0,0}, nasm_bytecodes+6996, IF_AMD|IF_SSE5},
+    {I_VCVTPH2PS, 3, {YMMREG,RM_YMM|BITS128,IMMEDIATE|BITS8,0,0}, nasm_bytecodes+6996, IF_AMD|IF_SSE5},
+    {I_VCVTPH2PS, 2, {YMMREG,IMMEDIATE|BITS8,0,0,0}, nasm_bytecodes+7004, IF_AMD|IF_SSE5},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VCVTPS2DQ[] = {
+    {I_VCVTPS2DQ, 2, {XMMREG,RM_XMM|BITS128,0,0,0}, nasm_bytecodes+9189, IF_AVX|IF_SANDYBRIDGE},
+    {I_VCVTPS2DQ, 2, {YMMREG,RM_YMM|BITS256,0,0,0}, nasm_bytecodes+9196, IF_AVX|IF_SANDYBRIDGE},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VCVTPS2PD[] = {
+    {I_VCVTPS2PD, 2, {XMMREG,RM_XMM|BITS64,0,0,0}, nasm_bytecodes+9203, IF_AVX|IF_SANDYBRIDGE},
+    {I_VCVTPS2PD, 2, {YMMREG,RM_XMM|BITS128,0,0,0}, nasm_bytecodes+9210, IF_AVX|IF_SANDYBRIDGE},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VCVTPS2PH[] = {
+    {I_VCVTPS2PH, 3, {RM_XMM|BITS64,XMMREG,IMMEDIATE|BITS8,0,0}, nasm_bytecodes+7012, IF_AMD|IF_SSE5},
+    {I_VCVTPS2PH, 2, {RM_XMM|BITS64,IMMEDIATE|BITS8,0,0,0}, nasm_bytecodes+7020, IF_AMD|IF_SSE5},
+    {I_VCVTPS2PH, 3, {RM_XMM|BITS128,YMMREG,IMMEDIATE|BITS8,0,0}, nasm_bytecodes+7028, IF_AMD|IF_SSE5},
+    {I_VCVTPS2PH, 3, {RM_YMM|BITS128,YMMREG,IMMEDIATE|BITS8,0,0}, nasm_bytecodes+7028, IF_AMD|IF_SSE5},
+    {I_VCVTPS2PH, 2, {RM_YMM|BITS128,IMMEDIATE|BITS8,0,0,0}, nasm_bytecodes+7036, IF_AMD|IF_SSE5},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VCVTSD2SI[] = {
+    {I_VCVTSD2SI, 2, {REG_GPR|BITS32,RM_XMM|BITS64,0,0,0}, nasm_bytecodes+9217, IF_AVX|IF_SANDYBRIDGE},
+    {I_VCVTSD2SI, 2, {REG_GPR|BITS64,RM_XMM|BITS64,0,0,0}, nasm_bytecodes+9224, IF_AVX|IF_SANDYBRIDGE|IF_LONG},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VCVTSD2SS[] = {
+    {I_VCVTSD2SS, 3, {XMMREG,XMMREG,RM_XMM|BITS64,0,0}, nasm_bytecodes+9231, IF_AVX|IF_SANDYBRIDGE},
+    {I_VCVTSD2SS, 2, {XMMREG,RM_XMM|BITS64,0,0,0}, nasm_bytecodes+9238, IF_AVX|IF_SANDYBRIDGE},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VCVTSI2SD[] = {
+    {I_VCVTSI2SD, 3, {XMMREG,XMMREG,RM_GPR|BITS32,0,0}, nasm_bytecodes+9245, IF_AVX|IF_SANDYBRIDGE|IF_SD},
+    {I_VCVTSI2SD, 2, {XMMREG,RM_GPR|BITS32,0,0,0}, nasm_bytecodes+9252, IF_AVX|IF_SANDYBRIDGE|IF_SD},
+    {I_VCVTSI2SD, 3, {XMMREG,XMMREG,MEMORY|BITS32,0,0}, nasm_bytecodes+9245, IF_AVX|IF_SANDYBRIDGE|IF_SD},
+    {I_VCVTSI2SD, 2, {XMMREG,MEMORY|BITS32,0,0,0}, nasm_bytecodes+9252, IF_AVX|IF_SANDYBRIDGE|IF_SD},
+    {I_VCVTSI2SD, 3, {XMMREG,XMMREG,RM_GPR|BITS64,0,0}, nasm_bytecodes+9259, IF_AVX|IF_SANDYBRIDGE|IF_LONG|IF_SQ},
+    {I_VCVTSI2SD, 2, {XMMREG,RM_GPR|BITS64,0,0,0}, nasm_bytecodes+9266, IF_AVX|IF_SANDYBRIDGE|IF_LONG|IF_SQ},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VCVTSI2SS[] = {
+    {I_VCVTSI2SS, 3, {XMMREG,XMMREG,RM_GPR|BITS32,0,0}, nasm_bytecodes+9273, IF_AVX|IF_SANDYBRIDGE|IF_SD},
+    {I_VCVTSI2SS, 2, {XMMREG,RM_GPR|BITS32,0,0,0}, nasm_bytecodes+9280, IF_AVX|IF_SANDYBRIDGE|IF_SD},
+    {I_VCVTSI2SS, 3, {XMMREG,XMMREG,MEMORY|BITS32,0,0}, nasm_bytecodes+9273, IF_AVX|IF_SANDYBRIDGE|IF_SD},
+    {I_VCVTSI2SS, 2, {XMMREG,MEMORY|BITS32,0,0,0}, nasm_bytecodes+9280, IF_AVX|IF_SANDYBRIDGE|IF_SD},
+    {I_VCVTSI2SS, 3, {XMMREG,XMMREG,RM_GPR|BITS64,0,0}, nasm_bytecodes+9287, IF_AVX|IF_SANDYBRIDGE|IF_LONG|IF_SQ},
+    {I_VCVTSI2SS, 2, {XMMREG,RM_GPR|BITS64,0,0,0}, nasm_bytecodes+9294, IF_AVX|IF_SANDYBRIDGE|IF_LONG|IF_SQ},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VCVTSS2SD[] = {
+    {I_VCVTSS2SD, 3, {XMMREG,XMMREG,RM_XMM|BITS32,0,0}, nasm_bytecodes+9301, IF_AVX|IF_SANDYBRIDGE},
+    {I_VCVTSS2SD, 2, {XMMREG,RM_XMM|BITS32,0,0,0}, nasm_bytecodes+9308, IF_AVX|IF_SANDYBRIDGE},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VCVTSS2SI[] = {
+    {I_VCVTSS2SI, 2, {REG_GPR|BITS32,RM_XMM|BITS32,0,0,0}, nasm_bytecodes+9315, IF_AVX|IF_SANDYBRIDGE},
+    {I_VCVTSS2SI, 2, {REG_GPR|BITS64,RM_XMM|BITS32,0,0,0}, nasm_bytecodes+9322, IF_AVX|IF_SANDYBRIDGE|IF_LONG},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VCVTTPD2DQ[] = {
+    {I_VCVTTPD2DQ, 2, {XMMREG,XMMREG,0,0,0}, nasm_bytecodes+9329, IF_AVX|IF_SANDYBRIDGE},
+    {I_VCVTTPD2DQ, 2, {XMMREG,MEMORY|BITS128,0,0,0}, nasm_bytecodes+9329, IF_AVX|IF_SANDYBRIDGE|IF_SO},
+    {I_VCVTTPD2DQ, 2, {XMMREG,YMMREG,0,0,0}, nasm_bytecodes+9336, IF_AVX|IF_SANDYBRIDGE},
+    {I_VCVTTPD2DQ, 2, {XMMREG,MEMORY|BITS256,0,0,0}, nasm_bytecodes+9336, IF_AVX|IF_SANDYBRIDGE|IF_SY},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VCVTTPS2DQ[] = {
+    {I_VCVTTPS2DQ, 2, {XMMREG,RM_XMM|BITS128,0,0,0}, nasm_bytecodes+9343, IF_AVX|IF_SANDYBRIDGE},
+    {I_VCVTTPS2DQ, 2, {YMMREG,RM_YMM|BITS256,0,0,0}, nasm_bytecodes+9350, IF_AVX|IF_SANDYBRIDGE},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VCVTTSD2SI[] = {
+    {I_VCVTTSD2SI, 2, {REG_GPR|BITS32,RM_XMM|BITS64,0,0,0}, nasm_bytecodes+9357, IF_AVX|IF_SANDYBRIDGE},
+    {I_VCVTTSD2SI, 2, {REG_GPR|BITS64,RM_XMM|BITS64,0,0,0}, nasm_bytecodes+9364, IF_AVX|IF_SANDYBRIDGE|IF_LONG},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VCVTTSS2SI[] = {
+    {I_VCVTTSS2SI, 2, {REG_GPR|BITS32,RM_XMM|BITS32,0,0,0}, nasm_bytecodes+9371, IF_AVX|IF_SANDYBRIDGE},
+    {I_VCVTTSS2SI, 2, {REG_GPR|BITS64,RM_XMM|BITS32,0,0,0}, nasm_bytecodes+9378, IF_AVX|IF_SANDYBRIDGE|IF_LONG},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VDIVPD[] = {
+    {I_VDIVPD, 3, {XMMREG,XMMREG,RM_XMM|BITS128,0,0}, nasm_bytecodes+9385, IF_AVX|IF_SANDYBRIDGE},
+    {I_VDIVPD, 2, {XMMREG,RM_XMM|BITS128,0,0,0}, nasm_bytecodes+9392, IF_AVX|IF_SANDYBRIDGE},
+    {I_VDIVPD, 3, {YMMREG,YMMREG,RM_YMM|BITS256,0,0}, nasm_bytecodes+9399, IF_AVX|IF_SANDYBRIDGE},
+    {I_VDIVPD, 2, {YMMREG,RM_YMM|BITS256,0,0,0}, nasm_bytecodes+9406, IF_AVX|IF_SANDYBRIDGE},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VDIVPS[] = {
+    {I_VDIVPS, 3, {XMMREG,XMMREG,RM_XMM|BITS128,0,0}, nasm_bytecodes+9413, IF_AVX|IF_SANDYBRIDGE},
+    {I_VDIVPS, 2, {XMMREG,RM_XMM|BITS128,0,0,0}, nasm_bytecodes+9420, IF_AVX|IF_SANDYBRIDGE},
+    {I_VDIVPS, 3, {YMMREG,YMMREG,RM_YMM|BITS256,0,0}, nasm_bytecodes+9427, IF_AVX|IF_SANDYBRIDGE},
+    {I_VDIVPS, 2, {YMMREG,RM_YMM|BITS256,0,0,0}, nasm_bytecodes+9434, IF_AVX|IF_SANDYBRIDGE},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VDIVSD[] = {
+    {I_VDIVSD, 3, {XMMREG,XMMREG,RM_XMM|BITS64,0,0}, nasm_bytecodes+9441, IF_AVX|IF_SANDYBRIDGE},
+    {I_VDIVSD, 2, {XMMREG,RM_XMM|BITS64,0,0,0}, nasm_bytecodes+9448, IF_AVX|IF_SANDYBRIDGE},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VDIVSS[] = {
+    {I_VDIVSS, 3, {XMMREG,XMMREG,RM_XMM|BITS32,0,0}, nasm_bytecodes+9455, IF_AVX|IF_SANDYBRIDGE},
+    {I_VDIVSS, 2, {XMMREG,RM_XMM|BITS32,0,0,0}, nasm_bytecodes+9462, IF_AVX|IF_SANDYBRIDGE},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VDPPD[] = {
+    {I_VDPPD, 4, {XMMREG,XMMREG,RM_XMM|BITS128,IMMEDIATE|BITS8,0}, nasm_bytecodes+6284, IF_AVX|IF_SANDYBRIDGE},
+    {I_VDPPD, 3, {XMMREG,RM_XMM|BITS128,IMMEDIATE|BITS8,0,0}, nasm_bytecodes+6292, IF_AVX|IF_SANDYBRIDGE},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VDPPS[] = {
+    {I_VDPPS, 4, {XMMREG,XMMREG,RM_XMM|BITS128,IMMEDIATE|BITS8,0}, nasm_bytecodes+6300, IF_AVX|IF_SANDYBRIDGE},
+    {I_VDPPS, 3, {XMMREG,RM_XMM|BITS128,IMMEDIATE|BITS8,0,0}, nasm_bytecodes+6308, IF_AVX|IF_SANDYBRIDGE},
+    {I_VDPPS, 4, {YMMREG,YMMREG,RM_YMM|BITS256,IMMEDIATE|BITS8,0}, nasm_bytecodes+6316, IF_AVX|IF_SANDYBRIDGE},
+    {I_VDPPS, 3, {YMMREG,RM_YMM|BITS256,IMMEDIATE|BITS8,0,0}, nasm_bytecodes+6324, IF_AVX|IF_SANDYBRIDGE},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VERR[] = {
+    {I_VERR, 1, {MEMORY,0,0,0,0}, nasm_bytecodes+18739, IF_286|IF_PROT},
+    {I_VERR, 1, {MEMORY|BITS16,0,0,0,0}, nasm_bytecodes+18739, IF_286|IF_PROT},
+    {I_VERR, 1, {REG_GPR|BITS16,0,0,0,0}, nasm_bytecodes+18739, IF_286|IF_PROT},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VERW[] = {
+    {I_VERW, 1, {MEMORY,0,0,0,0}, nasm_bytecodes+18744, IF_286|IF_PROT},
+    {I_VERW, 1, {MEMORY|BITS16,0,0,0,0}, nasm_bytecodes+18744, IF_286|IF_PROT},
+    {I_VERW, 1, {REG_GPR|BITS16,0,0,0,0}, nasm_bytecodes+18744, IF_286|IF_PROT},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VEXTRACTF128[] = {
+    {I_VEXTRACTF128, 3, {RM_XMM|BITS128,XMMREG,IMMEDIATE|BITS8,0,0}, nasm_bytecodes+6332, IF_AVX|IF_SANDYBRIDGE},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VEXTRACTPS[] = {
+    {I_VEXTRACTPS, 3, {RM_GPR|BITS32,XMMREG,IMMEDIATE|BITS8,0,0}, nasm_bytecodes+6340, IF_AVX|IF_SANDYBRIDGE},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VFMADD123PD[] = {
+    {I_VFMADD123PD, 3, {XMMREG,XMMREG,RM_XMM|BITS128,0,0}, nasm_bytecodes+12234, IF_FMA|IF_FUTURE},
+    {I_VFMADD123PD, 3, {YMMREG,YMMREG,RM_YMM|BITS256,0,0}, nasm_bytecodes+12241, IF_FMA|IF_FUTURE},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VFMADD123PS[] = {
+    {I_VFMADD123PS, 3, {XMMREG,XMMREG,RM_XMM|BITS128,0,0}, nasm_bytecodes+12220, IF_FMA|IF_FUTURE},
+    {I_VFMADD123PS, 3, {YMMREG,YMMREG,RM_YMM|BITS256,0,0}, nasm_bytecodes+12227, IF_FMA|IF_FUTURE},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VFMADD123SD[] = {
+    {I_VFMADD123SD, 3, {XMMREG,XMMREG,RM_XMM|BITS64,0,0}, nasm_bytecodes+12717, IF_FMA|IF_FUTURE},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VFMADD123SS[] = {
+    {I_VFMADD123SS, 3, {XMMREG,XMMREG,RM_XMM|BITS32,0,0}, nasm_bytecodes+12710, IF_FMA|IF_FUTURE},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VFMADD132PD[] = {
+    {I_VFMADD132PD, 3, {XMMREG,XMMREG,RM_XMM|BITS128,0,0}, nasm_bytecodes+12206, IF_FMA|IF_FUTURE},
+    {I_VFMADD132PD, 3, {YMMREG,YMMREG,RM_YMM|BITS256,0,0}, nasm_bytecodes+12213, IF_FMA|IF_FUTURE},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VFMADD132PS[] = {
+    {I_VFMADD132PS, 3, {XMMREG,XMMREG,RM_XMM|BITS128,0,0}, nasm_bytecodes+12192, IF_FMA|IF_FUTURE},
+    {I_VFMADD132PS, 3, {YMMREG,YMMREG,RM_YMM|BITS256,0,0}, nasm_bytecodes+12199, IF_FMA|IF_FUTURE},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VFMADD132SD[] = {
+    {I_VFMADD132SD, 3, {XMMREG,XMMREG,RM_XMM|BITS64,0,0}, nasm_bytecodes+12703, IF_FMA|IF_FUTURE},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VFMADD132SS[] = {
+    {I_VFMADD132SS, 3, {XMMREG,XMMREG,RM_XMM|BITS32,0,0}, nasm_bytecodes+12696, IF_FMA|IF_FUTURE},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VFMADD213PD[] = {
+    {I_VFMADD213PD, 3, {XMMREG,XMMREG,RM_XMM|BITS128,0,0}, nasm_bytecodes+12234, IF_FMA|IF_FUTURE},
+    {I_VFMADD213PD, 3, {YMMREG,YMMREG,RM_YMM|BITS256,0,0}, nasm_bytecodes+12241, IF_FMA|IF_FUTURE},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VFMADD213PS[] = {
+    {I_VFMADD213PS, 3, {XMMREG,XMMREG,RM_XMM|BITS128,0,0}, nasm_bytecodes+12220, IF_FMA|IF_FUTURE},
+    {I_VFMADD213PS, 3, {YMMREG,YMMREG,RM_YMM|BITS256,0,0}, nasm_bytecodes+12227, IF_FMA|IF_FUTURE},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VFMADD213SD[] = {
+    {I_VFMADD213SD, 3, {XMMREG,XMMREG,RM_XMM|BITS64,0,0}, nasm_bytecodes+12717, IF_FMA|IF_FUTURE},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VFMADD213SS[] = {
+    {I_VFMADD213SS, 3, {XMMREG,XMMREG,RM_XMM|BITS32,0,0}, nasm_bytecodes+12710, IF_FMA|IF_FUTURE},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VFMADD231PD[] = {
+    {I_VFMADD231PD, 3, {XMMREG,XMMREG,RM_XMM|BITS128,0,0}, nasm_bytecodes+12262, IF_FMA|IF_FUTURE},
+    {I_VFMADD231PD, 3, {YMMREG,YMMREG,RM_YMM|BITS256,0,0}, nasm_bytecodes+12269, IF_FMA|IF_FUTURE},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VFMADD231PS[] = {
+    {I_VFMADD231PS, 3, {XMMREG,XMMREG,RM_XMM|BITS128,0,0}, nasm_bytecodes+12248, IF_FMA|IF_FUTURE},
+    {I_VFMADD231PS, 3, {YMMREG,YMMREG,RM_YMM|BITS256,0,0}, nasm_bytecodes+12255, IF_FMA|IF_FUTURE},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VFMADD231SD[] = {
+    {I_VFMADD231SD, 3, {XMMREG,XMMREG,RM_XMM|BITS64,0,0}, nasm_bytecodes+12731, IF_FMA|IF_FUTURE},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VFMADD231SS[] = {
+    {I_VFMADD231SS, 3, {XMMREG,XMMREG,RM_XMM|BITS32,0,0}, nasm_bytecodes+12724, IF_FMA|IF_FUTURE},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VFMADD312PD[] = {
+    {I_VFMADD312PD, 3, {XMMREG,XMMREG,RM_XMM|BITS128,0,0}, nasm_bytecodes+12206, IF_FMA|IF_FUTURE},
+    {I_VFMADD312PD, 3, {YMMREG,YMMREG,RM_YMM|BITS256,0,0}, nasm_bytecodes+12213, IF_FMA|IF_FUTURE},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VFMADD312PS[] = {
+    {I_VFMADD312PS, 3, {XMMREG,XMMREG,RM_XMM|BITS128,0,0}, nasm_bytecodes+12192, IF_FMA|IF_FUTURE},
+    {I_VFMADD312PS, 3, {YMMREG,YMMREG,RM_YMM|BITS256,0,0}, nasm_bytecodes+12199, IF_FMA|IF_FUTURE},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VFMADD312SD[] = {
+    {I_VFMADD312SD, 3, {XMMREG,XMMREG,RM_XMM|BITS64,0,0}, nasm_bytecodes+12703, IF_FMA|IF_FUTURE},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VFMADD312SS[] = {
+    {I_VFMADD312SS, 3, {XMMREG,XMMREG,RM_XMM|BITS32,0,0}, nasm_bytecodes+12696, IF_FMA|IF_FUTURE},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VFMADD321PD[] = {
+    {I_VFMADD321PD, 3, {XMMREG,XMMREG,RM_XMM|BITS128,0,0}, nasm_bytecodes+12262, IF_FMA|IF_FUTURE},
+    {I_VFMADD321PD, 3, {YMMREG,YMMREG,RM_YMM|BITS256,0,0}, nasm_bytecodes+12269, IF_FMA|IF_FUTURE},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VFMADD321PS[] = {
+    {I_VFMADD321PS, 3, {XMMREG,XMMREG,RM_XMM|BITS128,0,0}, nasm_bytecodes+12248, IF_FMA|IF_FUTURE},
+    {I_VFMADD321PS, 3, {YMMREG,YMMREG,RM_YMM|BITS256,0,0}, nasm_bytecodes+12255, IF_FMA|IF_FUTURE},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VFMADD321SD[] = {
+    {I_VFMADD321SD, 3, {XMMREG,XMMREG,RM_XMM|BITS64,0,0}, nasm_bytecodes+12731, IF_FMA|IF_FUTURE},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VFMADD321SS[] = {
+    {I_VFMADD321SS, 3, {XMMREG,XMMREG,RM_XMM|BITS32,0,0}, nasm_bytecodes+12724, IF_FMA|IF_FUTURE},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VFMADDPD[] = {
+    {I_VFMADDPD, 4, {XMMREG,XMMREG,RM_XMM|BITS128,XMMREG,0}, nasm_bytecodes+3960, IF_AMD|IF_SSE5},
+    {I_VFMADDPD, 3, {XMMREG,RM_XMM|BITS128,XMMREG,0,0}, nasm_bytecodes+3969, IF_AMD|IF_SSE5},
+    {I_VFMADDPD, 4, {YMMREG,YMMREG,RM_YMM|BITS256,YMMREG,0}, nasm_bytecodes+3978, IF_AMD|IF_SSE5},
+    {I_VFMADDPD, 3, {YMMREG,RM_YMM|BITS256,YMMREG,0,0}, nasm_bytecodes+3987, IF_AMD|IF_SSE5},
+    {I_VFMADDPD, 4, {XMMREG,XMMREG,XMMREG,RM_XMM|BITS128,0}, nasm_bytecodes+3996, IF_AMD|IF_SSE5},
+    {I_VFMADDPD, 3, {XMMREG,XMMREG,RM_XMM|BITS128,0,0}, nasm_bytecodes+4005, IF_AMD|IF_SSE5},
+    {I_VFMADDPD, 4, {YMMREG,YMMREG,YMMREG,RM_YMM|BITS256,0}, nasm_bytecodes+4014, IF_AMD|IF_SSE5},
+    {I_VFMADDPD, 3, {YMMREG,YMMREG,RM_YMM|BITS256,0,0}, nasm_bytecodes+4023, IF_AMD|IF_SSE5},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VFMADDPS[] = {
+    {I_VFMADDPS, 4, {XMMREG,XMMREG,RM_XMM|BITS128,XMMREG,0}, nasm_bytecodes+4032, IF_AMD|IF_SSE5},
+    {I_VFMADDPS, 3, {XMMREG,RM_XMM|BITS128,XMMREG,0,0}, nasm_bytecodes+4041, IF_AMD|IF_SSE5},
+    {I_VFMADDPS, 4, {YMMREG,YMMREG,RM_YMM|BITS256,YMMREG,0}, nasm_bytecodes+4050, IF_AMD|IF_SSE5},
+    {I_VFMADDPS, 3, {YMMREG,RM_YMM|BITS256,YMMREG,0,0}, nasm_bytecodes+4059, IF_AMD|IF_SSE5},
+    {I_VFMADDPS, 4, {XMMREG,XMMREG,XMMREG,RM_XMM|BITS128,0}, nasm_bytecodes+4068, IF_AMD|IF_SSE5},
+    {I_VFMADDPS, 3, {XMMREG,XMMREG,RM_XMM|BITS128,0,0}, nasm_bytecodes+4077, IF_AMD|IF_SSE5},
+    {I_VFMADDPS, 4, {YMMREG,YMMREG,YMMREG,RM_YMM|BITS256,0}, nasm_bytecodes+4086, IF_AMD|IF_SSE5},
+    {I_VFMADDPS, 3, {YMMREG,YMMREG,RM_YMM|BITS256,0,0}, nasm_bytecodes+4095, IF_AMD|IF_SSE5},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VFMADDSD[] = {
+    {I_VFMADDSD, 4, {XMMREG,XMMREG,RM_XMM|BITS64,XMMREG,0}, nasm_bytecodes+4104, IF_AMD|IF_SSE5},
+    {I_VFMADDSD, 3, {XMMREG,RM_XMM|BITS64,XMMREG,0,0}, nasm_bytecodes+4113, IF_AMD|IF_SSE5},
+    {I_VFMADDSD, 4, {XMMREG,XMMREG,XMMREG,RM_XMM|BITS64,0}, nasm_bytecodes+4122, IF_AMD|IF_SSE5},
+    {I_VFMADDSD, 3, {XMMREG,XMMREG,RM_XMM|BITS64,0,0}, nasm_bytecodes+4131, IF_AMD|IF_SSE5},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VFMADDSS[] = {
+    {I_VFMADDSS, 4, {XMMREG,XMMREG,RM_XMM|BITS32,XMMREG,0}, nasm_bytecodes+4140, IF_AMD|IF_SSE5},
+    {I_VFMADDSS, 3, {XMMREG,RM_XMM|BITS32,XMMREG,0,0}, nasm_bytecodes+4149, IF_AMD|IF_SSE5},
+    {I_VFMADDSS, 4, {XMMREG,XMMREG,XMMREG,RM_XMM|BITS32,0}, nasm_bytecodes+4158, IF_AMD|IF_SSE5},
+    {I_VFMADDSS, 3, {XMMREG,XMMREG,RM_XMM|BITS32,0,0}, nasm_bytecodes+4167, IF_AMD|IF_SSE5},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VFMADDSUB123PD[] = {
+    {I_VFMADDSUB123PD, 3, {XMMREG,XMMREG,RM_XMM|BITS128,0,0}, nasm_bytecodes+12318, IF_FMA|IF_FUTURE},
+    {I_VFMADDSUB123PD, 3, {YMMREG,YMMREG,RM_YMM|BITS256,0,0}, nasm_bytecodes+12325, IF_FMA|IF_FUTURE},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VFMADDSUB123PS[] = {
+    {I_VFMADDSUB123PS, 3, {XMMREG,XMMREG,RM_XMM|BITS128,0,0}, nasm_bytecodes+12304, IF_FMA|IF_FUTURE},
+    {I_VFMADDSUB123PS, 3, {YMMREG,YMMREG,RM_YMM|BITS256,0,0}, nasm_bytecodes+12311, IF_FMA|IF_FUTURE},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VFMADDSUB132PD[] = {
+    {I_VFMADDSUB132PD, 3, {XMMREG,XMMREG,RM_XMM|BITS128,0,0}, nasm_bytecodes+12290, IF_FMA|IF_FUTURE},
+    {I_VFMADDSUB132PD, 3, {YMMREG,YMMREG,RM_YMM|BITS256,0,0}, nasm_bytecodes+12297, IF_FMA|IF_FUTURE},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VFMADDSUB132PS[] = {
+    {I_VFMADDSUB132PS, 3, {XMMREG,XMMREG,RM_XMM|BITS128,0,0}, nasm_bytecodes+12276, IF_FMA|IF_FUTURE},
+    {I_VFMADDSUB132PS, 3, {YMMREG,YMMREG,RM_YMM|BITS256,0,0}, nasm_bytecodes+12283, IF_FMA|IF_FUTURE},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VFMADDSUB213PD[] = {
+    {I_VFMADDSUB213PD, 3, {XMMREG,XMMREG,RM_XMM|BITS128,0,0}, nasm_bytecodes+12318, IF_FMA|IF_FUTURE},
+    {I_VFMADDSUB213PD, 3, {YMMREG,YMMREG,RM_YMM|BITS256,0,0}, nasm_bytecodes+12325, IF_FMA|IF_FUTURE},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VFMADDSUB213PS[] = {
+    {I_VFMADDSUB213PS, 3, {XMMREG,XMMREG,RM_XMM|BITS128,0,0}, nasm_bytecodes+12304, IF_FMA|IF_FUTURE},
+    {I_VFMADDSUB213PS, 3, {YMMREG,YMMREG,RM_YMM|BITS256,0,0}, nasm_bytecodes+12311, IF_FMA|IF_FUTURE},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VFMADDSUB231PD[] = {
+    {I_VFMADDSUB231PD, 3, {XMMREG,XMMREG,RM_XMM|BITS128,0,0}, nasm_bytecodes+12346, IF_FMA|IF_FUTURE},
+    {I_VFMADDSUB231PD, 3, {YMMREG,YMMREG,RM_YMM|BITS256,0,0}, nasm_bytecodes+12353, IF_FMA|IF_FUTURE},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VFMADDSUB231PS[] = {
+    {I_VFMADDSUB231PS, 3, {XMMREG,XMMREG,RM_XMM|BITS128,0,0}, nasm_bytecodes+12332, IF_FMA|IF_FUTURE},
+    {I_VFMADDSUB231PS, 3, {YMMREG,YMMREG,RM_YMM|BITS256,0,0}, nasm_bytecodes+12339, IF_FMA|IF_FUTURE},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VFMADDSUB312PD[] = {
+    {I_VFMADDSUB312PD, 3, {XMMREG,XMMREG,RM_XMM|BITS128,0,0}, nasm_bytecodes+12290, IF_FMA|IF_FUTURE},
+    {I_VFMADDSUB312PD, 3, {YMMREG,YMMREG,RM_YMM|BITS256,0,0}, nasm_bytecodes+12297, IF_FMA|IF_FUTURE},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VFMADDSUB312PS[] = {
+    {I_VFMADDSUB312PS, 3, {XMMREG,XMMREG,RM_XMM|BITS128,0,0}, nasm_bytecodes+12276, IF_FMA|IF_FUTURE},
+    {I_VFMADDSUB312PS, 3, {YMMREG,YMMREG,RM_YMM|BITS256,0,0}, nasm_bytecodes+12283, IF_FMA|IF_FUTURE},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VFMADDSUB321PD[] = {
+    {I_VFMADDSUB321PD, 3, {XMMREG,XMMREG,RM_XMM|BITS128,0,0}, nasm_bytecodes+12346, IF_FMA|IF_FUTURE},
+    {I_VFMADDSUB321PD, 3, {YMMREG,YMMREG,RM_YMM|BITS256,0,0}, nasm_bytecodes+12353, IF_FMA|IF_FUTURE},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VFMADDSUB321PS[] = {
+    {I_VFMADDSUB321PS, 3, {XMMREG,XMMREG,RM_XMM|BITS128,0,0}, nasm_bytecodes+12332, IF_FMA|IF_FUTURE},
+    {I_VFMADDSUB321PS, 3, {YMMREG,YMMREG,RM_YMM|BITS256,0,0}, nasm_bytecodes+12339, IF_FMA|IF_FUTURE},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VFMADDSUBPD[] = {
+    {I_VFMADDSUBPD, 4, {XMMREG,XMMREG,RM_XMM|BITS128,XMMREG,0}, nasm_bytecodes+4176, IF_AMD|IF_SSE5},
+    {I_VFMADDSUBPD, 3, {XMMREG,RM_XMM|BITS128,XMMREG,0,0}, nasm_bytecodes+4185, IF_AMD|IF_SSE5},
+    {I_VFMADDSUBPD, 4, {YMMREG,YMMREG,RM_YMM|BITS256,YMMREG,0}, nasm_bytecodes+4194, IF_AMD|IF_SSE5},
+    {I_VFMADDSUBPD, 3, {YMMREG,RM_YMM|BITS256,YMMREG,0,0}, nasm_bytecodes+4203, IF_AMD|IF_SSE5},
+    {I_VFMADDSUBPD, 4, {XMMREG,XMMREG,XMMREG,RM_XMM|BITS128,0}, nasm_bytecodes+4212, IF_AMD|IF_SSE5},
+    {I_VFMADDSUBPD, 3, {XMMREG,XMMREG,RM_XMM|BITS128,0,0}, nasm_bytecodes+4221, IF_AMD|IF_SSE5},
+    {I_VFMADDSUBPD, 4, {YMMREG,YMMREG,YMMREG,RM_YMM|BITS256,0}, nasm_bytecodes+4230, IF_AMD|IF_SSE5},
+    {I_VFMADDSUBPD, 3, {YMMREG,YMMREG,RM_YMM|BITS256,0,0}, nasm_bytecodes+4239, IF_AMD|IF_SSE5},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VFMADDSUBPS[] = {
+    {I_VFMADDSUBPS, 4, {XMMREG,XMMREG,RM_XMM|BITS128,XMMREG,0}, nasm_bytecodes+4248, IF_AMD|IF_SSE5},
+    {I_VFMADDSUBPS, 3, {XMMREG,RM_XMM|BITS128,XMMREG,0,0}, nasm_bytecodes+4257, IF_AMD|IF_SSE5},
+    {I_VFMADDSUBPS, 4, {YMMREG,YMMREG,RM_YMM|BITS256,YMMREG,0}, nasm_bytecodes+4266, IF_AMD|IF_SSE5},
+    {I_VFMADDSUBPS, 3, {YMMREG,RM_YMM|BITS256,YMMREG,0,0}, nasm_bytecodes+4275, IF_AMD|IF_SSE5},
+    {I_VFMADDSUBPS, 4, {XMMREG,XMMREG,XMMREG,RM_XMM|BITS128,0}, nasm_bytecodes+4284, IF_AMD|IF_SSE5},
+    {I_VFMADDSUBPS, 3, {XMMREG,XMMREG,RM_XMM|BITS128,0,0}, nasm_bytecodes+4293, IF_AMD|IF_SSE5},
+    {I_VFMADDSUBPS, 4, {YMMREG,YMMREG,YMMREG,RM_YMM|BITS256,0}, nasm_bytecodes+4302, IF_AMD|IF_SSE5},
+    {I_VFMADDSUBPS, 3, {YMMREG,YMMREG,RM_YMM|BITS256,0,0}, nasm_bytecodes+4311, IF_AMD|IF_SSE5},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VFMSUB123PD[] = {
+    {I_VFMSUB123PD, 3, {XMMREG,XMMREG,RM_XMM|BITS128,0,0}, nasm_bytecodes+12402, IF_FMA|IF_FUTURE},
+    {I_VFMSUB123PD, 3, {YMMREG,YMMREG,RM_YMM|BITS256,0,0}, nasm_bytecodes+12409, IF_FMA|IF_FUTURE},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VFMSUB123PS[] = {
+    {I_VFMSUB123PS, 3, {XMMREG,XMMREG,RM_XMM|BITS128,0,0}, nasm_bytecodes+12388, IF_FMA|IF_FUTURE},
+    {I_VFMSUB123PS, 3, {YMMREG,YMMREG,RM_YMM|BITS256,0,0}, nasm_bytecodes+12395, IF_FMA|IF_FUTURE},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VFMSUB123SD[] = {
+    {I_VFMSUB123SD, 3, {XMMREG,XMMREG,RM_XMM|BITS64,0,0}, nasm_bytecodes+12759, IF_FMA|IF_FUTURE},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VFMSUB123SS[] = {
+    {I_VFMSUB123SS, 3, {XMMREG,XMMREG,RM_XMM|BITS32,0,0}, nasm_bytecodes+12752, IF_FMA|IF_FUTURE},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VFMSUB132PD[] = {
+    {I_VFMSUB132PD, 3, {XMMREG,XMMREG,RM_XMM|BITS128,0,0}, nasm_bytecodes+12374, IF_FMA|IF_FUTURE},
+    {I_VFMSUB132PD, 3, {YMMREG,YMMREG,RM_YMM|BITS256,0,0}, nasm_bytecodes+12381, IF_FMA|IF_FUTURE},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VFMSUB132PS[] = {
+    {I_VFMSUB132PS, 3, {XMMREG,XMMREG,RM_XMM|BITS128,0,0}, nasm_bytecodes+12360, IF_FMA|IF_FUTURE},
+    {I_VFMSUB132PS, 3, {YMMREG,YMMREG,RM_YMM|BITS256,0,0}, nasm_bytecodes+12367, IF_FMA|IF_FUTURE},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VFMSUB132SD[] = {
+    {I_VFMSUB132SD, 3, {XMMREG,XMMREG,RM_XMM|BITS64,0,0}, nasm_bytecodes+12745, IF_FMA|IF_FUTURE},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VFMSUB132SS[] = {
+    {I_VFMSUB132SS, 3, {XMMREG,XMMREG,RM_XMM|BITS32,0,0}, nasm_bytecodes+12738, IF_FMA|IF_FUTURE},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VFMSUB213PD[] = {
+    {I_VFMSUB213PD, 3, {XMMREG,XMMREG,RM_XMM|BITS128,0,0}, nasm_bytecodes+12402, IF_FMA|IF_FUTURE},
+    {I_VFMSUB213PD, 3, {YMMREG,YMMREG,RM_YMM|BITS256,0,0}, nasm_bytecodes+12409, IF_FMA|IF_FUTURE},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VFMSUB213PS[] = {
+    {I_VFMSUB213PS, 3, {XMMREG,XMMREG,RM_XMM|BITS128,0,0}, nasm_bytecodes+12388, IF_FMA|IF_FUTURE},
+    {I_VFMSUB213PS, 3, {YMMREG,YMMREG,RM_YMM|BITS256,0,0}, nasm_bytecodes+12395, IF_FMA|IF_FUTURE},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VFMSUB213SD[] = {
+    {I_VFMSUB213SD, 3, {XMMREG,XMMREG,RM_XMM|BITS64,0,0}, nasm_bytecodes+12759, IF_FMA|IF_FUTURE},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VFMSUB213SS[] = {
+    {I_VFMSUB213SS, 3, {XMMREG,XMMREG,RM_XMM|BITS32,0,0}, nasm_bytecodes+12752, IF_FMA|IF_FUTURE},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VFMSUB231PD[] = {
+    {I_VFMSUB231PD, 3, {XMMREG,XMMREG,RM_XMM|BITS128,0,0}, nasm_bytecodes+12430, IF_FMA|IF_FUTURE},
+    {I_VFMSUB231PD, 3, {YMMREG,YMMREG,RM_YMM|BITS256,0,0}, nasm_bytecodes+12437, IF_FMA|IF_FUTURE},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VFMSUB231PS[] = {
+    {I_VFMSUB231PS, 3, {XMMREG,XMMREG,RM_XMM|BITS128,0,0}, nasm_bytecodes+12416, IF_FMA|IF_FUTURE},
+    {I_VFMSUB231PS, 3, {YMMREG,YMMREG,RM_YMM|BITS256,0,0}, nasm_bytecodes+12423, IF_FMA|IF_FUTURE},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VFMSUB231SD[] = {
+    {I_VFMSUB231SD, 3, {XMMREG,XMMREG,RM_XMM|BITS64,0,0}, nasm_bytecodes+12773, IF_FMA|IF_FUTURE},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VFMSUB231SS[] = {
+    {I_VFMSUB231SS, 3, {XMMREG,XMMREG,RM_XMM|BITS32,0,0}, nasm_bytecodes+12766, IF_FMA|IF_FUTURE},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VFMSUB312PD[] = {
+    {I_VFMSUB312PD, 3, {XMMREG,XMMREG,RM_XMM|BITS128,0,0}, nasm_bytecodes+12374, IF_FMA|IF_FUTURE},
+    {I_VFMSUB312PD, 3, {YMMREG,YMMREG,RM_YMM|BITS256,0,0}, nasm_bytecodes+12381, IF_FMA|IF_FUTURE},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VFMSUB312PS[] = {
+    {I_VFMSUB312PS, 3, {XMMREG,XMMREG,RM_XMM|BITS128,0,0}, nasm_bytecodes+12360, IF_FMA|IF_FUTURE},
+    {I_VFMSUB312PS, 3, {YMMREG,YMMREG,RM_YMM|BITS256,0,0}, nasm_bytecodes+12367, IF_FMA|IF_FUTURE},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VFMSUB312SD[] = {
+    {I_VFMSUB312SD, 3, {XMMREG,XMMREG,RM_XMM|BITS64,0,0}, nasm_bytecodes+12745, IF_FMA|IF_FUTURE},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VFMSUB312SS[] = {
+    {I_VFMSUB312SS, 3, {XMMREG,XMMREG,RM_XMM|BITS32,0,0}, nasm_bytecodes+12738, IF_FMA|IF_FUTURE},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VFMSUB321PD[] = {
+    {I_VFMSUB321PD, 3, {XMMREG,XMMREG,RM_XMM|BITS128,0,0}, nasm_bytecodes+12430, IF_FMA|IF_FUTURE},
+    {I_VFMSUB321PD, 3, {YMMREG,YMMREG,RM_YMM|BITS256,0,0}, nasm_bytecodes+12437, IF_FMA|IF_FUTURE},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VFMSUB321PS[] = {
+    {I_VFMSUB321PS, 3, {XMMREG,XMMREG,RM_XMM|BITS128,0,0}, nasm_bytecodes+12416, IF_FMA|IF_FUTURE},
+    {I_VFMSUB321PS, 3, {YMMREG,YMMREG,RM_YMM|BITS256,0,0}, nasm_bytecodes+12423, IF_FMA|IF_FUTURE},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VFMSUB321SD[] = {
+    {I_VFMSUB321SD, 3, {XMMREG,XMMREG,RM_XMM|BITS64,0,0}, nasm_bytecodes+12773, IF_FMA|IF_FUTURE},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VFMSUB321SS[] = {
+    {I_VFMSUB321SS, 3, {XMMREG,XMMREG,RM_XMM|BITS32,0,0}, nasm_bytecodes+12766, IF_FMA|IF_FUTURE},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VFMSUBADD123PD[] = {
+    {I_VFMSUBADD123PD, 3, {XMMREG,XMMREG,RM_XMM|BITS128,0,0}, nasm_bytecodes+12486, IF_FMA|IF_FUTURE},
+    {I_VFMSUBADD123PD, 3, {YMMREG,YMMREG,RM_YMM|BITS256,0,0}, nasm_bytecodes+12493, IF_FMA|IF_FUTURE},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VFMSUBADD123PS[] = {
+    {I_VFMSUBADD123PS, 3, {XMMREG,XMMREG,RM_XMM|BITS128,0,0}, nasm_bytecodes+12472, IF_FMA|IF_FUTURE},
+    {I_VFMSUBADD123PS, 3, {YMMREG,YMMREG,RM_YMM|BITS256,0,0}, nasm_bytecodes+12479, IF_FMA|IF_FUTURE},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VFMSUBADD132PD[] = {
+    {I_VFMSUBADD132PD, 3, {XMMREG,XMMREG,RM_XMM|BITS128,0,0}, nasm_bytecodes+12458, IF_FMA|IF_FUTURE},
+    {I_VFMSUBADD132PD, 3, {YMMREG,YMMREG,RM_YMM|BITS256,0,0}, nasm_bytecodes+12465, IF_FMA|IF_FUTURE},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VFMSUBADD132PS[] = {
+    {I_VFMSUBADD132PS, 3, {XMMREG,XMMREG,RM_XMM|BITS128,0,0}, nasm_bytecodes+12444, IF_FMA|IF_FUTURE},
+    {I_VFMSUBADD132PS, 3, {YMMREG,YMMREG,RM_YMM|BITS256,0,0}, nasm_bytecodes+12451, IF_FMA|IF_FUTURE},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VFMSUBADD213PD[] = {
+    {I_VFMSUBADD213PD, 3, {XMMREG,XMMREG,RM_XMM|BITS128,0,0}, nasm_bytecodes+12486, IF_FMA|IF_FUTURE},
+    {I_VFMSUBADD213PD, 3, {YMMREG,YMMREG,RM_YMM|BITS256,0,0}, nasm_bytecodes+12493, IF_FMA|IF_FUTURE},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VFMSUBADD213PS[] = {
+    {I_VFMSUBADD213PS, 3, {XMMREG,XMMREG,RM_XMM|BITS128,0,0}, nasm_bytecodes+12472, IF_FMA|IF_FUTURE},
+    {I_VFMSUBADD213PS, 3, {YMMREG,YMMREG,RM_YMM|BITS256,0,0}, nasm_bytecodes+12479, IF_FMA|IF_FUTURE},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VFMSUBADD231PD[] = {
+    {I_VFMSUBADD231PD, 3, {XMMREG,XMMREG,RM_XMM|BITS128,0,0}, nasm_bytecodes+12514, IF_FMA|IF_FUTURE},
+    {I_VFMSUBADD231PD, 3, {YMMREG,YMMREG,RM_YMM|BITS256,0,0}, nasm_bytecodes+12521, IF_FMA|IF_FUTURE},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VFMSUBADD231PS[] = {
+    {I_VFMSUBADD231PS, 3, {XMMREG,XMMREG,RM_XMM|BITS128,0,0}, nasm_bytecodes+12500, IF_FMA|IF_FUTURE},
+    {I_VFMSUBADD231PS, 3, {YMMREG,YMMREG,RM_YMM|BITS256,0,0}, nasm_bytecodes+12507, IF_FMA|IF_FUTURE},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VFMSUBADD312PD[] = {
+    {I_VFMSUBADD312PD, 3, {XMMREG,XMMREG,RM_XMM|BITS128,0,0}, nasm_bytecodes+12458, IF_FMA|IF_FUTURE},
+    {I_VFMSUBADD312PD, 3, {YMMREG,YMMREG,RM_YMM|BITS256,0,0}, nasm_bytecodes+12465, IF_FMA|IF_FUTURE},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VFMSUBADD312PS[] = {
+    {I_VFMSUBADD312PS, 3, {XMMREG,XMMREG,RM_XMM|BITS128,0,0}, nasm_bytecodes+12444, IF_FMA|IF_FUTURE},
+    {I_VFMSUBADD312PS, 3, {YMMREG,YMMREG,RM_YMM|BITS256,0,0}, nasm_bytecodes+12451, IF_FMA|IF_FUTURE},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VFMSUBADD321PD[] = {
+    {I_VFMSUBADD321PD, 3, {XMMREG,XMMREG,RM_XMM|BITS128,0,0}, nasm_bytecodes+12514, IF_FMA|IF_FUTURE},
+    {I_VFMSUBADD321PD, 3, {YMMREG,YMMREG,RM_YMM|BITS256,0,0}, nasm_bytecodes+12521, IF_FMA|IF_FUTURE},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VFMSUBADD321PS[] = {
+    {I_VFMSUBADD321PS, 3, {XMMREG,XMMREG,RM_XMM|BITS128,0,0}, nasm_bytecodes+12500, IF_FMA|IF_FUTURE},
+    {I_VFMSUBADD321PS, 3, {YMMREG,YMMREG,RM_YMM|BITS256,0,0}, nasm_bytecodes+12507, IF_FMA|IF_FUTURE},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VFMSUBADDPD[] = {
+    {I_VFMSUBADDPD, 4, {XMMREG,XMMREG,RM_XMM|BITS128,XMMREG,0}, nasm_bytecodes+4320, IF_AMD|IF_SSE5},
+    {I_VFMSUBADDPD, 3, {XMMREG,RM_XMM|BITS128,XMMREG,0,0}, nasm_bytecodes+4329, IF_AMD|IF_SSE5},
+    {I_VFMSUBADDPD, 4, {YMMREG,YMMREG,RM_YMM|BITS256,YMMREG,0}, nasm_bytecodes+4338, IF_AMD|IF_SSE5},
+    {I_VFMSUBADDPD, 3, {YMMREG,RM_YMM|BITS256,YMMREG,0,0}, nasm_bytecodes+4347, IF_AMD|IF_SSE5},
+    {I_VFMSUBADDPD, 4, {XMMREG,XMMREG,XMMREG,RM_XMM|BITS128,0}, nasm_bytecodes+4356, IF_AMD|IF_SSE5},
+    {I_VFMSUBADDPD, 3, {XMMREG,XMMREG,RM_XMM|BITS128,0,0}, nasm_bytecodes+4365, IF_AMD|IF_SSE5},
+    {I_VFMSUBADDPD, 4, {YMMREG,YMMREG,YMMREG,RM_YMM|BITS256,0}, nasm_bytecodes+4374, IF_AMD|IF_SSE5},
+    {I_VFMSUBADDPD, 3, {YMMREG,YMMREG,RM_YMM|BITS256,0,0}, nasm_bytecodes+4383, IF_AMD|IF_SSE5},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VFMSUBADDPS[] = {
+    {I_VFMSUBADDPS, 4, {XMMREG,XMMREG,RM_XMM|BITS128,XMMREG,0}, nasm_bytecodes+4392, IF_AMD|IF_SSE5},
+    {I_VFMSUBADDPS, 3, {XMMREG,RM_XMM|BITS128,XMMREG,0,0}, nasm_bytecodes+4401, IF_AMD|IF_SSE5},
+    {I_VFMSUBADDPS, 4, {YMMREG,YMMREG,RM_YMM|BITS256,YMMREG,0}, nasm_bytecodes+4410, IF_AMD|IF_SSE5},
+    {I_VFMSUBADDPS, 3, {YMMREG,RM_YMM|BITS256,YMMREG,0,0}, nasm_bytecodes+4419, IF_AMD|IF_SSE5},
+    {I_VFMSUBADDPS, 4, {XMMREG,XMMREG,XMMREG,RM_XMM|BITS128,0}, nasm_bytecodes+4428, IF_AMD|IF_SSE5},
+    {I_VFMSUBADDPS, 3, {XMMREG,XMMREG,RM_XMM|BITS128,0,0}, nasm_bytecodes+4437, IF_AMD|IF_SSE5},
+    {I_VFMSUBADDPS, 4, {YMMREG,YMMREG,YMMREG,RM_YMM|BITS256,0}, nasm_bytecodes+4446, IF_AMD|IF_SSE5},
+    {I_VFMSUBADDPS, 3, {YMMREG,YMMREG,RM_YMM|BITS256,0,0}, nasm_bytecodes+4455, IF_AMD|IF_SSE5},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VFMSUBPD[] = {
+    {I_VFMSUBPD, 4, {XMMREG,XMMREG,RM_XMM|BITS128,XMMREG,0}, nasm_bytecodes+4464, IF_AMD|IF_SSE5},
+    {I_VFMSUBPD, 3, {XMMREG,RM_XMM|BITS128,XMMREG,0,0}, nasm_bytecodes+4473, IF_AMD|IF_SSE5},
+    {I_VFMSUBPD, 4, {YMMREG,YMMREG,RM_YMM|BITS256,YMMREG,0}, nasm_bytecodes+4482, IF_AMD|IF_SSE5},
+    {I_VFMSUBPD, 3, {YMMREG,RM_YMM|BITS256,YMMREG,0,0}, nasm_bytecodes+4491, IF_AMD|IF_SSE5},
+    {I_VFMSUBPD, 4, {XMMREG,XMMREG,XMMREG,RM_XMM|BITS128,0}, nasm_bytecodes+4500, IF_AMD|IF_SSE5},
+    {I_VFMSUBPD, 3, {XMMREG,XMMREG,RM_XMM|BITS128,0,0}, nasm_bytecodes+4509, IF_AMD|IF_SSE5},
+    {I_VFMSUBPD, 4, {YMMREG,YMMREG,YMMREG,RM_YMM|BITS256,0}, nasm_bytecodes+4518, IF_AMD|IF_SSE5},
+    {I_VFMSUBPD, 3, {YMMREG,YMMREG,RM_YMM|BITS256,0,0}, nasm_bytecodes+4527, IF_AMD|IF_SSE5},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VFMSUBPS[] = {
+    {I_VFMSUBPS, 4, {XMMREG,XMMREG,RM_XMM|BITS128,XMMREG,0}, nasm_bytecodes+4536, IF_AMD|IF_SSE5},
+    {I_VFMSUBPS, 3, {XMMREG,RM_XMM|BITS128,XMMREG,0,0}, nasm_bytecodes+4545, IF_AMD|IF_SSE5},
+    {I_VFMSUBPS, 4, {YMMREG,YMMREG,RM_YMM|BITS256,YMMREG,0}, nasm_bytecodes+4554, IF_AMD|IF_SSE5},
+    {I_VFMSUBPS, 3, {YMMREG,RM_YMM|BITS256,YMMREG,0,0}, nasm_bytecodes+4563, IF_AMD|IF_SSE5},
+    {I_VFMSUBPS, 4, {XMMREG,XMMREG,XMMREG,RM_XMM|BITS128,0}, nasm_bytecodes+4572, IF_AMD|IF_SSE5},
+    {I_VFMSUBPS, 3, {XMMREG,XMMREG,RM_XMM|BITS128,0,0}, nasm_bytecodes+4581, IF_AMD|IF_SSE5},
+    {I_VFMSUBPS, 4, {YMMREG,YMMREG,YMMREG,RM_YMM|BITS256,0}, nasm_bytecodes+4590, IF_AMD|IF_SSE5},
+    {I_VFMSUBPS, 3, {YMMREG,YMMREG,RM_YMM|BITS256,0,0}, nasm_bytecodes+4599, IF_AMD|IF_SSE5},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VFMSUBSD[] = {
+    {I_VFMSUBSD, 4, {XMMREG,XMMREG,RM_XMM|BITS64,XMMREG,0}, nasm_bytecodes+4608, IF_AMD|IF_SSE5},
+    {I_VFMSUBSD, 3, {XMMREG,RM_XMM|BITS64,XMMREG,0,0}, nasm_bytecodes+4617, IF_AMD|IF_SSE5},
+    {I_VFMSUBSD, 4, {XMMREG,XMMREG,XMMREG,RM_XMM|BITS64,0}, nasm_bytecodes+4626, IF_AMD|IF_SSE5},
+    {I_VFMSUBSD, 3, {XMMREG,XMMREG,RM_XMM|BITS64,0,0}, nasm_bytecodes+4635, IF_AMD|IF_SSE5},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VFMSUBSS[] = {
+    {I_VFMSUBSS, 4, {XMMREG,XMMREG,RM_XMM|BITS32,XMMREG,0}, nasm_bytecodes+4644, IF_AMD|IF_SSE5},
+    {I_VFMSUBSS, 3, {XMMREG,RM_XMM|BITS32,XMMREG,0,0}, nasm_bytecodes+4653, IF_AMD|IF_SSE5},
+    {I_VFMSUBSS, 4, {XMMREG,XMMREG,XMMREG,RM_XMM|BITS32,0}, nasm_bytecodes+4662, IF_AMD|IF_SSE5},
+    {I_VFMSUBSS, 3, {XMMREG,XMMREG,RM_XMM|BITS32,0,0}, nasm_bytecodes+4671, IF_AMD|IF_SSE5},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VFNMADD123PD[] = {
+    {I_VFNMADD123PD, 3, {XMMREG,XMMREG,RM_XMM|BITS128,0,0}, nasm_bytecodes+12570, IF_FMA|IF_FUTURE},
+    {I_VFNMADD123PD, 3, {YMMREG,YMMREG,RM_YMM|BITS256,0,0}, nasm_bytecodes+12577, IF_FMA|IF_FUTURE},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VFNMADD123PS[] = {
+    {I_VFNMADD123PS, 3, {XMMREG,XMMREG,RM_XMM|BITS128,0,0}, nasm_bytecodes+12556, IF_FMA|IF_FUTURE},
+    {I_VFNMADD123PS, 3, {YMMREG,YMMREG,RM_YMM|BITS256,0,0}, nasm_bytecodes+12563, IF_FMA|IF_FUTURE},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VFNMADD123SD[] = {
+    {I_VFNMADD123SD, 3, {XMMREG,XMMREG,RM_XMM|BITS64,0,0}, nasm_bytecodes+12801, IF_FMA|IF_FUTURE},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VFNMADD123SS[] = {
+    {I_VFNMADD123SS, 3, {XMMREG,XMMREG,RM_XMM|BITS32,0,0}, nasm_bytecodes+12794, IF_FMA|IF_FUTURE},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VFNMADD132PD[] = {
+    {I_VFNMADD132PD, 3, {XMMREG,XMMREG,RM_XMM|BITS128,0,0}, nasm_bytecodes+12542, IF_FMA|IF_FUTURE},
+    {I_VFNMADD132PD, 3, {YMMREG,YMMREG,RM_YMM|BITS256,0,0}, nasm_bytecodes+12549, IF_FMA|IF_FUTURE},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VFNMADD132PS[] = {
+    {I_VFNMADD132PS, 3, {XMMREG,XMMREG,RM_XMM|BITS128,0,0}, nasm_bytecodes+12528, IF_FMA|IF_FUTURE},
+    {I_VFNMADD132PS, 3, {YMMREG,YMMREG,RM_YMM|BITS256,0,0}, nasm_bytecodes+12535, IF_FMA|IF_FUTURE},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VFNMADD132SD[] = {
+    {I_VFNMADD132SD, 3, {XMMREG,XMMREG,RM_XMM|BITS64,0,0}, nasm_bytecodes+12787, IF_FMA|IF_FUTURE},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VFNMADD132SS[] = {
+    {I_VFNMADD132SS, 3, {XMMREG,XMMREG,RM_XMM|BITS32,0,0}, nasm_bytecodes+12780, IF_FMA|IF_FUTURE},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VFNMADD213PD[] = {
+    {I_VFNMADD213PD, 3, {XMMREG,XMMREG,RM_XMM|BITS128,0,0}, nasm_bytecodes+12570, IF_FMA|IF_FUTURE},
+    {I_VFNMADD213PD, 3, {YMMREG,YMMREG,RM_YMM|BITS256,0,0}, nasm_bytecodes+12577, IF_FMA|IF_FUTURE},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VFNMADD213PS[] = {
+    {I_VFNMADD213PS, 3, {XMMREG,XMMREG,RM_XMM|BITS128,0,0}, nasm_bytecodes+12556, IF_FMA|IF_FUTURE},
+    {I_VFNMADD213PS, 3, {YMMREG,YMMREG,RM_YMM|BITS256,0,0}, nasm_bytecodes+12563, IF_FMA|IF_FUTURE},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VFNMADD213SD[] = {
+    {I_VFNMADD213SD, 3, {XMMREG,XMMREG,RM_XMM|BITS64,0,0}, nasm_bytecodes+12801, IF_FMA|IF_FUTURE},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VFNMADD213SS[] = {
+    {I_VFNMADD213SS, 3, {XMMREG,XMMREG,RM_XMM|BITS32,0,0}, nasm_bytecodes+12794, IF_FMA|IF_FUTURE},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VFNMADD231PD[] = {
+    {I_VFNMADD231PD, 3, {XMMREG,XMMREG,RM_XMM|BITS128,0,0}, nasm_bytecodes+12598, IF_FMA|IF_FUTURE},
+    {I_VFNMADD231PD, 3, {YMMREG,YMMREG,RM_YMM|BITS256,0,0}, nasm_bytecodes+12605, IF_FMA|IF_FUTURE},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VFNMADD231PS[] = {
+    {I_VFNMADD231PS, 3, {XMMREG,XMMREG,RM_XMM|BITS128,0,0}, nasm_bytecodes+12584, IF_FMA|IF_FUTURE},
+    {I_VFNMADD231PS, 3, {YMMREG,YMMREG,RM_YMM|BITS256,0,0}, nasm_bytecodes+12591, IF_FMA|IF_FUTURE},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VFNMADD231SD[] = {
+    {I_VFNMADD231SD, 3, {XMMREG,XMMREG,RM_XMM|BITS64,0,0}, nasm_bytecodes+12815, IF_FMA|IF_FUTURE},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VFNMADD231SS[] = {
+    {I_VFNMADD231SS, 3, {XMMREG,XMMREG,RM_XMM|BITS32,0,0}, nasm_bytecodes+12808, IF_FMA|IF_FUTURE},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VFNMADD312PD[] = {
+    {I_VFNMADD312PD, 3, {XMMREG,XMMREG,RM_XMM|BITS128,0,0}, nasm_bytecodes+12542, IF_FMA|IF_FUTURE},
+    {I_VFNMADD312PD, 3, {YMMREG,YMMREG,RM_YMM|BITS256,0,0}, nasm_bytecodes+12549, IF_FMA|IF_FUTURE},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VFNMADD312PS[] = {
+    {I_VFNMADD312PS, 3, {XMMREG,XMMREG,RM_XMM|BITS128,0,0}, nasm_bytecodes+12528, IF_FMA|IF_FUTURE},
+    {I_VFNMADD312PS, 3, {YMMREG,YMMREG,RM_YMM|BITS256,0,0}, nasm_bytecodes+12535, IF_FMA|IF_FUTURE},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VFNMADD312SD[] = {
+    {I_VFNMADD312SD, 3, {XMMREG,XMMREG,RM_XMM|BITS64,0,0}, nasm_bytecodes+12787, IF_FMA|IF_FUTURE},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VFNMADD312SS[] = {
+    {I_VFNMADD312SS, 3, {XMMREG,XMMREG,RM_XMM|BITS32,0,0}, nasm_bytecodes+12780, IF_FMA|IF_FUTURE},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VFNMADD321PD[] = {
+    {I_VFNMADD321PD, 3, {XMMREG,XMMREG,RM_XMM|BITS128,0,0}, nasm_bytecodes+12598, IF_FMA|IF_FUTURE},
+    {I_VFNMADD321PD, 3, {YMMREG,YMMREG,RM_YMM|BITS256,0,0}, nasm_bytecodes+12605, IF_FMA|IF_FUTURE},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VFNMADD321PS[] = {
+    {I_VFNMADD321PS, 3, {XMMREG,XMMREG,RM_XMM|BITS128,0,0}, nasm_bytecodes+12584, IF_FMA|IF_FUTURE},
+    {I_VFNMADD321PS, 3, {YMMREG,YMMREG,RM_YMM|BITS256,0,0}, nasm_bytecodes+12591, IF_FMA|IF_FUTURE},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VFNMADD321SD[] = {
+    {I_VFNMADD321SD, 3, {XMMREG,XMMREG,RM_XMM|BITS64,0,0}, nasm_bytecodes+12815, IF_FMA|IF_FUTURE},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VFNMADD321SS[] = {
+    {I_VFNMADD321SS, 3, {XMMREG,XMMREG,RM_XMM|BITS32,0,0}, nasm_bytecodes+12808, IF_FMA|IF_FUTURE},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VFNMADDPD[] = {
+    {I_VFNMADDPD, 4, {XMMREG,XMMREG,RM_XMM|BITS128,XMMREG,0}, nasm_bytecodes+4680, IF_AMD|IF_SSE5},
+    {I_VFNMADDPD, 3, {XMMREG,RM_XMM|BITS128,XMMREG,0,0}, nasm_bytecodes+4689, IF_AMD|IF_SSE5},
+    {I_VFNMADDPD, 4, {YMMREG,YMMREG,RM_YMM|BITS256,YMMREG,0}, nasm_bytecodes+4698, IF_AMD|IF_SSE5},
+    {I_VFNMADDPD, 3, {YMMREG,RM_YMM|BITS256,YMMREG,0,0}, nasm_bytecodes+4707, IF_AMD|IF_SSE5},
+    {I_VFNMADDPD, 4, {XMMREG,XMMREG,XMMREG,RM_XMM|BITS128,0}, nasm_bytecodes+4716, IF_AMD|IF_SSE5},
+    {I_VFNMADDPD, 3, {XMMREG,XMMREG,RM_XMM|BITS128,0,0}, nasm_bytecodes+4725, IF_AMD|IF_SSE5},
+    {I_VFNMADDPD, 4, {YMMREG,YMMREG,YMMREG,RM_YMM|BITS256,0}, nasm_bytecodes+4734, IF_AMD|IF_SSE5},
+    {I_VFNMADDPD, 3, {YMMREG,YMMREG,RM_YMM|BITS256,0,0}, nasm_bytecodes+4743, IF_AMD|IF_SSE5},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VFNMADDPS[] = {
+    {I_VFNMADDPS, 4, {XMMREG,XMMREG,RM_XMM|BITS128,XMMREG,0}, nasm_bytecodes+4752, IF_AMD|IF_SSE5},
+    {I_VFNMADDPS, 3, {XMMREG,RM_XMM|BITS128,XMMREG,0,0}, nasm_bytecodes+4761, IF_AMD|IF_SSE5},
+    {I_VFNMADDPS, 4, {YMMREG,YMMREG,RM_YMM|BITS256,YMMREG,0}, nasm_bytecodes+4770, IF_AMD|IF_SSE5},
+    {I_VFNMADDPS, 3, {YMMREG,RM_YMM|BITS256,YMMREG,0,0}, nasm_bytecodes+4779, IF_AMD|IF_SSE5},
+    {I_VFNMADDPS, 4, {XMMREG,XMMREG,XMMREG,RM_XMM|BITS128,0}, nasm_bytecodes+4788, IF_AMD|IF_SSE5},
+    {I_VFNMADDPS, 3, {XMMREG,XMMREG,RM_XMM|BITS128,0,0}, nasm_bytecodes+4797, IF_AMD|IF_SSE5},
+    {I_VFNMADDPS, 4, {YMMREG,YMMREG,YMMREG,RM_YMM|BITS256,0}, nasm_bytecodes+4806, IF_AMD|IF_SSE5},
+    {I_VFNMADDPS, 3, {YMMREG,YMMREG,RM_YMM|BITS256,0,0}, nasm_bytecodes+4815, IF_AMD|IF_SSE5},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VFNMADDSD[] = {
+    {I_VFNMADDSD, 4, {XMMREG,XMMREG,RM_XMM|BITS64,XMMREG,0}, nasm_bytecodes+4824, IF_AMD|IF_SSE5},
+    {I_VFNMADDSD, 3, {XMMREG,RM_XMM|BITS64,XMMREG,0,0}, nasm_bytecodes+4833, IF_AMD|IF_SSE5},
+    {I_VFNMADDSD, 4, {XMMREG,XMMREG,XMMREG,RM_XMM|BITS64,0}, nasm_bytecodes+4842, IF_AMD|IF_SSE5},
+    {I_VFNMADDSD, 3, {XMMREG,XMMREG,RM_XMM|BITS64,0,0}, nasm_bytecodes+4851, IF_AMD|IF_SSE5},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VFNMADDSS[] = {
+    {I_VFNMADDSS, 4, {XMMREG,XMMREG,RM_XMM|BITS32,XMMREG,0}, nasm_bytecodes+4860, IF_AMD|IF_SSE5},
+    {I_VFNMADDSS, 3, {XMMREG,RM_XMM|BITS32,XMMREG,0,0}, nasm_bytecodes+4869, IF_AMD|IF_SSE5},
+    {I_VFNMADDSS, 4, {XMMREG,XMMREG,XMMREG,RM_XMM|BITS32,0}, nasm_bytecodes+4878, IF_AMD|IF_SSE5},
+    {I_VFNMADDSS, 3, {XMMREG,XMMREG,RM_XMM|BITS32,0,0}, nasm_bytecodes+4887, IF_AMD|IF_SSE5},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VFNMSUB123PD[] = {
+    {I_VFNMSUB123PD, 3, {XMMREG,XMMREG,RM_XMM|BITS128,0,0}, nasm_bytecodes+12654, IF_FMA|IF_FUTURE},
+    {I_VFNMSUB123PD, 3, {YMMREG,YMMREG,RM_YMM|BITS256,0,0}, nasm_bytecodes+12661, IF_FMA|IF_FUTURE},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VFNMSUB123PS[] = {
+    {I_VFNMSUB123PS, 3, {XMMREG,XMMREG,RM_XMM|BITS128,0,0}, nasm_bytecodes+12640, IF_FMA|IF_FUTURE},
+    {I_VFNMSUB123PS, 3, {YMMREG,YMMREG,RM_YMM|BITS256,0,0}, nasm_bytecodes+12647, IF_FMA|IF_FUTURE},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VFNMSUB123SD[] = {
+    {I_VFNMSUB123SD, 3, {XMMREG,XMMREG,RM_XMM|BITS64,0,0}, nasm_bytecodes+12843, IF_FMA|IF_FUTURE},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VFNMSUB123SS[] = {
+    {I_VFNMSUB123SS, 3, {XMMREG,XMMREG,RM_XMM|BITS32,0,0}, nasm_bytecodes+12836, IF_FMA|IF_FUTURE},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VFNMSUB132PD[] = {
+    {I_VFNMSUB132PD, 3, {XMMREG,XMMREG,RM_XMM|BITS128,0,0}, nasm_bytecodes+12626, IF_FMA|IF_FUTURE},
+    {I_VFNMSUB132PD, 3, {YMMREG,YMMREG,RM_YMM|BITS256,0,0}, nasm_bytecodes+12633, IF_FMA|IF_FUTURE},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VFNMSUB132PS[] = {
+    {I_VFNMSUB132PS, 3, {XMMREG,XMMREG,RM_XMM|BITS128,0,0}, nasm_bytecodes+12612, IF_FMA|IF_FUTURE},
+    {I_VFNMSUB132PS, 3, {YMMREG,YMMREG,RM_YMM|BITS256,0,0}, nasm_bytecodes+12619, IF_FMA|IF_FUTURE},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VFNMSUB132SD[] = {
+    {I_VFNMSUB132SD, 3, {XMMREG,XMMREG,RM_XMM|BITS64,0,0}, nasm_bytecodes+12829, IF_FMA|IF_FUTURE},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VFNMSUB132SS[] = {
+    {I_VFNMSUB132SS, 3, {XMMREG,XMMREG,RM_XMM|BITS32,0,0}, nasm_bytecodes+12822, IF_FMA|IF_FUTURE},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VFNMSUB213PD[] = {
+    {I_VFNMSUB213PD, 3, {XMMREG,XMMREG,RM_XMM|BITS128,0,0}, nasm_bytecodes+12654, IF_FMA|IF_FUTURE},
+    {I_VFNMSUB213PD, 3, {YMMREG,YMMREG,RM_YMM|BITS256,0,0}, nasm_bytecodes+12661, IF_FMA|IF_FUTURE},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VFNMSUB213PS[] = {
+    {I_VFNMSUB213PS, 3, {XMMREG,XMMREG,RM_XMM|BITS128,0,0}, nasm_bytecodes+12640, IF_FMA|IF_FUTURE},
+    {I_VFNMSUB213PS, 3, {YMMREG,YMMREG,RM_YMM|BITS256,0,0}, nasm_bytecodes+12647, IF_FMA|IF_FUTURE},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VFNMSUB213SD[] = {
+    {I_VFNMSUB213SD, 3, {XMMREG,XMMREG,RM_XMM|BITS64,0,0}, nasm_bytecodes+12843, IF_FMA|IF_FUTURE},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VFNMSUB213SS[] = {
+    {I_VFNMSUB213SS, 3, {XMMREG,XMMREG,RM_XMM|BITS32,0,0}, nasm_bytecodes+12836, IF_FMA|IF_FUTURE},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VFNMSUB231PD[] = {
+    {I_VFNMSUB231PD, 3, {XMMREG,XMMREG,RM_XMM|BITS128,0,0}, nasm_bytecodes+12682, IF_FMA|IF_FUTURE},
+    {I_VFNMSUB231PD, 3, {YMMREG,YMMREG,RM_YMM|BITS256,0,0}, nasm_bytecodes+12689, IF_FMA|IF_FUTURE},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VFNMSUB231PS[] = {
+    {I_VFNMSUB231PS, 3, {XMMREG,XMMREG,RM_XMM|BITS128,0,0}, nasm_bytecodes+12668, IF_FMA|IF_FUTURE},
+    {I_VFNMSUB231PS, 3, {YMMREG,YMMREG,RM_YMM|BITS256,0,0}, nasm_bytecodes+12675, IF_FMA|IF_FUTURE},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VFNMSUB231SD[] = {
+    {I_VFNMSUB231SD, 3, {XMMREG,XMMREG,RM_XMM|BITS64,0,0}, nasm_bytecodes+12857, IF_FMA|IF_FUTURE},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VFNMSUB231SS[] = {
+    {I_VFNMSUB231SS, 3, {XMMREG,XMMREG,RM_XMM|BITS32,0,0}, nasm_bytecodes+12850, IF_FMA|IF_FUTURE},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VFNMSUB312PD[] = {
+    {I_VFNMSUB312PD, 3, {XMMREG,XMMREG,RM_XMM|BITS128,0,0}, nasm_bytecodes+12626, IF_FMA|IF_FUTURE},
+    {I_VFNMSUB312PD, 3, {YMMREG,YMMREG,RM_YMM|BITS256,0,0}, nasm_bytecodes+12633, IF_FMA|IF_FUTURE},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VFNMSUB312PS[] = {
+    {I_VFNMSUB312PS, 3, {XMMREG,XMMREG,RM_XMM|BITS128,0,0}, nasm_bytecodes+12612, IF_FMA|IF_FUTURE},
+    {I_VFNMSUB312PS, 3, {YMMREG,YMMREG,RM_YMM|BITS256,0,0}, nasm_bytecodes+12619, IF_FMA|IF_FUTURE},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VFNMSUB312SD[] = {
+    {I_VFNMSUB312SD, 3, {XMMREG,XMMREG,RM_XMM|BITS64,0,0}, nasm_bytecodes+12829, IF_FMA|IF_FUTURE},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VFNMSUB312SS[] = {
+    {I_VFNMSUB312SS, 3, {XMMREG,XMMREG,RM_XMM|BITS32,0,0}, nasm_bytecodes+12822, IF_FMA|IF_FUTURE},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VFNMSUB321PD[] = {
+    {I_VFNMSUB321PD, 3, {XMMREG,XMMREG,RM_XMM|BITS128,0,0}, nasm_bytecodes+12682, IF_FMA|IF_FUTURE},
+    {I_VFNMSUB321PD, 3, {YMMREG,YMMREG,RM_YMM|BITS256,0,0}, nasm_bytecodes+12689, IF_FMA|IF_FUTURE},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VFNMSUB321PS[] = {
+    {I_VFNMSUB321PS, 3, {XMMREG,XMMREG,RM_XMM|BITS128,0,0}, nasm_bytecodes+12668, IF_FMA|IF_FUTURE},
+    {I_VFNMSUB321PS, 3, {YMMREG,YMMREG,RM_YMM|BITS256,0,0}, nasm_bytecodes+12675, IF_FMA|IF_FUTURE},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VFNMSUB321SD[] = {
+    {I_VFNMSUB321SD, 3, {XMMREG,XMMREG,RM_XMM|BITS64,0,0}, nasm_bytecodes+12857, IF_FMA|IF_FUTURE},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VFNMSUB321SS[] = {
+    {I_VFNMSUB321SS, 3, {XMMREG,XMMREG,RM_XMM|BITS32,0,0}, nasm_bytecodes+12850, IF_FMA|IF_FUTURE},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VFNMSUBPD[] = {
+    {I_VFNMSUBPD, 4, {XMMREG,XMMREG,RM_XMM|BITS128,XMMREG,0}, nasm_bytecodes+4896, IF_AMD|IF_SSE5},
+    {I_VFNMSUBPD, 3, {XMMREG,RM_XMM|BITS128,XMMREG,0,0}, nasm_bytecodes+4905, IF_AMD|IF_SSE5},
+    {I_VFNMSUBPD, 4, {YMMREG,YMMREG,RM_YMM|BITS256,YMMREG,0}, nasm_bytecodes+4914, IF_AMD|IF_SSE5},
+    {I_VFNMSUBPD, 3, {YMMREG,RM_YMM|BITS256,YMMREG,0,0}, nasm_bytecodes+4923, IF_AMD|IF_SSE5},
+    {I_VFNMSUBPD, 4, {XMMREG,XMMREG,XMMREG,RM_XMM|BITS128,0}, nasm_bytecodes+4932, IF_AMD|IF_SSE5},
+    {I_VFNMSUBPD, 3, {XMMREG,XMMREG,RM_XMM|BITS128,0,0}, nasm_bytecodes+4941, IF_AMD|IF_SSE5},
+    {I_VFNMSUBPD, 4, {YMMREG,YMMREG,YMMREG,RM_YMM|BITS256,0}, nasm_bytecodes+4950, IF_AMD|IF_SSE5},
+    {I_VFNMSUBPD, 3, {YMMREG,YMMREG,RM_YMM|BITS256,0,0}, nasm_bytecodes+4959, IF_AMD|IF_SSE5},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VFNMSUBPS[] = {
+    {I_VFNMSUBPS, 4, {XMMREG,XMMREG,RM_XMM|BITS128,XMMREG,0}, nasm_bytecodes+4968, IF_AMD|IF_SSE5},
+    {I_VFNMSUBPS, 3, {XMMREG,RM_XMM|BITS128,XMMREG,0,0}, nasm_bytecodes+4977, IF_AMD|IF_SSE5},
+    {I_VFNMSUBPS, 4, {YMMREG,YMMREG,RM_YMM|BITS256,YMMREG,0}, nasm_bytecodes+4986, IF_AMD|IF_SSE5},
+    {I_VFNMSUBPS, 3, {YMMREG,RM_YMM|BITS256,YMMREG,0,0}, nasm_bytecodes+4995, IF_AMD|IF_SSE5},
+    {I_VFNMSUBPS, 4, {XMMREG,XMMREG,XMMREG,RM_XMM|BITS128,0}, nasm_bytecodes+5004, IF_AMD|IF_SSE5},
+    {I_VFNMSUBPS, 3, {XMMREG,XMMREG,RM_XMM|BITS128,0,0}, nasm_bytecodes+5013, IF_AMD|IF_SSE5},
+    {I_VFNMSUBPS, 4, {YMMREG,YMMREG,YMMREG,RM_YMM|BITS256,0}, nasm_bytecodes+5022, IF_AMD|IF_SSE5},
+    {I_VFNMSUBPS, 3, {YMMREG,YMMREG,RM_YMM|BITS256,0,0}, nasm_bytecodes+5031, IF_AMD|IF_SSE5},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VFNMSUBSD[] = {
+    {I_VFNMSUBSD, 4, {XMMREG,XMMREG,RM_XMM|BITS64,XMMREG,0}, nasm_bytecodes+5040, IF_AMD|IF_SSE5},
+    {I_VFNMSUBSD, 3, {XMMREG,RM_XMM|BITS64,XMMREG,0,0}, nasm_bytecodes+5049, IF_AMD|IF_SSE5},
+    {I_VFNMSUBSD, 4, {XMMREG,XMMREG,XMMREG,RM_XMM|BITS64,0}, nasm_bytecodes+5058, IF_AMD|IF_SSE5},
+    {I_VFNMSUBSD, 3, {XMMREG,XMMREG,RM_XMM|BITS64,0,0}, nasm_bytecodes+5067, IF_AMD|IF_SSE5},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VFNMSUBSS[] = {
+    {I_VFNMSUBSS, 4, {XMMREG,XMMREG,RM_XMM|BITS32,XMMREG,0}, nasm_bytecodes+5076, IF_AMD|IF_SSE5},
+    {I_VFNMSUBSS, 3, {XMMREG,RM_XMM|BITS32,XMMREG,0,0}, nasm_bytecodes+5085, IF_AMD|IF_SSE5},
+    {I_VFNMSUBSS, 4, {XMMREG,XMMREG,XMMREG,RM_XMM|BITS32,0}, nasm_bytecodes+5094, IF_AMD|IF_SSE5},
+    {I_VFNMSUBSS, 3, {XMMREG,XMMREG,RM_XMM|BITS32,0,0}, nasm_bytecodes+5103, IF_AMD|IF_SSE5},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VFRCZPD[] = {
+    {I_VFRCZPD, 2, {XMMREG,RM_XMM|BITS128,0,0,0}, nasm_bytecodes+12906, IF_AMD|IF_SSE5},
+    {I_VFRCZPD, 1, {XMMREG,0,0,0,0}, nasm_bytecodes+12913, IF_AMD|IF_SSE5},
+    {I_VFRCZPD, 2, {YMMREG,RM_YMM|BITS256,0,0,0}, nasm_bytecodes+12920, IF_AMD|IF_SSE5},
+    {I_VFRCZPD, 1, {YMMREG,0,0,0,0}, nasm_bytecodes+12927, IF_AMD|IF_SSE5},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VFRCZPS[] = {
+    {I_VFRCZPS, 2, {XMMREG,RM_XMM|BITS128,0,0,0}, nasm_bytecodes+12934, IF_AMD|IF_SSE5},
+    {I_VFRCZPS, 1, {XMMREG,0,0,0,0}, nasm_bytecodes+12941, IF_AMD|IF_SSE5},
+    {I_VFRCZPS, 2, {YMMREG,RM_YMM|BITS256,0,0,0}, nasm_bytecodes+12948, IF_AMD|IF_SSE5},
+    {I_VFRCZPS, 1, {YMMREG,0,0,0,0}, nasm_bytecodes+12955, IF_AMD|IF_SSE5},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VFRCZSD[] = {
+    {I_VFRCZSD, 2, {XMMREG,RM_XMM|BITS64,0,0,0}, nasm_bytecodes+12962, IF_AMD|IF_SSE5},
+    {I_VFRCZSD, 1, {XMMREG,0,0,0,0}, nasm_bytecodes+12969, IF_AMD|IF_SSE5},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VFRCZSS[] = {
+    {I_VFRCZSS, 2, {XMMREG,RM_XMM|BITS32,0,0,0}, nasm_bytecodes+12976, IF_AMD|IF_SSE5},
+    {I_VFRCZSS, 1, {XMMREG,0,0,0,0}, nasm_bytecodes+12983, IF_AMD|IF_SSE5},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VHADDPD[] = {
+    {I_VHADDPD, 3, {XMMREG,XMMREG,RM_XMM|BITS128,0,0}, nasm_bytecodes+9469, IF_AVX|IF_SANDYBRIDGE},
+    {I_VHADDPD, 2, {XMMREG,RM_XMM|BITS128,0,0,0}, nasm_bytecodes+9476, IF_AVX|IF_SANDYBRIDGE},
+    {I_VHADDPD, 3, {YMMREG,YMMREG,RM_YMM|BITS256,0,0}, nasm_bytecodes+9483, IF_AVX|IF_SANDYBRIDGE},
+    {I_VHADDPD, 2, {YMMREG,RM_YMM|BITS256,0,0,0}, nasm_bytecodes+9490, IF_AVX|IF_SANDYBRIDGE},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VHADDPS[] = {
+    {I_VHADDPS, 3, {XMMREG,XMMREG,RM_XMM|BITS128,0,0}, nasm_bytecodes+9497, IF_AVX|IF_SANDYBRIDGE},
+    {I_VHADDPS, 2, {XMMREG,RM_XMM|BITS128,0,0,0}, nasm_bytecodes+9504, IF_AVX|IF_SANDYBRIDGE},
+    {I_VHADDPS, 3, {YMMREG,YMMREG,RM_YMM|BITS256,0,0}, nasm_bytecodes+9511, IF_AVX|IF_SANDYBRIDGE},
+    {I_VHADDPS, 2, {YMMREG,RM_YMM|BITS256,0,0,0}, nasm_bytecodes+9518, IF_AVX|IF_SANDYBRIDGE},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VHSUBPD[] = {
+    {I_VHSUBPD, 3, {XMMREG,XMMREG,RM_XMM|BITS128,0,0}, nasm_bytecodes+9525, IF_AVX|IF_SANDYBRIDGE},
+    {I_VHSUBPD, 2, {XMMREG,RM_XMM|BITS128,0,0,0}, nasm_bytecodes+9532, IF_AVX|IF_SANDYBRIDGE},
+    {I_VHSUBPD, 3, {YMMREG,YMMREG,RM_YMM|BITS256,0,0}, nasm_bytecodes+9539, IF_AVX|IF_SANDYBRIDGE},
+    {I_VHSUBPD, 2, {YMMREG,RM_YMM|BITS256,0,0,0}, nasm_bytecodes+9546, IF_AVX|IF_SANDYBRIDGE},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VHSUBPS[] = {
+    {I_VHSUBPS, 3, {XMMREG,XMMREG,RM_XMM|BITS128,0,0}, nasm_bytecodes+9553, IF_AVX|IF_SANDYBRIDGE},
+    {I_VHSUBPS, 2, {XMMREG,RM_XMM|BITS128,0,0,0}, nasm_bytecodes+9560, IF_AVX|IF_SANDYBRIDGE},
+    {I_VHSUBPS, 3, {YMMREG,YMMREG,RM_YMM|BITS256,0,0}, nasm_bytecodes+9567, IF_AVX|IF_SANDYBRIDGE},
+    {I_VHSUBPS, 2, {YMMREG,RM_YMM|BITS256,0,0,0}, nasm_bytecodes+9574, IF_AVX|IF_SANDYBRIDGE},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VINSERTF128[] = {
+    {I_VINSERTF128, 4, {YMMREG,YMMREG,RM_XMM|BITS128,IMMEDIATE|BITS8,0}, nasm_bytecodes+6348, IF_AVX|IF_SANDYBRIDGE},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VINSERTPS[] = {
+    {I_VINSERTPS, 4, {XMMREG,XMMREG,RM_XMM|BITS32,IMMEDIATE|BITS8,0}, nasm_bytecodes+6356, IF_AVX|IF_SANDYBRIDGE},
+    {I_VINSERTPS, 3, {XMMREG,RM_XMM|BITS32,IMMEDIATE|BITS8,0,0}, nasm_bytecodes+6364, IF_AVX|IF_SANDYBRIDGE},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VLDDQU[] = {
+    {I_VLDDQU, 2, {XMMREG,MEMORY|BITS128,0,0,0}, nasm_bytecodes+9581, IF_AVX|IF_SANDYBRIDGE},
+    {I_VLDDQU, 2, {YMMREG,MEMORY|BITS256,0,0,0}, nasm_bytecodes+9588, IF_AVX|IF_SANDYBRIDGE},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VLDMXCSR[] = {
+    {I_VLDMXCSR, 1, {MEMORY|BITS32,0,0,0,0}, nasm_bytecodes+9595, IF_AVX|IF_SANDYBRIDGE},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VLDQQU[] = {
+    {I_VLDQQU, 2, {YMMREG,MEMORY|BITS256,0,0,0}, nasm_bytecodes+9588, IF_AVX|IF_SANDYBRIDGE},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VMASKMOVDQU[] = {
+    {I_VMASKMOVDQU, 2, {XMMREG,XMMREG,0,0,0}, nasm_bytecodes+9602, IF_AVX|IF_SANDYBRIDGE},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VMASKMOVPD[] = {
+    {I_VMASKMOVPD, 3, {XMMREG,XMMREG,MEMORY|BITS128,0,0}, nasm_bytecodes+9637, IF_AVX|IF_SANDYBRIDGE},
+    {I_VMASKMOVPD, 3, {YMMREG,YMMREG,MEMORY|BITS256,0,0}, nasm_bytecodes+9644, IF_AVX|IF_SANDYBRIDGE},
+    {I_VMASKMOVPD, 3, {MEMORY|BITS128,XMMREG,XMMREG,0,0}, nasm_bytecodes+9651, IF_AVX|IF_SANDYBRIDGE},
+    {I_VMASKMOVPD, 3, {MEMORY|BITS256,YMMREG,YMMREG,0,0}, nasm_bytecodes+9658, IF_AVX|IF_SANDYBRIDGE},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VMASKMOVPS[] = {
+    {I_VMASKMOVPS, 3, {XMMREG,XMMREG,MEMORY|BITS128,0,0}, nasm_bytecodes+9609, IF_AVX|IF_SANDYBRIDGE},
+    {I_VMASKMOVPS, 3, {YMMREG,YMMREG,MEMORY|BITS256,0,0}, nasm_bytecodes+9616, IF_AVX|IF_SANDYBRIDGE},
+    {I_VMASKMOVPS, 3, {MEMORY|BITS128,XMMREG,XMMREG,0,0}, nasm_bytecodes+9623, IF_AVX|IF_SANDYBRIDGE|IF_SO},
+    {I_VMASKMOVPS, 3, {MEMORY|BITS256,XMMREG,XMMREG,0,0}, nasm_bytecodes+9630, IF_AVX|IF_SANDYBRIDGE|IF_SY},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VMAXPD[] = {
+    {I_VMAXPD, 3, {XMMREG,XMMREG,RM_XMM|BITS128,0,0}, nasm_bytecodes+9665, IF_AVX|IF_SANDYBRIDGE},
+    {I_VMAXPD, 2, {XMMREG,RM_XMM|BITS128,0,0,0}, nasm_bytecodes+9672, IF_AVX|IF_SANDYBRIDGE},
+    {I_VMAXPD, 3, {YMMREG,YMMREG,RM_YMM|BITS256,0,0}, nasm_bytecodes+9679, IF_AVX|IF_SANDYBRIDGE},
+    {I_VMAXPD, 2, {YMMREG,RM_YMM|BITS256,0,0,0}, nasm_bytecodes+9686, IF_AVX|IF_SANDYBRIDGE},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VMAXPS[] = {
+    {I_VMAXPS, 3, {XMMREG,XMMREG,RM_XMM|BITS128,0,0}, nasm_bytecodes+9693, IF_AVX|IF_SANDYBRIDGE},
+    {I_VMAXPS, 2, {XMMREG,RM_XMM|BITS128,0,0,0}, nasm_bytecodes+9700, IF_AVX|IF_SANDYBRIDGE},
+    {I_VMAXPS, 3, {YMMREG,YMMREG,RM_YMM|BITS256,0,0}, nasm_bytecodes+9707, IF_AVX|IF_SANDYBRIDGE},
+    {I_VMAXPS, 2, {YMMREG,RM_YMM|BITS256,0,0,0}, nasm_bytecodes+9714, IF_AVX|IF_SANDYBRIDGE},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VMAXSD[] = {
+    {I_VMAXSD, 3, {XMMREG,XMMREG,RM_XMM|BITS64,0,0}, nasm_bytecodes+9721, IF_AVX|IF_SANDYBRIDGE},
+    {I_VMAXSD, 2, {XMMREG,RM_XMM|BITS64,0,0,0}, nasm_bytecodes+9728, IF_AVX|IF_SANDYBRIDGE},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VMAXSS[] = {
+    {I_VMAXSS, 3, {XMMREG,XMMREG,RM_XMM|BITS32,0,0}, nasm_bytecodes+9735, IF_AVX|IF_SANDYBRIDGE},
+    {I_VMAXSS, 2, {XMMREG,RM_XMM|BITS32,0,0,0}, nasm_bytecodes+9742, IF_AVX|IF_SANDYBRIDGE},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VMCALL[] = {
+    {I_VMCALL, 0, {0,0,0,0,0}, nasm_bytecodes+18864, IF_VMX},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VMCLEAR[] = {
+    {I_VMCLEAR, 1, {MEMORY,0,0,0,0}, nasm_bytecodes+15804, IF_VMX},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VMINPD[] = {
+    {I_VMINPD, 3, {XMMREG,XMMREG,RM_XMM|BITS128,0,0}, nasm_bytecodes+9749, IF_AVX|IF_SANDYBRIDGE},
+    {I_VMINPD, 2, {XMMREG,RM_XMM|BITS128,0,0,0}, nasm_bytecodes+9756, IF_AVX|IF_SANDYBRIDGE},
+    {I_VMINPD, 3, {YMMREG,YMMREG,RM_YMM|BITS256,0,0}, nasm_bytecodes+9763, IF_AVX|IF_SANDYBRIDGE},
+    {I_VMINPD, 2, {YMMREG,RM_YMM|BITS256,0,0,0}, nasm_bytecodes+9770, IF_AVX|IF_SANDYBRIDGE},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VMINPS[] = {
+    {I_VMINPS, 3, {XMMREG,XMMREG,RM_XMM|BITS128,0,0}, nasm_bytecodes+9777, IF_AVX|IF_SANDYBRIDGE},
+    {I_VMINPS, 2, {XMMREG,RM_XMM|BITS128,0,0,0}, nasm_bytecodes+9784, IF_AVX|IF_SANDYBRIDGE},
+    {I_VMINPS, 3, {YMMREG,YMMREG,RM_YMM|BITS256,0,0}, nasm_bytecodes+9791, IF_AVX|IF_SANDYBRIDGE},
+    {I_VMINPS, 2, {YMMREG,RM_YMM|BITS256,0,0,0}, nasm_bytecodes+9798, IF_AVX|IF_SANDYBRIDGE},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VMINSD[] = {
+    {I_VMINSD, 3, {XMMREG,XMMREG,RM_XMM|BITS64,0,0}, nasm_bytecodes+9805, IF_AVX|IF_SANDYBRIDGE},
+    {I_VMINSD, 2, {XMMREG,RM_XMM|BITS64,0,0,0}, nasm_bytecodes+9812, IF_AVX|IF_SANDYBRIDGE},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VMINSS[] = {
+    {I_VMINSS, 3, {XMMREG,XMMREG,RM_XMM|BITS32,0,0}, nasm_bytecodes+9819, IF_AVX|IF_SANDYBRIDGE},
+    {I_VMINSS, 2, {XMMREG,RM_XMM|BITS32,0,0,0}, nasm_bytecodes+9826, IF_AVX|IF_SANDYBRIDGE},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VMLAUNCH[] = {
+    {I_VMLAUNCH, 0, {0,0,0,0,0}, nasm_bytecodes+18869, IF_VMX},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VMLOAD[] = {
+    {I_VMLOAD, 0, {0,0,0,0,0}, nasm_bytecodes+18874, IF_X64|IF_VMX},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VMMCALL[] = {
+    {I_VMMCALL, 0, {0,0,0,0,0}, nasm_bytecodes+18879, IF_X64|IF_VMX},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VMOVAPD[] = {
+    {I_VMOVAPD, 2, {XMMREG,RM_XMM|BITS128,0,0,0}, nasm_bytecodes+9833, IF_AVX|IF_SANDYBRIDGE},
+    {I_VMOVAPD, 2, {RM_XMM|BITS128,XMMREG,0,0,0}, nasm_bytecodes+9840, IF_AVX|IF_SANDYBRIDGE},
+    {I_VMOVAPD, 2, {YMMREG,RM_YMM|BITS256,0,0,0}, nasm_bytecodes+9847, IF_AVX|IF_SANDYBRIDGE},
+    {I_VMOVAPD, 2, {RM_YMM|BITS256,YMMREG,0,0,0}, nasm_bytecodes+9854, IF_AVX|IF_SANDYBRIDGE},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VMOVAPS[] = {
+    {I_VMOVAPS, 2, {XMMREG,RM_XMM|BITS128,0,0,0}, nasm_bytecodes+9861, IF_AVX|IF_SANDYBRIDGE},
+    {I_VMOVAPS, 2, {RM_XMM|BITS128,XMMREG,0,0,0}, nasm_bytecodes+9868, IF_AVX|IF_SANDYBRIDGE},
+    {I_VMOVAPS, 2, {YMMREG,RM_YMM|BITS256,0,0,0}, nasm_bytecodes+9875, IF_AVX|IF_SANDYBRIDGE},
+    {I_VMOVAPS, 2, {RM_YMM|BITS256,YMMREG,0,0,0}, nasm_bytecodes+9882, IF_AVX|IF_SANDYBRIDGE},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VMOVD[] = {
+    {I_VMOVD, 2, {XMMREG,RM_GPR|BITS32,0,0,0}, nasm_bytecodes+9917, IF_AVX|IF_SANDYBRIDGE},
+    {I_VMOVD, 2, {RM_GPR|BITS32,XMMREG,0,0,0}, nasm_bytecodes+9924, IF_AVX|IF_SANDYBRIDGE},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VMOVDDUP[] = {
+    {I_VMOVDDUP, 2, {XMMREG,RM_XMM|BITS64,0,0,0}, nasm_bytecodes+9931, IF_AVX|IF_SANDYBRIDGE},
+    {I_VMOVDDUP, 2, {YMMREG,RM_YMM|BITS256,0,0,0}, nasm_bytecodes+9938, IF_AVX|IF_SANDYBRIDGE},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VMOVDQA[] = {
+    {I_VMOVDQA, 2, {XMMREG,RM_XMM|BITS128,0,0,0}, nasm_bytecodes+9945, IF_AVX|IF_SANDYBRIDGE},
+    {I_VMOVDQA, 2, {RM_XMM|BITS128,XMMREG,0,0,0}, nasm_bytecodes+9952, IF_AVX|IF_SANDYBRIDGE},
+    {I_VMOVDQA, 2, {YMMREG,RM_YMM,0,0,0}, nasm_bytecodes+9959, IF_AVX|IF_SANDYBRIDGE},
+    {I_VMOVDQA, 2, {RM_YMM|BITS256,YMMREG,0,0,0}, nasm_bytecodes+9966, IF_AVX|IF_SANDYBRIDGE},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VMOVDQU[] = {
+    {I_VMOVDQU, 2, {XMMREG,RM_XMM|BITS128,0,0,0}, nasm_bytecodes+9973, IF_AVX|IF_SANDYBRIDGE},
+    {I_VMOVDQU, 2, {RM_XMM|BITS128,XMMREG,0,0,0}, nasm_bytecodes+9980, IF_AVX|IF_SANDYBRIDGE},
+    {I_VMOVDQU, 2, {YMMREG,RM_YMM|BITS256,0,0,0}, nasm_bytecodes+9987, IF_AVX|IF_SANDYBRIDGE},
+    {I_VMOVDQU, 2, {RM_YMM|BITS256,YMMREG,0,0,0}, nasm_bytecodes+9994, IF_AVX|IF_SANDYBRIDGE},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VMOVHLPS[] = {
+    {I_VMOVHLPS, 3, {XMMREG,XMMREG,XMMREG,0,0}, nasm_bytecodes+10001, IF_AVX|IF_SANDYBRIDGE},
+    {I_VMOVHLPS, 2, {XMMREG,XMMREG,0,0,0}, nasm_bytecodes+10008, IF_AVX|IF_SANDYBRIDGE},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VMOVHPD[] = {
+    {I_VMOVHPD, 3, {XMMREG,XMMREG,MEMORY|BITS64,0,0}, nasm_bytecodes+10015, IF_AVX|IF_SANDYBRIDGE},
+    {I_VMOVHPD, 2, {XMMREG,MEMORY|BITS64,0,0,0}, nasm_bytecodes+10022, IF_AVX|IF_SANDYBRIDGE},
+    {I_VMOVHPD, 2, {MEMORY|BITS64,XMMREG,0,0,0}, nasm_bytecodes+10029, IF_AVX|IF_SANDYBRIDGE},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VMOVHPS[] = {
+    {I_VMOVHPS, 3, {XMMREG,XMMREG,MEMORY|BITS64,0,0}, nasm_bytecodes+10036, IF_AVX|IF_SANDYBRIDGE},
+    {I_VMOVHPS, 2, {XMMREG,MEMORY|BITS64,0,0,0}, nasm_bytecodes+10043, IF_AVX|IF_SANDYBRIDGE},
+    {I_VMOVHPS, 2, {MEMORY|BITS64,XMMREG,0,0,0}, nasm_bytecodes+10050, IF_AVX|IF_SANDYBRIDGE},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VMOVLHPS[] = {
+    {I_VMOVLHPS, 3, {XMMREG,XMMREG,XMMREG,0,0}, nasm_bytecodes+10036, IF_AVX|IF_SANDYBRIDGE},
+    {I_VMOVLHPS, 2, {XMMREG,XMMREG,0,0,0}, nasm_bytecodes+10043, IF_AVX|IF_SANDYBRIDGE},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VMOVLPD[] = {
+    {I_VMOVLPD, 3, {XMMREG,XMMREG,MEMORY|BITS64,0,0}, nasm_bytecodes+10057, IF_AVX|IF_SANDYBRIDGE},
+    {I_VMOVLPD, 2, {XMMREG,MEMORY|BITS64,0,0,0}, nasm_bytecodes+10064, IF_AVX|IF_SANDYBRIDGE},
+    {I_VMOVLPD, 2, {MEMORY|BITS64,XMMREG,0,0,0}, nasm_bytecodes+10071, IF_AVX|IF_SANDYBRIDGE},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VMOVLPS[] = {
+    {I_VMOVLPS, 3, {XMMREG,XMMREG,MEMORY|BITS64,0,0}, nasm_bytecodes+10001, IF_AVX|IF_SANDYBRIDGE},
+    {I_VMOVLPS, 2, {XMMREG,MEMORY|BITS64,0,0,0}, nasm_bytecodes+10008, IF_AVX|IF_SANDYBRIDGE},
+    {I_VMOVLPS, 2, {MEMORY|BITS64,XMMREG,0,0,0}, nasm_bytecodes+10078, IF_AVX|IF_SANDYBRIDGE},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VMOVMSKPD[] = {
+    {I_VMOVMSKPD, 2, {REG_GPR|BITS64,XMMREG,0,0,0}, nasm_bytecodes+10085, IF_AVX|IF_SANDYBRIDGE|IF_LONG},
+    {I_VMOVMSKPD, 2, {REG_GPR|BITS32,XMMREG,0,0,0}, nasm_bytecodes+10085, IF_AVX|IF_SANDYBRIDGE},
+    {I_VMOVMSKPD, 2, {REG_GPR|BITS64,YMMREG,0,0,0}, nasm_bytecodes+10092, IF_AVX|IF_SANDYBRIDGE|IF_LONG},
+    {I_VMOVMSKPD, 2, {REG_GPR|BITS32,YMMREG,0,0,0}, nasm_bytecodes+10092, IF_AVX|IF_SANDYBRIDGE},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VMOVMSKPS[] = {
+    {I_VMOVMSKPS, 2, {REG_GPR|BITS64,XMMREG,0,0,0}, nasm_bytecodes+10099, IF_AVX|IF_SANDYBRIDGE|IF_LONG},
+    {I_VMOVMSKPS, 2, {REG_GPR|BITS32,XMMREG,0,0,0}, nasm_bytecodes+10099, IF_AVX|IF_SANDYBRIDGE},
+    {I_VMOVMSKPS, 2, {REG_GPR|BITS64,YMMREG,0,0,0}, nasm_bytecodes+10106, IF_AVX|IF_SANDYBRIDGE|IF_LONG},
+    {I_VMOVMSKPS, 2, {REG_GPR|BITS32,YMMREG,0,0,0}, nasm_bytecodes+10106, IF_AVX|IF_SANDYBRIDGE},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VMOVNTDQ[] = {
+    {I_VMOVNTDQ, 2, {MEMORY|BITS128,XMMREG,0,0,0}, nasm_bytecodes+10113, IF_AVX|IF_SANDYBRIDGE},
+    {I_VMOVNTDQ, 2, {MEMORY|BITS256,YMMREG,0,0,0}, nasm_bytecodes+10120, IF_AVX|IF_SANDYBRIDGE},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VMOVNTDQA[] = {
+    {I_VMOVNTDQA, 2, {XMMREG,MEMORY|BITS128,0,0,0}, nasm_bytecodes+10127, IF_AVX|IF_SANDYBRIDGE},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VMOVNTPD[] = {
+    {I_VMOVNTPD, 2, {MEMORY|BITS128,XMMREG,0,0,0}, nasm_bytecodes+10134, IF_AVX|IF_SANDYBRIDGE},
+    {I_VMOVNTPD, 2, {MEMORY|BITS256,YMMREG,0,0,0}, nasm_bytecodes+10141, IF_AVX|IF_SANDYBRIDGE},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VMOVNTPS[] = {
+    {I_VMOVNTPS, 2, {MEMORY|BITS128,XMMREG,0,0,0}, nasm_bytecodes+10148, IF_AVX|IF_SANDYBRIDGE},
+    {I_VMOVNTPS, 2, {MEMORY|BITS128,YMMREG,0,0,0}, nasm_bytecodes+10155, IF_AVX|IF_SANDYBRIDGE},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VMOVNTQQ[] = {
+    {I_VMOVNTQQ, 2, {MEMORY|BITS256,YMMREG,0,0,0}, nasm_bytecodes+10120, IF_AVX|IF_SANDYBRIDGE},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VMOVQ[] = {
+    {I_VMOVQ, 2, {XMMREG,RM_XMM|BITS64,0,0,0}, nasm_bytecodes+9889, IF_AVX|IF_SANDYBRIDGE|IF_SQ},
+    {I_VMOVQ, 2, {RM_XMM|BITS64,XMMREG,0,0,0}, nasm_bytecodes+9896, IF_AVX|IF_SANDYBRIDGE|IF_SQ},
+    {I_VMOVQ, 2, {XMMREG,RM_GPR|BITS64,0,0,0}, nasm_bytecodes+9903, IF_AVX|IF_SANDYBRIDGE|IF_LONG|IF_SQ},
+    {I_VMOVQ, 2, {RM_GPR|BITS64,XMMREG,0,0,0}, nasm_bytecodes+9910, IF_AVX|IF_SANDYBRIDGE|IF_LONG|IF_SQ},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VMOVQQA[] = {
+    {I_VMOVQQA, 2, {YMMREG,RM_YMM|BITS256,0,0,0}, nasm_bytecodes+9959, IF_AVX|IF_SANDYBRIDGE},
+    {I_VMOVQQA, 2, {RM_YMM|BITS256,YMMREG,0,0,0}, nasm_bytecodes+9966, IF_AVX|IF_SANDYBRIDGE},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VMOVQQU[] = {
+    {I_VMOVQQU, 2, {YMMREG,RM_YMM|BITS256,0,0,0}, nasm_bytecodes+9987, IF_AVX|IF_SANDYBRIDGE},
+    {I_VMOVQQU, 2, {RM_YMM|BITS256,YMMREG,0,0,0}, nasm_bytecodes+9994, IF_AVX|IF_SANDYBRIDGE},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VMOVSD[] = {
+    {I_VMOVSD, 3, {XMMREG,XMMREG,XMMREG,0,0}, nasm_bytecodes+10162, IF_AVX|IF_SANDYBRIDGE},
+    {I_VMOVSD, 2, {XMMREG,XMMREG,0,0,0}, nasm_bytecodes+10169, IF_AVX|IF_SANDYBRIDGE},
+    {I_VMOVSD, 2, {XMMREG,MEMORY|BITS64,0,0,0}, nasm_bytecodes+10176, IF_AVX|IF_SANDYBRIDGE},
+    {I_VMOVSD, 3, {XMMREG,XMMREG,XMMREG,0,0}, nasm_bytecodes+10183, IF_AVX|IF_SANDYBRIDGE},
+    {I_VMOVSD, 2, {XMMREG,XMMREG,0,0,0}, nasm_bytecodes+10190, IF_AVX|IF_SANDYBRIDGE},
+    {I_VMOVSD, 2, {MEMORY|BITS64,XMMREG,0,0,0}, nasm_bytecodes+10197, IF_AVX|IF_SANDYBRIDGE},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VMOVSHDUP[] = {
+    {I_VMOVSHDUP, 2, {XMMREG,RM_XMM|BITS128,0,0,0}, nasm_bytecodes+10204, IF_AVX|IF_SANDYBRIDGE},
+    {I_VMOVSHDUP, 2, {YMMREG,RM_YMM|BITS256,0,0,0}, nasm_bytecodes+10211, IF_AVX|IF_SANDYBRIDGE},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VMOVSLDUP[] = {
+    {I_VMOVSLDUP, 2, {XMMREG,RM_XMM|BITS128,0,0,0}, nasm_bytecodes+10218, IF_AVX|IF_SANDYBRIDGE},
+    {I_VMOVSLDUP, 2, {YMMREG,RM_YMM|BITS256,0,0,0}, nasm_bytecodes+10225, IF_AVX|IF_SANDYBRIDGE},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VMOVSS[] = {
+    {I_VMOVSS, 3, {XMMREG,XMMREG,XMMREG,0,0}, nasm_bytecodes+10232, IF_AVX|IF_SANDYBRIDGE},
+    {I_VMOVSS, 2, {XMMREG,XMMREG,0,0,0}, nasm_bytecodes+10239, IF_AVX|IF_SANDYBRIDGE},
+    {I_VMOVSS, 2, {XMMREG,MEMORY|BITS64,0,0,0}, nasm_bytecodes+10246, IF_AVX|IF_SANDYBRIDGE},
+    {I_VMOVSS, 3, {XMMREG,XMMREG,XMMREG,0,0}, nasm_bytecodes+10253, IF_AVX|IF_SANDYBRIDGE},
+    {I_VMOVSS, 2, {XMMREG,XMMREG,0,0,0}, nasm_bytecodes+10260, IF_AVX|IF_SANDYBRIDGE},
+    {I_VMOVSS, 2, {MEMORY|BITS64,XMMREG,0,0,0}, nasm_bytecodes+10267, IF_AVX|IF_SANDYBRIDGE},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VMOVUPD[] = {
+    {I_VMOVUPD, 2, {XMMREG,RM_XMM|BITS128,0,0,0}, nasm_bytecodes+10274, IF_AVX|IF_SANDYBRIDGE},
+    {I_VMOVUPD, 2, {RM_XMM|BITS128,XMMREG,0,0,0}, nasm_bytecodes+10281, IF_AVX|IF_SANDYBRIDGE},
+    {I_VMOVUPD, 2, {YMMREG,RM_YMM|BITS256,0,0,0}, nasm_bytecodes+10288, IF_AVX|IF_SANDYBRIDGE},
+    {I_VMOVUPD, 2, {RM_YMM|BITS256,YMMREG,0,0,0}, nasm_bytecodes+10295, IF_AVX|IF_SANDYBRIDGE},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VMOVUPS[] = {
+    {I_VMOVUPS, 2, {XMMREG,RM_XMM|BITS128,0,0,0}, nasm_bytecodes+10302, IF_AVX|IF_SANDYBRIDGE},
+    {I_VMOVUPS, 2, {RM_XMM|BITS128,XMMREG,0,0,0}, nasm_bytecodes+10309, IF_AVX|IF_SANDYBRIDGE},
+    {I_VMOVUPS, 2, {YMMREG,RM_YMM|BITS256,0,0,0}, nasm_bytecodes+10316, IF_AVX|IF_SANDYBRIDGE},
+    {I_VMOVUPS, 2, {RM_YMM|BITS256,YMMREG,0,0,0}, nasm_bytecodes+10323, IF_AVX|IF_SANDYBRIDGE},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VMPSADBW[] = {
+    {I_VMPSADBW, 4, {XMMREG,XMMREG,RM_XMM|BITS128,IMMEDIATE|BITS8,0}, nasm_bytecodes+6372, IF_AVX|IF_SANDYBRIDGE},
+    {I_VMPSADBW, 3, {XMMREG,RM_XMM|BITS128,IMMEDIATE|BITS8,0,0}, nasm_bytecodes+6380, IF_AVX|IF_SANDYBRIDGE},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VMPTRLD[] = {
+    {I_VMPTRLD, 1, {MEMORY,0,0,0,0}, nasm_bytecodes+15811, IF_VMX},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VMPTRST[] = {
+    {I_VMPTRST, 1, {MEMORY,0,0,0,0}, nasm_bytecodes+18884, IF_VMX},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VMREAD[] = {
+    {I_VMREAD, 2, {RM_GPR|BITS32,REG_GPR|BITS32,0,0,0}, nasm_bytecodes+8189, IF_VMX|IF_NOLONG|IF_SD},
+    {I_VMREAD, 2, {RM_GPR|BITS64,REG_GPR|BITS64,0,0,0}, nasm_bytecodes+8188, IF_X64|IF_VMX|IF_SQ},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VMRESUME[] = {
+    {I_VMRESUME, 0, {0,0,0,0,0}, nasm_bytecodes+18889, IF_VMX},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VMRUN[] = {
+    {I_VMRUN, 0, {0,0,0,0,0}, nasm_bytecodes+18894, IF_X64|IF_VMX},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VMSAVE[] = {
+    {I_VMSAVE, 0, {0,0,0,0,0}, nasm_bytecodes+18899, IF_X64|IF_VMX},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VMULPD[] = {
+    {I_VMULPD, 3, {XMMREG,XMMREG,RM_XMM|BITS128,0,0}, nasm_bytecodes+10330, IF_AVX|IF_SANDYBRIDGE},
+    {I_VMULPD, 2, {XMMREG,RM_XMM|BITS128,0,0,0}, nasm_bytecodes+10337, IF_AVX|IF_SANDYBRIDGE},
+    {I_VMULPD, 3, {YMMREG,YMMREG,RM_YMM|BITS256,0,0}, nasm_bytecodes+10344, IF_AVX|IF_SANDYBRIDGE},
+    {I_VMULPD, 2, {YMMREG,RM_YMM|BITS256,0,0,0}, nasm_bytecodes+10351, IF_AVX|IF_SANDYBRIDGE},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VMULPS[] = {
+    {I_VMULPS, 3, {XMMREG,XMMREG,RM_XMM|BITS128,0,0}, nasm_bytecodes+10358, IF_AVX|IF_SANDYBRIDGE},
+    {I_VMULPS, 2, {XMMREG,RM_XMM|BITS128,0,0,0}, nasm_bytecodes+10365, IF_AVX|IF_SANDYBRIDGE},
+    {I_VMULPS, 3, {YMMREG,YMMREG,RM_YMM|BITS256,0,0}, nasm_bytecodes+10372, IF_AVX|IF_SANDYBRIDGE},
+    {I_VMULPS, 2, {YMMREG,RM_YMM|BITS256,0,0,0}, nasm_bytecodes+10379, IF_AVX|IF_SANDYBRIDGE},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VMULSD[] = {
+    {I_VMULSD, 3, {XMMREG,XMMREG,RM_XMM|BITS64,0,0}, nasm_bytecodes+10386, IF_AVX|IF_SANDYBRIDGE},
+    {I_VMULSD, 2, {XMMREG,RM_XMM|BITS64,0,0,0}, nasm_bytecodes+10393, IF_AVX|IF_SANDYBRIDGE},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VMULSS[] = {
+    {I_VMULSS, 3, {XMMREG,XMMREG,RM_XMM|BITS32,0,0}, nasm_bytecodes+10400, IF_AVX|IF_SANDYBRIDGE},
+    {I_VMULSS, 2, {XMMREG,RM_XMM|BITS32,0,0,0}, nasm_bytecodes+10407, IF_AVX|IF_SANDYBRIDGE},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VMWRITE[] = {
+    {I_VMWRITE, 2, {REG_GPR|BITS32,RM_GPR|BITS32,0,0,0}, nasm_bytecodes+8196, IF_VMX|IF_NOLONG|IF_SD},
+    {I_VMWRITE, 2, {REG_GPR|BITS64,RM_GPR|BITS64,0,0,0}, nasm_bytecodes+8195, IF_X64|IF_VMX|IF_SQ},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VMXOFF[] = {
+    {I_VMXOFF, 0, {0,0,0,0,0}, nasm_bytecodes+18904, IF_VMX},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VMXON[] = {
+    {I_VMXON, 1, {MEMORY,0,0,0,0}, nasm_bytecodes+15810, IF_VMX},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VORPD[] = {
+    {I_VORPD, 3, {XMMREG,XMMREG,RM_XMM|BITS128,0,0}, nasm_bytecodes+10414, IF_AVX|IF_SANDYBRIDGE},
+    {I_VORPD, 2, {XMMREG,RM_XMM|BITS128,0,0,0}, nasm_bytecodes+10421, IF_AVX|IF_SANDYBRIDGE},
+    {I_VORPD, 3, {YMMREG,YMMREG,RM_YMM|BITS256,0,0}, nasm_bytecodes+10428, IF_AVX|IF_SANDYBRIDGE},
+    {I_VORPD, 2, {YMMREG,RM_YMM|BITS256,0,0,0}, nasm_bytecodes+10435, IF_AVX|IF_SANDYBRIDGE},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VORPS[] = {
+    {I_VORPS, 3, {XMMREG,XMMREG,RM_XMM|BITS128,0,0}, nasm_bytecodes+10442, IF_AVX|IF_SANDYBRIDGE},
+    {I_VORPS, 2, {XMMREG,RM_XMM|BITS128,0,0,0}, nasm_bytecodes+10449, IF_AVX|IF_SANDYBRIDGE},
+    {I_VORPS, 3, {YMMREG,YMMREG,RM_YMM|BITS256,0,0}, nasm_bytecodes+10456, IF_AVX|IF_SANDYBRIDGE},
+    {I_VORPS, 2, {YMMREG,RM_YMM|BITS256,0,0,0}, nasm_bytecodes+10463, IF_AVX|IF_SANDYBRIDGE},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VPABSB[] = {
+    {I_VPABSB, 2, {XMMREG,RM_XMM|BITS128,0,0,0}, nasm_bytecodes+10470, IF_AVX|IF_SANDYBRIDGE},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VPABSD[] = {
+    {I_VPABSD, 2, {XMMREG,RM_XMM|BITS128,0,0,0}, nasm_bytecodes+10484, IF_AVX|IF_SANDYBRIDGE},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VPABSW[] = {
+    {I_VPABSW, 2, {XMMREG,RM_XMM|BITS128,0,0,0}, nasm_bytecodes+10477, IF_AVX|IF_SANDYBRIDGE},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VPACKSSDW[] = {
+    {I_VPACKSSDW, 3, {XMMREG,XMMREG,RM_XMM|BITS128,0,0}, nasm_bytecodes+10505, IF_AVX|IF_SANDYBRIDGE},
+    {I_VPACKSSDW, 2, {XMMREG,RM_XMM|BITS128,0,0,0}, nasm_bytecodes+10512, IF_AVX|IF_SANDYBRIDGE},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VPACKSSWB[] = {
+    {I_VPACKSSWB, 3, {XMMREG,XMMREG,RM_XMM|BITS128,0,0}, nasm_bytecodes+10491, IF_AVX|IF_SANDYBRIDGE},
+    {I_VPACKSSWB, 2, {XMMREG,RM_XMM|BITS128,0,0,0}, nasm_bytecodes+10498, IF_AVX|IF_SANDYBRIDGE},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VPACKUSDW[] = {
+    {I_VPACKUSDW, 3, {XMMREG,XMMREG,RM_XMM|BITS128,0,0}, nasm_bytecodes+10533, IF_AVX|IF_SANDYBRIDGE},
+    {I_VPACKUSDW, 2, {XMMREG,RM_XMM|BITS128,0,0,0}, nasm_bytecodes+10540, IF_AVX|IF_SANDYBRIDGE},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VPACKUSWB[] = {
+    {I_VPACKUSWB, 3, {XMMREG,XMMREG,RM_XMM|BITS128,0,0}, nasm_bytecodes+10519, IF_AVX|IF_SANDYBRIDGE},
+    {I_VPACKUSWB, 2, {XMMREG,RM_XMM|BITS128,0,0,0}, nasm_bytecodes+10526, IF_AVX|IF_SANDYBRIDGE},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VPADDB[] = {
+    {I_VPADDB, 3, {XMMREG,XMMREG,RM_XMM|BITS128,0,0}, nasm_bytecodes+10547, IF_AVX|IF_SANDYBRIDGE},
+    {I_VPADDB, 2, {XMMREG,RM_XMM|BITS128,0,0,0}, nasm_bytecodes+10554, IF_AVX|IF_SANDYBRIDGE},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VPADDD[] = {
+    {I_VPADDD, 3, {XMMREG,XMMREG,RM_XMM|BITS128,0,0}, nasm_bytecodes+10575, IF_AVX|IF_SANDYBRIDGE},
+    {I_VPADDD, 2, {XMMREG,RM_XMM|BITS128,0,0,0}, nasm_bytecodes+10582, IF_AVX|IF_SANDYBRIDGE},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VPADDQ[] = {
+    {I_VPADDQ, 3, {XMMREG,XMMREG,RM_XMM|BITS128,0,0}, nasm_bytecodes+10589, IF_AVX|IF_SANDYBRIDGE},
+    {I_VPADDQ, 2, {XMMREG,RM_XMM|BITS128,0,0,0}, nasm_bytecodes+10596, IF_AVX|IF_SANDYBRIDGE},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VPADDSB[] = {
+    {I_VPADDSB, 3, {XMMREG,XMMREG,RM_XMM|BITS128,0,0}, nasm_bytecodes+10603, IF_AVX|IF_SANDYBRIDGE},
+    {I_VPADDSB, 2, {XMMREG,RM_XMM|BITS128,0,0,0}, nasm_bytecodes+10610, IF_AVX|IF_SANDYBRIDGE},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VPADDSW[] = {
+    {I_VPADDSW, 3, {XMMREG,XMMREG,RM_XMM|BITS128,0,0}, nasm_bytecodes+10617, IF_AVX|IF_SANDYBRIDGE},
+    {I_VPADDSW, 2, {XMMREG,RM_XMM|BITS128,0,0,0}, nasm_bytecodes+10624, IF_AVX|IF_SANDYBRIDGE},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VPADDUSB[] = {
+    {I_VPADDUSB, 3, {XMMREG,XMMREG,RM_XMM|BITS128,0,0}, nasm_bytecodes+10631, IF_AVX|IF_SANDYBRIDGE},
+    {I_VPADDUSB, 2, {XMMREG,RM_XMM|BITS128,0,0,0}, nasm_bytecodes+10638, IF_AVX|IF_SANDYBRIDGE},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VPADDUSW[] = {
+    {I_VPADDUSW, 3, {XMMREG,XMMREG,RM_XMM|BITS128,0,0}, nasm_bytecodes+10645, IF_AVX|IF_SANDYBRIDGE},
+    {I_VPADDUSW, 2, {XMMREG,RM_XMM|BITS128,0,0,0}, nasm_bytecodes+10652, IF_AVX|IF_SANDYBRIDGE},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VPADDW[] = {
+    {I_VPADDW, 3, {XMMREG,XMMREG,RM_XMM|BITS128,0,0}, nasm_bytecodes+10561, IF_AVX|IF_SANDYBRIDGE},
+    {I_VPADDW, 2, {XMMREG,RM_XMM|BITS128,0,0,0}, nasm_bytecodes+10568, IF_AVX|IF_SANDYBRIDGE},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VPALIGNR[] = {
+    {I_VPALIGNR, 4, {XMMREG,XMMREG,RM_XMM|BITS128,IMMEDIATE|BITS8,0}, nasm_bytecodes+6388, IF_AVX|IF_SANDYBRIDGE},
+    {I_VPALIGNR, 3, {XMMREG,RM_XMM|BITS128,IMMEDIATE|BITS8,0,0}, nasm_bytecodes+6396, IF_AVX|IF_SANDYBRIDGE},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VPAND[] = {
+    {I_VPAND, 3, {XMMREG,XMMREG,RM_XMM|BITS128,0,0}, nasm_bytecodes+10659, IF_AVX|IF_SANDYBRIDGE},
+    {I_VPAND, 2, {XMMREG,RM_XMM|BITS128,0,0,0}, nasm_bytecodes+10666, IF_AVX|IF_SANDYBRIDGE},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VPANDN[] = {
+    {I_VPANDN, 3, {XMMREG,XMMREG,RM_XMM|BITS128,0,0}, nasm_bytecodes+10673, IF_AVX|IF_SANDYBRIDGE},
+    {I_VPANDN, 2, {XMMREG,RM_XMM|BITS128,0,0,0}, nasm_bytecodes+10680, IF_AVX|IF_SANDYBRIDGE},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VPAVGB[] = {
+    {I_VPAVGB, 3, {XMMREG,XMMREG,RM_XMM|BITS128,0,0}, nasm_bytecodes+10687, IF_AVX|IF_SANDYBRIDGE},
+    {I_VPAVGB, 2, {XMMREG,RM_XMM|BITS128,0,0,0}, nasm_bytecodes+10694, IF_AVX|IF_SANDYBRIDGE},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VPAVGW[] = {
+    {I_VPAVGW, 3, {XMMREG,XMMREG,RM_XMM|BITS128,0,0}, nasm_bytecodes+10701, IF_AVX|IF_SANDYBRIDGE},
+    {I_VPAVGW, 2, {XMMREG,RM_XMM|BITS128,0,0,0}, nasm_bytecodes+10708, IF_AVX|IF_SANDYBRIDGE},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VPBLENDVB[] = {
+    {I_VPBLENDVB, 4, {XMMREG,XMMREG,RM_XMM|BITS128,XMMREG,0}, nasm_bytecodes+3546, IF_AVX|IF_SANDYBRIDGE},
+    {I_VPBLENDVB, 3, {XMMREG,RM_XMM|BITS128,XMMREG,0,0}, nasm_bytecodes+3555, IF_AVX|IF_SANDYBRIDGE},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VPBLENDW[] = {
+    {I_VPBLENDW, 4, {XMMREG,XMMREG,RM_XMM|BITS128,IMMEDIATE|BITS8,0}, nasm_bytecodes+6404, IF_AVX|IF_SANDYBRIDGE},
+    {I_VPBLENDW, 3, {XMMREG,RM_XMM|BITS128,IMMEDIATE|BITS8,0,0}, nasm_bytecodes+6412, IF_AVX|IF_SANDYBRIDGE},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VPCLMULHQHQDQ[] = {
+    {I_VPCLMULHQHQDQ, 3, {XMMREG,XMMREG,RM_XMM|BITS128,0,0}, nasm_bytecodes+3942, IF_AVX|IF_SANDYBRIDGE},
+    {I_VPCLMULHQHQDQ, 2, {XMMREG,RM_XMM|BITS128,0,0,0}, nasm_bytecodes+3951, IF_AVX|IF_SANDYBRIDGE},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VPCLMULHQLQDQ[] = {
+    {I_VPCLMULHQLQDQ, 3, {XMMREG,XMMREG,RM_XMM|BITS128,0,0}, nasm_bytecodes+3906, IF_AVX|IF_SANDYBRIDGE},
+    {I_VPCLMULHQLQDQ, 2, {XMMREG,RM_XMM|BITS128,0,0,0}, nasm_bytecodes+3915, IF_AVX|IF_SANDYBRIDGE},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VPCLMULLQHQDQ[] = {
+    {I_VPCLMULLQHQDQ, 3, {XMMREG,XMMREG,RM_XMM|BITS128,0,0}, nasm_bytecodes+3924, IF_AVX|IF_SANDYBRIDGE},
+    {I_VPCLMULLQHQDQ, 2, {XMMREG,RM_XMM|BITS128,0,0,0}, nasm_bytecodes+3933, IF_AVX|IF_SANDYBRIDGE},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VPCLMULLQLQDQ[] = {
+    {I_VPCLMULLQLQDQ, 3, {XMMREG,XMMREG,RM_XMM|BITS128,0,0}, nasm_bytecodes+3888, IF_AVX|IF_SANDYBRIDGE},
+    {I_VPCLMULLQLQDQ, 2, {XMMREG,RM_XMM|BITS128,0,0,0}, nasm_bytecodes+3897, IF_AVX|IF_SANDYBRIDGE},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VPCLMULQDQ[] = {
+    {I_VPCLMULQDQ, 4, {XMMREG,XMMREG,RM_XMM|BITS128,IMMEDIATE|BITS8,0}, nasm_bytecodes+6916, IF_AVX|IF_SANDYBRIDGE},
+    {I_VPCLMULQDQ, 3, {XMMREG,RM_XMM|BITS128,IMMEDIATE|BITS8,0,0}, nasm_bytecodes+6924, IF_AVX|IF_SANDYBRIDGE},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VPCMOV[] = {
+    {I_VPCMOV, 4, {XMMREG,XMMREG,RM_XMM|BITS128,XMMREG,0}, nasm_bytecodes+5112, IF_AMD|IF_SSE5},
+    {I_VPCMOV, 3, {XMMREG,RM_XMM|BITS128,XMMREG,0,0}, nasm_bytecodes+5121, IF_AMD|IF_SSE5},
+    {I_VPCMOV, 4, {YMMREG,YMMREG,RM_YMM|BITS256,YMMREG,0}, nasm_bytecodes+5130, IF_AMD|IF_SSE5},
+    {I_VPCMOV, 3, {YMMREG,RM_YMM|BITS256,YMMREG,0,0}, nasm_bytecodes+5139, IF_AMD|IF_SSE5},
+    {I_VPCMOV, 4, {XMMREG,XMMREG,XMMREG,RM_XMM|BITS128,0}, nasm_bytecodes+5148, IF_AMD|IF_SSE5},
+    {I_VPCMOV, 3, {XMMREG,XMMREG,RM_XMM|BITS128,0,0}, nasm_bytecodes+5157, IF_AMD|IF_SSE5},
+    {I_VPCMOV, 4, {YMMREG,YMMREG,YMMREG,RM_YMM|BITS256,0}, nasm_bytecodes+5166, IF_AMD|IF_SSE5},
+    {I_VPCMOV, 3, {YMMREG,YMMREG,RM_YMM|BITS256,0,0}, nasm_bytecodes+5175, IF_AMD|IF_SSE5},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VPCMPEQB[] = {
+    {I_VPCMPEQB, 3, {XMMREG,XMMREG,RM_XMM|BITS128,0,0}, nasm_bytecodes+10715, IF_AVX|IF_SANDYBRIDGE},
+    {I_VPCMPEQB, 2, {XMMREG,RM_XMM|BITS128,0,0,0}, nasm_bytecodes+10722, IF_AVX|IF_SANDYBRIDGE},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VPCMPEQD[] = {
+    {I_VPCMPEQD, 3, {XMMREG,XMMREG,RM_XMM|BITS128,0,0}, nasm_bytecodes+10743, IF_AVX|IF_SANDYBRIDGE},
+    {I_VPCMPEQD, 2, {XMMREG,RM_XMM|BITS128,0,0,0}, nasm_bytecodes+10750, IF_AVX|IF_SANDYBRIDGE},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VPCMPEQQ[] = {
+    {I_VPCMPEQQ, 3, {XMMREG,XMMREG,RM_XMM|BITS128,0,0}, nasm_bytecodes+10757, IF_AVX|IF_SANDYBRIDGE},
+    {I_VPCMPEQQ, 2, {XMMREG,RM_XMM|BITS128,0,0,0}, nasm_bytecodes+10764, IF_AVX|IF_SANDYBRIDGE},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VPCMPEQW[] = {
+    {I_VPCMPEQW, 3, {XMMREG,XMMREG,RM_XMM|BITS128,0,0}, nasm_bytecodes+10729, IF_AVX|IF_SANDYBRIDGE},
+    {I_VPCMPEQW, 2, {XMMREG,RM_XMM|BITS128,0,0,0}, nasm_bytecodes+10736, IF_AVX|IF_SANDYBRIDGE},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VPCMPESTRI[] = {
+    {I_VPCMPESTRI, 3, {XMMREG,RM_XMM|BITS128,IMMEDIATE|BITS8,0,0}, nasm_bytecodes+6420, IF_AVX|IF_SANDYBRIDGE},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VPCMPESTRM[] = {
+    {I_VPCMPESTRM, 3, {XMMREG,RM_XMM|BITS128,IMMEDIATE|BITS8,0,0}, nasm_bytecodes+6428, IF_AVX|IF_SANDYBRIDGE},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VPCMPGTB[] = {
+    {I_VPCMPGTB, 3, {XMMREG,XMMREG,RM_XMM|BITS128,0,0}, nasm_bytecodes+10771, IF_AVX|IF_SANDYBRIDGE},
+    {I_VPCMPGTB, 2, {XMMREG,RM_XMM|BITS128,0,0,0}, nasm_bytecodes+10778, IF_AVX|IF_SANDYBRIDGE},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VPCMPGTD[] = {
+    {I_VPCMPGTD, 3, {XMMREG,XMMREG,RM_XMM|BITS128,0,0}, nasm_bytecodes+10799, IF_AVX|IF_SANDYBRIDGE},
+    {I_VPCMPGTD, 2, {XMMREG,RM_XMM|BITS128,0,0,0}, nasm_bytecodes+10806, IF_AVX|IF_SANDYBRIDGE},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VPCMPGTQ[] = {
+    {I_VPCMPGTQ, 3, {XMMREG,XMMREG,RM_XMM|BITS128,0,0}, nasm_bytecodes+10813, IF_AVX|IF_SANDYBRIDGE},
+    {I_VPCMPGTQ, 2, {XMMREG,RM_XMM|BITS128,0,0,0}, nasm_bytecodes+10820, IF_AVX|IF_SANDYBRIDGE},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VPCMPGTW[] = {
+    {I_VPCMPGTW, 3, {XMMREG,XMMREG,RM_XMM|BITS128,0,0}, nasm_bytecodes+10785, IF_AVX|IF_SANDYBRIDGE},
+    {I_VPCMPGTW, 2, {XMMREG,RM_XMM|BITS128,0,0,0}, nasm_bytecodes+10792, IF_AVX|IF_SANDYBRIDGE},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VPCMPISTRI[] = {
+    {I_VPCMPISTRI, 3, {XMMREG,RM_XMM|BITS128,IMMEDIATE|BITS8,0,0}, nasm_bytecodes+6436, IF_AVX|IF_SANDYBRIDGE},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VPCMPISTRM[] = {
+    {I_VPCMPISTRM, 3, {XMMREG,RM_XMM|BITS128,IMMEDIATE|BITS8,0,0}, nasm_bytecodes+6444, IF_AVX|IF_SANDYBRIDGE},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VPCOMB[] = {
+    {I_VPCOMB, 4, {XMMREG,XMMREG,RM_XMM|BITS128,IMMEDIATE|BITS8,0}, nasm_bytecodes+7044, IF_AMD|IF_SSE5},
+    {I_VPCOMB, 3, {XMMREG,RM_XMM|BITS128,IMMEDIATE|BITS8,0,0}, nasm_bytecodes+7052, IF_AMD|IF_SSE5},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VPCOMD[] = {
+    {I_VPCOMD, 4, {XMMREG,XMMREG,RM_XMM|BITS128,IMMEDIATE|BITS8,0}, nasm_bytecodes+7060, IF_AMD|IF_SSE5},
+    {I_VPCOMD, 3, {XMMREG,RM_XMM|BITS128,IMMEDIATE|BITS8,0,0}, nasm_bytecodes+7068, IF_AMD|IF_SSE5},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VPCOMQ[] = {
+    {I_VPCOMQ, 4, {XMMREG,XMMREG,RM_XMM|BITS128,IMMEDIATE|BITS8,0}, nasm_bytecodes+7076, IF_AMD|IF_SSE5},
+    {I_VPCOMQ, 3, {XMMREG,RM_XMM|BITS128,IMMEDIATE|BITS8,0,0}, nasm_bytecodes+7084, IF_AMD|IF_SSE5},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VPCOMUB[] = {
+    {I_VPCOMUB, 4, {XMMREG,XMMREG,RM_XMM|BITS128,IMMEDIATE|BITS8,0}, nasm_bytecodes+7092, IF_AMD|IF_SSE5},
+    {I_VPCOMUB, 3, {XMMREG,RM_XMM|BITS128,IMMEDIATE|BITS8,0,0}, nasm_bytecodes+7100, IF_AMD|IF_SSE5},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VPCOMUD[] = {
+    {I_VPCOMUD, 4, {XMMREG,XMMREG,RM_XMM|BITS128,IMMEDIATE|BITS8,0}, nasm_bytecodes+7108, IF_AMD|IF_SSE5},
+    {I_VPCOMUD, 3, {XMMREG,RM_XMM|BITS128,IMMEDIATE|BITS8,0,0}, nasm_bytecodes+7116, IF_AMD|IF_SSE5},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VPCOMUQ[] = {
+    {I_VPCOMUQ, 4, {XMMREG,XMMREG,RM_XMM|BITS128,IMMEDIATE|BITS8,0}, nasm_bytecodes+7124, IF_AMD|IF_SSE5},
+    {I_VPCOMUQ, 3, {XMMREG,RM_XMM|BITS128,IMMEDIATE|BITS8,0,0}, nasm_bytecodes+7132, IF_AMD|IF_SSE5},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VPCOMUW[] = {
+    {I_VPCOMUW, 4, {XMMREG,XMMREG,RM_XMM|BITS128,IMMEDIATE|BITS8,0}, nasm_bytecodes+7140, IF_AMD|IF_SSE5},
+    {I_VPCOMUW, 3, {XMMREG,RM_XMM|BITS128,IMMEDIATE|BITS8,0,0}, nasm_bytecodes+7148, IF_AMD|IF_SSE5},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VPCOMW[] = {
+    {I_VPCOMW, 4, {XMMREG,XMMREG,RM_XMM|BITS128,IMMEDIATE|BITS8,0}, nasm_bytecodes+7156, IF_AMD|IF_SSE5},
+    {I_VPCOMW, 3, {XMMREG,RM_XMM|BITS128,IMMEDIATE|BITS8,0,0}, nasm_bytecodes+7164, IF_AMD|IF_SSE5},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VPERM2F128[] = {
+    {I_VPERM2F128, 4, {YMMREG,YMMREG,RM_YMM|BITS256,IMMEDIATE|BITS8,0}, nasm_bytecodes+6484, IF_AVX|IF_SANDYBRIDGE},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VPERMIL2PD[] = {
+    {I_VPERMIL2PD, 5, {XMMREG,XMMREG,RM_XMM|BITS128,XMMREG,IMMEDIATE|BITS8}, nasm_bytecodes+3672, IF_AVX|IF_SANDYBRIDGE},
+    {I_VPERMIL2PD, 5, {XMMREG,XMMREG,XMMREG,RM_XMM|BITS128,IMMEDIATE|BITS8}, nasm_bytecodes+3681, IF_AVX|IF_SANDYBRIDGE},
+    {I_VPERMIL2PD, 5, {YMMREG,YMMREG,RM_YMM|BITS256,YMMREG,IMMEDIATE|BITS8}, nasm_bytecodes+3690, IF_AVX|IF_SANDYBRIDGE},
+    {I_VPERMIL2PD, 5, {YMMREG,YMMREG,YMMREG,RM_YMM|BITS256,IMMEDIATE|BITS8}, nasm_bytecodes+3699, IF_AVX|IF_SANDYBRIDGE},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VPERMIL2PS[] = {
+    {I_VPERMIL2PS, 5, {XMMREG,XMMREG,RM_XMM|BITS128,XMMREG,IMMEDIATE|BITS8}, nasm_bytecodes+3816, IF_AVX|IF_SANDYBRIDGE},
+    {I_VPERMIL2PS, 5, {XMMREG,XMMREG,XMMREG,RM_XMM|BITS128,IMMEDIATE|BITS8}, nasm_bytecodes+3825, IF_AVX|IF_SANDYBRIDGE},
+    {I_VPERMIL2PS, 5, {YMMREG,YMMREG,RM_YMM|BITS256,YMMREG,IMMEDIATE|BITS8}, nasm_bytecodes+3834, IF_AVX|IF_SANDYBRIDGE},
+    {I_VPERMIL2PS, 5, {YMMREG,YMMREG,YMMREG,RM_YMM|BITS256,IMMEDIATE|BITS8}, nasm_bytecodes+3843, IF_AVX|IF_SANDYBRIDGE},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VPERMILMO2PD[] = {
+    {I_VPERMILMO2PD, 4, {XMMREG,XMMREG,RM_XMM|BITS128,XMMREG,0}, nasm_bytecodes+3600, IF_AVX|IF_SANDYBRIDGE},
+    {I_VPERMILMO2PD, 4, {XMMREG,XMMREG,XMMREG,RM_XMM|BITS128,0}, nasm_bytecodes+3609, IF_AVX|IF_SANDYBRIDGE},
+    {I_VPERMILMO2PD, 4, {YMMREG,YMMREG,RM_YMM|BITS256,YMMREG,0}, nasm_bytecodes+3618, IF_AVX|IF_SANDYBRIDGE},
+    {I_VPERMILMO2PD, 4, {YMMREG,YMMREG,YMMREG,RM_YMM|BITS256,0}, nasm_bytecodes+3627, IF_AVX|IF_SANDYBRIDGE},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VPERMILMO2PS[] = {
+    {I_VPERMILMO2PS, 4, {XMMREG,XMMREG,RM_XMM|BITS128,XMMREG,0}, nasm_bytecodes+3744, IF_AVX|IF_SANDYBRIDGE},
+    {I_VPERMILMO2PS, 4, {XMMREG,XMMREG,XMMREG,RM_XMM|BITS128,0}, nasm_bytecodes+3753, IF_AVX|IF_SANDYBRIDGE},
+    {I_VPERMILMO2PS, 4, {YMMREG,YMMREG,RM_YMM|BITS256,YMMREG,0}, nasm_bytecodes+3762, IF_AVX|IF_SANDYBRIDGE},
+    {I_VPERMILMO2PS, 4, {YMMREG,YMMREG,YMMREG,RM_YMM|BITS256,0}, nasm_bytecodes+3771, IF_AVX|IF_SANDYBRIDGE},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VPERMILMZ2PD[] = {
+    {I_VPERMILMZ2PD, 4, {XMMREG,XMMREG,RM_XMM|BITS128,XMMREG,0}, nasm_bytecodes+3636, IF_AVX|IF_SANDYBRIDGE},
+    {I_VPERMILMZ2PD, 4, {XMMREG,XMMREG,XMMREG,RM_XMM|BITS128,0}, nasm_bytecodes+3645, IF_AVX|IF_SANDYBRIDGE},
+    {I_VPERMILMZ2PD, 4, {YMMREG,YMMREG,RM_YMM|BITS256,YMMREG,0}, nasm_bytecodes+3654, IF_AVX|IF_SANDYBRIDGE},
+    {I_VPERMILMZ2PD, 4, {YMMREG,YMMREG,YMMREG,RM_YMM|BITS256,0}, nasm_bytecodes+3663, IF_AVX|IF_SANDYBRIDGE},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VPERMILMZ2PS[] = {
+    {I_VPERMILMZ2PS, 4, {XMMREG,XMMREG,RM_XMM|BITS128,XMMREG,0}, nasm_bytecodes+3780, IF_AVX|IF_SANDYBRIDGE},
+    {I_VPERMILMZ2PS, 4, {XMMREG,XMMREG,XMMREG,RM_XMM|BITS128,0}, nasm_bytecodes+3789, IF_AVX|IF_SANDYBRIDGE},
+    {I_VPERMILMZ2PS, 4, {YMMREG,YMMREG,RM_YMM|BITS256,YMMREG,0}, nasm_bytecodes+3798, IF_AVX|IF_SANDYBRIDGE},
+    {I_VPERMILMZ2PS, 4, {YMMREG,YMMREG,YMMREG,RM_YMM|BITS256,0}, nasm_bytecodes+3807, IF_AVX|IF_SANDYBRIDGE},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VPERMILPD[] = {
+    {I_VPERMILPD, 3, {XMMREG,XMMREG,RM_XMM|BITS128,0,0}, nasm_bytecodes+10827, IF_AVX|IF_SANDYBRIDGE},
+    {I_VPERMILPD, 3, {YMMREG,YMMREG,RM_YMM|BITS256,0,0}, nasm_bytecodes+10834, IF_AVX|IF_SANDYBRIDGE},
+    {I_VPERMILPD, 3, {XMMREG,RM_XMM|BITS128,IMMEDIATE|BITS8,0,0}, nasm_bytecodes+6452, IF_AVX|IF_SANDYBRIDGE},
+    {I_VPERMILPD, 3, {YMMREG,RM_YMM|BITS256,IMMEDIATE|BITS8,0,0}, nasm_bytecodes+6460, IF_AVX|IF_SANDYBRIDGE},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VPERMILPS[] = {
+    {I_VPERMILPS, 3, {XMMREG,XMMREG,RM_XMM|BITS128,0,0}, nasm_bytecodes+10841, IF_AVX|IF_SANDYBRIDGE},
+    {I_VPERMILPS, 3, {YMMREG,YMMREG,RM_YMM|BITS256,0,0}, nasm_bytecodes+10848, IF_AVX|IF_SANDYBRIDGE},
+    {I_VPERMILPS, 3, {XMMREG,RM_XMM|BITS128,IMMEDIATE|BITS8,0,0}, nasm_bytecodes+6468, IF_AVX|IF_SANDYBRIDGE},
+    {I_VPERMILPS, 3, {YMMREG,RM_YMM|BITS256,IMMEDIATE|BITS8,0,0}, nasm_bytecodes+6476, IF_AVX|IF_SANDYBRIDGE},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VPERMILTD2PD[] = {
+    {I_VPERMILTD2PD, 4, {XMMREG,XMMREG,RM_XMM|BITS128,XMMREG,0}, nasm_bytecodes+3564, IF_AVX|IF_SANDYBRIDGE},
+    {I_VPERMILTD2PD, 4, {XMMREG,XMMREG,XMMREG,RM_XMM|BITS128,0}, nasm_bytecodes+3573, IF_AVX|IF_SANDYBRIDGE},
+    {I_VPERMILTD2PD, 4, {YMMREG,YMMREG,RM_YMM|BITS256,YMMREG,0}, nasm_bytecodes+3582, IF_AVX|IF_SANDYBRIDGE},
+    {I_VPERMILTD2PD, 4, {YMMREG,YMMREG,YMMREG,RM_YMM|BITS256,0}, nasm_bytecodes+3591, IF_AVX|IF_SANDYBRIDGE},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VPERMILTD2PS[] = {
+    {I_VPERMILTD2PS, 4, {XMMREG,XMMREG,RM_XMM|BITS128,XMMREG,0}, nasm_bytecodes+3708, IF_AVX|IF_SANDYBRIDGE},
+    {I_VPERMILTD2PS, 4, {XMMREG,XMMREG,XMMREG,RM_XMM|BITS128,0}, nasm_bytecodes+3717, IF_AVX|IF_SANDYBRIDGE},
+    {I_VPERMILTD2PS, 4, {YMMREG,YMMREG,RM_YMM|BITS256,YMMREG,0}, nasm_bytecodes+3726, IF_AVX|IF_SANDYBRIDGE},
+    {I_VPERMILTD2PS, 4, {YMMREG,YMMREG,YMMREG,RM_YMM|BITS256,0}, nasm_bytecodes+3735, IF_AVX|IF_SANDYBRIDGE},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VPEXTRB[] = {
+    {I_VPEXTRB, 3, {REG_GPR|BITS64,XMMREG,IMMEDIATE|BITS8,0,0}, nasm_bytecodes+6492, IF_AVX|IF_SANDYBRIDGE|IF_LONG},
+    {I_VPEXTRB, 3, {REG_GPR|BITS32,XMMREG,IMMEDIATE|BITS8,0,0}, nasm_bytecodes+6492, IF_AVX|IF_SANDYBRIDGE},
+    {I_VPEXTRB, 3, {MEMORY|BITS8,XMMREG,IMMEDIATE|BITS8,0,0}, nasm_bytecodes+6492, IF_AVX|IF_SANDYBRIDGE},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VPEXTRD[] = {
+    {I_VPEXTRD, 3, {REG_GPR|BITS64,XMMREG,IMMEDIATE|BITS8,0,0}, nasm_bytecodes+6516, IF_AVX|IF_SANDYBRIDGE|IF_LONG},
+    {I_VPEXTRD, 3, {RM_GPR|BITS32,XMMREG,IMMEDIATE|BITS8,0,0}, nasm_bytecodes+6516, IF_AVX|IF_SANDYBRIDGE},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VPEXTRQ[] = {
+    {I_VPEXTRQ, 3, {RM_GPR|BITS64,XMMREG,IMMEDIATE|BITS8,0,0}, nasm_bytecodes+6524, IF_AVX|IF_SANDYBRIDGE|IF_LONG},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VPEXTRW[] = {
+    {I_VPEXTRW, 3, {REG_GPR|BITS64,XMMREG,IMMEDIATE|BITS8,0,0}, nasm_bytecodes+6500, IF_AVX|IF_SANDYBRIDGE|IF_LONG},
+    {I_VPEXTRW, 3, {REG_GPR|BITS32,XMMREG,IMMEDIATE|BITS8,0,0}, nasm_bytecodes+6500, IF_AVX|IF_SANDYBRIDGE},
+    {I_VPEXTRW, 3, {MEMORY|BITS16,XMMREG,IMMEDIATE|BITS8,0,0}, nasm_bytecodes+6500, IF_AVX|IF_SANDYBRIDGE},
+    {I_VPEXTRW, 3, {REG_GPR|BITS64,XMMREG,IMMEDIATE|BITS8,0,0}, nasm_bytecodes+6508, IF_AVX|IF_SANDYBRIDGE|IF_LONG},
+    {I_VPEXTRW, 3, {REG_GPR|BITS32,XMMREG,IMMEDIATE|BITS8,0,0}, nasm_bytecodes+6508, IF_AVX|IF_SANDYBRIDGE},
+    {I_VPEXTRW, 3, {MEMORY|BITS16,XMMREG,IMMEDIATE|BITS8,0,0}, nasm_bytecodes+6508, IF_AVX|IF_SANDYBRIDGE},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VPHADDBD[] = {
+    {I_VPHADDBD, 2, {XMMREG,RM_XMM|BITS128,0,0,0}, nasm_bytecodes+12990, IF_AMD|IF_SSE5},
+    {I_VPHADDBD, 1, {XMMREG,0,0,0,0}, nasm_bytecodes+12997, IF_AMD|IF_SSE5},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VPHADDBQ[] = {
+    {I_VPHADDBQ, 2, {XMMREG,RM_XMM|BITS128,0,0,0}, nasm_bytecodes+13004, IF_AMD|IF_SSE5},
+    {I_VPHADDBQ, 1, {XMMREG,0,0,0,0}, nasm_bytecodes+13011, IF_AMD|IF_SSE5},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VPHADDBW[] = {
+    {I_VPHADDBW, 2, {XMMREG,RM_XMM|BITS128,0,0,0}, nasm_bytecodes+13018, IF_AMD|IF_SSE5},
+    {I_VPHADDBW, 1, {XMMREG,0,0,0,0}, nasm_bytecodes+13025, IF_AMD|IF_SSE5},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VPHADDD[] = {
+    {I_VPHADDD, 3, {XMMREG,XMMREG,RM_XMM|BITS128,0,0}, nasm_bytecodes+10869, IF_AVX|IF_SANDYBRIDGE},
+    {I_VPHADDD, 2, {XMMREG,RM_XMM|BITS128,0,0,0}, nasm_bytecodes+10876, IF_AVX|IF_SANDYBRIDGE},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VPHADDDQ[] = {
+    {I_VPHADDDQ, 2, {XMMREG,RM_XMM|BITS128,0,0,0}, nasm_bytecodes+13032, IF_AMD|IF_SSE5},
+    {I_VPHADDDQ, 1, {XMMREG,0,0,0,0}, nasm_bytecodes+13039, IF_AMD|IF_SSE5},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VPHADDSW[] = {
+    {I_VPHADDSW, 3, {XMMREG,XMMREG,RM_XMM|BITS128,0,0}, nasm_bytecodes+10883, IF_AVX|IF_SANDYBRIDGE},
+    {I_VPHADDSW, 2, {XMMREG,RM_XMM|BITS128,0,0,0}, nasm_bytecodes+10890, IF_AVX|IF_SANDYBRIDGE},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VPHADDUBD[] = {
+    {I_VPHADDUBD, 2, {XMMREG,RM_XMM|BITS128,0,0,0}, nasm_bytecodes+13046, IF_AMD|IF_SSE5},
+    {I_VPHADDUBD, 1, {XMMREG,0,0,0,0}, nasm_bytecodes+13053, IF_AMD|IF_SSE5},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VPHADDUBQ[] = {
+    {I_VPHADDUBQ, 2, {XMMREG,RM_XMM|BITS128,0,0,0}, nasm_bytecodes+13060, IF_AMD|IF_SSE5},
+    {I_VPHADDUBQ, 1, {XMMREG,0,0,0,0}, nasm_bytecodes+13067, IF_AMD|IF_SSE5},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VPHADDUBW[] = {
+    {I_VPHADDUBW, 2, {XMMREG,RM_XMM|BITS128,0,0,0}, nasm_bytecodes+13074, IF_AMD|IF_SSE5},
+    {I_VPHADDUBW, 1, {XMMREG,0,0,0,0}, nasm_bytecodes+13081, IF_AMD|IF_SSE5},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VPHADDUDQ[] = {
+    {I_VPHADDUDQ, 2, {XMMREG,RM_XMM|BITS128,0,0,0}, nasm_bytecodes+13088, IF_AMD|IF_SSE5},
+    {I_VPHADDUDQ, 1, {XMMREG,0,0,0,0}, nasm_bytecodes+13095, IF_AMD|IF_SSE5},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VPHADDUWD[] = {
+    {I_VPHADDUWD, 2, {XMMREG,RM_XMM|BITS128,0,0,0}, nasm_bytecodes+13102, IF_AMD|IF_SSE5},
+    {I_VPHADDUWD, 1, {XMMREG,0,0,0,0}, nasm_bytecodes+13109, IF_AMD|IF_SSE5},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VPHADDUWQ[] = {
+    {I_VPHADDUWQ, 2, {XMMREG,RM_XMM|BITS128,0,0,0}, nasm_bytecodes+13116, IF_AMD|IF_SSE5},
+    {I_VPHADDUWQ, 1, {XMMREG,0,0,0,0}, nasm_bytecodes+13123, IF_AMD|IF_SSE5},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VPHADDW[] = {
+    {I_VPHADDW, 3, {XMMREG,XMMREG,RM_XMM|BITS128,0,0}, nasm_bytecodes+10855, IF_AVX|IF_SANDYBRIDGE},
+    {I_VPHADDW, 2, {XMMREG,RM_XMM|BITS128,0,0,0}, nasm_bytecodes+10862, IF_AVX|IF_SANDYBRIDGE},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VPHADDWD[] = {
+    {I_VPHADDWD, 2, {XMMREG,RM_XMM|BITS128,0,0,0}, nasm_bytecodes+13130, IF_AMD|IF_SSE5},
+    {I_VPHADDWD, 1, {XMMREG,0,0,0,0}, nasm_bytecodes+13137, IF_AMD|IF_SSE5},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VPHADDWQ[] = {
+    {I_VPHADDWQ, 2, {XMMREG,RM_XMM|BITS128,0,0,0}, nasm_bytecodes+13144, IF_AMD|IF_SSE5},
+    {I_VPHADDWQ, 1, {XMMREG,0,0,0,0}, nasm_bytecodes+13151, IF_AMD|IF_SSE5},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VPHMINPOSUW[] = {
+    {I_VPHMINPOSUW, 2, {XMMREG,RM_XMM|BITS128,0,0,0}, nasm_bytecodes+10897, IF_AVX|IF_SANDYBRIDGE},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VPHSUBBW[] = {
+    {I_VPHSUBBW, 2, {XMMREG,RM_XMM|BITS128,0,0,0}, nasm_bytecodes+13158, IF_AMD|IF_SSE5},
+    {I_VPHSUBBW, 1, {XMMREG,0,0,0,0}, nasm_bytecodes+13165, IF_AMD|IF_SSE5},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VPHSUBD[] = {
+    {I_VPHSUBD, 3, {XMMREG,XMMREG,RM_XMM|BITS128,0,0}, nasm_bytecodes+10918, IF_AVX|IF_SANDYBRIDGE},
+    {I_VPHSUBD, 2, {XMMREG,RM_XMM|BITS128,0,0,0}, nasm_bytecodes+10925, IF_AVX|IF_SANDYBRIDGE},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VPHSUBDQ[] = {
+    {I_VPHSUBDQ, 2, {XMMREG,RM_XMM|BITS128,0,0,0}, nasm_bytecodes+13172, IF_AMD|IF_SSE5},
+    {I_VPHSUBDQ, 1, {XMMREG,0,0,0,0}, nasm_bytecodes+13179, IF_AMD|IF_SSE5},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VPHSUBSW[] = {
+    {I_VPHSUBSW, 3, {XMMREG,XMMREG,RM_XMM|BITS128,0,0}, nasm_bytecodes+10932, IF_AVX|IF_SANDYBRIDGE},
+    {I_VPHSUBSW, 2, {XMMREG,RM_XMM|BITS128,0,0,0}, nasm_bytecodes+10939, IF_AVX|IF_SANDYBRIDGE},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VPHSUBW[] = {
+    {I_VPHSUBW, 3, {XMMREG,XMMREG,RM_XMM|BITS128,0,0}, nasm_bytecodes+10904, IF_AVX|IF_SANDYBRIDGE},
+    {I_VPHSUBW, 2, {XMMREG,RM_XMM|BITS128,0,0,0}, nasm_bytecodes+10911, IF_AVX|IF_SANDYBRIDGE},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VPHSUBWD[] = {
+    {I_VPHSUBWD, 2, {XMMREG,RM_XMM|BITS128,0,0,0}, nasm_bytecodes+13186, IF_AMD|IF_SSE5},
+    {I_VPHSUBWD, 1, {XMMREG,0,0,0,0}, nasm_bytecodes+13193, IF_AMD|IF_SSE5},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VPINSRB[] = {
+    {I_VPINSRB, 4, {XMMREG,XMMREG,MEMORY|BITS8,IMMEDIATE|BITS8,0}, nasm_bytecodes+6532, IF_AVX|IF_SANDYBRIDGE},
+    {I_VPINSRB, 3, {XMMREG,MEMORY|BITS8,IMMEDIATE|BITS8,0,0}, nasm_bytecodes+6540, IF_AVX|IF_SANDYBRIDGE},
+    {I_VPINSRB, 4, {XMMREG,XMMREG,RM_GPR|BITS8,IMMEDIATE|BITS8,0}, nasm_bytecodes+6532, IF_AVX|IF_SANDYBRIDGE},
+    {I_VPINSRB, 3, {XMMREG,RM_GPR|BITS8,IMMEDIATE|BITS8,0,0}, nasm_bytecodes+6540, IF_AVX|IF_SANDYBRIDGE},
+    {I_VPINSRB, 4, {XMMREG,XMMREG,REG_GPR|BITS32,IMMEDIATE|BITS8,0}, nasm_bytecodes+6532, IF_AVX|IF_SANDYBRIDGE},
+    {I_VPINSRB, 3, {XMMREG,REG_GPR|BITS32,IMMEDIATE|BITS8,0,0}, nasm_bytecodes+6540, IF_AVX|IF_SANDYBRIDGE},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VPINSRD[] = {
+    {I_VPINSRD, 4, {XMMREG,XMMREG,MEMORY|BITS32,IMMEDIATE|BITS8,0}, nasm_bytecodes+6564, IF_AVX|IF_SANDYBRIDGE},
+    {I_VPINSRD, 3, {XMMREG,MEMORY|BITS32,IMMEDIATE|BITS8,0,0}, nasm_bytecodes+6572, IF_AVX|IF_SANDYBRIDGE},
+    {I_VPINSRD, 4, {XMMREG,XMMREG,RM_GPR|BITS32,IMMEDIATE|BITS8,0}, nasm_bytecodes+6564, IF_AVX|IF_SANDYBRIDGE},
+    {I_VPINSRD, 3, {XMMREG,RM_GPR|BITS32,IMMEDIATE|BITS8,0,0}, nasm_bytecodes+6572, IF_AVX|IF_SANDYBRIDGE},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VPINSRQ[] = {
+    {I_VPINSRQ, 4, {XMMREG,XMMREG,MEMORY|BITS64,IMMEDIATE|BITS8,0}, nasm_bytecodes+6580, IF_AVX|IF_SANDYBRIDGE|IF_LONG},
+    {I_VPINSRQ, 3, {XMMREG,MEMORY|BITS64,IMMEDIATE|BITS8,0,0}, nasm_bytecodes+6588, IF_AVX|IF_SANDYBRIDGE|IF_LONG},
+    {I_VPINSRQ, 4, {XMMREG,XMMREG,RM_GPR|BITS64,IMMEDIATE|BITS8,0}, nasm_bytecodes+6580, IF_AVX|IF_SANDYBRIDGE|IF_LONG},
+    {I_VPINSRQ, 3, {XMMREG,RM_GPR|BITS64,IMMEDIATE|BITS8,0,0}, nasm_bytecodes+6588, IF_AVX|IF_SANDYBRIDGE|IF_LONG},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VPINSRW[] = {
+    {I_VPINSRW, 4, {XMMREG,XMMREG,MEMORY|BITS16,IMMEDIATE|BITS8,0}, nasm_bytecodes+6548, IF_AVX|IF_SANDYBRIDGE},
+    {I_VPINSRW, 3, {XMMREG,MEMORY|BITS16,IMMEDIATE|BITS8,0,0}, nasm_bytecodes+6556, IF_AVX|IF_SANDYBRIDGE},
+    {I_VPINSRW, 4, {XMMREG,XMMREG,RM_GPR|BITS16,IMMEDIATE|BITS8,0}, nasm_bytecodes+6548, IF_AVX|IF_SANDYBRIDGE},
+    {I_VPINSRW, 3, {XMMREG,RM_GPR|BITS16,IMMEDIATE|BITS8,0,0}, nasm_bytecodes+6556, IF_AVX|IF_SANDYBRIDGE},
+    {I_VPINSRW, 4, {XMMREG,XMMREG,REG_GPR|BITS32,IMMEDIATE|BITS8,0}, nasm_bytecodes+6548, IF_AVX|IF_SANDYBRIDGE},
+    {I_VPINSRW, 3, {XMMREG,REG_GPR|BITS32,IMMEDIATE|BITS8,0,0}, nasm_bytecodes+6556, IF_AVX|IF_SANDYBRIDGE},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VPMACSDD[] = {
+    {I_VPMACSDD, 4, {XMMREG,XMMREG,RM_XMM|BITS128,XMMREG,0}, nasm_bytecodes+5184, IF_AMD|IF_SSE5},
+    {I_VPMACSDD, 3, {XMMREG,RM_XMM|BITS128,XMMREG,0,0}, nasm_bytecodes+5193, IF_AMD|IF_SSE5},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VPMACSDQH[] = {
+    {I_VPMACSDQH, 4, {XMMREG,XMMREG,RM_XMM|BITS128,XMMREG,0}, nasm_bytecodes+5202, IF_AMD|IF_SSE5},
+    {I_VPMACSDQH, 3, {XMMREG,RM_XMM|BITS128,XMMREG,0,0}, nasm_bytecodes+5211, IF_AMD|IF_SSE5},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VPMACSDQL[] = {
+    {I_VPMACSDQL, 4, {XMMREG,XMMREG,RM_XMM|BITS128,XMMREG,0}, nasm_bytecodes+5220, IF_AMD|IF_SSE5},
+    {I_VPMACSDQL, 3, {XMMREG,RM_XMM|BITS128,XMMREG,0,0}, nasm_bytecodes+5229, IF_AMD|IF_SSE5},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VPMACSSDD[] = {
+    {I_VPMACSSDD, 4, {XMMREG,XMMREG,RM_XMM|BITS128,XMMREG,0}, nasm_bytecodes+5238, IF_AMD|IF_SSE5},
+    {I_VPMACSSDD, 3, {XMMREG,RM_XMM|BITS128,XMMREG,0,0}, nasm_bytecodes+5247, IF_AMD|IF_SSE5},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VPMACSSDQH[] = {
+    {I_VPMACSSDQH, 4, {XMMREG,XMMREG,RM_XMM|BITS128,XMMREG,0}, nasm_bytecodes+5256, IF_AMD|IF_SSE5},
+    {I_VPMACSSDQH, 3, {XMMREG,RM_XMM|BITS128,XMMREG,0,0}, nasm_bytecodes+5265, IF_AMD|IF_SSE5},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VPMACSSDQL[] = {
+    {I_VPMACSSDQL, 4, {XMMREG,XMMREG,RM_XMM|BITS128,XMMREG,0}, nasm_bytecodes+5274, IF_AMD|IF_SSE5},
+    {I_VPMACSSDQL, 3, {XMMREG,RM_XMM|BITS128,XMMREG,0,0}, nasm_bytecodes+5283, IF_AMD|IF_SSE5},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VPMACSSWD[] = {
+    {I_VPMACSSWD, 4, {XMMREG,XMMREG,RM_XMM|BITS128,XMMREG,0}, nasm_bytecodes+5292, IF_AMD|IF_SSE5},
+    {I_VPMACSSWD, 3, {XMMREG,RM_XMM|BITS128,XMMREG,0,0}, nasm_bytecodes+5301, IF_AMD|IF_SSE5},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VPMACSSWW[] = {
+    {I_VPMACSSWW, 4, {XMMREG,XMMREG,RM_XMM|BITS128,XMMREG,0}, nasm_bytecodes+5310, IF_AMD|IF_SSE5},
+    {I_VPMACSSWW, 3, {XMMREG,RM_XMM|BITS128,XMMREG,0,0}, nasm_bytecodes+5319, IF_AMD|IF_SSE5},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VPMACSWD[] = {
+    {I_VPMACSWD, 4, {XMMREG,XMMREG,RM_XMM|BITS128,XMMREG,0}, nasm_bytecodes+5328, IF_AMD|IF_SSE5},
+    {I_VPMACSWD, 3, {XMMREG,RM_XMM|BITS128,XMMREG,0,0}, nasm_bytecodes+5337, IF_AMD|IF_SSE5},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VPMACSWW[] = {
+    {I_VPMACSWW, 4, {XMMREG,XMMREG,RM_XMM|BITS128,XMMREG,0}, nasm_bytecodes+5346, IF_AMD|IF_SSE5},
+    {I_VPMACSWW, 3, {XMMREG,RM_XMM|BITS128,XMMREG,0,0}, nasm_bytecodes+5355, IF_AMD|IF_SSE5},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VPMADCSSWD[] = {
+    {I_VPMADCSSWD, 4, {XMMREG,XMMREG,RM_XMM|BITS128,XMMREG,0}, nasm_bytecodes+5364, IF_AMD|IF_SSE5},
+    {I_VPMADCSSWD, 3, {XMMREG,RM_XMM|BITS128,XMMREG,0,0}, nasm_bytecodes+5373, IF_AMD|IF_SSE5},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VPMADCSWD[] = {
+    {I_VPMADCSWD, 4, {XMMREG,XMMREG,RM_XMM|BITS128,XMMREG,0}, nasm_bytecodes+5382, IF_AMD|IF_SSE5},
+    {I_VPMADCSWD, 3, {XMMREG,RM_XMM|BITS128,XMMREG,0,0}, nasm_bytecodes+5391, IF_AMD|IF_SSE5},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VPMADDUBSW[] = {
+    {I_VPMADDUBSW, 3, {XMMREG,XMMREG,RM_XMM|BITS128,0,0}, nasm_bytecodes+10960, IF_AVX|IF_SANDYBRIDGE},
+    {I_VPMADDUBSW, 2, {XMMREG,RM_XMM|BITS128,0,0,0}, nasm_bytecodes+10967, IF_AVX|IF_SANDYBRIDGE},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VPMADDWD[] = {
+    {I_VPMADDWD, 3, {XMMREG,XMMREG,RM_XMM|BITS128,0,0}, nasm_bytecodes+10946, IF_AVX|IF_SANDYBRIDGE},
+    {I_VPMADDWD, 2, {XMMREG,RM_XMM|BITS128,0,0,0}, nasm_bytecodes+10953, IF_AVX|IF_SANDYBRIDGE},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VPMAXSB[] = {
+    {I_VPMAXSB, 3, {XMMREG,XMMREG,RM_XMM|BITS128,0,0}, nasm_bytecodes+10974, IF_AVX|IF_SANDYBRIDGE},
+    {I_VPMAXSB, 2, {XMMREG,RM_XMM|BITS128,0,0,0}, nasm_bytecodes+10981, IF_AVX|IF_SANDYBRIDGE},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VPMAXSD[] = {
+    {I_VPMAXSD, 3, {XMMREG,XMMREG,RM_XMM|BITS128,0,0}, nasm_bytecodes+11002, IF_AVX|IF_SANDYBRIDGE},
+    {I_VPMAXSD, 2, {XMMREG,RM_XMM|BITS128,0,0,0}, nasm_bytecodes+11009, IF_AVX|IF_SANDYBRIDGE},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VPMAXSW[] = {
+    {I_VPMAXSW, 3, {XMMREG,XMMREG,RM_XMM|BITS128,0,0}, nasm_bytecodes+10988, IF_AVX|IF_SANDYBRIDGE},
+    {I_VPMAXSW, 2, {XMMREG,RM_XMM|BITS128,0,0,0}, nasm_bytecodes+10995, IF_AVX|IF_SANDYBRIDGE},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VPMAXUB[] = {
+    {I_VPMAXUB, 3, {XMMREG,XMMREG,RM_XMM|BITS128,0,0}, nasm_bytecodes+11016, IF_AVX|IF_SANDYBRIDGE},
+    {I_VPMAXUB, 2, {XMMREG,RM_XMM|BITS128,0,0,0}, nasm_bytecodes+11023, IF_AVX|IF_SANDYBRIDGE},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VPMAXUD[] = {
+    {I_VPMAXUD, 3, {XMMREG,XMMREG,RM_XMM|BITS128,0,0}, nasm_bytecodes+11044, IF_AVX|IF_SANDYBRIDGE},
+    {I_VPMAXUD, 2, {XMMREG,RM_XMM|BITS128,0,0,0}, nasm_bytecodes+11051, IF_AVX|IF_SANDYBRIDGE},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VPMAXUW[] = {
+    {I_VPMAXUW, 3, {XMMREG,XMMREG,RM_XMM|BITS128,0,0}, nasm_bytecodes+11030, IF_AVX|IF_SANDYBRIDGE},
+    {I_VPMAXUW, 2, {XMMREG,RM_XMM|BITS128,0,0,0}, nasm_bytecodes+11037, IF_AVX|IF_SANDYBRIDGE},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VPMINSB[] = {
+    {I_VPMINSB, 3, {XMMREG,XMMREG,RM_XMM|BITS128,0,0}, nasm_bytecodes+11058, IF_AVX|IF_SANDYBRIDGE},
+    {I_VPMINSB, 2, {XMMREG,RM_XMM|BITS128,0,0,0}, nasm_bytecodes+11065, IF_AVX|IF_SANDYBRIDGE},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VPMINSD[] = {
+    {I_VPMINSD, 3, {XMMREG,XMMREG,RM_XMM|BITS128,0,0}, nasm_bytecodes+11086, IF_AVX|IF_SANDYBRIDGE},
+    {I_VPMINSD, 2, {XMMREG,RM_XMM|BITS128,0,0,0}, nasm_bytecodes+11093, IF_AVX|IF_SANDYBRIDGE},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VPMINSW[] = {
+    {I_VPMINSW, 3, {XMMREG,XMMREG,RM_XMM|BITS128,0,0}, nasm_bytecodes+11072, IF_AVX|IF_SANDYBRIDGE},
+    {I_VPMINSW, 2, {XMMREG,RM_XMM|BITS128,0,0,0}, nasm_bytecodes+11079, IF_AVX|IF_SANDYBRIDGE},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VPMINUB[] = {
+    {I_VPMINUB, 3, {XMMREG,XMMREG,RM_XMM|BITS128,0,0}, nasm_bytecodes+11100, IF_AVX|IF_SANDYBRIDGE},
+    {I_VPMINUB, 2, {XMMREG,RM_XMM|BITS128,0,0,0}, nasm_bytecodes+11107, IF_AVX|IF_SANDYBRIDGE},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VPMINUD[] = {
+    {I_VPMINUD, 3, {XMMREG,XMMREG,RM_XMM|BITS128,0,0}, nasm_bytecodes+11128, IF_AVX|IF_SANDYBRIDGE},
+    {I_VPMINUD, 2, {XMMREG,RM_XMM|BITS128,0,0,0}, nasm_bytecodes+11135, IF_AVX|IF_SANDYBRIDGE},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VPMINUW[] = {
+    {I_VPMINUW, 3, {XMMREG,XMMREG,RM_XMM|BITS128,0,0}, nasm_bytecodes+11114, IF_AVX|IF_SANDYBRIDGE},
+    {I_VPMINUW, 2, {XMMREG,RM_XMM|BITS128,0,0,0}, nasm_bytecodes+11121, IF_AVX|IF_SANDYBRIDGE},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VPMOVMSKB[] = {
+    {I_VPMOVMSKB, 2, {REG_GPR|BITS64,XMMREG,0,0,0}, nasm_bytecodes+11142, IF_AVX|IF_SANDYBRIDGE|IF_LONG},
+    {I_VPMOVMSKB, 2, {REG_GPR|BITS32,XMMREG,0,0,0}, nasm_bytecodes+11142, IF_AVX|IF_SANDYBRIDGE},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VPMOVSXBD[] = {
+    {I_VPMOVSXBD, 2, {XMMREG,RM_XMM|BITS32,0,0,0}, nasm_bytecodes+11156, IF_AVX|IF_SANDYBRIDGE},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VPMOVSXBQ[] = {
+    {I_VPMOVSXBQ, 2, {XMMREG,RM_XMM|BITS16,0,0,0}, nasm_bytecodes+11163, IF_AVX|IF_SANDYBRIDGE},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VPMOVSXBW[] = {
+    {I_VPMOVSXBW, 2, {XMMREG,RM_XMM|BITS64,0,0,0}, nasm_bytecodes+11149, IF_AVX|IF_SANDYBRIDGE},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VPMOVSXDQ[] = {
+    {I_VPMOVSXDQ, 2, {XMMREG,RM_XMM|BITS64,0,0,0}, nasm_bytecodes+11184, IF_AVX|IF_SANDYBRIDGE},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VPMOVSXWD[] = {
+    {I_VPMOVSXWD, 2, {XMMREG,RM_XMM|BITS64,0,0,0}, nasm_bytecodes+11170, IF_AVX|IF_SANDYBRIDGE},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VPMOVSXWQ[] = {
+    {I_VPMOVSXWQ, 2, {XMMREG,RM_XMM|BITS32,0,0,0}, nasm_bytecodes+11177, IF_AVX|IF_SANDYBRIDGE},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VPMOVZXBD[] = {
+    {I_VPMOVZXBD, 2, {XMMREG,RM_XMM|BITS32,0,0,0}, nasm_bytecodes+11198, IF_AVX|IF_SANDYBRIDGE},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VPMOVZXBQ[] = {
+    {I_VPMOVZXBQ, 2, {XMMREG,RM_XMM|BITS16,0,0,0}, nasm_bytecodes+11205, IF_AVX|IF_SANDYBRIDGE},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VPMOVZXBW[] = {
+    {I_VPMOVZXBW, 2, {XMMREG,RM_XMM|BITS64,0,0,0}, nasm_bytecodes+11191, IF_AVX|IF_SANDYBRIDGE},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VPMOVZXDQ[] = {
+    {I_VPMOVZXDQ, 2, {XMMREG,RM_XMM|BITS64,0,0,0}, nasm_bytecodes+11226, IF_AVX|IF_SANDYBRIDGE},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VPMOVZXWD[] = {
+    {I_VPMOVZXWD, 2, {XMMREG,RM_XMM|BITS64,0,0,0}, nasm_bytecodes+11212, IF_AVX|IF_SANDYBRIDGE},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VPMOVZXWQ[] = {
+    {I_VPMOVZXWQ, 2, {XMMREG,RM_XMM|BITS32,0,0,0}, nasm_bytecodes+11219, IF_AVX|IF_SANDYBRIDGE},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VPMULDQ[] = {
+    {I_VPMULDQ, 3, {XMMREG,XMMREG,RM_XMM|BITS128,0,0}, nasm_bytecodes+11317, IF_AVX|IF_SANDYBRIDGE},
+    {I_VPMULDQ, 2, {XMMREG,RM_XMM|BITS128,0,0,0}, nasm_bytecodes+11324, IF_AVX|IF_SANDYBRIDGE},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VPMULHRSW[] = {
+    {I_VPMULHRSW, 3, {XMMREG,XMMREG,RM_XMM|BITS128,0,0}, nasm_bytecodes+11247, IF_AVX|IF_SANDYBRIDGE},
+    {I_VPMULHRSW, 2, {XMMREG,RM_XMM|BITS128,0,0,0}, nasm_bytecodes+11254, IF_AVX|IF_SANDYBRIDGE},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VPMULHUW[] = {
+    {I_VPMULHUW, 3, {XMMREG,XMMREG,RM_XMM|BITS128,0,0}, nasm_bytecodes+11233, IF_AVX|IF_SANDYBRIDGE},
+    {I_VPMULHUW, 2, {XMMREG,RM_XMM|BITS128,0,0,0}, nasm_bytecodes+11240, IF_AVX|IF_SANDYBRIDGE},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VPMULHW[] = {
+    {I_VPMULHW, 3, {XMMREG,XMMREG,RM_XMM|BITS128,0,0}, nasm_bytecodes+11261, IF_AVX|IF_SANDYBRIDGE},
+    {I_VPMULHW, 2, {XMMREG,RM_XMM|BITS128,0,0,0}, nasm_bytecodes+11268, IF_AVX|IF_SANDYBRIDGE},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VPMULLD[] = {
+    {I_VPMULLD, 3, {XMMREG,XMMREG,RM_XMM|BITS128,0,0}, nasm_bytecodes+11289, IF_AVX|IF_SANDYBRIDGE},
+    {I_VPMULLD, 2, {XMMREG,RM_XMM|BITS128,0,0,0}, nasm_bytecodes+11296, IF_AVX|IF_SANDYBRIDGE},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VPMULLW[] = {
+    {I_VPMULLW, 3, {XMMREG,XMMREG,RM_XMM|BITS128,0,0}, nasm_bytecodes+11275, IF_AVX|IF_SANDYBRIDGE},
+    {I_VPMULLW, 2, {XMMREG,RM_XMM|BITS128,0,0,0}, nasm_bytecodes+11282, IF_AVX|IF_SANDYBRIDGE},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VPMULUDQ[] = {
+    {I_VPMULUDQ, 3, {XMMREG,XMMREG,RM_XMM|BITS128,0,0}, nasm_bytecodes+11303, IF_AVX|IF_SANDYBRIDGE},
+    {I_VPMULUDQ, 2, {XMMREG,RM_XMM|BITS128,0,0,0}, nasm_bytecodes+11310, IF_AVX|IF_SANDYBRIDGE},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VPOR[] = {
+    {I_VPOR, 3, {XMMREG,XMMREG,RM_XMM|BITS128,0,0}, nasm_bytecodes+11331, IF_AVX|IF_SANDYBRIDGE},
+    {I_VPOR, 2, {XMMREG,RM_XMM|BITS128,0,0,0}, nasm_bytecodes+11338, IF_AVX|IF_SANDYBRIDGE},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VPPERM[] = {
+    {I_VPPERM, 4, {XMMREG,XMMREG,XMMREG,RM_XMM|BITS128,0}, nasm_bytecodes+5400, IF_AMD|IF_SSE5},
+    {I_VPPERM, 3, {XMMREG,XMMREG,RM_XMM|BITS128,0,0}, nasm_bytecodes+5409, IF_AMD|IF_SSE5},
+    {I_VPPERM, 4, {XMMREG,XMMREG,RM_XMM|BITS128,XMMREG,0}, nasm_bytecodes+5418, IF_AMD|IF_SSE5},
+    {I_VPPERM, 3, {XMMREG,RM_XMM|BITS128,XMMREG,0,0}, nasm_bytecodes+5427, IF_AMD|IF_SSE5},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VPROTB[] = {
+    {I_VPROTB, 3, {XMMREG,RM_XMM|BITS128,XMMREG,0,0}, nasm_bytecodes+13200, IF_AMD|IF_SSE5},
+    {I_VPROTB, 2, {XMMREG,XMMREG,0,0,0}, nasm_bytecodes+13207, IF_AMD|IF_SSE5},
+    {I_VPROTB, 3, {XMMREG,XMMREG,RM_XMM|BITS128,0,0}, nasm_bytecodes+13214, IF_AMD|IF_SSE5},
+    {I_VPROTB, 2, {XMMREG,RM_XMM|BITS128,0,0,0}, nasm_bytecodes+13221, IF_AMD|IF_SSE5},
+    {I_VPROTB, 3, {XMMREG,RM_XMM|BITS128,IMMEDIATE|BITS8,0,0}, nasm_bytecodes+7172, IF_AMD|IF_SSE5},
+    {I_VPROTB, 2, {XMMREG,IMMEDIATE|BITS8,0,0,0}, nasm_bytecodes+7180, IF_AMD|IF_SSE5},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VPROTD[] = {
+    {I_VPROTD, 3, {XMMREG,RM_XMM|BITS128,XMMREG,0,0}, nasm_bytecodes+13228, IF_AMD|IF_SSE5},
+    {I_VPROTD, 2, {XMMREG,XMMREG,0,0,0}, nasm_bytecodes+13235, IF_AMD|IF_SSE5},
+    {I_VPROTD, 3, {XMMREG,XMMREG,RM_XMM|BITS128,0,0}, nasm_bytecodes+13242, IF_AMD|IF_SSE5},
+    {I_VPROTD, 2, {XMMREG,RM_XMM|BITS128,0,0,0}, nasm_bytecodes+13249, IF_AMD|IF_SSE5},
+    {I_VPROTD, 3, {XMMREG,RM_XMM|BITS128,IMMEDIATE|BITS8,0,0}, nasm_bytecodes+7188, IF_AMD|IF_SSE5},
+    {I_VPROTD, 2, {XMMREG,IMMEDIATE|BITS8,0,0,0}, nasm_bytecodes+7196, IF_AMD|IF_SSE5},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VPROTQ[] = {
+    {I_VPROTQ, 3, {XMMREG,RM_XMM|BITS128,XMMREG,0,0}, nasm_bytecodes+13256, IF_AMD|IF_SSE5},
+    {I_VPROTQ, 2, {XMMREG,XMMREG,0,0,0}, nasm_bytecodes+13263, IF_AMD|IF_SSE5},
+    {I_VPROTQ, 3, {XMMREG,XMMREG,RM_XMM|BITS128,0,0}, nasm_bytecodes+13270, IF_AMD|IF_SSE5},
+    {I_VPROTQ, 2, {XMMREG,RM_XMM|BITS128,0,0,0}, nasm_bytecodes+13277, IF_AMD|IF_SSE5},
+    {I_VPROTQ, 3, {XMMREG,RM_XMM|BITS128,IMMEDIATE|BITS8,0,0}, nasm_bytecodes+7204, IF_AMD|IF_SSE5},
+    {I_VPROTQ, 2, {XMMREG,IMMEDIATE|BITS8,0,0,0}, nasm_bytecodes+7212, IF_AMD|IF_SSE5},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VPROTW[] = {
+    {I_VPROTW, 3, {XMMREG,RM_XMM|BITS128,XMMREG,0,0}, nasm_bytecodes+13284, IF_AMD|IF_SSE5},
+    {I_VPROTW, 2, {XMMREG,XMMREG,0,0,0}, nasm_bytecodes+13291, IF_AMD|IF_SSE5},
+    {I_VPROTW, 3, {XMMREG,XMMREG,RM_XMM|BITS128,0,0}, nasm_bytecodes+13298, IF_AMD|IF_SSE5},
+    {I_VPROTW, 2, {XMMREG,RM_XMM|BITS128,0,0,0}, nasm_bytecodes+13305, IF_AMD|IF_SSE5},
+    {I_VPROTW, 3, {XMMREG,RM_XMM|BITS128,IMMEDIATE|BITS8,0,0}, nasm_bytecodes+7220, IF_AMD|IF_SSE5},
+    {I_VPROTW, 2, {XMMREG,IMMEDIATE|BITS8,0,0,0}, nasm_bytecodes+7228, IF_AMD|IF_SSE5},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VPSADBW[] = {
+    {I_VPSADBW, 3, {XMMREG,XMMREG,RM_XMM|BITS128,0,0}, nasm_bytecodes+11345, IF_AVX|IF_SANDYBRIDGE},
+    {I_VPSADBW, 2, {XMMREG,RM_XMM|BITS128,0,0,0}, nasm_bytecodes+11352, IF_AVX|IF_SANDYBRIDGE},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VPSHAB[] = {
+    {I_VPSHAB, 3, {XMMREG,RM_XMM|BITS128,XMMREG,0,0}, nasm_bytecodes+13312, IF_AMD|IF_SSE5},
+    {I_VPSHAB, 2, {XMMREG,XMMREG,0,0,0}, nasm_bytecodes+13319, IF_AMD|IF_SSE5},
+    {I_VPSHAB, 3, {XMMREG,XMMREG,RM_XMM|BITS128,0,0}, nasm_bytecodes+13326, IF_AMD|IF_SSE5},
+    {I_VPSHAB, 2, {XMMREG,RM_XMM|BITS128,0,0,0}, nasm_bytecodes+13333, IF_AMD|IF_SSE5},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VPSHAD[] = {
+    {I_VPSHAD, 3, {XMMREG,RM_XMM|BITS128,XMMREG,0,0}, nasm_bytecodes+13340, IF_AMD|IF_SSE5},
+    {I_VPSHAD, 2, {XMMREG,XMMREG,0,0,0}, nasm_bytecodes+13347, IF_AMD|IF_SSE5},
+    {I_VPSHAD, 3, {XMMREG,XMMREG,RM_XMM|BITS128,0,0}, nasm_bytecodes+13354, IF_AMD|IF_SSE5},
+    {I_VPSHAD, 2, {XMMREG,RM_XMM|BITS128,0,0,0}, nasm_bytecodes+13361, IF_AMD|IF_SSE5},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VPSHAQ[] = {
+    {I_VPSHAQ, 3, {XMMREG,RM_XMM|BITS128,XMMREG,0,0}, nasm_bytecodes+13368, IF_AMD|IF_SSE5},
+    {I_VPSHAQ, 2, {XMMREG,XMMREG,0,0,0}, nasm_bytecodes+13375, IF_AMD|IF_SSE5},
+    {I_VPSHAQ, 3, {XMMREG,XMMREG,RM_XMM|BITS128,0,0}, nasm_bytecodes+13382, IF_AMD|IF_SSE5},
+    {I_VPSHAQ, 2, {XMMREG,RM_XMM|BITS128,0,0,0}, nasm_bytecodes+13389, IF_AMD|IF_SSE5},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VPSHAW[] = {
+    {I_VPSHAW, 3, {XMMREG,RM_XMM|BITS128,XMMREG,0,0}, nasm_bytecodes+13396, IF_AMD|IF_SSE5},
+    {I_VPSHAW, 2, {XMMREG,XMMREG,0,0,0}, nasm_bytecodes+13403, IF_AMD|IF_SSE5},
+    {I_VPSHAW, 3, {XMMREG,XMMREG,RM_XMM|BITS128,0,0}, nasm_bytecodes+13410, IF_AMD|IF_SSE5},
+    {I_VPSHAW, 2, {XMMREG,RM_XMM|BITS128,0,0,0}, nasm_bytecodes+13417, IF_AMD|IF_SSE5},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VPSHLB[] = {
+    {I_VPSHLB, 3, {XMMREG,RM_XMM|BITS128,XMMREG,0,0}, nasm_bytecodes+13424, IF_AMD|IF_SSE5},
+    {I_VPSHLB, 2, {XMMREG,XMMREG,0,0,0}, nasm_bytecodes+13431, IF_AMD|IF_SSE5},
+    {I_VPSHLB, 3, {XMMREG,XMMREG,RM_XMM|BITS128,0,0}, nasm_bytecodes+13438, IF_AMD|IF_SSE5},
+    {I_VPSHLB, 2, {XMMREG,RM_XMM|BITS128,0,0,0}, nasm_bytecodes+13445, IF_AMD|IF_SSE5},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VPSHLD[] = {
+    {I_VPSHLD, 3, {XMMREG,RM_XMM|BITS128,XMMREG,0,0}, nasm_bytecodes+13452, IF_AMD|IF_SSE5},
+    {I_VPSHLD, 2, {XMMREG,XMMREG,0,0,0}, nasm_bytecodes+13459, IF_AMD|IF_SSE5},
+    {I_VPSHLD, 3, {XMMREG,XMMREG,RM_XMM|BITS128,0,0}, nasm_bytecodes+13466, IF_AMD|IF_SSE5},
+    {I_VPSHLD, 2, {XMMREG,RM_XMM|BITS128,0,0,0}, nasm_bytecodes+13473, IF_AMD|IF_SSE5},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VPSHLQ[] = {
+    {I_VPSHLQ, 3, {XMMREG,RM_XMM|BITS128,XMMREG,0,0}, nasm_bytecodes+13480, IF_AMD|IF_SSE5},
+    {I_VPSHLQ, 2, {XMMREG,XMMREG,0,0,0}, nasm_bytecodes+13487, IF_AMD|IF_SSE5},
+    {I_VPSHLQ, 3, {XMMREG,XMMREG,RM_XMM|BITS128,0,0}, nasm_bytecodes+13494, IF_AMD|IF_SSE5},
+    {I_VPSHLQ, 2, {XMMREG,RM_XMM|BITS128,0,0,0}, nasm_bytecodes+13501, IF_AMD|IF_SSE5},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VPSHLW[] = {
+    {I_VPSHLW, 3, {XMMREG,RM_XMM|BITS128,XMMREG,0,0}, nasm_bytecodes+13508, IF_AMD|IF_SSE5},
+    {I_VPSHLW, 2, {XMMREG,XMMREG,0,0,0}, nasm_bytecodes+13515, IF_AMD|IF_SSE5},
+    {I_VPSHLW, 3, {XMMREG,XMMREG,RM_XMM|BITS128,0,0}, nasm_bytecodes+13522, IF_AMD|IF_SSE5},
+    {I_VPSHLW, 2, {XMMREG,RM_XMM|BITS128,0,0,0}, nasm_bytecodes+13529, IF_AMD|IF_SSE5},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VPSHUFB[] = {
+    {I_VPSHUFB, 3, {XMMREG,XMMREG,RM_XMM|BITS128,0,0}, nasm_bytecodes+11359, IF_AVX|IF_SANDYBRIDGE},
+    {I_VPSHUFB, 2, {XMMREG,RM_XMM|BITS128,0,0,0}, nasm_bytecodes+11366, IF_AVX|IF_SANDYBRIDGE},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VPSHUFD[] = {
+    {I_VPSHUFD, 3, {XMMREG,RM_XMM|BITS128,IMMEDIATE|BITS8,0,0}, nasm_bytecodes+6596, IF_AVX|IF_SANDYBRIDGE},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VPSHUFHW[] = {
+    {I_VPSHUFHW, 3, {XMMREG,RM_XMM|BITS128,IMMEDIATE|BITS8,0,0}, nasm_bytecodes+6604, IF_AVX|IF_SANDYBRIDGE},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VPSHUFLW[] = {
+    {I_VPSHUFLW, 3, {XMMREG,RM_XMM|BITS128,IMMEDIATE|BITS8,0,0}, nasm_bytecodes+6612, IF_AVX|IF_SANDYBRIDGE},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VPSIGNB[] = {
+    {I_VPSIGNB, 3, {XMMREG,XMMREG,RM_XMM|BITS128,0,0}, nasm_bytecodes+11373, IF_AVX|IF_SANDYBRIDGE},
+    {I_VPSIGNB, 2, {XMMREG,RM_XMM|BITS128,0,0,0}, nasm_bytecodes+11380, IF_AVX|IF_SANDYBRIDGE},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VPSIGND[] = {
+    {I_VPSIGND, 3, {XMMREG,XMMREG,RM_XMM|BITS128,0,0}, nasm_bytecodes+11401, IF_AVX|IF_SANDYBRIDGE},
+    {I_VPSIGND, 2, {XMMREG,RM_XMM|BITS128,0,0,0}, nasm_bytecodes+11408, IF_AVX|IF_SANDYBRIDGE},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VPSIGNW[] = {
+    {I_VPSIGNW, 3, {XMMREG,XMMREG,RM_XMM|BITS128,0,0}, nasm_bytecodes+11387, IF_AVX|IF_SANDYBRIDGE},
+    {I_VPSIGNW, 2, {XMMREG,RM_XMM|BITS128,0,0,0}, nasm_bytecodes+11394, IF_AVX|IF_SANDYBRIDGE},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VPSLLD[] = {
+    {I_VPSLLD, 3, {XMMREG,XMMREG,RM_XMM|BITS128,0,0}, nasm_bytecodes+11429, IF_AVX|IF_SANDYBRIDGE},
+    {I_VPSLLD, 2, {XMMREG,RM_XMM|BITS128,0,0,0}, nasm_bytecodes+11436, IF_AVX|IF_SANDYBRIDGE},
+    {I_VPSLLD, 3, {XMMREG,XMMREG,IMMEDIATE|BITS8,0,0}, nasm_bytecodes+6668, IF_AVX|IF_SANDYBRIDGE},
+    {I_VPSLLD, 2, {XMMREG,IMMEDIATE|BITS8,0,0,0}, nasm_bytecodes+6676, IF_AVX|IF_SANDYBRIDGE},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VPSLLDQ[] = {
+    {I_VPSLLDQ, 3, {XMMREG,XMMREG,IMMEDIATE|BITS8,0,0}, nasm_bytecodes+6620, IF_AVX|IF_SANDYBRIDGE},
+    {I_VPSLLDQ, 2, {XMMREG,IMMEDIATE|BITS8,0,0,0}, nasm_bytecodes+6628, IF_AVX|IF_SANDYBRIDGE},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VPSLLQ[] = {
+    {I_VPSLLQ, 3, {XMMREG,XMMREG,RM_XMM|BITS128,0,0}, nasm_bytecodes+11443, IF_AVX|IF_SANDYBRIDGE},
+    {I_VPSLLQ, 2, {XMMREG,RM_XMM|BITS128,0,0,0}, nasm_bytecodes+11450, IF_AVX|IF_SANDYBRIDGE},
+    {I_VPSLLQ, 3, {XMMREG,XMMREG,IMMEDIATE|BITS8,0,0}, nasm_bytecodes+6684, IF_AVX|IF_SANDYBRIDGE},
+    {I_VPSLLQ, 2, {XMMREG,IMMEDIATE|BITS8,0,0,0}, nasm_bytecodes+6692, IF_AVX|IF_SANDYBRIDGE},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VPSLLW[] = {
+    {I_VPSLLW, 3, {XMMREG,XMMREG,RM_XMM|BITS128,0,0}, nasm_bytecodes+11415, IF_AVX|IF_SANDYBRIDGE},
+    {I_VPSLLW, 2, {XMMREG,RM_XMM|BITS128,0,0,0}, nasm_bytecodes+11422, IF_AVX|IF_SANDYBRIDGE},
+    {I_VPSLLW, 3, {XMMREG,XMMREG,IMMEDIATE|BITS8,0,0}, nasm_bytecodes+6652, IF_AVX|IF_SANDYBRIDGE},
+    {I_VPSLLW, 2, {XMMREG,IMMEDIATE|BITS8,0,0,0}, nasm_bytecodes+6660, IF_AVX|IF_SANDYBRIDGE},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VPSRAD[] = {
+    {I_VPSRAD, 3, {XMMREG,XMMREG,RM_XMM|BITS128,0,0}, nasm_bytecodes+11471, IF_AVX|IF_SANDYBRIDGE},
+    {I_VPSRAD, 2, {XMMREG,RM_XMM|BITS128,0,0,0}, nasm_bytecodes+11478, IF_AVX|IF_SANDYBRIDGE},
+    {I_VPSRAD, 3, {XMMREG,XMMREG,IMMEDIATE|BITS8,0,0}, nasm_bytecodes+6716, IF_AVX|IF_SANDYBRIDGE},
+    {I_VPSRAD, 2, {XMMREG,IMMEDIATE|BITS8,0,0,0}, nasm_bytecodes+6724, IF_AVX|IF_SANDYBRIDGE},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VPSRAW[] = {
+    {I_VPSRAW, 3, {XMMREG,XMMREG,RM_XMM|BITS128,0,0}, nasm_bytecodes+11457, IF_AVX|IF_SANDYBRIDGE},
+    {I_VPSRAW, 2, {XMMREG,RM_XMM|BITS128,0,0,0}, nasm_bytecodes+11464, IF_AVX|IF_SANDYBRIDGE},
+    {I_VPSRAW, 3, {XMMREG,XMMREG,IMMEDIATE|BITS8,0,0}, nasm_bytecodes+6700, IF_AVX|IF_SANDYBRIDGE},
+    {I_VPSRAW, 2, {XMMREG,IMMEDIATE|BITS8,0,0,0}, nasm_bytecodes+6708, IF_AVX|IF_SANDYBRIDGE},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VPSRLD[] = {
+    {I_VPSRLD, 3, {XMMREG,XMMREG,RM_XMM|BITS128,0,0}, nasm_bytecodes+11499, IF_AVX|IF_SANDYBRIDGE},
+    {I_VPSRLD, 2, {XMMREG,RM_XMM|BITS128,0,0,0}, nasm_bytecodes+11506, IF_AVX|IF_SANDYBRIDGE},
+    {I_VPSRLD, 3, {XMMREG,XMMREG,IMMEDIATE|BITS8,0,0}, nasm_bytecodes+6748, IF_AVX|IF_SANDYBRIDGE},
+    {I_VPSRLD, 2, {XMMREG,IMMEDIATE|BITS8,0,0,0}, nasm_bytecodes+6756, IF_AVX|IF_SANDYBRIDGE},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VPSRLDQ[] = {
+    {I_VPSRLDQ, 3, {XMMREG,XMMREG,IMMEDIATE|BITS8,0,0}, nasm_bytecodes+6636, IF_AVX|IF_SANDYBRIDGE},
+    {I_VPSRLDQ, 2, {XMMREG,IMMEDIATE|BITS8,0,0,0}, nasm_bytecodes+6644, IF_AVX|IF_SANDYBRIDGE},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VPSRLQ[] = {
+    {I_VPSRLQ, 3, {XMMREG,XMMREG,RM_XMM|BITS128,0,0}, nasm_bytecodes+11513, IF_AVX|IF_SANDYBRIDGE},
+    {I_VPSRLQ, 2, {XMMREG,RM_XMM|BITS128,0,0,0}, nasm_bytecodes+11520, IF_AVX|IF_SANDYBRIDGE},
+    {I_VPSRLQ, 3, {XMMREG,XMMREG,IMMEDIATE|BITS8,0,0}, nasm_bytecodes+6764, IF_AVX|IF_SANDYBRIDGE},
+    {I_VPSRLQ, 2, {XMMREG,IMMEDIATE|BITS8,0,0,0}, nasm_bytecodes+6772, IF_AVX|IF_SANDYBRIDGE},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VPSRLW[] = {
+    {I_VPSRLW, 3, {XMMREG,XMMREG,RM_XMM|BITS128,0,0}, nasm_bytecodes+11485, IF_AVX|IF_SANDYBRIDGE},
+    {I_VPSRLW, 2, {XMMREG,RM_XMM|BITS128,0,0,0}, nasm_bytecodes+11492, IF_AVX|IF_SANDYBRIDGE},
+    {I_VPSRLW, 3, {XMMREG,XMMREG,IMMEDIATE|BITS8,0,0}, nasm_bytecodes+6732, IF_AVX|IF_SANDYBRIDGE},
+    {I_VPSRLW, 2, {XMMREG,IMMEDIATE|BITS8,0,0,0}, nasm_bytecodes+6740, IF_AVX|IF_SANDYBRIDGE},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VPSUBB[] = {
+    {I_VPSUBB, 3, {XMMREG,XMMREG,RM_XMM|BITS128,0,0}, nasm_bytecodes+11541, IF_AVX|IF_SANDYBRIDGE},
+    {I_VPSUBB, 2, {XMMREG,RM_XMM|BITS128,0,0,0}, nasm_bytecodes+11548, IF_AVX|IF_SANDYBRIDGE},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VPSUBD[] = {
+    {I_VPSUBD, 3, {XMMREG,XMMREG,RM_XMM|BITS128,0,0}, nasm_bytecodes+11569, IF_AVX|IF_SANDYBRIDGE},
+    {I_VPSUBD, 2, {XMMREG,RM_XMM|BITS128,0,0,0}, nasm_bytecodes+11576, IF_AVX|IF_SANDYBRIDGE},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VPSUBQ[] = {
+    {I_VPSUBQ, 3, {XMMREG,XMMREG,RM_XMM|BITS128,0,0}, nasm_bytecodes+11583, IF_AVX|IF_SANDYBRIDGE},
+    {I_VPSUBQ, 2, {XMMREG,RM_XMM|BITS128,0,0,0}, nasm_bytecodes+11590, IF_AVX|IF_SANDYBRIDGE},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VPSUBSB[] = {
+    {I_VPSUBSB, 3, {XMMREG,XMMREG,RM_XMM|BITS128,0,0}, nasm_bytecodes+11597, IF_AVX|IF_SANDYBRIDGE},
+    {I_VPSUBSB, 2, {XMMREG,RM_XMM|BITS128,0,0,0}, nasm_bytecodes+11604, IF_AVX|IF_SANDYBRIDGE},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VPSUBSW[] = {
+    {I_VPSUBSW, 3, {XMMREG,XMMREG,RM_XMM|BITS128,0,0}, nasm_bytecodes+11611, IF_AVX|IF_SANDYBRIDGE},
+    {I_VPSUBSW, 2, {XMMREG,RM_XMM|BITS128,0,0,0}, nasm_bytecodes+11618, IF_AVX|IF_SANDYBRIDGE},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VPSUBUSB[] = {
+    {I_VPSUBUSB, 3, {XMMREG,XMMREG,RM_XMM|BITS128,0,0}, nasm_bytecodes+11625, IF_AVX|IF_SANDYBRIDGE},
+    {I_VPSUBUSB, 2, {XMMREG,RM_XMM|BITS128,0,0,0}, nasm_bytecodes+11632, IF_AVX|IF_SANDYBRIDGE},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VPSUBUSW[] = {
+    {I_VPSUBUSW, 3, {XMMREG,XMMREG,RM_XMM|BITS128,0,0}, nasm_bytecodes+11639, IF_AVX|IF_SANDYBRIDGE},
+    {I_VPSUBUSW, 2, {XMMREG,RM_XMM|BITS128,0,0,0}, nasm_bytecodes+11646, IF_AVX|IF_SANDYBRIDGE},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VPSUBW[] = {
+    {I_VPSUBW, 3, {XMMREG,XMMREG,RM_XMM|BITS128,0,0}, nasm_bytecodes+11555, IF_AVX|IF_SANDYBRIDGE},
+    {I_VPSUBW, 2, {XMMREG,RM_XMM|BITS128,0,0,0}, nasm_bytecodes+11562, IF_AVX|IF_SANDYBRIDGE},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VPTEST[] = {
+    {I_VPTEST, 2, {XMMREG,RM_XMM|BITS128,0,0,0}, nasm_bytecodes+11527, IF_AVX|IF_SANDYBRIDGE},
+    {I_VPTEST, 2, {YMMREG,RM_YMM|BITS256,0,0,0}, nasm_bytecodes+11534, IF_AVX|IF_SANDYBRIDGE},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VPUNPCKHBW[] = {
+    {I_VPUNPCKHBW, 3, {XMMREG,XMMREG,RM_XMM|BITS128,0,0}, nasm_bytecodes+11653, IF_AVX|IF_SANDYBRIDGE},
+    {I_VPUNPCKHBW, 2, {XMMREG,RM_XMM|BITS128,0,0,0}, nasm_bytecodes+11660, IF_AVX|IF_SANDYBRIDGE},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VPUNPCKHDQ[] = {
+    {I_VPUNPCKHDQ, 3, {XMMREG,XMMREG,RM_XMM|BITS128,0,0}, nasm_bytecodes+11681, IF_AVX|IF_SANDYBRIDGE},
+    {I_VPUNPCKHDQ, 2, {XMMREG,RM_XMM|BITS128,0,0,0}, nasm_bytecodes+11688, IF_AVX|IF_SANDYBRIDGE},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VPUNPCKHQDQ[] = {
+    {I_VPUNPCKHQDQ, 3, {XMMREG,XMMREG,RM_XMM|BITS128,0,0}, nasm_bytecodes+11695, IF_AVX|IF_SANDYBRIDGE},
+    {I_VPUNPCKHQDQ, 2, {XMMREG,RM_XMM|BITS128,0,0,0}, nasm_bytecodes+11702, IF_AVX|IF_SANDYBRIDGE},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VPUNPCKHWD[] = {
+    {I_VPUNPCKHWD, 3, {XMMREG,XMMREG,RM_XMM|BITS128,0,0}, nasm_bytecodes+11667, IF_AVX|IF_SANDYBRIDGE},
+    {I_VPUNPCKHWD, 2, {XMMREG,RM_XMM|BITS128,0,0,0}, nasm_bytecodes+11674, IF_AVX|IF_SANDYBRIDGE},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VPUNPCKLBW[] = {
+    {I_VPUNPCKLBW, 3, {XMMREG,XMMREG,RM_XMM|BITS128,0,0}, nasm_bytecodes+11709, IF_AVX|IF_SANDYBRIDGE},
+    {I_VPUNPCKLBW, 2, {XMMREG,RM_XMM|BITS128,0,0,0}, nasm_bytecodes+11716, IF_AVX|IF_SANDYBRIDGE},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VPUNPCKLDQ[] = {
+    {I_VPUNPCKLDQ, 3, {XMMREG,XMMREG,RM_XMM|BITS128,0,0}, nasm_bytecodes+11737, IF_AVX|IF_SANDYBRIDGE},
+    {I_VPUNPCKLDQ, 2, {XMMREG,RM_XMM|BITS128,0,0,0}, nasm_bytecodes+11744, IF_AVX|IF_SANDYBRIDGE},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VPUNPCKLQDQ[] = {
+    {I_VPUNPCKLQDQ, 3, {XMMREG,XMMREG,RM_XMM|BITS128,0,0}, nasm_bytecodes+11751, IF_AVX|IF_SANDYBRIDGE},
+    {I_VPUNPCKLQDQ, 2, {XMMREG,RM_XMM|BITS128,0,0,0}, nasm_bytecodes+11758, IF_AVX|IF_SANDYBRIDGE},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VPUNPCKLWD[] = {
+    {I_VPUNPCKLWD, 3, {XMMREG,XMMREG,RM_XMM|BITS128,0,0}, nasm_bytecodes+11723, IF_AVX|IF_SANDYBRIDGE},
+    {I_VPUNPCKLWD, 2, {XMMREG,RM_XMM|BITS128,0,0,0}, nasm_bytecodes+11730, IF_AVX|IF_SANDYBRIDGE},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VPXOR[] = {
+    {I_VPXOR, 3, {XMMREG,XMMREG,RM_XMM|BITS128,0,0}, nasm_bytecodes+11765, IF_AVX|IF_SANDYBRIDGE},
+    {I_VPXOR, 2, {XMMREG,RM_XMM|BITS128,0,0,0}, nasm_bytecodes+11772, IF_AVX|IF_SANDYBRIDGE},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VRCPPS[] = {
+    {I_VRCPPS, 2, {XMMREG,RM_XMM|BITS128,0,0,0}, nasm_bytecodes+11779, IF_AVX|IF_SANDYBRIDGE},
+    {I_VRCPPS, 2, {YMMREG,RM_YMM|BITS256,0,0,0}, nasm_bytecodes+11786, IF_AVX|IF_SANDYBRIDGE},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VRCPSS[] = {
+    {I_VRCPSS, 3, {XMMREG,XMMREG,RM_XMM|BITS32,0,0}, nasm_bytecodes+11793, IF_AVX|IF_SANDYBRIDGE},
+    {I_VRCPSS, 2, {XMMREG,RM_XMM|BITS32,0,0,0}, nasm_bytecodes+11800, IF_AVX|IF_SANDYBRIDGE},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VROUNDPD[] = {
+    {I_VROUNDPD, 3, {XMMREG,RM_XMM|BITS128,IMMEDIATE|BITS8,0,0}, nasm_bytecodes+6780, IF_AVX|IF_SANDYBRIDGE},
+    {I_VROUNDPD, 3, {YMMREG,RM_YMM|BITS256,IMMEDIATE|BITS8,0,0}, nasm_bytecodes+6788, IF_AVX|IF_SANDYBRIDGE},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VROUNDPS[] = {
+    {I_VROUNDPS, 3, {XMMREG,RM_XMM|BITS128,IMMEDIATE|BITS8,0,0}, nasm_bytecodes+6796, IF_AVX|IF_SANDYBRIDGE},
+    {I_VROUNDPS, 3, {YMMREG,RM_YMM|BITS256,IMMEDIATE|BITS8,0,0}, nasm_bytecodes+6804, IF_AVX|IF_SANDYBRIDGE},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VROUNDSD[] = {
+    {I_VROUNDSD, 4, {XMMREG,XMMREG,RM_XMM|BITS64,IMMEDIATE|BITS8,0}, nasm_bytecodes+6812, IF_AVX|IF_SANDYBRIDGE},
+    {I_VROUNDSD, 3, {XMMREG,RM_XMM|BITS64,IMMEDIATE|BITS8,0,0}, nasm_bytecodes+6820, IF_AVX|IF_SANDYBRIDGE},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VROUNDSS[] = {
+    {I_VROUNDSS, 4, {XMMREG,XMMREG,RM_XMM|BITS32,IMMEDIATE|BITS8,0}, nasm_bytecodes+6828, IF_AVX|IF_SANDYBRIDGE},
+    {I_VROUNDSS, 3, {XMMREG,RM_XMM|BITS32,IMMEDIATE|BITS8,0,0}, nasm_bytecodes+6836, IF_AVX|IF_SANDYBRIDGE},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VRSQRTPS[] = {
+    {I_VRSQRTPS, 2, {XMMREG,RM_XMM|BITS128,0,0,0}, nasm_bytecodes+11807, IF_AVX|IF_SANDYBRIDGE},
+    {I_VRSQRTPS, 2, {YMMREG,RM_YMM|BITS256,0,0,0}, nasm_bytecodes+11814, IF_AVX|IF_SANDYBRIDGE},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VRSQRTSS[] = {
+    {I_VRSQRTSS, 3, {XMMREG,XMMREG,RM_XMM|BITS32,0,0}, nasm_bytecodes+11821, IF_AVX|IF_SANDYBRIDGE},
+    {I_VRSQRTSS, 2, {XMMREG,RM_XMM|BITS32,0,0,0}, nasm_bytecodes+11828, IF_AVX|IF_SANDYBRIDGE},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VSHUFPD[] = {
+    {I_VSHUFPD, 4, {XMMREG,XMMREG,RM_XMM|BITS128,IMMEDIATE|BITS8,0}, nasm_bytecodes+6844, IF_AVX|IF_SANDYBRIDGE},
+    {I_VSHUFPD, 3, {XMMREG,RM_XMM|BITS128,IMMEDIATE|BITS8,0,0}, nasm_bytecodes+6852, IF_AVX|IF_SANDYBRIDGE},
+    {I_VSHUFPD, 4, {YMMREG,YMMREG,RM_YMM|BITS256,IMMEDIATE|BITS8,0}, nasm_bytecodes+6860, IF_AVX|IF_SANDYBRIDGE},
+    {I_VSHUFPD, 3, {YMMREG,RM_YMM|BITS256,IMMEDIATE|BITS8,0,0}, nasm_bytecodes+6868, IF_AVX|IF_SANDYBRIDGE},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VSHUFPS[] = {
+    {I_VSHUFPS, 4, {XMMREG,XMMREG,RM_XMM|BITS128,IMMEDIATE|BITS8,0}, nasm_bytecodes+6876, IF_AVX|IF_SANDYBRIDGE},
+    {I_VSHUFPS, 3, {XMMREG,RM_XMM|BITS128,IMMEDIATE|BITS8,0,0}, nasm_bytecodes+6884, IF_AVX|IF_SANDYBRIDGE},
+    {I_VSHUFPS, 4, {YMMREG,YMMREG,RM_YMM|BITS256,IMMEDIATE|BITS8,0}, nasm_bytecodes+6892, IF_AVX|IF_SANDYBRIDGE},
+    {I_VSHUFPS, 3, {YMMREG,RM_YMM|BITS256,IMMEDIATE|BITS8,0,0}, nasm_bytecodes+6900, IF_AVX|IF_SANDYBRIDGE},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VSQRTPD[] = {
+    {I_VSQRTPD, 2, {XMMREG,RM_XMM|BITS128,0,0,0}, nasm_bytecodes+11835, IF_AVX|IF_SANDYBRIDGE},
+    {I_VSQRTPD, 2, {YMMREG,RM_YMM|BITS256,0,0,0}, nasm_bytecodes+11842, IF_AVX|IF_SANDYBRIDGE},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VSQRTPS[] = {
+    {I_VSQRTPS, 2, {XMMREG,RM_XMM|BITS128,0,0,0}, nasm_bytecodes+11849, IF_AVX|IF_SANDYBRIDGE},
+    {I_VSQRTPS, 2, {YMMREG,RM_YMM|BITS256,0,0,0}, nasm_bytecodes+11856, IF_AVX|IF_SANDYBRIDGE},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VSQRTSD[] = {
+    {I_VSQRTSD, 3, {XMMREG,XMMREG,RM_XMM|BITS64,0,0}, nasm_bytecodes+11863, IF_AVX|IF_SANDYBRIDGE},
+    {I_VSQRTSD, 2, {XMMREG,RM_XMM|BITS64,0,0,0}, nasm_bytecodes+11870, IF_AVX|IF_SANDYBRIDGE},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VSQRTSS[] = {
+    {I_VSQRTSS, 3, {XMMREG,XMMREG,RM_XMM|BITS32,0,0}, nasm_bytecodes+11877, IF_AVX|IF_SANDYBRIDGE},
+    {I_VSQRTSS, 2, {XMMREG,RM_XMM|BITS32,0,0,0}, nasm_bytecodes+11884, IF_AVX|IF_SANDYBRIDGE},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VSTMXCSR[] = {
+    {I_VSTMXCSR, 1, {MEMORY|BITS32,0,0,0,0}, nasm_bytecodes+11891, IF_AVX|IF_SANDYBRIDGE},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VSUBPD[] = {
+    {I_VSUBPD, 3, {XMMREG,XMMREG,RM_XMM|BITS128,0,0}, nasm_bytecodes+11898, IF_AVX|IF_SANDYBRIDGE},
+    {I_VSUBPD, 2, {XMMREG,RM_XMM|BITS128,0,0,0}, nasm_bytecodes+11905, IF_AVX|IF_SANDYBRIDGE},
+    {I_VSUBPD, 3, {YMMREG,YMMREG,RM_YMM|BITS256,0,0}, nasm_bytecodes+11912, IF_AVX|IF_SANDYBRIDGE},
+    {I_VSUBPD, 2, {YMMREG,RM_YMM|BITS256,0,0,0}, nasm_bytecodes+11919, IF_AVX|IF_SANDYBRIDGE},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VSUBPS[] = {
+    {I_VSUBPS, 3, {XMMREG,XMMREG,RM_XMM|BITS128,0,0}, nasm_bytecodes+11926, IF_AVX|IF_SANDYBRIDGE},
+    {I_VSUBPS, 2, {XMMREG,RM_XMM|BITS128,0,0,0}, nasm_bytecodes+11933, IF_AVX|IF_SANDYBRIDGE},
+    {I_VSUBPS, 3, {YMMREG,YMMREG,RM_YMM|BITS256,0,0}, nasm_bytecodes+11940, IF_AVX|IF_SANDYBRIDGE},
+    {I_VSUBPS, 2, {YMMREG,RM_YMM|BITS256,0,0,0}, nasm_bytecodes+11947, IF_AVX|IF_SANDYBRIDGE},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VSUBSD[] = {
+    {I_VSUBSD, 3, {XMMREG,XMMREG,RM_XMM|BITS64,0,0}, nasm_bytecodes+11954, IF_AVX|IF_SANDYBRIDGE},
+    {I_VSUBSD, 2, {XMMREG,RM_XMM|BITS64,0,0,0}, nasm_bytecodes+11961, IF_AVX|IF_SANDYBRIDGE},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VSUBSS[] = {
+    {I_VSUBSS, 3, {XMMREG,XMMREG,RM_XMM|BITS32,0,0}, nasm_bytecodes+11968, IF_AVX|IF_SANDYBRIDGE},
+    {I_VSUBSS, 2, {XMMREG,RM_XMM|BITS32,0,0,0}, nasm_bytecodes+11975, IF_AVX|IF_SANDYBRIDGE},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VTESTPD[] = {
+    {I_VTESTPD, 2, {XMMREG,RM_XMM|BITS128,0,0,0}, nasm_bytecodes+11996, IF_AVX|IF_SANDYBRIDGE},
+    {I_VTESTPD, 2, {YMMREG,RM_YMM|BITS256,0,0,0}, nasm_bytecodes+12003, IF_AVX|IF_SANDYBRIDGE},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VTESTPS[] = {
+    {I_VTESTPS, 2, {XMMREG,RM_XMM|BITS128,0,0,0}, nasm_bytecodes+11982, IF_AVX|IF_SANDYBRIDGE},
+    {I_VTESTPS, 2, {YMMREG,RM_YMM|BITS256,0,0,0}, nasm_bytecodes+11989, IF_AVX|IF_SANDYBRIDGE},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VUCOMISD[] = {
+    {I_VUCOMISD, 2, {XMMREG,RM_XMM|BITS64,0,0,0}, nasm_bytecodes+12010, IF_AVX|IF_SANDYBRIDGE},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VUCOMISS[] = {
+    {I_VUCOMISS, 2, {XMMREG,RM_XMM|BITS32,0,0,0}, nasm_bytecodes+12017, IF_AVX|IF_SANDYBRIDGE},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VUNPCKHPD[] = {
+    {I_VUNPCKHPD, 3, {XMMREG,XMMREG,RM_XMM|BITS128,0,0}, nasm_bytecodes+12024, IF_AVX|IF_SANDYBRIDGE},
+    {I_VUNPCKHPD, 2, {XMMREG,RM_XMM|BITS128,0,0,0}, nasm_bytecodes+12031, IF_AVX|IF_SANDYBRIDGE},
+    {I_VUNPCKHPD, 3, {YMMREG,YMMREG,RM_YMM|BITS256,0,0}, nasm_bytecodes+12038, IF_AVX|IF_SANDYBRIDGE},
+    {I_VUNPCKHPD, 2, {YMMREG,RM_YMM|BITS256,0,0,0}, nasm_bytecodes+12045, IF_AVX|IF_SANDYBRIDGE},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VUNPCKHPS[] = {
+    {I_VUNPCKHPS, 3, {XMMREG,XMMREG,RM_XMM|BITS128,0,0}, nasm_bytecodes+12052, IF_AVX|IF_SANDYBRIDGE},
+    {I_VUNPCKHPS, 2, {XMMREG,RM_XMM|BITS128,0,0,0}, nasm_bytecodes+12059, IF_AVX|IF_SANDYBRIDGE},
+    {I_VUNPCKHPS, 3, {YMMREG,YMMREG,RM_YMM|BITS256,0,0}, nasm_bytecodes+12066, IF_AVX|IF_SANDYBRIDGE},
+    {I_VUNPCKHPS, 2, {YMMREG,RM_YMM|BITS256,0,0,0}, nasm_bytecodes+12073, IF_AVX|IF_SANDYBRIDGE},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VUNPCKLPD[] = {
+    {I_VUNPCKLPD, 3, {XMMREG,XMMREG,RM_XMM|BITS128,0,0}, nasm_bytecodes+12080, IF_AVX|IF_SANDYBRIDGE},
+    {I_VUNPCKLPD, 2, {XMMREG,RM_XMM|BITS128,0,0,0}, nasm_bytecodes+12087, IF_AVX|IF_SANDYBRIDGE},
+    {I_VUNPCKLPD, 3, {YMMREG,YMMREG,RM_YMM|BITS256,0,0}, nasm_bytecodes+12094, IF_AVX|IF_SANDYBRIDGE},
+    {I_VUNPCKLPD, 2, {YMMREG,RM_YMM|BITS256,0,0,0}, nasm_bytecodes+12101, IF_AVX|IF_SANDYBRIDGE},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VUNPCKLPS[] = {
+    {I_VUNPCKLPS, 3, {XMMREG,XMMREG,RM_XMM|BITS128,0,0}, nasm_bytecodes+12108, IF_AVX|IF_SANDYBRIDGE},
+    {I_VUNPCKLPS, 2, {XMMREG,RM_XMM|BITS128,0,0,0}, nasm_bytecodes+12115, IF_AVX|IF_SANDYBRIDGE},
+    {I_VUNPCKLPS, 3, {YMMREG,YMMREG,RM_YMM|BITS256,0,0}, nasm_bytecodes+12122, IF_AVX|IF_SANDYBRIDGE},
+    {I_VUNPCKLPS, 2, {YMMREG,RM_YMM|BITS256,0,0,0}, nasm_bytecodes+12129, IF_AVX|IF_SANDYBRIDGE},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VXORPD[] = {
+    {I_VXORPD, 3, {XMMREG,XMMREG,RM_XMM|BITS128,0,0}, nasm_bytecodes+12136, IF_AVX|IF_SANDYBRIDGE},
+    {I_VXORPD, 2, {XMMREG,RM_XMM|BITS128,0,0,0}, nasm_bytecodes+12143, IF_AVX|IF_SANDYBRIDGE},
+    {I_VXORPD, 3, {YMMREG,YMMREG,RM_YMM|BITS256,0,0}, nasm_bytecodes+12150, IF_AVX|IF_SANDYBRIDGE},
+    {I_VXORPD, 2, {YMMREG,RM_YMM|BITS256,0,0,0}, nasm_bytecodes+12157, IF_AVX|IF_SANDYBRIDGE},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VXORPS[] = {
+    {I_VXORPS, 3, {XMMREG,XMMREG,RM_XMM|BITS128,0,0}, nasm_bytecodes+12164, IF_AVX|IF_SANDYBRIDGE},
+    {I_VXORPS, 2, {XMMREG,RM_XMM|BITS128,0,0,0}, nasm_bytecodes+12171, IF_AVX|IF_SANDYBRIDGE},
+    {I_VXORPS, 3, {YMMREG,YMMREG,RM_YMM|BITS256,0,0}, nasm_bytecodes+12178, IF_AVX|IF_SANDYBRIDGE},
+    {I_VXORPS, 2, {YMMREG,RM_YMM|BITS256,0,0,0}, nasm_bytecodes+12185, IF_AVX|IF_SANDYBRIDGE},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VZEROALL[] = {
+    {I_VZEROALL, 0, {0,0,0,0,0}, nasm_bytecodes+15840, IF_AVX|IF_SANDYBRIDGE},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_VZEROUPPER[] = {
+    {I_VZEROUPPER, 0, {0,0,0,0,0}, nasm_bytecodes+15846, IF_AVX|IF_SANDYBRIDGE},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_WBINVD[] = {
+    {I_WBINVD, 0, {0,0,0,0,0}, nasm_bytecodes+19906, IF_486|IF_PRIV},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_WRMSR[] = {
+    {I_WRMSR, 0, {0,0,0,0,0}, nasm_bytecodes+19910, IF_PENT|IF_PRIV},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_WRSHR[] = {
+    {I_WRSHR, 1, {RM_GPR|BITS32,0,0,0,0}, nasm_bytecodes+14688, IF_P6|IF_CYRIX|IF_SMM},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_XADD[] = {
+    {I_XADD, 2, {MEMORY,REG_GPR|BITS8,0,0,0}, nasm_bytecodes+18749, IF_486|IF_SM},
+    {I_XADD, 2, {REG_GPR|BITS8,REG_GPR|BITS8,0,0,0}, nasm_bytecodes+18749, IF_486},
+    {I_XADD, 2, {MEMORY,REG_GPR|BITS16,0,0,0}, nasm_bytecodes+14694, IF_486|IF_SM},
+    {I_XADD, 2, {REG_GPR|BITS16,REG_GPR|BITS16,0,0,0}, nasm_bytecodes+14694, IF_486},
+    {I_XADD, 2, {MEMORY,REG_GPR|BITS32,0,0,0}, nasm_bytecodes+14700, IF_486|IF_SM},
+    {I_XADD, 2, {REG_GPR|BITS32,REG_GPR|BITS32,0,0,0}, nasm_bytecodes+14700, IF_486},
+    {I_XADD, 2, {MEMORY,REG_GPR|BITS64,0,0,0}, nasm_bytecodes+14706, IF_X64|IF_SM},
+    {I_XADD, 2, {REG_GPR|BITS64,REG_GPR|BITS64,0,0,0}, nasm_bytecodes+14706, IF_X64},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_XBTS[] = {
+    {I_XBTS, 2, {REG_GPR|BITS16,MEMORY,0,0,0}, nasm_bytecodes+14712, IF_386|IF_SW|IF_UNDOC},
+    {I_XBTS, 2, {REG_GPR|BITS16,REG_GPR|BITS16,0,0,0}, nasm_bytecodes+14712, IF_386|IF_UNDOC},
+    {I_XBTS, 2, {REG_GPR|BITS32,MEMORY,0,0,0}, nasm_bytecodes+14718, IF_386|IF_SD|IF_UNDOC},
+    {I_XBTS, 2, {REG_GPR|BITS32,REG_GPR|BITS32,0,0,0}, nasm_bytecodes+14718, IF_386|IF_UNDOC},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_XCHG[] = {
+    {I_XCHG, 2, {REG_AX,REG_GPR|BITS16,0,0,0}, nasm_bytecodes+19914, IF_8086},
+    {I_XCHG, 2, {REG_EAX,REG32NA,0,0,0}, nasm_bytecodes+19918, IF_386},
+    {I_XCHG, 2, {REG_RAX,REG_GPR|BITS64,0,0,0}, nasm_bytecodes+19922, IF_X64},
+    {I_XCHG, 2, {REG_GPR|BITS16,REG_AX,0,0,0}, nasm_bytecodes+19926, IF_8086},
+    {I_XCHG, 2, {REG32NA,REG_EAX,0,0,0}, nasm_bytecodes+19930, IF_386},
+    {I_XCHG, 2, {REG_GPR|BITS64,REG_RAX,0,0,0}, nasm_bytecodes+19934, IF_X64},
+    {I_XCHG, 2, {REG_EAX,REG_EAX,0,0,0}, nasm_bytecodes+19938, IF_386|IF_NOLONG},
+    {I_XCHG, 2, {REG_GPR|BITS8,MEMORY,0,0,0}, nasm_bytecodes+19942, IF_8086|IF_SM},
+    {I_XCHG, 2, {REG_GPR|BITS8,REG_GPR|BITS8,0,0,0}, nasm_bytecodes+19942, IF_8086},
+    {I_XCHG, 2, {REG_GPR|BITS16,MEMORY,0,0,0}, nasm_bytecodes+18754, IF_8086|IF_SM},
+    {I_XCHG, 2, {REG_GPR|BITS16,REG_GPR|BITS16,0,0,0}, nasm_bytecodes+18754, IF_8086},
+    {I_XCHG, 2, {REG_GPR|BITS32,MEMORY,0,0,0}, nasm_bytecodes+18759, IF_386|IF_SM},
+    {I_XCHG, 2, {REG_GPR|BITS32,REG_GPR|BITS32,0,0,0}, nasm_bytecodes+18759, IF_386},
+    {I_XCHG, 2, {REG_GPR|BITS64,MEMORY,0,0,0}, nasm_bytecodes+18764, IF_X64|IF_SM},
+    {I_XCHG, 2, {REG_GPR|BITS64,REG_GPR|BITS64,0,0,0}, nasm_bytecodes+18764, IF_X64},
+    {I_XCHG, 2, {MEMORY,REG_GPR|BITS8,0,0,0}, nasm_bytecodes+19946, IF_8086|IF_SM},
+    {I_XCHG, 2, {REG_GPR|BITS8,REG_GPR|BITS8,0,0,0}, nasm_bytecodes+19946, IF_8086},
+    {I_XCHG, 2, {MEMORY,REG_GPR|BITS16,0,0,0}, nasm_bytecodes+18769, IF_8086|IF_SM},
+    {I_XCHG, 2, {REG_GPR|BITS16,REG_GPR|BITS16,0,0,0}, nasm_bytecodes+18769, IF_8086},
+    {I_XCHG, 2, {MEMORY,REG_GPR|BITS32,0,0,0}, nasm_bytecodes+18774, IF_386|IF_SM},
+    {I_XCHG, 2, {REG_GPR|BITS32,REG_GPR|BITS32,0,0,0}, nasm_bytecodes+18774, IF_386},
+    {I_XCHG, 2, {MEMORY,REG_GPR|BITS64,0,0,0}, nasm_bytecodes+18779, IF_X64|IF_SM},
+    {I_XCHG, 2, {REG_GPR|BITS64,REG_GPR|BITS64,0,0,0}, nasm_bytecodes+18779, IF_X64},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_XCRYPTCBC[] = {
+    {I_XCRYPTCBC, 0, {0,0,0,0,0}, nasm_bytecodes+15858, IF_PENT|IF_CYRIX},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_XCRYPTCFB[] = {
+    {I_XCRYPTCFB, 0, {0,0,0,0,0}, nasm_bytecodes+15870, IF_PENT|IF_CYRIX},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_XCRYPTCTR[] = {
+    {I_XCRYPTCTR, 0, {0,0,0,0,0}, nasm_bytecodes+15864, IF_PENT|IF_CYRIX},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_XCRYPTECB[] = {
+    {I_XCRYPTECB, 0, {0,0,0,0,0}, nasm_bytecodes+15852, IF_PENT|IF_CYRIX},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_XCRYPTOFB[] = {
+    {I_XCRYPTOFB, 0, {0,0,0,0,0}, nasm_bytecodes+15876, IF_PENT|IF_CYRIX},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_XGETBV[] = {
+    {I_XGETBV, 0, {0,0,0,0,0}, nasm_bytecodes+15006, IF_NEHALEM},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_XLAT[] = {
+    {I_XLAT, 0, {0,0,0,0,0}, nasm_bytecodes+20025, IF_8086},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_XLATB[] = {
+    {I_XLATB, 0, {0,0,0,0,0}, nasm_bytecodes+20025, IF_8086},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_XOR[] = {
+    {I_XOR, 2, {MEMORY,REG_GPR|BITS8,0,0,0}, nasm_bytecodes+19950, IF_8086|IF_SM},
+    {I_XOR, 2, {REG_GPR|BITS8,REG_GPR|BITS8,0,0,0}, nasm_bytecodes+19950, IF_8086},
+    {I_XOR, 2, {MEMORY,REG_GPR|BITS16,0,0,0}, nasm_bytecodes+18784, IF_8086|IF_SM},
+    {I_XOR, 2, {REG_GPR|BITS16,REG_GPR|BITS16,0,0,0}, nasm_bytecodes+18784, IF_8086},
+    {I_XOR, 2, {MEMORY,REG_GPR|BITS32,0,0,0}, nasm_bytecodes+18789, IF_386|IF_SM},
+    {I_XOR, 2, {REG_GPR|BITS32,REG_GPR|BITS32,0,0,0}, nasm_bytecodes+18789, IF_386},
+    {I_XOR, 2, {MEMORY,REG_GPR|BITS64,0,0,0}, nasm_bytecodes+18794, IF_X64|IF_SM},
+    {I_XOR, 2, {REG_GPR|BITS64,REG_GPR|BITS64,0,0,0}, nasm_bytecodes+18794, IF_X64},
+    {I_XOR, 2, {REG_GPR|BITS8,MEMORY,0,0,0}, nasm_bytecodes+11208, IF_8086|IF_SM},
+    {I_XOR, 2, {REG_GPR|BITS8,REG_GPR|BITS8,0,0,0}, nasm_bytecodes+11208, IF_8086},
+    {I_XOR, 2, {REG_GPR|BITS16,MEMORY,0,0,0}, nasm_bytecodes+18799, IF_8086|IF_SM},
+    {I_XOR, 2, {REG_GPR|BITS16,REG_GPR|BITS16,0,0,0}, nasm_bytecodes+18799, IF_8086},
+    {I_XOR, 2, {REG_GPR|BITS32,MEMORY,0,0,0}, nasm_bytecodes+18804, IF_386|IF_SM},
+    {I_XOR, 2, {REG_GPR|BITS32,REG_GPR|BITS32,0,0,0}, nasm_bytecodes+18804, IF_386},
+    {I_XOR, 2, {REG_GPR|BITS64,MEMORY,0,0,0}, nasm_bytecodes+18809, IF_X64|IF_SM},
+    {I_XOR, 2, {REG_GPR|BITS64,REG_GPR|BITS64,0,0,0}, nasm_bytecodes+18809, IF_X64},
+    {I_XOR, 2, {RM_GPR|BITS16,IMMEDIATE|BITS8,0,0,0}, nasm_bytecodes+14724, IF_8086},
+    {I_XOR, 2, {RM_GPR|BITS32,IMMEDIATE|BITS8,0,0,0}, nasm_bytecodes+14730, IF_386},
+    {I_XOR, 2, {RM_GPR|BITS64,IMMEDIATE|BITS8,0,0,0}, nasm_bytecodes+14736, IF_X64},
+    {I_XOR, 2, {REG_AL,IMMEDIATE,0,0,0}, nasm_bytecodes+19954, IF_8086|IF_SM},
+    {I_XOR, 2, {REG_AX,SBYTE16,0,0,0}, nasm_bytecodes+14724, IF_8086|IF_SM},
+    {I_XOR, 2, {REG_AX,IMMEDIATE,0,0,0}, nasm_bytecodes+18814, IF_8086|IF_SM},
+    {I_XOR, 2, {REG_EAX,SBYTE32,0,0,0}, nasm_bytecodes+14730, IF_386|IF_SM},
+    {I_XOR, 2, {REG_EAX,IMMEDIATE,0,0,0}, nasm_bytecodes+18819, IF_386|IF_SM},
+    {I_XOR, 2, {REG_RAX,SBYTE64,0,0,0}, nasm_bytecodes+14736, IF_X64|IF_SM},
+    {I_XOR, 2, {REG_RAX,IMMEDIATE,0,0,0}, nasm_bytecodes+18824, IF_X64|IF_SM},
+    {I_XOR, 2, {RM_GPR|BITS8,IMMEDIATE,0,0,0}, nasm_bytecodes+18829, IF_8086|IF_SM},
+    {I_XOR, 2, {RM_GPR|BITS16,IMMEDIATE,0,0,0}, nasm_bytecodes+14742, IF_8086|IF_SM},
+    {I_XOR, 2, {RM_GPR|BITS32,IMMEDIATE,0,0,0}, nasm_bytecodes+14748, IF_386|IF_SM},
+    {I_XOR, 2, {RM_GPR|BITS64,IMMEDIATE,0,0,0}, nasm_bytecodes+14754, IF_X64|IF_SM},
+    {I_XOR, 2, {MEMORY,IMMEDIATE|BITS8,0,0,0}, nasm_bytecodes+18829, IF_8086|IF_SM},
+    {I_XOR, 2, {MEMORY,IMMEDIATE|BITS16,0,0,0}, nasm_bytecodes+14742, IF_8086|IF_SM},
+    {I_XOR, 2, {MEMORY,IMMEDIATE|BITS32,0,0,0}, nasm_bytecodes+14748, IF_386|IF_SM},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_XORPD[] = {
+    {I_XORPD, 2, {XMMREG,RM_XMM,0,0,0}, nasm_bytecodes+15738, IF_WILLAMETTE|IF_SSE2|IF_SO},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_XORPS[] = {
+    {I_XORPS, 2, {XMMREG,RM_XMM,0,0,0}, nasm_bytecodes+15000, IF_KATMAI|IF_SSE},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_XRSTOR[] = {
+    {I_XRSTOR, 1, {MEMORY,0,0,0,0}, nasm_bytecodes+15024, IF_NEHALEM},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_XSAVE[] = {
+    {I_XSAVE, 1, {MEMORY,0,0,0,0}, nasm_bytecodes+15018, IF_NEHALEM},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_XSETBV[] = {
+    {I_XSETBV, 0, {0,0,0,0,0}, nasm_bytecodes+15012, IF_NEHALEM|IF_PRIV},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_XSHA1[] = {
+    {I_XSHA1, 0, {0,0,0,0,0}, nasm_bytecodes+15888, IF_PENT|IF_CYRIX},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_XSHA256[] = {
+    {I_XSHA256, 0, {0,0,0,0,0}, nasm_bytecodes+15894, IF_PENT|IF_CYRIX},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_XSTORE[] = {
+    {I_XSTORE, 0, {0,0,0,0,0}, nasm_bytecodes+18909, IF_PENT|IF_CYRIX},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_CMOVcc[] = {
+    {I_CMOVcc, 2, {REG_GPR|BITS16,MEMORY,0,0,0}, nasm_bytecodes+7817, IF_P6|IF_SM},
+    {I_CMOVcc, 2, {REG_GPR|BITS16,REG_GPR|BITS16,0,0,0}, nasm_bytecodes+7817, IF_P6},
+    {I_CMOVcc, 2, {REG_GPR|BITS32,MEMORY,0,0,0}, nasm_bytecodes+7824, IF_P6|IF_SM},
+    {I_CMOVcc, 2, {REG_GPR|BITS32,REG_GPR|BITS32,0,0,0}, nasm_bytecodes+7824, IF_P6},
+    {I_CMOVcc, 2, {REG_GPR|BITS64,MEMORY,0,0,0}, nasm_bytecodes+7831, IF_X64|IF_SM},
+    {I_CMOVcc, 2, {REG_GPR|BITS64,REG_GPR|BITS64,0,0,0}, nasm_bytecodes+7831, IF_X64},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_Jcc[] = {
+    {I_Jcc, 1, {IMMEDIATE|NEAR,0,0,0,0}, nasm_bytecodes+7838, IF_386},
+    {I_Jcc, 1, {IMMEDIATE|BITS16|NEAR,0,0,0,0}, nasm_bytecodes+7845, IF_386},
+    {I_Jcc, 1, {IMMEDIATE|BITS32|NEAR,0,0,0,0}, nasm_bytecodes+7852, IF_386},
+    {I_Jcc, 1, {IMMEDIATE|SHORT,0,0,0,0}, nasm_bytecodes+18835, IF_8086},
+    {I_Jcc, 1, {IMMEDIATE,0,0,0,0}, nasm_bytecodes+18834, IF_8086},
+    {I_Jcc, 1, {IMMEDIATE,0,0,0,0}, nasm_bytecodes+7853, IF_386},
+    {I_Jcc, 1, {IMMEDIATE,0,0,0,0}, nasm_bytecodes+7859, IF_8086},
+    {I_Jcc, 1, {IMMEDIATE,0,0,0,0}, nasm_bytecodes+18835, IF_8086},
+    ITEMPLATE_END
+};
+
+static const struct itemplate instrux_SETcc[] = {
+    {I_SETcc, 1, {MEMORY,0,0,0,0}, nasm_bytecodes+14760, IF_386|IF_SB},
+    {I_SETcc, 1, {REG_GPR|BITS8,0,0,0,0}, nasm_bytecodes+14760, IF_386},
+    ITEMPLATE_END
+};
+
+const struct itemplate * const nasm_instructions[] = {
+    instrux_AAA,
+    instrux_AAD,
+    instrux_AAM,
+    instrux_AAS,
+    instrux_ADC,
+    instrux_ADD,
+    instrux_ADDPD,
+    instrux_ADDPS,
+    instrux_ADDSD,
+    instrux_ADDSS,
+    instrux_ADDSUBPD,
+    instrux_ADDSUBPS,
+    instrux_AESDEC,
+    instrux_AESDECLAST,
+    instrux_AESENC,
+    instrux_AESENCLAST,
+    instrux_AESIMC,
+    instrux_AESKEYGENASSIST,
+    instrux_AND,
+    instrux_ANDNPD,
+    instrux_ANDNPS,
+    instrux_ANDPD,
+    instrux_ANDPS,
+    instrux_ARPL,
+    instrux_BB0_RESET,
+    instrux_BB1_RESET,
+    instrux_BLENDPD,
+    instrux_BLENDPS,
+    instrux_BLENDVPD,
+    instrux_BLENDVPS,
+    instrux_BOUND,
+    instrux_BSF,
+    instrux_BSR,
+    instrux_BSWAP,
+    instrux_BT,
+    instrux_BTC,
+    instrux_BTR,
+    instrux_BTS,
+    instrux_CALL,
+    instrux_CBW,
+    instrux_CDQ,
+    instrux_CDQE,
+    instrux_CLC,
+    instrux_CLD,
+    instrux_CLFLUSH,
+    instrux_CLGI,
+    instrux_CLI,
+    instrux_CLTS,
+    instrux_CMC,
+    instrux_CMP,
+    instrux_CMPEQPD,
+    instrux_CMPEQPS,
+    instrux_CMPEQSD,
+    instrux_CMPEQSS,
+    instrux_CMPLEPD,
+    instrux_CMPLEPS,
+    instrux_CMPLESD,
+    instrux_CMPLESS,
+    instrux_CMPLTPD,
+    instrux_CMPLTPS,
+    instrux_CMPLTSD,
+    instrux_CMPLTSS,
+    instrux_CMPNEQPD,
+    instrux_CMPNEQPS,
+    instrux_CMPNEQSD,
+    instrux_CMPNEQSS,
+    instrux_CMPNLEPD,
+    instrux_CMPNLEPS,
+    instrux_CMPNLESD,
+    instrux_CMPNLESS,
+    instrux_CMPNLTPD,
+    instrux_CMPNLTPS,
+    instrux_CMPNLTSD,
+    instrux_CMPNLTSS,
+    instrux_CMPORDPD,
+    instrux_CMPORDPS,
+    instrux_CMPORDSD,
+    instrux_CMPORDSS,
+    instrux_CMPPD,
+    instrux_CMPPS,
+    instrux_CMPSB,
+    instrux_CMPSD,
+    instrux_CMPSQ,
+    instrux_CMPSS,
+    instrux_CMPSW,
+    instrux_CMPUNORDPD,
+    instrux_CMPUNORDPS,
+    instrux_CMPUNORDSD,
+    instrux_CMPUNORDSS,
+    instrux_CMPXCHG,
+    instrux_CMPXCHG16B,
+    instrux_CMPXCHG486,
+    instrux_CMPXCHG8B,
+    instrux_COMISD,
+    instrux_COMISS,
+    instrux_CPUID,
+    instrux_CPU_READ,
+    instrux_CPU_WRITE,
+    instrux_CQO,
+    instrux_CRC32,
+    instrux_CVTDQ2PD,
+    instrux_CVTDQ2PS,
+    instrux_CVTPD2DQ,
+    instrux_CVTPD2PI,
+    instrux_CVTPD2PS,
+    instrux_CVTPI2PD,
+    instrux_CVTPI2PS,
+    instrux_CVTPS2DQ,
+    instrux_CVTPS2PD,
+    instrux_CVTPS2PI,
+    instrux_CVTSD2SI,
+    instrux_CVTSD2SS,
+    instrux_CVTSI2SD,
+    instrux_CVTSI2SS,
+    instrux_CVTSS2SD,
+    instrux_CVTSS2SI,
+    instrux_CVTTPD2DQ,
+    instrux_CVTTPD2PI,
+    instrux_CVTTPS2DQ,
+    instrux_CVTTPS2PI,
+    instrux_CVTTSD2SI,
+    instrux_CVTTSS2SI,
+    instrux_CWD,
+    instrux_CWDE,
+    instrux_DAA,
+    instrux_DAS,
+    instrux_DB,
+    instrux_DD,
+    instrux_DEC,
+    instrux_DIV,
+    instrux_DIVPD,
+    instrux_DIVPS,
+    instrux_DIVSD,
+    instrux_DIVSS,
+    instrux_DMINT,
+    instrux_DO,
+    instrux_DPPD,
+    instrux_DPPS,
+    instrux_DQ,
+    instrux_DT,
+    instrux_DW,
+    instrux_DY,
+    instrux_EMMS,
+    instrux_ENTER,
+    instrux_EQU,
+    instrux_EXTRACTPS,
+    instrux_EXTRQ,
+    instrux_F2XM1,
+    instrux_FABS,
+    instrux_FADD,
+    instrux_FADDP,
+    instrux_FBLD,
+    instrux_FBSTP,
+    instrux_FCHS,
+    instrux_FCLEX,
+    instrux_FCMOVB,
+    instrux_FCMOVBE,
+    instrux_FCMOVE,
+    instrux_FCMOVNB,
+    instrux_FCMOVNBE,
+    instrux_FCMOVNE,
+    instrux_FCMOVNU,
+    instrux_FCMOVU,
+    instrux_FCOM,
+    instrux_FCOMI,
+    instrux_FCOMIP,
+    instrux_FCOMP,
+    instrux_FCOMPP,
+    instrux_FCOS,
+    instrux_FDECSTP,
+    instrux_FDISI,
+    instrux_FDIV,
+    instrux_FDIVP,
+    instrux_FDIVR,
+    instrux_FDIVRP,
+    instrux_FEMMS,
+    instrux_FENI,
+    instrux_FFREE,
+    instrux_FFREEP,
+    instrux_FIADD,
+    instrux_FICOM,
+    instrux_FICOMP,
+    instrux_FIDIV,
+    instrux_FIDIVR,
+    instrux_FILD,
+    instrux_FIMUL,
+    instrux_FINCSTP,
+    instrux_FINIT,
+    instrux_FIST,
+    instrux_FISTP,
+    instrux_FISTTP,
+    instrux_FISUB,
+    instrux_FISUBR,
+    instrux_FLD,
+    instrux_FLD1,
+    instrux_FLDCW,
+    instrux_FLDENV,
+    instrux_FLDL2E,
+    instrux_FLDL2T,
+    instrux_FLDLG2,
+    instrux_FLDLN2,
+    instrux_FLDPI,
+    instrux_FLDZ,
+    instrux_FMUL,
+    instrux_FMULP,
+    instrux_FNCLEX,
+    instrux_FNDISI,
+    instrux_FNENI,
+    instrux_FNINIT,
+    instrux_FNOP,
+    instrux_FNSAVE,
+    instrux_FNSTCW,
+    instrux_FNSTENV,
+    instrux_FNSTSW,
+    instrux_FPATAN,
+    instrux_FPREM,
+    instrux_FPREM1,
+    instrux_FPTAN,
+    instrux_FRNDINT,
+    instrux_FRSTOR,
+    instrux_FSAVE,
+    instrux_FSCALE,
+    instrux_FSETPM,
+    instrux_FSIN,
+    instrux_FSINCOS,
+    instrux_FSQRT,
+    instrux_FST,
+    instrux_FSTCW,
+    instrux_FSTENV,
+    instrux_FSTP,
+    instrux_FSTSW,
+    instrux_FSUB,
+    instrux_FSUBP,
+    instrux_FSUBR,
+    instrux_FSUBRP,
+    instrux_FTST,
+    instrux_FUCOM,
+    instrux_FUCOMI,
+    instrux_FUCOMIP,
+    instrux_FUCOMP,
+    instrux_FUCOMPP,
+    instrux_FWAIT,
+    instrux_FXAM,
+    instrux_FXCH,
+    instrux_FXRSTOR,
+    instrux_FXSAVE,
+    instrux_FXTRACT,
+    instrux_FYL2X,
+    instrux_FYL2XP1,
+    instrux_GETSEC,
+    instrux_HADDPD,
+    instrux_HADDPS,
+    instrux_HINT_NOP0,
+    instrux_HINT_NOP1,
+    instrux_HINT_NOP10,
+    instrux_HINT_NOP11,
+    instrux_HINT_NOP12,
+    instrux_HINT_NOP13,
+    instrux_HINT_NOP14,
+    instrux_HINT_NOP15,
+    instrux_HINT_NOP16,
+    instrux_HINT_NOP17,
+    instrux_HINT_NOP18,
+    instrux_HINT_NOP19,
+    instrux_HINT_NOP2,
+    instrux_HINT_NOP20,
+    instrux_HINT_NOP21,
+    instrux_HINT_NOP22,
+    instrux_HINT_NOP23,
+    instrux_HINT_NOP24,
+    instrux_HINT_NOP25,
+    instrux_HINT_NOP26,
+    instrux_HINT_NOP27,
+    instrux_HINT_NOP28,
+    instrux_HINT_NOP29,
+    instrux_HINT_NOP3,
+    instrux_HINT_NOP30,
+    instrux_HINT_NOP31,
+    instrux_HINT_NOP32,
+    instrux_HINT_NOP33,
+    instrux_HINT_NOP34,
+    instrux_HINT_NOP35,
+    instrux_HINT_NOP36,
+    instrux_HINT_NOP37,
+    instrux_HINT_NOP38,
+    instrux_HINT_NOP39,
+    instrux_HINT_NOP4,
+    instrux_HINT_NOP40,
+    instrux_HINT_NOP41,
+    instrux_HINT_NOP42,
+    instrux_HINT_NOP43,
+    instrux_HINT_NOP44,
+    instrux_HINT_NOP45,
+    instrux_HINT_NOP46,
+    instrux_HINT_NOP47,
+    instrux_HINT_NOP48,
+    instrux_HINT_NOP49,
+    instrux_HINT_NOP5,
+    instrux_HINT_NOP50,
+    instrux_HINT_NOP51,
+    instrux_HINT_NOP52,
+    instrux_HINT_NOP53,
+    instrux_HINT_NOP54,
+    instrux_HINT_NOP55,
+    instrux_HINT_NOP56,
+    instrux_HINT_NOP57,
+    instrux_HINT_NOP58,
+    instrux_HINT_NOP59,
+    instrux_HINT_NOP6,
+    instrux_HINT_NOP60,
+    instrux_HINT_NOP61,
+    instrux_HINT_NOP62,
+    instrux_HINT_NOP63,
+    instrux_HINT_NOP7,
+    instrux_HINT_NOP8,
+    instrux_HINT_NOP9,
+    instrux_HLT,
+    instrux_HSUBPD,
+    instrux_HSUBPS,
+    instrux_IBTS,
+    instrux_ICEBP,
+    instrux_IDIV,
+    instrux_IMUL,
+    instrux_IN,
+    instrux_INC,
+    instrux_INCBIN,
+    instrux_INSB,
+    instrux_INSD,
+    instrux_INSERTPS,
+    instrux_INSERTQ,
+    instrux_INSW,
+    instrux_INT,
+    instrux_INT01,
+    instrux_INT03,
+    instrux_INT1,
+    instrux_INT3,
+    instrux_INTO,
+    instrux_INVD,
+    instrux_INVEPT,
+    instrux_INVLPG,
+    instrux_INVLPGA,
+    instrux_INVVPID,
+    instrux_IRET,
+    instrux_IRETD,
+    instrux_IRETQ,
+    instrux_IRETW,
+    instrux_JCXZ,
+    instrux_JECXZ,
+    instrux_JMP,
+    instrux_JMPE,
+    instrux_JRCXZ,
+    instrux_LAHF,
+    instrux_LAR,
+    instrux_LDDQU,
+    instrux_LDMXCSR,
+    instrux_LDS,
+    instrux_LEA,
+    instrux_LEAVE,
+    instrux_LES,
+    instrux_LFENCE,
+    instrux_LFS,
+    instrux_LGDT,
+    instrux_LGS,
+    instrux_LIDT,
+    instrux_LLDT,
+    instrux_LLWPCB,
+    instrux_LMSW,
+    instrux_LOADALL,
+    instrux_LOADALL286,
+    instrux_LODSB,
+    instrux_LODSD,
+    instrux_LODSQ,
+    instrux_LODSW,
+    instrux_LOOP,
+    instrux_LOOPE,
+    instrux_LOOPNE,
+    instrux_LOOPNZ,
+    instrux_LOOPZ,
+    instrux_LSL,
+    instrux_LSS,
+    instrux_LTR,
+    instrux_LWPINS,
+    instrux_LWPVAL,
+    instrux_LZCNT,
+    instrux_MASKMOVDQU,
+    instrux_MASKMOVQ,
+    instrux_MAXPD,
+    instrux_MAXPS,
+    instrux_MAXSD,
+    instrux_MAXSS,
+    instrux_MFENCE,
+    instrux_MINPD,
+    instrux_MINPS,
+    instrux_MINSD,
+    instrux_MINSS,
+    instrux_MONITOR,
+    instrux_MONTMUL,
+    instrux_MOV,
+    instrux_MOVAPD,
+    instrux_MOVAPS,
+    instrux_MOVBE,
+    instrux_MOVD,
+    instrux_MOVDDUP,
+    instrux_MOVDQ2Q,
+    instrux_MOVDQA,
+    instrux_MOVDQU,
+    instrux_MOVHLPS,
+    instrux_MOVHPD,
+    instrux_MOVHPS,
+    instrux_MOVLHPS,
+    instrux_MOVLPD,
+    instrux_MOVLPS,
+    instrux_MOVMSKPD,
+    instrux_MOVMSKPS,
+    instrux_MOVNTDQ,
+    instrux_MOVNTDQA,
+    instrux_MOVNTI,
+    instrux_MOVNTPD,
+    instrux_MOVNTPS,
+    instrux_MOVNTQ,
+    instrux_MOVNTSD,
+    instrux_MOVNTSS,
+    instrux_MOVQ,
+    instrux_MOVQ2DQ,
+    instrux_MOVSB,
+    instrux_MOVSD,
+    instrux_MOVSHDUP,
+    instrux_MOVSLDUP,
+    instrux_MOVSQ,
+    instrux_MOVSS,
+    instrux_MOVSW,
+    instrux_MOVSX,
+    instrux_MOVSXD,
+    instrux_MOVUPD,
+    instrux_MOVUPS,
+    instrux_MOVZX,
+    instrux_MPSADBW,
+    instrux_MUL,
+    instrux_MULPD,
+    instrux_MULPS,
+    instrux_MULSD,
+    instrux_MULSS,
+    instrux_MWAIT,
+    instrux_NEG,
+    instrux_NOP,
+    instrux_NOT,
+    instrux_OR,
+    instrux_ORPD,
+    instrux_ORPS,
+    instrux_OUT,
+    instrux_OUTSB,
+    instrux_OUTSD,
+    instrux_OUTSW,
+    instrux_PABSB,
+    instrux_PABSD,
+    instrux_PABSW,
+    instrux_PACKSSDW,
+    instrux_PACKSSWB,
+    instrux_PACKUSDW,
+    instrux_PACKUSWB,
+    instrux_PADDB,
+    instrux_PADDD,
+    instrux_PADDQ,
+    instrux_PADDSB,
+    instrux_PADDSIW,
+    instrux_PADDSW,
+    instrux_PADDUSB,
+    instrux_PADDUSW,
+    instrux_PADDW,
+    instrux_PALIGNR,
+    instrux_PAND,
+    instrux_PANDN,
+    instrux_PAUSE,
+    instrux_PAVEB,
+    instrux_PAVGB,
+    instrux_PAVGUSB,
+    instrux_PAVGW,
+    instrux_PBLENDVB,
+    instrux_PBLENDW,
+    instrux_PCLMULHQHQDQ,
+    instrux_PCLMULHQLQDQ,
+    instrux_PCLMULLQHQDQ,
+    instrux_PCLMULLQLQDQ,
+    instrux_PCLMULQDQ,
+    instrux_PCMPEQB,
+    instrux_PCMPEQD,
+    instrux_PCMPEQQ,
+    instrux_PCMPEQW,
+    instrux_PCMPESTRI,
+    instrux_PCMPESTRM,
+    instrux_PCMPGTB,
+    instrux_PCMPGTD,
+    instrux_PCMPGTQ,
+    instrux_PCMPGTW,
+    instrux_PCMPISTRI,
+    instrux_PCMPISTRM,
+    instrux_PDISTIB,
+    instrux_PEXTRB,
+    instrux_PEXTRD,
+    instrux_PEXTRQ,
+    instrux_PEXTRW,
+    instrux_PF2ID,
+    instrux_PF2IW,
+    instrux_PFACC,
+    instrux_PFADD,
+    instrux_PFCMPEQ,
+    instrux_PFCMPGE,
+    instrux_PFCMPGT,
+    instrux_PFMAX,
+    instrux_PFMIN,
+    instrux_PFMUL,
+    instrux_PFNACC,
+    instrux_PFPNACC,
+    instrux_PFRCP,
+    instrux_PFRCPIT1,
+    instrux_PFRCPIT2,
+    instrux_PFRCPV,
+    instrux_PFRSQIT1,
+    instrux_PFRSQRT,
+    instrux_PFRSQRTV,
+    instrux_PFSUB,
+    instrux_PFSUBR,
+    instrux_PHADDD,
+    instrux_PHADDSW,
+    instrux_PHADDW,
+    instrux_PHMINPOSUW,
+    instrux_PHSUBD,
+    instrux_PHSUBSW,
+    instrux_PHSUBW,
+    instrux_PI2FD,
+    instrux_PI2FW,
+    instrux_PINSRB,
+    instrux_PINSRD,
+    instrux_PINSRQ,
+    instrux_PINSRW,
+    instrux_PMACHRIW,
+    instrux_PMADDUBSW,
+    instrux_PMADDWD,
+    instrux_PMAGW,
+    instrux_PMAXSB,
+    instrux_PMAXSD,
+    instrux_PMAXSW,
+    instrux_PMAXUB,
+    instrux_PMAXUD,
+    instrux_PMAXUW,
+    instrux_PMINSB,
+    instrux_PMINSD,
+    instrux_PMINSW,
+    instrux_PMINUB,
+    instrux_PMINUD,
+    instrux_PMINUW,
+    instrux_PMOVMSKB,
+    instrux_PMOVSXBD,
+    instrux_PMOVSXBQ,
+    instrux_PMOVSXBW,
+    instrux_PMOVSXDQ,
+    instrux_PMOVSXWD,
+    instrux_PMOVSXWQ,
+    instrux_PMOVZXBD,
+    instrux_PMOVZXBQ,
+    instrux_PMOVZXBW,
+    instrux_PMOVZXDQ,
+    instrux_PMOVZXWD,
+    instrux_PMOVZXWQ,
+    instrux_PMULDQ,
+    instrux_PMULHRIW,
+    instrux_PMULHRSW,
+    instrux_PMULHRWA,
+    instrux_PMULHRWC,
+    instrux_PMULHUW,
+    instrux_PMULHW,
+    instrux_PMULLD,
+    instrux_PMULLW,
+    instrux_PMULUDQ,
+    instrux_PMVGEZB,
+    instrux_PMVLZB,
+    instrux_PMVNZB,
+    instrux_PMVZB,
+    instrux_POP,
+    instrux_POPA,
+    instrux_POPAD,
+    instrux_POPAW,
+    instrux_POPCNT,
+    instrux_POPF,
+    instrux_POPFD,
+    instrux_POPFQ,
+    instrux_POPFW,
+    instrux_POR,
+    instrux_PREFETCH,
+    instrux_PREFETCHNTA,
+    instrux_PREFETCHT0,
+    instrux_PREFETCHT1,
+    instrux_PREFETCHT2,
+    instrux_PREFETCHW,
+    instrux_PSADBW,
+    instrux_PSHUFB,
+    instrux_PSHUFD,
+    instrux_PSHUFHW,
+    instrux_PSHUFLW,
+    instrux_PSHUFW,
+    instrux_PSIGNB,
+    instrux_PSIGND,
+    instrux_PSIGNW,
+    instrux_PSLLD,
+    instrux_PSLLDQ,
+    instrux_PSLLQ,
+    instrux_PSLLW,
+    instrux_PSRAD,
+    instrux_PSRAW,
+    instrux_PSRLD,
+    instrux_PSRLDQ,
+    instrux_PSRLQ,
+    instrux_PSRLW,
+    instrux_PSUBB,
+    instrux_PSUBD,
+    instrux_PSUBQ,
+    instrux_PSUBSB,
+    instrux_PSUBSIW,
+    instrux_PSUBSW,
+    instrux_PSUBUSB,
+    instrux_PSUBUSW,
+    instrux_PSUBW,
+    instrux_PSWAPD,
+    instrux_PTEST,
+    instrux_PUNPCKHBW,
+    instrux_PUNPCKHDQ,
+    instrux_PUNPCKHQDQ,
+    instrux_PUNPCKHWD,
+    instrux_PUNPCKLBW,
+    instrux_PUNPCKLDQ,
+    instrux_PUNPCKLQDQ,
+    instrux_PUNPCKLWD,
+    instrux_PUSH,
+    instrux_PUSHA,
+    instrux_PUSHAD,
+    instrux_PUSHAW,
+    instrux_PUSHF,
+    instrux_PUSHFD,
+    instrux_PUSHFQ,
+    instrux_PUSHFW,
+    instrux_PXOR,
+    instrux_RCL,
+    instrux_RCPPS,
+    instrux_RCPSS,
+    instrux_RCR,
+    instrux_RDM,
+    instrux_RDMSR,
+    instrux_RDPMC,
+    instrux_RDSHR,
+    instrux_RDTSC,
+    instrux_RDTSCP,
+    instrux_RESB,
+    instrux_RESD,
+    instrux_RESO,
+    instrux_RESQ,
+    instrux_REST,
+    instrux_RESW,
+    instrux_RESY,
+    instrux_RET,
+    instrux_RETF,
+    instrux_RETN,
+    instrux_ROL,
+    instrux_ROR,
+    instrux_ROUNDPD,
+    instrux_ROUNDPS,
+    instrux_ROUNDSD,
+    instrux_ROUNDSS,
+    instrux_RSDC,
+    instrux_RSLDT,
+    instrux_RSM,
+    instrux_RSQRTPS,
+    instrux_RSQRTSS,
+    instrux_RSTS,
+    instrux_SAHF,
+    instrux_SAL,
+    instrux_SALC,
+    instrux_SAR,
+    instrux_SBB,
+    instrux_SCASB,
+    instrux_SCASD,
+    instrux_SCASQ,
+    instrux_SCASW,
+    instrux_SFENCE,
+    instrux_SGDT,
+    instrux_SHL,
+    instrux_SHLD,
+    instrux_SHR,
+    instrux_SHRD,
+    instrux_SHUFPD,
+    instrux_SHUFPS,
+    instrux_SIDT,
+    instrux_SKINIT,
+    instrux_SLDT,
+    instrux_SLWPCB,
+    instrux_SMI,
+    instrux_SMINT,
+    instrux_SMINTOLD,
+    instrux_SMSW,
+    instrux_SQRTPD,
+    instrux_SQRTPS,
+    instrux_SQRTSD,
+    instrux_SQRTSS,
+    instrux_STC,
+    instrux_STD,
+    instrux_STGI,
+    instrux_STI,
+    instrux_STMXCSR,
+    instrux_STOSB,
+    instrux_STOSD,
+    instrux_STOSQ,
+    instrux_STOSW,
+    instrux_STR,
+    instrux_SUB,
+    instrux_SUBPD,
+    instrux_SUBPS,
+    instrux_SUBSD,
+    instrux_SUBSS,
+    instrux_SVDC,
+    instrux_SVLDT,
+    instrux_SVTS,
+    instrux_SWAPGS,
+    instrux_SYSCALL,
+    instrux_SYSENTER,
+    instrux_SYSEXIT,
+    instrux_SYSRET,
+    instrux_TEST,
+    instrux_UCOMISD,
+    instrux_UCOMISS,
+    instrux_UD0,
+    instrux_UD1,
+    instrux_UD2,
+    instrux_UD2A,
+    instrux_UD2B,
+    instrux_UMOV,
+    instrux_UNPCKHPD,
+    instrux_UNPCKHPS,
+    instrux_UNPCKLPD,
+    instrux_UNPCKLPS,
+    instrux_VADDPD,
+    instrux_VADDPS,
+    instrux_VADDSD,
+    instrux_VADDSS,
+    instrux_VADDSUBPD,
+    instrux_VADDSUBPS,
+    instrux_VAESDEC,
+    instrux_VAESDECLAST,
+    instrux_VAESENC,
+    instrux_VAESENCLAST,
+    instrux_VAESIMC,
+    instrux_VAESKEYGENASSIST,
+    instrux_VANDNPD,
+    instrux_VANDNPS,
+    instrux_VANDPD,
+    instrux_VANDPS,
+    instrux_VBLENDPD,
+    instrux_VBLENDPS,
+    instrux_VBLENDVPD,
+    instrux_VBLENDVPS,
+    instrux_VBROADCASTF128,
+    instrux_VBROADCASTSD,
+    instrux_VBROADCASTSS,
+    instrux_VCMPEQPD,
+    instrux_VCMPEQPS,
+    instrux_VCMPEQSD,
+    instrux_VCMPEQSS,
+    instrux_VCMPEQ_OSPD,
+    instrux_VCMPEQ_OSPS,
+    instrux_VCMPEQ_OSSD,
+    instrux_VCMPEQ_OSSS,
+    instrux_VCMPEQ_UQPD,
+    instrux_VCMPEQ_UQPS,
+    instrux_VCMPEQ_UQSD,
+    instrux_VCMPEQ_UQSS,
+    instrux_VCMPEQ_USPD,
+    instrux_VCMPEQ_USPS,
+    instrux_VCMPEQ_USSD,
+    instrux_VCMPEQ_USSS,
+    instrux_VCMPFALSEPD,
+    instrux_VCMPFALSEPS,
+    instrux_VCMPFALSESD,
+    instrux_VCMPFALSESS,
+    instrux_VCMPFALSE_OSPD,
+    instrux_VCMPFALSE_OSPS,
+    instrux_VCMPFALSE_OSSD,
+    instrux_VCMPFALSE_OSSS,
+    instrux_VCMPGEPD,
+    instrux_VCMPGEPS,
+    instrux_VCMPGESD,
+    instrux_VCMPGESS,
+    instrux_VCMPGE_OQPD,
+    instrux_VCMPGE_OQPS,
+    instrux_VCMPGE_OQSD,
+    instrux_VCMPGE_OQSS,
+    instrux_VCMPGTPD,
+    instrux_VCMPGTPS,
+    instrux_VCMPGTSD,
+    instrux_VCMPGTSS,
+    instrux_VCMPGT_OQPD,
+    instrux_VCMPGT_OQPS,
+    instrux_VCMPGT_OQSD,
+    instrux_VCMPGT_OQSS,
+    instrux_VCMPLEPD,
+    instrux_VCMPLEPS,
+    instrux_VCMPLESD,
+    instrux_VCMPLESS,
+    instrux_VCMPLE_OQPD,
+    instrux_VCMPLE_OQPS,
+    instrux_VCMPLE_OQSD,
+    instrux_VCMPLE_OQSS,
+    instrux_VCMPLTPD,
+    instrux_VCMPLTPS,
+    instrux_VCMPLTSD,
+    instrux_VCMPLTSS,
+    instrux_VCMPLT_OQPD,
+    instrux_VCMPLT_OQPS,
+    instrux_VCMPLT_OQSD,
+    instrux_VCMPLT_OQSS,
+    instrux_VCMPNEQPD,
+    instrux_VCMPNEQPS,
+    instrux_VCMPNEQSD,
+    instrux_VCMPNEQSS,
+    instrux_VCMPNEQ_OQPD,
+    instrux_VCMPNEQ_OQPS,
+    instrux_VCMPNEQ_OQSD,
+    instrux_VCMPNEQ_OQSS,
+    instrux_VCMPNEQ_OSPD,
+    instrux_VCMPNEQ_OSPS,
+    instrux_VCMPNEQ_OSSD,
+    instrux_VCMPNEQ_OSSS,
+    instrux_VCMPNEQ_USPD,
+    instrux_VCMPNEQ_USPS,
+    instrux_VCMPNEQ_USSD,
+    instrux_VCMPNEQ_USSS,
+    instrux_VCMPNGEPD,
+    instrux_VCMPNGEPS,
+    instrux_VCMPNGESD,
+    instrux_VCMPNGESS,
+    instrux_VCMPNGE_UQPD,
+    instrux_VCMPNGE_UQPS,
+    instrux_VCMPNGE_UQSD,
+    instrux_VCMPNGE_UQSS,
+    instrux_VCMPNGTPD,
+    instrux_VCMPNGTPS,
+    instrux_VCMPNGTSD,
+    instrux_VCMPNGTSS,
+    instrux_VCMPNGT_UQPD,
+    instrux_VCMPNGT_UQPS,
+    instrux_VCMPNGT_UQSD,
+    instrux_VCMPNGT_UQSS,
+    instrux_VCMPNLEPD,
+    instrux_VCMPNLEPS,
+    instrux_VCMPNLESD,
+    instrux_VCMPNLESS,
+    instrux_VCMPNLE_UQPD,
+    instrux_VCMPNLE_UQPS,
+    instrux_VCMPNLE_UQSD,
+    instrux_VCMPNLE_UQSS,
+    instrux_VCMPNLTPD,
+    instrux_VCMPNLTPS,
+    instrux_VCMPNLTSD,
+    instrux_VCMPNLTSS,
+    instrux_VCMPNLT_UQPD,
+    instrux_VCMPNLT_UQPS,
+    instrux_VCMPNLT_UQSD,
+    instrux_VCMPNLT_UQSS,
+    instrux_VCMPORDPD,
+    instrux_VCMPORDPS,
+    instrux_VCMPORDSD,
+    instrux_VCMPORDSS,
+    instrux_VCMPORD_SPD,
+    instrux_VCMPORD_SPS,
+    instrux_VCMPORD_SSD,
+    instrux_VCMPORD_SSS,
+    instrux_VCMPPD,
+    instrux_VCMPPS,
+    instrux_VCMPSD,
+    instrux_VCMPSS,
+    instrux_VCMPTRUEPD,
+    instrux_VCMPTRUEPS,
+    instrux_VCMPTRUESD,
+    instrux_VCMPTRUESS,
+    instrux_VCMPTRUE_USPD,
+    instrux_VCMPTRUE_USPS,
+    instrux_VCMPTRUE_USSD,
+    instrux_VCMPTRUE_USSS,
+    instrux_VCMPUNORDPD,
+    instrux_VCMPUNORDPS,
+    instrux_VCMPUNORDSD,
+    instrux_VCMPUNORDSS,
+    instrux_VCMPUNORD_SPD,
+    instrux_VCMPUNORD_SPS,
+    instrux_VCMPUNORD_SSD,
+    instrux_VCMPUNORD_SSS,
+    instrux_VCOMISD,
+    instrux_VCOMISS,
+    instrux_VCVTDQ2PD,
+    instrux_VCVTDQ2PS,
+    instrux_VCVTPD2DQ,
+    instrux_VCVTPD2PS,
+    instrux_VCVTPH2PS,
+    instrux_VCVTPS2DQ,
+    instrux_VCVTPS2PD,
+    instrux_VCVTPS2PH,
+    instrux_VCVTSD2SI,
+    instrux_VCVTSD2SS,
+    instrux_VCVTSI2SD,
+    instrux_VCVTSI2SS,
+    instrux_VCVTSS2SD,
+    instrux_VCVTSS2SI,
+    instrux_VCVTTPD2DQ,
+    instrux_VCVTTPS2DQ,
+    instrux_VCVTTSD2SI,
+    instrux_VCVTTSS2SI,
+    instrux_VDIVPD,
+    instrux_VDIVPS,
+    instrux_VDIVSD,
+    instrux_VDIVSS,
+    instrux_VDPPD,
+    instrux_VDPPS,
+    instrux_VERR,
+    instrux_VERW,
+    instrux_VEXTRACTF128,
+    instrux_VEXTRACTPS,
+    instrux_VFMADD123PD,
+    instrux_VFMADD123PS,
+    instrux_VFMADD123SD,
+    instrux_VFMADD123SS,
+    instrux_VFMADD132PD,
+    instrux_VFMADD132PS,
+    instrux_VFMADD132SD,
+    instrux_VFMADD132SS,
+    instrux_VFMADD213PD,
+    instrux_VFMADD213PS,
+    instrux_VFMADD213SD,
+    instrux_VFMADD213SS,
+    instrux_VFMADD231PD,
+    instrux_VFMADD231PS,
+    instrux_VFMADD231SD,
+    instrux_VFMADD231SS,
+    instrux_VFMADD312PD,
+    instrux_VFMADD312PS,
+    instrux_VFMADD312SD,
+    instrux_VFMADD312SS,
+    instrux_VFMADD321PD,
+    instrux_VFMADD321PS,
+    instrux_VFMADD321SD,
+    instrux_VFMADD321SS,
+    instrux_VFMADDPD,
+    instrux_VFMADDPS,
+    instrux_VFMADDSD,
+    instrux_VFMADDSS,
+    instrux_VFMADDSUB123PD,
+    instrux_VFMADDSUB123PS,
+    instrux_VFMADDSUB132PD,
+    instrux_VFMADDSUB132PS,
+    instrux_VFMADDSUB213PD,
+    instrux_VFMADDSUB213PS,
+    instrux_VFMADDSUB231PD,
+    instrux_VFMADDSUB231PS,
+    instrux_VFMADDSUB312PD,
+    instrux_VFMADDSUB312PS,
+    instrux_VFMADDSUB321PD,
+    instrux_VFMADDSUB321PS,
+    instrux_VFMADDSUBPD,
+    instrux_VFMADDSUBPS,
+    instrux_VFMSUB123PD,
+    instrux_VFMSUB123PS,
+    instrux_VFMSUB123SD,
+    instrux_VFMSUB123SS,
+    instrux_VFMSUB132PD,
+    instrux_VFMSUB132PS,
+    instrux_VFMSUB132SD,
+    instrux_VFMSUB132SS,
+    instrux_VFMSUB213PD,
+    instrux_VFMSUB213PS,
+    instrux_VFMSUB213SD,
+    instrux_VFMSUB213SS,
+    instrux_VFMSUB231PD,
+    instrux_VFMSUB231PS,
+    instrux_VFMSUB231SD,
+    instrux_VFMSUB231SS,
+    instrux_VFMSUB312PD,
+    instrux_VFMSUB312PS,
+    instrux_VFMSUB312SD,
+    instrux_VFMSUB312SS,
+    instrux_VFMSUB321PD,
+    instrux_VFMSUB321PS,
+    instrux_VFMSUB321SD,
+    instrux_VFMSUB321SS,
+    instrux_VFMSUBADD123PD,
+    instrux_VFMSUBADD123PS,
+    instrux_VFMSUBADD132PD,
+    instrux_VFMSUBADD132PS,
+    instrux_VFMSUBADD213PD,
+    instrux_VFMSUBADD213PS,
+    instrux_VFMSUBADD231PD,
+    instrux_VFMSUBADD231PS,
+    instrux_VFMSUBADD312PD,
+    instrux_VFMSUBADD312PS,
+    instrux_VFMSUBADD321PD,
+    instrux_VFMSUBADD321PS,
+    instrux_VFMSUBADDPD,
+    instrux_VFMSUBADDPS,
+    instrux_VFMSUBPD,
+    instrux_VFMSUBPS,
+    instrux_VFMSUBSD,
+    instrux_VFMSUBSS,
+    instrux_VFNMADD123PD,
+    instrux_VFNMADD123PS,
+    instrux_VFNMADD123SD,
+    instrux_VFNMADD123SS,
+    instrux_VFNMADD132PD,
+    instrux_VFNMADD132PS,
+    instrux_VFNMADD132SD,
+    instrux_VFNMADD132SS,
+    instrux_VFNMADD213PD,
+    instrux_VFNMADD213PS,
+    instrux_VFNMADD213SD,
+    instrux_VFNMADD213SS,
+    instrux_VFNMADD231PD,
+    instrux_VFNMADD231PS,
+    instrux_VFNMADD231SD,
+    instrux_VFNMADD231SS,
+    instrux_VFNMADD312PD,
+    instrux_VFNMADD312PS,
+    instrux_VFNMADD312SD,
+    instrux_VFNMADD312SS,
+    instrux_VFNMADD321PD,
+    instrux_VFNMADD321PS,
+    instrux_VFNMADD321SD,
+    instrux_VFNMADD321SS,
+    instrux_VFNMADDPD,
+    instrux_VFNMADDPS,
+    instrux_VFNMADDSD,
+    instrux_VFNMADDSS,
+    instrux_VFNMSUB123PD,
+    instrux_VFNMSUB123PS,
+    instrux_VFNMSUB123SD,
+    instrux_VFNMSUB123SS,
+    instrux_VFNMSUB132PD,
+    instrux_VFNMSUB132PS,
+    instrux_VFNMSUB132SD,
+    instrux_VFNMSUB132SS,
+    instrux_VFNMSUB213PD,
+    instrux_VFNMSUB213PS,
+    instrux_VFNMSUB213SD,
+    instrux_VFNMSUB213SS,
+    instrux_VFNMSUB231PD,
+    instrux_VFNMSUB231PS,
+    instrux_VFNMSUB231SD,
+    instrux_VFNMSUB231SS,
+    instrux_VFNMSUB312PD,
+    instrux_VFNMSUB312PS,
+    instrux_VFNMSUB312SD,
+    instrux_VFNMSUB312SS,
+    instrux_VFNMSUB321PD,
+    instrux_VFNMSUB321PS,
+    instrux_VFNMSUB321SD,
+    instrux_VFNMSUB321SS,
+    instrux_VFNMSUBPD,
+    instrux_VFNMSUBPS,
+    instrux_VFNMSUBSD,
+    instrux_VFNMSUBSS,
+    instrux_VFRCZPD,
+    instrux_VFRCZPS,
+    instrux_VFRCZSD,
+    instrux_VFRCZSS,
+    instrux_VHADDPD,
+    instrux_VHADDPS,
+    instrux_VHSUBPD,
+    instrux_VHSUBPS,
+    instrux_VINSERTF128,
+    instrux_VINSERTPS,
+    instrux_VLDDQU,
+    instrux_VLDMXCSR,
+    instrux_VLDQQU,
+    instrux_VMASKMOVDQU,
+    instrux_VMASKMOVPD,
+    instrux_VMASKMOVPS,
+    instrux_VMAXPD,
+    instrux_VMAXPS,
+    instrux_VMAXSD,
+    instrux_VMAXSS,
+    instrux_VMCALL,
+    instrux_VMCLEAR,
+    instrux_VMINPD,
+    instrux_VMINPS,
+    instrux_VMINSD,
+    instrux_VMINSS,
+    instrux_VMLAUNCH,
+    instrux_VMLOAD,
+    instrux_VMMCALL,
+    instrux_VMOVAPD,
+    instrux_VMOVAPS,
+    instrux_VMOVD,
+    instrux_VMOVDDUP,
+    instrux_VMOVDQA,
+    instrux_VMOVDQU,
+    instrux_VMOVHLPS,
+    instrux_VMOVHPD,
+    instrux_VMOVHPS,
+    instrux_VMOVLHPS,
+    instrux_VMOVLPD,
+    instrux_VMOVLPS,
+    instrux_VMOVMSKPD,
+    instrux_VMOVMSKPS,
+    instrux_VMOVNTDQ,
+    instrux_VMOVNTDQA,
+    instrux_VMOVNTPD,
+    instrux_VMOVNTPS,
+    instrux_VMOVNTQQ,
+    instrux_VMOVQ,
+    instrux_VMOVQQA,
+    instrux_VMOVQQU,
+    instrux_VMOVSD,
+    instrux_VMOVSHDUP,
+    instrux_VMOVSLDUP,
+    instrux_VMOVSS,
+    instrux_VMOVUPD,
+    instrux_VMOVUPS,
+    instrux_VMPSADBW,
+    instrux_VMPTRLD,
+    instrux_VMPTRST,
+    instrux_VMREAD,
+    instrux_VMRESUME,
+    instrux_VMRUN,
+    instrux_VMSAVE,
+    instrux_VMULPD,
+    instrux_VMULPS,
+    instrux_VMULSD,
+    instrux_VMULSS,
+    instrux_VMWRITE,
+    instrux_VMXOFF,
+    instrux_VMXON,
+    instrux_VORPD,
+    instrux_VORPS,
+    instrux_VPABSB,
+    instrux_VPABSD,
+    instrux_VPABSW,
+    instrux_VPACKSSDW,
+    instrux_VPACKSSWB,
+    instrux_VPACKUSDW,
+    instrux_VPACKUSWB,
+    instrux_VPADDB,
+    instrux_VPADDD,
+    instrux_VPADDQ,
+    instrux_VPADDSB,
+    instrux_VPADDSW,
+    instrux_VPADDUSB,
+    instrux_VPADDUSW,
+    instrux_VPADDW,
+    instrux_VPALIGNR,
+    instrux_VPAND,
+    instrux_VPANDN,
+    instrux_VPAVGB,
+    instrux_VPAVGW,
+    instrux_VPBLENDVB,
+    instrux_VPBLENDW,
+    instrux_VPCLMULHQHQDQ,
+    instrux_VPCLMULHQLQDQ,
+    instrux_VPCLMULLQHQDQ,
+    instrux_VPCLMULLQLQDQ,
+    instrux_VPCLMULQDQ,
+    instrux_VPCMOV,
+    instrux_VPCMPEQB,
+    instrux_VPCMPEQD,
+    instrux_VPCMPEQQ,
+    instrux_VPCMPEQW,
+    instrux_VPCMPESTRI,
+    instrux_VPCMPESTRM,
+    instrux_VPCMPGTB,
+    instrux_VPCMPGTD,
+    instrux_VPCMPGTQ,
+    instrux_VPCMPGTW,
+    instrux_VPCMPISTRI,
+    instrux_VPCMPISTRM,
+    instrux_VPCOMB,
+    instrux_VPCOMD,
+    instrux_VPCOMQ,
+    instrux_VPCOMUB,
+    instrux_VPCOMUD,
+    instrux_VPCOMUQ,
+    instrux_VPCOMUW,
+    instrux_VPCOMW,
+    instrux_VPERM2F128,
+    instrux_VPERMIL2PD,
+    instrux_VPERMIL2PS,
+    instrux_VPERMILMO2PD,
+    instrux_VPERMILMO2PS,
+    instrux_VPERMILMZ2PD,
+    instrux_VPERMILMZ2PS,
+    instrux_VPERMILPD,
+    instrux_VPERMILPS,
+    instrux_VPERMILTD2PD,
+    instrux_VPERMILTD2PS,
+    instrux_VPEXTRB,
+    instrux_VPEXTRD,
+    instrux_VPEXTRQ,
+    instrux_VPEXTRW,
+    instrux_VPHADDBD,
+    instrux_VPHADDBQ,
+    instrux_VPHADDBW,
+    instrux_VPHADDD,
+    instrux_VPHADDDQ,
+    instrux_VPHADDSW,
+    instrux_VPHADDUBD,
+    instrux_VPHADDUBQ,
+    instrux_VPHADDUBW,
+    instrux_VPHADDUDQ,
+    instrux_VPHADDUWD,
+    instrux_VPHADDUWQ,
+    instrux_VPHADDW,
+    instrux_VPHADDWD,
+    instrux_VPHADDWQ,
+    instrux_VPHMINPOSUW,
+    instrux_VPHSUBBW,
+    instrux_VPHSUBD,
+    instrux_VPHSUBDQ,
+    instrux_VPHSUBSW,
+    instrux_VPHSUBW,
+    instrux_VPHSUBWD,
+    instrux_VPINSRB,
+    instrux_VPINSRD,
+    instrux_VPINSRQ,
+    instrux_VPINSRW,
+    instrux_VPMACSDD,
+    instrux_VPMACSDQH,
+    instrux_VPMACSDQL,
+    instrux_VPMACSSDD,
+    instrux_VPMACSSDQH,
+    instrux_VPMACSSDQL,
+    instrux_VPMACSSWD,
+    instrux_VPMACSSWW,
+    instrux_VPMACSWD,
+    instrux_VPMACSWW,
+    instrux_VPMADCSSWD,
+    instrux_VPMADCSWD,
+    instrux_VPMADDUBSW,
+    instrux_VPMADDWD,
+    instrux_VPMAXSB,
+    instrux_VPMAXSD,
+    instrux_VPMAXSW,
+    instrux_VPMAXUB,
+    instrux_VPMAXUD,
+    instrux_VPMAXUW,
+    instrux_VPMINSB,
+    instrux_VPMINSD,
+    instrux_VPMINSW,
+    instrux_VPMINUB,
+    instrux_VPMINUD,
+    instrux_VPMINUW,
+    instrux_VPMOVMSKB,
+    instrux_VPMOVSXBD,
+    instrux_VPMOVSXBQ,
+    instrux_VPMOVSXBW,
+    instrux_VPMOVSXDQ,
+    instrux_VPMOVSXWD,
+    instrux_VPMOVSXWQ,
+    instrux_VPMOVZXBD,
+    instrux_VPMOVZXBQ,
+    instrux_VPMOVZXBW,
+    instrux_VPMOVZXDQ,
+    instrux_VPMOVZXWD,
+    instrux_VPMOVZXWQ,
+    instrux_VPMULDQ,
+    instrux_VPMULHRSW,
+    instrux_VPMULHUW,
+    instrux_VPMULHW,
+    instrux_VPMULLD,
+    instrux_VPMULLW,
+    instrux_VPMULUDQ,
+    instrux_VPOR,
+    instrux_VPPERM,
+    instrux_VPROTB,
+    instrux_VPROTD,
+    instrux_VPROTQ,
+    instrux_VPROTW,
+    instrux_VPSADBW,
+    instrux_VPSHAB,
+    instrux_VPSHAD,
+    instrux_VPSHAQ,
+    instrux_VPSHAW,
+    instrux_VPSHLB,
+    instrux_VPSHLD,
+    instrux_VPSHLQ,
+    instrux_VPSHLW,
+    instrux_VPSHUFB,
+    instrux_VPSHUFD,
+    instrux_VPSHUFHW,
+    instrux_VPSHUFLW,
+    instrux_VPSIGNB,
+    instrux_VPSIGND,
+    instrux_VPSIGNW,
+    instrux_VPSLLD,
+    instrux_VPSLLDQ,
+    instrux_VPSLLQ,
+    instrux_VPSLLW,
+    instrux_VPSRAD,
+    instrux_VPSRAW,
+    instrux_VPSRLD,
+    instrux_VPSRLDQ,
+    instrux_VPSRLQ,
+    instrux_VPSRLW,
+    instrux_VPSUBB,
+    instrux_VPSUBD,
+    instrux_VPSUBQ,
+    instrux_VPSUBSB,
+    instrux_VPSUBSW,
+    instrux_VPSUBUSB,
+    instrux_VPSUBUSW,
+    instrux_VPSUBW,
+    instrux_VPTEST,
+    instrux_VPUNPCKHBW,
+    instrux_VPUNPCKHDQ,
+    instrux_VPUNPCKHQDQ,
+    instrux_VPUNPCKHWD,
+    instrux_VPUNPCKLBW,
+    instrux_VPUNPCKLDQ,
+    instrux_VPUNPCKLQDQ,
+    instrux_VPUNPCKLWD,
+    instrux_VPXOR,
+    instrux_VRCPPS,
+    instrux_VRCPSS,
+    instrux_VROUNDPD,
+    instrux_VROUNDPS,
+    instrux_VROUNDSD,
+    instrux_VROUNDSS,
+    instrux_VRSQRTPS,
+    instrux_VRSQRTSS,
+    instrux_VSHUFPD,
+    instrux_VSHUFPS,
+    instrux_VSQRTPD,
+    instrux_VSQRTPS,
+    instrux_VSQRTSD,
+    instrux_VSQRTSS,
+    instrux_VSTMXCSR,
+    instrux_VSUBPD,
+    instrux_VSUBPS,
+    instrux_VSUBSD,
+    instrux_VSUBSS,
+    instrux_VTESTPD,
+    instrux_VTESTPS,
+    instrux_VUCOMISD,
+    instrux_VUCOMISS,
+    instrux_VUNPCKHPD,
+    instrux_VUNPCKHPS,
+    instrux_VUNPCKLPD,
+    instrux_VUNPCKLPS,
+    instrux_VXORPD,
+    instrux_VXORPS,
+    instrux_VZEROALL,
+    instrux_VZEROUPPER,
+    instrux_WBINVD,
+    instrux_WRMSR,
+    instrux_WRSHR,
+    instrux_XADD,
+    instrux_XBTS,
+    instrux_XCHG,
+    instrux_XCRYPTCBC,
+    instrux_XCRYPTCFB,
+    instrux_XCRYPTCTR,
+    instrux_XCRYPTECB,
+    instrux_XCRYPTOFB,
+    instrux_XGETBV,
+    instrux_XLAT,
+    instrux_XLATB,
+    instrux_XOR,
+    instrux_XORPD,
+    instrux_XORPS,
+    instrux_XRSTOR,
+    instrux_XSAVE,
+    instrux_XSETBV,
+    instrux_XSHA1,
+    instrux_XSHA256,
+    instrux_XSTORE,
+    instrux_CMOVcc,
+    instrux_Jcc,
+    instrux_SETcc,
+};
diff --git a/insnsb.c b/insnsb.c
new file mode 100644 (file)
index 0000000..490c5bf
--- /dev/null
+++ b/insnsb.c
@@ -0,0 +1,3016 @@
+/* This file auto-generated from insns.dat by insns.pl - don't edit it */
+
+#include "nasm.h"
+#include "insns.h"
+
+const uint8_t nasm_bytecodes[20028] = {
+    /*     0 */ 0324,0361,03,017,072,027,0101,026,0,
+    /*     9 */ 0324,0361,03,017,072,024,0101,026,0,
+    /*    18 */ 0324,0361,03,017,072,026,0101,026,0,
+    /*    27 */ 0324,0361,03,017,072,025,0101,026,0,
+    /*    36 */ 0325,0361,03,017,072,040,0110,026,0,
+    /*    45 */ 0324,0361,03,017,072,042,0110,026,0,
+    /*    54 */ 0261,03,021,01,0113,0120,0174,03,0,
+    /*    63 */ 0261,03,025,01,0113,0120,0174,03,0,
+    /*    72 */ 0261,03,021,01,0112,0120,0174,03,0,
+    /*    81 */ 0261,03,025,01,0112,0120,0174,03,0,
+    /*    90 */ 0261,01,021,01,0302,0120,01,0,0,
+    /*    99 */ 0260,01,021,01,0302,0110,01,0,0,
+    /*   108 */ 0261,01,025,01,0302,0120,01,0,0,
+    /*   117 */ 0260,01,025,01,0302,0110,01,0,0,
+    /*   126 */ 0261,01,021,01,0302,0120,01,01,0,
+    /*   135 */ 0260,01,021,01,0302,0110,01,01,0,
+    /*   144 */ 0261,01,025,01,0302,0120,01,01,0,
+    /*   153 */ 0260,01,025,01,0302,0110,01,01,0,
+    /*   162 */ 0261,01,021,01,0302,0120,01,02,0,
+    /*   171 */ 0260,01,021,01,0302,0110,01,02,0,
+    /*   180 */ 0261,01,025,01,0302,0120,01,02,0,
+    /*   189 */ 0260,01,025,01,0302,0110,01,02,0,
+    /*   198 */ 0261,01,021,01,0302,0120,01,03,0,
+    /*   207 */ 0260,01,021,01,0302,0110,01,03,0,
+    /*   216 */ 0261,01,025,01,0302,0120,01,03,0,
+    /*   225 */ 0260,01,025,01,0302,0110,01,03,0,
+    /*   234 */ 0261,01,021,01,0302,0120,01,04,0,
+    /*   243 */ 0260,01,021,01,0302,0110,01,04,0,
+    /*   252 */ 0261,01,025,01,0302,0120,01,04,0,
+    /*   261 */ 0260,01,025,01,0302,0110,01,04,0,
+    /*   270 */ 0261,01,021,01,0302,0120,01,05,0,
+    /*   279 */ 0260,01,021,01,0302,0110,01,05,0,
+    /*   288 */ 0261,01,025,01,0302,0120,01,05,0,
+    /*   297 */ 0260,01,025,01,0302,0110,01,05,0,
+    /*   306 */ 0261,01,021,01,0302,0120,01,06,0,
+    /*   315 */ 0260,01,021,01,0302,0110,01,06,0,
+    /*   324 */ 0261,01,025,01,0302,0120,01,06,0,
+    /*   333 */ 0260,01,025,01,0302,0110,01,06,0,
+    /*   342 */ 0261,01,021,01,0302,0120,01,07,0,
+    /*   351 */ 0260,01,021,01,0302,0110,01,07,0,
+    /*   360 */ 0261,01,025,01,0302,0120,01,07,0,
+    /*   369 */ 0260,01,025,01,0302,0110,01,07,0,
+    /*   378 */ 0261,01,021,01,0302,0120,01,010,0,
+    /*   387 */ 0260,01,021,01,0302,0110,01,010,0,
+    /*   396 */ 0261,01,025,01,0302,0120,01,010,0,
+    /*   405 */ 0260,01,025,01,0302,0110,01,010,0,
+    /*   414 */ 0261,01,021,01,0302,0120,01,011,0,
+    /*   423 */ 0260,01,021,01,0302,0110,01,011,0,
+    /*   432 */ 0261,01,025,01,0302,0120,01,011,0,
+    /*   441 */ 0260,01,025,01,0302,0110,01,011,0,
+    /*   450 */ 0261,01,021,01,0302,0120,01,012,0,
+    /*   459 */ 0260,01,021,01,0302,0110,01,012,0,
+    /*   468 */ 0261,01,025,01,0302,0120,01,012,0,
+    /*   477 */ 0260,01,025,01,0302,0110,01,012,0,
+    /*   486 */ 0261,01,021,01,0302,0120,01,013,0,
+    /*   495 */ 0260,01,021,01,0302,0110,01,013,0,
+    /*   504 */ 0261,01,025,01,0302,0120,01,013,0,
+    /*   513 */ 0260,01,025,01,0302,0110,01,013,0,
+    /*   522 */ 0261,01,021,01,0302,0120,01,014,0,
+    /*   531 */ 0260,01,021,01,0302,0110,01,014,0,
+    /*   540 */ 0261,01,025,01,0302,0120,01,014,0,
+    /*   549 */ 0260,01,025,01,0302,0110,01,014,0,
+    /*   558 */ 0261,01,021,01,0302,0120,01,015,0,
+    /*   567 */ 0260,01,021,01,0302,0110,01,015,0,
+    /*   576 */ 0261,01,025,01,0302,0120,01,015,0,
+    /*   585 */ 0260,01,025,01,0302,0110,01,015,0,
+    /*   594 */ 0261,01,021,01,0302,0120,01,016,0,
+    /*   603 */ 0260,01,021,01,0302,0110,01,016,0,
+    /*   612 */ 0261,01,025,01,0302,0120,01,016,0,
+    /*   621 */ 0260,01,025,01,0302,0110,01,016,0,
+    /*   630 */ 0261,01,021,01,0302,0120,01,017,0,
+    /*   639 */ 0260,01,021,01,0302,0110,01,017,0,
+    /*   648 */ 0261,01,025,01,0302,0120,01,017,0,
+    /*   657 */ 0260,01,025,01,0302,0110,01,017,0,
+    /*   666 */ 0261,01,021,01,0302,0120,01,020,0,
+    /*   675 */ 0260,01,021,01,0302,0110,01,020,0,
+    /*   684 */ 0261,01,025,01,0302,0120,01,020,0,
+    /*   693 */ 0260,01,025,01,0302,0110,01,020,0,
+    /*   702 */ 0261,01,021,01,0302,0120,01,021,0,
+    /*   711 */ 0260,01,021,01,0302,0110,01,021,0,
+    /*   720 */ 0261,01,025,01,0302,0120,01,021,0,
+    /*   729 */ 0260,01,025,01,0302,0110,01,021,0,
+    /*   738 */ 0261,01,021,01,0302,0120,01,022,0,
+    /*   747 */ 0260,01,021,01,0302,0110,01,022,0,
+    /*   756 */ 0261,01,025,01,0302,0120,01,022,0,
+    /*   765 */ 0260,01,025,01,0302,0110,01,022,0,
+    /*   774 */ 0261,01,021,01,0302,0120,01,023,0,
+    /*   783 */ 0260,01,021,01,0302,0110,01,023,0,
+    /*   792 */ 0261,01,025,01,0302,0120,01,023,0,
+    /*   801 */ 0260,01,025,01,0302,0110,01,023,0,
+    /*   810 */ 0261,01,021,01,0302,0120,01,024,0,
+    /*   819 */ 0260,01,021,01,0302,0110,01,024,0,
+    /*   828 */ 0261,01,025,01,0302,0120,01,024,0,
+    /*   837 */ 0260,01,025,01,0302,0110,01,024,0,
+    /*   846 */ 0261,01,021,01,0302,0120,01,025,0,
+    /*   855 */ 0260,01,021,01,0302,0110,01,025,0,
+    /*   864 */ 0261,01,025,01,0302,0120,01,025,0,
+    /*   873 */ 0260,01,025,01,0302,0110,01,025,0,
+    /*   882 */ 0261,01,021,01,0302,0120,01,026,0,
+    /*   891 */ 0260,01,021,01,0302,0110,01,026,0,
+    /*   900 */ 0261,01,025,01,0302,0120,01,026,0,
+    /*   909 */ 0260,01,025,01,0302,0110,01,026,0,
+    /*   918 */ 0261,01,021,01,0302,0120,01,027,0,
+    /*   927 */ 0260,01,021,01,0302,0110,01,027,0,
+    /*   936 */ 0261,01,025,01,0302,0120,01,027,0,
+    /*   945 */ 0260,01,025,01,0302,0110,01,027,0,
+    /*   954 */ 0261,01,021,01,0302,0120,01,030,0,
+    /*   963 */ 0260,01,021,01,0302,0110,01,030,0,
+    /*   972 */ 0261,01,025,01,0302,0120,01,030,0,
+    /*   981 */ 0260,01,025,01,0302,0110,01,030,0,
+    /*   990 */ 0261,01,021,01,0302,0120,01,031,0,
+    /*   999 */ 0260,01,021,01,0302,0110,01,031,0,
+    /*  1008 */ 0261,01,025,01,0302,0120,01,031,0,
+    /*  1017 */ 0260,01,025,01,0302,0110,01,031,0,
+    /*  1026 */ 0261,01,021,01,0302,0120,01,032,0,
+    /*  1035 */ 0260,01,021,01,0302,0110,01,032,0,
+    /*  1044 */ 0261,01,025,01,0302,0120,01,032,0,
+    /*  1053 */ 0260,01,025,01,0302,0110,01,032,0,
+    /*  1062 */ 0261,01,021,01,0302,0120,01,033,0,
+    /*  1071 */ 0260,01,021,01,0302,0110,01,033,0,
+    /*  1080 */ 0261,01,025,01,0302,0120,01,033,0,
+    /*  1089 */ 0260,01,025,01,0302,0110,01,033,0,
+    /*  1098 */ 0261,01,021,01,0302,0120,01,034,0,
+    /*  1107 */ 0260,01,021,01,0302,0110,01,034,0,
+    /*  1116 */ 0261,01,025,01,0302,0120,01,034,0,
+    /*  1125 */ 0260,01,025,01,0302,0110,01,034,0,
+    /*  1134 */ 0261,01,021,01,0302,0120,01,035,0,
+    /*  1143 */ 0260,01,021,01,0302,0110,01,035,0,
+    /*  1152 */ 0261,01,025,01,0302,0120,01,035,0,
+    /*  1161 */ 0260,01,025,01,0302,0110,01,035,0,
+    /*  1170 */ 0261,01,021,01,0302,0120,01,036,0,
+    /*  1179 */ 0260,01,021,01,0302,0110,01,036,0,
+    /*  1188 */ 0261,01,025,01,0302,0120,01,036,0,
+    /*  1197 */ 0260,01,025,01,0302,0110,01,036,0,
+    /*  1206 */ 0261,01,021,01,0302,0120,01,037,0,
+    /*  1215 */ 0260,01,021,01,0302,0110,01,037,0,
+    /*  1224 */ 0261,01,025,01,0302,0120,01,037,0,
+    /*  1233 */ 0260,01,025,01,0302,0110,01,037,0,
+    /*  1242 */ 0261,01,020,01,0302,0120,01,0,0,
+    /*  1251 */ 0260,01,020,01,0302,0110,01,0,0,
+    /*  1260 */ 0261,01,024,01,0302,0120,01,0,0,
+    /*  1269 */ 0260,01,024,01,0302,0110,01,0,0,
+    /*  1278 */ 0261,01,020,01,0302,0120,01,01,0,
+    /*  1287 */ 0260,01,020,01,0302,0110,01,01,0,
+    /*  1296 */ 0261,01,024,01,0302,0120,01,01,0,
+    /*  1305 */ 0260,01,024,01,0302,0110,01,01,0,
+    /*  1314 */ 0261,01,020,01,0302,0120,01,02,0,
+    /*  1323 */ 0260,01,020,01,0302,0110,01,02,0,
+    /*  1332 */ 0261,01,024,01,0302,0120,01,02,0,
+    /*  1341 */ 0260,01,024,01,0302,0110,01,02,0,
+    /*  1350 */ 0261,01,020,01,0302,0120,01,03,0,
+    /*  1359 */ 0260,01,020,01,0302,0110,01,03,0,
+    /*  1368 */ 0261,01,024,01,0302,0120,01,03,0,
+    /*  1377 */ 0260,01,024,01,0302,0110,01,03,0,
+    /*  1386 */ 0261,01,020,01,0302,0120,01,04,0,
+    /*  1395 */ 0260,01,020,01,0302,0110,01,04,0,
+    /*  1404 */ 0261,01,024,01,0302,0120,01,04,0,
+    /*  1413 */ 0260,01,024,01,0302,0110,01,04,0,
+    /*  1422 */ 0261,01,020,01,0302,0120,01,05,0,
+    /*  1431 */ 0260,01,020,01,0302,0110,01,05,0,
+    /*  1440 */ 0261,01,024,01,0302,0120,01,05,0,
+    /*  1449 */ 0260,01,024,01,0302,0110,01,05,0,
+    /*  1458 */ 0261,01,020,01,0302,0120,01,06,0,
+    /*  1467 */ 0260,01,020,01,0302,0110,01,06,0,
+    /*  1476 */ 0261,01,024,01,0302,0120,01,06,0,
+    /*  1485 */ 0260,01,024,01,0302,0110,01,06,0,
+    /*  1494 */ 0261,01,020,01,0302,0120,01,07,0,
+    /*  1503 */ 0260,01,020,01,0302,0110,01,07,0,
+    /*  1512 */ 0261,01,024,01,0302,0120,01,07,0,
+    /*  1521 */ 0260,01,024,01,0302,0110,01,07,0,
+    /*  1530 */ 0261,01,020,01,0302,0120,01,010,0,
+    /*  1539 */ 0260,01,020,01,0302,0110,01,010,0,
+    /*  1548 */ 0261,01,024,01,0302,0120,01,010,0,
+    /*  1557 */ 0260,01,024,01,0302,0110,01,010,0,
+    /*  1566 */ 0261,01,020,01,0302,0120,01,011,0,
+    /*  1575 */ 0260,01,020,01,0302,0110,01,011,0,
+    /*  1584 */ 0261,01,024,01,0302,0120,01,011,0,
+    /*  1593 */ 0260,01,024,01,0302,0110,01,011,0,
+    /*  1602 */ 0261,01,020,01,0302,0120,01,012,0,
+    /*  1611 */ 0260,01,020,01,0302,0110,01,012,0,
+    /*  1620 */ 0261,01,024,01,0302,0120,01,012,0,
+    /*  1629 */ 0260,01,024,01,0302,0110,01,012,0,
+    /*  1638 */ 0261,01,020,01,0302,0120,01,013,0,
+    /*  1647 */ 0260,01,020,01,0302,0110,01,013,0,
+    /*  1656 */ 0261,01,024,01,0302,0120,01,013,0,
+    /*  1665 */ 0260,01,024,01,0302,0110,01,013,0,
+    /*  1674 */ 0261,01,020,01,0302,0120,01,014,0,
+    /*  1683 */ 0260,01,020,01,0302,0110,01,014,0,
+    /*  1692 */ 0261,01,024,01,0302,0120,01,014,0,
+    /*  1701 */ 0260,01,024,01,0302,0110,01,014,0,
+    /*  1710 */ 0261,01,020,01,0302,0120,01,015,0,
+    /*  1719 */ 0260,01,020,01,0302,0110,01,015,0,
+    /*  1728 */ 0261,01,024,01,0302,0120,01,015,0,
+    /*  1737 */ 0260,01,024,01,0302,0110,01,015,0,
+    /*  1746 */ 0261,01,020,01,0302,0120,01,016,0,
+    /*  1755 */ 0260,01,020,01,0302,0110,01,016,0,
+    /*  1764 */ 0261,01,024,01,0302,0120,01,016,0,
+    /*  1773 */ 0260,01,024,01,0302,0110,01,016,0,
+    /*  1782 */ 0261,01,020,01,0302,0120,01,017,0,
+    /*  1791 */ 0260,01,020,01,0302,0110,01,017,0,
+    /*  1800 */ 0261,01,024,01,0302,0120,01,017,0,
+    /*  1809 */ 0260,01,024,01,0302,0110,01,017,0,
+    /*  1818 */ 0261,01,020,01,0302,0120,01,020,0,
+    /*  1827 */ 0260,01,020,01,0302,0110,01,020,0,
+    /*  1836 */ 0261,01,024,01,0302,0120,01,020,0,
+    /*  1845 */ 0260,01,024,01,0302,0110,01,020,0,
+    /*  1854 */ 0261,01,020,01,0302,0120,01,021,0,
+    /*  1863 */ 0260,01,020,01,0302,0110,01,021,0,
+    /*  1872 */ 0261,01,024,01,0302,0120,01,021,0,
+    /*  1881 */ 0260,01,024,01,0302,0110,01,021,0,
+    /*  1890 */ 0261,01,020,01,0302,0120,01,022,0,
+    /*  1899 */ 0260,01,020,01,0302,0110,01,022,0,
+    /*  1908 */ 0261,01,024,01,0302,0120,01,022,0,
+    /*  1917 */ 0260,01,024,01,0302,0110,01,022,0,
+    /*  1926 */ 0261,01,020,01,0302,0120,01,023,0,
+    /*  1935 */ 0260,01,020,01,0302,0110,01,023,0,
+    /*  1944 */ 0261,01,024,01,0302,0120,01,023,0,
+    /*  1953 */ 0260,01,024,01,0302,0110,01,023,0,
+    /*  1962 */ 0261,01,020,01,0302,0120,01,024,0,
+    /*  1971 */ 0260,01,020,01,0302,0110,01,024,0,
+    /*  1980 */ 0261,01,024,01,0302,0120,01,024,0,
+    /*  1989 */ 0260,01,024,01,0302,0110,01,024,0,
+    /*  1998 */ 0261,01,020,01,0302,0120,01,025,0,
+    /*  2007 */ 0260,01,020,01,0302,0110,01,025,0,
+    /*  2016 */ 0261,01,024,01,0302,0120,01,025,0,
+    /*  2025 */ 0260,01,024,01,0302,0110,01,025,0,
+    /*  2034 */ 0261,01,020,01,0302,0120,01,026,0,
+    /*  2043 */ 0260,01,020,01,0302,0110,01,026,0,
+    /*  2052 */ 0261,01,024,01,0302,0120,01,026,0,
+    /*  2061 */ 0260,01,024,01,0302,0110,01,026,0,
+    /*  2070 */ 0261,01,020,01,0302,0120,01,027,0,
+    /*  2079 */ 0260,01,020,01,0302,0110,01,027,0,
+    /*  2088 */ 0261,01,024,01,0302,0120,01,027,0,
+    /*  2097 */ 0260,01,024,01,0302,0110,01,027,0,
+    /*  2106 */ 0261,01,020,01,0302,0120,01,030,0,
+    /*  2115 */ 0260,01,020,01,0302,0110,01,030,0,
+    /*  2124 */ 0261,01,024,01,0302,0120,01,030,0,
+    /*  2133 */ 0260,01,024,01,0302,0110,01,030,0,
+    /*  2142 */ 0261,01,020,01,0302,0120,01,031,0,
+    /*  2151 */ 0260,01,020,01,0302,0110,01,031,0,
+    /*  2160 */ 0261,01,024,01,0302,0120,01,031,0,
+    /*  2169 */ 0260,01,024,01,0302,0110,01,031,0,
+    /*  2178 */ 0261,01,020,01,0302,0120,01,032,0,
+    /*  2187 */ 0260,01,020,01,0302,0110,01,032,0,
+    /*  2196 */ 0261,01,024,01,0302,0120,01,032,0,
+    /*  2205 */ 0260,01,024,01,0302,0110,01,032,0,
+    /*  2214 */ 0261,01,020,01,0302,0120,01,033,0,
+    /*  2223 */ 0260,01,020,01,0302,0110,01,033,0,
+    /*  2232 */ 0261,01,024,01,0302,0120,01,033,0,
+    /*  2241 */ 0260,01,024,01,0302,0110,01,033,0,
+    /*  2250 */ 0261,01,020,01,0302,0120,01,034,0,
+    /*  2259 */ 0260,01,020,01,0302,0110,01,034,0,
+    /*  2268 */ 0261,01,024,01,0302,0120,01,034,0,
+    /*  2277 */ 0260,01,024,01,0302,0110,01,034,0,
+    /*  2286 */ 0261,01,020,01,0302,0120,01,035,0,
+    /*  2295 */ 0260,01,020,01,0302,0110,01,035,0,
+    /*  2304 */ 0261,01,024,01,0302,0120,01,035,0,
+    /*  2313 */ 0260,01,024,01,0302,0110,01,035,0,
+    /*  2322 */ 0261,01,020,01,0302,0120,01,036,0,
+    /*  2331 */ 0260,01,020,01,0302,0110,01,036,0,
+    /*  2340 */ 0261,01,024,01,0302,0120,01,036,0,
+    /*  2349 */ 0260,01,024,01,0302,0110,01,036,0,
+    /*  2358 */ 0261,01,020,01,0302,0120,01,037,0,
+    /*  2367 */ 0260,01,020,01,0302,0110,01,037,0,
+    /*  2376 */ 0261,01,024,01,0302,0120,01,037,0,
+    /*  2385 */ 0260,01,024,01,0302,0110,01,037,0,
+    /*  2394 */ 0261,01,023,01,0302,0120,01,0,0,
+    /*  2403 */ 0260,01,023,01,0302,0110,01,0,0,
+    /*  2412 */ 0261,01,023,01,0302,0120,01,01,0,
+    /*  2421 */ 0260,01,023,01,0302,0110,01,01,0,
+    /*  2430 */ 0261,01,023,01,0302,0120,01,02,0,
+    /*  2439 */ 0260,01,023,01,0302,0110,01,02,0,
+    /*  2448 */ 0261,01,023,01,0302,0120,01,03,0,
+    /*  2457 */ 0260,01,023,01,0302,0110,01,03,0,
+    /*  2466 */ 0261,01,023,01,0302,0120,01,04,0,
+    /*  2475 */ 0260,01,023,01,0302,0110,01,04,0,
+    /*  2484 */ 0261,01,023,01,0302,0120,01,05,0,
+    /*  2493 */ 0260,01,023,01,0302,0110,01,05,0,
+    /*  2502 */ 0261,01,023,01,0302,0120,01,06,0,
+    /*  2511 */ 0260,01,023,01,0302,0110,01,06,0,
+    /*  2520 */ 0261,01,023,01,0302,0120,01,07,0,
+    /*  2529 */ 0260,01,023,01,0302,0110,01,07,0,
+    /*  2538 */ 0261,01,023,01,0302,0120,01,010,0,
+    /*  2547 */ 0260,01,023,01,0302,0110,01,010,0,
+    /*  2556 */ 0261,01,023,01,0302,0120,01,011,0,
+    /*  2565 */ 0260,01,023,01,0302,0110,01,011,0,
+    /*  2574 */ 0261,01,023,01,0302,0120,01,012,0,
+    /*  2583 */ 0260,01,023,01,0302,0110,01,012,0,
+    /*  2592 */ 0261,01,023,01,0302,0120,01,013,0,
+    /*  2601 */ 0260,01,023,01,0302,0110,01,013,0,
+    /*  2610 */ 0261,01,023,01,0302,0120,01,014,0,
+    /*  2619 */ 0260,01,023,01,0302,0110,01,014,0,
+    /*  2628 */ 0261,01,023,01,0302,0120,01,015,0,
+    /*  2637 */ 0260,01,023,01,0302,0110,01,015,0,
+    /*  2646 */ 0261,01,023,01,0302,0120,01,016,0,
+    /*  2655 */ 0260,01,023,01,0302,0110,01,016,0,
+    /*  2664 */ 0261,01,023,01,0302,0120,01,017,0,
+    /*  2673 */ 0260,01,023,01,0302,0110,01,017,0,
+    /*  2682 */ 0261,01,023,01,0302,0120,01,020,0,
+    /*  2691 */ 0260,01,023,01,0302,0110,01,020,0,
+    /*  2700 */ 0261,01,023,01,0302,0120,01,021,0,
+    /*  2709 */ 0260,01,023,01,0302,0110,01,021,0,
+    /*  2718 */ 0261,01,023,01,0302,0120,01,022,0,
+    /*  2727 */ 0260,01,023,01,0302,0110,01,022,0,
+    /*  2736 */ 0261,01,023,01,0302,0120,01,023,0,
+    /*  2745 */ 0260,01,023,01,0302,0110,01,023,0,
+    /*  2754 */ 0261,01,023,01,0302,0120,01,024,0,
+    /*  2763 */ 0260,01,023,01,0302,0110,01,024,0,
+    /*  2772 */ 0261,01,023,01,0302,0120,01,025,0,
+    /*  2781 */ 0260,01,023,01,0302,0110,01,025,0,
+    /*  2790 */ 0261,01,023,01,0302,0120,01,026,0,
+    /*  2799 */ 0260,01,023,01,0302,0110,01,026,0,
+    /*  2808 */ 0261,01,023,01,0302,0120,01,027,0,
+    /*  2817 */ 0260,01,023,01,0302,0110,01,027,0,
+    /*  2826 */ 0261,01,023,01,0302,0120,01,030,0,
+    /*  2835 */ 0260,01,023,01,0302,0110,01,030,0,
+    /*  2844 */ 0261,01,023,01,0302,0120,01,031,0,
+    /*  2853 */ 0260,01,023,01,0302,0110,01,031,0,
+    /*  2862 */ 0261,01,023,01,0302,0120,01,032,0,
+    /*  2871 */ 0260,01,023,01,0302,0110,01,032,0,
+    /*  2880 */ 0261,01,023,01,0302,0120,01,033,0,
+    /*  2889 */ 0260,01,023,01,0302,0110,01,033,0,
+    /*  2898 */ 0261,01,023,01,0302,0120,01,034,0,
+    /*  2907 */ 0260,01,023,01,0302,0110,01,034,0,
+    /*  2916 */ 0261,01,023,01,0302,0120,01,035,0,
+    /*  2925 */ 0260,01,023,01,0302,0110,01,035,0,
+    /*  2934 */ 0261,01,023,01,0302,0120,01,036,0,
+    /*  2943 */ 0260,01,023,01,0302,0110,01,036,0,
+    /*  2952 */ 0261,01,023,01,0302,0120,01,037,0,
+    /*  2961 */ 0260,01,023,01,0302,0110,01,037,0,
+    /*  2970 */ 0261,01,022,01,0302,0120,01,0,0,
+    /*  2979 */ 0260,01,022,01,0302,0110,01,0,0,
+    /*  2988 */ 0261,01,022,01,0302,0120,01,01,0,
+    /*  2997 */ 0260,01,022,01,0302,0110,01,01,0,
+    /*  3006 */ 0261,01,022,01,0302,0120,01,02,0,
+    /*  3015 */ 0260,01,022,01,0302,0110,01,02,0,
+    /*  3024 */ 0261,01,022,01,0302,0120,01,03,0,
+    /*  3033 */ 0260,01,022,01,0302,0110,01,03,0,
+    /*  3042 */ 0261,01,022,01,0302,0120,01,04,0,
+    /*  3051 */ 0260,01,022,01,0302,0110,01,04,0,
+    /*  3060 */ 0261,01,022,01,0302,0120,01,05,0,
+    /*  3069 */ 0260,01,022,01,0302,0110,01,05,0,
+    /*  3078 */ 0261,01,022,01,0302,0120,01,06,0,
+    /*  3087 */ 0260,01,022,01,0302,0110,01,06,0,
+    /*  3096 */ 0261,01,022,01,0302,0120,01,07,0,
+    /*  3105 */ 0260,01,022,01,0302,0110,01,07,0,
+    /*  3114 */ 0261,01,022,01,0302,0120,01,010,0,
+    /*  3123 */ 0260,01,022,01,0302,0110,01,010,0,
+    /*  3132 */ 0261,01,022,01,0302,0120,01,011,0,
+    /*  3141 */ 0260,01,022,01,0302,0110,01,011,0,
+    /*  3150 */ 0261,01,022,01,0302,0120,01,012,0,
+    /*  3159 */ 0260,01,022,01,0302,0110,01,012,0,
+    /*  3168 */ 0261,01,022,01,0302,0120,01,013,0,
+    /*  3177 */ 0260,01,022,01,0302,0110,01,013,0,
+    /*  3186 */ 0261,01,022,01,0302,0120,01,014,0,
+    /*  3195 */ 0260,01,022,01,0302,0110,01,014,0,
+    /*  3204 */ 0261,01,022,01,0302,0120,01,015,0,
+    /*  3213 */ 0260,01,022,01,0302,0110,01,015,0,
+    /*  3222 */ 0261,01,022,01,0302,0120,01,016,0,
+    /*  3231 */ 0260,01,022,01,0302,0110,01,016,0,
+    /*  3240 */ 0261,01,022,01,0302,0120,01,017,0,
+    /*  3249 */ 0260,01,022,01,0302,0110,01,017,0,
+    /*  3258 */ 0261,01,022,01,0302,0120,01,020,0,
+    /*  3267 */ 0260,01,022,01,0302,0110,01,020,0,
+    /*  3276 */ 0261,01,022,01,0302,0120,01,021,0,
+    /*  3285 */ 0260,01,022,01,0302,0110,01,021,0,
+    /*  3294 */ 0261,01,022,01,0302,0120,01,022,0,
+    /*  3303 */ 0260,01,022,01,0302,0110,01,022,0,
+    /*  3312 */ 0261,01,022,01,0302,0120,01,023,0,
+    /*  3321 */ 0260,01,022,01,0302,0110,01,023,0,
+    /*  3330 */ 0261,01,022,01,0302,0120,01,024,0,
+    /*  3339 */ 0260,01,022,01,0302,0110,01,024,0,
+    /*  3348 */ 0261,01,022,01,0302,0120,01,025,0,
+    /*  3357 */ 0260,01,022,01,0302,0110,01,025,0,
+    /*  3366 */ 0261,01,022,01,0302,0120,01,026,0,
+    /*  3375 */ 0260,01,022,01,0302,0110,01,026,0,
+    /*  3384 */ 0261,01,022,01,0302,0120,01,027,0,
+    /*  3393 */ 0260,01,022,01,0302,0110,01,027,0,
+    /*  3402 */ 0261,01,022,01,0302,0120,01,030,0,
+    /*  3411 */ 0260,01,022,01,0302,0110,01,030,0,
+    /*  3420 */ 0261,01,022,01,0302,0120,01,031,0,
+    /*  3429 */ 0260,01,022,01,0302,0110,01,031,0,
+    /*  3438 */ 0261,01,022,01,0302,0120,01,032,0,
+    /*  3447 */ 0260,01,022,01,0302,0110,01,032,0,
+    /*  3456 */ 0261,01,022,01,0302,0120,01,033,0,
+    /*  3465 */ 0260,01,022,01,0302,0110,01,033,0,
+    /*  3474 */ 0261,01,022,01,0302,0120,01,034,0,
+    /*  3483 */ 0260,01,022,01,0302,0110,01,034,0,
+    /*  3492 */ 0261,01,022,01,0302,0120,01,035,0,
+    /*  3501 */ 0260,01,022,01,0302,0110,01,035,0,
+    /*  3510 */ 0261,01,022,01,0302,0120,01,036,0,
+    /*  3519 */ 0260,01,022,01,0302,0110,01,036,0,
+    /*  3528 */ 0261,01,022,01,0302,0120,01,037,0,
+    /*  3537 */ 0260,01,022,01,0302,0110,01,037,0,
+    /*  3546 */ 0261,03,021,01,0114,0120,0174,03,0,
+    /*  3555 */ 0260,03,021,01,0114,0110,0174,02,0,
+    /*  3564 */ 0261,03,01,01,0111,0120,0173,060,0,
+    /*  3573 */ 0261,03,011,01,0111,0130,0173,040,0,
+    /*  3582 */ 0261,03,05,01,0111,0120,0173,060,0,
+    /*  3591 */ 0261,03,015,01,0111,0130,0173,040,0,
+    /*  3600 */ 0261,03,01,01,0111,0120,0173,062,0,
+    /*  3609 */ 0261,03,011,01,0111,0130,0173,042,0,
+    /*  3618 */ 0261,03,05,01,0111,0120,0173,062,0,
+    /*  3627 */ 0261,03,015,01,0111,0130,0173,042,0,
+    /*  3636 */ 0261,03,01,01,0111,0120,0173,063,0,
+    /*  3645 */ 0261,03,011,01,0111,0130,0173,043,0,
+    /*  3654 */ 0261,03,05,01,0111,0120,0173,063,0,
+    /*  3663 */ 0261,03,015,01,0111,0130,0173,043,0,
+    /*  3672 */ 0261,03,01,01,0111,0120,0172,034,0,
+    /*  3681 */ 0261,03,011,01,0111,0130,0172,024,0,
+    /*  3690 */ 0261,03,05,01,0111,0120,0172,034,0,
+    /*  3699 */ 0261,03,015,01,0111,0130,0172,024,0,
+    /*  3708 */ 0261,03,01,01,0110,0120,0173,060,0,
+    /*  3717 */ 0261,03,011,01,0110,0130,0173,040,0,
+    /*  3726 */ 0261,03,05,01,0110,0120,0173,060,0,
+    /*  3735 */ 0261,03,015,01,0110,0130,0173,040,0,
+    /*  3744 */ 0261,03,01,01,0110,0120,0173,062,0,
+    /*  3753 */ 0261,03,011,01,0110,0130,0173,042,0,
+    /*  3762 */ 0261,03,05,01,0110,0120,0173,062,0,
+    /*  3771 */ 0261,03,015,01,0110,0130,0173,042,0,
+    /*  3780 */ 0261,03,01,01,0110,0120,0173,063,0,
+    /*  3789 */ 0261,03,011,01,0110,0130,0173,043,0,
+    /*  3798 */ 0261,03,05,01,0110,0120,0173,063,0,
+    /*  3807 */ 0261,03,015,01,0110,0130,0173,043,0,
+    /*  3816 */ 0261,03,01,01,0110,0120,0172,034,0,
+    /*  3825 */ 0261,03,011,01,0110,0130,0172,024,0,
+    /*  3834 */ 0261,03,05,01,0110,0120,0172,034,0,
+    /*  3843 */ 0261,03,015,01,0110,0130,0172,024,0,
+    /*  3852 */ 0361,03,017,072,0104,0110,01,0,0,
+    /*  3861 */ 0361,03,017,072,0104,0110,01,01,0,
+    /*  3870 */ 0361,03,017,072,0104,0110,01,020,0,
+    /*  3879 */ 0361,03,017,072,0104,0110,01,021,0,
+    /*  3888 */ 0261,03,021,01,0104,0120,01,0,0,
+    /*  3897 */ 0260,03,021,01,0104,0110,01,0,0,
+    /*  3906 */ 0261,03,021,01,0104,0120,01,01,0,
+    /*  3915 */ 0260,03,021,01,0104,0110,01,01,0,
+    /*  3924 */ 0261,03,021,01,0104,0120,01,020,0,
+    /*  3933 */ 0260,03,021,01,0104,0110,01,020,0,
+    /*  3942 */ 0261,03,021,01,0104,0120,01,021,0,
+    /*  3951 */ 0260,03,021,01,0104,0110,01,021,0,
+    /*  3960 */ 0261,03,01,01,0151,0120,0174,03,0,
+    /*  3969 */ 0260,03,01,01,0151,0110,0174,02,0,
+    /*  3978 */ 0261,03,05,01,0151,0120,0174,03,0,
+    /*  3987 */ 0260,03,05,01,0151,0110,0174,02,0,
+    /*  3996 */ 0261,03,011,01,0151,0130,0174,02,0,
+    /*  4005 */ 0260,03,011,01,0151,0120,0174,01,0,
+    /*  4014 */ 0261,03,015,01,0151,0130,0174,02,0,
+    /*  4023 */ 0260,03,015,01,0151,0120,0174,01,0,
+    /*  4032 */ 0261,03,01,01,0150,0120,0174,03,0,
+    /*  4041 */ 0260,03,01,01,0150,0110,0174,02,0,
+    /*  4050 */ 0261,03,05,01,0150,0120,0174,03,0,
+    /*  4059 */ 0260,03,05,01,0150,0110,0174,02,0,
+    /*  4068 */ 0261,03,011,01,0150,0130,0174,02,0,
+    /*  4077 */ 0260,03,011,01,0150,0120,0174,01,0,
+    /*  4086 */ 0261,03,015,01,0150,0130,0174,02,0,
+    /*  4095 */ 0260,03,015,01,0150,0120,0174,01,0,
+    /*  4104 */ 0261,03,01,01,0153,0120,0174,03,0,
+    /*  4113 */ 0260,03,01,01,0153,0110,0174,02,0,
+    /*  4122 */ 0261,03,011,01,0153,0130,0174,02,0,
+    /*  4131 */ 0260,03,011,01,0153,0120,0174,01,0,
+    /*  4140 */ 0261,03,01,01,0152,0120,0174,03,0,
+    /*  4149 */ 0260,03,01,01,0152,0110,0174,02,0,
+    /*  4158 */ 0261,03,011,01,0152,0130,0174,02,0,
+    /*  4167 */ 0260,03,011,01,0152,0120,0174,01,0,
+    /*  4176 */ 0261,03,01,01,0135,0120,0174,03,0,
+    /*  4185 */ 0260,03,01,01,0135,0110,0174,02,0,
+    /*  4194 */ 0261,03,05,01,0135,0120,0174,03,0,
+    /*  4203 */ 0260,03,05,01,0135,0110,0174,02,0,
+    /*  4212 */ 0261,03,011,01,0135,0130,0174,02,0,
+    /*  4221 */ 0260,03,011,01,0135,0120,0174,01,0,
+    /*  4230 */ 0261,03,015,01,0135,0130,0174,02,0,
+    /*  4239 */ 0260,03,015,01,0135,0120,0174,01,0,
+    /*  4248 */ 0261,03,01,01,0134,0120,0174,03,0,
+    /*  4257 */ 0260,03,01,01,0134,0110,0174,02,0,
+    /*  4266 */ 0261,03,05,01,0134,0120,0174,03,0,
+    /*  4275 */ 0260,03,05,01,0134,0110,0174,02,0,
+    /*  4284 */ 0261,03,011,01,0134,0130,0174,02,0,
+    /*  4293 */ 0260,03,011,01,0134,0120,0174,01,0,
+    /*  4302 */ 0261,03,015,01,0134,0130,0174,02,0,
+    /*  4311 */ 0260,03,015,01,0134,0120,0174,01,0,
+    /*  4320 */ 0261,03,01,01,0137,0120,0174,03,0,
+    /*  4329 */ 0260,03,01,01,0137,0110,0174,02,0,
+    /*  4338 */ 0261,03,05,01,0137,0120,0174,03,0,
+    /*  4347 */ 0260,03,05,01,0137,0110,0174,02,0,
+    /*  4356 */ 0261,03,011,01,0137,0130,0174,02,0,
+    /*  4365 */ 0260,03,011,01,0137,0120,0174,01,0,
+    /*  4374 */ 0261,03,015,01,0137,0130,0174,02,0,
+    /*  4383 */ 0260,03,015,01,0137,0120,0174,01,0,
+    /*  4392 */ 0261,03,01,01,0136,0120,0174,03,0,
+    /*  4401 */ 0260,03,01,01,0136,0110,0174,02,0,
+    /*  4410 */ 0261,03,05,01,0136,0120,0174,03,0,
+    /*  4419 */ 0260,03,05,01,0136,0110,0174,02,0,
+    /*  4428 */ 0261,03,011,01,0136,0130,0174,02,0,
+    /*  4437 */ 0260,03,011,01,0136,0120,0174,01,0,
+    /*  4446 */ 0261,03,015,01,0136,0130,0174,02,0,
+    /*  4455 */ 0260,03,015,01,0136,0120,0174,01,0,
+    /*  4464 */ 0261,03,01,01,0155,0120,0174,03,0,
+    /*  4473 */ 0260,03,01,01,0155,0110,0174,02,0,
+    /*  4482 */ 0261,03,05,01,0155,0120,0174,03,0,
+    /*  4491 */ 0260,03,05,01,0155,0110,0174,02,0,
+    /*  4500 */ 0261,03,011,01,0155,0130,0174,02,0,
+    /*  4509 */ 0260,03,011,01,0155,0120,0174,01,0,
+    /*  4518 */ 0261,03,015,01,0155,0130,0174,02,0,
+    /*  4527 */ 0260,03,015,01,0155,0120,0174,01,0,
+    /*  4536 */ 0261,03,01,01,0154,0120,0174,03,0,
+    /*  4545 */ 0260,03,01,01,0154,0110,0174,02,0,
+    /*  4554 */ 0261,03,05,01,0154,0120,0174,03,0,
+    /*  4563 */ 0260,03,05,01,0154,0110,0174,02,0,
+    /*  4572 */ 0261,03,011,01,0154,0130,0174,02,0,
+    /*  4581 */ 0260,03,011,01,0154,0120,0174,01,0,
+    /*  4590 */ 0261,03,015,01,0154,0130,0174,02,0,
+    /*  4599 */ 0260,03,015,01,0154,0120,0174,01,0,
+    /*  4608 */ 0261,03,01,01,0157,0120,0174,03,0,
+    /*  4617 */ 0260,03,01,01,0157,0110,0174,02,0,
+    /*  4626 */ 0261,03,011,01,0157,0130,0174,02,0,
+    /*  4635 */ 0260,03,011,01,0157,0120,0174,01,0,
+    /*  4644 */ 0261,03,01,01,0156,0120,0174,03,0,
+    /*  4653 */ 0260,03,01,01,0156,0110,0174,02,0,
+    /*  4662 */ 0261,03,011,01,0156,0130,0174,02,0,
+    /*  4671 */ 0260,03,011,01,0156,0120,0174,01,0,
+    /*  4680 */ 0261,03,01,01,0171,0120,0174,03,0,
+    /*  4689 */ 0260,03,01,01,0171,0110,0174,02,0,
+    /*  4698 */ 0261,03,05,01,0171,0120,0174,03,0,
+    /*  4707 */ 0260,03,05,01,0171,0110,0174,02,0,
+    /*  4716 */ 0261,03,011,01,0171,0130,0174,02,0,
+    /*  4725 */ 0260,03,011,01,0171,0120,0174,01,0,
+    /*  4734 */ 0261,03,015,01,0171,0130,0174,02,0,
+    /*  4743 */ 0260,03,015,01,0171,0120,0174,01,0,
+    /*  4752 */ 0261,03,01,01,0170,0120,0174,03,0,
+    /*  4761 */ 0260,03,01,01,0170,0110,0174,02,0,
+    /*  4770 */ 0261,03,05,01,0170,0120,0174,03,0,
+    /*  4779 */ 0260,03,05,01,0170,0110,0174,02,0,
+    /*  4788 */ 0261,03,011,01,0170,0130,0174,02,0,
+    /*  4797 */ 0260,03,011,01,0170,0120,0174,01,0,
+    /*  4806 */ 0261,03,015,01,0170,0130,0174,02,0,
+    /*  4815 */ 0260,03,015,01,0170,0120,0174,01,0,
+    /*  4824 */ 0261,03,01,01,0173,0120,0174,03,0,
+    /*  4833 */ 0260,03,01,01,0173,0110,0174,02,0,
+    /*  4842 */ 0261,03,011,01,0173,0130,0174,02,0,
+    /*  4851 */ 0260,03,011,01,0173,0120,0174,01,0,
+    /*  4860 */ 0261,03,01,01,0172,0120,0174,03,0,
+    /*  4869 */ 0260,03,01,01,0172,0110,0174,02,0,
+    /*  4878 */ 0261,03,011,01,0172,0130,0174,02,0,
+    /*  4887 */ 0260,03,011,01,0172,0120,0174,01,0,
+    /*  4896 */ 0261,03,01,01,0175,0120,0174,03,0,
+    /*  4905 */ 0260,03,01,01,0175,0110,0174,02,0,
+    /*  4914 */ 0261,03,05,01,0175,0120,0174,03,0,
+    /*  4923 */ 0260,03,05,01,0175,0110,0174,02,0,
+    /*  4932 */ 0261,03,011,01,0175,0130,0174,02,0,
+    /*  4941 */ 0260,03,011,01,0175,0120,0174,01,0,
+    /*  4950 */ 0261,03,015,01,0175,0130,0174,02,0,
+    /*  4959 */ 0260,03,015,01,0175,0120,0174,01,0,
+    /*  4968 */ 0261,03,01,01,0174,0120,0174,03,0,
+    /*  4977 */ 0260,03,01,01,0174,0110,0174,02,0,
+    /*  4986 */ 0261,03,05,01,0174,0120,0174,03,0,
+    /*  4995 */ 0260,03,05,01,0174,0110,0174,02,0,
+    /*  5004 */ 0261,03,011,01,0174,0130,0174,02,0,
+    /*  5013 */ 0260,03,011,01,0174,0120,0174,01,0,
+    /*  5022 */ 0261,03,015,01,0174,0130,0174,02,0,
+    /*  5031 */ 0260,03,015,01,0174,0120,0174,01,0,
+    /*  5040 */ 0261,03,01,01,0177,0120,0174,03,0,
+    /*  5049 */ 0260,03,01,01,0177,0110,0174,02,0,
+    /*  5058 */ 0261,03,011,01,0177,0130,0174,02,0,
+    /*  5067 */ 0260,03,011,01,0177,0120,0174,01,0,
+    /*  5076 */ 0261,03,01,01,0176,0120,0174,03,0,
+    /*  5085 */ 0260,03,01,01,0176,0110,0174,02,0,
+    /*  5094 */ 0261,03,011,01,0176,0130,0174,02,0,
+    /*  5103 */ 0260,03,011,01,0176,0120,0174,01,0,
+    /*  5112 */ 0261,0110,0,01,0242,0120,0174,03,0,
+    /*  5121 */ 0260,0110,0,01,0242,0110,0174,02,0,
+    /*  5130 */ 0261,0110,04,01,0242,0120,0174,03,0,
+    /*  5139 */ 0260,0110,04,01,0242,0110,0174,02,0,
+    /*  5148 */ 0261,0110,010,01,0242,0130,0174,02,0,
+    /*  5157 */ 0260,0110,010,01,0242,0120,0174,01,0,
+    /*  5166 */ 0261,0110,014,01,0242,0130,0174,02,0,
+    /*  5175 */ 0260,0110,014,01,0242,0120,0174,01,0,
+    /*  5184 */ 0261,0110,0,01,0236,0120,0174,03,0,
+    /*  5193 */ 0260,0110,0,01,0236,0110,0174,02,0,
+    /*  5202 */ 0261,0110,0,01,0237,0120,0174,03,0,
+    /*  5211 */ 0260,0110,0,01,0237,0110,0174,02,0,
+    /*  5220 */ 0261,0110,0,01,0227,0120,0174,03,0,
+    /*  5229 */ 0260,0110,0,01,0227,0110,0174,02,0,
+    /*  5238 */ 0261,0110,0,01,0216,0120,0174,03,0,
+    /*  5247 */ 0260,0110,0,01,0216,0110,0174,02,0,
+    /*  5256 */ 0261,0110,0,01,0217,0120,0174,03,0,
+    /*  5265 */ 0260,0110,0,01,0217,0110,0174,02,0,
+    /*  5274 */ 0261,0110,0,01,0207,0120,0174,03,0,
+    /*  5283 */ 0260,0110,0,01,0207,0110,0174,02,0,
+    /*  5292 */ 0261,0110,0,01,0206,0120,0174,03,0,
+    /*  5301 */ 0260,0110,0,01,0206,0110,0174,02,0,
+    /*  5310 */ 0261,0110,0,01,0205,0120,0174,03,0,
+    /*  5319 */ 0260,0110,0,01,0205,0110,0174,02,0,
+    /*  5328 */ 0261,0110,0,01,0226,0120,0174,03,0,
+    /*  5337 */ 0260,0110,0,01,0226,0110,0174,02,0,
+    /*  5346 */ 0261,0110,0,01,0225,0120,0174,03,0,
+    /*  5355 */ 0260,0110,0,01,0225,0110,0174,02,0,
+    /*  5364 */ 0261,0110,0,01,0246,0120,0174,03,0,
+    /*  5373 */ 0260,0110,0,01,0246,0110,0174,02,0,
+    /*  5382 */ 0261,0110,0,01,0266,0120,0174,03,0,
+    /*  5391 */ 0260,0110,0,01,0266,0110,0174,02,0,
+    /*  5400 */ 0261,0110,010,01,0243,0130,0174,02,0,
+    /*  5409 */ 0260,0110,010,01,0243,0120,0174,01,0,
+    /*  5418 */ 0261,0110,0,01,0243,0120,0174,03,0,
+    /*  5427 */ 0260,0110,0,01,0243,0110,0174,02,0,
+    /*  5436 */ 0323,02,017,017,0110,01,0277,0,
+    /*  5444 */ 0323,02,017,017,0110,01,035,0,
+    /*  5452 */ 0323,02,017,017,0110,01,0256,0,
+    /*  5460 */ 0323,02,017,017,0110,01,0236,0,
+    /*  5468 */ 0323,02,017,017,0110,01,0260,0,
+    /*  5476 */ 0323,02,017,017,0110,01,0220,0,
+    /*  5484 */ 0323,02,017,017,0110,01,0240,0,
+    /*  5492 */ 0323,02,017,017,0110,01,0244,0,
+    /*  5500 */ 0323,02,017,017,0110,01,0224,0,
+    /*  5508 */ 0323,02,017,017,0110,01,0264,0,
+    /*  5516 */ 0323,02,017,017,0110,01,0226,0,
+    /*  5524 */ 0323,02,017,017,0110,01,0246,0,
+    /*  5532 */ 0323,02,017,017,0110,01,0266,0,
+    /*  5540 */ 0323,02,017,017,0110,01,0247,0,
+    /*  5548 */ 0323,02,017,017,0110,01,0227,0,
+    /*  5556 */ 0323,02,017,017,0110,01,0232,0,
+    /*  5564 */ 0323,02,017,017,0110,01,0252,0,
+    /*  5572 */ 0323,02,017,017,0110,01,015,0,
+    /*  5580 */ 0323,02,017,017,0110,01,0267,0,
+    /*  5588 */ 0360,02,017,0302,0110,01,0,0,
+    /*  5596 */ 0363,02,017,0302,0110,01,0,0,
+    /*  5604 */ 0360,02,017,0302,0110,01,02,0,
+    /*  5612 */ 0363,02,017,0302,0110,01,02,0,
+    /*  5620 */ 0360,02,017,0302,0110,01,01,0,
+    /*  5628 */ 0363,02,017,0302,0110,01,01,0,
+    /*  5636 */ 0360,02,017,0302,0110,01,04,0,
+    /*  5644 */ 0363,02,017,0302,0110,01,04,0,
+    /*  5652 */ 0360,02,017,0302,0110,01,06,0,
+    /*  5660 */ 0363,02,017,0302,0110,01,06,0,
+    /*  5668 */ 0360,02,017,0302,0110,01,05,0,
+    /*  5676 */ 0363,02,017,0302,0110,01,05,0,
+    /*  5684 */ 0360,02,017,0302,0110,01,07,0,
+    /*  5692 */ 0363,02,017,0302,0110,01,07,0,
+    /*  5700 */ 0360,02,017,0302,0110,01,03,0,
+    /*  5708 */ 0363,02,017,0302,0110,01,03,0,
+    /*  5716 */ 0360,0323,02,017,0160,0110,022,0,
+    /*  5724 */ 0323,02,017,017,0110,01,034,0,
+    /*  5732 */ 0323,02,017,017,0110,01,0212,0,
+    /*  5740 */ 0323,02,017,017,0110,01,0216,0,
+    /*  5748 */ 0323,02,017,017,0110,01,014,0,
+    /*  5756 */ 0323,02,017,017,0110,01,0273,0,
+    /*  5764 */ 0361,02,017,0302,0110,01,0,0,
+    /*  5772 */ 0362,02,017,0302,0110,01,0,0,
+    /*  5780 */ 0361,02,017,0302,0110,01,02,0,
+    /*  5788 */ 0362,02,017,0302,0110,01,02,0,
+    /*  5796 */ 0361,02,017,0302,0110,01,01,0,
+    /*  5804 */ 0362,02,017,0302,0110,01,01,0,
+    /*  5812 */ 0361,02,017,0302,0110,01,04,0,
+    /*  5820 */ 0362,02,017,0302,0110,01,04,0,
+    /*  5828 */ 0361,02,017,0302,0110,01,06,0,
+    /*  5836 */ 0362,02,017,0302,0110,01,06,0,
+    /*  5844 */ 0361,02,017,0302,0110,01,05,0,
+    /*  5852 */ 0362,02,017,0302,0110,01,05,0,
+    /*  5860 */ 0361,02,017,0302,0110,01,07,0,
+    /*  5868 */ 0362,02,017,0302,0110,01,07,0,
+    /*  5876 */ 0361,02,017,0302,0110,01,03,0,
+    /*  5884 */ 0362,02,017,0302,0110,01,03,0,
+    /*  5892 */ 0323,0361,03,017,070,0200,0110,0,
+    /*  5900 */ 0323,0361,03,017,070,0201,0110,0,
+    /*  5908 */ 0360,03,017,072,017,0110,026,0,
+    /*  5916 */ 0361,03,017,072,017,0110,026,0,
+    /*  5924 */ 0361,02,017,0170,0200,025,026,0,
+    /*  5932 */ 0362,02,017,0170,0110,026,027,0,
+    /*  5940 */ 0361,03,017,072,015,0110,026,0,
+    /*  5948 */ 0361,03,017,072,014,0110,026,0,
+    /*  5956 */ 0361,03,017,072,0101,0110,026,0,
+    /*  5964 */ 0361,03,017,072,0100,0110,026,0,
+    /*  5972 */ 0361,03,017,072,041,0110,026,0,
+    /*  5980 */ 0361,03,017,072,0102,0110,026,0,
+    /*  5988 */ 0361,03,017,072,016,0110,026,0,
+    /*  5996 */ 0361,03,017,072,011,0110,026,0,
+    /*  6004 */ 0361,03,017,072,010,0110,026,0,
+    /*  6012 */ 0361,03,017,072,013,0110,026,0,
+    /*  6020 */ 0361,03,017,072,012,0110,026,0,
+    /*  6028 */ 0320,0332,03,017,070,0361,0110,0,
+    /*  6036 */ 0321,0332,03,017,070,0361,0110,0,
+    /*  6044 */ 0324,0332,03,017,070,0360,0110,0,
+    /*  6052 */ 0324,0332,03,017,070,0361,0110,0,
+    /*  6060 */ 0361,03,017,072,0141,0110,026,0,
+    /*  6068 */ 0361,03,017,072,0140,0110,026,0,
+    /*  6076 */ 0361,03,017,072,0143,0110,026,0,
+    /*  6084 */ 0361,03,017,072,0142,0110,026,0,
+    /*  6092 */ 0323,02,017,017,0110,01,0206,0,
+    /*  6100 */ 0323,02,017,017,0110,01,0207,0,
+    /*  6108 */ 0361,03,017,072,0337,0110,022,0,
+    /*  6116 */ 0270,03,021,01,0337,0110,022,0,
+    /*  6124 */ 0261,03,021,01,015,0120,023,0,
+    /*  6132 */ 0260,03,021,01,015,0110,022,0,
+    /*  6140 */ 0261,03,025,01,015,0120,023,0,
+    /*  6148 */ 0260,03,025,01,015,0110,022,0,
+    /*  6156 */ 0261,03,021,01,014,0120,023,0,
+    /*  6164 */ 0260,03,021,01,014,0110,022,0,
+    /*  6172 */ 0261,03,025,01,014,0120,023,0,
+    /*  6180 */ 0260,03,025,01,014,0110,022,0,
+    /*  6188 */ 0261,01,021,01,0302,0120,023,0,
+    /*  6196 */ 0260,01,021,01,0302,0110,022,0,
+    /*  6204 */ 0261,01,025,01,0302,0120,023,0,
+    /*  6212 */ 0260,01,025,01,0302,0110,022,0,
+    /*  6220 */ 0261,01,020,01,0302,0120,023,0,
+    /*  6228 */ 0260,01,020,01,0302,0110,022,0,
+    /*  6236 */ 0261,01,024,01,0302,0120,023,0,
+    /*  6244 */ 0260,01,024,01,0302,0110,022,0,
+    /*  6252 */ 0261,01,023,01,0302,0120,023,0,
+    /*  6260 */ 0260,01,023,01,0302,0110,022,0,
+    /*  6268 */ 0261,01,022,01,0302,0120,023,0,
+    /*  6276 */ 0260,01,022,01,0302,0110,022,0,
+    /*  6284 */ 0261,03,021,01,0101,0120,023,0,
+    /*  6292 */ 0260,03,021,01,0101,0110,022,0,
+    /*  6300 */ 0261,03,021,01,0100,0120,023,0,
+    /*  6308 */ 0260,03,021,01,0100,0110,022,0,
+    /*  6316 */ 0261,03,025,01,0100,0120,023,0,
+    /*  6324 */ 0260,03,025,01,0100,0110,022,0,
+    /*  6332 */ 0270,03,025,01,031,0101,022,0,
+    /*  6340 */ 0270,03,021,01,027,0101,022,0,
+    /*  6348 */ 0261,03,025,01,030,0120,023,0,
+    /*  6356 */ 0261,03,021,01,041,0120,023,0,
+    /*  6364 */ 0260,03,021,01,041,0110,022,0,
+    /*  6372 */ 0261,03,021,01,0102,0120,023,0,
+    /*  6380 */ 0260,03,021,01,0102,0110,022,0,
+    /*  6388 */ 0261,03,021,01,017,0120,023,0,
+    /*  6396 */ 0260,03,021,01,017,0110,022,0,
+    /*  6404 */ 0261,03,021,01,016,0120,023,0,
+    /*  6412 */ 0260,03,021,01,016,0110,022,0,
+    /*  6420 */ 0270,03,021,01,0141,0110,022,0,
+    /*  6428 */ 0270,03,021,01,0140,0110,022,0,
+    /*  6436 */ 0270,03,021,01,0143,0110,022,0,
+    /*  6444 */ 0270,03,021,01,0142,0110,022,0,
+    /*  6452 */ 0270,03,021,01,05,0110,022,0,
+    /*  6460 */ 0270,03,025,01,05,0110,022,0,
+    /*  6468 */ 0270,03,021,01,04,0110,022,0,
+    /*  6476 */ 0270,03,025,01,04,0110,022,0,
+    /*  6484 */ 0261,03,025,01,06,0120,023,0,
+    /*  6492 */ 0270,03,01,01,024,0101,022,0,
+    /*  6500 */ 0270,01,01,01,0305,0101,022,0,
+    /*  6508 */ 0270,03,01,01,025,0101,022,0,
+    /*  6516 */ 0270,03,01,01,026,0101,022,0,
+    /*  6524 */ 0270,03,011,01,026,0101,022,0,
+    /*  6532 */ 0261,03,021,01,040,0120,023,0,
+    /*  6540 */ 0260,03,021,01,040,0110,022,0,
+    /*  6548 */ 0261,01,021,01,0304,0120,023,0,
+    /*  6556 */ 0260,01,021,01,0304,0110,022,0,
+    /*  6564 */ 0261,03,01,01,042,0120,023,0,
+    /*  6572 */ 0260,03,01,01,042,0110,022,0,
+    /*  6580 */ 0261,03,011,01,042,0120,023,0,
+    /*  6588 */ 0260,03,011,01,042,0110,022,0,
+    /*  6596 */ 0270,01,021,01,0160,0110,022,0,
+    /*  6604 */ 0270,01,022,01,0160,0110,022,0,
+    /*  6612 */ 0270,01,023,01,0160,0110,022,0,
+    /*  6620 */ 0260,01,021,01,0163,0217,022,0,
+    /*  6628 */ 0260,01,021,01,0163,0207,021,0,
+    /*  6636 */ 0260,01,021,01,0163,0213,022,0,
+    /*  6644 */ 0260,01,021,01,0163,0203,021,0,
+    /*  6652 */ 0260,01,021,01,0161,0216,022,0,
+    /*  6660 */ 0260,01,021,01,0161,0206,021,0,
+    /*  6668 */ 0260,01,021,01,0162,0216,022,0,
+    /*  6676 */ 0260,01,021,01,0162,0206,021,0,
+    /*  6684 */ 0260,01,021,01,0163,0216,022,0,
+    /*  6692 */ 0260,01,021,01,0163,0206,021,0,
+    /*  6700 */ 0260,01,021,01,0161,0214,022,0,
+    /*  6708 */ 0260,01,021,01,0161,0204,021,0,
+    /*  6716 */ 0260,01,021,01,0162,0214,022,0,
+    /*  6724 */ 0260,01,021,01,0162,0204,021,0,
+    /*  6732 */ 0260,01,021,01,0161,0212,022,0,
+    /*  6740 */ 0260,01,021,01,0161,0202,021,0,
+    /*  6748 */ 0260,01,021,01,0162,0212,022,0,
+    /*  6756 */ 0260,01,021,01,0162,0202,021,0,
+    /*  6764 */ 0260,01,021,01,0163,0212,022,0,
+    /*  6772 */ 0260,01,021,01,0163,0202,021,0,
+    /*  6780 */ 0270,03,021,01,011,0110,022,0,
+    /*  6788 */ 0270,03,025,01,011,0110,022,0,
+    /*  6796 */ 0270,03,021,01,010,0110,022,0,
+    /*  6804 */ 0270,03,025,01,010,0110,022,0,
+    /*  6812 */ 0261,03,021,01,013,0120,023,0,
+    /*  6820 */ 0260,03,021,01,013,0110,022,0,
+    /*  6828 */ 0261,03,021,01,012,0120,023,0,
+    /*  6836 */ 0260,03,021,01,012,0110,022,0,
+    /*  6844 */ 0261,01,021,01,0306,0120,023,0,
+    /*  6852 */ 0260,01,021,01,0306,0110,022,0,
+    /*  6860 */ 0261,01,025,01,0306,0120,023,0,
+    /*  6868 */ 0260,01,025,01,0306,0110,022,0,
+    /*  6876 */ 0261,01,020,01,0306,0120,023,0,
+    /*  6884 */ 0260,01,020,01,0306,0110,022,0,
+    /*  6892 */ 0261,01,024,01,0306,0120,023,0,
+    /*  6900 */ 0260,01,024,01,0306,0110,022,0,
+    /*  6908 */ 0361,03,017,072,0104,0110,022,0,
+    /*  6916 */ 0261,03,021,01,0104,0120,023,0,
+    /*  6924 */ 0260,03,021,01,0104,0110,022,0,
+    /*  6932 */ 0260,0112,0,01,022,0211,032,0,
+    /*  6940 */ 0260,0112,04,01,022,0211,042,0,
+    /*  6948 */ 0260,0112,010,01,022,0211,042,0,
+    /*  6956 */ 0260,0112,0,01,022,0210,032,0,
+    /*  6964 */ 0260,0112,04,01,022,0210,042,0,
+    /*  6972 */ 0260,0112,010,01,022,0210,042,0,
+    /*  6980 */ 0270,0110,0,01,0240,0110,022,0,
+    /*  6988 */ 0270,0110,0,01,0240,0100,021,0,
+    /*  6996 */ 0270,0110,04,01,0240,0110,022,0,
+    /*  7004 */ 0270,0110,04,01,0240,0100,021,0,
+    /*  7012 */ 0270,0110,0,01,0241,0101,022,0,
+    /*  7020 */ 0270,0110,0,01,0241,0100,021,0,
+    /*  7028 */ 0270,0110,04,01,0241,0101,022,0,
+    /*  7036 */ 0270,0110,04,01,0241,0100,021,0,
+    /*  7044 */ 0261,0110,0,01,0314,0120,023,0,
+    /*  7052 */ 0260,0110,0,01,0314,0110,022,0,
+    /*  7060 */ 0261,0110,0,01,0316,0120,023,0,
+    /*  7068 */ 0260,0110,0,01,0316,0110,022,0,
+    /*  7076 */ 0261,0110,0,01,0317,0120,023,0,
+    /*  7084 */ 0260,0110,0,01,0317,0110,022,0,
+    /*  7092 */ 0261,0110,0,01,0354,0120,023,0,
+    /*  7100 */ 0260,0110,0,01,0354,0110,022,0,
+    /*  7108 */ 0261,0110,0,01,0356,0120,023,0,
+    /*  7116 */ 0260,0110,0,01,0356,0110,022,0,
+    /*  7124 */ 0261,0110,0,01,0357,0120,023,0,
+    /*  7132 */ 0260,0110,0,01,0357,0110,022,0,
+    /*  7140 */ 0261,0110,0,01,0355,0120,023,0,
+    /*  7148 */ 0260,0110,0,01,0355,0110,022,0,
+    /*  7156 */ 0261,0110,0,01,0315,0120,023,0,
+    /*  7164 */ 0260,0110,0,01,0315,0110,022,0,
+    /*  7172 */ 0270,0110,0,01,0300,0110,022,0,
+    /*  7180 */ 0270,0110,0,01,0300,0100,021,0,
+    /*  7188 */ 0270,0110,0,01,0302,0110,022,0,
+    /*  7196 */ 0270,0110,0,01,0302,0100,021,0,
+    /*  7204 */ 0270,0110,0,01,0303,0110,022,0,
+    /*  7212 */ 0270,0110,0,01,0303,0100,021,0,
+    /*  7220 */ 0270,0110,0,01,0301,0110,022,0,
+    /*  7228 */ 0270,0110,0,01,0301,0100,021,0,
+    /*  7236 */ 0320,02,017,0272,0204,025,0,
+    /*  7243 */ 0321,02,017,0272,0204,025,0,
+    /*  7250 */ 0324,02,017,0272,0204,025,0,
+    /*  7257 */ 0320,02,017,0272,0207,025,0,
+    /*  7264 */ 0321,02,017,0272,0207,025,0,
+    /*  7271 */ 0324,02,017,0272,0207,025,0,
+    /*  7278 */ 0320,02,017,0272,0206,025,0,
+    /*  7285 */ 0321,02,017,0272,0206,025,0,
+    /*  7292 */ 0324,02,017,0272,0206,025,0,
+    /*  7299 */ 0320,02,017,0272,0205,025,0,
+    /*  7306 */ 0321,02,017,0272,0205,025,0,
+    /*  7313 */ 0324,02,017,0272,0205,025,0,
+    /*  7320 */ 0323,0313,03,017,01,0337,0,
+    /*  7327 */ 0320,0323,02,017,02,0110,0,
+    /*  7334 */ 0321,0323,02,017,02,0110,0,
+    /*  7341 */ 0320,0323,02,017,03,0110,0,
+    /*  7348 */ 0321,0323,02,017,03,0110,0,
+    /*  7355 */ 0360,0320,02,017,0156,0110,0,
+    /*  7362 */ 0360,0320,02,017,0176,0101,0,
+    /*  7369 */ 0360,0323,02,017,0157,0110,0,
+    /*  7376 */ 0360,0323,02,017,0177,0101,0,
+    /*  7383 */ 0360,0323,02,017,0153,0110,0,
+    /*  7390 */ 0360,0323,02,017,0143,0110,0,
+    /*  7397 */ 0360,0323,02,017,0147,0110,0,
+    /*  7404 */ 0360,0323,02,017,0374,0110,0,
+    /*  7411 */ 0360,0323,02,017,0376,0110,0,
+    /*  7418 */ 0360,0323,02,017,0354,0110,0,
+    /*  7425 */ 0360,0323,02,017,0355,0110,0,
+    /*  7432 */ 0360,0323,02,017,0334,0110,0,
+    /*  7439 */ 0360,0323,02,017,0335,0110,0,
+    /*  7446 */ 0360,0323,02,017,0375,0110,0,
+    /*  7453 */ 0360,0323,02,017,0333,0110,0,
+    /*  7460 */ 0360,0323,02,017,0337,0110,0,
+    /*  7467 */ 0360,0323,02,017,0164,0110,0,
+    /*  7474 */ 0360,0323,02,017,0166,0110,0,
+    /*  7481 */ 0360,0323,02,017,0165,0110,0,
+    /*  7488 */ 0360,0323,02,017,0144,0110,0,
+    /*  7495 */ 0360,0323,02,017,0146,0110,0,
+    /*  7502 */ 0360,0323,02,017,0145,0110,0,
+    /*  7509 */ 0360,0323,02,017,0365,0110,0,
+    /*  7516 */ 0360,0323,02,017,0345,0110,0,
+    /*  7523 */ 0360,0323,02,017,0325,0110,0,
+    /*  7530 */ 0360,0323,02,017,0353,0110,0,
+    /*  7537 */ 0360,0323,02,017,0362,0110,0,
+    /*  7544 */ 0360,02,017,0162,0206,025,0,
+    /*  7551 */ 0360,0323,02,017,0363,0110,0,
+    /*  7558 */ 0360,02,017,0163,0206,025,0,
+    /*  7565 */ 0360,0323,02,017,0361,0110,0,
+    /*  7572 */ 0360,02,017,0161,0206,025,0,
+    /*  7579 */ 0360,0323,02,017,0342,0110,0,
+    /*  7586 */ 0360,02,017,0162,0204,025,0,
+    /*  7593 */ 0360,0323,02,017,0341,0110,0,
+    /*  7600 */ 0360,02,017,0161,0204,025,0,
+    /*  7607 */ 0360,0323,02,017,0322,0110,0,
+    /*  7614 */ 0360,02,017,0162,0202,025,0,
+    /*  7621 */ 0360,0323,02,017,0323,0110,0,
+    /*  7628 */ 0360,02,017,0163,0202,025,0,
+    /*  7635 */ 0360,0323,02,017,0321,0110,0,
+    /*  7642 */ 0360,02,017,0161,0202,025,0,
+    /*  7649 */ 0360,0323,02,017,0370,0110,0,
+    /*  7656 */ 0360,0323,02,017,0372,0110,0,
+    /*  7663 */ 0360,0323,02,017,0350,0110,0,
+    /*  7670 */ 0360,0323,02,017,0351,0110,0,
+    /*  7677 */ 0360,0323,02,017,0330,0110,0,
+    /*  7684 */ 0360,0323,02,017,0331,0110,0,
+    /*  7691 */ 0360,0323,02,017,0371,0110,0,
+    /*  7698 */ 0360,0323,02,017,0150,0110,0,
+    /*  7705 */ 0360,0323,02,017,0152,0110,0,
+    /*  7712 */ 0360,0323,02,017,0151,0110,0,
+    /*  7719 */ 0360,0323,02,017,0140,0110,0,
+    /*  7726 */ 0360,0323,02,017,0142,0110,0,
+    /*  7733 */ 0360,0323,02,017,0141,0110,0,
+    /*  7740 */ 0360,0323,02,017,0357,0110,0,
+    /*  7747 */ 0320,02,017,0244,0101,026,0,
+    /*  7754 */ 0321,02,017,0244,0101,026,0,
+    /*  7761 */ 0324,02,017,0244,0101,026,0,
+    /*  7768 */ 0320,02,017,0254,0101,026,0,
+    /*  7775 */ 0321,02,017,0254,0101,026,0,
+    /*  7782 */ 0324,02,017,0254,0101,026,0,
+    /*  7789 */ 0360,0320,02,017,021,0101,0,
+    /*  7796 */ 0360,0321,02,017,021,0101,0,
+    /*  7803 */ 0360,0320,02,017,023,0110,0,
+    /*  7810 */ 0360,0321,02,017,023,0110,0,
+    /*  7817 */ 0320,01,017,0330,0100,0110,0,
+    /*  7824 */ 0321,01,017,0330,0100,0110,0,
+    /*  7831 */ 0324,01,017,0330,0100,0110,0,
+    /*  7838 */ 0322,01,017,0330,0200,064,0,
+    /*  7845 */ 0320,01,017,0330,0200,064,0,
+    /*  7852 */ 0321,01,017,0330,0200,064,0,
+    /*  7859 */ 0330,0161,0373,01,0351,064,0,
+    /*  7866 */ 0360,02,017,0302,0110,026,0,
+    /*  7873 */ 0363,02,017,0302,0110,026,0,
+    /*  7880 */ 0324,0363,02,017,052,0110,0,
+    /*  7887 */ 0324,0363,02,017,055,0110,0,
+    /*  7894 */ 0324,0363,02,017,054,0110,0,
+    /*  7901 */ 0360,0324,02,017,0120,0110,0,
+    /*  7908 */ 0360,02,017,0306,0110,026,0,
+    /*  7915 */ 0360,0323,02,017,0340,0110,0,
+    /*  7922 */ 0360,0323,02,017,0343,0110,0,
+    /*  7929 */ 0360,02,017,0305,0110,026,0,
+    /*  7936 */ 0360,02,017,0304,0110,026,0,
+    /*  7943 */ 0360,0323,02,017,0356,0110,0,
+    /*  7950 */ 0360,0323,02,017,0336,0110,0,
+    /*  7957 */ 0360,0323,02,017,0352,0110,0,
+    /*  7964 */ 0360,0323,02,017,0332,0110,0,
+    /*  7971 */ 0360,0323,02,017,0344,0110,0,
+    /*  7978 */ 0360,0323,02,017,0366,0110,0,
+    /*  7985 */ 0324,0360,02,017,0303,0101,0,
+    /*  7992 */ 0361,0317,02,017,0176,0101,0,
+    /*  7999 */ 0361,0317,02,017,0156,0110,0,
+    /*  8006 */ 0361,0324,02,017,0156,0110,0,
+    /*  8013 */ 0361,0324,02,017,0176,0101,0,
+    /*  8020 */ 0361,02,017,0305,0110,026,0,
+    /*  8027 */ 0361,02,017,0304,0110,026,0,
+    /*  8034 */ 0360,0323,02,017,0364,0110,0,
+    /*  8041 */ 0361,02,017,0160,0110,022,0,
+    /*  8048 */ 0363,02,017,0160,0110,022,0,
+    /*  8055 */ 0362,02,017,0160,0110,022,0,
+    /*  8062 */ 0361,02,017,0163,0207,025,0,
+    /*  8069 */ 0361,02,017,0161,0206,025,0,
+    /*  8076 */ 0361,02,017,0162,0206,025,0,
+    /*  8083 */ 0361,02,017,0163,0206,025,0,
+    /*  8090 */ 0361,02,017,0161,0204,025,0,
+    /*  8097 */ 0361,02,017,0162,0204,025,0,
+    /*  8104 */ 0361,02,017,0163,0203,025,0,
+    /*  8111 */ 0361,02,017,0161,0202,025,0,
+    /*  8118 */ 0361,02,017,0162,0202,025,0,
+    /*  8125 */ 0361,02,017,0163,0202,025,0,
+    /*  8132 */ 0360,0323,02,017,0373,0110,0,
+    /*  8139 */ 0361,02,017,0302,0110,026,0,
+    /*  8146 */ 0362,02,017,0302,0110,026,0,
+    /*  8153 */ 0324,0362,02,017,055,0110,0,
+    /*  8160 */ 0324,0362,02,017,052,0110,0,
+    /*  8167 */ 0324,0362,02,017,054,0110,0,
+    /*  8174 */ 0361,0324,02,017,0120,0110,0,
+    /*  8181 */ 0361,02,017,0306,0110,026,0,
+    /*  8188 */ 0323,0360,02,017,0170,0101,0,
+    /*  8195 */ 0323,0360,02,017,0171,0110,0,
+    /*  8202 */ 0360,03,017,070,034,0110,0,
+    /*  8209 */ 0361,03,017,070,034,0110,0,
+    /*  8216 */ 0360,03,017,070,035,0110,0,
+    /*  8223 */ 0361,03,017,070,035,0110,0,
+    /*  8230 */ 0360,03,017,070,036,0110,0,
+    /*  8237 */ 0361,03,017,070,036,0110,0,
+    /*  8244 */ 0360,03,017,070,01,0110,0,
+    /*  8251 */ 0361,03,017,070,01,0110,0,
+    /*  8258 */ 0360,03,017,070,02,0110,0,
+    /*  8265 */ 0361,03,017,070,02,0110,0,
+    /*  8272 */ 0360,03,017,070,03,0110,0,
+    /*  8279 */ 0361,03,017,070,03,0110,0,
+    /*  8286 */ 0360,03,017,070,05,0110,0,
+    /*  8293 */ 0361,03,017,070,05,0110,0,
+    /*  8300 */ 0360,03,017,070,06,0110,0,
+    /*  8307 */ 0361,03,017,070,06,0110,0,
+    /*  8314 */ 0360,03,017,070,07,0110,0,
+    /*  8321 */ 0361,03,017,070,07,0110,0,
+    /*  8328 */ 0360,03,017,070,04,0110,0,
+    /*  8335 */ 0361,03,017,070,04,0110,0,
+    /*  8342 */ 0360,03,017,070,013,0110,0,
+    /*  8349 */ 0361,03,017,070,013,0110,0,
+    /*  8356 */ 0360,03,017,070,0,0110,0,
+    /*  8363 */ 0361,03,017,070,0,0110,0,
+    /*  8370 */ 0360,03,017,070,010,0110,0,
+    /*  8377 */ 0361,03,017,070,010,0110,0,
+    /*  8384 */ 0360,03,017,070,011,0110,0,
+    /*  8391 */ 0361,03,017,070,011,0110,0,
+    /*  8398 */ 0360,03,017,070,012,0110,0,
+    /*  8405 */ 0361,03,017,070,012,0110,0,
+    /*  8412 */ 0320,0333,02,017,0275,0110,0,
+    /*  8419 */ 0321,0333,02,017,0275,0110,0,
+    /*  8426 */ 0324,0333,02,017,0275,0110,0,
+    /*  8433 */ 0361,03,017,070,025,0110,0,
+    /*  8440 */ 0361,03,017,070,024,0110,0,
+    /*  8447 */ 0361,03,017,070,052,0110,0,
+    /*  8454 */ 0361,03,017,070,053,0110,0,
+    /*  8461 */ 0361,03,017,070,020,0110,0,
+    /*  8468 */ 0361,03,017,070,051,0110,0,
+    /*  8475 */ 0361,03,017,070,0101,0110,0,
+    /*  8482 */ 0361,03,017,070,074,0110,0,
+    /*  8489 */ 0361,03,017,070,075,0110,0,
+    /*  8496 */ 0361,03,017,070,077,0110,0,
+    /*  8503 */ 0361,03,017,070,076,0110,0,
+    /*  8510 */ 0361,03,017,070,070,0110,0,
+    /*  8517 */ 0361,03,017,070,071,0110,0,
+    /*  8524 */ 0361,03,017,070,073,0110,0,
+    /*  8531 */ 0361,03,017,070,072,0110,0,
+    /*  8538 */ 0361,03,017,070,040,0110,0,
+    /*  8545 */ 0361,03,017,070,041,0110,0,
+    /*  8552 */ 0361,03,017,070,042,0110,0,
+    /*  8559 */ 0361,03,017,070,043,0110,0,
+    /*  8566 */ 0361,03,017,070,044,0110,0,
+    /*  8573 */ 0361,03,017,070,045,0110,0,
+    /*  8580 */ 0361,03,017,070,060,0110,0,
+    /*  8587 */ 0361,03,017,070,061,0110,0,
+    /*  8594 */ 0361,03,017,070,062,0110,0,
+    /*  8601 */ 0361,03,017,070,063,0110,0,
+    /*  8608 */ 0361,03,017,070,064,0110,0,
+    /*  8615 */ 0361,03,017,070,065,0110,0,
+    /*  8622 */ 0361,03,017,070,050,0110,0,
+    /*  8629 */ 0361,03,017,070,0100,0110,0,
+    /*  8636 */ 0361,03,017,070,027,0110,0,
+    /*  8643 */ 0361,03,017,070,067,0110,0,
+    /*  8650 */ 0320,0333,02,017,0270,0110,0,
+    /*  8657 */ 0321,0333,02,017,0270,0110,0,
+    /*  8664 */ 0324,0333,02,017,0270,0110,0,
+    /*  8671 */ 0320,03,017,070,0360,0110,0,
+    /*  8678 */ 0321,03,017,070,0360,0110,0,
+    /*  8685 */ 0324,03,017,070,0360,0110,0,
+    /*  8692 */ 0320,03,017,070,0361,0101,0,
+    /*  8699 */ 0321,03,017,070,0361,0101,0,
+    /*  8706 */ 0324,03,017,070,0361,0101,0,
+    /*  8713 */ 0361,03,017,070,0334,0110,0,
+    /*  8720 */ 0361,03,017,070,0335,0110,0,
+    /*  8727 */ 0361,03,017,070,0336,0110,0,
+    /*  8734 */ 0361,03,017,070,0337,0110,0,
+    /*  8741 */ 0361,03,017,070,0333,0110,0,
+    /*  8748 */ 0261,02,021,01,0334,0120,0,
+    /*  8755 */ 0260,02,021,01,0334,0110,0,
+    /*  8762 */ 0261,02,021,01,0335,0120,0,
+    /*  8769 */ 0260,02,021,01,0335,0110,0,
+    /*  8776 */ 0261,02,021,01,0336,0120,0,
+    /*  8783 */ 0260,02,021,01,0336,0110,0,
+    /*  8790 */ 0261,02,021,01,0337,0120,0,
+    /*  8797 */ 0260,02,021,01,0337,0110,0,
+    /*  8804 */ 0270,02,021,01,0333,0110,0,
+    /*  8811 */ 0261,01,021,01,0130,0120,0,
+    /*  8818 */ 0260,01,021,01,0130,0110,0,
+    /*  8825 */ 0261,01,025,01,0130,0120,0,
+    /*  8832 */ 0260,01,025,01,0130,0110,0,
+    /*  8839 */ 0261,01,020,01,0130,0120,0,
+    /*  8846 */ 0260,01,020,01,0130,0110,0,
+    /*  8853 */ 0261,01,024,01,0130,0120,0,
+    /*  8860 */ 0260,01,024,01,0130,0110,0,
+    /*  8867 */ 0261,01,023,01,0130,0120,0,
+    /*  8874 */ 0260,01,023,01,0130,0110,0,
+    /*  8881 */ 0261,01,022,01,0130,0120,0,
+    /*  8888 */ 0260,01,022,01,0130,0110,0,
+    /*  8895 */ 0261,01,021,01,0320,0120,0,
+    /*  8902 */ 0260,01,021,01,0320,0110,0,
+    /*  8909 */ 0261,01,025,01,0320,0120,0,
+    /*  8916 */ 0260,01,025,01,0320,0110,0,
+    /*  8923 */ 0261,01,023,01,0320,0120,0,
+    /*  8930 */ 0260,01,023,01,0320,0110,0,
+    /*  8937 */ 0261,01,027,01,0320,0120,0,
+    /*  8944 */ 0260,01,027,01,0320,0110,0,
+    /*  8951 */ 0261,01,021,01,0124,0120,0,
+    /*  8958 */ 0260,01,021,01,0124,0110,0,
+    /*  8965 */ 0261,01,025,01,0124,0120,0,
+    /*  8972 */ 0260,01,025,01,0124,0110,0,
+    /*  8979 */ 0261,01,020,01,0124,0120,0,
+    /*  8986 */ 0260,01,020,01,0124,0110,0,
+    /*  8993 */ 0261,01,024,01,0124,0120,0,
+    /*  9000 */ 0260,01,024,01,0124,0110,0,
+    /*  9007 */ 0261,01,021,01,0125,0120,0,
+    /*  9014 */ 0260,01,021,01,0125,0110,0,
+    /*  9021 */ 0261,01,025,01,0125,0120,0,
+    /*  9028 */ 0260,01,025,01,0125,0110,0,
+    /*  9035 */ 0261,01,020,01,0125,0120,0,
+    /*  9042 */ 0260,01,020,01,0125,0110,0,
+    /*  9049 */ 0261,01,024,01,0125,0120,0,
+    /*  9056 */ 0260,01,024,01,0125,0110,0,
+    /*  9063 */ 0270,02,021,01,025,0110,0,
+    /*  9070 */ 0270,02,025,01,025,0110,0,
+    /*  9077 */ 0270,02,021,01,024,0110,0,
+    /*  9084 */ 0270,02,025,01,024,0110,0,
+    /*  9091 */ 0270,02,021,01,030,0110,0,
+    /*  9098 */ 0270,02,025,01,030,0110,0,
+    /*  9105 */ 0270,02,025,01,031,0110,0,
+    /*  9112 */ 0270,02,025,01,032,0110,0,
+    /*  9119 */ 0270,01,021,01,057,0110,0,
+    /*  9126 */ 0270,01,020,01,057,0110,0,
+    /*  9133 */ 0270,01,022,01,0346,0110,0,
+    /*  9140 */ 0270,01,026,01,0346,0110,0,
+    /*  9147 */ 0270,01,020,01,0133,0110,0,
+    /*  9154 */ 0270,01,024,01,0133,0110,0,
+    /*  9161 */ 0270,01,023,01,0346,0110,0,
+    /*  9168 */ 0270,01,027,01,0346,0110,0,
+    /*  9175 */ 0270,01,021,01,0132,0110,0,
+    /*  9182 */ 0270,01,025,01,0132,0110,0,
+    /*  9189 */ 0270,01,021,01,0133,0110,0,
+    /*  9196 */ 0270,01,025,01,0133,0110,0,
+    /*  9203 */ 0270,01,020,01,0132,0110,0,
+    /*  9210 */ 0270,01,024,01,0132,0110,0,
+    /*  9217 */ 0270,01,03,01,055,0110,0,
+    /*  9224 */ 0270,01,013,01,055,0110,0,
+    /*  9231 */ 0261,01,023,01,0132,0120,0,
+    /*  9238 */ 0260,01,023,01,0132,0110,0,
+    /*  9245 */ 0261,01,03,01,052,0120,0,
+    /*  9252 */ 0260,01,03,01,052,0110,0,
+    /*  9259 */ 0261,01,013,01,052,0120,0,
+    /*  9266 */ 0260,01,013,01,052,0110,0,
+    /*  9273 */ 0261,01,02,01,052,0120,0,
+    /*  9280 */ 0260,01,02,01,052,0110,0,
+    /*  9287 */ 0261,01,012,01,052,0120,0,
+    /*  9294 */ 0260,01,012,01,052,0110,0,
+    /*  9301 */ 0261,01,022,01,0132,0120,0,
+    /*  9308 */ 0260,01,022,01,0132,0110,0,
+    /*  9315 */ 0270,01,02,01,055,0110,0,
+    /*  9322 */ 0270,01,012,01,055,0110,0,
+    /*  9329 */ 0270,01,021,01,0346,0110,0,
+    /*  9336 */ 0270,01,025,01,0346,0110,0,
+    /*  9343 */ 0270,01,022,01,0133,0110,0,
+    /*  9350 */ 0270,01,026,01,0133,0110,0,
+    /*  9357 */ 0270,01,03,01,054,0110,0,
+    /*  9364 */ 0270,01,013,01,054,0110,0,
+    /*  9371 */ 0270,01,02,01,054,0110,0,
+    /*  9378 */ 0270,01,012,01,054,0110,0,
+    /*  9385 */ 0261,01,021,01,0136,0120,0,
+    /*  9392 */ 0260,01,021,01,0136,0110,0,
+    /*  9399 */ 0261,01,025,01,0136,0120,0,
+    /*  9406 */ 0260,01,025,01,0136,0110,0,
+    /*  9413 */ 0261,01,020,01,0136,0120,0,
+    /*  9420 */ 0260,01,020,01,0136,0110,0,
+    /*  9427 */ 0261,01,024,01,0136,0120,0,
+    /*  9434 */ 0260,01,024,01,0136,0110,0,
+    /*  9441 */ 0261,01,023,01,0136,0120,0,
+    /*  9448 */ 0260,01,023,01,0136,0110,0,
+    /*  9455 */ 0261,01,022,01,0136,0120,0,
+    /*  9462 */ 0260,01,022,01,0136,0110,0,
+    /*  9469 */ 0261,01,021,01,0174,0120,0,
+    /*  9476 */ 0260,01,021,01,0174,0110,0,
+    /*  9483 */ 0261,01,025,01,0174,0120,0,
+    /*  9490 */ 0260,01,025,01,0174,0110,0,
+    /*  9497 */ 0261,01,023,01,0174,0120,0,
+    /*  9504 */ 0260,01,023,01,0174,0110,0,
+    /*  9511 */ 0261,01,027,01,0174,0120,0,
+    /*  9518 */ 0260,01,027,01,0174,0110,0,
+    /*  9525 */ 0261,01,021,01,0175,0120,0,
+    /*  9532 */ 0260,01,021,01,0175,0110,0,
+    /*  9539 */ 0261,01,025,01,0175,0120,0,
+    /*  9546 */ 0260,01,025,01,0175,0110,0,
+    /*  9553 */ 0261,01,023,01,0175,0120,0,
+    /*  9560 */ 0260,01,023,01,0175,0110,0,
+    /*  9567 */ 0261,01,027,01,0175,0120,0,
+    /*  9574 */ 0260,01,027,01,0175,0110,0,
+    /*  9581 */ 0270,01,023,01,0360,0110,0,
+    /*  9588 */ 0270,01,027,01,0360,0110,0,
+    /*  9595 */ 0270,01,020,01,0256,0202,0,
+    /*  9602 */ 0270,01,021,01,0367,0110,0,
+    /*  9609 */ 0261,02,021,01,054,0120,0,
+    /*  9616 */ 0261,02,025,01,054,0120,0,
+    /*  9623 */ 0261,02,021,01,056,0102,0,
+    /*  9630 */ 0261,02,025,01,056,0102,0,
+    /*  9637 */ 0261,02,021,01,055,0120,0,
+    /*  9644 */ 0261,02,025,01,055,0120,0,
+    /*  9651 */ 0261,02,021,01,057,0102,0,
+    /*  9658 */ 0261,02,025,01,057,0102,0,
+    /*  9665 */ 0261,01,021,01,0137,0120,0,
+    /*  9672 */ 0260,01,021,01,0137,0110,0,
+    /*  9679 */ 0261,01,025,01,0137,0120,0,
+    /*  9686 */ 0260,01,025,01,0137,0110,0,
+    /*  9693 */ 0261,01,020,01,0137,0120,0,
+    /*  9700 */ 0260,01,020,01,0137,0110,0,
+    /*  9707 */ 0261,01,024,01,0137,0120,0,
+    /*  9714 */ 0260,01,024,01,0137,0110,0,
+    /*  9721 */ 0261,01,023,01,0137,0120,0,
+    /*  9728 */ 0260,01,023,01,0137,0110,0,
+    /*  9735 */ 0261,01,022,01,0137,0120,0,
+    /*  9742 */ 0260,01,022,01,0137,0110,0,
+    /*  9749 */ 0261,01,021,01,0135,0120,0,
+    /*  9756 */ 0260,01,021,01,0135,0110,0,
+    /*  9763 */ 0261,01,025,01,0135,0120,0,
+    /*  9770 */ 0260,01,025,01,0135,0110,0,
+    /*  9777 */ 0261,01,020,01,0135,0120,0,
+    /*  9784 */ 0260,01,020,01,0135,0110,0,
+    /*  9791 */ 0261,01,024,01,0135,0120,0,
+    /*  9798 */ 0260,01,024,01,0135,0110,0,
+    /*  9805 */ 0261,01,023,01,0135,0120,0,
+    /*  9812 */ 0260,01,023,01,0135,0110,0,
+    /*  9819 */ 0261,01,022,01,0135,0120,0,
+    /*  9826 */ 0260,01,022,01,0135,0110,0,
+    /*  9833 */ 0270,01,021,01,050,0110,0,
+    /*  9840 */ 0270,01,021,01,051,0101,0,
+    /*  9847 */ 0270,01,025,01,050,0110,0,
+    /*  9854 */ 0270,01,025,01,051,0101,0,
+    /*  9861 */ 0270,01,020,01,050,0110,0,
+    /*  9868 */ 0270,01,020,01,051,0101,0,
+    /*  9875 */ 0270,01,024,01,050,0110,0,
+    /*  9882 */ 0270,01,024,01,051,0101,0,
+    /*  9889 */ 0270,01,022,01,0176,0110,0,
+    /*  9896 */ 0270,01,021,01,0326,0101,0,
+    /*  9903 */ 0270,01,011,01,0156,0110,0,
+    /*  9910 */ 0270,01,011,01,0176,0101,0,
+    /*  9917 */ 0270,01,01,01,0156,0110,0,
+    /*  9924 */ 0270,01,01,01,0176,0101,0,
+    /*  9931 */ 0270,01,023,01,022,0110,0,
+    /*  9938 */ 0270,01,027,01,022,0110,0,
+    /*  9945 */ 0270,01,021,01,0157,0110,0,
+    /*  9952 */ 0270,01,021,01,0177,0101,0,
+    /*  9959 */ 0270,01,025,01,0157,0110,0,
+    /*  9966 */ 0270,01,025,01,0177,0101,0,
+    /*  9973 */ 0270,01,022,01,0157,0110,0,
+    /*  9980 */ 0270,01,022,01,0177,0101,0,
+    /*  9987 */ 0270,01,026,01,0157,0110,0,
+    /*  9994 */ 0270,01,026,01,0177,0101,0,
+    /* 10001 */ 0261,01,020,01,022,0120,0,
+    /* 10008 */ 0260,01,020,01,022,0110,0,
+    /* 10015 */ 0261,01,021,01,026,0120,0,
+    /* 10022 */ 0260,01,021,01,026,0110,0,
+    /* 10029 */ 0270,01,021,01,027,0101,0,
+    /* 10036 */ 0261,01,020,01,026,0120,0,
+    /* 10043 */ 0260,01,020,01,026,0110,0,
+    /* 10050 */ 0270,01,020,01,027,0101,0,
+    /* 10057 */ 0261,01,021,01,022,0120,0,
+    /* 10064 */ 0260,01,021,01,022,0110,0,
+    /* 10071 */ 0270,01,021,01,023,0101,0,
+    /* 10078 */ 0270,01,020,01,023,0101,0,
+    /* 10085 */ 0270,01,021,01,0120,0110,0,
+    /* 10092 */ 0270,01,025,01,0120,0110,0,
+    /* 10099 */ 0270,01,020,01,0120,0110,0,
+    /* 10106 */ 0270,01,024,01,0120,0110,0,
+    /* 10113 */ 0270,01,021,01,0347,0101,0,
+    /* 10120 */ 0270,01,025,01,0347,0101,0,
+    /* 10127 */ 0270,02,021,01,052,0110,0,
+    /* 10134 */ 0270,01,021,01,053,0101,0,
+    /* 10141 */ 0270,01,025,01,053,0101,0,
+    /* 10148 */ 0270,01,020,01,053,0101,0,
+    /* 10155 */ 0270,01,024,01,053,0101,0,
+    /* 10162 */ 0261,01,023,01,020,0120,0,
+    /* 10169 */ 0260,01,023,01,020,0110,0,
+    /* 10176 */ 0270,01,023,01,020,0110,0,
+    /* 10183 */ 0261,01,023,01,021,0102,0,
+    /* 10190 */ 0260,01,023,01,021,0101,0,
+    /* 10197 */ 0270,01,023,01,021,0101,0,
+    /* 10204 */ 0270,01,022,01,026,0110,0,
+    /* 10211 */ 0270,01,026,01,026,0110,0,
+    /* 10218 */ 0270,01,022,01,022,0110,0,
+    /* 10225 */ 0270,01,026,01,022,0110,0,
+    /* 10232 */ 0261,01,022,01,020,0120,0,
+    /* 10239 */ 0260,01,022,01,020,0110,0,
+    /* 10246 */ 0270,01,022,01,020,0110,0,
+    /* 10253 */ 0261,01,022,01,021,0102,0,
+    /* 10260 */ 0260,01,022,01,021,0101,0,
+    /* 10267 */ 0270,01,022,01,021,0101,0,
+    /* 10274 */ 0270,01,021,01,020,0110,0,
+    /* 10281 */ 0270,01,021,01,021,0101,0,
+    /* 10288 */ 0270,01,025,01,020,0110,0,
+    /* 10295 */ 0270,01,025,01,021,0101,0,
+    /* 10302 */ 0270,01,020,01,020,0110,0,
+    /* 10309 */ 0270,01,020,01,021,0101,0,
+    /* 10316 */ 0270,01,024,01,020,0110,0,
+    /* 10323 */ 0270,01,024,01,021,0101,0,
+    /* 10330 */ 0261,01,021,01,0131,0120,0,
+    /* 10337 */ 0260,01,021,01,0131,0110,0,
+    /* 10344 */ 0261,01,025,01,0131,0120,0,
+    /* 10351 */ 0260,01,025,01,0131,0110,0,
+    /* 10358 */ 0261,01,020,01,0131,0120,0,
+    /* 10365 */ 0260,01,020,01,0131,0110,0,
+    /* 10372 */ 0261,01,024,01,0131,0120,0,
+    /* 10379 */ 0260,01,024,01,0131,0110,0,
+    /* 10386 */ 0261,01,023,01,0131,0120,0,
+    /* 10393 */ 0260,01,023,01,0131,0110,0,
+    /* 10400 */ 0261,01,022,01,0131,0120,0,
+    /* 10407 */ 0260,01,022,01,0131,0110,0,
+    /* 10414 */ 0261,01,021,01,0126,0120,0,
+    /* 10421 */ 0260,01,021,01,0126,0110,0,
+    /* 10428 */ 0261,01,025,01,0126,0120,0,
+    /* 10435 */ 0260,01,025,01,0126,0110,0,
+    /* 10442 */ 0261,01,020,01,0126,0120,0,
+    /* 10449 */ 0260,01,020,01,0126,0110,0,
+    /* 10456 */ 0261,01,024,01,0126,0120,0,
+    /* 10463 */ 0260,01,024,01,0126,0110,0,
+    /* 10470 */ 0270,02,021,01,034,0110,0,
+    /* 10477 */ 0270,02,021,01,035,0110,0,
+    /* 10484 */ 0270,02,021,01,036,0110,0,
+    /* 10491 */ 0261,01,021,01,0143,0120,0,
+    /* 10498 */ 0260,01,021,01,0143,0110,0,
+    /* 10505 */ 0261,01,021,01,0153,0120,0,
+    /* 10512 */ 0260,01,021,01,0153,0110,0,
+    /* 10519 */ 0261,01,021,01,0147,0120,0,
+    /* 10526 */ 0260,01,021,01,0147,0110,0,
+    /* 10533 */ 0261,02,021,01,053,0120,0,
+    /* 10540 */ 0260,02,021,01,053,0110,0,
+    /* 10547 */ 0261,01,021,01,0374,0120,0,
+    /* 10554 */ 0260,01,021,01,0374,0110,0,
+    /* 10561 */ 0261,01,021,01,0375,0120,0,
+    /* 10568 */ 0260,01,021,01,0375,0110,0,
+    /* 10575 */ 0261,01,021,01,0376,0120,0,
+    /* 10582 */ 0260,01,021,01,0376,0110,0,
+    /* 10589 */ 0261,01,021,01,0324,0120,0,
+    /* 10596 */ 0260,01,021,01,0324,0110,0,
+    /* 10603 */ 0261,01,021,01,0354,0120,0,
+    /* 10610 */ 0260,01,021,01,0354,0110,0,
+    /* 10617 */ 0261,01,021,01,0355,0120,0,
+    /* 10624 */ 0260,01,021,01,0355,0110,0,
+    /* 10631 */ 0261,01,021,01,0334,0120,0,
+    /* 10638 */ 0260,01,021,01,0334,0110,0,
+    /* 10645 */ 0261,01,021,01,0335,0120,0,
+    /* 10652 */ 0260,01,021,01,0335,0110,0,
+    /* 10659 */ 0261,01,021,01,0333,0120,0,
+    /* 10666 */ 0260,01,021,01,0333,0110,0,
+    /* 10673 */ 0261,01,021,01,0337,0120,0,
+    /* 10680 */ 0260,01,021,01,0337,0110,0,
+    /* 10687 */ 0261,01,021,01,0340,0120,0,
+    /* 10694 */ 0260,01,021,01,0340,0110,0,
+    /* 10701 */ 0261,01,021,01,0343,0120,0,
+    /* 10708 */ 0260,01,021,01,0343,0110,0,
+    /* 10715 */ 0261,01,021,01,0164,0120,0,
+    /* 10722 */ 0260,01,021,01,0164,0110,0,
+    /* 10729 */ 0261,01,021,01,0165,0120,0,
+    /* 10736 */ 0260,01,021,01,0165,0110,0,
+    /* 10743 */ 0261,01,021,01,0166,0120,0,
+    /* 10750 */ 0260,01,021,01,0166,0110,0,
+    /* 10757 */ 0261,01,021,01,051,0120,0,
+    /* 10764 */ 0260,01,021,01,051,0110,0,
+    /* 10771 */ 0261,01,021,01,0144,0120,0,
+    /* 10778 */ 0260,01,021,01,0144,0110,0,
+    /* 10785 */ 0261,01,021,01,0145,0120,0,
+    /* 10792 */ 0260,01,021,01,0145,0110,0,
+    /* 10799 */ 0261,01,021,01,0146,0120,0,
+    /* 10806 */ 0260,01,021,01,0146,0110,0,
+    /* 10813 */ 0261,01,021,01,067,0120,0,
+    /* 10820 */ 0260,01,021,01,067,0110,0,
+    /* 10827 */ 0261,02,021,01,015,0120,0,
+    /* 10834 */ 0261,02,025,01,015,0120,0,
+    /* 10841 */ 0261,02,021,01,014,0120,0,
+    /* 10848 */ 0261,02,025,01,014,0120,0,
+    /* 10855 */ 0261,02,021,01,01,0120,0,
+    /* 10862 */ 0260,02,021,01,01,0110,0,
+    /* 10869 */ 0261,02,021,01,02,0120,0,
+    /* 10876 */ 0260,02,021,01,02,0110,0,
+    /* 10883 */ 0261,02,021,01,03,0120,0,
+    /* 10890 */ 0260,02,021,01,03,0110,0,
+    /* 10897 */ 0270,02,021,01,0101,0110,0,
+    /* 10904 */ 0261,02,021,01,05,0120,0,
+    /* 10911 */ 0260,02,021,01,05,0110,0,
+    /* 10918 */ 0261,02,021,01,06,0120,0,
+    /* 10925 */ 0260,02,021,01,06,0110,0,
+    /* 10932 */ 0261,02,021,01,07,0120,0,
+    /* 10939 */ 0260,02,021,01,07,0110,0,
+    /* 10946 */ 0261,01,021,01,0365,0120,0,
+    /* 10953 */ 0260,01,021,01,0365,0110,0,
+    /* 10960 */ 0261,02,021,01,04,0120,0,
+    /* 10967 */ 0260,02,021,01,04,0110,0,
+    /* 10974 */ 0261,02,021,01,074,0120,0,
+    /* 10981 */ 0260,02,021,01,074,0110,0,
+    /* 10988 */ 0261,01,021,01,0356,0120,0,
+    /* 10995 */ 0260,01,021,01,0356,0110,0,
+    /* 11002 */ 0261,02,021,01,075,0120,0,
+    /* 11009 */ 0260,02,021,01,075,0110,0,
+    /* 11016 */ 0261,01,021,01,0336,0120,0,
+    /* 11023 */ 0260,01,021,01,0336,0110,0,
+    /* 11030 */ 0261,02,021,01,076,0120,0,
+    /* 11037 */ 0260,02,021,01,076,0110,0,
+    /* 11044 */ 0261,02,021,01,077,0120,0,
+    /* 11051 */ 0260,02,021,01,077,0110,0,
+    /* 11058 */ 0261,02,021,01,070,0120,0,
+    /* 11065 */ 0260,02,021,01,070,0110,0,
+    /* 11072 */ 0261,01,021,01,0352,0120,0,
+    /* 11079 */ 0260,01,021,01,0352,0110,0,
+    /* 11086 */ 0261,02,021,01,071,0120,0,
+    /* 11093 */ 0260,02,021,01,071,0110,0,
+    /* 11100 */ 0261,01,021,01,0332,0120,0,
+    /* 11107 */ 0260,01,021,01,0332,0110,0,
+    /* 11114 */ 0261,02,021,01,072,0120,0,
+    /* 11121 */ 0260,02,021,01,072,0110,0,
+    /* 11128 */ 0261,02,021,01,073,0120,0,
+    /* 11135 */ 0260,02,021,01,073,0110,0,
+    /* 11142 */ 0270,01,021,01,0327,0110,0,
+    /* 11149 */ 0270,02,021,01,040,0110,0,
+    /* 11156 */ 0270,02,021,01,041,0110,0,
+    /* 11163 */ 0270,02,021,01,042,0110,0,
+    /* 11170 */ 0270,02,021,01,043,0110,0,
+    /* 11177 */ 0270,02,021,01,044,0110,0,
+    /* 11184 */ 0270,02,021,01,045,0110,0,
+    /* 11191 */ 0270,02,021,01,060,0110,0,
+    /* 11198 */ 0270,02,021,01,061,0110,0,
+    /* 11205 */ 0270,02,021,01,062,0110,0,
+    /* 11212 */ 0270,02,021,01,063,0110,0,
+    /* 11219 */ 0270,02,021,01,064,0110,0,
+    /* 11226 */ 0270,02,021,01,065,0110,0,
+    /* 11233 */ 0261,01,021,01,0344,0120,0,
+    /* 11240 */ 0260,01,021,01,0344,0110,0,
+    /* 11247 */ 0261,02,021,01,013,0120,0,
+    /* 11254 */ 0260,02,021,01,013,0110,0,
+    /* 11261 */ 0261,01,021,01,0345,0120,0,
+    /* 11268 */ 0260,01,021,01,0345,0110,0,
+    /* 11275 */ 0261,01,021,01,0325,0120,0,
+    /* 11282 */ 0260,01,021,01,0325,0110,0,
+    /* 11289 */ 0261,02,021,01,0100,0120,0,
+    /* 11296 */ 0260,02,021,01,0100,0110,0,
+    /* 11303 */ 0261,01,021,01,0364,0120,0,
+    /* 11310 */ 0260,01,021,01,0364,0110,0,
+    /* 11317 */ 0261,02,021,01,050,0120,0,
+    /* 11324 */ 0260,02,021,01,050,0110,0,
+    /* 11331 */ 0261,01,021,01,0353,0120,0,
+    /* 11338 */ 0260,01,021,01,0353,0110,0,
+    /* 11345 */ 0261,01,021,01,0366,0120,0,
+    /* 11352 */ 0260,01,021,01,0366,0110,0,
+    /* 11359 */ 0261,02,021,01,0,0120,0,
+    /* 11366 */ 0260,02,021,01,0,0110,0,
+    /* 11373 */ 0261,02,021,01,010,0120,0,
+    /* 11380 */ 0260,02,021,01,010,0110,0,
+    /* 11387 */ 0261,02,021,01,011,0120,0,
+    /* 11394 */ 0260,02,021,01,011,0110,0,
+    /* 11401 */ 0261,02,021,01,012,0120,0,
+    /* 11408 */ 0260,02,021,01,012,0110,0,
+    /* 11415 */ 0261,01,021,01,0361,0120,0,
+    /* 11422 */ 0260,01,021,01,0361,0110,0,
+    /* 11429 */ 0261,01,021,01,0362,0120,0,
+    /* 11436 */ 0260,01,021,01,0362,0110,0,
+    /* 11443 */ 0261,01,021,01,0363,0120,0,
+    /* 11450 */ 0260,01,021,01,0363,0110,0,
+    /* 11457 */ 0261,01,021,01,0341,0120,0,
+    /* 11464 */ 0260,01,021,01,0341,0110,0,
+    /* 11471 */ 0261,01,021,01,0342,0120,0,
+    /* 11478 */ 0260,01,021,01,0342,0110,0,
+    /* 11485 */ 0261,01,021,01,0321,0120,0,
+    /* 11492 */ 0260,01,021,01,0321,0110,0,
+    /* 11499 */ 0261,01,021,01,0322,0120,0,
+    /* 11506 */ 0260,01,021,01,0322,0110,0,
+    /* 11513 */ 0261,01,021,01,0323,0120,0,
+    /* 11520 */ 0260,01,021,01,0323,0110,0,
+    /* 11527 */ 0270,02,021,01,027,0110,0,
+    /* 11534 */ 0270,02,025,01,027,0110,0,
+    /* 11541 */ 0261,01,021,01,0370,0120,0,
+    /* 11548 */ 0260,01,021,01,0370,0110,0,
+    /* 11555 */ 0261,01,021,01,0371,0120,0,
+    /* 11562 */ 0260,01,021,01,0371,0110,0,
+    /* 11569 */ 0261,01,021,01,0372,0120,0,
+    /* 11576 */ 0260,01,021,01,0372,0110,0,
+    /* 11583 */ 0261,01,021,01,0373,0120,0,
+    /* 11590 */ 0260,01,021,01,0373,0110,0,
+    /* 11597 */ 0261,01,021,01,0350,0120,0,
+    /* 11604 */ 0260,01,021,01,0350,0110,0,
+    /* 11611 */ 0261,01,021,01,0351,0120,0,
+    /* 11618 */ 0260,01,021,01,0351,0110,0,
+    /* 11625 */ 0261,01,021,01,0330,0120,0,
+    /* 11632 */ 0260,01,021,01,0330,0110,0,
+    /* 11639 */ 0261,01,021,01,0331,0120,0,
+    /* 11646 */ 0260,01,021,01,0331,0110,0,
+    /* 11653 */ 0261,01,021,01,0150,0120,0,
+    /* 11660 */ 0260,01,021,01,0150,0110,0,
+    /* 11667 */ 0261,01,021,01,0151,0120,0,
+    /* 11674 */ 0260,01,021,01,0151,0110,0,
+    /* 11681 */ 0261,01,021,01,0152,0120,0,
+    /* 11688 */ 0260,01,021,01,0152,0110,0,
+    /* 11695 */ 0261,01,021,01,0155,0120,0,
+    /* 11702 */ 0260,01,021,01,0155,0110,0,
+    /* 11709 */ 0261,01,021,01,0140,0120,0,
+    /* 11716 */ 0260,01,021,01,0140,0110,0,
+    /* 11723 */ 0261,01,021,01,0141,0120,0,
+    /* 11730 */ 0260,01,021,01,0141,0110,0,
+    /* 11737 */ 0261,01,021,01,0142,0120,0,
+    /* 11744 */ 0260,01,021,01,0142,0110,0,
+    /* 11751 */ 0261,01,021,01,0154,0120,0,
+    /* 11758 */ 0260,01,021,01,0154,0110,0,
+    /* 11765 */ 0261,01,021,01,0357,0120,0,
+    /* 11772 */ 0260,01,021,01,0357,0110,0,
+    /* 11779 */ 0270,01,020,01,0123,0110,0,
+    /* 11786 */ 0270,01,024,01,0123,0110,0,
+    /* 11793 */ 0261,01,022,01,0123,0120,0,
+    /* 11800 */ 0260,01,022,01,0123,0110,0,
+    /* 11807 */ 0270,01,020,01,0122,0110,0,
+    /* 11814 */ 0270,01,024,01,0122,0110,0,
+    /* 11821 */ 0261,01,022,01,0122,0120,0,
+    /* 11828 */ 0260,01,022,01,0122,0110,0,
+    /* 11835 */ 0270,01,021,01,0121,0110,0,
+    /* 11842 */ 0270,01,025,01,0121,0110,0,
+    /* 11849 */ 0270,01,020,01,0121,0110,0,
+    /* 11856 */ 0270,01,024,01,0121,0110,0,
+    /* 11863 */ 0261,01,023,01,0121,0120,0,
+    /* 11870 */ 0260,01,023,01,0121,0110,0,
+    /* 11877 */ 0261,01,022,01,0121,0120,0,
+    /* 11884 */ 0260,01,022,01,0121,0110,0,
+    /* 11891 */ 0270,01,020,01,0256,0203,0,
+    /* 11898 */ 0261,01,021,01,0134,0120,0,
+    /* 11905 */ 0260,01,021,01,0134,0110,0,
+    /* 11912 */ 0261,01,025,01,0134,0120,0,
+    /* 11919 */ 0260,01,025,01,0134,0110,0,
+    /* 11926 */ 0261,01,020,01,0134,0120,0,
+    /* 11933 */ 0260,01,020,01,0134,0110,0,
+    /* 11940 */ 0261,01,024,01,0134,0120,0,
+    /* 11947 */ 0260,01,024,01,0134,0110,0,
+    /* 11954 */ 0261,01,023,01,0134,0120,0,
+    /* 11961 */ 0260,01,023,01,0134,0110,0,
+    /* 11968 */ 0261,01,022,01,0134,0120,0,
+    /* 11975 */ 0260,01,022,01,0134,0110,0,
+    /* 11982 */ 0270,02,021,01,016,0110,0,
+    /* 11989 */ 0270,02,025,01,016,0110,0,
+    /* 11996 */ 0270,02,021,01,017,0110,0,
+    /* 12003 */ 0270,02,025,01,017,0110,0,
+    /* 12010 */ 0270,01,021,01,056,0110,0,
+    /* 12017 */ 0270,01,020,01,056,0110,0,
+    /* 12024 */ 0261,01,021,01,025,0120,0,
+    /* 12031 */ 0260,01,021,01,025,0110,0,
+    /* 12038 */ 0261,01,025,01,025,0120,0,
+    /* 12045 */ 0260,01,025,01,025,0110,0,
+    /* 12052 */ 0261,01,020,01,025,0120,0,
+    /* 12059 */ 0260,01,020,01,025,0110,0,
+    /* 12066 */ 0261,01,024,01,025,0120,0,
+    /* 12073 */ 0260,01,024,01,025,0110,0,
+    /* 12080 */ 0261,01,021,01,024,0120,0,
+    /* 12087 */ 0260,01,021,01,024,0110,0,
+    /* 12094 */ 0261,01,025,01,024,0120,0,
+    /* 12101 */ 0260,01,025,01,024,0110,0,
+    /* 12108 */ 0261,01,020,01,024,0120,0,
+    /* 12115 */ 0260,01,020,01,024,0110,0,
+    /* 12122 */ 0261,01,024,01,024,0120,0,
+    /* 12129 */ 0260,01,024,01,024,0110,0,
+    /* 12136 */ 0261,01,021,01,0127,0120,0,
+    /* 12143 */ 0260,01,021,01,0127,0110,0,
+    /* 12150 */ 0261,01,025,01,0127,0120,0,
+    /* 12157 */ 0260,01,025,01,0127,0110,0,
+    /* 12164 */ 0261,01,020,01,0127,0120,0,
+    /* 12171 */ 0260,01,020,01,0127,0110,0,
+    /* 12178 */ 0261,01,024,01,0127,0120,0,
+    /* 12185 */ 0260,01,024,01,0127,0110,0,
+    /* 12192 */ 0261,02,01,01,0230,0120,0,
+    /* 12199 */ 0261,02,05,01,0230,0120,0,
+    /* 12206 */ 0261,02,011,01,0230,0120,0,
+    /* 12213 */ 0261,02,015,01,0230,0120,0,
+    /* 12220 */ 0261,02,01,01,0250,0120,0,
+    /* 12227 */ 0261,02,05,01,0250,0120,0,
+    /* 12234 */ 0261,02,011,01,0250,0120,0,
+    /* 12241 */ 0261,02,015,01,0250,0120,0,
+    /* 12248 */ 0261,02,01,01,0270,0120,0,
+    /* 12255 */ 0261,02,05,01,0270,0120,0,
+    /* 12262 */ 0261,02,011,01,0270,0120,0,
+    /* 12269 */ 0261,02,015,01,0270,0120,0,
+    /* 12276 */ 0261,02,01,01,0226,0120,0,
+    /* 12283 */ 0261,02,05,01,0226,0120,0,
+    /* 12290 */ 0261,02,011,01,0226,0120,0,
+    /* 12297 */ 0261,02,015,01,0226,0120,0,
+    /* 12304 */ 0261,02,01,01,0246,0120,0,
+    /* 12311 */ 0261,02,05,01,0246,0120,0,
+    /* 12318 */ 0261,02,011,01,0246,0120,0,
+    /* 12325 */ 0261,02,015,01,0246,0120,0,
+    /* 12332 */ 0261,02,01,01,0266,0120,0,
+    /* 12339 */ 0261,02,05,01,0266,0120,0,
+    /* 12346 */ 0261,02,011,01,0266,0120,0,
+    /* 12353 */ 0261,02,015,01,0266,0120,0,
+    /* 12360 */ 0261,02,01,01,0232,0120,0,
+    /* 12367 */ 0261,02,05,01,0232,0120,0,
+    /* 12374 */ 0261,02,011,01,0232,0120,0,
+    /* 12381 */ 0261,02,015,01,0232,0120,0,
+    /* 12388 */ 0261,02,01,01,0252,0120,0,
+    /* 12395 */ 0261,02,05,01,0252,0120,0,
+    /* 12402 */ 0261,02,011,01,0252,0120,0,
+    /* 12409 */ 0261,02,015,01,0252,0120,0,
+    /* 12416 */ 0261,02,01,01,0272,0120,0,
+    /* 12423 */ 0261,02,05,01,0272,0120,0,
+    /* 12430 */ 0261,02,011,01,0272,0120,0,
+    /* 12437 */ 0261,02,015,01,0272,0120,0,
+    /* 12444 */ 0261,02,01,01,0227,0120,0,
+    /* 12451 */ 0261,02,05,01,0227,0120,0,
+    /* 12458 */ 0261,02,011,01,0227,0120,0,
+    /* 12465 */ 0261,02,015,01,0227,0120,0,
+    /* 12472 */ 0261,02,01,01,0247,0120,0,
+    /* 12479 */ 0261,02,05,01,0247,0120,0,
+    /* 12486 */ 0261,02,011,01,0247,0120,0,
+    /* 12493 */ 0261,02,015,01,0247,0120,0,
+    /* 12500 */ 0261,02,01,01,0267,0120,0,
+    /* 12507 */ 0261,02,05,01,0267,0120,0,
+    /* 12514 */ 0261,02,011,01,0267,0120,0,
+    /* 12521 */ 0261,02,015,01,0267,0120,0,
+    /* 12528 */ 0261,02,01,01,0234,0120,0,
+    /* 12535 */ 0261,02,05,01,0234,0120,0,
+    /* 12542 */ 0261,02,011,01,0234,0120,0,
+    /* 12549 */ 0261,02,015,01,0234,0120,0,
+    /* 12556 */ 0261,02,01,01,0254,0120,0,
+    /* 12563 */ 0261,02,05,01,0254,0120,0,
+    /* 12570 */ 0261,02,011,01,0254,0120,0,
+    /* 12577 */ 0261,02,015,01,0254,0120,0,
+    /* 12584 */ 0261,02,01,01,0274,0120,0,
+    /* 12591 */ 0261,02,05,01,0274,0120,0,
+    /* 12598 */ 0261,02,011,01,0274,0120,0,
+    /* 12605 */ 0261,02,015,01,0274,0120,0,
+    /* 12612 */ 0261,02,01,01,0236,0120,0,
+    /* 12619 */ 0261,02,05,01,0236,0120,0,
+    /* 12626 */ 0261,02,011,01,0236,0120,0,
+    /* 12633 */ 0261,02,015,01,0236,0120,0,
+    /* 12640 */ 0261,02,01,01,0256,0120,0,
+    /* 12647 */ 0261,02,05,01,0256,0120,0,
+    /* 12654 */ 0261,02,011,01,0256,0120,0,
+    /* 12661 */ 0261,02,015,01,0256,0120,0,
+    /* 12668 */ 0261,02,01,01,0276,0120,0,
+    /* 12675 */ 0261,02,05,01,0276,0120,0,
+    /* 12682 */ 0261,02,011,01,0276,0120,0,
+    /* 12689 */ 0261,02,015,01,0276,0120,0,
+    /* 12696 */ 0261,02,01,01,0231,0120,0,
+    /* 12703 */ 0261,02,011,01,0231,0120,0,
+    /* 12710 */ 0261,02,01,01,0251,0120,0,
+    /* 12717 */ 0261,02,011,01,0251,0120,0,
+    /* 12724 */ 0261,02,01,01,0271,0120,0,
+    /* 12731 */ 0261,02,011,01,0271,0120,0,
+    /* 12738 */ 0261,02,01,01,0233,0120,0,
+    /* 12745 */ 0261,02,011,01,0233,0120,0,
+    /* 12752 */ 0261,02,01,01,0253,0120,0,
+    /* 12759 */ 0261,02,011,01,0253,0120,0,
+    /* 12766 */ 0261,02,01,01,0273,0120,0,
+    /* 12773 */ 0261,02,011,01,0273,0120,0,
+    /* 12780 */ 0261,02,01,01,0235,0120,0,
+    /* 12787 */ 0261,02,011,01,0235,0120,0,
+    /* 12794 */ 0261,02,01,01,0255,0120,0,
+    /* 12801 */ 0261,02,011,01,0255,0120,0,
+    /* 12808 */ 0261,02,01,01,0275,0120,0,
+    /* 12815 */ 0261,02,011,01,0275,0120,0,
+    /* 12822 */ 0261,02,01,01,0237,0120,0,
+    /* 12829 */ 0261,02,011,01,0237,0120,0,
+    /* 12836 */ 0261,02,01,01,0257,0120,0,
+    /* 12843 */ 0261,02,011,01,0257,0120,0,
+    /* 12850 */ 0261,02,01,01,0277,0120,0,
+    /* 12857 */ 0261,02,011,01,0277,0120,0,
+    /* 12864 */ 0270,0111,0,01,022,0200,0,
+    /* 12871 */ 0270,0111,04,01,022,0200,0,
+    /* 12878 */ 0270,0111,010,01,022,0200,0,
+    /* 12885 */ 0270,0111,0,01,022,0201,0,
+    /* 12892 */ 0270,0111,04,01,022,0201,0,
+    /* 12899 */ 0270,0111,010,01,022,0201,0,
+    /* 12906 */ 0270,0111,0,01,0201,0110,0,
+    /* 12913 */ 0270,0111,0,01,0201,0100,0,
+    /* 12920 */ 0270,0111,04,01,0201,0110,0,
+    /* 12927 */ 0270,0111,04,01,0201,0100,0,
+    /* 12934 */ 0270,0111,0,01,0200,0110,0,
+    /* 12941 */ 0270,0111,0,01,0200,0100,0,
+    /* 12948 */ 0270,0111,04,01,0200,0110,0,
+    /* 12955 */ 0270,0111,04,01,0200,0100,0,
+    /* 12962 */ 0270,0111,0,01,0203,0110,0,
+    /* 12969 */ 0270,0111,0,01,0203,0100,0,
+    /* 12976 */ 0270,0111,0,01,0202,0110,0,
+    /* 12983 */ 0270,0111,0,01,0202,0100,0,
+    /* 12990 */ 0270,0111,0,01,0302,0110,0,
+    /* 12997 */ 0270,0111,0,01,0302,0100,0,
+    /* 13004 */ 0270,0111,0,01,0303,0110,0,
+    /* 13011 */ 0270,0111,0,01,0303,0100,0,
+    /* 13018 */ 0270,0111,0,01,0301,0110,0,
+    /* 13025 */ 0270,0111,0,01,0301,0100,0,
+    /* 13032 */ 0270,0111,0,01,0313,0110,0,
+    /* 13039 */ 0270,0111,0,01,0313,0100,0,
+    /* 13046 */ 0270,0111,0,01,0322,0110,0,
+    /* 13053 */ 0270,0111,0,01,0322,0100,0,
+    /* 13060 */ 0270,0111,0,01,0323,0110,0,
+    /* 13067 */ 0270,0111,0,01,0323,0100,0,
+    /* 13074 */ 0270,0111,0,01,0321,0110,0,
+    /* 13081 */ 0270,0111,0,01,0321,0100,0,
+    /* 13088 */ 0270,0111,0,01,0333,0110,0,
+    /* 13095 */ 0270,0111,0,01,0333,0100,0,
+    /* 13102 */ 0270,0111,0,01,0326,0110,0,
+    /* 13109 */ 0270,0111,0,01,0326,0100,0,
+    /* 13116 */ 0270,0111,0,01,0327,0110,0,
+    /* 13123 */ 0270,0111,0,01,0327,0100,0,
+    /* 13130 */ 0270,0111,0,01,0306,0110,0,
+    /* 13137 */ 0270,0111,0,01,0306,0100,0,
+    /* 13144 */ 0270,0111,0,01,0307,0110,0,
+    /* 13151 */ 0270,0111,0,01,0307,0100,0,
+    /* 13158 */ 0270,0111,0,01,0341,0110,0,
+    /* 13165 */ 0270,0111,0,01,0341,0100,0,
+    /* 13172 */ 0270,0111,0,01,0343,0110,0,
+    /* 13179 */ 0270,0111,0,01,0343,0100,0,
+    /* 13186 */ 0270,0111,0,01,0342,0110,0,
+    /* 13193 */ 0270,0111,0,01,0342,0100,0,
+    /* 13200 */ 0262,0111,0,01,0220,0110,0,
+    /* 13207 */ 0261,0111,0,01,0220,0100,0,
+    /* 13214 */ 0261,0111,010,01,0220,0120,0,
+    /* 13221 */ 0260,0111,010,01,0220,0110,0,
+    /* 13228 */ 0262,0111,0,01,0222,0110,0,
+    /* 13235 */ 0261,0111,0,01,0222,0100,0,
+    /* 13242 */ 0261,0111,010,01,0222,0120,0,
+    /* 13249 */ 0260,0111,010,01,0222,0110,0,
+    /* 13256 */ 0262,0111,0,01,0223,0110,0,
+    /* 13263 */ 0261,0111,0,01,0223,0100,0,
+    /* 13270 */ 0261,0111,010,01,0223,0120,0,
+    /* 13277 */ 0260,0111,010,01,0223,0110,0,
+    /* 13284 */ 0262,0111,0,01,0221,0110,0,
+    /* 13291 */ 0261,0111,0,01,0221,0100,0,
+    /* 13298 */ 0261,0111,010,01,0221,0120,0,
+    /* 13305 */ 0260,0111,010,01,0221,0110,0,
+    /* 13312 */ 0262,0111,0,01,0230,0110,0,
+    /* 13319 */ 0261,0111,0,01,0230,0100,0,
+    /* 13326 */ 0261,0111,010,01,0230,0120,0,
+    /* 13333 */ 0260,0111,010,01,0230,0110,0,
+    /* 13340 */ 0262,0111,0,01,0232,0110,0,
+    /* 13347 */ 0261,0111,0,01,0232,0100,0,
+    /* 13354 */ 0261,0111,010,01,0232,0120,0,
+    /* 13361 */ 0260,0111,010,01,0232,0110,0,
+    /* 13368 */ 0262,0111,0,01,0233,0110,0,
+    /* 13375 */ 0261,0111,0,01,0233,0100,0,
+    /* 13382 */ 0261,0111,010,01,0233,0120,0,
+    /* 13389 */ 0260,0111,010,01,0233,0110,0,
+    /* 13396 */ 0262,0111,0,01,0231,0110,0,
+    /* 13403 */ 0261,0111,0,01,0231,0100,0,
+    /* 13410 */ 0261,0111,010,01,0231,0120,0,
+    /* 13417 */ 0260,0111,010,01,0231,0110,0,
+    /* 13424 */ 0262,0111,0,01,0224,0110,0,
+    /* 13431 */ 0261,0111,0,01,0224,0100,0,
+    /* 13438 */ 0261,0111,010,01,0224,0120,0,
+    /* 13445 */ 0260,0111,010,01,0224,0110,0,
+    /* 13452 */ 0262,0111,0,01,0226,0110,0,
+    /* 13459 */ 0261,0111,0,01,0226,0100,0,
+    /* 13466 */ 0261,0111,010,01,0226,0120,0,
+    /* 13473 */ 0260,0111,010,01,0226,0110,0,
+    /* 13480 */ 0262,0111,0,01,0227,0110,0,
+    /* 13487 */ 0261,0111,0,01,0227,0100,0,
+    /* 13494 */ 0261,0111,010,01,0227,0120,0,
+    /* 13501 */ 0260,0111,010,01,0227,0110,0,
+    /* 13508 */ 0262,0111,0,01,0225,0110,0,
+    /* 13515 */ 0261,0111,0,01,0225,0100,0,
+    /* 13522 */ 0261,0111,010,01,0225,0120,0,
+    /* 13529 */ 0260,0111,010,01,0225,0110,0,
+    /* 13536 */ 0320,01,0203,0202,0275,0,
+    /* 13542 */ 0321,01,0203,0202,0275,0,
+    /* 13548 */ 0324,01,0203,0202,0275,0,
+    /* 13554 */ 0320,0145,0201,0202,0141,0,
+    /* 13560 */ 0321,0155,0201,0202,0151,0,
+    /* 13566 */ 0324,0155,0201,0202,0251,0,
+    /* 13572 */ 0320,01,0203,0200,0275,0,
+    /* 13578 */ 0321,01,0203,0200,0275,0,
+    /* 13584 */ 0324,01,0203,0200,0275,0,
+    /* 13590 */ 0320,0145,0201,0200,0141,0,
+    /* 13596 */ 0321,0155,0201,0200,0151,0,
+    /* 13602 */ 0324,0155,0201,0200,0251,0,
+    /* 13608 */ 0320,01,0203,0204,0275,0,
+    /* 13614 */ 0321,01,0203,0204,0275,0,
+    /* 13620 */ 0324,01,0203,0204,0275,0,
+    /* 13626 */ 0320,0145,0201,0204,0141,0,
+    /* 13632 */ 0321,0155,0201,0204,0151,0,
+    /* 13638 */ 0324,0155,0201,0204,0251,0,
+    /* 13644 */ 0320,02,017,0274,0110,0,
+    /* 13650 */ 0321,02,017,0274,0110,0,
+    /* 13656 */ 0324,02,017,0274,0110,0,
+    /* 13662 */ 0320,02,017,0275,0110,0,
+    /* 13668 */ 0321,02,017,0275,0110,0,
+    /* 13674 */ 0324,02,017,0275,0110,0,
+    /* 13680 */ 0321,01,017,010,0310,0,
+    /* 13686 */ 0324,01,017,010,0310,0,
+    /* 13692 */ 0320,02,017,0243,0101,0,
+    /* 13698 */ 0321,02,017,0243,0101,0,
+    /* 13704 */ 0324,02,017,0243,0101,0,
+    /* 13710 */ 0320,02,017,0273,0101,0,
+    /* 13716 */ 0321,02,017,0273,0101,0,
+    /* 13722 */ 0324,02,017,0273,0101,0,
+    /* 13728 */ 0320,02,017,0263,0101,0,
+    /* 13734 */ 0321,02,017,0263,0101,0,
+    /* 13740 */ 0324,02,017,0263,0101,0,
+    /* 13746 */ 0320,02,017,0253,0101,0,
+    /* 13752 */ 0321,02,017,0253,0101,0,
+    /* 13758 */ 0324,02,017,0253,0101,0,
+    /* 13764 */ 0322,01,0232,034,074,0,
+    /* 13770 */ 0320,01,0232,034,074,0,
+    /* 13776 */ 0321,01,0232,034,074,0,
+    /* 13782 */ 0322,01,0232,035,030,0,
+    /* 13788 */ 0320,01,0232,031,030,0,
+    /* 13794 */ 0321,01,0232,041,030,0,
+    /* 13800 */ 0320,01,0203,0207,0275,0,
+    /* 13806 */ 0321,01,0203,0207,0275,0,
+    /* 13812 */ 0324,01,0203,0207,0275,0,
+    /* 13818 */ 0320,0145,0201,0207,0141,0,
+    /* 13824 */ 0321,0155,0201,0207,0151,0,
+    /* 13830 */ 0324,0155,0201,0207,0251,0,
+    /* 13836 */ 0320,02,017,0261,0101,0,
+    /* 13842 */ 0321,02,017,0261,0101,0,
+    /* 13848 */ 0324,02,017,0261,0101,0,
+    /* 13854 */ 0320,02,017,0247,0101,0,
+    /* 13860 */ 0321,02,017,0247,0101,0,
+    /* 13866 */ 0324,02,017,0307,0201,0,
+    /* 13872 */ 0320,02,017,0257,0110,0,
+    /* 13878 */ 0321,02,017,0257,0110,0,
+    /* 13884 */ 0324,02,017,0257,0110,0,
+    /* 13890 */ 0320,01,0153,0110,016,0,
+    /* 13896 */ 0320,01,0151,0110,032,0,
+    /* 13902 */ 0320,0146,0151,0110,0142,0,
+    /* 13908 */ 0321,01,0153,0110,016,0,
+    /* 13914 */ 0321,01,0151,0110,042,0,
+    /* 13920 */ 0321,0156,0151,0110,0152,0,
+    /* 13926 */ 0324,01,0153,0110,016,0,
+    /* 13932 */ 0324,01,0151,0110,042,0,
+    /* 13938 */ 0324,0156,0151,0110,0252,0,
+    /* 13944 */ 0320,01,0153,0100,015,0,
+    /* 13950 */ 0320,01,0151,0100,031,0,
+    /* 13956 */ 0320,0145,0151,0100,0141,0,
+    /* 13962 */ 0321,01,0153,0100,015,0,
+    /* 13968 */ 0321,01,0151,0100,041,0,
+    /* 13974 */ 0321,0155,0151,0100,0151,0,
+    /* 13980 */ 0324,01,0153,0100,015,0,
+    /* 13986 */ 0324,01,0151,0100,0255,0,
+    /* 13992 */ 0324,0155,0151,0100,0251,0,
+    /* 13998 */ 0310,03,017,01,0337,0,
+    /* 14004 */ 0311,03,017,01,0337,0,
+    /* 14010 */ 0322,01,0352,034,074,0,
+    /* 14016 */ 0320,01,0352,034,074,0,
+    /* 14022 */ 0321,01,0352,034,074,0,
+    /* 14028 */ 0322,01,0352,035,030,0,
+    /* 14034 */ 0320,01,0352,031,030,0,
+    /* 14040 */ 0321,01,0352,041,030,0,
+    /* 14046 */ 0322,02,017,0270,064,0,
+    /* 14052 */ 0320,02,017,0270,064,0,
+    /* 14058 */ 0321,02,017,0270,064,0,
+    /* 14064 */ 0320,02,017,0,0206,0,
+    /* 14070 */ 0321,02,017,0,0206,0,
+    /* 14076 */ 0320,02,017,02,0110,0,
+    /* 14082 */ 0321,02,017,02,0110,0,
+    /* 14088 */ 0324,02,017,02,0110,0,
+    /* 14094 */ 0320,02,017,0264,0110,0,
+    /* 14100 */ 0321,02,017,0264,0110,0,
+    /* 14106 */ 0320,02,017,0265,0110,0,
+    /* 14112 */ 0321,02,017,0265,0110,0,
+    /* 14118 */ 0320,02,017,03,0110,0,
+    /* 14124 */ 0321,02,017,03,0110,0,
+    /* 14130 */ 0324,02,017,03,0110,0,
+    /* 14136 */ 0320,02,017,0262,0110,0,
+    /* 14142 */ 0321,02,017,0262,0110,0,
+    /* 14148 */ 0334,02,017,040,0101,0,
+    /* 14154 */ 0323,02,017,040,0101,0,
+    /* 14160 */ 0334,02,017,042,0110,0,
+    /* 14166 */ 0323,02,017,042,0110,0,
+    /* 14172 */ 0323,02,017,041,0101,0,
+    /* 14178 */ 0323,02,017,043,0110,0,
+    /* 14184 */ 0324,01,0307,0200,0255,0,
+    /* 14190 */ 0320,01,0307,0200,031,0,
+    /* 14196 */ 0321,01,0307,0200,041,0,
+    /* 14202 */ 0360,02,017,0156,0110,0,
+    /* 14208 */ 0360,02,017,0176,0101,0,
+    /* 14214 */ 0320,02,017,0276,0110,0,
+    /* 14220 */ 0321,02,017,0276,0110,0,
+    /* 14226 */ 0321,02,017,0277,0110,0,
+    /* 14232 */ 0324,02,017,0276,0110,0,
+    /* 14238 */ 0324,02,017,0277,0110,0,
+    /* 14244 */ 0320,02,017,0266,0110,0,
+    /* 14250 */ 0321,02,017,0266,0110,0,
+    /* 14256 */ 0321,02,017,0267,0110,0,
+    /* 14262 */ 0324,02,017,0266,0110,0,
+    /* 14268 */ 0324,02,017,0267,0110,0,
+    /* 14274 */ 0320,02,017,037,0200,0,
+    /* 14280 */ 0321,02,017,037,0200,0,
+    /* 14286 */ 0324,02,017,037,0200,0,
+    /* 14292 */ 0320,01,0203,0201,0275,0,
+    /* 14298 */ 0321,01,0203,0201,0275,0,
+    /* 14304 */ 0324,01,0203,0201,0275,0,
+    /* 14310 */ 0320,0145,0201,0201,0141,0,
+    /* 14316 */ 0321,0155,0201,0201,0151,0,
+    /* 14322 */ 0324,0155,0201,0201,0251,0,
+    /* 14328 */ 0323,02,017,0121,0110,0,
+    /* 14334 */ 0323,02,017,0120,0110,0,
+    /* 14340 */ 0323,02,017,0122,0110,0,
+    /* 14346 */ 0323,02,017,0135,0110,0,
+    /* 14352 */ 0323,02,017,0131,0110,0,
+    /* 14358 */ 0323,02,017,0125,0110,0,
+    /* 14364 */ 0320,01,0301,0202,025,0,
+    /* 14370 */ 0321,01,0301,0202,025,0,
+    /* 14376 */ 0324,01,0301,0202,025,0,
+    /* 14382 */ 0320,01,0301,0203,025,0,
+    /* 14388 */ 0321,01,0301,0203,025,0,
+    /* 14394 */ 0324,01,0301,0203,025,0,
+    /* 14400 */ 0321,02,017,066,0200,0,
+    /* 14406 */ 0320,01,0301,0200,025,0,
+    /* 14412 */ 0321,01,0301,0200,025,0,
+    /* 14418 */ 0324,01,0301,0200,025,0,
+    /* 14424 */ 0320,01,0301,0201,025,0,
+    /* 14430 */ 0321,01,0301,0201,025,0,
+    /* 14436 */ 0324,01,0301,0201,025,0,
+    /* 14442 */ 0320,01,0301,0204,025,0,
+    /* 14448 */ 0321,01,0301,0204,025,0,
+    /* 14454 */ 0324,01,0301,0204,025,0,
+    /* 14460 */ 0320,01,0301,0207,025,0,
+    /* 14466 */ 0321,01,0301,0207,025,0,
+    /* 14472 */ 0324,01,0301,0207,025,0,
+    /* 14478 */ 0320,01,0203,0203,0275,0,
+    /* 14484 */ 0321,01,0203,0203,0275,0,
+    /* 14490 */ 0324,01,0203,0203,0275,0,
+    /* 14496 */ 0320,0145,0201,0203,0141,0,
+    /* 14502 */ 0321,0155,0201,0203,0151,0,
+    /* 14508 */ 0324,0155,0201,0203,0251,0,
+    /* 14514 */ 0320,02,017,0245,0101,0,
+    /* 14520 */ 0321,02,017,0245,0101,0,
+    /* 14526 */ 0324,02,017,0245,0101,0,
+    /* 14532 */ 0320,01,0301,0205,025,0,
+    /* 14538 */ 0321,01,0301,0205,025,0,
+    /* 14544 */ 0324,01,0301,0205,025,0,
+    /* 14550 */ 0320,02,017,0255,0101,0,
+    /* 14556 */ 0321,02,017,0255,0101,0,
+    /* 14562 */ 0324,02,017,0255,0101,0,
+    /* 14568 */ 0320,02,017,0,0200,0,
+    /* 14574 */ 0321,02,017,0,0200,0,
+    /* 14580 */ 0323,02,017,0,0200,0,
+    /* 14586 */ 0324,02,017,0,0200,0,
+    /* 14592 */ 0320,02,017,01,0204,0,
+    /* 14598 */ 0321,02,017,01,0204,0,
+    /* 14604 */ 0320,02,017,0,0201,0,
+    /* 14610 */ 0321,02,017,0,0201,0,
+    /* 14616 */ 0324,02,017,0,0201,0,
+    /* 14622 */ 0320,01,0203,0205,0275,0,
+    /* 14628 */ 0321,01,0203,0205,0275,0,
+    /* 14634 */ 0324,01,0203,0205,0275,0,
+    /* 14640 */ 0320,0145,0201,0205,0141,0,
+    /* 14646 */ 0321,0155,0201,0205,0151,0,
+    /* 14652 */ 0324,0155,0201,0205,0251,0,
+    /* 14658 */ 0320,01,0367,0200,031,0,
+    /* 14664 */ 0321,01,0367,0200,041,0,
+    /* 14670 */ 0324,01,0367,0200,0255,0,
+    /* 14676 */ 0360,02,017,020,0101,0,
+    /* 14682 */ 0360,02,017,022,0110,0,
+    /* 14688 */ 0321,02,017,067,0200,0,
+    /* 14694 */ 0320,02,017,0301,0101,0,
+    /* 14700 */ 0321,02,017,0301,0101,0,
+    /* 14706 */ 0324,02,017,0301,0101,0,
+    /* 14712 */ 0320,02,017,0246,0110,0,
+    /* 14718 */ 0321,02,017,0246,0110,0,
+    /* 14724 */ 0320,01,0203,0206,0275,0,
+    /* 14730 */ 0321,01,0203,0206,0275,0,
+    /* 14736 */ 0324,01,0203,0206,0275,0,
+    /* 14742 */ 0320,0145,0201,0206,0141,0,
+    /* 14748 */ 0321,0155,0201,0206,0151,0,
+    /* 14754 */ 0324,0155,0201,0206,0251,0,
+    /* 14760 */ 01,017,0330,0220,0200,0,
+    /* 14766 */ 0360,02,017,0130,0110,0,
+    /* 14772 */ 0363,02,017,0130,0110,0,
+    /* 14778 */ 0360,02,017,0125,0110,0,
+    /* 14784 */ 0360,02,017,0124,0110,0,
+    /* 14790 */ 0360,02,017,057,0110,0,
+    /* 14796 */ 0360,02,017,052,0110,0,
+    /* 14802 */ 0360,02,017,055,0110,0,
+    /* 14808 */ 0360,02,017,054,0110,0,
+    /* 14814 */ 0360,02,017,0136,0110,0,
+    /* 14820 */ 0363,02,017,0136,0110,0,
+    /* 14826 */ 0360,02,017,0137,0110,0,
+    /* 14832 */ 0363,02,017,0137,0110,0,
+    /* 14838 */ 0360,02,017,0135,0110,0,
+    /* 14844 */ 0363,02,017,0135,0110,0,
+    /* 14850 */ 0360,02,017,050,0110,0,
+    /* 14856 */ 0360,02,017,051,0101,0,
+    /* 14862 */ 0360,02,017,026,0110,0,
+    /* 14868 */ 0360,02,017,027,0101,0,
+    /* 14874 */ 0360,02,017,023,0101,0,
+    /* 14880 */ 0360,02,017,0120,0110,0,
+    /* 14886 */ 0360,02,017,053,0101,0,
+    /* 14892 */ 0363,02,017,020,0110,0,
+    /* 14898 */ 0363,02,017,021,0101,0,
+    /* 14904 */ 0360,02,017,020,0110,0,
+    /* 14910 */ 0360,02,017,021,0101,0,
+    /* 14916 */ 0360,02,017,0131,0110,0,
+    /* 14922 */ 0363,02,017,0131,0110,0,
+    /* 14928 */ 0360,02,017,0126,0110,0,
+    /* 14934 */ 0360,02,017,0123,0110,0,
+    /* 14940 */ 0363,02,017,0123,0110,0,
+    /* 14946 */ 0360,02,017,0122,0110,0,
+    /* 14952 */ 0363,02,017,0122,0110,0,
+    /* 14958 */ 0360,02,017,0121,0110,0,
+    /* 14964 */ 0363,02,017,0121,0110,0,
+    /* 14970 */ 0360,02,017,0134,0110,0,
+    /* 14976 */ 0363,02,017,0134,0110,0,
+    /* 14982 */ 0360,02,017,056,0110,0,
+    /* 14988 */ 0360,02,017,025,0110,0,
+    /* 14994 */ 0360,02,017,024,0110,0,
+    /* 15000 */ 0360,02,017,0127,0110,0,
+    /* 15006 */ 0360,03,017,01,0320,0,
+    /* 15012 */ 0360,03,017,01,0321,0,
+    /* 15018 */ 0360,02,017,0256,0204,0,
+    /* 15024 */ 0360,02,017,0256,0205,0,
+    /* 15030 */ 0360,02,017,0367,0110,0,
+    /* 15036 */ 0360,02,017,0347,0101,0,
+    /* 15042 */ 0360,02,017,0327,0110,0,
+    /* 15048 */ 0361,02,017,0367,0110,0,
+    /* 15054 */ 0361,02,017,0347,0101,0,
+    /* 15060 */ 0361,02,017,053,0101,0,
+    /* 15066 */ 0361,02,017,0157,0110,0,
+    /* 15072 */ 0361,02,017,0177,0101,0,
+    /* 15078 */ 0363,02,017,0157,0110,0,
+    /* 15084 */ 0363,02,017,0177,0101,0,
+    /* 15090 */ 0362,02,017,0326,0110,0,
+    /* 15096 */ 0363,02,017,0176,0110,0,
+    /* 15102 */ 0361,02,017,0326,0101,0,
+    /* 15108 */ 0363,02,017,0326,0110,0,
+    /* 15114 */ 0361,02,017,0143,0110,0,
+    /* 15120 */ 0361,02,017,0153,0110,0,
+    /* 15126 */ 0361,02,017,0147,0110,0,
+    /* 15132 */ 0361,02,017,0374,0110,0,
+    /* 15138 */ 0361,02,017,0375,0110,0,
+    /* 15144 */ 0361,02,017,0376,0110,0,
+    /* 15150 */ 0360,02,017,0324,0110,0,
+    /* 15156 */ 0361,02,017,0324,0110,0,
+    /* 15162 */ 0361,02,017,0354,0110,0,
+    /* 15168 */ 0361,02,017,0355,0110,0,
+    /* 15174 */ 0361,02,017,0334,0110,0,
+    /* 15180 */ 0361,02,017,0335,0110,0,
+    /* 15186 */ 0361,02,017,0333,0110,0,
+    /* 15192 */ 0361,02,017,0337,0110,0,
+    /* 15198 */ 0361,02,017,0340,0110,0,
+    /* 15204 */ 0361,02,017,0343,0110,0,
+    /* 15210 */ 0361,02,017,0164,0110,0,
+    /* 15216 */ 0361,02,017,0165,0110,0,
+    /* 15222 */ 0361,02,017,0166,0110,0,
+    /* 15228 */ 0361,02,017,0144,0110,0,
+    /* 15234 */ 0361,02,017,0145,0110,0,
+    /* 15240 */ 0361,02,017,0146,0110,0,
+    /* 15246 */ 0361,02,017,0365,0110,0,
+    /* 15252 */ 0361,02,017,0356,0110,0,
+    /* 15258 */ 0361,02,017,0336,0110,0,
+    /* 15264 */ 0361,02,017,0352,0110,0,
+    /* 15270 */ 0361,02,017,0332,0110,0,
+    /* 15276 */ 0361,02,017,0327,0110,0,
+    /* 15282 */ 0361,02,017,0344,0110,0,
+    /* 15288 */ 0361,02,017,0345,0110,0,
+    /* 15294 */ 0361,02,017,0325,0110,0,
+    /* 15300 */ 0361,02,017,0364,0110,0,
+    /* 15306 */ 0361,02,017,0353,0110,0,
+    /* 15312 */ 0361,02,017,0366,0110,0,
+    /* 15318 */ 0361,02,017,0361,0110,0,
+    /* 15324 */ 0361,02,017,0362,0110,0,
+    /* 15330 */ 0361,02,017,0363,0110,0,
+    /* 15336 */ 0361,02,017,0341,0110,0,
+    /* 15342 */ 0361,02,017,0342,0110,0,
+    /* 15348 */ 0361,02,017,0321,0110,0,
+    /* 15354 */ 0361,02,017,0322,0110,0,
+    /* 15360 */ 0361,02,017,0323,0110,0,
+    /* 15366 */ 0361,02,017,0370,0110,0,
+    /* 15372 */ 0361,02,017,0371,0110,0,
+    /* 15378 */ 0361,02,017,0372,0110,0,
+    /* 15384 */ 0361,02,017,0373,0110,0,
+    /* 15390 */ 0361,02,017,0350,0110,0,
+    /* 15396 */ 0361,02,017,0351,0110,0,
+    /* 15402 */ 0361,02,017,0330,0110,0,
+    /* 15408 */ 0361,02,017,0331,0110,0,
+    /* 15414 */ 0361,02,017,0150,0110,0,
+    /* 15420 */ 0361,02,017,0151,0110,0,
+    /* 15426 */ 0361,02,017,0152,0110,0,
+    /* 15432 */ 0361,02,017,0155,0110,0,
+    /* 15438 */ 0361,02,017,0140,0110,0,
+    /* 15444 */ 0361,02,017,0141,0110,0,
+    /* 15450 */ 0361,02,017,0142,0110,0,
+    /* 15456 */ 0361,02,017,0154,0110,0,
+    /* 15462 */ 0361,02,017,0357,0110,0,
+    /* 15468 */ 0361,02,017,0130,0110,0,
+    /* 15474 */ 0362,02,017,0130,0110,0,
+    /* 15480 */ 0361,02,017,0125,0110,0,
+    /* 15486 */ 0361,02,017,0124,0110,0,
+    /* 15492 */ 0361,02,017,057,0110,0,
+    /* 15498 */ 0363,02,017,0346,0110,0,
+    /* 15504 */ 0360,02,017,0133,0110,0,
+    /* 15510 */ 0362,02,017,0346,0110,0,
+    /* 15516 */ 0361,02,017,055,0110,0,
+    /* 15522 */ 0361,02,017,0132,0110,0,
+    /* 15528 */ 0361,02,017,052,0110,0,
+    /* 15534 */ 0361,02,017,0133,0110,0,
+    /* 15540 */ 0360,02,017,0132,0110,0,
+    /* 15546 */ 0362,02,017,0132,0110,0,
+    /* 15552 */ 0363,02,017,0132,0110,0,
+    /* 15558 */ 0361,02,017,054,0110,0,
+    /* 15564 */ 0361,02,017,0346,0110,0,
+    /* 15570 */ 0363,02,017,0133,0110,0,
+    /* 15576 */ 0361,02,017,0136,0110,0,
+    /* 15582 */ 0362,02,017,0136,0110,0,
+    /* 15588 */ 0361,02,017,0137,0110,0,
+    /* 15594 */ 0362,02,017,0137,0110,0,
+    /* 15600 */ 0361,02,017,0135,0110,0,
+    /* 15606 */ 0362,02,017,0135,0110,0,
+    /* 15612 */ 0361,02,017,050,0110,0,
+    /* 15618 */ 0361,02,017,051,0101,0,
+    /* 15624 */ 0361,02,017,027,0101,0,
+    /* 15630 */ 0361,02,017,026,0110,0,
+    /* 15636 */ 0361,02,017,023,0101,0,
+    /* 15642 */ 0361,02,017,022,0110,0,
+    /* 15648 */ 0361,02,017,0120,0110,0,
+    /* 15654 */ 0362,02,017,020,0110,0,
+    /* 15660 */ 0362,02,017,021,0101,0,
+    /* 15666 */ 0361,02,017,020,0110,0,
+    /* 15672 */ 0361,02,017,021,0101,0,
+    /* 15678 */ 0361,02,017,0131,0110,0,
+    /* 15684 */ 0362,02,017,0131,0110,0,
+    /* 15690 */ 0361,02,017,0126,0110,0,
+    /* 15696 */ 0361,02,017,0121,0110,0,
+    /* 15702 */ 0362,02,017,0121,0110,0,
+    /* 15708 */ 0361,02,017,0134,0110,0,
+    /* 15714 */ 0362,02,017,0134,0110,0,
+    /* 15720 */ 0361,02,017,056,0110,0,
+    /* 15726 */ 0361,02,017,025,0110,0,
+    /* 15732 */ 0361,02,017,024,0110,0,
+    /* 15738 */ 0361,02,017,0127,0110,0,
+    /* 15744 */ 0361,02,017,0320,0110,0,
+    /* 15750 */ 0362,02,017,0320,0110,0,
+    /* 15756 */ 0361,02,017,0174,0110,0,
+    /* 15762 */ 0362,02,017,0174,0110,0,
+    /* 15768 */ 0361,02,017,0175,0110,0,
+    /* 15774 */ 0362,02,017,0175,0110,0,
+    /* 15780 */ 0362,02,017,0360,0110,0,
+    /* 15786 */ 0362,02,017,022,0110,0,
+    /* 15792 */ 0363,02,017,026,0110,0,
+    /* 15798 */ 0363,02,017,022,0110,0,
+    /* 15804 */ 0361,02,017,0307,0206,0,
+    /* 15810 */ 0363,02,017,0307,0206,0,
+    /* 15816 */ 0361,02,017,0171,0110,0,
+    /* 15822 */ 0362,02,017,0171,0110,0,
+    /* 15828 */ 0362,02,017,053,0101,0,
+    /* 15834 */ 0363,02,017,053,0101,0,
+    /* 15840 */ 0270,01,024,01,0167,0,
+    /* 15846 */ 0270,01,020,01,0167,0,
+    /* 15852 */ 0336,03,017,0247,0310,0,
+    /* 15858 */ 0336,03,017,0247,0320,0,
+    /* 15864 */ 0336,03,017,0247,0330,0,
+    /* 15870 */ 0336,03,017,0247,0340,0,
+    /* 15876 */ 0336,03,017,0247,0350,0,
+    /* 15882 */ 0336,03,017,0246,0300,0,
+    /* 15888 */ 0336,03,017,0246,0310,0,
+    /* 15894 */ 0336,03,017,0246,0320,0,
+    /* 15900 */ 0320,02,017,030,0200,0,
+    /* 15906 */ 0321,02,017,030,0200,0,
+    /* 15912 */ 0324,02,017,030,0200,0,
+    /* 15918 */ 0320,02,017,030,0201,0,
+    /* 15924 */ 0321,02,017,030,0201,0,
+    /* 15930 */ 0324,02,017,030,0201,0,
+    /* 15936 */ 0320,02,017,030,0202,0,
+    /* 15942 */ 0321,02,017,030,0202,0,
+    /* 15948 */ 0324,02,017,030,0202,0,
+    /* 15954 */ 0320,02,017,030,0203,0,
+    /* 15960 */ 0321,02,017,030,0203,0,
+    /* 15966 */ 0324,02,017,030,0203,0,
+    /* 15972 */ 0320,02,017,030,0204,0,
+    /* 15978 */ 0321,02,017,030,0204,0,
+    /* 15984 */ 0324,02,017,030,0204,0,
+    /* 15990 */ 0320,02,017,030,0205,0,
+    /* 15996 */ 0321,02,017,030,0205,0,
+    /* 16002 */ 0324,02,017,030,0205,0,
+    /* 16008 */ 0320,02,017,030,0206,0,
+    /* 16014 */ 0321,02,017,030,0206,0,
+    /* 16020 */ 0324,02,017,030,0206,0,
+    /* 16026 */ 0320,02,017,030,0207,0,
+    /* 16032 */ 0321,02,017,030,0207,0,
+    /* 16038 */ 0324,02,017,030,0207,0,
+    /* 16044 */ 0320,02,017,031,0200,0,
+    /* 16050 */ 0321,02,017,031,0200,0,
+    /* 16056 */ 0324,02,017,031,0200,0,
+    /* 16062 */ 0320,02,017,031,0201,0,
+    /* 16068 */ 0321,02,017,031,0201,0,
+    /* 16074 */ 0324,02,017,031,0201,0,
+    /* 16080 */ 0320,02,017,031,0202,0,
+    /* 16086 */ 0321,02,017,031,0202,0,
+    /* 16092 */ 0324,02,017,031,0202,0,
+    /* 16098 */ 0320,02,017,031,0203,0,
+    /* 16104 */ 0321,02,017,031,0203,0,
+    /* 16110 */ 0324,02,017,031,0203,0,
+    /* 16116 */ 0320,02,017,031,0204,0,
+    /* 16122 */ 0321,02,017,031,0204,0,
+    /* 16128 */ 0324,02,017,031,0204,0,
+    /* 16134 */ 0320,02,017,031,0205,0,
+    /* 16140 */ 0321,02,017,031,0205,0,
+    /* 16146 */ 0324,02,017,031,0205,0,
+    /* 16152 */ 0320,02,017,031,0206,0,
+    /* 16158 */ 0321,02,017,031,0206,0,
+    /* 16164 */ 0324,02,017,031,0206,0,
+    /* 16170 */ 0320,02,017,031,0207,0,
+    /* 16176 */ 0321,02,017,031,0207,0,
+    /* 16182 */ 0324,02,017,031,0207,0,
+    /* 16188 */ 0320,02,017,032,0200,0,
+    /* 16194 */ 0321,02,017,032,0200,0,
+    /* 16200 */ 0324,02,017,032,0200,0,
+    /* 16206 */ 0320,02,017,032,0201,0,
+    /* 16212 */ 0321,02,017,032,0201,0,
+    /* 16218 */ 0324,02,017,032,0201,0,
+    /* 16224 */ 0320,02,017,032,0202,0,
+    /* 16230 */ 0321,02,017,032,0202,0,
+    /* 16236 */ 0324,02,017,032,0202,0,
+    /* 16242 */ 0320,02,017,032,0203,0,
+    /* 16248 */ 0321,02,017,032,0203,0,
+    /* 16254 */ 0324,02,017,032,0203,0,
+    /* 16260 */ 0320,02,017,032,0204,0,
+    /* 16266 */ 0321,02,017,032,0204,0,
+    /* 16272 */ 0324,02,017,032,0204,0,
+    /* 16278 */ 0320,02,017,032,0205,0,
+    /* 16284 */ 0321,02,017,032,0205,0,
+    /* 16290 */ 0324,02,017,032,0205,0,
+    /* 16296 */ 0320,02,017,032,0206,0,
+    /* 16302 */ 0321,02,017,032,0206,0,
+    /* 16308 */ 0324,02,017,032,0206,0,
+    /* 16314 */ 0320,02,017,032,0207,0,
+    /* 16320 */ 0321,02,017,032,0207,0,
+    /* 16326 */ 0324,02,017,032,0207,0,
+    /* 16332 */ 0320,02,017,033,0200,0,
+    /* 16338 */ 0321,02,017,033,0200,0,
+    /* 16344 */ 0324,02,017,033,0200,0,
+    /* 16350 */ 0320,02,017,033,0201,0,
+    /* 16356 */ 0321,02,017,033,0201,0,
+    /* 16362 */ 0324,02,017,033,0201,0,
+    /* 16368 */ 0320,02,017,033,0202,0,
+    /* 16374 */ 0321,02,017,033,0202,0,
+    /* 16380 */ 0324,02,017,033,0202,0,
+    /* 16386 */ 0320,02,017,033,0203,0,
+    /* 16392 */ 0321,02,017,033,0203,0,
+    /* 16398 */ 0324,02,017,033,0203,0,
+    /* 16404 */ 0320,02,017,033,0204,0,
+    /* 16410 */ 0321,02,017,033,0204,0,
+    /* 16416 */ 0324,02,017,033,0204,0,
+    /* 16422 */ 0320,02,017,033,0205,0,
+    /* 16428 */ 0321,02,017,033,0205,0,
+    /* 16434 */ 0324,02,017,033,0205,0,
+    /* 16440 */ 0320,02,017,033,0206,0,
+    /* 16446 */ 0321,02,017,033,0206,0,
+    /* 16452 */ 0324,02,017,033,0206,0,
+    /* 16458 */ 0320,02,017,033,0207,0,
+    /* 16464 */ 0321,02,017,033,0207,0,
+    /* 16470 */ 0324,02,017,033,0207,0,
+    /* 16476 */ 0320,02,017,034,0200,0,
+    /* 16482 */ 0321,02,017,034,0200,0,
+    /* 16488 */ 0324,02,017,034,0200,0,
+    /* 16494 */ 0320,02,017,034,0201,0,
+    /* 16500 */ 0321,02,017,034,0201,0,
+    /* 16506 */ 0324,02,017,034,0201,0,
+    /* 16512 */ 0320,02,017,034,0202,0,
+    /* 16518 */ 0321,02,017,034,0202,0,
+    /* 16524 */ 0324,02,017,034,0202,0,
+    /* 16530 */ 0320,02,017,034,0203,0,
+    /* 16536 */ 0321,02,017,034,0203,0,
+    /* 16542 */ 0324,02,017,034,0203,0,
+    /* 16548 */ 0320,02,017,034,0204,0,
+    /* 16554 */ 0321,02,017,034,0204,0,
+    /* 16560 */ 0324,02,017,034,0204,0,
+    /* 16566 */ 0320,02,017,034,0205,0,
+    /* 16572 */ 0321,02,017,034,0205,0,
+    /* 16578 */ 0324,02,017,034,0205,0,
+    /* 16584 */ 0320,02,017,034,0206,0,
+    /* 16590 */ 0321,02,017,034,0206,0,
+    /* 16596 */ 0324,02,017,034,0206,0,
+    /* 16602 */ 0320,02,017,034,0207,0,
+    /* 16608 */ 0321,02,017,034,0207,0,
+    /* 16614 */ 0324,02,017,034,0207,0,
+    /* 16620 */ 0320,02,017,035,0200,0,
+    /* 16626 */ 0321,02,017,035,0200,0,
+    /* 16632 */ 0324,02,017,035,0200,0,
+    /* 16638 */ 0320,02,017,035,0201,0,
+    /* 16644 */ 0321,02,017,035,0201,0,
+    /* 16650 */ 0324,02,017,035,0201,0,
+    /* 16656 */ 0320,02,017,035,0202,0,
+    /* 16662 */ 0321,02,017,035,0202,0,
+    /* 16668 */ 0324,02,017,035,0202,0,
+    /* 16674 */ 0320,02,017,035,0203,0,
+    /* 16680 */ 0321,02,017,035,0203,0,
+    /* 16686 */ 0324,02,017,035,0203,0,
+    /* 16692 */ 0320,02,017,035,0204,0,
+    /* 16698 */ 0321,02,017,035,0204,0,
+    /* 16704 */ 0324,02,017,035,0204,0,
+    /* 16710 */ 0320,02,017,035,0205,0,
+    /* 16716 */ 0321,02,017,035,0205,0,
+    /* 16722 */ 0324,02,017,035,0205,0,
+    /* 16728 */ 0320,02,017,035,0206,0,
+    /* 16734 */ 0321,02,017,035,0206,0,
+    /* 16740 */ 0324,02,017,035,0206,0,
+    /* 16746 */ 0320,02,017,035,0207,0,
+    /* 16752 */ 0321,02,017,035,0207,0,
+    /* 16758 */ 0324,02,017,035,0207,0,
+    /* 16764 */ 0320,02,017,036,0200,0,
+    /* 16770 */ 0321,02,017,036,0200,0,
+    /* 16776 */ 0324,02,017,036,0200,0,
+    /* 16782 */ 0320,02,017,036,0201,0,
+    /* 16788 */ 0321,02,017,036,0201,0,
+    /* 16794 */ 0324,02,017,036,0201,0,
+    /* 16800 */ 0320,02,017,036,0202,0,
+    /* 16806 */ 0321,02,017,036,0202,0,
+    /* 16812 */ 0324,02,017,036,0202,0,
+    /* 16818 */ 0320,02,017,036,0203,0,
+    /* 16824 */ 0321,02,017,036,0203,0,
+    /* 16830 */ 0324,02,017,036,0203,0,
+    /* 16836 */ 0320,02,017,036,0204,0,
+    /* 16842 */ 0321,02,017,036,0204,0,
+    /* 16848 */ 0324,02,017,036,0204,0,
+    /* 16854 */ 0320,02,017,036,0205,0,
+    /* 16860 */ 0321,02,017,036,0205,0,
+    /* 16866 */ 0324,02,017,036,0205,0,
+    /* 16872 */ 0320,02,017,036,0206,0,
+    /* 16878 */ 0321,02,017,036,0206,0,
+    /* 16884 */ 0324,02,017,036,0206,0,
+    /* 16890 */ 0320,02,017,036,0207,0,
+    /* 16896 */ 0321,02,017,036,0207,0,
+    /* 16902 */ 0324,02,017,036,0207,0,
+    /* 16908 */ 0320,02,017,037,0201,0,
+    /* 16914 */ 0321,02,017,037,0201,0,
+    /* 16920 */ 0324,02,017,037,0201,0,
+    /* 16926 */ 0320,02,017,037,0202,0,
+    /* 16932 */ 0321,02,017,037,0202,0,
+    /* 16938 */ 0324,02,017,037,0202,0,
+    /* 16944 */ 0320,02,017,037,0203,0,
+    /* 16950 */ 0321,02,017,037,0203,0,
+    /* 16956 */ 0324,02,017,037,0203,0,
+    /* 16962 */ 0320,02,017,037,0204,0,
+    /* 16968 */ 0321,02,017,037,0204,0,
+    /* 16974 */ 0324,02,017,037,0204,0,
+    /* 16980 */ 0320,02,017,037,0205,0,
+    /* 16986 */ 0321,02,017,037,0205,0,
+    /* 16992 */ 0324,02,017,037,0205,0,
+    /* 16998 */ 0320,02,017,037,0206,0,
+    /* 17004 */ 0321,02,017,037,0206,0,
+    /* 17010 */ 0324,02,017,037,0206,0,
+    /* 17016 */ 0320,02,017,037,0207,0,
+    /* 17022 */ 0321,02,017,037,0207,0,
+    /* 17028 */ 0324,02,017,037,0207,0,
+    /* 17034 */ 0320,01,021,0101,0,
+    /* 17039 */ 0321,01,021,0101,0,
+    /* 17044 */ 0324,01,021,0101,0,
+    /* 17049 */ 0320,01,023,0110,0,
+    /* 17054 */ 0321,01,023,0110,0,
+    /* 17059 */ 0324,01,023,0110,0,
+    /* 17064 */ 0320,01,025,031,0,
+    /* 17069 */ 0321,01,025,041,0,
+    /* 17074 */ 0324,01,025,0255,0,
+    /* 17079 */ 01,0200,0202,021,0,
+    /* 17084 */ 0320,01,01,0101,0,
+    /* 17089 */ 0321,01,01,0101,0,
+    /* 17094 */ 0324,01,01,0101,0,
+    /* 17099 */ 0320,01,03,0110,0,
+    /* 17104 */ 0321,01,03,0110,0,
+    /* 17109 */ 0324,01,03,0110,0,
+    /* 17114 */ 0320,01,05,031,0,
+    /* 17119 */ 0321,01,05,041,0,
+    /* 17124 */ 0324,01,05,0255,0,
+    /* 17129 */ 01,0200,0200,021,0,
+    /* 17134 */ 0320,01,041,0101,0,
+    /* 17139 */ 0321,01,041,0101,0,
+    /* 17144 */ 0324,01,041,0101,0,
+    /* 17149 */ 0320,01,043,0110,0,
+    /* 17154 */ 0321,01,043,0110,0,
+    /* 17159 */ 0324,01,043,0110,0,
+    /* 17164 */ 0320,01,045,031,0,
+    /* 17169 */ 0321,01,045,041,0,
+    /* 17174 */ 0324,01,045,0255,0,
+    /* 17179 */ 01,0200,0204,021,0,
+    /* 17184 */ 0320,01,0142,0110,0,
+    /* 17189 */ 0321,01,0142,0110,0,
+    /* 17194 */ 0322,01,0350,064,0,
+    /* 17199 */ 0320,01,0350,064,0,
+    /* 17204 */ 0321,01,0350,064,0,
+    /* 17209 */ 0322,01,0377,0203,0,
+    /* 17214 */ 0324,01,0377,0203,0,
+    /* 17219 */ 0320,01,0377,0203,0,
+    /* 17224 */ 0321,01,0377,0203,0,
+    /* 17229 */ 0322,01,0377,0202,0,
+    /* 17234 */ 0320,01,0377,0202,0,
+    /* 17239 */ 0321,01,0377,0202,0,
+    /* 17244 */ 0324,01,0377,0202,0,
+    /* 17249 */ 0323,01,0377,0202,0,
+    /* 17254 */ 03,017,01,0335,0,
+    /* 17259 */ 0320,01,071,0101,0,
+    /* 17264 */ 0321,01,071,0101,0,
+    /* 17269 */ 0324,01,071,0101,0,
+    /* 17274 */ 0320,01,073,0110,0,
+    /* 17279 */ 0321,01,073,0110,0,
+    /* 17284 */ 0324,01,073,0110,0,
+    /* 17289 */ 0320,01,075,031,0,
+    /* 17294 */ 0321,01,075,041,0,
+    /* 17299 */ 0324,01,075,0255,0,
+    /* 17304 */ 01,0200,0207,021,0,
+    /* 17309 */ 0335,0321,01,0247,0,
+    /* 17314 */ 0335,0324,01,0247,0,
+    /* 17319 */ 0335,0320,01,0247,0,
+    /* 17324 */ 02,017,0260,0101,0,
+    /* 17329 */ 02,017,0246,0101,0,
+    /* 17334 */ 0320,01,0377,0201,0,
+    /* 17339 */ 0321,01,0377,0201,0,
+    /* 17344 */ 0324,01,0377,0201,0,
+    /* 17349 */ 0320,01,0367,0206,0,
+    /* 17354 */ 0321,01,0367,0206,0,
+    /* 17359 */ 0324,01,0367,0206,0,
+    /* 17364 */ 01,0310,030,025,0,
+    /* 17369 */ 01,0334,010,0300,0,
+    /* 17374 */ 01,0330,010,0300,0,
+    /* 17379 */ 01,0330,011,0300,0,
+    /* 17384 */ 01,0336,010,0300,0,
+    /* 17389 */ 0341,02,0333,0342,0,
+    /* 17394 */ 01,0332,010,0300,0,
+    /* 17399 */ 01,0332,011,0300,0,
+    /* 17404 */ 01,0332,010,0320,0,
+    /* 17409 */ 01,0332,011,0320,0,
+    /* 17414 */ 01,0332,010,0310,0,
+    /* 17419 */ 01,0332,011,0310,0,
+    /* 17424 */ 01,0333,010,0300,0,
+    /* 17429 */ 01,0333,011,0300,0,
+    /* 17434 */ 01,0333,010,0320,0,
+    /* 17439 */ 01,0333,011,0320,0,
+    /* 17444 */ 01,0333,010,0310,0,
+    /* 17449 */ 01,0333,011,0310,0,
+    /* 17454 */ 01,0333,010,0330,0,
+    /* 17459 */ 01,0333,011,0330,0,
+    /* 17464 */ 01,0332,010,0330,0,
+    /* 17469 */ 01,0332,011,0330,0,
+    /* 17474 */ 01,0330,010,0320,0,
+    /* 17479 */ 01,0330,011,0320,0,
+    /* 17484 */ 01,0333,010,0360,0,
+    /* 17489 */ 01,0333,011,0360,0,
+    /* 17494 */ 01,0337,010,0360,0,
+    /* 17499 */ 01,0337,011,0360,0,
+    /* 17504 */ 01,0330,010,0330,0,
+    /* 17509 */ 01,0330,011,0330,0,
+    /* 17514 */ 0341,02,0333,0341,0,
+    /* 17519 */ 01,0334,010,0370,0,
+    /* 17524 */ 01,0330,010,0360,0,
+    /* 17529 */ 01,0330,011,0360,0,
+    /* 17534 */ 01,0336,010,0370,0,
+    /* 17539 */ 01,0334,010,0360,0,
+    /* 17544 */ 01,0330,010,0370,0,
+    /* 17549 */ 01,0330,011,0370,0,
+    /* 17554 */ 01,0336,010,0360,0,
+    /* 17559 */ 0341,02,0333,0340,0,
+    /* 17564 */ 01,0335,010,0300,0,
+    /* 17569 */ 01,0337,010,0300,0,
+    /* 17574 */ 0341,02,0333,0343,0,
+    /* 17579 */ 01,0331,010,0300,0,
+    /* 17584 */ 01,0334,010,0310,0,
+    /* 17589 */ 01,0330,010,0310,0,
+    /* 17594 */ 01,0330,011,0310,0,
+    /* 17599 */ 01,0336,010,0310,0,
+    /* 17604 */ 0341,01,0335,0206,0,
+    /* 17609 */ 01,0335,010,0320,0,
+    /* 17614 */ 0341,01,0331,0207,0,
+    /* 17619 */ 0341,01,0331,0206,0,
+    /* 17624 */ 01,0335,010,0330,0,
+    /* 17629 */ 0341,01,0335,0207,0,
+    /* 17634 */ 0341,02,0337,0340,0,
+    /* 17639 */ 01,0334,010,0350,0,
+    /* 17644 */ 01,0330,010,0340,0,
+    /* 17649 */ 01,0330,011,0340,0,
+    /* 17654 */ 01,0336,010,0350,0,
+    /* 17659 */ 01,0334,010,0340,0,
+    /* 17664 */ 01,0330,010,0350,0,
+    /* 17669 */ 01,0330,011,0350,0,
+    /* 17674 */ 01,0336,010,0340,0,
+    /* 17679 */ 01,0335,010,0340,0,
+    /* 17684 */ 01,0335,011,0340,0,
+    /* 17689 */ 01,0333,010,0350,0,
+    /* 17694 */ 01,0333,011,0350,0,
+    /* 17699 */ 01,0337,010,0350,0,
+    /* 17704 */ 01,0337,011,0350,0,
+    /* 17709 */ 01,0335,010,0350,0,
+    /* 17714 */ 01,0335,011,0350,0,
+    /* 17719 */ 01,0331,010,0310,0,
+    /* 17724 */ 01,0331,011,0310,0,
+    /* 17729 */ 0320,01,0367,0207,0,
+    /* 17734 */ 0321,01,0367,0207,0,
+    /* 17739 */ 0324,01,0367,0207,0,
+    /* 17744 */ 0320,01,0367,0205,0,
+    /* 17749 */ 0321,01,0367,0205,0,
+    /* 17754 */ 0324,01,0367,0205,0,
+    /* 17759 */ 0320,01,0345,025,0,
+    /* 17764 */ 0321,01,0345,025,0,
+    /* 17769 */ 0320,01,0377,0200,0,
+    /* 17774 */ 0321,01,0377,0200,0,
+    /* 17779 */ 0324,01,0377,0200,0,
+    /* 17784 */ 02,017,01,0207,0,
+    /* 17789 */ 0310,01,0343,050,0,
+    /* 17794 */ 0311,01,0343,050,0,
+    /* 17799 */ 0313,01,0343,050,0,
+    /* 17804 */ 0371,01,0353,050,0,
+    /* 17809 */ 0322,01,0351,064,0,
+    /* 17814 */ 0320,01,0351,064,0,
+    /* 17819 */ 0321,01,0351,064,0,
+    /* 17824 */ 0322,01,0377,0205,0,
+    /* 17829 */ 0324,01,0377,0205,0,
+    /* 17834 */ 0320,01,0377,0205,0,
+    /* 17839 */ 0321,01,0377,0205,0,
+    /* 17844 */ 0322,01,0377,0204,0,
+    /* 17849 */ 0320,01,0377,0204,0,
+    /* 17854 */ 0321,01,0377,0204,0,
+    /* 17859 */ 0323,01,0377,0204,0,
+    /* 17864 */ 0320,01,0305,0110,0,
+    /* 17869 */ 0321,01,0305,0110,0,
+    /* 17874 */ 0320,01,0215,0110,0,
+    /* 17879 */ 0321,01,0215,0110,0,
+    /* 17884 */ 0324,01,0215,0110,0,
+    /* 17889 */ 0320,01,0304,0110,0,
+    /* 17894 */ 0321,01,0304,0110,0,
+    /* 17899 */ 03,017,0256,0350,0,
+    /* 17904 */ 02,017,01,0202,0,
+    /* 17909 */ 02,017,01,0203,0,
+    /* 17914 */ 02,017,0,0202,0,
+    /* 17919 */ 02,017,01,0206,0,
+    /* 17924 */ 0312,01,0342,050,0,
+    /* 17929 */ 0310,01,0342,050,0,
+    /* 17934 */ 0311,01,0342,050,0,
+    /* 17939 */ 0313,01,0342,050,0,
+    /* 17944 */ 0312,01,0341,050,0,
+    /* 17949 */ 0310,01,0341,050,0,
+    /* 17954 */ 0311,01,0341,050,0,
+    /* 17959 */ 0313,01,0341,050,0,
+    /* 17964 */ 0312,01,0340,050,0,
+    /* 17969 */ 0310,01,0340,050,0,
+    /* 17974 */ 0311,01,0340,050,0,
+    /* 17979 */ 0313,01,0340,050,0,
+    /* 17984 */ 02,017,0,0203,0,
+    /* 17989 */ 03,017,0256,0360,0,
+    /* 17994 */ 03,017,01,0310,0,
+    /* 17999 */ 0320,01,0214,0101,0,
+    /* 18004 */ 0321,01,0214,0101,0,
+    /* 18009 */ 0320,01,0241,045,0,
+    /* 18014 */ 0321,01,0241,045,0,
+    /* 18019 */ 0324,01,0241,045,0,
+    /* 18024 */ 0320,01,0243,044,0,
+    /* 18029 */ 0321,01,0243,044,0,
+    /* 18034 */ 0324,01,0243,044,0,
+    /* 18039 */ 02,017,044,0101,0,
+    /* 18044 */ 02,017,046,0110,0,
+    /* 18049 */ 0320,01,0211,0101,0,
+    /* 18054 */ 0321,01,0211,0101,0,
+    /* 18059 */ 0324,01,0211,0101,0,
+    /* 18064 */ 0320,01,0213,0110,0,
+    /* 18069 */ 0321,01,0213,0110,0,
+    /* 18074 */ 0324,01,0213,0110,0,
+    /* 18079 */ 0320,010,0270,031,0,
+    /* 18084 */ 0321,010,0270,041,0,
+    /* 18089 */ 0324,010,0270,055,0,
+    /* 18094 */ 01,0306,0200,021,0,
+    /* 18099 */ 0324,01,0143,0110,0,
+    /* 18104 */ 0320,01,0367,0204,0,
+    /* 18109 */ 0321,01,0367,0204,0,
+    /* 18114 */ 0324,01,0367,0204,0,
+    /* 18119 */ 03,017,01,0311,0,
+    /* 18124 */ 0320,01,0367,0203,0,
+    /* 18129 */ 0321,01,0367,0203,0,
+    /* 18134 */ 0324,01,0367,0203,0,
+    /* 18139 */ 0320,01,0367,0202,0,
+    /* 18144 */ 0321,01,0367,0202,0,
+    /* 18149 */ 0324,01,0367,0202,0,
+    /* 18154 */ 0320,01,011,0101,0,
+    /* 18159 */ 0321,01,011,0101,0,
+    /* 18164 */ 0324,01,011,0101,0,
+    /* 18169 */ 0320,01,013,0110,0,
+    /* 18174 */ 0321,01,013,0110,0,
+    /* 18179 */ 0324,01,013,0110,0,
+    /* 18184 */ 0320,01,015,031,0,
+    /* 18189 */ 0321,01,015,041,0,
+    /* 18194 */ 0324,01,015,0255,0,
+    /* 18199 */ 01,0200,0201,021,0,
+    /* 18204 */ 0320,01,0347,024,0,
+    /* 18209 */ 0321,01,0347,024,0,
+    /* 18214 */ 0314,0333,01,0220,0,
+    /* 18219 */ 0320,01,0217,0200,0,
+    /* 18224 */ 0321,01,0217,0200,0,
+    /* 18229 */ 0323,01,0217,0200,0,
+    /* 18234 */ 02,017,015,0200,0,
+    /* 18239 */ 02,017,015,0201,0,
+    /* 18244 */ 0320,01,0377,0206,0,
+    /* 18249 */ 0321,01,0377,0206,0,
+    /* 18254 */ 0323,01,0377,0206,0,
+    /* 18259 */ 0320,0144,0150,0140,0,
+    /* 18264 */ 0321,0154,0150,0150,0,
+    /* 18269 */ 0323,0154,0150,0250,0,
+    /* 18274 */ 01,0300,0202,025,0,
+    /* 18279 */ 0320,01,0321,0202,0,
+    /* 18284 */ 0320,01,0323,0202,0,
+    /* 18289 */ 0321,01,0321,0202,0,
+    /* 18294 */ 0321,01,0323,0202,0,
+    /* 18299 */ 0324,01,0321,0202,0,
+    /* 18304 */ 0324,01,0323,0202,0,
+    /* 18309 */ 01,0300,0203,025,0,
+    /* 18314 */ 0320,01,0321,0203,0,
+    /* 18319 */ 0320,01,0323,0203,0,
+    /* 18324 */ 0321,01,0321,0203,0,
+    /* 18329 */ 0321,01,0323,0203,0,
+    /* 18334 */ 0324,01,0321,0203,0,
+    /* 18339 */ 0324,01,0323,0203,0,
+    /* 18344 */ 03,017,01,0371,0,
+    /* 18349 */ 01,0300,0200,025,0,
+    /* 18354 */ 0320,01,0321,0200,0,
+    /* 18359 */ 0320,01,0323,0200,0,
+    /* 18364 */ 0321,01,0321,0200,0,
+    /* 18369 */ 0321,01,0323,0200,0,
+    /* 18374 */ 0324,01,0321,0200,0,
+    /* 18379 */ 0324,01,0323,0200,0,
+    /* 18384 */ 01,0300,0201,025,0,
+    /* 18389 */ 0320,01,0321,0201,0,
+    /* 18394 */ 0320,01,0323,0201,0,
+    /* 18399 */ 0321,01,0321,0201,0,
+    /* 18404 */ 0321,01,0323,0201,0,
+    /* 18409 */ 0324,01,0321,0201,0,
+    /* 18414 */ 0324,01,0323,0201,0,
+    /* 18419 */ 02,017,0173,0200,0,
+    /* 18424 */ 02,017,0175,0200,0,
+    /* 18429 */ 01,0300,0204,025,0,
+    /* 18434 */ 0320,01,0321,0204,0,
+    /* 18439 */ 0320,01,0323,0204,0,
+    /* 18444 */ 0321,01,0321,0204,0,
+    /* 18449 */ 0321,01,0323,0204,0,
+    /* 18454 */ 0324,01,0321,0204,0,
+    /* 18459 */ 0324,01,0323,0204,0,
+    /* 18464 */ 01,0300,0207,025,0,
+    /* 18469 */ 0320,01,0321,0207,0,
+    /* 18474 */ 0320,01,0323,0207,0,
+    /* 18479 */ 0321,01,0321,0207,0,
+    /* 18484 */ 0321,01,0323,0207,0,
+    /* 18489 */ 0324,01,0321,0207,0,
+    /* 18494 */ 0324,01,0323,0207,0,
+    /* 18499 */ 0320,01,031,0101,0,
+    /* 18504 */ 0321,01,031,0101,0,
+    /* 18509 */ 0324,01,031,0101,0,
+    /* 18514 */ 0320,01,033,0110,0,
+    /* 18519 */ 0321,01,033,0110,0,
+    /* 18524 */ 0324,01,033,0110,0,
+    /* 18529 */ 0320,01,035,031,0,
+    /* 18534 */ 0321,01,035,041,0,
+    /* 18539 */ 0324,01,035,0255,0,
+    /* 18544 */ 01,0200,0203,021,0,
+    /* 18549 */ 0335,0321,01,0257,0,
+    /* 18554 */ 0335,0324,01,0257,0,
+    /* 18559 */ 0335,0320,01,0257,0,
+    /* 18564 */ 03,017,0256,0370,0,
+    /* 18569 */ 02,017,01,0200,0,
+    /* 18574 */ 01,0300,0205,025,0,
+    /* 18579 */ 0320,01,0321,0205,0,
+    /* 18584 */ 0320,01,0323,0205,0,
+    /* 18589 */ 0321,01,0321,0205,0,
+    /* 18594 */ 0321,01,0323,0205,0,
+    /* 18599 */ 0324,01,0321,0205,0,
+    /* 18604 */ 0324,01,0323,0205,0,
+    /* 18609 */ 02,017,01,0201,0,
+    /* 18614 */ 03,017,01,0336,0,
+    /* 18619 */ 03,017,01,0334,0,
+    /* 18624 */ 0320,01,051,0101,0,
+    /* 18629 */ 0321,01,051,0101,0,
+    /* 18634 */ 0324,01,051,0101,0,
+    /* 18639 */ 0320,01,053,0110,0,
+    /* 18644 */ 0321,01,053,0110,0,
+    /* 18649 */ 0324,01,053,0110,0,
+    /* 18654 */ 0320,01,055,031,0,
+    /* 18659 */ 0321,01,055,041,0,
+    /* 18664 */ 0324,01,055,0255,0,
+    /* 18669 */ 01,0200,0205,021,0,
+    /* 18674 */ 02,017,0172,0200,0,
+    /* 18679 */ 02,017,0174,0200,0,
+    /* 18684 */ 03,017,01,0370,0,
+    /* 18689 */ 0320,01,0205,0101,0,
+    /* 18694 */ 0321,01,0205,0101,0,
+    /* 18699 */ 0324,01,0205,0101,0,
+    /* 18704 */ 0320,01,0205,0110,0,
+    /* 18709 */ 0321,01,0205,0110,0,
+    /* 18714 */ 0324,01,0205,0110,0,
+    /* 18719 */ 0320,01,0251,031,0,
+    /* 18724 */ 0321,01,0251,041,0,
+    /* 18729 */ 0324,01,0251,0255,0,
+    /* 18734 */ 01,0366,0200,021,0,
+    /* 18739 */ 02,017,0,0204,0,
+    /* 18744 */ 02,017,0,0205,0,
+    /* 18749 */ 02,017,0300,0101,0,
+    /* 18754 */ 0320,01,0207,0110,0,
+    /* 18759 */ 0321,01,0207,0110,0,
+    /* 18764 */ 0324,01,0207,0110,0,
+    /* 18769 */ 0320,01,0207,0101,0,
+    /* 18774 */ 0321,01,0207,0101,0,
+    /* 18779 */ 0324,01,0207,0101,0,
+    /* 18784 */ 0320,01,061,0101,0,
+    /* 18789 */ 0321,01,061,0101,0,
+    /* 18794 */ 0324,01,061,0101,0,
+    /* 18799 */ 0320,01,063,0110,0,
+    /* 18804 */ 0321,01,063,0110,0,
+    /* 18809 */ 0324,01,063,0110,0,
+    /* 18814 */ 0320,01,065,031,0,
+    /* 18819 */ 0321,01,065,041,0,
+    /* 18824 */ 0324,01,065,0255,0,
+    /* 18829 */ 01,0200,0206,021,0,
+    /* 18834 */ 0370,0330,0160,050,0,
+    /* 18839 */ 02,017,0256,0202,0,
+    /* 18844 */ 02,017,0256,0203,0,
+    /* 18849 */ 02,017,0256,0201,0,
+    /* 18854 */ 02,017,0256,0200,0,
+    /* 18859 */ 02,017,0256,0207,0,
+    /* 18864 */ 03,017,01,0301,0,
+    /* 18869 */ 03,017,01,0302,0,
+    /* 18874 */ 03,017,01,0332,0,
+    /* 18879 */ 03,017,01,0331,0,
+    /* 18884 */ 02,017,0307,0207,0,
+    /* 18889 */ 03,017,01,0303,0,
+    /* 18894 */ 03,017,01,0330,0,
+    /* 18899 */ 03,017,01,0333,0,
+    /* 18904 */ 03,017,01,0304,0,
+    /* 18909 */ 03,017,0247,0300,0,
+    /* 18914 */ 02,0325,012,0,
+    /* 18918 */ 01,0325,024,0,
+    /* 18922 */ 02,0324,012,0,
+    /* 18926 */ 01,0324,024,0,
+    /* 18930 */ 01,020,0101,0,
+    /* 18934 */ 01,024,021,0,
+    /* 18938 */ 01,0,0101,0,
+    /* 18942 */ 01,04,021,0,
+    /* 18946 */ 01,040,0101,0,
+    /* 18950 */ 01,044,021,0,
+    /* 18954 */ 01,0143,0101,0,
+    /* 18958 */ 02,017,072,0,
+    /* 18962 */ 02,017,073,0,
+    /* 18966 */ 0320,01,0230,0,
+    /* 18970 */ 0321,01,0231,0,
+    /* 18974 */ 0324,01,0230,0,
+    /* 18978 */ 02,017,06,0,
+    /* 18982 */ 01,070,0101,0,
+    /* 18986 */ 01,074,021,0,
+    /* 18990 */ 0335,01,0246,0,
+    /* 18994 */ 02,017,0242,0,
+    /* 18998 */ 02,017,075,0,
+    /* 19002 */ 02,017,074,0,
+    /* 19006 */ 0324,01,0231,0,
+    /* 19010 */ 0320,01,0231,0,
+    /* 19014 */ 0321,01,0230,0,
+    /* 19018 */ 0320,010,0110,0,
+    /* 19022 */ 0321,010,0110,0,
+    /* 19026 */ 01,0376,0201,0,
+    /* 19030 */ 01,0366,0206,0,
+    /* 19034 */ 02,017,071,0,
+    /* 19038 */ 02,017,0167,0,
+    /* 19042 */ 02,0331,0360,0,
+    /* 19046 */ 02,0331,0341,0,
+    /* 19050 */ 01,0330,0200,0,
+    /* 19054 */ 01,0334,0200,0,
+    /* 19058 */ 02,0336,0301,0,
+    /* 19062 */ 01,0337,0204,0,
+    /* 19066 */ 01,0337,0206,0,
+    /* 19070 */ 02,0331,0340,0,
+    /* 19074 */ 02,0332,0301,0,
+    /* 19078 */ 02,0332,0321,0,
+    /* 19082 */ 02,0332,0311,0,
+    /* 19086 */ 02,0333,0301,0,
+    /* 19090 */ 02,0333,0321,0,
+    /* 19094 */ 02,0333,0311,0,
+    /* 19098 */ 02,0333,0331,0,
+    /* 19102 */ 02,0332,0331,0,
+    /* 19106 */ 01,0330,0202,0,
+    /* 19110 */ 01,0334,0202,0,
+    /* 19114 */ 02,0330,0321,0,
+    /* 19118 */ 02,0333,0361,0,
+    /* 19122 */ 02,0337,0361,0,
+    /* 19126 */ 01,0330,0203,0,
+    /* 19130 */ 01,0334,0203,0,
+    /* 19134 */ 02,0330,0331,0,
+    /* 19138 */ 02,0336,0331,0,
+    /* 19142 */ 02,0331,0377,0,
+    /* 19146 */ 02,0331,0366,0,
+    /* 19150 */ 01,0330,0206,0,
+    /* 19154 */ 01,0334,0206,0,
+    /* 19158 */ 02,0336,0371,0,
+    /* 19162 */ 01,0330,0207,0,
+    /* 19166 */ 01,0334,0207,0,
+    /* 19170 */ 02,0336,0361,0,
+    /* 19174 */ 02,017,016,0,
+    /* 19178 */ 02,0335,0301,0,
+    /* 19182 */ 02,0337,0301,0,
+    /* 19186 */ 01,0332,0200,0,
+    /* 19190 */ 01,0336,0200,0,
+    /* 19194 */ 01,0332,0202,0,
+    /* 19198 */ 01,0336,0202,0,
+    /* 19202 */ 01,0332,0203,0,
+    /* 19206 */ 01,0336,0203,0,
+    /* 19210 */ 01,0332,0206,0,
+    /* 19214 */ 01,0336,0206,0,
+    /* 19218 */ 01,0332,0207,0,
+    /* 19222 */ 01,0336,0207,0,
+    /* 19226 */ 01,0333,0200,0,
+    /* 19230 */ 01,0337,0200,0,
+    /* 19234 */ 01,0337,0205,0,
+    /* 19238 */ 01,0332,0201,0,
+    /* 19242 */ 01,0336,0201,0,
+    /* 19246 */ 02,0331,0367,0,
+    /* 19250 */ 01,0333,0202,0,
+    /* 19254 */ 01,0337,0202,0,
+    /* 19258 */ 01,0333,0203,0,
+    /* 19262 */ 01,0337,0203,0,
+    /* 19266 */ 01,0337,0207,0,
+    /* 19270 */ 01,0337,0201,0,
+    /* 19274 */ 01,0333,0201,0,
+    /* 19278 */ 01,0335,0201,0,
+    /* 19282 */ 01,0332,0204,0,
+    /* 19286 */ 01,0336,0204,0,
+    /* 19290 */ 01,0332,0205,0,
+    /* 19294 */ 01,0336,0205,0,
+    /* 19298 */ 01,0331,0200,0,
+    /* 19302 */ 01,0335,0200,0,
+    /* 19306 */ 01,0333,0205,0,
+    /* 19310 */ 02,0331,0301,0,
+    /* 19314 */ 02,0331,0350,0,
+    /* 19318 */ 01,0331,0205,0,
+    /* 19322 */ 01,0331,0204,0,
+    /* 19326 */ 02,0331,0352,0,
+    /* 19330 */ 02,0331,0351,0,
+    /* 19334 */ 02,0331,0354,0,
+    /* 19338 */ 02,0331,0355,0,
+    /* 19342 */ 02,0331,0353,0,
+    /* 19346 */ 02,0331,0356,0,
+    /* 19350 */ 01,0330,0201,0,
+    /* 19354 */ 01,0334,0201,0,
+    /* 19358 */ 02,0336,0311,0,
+    /* 19362 */ 02,0331,0320,0,
+    /* 19366 */ 02,0331,0363,0,
+    /* 19370 */ 02,0331,0370,0,
+    /* 19374 */ 02,0331,0365,0,
+    /* 19378 */ 02,0331,0362,0,
+    /* 19382 */ 02,0331,0374,0,
+    /* 19386 */ 01,0335,0204,0,
+    /* 19390 */ 02,0331,0375,0,
+    /* 19394 */ 02,0333,0344,0,
+    /* 19398 */ 02,0331,0376,0,
+    /* 19402 */ 02,0331,0373,0,
+    /* 19406 */ 02,0331,0372,0,
+    /* 19410 */ 01,0331,0202,0,
+    /* 19414 */ 01,0335,0202,0,
+    /* 19418 */ 02,0335,0321,0,
+    /* 19422 */ 01,0331,0203,0,
+    /* 19426 */ 01,0335,0203,0,
+    /* 19430 */ 01,0333,0207,0,
+    /* 19434 */ 02,0335,0331,0,
+    /* 19438 */ 01,0330,0204,0,
+    /* 19442 */ 01,0334,0204,0,
+    /* 19446 */ 02,0336,0351,0,
+    /* 19450 */ 01,0330,0205,0,
+    /* 19454 */ 01,0334,0205,0,
+    /* 19458 */ 02,0336,0341,0,
+    /* 19462 */ 02,0331,0344,0,
+    /* 19466 */ 02,0335,0341,0,
+    /* 19470 */ 02,0333,0351,0,
+    /* 19474 */ 02,0337,0351,0,
+    /* 19478 */ 02,0335,0351,0,
+    /* 19482 */ 02,0332,0351,0,
+    /* 19486 */ 02,0331,0345,0,
+    /* 19490 */ 02,0331,0311,0,
+    /* 19494 */ 02,0331,0364,0,
+    /* 19498 */ 02,0331,0361,0,
+    /* 19502 */ 02,0331,0371,0,
+    /* 19506 */ 01,0366,0207,0,
+    /* 19510 */ 01,0366,0205,0,
+    /* 19514 */ 01,0344,025,0,
+    /* 19518 */ 0320,01,0355,0,
+    /* 19522 */ 0321,01,0355,0,
+    /* 19526 */ 0320,010,0100,0,
+    /* 19530 */ 0321,010,0100,0,
+    /* 19534 */ 01,0376,0200,0,
+    /* 19538 */ 0321,01,0155,0,
+    /* 19542 */ 0320,01,0155,0,
+    /* 19546 */ 01,0315,024,0,
+    /* 19550 */ 02,017,010,0,
+    /* 19554 */ 0322,01,0317,0,
+    /* 19558 */ 0321,01,0317,0,
+    /* 19562 */ 0324,01,0317,0,
+    /* 19566 */ 0320,01,0317,0,
+    /* 19570 */ 02,017,07,0,
+    /* 19574 */ 02,017,05,0,
+    /* 19578 */ 0321,01,0255,0,
+    /* 19582 */ 0324,01,0255,0,
+    /* 19586 */ 0320,01,0255,0,
+    /* 19590 */ 01,0216,0110,0,
+    /* 19594 */ 01,0240,045,0,
+    /* 19598 */ 01,0242,044,0,
+    /* 19602 */ 01,0210,0101,0,
+    /* 19606 */ 01,0212,0110,0,
+    /* 19610 */ 010,0260,021,0,
+    /* 19614 */ 0321,01,0245,0,
+    /* 19618 */ 0324,01,0245,0,
+    /* 19622 */ 0320,01,0245,0,
+    /* 19626 */ 01,0366,0204,0,
+    /* 19630 */ 01,0366,0203,0,
+    /* 19634 */ 0314,01,0220,0,
+    /* 19638 */ 01,0366,0202,0,
+    /* 19642 */ 01,010,0101,0,
+    /* 19646 */ 01,014,021,0,
+    /* 19650 */ 01,0346,024,0,
+    /* 19654 */ 0320,01,0357,0,
+    /* 19658 */ 0321,01,0357,0,
+    /* 19662 */ 0321,01,0157,0,
+    /* 19666 */ 0320,01,0157,0,
+    /* 19670 */ 0320,010,0130,0,
+    /* 19674 */ 0321,010,0130,0,
+    /* 19678 */ 0323,010,0130,0,
+    /* 19682 */ 01,017,0347,0,
+    /* 19686 */ 0322,01,0141,0,
+    /* 19690 */ 0321,01,0141,0,
+    /* 19694 */ 0320,01,0141,0,
+    /* 19698 */ 0322,01,0235,0,
+    /* 19702 */ 0321,01,0235,0,
+    /* 19706 */ 0320,01,0235,0,
+    /* 19710 */ 0320,010,0120,0,
+    /* 19714 */ 0321,010,0120,0,
+    /* 19718 */ 0323,010,0120,0,
+    /* 19722 */ 01,017,0346,0,
+    /* 19726 */ 01,0152,0274,0,
+    /* 19730 */ 0322,01,0140,0,
+    /* 19734 */ 0321,01,0140,0,
+    /* 19738 */ 0320,01,0140,0,
+    /* 19742 */ 0322,01,0234,0,
+    /* 19746 */ 0321,01,0234,0,
+    /* 19750 */ 0320,01,0234,0,
+    /* 19754 */ 01,0320,0202,0,
+    /* 19758 */ 01,0322,0202,0,
+    /* 19762 */ 01,0320,0203,0,
+    /* 19766 */ 01,0322,0203,0,
+    /* 19770 */ 02,017,062,0,
+    /* 19774 */ 02,017,063,0,
+    /* 19778 */ 02,017,061,0,
+    /* 19782 */ 01,0302,030,0,
+    /* 19786 */ 01,0312,030,0,
+    /* 19790 */ 01,0320,0200,0,
+    /* 19794 */ 01,0322,0200,0,
+    /* 19798 */ 01,0320,0201,0,
+    /* 19802 */ 01,0322,0201,0,
+    /* 19806 */ 02,017,0252,0,
+    /* 19810 */ 01,0320,0204,0,
+    /* 19814 */ 01,0322,0204,0,
+    /* 19818 */ 01,0320,0207,0,
+    /* 19822 */ 01,0322,0207,0,
+    /* 19826 */ 01,030,0101,0,
+    /* 19830 */ 01,034,021,0,
+    /* 19834 */ 0335,01,0256,0,
+    /* 19838 */ 01,0320,0205,0,
+    /* 19842 */ 01,0322,0205,0,
+    /* 19846 */ 02,017,070,0,
+    /* 19850 */ 02,017,0176,0,
+    /* 19854 */ 0321,01,0253,0,
+    /* 19858 */ 0324,01,0253,0,
+    /* 19862 */ 0320,01,0253,0,
+    /* 19866 */ 01,050,0101,0,
+    /* 19870 */ 01,054,021,0,
+    /* 19874 */ 02,017,064,0,
+    /* 19878 */ 02,017,065,0,
+    /* 19882 */ 01,0204,0101,0,
+    /* 19886 */ 01,0204,0110,0,
+    /* 19890 */ 01,0250,021,0,
+    /* 19894 */ 02,017,0377,0,
+    /* 19898 */ 02,017,0271,0,
+    /* 19902 */ 02,017,013,0,
+    /* 19906 */ 02,017,011,0,
+    /* 19910 */ 02,017,060,0,
+    /* 19914 */ 0320,011,0220,0,
+    /* 19918 */ 0321,011,0220,0,
+    /* 19922 */ 0324,011,0220,0,
+    /* 19926 */ 0320,010,0220,0,
+    /* 19930 */ 0321,010,0220,0,
+    /* 19934 */ 0324,010,0220,0,
+    /* 19938 */ 0321,01,0220,0,
+    /* 19942 */ 01,0206,0110,0,
+    /* 19946 */ 01,0206,0101,0,
+    /* 19950 */ 01,060,0101,0,
+    /* 19954 */ 01,064,021,0,
+    /* 19958 */ 02,017,067,0,
+    /* 19962 */ 01,067,0,
+    /* 19965 */ 01,077,0,
+    /* 19968 */ 01,0374,0,
+    /* 19971 */ 01,0372,0,
+    /* 19974 */ 01,0365,0,
+    /* 19977 */ 01,047,0,
+    /* 19980 */ 01,057,0,
+    /* 19983 */ 01,0364,0,
+    /* 19986 */ 01,0361,0,
+    /* 19989 */ 01,0354,0,
+    /* 19992 */ 01,0154,0,
+    /* 19995 */ 01,0314,0,
+    /* 19998 */ 01,0316,0,
+    /* 20001 */ 01,0237,0,
+    /* 20004 */ 01,0254,0,
+    /* 20007 */ 01,0356,0,
+    /* 20010 */ 01,0156,0,
+    /* 20013 */ 01,0313,0,
+    /* 20016 */ 01,0326,0,
+    /* 20019 */ 01,0375,0,
+    /* 20022 */ 01,0373,0,
+    /* 20025 */ 01,0327,0,
+};
+
+/*
+ * Bytecode frequencies (including reuse):
+ *
+ *   0:3415 |  40:   4 | 100:  53 | 140:   1 | 200: 104 | 240:   0 | 300:   0 | 340:   1
+ *   1:2871 |  41:  19 | 101: 282 | 141:  17 | 201:  74 | 241:   0 | 301:   0 | 341:  10
+ *   2:1041 |  42:  12 | 102:   6 | 142:   2 | 202:  88 | 242:   0 | 302:   0 | 342:   0
+ *   3: 212 |  43:   4 | 103:   0 | 143:   0 | 203:  75 | 243:   0 | 303:   0 | 343:   0
+ *   4:   0 |  44:   4 | 104:   0 | 144:   1 | 204: 101 | 244:   0 | 304:   0 | 344:   2
+ *   5:   0 |  45:   4 | 105:   0 | 145:  17 | 205:  72 | 245:   0 | 305:   0 | 345:   1
+ *   6:   0 |  46:   0 | 106:   0 | 146:   2 | 206:  74 | 246:   0 | 306:   0 | 346:   1
+ *   7:   0 |  47:   0 | 107:   0 | 147:   0 | 207:  71 | 247:   0 | 307:   0 | 347:   1
+ *  10:  72 |  50:  28 | 110:1313 | 150:   2 | 210:   3 | 250:   1 | 310:   7 | 350:   0
+ *  11:  26 |  51:   0 | 111:   0 | 151:  17 | 211:   3 | 251:   9 | 311:   7 | 351:   0
+ *  12:   0 |  52:   0 | 112:   0 | 152:   2 | 212:   3 | 252:   2 | 312:   5 | 352:   0
+ *  13:   0 |  53:   0 | 113:   0 | 153:   0 | 213:   1 | 253:   0 | 313:   7 | 353:   0
+ *  14:   0 |  54:   0 | 114:   0 | 154:   3 | 214:   2 | 254:   0 | 314:   2 | 354:   0
+ *  15:   6 |  55:   1 | 115:   0 | 155:  26 | 215:   0 | 255:  13 | 315:   0 | 355:   0
+ *  16:  12 |  56:   0 | 116:   0 | 156:   4 | 216:   3 | 256:   0 | 316:   0 | 356:   0
+ *  17:   0 |  57:   0 | 117:   0 | 157:   0 | 217:   1 | 257:   0 | 317:   4 | 357:   0
+ *  20:   0 |  60:   4 | 120: 733 | 160:   0 | 220:   0 | 260: 539 | 320: 322 | 360: 172
+ *  21:  48 |  61:   0 | 121:   0 | 161:   0 | 221:   0 | 261: 767 | 321: 325 | 361: 236
+ *  22: 101 |  62:   4 | 122:   0 | 162:   0 | 222:   0 | 262:  12 | 322:  21 | 362:  44
+ *  23:  44 |  63:   4 | 123:   0 | 163:   0 | 223:   0 | 263:   0 | 323: 113 | 363:  48
+ *  24:   6 |  64:  20 | 124:   0 | 164:   0 | 224:   0 | 264:   0 | 324: 283 | 364:   0
+ *  25:  67 |  65:   0 | 125:   0 | 165:   0 | 225:   0 | 265:   0 | 325:   1 | 365:   0
+ *  26:  67 |  66:   0 | 126:   0 | 166:   0 | 226:   0 | 266:   0 | 326:   0 | 366:   0
+ *  27:   1 |  67:   0 | 127:   0 | 167:   0 | 227:   0 | 267:   0 | 327:   0 | 367:   0
+ *  30:  14 |  70:   0 | 130:  51 | 170:   0 | 230:   0 | 270: 243 | 330:  16 | 370:   1
+ *  31:  19 |  71:   0 | 131:   0 | 171:   0 | 231:   0 | 271:   0 | 331:   0 | 371:   1
+ *  32:   4 |  72:   0 | 132:   0 | 172:   8 | 232:   0 | 272:   0 | 332:   5 | 372:   0
+ *  33:   0 |  73:   0 | 133:   0 | 173:  24 | 233:   0 | 273:   0 | 333:   7 | 373:   1
+ *  34:   6 |  74:   6 | 134:   0 | 174: 170 | 234:   0 | 274:   1 | 334:   2 | 374:   0
+ *  35:   2 |  75:   0 | 135:   0 | 175:   0 | 235:   0 | 275:  48 | 335:   8 | 375:   0
+ *  36:   0 |  76:   0 | 136:   0 | 176:   0 | 236:   0 | 276:   0 | 336:   8 | 376:   0
+ *  37:   0 |  77:   0 | 137:   0 | 177:   0 | 237:   0 | 277:   0 | 337:   0 | 377:   0
+ */
diff --git a/insnsd.c b/insnsd.c
new file mode 100644 (file)
index 0000000..ebd06a5
--- /dev/null
+++ b/insnsd.c
@@ -0,0 +1,17415 @@
+/* This file auto-generated from insns.dat by insns.pl - don't edit it */
+
+#include "nasm.h"
+#include "insns.h"
+
+static const struct itemplate instrux[] = {
+    /*    0 */ {I_RESB, 1, {IMMEDIATE,0,0,0,0}, nasm_bytecodes+19072, IF_8086},
+    /*    1 */ {I_AAA, 0, {0,0,0,0,0}, nasm_bytecodes+19962, IF_8086|IF_NOLONG},
+    /*    2 */ {I_AAD, 0, {0,0,0,0,0}, nasm_bytecodes+18914, IF_8086|IF_NOLONG},
+    /*    3 */ {I_AAD, 1, {IMMEDIATE,0,0,0,0}, nasm_bytecodes+18918, IF_8086|IF_SB|IF_NOLONG},
+    /*    4 */ {I_AAM, 0, {0,0,0,0,0}, nasm_bytecodes+18922, IF_8086|IF_NOLONG},
+    /*    5 */ {I_AAM, 1, {IMMEDIATE,0,0,0,0}, nasm_bytecodes+18926, IF_8086|IF_SB|IF_NOLONG},
+    /*    6 */ {I_AAS, 0, {0,0,0,0,0}, nasm_bytecodes+19965, IF_8086|IF_NOLONG},
+    /*    7 */ {I_ADC, 2, {MEMORY,REG_GPR|BITS8,0,0,0}, nasm_bytecodes+18930, IF_8086|IF_SM},
+    /*    8 */ {I_ADC, 2, {REG_GPR|BITS8,REG_GPR|BITS8,0,0,0}, nasm_bytecodes+18930, IF_8086},
+    /*    9 */ {I_ADC, 2, {MEMORY,REG_GPR|BITS16,0,0,0}, nasm_bytecodes+17034, IF_8086|IF_SM},
+    /*   10 */ {I_ADC, 2, {REG_GPR|BITS16,REG_GPR|BITS16,0,0,0}, nasm_bytecodes+17034, IF_8086},
+    /*   11 */ {I_ADC, 2, {MEMORY,REG_GPR|BITS32,0,0,0}, nasm_bytecodes+17039, IF_386|IF_SM},
+    /*   12 */ {I_ADC, 2, {REG_GPR|BITS32,REG_GPR|BITS32,0,0,0}, nasm_bytecodes+17039, IF_386},
+    /*   13 */ {I_ADC, 2, {MEMORY,REG_GPR|BITS64,0,0,0}, nasm_bytecodes+17044, IF_X64|IF_SM},
+    /*   14 */ {I_ADC, 2, {REG_GPR|BITS64,REG_GPR|BITS64,0,0,0}, nasm_bytecodes+17044, IF_X64},
+    /*   15 */ {I_ADC, 2, {REG_GPR|BITS8,MEMORY,0,0,0}, nasm_bytecodes+10228, IF_8086|IF_SM},
+    /*   16 */ {I_ADC, 2, {REG_GPR|BITS8,REG_GPR|BITS8,0,0,0}, nasm_bytecodes+10228, IF_8086},
+    /*   17 */ {I_ADC, 2, {REG_GPR|BITS16,MEMORY,0,0,0}, nasm_bytecodes+17049, IF_8086|IF_SM},
+    /*   18 */ {I_ADC, 2, {REG_GPR|BITS16,REG_GPR|BITS16,0,0,0}, nasm_bytecodes+17049, IF_8086},
+    /*   19 */ {I_ADC, 2, {REG_GPR|BITS32,MEMORY,0,0,0}, nasm_bytecodes+17054, IF_386|IF_SM},
+    /*   20 */ {I_ADC, 2, {REG_GPR|BITS32,REG_GPR|BITS32,0,0,0}, nasm_bytecodes+17054, IF_386},
+    /*   21 */ {I_ADC, 2, {REG_GPR|BITS64,MEMORY,0,0,0}, nasm_bytecodes+17059, IF_X64|IF_SM},
+    /*   22 */ {I_ADC, 2, {REG_GPR|BITS64,REG_GPR|BITS64,0,0,0}, nasm_bytecodes+17059, IF_X64},
+    /*   23 */ {I_ADC, 2, {RM_GPR|BITS16,IMMEDIATE|BITS8,0,0,0}, nasm_bytecodes+13536, IF_8086},
+    /*   24 */ {I_ADC, 2, {RM_GPR|BITS32,IMMEDIATE|BITS8,0,0,0}, nasm_bytecodes+13542, IF_386},
+    /*   25 */ {I_ADC, 2, {RM_GPR|BITS64,IMMEDIATE|BITS8,0,0,0}, nasm_bytecodes+13548, IF_X64},
+    /*   26 */ {I_ADC, 2, {REG_AL,IMMEDIATE,0,0,0}, nasm_bytecodes+18934, IF_8086|IF_SM},
+    /*   27 */ {I_ADC, 2, {REG_AX,SBYTE16,0,0,0}, nasm_bytecodes+13536, IF_8086|IF_SM},
+    /*   28 */ {I_ADC, 2, {REG_AX,IMMEDIATE,0,0,0}, nasm_bytecodes+17064, IF_8086|IF_SM},
+    /*   29 */ {I_ADC, 2, {REG_EAX,SBYTE32,0,0,0}, nasm_bytecodes+13542, IF_386|IF_SM},
+    /*   30 */ {I_ADC, 2, {REG_EAX,IMMEDIATE,0,0,0}, nasm_bytecodes+17069, IF_386|IF_SM},
+    /*   31 */ {I_ADC, 2, {REG_RAX,SBYTE64,0,0,0}, nasm_bytecodes+13548, IF_X64|IF_SM},
+    /*   32 */ {I_ADC, 2, {REG_RAX,IMMEDIATE,0,0,0}, nasm_bytecodes+17074, IF_X64|IF_SM},
+    /*   33 */ {I_ADC, 2, {RM_GPR|BITS8,IMMEDIATE,0,0,0}, nasm_bytecodes+17079, IF_8086|IF_SM},
+    /*   34 */ {I_ADC, 2, {RM_GPR|BITS16,IMMEDIATE,0,0,0}, nasm_bytecodes+13554, IF_8086|IF_SM},
+    /*   35 */ {I_ADC, 2, {RM_GPR|BITS32,IMMEDIATE,0,0,0}, nasm_bytecodes+13560, IF_386|IF_SM},
+    /*   36 */ {I_ADC, 2, {RM_GPR|BITS64,IMMEDIATE,0,0,0}, nasm_bytecodes+13566, IF_X64|IF_SM},
+    /*   37 */ {I_ADC, 2, {MEMORY,IMMEDIATE|BITS8,0,0,0}, nasm_bytecodes+17079, IF_8086|IF_SM},
+    /*   38 */ {I_ADC, 2, {MEMORY,IMMEDIATE|BITS16,0,0,0}, nasm_bytecodes+13554, IF_8086|IF_SM},
+    /*   39 */ {I_ADC, 2, {MEMORY,IMMEDIATE|BITS32,0,0,0}, nasm_bytecodes+13560, IF_386|IF_SM},
+    /*   40 */ {I_ADD, 2, {MEMORY,REG_GPR|BITS8,0,0,0}, nasm_bytecodes+18938, IF_8086|IF_SM},
+    /*   41 */ {I_ADD, 2, {REG_GPR|BITS8,REG_GPR|BITS8,0,0,0}, nasm_bytecodes+18938, IF_8086},
+    /*   42 */ {I_ADD, 2, {MEMORY,REG_GPR|BITS16,0,0,0}, nasm_bytecodes+17084, IF_8086|IF_SM},
+    /*   43 */ {I_ADD, 2, {REG_GPR|BITS16,REG_GPR|BITS16,0,0,0}, nasm_bytecodes+17084, IF_8086},
+    /*   44 */ {I_ADD, 2, {MEMORY,REG_GPR|BITS32,0,0,0}, nasm_bytecodes+17089, IF_386|IF_SM},
+    /*   45 */ {I_ADD, 2, {REG_GPR|BITS32,REG_GPR|BITS32,0,0,0}, nasm_bytecodes+17089, IF_386},
+    /*   46 */ {I_ADD, 2, {MEMORY,REG_GPR|BITS64,0,0,0}, nasm_bytecodes+17094, IF_X64|IF_SM},
+    /*   47 */ {I_ADD, 2, {REG_GPR|BITS64,REG_GPR|BITS64,0,0,0}, nasm_bytecodes+17094, IF_X64},
+    /*   48 */ {I_ADD, 2, {REG_GPR|BITS8,MEMORY,0,0,0}, nasm_bytecodes+10879, IF_8086|IF_SM},
+    /*   49 */ {I_ADD, 2, {REG_GPR|BITS8,REG_GPR|BITS8,0,0,0}, nasm_bytecodes+10879, IF_8086},
+    /*   50 */ {I_ADD, 2, {REG_GPR|BITS16,MEMORY,0,0,0}, nasm_bytecodes+17099, IF_8086|IF_SM},
+    /*   51 */ {I_ADD, 2, {REG_GPR|BITS16,REG_GPR|BITS16,0,0,0}, nasm_bytecodes+17099, IF_8086},
+    /*   52 */ {I_ADD, 2, {REG_GPR|BITS32,MEMORY,0,0,0}, nasm_bytecodes+17104, IF_386|IF_SM},
+    /*   53 */ {I_ADD, 2, {REG_GPR|BITS32,REG_GPR|BITS32,0,0,0}, nasm_bytecodes+17104, IF_386},
+    /*   54 */ {I_ADD, 2, {REG_GPR|BITS64,MEMORY,0,0,0}, nasm_bytecodes+17109, IF_X64|IF_SM},
+    /*   55 */ {I_ADD, 2, {REG_GPR|BITS64,REG_GPR|BITS64,0,0,0}, nasm_bytecodes+17109, IF_X64},
+    /*   56 */ {I_ADD, 2, {RM_GPR|BITS16,IMMEDIATE|BITS8,0,0,0}, nasm_bytecodes+13572, IF_8086},
+    /*   57 */ {I_ADD, 2, {RM_GPR|BITS32,IMMEDIATE|BITS8,0,0,0}, nasm_bytecodes+13578, IF_386},
+    /*   58 */ {I_ADD, 2, {RM_GPR|BITS64,IMMEDIATE|BITS8,0,0,0}, nasm_bytecodes+13584, IF_X64},
+    /*   59 */ {I_ADD, 2, {REG_AL,IMMEDIATE,0,0,0}, nasm_bytecodes+18942, IF_8086|IF_SM},
+    /*   60 */ {I_ADD, 2, {REG_AX,SBYTE16,0,0,0}, nasm_bytecodes+13572, IF_8086|IF_SM},
+    /*   61 */ {I_ADD, 2, {REG_AX,IMMEDIATE,0,0,0}, nasm_bytecodes+17114, IF_8086|IF_SM},
+    /*   62 */ {I_ADD, 2, {REG_EAX,SBYTE32,0,0,0}, nasm_bytecodes+13578, IF_386|IF_SM},
+    /*   63 */ {I_ADD, 2, {REG_EAX,IMMEDIATE,0,0,0}, nasm_bytecodes+17119, IF_386|IF_SM},
+    /*   64 */ {I_ADD, 2, {REG_RAX,SBYTE64,0,0,0}, nasm_bytecodes+13584, IF_X64|IF_SM},
+    /*   65 */ {I_ADD, 2, {REG_RAX,IMMEDIATE,0,0,0}, nasm_bytecodes+17124, IF_X64|IF_SM},
+    /*   66 */ {I_ADD, 2, {RM_GPR|BITS8,IMMEDIATE,0,0,0}, nasm_bytecodes+17129, IF_8086|IF_SM},
+    /*   67 */ {I_ADD, 2, {RM_GPR|BITS16,IMMEDIATE,0,0,0}, nasm_bytecodes+13590, IF_8086|IF_SM},
+    /*   68 */ {I_ADD, 2, {RM_GPR|BITS32,IMMEDIATE,0,0,0}, nasm_bytecodes+13596, IF_386|IF_SM},
+    /*   69 */ {I_ADD, 2, {RM_GPR|BITS64,IMMEDIATE,0,0,0}, nasm_bytecodes+13602, IF_X64|IF_SM},
+    /*   70 */ {I_ADD, 2, {MEMORY,IMMEDIATE|BITS8,0,0,0}, nasm_bytecodes+17129, IF_8086|IF_SM},
+    /*   71 */ {I_ADD, 2, {MEMORY,IMMEDIATE|BITS16,0,0,0}, nasm_bytecodes+13590, IF_8086|IF_SM},
+    /*   72 */ {I_ADD, 2, {MEMORY,IMMEDIATE|BITS32,0,0,0}, nasm_bytecodes+13596, IF_386|IF_SM},
+    /*   73 */ {I_AND, 2, {MEMORY,REG_GPR|BITS8,0,0,0}, nasm_bytecodes+18946, IF_8086|IF_SM},
+    /*   74 */ {I_AND, 2, {REG_GPR|BITS8,REG_GPR|BITS8,0,0,0}, nasm_bytecodes+18946, IF_8086},
+    /*   75 */ {I_AND, 2, {MEMORY,REG_GPR|BITS16,0,0,0}, nasm_bytecodes+17134, IF_8086|IF_SM},
+    /*   76 */ {I_AND, 2, {REG_GPR|BITS16,REG_GPR|BITS16,0,0,0}, nasm_bytecodes+17134, IF_8086},
+    /*   77 */ {I_AND, 2, {MEMORY,REG_GPR|BITS32,0,0,0}, nasm_bytecodes+17139, IF_386|IF_SM},
+    /*   78 */ {I_AND, 2, {REG_GPR|BITS32,REG_GPR|BITS32,0,0,0}, nasm_bytecodes+17139, IF_386},
+    /*   79 */ {I_AND, 2, {MEMORY,REG_GPR|BITS64,0,0,0}, nasm_bytecodes+17144, IF_X64|IF_SM},
+    /*   80 */ {I_AND, 2, {REG_GPR|BITS64,REG_GPR|BITS64,0,0,0}, nasm_bytecodes+17144, IF_X64},
+    /*   81 */ {I_AND, 2, {REG_GPR|BITS8,MEMORY,0,0,0}, nasm_bytecodes+11166, IF_8086|IF_SM},
+    /*   82 */ {I_AND, 2, {REG_GPR|BITS8,REG_GPR|BITS8,0,0,0}, nasm_bytecodes+11166, IF_8086},
+    /*   83 */ {I_AND, 2, {REG_GPR|BITS16,MEMORY,0,0,0}, nasm_bytecodes+17149, IF_8086|IF_SM},
+    /*   84 */ {I_AND, 2, {REG_GPR|BITS16,REG_GPR|BITS16,0,0,0}, nasm_bytecodes+17149, IF_8086},
+    /*   85 */ {I_AND, 2, {REG_GPR|BITS32,MEMORY,0,0,0}, nasm_bytecodes+17154, IF_386|IF_SM},
+    /*   86 */ {I_AND, 2, {REG_GPR|BITS32,REG_GPR|BITS32,0,0,0}, nasm_bytecodes+17154, IF_386},
+    /*   87 */ {I_AND, 2, {REG_GPR|BITS64,MEMORY,0,0,0}, nasm_bytecodes+17159, IF_X64|IF_SM},
+    /*   88 */ {I_AND, 2, {REG_GPR|BITS64,REG_GPR|BITS64,0,0,0}, nasm_bytecodes+17159, IF_X64},
+    /*   89 */ {I_AND, 2, {RM_GPR|BITS16,IMMEDIATE|BITS8,0,0,0}, nasm_bytecodes+13608, IF_8086},
+    /*   90 */ {I_AND, 2, {RM_GPR|BITS32,IMMEDIATE|BITS8,0,0,0}, nasm_bytecodes+13614, IF_386},
+    /*   91 */ {I_AND, 2, {RM_GPR|BITS64,IMMEDIATE|BITS8,0,0,0}, nasm_bytecodes+13620, IF_X64},
+    /*   92 */ {I_AND, 2, {REG_AL,IMMEDIATE,0,0,0}, nasm_bytecodes+18950, IF_8086|IF_SM},
+    /*   93 */ {I_AND, 2, {REG_AX,SBYTE16,0,0,0}, nasm_bytecodes+13608, IF_8086|IF_SM},
+    /*   94 */ {I_AND, 2, {REG_AX,IMMEDIATE,0,0,0}, nasm_bytecodes+17164, IF_8086|IF_SM},
+    /*   95 */ {I_AND, 2, {REG_EAX,SBYTE32,0,0,0}, nasm_bytecodes+13614, IF_386|IF_SM},
+    /*   96 */ {I_AND, 2, {REG_EAX,IMMEDIATE,0,0,0}, nasm_bytecodes+17169, IF_386|IF_SM},
+    /*   97 */ {I_AND, 2, {REG_RAX,SBYTE64,0,0,0}, nasm_bytecodes+13620, IF_X64|IF_SM},
+    /*   98 */ {I_AND, 2, {REG_RAX,IMMEDIATE,0,0,0}, nasm_bytecodes+17174, IF_X64|IF_SM},
+    /*   99 */ {I_AND, 2, {RM_GPR|BITS8,IMMEDIATE,0,0,0}, nasm_bytecodes+17179, IF_8086|IF_SM},
+    /*  100 */ {I_AND, 2, {RM_GPR|BITS16,IMMEDIATE,0,0,0}, nasm_bytecodes+13626, IF_8086|IF_SM},
+    /*  101 */ {I_AND, 2, {RM_GPR|BITS32,IMMEDIATE,0,0,0}, nasm_bytecodes+13632, IF_386|IF_SM},
+    /*  102 */ {I_AND, 2, {RM_GPR|BITS64,IMMEDIATE,0,0,0}, nasm_bytecodes+13638, IF_X64|IF_SM},
+    /*  103 */ {I_AND, 2, {MEMORY,IMMEDIATE|BITS8,0,0,0}, nasm_bytecodes+17179, IF_8086|IF_SM},
+    /*  104 */ {I_AND, 2, {MEMORY,IMMEDIATE|BITS16,0,0,0}, nasm_bytecodes+13626, IF_8086|IF_SM},
+    /*  105 */ {I_AND, 2, {MEMORY,IMMEDIATE|BITS32,0,0,0}, nasm_bytecodes+13632, IF_386|IF_SM},
+    /*  106 */ {I_ARPL, 2, {MEMORY,REG_GPR|BITS16,0,0,0}, nasm_bytecodes+18954, IF_286|IF_PROT|IF_SM|IF_NOLONG},
+    /*  107 */ {I_ARPL, 2, {REG_GPR|BITS16,REG_GPR|BITS16,0,0,0}, nasm_bytecodes+18954, IF_286|IF_PROT|IF_NOLONG},
+    /*  108 */ {I_BOUND, 2, {REG_GPR|BITS16,MEMORY,0,0,0}, nasm_bytecodes+17184, IF_186|IF_NOLONG},
+    /*  109 */ {I_BOUND, 2, {REG_GPR|BITS32,MEMORY,0,0,0}, nasm_bytecodes+17189, IF_386|IF_NOLONG},
+    /*  110 */ {I_BSF, 2, {REG_GPR|BITS16,MEMORY,0,0,0}, nasm_bytecodes+13644, IF_386|IF_SM},
+    /*  111 */ {I_BSF, 2, {REG_GPR|BITS16,REG_GPR|BITS16,0,0,0}, nasm_bytecodes+13644, IF_386},
+    /*  112 */ {I_BSF, 2, {REG_GPR|BITS32,MEMORY,0,0,0}, nasm_bytecodes+13650, IF_386|IF_SM},
+    /*  113 */ {I_BSF, 2, {REG_GPR|BITS32,REG_GPR|BITS32,0,0,0}, nasm_bytecodes+13650, IF_386},
+    /*  114 */ {I_BSF, 2, {REG_GPR|BITS64,MEMORY,0,0,0}, nasm_bytecodes+13656, IF_X64|IF_SM},
+    /*  115 */ {I_BSF, 2, {REG_GPR|BITS64,REG_GPR|BITS64,0,0,0}, nasm_bytecodes+13656, IF_X64},
+    /*  116 */ {I_BSR, 2, {REG_GPR|BITS16,MEMORY,0,0,0}, nasm_bytecodes+13662, IF_386|IF_SM},
+    /*  117 */ {I_BSR, 2, {REG_GPR|BITS16,REG_GPR|BITS16,0,0,0}, nasm_bytecodes+13662, IF_386},
+    /*  118 */ {I_BSR, 2, {REG_GPR|BITS32,MEMORY,0,0,0}, nasm_bytecodes+13668, IF_386|IF_SM},
+    /*  119 */ {I_BSR, 2, {REG_GPR|BITS32,REG_GPR|BITS32,0,0,0}, nasm_bytecodes+13668, IF_386},
+    /*  120 */ {I_BSR, 2, {REG_GPR|BITS64,MEMORY,0,0,0}, nasm_bytecodes+13674, IF_X64|IF_SM},
+    /*  121 */ {I_BSR, 2, {REG_GPR|BITS64,REG_GPR|BITS64,0,0,0}, nasm_bytecodes+13674, IF_X64},
+    /*  122 */ {I_BSWAP, 1, {REG_GPR|BITS32,0,0,0,0}, nasm_bytecodes+13680, IF_486},
+    /*  123 */ {I_BSWAP, 1, {REG_GPR|BITS64,0,0,0,0}, nasm_bytecodes+13686, IF_X64},
+    /*  124 */ {I_BT, 2, {MEMORY,REG_GPR|BITS16,0,0,0}, nasm_bytecodes+13692, IF_386|IF_SM},
+    /*  125 */ {I_BT, 2, {REG_GPR|BITS16,REG_GPR|BITS16,0,0,0}, nasm_bytecodes+13692, IF_386},
+    /*  126 */ {I_BT, 2, {MEMORY,REG_GPR|BITS32,0,0,0}, nasm_bytecodes+13698, IF_386|IF_SM},
+    /*  127 */ {I_BT, 2, {REG_GPR|BITS32,REG_GPR|BITS32,0,0,0}, nasm_bytecodes+13698, IF_386},
+    /*  128 */ {I_BT, 2, {MEMORY,REG_GPR|BITS64,0,0,0}, nasm_bytecodes+13704, IF_X64|IF_SM},
+    /*  129 */ {I_BT, 2, {REG_GPR|BITS64,REG_GPR|BITS64,0,0,0}, nasm_bytecodes+13704, IF_X64},
+    /*  130 */ {I_BT, 2, {RM_GPR|BITS16,IMMEDIATE,0,0,0}, nasm_bytecodes+7236, IF_386|IF_SB},
+    /*  131 */ {I_BT, 2, {RM_GPR|BITS32,IMMEDIATE,0,0,0}, nasm_bytecodes+7243, IF_386|IF_SB},
+    /*  132 */ {I_BT, 2, {RM_GPR|BITS64,IMMEDIATE,0,0,0}, nasm_bytecodes+7250, IF_X64|IF_SB},
+    /*  133 */ {I_BTC, 2, {MEMORY,REG_GPR|BITS16,0,0,0}, nasm_bytecodes+13710, IF_386|IF_SM},
+    /*  134 */ {I_BTC, 2, {REG_GPR|BITS16,REG_GPR|BITS16,0,0,0}, nasm_bytecodes+13710, IF_386},
+    /*  135 */ {I_BTC, 2, {MEMORY,REG_GPR|BITS32,0,0,0}, nasm_bytecodes+13716, IF_386|IF_SM},
+    /*  136 */ {I_BTC, 2, {REG_GPR|BITS32,REG_GPR|BITS32,0,0,0}, nasm_bytecodes+13716, IF_386},
+    /*  137 */ {I_BTC, 2, {MEMORY,REG_GPR|BITS64,0,0,0}, nasm_bytecodes+13722, IF_X64|IF_SM},
+    /*  138 */ {I_BTC, 2, {REG_GPR|BITS64,REG_GPR|BITS64,0,0,0}, nasm_bytecodes+13722, IF_X64},
+    /*  139 */ {I_BTC, 2, {RM_GPR|BITS16,IMMEDIATE,0,0,0}, nasm_bytecodes+7257, IF_386|IF_SB},
+    /*  140 */ {I_BTC, 2, {RM_GPR|BITS32,IMMEDIATE,0,0,0}, nasm_bytecodes+7264, IF_386|IF_SB},
+    /*  141 */ {I_BTC, 2, {RM_GPR|BITS64,IMMEDIATE,0,0,0}, nasm_bytecodes+7271, IF_X64|IF_SB},
+    /*  142 */ {I_BTR, 2, {MEMORY,REG_GPR|BITS16,0,0,0}, nasm_bytecodes+13728, IF_386|IF_SM},
+    /*  143 */ {I_BTR, 2, {REG_GPR|BITS16,REG_GPR|BITS16,0,0,0}, nasm_bytecodes+13728, IF_386},
+    /*  144 */ {I_BTR, 2, {MEMORY,REG_GPR|BITS32,0,0,0}, nasm_bytecodes+13734, IF_386|IF_SM},
+    /*  145 */ {I_BTR, 2, {REG_GPR|BITS32,REG_GPR|BITS32,0,0,0}, nasm_bytecodes+13734, IF_386},
+    /*  146 */ {I_BTR, 2, {MEMORY,REG_GPR|BITS64,0,0,0}, nasm_bytecodes+13740, IF_X64|IF_SM},
+    /*  147 */ {I_BTR, 2, {REG_GPR|BITS64,REG_GPR|BITS64,0,0,0}, nasm_bytecodes+13740, IF_X64},
+    /*  148 */ {I_BTR, 2, {RM_GPR|BITS16,IMMEDIATE,0,0,0}, nasm_bytecodes+7278, IF_386|IF_SB},
+    /*  149 */ {I_BTR, 2, {RM_GPR|BITS32,IMMEDIATE,0,0,0}, nasm_bytecodes+7285, IF_386|IF_SB},
+    /*  150 */ {I_BTR, 2, {RM_GPR|BITS64,IMMEDIATE,0,0,0}, nasm_bytecodes+7292, IF_X64|IF_SB},
+    /*  151 */ {I_BTS, 2, {MEMORY,REG_GPR|BITS16,0,0,0}, nasm_bytecodes+13746, IF_386|IF_SM},
+    /*  152 */ {I_BTS, 2, {REG_GPR|BITS16,REG_GPR|BITS16,0,0,0}, nasm_bytecodes+13746, IF_386},
+    /*  153 */ {I_BTS, 2, {MEMORY,REG_GPR|BITS32,0,0,0}, nasm_bytecodes+13752, IF_386|IF_SM},
+    /*  154 */ {I_BTS, 2, {REG_GPR|BITS32,REG_GPR|BITS32,0,0,0}, nasm_bytecodes+13752, IF_386},
+    /*  155 */ {I_BTS, 2, {MEMORY,REG_GPR|BITS64,0,0,0}, nasm_bytecodes+13758, IF_X64|IF_SM},
+    /*  156 */ {I_BTS, 2, {REG_GPR|BITS64,REG_GPR|BITS64,0,0,0}, nasm_bytecodes+13758, IF_X64},
+    /*  157 */ {I_BTS, 2, {RM_GPR|BITS16,IMMEDIATE,0,0,0}, nasm_bytecodes+7299, IF_386|IF_SB},
+    /*  158 */ {I_BTS, 2, {RM_GPR|BITS32,IMMEDIATE,0,0,0}, nasm_bytecodes+7306, IF_386|IF_SB},
+    /*  159 */ {I_BTS, 2, {RM_GPR|BITS64,IMMEDIATE,0,0,0}, nasm_bytecodes+7313, IF_X64|IF_SB},
+    /*  160 */ {I_CALL, 1, {IMMEDIATE,0,0,0,0}, nasm_bytecodes+17194, IF_8086},
+    /*  161 */ {I_CALL, 1, {IMMEDIATE|NEAR,0,0,0,0}, nasm_bytecodes+17194, IF_8086},
+    /*  162 */ {I_CALL, 1, {IMMEDIATE|BITS16,0,0,0,0}, nasm_bytecodes+17199, IF_8086},
+    /*  163 */ {I_CALL, 1, {IMMEDIATE|BITS16|NEAR,0,0,0,0}, nasm_bytecodes+17199, IF_8086},
+    /*  164 */ {I_CALL, 1, {IMMEDIATE|BITS32,0,0,0,0}, nasm_bytecodes+17204, IF_386},
+    /*  165 */ {I_CALL, 1, {IMMEDIATE|BITS32|NEAR,0,0,0,0}, nasm_bytecodes+17204, IF_386},
+    /*  166 */ {I_CALL, 2, {IMMEDIATE|COLON,IMMEDIATE,0,0,0}, nasm_bytecodes+13782, IF_8086|IF_NOLONG},
+    /*  167 */ {I_CALL, 2, {IMMEDIATE|BITS16|COLON,IMMEDIATE,0,0,0}, nasm_bytecodes+13788, IF_8086|IF_NOLONG},
+    /*  168 */ {I_CALL, 2, {IMMEDIATE|COLON,IMMEDIATE|BITS16,0,0,0}, nasm_bytecodes+13788, IF_8086|IF_NOLONG},
+    /*  169 */ {I_CALL, 2, {IMMEDIATE|BITS32|COLON,IMMEDIATE,0,0,0}, nasm_bytecodes+13794, IF_386|IF_NOLONG},
+    /*  170 */ {I_CALL, 2, {IMMEDIATE|COLON,IMMEDIATE|BITS32,0,0,0}, nasm_bytecodes+13794, IF_386|IF_NOLONG},
+    /*  171 */ {I_CALL, 1, {MEMORY|FAR,0,0,0,0}, nasm_bytecodes+17209, IF_8086|IF_NOLONG},
+    /*  172 */ {I_CALL, 1, {MEMORY|FAR,0,0,0,0}, nasm_bytecodes+17214, IF_X64},
+    /*  173 */ {I_CALL, 1, {MEMORY|BITS16|FAR,0,0,0,0}, nasm_bytecodes+17219, IF_8086},
+    /*  174 */ {I_CALL, 1, {MEMORY|BITS32|FAR,0,0,0,0}, nasm_bytecodes+17224, IF_386},
+    /*  175 */ {I_CALL, 1, {MEMORY|BITS64|FAR,0,0,0,0}, nasm_bytecodes+17214, IF_X64},
+    /*  176 */ {I_CALL, 1, {MEMORY|NEAR,0,0,0,0}, nasm_bytecodes+17229, IF_8086},
+    /*  177 */ {I_CALL, 1, {MEMORY|BITS16|NEAR,0,0,0,0}, nasm_bytecodes+17234, IF_8086},
+    /*  178 */ {I_CALL, 1, {MEMORY|BITS32|NEAR,0,0,0,0}, nasm_bytecodes+17239, IF_386|IF_NOLONG},
+    /*  179 */ {I_CALL, 1, {MEMORY|BITS64|NEAR,0,0,0,0}, nasm_bytecodes+17244, IF_X64},
+    /*  180 */ {I_CALL, 1, {REG_GPR|BITS16,0,0,0,0}, nasm_bytecodes+17234, IF_8086},
+    /*  181 */ {I_CALL, 1, {REG_GPR|BITS32,0,0,0,0}, nasm_bytecodes+17239, IF_386|IF_NOLONG},
+    /*  182 */ {I_CALL, 1, {REG_GPR|BITS64,0,0,0,0}, nasm_bytecodes+17249, IF_X64},
+    /*  183 */ {I_CALL, 1, {MEMORY,0,0,0,0}, nasm_bytecodes+17229, IF_8086},
+    /*  184 */ {I_CALL, 1, {MEMORY|BITS16,0,0,0,0}, nasm_bytecodes+17234, IF_8086},
+    /*  185 */ {I_CALL, 1, {MEMORY|BITS32,0,0,0,0}, nasm_bytecodes+17239, IF_386|IF_NOLONG},
+    /*  186 */ {I_CALL, 1, {MEMORY|BITS64,0,0,0,0}, nasm_bytecodes+17249, IF_X64},
+    /*  187 */ {I_CBW, 0, {0,0,0,0,0}, nasm_bytecodes+18966, IF_8086},
+    /*  188 */ {I_CDQ, 0, {0,0,0,0,0}, nasm_bytecodes+18970, IF_386},
+    /*  189 */ {I_CDQE, 0, {0,0,0,0,0}, nasm_bytecodes+18974, IF_X64},
+    /*  190 */ {I_CLC, 0, {0,0,0,0,0}, nasm_bytecodes+18686, IF_8086},
+    /*  191 */ {I_CLD, 0, {0,0,0,0,0}, nasm_bytecodes+19968, IF_8086},
+    /*  192 */ {I_CLGI, 0, {0,0,0,0,0}, nasm_bytecodes+17254, IF_X64|IF_AMD},
+    /*  193 */ {I_CLI, 0, {0,0,0,0,0}, nasm_bytecodes+19971, IF_8086},
+    /*  194 */ {I_CLTS, 0, {0,0,0,0,0}, nasm_bytecodes+18978, IF_286|IF_PRIV},
+    /*  195 */ {I_CMC, 0, {0,0,0,0,0}, nasm_bytecodes+19974, IF_8086},
+    /*  196 */ {I_CMP, 2, {MEMORY,REG_GPR|BITS8,0,0,0}, nasm_bytecodes+18982, IF_8086|IF_SM},
+    /*  197 */ {I_CMP, 2, {REG_GPR|BITS8,REG_GPR|BITS8,0,0,0}, nasm_bytecodes+18982, IF_8086},
+    /*  198 */ {I_CMP, 2, {MEMORY,REG_GPR|BITS16,0,0,0}, nasm_bytecodes+17259, IF_8086|IF_SM},
+    /*  199 */ {I_CMP, 2, {REG_GPR|BITS16,REG_GPR|BITS16,0,0,0}, nasm_bytecodes+17259, IF_8086},
+    /*  200 */ {I_CMP, 2, {MEMORY,REG_GPR|BITS32,0,0,0}, nasm_bytecodes+17264, IF_386|IF_SM},
+    /*  201 */ {I_CMP, 2, {REG_GPR|BITS32,REG_GPR|BITS32,0,0,0}, nasm_bytecodes+17264, IF_386},
+    /*  202 */ {I_CMP, 2, {MEMORY,REG_GPR|BITS64,0,0,0}, nasm_bytecodes+17269, IF_X64|IF_SM},
+    /*  203 */ {I_CMP, 2, {REG_GPR|BITS64,REG_GPR|BITS64,0,0,0}, nasm_bytecodes+17269, IF_X64},
+    /*  204 */ {I_CMP, 2, {REG_GPR|BITS8,MEMORY,0,0,0}, nasm_bytecodes+11124, IF_8086|IF_SM},
+    /*  205 */ {I_CMP, 2, {REG_GPR|BITS8,REG_GPR|BITS8,0,0,0}, nasm_bytecodes+11124, IF_8086},
+    /*  206 */ {I_CMP, 2, {REG_GPR|BITS16,MEMORY,0,0,0}, nasm_bytecodes+17274, IF_8086|IF_SM},
+    /*  207 */ {I_CMP, 2, {REG_GPR|BITS16,REG_GPR|BITS16,0,0,0}, nasm_bytecodes+17274, IF_8086},
+    /*  208 */ {I_CMP, 2, {REG_GPR|BITS32,MEMORY,0,0,0}, nasm_bytecodes+17279, IF_386|IF_SM},
+    /*  209 */ {I_CMP, 2, {REG_GPR|BITS32,REG_GPR|BITS32,0,0,0}, nasm_bytecodes+17279, IF_386},
+    /*  210 */ {I_CMP, 2, {REG_GPR|BITS64,MEMORY,0,0,0}, nasm_bytecodes+17284, IF_X64|IF_SM},
+    /*  211 */ {I_CMP, 2, {REG_GPR|BITS64,REG_GPR|BITS64,0,0,0}, nasm_bytecodes+17284, IF_X64},
+    /*  212 */ {I_CMP, 2, {RM_GPR|BITS16,IMMEDIATE|BITS8,0,0,0}, nasm_bytecodes+13800, IF_8086},
+    /*  213 */ {I_CMP, 2, {RM_GPR|BITS32,IMMEDIATE|BITS8,0,0,0}, nasm_bytecodes+13806, IF_386},
+    /*  214 */ {I_CMP, 2, {RM_GPR|BITS64,IMMEDIATE|BITS8,0,0,0}, nasm_bytecodes+13812, IF_X64},
+    /*  215 */ {I_CMP, 2, {REG_AL,IMMEDIATE,0,0,0}, nasm_bytecodes+18986, IF_8086|IF_SM},
+    /*  216 */ {I_CMP, 2, {REG_AX,SBYTE16,0,0,0}, nasm_bytecodes+13800, IF_8086|IF_SM},
+    /*  217 */ {I_CMP, 2, {REG_AX,IMMEDIATE,0,0,0}, nasm_bytecodes+17289, IF_8086|IF_SM},
+    /*  218 */ {I_CMP, 2, {REG_EAX,SBYTE32,0,0,0}, nasm_bytecodes+13806, IF_386|IF_SM},
+    /*  219 */ {I_CMP, 2, {REG_EAX,IMMEDIATE,0,0,0}, nasm_bytecodes+17294, IF_386|IF_SM},
+    /*  220 */ {I_CMP, 2, {REG_RAX,SBYTE64,0,0,0}, nasm_bytecodes+13812, IF_X64|IF_SM},
+    /*  221 */ {I_CMP, 2, {REG_RAX,IMMEDIATE,0,0,0}, nasm_bytecodes+17299, IF_X64|IF_SM},
+    /*  222 */ {I_CMP, 2, {RM_GPR|BITS8,IMMEDIATE,0,0,0}, nasm_bytecodes+17304, IF_8086|IF_SM},
+    /*  223 */ {I_CMP, 2, {RM_GPR|BITS16,IMMEDIATE,0,0,0}, nasm_bytecodes+13818, IF_8086|IF_SM},
+    /*  224 */ {I_CMP, 2, {RM_GPR|BITS32,IMMEDIATE,0,0,0}, nasm_bytecodes+13824, IF_386|IF_SM},
+    /*  225 */ {I_CMP, 2, {RM_GPR|BITS64,IMMEDIATE,0,0,0}, nasm_bytecodes+13830, IF_X64|IF_SM},
+    /*  226 */ {I_CMP, 2, {MEMORY,IMMEDIATE|BITS8,0,0,0}, nasm_bytecodes+17304, IF_8086|IF_SM},
+    /*  227 */ {I_CMP, 2, {MEMORY,IMMEDIATE|BITS16,0,0,0}, nasm_bytecodes+13818, IF_8086|IF_SM},
+    /*  228 */ {I_CMP, 2, {MEMORY,IMMEDIATE|BITS32,0,0,0}, nasm_bytecodes+13824, IF_386|IF_SM},
+    /*  229 */ {I_CMPSB, 0, {0,0,0,0,0}, nasm_bytecodes+18990, IF_8086},
+    /*  230 */ {I_CMPSD, 0, {0,0,0,0,0}, nasm_bytecodes+17309, IF_386},
+    /*  231 */ {I_CMPSQ, 0, {0,0,0,0,0}, nasm_bytecodes+17314, IF_X64},
+    /*  232 */ {I_CMPSW, 0, {0,0,0,0,0}, nasm_bytecodes+17319, IF_8086},
+    /*  233 */ {I_CMPXCHG, 2, {MEMORY,REG_GPR|BITS8,0,0,0}, nasm_bytecodes+17324, IF_PENT|IF_SM},
+    /*  234 */ {I_CMPXCHG, 2, {REG_GPR|BITS8,REG_GPR|BITS8,0,0,0}, nasm_bytecodes+17324, IF_PENT},
+    /*  235 */ {I_CMPXCHG, 2, {MEMORY,REG_GPR|BITS16,0,0,0}, nasm_bytecodes+13836, IF_PENT|IF_SM},
+    /*  236 */ {I_CMPXCHG, 2, {REG_GPR|BITS16,REG_GPR|BITS16,0,0,0}, nasm_bytecodes+13836, IF_PENT},
+    /*  237 */ {I_CMPXCHG, 2, {MEMORY,REG_GPR|BITS32,0,0,0}, nasm_bytecodes+13842, IF_PENT|IF_SM},
+    /*  238 */ {I_CMPXCHG, 2, {REG_GPR|BITS32,REG_GPR|BITS32,0,0,0}, nasm_bytecodes+13842, IF_PENT},
+    /*  239 */ {I_CMPXCHG, 2, {MEMORY,REG_GPR|BITS64,0,0,0}, nasm_bytecodes+13848, IF_X64|IF_SM},
+    /*  240 */ {I_CMPXCHG, 2, {REG_GPR|BITS64,REG_GPR|BITS64,0,0,0}, nasm_bytecodes+13848, IF_X64},
+    /*  241 */ {I_CMPXCHG8B, 1, {MEMORY,0,0,0,0}, nasm_bytecodes+13867, IF_PENT},
+    /*  242 */ {I_CMPXCHG16B, 1, {MEMORY,0,0,0,0}, nasm_bytecodes+13866, IF_X64},
+    /*  243 */ {I_CPUID, 0, {0,0,0,0,0}, nasm_bytecodes+18994, IF_PENT},
+    /*  244 */ {I_CPU_READ, 0, {0,0,0,0,0}, nasm_bytecodes+18998, IF_PENT|IF_CYRIX},
+    /*  245 */ {I_CPU_WRITE, 0, {0,0,0,0,0}, nasm_bytecodes+19002, IF_PENT|IF_CYRIX},
+    /*  246 */ {I_CQO, 0, {0,0,0,0,0}, nasm_bytecodes+19006, IF_X64},
+    /*  247 */ {I_CWD, 0, {0,0,0,0,0}, nasm_bytecodes+19010, IF_8086},
+    /*  248 */ {I_CWDE, 0, {0,0,0,0,0}, nasm_bytecodes+19014, IF_386},
+    /*  249 */ {I_DAA, 0, {0,0,0,0,0}, nasm_bytecodes+19977, IF_8086|IF_NOLONG},
+    /*  250 */ {I_DAS, 0, {0,0,0,0,0}, nasm_bytecodes+19980, IF_8086|IF_NOLONG},
+    /*  251 */ {I_DEC, 1, {REG_GPR|BITS16,0,0,0,0}, nasm_bytecodes+19018, IF_8086|IF_NOLONG},
+    /*  252 */ {I_DEC, 1, {REG_GPR|BITS32,0,0,0,0}, nasm_bytecodes+19022, IF_386|IF_NOLONG},
+    /*  253 */ {I_DEC, 1, {RM_GPR|BITS8,0,0,0,0}, nasm_bytecodes+19026, IF_8086},
+    /*  254 */ {I_DEC, 1, {RM_GPR|BITS16,0,0,0,0}, nasm_bytecodes+17334, IF_8086},
+    /*  255 */ {I_DEC, 1, {RM_GPR|BITS32,0,0,0,0}, nasm_bytecodes+17339, IF_386},
+    /*  256 */ {I_DEC, 1, {RM_GPR|BITS64,0,0,0,0}, nasm_bytecodes+17344, IF_X64},
+    /*  257 */ {I_DIV, 1, {RM_GPR|BITS8,0,0,0,0}, nasm_bytecodes+19030, IF_8086},
+    /*  258 */ {I_DIV, 1, {RM_GPR|BITS16,0,0,0,0}, nasm_bytecodes+17349, IF_8086},
+    /*  259 */ {I_DIV, 1, {RM_GPR|BITS32,0,0,0,0}, nasm_bytecodes+17354, IF_386},
+    /*  260 */ {I_DIV, 1, {RM_GPR|BITS64,0,0,0,0}, nasm_bytecodes+17359, IF_X64},
+    /*  261 */ {I_DMINT, 0, {0,0,0,0,0}, nasm_bytecodes+19034, IF_P6|IF_CYRIX},
+    /*  262 */ {I_EMMS, 0, {0,0,0,0,0}, nasm_bytecodes+19038, IF_PENT|IF_MMX},
+    /*  263 */ {I_ENTER, 2, {IMMEDIATE,IMMEDIATE,0,0,0}, nasm_bytecodes+17364, IF_186},
+    /*  264 */ {I_EQU, 1, {IMMEDIATE,0,0,0,0}, nasm_bytecodes+5778, IF_8086},
+    /*  265 */ {I_EQU, 2, {IMMEDIATE|COLON,IMMEDIATE,0,0,0}, nasm_bytecodes+5778, IF_8086},
+    /*  266 */ {I_F2XM1, 0, {0,0,0,0,0}, nasm_bytecodes+19042, IF_8086|IF_FPU},
+    /*  267 */ {I_FABS, 0, {0,0,0,0,0}, nasm_bytecodes+19046, IF_8086|IF_FPU},
+    /*  268 */ {I_FADD, 1, {MEMORY|BITS32,0,0,0,0}, nasm_bytecodes+19050, IF_8086|IF_FPU},
+    /*  269 */ {I_FADD, 1, {MEMORY|BITS64,0,0,0,0}, nasm_bytecodes+19054, IF_8086|IF_FPU},
+    /*  270 */ {I_FADD, 1, {FPUREG|TO,0,0,0,0}, nasm_bytecodes+17369, IF_8086|IF_FPU},
+    /*  271 */ {I_FADD, 1, {FPUREG,0,0,0,0}, nasm_bytecodes+17374, IF_8086|IF_FPU},
+    /*  272 */ {I_FADD, 2, {FPUREG,FPU0,0,0,0}, nasm_bytecodes+17369, IF_8086|IF_FPU},
+    /*  273 */ {I_FADD, 2, {FPU0,FPUREG,0,0,0}, nasm_bytecodes+17379, IF_8086|IF_FPU},
+    /*  274 */ {I_FADDP, 1, {FPUREG,0,0,0,0}, nasm_bytecodes+17384, IF_8086|IF_FPU},
+    /*  275 */ {I_FADDP, 2, {FPUREG,FPU0,0,0,0}, nasm_bytecodes+17384, IF_8086|IF_FPU},
+    /*  276 */ {I_FBLD, 1, {MEMORY|BITS80,0,0,0,0}, nasm_bytecodes+19062, IF_8086|IF_FPU},
+    /*  277 */ {I_FBLD, 1, {MEMORY,0,0,0,0}, nasm_bytecodes+19062, IF_8086|IF_FPU},
+    /*  278 */ {I_FBSTP, 1, {MEMORY|BITS80,0,0,0,0}, nasm_bytecodes+19066, IF_8086|IF_FPU},
+    /*  279 */ {I_FBSTP, 1, {MEMORY,0,0,0,0}, nasm_bytecodes+19066, IF_8086|IF_FPU},
+    /*  280 */ {I_FCHS, 0, {0,0,0,0,0}, nasm_bytecodes+19070, IF_8086|IF_FPU},
+    /*  281 */ {I_FCLEX, 0, {0,0,0,0,0}, nasm_bytecodes+17389, IF_8086|IF_FPU},
+    /*  282 */ {I_FCMOVB, 1, {FPUREG,0,0,0,0}, nasm_bytecodes+17394, IF_P6|IF_FPU},
+    /*  283 */ {I_FCMOVB, 2, {FPU0,FPUREG,0,0,0}, nasm_bytecodes+17399, IF_P6|IF_FPU},
+    /*  284 */ {I_FCMOVBE, 1, {FPUREG,0,0,0,0}, nasm_bytecodes+17404, IF_P6|IF_FPU},
+    /*  285 */ {I_FCMOVBE, 2, {FPU0,FPUREG,0,0,0}, nasm_bytecodes+17409, IF_P6|IF_FPU},
+    /*  286 */ {I_FCMOVE, 1, {FPUREG,0,0,0,0}, nasm_bytecodes+17414, IF_P6|IF_FPU},
+    /*  287 */ {I_FCMOVE, 2, {FPU0,FPUREG,0,0,0}, nasm_bytecodes+17419, IF_P6|IF_FPU},
+    /*  288 */ {I_FCMOVNB, 1, {FPUREG,0,0,0,0}, nasm_bytecodes+17424, IF_P6|IF_FPU},
+    /*  289 */ {I_FCMOVNB, 2, {FPU0,FPUREG,0,0,0}, nasm_bytecodes+17429, IF_P6|IF_FPU},
+    /*  290 */ {I_FCMOVNBE, 1, {FPUREG,0,0,0,0}, nasm_bytecodes+17434, IF_P6|IF_FPU},
+    /*  291 */ {I_FCMOVNBE, 2, {FPU0,FPUREG,0,0,0}, nasm_bytecodes+17439, IF_P6|IF_FPU},
+    /*  292 */ {I_FCMOVNE, 1, {FPUREG,0,0,0,0}, nasm_bytecodes+17444, IF_P6|IF_FPU},
+    /*  293 */ {I_FCMOVNE, 2, {FPU0,FPUREG,0,0,0}, nasm_bytecodes+17449, IF_P6|IF_FPU},
+    /*  294 */ {I_FCMOVNU, 1, {FPUREG,0,0,0,0}, nasm_bytecodes+17454, IF_P6|IF_FPU},
+    /*  295 */ {I_FCMOVNU, 2, {FPU0,FPUREG,0,0,0}, nasm_bytecodes+17459, IF_P6|IF_FPU},
+    /*  296 */ {I_FCMOVU, 1, {FPUREG,0,0,0,0}, nasm_bytecodes+17464, IF_P6|IF_FPU},
+    /*  297 */ {I_FCMOVU, 2, {FPU0,FPUREG,0,0,0}, nasm_bytecodes+17469, IF_P6|IF_FPU},
+    /*  298 */ {I_FCOM, 1, {MEMORY|BITS32,0,0,0,0}, nasm_bytecodes+19106, IF_8086|IF_FPU},
+    /*  299 */ {I_FCOM, 1, {MEMORY|BITS64,0,0,0,0}, nasm_bytecodes+19110, IF_8086|IF_FPU},
+    /*  300 */ {I_FCOM, 1, {FPUREG,0,0,0,0}, nasm_bytecodes+17474, IF_8086|IF_FPU},
+    /*  301 */ {I_FCOM, 2, {FPU0,FPUREG,0,0,0}, nasm_bytecodes+17479, IF_8086|IF_FPU},
+    /*  302 */ {I_FCOMI, 1, {FPUREG,0,0,0,0}, nasm_bytecodes+17484, IF_P6|IF_FPU},
+    /*  303 */ {I_FCOMI, 2, {FPU0,FPUREG,0,0,0}, nasm_bytecodes+17489, IF_P6|IF_FPU},
+    /*  304 */ {I_FCOMIP, 1, {FPUREG,0,0,0,0}, nasm_bytecodes+17494, IF_P6|IF_FPU},
+    /*  305 */ {I_FCOMIP, 2, {FPU0,FPUREG,0,0,0}, nasm_bytecodes+17499, IF_P6|IF_FPU},
+    /*  306 */ {I_FCOMP, 1, {MEMORY|BITS32,0,0,0,0}, nasm_bytecodes+19126, IF_8086|IF_FPU},
+    /*  307 */ {I_FCOMP, 1, {MEMORY|BITS64,0,0,0,0}, nasm_bytecodes+19130, IF_8086|IF_FPU},
+    /*  308 */ {I_FCOMP, 1, {FPUREG,0,0,0,0}, nasm_bytecodes+17504, IF_8086|IF_FPU},
+    /*  309 */ {I_FCOMP, 2, {FPU0,FPUREG,0,0,0}, nasm_bytecodes+17509, IF_8086|IF_FPU},
+    /*  310 */ {I_FCOMPP, 0, {0,0,0,0,0}, nasm_bytecodes+19138, IF_8086|IF_FPU},
+    /*  311 */ {I_FCOS, 0, {0,0,0,0,0}, nasm_bytecodes+19142, IF_386|IF_FPU},
+    /*  312 */ {I_FDECSTP, 0, {0,0,0,0,0}, nasm_bytecodes+19146, IF_8086|IF_FPU},
+    /*  313 */ {I_FDISI, 0, {0,0,0,0,0}, nasm_bytecodes+17514, IF_8086|IF_FPU},
+    /*  314 */ {I_FDIV, 1, {MEMORY|BITS32,0,0,0,0}, nasm_bytecodes+19150, IF_8086|IF_FPU},
+    /*  315 */ {I_FDIV, 1, {MEMORY|BITS64,0,0,0,0}, nasm_bytecodes+19154, IF_8086|IF_FPU},
+    /*  316 */ {I_FDIV, 1, {FPUREG|TO,0,0,0,0}, nasm_bytecodes+17519, IF_8086|IF_FPU},
+    /*  317 */ {I_FDIV, 1, {FPUREG,0,0,0,0}, nasm_bytecodes+17524, IF_8086|IF_FPU},
+    /*  318 */ {I_FDIV, 2, {FPUREG,FPU0,0,0,0}, nasm_bytecodes+17519, IF_8086|IF_FPU},
+    /*  319 */ {I_FDIV, 2, {FPU0,FPUREG,0,0,0}, nasm_bytecodes+17529, IF_8086|IF_FPU},
+    /*  320 */ {I_FDIVP, 1, {FPUREG,0,0,0,0}, nasm_bytecodes+17534, IF_8086|IF_FPU},
+    /*  321 */ {I_FDIVP, 2, {FPUREG,FPU0,0,0,0}, nasm_bytecodes+17534, IF_8086|IF_FPU},
+    /*  322 */ {I_FDIVR, 1, {MEMORY|BITS32,0,0,0,0}, nasm_bytecodes+19162, IF_8086|IF_FPU},
+    /*  323 */ {I_FDIVR, 1, {MEMORY|BITS64,0,0,0,0}, nasm_bytecodes+19166, IF_8086|IF_FPU},
+    /*  324 */ {I_FDIVR, 1, {FPUREG|TO,0,0,0,0}, nasm_bytecodes+17539, IF_8086|IF_FPU},
+    /*  325 */ {I_FDIVR, 2, {FPUREG,FPU0,0,0,0}, nasm_bytecodes+17539, IF_8086|IF_FPU},
+    /*  326 */ {I_FDIVR, 1, {FPUREG,0,0,0,0}, nasm_bytecodes+17544, IF_8086|IF_FPU},
+    /*  327 */ {I_FDIVR, 2, {FPU0,FPUREG,0,0,0}, nasm_bytecodes+17549, IF_8086|IF_FPU},
+    /*  328 */ {I_FDIVRP, 1, {FPUREG,0,0,0,0}, nasm_bytecodes+17554, IF_8086|IF_FPU},
+    /*  329 */ {I_FDIVRP, 2, {FPUREG,FPU0,0,0,0}, nasm_bytecodes+17554, IF_8086|IF_FPU},
+    /*  330 */ {I_FEMMS, 0, {0,0,0,0,0}, nasm_bytecodes+19174, IF_PENT|IF_3DNOW},
+    /*  331 */ {I_FENI, 0, {0,0,0,0,0}, nasm_bytecodes+17559, IF_8086|IF_FPU},
+    /*  332 */ {I_FFREE, 1, {FPUREG,0,0,0,0}, nasm_bytecodes+17564, IF_8086|IF_FPU},
+    /*  333 */ {I_FFREE, 0, {0,0,0,0,0}, nasm_bytecodes+19178, IF_8086|IF_FPU},
+    /*  334 */ {I_FFREEP, 1, {FPUREG,0,0,0,0}, nasm_bytecodes+17569, IF_286|IF_FPU|IF_UNDOC},
+    /*  335 */ {I_FFREEP, 0, {0,0,0,0,0}, nasm_bytecodes+19182, IF_286|IF_FPU|IF_UNDOC},
+    /*  336 */ {I_FIADD, 1, {MEMORY|BITS32,0,0,0,0}, nasm_bytecodes+19186, IF_8086|IF_FPU},
+    /*  337 */ {I_FIADD, 1, {MEMORY|BITS16,0,0,0,0}, nasm_bytecodes+19190, IF_8086|IF_FPU},
+    /*  338 */ {I_FICOM, 1, {MEMORY|BITS32,0,0,0,0}, nasm_bytecodes+19194, IF_8086|IF_FPU},
+    /*  339 */ {I_FICOM, 1, {MEMORY|BITS16,0,0,0,0}, nasm_bytecodes+19198, IF_8086|IF_FPU},
+    /*  340 */ {I_FICOMP, 1, {MEMORY|BITS32,0,0,0,0}, nasm_bytecodes+19202, IF_8086|IF_FPU},
+    /*  341 */ {I_FICOMP, 1, {MEMORY|BITS16,0,0,0,0}, nasm_bytecodes+19206, IF_8086|IF_FPU},
+    /*  342 */ {I_FIDIV, 1, {MEMORY|BITS32,0,0,0,0}, nasm_bytecodes+19210, IF_8086|IF_FPU},
+    /*  343 */ {I_FIDIV, 1, {MEMORY|BITS16,0,0,0,0}, nasm_bytecodes+19214, IF_8086|IF_FPU},
+    /*  344 */ {I_FIDIVR, 1, {MEMORY|BITS32,0,0,0,0}, nasm_bytecodes+19218, IF_8086|IF_FPU},
+    /*  345 */ {I_FIDIVR, 1, {MEMORY|BITS16,0,0,0,0}, nasm_bytecodes+19222, IF_8086|IF_FPU},
+    /*  346 */ {I_FILD, 1, {MEMORY|BITS32,0,0,0,0}, nasm_bytecodes+19226, IF_8086|IF_FPU},
+    /*  347 */ {I_FILD, 1, {MEMORY|BITS16,0,0,0,0}, nasm_bytecodes+19230, IF_8086|IF_FPU},
+    /*  348 */ {I_FILD, 1, {MEMORY|BITS64,0,0,0,0}, nasm_bytecodes+19234, IF_8086|IF_FPU},
+    /*  349 */ {I_FIMUL, 1, {MEMORY|BITS32,0,0,0,0}, nasm_bytecodes+19238, IF_8086|IF_FPU},
+    /*  350 */ {I_FIMUL, 1, {MEMORY|BITS16,0,0,0,0}, nasm_bytecodes+19242, IF_8086|IF_FPU},
+    /*  351 */ {I_FINCSTP, 0, {0,0,0,0,0}, nasm_bytecodes+19246, IF_8086|IF_FPU},
+    /*  352 */ {I_FINIT, 0, {0,0,0,0,0}, nasm_bytecodes+17574, IF_8086|IF_FPU},
+    /*  353 */ {I_FIST, 1, {MEMORY|BITS32,0,0,0,0}, nasm_bytecodes+19250, IF_8086|IF_FPU},
+    /*  354 */ {I_FIST, 1, {MEMORY|BITS16,0,0,0,0}, nasm_bytecodes+19254, IF_8086|IF_FPU},
+    /*  355 */ {I_FISTP, 1, {MEMORY|BITS32,0,0,0,0}, nasm_bytecodes+19258, IF_8086|IF_FPU},
+    /*  356 */ {I_FISTP, 1, {MEMORY|BITS16,0,0,0,0}, nasm_bytecodes+19262, IF_8086|IF_FPU},
+    /*  357 */ {I_FISTP, 1, {MEMORY|BITS64,0,0,0,0}, nasm_bytecodes+19266, IF_8086|IF_FPU},
+    /*  358 */ {I_FISTTP, 1, {MEMORY|BITS16,0,0,0,0}, nasm_bytecodes+19270, IF_PRESCOTT|IF_FPU},
+    /*  359 */ {I_FISTTP, 1, {MEMORY|BITS32,0,0,0,0}, nasm_bytecodes+19274, IF_PRESCOTT|IF_FPU},
+    /*  360 */ {I_FISTTP, 1, {MEMORY|BITS64,0,0,0,0}, nasm_bytecodes+19278, IF_PRESCOTT|IF_FPU},
+    /*  361 */ {I_FISUB, 1, {MEMORY|BITS32,0,0,0,0}, nasm_bytecodes+19282, IF_8086|IF_FPU},
+    /*  362 */ {I_FISUB, 1, {MEMORY|BITS16,0,0,0,0}, nasm_bytecodes+19286, IF_8086|IF_FPU},
+    /*  363 */ {I_FISUBR, 1, {MEMORY|BITS32,0,0,0,0}, nasm_bytecodes+19290, IF_8086|IF_FPU},
+    /*  364 */ {I_FISUBR, 1, {MEMORY|BITS16,0,0,0,0}, nasm_bytecodes+19294, IF_8086|IF_FPU},
+    /*  365 */ {I_FLD, 1, {MEMORY|BITS32,0,0,0,0}, nasm_bytecodes+19298, IF_8086|IF_FPU},
+    /*  366 */ {I_FLD, 1, {MEMORY|BITS64,0,0,0,0}, nasm_bytecodes+19302, IF_8086|IF_FPU},
+    /*  367 */ {I_FLD, 1, {MEMORY|BITS80,0,0,0,0}, nasm_bytecodes+19306, IF_8086|IF_FPU},
+    /*  368 */ {I_FLD, 1, {FPUREG,0,0,0,0}, nasm_bytecodes+17579, IF_8086|IF_FPU},
+    /*  369 */ {I_FLD1, 0, {0,0,0,0,0}, nasm_bytecodes+19314, IF_8086|IF_FPU},
+    /*  370 */ {I_FLDCW, 1, {MEMORY,0,0,0,0}, nasm_bytecodes+19318, IF_8086|IF_FPU|IF_SW},
+    /*  371 */ {I_FLDENV, 1, {MEMORY,0,0,0,0}, nasm_bytecodes+19322, IF_8086|IF_FPU},
+    /*  372 */ {I_FLDL2E, 0, {0,0,0,0,0}, nasm_bytecodes+19326, IF_8086|IF_FPU},
+    /*  373 */ {I_FLDL2T, 0, {0,0,0,0,0}, nasm_bytecodes+19330, IF_8086|IF_FPU},
+    /*  374 */ {I_FLDLG2, 0, {0,0,0,0,0}, nasm_bytecodes+19334, IF_8086|IF_FPU},
+    /*  375 */ {I_FLDLN2, 0, {0,0,0,0,0}, nasm_bytecodes+19338, IF_8086|IF_FPU},
+    /*  376 */ {I_FLDPI, 0, {0,0,0,0,0}, nasm_bytecodes+19342, IF_8086|IF_FPU},
+    /*  377 */ {I_FLDZ, 0, {0,0,0,0,0}, nasm_bytecodes+19346, IF_8086|IF_FPU},
+    /*  378 */ {I_FMUL, 1, {MEMORY|BITS32,0,0,0,0}, nasm_bytecodes+19350, IF_8086|IF_FPU},
+    /*  379 */ {I_FMUL, 1, {MEMORY|BITS64,0,0,0,0}, nasm_bytecodes+19354, IF_8086|IF_FPU},
+    /*  380 */ {I_FMUL, 1, {FPUREG|TO,0,0,0,0}, nasm_bytecodes+17584, IF_8086|IF_FPU},
+    /*  381 */ {I_FMUL, 2, {FPUREG,FPU0,0,0,0}, nasm_bytecodes+17584, IF_8086|IF_FPU},
+    /*  382 */ {I_FMUL, 1, {FPUREG,0,0,0,0}, nasm_bytecodes+17589, IF_8086|IF_FPU},
+    /*  383 */ {I_FMUL, 2, {FPU0,FPUREG,0,0,0}, nasm_bytecodes+17594, IF_8086|IF_FPU},
+    /*  384 */ {I_FMULP, 1, {FPUREG,0,0,0,0}, nasm_bytecodes+17599, IF_8086|IF_FPU},
+    /*  385 */ {I_FMULP, 2, {FPUREG,FPU0,0,0,0}, nasm_bytecodes+17599, IF_8086|IF_FPU},
+    /*  386 */ {I_FNCLEX, 0, {0,0,0,0,0}, nasm_bytecodes+17390, IF_8086|IF_FPU},
+    /*  387 */ {I_FNDISI, 0, {0,0,0,0,0}, nasm_bytecodes+17515, IF_8086|IF_FPU},
+    /*  388 */ {I_FNENI, 0, {0,0,0,0,0}, nasm_bytecodes+17560, IF_8086|IF_FPU},
+    /*  389 */ {I_FNINIT, 0, {0,0,0,0,0}, nasm_bytecodes+17575, IF_8086|IF_FPU},
+    /*  390 */ {I_FNOP, 0, {0,0,0,0,0}, nasm_bytecodes+19362, IF_8086|IF_FPU},
+    /*  391 */ {I_FNSAVE, 1, {MEMORY,0,0,0,0}, nasm_bytecodes+17605, IF_8086|IF_FPU},
+    /*  392 */ {I_FNSTCW, 1, {MEMORY,0,0,0,0}, nasm_bytecodes+17615, IF_8086|IF_FPU|IF_SW},
+    /*  393 */ {I_FNSTENV, 1, {MEMORY,0,0,0,0}, nasm_bytecodes+17620, IF_8086|IF_FPU},
+    /*  394 */ {I_FNSTSW, 1, {MEMORY,0,0,0,0}, nasm_bytecodes+17630, IF_8086|IF_FPU|IF_SW},
+    /*  395 */ {I_FNSTSW, 1, {REG_AX,0,0,0,0}, nasm_bytecodes+17635, IF_286|IF_FPU},
+    /*  396 */ {I_FPATAN, 0, {0,0,0,0,0}, nasm_bytecodes+19366, IF_8086|IF_FPU},
+    /*  397 */ {I_FPREM, 0, {0,0,0,0,0}, nasm_bytecodes+19370, IF_8086|IF_FPU},
+    /*  398 */ {I_FPREM1, 0, {0,0,0,0,0}, nasm_bytecodes+19374, IF_386|IF_FPU},
+    /*  399 */ {I_FPTAN, 0, {0,0,0,0,0}, nasm_bytecodes+19378, IF_8086|IF_FPU},
+    /*  400 */ {I_FRNDINT, 0, {0,0,0,0,0}, nasm_bytecodes+19382, IF_8086|IF_FPU},
+    /*  401 */ {I_FRSTOR, 1, {MEMORY,0,0,0,0}, nasm_bytecodes+19386, IF_8086|IF_FPU},
+    /*  402 */ {I_FSAVE, 1, {MEMORY,0,0,0,0}, nasm_bytecodes+17604, IF_8086|IF_FPU},
+    /*  403 */ {I_FSCALE, 0, {0,0,0,0,0}, nasm_bytecodes+19390, IF_8086|IF_FPU},
+    /*  404 */ {I_FSETPM, 0, {0,0,0,0,0}, nasm_bytecodes+19394, IF_286|IF_FPU},
+    /*  405 */ {I_FSIN, 0, {0,0,0,0,0}, nasm_bytecodes+19398, IF_386|IF_FPU},
+    /*  406 */ {I_FSINCOS, 0, {0,0,0,0,0}, nasm_bytecodes+19402, IF_386|IF_FPU},
+    /*  407 */ {I_FSQRT, 0, {0,0,0,0,0}, nasm_bytecodes+19406, IF_8086|IF_FPU},
+    /*  408 */ {I_FST, 1, {MEMORY|BITS32,0,0,0,0}, nasm_bytecodes+19410, IF_8086|IF_FPU},
+    /*  409 */ {I_FST, 1, {MEMORY|BITS64,0,0,0,0}, nasm_bytecodes+19414, IF_8086|IF_FPU},
+    /*  410 */ {I_FST, 1, {FPUREG,0,0,0,0}, nasm_bytecodes+17609, IF_8086|IF_FPU},
+    /*  411 */ {I_FSTCW, 1, {MEMORY,0,0,0,0}, nasm_bytecodes+17614, IF_8086|IF_FPU|IF_SW},
+    /*  412 */ {I_FSTENV, 1, {MEMORY,0,0,0,0}, nasm_bytecodes+17619, IF_8086|IF_FPU},
+    /*  413 */ {I_FSTP, 1, {MEMORY|BITS32,0,0,0,0}, nasm_bytecodes+19422, IF_8086|IF_FPU},
+    /*  414 */ {I_FSTP, 1, {MEMORY|BITS64,0,0,0,0}, nasm_bytecodes+19426, IF_8086|IF_FPU},
+    /*  415 */ {I_FSTP, 1, {MEMORY|BITS80,0,0,0,0}, nasm_bytecodes+19430, IF_8086|IF_FPU},
+    /*  416 */ {I_FSTP, 1, {FPUREG,0,0,0,0}, nasm_bytecodes+17624, IF_8086|IF_FPU},
+    /*  417 */ {I_FSTSW, 1, {MEMORY,0,0,0,0}, nasm_bytecodes+17629, IF_8086|IF_FPU|IF_SW},
+    /*  418 */ {I_FSTSW, 1, {REG_AX,0,0,0,0}, nasm_bytecodes+17634, IF_286|IF_FPU},
+    /*  419 */ {I_FSUB, 1, {MEMORY|BITS32,0,0,0,0}, nasm_bytecodes+19438, IF_8086|IF_FPU},
+    /*  420 */ {I_FSUB, 1, {MEMORY|BITS64,0,0,0,0}, nasm_bytecodes+19442, IF_8086|IF_FPU},
+    /*  421 */ {I_FSUB, 1, {FPUREG|TO,0,0,0,0}, nasm_bytecodes+17639, IF_8086|IF_FPU},
+    /*  422 */ {I_FSUB, 2, {FPUREG,FPU0,0,0,0}, nasm_bytecodes+17639, IF_8086|IF_FPU},
+    /*  423 */ {I_FSUB, 1, {FPUREG,0,0,0,0}, nasm_bytecodes+17644, IF_8086|IF_FPU},
+    /*  424 */ {I_FSUB, 2, {FPU0,FPUREG,0,0,0}, nasm_bytecodes+17649, IF_8086|IF_FPU},
+    /*  425 */ {I_FSUBP, 1, {FPUREG,0,0,0,0}, nasm_bytecodes+17654, IF_8086|IF_FPU},
+    /*  426 */ {I_FSUBP, 2, {FPUREG,FPU0,0,0,0}, nasm_bytecodes+17654, IF_8086|IF_FPU},
+    /*  427 */ {I_FSUBR, 1, {MEMORY|BITS32,0,0,0,0}, nasm_bytecodes+19450, IF_8086|IF_FPU},
+    /*  428 */ {I_FSUBR, 1, {MEMORY|BITS64,0,0,0,0}, nasm_bytecodes+19454, IF_8086|IF_FPU},
+    /*  429 */ {I_FSUBR, 1, {FPUREG|TO,0,0,0,0}, nasm_bytecodes+17659, IF_8086|IF_FPU},
+    /*  430 */ {I_FSUBR, 2, {FPUREG,FPU0,0,0,0}, nasm_bytecodes+17659, IF_8086|IF_FPU},
+    /*  431 */ {I_FSUBR, 1, {FPUREG,0,0,0,0}, nasm_bytecodes+17664, IF_8086|IF_FPU},
+    /*  432 */ {I_FSUBR, 2, {FPU0,FPUREG,0,0,0}, nasm_bytecodes+17669, IF_8086|IF_FPU},
+    /*  433 */ {I_FSUBRP, 1, {FPUREG,0,0,0,0}, nasm_bytecodes+17674, IF_8086|IF_FPU},
+    /*  434 */ {I_FSUBRP, 2, {FPUREG,FPU0,0,0,0}, nasm_bytecodes+17674, IF_8086|IF_FPU},
+    /*  435 */ {I_FTST, 0, {0,0,0,0,0}, nasm_bytecodes+19462, IF_8086|IF_FPU},
+    /*  436 */ {I_FUCOM, 1, {FPUREG,0,0,0,0}, nasm_bytecodes+17679, IF_386|IF_FPU},
+    /*  437 */ {I_FUCOM, 2, {FPU0,FPUREG,0,0,0}, nasm_bytecodes+17684, IF_386|IF_FPU},
+    /*  438 */ {I_FUCOMI, 1, {FPUREG,0,0,0,0}, nasm_bytecodes+17689, IF_P6|IF_FPU},
+    /*  439 */ {I_FUCOMI, 2, {FPU0,FPUREG,0,0,0}, nasm_bytecodes+17694, IF_P6|IF_FPU},
+    /*  440 */ {I_FUCOMIP, 1, {FPUREG,0,0,0,0}, nasm_bytecodes+17699, IF_P6|IF_FPU},
+    /*  441 */ {I_FUCOMIP, 2, {FPU0,FPUREG,0,0,0}, nasm_bytecodes+17704, IF_P6|IF_FPU},
+    /*  442 */ {I_FUCOMP, 1, {FPUREG,0,0,0,0}, nasm_bytecodes+17709, IF_386|IF_FPU},
+    /*  443 */ {I_FUCOMP, 2, {FPU0,FPUREG,0,0,0}, nasm_bytecodes+17714, IF_386|IF_FPU},
+    /*  444 */ {I_FUCOMPP, 0, {0,0,0,0,0}, nasm_bytecodes+19482, IF_386|IF_FPU},
+    /*  445 */ {I_FXAM, 0, {0,0,0,0,0}, nasm_bytecodes+19486, IF_8086|IF_FPU},
+    /*  446 */ {I_FXCH, 1, {FPUREG,0,0,0,0}, nasm_bytecodes+17719, IF_8086|IF_FPU},
+    /*  447 */ {I_FXCH, 2, {FPUREG,FPU0,0,0,0}, nasm_bytecodes+17719, IF_8086|IF_FPU},
+    /*  448 */ {I_FXCH, 2, {FPU0,FPUREG,0,0,0}, nasm_bytecodes+17724, IF_8086|IF_FPU},
+    /*  449 */ {I_FXTRACT, 0, {0,0,0,0,0}, nasm_bytecodes+19494, IF_8086|IF_FPU},
+    /*  450 */ {I_FYL2X, 0, {0,0,0,0,0}, nasm_bytecodes+19498, IF_8086|IF_FPU},
+    /*  451 */ {I_FYL2XP1, 0, {0,0,0,0,0}, nasm_bytecodes+19502, IF_8086|IF_FPU},
+    /*  452 */ {I_HLT, 0, {0,0,0,0,0}, nasm_bytecodes+19983, IF_8086|IF_PRIV},
+    /*  453 */ {I_IDIV, 1, {RM_GPR|BITS8,0,0,0,0}, nasm_bytecodes+19506, IF_8086},
+    /*  454 */ {I_IDIV, 1, {RM_GPR|BITS16,0,0,0,0}, nasm_bytecodes+17729, IF_8086},
+    /*  455 */ {I_IDIV, 1, {RM_GPR|BITS32,0,0,0,0}, nasm_bytecodes+17734, IF_386},
+    /*  456 */ {I_IDIV, 1, {RM_GPR|BITS64,0,0,0,0}, nasm_bytecodes+17739, IF_X64},
+    /*  457 */ {I_IMUL, 1, {RM_GPR|BITS8,0,0,0,0}, nasm_bytecodes+19510, IF_8086},
+    /*  458 */ {I_IMUL, 1, {RM_GPR|BITS16,0,0,0,0}, nasm_bytecodes+17744, IF_8086},
+    /*  459 */ {I_IMUL, 1, {RM_GPR|BITS32,0,0,0,0}, nasm_bytecodes+17749, IF_386},
+    /*  460 */ {I_IMUL, 1, {RM_GPR|BITS64,0,0,0,0}, nasm_bytecodes+17754, IF_X64},
+    /*  461 */ {I_IMUL, 2, {REG_GPR|BITS16,MEMORY,0,0,0}, nasm_bytecodes+13872, IF_386|IF_SM},
+    /*  462 */ {I_IMUL, 2, {REG_GPR|BITS16,REG_GPR|BITS16,0,0,0}, nasm_bytecodes+13872, IF_386},
+    /*  463 */ {I_IMUL, 2, {REG_GPR|BITS32,MEMORY,0,0,0}, nasm_bytecodes+13878, IF_386|IF_SM},
+    /*  464 */ {I_IMUL, 2, {REG_GPR|BITS32,REG_GPR|BITS32,0,0,0}, nasm_bytecodes+13878, IF_386},
+    /*  465 */ {I_IMUL, 2, {REG_GPR|BITS64,MEMORY,0,0,0}, nasm_bytecodes+13884, IF_X64|IF_SM},
+    /*  466 */ {I_IMUL, 2, {REG_GPR|BITS64,REG_GPR|BITS64,0,0,0}, nasm_bytecodes+13884, IF_X64},
+    /*  467 */ {I_IMUL, 3, {REG_GPR|BITS16,MEMORY,IMMEDIATE|BITS8,0,0}, nasm_bytecodes+13890, IF_186|IF_SM},
+    /*  468 */ {I_IMUL, 3, {REG_GPR|BITS16,MEMORY,IMMEDIATE|BITS16,0,0}, nasm_bytecodes+13896, IF_186|IF_SM},
+    /*  469 */ {I_IMUL, 3, {REG_GPR|BITS16,REG_GPR|BITS16,IMMEDIATE|BITS8,0,0}, nasm_bytecodes+13890, IF_186},
+    /*  470 */ {I_IMUL, 3, {REG_GPR|BITS16,REG_GPR|BITS16,IMMEDIATE|BITS16,0,0}, nasm_bytecodes+13896, IF_186},
+    /*  471 */ {I_IMUL, 3, {REG_GPR|BITS32,MEMORY,IMMEDIATE|BITS8,0,0}, nasm_bytecodes+13908, IF_386|IF_SM},
+    /*  472 */ {I_IMUL, 3, {REG_GPR|BITS32,MEMORY,IMMEDIATE|BITS32,0,0}, nasm_bytecodes+13914, IF_386|IF_SM},
+    /*  473 */ {I_IMUL, 3, {REG_GPR|BITS32,REG_GPR|BITS32,IMMEDIATE|BITS8,0,0}, nasm_bytecodes+13908, IF_386},
+    /*  474 */ {I_IMUL, 3, {REG_GPR|BITS32,REG_GPR|BITS32,IMMEDIATE|BITS32,0,0}, nasm_bytecodes+13914, IF_386},
+    /*  475 */ {I_IMUL, 3, {REG_GPR|BITS64,MEMORY,IMMEDIATE|BITS8,0,0}, nasm_bytecodes+13926, IF_X64|IF_SM},
+    /*  476 */ {I_IMUL, 3, {REG_GPR|BITS64,MEMORY,IMMEDIATE|BITS32,0,0}, nasm_bytecodes+13932, IF_X64|IF_SM},
+    /*  477 */ {I_IMUL, 3, {REG_GPR|BITS64,REG_GPR|BITS64,IMMEDIATE|BITS8,0,0}, nasm_bytecodes+13926, IF_X64},
+    /*  478 */ {I_IMUL, 3, {REG_GPR|BITS64,REG_GPR|BITS64,IMMEDIATE|BITS32,0,0}, nasm_bytecodes+13932, IF_X64},
+    /*  479 */ {I_IMUL, 2, {REG_GPR|BITS16,IMMEDIATE|BITS8,0,0,0}, nasm_bytecodes+13944, IF_186},
+    /*  480 */ {I_IMUL, 2, {REG_GPR|BITS16,IMMEDIATE|BITS16,0,0,0}, nasm_bytecodes+13950, IF_186},
+    /*  481 */ {I_IMUL, 2, {REG_GPR|BITS32,IMMEDIATE|BITS8,0,0,0}, nasm_bytecodes+13962, IF_386},
+    /*  482 */ {I_IMUL, 2, {REG_GPR|BITS32,IMMEDIATE|BITS32,0,0,0}, nasm_bytecodes+13968, IF_386},
+    /*  483 */ {I_IMUL, 2, {REG_GPR|BITS64,IMMEDIATE|BITS8,0,0,0}, nasm_bytecodes+13980, IF_X64},
+    /*  484 */ {I_IMUL, 2, {REG_GPR|BITS64,IMMEDIATE|BITS32,0,0,0}, nasm_bytecodes+13986, IF_X64},
+    /*  485 */ {I_IN, 2, {REG_AL,IMMEDIATE,0,0,0}, nasm_bytecodes+19514, IF_8086|IF_SB},
+    /*  486 */ {I_IN, 2, {REG_AX,IMMEDIATE,0,0,0}, nasm_bytecodes+17759, IF_8086|IF_SB},
+    /*  487 */ {I_IN, 2, {REG_EAX,IMMEDIATE,0,0,0}, nasm_bytecodes+17764, IF_386|IF_SB},
+    /*  488 */ {I_IN, 2, {REG_AL,REG_DX,0,0,0}, nasm_bytecodes+19989, IF_8086},
+    /*  489 */ {I_IN, 2, {REG_AX,REG_DX,0,0,0}, nasm_bytecodes+19518, IF_8086},
+    /*  490 */ {I_IN, 2, {REG_EAX,REG_DX,0,0,0}, nasm_bytecodes+19522, IF_386},
+    /*  491 */ {I_INC, 1, {REG_GPR|BITS16,0,0,0,0}, nasm_bytecodes+19526, IF_8086|IF_NOLONG},
+    /*  492 */ {I_INC, 1, {REG_GPR|BITS32,0,0,0,0}, nasm_bytecodes+19530, IF_386|IF_NOLONG},
+    /*  493 */ {I_INC, 1, {RM_GPR|BITS8,0,0,0,0}, nasm_bytecodes+19534, IF_8086},
+    /*  494 */ {I_INC, 1, {RM_GPR|BITS16,0,0,0,0}, nasm_bytecodes+17769, IF_8086},
+    /*  495 */ {I_INC, 1, {RM_GPR|BITS32,0,0,0,0}, nasm_bytecodes+17774, IF_386},
+    /*  496 */ {I_INC, 1, {RM_GPR|BITS64,0,0,0,0}, nasm_bytecodes+17779, IF_X64},
+    /*  497 */ {I_INSB, 0, {0,0,0,0,0}, nasm_bytecodes+19992, IF_186},
+    /*  498 */ {I_INSD, 0, {0,0,0,0,0}, nasm_bytecodes+19538, IF_386},
+    /*  499 */ {I_INSW, 0, {0,0,0,0,0}, nasm_bytecodes+19542, IF_186},
+    /*  500 */ {I_INT, 1, {IMMEDIATE,0,0,0,0}, nasm_bytecodes+19546, IF_8086|IF_SB},
+    /*  501 */ {I_INT1, 0, {0,0,0,0,0}, nasm_bytecodes+19986, IF_386},
+    /*  502 */ {I_INT3, 0, {0,0,0,0,0}, nasm_bytecodes+19995, IF_8086},
+    /*  503 */ {I_INTO, 0, {0,0,0,0,0}, nasm_bytecodes+19998, IF_8086|IF_NOLONG},
+    /*  504 */ {I_INVD, 0, {0,0,0,0,0}, nasm_bytecodes+19550, IF_486|IF_PRIV},
+    /*  505 */ {I_INVLPG, 1, {MEMORY,0,0,0,0}, nasm_bytecodes+17784, IF_486|IF_PRIV},
+    /*  506 */ {I_INVLPGA, 2, {REG_AX,REG_ECX,0,0,0}, nasm_bytecodes+13998, IF_X86_64|IF_AMD|IF_NOLONG},
+    /*  507 */ {I_INVLPGA, 2, {REG_EAX,REG_ECX,0,0,0}, nasm_bytecodes+14004, IF_X86_64|IF_AMD},
+    /*  508 */ {I_INVLPGA, 2, {REG_RAX,REG_ECX,0,0,0}, nasm_bytecodes+7320, IF_X64|IF_AMD},
+    /*  509 */ {I_INVLPGA, 0, {0,0,0,0,0}, nasm_bytecodes+14005, IF_X86_64|IF_AMD},
+    /*  510 */ {I_IRET, 0, {0,0,0,0,0}, nasm_bytecodes+19554, IF_8086},
+    /*  511 */ {I_IRETD, 0, {0,0,0,0,0}, nasm_bytecodes+19558, IF_386},
+    /*  512 */ {I_IRETQ, 0, {0,0,0,0,0}, nasm_bytecodes+19562, IF_X64},
+    /*  513 */ {I_IRETW, 0, {0,0,0,0,0}, nasm_bytecodes+19566, IF_8086},
+    /*  514 */ {I_JCXZ, 1, {IMMEDIATE,0,0,0,0}, nasm_bytecodes+17789, IF_8086|IF_NOLONG},
+    /*  515 */ {I_JECXZ, 1, {IMMEDIATE,0,0,0,0}, nasm_bytecodes+17794, IF_386},
+    /*  516 */ {I_JRCXZ, 1, {IMMEDIATE,0,0,0,0}, nasm_bytecodes+17799, IF_X64},
+    /*  517 */ {I_JMP, 1, {IMMEDIATE|SHORT,0,0,0,0}, nasm_bytecodes+17805, IF_8086},
+    /*  518 */ {I_JMP, 1, {IMMEDIATE,0,0,0,0}, nasm_bytecodes+17809, IF_8086},
+    /*  519 */ {I_JMP, 1, {IMMEDIATE|BITS16,0,0,0,0}, nasm_bytecodes+17814, IF_8086},
+    /*  520 */ {I_JMP, 1, {IMMEDIATE|BITS32,0,0,0,0}, nasm_bytecodes+17819, IF_386},
+    /*  521 */ {I_JMP, 2, {IMMEDIATE|COLON,IMMEDIATE,0,0,0}, nasm_bytecodes+14028, IF_8086|IF_NOLONG},
+    /*  522 */ {I_JMP, 2, {IMMEDIATE|BITS16|COLON,IMMEDIATE,0,0,0}, nasm_bytecodes+14034, IF_8086|IF_NOLONG},
+    /*  523 */ {I_JMP, 2, {IMMEDIATE|COLON,IMMEDIATE|BITS16,0,0,0}, nasm_bytecodes+14034, IF_8086|IF_NOLONG},
+    /*  524 */ {I_JMP, 2, {IMMEDIATE|BITS32|COLON,IMMEDIATE,0,0,0}, nasm_bytecodes+14040, IF_386|IF_NOLONG},
+    /*  525 */ {I_JMP, 2, {IMMEDIATE|COLON,IMMEDIATE|BITS32,0,0,0}, nasm_bytecodes+14040, IF_386|IF_NOLONG},
+    /*  526 */ {I_JMP, 1, {MEMORY|FAR,0,0,0,0}, nasm_bytecodes+17824, IF_8086|IF_NOLONG},
+    /*  527 */ {I_JMP, 1, {MEMORY|FAR,0,0,0,0}, nasm_bytecodes+17829, IF_X64},
+    /*  528 */ {I_JMP, 1, {MEMORY|BITS16|FAR,0,0,0,0}, nasm_bytecodes+17834, IF_8086},
+    /*  529 */ {I_JMP, 1, {MEMORY|BITS32|FAR,0,0,0,0}, nasm_bytecodes+17839, IF_386},
+    /*  530 */ {I_JMP, 1, {MEMORY|BITS64|FAR,0,0,0,0}, nasm_bytecodes+17829, IF_X64},
+    /*  531 */ {I_JMP, 1, {MEMORY|NEAR,0,0,0,0}, nasm_bytecodes+17844, IF_8086},
+    /*  532 */ {I_JMP, 1, {MEMORY|BITS16|NEAR,0,0,0,0}, nasm_bytecodes+17849, IF_8086},
+    /*  533 */ {I_JMP, 1, {MEMORY|BITS32|NEAR,0,0,0,0}, nasm_bytecodes+17854, IF_386|IF_NOLONG},
+    /*  534 */ {I_JMP, 1, {MEMORY|BITS64|NEAR,0,0,0,0}, nasm_bytecodes+17859, IF_X64},
+    /*  535 */ {I_JMP, 1, {REG_GPR|BITS16,0,0,0,0}, nasm_bytecodes+17849, IF_8086},
+    /*  536 */ {I_JMP, 1, {REG_GPR|BITS32,0,0,0,0}, nasm_bytecodes+17854, IF_386|IF_NOLONG},
+    /*  537 */ {I_JMP, 1, {REG_GPR|BITS64,0,0,0,0}, nasm_bytecodes+17859, IF_X64},
+    /*  538 */ {I_JMP, 1, {MEMORY,0,0,0,0}, nasm_bytecodes+17844, IF_8086},
+    /*  539 */ {I_JMP, 1, {MEMORY|BITS16,0,0,0,0}, nasm_bytecodes+17849, IF_8086},
+    /*  540 */ {I_JMP, 1, {MEMORY|BITS32,0,0,0,0}, nasm_bytecodes+17854, IF_386|IF_NOLONG},
+    /*  541 */ {I_JMP, 1, {MEMORY|BITS64,0,0,0,0}, nasm_bytecodes+17859, IF_X64},
+    /*  542 */ {I_JMPE, 1, {IMMEDIATE,0,0,0,0}, nasm_bytecodes+14046, IF_IA64},
+    /*  543 */ {I_JMPE, 1, {IMMEDIATE|BITS16,0,0,0,0}, nasm_bytecodes+14052, IF_IA64},
+    /*  544 */ {I_JMPE, 1, {IMMEDIATE|BITS32,0,0,0,0}, nasm_bytecodes+14058, IF_IA64},
+    /*  545 */ {I_JMPE, 1, {RM_GPR|BITS16,0,0,0,0}, nasm_bytecodes+14064, IF_IA64},
+    /*  546 */ {I_JMPE, 1, {RM_GPR|BITS32,0,0,0,0}, nasm_bytecodes+14070, IF_IA64},
+    /*  547 */ {I_LAHF, 0, {0,0,0,0,0}, nasm_bytecodes+20001, IF_8086},
+    /*  548 */ {I_LAR, 2, {REG_GPR|BITS16,MEMORY,0,0,0}, nasm_bytecodes+14076, IF_286|IF_PROT|IF_SW},
+    /*  549 */ {I_LAR, 2, {REG_GPR|BITS16,REG_GPR|BITS16,0,0,0}, nasm_bytecodes+14076, IF_286|IF_PROT},
+    /*  550 */ {I_LAR, 2, {REG_GPR|BITS16,REG_GPR|BITS32,0,0,0}, nasm_bytecodes+14076, IF_386|IF_PROT},
+    /*  551 */ {I_LAR, 2, {REG_GPR|BITS32,MEMORY,0,0,0}, nasm_bytecodes+14082, IF_386|IF_PROT|IF_SW},
+    /*  552 */ {I_LAR, 2, {REG_GPR|BITS32,REG_GPR|BITS16,0,0,0}, nasm_bytecodes+14082, IF_386|IF_PROT},
+    /*  553 */ {I_LAR, 2, {REG_GPR|BITS32,REG_GPR|BITS32,0,0,0}, nasm_bytecodes+14082, IF_386|IF_PROT},
+    /*  554 */ {I_LAR, 2, {REG_GPR|BITS64,MEMORY,0,0,0}, nasm_bytecodes+14088, IF_X64|IF_PROT|IF_SW},
+    /*  555 */ {I_LAR, 2, {REG_GPR|BITS64,REG_GPR|BITS16,0,0,0}, nasm_bytecodes+14088, IF_X64|IF_PROT},
+    /*  556 */ {I_LAR, 2, {REG_GPR|BITS64,REG_GPR|BITS32,0,0,0}, nasm_bytecodes+14088, IF_X64|IF_PROT},
+    /*  557 */ {I_LAR, 2, {REG_GPR|BITS64,REG_GPR|BITS64,0,0,0}, nasm_bytecodes+14088, IF_X64|IF_PROT},
+    /*  558 */ {I_LDS, 2, {REG_GPR|BITS16,MEMORY,0,0,0}, nasm_bytecodes+17864, IF_8086|IF_NOLONG},
+    /*  559 */ {I_LDS, 2, {REG_GPR|BITS32,MEMORY,0,0,0}, nasm_bytecodes+17869, IF_386|IF_NOLONG},
+    /*  560 */ {I_LEA, 2, {REG_GPR|BITS16,MEMORY,0,0,0}, nasm_bytecodes+17874, IF_8086},
+    /*  561 */ {I_LEA, 2, {REG_GPR|BITS32,MEMORY,0,0,0}, nasm_bytecodes+17879, IF_386},
+    /*  562 */ {I_LEA, 2, {REG_GPR|BITS64,MEMORY,0,0,0}, nasm_bytecodes+17884, IF_X64},
+    /*  563 */ {I_LEAVE, 0, {0,0,0,0,0}, nasm_bytecodes+18121, IF_186},
+    /*  564 */ {I_LES, 2, {REG_GPR|BITS16,MEMORY,0,0,0}, nasm_bytecodes+17889, IF_8086|IF_NOLONG},
+    /*  565 */ {I_LES, 2, {REG_GPR|BITS32,MEMORY,0,0,0}, nasm_bytecodes+17894, IF_386|IF_NOLONG},
+    /*  566 */ {I_LFENCE, 0, {0,0,0,0,0}, nasm_bytecodes+17899, IF_X64|IF_AMD},
+    /*  567 */ {I_LFS, 2, {REG_GPR|BITS16,MEMORY,0,0,0}, nasm_bytecodes+14094, IF_386},
+    /*  568 */ {I_LFS, 2, {REG_GPR|BITS32,MEMORY,0,0,0}, nasm_bytecodes+14100, IF_386},
+    /*  569 */ {I_LGDT, 1, {MEMORY,0,0,0,0}, nasm_bytecodes+17904, IF_286|IF_PRIV},
+    /*  570 */ {I_LGS, 2, {REG_GPR|BITS16,MEMORY,0,0,0}, nasm_bytecodes+14106, IF_386},
+    /*  571 */ {I_LGS, 2, {REG_GPR|BITS32,MEMORY,0,0,0}, nasm_bytecodes+14112, IF_386},
+    /*  572 */ {I_LIDT, 1, {MEMORY,0,0,0,0}, nasm_bytecodes+17909, IF_286|IF_PRIV},
+    /*  573 */ {I_LLDT, 1, {MEMORY,0,0,0,0}, nasm_bytecodes+17914, IF_286|IF_PROT|IF_PRIV},
+    /*  574 */ {I_LLDT, 1, {MEMORY|BITS16,0,0,0,0}, nasm_bytecodes+17914, IF_286|IF_PROT|IF_PRIV},
+    /*  575 */ {I_LLDT, 1, {REG_GPR|BITS16,0,0,0,0}, nasm_bytecodes+17914, IF_286|IF_PROT|IF_PRIV},
+    /*  576 */ {I_LMSW, 1, {MEMORY,0,0,0,0}, nasm_bytecodes+17919, IF_286|IF_PRIV},
+    /*  577 */ {I_LMSW, 1, {MEMORY|BITS16,0,0,0,0}, nasm_bytecodes+17919, IF_286|IF_PRIV},
+    /*  578 */ {I_LMSW, 1, {REG_GPR|BITS16,0,0,0,0}, nasm_bytecodes+17919, IF_286|IF_PRIV},
+    /*  579 */ {I_LOADALL, 0, {0,0,0,0,0}, nasm_bytecodes+19570, IF_386|IF_UNDOC},
+    /*  580 */ {I_LOADALL286, 0, {0,0,0,0,0}, nasm_bytecodes+19574, IF_286|IF_UNDOC},
+    /*  581 */ {I_LODSB, 0, {0,0,0,0,0}, nasm_bytecodes+20004, IF_8086},
+    /*  582 */ {I_LODSD, 0, {0,0,0,0,0}, nasm_bytecodes+19578, IF_386},
+    /*  583 */ {I_LODSQ, 0, {0,0,0,0,0}, nasm_bytecodes+19582, IF_X64},
+    /*  584 */ {I_LODSW, 0, {0,0,0,0,0}, nasm_bytecodes+19586, IF_8086},
+    /*  585 */ {I_LOOP, 1, {IMMEDIATE,0,0,0,0}, nasm_bytecodes+17924, IF_8086},
+    /*  586 */ {I_LOOP, 2, {IMMEDIATE,REG_CX,0,0,0}, nasm_bytecodes+17929, IF_8086|IF_NOLONG},
+    /*  587 */ {I_LOOP, 2, {IMMEDIATE,REG_ECX,0,0,0}, nasm_bytecodes+17934, IF_386},
+    /*  588 */ {I_LOOP, 2, {IMMEDIATE,REG_RCX,0,0,0}, nasm_bytecodes+17939, IF_X64},
+    /*  589 */ {I_LOOPE, 1, {IMMEDIATE,0,0,0,0}, nasm_bytecodes+17944, IF_8086},
+    /*  590 */ {I_LOOPE, 2, {IMMEDIATE,REG_CX,0,0,0}, nasm_bytecodes+17949, IF_8086|IF_NOLONG},
+    /*  591 */ {I_LOOPE, 2, {IMMEDIATE,REG_ECX,0,0,0}, nasm_bytecodes+17954, IF_386},
+    /*  592 */ {I_LOOPE, 2, {IMMEDIATE,REG_RCX,0,0,0}, nasm_bytecodes+17959, IF_X64},
+    /*  593 */ {I_LOOPNE, 1, {IMMEDIATE,0,0,0,0}, nasm_bytecodes+17964, IF_8086},
+    /*  594 */ {I_LOOPNE, 2, {IMMEDIATE,REG_CX,0,0,0}, nasm_bytecodes+17969, IF_8086|IF_NOLONG},
+    /*  595 */ {I_LOOPNE, 2, {IMMEDIATE,REG_ECX,0,0,0}, nasm_bytecodes+17974, IF_386},
+    /*  596 */ {I_LOOPNE, 2, {IMMEDIATE,REG_RCX,0,0,0}, nasm_bytecodes+17979, IF_X64},
+    /*  597 */ {I_LOOPNZ, 1, {IMMEDIATE,0,0,0,0}, nasm_bytecodes+17964, IF_8086},
+    /*  598 */ {I_LOOPNZ, 2, {IMMEDIATE,REG_CX,0,0,0}, nasm_bytecodes+17969, IF_8086|IF_NOLONG},
+    /*  599 */ {I_LOOPNZ, 2, {IMMEDIATE,REG_ECX,0,0,0}, nasm_bytecodes+17974, IF_386},
+    /*  600 */ {I_LOOPNZ, 2, {IMMEDIATE,REG_RCX,0,0,0}, nasm_bytecodes+17979, IF_X64},
+    /*  601 */ {I_LOOPZ, 1, {IMMEDIATE,0,0,0,0}, nasm_bytecodes+17944, IF_8086},
+    /*  602 */ {I_LOOPZ, 2, {IMMEDIATE,REG_CX,0,0,0}, nasm_bytecodes+17949, IF_8086|IF_NOLONG},
+    /*  603 */ {I_LOOPZ, 2, {IMMEDIATE,REG_ECX,0,0,0}, nasm_bytecodes+17954, IF_386},
+    /*  604 */ {I_LOOPZ, 2, {IMMEDIATE,REG_RCX,0,0,0}, nasm_bytecodes+17959, IF_X64},
+    /*  605 */ {I_LSL, 2, {REG_GPR|BITS16,MEMORY,0,0,0}, nasm_bytecodes+14118, IF_286|IF_PROT|IF_SW},
+    /*  606 */ {I_LSL, 2, {REG_GPR|BITS16,REG_GPR|BITS16,0,0,0}, nasm_bytecodes+14118, IF_286|IF_PROT},
+    /*  607 */ {I_LSL, 2, {REG_GPR|BITS16,REG_GPR|BITS32,0,0,0}, nasm_bytecodes+14118, IF_386|IF_PROT},
+    /*  608 */ {I_LSL, 2, {REG_GPR|BITS32,MEMORY,0,0,0}, nasm_bytecodes+14124, IF_386|IF_PROT|IF_SW},
+    /*  609 */ {I_LSL, 2, {REG_GPR|BITS32,REG_GPR|BITS16,0,0,0}, nasm_bytecodes+14124, IF_386|IF_PROT},
+    /*  610 */ {I_LSL, 2, {REG_GPR|BITS32,REG_GPR|BITS32,0,0,0}, nasm_bytecodes+14124, IF_386|IF_PROT},
+    /*  611 */ {I_LSL, 2, {REG_GPR|BITS64,MEMORY,0,0,0}, nasm_bytecodes+14130, IF_X64|IF_PROT|IF_SW},
+    /*  612 */ {I_LSL, 2, {REG_GPR|BITS64,REG_GPR|BITS16,0,0,0}, nasm_bytecodes+14130, IF_X64|IF_PROT},
+    /*  613 */ {I_LSL, 2, {REG_GPR|BITS64,REG_GPR|BITS32,0,0,0}, nasm_bytecodes+14130, IF_X64|IF_PROT},
+    /*  614 */ {I_LSL, 2, {REG_GPR|BITS64,REG_GPR|BITS64,0,0,0}, nasm_bytecodes+14130, IF_X64|IF_PROT},
+    /*  615 */ {I_LSS, 2, {REG_GPR|BITS16,MEMORY,0,0,0}, nasm_bytecodes+14136, IF_386},
+    /*  616 */ {I_LSS, 2, {REG_GPR|BITS32,MEMORY,0,0,0}, nasm_bytecodes+14142, IF_386},
+    /*  617 */ {I_LTR, 1, {MEMORY,0,0,0,0}, nasm_bytecodes+17984, IF_286|IF_PROT|IF_PRIV},
+    /*  618 */ {I_LTR, 1, {MEMORY|BITS16,0,0,0,0}, nasm_bytecodes+17984, IF_286|IF_PROT|IF_PRIV},
+    /*  619 */ {I_LTR, 1, {REG_GPR|BITS16,0,0,0,0}, nasm_bytecodes+17984, IF_286|IF_PROT|IF_PRIV},
+    /*  620 */ {I_MFENCE, 0, {0,0,0,0,0}, nasm_bytecodes+17989, IF_X64|IF_AMD},
+    /*  621 */ {I_MONITOR, 0, {0,0,0,0,0}, nasm_bytecodes+17994, IF_PRESCOTT},
+    /*  622 */ {I_MOV, 2, {MEMORY,REG_SREG,0,0,0}, nasm_bytecodes+18005, IF_8086|IF_SM},
+    /*  623 */ {I_MOV, 2, {REG_GPR|BITS16,REG_SREG,0,0,0}, nasm_bytecodes+17999, IF_8086},
+    /*  624 */ {I_MOV, 2, {REG_GPR|BITS32,REG_SREG,0,0,0}, nasm_bytecodes+18004, IF_386},
+    /*  625 */ {I_MOV, 2, {REG_SREG,MEMORY,0,0,0}, nasm_bytecodes+19590, IF_8086|IF_SM},
+    /*  626 */ {I_MOV, 2, {REG_SREG,REG_GPR|BITS16,0,0,0}, nasm_bytecodes+19590, IF_8086},
+    /*  627 */ {I_MOV, 2, {REG_SREG,REG_GPR|BITS32,0,0,0}, nasm_bytecodes+19590, IF_386},
+    /*  628 */ {I_MOV, 2, {REG_AL,MEM_OFFS,0,0,0}, nasm_bytecodes+19594, IF_8086|IF_SM},
+    /*  629 */ {I_MOV, 2, {REG_AX,MEM_OFFS,0,0,0}, nasm_bytecodes+18009, IF_8086|IF_SM},
+    /*  630 */ {I_MOV, 2, {REG_EAX,MEM_OFFS,0,0,0}, nasm_bytecodes+18014, IF_386|IF_SM},
+    /*  631 */ {I_MOV, 2, {REG_RAX,MEM_OFFS,0,0,0}, nasm_bytecodes+18019, IF_X64|IF_SM},
+    /*  632 */ {I_MOV, 2, {MEM_OFFS,REG_AL,0,0,0}, nasm_bytecodes+19598, IF_8086|IF_SM},
+    /*  633 */ {I_MOV, 2, {MEM_OFFS,REG_AX,0,0,0}, nasm_bytecodes+18024, IF_8086|IF_SM},
+    /*  634 */ {I_MOV, 2, {MEM_OFFS,REG_EAX,0,0,0}, nasm_bytecodes+18029, IF_386|IF_SM},
+    /*  635 */ {I_MOV, 2, {MEM_OFFS,REG_RAX,0,0,0}, nasm_bytecodes+18034, IF_X64|IF_SM},
+    /*  636 */ {I_MOV, 2, {REG_GPR|BITS32,REG_CREG,0,0,0}, nasm_bytecodes+14148, IF_386|IF_PRIV|IF_NOLONG},
+    /*  637 */ {I_MOV, 2, {REG_GPR|BITS64,REG_CREG,0,0,0}, nasm_bytecodes+14154, IF_X64|IF_PRIV},
+    /*  638 */ {I_MOV, 2, {REG_CREG,REG_GPR|BITS32,0,0,0}, nasm_bytecodes+14160, IF_386|IF_PRIV|IF_NOLONG},
+    /*  639 */ {I_MOV, 2, {REG_CREG,REG_GPR|BITS64,0,0,0}, nasm_bytecodes+14166, IF_X64|IF_PRIV},
+    /*  640 */ {I_MOV, 2, {REG_GPR|BITS32,REG_DREG,0,0,0}, nasm_bytecodes+14173, IF_386|IF_PRIV|IF_NOLONG},
+    /*  641 */ {I_MOV, 2, {REG_GPR|BITS64,REG_DREG,0,0,0}, nasm_bytecodes+14172, IF_X64|IF_PRIV},
+    /*  642 */ {I_MOV, 2, {REG_DREG,REG_GPR|BITS32,0,0,0}, nasm_bytecodes+14179, IF_386|IF_PRIV|IF_NOLONG},
+    /*  643 */ {I_MOV, 2, {REG_DREG,REG_GPR|BITS64,0,0,0}, nasm_bytecodes+14178, IF_X64|IF_PRIV},
+    /*  644 */ {I_MOV, 2, {MEMORY,REG_GPR|BITS8,0,0,0}, nasm_bytecodes+19602, IF_8086|IF_SM},
+    /*  645 */ {I_MOV, 2, {REG_GPR|BITS8,REG_GPR|BITS8,0,0,0}, nasm_bytecodes+19602, IF_8086},
+    /*  646 */ {I_MOV, 2, {MEMORY,REG_GPR|BITS16,0,0,0}, nasm_bytecodes+18049, IF_8086|IF_SM},
+    /*  647 */ {I_MOV, 2, {REG_GPR|BITS16,REG_GPR|BITS16,0,0,0}, nasm_bytecodes+18049, IF_8086},
+    /*  648 */ {I_MOV, 2, {MEMORY,REG_GPR|BITS32,0,0,0}, nasm_bytecodes+18054, IF_386|IF_SM},
+    /*  649 */ {I_MOV, 2, {REG_GPR|BITS32,REG_GPR|BITS32,0,0,0}, nasm_bytecodes+18054, IF_386},
+    /*  650 */ {I_MOV, 2, {MEMORY,REG_GPR|BITS64,0,0,0}, nasm_bytecodes+18059, IF_X64|IF_SM},
+    /*  651 */ {I_MOV, 2, {REG_GPR|BITS64,REG_GPR|BITS64,0,0,0}, nasm_bytecodes+18059, IF_X64},
+    /*  652 */ {I_MOV, 2, {REG_GPR|BITS8,MEMORY,0,0,0}, nasm_bytecodes+19606, IF_8086|IF_SM},
+    /*  653 */ {I_MOV, 2, {REG_GPR|BITS8,REG_GPR|BITS8,0,0,0}, nasm_bytecodes+19606, IF_8086},
+    /*  654 */ {I_MOV, 2, {REG_GPR|BITS16,MEMORY,0,0,0}, nasm_bytecodes+18064, IF_8086|IF_SM},
+    /*  655 */ {I_MOV, 2, {REG_GPR|BITS16,REG_GPR|BITS16,0,0,0}, nasm_bytecodes+18064, IF_8086},
+    /*  656 */ {I_MOV, 2, {REG_GPR|BITS32,MEMORY,0,0,0}, nasm_bytecodes+18069, IF_386|IF_SM},
+    /*  657 */ {I_MOV, 2, {REG_GPR|BITS32,REG_GPR|BITS32,0,0,0}, nasm_bytecodes+18069, IF_386},
+    /*  658 */ {I_MOV, 2, {REG_GPR|BITS64,MEMORY,0,0,0}, nasm_bytecodes+18074, IF_X64|IF_SM},
+    /*  659 */ {I_MOV, 2, {REG_GPR|BITS64,REG_GPR|BITS64,0,0,0}, nasm_bytecodes+18074, IF_X64},
+    /*  660 */ {I_MOV, 2, {REG_GPR|BITS8,IMMEDIATE,0,0,0}, nasm_bytecodes+19610, IF_8086|IF_SM},
+    /*  661 */ {I_MOV, 2, {REG_GPR|BITS16,IMMEDIATE,0,0,0}, nasm_bytecodes+18079, IF_8086|IF_SM},
+    /*  662 */ {I_MOV, 2, {REG_GPR|BITS32,IMMEDIATE,0,0,0}, nasm_bytecodes+18084, IF_386|IF_SM},
+    /*  663 */ {I_MOV, 2, {REG_GPR|BITS64,IMMEDIATE,0,0,0}, nasm_bytecodes+18089, IF_X64|IF_SM},
+    /*  664 */ {I_MOV, 2, {REG_GPR|BITS64,IMMEDIATE|BITS32,0,0,0}, nasm_bytecodes+14184, IF_X64},
+    /*  665 */ {I_MOV, 2, {RM_GPR|BITS8,IMMEDIATE,0,0,0}, nasm_bytecodes+18094, IF_8086|IF_SM},
+    /*  666 */ {I_MOV, 2, {RM_GPR|BITS16,IMMEDIATE,0,0,0}, nasm_bytecodes+14190, IF_8086|IF_SM},
+    /*  667 */ {I_MOV, 2, {RM_GPR|BITS32,IMMEDIATE,0,0,0}, nasm_bytecodes+14196, IF_386|IF_SM},
+    /*  668 */ {I_MOV, 2, {RM_GPR|BITS64,IMMEDIATE,0,0,0}, nasm_bytecodes+14184, IF_X64|IF_SM},
+    /*  669 */ {I_MOV, 2, {MEMORY,IMMEDIATE|BITS8,0,0,0}, nasm_bytecodes+18094, IF_8086|IF_SM},
+    /*  670 */ {I_MOV, 2, {MEMORY,IMMEDIATE|BITS16,0,0,0}, nasm_bytecodes+14190, IF_8086|IF_SM},
+    /*  671 */ {I_MOV, 2, {MEMORY,IMMEDIATE|BITS32,0,0,0}, nasm_bytecodes+14196, IF_386|IF_SM},
+    /*  672 */ {I_MOVD, 2, {MMXREG,MEMORY,0,0,0}, nasm_bytecodes+14202, IF_PENT|IF_MMX|IF_SD},
+    /*  673 */ {I_MOVD, 2, {MMXREG,REG_GPR|BITS32,0,0,0}, nasm_bytecodes+14202, IF_PENT|IF_MMX},
+    /*  674 */ {I_MOVD, 2, {MEMORY,MMXREG,0,0,0}, nasm_bytecodes+14208, IF_PENT|IF_MMX|IF_SD},
+    /*  675 */ {I_MOVD, 2, {REG_GPR|BITS32,MMXREG,0,0,0}, nasm_bytecodes+14208, IF_PENT|IF_MMX},
+    /*  676 */ {I_MOVD, 2, {XMMREG,MEMORY,0,0,0}, nasm_bytecodes+7355, IF_X64|IF_SD},
+    /*  677 */ {I_MOVD, 2, {XMMREG,REG_GPR|BITS32,0,0,0}, nasm_bytecodes+7355, IF_X64},
+    /*  678 */ {I_MOVD, 2, {MEMORY,XMMREG,0,0,0}, nasm_bytecodes+7362, IF_X64|IF_SD},
+    /*  679 */ {I_MOVD, 2, {REG_GPR|BITS32,XMMREG,0,0,0}, nasm_bytecodes+7362, IF_X64|IF_SSE},
+    /*  680 */ {I_MOVQ, 2, {MMXREG,RM_MMX,0,0,0}, nasm_bytecodes+7369, IF_PENT|IF_MMX|IF_SQ},
+    /*  681 */ {I_MOVQ, 2, {RM_MMX,MMXREG,0,0,0}, nasm_bytecodes+7376, IF_PENT|IF_MMX|IF_SQ},
+    /*  682 */ {I_MOVQ, 2, {MMXREG,RM_GPR|BITS64,0,0,0}, nasm_bytecodes+14202, IF_X64|IF_MMX},
+    /*  683 */ {I_MOVQ, 2, {RM_GPR|BITS64,MMXREG,0,0,0}, nasm_bytecodes+14208, IF_X64|IF_MMX},
+    /*  684 */ {I_MOVSB, 0, {0,0,0,0,0}, nasm_bytecodes+5497, IF_8086},
+    /*  685 */ {I_MOVSD, 0, {0,0,0,0,0}, nasm_bytecodes+19614, IF_386},
+    /*  686 */ {I_MOVSQ, 0, {0,0,0,0,0}, nasm_bytecodes+19618, IF_X64},
+    /*  687 */ {I_MOVSW, 0, {0,0,0,0,0}, nasm_bytecodes+19622, IF_8086},
+    /*  688 */ {I_MOVSX, 2, {REG_GPR|BITS16,MEMORY,0,0,0}, nasm_bytecodes+14214, IF_386|IF_SB},
+    /*  689 */ {I_MOVSX, 2, {REG_GPR|BITS16,REG_GPR|BITS8,0,0,0}, nasm_bytecodes+14214, IF_386},
+    /*  690 */ {I_MOVSX, 2, {REG_GPR|BITS32,RM_GPR|BITS8,0,0,0}, nasm_bytecodes+14220, IF_386},
+    /*  691 */ {I_MOVSX, 2, {REG_GPR|BITS32,RM_GPR|BITS16,0,0,0}, nasm_bytecodes+14226, IF_386},
+    /*  692 */ {I_MOVSX, 2, {REG_GPR|BITS64,RM_GPR|BITS8,0,0,0}, nasm_bytecodes+14232, IF_X64},
+    /*  693 */ {I_MOVSX, 2, {REG_GPR|BITS64,RM_GPR|BITS16,0,0,0}, nasm_bytecodes+14238, IF_X64},
+    /*  694 */ {I_MOVSXD, 2, {REG_GPR|BITS64,RM_GPR|BITS32,0,0,0}, nasm_bytecodes+18099, IF_X64},
+    /*  695 */ {I_MOVZX, 2, {REG_GPR|BITS16,MEMORY,0,0,0}, nasm_bytecodes+14244, IF_386|IF_SB},
+    /*  696 */ {I_MOVZX, 2, {REG_GPR|BITS16,REG_GPR|BITS8,0,0,0}, nasm_bytecodes+14244, IF_386},
+    /*  697 */ {I_MOVZX, 2, {REG_GPR|BITS32,RM_GPR|BITS8,0,0,0}, nasm_bytecodes+14250, IF_386},
+    /*  698 */ {I_MOVZX, 2, {REG_GPR|BITS32,RM_GPR|BITS16,0,0,0}, nasm_bytecodes+14256, IF_386},
+    /*  699 */ {I_MOVZX, 2, {REG_GPR|BITS64,RM_GPR|BITS8,0,0,0}, nasm_bytecodes+14262, IF_X64},
+    /*  700 */ {I_MOVZX, 2, {REG_GPR|BITS64,RM_GPR|BITS16,0,0,0}, nasm_bytecodes+14268, IF_X64},
+    /*  701 */ {I_MUL, 1, {RM_GPR|BITS8,0,0,0,0}, nasm_bytecodes+19626, IF_8086},
+    /*  702 */ {I_MUL, 1, {RM_GPR|BITS16,0,0,0,0}, nasm_bytecodes+18104, IF_8086},
+    /*  703 */ {I_MUL, 1, {RM_GPR|BITS32,0,0,0,0}, nasm_bytecodes+18109, IF_386},
+    /*  704 */ {I_MUL, 1, {RM_GPR|BITS64,0,0,0,0}, nasm_bytecodes+18114, IF_X64},
+    /*  705 */ {I_MWAIT, 0, {0,0,0,0,0}, nasm_bytecodes+18119, IF_PRESCOTT},
+    /*  706 */ {I_NEG, 1, {RM_GPR|BITS8,0,0,0,0}, nasm_bytecodes+19630, IF_8086},
+    /*  707 */ {I_NEG, 1, {RM_GPR|BITS16,0,0,0,0}, nasm_bytecodes+18124, IF_8086},
+    /*  708 */ {I_NEG, 1, {RM_GPR|BITS32,0,0,0,0}, nasm_bytecodes+18129, IF_386},
+    /*  709 */ {I_NEG, 1, {RM_GPR|BITS64,0,0,0,0}, nasm_bytecodes+18134, IF_X64},
+    /*  710 */ {I_NOP, 0, {0,0,0,0,0}, nasm_bytecodes+19634, IF_8086},
+    /*  711 */ {I_NOP, 1, {RM_GPR|BITS16,0,0,0,0}, nasm_bytecodes+14274, IF_P6},
+    /*  712 */ {I_NOP, 1, {RM_GPR|BITS32,0,0,0,0}, nasm_bytecodes+14280, IF_P6},
+    /*  713 */ {I_NOP, 1, {RM_GPR|BITS64,0,0,0,0}, nasm_bytecodes+14286, IF_X64},
+    /*  714 */ {I_NOT, 1, {RM_GPR|BITS8,0,0,0,0}, nasm_bytecodes+19638, IF_8086},
+    /*  715 */ {I_NOT, 1, {RM_GPR|BITS16,0,0,0,0}, nasm_bytecodes+18139, IF_8086},
+    /*  716 */ {I_NOT, 1, {RM_GPR|BITS32,0,0,0,0}, nasm_bytecodes+18144, IF_386},
+    /*  717 */ {I_NOT, 1, {RM_GPR|BITS64,0,0,0,0}, nasm_bytecodes+18149, IF_X64},
+    /*  718 */ {I_OR, 2, {MEMORY,REG_GPR|BITS8,0,0,0}, nasm_bytecodes+19642, IF_8086|IF_SM},
+    /*  719 */ {I_OR, 2, {REG_GPR|BITS8,REG_GPR|BITS8,0,0,0}, nasm_bytecodes+19642, IF_8086},
+    /*  720 */ {I_OR, 2, {MEMORY,REG_GPR|BITS16,0,0,0}, nasm_bytecodes+18154, IF_8086|IF_SM},
+    /*  721 */ {I_OR, 2, {REG_GPR|BITS16,REG_GPR|BITS16,0,0,0}, nasm_bytecodes+18154, IF_8086},
+    /*  722 */ {I_OR, 2, {MEMORY,REG_GPR|BITS32,0,0,0}, nasm_bytecodes+18159, IF_386|IF_SM},
+    /*  723 */ {I_OR, 2, {REG_GPR|BITS32,REG_GPR|BITS32,0,0,0}, nasm_bytecodes+18159, IF_386},
+    /*  724 */ {I_OR, 2, {MEMORY,REG_GPR|BITS64,0,0,0}, nasm_bytecodes+18164, IF_X64|IF_SM},
+    /*  725 */ {I_OR, 2, {REG_GPR|BITS64,REG_GPR|BITS64,0,0,0}, nasm_bytecodes+18164, IF_X64},
+    /*  726 */ {I_OR, 2, {REG_GPR|BITS8,MEMORY,0,0,0}, nasm_bytecodes+11411, IF_8086|IF_SM},
+    /*  727 */ {I_OR, 2, {REG_GPR|BITS8,REG_GPR|BITS8,0,0,0}, nasm_bytecodes+11411, IF_8086},
+    /*  728 */ {I_OR, 2, {REG_GPR|BITS16,MEMORY,0,0,0}, nasm_bytecodes+18169, IF_8086|IF_SM},
+    /*  729 */ {I_OR, 2, {REG_GPR|BITS16,REG_GPR|BITS16,0,0,0}, nasm_bytecodes+18169, IF_8086},
+    /*  730 */ {I_OR, 2, {REG_GPR|BITS32,MEMORY,0,0,0}, nasm_bytecodes+18174, IF_386|IF_SM},
+    /*  731 */ {I_OR, 2, {REG_GPR|BITS32,REG_GPR|BITS32,0,0,0}, nasm_bytecodes+18174, IF_386},
+    /*  732 */ {I_OR, 2, {REG_GPR|BITS64,MEMORY,0,0,0}, nasm_bytecodes+18179, IF_X64|IF_SM},
+    /*  733 */ {I_OR, 2, {REG_GPR|BITS64,REG_GPR|BITS64,0,0,0}, nasm_bytecodes+18179, IF_X64},
+    /*  734 */ {I_OR, 2, {RM_GPR|BITS16,IMMEDIATE|BITS8,0,0,0}, nasm_bytecodes+14292, IF_8086},
+    /*  735 */ {I_OR, 2, {RM_GPR|BITS32,IMMEDIATE|BITS8,0,0,0}, nasm_bytecodes+14298, IF_386},
+    /*  736 */ {I_OR, 2, {RM_GPR|BITS64,IMMEDIATE|BITS8,0,0,0}, nasm_bytecodes+14304, IF_X64},
+    /*  737 */ {I_OR, 2, {REG_AL,IMMEDIATE,0,0,0}, nasm_bytecodes+19646, IF_8086|IF_SM},
+    /*  738 */ {I_OR, 2, {REG_AX,SBYTE16,0,0,0}, nasm_bytecodes+14292, IF_8086|IF_SM},
+    /*  739 */ {I_OR, 2, {REG_AX,IMMEDIATE,0,0,0}, nasm_bytecodes+18184, IF_8086|IF_SM},
+    /*  740 */ {I_OR, 2, {REG_EAX,SBYTE32,0,0,0}, nasm_bytecodes+14298, IF_386|IF_SM},
+    /*  741 */ {I_OR, 2, {REG_EAX,IMMEDIATE,0,0,0}, nasm_bytecodes+18189, IF_386|IF_SM},
+    /*  742 */ {I_OR, 2, {REG_RAX,SBYTE64,0,0,0}, nasm_bytecodes+14304, IF_X64|IF_SM},
+    /*  743 */ {I_OR, 2, {REG_RAX,IMMEDIATE,0,0,0}, nasm_bytecodes+18194, IF_X64|IF_SM},
+    /*  744 */ {I_OR, 2, {RM_GPR|BITS8,IMMEDIATE,0,0,0}, nasm_bytecodes+18199, IF_8086|IF_SM},
+    /*  745 */ {I_OR, 2, {RM_GPR|BITS16,IMMEDIATE,0,0,0}, nasm_bytecodes+14310, IF_8086|IF_SM},
+    /*  746 */ {I_OR, 2, {RM_GPR|BITS32,IMMEDIATE,0,0,0}, nasm_bytecodes+14316, IF_386|IF_SM},
+    /*  747 */ {I_OR, 2, {RM_GPR|BITS64,IMMEDIATE,0,0,0}, nasm_bytecodes+14322, IF_X64|IF_SM},
+    /*  748 */ {I_OR, 2, {MEMORY,IMMEDIATE|BITS8,0,0,0}, nasm_bytecodes+18199, IF_8086|IF_SM},
+    /*  749 */ {I_OR, 2, {MEMORY,IMMEDIATE|BITS16,0,0,0}, nasm_bytecodes+14310, IF_8086|IF_SM},
+    /*  750 */ {I_OR, 2, {MEMORY,IMMEDIATE|BITS32,0,0,0}, nasm_bytecodes+14316, IF_386|IF_SM},
+    /*  751 */ {I_OUT, 2, {IMMEDIATE,REG_AL,0,0,0}, nasm_bytecodes+19650, IF_8086|IF_SB},
+    /*  752 */ {I_OUT, 2, {IMMEDIATE,REG_AX,0,0,0}, nasm_bytecodes+18204, IF_8086|IF_SB},
+    /*  753 */ {I_OUT, 2, {IMMEDIATE,REG_EAX,0,0,0}, nasm_bytecodes+18209, IF_386|IF_SB},
+    /*  754 */ {I_OUT, 2, {REG_DX,REG_AL,0,0,0}, nasm_bytecodes+20007, IF_8086},
+    /*  755 */ {I_OUT, 2, {REG_DX,REG_AX,0,0,0}, nasm_bytecodes+19654, IF_8086},
+    /*  756 */ {I_OUT, 2, {REG_DX,REG_EAX,0,0,0}, nasm_bytecodes+19658, IF_386},
+    /*  757 */ {I_OUTSB, 0, {0,0,0,0,0}, nasm_bytecodes+20010, IF_186},
+    /*  758 */ {I_OUTSD, 0, {0,0,0,0,0}, nasm_bytecodes+19662, IF_386},
+    /*  759 */ {I_OUTSW, 0, {0,0,0,0,0}, nasm_bytecodes+19666, IF_186},
+    /*  760 */ {I_PACKSSDW, 2, {MMXREG,RM_MMX,0,0,0}, nasm_bytecodes+7383, IF_PENT|IF_MMX|IF_SQ},
+    /*  761 */ {I_PACKSSWB, 2, {MMXREG,RM_MMX,0,0,0}, nasm_bytecodes+7390, IF_PENT|IF_MMX|IF_SQ},
+    /*  762 */ {I_PACKUSWB, 2, {MMXREG,RM_MMX,0,0,0}, nasm_bytecodes+7397, IF_PENT|IF_MMX|IF_SQ},
+    /*  763 */ {I_PADDB, 2, {MMXREG,RM_MMX,0,0,0}, nasm_bytecodes+7404, IF_PENT|IF_MMX|IF_SQ},
+    /*  764 */ {I_PADDD, 2, {MMXREG,RM_MMX,0,0,0}, nasm_bytecodes+7411, IF_PENT|IF_MMX|IF_SQ},
+    /*  765 */ {I_PADDSB, 2, {MMXREG,RM_MMX,0,0,0}, nasm_bytecodes+7418, IF_PENT|IF_MMX|IF_SQ},
+    /*  766 */ {I_PADDSIW, 2, {MMXREG,RM_MMX,0,0,0}, nasm_bytecodes+14328, IF_PENT|IF_MMX|IF_SQ|IF_CYRIX},
+    /*  767 */ {I_PADDSW, 2, {MMXREG,RM_MMX,0,0,0}, nasm_bytecodes+7425, IF_PENT|IF_MMX|IF_SQ},
+    /*  768 */ {I_PADDUSB, 2, {MMXREG,RM_MMX,0,0,0}, nasm_bytecodes+7432, IF_PENT|IF_MMX|IF_SQ},
+    /*  769 */ {I_PADDUSW, 2, {MMXREG,RM_MMX,0,0,0}, nasm_bytecodes+7439, IF_PENT|IF_MMX|IF_SQ},
+    /*  770 */ {I_PADDW, 2, {MMXREG,RM_MMX,0,0,0}, nasm_bytecodes+7446, IF_PENT|IF_MMX|IF_SQ},
+    /*  771 */ {I_PAND, 2, {MMXREG,RM_MMX,0,0,0}, nasm_bytecodes+7453, IF_PENT|IF_MMX|IF_SQ},
+    /*  772 */ {I_PANDN, 2, {MMXREG,RM_MMX,0,0,0}, nasm_bytecodes+7460, IF_PENT|IF_MMX|IF_SQ},
+    /*  773 */ {I_PAUSE, 0, {0,0,0,0,0}, nasm_bytecodes+18214, IF_8086},
+    /*  774 */ {I_PAVEB, 2, {MMXREG,RM_MMX,0,0,0}, nasm_bytecodes+14334, IF_PENT|IF_MMX|IF_SQ|IF_CYRIX},
+    /*  775 */ {I_PAVGUSB, 2, {MMXREG,RM_MMX,0,0,0}, nasm_bytecodes+5436, IF_PENT|IF_3DNOW|IF_SQ},
+    /*  776 */ {I_PCMPEQB, 2, {MMXREG,RM_MMX,0,0,0}, nasm_bytecodes+7467, IF_PENT|IF_MMX|IF_SQ},
+    /*  777 */ {I_PCMPEQD, 2, {MMXREG,RM_MMX,0,0,0}, nasm_bytecodes+7474, IF_PENT|IF_MMX|IF_SQ},
+    /*  778 */ {I_PCMPEQW, 2, {MMXREG,RM_MMX,0,0,0}, nasm_bytecodes+7481, IF_PENT|IF_MMX|IF_SQ},
+    /*  779 */ {I_PCMPGTB, 2, {MMXREG,RM_MMX,0,0,0}, nasm_bytecodes+7488, IF_PENT|IF_MMX|IF_SQ},
+    /*  780 */ {I_PCMPGTD, 2, {MMXREG,RM_MMX,0,0,0}, nasm_bytecodes+7495, IF_PENT|IF_MMX|IF_SQ},
+    /*  781 */ {I_PCMPGTW, 2, {MMXREG,RM_MMX,0,0,0}, nasm_bytecodes+7502, IF_PENT|IF_MMX|IF_SQ},
+    /*  782 */ {I_PDISTIB, 2, {MMXREG,MEMORY,0,0,0}, nasm_bytecodes+15487, IF_PENT|IF_MMX|IF_SM|IF_CYRIX},
+    /*  783 */ {I_PF2ID, 2, {MMXREG,RM_MMX,0,0,0}, nasm_bytecodes+5444, IF_PENT|IF_3DNOW|IF_SQ},
+    /*  784 */ {I_PFACC, 2, {MMXREG,RM_MMX,0,0,0}, nasm_bytecodes+5452, IF_PENT|IF_3DNOW|IF_SQ},
+    /*  785 */ {I_PFADD, 2, {MMXREG,RM_MMX,0,0,0}, nasm_bytecodes+5460, IF_PENT|IF_3DNOW|IF_SQ},
+    /*  786 */ {I_PFCMPEQ, 2, {MMXREG,RM_MMX,0,0,0}, nasm_bytecodes+5468, IF_PENT|IF_3DNOW|IF_SQ},
+    /*  787 */ {I_PFCMPGE, 2, {MMXREG,RM_MMX,0,0,0}, nasm_bytecodes+5476, IF_PENT|IF_3DNOW|IF_SQ},
+    /*  788 */ {I_PFCMPGT, 2, {MMXREG,RM_MMX,0,0,0}, nasm_bytecodes+5484, IF_PENT|IF_3DNOW|IF_SQ},
+    /*  789 */ {I_PFMAX, 2, {MMXREG,RM_MMX,0,0,0}, nasm_bytecodes+5492, IF_PENT|IF_3DNOW|IF_SQ},
+    /*  790 */ {I_PFMIN, 2, {MMXREG,RM_MMX,0,0,0}, nasm_bytecodes+5500, IF_PENT|IF_3DNOW|IF_SQ},
+    /*  791 */ {I_PFMUL, 2, {MMXREG,RM_MMX,0,0,0}, nasm_bytecodes+5508, IF_PENT|IF_3DNOW|IF_SQ},
+    /*  792 */ {I_PFRCP, 2, {MMXREG,RM_MMX,0,0,0}, nasm_bytecodes+5516, IF_PENT|IF_3DNOW|IF_SQ},
+    /*  793 */ {I_PFRCPIT1, 2, {MMXREG,RM_MMX,0,0,0}, nasm_bytecodes+5524, IF_PENT|IF_3DNOW|IF_SQ},
+    /*  794 */ {I_PFRCPIT2, 2, {MMXREG,RM_MMX,0,0,0}, nasm_bytecodes+5532, IF_PENT|IF_3DNOW|IF_SQ},
+    /*  795 */ {I_PFRSQIT1, 2, {MMXREG,RM_MMX,0,0,0}, nasm_bytecodes+5540, IF_PENT|IF_3DNOW|IF_SQ},
+    /*  796 */ {I_PFRSQRT, 2, {MMXREG,RM_MMX,0,0,0}, nasm_bytecodes+5548, IF_PENT|IF_3DNOW|IF_SQ},
+    /*  797 */ {I_PFSUB, 2, {MMXREG,RM_MMX,0,0,0}, nasm_bytecodes+5556, IF_PENT|IF_3DNOW|IF_SQ},
+    /*  798 */ {I_PFSUBR, 2, {MMXREG,RM_MMX,0,0,0}, nasm_bytecodes+5564, IF_PENT|IF_3DNOW|IF_SQ},
+    /*  799 */ {I_PI2FD, 2, {MMXREG,RM_MMX,0,0,0}, nasm_bytecodes+5572, IF_PENT|IF_3DNOW|IF_SQ},
+    /*  800 */ {I_PMACHRIW, 2, {MMXREG,MEMORY,0,0,0}, nasm_bytecodes+15583, IF_PENT|IF_MMX|IF_SM|IF_CYRIX},
+    /*  801 */ {I_PMADDWD, 2, {MMXREG,RM_MMX,0,0,0}, nasm_bytecodes+7509, IF_PENT|IF_MMX|IF_SQ},
+    /*  802 */ {I_PMAGW, 2, {MMXREG,RM_MMX,0,0,0}, nasm_bytecodes+14340, IF_PENT|IF_MMX|IF_SQ|IF_CYRIX},
+    /*  803 */ {I_PMULHRIW, 2, {MMXREG,RM_MMX,0,0,0}, nasm_bytecodes+14346, IF_PENT|IF_MMX|IF_SQ|IF_CYRIX},
+    /*  804 */ {I_PMULHRWA, 2, {MMXREG,RM_MMX,0,0,0}, nasm_bytecodes+5580, IF_PENT|IF_3DNOW|IF_SQ},
+    /*  805 */ {I_PMULHRWC, 2, {MMXREG,RM_MMX,0,0,0}, nasm_bytecodes+14352, IF_PENT|IF_MMX|IF_SQ|IF_CYRIX},
+    /*  806 */ {I_PMULHW, 2, {MMXREG,RM_MMX,0,0,0}, nasm_bytecodes+7516, IF_PENT|IF_MMX|IF_SQ},
+    /*  807 */ {I_PMULLW, 2, {MMXREG,RM_MMX,0,0,0}, nasm_bytecodes+7523, IF_PENT|IF_MMX|IF_SQ},
+    /*  808 */ {I_PMVGEZB, 2, {MMXREG,MEMORY,0,0,0}, nasm_bytecodes+15715, IF_PENT|IF_MMX|IF_SQ|IF_CYRIX},
+    /*  809 */ {I_PMVLZB, 2, {MMXREG,MEMORY,0,0,0}, nasm_bytecodes+15571, IF_PENT|IF_MMX|IF_SQ|IF_CYRIX},
+    /*  810 */ {I_PMVNZB, 2, {MMXREG,MEMORY,0,0,0}, nasm_bytecodes+15553, IF_PENT|IF_MMX|IF_SQ|IF_CYRIX},
+    /*  811 */ {I_PMVZB, 2, {MMXREG,MEMORY,0,0,0}, nasm_bytecodes+15475, IF_PENT|IF_MMX|IF_SQ|IF_CYRIX},
+    /*  812 */ {I_POP, 1, {REG_GPR|BITS16,0,0,0,0}, nasm_bytecodes+19670, IF_8086},
+    /*  813 */ {I_POP, 1, {REG_GPR|BITS32,0,0,0,0}, nasm_bytecodes+19674, IF_386|IF_NOLONG},
+    /*  814 */ {I_POP, 1, {REG_GPR|BITS64,0,0,0,0}, nasm_bytecodes+19678, IF_X64},
+    /*  815 */ {I_POP, 1, {RM_GPR|BITS16,0,0,0,0}, nasm_bytecodes+18219, IF_8086},
+    /*  816 */ {I_POP, 1, {RM_GPR|BITS32,0,0,0,0}, nasm_bytecodes+18224, IF_386|IF_NOLONG},
+    /*  817 */ {I_POP, 1, {RM_GPR|BITS64,0,0,0,0}, nasm_bytecodes+18229, IF_X64},
+    /*  818 */ {I_POP, 1, {REG_DESS,0,0,0,0}, nasm_bytecodes+19488, IF_8086|IF_NOLONG},
+    /*  819 */ {I_POP, 1, {REG_FSGS,0,0,0,0}, nasm_bytecodes+19682, IF_386},
+    /*  820 */ {I_POPA, 0, {0,0,0,0,0}, nasm_bytecodes+19686, IF_186|IF_NOLONG},
+    /*  821 */ {I_POPAD, 0, {0,0,0,0,0}, nasm_bytecodes+19690, IF_386|IF_NOLONG},
+    /*  822 */ {I_POPAW, 0, {0,0,0,0,0}, nasm_bytecodes+19694, IF_186|IF_NOLONG},
+    /*  823 */ {I_POPF, 0, {0,0,0,0,0}, nasm_bytecodes+19698, IF_8086},
+    /*  824 */ {I_POPFD, 0, {0,0,0,0,0}, nasm_bytecodes+19702, IF_386|IF_NOLONG},
+    /*  825 */ {I_POPFQ, 0, {0,0,0,0,0}, nasm_bytecodes+19702, IF_X64},
+    /*  826 */ {I_POPFW, 0, {0,0,0,0,0}, nasm_bytecodes+19706, IF_8086},
+    /*  827 */ {I_POR, 2, {MMXREG,RM_MMX,0,0,0}, nasm_bytecodes+7530, IF_PENT|IF_MMX|IF_SQ},
+    /*  828 */ {I_PREFETCH, 1, {MEMORY,0,0,0,0}, nasm_bytecodes+18234, IF_PENT|IF_3DNOW|IF_SQ},
+    /*  829 */ {I_PREFETCHW, 1, {MEMORY,0,0,0,0}, nasm_bytecodes+18239, IF_PENT|IF_3DNOW|IF_SQ},
+    /*  830 */ {I_PSLLD, 2, {MMXREG,RM_MMX,0,0,0}, nasm_bytecodes+7537, IF_PENT|IF_MMX|IF_SQ},
+    /*  831 */ {I_PSLLD, 2, {MMXREG,IMMEDIATE,0,0,0}, nasm_bytecodes+7544, IF_PENT|IF_MMX},
+    /*  832 */ {I_PSLLQ, 2, {MMXREG,RM_MMX,0,0,0}, nasm_bytecodes+7551, IF_PENT|IF_MMX|IF_SQ},
+    /*  833 */ {I_PSLLQ, 2, {MMXREG,IMMEDIATE,0,0,0}, nasm_bytecodes+7558, IF_PENT|IF_MMX},
+    /*  834 */ {I_PSLLW, 2, {MMXREG,RM_MMX,0,0,0}, nasm_bytecodes+7565, IF_PENT|IF_MMX|IF_SQ},
+    /*  835 */ {I_PSLLW, 2, {MMXREG,IMMEDIATE,0,0,0}, nasm_bytecodes+7572, IF_PENT|IF_MMX},
+    /*  836 */ {I_PSRAD, 2, {MMXREG,RM_MMX,0,0,0}, nasm_bytecodes+7579, IF_PENT|IF_MMX|IF_SQ},
+    /*  837 */ {I_PSRAD, 2, {MMXREG,IMMEDIATE,0,0,0}, nasm_bytecodes+7586, IF_PENT|IF_MMX},
+    /*  838 */ {I_PSRAW, 2, {MMXREG,RM_MMX,0,0,0}, nasm_bytecodes+7593, IF_PENT|IF_MMX|IF_SQ},
+    /*  839 */ {I_PSRAW, 2, {MMXREG,IMMEDIATE,0,0,0}, nasm_bytecodes+7600, IF_PENT|IF_MMX},
+    /*  840 */ {I_PSRLD, 2, {MMXREG,RM_MMX,0,0,0}, nasm_bytecodes+7607, IF_PENT|IF_MMX|IF_SQ},
+    /*  841 */ {I_PSRLD, 2, {MMXREG,IMMEDIATE,0,0,0}, nasm_bytecodes+7614, IF_PENT|IF_MMX},
+    /*  842 */ {I_PSRLQ, 2, {MMXREG,RM_MMX,0,0,0}, nasm_bytecodes+7621, IF_PENT|IF_MMX|IF_SQ},
+    /*  843 */ {I_PSRLQ, 2, {MMXREG,IMMEDIATE,0,0,0}, nasm_bytecodes+7628, IF_PENT|IF_MMX},
+    /*  844 */ {I_PSRLW, 2, {MMXREG,RM_MMX,0,0,0}, nasm_bytecodes+7635, IF_PENT|IF_MMX|IF_SQ},
+    /*  845 */ {I_PSRLW, 2, {MMXREG,IMMEDIATE,0,0,0}, nasm_bytecodes+7642, IF_PENT|IF_MMX},
+    /*  846 */ {I_PSUBB, 2, {MMXREG,RM_MMX,0,0,0}, nasm_bytecodes+7649, IF_PENT|IF_MMX|IF_SQ},
+    /*  847 */ {I_PSUBD, 2, {MMXREG,RM_MMX,0,0,0}, nasm_bytecodes+7656, IF_PENT|IF_MMX|IF_SQ},
+    /*  848 */ {I_PSUBSB, 2, {MMXREG,RM_MMX,0,0,0}, nasm_bytecodes+7663, IF_PENT|IF_MMX|IF_SQ},
+    /*  849 */ {I_PSUBSIW, 2, {MMXREG,RM_MMX,0,0,0}, nasm_bytecodes+14358, IF_PENT|IF_MMX|IF_SQ|IF_CYRIX},
+    /*  850 */ {I_PSUBSW, 2, {MMXREG,RM_MMX,0,0,0}, nasm_bytecodes+7670, IF_PENT|IF_MMX|IF_SQ},
+    /*  851 */ {I_PSUBUSB, 2, {MMXREG,RM_MMX,0,0,0}, nasm_bytecodes+7677, IF_PENT|IF_MMX|IF_SQ},
+    /*  852 */ {I_PSUBUSW, 2, {MMXREG,RM_MMX,0,0,0}, nasm_bytecodes+7684, IF_PENT|IF_MMX|IF_SQ},
+    /*  853 */ {I_PSUBW, 2, {MMXREG,RM_MMX,0,0,0}, nasm_bytecodes+7691, IF_PENT|IF_MMX|IF_SQ},
+    /*  854 */ {I_PUNPCKHBW, 2, {MMXREG,RM_MMX,0,0,0}, nasm_bytecodes+7698, IF_PENT|IF_MMX|IF_SQ},
+    /*  855 */ {I_PUNPCKHDQ, 2, {MMXREG,RM_MMX,0,0,0}, nasm_bytecodes+7705, IF_PENT|IF_MMX|IF_SQ},
+    /*  856 */ {I_PUNPCKHWD, 2, {MMXREG,RM_MMX,0,0,0}, nasm_bytecodes+7712, IF_PENT|IF_MMX|IF_SQ},
+    /*  857 */ {I_PUNPCKLBW, 2, {MMXREG,RM_MMX,0,0,0}, nasm_bytecodes+7719, IF_PENT|IF_MMX|IF_SQ},
+    /*  858 */ {I_PUNPCKLDQ, 2, {MMXREG,RM_MMX,0,0,0}, nasm_bytecodes+7726, IF_PENT|IF_MMX|IF_SQ},
+    /*  859 */ {I_PUNPCKLWD, 2, {MMXREG,RM_MMX,0,0,0}, nasm_bytecodes+7733, IF_PENT|IF_MMX|IF_SQ},
+    /*  860 */ {I_PUSH, 1, {REG_GPR|BITS16,0,0,0,0}, nasm_bytecodes+19710, IF_8086},
+    /*  861 */ {I_PUSH, 1, {REG_GPR|BITS32,0,0,0,0}, nasm_bytecodes+19714, IF_386|IF_NOLONG},
+    /*  862 */ {I_PUSH, 1, {REG_GPR|BITS64,0,0,0,0}, nasm_bytecodes+19718, IF_X64},
+    /*  863 */ {I_PUSH, 1, {RM_GPR|BITS16,0,0,0,0}, nasm_bytecodes+18244, IF_8086},
+    /*  864 */ {I_PUSH, 1, {RM_GPR|BITS32,0,0,0,0}, nasm_bytecodes+18249, IF_386|IF_NOLONG},
+    /*  865 */ {I_PUSH, 1, {RM_GPR|BITS64,0,0,0,0}, nasm_bytecodes+18254, IF_X64},
+    /*  866 */ {I_PUSH, 1, {REG_CS,0,0,0,0}, nasm_bytecodes+19464, IF_8086|IF_NOLONG},
+    /*  867 */ {I_PUSH, 1, {REG_DESS,0,0,0,0}, nasm_bytecodes+19464, IF_8086|IF_NOLONG},
+    /*  868 */ {I_PUSH, 1, {REG_FSGS,0,0,0,0}, nasm_bytecodes+19722, IF_386},
+    /*  869 */ {I_PUSH, 1, {IMMEDIATE|BITS8,0,0,0,0}, nasm_bytecodes+19726, IF_186},
+    /*  870 */ {I_PUSH, 1, {IMMEDIATE|BITS16,0,0,0,0}, nasm_bytecodes+18259, IF_186|IF_AR0|IF_SZ},
+    /*  871 */ {I_PUSH, 1, {IMMEDIATE|BITS32,0,0,0,0}, nasm_bytecodes+18264, IF_386|IF_NOLONG|IF_AR0|IF_SZ},
+    /*  872 */ {I_PUSH, 1, {IMMEDIATE|BITS32,0,0,0,0}, nasm_bytecodes+18264, IF_386|IF_NOLONG|IF_SD},
+    /*  873 */ {I_PUSH, 1, {IMMEDIATE|BITS64,0,0,0,0}, nasm_bytecodes+18269, IF_X64|IF_AR0|IF_SZ},
+    /*  874 */ {I_PUSHA, 0, {0,0,0,0,0}, nasm_bytecodes+19730, IF_186|IF_NOLONG},
+    /*  875 */ {I_PUSHAD, 0, {0,0,0,0,0}, nasm_bytecodes+19734, IF_386|IF_NOLONG},
+    /*  876 */ {I_PUSHAW, 0, {0,0,0,0,0}, nasm_bytecodes+19738, IF_186|IF_NOLONG},
+    /*  877 */ {I_PUSHF, 0, {0,0,0,0,0}, nasm_bytecodes+19742, IF_8086},
+    /*  878 */ {I_PUSHFD, 0, {0,0,0,0,0}, nasm_bytecodes+19746, IF_386|IF_NOLONG},
+    /*  879 */ {I_PUSHFQ, 0, {0,0,0,0,0}, nasm_bytecodes+19746, IF_X64},
+    /*  880 */ {I_PUSHFW, 0, {0,0,0,0,0}, nasm_bytecodes+19750, IF_8086},
+    /*  881 */ {I_PXOR, 2, {MMXREG,RM_MMX,0,0,0}, nasm_bytecodes+7740, IF_PENT|IF_MMX|IF_SQ},
+    /*  882 */ {I_RCL, 2, {RM_GPR|BITS8,UNITY,0,0,0}, nasm_bytecodes+19754, IF_8086},
+    /*  883 */ {I_RCL, 2, {RM_GPR|BITS8,REG_CL,0,0,0}, nasm_bytecodes+19758, IF_8086},
+    /*  884 */ {I_RCL, 2, {RM_GPR|BITS8,IMMEDIATE,0,0,0}, nasm_bytecodes+18274, IF_186|IF_SB},
+    /*  885 */ {I_RCL, 2, {RM_GPR|BITS16,UNITY,0,0,0}, nasm_bytecodes+18279, IF_8086},
+    /*  886 */ {I_RCL, 2, {RM_GPR|BITS16,REG_CL,0,0,0}, nasm_bytecodes+18284, IF_8086},
+    /*  887 */ {I_RCL, 2, {RM_GPR|BITS16,IMMEDIATE,0,0,0}, nasm_bytecodes+14364, IF_186|IF_SB},
+    /*  888 */ {I_RCL, 2, {RM_GPR|BITS32,UNITY,0,0,0}, nasm_bytecodes+18289, IF_386},
+    /*  889 */ {I_RCL, 2, {RM_GPR|BITS32,REG_CL,0,0,0}, nasm_bytecodes+18294, IF_386},
+    /*  890 */ {I_RCL, 2, {RM_GPR|BITS32,IMMEDIATE,0,0,0}, nasm_bytecodes+14370, IF_386|IF_SB},
+    /*  891 */ {I_RCL, 2, {RM_GPR|BITS64,UNITY,0,0,0}, nasm_bytecodes+18299, IF_X64},
+    /*  892 */ {I_RCL, 2, {RM_GPR|BITS64,REG_CL,0,0,0}, nasm_bytecodes+18304, IF_X64},
+    /*  893 */ {I_RCL, 2, {RM_GPR|BITS64,IMMEDIATE,0,0,0}, nasm_bytecodes+14376, IF_X64|IF_SB},
+    /*  894 */ {I_RCR, 2, {RM_GPR|BITS8,UNITY,0,0,0}, nasm_bytecodes+19762, IF_8086},
+    /*  895 */ {I_RCR, 2, {RM_GPR|BITS8,REG_CL,0,0,0}, nasm_bytecodes+19766, IF_8086},
+    /*  896 */ {I_RCR, 2, {RM_GPR|BITS8,IMMEDIATE,0,0,0}, nasm_bytecodes+18309, IF_186|IF_SB},
+    /*  897 */ {I_RCR, 2, {RM_GPR|BITS16,UNITY,0,0,0}, nasm_bytecodes+18314, IF_8086},
+    /*  898 */ {I_RCR, 2, {RM_GPR|BITS16,REG_CL,0,0,0}, nasm_bytecodes+18319, IF_8086},
+    /*  899 */ {I_RCR, 2, {RM_GPR|BITS16,IMMEDIATE,0,0,0}, nasm_bytecodes+14382, IF_186|IF_SB},
+    /*  900 */ {I_RCR, 2, {RM_GPR|BITS32,UNITY,0,0,0}, nasm_bytecodes+18324, IF_386},
+    /*  901 */ {I_RCR, 2, {RM_GPR|BITS32,REG_CL,0,0,0}, nasm_bytecodes+18329, IF_386},
+    /*  902 */ {I_RCR, 2, {RM_GPR|BITS32,IMMEDIATE,0,0,0}, nasm_bytecodes+14388, IF_386|IF_SB},
+    /*  903 */ {I_RCR, 2, {RM_GPR|BITS64,UNITY,0,0,0}, nasm_bytecodes+18334, IF_X64},
+    /*  904 */ {I_RCR, 2, {RM_GPR|BITS64,REG_CL,0,0,0}, nasm_bytecodes+18339, IF_X64},
+    /*  905 */ {I_RCR, 2, {RM_GPR|BITS64,IMMEDIATE,0,0,0}, nasm_bytecodes+14394, IF_X64|IF_SB},
+    /*  906 */ {I_RDSHR, 1, {RM_GPR|BITS32,0,0,0,0}, nasm_bytecodes+14400, IF_P6|IF_CYRIX|IF_SMM},
+    /*  907 */ {I_RDMSR, 0, {0,0,0,0,0}, nasm_bytecodes+19770, IF_PENT|IF_PRIV},
+    /*  908 */ {I_RDPMC, 0, {0,0,0,0,0}, nasm_bytecodes+19774, IF_P6},
+    /*  909 */ {I_RDTSC, 0, {0,0,0,0,0}, nasm_bytecodes+19778, IF_PENT},
+    /*  910 */ {I_RDTSCP, 0, {0,0,0,0,0}, nasm_bytecodes+18344, IF_X86_64},
+    /*  911 */ {I_RET, 0, {0,0,0,0,0}, nasm_bytecodes+18891, IF_8086},
+    /*  912 */ {I_RET, 1, {IMMEDIATE,0,0,0,0}, nasm_bytecodes+19782, IF_8086|IF_SW},
+    /*  913 */ {I_RETF, 0, {0,0,0,0,0}, nasm_bytecodes+20013, IF_8086},
+    /*  914 */ {I_RETF, 1, {IMMEDIATE,0,0,0,0}, nasm_bytecodes+19786, IF_8086|IF_SW},
+    /*  915 */ {I_RETN, 0, {0,0,0,0,0}, nasm_bytecodes+18891, IF_8086},
+    /*  916 */ {I_RETN, 1, {IMMEDIATE,0,0,0,0}, nasm_bytecodes+19782, IF_8086|IF_SW},
+    /*  917 */ {I_ROL, 2, {RM_GPR|BITS8,UNITY,0,0,0}, nasm_bytecodes+19790, IF_8086},
+    /*  918 */ {I_ROL, 2, {RM_GPR|BITS8,REG_CL,0,0,0}, nasm_bytecodes+19794, IF_8086},
+    /*  919 */ {I_ROL, 2, {RM_GPR|BITS8,IMMEDIATE,0,0,0}, nasm_bytecodes+18349, IF_186|IF_SB},
+    /*  920 */ {I_ROL, 2, {RM_GPR|BITS16,UNITY,0,0,0}, nasm_bytecodes+18354, IF_8086},
+    /*  921 */ {I_ROL, 2, {RM_GPR|BITS16,REG_CL,0,0,0}, nasm_bytecodes+18359, IF_8086},
+    /*  922 */ {I_ROL, 2, {RM_GPR|BITS16,IMMEDIATE,0,0,0}, nasm_bytecodes+14406, IF_186|IF_SB},
+    /*  923 */ {I_ROL, 2, {RM_GPR|BITS32,UNITY,0,0,0}, nasm_bytecodes+18364, IF_386},
+    /*  924 */ {I_ROL, 2, {RM_GPR|BITS32,REG_CL,0,0,0}, nasm_bytecodes+18369, IF_386},
+    /*  925 */ {I_ROL, 2, {RM_GPR|BITS32,IMMEDIATE,0,0,0}, nasm_bytecodes+14412, IF_386|IF_SB},
+    /*  926 */ {I_ROL, 2, {RM_GPR|BITS64,UNITY,0,0,0}, nasm_bytecodes+18374, IF_X64},
+    /*  927 */ {I_ROL, 2, {RM_GPR|BITS64,REG_CL,0,0,0}, nasm_bytecodes+18379, IF_X64},
+    /*  928 */ {I_ROL, 2, {RM_GPR|BITS64,IMMEDIATE,0,0,0}, nasm_bytecodes+14418, IF_X64|IF_SB},
+    /*  929 */ {I_ROR, 2, {RM_GPR|BITS8,UNITY,0,0,0}, nasm_bytecodes+19798, IF_8086},
+    /*  930 */ {I_ROR, 2, {RM_GPR|BITS8,REG_CL,0,0,0}, nasm_bytecodes+19802, IF_8086},
+    /*  931 */ {I_ROR, 2, {RM_GPR|BITS8,IMMEDIATE,0,0,0}, nasm_bytecodes+18384, IF_186|IF_SB},
+    /*  932 */ {I_ROR, 2, {RM_GPR|BITS16,UNITY,0,0,0}, nasm_bytecodes+18389, IF_8086},
+    /*  933 */ {I_ROR, 2, {RM_GPR|BITS16,REG_CL,0,0,0}, nasm_bytecodes+18394, IF_8086},
+    /*  934 */ {I_ROR, 2, {RM_GPR|BITS16,IMMEDIATE,0,0,0}, nasm_bytecodes+14424, IF_186|IF_SB},
+    /*  935 */ {I_ROR, 2, {RM_GPR|BITS32,UNITY,0,0,0}, nasm_bytecodes+18399, IF_386},
+    /*  936 */ {I_ROR, 2, {RM_GPR|BITS32,REG_CL,0,0,0}, nasm_bytecodes+18404, IF_386},
+    /*  937 */ {I_ROR, 2, {RM_GPR|BITS32,IMMEDIATE,0,0,0}, nasm_bytecodes+14430, IF_386|IF_SB},
+    /*  938 */ {I_ROR, 2, {RM_GPR|BITS64,UNITY,0,0,0}, nasm_bytecodes+18409, IF_X64},
+    /*  939 */ {I_ROR, 2, {RM_GPR|BITS64,REG_CL,0,0,0}, nasm_bytecodes+18414, IF_X64},
+    /*  940 */ {I_ROR, 2, {RM_GPR|BITS64,IMMEDIATE,0,0,0}, nasm_bytecodes+14436, IF_X64|IF_SB},
+    /*  941 */ {I_RSDC, 2, {REG_SREG,MEMORY|BITS80,0,0,0}, nasm_bytecodes+15823, IF_486|IF_CYRIX|IF_SMM},
+    /*  942 */ {I_RSLDT, 1, {MEMORY|BITS80,0,0,0,0}, nasm_bytecodes+18419, IF_486|IF_CYRIX|IF_SMM},
+    /*  943 */ {I_RSM, 0, {0,0,0,0,0}, nasm_bytecodes+19806, IF_PENT|IF_SMM},
+    /*  944 */ {I_RSTS, 1, {MEMORY|BITS80,0,0,0,0}, nasm_bytecodes+18424, IF_486|IF_CYRIX|IF_SMM},
+    /*  945 */ {I_SAHF, 0, {0,0,0,0,0}, nasm_bytecodes+5465, IF_8086},
+    /*  946 */ {I_SALC, 0, {0,0,0,0,0}, nasm_bytecodes+20016, IF_8086|IF_UNDOC},
+    /*  947 */ {I_SAR, 2, {RM_GPR|BITS8,UNITY,0,0,0}, nasm_bytecodes+19818, IF_8086},
+    /*  948 */ {I_SAR, 2, {RM_GPR|BITS8,REG_CL,0,0,0}, nasm_bytecodes+19822, IF_8086},
+    /*  949 */ {I_SAR, 2, {RM_GPR|BITS8,IMMEDIATE,0,0,0}, nasm_bytecodes+18464, IF_186|IF_SB},
+    /*  950 */ {I_SAR, 2, {RM_GPR|BITS16,UNITY,0,0,0}, nasm_bytecodes+18469, IF_8086},
+    /*  951 */ {I_SAR, 2, {RM_GPR|BITS16,REG_CL,0,0,0}, nasm_bytecodes+18474, IF_8086},
+    /*  952 */ {I_SAR, 2, {RM_GPR|BITS16,IMMEDIATE,0,0,0}, nasm_bytecodes+14460, IF_186|IF_SB},
+    /*  953 */ {I_SAR, 2, {RM_GPR|BITS32,UNITY,0,0,0}, nasm_bytecodes+18479, IF_386},
+    /*  954 */ {I_SAR, 2, {RM_GPR|BITS32,REG_CL,0,0,0}, nasm_bytecodes+18484, IF_386},
+    /*  955 */ {I_SAR, 2, {RM_GPR|BITS32,IMMEDIATE,0,0,0}, nasm_bytecodes+14466, IF_386|IF_SB},
+    /*  956 */ {I_SAR, 2, {RM_GPR|BITS64,UNITY,0,0,0}, nasm_bytecodes+18489, IF_X64},
+    /*  957 */ {I_SAR, 2, {RM_GPR|BITS64,REG_CL,0,0,0}, nasm_bytecodes+18494, IF_X64},
+    /*  958 */ {I_SAR, 2, {RM_GPR|BITS64,IMMEDIATE,0,0,0}, nasm_bytecodes+14472, IF_X64|IF_SB},
+    /*  959 */ {I_SBB, 2, {MEMORY,REG_GPR|BITS8,0,0,0}, nasm_bytecodes+19826, IF_8086|IF_SM},
+    /*  960 */ {I_SBB, 2, {REG_GPR|BITS8,REG_GPR|BITS8,0,0,0}, nasm_bytecodes+19826, IF_8086},
+    /*  961 */ {I_SBB, 2, {MEMORY,REG_GPR|BITS16,0,0,0}, nasm_bytecodes+18499, IF_8086|IF_SM},
+    /*  962 */ {I_SBB, 2, {REG_GPR|BITS16,REG_GPR|BITS16,0,0,0}, nasm_bytecodes+18499, IF_8086},
+    /*  963 */ {I_SBB, 2, {MEMORY,REG_GPR|BITS32,0,0,0}, nasm_bytecodes+18504, IF_386|IF_SM},
+    /*  964 */ {I_SBB, 2, {REG_GPR|BITS32,REG_GPR|BITS32,0,0,0}, nasm_bytecodes+18504, IF_386},
+    /*  965 */ {I_SBB, 2, {MEMORY,REG_GPR|BITS64,0,0,0}, nasm_bytecodes+18509, IF_X64|IF_SM},
+    /*  966 */ {I_SBB, 2, {REG_GPR|BITS64,REG_GPR|BITS64,0,0,0}, nasm_bytecodes+18509, IF_X64},
+    /*  967 */ {I_SBB, 2, {REG_GPR|BITS8,MEMORY,0,0,0}, nasm_bytecodes+9115, IF_8086|IF_SM},
+    /*  968 */ {I_SBB, 2, {REG_GPR|BITS8,REG_GPR|BITS8,0,0,0}, nasm_bytecodes+9115, IF_8086},
+    /*  969 */ {I_SBB, 2, {REG_GPR|BITS16,MEMORY,0,0,0}, nasm_bytecodes+18514, IF_8086|IF_SM},
+    /*  970 */ {I_SBB, 2, {REG_GPR|BITS16,REG_GPR|BITS16,0,0,0}, nasm_bytecodes+18514, IF_8086},
+    /*  971 */ {I_SBB, 2, {REG_GPR|BITS32,MEMORY,0,0,0}, nasm_bytecodes+18519, IF_386|IF_SM},
+    /*  972 */ {I_SBB, 2, {REG_GPR|BITS32,REG_GPR|BITS32,0,0,0}, nasm_bytecodes+18519, IF_386},
+    /*  973 */ {I_SBB, 2, {REG_GPR|BITS64,MEMORY,0,0,0}, nasm_bytecodes+18524, IF_X64|IF_SM},
+    /*  974 */ {I_SBB, 2, {REG_GPR|BITS64,REG_GPR|BITS64,0,0,0}, nasm_bytecodes+18524, IF_X64},
+    /*  975 */ {I_SBB, 2, {RM_GPR|BITS16,IMMEDIATE|BITS8,0,0,0}, nasm_bytecodes+14478, IF_8086},
+    /*  976 */ {I_SBB, 2, {RM_GPR|BITS32,IMMEDIATE|BITS8,0,0,0}, nasm_bytecodes+14484, IF_386},
+    /*  977 */ {I_SBB, 2, {RM_GPR|BITS64,IMMEDIATE|BITS8,0,0,0}, nasm_bytecodes+14490, IF_X64},
+    /*  978 */ {I_SBB, 2, {REG_AL,IMMEDIATE,0,0,0}, nasm_bytecodes+19830, IF_8086|IF_SM},
+    /*  979 */ {I_SBB, 2, {REG_AX,SBYTE16,0,0,0}, nasm_bytecodes+14478, IF_8086|IF_SM},
+    /*  980 */ {I_SBB, 2, {REG_AX,IMMEDIATE,0,0,0}, nasm_bytecodes+18529, IF_8086|IF_SM},
+    /*  981 */ {I_SBB, 2, {REG_EAX,SBYTE32,0,0,0}, nasm_bytecodes+14484, IF_386|IF_SM},
+    /*  982 */ {I_SBB, 2, {REG_EAX,IMMEDIATE,0,0,0}, nasm_bytecodes+18534, IF_386|IF_SM},
+    /*  983 */ {I_SBB, 2, {REG_RAX,SBYTE64,0,0,0}, nasm_bytecodes+14490, IF_X64|IF_SM},
+    /*  984 */ {I_SBB, 2, {REG_RAX,IMMEDIATE,0,0,0}, nasm_bytecodes+18539, IF_X64|IF_SM},
+    /*  985 */ {I_SBB, 2, {RM_GPR|BITS8,IMMEDIATE,0,0,0}, nasm_bytecodes+18544, IF_8086|IF_SM},
+    /*  986 */ {I_SBB, 2, {RM_GPR|BITS16,IMMEDIATE,0,0,0}, nasm_bytecodes+14496, IF_8086|IF_SM},
+    /*  987 */ {I_SBB, 2, {RM_GPR|BITS32,IMMEDIATE,0,0,0}, nasm_bytecodes+14502, IF_386|IF_SM},
+    /*  988 */ {I_SBB, 2, {RM_GPR|BITS64,IMMEDIATE,0,0,0}, nasm_bytecodes+14508, IF_X64|IF_SM},
+    /*  989 */ {I_SBB, 2, {MEMORY,IMMEDIATE|BITS8,0,0,0}, nasm_bytecodes+18544, IF_8086|IF_SM},
+    /*  990 */ {I_SBB, 2, {MEMORY,IMMEDIATE|BITS16,0,0,0}, nasm_bytecodes+14496, IF_8086|IF_SM},
+    /*  991 */ {I_SBB, 2, {MEMORY,IMMEDIATE|BITS32,0,0,0}, nasm_bytecodes+14502, IF_386|IF_SM},
+    /*  992 */ {I_SCASB, 0, {0,0,0,0,0}, nasm_bytecodes+19834, IF_8086},
+    /*  993 */ {I_SCASD, 0, {0,0,0,0,0}, nasm_bytecodes+18549, IF_386},
+    /*  994 */ {I_SCASQ, 0, {0,0,0,0,0}, nasm_bytecodes+18554, IF_X64},
+    /*  995 */ {I_SCASW, 0, {0,0,0,0,0}, nasm_bytecodes+18559, IF_8086},
+    /*  996 */ {I_SFENCE, 0, {0,0,0,0,0}, nasm_bytecodes+18564, IF_X64|IF_AMD},
+    /*  997 */ {I_SGDT, 1, {MEMORY,0,0,0,0}, nasm_bytecodes+18569, IF_286},
+    /*  998 */ {I_SHL, 2, {RM_GPR|BITS8,UNITY,0,0,0}, nasm_bytecodes+19810, IF_8086},
+    /*  999 */ {I_SHL, 2, {RM_GPR|BITS8,REG_CL,0,0,0}, nasm_bytecodes+19814, IF_8086},
+    /* 1000 */ {I_SHL, 2, {RM_GPR|BITS8,IMMEDIATE,0,0,0}, nasm_bytecodes+18429, IF_186|IF_SB},
+    /* 1001 */ {I_SHL, 2, {RM_GPR|BITS16,UNITY,0,0,0}, nasm_bytecodes+18434, IF_8086},
+    /* 1002 */ {I_SHL, 2, {RM_GPR|BITS16,REG_CL,0,0,0}, nasm_bytecodes+18439, IF_8086},
+    /* 1003 */ {I_SHL, 2, {RM_GPR|BITS16,IMMEDIATE,0,0,0}, nasm_bytecodes+14442, IF_186|IF_SB},
+    /* 1004 */ {I_SHL, 2, {RM_GPR|BITS32,UNITY,0,0,0}, nasm_bytecodes+18444, IF_386},
+    /* 1005 */ {I_SHL, 2, {RM_GPR|BITS32,REG_CL,0,0,0}, nasm_bytecodes+18449, IF_386},
+    /* 1006 */ {I_SHL, 2, {RM_GPR|BITS32,IMMEDIATE,0,0,0}, nasm_bytecodes+14448, IF_386|IF_SB},
+    /* 1007 */ {I_SHL, 2, {RM_GPR|BITS64,UNITY,0,0,0}, nasm_bytecodes+18454, IF_X64},
+    /* 1008 */ {I_SHL, 2, {RM_GPR|BITS64,REG_CL,0,0,0}, nasm_bytecodes+18459, IF_X64},
+    /* 1009 */ {I_SHL, 2, {RM_GPR|BITS64,IMMEDIATE,0,0,0}, nasm_bytecodes+14454, IF_X64|IF_SB},
+    /* 1010 */ {I_SHLD, 3, {MEMORY,REG_GPR|BITS16,IMMEDIATE,0,0}, nasm_bytecodes+7747, IF_386|IF_SM2|IF_SB|IF_AR2},
+    /* 1011 */ {I_SHLD, 3, {REG_GPR|BITS16,REG_GPR|BITS16,IMMEDIATE,0,0}, nasm_bytecodes+7747, IF_386|IF_SM2|IF_SB|IF_AR2},
+    /* 1012 */ {I_SHLD, 3, {MEMORY,REG_GPR|BITS32,IMMEDIATE,0,0}, nasm_bytecodes+7754, IF_386|IF_SM2|IF_SB|IF_AR2},
+    /* 1013 */ {I_SHLD, 3, {REG_GPR|BITS32,REG_GPR|BITS32,IMMEDIATE,0,0}, nasm_bytecodes+7754, IF_386|IF_SM2|IF_SB|IF_AR2},
+    /* 1014 */ {I_SHLD, 3, {MEMORY,REG_GPR|BITS64,IMMEDIATE,0,0}, nasm_bytecodes+7761, IF_X64|IF_SM2|IF_SB|IF_AR2},
+    /* 1015 */ {I_SHLD, 3, {REG_GPR|BITS64,REG_GPR|BITS64,IMMEDIATE,0,0}, nasm_bytecodes+7761, IF_X64|IF_SM2|IF_SB|IF_AR2},
+    /* 1016 */ {I_SHLD, 3, {MEMORY,REG_GPR|BITS16,REG_CL,0,0}, nasm_bytecodes+14514, IF_386|IF_SM},
+    /* 1017 */ {I_SHLD, 3, {REG_GPR|BITS16,REG_GPR|BITS16,REG_CL,0,0}, nasm_bytecodes+14514, IF_386},
+    /* 1018 */ {I_SHLD, 3, {MEMORY,REG_GPR|BITS32,REG_CL,0,0}, nasm_bytecodes+14520, IF_386|IF_SM},
+    /* 1019 */ {I_SHLD, 3, {REG_GPR|BITS32,REG_GPR|BITS32,REG_CL,0,0}, nasm_bytecodes+14520, IF_386},
+    /* 1020 */ {I_SHLD, 3, {MEMORY,REG_GPR|BITS64,REG_CL,0,0}, nasm_bytecodes+14526, IF_X64|IF_SM},
+    /* 1021 */ {I_SHLD, 3, {REG_GPR|BITS64,REG_GPR|BITS64,REG_CL,0,0}, nasm_bytecodes+14526, IF_X64},
+    /* 1022 */ {I_SHR, 2, {RM_GPR|BITS8,UNITY,0,0,0}, nasm_bytecodes+19838, IF_8086},
+    /* 1023 */ {I_SHR, 2, {RM_GPR|BITS8,REG_CL,0,0,0}, nasm_bytecodes+19842, IF_8086},
+    /* 1024 */ {I_SHR, 2, {RM_GPR|BITS8,IMMEDIATE,0,0,0}, nasm_bytecodes+18574, IF_186|IF_SB},
+    /* 1025 */ {I_SHR, 2, {RM_GPR|BITS16,UNITY,0,0,0}, nasm_bytecodes+18579, IF_8086},
+    /* 1026 */ {I_SHR, 2, {RM_GPR|BITS16,REG_CL,0,0,0}, nasm_bytecodes+18584, IF_8086},
+    /* 1027 */ {I_SHR, 2, {RM_GPR|BITS16,IMMEDIATE,0,0,0}, nasm_bytecodes+14532, IF_186|IF_SB},
+    /* 1028 */ {I_SHR, 2, {RM_GPR|BITS32,UNITY,0,0,0}, nasm_bytecodes+18589, IF_386},
+    /* 1029 */ {I_SHR, 2, {RM_GPR|BITS32,REG_CL,0,0,0}, nasm_bytecodes+18594, IF_386},
+    /* 1030 */ {I_SHR, 2, {RM_GPR|BITS32,IMMEDIATE,0,0,0}, nasm_bytecodes+14538, IF_386|IF_SB},
+    /* 1031 */ {I_SHR, 2, {RM_GPR|BITS64,UNITY,0,0,0}, nasm_bytecodes+18599, IF_X64},
+    /* 1032 */ {I_SHR, 2, {RM_GPR|BITS64,REG_CL,0,0,0}, nasm_bytecodes+18604, IF_X64},
+    /* 1033 */ {I_SHR, 2, {RM_GPR|BITS64,IMMEDIATE,0,0,0}, nasm_bytecodes+14544, IF_X64|IF_SB},
+    /* 1034 */ {I_SHRD, 3, {MEMORY,REG_GPR|BITS16,IMMEDIATE,0,0}, nasm_bytecodes+7768, IF_386|IF_SM2|IF_SB|IF_AR2},
+    /* 1035 */ {I_SHRD, 3, {REG_GPR|BITS16,REG_GPR|BITS16,IMMEDIATE,0,0}, nasm_bytecodes+7768, IF_386|IF_SM2|IF_SB|IF_AR2},
+    /* 1036 */ {I_SHRD, 3, {MEMORY,REG_GPR|BITS32,IMMEDIATE,0,0}, nasm_bytecodes+7775, IF_386|IF_SM2|IF_SB|IF_AR2},
+    /* 1037 */ {I_SHRD, 3, {REG_GPR|BITS32,REG_GPR|BITS32,IMMEDIATE,0,0}, nasm_bytecodes+7775, IF_386|IF_SM2|IF_SB|IF_AR2},
+    /* 1038 */ {I_SHRD, 3, {MEMORY,REG_GPR|BITS64,IMMEDIATE,0,0}, nasm_bytecodes+7782, IF_X64|IF_SM2|IF_SB|IF_AR2},
+    /* 1039 */ {I_SHRD, 3, {REG_GPR|BITS64,REG_GPR|BITS64,IMMEDIATE,0,0}, nasm_bytecodes+7782, IF_X64|IF_SM2|IF_SB|IF_AR2},
+    /* 1040 */ {I_SHRD, 3, {MEMORY,REG_GPR|BITS16,REG_CL,0,0}, nasm_bytecodes+14550, IF_386|IF_SM},
+    /* 1041 */ {I_SHRD, 3, {REG_GPR|BITS16,REG_GPR|BITS16,REG_CL,0,0}, nasm_bytecodes+14550, IF_386},
+    /* 1042 */ {I_SHRD, 3, {MEMORY,REG_GPR|BITS32,REG_CL,0,0}, nasm_bytecodes+14556, IF_386|IF_SM},
+    /* 1043 */ {I_SHRD, 3, {REG_GPR|BITS32,REG_GPR|BITS32,REG_CL,0,0}, nasm_bytecodes+14556, IF_386},
+    /* 1044 */ {I_SHRD, 3, {MEMORY,REG_GPR|BITS64,REG_CL,0,0}, nasm_bytecodes+14562, IF_X64|IF_SM},
+    /* 1045 */ {I_SHRD, 3, {REG_GPR|BITS64,REG_GPR|BITS64,REG_CL,0,0}, nasm_bytecodes+14562, IF_X64},
+    /* 1046 */ {I_SIDT, 1, {MEMORY,0,0,0,0}, nasm_bytecodes+18609, IF_286},
+    /* 1047 */ {I_SLDT, 1, {MEMORY,0,0,0,0}, nasm_bytecodes+14587, IF_286},
+    /* 1048 */ {I_SLDT, 1, {MEMORY|BITS16,0,0,0,0}, nasm_bytecodes+14587, IF_286},
+    /* 1049 */ {I_SLDT, 1, {REG_GPR|BITS16,0,0,0,0}, nasm_bytecodes+14568, IF_286},
+    /* 1050 */ {I_SLDT, 1, {REG_GPR|BITS32,0,0,0,0}, nasm_bytecodes+14574, IF_386},
+    /* 1051 */ {I_SLDT, 1, {REG_GPR|BITS64,0,0,0,0}, nasm_bytecodes+14586, IF_X64},
+    /* 1052 */ {I_SKINIT, 0, {0,0,0,0,0}, nasm_bytecodes+18614, IF_X64},
+    /* 1053 */ {I_SMI, 0, {0,0,0,0,0}, nasm_bytecodes+19986, IF_386|IF_UNDOC},
+    /* 1054 */ {I_SMSW, 1, {MEMORY,0,0,0,0}, nasm_bytecodes+14599, IF_286},
+    /* 1055 */ {I_SMSW, 1, {MEMORY|BITS16,0,0,0,0}, nasm_bytecodes+14599, IF_286},
+    /* 1056 */ {I_SMSW, 1, {REG_GPR|BITS16,0,0,0,0}, nasm_bytecodes+14592, IF_286},
+    /* 1057 */ {I_SMSW, 1, {REG_GPR|BITS32,0,0,0,0}, nasm_bytecodes+14598, IF_386},
+    /* 1058 */ {I_STC, 0, {0,0,0,0,0}, nasm_bytecodes+18346, IF_8086},
+    /* 1059 */ {I_STD, 0, {0,0,0,0,0}, nasm_bytecodes+20019, IF_8086},
+    /* 1060 */ {I_STGI, 0, {0,0,0,0,0}, nasm_bytecodes+18619, IF_X64},
+    /* 1061 */ {I_STI, 0, {0,0,0,0,0}, nasm_bytecodes+20022, IF_8086},
+    /* 1062 */ {I_STOSB, 0, {0,0,0,0,0}, nasm_bytecodes+5569, IF_8086},
+    /* 1063 */ {I_STOSD, 0, {0,0,0,0,0}, nasm_bytecodes+19854, IF_386},
+    /* 1064 */ {I_STOSQ, 0, {0,0,0,0,0}, nasm_bytecodes+19858, IF_X64},
+    /* 1065 */ {I_STOSW, 0, {0,0,0,0,0}, nasm_bytecodes+19862, IF_8086},
+    /* 1066 */ {I_STR, 1, {MEMORY,0,0,0,0}, nasm_bytecodes+14617, IF_286|IF_PROT},
+    /* 1067 */ {I_STR, 1, {MEMORY|BITS16,0,0,0,0}, nasm_bytecodes+14617, IF_286|IF_PROT},
+    /* 1068 */ {I_STR, 1, {REG_GPR|BITS16,0,0,0,0}, nasm_bytecodes+14604, IF_286|IF_PROT},
+    /* 1069 */ {I_STR, 1, {REG_GPR|BITS32,0,0,0,0}, nasm_bytecodes+14610, IF_386|IF_PROT},
+    /* 1070 */ {I_STR, 1, {REG_GPR|BITS64,0,0,0,0}, nasm_bytecodes+14616, IF_X64},
+    /* 1071 */ {I_SUB, 2, {MEMORY,REG_GPR|BITS8,0,0,0}, nasm_bytecodes+19866, IF_8086|IF_SM},
+    /* 1072 */ {I_SUB, 2, {REG_GPR|BITS8,REG_GPR|BITS8,0,0,0}, nasm_bytecodes+19866, IF_8086},
+    /* 1073 */ {I_SUB, 2, {MEMORY,REG_GPR|BITS16,0,0,0}, nasm_bytecodes+18624, IF_8086|IF_SM},
+    /* 1074 */ {I_SUB, 2, {REG_GPR|BITS16,REG_GPR|BITS16,0,0,0}, nasm_bytecodes+18624, IF_8086},
+    /* 1075 */ {I_SUB, 2, {MEMORY,REG_GPR|BITS32,0,0,0}, nasm_bytecodes+18629, IF_386|IF_SM},
+    /* 1076 */ {I_SUB, 2, {REG_GPR|BITS32,REG_GPR|BITS32,0,0,0}, nasm_bytecodes+18629, IF_386},
+    /* 1077 */ {I_SUB, 2, {MEMORY,REG_GPR|BITS64,0,0,0}, nasm_bytecodes+18634, IF_X64|IF_SM},
+    /* 1078 */ {I_SUB, 2, {REG_GPR|BITS64,REG_GPR|BITS64,0,0,0}, nasm_bytecodes+18634, IF_X64},
+    /* 1079 */ {I_SUB, 2, {REG_GPR|BITS8,MEMORY,0,0,0}, nasm_bytecodes+10130, IF_8086|IF_SM},
+    /* 1080 */ {I_SUB, 2, {REG_GPR|BITS8,REG_GPR|BITS8,0,0,0}, nasm_bytecodes+10130, IF_8086},
+    /* 1081 */ {I_SUB, 2, {REG_GPR|BITS16,MEMORY,0,0,0}, nasm_bytecodes+18639, IF_8086|IF_SM},
+    /* 1082 */ {I_SUB, 2, {REG_GPR|BITS16,REG_GPR|BITS16,0,0,0}, nasm_bytecodes+18639, IF_8086},
+    /* 1083 */ {I_SUB, 2, {REG_GPR|BITS32,MEMORY,0,0,0}, nasm_bytecodes+18644, IF_386|IF_SM},
+    /* 1084 */ {I_SUB, 2, {REG_GPR|BITS32,REG_GPR|BITS32,0,0,0}, nasm_bytecodes+18644, IF_386},
+    /* 1085 */ {I_SUB, 2, {REG_GPR|BITS64,MEMORY,0,0,0}, nasm_bytecodes+18649, IF_X64|IF_SM},
+    /* 1086 */ {I_SUB, 2, {REG_GPR|BITS64,REG_GPR|BITS64,0,0,0}, nasm_bytecodes+18649, IF_X64},
+    /* 1087 */ {I_SUB, 2, {RM_GPR|BITS16,IMMEDIATE|BITS8,0,0,0}, nasm_bytecodes+14622, IF_8086},
+    /* 1088 */ {I_SUB, 2, {RM_GPR|BITS32,IMMEDIATE|BITS8,0,0,0}, nasm_bytecodes+14628, IF_386},
+    /* 1089 */ {I_SUB, 2, {RM_GPR|BITS64,IMMEDIATE|BITS8,0,0,0}, nasm_bytecodes+14634, IF_X64},
+    /* 1090 */ {I_SUB, 2, {REG_AL,IMMEDIATE,0,0,0}, nasm_bytecodes+19870, IF_8086|IF_SM},
+    /* 1091 */ {I_SUB, 2, {REG_AX,SBYTE16,0,0,0}, nasm_bytecodes+14622, IF_8086|IF_SM},
+    /* 1092 */ {I_SUB, 2, {REG_AX,IMMEDIATE,0,0,0}, nasm_bytecodes+18654, IF_8086|IF_SM},
+    /* 1093 */ {I_SUB, 2, {REG_EAX,SBYTE32,0,0,0}, nasm_bytecodes+14628, IF_386|IF_SM},
+    /* 1094 */ {I_SUB, 2, {REG_EAX,IMMEDIATE,0,0,0}, nasm_bytecodes+18659, IF_386|IF_SM},
+    /* 1095 */ {I_SUB, 2, {REG_RAX,SBYTE64,0,0,0}, nasm_bytecodes+14634, IF_X64|IF_SM},
+    /* 1096 */ {I_SUB, 2, {REG_RAX,IMMEDIATE,0,0,0}, nasm_bytecodes+18664, IF_X64|IF_SM},
+    /* 1097 */ {I_SUB, 2, {RM_GPR|BITS8,IMMEDIATE,0,0,0}, nasm_bytecodes+18669, IF_8086|IF_SM},
+    /* 1098 */ {I_SUB, 2, {RM_GPR|BITS16,IMMEDIATE,0,0,0}, nasm_bytecodes+14640, IF_8086|IF_SM},
+    /* 1099 */ {I_SUB, 2, {RM_GPR|BITS32,IMMEDIATE,0,0,0}, nasm_bytecodes+14646, IF_386|IF_SM},
+    /* 1100 */ {I_SUB, 2, {RM_GPR|BITS64,IMMEDIATE,0,0,0}, nasm_bytecodes+14652, IF_X64|IF_SM},
+    /* 1101 */ {I_SUB, 2, {MEMORY,IMMEDIATE|BITS8,0,0,0}, nasm_bytecodes+18669, IF_8086|IF_SM},
+    /* 1102 */ {I_SUB, 2, {MEMORY,IMMEDIATE|BITS16,0,0,0}, nasm_bytecodes+14640, IF_8086|IF_SM},
+    /* 1103 */ {I_SUB, 2, {MEMORY,IMMEDIATE|BITS32,0,0,0}, nasm_bytecodes+14646, IF_386|IF_SM},
+    /* 1104 */ {I_SVDC, 2, {MEMORY|BITS80,REG_SREG,0,0,0}, nasm_bytecodes+8190, IF_486|IF_CYRIX|IF_SMM},
+    /* 1105 */ {I_SVTS, 1, {MEMORY|BITS80,0,0,0,0}, nasm_bytecodes+18679, IF_486|IF_CYRIX|IF_SMM},
+    /* 1106 */ {I_SWAPGS, 0, {0,0,0,0,0}, nasm_bytecodes+18684, IF_X64},
+    /* 1107 */ {I_SYSCALL, 0, {0,0,0,0,0}, nasm_bytecodes+19574, IF_P6|IF_AMD},
+    /* 1108 */ {I_SYSENTER, 0, {0,0,0,0,0}, nasm_bytecodes+19874, IF_P6},
+    /* 1109 */ {I_SYSEXIT, 0, {0,0,0,0,0}, nasm_bytecodes+19878, IF_P6|IF_PRIV},
+    /* 1110 */ {I_SYSRET, 0, {0,0,0,0,0}, nasm_bytecodes+19570, IF_P6|IF_PRIV|IF_AMD},
+    /* 1111 */ {I_TEST, 2, {MEMORY,REG_GPR|BITS8,0,0,0}, nasm_bytecodes+19882, IF_8086|IF_SM},
+    /* 1112 */ {I_TEST, 2, {REG_GPR|BITS8,REG_GPR|BITS8,0,0,0}, nasm_bytecodes+19882, IF_8086},
+    /* 1113 */ {I_TEST, 2, {MEMORY,REG_GPR|BITS16,0,0,0}, nasm_bytecodes+18689, IF_8086|IF_SM},
+    /* 1114 */ {I_TEST, 2, {REG_GPR|BITS16,REG_GPR|BITS16,0,0,0}, nasm_bytecodes+18689, IF_8086},
+    /* 1115 */ {I_TEST, 2, {MEMORY,REG_GPR|BITS32,0,0,0}, nasm_bytecodes+18694, IF_386|IF_SM},
+    /* 1116 */ {I_TEST, 2, {REG_GPR|BITS32,REG_GPR|BITS32,0,0,0}, nasm_bytecodes+18694, IF_386},
+    /* 1117 */ {I_TEST, 2, {MEMORY,REG_GPR|BITS64,0,0,0}, nasm_bytecodes+18699, IF_X64|IF_SM},
+    /* 1118 */ {I_TEST, 2, {REG_GPR|BITS64,REG_GPR|BITS64,0,0,0}, nasm_bytecodes+18699, IF_X64},
+    /* 1119 */ {I_TEST, 2, {REG_GPR|BITS8,MEMORY,0,0,0}, nasm_bytecodes+19886, IF_8086|IF_SM},
+    /* 1120 */ {I_TEST, 2, {REG_GPR|BITS16,MEMORY,0,0,0}, nasm_bytecodes+18704, IF_8086|IF_SM},
+    /* 1121 */ {I_TEST, 2, {REG_GPR|BITS32,MEMORY,0,0,0}, nasm_bytecodes+18709, IF_386|IF_SM},
+    /* 1122 */ {I_TEST, 2, {REG_GPR|BITS64,MEMORY,0,0,0}, nasm_bytecodes+18714, IF_X64|IF_SM},
+    /* 1123 */ {I_TEST, 2, {REG_AL,IMMEDIATE,0,0,0}, nasm_bytecodes+19890, IF_8086|IF_SM},
+    /* 1124 */ {I_TEST, 2, {REG_AX,IMMEDIATE,0,0,0}, nasm_bytecodes+18719, IF_8086|IF_SM},
+    /* 1125 */ {I_TEST, 2, {REG_EAX,IMMEDIATE,0,0,0}, nasm_bytecodes+18724, IF_386|IF_SM},
+    /* 1126 */ {I_TEST, 2, {REG_RAX,IMMEDIATE,0,0,0}, nasm_bytecodes+18729, IF_X64|IF_SM},
+    /* 1127 */ {I_TEST, 2, {RM_GPR|BITS8,IMMEDIATE,0,0,0}, nasm_bytecodes+18734, IF_8086|IF_SM},
+    /* 1128 */ {I_TEST, 2, {RM_GPR|BITS16,IMMEDIATE,0,0,0}, nasm_bytecodes+14658, IF_8086|IF_SM},
+    /* 1129 */ {I_TEST, 2, {RM_GPR|BITS32,IMMEDIATE,0,0,0}, nasm_bytecodes+14664, IF_386|IF_SM},
+    /* 1130 */ {I_TEST, 2, {RM_GPR|BITS64,IMMEDIATE,0,0,0}, nasm_bytecodes+14670, IF_X64|IF_SM},
+    /* 1131 */ {I_TEST, 2, {MEMORY,IMMEDIATE|BITS8,0,0,0}, nasm_bytecodes+18734, IF_8086|IF_SM},
+    /* 1132 */ {I_TEST, 2, {MEMORY,IMMEDIATE|BITS16,0,0,0}, nasm_bytecodes+14658, IF_8086|IF_SM},
+    /* 1133 */ {I_TEST, 2, {MEMORY,IMMEDIATE|BITS32,0,0,0}, nasm_bytecodes+14664, IF_386|IF_SM},
+    /* 1134 */ {I_UD0, 0, {0,0,0,0,0}, nasm_bytecodes+19894, IF_186|IF_UNDOC},
+    /* 1135 */ {I_UD1, 0, {0,0,0,0,0}, nasm_bytecodes+19898, IF_186|IF_UNDOC},
+    /* 1136 */ {I_UD2, 0, {0,0,0,0,0}, nasm_bytecodes+19902, IF_186},
+    /* 1137 */ {I_VERR, 1, {MEMORY,0,0,0,0}, nasm_bytecodes+18739, IF_286|IF_PROT},
+    /* 1138 */ {I_VERR, 1, {MEMORY|BITS16,0,0,0,0}, nasm_bytecodes+18739, IF_286|IF_PROT},
+    /* 1139 */ {I_VERR, 1, {REG_GPR|BITS16,0,0,0,0}, nasm_bytecodes+18739, IF_286|IF_PROT},
+    /* 1140 */ {I_VERW, 1, {MEMORY,0,0,0,0}, nasm_bytecodes+18744, IF_286|IF_PROT},
+    /* 1141 */ {I_VERW, 1, {MEMORY|BITS16,0,0,0,0}, nasm_bytecodes+18744, IF_286|IF_PROT},
+    /* 1142 */ {I_VERW, 1, {REG_GPR|BITS16,0,0,0,0}, nasm_bytecodes+18744, IF_286|IF_PROT},
+    /* 1143 */ {I_FWAIT, 0, {0,0,0,0,0}, nasm_bytecodes+19468, IF_8086},
+    /* 1144 */ {I_WBINVD, 0, {0,0,0,0,0}, nasm_bytecodes+19906, IF_486|IF_PRIV},
+    /* 1145 */ {I_WRSHR, 1, {RM_GPR|BITS32,0,0,0,0}, nasm_bytecodes+14688, IF_P6|IF_CYRIX|IF_SMM},
+    /* 1146 */ {I_WRMSR, 0, {0,0,0,0,0}, nasm_bytecodes+19910, IF_PENT|IF_PRIV},
+    /* 1147 */ {I_XADD, 2, {MEMORY,REG_GPR|BITS8,0,0,0}, nasm_bytecodes+18749, IF_486|IF_SM},
+    /* 1148 */ {I_XADD, 2, {REG_GPR|BITS8,REG_GPR|BITS8,0,0,0}, nasm_bytecodes+18749, IF_486},
+    /* 1149 */ {I_XADD, 2, {MEMORY,REG_GPR|BITS16,0,0,0}, nasm_bytecodes+14694, IF_486|IF_SM},
+    /* 1150 */ {I_XADD, 2, {REG_GPR|BITS16,REG_GPR|BITS16,0,0,0}, nasm_bytecodes+14694, IF_486},
+    /* 1151 */ {I_XADD, 2, {MEMORY,REG_GPR|BITS32,0,0,0}, nasm_bytecodes+14700, IF_486|IF_SM},
+    /* 1152 */ {I_XADD, 2, {REG_GPR|BITS32,REG_GPR|BITS32,0,0,0}, nasm_bytecodes+14700, IF_486},
+    /* 1153 */ {I_XADD, 2, {MEMORY,REG_GPR|BITS64,0,0,0}, nasm_bytecodes+14706, IF_X64|IF_SM},
+    /* 1154 */ {I_XADD, 2, {REG_GPR|BITS64,REG_GPR|BITS64,0,0,0}, nasm_bytecodes+14706, IF_X64},
+    /* 1155 */ {I_XCHG, 2, {REG_AX,REG_GPR|BITS16,0,0,0}, nasm_bytecodes+19914, IF_8086},
+    /* 1156 */ {I_XCHG, 2, {REG_EAX,REG32NA,0,0,0}, nasm_bytecodes+19918, IF_386},
+    /* 1157 */ {I_XCHG, 2, {REG_RAX,REG_GPR|BITS64,0,0,0}, nasm_bytecodes+19922, IF_X64},
+    /* 1158 */ {I_XCHG, 2, {REG_GPR|BITS16,REG_AX,0,0,0}, nasm_bytecodes+19926, IF_8086},
+    /* 1159 */ {I_XCHG, 2, {REG32NA,REG_EAX,0,0,0}, nasm_bytecodes+19930, IF_386},
+    /* 1160 */ {I_XCHG, 2, {REG_GPR|BITS64,REG_RAX,0,0,0}, nasm_bytecodes+19934, IF_X64},
+    /* 1161 */ {I_XCHG, 2, {REG_EAX,REG_EAX,0,0,0}, nasm_bytecodes+19938, IF_386|IF_NOLONG},
+    /* 1162 */ {I_XCHG, 2, {REG_GPR|BITS8,MEMORY,0,0,0}, nasm_bytecodes+19942, IF_8086|IF_SM},
+    /* 1163 */ {I_XCHG, 2, {REG_GPR|BITS8,REG_GPR|BITS8,0,0,0}, nasm_bytecodes+19942, IF_8086},
+    /* 1164 */ {I_XCHG, 2, {REG_GPR|BITS16,MEMORY,0,0,0}, nasm_bytecodes+18754, IF_8086|IF_SM},
+    /* 1165 */ {I_XCHG, 2, {REG_GPR|BITS16,REG_GPR|BITS16,0,0,0}, nasm_bytecodes+18754, IF_8086},
+    /* 1166 */ {I_XCHG, 2, {REG_GPR|BITS32,MEMORY,0,0,0}, nasm_bytecodes+18759, IF_386|IF_SM},
+    /* 1167 */ {I_XCHG, 2, {REG_GPR|BITS32,REG_GPR|BITS32,0,0,0}, nasm_bytecodes+18759, IF_386},
+    /* 1168 */ {I_XCHG, 2, {REG_GPR|BITS64,MEMORY,0,0,0}, nasm_bytecodes+18764, IF_X64|IF_SM},
+    /* 1169 */ {I_XCHG, 2, {REG_GPR|BITS64,REG_GPR|BITS64,0,0,0}, nasm_bytecodes+18764, IF_X64},
+    /* 1170 */ {I_XCHG, 2, {MEMORY,REG_GPR|BITS8,0,0,0}, nasm_bytecodes+19946, IF_8086|IF_SM},
+    /* 1171 */ {I_XCHG, 2, {REG_GPR|BITS8,REG_GPR|BITS8,0,0,0}, nasm_bytecodes+19946, IF_8086},
+    /* 1172 */ {I_XCHG, 2, {MEMORY,REG_GPR|BITS16,0,0,0}, nasm_bytecodes+18769, IF_8086|IF_SM},
+    /* 1173 */ {I_XCHG, 2, {REG_GPR|BITS16,REG_GPR|BITS16,0,0,0}, nasm_bytecodes+18769, IF_8086},
+    /* 1174 */ {I_XCHG, 2, {MEMORY,REG_GPR|BITS32,0,0,0}, nasm_bytecodes+18774, IF_386|IF_SM},
+    /* 1175 */ {I_XCHG, 2, {REG_GPR|BITS32,REG_GPR|BITS32,0,0,0}, nasm_bytecodes+18774, IF_386},
+    /* 1176 */ {I_XCHG, 2, {MEMORY,REG_GPR|BITS64,0,0,0}, nasm_bytecodes+18779, IF_X64|IF_SM},
+    /* 1177 */ {I_XCHG, 2, {REG_GPR|BITS64,REG_GPR|BITS64,0,0,0}, nasm_bytecodes+18779, IF_X64},
+    /* 1178 */ {I_XLATB, 0, {0,0,0,0,0}, nasm_bytecodes+20025, IF_8086},
+    /* 1179 */ {I_XLAT, 0, {0,0,0,0,0}, nasm_bytecodes+20025, IF_8086},
+    /* 1180 */ {I_XOR, 2, {MEMORY,REG_GPR|BITS8,0,0,0}, nasm_bytecodes+19950, IF_8086|IF_SM},
+    /* 1181 */ {I_XOR, 2, {REG_GPR|BITS8,REG_GPR|BITS8,0,0,0}, nasm_bytecodes+19950, IF_8086},
+    /* 1182 */ {I_XOR, 2, {MEMORY,REG_GPR|BITS16,0,0,0}, nasm_bytecodes+18784, IF_8086|IF_SM},
+    /* 1183 */ {I_XOR, 2, {REG_GPR|BITS16,REG_GPR|BITS16,0,0,0}, nasm_bytecodes+18784, IF_8086},
+    /* 1184 */ {I_XOR, 2, {MEMORY,REG_GPR|BITS32,0,0,0}, nasm_bytecodes+18789, IF_386|IF_SM},
+    /* 1185 */ {I_XOR, 2, {REG_GPR|BITS32,REG_GPR|BITS32,0,0,0}, nasm_bytecodes+18789, IF_386},
+    /* 1186 */ {I_XOR, 2, {MEMORY,REG_GPR|BITS64,0,0,0}, nasm_bytecodes+18794, IF_X64|IF_SM},
+    /* 1187 */ {I_XOR, 2, {REG_GPR|BITS64,REG_GPR|BITS64,0,0,0}, nasm_bytecodes+18794, IF_X64},
+    /* 1188 */ {I_XOR, 2, {REG_GPR|BITS8,MEMORY,0,0,0}, nasm_bytecodes+11208, IF_8086|IF_SM},
+    /* 1189 */ {I_XOR, 2, {REG_GPR|BITS8,REG_GPR|BITS8,0,0,0}, nasm_bytecodes+11208, IF_8086},
+    /* 1190 */ {I_XOR, 2, {REG_GPR|BITS16,MEMORY,0,0,0}, nasm_bytecodes+18799, IF_8086|IF_SM},
+    /* 1191 */ {I_XOR, 2, {REG_GPR|BITS16,REG_GPR|BITS16,0,0,0}, nasm_bytecodes+18799, IF_8086},
+    /* 1192 */ {I_XOR, 2, {REG_GPR|BITS32,MEMORY,0,0,0}, nasm_bytecodes+18804, IF_386|IF_SM},
+    /* 1193 */ {I_XOR, 2, {REG_GPR|BITS32,REG_GPR|BITS32,0,0,0}, nasm_bytecodes+18804, IF_386},
+    /* 1194 */ {I_XOR, 2, {REG_GPR|BITS64,MEMORY,0,0,0}, nasm_bytecodes+18809, IF_X64|IF_SM},
+    /* 1195 */ {I_XOR, 2, {REG_GPR|BITS64,REG_GPR|BITS64,0,0,0}, nasm_bytecodes+18809, IF_X64},
+    /* 1196 */ {I_XOR, 2, {RM_GPR|BITS16,IMMEDIATE|BITS8,0,0,0}, nasm_bytecodes+14724, IF_8086},
+    /* 1197 */ {I_XOR, 2, {RM_GPR|BITS32,IMMEDIATE|BITS8,0,0,0}, nasm_bytecodes+14730, IF_386},
+    /* 1198 */ {I_XOR, 2, {RM_GPR|BITS64,IMMEDIATE|BITS8,0,0,0}, nasm_bytecodes+14736, IF_X64},
+    /* 1199 */ {I_XOR, 2, {REG_AL,IMMEDIATE,0,0,0}, nasm_bytecodes+19954, IF_8086|IF_SM},
+    /* 1200 */ {I_XOR, 2, {REG_AX,SBYTE16,0,0,0}, nasm_bytecodes+14724, IF_8086|IF_SM},
+    /* 1201 */ {I_XOR, 2, {REG_AX,IMMEDIATE,0,0,0}, nasm_bytecodes+18814, IF_8086|IF_SM},
+    /* 1202 */ {I_XOR, 2, {REG_EAX,SBYTE32,0,0,0}, nasm_bytecodes+14730, IF_386|IF_SM},
+    /* 1203 */ {I_XOR, 2, {REG_EAX,IMMEDIATE,0,0,0}, nasm_bytecodes+18819, IF_386|IF_SM},
+    /* 1204 */ {I_XOR, 2, {REG_RAX,SBYTE64,0,0,0}, nasm_bytecodes+14736, IF_X64|IF_SM},
+    /* 1205 */ {I_XOR, 2, {REG_RAX,IMMEDIATE,0,0,0}, nasm_bytecodes+18824, IF_X64|IF_SM},
+    /* 1206 */ {I_XOR, 2, {RM_GPR|BITS8,IMMEDIATE,0,0,0}, nasm_bytecodes+18829, IF_8086|IF_SM},
+    /* 1207 */ {I_XOR, 2, {RM_GPR|BITS16,IMMEDIATE,0,0,0}, nasm_bytecodes+14742, IF_8086|IF_SM},
+    /* 1208 */ {I_XOR, 2, {RM_GPR|BITS32,IMMEDIATE,0,0,0}, nasm_bytecodes+14748, IF_386|IF_SM},
+    /* 1209 */ {I_XOR, 2, {RM_GPR|BITS64,IMMEDIATE,0,0,0}, nasm_bytecodes+14754, IF_X64|IF_SM},
+    /* 1210 */ {I_XOR, 2, {MEMORY,IMMEDIATE|BITS8,0,0,0}, nasm_bytecodes+18829, IF_8086|IF_SM},
+    /* 1211 */ {I_XOR, 2, {MEMORY,IMMEDIATE|BITS16,0,0,0}, nasm_bytecodes+14742, IF_8086|IF_SM},
+    /* 1212 */ {I_XOR, 2, {MEMORY,IMMEDIATE|BITS32,0,0,0}, nasm_bytecodes+14748, IF_386|IF_SM},
+    /* 1213 */ {I_CMOVcc, 2, {REG_GPR|BITS16,MEMORY,0,0,0}, nasm_bytecodes+7817, IF_P6|IF_SM},
+    /* 1214 */ {I_CMOVcc, 2, {REG_GPR|BITS16,REG_GPR|BITS16,0,0,0}, nasm_bytecodes+7817, IF_P6},
+    /* 1215 */ {I_CMOVcc, 2, {REG_GPR|BITS32,MEMORY,0,0,0}, nasm_bytecodes+7824, IF_P6|IF_SM},
+    /* 1216 */ {I_CMOVcc, 2, {REG_GPR|BITS32,REG_GPR|BITS32,0,0,0}, nasm_bytecodes+7824, IF_P6},
+    /* 1217 */ {I_CMOVcc, 2, {REG_GPR|BITS64,MEMORY,0,0,0}, nasm_bytecodes+7831, IF_X64|IF_SM},
+    /* 1218 */ {I_CMOVcc, 2, {REG_GPR|BITS64,REG_GPR|BITS64,0,0,0}, nasm_bytecodes+7831, IF_X64},
+    /* 1219 */ {I_Jcc, 1, {IMMEDIATE|NEAR,0,0,0,0}, nasm_bytecodes+7838, IF_386},
+    /* 1220 */ {I_Jcc, 1, {IMMEDIATE|BITS16|NEAR,0,0,0,0}, nasm_bytecodes+7845, IF_386},
+    /* 1221 */ {I_Jcc, 1, {IMMEDIATE|BITS32|NEAR,0,0,0,0}, nasm_bytecodes+7852, IF_386},
+    /* 1222 */ {I_Jcc, 1, {IMMEDIATE,0,0,0,0}, nasm_bytecodes+18835, IF_8086},
+    /* 1223 */ {I_SETcc, 1, {MEMORY,0,0,0,0}, nasm_bytecodes+14760, IF_386|IF_SB},
+    /* 1224 */ {I_SETcc, 1, {REG_GPR|BITS8,0,0,0,0}, nasm_bytecodes+14760, IF_386},
+    /* 1225 */ {I_ADDPS, 2, {XMMREG,RM_XMM,0,0,0}, nasm_bytecodes+14766, IF_KATMAI|IF_SSE},
+    /* 1226 */ {I_ADDSS, 2, {XMMREG,RM_XMM,0,0,0}, nasm_bytecodes+14772, IF_KATMAI|IF_SSE|IF_SD},
+    /* 1227 */ {I_ANDNPS, 2, {XMMREG,RM_XMM,0,0,0}, nasm_bytecodes+14778, IF_KATMAI|IF_SSE},
+    /* 1228 */ {I_ANDPS, 2, {XMMREG,RM_XMM,0,0,0}, nasm_bytecodes+14784, IF_KATMAI|IF_SSE},
+    /* 1229 */ {I_CMPEQPS, 2, {XMMREG,RM_XMM,0,0,0}, nasm_bytecodes+5588, IF_KATMAI|IF_SSE},
+    /* 1230 */ {I_CMPEQSS, 2, {XMMREG,RM_XMM,0,0,0}, nasm_bytecodes+5596, IF_KATMAI|IF_SSE},
+    /* 1231 */ {I_CMPLEPS, 2, {XMMREG,RM_XMM,0,0,0}, nasm_bytecodes+5604, IF_KATMAI|IF_SSE},
+    /* 1232 */ {I_CMPLESS, 2, {XMMREG,RM_XMM,0,0,0}, nasm_bytecodes+5612, IF_KATMAI|IF_SSE},
+    /* 1233 */ {I_CMPLTPS, 2, {XMMREG,RM_XMM,0,0,0}, nasm_bytecodes+5620, IF_KATMAI|IF_SSE},
+    /* 1234 */ {I_CMPLTSS, 2, {XMMREG,RM_XMM,0,0,0}, nasm_bytecodes+5628, IF_KATMAI|IF_SSE},
+    /* 1235 */ {I_CMPNEQPS, 2, {XMMREG,RM_XMM,0,0,0}, nasm_bytecodes+5636, IF_KATMAI|IF_SSE},
+    /* 1236 */ {I_CMPNEQSS, 2, {XMMREG,RM_XMM,0,0,0}, nasm_bytecodes+5644, IF_KATMAI|IF_SSE},
+    /* 1237 */ {I_CMPNLEPS, 2, {XMMREG,RM_XMM,0,0,0}, nasm_bytecodes+5652, IF_KATMAI|IF_SSE},
+    /* 1238 */ {I_CMPNLESS, 2, {XMMREG,RM_XMM,0,0,0}, nasm_bytecodes+5660, IF_KATMAI|IF_SSE},
+    /* 1239 */ {I_CMPNLTPS, 2, {XMMREG,RM_XMM,0,0,0}, nasm_bytecodes+5668, IF_KATMAI|IF_SSE},
+    /* 1240 */ {I_CMPNLTSS, 2, {XMMREG,RM_XMM,0,0,0}, nasm_bytecodes+5676, IF_KATMAI|IF_SSE},
+    /* 1241 */ {I_CMPORDPS, 2, {XMMREG,RM_XMM,0,0,0}, nasm_bytecodes+5684, IF_KATMAI|IF_SSE},
+    /* 1242 */ {I_CMPORDSS, 2, {XMMREG,RM_XMM,0,0,0}, nasm_bytecodes+5692, IF_KATMAI|IF_SSE},
+    /* 1243 */ {I_CMPUNORDPS, 2, {XMMREG,RM_XMM,0,0,0}, nasm_bytecodes+5700, IF_KATMAI|IF_SSE},
+    /* 1244 */ {I_CMPUNORDSS, 2, {XMMREG,RM_XMM,0,0,0}, nasm_bytecodes+5708, IF_KATMAI|IF_SSE},
+    /* 1245 */ {I_CMPPS, 3, {XMMREG,MEMORY,IMMEDIATE,0,0}, nasm_bytecodes+7866, IF_KATMAI|IF_SSE|IF_SB|IF_AR2},
+    /* 1246 */ {I_CMPPS, 3, {XMMREG,XMMREG,IMMEDIATE,0,0}, nasm_bytecodes+7866, IF_KATMAI|IF_SSE|IF_SB|IF_AR2},
+    /* 1247 */ {I_CMPSS, 3, {XMMREG,MEMORY,IMMEDIATE,0,0}, nasm_bytecodes+7873, IF_KATMAI|IF_SSE|IF_SB|IF_AR2},
+    /* 1248 */ {I_CMPSS, 3, {XMMREG,XMMREG,IMMEDIATE,0,0}, nasm_bytecodes+7873, IF_KATMAI|IF_SSE|IF_SB|IF_AR2},
+    /* 1249 */ {I_COMISS, 2, {XMMREG,RM_XMM,0,0,0}, nasm_bytecodes+14790, IF_KATMAI|IF_SSE},
+    /* 1250 */ {I_CVTPI2PS, 2, {XMMREG,RM_MMX,0,0,0}, nasm_bytecodes+14796, IF_KATMAI|IF_SSE|IF_MMX|IF_SQ},
+    /* 1251 */ {I_CVTPS2PI, 2, {MMXREG,RM_XMM,0,0,0}, nasm_bytecodes+14802, IF_KATMAI|IF_SSE|IF_MMX|IF_SQ},
+    /* 1252 */ {I_CVTSI2SS, 2, {XMMREG,RM_GPR|BITS32,0,0,0}, nasm_bytecodes+7881, IF_KATMAI|IF_SSE|IF_SD|IF_AR1},
+    /* 1253 */ {I_CVTSI2SS, 2, {XMMREG,RM_GPR|BITS64,0,0,0}, nasm_bytecodes+7880, IF_X64|IF_SSE|IF_SQ|IF_AR1},
+    /* 1254 */ {I_CVTSS2SI, 2, {REG_GPR|BITS32,XMMREG,0,0,0}, nasm_bytecodes+7888, IF_KATMAI|IF_SSE|IF_SD|IF_AR1},
+    /* 1255 */ {I_CVTSS2SI, 2, {REG_GPR|BITS32,MEMORY,0,0,0}, nasm_bytecodes+7888, IF_KATMAI|IF_SSE|IF_SD|IF_AR1},
+    /* 1256 */ {I_CVTSS2SI, 2, {REG_GPR|BITS64,XMMREG,0,0,0}, nasm_bytecodes+7887, IF_X64|IF_SSE|IF_SD|IF_AR1},
+    /* 1257 */ {I_CVTSS2SI, 2, {REG_GPR|BITS64,MEMORY,0,0,0}, nasm_bytecodes+7887, IF_X64|IF_SSE|IF_SD|IF_AR1},
+    /* 1258 */ {I_CVTTPS2PI, 2, {MMXREG,RM_XMM,0,0,0}, nasm_bytecodes+14808, IF_KATMAI|IF_SSE|IF_MMX|IF_SQ},
+    /* 1259 */ {I_CVTTSS2SI, 2, {REG_GPR|BITS32,RM_XMM,0,0,0}, nasm_bytecodes+7895, IF_KATMAI|IF_SSE|IF_SD|IF_AR1},
+    /* 1260 */ {I_CVTTSS2SI, 2, {REG_GPR|BITS64,RM_XMM,0,0,0}, nasm_bytecodes+7894, IF_X64|IF_SSE|IF_SD|IF_AR1},
+    /* 1261 */ {I_DIVPS, 2, {XMMREG,RM_XMM,0,0,0}, nasm_bytecodes+14814, IF_KATMAI|IF_SSE},
+    /* 1262 */ {I_DIVSS, 2, {XMMREG,RM_XMM,0,0,0}, nasm_bytecodes+14820, IF_KATMAI|IF_SSE},
+    /* 1263 */ {I_LDMXCSR, 1, {MEMORY,0,0,0,0}, nasm_bytecodes+18839, IF_KATMAI|IF_SSE|IF_SD},
+    /* 1264 */ {I_MAXPS, 2, {XMMREG,RM_XMM,0,0,0}, nasm_bytecodes+14826, IF_KATMAI|IF_SSE},
+    /* 1265 */ {I_MAXSS, 2, {XMMREG,RM_XMM,0,0,0}, nasm_bytecodes+14832, IF_KATMAI|IF_SSE},
+    /* 1266 */ {I_MINPS, 2, {XMMREG,RM_XMM,0,0,0}, nasm_bytecodes+14838, IF_KATMAI|IF_SSE},
+    /* 1267 */ {I_MINSS, 2, {XMMREG,RM_XMM,0,0,0}, nasm_bytecodes+14844, IF_KATMAI|IF_SSE},
+    /* 1268 */ {I_MOVAPS, 2, {XMMREG,MEMORY,0,0,0}, nasm_bytecodes+14850, IF_KATMAI|IF_SSE},
+    /* 1269 */ {I_MOVAPS, 2, {MEMORY,XMMREG,0,0,0}, nasm_bytecodes+14856, IF_KATMAI|IF_SSE},
+    /* 1270 */ {I_MOVAPS, 2, {XMMREG,XMMREG,0,0,0}, nasm_bytecodes+14850, IF_KATMAI|IF_SSE},
+    /* 1271 */ {I_MOVAPS, 2, {XMMREG,XMMREG,0,0,0}, nasm_bytecodes+14856, IF_KATMAI|IF_SSE},
+    /* 1272 */ {I_MOVHPS, 2, {XMMREG,MEMORY,0,0,0}, nasm_bytecodes+14862, IF_KATMAI|IF_SSE},
+    /* 1273 */ {I_MOVHPS, 2, {MEMORY,XMMREG,0,0,0}, nasm_bytecodes+14868, IF_KATMAI|IF_SSE},
+    /* 1274 */ {I_MOVLHPS, 2, {XMMREG,XMMREG,0,0,0}, nasm_bytecodes+14862, IF_KATMAI|IF_SSE},
+    /* 1275 */ {I_MOVLPS, 2, {XMMREG,MEMORY,0,0,0}, nasm_bytecodes+14682, IF_KATMAI|IF_SSE},
+    /* 1276 */ {I_MOVLPS, 2, {MEMORY,XMMREG,0,0,0}, nasm_bytecodes+14874, IF_KATMAI|IF_SSE},
+    /* 1277 */ {I_MOVHLPS, 2, {XMMREG,XMMREG,0,0,0}, nasm_bytecodes+14682, IF_KATMAI|IF_SSE},
+    /* 1278 */ {I_MOVMSKPS, 2, {REG_GPR|BITS32,XMMREG,0,0,0}, nasm_bytecodes+14880, IF_KATMAI|IF_SSE},
+    /* 1279 */ {I_MOVMSKPS, 2, {REG_GPR|BITS64,XMMREG,0,0,0}, nasm_bytecodes+7901, IF_X64|IF_SSE},
+    /* 1280 */ {I_MOVNTPS, 2, {MEMORY,XMMREG,0,0,0}, nasm_bytecodes+14886, IF_KATMAI|IF_SSE},
+    /* 1281 */ {I_MOVSS, 2, {XMMREG,MEMORY,0,0,0}, nasm_bytecodes+14892, IF_KATMAI|IF_SSE},
+    /* 1282 */ {I_MOVSS, 2, {MEMORY,XMMREG,0,0,0}, nasm_bytecodes+14898, IF_KATMAI|IF_SSE},
+    /* 1283 */ {I_MOVSS, 2, {XMMREG,XMMREG,0,0,0}, nasm_bytecodes+14892, IF_KATMAI|IF_SSE},
+    /* 1284 */ {I_MOVSS, 2, {XMMREG,XMMREG,0,0,0}, nasm_bytecodes+14898, IF_KATMAI|IF_SSE},
+    /* 1285 */ {I_MOVUPS, 2, {XMMREG,MEMORY,0,0,0}, nasm_bytecodes+14904, IF_KATMAI|IF_SSE},
+    /* 1286 */ {I_MOVUPS, 2, {MEMORY,XMMREG,0,0,0}, nasm_bytecodes+14910, IF_KATMAI|IF_SSE},
+    /* 1287 */ {I_MOVUPS, 2, {XMMREG,XMMREG,0,0,0}, nasm_bytecodes+14904, IF_KATMAI|IF_SSE},
+    /* 1288 */ {I_MOVUPS, 2, {XMMREG,XMMREG,0,0,0}, nasm_bytecodes+14910, IF_KATMAI|IF_SSE},
+    /* 1289 */ {I_MULPS, 2, {XMMREG,RM_XMM,0,0,0}, nasm_bytecodes+14916, IF_KATMAI|IF_SSE},
+    /* 1290 */ {I_MULSS, 2, {XMMREG,RM_XMM,0,0,0}, nasm_bytecodes+14922, IF_KATMAI|IF_SSE},
+    /* 1291 */ {I_ORPS, 2, {XMMREG,RM_XMM,0,0,0}, nasm_bytecodes+14928, IF_KATMAI|IF_SSE},
+    /* 1292 */ {I_RCPPS, 2, {XMMREG,RM_XMM,0,0,0}, nasm_bytecodes+14934, IF_KATMAI|IF_SSE},
+    /* 1293 */ {I_RCPSS, 2, {XMMREG,RM_XMM,0,0,0}, nasm_bytecodes+14940, IF_KATMAI|IF_SSE},
+    /* 1294 */ {I_RSQRTPS, 2, {XMMREG,RM_XMM,0,0,0}, nasm_bytecodes+14946, IF_KATMAI|IF_SSE},
+    /* 1295 */ {I_RSQRTSS, 2, {XMMREG,RM_XMM,0,0,0}, nasm_bytecodes+14952, IF_KATMAI|IF_SSE},
+    /* 1296 */ {I_SHUFPS, 3, {XMMREG,MEMORY,IMMEDIATE,0,0}, nasm_bytecodes+7908, IF_KATMAI|IF_SSE|IF_SB|IF_AR2},
+    /* 1297 */ {I_SHUFPS, 3, {XMMREG,XMMREG,IMMEDIATE,0,0}, nasm_bytecodes+7908, IF_KATMAI|IF_SSE|IF_SB|IF_AR2},
+    /* 1298 */ {I_SQRTPS, 2, {XMMREG,RM_XMM,0,0,0}, nasm_bytecodes+14958, IF_KATMAI|IF_SSE},
+    /* 1299 */ {I_SQRTSS, 2, {XMMREG,RM_XMM,0,0,0}, nasm_bytecodes+14964, IF_KATMAI|IF_SSE},
+    /* 1300 */ {I_STMXCSR, 1, {MEMORY,0,0,0,0}, nasm_bytecodes+18844, IF_KATMAI|IF_SSE|IF_SD},
+    /* 1301 */ {I_SUBPS, 2, {XMMREG,RM_XMM,0,0,0}, nasm_bytecodes+14970, IF_KATMAI|IF_SSE},
+    /* 1302 */ {I_SUBSS, 2, {XMMREG,RM_XMM,0,0,0}, nasm_bytecodes+14976, IF_KATMAI|IF_SSE},
+    /* 1303 */ {I_UCOMISS, 2, {XMMREG,RM_XMM,0,0,0}, nasm_bytecodes+14982, IF_KATMAI|IF_SSE},
+    /* 1304 */ {I_UNPCKHPS, 2, {XMMREG,RM_XMM,0,0,0}, nasm_bytecodes+14988, IF_KATMAI|IF_SSE},
+    /* 1305 */ {I_UNPCKLPS, 2, {XMMREG,RM_XMM,0,0,0}, nasm_bytecodes+14994, IF_KATMAI|IF_SSE},
+    /* 1306 */ {I_XORPS, 2, {XMMREG,RM_XMM,0,0,0}, nasm_bytecodes+15000, IF_KATMAI|IF_SSE},
+    /* 1307 */ {I_FXRSTOR, 1, {MEMORY,0,0,0,0}, nasm_bytecodes+18849, IF_P6|IF_SSE|IF_FPU},
+    /* 1308 */ {I_FXSAVE, 1, {MEMORY,0,0,0,0}, nasm_bytecodes+18854, IF_P6|IF_SSE|IF_FPU},
+    /* 1309 */ {I_XGETBV, 0, {0,0,0,0,0}, nasm_bytecodes+15006, IF_NEHALEM},
+    /* 1310 */ {I_XSETBV, 0, {0,0,0,0,0}, nasm_bytecodes+15012, IF_NEHALEM|IF_PRIV},
+    /* 1311 */ {I_XSAVE, 1, {MEMORY,0,0,0,0}, nasm_bytecodes+15018, IF_NEHALEM},
+    /* 1312 */ {I_XRSTOR, 1, {MEMORY,0,0,0,0}, nasm_bytecodes+15024, IF_NEHALEM},
+    /* 1313 */ {I_PREFETCHNTA, 1, {MEMORY,0,0,0,0}, nasm_bytecodes+15913, IF_KATMAI},
+    /* 1314 */ {I_PREFETCHT0, 1, {MEMORY,0,0,0,0}, nasm_bytecodes+15931, IF_KATMAI},
+    /* 1315 */ {I_PREFETCHT1, 1, {MEMORY,0,0,0,0}, nasm_bytecodes+15949, IF_KATMAI},
+    /* 1316 */ {I_PREFETCHT2, 1, {MEMORY,0,0,0,0}, nasm_bytecodes+15967, IF_KATMAI},
+    /* 1317 */ {I_SFENCE, 0, {0,0,0,0,0}, nasm_bytecodes+18564, IF_KATMAI},
+    /* 1318 */ {I_MASKMOVQ, 2, {MMXREG,MMXREG,0,0,0}, nasm_bytecodes+15030, IF_KATMAI|IF_MMX},
+    /* 1319 */ {I_MOVNTQ, 2, {MEMORY,MMXREG,0,0,0}, nasm_bytecodes+15036, IF_KATMAI|IF_MMX|IF_SQ},
+    /* 1320 */ {I_PAVGB, 2, {MMXREG,RM_MMX,0,0,0}, nasm_bytecodes+7915, IF_KATMAI|IF_MMX|IF_SQ},
+    /* 1321 */ {I_PAVGW, 2, {MMXREG,RM_MMX,0,0,0}, nasm_bytecodes+7922, IF_KATMAI|IF_MMX|IF_SQ},
+    /* 1322 */ {I_PEXTRW, 3, {REG_GPR|BITS32,MMXREG,IMMEDIATE,0,0}, nasm_bytecodes+7929, IF_KATMAI|IF_MMX|IF_SB|IF_AR2},
+    /* 1323 */ {I_PINSRW, 3, {MMXREG,MEMORY,IMMEDIATE,0,0}, nasm_bytecodes+7936, IF_KATMAI|IF_MMX|IF_SB|IF_AR2},
+    /* 1324 */ {I_PINSRW, 3, {MMXREG,RM_GPR|BITS16,IMMEDIATE,0,0}, nasm_bytecodes+7936, IF_KATMAI|IF_MMX|IF_SB|IF_AR2},
+    /* 1325 */ {I_PINSRW, 3, {MMXREG,REG_GPR|BITS32,IMMEDIATE,0,0}, nasm_bytecodes+7936, IF_KATMAI|IF_MMX|IF_SB|IF_AR2},
+    /* 1326 */ {I_PMAXSW, 2, {MMXREG,RM_MMX,0,0,0}, nasm_bytecodes+7943, IF_KATMAI|IF_MMX|IF_SQ},
+    /* 1327 */ {I_PMAXUB, 2, {MMXREG,RM_MMX,0,0,0}, nasm_bytecodes+7950, IF_KATMAI|IF_MMX|IF_SQ},
+    /* 1328 */ {I_PMINSW, 2, {MMXREG,RM_MMX,0,0,0}, nasm_bytecodes+7957, IF_KATMAI|IF_MMX|IF_SQ},
+    /* 1329 */ {I_PMINUB, 2, {MMXREG,RM_MMX,0,0,0}, nasm_bytecodes+7964, IF_KATMAI|IF_MMX|IF_SQ},
+    /* 1330 */ {I_PMOVMSKB, 2, {REG_GPR|BITS32,MMXREG,0,0,0}, nasm_bytecodes+15042, IF_KATMAI|IF_MMX},
+    /* 1331 */ {I_PMULHUW, 2, {MMXREG,RM_MMX,0,0,0}, nasm_bytecodes+7971, IF_KATMAI|IF_MMX|IF_SQ},
+    /* 1332 */ {I_PSADBW, 2, {MMXREG,RM_MMX,0,0,0}, nasm_bytecodes+7978, IF_KATMAI|IF_MMX|IF_SQ},
+    /* 1333 */ {I_PSHUFW, 3, {MMXREG,RM_MMX,IMMEDIATE,0,0}, nasm_bytecodes+5716, IF_KATMAI|IF_MMX|IF_SM2|IF_SB|IF_AR2},
+    /* 1334 */ {I_PF2IW, 2, {MMXREG,RM_MMX,0,0,0}, nasm_bytecodes+5724, IF_PENT|IF_3DNOW|IF_SQ},
+    /* 1335 */ {I_PFNACC, 2, {MMXREG,RM_MMX,0,0,0}, nasm_bytecodes+5732, IF_PENT|IF_3DNOW|IF_SQ},
+    /* 1336 */ {I_PFPNACC, 2, {MMXREG,RM_MMX,0,0,0}, nasm_bytecodes+5740, IF_PENT|IF_3DNOW|IF_SQ},
+    /* 1337 */ {I_PI2FW, 2, {MMXREG,RM_MMX,0,0,0}, nasm_bytecodes+5748, IF_PENT|IF_3DNOW|IF_SQ},
+    /* 1338 */ {I_PSWAPD, 2, {MMXREG,RM_MMX,0,0,0}, nasm_bytecodes+5756, IF_PENT|IF_3DNOW|IF_SQ},
+    /* 1339 */ {I_MASKMOVDQU, 2, {XMMREG,XMMREG,0,0,0}, nasm_bytecodes+15048, IF_WILLAMETTE|IF_SSE2},
+    /* 1340 */ {I_CLFLUSH, 1, {MEMORY,0,0,0,0}, nasm_bytecodes+18859, IF_WILLAMETTE|IF_SSE2},
+    /* 1341 */ {I_MOVNTDQ, 2, {MEMORY,XMMREG,0,0,0}, nasm_bytecodes+15054, IF_WILLAMETTE|IF_SSE2|IF_SO},
+    /* 1342 */ {I_MOVNTI, 2, {MEMORY,REG_GPR|BITS32,0,0,0}, nasm_bytecodes+7986, IF_WILLAMETTE|IF_SD},
+    /* 1343 */ {I_MOVNTI, 2, {MEMORY,REG_GPR|BITS64,0,0,0}, nasm_bytecodes+7985, IF_X64|IF_SQ},
+    /* 1344 */ {I_MOVNTPD, 2, {MEMORY,XMMREG,0,0,0}, nasm_bytecodes+15060, IF_WILLAMETTE|IF_SSE2|IF_SO},
+    /* 1345 */ {I_LFENCE, 0, {0,0,0,0,0}, nasm_bytecodes+17899, IF_WILLAMETTE|IF_SSE2},
+    /* 1346 */ {I_MFENCE, 0, {0,0,0,0,0}, nasm_bytecodes+17989, IF_WILLAMETTE|IF_SSE2},
+    /* 1347 */ {I_MOVD, 2, {MEMORY,XMMREG,0,0,0}, nasm_bytecodes+7992, IF_WILLAMETTE|IF_SSE2|IF_SD},
+    /* 1348 */ {I_MOVD, 2, {XMMREG,MEMORY,0,0,0}, nasm_bytecodes+7999, IF_WILLAMETTE|IF_SSE2|IF_SD},
+    /* 1349 */ {I_MOVD, 2, {XMMREG,RM_GPR|BITS32,0,0,0}, nasm_bytecodes+7999, IF_WILLAMETTE|IF_SSE2},
+    /* 1350 */ {I_MOVD, 2, {RM_GPR|BITS32,XMMREG,0,0,0}, nasm_bytecodes+7992, IF_WILLAMETTE|IF_SSE2},
+    /* 1351 */ {I_MOVDQA, 2, {XMMREG,XMMREG,0,0,0}, nasm_bytecodes+15066, IF_WILLAMETTE|IF_SSE2},
+    /* 1352 */ {I_MOVDQA, 2, {MEMORY,XMMREG,0,0,0}, nasm_bytecodes+15072, IF_WILLAMETTE|IF_SSE2|IF_SO},
+    /* 1353 */ {I_MOVDQA, 2, {XMMREG,MEMORY,0,0,0}, nasm_bytecodes+15066, IF_WILLAMETTE|IF_SSE2|IF_SO},
+    /* 1354 */ {I_MOVDQA, 2, {XMMREG,XMMREG,0,0,0}, nasm_bytecodes+15072, IF_WILLAMETTE|IF_SSE2},
+    /* 1355 */ {I_MOVDQU, 2, {XMMREG,XMMREG,0,0,0}, nasm_bytecodes+15078, IF_WILLAMETTE|IF_SSE2},
+    /* 1356 */ {I_MOVDQU, 2, {MEMORY,XMMREG,0,0,0}, nasm_bytecodes+15084, IF_WILLAMETTE|IF_SSE2|IF_SO},
+    /* 1357 */ {I_MOVDQU, 2, {XMMREG,MEMORY,0,0,0}, nasm_bytecodes+15078, IF_WILLAMETTE|IF_SSE2|IF_SO},
+    /* 1358 */ {I_MOVDQU, 2, {XMMREG,XMMREG,0,0,0}, nasm_bytecodes+15084, IF_WILLAMETTE|IF_SSE2},
+    /* 1359 */ {I_MOVDQ2Q, 2, {MMXREG,XMMREG,0,0,0}, nasm_bytecodes+15090, IF_WILLAMETTE|IF_SSE2},
+    /* 1360 */ {I_MOVQ, 2, {XMMREG,XMMREG,0,0,0}, nasm_bytecodes+15096, IF_WILLAMETTE|IF_SSE2},
+    /* 1361 */ {I_MOVQ, 2, {XMMREG,XMMREG,0,0,0}, nasm_bytecodes+15102, IF_WILLAMETTE|IF_SSE2},
+    /* 1362 */ {I_MOVQ, 2, {MEMORY,XMMREG,0,0,0}, nasm_bytecodes+15102, IF_WILLAMETTE|IF_SSE2|IF_SQ},
+    /* 1363 */ {I_MOVQ, 2, {XMMREG,MEMORY,0,0,0}, nasm_bytecodes+15096, IF_WILLAMETTE|IF_SSE2|IF_SQ},
+    /* 1364 */ {I_MOVQ, 2, {XMMREG,RM_GPR|BITS64,0,0,0}, nasm_bytecodes+8006, IF_X64|IF_SSE2},
+    /* 1365 */ {I_MOVQ, 2, {RM_GPR|BITS64,XMMREG,0,0,0}, nasm_bytecodes+8013, IF_X64|IF_SSE2},
+    /* 1366 */ {I_MOVQ2DQ, 2, {XMMREG,MMXREG,0,0,0}, nasm_bytecodes+15108, IF_WILLAMETTE|IF_SSE2},
+    /* 1367 */ {I_PACKSSWB, 2, {XMMREG,RM_XMM,0,0,0}, nasm_bytecodes+15114, IF_WILLAMETTE|IF_SSE2|IF_SO},
+    /* 1368 */ {I_PACKSSDW, 2, {XMMREG,RM_XMM,0,0,0}, nasm_bytecodes+15120, IF_WILLAMETTE|IF_SSE2|IF_SO},
+    /* 1369 */ {I_PACKUSWB, 2, {XMMREG,RM_XMM,0,0,0}, nasm_bytecodes+15126, IF_WILLAMETTE|IF_SSE2|IF_SO},
+    /* 1370 */ {I_PADDB, 2, {XMMREG,RM_XMM,0,0,0}, nasm_bytecodes+15132, IF_WILLAMETTE|IF_SSE2|IF_SO},
+    /* 1371 */ {I_PADDW, 2, {XMMREG,RM_XMM,0,0,0}, nasm_bytecodes+15138, IF_WILLAMETTE|IF_SSE2|IF_SO},
+    /* 1372 */ {I_PADDD, 2, {XMMREG,RM_XMM,0,0,0}, nasm_bytecodes+15144, IF_WILLAMETTE|IF_SSE2|IF_SO},
+    /* 1373 */ {I_PADDQ, 2, {MMXREG,RM_MMX,0,0,0}, nasm_bytecodes+15150, IF_WILLAMETTE|IF_MMX|IF_SQ},
+    /* 1374 */ {I_PADDQ, 2, {XMMREG,RM_XMM,0,0,0}, nasm_bytecodes+15156, IF_WILLAMETTE|IF_SSE2|IF_SO},
+    /* 1375 */ {I_PADDSB, 2, {XMMREG,RM_XMM,0,0,0}, nasm_bytecodes+15162, IF_WILLAMETTE|IF_SSE2|IF_SO},
+    /* 1376 */ {I_PADDSW, 2, {XMMREG,RM_XMM,0,0,0}, nasm_bytecodes+15168, IF_WILLAMETTE|IF_SSE2|IF_SO},
+    /* 1377 */ {I_PADDUSB, 2, {XMMREG,RM_XMM,0,0,0}, nasm_bytecodes+15174, IF_WILLAMETTE|IF_SSE2|IF_SO},
+    /* 1378 */ {I_PADDUSW, 2, {XMMREG,RM_XMM,0,0,0}, nasm_bytecodes+15180, IF_WILLAMETTE|IF_SSE2|IF_SO},
+    /* 1379 */ {I_PAND, 2, {XMMREG,RM_XMM,0,0,0}, nasm_bytecodes+15186, IF_WILLAMETTE|IF_SSE2|IF_SO},
+    /* 1380 */ {I_PANDN, 2, {XMMREG,RM_XMM,0,0,0}, nasm_bytecodes+15192, IF_WILLAMETTE|IF_SSE2|IF_SO},
+    /* 1381 */ {I_PAVGB, 2, {XMMREG,RM_XMM,0,0,0}, nasm_bytecodes+15198, IF_WILLAMETTE|IF_SSE2|IF_SO},
+    /* 1382 */ {I_PAVGW, 2, {XMMREG,RM_XMM,0,0,0}, nasm_bytecodes+15204, IF_WILLAMETTE|IF_SSE2|IF_SO},
+    /* 1383 */ {I_PCMPEQB, 2, {XMMREG,RM_XMM,0,0,0}, nasm_bytecodes+15210, IF_WILLAMETTE|IF_SSE2|IF_SO},
+    /* 1384 */ {I_PCMPEQW, 2, {XMMREG,RM_XMM,0,0,0}, nasm_bytecodes+15216, IF_WILLAMETTE|IF_SSE2|IF_SO},
+    /* 1385 */ {I_PCMPEQD, 2, {XMMREG,RM_XMM,0,0,0}, nasm_bytecodes+15222, IF_WILLAMETTE|IF_SSE2|IF_SO},
+    /* 1386 */ {I_PCMPGTB, 2, {XMMREG,RM_XMM,0,0,0}, nasm_bytecodes+15228, IF_WILLAMETTE|IF_SSE2|IF_SO},
+    /* 1387 */ {I_PCMPGTW, 2, {XMMREG,RM_XMM,0,0,0}, nasm_bytecodes+15234, IF_WILLAMETTE|IF_SSE2|IF_SO},
+    /* 1388 */ {I_PCMPGTD, 2, {XMMREG,RM_XMM,0,0,0}, nasm_bytecodes+15240, IF_WILLAMETTE|IF_SSE2|IF_SO},
+    /* 1389 */ {I_PEXTRW, 3, {REG_GPR|BITS32,XMMREG,IMMEDIATE,0,0}, nasm_bytecodes+8020, IF_WILLAMETTE|IF_SSE2|IF_SB|IF_AR2},
+    /* 1390 */ {I_PINSRW, 3, {XMMREG,REG_GPR|BITS16,IMMEDIATE,0,0}, nasm_bytecodes+8027, IF_WILLAMETTE|IF_SSE2|IF_SB|IF_AR2},
+    /* 1391 */ {I_PINSRW, 3, {XMMREG,MEMORY,IMMEDIATE,0,0}, nasm_bytecodes+8027, IF_WILLAMETTE|IF_SSE2|IF_SB|IF_AR2},
+    /* 1392 */ {I_PINSRW, 3, {XMMREG,MEMORY|BITS16,IMMEDIATE,0,0}, nasm_bytecodes+8027, IF_WILLAMETTE|IF_SSE2|IF_SB|IF_AR2},
+    /* 1393 */ {I_PMADDWD, 2, {XMMREG,RM_XMM,0,0,0}, nasm_bytecodes+15246, IF_WILLAMETTE|IF_SSE2|IF_SO},
+    /* 1394 */ {I_PMAXSW, 2, {XMMREG,RM_XMM,0,0,0}, nasm_bytecodes+15252, IF_WILLAMETTE|IF_SSE2|IF_SO},
+    /* 1395 */ {I_PMAXUB, 2, {XMMREG,RM_XMM,0,0,0}, nasm_bytecodes+15258, IF_WILLAMETTE|IF_SSE2|IF_SO},
+    /* 1396 */ {I_PMINSW, 2, {XMMREG,RM_XMM,0,0,0}, nasm_bytecodes+15264, IF_WILLAMETTE|IF_SSE2|IF_SO},
+    /* 1397 */ {I_PMINUB, 2, {XMMREG,RM_XMM,0,0,0}, nasm_bytecodes+15270, IF_WILLAMETTE|IF_SSE2|IF_SO},
+    /* 1398 */ {I_PMOVMSKB, 2, {REG_GPR|BITS32,XMMREG,0,0,0}, nasm_bytecodes+15276, IF_WILLAMETTE|IF_SSE2},
+    /* 1399 */ {I_PMULHUW, 2, {XMMREG,RM_XMM,0,0,0}, nasm_bytecodes+15282, IF_WILLAMETTE|IF_SSE2|IF_SO},
+    /* 1400 */ {I_PMULHW, 2, {XMMREG,RM_XMM,0,0,0}, nasm_bytecodes+15288, IF_WILLAMETTE|IF_SSE2|IF_SO},
+    /* 1401 */ {I_PMULLW, 2, {XMMREG,RM_XMM,0,0,0}, nasm_bytecodes+15294, IF_WILLAMETTE|IF_SSE2|IF_SO},
+    /* 1402 */ {I_PMULUDQ, 2, {MMXREG,RM_MMX,0,0,0}, nasm_bytecodes+8034, IF_WILLAMETTE|IF_SSE2|IF_SO},
+    /* 1403 */ {I_PMULUDQ, 2, {XMMREG,RM_XMM,0,0,0}, nasm_bytecodes+15300, IF_WILLAMETTE|IF_SSE2|IF_SO},
+    /* 1404 */ {I_POR, 2, {XMMREG,RM_XMM,0,0,0}, nasm_bytecodes+15306, IF_WILLAMETTE|IF_SSE2|IF_SO},
+    /* 1405 */ {I_PSADBW, 2, {XMMREG,RM_XMM,0,0,0}, nasm_bytecodes+15312, IF_WILLAMETTE|IF_SSE2|IF_SO},
+    /* 1406 */ {I_PSHUFD, 3, {XMMREG,XMMREG,IMMEDIATE,0,0}, nasm_bytecodes+8041, IF_WILLAMETTE|IF_SSE2|IF_SB|IF_AR2},
+    /* 1407 */ {I_PSHUFD, 3, {XMMREG,MEMORY,IMMEDIATE,0,0}, nasm_bytecodes+8041, IF_WILLAMETTE|IF_SSE2|IF_SM2|IF_SB|IF_AR2},
+    /* 1408 */ {I_PSHUFHW, 3, {XMMREG,XMMREG,IMMEDIATE,0,0}, nasm_bytecodes+8048, IF_WILLAMETTE|IF_SSE2|IF_SB|IF_AR2},
+    /* 1409 */ {I_PSHUFHW, 3, {XMMREG,MEMORY,IMMEDIATE,0,0}, nasm_bytecodes+8048, IF_WILLAMETTE|IF_SSE2|IF_SM2|IF_SB|IF_AR2},
+    /* 1410 */ {I_PSHUFLW, 3, {XMMREG,XMMREG,IMMEDIATE,0,0}, nasm_bytecodes+8055, IF_WILLAMETTE|IF_SSE2|IF_SB|IF_AR2},
+    /* 1411 */ {I_PSHUFLW, 3, {XMMREG,MEMORY,IMMEDIATE,0,0}, nasm_bytecodes+8055, IF_WILLAMETTE|IF_SSE2|IF_SM2|IF_SB|IF_AR2},
+    /* 1412 */ {I_PSLLDQ, 2, {XMMREG,IMMEDIATE,0,0,0}, nasm_bytecodes+8062, IF_WILLAMETTE|IF_SSE2|IF_SB|IF_AR1},
+    /* 1413 */ {I_PSLLW, 2, {XMMREG,RM_XMM,0,0,0}, nasm_bytecodes+15318, IF_WILLAMETTE|IF_SSE2|IF_SO},
+    /* 1414 */ {I_PSLLW, 2, {XMMREG,IMMEDIATE,0,0,0}, nasm_bytecodes+8069, IF_WILLAMETTE|IF_SSE2|IF_SB|IF_AR1},
+    /* 1415 */ {I_PSLLD, 2, {XMMREG,RM_XMM,0,0,0}, nasm_bytecodes+15324, IF_WILLAMETTE|IF_SSE2|IF_SO},
+    /* 1416 */ {I_PSLLD, 2, {XMMREG,IMMEDIATE,0,0,0}, nasm_bytecodes+8076, IF_WILLAMETTE|IF_SSE2|IF_SB|IF_AR1},
+    /* 1417 */ {I_PSLLQ, 2, {XMMREG,RM_XMM,0,0,0}, nasm_bytecodes+15330, IF_WILLAMETTE|IF_SSE2|IF_SO},
+    /* 1418 */ {I_PSLLQ, 2, {XMMREG,IMMEDIATE,0,0,0}, nasm_bytecodes+8083, IF_WILLAMETTE|IF_SSE2|IF_SB|IF_AR1},
+    /* 1419 */ {I_PSRAW, 2, {XMMREG,RM_XMM,0,0,0}, nasm_bytecodes+15336, IF_WILLAMETTE|IF_SSE2|IF_SO},
+    /* 1420 */ {I_PSRAW, 2, {XMMREG,IMMEDIATE,0,0,0}, nasm_bytecodes+8090, IF_WILLAMETTE|IF_SSE2|IF_SB|IF_AR1},
+    /* 1421 */ {I_PSRAD, 2, {XMMREG,RM_XMM,0,0,0}, nasm_bytecodes+15342, IF_WILLAMETTE|IF_SSE2|IF_SO},
+    /* 1422 */ {I_PSRAD, 2, {XMMREG,IMMEDIATE,0,0,0}, nasm_bytecodes+8097, IF_WILLAMETTE|IF_SSE2|IF_SB|IF_AR1},
+    /* 1423 */ {I_PSRLDQ, 2, {XMMREG,IMMEDIATE,0,0,0}, nasm_bytecodes+8104, IF_WILLAMETTE|IF_SSE2|IF_SB|IF_AR1},
+    /* 1424 */ {I_PSRLW, 2, {XMMREG,RM_XMM,0,0,0}, nasm_bytecodes+15348, IF_WILLAMETTE|IF_SSE2|IF_SO},
+    /* 1425 */ {I_PSRLW, 2, {XMMREG,IMMEDIATE,0,0,0}, nasm_bytecodes+8111, IF_WILLAMETTE|IF_SSE2|IF_SB|IF_AR1},
+    /* 1426 */ {I_PSRLD, 2, {XMMREG,RM_XMM,0,0,0}, nasm_bytecodes+15354, IF_WILLAMETTE|IF_SSE2|IF_SO},
+    /* 1427 */ {I_PSRLD, 2, {XMMREG,IMMEDIATE,0,0,0}, nasm_bytecodes+8118, IF_WILLAMETTE|IF_SSE2|IF_SB|IF_AR1},
+    /* 1428 */ {I_PSRLQ, 2, {XMMREG,RM_XMM,0,0,0}, nasm_bytecodes+15360, IF_WILLAMETTE|IF_SSE2|IF_SO},
+    /* 1429 */ {I_PSRLQ, 2, {XMMREG,IMMEDIATE,0,0,0}, nasm_bytecodes+8125, IF_WILLAMETTE|IF_SSE2|IF_SB|IF_AR1},
+    /* 1430 */ {I_PSUBB, 2, {XMMREG,RM_XMM,0,0,0}, nasm_bytecodes+15366, IF_WILLAMETTE|IF_SSE2|IF_SO},
+    /* 1431 */ {I_PSUBW, 2, {XMMREG,RM_XMM,0,0,0}, nasm_bytecodes+15372, IF_WILLAMETTE|IF_SSE2|IF_SO},
+    /* 1432 */ {I_PSUBD, 2, {XMMREG,RM_XMM,0,0,0}, nasm_bytecodes+15378, IF_WILLAMETTE|IF_SSE2|IF_SO},
+    /* 1433 */ {I_PSUBQ, 2, {MMXREG,RM_MMX,0,0,0}, nasm_bytecodes+8132, IF_WILLAMETTE|IF_SSE2|IF_SO},
+    /* 1434 */ {I_PSUBQ, 2, {XMMREG,RM_XMM,0,0,0}, nasm_bytecodes+15384, IF_WILLAMETTE|IF_SSE2|IF_SO},
+    /* 1435 */ {I_PSUBSB, 2, {XMMREG,RM_XMM,0,0,0}, nasm_bytecodes+15390, IF_WILLAMETTE|IF_SSE2|IF_SO},
+    /* 1436 */ {I_PSUBSW, 2, {XMMREG,RM_XMM,0,0,0}, nasm_bytecodes+15396, IF_WILLAMETTE|IF_SSE2|IF_SO},
+    /* 1437 */ {I_PSUBUSB, 2, {XMMREG,RM_XMM,0,0,0}, nasm_bytecodes+15402, IF_WILLAMETTE|IF_SSE2|IF_SO},
+    /* 1438 */ {I_PSUBUSW, 2, {XMMREG,RM_XMM,0,0,0}, nasm_bytecodes+15408, IF_WILLAMETTE|IF_SSE2|IF_SO},
+    /* 1439 */ {I_PUNPCKHBW, 2, {XMMREG,RM_XMM,0,0,0}, nasm_bytecodes+15414, IF_WILLAMETTE|IF_SSE2|IF_SO},
+    /* 1440 */ {I_PUNPCKHWD, 2, {XMMREG,RM_XMM,0,0,0}, nasm_bytecodes+15420, IF_WILLAMETTE|IF_SSE2|IF_SO},
+    /* 1441 */ {I_PUNPCKHDQ, 2, {XMMREG,RM_XMM,0,0,0}, nasm_bytecodes+15426, IF_WILLAMETTE|IF_SSE2|IF_SO},
+    /* 1442 */ {I_PUNPCKHQDQ, 2, {XMMREG,RM_XMM,0,0,0}, nasm_bytecodes+15432, IF_WILLAMETTE|IF_SSE2|IF_SO},
+    /* 1443 */ {I_PUNPCKLBW, 2, {XMMREG,RM_XMM,0,0,0}, nasm_bytecodes+15438, IF_WILLAMETTE|IF_SSE2|IF_SO},
+    /* 1444 */ {I_PUNPCKLWD, 2, {XMMREG,RM_XMM,0,0,0}, nasm_bytecodes+15444, IF_WILLAMETTE|IF_SSE2|IF_SO},
+    /* 1445 */ {I_PUNPCKLDQ, 2, {XMMREG,RM_XMM,0,0,0}, nasm_bytecodes+15450, IF_WILLAMETTE|IF_SSE2|IF_SO},
+    /* 1446 */ {I_PUNPCKLQDQ, 2, {XMMREG,RM_XMM,0,0,0}, nasm_bytecodes+15456, IF_WILLAMETTE|IF_SSE2|IF_SO},
+    /* 1447 */ {I_PXOR, 2, {XMMREG,RM_XMM,0,0,0}, nasm_bytecodes+15462, IF_WILLAMETTE|IF_SSE2|IF_SO},
+    /* 1448 */ {I_ADDPD, 2, {XMMREG,RM_XMM,0,0,0}, nasm_bytecodes+15468, IF_WILLAMETTE|IF_SSE2|IF_SO},
+    /* 1449 */ {I_ADDSD, 2, {XMMREG,RM_XMM,0,0,0}, nasm_bytecodes+15474, IF_WILLAMETTE|IF_SSE2|IF_SQ},
+    /* 1450 */ {I_ANDNPD, 2, {XMMREG,RM_XMM,0,0,0}, nasm_bytecodes+15480, IF_WILLAMETTE|IF_SSE2|IF_SO},
+    /* 1451 */ {I_ANDPD, 2, {XMMREG,RM_XMM,0,0,0}, nasm_bytecodes+15486, IF_WILLAMETTE|IF_SSE2|IF_SO},
+    /* 1452 */ {I_CMPEQPD, 2, {XMMREG,RM_XMM,0,0,0}, nasm_bytecodes+5764, IF_WILLAMETTE|IF_SSE2|IF_SO},
+    /* 1453 */ {I_CMPEQSD, 2, {XMMREG,RM_XMM,0,0,0}, nasm_bytecodes+5772, IF_WILLAMETTE|IF_SSE2},
+    /* 1454 */ {I_CMPLEPD, 2, {XMMREG,RM_XMM,0,0,0}, nasm_bytecodes+5780, IF_WILLAMETTE|IF_SSE2|IF_SO},
+    /* 1455 */ {I_CMPLESD, 2, {XMMREG,RM_XMM,0,0,0}, nasm_bytecodes+5788, IF_WILLAMETTE|IF_SSE2},
+    /* 1456 */ {I_CMPLTPD, 2, {XMMREG,RM_XMM,0,0,0}, nasm_bytecodes+5796, IF_WILLAMETTE|IF_SSE2|IF_SO},
+    /* 1457 */ {I_CMPLTSD, 2, {XMMREG,RM_XMM,0,0,0}, nasm_bytecodes+5804, IF_WILLAMETTE|IF_SSE2},
+    /* 1458 */ {I_CMPNEQPD, 2, {XMMREG,RM_XMM,0,0,0}, nasm_bytecodes+5812, IF_WILLAMETTE|IF_SSE2|IF_SO},
+    /* 1459 */ {I_CMPNEQSD, 2, {XMMREG,RM_XMM,0,0,0}, nasm_bytecodes+5820, IF_WILLAMETTE|IF_SSE2},
+    /* 1460 */ {I_CMPNLEPD, 2, {XMMREG,RM_XMM,0,0,0}, nasm_bytecodes+5828, IF_WILLAMETTE|IF_SSE2|IF_SO},
+    /* 1461 */ {I_CMPNLESD, 2, {XMMREG,RM_XMM,0,0,0}, nasm_bytecodes+5836, IF_WILLAMETTE|IF_SSE2},
+    /* 1462 */ {I_CMPNLTPD, 2, {XMMREG,RM_XMM,0,0,0}, nasm_bytecodes+5844, IF_WILLAMETTE|IF_SSE2|IF_SO},
+    /* 1463 */ {I_CMPNLTSD, 2, {XMMREG,RM_XMM,0,0,0}, nasm_bytecodes+5852, IF_WILLAMETTE|IF_SSE2},
+    /* 1464 */ {I_CMPORDPD, 2, {XMMREG,RM_XMM,0,0,0}, nasm_bytecodes+5860, IF_WILLAMETTE|IF_SSE2|IF_SO},
+    /* 1465 */ {I_CMPORDSD, 2, {XMMREG,RM_XMM,0,0,0}, nasm_bytecodes+5868, IF_WILLAMETTE|IF_SSE2},
+    /* 1466 */ {I_CMPUNORDPD, 2, {XMMREG,RM_XMM,0,0,0}, nasm_bytecodes+5876, IF_WILLAMETTE|IF_SSE2|IF_SO},
+    /* 1467 */ {I_CMPUNORDSD, 2, {XMMREG,RM_XMM,0,0,0}, nasm_bytecodes+5884, IF_WILLAMETTE|IF_SSE2},
+    /* 1468 */ {I_CMPPD, 3, {XMMREG,RM_XMM,IMMEDIATE,0,0}, nasm_bytecodes+8139, IF_WILLAMETTE|IF_SSE2|IF_SM2|IF_SB|IF_AR2},
+    /* 1469 */ {I_CMPSD, 3, {XMMREG,RM_XMM,IMMEDIATE,0,0}, nasm_bytecodes+8146, IF_WILLAMETTE|IF_SSE2|IF_SB|IF_AR2},
+    /* 1470 */ {I_COMISD, 2, {XMMREG,RM_XMM,0,0,0}, nasm_bytecodes+15492, IF_WILLAMETTE|IF_SSE2},
+    /* 1471 */ {I_CVTDQ2PD, 2, {XMMREG,RM_XMM,0,0,0}, nasm_bytecodes+15498, IF_WILLAMETTE|IF_SSE2|IF_SQ},
+    /* 1472 */ {I_CVTDQ2PS, 2, {XMMREG,RM_XMM,0,0,0}, nasm_bytecodes+15504, IF_WILLAMETTE|IF_SSE2|IF_SO},
+    /* 1473 */ {I_CVTPD2DQ, 2, {XMMREG,RM_XMM,0,0,0}, nasm_bytecodes+15510, IF_WILLAMETTE|IF_SSE2|IF_SO},
+    /* 1474 */ {I_CVTPD2PI, 2, {MMXREG,RM_XMM,0,0,0}, nasm_bytecodes+15516, IF_WILLAMETTE|IF_SSE2|IF_SO},
+    /* 1475 */ {I_CVTPD2PS, 2, {XMMREG,RM_XMM,0,0,0}, nasm_bytecodes+15522, IF_WILLAMETTE|IF_SSE2|IF_SO},
+    /* 1476 */ {I_CVTPI2PD, 2, {XMMREG,RM_MMX,0,0,0}, nasm_bytecodes+15528, IF_WILLAMETTE|IF_SSE2|IF_SQ},
+    /* 1477 */ {I_CVTPS2DQ, 2, {XMMREG,RM_XMM,0,0,0}, nasm_bytecodes+15534, IF_WILLAMETTE|IF_SSE2|IF_SO},
+    /* 1478 */ {I_CVTPS2PD, 2, {XMMREG,RM_XMM,0,0,0}, nasm_bytecodes+15540, IF_WILLAMETTE|IF_SSE2|IF_SQ},
+    /* 1479 */ {I_CVTSD2SI, 2, {REG_GPR|BITS32,XMMREG,0,0,0}, nasm_bytecodes+8154, IF_WILLAMETTE|IF_SSE2|IF_SQ|IF_AR1},
+    /* 1480 */ {I_CVTSD2SI, 2, {REG_GPR|BITS32,MEMORY,0,0,0}, nasm_bytecodes+8154, IF_WILLAMETTE|IF_SSE2|IF_SQ|IF_AR1},
+    /* 1481 */ {I_CVTSD2SI, 2, {REG_GPR|BITS64,XMMREG,0,0,0}, nasm_bytecodes+8153, IF_X64|IF_SSE2|IF_SQ|IF_AR1},
+    /* 1482 */ {I_CVTSD2SI, 2, {REG_GPR|BITS64,MEMORY,0,0,0}, nasm_bytecodes+8153, IF_X64|IF_SSE2|IF_SQ|IF_AR1},
+    /* 1483 */ {I_CVTSD2SS, 2, {XMMREG,RM_XMM,0,0,0}, nasm_bytecodes+15546, IF_WILLAMETTE|IF_SSE2|IF_SQ},
+    /* 1484 */ {I_CVTSI2SD, 2, {XMMREG,RM_GPR|BITS32,0,0,0}, nasm_bytecodes+8161, IF_WILLAMETTE|IF_SSE2|IF_SD|IF_AR1},
+    /* 1485 */ {I_CVTSI2SD, 2, {XMMREG,RM_GPR|BITS64,0,0,0}, nasm_bytecodes+8160, IF_X64|IF_SSE2|IF_SQ|IF_AR1},
+    /* 1486 */ {I_CVTSS2SD, 2, {XMMREG,RM_XMM,0,0,0}, nasm_bytecodes+15552, IF_WILLAMETTE|IF_SSE2|IF_SD},
+    /* 1487 */ {I_CVTTPD2PI, 2, {MMXREG,RM_XMM,0,0,0}, nasm_bytecodes+15558, IF_WILLAMETTE|IF_SSE2|IF_SO},
+    /* 1488 */ {I_CVTTPD2DQ, 2, {XMMREG,RM_XMM,0,0,0}, nasm_bytecodes+15564, IF_WILLAMETTE|IF_SSE2|IF_SO},
+    /* 1489 */ {I_CVTTPS2DQ, 2, {XMMREG,RM_XMM,0,0,0}, nasm_bytecodes+15570, IF_WILLAMETTE|IF_SSE2|IF_SO},
+    /* 1490 */ {I_CVTTSD2SI, 2, {REG_GPR|BITS32,XMMREG,0,0,0}, nasm_bytecodes+8168, IF_WILLAMETTE|IF_SSE2|IF_SQ|IF_AR1},
+    /* 1491 */ {I_CVTTSD2SI, 2, {REG_GPR|BITS32,MEMORY,0,0,0}, nasm_bytecodes+8168, IF_WILLAMETTE|IF_SSE2|IF_SQ|IF_AR1},
+    /* 1492 */ {I_CVTTSD2SI, 2, {REG_GPR|BITS64,XMMREG,0,0,0}, nasm_bytecodes+8167, IF_X64|IF_SSE2|IF_SQ|IF_AR1},
+    /* 1493 */ {I_CVTTSD2SI, 2, {REG_GPR|BITS64,MEMORY,0,0,0}, nasm_bytecodes+8167, IF_X64|IF_SSE2|IF_SQ|IF_AR1},
+    /* 1494 */ {I_DIVPD, 2, {XMMREG,RM_XMM,0,0,0}, nasm_bytecodes+15576, IF_WILLAMETTE|IF_SSE2|IF_SO},
+    /* 1495 */ {I_DIVSD, 2, {XMMREG,RM_XMM,0,0,0}, nasm_bytecodes+15582, IF_WILLAMETTE|IF_SSE2},
+    /* 1496 */ {I_MAXPD, 2, {XMMREG,RM_XMM,0,0,0}, nasm_bytecodes+15588, IF_WILLAMETTE|IF_SSE2|IF_SO},
+    /* 1497 */ {I_MAXSD, 2, {XMMREG,RM_XMM,0,0,0}, nasm_bytecodes+15594, IF_WILLAMETTE|IF_SSE2},
+    /* 1498 */ {I_MINPD, 2, {XMMREG,RM_XMM,0,0,0}, nasm_bytecodes+15600, IF_WILLAMETTE|IF_SSE2|IF_SO},
+    /* 1499 */ {I_MINSD, 2, {XMMREG,RM_XMM,0,0,0}, nasm_bytecodes+15606, IF_WILLAMETTE|IF_SSE2},
+    /* 1500 */ {I_MOVAPD, 2, {XMMREG,XMMREG,0,0,0}, nasm_bytecodes+15612, IF_WILLAMETTE|IF_SSE2},
+    /* 1501 */ {I_MOVAPD, 2, {XMMREG,XMMREG,0,0,0}, nasm_bytecodes+15618, IF_WILLAMETTE|IF_SSE2},
+    /* 1502 */ {I_MOVAPD, 2, {MEMORY,XMMREG,0,0,0}, nasm_bytecodes+15618, IF_WILLAMETTE|IF_SSE2|IF_SO},
+    /* 1503 */ {I_MOVAPD, 2, {XMMREG,MEMORY,0,0,0}, nasm_bytecodes+15612, IF_WILLAMETTE|IF_SSE2|IF_SO},
+    /* 1504 */ {I_MOVHPD, 2, {MEMORY,XMMREG,0,0,0}, nasm_bytecodes+15624, IF_WILLAMETTE|IF_SSE2},
+    /* 1505 */ {I_MOVHPD, 2, {XMMREG,MEMORY,0,0,0}, nasm_bytecodes+15630, IF_WILLAMETTE|IF_SSE2},
+    /* 1506 */ {I_MOVLPD, 2, {MEMORY,XMMREG,0,0,0}, nasm_bytecodes+15636, IF_WILLAMETTE|IF_SSE2},
+    /* 1507 */ {I_MOVLPD, 2, {XMMREG,MEMORY,0,0,0}, nasm_bytecodes+15642, IF_WILLAMETTE|IF_SSE2},
+    /* 1508 */ {I_MOVMSKPD, 2, {REG_GPR|BITS32,XMMREG,0,0,0}, nasm_bytecodes+15648, IF_WILLAMETTE|IF_SSE2},
+    /* 1509 */ {I_MOVMSKPD, 2, {REG_GPR|BITS64,XMMREG,0,0,0}, nasm_bytecodes+8174, IF_X64|IF_SSE2},
+    /* 1510 */ {I_MOVSD, 2, {XMMREG,XMMREG,0,0,0}, nasm_bytecodes+15654, IF_WILLAMETTE|IF_SSE2},
+    /* 1511 */ {I_MOVSD, 2, {XMMREG,XMMREG,0,0,0}, nasm_bytecodes+15660, IF_WILLAMETTE|IF_SSE2},
+    /* 1512 */ {I_MOVSD, 2, {MEMORY,XMMREG,0,0,0}, nasm_bytecodes+15660, IF_WILLAMETTE|IF_SSE2},
+    /* 1513 */ {I_MOVSD, 2, {XMMREG,MEMORY,0,0,0}, nasm_bytecodes+15654, IF_WILLAMETTE|IF_SSE2},
+    /* 1514 */ {I_MOVUPD, 2, {XMMREG,XMMREG,0,0,0}, nasm_bytecodes+15666, IF_WILLAMETTE|IF_SSE2},
+    /* 1515 */ {I_MOVUPD, 2, {XMMREG,XMMREG,0,0,0}, nasm_bytecodes+15672, IF_WILLAMETTE|IF_SSE2},
+    /* 1516 */ {I_MOVUPD, 2, {MEMORY,XMMREG,0,0,0}, nasm_bytecodes+15672, IF_WILLAMETTE|IF_SSE2|IF_SO},
+    /* 1517 */ {I_MOVUPD, 2, {XMMREG,MEMORY,0,0,0}, nasm_bytecodes+15666, IF_WILLAMETTE|IF_SSE2|IF_SO},
+    /* 1518 */ {I_MULPD, 2, {XMMREG,RM_XMM,0,0,0}, nasm_bytecodes+15678, IF_WILLAMETTE|IF_SSE2|IF_SO},
+    /* 1519 */ {I_MULSD, 2, {XMMREG,RM_XMM,0,0,0}, nasm_bytecodes+15684, IF_WILLAMETTE|IF_SSE2},
+    /* 1520 */ {I_ORPD, 2, {XMMREG,RM_XMM,0,0,0}, nasm_bytecodes+15690, IF_WILLAMETTE|IF_SSE2|IF_SO},
+    /* 1521 */ {I_SHUFPD, 3, {XMMREG,XMMREG,IMMEDIATE,0,0}, nasm_bytecodes+8181, IF_WILLAMETTE|IF_SSE2|IF_SB|IF_AR2},
+    /* 1522 */ {I_SHUFPD, 3, {XMMREG,MEMORY,IMMEDIATE,0,0}, nasm_bytecodes+8181, IF_WILLAMETTE|IF_SSE2|IF_SM|IF_SB|IF_AR2},
+    /* 1523 */ {I_SQRTPD, 2, {XMMREG,RM_XMM,0,0,0}, nasm_bytecodes+15696, IF_WILLAMETTE|IF_SSE2|IF_SO},
+    /* 1524 */ {I_SQRTSD, 2, {XMMREG,RM_XMM,0,0,0}, nasm_bytecodes+15702, IF_WILLAMETTE|IF_SSE2},
+    /* 1525 */ {I_SUBPD, 2, {XMMREG,RM_XMM,0,0,0}, nasm_bytecodes+15708, IF_WILLAMETTE|IF_SSE2|IF_SO},
+    /* 1526 */ {I_SUBSD, 2, {XMMREG,RM_XMM,0,0,0}, nasm_bytecodes+15714, IF_WILLAMETTE|IF_SSE2},
+    /* 1527 */ {I_UCOMISD, 2, {XMMREG,RM_XMM,0,0,0}, nasm_bytecodes+15720, IF_WILLAMETTE|IF_SSE2},
+    /* 1528 */ {I_UNPCKHPD, 2, {XMMREG,RM_XMM,0,0,0}, nasm_bytecodes+15726, IF_WILLAMETTE|IF_SSE2|IF_SO},
+    /* 1529 */ {I_UNPCKLPD, 2, {XMMREG,RM_XMM,0,0,0}, nasm_bytecodes+15732, IF_WILLAMETTE|IF_SSE2|IF_SO},
+    /* 1530 */ {I_XORPD, 2, {XMMREG,RM_XMM,0,0,0}, nasm_bytecodes+15738, IF_WILLAMETTE|IF_SSE2|IF_SO},
+    /* 1531 */ {I_ADDSUBPD, 2, {XMMREG,RM_XMM,0,0,0}, nasm_bytecodes+15744, IF_PRESCOTT|IF_SSE3|IF_SO},
+    /* 1532 */ {I_ADDSUBPS, 2, {XMMREG,RM_XMM,0,0,0}, nasm_bytecodes+15750, IF_PRESCOTT|IF_SSE3|IF_SO},
+    /* 1533 */ {I_HADDPD, 2, {XMMREG,RM_XMM,0,0,0}, nasm_bytecodes+15756, IF_PRESCOTT|IF_SSE3|IF_SO},
+    /* 1534 */ {I_HADDPS, 2, {XMMREG,RM_XMM,0,0,0}, nasm_bytecodes+15762, IF_PRESCOTT|IF_SSE3|IF_SO},
+    /* 1535 */ {I_HSUBPD, 2, {XMMREG,RM_XMM,0,0,0}, nasm_bytecodes+15768, IF_PRESCOTT|IF_SSE3|IF_SO},
+    /* 1536 */ {I_HSUBPS, 2, {XMMREG,RM_XMM,0,0,0}, nasm_bytecodes+15774, IF_PRESCOTT|IF_SSE3|IF_SO},
+    /* 1537 */ {I_LDDQU, 2, {XMMREG,MEMORY,0,0,0}, nasm_bytecodes+15780, IF_PRESCOTT|IF_SSE3|IF_SO},
+    /* 1538 */ {I_MOVDDUP, 2, {XMMREG,RM_XMM,0,0,0}, nasm_bytecodes+15786, IF_PRESCOTT|IF_SSE3},
+    /* 1539 */ {I_MOVSHDUP, 2, {XMMREG,RM_XMM,0,0,0}, nasm_bytecodes+15792, IF_PRESCOTT|IF_SSE3},
+    /* 1540 */ {I_MOVSLDUP, 2, {XMMREG,RM_XMM,0,0,0}, nasm_bytecodes+15798, IF_PRESCOTT|IF_SSE3},
+    /* 1541 */ {I_VMCALL, 0, {0,0,0,0,0}, nasm_bytecodes+18864, IF_VMX},
+    /* 1542 */ {I_VMCLEAR, 1, {MEMORY,0,0,0,0}, nasm_bytecodes+15804, IF_VMX},
+    /* 1543 */ {I_VMLAUNCH, 0, {0,0,0,0,0}, nasm_bytecodes+18869, IF_VMX},
+    /* 1544 */ {I_VMLOAD, 0, {0,0,0,0,0}, nasm_bytecodes+18874, IF_X64|IF_VMX},
+    /* 1545 */ {I_VMMCALL, 0, {0,0,0,0,0}, nasm_bytecodes+18879, IF_X64|IF_VMX},
+    /* 1546 */ {I_VMPTRLD, 1, {MEMORY,0,0,0,0}, nasm_bytecodes+15811, IF_VMX},
+    /* 1547 */ {I_VMPTRST, 1, {MEMORY,0,0,0,0}, nasm_bytecodes+18884, IF_VMX},
+    /* 1548 */ {I_VMREAD, 2, {RM_GPR|BITS32,REG_GPR|BITS32,0,0,0}, nasm_bytecodes+8189, IF_VMX|IF_NOLONG|IF_SD},
+    /* 1549 */ {I_VMREAD, 2, {RM_GPR|BITS64,REG_GPR|BITS64,0,0,0}, nasm_bytecodes+8188, IF_X64|IF_VMX|IF_SQ},
+    /* 1550 */ {I_VMRESUME, 0, {0,0,0,0,0}, nasm_bytecodes+18889, IF_VMX},
+    /* 1551 */ {I_VMRUN, 0, {0,0,0,0,0}, nasm_bytecodes+18894, IF_X64|IF_VMX},
+    /* 1552 */ {I_VMSAVE, 0, {0,0,0,0,0}, nasm_bytecodes+18899, IF_X64|IF_VMX},
+    /* 1553 */ {I_VMWRITE, 2, {REG_GPR|BITS32,RM_GPR|BITS32,0,0,0}, nasm_bytecodes+8196, IF_VMX|IF_NOLONG|IF_SD},
+    /* 1554 */ {I_VMWRITE, 2, {REG_GPR|BITS64,RM_GPR|BITS64,0,0,0}, nasm_bytecodes+8195, IF_X64|IF_VMX|IF_SQ},
+    /* 1555 */ {I_VMXOFF, 0, {0,0,0,0,0}, nasm_bytecodes+18904, IF_VMX},
+    /* 1556 */ {I_VMXON, 1, {MEMORY,0,0,0,0}, nasm_bytecodes+15810, IF_VMX},
+    /* 1557 */ {I_INVEPT, 2, {REG_GPR|BITS32,MEMORY,0,0,0}, nasm_bytecodes+5893, IF_VMX|IF_SO|IF_NOLONG},
+    /* 1558 */ {I_INVEPT, 2, {REG_GPR|BITS64,MEMORY,0,0,0}, nasm_bytecodes+5892, IF_VMX|IF_SO|IF_LONG},
+    /* 1559 */ {I_INVVPID, 2, {REG_GPR|BITS32,MEMORY,0,0,0}, nasm_bytecodes+5901, IF_VMX|IF_SO|IF_NOLONG},
+    /* 1560 */ {I_INVVPID, 2, {REG_GPR|BITS64,MEMORY,0,0,0}, nasm_bytecodes+5900, IF_VMX|IF_SO|IF_LONG},
+    /* 1561 */ {I_PABSB, 2, {MMXREG,RM_MMX,0,0,0}, nasm_bytecodes+8202, IF_SSSE3|IF_MMX|IF_SQ},
+    /* 1562 */ {I_PABSB, 2, {XMMREG,RM_XMM,0,0,0}, nasm_bytecodes+8209, IF_SSSE3},
+    /* 1563 */ {I_PABSW, 2, {MMXREG,RM_MMX,0,0,0}, nasm_bytecodes+8216, IF_SSSE3|IF_MMX|IF_SQ},
+    /* 1564 */ {I_PABSW, 2, {XMMREG,RM_XMM,0,0,0}, nasm_bytecodes+8223, IF_SSSE3},
+    /* 1565 */ {I_PABSD, 2, {MMXREG,RM_MMX,0,0,0}, nasm_bytecodes+8230, IF_SSSE3|IF_MMX|IF_SQ},
+    /* 1566 */ {I_PABSD, 2, {XMMREG,RM_XMM,0,0,0}, nasm_bytecodes+8237, IF_SSSE3},
+    /* 1567 */ {I_PALIGNR, 3, {MMXREG,RM_MMX,IMMEDIATE,0,0}, nasm_bytecodes+5908, IF_SSSE3|IF_MMX|IF_SQ},
+    /* 1568 */ {I_PALIGNR, 3, {XMMREG,RM_XMM,IMMEDIATE,0,0}, nasm_bytecodes+5916, IF_SSSE3},
+    /* 1569 */ {I_PHADDW, 2, {MMXREG,RM_MMX,0,0,0}, nasm_bytecodes+8244, IF_SSSE3|IF_MMX|IF_SQ},
+    /* 1570 */ {I_PHADDW, 2, {XMMREG,RM_XMM,0,0,0}, nasm_bytecodes+8251, IF_SSSE3},
+    /* 1571 */ {I_PHADDD, 2, {MMXREG,RM_MMX,0,0,0}, nasm_bytecodes+8258, IF_SSSE3|IF_MMX|IF_SQ},
+    /* 1572 */ {I_PHADDD, 2, {XMMREG,RM_XMM,0,0,0}, nasm_bytecodes+8265, IF_SSSE3},
+    /* 1573 */ {I_PHADDSW, 2, {MMXREG,RM_MMX,0,0,0}, nasm_bytecodes+8272, IF_SSSE3|IF_MMX|IF_SQ},
+    /* 1574 */ {I_PHADDSW, 2, {XMMREG,RM_XMM,0,0,0}, nasm_bytecodes+8279, IF_SSSE3},
+    /* 1575 */ {I_PHSUBW, 2, {MMXREG,RM_MMX,0,0,0}, nasm_bytecodes+8286, IF_SSSE3|IF_MMX|IF_SQ},
+    /* 1576 */ {I_PHSUBW, 2, {XMMREG,RM_XMM,0,0,0}, nasm_bytecodes+8293, IF_SSSE3},
+    /* 1577 */ {I_PHSUBD, 2, {MMXREG,RM_MMX,0,0,0}, nasm_bytecodes+8300, IF_SSSE3|IF_MMX|IF_SQ},
+    /* 1578 */ {I_PHSUBD, 2, {XMMREG,RM_XMM,0,0,0}, nasm_bytecodes+8307, IF_SSSE3},
+    /* 1579 */ {I_PHSUBSW, 2, {MMXREG,RM_MMX,0,0,0}, nasm_bytecodes+8314, IF_SSSE3|IF_MMX|IF_SQ},
+    /* 1580 */ {I_PHSUBSW, 2, {XMMREG,RM_XMM,0,0,0}, nasm_bytecodes+8321, IF_SSSE3},
+    /* 1581 */ {I_PMADDUBSW, 2, {MMXREG,RM_MMX,0,0,0}, nasm_bytecodes+8328, IF_SSSE3|IF_MMX|IF_SQ},
+    /* 1582 */ {I_PMADDUBSW, 2, {XMMREG,RM_XMM,0,0,0}, nasm_bytecodes+8335, IF_SSSE3},
+    /* 1583 */ {I_PMULHRSW, 2, {MMXREG,RM_MMX,0,0,0}, nasm_bytecodes+8342, IF_SSSE3|IF_MMX|IF_SQ},
+    /* 1584 */ {I_PMULHRSW, 2, {XMMREG,RM_XMM,0,0,0}, nasm_bytecodes+8349, IF_SSSE3},
+    /* 1585 */ {I_PSHUFB, 2, {MMXREG,RM_MMX,0,0,0}, nasm_bytecodes+8356, IF_SSSE3|IF_MMX|IF_SQ},
+    /* 1586 */ {I_PSHUFB, 2, {XMMREG,RM_XMM,0,0,0}, nasm_bytecodes+8363, IF_SSSE3},
+    /* 1587 */ {I_PSIGNB, 2, {MMXREG,RM_MMX,0,0,0}, nasm_bytecodes+8370, IF_SSSE3|IF_MMX|IF_SQ},
+    /* 1588 */ {I_PSIGNB, 2, {XMMREG,RM_XMM,0,0,0}, nasm_bytecodes+8377, IF_SSSE3},
+    /* 1589 */ {I_PSIGNW, 2, {MMXREG,RM_MMX,0,0,0}, nasm_bytecodes+8384, IF_SSSE3|IF_MMX|IF_SQ},
+    /* 1590 */ {I_PSIGNW, 2, {XMMREG,RM_XMM,0,0,0}, nasm_bytecodes+8391, IF_SSSE3},
+    /* 1591 */ {I_PSIGND, 2, {MMXREG,RM_MMX,0,0,0}, nasm_bytecodes+8398, IF_SSSE3|IF_MMX|IF_SQ},
+    /* 1592 */ {I_PSIGND, 2, {XMMREG,RM_XMM,0,0,0}, nasm_bytecodes+8405, IF_SSSE3},
+    /* 1593 */ {I_EXTRQ, 3, {XMMREG,IMMEDIATE,IMMEDIATE,0,0}, nasm_bytecodes+5924, IF_SSE4A|IF_AMD},
+    /* 1594 */ {I_EXTRQ, 2, {XMMREG,XMMREG,0,0,0}, nasm_bytecodes+15816, IF_SSE4A|IF_AMD},
+    /* 1595 */ {I_INSERTQ, 4, {XMMREG,XMMREG,IMMEDIATE,IMMEDIATE,0}, nasm_bytecodes+5932, IF_SSE4A|IF_AMD},
+    /* 1596 */ {I_INSERTQ, 2, {XMMREG,XMMREG,0,0,0}, nasm_bytecodes+15822, IF_SSE4A|IF_AMD},
+    /* 1597 */ {I_MOVNTSD, 2, {MEMORY,XMMREG,0,0,0}, nasm_bytecodes+15828, IF_SSE4A|IF_AMD|IF_SQ},
+    /* 1598 */ {I_MOVNTSS, 2, {MEMORY,XMMREG,0,0,0}, nasm_bytecodes+15834, IF_SSE4A|IF_AMD|IF_SD},
+    /* 1599 */ {I_LZCNT, 2, {REG_GPR|BITS16,RM_GPR|BITS16,0,0,0}, nasm_bytecodes+8412, IF_P6|IF_AMD},
+    /* 1600 */ {I_LZCNT, 2, {REG_GPR|BITS32,RM_GPR|BITS32,0,0,0}, nasm_bytecodes+8419, IF_P6|IF_AMD},
+    /* 1601 */ {I_LZCNT, 2, {REG_GPR|BITS64,RM_GPR|BITS64,0,0,0}, nasm_bytecodes+8426, IF_X64|IF_AMD},
+    /* 1602 */ {I_BLENDPD, 3, {XMMREG,RM_XMM,IMMEDIATE,0,0}, nasm_bytecodes+5940, IF_SSE41},
+    /* 1603 */ {I_BLENDPS, 3, {XMMREG,RM_XMM,IMMEDIATE,0,0}, nasm_bytecodes+5948, IF_SSE41},
+    /* 1604 */ {I_BLENDVPD, 3, {XMMREG,RM_XMM,XMM0,0,0}, nasm_bytecodes+8433, IF_SSE41},
+    /* 1605 */ {I_BLENDVPS, 3, {XMMREG,RM_XMM,XMM0,0,0}, nasm_bytecodes+8440, IF_SSE41},
+    /* 1606 */ {I_DPPD, 3, {XMMREG,RM_XMM,IMMEDIATE,0,0}, nasm_bytecodes+5956, IF_SSE41},
+    /* 1607 */ {I_DPPS, 3, {XMMREG,RM_XMM,IMMEDIATE,0,0}, nasm_bytecodes+5964, IF_SSE41},
+    /* 1608 */ {I_EXTRACTPS, 3, {RM_GPR|BITS32,XMMREG,IMMEDIATE,0,0}, nasm_bytecodes+1, IF_SSE41},
+    /* 1609 */ {I_EXTRACTPS, 3, {REG_GPR|BITS64,XMMREG,IMMEDIATE,0,0}, nasm_bytecodes+0, IF_SSE41|IF_X64},
+    /* 1610 */ {I_INSERTPS, 3, {XMMREG,RM_XMM,IMMEDIATE,0,0}, nasm_bytecodes+5972, IF_SSE41|IF_SD},
+    /* 1611 */ {I_MOVNTDQA, 2, {XMMREG,MEMORY,0,0,0}, nasm_bytecodes+8447, IF_SSE41},
+    /* 1612 */ {I_MPSADBW, 3, {XMMREG,RM_XMM,IMMEDIATE,0,0}, nasm_bytecodes+5980, IF_SSE41},
+    /* 1613 */ {I_PACKUSDW, 2, {XMMREG,RM_XMM,0,0,0}, nasm_bytecodes+8454, IF_SSE41},
+    /* 1614 */ {I_PBLENDVB, 3, {XMMREG,RM_XMM,XMM0,0,0}, nasm_bytecodes+8461, IF_SSE41},
+    /* 1615 */ {I_PBLENDW, 3, {XMMREG,RM_XMM,IMMEDIATE,0,0}, nasm_bytecodes+5988, IF_SSE41},
+    /* 1616 */ {I_PCMPEQQ, 2, {XMMREG,RM_XMM,0,0,0}, nasm_bytecodes+8468, IF_SSE41},
+    /* 1617 */ {I_PEXTRB, 3, {REG_GPR|BITS32,XMMREG,IMMEDIATE,0,0}, nasm_bytecodes+10, IF_SSE41},
+    /* 1618 */ {I_PEXTRB, 3, {MEMORY|BITS8,XMMREG,IMMEDIATE,0,0}, nasm_bytecodes+10, IF_SSE41},
+    /* 1619 */ {I_PEXTRB, 3, {REG_GPR|BITS64,XMMREG,IMMEDIATE,0,0}, nasm_bytecodes+9, IF_SSE41|IF_X64},
+    /* 1620 */ {I_PEXTRD, 3, {RM_GPR|BITS32,XMMREG,IMMEDIATE,0,0}, nasm_bytecodes+19, IF_SSE41},
+    /* 1621 */ {I_PEXTRQ, 3, {RM_GPR|BITS64,XMMREG,IMMEDIATE,0,0}, nasm_bytecodes+18, IF_SSE41|IF_X64},
+    /* 1622 */ {I_PEXTRW, 3, {REG_GPR|BITS32,XMMREG,IMMEDIATE,0,0}, nasm_bytecodes+28, IF_SSE41},
+    /* 1623 */ {I_PEXTRW, 3, {MEMORY|BITS16,XMMREG,IMMEDIATE,0,0}, nasm_bytecodes+28, IF_SSE41},
+    /* 1624 */ {I_PEXTRW, 3, {REG_GPR|BITS64,XMMREG,IMMEDIATE,0,0}, nasm_bytecodes+27, IF_SSE41|IF_X64},
+    /* 1625 */ {I_PHMINPOSUW, 2, {XMMREG,RM_XMM,0,0,0}, nasm_bytecodes+8475, IF_SSE41},
+    /* 1626 */ {I_PINSRB, 3, {XMMREG,MEMORY,IMMEDIATE,0,0}, nasm_bytecodes+37, IF_SSE41|IF_SB|IF_AR2},
+    /* 1627 */ {I_PINSRB, 3, {XMMREG,RM_GPR|BITS8,IMMEDIATE,0,0}, nasm_bytecodes+36, IF_SSE41|IF_SB|IF_AR2},
+    /* 1628 */ {I_PINSRB, 3, {XMMREG,REG_GPR|BITS32,IMMEDIATE,0,0}, nasm_bytecodes+37, IF_SSE41|IF_SB|IF_AR2},
+    /* 1629 */ {I_PINSRD, 3, {XMMREG,MEMORY,IMMEDIATE,0,0}, nasm_bytecodes+46, IF_SSE41|IF_SB|IF_AR2},
+    /* 1630 */ {I_PINSRD, 3, {XMMREG,RM_GPR|BITS32,IMMEDIATE,0,0}, nasm_bytecodes+46, IF_SSE41|IF_SB|IF_AR2},
+    /* 1631 */ {I_PINSRQ, 3, {XMMREG,MEMORY,IMMEDIATE,0,0}, nasm_bytecodes+45, IF_SSE41|IF_X64|IF_SB|IF_AR2},
+    /* 1632 */ {I_PINSRQ, 3, {XMMREG,RM_GPR|BITS64,IMMEDIATE,0,0}, nasm_bytecodes+45, IF_SSE41|IF_X64|IF_SB|IF_AR2},
+    /* 1633 */ {I_PMAXSB, 2, {XMMREG,RM_XMM,0,0,0}, nasm_bytecodes+8482, IF_SSE41},
+    /* 1634 */ {I_PMAXSD, 2, {XMMREG,RM_XMM,0,0,0}, nasm_bytecodes+8489, IF_SSE41},
+    /* 1635 */ {I_PMAXUD, 2, {XMMREG,RM_XMM,0,0,0}, nasm_bytecodes+8496, IF_SSE41},
+    /* 1636 */ {I_PMAXUW, 2, {XMMREG,RM_XMM,0,0,0}, nasm_bytecodes+8503, IF_SSE41},
+    /* 1637 */ {I_PMINSB, 2, {XMMREG,RM_XMM,0,0,0}, nasm_bytecodes+8510, IF_SSE41},
+    /* 1638 */ {I_PMINSD, 2, {XMMREG,RM_XMM,0,0,0}, nasm_bytecodes+8517, IF_SSE41},
+    /* 1639 */ {I_PMINUD, 2, {XMMREG,RM_XMM,0,0,0}, nasm_bytecodes+8524, IF_SSE41},
+    /* 1640 */ {I_PMINUW, 2, {XMMREG,RM_XMM,0,0,0}, nasm_bytecodes+8531, IF_SSE41},
+    /* 1641 */ {I_PMOVSXBW, 2, {XMMREG,RM_XMM,0,0,0}, nasm_bytecodes+8538, IF_SSE41|IF_SQ},
+    /* 1642 */ {I_PMOVSXBD, 2, {XMMREG,RM_XMM,0,0,0}, nasm_bytecodes+8545, IF_SSE41|IF_SD},
+    /* 1643 */ {I_PMOVSXBQ, 2, {XMMREG,RM_XMM,0,0,0}, nasm_bytecodes+8552, IF_SSE41|IF_SW},
+    /* 1644 */ {I_PMOVSXWD, 2, {XMMREG,RM_XMM,0,0,0}, nasm_bytecodes+8559, IF_SSE41|IF_SQ},
+    /* 1645 */ {I_PMOVSXWQ, 2, {XMMREG,RM_XMM,0,0,0}, nasm_bytecodes+8566, IF_SSE41|IF_SD},
+    /* 1646 */ {I_PMOVSXDQ, 2, {XMMREG,RM_XMM,0,0,0}, nasm_bytecodes+8573, IF_SSE41|IF_SQ},
+    /* 1647 */ {I_PMOVZXBW, 2, {XMMREG,RM_XMM,0,0,0}, nasm_bytecodes+8580, IF_SSE41|IF_SQ},
+    /* 1648 */ {I_PMOVZXBD, 2, {XMMREG,RM_XMM,0,0,0}, nasm_bytecodes+8587, IF_SSE41|IF_SD},
+    /* 1649 */ {I_PMOVZXBQ, 2, {XMMREG,RM_XMM,0,0,0}, nasm_bytecodes+8594, IF_SSE41|IF_SW},
+    /* 1650 */ {I_PMOVZXWD, 2, {XMMREG,RM_XMM,0,0,0}, nasm_bytecodes+8601, IF_SSE41|IF_SQ},
+    /* 1651 */ {I_PMOVZXWQ, 2, {XMMREG,RM_XMM,0,0,0}, nasm_bytecodes+8608, IF_SSE41|IF_SD},
+    /* 1652 */ {I_PMOVZXDQ, 2, {XMMREG,RM_XMM,0,0,0}, nasm_bytecodes+8615, IF_SSE41|IF_SQ},
+    /* 1653 */ {I_PMULDQ, 2, {XMMREG,RM_XMM,0,0,0}, nasm_bytecodes+8622, IF_SSE41},
+    /* 1654 */ {I_PMULLD, 2, {XMMREG,RM_XMM,0,0,0}, nasm_bytecodes+8629, IF_SSE41},
+    /* 1655 */ {I_PTEST, 2, {XMMREG,RM_XMM,0,0,0}, nasm_bytecodes+8636, IF_SSE41},
+    /* 1656 */ {I_ROUNDPD, 3, {XMMREG,RM_XMM,IMMEDIATE,0,0}, nasm_bytecodes+5996, IF_SSE41},
+    /* 1657 */ {I_ROUNDPS, 3, {XMMREG,RM_XMM,IMMEDIATE,0,0}, nasm_bytecodes+6004, IF_SSE41},
+    /* 1658 */ {I_ROUNDSD, 3, {XMMREG,RM_XMM,IMMEDIATE,0,0}, nasm_bytecodes+6012, IF_SSE41},
+    /* 1659 */ {I_ROUNDSS, 3, {XMMREG,RM_XMM,IMMEDIATE,0,0}, nasm_bytecodes+6020, IF_SSE41},
+    /* 1660 */ {I_CRC32, 2, {REG_GPR|BITS32,RM_GPR|BITS8,0,0,0}, nasm_bytecodes+6045, IF_SSE42},
+    /* 1661 */ {I_CRC32, 2, {REG_GPR|BITS32,RM_GPR|BITS16,0,0,0}, nasm_bytecodes+6028, IF_SSE42},
+    /* 1662 */ {I_CRC32, 2, {REG_GPR|BITS32,RM_GPR|BITS32,0,0,0}, nasm_bytecodes+6036, IF_SSE42},
+    /* 1663 */ {I_CRC32, 2, {REG_GPR|BITS64,RM_GPR|BITS8,0,0,0}, nasm_bytecodes+6044, IF_SSE42|IF_X64},
+    /* 1664 */ {I_CRC32, 2, {REG_GPR|BITS64,RM_GPR|BITS64,0,0,0}, nasm_bytecodes+6052, IF_SSE42|IF_X64},
+    /* 1665 */ {I_PCMPESTRI, 3, {XMMREG,RM_XMM,IMMEDIATE,0,0}, nasm_bytecodes+6060, IF_SSE42},
+    /* 1666 */ {I_PCMPESTRM, 3, {XMMREG,RM_XMM,IMMEDIATE,0,0}, nasm_bytecodes+6068, IF_SSE42},
+    /* 1667 */ {I_PCMPISTRI, 3, {XMMREG,RM_XMM,IMMEDIATE,0,0}, nasm_bytecodes+6076, IF_SSE42},
+    /* 1668 */ {I_PCMPISTRM, 3, {XMMREG,RM_XMM,IMMEDIATE,0,0}, nasm_bytecodes+6084, IF_SSE42},
+    /* 1669 */ {I_PCMPGTQ, 2, {XMMREG,RM_XMM,0,0,0}, nasm_bytecodes+8643, IF_SSE42},
+    /* 1670 */ {I_POPCNT, 2, {REG_GPR|BITS16,RM_GPR|BITS16,0,0,0}, nasm_bytecodes+8650, IF_NEHALEM|IF_SW},
+    /* 1671 */ {I_POPCNT, 2, {REG_GPR|BITS32,RM_GPR|BITS32,0,0,0}, nasm_bytecodes+8657, IF_NEHALEM|IF_SD},
+    /* 1672 */ {I_POPCNT, 2, {REG_GPR|BITS64,RM_GPR|BITS64,0,0,0}, nasm_bytecodes+8664, IF_NEHALEM|IF_SQ|IF_X64},
+    /* 1673 */ {I_GETSEC, 0, {0,0,0,0,0}, nasm_bytecodes+19958, IF_KATMAI},
+    /* 1674 */ {I_PFRCPV, 2, {MMXREG,RM_MMX,0,0,0}, nasm_bytecodes+6092, IF_PENT|IF_3DNOW|IF_SQ|IF_CYRIX},
+    /* 1675 */ {I_PFRSQRTV, 2, {MMXREG,RM_MMX,0,0,0}, nasm_bytecodes+6100, IF_PENT|IF_3DNOW|IF_SQ|IF_CYRIX},
+    /* 1676 */ {I_MOVBE, 2, {REG_GPR|BITS16,MEMORY|BITS16,0,0,0}, nasm_bytecodes+8671, IF_NEHALEM|IF_SM},
+    /* 1677 */ {I_MOVBE, 2, {REG_GPR|BITS32,MEMORY|BITS32,0,0,0}, nasm_bytecodes+8678, IF_NEHALEM|IF_SM},
+    /* 1678 */ {I_MOVBE, 2, {REG_GPR|BITS64,MEMORY|BITS64,0,0,0}, nasm_bytecodes+8685, IF_NEHALEM|IF_SM},
+    /* 1679 */ {I_MOVBE, 2, {MEMORY|BITS16,REG_GPR|BITS16,0,0,0}, nasm_bytecodes+8692, IF_NEHALEM|IF_SM},
+    /* 1680 */ {I_MOVBE, 2, {MEMORY|BITS32,REG_GPR|BITS32,0,0,0}, nasm_bytecodes+8699, IF_NEHALEM|IF_SM},
+    /* 1681 */ {I_MOVBE, 2, {MEMORY|BITS64,REG_GPR|BITS64,0,0,0}, nasm_bytecodes+8706, IF_NEHALEM|IF_SM},
+    /* 1682 */ {I_AESENC, 2, {XMMREG,RM_XMM|BITS128,0,0,0}, nasm_bytecodes+8713, IF_SSE|IF_WESTMERE},
+    /* 1683 */ {I_AESENCLAST, 2, {XMMREG,RM_XMM|BITS128,0,0,0}, nasm_bytecodes+8720, IF_SSE|IF_WESTMERE},
+    /* 1684 */ {I_AESDEC, 2, {XMMREG,RM_XMM|BITS128,0,0,0}, nasm_bytecodes+8727, IF_SSE|IF_WESTMERE},
+    /* 1685 */ {I_AESDECLAST, 2, {XMMREG,RM_XMM|BITS128,0,0,0}, nasm_bytecodes+8734, IF_SSE|IF_WESTMERE},
+    /* 1686 */ {I_AESIMC, 2, {XMMREG,RM_XMM|BITS128,0,0,0}, nasm_bytecodes+8741, IF_SSE|IF_WESTMERE},
+    /* 1687 */ {I_AESKEYGENASSIST, 3, {XMMREG,RM_XMM|BITS128,IMMEDIATE|BITS8,0,0}, nasm_bytecodes+6108, IF_SSE|IF_WESTMERE},
+    /* 1688 */ {I_VAESENC, 3, {XMMREG,XMMREG,RM_XMM|BITS128,0,0}, nasm_bytecodes+8748, IF_AVX|IF_SANDYBRIDGE},
+    /* 1689 */ {I_VAESENC, 2, {XMMREG,RM_XMM|BITS128,0,0,0}, nasm_bytecodes+8755, IF_AVX|IF_SANDYBRIDGE},
+    /* 1690 */ {I_VAESENCLAST, 3, {XMMREG,XMMREG,RM_XMM|BITS128,0,0}, nasm_bytecodes+8762, IF_AVX|IF_SANDYBRIDGE},
+    /* 1691 */ {I_VAESENCLAST, 2, {XMMREG,RM_XMM|BITS128,0,0,0}, nasm_bytecodes+8769, IF_AVX|IF_SANDYBRIDGE},
+    /* 1692 */ {I_VAESDEC, 3, {XMMREG,XMMREG,RM_XMM|BITS128,0,0}, nasm_bytecodes+8776, IF_AVX|IF_SANDYBRIDGE},
+    /* 1693 */ {I_VAESDEC, 2, {XMMREG,RM_XMM|BITS128,0,0,0}, nasm_bytecodes+8783, IF_AVX|IF_SANDYBRIDGE},
+    /* 1694 */ {I_VAESDECLAST, 3, {XMMREG,XMMREG,RM_XMM|BITS128,0,0}, nasm_bytecodes+8790, IF_AVX|IF_SANDYBRIDGE},
+    /* 1695 */ {I_VAESDECLAST, 2, {XMMREG,RM_XMM|BITS128,0,0,0}, nasm_bytecodes+8797, IF_AVX|IF_SANDYBRIDGE},
+    /* 1696 */ {I_VAESIMC, 2, {XMMREG,RM_XMM|BITS128,0,0,0}, nasm_bytecodes+8804, IF_AVX|IF_SANDYBRIDGE},
+    /* 1697 */ {I_VAESKEYGENASSIST, 3, {XMMREG,RM_XMM|BITS128,IMMEDIATE|BITS8,0,0}, nasm_bytecodes+6116, IF_AVX|IF_SANDYBRIDGE},
+    /* 1698 */ {I_VADDPD, 3, {XMMREG,XMMREG,RM_XMM|BITS128,0,0}, nasm_bytecodes+8811, IF_AVX|IF_SANDYBRIDGE},
+    /* 1699 */ {I_VADDPD, 2, {XMMREG,RM_XMM|BITS128,0,0,0}, nasm_bytecodes+8818, IF_AVX|IF_SANDYBRIDGE},
+    /* 1700 */ {I_VADDPD, 3, {YMMREG,YMMREG,RM_YMM|BITS256,0,0}, nasm_bytecodes+8825, IF_AVX|IF_SANDYBRIDGE},
+    /* 1701 */ {I_VADDPD, 2, {YMMREG,RM_YMM|BITS256,0,0,0}, nasm_bytecodes+8832, IF_AVX|IF_SANDYBRIDGE},
+    /* 1702 */ {I_VADDPS, 3, {XMMREG,XMMREG,RM_XMM|BITS128,0,0}, nasm_bytecodes+8839, IF_AVX|IF_SANDYBRIDGE},
+    /* 1703 */ {I_VADDPS, 2, {XMMREG,RM_XMM|BITS128,0,0,0}, nasm_bytecodes+8846, IF_AVX|IF_SANDYBRIDGE},
+    /* 1704 */ {I_VADDPS, 3, {YMMREG,YMMREG,RM_YMM|BITS256,0,0}, nasm_bytecodes+8853, IF_AVX|IF_SANDYBRIDGE},
+    /* 1705 */ {I_VADDPS, 2, {YMMREG,RM_YMM|BITS256,0,0,0}, nasm_bytecodes+8860, IF_AVX|IF_SANDYBRIDGE},
+    /* 1706 */ {I_VADDSD, 3, {XMMREG,XMMREG,RM_XMM|BITS64,0,0}, nasm_bytecodes+8867, IF_AVX|IF_SANDYBRIDGE},
+    /* 1707 */ {I_VADDSD, 2, {XMMREG,RM_XMM|BITS64,0,0,0}, nasm_bytecodes+8874, IF_AVX|IF_SANDYBRIDGE},
+    /* 1708 */ {I_VADDSS, 3, {XMMREG,XMMREG,RM_XMM|BITS32,0,0}, nasm_bytecodes+8881, IF_AVX|IF_SANDYBRIDGE},
+    /* 1709 */ {I_VADDSS, 2, {XMMREG,RM_XMM|BITS32,0,0,0}, nasm_bytecodes+8888, IF_AVX|IF_SANDYBRIDGE},
+    /* 1710 */ {I_VADDSUBPD, 3, {XMMREG,XMMREG,RM_XMM|BITS128,0,0}, nasm_bytecodes+8895, IF_AVX|IF_SANDYBRIDGE},
+    /* 1711 */ {I_VADDSUBPD, 2, {XMMREG,RM_XMM|BITS128,0,0,0}, nasm_bytecodes+8902, IF_AVX|IF_SANDYBRIDGE},
+    /* 1712 */ {I_VADDSUBPD, 3, {YMMREG,YMMREG,RM_YMM|BITS256,0,0}, nasm_bytecodes+8909, IF_AVX|IF_SANDYBRIDGE},
+    /* 1713 */ {I_VADDSUBPD, 2, {YMMREG,RM_YMM|BITS256,0,0,0}, nasm_bytecodes+8916, IF_AVX|IF_SANDYBRIDGE},
+    /* 1714 */ {I_VADDSUBPS, 3, {XMMREG,XMMREG,RM_XMM|BITS128,0,0}, nasm_bytecodes+8923, IF_AVX|IF_SANDYBRIDGE},
+    /* 1715 */ {I_VADDSUBPS, 2, {XMMREG,RM_XMM|BITS128,0,0,0}, nasm_bytecodes+8930, IF_AVX|IF_SANDYBRIDGE},
+    /* 1716 */ {I_VADDSUBPS, 3, {YMMREG,YMMREG,RM_YMM|BITS256,0,0}, nasm_bytecodes+8937, IF_AVX|IF_SANDYBRIDGE},
+    /* 1717 */ {I_VADDSUBPS, 2, {YMMREG,RM_YMM|BITS256,0,0,0}, nasm_bytecodes+8944, IF_AVX|IF_SANDYBRIDGE},
+    /* 1718 */ {I_VANDPD, 3, {XMMREG,XMMREG,RM_XMM|BITS128,0,0}, nasm_bytecodes+8951, IF_AVX|IF_SANDYBRIDGE},
+    /* 1719 */ {I_VANDPD, 2, {XMMREG,RM_XMM|BITS128,0,0,0}, nasm_bytecodes+8958, IF_AVX|IF_SANDYBRIDGE},
+    /* 1720 */ {I_VANDPD, 3, {YMMREG,YMMREG,RM_YMM|BITS256,0,0}, nasm_bytecodes+8965, IF_AVX|IF_SANDYBRIDGE},
+    /* 1721 */ {I_VANDPD, 2, {YMMREG,RM_YMM|BITS256,0,0,0}, nasm_bytecodes+8972, IF_AVX|IF_SANDYBRIDGE},
+    /* 1722 */ {I_VANDPS, 3, {XMMREG,XMMREG,RM_XMM|BITS128,0,0}, nasm_bytecodes+8979, IF_AVX|IF_SANDYBRIDGE},
+    /* 1723 */ {I_VANDPS, 2, {XMMREG,RM_XMM|BITS128,0,0,0}, nasm_bytecodes+8986, IF_AVX|IF_SANDYBRIDGE},
+    /* 1724 */ {I_VANDPS, 3, {YMMREG,YMMREG,RM_YMM|BITS256,0,0}, nasm_bytecodes+8993, IF_AVX|IF_SANDYBRIDGE},
+    /* 1725 */ {I_VANDPS, 2, {YMMREG,RM_YMM|BITS256,0,0,0}, nasm_bytecodes+9000, IF_AVX|IF_SANDYBRIDGE},
+    /* 1726 */ {I_VANDNPD, 3, {XMMREG,XMMREG,RM_XMM|BITS128,0,0}, nasm_bytecodes+9007, IF_AVX|IF_SANDYBRIDGE},
+    /* 1727 */ {I_VANDNPD, 2, {XMMREG,RM_XMM|BITS128,0,0,0}, nasm_bytecodes+9014, IF_AVX|IF_SANDYBRIDGE},
+    /* 1728 */ {I_VANDNPD, 3, {YMMREG,YMMREG,RM_YMM|BITS256,0,0}, nasm_bytecodes+9021, IF_AVX|IF_SANDYBRIDGE},
+    /* 1729 */ {I_VANDNPD, 2, {YMMREG,RM_YMM|BITS256,0,0,0}, nasm_bytecodes+9028, IF_AVX|IF_SANDYBRIDGE},
+    /* 1730 */ {I_VANDNPS, 3, {XMMREG,XMMREG,RM_XMM|BITS128,0,0}, nasm_bytecodes+9035, IF_AVX|IF_SANDYBRIDGE},
+    /* 1731 */ {I_VANDNPS, 2, {XMMREG,RM_XMM|BITS128,0,0,0}, nasm_bytecodes+9042, IF_AVX|IF_SANDYBRIDGE},
+    /* 1732 */ {I_VANDNPS, 3, {YMMREG,YMMREG,RM_YMM|BITS256,0,0}, nasm_bytecodes+9049, IF_AVX|IF_SANDYBRIDGE},
+    /* 1733 */ {I_VANDNPS, 2, {YMMREG,RM_YMM|BITS256,0,0,0}, nasm_bytecodes+9056, IF_AVX|IF_SANDYBRIDGE},
+    /* 1734 */ {I_VBLENDPD, 4, {XMMREG,XMMREG,RM_XMM|BITS128,IMMEDIATE|BITS8,0}, nasm_bytecodes+6124, IF_AVX|IF_SANDYBRIDGE},
+    /* 1735 */ {I_VBLENDPD, 3, {XMMREG,RM_XMM|BITS128,IMMEDIATE|BITS8,0,0}, nasm_bytecodes+6132, IF_AVX|IF_SANDYBRIDGE},
+    /* 1736 */ {I_VBLENDPD, 4, {YMMREG,YMMREG,RM_YMM|BITS256,IMMEDIATE|BITS8,0}, nasm_bytecodes+6140, IF_AVX|IF_SANDYBRIDGE},
+    /* 1737 */ {I_VBLENDPD, 3, {YMMREG,RM_YMM|BITS256,IMMEDIATE|BITS8,0,0}, nasm_bytecodes+6148, IF_AVX|IF_SANDYBRIDGE},
+    /* 1738 */ {I_VBLENDPS, 4, {XMMREG,XMMREG,RM_XMM|BITS128,IMMEDIATE|BITS8,0}, nasm_bytecodes+6156, IF_AVX|IF_SANDYBRIDGE},
+    /* 1739 */ {I_VBLENDPS, 3, {XMMREG,RM_XMM|BITS128,IMMEDIATE|BITS8,0,0}, nasm_bytecodes+6164, IF_AVX|IF_SANDYBRIDGE},
+    /* 1740 */ {I_VBLENDPS, 4, {YMMREG,YMMREG,RM_YMM|BITS256,IMMEDIATE|BITS8,0}, nasm_bytecodes+6172, IF_AVX|IF_SANDYBRIDGE},
+    /* 1741 */ {I_VBLENDPS, 3, {YMMREG,RM_YMM|BITS256,IMMEDIATE|BITS8,0,0}, nasm_bytecodes+6180, IF_AVX|IF_SANDYBRIDGE},
+    /* 1742 */ {I_VBLENDVPD, 4, {XMMREG,XMMREG,RM_XMM|BITS128,XMMREG,0}, nasm_bytecodes+54, IF_AVX|IF_SANDYBRIDGE},
+    /* 1743 */ {I_VBLENDVPD, 3, {XMMREG,RM_XMM|BITS128,XMM0,0,0}, nasm_bytecodes+9063, IF_AVX|IF_SANDYBRIDGE},
+    /* 1744 */ {I_VBLENDVPD, 4, {YMMREG,YMMREG,RM_YMM|BITS256,YMMREG,0}, nasm_bytecodes+63, IF_AVX|IF_SANDYBRIDGE},
+    /* 1745 */ {I_VBLENDVPD, 3, {YMMREG,RM_YMM|BITS256,YMM0,0,0}, nasm_bytecodes+9070, IF_AVX|IF_SANDYBRIDGE},
+    /* 1746 */ {I_VBLENDVPS, 4, {XMMREG,XMMREG,RM_XMM|BITS128,XMMREG,0}, nasm_bytecodes+72, IF_AVX|IF_SANDYBRIDGE},
+    /* 1747 */ {I_VBLENDVPS, 3, {XMMREG,RM_XMM|BITS128,XMM0,0,0}, nasm_bytecodes+9077, IF_AVX|IF_SANDYBRIDGE},
+    /* 1748 */ {I_VBLENDVPS, 4, {YMMREG,YMMREG,RM_YMM|BITS256,YMMREG,0}, nasm_bytecodes+81, IF_AVX|IF_SANDYBRIDGE},
+    /* 1749 */ {I_VBLENDVPD, 3, {YMMREG,RM_YMM|BITS256,YMM0,0,0}, nasm_bytecodes+9084, IF_AVX|IF_SANDYBRIDGE},
+    /* 1750 */ {I_VBROADCASTSS, 2, {XMMREG,MEMORY|BITS32,0,0,0}, nasm_bytecodes+9091, IF_AVX|IF_SANDYBRIDGE},
+    /* 1751 */ {I_VBROADCASTSS, 2, {YMMREG,MEMORY|BITS32,0,0,0}, nasm_bytecodes+9098, IF_AVX|IF_SANDYBRIDGE},
+    /* 1752 */ {I_VBROADCASTSD, 2, {YMMREG,MEMORY|BITS64,0,0,0}, nasm_bytecodes+9105, IF_AVX|IF_SANDYBRIDGE},
+    /* 1753 */ {I_VBROADCASTF128, 2, {YMMREG,MEMORY|BITS128,0,0,0}, nasm_bytecodes+9112, IF_AVX|IF_SANDYBRIDGE},
+    /* 1754 */ {I_VCMPEQPD, 3, {XMMREG,XMMREG,RM_XMM|BITS128,0,0}, nasm_bytecodes+90, IF_AVX|IF_SANDYBRIDGE},
+    /* 1755 */ {I_VCMPEQPD, 2, {XMMREG,RM_XMM|BITS128,0,0,0}, nasm_bytecodes+99, IF_AVX|IF_SANDYBRIDGE},
+    /* 1756 */ {I_VCMPEQPD, 3, {YMMREG,YMMREG,RM_YMM|BITS256,0,0}, nasm_bytecodes+108, IF_AVX|IF_SANDYBRIDGE},
+    /* 1757 */ {I_VCMPEQPD, 2, {YMMREG,RM_YMM|BITS256,0,0,0}, nasm_bytecodes+117, IF_AVX|IF_SANDYBRIDGE},
+    /* 1758 */ {I_VCMPLTPD, 3, {XMMREG,XMMREG,RM_XMM|BITS128,0,0}, nasm_bytecodes+126, IF_AVX|IF_SANDYBRIDGE},
+    /* 1759 */ {I_VCMPLTPD, 2, {XMMREG,RM_XMM|BITS128,0,0,0}, nasm_bytecodes+135, IF_AVX|IF_SANDYBRIDGE},
+    /* 1760 */ {I_VCMPLTPD, 3, {YMMREG,YMMREG,RM_YMM|BITS256,0,0}, nasm_bytecodes+144, IF_AVX|IF_SANDYBRIDGE},
+    /* 1761 */ {I_VCMPLTPD, 2, {YMMREG,RM_YMM|BITS256,0,0,0}, nasm_bytecodes+153, IF_AVX|IF_SANDYBRIDGE},
+    /* 1762 */ {I_VCMPLEPD, 3, {XMMREG,XMMREG,RM_XMM|BITS128,0,0}, nasm_bytecodes+162, IF_AVX|IF_SANDYBRIDGE},
+    /* 1763 */ {I_VCMPLEPD, 2, {XMMREG,RM_XMM|BITS128,0,0,0}, nasm_bytecodes+171, IF_AVX|IF_SANDYBRIDGE},
+    /* 1764 */ {I_VCMPLEPD, 3, {YMMREG,YMMREG,RM_YMM|BITS256,0,0}, nasm_bytecodes+180, IF_AVX|IF_SANDYBRIDGE},
+    /* 1765 */ {I_VCMPLEPD, 2, {YMMREG,RM_YMM|BITS256,0,0,0}, nasm_bytecodes+189, IF_AVX|IF_SANDYBRIDGE},
+    /* 1766 */ {I_VCMPUNORDPD, 3, {XMMREG,XMMREG,RM_XMM|BITS128,0,0}, nasm_bytecodes+198, IF_AVX|IF_SANDYBRIDGE},
+    /* 1767 */ {I_VCMPUNORDPD, 2, {XMMREG,RM_XMM|BITS128,0,0,0}, nasm_bytecodes+207, IF_AVX|IF_SANDYBRIDGE},
+    /* 1768 */ {I_VCMPUNORDPD, 3, {YMMREG,YMMREG,RM_YMM|BITS256,0,0}, nasm_bytecodes+216, IF_AVX|IF_SANDYBRIDGE},
+    /* 1769 */ {I_VCMPUNORDPD, 2, {YMMREG,RM_YMM|BITS256,0,0,0}, nasm_bytecodes+225, IF_AVX|IF_SANDYBRIDGE},
+    /* 1770 */ {I_VCMPNEQPD, 3, {XMMREG,XMMREG,RM_XMM|BITS128,0,0}, nasm_bytecodes+234, IF_AVX|IF_SANDYBRIDGE},
+    /* 1771 */ {I_VCMPNEQPD, 2, {XMMREG,RM_XMM|BITS128,0,0,0}, nasm_bytecodes+243, IF_AVX|IF_SANDYBRIDGE},
+    /* 1772 */ {I_VCMPNEQPD, 3, {YMMREG,YMMREG,RM_YMM|BITS256,0,0}, nasm_bytecodes+252, IF_AVX|IF_SANDYBRIDGE},
+    /* 1773 */ {I_VCMPNEQPD, 2, {YMMREG,RM_YMM|BITS256,0,0,0}, nasm_bytecodes+261, IF_AVX|IF_SANDYBRIDGE},
+    /* 1774 */ {I_VCMPNLTPD, 3, {XMMREG,XMMREG,RM_XMM|BITS128,0,0}, nasm_bytecodes+270, IF_AVX|IF_SANDYBRIDGE},
+    /* 1775 */ {I_VCMPNLTPD, 2, {XMMREG,RM_XMM|BITS128,0,0,0}, nasm_bytecodes+279, IF_AVX|IF_SANDYBRIDGE},
+    /* 1776 */ {I_VCMPNLTPD, 3, {YMMREG,YMMREG,RM_YMM|BITS256,0,0}, nasm_bytecodes+288, IF_AVX|IF_SANDYBRIDGE},
+    /* 1777 */ {I_VCMPNLTPD, 2, {YMMREG,RM_YMM|BITS256,0,0,0}, nasm_bytecodes+297, IF_AVX|IF_SANDYBRIDGE},
+    /* 1778 */ {I_VCMPNLEPD, 3, {XMMREG,XMMREG,RM_XMM|BITS128,0,0}, nasm_bytecodes+306, IF_AVX|IF_SANDYBRIDGE},
+    /* 1779 */ {I_VCMPNLEPD, 2, {XMMREG,RM_XMM|BITS128,0,0,0}, nasm_bytecodes+315, IF_AVX|IF_SANDYBRIDGE},
+    /* 1780 */ {I_VCMPNLEPD, 3, {YMMREG,YMMREG,RM_YMM|BITS256,0,0}, nasm_bytecodes+324, IF_AVX|IF_SANDYBRIDGE},
+    /* 1781 */ {I_VCMPNLEPD, 2, {YMMREG,RM_YMM|BITS256,0,0,0}, nasm_bytecodes+333, IF_AVX|IF_SANDYBRIDGE},
+    /* 1782 */ {I_VCMPORDPD, 3, {XMMREG,XMMREG,RM_XMM|BITS128,0,0}, nasm_bytecodes+342, IF_AVX|IF_SANDYBRIDGE},
+    /* 1783 */ {I_VCMPORDPD, 2, {XMMREG,RM_XMM|BITS128,0,0,0}, nasm_bytecodes+351, IF_AVX|IF_SANDYBRIDGE},
+    /* 1784 */ {I_VCMPORDPD, 3, {YMMREG,YMMREG,RM_YMM|BITS256,0,0}, nasm_bytecodes+360, IF_AVX|IF_SANDYBRIDGE},
+    /* 1785 */ {I_VCMPORDPD, 2, {YMMREG,RM_YMM|BITS256,0,0,0}, nasm_bytecodes+369, IF_AVX|IF_SANDYBRIDGE},
+    /* 1786 */ {I_VCMPEQ_UQPD, 3, {XMMREG,XMMREG,RM_XMM|BITS128,0,0}, nasm_bytecodes+378, IF_AVX|IF_SANDYBRIDGE},
+    /* 1787 */ {I_VCMPEQ_UQPD, 2, {XMMREG,RM_XMM|BITS128,0,0,0}, nasm_bytecodes+387, IF_AVX|IF_SANDYBRIDGE},
+    /* 1788 */ {I_VCMPEQ_UQPD, 3, {YMMREG,YMMREG,RM_YMM|BITS256,0,0}, nasm_bytecodes+396, IF_AVX|IF_SANDYBRIDGE},
+    /* 1789 */ {I_VCMPEQ_UQPD, 2, {YMMREG,RM_YMM|BITS256,0,0,0}, nasm_bytecodes+405, IF_AVX|IF_SANDYBRIDGE},
+    /* 1790 */ {I_VCMPNGEPD, 3, {XMMREG,XMMREG,RM_XMM|BITS128,0,0}, nasm_bytecodes+414, IF_AVX|IF_SANDYBRIDGE},
+    /* 1791 */ {I_VCMPNGEPD, 2, {XMMREG,RM_XMM|BITS128,0,0,0}, nasm_bytecodes+423, IF_AVX|IF_SANDYBRIDGE},
+    /* 1792 */ {I_VCMPNGEPD, 3, {YMMREG,YMMREG,RM_YMM|BITS256,0,0}, nasm_bytecodes+432, IF_AVX|IF_SANDYBRIDGE},
+    /* 1793 */ {I_VCMPNGEPD, 2, {YMMREG,RM_YMM|BITS256,0,0,0}, nasm_bytecodes+441, IF_AVX|IF_SANDYBRIDGE},
+    /* 1794 */ {I_VCMPNGTPD, 3, {XMMREG,XMMREG,RM_XMM|BITS128,0,0}, nasm_bytecodes+450, IF_AVX|IF_SANDYBRIDGE},
+    /* 1795 */ {I_VCMPNGTPD, 2, {XMMREG,RM_XMM|BITS128,0,0,0}, nasm_bytecodes+459, IF_AVX|IF_SANDYBRIDGE},
+    /* 1796 */ {I_VCMPNGTPD, 3, {YMMREG,YMMREG,RM_YMM|BITS256,0,0}, nasm_bytecodes+468, IF_AVX|IF_SANDYBRIDGE},
+    /* 1797 */ {I_VCMPNGTPD, 2, {YMMREG,RM_YMM|BITS256,0,0,0}, nasm_bytecodes+477, IF_AVX|IF_SANDYBRIDGE},
+    /* 1798 */ {I_VCMPFALSEPD, 3, {XMMREG,XMMREG,RM_XMM|BITS128,0,0}, nasm_bytecodes+486, IF_AVX|IF_SANDYBRIDGE},
+    /* 1799 */ {I_VCMPFALSEPD, 2, {XMMREG,RM_XMM|BITS128,0,0,0}, nasm_bytecodes+495, IF_AVX|IF_SANDYBRIDGE},
+    /* 1800 */ {I_VCMPFALSEPD, 3, {YMMREG,YMMREG,RM_YMM|BITS256,0,0}, nasm_bytecodes+504, IF_AVX|IF_SANDYBRIDGE},
+    /* 1801 */ {I_VCMPFALSEPD, 2, {YMMREG,RM_YMM|BITS256,0,0,0}, nasm_bytecodes+513, IF_AVX|IF_SANDYBRIDGE},
+    /* 1802 */ {I_VCMPNEQ_OQPD, 3, {XMMREG,XMMREG,RM_XMM|BITS128,0,0}, nasm_bytecodes+522, IF_AVX|IF_SANDYBRIDGE},
+    /* 1803 */ {I_VCMPNEQ_OQPD, 2, {XMMREG,RM_XMM|BITS128,0,0,0}, nasm_bytecodes+531, IF_AVX|IF_SANDYBRIDGE},
+    /* 1804 */ {I_VCMPNEQ_OQPD, 3, {YMMREG,YMMREG,RM_YMM|BITS256,0,0}, nasm_bytecodes+540, IF_AVX|IF_SANDYBRIDGE},
+    /* 1805 */ {I_VCMPNEQ_OQPD, 2, {YMMREG,RM_YMM|BITS256,0,0,0}, nasm_bytecodes+549, IF_AVX|IF_SANDYBRIDGE},
+    /* 1806 */ {I_VCMPGEPD, 3, {XMMREG,XMMREG,RM_XMM|BITS128,0,0}, nasm_bytecodes+558, IF_AVX|IF_SANDYBRIDGE},
+    /* 1807 */ {I_VCMPGEPD, 2, {XMMREG,RM_XMM|BITS128,0,0,0}, nasm_bytecodes+567, IF_AVX|IF_SANDYBRIDGE},
+    /* 1808 */ {I_VCMPGEPD, 3, {YMMREG,YMMREG,RM_YMM|BITS256,0,0}, nasm_bytecodes+576, IF_AVX|IF_SANDYBRIDGE},
+    /* 1809 */ {I_VCMPGEPD, 2, {YMMREG,RM_YMM|BITS256,0,0,0}, nasm_bytecodes+585, IF_AVX|IF_SANDYBRIDGE},
+    /* 1810 */ {I_VCMPGTPD, 3, {XMMREG,XMMREG,RM_XMM|BITS128,0,0}, nasm_bytecodes+594, IF_AVX|IF_SANDYBRIDGE},
+    /* 1811 */ {I_VCMPGTPD, 2, {XMMREG,RM_XMM|BITS128,0,0,0}, nasm_bytecodes+603, IF_AVX|IF_SANDYBRIDGE},
+    /* 1812 */ {I_VCMPGTPD, 3, {YMMREG,YMMREG,RM_YMM|BITS256,0,0}, nasm_bytecodes+612, IF_AVX|IF_SANDYBRIDGE},
+    /* 1813 */ {I_VCMPGTPD, 2, {YMMREG,RM_YMM|BITS256,0,0,0}, nasm_bytecodes+621, IF_AVX|IF_SANDYBRIDGE},
+    /* 1814 */ {I_VCMPTRUEPD, 3, {XMMREG,XMMREG,RM_XMM|BITS128,0,0}, nasm_bytecodes+630, IF_AVX|IF_SANDYBRIDGE},
+    /* 1815 */ {I_VCMPTRUEPD, 2, {XMMREG,RM_XMM|BITS128,0,0,0}, nasm_bytecodes+639, IF_AVX|IF_SANDYBRIDGE},
+    /* 1816 */ {I_VCMPTRUEPD, 3, {YMMREG,YMMREG,RM_YMM|BITS256,0,0}, nasm_bytecodes+648, IF_AVX|IF_SANDYBRIDGE},
+    /* 1817 */ {I_VCMPTRUEPD, 2, {YMMREG,RM_YMM|BITS256,0,0,0}, nasm_bytecodes+657, IF_AVX|IF_SANDYBRIDGE},
+    /* 1818 */ {I_VCMPEQ_OSPD, 3, {XMMREG,XMMREG,RM_XMM|BITS128,0,0}, nasm_bytecodes+666, IF_AVX|IF_SANDYBRIDGE},
+    /* 1819 */ {I_VCMPEQ_OSPD, 2, {XMMREG,RM_XMM|BITS128,0,0,0}, nasm_bytecodes+675, IF_AVX|IF_SANDYBRIDGE},
+    /* 1820 */ {I_VCMPEQ_OSPD, 3, {YMMREG,YMMREG,RM_YMM|BITS256,0,0}, nasm_bytecodes+684, IF_AVX|IF_SANDYBRIDGE},
+    /* 1821 */ {I_VCMPEQ_OSPD, 2, {YMMREG,RM_YMM|BITS256,0,0,0}, nasm_bytecodes+693, IF_AVX|IF_SANDYBRIDGE},
+    /* 1822 */ {I_VCMPLT_OQPD, 3, {XMMREG,XMMREG,RM_XMM|BITS128,0,0}, nasm_bytecodes+702, IF_AVX|IF_SANDYBRIDGE},
+    /* 1823 */ {I_VCMPLT_OQPD, 2, {XMMREG,RM_XMM|BITS128,0,0,0}, nasm_bytecodes+711, IF_AVX|IF_SANDYBRIDGE},
+    /* 1824 */ {I_VCMPLT_OQPD, 3, {YMMREG,YMMREG,RM_YMM|BITS256,0,0}, nasm_bytecodes+720, IF_AVX|IF_SANDYBRIDGE},
+    /* 1825 */ {I_VCMPLT_OQPD, 2, {YMMREG,RM_YMM|BITS256,0,0,0}, nasm_bytecodes+729, IF_AVX|IF_SANDYBRIDGE},
+    /* 1826 */ {I_VCMPLE_OQPD, 3, {XMMREG,XMMREG,RM_XMM|BITS128,0,0}, nasm_bytecodes+738, IF_AVX|IF_SANDYBRIDGE},
+    /* 1827 */ {I_VCMPLE_OQPD, 2, {XMMREG,RM_XMM|BITS128,0,0,0}, nasm_bytecodes+747, IF_AVX|IF_SANDYBRIDGE},
+    /* 1828 */ {I_VCMPLE_OQPD, 3, {YMMREG,YMMREG,RM_YMM|BITS256,0,0}, nasm_bytecodes+756, IF_AVX|IF_SANDYBRIDGE},
+    /* 1829 */ {I_VCMPLE_OQPD, 2, {YMMREG,RM_YMM|BITS256,0,0,0}, nasm_bytecodes+765, IF_AVX|IF_SANDYBRIDGE},
+    /* 1830 */ {I_VCMPUNORD_SPD, 3, {XMMREG,XMMREG,RM_XMM|BITS128,0,0}, nasm_bytecodes+774, IF_AVX|IF_SANDYBRIDGE},
+    /* 1831 */ {I_VCMPUNORD_SPD, 2, {XMMREG,RM_XMM|BITS128,0,0,0}, nasm_bytecodes+783, IF_AVX|IF_SANDYBRIDGE},
+    /* 1832 */ {I_VCMPUNORD_SPD, 3, {YMMREG,YMMREG,RM_YMM|BITS256,0,0}, nasm_bytecodes+792, IF_AVX|IF_SANDYBRIDGE},
+    /* 1833 */ {I_VCMPUNORD_SPD, 2, {YMMREG,RM_YMM|BITS256,0,0,0}, nasm_bytecodes+801, IF_AVX|IF_SANDYBRIDGE},
+    /* 1834 */ {I_VCMPNEQ_USPD, 3, {XMMREG,XMMREG,RM_XMM|BITS128,0,0}, nasm_bytecodes+810, IF_AVX|IF_SANDYBRIDGE},
+    /* 1835 */ {I_VCMPNEQ_USPD, 2, {XMMREG,RM_XMM|BITS128,0,0,0}, nasm_bytecodes+819, IF_AVX|IF_SANDYBRIDGE},
+    /* 1836 */ {I_VCMPNEQ_USPD, 3, {YMMREG,YMMREG,RM_YMM|BITS256,0,0}, nasm_bytecodes+828, IF_AVX|IF_SANDYBRIDGE},
+    /* 1837 */ {I_VCMPNEQ_USPD, 2, {YMMREG,RM_YMM|BITS256,0,0,0}, nasm_bytecodes+837, IF_AVX|IF_SANDYBRIDGE},
+    /* 1838 */ {I_VCMPNLT_UQPD, 3, {XMMREG,XMMREG,RM_XMM|BITS128,0,0}, nasm_bytecodes+846, IF_AVX|IF_SANDYBRIDGE},
+    /* 1839 */ {I_VCMPNLT_UQPD, 2, {XMMREG,RM_XMM|BITS128,0,0,0}, nasm_bytecodes+855, IF_AVX|IF_SANDYBRIDGE},
+    /* 1840 */ {I_VCMPNLT_UQPD, 3, {YMMREG,YMMREG,RM_YMM|BITS256,0,0}, nasm_bytecodes+864, IF_AVX|IF_SANDYBRIDGE},
+    /* 1841 */ {I_VCMPNLT_UQPD, 2, {YMMREG,RM_YMM|BITS256,0,0,0}, nasm_bytecodes+873, IF_AVX|IF_SANDYBRIDGE},
+    /* 1842 */ {I_VCMPNLE_UQPD, 3, {XMMREG,XMMREG,RM_XMM|BITS128,0,0}, nasm_bytecodes+882, IF_AVX|IF_SANDYBRIDGE},
+    /* 1843 */ {I_VCMPNLE_UQPD, 2, {XMMREG,RM_XMM|BITS128,0,0,0}, nasm_bytecodes+891, IF_AVX|IF_SANDYBRIDGE},
+    /* 1844 */ {I_VCMPNLE_UQPD, 3, {YMMREG,YMMREG,RM_YMM|BITS256,0,0}, nasm_bytecodes+900, IF_AVX|IF_SANDYBRIDGE},
+    /* 1845 */ {I_VCMPNLE_UQPD, 2, {YMMREG,RM_YMM|BITS256,0,0,0}, nasm_bytecodes+909, IF_AVX|IF_SANDYBRIDGE},
+    /* 1846 */ {I_VCMPORD_SPD, 3, {XMMREG,XMMREG,RM_XMM|BITS128,0,0}, nasm_bytecodes+918, IF_AVX|IF_SANDYBRIDGE},
+    /* 1847 */ {I_VCMPORD_SPD, 2, {XMMREG,RM_XMM|BITS128,0,0,0}, nasm_bytecodes+927, IF_AVX|IF_SANDYBRIDGE},
+    /* 1848 */ {I_VCMPORD_SPD, 3, {YMMREG,YMMREG,RM_YMM|BITS256,0,0}, nasm_bytecodes+936, IF_AVX|IF_SANDYBRIDGE},
+    /* 1849 */ {I_VCMPORD_SPD, 2, {YMMREG,RM_YMM|BITS256,0,0,0}, nasm_bytecodes+945, IF_AVX|IF_SANDYBRIDGE},
+    /* 1850 */ {I_VCMPEQ_USPD, 3, {XMMREG,XMMREG,RM_XMM|BITS128,0,0}, nasm_bytecodes+954, IF_AVX|IF_SANDYBRIDGE},
+    /* 1851 */ {I_VCMPEQ_USPD, 2, {XMMREG,RM_XMM|BITS128,0,0,0}, nasm_bytecodes+963, IF_AVX|IF_SANDYBRIDGE},
+    /* 1852 */ {I_VCMPEQ_USPD, 3, {YMMREG,YMMREG,RM_YMM|BITS256,0,0}, nasm_bytecodes+972, IF_AVX|IF_SANDYBRIDGE},
+    /* 1853 */ {I_VCMPEQ_USPD, 2, {YMMREG,RM_YMM|BITS256,0,0,0}, nasm_bytecodes+981, IF_AVX|IF_SANDYBRIDGE},
+    /* 1854 */ {I_VCMPNGE_UQPD, 3, {XMMREG,XMMREG,RM_XMM|BITS128,0,0}, nasm_bytecodes+990, IF_AVX|IF_SANDYBRIDGE},
+    /* 1855 */ {I_VCMPNGE_UQPD, 2, {XMMREG,RM_XMM|BITS128,0,0,0}, nasm_bytecodes+999, IF_AVX|IF_SANDYBRIDGE},
+    /* 1856 */ {I_VCMPNGE_UQPD, 3, {YMMREG,YMMREG,RM_YMM|BITS256,0,0}, nasm_bytecodes+1008, IF_AVX|IF_SANDYBRIDGE},
+    /* 1857 */ {I_VCMPNGE_UQPD, 2, {YMMREG,RM_YMM|BITS256,0,0,0}, nasm_bytecodes+1017, IF_AVX|IF_SANDYBRIDGE},
+    /* 1858 */ {I_VCMPNGT_UQPD, 3, {XMMREG,XMMREG,RM_XMM|BITS128,0,0}, nasm_bytecodes+1026, IF_AVX|IF_SANDYBRIDGE},
+    /* 1859 */ {I_VCMPNGT_UQPD, 2, {XMMREG,RM_XMM|BITS128,0,0,0}, nasm_bytecodes+1035, IF_AVX|IF_SANDYBRIDGE},
+    /* 1860 */ {I_VCMPNGT_UQPD, 3, {YMMREG,YMMREG,RM_YMM|BITS256,0,0}, nasm_bytecodes+1044, IF_AVX|IF_SANDYBRIDGE},
+    /* 1861 */ {I_VCMPNGT_UQPD, 2, {YMMREG,RM_YMM|BITS256,0,0,0}, nasm_bytecodes+1053, IF_AVX|IF_SANDYBRIDGE},
+    /* 1862 */ {I_VCMPFALSE_OSPD, 3, {XMMREG,XMMREG,RM_XMM|BITS128,0,0}, nasm_bytecodes+1062, IF_AVX|IF_SANDYBRIDGE},
+    /* 1863 */ {I_VCMPFALSE_OSPD, 2, {XMMREG,RM_XMM|BITS128,0,0,0}, nasm_bytecodes+1071, IF_AVX|IF_SANDYBRIDGE},
+    /* 1864 */ {I_VCMPFALSE_OSPD, 3, {YMMREG,YMMREG,RM_YMM|BITS256,0,0}, nasm_bytecodes+1080, IF_AVX|IF_SANDYBRIDGE},
+    /* 1865 */ {I_VCMPFALSE_OSPD, 2, {YMMREG,RM_YMM|BITS256,0,0,0}, nasm_bytecodes+1089, IF_AVX|IF_SANDYBRIDGE},
+    /* 1866 */ {I_VCMPNEQ_OSPD, 3, {XMMREG,XMMREG,RM_XMM|BITS128,0,0}, nasm_bytecodes+1098, IF_AVX|IF_SANDYBRIDGE},
+    /* 1867 */ {I_VCMPNEQ_OSPD, 2, {XMMREG,RM_XMM|BITS128,0,0,0}, nasm_bytecodes+1107, IF_AVX|IF_SANDYBRIDGE},
+    /* 1868 */ {I_VCMPNEQ_OSPD, 3, {YMMREG,YMMREG,RM_YMM|BITS256,0,0}, nasm_bytecodes+1116, IF_AVX|IF_SANDYBRIDGE},
+    /* 1869 */ {I_VCMPNEQ_OSPD, 2, {YMMREG,RM_YMM|BITS256,0,0,0}, nasm_bytecodes+1125, IF_AVX|IF_SANDYBRIDGE},
+    /* 1870 */ {I_VCMPGE_OQPD, 3, {XMMREG,XMMREG,RM_XMM|BITS128,0,0}, nasm_bytecodes+1134, IF_AVX|IF_SANDYBRIDGE},
+    /* 1871 */ {I_VCMPGE_OQPD, 2, {XMMREG,RM_XMM|BITS128,0,0,0}, nasm_bytecodes+1143, IF_AVX|IF_SANDYBRIDGE},
+    /* 1872 */ {I_VCMPGE_OQPD, 3, {YMMREG,YMMREG,RM_YMM|BITS256,0,0}, nasm_bytecodes+1152, IF_AVX|IF_SANDYBRIDGE},
+    /* 1873 */ {I_VCMPGE_OQPD, 2, {YMMREG,RM_YMM|BITS256,0,0,0}, nasm_bytecodes+1161, IF_AVX|IF_SANDYBRIDGE},
+    /* 1874 */ {I_VCMPGT_OQPD, 3, {XMMREG,XMMREG,RM_XMM|BITS128,0,0}, nasm_bytecodes+1170, IF_AVX|IF_SANDYBRIDGE},
+    /* 1875 */ {I_VCMPGT_OQPD, 2, {XMMREG,RM_XMM|BITS128,0,0,0}, nasm_bytecodes+1179, IF_AVX|IF_SANDYBRIDGE},
+    /* 1876 */ {I_VCMPGT_OQPD, 3, {YMMREG,YMMREG,RM_YMM|BITS256,0,0}, nasm_bytecodes+1188, IF_AVX|IF_SANDYBRIDGE},
+    /* 1877 */ {I_VCMPGT_OQPD, 2, {YMMREG,RM_YMM|BITS256,0,0,0}, nasm_bytecodes+1197, IF_AVX|IF_SANDYBRIDGE},
+    /* 1878 */ {I_VCMPTRUE_USPD, 3, {XMMREG,XMMREG,RM_XMM|BITS128,0,0}, nasm_bytecodes+1206, IF_AVX|IF_SANDYBRIDGE},
+    /* 1879 */ {I_VCMPTRUE_USPD, 2, {XMMREG,RM_XMM|BITS128,0,0,0}, nasm_bytecodes+1215, IF_AVX|IF_SANDYBRIDGE},
+    /* 1880 */ {I_VCMPTRUE_USPD, 3, {YMMREG,YMMREG,RM_YMM|BITS256,0,0}, nasm_bytecodes+1224, IF_AVX|IF_SANDYBRIDGE},
+    /* 1881 */ {I_VCMPTRUE_USPD, 2, {YMMREG,RM_YMM|BITS256,0,0,0}, nasm_bytecodes+1233, IF_AVX|IF_SANDYBRIDGE},
+    /* 1882 */ {I_VCMPPD, 4, {XMMREG,XMMREG,RM_XMM|BITS128,IMMEDIATE|BITS8,0}, nasm_bytecodes+6188, IF_AVX|IF_SANDYBRIDGE},
+    /* 1883 */ {I_VCMPPD, 3, {XMMREG,RM_XMM|BITS128,IMMEDIATE|BITS8,0,0}, nasm_bytecodes+6196, IF_AVX|IF_SANDYBRIDGE},
+    /* 1884 */ {I_VCMPPD, 4, {YMMREG,YMMREG,RM_YMM|BITS256,IMMEDIATE|BITS8,0}, nasm_bytecodes+6204, IF_AVX|IF_SANDYBRIDGE},
+    /* 1885 */ {I_VCMPPD, 3, {YMMREG,RM_YMM|BITS256,IMMEDIATE|BITS8,0,0}, nasm_bytecodes+6212, IF_AVX|IF_SANDYBRIDGE},
+    /* 1886 */ {I_VCMPEQPS, 3, {XMMREG,XMMREG,RM_XMM|BITS128,0,0}, nasm_bytecodes+1242, IF_AVX|IF_SANDYBRIDGE},
+    /* 1887 */ {I_VCMPEQPS, 2, {XMMREG,RM_XMM|BITS128,0,0,0}, nasm_bytecodes+1251, IF_AVX|IF_SANDYBRIDGE},
+    /* 1888 */ {I_VCMPEQPS, 3, {YMMREG,YMMREG,RM_YMM|BITS256,0,0}, nasm_bytecodes+1260, IF_AVX|IF_SANDYBRIDGE},
+    /* 1889 */ {I_VCMPEQPS, 2, {YMMREG,RM_YMM|BITS256,0,0,0}, nasm_bytecodes+1269, IF_AVX|IF_SANDYBRIDGE},
+    /* 1890 */ {I_VCMPLTPS, 3, {XMMREG,XMMREG,RM_XMM|BITS128,0,0}, nasm_bytecodes+1278, IF_AVX|IF_SANDYBRIDGE},
+    /* 1891 */ {I_VCMPLTPS, 2, {XMMREG,RM_XMM|BITS128,0,0,0}, nasm_bytecodes+1287, IF_AVX|IF_SANDYBRIDGE},
+    /* 1892 */ {I_VCMPLTPS, 3, {YMMREG,YMMREG,RM_YMM|BITS256,0,0}, nasm_bytecodes+1296, IF_AVX|IF_SANDYBRIDGE},
+    /* 1893 */ {I_VCMPLTPS, 2, {YMMREG,RM_YMM|BITS256,0,0,0}, nasm_bytecodes+1305, IF_AVX|IF_SANDYBRIDGE},
+    /* 1894 */ {I_VCMPLEPS, 3, {XMMREG,XMMREG,RM_XMM|BITS128,0,0}, nasm_bytecodes+1314, IF_AVX|IF_SANDYBRIDGE},
+    /* 1895 */ {I_VCMPLEPS, 2, {XMMREG,RM_XMM|BITS128,0,0,0}, nasm_bytecodes+1323, IF_AVX|IF_SANDYBRIDGE},
+    /* 1896 */ {I_VCMPLEPS, 3, {YMMREG,YMMREG,RM_YMM|BITS256,0,0}, nasm_bytecodes+1332, IF_AVX|IF_SANDYBRIDGE},
+    /* 1897 */ {I_VCMPLEPS, 2, {YMMREG,RM_YMM|BITS256,0,0,0}, nasm_bytecodes+1341, IF_AVX|IF_SANDYBRIDGE},
+    /* 1898 */ {I_VCMPUNORDPS, 3, {XMMREG,XMMREG,RM_XMM|BITS128,0,0}, nasm_bytecodes+1350, IF_AVX|IF_SANDYBRIDGE},
+    /* 1899 */ {I_VCMPUNORDPS, 2, {XMMREG,RM_XMM|BITS128,0,0,0}, nasm_bytecodes+1359, IF_AVX|IF_SANDYBRIDGE},
+    /* 1900 */ {I_VCMPUNORDPS, 3, {YMMREG,YMMREG,RM_YMM|BITS256,0,0}, nasm_bytecodes+1368, IF_AVX|IF_SANDYBRIDGE},
+    /* 1901 */ {I_VCMPUNORDPS, 2, {YMMREG,RM_YMM|BITS256,0,0,0}, nasm_bytecodes+1377, IF_AVX|IF_SANDYBRIDGE},
+    /* 1902 */ {I_VCMPNEQPS, 3, {XMMREG,XMMREG,RM_XMM|BITS128,0,0}, nasm_bytecodes+1386, IF_AVX|IF_SANDYBRIDGE},
+    /* 1903 */ {I_VCMPNEQPS, 2, {XMMREG,RM_XMM|BITS128,0,0,0}, nasm_bytecodes+1395, IF_AVX|IF_SANDYBRIDGE},
+    /* 1904 */ {I_VCMPNEQPS, 3, {YMMREG,YMMREG,RM_YMM|BITS256,0,0}, nasm_bytecodes+1404, IF_AVX|IF_SANDYBRIDGE},
+    /* 1905 */ {I_VCMPNEQPS, 2, {YMMREG,RM_YMM|BITS256,0,0,0}, nasm_bytecodes+1413, IF_AVX|IF_SANDYBRIDGE},
+    /* 1906 */ {I_VCMPNLTPS, 3, {XMMREG,XMMREG,RM_XMM|BITS128,0,0}, nasm_bytecodes+1422, IF_AVX|IF_SANDYBRIDGE},
+    /* 1907 */ {I_VCMPNLTPS, 2, {XMMREG,RM_XMM|BITS128,0,0,0}, nasm_bytecodes+1431, IF_AVX|IF_SANDYBRIDGE},
+    /* 1908 */ {I_VCMPNLTPS, 3, {YMMREG,YMMREG,RM_YMM|BITS256,0,0}, nasm_bytecodes+1440, IF_AVX|IF_SANDYBRIDGE},
+    /* 1909 */ {I_VCMPNLTPS, 2, {YMMREG,RM_YMM|BITS256,0,0,0}, nasm_bytecodes+1449, IF_AVX|IF_SANDYBRIDGE},
+    /* 1910 */ {I_VCMPNLEPS, 3, {XMMREG,XMMREG,RM_XMM|BITS128,0,0}, nasm_bytecodes+1458, IF_AVX|IF_SANDYBRIDGE},
+    /* 1911 */ {I_VCMPNLEPS, 2, {XMMREG,RM_XMM|BITS128,0,0,0}, nasm_bytecodes+1467, IF_AVX|IF_SANDYBRIDGE},
+    /* 1912 */ {I_VCMPNLEPS, 3, {YMMREG,YMMREG,RM_YMM|BITS256,0,0}, nasm_bytecodes+1476, IF_AVX|IF_SANDYBRIDGE},
+    /* 1913 */ {I_VCMPNLEPS, 2, {YMMREG,RM_YMM|BITS256,0,0,0}, nasm_bytecodes+1485, IF_AVX|IF_SANDYBRIDGE},
+    /* 1914 */ {I_VCMPORDPS, 3, {XMMREG,XMMREG,RM_XMM|BITS128,0,0}, nasm_bytecodes+1494, IF_AVX|IF_SANDYBRIDGE},
+    /* 1915 */ {I_VCMPORDPS, 2, {XMMREG,RM_XMM|BITS128,0,0,0}, nasm_bytecodes+1503, IF_AVX|IF_SANDYBRIDGE},
+    /* 1916 */ {I_VCMPORDPS, 3, {YMMREG,YMMREG,RM_YMM|BITS256,0,0}, nasm_bytecodes+1512, IF_AVX|IF_SANDYBRIDGE},
+    /* 1917 */ {I_VCMPORDPS, 2, {YMMREG,RM_YMM|BITS256,0,0,0}, nasm_bytecodes+1521, IF_AVX|IF_SANDYBRIDGE},
+    /* 1918 */ {I_VCMPEQ_UQPS, 3, {XMMREG,XMMREG,RM_XMM|BITS128,0,0}, nasm_bytecodes+1530, IF_AVX|IF_SANDYBRIDGE},
+    /* 1919 */ {I_VCMPEQ_UQPS, 2, {XMMREG,RM_XMM|BITS128,0,0,0}, nasm_bytecodes+1539, IF_AVX|IF_SANDYBRIDGE},
+    /* 1920 */ {I_VCMPEQ_UQPS, 3, {YMMREG,YMMREG,RM_YMM|BITS256,0,0}, nasm_bytecodes+1548, IF_AVX|IF_SANDYBRIDGE},
+    /* 1921 */ {I_VCMPEQ_UQPS, 2, {YMMREG,RM_YMM|BITS256,0,0,0}, nasm_bytecodes+1557, IF_AVX|IF_SANDYBRIDGE},
+    /* 1922 */ {I_VCMPNGEPS, 3, {XMMREG,XMMREG,RM_XMM|BITS128,0,0}, nasm_bytecodes+1566, IF_AVX|IF_SANDYBRIDGE},
+    /* 1923 */ {I_VCMPNGEPS, 2, {XMMREG,RM_XMM|BITS128,0,0,0}, nasm_bytecodes+1575, IF_AVX|IF_SANDYBRIDGE},
+    /* 1924 */ {I_VCMPNGEPS, 3, {YMMREG,YMMREG,RM_YMM|BITS256,0,0}, nasm_bytecodes+1584, IF_AVX|IF_SANDYBRIDGE},
+    /* 1925 */ {I_VCMPNGEPS, 2, {YMMREG,RM_YMM|BITS256,0,0,0}, nasm_bytecodes+1593, IF_AVX|IF_SANDYBRIDGE},
+    /* 1926 */ {I_VCMPNGTPS, 3, {XMMREG,XMMREG,RM_XMM|BITS128,0,0}, nasm_bytecodes+1602, IF_AVX|IF_SANDYBRIDGE},
+    /* 1927 */ {I_VCMPNGTPS, 2, {XMMREG,RM_XMM|BITS128,0,0,0}, nasm_bytecodes+1611, IF_AVX|IF_SANDYBRIDGE},
+    /* 1928 */ {I_VCMPNGTPS, 3, {YMMREG,YMMREG,RM_YMM|BITS256,0,0}, nasm_bytecodes+1620, IF_AVX|IF_SANDYBRIDGE},
+    /* 1929 */ {I_VCMPNGTPS, 2, {YMMREG,RM_YMM|BITS256,0,0,0}, nasm_bytecodes+1629, IF_AVX|IF_SANDYBRIDGE},
+    /* 1930 */ {I_VCMPFALSEPS, 3, {XMMREG,XMMREG,RM_XMM|BITS128,0,0}, nasm_bytecodes+1638, IF_AVX|IF_SANDYBRIDGE},
+    /* 1931 */ {I_VCMPFALSEPS, 2, {XMMREG,RM_XMM|BITS128,0,0,0}, nasm_bytecodes+1647, IF_AVX|IF_SANDYBRIDGE},
+    /* 1932 */ {I_VCMPFALSEPS, 3, {YMMREG,YMMREG,RM_YMM|BITS256,0,0}, nasm_bytecodes+1656, IF_AVX|IF_SANDYBRIDGE},
+    /* 1933 */ {I_VCMPFALSEPS, 2, {YMMREG,RM_YMM|BITS256,0,0,0}, nasm_bytecodes+1665, IF_AVX|IF_SANDYBRIDGE},
+    /* 1934 */ {I_VCMPNEQ_OQPS, 3, {XMMREG,XMMREG,RM_XMM|BITS128,0,0}, nasm_bytecodes+1674, IF_AVX|IF_SANDYBRIDGE},
+    /* 1935 */ {I_VCMPNEQ_OQPS, 2, {XMMREG,RM_XMM|BITS128,0,0,0}, nasm_bytecodes+1683, IF_AVX|IF_SANDYBRIDGE},
+    /* 1936 */ {I_VCMPNEQ_OQPS, 3, {YMMREG,YMMREG,RM_YMM|BITS256,0,0}, nasm_bytecodes+1692, IF_AVX|IF_SANDYBRIDGE},
+    /* 1937 */ {I_VCMPNEQ_OQPS, 2, {YMMREG,RM_YMM|BITS256,0,0,0}, nasm_bytecodes+1701, IF_AVX|IF_SANDYBRIDGE},
+    /* 1938 */ {I_VCMPGEPS, 3, {XMMREG,XMMREG,RM_XMM|BITS128,0,0}, nasm_bytecodes+1710, IF_AVX|IF_SANDYBRIDGE},
+    /* 1939 */ {I_VCMPGEPS, 2, {XMMREG,RM_XMM|BITS128,0,0,0}, nasm_bytecodes+1719, IF_AVX|IF_SANDYBRIDGE},
+    /* 1940 */ {I_VCMPGEPS, 3, {YMMREG,YMMREG,RM_YMM|BITS256,0,0}, nasm_bytecodes+1728, IF_AVX|IF_SANDYBRIDGE},
+    /* 1941 */ {I_VCMPGEPS, 2, {YMMREG,RM_YMM|BITS256,0,0,0}, nasm_bytecodes+1737, IF_AVX|IF_SANDYBRIDGE},
+    /* 1942 */ {I_VCMPGTPS, 3, {XMMREG,XMMREG,RM_XMM|BITS128,0,0}, nasm_bytecodes+1746, IF_AVX|IF_SANDYBRIDGE},
+    /* 1943 */ {I_VCMPGTPS, 2, {XMMREG,RM_XMM|BITS128,0,0,0}, nasm_bytecodes+1755, IF_AVX|IF_SANDYBRIDGE},
+    /* 1944 */ {I_VCMPGTPS, 3, {YMMREG,YMMREG,RM_YMM|BITS256,0,0}, nasm_bytecodes+1764, IF_AVX|IF_SANDYBRIDGE},
+    /* 1945 */ {I_VCMPGTPS, 2, {YMMREG,RM_YMM|BITS256,0,0,0}, nasm_bytecodes+1773, IF_AVX|IF_SANDYBRIDGE},
+    /* 1946 */ {I_VCMPTRUEPS, 3, {XMMREG,XMMREG,RM_XMM|BITS128,0,0}, nasm_bytecodes+1782, IF_AVX|IF_SANDYBRIDGE},
+    /* 1947 */ {I_VCMPTRUEPS, 2, {XMMREG,RM_XMM|BITS128,0,0,0}, nasm_bytecodes+1791, IF_AVX|IF_SANDYBRIDGE},
+    /* 1948 */ {I_VCMPTRUEPS, 3, {YMMREG,YMMREG,RM_YMM|BITS256,0,0}, nasm_bytecodes+1800, IF_AVX|IF_SANDYBRIDGE},
+    /* 1949 */ {I_VCMPTRUEPS, 2, {YMMREG,RM_YMM|BITS256,0,0,0}, nasm_bytecodes+1809, IF_AVX|IF_SANDYBRIDGE},
+    /* 1950 */ {I_VCMPEQ_OSPS, 3, {XMMREG,XMMREG,RM_XMM|BITS128,0,0}, nasm_bytecodes+1818, IF_AVX|IF_SANDYBRIDGE},
+    /* 1951 */ {I_VCMPEQ_OSPS, 2, {XMMREG,RM_XMM|BITS128,0,0,0}, nasm_bytecodes+1827, IF_AVX|IF_SANDYBRIDGE},
+    /* 1952 */ {I_VCMPEQ_OSPS, 3, {YMMREG,YMMREG,RM_YMM|BITS256,0,0}, nasm_bytecodes+1836, IF_AVX|IF_SANDYBRIDGE},
+    /* 1953 */ {I_VCMPEQ_OSPS, 2, {YMMREG,RM_YMM|BITS256,0,0,0}, nasm_bytecodes+1845, IF_AVX|IF_SANDYBRIDGE},
+    /* 1954 */ {I_VCMPLT_OQPS, 3, {XMMREG,XMMREG,RM_XMM|BITS128,0,0}, nasm_bytecodes+1854, IF_AVX|IF_SANDYBRIDGE},
+    /* 1955 */ {I_VCMPLT_OQPS, 2, {XMMREG,RM_XMM|BITS128,0,0,0}, nasm_bytecodes+1863, IF_AVX|IF_SANDYBRIDGE},
+    /* 1956 */ {I_VCMPLT_OQPS, 3, {YMMREG,YMMREG,RM_YMM|BITS256,0,0}, nasm_bytecodes+1872, IF_AVX|IF_SANDYBRIDGE},
+    /* 1957 */ {I_VCMPLT_OQPS, 2, {YMMREG,RM_YMM|BITS256,0,0,0}, nasm_bytecodes+1881, IF_AVX|IF_SANDYBRIDGE},
+    /* 1958 */ {I_VCMPLE_OQPS, 3, {XMMREG,XMMREG,RM_XMM|BITS128,0,0}, nasm_bytecodes+1890, IF_AVX|IF_SANDYBRIDGE},
+    /* 1959 */ {I_VCMPLE_OQPS, 2, {XMMREG,RM_XMM|BITS128,0,0,0}, nasm_bytecodes+1899, IF_AVX|IF_SANDYBRIDGE},
+    /* 1960 */ {I_VCMPLE_OQPS, 3, {YMMREG,YMMREG,RM_YMM|BITS256,0,0}, nasm_bytecodes+1908, IF_AVX|IF_SANDYBRIDGE},
+    /* 1961 */ {I_VCMPLE_OQPS, 2, {YMMREG,RM_YMM|BITS256,0,0,0}, nasm_bytecodes+1917, IF_AVX|IF_SANDYBRIDGE},
+    /* 1962 */ {I_VCMPUNORD_SPS, 3, {XMMREG,XMMREG,RM_XMM|BITS128,0,0}, nasm_bytecodes+1926, IF_AVX|IF_SANDYBRIDGE},
+    /* 1963 */ {I_VCMPUNORD_SPS, 2, {XMMREG,RM_XMM|BITS128,0,0,0}, nasm_bytecodes+1935, IF_AVX|IF_SANDYBRIDGE},
+    /* 1964 */ {I_VCMPUNORD_SPS, 3, {YMMREG,YMMREG,RM_YMM|BITS256,0,0}, nasm_bytecodes+1944, IF_AVX|IF_SANDYBRIDGE},
+    /* 1965 */ {I_VCMPUNORD_SPS, 2, {YMMREG,RM_YMM|BITS256,0,0,0}, nasm_bytecodes+1953, IF_AVX|IF_SANDYBRIDGE},
+    /* 1966 */ {I_VCMPNEQ_USPS, 3, {XMMREG,XMMREG,RM_XMM|BITS128,0,0}, nasm_bytecodes+1962, IF_AVX|IF_SANDYBRIDGE},
+    /* 1967 */ {I_VCMPNEQ_USPS, 2, {XMMREG,RM_XMM|BITS128,0,0,0}, nasm_bytecodes+1971, IF_AVX|IF_SANDYBRIDGE},
+    /* 1968 */ {I_VCMPNEQ_USPS, 3, {YMMREG,YMMREG,RM_YMM|BITS256,0,0}, nasm_bytecodes+1980, IF_AVX|IF_SANDYBRIDGE},
+    /* 1969 */ {I_VCMPNEQ_USPS, 2, {YMMREG,RM_YMM|BITS256,0,0,0}, nasm_bytecodes+1989, IF_AVX|IF_SANDYBRIDGE},
+    /* 1970 */ {I_VCMPNLT_UQPS, 3, {XMMREG,XMMREG,RM_XMM|BITS128,0,0}, nasm_bytecodes+1998, IF_AVX|IF_SANDYBRIDGE},
+    /* 1971 */ {I_VCMPNLT_UQPS, 2, {XMMREG,RM_XMM|BITS128,0,0,0}, nasm_bytecodes+2007, IF_AVX|IF_SANDYBRIDGE},
+    /* 1972 */ {I_VCMPNLT_UQPS, 3, {YMMREG,YMMREG,RM_YMM|BITS256,0,0}, nasm_bytecodes+2016, IF_AVX|IF_SANDYBRIDGE},
+    /* 1973 */ {I_VCMPNLT_UQPS, 2, {YMMREG,RM_YMM|BITS256,0,0,0}, nasm_bytecodes+2025, IF_AVX|IF_SANDYBRIDGE},
+    /* 1974 */ {I_VCMPNLE_UQPS, 3, {XMMREG,XMMREG,RM_XMM|BITS128,0,0}, nasm_bytecodes+2034, IF_AVX|IF_SANDYBRIDGE},
+    /* 1975 */ {I_VCMPNLE_UQPS, 2, {XMMREG,RM_XMM|BITS128,0,0,0}, nasm_bytecodes+2043, IF_AVX|IF_SANDYBRIDGE},
+    /* 1976 */ {I_VCMPNLE_UQPS, 3, {YMMREG,YMMREG,RM_YMM|BITS256,0,0}, nasm_bytecodes+2052, IF_AVX|IF_SANDYBRIDGE},
+    /* 1977 */ {I_VCMPNLE_UQPS, 2, {YMMREG,RM_YMM|BITS256,0,0,0}, nasm_bytecodes+2061, IF_AVX|IF_SANDYBRIDGE},
+    /* 1978 */ {I_VCMPORD_SPS, 3, {XMMREG,XMMREG,RM_XMM|BITS128,0,0}, nasm_bytecodes+2070, IF_AVX|IF_SANDYBRIDGE},
+    /* 1979 */ {I_VCMPORD_SPS, 2, {XMMREG,RM_XMM|BITS128,0,0,0}, nasm_bytecodes+2079, IF_AVX|IF_SANDYBRIDGE},
+    /* 1980 */ {I_VCMPORD_SPS, 3, {YMMREG,YMMREG,RM_YMM|BITS256,0,0}, nasm_bytecodes+2088, IF_AVX|IF_SANDYBRIDGE},
+    /* 1981 */ {I_VCMPORD_SPS, 2, {YMMREG,RM_YMM|BITS256,0,0,0}, nasm_bytecodes+2097, IF_AVX|IF_SANDYBRIDGE},
+    /* 1982 */ {I_VCMPEQ_USPS, 3, {XMMREG,XMMREG,RM_XMM|BITS128,0,0}, nasm_bytecodes+2106, IF_AVX|IF_SANDYBRIDGE},
+    /* 1983 */ {I_VCMPEQ_USPS, 2, {XMMREG,RM_XMM|BITS128,0,0,0}, nasm_bytecodes+2115, IF_AVX|IF_SANDYBRIDGE},
+    /* 1984 */ {I_VCMPEQ_USPS, 3, {YMMREG,YMMREG,RM_YMM|BITS256,0,0}, nasm_bytecodes+2124, IF_AVX|IF_SANDYBRIDGE},
+    /* 1985 */ {I_VCMPEQ_USPS, 2, {YMMREG,RM_YMM|BITS256,0,0,0}, nasm_bytecodes+2133, IF_AVX|IF_SANDYBRIDGE},
+    /* 1986 */ {I_VCMPNGE_UQPS, 3, {XMMREG,XMMREG,RM_XMM|BITS128,0,0}, nasm_bytecodes+2142, IF_AVX|IF_SANDYBRIDGE},
+    /* 1987 */ {I_VCMPNGE_UQPS, 2, {XMMREG,RM_XMM|BITS128,0,0,0}, nasm_bytecodes+2151, IF_AVX|IF_SANDYBRIDGE},
+    /* 1988 */ {I_VCMPNGE_UQPS, 3, {YMMREG,YMMREG,RM_YMM|BITS256,0,0}, nasm_bytecodes+2160, IF_AVX|IF_SANDYBRIDGE},
+    /* 1989 */ {I_VCMPNGE_UQPS, 2, {YMMREG,RM_YMM|BITS256,0,0,0}, nasm_bytecodes+2169, IF_AVX|IF_SANDYBRIDGE},
+    /* 1990 */ {I_VCMPNGT_UQPS, 3, {XMMREG,XMMREG,RM_XMM|BITS128,0,0}, nasm_bytecodes+2178, IF_AVX|IF_SANDYBRIDGE},
+    /* 1991 */ {I_VCMPNGT_UQPS, 2, {XMMREG,RM_XMM|BITS128,0,0,0}, nasm_bytecodes+2187, IF_AVX|IF_SANDYBRIDGE},
+    /* 1992 */ {I_VCMPNGT_UQPS, 3, {YMMREG,YMMREG,RM_YMM|BITS256,0,0}, nasm_bytecodes+2196, IF_AVX|IF_SANDYBRIDGE},
+    /* 1993 */ {I_VCMPNGT_UQPS, 2, {YMMREG,RM_YMM|BITS256,0,0,0}, nasm_bytecodes+2205, IF_AVX|IF_SANDYBRIDGE},
+    /* 1994 */ {I_VCMPFALSE_OSPS, 3, {XMMREG,XMMREG,RM_XMM|BITS128,0,0}, nasm_bytecodes+2214, IF_AVX|IF_SANDYBRIDGE},
+    /* 1995 */ {I_VCMPFALSE_OSPS, 2, {XMMREG,RM_XMM|BITS128,0,0,0}, nasm_bytecodes+2223, IF_AVX|IF_SANDYBRIDGE},
+    /* 1996 */ {I_VCMPFALSE_OSPS, 3, {YMMREG,YMMREG,RM_YMM|BITS256,0,0}, nasm_bytecodes+2232, IF_AVX|IF_SANDYBRIDGE},
+    /* 1997 */ {I_VCMPFALSE_OSPS, 2, {YMMREG,RM_YMM|BITS256,0,0,0}, nasm_bytecodes+2241, IF_AVX|IF_SANDYBRIDGE},
+    /* 1998 */ {I_VCMPNEQ_OSPS, 3, {XMMREG,XMMREG,RM_XMM|BITS128,0,0}, nasm_bytecodes+2250, IF_AVX|IF_SANDYBRIDGE},
+    /* 1999 */ {I_VCMPNEQ_OSPS, 2, {XMMREG,RM_XMM|BITS128,0,0,0}, nasm_bytecodes+2259, IF_AVX|IF_SANDYBRIDGE},
+    /* 2000 */ {I_VCMPNEQ_OSPS, 3, {YMMREG,YMMREG,RM_YMM|BITS256,0,0}, nasm_bytecodes+2268, IF_AVX|IF_SANDYBRIDGE},
+    /* 2001 */ {I_VCMPNEQ_OSPS, 2, {YMMREG,RM_YMM|BITS256,0,0,0}, nasm_bytecodes+2277, IF_AVX|IF_SANDYBRIDGE},
+    /* 2002 */ {I_VCMPGE_OQPS, 3, {XMMREG,XMMREG,RM_XMM|BITS128,0,0}, nasm_bytecodes+2286, IF_AVX|IF_SANDYBRIDGE},
+    /* 2003 */ {I_VCMPGE_OQPS, 2, {XMMREG,RM_XMM|BITS128,0,0,0}, nasm_bytecodes+2295, IF_AVX|IF_SANDYBRIDGE},
+    /* 2004 */ {I_VCMPGE_OQPS, 3, {YMMREG,YMMREG,RM_YMM|BITS256,0,0}, nasm_bytecodes+2304, IF_AVX|IF_SANDYBRIDGE},
+    /* 2005 */ {I_VCMPGE_OQPS, 2, {YMMREG,RM_YMM|BITS256,0,0,0}, nasm_bytecodes+2313, IF_AVX|IF_SANDYBRIDGE},
+    /* 2006 */ {I_VCMPGT_OQPS, 3, {XMMREG,XMMREG,RM_XMM|BITS128,0,0}, nasm_bytecodes+2322, IF_AVX|IF_SANDYBRIDGE},
+    /* 2007 */ {I_VCMPGT_OQPS, 2, {XMMREG,RM_XMM|BITS128,0,0,0}, nasm_bytecodes+2331, IF_AVX|IF_SANDYBRIDGE},
+    /* 2008 */ {I_VCMPGT_OQPS, 3, {YMMREG,YMMREG,RM_YMM|BITS256,0,0}, nasm_bytecodes+2340, IF_AVX|IF_SANDYBRIDGE},
+    /* 2009 */ {I_VCMPGT_OQPS, 2, {YMMREG,RM_YMM|BITS256,0,0,0}, nasm_bytecodes+2349, IF_AVX|IF_SANDYBRIDGE},
+    /* 2010 */ {I_VCMPTRUE_USPS, 3, {XMMREG,XMMREG,RM_XMM|BITS128,0,0}, nasm_bytecodes+2358, IF_AVX|IF_SANDYBRIDGE},
+    /* 2011 */ {I_VCMPTRUE_USPS, 2, {XMMREG,RM_XMM|BITS128,0,0,0}, nasm_bytecodes+2367, IF_AVX|IF_SANDYBRIDGE},
+    /* 2012 */ {I_VCMPTRUE_USPS, 3, {YMMREG,YMMREG,RM_YMM|BITS256,0,0}, nasm_bytecodes+2376, IF_AVX|IF_SANDYBRIDGE},
+    /* 2013 */ {I_VCMPTRUE_USPS, 2, {YMMREG,RM_YMM|BITS256,0,0,0}, nasm_bytecodes+2385, IF_AVX|IF_SANDYBRIDGE},
+    /* 2014 */ {I_VCMPPS, 4, {XMMREG,XMMREG,RM_XMM|BITS128,IMMEDIATE|BITS8,0}, nasm_bytecodes+6220, IF_AVX|IF_SANDYBRIDGE},
+    /* 2015 */ {I_VCMPPS, 3, {XMMREG,RM_XMM|BITS128,IMMEDIATE|BITS8,0,0}, nasm_bytecodes+6228, IF_AVX|IF_SANDYBRIDGE},
+    /* 2016 */ {I_VCMPPS, 4, {YMMREG,YMMREG,RM_YMM|BITS256,IMMEDIATE|BITS8,0}, nasm_bytecodes+6236, IF_AVX|IF_SANDYBRIDGE},
+    /* 2017 */ {I_VCMPPS, 3, {YMMREG,RM_YMM|BITS256,IMMEDIATE|BITS8,0,0}, nasm_bytecodes+6244, IF_AVX|IF_SANDYBRIDGE},
+    /* 2018 */ {I_VCMPEQSD, 3, {XMMREG,XMMREG,RM_XMM|BITS64,0,0}, nasm_bytecodes+2394, IF_AVX|IF_SANDYBRIDGE},
+    /* 2019 */ {I_VCMPEQSD, 2, {XMMREG,RM_XMM|BITS64,0,0,0}, nasm_bytecodes+2403, IF_AVX|IF_SANDYBRIDGE},
+    /* 2020 */ {I_VCMPLTSD, 3, {XMMREG,XMMREG,RM_XMM|BITS64,0,0}, nasm_bytecodes+2412, IF_AVX|IF_SANDYBRIDGE},
+    /* 2021 */ {I_VCMPLTSD, 2, {XMMREG,RM_XMM|BITS64,0,0,0}, nasm_bytecodes+2421, IF_AVX|IF_SANDYBRIDGE},
+    /* 2022 */ {I_VCMPLESD, 3, {XMMREG,XMMREG,RM_XMM|BITS64,0,0}, nasm_bytecodes+2430, IF_AVX|IF_SANDYBRIDGE},
+    /* 2023 */ {I_VCMPLESD, 2, {XMMREG,RM_XMM|BITS64,0,0,0}, nasm_bytecodes+2439, IF_AVX|IF_SANDYBRIDGE},
+    /* 2024 */ {I_VCMPUNORDSD, 3, {XMMREG,XMMREG,RM_XMM|BITS64,0,0}, nasm_bytecodes+2448, IF_AVX|IF_SANDYBRIDGE},
+    /* 2025 */ {I_VCMPUNORDSD, 2, {XMMREG,RM_XMM|BITS64,0,0,0}, nasm_bytecodes+2457, IF_AVX|IF_SANDYBRIDGE},
+    /* 2026 */ {I_VCMPNEQSD, 3, {XMMREG,XMMREG,RM_XMM|BITS64,0,0}, nasm_bytecodes+2466, IF_AVX|IF_SANDYBRIDGE},
+    /* 2027 */ {I_VCMPNEQSD, 2, {XMMREG,RM_XMM|BITS64,0,0,0}, nasm_bytecodes+2475, IF_AVX|IF_SANDYBRIDGE},
+    /* 2028 */ {I_VCMPNLTSD, 3, {XMMREG,XMMREG,RM_XMM|BITS64,0,0}, nasm_bytecodes+2484, IF_AVX|IF_SANDYBRIDGE},
+    /* 2029 */ {I_VCMPNLTSD, 2, {XMMREG,RM_XMM|BITS64,0,0,0}, nasm_bytecodes+2493, IF_AVX|IF_SANDYBRIDGE},
+    /* 2030 */ {I_VCMPNLESD, 3, {XMMREG,XMMREG,RM_XMM|BITS64,0,0}, nasm_bytecodes+2502, IF_AVX|IF_SANDYBRIDGE},
+    /* 2031 */ {I_VCMPNLESD, 2, {XMMREG,RM_XMM|BITS64,0,0,0}, nasm_bytecodes+2511, IF_AVX|IF_SANDYBRIDGE},
+    /* 2032 */ {I_VCMPORDSD, 3, {XMMREG,XMMREG,RM_XMM|BITS64,0,0}, nasm_bytecodes+2520, IF_AVX|IF_SANDYBRIDGE},
+    /* 2033 */ {I_VCMPORDSD, 2, {XMMREG,RM_XMM|BITS64,0,0,0}, nasm_bytecodes+2529, IF_AVX|IF_SANDYBRIDGE},
+    /* 2034 */ {I_VCMPEQ_UQSD, 3, {XMMREG,XMMREG,RM_XMM|BITS64,0,0}, nasm_bytecodes+2538, IF_AVX|IF_SANDYBRIDGE},
+    /* 2035 */ {I_VCMPEQ_UQSD, 2, {XMMREG,RM_XMM|BITS64,0,0,0}, nasm_bytecodes+2547, IF_AVX|IF_SANDYBRIDGE},
+    /* 2036 */ {I_VCMPNGESD, 3, {XMMREG,XMMREG,RM_XMM|BITS64,0,0}, nasm_bytecodes+2556, IF_AVX|IF_SANDYBRIDGE},
+    /* 2037 */ {I_VCMPNGESD, 2, {XMMREG,RM_XMM|BITS64,0,0,0}, nasm_bytecodes+2565, IF_AVX|IF_SANDYBRIDGE},
+    /* 2038 */ {I_VCMPNGTSD, 3, {XMMREG,XMMREG,RM_XMM|BITS64,0,0}, nasm_bytecodes+2574, IF_AVX|IF_SANDYBRIDGE},
+    /* 2039 */ {I_VCMPNGTSD, 2, {XMMREG,RM_XMM|BITS64,0,0,0}, nasm_bytecodes+2583, IF_AVX|IF_SANDYBRIDGE},
+    /* 2040 */ {I_VCMPFALSESD, 3, {XMMREG,XMMREG,RM_XMM|BITS64,0,0}, nasm_bytecodes+2592, IF_AVX|IF_SANDYBRIDGE},
+    /* 2041 */ {I_VCMPFALSESD, 2, {XMMREG,RM_XMM|BITS64,0,0,0}, nasm_bytecodes+2601, IF_AVX|IF_SANDYBRIDGE},
+    /* 2042 */ {I_VCMPNEQ_OQSD, 3, {XMMREG,XMMREG,RM_XMM|BITS64,0,0}, nasm_bytecodes+2610, IF_AVX|IF_SANDYBRIDGE},
+    /* 2043 */ {I_VCMPNEQ_OQSD, 2, {XMMREG,RM_XMM|BITS64,0,0,0}, nasm_bytecodes+2619, IF_AVX|IF_SANDYBRIDGE},
+    /* 2044 */ {I_VCMPGESD, 3, {XMMREG,XMMREG,RM_XMM|BITS64,0,0}, nasm_bytecodes+2628, IF_AVX|IF_SANDYBRIDGE},
+    /* 2045 */ {I_VCMPGESD, 2, {XMMREG,RM_XMM|BITS64,0,0,0}, nasm_bytecodes+2637, IF_AVX|IF_SANDYBRIDGE},
+    /* 2046 */ {I_VCMPGTSD, 3, {XMMREG,XMMREG,RM_XMM|BITS64,0,0}, nasm_bytecodes+2646, IF_AVX|IF_SANDYBRIDGE},
+    /* 2047 */ {I_VCMPGTSD, 2, {XMMREG,RM_XMM|BITS64,0,0,0}, nasm_bytecodes+2655, IF_AVX|IF_SANDYBRIDGE},
+    /* 2048 */ {I_VCMPTRUESD, 3, {XMMREG,XMMREG,RM_XMM|BITS64,0,0}, nasm_bytecodes+2664, IF_AVX|IF_SANDYBRIDGE},
+    /* 2049 */ {I_VCMPTRUESD, 2, {XMMREG,RM_XMM|BITS64,0,0,0}, nasm_bytecodes+2673, IF_AVX|IF_SANDYBRIDGE},
+    /* 2050 */ {I_VCMPEQ_OSSD, 3, {XMMREG,XMMREG,RM_XMM|BITS64,0,0}, nasm_bytecodes+2682, IF_AVX|IF_SANDYBRIDGE},
+    /* 2051 */ {I_VCMPEQ_OSSD, 2, {XMMREG,RM_XMM|BITS64,0,0,0}, nasm_bytecodes+2691, IF_AVX|IF_SANDYBRIDGE},
+    /* 2052 */ {I_VCMPLT_OQSD, 3, {XMMREG,XMMREG,RM_XMM|BITS64,0,0}, nasm_bytecodes+2700, IF_AVX|IF_SANDYBRIDGE},
+    /* 2053 */ {I_VCMPLT_OQSD, 2, {XMMREG,RM_XMM|BITS64,0,0,0}, nasm_bytecodes+2709, IF_AVX|IF_SANDYBRIDGE},
+    /* 2054 */ {I_VCMPLE_OQSD, 3, {XMMREG,XMMREG,RM_XMM|BITS64,0,0}, nasm_bytecodes+2718, IF_AVX|IF_SANDYBRIDGE},
+    /* 2055 */ {I_VCMPLE_OQSD, 2, {XMMREG,RM_XMM|BITS64,0,0,0}, nasm_bytecodes+2727, IF_AVX|IF_SANDYBRIDGE},
+    /* 2056 */ {I_VCMPUNORD_SSD, 3, {XMMREG,XMMREG,RM_XMM|BITS64,0,0}, nasm_bytecodes+2736, IF_AVX|IF_SANDYBRIDGE},
+    /* 2057 */ {I_VCMPUNORD_SSD, 2, {XMMREG,RM_XMM|BITS64,0,0,0}, nasm_bytecodes+2745, IF_AVX|IF_SANDYBRIDGE},
+    /* 2058 */ {I_VCMPNEQ_USSD, 3, {XMMREG,XMMREG,RM_XMM|BITS64,0,0}, nasm_bytecodes+2754, IF_AVX|IF_SANDYBRIDGE},
+    /* 2059 */ {I_VCMPNEQ_USSD, 2, {XMMREG,RM_XMM|BITS64,0,0,0}, nasm_bytecodes+2763, IF_AVX|IF_SANDYBRIDGE},
+    /* 2060 */ {I_VCMPNLT_UQSD, 3, {XMMREG,XMMREG,RM_XMM|BITS64,0,0}, nasm_bytecodes+2772, IF_AVX|IF_SANDYBRIDGE},
+    /* 2061 */ {I_VCMPNLT_UQSD, 2, {XMMREG,RM_XMM|BITS64,0,0,0}, nasm_bytecodes+2781, IF_AVX|IF_SANDYBRIDGE},
+    /* 2062 */ {I_VCMPNLE_UQSD, 3, {XMMREG,XMMREG,RM_XMM|BITS64,0,0}, nasm_bytecodes+2790, IF_AVX|IF_SANDYBRIDGE},
+    /* 2063 */ {I_VCMPNLE_UQSD, 2, {XMMREG,RM_XMM|BITS64,0,0,0}, nasm_bytecodes+2799, IF_AVX|IF_SANDYBRIDGE},
+    /* 2064 */ {I_VCMPORD_SSD, 3, {XMMREG,XMMREG,RM_XMM|BITS64,0,0}, nasm_bytecodes+2808, IF_AVX|IF_SANDYBRIDGE},
+    /* 2065 */ {I_VCMPORD_SSD, 2, {XMMREG,RM_XMM|BITS64,0,0,0}, nasm_bytecodes+2817, IF_AVX|IF_SANDYBRIDGE},
+    /* 2066 */ {I_VCMPEQ_USSD, 3, {XMMREG,XMMREG,RM_XMM|BITS64,0,0}, nasm_bytecodes+2826, IF_AVX|IF_SANDYBRIDGE},
+    /* 2067 */ {I_VCMPEQ_USSD, 2, {XMMREG,RM_XMM|BITS64,0,0,0}, nasm_bytecodes+2835, IF_AVX|IF_SANDYBRIDGE},
+    /* 2068 */ {I_VCMPNGE_UQSD, 3, {XMMREG,XMMREG,RM_XMM|BITS64,0,0}, nasm_bytecodes+2844, IF_AVX|IF_SANDYBRIDGE},
+    /* 2069 */ {I_VCMPNGE_UQSD, 2, {XMMREG,RM_XMM|BITS64,0,0,0}, nasm_bytecodes+2853, IF_AVX|IF_SANDYBRIDGE},
+    /* 2070 */ {I_VCMPNGT_UQSD, 3, {XMMREG,XMMREG,RM_XMM|BITS64,0,0}, nasm_bytecodes+2862, IF_AVX|IF_SANDYBRIDGE},
+    /* 2071 */ {I_VCMPNGT_UQSD, 2, {XMMREG,RM_XMM|BITS64,0,0,0}, nasm_bytecodes+2871, IF_AVX|IF_SANDYBRIDGE},
+    /* 2072 */ {I_VCMPFALSE_OSSD, 3, {XMMREG,XMMREG,RM_XMM|BITS64,0,0}, nasm_bytecodes+2880, IF_AVX|IF_SANDYBRIDGE},
+    /* 2073 */ {I_VCMPFALSE_OSSD, 2, {XMMREG,RM_XMM|BITS64,0,0,0}, nasm_bytecodes+2889, IF_AVX|IF_SANDYBRIDGE},
+    /* 2074 */ {I_VCMPNEQ_OSSD, 3, {XMMREG,XMMREG,RM_XMM|BITS64,0,0}, nasm_bytecodes+2898, IF_AVX|IF_SANDYBRIDGE},
+    /* 2075 */ {I_VCMPNEQ_OSSD, 2, {XMMREG,RM_XMM|BITS64,0,0,0}, nasm_bytecodes+2907, IF_AVX|IF_SANDYBRIDGE},
+    /* 2076 */ {I_VCMPGE_OQSD, 3, {XMMREG,XMMREG,RM_XMM|BITS64,0,0}, nasm_bytecodes+2916, IF_AVX|IF_SANDYBRIDGE},
+    /* 2077 */ {I_VCMPGE_OQSD, 2, {XMMREG,RM_XMM|BITS64,0,0,0}, nasm_bytecodes+2925, IF_AVX|IF_SANDYBRIDGE},
+    /* 2078 */ {I_VCMPGT_OQSD, 3, {XMMREG,XMMREG,RM_XMM|BITS64,0,0}, nasm_bytecodes+2934, IF_AVX|IF_SANDYBRIDGE},
+    /* 2079 */ {I_VCMPGT_OQSD, 2, {XMMREG,RM_XMM|BITS64,0,0,0}, nasm_bytecodes+2943, IF_AVX|IF_SANDYBRIDGE},
+    /* 2080 */ {I_VCMPTRUE_USSD, 3, {XMMREG,XMMREG,RM_XMM|BITS64,0,0}, nasm_bytecodes+2952, IF_AVX|IF_SANDYBRIDGE},
+    /* 2081 */ {I_VCMPTRUE_USSD, 2, {XMMREG,RM_XMM|BITS64,0,0,0}, nasm_bytecodes+2961, IF_AVX|IF_SANDYBRIDGE},
+    /* 2082 */ {I_VCMPSD, 4, {XMMREG,XMMREG,RM_XMM|BITS64,IMMEDIATE|BITS8,0}, nasm_bytecodes+6252, IF_AVX|IF_SANDYBRIDGE},
+    /* 2083 */ {I_VCMPSD, 3, {XMMREG,RM_XMM|BITS64,IMMEDIATE|BITS8,0,0}, nasm_bytecodes+6260, IF_AVX|IF_SANDYBRIDGE},
+    /* 2084 */ {I_VCMPEQSS, 3, {XMMREG,XMMREG,RM_XMM|BITS32,0,0}, nasm_bytecodes+2970, IF_AVX|IF_SANDYBRIDGE},
+    /* 2085 */ {I_VCMPEQSS, 2, {XMMREG,RM_XMM|BITS32,0,0,0}, nasm_bytecodes+2979, IF_AVX|IF_SANDYBRIDGE},
+    /* 2086 */ {I_VCMPLTSS, 3, {XMMREG,XMMREG,RM_XMM|BITS32,0,0}, nasm_bytecodes+2988, IF_AVX|IF_SANDYBRIDGE},
+    /* 2087 */ {I_VCMPLTSS, 2, {XMMREG,RM_XMM|BITS32,0,0,0}, nasm_bytecodes+2997, IF_AVX|IF_SANDYBRIDGE},
+    /* 2088 */ {I_VCMPLESS, 3, {XMMREG,XMMREG,RM_XMM|BITS32,0,0}, nasm_bytecodes+3006, IF_AVX|IF_SANDYBRIDGE},
+    /* 2089 */ {I_VCMPLESS, 2, {XMMREG,RM_XMM|BITS32,0,0,0}, nasm_bytecodes+3015, IF_AVX|IF_SANDYBRIDGE},
+    /* 2090 */ {I_VCMPUNORDSS, 3, {XMMREG,XMMREG,RM_XMM|BITS32,0,0}, nasm_bytecodes+3024, IF_AVX|IF_SANDYBRIDGE},
+    /* 2091 */ {I_VCMPUNORDSS, 2, {XMMREG,RM_XMM|BITS32,0,0,0}, nasm_bytecodes+3033, IF_AVX|IF_SANDYBRIDGE},
+    /* 2092 */ {I_VCMPNEQSS, 3, {XMMREG,XMMREG,RM_XMM|BITS32,0,0}, nasm_bytecodes+3042, IF_AVX|IF_SANDYBRIDGE},
+    /* 2093 */ {I_VCMPNEQSS, 2, {XMMREG,RM_XMM|BITS32,0,0,0}, nasm_bytecodes+3051, IF_AVX|IF_SANDYBRIDGE},
+    /* 2094 */ {I_VCMPNLTSS, 3, {XMMREG,XMMREG,RM_XMM|BITS32,0,0}, nasm_bytecodes+3060, IF_AVX|IF_SANDYBRIDGE},
+    /* 2095 */ {I_VCMPNLTSS, 2, {XMMREG,RM_XMM|BITS32,0,0,0}, nasm_bytecodes+3069, IF_AVX|IF_SANDYBRIDGE},
+    /* 2096 */ {I_VCMPNLESS, 3, {XMMREG,XMMREG,RM_XMM|BITS32,0,0}, nasm_bytecodes+3078, IF_AVX|IF_SANDYBRIDGE},
+    /* 2097 */ {I_VCMPNLESS, 2, {XMMREG,RM_XMM|BITS32,0,0,0}, nasm_bytecodes+3087, IF_AVX|IF_SANDYBRIDGE},
+    /* 2098 */ {I_VCMPORDSS, 3, {XMMREG,XMMREG,RM_XMM|BITS32,0,0}, nasm_bytecodes+3096, IF_AVX|IF_SANDYBRIDGE},
+    /* 2099 */ {I_VCMPORDSS, 2, {XMMREG,RM_XMM|BITS32,0,0,0}, nasm_bytecodes+3105, IF_AVX|IF_SANDYBRIDGE},
+    /* 2100 */ {I_VCMPEQ_UQSS, 3, {XMMREG,XMMREG,RM_XMM|BITS32,0,0}, nasm_bytecodes+3114, IF_AVX|IF_SANDYBRIDGE},
+    /* 2101 */ {I_VCMPEQ_UQSS, 2, {XMMREG,RM_XMM|BITS32,0,0,0}, nasm_bytecodes+3123, IF_AVX|IF_SANDYBRIDGE},
+    /* 2102 */ {I_VCMPNGESS, 3, {XMMREG,XMMREG,RM_XMM|BITS32,0,0}, nasm_bytecodes+3132, IF_AVX|IF_SANDYBRIDGE},
+    /* 2103 */ {I_VCMPNGESS, 2, {XMMREG,RM_XMM|BITS32,0,0,0}, nasm_bytecodes+3141, IF_AVX|IF_SANDYBRIDGE},
+    /* 2104 */ {I_VCMPNGTSS, 3, {XMMREG,XMMREG,RM_XMM|BITS32,0,0}, nasm_bytecodes+3150, IF_AVX|IF_SANDYBRIDGE},
+    /* 2105 */ {I_VCMPNGTSS, 2, {XMMREG,RM_XMM|BITS32,0,0,0}, nasm_bytecodes+3159, IF_AVX|IF_SANDYBRIDGE},
+    /* 2106 */ {I_VCMPFALSESS, 3, {XMMREG,XMMREG,RM_XMM|BITS32,0,0}, nasm_bytecodes+3168, IF_AVX|IF_SANDYBRIDGE},
+    /* 2107 */ {I_VCMPFALSESS, 2, {XMMREG,RM_XMM|BITS32,0,0,0}, nasm_bytecodes+3177, IF_AVX|IF_SANDYBRIDGE},
+    /* 2108 */ {I_VCMPNEQ_OQSS, 3, {XMMREG,XMMREG,RM_XMM|BITS32,0,0}, nasm_bytecodes+3186, IF_AVX|IF_SANDYBRIDGE},
+    /* 2109 */ {I_VCMPNEQ_OQSS, 2, {XMMREG,RM_XMM|BITS32,0,0,0}, nasm_bytecodes+3195, IF_AVX|IF_SANDYBRIDGE},
+    /* 2110 */ {I_VCMPGESS, 3, {XMMREG,XMMREG,RM_XMM|BITS32,0,0}, nasm_bytecodes+3204, IF_AVX|IF_SANDYBRIDGE},
+    /* 2111 */ {I_VCMPGESS, 2, {XMMREG,RM_XMM|BITS32,0,0,0}, nasm_bytecodes+3213, IF_AVX|IF_SANDYBRIDGE},
+    /* 2112 */ {I_VCMPGTSS, 3, {XMMREG,XMMREG,RM_XMM|BITS32,0,0}, nasm_bytecodes+3222, IF_AVX|IF_SANDYBRIDGE},
+    /* 2113 */ {I_VCMPGTSS, 2, {XMMREG,RM_XMM|BITS32,0,0,0}, nasm_bytecodes+3231, IF_AVX|IF_SANDYBRIDGE},
+    /* 2114 */ {I_VCMPTRUESS, 3, {XMMREG,XMMREG,RM_XMM|BITS32,0,0}, nasm_bytecodes+3240, IF_AVX|IF_SANDYBRIDGE},
+    /* 2115 */ {I_VCMPTRUESS, 2, {XMMREG,RM_XMM|BITS32,0,0,0}, nasm_bytecodes+3249, IF_AVX|IF_SANDYBRIDGE},
+    /* 2116 */ {I_VCMPEQ_OSSS, 3, {XMMREG,XMMREG,RM_XMM|BITS32,0,0}, nasm_bytecodes+3258, IF_AVX|IF_SANDYBRIDGE},
+    /* 2117 */ {I_VCMPEQ_OSSS, 2, {XMMREG,RM_XMM|BITS32,0,0,0}, nasm_bytecodes+3267, IF_AVX|IF_SANDYBRIDGE},
+    /* 2118 */ {I_VCMPLT_OQSS, 3, {XMMREG,XMMREG,RM_XMM|BITS32,0,0}, nasm_bytecodes+3276, IF_AVX|IF_SANDYBRIDGE},
+    /* 2119 */ {I_VCMPLT_OQSS, 2, {XMMREG,RM_XMM|BITS32,0,0,0}, nasm_bytecodes+3285, IF_AVX|IF_SANDYBRIDGE},
+    /* 2120 */ {I_VCMPLE_OQSS, 3, {XMMREG,XMMREG,RM_XMM|BITS32,0,0}, nasm_bytecodes+3294, IF_AVX|IF_SANDYBRIDGE},
+    /* 2121 */ {I_VCMPLE_OQSS, 2, {XMMREG,RM_XMM|BITS32,0,0,0}, nasm_bytecodes+3303, IF_AVX|IF_SANDYBRIDGE},
+    /* 2122 */ {I_VCMPUNORD_SSS, 3, {XMMREG,XMMREG,RM_XMM|BITS32,0,0}, nasm_bytecodes+3312, IF_AVX|IF_SANDYBRIDGE},
+    /* 2123 */ {I_VCMPUNORD_SSS, 2, {XMMREG,RM_XMM|BITS32,0,0,0}, nasm_bytecodes+3321, IF_AVX|IF_SANDYBRIDGE},
+    /* 2124 */ {I_VCMPNEQ_USSS, 3, {XMMREG,XMMREG,RM_XMM|BITS32,0,0}, nasm_bytecodes+3330, IF_AVX|IF_SANDYBRIDGE},
+    /* 2125 */ {I_VCMPNEQ_USSS, 2, {XMMREG,RM_XMM|BITS32,0,0,0}, nasm_bytecodes+3339, IF_AVX|IF_SANDYBRIDGE},
+    /* 2126 */ {I_VCMPNLT_UQSS, 3, {XMMREG,XMMREG,RM_XMM|BITS32,0,0}, nasm_bytecodes+3348, IF_AVX|IF_SANDYBRIDGE},
+    /* 2127 */ {I_VCMPNLT_UQSS, 2, {XMMREG,RM_XMM|BITS32,0,0,0}, nasm_bytecodes+3357, IF_AVX|IF_SANDYBRIDGE},
+    /* 2128 */ {I_VCMPNLE_UQSS, 3, {XMMREG,XMMREG,RM_XMM|BITS32,0,0}, nasm_bytecodes+3366, IF_AVX|IF_SANDYBRIDGE},
+    /* 2129 */ {I_VCMPNLE_UQSS, 2, {XMMREG,RM_XMM|BITS32,0,0,0}, nasm_bytecodes+3375, IF_AVX|IF_SANDYBRIDGE},
+    /* 2130 */ {I_VCMPORD_SSS, 3, {XMMREG,XMMREG,RM_XMM|BITS32,0,0}, nasm_bytecodes+3384, IF_AVX|IF_SANDYBRIDGE},
+    /* 2131 */ {I_VCMPORD_SSS, 2, {XMMREG,RM_XMM|BITS32,0,0,0}, nasm_bytecodes+3393, IF_AVX|IF_SANDYBRIDGE},
+    /* 2132 */ {I_VCMPEQ_USSS, 3, {XMMREG,XMMREG,RM_XMM|BITS32,0,0}, nasm_bytecodes+3402, IF_AVX|IF_SANDYBRIDGE},
+    /* 2133 */ {I_VCMPEQ_USSS, 2, {XMMREG,RM_XMM|BITS32,0,0,0}, nasm_bytecodes+3411, IF_AVX|IF_SANDYBRIDGE},
+    /* 2134 */ {I_VCMPNGE_UQSS, 3, {XMMREG,XMMREG,RM_XMM|BITS32,0,0}, nasm_bytecodes+3420, IF_AVX|IF_SANDYBRIDGE},
+    /* 2135 */ {I_VCMPNGE_UQSS, 2, {XMMREG,RM_XMM|BITS32,0,0,0}, nasm_bytecodes+3429, IF_AVX|IF_SANDYBRIDGE},
+    /* 2136 */ {I_VCMPNGT_UQSS, 3, {XMMREG,XMMREG,RM_XMM|BITS32,0,0}, nasm_bytecodes+3438, IF_AVX|IF_SANDYBRIDGE},
+    /* 2137 */ {I_VCMPNGT_UQSS, 2, {XMMREG,RM_XMM|BITS32,0,0,0}, nasm_bytecodes+3447, IF_AVX|IF_SANDYBRIDGE},
+    /* 2138 */ {I_VCMPFALSE_OSSS, 3, {XMMREG,XMMREG,RM_XMM|BITS32,0,0}, nasm_bytecodes+3456, IF_AVX|IF_SANDYBRIDGE},
+    /* 2139 */ {I_VCMPFALSE_OSSS, 2, {XMMREG,RM_XMM|BITS32,0,0,0}, nasm_bytecodes+3465, IF_AVX|IF_SANDYBRIDGE},
+    /* 2140 */ {I_VCMPNEQ_OSSS, 3, {XMMREG,XMMREG,RM_XMM|BITS32,0,0}, nasm_bytecodes+3474, IF_AVX|IF_SANDYBRIDGE},
+    /* 2141 */ {I_VCMPNEQ_OSSS, 2, {XMMREG,RM_XMM|BITS32,0,0,0}, nasm_bytecodes+3483, IF_AVX|IF_SANDYBRIDGE},
+    /* 2142 */ {I_VCMPGE_OQSS, 3, {XMMREG,XMMREG,RM_XMM|BITS32,0,0}, nasm_bytecodes+3492, IF_AVX|IF_SANDYBRIDGE},
+    /* 2143 */ {I_VCMPGE_OQSS, 2, {XMMREG,RM_XMM|BITS32,0,0,0}, nasm_bytecodes+3501, IF_AVX|IF_SANDYBRIDGE},
+    /* 2144 */ {I_VCMPGT_OQSS, 3, {XMMREG,XMMREG,RM_XMM|BITS32,0,0}, nasm_bytecodes+3510, IF_AVX|IF_SANDYBRIDGE},
+    /* 2145 */ {I_VCMPGT_OQSS, 2, {XMMREG,RM_XMM|BITS32,0,0,0}, nasm_bytecodes+3519, IF_AVX|IF_SANDYBRIDGE},
+    /* 2146 */ {I_VCMPTRUE_USSS, 3, {XMMREG,XMMREG,RM_XMM|BITS32,0,0}, nasm_bytecodes+3528, IF_AVX|IF_SANDYBRIDGE},
+    /* 2147 */ {I_VCMPTRUE_USSS, 2, {XMMREG,RM_XMM|BITS32,0,0,0}, nasm_bytecodes+3537, IF_AVX|IF_SANDYBRIDGE},
+    /* 2148 */ {I_VCMPSS, 4, {XMMREG,XMMREG,RM_XMM|BITS32,IMMEDIATE|BITS8,0}, nasm_bytecodes+6268, IF_AVX|IF_SANDYBRIDGE},
+    /* 2149 */ {I_VCMPSS, 3, {XMMREG,RM_XMM|BITS32,IMMEDIATE|BITS8,0,0}, nasm_bytecodes+6276, IF_AVX|IF_SANDYBRIDGE},
+    /* 2150 */ {I_VCOMISD, 2, {XMMREG,RM_XMM|BITS64,0,0,0}, nasm_bytecodes+9119, IF_AVX|IF_SANDYBRIDGE},
+    /* 2151 */ {I_VCOMISS, 2, {XMMREG,RM_XMM|BITS32,0,0,0}, nasm_bytecodes+9126, IF_AVX|IF_SANDYBRIDGE},
+    /* 2152 */ {I_VCVTDQ2PD, 2, {XMMREG,RM_XMM|BITS64,0,0,0}, nasm_bytecodes+9133, IF_AVX|IF_SANDYBRIDGE},
+    /* 2153 */ {I_VCVTDQ2PD, 2, {YMMREG,RM_XMM|BITS128,0,0,0}, nasm_bytecodes+9140, IF_AVX|IF_SANDYBRIDGE},
+    /* 2154 */ {I_VCVTDQ2PS, 2, {XMMREG,RM_XMM|BITS128,0,0,0}, nasm_bytecodes+9147, IF_AVX|IF_SANDYBRIDGE},
+    /* 2155 */ {I_VCVTDQ2PS, 2, {YMMREG,RM_YMM|BITS256,0,0,0}, nasm_bytecodes+9154, IF_AVX|IF_SANDYBRIDGE},
+    /* 2156 */ {I_VCVTPD2DQ, 2, {XMMREG,XMMREG,0,0,0}, nasm_bytecodes+9161, IF_AVX|IF_SANDYBRIDGE},
+    /* 2157 */ {I_VCVTPD2DQ, 2, {XMMREG,MEMORY|BITS128,0,0,0}, nasm_bytecodes+9161, IF_AVX|IF_SANDYBRIDGE|IF_SO},
+    /* 2158 */ {I_VCVTPD2DQ, 2, {XMMREG,YMMREG,0,0,0}, nasm_bytecodes+9168, IF_AVX|IF_SANDYBRIDGE},
+    /* 2159 */ {I_VCVTPD2DQ, 2, {XMMREG,MEMORY|BITS256,0,0,0}, nasm_bytecodes+9168, IF_AVX|IF_SANDYBRIDGE|IF_SY},
+    /* 2160 */ {I_VCVTPD2PS, 2, {XMMREG,XMMREG,0,0,0}, nasm_bytecodes+9175, IF_AVX|IF_SANDYBRIDGE},
+    /* 2161 */ {I_VCVTPD2PS, 2, {XMMREG,MEMORY|BITS128,0,0,0}, nasm_bytecodes+9175, IF_AVX|IF_SANDYBRIDGE|IF_SO},
+    /* 2162 */ {I_VCVTPD2PS, 2, {XMMREG,YMMREG,0,0,0}, nasm_bytecodes+9182, IF_AVX|IF_SANDYBRIDGE},
+    /* 2163 */ {I_VCVTPD2PS, 2, {XMMREG,MEMORY|BITS256,0,0,0}, nasm_bytecodes+9182, IF_AVX|IF_SANDYBRIDGE|IF_SY},
+    /* 2164 */ {I_VCVTPS2DQ, 2, {XMMREG,RM_XMM|BITS128,0,0,0}, nasm_bytecodes+9189, IF_AVX|IF_SANDYBRIDGE},
+    /* 2165 */ {I_VCVTPS2DQ, 2, {YMMREG,RM_YMM|BITS256,0,0,0}, nasm_bytecodes+9196, IF_AVX|IF_SANDYBRIDGE},
+    /* 2166 */ {I_VCVTPS2PD, 2, {XMMREG,RM_XMM|BITS64,0,0,0}, nasm_bytecodes+9203, IF_AVX|IF_SANDYBRIDGE},
+    /* 2167 */ {I_VCVTPS2PD, 2, {YMMREG,RM_XMM|BITS128,0,0,0}, nasm_bytecodes+9210, IF_AVX|IF_SANDYBRIDGE},
+    /* 2168 */ {I_VCVTSD2SI, 2, {REG_GPR|BITS32,RM_XMM|BITS64,0,0,0}, nasm_bytecodes+9217, IF_AVX|IF_SANDYBRIDGE},
+    /* 2169 */ {I_VCVTSD2SI, 2, {REG_GPR|BITS64,RM_XMM|BITS64,0,0,0}, nasm_bytecodes+9224, IF_AVX|IF_SANDYBRIDGE|IF_LONG},
+    /* 2170 */ {I_VCVTSD2SS, 3, {XMMREG,XMMREG,RM_XMM|BITS64,0,0}, nasm_bytecodes+9231, IF_AVX|IF_SANDYBRIDGE},
+    /* 2171 */ {I_VCVTSD2SS, 2, {XMMREG,RM_XMM|BITS64,0,0,0}, nasm_bytecodes+9238, IF_AVX|IF_SANDYBRIDGE},
+    /* 2172 */ {I_VCVTSI2SD, 3, {XMMREG,XMMREG,RM_GPR|BITS32,0,0}, nasm_bytecodes+9245, IF_AVX|IF_SANDYBRIDGE|IF_SD},
+    /* 2173 */ {I_VCVTSI2SD, 2, {XMMREG,RM_GPR|BITS32,0,0,0}, nasm_bytecodes+9252, IF_AVX|IF_SANDYBRIDGE|IF_SD},
+    /* 2174 */ {I_VCVTSI2SD, 3, {XMMREG,XMMREG,RM_GPR|BITS64,0,0}, nasm_bytecodes+9259, IF_AVX|IF_SANDYBRIDGE|IF_LONG|IF_SQ},
+    /* 2175 */ {I_VCVTSI2SD, 2, {XMMREG,RM_GPR|BITS64,0,0,0}, nasm_bytecodes+9266, IF_AVX|IF_SANDYBRIDGE|IF_LONG|IF_SQ},
+    /* 2176 */ {I_VCVTSI2SS, 3, {XMMREG,XMMREG,RM_GPR|BITS32,0,0}, nasm_bytecodes+9273, IF_AVX|IF_SANDYBRIDGE|IF_SD},
+    /* 2177 */ {I_VCVTSI2SS, 2, {XMMREG,RM_GPR|BITS32,0,0,0}, nasm_bytecodes+9280, IF_AVX|IF_SANDYBRIDGE|IF_SD},
+    /* 2178 */ {I_VCVTSI2SS, 3, {XMMREG,XMMREG,RM_GPR|BITS64,0,0}, nasm_bytecodes+9287, IF_AVX|IF_SANDYBRIDGE|IF_LONG|IF_SQ},
+    /* 2179 */ {I_VCVTSI2SS, 2, {XMMREG,RM_GPR|BITS64,0,0,0}, nasm_bytecodes+9294, IF_AVX|IF_SANDYBRIDGE|IF_LONG|IF_SQ},
+    /* 2180 */ {I_VCVTSS2SD, 3, {XMMREG,XMMREG,RM_XMM|BITS32,0,0}, nasm_bytecodes+9301, IF_AVX|IF_SANDYBRIDGE},
+    /* 2181 */ {I_VCVTSS2SD, 2, {XMMREG,RM_XMM|BITS32,0,0,0}, nasm_bytecodes+9308, IF_AVX|IF_SANDYBRIDGE},
+    /* 2182 */ {I_VCVTSS2SI, 2, {REG_GPR|BITS32,RM_XMM|BITS32,0,0,0}, nasm_bytecodes+9315, IF_AVX|IF_SANDYBRIDGE},
+    /* 2183 */ {I_VCVTSS2SI, 2, {REG_GPR|BITS64,RM_XMM|BITS32,0,0,0}, nasm_bytecodes+9322, IF_AVX|IF_SANDYBRIDGE|IF_LONG},
+    /* 2184 */ {I_VCVTTPD2DQ, 2, {XMMREG,XMMREG,0,0,0}, nasm_bytecodes+9329, IF_AVX|IF_SANDYBRIDGE},
+    /* 2185 */ {I_VCVTTPD2DQ, 2, {XMMREG,MEMORY|BITS128,0,0,0}, nasm_bytecodes+9329, IF_AVX|IF_SANDYBRIDGE|IF_SO},
+    /* 2186 */ {I_VCVTTPD2DQ, 2, {XMMREG,YMMREG,0,0,0}, nasm_bytecodes+9336, IF_AVX|IF_SANDYBRIDGE},
+    /* 2187 */ {I_VCVTTPD2DQ, 2, {XMMREG,MEMORY|BITS256,0,0,0}, nasm_bytecodes+9336, IF_AVX|IF_SANDYBRIDGE|IF_SY},
+    /* 2188 */ {I_VCVTTPS2DQ, 2, {XMMREG,RM_XMM|BITS128,0,0,0}, nasm_bytecodes+9343, IF_AVX|IF_SANDYBRIDGE},
+    /* 2189 */ {I_VCVTTPS2DQ, 2, {YMMREG,RM_YMM|BITS256,0,0,0}, nasm_bytecodes+9350, IF_AVX|IF_SANDYBRIDGE},
+    /* 2190 */ {I_VCVTTSD2SI, 2, {REG_GPR|BITS32,RM_XMM|BITS64,0,0,0}, nasm_bytecodes+9357, IF_AVX|IF_SANDYBRIDGE},
+    /* 2191 */ {I_VCVTTSD2SI, 2, {REG_GPR|BITS64,RM_XMM|BITS64,0,0,0}, nasm_bytecodes+9364, IF_AVX|IF_SANDYBRIDGE|IF_LONG},
+    /* 2192 */ {I_VCVTTSS2SI, 2, {REG_GPR|BITS32,RM_XMM|BITS32,0,0,0}, nasm_bytecodes+9371, IF_AVX|IF_SANDYBRIDGE},
+    /* 2193 */ {I_VCVTTSS2SI, 2, {REG_GPR|BITS64,RM_XMM|BITS32,0,0,0}, nasm_bytecodes+9378, IF_AVX|IF_SANDYBRIDGE|IF_LONG},
+    /* 2194 */ {I_VDIVPD, 3, {XMMREG,XMMREG,RM_XMM|BITS128,0,0}, nasm_bytecodes+9385, IF_AVX|IF_SANDYBRIDGE},
+    /* 2195 */ {I_VDIVPD, 2, {XMMREG,RM_XMM|BITS128,0,0,0}, nasm_bytecodes+9392, IF_AVX|IF_SANDYBRIDGE},
+    /* 2196 */ {I_VDIVPD, 3, {YMMREG,YMMREG,RM_YMM|BITS256,0,0}, nasm_bytecodes+9399, IF_AVX|IF_SANDYBRIDGE},
+    /* 2197 */ {I_VDIVPD, 2, {YMMREG,RM_YMM|BITS256,0,0,0}, nasm_bytecodes+9406, IF_AVX|IF_SANDYBRIDGE},
+    /* 2198 */ {I_VDIVPS, 3, {XMMREG,XMMREG,RM_XMM|BITS128,0,0}, nasm_bytecodes+9413, IF_AVX|IF_SANDYBRIDGE},
+    /* 2199 */ {I_VDIVPS, 2, {XMMREG,RM_XMM|BITS128,0,0,0}, nasm_bytecodes+9420, IF_AVX|IF_SANDYBRIDGE},
+    /* 2200 */ {I_VDIVPS, 3, {YMMREG,YMMREG,RM_YMM|BITS256,0,0}, nasm_bytecodes+9427, IF_AVX|IF_SANDYBRIDGE},
+    /* 2201 */ {I_VDIVPS, 2, {YMMREG,RM_YMM|BITS256,0,0,0}, nasm_bytecodes+9434, IF_AVX|IF_SANDYBRIDGE},
+    /* 2202 */ {I_VDIVSD, 3, {XMMREG,XMMREG,RM_XMM|BITS64,0,0}, nasm_bytecodes+9441, IF_AVX|IF_SANDYBRIDGE},
+    /* 2203 */ {I_VDIVSD, 2, {XMMREG,RM_XMM|BITS64,0,0,0}, nasm_bytecodes+9448, IF_AVX|IF_SANDYBRIDGE},
+    /* 2204 */ {I_VDIVSS, 3, {XMMREG,XMMREG,RM_XMM|BITS32,0,0}, nasm_bytecodes+9455, IF_AVX|IF_SANDYBRIDGE},
+    /* 2205 */ {I_VDIVSS, 2, {XMMREG,RM_XMM|BITS32,0,0,0}, nasm_bytecodes+9462, IF_AVX|IF_SANDYBRIDGE},
+    /* 2206 */ {I_VDPPD, 4, {XMMREG,XMMREG,RM_XMM|BITS128,IMMEDIATE|BITS8,0}, nasm_bytecodes+6284, IF_AVX|IF_SANDYBRIDGE},
+    /* 2207 */ {I_VDPPD, 3, {XMMREG,RM_XMM|BITS128,IMMEDIATE|BITS8,0,0}, nasm_bytecodes+6292, IF_AVX|IF_SANDYBRIDGE},
+    /* 2208 */ {I_VDPPS, 4, {XMMREG,XMMREG,RM_XMM|BITS128,IMMEDIATE|BITS8,0}, nasm_bytecodes+6300, IF_AVX|IF_SANDYBRIDGE},
+    /* 2209 */ {I_VDPPS, 3, {XMMREG,RM_XMM|BITS128,IMMEDIATE|BITS8,0,0}, nasm_bytecodes+6308, IF_AVX|IF_SANDYBRIDGE},
+    /* 2210 */ {I_VDPPS, 4, {YMMREG,YMMREG,RM_YMM|BITS256,IMMEDIATE|BITS8,0}, nasm_bytecodes+6316, IF_AVX|IF_SANDYBRIDGE},
+    /* 2211 */ {I_VDPPS, 3, {YMMREG,RM_YMM|BITS256,IMMEDIATE|BITS8,0,0}, nasm_bytecodes+6324, IF_AVX|IF_SANDYBRIDGE},
+    /* 2212 */ {I_VEXTRACTF128, 3, {RM_XMM|BITS128,XMMREG,IMMEDIATE|BITS8,0,0}, nasm_bytecodes+6332, IF_AVX|IF_SANDYBRIDGE},
+    /* 2213 */ {I_VEXTRACTPS, 3, {RM_GPR|BITS32,XMMREG,IMMEDIATE|BITS8,0,0}, nasm_bytecodes+6340, IF_AVX|IF_SANDYBRIDGE},
+    /* 2214 */ {I_VHADDPD, 3, {XMMREG,XMMREG,RM_XMM|BITS128,0,0}, nasm_bytecodes+9469, IF_AVX|IF_SANDYBRIDGE},
+    /* 2215 */ {I_VHADDPD, 2, {XMMREG,RM_XMM|BITS128,0,0,0}, nasm_bytecodes+9476, IF_AVX|IF_SANDYBRIDGE},
+    /* 2216 */ {I_VHADDPD, 3, {YMMREG,YMMREG,RM_YMM|BITS256,0,0}, nasm_bytecodes+9483, IF_AVX|IF_SANDYBRIDGE},
+    /* 2217 */ {I_VHADDPD, 2, {YMMREG,RM_YMM|BITS256,0,0,0}, nasm_bytecodes+9490, IF_AVX|IF_SANDYBRIDGE},
+    /* 2218 */ {I_VHADDPS, 3, {XMMREG,XMMREG,RM_XMM|BITS128,0,0}, nasm_bytecodes+9497, IF_AVX|IF_SANDYBRIDGE},
+    /* 2219 */ {I_VHADDPS, 2, {XMMREG,RM_XMM|BITS128,0,0,0}, nasm_bytecodes+9504, IF_AVX|IF_SANDYBRIDGE},
+    /* 2220 */ {I_VHADDPS, 3, {YMMREG,YMMREG,RM_YMM|BITS256,0,0}, nasm_bytecodes+9511, IF_AVX|IF_SANDYBRIDGE},
+    /* 2221 */ {I_VHADDPS, 2, {YMMREG,RM_YMM|BITS256,0,0,0}, nasm_bytecodes+9518, IF_AVX|IF_SANDYBRIDGE},
+    /* 2222 */ {I_VHSUBPD, 3, {XMMREG,XMMREG,RM_XMM|BITS128,0,0}, nasm_bytecodes+9525, IF_AVX|IF_SANDYBRIDGE},
+    /* 2223 */ {I_VHSUBPD, 2, {XMMREG,RM_XMM|BITS128,0,0,0}, nasm_bytecodes+9532, IF_AVX|IF_SANDYBRIDGE},
+    /* 2224 */ {I_VHSUBPD, 3, {YMMREG,YMMREG,RM_YMM|BITS256,0,0}, nasm_bytecodes+9539, IF_AVX|IF_SANDYBRIDGE},
+    /* 2225 */ {I_VHSUBPD, 2, {YMMREG,RM_YMM|BITS256,0,0,0}, nasm_bytecodes+9546, IF_AVX|IF_SANDYBRIDGE},
+    /* 2226 */ {I_VHSUBPS, 3, {XMMREG,XMMREG,RM_XMM|BITS128,0,0}, nasm_bytecodes+9553, IF_AVX|IF_SANDYBRIDGE},
+    /* 2227 */ {I_VHSUBPS, 2, {XMMREG,RM_XMM|BITS128,0,0,0}, nasm_bytecodes+9560, IF_AVX|IF_SANDYBRIDGE},
+    /* 2228 */ {I_VHSUBPS, 3, {YMMREG,YMMREG,RM_YMM|BITS256,0,0}, nasm_bytecodes+9567, IF_AVX|IF_SANDYBRIDGE},
+    /* 2229 */ {I_VHSUBPS, 2, {YMMREG,RM_YMM|BITS256,0,0,0}, nasm_bytecodes+9574, IF_AVX|IF_SANDYBRIDGE},
+    /* 2230 */ {I_VINSERTF128, 4, {YMMREG,YMMREG,RM_XMM|BITS128,IMMEDIATE|BITS8,0}, nasm_bytecodes+6348, IF_AVX|IF_SANDYBRIDGE},
+    /* 2231 */ {I_VINSERTPS, 4, {XMMREG,XMMREG,RM_XMM|BITS32,IMMEDIATE|BITS8,0}, nasm_bytecodes+6356, IF_AVX|IF_SANDYBRIDGE},
+    /* 2232 */ {I_VINSERTPS, 3, {XMMREG,RM_XMM|BITS32,IMMEDIATE|BITS8,0,0}, nasm_bytecodes+6364, IF_AVX|IF_SANDYBRIDGE},
+    /* 2233 */ {I_VLDDQU, 2, {XMMREG,MEMORY|BITS128,0,0,0}, nasm_bytecodes+9581, IF_AVX|IF_SANDYBRIDGE},
+    /* 2234 */ {I_VLDQQU, 2, {YMMREG,MEMORY|BITS256,0,0,0}, nasm_bytecodes+9588, IF_AVX|IF_SANDYBRIDGE},
+    /* 2235 */ {I_VLDDQU, 2, {YMMREG,MEMORY|BITS256,0,0,0}, nasm_bytecodes+9588, IF_AVX|IF_SANDYBRIDGE},
+    /* 2236 */ {I_VLDMXCSR, 1, {MEMORY|BITS32,0,0,0,0}, nasm_bytecodes+9595, IF_AVX|IF_SANDYBRIDGE},
+    /* 2237 */ {I_VMASKMOVDQU, 2, {XMMREG,XMMREG,0,0,0}, nasm_bytecodes+9602, IF_AVX|IF_SANDYBRIDGE},
+    /* 2238 */ {I_VMASKMOVPS, 3, {XMMREG,XMMREG,MEMORY|BITS128,0,0}, nasm_bytecodes+9609, IF_AVX|IF_SANDYBRIDGE},
+    /* 2239 */ {I_VMASKMOVPS, 3, {YMMREG,YMMREG,MEMORY|BITS256,0,0}, nasm_bytecodes+9616, IF_AVX|IF_SANDYBRIDGE},
+    /* 2240 */ {I_VMASKMOVPS, 3, {MEMORY|BITS128,XMMREG,XMMREG,0,0}, nasm_bytecodes+9623, IF_AVX|IF_SANDYBRIDGE|IF_SO},
+    /* 2241 */ {I_VMASKMOVPS, 3, {MEMORY|BITS256,XMMREG,XMMREG,0,0}, nasm_bytecodes+9630, IF_AVX|IF_SANDYBRIDGE|IF_SY},
+    /* 2242 */ {I_VMASKMOVPD, 3, {XMMREG,XMMREG,MEMORY|BITS128,0,0}, nasm_bytecodes+9637, IF_AVX|IF_SANDYBRIDGE},
+    /* 2243 */ {I_VMASKMOVPD, 3, {YMMREG,YMMREG,MEMORY|BITS256,0,0}, nasm_bytecodes+9644, IF_AVX|IF_SANDYBRIDGE},
+    /* 2244 */ {I_VMASKMOVPD, 3, {MEMORY|BITS128,XMMREG,XMMREG,0,0}, nasm_bytecodes+9651, IF_AVX|IF_SANDYBRIDGE},
+    /* 2245 */ {I_VMASKMOVPD, 3, {MEMORY|BITS256,YMMREG,YMMREG,0,0}, nasm_bytecodes+9658, IF_AVX|IF_SANDYBRIDGE},
+    /* 2246 */ {I_VMAXPD, 3, {XMMREG,XMMREG,RM_XMM|BITS128,0,0}, nasm_bytecodes+9665, IF_AVX|IF_SANDYBRIDGE},
+    /* 2247 */ {I_VMAXPD, 2, {XMMREG,RM_XMM|BITS128,0,0,0}, nasm_bytecodes+9672, IF_AVX|IF_SANDYBRIDGE},
+    /* 2248 */ {I_VMAXPD, 3, {YMMREG,YMMREG,RM_YMM|BITS256,0,0}, nasm_bytecodes+9679, IF_AVX|IF_SANDYBRIDGE},
+    /* 2249 */ {I_VMAXPD, 2, {YMMREG,RM_YMM|BITS256,0,0,0}, nasm_bytecodes+9686, IF_AVX|IF_SANDYBRIDGE},
+    /* 2250 */ {I_VMAXPS, 3, {XMMREG,XMMREG,RM_XMM|BITS128,0,0}, nasm_bytecodes+9693, IF_AVX|IF_SANDYBRIDGE},
+    /* 2251 */ {I_VMAXPS, 2, {XMMREG,RM_XMM|BITS128,0,0,0}, nasm_bytecodes+9700, IF_AVX|IF_SANDYBRIDGE},
+    /* 2252 */ {I_VMAXPS, 3, {YMMREG,YMMREG,RM_YMM|BITS256,0,0}, nasm_bytecodes+9707, IF_AVX|IF_SANDYBRIDGE},
+    /* 2253 */ {I_VMAXPS, 2, {YMMREG,RM_YMM|BITS256,0,0,0}, nasm_bytecodes+9714, IF_AVX|IF_SANDYBRIDGE},
+    /* 2254 */ {I_VMAXSD, 3, {XMMREG,XMMREG,RM_XMM|BITS64,0,0}, nasm_bytecodes+9721, IF_AVX|IF_SANDYBRIDGE},
+    /* 2255 */ {I_VMAXSD, 2, {XMMREG,RM_XMM|BITS64,0,0,0}, nasm_bytecodes+9728, IF_AVX|IF_SANDYBRIDGE},
+    /* 2256 */ {I_VMAXSS, 3, {XMMREG,XMMREG,RM_XMM|BITS32,0,0}, nasm_bytecodes+9735, IF_AVX|IF_SANDYBRIDGE},
+    /* 2257 */ {I_VMAXSS, 2, {XMMREG,RM_XMM|BITS32,0,0,0}, nasm_bytecodes+9742, IF_AVX|IF_SANDYBRIDGE},
+    /* 2258 */ {I_VMINPD, 3, {XMMREG,XMMREG,RM_XMM|BITS128,0,0}, nasm_bytecodes+9749, IF_AVX|IF_SANDYBRIDGE},
+    /* 2259 */ {I_VMINPD, 2, {XMMREG,RM_XMM|BITS128,0,0,0}, nasm_bytecodes+9756, IF_AVX|IF_SANDYBRIDGE},
+    /* 2260 */ {I_VMINPD, 3, {YMMREG,YMMREG,RM_YMM|BITS256,0,0}, nasm_bytecodes+9763, IF_AVX|IF_SANDYBRIDGE},
+    /* 2261 */ {I_VMINPD, 2, {YMMREG,RM_YMM|BITS256,0,0,0}, nasm_bytecodes+9770, IF_AVX|IF_SANDYBRIDGE},
+    /* 2262 */ {I_VMINPS, 3, {XMMREG,XMMREG,RM_XMM|BITS128,0,0}, nasm_bytecodes+9777, IF_AVX|IF_SANDYBRIDGE},
+    /* 2263 */ {I_VMINPS, 2, {XMMREG,RM_XMM|BITS128,0,0,0}, nasm_bytecodes+9784, IF_AVX|IF_SANDYBRIDGE},
+    /* 2264 */ {I_VMINPS, 3, {YMMREG,YMMREG,RM_YMM|BITS256,0,0}, nasm_bytecodes+9791, IF_AVX|IF_SANDYBRIDGE},
+    /* 2265 */ {I_VMINPS, 2, {YMMREG,RM_YMM|BITS256,0,0,0}, nasm_bytecodes+9798, IF_AVX|IF_SANDYBRIDGE},
+    /* 2266 */ {I_VMINSD, 3, {XMMREG,XMMREG,RM_XMM|BITS64,0,0}, nasm_bytecodes+9805, IF_AVX|IF_SANDYBRIDGE},
+    /* 2267 */ {I_VMINSD, 2, {XMMREG,RM_XMM|BITS64,0,0,0}, nasm_bytecodes+9812, IF_AVX|IF_SANDYBRIDGE},
+    /* 2268 */ {I_VMINSS, 3, {XMMREG,XMMREG,RM_XMM|BITS32,0,0}, nasm_bytecodes+9819, IF_AVX|IF_SANDYBRIDGE},
+    /* 2269 */ {I_VMINSS, 2, {XMMREG,RM_XMM|BITS32,0,0,0}, nasm_bytecodes+9826, IF_AVX|IF_SANDYBRIDGE},
+    /* 2270 */ {I_VMOVAPD, 2, {XMMREG,RM_XMM|BITS128,0,0,0}, nasm_bytecodes+9833, IF_AVX|IF_SANDYBRIDGE},
+    /* 2271 */ {I_VMOVAPD, 2, {RM_XMM|BITS128,XMMREG,0,0,0}, nasm_bytecodes+9840, IF_AVX|IF_SANDYBRIDGE},
+    /* 2272 */ {I_VMOVAPD, 2, {YMMREG,RM_YMM|BITS256,0,0,0}, nasm_bytecodes+9847, IF_AVX|IF_SANDYBRIDGE},
+    /* 2273 */ {I_VMOVAPD, 2, {RM_YMM|BITS256,YMMREG,0,0,0}, nasm_bytecodes+9854, IF_AVX|IF_SANDYBRIDGE},
+    /* 2274 */ {I_VMOVAPS, 2, {XMMREG,RM_XMM|BITS128,0,0,0}, nasm_bytecodes+9861, IF_AVX|IF_SANDYBRIDGE},
+    /* 2275 */ {I_VMOVAPS, 2, {RM_XMM|BITS128,XMMREG,0,0,0}, nasm_bytecodes+9868, IF_AVX|IF_SANDYBRIDGE},
+    /* 2276 */ {I_VMOVAPS, 2, {YMMREG,RM_YMM|BITS256,0,0,0}, nasm_bytecodes+9875, IF_AVX|IF_SANDYBRIDGE},
+    /* 2277 */ {I_VMOVAPS, 2, {RM_YMM|BITS256,YMMREG,0,0,0}, nasm_bytecodes+9882, IF_AVX|IF_SANDYBRIDGE},
+    /* 2278 */ {I_VMOVQ, 2, {XMMREG,RM_XMM|BITS64,0,0,0}, nasm_bytecodes+9889, IF_AVX|IF_SANDYBRIDGE|IF_SQ},
+    /* 2279 */ {I_VMOVQ, 2, {RM_XMM|BITS64,XMMREG,0,0,0}, nasm_bytecodes+9896, IF_AVX|IF_SANDYBRIDGE|IF_SQ},
+    /* 2280 */ {I_VMOVQ, 2, {XMMREG,RM_GPR|BITS64,0,0,0}, nasm_bytecodes+9903, IF_AVX|IF_SANDYBRIDGE|IF_LONG|IF_SQ},
+    /* 2281 */ {I_VMOVQ, 2, {RM_GPR|BITS64,XMMREG,0,0,0}, nasm_bytecodes+9910, IF_AVX|IF_SANDYBRIDGE|IF_LONG|IF_SQ},
+    /* 2282 */ {I_VMOVD, 2, {XMMREG,RM_GPR|BITS32,0,0,0}, nasm_bytecodes+9917, IF_AVX|IF_SANDYBRIDGE},
+    /* 2283 */ {I_VMOVD, 2, {RM_GPR|BITS32,XMMREG,0,0,0}, nasm_bytecodes+9924, IF_AVX|IF_SANDYBRIDGE},
+    /* 2284 */ {I_VMOVDDUP, 2, {XMMREG,RM_XMM|BITS64,0,0,0}, nasm_bytecodes+9931, IF_AVX|IF_SANDYBRIDGE},
+    /* 2285 */ {I_VMOVDDUP, 2, {YMMREG,RM_YMM|BITS256,0,0,0}, nasm_bytecodes+9938, IF_AVX|IF_SANDYBRIDGE},
+    /* 2286 */ {I_VMOVDQA, 2, {XMMREG,RM_XMM|BITS128,0,0,0}, nasm_bytecodes+9945, IF_AVX|IF_SANDYBRIDGE},
+    /* 2287 */ {I_VMOVDQA, 2, {RM_XMM|BITS128,XMMREG,0,0,0}, nasm_bytecodes+9952, IF_AVX|IF_SANDYBRIDGE},
+    /* 2288 */ {I_VMOVQQA, 2, {YMMREG,RM_YMM|BITS256,0,0,0}, nasm_bytecodes+9959, IF_AVX|IF_SANDYBRIDGE},
+    /* 2289 */ {I_VMOVQQA, 2, {RM_YMM|BITS256,YMMREG,0,0,0}, nasm_bytecodes+9966, IF_AVX|IF_SANDYBRIDGE},
+    /* 2290 */ {I_VMOVDQA, 2, {YMMREG,RM_YMM,0,0,0}, nasm_bytecodes+9959, IF_AVX|IF_SANDYBRIDGE},
+    /* 2291 */ {I_VMOVDQA, 2, {RM_YMM|BITS256,YMMREG,0,0,0}, nasm_bytecodes+9966, IF_AVX|IF_SANDYBRIDGE},
+    /* 2292 */ {I_VMOVDQU, 2, {XMMREG,RM_XMM|BITS128,0,0,0}, nasm_bytecodes+9973, IF_AVX|IF_SANDYBRIDGE},
+    /* 2293 */ {I_VMOVDQU, 2, {RM_XMM|BITS128,XMMREG,0,0,0}, nasm_bytecodes+9980, IF_AVX|IF_SANDYBRIDGE},
+    /* 2294 */ {I_VMOVQQU, 2, {YMMREG,RM_YMM|BITS256,0,0,0}, nasm_bytecodes+9987, IF_AVX|IF_SANDYBRIDGE},
+    /* 2295 */ {I_VMOVQQU, 2, {RM_YMM|BITS256,YMMREG,0,0,0}, nasm_bytecodes+9994, IF_AVX|IF_SANDYBRIDGE},
+    /* 2296 */ {I_VMOVDQU, 2, {YMMREG,RM_YMM|BITS256,0,0,0}, nasm_bytecodes+9987, IF_AVX|IF_SANDYBRIDGE},
+    /* 2297 */ {I_VMOVDQU, 2, {RM_YMM|BITS256,YMMREG,0,0,0}, nasm_bytecodes+9994, IF_AVX|IF_SANDYBRIDGE},
+    /* 2298 */ {I_VMOVHLPS, 3, {XMMREG,XMMREG,XMMREG,0,0}, nasm_bytecodes+10001, IF_AVX|IF_SANDYBRIDGE},
+    /* 2299 */ {I_VMOVHLPS, 2, {XMMREG,XMMREG,0,0,0}, nasm_bytecodes+10008, IF_AVX|IF_SANDYBRIDGE},
+    /* 2300 */ {I_VMOVHPD, 3, {XMMREG,XMMREG,MEMORY|BITS64,0,0}, nasm_bytecodes+10015, IF_AVX|IF_SANDYBRIDGE},
+    /* 2301 */ {I_VMOVHPD, 2, {XMMREG,MEMORY|BITS64,0,0,0}, nasm_bytecodes+10022, IF_AVX|IF_SANDYBRIDGE},
+    /* 2302 */ {I_VMOVHPD, 2, {MEMORY|BITS64,XMMREG,0,0,0}, nasm_bytecodes+10029, IF_AVX|IF_SANDYBRIDGE},
+    /* 2303 */ {I_VMOVHPS, 3, {XMMREG,XMMREG,MEMORY|BITS64,0,0}, nasm_bytecodes+10036, IF_AVX|IF_SANDYBRIDGE},
+    /* 2304 */ {I_VMOVHPS, 2, {XMMREG,MEMORY|BITS64,0,0,0}, nasm_bytecodes+10043, IF_AVX|IF_SANDYBRIDGE},
+    /* 2305 */ {I_VMOVHPS, 2, {MEMORY|BITS64,XMMREG,0,0,0}, nasm_bytecodes+10050, IF_AVX|IF_SANDYBRIDGE},
+    /* 2306 */ {I_VMOVLHPS, 3, {XMMREG,XMMREG,XMMREG,0,0}, nasm_bytecodes+10036, IF_AVX|IF_SANDYBRIDGE},
+    /* 2307 */ {I_VMOVLHPS, 2, {XMMREG,XMMREG,0,0,0}, nasm_bytecodes+10043, IF_AVX|IF_SANDYBRIDGE},
+    /* 2308 */ {I_VMOVLPD, 3, {XMMREG,XMMREG,MEMORY|BITS64,0,0}, nasm_bytecodes+10057, IF_AVX|IF_SANDYBRIDGE},
+    /* 2309 */ {I_VMOVLPD, 2, {XMMREG,MEMORY|BITS64,0,0,0}, nasm_bytecodes+10064, IF_AVX|IF_SANDYBRIDGE},
+    /* 2310 */ {I_VMOVLPD, 2, {MEMORY|BITS64,XMMREG,0,0,0}, nasm_bytecodes+10071, IF_AVX|IF_SANDYBRIDGE},
+    /* 2311 */ {I_VMOVLPS, 3, {XMMREG,XMMREG,MEMORY|BITS64,0,0}, nasm_bytecodes+10001, IF_AVX|IF_SANDYBRIDGE},
+    /* 2312 */ {I_VMOVLPS, 2, {XMMREG,MEMORY|BITS64,0,0,0}, nasm_bytecodes+10008, IF_AVX|IF_SANDYBRIDGE},
+    /* 2313 */ {I_VMOVLPS, 2, {MEMORY|BITS64,XMMREG,0,0,0}, nasm_bytecodes+10078, IF_AVX|IF_SANDYBRIDGE},
+    /* 2314 */ {I_VMOVMSKPD, 2, {REG_GPR|BITS64,XMMREG,0,0,0}, nasm_bytecodes+10085, IF_AVX|IF_SANDYBRIDGE|IF_LONG},
+    /* 2315 */ {I_VMOVMSKPD, 2, {REG_GPR|BITS32,XMMREG,0,0,0}, nasm_bytecodes+10085, IF_AVX|IF_SANDYBRIDGE},
+    /* 2316 */ {I_VMOVMSKPD, 2, {REG_GPR|BITS64,YMMREG,0,0,0}, nasm_bytecodes+10092, IF_AVX|IF_SANDYBRIDGE|IF_LONG},
+    /* 2317 */ {I_VMOVMSKPD, 2, {REG_GPR|BITS32,YMMREG,0,0,0}, nasm_bytecodes+10092, IF_AVX|IF_SANDYBRIDGE},
+    /* 2318 */ {I_VMOVMSKPS, 2, {REG_GPR|BITS64,XMMREG,0,0,0}, nasm_bytecodes+10099, IF_AVX|IF_SANDYBRIDGE|IF_LONG},
+    /* 2319 */ {I_VMOVMSKPS, 2, {REG_GPR|BITS32,XMMREG,0,0,0}, nasm_bytecodes+10099, IF_AVX|IF_SANDYBRIDGE},
+    /* 2320 */ {I_VMOVMSKPS, 2, {REG_GPR|BITS64,YMMREG,0,0,0}, nasm_bytecodes+10106, IF_AVX|IF_SANDYBRIDGE|IF_LONG},
+    /* 2321 */ {I_VMOVMSKPS, 2, {REG_GPR|BITS32,YMMREG,0,0,0}, nasm_bytecodes+10106, IF_AVX|IF_SANDYBRIDGE},
+    /* 2322 */ {I_VMOVNTDQ, 2, {MEMORY|BITS128,XMMREG,0,0,0}, nasm_bytecodes+10113, IF_AVX|IF_SANDYBRIDGE},
+    /* 2323 */ {I_VMOVNTQQ, 2, {MEMORY|BITS256,YMMREG,0,0,0}, nasm_bytecodes+10120, IF_AVX|IF_SANDYBRIDGE},
+    /* 2324 */ {I_VMOVNTDQ, 2, {MEMORY|BITS256,YMMREG,0,0,0}, nasm_bytecodes+10120, IF_AVX|IF_SANDYBRIDGE},
+    /* 2325 */ {I_VMOVNTDQA, 2, {XMMREG,MEMORY|BITS128,0,0,0}, nasm_bytecodes+10127, IF_AVX|IF_SANDYBRIDGE},
+    /* 2326 */ {I_VMOVNTPD, 2, {MEMORY|BITS128,XMMREG,0,0,0}, nasm_bytecodes+10134, IF_AVX|IF_SANDYBRIDGE},
+    /* 2327 */ {I_VMOVNTPD, 2, {MEMORY|BITS256,YMMREG,0,0,0}, nasm_bytecodes+10141, IF_AVX|IF_SANDYBRIDGE},
+    /* 2328 */ {I_VMOVNTPS, 2, {MEMORY|BITS128,XMMREG,0,0,0}, nasm_bytecodes+10148, IF_AVX|IF_SANDYBRIDGE},
+    /* 2329 */ {I_VMOVNTPS, 2, {MEMORY|BITS128,YMMREG,0,0,0}, nasm_bytecodes+10155, IF_AVX|IF_SANDYBRIDGE},
+    /* 2330 */ {I_VMOVSD, 3, {XMMREG,XMMREG,XMMREG,0,0}, nasm_bytecodes+10162, IF_AVX|IF_SANDYBRIDGE},
+    /* 2331 */ {I_VMOVSD, 2, {XMMREG,XMMREG,0,0,0}, nasm_bytecodes+10169, IF_AVX|IF_SANDYBRIDGE},
+    /* 2332 */ {I_VMOVSD, 2, {XMMREG,MEMORY|BITS64,0,0,0}, nasm_bytecodes+10176, IF_AVX|IF_SANDYBRIDGE},
+    /* 2333 */ {I_VMOVSD, 3, {XMMREG,XMMREG,XMMREG,0,0}, nasm_bytecodes+10183, IF_AVX|IF_SANDYBRIDGE},
+    /* 2334 */ {I_VMOVSD, 2, {XMMREG,XMMREG,0,0,0}, nasm_bytecodes+10190, IF_AVX|IF_SANDYBRIDGE},
+    /* 2335 */ {I_VMOVSD, 2, {MEMORY|BITS64,XMMREG,0,0,0}, nasm_bytecodes+10197, IF_AVX|IF_SANDYBRIDGE},
+    /* 2336 */ {I_VMOVSHDUP, 2, {XMMREG,RM_XMM|BITS128,0,0,0}, nasm_bytecodes+10204, IF_AVX|IF_SANDYBRIDGE},
+    /* 2337 */ {I_VMOVSHDUP, 2, {YMMREG,RM_YMM|BITS256,0,0,0}, nasm_bytecodes+10211, IF_AVX|IF_SANDYBRIDGE},
+    /* 2338 */ {I_VMOVSLDUP, 2, {XMMREG,RM_XMM|BITS128,0,0,0}, nasm_bytecodes+10218, IF_AVX|IF_SANDYBRIDGE},
+    /* 2339 */ {I_VMOVSLDUP, 2, {YMMREG,RM_YMM|BITS256,0,0,0}, nasm_bytecodes+10225, IF_AVX|IF_SANDYBRIDGE},
+    /* 2340 */ {I_VMOVSS, 3, {XMMREG,XMMREG,XMMREG,0,0}, nasm_bytecodes+10232, IF_AVX|IF_SANDYBRIDGE},
+    /* 2341 */ {I_VMOVSS, 2, {XMMREG,XMMREG,0,0,0}, nasm_bytecodes+10239, IF_AVX|IF_SANDYBRIDGE},
+    /* 2342 */ {I_VMOVSS, 2, {XMMREG,MEMORY|BITS64,0,0,0}, nasm_bytecodes+10246, IF_AVX|IF_SANDYBRIDGE},
+    /* 2343 */ {I_VMOVSS, 3, {XMMREG,XMMREG,XMMREG,0,0}, nasm_bytecodes+10253, IF_AVX|IF_SANDYBRIDGE},
+    /* 2344 */ {I_VMOVSS, 2, {XMMREG,XMMREG,0,0,0}, nasm_bytecodes+10260, IF_AVX|IF_SANDYBRIDGE},
+    /* 2345 */ {I_VMOVSS, 2, {MEMORY|BITS64,XMMREG,0,0,0}, nasm_bytecodes+10267, IF_AVX|IF_SANDYBRIDGE},
+    /* 2346 */ {I_VMOVUPD, 2, {XMMREG,RM_XMM|BITS128,0,0,0}, nasm_bytecodes+10274, IF_AVX|IF_SANDYBRIDGE},
+    /* 2347 */ {I_VMOVUPD, 2, {RM_XMM|BITS128,XMMREG,0,0,0}, nasm_bytecodes+10281, IF_AVX|IF_SANDYBRIDGE},
+    /* 2348 */ {I_VMOVUPD, 2, {YMMREG,RM_YMM|BITS256,0,0,0}, nasm_bytecodes+10288, IF_AVX|IF_SANDYBRIDGE},
+    /* 2349 */ {I_VMOVUPD, 2, {RM_YMM|BITS256,YMMREG,0,0,0}, nasm_bytecodes+10295, IF_AVX|IF_SANDYBRIDGE},
+    /* 2350 */ {I_VMOVUPS, 2, {XMMREG,RM_XMM|BITS128,0,0,0}, nasm_bytecodes+10302, IF_AVX|IF_SANDYBRIDGE},
+    /* 2351 */ {I_VMOVUPS, 2, {RM_XMM|BITS128,XMMREG,0,0,0}, nasm_bytecodes+10309, IF_AVX|IF_SANDYBRIDGE},
+    /* 2352 */ {I_VMOVUPS, 2, {YMMREG,RM_YMM|BITS256,0,0,0}, nasm_bytecodes+10316, IF_AVX|IF_SANDYBRIDGE},
+    /* 2353 */ {I_VMOVUPS, 2, {RM_YMM|BITS256,YMMREG,0,0,0}, nasm_bytecodes+10323, IF_AVX|IF_SANDYBRIDGE},
+    /* 2354 */ {I_VMPSADBW, 4, {XMMREG,XMMREG,RM_XMM|BITS128,IMMEDIATE|BITS8,0}, nasm_bytecodes+6372, IF_AVX|IF_SANDYBRIDGE},
+    /* 2355 */ {I_VMPSADBW, 3, {XMMREG,RM_XMM|BITS128,IMMEDIATE|BITS8,0,0}, nasm_bytecodes+6380, IF_AVX|IF_SANDYBRIDGE},
+    /* 2356 */ {I_VMULPD, 3, {XMMREG,XMMREG,RM_XMM|BITS128,0,0}, nasm_bytecodes+10330, IF_AVX|IF_SANDYBRIDGE},
+    /* 2357 */ {I_VMULPD, 2, {XMMREG,RM_XMM|BITS128,0,0,0}, nasm_bytecodes+10337, IF_AVX|IF_SANDYBRIDGE},
+    /* 2358 */ {I_VMULPD, 3, {YMMREG,YMMREG,RM_YMM|BITS256,0,0}, nasm_bytecodes+10344, IF_AVX|IF_SANDYBRIDGE},
+    /* 2359 */ {I_VMULPD, 2, {YMMREG,RM_YMM|BITS256,0,0,0}, nasm_bytecodes+10351, IF_AVX|IF_SANDYBRIDGE},
+    /* 2360 */ {I_VMULPS, 3, {XMMREG,XMMREG,RM_XMM|BITS128,0,0}, nasm_bytecodes+10358, IF_AVX|IF_SANDYBRIDGE},
+    /* 2361 */ {I_VMULPS, 2, {XMMREG,RM_XMM|BITS128,0,0,0}, nasm_bytecodes+10365, IF_AVX|IF_SANDYBRIDGE},
+    /* 2362 */ {I_VMULPS, 3, {YMMREG,YMMREG,RM_YMM|BITS256,0,0}, nasm_bytecodes+10372, IF_AVX|IF_SANDYBRIDGE},
+    /* 2363 */ {I_VMULPS, 2, {YMMREG,RM_YMM|BITS256,0,0,0}, nasm_bytecodes+10379, IF_AVX|IF_SANDYBRIDGE},
+    /* 2364 */ {I_VMULSD, 3, {XMMREG,XMMREG,RM_XMM|BITS64,0,0}, nasm_bytecodes+10386, IF_AVX|IF_SANDYBRIDGE},
+    /* 2365 */ {I_VMULSD, 2, {XMMREG,RM_XMM|BITS64,0,0,0}, nasm_bytecodes+10393, IF_AVX|IF_SANDYBRIDGE},
+    /* 2366 */ {I_VMULSS, 3, {XMMREG,XMMREG,RM_XMM|BITS32,0,0}, nasm_bytecodes+10400, IF_AVX|IF_SANDYBRIDGE},
+    /* 2367 */ {I_VMULSS, 2, {XMMREG,RM_XMM|BITS32,0,0,0}, nasm_bytecodes+10407, IF_AVX|IF_SANDYBRIDGE},
+    /* 2368 */ {I_VORPD, 3, {XMMREG,XMMREG,RM_XMM|BITS128,0,0}, nasm_bytecodes+10414, IF_AVX|IF_SANDYBRIDGE},
+    /* 2369 */ {I_VORPD, 2, {XMMREG,RM_XMM|BITS128,0,0,0}, nasm_bytecodes+10421, IF_AVX|IF_SANDYBRIDGE},
+    /* 2370 */ {I_VORPD, 3, {YMMREG,YMMREG,RM_YMM|BITS256,0,0}, nasm_bytecodes+10428, IF_AVX|IF_SANDYBRIDGE},
+    /* 2371 */ {I_VORPD, 2, {YMMREG,RM_YMM|BITS256,0,0,0}, nasm_bytecodes+10435, IF_AVX|IF_SANDYBRIDGE},
+    /* 2372 */ {I_VORPS, 3, {XMMREG,XMMREG,RM_XMM|BITS128,0,0}, nasm_bytecodes+10442, IF_AVX|IF_SANDYBRIDGE},
+    /* 2373 */ {I_VORPS, 2, {XMMREG,RM_XMM|BITS128,0,0,0}, nasm_bytecodes+10449, IF_AVX|IF_SANDYBRIDGE},
+    /* 2374 */ {I_VORPS, 3, {YMMREG,YMMREG,RM_YMM|BITS256,0,0}, nasm_bytecodes+10456, IF_AVX|IF_SANDYBRIDGE},
+    /* 2375 */ {I_VORPS, 2, {YMMREG,RM_YMM|BITS256,0,0,0}, nasm_bytecodes+10463, IF_AVX|IF_SANDYBRIDGE},
+    /* 2376 */ {I_VPABSB, 2, {XMMREG,RM_XMM|BITS128,0,0,0}, nasm_bytecodes+10470, IF_AVX|IF_SANDYBRIDGE},
+    /* 2377 */ {I_VPABSW, 2, {XMMREG,RM_XMM|BITS128,0,0,0}, nasm_bytecodes+10477, IF_AVX|IF_SANDYBRIDGE},
+    /* 2378 */ {I_VPABSD, 2, {XMMREG,RM_XMM|BITS128,0,0,0}, nasm_bytecodes+10484, IF_AVX|IF_SANDYBRIDGE},
+    /* 2379 */ {I_VPACKSSWB, 3, {XMMREG,XMMREG,RM_XMM|BITS128,0,0}, nasm_bytecodes+10491, IF_AVX|IF_SANDYBRIDGE},
+    /* 2380 */ {I_VPACKSSWB, 2, {XMMREG,RM_XMM|BITS128,0,0,0}, nasm_bytecodes+10498, IF_AVX|IF_SANDYBRIDGE},
+    /* 2381 */ {I_VPACKSSDW, 3, {XMMREG,XMMREG,RM_XMM|BITS128,0,0}, nasm_bytecodes+10505, IF_AVX|IF_SANDYBRIDGE},
+    /* 2382 */ {I_VPACKSSDW, 2, {XMMREG,RM_XMM|BITS128,0,0,0}, nasm_bytecodes+10512, IF_AVX|IF_SANDYBRIDGE},
+    /* 2383 */ {I_VPACKUSWB, 3, {XMMREG,XMMREG,RM_XMM|BITS128,0,0}, nasm_bytecodes+10519, IF_AVX|IF_SANDYBRIDGE},
+    /* 2384 */ {I_VPACKUSWB, 2, {XMMREG,RM_XMM|BITS128,0,0,0}, nasm_bytecodes+10526, IF_AVX|IF_SANDYBRIDGE},
+    /* 2385 */ {I_VPACKUSDW, 3, {XMMREG,XMMREG,RM_XMM|BITS128,0,0}, nasm_bytecodes+10533, IF_AVX|IF_SANDYBRIDGE},
+    /* 2386 */ {I_VPACKUSDW, 2, {XMMREG,RM_XMM|BITS128,0,0,0}, nasm_bytecodes+10540, IF_AVX|IF_SANDYBRIDGE},
+    /* 2387 */ {I_VPADDB, 3, {XMMREG,XMMREG,RM_XMM|BITS128,0,0}, nasm_bytecodes+10547, IF_AVX|IF_SANDYBRIDGE},
+    /* 2388 */ {I_VPADDB, 2, {XMMREG,RM_XMM|BITS128,0,0,0}, nasm_bytecodes+10554, IF_AVX|IF_SANDYBRIDGE},
+    /* 2389 */ {I_VPADDW, 3, {XMMREG,XMMREG,RM_XMM|BITS128,0,0}, nasm_bytecodes+10561, IF_AVX|IF_SANDYBRIDGE},
+    /* 2390 */ {I_VPADDW, 2, {XMMREG,RM_XMM|BITS128,0,0,0}, nasm_bytecodes+10568, IF_AVX|IF_SANDYBRIDGE},
+    /* 2391 */ {I_VPADDD, 3, {XMMREG,XMMREG,RM_XMM|BITS128,0,0}, nasm_bytecodes+10575, IF_AVX|IF_SANDYBRIDGE},
+    /* 2392 */ {I_VPADDD, 2, {XMMREG,RM_XMM|BITS128,0,0,0}, nasm_bytecodes+10582, IF_AVX|IF_SANDYBRIDGE},
+    /* 2393 */ {I_VPADDQ, 3, {XMMREG,XMMREG,RM_XMM|BITS128,0,0}, nasm_bytecodes+10589, IF_AVX|IF_SANDYBRIDGE},
+    /* 2394 */ {I_VPADDQ, 2, {XMMREG,RM_XMM|BITS128,0,0,0}, nasm_bytecodes+10596, IF_AVX|IF_SANDYBRIDGE},
+    /* 2395 */ {I_VPADDSB, 3, {XMMREG,XMMREG,RM_XMM|BITS128,0,0}, nasm_bytecodes+10603, IF_AVX|IF_SANDYBRIDGE},
+    /* 2396 */ {I_VPADDSB, 2, {XMMREG,RM_XMM|BITS128,0,0,0}, nasm_bytecodes+10610, IF_AVX|IF_SANDYBRIDGE},
+    /* 2397 */ {I_VPADDSW, 3, {XMMREG,XMMREG,RM_XMM|BITS128,0,0}, nasm_bytecodes+10617, IF_AVX|IF_SANDYBRIDGE},
+    /* 2398 */ {I_VPADDSW, 2, {XMMREG,RM_XMM|BITS128,0,0,0}, nasm_bytecodes+10624, IF_AVX|IF_SANDYBRIDGE},
+    /* 2399 */ {I_VPADDUSB, 3, {XMMREG,XMMREG,RM_XMM|BITS128,0,0}, nasm_bytecodes+10631, IF_AVX|IF_SANDYBRIDGE},
+    /* 2400 */ {I_VPADDUSB, 2, {XMMREG,RM_XMM|BITS128,0,0,0}, nasm_bytecodes+10638, IF_AVX|IF_SANDYBRIDGE},
+    /* 2401 */ {I_VPADDUSW, 3, {XMMREG,XMMREG,RM_XMM|BITS128,0,0}, nasm_bytecodes+10645, IF_AVX|IF_SANDYBRIDGE},
+    /* 2402 */ {I_VPADDUSW, 2, {XMMREG,RM_XMM|BITS128,0,0,0}, nasm_bytecodes+10652, IF_AVX|IF_SANDYBRIDGE},
+    /* 2403 */ {I_VPALIGNR, 4, {XMMREG,XMMREG,RM_XMM|BITS128,IMMEDIATE|BITS8,0}, nasm_bytecodes+6388, IF_AVX|IF_SANDYBRIDGE},
+    /* 2404 */ {I_VPALIGNR, 3, {XMMREG,RM_XMM|BITS128,IMMEDIATE|BITS8,0,0}, nasm_bytecodes+6396, IF_AVX|IF_SANDYBRIDGE},
+    /* 2405 */ {I_VPAND, 3, {XMMREG,XMMREG,RM_XMM|BITS128,0,0}, nasm_bytecodes+10659, IF_AVX|IF_SANDYBRIDGE},
+    /* 2406 */ {I_VPAND, 2, {XMMREG,RM_XMM|BITS128,0,0,0}, nasm_bytecodes+10666, IF_AVX|IF_SANDYBRIDGE},
+    /* 2407 */ {I_VPANDN, 3, {XMMREG,XMMREG,RM_XMM|BITS128,0,0}, nasm_bytecodes+10673, IF_AVX|IF_SANDYBRIDGE},
+    /* 2408 */ {I_VPANDN, 2, {XMMREG,RM_XMM|BITS128,0,0,0}, nasm_bytecodes+10680, IF_AVX|IF_SANDYBRIDGE},
+    /* 2409 */ {I_VPAVGB, 3, {XMMREG,XMMREG,RM_XMM|BITS128,0,0}, nasm_bytecodes+10687, IF_AVX|IF_SANDYBRIDGE},
+    /* 2410 */ {I_VPAVGB, 2, {XMMREG,RM_XMM|BITS128,0,0,0}, nasm_bytecodes+10694, IF_AVX|IF_SANDYBRIDGE},
+    /* 2411 */ {I_VPAVGW, 3, {XMMREG,XMMREG,RM_XMM|BITS128,0,0}, nasm_bytecodes+10701, IF_AVX|IF_SANDYBRIDGE},
+    /* 2412 */ {I_VPAVGW, 2, {XMMREG,RM_XMM|BITS128,0,0,0}, nasm_bytecodes+10708, IF_AVX|IF_SANDYBRIDGE},
+    /* 2413 */ {I_VPBLENDVB, 4, {XMMREG,XMMREG,RM_XMM|BITS128,XMMREG,0}, nasm_bytecodes+3546, IF_AVX|IF_SANDYBRIDGE},
+    /* 2414 */ {I_VPBLENDVB, 3, {XMMREG,RM_XMM|BITS128,XMMREG,0,0}, nasm_bytecodes+3555, IF_AVX|IF_SANDYBRIDGE},
+    /* 2415 */ {I_VPBLENDW, 4, {XMMREG,XMMREG,RM_XMM|BITS128,IMMEDIATE|BITS8,0}, nasm_bytecodes+6404, IF_AVX|IF_SANDYBRIDGE},
+    /* 2416 */ {I_VPBLENDW, 3, {XMMREG,RM_XMM|BITS128,IMMEDIATE|BITS8,0,0}, nasm_bytecodes+6412, IF_AVX|IF_SANDYBRIDGE},
+    /* 2417 */ {I_VPCMPESTRI, 3, {XMMREG,RM_XMM|BITS128,IMMEDIATE|BITS8,0,0}, nasm_bytecodes+6420, IF_AVX|IF_SANDYBRIDGE},
+    /* 2418 */ {I_VPCMPESTRM, 3, {XMMREG,RM_XMM|BITS128,IMMEDIATE|BITS8,0,0}, nasm_bytecodes+6428, IF_AVX|IF_SANDYBRIDGE},
+    /* 2419 */ {I_VPCMPISTRI, 3, {XMMREG,RM_XMM|BITS128,IMMEDIATE|BITS8,0,0}, nasm_bytecodes+6436, IF_AVX|IF_SANDYBRIDGE},
+    /* 2420 */ {I_VPCMPISTRM, 3, {XMMREG,RM_XMM|BITS128,IMMEDIATE|BITS8,0,0}, nasm_bytecodes+6444, IF_AVX|IF_SANDYBRIDGE},
+    /* 2421 */ {I_VPCMPEQB, 3, {XMMREG,XMMREG,RM_XMM|BITS128,0,0}, nasm_bytecodes+10715, IF_AVX|IF_SANDYBRIDGE},
+    /* 2422 */ {I_VPCMPEQB, 2, {XMMREG,RM_XMM|BITS128,0,0,0}, nasm_bytecodes+10722, IF_AVX|IF_SANDYBRIDGE},
+    /* 2423 */ {I_VPCMPEQW, 3, {XMMREG,XMMREG,RM_XMM|BITS128,0,0}, nasm_bytecodes+10729, IF_AVX|IF_SANDYBRIDGE},
+    /* 2424 */ {I_VPCMPEQW, 2, {XMMREG,RM_XMM|BITS128,0,0,0}, nasm_bytecodes+10736, IF_AVX|IF_SANDYBRIDGE},
+    /* 2425 */ {I_VPCMPEQD, 3, {XMMREG,XMMREG,RM_XMM|BITS128,0,0}, nasm_bytecodes+10743, IF_AVX|IF_SANDYBRIDGE},
+    /* 2426 */ {I_VPCMPEQD, 2, {XMMREG,RM_XMM|BITS128,0,0,0}, nasm_bytecodes+10750, IF_AVX|IF_SANDYBRIDGE},
+    /* 2427 */ {I_VPCMPEQQ, 3, {XMMREG,XMMREG,RM_XMM|BITS128,0,0}, nasm_bytecodes+10757, IF_AVX|IF_SANDYBRIDGE},
+    /* 2428 */ {I_VPCMPEQQ, 2, {XMMREG,RM_XMM|BITS128,0,0,0}, nasm_bytecodes+10764, IF_AVX|IF_SANDYBRIDGE},
+    /* 2429 */ {I_VPCMPGTB, 3, {XMMREG,XMMREG,RM_XMM|BITS128,0,0}, nasm_bytecodes+10771, IF_AVX|IF_SANDYBRIDGE},
+    /* 2430 */ {I_VPCMPGTB, 2, {XMMREG,RM_XMM|BITS128,0,0,0}, nasm_bytecodes+10778, IF_AVX|IF_SANDYBRIDGE},
+    /* 2431 */ {I_VPCMPGTW, 3, {XMMREG,XMMREG,RM_XMM|BITS128,0,0}, nasm_bytecodes+10785, IF_AVX|IF_SANDYBRIDGE},
+    /* 2432 */ {I_VPCMPGTW, 2, {XMMREG,RM_XMM|BITS128,0,0,0}, nasm_bytecodes+10792, IF_AVX|IF_SANDYBRIDGE},
+    /* 2433 */ {I_VPCMPGTD, 3, {XMMREG,XMMREG,RM_XMM|BITS128,0,0}, nasm_bytecodes+10799, IF_AVX|IF_SANDYBRIDGE},
+    /* 2434 */ {I_VPCMPGTD, 2, {XMMREG,RM_XMM|BITS128,0,0,0}, nasm_bytecodes+10806, IF_AVX|IF_SANDYBRIDGE},
+    /* 2435 */ {I_VPCMPGTQ, 3, {XMMREG,XMMREG,RM_XMM|BITS128,0,0}, nasm_bytecodes+10813, IF_AVX|IF_SANDYBRIDGE},
+    /* 2436 */ {I_VPCMPGTQ, 2, {XMMREG,RM_XMM|BITS128,0,0,0}, nasm_bytecodes+10820, IF_AVX|IF_SANDYBRIDGE},
+    /* 2437 */ {I_VPERMILPD, 3, {XMMREG,XMMREG,RM_XMM|BITS128,0,0}, nasm_bytecodes+10827, IF_AVX|IF_SANDYBRIDGE},
+    /* 2438 */ {I_VPERMILPD, 3, {YMMREG,YMMREG,RM_YMM|BITS256,0,0}, nasm_bytecodes+10834, IF_AVX|IF_SANDYBRIDGE},
+    /* 2439 */ {I_VPERMILPD, 3, {XMMREG,RM_XMM|BITS128,IMMEDIATE|BITS8,0,0}, nasm_bytecodes+6452, IF_AVX|IF_SANDYBRIDGE},
+    /* 2440 */ {I_VPERMILPD, 3, {YMMREG,RM_YMM|BITS256,IMMEDIATE|BITS8,0,0}, nasm_bytecodes+6460, IF_AVX|IF_SANDYBRIDGE},
+    /* 2441 */ {I_VPERMILTD2PD, 4, {XMMREG,XMMREG,RM_XMM|BITS128,XMMREG,0}, nasm_bytecodes+3564, IF_AVX|IF_SANDYBRIDGE},
+    /* 2442 */ {I_VPERMILTD2PD, 4, {XMMREG,XMMREG,XMMREG,RM_XMM|BITS128,0}, nasm_bytecodes+3573, IF_AVX|IF_SANDYBRIDGE},
+    /* 2443 */ {I_VPERMILTD2PD, 4, {YMMREG,YMMREG,RM_YMM|BITS256,YMMREG,0}, nasm_bytecodes+3582, IF_AVX|IF_SANDYBRIDGE},
+    /* 2444 */ {I_VPERMILTD2PD, 4, {YMMREG,YMMREG,YMMREG,RM_YMM|BITS256,0}, nasm_bytecodes+3591, IF_AVX|IF_SANDYBRIDGE},
+    /* 2445 */ {I_VPERMILMO2PD, 4, {XMMREG,XMMREG,RM_XMM|BITS128,XMMREG,0}, nasm_bytecodes+3600, IF_AVX|IF_SANDYBRIDGE},
+    /* 2446 */ {I_VPERMILMO2PD, 4, {XMMREG,XMMREG,XMMREG,RM_XMM|BITS128,0}, nasm_bytecodes+3609, IF_AVX|IF_SANDYBRIDGE},
+    /* 2447 */ {I_VPERMILMO2PD, 4, {YMMREG,YMMREG,RM_YMM|BITS256,YMMREG,0}, nasm_bytecodes+3618, IF_AVX|IF_SANDYBRIDGE},
+    /* 2448 */ {I_VPERMILMO2PD, 4, {YMMREG,YMMREG,YMMREG,RM_YMM|BITS256,0}, nasm_bytecodes+3627, IF_AVX|IF_SANDYBRIDGE},
+    /* 2449 */ {I_VPERMILMZ2PD, 4, {XMMREG,XMMREG,RM_XMM|BITS128,XMMREG,0}, nasm_bytecodes+3636, IF_AVX|IF_SANDYBRIDGE},
+    /* 2450 */ {I_VPERMILMZ2PD, 4, {XMMREG,XMMREG,XMMREG,RM_XMM|BITS128,0}, nasm_bytecodes+3645, IF_AVX|IF_SANDYBRIDGE},
+    /* 2451 */ {I_VPERMILMZ2PD, 4, {YMMREG,YMMREG,RM_YMM|BITS256,YMMREG,0}, nasm_bytecodes+3654, IF_AVX|IF_SANDYBRIDGE},
+    /* 2452 */ {I_VPERMILMZ2PD, 4, {YMMREG,YMMREG,YMMREG,RM_YMM|BITS256,0}, nasm_bytecodes+3663, IF_AVX|IF_SANDYBRIDGE},
+    /* 2453 */ {I_VPERMIL2PD, 5, {XMMREG,XMMREG,RM_XMM|BITS128,XMMREG,IMMEDIATE|BITS8}, nasm_bytecodes+3672, IF_AVX|IF_SANDYBRIDGE},
+    /* 2454 */ {I_VPERMIL2PD, 5, {XMMREG,XMMREG,XMMREG,RM_XMM|BITS128,IMMEDIATE|BITS8}, nasm_bytecodes+3681, IF_AVX|IF_SANDYBRIDGE},
+    /* 2455 */ {I_VPERMIL2PD, 5, {YMMREG,YMMREG,RM_YMM|BITS256,YMMREG,IMMEDIATE|BITS8}, nasm_bytecodes+3690, IF_AVX|IF_SANDYBRIDGE},
+    /* 2456 */ {I_VPERMIL2PD, 5, {YMMREG,YMMREG,YMMREG,RM_YMM|BITS256,IMMEDIATE|BITS8}, nasm_bytecodes+3699, IF_AVX|IF_SANDYBRIDGE},
+    /* 2457 */ {I_VPERMILPS, 3, {XMMREG,XMMREG,RM_XMM|BITS128,0,0}, nasm_bytecodes+10841, IF_AVX|IF_SANDYBRIDGE},
+    /* 2458 */ {I_VPERMILPS, 3, {YMMREG,YMMREG,RM_YMM|BITS256,0,0}, nasm_bytecodes+10848, IF_AVX|IF_SANDYBRIDGE},
+    /* 2459 */ {I_VPERMILPS, 3, {XMMREG,RM_XMM|BITS128,IMMEDIATE|BITS8,0,0}, nasm_bytecodes+6468, IF_AVX|IF_SANDYBRIDGE},
+    /* 2460 */ {I_VPERMILPS, 3, {YMMREG,RM_YMM|BITS256,IMMEDIATE|BITS8,0,0}, nasm_bytecodes+6476, IF_AVX|IF_SANDYBRIDGE},
+    /* 2461 */ {I_VPERMILTD2PS, 4, {XMMREG,XMMREG,RM_XMM|BITS128,XMMREG,0}, nasm_bytecodes+3708, IF_AVX|IF_SANDYBRIDGE},
+    /* 2462 */ {I_VPERMILTD2PS, 4, {XMMREG,XMMREG,XMMREG,RM_XMM|BITS128,0}, nasm_bytecodes+3717, IF_AVX|IF_SANDYBRIDGE},
+    /* 2463 */ {I_VPERMILTD2PS, 4, {YMMREG,YMMREG,RM_YMM|BITS256,YMMREG,0}, nasm_bytecodes+3726, IF_AVX|IF_SANDYBRIDGE},
+    /* 2464 */ {I_VPERMILTD2PS, 4, {YMMREG,YMMREG,YMMREG,RM_YMM|BITS256,0}, nasm_bytecodes+3735, IF_AVX|IF_SANDYBRIDGE},
+    /* 2465 */ {I_VPERMILMO2PS, 4, {XMMREG,XMMREG,RM_XMM|BITS128,XMMREG,0}, nasm_bytecodes+3744, IF_AVX|IF_SANDYBRIDGE},
+    /* 2466 */ {I_VPERMILMO2PS, 4, {XMMREG,XMMREG,XMMREG,RM_XMM|BITS128,0}, nasm_bytecodes+3753, IF_AVX|IF_SANDYBRIDGE},
+    /* 2467 */ {I_VPERMILMO2PS, 4, {YMMREG,YMMREG,RM_YMM|BITS256,YMMREG,0}, nasm_bytecodes+3762, IF_AVX|IF_SANDYBRIDGE},
+    /* 2468 */ {I_VPERMILMO2PS, 4, {YMMREG,YMMREG,YMMREG,RM_YMM|BITS256,0}, nasm_bytecodes+3771, IF_AVX|IF_SANDYBRIDGE},
+    /* 2469 */ {I_VPERMILMZ2PS, 4, {XMMREG,XMMREG,RM_XMM|BITS128,XMMREG,0}, nasm_bytecodes+3780, IF_AVX|IF_SANDYBRIDGE},
+    /* 2470 */ {I_VPERMILMZ2PS, 4, {XMMREG,XMMREG,XMMREG,RM_XMM|BITS128,0}, nasm_bytecodes+3789, IF_AVX|IF_SANDYBRIDGE},
+    /* 2471 */ {I_VPERMILMZ2PS, 4, {YMMREG,YMMREG,RM_YMM|BITS256,YMMREG,0}, nasm_bytecodes+3798, IF_AVX|IF_SANDYBRIDGE},
+    /* 2472 */ {I_VPERMILMZ2PS, 4, {YMMREG,YMMREG,YMMREG,RM_YMM|BITS256,0}, nasm_bytecodes+3807, IF_AVX|IF_SANDYBRIDGE},
+    /* 2473 */ {I_VPERMIL2PS, 5, {XMMREG,XMMREG,RM_XMM|BITS128,XMMREG,IMMEDIATE|BITS8}, nasm_bytecodes+3816, IF_AVX|IF_SANDYBRIDGE},
+    /* 2474 */ {I_VPERMIL2PS, 5, {XMMREG,XMMREG,XMMREG,RM_XMM|BITS128,IMMEDIATE|BITS8}, nasm_bytecodes+3825, IF_AVX|IF_SANDYBRIDGE},
+    /* 2475 */ {I_VPERMIL2PS, 5, {YMMREG,YMMREG,RM_YMM|BITS256,YMMREG,IMMEDIATE|BITS8}, nasm_bytecodes+3834, IF_AVX|IF_SANDYBRIDGE},
+    /* 2476 */ {I_VPERMIL2PS, 5, {YMMREG,YMMREG,YMMREG,RM_YMM|BITS256,IMMEDIATE|BITS8}, nasm_bytecodes+3843, IF_AVX|IF_SANDYBRIDGE},
+    /* 2477 */ {I_VPERM2F128, 4, {YMMREG,YMMREG,RM_YMM|BITS256,IMMEDIATE|BITS8,0}, nasm_bytecodes+6484, IF_AVX|IF_SANDYBRIDGE},
+    /* 2478 */ {I_VPEXTRB, 3, {REG_GPR|BITS64,XMMREG,IMMEDIATE|BITS8,0,0}, nasm_bytecodes+6492, IF_AVX|IF_SANDYBRIDGE|IF_LONG},
+    /* 2479 */ {I_VPEXTRB, 3, {REG_GPR|BITS32,XMMREG,IMMEDIATE|BITS8,0,0}, nasm_bytecodes+6492, IF_AVX|IF_SANDYBRIDGE},
+    /* 2480 */ {I_VPEXTRB, 3, {MEMORY|BITS8,XMMREG,IMMEDIATE|BITS8,0,0}, nasm_bytecodes+6492, IF_AVX|IF_SANDYBRIDGE},
+    /* 2481 */ {I_VPEXTRW, 3, {REG_GPR|BITS64,XMMREG,IMMEDIATE|BITS8,0,0}, nasm_bytecodes+6500, IF_AVX|IF_SANDYBRIDGE|IF_LONG},
+    /* 2482 */ {I_VPEXTRW, 3, {REG_GPR|BITS32,XMMREG,IMMEDIATE|BITS8,0,0}, nasm_bytecodes+6500, IF_AVX|IF_SANDYBRIDGE},
+    /* 2483 */ {I_VPEXTRW, 3, {MEMORY|BITS16,XMMREG,IMMEDIATE|BITS8,0,0}, nasm_bytecodes+6500, IF_AVX|IF_SANDYBRIDGE},
+    /* 2484 */ {I_VPEXTRW, 3, {REG_GPR|BITS64,XMMREG,IMMEDIATE|BITS8,0,0}, nasm_bytecodes+6508, IF_AVX|IF_SANDYBRIDGE|IF_LONG},
+    /* 2485 */ {I_VPEXTRW, 3, {REG_GPR|BITS32,XMMREG,IMMEDIATE|BITS8,0,0}, nasm_bytecodes+6508, IF_AVX|IF_SANDYBRIDGE},
+    /* 2486 */ {I_VPEXTRW, 3, {MEMORY|BITS16,XMMREG,IMMEDIATE|BITS8,0,0}, nasm_bytecodes+6508, IF_AVX|IF_SANDYBRIDGE},
+    /* 2487 */ {I_VPEXTRD, 3, {REG_GPR|BITS64,XMMREG,IMMEDIATE|BITS8,0,0}, nasm_bytecodes+6516, IF_AVX|IF_SANDYBRIDGE|IF_LONG},
+    /* 2488 */ {I_VPEXTRD, 3, {RM_GPR|BITS32,XMMREG,IMMEDIATE|BITS8,0,0}, nasm_bytecodes+6516, IF_AVX|IF_SANDYBRIDGE},
+    /* 2489 */ {I_VPEXTRQ, 3, {RM_GPR|BITS64,XMMREG,IMMEDIATE|BITS8,0,0}, nasm_bytecodes+6524, IF_AVX|IF_SANDYBRIDGE|IF_LONG},
+    /* 2490 */ {I_VPHADDW, 3, {XMMREG,XMMREG,RM_XMM|BITS128,0,0}, nasm_bytecodes+10855, IF_AVX|IF_SANDYBRIDGE},
+    /* 2491 */ {I_VPHADDW, 2, {XMMREG,RM_XMM|BITS128,0,0,0}, nasm_bytecodes+10862, IF_AVX|IF_SANDYBRIDGE},
+    /* 2492 */ {I_VPHADDD, 3, {XMMREG,XMMREG,RM_XMM|BITS128,0,0}, nasm_bytecodes+10869, IF_AVX|IF_SANDYBRIDGE},
+    /* 2493 */ {I_VPHADDD, 2, {XMMREG,RM_XMM|BITS128,0,0,0}, nasm_bytecodes+10876, IF_AVX|IF_SANDYBRIDGE},
+    /* 2494 */ {I_VPHADDSW, 3, {XMMREG,XMMREG,RM_XMM|BITS128,0,0}, nasm_bytecodes+10883, IF_AVX|IF_SANDYBRIDGE},
+    /* 2495 */ {I_VPHADDSW, 2, {XMMREG,RM_XMM|BITS128,0,0,0}, nasm_bytecodes+10890, IF_AVX|IF_SANDYBRIDGE},
+    /* 2496 */ {I_VPHMINPOSUW, 2, {XMMREG,RM_XMM|BITS128,0,0,0}, nasm_bytecodes+10897, IF_AVX|IF_SANDYBRIDGE},
+    /* 2497 */ {I_VPHSUBW, 3, {XMMREG,XMMREG,RM_XMM|BITS128,0,0}, nasm_bytecodes+10904, IF_AVX|IF_SANDYBRIDGE},
+    /* 2498 */ {I_VPHSUBW, 2, {XMMREG,RM_XMM|BITS128,0,0,0}, nasm_bytecodes+10911, IF_AVX|IF_SANDYBRIDGE},
+    /* 2499 */ {I_VPHSUBD, 3, {XMMREG,XMMREG,RM_XMM|BITS128,0,0}, nasm_bytecodes+10918, IF_AVX|IF_SANDYBRIDGE},
+    /* 2500 */ {I_VPHSUBD, 2, {XMMREG,RM_XMM|BITS128,0,0,0}, nasm_bytecodes+10925, IF_AVX|IF_SANDYBRIDGE},
+    /* 2501 */ {I_VPHSUBSW, 3, {XMMREG,XMMREG,RM_XMM|BITS128,0,0}, nasm_bytecodes+10932, IF_AVX|IF_SANDYBRIDGE},
+    /* 2502 */ {I_VPHSUBSW, 2, {XMMREG,RM_XMM|BITS128,0,0,0}, nasm_bytecodes+10939, IF_AVX|IF_SANDYBRIDGE},
+    /* 2503 */ {I_VPINSRB, 4, {XMMREG,XMMREG,MEMORY|BITS8,IMMEDIATE|BITS8,0}, nasm_bytecodes+6532, IF_AVX|IF_SANDYBRIDGE},
+    /* 2504 */ {I_VPINSRB, 3, {XMMREG,MEMORY|BITS8,IMMEDIATE|BITS8,0,0}, nasm_bytecodes+6540, IF_AVX|IF_SANDYBRIDGE},
+    /* 2505 */ {I_VPINSRB, 4, {XMMREG,XMMREG,RM_GPR|BITS8,IMMEDIATE|BITS8,0}, nasm_bytecodes+6532, IF_AVX|IF_SANDYBRIDGE},
+    /* 2506 */ {I_VPINSRB, 3, {XMMREG,RM_GPR|BITS8,IMMEDIATE|BITS8,0,0}, nasm_bytecodes+6540, IF_AVX|IF_SANDYBRIDGE},
+    /* 2507 */ {I_VPINSRB, 4, {XMMREG,XMMREG,REG_GPR|BITS32,IMMEDIATE|BITS8,0}, nasm_bytecodes+6532, IF_AVX|IF_SANDYBRIDGE},
+    /* 2508 */ {I_VPINSRB, 3, {XMMREG,REG_GPR|BITS32,IMMEDIATE|BITS8,0,0}, nasm_bytecodes+6540, IF_AVX|IF_SANDYBRIDGE},
+    /* 2509 */ {I_VPINSRW, 4, {XMMREG,XMMREG,MEMORY|BITS16,IMMEDIATE|BITS8,0}, nasm_bytecodes+6548, IF_AVX|IF_SANDYBRIDGE},
+    /* 2510 */ {I_VPINSRW, 3, {XMMREG,MEMORY|BITS16,IMMEDIATE|BITS8,0,0}, nasm_bytecodes+6556, IF_AVX|IF_SANDYBRIDGE},
+    /* 2511 */ {I_VPINSRW, 4, {XMMREG,XMMREG,RM_GPR|BITS16,IMMEDIATE|BITS8,0}, nasm_bytecodes+6548, IF_AVX|IF_SANDYBRIDGE},
+    /* 2512 */ {I_VPINSRW, 3, {XMMREG,RM_GPR|BITS16,IMMEDIATE|BITS8,0,0}, nasm_bytecodes+6556, IF_AVX|IF_SANDYBRIDGE},
+    /* 2513 */ {I_VPINSRW, 4, {XMMREG,XMMREG,REG_GPR|BITS32,IMMEDIATE|BITS8,0}, nasm_bytecodes+6548, IF_AVX|IF_SANDYBRIDGE},
+    /* 2514 */ {I_VPINSRW, 3, {XMMREG,REG_GPR|BITS32,IMMEDIATE|BITS8,0,0}, nasm_bytecodes+6556, IF_AVX|IF_SANDYBRIDGE},
+    /* 2515 */ {I_VPINSRD, 4, {XMMREG,XMMREG,MEMORY|BITS32,IMMEDIATE|BITS8,0}, nasm_bytecodes+6564, IF_AVX|IF_SANDYBRIDGE},
+    /* 2516 */ {I_VPINSRD, 3, {XMMREG,MEMORY|BITS32,IMMEDIATE|BITS8,0,0}, nasm_bytecodes+6572, IF_AVX|IF_SANDYBRIDGE},
+    /* 2517 */ {I_VPINSRD, 4, {XMMREG,XMMREG,RM_GPR|BITS32,IMMEDIATE|BITS8,0}, nasm_bytecodes+6564, IF_AVX|IF_SANDYBRIDGE},
+    /* 2518 */ {I_VPINSRD, 3, {XMMREG,RM_GPR|BITS32,IMMEDIATE|BITS8,0,0}, nasm_bytecodes+6572, IF_AVX|IF_SANDYBRIDGE},
+    /* 2519 */ {I_VPINSRQ, 4, {XMMREG,XMMREG,MEMORY|BITS64,IMMEDIATE|BITS8,0}, nasm_bytecodes+6580, IF_AVX|IF_SANDYBRIDGE|IF_LONG},
+    /* 2520 */ {I_VPINSRQ, 3, {XMMREG,MEMORY|BITS64,IMMEDIATE|BITS8,0,0}, nasm_bytecodes+6588, IF_AVX|IF_SANDYBRIDGE|IF_LONG},
+    /* 2521 */ {I_VPINSRQ, 4, {XMMREG,XMMREG,RM_GPR|BITS64,IMMEDIATE|BITS8,0}, nasm_bytecodes+6580, IF_AVX|IF_SANDYBRIDGE|IF_LONG},
+    /* 2522 */ {I_VPINSRQ, 3, {XMMREG,RM_GPR|BITS64,IMMEDIATE|BITS8,0,0}, nasm_bytecodes+6588, IF_AVX|IF_SANDYBRIDGE|IF_LONG},
+    /* 2523 */ {I_VPMADDWD, 3, {XMMREG,XMMREG,RM_XMM|BITS128,0,0}, nasm_bytecodes+10946, IF_AVX|IF_SANDYBRIDGE},
+    /* 2524 */ {I_VPMADDWD, 2, {XMMREG,RM_XMM|BITS128,0,0,0}, nasm_bytecodes+10953, IF_AVX|IF_SANDYBRIDGE},
+    /* 2525 */ {I_VPMADDUBSW, 3, {XMMREG,XMMREG,RM_XMM|BITS128,0,0}, nasm_bytecodes+10960, IF_AVX|IF_SANDYBRIDGE},
+    /* 2526 */ {I_VPMADDUBSW, 2, {XMMREG,RM_XMM|BITS128,0,0,0}, nasm_bytecodes+10967, IF_AVX|IF_SANDYBRIDGE},
+    /* 2527 */ {I_VPMAXSB, 3, {XMMREG,XMMREG,RM_XMM|BITS128,0,0}, nasm_bytecodes+10974, IF_AVX|IF_SANDYBRIDGE},
+    /* 2528 */ {I_VPMAXSB, 2, {XMMREG,RM_XMM|BITS128,0,0,0}, nasm_bytecodes+10981, IF_AVX|IF_SANDYBRIDGE},
+    /* 2529 */ {I_VPMAXSW, 3, {XMMREG,XMMREG,RM_XMM|BITS128,0,0}, nasm_bytecodes+10988, IF_AVX|IF_SANDYBRIDGE},
+    /* 2530 */ {I_VPMAXSW, 2, {XMMREG,RM_XMM|BITS128,0,0,0}, nasm_bytecodes+10995, IF_AVX|IF_SANDYBRIDGE},
+    /* 2531 */ {I_VPMAXSD, 3, {XMMREG,XMMREG,RM_XMM|BITS128,0,0}, nasm_bytecodes+11002, IF_AVX|IF_SANDYBRIDGE},
+    /* 2532 */ {I_VPMAXSD, 2, {XMMREG,RM_XMM|BITS128,0,0,0}, nasm_bytecodes+11009, IF_AVX|IF_SANDYBRIDGE},
+    /* 2533 */ {I_VPMAXUB, 3, {XMMREG,XMMREG,RM_XMM|BITS128,0,0}, nasm_bytecodes+11016, IF_AVX|IF_SANDYBRIDGE},
+    /* 2534 */ {I_VPMAXUB, 2, {XMMREG,RM_XMM|BITS128,0,0,0}, nasm_bytecodes+11023, IF_AVX|IF_SANDYBRIDGE},
+    /* 2535 */ {I_VPMAXUW, 3, {XMMREG,XMMREG,RM_XMM|BITS128,0,0}, nasm_bytecodes+11030, IF_AVX|IF_SANDYBRIDGE},
+    /* 2536 */ {I_VPMAXUW, 2, {XMMREG,RM_XMM|BITS128,0,0,0}, nasm_bytecodes+11037, IF_AVX|IF_SANDYBRIDGE},
+    /* 2537 */ {I_VPMAXUD, 3, {XMMREG,XMMREG,RM_XMM|BITS128,0,0}, nasm_bytecodes+11044, IF_AVX|IF_SANDYBRIDGE},
+    /* 2538 */ {I_VPMAXUD, 2, {XMMREG,RM_XMM|BITS128,0,0,0}, nasm_bytecodes+11051, IF_AVX|IF_SANDYBRIDGE},
+    /* 2539 */ {I_VPMINSB, 3, {XMMREG,XMMREG,RM_XMM|BITS128,0,0}, nasm_bytecodes+11058, IF_AVX|IF_SANDYBRIDGE},
+    /* 2540 */ {I_VPMINSB, 2, {XMMREG,RM_XMM|BITS128,0,0,0}, nasm_bytecodes+11065, IF_AVX|IF_SANDYBRIDGE},
+    /* 2541 */ {I_VPMINSW, 3, {XMMREG,XMMREG,RM_XMM|BITS128,0,0}, nasm_bytecodes+11072, IF_AVX|IF_SANDYBRIDGE},
+    /* 2542 */ {I_VPMINSW, 2, {XMMREG,RM_XMM|BITS128,0,0,0}, nasm_bytecodes+11079, IF_AVX|IF_SANDYBRIDGE},
+    /* 2543 */ {I_VPMINSD, 3, {XMMREG,XMMREG,RM_XMM|BITS128,0,0}, nasm_bytecodes+11086, IF_AVX|IF_SANDYBRIDGE},
+    /* 2544 */ {I_VPMINSD, 2, {XMMREG,RM_XMM|BITS128,0,0,0}, nasm_bytecodes+11093, IF_AVX|IF_SANDYBRIDGE},
+    /* 2545 */ {I_VPMINUB, 3, {XMMREG,XMMREG,RM_XMM|BITS128,0,0}, nasm_bytecodes+11100, IF_AVX|IF_SANDYBRIDGE},
+    /* 2546 */ {I_VPMINUB, 2, {XMMREG,RM_XMM|BITS128,0,0,0}, nasm_bytecodes+11107, IF_AVX|IF_SANDYBRIDGE},
+    /* 2547 */ {I_VPMINUW, 3, {XMMREG,XMMREG,RM_XMM|BITS128,0,0}, nasm_bytecodes+11114, IF_AVX|IF_SANDYBRIDGE},
+    /* 2548 */ {I_VPMINUW, 2, {XMMREG,RM_XMM|BITS128,0,0,0}, nasm_bytecodes+11121, IF_AVX|IF_SANDYBRIDGE},
+    /* 2549 */ {I_VPMINUD, 3, {XMMREG,XMMREG,RM_XMM|BITS128,0,0}, nasm_bytecodes+11128, IF_AVX|IF_SANDYBRIDGE},
+    /* 2550 */ {I_VPMINUD, 2, {XMMREG,RM_XMM|BITS128,0,0,0}, nasm_bytecodes+11135, IF_AVX|IF_SANDYBRIDGE},
+    /* 2551 */ {I_VPMOVMSKB, 2, {REG_GPR|BITS64,XMMREG,0,0,0}, nasm_bytecodes+11142, IF_AVX|IF_SANDYBRIDGE|IF_LONG},
+    /* 2552 */ {I_VPMOVMSKB, 2, {REG_GPR|BITS32,XMMREG,0,0,0}, nasm_bytecodes+11142, IF_AVX|IF_SANDYBRIDGE},
+    /* 2553 */ {I_VPMOVSXBW, 2, {XMMREG,RM_XMM|BITS64,0,0,0}, nasm_bytecodes+11149, IF_AVX|IF_SANDYBRIDGE},
+    /* 2554 */ {I_VPMOVSXBD, 2, {XMMREG,RM_XMM|BITS32,0,0,0}, nasm_bytecodes+11156, IF_AVX|IF_SANDYBRIDGE},
+    /* 2555 */ {I_VPMOVSXBQ, 2, {XMMREG,RM_XMM|BITS16,0,0,0}, nasm_bytecodes+11163, IF_AVX|IF_SANDYBRIDGE},
+    /* 2556 */ {I_VPMOVSXWD, 2, {XMMREG,RM_XMM|BITS64,0,0,0}, nasm_bytecodes+11170, IF_AVX|IF_SANDYBRIDGE},
+    /* 2557 */ {I_VPMOVSXWQ, 2, {XMMREG,RM_XMM|BITS32,0,0,0}, nasm_bytecodes+11177, IF_AVX|IF_SANDYBRIDGE},
+    /* 2558 */ {I_VPMOVSXDQ, 2, {XMMREG,RM_XMM|BITS64,0,0,0}, nasm_bytecodes+11184, IF_AVX|IF_SANDYBRIDGE},
+    /* 2559 */ {I_VPMOVZXBW, 2, {XMMREG,RM_XMM|BITS64,0,0,0}, nasm_bytecodes+11191, IF_AVX|IF_SANDYBRIDGE},
+    /* 2560 */ {I_VPMOVZXBD, 2, {XMMREG,RM_XMM|BITS32,0,0,0}, nasm_bytecodes+11198, IF_AVX|IF_SANDYBRIDGE},
+    /* 2561 */ {I_VPMOVZXBQ, 2, {XMMREG,RM_XMM|BITS16,0,0,0}, nasm_bytecodes+11205, IF_AVX|IF_SANDYBRIDGE},
+    /* 2562 */ {I_VPMOVZXWD, 2, {XMMREG,RM_XMM|BITS64,0,0,0}, nasm_bytecodes+11212, IF_AVX|IF_SANDYBRIDGE},
+    /* 2563 */ {I_VPMOVZXWQ, 2, {XMMREG,RM_XMM|BITS32,0,0,0}, nasm_bytecodes+11219, IF_AVX|IF_SANDYBRIDGE},
+    /* 2564 */ {I_VPMOVZXDQ, 2, {XMMREG,RM_XMM|BITS64,0,0,0}, nasm_bytecodes+11226, IF_AVX|IF_SANDYBRIDGE},
+    /* 2565 */ {I_VPMULHUW, 3, {XMMREG,XMMREG,RM_XMM|BITS128,0,0}, nasm_bytecodes+11233, IF_AVX|IF_SANDYBRIDGE},
+    /* 2566 */ {I_VPMULHUW, 2, {XMMREG,RM_XMM|BITS128,0,0,0}, nasm_bytecodes+11240, IF_AVX|IF_SANDYBRIDGE},
+    /* 2567 */ {I_VPMULHRSW, 3, {XMMREG,XMMREG,RM_XMM|BITS128,0,0}, nasm_bytecodes+11247, IF_AVX|IF_SANDYBRIDGE},
+    /* 2568 */ {I_VPMULHRSW, 2, {XMMREG,RM_XMM|BITS128,0,0,0}, nasm_bytecodes+11254, IF_AVX|IF_SANDYBRIDGE},
+    /* 2569 */ {I_VPMULHW, 3, {XMMREG,XMMREG,RM_XMM|BITS128,0,0}, nasm_bytecodes+11261, IF_AVX|IF_SANDYBRIDGE},
+    /* 2570 */ {I_VPMULHW, 2, {XMMREG,RM_XMM|BITS128,0,0,0}, nasm_bytecodes+11268, IF_AVX|IF_SANDYBRIDGE},
+    /* 2571 */ {I_VPMULLW, 3, {XMMREG,XMMREG,RM_XMM|BITS128,0,0}, nasm_bytecodes+11275, IF_AVX|IF_SANDYBRIDGE},
+    /* 2572 */ {I_VPMULLW, 2, {XMMREG,RM_XMM|BITS128,0,0,0}, nasm_bytecodes+11282, IF_AVX|IF_SANDYBRIDGE},
+    /* 2573 */ {I_VPMULLD, 3, {XMMREG,XMMREG,RM_XMM|BITS128,0,0}, nasm_bytecodes+11289, IF_AVX|IF_SANDYBRIDGE},
+    /* 2574 */ {I_VPMULLD, 2, {XMMREG,RM_XMM|BITS128,0,0,0}, nasm_bytecodes+11296, IF_AVX|IF_SANDYBRIDGE},
+    /* 2575 */ {I_VPMULUDQ, 3, {XMMREG,XMMREG,RM_XMM|BITS128,0,0}, nasm_bytecodes+11303, IF_AVX|IF_SANDYBRIDGE},
+    /* 2576 */ {I_VPMULUDQ, 2, {XMMREG,RM_XMM|BITS128,0,0,0}, nasm_bytecodes+11310, IF_AVX|IF_SANDYBRIDGE},
+    /* 2577 */ {I_VPMULDQ, 3, {XMMREG,XMMREG,RM_XMM|BITS128,0,0}, nasm_bytecodes+11317, IF_AVX|IF_SANDYBRIDGE},
+    /* 2578 */ {I_VPMULDQ, 2, {XMMREG,RM_XMM|BITS128,0,0,0}, nasm_bytecodes+11324, IF_AVX|IF_SANDYBRIDGE},
+    /* 2579 */ {I_VPOR, 3, {XMMREG,XMMREG,RM_XMM|BITS128,0,0}, nasm_bytecodes+11331, IF_AVX|IF_SANDYBRIDGE},
+    /* 2580 */ {I_VPOR, 2, {XMMREG,RM_XMM|BITS128,0,0,0}, nasm_bytecodes+11338, IF_AVX|IF_SANDYBRIDGE},
+    /* 2581 */ {I_VPSADBW, 3, {XMMREG,XMMREG,RM_XMM|BITS128,0,0}, nasm_bytecodes+11345, IF_AVX|IF_SANDYBRIDGE},
+    /* 2582 */ {I_VPSADBW, 2, {XMMREG,RM_XMM|BITS128,0,0,0}, nasm_bytecodes+11352, IF_AVX|IF_SANDYBRIDGE},
+    /* 2583 */ {I_VPSHUFB, 3, {XMMREG,XMMREG,RM_XMM|BITS128,0,0}, nasm_bytecodes+11359, IF_AVX|IF_SANDYBRIDGE},
+    /* 2584 */ {I_VPSHUFB, 2, {XMMREG,RM_XMM|BITS128,0,0,0}, nasm_bytecodes+11366, IF_AVX|IF_SANDYBRIDGE},
+    /* 2585 */ {I_VPSHUFD, 3, {XMMREG,RM_XMM|BITS128,IMMEDIATE|BITS8,0,0}, nasm_bytecodes+6596, IF_AVX|IF_SANDYBRIDGE},
+    /* 2586 */ {I_VPSHUFHW, 3, {XMMREG,RM_XMM|BITS128,IMMEDIATE|BITS8,0,0}, nasm_bytecodes+6604, IF_AVX|IF_SANDYBRIDGE},
+    /* 2587 */ {I_VPSHUFLW, 3, {XMMREG,RM_XMM|BITS128,IMMEDIATE|BITS8,0,0}, nasm_bytecodes+6612, IF_AVX|IF_SANDYBRIDGE},
+    /* 2588 */ {I_VPSIGNB, 3, {XMMREG,XMMREG,RM_XMM|BITS128,0,0}, nasm_bytecodes+11373, IF_AVX|IF_SANDYBRIDGE},
+    /* 2589 */ {I_VPSIGNB, 2, {XMMREG,RM_XMM|BITS128,0,0,0}, nasm_bytecodes+11380, IF_AVX|IF_SANDYBRIDGE},
+    /* 2590 */ {I_VPSIGNW, 3, {XMMREG,XMMREG,RM_XMM|BITS128,0,0}, nasm_bytecodes+11387, IF_AVX|IF_SANDYBRIDGE},
+    /* 2591 */ {I_VPSIGNW, 2, {XMMREG,RM_XMM|BITS128,0,0,0}, nasm_bytecodes+11394, IF_AVX|IF_SANDYBRIDGE},
+    /* 2592 */ {I_VPSIGND, 3, {XMMREG,XMMREG,RM_XMM|BITS128,0,0}, nasm_bytecodes+11401, IF_AVX|IF_SANDYBRIDGE},
+    /* 2593 */ {I_VPSIGND, 2, {XMMREG,RM_XMM|BITS128,0,0,0}, nasm_bytecodes+11408, IF_AVX|IF_SANDYBRIDGE},
+    /* 2594 */ {I_VPSLLDQ, 3, {XMMREG,XMMREG,IMMEDIATE|BITS8,0,0}, nasm_bytecodes+6620, IF_AVX|IF_SANDYBRIDGE},
+    /* 2595 */ {I_VPSLLDQ, 2, {XMMREG,IMMEDIATE|BITS8,0,0,0}, nasm_bytecodes+6628, IF_AVX|IF_SANDYBRIDGE},
+    /* 2596 */ {I_VPSRLDQ, 3, {XMMREG,XMMREG,IMMEDIATE|BITS8,0,0}, nasm_bytecodes+6636, IF_AVX|IF_SANDYBRIDGE},
+    /* 2597 */ {I_VPSRLDQ, 2, {XMMREG,IMMEDIATE|BITS8,0,0,0}, nasm_bytecodes+6644, IF_AVX|IF_SANDYBRIDGE},
+    /* 2598 */ {I_VPSLLW, 3, {XMMREG,XMMREG,RM_XMM|BITS128,0,0}, nasm_bytecodes+11415, IF_AVX|IF_SANDYBRIDGE},
+    /* 2599 */ {I_VPSLLW, 2, {XMMREG,RM_XMM|BITS128,0,0,0}, nasm_bytecodes+11422, IF_AVX|IF_SANDYBRIDGE},
+    /* 2600 */ {I_VPSLLW, 3, {XMMREG,XMMREG,IMMEDIATE|BITS8,0,0}, nasm_bytecodes+6652, IF_AVX|IF_SANDYBRIDGE},
+    /* 2601 */ {I_VPSLLW, 2, {XMMREG,IMMEDIATE|BITS8,0,0,0}, nasm_bytecodes+6660, IF_AVX|IF_SANDYBRIDGE},
+    /* 2602 */ {I_VPSLLD, 3, {XMMREG,XMMREG,RM_XMM|BITS128,0,0}, nasm_bytecodes+11429, IF_AVX|IF_SANDYBRIDGE},
+    /* 2603 */ {I_VPSLLD, 2, {XMMREG,RM_XMM|BITS128,0,0,0}, nasm_bytecodes+11436, IF_AVX|IF_SANDYBRIDGE},
+    /* 2604 */ {I_VPSLLD, 3, {XMMREG,XMMREG,IMMEDIATE|BITS8,0,0}, nasm_bytecodes+6668, IF_AVX|IF_SANDYBRIDGE},
+    /* 2605 */ {I_VPSLLD, 2, {XMMREG,IMMEDIATE|BITS8,0,0,0}, nasm_bytecodes+6676, IF_AVX|IF_SANDYBRIDGE},
+    /* 2606 */ {I_VPSLLQ, 3, {XMMREG,XMMREG,RM_XMM|BITS128,0,0}, nasm_bytecodes+11443, IF_AVX|IF_SANDYBRIDGE},
+    /* 2607 */ {I_VPSLLQ, 2, {XMMREG,RM_XMM|BITS128,0,0,0}, nasm_bytecodes+11450, IF_AVX|IF_SANDYBRIDGE},
+    /* 2608 */ {I_VPSLLQ, 3, {XMMREG,XMMREG,IMMEDIATE|BITS8,0,0}, nasm_bytecodes+6684, IF_AVX|IF_SANDYBRIDGE},
+    /* 2609 */ {I_VPSLLQ, 2, {XMMREG,IMMEDIATE|BITS8,0,0,0}, nasm_bytecodes+6692, IF_AVX|IF_SANDYBRIDGE},
+    /* 2610 */ {I_VPSRAW, 3, {XMMREG,XMMREG,RM_XMM|BITS128,0,0}, nasm_bytecodes+11457, IF_AVX|IF_SANDYBRIDGE},
+    /* 2611 */ {I_VPSRAW, 2, {XMMREG,RM_XMM|BITS128,0,0,0}, nasm_bytecodes+11464, IF_AVX|IF_SANDYBRIDGE},
+    /* 2612 */ {I_VPSRAW, 3, {XMMREG,XMMREG,IMMEDIATE|BITS8,0,0}, nasm_bytecodes+6700, IF_AVX|IF_SANDYBRIDGE},
+    /* 2613 */ {I_VPSRAW, 2, {XMMREG,IMMEDIATE|BITS8,0,0,0}, nasm_bytecodes+6708, IF_AVX|IF_SANDYBRIDGE},
+    /* 2614 */ {I_VPSRAD, 3, {XMMREG,XMMREG,RM_XMM|BITS128,0,0}, nasm_bytecodes+11471, IF_AVX|IF_SANDYBRIDGE},
+    /* 2615 */ {I_VPSRAD, 2, {XMMREG,RM_XMM|BITS128,0,0,0}, nasm_bytecodes+11478, IF_AVX|IF_SANDYBRIDGE},
+    /* 2616 */ {I_VPSRAD, 3, {XMMREG,XMMREG,IMMEDIATE|BITS8,0,0}, nasm_bytecodes+6716, IF_AVX|IF_SANDYBRIDGE},
+    /* 2617 */ {I_VPSRAD, 2, {XMMREG,IMMEDIATE|BITS8,0,0,0}, nasm_bytecodes+6724, IF_AVX|IF_SANDYBRIDGE},
+    /* 2618 */ {I_VPSRLW, 3, {XMMREG,XMMREG,RM_XMM|BITS128,0,0}, nasm_bytecodes+11485, IF_AVX|IF_SANDYBRIDGE},
+    /* 2619 */ {I_VPSRLW, 2, {XMMREG,RM_XMM|BITS128,0,0,0}, nasm_bytecodes+11492, IF_AVX|IF_SANDYBRIDGE},
+    /* 2620 */ {I_VPSRLW, 3, {XMMREG,XMMREG,IMMEDIATE|BITS8,0,0}, nasm_bytecodes+6732, IF_AVX|IF_SANDYBRIDGE},
+    /* 2621 */ {I_VPSRLW, 2, {XMMREG,IMMEDIATE|BITS8,0,0,0}, nasm_bytecodes+6740, IF_AVX|IF_SANDYBRIDGE},
+    /* 2622 */ {I_VPSRLD, 3, {XMMREG,XMMREG,RM_XMM|BITS128,0,0}, nasm_bytecodes+11499, IF_AVX|IF_SANDYBRIDGE},
+    /* 2623 */ {I_VPSRLD, 2, {XMMREG,RM_XMM|BITS128,0,0,0}, nasm_bytecodes+11506, IF_AVX|IF_SANDYBRIDGE},
+    /* 2624 */ {I_VPSRLD, 3, {XMMREG,XMMREG,IMMEDIATE|BITS8,0,0}, nasm_bytecodes+6748, IF_AVX|IF_SANDYBRIDGE},
+    /* 2625 */ {I_VPSRLD, 2, {XMMREG,IMMEDIATE|BITS8,0,0,0}, nasm_bytecodes+6756, IF_AVX|IF_SANDYBRIDGE},
+    /* 2626 */ {I_VPSRLQ, 3, {XMMREG,XMMREG,RM_XMM|BITS128,0,0}, nasm_bytecodes+11513, IF_AVX|IF_SANDYBRIDGE},
+    /* 2627 */ {I_VPSRLQ, 2, {XMMREG,RM_XMM|BITS128,0,0,0}, nasm_bytecodes+11520, IF_AVX|IF_SANDYBRIDGE},
+    /* 2628 */ {I_VPSRLQ, 3, {XMMREG,XMMREG,IMMEDIATE|BITS8,0,0}, nasm_bytecodes+6764, IF_AVX|IF_SANDYBRIDGE},
+    /* 2629 */ {I_VPSRLQ, 2, {XMMREG,IMMEDIATE|BITS8,0,0,0}, nasm_bytecodes+6772, IF_AVX|IF_SANDYBRIDGE},
+    /* 2630 */ {I_VPTEST, 2, {XMMREG,RM_XMM|BITS128,0,0,0}, nasm_bytecodes+11527, IF_AVX|IF_SANDYBRIDGE},
+    /* 2631 */ {I_VPTEST, 2, {YMMREG,RM_YMM|BITS256,0,0,0}, nasm_bytecodes+11534, IF_AVX|IF_SANDYBRIDGE},
+    /* 2632 */ {I_VPSUBB, 3, {XMMREG,XMMREG,RM_XMM|BITS128,0,0}, nasm_bytecodes+11541, IF_AVX|IF_SANDYBRIDGE},
+    /* 2633 */ {I_VPSUBB, 2, {XMMREG,RM_XMM|BITS128,0,0,0}, nasm_bytecodes+11548, IF_AVX|IF_SANDYBRIDGE},
+    /* 2634 */ {I_VPSUBW, 3, {XMMREG,XMMREG,RM_XMM|BITS128,0,0}, nasm_bytecodes+11555, IF_AVX|IF_SANDYBRIDGE},
+    /* 2635 */ {I_VPSUBW, 2, {XMMREG,RM_XMM|BITS128,0,0,0}, nasm_bytecodes+11562, IF_AVX|IF_SANDYBRIDGE},
+    /* 2636 */ {I_VPSUBD, 3, {XMMREG,XMMREG,RM_XMM|BITS128,0,0}, nasm_bytecodes+11569, IF_AVX|IF_SANDYBRIDGE},
+    /* 2637 */ {I_VPSUBD, 2, {XMMREG,RM_XMM|BITS128,0,0,0}, nasm_bytecodes+11576, IF_AVX|IF_SANDYBRIDGE},
+    /* 2638 */ {I_VPSUBQ, 3, {XMMREG,XMMREG,RM_XMM|BITS128,0,0}, nasm_bytecodes+11583, IF_AVX|IF_SANDYBRIDGE},
+    /* 2639 */ {I_VPSUBQ, 2, {XMMREG,RM_XMM|BITS128,0,0,0}, nasm_bytecodes+11590, IF_AVX|IF_SANDYBRIDGE},
+    /* 2640 */ {I_VPSUBSB, 3, {XMMREG,XMMREG,RM_XMM|BITS128,0,0}, nasm_bytecodes+11597, IF_AVX|IF_SANDYBRIDGE},
+    /* 2641 */ {I_VPSUBSB, 2, {XMMREG,RM_XMM|BITS128,0,0,0}, nasm_bytecodes+11604, IF_AVX|IF_SANDYBRIDGE},
+    /* 2642 */ {I_VPSUBSW, 3, {XMMREG,XMMREG,RM_XMM|BITS128,0,0}, nasm_bytecodes+11611, IF_AVX|IF_SANDYBRIDGE},
+    /* 2643 */ {I_VPSUBSW, 2, {XMMREG,RM_XMM|BITS128,0,0,0}, nasm_bytecodes+11618, IF_AVX|IF_SANDYBRIDGE},
+    /* 2644 */ {I_VPSUBUSB, 3, {XMMREG,XMMREG,RM_XMM|BITS128,0,0}, nasm_bytecodes+11625, IF_AVX|IF_SANDYBRIDGE},
+    /* 2645 */ {I_VPSUBUSB, 2, {XMMREG,RM_XMM|BITS128,0,0,0}, nasm_bytecodes+11632, IF_AVX|IF_SANDYBRIDGE},
+    /* 2646 */ {I_VPSUBUSW, 3, {XMMREG,XMMREG,RM_XMM|BITS128,0,0}, nasm_bytecodes+11639, IF_AVX|IF_SANDYBRIDGE},
+    /* 2647 */ {I_VPSUBUSW, 2, {XMMREG,RM_XMM|BITS128,0,0,0}, nasm_bytecodes+11646, IF_AVX|IF_SANDYBRIDGE},
+    /* 2648 */ {I_VPUNPCKHBW, 3, {XMMREG,XMMREG,RM_XMM|BITS128,0,0}, nasm_bytecodes+11653, IF_AVX|IF_SANDYBRIDGE},
+    /* 2649 */ {I_VPUNPCKHBW, 2, {XMMREG,RM_XMM|BITS128,0,0,0}, nasm_bytecodes+11660, IF_AVX|IF_SANDYBRIDGE},
+    /* 2650 */ {I_VPUNPCKHWD, 3, {XMMREG,XMMREG,RM_XMM|BITS128,0,0}, nasm_bytecodes+11667, IF_AVX|IF_SANDYBRIDGE},
+    /* 2651 */ {I_VPUNPCKHWD, 2, {XMMREG,RM_XMM|BITS128,0,0,0}, nasm_bytecodes+11674, IF_AVX|IF_SANDYBRIDGE},
+    /* 2652 */ {I_VPUNPCKHDQ, 3, {XMMREG,XMMREG,RM_XMM|BITS128,0,0}, nasm_bytecodes+11681, IF_AVX|IF_SANDYBRIDGE},
+    /* 2653 */ {I_VPUNPCKHDQ, 2, {XMMREG,RM_XMM|BITS128,0,0,0}, nasm_bytecodes+11688, IF_AVX|IF_SANDYBRIDGE},
+    /* 2654 */ {I_VPUNPCKHQDQ, 3, {XMMREG,XMMREG,RM_XMM|BITS128,0,0}, nasm_bytecodes+11695, IF_AVX|IF_SANDYBRIDGE},
+    /* 2655 */ {I_VPUNPCKHQDQ, 2, {XMMREG,RM_XMM|BITS128,0,0,0}, nasm_bytecodes+11702, IF_AVX|IF_SANDYBRIDGE},
+    /* 2656 */ {I_VPUNPCKLBW, 3, {XMMREG,XMMREG,RM_XMM|BITS128,0,0}, nasm_bytecodes+11709, IF_AVX|IF_SANDYBRIDGE},
+    /* 2657 */ {I_VPUNPCKLBW, 2, {XMMREG,RM_XMM|BITS128,0,0,0}, nasm_bytecodes+11716, IF_AVX|IF_SANDYBRIDGE},
+    /* 2658 */ {I_VPUNPCKLWD, 3, {XMMREG,XMMREG,RM_XMM|BITS128,0,0}, nasm_bytecodes+11723, IF_AVX|IF_SANDYBRIDGE},
+    /* 2659 */ {I_VPUNPCKLWD, 2, {XMMREG,RM_XMM|BITS128,0,0,0}, nasm_bytecodes+11730, IF_AVX|IF_SANDYBRIDGE},
+    /* 2660 */ {I_VPUNPCKLDQ, 3, {XMMREG,XMMREG,RM_XMM|BITS128,0,0}, nasm_bytecodes+11737, IF_AVX|IF_SANDYBRIDGE},
+    /* 2661 */ {I_VPUNPCKLDQ, 2, {XMMREG,RM_XMM|BITS128,0,0,0}, nasm_bytecodes+11744, IF_AVX|IF_SANDYBRIDGE},
+    /* 2662 */ {I_VPUNPCKLQDQ, 3, {XMMREG,XMMREG,RM_XMM|BITS128,0,0}, nasm_bytecodes+11751, IF_AVX|IF_SANDYBRIDGE},
+    /* 2663 */ {I_VPUNPCKLQDQ, 2, {XMMREG,RM_XMM|BITS128,0,0,0}, nasm_bytecodes+11758, IF_AVX|IF_SANDYBRIDGE},
+    /* 2664 */ {I_VPXOR, 3, {XMMREG,XMMREG,RM_XMM|BITS128,0,0}, nasm_bytecodes+11765, IF_AVX|IF_SANDYBRIDGE},
+    /* 2665 */ {I_VPXOR, 2, {XMMREG,RM_XMM|BITS128,0,0,0}, nasm_bytecodes+11772, IF_AVX|IF_SANDYBRIDGE},
+    /* 2666 */ {I_VRCPPS, 2, {XMMREG,RM_XMM|BITS128,0,0,0}, nasm_bytecodes+11779, IF_AVX|IF_SANDYBRIDGE},
+    /* 2667 */ {I_VRCPPS, 2, {YMMREG,RM_YMM|BITS256,0,0,0}, nasm_bytecodes+11786, IF_AVX|IF_SANDYBRIDGE},
+    /* 2668 */ {I_VRCPSS, 3, {XMMREG,XMMREG,RM_XMM|BITS32,0,0}, nasm_bytecodes+11793, IF_AVX|IF_SANDYBRIDGE},
+    /* 2669 */ {I_VRCPSS, 2, {XMMREG,RM_XMM|BITS32,0,0,0}, nasm_bytecodes+11800, IF_AVX|IF_SANDYBRIDGE},
+    /* 2670 */ {I_VRSQRTPS, 2, {XMMREG,RM_XMM|BITS128,0,0,0}, nasm_bytecodes+11807, IF_AVX|IF_SANDYBRIDGE},
+    /* 2671 */ {I_VRSQRTPS, 2, {YMMREG,RM_YMM|BITS256,0,0,0}, nasm_bytecodes+11814, IF_AVX|IF_SANDYBRIDGE},
+    /* 2672 */ {I_VRSQRTSS, 3, {XMMREG,XMMREG,RM_XMM|BITS32,0,0}, nasm_bytecodes+11821, IF_AVX|IF_SANDYBRIDGE},
+    /* 2673 */ {I_VRSQRTSS, 2, {XMMREG,RM_XMM|BITS32,0,0,0}, nasm_bytecodes+11828, IF_AVX|IF_SANDYBRIDGE},
+    /* 2674 */ {I_VROUNDPD, 3, {XMMREG,RM_XMM|BITS128,IMMEDIATE|BITS8,0,0}, nasm_bytecodes+6780, IF_AVX|IF_SANDYBRIDGE},
+    /* 2675 */ {I_VROUNDPD, 3, {YMMREG,RM_YMM|BITS256,IMMEDIATE|BITS8,0,0}, nasm_bytecodes+6788, IF_AVX|IF_SANDYBRIDGE},
+    /* 2676 */ {I_VROUNDPS, 3, {XMMREG,RM_XMM|BITS128,IMMEDIATE|BITS8,0,0}, nasm_bytecodes+6796, IF_AVX|IF_SANDYBRIDGE},
+    /* 2677 */ {I_VROUNDPS, 3, {YMMREG,RM_YMM|BITS256,IMMEDIATE|BITS8,0,0}, nasm_bytecodes+6804, IF_AVX|IF_SANDYBRIDGE},
+    /* 2678 */ {I_VROUNDSD, 4, {XMMREG,XMMREG,RM_XMM|BITS64,IMMEDIATE|BITS8,0}, nasm_bytecodes+6812, IF_AVX|IF_SANDYBRIDGE},
+    /* 2679 */ {I_VROUNDSD, 3, {XMMREG,RM_XMM|BITS64,IMMEDIATE|BITS8,0,0}, nasm_bytecodes+6820, IF_AVX|IF_SANDYBRIDGE},
+    /* 2680 */ {I_VROUNDSS, 4, {XMMREG,XMMREG,RM_XMM|BITS32,IMMEDIATE|BITS8,0}, nasm_bytecodes+6828, IF_AVX|IF_SANDYBRIDGE},
+    /* 2681 */ {I_VROUNDSS, 3, {XMMREG,RM_XMM|BITS32,IMMEDIATE|BITS8,0,0}, nasm_bytecodes+6836, IF_AVX|IF_SANDYBRIDGE},
+    /* 2682 */ {I_VSHUFPD, 4, {XMMREG,XMMREG,RM_XMM|BITS128,IMMEDIATE|BITS8,0}, nasm_bytecodes+6844, IF_AVX|IF_SANDYBRIDGE},
+    /* 2683 */ {I_VSHUFPD, 3, {XMMREG,RM_XMM|BITS128,IMMEDIATE|BITS8,0,0}, nasm_bytecodes+6852, IF_AVX|IF_SANDYBRIDGE},
+    /* 2684 */ {I_VSHUFPD, 4, {YMMREG,YMMREG,RM_YMM|BITS256,IMMEDIATE|BITS8,0}, nasm_bytecodes+6860, IF_AVX|IF_SANDYBRIDGE},
+    /* 2685 */ {I_VSHUFPD, 3, {YMMREG,RM_YMM|BITS256,IMMEDIATE|BITS8,0,0}, nasm_bytecodes+6868, IF_AVX|IF_SANDYBRIDGE},
+    /* 2686 */ {I_VSHUFPS, 4, {XMMREG,XMMREG,RM_XMM|BITS128,IMMEDIATE|BITS8,0}, nasm_bytecodes+6876, IF_AVX|IF_SANDYBRIDGE},
+    /* 2687 */ {I_VSHUFPS, 3, {XMMREG,RM_XMM|BITS128,IMMEDIATE|BITS8,0,0}, nasm_bytecodes+6884, IF_AVX|IF_SANDYBRIDGE},
+    /* 2688 */ {I_VSHUFPS, 4, {YMMREG,YMMREG,RM_YMM|BITS256,IMMEDIATE|BITS8,0}, nasm_bytecodes+6892, IF_AVX|IF_SANDYBRIDGE},
+    /* 2689 */ {I_VSHUFPS, 3, {YMMREG,RM_YMM|BITS256,IMMEDIATE|BITS8,0,0}, nasm_bytecodes+6900, IF_AVX|IF_SANDYBRIDGE},
+    /* 2690 */ {I_VSQRTPD, 2, {XMMREG,RM_XMM|BITS128,0,0,0}, nasm_bytecodes+11835, IF_AVX|IF_SANDYBRIDGE},
+    /* 2691 */ {I_VSQRTPD, 2, {YMMREG,RM_YMM|BITS256,0,0,0}, nasm_bytecodes+11842, IF_AVX|IF_SANDYBRIDGE},
+    /* 2692 */ {I_VSQRTPS, 2, {XMMREG,RM_XMM|BITS128,0,0,0}, nasm_bytecodes+11849, IF_AVX|IF_SANDYBRIDGE},
+    /* 2693 */ {I_VSQRTPS, 2, {YMMREG,RM_YMM|BITS256,0,0,0}, nasm_bytecodes+11856, IF_AVX|IF_SANDYBRIDGE},
+    /* 2694 */ {I_VSQRTSD, 3, {XMMREG,XMMREG,RM_XMM|BITS64,0,0}, nasm_bytecodes+11863, IF_AVX|IF_SANDYBRIDGE},
+    /* 2695 */ {I_VSQRTSD, 2, {XMMREG,RM_XMM|BITS64,0,0,0}, nasm_bytecodes+11870, IF_AVX|IF_SANDYBRIDGE},
+    /* 2696 */ {I_VSQRTSS, 3, {XMMREG,XMMREG,RM_XMM|BITS32,0,0}, nasm_bytecodes+11877, IF_AVX|IF_SANDYBRIDGE},
+    /* 2697 */ {I_VSQRTSS, 2, {XMMREG,RM_XMM|BITS32,0,0,0}, nasm_bytecodes+11884, IF_AVX|IF_SANDYBRIDGE},
+    /* 2698 */ {I_VSTMXCSR, 1, {MEMORY|BITS32,0,0,0,0}, nasm_bytecodes+11891, IF_AVX|IF_SANDYBRIDGE},
+    /* 2699 */ {I_VSUBPD, 3, {XMMREG,XMMREG,RM_XMM|BITS128,0,0}, nasm_bytecodes+11898, IF_AVX|IF_SANDYBRIDGE},
+    /* 2700 */ {I_VSUBPD, 2, {XMMREG,RM_XMM|BITS128,0,0,0}, nasm_bytecodes+11905, IF_AVX|IF_SANDYBRIDGE},
+    /* 2701 */ {I_VSUBPD, 3, {YMMREG,YMMREG,RM_YMM|BITS256,0,0}, nasm_bytecodes+11912, IF_AVX|IF_SANDYBRIDGE},
+    /* 2702 */ {I_VSUBPD, 2, {YMMREG,RM_YMM|BITS256,0,0,0}, nasm_bytecodes+11919, IF_AVX|IF_SANDYBRIDGE},
+    /* 2703 */ {I_VSUBPS, 3, {XMMREG,XMMREG,RM_XMM|BITS128,0,0}, nasm_bytecodes+11926, IF_AVX|IF_SANDYBRIDGE},
+    /* 2704 */ {I_VSUBPS, 2, {XMMREG,RM_XMM|BITS128,0,0,0}, nasm_bytecodes+11933, IF_AVX|IF_SANDYBRIDGE},
+    /* 2705 */ {I_VSUBPS, 3, {YMMREG,YMMREG,RM_YMM|BITS256,0,0}, nasm_bytecodes+11940, IF_AVX|IF_SANDYBRIDGE},
+    /* 2706 */ {I_VSUBPS, 2, {YMMREG,RM_YMM|BITS256,0,0,0}, nasm_bytecodes+11947, IF_AVX|IF_SANDYBRIDGE},
+    /* 2707 */ {I_VSUBSD, 3, {XMMREG,XMMREG,RM_XMM|BITS64,0,0}, nasm_bytecodes+11954, IF_AVX|IF_SANDYBRIDGE},
+    /* 2708 */ {I_VSUBSD, 2, {XMMREG,RM_XMM|BITS64,0,0,0}, nasm_bytecodes+11961, IF_AVX|IF_SANDYBRIDGE},
+    /* 2709 */ {I_VSUBSS, 3, {XMMREG,XMMREG,RM_XMM|BITS32,0,0}, nasm_bytecodes+11968, IF_AVX|IF_SANDYBRIDGE},
+    /* 2710 */ {I_VSUBSS, 2, {XMMREG,RM_XMM|BITS32,0,0,0}, nasm_bytecodes+11975, IF_AVX|IF_SANDYBRIDGE},
+    /* 2711 */ {I_VTESTPS, 2, {XMMREG,RM_XMM|BITS128,0,0,0}, nasm_bytecodes+11982, IF_AVX|IF_SANDYBRIDGE},
+    /* 2712 */ {I_VTESTPS, 2, {YMMREG,RM_YMM|BITS256,0,0,0}, nasm_bytecodes+11989, IF_AVX|IF_SANDYBRIDGE},
+    /* 2713 */ {I_VTESTPD, 2, {XMMREG,RM_XMM|BITS128,0,0,0}, nasm_bytecodes+11996, IF_AVX|IF_SANDYBRIDGE},
+    /* 2714 */ {I_VTESTPD, 2, {YMMREG,RM_YMM|BITS256,0,0,0}, nasm_bytecodes+12003, IF_AVX|IF_SANDYBRIDGE},
+    /* 2715 */ {I_VUCOMISD, 2, {XMMREG,RM_XMM|BITS64,0,0,0}, nasm_bytecodes+12010, IF_AVX|IF_SANDYBRIDGE},
+    /* 2716 */ {I_VUCOMISS, 2, {XMMREG,RM_XMM|BITS32,0,0,0}, nasm_bytecodes+12017, IF_AVX|IF_SANDYBRIDGE},
+    /* 2717 */ {I_VUNPCKHPD, 3, {XMMREG,XMMREG,RM_XMM|BITS128,0,0}, nasm_bytecodes+12024, IF_AVX|IF_SANDYBRIDGE},
+    /* 2718 */ {I_VUNPCKHPD, 2, {XMMREG,RM_XMM|BITS128,0,0,0}, nasm_bytecodes+12031, IF_AVX|IF_SANDYBRIDGE},
+    /* 2719 */ {I_VUNPCKHPD, 3, {YMMREG,YMMREG,RM_YMM|BITS256,0,0}, nasm_bytecodes+12038, IF_AVX|IF_SANDYBRIDGE},
+    /* 2720 */ {I_VUNPCKHPD, 2, {YMMREG,RM_YMM|BITS256,0,0,0}, nasm_bytecodes+12045, IF_AVX|IF_SANDYBRIDGE},
+    /* 2721 */ {I_VUNPCKHPS, 3, {XMMREG,XMMREG,RM_XMM|BITS128,0,0}, nasm_bytecodes+12052, IF_AVX|IF_SANDYBRIDGE},
+    /* 2722 */ {I_VUNPCKHPS, 2, {XMMREG,RM_XMM|BITS128,0,0,0}, nasm_bytecodes+12059, IF_AVX|IF_SANDYBRIDGE},
+    /* 2723 */ {I_VUNPCKHPS, 3, {YMMREG,YMMREG,RM_YMM|BITS256,0,0}, nasm_bytecodes+12066, IF_AVX|IF_SANDYBRIDGE},
+    /* 2724 */ {I_VUNPCKHPS, 2, {YMMREG,RM_YMM|BITS256,0,0,0}, nasm_bytecodes+12073, IF_AVX|IF_SANDYBRIDGE},
+    /* 2725 */ {I_VUNPCKLPD, 3, {XMMREG,XMMREG,RM_XMM|BITS128,0,0}, nasm_bytecodes+12080, IF_AVX|IF_SANDYBRIDGE},
+    /* 2726 */ {I_VUNPCKLPD, 2, {XMMREG,RM_XMM|BITS128,0,0,0}, nasm_bytecodes+12087, IF_AVX|IF_SANDYBRIDGE},
+    /* 2727 */ {I_VUNPCKLPD, 3, {YMMREG,YMMREG,RM_YMM|BITS256,0,0}, nasm_bytecodes+12094, IF_AVX|IF_SANDYBRIDGE},
+    /* 2728 */ {I_VUNPCKLPD, 2, {YMMREG,RM_YMM|BITS256,0,0,0}, nasm_bytecodes+12101, IF_AVX|IF_SANDYBRIDGE},
+    /* 2729 */ {I_VUNPCKLPS, 3, {XMMREG,XMMREG,RM_XMM|BITS128,0,0}, nasm_bytecodes+12108, IF_AVX|IF_SANDYBRIDGE},
+    /* 2730 */ {I_VUNPCKLPS, 2, {XMMREG,RM_XMM|BITS128,0,0,0}, nasm_bytecodes+12115, IF_AVX|IF_SANDYBRIDGE},
+    /* 2731 */ {I_VUNPCKLPS, 3, {YMMREG,YMMREG,RM_YMM|BITS256,0,0}, nasm_bytecodes+12122, IF_AVX|IF_SANDYBRIDGE},
+    /* 2732 */ {I_VUNPCKLPS, 2, {YMMREG,RM_YMM|BITS256,0,0,0}, nasm_bytecodes+12129, IF_AVX|IF_SANDYBRIDGE},
+    /* 2733 */ {I_VXORPD, 3, {XMMREG,XMMREG,RM_XMM|BITS128,0,0}, nasm_bytecodes+12136, IF_AVX|IF_SANDYBRIDGE},
+    /* 2734 */ {I_VXORPD, 2, {XMMREG,RM_XMM|BITS128,0,0,0}, nasm_bytecodes+12143, IF_AVX|IF_SANDYBRIDGE},
+    /* 2735 */ {I_VXORPD, 3, {YMMREG,YMMREG,RM_YMM|BITS256,0,0}, nasm_bytecodes+12150, IF_AVX|IF_SANDYBRIDGE},
+    /* 2736 */ {I_VXORPD, 2, {YMMREG,RM_YMM|BITS256,0,0,0}, nasm_bytecodes+12157, IF_AVX|IF_SANDYBRIDGE},
+    /* 2737 */ {I_VXORPS, 3, {XMMREG,XMMREG,RM_XMM|BITS128,0,0}, nasm_bytecodes+12164, IF_AVX|IF_SANDYBRIDGE},
+    /* 2738 */ {I_VXORPS, 2, {XMMREG,RM_XMM|BITS128,0,0,0}, nasm_bytecodes+12171, IF_AVX|IF_SANDYBRIDGE},
+    /* 2739 */ {I_VXORPS, 3, {YMMREG,YMMREG,RM_YMM|BITS256,0,0}, nasm_bytecodes+12178, IF_AVX|IF_SANDYBRIDGE},
+    /* 2740 */ {I_VXORPS, 2, {YMMREG,RM_YMM|BITS256,0,0,0}, nasm_bytecodes+12185, IF_AVX|IF_SANDYBRIDGE},
+    /* 2741 */ {I_VZEROALL, 0, {0,0,0,0,0}, nasm_bytecodes+15840, IF_AVX|IF_SANDYBRIDGE},
+    /* 2742 */ {I_VZEROUPPER, 0, {0,0,0,0,0}, nasm_bytecodes+15846, IF_AVX|IF_SANDYBRIDGE},
+    /* 2743 */ {I_PCLMULLQLQDQ, 2, {XMMREG,RM_XMM|BITS128,0,0,0}, nasm_bytecodes+3852, IF_SSE|IF_WESTMERE},
+    /* 2744 */ {I_PCLMULHQLQDQ, 2, {XMMREG,RM_XMM|BITS128,0,0,0}, nasm_bytecodes+3861, IF_SSE|IF_WESTMERE},
+    /* 2745 */ {I_PCLMULLQHQDQ, 2, {XMMREG,RM_XMM|BITS128,0,0,0}, nasm_bytecodes+3870, IF_SSE|IF_WESTMERE},
+    /* 2746 */ {I_PCLMULHQHQDQ, 2, {XMMREG,RM_XMM|BITS128,0,0,0}, nasm_bytecodes+3879, IF_SSE|IF_WESTMERE},
+    /* 2747 */ {I_PCLMULQDQ, 3, {XMMREG,RM_XMM|BITS128,IMMEDIATE|BITS8,0,0}, nasm_bytecodes+6908, IF_SSE|IF_WESTMERE},
+    /* 2748 */ {I_VPCLMULLQLQDQ, 3, {XMMREG,XMMREG,RM_XMM|BITS128,0,0}, nasm_bytecodes+3888, IF_AVX|IF_SANDYBRIDGE},
+    /* 2749 */ {I_VPCLMULLQLQDQ, 2, {XMMREG,RM_XMM|BITS128,0,0,0}, nasm_bytecodes+3897, IF_AVX|IF_SANDYBRIDGE},
+    /* 2750 */ {I_VPCLMULHQLQDQ, 3, {XMMREG,XMMREG,RM_XMM|BITS128,0,0}, nasm_bytecodes+3906, IF_AVX|IF_SANDYBRIDGE},
+    /* 2751 */ {I_VPCLMULHQLQDQ, 2, {XMMREG,RM_XMM|BITS128,0,0,0}, nasm_bytecodes+3915, IF_AVX|IF_SANDYBRIDGE},
+    /* 2752 */ {I_VPCLMULLQHQDQ, 3, {XMMREG,XMMREG,RM_XMM|BITS128,0,0}, nasm_bytecodes+3924, IF_AVX|IF_SANDYBRIDGE},
+    /* 2753 */ {I_VPCLMULLQHQDQ, 2, {XMMREG,RM_XMM|BITS128,0,0,0}, nasm_bytecodes+3933, IF_AVX|IF_SANDYBRIDGE},
+    /* 2754 */ {I_VPCLMULHQHQDQ, 3, {XMMREG,XMMREG,RM_XMM|BITS128,0,0}, nasm_bytecodes+3942, IF_AVX|IF_SANDYBRIDGE},
+    /* 2755 */ {I_VPCLMULHQHQDQ, 2, {XMMREG,RM_XMM|BITS128,0,0,0}, nasm_bytecodes+3951, IF_AVX|IF_SANDYBRIDGE},
+    /* 2756 */ {I_VPCLMULQDQ, 4, {XMMREG,XMMREG,RM_XMM|BITS128,IMMEDIATE|BITS8,0}, nasm_bytecodes+6916, IF_AVX|IF_SANDYBRIDGE},
+    /* 2757 */ {I_VPCLMULQDQ, 3, {XMMREG,RM_XMM|BITS128,IMMEDIATE|BITS8,0,0}, nasm_bytecodes+6924, IF_AVX|IF_SANDYBRIDGE},
+    /* 2758 */ {I_VFMADD132PS, 3, {XMMREG,XMMREG,RM_XMM|BITS128,0,0}, nasm_bytecodes+12192, IF_FMA|IF_FUTURE},
+    /* 2759 */ {I_VFMADD132PS, 3, {YMMREG,YMMREG,RM_YMM|BITS256,0,0}, nasm_bytecodes+12199, IF_FMA|IF_FUTURE},
+    /* 2760 */ {I_VFMADD132PD, 3, {XMMREG,XMMREG,RM_XMM|BITS128,0,0}, nasm_bytecodes+12206, IF_FMA|IF_FUTURE},
+    /* 2761 */ {I_VFMADD132PD, 3, {YMMREG,YMMREG,RM_YMM|BITS256,0,0}, nasm_bytecodes+12213, IF_FMA|IF_FUTURE},
+    /* 2762 */ {I_VFMADD312PS, 3, {XMMREG,XMMREG,RM_XMM|BITS128,0,0}, nasm_bytecodes+12192, IF_FMA|IF_FUTURE},
+    /* 2763 */ {I_VFMADD312PS, 3, {YMMREG,YMMREG,RM_YMM|BITS256,0,0}, nasm_bytecodes+12199, IF_FMA|IF_FUTURE},
+    /* 2764 */ {I_VFMADD312PD, 3, {XMMREG,XMMREG,RM_XMM|BITS128,0,0}, nasm_bytecodes+12206, IF_FMA|IF_FUTURE},
+    /* 2765 */ {I_VFMADD312PD, 3, {YMMREG,YMMREG,RM_YMM|BITS256,0,0}, nasm_bytecodes+12213, IF_FMA|IF_FUTURE},
+    /* 2766 */ {I_VFMADD213PS, 3, {XMMREG,XMMREG,RM_XMM|BITS128,0,0}, nasm_bytecodes+12220, IF_FMA|IF_FUTURE},
+    /* 2767 */ {I_VFMADD213PS, 3, {YMMREG,YMMREG,RM_YMM|BITS256,0,0}, nasm_bytecodes+12227, IF_FMA|IF_FUTURE},
+    /* 2768 */ {I_VFMADD213PD, 3, {XMMREG,XMMREG,RM_XMM|BITS128,0,0}, nasm_bytecodes+12234, IF_FMA|IF_FUTURE},
+    /* 2769 */ {I_VFMADD213PD, 3, {YMMREG,YMMREG,RM_YMM|BITS256,0,0}, nasm_bytecodes+12241, IF_FMA|IF_FUTURE},
+    /* 2770 */ {I_VFMADD123PS, 3, {XMMREG,XMMREG,RM_XMM|BITS128,0,0}, nasm_bytecodes+12220, IF_FMA|IF_FUTURE},
+    /* 2771 */ {I_VFMADD123PS, 3, {YMMREG,YMMREG,RM_YMM|BITS256,0,0}, nasm_bytecodes+12227, IF_FMA|IF_FUTURE},
+    /* 2772 */ {I_VFMADD123PD, 3, {XMMREG,XMMREG,RM_XMM|BITS128,0,0}, nasm_bytecodes+12234, IF_FMA|IF_FUTURE},
+    /* 2773 */ {I_VFMADD123PD, 3, {YMMREG,YMMREG,RM_YMM|BITS256,0,0}, nasm_bytecodes+12241, IF_FMA|IF_FUTURE},
+    /* 2774 */ {I_VFMADD231PS, 3, {XMMREG,XMMREG,RM_XMM|BITS128,0,0}, nasm_bytecodes+12248, IF_FMA|IF_FUTURE},
+    /* 2775 */ {I_VFMADD231PS, 3, {YMMREG,YMMREG,RM_YMM|BITS256,0,0}, nasm_bytecodes+12255, IF_FMA|IF_FUTURE},
+    /* 2776 */ {I_VFMADD231PD, 3, {XMMREG,XMMREG,RM_XMM|BITS128,0,0}, nasm_bytecodes+12262, IF_FMA|IF_FUTURE},
+    /* 2777 */ {I_VFMADD231PD, 3, {YMMREG,YMMREG,RM_YMM|BITS256,0,0}, nasm_bytecodes+12269, IF_FMA|IF_FUTURE},
+    /* 2778 */ {I_VFMADD321PS, 3, {XMMREG,XMMREG,RM_XMM|BITS128,0,0}, nasm_bytecodes+12248, IF_FMA|IF_FUTURE},
+    /* 2779 */ {I_VFMADD321PS, 3, {YMMREG,YMMREG,RM_YMM|BITS256,0,0}, nasm_bytecodes+12255, IF_FMA|IF_FUTURE},
+    /* 2780 */ {I_VFMADD321PD, 3, {XMMREG,XMMREG,RM_XMM|BITS128,0,0}, nasm_bytecodes+12262, IF_FMA|IF_FUTURE},
+    /* 2781 */ {I_VFMADD321PD, 3, {YMMREG,YMMREG,RM_YMM|BITS256,0,0}, nasm_bytecodes+12269, IF_FMA|IF_FUTURE},
+    /* 2782 */ {I_VFMADDSUB132PS, 3, {XMMREG,XMMREG,RM_XMM|BITS128,0,0}, nasm_bytecodes+12276, IF_FMA|IF_FUTURE},
+    /* 2783 */ {I_VFMADDSUB132PS, 3, {YMMREG,YMMREG,RM_YMM|BITS256,0,0}, nasm_bytecodes+12283, IF_FMA|IF_FUTURE},
+    /* 2784 */ {I_VFMADDSUB132PD, 3, {XMMREG,XMMREG,RM_XMM|BITS128,0,0}, nasm_bytecodes+12290, IF_FMA|IF_FUTURE},
+    /* 2785 */ {I_VFMADDSUB132PD, 3, {YMMREG,YMMREG,RM_YMM|BITS256,0,0}, nasm_bytecodes+12297, IF_FMA|IF_FUTURE},
+    /* 2786 */ {I_VFMADDSUB312PS, 3, {XMMREG,XMMREG,RM_XMM|BITS128,0,0}, nasm_bytecodes+12276, IF_FMA|IF_FUTURE},
+    /* 2787 */ {I_VFMADDSUB312PS, 3, {YMMREG,YMMREG,RM_YMM|BITS256,0,0}, nasm_bytecodes+12283, IF_FMA|IF_FUTURE},
+    /* 2788 */ {I_VFMADDSUB312PD, 3, {XMMREG,XMMREG,RM_XMM|BITS128,0,0}, nasm_bytecodes+12290, IF_FMA|IF_FUTURE},
+    /* 2789 */ {I_VFMADDSUB312PD, 3, {YMMREG,YMMREG,RM_YMM|BITS256,0,0}, nasm_bytecodes+12297, IF_FMA|IF_FUTURE},
+    /* 2790 */ {I_VFMADDSUB213PS, 3, {XMMREG,XMMREG,RM_XMM|BITS128,0,0}, nasm_bytecodes+12304, IF_FMA|IF_FUTURE},
+    /* 2791 */ {I_VFMADDSUB213PS, 3, {YMMREG,YMMREG,RM_YMM|BITS256,0,0}, nasm_bytecodes+12311, IF_FMA|IF_FUTURE},
+    /* 2792 */ {I_VFMADDSUB213PD, 3, {XMMREG,XMMREG,RM_XMM|BITS128,0,0}, nasm_bytecodes+12318, IF_FMA|IF_FUTURE},
+    /* 2793 */ {I_VFMADDSUB213PD, 3, {YMMREG,YMMREG,RM_YMM|BITS256,0,0}, nasm_bytecodes+12325, IF_FMA|IF_FUTURE},
+    /* 2794 */ {I_VFMADDSUB123PS, 3, {XMMREG,XMMREG,RM_XMM|BITS128,0,0}, nasm_bytecodes+12304, IF_FMA|IF_FUTURE},
+    /* 2795 */ {I_VFMADDSUB123PS, 3, {YMMREG,YMMREG,RM_YMM|BITS256,0,0}, nasm_bytecodes+12311, IF_FMA|IF_FUTURE},
+    /* 2796 */ {I_VFMADDSUB123PD, 3, {XMMREG,XMMREG,RM_XMM|BITS128,0,0}, nasm_bytecodes+12318, IF_FMA|IF_FUTURE},
+    /* 2797 */ {I_VFMADDSUB123PD, 3, {YMMREG,YMMREG,RM_YMM|BITS256,0,0}, nasm_bytecodes+12325, IF_FMA|IF_FUTURE},
+    /* 2798 */ {I_VFMADDSUB231PS, 3, {XMMREG,XMMREG,RM_XMM|BITS128,0,0}, nasm_bytecodes+12332, IF_FMA|IF_FUTURE},
+    /* 2799 */ {I_VFMADDSUB231PS, 3, {YMMREG,YMMREG,RM_YMM|BITS256,0,0}, nasm_bytecodes+12339, IF_FMA|IF_FUTURE},
+    /* 2800 */ {I_VFMADDSUB231PD, 3, {XMMREG,XMMREG,RM_XMM|BITS128,0,0}, nasm_bytecodes+12346, IF_FMA|IF_FUTURE},
+    /* 2801 */ {I_VFMADDSUB231PD, 3, {YMMREG,YMMREG,RM_YMM|BITS256,0,0}, nasm_bytecodes+12353, IF_FMA|IF_FUTURE},
+    /* 2802 */ {I_VFMADDSUB321PS, 3, {XMMREG,XMMREG,RM_XMM|BITS128,0,0}, nasm_bytecodes+12332, IF_FMA|IF_FUTURE},
+    /* 2803 */ {I_VFMADDSUB321PS, 3, {YMMREG,YMMREG,RM_YMM|BITS256,0,0}, nasm_bytecodes+12339, IF_FMA|IF_FUTURE},
+    /* 2804 */ {I_VFMADDSUB321PD, 3, {XMMREG,XMMREG,RM_XMM|BITS128,0,0}, nasm_bytecodes+12346, IF_FMA|IF_FUTURE},
+    /* 2805 */ {I_VFMADDSUB321PD, 3, {YMMREG,YMMREG,RM_YMM|BITS256,0,0}, nasm_bytecodes+12353, IF_FMA|IF_FUTURE},
+    /* 2806 */ {I_VFMSUB132PS, 3, {XMMREG,XMMREG,RM_XMM|BITS128,0,0}, nasm_bytecodes+12360, IF_FMA|IF_FUTURE},
+    /* 2807 */ {I_VFMSUB132PS, 3, {YMMREG,YMMREG,RM_YMM|BITS256,0,0}, nasm_bytecodes+12367, IF_FMA|IF_FUTURE},
+    /* 2808 */ {I_VFMSUB132PD, 3, {XMMREG,XMMREG,RM_XMM|BITS128,0,0}, nasm_bytecodes+12374, IF_FMA|IF_FUTURE},
+    /* 2809 */ {I_VFMSUB132PD, 3, {YMMREG,YMMREG,RM_YMM|BITS256,0,0}, nasm_bytecodes+12381, IF_FMA|IF_FUTURE},
+    /* 2810 */ {I_VFMSUB312PS, 3, {XMMREG,XMMREG,RM_XMM|BITS128,0,0}, nasm_bytecodes+12360, IF_FMA|IF_FUTURE},
+    /* 2811 */ {I_VFMSUB312PS, 3, {YMMREG,YMMREG,RM_YMM|BITS256,0,0}, nasm_bytecodes+12367, IF_FMA|IF_FUTURE},
+    /* 2812 */ {I_VFMSUB312PD, 3, {XMMREG,XMMREG,RM_XMM|BITS128,0,0}, nasm_bytecodes+12374, IF_FMA|IF_FUTURE},
+    /* 2813 */ {I_VFMSUB312PD, 3, {YMMREG,YMMREG,RM_YMM|BITS256,0,0}, nasm_bytecodes+12381, IF_FMA|IF_FUTURE},
+    /* 2814 */ {I_VFMSUB213PS, 3, {XMMREG,XMMREG,RM_XMM|BITS128,0,0}, nasm_bytecodes+12388, IF_FMA|IF_FUTURE},
+    /* 2815 */ {I_VFMSUB213PS, 3, {YMMREG,YMMREG,RM_YMM|BITS256,0,0}, nasm_bytecodes+12395, IF_FMA|IF_FUTURE},
+    /* 2816 */ {I_VFMSUB213PD, 3, {XMMREG,XMMREG,RM_XMM|BITS128,0,0}, nasm_bytecodes+12402, IF_FMA|IF_FUTURE},
+    /* 2817 */ {I_VFMSUB213PD, 3, {YMMREG,YMMREG,RM_YMM|BITS256,0,0}, nasm_bytecodes+12409, IF_FMA|IF_FUTURE},
+    /* 2818 */ {I_VFMSUB123PS, 3, {XMMREG,XMMREG,RM_XMM|BITS128,0,0}, nasm_bytecodes+12388, IF_FMA|IF_FUTURE},
+    /* 2819 */ {I_VFMSUB123PS, 3, {YMMREG,YMMREG,RM_YMM|BITS256,0,0}, nasm_bytecodes+12395, IF_FMA|IF_FUTURE},
+    /* 2820 */ {I_VFMSUB123PD, 3, {XMMREG,XMMREG,RM_XMM|BITS128,0,0}, nasm_bytecodes+12402, IF_FMA|IF_FUTURE},
+    /* 2821 */ {I_VFMSUB123PD, 3, {YMMREG,YMMREG,RM_YMM|BITS256,0,0}, nasm_bytecodes+12409, IF_FMA|IF_FUTURE},
+    /* 2822 */ {I_VFMSUB231PS, 3, {XMMREG,XMMREG,RM_XMM|BITS128,0,0}, nasm_bytecodes+12416, IF_FMA|IF_FUTURE},
+    /* 2823 */ {I_VFMSUB231PS, 3, {YMMREG,YMMREG,RM_YMM|BITS256,0,0}, nasm_bytecodes+12423, IF_FMA|IF_FUTURE},
+    /* 2824 */ {I_VFMSUB231PD, 3, {XMMREG,XMMREG,RM_XMM|BITS128,0,0}, nasm_bytecodes+12430, IF_FMA|IF_FUTURE},
+    /* 2825 */ {I_VFMSUB231PD, 3, {YMMREG,YMMREG,RM_YMM|BITS256,0,0}, nasm_bytecodes+12437, IF_FMA|IF_FUTURE},
+    /* 2826 */ {I_VFMSUB321PS, 3, {XMMREG,XMMREG,RM_XMM|BITS128,0,0}, nasm_bytecodes+12416, IF_FMA|IF_FUTURE},
+    /* 2827 */ {I_VFMSUB321PS, 3, {YMMREG,YMMREG,RM_YMM|BITS256,0,0}, nasm_bytecodes+12423, IF_FMA|IF_FUTURE},
+    /* 2828 */ {I_VFMSUB321PD, 3, {XMMREG,XMMREG,RM_XMM|BITS128,0,0}, nasm_bytecodes+12430, IF_FMA|IF_FUTURE},
+    /* 2829 */ {I_VFMSUB321PD, 3, {YMMREG,YMMREG,RM_YMM|BITS256,0,0}, nasm_bytecodes+12437, IF_FMA|IF_FUTURE},
+    /* 2830 */ {I_VFMSUBADD132PS, 3, {XMMREG,XMMREG,RM_XMM|BITS128,0,0}, nasm_bytecodes+12444, IF_FMA|IF_FUTURE},
+    /* 2831 */ {I_VFMSUBADD132PS, 3, {YMMREG,YMMREG,RM_YMM|BITS256,0,0}, nasm_bytecodes+12451, IF_FMA|IF_FUTURE},
+    /* 2832 */ {I_VFMSUBADD132PD, 3, {XMMREG,XMMREG,RM_XMM|BITS128,0,0}, nasm_bytecodes+12458, IF_FMA|IF_FUTURE},
+    /* 2833 */ {I_VFMSUBADD132PD, 3, {YMMREG,YMMREG,RM_YMM|BITS256,0,0}, nasm_bytecodes+12465, IF_FMA|IF_FUTURE},
+    /* 2834 */ {I_VFMSUBADD312PS, 3, {XMMREG,XMMREG,RM_XMM|BITS128,0,0}, nasm_bytecodes+12444, IF_FMA|IF_FUTURE},
+    /* 2835 */ {I_VFMSUBADD312PS, 3, {YMMREG,YMMREG,RM_YMM|BITS256,0,0}, nasm_bytecodes+12451, IF_FMA|IF_FUTURE},
+    /* 2836 */ {I_VFMSUBADD312PD, 3, {XMMREG,XMMREG,RM_XMM|BITS128,0,0}, nasm_bytecodes+12458, IF_FMA|IF_FUTURE},
+    /* 2837 */ {I_VFMSUBADD312PD, 3, {YMMREG,YMMREG,RM_YMM|BITS256,0,0}, nasm_bytecodes+12465, IF_FMA|IF_FUTURE},
+    /* 2838 */ {I_VFMSUBADD213PS, 3, {XMMREG,XMMREG,RM_XMM|BITS128,0,0}, nasm_bytecodes+12472, IF_FMA|IF_FUTURE},
+    /* 2839 */ {I_VFMSUBADD213PS, 3, {YMMREG,YMMREG,RM_YMM|BITS256,0,0}, nasm_bytecodes+12479, IF_FMA|IF_FUTURE},
+    /* 2840 */ {I_VFMSUBADD213PD, 3, {XMMREG,XMMREG,RM_XMM|BITS128,0,0}, nasm_bytecodes+12486, IF_FMA|IF_FUTURE},
+    /* 2841 */ {I_VFMSUBADD213PD, 3, {YMMREG,YMMREG,RM_YMM|BITS256,0,0}, nasm_bytecodes+12493, IF_FMA|IF_FUTURE},
+    /* 2842 */ {I_VFMSUBADD123PS, 3, {XMMREG,XMMREG,RM_XMM|BITS128,0,0}, nasm_bytecodes+12472, IF_FMA|IF_FUTURE},
+    /* 2843 */ {I_VFMSUBADD123PS, 3, {YMMREG,YMMREG,RM_YMM|BITS256,0,0}, nasm_bytecodes+12479, IF_FMA|IF_FUTURE},
+    /* 2844 */ {I_VFMSUBADD123PD, 3, {XMMREG,XMMREG,RM_XMM|BITS128,0,0}, nasm_bytecodes+12486, IF_FMA|IF_FUTURE},
+    /* 2845 */ {I_VFMSUBADD123PD, 3, {YMMREG,YMMREG,RM_YMM|BITS256,0,0}, nasm_bytecodes+12493, IF_FMA|IF_FUTURE},
+    /* 2846 */ {I_VFMSUBADD231PS, 3, {XMMREG,XMMREG,RM_XMM|BITS128,0,0}, nasm_bytecodes+12500, IF_FMA|IF_FUTURE},
+    /* 2847 */ {I_VFMSUBADD231PS, 3, {YMMREG,YMMREG,RM_YMM|BITS256,0,0}, nasm_bytecodes+12507, IF_FMA|IF_FUTURE},
+    /* 2848 */ {I_VFMSUBADD231PD, 3, {XMMREG,XMMREG,RM_XMM|BITS128,0,0}, nasm_bytecodes+12514, IF_FMA|IF_FUTURE},
+    /* 2849 */ {I_VFMSUBADD231PD, 3, {YMMREG,YMMREG,RM_YMM|BITS256,0,0}, nasm_bytecodes+12521, IF_FMA|IF_FUTURE},
+    /* 2850 */ {I_VFMSUBADD321PS, 3, {XMMREG,XMMREG,RM_XMM|BITS128,0,0}, nasm_bytecodes+12500, IF_FMA|IF_FUTURE},
+    /* 2851 */ {I_VFMSUBADD321PS, 3, {YMMREG,YMMREG,RM_YMM|BITS256,0,0}, nasm_bytecodes+12507, IF_FMA|IF_FUTURE},
+    /* 2852 */ {I_VFMSUBADD321PD, 3, {XMMREG,XMMREG,RM_XMM|BITS128,0,0}, nasm_bytecodes+12514, IF_FMA|IF_FUTURE},
+    /* 2853 */ {I_VFMSUBADD321PD, 3, {YMMREG,YMMREG,RM_YMM|BITS256,0,0}, nasm_bytecodes+12521, IF_FMA|IF_FUTURE},
+    /* 2854 */ {I_VFNMADD132PS, 3, {XMMREG,XMMREG,RM_XMM|BITS128,0,0}, nasm_bytecodes+12528, IF_FMA|IF_FUTURE},
+    /* 2855 */ {I_VFNMADD132PS, 3, {YMMREG,YMMREG,RM_YMM|BITS256,0,0}, nasm_bytecodes+12535, IF_FMA|IF_FUTURE},
+    /* 2856 */ {I_VFNMADD132PD, 3, {XMMREG,XMMREG,RM_XMM|BITS128,0,0}, nasm_bytecodes+12542, IF_FMA|IF_FUTURE},
+    /* 2857 */ {I_VFNMADD132PD, 3, {YMMREG,YMMREG,RM_YMM|BITS256,0,0}, nasm_bytecodes+12549, IF_FMA|IF_FUTURE},
+    /* 2858 */ {I_VFNMADD312PS, 3, {XMMREG,XMMREG,RM_XMM|BITS128,0,0}, nasm_bytecodes+12528, IF_FMA|IF_FUTURE},
+    /* 2859 */ {I_VFNMADD312PS, 3, {YMMREG,YMMREG,RM_YMM|BITS256,0,0}, nasm_bytecodes+12535, IF_FMA|IF_FUTURE},
+    /* 2860 */ {I_VFNMADD312PD, 3, {XMMREG,XMMREG,RM_XMM|BITS128,0,0}, nasm_bytecodes+12542, IF_FMA|IF_FUTURE},
+    /* 2861 */ {I_VFNMADD312PD, 3, {YMMREG,YMMREG,RM_YMM|BITS256,0,0}, nasm_bytecodes+12549, IF_FMA|IF_FUTURE},
+    /* 2862 */ {I_VFNMADD213PS, 3, {XMMREG,XMMREG,RM_XMM|BITS128,0,0}, nasm_bytecodes+12556, IF_FMA|IF_FUTURE},
+    /* 2863 */ {I_VFNMADD213PS, 3, {YMMREG,YMMREG,RM_YMM|BITS256,0,0}, nasm_bytecodes+12563, IF_FMA|IF_FUTURE},
+    /* 2864 */ {I_VFNMADD213PD, 3, {XMMREG,XMMREG,RM_XMM|BITS128,0,0}, nasm_bytecodes+12570, IF_FMA|IF_FUTURE},
+    /* 2865 */ {I_VFNMADD213PD, 3, {YMMREG,YMMREG,RM_YMM|BITS256,0,0}, nasm_bytecodes+12577, IF_FMA|IF_FUTURE},
+    /* 2866 */ {I_VFNMADD123PS, 3, {XMMREG,XMMREG,RM_XMM|BITS128,0,0}, nasm_bytecodes+12556, IF_FMA|IF_FUTURE},
+    /* 2867 */ {I_VFNMADD123PS, 3, {YMMREG,YMMREG,RM_YMM|BITS256,0,0}, nasm_bytecodes+12563, IF_FMA|IF_FUTURE},
+    /* 2868 */ {I_VFNMADD123PD, 3, {XMMREG,XMMREG,RM_XMM|BITS128,0,0}, nasm_bytecodes+12570, IF_FMA|IF_FUTURE},
+    /* 2869 */ {I_VFNMADD123PD, 3, {YMMREG,YMMREG,RM_YMM|BITS256,0,0}, nasm_bytecodes+12577, IF_FMA|IF_FUTURE},
+    /* 2870 */ {I_VFNMADD231PS, 3, {XMMREG,XMMREG,RM_XMM|BITS128,0,0}, nasm_bytecodes+12584, IF_FMA|IF_FUTURE},
+    /* 2871 */ {I_VFNMADD231PS, 3, {YMMREG,YMMREG,RM_YMM|BITS256,0,0}, nasm_bytecodes+12591, IF_FMA|IF_FUTURE},
+    /* 2872 */ {I_VFNMADD231PD, 3, {XMMREG,XMMREG,RM_XMM|BITS128,0,0}, nasm_bytecodes+12598, IF_FMA|IF_FUTURE},
+    /* 2873 */ {I_VFNMADD231PD, 3, {YMMREG,YMMREG,RM_YMM|BITS256,0,0}, nasm_bytecodes+12605, IF_FMA|IF_FUTURE},
+    /* 2874 */ {I_VFNMADD321PS, 3, {XMMREG,XMMREG,RM_XMM|BITS128,0,0}, nasm_bytecodes+12584, IF_FMA|IF_FUTURE},
+    /* 2875 */ {I_VFNMADD321PS, 3, {YMMREG,YMMREG,RM_YMM|BITS256,0,0}, nasm_bytecodes+12591, IF_FMA|IF_FUTURE},
+    /* 2876 */ {I_VFNMADD321PD, 3, {XMMREG,XMMREG,RM_XMM|BITS128,0,0}, nasm_bytecodes+12598, IF_FMA|IF_FUTURE},
+    /* 2877 */ {I_VFNMADD321PD, 3, {YMMREG,YMMREG,RM_YMM|BITS256,0,0}, nasm_bytecodes+12605, IF_FMA|IF_FUTURE},
+    /* 2878 */ {I_VFNMSUB132PS, 3, {XMMREG,XMMREG,RM_XMM|BITS128,0,0}, nasm_bytecodes+12612, IF_FMA|IF_FUTURE},
+    /* 2879 */ {I_VFNMSUB132PS, 3, {YMMREG,YMMREG,RM_YMM|BITS256,0,0}, nasm_bytecodes+12619, IF_FMA|IF_FUTURE},
+    /* 2880 */ {I_VFNMSUB132PD, 3, {XMMREG,XMMREG,RM_XMM|BITS128,0,0}, nasm_bytecodes+12626, IF_FMA|IF_FUTURE},
+    /* 2881 */ {I_VFNMSUB132PD, 3, {YMMREG,YMMREG,RM_YMM|BITS256,0,0}, nasm_bytecodes+12633, IF_FMA|IF_FUTURE},
+    /* 2882 */ {I_VFNMSUB312PS, 3, {XMMREG,XMMREG,RM_XMM|BITS128,0,0}, nasm_bytecodes+12612, IF_FMA|IF_FUTURE},
+    /* 2883 */ {I_VFNMSUB312PS, 3, {YMMREG,YMMREG,RM_YMM|BITS256,0,0}, nasm_bytecodes+12619, IF_FMA|IF_FUTURE},
+    /* 2884 */ {I_VFNMSUB312PD, 3, {XMMREG,XMMREG,RM_XMM|BITS128,0,0}, nasm_bytecodes+12626, IF_FMA|IF_FUTURE},
+    /* 2885 */ {I_VFNMSUB312PD, 3, {YMMREG,YMMREG,RM_YMM|BITS256,0,0}, nasm_bytecodes+12633, IF_FMA|IF_FUTURE},
+    /* 2886 */ {I_VFNMSUB213PS, 3, {XMMREG,XMMREG,RM_XMM|BITS128,0,0}, nasm_bytecodes+12640, IF_FMA|IF_FUTURE},
+    /* 2887 */ {I_VFNMSUB213PS, 3, {YMMREG,YMMREG,RM_YMM|BITS256,0,0}, nasm_bytecodes+12647, IF_FMA|IF_FUTURE},
+    /* 2888 */ {I_VFNMSUB213PD, 3, {XMMREG,XMMREG,RM_XMM|BITS128,0,0}, nasm_bytecodes+12654, IF_FMA|IF_FUTURE},
+    /* 2889 */ {I_VFNMSUB213PD, 3, {YMMREG,YMMREG,RM_YMM|BITS256,0,0}, nasm_bytecodes+12661, IF_FMA|IF_FUTURE},
+    /* 2890 */ {I_VFNMSUB123PS, 3, {XMMREG,XMMREG,RM_XMM|BITS128,0,0}, nasm_bytecodes+12640, IF_FMA|IF_FUTURE},
+    /* 2891 */ {I_VFNMSUB123PS, 3, {YMMREG,YMMREG,RM_YMM|BITS256,0,0}, nasm_bytecodes+12647, IF_FMA|IF_FUTURE},
+    /* 2892 */ {I_VFNMSUB123PD, 3, {XMMREG,XMMREG,RM_XMM|BITS128,0,0}, nasm_bytecodes+12654, IF_FMA|IF_FUTURE},
+    /* 2893 */ {I_VFNMSUB123PD, 3, {YMMREG,YMMREG,RM_YMM|BITS256,0,0}, nasm_bytecodes+12661, IF_FMA|IF_FUTURE},
+    /* 2894 */ {I_VFNMSUB231PS, 3, {XMMREG,XMMREG,RM_XMM|BITS128,0,0}, nasm_bytecodes+12668, IF_FMA|IF_FUTURE},
+    /* 2895 */ {I_VFNMSUB231PS, 3, {YMMREG,YMMREG,RM_YMM|BITS256,0,0}, nasm_bytecodes+12675, IF_FMA|IF_FUTURE},
+    /* 2896 */ {I_VFNMSUB231PD, 3, {XMMREG,XMMREG,RM_XMM|BITS128,0,0}, nasm_bytecodes+12682, IF_FMA|IF_FUTURE},
+    /* 2897 */ {I_VFNMSUB231PD, 3, {YMMREG,YMMREG,RM_YMM|BITS256,0,0}, nasm_bytecodes+12689, IF_FMA|IF_FUTURE},
+    /* 2898 */ {I_VFNMSUB321PS, 3, {XMMREG,XMMREG,RM_XMM|BITS128,0,0}, nasm_bytecodes+12668, IF_FMA|IF_FUTURE},
+    /* 2899 */ {I_VFNMSUB321PS, 3, {YMMREG,YMMREG,RM_YMM|BITS256,0,0}, nasm_bytecodes+12675, IF_FMA|IF_FUTURE},
+    /* 2900 */ {I_VFNMSUB321PD, 3, {XMMREG,XMMREG,RM_XMM|BITS128,0,0}, nasm_bytecodes+12682, IF_FMA|IF_FUTURE},
+    /* 2901 */ {I_VFNMSUB321PD, 3, {YMMREG,YMMREG,RM_YMM|BITS256,0,0}, nasm_bytecodes+12689, IF_FMA|IF_FUTURE},
+    /* 2902 */ {I_VFMADD132SS, 3, {XMMREG,XMMREG,RM_XMM|BITS32,0,0}, nasm_bytecodes+12696, IF_FMA|IF_FUTURE},
+    /* 2903 */ {I_VFMADD132SD, 3, {XMMREG,XMMREG,RM_XMM|BITS64,0,0}, nasm_bytecodes+12703, IF_FMA|IF_FUTURE},
+    /* 2904 */ {I_VFMADD312SS, 3, {XMMREG,XMMREG,RM_XMM|BITS32,0,0}, nasm_bytecodes+12696, IF_FMA|IF_FUTURE},
+    /* 2905 */ {I_VFMADD312SD, 3, {XMMREG,XMMREG,RM_XMM|BITS64,0,0}, nasm_bytecodes+12703, IF_FMA|IF_FUTURE},
+    /* 2906 */ {I_VFMADD213SS, 3, {XMMREG,XMMREG,RM_XMM|BITS32,0,0}, nasm_bytecodes+12710, IF_FMA|IF_FUTURE},
+    /* 2907 */ {I_VFMADD213SD, 3, {XMMREG,XMMREG,RM_XMM|BITS64,0,0}, nasm_bytecodes+12717, IF_FMA|IF_FUTURE},
+    /* 2908 */ {I_VFMADD123SS, 3, {XMMREG,XMMREG,RM_XMM|BITS32,0,0}, nasm_bytecodes+12710, IF_FMA|IF_FUTURE},
+    /* 2909 */ {I_VFMADD123SD, 3, {XMMREG,XMMREG,RM_XMM|BITS64,0,0}, nasm_bytecodes+12717, IF_FMA|IF_FUTURE},
+    /* 2910 */ {I_VFMADD231SS, 3, {XMMREG,XMMREG,RM_XMM|BITS32,0,0}, nasm_bytecodes+12724, IF_FMA|IF_FUTURE},
+    /* 2911 */ {I_VFMADD231SD, 3, {XMMREG,XMMREG,RM_XMM|BITS64,0,0}, nasm_bytecodes+12731, IF_FMA|IF_FUTURE},
+    /* 2912 */ {I_VFMADD321SS, 3, {XMMREG,XMMREG,RM_XMM|BITS32,0,0}, nasm_bytecodes+12724, IF_FMA|IF_FUTURE},
+    /* 2913 */ {I_VFMADD321SD, 3, {XMMREG,XMMREG,RM_XMM|BITS64,0,0}, nasm_bytecodes+12731, IF_FMA|IF_FUTURE},
+    /* 2914 */ {I_VFMSUB132SS, 3, {XMMREG,XMMREG,RM_XMM|BITS32,0,0}, nasm_bytecodes+12738, IF_FMA|IF_FUTURE},
+    /* 2915 */ {I_VFMSUB132SD, 3, {XMMREG,XMMREG,RM_XMM|BITS64,0,0}, nasm_bytecodes+12745, IF_FMA|IF_FUTURE},
+    /* 2916 */ {I_VFMSUB312SS, 3, {XMMREG,XMMREG,RM_XMM|BITS32,0,0}, nasm_bytecodes+12738, IF_FMA|IF_FUTURE},
+    /* 2917 */ {I_VFMSUB312SD, 3, {XMMREG,XMMREG,RM_XMM|BITS64,0,0}, nasm_bytecodes+12745, IF_FMA|IF_FUTURE},
+    /* 2918 */ {I_VFMSUB213SS, 3, {XMMREG,XMMREG,RM_XMM|BITS32,0,0}, nasm_bytecodes+12752, IF_FMA|IF_FUTURE},
+    /* 2919 */ {I_VFMSUB213SD, 3, {XMMREG,XMMREG,RM_XMM|BITS64,0,0}, nasm_bytecodes+12759, IF_FMA|IF_FUTURE},
+    /* 2920 */ {I_VFMSUB123SS, 3, {XMMREG,XMMREG,RM_XMM|BITS32,0,0}, nasm_bytecodes+12752, IF_FMA|IF_FUTURE},
+    /* 2921 */ {I_VFMSUB123SD, 3, {XMMREG,XMMREG,RM_XMM|BITS64,0,0}, nasm_bytecodes+12759, IF_FMA|IF_FUTURE},
+    /* 2922 */ {I_VFMSUB231SS, 3, {XMMREG,XMMREG,RM_XMM|BITS32,0,0}, nasm_bytecodes+12766, IF_FMA|IF_FUTURE},
+    /* 2923 */ {I_VFMSUB231SD, 3, {XMMREG,XMMREG,RM_XMM|BITS64,0,0}, nasm_bytecodes+12773, IF_FMA|IF_FUTURE},
+    /* 2924 */ {I_VFMSUB321SS, 3, {XMMREG,XMMREG,RM_XMM|BITS32,0,0}, nasm_bytecodes+12766, IF_FMA|IF_FUTURE},
+    /* 2925 */ {I_VFMSUB321SD, 3, {XMMREG,XMMREG,RM_XMM|BITS64,0,0}, nasm_bytecodes+12773, IF_FMA|IF_FUTURE},
+    /* 2926 */ {I_VFNMADD132SS, 3, {XMMREG,XMMREG,RM_XMM|BITS32,0,0}, nasm_bytecodes+12780, IF_FMA|IF_FUTURE},
+    /* 2927 */ {I_VFNMADD132SD, 3, {XMMREG,XMMREG,RM_XMM|BITS64,0,0}, nasm_bytecodes+12787, IF_FMA|IF_FUTURE},
+    /* 2928 */ {I_VFNMADD312SS, 3, {XMMREG,XMMREG,RM_XMM|BITS32,0,0}, nasm_bytecodes+12780, IF_FMA|IF_FUTURE},
+    /* 2929 */ {I_VFNMADD312SD, 3, {XMMREG,XMMREG,RM_XMM|BITS64,0,0}, nasm_bytecodes+12787, IF_FMA|IF_FUTURE},
+    /* 2930 */ {I_VFNMADD213SS, 3, {XMMREG,XMMREG,RM_XMM|BITS32,0,0}, nasm_bytecodes+12794, IF_FMA|IF_FUTURE},
+    /* 2931 */ {I_VFNMADD213SD, 3, {XMMREG,XMMREG,RM_XMM|BITS64,0,0}, nasm_bytecodes+12801, IF_FMA|IF_FUTURE},
+    /* 2932 */ {I_VFNMADD123SS, 3, {XMMREG,XMMREG,RM_XMM|BITS32,0,0}, nasm_bytecodes+12794, IF_FMA|IF_FUTURE},
+    /* 2933 */ {I_VFNMADD123SD, 3, {XMMREG,XMMREG,RM_XMM|BITS64,0,0}, nasm_bytecodes+12801, IF_FMA|IF_FUTURE},
+    /* 2934 */ {I_VFNMADD231SS, 3, {XMMREG,XMMREG,RM_XMM|BITS32,0,0}, nasm_bytecodes+12808, IF_FMA|IF_FUTURE},
+    /* 2935 */ {I_VFNMADD231SD, 3, {XMMREG,XMMREG,RM_XMM|BITS64,0,0}, nasm_bytecodes+12815, IF_FMA|IF_FUTURE},
+    /* 2936 */ {I_VFNMADD321SS, 3, {XMMREG,XMMREG,RM_XMM|BITS32,0,0}, nasm_bytecodes+12808, IF_FMA|IF_FUTURE},
+    /* 2937 */ {I_VFNMADD321SD, 3, {XMMREG,XMMREG,RM_XMM|BITS64,0,0}, nasm_bytecodes+12815, IF_FMA|IF_FUTURE},
+    /* 2938 */ {I_VFNMSUB132SS, 3, {XMMREG,XMMREG,RM_XMM|BITS32,0,0}, nasm_bytecodes+12822, IF_FMA|IF_FUTURE},
+    /* 2939 */ {I_VFNMSUB132SD, 3, {XMMREG,XMMREG,RM_XMM|BITS64,0,0}, nasm_bytecodes+12829, IF_FMA|IF_FUTURE},
+    /* 2940 */ {I_VFNMSUB312SS, 3, {XMMREG,XMMREG,RM_XMM|BITS32,0,0}, nasm_bytecodes+12822, IF_FMA|IF_FUTURE},
+    /* 2941 */ {I_VFNMSUB312SD, 3, {XMMREG,XMMREG,RM_XMM|BITS64,0,0}, nasm_bytecodes+12829, IF_FMA|IF_FUTURE},
+    /* 2942 */ {I_VFNMSUB213SS, 3, {XMMREG,XMMREG,RM_XMM|BITS32,0,0}, nasm_bytecodes+12836, IF_FMA|IF_FUTURE},
+    /* 2943 */ {I_VFNMSUB213SD, 3, {XMMREG,XMMREG,RM_XMM|BITS64,0,0}, nasm_bytecodes+12843, IF_FMA|IF_FUTURE},
+    /* 2944 */ {I_VFNMSUB123SS, 3, {XMMREG,XMMREG,RM_XMM|BITS32,0,0}, nasm_bytecodes+12836, IF_FMA|IF_FUTURE},
+    /* 2945 */ {I_VFNMSUB123SD, 3, {XMMREG,XMMREG,RM_XMM|BITS64,0,0}, nasm_bytecodes+12843, IF_FMA|IF_FUTURE},
+    /* 2946 */ {I_VFNMSUB231SS, 3, {XMMREG,XMMREG,RM_XMM|BITS32,0,0}, nasm_bytecodes+12850, IF_FMA|IF_FUTURE},
+    /* 2947 */ {I_VFNMSUB231SD, 3, {XMMREG,XMMREG,RM_XMM|BITS64,0,0}, nasm_bytecodes+12857, IF_FMA|IF_FUTURE},
+    /* 2948 */ {I_VFNMSUB321SS, 3, {XMMREG,XMMREG,RM_XMM|BITS32,0,0}, nasm_bytecodes+12850, IF_FMA|IF_FUTURE},
+    /* 2949 */ {I_VFNMSUB321SD, 3, {XMMREG,XMMREG,RM_XMM|BITS64,0,0}, nasm_bytecodes+12857, IF_FMA|IF_FUTURE},
+    /* 2950 */ {I_XSTORE, 0, {0,0,0,0,0}, nasm_bytecodes+18909, IF_PENT|IF_CYRIX},
+    /* 2951 */ {I_XCRYPTECB, 0, {0,0,0,0,0}, nasm_bytecodes+15852, IF_PENT|IF_CYRIX},
+    /* 2952 */ {I_XCRYPTCBC, 0, {0,0,0,0,0}, nasm_bytecodes+15858, IF_PENT|IF_CYRIX},
+    /* 2953 */ {I_XCRYPTCTR, 0, {0,0,0,0,0}, nasm_bytecodes+15864, IF_PENT|IF_CYRIX},
+    /* 2954 */ {I_XCRYPTCFB, 0, {0,0,0,0,0}, nasm_bytecodes+15870, IF_PENT|IF_CYRIX},
+    /* 2955 */ {I_XCRYPTOFB, 0, {0,0,0,0,0}, nasm_bytecodes+15876, IF_PENT|IF_CYRIX},
+    /* 2956 */ {I_MONTMUL, 0, {0,0,0,0,0}, nasm_bytecodes+15882, IF_PENT|IF_CYRIX},
+    /* 2957 */ {I_XSHA1, 0, {0,0,0,0,0}, nasm_bytecodes+15888, IF_PENT|IF_CYRIX},
+    /* 2958 */ {I_XSHA256, 0, {0,0,0,0,0}, nasm_bytecodes+15894, IF_PENT|IF_CYRIX},
+    /* 2959 */ {I_LLWPCB, 1, {REG_GPR|BITS16,0,0,0,0}, nasm_bytecodes+12864, IF_AMD},
+    /* 2960 */ {I_LLWPCB, 1, {REG_GPR|BITS32,0,0,0,0}, nasm_bytecodes+12871, IF_AMD|IF_386},
+    /* 2961 */ {I_LLWPCB, 1, {REG_GPR|BITS64,0,0,0,0}, nasm_bytecodes+12878, IF_AMD|IF_X64},
+    /* 2962 */ {I_SLWPCB, 1, {REG_GPR|BITS16,0,0,0,0}, nasm_bytecodes+12885, IF_AMD},
+    /* 2963 */ {I_SLWPCB, 1, {REG_GPR|BITS32,0,0,0,0}, nasm_bytecodes+12892, IF_AMD|IF_386},
+    /* 2964 */ {I_SLWPCB, 1, {REG_GPR|BITS64,0,0,0,0}, nasm_bytecodes+12899, IF_AMD|IF_X64},
+    /* 2965 */ {I_LWPVAL, 3, {REG_GPR|BITS16,RM_GPR|BITS32,IMMEDIATE|BITS16,0,0}, nasm_bytecodes+6932, IF_AMD|IF_386},
+    /* 2966 */ {I_LWPVAL, 3, {REG_GPR|BITS32,RM_GPR|BITS32,IMMEDIATE|BITS32,0,0}, nasm_bytecodes+6940, IF_AMD|IF_386},
+    /* 2967 */ {I_LWPVAL, 3, {REG_GPR|BITS64,RM_GPR|BITS32,IMMEDIATE|BITS32,0,0}, nasm_bytecodes+6948, IF_AMD|IF_X64},
+    /* 2968 */ {I_LWPINS, 3, {REG_GPR|BITS16,RM_GPR|BITS32,IMMEDIATE|BITS16,0,0}, nasm_bytecodes+6956, IF_AMD|IF_386},
+    /* 2969 */ {I_LWPINS, 3, {REG_GPR|BITS32,RM_GPR|BITS32,IMMEDIATE|BITS32,0,0}, nasm_bytecodes+6964, IF_AMD|IF_386},
+    /* 2970 */ {I_LWPINS, 3, {REG_GPR|BITS64,RM_GPR|BITS32,IMMEDIATE|BITS32,0,0}, nasm_bytecodes+6972, IF_AMD|IF_X64},
+    /* 2971 */ {I_VCVTPH2PS, 3, {XMMREG,RM_XMM|BITS64,IMMEDIATE|BITS8,0,0}, nasm_bytecodes+6980, IF_AMD|IF_SSE5},
+    /* 2972 */ {I_VCVTPH2PS, 2, {XMMREG,IMMEDIATE|BITS8,0,0,0}, nasm_bytecodes+6988, IF_AMD|IF_SSE5},
+    /* 2973 */ {I_VCVTPH2PS, 3, {YMMREG,RM_XMM|BITS128,IMMEDIATE|BITS8,0,0}, nasm_bytecodes+6996, IF_AMD|IF_SSE5},
+    /* 2974 */ {I_VCVTPH2PS, 3, {YMMREG,RM_YMM|BITS128,IMMEDIATE|BITS8,0,0}, nasm_bytecodes+6996, IF_AMD|IF_SSE5},
+    /* 2975 */ {I_VCVTPH2PS, 2, {YMMREG,IMMEDIATE|BITS8,0,0,0}, nasm_bytecodes+7004, IF_AMD|IF_SSE5},
+    /* 2976 */ {I_VCVTPS2PH, 3, {RM_XMM|BITS64,XMMREG,IMMEDIATE|BITS8,0,0}, nasm_bytecodes+7012, IF_AMD|IF_SSE5},
+    /* 2977 */ {I_VCVTPS2PH, 2, {RM_XMM|BITS64,IMMEDIATE|BITS8,0,0,0}, nasm_bytecodes+7020, IF_AMD|IF_SSE5},
+    /* 2978 */ {I_VCVTPS2PH, 3, {RM_XMM|BITS128,YMMREG,IMMEDIATE|BITS8,0,0}, nasm_bytecodes+7028, IF_AMD|IF_SSE5},
+    /* 2979 */ {I_VCVTPS2PH, 3, {RM_YMM|BITS128,YMMREG,IMMEDIATE|BITS8,0,0}, nasm_bytecodes+7028, IF_AMD|IF_SSE5},
+    /* 2980 */ {I_VCVTPS2PH, 2, {RM_YMM|BITS128,IMMEDIATE|BITS8,0,0,0}, nasm_bytecodes+7036, IF_AMD|IF_SSE5},
+    /* 2981 */ {I_VFMADDPD, 4, {XMMREG,XMMREG,RM_XMM|BITS128,XMMREG,0}, nasm_bytecodes+3960, IF_AMD|IF_SSE5},
+    /* 2982 */ {I_VFMADDPD, 3, {XMMREG,RM_XMM|BITS128,XMMREG,0,0}, nasm_bytecodes+3969, IF_AMD|IF_SSE5},
+    /* 2983 */ {I_VFMADDPD, 4, {YMMREG,YMMREG,RM_YMM|BITS256,YMMREG,0}, nasm_bytecodes+3978, IF_AMD|IF_SSE5},
+    /* 2984 */ {I_VFMADDPD, 3, {YMMREG,RM_YMM|BITS256,YMMREG,0,0}, nasm_bytecodes+3987, IF_AMD|IF_SSE5},
+    /* 2985 */ {I_VFMADDPD, 4, {XMMREG,XMMREG,XMMREG,RM_XMM|BITS128,0}, nasm_bytecodes+3996, IF_AMD|IF_SSE5},
+    /* 2986 */ {I_VFMADDPD, 3, {XMMREG,XMMREG,RM_XMM|BITS128,0,0}, nasm_bytecodes+4005, IF_AMD|IF_SSE5},
+    /* 2987 */ {I_VFMADDPD, 4, {YMMREG,YMMREG,YMMREG,RM_YMM|BITS256,0}, nasm_bytecodes+4014, IF_AMD|IF_SSE5},
+    /* 2988 */ {I_VFMADDPD, 3, {YMMREG,YMMREG,RM_YMM|BITS256,0,0}, nasm_bytecodes+4023, IF_AMD|IF_SSE5},
+    /* 2989 */ {I_VFMADDPS, 4, {XMMREG,XMMREG,RM_XMM|BITS128,XMMREG,0}, nasm_bytecodes+4032, IF_AMD|IF_SSE5},
+    /* 2990 */ {I_VFMADDPS, 3, {XMMREG,RM_XMM|BITS128,XMMREG,0,0}, nasm_bytecodes+4041, IF_AMD|IF_SSE5},
+    /* 2991 */ {I_VFMADDPS, 4, {YMMREG,YMMREG,RM_YMM|BITS256,YMMREG,0}, nasm_bytecodes+4050, IF_AMD|IF_SSE5},
+    /* 2992 */ {I_VFMADDPS, 3, {YMMREG,RM_YMM|BITS256,YMMREG,0,0}, nasm_bytecodes+4059, IF_AMD|IF_SSE5},
+    /* 2993 */ {I_VFMADDPS, 4, {XMMREG,XMMREG,XMMREG,RM_XMM|BITS128,0}, nasm_bytecodes+4068, IF_AMD|IF_SSE5},
+    /* 2994 */ {I_VFMADDPS, 3, {XMMREG,XMMREG,RM_XMM|BITS128,0,0}, nasm_bytecodes+4077, IF_AMD|IF_SSE5},
+    /* 2995 */ {I_VFMADDPS, 4, {YMMREG,YMMREG,YMMREG,RM_YMM|BITS256,0}, nasm_bytecodes+4086, IF_AMD|IF_SSE5},
+    /* 2996 */ {I_VFMADDPS, 3, {YMMREG,YMMREG,RM_YMM|BITS256,0,0}, nasm_bytecodes+4095, IF_AMD|IF_SSE5},
+    /* 2997 */ {I_VFMADDSD, 4, {XMMREG,XMMREG,RM_XMM|BITS64,XMMREG,0}, nasm_bytecodes+4104, IF_AMD|IF_SSE5},
+    /* 2998 */ {I_VFMADDSD, 3, {XMMREG,RM_XMM|BITS64,XMMREG,0,0}, nasm_bytecodes+4113, IF_AMD|IF_SSE5},
+    /* 2999 */ {I_VFMADDSD, 4, {XMMREG,XMMREG,XMMREG,RM_XMM|BITS64,0}, nasm_bytecodes+4122, IF_AMD|IF_SSE5},
+    /* 3000 */ {I_VFMADDSD, 3, {XMMREG,XMMREG,RM_XMM|BITS64,0,0}, nasm_bytecodes+4131, IF_AMD|IF_SSE5},
+    /* 3001 */ {I_VFMADDSS, 4, {XMMREG,XMMREG,RM_XMM|BITS32,XMMREG,0}, nasm_bytecodes+4140, IF_AMD|IF_SSE5},
+    /* 3002 */ {I_VFMADDSS, 3, {XMMREG,RM_XMM|BITS32,XMMREG,0,0}, nasm_bytecodes+4149, IF_AMD|IF_SSE5},
+    /* 3003 */ {I_VFMADDSS, 4, {XMMREG,XMMREG,XMMREG,RM_XMM|BITS32,0}, nasm_bytecodes+4158, IF_AMD|IF_SSE5},
+    /* 3004 */ {I_VFMADDSS, 3, {XMMREG,XMMREG,RM_XMM|BITS32,0,0}, nasm_bytecodes+4167, IF_AMD|IF_SSE5},
+    /* 3005 */ {I_VFMADDSUBPD, 4, {XMMREG,XMMREG,RM_XMM|BITS128,XMMREG,0}, nasm_bytecodes+4176, IF_AMD|IF_SSE5},
+    /* 3006 */ {I_VFMADDSUBPD, 3, {XMMREG,RM_XMM|BITS128,XMMREG,0,0}, nasm_bytecodes+4185, IF_AMD|IF_SSE5},
+    /* 3007 */ {I_VFMADDSUBPD, 4, {YMMREG,YMMREG,RM_YMM|BITS256,YMMREG,0}, nasm_bytecodes+4194, IF_AMD|IF_SSE5},
+    /* 3008 */ {I_VFMADDSUBPD, 3, {YMMREG,RM_YMM|BITS256,YMMREG,0,0}, nasm_bytecodes+4203, IF_AMD|IF_SSE5},
+    /* 3009 */ {I_VFMADDSUBPD, 4, {XMMREG,XMMREG,XMMREG,RM_XMM|BITS128,0}, nasm_bytecodes+4212, IF_AMD|IF_SSE5},
+    /* 3010 */ {I_VFMADDSUBPD, 3, {XMMREG,XMMREG,RM_XMM|BITS128,0,0}, nasm_bytecodes+4221, IF_AMD|IF_SSE5},
+    /* 3011 */ {I_VFMADDSUBPD, 4, {YMMREG,YMMREG,YMMREG,RM_YMM|BITS256,0}, nasm_bytecodes+4230, IF_AMD|IF_SSE5},
+    /* 3012 */ {I_VFMADDSUBPD, 3, {YMMREG,YMMREG,RM_YMM|BITS256,0,0}, nasm_bytecodes+4239, IF_AMD|IF_SSE5},
+    /* 3013 */ {I_VFMADDSUBPS, 4, {XMMREG,XMMREG,RM_XMM|BITS128,XMMREG,0}, nasm_bytecodes+4248, IF_AMD|IF_SSE5},
+    /* 3014 */ {I_VFMADDSUBPS, 3, {XMMREG,RM_XMM|BITS128,XMMREG,0,0}, nasm_bytecodes+4257, IF_AMD|IF_SSE5},
+    /* 3015 */ {I_VFMADDSUBPS, 4, {YMMREG,YMMREG,RM_YMM|BITS256,YMMREG,0}, nasm_bytecodes+4266, IF_AMD|IF_SSE5},
+    /* 3016 */ {I_VFMADDSUBPS, 3, {YMMREG,RM_YMM|BITS256,YMMREG,0,0}, nasm_bytecodes+4275, IF_AMD|IF_SSE5},
+    /* 3017 */ {I_VFMADDSUBPS, 4, {XMMREG,XMMREG,XMMREG,RM_XMM|BITS128,0}, nasm_bytecodes+4284, IF_AMD|IF_SSE5},
+    /* 3018 */ {I_VFMADDSUBPS, 3, {XMMREG,XMMREG,RM_XMM|BITS128,0,0}, nasm_bytecodes+4293, IF_AMD|IF_SSE5},
+    /* 3019 */ {I_VFMADDSUBPS, 4, {YMMREG,YMMREG,YMMREG,RM_YMM|BITS256,0}, nasm_bytecodes+4302, IF_AMD|IF_SSE5},
+    /* 3020 */ {I_VFMADDSUBPS, 3, {YMMREG,YMMREG,RM_YMM|BITS256,0,0}, nasm_bytecodes+4311, IF_AMD|IF_SSE5},
+    /* 3021 */ {I_VFMSUBADDPD, 4, {XMMREG,XMMREG,RM_XMM|BITS128,XMMREG,0}, nasm_bytecodes+4320, IF_AMD|IF_SSE5},
+    /* 3022 */ {I_VFMSUBADDPD, 3, {XMMREG,RM_XMM|BITS128,XMMREG,0,0}, nasm_bytecodes+4329, IF_AMD|IF_SSE5},
+    /* 3023 */ {I_VFMSUBADDPD, 4, {YMMREG,YMMREG,RM_YMM|BITS256,YMMREG,0}, nasm_bytecodes+4338, IF_AMD|IF_SSE5},
+    /* 3024 */ {I_VFMSUBADDPD, 3, {YMMREG,RM_YMM|BITS256,YMMREG,0,0}, nasm_bytecodes+4347, IF_AMD|IF_SSE5},
+    /* 3025 */ {I_VFMSUBADDPD, 4, {XMMREG,XMMREG,XMMREG,RM_XMM|BITS128,0}, nasm_bytecodes+4356, IF_AMD|IF_SSE5},
+    /* 3026 */ {I_VFMSUBADDPD, 3, {XMMREG,XMMREG,RM_XMM|BITS128,0,0}, nasm_bytecodes+4365, IF_AMD|IF_SSE5},
+    /* 3027 */ {I_VFMSUBADDPD, 4, {YMMREG,YMMREG,YMMREG,RM_YMM|BITS256,0}, nasm_bytecodes+4374, IF_AMD|IF_SSE5},
+    /* 3028 */ {I_VFMSUBADDPD, 3, {YMMREG,YMMREG,RM_YMM|BITS256,0,0}, nasm_bytecodes+4383, IF_AMD|IF_SSE5},
+    /* 3029 */ {I_VFMSUBADDPS, 4, {XMMREG,XMMREG,RM_XMM|BITS128,XMMREG,0}, nasm_bytecodes+4392, IF_AMD|IF_SSE5},
+    /* 3030 */ {I_VFMSUBADDPS, 3, {XMMREG,RM_XMM|BITS128,XMMREG,0,0}, nasm_bytecodes+4401, IF_AMD|IF_SSE5},
+    /* 3031 */ {I_VFMSUBADDPS, 4, {YMMREG,YMMREG,RM_YMM|BITS256,YMMREG,0}, nasm_bytecodes+4410, IF_AMD|IF_SSE5},
+    /* 3032 */ {I_VFMSUBADDPS, 3, {YMMREG,RM_YMM|BITS256,YMMREG,0,0}, nasm_bytecodes+4419, IF_AMD|IF_SSE5},
+    /* 3033 */ {I_VFMSUBADDPS, 4, {XMMREG,XMMREG,XMMREG,RM_XMM|BITS128,0}, nasm_bytecodes+4428, IF_AMD|IF_SSE5},
+    /* 3034 */ {I_VFMSUBADDPS, 3, {XMMREG,XMMREG,RM_XMM|BITS128,0,0}, nasm_bytecodes+4437, IF_AMD|IF_SSE5},
+    /* 3035 */ {I_VFMSUBADDPS, 4, {YMMREG,YMMREG,YMMREG,RM_YMM|BITS256,0}, nasm_bytecodes+4446, IF_AMD|IF_SSE5},
+    /* 3036 */ {I_VFMSUBADDPS, 3, {YMMREG,YMMREG,RM_YMM|BITS256,0,0}, nasm_bytecodes+4455, IF_AMD|IF_SSE5},
+    /* 3037 */ {I_VFMSUBPD, 4, {XMMREG,XMMREG,RM_XMM|BITS128,XMMREG,0}, nasm_bytecodes+4464, IF_AMD|IF_SSE5},
+    /* 3038 */ {I_VFMSUBPD, 3, {XMMREG,RM_XMM|BITS128,XMMREG,0,0}, nasm_bytecodes+4473, IF_AMD|IF_SSE5},
+    /* 3039 */ {I_VFMSUBPD, 4, {YMMREG,YMMREG,RM_YMM|BITS256,YMMREG,0}, nasm_bytecodes+4482, IF_AMD|IF_SSE5},
+    /* 3040 */ {I_VFMSUBPD, 3, {YMMREG,RM_YMM|BITS256,YMMREG,0,0}, nasm_bytecodes+4491, IF_AMD|IF_SSE5},
+    /* 3041 */ {I_VFMSUBPD, 4, {XMMREG,XMMREG,XMMREG,RM_XMM|BITS128,0}, nasm_bytecodes+4500, IF_AMD|IF_SSE5},
+    /* 3042 */ {I_VFMSUBPD, 3, {XMMREG,XMMREG,RM_XMM|BITS128,0,0}, nasm_bytecodes+4509, IF_AMD|IF_SSE5},
+    /* 3043 */ {I_VFMSUBPD, 4, {YMMREG,YMMREG,YMMREG,RM_YMM|BITS256,0}, nasm_bytecodes+4518, IF_AMD|IF_SSE5},
+    /* 3044 */ {I_VFMSUBPD, 3, {YMMREG,YMMREG,RM_YMM|BITS256,0,0}, nasm_bytecodes+4527, IF_AMD|IF_SSE5},
+    /* 3045 */ {I_VFMSUBPS, 4, {XMMREG,XMMREG,RM_XMM|BITS128,XMMREG,0}, nasm_bytecodes+4536, IF_AMD|IF_SSE5},
+    /* 3046 */ {I_VFMSUBPS, 3, {XMMREG,RM_XMM|BITS128,XMMREG,0,0}, nasm_bytecodes+4545, IF_AMD|IF_SSE5},
+    /* 3047 */ {I_VFMSUBPS, 4, {YMMREG,YMMREG,RM_YMM|BITS256,YMMREG,0}, nasm_bytecodes+4554, IF_AMD|IF_SSE5},
+    /* 3048 */ {I_VFMSUBPS, 3, {YMMREG,RM_YMM|BITS256,YMMREG,0,0}, nasm_bytecodes+4563, IF_AMD|IF_SSE5},
+    /* 3049 */ {I_VFMSUBPS, 4, {XMMREG,XMMREG,XMMREG,RM_XMM|BITS128,0}, nasm_bytecodes+4572, IF_AMD|IF_SSE5},
+    /* 3050 */ {I_VFMSUBPS, 3, {XMMREG,XMMREG,RM_XMM|BITS128,0,0}, nasm_bytecodes+4581, IF_AMD|IF_SSE5},
+    /* 3051 */ {I_VFMSUBPS, 4, {YMMREG,YMMREG,YMMREG,RM_YMM|BITS256,0}, nasm_bytecodes+4590, IF_AMD|IF_SSE5},
+    /* 3052 */ {I_VFMSUBPS, 3, {YMMREG,YMMREG,RM_YMM|BITS256,0,0}, nasm_bytecodes+4599, IF_AMD|IF_SSE5},
+    /* 3053 */ {I_VFMSUBSD, 4, {XMMREG,XMMREG,RM_XMM|BITS64,XMMREG,0}, nasm_bytecodes+4608, IF_AMD|IF_SSE5},
+    /* 3054 */ {I_VFMSUBSD, 3, {XMMREG,RM_XMM|BITS64,XMMREG,0,0}, nasm_bytecodes+4617, IF_AMD|IF_SSE5},
+    /* 3055 */ {I_VFMSUBSD, 4, {XMMREG,XMMREG,XMMREG,RM_XMM|BITS64,0}, nasm_bytecodes+4626, IF_AMD|IF_SSE5},
+    /* 3056 */ {I_VFMSUBSD, 3, {XMMREG,XMMREG,RM_XMM|BITS64,0,0}, nasm_bytecodes+4635, IF_AMD|IF_SSE5},
+    /* 3057 */ {I_VFMSUBSS, 4, {XMMREG,XMMREG,RM_XMM|BITS32,XMMREG,0}, nasm_bytecodes+4644, IF_AMD|IF_SSE5},
+    /* 3058 */ {I_VFMSUBSS, 3, {XMMREG,RM_XMM|BITS32,XMMREG,0,0}, nasm_bytecodes+4653, IF_AMD|IF_SSE5},
+    /* 3059 */ {I_VFMSUBSS, 4, {XMMREG,XMMREG,XMMREG,RM_XMM|BITS32,0}, nasm_bytecodes+4662, IF_AMD|IF_SSE5},
+    /* 3060 */ {I_VFMSUBSS, 3, {XMMREG,XMMREG,RM_XMM|BITS32,0,0}, nasm_bytecodes+4671, IF_AMD|IF_SSE5},
+    /* 3061 */ {I_VFNMADDPD, 4, {XMMREG,XMMREG,RM_XMM|BITS128,XMMREG,0}, nasm_bytecodes+4680, IF_AMD|IF_SSE5},
+    /* 3062 */ {I_VFNMADDPD, 3, {XMMREG,RM_XMM|BITS128,XMMREG,0,0}, nasm_bytecodes+4689, IF_AMD|IF_SSE5},
+    /* 3063 */ {I_VFNMADDPD, 4, {YMMREG,YMMREG,RM_YMM|BITS256,YMMREG,0}, nasm_bytecodes+4698, IF_AMD|IF_SSE5},
+    /* 3064 */ {I_VFNMADDPD, 3, {YMMREG,RM_YMM|BITS256,YMMREG,0,0}, nasm_bytecodes+4707, IF_AMD|IF_SSE5},
+    /* 3065 */ {I_VFNMADDPD, 4, {XMMREG,XMMREG,XMMREG,RM_XMM|BITS128,0}, nasm_bytecodes+4716, IF_AMD|IF_SSE5},
+    /* 3066 */ {I_VFNMADDPD, 3, {XMMREG,XMMREG,RM_XMM|BITS128,0,0}, nasm_bytecodes+4725, IF_AMD|IF_SSE5},
+    /* 3067 */ {I_VFNMADDPD, 4, {YMMREG,YMMREG,YMMREG,RM_YMM|BITS256,0}, nasm_bytecodes+4734, IF_AMD|IF_SSE5},
+    /* 3068 */ {I_VFNMADDPD, 3, {YMMREG,YMMREG,RM_YMM|BITS256,0,0}, nasm_bytecodes+4743, IF_AMD|IF_SSE5},
+    /* 3069 */ {I_VFNMADDPS, 4, {XMMREG,XMMREG,RM_XMM|BITS128,XMMREG,0}, nasm_bytecodes+4752, IF_AMD|IF_SSE5},
+    /* 3070 */ {I_VFNMADDPS, 3, {XMMREG,RM_XMM|BITS128,XMMREG,0,0}, nasm_bytecodes+4761, IF_AMD|IF_SSE5},
+    /* 3071 */ {I_VFNMADDPS, 4, {YMMREG,YMMREG,RM_YMM|BITS256,YMMREG,0}, nasm_bytecodes+4770, IF_AMD|IF_SSE5},
+    /* 3072 */ {I_VFNMADDPS, 3, {YMMREG,RM_YMM|BITS256,YMMREG,0,0}, nasm_bytecodes+4779, IF_AMD|IF_SSE5},
+    /* 3073 */ {I_VFNMADDPS, 4, {XMMREG,XMMREG,XMMREG,RM_XMM|BITS128,0}, nasm_bytecodes+4788, IF_AMD|IF_SSE5},
+    /* 3074 */ {I_VFNMADDPS, 3, {XMMREG,XMMREG,RM_XMM|BITS128,0,0}, nasm_bytecodes+4797, IF_AMD|IF_SSE5},
+    /* 3075 */ {I_VFNMADDPS, 4, {YMMREG,YMMREG,YMMREG,RM_YMM|BITS256,0}, nasm_bytecodes+4806, IF_AMD|IF_SSE5},
+    /* 3076 */ {I_VFNMADDPS, 3, {YMMREG,YMMREG,RM_YMM|BITS256,0,0}, nasm_bytecodes+4815, IF_AMD|IF_SSE5},
+    /* 3077 */ {I_VFNMADDSD, 4, {XMMREG,XMMREG,RM_XMM|BITS64,XMMREG,0}, nasm_bytecodes+4824, IF_AMD|IF_SSE5},
+    /* 3078 */ {I_VFNMADDSD, 3, {XMMREG,RM_XMM|BITS64,XMMREG,0,0}, nasm_bytecodes+4833, IF_AMD|IF_SSE5},
+    /* 3079 */ {I_VFNMADDSD, 4, {XMMREG,XMMREG,XMMREG,RM_XMM|BITS64,0}, nasm_bytecodes+4842, IF_AMD|IF_SSE5},
+    /* 3080 */ {I_VFNMADDSD, 3, {XMMREG,XMMREG,RM_XMM|BITS64,0,0}, nasm_bytecodes+4851, IF_AMD|IF_SSE5},
+    /* 3081 */ {I_VFNMADDSS, 4, {XMMREG,XMMREG,RM_XMM|BITS32,XMMREG,0}, nasm_bytecodes+4860, IF_AMD|IF_SSE5},
+    /* 3082 */ {I_VFNMADDSS, 3, {XMMREG,RM_XMM|BITS32,XMMREG,0,0}, nasm_bytecodes+4869, IF_AMD|IF_SSE5},
+    /* 3083 */ {I_VFNMADDSS, 4, {XMMREG,XMMREG,XMMREG,RM_XMM|BITS32,0}, nasm_bytecodes+4878, IF_AMD|IF_SSE5},
+    /* 3084 */ {I_VFNMADDSS, 3, {XMMREG,XMMREG,RM_XMM|BITS32,0,0}, nasm_bytecodes+4887, IF_AMD|IF_SSE5},
+    /* 3085 */ {I_VFNMSUBPD, 4, {XMMREG,XMMREG,RM_XMM|BITS128,XMMREG,0}, nasm_bytecodes+4896, IF_AMD|IF_SSE5},
+    /* 3086 */ {I_VFNMSUBPD, 3, {XMMREG,RM_XMM|BITS128,XMMREG,0,0}, nasm_bytecodes+4905, IF_AMD|IF_SSE5},
+    /* 3087 */ {I_VFNMSUBPD, 4, {YMMREG,YMMREG,RM_YMM|BITS256,YMMREG,0}, nasm_bytecodes+4914, IF_AMD|IF_SSE5},
+    /* 3088 */ {I_VFNMSUBPD, 3, {YMMREG,RM_YMM|BITS256,YMMREG,0,0}, nasm_bytecodes+4923, IF_AMD|IF_SSE5},
+    /* 3089 */ {I_VFNMSUBPD, 4, {XMMREG,XMMREG,XMMREG,RM_XMM|BITS128,0}, nasm_bytecodes+4932, IF_AMD|IF_SSE5},
+    /* 3090 */ {I_VFNMSUBPD, 3, {XMMREG,XMMREG,RM_XMM|BITS128,0,0}, nasm_bytecodes+4941, IF_AMD|IF_SSE5},
+    /* 3091 */ {I_VFNMSUBPD, 4, {YMMREG,YMMREG,YMMREG,RM_YMM|BITS256,0}, nasm_bytecodes+4950, IF_AMD|IF_SSE5},
+    /* 3092 */ {I_VFNMSUBPD, 3, {YMMREG,YMMREG,RM_YMM|BITS256,0,0}, nasm_bytecodes+4959, IF_AMD|IF_SSE5},
+    /* 3093 */ {I_VFNMSUBPS, 4, {XMMREG,XMMREG,RM_XMM|BITS128,XMMREG,0}, nasm_bytecodes+4968, IF_AMD|IF_SSE5},
+    /* 3094 */ {I_VFNMSUBPS, 3, {XMMREG,RM_XMM|BITS128,XMMREG,0,0}, nasm_bytecodes+4977, IF_AMD|IF_SSE5},
+    /* 3095 */ {I_VFNMSUBPS, 4, {YMMREG,YMMREG,RM_YMM|BITS256,YMMREG,0}, nasm_bytecodes+4986, IF_AMD|IF_SSE5},
+    /* 3096 */ {I_VFNMSUBPS, 3, {YMMREG,RM_YMM|BITS256,YMMREG,0,0}, nasm_bytecodes+4995, IF_AMD|IF_SSE5},
+    /* 3097 */ {I_VFNMSUBPS, 4, {XMMREG,XMMREG,XMMREG,RM_XMM|BITS128,0}, nasm_bytecodes+5004, IF_AMD|IF_SSE5},
+    /* 3098 */ {I_VFNMSUBPS, 3, {XMMREG,XMMREG,RM_XMM|BITS128,0,0}, nasm_bytecodes+5013, IF_AMD|IF_SSE5},
+    /* 3099 */ {I_VFNMSUBPS, 4, {YMMREG,YMMREG,YMMREG,RM_YMM|BITS256,0}, nasm_bytecodes+5022, IF_AMD|IF_SSE5},
+    /* 3100 */ {I_VFNMSUBPS, 3, {YMMREG,YMMREG,RM_YMM|BITS256,0,0}, nasm_bytecodes+5031, IF_AMD|IF_SSE5},
+    /* 3101 */ {I_VFNMSUBSD, 4, {XMMREG,XMMREG,RM_XMM|BITS64,XMMREG,0}, nasm_bytecodes+5040, IF_AMD|IF_SSE5},
+    /* 3102 */ {I_VFNMSUBSD, 3, {XMMREG,RM_XMM|BITS64,XMMREG,0,0}, nasm_bytecodes+5049, IF_AMD|IF_SSE5},
+    /* 3103 */ {I_VFNMSUBSD, 4, {XMMREG,XMMREG,XMMREG,RM_XMM|BITS64,0}, nasm_bytecodes+5058, IF_AMD|IF_SSE5},
+    /* 3104 */ {I_VFNMSUBSD, 3, {XMMREG,XMMREG,RM_XMM|BITS64,0,0}, nasm_bytecodes+5067, IF_AMD|IF_SSE5},
+    /* 3105 */ {I_VFNMSUBSS, 4, {XMMREG,XMMREG,RM_XMM|BITS32,XMMREG,0}, nasm_bytecodes+5076, IF_AMD|IF_SSE5},
+    /* 3106 */ {I_VFNMSUBSS, 3, {XMMREG,RM_XMM|BITS32,XMMREG,0,0}, nasm_bytecodes+5085, IF_AMD|IF_SSE5},
+    /* 3107 */ {I_VFNMSUBSS, 4, {XMMREG,XMMREG,XMMREG,RM_XMM|BITS32,0}, nasm_bytecodes+5094, IF_AMD|IF_SSE5},
+    /* 3108 */ {I_VFNMSUBSS, 3, {XMMREG,XMMREG,RM_XMM|BITS32,0,0}, nasm_bytecodes+5103, IF_AMD|IF_SSE5},
+    /* 3109 */ {I_VFRCZPD, 2, {XMMREG,RM_XMM|BITS128,0,0,0}, nasm_bytecodes+12906, IF_AMD|IF_SSE5},
+    /* 3110 */ {I_VFRCZPD, 1, {XMMREG,0,0,0,0}, nasm_bytecodes+12913, IF_AMD|IF_SSE5},
+    /* 3111 */ {I_VFRCZPD, 2, {YMMREG,RM_YMM|BITS256,0,0,0}, nasm_bytecodes+12920, IF_AMD|IF_SSE5},
+    /* 3112 */ {I_VFRCZPD, 1, {YMMREG,0,0,0,0}, nasm_bytecodes+12927, IF_AMD|IF_SSE5},
+    /* 3113 */ {I_VFRCZPS, 2, {XMMREG,RM_XMM|BITS128,0,0,0}, nasm_bytecodes+12934, IF_AMD|IF_SSE5},
+    /* 3114 */ {I_VFRCZPS, 1, {XMMREG,0,0,0,0}, nasm_bytecodes+12941, IF_AMD|IF_SSE5},
+    /* 3115 */ {I_VFRCZPS, 2, {YMMREG,RM_YMM|BITS256,0,0,0}, nasm_bytecodes+12948, IF_AMD|IF_SSE5},
+    /* 3116 */ {I_VFRCZPS, 1, {YMMREG,0,0,0,0}, nasm_bytecodes+12955, IF_AMD|IF_SSE5},
+    /* 3117 */ {I_VFRCZSD, 2, {XMMREG,RM_XMM|BITS64,0,0,0}, nasm_bytecodes+12962, IF_AMD|IF_SSE5},
+    /* 3118 */ {I_VFRCZSD, 1, {XMMREG,0,0,0,0}, nasm_bytecodes+12969, IF_AMD|IF_SSE5},
+    /* 3119 */ {I_VFRCZSS, 2, {XMMREG,RM_XMM|BITS32,0,0,0}, nasm_bytecodes+12976, IF_AMD|IF_SSE5},
+    /* 3120 */ {I_VFRCZSS, 1, {XMMREG,0,0,0,0}, nasm_bytecodes+12983, IF_AMD|IF_SSE5},
+    /* 3121 */ {I_VPCMOV, 4, {XMMREG,XMMREG,RM_XMM|BITS128,XMMREG,0}, nasm_bytecodes+5112, IF_AMD|IF_SSE5},
+    /* 3122 */ {I_VPCMOV, 3, {XMMREG,RM_XMM|BITS128,XMMREG,0,0}, nasm_bytecodes+5121, IF_AMD|IF_SSE5},
+    /* 3123 */ {I_VPCMOV, 4, {YMMREG,YMMREG,RM_YMM|BITS256,YMMREG,0}, nasm_bytecodes+5130, IF_AMD|IF_SSE5},
+    /* 3124 */ {I_VPCMOV, 3, {YMMREG,RM_YMM|BITS256,YMMREG,0,0}, nasm_bytecodes+5139, IF_AMD|IF_SSE5},
+    /* 3125 */ {I_VPCMOV, 4, {XMMREG,XMMREG,XMMREG,RM_XMM|BITS128,0}, nasm_bytecodes+5148, IF_AMD|IF_SSE5},
+    /* 3126 */ {I_VPCMOV, 3, {XMMREG,XMMREG,RM_XMM|BITS128,0,0}, nasm_bytecodes+5157, IF_AMD|IF_SSE5},
+    /* 3127 */ {I_VPCMOV, 4, {YMMREG,YMMREG,YMMREG,RM_YMM|BITS256,0}, nasm_bytecodes+5166, IF_AMD|IF_SSE5},
+    /* 3128 */ {I_VPCMOV, 3, {YMMREG,YMMREG,RM_YMM|BITS256,0,0}, nasm_bytecodes+5175, IF_AMD|IF_SSE5},
+    /* 3129 */ {I_VPCOMB, 4, {XMMREG,XMMREG,RM_XMM|BITS128,IMMEDIATE|BITS8,0}, nasm_bytecodes+7044, IF_AMD|IF_SSE5},
+    /* 3130 */ {I_VPCOMB, 3, {XMMREG,RM_XMM|BITS128,IMMEDIATE|BITS8,0,0}, nasm_bytecodes+7052, IF_AMD|IF_SSE5},
+    /* 3131 */ {I_VPCOMD, 4, {XMMREG,XMMREG,RM_XMM|BITS128,IMMEDIATE|BITS8,0}, nasm_bytecodes+7060, IF_AMD|IF_SSE5},
+    /* 3132 */ {I_VPCOMD, 3, {XMMREG,RM_XMM|BITS128,IMMEDIATE|BITS8,0,0}, nasm_bytecodes+7068, IF_AMD|IF_SSE5},
+    /* 3133 */ {I_VPCOMQ, 4, {XMMREG,XMMREG,RM_XMM|BITS128,IMMEDIATE|BITS8,0}, nasm_bytecodes+7076, IF_AMD|IF_SSE5},
+    /* 3134 */ {I_VPCOMQ, 3, {XMMREG,RM_XMM|BITS128,IMMEDIATE|BITS8,0,0}, nasm_bytecodes+7084, IF_AMD|IF_SSE5},
+    /* 3135 */ {I_VPCOMUB, 4, {XMMREG,XMMREG,RM_XMM|BITS128,IMMEDIATE|BITS8,0}, nasm_bytecodes+7092, IF_AMD|IF_SSE5},
+    /* 3136 */ {I_VPCOMUB, 3, {XMMREG,RM_XMM|BITS128,IMMEDIATE|BITS8,0,0}, nasm_bytecodes+7100, IF_AMD|IF_SSE5},
+    /* 3137 */ {I_VPCOMUD, 4, {XMMREG,XMMREG,RM_XMM|BITS128,IMMEDIATE|BITS8,0}, nasm_bytecodes+7108, IF_AMD|IF_SSE5},
+    /* 3138 */ {I_VPCOMUD, 3, {XMMREG,RM_XMM|BITS128,IMMEDIATE|BITS8,0,0}, nasm_bytecodes+7116, IF_AMD|IF_SSE5},
+    /* 3139 */ {I_VPCOMUQ, 4, {XMMREG,XMMREG,RM_XMM|BITS128,IMMEDIATE|BITS8,0}, nasm_bytecodes+7124, IF_AMD|IF_SSE5},
+    /* 3140 */ {I_VPCOMUQ, 3, {XMMREG,RM_XMM|BITS128,IMMEDIATE|BITS8,0,0}, nasm_bytecodes+7132, IF_AMD|IF_SSE5},
+    /* 3141 */ {I_VPCOMUW, 4, {XMMREG,XMMREG,RM_XMM|BITS128,IMMEDIATE|BITS8,0}, nasm_bytecodes+7140, IF_AMD|IF_SSE5},
+    /* 3142 */ {I_VPCOMUW, 3, {XMMREG,RM_XMM|BITS128,IMMEDIATE|BITS8,0,0}, nasm_bytecodes+7148, IF_AMD|IF_SSE5},
+    /* 3143 */ {I_VPCOMW, 4, {XMMREG,XMMREG,RM_XMM|BITS128,IMMEDIATE|BITS8,0}, nasm_bytecodes+7156, IF_AMD|IF_SSE5},
+    /* 3144 */ {I_VPCOMW, 3, {XMMREG,RM_XMM|BITS128,IMMEDIATE|BITS8,0,0}, nasm_bytecodes+7164, IF_AMD|IF_SSE5},
+    /* 3145 */ {I_VPHADDBD, 2, {XMMREG,RM_XMM|BITS128,0,0,0}, nasm_bytecodes+12990, IF_AMD|IF_SSE5},
+    /* 3146 */ {I_VPHADDBD, 1, {XMMREG,0,0,0,0}, nasm_bytecodes+12997, IF_AMD|IF_SSE5},
+    /* 3147 */ {I_VPHADDBQ, 2, {XMMREG,RM_XMM|BITS128,0,0,0}, nasm_bytecodes+13004, IF_AMD|IF_SSE5},
+    /* 3148 */ {I_VPHADDBQ, 1, {XMMREG,0,0,0,0}, nasm_bytecodes+13011, IF_AMD|IF_SSE5},
+    /* 3149 */ {I_VPHADDBW, 2, {XMMREG,RM_XMM|BITS128,0,0,0}, nasm_bytecodes+13018, IF_AMD|IF_SSE5},
+    /* 3150 */ {I_VPHADDBW, 1, {XMMREG,0,0,0,0}, nasm_bytecodes+13025, IF_AMD|IF_SSE5},
+    /* 3151 */ {I_VPHADDDQ, 2, {XMMREG,RM_XMM|BITS128,0,0,0}, nasm_bytecodes+13032, IF_AMD|IF_SSE5},
+    /* 3152 */ {I_VPHADDDQ, 1, {XMMREG,0,0,0,0}, nasm_bytecodes+13039, IF_AMD|IF_SSE5},
+    /* 3153 */ {I_VPHADDUBD, 2, {XMMREG,RM_XMM|BITS128,0,0,0}, nasm_bytecodes+13046, IF_AMD|IF_SSE5},
+    /* 3154 */ {I_VPHADDUBD, 1, {XMMREG,0,0,0,0}, nasm_bytecodes+13053, IF_AMD|IF_SSE5},
+    /* 3155 */ {I_VPHADDUBQ, 2, {XMMREG,RM_XMM|BITS128,0,0,0}, nasm_bytecodes+13060, IF_AMD|IF_SSE5},
+    /* 3156 */ {I_VPHADDUBQ, 1, {XMMREG,0,0,0,0}, nasm_bytecodes+13067, IF_AMD|IF_SSE5},
+    /* 3157 */ {I_VPHADDUBW, 2, {XMMREG,RM_XMM|BITS128,0,0,0}, nasm_bytecodes+13074, IF_AMD|IF_SSE5},
+    /* 3158 */ {I_VPHADDUBW, 1, {XMMREG,0,0,0,0}, nasm_bytecodes+13081, IF_AMD|IF_SSE5},
+    /* 3159 */ {I_VPHADDUDQ, 2, {XMMREG,RM_XMM|BITS128,0,0,0}, nasm_bytecodes+13088, IF_AMD|IF_SSE5},
+    /* 3160 */ {I_VPHADDUDQ, 1, {XMMREG,0,0,0,0}, nasm_bytecodes+13095, IF_AMD|IF_SSE5},
+    /* 3161 */ {I_VPHADDUWD, 2, {XMMREG,RM_XMM|BITS128,0,0,0}, nasm_bytecodes+13102, IF_AMD|IF_SSE5},
+    /* 3162 */ {I_VPHADDUWD, 1, {XMMREG,0,0,0,0}, nasm_bytecodes+13109, IF_AMD|IF_SSE5},
+    /* 3163 */ {I_VPHADDUWQ, 2, {XMMREG,RM_XMM|BITS128,0,0,0}, nasm_bytecodes+13116, IF_AMD|IF_SSE5},
+    /* 3164 */ {I_VPHADDUWQ, 1, {XMMREG,0,0,0,0}, nasm_bytecodes+13123, IF_AMD|IF_SSE5},
+    /* 3165 */ {I_VPHADDWD, 2, {XMMREG,RM_XMM|BITS128,0,0,0}, nasm_bytecodes+13130, IF_AMD|IF_SSE5},
+    /* 3166 */ {I_VPHADDWD, 1, {XMMREG,0,0,0,0}, nasm_bytecodes+13137, IF_AMD|IF_SSE5},
+    /* 3167 */ {I_VPHADDWQ, 2, {XMMREG,RM_XMM|BITS128,0,0,0}, nasm_bytecodes+13144, IF_AMD|IF_SSE5},
+    /* 3168 */ {I_VPHADDWQ, 1, {XMMREG,0,0,0,0}, nasm_bytecodes+13151, IF_AMD|IF_SSE5},
+    /* 3169 */ {I_VPHSUBBW, 2, {XMMREG,RM_XMM|BITS128,0,0,0}, nasm_bytecodes+13158, IF_AMD|IF_SSE5},
+    /* 3170 */ {I_VPHSUBBW, 1, {XMMREG,0,0,0,0}, nasm_bytecodes+13165, IF_AMD|IF_SSE5},
+    /* 3171 */ {I_VPHSUBDQ, 2, {XMMREG,RM_XMM|BITS128,0,0,0}, nasm_bytecodes+13172, IF_AMD|IF_SSE5},
+    /* 3172 */ {I_VPHSUBDQ, 1, {XMMREG,0,0,0,0}, nasm_bytecodes+13179, IF_AMD|IF_SSE5},
+    /* 3173 */ {I_VPHSUBWD, 2, {XMMREG,RM_XMM|BITS128,0,0,0}, nasm_bytecodes+13186, IF_AMD|IF_SSE5},
+    /* 3174 */ {I_VPHSUBWD, 1, {XMMREG,0,0,0,0}, nasm_bytecodes+13193, IF_AMD|IF_SSE5},
+    /* 3175 */ {I_VPMACSDD, 4, {XMMREG,XMMREG,RM_XMM|BITS128,XMMREG,0}, nasm_bytecodes+5184, IF_AMD|IF_SSE5},
+    /* 3176 */ {I_VPMACSDD, 3, {XMMREG,RM_XMM|BITS128,XMMREG,0,0}, nasm_bytecodes+5193, IF_AMD|IF_SSE5},
+    /* 3177 */ {I_VPMACSDQH, 4, {XMMREG,XMMREG,RM_XMM|BITS128,XMMREG,0}, nasm_bytecodes+5202, IF_AMD|IF_SSE5},
+    /* 3178 */ {I_VPMACSDQH, 3, {XMMREG,RM_XMM|BITS128,XMMREG,0,0}, nasm_bytecodes+5211, IF_AMD|IF_SSE5},
+    /* 3179 */ {I_VPMACSDQL, 4, {XMMREG,XMMREG,RM_XMM|BITS128,XMMREG,0}, nasm_bytecodes+5220, IF_AMD|IF_SSE5},
+    /* 3180 */ {I_VPMACSDQL, 3, {XMMREG,RM_XMM|BITS128,XMMREG,0,0}, nasm_bytecodes+5229, IF_AMD|IF_SSE5},
+    /* 3181 */ {I_VPMACSSDD, 4, {XMMREG,XMMREG,RM_XMM|BITS128,XMMREG,0}, nasm_bytecodes+5238, IF_AMD|IF_SSE5},
+    /* 3182 */ {I_VPMACSSDD, 3, {XMMREG,RM_XMM|BITS128,XMMREG,0,0}, nasm_bytecodes+5247, IF_AMD|IF_SSE5},
+    /* 3183 */ {I_VPMACSSDQH, 4, {XMMREG,XMMREG,RM_XMM|BITS128,XMMREG,0}, nasm_bytecodes+5256, IF_AMD|IF_SSE5},
+    /* 3184 */ {I_VPMACSSDQH, 3, {XMMREG,RM_XMM|BITS128,XMMREG,0,0}, nasm_bytecodes+5265, IF_AMD|IF_SSE5},
+    /* 3185 */ {I_VPMACSSDQL, 4, {XMMREG,XMMREG,RM_XMM|BITS128,XMMREG,0}, nasm_bytecodes+5274, IF_AMD|IF_SSE5},
+    /* 3186 */ {I_VPMACSSDQL, 3, {XMMREG,RM_XMM|BITS128,XMMREG,0,0}, nasm_bytecodes+5283, IF_AMD|IF_SSE5},
+    /* 3187 */ {I_VPMACSSWD, 4, {XMMREG,XMMREG,RM_XMM|BITS128,XMMREG,0}, nasm_bytecodes+5292, IF_AMD|IF_SSE5},
+    /* 3188 */ {I_VPMACSSWD, 3, {XMMREG,RM_XMM|BITS128,XMMREG,0,0}, nasm_bytecodes+5301, IF_AMD|IF_SSE5},
+    /* 3189 */ {I_VPMACSSWW, 4, {XMMREG,XMMREG,RM_XMM|BITS128,XMMREG,0}, nasm_bytecodes+5310, IF_AMD|IF_SSE5},
+    /* 3190 */ {I_VPMACSSWW, 3, {XMMREG,RM_XMM|BITS128,XMMREG,0,0}, nasm_bytecodes+5319, IF_AMD|IF_SSE5},
+    /* 3191 */ {I_VPMACSWD, 4, {XMMREG,XMMREG,RM_XMM|BITS128,XMMREG,0}, nasm_bytecodes+5328, IF_AMD|IF_SSE5},
+    /* 3192 */ {I_VPMACSWD, 3, {XMMREG,RM_XMM|BITS128,XMMREG,0,0}, nasm_bytecodes+5337, IF_AMD|IF_SSE5},
+    /* 3193 */ {I_VPMACSWW, 4, {XMMREG,XMMREG,RM_XMM|BITS128,XMMREG,0}, nasm_bytecodes+5346, IF_AMD|IF_SSE5},
+    /* 3194 */ {I_VPMACSWW, 3, {XMMREG,RM_XMM|BITS128,XMMREG,0,0}, nasm_bytecodes+5355, IF_AMD|IF_SSE5},
+    /* 3195 */ {I_VPMADCSSWD, 4, {XMMREG,XMMREG,RM_XMM|BITS128,XMMREG,0}, nasm_bytecodes+5364, IF_AMD|IF_SSE5},
+    /* 3196 */ {I_VPMADCSSWD, 3, {XMMREG,RM_XMM|BITS128,XMMREG,0,0}, nasm_bytecodes+5373, IF_AMD|IF_SSE5},
+    /* 3197 */ {I_VPMADCSWD, 4, {XMMREG,XMMREG,RM_XMM|BITS128,XMMREG,0}, nasm_bytecodes+5382, IF_AMD|IF_SSE5},
+    /* 3198 */ {I_VPMADCSWD, 3, {XMMREG,RM_XMM|BITS128,XMMREG,0,0}, nasm_bytecodes+5391, IF_AMD|IF_SSE5},
+    /* 3199 */ {I_VPPERM, 4, {XMMREG,XMMREG,XMMREG,RM_XMM|BITS128,0}, nasm_bytecodes+5400, IF_AMD|IF_SSE5},
+    /* 3200 */ {I_VPPERM, 3, {XMMREG,XMMREG,RM_XMM|BITS128,0,0}, nasm_bytecodes+5409, IF_AMD|IF_SSE5},
+    /* 3201 */ {I_VPPERM, 4, {XMMREG,XMMREG,RM_XMM|BITS128,XMMREG,0}, nasm_bytecodes+5418, IF_AMD|IF_SSE5},
+    /* 3202 */ {I_VPPERM, 3, {XMMREG,RM_XMM|BITS128,XMMREG,0,0}, nasm_bytecodes+5427, IF_AMD|IF_SSE5},
+    /* 3203 */ {I_VPROTB, 3, {XMMREG,RM_XMM|BITS128,XMMREG,0,0}, nasm_bytecodes+13200, IF_AMD|IF_SSE5},
+    /* 3204 */ {I_VPROTB, 2, {XMMREG,XMMREG,0,0,0}, nasm_bytecodes+13207, IF_AMD|IF_SSE5},
+    /* 3205 */ {I_VPROTB, 3, {XMMREG,XMMREG,RM_XMM|BITS128,0,0}, nasm_bytecodes+13214, IF_AMD|IF_SSE5},
+    /* 3206 */ {I_VPROTB, 2, {XMMREG,RM_XMM|BITS128,0,0,0}, nasm_bytecodes+13221, IF_AMD|IF_SSE5},
+    /* 3207 */ {I_VPROTB, 3, {XMMREG,RM_XMM|BITS128,IMMEDIATE|BITS8,0,0}, nasm_bytecodes+7172, IF_AMD|IF_SSE5},
+    /* 3208 */ {I_VPROTB, 2, {XMMREG,IMMEDIATE|BITS8,0,0,0}, nasm_bytecodes+7180, IF_AMD|IF_SSE5},
+    /* 3209 */ {I_VPROTD, 3, {XMMREG,RM_XMM|BITS128,XMMREG,0,0}, nasm_bytecodes+13228, IF_AMD|IF_SSE5},
+    /* 3210 */ {I_VPROTD, 2, {XMMREG,XMMREG,0,0,0}, nasm_bytecodes+13235, IF_AMD|IF_SSE5},
+    /* 3211 */ {I_VPROTD, 3, {XMMREG,XMMREG,RM_XMM|BITS128,0,0}, nasm_bytecodes+13242, IF_AMD|IF_SSE5},
+    /* 3212 */ {I_VPROTD, 2, {XMMREG,RM_XMM|BITS128,0,0,0}, nasm_bytecodes+13249, IF_AMD|IF_SSE5},
+    /* 3213 */ {I_VPROTD, 3, {XMMREG,RM_XMM|BITS128,IMMEDIATE|BITS8,0,0}, nasm_bytecodes+7188, IF_AMD|IF_SSE5},
+    /* 3214 */ {I_VPROTD, 2, {XMMREG,IMMEDIATE|BITS8,0,0,0}, nasm_bytecodes+7196, IF_AMD|IF_SSE5},
+    /* 3215 */ {I_VPROTQ, 3, {XMMREG,RM_XMM|BITS128,XMMREG,0,0}, nasm_bytecodes+13256, IF_AMD|IF_SSE5},
+    /* 3216 */ {I_VPROTQ, 2, {XMMREG,XMMREG,0,0,0}, nasm_bytecodes+13263, IF_AMD|IF_SSE5},
+    /* 3217 */ {I_VPROTQ, 3, {XMMREG,XMMREG,RM_XMM|BITS128,0,0}, nasm_bytecodes+13270, IF_AMD|IF_SSE5},
+    /* 3218 */ {I_VPROTQ, 2, {XMMREG,RM_XMM|BITS128,0,0,0}, nasm_bytecodes+13277, IF_AMD|IF_SSE5},
+    /* 3219 */ {I_VPROTQ, 3, {XMMREG,RM_XMM|BITS128,IMMEDIATE|BITS8,0,0}, nasm_bytecodes+7204, IF_AMD|IF_SSE5},
+    /* 3220 */ {I_VPROTQ, 2, {XMMREG,IMMEDIATE|BITS8,0,0,0}, nasm_bytecodes+7212, IF_AMD|IF_SSE5},
+    /* 3221 */ {I_VPROTW, 3, {XMMREG,RM_XMM|BITS128,XMMREG,0,0}, nasm_bytecodes+13284, IF_AMD|IF_SSE5},
+    /* 3222 */ {I_VPROTW, 2, {XMMREG,XMMREG,0,0,0}, nasm_bytecodes+13291, IF_AMD|IF_SSE5},
+    /* 3223 */ {I_VPROTW, 3, {XMMREG,XMMREG,RM_XMM|BITS128,0,0}, nasm_bytecodes+13298, IF_AMD|IF_SSE5},
+    /* 3224 */ {I_VPROTW, 2, {XMMREG,RM_XMM|BITS128,0,0,0}, nasm_bytecodes+13305, IF_AMD|IF_SSE5},
+    /* 3225 */ {I_VPROTW, 3, {XMMREG,RM_XMM|BITS128,IMMEDIATE|BITS8,0,0}, nasm_bytecodes+7220, IF_AMD|IF_SSE5},
+    /* 3226 */ {I_VPROTW, 2, {XMMREG,IMMEDIATE|BITS8,0,0,0}, nasm_bytecodes+7228, IF_AMD|IF_SSE5},
+    /* 3227 */ {I_VPSHAB, 3, {XMMREG,RM_XMM|BITS128,XMMREG,0,0}, nasm_bytecodes+13312, IF_AMD|IF_SSE5},
+    /* 3228 */ {I_VPSHAB, 2, {XMMREG,XMMREG,0,0,0}, nasm_bytecodes+13319, IF_AMD|IF_SSE5},
+    /* 3229 */ {I_VPSHAB, 3, {XMMREG,XMMREG,RM_XMM|BITS128,0,0}, nasm_bytecodes+13326, IF_AMD|IF_SSE5},
+    /* 3230 */ {I_VPSHAB, 2, {XMMREG,RM_XMM|BITS128,0,0,0}, nasm_bytecodes+13333, IF_AMD|IF_SSE5},
+    /* 3231 */ {I_VPSHAD, 3, {XMMREG,RM_XMM|BITS128,XMMREG,0,0}, nasm_bytecodes+13340, IF_AMD|IF_SSE5},
+    /* 3232 */ {I_VPSHAD, 2, {XMMREG,XMMREG,0,0,0}, nasm_bytecodes+13347, IF_AMD|IF_SSE5},
+    /* 3233 */ {I_VPSHAD, 3, {XMMREG,XMMREG,RM_XMM|BITS128,0,0}, nasm_bytecodes+13354, IF_AMD|IF_SSE5},
+    /* 3234 */ {I_VPSHAD, 2, {XMMREG,RM_XMM|BITS128,0,0,0}, nasm_bytecodes+13361, IF_AMD|IF_SSE5},
+    /* 3235 */ {I_VPSHAQ, 3, {XMMREG,RM_XMM|BITS128,XMMREG,0,0}, nasm_bytecodes+13368, IF_AMD|IF_SSE5},
+    /* 3236 */ {I_VPSHAQ, 2, {XMMREG,XMMREG,0,0,0}, nasm_bytecodes+13375, IF_AMD|IF_SSE5},
+    /* 3237 */ {I_VPSHAQ, 3, {XMMREG,XMMREG,RM_XMM|BITS128,0,0}, nasm_bytecodes+13382, IF_AMD|IF_SSE5},
+    /* 3238 */ {I_VPSHAQ, 2, {XMMREG,RM_XMM|BITS128,0,0,0}, nasm_bytecodes+13389, IF_AMD|IF_SSE5},
+    /* 3239 */ {I_VPSHAW, 3, {XMMREG,RM_XMM|BITS128,XMMREG,0,0}, nasm_bytecodes+13396, IF_AMD|IF_SSE5},
+    /* 3240 */ {I_VPSHAW, 2, {XMMREG,XMMREG,0,0,0}, nasm_bytecodes+13403, IF_AMD|IF_SSE5},
+    /* 3241 */ {I_VPSHAW, 3, {XMMREG,XMMREG,RM_XMM|BITS128,0,0}, nasm_bytecodes+13410, IF_AMD|IF_SSE5},
+    /* 3242 */ {I_VPSHAW, 2, {XMMREG,RM_XMM|BITS128,0,0,0}, nasm_bytecodes+13417, IF_AMD|IF_SSE5},
+    /* 3243 */ {I_VPSHLB, 3, {XMMREG,RM_XMM|BITS128,XMMREG,0,0}, nasm_bytecodes+13424, IF_AMD|IF_SSE5},
+    /* 3244 */ {I_VPSHLB, 2, {XMMREG,XMMREG,0,0,0}, nasm_bytecodes+13431, IF_AMD|IF_SSE5},
+    /* 3245 */ {I_VPSHLB, 3, {XMMREG,XMMREG,RM_XMM|BITS128,0,0}, nasm_bytecodes+13438, IF_AMD|IF_SSE5},
+    /* 3246 */ {I_VPSHLB, 2, {XMMREG,RM_XMM|BITS128,0,0,0}, nasm_bytecodes+13445, IF_AMD|IF_SSE5},
+    /* 3247 */ {I_VPSHLD, 3, {XMMREG,RM_XMM|BITS128,XMMREG,0,0}, nasm_bytecodes+13452, IF_AMD|IF_SSE5},
+    /* 3248 */ {I_VPSHLD, 2, {XMMREG,XMMREG,0,0,0}, nasm_bytecodes+13459, IF_AMD|IF_SSE5},
+    /* 3249 */ {I_VPSHLD, 3, {XMMREG,XMMREG,RM_XMM|BITS128,0,0}, nasm_bytecodes+13466, IF_AMD|IF_SSE5},
+    /* 3250 */ {I_VPSHLD, 2, {XMMREG,RM_XMM|BITS128,0,0,0}, nasm_bytecodes+13473, IF_AMD|IF_SSE5},
+    /* 3251 */ {I_VPSHLQ, 3, {XMMREG,RM_XMM|BITS128,XMMREG,0,0}, nasm_bytecodes+13480, IF_AMD|IF_SSE5},
+    /* 3252 */ {I_VPSHLQ, 2, {XMMREG,XMMREG,0,0,0}, nasm_bytecodes+13487, IF_AMD|IF_SSE5},
+    /* 3253 */ {I_VPSHLQ, 3, {XMMREG,XMMREG,RM_XMM|BITS128,0,0}, nasm_bytecodes+13494, IF_AMD|IF_SSE5},
+    /* 3254 */ {I_VPSHLQ, 2, {XMMREG,RM_XMM|BITS128,0,0,0}, nasm_bytecodes+13501, IF_AMD|IF_SSE5},
+    /* 3255 */ {I_VPSHLW, 3, {XMMREG,RM_XMM|BITS128,XMMREG,0,0}, nasm_bytecodes+13508, IF_AMD|IF_SSE5},
+    /* 3256 */ {I_VPSHLW, 2, {XMMREG,XMMREG,0,0,0}, nasm_bytecodes+13515, IF_AMD|IF_SSE5},
+    /* 3257 */ {I_VPSHLW, 3, {XMMREG,XMMREG,RM_XMM|BITS128,0,0}, nasm_bytecodes+13522, IF_AMD|IF_SSE5},
+    /* 3258 */ {I_VPSHLW, 2, {XMMREG,RM_XMM|BITS128,0,0,0}, nasm_bytecodes+13529, IF_AMD|IF_SSE5},
+    /* 3259 */ {I_HINT_NOP0, 1, {RM_GPR|BITS16,0,0,0,0}, nasm_bytecodes+15900, IF_P6|IF_UNDOC},
+    /* 3260 */ {I_HINT_NOP0, 1, {RM_GPR|BITS32,0,0,0,0}, nasm_bytecodes+15906, IF_P6|IF_UNDOC},
+    /* 3261 */ {I_HINT_NOP0, 1, {RM_GPR|BITS64,0,0,0,0}, nasm_bytecodes+15912, IF_X64|IF_UNDOC},
+    /* 3262 */ {I_HINT_NOP1, 1, {RM_GPR|BITS16,0,0,0,0}, nasm_bytecodes+15918, IF_P6|IF_UNDOC},
+    /* 3263 */ {I_HINT_NOP1, 1, {RM_GPR|BITS32,0,0,0,0}, nasm_bytecodes+15924, IF_P6|IF_UNDOC},
+    /* 3264 */ {I_HINT_NOP1, 1, {RM_GPR|BITS64,0,0,0,0}, nasm_bytecodes+15930, IF_X64|IF_UNDOC},
+    /* 3265 */ {I_HINT_NOP2, 1, {RM_GPR|BITS16,0,0,0,0}, nasm_bytecodes+15936, IF_P6|IF_UNDOC},
+    /* 3266 */ {I_HINT_NOP2, 1, {RM_GPR|BITS32,0,0,0,0}, nasm_bytecodes+15942, IF_P6|IF_UNDOC},
+    /* 3267 */ {I_HINT_NOP2, 1, {RM_GPR|BITS64,0,0,0,0}, nasm_bytecodes+15948, IF_X64|IF_UNDOC},
+    /* 3268 */ {I_HINT_NOP3, 1, {RM_GPR|BITS16,0,0,0,0}, nasm_bytecodes+15954, IF_P6|IF_UNDOC},
+    /* 3269 */ {I_HINT_NOP3, 1, {RM_GPR|BITS32,0,0,0,0}, nasm_bytecodes+15960, IF_P6|IF_UNDOC},
+    /* 3270 */ {I_HINT_NOP3, 1, {RM_GPR|BITS64,0,0,0,0}, nasm_bytecodes+15966, IF_X64|IF_UNDOC},
+    /* 3271 */ {I_HINT_NOP4, 1, {RM_GPR|BITS16,0,0,0,0}, nasm_bytecodes+15972, IF_P6|IF_UNDOC},
+    /* 3272 */ {I_HINT_NOP4, 1, {RM_GPR|BITS32,0,0,0,0}, nasm_bytecodes+15978, IF_P6|IF_UNDOC},
+    /* 3273 */ {I_HINT_NOP4, 1, {RM_GPR|BITS64,0,0,0,0}, nasm_bytecodes+15984, IF_X64|IF_UNDOC},
+    /* 3274 */ {I_HINT_NOP5, 1, {RM_GPR|BITS16,0,0,0,0}, nasm_bytecodes+15990, IF_P6|IF_UNDOC},
+    /* 3275 */ {I_HINT_NOP5, 1, {RM_GPR|BITS32,0,0,0,0}, nasm_bytecodes+15996, IF_P6|IF_UNDOC},
+    /* 3276 */ {I_HINT_NOP5, 1, {RM_GPR|BITS64,0,0,0,0}, nasm_bytecodes+16002, IF_X64|IF_UNDOC},
+    /* 3277 */ {I_HINT_NOP6, 1, {RM_GPR|BITS16,0,0,0,0}, nasm_bytecodes+16008, IF_P6|IF_UNDOC},
+    /* 3278 */ {I_HINT_NOP6, 1, {RM_GPR|BITS32,0,0,0,0}, nasm_bytecodes+16014, IF_P6|IF_UNDOC},
+    /* 3279 */ {I_HINT_NOP6, 1, {RM_GPR|BITS64,0,0,0,0}, nasm_bytecodes+16020, IF_X64|IF_UNDOC},
+    /* 3280 */ {I_HINT_NOP7, 1, {RM_GPR|BITS16,0,0,0,0}, nasm_bytecodes+16026, IF_P6|IF_UNDOC},
+    /* 3281 */ {I_HINT_NOP7, 1, {RM_GPR|BITS32,0,0,0,0}, nasm_bytecodes+16032, IF_P6|IF_UNDOC},
+    /* 3282 */ {I_HINT_NOP7, 1, {RM_GPR|BITS64,0,0,0,0}, nasm_bytecodes+16038, IF_X64|IF_UNDOC},
+    /* 3283 */ {I_HINT_NOP8, 1, {RM_GPR|BITS16,0,0,0,0}, nasm_bytecodes+16044, IF_P6|IF_UNDOC},
+    /* 3284 */ {I_HINT_NOP8, 1, {RM_GPR|BITS32,0,0,0,0}, nasm_bytecodes+16050, IF_P6|IF_UNDOC},
+    /* 3285 */ {I_HINT_NOP8, 1, {RM_GPR|BITS64,0,0,0,0}, nasm_bytecodes+16056, IF_X64|IF_UNDOC},
+    /* 3286 */ {I_HINT_NOP9, 1, {RM_GPR|BITS16,0,0,0,0}, nasm_bytecodes+16062, IF_P6|IF_UNDOC},
+    /* 3287 */ {I_HINT_NOP9, 1, {RM_GPR|BITS32,0,0,0,0}, nasm_bytecodes+16068, IF_P6|IF_UNDOC},
+    /* 3288 */ {I_HINT_NOP9, 1, {RM_GPR|BITS64,0,0,0,0}, nasm_bytecodes+16074, IF_X64|IF_UNDOC},
+    /* 3289 */ {I_HINT_NOP10, 1, {RM_GPR|BITS16,0,0,0,0}, nasm_bytecodes+16080, IF_P6|IF_UNDOC},
+    /* 3290 */ {I_HINT_NOP10, 1, {RM_GPR|BITS32,0,0,0,0}, nasm_bytecodes+16086, IF_P6|IF_UNDOC},
+    /* 3291 */ {I_HINT_NOP10, 1, {RM_GPR|BITS64,0,0,0,0}, nasm_bytecodes+16092, IF_X64|IF_UNDOC},
+    /* 3292 */ {I_HINT_NOP11, 1, {RM_GPR|BITS16,0,0,0,0}, nasm_bytecodes+16098, IF_P6|IF_UNDOC},
+    /* 3293 */ {I_HINT_NOP11, 1, {RM_GPR|BITS32,0,0,0,0}, nasm_bytecodes+16104, IF_P6|IF_UNDOC},
+    /* 3294 */ {I_HINT_NOP11, 1, {RM_GPR|BITS64,0,0,0,0}, nasm_bytecodes+16110, IF_X64|IF_UNDOC},
+    /* 3295 */ {I_HINT_NOP12, 1, {RM_GPR|BITS16,0,0,0,0}, nasm_bytecodes+16116, IF_P6|IF_UNDOC},
+    /* 3296 */ {I_HINT_NOP12, 1, {RM_GPR|BITS32,0,0,0,0}, nasm_bytecodes+16122, IF_P6|IF_UNDOC},
+    /* 3297 */ {I_HINT_NOP12, 1, {RM_GPR|BITS64,0,0,0,0}, nasm_bytecodes+16128, IF_X64|IF_UNDOC},
+    /* 3298 */ {I_HINT_NOP13, 1, {RM_GPR|BITS16,0,0,0,0}, nasm_bytecodes+16134, IF_P6|IF_UNDOC},
+    /* 3299 */ {I_HINT_NOP13, 1, {RM_GPR|BITS32,0,0,0,0}, nasm_bytecodes+16140, IF_P6|IF_UNDOC},
+    /* 3300 */ {I_HINT_NOP13, 1, {RM_GPR|BITS64,0,0,0,0}, nasm_bytecodes+16146, IF_X64|IF_UNDOC},
+    /* 3301 */ {I_HINT_NOP14, 1, {RM_GPR|BITS16,0,0,0,0}, nasm_bytecodes+16152, IF_P6|IF_UNDOC},
+    /* 3302 */ {I_HINT_NOP14, 1, {RM_GPR|BITS32,0,0,0,0}, nasm_bytecodes+16158, IF_P6|IF_UNDOC},
+    /* 3303 */ {I_HINT_NOP14, 1, {RM_GPR|BITS64,0,0,0,0}, nasm_bytecodes+16164, IF_X64|IF_UNDOC},
+    /* 3304 */ {I_HINT_NOP15, 1, {RM_GPR|BITS16,0,0,0,0}, nasm_bytecodes+16170, IF_P6|IF_UNDOC},
+    /* 3305 */ {I_HINT_NOP15, 1, {RM_GPR|BITS32,0,0,0,0}, nasm_bytecodes+16176, IF_P6|IF_UNDOC},
+    /* 3306 */ {I_HINT_NOP15, 1, {RM_GPR|BITS64,0,0,0,0}, nasm_bytecodes+16182, IF_X64|IF_UNDOC},
+    /* 3307 */ {I_HINT_NOP16, 1, {RM_GPR|BITS16,0,0,0,0}, nasm_bytecodes+16188, IF_P6|IF_UNDOC},
+    /* 3308 */ {I_HINT_NOP16, 1, {RM_GPR|BITS32,0,0,0,0}, nasm_bytecodes+16194, IF_P6|IF_UNDOC},
+    /* 3309 */ {I_HINT_NOP16, 1, {RM_GPR|BITS64,0,0,0,0}, nasm_bytecodes+16200, IF_X64|IF_UNDOC},
+    /* 3310 */ {I_HINT_NOP17, 1, {RM_GPR|BITS16,0,0,0,0}, nasm_bytecodes+16206, IF_P6|IF_UNDOC},
+    /* 3311 */ {I_HINT_NOP17, 1, {RM_GPR|BITS32,0,0,0,0}, nasm_bytecodes+16212, IF_P6|IF_UNDOC},
+    /* 3312 */ {I_HINT_NOP17, 1, {RM_GPR|BITS64,0,0,0,0}, nasm_bytecodes+16218, IF_X64|IF_UNDOC},
+    /* 3313 */ {I_HINT_NOP18, 1, {RM_GPR|BITS16,0,0,0,0}, nasm_bytecodes+16224, IF_P6|IF_UNDOC},
+    /* 3314 */ {I_HINT_NOP18, 1, {RM_GPR|BITS32,0,0,0,0}, nasm_bytecodes+16230, IF_P6|IF_UNDOC},
+    /* 3315 */ {I_HINT_NOP18, 1, {RM_GPR|BITS64,0,0,0,0}, nasm_bytecodes+16236, IF_X64|IF_UNDOC},
+    /* 3316 */ {I_HINT_NOP19, 1, {RM_GPR|BITS16,0,0,0,0}, nasm_bytecodes+16242, IF_P6|IF_UNDOC},
+    /* 3317 */ {I_HINT_NOP19, 1, {RM_GPR|BITS32,0,0,0,0}, nasm_bytecodes+16248, IF_P6|IF_UNDOC},
+    /* 3318 */ {I_HINT_NOP19, 1, {RM_GPR|BITS64,0,0,0,0}, nasm_bytecodes+16254, IF_X64|IF_UNDOC},
+    /* 3319 */ {I_HINT_NOP20, 1, {RM_GPR|BITS16,0,0,0,0}, nasm_bytecodes+16260, IF_P6|IF_UNDOC},
+    /* 3320 */ {I_HINT_NOP20, 1, {RM_GPR|BITS32,0,0,0,0}, nasm_bytecodes+16266, IF_P6|IF_UNDOC},
+    /* 3321 */ {I_HINT_NOP20, 1, {RM_GPR|BITS64,0,0,0,0}, nasm_bytecodes+16272, IF_X64|IF_UNDOC},
+    /* 3322 */ {I_HINT_NOP21, 1, {RM_GPR|BITS16,0,0,0,0}, nasm_bytecodes+16278, IF_P6|IF_UNDOC},
+    /* 3323 */ {I_HINT_NOP21, 1, {RM_GPR|BITS32,0,0,0,0}, nasm_bytecodes+16284, IF_P6|IF_UNDOC},
+    /* 3324 */ {I_HINT_NOP21, 1, {RM_GPR|BITS64,0,0,0,0}, nasm_bytecodes+16290, IF_X64|IF_UNDOC},
+    /* 3325 */ {I_HINT_NOP22, 1, {RM_GPR|BITS16,0,0,0,0}, nasm_bytecodes+16296, IF_P6|IF_UNDOC},
+    /* 3326 */ {I_HINT_NOP22, 1, {RM_GPR|BITS32,0,0,0,0}, nasm_bytecodes+16302, IF_P6|IF_UNDOC},
+    /* 3327 */ {I_HINT_NOP22, 1, {RM_GPR|BITS64,0,0,0,0}, nasm_bytecodes+16308, IF_X64|IF_UNDOC},
+    /* 3328 */ {I_HINT_NOP23, 1, {RM_GPR|BITS16,0,0,0,0}, nasm_bytecodes+16314, IF_P6|IF_UNDOC},
+    /* 3329 */ {I_HINT_NOP23, 1, {RM_GPR|BITS32,0,0,0,0}, nasm_bytecodes+16320, IF_P6|IF_UNDOC},
+    /* 3330 */ {I_HINT_NOP23, 1, {RM_GPR|BITS64,0,0,0,0}, nasm_bytecodes+16326, IF_X64|IF_UNDOC},
+    /* 3331 */ {I_HINT_NOP24, 1, {RM_GPR|BITS16,0,0,0,0}, nasm_bytecodes+16332, IF_P6|IF_UNDOC},
+    /* 3332 */ {I_HINT_NOP24, 1, {RM_GPR|BITS32,0,0,0,0}, nasm_bytecodes+16338, IF_P6|IF_UNDOC},
+    /* 3333 */ {I_HINT_NOP24, 1, {RM_GPR|BITS64,0,0,0,0}, nasm_bytecodes+16344, IF_X64|IF_UNDOC},
+    /* 3334 */ {I_HINT_NOP25, 1, {RM_GPR|BITS16,0,0,0,0}, nasm_bytecodes+16350, IF_P6|IF_UNDOC},
+    /* 3335 */ {I_HINT_NOP25, 1, {RM_GPR|BITS32,0,0,0,0}, nasm_bytecodes+16356, IF_P6|IF_UNDOC},
+    /* 3336 */ {I_HINT_NOP25, 1, {RM_GPR|BITS64,0,0,0,0}, nasm_bytecodes+16362, IF_X64|IF_UNDOC},
+    /* 3337 */ {I_HINT_NOP26, 1, {RM_GPR|BITS16,0,0,0,0}, nasm_bytecodes+16368, IF_P6|IF_UNDOC},
+    /* 3338 */ {I_HINT_NOP26, 1, {RM_GPR|BITS32,0,0,0,0}, nasm_bytecodes+16374, IF_P6|IF_UNDOC},
+    /* 3339 */ {I_HINT_NOP26, 1, {RM_GPR|BITS64,0,0,0,0}, nasm_bytecodes+16380, IF_X64|IF_UNDOC},
+    /* 3340 */ {I_HINT_NOP27, 1, {RM_GPR|BITS16,0,0,0,0}, nasm_bytecodes+16386, IF_P6|IF_UNDOC},
+    /* 3341 */ {I_HINT_NOP27, 1, {RM_GPR|BITS32,0,0,0,0}, nasm_bytecodes+16392, IF_P6|IF_UNDOC},
+    /* 3342 */ {I_HINT_NOP27, 1, {RM_GPR|BITS64,0,0,0,0}, nasm_bytecodes+16398, IF_X64|IF_UNDOC},
+    /* 3343 */ {I_HINT_NOP28, 1, {RM_GPR|BITS16,0,0,0,0}, nasm_bytecodes+16404, IF_P6|IF_UNDOC},
+    /* 3344 */ {I_HINT_NOP28, 1, {RM_GPR|BITS32,0,0,0,0}, nasm_bytecodes+16410, IF_P6|IF_UNDOC},
+    /* 3345 */ {I_HINT_NOP28, 1, {RM_GPR|BITS64,0,0,0,0}, nasm_bytecodes+16416, IF_X64|IF_UNDOC},
+    /* 3346 */ {I_HINT_NOP29, 1, {RM_GPR|BITS16,0,0,0,0}, nasm_bytecodes+16422, IF_P6|IF_UNDOC},
+    /* 3347 */ {I_HINT_NOP29, 1, {RM_GPR|BITS32,0,0,0,0}, nasm_bytecodes+16428, IF_P6|IF_UNDOC},
+    /* 3348 */ {I_HINT_NOP29, 1, {RM_GPR|BITS64,0,0,0,0}, nasm_bytecodes+16434, IF_X64|IF_UNDOC},
+    /* 3349 */ {I_HINT_NOP30, 1, {RM_GPR|BITS16,0,0,0,0}, nasm_bytecodes+16440, IF_P6|IF_UNDOC},
+    /* 3350 */ {I_HINT_NOP30, 1, {RM_GPR|BITS32,0,0,0,0}, nasm_bytecodes+16446, IF_P6|IF_UNDOC},
+    /* 3351 */ {I_HINT_NOP30, 1, {RM_GPR|BITS64,0,0,0,0}, nasm_bytecodes+16452, IF_X64|IF_UNDOC},
+    /* 3352 */ {I_HINT_NOP31, 1, {RM_GPR|BITS16,0,0,0,0}, nasm_bytecodes+16458, IF_P6|IF_UNDOC},
+    /* 3353 */ {I_HINT_NOP31, 1, {RM_GPR|BITS32,0,0,0,0}, nasm_bytecodes+16464, IF_P6|IF_UNDOC},
+    /* 3354 */ {I_HINT_NOP31, 1, {RM_GPR|BITS64,0,0,0,0}, nasm_bytecodes+16470, IF_X64|IF_UNDOC},
+    /* 3355 */ {I_HINT_NOP32, 1, {RM_GPR|BITS16,0,0,0,0}, nasm_bytecodes+16476, IF_P6|IF_UNDOC},
+    /* 3356 */ {I_HINT_NOP32, 1, {RM_GPR|BITS32,0,0,0,0}, nasm_bytecodes+16482, IF_P6|IF_UNDOC},
+    /* 3357 */ {I_HINT_NOP32, 1, {RM_GPR|BITS64,0,0,0,0}, nasm_bytecodes+16488, IF_X64|IF_UNDOC},
+    /* 3358 */ {I_HINT_NOP33, 1, {RM_GPR|BITS16,0,0,0,0}, nasm_bytecodes+16494, IF_P6|IF_UNDOC},
+    /* 3359 */ {I_HINT_NOP33, 1, {RM_GPR|BITS32,0,0,0,0}, nasm_bytecodes+16500, IF_P6|IF_UNDOC},
+    /* 3360 */ {I_HINT_NOP33, 1, {RM_GPR|BITS64,0,0,0,0}, nasm_bytecodes+16506, IF_X64|IF_UNDOC},
+    /* 3361 */ {I_HINT_NOP34, 1, {RM_GPR|BITS16,0,0,0,0}, nasm_bytecodes+16512, IF_P6|IF_UNDOC},
+    /* 3362 */ {I_HINT_NOP34, 1, {RM_GPR|BITS32,0,0,0,0}, nasm_bytecodes+16518, IF_P6|IF_UNDOC},
+    /* 3363 */ {I_HINT_NOP34, 1, {RM_GPR|BITS64,0,0,0,0}, nasm_bytecodes+16524, IF_X64|IF_UNDOC},
+    /* 3364 */ {I_HINT_NOP35, 1, {RM_GPR|BITS16,0,0,0,0}, nasm_bytecodes+16530, IF_P6|IF_UNDOC},
+    /* 3365 */ {I_HINT_NOP35, 1, {RM_GPR|BITS32,0,0,0,0}, nasm_bytecodes+16536, IF_P6|IF_UNDOC},
+    /* 3366 */ {I_HINT_NOP35, 1, {RM_GPR|BITS64,0,0,0,0}, nasm_bytecodes+16542, IF_X64|IF_UNDOC},
+    /* 3367 */ {I_HINT_NOP36, 1, {RM_GPR|BITS16,0,0,0,0}, nasm_bytecodes+16548, IF_P6|IF_UNDOC},
+    /* 3368 */ {I_HINT_NOP36, 1, {RM_GPR|BITS32,0,0,0,0}, nasm_bytecodes+16554, IF_P6|IF_UNDOC},
+    /* 3369 */ {I_HINT_NOP36, 1, {RM_GPR|BITS64,0,0,0,0}, nasm_bytecodes+16560, IF_X64|IF_UNDOC},
+    /* 3370 */ {I_HINT_NOP37, 1, {RM_GPR|BITS16,0,0,0,0}, nasm_bytecodes+16566, IF_P6|IF_UNDOC},
+    /* 3371 */ {I_HINT_NOP37, 1, {RM_GPR|BITS32,0,0,0,0}, nasm_bytecodes+16572, IF_P6|IF_UNDOC},
+    /* 3372 */ {I_HINT_NOP37, 1, {RM_GPR|BITS64,0,0,0,0}, nasm_bytecodes+16578, IF_X64|IF_UNDOC},
+    /* 3373 */ {I_HINT_NOP38, 1, {RM_GPR|BITS16,0,0,0,0}, nasm_bytecodes+16584, IF_P6|IF_UNDOC},
+    /* 3374 */ {I_HINT_NOP38, 1, {RM_GPR|BITS32,0,0,0,0}, nasm_bytecodes+16590, IF_P6|IF_UNDOC},
+    /* 3375 */ {I_HINT_NOP38, 1, {RM_GPR|BITS64,0,0,0,0}, nasm_bytecodes+16596, IF_X64|IF_UNDOC},
+    /* 3376 */ {I_HINT_NOP39, 1, {RM_GPR|BITS16,0,0,0,0}, nasm_bytecodes+16602, IF_P6|IF_UNDOC},
+    /* 3377 */ {I_HINT_NOP39, 1, {RM_GPR|BITS32,0,0,0,0}, nasm_bytecodes+16608, IF_P6|IF_UNDOC},
+    /* 3378 */ {I_HINT_NOP39, 1, {RM_GPR|BITS64,0,0,0,0}, nasm_bytecodes+16614, IF_X64|IF_UNDOC},
+    /* 3379 */ {I_HINT_NOP40, 1, {RM_GPR|BITS16,0,0,0,0}, nasm_bytecodes+16620, IF_P6|IF_UNDOC},
+    /* 3380 */ {I_HINT_NOP40, 1, {RM_GPR|BITS32,0,0,0,0}, nasm_bytecodes+16626, IF_P6|IF_UNDOC},
+    /* 3381 */ {I_HINT_NOP40, 1, {RM_GPR|BITS64,0,0,0,0}, nasm_bytecodes+16632, IF_X64|IF_UNDOC},
+    /* 3382 */ {I_HINT_NOP41, 1, {RM_GPR|BITS16,0,0,0,0}, nasm_bytecodes+16638, IF_P6|IF_UNDOC},
+    /* 3383 */ {I_HINT_NOP41, 1, {RM_GPR|BITS32,0,0,0,0}, nasm_bytecodes+16644, IF_P6|IF_UNDOC},
+    /* 3384 */ {I_HINT_NOP41, 1, {RM_GPR|BITS64,0,0,0,0}, nasm_bytecodes+16650, IF_X64|IF_UNDOC},
+    /* 3385 */ {I_HINT_NOP42, 1, {RM_GPR|BITS16,0,0,0,0}, nasm_bytecodes+16656, IF_P6|IF_UNDOC},
+    /* 3386 */ {I_HINT_NOP42, 1, {RM_GPR|BITS32,0,0,0,0}, nasm_bytecodes+16662, IF_P6|IF_UNDOC},
+    /* 3387 */ {I_HINT_NOP42, 1, {RM_GPR|BITS64,0,0,0,0}, nasm_bytecodes+16668, IF_X64|IF_UNDOC},
+    /* 3388 */ {I_HINT_NOP43, 1, {RM_GPR|BITS16,0,0,0,0}, nasm_bytecodes+16674, IF_P6|IF_UNDOC},
+    /* 3389 */ {I_HINT_NOP43, 1, {RM_GPR|BITS32,0,0,0,0}, nasm_bytecodes+16680, IF_P6|IF_UNDOC},
+    /* 3390 */ {I_HINT_NOP43, 1, {RM_GPR|BITS64,0,0,0,0}, nasm_bytecodes+16686, IF_X64|IF_UNDOC},
+    /* 3391 */ {I_HINT_NOP44, 1, {RM_GPR|BITS16,0,0,0,0}, nasm_bytecodes+16692, IF_P6|IF_UNDOC},
+    /* 3392 */ {I_HINT_NOP44, 1, {RM_GPR|BITS32,0,0,0,0}, nasm_bytecodes+16698, IF_P6|IF_UNDOC},
+    /* 3393 */ {I_HINT_NOP44, 1, {RM_GPR|BITS64,0,0,0,0}, nasm_bytecodes+16704, IF_X64|IF_UNDOC},
+    /* 3394 */ {I_HINT_NOP45, 1, {RM_GPR|BITS16,0,0,0,0}, nasm_bytecodes+16710, IF_P6|IF_UNDOC},
+    /* 3395 */ {I_HINT_NOP45, 1, {RM_GPR|BITS32,0,0,0,0}, nasm_bytecodes+16716, IF_P6|IF_UNDOC},
+    /* 3396 */ {I_HINT_NOP45, 1, {RM_GPR|BITS64,0,0,0,0}, nasm_bytecodes+16722, IF_X64|IF_UNDOC},
+    /* 3397 */ {I_HINT_NOP46, 1, {RM_GPR|BITS16,0,0,0,0}, nasm_bytecodes+16728, IF_P6|IF_UNDOC},
+    /* 3398 */ {I_HINT_NOP46, 1, {RM_GPR|BITS32,0,0,0,0}, nasm_bytecodes+16734, IF_P6|IF_UNDOC},
+    /* 3399 */ {I_HINT_NOP46, 1, {RM_GPR|BITS64,0,0,0,0}, nasm_bytecodes+16740, IF_X64|IF_UNDOC},
+    /* 3400 */ {I_HINT_NOP47, 1, {RM_GPR|BITS16,0,0,0,0}, nasm_bytecodes+16746, IF_P6|IF_UNDOC},
+    /* 3401 */ {I_HINT_NOP47, 1, {RM_GPR|BITS32,0,0,0,0}, nasm_bytecodes+16752, IF_P6|IF_UNDOC},
+    /* 3402 */ {I_HINT_NOP47, 1, {RM_GPR|BITS64,0,0,0,0}, nasm_bytecodes+16758, IF_X64|IF_UNDOC},
+    /* 3403 */ {I_HINT_NOP48, 1, {RM_GPR|BITS16,0,0,0,0}, nasm_bytecodes+16764, IF_P6|IF_UNDOC},
+    /* 3404 */ {I_HINT_NOP48, 1, {RM_GPR|BITS32,0,0,0,0}, nasm_bytecodes+16770, IF_P6|IF_UNDOC},
+    /* 3405 */ {I_HINT_NOP48, 1, {RM_GPR|BITS64,0,0,0,0}, nasm_bytecodes+16776, IF_X64|IF_UNDOC},
+    /* 3406 */ {I_HINT_NOP49, 1, {RM_GPR|BITS16,0,0,0,0}, nasm_bytecodes+16782, IF_P6|IF_UNDOC},
+    /* 3407 */ {I_HINT_NOP49, 1, {RM_GPR|BITS32,0,0,0,0}, nasm_bytecodes+16788, IF_P6|IF_UNDOC},
+    /* 3408 */ {I_HINT_NOP49, 1, {RM_GPR|BITS64,0,0,0,0}, nasm_bytecodes+16794, IF_X64|IF_UNDOC},
+    /* 3409 */ {I_HINT_NOP50, 1, {RM_GPR|BITS16,0,0,0,0}, nasm_bytecodes+16800, IF_P6|IF_UNDOC},
+    /* 3410 */ {I_HINT_NOP50, 1, {RM_GPR|BITS32,0,0,0,0}, nasm_bytecodes+16806, IF_P6|IF_UNDOC},
+    /* 3411 */ {I_HINT_NOP50, 1, {RM_GPR|BITS64,0,0,0,0}, nasm_bytecodes+16812, IF_X64|IF_UNDOC},
+    /* 3412 */ {I_HINT_NOP51, 1, {RM_GPR|BITS16,0,0,0,0}, nasm_bytecodes+16818, IF_P6|IF_UNDOC},
+    /* 3413 */ {I_HINT_NOP51, 1, {RM_GPR|BITS32,0,0,0,0}, nasm_bytecodes+16824, IF_P6|IF_UNDOC},
+    /* 3414 */ {I_HINT_NOP51, 1, {RM_GPR|BITS64,0,0,0,0}, nasm_bytecodes+16830, IF_X64|IF_UNDOC},
+    /* 3415 */ {I_HINT_NOP52, 1, {RM_GPR|BITS16,0,0,0,0}, nasm_bytecodes+16836, IF_P6|IF_UNDOC},
+    /* 3416 */ {I_HINT_NOP52, 1, {RM_GPR|BITS32,0,0,0,0}, nasm_bytecodes+16842, IF_P6|IF_UNDOC},
+    /* 3417 */ {I_HINT_NOP52, 1, {RM_GPR|BITS64,0,0,0,0}, nasm_bytecodes+16848, IF_X64|IF_UNDOC},
+    /* 3418 */ {I_HINT_NOP53, 1, {RM_GPR|BITS16,0,0,0,0}, nasm_bytecodes+16854, IF_P6|IF_UNDOC},
+    /* 3419 */ {I_HINT_NOP53, 1, {RM_GPR|BITS32,0,0,0,0}, nasm_bytecodes+16860, IF_P6|IF_UNDOC},
+    /* 3420 */ {I_HINT_NOP53, 1, {RM_GPR|BITS64,0,0,0,0}, nasm_bytecodes+16866, IF_X64|IF_UNDOC},
+    /* 3421 */ {I_HINT_NOP54, 1, {RM_GPR|BITS16,0,0,0,0}, nasm_bytecodes+16872, IF_P6|IF_UNDOC},
+    /* 3422 */ {I_HINT_NOP54, 1, {RM_GPR|BITS32,0,0,0,0}, nasm_bytecodes+16878, IF_P6|IF_UNDOC},
+    /* 3423 */ {I_HINT_NOP54, 1, {RM_GPR|BITS64,0,0,0,0}, nasm_bytecodes+16884, IF_X64|IF_UNDOC},
+    /* 3424 */ {I_HINT_NOP55, 1, {RM_GPR|BITS16,0,0,0,0}, nasm_bytecodes+16890, IF_P6|IF_UNDOC},
+    /* 3425 */ {I_HINT_NOP55, 1, {RM_GPR|BITS32,0,0,0,0}, nasm_bytecodes+16896, IF_P6|IF_UNDOC},
+    /* 3426 */ {I_HINT_NOP55, 1, {RM_GPR|BITS64,0,0,0,0}, nasm_bytecodes+16902, IF_X64|IF_UNDOC},
+    /* 3427 */ {I_HINT_NOP56, 1, {RM_GPR|BITS16,0,0,0,0}, nasm_bytecodes+14274, IF_P6|IF_UNDOC},
+    /* 3428 */ {I_HINT_NOP56, 1, {RM_GPR|BITS32,0,0,0,0}, nasm_bytecodes+14280, IF_P6|IF_UNDOC},
+    /* 3429 */ {I_HINT_NOP56, 1, {RM_GPR|BITS64,0,0,0,0}, nasm_bytecodes+14286, IF_X64|IF_UNDOC},
+    /* 3430 */ {I_HINT_NOP57, 1, {RM_GPR|BITS16,0,0,0,0}, nasm_bytecodes+16908, IF_P6|IF_UNDOC},
+    /* 3431 */ {I_HINT_NOP57, 1, {RM_GPR|BITS32,0,0,0,0}, nasm_bytecodes+16914, IF_P6|IF_UNDOC},
+    /* 3432 */ {I_HINT_NOP57, 1, {RM_GPR|BITS64,0,0,0,0}, nasm_bytecodes+16920, IF_X64|IF_UNDOC},
+    /* 3433 */ {I_HINT_NOP58, 1, {RM_GPR|BITS16,0,0,0,0}, nasm_bytecodes+16926, IF_P6|IF_UNDOC},
+    /* 3434 */ {I_HINT_NOP58, 1, {RM_GPR|BITS32,0,0,0,0}, nasm_bytecodes+16932, IF_P6|IF_UNDOC},
+    /* 3435 */ {I_HINT_NOP58, 1, {RM_GPR|BITS64,0,0,0,0}, nasm_bytecodes+16938, IF_X64|IF_UNDOC},
+    /* 3436 */ {I_HINT_NOP59, 1, {RM_GPR|BITS16,0,0,0,0}, nasm_bytecodes+16944, IF_P6|IF_UNDOC},
+    /* 3437 */ {I_HINT_NOP59, 1, {RM_GPR|BITS32,0,0,0,0}, nasm_bytecodes+16950, IF_P6|IF_UNDOC},
+    /* 3438 */ {I_HINT_NOP59, 1, {RM_GPR|BITS64,0,0,0,0}, nasm_bytecodes+16956, IF_X64|IF_UNDOC},
+    /* 3439 */ {I_HINT_NOP60, 1, {RM_GPR|BITS16,0,0,0,0}, nasm_bytecodes+16962, IF_P6|IF_UNDOC},
+    /* 3440 */ {I_HINT_NOP60, 1, {RM_GPR|BITS32,0,0,0,0}, nasm_bytecodes+16968, IF_P6|IF_UNDOC},
+    /* 3441 */ {I_HINT_NOP60, 1, {RM_GPR|BITS64,0,0,0,0}, nasm_bytecodes+16974, IF_X64|IF_UNDOC},
+    /* 3442 */ {I_HINT_NOP61, 1, {RM_GPR|BITS16,0,0,0,0}, nasm_bytecodes+16980, IF_P6|IF_UNDOC},
+    /* 3443 */ {I_HINT_NOP61, 1, {RM_GPR|BITS32,0,0,0,0}, nasm_bytecodes+16986, IF_P6|IF_UNDOC},
+    /* 3444 */ {I_HINT_NOP61, 1, {RM_GPR|BITS64,0,0,0,0}, nasm_bytecodes+16992, IF_X64|IF_UNDOC},
+    /* 3445 */ {I_HINT_NOP62, 1, {RM_GPR|BITS16,0,0,0,0}, nasm_bytecodes+16998, IF_P6|IF_UNDOC},
+    /* 3446 */ {I_HINT_NOP62, 1, {RM_GPR|BITS32,0,0,0,0}, nasm_bytecodes+17004, IF_P6|IF_UNDOC},
+    /* 3447 */ {I_HINT_NOP62, 1, {RM_GPR|BITS64,0,0,0,0}, nasm_bytecodes+17010, IF_X64|IF_UNDOC},
+    /* 3448 */ {I_HINT_NOP63, 1, {RM_GPR|BITS16,0,0,0,0}, nasm_bytecodes+17016, IF_P6|IF_UNDOC},
+    /* 3449 */ {I_HINT_NOP63, 1, {RM_GPR|BITS32,0,0,0,0}, nasm_bytecodes+17022, IF_P6|IF_UNDOC},
+    /* 3450 */ {I_HINT_NOP63, 1, {RM_GPR|BITS64,0,0,0,0}, nasm_bytecodes+17028, IF_X64|IF_UNDOC},
+};
+
+static const struct itemplate * const itable_00[] = {
+    instrux + 40,
+    instrux + 41,
+};
+
+static const struct itemplate * const itable_01[] = {
+    instrux + 42,
+    instrux + 43,
+    instrux + 44,
+    instrux + 45,
+    instrux + 46,
+    instrux + 47,
+};
+
+static const struct itemplate * const itable_02[] = {
+    instrux + 48,
+    instrux + 49,
+};
+
+static const struct itemplate * const itable_03[] = {
+    instrux + 50,
+    instrux + 51,
+    instrux + 52,
+    instrux + 53,
+    instrux + 54,
+    instrux + 55,
+};
+
+static const struct itemplate * const itable_04[] = {
+    instrux + 59,
+};
+
+static const struct itemplate * const itable_05[] = {
+    instrux + 61,
+    instrux + 63,
+    instrux + 65,
+};
+
+static const struct itemplate * const itable_06[] = {
+    instrux + 866,
+    instrux + 867,
+};
+
+static const struct itemplate * const itable_07[] = {
+    instrux + 818,
+};
+
+static const struct itemplate * const itable_08[] = {
+    instrux + 718,
+    instrux + 719,
+};
+
+static const struct itemplate * const itable_09[] = {
+    instrux + 720,
+    instrux + 721,
+    instrux + 722,
+    instrux + 723,
+    instrux + 724,
+    instrux + 725,
+};
+
+static const struct itemplate * const itable_0A[] = {
+    instrux + 726,
+    instrux + 727,
+};
+
+static const struct itemplate * const itable_0B[] = {
+    instrux + 728,
+    instrux + 729,
+    instrux + 730,
+    instrux + 731,
+    instrux + 732,
+    instrux + 733,
+};
+
+static const struct itemplate * const itable_0C[] = {
+    instrux + 737,
+};
+
+static const struct itemplate * const itable_0D[] = {
+    instrux + 739,
+    instrux + 741,
+    instrux + 743,
+};
+
+static const struct itemplate * const itable_0E[] = {
+    instrux + 866,
+    instrux + 867,
+};
+
+static const struct itemplate * const itable_0F00[] = {
+    instrux + 545,
+    instrux + 546,
+    instrux + 573,
+    instrux + 574,
+    instrux + 575,
+    instrux + 617,
+    instrux + 618,
+    instrux + 619,
+    instrux + 1047,
+    instrux + 1048,
+    instrux + 1049,
+    instrux + 1050,
+    instrux + 1051,
+    instrux + 1066,
+    instrux + 1067,
+    instrux + 1068,
+    instrux + 1069,
+    instrux + 1070,
+    instrux + 1137,
+    instrux + 1138,
+    instrux + 1139,
+    instrux + 1140,
+    instrux + 1141,
+    instrux + 1142,
+};
+
+static const struct itemplate * const itable_0F01[] = {
+    instrux + 192,
+    instrux + 505,
+    instrux + 506,
+    instrux + 507,
+    instrux + 508,
+    instrux + 509,
+    instrux + 569,
+    instrux + 572,
+    instrux + 576,
+    instrux + 577,
+    instrux + 578,
+    instrux + 621,
+    instrux + 705,
+    instrux + 910,
+    instrux + 997,
+    instrux + 1046,
+    instrux + 1052,
+    instrux + 1054,
+    instrux + 1055,
+    instrux + 1056,
+    instrux + 1057,
+    instrux + 1060,
+    instrux + 1106,
+    instrux + 1309,
+    instrux + 1310,
+    instrux + 1541,
+    instrux + 1543,
+    instrux + 1544,
+    instrux + 1545,
+    instrux + 1550,
+    instrux + 1551,
+    instrux + 1552,
+    instrux + 1555,
+};
+
+static const struct itemplate * const itable_0F02[] = {
+    instrux + 548,
+    instrux + 549,
+    instrux + 550,
+    instrux + 551,
+    instrux + 552,
+    instrux + 553,
+    instrux + 554,
+    instrux + 555,
+    instrux + 556,
+    instrux + 557,
+};
+
+static const struct itemplate * const itable_0F03[] = {
+    instrux + 605,
+    instrux + 606,
+    instrux + 607,
+    instrux + 608,
+    instrux + 609,
+    instrux + 610,
+    instrux + 611,
+    instrux + 612,
+    instrux + 613,
+    instrux + 614,
+};
+
+static const struct itemplate * const itable_0F05[] = {
+    instrux + 580,
+    instrux + 1107,
+};
+
+static const struct itemplate * const itable_0F06[] = {
+    instrux + 194,
+};
+
+static const struct itemplate * const itable_0F07[] = {
+    instrux + 579,
+    instrux + 1110,
+};
+
+static const struct itemplate * const itable_0F08[] = {
+    instrux + 504,
+};
+
+static const struct itemplate * const itable_0F09[] = {
+    instrux + 1144,
+};
+
+static const struct itemplate * const itable_0F0B[] = {
+    instrux + 1136,
+};
+
+static const struct itemplate * const itable_0F0D[] = {
+    instrux + 828,
+    instrux + 829,
+};
+
+static const struct itemplate * const itable_0F0E[] = {
+    instrux + 330,
+};
+
+static const struct itemplate * const itable_0F0F[] = {
+    instrux + 775,
+    instrux + 783,
+    instrux + 784,
+    instrux + 785,
+    instrux + 786,
+    instrux + 787,
+    instrux + 788,
+    instrux + 789,
+    instrux + 790,
+    instrux + 791,
+    instrux + 792,
+    instrux + 793,
+    instrux + 794,
+    instrux + 795,
+    instrux + 796,
+    instrux + 797,
+    instrux + 798,
+    instrux + 799,
+    instrux + 804,
+    instrux + 1334,
+    instrux + 1335,
+    instrux + 1336,
+    instrux + 1337,
+    instrux + 1338,
+    instrux + 1674,
+    instrux + 1675,
+};
+
+static const struct itemplate * const itable_0F10[] = {
+    instrux + 1281,
+    instrux + 1283,
+    instrux + 1285,
+    instrux + 1287,
+    instrux + 1510,
+    instrux + 1513,
+    instrux + 1514,
+    instrux + 1517,
+};
+
+static const struct itemplate * const itable_0F11[] = {
+    instrux + 1282,
+    instrux + 1284,
+    instrux + 1286,
+    instrux + 1288,
+    instrux + 1511,
+    instrux + 1512,
+    instrux + 1515,
+    instrux + 1516,
+};
+
+static const struct itemplate * const itable_0F12[] = {
+    instrux + 1275,
+    instrux + 1277,
+    instrux + 1507,
+    instrux + 1538,
+    instrux + 1540,
+};
+
+static const struct itemplate * const itable_0F13[] = {
+    instrux + 1276,
+    instrux + 1506,
+};
+
+static const struct itemplate * const itable_0F14[] = {
+    instrux + 1305,
+    instrux + 1529,
+};
+
+static const struct itemplate * const itable_0F15[] = {
+    instrux + 1304,
+    instrux + 1528,
+};
+
+static const struct itemplate * const itable_0F16[] = {
+    instrux + 1272,
+    instrux + 1274,
+    instrux + 1505,
+    instrux + 1539,
+};
+
+static const struct itemplate * const itable_0F17[] = {
+    instrux + 1273,
+    instrux + 1504,
+};
+
+static const struct itemplate * const itable_0F18[] = {
+    instrux + 1313,
+    instrux + 1314,
+    instrux + 1315,
+    instrux + 1316,
+    instrux + 3259,
+    instrux + 3260,
+    instrux + 3261,
+    instrux + 3262,
+    instrux + 3263,
+    instrux + 3264,
+    instrux + 3265,
+    instrux + 3266,
+    instrux + 3267,
+    instrux + 3268,
+    instrux + 3269,
+    instrux + 3270,
+    instrux + 3271,
+    instrux + 3272,
+    instrux + 3273,
+    instrux + 3274,
+    instrux + 3275,
+    instrux + 3276,
+    instrux + 3277,
+    instrux + 3278,
+    instrux + 3279,
+    instrux + 3280,
+    instrux + 3281,
+    instrux + 3282,
+};
+
+static const struct itemplate * const itable_0F19[] = {
+    instrux + 3283,
+    instrux + 3284,
+    instrux + 3285,
+    instrux + 3286,
+    instrux + 3287,
+    instrux + 3288,
+    instrux + 3289,
+    instrux + 3290,
+    instrux + 3291,
+    instrux + 3292,
+    instrux + 3293,
+    instrux + 3294,
+    instrux + 3295,
+    instrux + 3296,
+    instrux + 3297,
+    instrux + 3298,
+    instrux + 3299,
+    instrux + 3300,
+    instrux + 3301,
+    instrux + 3302,
+    instrux + 3303,
+    instrux + 3304,
+    instrux + 3305,
+    instrux + 3306,
+};
+
+static const struct itemplate * const itable_0F1A[] = {
+    instrux + 3307,
+    instrux + 3308,
+    instrux + 3309,
+    instrux + 3310,
+    instrux + 3311,
+    instrux + 3312,
+    instrux + 3313,
+    instrux + 3314,
+    instrux + 3315,
+    instrux + 3316,
+    instrux + 3317,
+    instrux + 3318,
+    instrux + 3319,
+    instrux + 3320,
+    instrux + 3321,
+    instrux + 3322,
+    instrux + 3323,
+    instrux + 3324,
+    instrux + 3325,
+    instrux + 3326,
+    instrux + 3327,
+    instrux + 3328,
+    instrux + 3329,
+    instrux + 3330,
+};
+
+static const struct itemplate * const itable_0F1B[] = {
+    instrux + 3331,
+    instrux + 3332,
+    instrux + 3333,
+    instrux + 3334,
+    instrux + 3335,
+    instrux + 3336,
+    instrux + 3337,
+    instrux + 3338,
+    instrux + 3339,
+    instrux + 3340,
+    instrux + 3341,
+    instrux + 3342,
+    instrux + 3343,
+    instrux + 3344,
+    instrux + 3345,
+    instrux + 3346,
+    instrux + 3347,
+    instrux + 3348,
+    instrux + 3349,
+    instrux + 3350,
+    instrux + 3351,
+    instrux + 3352,
+    instrux + 3353,
+    instrux + 3354,
+};
+
+static const struct itemplate * const itable_0F1C[] = {
+    instrux + 3355,
+    instrux + 3356,
+    instrux + 3357,
+    instrux + 3358,
+    instrux + 3359,
+    instrux + 3360,
+    instrux + 3361,
+    instrux + 3362,
+    instrux + 3363,
+    instrux + 3364,
+    instrux + 3365,
+    instrux + 3366,
+    instrux + 3367,
+    instrux + 3368,
+    instrux + 3369,
+    instrux + 3370,
+    instrux + 3371,
+    instrux + 3372,
+    instrux + 3373,
+    instrux + 3374,
+    instrux + 3375,
+    instrux + 3376,
+    instrux + 3377,
+    instrux + 3378,
+};
+
+static const struct itemplate * const itable_0F1D[] = {
+    instrux + 3379,
+    instrux + 3380,
+    instrux + 3381,
+    instrux + 3382,
+    instrux + 3383,
+    instrux + 3384,
+    instrux + 3385,
+    instrux + 3386,
+    instrux + 3387,
+    instrux + 3388,
+    instrux + 3389,
+    instrux + 3390,
+    instrux + 3391,
+    instrux + 3392,
+    instrux + 3393,
+    instrux + 3394,
+    instrux + 3395,
+    instrux + 3396,
+    instrux + 3397,
+    instrux + 3398,
+    instrux + 3399,
+    instrux + 3400,
+    instrux + 3401,
+    instrux + 3402,
+};
+
+static const struct itemplate * const itable_0F1E[] = {
+    instrux + 3403,
+    instrux + 3404,
+    instrux + 3405,
+    instrux + 3406,
+    instrux + 3407,
+    instrux + 3408,
+    instrux + 3409,
+    instrux + 3410,
+    instrux + 3411,
+    instrux + 3412,
+    instrux + 3413,
+    instrux + 3414,
+    instrux + 3415,
+    instrux + 3416,
+    instrux + 3417,
+    instrux + 3418,
+    instrux + 3419,
+    instrux + 3420,
+    instrux + 3421,
+    instrux + 3422,
+    instrux + 3423,
+    instrux + 3424,
+    instrux + 3425,
+    instrux + 3426,
+};
+
+static const struct itemplate * const itable_0F1F[] = {
+    instrux + 711,
+    instrux + 712,
+    instrux + 713,
+    instrux + 3427,
+    instrux + 3428,
+    instrux + 3429,
+    instrux + 3430,
+    instrux + 3431,
+    instrux + 3432,
+    instrux + 3433,
+    instrux + 3434,
+    instrux + 3435,
+    instrux + 3436,
+    instrux + 3437,
+    instrux + 3438,
+    instrux + 3439,
+    instrux + 3440,
+    instrux + 3441,
+    instrux + 3442,
+    instrux + 3443,
+    instrux + 3444,
+    instrux + 3445,
+    instrux + 3446,
+    instrux + 3447,
+    instrux + 3448,
+    instrux + 3449,
+    instrux + 3450,
+};
+
+static const struct itemplate * const itable_0F20[] = {
+    instrux + 636,
+    instrux + 637,
+};
+
+static const struct itemplate * const itable_0F21[] = {
+    instrux + 640,
+    instrux + 641,
+};
+
+static const struct itemplate * const itable_0F22[] = {
+    instrux + 638,
+    instrux + 639,
+};
+
+static const struct itemplate * const itable_0F23[] = {
+    instrux + 642,
+    instrux + 643,
+};
+
+static const struct itemplate * const itable_0F28[] = {
+    instrux + 1268,
+    instrux + 1270,
+    instrux + 1500,
+    instrux + 1503,
+};
+
+static const struct itemplate * const itable_0F29[] = {
+    instrux + 1269,
+    instrux + 1271,
+    instrux + 1501,
+    instrux + 1502,
+};
+
+static const struct itemplate * const itable_0F2A[] = {
+    instrux + 1250,
+    instrux + 1252,
+    instrux + 1253,
+    instrux + 1476,
+    instrux + 1484,
+    instrux + 1485,
+};
+
+static const struct itemplate * const itable_0F2B[] = {
+    instrux + 1280,
+    instrux + 1344,
+    instrux + 1597,
+    instrux + 1598,
+};
+
+static const struct itemplate * const itable_0F2C[] = {
+    instrux + 1258,
+    instrux + 1259,
+    instrux + 1260,
+    instrux + 1487,
+    instrux + 1490,
+    instrux + 1491,
+    instrux + 1492,
+    instrux + 1493,
+};
+
+static const struct itemplate * const itable_0F2D[] = {
+    instrux + 1251,
+    instrux + 1254,
+    instrux + 1255,
+    instrux + 1256,
+    instrux + 1257,
+    instrux + 1474,
+    instrux + 1479,
+    instrux + 1480,
+    instrux + 1481,
+    instrux + 1482,
+};
+
+static const struct itemplate * const itable_0F2E[] = {
+    instrux + 1303,
+    instrux + 1527,
+};
+
+static const struct itemplate * const itable_0F2F[] = {
+    instrux + 1249,
+    instrux + 1470,
+};
+
+static const struct itemplate * const itable_0F30[] = {
+    instrux + 1146,
+};
+
+static const struct itemplate * const itable_0F31[] = {
+    instrux + 909,
+};
+
+static const struct itemplate * const itable_0F32[] = {
+    instrux + 907,
+};
+
+static const struct itemplate * const itable_0F33[] = {
+    instrux + 908,
+};
+
+static const struct itemplate * const itable_0F34[] = {
+    instrux + 1108,
+};
+
+static const struct itemplate * const itable_0F35[] = {
+    instrux + 1109,
+};
+
+static const struct itemplate * const itable_0F36[] = {
+    instrux + 906,
+};
+
+static const struct itemplate * const itable_0F37[] = {
+    instrux + 1145,
+    instrux + 1673,
+};
+
+static const struct itemplate * const itable_0F3800[] = {
+    instrux + 1585,
+    instrux + 1586,
+};
+
+static const struct itemplate * const itable_0F3801[] = {
+    instrux + 1569,
+    instrux + 1570,
+};
+
+static const struct itemplate * const itable_0F3802[] = {
+    instrux + 1571,
+    instrux + 1572,
+};
+
+static const struct itemplate * const itable_0F3803[] = {
+    instrux + 1573,
+    instrux + 1574,
+};
+
+static const struct itemplate * const itable_0F3804[] = {
+    instrux + 1581,
+    instrux + 1582,
+};
+
+static const struct itemplate * const itable_0F3805[] = {
+    instrux + 1575,
+    instrux + 1576,
+};
+
+static const struct itemplate * const itable_0F3806[] = {
+    instrux + 1577,
+    instrux + 1578,
+};
+
+static const struct itemplate * const itable_0F3807[] = {
+    instrux + 1579,
+    instrux + 1580,
+};
+
+static const struct itemplate * const itable_0F3808[] = {
+    instrux + 1587,
+    instrux + 1588,
+};
+
+static const struct itemplate * const itable_0F3809[] = {
+    instrux + 1589,
+    instrux + 1590,
+};
+
+static const struct itemplate * const itable_0F380A[] = {
+    instrux + 1591,
+    instrux + 1592,
+};
+
+static const struct itemplate * const itable_0F380B[] = {
+    instrux + 1583,
+    instrux + 1584,
+};
+
+static const struct itemplate * const itable_0F3810[] = {
+    instrux + 1614,
+};
+
+static const struct itemplate * const itable_0F3814[] = {
+    instrux + 1605,
+};
+
+static const struct itemplate * const itable_0F3815[] = {
+    instrux + 1604,
+};
+
+static const struct itemplate * const itable_0F3817[] = {
+    instrux + 1655,
+};
+
+static const struct itemplate * const itable_0F381C[] = {
+    instrux + 1561,
+    instrux + 1562,
+};
+
+static const struct itemplate * const itable_0F381D[] = {
+    instrux + 1563,
+    instrux + 1564,
+};
+
+static const struct itemplate * const itable_0F381E[] = {
+    instrux + 1565,
+    instrux + 1566,
+};
+
+static const struct itemplate * const itable_0F3820[] = {
+    instrux + 1641,
+};
+
+static const struct itemplate * const itable_0F3821[] = {
+    instrux + 1642,
+};
+
+static const struct itemplate * const itable_0F3822[] = {
+    instrux + 1643,
+};
+
+static const struct itemplate * const itable_0F3823[] = {
+    instrux + 1644,
+};
+
+static const struct itemplate * const itable_0F3824[] = {
+    instrux + 1645,
+};
+
+static const struct itemplate * const itable_0F3825[] = {
+    instrux + 1646,
+};
+
+static const struct itemplate * const itable_0F3828[] = {
+    instrux + 1653,
+};
+
+static const struct itemplate * const itable_0F3829[] = {
+    instrux + 1616,
+};
+
+static const struct itemplate * const itable_0F382A[] = {
+    instrux + 1611,
+};
+
+static const struct itemplate * const itable_0F382B[] = {
+    instrux + 1613,
+};
+
+static const struct itemplate * const itable_0F3830[] = {
+    instrux + 1647,
+};
+
+static const struct itemplate * const itable_0F3831[] = {
+    instrux + 1648,
+};
+
+static const struct itemplate * const itable_0F3832[] = {
+    instrux + 1649,
+};
+
+static const struct itemplate * const itable_0F3833[] = {
+    instrux + 1650,
+};
+
+static const struct itemplate * const itable_0F3834[] = {
+    instrux + 1651,
+};
+
+static const struct itemplate * const itable_0F3835[] = {
+    instrux + 1652,
+};
+
+static const struct itemplate * const itable_0F3837[] = {
+    instrux + 1669,
+};
+
+static const struct itemplate * const itable_0F3838[] = {
+    instrux + 1637,
+};
+
+static const struct itemplate * const itable_0F3839[] = {
+    instrux + 1638,
+};
+
+static const struct itemplate * const itable_0F383A[] = {
+    instrux + 1640,
+};
+
+static const struct itemplate * const itable_0F383B[] = {
+    instrux + 1639,
+};
+
+static const struct itemplate * const itable_0F383C[] = {
+    instrux + 1633,
+};
+
+static const struct itemplate * const itable_0F383D[] = {
+    instrux + 1634,
+};
+
+static const struct itemplate * const itable_0F383E[] = {
+    instrux + 1636,
+};
+
+static const struct itemplate * const itable_0F383F[] = {
+    instrux + 1635,
+};
+
+static const struct itemplate * const itable_0F3840[] = {
+    instrux + 1654,
+};
+
+static const struct itemplate * const itable_0F3841[] = {
+    instrux + 1625,
+};
+
+static const struct itemplate * const itable_0F3880[] = {
+    instrux + 1557,
+    instrux + 1558,
+};
+
+static const struct itemplate * const itable_0F3881[] = {
+    instrux + 1559,
+    instrux + 1560,
+};
+
+static const struct itemplate * const itable_0F38DB[] = {
+    instrux + 1686,
+};
+
+static const struct itemplate * const itable_0F38DC[] = {
+    instrux + 1682,
+};
+
+static const struct itemplate * const itable_0F38DD[] = {
+    instrux + 1683,
+};
+
+static const struct itemplate * const itable_0F38DE[] = {
+    instrux + 1684,
+};
+
+static const struct itemplate * const itable_0F38DF[] = {
+    instrux + 1685,
+};
+
+static const struct itemplate * const itable_0F38F0[] = {
+    instrux + 1660,
+    instrux + 1663,
+    instrux + 1676,
+    instrux + 1677,
+    instrux + 1678,
+};
+
+static const struct itemplate * const itable_0F38F1[] = {
+    instrux + 1661,
+    instrux + 1662,
+    instrux + 1664,
+    instrux + 1679,
+    instrux + 1680,
+    instrux + 1681,
+};
+
+static const struct itemplate * const itable_0F39[] = {
+    instrux + 261,
+};
+
+static const struct itemplate * const itable_0F3A08[] = {
+    instrux + 1657,
+};
+
+static const struct itemplate * const itable_0F3A09[] = {
+    instrux + 1656,
+};
+
+static const struct itemplate * const itable_0F3A0A[] = {
+    instrux + 1659,
+};
+
+static const struct itemplate * const itable_0F3A0B[] = {
+    instrux + 1658,
+};
+
+static const struct itemplate * const itable_0F3A0C[] = {
+    instrux + 1603,
+};
+
+static const struct itemplate * const itable_0F3A0D[] = {
+    instrux + 1602,
+};
+
+static const struct itemplate * const itable_0F3A0E[] = {
+    instrux + 1615,
+};
+
+static const struct itemplate * const itable_0F3A0F[] = {
+    instrux + 1567,
+    instrux + 1568,
+};
+
+static const struct itemplate * const itable_0F3A14[] = {
+    instrux + 1617,
+    instrux + 1618,
+    instrux + 1619,
+};
+
+static const struct itemplate * const itable_0F3A15[] = {
+    instrux + 1622,
+    instrux + 1623,
+    instrux + 1624,
+};
+
+static const struct itemplate * const itable_0F3A16[] = {
+    instrux + 1620,
+    instrux + 1621,
+};
+
+static const struct itemplate * const itable_0F3A17[] = {
+    instrux + 1608,
+    instrux + 1609,
+};
+
+static const struct itemplate * const itable_0F3A20[] = {
+    instrux + 1626,
+    instrux + 1627,
+    instrux + 1628,
+};
+
+static const struct itemplate * const itable_0F3A21[] = {
+    instrux + 1610,
+};
+
+static const struct itemplate * const itable_0F3A22[] = {
+    instrux + 1629,
+    instrux + 1630,
+    instrux + 1631,
+    instrux + 1632,
+};
+
+static const struct itemplate * const itable_0F3A40[] = {
+    instrux + 1607,
+};
+
+static const struct itemplate * const itable_0F3A41[] = {
+    instrux + 1606,
+};
+
+static const struct itemplate * const itable_0F3A42[] = {
+    instrux + 1612,
+};
+
+static const struct itemplate * const itable_0F3A44[] = {
+    instrux + 2743,
+    instrux + 2744,
+    instrux + 2745,
+    instrux + 2746,
+    instrux + 2747,
+};
+
+static const struct itemplate * const itable_0F3A60[] = {
+    instrux + 1666,
+};
+
+static const struct itemplate * const itable_0F3A61[] = {
+    instrux + 1665,
+};
+
+static const struct itemplate * const itable_0F3A62[] = {
+    instrux + 1668,
+};
+
+static const struct itemplate * const itable_0F3A63[] = {
+    instrux + 1667,
+};
+
+static const struct itemplate * const itable_0F3ADF[] = {
+    instrux + 1687,
+};
+
+static const struct itemplate * const itable_0F3C[] = {
+    instrux + 245,
+};
+
+static const struct itemplate * const itable_0F3D[] = {
+    instrux + 244,
+};
+
+static const struct itemplate * const itable_0F40[] = {
+    instrux + 1213,
+    instrux + 1214,
+    instrux + 1215,
+    instrux + 1216,
+    instrux + 1217,
+    instrux + 1218,
+};
+
+static const struct itemplate * const itable_0F41[] = {
+    instrux + 1213,
+    instrux + 1214,
+    instrux + 1215,
+    instrux + 1216,
+    instrux + 1217,
+    instrux + 1218,
+};
+
+static const struct itemplate * const itable_0F42[] = {
+    instrux + 1213,
+    instrux + 1214,
+    instrux + 1215,
+    instrux + 1216,
+    instrux + 1217,
+    instrux + 1218,
+};
+
+static const struct itemplate * const itable_0F43[] = {
+    instrux + 1213,
+    instrux + 1214,
+    instrux + 1215,
+    instrux + 1216,
+    instrux + 1217,
+    instrux + 1218,
+};
+
+static const struct itemplate * const itable_0F44[] = {
+    instrux + 1213,
+    instrux + 1214,
+    instrux + 1215,
+    instrux + 1216,
+    instrux + 1217,
+    instrux + 1218,
+};
+
+static const struct itemplate * const itable_0F45[] = {
+    instrux + 1213,
+    instrux + 1214,
+    instrux + 1215,
+    instrux + 1216,
+    instrux + 1217,
+    instrux + 1218,
+};
+
+static const struct itemplate * const itable_0F46[] = {
+    instrux + 1213,
+    instrux + 1214,
+    instrux + 1215,
+    instrux + 1216,
+    instrux + 1217,
+    instrux + 1218,
+};
+
+static const struct itemplate * const itable_0F47[] = {
+    instrux + 1213,
+    instrux + 1214,
+    instrux + 1215,
+    instrux + 1216,
+    instrux + 1217,
+    instrux + 1218,
+};
+
+static const struct itemplate * const itable_0F48[] = {
+    instrux + 1213,
+    instrux + 1214,
+    instrux + 1215,
+    instrux + 1216,
+    instrux + 1217,
+    instrux + 1218,
+};
+
+static const struct itemplate * const itable_0F49[] = {
+    instrux + 1213,
+    instrux + 1214,
+    instrux + 1215,
+    instrux + 1216,
+    instrux + 1217,
+    instrux + 1218,
+};
+
+static const struct itemplate * const itable_0F4A[] = {
+    instrux + 1213,
+    instrux + 1214,
+    instrux + 1215,
+    instrux + 1216,
+    instrux + 1217,
+    instrux + 1218,
+};
+
+static const struct itemplate * const itable_0F4B[] = {
+    instrux + 1213,
+    instrux + 1214,
+    instrux + 1215,
+    instrux + 1216,
+    instrux + 1217,
+    instrux + 1218,
+};
+
+static const struct itemplate * const itable_0F4C[] = {
+    instrux + 1213,
+    instrux + 1214,
+    instrux + 1215,
+    instrux + 1216,
+    instrux + 1217,
+    instrux + 1218,
+};
+
+static const struct itemplate * const itable_0F4D[] = {
+    instrux + 1213,
+    instrux + 1214,
+    instrux + 1215,
+    instrux + 1216,
+    instrux + 1217,
+    instrux + 1218,
+};
+
+static const struct itemplate * const itable_0F4E[] = {
+    instrux + 1213,
+    instrux + 1214,
+    instrux + 1215,
+    instrux + 1216,
+    instrux + 1217,
+    instrux + 1218,
+};
+
+static const struct itemplate * const itable_0F4F[] = {
+    instrux + 1213,
+    instrux + 1214,
+    instrux + 1215,
+    instrux + 1216,
+    instrux + 1217,
+    instrux + 1218,
+};
+
+static const struct itemplate * const itable_0F50[] = {
+    instrux + 774,
+    instrux + 1278,
+    instrux + 1279,
+    instrux + 1508,
+    instrux + 1509,
+};
+
+static const struct itemplate * const itable_0F51[] = {
+    instrux + 766,
+    instrux + 1298,
+    instrux + 1299,
+    instrux + 1523,
+    instrux + 1524,
+};
+
+static const struct itemplate * const itable_0F52[] = {
+    instrux + 802,
+    instrux + 1294,
+    instrux + 1295,
+};
+
+static const struct itemplate * const itable_0F53[] = {
+    instrux + 1292,
+    instrux + 1293,
+};
+
+static const struct itemplate * const itable_0F54[] = {
+    instrux + 782,
+    instrux + 1228,
+    instrux + 1451,
+};
+
+static const struct itemplate * const itable_0F55[] = {
+    instrux + 849,
+    instrux + 1227,
+    instrux + 1450,
+};
+
+static const struct itemplate * const itable_0F56[] = {
+    instrux + 1291,
+    instrux + 1520,
+};
+
+static const struct itemplate * const itable_0F57[] = {
+    instrux + 1306,
+    instrux + 1530,
+};
+
+static const struct itemplate * const itable_0F58[] = {
+    instrux + 811,
+    instrux + 1225,
+    instrux + 1226,
+    instrux + 1448,
+    instrux + 1449,
+};
+
+static const struct itemplate * const itable_0F59[] = {
+    instrux + 805,
+    instrux + 1289,
+    instrux + 1290,
+    instrux + 1518,
+    instrux + 1519,
+};
+
+static const struct itemplate * const itable_0F5A[] = {
+    instrux + 810,
+    instrux + 1475,
+    instrux + 1478,
+    instrux + 1483,
+    instrux + 1486,
+};
+
+static const struct itemplate * const itable_0F5B[] = {
+    instrux + 809,
+    instrux + 1472,
+    instrux + 1477,
+    instrux + 1489,
+};
+
+static const struct itemplate * const itable_0F5C[] = {
+    instrux + 808,
+    instrux + 1301,
+    instrux + 1302,
+    instrux + 1525,
+    instrux + 1526,
+};
+
+static const struct itemplate * const itable_0F5D[] = {
+    instrux + 803,
+    instrux + 1266,
+    instrux + 1267,
+    instrux + 1498,
+    instrux + 1499,
+};
+
+static const struct itemplate * const itable_0F5E[] = {
+    instrux + 800,
+    instrux + 1261,
+    instrux + 1262,
+    instrux + 1494,
+    instrux + 1495,
+};
+
+static const struct itemplate * const itable_0F5F[] = {
+    instrux + 1264,
+    instrux + 1265,
+    instrux + 1496,
+    instrux + 1497,
+};
+
+static const struct itemplate * const itable_0F60[] = {
+    instrux + 857,
+    instrux + 1443,
+};
+
+static const struct itemplate * const itable_0F61[] = {
+    instrux + 859,
+    instrux + 1444,
+};
+
+static const struct itemplate * const itable_0F62[] = {
+    instrux + 858,
+    instrux + 1445,
+};
+
+static const struct itemplate * const itable_0F63[] = {
+    instrux + 761,
+    instrux + 1367,
+};
+
+static const struct itemplate * const itable_0F64[] = {
+    instrux + 779,
+    instrux + 1386,
+};
+
+static const struct itemplate * const itable_0F65[] = {
+    instrux + 781,
+    instrux + 1387,
+};
+
+static const struct itemplate * const itable_0F66[] = {
+    instrux + 780,
+    instrux + 1388,
+};
+
+static const struct itemplate * const itable_0F67[] = {
+    instrux + 762,
+    instrux + 1369,
+};
+
+static const struct itemplate * const itable_0F68[] = {
+    instrux + 854,
+    instrux + 1439,
+};
+
+static const struct itemplate * const itable_0F69[] = {
+    instrux + 856,
+    instrux + 1440,
+};
+
+static const struct itemplate * const itable_0F6A[] = {
+    instrux + 855,
+    instrux + 1441,
+};
+
+static const struct itemplate * const itable_0F6B[] = {
+    instrux + 760,
+    instrux + 1368,
+};
+
+static const struct itemplate * const itable_0F6C[] = {
+    instrux + 1446,
+};
+
+static const struct itemplate * const itable_0F6D[] = {
+    instrux + 1442,
+};
+
+static const struct itemplate * const itable_0F6E[] = {
+    instrux + 672,
+    instrux + 673,
+    instrux + 676,
+    instrux + 677,
+    instrux + 682,
+    instrux + 1348,
+    instrux + 1349,
+    instrux + 1364,
+};
+
+static const struct itemplate * const itable_0F6F[] = {
+    instrux + 680,
+    instrux + 1351,
+    instrux + 1353,
+    instrux + 1355,
+    instrux + 1357,
+};
+
+static const struct itemplate * const itable_0F70[] = {
+    instrux + 1333,
+    instrux + 1406,
+    instrux + 1407,
+    instrux + 1408,
+    instrux + 1409,
+    instrux + 1410,
+    instrux + 1411,
+};
+
+static const struct itemplate * const itable_0F71[] = {
+    instrux + 835,
+    instrux + 839,
+    instrux + 845,
+    instrux + 1414,
+    instrux + 1420,
+    instrux + 1425,
+};
+
+static const struct itemplate * const itable_0F72[] = {
+    instrux + 831,
+    instrux + 837,
+    instrux + 841,
+    instrux + 1416,
+    instrux + 1422,
+    instrux + 1427,
+};
+
+static const struct itemplate * const itable_0F73[] = {
+    instrux + 833,
+    instrux + 843,
+    instrux + 1412,
+    instrux + 1418,
+    instrux + 1423,
+    instrux + 1429,
+};
+
+static const struct itemplate * const itable_0F74[] = {
+    instrux + 776,
+    instrux + 1383,
+};
+
+static const struct itemplate * const itable_0F75[] = {
+    instrux + 778,
+    instrux + 1384,
+};
+
+static const struct itemplate * const itable_0F76[] = {
+    instrux + 777,
+    instrux + 1385,
+};
+
+static const struct itemplate * const itable_0F77[] = {
+    instrux + 262,
+};
+
+static const struct itemplate * const itable_0F78[] = {
+    instrux + 1104,
+    instrux + 1548,
+    instrux + 1549,
+    instrux + 1593,
+    instrux + 1595,
+};
+
+static const struct itemplate * const itable_0F79[] = {
+    instrux + 941,
+    instrux + 1553,
+    instrux + 1554,
+    instrux + 1594,
+    instrux + 1596,
+};
+
+static const struct itemplate * const itable_0F7B[] = {
+    instrux + 942,
+};
+
+static const struct itemplate * const itable_0F7C[] = {
+    instrux + 1105,
+    instrux + 1533,
+    instrux + 1534,
+};
+
+static const struct itemplate * const itable_0F7D[] = {
+    instrux + 944,
+    instrux + 1535,
+    instrux + 1536,
+};
+
+static const struct itemplate * const itable_0F7E[] = {
+    instrux + 674,
+    instrux + 675,
+    instrux + 678,
+    instrux + 679,
+    instrux + 683,
+    instrux + 1347,
+    instrux + 1350,
+    instrux + 1360,
+    instrux + 1363,
+    instrux + 1365,
+};
+
+static const struct itemplate * const itable_0F7F[] = {
+    instrux + 681,
+    instrux + 1352,
+    instrux + 1354,
+    instrux + 1356,
+    instrux + 1358,
+};
+
+static const struct itemplate * const itable_0F80[] = {
+    instrux + 1219,
+    instrux + 1220,
+    instrux + 1221,
+};
+
+static const struct itemplate * const itable_0F81[] = {
+    instrux + 1219,
+    instrux + 1220,
+    instrux + 1221,
+};
+
+static const struct itemplate * const itable_0F82[] = {
+    instrux + 1219,
+    instrux + 1220,
+    instrux + 1221,
+};
+
+static const struct itemplate * const itable_0F83[] = {
+    instrux + 1219,
+    instrux + 1220,
+    instrux + 1221,
+};
+
+static const struct itemplate * const itable_0F84[] = {
+    instrux + 1219,
+    instrux + 1220,
+    instrux + 1221,
+};
+
+static const struct itemplate * const itable_0F85[] = {
+    instrux + 1219,
+    instrux + 1220,
+    instrux + 1221,
+};
+
+static const struct itemplate * const itable_0F86[] = {
+    instrux + 1219,
+    instrux + 1220,
+    instrux + 1221,
+};
+
+static const struct itemplate * const itable_0F87[] = {
+    instrux + 1219,
+    instrux + 1220,
+    instrux + 1221,
+};
+
+static const struct itemplate * const itable_0F88[] = {
+    instrux + 1219,
+    instrux + 1220,
+    instrux + 1221,
+};
+
+static const struct itemplate * const itable_0F89[] = {
+    instrux + 1219,
+    instrux + 1220,
+    instrux + 1221,
+};
+
+static const struct itemplate * const itable_0F8A[] = {
+    instrux + 1219,
+    instrux + 1220,
+    instrux + 1221,
+};
+
+static const struct itemplate * const itable_0F8B[] = {
+    instrux + 1219,
+    instrux + 1220,
+    instrux + 1221,
+};
+
+static const struct itemplate * const itable_0F8C[] = {
+    instrux + 1219,
+    instrux + 1220,
+    instrux + 1221,
+};
+
+static const struct itemplate * const itable_0F8D[] = {
+    instrux + 1219,
+    instrux + 1220,
+    instrux + 1221,
+};
+
+static const struct itemplate * const itable_0F8E[] = {
+    instrux + 1219,
+    instrux + 1220,
+    instrux + 1221,
+};
+
+static const struct itemplate * const itable_0F8F[] = {
+    instrux + 1219,
+    instrux + 1220,
+    instrux + 1221,
+};
+
+static const struct itemplate * const itable_0F90[] = {
+    instrux + 1223,
+    instrux + 1224,
+};
+
+static const struct itemplate * const itable_0F91[] = {
+    instrux + 1223,
+    instrux + 1224,
+};
+
+static const struct itemplate * const itable_0F92[] = {
+    instrux + 1223,
+    instrux + 1224,
+};
+
+static const struct itemplate * const itable_0F93[] = {
+    instrux + 1223,
+    instrux + 1224,
+};
+
+static const struct itemplate * const itable_0F94[] = {
+    instrux + 1223,
+    instrux + 1224,
+};
+
+static const struct itemplate * const itable_0F95[] = {
+    instrux + 1223,
+    instrux + 1224,
+};
+
+static const struct itemplate * const itable_0F96[] = {
+    instrux + 1223,
+    instrux + 1224,
+};
+
+static const struct itemplate * const itable_0F97[] = {
+    instrux + 1223,
+    instrux + 1224,
+};
+
+static const struct itemplate * const itable_0F98[] = {
+    instrux + 1223,
+    instrux + 1224,
+};
+
+static const struct itemplate * const itable_0F99[] = {
+    instrux + 1223,
+    instrux + 1224,
+};
+
+static const struct itemplate * const itable_0F9A[] = {
+    instrux + 1223,
+    instrux + 1224,
+};
+
+static const struct itemplate * const itable_0F9B[] = {
+    instrux + 1223,
+    instrux + 1224,
+};
+
+static const struct itemplate * const itable_0F9C[] = {
+    instrux + 1223,
+    instrux + 1224,
+};
+
+static const struct itemplate * const itable_0F9D[] = {
+    instrux + 1223,
+    instrux + 1224,
+};
+
+static const struct itemplate * const itable_0F9E[] = {
+    instrux + 1223,
+    instrux + 1224,
+};
+
+static const struct itemplate * const itable_0F9F[] = {
+    instrux + 1223,
+    instrux + 1224,
+};
+
+static const struct itemplate * const itable_0FA0[] = {
+    instrux + 868,
+};
+
+static const struct itemplate * const itable_0FA1[] = {
+    instrux + 819,
+};
+
+static const struct itemplate * const itable_0FA2[] = {
+    instrux + 243,
+};
+
+static const struct itemplate * const itable_0FA3[] = {
+    instrux + 124,
+    instrux + 125,
+    instrux + 126,
+    instrux + 127,
+    instrux + 128,
+    instrux + 129,
+};
+
+static const struct itemplate * const itable_0FA4[] = {
+    instrux + 1010,
+    instrux + 1011,
+    instrux + 1012,
+    instrux + 1013,
+    instrux + 1014,
+    instrux + 1015,
+};
+
+static const struct itemplate * const itable_0FA5[] = {
+    instrux + 1016,
+    instrux + 1017,
+    instrux + 1018,
+    instrux + 1019,
+    instrux + 1020,
+    instrux + 1021,
+};
+
+static const struct itemplate * const itable_0FA6C0[] = {
+    instrux + 2956,
+};
+
+static const struct itemplate * const itable_0FA6C8[] = {
+    instrux + 2957,
+};
+
+static const struct itemplate * const itable_0FA6D0[] = {
+    instrux + 2958,
+};
+
+static const struct itemplate * const itable_0FA7C0[] = {
+    instrux + 2950,
+};
+
+static const struct itemplate * const itable_0FA7C8[] = {
+    instrux + 2951,
+};
+
+static const struct itemplate * const itable_0FA7D0[] = {
+    instrux + 2952,
+};
+
+static const struct itemplate * const itable_0FA7D8[] = {
+    instrux + 2953,
+};
+
+static const struct itemplate * const itable_0FA7E0[] = {
+    instrux + 2954,
+};
+
+static const struct itemplate * const itable_0FA7E8[] = {
+    instrux + 2955,
+};
+
+static const struct itemplate * const itable_0FA8[] = {
+    instrux + 868,
+};
+
+static const struct itemplate * const itable_0FA9[] = {
+    instrux + 819,
+};
+
+static const struct itemplate * const itable_0FAA[] = {
+    instrux + 943,
+};
+
+static const struct itemplate * const itable_0FAB[] = {
+    instrux + 151,
+    instrux + 152,
+    instrux + 153,
+    instrux + 154,
+    instrux + 155,
+    instrux + 156,
+};
+
+static const struct itemplate * const itable_0FAC[] = {
+    instrux + 1034,
+    instrux + 1035,
+    instrux + 1036,
+    instrux + 1037,
+    instrux + 1038,
+    instrux + 1039,
+};
+
+static const struct itemplate * const itable_0FAD[] = {
+    instrux + 1040,
+    instrux + 1041,
+    instrux + 1042,
+    instrux + 1043,
+    instrux + 1044,
+    instrux + 1045,
+};
+
+static const struct itemplate * const itable_0FAE[] = {
+    instrux + 566,
+    instrux + 620,
+    instrux + 996,
+    instrux + 1263,
+    instrux + 1300,
+    instrux + 1307,
+    instrux + 1308,
+    instrux + 1311,
+    instrux + 1312,
+    instrux + 1317,
+    instrux + 1340,
+    instrux + 1345,
+    instrux + 1346,
+};
+
+static const struct itemplate * const itable_0FAF[] = {
+    instrux + 461,
+    instrux + 462,
+    instrux + 463,
+    instrux + 464,
+    instrux + 465,
+    instrux + 466,
+};
+
+static const struct itemplate * const itable_0FB0[] = {
+    instrux + 233,
+    instrux + 234,
+};
+
+static const struct itemplate * const itable_0FB1[] = {
+    instrux + 235,
+    instrux + 236,
+    instrux + 237,
+    instrux + 238,
+    instrux + 239,
+    instrux + 240,
+};
+
+static const struct itemplate * const itable_0FB2[] = {
+    instrux + 615,
+    instrux + 616,
+};
+
+static const struct itemplate * const itable_0FB3[] = {
+    instrux + 142,
+    instrux + 143,
+    instrux + 144,
+    instrux + 145,
+    instrux + 146,
+    instrux + 147,
+};
+
+static const struct itemplate * const itable_0FB4[] = {
+    instrux + 567,
+    instrux + 568,
+};
+
+static const struct itemplate * const itable_0FB5[] = {
+    instrux + 570,
+    instrux + 571,
+};
+
+static const struct itemplate * const itable_0FB6[] = {
+    instrux + 695,
+    instrux + 696,
+    instrux + 697,
+    instrux + 699,
+};
+
+static const struct itemplate * const itable_0FB7[] = {
+    instrux + 698,
+    instrux + 700,
+};
+
+static const struct itemplate * const itable_0FB8[] = {
+    instrux + 542,
+    instrux + 543,
+    instrux + 544,
+    instrux + 1670,
+    instrux + 1671,
+    instrux + 1672,
+};
+
+static const struct itemplate * const itable_0FB9[] = {
+    instrux + 1135,
+};
+
+static const struct itemplate * const itable_0FBA[] = {
+    instrux + 130,
+    instrux + 131,
+    instrux + 132,
+    instrux + 139,
+    instrux + 140,
+    instrux + 141,
+    instrux + 148,
+    instrux + 149,
+    instrux + 150,
+    instrux + 157,
+    instrux + 158,
+    instrux + 159,
+};
+
+static const struct itemplate * const itable_0FBB[] = {
+    instrux + 133,
+    instrux + 134,
+    instrux + 135,
+    instrux + 136,
+    instrux + 137,
+    instrux + 138,
+};
+
+static const struct itemplate * const itable_0FBC[] = {
+    instrux + 110,
+    instrux + 111,
+    instrux + 112,
+    instrux + 113,
+    instrux + 114,
+    instrux + 115,
+};
+
+static const struct itemplate * const itable_0FBD[] = {
+    instrux + 116,
+    instrux + 117,
+    instrux + 118,
+    instrux + 119,
+    instrux + 120,
+    instrux + 121,
+    instrux + 1599,
+    instrux + 1600,
+    instrux + 1601,
+};
+
+static const struct itemplate * const itable_0FBE[] = {
+    instrux + 688,
+    instrux + 689,
+    instrux + 690,
+    instrux + 692,
+};
+
+static const struct itemplate * const itable_0FBF[] = {
+    instrux + 691,
+    instrux + 693,
+};
+
+static const struct itemplate * const itable_0FC0[] = {
+    instrux + 1147,
+    instrux + 1148,
+};
+
+static const struct itemplate * const itable_0FC1[] = {
+    instrux + 1149,
+    instrux + 1150,
+    instrux + 1151,
+    instrux + 1152,
+    instrux + 1153,
+    instrux + 1154,
+};
+
+static const struct itemplate * const itable_0FC2[] = {
+    instrux + 1229,
+    instrux + 1230,
+    instrux + 1231,
+    instrux + 1232,
+    instrux + 1233,
+    instrux + 1234,
+    instrux + 1235,
+    instrux + 1236,
+    instrux + 1237,
+    instrux + 1238,
+    instrux + 1239,
+    instrux + 1240,
+    instrux + 1241,
+    instrux + 1242,
+    instrux + 1243,
+    instrux + 1244,
+    instrux + 1245,
+    instrux + 1246,
+    instrux + 1247,
+    instrux + 1248,
+    instrux + 1452,
+    instrux + 1453,
+    instrux + 1454,
+    instrux + 1455,
+    instrux + 1456,
+    instrux + 1457,
+    instrux + 1458,
+    instrux + 1459,
+    instrux + 1460,
+    instrux + 1461,
+    instrux + 1462,
+    instrux + 1463,
+    instrux + 1464,
+    instrux + 1465,
+    instrux + 1466,
+    instrux + 1467,
+    instrux + 1468,
+    instrux + 1469,
+};
+
+static const struct itemplate * const itable_0FC3[] = {
+    instrux + 1342,
+    instrux + 1343,
+};
+
+static const struct itemplate * const itable_0FC4[] = {
+    instrux + 1323,
+    instrux + 1324,
+    instrux + 1325,
+    instrux + 1390,
+    instrux + 1391,
+    instrux + 1392,
+};
+
+static const struct itemplate * const itable_0FC5[] = {
+    instrux + 1322,
+    instrux + 1389,
+};
+
+static const struct itemplate * const itable_0FC6[] = {
+    instrux + 1296,
+    instrux + 1297,
+    instrux + 1521,
+    instrux + 1522,
+};
+
+static const struct itemplate * const itable_0FC7[] = {
+    instrux + 241,
+    instrux + 242,
+    instrux + 1542,
+    instrux + 1546,
+    instrux + 1547,
+    instrux + 1556,
+};
+
+static const struct itemplate * const itable_0FC8[] = {
+    instrux + 122,
+    instrux + 123,
+};
+
+static const struct itemplate * const itable_0FC9[] = {
+    instrux + 122,
+    instrux + 123,
+};
+
+static const struct itemplate * const itable_0FCA[] = {
+    instrux + 122,
+    instrux + 123,
+};
+
+static const struct itemplate * const itable_0FCB[] = {
+    instrux + 122,
+    instrux + 123,
+};
+
+static const struct itemplate * const itable_0FCC[] = {
+    instrux + 122,
+    instrux + 123,
+};
+
+static const struct itemplate * const itable_0FCD[] = {
+    instrux + 122,
+    instrux + 123,
+};
+
+static const struct itemplate * const itable_0FCE[] = {
+    instrux + 122,
+    instrux + 123,
+};
+
+static const struct itemplate * const itable_0FCF[] = {
+    instrux + 122,
+    instrux + 123,
+};
+
+static const struct itemplate * const itable_0FD0[] = {
+    instrux + 1531,
+    instrux + 1532,
+};
+
+static const struct itemplate * const itable_0FD1[] = {
+    instrux + 844,
+    instrux + 1424,
+};
+
+static const struct itemplate * const itable_0FD2[] = {
+    instrux + 840,
+    instrux + 1426,
+};
+
+static const struct itemplate * const itable_0FD3[] = {
+    instrux + 842,
+    instrux + 1428,
+};
+
+static const struct itemplate * const itable_0FD4[] = {
+    instrux + 1373,
+    instrux + 1374,
+};
+
+static const struct itemplate * const itable_0FD5[] = {
+    instrux + 807,
+    instrux + 1401,
+};
+
+static const struct itemplate * const itable_0FD6[] = {
+    instrux + 1359,
+    instrux + 1361,
+    instrux + 1362,
+    instrux + 1366,
+};
+
+static const struct itemplate * const itable_0FD7[] = {
+    instrux + 1330,
+    instrux + 1398,
+};
+
+static const struct itemplate * const itable_0FD8[] = {
+    instrux + 851,
+    instrux + 1437,
+};
+
+static const struct itemplate * const itable_0FD9[] = {
+    instrux + 852,
+    instrux + 1438,
+};
+
+static const struct itemplate * const itable_0FDA[] = {
+    instrux + 1329,
+    instrux + 1397,
+};
+
+static const struct itemplate * const itable_0FDB[] = {
+    instrux + 771,
+    instrux + 1379,
+};
+
+static const struct itemplate * const itable_0FDC[] = {
+    instrux + 768,
+    instrux + 1377,
+};
+
+static const struct itemplate * const itable_0FDD[] = {
+    instrux + 769,
+    instrux + 1378,
+};
+
+static const struct itemplate * const itable_0FDE[] = {
+    instrux + 1327,
+    instrux + 1395,
+};
+
+static const struct itemplate * const itable_0FDF[] = {
+    instrux + 772,
+    instrux + 1380,
+};
+
+static const struct itemplate * const itable_0FE0[] = {
+    instrux + 1320,
+    instrux + 1381,
+};
+
+static const struct itemplate * const itable_0FE1[] = {
+    instrux + 838,
+    instrux + 1419,
+};
+
+static const struct itemplate * const itable_0FE2[] = {
+    instrux + 836,
+    instrux + 1421,
+};
+
+static const struct itemplate * const itable_0FE3[] = {
+    instrux + 1321,
+    instrux + 1382,
+};
+
+static const struct itemplate * const itable_0FE4[] = {
+    instrux + 1331,
+    instrux + 1399,
+};
+
+static const struct itemplate * const itable_0FE5[] = {
+    instrux + 806,
+    instrux + 1400,
+};
+
+static const struct itemplate * const itable_0FE6[] = {
+    instrux + 1471,
+    instrux + 1473,
+    instrux + 1488,
+};
+
+static const struct itemplate * const itable_0FE7[] = {
+    instrux + 1319,
+    instrux + 1341,
+};
+
+static const struct itemplate * const itable_0FE8[] = {
+    instrux + 848,
+    instrux + 1435,
+};
+
+static const struct itemplate * const itable_0FE9[] = {
+    instrux + 850,
+    instrux + 1436,
+};
+
+static const struct itemplate * const itable_0FEA[] = {
+    instrux + 1328,
+    instrux + 1396,
+};
+
+static const struct itemplate * const itable_0FEB[] = {
+    instrux + 827,
+    instrux + 1404,
+};
+
+static const struct itemplate * const itable_0FEC[] = {
+    instrux + 765,
+    instrux + 1375,
+};
+
+static const struct itemplate * const itable_0FED[] = {
+    instrux + 767,
+    instrux + 1376,
+};
+
+static const struct itemplate * const itable_0FEE[] = {
+    instrux + 1326,
+    instrux + 1394,
+};
+
+static const struct itemplate * const itable_0FEF[] = {
+    instrux + 881,
+    instrux + 1447,
+};
+
+static const struct itemplate * const itable_0FF0[] = {
+    instrux + 1537,
+};
+
+static const struct itemplate * const itable_0FF1[] = {
+    instrux + 834,
+    instrux + 1413,
+};
+
+static const struct itemplate * const itable_0FF2[] = {
+    instrux + 830,
+    instrux + 1415,
+};
+
+static const struct itemplate * const itable_0FF3[] = {
+    instrux + 832,
+    instrux + 1417,
+};
+
+static const struct itemplate * const itable_0FF4[] = {
+    instrux + 1402,
+    instrux + 1403,
+};
+
+static const struct itemplate * const itable_0FF5[] = {
+    instrux + 801,
+    instrux + 1393,
+};
+
+static const struct itemplate * const itable_0FF6[] = {
+    instrux + 1332,
+    instrux + 1405,
+};
+
+static const struct itemplate * const itable_0FF7[] = {
+    instrux + 1318,
+    instrux + 1339,
+};
+
+static const struct itemplate * const itable_0FF8[] = {
+    instrux + 846,
+    instrux + 1430,
+};
+
+static const struct itemplate * const itable_0FF9[] = {
+    instrux + 853,
+    instrux + 1431,
+};
+
+static const struct itemplate * const itable_0FFA[] = {
+    instrux + 847,
+    instrux + 1432,
+};
+
+static const struct itemplate * const itable_0FFB[] = {
+    instrux + 1433,
+    instrux + 1434,
+};
+
+static const struct itemplate * const itable_0FFC[] = {
+    instrux + 763,
+    instrux + 1370,
+};
+
+static const struct itemplate * const itable_0FFD[] = {
+    instrux + 770,
+    instrux + 1371,
+};
+
+static const struct itemplate * const itable_0FFE[] = {
+    instrux + 764,
+    instrux + 1372,
+};
+
+static const struct itemplate * const itable_0FFF[] = {
+    instrux + 1134,
+};
+
+static const struct itemplate * const itable_10[] = {
+    instrux + 7,
+    instrux + 8,
+};
+
+static const struct itemplate * const itable_11[] = {
+    instrux + 9,
+    instrux + 10,
+    instrux + 11,
+    instrux + 12,
+    instrux + 13,
+    instrux + 14,
+};
+
+static const struct itemplate * const itable_12[] = {
+    instrux + 15,
+    instrux + 16,
+};
+
+static const struct itemplate * const itable_13[] = {
+    instrux + 17,
+    instrux + 18,
+    instrux + 19,
+    instrux + 20,
+    instrux + 21,
+    instrux + 22,
+};
+
+static const struct itemplate * const itable_14[] = {
+    instrux + 26,
+};
+
+static const struct itemplate * const itable_15[] = {
+    instrux + 28,
+    instrux + 30,
+    instrux + 32,
+};
+
+static const struct itemplate * const itable_16[] = {
+    instrux + 866,
+    instrux + 867,
+};
+
+static const struct itemplate * const itable_17[] = {
+    instrux + 818,
+};
+
+static const struct itemplate * const itable_18[] = {
+    instrux + 959,
+    instrux + 960,
+};
+
+static const struct itemplate * const itable_19[] = {
+    instrux + 961,
+    instrux + 962,
+    instrux + 963,
+    instrux + 964,
+    instrux + 965,
+    instrux + 966,
+};
+
+static const struct itemplate * const itable_1A[] = {
+    instrux + 967,
+    instrux + 968,
+};
+
+static const struct itemplate * const itable_1B[] = {
+    instrux + 969,
+    instrux + 970,
+    instrux + 971,
+    instrux + 972,
+    instrux + 973,
+    instrux + 974,
+};
+
+static const struct itemplate * const itable_1C[] = {
+    instrux + 978,
+};
+
+static const struct itemplate * const itable_1D[] = {
+    instrux + 980,
+    instrux + 982,
+    instrux + 984,
+};
+
+static const struct itemplate * const itable_1E[] = {
+    instrux + 866,
+    instrux + 867,
+};
+
+static const struct itemplate * const itable_1F[] = {
+    instrux + 818,
+};
+
+static const struct itemplate * const itable_20[] = {
+    instrux + 73,
+    instrux + 74,
+};
+
+static const struct itemplate * const itable_21[] = {
+    instrux + 75,
+    instrux + 76,
+    instrux + 77,
+    instrux + 78,
+    instrux + 79,
+    instrux + 80,
+};
+
+static const struct itemplate * const itable_22[] = {
+    instrux + 81,
+    instrux + 82,
+};
+
+static const struct itemplate * const itable_23[] = {
+    instrux + 83,
+    instrux + 84,
+    instrux + 85,
+    instrux + 86,
+    instrux + 87,
+    instrux + 88,
+};
+
+static const struct itemplate * const itable_24[] = {
+    instrux + 92,
+};
+
+static const struct itemplate * const itable_25[] = {
+    instrux + 94,
+    instrux + 96,
+    instrux + 98,
+};
+
+static const struct itemplate * const itable_27[] = {
+    instrux + 249,
+};
+
+static const struct itemplate * const itable_28[] = {
+    instrux + 1071,
+    instrux + 1072,
+};
+
+static const struct itemplate * const itable_29[] = {
+    instrux + 1073,
+    instrux + 1074,
+    instrux + 1075,
+    instrux + 1076,
+    instrux + 1077,
+    instrux + 1078,
+};
+
+static const struct itemplate * const itable_2A[] = {
+    instrux + 1079,
+    instrux + 1080,
+};
+
+static const struct itemplate * const itable_2B[] = {
+    instrux + 1081,
+    instrux + 1082,
+    instrux + 1083,
+    instrux + 1084,
+    instrux + 1085,
+    instrux + 1086,
+};
+
+static const struct itemplate * const itable_2C[] = {
+    instrux + 1090,
+};
+
+static const struct itemplate * const itable_2D[] = {
+    instrux + 1092,
+    instrux + 1094,
+    instrux + 1096,
+};
+
+static const struct itemplate * const itable_2F[] = {
+    instrux + 250,
+};
+
+static const struct itemplate * const itable_30[] = {
+    instrux + 1180,
+    instrux + 1181,
+};
+
+static const struct itemplate * const itable_31[] = {
+    instrux + 1182,
+    instrux + 1183,
+    instrux + 1184,
+    instrux + 1185,
+    instrux + 1186,
+    instrux + 1187,
+};
+
+static const struct itemplate * const itable_32[] = {
+    instrux + 1188,
+    instrux + 1189,
+};
+
+static const struct itemplate * const itable_33[] = {
+    instrux + 1190,
+    instrux + 1191,
+    instrux + 1192,
+    instrux + 1193,
+    instrux + 1194,
+    instrux + 1195,
+};
+
+static const struct itemplate * const itable_34[] = {
+    instrux + 1199,
+};
+
+static const struct itemplate * const itable_35[] = {
+    instrux + 1201,
+    instrux + 1203,
+    instrux + 1205,
+};
+
+static const struct itemplate * const itable_37[] = {
+    instrux + 1,
+};
+
+static const struct itemplate * const itable_38[] = {
+    instrux + 196,
+    instrux + 197,
+};
+
+static const struct itemplate * const itable_39[] = {
+    instrux + 198,
+    instrux + 199,
+    instrux + 200,
+    instrux + 201,
+    instrux + 202,
+    instrux + 203,
+};
+
+static const struct itemplate * const itable_3A[] = {
+    instrux + 204,
+    instrux + 205,
+};
+
+static const struct itemplate * const itable_3B[] = {
+    instrux + 206,
+    instrux + 207,
+    instrux + 208,
+    instrux + 209,
+    instrux + 210,
+    instrux + 211,
+};
+
+static const struct itemplate * const itable_3C[] = {
+    instrux + 215,
+};
+
+static const struct itemplate * const itable_3D[] = {
+    instrux + 217,
+    instrux + 219,
+    instrux + 221,
+};
+
+static const struct itemplate * const itable_3F[] = {
+    instrux + 6,
+};
+
+static const struct itemplate * const itable_40[] = {
+    instrux + 491,
+    instrux + 492,
+};
+
+static const struct itemplate * const itable_41[] = {
+    instrux + 491,
+    instrux + 492,
+};
+
+static const struct itemplate * const itable_42[] = {
+    instrux + 491,
+    instrux + 492,
+};
+
+static const struct itemplate * const itable_43[] = {
+    instrux + 491,
+    instrux + 492,
+};
+
+static const struct itemplate * const itable_44[] = {
+    instrux + 491,
+    instrux + 492,
+};
+
+static const struct itemplate * const itable_45[] = {
+    instrux + 491,
+    instrux + 492,
+};
+
+static const struct itemplate * const itable_46[] = {
+    instrux + 491,
+    instrux + 492,
+};
+
+static const struct itemplate * const itable_47[] = {
+    instrux + 491,
+    instrux + 492,
+};
+
+static const struct itemplate * const itable_48[] = {
+    instrux + 251,
+    instrux + 252,
+};
+
+static const struct itemplate * const itable_49[] = {
+    instrux + 251,
+    instrux + 252,
+};
+
+static const struct itemplate * const itable_4A[] = {
+    instrux + 251,
+    instrux + 252,
+};
+
+static const struct itemplate * const itable_4B[] = {
+    instrux + 251,
+    instrux + 252,
+};
+
+static const struct itemplate * const itable_4C[] = {
+    instrux + 251,
+    instrux + 252,
+};
+
+static const struct itemplate * const itable_4D[] = {
+    instrux + 251,
+    instrux + 252,
+};
+
+static const struct itemplate * const itable_4E[] = {
+    instrux + 251,
+    instrux + 252,
+};
+
+static const struct itemplate * const itable_4F[] = {
+    instrux + 251,
+    instrux + 252,
+};
+
+static const struct itemplate * const itable_50[] = {
+    instrux + 860,
+    instrux + 861,
+    instrux + 862,
+};
+
+static const struct itemplate * const itable_51[] = {
+    instrux + 860,
+    instrux + 861,
+    instrux + 862,
+};
+
+static const struct itemplate * const itable_52[] = {
+    instrux + 860,
+    instrux + 861,
+    instrux + 862,
+};
+
+static const struct itemplate * const itable_53[] = {
+    instrux + 860,
+    instrux + 861,
+    instrux + 862,
+};
+
+static const struct itemplate * const itable_54[] = {
+    instrux + 860,
+    instrux + 861,
+    instrux + 862,
+};
+
+static const struct itemplate * const itable_55[] = {
+    instrux + 860,
+    instrux + 861,
+    instrux + 862,
+};
+
+static const struct itemplate * const itable_56[] = {
+    instrux + 860,
+    instrux + 861,
+    instrux + 862,
+};
+
+static const struct itemplate * const itable_57[] = {
+    instrux + 860,
+    instrux + 861,
+    instrux + 862,
+};
+
+static const struct itemplate * const itable_58[] = {
+    instrux + 812,
+    instrux + 813,
+    instrux + 814,
+};
+
+static const struct itemplate * const itable_59[] = {
+    instrux + 812,
+    instrux + 813,
+    instrux + 814,
+};
+
+static const struct itemplate * const itable_5A[] = {
+    instrux + 812,
+    instrux + 813,
+    instrux + 814,
+};
+
+static const struct itemplate * const itable_5B[] = {
+    instrux + 812,
+    instrux + 813,
+    instrux + 814,
+};
+
+static const struct itemplate * const itable_5C[] = {
+    instrux + 812,
+    instrux + 813,
+    instrux + 814,
+};
+
+static const struct itemplate * const itable_5D[] = {
+    instrux + 812,
+    instrux + 813,
+    instrux + 814,
+};
+
+static const struct itemplate * const itable_5E[] = {
+    instrux + 812,
+    instrux + 813,
+    instrux + 814,
+};
+
+static const struct itemplate * const itable_5F[] = {
+    instrux + 812,
+    instrux + 813,
+    instrux + 814,
+};
+
+static const struct itemplate * const itable_60[] = {
+    instrux + 874,
+    instrux + 875,
+    instrux + 876,
+};
+
+static const struct itemplate * const itable_61[] = {
+    instrux + 820,
+    instrux + 821,
+    instrux + 822,
+};
+
+static const struct itemplate * const itable_62[] = {
+    instrux + 108,
+    instrux + 109,
+};
+
+static const struct itemplate * const itable_63[] = {
+    instrux + 106,
+    instrux + 107,
+    instrux + 694,
+};
+
+static const struct itemplate * const itable_68[] = {
+    instrux + 870,
+    instrux + 871,
+    instrux + 872,
+    instrux + 873,
+};
+
+static const struct itemplate * const itable_69[] = {
+    instrux + 468,
+    instrux + 470,
+    instrux + 472,
+    instrux + 474,
+    instrux + 476,
+    instrux + 478,
+    instrux + 480,
+    instrux + 482,
+    instrux + 484,
+};
+
+static const struct itemplate * const itable_6A[] = {
+    instrux + 869,
+    instrux + 870,
+    instrux + 871,
+    instrux + 872,
+    instrux + 873,
+};
+
+static const struct itemplate * const itable_6B[] = {
+    instrux + 467,
+    instrux + 469,
+    instrux + 471,
+    instrux + 473,
+    instrux + 475,
+    instrux + 477,
+    instrux + 479,
+    instrux + 481,
+    instrux + 483,
+};
+
+static const struct itemplate * const itable_6C[] = {
+    instrux + 497,
+};
+
+static const struct itemplate * const itable_6D[] = {
+    instrux + 498,
+    instrux + 499,
+};
+
+static const struct itemplate * const itable_6E[] = {
+    instrux + 757,
+};
+
+static const struct itemplate * const itable_6F[] = {
+    instrux + 758,
+    instrux + 759,
+};
+
+static const struct itemplate * const itable_70[] = {
+    instrux + 1222,
+};
+
+static const struct itemplate * const itable_71[] = {
+    instrux + 1222,
+};
+
+static const struct itemplate * const itable_72[] = {
+    instrux + 1222,
+};
+
+static const struct itemplate * const itable_73[] = {
+    instrux + 1222,
+};
+
+static const struct itemplate * const itable_74[] = {
+    instrux + 1222,
+};
+
+static const struct itemplate * const itable_75[] = {
+    instrux + 1222,
+};
+
+static const struct itemplate * const itable_76[] = {
+    instrux + 1222,
+};
+
+static const struct itemplate * const itable_77[] = {
+    instrux + 1222,
+};
+
+static const struct itemplate * const itable_78[] = {
+    instrux + 1222,
+};
+
+static const struct itemplate * const itable_79[] = {
+    instrux + 1222,
+};
+
+static const struct itemplate * const itable_7A[] = {
+    instrux + 1222,
+};
+
+static const struct itemplate * const itable_7B[] = {
+    instrux + 1222,
+};
+
+static const struct itemplate * const itable_7C[] = {
+    instrux + 1222,
+};
+
+static const struct itemplate * const itable_7D[] = {
+    instrux + 1222,
+};
+
+static const struct itemplate * const itable_7E[] = {
+    instrux + 1222,
+};
+
+static const struct itemplate * const itable_7F[] = {
+    instrux + 1222,
+};
+
+static const struct itemplate * const itable_80[] = {
+    instrux + 33,
+    instrux + 37,
+    instrux + 66,
+    instrux + 70,
+    instrux + 99,
+    instrux + 103,
+    instrux + 222,
+    instrux + 226,
+    instrux + 744,
+    instrux + 748,
+    instrux + 985,
+    instrux + 989,
+    instrux + 1097,
+    instrux + 1101,
+    instrux + 1206,
+    instrux + 1210,
+};
+
+static const struct itemplate * const itable_81[] = {
+    instrux + 34,
+    instrux + 35,
+    instrux + 36,
+    instrux + 38,
+    instrux + 39,
+    instrux + 67,
+    instrux + 68,
+    instrux + 69,
+    instrux + 71,
+    instrux + 72,
+    instrux + 100,
+    instrux + 101,
+    instrux + 102,
+    instrux + 104,
+    instrux + 105,
+    instrux + 223,
+    instrux + 224,
+    instrux + 225,
+    instrux + 227,
+    instrux + 228,
+    instrux + 745,
+    instrux + 746,
+    instrux + 747,
+    instrux + 749,
+    instrux + 750,
+    instrux + 986,
+    instrux + 987,
+    instrux + 988,
+    instrux + 990,
+    instrux + 991,
+    instrux + 1098,
+    instrux + 1099,
+    instrux + 1100,
+    instrux + 1102,
+    instrux + 1103,
+    instrux + 1207,
+    instrux + 1208,
+    instrux + 1209,
+    instrux + 1211,
+    instrux + 1212,
+};
+
+static const struct itemplate * const itable_83[] = {
+    instrux + 23,
+    instrux + 24,
+    instrux + 25,
+    instrux + 27,
+    instrux + 29,
+    instrux + 31,
+    instrux + 34,
+    instrux + 35,
+    instrux + 36,
+    instrux + 38,
+    instrux + 39,
+    instrux + 56,
+    instrux + 57,
+    instrux + 58,
+    instrux + 60,
+    instrux + 62,
+    instrux + 64,
+    instrux + 67,
+    instrux + 68,
+    instrux + 69,
+    instrux + 71,
+    instrux + 72,
+    instrux + 89,
+    instrux + 90,
+    instrux + 91,
+    instrux + 93,
+    instrux + 95,
+    instrux + 97,
+    instrux + 100,
+    instrux + 101,
+    instrux + 102,
+    instrux + 104,
+    instrux + 105,
+    instrux + 212,
+    instrux + 213,
+    instrux + 214,
+    instrux + 216,
+    instrux + 218,
+    instrux + 220,
+    instrux + 223,
+    instrux + 224,
+    instrux + 225,
+    instrux + 227,
+    instrux + 228,
+    instrux + 734,
+    instrux + 735,
+    instrux + 736,
+    instrux + 738,
+    instrux + 740,
+    instrux + 742,
+    instrux + 745,
+    instrux + 746,
+    instrux + 747,
+    instrux + 749,
+    instrux + 750,
+    instrux + 975,
+    instrux + 976,
+    instrux + 977,
+    instrux + 979,
+    instrux + 981,
+    instrux + 983,
+    instrux + 986,
+    instrux + 987,
+    instrux + 988,
+    instrux + 990,
+    instrux + 991,
+    instrux + 1087,
+    instrux + 1088,
+    instrux + 1089,
+    instrux + 1091,
+    instrux + 1093,
+    instrux + 1095,
+    instrux + 1098,
+    instrux + 1099,
+    instrux + 1100,
+    instrux + 1102,
+    instrux + 1103,
+    instrux + 1196,
+    instrux + 1197,
+    instrux + 1198,
+    instrux + 1200,
+    instrux + 1202,
+    instrux + 1204,
+    instrux + 1207,
+    instrux + 1208,
+    instrux + 1209,
+    instrux + 1211,
+    instrux + 1212,
+};
+
+static const struct itemplate * const itable_84[] = {
+    instrux + 1111,
+    instrux + 1112,
+    instrux + 1119,
+};
+
+static const struct itemplate * const itable_85[] = {
+    instrux + 1113,
+    instrux + 1114,
+    instrux + 1115,
+    instrux + 1116,
+    instrux + 1117,
+    instrux + 1118,
+    instrux + 1120,
+    instrux + 1121,
+    instrux + 1122,
+};
+
+static const struct itemplate * const itable_86[] = {
+    instrux + 1162,
+    instrux + 1163,
+    instrux + 1170,
+    instrux + 1171,
+};
+
+static const struct itemplate * const itable_87[] = {
+    instrux + 1164,
+    instrux + 1165,
+    instrux + 1166,
+    instrux + 1167,
+    instrux + 1168,
+    instrux + 1169,
+    instrux + 1172,
+    instrux + 1173,
+    instrux + 1174,
+    instrux + 1175,
+    instrux + 1176,
+    instrux + 1177,
+};
+
+static const struct itemplate * const itable_88[] = {
+    instrux + 644,
+    instrux + 645,
+};
+
+static const struct itemplate * const itable_89[] = {
+    instrux + 646,
+    instrux + 647,
+    instrux + 648,
+    instrux + 649,
+    instrux + 650,
+    instrux + 651,
+};
+
+static const struct itemplate * const itable_8A[] = {
+    instrux + 652,
+    instrux + 653,
+};
+
+static const struct itemplate * const itable_8B[] = {
+    instrux + 654,
+    instrux + 655,
+    instrux + 656,
+    instrux + 657,
+    instrux + 658,
+    instrux + 659,
+};
+
+static const struct itemplate * const itable_8C[] = {
+    instrux + 622,
+    instrux + 623,
+    instrux + 624,
+};
+
+static const struct itemplate * const itable_8D[] = {
+    instrux + 560,
+    instrux + 561,
+    instrux + 562,
+};
+
+static const struct itemplate * const itable_8E[] = {
+    instrux + 625,
+    instrux + 626,
+    instrux + 627,
+};
+
+static const struct itemplate * const itable_8F[] = {
+    instrux + 815,
+    instrux + 816,
+    instrux + 817,
+};
+
+static const struct itemplate * const itable_90[] = {
+    instrux + 710,
+    instrux + 773,
+    instrux + 1155,
+    instrux + 1156,
+    instrux + 1157,
+    instrux + 1158,
+    instrux + 1159,
+    instrux + 1160,
+    instrux + 1161,
+};
+
+static const struct itemplate * const itable_91[] = {
+    instrux + 1155,
+    instrux + 1156,
+    instrux + 1157,
+    instrux + 1158,
+    instrux + 1159,
+    instrux + 1160,
+};
+
+static const struct itemplate * const itable_92[] = {
+    instrux + 1155,
+    instrux + 1156,
+    instrux + 1157,
+    instrux + 1158,
+    instrux + 1159,
+    instrux + 1160,
+};
+
+static const struct itemplate * const itable_93[] = {
+    instrux + 1155,
+    instrux + 1156,
+    instrux + 1157,
+    instrux + 1158,
+    instrux + 1159,
+    instrux + 1160,
+};
+
+static const struct itemplate * const itable_94[] = {
+    instrux + 1155,
+    instrux + 1156,
+    instrux + 1157,
+    instrux + 1158,
+    instrux + 1159,
+    instrux + 1160,
+};
+
+static const struct itemplate * const itable_95[] = {
+    instrux + 1155,
+    instrux + 1156,
+    instrux + 1157,
+    instrux + 1158,
+    instrux + 1159,
+    instrux + 1160,
+};
+
+static const struct itemplate * const itable_96[] = {
+    instrux + 1155,
+    instrux + 1156,
+    instrux + 1157,
+    instrux + 1158,
+    instrux + 1159,
+    instrux + 1160,
+};
+
+static const struct itemplate * const itable_97[] = {
+    instrux + 1155,
+    instrux + 1156,
+    instrux + 1157,
+    instrux + 1158,
+    instrux + 1159,
+    instrux + 1160,
+};
+
+static const struct itemplate * const itable_98[] = {
+    instrux + 187,
+    instrux + 189,
+    instrux + 248,
+};
+
+static const struct itemplate * const itable_99[] = {
+    instrux + 188,
+    instrux + 246,
+    instrux + 247,
+};
+
+static const struct itemplate * const itable_9A[] = {
+    instrux + 166,
+    instrux + 167,
+    instrux + 168,
+    instrux + 169,
+    instrux + 170,
+};
+
+static const struct itemplate * const itable_9C[] = {
+    instrux + 877,
+    instrux + 878,
+    instrux + 879,
+    instrux + 880,
+};
+
+static const struct itemplate * const itable_9D[] = {
+    instrux + 823,
+    instrux + 824,
+    instrux + 825,
+    instrux + 826,
+};
+
+static const struct itemplate * const itable_9E[] = {
+    instrux + 945,
+};
+
+static const struct itemplate * const itable_9F[] = {
+    instrux + 547,
+};
+
+static const struct itemplate * const itable_A0[] = {
+    instrux + 628,
+};
+
+static const struct itemplate * const itable_A1[] = {
+    instrux + 629,
+    instrux + 630,
+    instrux + 631,
+};
+
+static const struct itemplate * const itable_A2[] = {
+    instrux + 632,
+};
+
+static const struct itemplate * const itable_A3[] = {
+    instrux + 633,
+    instrux + 634,
+    instrux + 635,
+};
+
+static const struct itemplate * const itable_A4[] = {
+    instrux + 684,
+};
+
+static const struct itemplate * const itable_A5[] = {
+    instrux + 685,
+    instrux + 686,
+    instrux + 687,
+};
+
+static const struct itemplate * const itable_A6[] = {
+    instrux + 229,
+};
+
+static const struct itemplate * const itable_A7[] = {
+    instrux + 230,
+    instrux + 231,
+    instrux + 232,
+};
+
+static const struct itemplate * const itable_A8[] = {
+    instrux + 1123,
+};
+
+static const struct itemplate * const itable_A9[] = {
+    instrux + 1124,
+    instrux + 1125,
+    instrux + 1126,
+};
+
+static const struct itemplate * const itable_AA[] = {
+    instrux + 1062,
+};
+
+static const struct itemplate * const itable_AB[] = {
+    instrux + 1063,
+    instrux + 1064,
+    instrux + 1065,
+};
+
+static const struct itemplate * const itable_AC[] = {
+    instrux + 581,
+};
+
+static const struct itemplate * const itable_AD[] = {
+    instrux + 582,
+    instrux + 583,
+    instrux + 584,
+};
+
+static const struct itemplate * const itable_AE[] = {
+    instrux + 992,
+};
+
+static const struct itemplate * const itable_AF[] = {
+    instrux + 993,
+    instrux + 994,
+    instrux + 995,
+};
+
+static const struct itemplate * const itable_B0[] = {
+    instrux + 660,
+};
+
+static const struct itemplate * const itable_B1[] = {
+    instrux + 660,
+};
+
+static const struct itemplate * const itable_B2[] = {
+    instrux + 660,
+};
+
+static const struct itemplate * const itable_B3[] = {
+    instrux + 660,
+};
+
+static const struct itemplate * const itable_B4[] = {
+    instrux + 660,
+};
+
+static const struct itemplate * const itable_B5[] = {
+    instrux + 660,
+};
+
+static const struct itemplate * const itable_B6[] = {
+    instrux + 660,
+};
+
+static const struct itemplate * const itable_B7[] = {
+    instrux + 660,
+};
+
+static const struct itemplate * const itable_B8[] = {
+    instrux + 661,
+    instrux + 662,
+    instrux + 663,
+};
+
+static const struct itemplate * const itable_B9[] = {
+    instrux + 661,
+    instrux + 662,
+    instrux + 663,
+};
+
+static const struct itemplate * const itable_BA[] = {
+    instrux + 661,
+    instrux + 662,
+    instrux + 663,
+};
+
+static const struct itemplate * const itable_BB[] = {
+    instrux + 661,
+    instrux + 662,
+    instrux + 663,
+};
+
+static const struct itemplate * const itable_BC[] = {
+    instrux + 661,
+    instrux + 662,
+    instrux + 663,
+};
+
+static const struct itemplate * const itable_BD[] = {
+    instrux + 661,
+    instrux + 662,
+    instrux + 663,
+};
+
+static const struct itemplate * const itable_BE[] = {
+    instrux + 661,
+    instrux + 662,
+    instrux + 663,
+};
+
+static const struct itemplate * const itable_BF[] = {
+    instrux + 661,
+    instrux + 662,
+    instrux + 663,
+};
+
+static const struct itemplate * const itable_C0[] = {
+    instrux + 884,
+    instrux + 896,
+    instrux + 919,
+    instrux + 931,
+    instrux + 949,
+    instrux + 1000,
+    instrux + 1024,
+};
+
+static const struct itemplate * const itable_C1[] = {
+    instrux + 887,
+    instrux + 890,
+    instrux + 893,
+    instrux + 899,
+    instrux + 902,
+    instrux + 905,
+    instrux + 922,
+    instrux + 925,
+    instrux + 928,
+    instrux + 934,
+    instrux + 937,
+    instrux + 940,
+    instrux + 952,
+    instrux + 955,
+    instrux + 958,
+    instrux + 1003,
+    instrux + 1006,
+    instrux + 1009,
+    instrux + 1027,
+    instrux + 1030,
+    instrux + 1033,
+};
+
+static const struct itemplate * const itable_C2[] = {
+    instrux + 912,
+    instrux + 916,
+};
+
+static const struct itemplate * const itable_C3[] = {
+    instrux + 911,
+    instrux + 915,
+};
+
+static const struct itemplate * const itable_C4[] = {
+    instrux + 564,
+    instrux + 565,
+};
+
+static const struct itemplate * const itable_C5[] = {
+    instrux + 558,
+    instrux + 559,
+};
+
+static const struct itemplate * const itable_C6[] = {
+    instrux + 665,
+    instrux + 669,
+};
+
+static const struct itemplate * const itable_C7[] = {
+    instrux + 664,
+    instrux + 666,
+    instrux + 667,
+    instrux + 668,
+    instrux + 670,
+    instrux + 671,
+};
+
+static const struct itemplate * const itable_C8[] = {
+    instrux + 263,
+};
+
+static const struct itemplate * const itable_C9[] = {
+    instrux + 563,
+};
+
+static const struct itemplate * const itable_CA[] = {
+    instrux + 914,
+};
+
+static const struct itemplate * const itable_CB[] = {
+    instrux + 913,
+};
+
+static const struct itemplate * const itable_CC[] = {
+    instrux + 502,
+};
+
+static const struct itemplate * const itable_CD[] = {
+    instrux + 500,
+};
+
+static const struct itemplate * const itable_CE[] = {
+    instrux + 503,
+};
+
+static const struct itemplate * const itable_CF[] = {
+    instrux + 510,
+    instrux + 511,
+    instrux + 512,
+    instrux + 513,
+};
+
+static const struct itemplate * const itable_D0[] = {
+    instrux + 882,
+    instrux + 894,
+    instrux + 917,
+    instrux + 929,
+    instrux + 947,
+    instrux + 998,
+    instrux + 1022,
+};
+
+static const struct itemplate * const itable_D1[] = {
+    instrux + 885,
+    instrux + 888,
+    instrux + 891,
+    instrux + 897,
+    instrux + 900,
+    instrux + 903,
+    instrux + 920,
+    instrux + 923,
+    instrux + 926,
+    instrux + 932,
+    instrux + 935,
+    instrux + 938,
+    instrux + 950,
+    instrux + 953,
+    instrux + 956,
+    instrux + 1001,
+    instrux + 1004,
+    instrux + 1007,
+    instrux + 1025,
+    instrux + 1028,
+    instrux + 1031,
+};
+
+static const struct itemplate * const itable_D2[] = {
+    instrux + 883,
+    instrux + 895,
+    instrux + 918,
+    instrux + 930,
+    instrux + 948,
+    instrux + 999,
+    instrux + 1023,
+};
+
+static const struct itemplate * const itable_D3[] = {
+    instrux + 886,
+    instrux + 889,
+    instrux + 892,
+    instrux + 898,
+    instrux + 901,
+    instrux + 904,
+    instrux + 921,
+    instrux + 924,
+    instrux + 927,
+    instrux + 933,
+    instrux + 936,
+    instrux + 939,
+    instrux + 951,
+    instrux + 954,
+    instrux + 957,
+    instrux + 1002,
+    instrux + 1005,
+    instrux + 1008,
+    instrux + 1026,
+    instrux + 1029,
+    instrux + 1032,
+};
+
+static const struct itemplate * const itable_D4[] = {
+    instrux + 4,
+    instrux + 5,
+};
+
+static const struct itemplate * const itable_D5[] = {
+    instrux + 2,
+    instrux + 3,
+};
+
+static const struct itemplate * const itable_D6[] = {
+    instrux + 946,
+};
+
+static const struct itemplate * const itable_D7[] = {
+    instrux + 1178,
+    instrux + 1179,
+};
+
+static const struct itemplate * const itable_D8[] = {
+    instrux + 268,
+    instrux + 271,
+    instrux + 273,
+    instrux + 298,
+    instrux + 300,
+    instrux + 301,
+    instrux + 306,
+    instrux + 308,
+    instrux + 309,
+    instrux + 314,
+    instrux + 317,
+    instrux + 319,
+    instrux + 322,
+    instrux + 326,
+    instrux + 327,
+    instrux + 378,
+    instrux + 382,
+    instrux + 383,
+    instrux + 419,
+    instrux + 423,
+    instrux + 424,
+    instrux + 427,
+    instrux + 431,
+    instrux + 432,
+};
+
+static const struct itemplate * const itable_D9[] = {
+    instrux + 266,
+    instrux + 267,
+    instrux + 280,
+    instrux + 311,
+    instrux + 312,
+    instrux + 351,
+    instrux + 365,
+    instrux + 368,
+    instrux + 369,
+    instrux + 370,
+    instrux + 371,
+    instrux + 372,
+    instrux + 373,
+    instrux + 374,
+    instrux + 375,
+    instrux + 376,
+    instrux + 377,
+    instrux + 390,
+    instrux + 392,
+    instrux + 393,
+    instrux + 396,
+    instrux + 397,
+    instrux + 398,
+    instrux + 399,
+    instrux + 400,
+    instrux + 403,
+    instrux + 405,
+    instrux + 406,
+    instrux + 407,
+    instrux + 408,
+    instrux + 411,
+    instrux + 412,
+    instrux + 413,
+    instrux + 435,
+    instrux + 445,
+    instrux + 446,
+    instrux + 447,
+    instrux + 448,
+    instrux + 449,
+    instrux + 450,
+    instrux + 451,
+};
+
+static const struct itemplate * const itable_DA[] = {
+    instrux + 282,
+    instrux + 283,
+    instrux + 284,
+    instrux + 285,
+    instrux + 286,
+    instrux + 287,
+    instrux + 296,
+    instrux + 297,
+    instrux + 336,
+    instrux + 338,
+    instrux + 340,
+    instrux + 342,
+    instrux + 344,
+    instrux + 349,
+    instrux + 361,
+    instrux + 363,
+    instrux + 444,
+};
+
+static const struct itemplate * const itable_DB[] = {
+    instrux + 281,
+    instrux + 288,
+    instrux + 289,
+    instrux + 290,
+    instrux + 291,
+    instrux + 292,
+    instrux + 293,
+    instrux + 294,
+    instrux + 295,
+    instrux + 302,
+    instrux + 303,
+    instrux + 313,
+    instrux + 331,
+    instrux + 346,
+    instrux + 352,
+    instrux + 353,
+    instrux + 355,
+    instrux + 359,
+    instrux + 367,
+    instrux + 386,
+    instrux + 387,
+    instrux + 388,
+    instrux + 389,
+    instrux + 404,
+    instrux + 415,
+    instrux + 438,
+    instrux + 439,
+};
+
+static const struct itemplate * const itable_DC[] = {
+    instrux + 269,
+    instrux + 270,
+    instrux + 272,
+    instrux + 299,
+    instrux + 307,
+    instrux + 315,
+    instrux + 316,
+    instrux + 318,
+    instrux + 323,
+    instrux + 324,
+    instrux + 325,
+    instrux + 379,
+    instrux + 380,
+    instrux + 381,
+    instrux + 420,
+    instrux + 421,
+    instrux + 422,
+    instrux + 428,
+    instrux + 429,
+    instrux + 430,
+};
+
+static const struct itemplate * const itable_DD[] = {
+    instrux + 332,
+    instrux + 333,
+    instrux + 360,
+    instrux + 366,
+    instrux + 391,
+    instrux + 394,
+    instrux + 401,
+    instrux + 402,
+    instrux + 409,
+    instrux + 410,
+    instrux + 414,
+    instrux + 416,
+    instrux + 417,
+    instrux + 436,
+    instrux + 437,
+    instrux + 442,
+    instrux + 443,
+};
+
+static const struct itemplate * const itable_DE[] = {
+    instrux + 274,
+    instrux + 275,
+    instrux + 310,
+    instrux + 320,
+    instrux + 321,
+    instrux + 328,
+    instrux + 329,
+    instrux + 337,
+    instrux + 339,
+    instrux + 341,
+    instrux + 343,
+    instrux + 345,
+    instrux + 350,
+    instrux + 362,
+    instrux + 364,
+    instrux + 384,
+    instrux + 385,
+    instrux + 425,
+    instrux + 426,
+    instrux + 433,
+    instrux + 434,
+};
+
+static const struct itemplate * const itable_DF[] = {
+    instrux + 276,
+    instrux + 277,
+    instrux + 278,
+    instrux + 279,
+    instrux + 304,
+    instrux + 305,
+    instrux + 334,
+    instrux + 335,
+    instrux + 347,
+    instrux + 348,
+    instrux + 354,
+    instrux + 356,
+    instrux + 357,
+    instrux + 358,
+    instrux + 395,
+    instrux + 418,
+    instrux + 440,
+    instrux + 441,
+};
+
+static const struct itemplate * const itable_E0[] = {
+    instrux + 593,
+    instrux + 594,
+    instrux + 595,
+    instrux + 596,
+    instrux + 597,
+    instrux + 598,
+    instrux + 599,
+    instrux + 600,
+};
+
+static const struct itemplate * const itable_E1[] = {
+    instrux + 589,
+    instrux + 590,
+    instrux + 591,
+    instrux + 592,
+    instrux + 601,
+    instrux + 602,
+    instrux + 603,
+    instrux + 604,
+};
+
+static const struct itemplate * const itable_E2[] = {
+    instrux + 585,
+    instrux + 586,
+    instrux + 587,
+    instrux + 588,
+};
+
+static const struct itemplate * const itable_E3[] = {
+    instrux + 514,
+    instrux + 515,
+    instrux + 516,
+};
+
+static const struct itemplate * const itable_E4[] = {
+    instrux + 485,
+};
+
+static const struct itemplate * const itable_E5[] = {
+    instrux + 486,
+    instrux + 487,
+};
+
+static const struct itemplate * const itable_E6[] = {
+    instrux + 751,
+};
+
+static const struct itemplate * const itable_E7[] = {
+    instrux + 752,
+    instrux + 753,
+};
+
+static const struct itemplate * const itable_E8[] = {
+    instrux + 160,
+    instrux + 161,
+    instrux + 162,
+    instrux + 163,
+    instrux + 164,
+    instrux + 165,
+};
+
+static const struct itemplate * const itable_E9[] = {
+    instrux + 518,
+    instrux + 519,
+    instrux + 520,
+};
+
+static const struct itemplate * const itable_EA[] = {
+    instrux + 521,
+    instrux + 522,
+    instrux + 523,
+    instrux + 524,
+    instrux + 525,
+};
+
+static const struct itemplate * const itable_EB[] = {
+    instrux + 517,
+};
+
+static const struct itemplate * const itable_EC[] = {
+    instrux + 488,
+};
+
+static const struct itemplate * const itable_ED[] = {
+    instrux + 489,
+    instrux + 490,
+};
+
+static const struct itemplate * const itable_EE[] = {
+    instrux + 754,
+};
+
+static const struct itemplate * const itable_EF[] = {
+    instrux + 755,
+    instrux + 756,
+};
+
+static const struct itemplate * const itable_F1[] = {
+    instrux + 501,
+    instrux + 1053,
+};
+
+static const struct itemplate * const itable_F4[] = {
+    instrux + 452,
+};
+
+static const struct itemplate * const itable_F5[] = {
+    instrux + 195,
+};
+
+static const struct itemplate * const itable_F6[] = {
+    instrux + 257,
+    instrux + 453,
+    instrux + 457,
+    instrux + 701,
+    instrux + 706,
+    instrux + 714,
+    instrux + 1127,
+    instrux + 1131,
+};
+
+static const struct itemplate * const itable_F7[] = {
+    instrux + 258,
+    instrux + 259,
+    instrux + 260,
+    instrux + 454,
+    instrux + 455,
+    instrux + 456,
+    instrux + 458,
+    instrux + 459,
+    instrux + 460,
+    instrux + 702,
+    instrux + 703,
+    instrux + 704,
+    instrux + 707,
+    instrux + 708,
+    instrux + 709,
+    instrux + 715,
+    instrux + 716,
+    instrux + 717,
+    instrux + 1128,
+    instrux + 1129,
+    instrux + 1130,
+    instrux + 1132,
+    instrux + 1133,
+};
+
+static const struct itemplate * const itable_F8[] = {
+    instrux + 190,
+};
+
+static const struct itemplate * const itable_F9[] = {
+    instrux + 1058,
+};
+
+static const struct itemplate * const itable_FA[] = {
+    instrux + 193,
+};
+
+static const struct itemplate * const itable_FB[] = {
+    instrux + 1061,
+};
+
+static const struct itemplate * const itable_FC[] = {
+    instrux + 191,
+};
+
+static const struct itemplate * const itable_FD[] = {
+    instrux + 1059,
+};
+
+static const struct itemplate * const itable_FE[] = {
+    instrux + 253,
+    instrux + 493,
+};
+
+static const struct itemplate * const itable_FF[] = {
+    instrux + 171,
+    instrux + 172,
+    instrux + 173,
+    instrux + 174,
+    instrux + 175,
+    instrux + 176,
+    instrux + 177,
+    instrux + 178,
+    instrux + 179,
+    instrux + 180,
+    instrux + 181,
+    instrux + 182,
+    instrux + 183,
+    instrux + 184,
+    instrux + 185,
+    instrux + 186,
+    instrux + 254,
+    instrux + 255,
+    instrux + 256,
+    instrux + 494,
+    instrux + 495,
+    instrux + 496,
+    instrux + 526,
+    instrux + 527,
+    instrux + 528,
+    instrux + 529,
+    instrux + 530,
+    instrux + 531,
+    instrux + 532,
+    instrux + 533,
+    instrux + 534,
+    instrux + 535,
+    instrux + 536,
+    instrux + 537,
+    instrux + 538,
+    instrux + 539,
+    instrux + 540,
+    instrux + 541,
+    instrux + 863,
+    instrux + 864,
+    instrux + 865,
+};
+
+static const struct itemplate * const itable_vex01010[] = {
+    instrux + 2350,
+};
+
+static const struct itemplate * const itable_vex01011[] = {
+    instrux + 2351,
+};
+
+static const struct itemplate * const itable_vex01012[] = {
+    instrux + 2298,
+    instrux + 2299,
+    instrux + 2311,
+    instrux + 2312,
+};
+
+static const struct itemplate * const itable_vex01013[] = {
+    instrux + 2313,
+};
+
+static const struct itemplate * const itable_vex01014[] = {
+    instrux + 2729,
+    instrux + 2730,
+};
+
+static const struct itemplate * const itable_vex01015[] = {
+    instrux + 2721,
+    instrux + 2722,
+};
+
+static const struct itemplate * const itable_vex01016[] = {
+    instrux + 2303,
+    instrux + 2304,
+    instrux + 2306,
+    instrux + 2307,
+};
+
+static const struct itemplate * const itable_vex01017[] = {
+    instrux + 2305,
+};
+
+static const struct itemplate * const itable_vex01028[] = {
+    instrux + 2274,
+};
+
+static const struct itemplate * const itable_vex01029[] = {
+    instrux + 2275,
+};
+
+static const struct itemplate * const itable_vex0102B[] = {
+    instrux + 2328,
+};
+
+static const struct itemplate * const itable_vex0102E[] = {
+    instrux + 2716,
+};
+
+static const struct itemplate * const itable_vex0102F[] = {
+    instrux + 2151,
+};
+
+static const struct itemplate * const itable_vex01050[] = {
+    instrux + 2318,
+    instrux + 2319,
+};
+
+static const struct itemplate * const itable_vex01051[] = {
+    instrux + 2692,
+};
+
+static const struct itemplate * const itable_vex01052[] = {
+    instrux + 2670,
+};
+
+static const struct itemplate * const itable_vex01053[] = {
+    instrux + 2666,
+};
+
+static const struct itemplate * const itable_vex01054[] = {
+    instrux + 1722,
+    instrux + 1723,
+};
+
+static const struct itemplate * const itable_vex01055[] = {
+    instrux + 1730,
+    instrux + 1731,
+};
+
+static const struct itemplate * const itable_vex01056[] = {
+    instrux + 2372,
+    instrux + 2373,
+};
+
+static const struct itemplate * const itable_vex01057[] = {
+    instrux + 2737,
+    instrux + 2738,
+};
+
+static const struct itemplate * const itable_vex01058[] = {
+    instrux + 1702,
+    instrux + 1703,
+};
+
+static const struct itemplate * const itable_vex01059[] = {
+    instrux + 2360,
+    instrux + 2361,
+};
+
+static const struct itemplate * const itable_vex0105A[] = {
+    instrux + 2166,
+};
+
+static const struct itemplate * const itable_vex0105B[] = {
+    instrux + 2154,
+};
+
+static const struct itemplate * const itable_vex0105C[] = {
+    instrux + 2703,
+    instrux + 2704,
+};
+
+static const struct itemplate * const itable_vex0105D[] = {
+    instrux + 2262,
+    instrux + 2263,
+};
+
+static const struct itemplate * const itable_vex0105E[] = {
+    instrux + 2198,
+    instrux + 2199,
+};
+
+static const struct itemplate * const itable_vex0105F[] = {
+    instrux + 2250,
+    instrux + 2251,
+};
+
+static const struct itemplate * const itable_vex01077[] = {
+    instrux + 2742,
+};
+
+static const struct itemplate * const itable_vex010AE[] = {
+    instrux + 2236,
+    instrux + 2698,
+};
+
+static const struct itemplate * const itable_vex010C2[] = {
+    instrux + 1886,
+    instrux + 1887,
+    instrux + 1890,
+    instrux + 1891,
+    instrux + 1894,
+    instrux + 1895,
+    instrux + 1898,
+    instrux + 1899,
+    instrux + 1902,
+    instrux + 1903,
+    instrux + 1906,
+    instrux + 1907,
+    instrux + 1910,
+    instrux + 1911,
+    instrux + 1914,
+    instrux + 1915,
+    instrux + 1918,
+    instrux + 1919,
+    instrux + 1922,
+    instrux + 1923,
+    instrux + 1926,
+    instrux + 1927,
+    instrux + 1930,
+    instrux + 1931,
+    instrux + 1934,
+    instrux + 1935,
+    instrux + 1938,
+    instrux + 1939,
+    instrux + 1942,
+    instrux + 1943,
+    instrux + 1946,
+    instrux + 1947,
+    instrux + 1950,
+    instrux + 1951,
+    instrux + 1954,
+    instrux + 1955,
+    instrux + 1958,
+    instrux + 1959,
+    instrux + 1962,
+    instrux + 1963,
+    instrux + 1966,
+    instrux + 1967,
+    instrux + 1970,
+    instrux + 1971,
+    instrux + 1974,
+    instrux + 1975,
+    instrux + 1978,
+    instrux + 1979,
+    instrux + 1982,
+    instrux + 1983,
+    instrux + 1986,
+    instrux + 1987,
+    instrux + 1990,
+    instrux + 1991,
+    instrux + 1994,
+    instrux + 1995,
+    instrux + 1998,
+    instrux + 1999,
+    instrux + 2002,
+    instrux + 2003,
+    instrux + 2006,
+    instrux + 2007,
+    instrux + 2010,
+    instrux + 2011,
+    instrux + 2014,
+    instrux + 2015,
+};
+
+static const struct itemplate * const itable_vex010C6[] = {
+    instrux + 2686,
+    instrux + 2687,
+};
+
+static const struct itemplate * const itable_vex01110[] = {
+    instrux + 2346,
+};
+
+static const struct itemplate * const itable_vex01111[] = {
+    instrux + 2347,
+};
+
+static const struct itemplate * const itable_vex01112[] = {
+    instrux + 2308,
+    instrux + 2309,
+};
+
+static const struct itemplate * const itable_vex01113[] = {
+    instrux + 2310,
+};
+
+static const struct itemplate * const itable_vex01114[] = {
+    instrux + 2725,
+    instrux + 2726,
+};
+
+static const struct itemplate * const itable_vex01115[] = {
+    instrux + 2717,
+    instrux + 2718,
+};
+
+static const struct itemplate * const itable_vex01116[] = {
+    instrux + 2300,
+    instrux + 2301,
+};
+
+static const struct itemplate * const itable_vex01117[] = {
+    instrux + 2302,
+};
+
+static const struct itemplate * const itable_vex01128[] = {
+    instrux + 2270,
+};
+
+static const struct itemplate * const itable_vex01129[] = {
+    instrux + 2271,
+    instrux + 2427,
+    instrux + 2428,
+};
+
+static const struct itemplate * const itable_vex0112B[] = {
+    instrux + 2326,
+};
+
+static const struct itemplate * const itable_vex0112E[] = {
+    instrux + 2715,
+};
+
+static const struct itemplate * const itable_vex0112F[] = {
+    instrux + 2150,
+};
+
+static const struct itemplate * const itable_vex01137[] = {
+    instrux + 2435,
+    instrux + 2436,
+};
+
+static const struct itemplate * const itable_vex01150[] = {
+    instrux + 2314,
+    instrux + 2315,
+};
+
+static const struct itemplate * const itable_vex01151[] = {
+    instrux + 2690,
+};
+
+static const struct itemplate * const itable_vex01154[] = {
+    instrux + 1718,
+    instrux + 1719,
+};
+
+static const struct itemplate * const itable_vex01155[] = {
+    instrux + 1726,
+    instrux + 1727,
+};
+
+static const struct itemplate * const itable_vex01156[] = {
+    instrux + 2368,
+    instrux + 2369,
+};
+
+static const struct itemplate * const itable_vex01157[] = {
+    instrux + 2733,
+    instrux + 2734,
+};
+
+static const struct itemplate * const itable_vex01158[] = {
+    instrux + 1698,
+    instrux + 1699,
+};
+
+static const struct itemplate * const itable_vex01159[] = {
+    instrux + 2356,
+    instrux + 2357,
+};
+
+static const struct itemplate * const itable_vex0115A[] = {
+    instrux + 2160,
+    instrux + 2161,
+};
+
+static const struct itemplate * const itable_vex0115B[] = {
+    instrux + 2164,
+};
+
+static const struct itemplate * const itable_vex0115C[] = {
+    instrux + 2699,
+    instrux + 2700,
+};
+
+static const struct itemplate * const itable_vex0115D[] = {
+    instrux + 2258,
+    instrux + 2259,
+};
+
+static const struct itemplate * const itable_vex0115E[] = {
+    instrux + 2194,
+    instrux + 2195,
+};
+
+static const struct itemplate * const itable_vex0115F[] = {
+    instrux + 2246,
+    instrux + 2247,
+};
+
+static const struct itemplate * const itable_vex01160[] = {
+    instrux + 2656,
+    instrux + 2657,
+};
+
+static const struct itemplate * const itable_vex01161[] = {
+    instrux + 2658,
+    instrux + 2659,
+};
+
+static const struct itemplate * const itable_vex01162[] = {
+    instrux + 2660,
+    instrux + 2661,
+};
+
+static const struct itemplate * const itable_vex01163[] = {
+    instrux + 2379,
+    instrux + 2380,
+};
+
+static const struct itemplate * const itable_vex01164[] = {
+    instrux + 2429,
+    instrux + 2430,
+};
+
+static const struct itemplate * const itable_vex01165[] = {
+    instrux + 2431,
+    instrux + 2432,
+};
+
+static const struct itemplate * const itable_vex01166[] = {
+    instrux + 2433,
+    instrux + 2434,
+};
+
+static const struct itemplate * const itable_vex01167[] = {
+    instrux + 2383,
+    instrux + 2384,
+};
+
+static const struct itemplate * const itable_vex01168[] = {
+    instrux + 2648,
+    instrux + 2649,
+};
+
+static const struct itemplate * const itable_vex01169[] = {
+    instrux + 2650,
+    instrux + 2651,
+};
+
+static const struct itemplate * const itable_vex0116A[] = {
+    instrux + 2652,
+    instrux + 2653,
+};
+
+static const struct itemplate * const itable_vex0116B[] = {
+    instrux + 2381,
+    instrux + 2382,
+};
+
+static const struct itemplate * const itable_vex0116C[] = {
+    instrux + 2662,
+    instrux + 2663,
+};
+
+static const struct itemplate * const itable_vex0116D[] = {
+    instrux + 2654,
+    instrux + 2655,
+};
+
+static const struct itemplate * const itable_vex0116E[] = {
+    instrux + 2280,
+    instrux + 2282,
+};
+
+static const struct itemplate * const itable_vex0116F[] = {
+    instrux + 2286,
+};
+
+static const struct itemplate * const itable_vex01170[] = {
+    instrux + 2585,
+};
+
+static const struct itemplate * const itable_vex01171[] = {
+    instrux + 2600,
+    instrux + 2601,
+    instrux + 2612,
+    instrux + 2613,
+    instrux + 2620,
+    instrux + 2621,
+};
+
+static const struct itemplate * const itable_vex01172[] = {
+    instrux + 2604,
+    instrux + 2605,
+    instrux + 2616,
+    instrux + 2617,
+    instrux + 2624,
+    instrux + 2625,
+};
+
+static const struct itemplate * const itable_vex01173[] = {
+    instrux + 2594,
+    instrux + 2595,
+    instrux + 2596,
+    instrux + 2597,
+    instrux + 2608,
+    instrux + 2609,
+    instrux + 2628,
+    instrux + 2629,
+};
+
+static const struct itemplate * const itable_vex01174[] = {
+    instrux + 2421,
+    instrux + 2422,
+};
+
+static const struct itemplate * const itable_vex01175[] = {
+    instrux + 2423,
+    instrux + 2424,
+};
+
+static const struct itemplate * const itable_vex01176[] = {
+    instrux + 2425,
+    instrux + 2426,
+};
+
+static const struct itemplate * const itable_vex0117C[] = {
+    instrux + 2214,
+    instrux + 2215,
+};
+
+static const struct itemplate * const itable_vex0117D[] = {
+    instrux + 2222,
+    instrux + 2223,
+};
+
+static const struct itemplate * const itable_vex0117E[] = {
+    instrux + 2281,
+    instrux + 2283,
+};
+
+static const struct itemplate * const itable_vex0117F[] = {
+    instrux + 2287,
+};
+
+static const struct itemplate * const itable_vex011C2[] = {
+    instrux + 1754,
+    instrux + 1755,
+    instrux + 1758,
+    instrux + 1759,
+    instrux + 1762,
+    instrux + 1763,
+    instrux + 1766,
+    instrux + 1767,
+    instrux + 1770,
+    instrux + 1771,
+    instrux + 1774,
+    instrux + 1775,
+    instrux + 1778,
+    instrux + 1779,
+    instrux + 1782,
+    instrux + 1783,
+    instrux + 1786,
+    instrux + 1787,
+    instrux + 1790,
+    instrux + 1791,
+    instrux + 1794,
+    instrux + 1795,
+    instrux + 1798,
+    instrux + 1799,
+    instrux + 1802,
+    instrux + 1803,
+    instrux + 1806,
+    instrux + 1807,
+    instrux + 1810,
+    instrux + 1811,
+    instrux + 1814,
+    instrux + 1815,
+    instrux + 1818,
+    instrux + 1819,
+    instrux + 1822,
+    instrux + 1823,
+    instrux + 1826,
+    instrux + 1827,
+    instrux + 1830,
+    instrux + 1831,
+    instrux + 1834,
+    instrux + 1835,
+    instrux + 1838,
+    instrux + 1839,
+    instrux + 1842,
+    instrux + 1843,
+    instrux + 1846,
+    instrux + 1847,
+    instrux + 1850,
+    instrux + 1851,
+    instrux + 1854,
+    instrux + 1855,
+    instrux + 1858,
+    instrux + 1859,
+    instrux + 1862,
+    instrux + 1863,
+    instrux + 1866,
+    instrux + 1867,
+    instrux + 1870,
+    instrux + 1871,
+    instrux + 1874,
+    instrux + 1875,
+    instrux + 1878,
+    instrux + 1879,
+    instrux + 1882,
+    instrux + 1883,
+};
+
+static const struct itemplate * const itable_vex011C4[] = {
+    instrux + 2509,
+    instrux + 2510,
+    instrux + 2511,
+    instrux + 2512,
+    instrux + 2513,
+    instrux + 2514,
+};
+
+static const struct itemplate * const itable_vex011C5[] = {
+    instrux + 2481,
+    instrux + 2482,
+    instrux + 2483,
+};
+
+static const struct itemplate * const itable_vex011C6[] = {
+    instrux + 2682,
+    instrux + 2683,
+};
+
+static const struct itemplate * const itable_vex011D0[] = {
+    instrux + 1710,
+    instrux + 1711,
+};
+
+static const struct itemplate * const itable_vex011D1[] = {
+    instrux + 2618,
+    instrux + 2619,
+};
+
+static const struct itemplate * const itable_vex011D2[] = {
+    instrux + 2622,
+    instrux + 2623,
+};
+
+static const struct itemplate * const itable_vex011D3[] = {
+    instrux + 2626,
+    instrux + 2627,
+};
+
+static const struct itemplate * const itable_vex011D4[] = {
+    instrux + 2393,
+    instrux + 2394,
+};
+
+static const struct itemplate * const itable_vex011D5[] = {
+    instrux + 2571,
+    instrux + 2572,
+};
+
+static const struct itemplate * const itable_vex011D6[] = {
+    instrux + 2279,
+};
+
+static const struct itemplate * const itable_vex011D7[] = {
+    instrux + 2551,
+    instrux + 2552,
+};
+
+static const struct itemplate * const itable_vex011D8[] = {
+    instrux + 2644,
+    instrux + 2645,
+};
+
+static const struct itemplate * const itable_vex011D9[] = {
+    instrux + 2646,
+    instrux + 2647,
+};
+
+static const struct itemplate * const itable_vex011DA[] = {
+    instrux + 2545,
+    instrux + 2546,
+};
+
+static const struct itemplate * const itable_vex011DB[] = {
+    instrux + 2405,
+    instrux + 2406,
+};
+
+static const struct itemplate * const itable_vex011DC[] = {
+    instrux + 2399,
+    instrux + 2400,
+};
+
+static const struct itemplate * const itable_vex011DD[] = {
+    instrux + 2401,
+    instrux + 2402,
+};
+
+static const struct itemplate * const itable_vex011DE[] = {
+    instrux + 2533,
+    instrux + 2534,
+};
+
+static const struct itemplate * const itable_vex011DF[] = {
+    instrux + 2407,
+    instrux + 2408,
+};
+
+static const struct itemplate * const itable_vex011E0[] = {
+    instrux + 2409,
+    instrux + 2410,
+};
+
+static const struct itemplate * const itable_vex011E1[] = {
+    instrux + 2610,
+    instrux + 2611,
+};
+
+static const struct itemplate * const itable_vex011E2[] = {
+    instrux + 2614,
+    instrux + 2615,
+};
+
+static const struct itemplate * const itable_vex011E3[] = {
+    instrux + 2411,
+    instrux + 2412,
+};
+
+static const struct itemplate * const itable_vex011E4[] = {
+    instrux + 2565,
+    instrux + 2566,
+};
+
+static const struct itemplate * const itable_vex011E5[] = {
+    instrux + 2569,
+    instrux + 2570,
+};
+
+static const struct itemplate * const itable_vex011E6[] = {
+    instrux + 2184,
+    instrux + 2185,
+};
+
+static const struct itemplate * const itable_vex011E7[] = {
+    instrux + 2322,
+};
+
+static const struct itemplate * const itable_vex011E8[] = {
+    instrux + 2640,
+    instrux + 2641,
+};
+
+static const struct itemplate * const itable_vex011E9[] = {
+    instrux + 2642,
+    instrux + 2643,
+};
+
+static const struct itemplate * const itable_vex011EA[] = {
+    instrux + 2541,
+    instrux + 2542,
+};
+
+static const struct itemplate * const itable_vex011EB[] = {
+    instrux + 2579,
+    instrux + 2580,
+};
+
+static const struct itemplate * const itable_vex011EC[] = {
+    instrux + 2395,
+    instrux + 2396,
+};
+
+static const struct itemplate * const itable_vex011ED[] = {
+    instrux + 2397,
+    instrux + 2398,
+};
+
+static const struct itemplate * const itable_vex011EE[] = {
+    instrux + 2529,
+    instrux + 2530,
+};
+
+static const struct itemplate * const itable_vex011EF[] = {
+    instrux + 2664,
+    instrux + 2665,
+};
+
+static const struct itemplate * const itable_vex011F1[] = {
+    instrux + 2598,
+    instrux + 2599,
+};
+
+static const struct itemplate * const itable_vex011F2[] = {
+    instrux + 2602,
+    instrux + 2603,
+};
+
+static const struct itemplate * const itable_vex011F3[] = {
+    instrux + 2606,
+    instrux + 2607,
+};
+
+static const struct itemplate * const itable_vex011F4[] = {
+    instrux + 2575,
+    instrux + 2576,
+};
+
+static const struct itemplate * const itable_vex011F5[] = {
+    instrux + 2523,
+    instrux + 2524,
+};
+
+static const struct itemplate * const itable_vex011F6[] = {
+    instrux + 2581,
+    instrux + 2582,
+};
+
+static const struct itemplate * const itable_vex011F7[] = {
+    instrux + 2237,
+};
+
+static const struct itemplate * const itable_vex011F8[] = {
+    instrux + 2632,
+    instrux + 2633,
+};
+
+static const struct itemplate * const itable_vex011F9[] = {
+    instrux + 2634,
+    instrux + 2635,
+};
+
+static const struct itemplate * const itable_vex011FA[] = {
+    instrux + 2636,
+    instrux + 2637,
+};
+
+static const struct itemplate * const itable_vex011FB[] = {
+    instrux + 2638,
+    instrux + 2639,
+};
+
+static const struct itemplate * const itable_vex011FC[] = {
+    instrux + 2387,
+    instrux + 2388,
+};
+
+static const struct itemplate * const itable_vex011FD[] = {
+    instrux + 2389,
+    instrux + 2390,
+};
+
+static const struct itemplate * const itable_vex011FE[] = {
+    instrux + 2391,
+    instrux + 2392,
+};
+
+static const struct itemplate * const itable_vex01210[] = {
+    instrux + 2340,
+    instrux + 2341,
+    instrux + 2342,
+};
+
+static const struct itemplate * const itable_vex01211[] = {
+    instrux + 2343,
+    instrux + 2344,
+    instrux + 2345,
+};
+
+static const struct itemplate * const itable_vex01212[] = {
+    instrux + 2338,
+};
+
+static const struct itemplate * const itable_vex01216[] = {
+    instrux + 2336,
+};
+
+static const struct itemplate * const itable_vex0122A[] = {
+    instrux + 2176,
+    instrux + 2177,
+    instrux + 2178,
+    instrux + 2179,
+};
+
+static const struct itemplate * const itable_vex0122C[] = {
+    instrux + 2192,
+    instrux + 2193,
+};
+
+static const struct itemplate * const itable_vex0122D[] = {
+    instrux + 2182,
+    instrux + 2183,
+};
+
+static const struct itemplate * const itable_vex01251[] = {
+    instrux + 2696,
+    instrux + 2697,
+};
+
+static const struct itemplate * const itable_vex01252[] = {
+    instrux + 2672,
+    instrux + 2673,
+};
+
+static const struct itemplate * const itable_vex01253[] = {
+    instrux + 2668,
+    instrux + 2669,
+};
+
+static const struct itemplate * const itable_vex01258[] = {
+    instrux + 1708,
+    instrux + 1709,
+};
+
+static const struct itemplate * const itable_vex01259[] = {
+    instrux + 2366,
+    instrux + 2367,
+};
+
+static const struct itemplate * const itable_vex0125A[] = {
+    instrux + 2180,
+    instrux + 2181,
+};
+
+static const struct itemplate * const itable_vex0125B[] = {
+    instrux + 2188,
+};
+
+static const struct itemplate * const itable_vex0125C[] = {
+    instrux + 2709,
+    instrux + 2710,
+};
+
+static const struct itemplate * const itable_vex0125D[] = {
+    instrux + 2268,
+    instrux + 2269,
+};
+
+static const struct itemplate * const itable_vex0125E[] = {
+    instrux + 2204,
+    instrux + 2205,
+};
+
+static const struct itemplate * const itable_vex0125F[] = {
+    instrux + 2256,
+    instrux + 2257,
+};
+
+static const struct itemplate * const itable_vex0126F[] = {
+    instrux + 2292,
+};
+
+static const struct itemplate * const itable_vex01270[] = {
+    instrux + 2586,
+};
+
+static const struct itemplate * const itable_vex0127E[] = {
+    instrux + 2278,
+};
+
+static const struct itemplate * const itable_vex0127F[] = {
+    instrux + 2293,
+};
+
+static const struct itemplate * const itable_vex012C2[] = {
+    instrux + 2084,
+    instrux + 2085,
+    instrux + 2086,
+    instrux + 2087,
+    instrux + 2088,
+    instrux + 2089,
+    instrux + 2090,
+    instrux + 2091,
+    instrux + 2092,
+    instrux + 2093,
+    instrux + 2094,
+    instrux + 2095,
+    instrux + 2096,
+    instrux + 2097,
+    instrux + 2098,
+    instrux + 2099,
+    instrux + 2100,
+    instrux + 2101,
+    instrux + 2102,
+    instrux + 2103,
+    instrux + 2104,
+    instrux + 2105,
+    instrux + 2106,
+    instrux + 2107,
+    instrux + 2108,
+    instrux + 2109,
+    instrux + 2110,
+    instrux + 2111,
+    instrux + 2112,
+    instrux + 2113,
+    instrux + 2114,
+    instrux + 2115,
+    instrux + 2116,
+    instrux + 2117,
+    instrux + 2118,
+    instrux + 2119,
+    instrux + 2120,
+    instrux + 2121,
+    instrux + 2122,
+    instrux + 2123,
+    instrux + 2124,
+    instrux + 2125,
+    instrux + 2126,
+    instrux + 2127,
+    instrux + 2128,
+    instrux + 2129,
+    instrux + 2130,
+    instrux + 2131,
+    instrux + 2132,
+    instrux + 2133,
+    instrux + 2134,
+    instrux + 2135,
+    instrux + 2136,
+    instrux + 2137,
+    instrux + 2138,
+    instrux + 2139,
+    instrux + 2140,
+    instrux + 2141,
+    instrux + 2142,
+    instrux + 2143,
+    instrux + 2144,
+    instrux + 2145,
+    instrux + 2146,
+    instrux + 2147,
+    instrux + 2148,
+    instrux + 2149,
+};
+
+static const struct itemplate * const itable_vex012E6[] = {
+    instrux + 2152,
+};
+
+static const struct itemplate * const itable_vex01310[] = {
+    instrux + 2330,
+    instrux + 2331,
+    instrux + 2332,
+};
+
+static const struct itemplate * const itable_vex01311[] = {
+    instrux + 2333,
+    instrux + 2334,
+    instrux + 2335,
+};
+
+static const struct itemplate * const itable_vex01312[] = {
+    instrux + 2284,
+};
+
+static const struct itemplate * const itable_vex0132A[] = {
+    instrux + 2172,
+    instrux + 2173,
+    instrux + 2174,
+    instrux + 2175,
+};
+
+static const struct itemplate * const itable_vex0132C[] = {
+    instrux + 2190,
+    instrux + 2191,
+};
+
+static const struct itemplate * const itable_vex0132D[] = {
+    instrux + 2168,
+    instrux + 2169,
+};
+
+static const struct itemplate * const itable_vex01351[] = {
+    instrux + 2694,
+    instrux + 2695,
+};
+
+static const struct itemplate * const itable_vex01358[] = {
+    instrux + 1706,
+    instrux + 1707,
+};
+
+static const struct itemplate * const itable_vex01359[] = {
+    instrux + 2364,
+    instrux + 2365,
+};
+
+static const struct itemplate * const itable_vex0135A[] = {
+    instrux + 2170,
+    instrux + 2171,
+};
+
+static const struct itemplate * const itable_vex0135C[] = {
+    instrux + 2707,
+    instrux + 2708,
+};
+
+static const struct itemplate * const itable_vex0135D[] = {
+    instrux + 2266,
+    instrux + 2267,
+};
+
+static const struct itemplate * const itable_vex0135E[] = {
+    instrux + 2202,
+    instrux + 2203,
+};
+
+static const struct itemplate * const itable_vex0135F[] = {
+    instrux + 2254,
+    instrux + 2255,
+};
+
+static const struct itemplate * const itable_vex01370[] = {
+    instrux + 2587,
+};
+
+static const struct itemplate * const itable_vex0137C[] = {
+    instrux + 2218,
+    instrux + 2219,
+};
+
+static const struct itemplate * const itable_vex0137D[] = {
+    instrux + 2226,
+    instrux + 2227,
+};
+
+static const struct itemplate * const itable_vex013C2[] = {
+    instrux + 2018,
+    instrux + 2019,
+    instrux + 2020,
+    instrux + 2021,
+    instrux + 2022,
+    instrux + 2023,
+    instrux + 2024,
+    instrux + 2025,
+    instrux + 2026,
+    instrux + 2027,
+    instrux + 2028,
+    instrux + 2029,
+    instrux + 2030,
+    instrux + 2031,
+    instrux + 2032,
+    instrux + 2033,
+    instrux + 2034,
+    instrux + 2035,
+    instrux + 2036,
+    instrux + 2037,
+    instrux + 2038,
+    instrux + 2039,
+    instrux + 2040,
+    instrux + 2041,
+    instrux + 2042,
+    instrux + 2043,
+    instrux + 2044,
+    instrux + 2045,
+    instrux + 2046,
+    instrux + 2047,
+    instrux + 2048,
+    instrux + 2049,
+    instrux + 2050,
+    instrux + 2051,
+    instrux + 2052,
+    instrux + 2053,
+    instrux + 2054,
+    instrux + 2055,
+    instrux + 2056,
+    instrux + 2057,
+    instrux + 2058,
+    instrux + 2059,
+    instrux + 2060,
+    instrux + 2061,
+    instrux + 2062,
+    instrux + 2063,
+    instrux + 2064,
+    instrux + 2065,
+    instrux + 2066,
+    instrux + 2067,
+    instrux + 2068,
+    instrux + 2069,
+    instrux + 2070,
+    instrux + 2071,
+    instrux + 2072,
+    instrux + 2073,
+    instrux + 2074,
+    instrux + 2075,
+    instrux + 2076,
+    instrux + 2077,
+    instrux + 2078,
+    instrux + 2079,
+    instrux + 2080,
+    instrux + 2081,
+    instrux + 2082,
+    instrux + 2083,
+};
+
+static const struct itemplate * const itable_vex013D0[] = {
+    instrux + 1714,
+    instrux + 1715,
+};
+
+static const struct itemplate * const itable_vex013E6[] = {
+    instrux + 2156,
+    instrux + 2157,
+};
+
+static const struct itemplate * const itable_vex013F0[] = {
+    instrux + 2233,
+};
+
+static const struct itemplate * const itable_vex01410[] = {
+    instrux + 2352,
+};
+
+static const struct itemplate * const itable_vex01411[] = {
+    instrux + 2353,
+};
+
+static const struct itemplate * const itable_vex01414[] = {
+    instrux + 2731,
+    instrux + 2732,
+};
+
+static const struct itemplate * const itable_vex01415[] = {
+    instrux + 2723,
+    instrux + 2724,
+};
+
+static const struct itemplate * const itable_vex01428[] = {
+    instrux + 2276,
+};
+
+static const struct itemplate * const itable_vex01429[] = {
+    instrux + 2277,
+};
+
+static const struct itemplate * const itable_vex0142B[] = {
+    instrux + 2329,
+};
+
+static const struct itemplate * const itable_vex01450[] = {
+    instrux + 2320,
+    instrux + 2321,
+};
+
+static const struct itemplate * const itable_vex01451[] = {
+    instrux + 2693,
+};
+
+static const struct itemplate * const itable_vex01452[] = {
+    instrux + 2671,
+};
+
+static const struct itemplate * const itable_vex01453[] = {
+    instrux + 2667,
+};
+
+static const struct itemplate * const itable_vex01454[] = {
+    instrux + 1724,
+    instrux + 1725,
+};
+
+static const struct itemplate * const itable_vex01455[] = {
+    instrux + 1732,
+    instrux + 1733,
+};
+
+static const struct itemplate * const itable_vex01456[] = {
+    instrux + 2374,
+    instrux + 2375,
+};
+
+static const struct itemplate * const itable_vex01457[] = {
+    instrux + 2739,
+    instrux + 2740,
+};
+
+static const struct itemplate * const itable_vex01458[] = {
+    instrux + 1704,
+    instrux + 1705,
+};
+
+static const struct itemplate * const itable_vex01459[] = {
+    instrux + 2362,
+    instrux + 2363,
+};
+
+static const struct itemplate * const itable_vex0145A[] = {
+    instrux + 2167,
+};
+
+static const struct itemplate * const itable_vex0145B[] = {
+    instrux + 2155,
+};
+
+static const struct itemplate * const itable_vex0145C[] = {
+    instrux + 2705,
+    instrux + 2706,
+};
+
+static const struct itemplate * const itable_vex0145D[] = {
+    instrux + 2264,
+    instrux + 2265,
+};
+
+static const struct itemplate * const itable_vex0145E[] = {
+    instrux + 2200,
+    instrux + 2201,
+};
+
+static const struct itemplate * const itable_vex0145F[] = {
+    instrux + 2252,
+    instrux + 2253,
+};
+
+static const struct itemplate * const itable_vex01477[] = {
+    instrux + 2741,
+};
+
+static const struct itemplate * const itable_vex014C2[] = {
+    instrux + 1888,
+    instrux + 1889,
+    instrux + 1892,
+    instrux + 1893,
+    instrux + 1896,
+    instrux + 1897,
+    instrux + 1900,
+    instrux + 1901,
+    instrux + 1904,
+    instrux + 1905,
+    instrux + 1908,
+    instrux + 1909,
+    instrux + 1912,
+    instrux + 1913,
+    instrux + 1916,
+    instrux + 1917,
+    instrux + 1920,
+    instrux + 1921,
+    instrux + 1924,
+    instrux + 1925,
+    instrux + 1928,
+    instrux + 1929,
+    instrux + 1932,
+    instrux + 1933,
+    instrux + 1936,
+    instrux + 1937,
+    instrux + 1940,
+    instrux + 1941,
+    instrux + 1944,
+    instrux + 1945,
+    instrux + 1948,
+    instrux + 1949,
+    instrux + 1952,
+    instrux + 1953,
+    instrux + 1956,
+    instrux + 1957,
+    instrux + 1960,
+    instrux + 1961,
+    instrux + 1964,
+    instrux + 1965,
+    instrux + 1968,
+    instrux + 1969,
+    instrux + 1972,
+    instrux + 1973,
+    instrux + 1976,
+    instrux + 1977,
+    instrux + 1980,
+    instrux + 1981,
+    instrux + 1984,
+    instrux + 1985,
+    instrux + 1988,
+    instrux + 1989,
+    instrux + 1992,
+    instrux + 1993,
+    instrux + 1996,
+    instrux + 1997,
+    instrux + 2000,
+    instrux + 2001,
+    instrux + 2004,
+    instrux + 2005,
+    instrux + 2008,
+    instrux + 2009,
+    instrux + 2012,
+    instrux + 2013,
+    instrux + 2016,
+    instrux + 2017,
+};
+
+static const struct itemplate * const itable_vex014C6[] = {
+    instrux + 2688,
+    instrux + 2689,
+};
+
+static const struct itemplate * const itable_vex01510[] = {
+    instrux + 2348,
+};
+
+static const struct itemplate * const itable_vex01511[] = {
+    instrux + 2349,
+};
+
+static const struct itemplate * const itable_vex01514[] = {
+    instrux + 2727,
+    instrux + 2728,
+};
+
+static const struct itemplate * const itable_vex01515[] = {
+    instrux + 2719,
+    instrux + 2720,
+};
+
+static const struct itemplate * const itable_vex01528[] = {
+    instrux + 2272,
+};
+
+static const struct itemplate * const itable_vex01529[] = {
+    instrux + 2273,
+};
+
+static const struct itemplate * const itable_vex0152B[] = {
+    instrux + 2327,
+};
+
+static const struct itemplate * const itable_vex01550[] = {
+    instrux + 2316,
+    instrux + 2317,
+};
+
+static const struct itemplate * const itable_vex01551[] = {
+    instrux + 2691,
+};
+
+static const struct itemplate * const itable_vex01554[] = {
+    instrux + 1720,
+    instrux + 1721,
+};
+
+static const struct itemplate * const itable_vex01555[] = {
+    instrux + 1728,
+    instrux + 1729,
+};
+
+static const struct itemplate * const itable_vex01556[] = {
+    instrux + 2370,
+    instrux + 2371,
+};
+
+static const struct itemplate * const itable_vex01557[] = {
+    instrux + 2735,
+    instrux + 2736,
+};
+
+static const struct itemplate * const itable_vex01558[] = {
+    instrux + 1700,
+    instrux + 1701,
+};
+
+static const struct itemplate * const itable_vex01559[] = {
+    instrux + 2358,
+    instrux + 2359,
+};
+
+static const struct itemplate * const itable_vex0155A[] = {
+    instrux + 2162,
+    instrux + 2163,
+};
+
+static const struct itemplate * const itable_vex0155B[] = {
+    instrux + 2165,
+};
+
+static const struct itemplate * const itable_vex0155C[] = {
+    instrux + 2701,
+    instrux + 2702,
+};
+
+static const struct itemplate * const itable_vex0155D[] = {
+    instrux + 2260,
+    instrux + 2261,
+};
+
+static const struct itemplate * const itable_vex0155E[] = {
+    instrux + 2196,
+    instrux + 2197,
+};
+
+static const struct itemplate * const itable_vex0155F[] = {
+    instrux + 2248,
+    instrux + 2249,
+};
+
+static const struct itemplate * const itable_vex0156F[] = {
+    instrux + 2288,
+    instrux + 2290,
+};
+
+static const struct itemplate * const itable_vex0157C[] = {
+    instrux + 2216,
+    instrux + 2217,
+};
+
+static const struct itemplate * const itable_vex0157D[] = {
+    instrux + 2224,
+    instrux + 2225,
+};
+
+static const struct itemplate * const itable_vex0157F[] = {
+    instrux + 2289,
+    instrux + 2291,
+};
+
+static const struct itemplate * const itable_vex015C2[] = {
+    instrux + 1756,
+    instrux + 1757,
+    instrux + 1760,
+    instrux + 1761,
+    instrux + 1764,
+    instrux + 1765,
+    instrux + 1768,
+    instrux + 1769,
+    instrux + 1772,
+    instrux + 1773,
+    instrux + 1776,
+    instrux + 1777,
+    instrux + 1780,
+    instrux + 1781,
+    instrux + 1784,
+    instrux + 1785,
+    instrux + 1788,
+    instrux + 1789,
+    instrux + 1792,
+    instrux + 1793,
+    instrux + 1796,
+    instrux + 1797,
+    instrux + 1800,
+    instrux + 1801,
+    instrux + 1804,
+    instrux + 1805,
+    instrux + 1808,
+    instrux + 1809,
+    instrux + 1812,
+    instrux + 1813,
+    instrux + 1816,
+    instrux + 1817,
+    instrux + 1820,
+    instrux + 1821,
+    instrux + 1824,
+    instrux + 1825,
+    instrux + 1828,
+    instrux + 1829,
+    instrux + 1832,
+    instrux + 1833,
+    instrux + 1836,
+    instrux + 1837,
+    instrux + 1840,
+    instrux + 1841,
+    instrux + 1844,
+    instrux + 1845,
+    instrux + 1848,
+    instrux + 1849,
+    instrux + 1852,
+    instrux + 1853,
+    instrux + 1856,
+    instrux + 1857,
+    instrux + 1860,
+    instrux + 1861,
+    instrux + 1864,
+    instrux + 1865,
+    instrux + 1868,
+    instrux + 1869,
+    instrux + 1872,
+    instrux + 1873,
+    instrux + 1876,
+    instrux + 1877,
+    instrux + 1880,
+    instrux + 1881,
+    instrux + 1884,
+    instrux + 1885,
+};
+
+static const struct itemplate * const itable_vex015C6[] = {
+    instrux + 2684,
+    instrux + 2685,
+};
+
+static const struct itemplate * const itable_vex015D0[] = {
+    instrux + 1712,
+    instrux + 1713,
+};
+
+static const struct itemplate * const itable_vex015E6[] = {
+    instrux + 2186,
+    instrux + 2187,
+};
+
+static const struct itemplate * const itable_vex015E7[] = {
+    instrux + 2323,
+    instrux + 2324,
+};
+
+static const struct itemplate * const itable_vex01612[] = {
+    instrux + 2339,
+};
+
+static const struct itemplate * const itable_vex01616[] = {
+    instrux + 2337,
+};
+
+static const struct itemplate * const itable_vex0165B[] = {
+    instrux + 2189,
+};
+
+static const struct itemplate * const itable_vex0166F[] = {
+    instrux + 2294,
+    instrux + 2296,
+};
+
+static const struct itemplate * const itable_vex0167F[] = {
+    instrux + 2295,
+    instrux + 2297,
+};
+
+static const struct itemplate * const itable_vex016E6[] = {
+    instrux + 2153,
+};
+
+static const struct itemplate * const itable_vex01712[] = {
+    instrux + 2285,
+};
+
+static const struct itemplate * const itable_vex0177C[] = {
+    instrux + 2220,
+    instrux + 2221,
+};
+
+static const struct itemplate * const itable_vex0177D[] = {
+    instrux + 2228,
+    instrux + 2229,
+};
+
+static const struct itemplate * const itable_vex017D0[] = {
+    instrux + 1716,
+    instrux + 1717,
+};
+
+static const struct itemplate * const itable_vex017E6[] = {
+    instrux + 2158,
+    instrux + 2159,
+};
+
+static const struct itemplate * const itable_vex017F0[] = {
+    instrux + 2234,
+    instrux + 2235,
+};
+
+static const struct itemplate * const itable_vex02100[] = {
+    instrux + 2583,
+    instrux + 2584,
+};
+
+static const struct itemplate * const itable_vex02101[] = {
+    instrux + 2490,
+    instrux + 2491,
+};
+
+static const struct itemplate * const itable_vex02102[] = {
+    instrux + 2492,
+    instrux + 2493,
+};
+
+static const struct itemplate * const itable_vex02103[] = {
+    instrux + 2494,
+    instrux + 2495,
+};
+
+static const struct itemplate * const itable_vex02104[] = {
+    instrux + 2525,
+    instrux + 2526,
+};
+
+static const struct itemplate * const itable_vex02105[] = {
+    instrux + 2497,
+    instrux + 2498,
+};
+
+static const struct itemplate * const itable_vex02106[] = {
+    instrux + 2499,
+    instrux + 2500,
+};
+
+static const struct itemplate * const itable_vex02107[] = {
+    instrux + 2501,
+    instrux + 2502,
+};
+
+static const struct itemplate * const itable_vex02108[] = {
+    instrux + 2588,
+    instrux + 2589,
+};
+
+static const struct itemplate * const itable_vex02109[] = {
+    instrux + 2590,
+    instrux + 2591,
+};
+
+static const struct itemplate * const itable_vex0210A[] = {
+    instrux + 2592,
+    instrux + 2593,
+};
+
+static const struct itemplate * const itable_vex0210B[] = {
+    instrux + 2567,
+    instrux + 2568,
+};
+
+static const struct itemplate * const itable_vex0210C[] = {
+    instrux + 2457,
+};
+
+static const struct itemplate * const itable_vex0210D[] = {
+    instrux + 2437,
+};
+
+static const struct itemplate * const itable_vex0210E[] = {
+    instrux + 2711,
+};
+
+static const struct itemplate * const itable_vex0210F[] = {
+    instrux + 2713,
+};
+
+static const struct itemplate * const itable_vex02114[] = {
+    instrux + 1747,
+};
+
+static const struct itemplate * const itable_vex02115[] = {
+    instrux + 1743,
+};
+
+static const struct itemplate * const itable_vex02117[] = {
+    instrux + 2630,
+};
+
+static const struct itemplate * const itable_vex02118[] = {
+    instrux + 1750,
+};
+
+static const struct itemplate * const itable_vex0211C[] = {
+    instrux + 2376,
+};
+
+static const struct itemplate * const itable_vex0211D[] = {
+    instrux + 2377,
+};
+
+static const struct itemplate * const itable_vex0211E[] = {
+    instrux + 2378,
+};
+
+static const struct itemplate * const itable_vex02120[] = {
+    instrux + 2553,
+};
+
+static const struct itemplate * const itable_vex02121[] = {
+    instrux + 2554,
+};
+
+static const struct itemplate * const itable_vex02122[] = {
+    instrux + 2555,
+};
+
+static const struct itemplate * const itable_vex02123[] = {
+    instrux + 2556,
+};
+
+static const struct itemplate * const itable_vex02124[] = {
+    instrux + 2557,
+};
+
+static const struct itemplate * const itable_vex02125[] = {
+    instrux + 2558,
+};
+
+static const struct itemplate * const itable_vex02128[] = {
+    instrux + 2577,
+    instrux + 2578,
+};
+
+static const struct itemplate * const itable_vex0212A[] = {
+    instrux + 2325,
+};
+
+static const struct itemplate * const itable_vex0212B[] = {
+    instrux + 2385,
+    instrux + 2386,
+};
+
+static const struct itemplate * const itable_vex0212C[] = {
+    instrux + 2238,
+};
+
+static const struct itemplate * const itable_vex0212D[] = {
+    instrux + 2242,
+};
+
+static const struct itemplate * const itable_vex0212E[] = {
+    instrux + 2240,
+};
+
+static const struct itemplate * const itable_vex0212F[] = {
+    instrux + 2244,
+};
+
+static const struct itemplate * const itable_vex02130[] = {
+    instrux + 2559,
+};
+
+static const struct itemplate * const itable_vex02131[] = {
+    instrux + 2560,
+};
+
+static const struct itemplate * const itable_vex02132[] = {
+    instrux + 2561,
+};
+
+static const struct itemplate * const itable_vex02133[] = {
+    instrux + 2562,
+};
+
+static const struct itemplate * const itable_vex02134[] = {
+    instrux + 2563,
+};
+
+static const struct itemplate * const itable_vex02135[] = {
+    instrux + 2564,
+};
+
+static const struct itemplate * const itable_vex02138[] = {
+    instrux + 2539,
+    instrux + 2540,
+};
+
+static const struct itemplate * const itable_vex02139[] = {
+    instrux + 2543,
+    instrux + 2544,
+};
+
+static const struct itemplate * const itable_vex0213A[] = {
+    instrux + 2547,
+    instrux + 2548,
+};
+
+static const struct itemplate * const itable_vex0213B[] = {
+    instrux + 2549,
+    instrux + 2550,
+};
+
+static const struct itemplate * const itable_vex0213C[] = {
+    instrux + 2527,
+    instrux + 2528,
+};
+
+static const struct itemplate * const itable_vex0213D[] = {
+    instrux + 2531,
+    instrux + 2532,
+};
+
+static const struct itemplate * const itable_vex0213E[] = {
+    instrux + 2535,
+    instrux + 2536,
+};
+
+static const struct itemplate * const itable_vex0213F[] = {
+    instrux + 2537,
+    instrux + 2538,
+};
+
+static const struct itemplate * const itable_vex02140[] = {
+    instrux + 2573,
+    instrux + 2574,
+};
+
+static const struct itemplate * const itable_vex02141[] = {
+    instrux + 2496,
+};
+
+static const struct itemplate * const itable_vex02196[] = {
+    instrux + 2782,
+    instrux + 2784,
+    instrux + 2786,
+    instrux + 2788,
+};
+
+static const struct itemplate * const itable_vex02197[] = {
+    instrux + 2830,
+    instrux + 2832,
+    instrux + 2834,
+    instrux + 2836,
+};
+
+static const struct itemplate * const itable_vex02198[] = {
+    instrux + 2758,
+    instrux + 2760,
+    instrux + 2762,
+    instrux + 2764,
+};
+
+static const struct itemplate * const itable_vex02199[] = {
+    instrux + 2902,
+    instrux + 2903,
+    instrux + 2904,
+    instrux + 2905,
+};
+
+static const struct itemplate * const itable_vex0219A[] = {
+    instrux + 2806,
+    instrux + 2808,
+    instrux + 2810,
+    instrux + 2812,
+};
+
+static const struct itemplate * const itable_vex0219B[] = {
+    instrux + 2914,
+    instrux + 2915,
+    instrux + 2916,
+    instrux + 2917,
+};
+
+static const struct itemplate * const itable_vex0219C[] = {
+    instrux + 2854,
+    instrux + 2856,
+    instrux + 2858,
+    instrux + 2860,
+};
+
+static const struct itemplate * const itable_vex0219D[] = {
+    instrux + 2926,
+    instrux + 2927,
+    instrux + 2928,
+    instrux + 2929,
+};
+
+static const struct itemplate * const itable_vex0219E[] = {
+    instrux + 2878,
+    instrux + 2880,
+    instrux + 2882,
+    instrux + 2884,
+};
+
+static const struct itemplate * const itable_vex0219F[] = {
+    instrux + 2938,
+    instrux + 2939,
+    instrux + 2940,
+    instrux + 2941,
+};
+
+static const struct itemplate * const itable_vex021A6[] = {
+    instrux + 2790,
+    instrux + 2792,
+    instrux + 2794,
+    instrux + 2796,
+};
+
+static const struct itemplate * const itable_vex021A7[] = {
+    instrux + 2838,
+    instrux + 2840,
+    instrux + 2842,
+    instrux + 2844,
+};
+
+static const struct itemplate * const itable_vex021A8[] = {
+    instrux + 2766,
+    instrux + 2768,
+    instrux + 2770,
+    instrux + 2772,
+};
+
+static const struct itemplate * const itable_vex021A9[] = {
+    instrux + 2906,
+    instrux + 2907,
+    instrux + 2908,
+    instrux + 2909,
+};
+
+static const struct itemplate * const itable_vex021AA[] = {
+    instrux + 2814,
+    instrux + 2816,
+    instrux + 2818,
+    instrux + 2820,
+};
+
+static const struct itemplate * const itable_vex021AB[] = {
+    instrux + 2918,
+    instrux + 2919,
+    instrux + 2920,
+    instrux + 2921,
+};
+
+static const struct itemplate * const itable_vex021AC[] = {
+    instrux + 2862,
+    instrux + 2864,
+    instrux + 2866,
+    instrux + 2868,
+};
+
+static const struct itemplate * const itable_vex021AD[] = {
+    instrux + 2930,
+    instrux + 2931,
+    instrux + 2932,
+    instrux + 2933,
+};
+
+static const struct itemplate * const itable_vex021AE[] = {
+    instrux + 2886,
+    instrux + 2888,
+    instrux + 2890,
+    instrux + 2892,
+};
+
+static const struct itemplate * const itable_vex021AF[] = {
+    instrux + 2942,
+    instrux + 2943,
+    instrux + 2944,
+    instrux + 2945,
+};
+
+static const struct itemplate * const itable_vex021B6[] = {
+    instrux + 2798,
+    instrux + 2800,
+    instrux + 2802,
+    instrux + 2804,
+};
+
+static const struct itemplate * const itable_vex021B7[] = {
+    instrux + 2846,
+    instrux + 2848,
+    instrux + 2850,
+    instrux + 2852,
+};
+
+static const struct itemplate * const itable_vex021B8[] = {
+    instrux + 2774,
+    instrux + 2776,
+    instrux + 2778,
+    instrux + 2780,
+};
+
+static const struct itemplate * const itable_vex021B9[] = {
+    instrux + 2910,
+    instrux + 2911,
+    instrux + 2912,
+    instrux + 2913,
+};
+
+static const struct itemplate * const itable_vex021BA[] = {
+    instrux + 2822,
+    instrux + 2824,
+    instrux + 2826,
+    instrux + 2828,
+};
+
+static const struct itemplate * const itable_vex021BB[] = {
+    instrux + 2922,
+    instrux + 2923,
+    instrux + 2924,
+    instrux + 2925,
+};
+
+static const struct itemplate * const itable_vex021BC[] = {
+    instrux + 2870,
+    instrux + 2872,
+    instrux + 2874,
+    instrux + 2876,
+};
+
+static const struct itemplate * const itable_vex021BD[] = {
+    instrux + 2934,
+    instrux + 2935,
+    instrux + 2936,
+    instrux + 2937,
+};
+
+static const struct itemplate * const itable_vex021BE[] = {
+    instrux + 2894,
+    instrux + 2896,
+    instrux + 2898,
+    instrux + 2900,
+};
+
+static const struct itemplate * const itable_vex021BF[] = {
+    instrux + 2946,
+    instrux + 2947,
+    instrux + 2948,
+    instrux + 2949,
+};
+
+static const struct itemplate * const itable_vex021DB[] = {
+    instrux + 1696,
+};
+
+static const struct itemplate * const itable_vex021DC[] = {
+    instrux + 1688,
+    instrux + 1689,
+};
+
+static const struct itemplate * const itable_vex021DD[] = {
+    instrux + 1690,
+    instrux + 1691,
+};
+
+static const struct itemplate * const itable_vex021DE[] = {
+    instrux + 1692,
+    instrux + 1693,
+};
+
+static const struct itemplate * const itable_vex021DF[] = {
+    instrux + 1694,
+    instrux + 1695,
+};
+
+static const struct itemplate * const itable_vex0250C[] = {
+    instrux + 2458,
+};
+
+static const struct itemplate * const itable_vex0250D[] = {
+    instrux + 2438,
+};
+
+static const struct itemplate * const itable_vex0250E[] = {
+    instrux + 2712,
+};
+
+static const struct itemplate * const itable_vex0250F[] = {
+    instrux + 2714,
+};
+
+static const struct itemplate * const itable_vex02514[] = {
+    instrux + 1749,
+};
+
+static const struct itemplate * const itable_vex02515[] = {
+    instrux + 1745,
+};
+
+static const struct itemplate * const itable_vex02517[] = {
+    instrux + 2631,
+};
+
+static const struct itemplate * const itable_vex02518[] = {
+    instrux + 1751,
+};
+
+static const struct itemplate * const itable_vex02519[] = {
+    instrux + 1752,
+};
+
+static const struct itemplate * const itable_vex0251A[] = {
+    instrux + 1753,
+};
+
+static const struct itemplate * const itable_vex0252C[] = {
+    instrux + 2239,
+};
+
+static const struct itemplate * const itable_vex0252D[] = {
+    instrux + 2243,
+};
+
+static const struct itemplate * const itable_vex0252E[] = {
+    instrux + 2241,
+};
+
+static const struct itemplate * const itable_vex0252F[] = {
+    instrux + 2245,
+};
+
+static const struct itemplate * const itable_vex02596[] = {
+    instrux + 2783,
+    instrux + 2785,
+    instrux + 2787,
+    instrux + 2789,
+};
+
+static const struct itemplate * const itable_vex02597[] = {
+    instrux + 2831,
+    instrux + 2833,
+    instrux + 2835,
+    instrux + 2837,
+};
+
+static const struct itemplate * const itable_vex02598[] = {
+    instrux + 2759,
+    instrux + 2761,
+    instrux + 2763,
+    instrux + 2765,
+};
+
+static const struct itemplate * const itable_vex0259A[] = {
+    instrux + 2807,
+    instrux + 2809,
+    instrux + 2811,
+    instrux + 2813,
+};
+
+static const struct itemplate * const itable_vex0259C[] = {
+    instrux + 2855,
+    instrux + 2857,
+    instrux + 2859,
+    instrux + 2861,
+};
+
+static const struct itemplate * const itable_vex0259E[] = {
+    instrux + 2879,
+    instrux + 2881,
+    instrux + 2883,
+    instrux + 2885,
+};
+
+static const struct itemplate * const itable_vex025A6[] = {
+    instrux + 2791,
+    instrux + 2793,
+    instrux + 2795,
+    instrux + 2797,
+};
+
+static const struct itemplate * const itable_vex025A7[] = {
+    instrux + 2839,
+    instrux + 2841,
+    instrux + 2843,
+    instrux + 2845,
+};
+
+static const struct itemplate * const itable_vex025A8[] = {
+    instrux + 2767,
+    instrux + 2769,
+    instrux + 2771,
+    instrux + 2773,
+};
+
+static const struct itemplate * const itable_vex025AA[] = {
+    instrux + 2815,
+    instrux + 2817,
+    instrux + 2819,
+    instrux + 2821,
+};
+
+static const struct itemplate * const itable_vex025AC[] = {
+    instrux + 2863,
+    instrux + 2865,
+    instrux + 2867,
+    instrux + 2869,
+};
+
+static const struct itemplate * const itable_vex025AE[] = {
+    instrux + 2887,
+    instrux + 2889,
+    instrux + 2891,
+    instrux + 2893,
+};
+
+static const struct itemplate * const itable_vex025B6[] = {
+    instrux + 2799,
+    instrux + 2801,
+    instrux + 2803,
+    instrux + 2805,
+};
+
+static const struct itemplate * const itable_vex025B7[] = {
+    instrux + 2847,
+    instrux + 2849,
+    instrux + 2851,
+    instrux + 2853,
+};
+
+static const struct itemplate * const itable_vex025B8[] = {
+    instrux + 2775,
+    instrux + 2777,
+    instrux + 2779,
+    instrux + 2781,
+};
+
+static const struct itemplate * const itable_vex025BA[] = {
+    instrux + 2823,
+    instrux + 2825,
+    instrux + 2827,
+    instrux + 2829,
+};
+
+static const struct itemplate * const itable_vex025BC[] = {
+    instrux + 2871,
+    instrux + 2873,
+    instrux + 2875,
+    instrux + 2877,
+};
+
+static const struct itemplate * const itable_vex025BE[] = {
+    instrux + 2895,
+    instrux + 2897,
+    instrux + 2899,
+    instrux + 2901,
+};
+
+static const struct itemplate * const itable_vex03104[] = {
+    instrux + 2459,
+};
+
+static const struct itemplate * const itable_vex03105[] = {
+    instrux + 2439,
+};
+
+static const struct itemplate * const itable_vex03108[] = {
+    instrux + 2676,
+};
+
+static const struct itemplate * const itable_vex03109[] = {
+    instrux + 2674,
+};
+
+static const struct itemplate * const itable_vex0310A[] = {
+    instrux + 2680,
+    instrux + 2681,
+};
+
+static const struct itemplate * const itable_vex0310B[] = {
+    instrux + 2678,
+    instrux + 2679,
+};
+
+static const struct itemplate * const itable_vex0310C[] = {
+    instrux + 1738,
+    instrux + 1739,
+};
+
+static const struct itemplate * const itable_vex0310D[] = {
+    instrux + 1734,
+    instrux + 1735,
+};
+
+static const struct itemplate * const itable_vex0310E[] = {
+    instrux + 2415,
+    instrux + 2416,
+};
+
+static const struct itemplate * const itable_vex0310F[] = {
+    instrux + 2403,
+    instrux + 2404,
+};
+
+static const struct itemplate * const itable_vex03114[] = {
+    instrux + 2478,
+    instrux + 2479,
+    instrux + 2480,
+};
+
+static const struct itemplate * const itable_vex03115[] = {
+    instrux + 2484,
+    instrux + 2485,
+    instrux + 2486,
+};
+
+static const struct itemplate * const itable_vex03116[] = {
+    instrux + 2487,
+    instrux + 2488,
+    instrux + 2489,
+};
+
+static const struct itemplate * const itable_vex03117[] = {
+    instrux + 2213,
+};
+
+static const struct itemplate * const itable_vex03120[] = {
+    instrux + 2503,
+    instrux + 2504,
+    instrux + 2505,
+    instrux + 2506,
+    instrux + 2507,
+    instrux + 2508,
+};
+
+static const struct itemplate * const itable_vex03121[] = {
+    instrux + 2231,
+    instrux + 2232,
+};
+
+static const struct itemplate * const itable_vex03122[] = {
+    instrux + 2515,
+    instrux + 2516,
+    instrux + 2517,
+    instrux + 2518,
+    instrux + 2519,
+    instrux + 2520,
+    instrux + 2521,
+    instrux + 2522,
+};
+
+static const struct itemplate * const itable_vex03140[] = {
+    instrux + 2208,
+    instrux + 2209,
+};
+
+static const struct itemplate * const itable_vex03141[] = {
+    instrux + 2206,
+    instrux + 2207,
+};
+
+static const struct itemplate * const itable_vex03142[] = {
+    instrux + 2354,
+    instrux + 2355,
+};
+
+static const struct itemplate * const itable_vex03144[] = {
+    instrux + 2748,
+    instrux + 2749,
+    instrux + 2750,
+    instrux + 2751,
+    instrux + 2752,
+    instrux + 2753,
+    instrux + 2754,
+    instrux + 2755,
+    instrux + 2756,
+    instrux + 2757,
+};
+
+static const struct itemplate * const itable_vex03148[] = {
+    instrux + 2461,
+    instrux + 2462,
+    instrux + 2465,
+    instrux + 2466,
+    instrux + 2469,
+    instrux + 2470,
+    instrux + 2473,
+    instrux + 2474,
+};
+
+static const struct itemplate * const itable_vex03149[] = {
+    instrux + 2441,
+    instrux + 2442,
+    instrux + 2445,
+    instrux + 2446,
+    instrux + 2449,
+    instrux + 2450,
+    instrux + 2453,
+    instrux + 2454,
+};
+
+static const struct itemplate * const itable_vex0314A[] = {
+    instrux + 1746,
+};
+
+static const struct itemplate * const itable_vex0314B[] = {
+    instrux + 1742,
+};
+
+static const struct itemplate * const itable_vex0314C[] = {
+    instrux + 2413,
+    instrux + 2414,
+};
+
+static const struct itemplate * const itable_vex0315C[] = {
+    instrux + 3013,
+    instrux + 3014,
+    instrux + 3017,
+    instrux + 3018,
+};
+
+static const struct itemplate * const itable_vex0315D[] = {
+    instrux + 3005,
+    instrux + 3006,
+    instrux + 3009,
+    instrux + 3010,
+};
+
+static const struct itemplate * const itable_vex0315E[] = {
+    instrux + 3029,
+    instrux + 3030,
+    instrux + 3033,
+    instrux + 3034,
+};
+
+static const struct itemplate * const itable_vex0315F[] = {
+    instrux + 3021,
+    instrux + 3022,
+    instrux + 3025,
+    instrux + 3026,
+};
+
+static const struct itemplate * const itable_vex03160[] = {
+    instrux + 2418,
+};
+
+static const struct itemplate * const itable_vex03161[] = {
+    instrux + 2417,
+};
+
+static const struct itemplate * const itable_vex03162[] = {
+    instrux + 2420,
+};
+
+static const struct itemplate * const itable_vex03163[] = {
+    instrux + 2419,
+};
+
+static const struct itemplate * const itable_vex03168[] = {
+    instrux + 2989,
+    instrux + 2990,
+    instrux + 2993,
+    instrux + 2994,
+};
+
+static const struct itemplate * const itable_vex03169[] = {
+    instrux + 2981,
+    instrux + 2982,
+    instrux + 2985,
+    instrux + 2986,
+};
+
+static const struct itemplate * const itable_vex0316A[] = {
+    instrux + 3001,
+    instrux + 3002,
+    instrux + 3003,
+    instrux + 3004,
+};
+
+static const struct itemplate * const itable_vex0316B[] = {
+    instrux + 2997,
+    instrux + 2998,
+    instrux + 2999,
+    instrux + 3000,
+};
+
+static const struct itemplate * const itable_vex0316C[] = {
+    instrux + 3045,
+    instrux + 3046,
+    instrux + 3049,
+    instrux + 3050,
+};
+
+static const struct itemplate * const itable_vex0316D[] = {
+    instrux + 3037,
+    instrux + 3038,
+    instrux + 3041,
+    instrux + 3042,
+};
+
+static const struct itemplate * const itable_vex0316E[] = {
+    instrux + 3057,
+    instrux + 3058,
+    instrux + 3059,
+    instrux + 3060,
+};
+
+static const struct itemplate * const itable_vex0316F[] = {
+    instrux + 3053,
+    instrux + 3054,
+    instrux + 3055,
+    instrux + 3056,
+};
+
+static const struct itemplate * const itable_vex03178[] = {
+    instrux + 3069,
+    instrux + 3070,
+    instrux + 3073,
+    instrux + 3074,
+};
+
+static const struct itemplate * const itable_vex03179[] = {
+    instrux + 3061,
+    instrux + 3062,
+    instrux + 3065,
+    instrux + 3066,
+};
+
+static const struct itemplate * const itable_vex0317A[] = {
+    instrux + 3081,
+    instrux + 3082,
+    instrux + 3083,
+    instrux + 3084,
+};
+
+static const struct itemplate * const itable_vex0317B[] = {
+    instrux + 3077,
+    instrux + 3078,
+    instrux + 3079,
+    instrux + 3080,
+};
+
+static const struct itemplate * const itable_vex0317C[] = {
+    instrux + 3093,
+    instrux + 3094,
+    instrux + 3097,
+    instrux + 3098,
+};
+
+static const struct itemplate * const itable_vex0317D[] = {
+    instrux + 3085,
+    instrux + 3086,
+    instrux + 3089,
+    instrux + 3090,
+};
+
+static const struct itemplate * const itable_vex0317E[] = {
+    instrux + 3105,
+    instrux + 3106,
+    instrux + 3107,
+    instrux + 3108,
+};
+
+static const struct itemplate * const itable_vex0317F[] = {
+    instrux + 3101,
+    instrux + 3102,
+    instrux + 3103,
+    instrux + 3104,
+};
+
+static const struct itemplate * const itable_vex031DF[] = {
+    instrux + 1697,
+};
+
+static const struct itemplate * const itable_vex03504[] = {
+    instrux + 2460,
+};
+
+static const struct itemplate * const itable_vex03505[] = {
+    instrux + 2440,
+};
+
+static const struct itemplate * const itable_vex03506[] = {
+    instrux + 2477,
+};
+
+static const struct itemplate * const itable_vex03508[] = {
+    instrux + 2677,
+};
+
+static const struct itemplate * const itable_vex03509[] = {
+    instrux + 2675,
+};
+
+static const struct itemplate * const itable_vex0350C[] = {
+    instrux + 1740,
+    instrux + 1741,
+};
+
+static const struct itemplate * const itable_vex0350D[] = {
+    instrux + 1736,
+    instrux + 1737,
+};
+
+static const struct itemplate * const itable_vex03518[] = {
+    instrux + 2230,
+};
+
+static const struct itemplate * const itable_vex03519[] = {
+    instrux + 2212,
+};
+
+static const struct itemplate * const itable_vex03540[] = {
+    instrux + 2210,
+    instrux + 2211,
+};
+
+static const struct itemplate * const itable_vex03548[] = {
+    instrux + 2463,
+    instrux + 2464,
+    instrux + 2467,
+    instrux + 2468,
+    instrux + 2471,
+    instrux + 2472,
+    instrux + 2475,
+    instrux + 2476,
+};
+
+static const struct itemplate * const itable_vex03549[] = {
+    instrux + 2443,
+    instrux + 2444,
+    instrux + 2447,
+    instrux + 2448,
+    instrux + 2451,
+    instrux + 2452,
+    instrux + 2455,
+    instrux + 2456,
+};
+
+static const struct itemplate * const itable_vex0354A[] = {
+    instrux + 1748,
+};
+
+static const struct itemplate * const itable_vex0354B[] = {
+    instrux + 1744,
+};
+
+static const struct itemplate * const itable_vex0355C[] = {
+    instrux + 3015,
+    instrux + 3016,
+    instrux + 3019,
+    instrux + 3020,
+};
+
+static const struct itemplate * const itable_vex0355D[] = {
+    instrux + 3007,
+    instrux + 3008,
+    instrux + 3011,
+    instrux + 3012,
+};
+
+static const struct itemplate * const itable_vex0355E[] = {
+    instrux + 3031,
+    instrux + 3032,
+    instrux + 3035,
+    instrux + 3036,
+};
+
+static const struct itemplate * const itable_vex0355F[] = {
+    instrux + 3023,
+    instrux + 3024,
+    instrux + 3027,
+    instrux + 3028,
+};
+
+static const struct itemplate * const itable_vex03568[] = {
+    instrux + 2991,
+    instrux + 2992,
+    instrux + 2995,
+    instrux + 2996,
+};
+
+static const struct itemplate * const itable_vex03569[] = {
+    instrux + 2983,
+    instrux + 2984,
+    instrux + 2987,
+    instrux + 2988,
+};
+
+static const struct itemplate * const itable_vex0356C[] = {
+    instrux + 3047,
+    instrux + 3048,
+    instrux + 3051,
+    instrux + 3052,
+};
+
+static const struct itemplate * const itable_vex0356D[] = {
+    instrux + 3039,
+    instrux + 3040,
+    instrux + 3043,
+    instrux + 3044,
+};
+
+static const struct itemplate * const itable_vex03578[] = {
+    instrux + 3071,
+    instrux + 3072,
+    instrux + 3075,
+    instrux + 3076,
+};
+
+static const struct itemplate * const itable_vex03579[] = {
+    instrux + 3063,
+    instrux + 3064,
+    instrux + 3067,
+    instrux + 3068,
+};
+
+static const struct itemplate * const itable_vex0357C[] = {
+    instrux + 3095,
+    instrux + 3096,
+    instrux + 3099,
+    instrux + 3100,
+};
+
+static const struct itemplate * const itable_vex0357D[] = {
+    instrux + 3087,
+    instrux + 3088,
+    instrux + 3091,
+    instrux + 3092,
+};
+
+static const struct itemplate * const itable_xop08085[] = {
+    instrux + 3189,
+    instrux + 3190,
+};
+
+static const struct itemplate * const itable_xop08086[] = {
+    instrux + 3187,
+    instrux + 3188,
+};
+
+static const struct itemplate * const itable_xop08087[] = {
+    instrux + 3185,
+    instrux + 3186,
+};
+
+static const struct itemplate * const itable_xop0808E[] = {
+    instrux + 3181,
+    instrux + 3182,
+};
+
+static const struct itemplate * const itable_xop0808F[] = {
+    instrux + 3183,
+    instrux + 3184,
+};
+
+static const struct itemplate * const itable_xop08095[] = {
+    instrux + 3193,
+    instrux + 3194,
+};
+
+static const struct itemplate * const itable_xop08096[] = {
+    instrux + 3191,
+    instrux + 3192,
+};
+
+static const struct itemplate * const itable_xop08097[] = {
+    instrux + 3179,
+    instrux + 3180,
+};
+
+static const struct itemplate * const itable_xop0809E[] = {
+    instrux + 3175,
+    instrux + 3176,
+};
+
+static const struct itemplate * const itable_xop0809F[] = {
+    instrux + 3177,
+    instrux + 3178,
+};
+
+static const struct itemplate * const itable_xop080A0[] = {
+    instrux + 2971,
+    instrux + 2972,
+};
+
+static const struct itemplate * const itable_xop080A1[] = {
+    instrux + 2976,
+    instrux + 2977,
+};
+
+static const struct itemplate * const itable_xop080A2[] = {
+    instrux + 3121,
+    instrux + 3122,
+    instrux + 3125,
+    instrux + 3126,
+};
+
+static const struct itemplate * const itable_xop080A3[] = {
+    instrux + 3199,
+    instrux + 3200,
+    instrux + 3201,
+    instrux + 3202,
+};
+
+static const struct itemplate * const itable_xop080A6[] = {
+    instrux + 3195,
+    instrux + 3196,
+};
+
+static const struct itemplate * const itable_xop080B6[] = {
+    instrux + 3197,
+    instrux + 3198,
+};
+
+static const struct itemplate * const itable_xop080C0[] = {
+    instrux + 3207,
+    instrux + 3208,
+};
+
+static const struct itemplate * const itable_xop080C1[] = {
+    instrux + 3225,
+    instrux + 3226,
+};
+
+static const struct itemplate * const itable_xop080C2[] = {
+    instrux + 3213,
+    instrux + 3214,
+};
+
+static const struct itemplate * const itable_xop080C3[] = {
+    instrux + 3219,
+    instrux + 3220,
+};
+
+static const struct itemplate * const itable_xop080CC[] = {
+    instrux + 3129,
+    instrux + 3130,
+};
+
+static const struct itemplate * const itable_xop080CD[] = {
+    instrux + 3143,
+    instrux + 3144,
+};
+
+static const struct itemplate * const itable_xop080CE[] = {
+    instrux + 3131,
+    instrux + 3132,
+};
+
+static const struct itemplate * const itable_xop080CF[] = {
+    instrux + 3133,
+    instrux + 3134,
+};
+
+static const struct itemplate * const itable_xop080EC[] = {
+    instrux + 3135,
+    instrux + 3136,
+};
+
+static const struct itemplate * const itable_xop080ED[] = {
+    instrux + 3141,
+    instrux + 3142,
+};
+
+static const struct itemplate * const itable_xop080EE[] = {
+    instrux + 3137,
+    instrux + 3138,
+};
+
+static const struct itemplate * const itable_xop080EF[] = {
+    instrux + 3139,
+    instrux + 3140,
+};
+
+static const struct itemplate * const itable_xop084A0[] = {
+    instrux + 2973,
+    instrux + 2974,
+    instrux + 2975,
+};
+
+static const struct itemplate * const itable_xop084A1[] = {
+    instrux + 2978,
+    instrux + 2979,
+    instrux + 2980,
+};
+
+static const struct itemplate * const itable_xop084A2[] = {
+    instrux + 3123,
+    instrux + 3124,
+    instrux + 3127,
+    instrux + 3128,
+};
+
+static const struct itemplate * const itable_xop09012[] = {
+    instrux + 2959,
+    instrux + 2961,
+    instrux + 2962,
+    instrux + 2964,
+};
+
+static const struct itemplate * const itable_xop09080[] = {
+    instrux + 3113,
+    instrux + 3114,
+};
+
+static const struct itemplate * const itable_xop09081[] = {
+    instrux + 3109,
+    instrux + 3110,
+};
+
+static const struct itemplate * const itable_xop09082[] = {
+    instrux + 3119,
+    instrux + 3120,
+};
+
+static const struct itemplate * const itable_xop09083[] = {
+    instrux + 3117,
+    instrux + 3118,
+};
+
+static const struct itemplate * const itable_xop09090[] = {
+    instrux + 3203,
+    instrux + 3204,
+    instrux + 3205,
+    instrux + 3206,
+};
+
+static const struct itemplate * const itable_xop09091[] = {
+    instrux + 3221,
+    instrux + 3222,
+    instrux + 3223,
+    instrux + 3224,
+};
+
+static const struct itemplate * const itable_xop09092[] = {
+    instrux + 3209,
+    instrux + 3210,
+    instrux + 3211,
+    instrux + 3212,
+};
+
+static const struct itemplate * const itable_xop09093[] = {
+    instrux + 3215,
+    instrux + 3216,
+    instrux + 3217,
+    instrux + 3218,
+};
+
+static const struct itemplate * const itable_xop09094[] = {
+    instrux + 3243,
+    instrux + 3244,
+    instrux + 3245,
+    instrux + 3246,
+};
+
+static const struct itemplate * const itable_xop09095[] = {
+    instrux + 3255,
+    instrux + 3256,
+    instrux + 3257,
+    instrux + 3258,
+};
+
+static const struct itemplate * const itable_xop09096[] = {
+    instrux + 3247,
+    instrux + 3248,
+    instrux + 3249,
+    instrux + 3250,
+};
+
+static const struct itemplate * const itable_xop09097[] = {
+    instrux + 3251,
+    instrux + 3252,
+    instrux + 3253,
+    instrux + 3254,
+};
+
+static const struct itemplate * const itable_xop09098[] = {
+    instrux + 3227,
+    instrux + 3228,
+    instrux + 3229,
+    instrux + 3230,
+};
+
+static const struct itemplate * const itable_xop09099[] = {
+    instrux + 3239,
+    instrux + 3240,
+    instrux + 3241,
+    instrux + 3242,
+};
+
+static const struct itemplate * const itable_xop0909A[] = {
+    instrux + 3231,
+    instrux + 3232,
+    instrux + 3233,
+    instrux + 3234,
+};
+
+static const struct itemplate * const itable_xop0909B[] = {
+    instrux + 3235,
+    instrux + 3236,
+    instrux + 3237,
+    instrux + 3238,
+};
+
+static const struct itemplate * const itable_xop090C1[] = {
+    instrux + 3149,
+    instrux + 3150,
+};
+
+static const struct itemplate * const itable_xop090C2[] = {
+    instrux + 3145,
+    instrux + 3146,
+};
+
+static const struct itemplate * const itable_xop090C3[] = {
+    instrux + 3147,
+    instrux + 3148,
+};
+
+static const struct itemplate * const itable_xop090C6[] = {
+    instrux + 3165,
+    instrux + 3166,
+};
+
+static const struct itemplate * const itable_xop090C7[] = {
+    instrux + 3167,
+    instrux + 3168,
+};
+
+static const struct itemplate * const itable_xop090CB[] = {
+    instrux + 3151,
+    instrux + 3152,
+};
+
+static const struct itemplate * const itable_xop090D1[] = {
+    instrux + 3157,
+    instrux + 3158,
+};
+
+static const struct itemplate * const itable_xop090D2[] = {
+    instrux + 3153,
+    instrux + 3154,
+};
+
+static const struct itemplate * const itable_xop090D3[] = {
+    instrux + 3155,
+    instrux + 3156,
+};
+
+static const struct itemplate * const itable_xop090D6[] = {
+    instrux + 3161,
+    instrux + 3162,
+};
+
+static const struct itemplate * const itable_xop090D7[] = {
+    instrux + 3163,
+    instrux + 3164,
+};
+
+static const struct itemplate * const itable_xop090DB[] = {
+    instrux + 3159,
+    instrux + 3160,
+};
+
+static const struct itemplate * const itable_xop090E1[] = {
+    instrux + 3169,
+    instrux + 3170,
+};
+
+static const struct itemplate * const itable_xop090E2[] = {
+    instrux + 3173,
+    instrux + 3174,
+};
+
+static const struct itemplate * const itable_xop090E3[] = {
+    instrux + 3171,
+    instrux + 3172,
+};
+
+static const struct itemplate * const itable_xop09412[] = {
+    instrux + 2960,
+    instrux + 2963,
+};
+
+static const struct itemplate * const itable_xop09480[] = {
+    instrux + 3115,
+    instrux + 3116,
+};
+
+static const struct itemplate * const itable_xop09481[] = {
+    instrux + 3111,
+    instrux + 3112,
+};
+
+static const struct itemplate * const itable_xop0A012[] = {
+    instrux + 2965,
+    instrux + 2967,
+    instrux + 2968,
+    instrux + 2970,
+};
+
+static const struct itemplate * const itable_xop0A412[] = {
+    instrux + 2966,
+    instrux + 2969,
+};
+
+static const struct disasm_index itable_vex010[256] = {
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { itable_vex01010, 1 },
+    { itable_vex01011, 1 },
+    { itable_vex01012, 4 },
+    { itable_vex01013, 1 },
+    { itable_vex01014, 2 },
+    { itable_vex01015, 2 },
+    { itable_vex01016, 4 },
+    { itable_vex01017, 1 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { itable_vex01028, 1 },
+    { itable_vex01029, 1 },
+    { NULL, 0 },
+    { itable_vex0102B, 1 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { itable_vex0102E, 1 },
+    { itable_vex0102F, 1 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { itable_vex01050, 2 },
+    { itable_vex01051, 1 },
+    { itable_vex01052, 1 },
+    { itable_vex01053, 1 },
+    { itable_vex01054, 2 },
+    { itable_vex01055, 2 },
+    { itable_vex01056, 2 },
+    { itable_vex01057, 2 },
+    { itable_vex01058, 2 },
+    { itable_vex01059, 2 },
+    { itable_vex0105A, 1 },
+    { itable_vex0105B, 1 },
+    { itable_vex0105C, 2 },
+    { itable_vex0105D, 2 },
+    { itable_vex0105E, 2 },
+    { itable_vex0105F, 2 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { itable_vex01077, 1 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { itable_vex010AE, 2 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { itable_vex010C2, 66 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { itable_vex010C6, 2 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+};
+
+static const struct disasm_index itable_vex011[256] = {
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { itable_vex01110, 1 },
+    { itable_vex01111, 1 },
+    { itable_vex01112, 2 },
+    { itable_vex01113, 1 },
+    { itable_vex01114, 2 },
+    { itable_vex01115, 2 },
+    { itable_vex01116, 2 },
+    { itable_vex01117, 1 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { itable_vex01128, 1 },
+    { itable_vex01129, 3 },
+    { NULL, 0 },
+    { itable_vex0112B, 1 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { itable_vex0112E, 1 },
+    { itable_vex0112F, 1 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { itable_vex01137, 2 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { itable_vex01150, 2 },
+    { itable_vex01151, 1 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { itable_vex01154, 2 },
+    { itable_vex01155, 2 },
+    { itable_vex01156, 2 },
+    { itable_vex01157, 2 },
+    { itable_vex01158, 2 },
+    { itable_vex01159, 2 },
+    { itable_vex0115A, 2 },
+    { itable_vex0115B, 1 },
+    { itable_vex0115C, 2 },
+    { itable_vex0115D, 2 },
+    { itable_vex0115E, 2 },
+    { itable_vex0115F, 2 },
+    { itable_vex01160, 2 },
+    { itable_vex01161, 2 },
+    { itable_vex01162, 2 },
+    { itable_vex01163, 2 },
+    { itable_vex01164, 2 },
+    { itable_vex01165, 2 },
+    { itable_vex01166, 2 },
+    { itable_vex01167, 2 },
+    { itable_vex01168, 2 },
+    { itable_vex01169, 2 },
+    { itable_vex0116A, 2 },
+    { itable_vex0116B, 2 },
+    { itable_vex0116C, 2 },
+    { itable_vex0116D, 2 },
+    { itable_vex0116E, 2 },
+    { itable_vex0116F, 1 },
+    { itable_vex01170, 1 },
+    { itable_vex01171, 6 },
+    { itable_vex01172, 6 },
+    { itable_vex01173, 8 },
+    { itable_vex01174, 2 },
+    { itable_vex01175, 2 },
+    { itable_vex01176, 2 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { itable_vex0117C, 2 },
+    { itable_vex0117D, 2 },
+    { itable_vex0117E, 2 },
+    { itable_vex0117F, 1 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { itable_vex011C2, 66 },
+    { NULL, 0 },
+    { itable_vex011C4, 6 },
+    { itable_vex011C5, 3 },
+    { itable_vex011C6, 2 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { itable_vex011D0, 2 },
+    { itable_vex011D1, 2 },
+    { itable_vex011D2, 2 },
+    { itable_vex011D3, 2 },
+    { itable_vex011D4, 2 },
+    { itable_vex011D5, 2 },
+    { itable_vex011D6, 1 },
+    { itable_vex011D7, 2 },
+    { itable_vex011D8, 2 },
+    { itable_vex011D9, 2 },
+    { itable_vex011DA, 2 },
+    { itable_vex011DB, 2 },
+    { itable_vex011DC, 2 },
+    { itable_vex011DD, 2 },
+    { itable_vex011DE, 2 },
+    { itable_vex011DF, 2 },
+    { itable_vex011E0, 2 },
+    { itable_vex011E1, 2 },
+    { itable_vex011E2, 2 },
+    { itable_vex011E3, 2 },
+    { itable_vex011E4, 2 },
+    { itable_vex011E5, 2 },
+    { itable_vex011E6, 2 },
+    { itable_vex011E7, 1 },
+    { itable_vex011E8, 2 },
+    { itable_vex011E9, 2 },
+    { itable_vex011EA, 2 },
+    { itable_vex011EB, 2 },
+    { itable_vex011EC, 2 },
+    { itable_vex011ED, 2 },
+    { itable_vex011EE, 2 },
+    { itable_vex011EF, 2 },
+    { NULL, 0 },
+    { itable_vex011F1, 2 },
+    { itable_vex011F2, 2 },
+    { itable_vex011F3, 2 },
+    { itable_vex011F4, 2 },
+    { itable_vex011F5, 2 },
+    { itable_vex011F6, 2 },
+    { itable_vex011F7, 1 },
+    { itable_vex011F8, 2 },
+    { itable_vex011F9, 2 },
+    { itable_vex011FA, 2 },
+    { itable_vex011FB, 2 },
+    { itable_vex011FC, 2 },
+    { itable_vex011FD, 2 },
+    { itable_vex011FE, 2 },
+    { NULL, 0 },
+};
+
+static const struct disasm_index itable_vex012[256] = {
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { itable_vex01210, 3 },
+    { itable_vex01211, 3 },
+    { itable_vex01212, 1 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { itable_vex01216, 1 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { itable_vex0122A, 4 },
+    { NULL, 0 },
+    { itable_vex0122C, 2 },
+    { itable_vex0122D, 2 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { itable_vex01251, 2 },
+    { itable_vex01252, 2 },
+    { itable_vex01253, 2 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { itable_vex01258, 2 },
+    { itable_vex01259, 2 },
+    { itable_vex0125A, 2 },
+    { itable_vex0125B, 1 },
+    { itable_vex0125C, 2 },
+    { itable_vex0125D, 2 },
+    { itable_vex0125E, 2 },
+    { itable_vex0125F, 2 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { itable_vex0126F, 1 },
+    { itable_vex01270, 1 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { itable_vex0127E, 1 },
+    { itable_vex0127F, 1 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { itable_vex012C2, 66 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { itable_vex012E6, 1 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+};
+
+static const struct disasm_index itable_vex013[256] = {
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { itable_vex01310, 3 },
+    { itable_vex01311, 3 },
+    { itable_vex01312, 1 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { itable_vex0132A, 4 },
+    { NULL, 0 },
+    { itable_vex0132C, 2 },
+    { itable_vex0132D, 2 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { itable_vex01351, 2 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { itable_vex01358, 2 },
+    { itable_vex01359, 2 },
+    { itable_vex0135A, 2 },
+    { NULL, 0 },
+    { itable_vex0135C, 2 },
+    { itable_vex0135D, 2 },
+    { itable_vex0135E, 2 },
+    { itable_vex0135F, 2 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { itable_vex01370, 1 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { itable_vex0137C, 2 },
+    { itable_vex0137D, 2 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { itable_vex013C2, 66 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { itable_vex013D0, 2 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { itable_vex013E6, 2 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { itable_vex013F0, 1 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+};
+
+static const struct disasm_index itable_vex014[256] = {
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { itable_vex01410, 1 },
+    { itable_vex01411, 1 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { itable_vex01414, 2 },
+    { itable_vex01415, 2 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { itable_vex01428, 1 },
+    { itable_vex01429, 1 },
+    { NULL, 0 },
+    { itable_vex0142B, 1 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { itable_vex01450, 2 },
+    { itable_vex01451, 1 },
+    { itable_vex01452, 1 },
+    { itable_vex01453, 1 },
+    { itable_vex01454, 2 },
+    { itable_vex01455, 2 },
+    { itable_vex01456, 2 },
+    { itable_vex01457, 2 },
+    { itable_vex01458, 2 },
+    { itable_vex01459, 2 },
+    { itable_vex0145A, 1 },
+    { itable_vex0145B, 1 },
+    { itable_vex0145C, 2 },
+    { itable_vex0145D, 2 },
+    { itable_vex0145E, 2 },
+    { itable_vex0145F, 2 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { itable_vex01477, 1 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { itable_vex014C2, 66 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { itable_vex014C6, 2 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+};
+
+static const struct disasm_index itable_vex015[256] = {
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { itable_vex01510, 1 },
+    { itable_vex01511, 1 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { itable_vex01514, 2 },
+    { itable_vex01515, 2 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { itable_vex01528, 1 },
+    { itable_vex01529, 1 },
+    { NULL, 0 },
+    { itable_vex0152B, 1 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { itable_vex01550, 2 },
+    { itable_vex01551, 1 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { itable_vex01554, 2 },
+    { itable_vex01555, 2 },
+    { itable_vex01556, 2 },
+    { itable_vex01557, 2 },
+    { itable_vex01558, 2 },
+    { itable_vex01559, 2 },
+    { itable_vex0155A, 2 },
+    { itable_vex0155B, 1 },
+    { itable_vex0155C, 2 },
+    { itable_vex0155D, 2 },
+    { itable_vex0155E, 2 },
+    { itable_vex0155F, 2 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { itable_vex0156F, 2 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { itable_vex0157C, 2 },
+    { itable_vex0157D, 2 },
+    { NULL, 0 },
+    { itable_vex0157F, 2 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { itable_vex015C2, 66 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { itable_vex015C6, 2 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { itable_vex015D0, 2 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { itable_vex015E6, 2 },
+    { itable_vex015E7, 2 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+};
+
+static const struct disasm_index itable_vex016[256] = {
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { itable_vex01612, 1 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { itable_vex01616, 1 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { itable_vex0165B, 1 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { itable_vex0166F, 2 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { itable_vex0167F, 2 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { itable_vex016E6, 1 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+};
+
+static const struct disasm_index itable_vex017[256] = {
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { itable_vex01712, 1 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { itable_vex0177C, 2 },
+    { itable_vex0177D, 2 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { itable_vex017D0, 2 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { itable_vex017E6, 2 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { itable_vex017F0, 2 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+};
+
+static const struct disasm_index itable_vex021[256] = {
+    { itable_vex02100, 2 },
+    { itable_vex02101, 2 },
+    { itable_vex02102, 2 },
+    { itable_vex02103, 2 },
+    { itable_vex02104, 2 },
+    { itable_vex02105, 2 },
+    { itable_vex02106, 2 },
+    { itable_vex02107, 2 },
+    { itable_vex02108, 2 },
+    { itable_vex02109, 2 },
+    { itable_vex0210A, 2 },
+    { itable_vex0210B, 2 },
+    { itable_vex0210C, 1 },
+    { itable_vex0210D, 1 },
+    { itable_vex0210E, 1 },
+    { itable_vex0210F, 1 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { itable_vex02114, 1 },
+    { itable_vex02115, 1 },
+    { NULL, 0 },
+    { itable_vex02117, 1 },
+    { itable_vex02118, 1 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { itable_vex0211C, 1 },
+    { itable_vex0211D, 1 },
+    { itable_vex0211E, 1 },
+    { NULL, 0 },
+    { itable_vex02120, 1 },
+    { itable_vex02121, 1 },
+    { itable_vex02122, 1 },
+    { itable_vex02123, 1 },
+    { itable_vex02124, 1 },
+    { itable_vex02125, 1 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { itable_vex02128, 2 },
+    { NULL, 0 },
+    { itable_vex0212A, 1 },
+    { itable_vex0212B, 2 },
+    { itable_vex0212C, 1 },
+    { itable_vex0212D, 1 },
+    { itable_vex0212E, 1 },
+    { itable_vex0212F, 1 },
+    { itable_vex02130, 1 },
+    { itable_vex02131, 1 },
+    { itable_vex02132, 1 },
+    { itable_vex02133, 1 },
+    { itable_vex02134, 1 },
+    { itable_vex02135, 1 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { itable_vex02138, 2 },
+    { itable_vex02139, 2 },
+    { itable_vex0213A, 2 },
+    { itable_vex0213B, 2 },
+    { itable_vex0213C, 2 },
+    { itable_vex0213D, 2 },
+    { itable_vex0213E, 2 },
+    { itable_vex0213F, 2 },
+    { itable_vex02140, 2 },
+    { itable_vex02141, 1 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { itable_vex02196, 4 },
+    { itable_vex02197, 4 },
+    { itable_vex02198, 4 },
+    { itable_vex02199, 4 },
+    { itable_vex0219A, 4 },
+    { itable_vex0219B, 4 },
+    { itable_vex0219C, 4 },
+    { itable_vex0219D, 4 },
+    { itable_vex0219E, 4 },
+    { itable_vex0219F, 4 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { itable_vex021A6, 4 },
+    { itable_vex021A7, 4 },
+    { itable_vex021A8, 4 },
+    { itable_vex021A9, 4 },
+    { itable_vex021AA, 4 },
+    { itable_vex021AB, 4 },
+    { itable_vex021AC, 4 },
+    { itable_vex021AD, 4 },
+    { itable_vex021AE, 4 },
+    { itable_vex021AF, 4 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { itable_vex021B6, 4 },
+    { itable_vex021B7, 4 },
+    { itable_vex021B8, 4 },
+    { itable_vex021B9, 4 },
+    { itable_vex021BA, 4 },
+    { itable_vex021BB, 4 },
+    { itable_vex021BC, 4 },
+    { itable_vex021BD, 4 },
+    { itable_vex021BE, 4 },
+    { itable_vex021BF, 4 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { itable_vex021DB, 1 },
+    { itable_vex021DC, 2 },
+    { itable_vex021DD, 2 },
+    { itable_vex021DE, 2 },
+    { itable_vex021DF, 2 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+};
+
+static const struct disasm_index itable_vex025[256] = {
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { itable_vex0250C, 1 },
+    { itable_vex0250D, 1 },
+    { itable_vex0250E, 1 },
+    { itable_vex0250F, 1 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { itable_vex02514, 1 },
+    { itable_vex02515, 1 },
+    { NULL, 0 },
+    { itable_vex02517, 1 },
+    { itable_vex02518, 1 },
+    { itable_vex02519, 1 },
+    { itable_vex0251A, 1 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { itable_vex0252C, 1 },
+    { itable_vex0252D, 1 },
+    { itable_vex0252E, 1 },
+    { itable_vex0252F, 1 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { itable_vex02596, 4 },
+    { itable_vex02597, 4 },
+    { itable_vex02598, 4 },
+    { NULL, 0 },
+    { itable_vex0259A, 4 },
+    { NULL, 0 },
+    { itable_vex0259C, 4 },
+    { NULL, 0 },
+    { itable_vex0259E, 4 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { itable_vex025A6, 4 },
+    { itable_vex025A7, 4 },
+    { itable_vex025A8, 4 },
+    { NULL, 0 },
+    { itable_vex025AA, 4 },
+    { NULL, 0 },
+    { itable_vex025AC, 4 },
+    { NULL, 0 },
+    { itable_vex025AE, 4 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { itable_vex025B6, 4 },
+    { itable_vex025B7, 4 },
+    { itable_vex025B8, 4 },
+    { NULL, 0 },
+    { itable_vex025BA, 4 },
+    { NULL, 0 },
+    { itable_vex025BC, 4 },
+    { NULL, 0 },
+    { itable_vex025BE, 4 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+};
+
+static const struct disasm_index itable_vex031[256] = {
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { itable_vex03104, 1 },
+    { itable_vex03105, 1 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { itable_vex03108, 1 },
+    { itable_vex03109, 1 },
+    { itable_vex0310A, 2 },
+    { itable_vex0310B, 2 },
+    { itable_vex0310C, 2 },
+    { itable_vex0310D, 2 },
+    { itable_vex0310E, 2 },
+    { itable_vex0310F, 2 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { itable_vex03114, 3 },
+    { itable_vex03115, 3 },
+    { itable_vex03116, 3 },
+    { itable_vex03117, 1 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { itable_vex03120, 6 },
+    { itable_vex03121, 2 },
+    { itable_vex03122, 8 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { itable_vex03140, 2 },
+    { itable_vex03141, 2 },
+    { itable_vex03142, 2 },
+    { NULL, 0 },
+    { itable_vex03144, 10 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { itable_vex03148, 8 },
+    { itable_vex03149, 8 },
+    { itable_vex0314A, 1 },
+    { itable_vex0314B, 1 },
+    { itable_vex0314C, 2 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { itable_vex0315C, 4 },
+    { itable_vex0315D, 4 },
+    { itable_vex0315E, 4 },
+    { itable_vex0315F, 4 },
+    { itable_vex03160, 1 },
+    { itable_vex03161, 1 },
+    { itable_vex03162, 1 },
+    { itable_vex03163, 1 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { itable_vex03168, 4 },
+    { itable_vex03169, 4 },
+    { itable_vex0316A, 4 },
+    { itable_vex0316B, 4 },
+    { itable_vex0316C, 4 },
+    { itable_vex0316D, 4 },
+    { itable_vex0316E, 4 },
+    { itable_vex0316F, 4 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { itable_vex03178, 4 },
+    { itable_vex03179, 4 },
+    { itable_vex0317A, 4 },
+    { itable_vex0317B, 4 },
+    { itable_vex0317C, 4 },
+    { itable_vex0317D, 4 },
+    { itable_vex0317E, 4 },
+    { itable_vex0317F, 4 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { itable_vex031DF, 1 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+};
+
+static const struct disasm_index itable_vex035[256] = {
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { itable_vex03504, 1 },
+    { itable_vex03505, 1 },
+    { itable_vex03506, 1 },
+    { NULL, 0 },
+    { itable_vex03508, 1 },
+    { itable_vex03509, 1 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { itable_vex0350C, 2 },
+    { itable_vex0350D, 2 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { itable_vex03518, 1 },
+    { itable_vex03519, 1 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { itable_vex03540, 2 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { itable_vex03548, 8 },
+    { itable_vex03549, 8 },
+    { itable_vex0354A, 1 },
+    { itable_vex0354B, 1 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { itable_vex0355C, 4 },
+    { itable_vex0355D, 4 },
+    { itable_vex0355E, 4 },
+    { itable_vex0355F, 4 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { itable_vex03568, 4 },
+    { itable_vex03569, 4 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { itable_vex0356C, 4 },
+    { itable_vex0356D, 4 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { itable_vex03578, 4 },
+    { itable_vex03579, 4 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { itable_vex0357C, 4 },
+    { itable_vex0357D, 4 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+};
+
+static const struct disasm_index itable_xop080[256] = {
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { itable_xop08085, 2 },
+    { itable_xop08086, 2 },
+    { itable_xop08087, 2 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { itable_xop0808E, 2 },
+    { itable_xop0808F, 2 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { itable_xop08095, 2 },
+    { itable_xop08096, 2 },
+    { itable_xop08097, 2 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { itable_xop0809E, 2 },
+    { itable_xop0809F, 2 },
+    { itable_xop080A0, 2 },
+    { itable_xop080A1, 2 },
+    { itable_xop080A2, 4 },
+    { itable_xop080A3, 4 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { itable_xop080A6, 2 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { itable_xop080B6, 2 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { itable_xop080C0, 2 },
+    { itable_xop080C1, 2 },
+    { itable_xop080C2, 2 },
+    { itable_xop080C3, 2 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { itable_xop080CC, 2 },
+    { itable_xop080CD, 2 },
+    { itable_xop080CE, 2 },
+    { itable_xop080CF, 2 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { itable_xop080EC, 2 },
+    { itable_xop080ED, 2 },
+    { itable_xop080EE, 2 },
+    { itable_xop080EF, 2 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+};
+
+static const struct disasm_index itable_xop084[256] = {
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { itable_xop084A0, 3 },
+    { itable_xop084A1, 3 },
+    { itable_xop084A2, 4 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+};
+
+static const struct disasm_index itable_xop090[256] = {
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { itable_xop09012, 4 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { itable_xop09080, 2 },
+    { itable_xop09081, 2 },
+    { itable_xop09082, 2 },
+    { itable_xop09083, 2 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { itable_xop09090, 4 },
+    { itable_xop09091, 4 },
+    { itable_xop09092, 4 },
+    { itable_xop09093, 4 },
+    { itable_xop09094, 4 },
+    { itable_xop09095, 4 },
+    { itable_xop09096, 4 },
+    { itable_xop09097, 4 },
+    { itable_xop09098, 4 },
+    { itable_xop09099, 4 },
+    { itable_xop0909A, 4 },
+    { itable_xop0909B, 4 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { itable_xop090C1, 2 },
+    { itable_xop090C2, 2 },
+    { itable_xop090C3, 2 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { itable_xop090C6, 2 },
+    { itable_xop090C7, 2 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { itable_xop090CB, 2 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { itable_xop090D1, 2 },
+    { itable_xop090D2, 2 },
+    { itable_xop090D3, 2 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { itable_xop090D6, 2 },
+    { itable_xop090D7, 2 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { itable_xop090DB, 2 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { itable_xop090E1, 2 },
+    { itable_xop090E2, 2 },
+    { itable_xop090E3, 2 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+};
+
+static const struct disasm_index itable_xop094[256] = {
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { itable_xop09412, 2 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { itable_xop09480, 2 },
+    { itable_xop09481, 2 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+};
+
+static const struct disasm_index itable_xop0A0[256] = {
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { itable_xop0A012, 4 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+};
+
+static const struct disasm_index itable_xop0A4[256] = {
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { itable_xop0A412, 2 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+};
+
+static const struct disasm_index itable_0F38[256] = {
+    { itable_0F3800, 2 },
+    { itable_0F3801, 2 },
+    { itable_0F3802, 2 },
+    { itable_0F3803, 2 },
+    { itable_0F3804, 2 },
+    { itable_0F3805, 2 },
+    { itable_0F3806, 2 },
+    { itable_0F3807, 2 },
+    { itable_0F3808, 2 },
+    { itable_0F3809, 2 },
+    { itable_0F380A, 2 },
+    { itable_0F380B, 2 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { itable_0F3810, 1 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { itable_0F3814, 1 },
+    { itable_0F3815, 1 },
+    { NULL, 0 },
+    { itable_0F3817, 1 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { itable_0F381C, 2 },
+    { itable_0F381D, 2 },
+    { itable_0F381E, 2 },
+    { NULL, 0 },
+    { itable_0F3820, 1 },
+    { itable_0F3821, 1 },
+    { itable_0F3822, 1 },
+    { itable_0F3823, 1 },
+    { itable_0F3824, 1 },
+    { itable_0F3825, 1 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { itable_0F3828, 1 },
+    { itable_0F3829, 1 },
+    { itable_0F382A, 1 },
+    { itable_0F382B, 1 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { itable_0F3830, 1 },
+    { itable_0F3831, 1 },
+    { itable_0F3832, 1 },
+    { itable_0F3833, 1 },
+    { itable_0F3834, 1 },
+    { itable_0F3835, 1 },
+    { NULL, 0 },
+    { itable_0F3837, 1 },
+    { itable_0F3838, 1 },
+    { itable_0F3839, 1 },
+    { itable_0F383A, 1 },
+    { itable_0F383B, 1 },
+    { itable_0F383C, 1 },
+    { itable_0F383D, 1 },
+    { itable_0F383E, 1 },
+    { itable_0F383F, 1 },
+    { itable_0F3840, 1 },
+    { itable_0F3841, 1 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { itable_0F3880, 2 },
+    { itable_0F3881, 2 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { itable_0F38DB, 1 },
+    { itable_0F38DC, 1 },
+    { itable_0F38DD, 1 },
+    { itable_0F38DE, 1 },
+    { itable_0F38DF, 1 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { itable_0F38F0, 5 },
+    { itable_0F38F1, 6 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+};
+
+static const struct disasm_index itable_0F3A[256] = {
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { itable_0F3A08, 1 },
+    { itable_0F3A09, 1 },
+    { itable_0F3A0A, 1 },
+    { itable_0F3A0B, 1 },
+    { itable_0F3A0C, 1 },
+    { itable_0F3A0D, 1 },
+    { itable_0F3A0E, 1 },
+    { itable_0F3A0F, 2 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { itable_0F3A14, 3 },
+    { itable_0F3A15, 3 },
+    { itable_0F3A16, 2 },
+    { itable_0F3A17, 2 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { itable_0F3A20, 3 },
+    { itable_0F3A21, 1 },
+    { itable_0F3A22, 4 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { itable_0F3A40, 1 },
+    { itable_0F3A41, 1 },
+    { itable_0F3A42, 1 },
+    { NULL, 0 },
+    { itable_0F3A44, 5 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { itable_0F3A60, 1 },
+    { itable_0F3A61, 1 },
+    { itable_0F3A62, 1 },
+    { itable_0F3A63, 1 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { itable_0F3ADF, 1 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+};
+
+static const struct disasm_index itable_0FA6[256] = {
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { itable_0FA6C0, 1 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { itable_0FA6C8, 1 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { itable_0FA6D0, 1 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+};
+
+static const struct disasm_index itable_0FA7[256] = {
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { itable_0FA7C0, 1 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { itable_0FA7C8, 1 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { itable_0FA7D0, 1 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { itable_0FA7D8, 1 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { itable_0FA7E0, 1 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { itable_0FA7E8, 1 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+};
+
+static const struct disasm_index itable_0F[256] = {
+    { itable_0F00, 24 },
+    { itable_0F01, 33 },
+    { itable_0F02, 10 },
+    { itable_0F03, 10 },
+    { NULL, 0 },
+    { itable_0F05, 2 },
+    { itable_0F06, 1 },
+    { itable_0F07, 2 },
+    { itable_0F08, 1 },
+    { itable_0F09, 1 },
+    { NULL, 0 },
+    { itable_0F0B, 1 },
+    { NULL, 0 },
+    { itable_0F0D, 2 },
+    { itable_0F0E, 1 },
+    { itable_0F0F, 26 },
+    { itable_0F10, 8 },
+    { itable_0F11, 8 },
+    { itable_0F12, 5 },
+    { itable_0F13, 2 },
+    { itable_0F14, 2 },
+    { itable_0F15, 2 },
+    { itable_0F16, 4 },
+    { itable_0F17, 2 },
+    { itable_0F18, 28 },
+    { itable_0F19, 24 },
+    { itable_0F1A, 24 },
+    { itable_0F1B, 24 },
+    { itable_0F1C, 24 },
+    { itable_0F1D, 24 },
+    { itable_0F1E, 24 },
+    { itable_0F1F, 27 },
+    { itable_0F20, 2 },
+    { itable_0F21, 2 },
+    { itable_0F22, 2 },
+    { itable_0F23, 2 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { itable_0F28, 4 },
+    { itable_0F29, 4 },
+    { itable_0F2A, 6 },
+    { itable_0F2B, 4 },
+    { itable_0F2C, 8 },
+    { itable_0F2D, 10 },
+    { itable_0F2E, 2 },
+    { itable_0F2F, 2 },
+    { itable_0F30, 1 },
+    { itable_0F31, 1 },
+    { itable_0F32, 1 },
+    { itable_0F33, 1 },
+    { itable_0F34, 1 },
+    { itable_0F35, 1 },
+    { itable_0F36, 1 },
+    { itable_0F37, 2 },
+    { itable_0F38, -1 },
+    { itable_0F39, 1 },
+    { itable_0F3A, -1 },
+    { NULL, 0 },
+    { itable_0F3C, 1 },
+    { itable_0F3D, 1 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { itable_0F40, 6 },
+    { itable_0F41, 6 },
+    { itable_0F42, 6 },
+    { itable_0F43, 6 },
+    { itable_0F44, 6 },
+    { itable_0F45, 6 },
+    { itable_0F46, 6 },
+    { itable_0F47, 6 },
+    { itable_0F48, 6 },
+    { itable_0F49, 6 },
+    { itable_0F4A, 6 },
+    { itable_0F4B, 6 },
+    { itable_0F4C, 6 },
+    { itable_0F4D, 6 },
+    { itable_0F4E, 6 },
+    { itable_0F4F, 6 },
+    { itable_0F50, 5 },
+    { itable_0F51, 5 },
+    { itable_0F52, 3 },
+    { itable_0F53, 2 },
+    { itable_0F54, 3 },
+    { itable_0F55, 3 },
+    { itable_0F56, 2 },
+    { itable_0F57, 2 },
+    { itable_0F58, 5 },
+    { itable_0F59, 5 },
+    { itable_0F5A, 5 },
+    { itable_0F5B, 4 },
+    { itable_0F5C, 5 },
+    { itable_0F5D, 5 },
+    { itable_0F5E, 5 },
+    { itable_0F5F, 4 },
+    { itable_0F60, 2 },
+    { itable_0F61, 2 },
+    { itable_0F62, 2 },
+    { itable_0F63, 2 },
+    { itable_0F64, 2 },
+    { itable_0F65, 2 },
+    { itable_0F66, 2 },
+    { itable_0F67, 2 },
+    { itable_0F68, 2 },
+    { itable_0F69, 2 },
+    { itable_0F6A, 2 },
+    { itable_0F6B, 2 },
+    { itable_0F6C, 1 },
+    { itable_0F6D, 1 },
+    { itable_0F6E, 8 },
+    { itable_0F6F, 5 },
+    { itable_0F70, 7 },
+    { itable_0F71, 6 },
+    { itable_0F72, 6 },
+    { itable_0F73, 6 },
+    { itable_0F74, 2 },
+    { itable_0F75, 2 },
+    { itable_0F76, 2 },
+    { itable_0F77, 1 },
+    { itable_0F78, 5 },
+    { itable_0F79, 5 },
+    { NULL, 0 },
+    { itable_0F7B, 1 },
+    { itable_0F7C, 3 },
+    { itable_0F7D, 3 },
+    { itable_0F7E, 10 },
+    { itable_0F7F, 5 },
+    { itable_0F80, 3 },
+    { itable_0F81, 3 },
+    { itable_0F82, 3 },
+    { itable_0F83, 3 },
+    { itable_0F84, 3 },
+    { itable_0F85, 3 },
+    { itable_0F86, 3 },
+    { itable_0F87, 3 },
+    { itable_0F88, 3 },
+    { itable_0F89, 3 },
+    { itable_0F8A, 3 },
+    { itable_0F8B, 3 },
+    { itable_0F8C, 3 },
+    { itable_0F8D, 3 },
+    { itable_0F8E, 3 },
+    { itable_0F8F, 3 },
+    { itable_0F90, 2 },
+    { itable_0F91, 2 },
+    { itable_0F92, 2 },
+    { itable_0F93, 2 },
+    { itable_0F94, 2 },
+    { itable_0F95, 2 },
+    { itable_0F96, 2 },
+    { itable_0F97, 2 },
+    { itable_0F98, 2 },
+    { itable_0F99, 2 },
+    { itable_0F9A, 2 },
+    { itable_0F9B, 2 },
+    { itable_0F9C, 2 },
+    { itable_0F9D, 2 },
+    { itable_0F9E, 2 },
+    { itable_0F9F, 2 },
+    { itable_0FA0, 1 },
+    { itable_0FA1, 1 },
+    { itable_0FA2, 1 },
+    { itable_0FA3, 6 },
+    { itable_0FA4, 6 },
+    { itable_0FA5, 6 },
+    { itable_0FA6, -1 },
+    { itable_0FA7, -1 },
+    { itable_0FA8, 1 },
+    { itable_0FA9, 1 },
+    { itable_0FAA, 1 },
+    { itable_0FAB, 6 },
+    { itable_0FAC, 6 },
+    { itable_0FAD, 6 },
+    { itable_0FAE, 13 },
+    { itable_0FAF, 6 },
+    { itable_0FB0, 2 },
+    { itable_0FB1, 6 },
+    { itable_0FB2, 2 },
+    { itable_0FB3, 6 },
+    { itable_0FB4, 2 },
+    { itable_0FB5, 2 },
+    { itable_0FB6, 4 },
+    { itable_0FB7, 2 },
+    { itable_0FB8, 6 },
+    { itable_0FB9, 1 },
+    { itable_0FBA, 12 },
+    { itable_0FBB, 6 },
+    { itable_0FBC, 6 },
+    { itable_0FBD, 9 },
+    { itable_0FBE, 4 },
+    { itable_0FBF, 2 },
+    { itable_0FC0, 2 },
+    { itable_0FC1, 6 },
+    { itable_0FC2, 38 },
+    { itable_0FC3, 2 },
+    { itable_0FC4, 6 },
+    { itable_0FC5, 2 },
+    { itable_0FC6, 4 },
+    { itable_0FC7, 6 },
+    { itable_0FC8, 2 },
+    { itable_0FC9, 2 },
+    { itable_0FCA, 2 },
+    { itable_0FCB, 2 },
+    { itable_0FCC, 2 },
+    { itable_0FCD, 2 },
+    { itable_0FCE, 2 },
+    { itable_0FCF, 2 },
+    { itable_0FD0, 2 },
+    { itable_0FD1, 2 },
+    { itable_0FD2, 2 },
+    { itable_0FD3, 2 },
+    { itable_0FD4, 2 },
+    { itable_0FD5, 2 },
+    { itable_0FD6, 4 },
+    { itable_0FD7, 2 },
+    { itable_0FD8, 2 },
+    { itable_0FD9, 2 },
+    { itable_0FDA, 2 },
+    { itable_0FDB, 2 },
+    { itable_0FDC, 2 },
+    { itable_0FDD, 2 },
+    { itable_0FDE, 2 },
+    { itable_0FDF, 2 },
+    { itable_0FE0, 2 },
+    { itable_0FE1, 2 },
+    { itable_0FE2, 2 },
+    { itable_0FE3, 2 },
+    { itable_0FE4, 2 },
+    { itable_0FE5, 2 },
+    { itable_0FE6, 3 },
+    { itable_0FE7, 2 },
+    { itable_0FE8, 2 },
+    { itable_0FE9, 2 },
+    { itable_0FEA, 2 },
+    { itable_0FEB, 2 },
+    { itable_0FEC, 2 },
+    { itable_0FED, 2 },
+    { itable_0FEE, 2 },
+    { itable_0FEF, 2 },
+    { itable_0FF0, 1 },
+    { itable_0FF1, 2 },
+    { itable_0FF2, 2 },
+    { itable_0FF3, 2 },
+    { itable_0FF4, 2 },
+    { itable_0FF5, 2 },
+    { itable_0FF6, 2 },
+    { itable_0FF7, 2 },
+    { itable_0FF8, 2 },
+    { itable_0FF9, 2 },
+    { itable_0FFA, 2 },
+    { itable_0FFB, 2 },
+    { itable_0FFC, 2 },
+    { itable_0FFD, 2 },
+    { itable_0FFE, 2 },
+    { itable_0FFF, 1 },
+};
+
+const struct disasm_index itable[256] = {
+    { itable_00, 2 },
+    { itable_01, 6 },
+    { itable_02, 2 },
+    { itable_03, 6 },
+    { itable_04, 1 },
+    { itable_05, 3 },
+    { itable_06, 2 },
+    { itable_07, 1 },
+    { itable_08, 2 },
+    { itable_09, 6 },
+    { itable_0A, 2 },
+    { itable_0B, 6 },
+    { itable_0C, 1 },
+    { itable_0D, 3 },
+    { itable_0E, 2 },
+    { itable_0F, -1 },
+    { itable_10, 2 },
+    { itable_11, 6 },
+    { itable_12, 2 },
+    { itable_13, 6 },
+    { itable_14, 1 },
+    { itable_15, 3 },
+    { itable_16, 2 },
+    { itable_17, 1 },
+    { itable_18, 2 },
+    { itable_19, 6 },
+    { itable_1A, 2 },
+    { itable_1B, 6 },
+    { itable_1C, 1 },
+    { itable_1D, 3 },
+    { itable_1E, 2 },
+    { itable_1F, 1 },
+    { itable_20, 2 },
+    { itable_21, 6 },
+    { itable_22, 2 },
+    { itable_23, 6 },
+    { itable_24, 1 },
+    { itable_25, 3 },
+    { NULL, 0 },
+    { itable_27, 1 },
+    { itable_28, 2 },
+    { itable_29, 6 },
+    { itable_2A, 2 },
+    { itable_2B, 6 },
+    { itable_2C, 1 },
+    { itable_2D, 3 },
+    { NULL, 0 },
+    { itable_2F, 1 },
+    { itable_30, 2 },
+    { itable_31, 6 },
+    { itable_32, 2 },
+    { itable_33, 6 },
+    { itable_34, 1 },
+    { itable_35, 3 },
+    { NULL, 0 },
+    { itable_37, 1 },
+    { itable_38, 2 },
+    { itable_39, 6 },
+    { itable_3A, 2 },
+    { itable_3B, 6 },
+    { itable_3C, 1 },
+    { itable_3D, 3 },
+    { NULL, 0 },
+    { itable_3F, 1 },
+    { itable_40, 2 },
+    { itable_41, 2 },
+    { itable_42, 2 },
+    { itable_43, 2 },
+    { itable_44, 2 },
+    { itable_45, 2 },
+    { itable_46, 2 },
+    { itable_47, 2 },
+    { itable_48, 2 },
+    { itable_49, 2 },
+    { itable_4A, 2 },
+    { itable_4B, 2 },
+    { itable_4C, 2 },
+    { itable_4D, 2 },
+    { itable_4E, 2 },
+    { itable_4F, 2 },
+    { itable_50, 3 },
+    { itable_51, 3 },
+    { itable_52, 3 },
+    { itable_53, 3 },
+    { itable_54, 3 },
+    { itable_55, 3 },
+    { itable_56, 3 },
+    { itable_57, 3 },
+    { itable_58, 3 },
+    { itable_59, 3 },
+    { itable_5A, 3 },
+    { itable_5B, 3 },
+    { itable_5C, 3 },
+    { itable_5D, 3 },
+    { itable_5E, 3 },
+    { itable_5F, 3 },
+    { itable_60, 3 },
+    { itable_61, 3 },
+    { itable_62, 2 },
+    { itable_63, 3 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { itable_68, 4 },
+    { itable_69, 9 },
+    { itable_6A, 5 },
+    { itable_6B, 9 },
+    { itable_6C, 1 },
+    { itable_6D, 2 },
+    { itable_6E, 1 },
+    { itable_6F, 2 },
+    { itable_70, 1 },
+    { itable_71, 1 },
+    { itable_72, 1 },
+    { itable_73, 1 },
+    { itable_74, 1 },
+    { itable_75, 1 },
+    { itable_76, 1 },
+    { itable_77, 1 },
+    { itable_78, 1 },
+    { itable_79, 1 },
+    { itable_7A, 1 },
+    { itable_7B, 1 },
+    { itable_7C, 1 },
+    { itable_7D, 1 },
+    { itable_7E, 1 },
+    { itable_7F, 1 },
+    { itable_80, 16 },
+    { itable_81, 40 },
+    { NULL, 0 },
+    { itable_83, 88 },
+    { itable_84, 3 },
+    { itable_85, 9 },
+    { itable_86, 4 },
+    { itable_87, 12 },
+    { itable_88, 2 },
+    { itable_89, 6 },
+    { itable_8A, 2 },
+    { itable_8B, 6 },
+    { itable_8C, 3 },
+    { itable_8D, 3 },
+    { itable_8E, 3 },
+    { itable_8F, 3 },
+    { itable_90, 9 },
+    { itable_91, 6 },
+    { itable_92, 6 },
+    { itable_93, 6 },
+    { itable_94, 6 },
+    { itable_95, 6 },
+    { itable_96, 6 },
+    { itable_97, 6 },
+    { itable_98, 3 },
+    { itable_99, 3 },
+    { itable_9A, 5 },
+    { NULL, 0 },
+    { itable_9C, 4 },
+    { itable_9D, 4 },
+    { itable_9E, 1 },
+    { itable_9F, 1 },
+    { itable_A0, 1 },
+    { itable_A1, 3 },
+    { itable_A2, 1 },
+    { itable_A3, 3 },
+    { itable_A4, 1 },
+    { itable_A5, 3 },
+    { itable_A6, 1 },
+    { itable_A7, 3 },
+    { itable_A8, 1 },
+    { itable_A9, 3 },
+    { itable_AA, 1 },
+    { itable_AB, 3 },
+    { itable_AC, 1 },
+    { itable_AD, 3 },
+    { itable_AE, 1 },
+    { itable_AF, 3 },
+    { itable_B0, 1 },
+    { itable_B1, 1 },
+    { itable_B2, 1 },
+    { itable_B3, 1 },
+    { itable_B4, 1 },
+    { itable_B5, 1 },
+    { itable_B6, 1 },
+    { itable_B7, 1 },
+    { itable_B8, 3 },
+    { itable_B9, 3 },
+    { itable_BA, 3 },
+    { itable_BB, 3 },
+    { itable_BC, 3 },
+    { itable_BD, 3 },
+    { itable_BE, 3 },
+    { itable_BF, 3 },
+    { itable_C0, 7 },
+    { itable_C1, 21 },
+    { itable_C2, 2 },
+    { itable_C3, 2 },
+    { itable_C4, 2 },
+    { itable_C5, 2 },
+    { itable_C6, 2 },
+    { itable_C7, 6 },
+    { itable_C8, 1 },
+    { itable_C9, 1 },
+    { itable_CA, 1 },
+    { itable_CB, 1 },
+    { itable_CC, 1 },
+    { itable_CD, 1 },
+    { itable_CE, 1 },
+    { itable_CF, 4 },
+    { itable_D0, 7 },
+    { itable_D1, 21 },
+    { itable_D2, 7 },
+    { itable_D3, 21 },
+    { itable_D4, 2 },
+    { itable_D5, 2 },
+    { itable_D6, 1 },
+    { itable_D7, 2 },
+    { itable_D8, 24 },
+    { itable_D9, 41 },
+    { itable_DA, 17 },
+    { itable_DB, 27 },
+    { itable_DC, 20 },
+    { itable_DD, 17 },
+    { itable_DE, 21 },
+    { itable_DF, 18 },
+    { itable_E0, 8 },
+    { itable_E1, 8 },
+    { itable_E2, 4 },
+    { itable_E3, 3 },
+    { itable_E4, 1 },
+    { itable_E5, 2 },
+    { itable_E6, 1 },
+    { itable_E7, 2 },
+    { itable_E8, 6 },
+    { itable_E9, 3 },
+    { itable_EA, 5 },
+    { itable_EB, 1 },
+    { itable_EC, 1 },
+    { itable_ED, 2 },
+    { itable_EE, 1 },
+    { itable_EF, 2 },
+    { NULL, 0 },
+    { itable_F1, 2 },
+    { NULL, 0 },
+    { NULL, 0 },
+    { itable_F4, 1 },
+    { itable_F5, 1 },
+    { itable_F6, 8 },
+    { itable_F7, 23 },
+    { itable_F8, 1 },
+    { itable_F9, 1 },
+    { itable_FA, 1 },
+    { itable_FB, 1 },
+    { itable_FC, 1 },
+    { itable_FD, 1 },
+    { itable_FE, 2 },
+    { itable_FF, 41 },
+};
+
+const struct disasm_index * const itable_vex[2][32][8] =
+{
+    {
+        {
+            NULL,
+            NULL,
+            NULL,
+            NULL,
+            NULL,
+            NULL,
+            NULL,
+            NULL,
+        },
+        {
+            itable_vex010,
+            itable_vex011,
+            itable_vex012,
+            itable_vex013,
+            itable_vex014,
+            itable_vex015,
+            itable_vex016,
+            itable_vex017,
+        },
+        {
+            NULL,
+            itable_vex021,
+            NULL,
+            NULL,
+            NULL,
+            itable_vex025,
+            NULL,
+            NULL,
+        },
+        {
+            NULL,
+            itable_vex031,
+            NULL,
+            NULL,
+            NULL,
+            itable_vex035,
+            NULL,
+            NULL,
+        },
+        {
+            NULL,
+            NULL,
+            NULL,
+            NULL,
+            NULL,
+            NULL,
+            NULL,
+            NULL,
+        },
+        {
+            NULL,
+            NULL,
+            NULL,
+            NULL,
+            NULL,
+            NULL,
+            NULL,
+            NULL,
+        },
+        {
+            NULL,
+            NULL,
+            NULL,
+            NULL,
+            NULL,
+            NULL,
+            NULL,
+            NULL,
+        },
+        {
+            NULL,
+            NULL,
+            NULL,
+            NULL,
+            NULL,
+            NULL,
+            NULL,
+            NULL,
+        },
+        {
+            NULL,
+            NULL,
+            NULL,
+            NULL,
+            NULL,
+            NULL,
+            NULL,
+            NULL,
+        },
+        {
+            NULL,
+            NULL,
+            NULL,
+            NULL,
+            NULL,
+            NULL,
+            NULL,
+            NULL,
+        },
+        {
+            NULL,
+            NULL,
+            NULL,
+            NULL,
+            NULL,
+            NULL,
+            NULL,
+            NULL,
+        },
+        {
+            NULL,
+            NULL,
+            NULL,
+            NULL,
+            NULL,
+            NULL,
+            NULL,
+            NULL,
+        },
+        {
+            NULL,
+            NULL,
+            NULL,
+            NULL,
+            NULL,
+            NULL,
+            NULL,
+            NULL,
+        },
+        {
+            NULL,
+            NULL,
+            NULL,
+            NULL,
+            NULL,
+            NULL,
+            NULL,
+            NULL,
+        },
+        {
+            NULL,
+            NULL,
+            NULL,
+            NULL,
+            NULL,
+            NULL,
+            NULL,
+            NULL,
+        },
+        {
+            NULL,
+            NULL,
+            NULL,
+            NULL,
+            NULL,
+            NULL,
+            NULL,
+            NULL,
+        },
+        {
+            NULL,
+            NULL,
+            NULL,
+            NULL,
+            NULL,
+            NULL,
+            NULL,
+            NULL,
+        },
+        {
+            NULL,
+            NULL,
+            NULL,
+            NULL,
+            NULL,
+            NULL,
+            NULL,
+            NULL,
+        },
+        {
+            NULL,
+            NULL,
+            NULL,
+            NULL,
+            NULL,
+            NULL,
+            NULL,
+            NULL,
+        },
+        {
+            NULL,
+            NULL,
+            NULL,
+            NULL,
+            NULL,
+            NULL,
+            NULL,
+            NULL,
+        },
+        {
+            NULL,
+            NULL,
+            NULL,
+            NULL,
+            NULL,
+            NULL,
+            NULL,
+            NULL,
+        },
+        {
+            NULL,
+            NULL,
+            NULL,
+            NULL,
+            NULL,
+            NULL,
+            NULL,
+            NULL,
+        },
+        {
+            NULL,
+            NULL,
+            NULL,
+            NULL,
+            NULL,
+            NULL,
+            NULL,
+            NULL,
+        },
+        {
+            NULL,
+            NULL,
+            NULL,
+            NULL,
+            NULL,
+            NULL,
+            NULL,
+            NULL,
+        },
+        {
+            NULL,
+            NULL,
+            NULL,
+            NULL,
+            NULL,
+            NULL,
+            NULL,
+            NULL,
+        },
+        {
+            NULL,
+            NULL,
+            NULL,
+            NULL,
+            NULL,
+            NULL,
+            NULL,
+            NULL,
+        },
+        {
+            NULL,
+            NULL,
+            NULL,
+            NULL,
+            NULL,
+            NULL,
+            NULL,
+            NULL,
+        },
+        {
+            NULL,
+            NULL,
+            NULL,
+            NULL,
+            NULL,
+            NULL,
+            NULL,
+            NULL,
+        },
+        {
+            NULL,
+            NULL,
+            NULL,
+            NULL,
+            NULL,
+            NULL,
+            NULL,
+            NULL,
+        },
+        {
+            NULL,
+            NULL,
+            NULL,
+            NULL,
+            NULL,
+            NULL,
+            NULL,
+            NULL,
+        },
+        {
+            NULL,
+            NULL,
+            NULL,
+            NULL,
+            NULL,
+            NULL,
+            NULL,
+            NULL,
+        },
+        {
+            NULL,
+            NULL,
+            NULL,
+            NULL,
+            NULL,
+            NULL,
+            NULL,
+            NULL,
+        },
+    },
+    {
+        {
+            NULL,
+            NULL,
+            NULL,
+            NULL,
+            NULL,
+            NULL,
+            NULL,
+            NULL,
+        },
+        {
+            NULL,
+            NULL,
+            NULL,
+            NULL,
+            NULL,
+            NULL,
+            NULL,
+            NULL,
+        },
+        {
+            NULL,
+            NULL,
+            NULL,
+            NULL,
+            NULL,
+            NULL,
+            NULL,
+            NULL,
+        },
+        {
+            NULL,
+            NULL,
+            NULL,
+            NULL,
+            NULL,
+            NULL,
+            NULL,
+            NULL,
+        },
+        {
+            NULL,
+            NULL,
+            NULL,
+            NULL,
+            NULL,
+            NULL,
+            NULL,
+            NULL,
+        },
+        {
+            NULL,
+            NULL,
+            NULL,
+            NULL,
+            NULL,
+            NULL,
+            NULL,
+            NULL,
+        },
+        {
+            NULL,
+            NULL,
+            NULL,
+            NULL,
+            NULL,
+            NULL,
+            NULL,
+            NULL,
+        },
+        {
+            NULL,
+            NULL,
+            NULL,
+            NULL,
+            NULL,
+            NULL,
+            NULL,
+            NULL,
+        },
+        {
+            itable_xop080,
+            NULL,
+            NULL,
+            NULL,
+            itable_xop084,
+            NULL,
+            NULL,
+            NULL,
+        },
+        {
+            itable_xop090,
+            NULL,
+            NULL,
+            NULL,
+            itable_xop094,
+            NULL,
+            NULL,
+            NULL,
+        },
+        {
+            itable_xop0A0,
+            NULL,
+            NULL,
+            NULL,
+            itable_xop0A4,
+            NULL,
+            NULL,
+            NULL,
+        },
+        {
+            NULL,
+            NULL,
+            NULL,
+            NULL,
+            NULL,
+            NULL,
+            NULL,
+            NULL,
+        },
+        {
+            NULL,
+            NULL,
+            NULL,
+            NULL,
+            NULL,
+            NULL,
+            NULL,
+            NULL,
+        },
+        {
+            NULL,
+            NULL,
+            NULL,
+            NULL,
+            NULL,
+            NULL,
+            NULL,
+            NULL,
+        },
+        {
+            NULL,
+            NULL,
+            NULL,
+            NULL,
+            NULL,
+            NULL,
+            NULL,
+            NULL,
+        },
+        {
+            NULL,
+            NULL,
+            NULL,
+            NULL,
+            NULL,
+            NULL,
+            NULL,
+            NULL,
+        },
+        {
+            NULL,
+            NULL,
+            NULL,
+            NULL,
+            NULL,
+            NULL,
+            NULL,
+            NULL,
+        },
+        {
+            NULL,
+            NULL,
+            NULL,
+            NULL,
+            NULL,
+            NULL,
+            NULL,
+            NULL,
+        },
+        {
+            NULL,
+            NULL,
+            NULL,
+            NULL,
+            NULL,
+            NULL,
+            NULL,
+            NULL,
+        },
+        {
+            NULL,
+            NULL,
+            NULL,
+            NULL,
+            NULL,
+            NULL,
+            NULL,
+            NULL,
+        },
+        {
+            NULL,
+            NULL,
+            NULL,
+            NULL,
+            NULL,
+            NULL,
+            NULL,
+            NULL,
+        },
+        {
+            NULL,
+            NULL,
+            NULL,
+            NULL,
+            NULL,
+            NULL,
+            NULL,
+            NULL,
+        },
+        {
+            NULL,
+            NULL,
+            NULL,
+            NULL,
+            NULL,
+            NULL,
+            NULL,
+            NULL,
+        },
+        {
+            NULL,
+            NULL,
+            NULL,
+            NULL,
+            NULL,
+            NULL,
+            NULL,
+            NULL,
+        },
+        {
+            NULL,
+            NULL,
+            NULL,
+            NULL,
+            NULL,
+            NULL,
+            NULL,
+            NULL,
+        },
+        {
+            NULL,
+            NULL,
+            NULL,
+            NULL,
+            NULL,
+            NULL,
+            NULL,
+            NULL,
+        },
+        {
+            NULL,
+            NULL,
+            NULL,
+            NULL,
+            NULL,
+            NULL,
+            NULL,
+            NULL,
+        },
+        {
+            NULL,
+            NULL,
+            NULL,
+            NULL,
+            NULL,
+            NULL,
+            NULL,
+            NULL,
+        },
+        {
+            NULL,
+            NULL,
+            NULL,
+            NULL,
+            NULL,
+            NULL,
+            NULL,
+            NULL,
+        },
+        {
+            NULL,
+            NULL,
+            NULL,
+            NULL,
+            NULL,
+            NULL,
+            NULL,
+            NULL,
+        },
+        {
+            NULL,
+            NULL,
+            NULL,
+            NULL,
+            NULL,
+            NULL,
+            NULL,
+            NULL,
+        },
+        {
+            NULL,
+            NULL,
+            NULL,
+            NULL,
+            NULL,
+            NULL,
+            NULL,
+            NULL,
+        },
+    },
+};
diff --git a/insnsi.h b/insnsi.h
new file mode 100644 (file)
index 0000000..e5b48e2
--- /dev/null
+++ b/insnsi.h
@@ -0,0 +1,1395 @@
+/* This file is auto-generated from insns.dat by insns.pl - don't edit it */
+
+/* This file in included by nasm.h */
+
+/* Instruction names */
+
+#ifndef NASM_INSNSI_H
+#define NASM_INSNSI_H 1
+
+enum opcode {
+       I_AAA,
+       I_AAD,
+       I_AAM,
+       I_AAS,
+       I_ADC,
+       I_ADD,
+       I_ADDPD,
+       I_ADDPS,
+       I_ADDSD,
+       I_ADDSS,
+       I_ADDSUBPD,
+       I_ADDSUBPS,
+       I_AESDEC,
+       I_AESDECLAST,
+       I_AESENC,
+       I_AESENCLAST,
+       I_AESIMC,
+       I_AESKEYGENASSIST,
+       I_AND,
+       I_ANDNPD,
+       I_ANDNPS,
+       I_ANDPD,
+       I_ANDPS,
+       I_ARPL,
+       I_BB0_RESET,
+       I_BB1_RESET,
+       I_BLENDPD,
+       I_BLENDPS,
+       I_BLENDVPD,
+       I_BLENDVPS,
+       I_BOUND,
+       I_BSF,
+       I_BSR,
+       I_BSWAP,
+       I_BT,
+       I_BTC,
+       I_BTR,
+       I_BTS,
+       I_CALL,
+       I_CBW,
+       I_CDQ,
+       I_CDQE,
+       I_CLC,
+       I_CLD,
+       I_CLFLUSH,
+       I_CLGI,
+       I_CLI,
+       I_CLTS,
+       I_CMC,
+       I_CMP,
+       I_CMPEQPD,
+       I_CMPEQPS,
+       I_CMPEQSD,
+       I_CMPEQSS,
+       I_CMPLEPD,
+       I_CMPLEPS,
+       I_CMPLESD,
+       I_CMPLESS,
+       I_CMPLTPD,
+       I_CMPLTPS,
+       I_CMPLTSD,
+       I_CMPLTSS,
+       I_CMPNEQPD,
+       I_CMPNEQPS,
+       I_CMPNEQSD,
+       I_CMPNEQSS,
+       I_CMPNLEPD,
+       I_CMPNLEPS,
+       I_CMPNLESD,
+       I_CMPNLESS,
+       I_CMPNLTPD,
+       I_CMPNLTPS,
+       I_CMPNLTSD,
+       I_CMPNLTSS,
+       I_CMPORDPD,
+       I_CMPORDPS,
+       I_CMPORDSD,
+       I_CMPORDSS,
+       I_CMPPD,
+       I_CMPPS,
+       I_CMPSB,
+       I_CMPSD,
+       I_CMPSQ,
+       I_CMPSS,
+       I_CMPSW,
+       I_CMPUNORDPD,
+       I_CMPUNORDPS,
+       I_CMPUNORDSD,
+       I_CMPUNORDSS,
+       I_CMPXCHG,
+       I_CMPXCHG16B,
+       I_CMPXCHG486,
+       I_CMPXCHG8B,
+       I_COMISD,
+       I_COMISS,
+       I_CPUID,
+       I_CPU_READ,
+       I_CPU_WRITE,
+       I_CQO,
+       I_CRC32,
+       I_CVTDQ2PD,
+       I_CVTDQ2PS,
+       I_CVTPD2DQ,
+       I_CVTPD2PI,
+       I_CVTPD2PS,
+       I_CVTPI2PD,
+       I_CVTPI2PS,
+       I_CVTPS2DQ,
+       I_CVTPS2PD,
+       I_CVTPS2PI,
+       I_CVTSD2SI,
+       I_CVTSD2SS,
+       I_CVTSI2SD,
+       I_CVTSI2SS,
+       I_CVTSS2SD,
+       I_CVTSS2SI,
+       I_CVTTPD2DQ,
+       I_CVTTPD2PI,
+       I_CVTTPS2DQ,
+       I_CVTTPS2PI,
+       I_CVTTSD2SI,
+       I_CVTTSS2SI,
+       I_CWD,
+       I_CWDE,
+       I_DAA,
+       I_DAS,
+       I_DB,
+       I_DD,
+       I_DEC,
+       I_DIV,
+       I_DIVPD,
+       I_DIVPS,
+       I_DIVSD,
+       I_DIVSS,
+       I_DMINT,
+       I_DO,
+       I_DPPD,
+       I_DPPS,
+       I_DQ,
+       I_DT,
+       I_DW,
+       I_DY,
+       I_EMMS,
+       I_ENTER,
+       I_EQU,
+       I_EXTRACTPS,
+       I_EXTRQ,
+       I_F2XM1,
+       I_FABS,
+       I_FADD,
+       I_FADDP,
+       I_FBLD,
+       I_FBSTP,
+       I_FCHS,
+       I_FCLEX,
+       I_FCMOVB,
+       I_FCMOVBE,
+       I_FCMOVE,
+       I_FCMOVNB,
+       I_FCMOVNBE,
+       I_FCMOVNE,
+       I_FCMOVNU,
+       I_FCMOVU,
+       I_FCOM,
+       I_FCOMI,
+       I_FCOMIP,
+       I_FCOMP,
+       I_FCOMPP,
+       I_FCOS,
+       I_FDECSTP,
+       I_FDISI,
+       I_FDIV,
+       I_FDIVP,
+       I_FDIVR,
+       I_FDIVRP,
+       I_FEMMS,
+       I_FENI,
+       I_FFREE,
+       I_FFREEP,
+       I_FIADD,
+       I_FICOM,
+       I_FICOMP,
+       I_FIDIV,
+       I_FIDIVR,
+       I_FILD,
+       I_FIMUL,
+       I_FINCSTP,
+       I_FINIT,
+       I_FIST,
+       I_FISTP,
+       I_FISTTP,
+       I_FISUB,
+       I_FISUBR,
+       I_FLD,
+       I_FLD1,
+       I_FLDCW,
+       I_FLDENV,
+       I_FLDL2E,
+       I_FLDL2T,
+       I_FLDLG2,
+       I_FLDLN2,
+       I_FLDPI,
+       I_FLDZ,
+       I_FMUL,
+       I_FMULP,
+       I_FNCLEX,
+       I_FNDISI,
+       I_FNENI,
+       I_FNINIT,
+       I_FNOP,
+       I_FNSAVE,
+       I_FNSTCW,
+       I_FNSTENV,
+       I_FNSTSW,
+       I_FPATAN,
+       I_FPREM,
+       I_FPREM1,
+       I_FPTAN,
+       I_FRNDINT,
+       I_FRSTOR,
+       I_FSAVE,
+       I_FSCALE,
+       I_FSETPM,
+       I_FSIN,
+       I_FSINCOS,
+       I_FSQRT,
+       I_FST,
+       I_FSTCW,
+       I_FSTENV,
+       I_FSTP,
+       I_FSTSW,
+       I_FSUB,
+       I_FSUBP,
+       I_FSUBR,
+       I_FSUBRP,
+       I_FTST,
+       I_FUCOM,
+       I_FUCOMI,
+       I_FUCOMIP,
+       I_FUCOMP,
+       I_FUCOMPP,
+       I_FWAIT,
+       I_FXAM,
+       I_FXCH,
+       I_FXRSTOR,
+       I_FXSAVE,
+       I_FXTRACT,
+       I_FYL2X,
+       I_FYL2XP1,
+       I_GETSEC,
+       I_HADDPD,
+       I_HADDPS,
+       I_HINT_NOP0,
+       I_HINT_NOP1,
+       I_HINT_NOP10,
+       I_HINT_NOP11,
+       I_HINT_NOP12,
+       I_HINT_NOP13,
+       I_HINT_NOP14,
+       I_HINT_NOP15,
+       I_HINT_NOP16,
+       I_HINT_NOP17,
+       I_HINT_NOP18,
+       I_HINT_NOP19,
+       I_HINT_NOP2,
+       I_HINT_NOP20,
+       I_HINT_NOP21,
+       I_HINT_NOP22,
+       I_HINT_NOP23,
+       I_HINT_NOP24,
+       I_HINT_NOP25,
+       I_HINT_NOP26,
+       I_HINT_NOP27,
+       I_HINT_NOP28,
+       I_HINT_NOP29,
+       I_HINT_NOP3,
+       I_HINT_NOP30,
+       I_HINT_NOP31,
+       I_HINT_NOP32,
+       I_HINT_NOP33,
+       I_HINT_NOP34,
+       I_HINT_NOP35,
+       I_HINT_NOP36,
+       I_HINT_NOP37,
+       I_HINT_NOP38,
+       I_HINT_NOP39,
+       I_HINT_NOP4,
+       I_HINT_NOP40,
+       I_HINT_NOP41,
+       I_HINT_NOP42,
+       I_HINT_NOP43,
+       I_HINT_NOP44,
+       I_HINT_NOP45,
+       I_HINT_NOP46,
+       I_HINT_NOP47,
+       I_HINT_NOP48,
+       I_HINT_NOP49,
+       I_HINT_NOP5,
+       I_HINT_NOP50,
+       I_HINT_NOP51,
+       I_HINT_NOP52,
+       I_HINT_NOP53,
+       I_HINT_NOP54,
+       I_HINT_NOP55,
+       I_HINT_NOP56,
+       I_HINT_NOP57,
+       I_HINT_NOP58,
+       I_HINT_NOP59,
+       I_HINT_NOP6,
+       I_HINT_NOP60,
+       I_HINT_NOP61,
+       I_HINT_NOP62,
+       I_HINT_NOP63,
+       I_HINT_NOP7,
+       I_HINT_NOP8,
+       I_HINT_NOP9,
+       I_HLT,
+       I_HSUBPD,
+       I_HSUBPS,
+       I_IBTS,
+       I_ICEBP,
+       I_IDIV,
+       I_IMUL,
+       I_IN,
+       I_INC,
+       I_INCBIN,
+       I_INSB,
+       I_INSD,
+       I_INSERTPS,
+       I_INSERTQ,
+       I_INSW,
+       I_INT,
+       I_INT01,
+       I_INT03,
+       I_INT1,
+       I_INT3,
+       I_INTO,
+       I_INVD,
+       I_INVEPT,
+       I_INVLPG,
+       I_INVLPGA,
+       I_INVVPID,
+       I_IRET,
+       I_IRETD,
+       I_IRETQ,
+       I_IRETW,
+       I_JCXZ,
+       I_JECXZ,
+       I_JMP,
+       I_JMPE,
+       I_JRCXZ,
+       I_LAHF,
+       I_LAR,
+       I_LDDQU,
+       I_LDMXCSR,
+       I_LDS,
+       I_LEA,
+       I_LEAVE,
+       I_LES,
+       I_LFENCE,
+       I_LFS,
+       I_LGDT,
+       I_LGS,
+       I_LIDT,
+       I_LLDT,
+       I_LLWPCB,
+       I_LMSW,
+       I_LOADALL,
+       I_LOADALL286,
+       I_LODSB,
+       I_LODSD,
+       I_LODSQ,
+       I_LODSW,
+       I_LOOP,
+       I_LOOPE,
+       I_LOOPNE,
+       I_LOOPNZ,
+       I_LOOPZ,
+       I_LSL,
+       I_LSS,
+       I_LTR,
+       I_LWPINS,
+       I_LWPVAL,
+       I_LZCNT,
+       I_MASKMOVDQU,
+       I_MASKMOVQ,
+       I_MAXPD,
+       I_MAXPS,
+       I_MAXSD,
+       I_MAXSS,
+       I_MFENCE,
+       I_MINPD,
+       I_MINPS,
+       I_MINSD,
+       I_MINSS,
+       I_MONITOR,
+       I_MONTMUL,
+       I_MOV,
+       I_MOVAPD,
+       I_MOVAPS,
+       I_MOVBE,
+       I_MOVD,
+       I_MOVDDUP,
+       I_MOVDQ2Q,
+       I_MOVDQA,
+       I_MOVDQU,
+       I_MOVHLPS,
+       I_MOVHPD,
+       I_MOVHPS,
+       I_MOVLHPS,
+       I_MOVLPD,
+       I_MOVLPS,
+       I_MOVMSKPD,
+       I_MOVMSKPS,
+       I_MOVNTDQ,
+       I_MOVNTDQA,
+       I_MOVNTI,
+       I_MOVNTPD,
+       I_MOVNTPS,
+       I_MOVNTQ,
+       I_MOVNTSD,
+       I_MOVNTSS,
+       I_MOVQ,
+       I_MOVQ2DQ,
+       I_MOVSB,
+       I_MOVSD,
+       I_MOVSHDUP,
+       I_MOVSLDUP,
+       I_MOVSQ,
+       I_MOVSS,
+       I_MOVSW,
+       I_MOVSX,
+       I_MOVSXD,
+       I_MOVUPD,
+       I_MOVUPS,
+       I_MOVZX,
+       I_MPSADBW,
+       I_MUL,
+       I_MULPD,
+       I_MULPS,
+       I_MULSD,
+       I_MULSS,
+       I_MWAIT,
+       I_NEG,
+       I_NOP,
+       I_NOT,
+       I_OR,
+       I_ORPD,
+       I_ORPS,
+       I_OUT,
+       I_OUTSB,
+       I_OUTSD,
+       I_OUTSW,
+       I_PABSB,
+       I_PABSD,
+       I_PABSW,
+       I_PACKSSDW,
+       I_PACKSSWB,
+       I_PACKUSDW,
+       I_PACKUSWB,
+       I_PADDB,
+       I_PADDD,
+       I_PADDQ,
+       I_PADDSB,
+       I_PADDSIW,
+       I_PADDSW,
+       I_PADDUSB,
+       I_PADDUSW,
+       I_PADDW,
+       I_PALIGNR,
+       I_PAND,
+       I_PANDN,
+       I_PAUSE,
+       I_PAVEB,
+       I_PAVGB,
+       I_PAVGUSB,
+       I_PAVGW,
+       I_PBLENDVB,
+       I_PBLENDW,
+       I_PCLMULHQHQDQ,
+       I_PCLMULHQLQDQ,
+       I_PCLMULLQHQDQ,
+       I_PCLMULLQLQDQ,
+       I_PCLMULQDQ,
+       I_PCMPEQB,
+       I_PCMPEQD,
+       I_PCMPEQQ,
+       I_PCMPEQW,
+       I_PCMPESTRI,
+       I_PCMPESTRM,
+       I_PCMPGTB,
+       I_PCMPGTD,
+       I_PCMPGTQ,
+       I_PCMPGTW,
+       I_PCMPISTRI,
+       I_PCMPISTRM,
+       I_PDISTIB,
+       I_PEXTRB,
+       I_PEXTRD,
+       I_PEXTRQ,
+       I_PEXTRW,
+       I_PF2ID,
+       I_PF2IW,
+       I_PFACC,
+       I_PFADD,
+       I_PFCMPEQ,
+       I_PFCMPGE,
+       I_PFCMPGT,
+       I_PFMAX,
+       I_PFMIN,
+       I_PFMUL,
+       I_PFNACC,
+       I_PFPNACC,
+       I_PFRCP,
+       I_PFRCPIT1,
+       I_PFRCPIT2,
+       I_PFRCPV,
+       I_PFRSQIT1,
+       I_PFRSQRT,
+       I_PFRSQRTV,
+       I_PFSUB,
+       I_PFSUBR,
+       I_PHADDD,
+       I_PHADDSW,
+       I_PHADDW,
+       I_PHMINPOSUW,
+       I_PHSUBD,
+       I_PHSUBSW,
+       I_PHSUBW,
+       I_PI2FD,
+       I_PI2FW,
+       I_PINSRB,
+       I_PINSRD,
+       I_PINSRQ,
+       I_PINSRW,
+       I_PMACHRIW,
+       I_PMADDUBSW,
+       I_PMADDWD,
+       I_PMAGW,
+       I_PMAXSB,
+       I_PMAXSD,
+       I_PMAXSW,
+       I_PMAXUB,
+       I_PMAXUD,
+       I_PMAXUW,
+       I_PMINSB,
+       I_PMINSD,
+       I_PMINSW,
+       I_PMINUB,
+       I_PMINUD,
+       I_PMINUW,
+       I_PMOVMSKB,
+       I_PMOVSXBD,
+       I_PMOVSXBQ,
+       I_PMOVSXBW,
+       I_PMOVSXDQ,
+       I_PMOVSXWD,
+       I_PMOVSXWQ,
+       I_PMOVZXBD,
+       I_PMOVZXBQ,
+       I_PMOVZXBW,
+       I_PMOVZXDQ,
+       I_PMOVZXWD,
+       I_PMOVZXWQ,
+       I_PMULDQ,
+       I_PMULHRIW,
+       I_PMULHRSW,
+       I_PMULHRWA,
+       I_PMULHRWC,
+       I_PMULHUW,
+       I_PMULHW,
+       I_PMULLD,
+       I_PMULLW,
+       I_PMULUDQ,
+       I_PMVGEZB,
+       I_PMVLZB,
+       I_PMVNZB,
+       I_PMVZB,
+       I_POP,
+       I_POPA,
+       I_POPAD,
+       I_POPAW,
+       I_POPCNT,
+       I_POPF,
+       I_POPFD,
+       I_POPFQ,
+       I_POPFW,
+       I_POR,
+       I_PREFETCH,
+       I_PREFETCHNTA,
+       I_PREFETCHT0,
+       I_PREFETCHT1,
+       I_PREFETCHT2,
+       I_PREFETCHW,
+       I_PSADBW,
+       I_PSHUFB,
+       I_PSHUFD,
+       I_PSHUFHW,
+       I_PSHUFLW,
+       I_PSHUFW,
+       I_PSIGNB,
+       I_PSIGND,
+       I_PSIGNW,
+       I_PSLLD,
+       I_PSLLDQ,
+       I_PSLLQ,
+       I_PSLLW,
+       I_PSRAD,
+       I_PSRAW,
+       I_PSRLD,
+       I_PSRLDQ,
+       I_PSRLQ,
+       I_PSRLW,
+       I_PSUBB,
+       I_PSUBD,
+       I_PSUBQ,
+       I_PSUBSB,
+       I_PSUBSIW,
+       I_PSUBSW,
+       I_PSUBUSB,
+       I_PSUBUSW,
+       I_PSUBW,
+       I_PSWAPD,
+       I_PTEST,
+       I_PUNPCKHBW,
+       I_PUNPCKHDQ,
+       I_PUNPCKHQDQ,
+       I_PUNPCKHWD,
+       I_PUNPCKLBW,
+       I_PUNPCKLDQ,
+       I_PUNPCKLQDQ,
+       I_PUNPCKLWD,
+       I_PUSH,
+       I_PUSHA,
+       I_PUSHAD,
+       I_PUSHAW,
+       I_PUSHF,
+       I_PUSHFD,
+       I_PUSHFQ,
+       I_PUSHFW,
+       I_PXOR,
+       I_RCL,
+       I_RCPPS,
+       I_RCPSS,
+       I_RCR,
+       I_RDM,
+       I_RDMSR,
+       I_RDPMC,
+       I_RDSHR,
+       I_RDTSC,
+       I_RDTSCP,
+       I_RESB,
+       I_RESD,
+       I_RESO,
+       I_RESQ,
+       I_REST,
+       I_RESW,
+       I_RESY,
+       I_RET,
+       I_RETF,
+       I_RETN,
+       I_ROL,
+       I_ROR,
+       I_ROUNDPD,
+       I_ROUNDPS,
+       I_ROUNDSD,
+       I_ROUNDSS,
+       I_RSDC,
+       I_RSLDT,
+       I_RSM,
+       I_RSQRTPS,
+       I_RSQRTSS,
+       I_RSTS,
+       I_SAHF,
+       I_SAL,
+       I_SALC,
+       I_SAR,
+       I_SBB,
+       I_SCASB,
+       I_SCASD,
+       I_SCASQ,
+       I_SCASW,
+       I_SFENCE,
+       I_SGDT,
+       I_SHL,
+       I_SHLD,
+       I_SHR,
+       I_SHRD,
+       I_SHUFPD,
+       I_SHUFPS,
+       I_SIDT,
+       I_SKINIT,
+       I_SLDT,
+       I_SLWPCB,
+       I_SMI,
+       I_SMINT,
+       I_SMINTOLD,
+       I_SMSW,
+       I_SQRTPD,
+       I_SQRTPS,
+       I_SQRTSD,
+       I_SQRTSS,
+       I_STC,
+       I_STD,
+       I_STGI,
+       I_STI,
+       I_STMXCSR,
+       I_STOSB,
+       I_STOSD,
+       I_STOSQ,
+       I_STOSW,
+       I_STR,
+       I_SUB,
+       I_SUBPD,
+       I_SUBPS,
+       I_SUBSD,
+       I_SUBSS,
+       I_SVDC,
+       I_SVLDT,
+       I_SVTS,
+       I_SWAPGS,
+       I_SYSCALL,
+       I_SYSENTER,
+       I_SYSEXIT,
+       I_SYSRET,
+       I_TEST,
+       I_UCOMISD,
+       I_UCOMISS,
+       I_UD0,
+       I_UD1,
+       I_UD2,
+       I_UD2A,
+       I_UD2B,
+       I_UMOV,
+       I_UNPCKHPD,
+       I_UNPCKHPS,
+       I_UNPCKLPD,
+       I_UNPCKLPS,
+       I_VADDPD,
+       I_VADDPS,
+       I_VADDSD,
+       I_VADDSS,
+       I_VADDSUBPD,
+       I_VADDSUBPS,
+       I_VAESDEC,
+       I_VAESDECLAST,
+       I_VAESENC,
+       I_VAESENCLAST,
+       I_VAESIMC,
+       I_VAESKEYGENASSIST,
+       I_VANDNPD,
+       I_VANDNPS,
+       I_VANDPD,
+       I_VANDPS,
+       I_VBLENDPD,
+       I_VBLENDPS,
+       I_VBLENDVPD,
+       I_VBLENDVPS,
+       I_VBROADCASTF128,
+       I_VBROADCASTSD,
+       I_VBROADCASTSS,
+       I_VCMPEQPD,
+       I_VCMPEQPS,
+       I_VCMPEQSD,
+       I_VCMPEQSS,
+       I_VCMPEQ_OSPD,
+       I_VCMPEQ_OSPS,
+       I_VCMPEQ_OSSD,
+       I_VCMPEQ_OSSS,
+       I_VCMPEQ_UQPD,
+       I_VCMPEQ_UQPS,
+       I_VCMPEQ_UQSD,
+       I_VCMPEQ_UQSS,
+       I_VCMPEQ_USPD,
+       I_VCMPEQ_USPS,
+       I_VCMPEQ_USSD,
+       I_VCMPEQ_USSS,
+       I_VCMPFALSEPD,
+       I_VCMPFALSEPS,
+       I_VCMPFALSESD,
+       I_VCMPFALSESS,
+       I_VCMPFALSE_OSPD,
+       I_VCMPFALSE_OSPS,
+       I_VCMPFALSE_OSSD,
+       I_VCMPFALSE_OSSS,
+       I_VCMPGEPD,
+       I_VCMPGEPS,
+       I_VCMPGESD,
+       I_VCMPGESS,
+       I_VCMPGE_OQPD,
+       I_VCMPGE_OQPS,
+       I_VCMPGE_OQSD,
+       I_VCMPGE_OQSS,
+       I_VCMPGTPD,
+       I_VCMPGTPS,
+       I_VCMPGTSD,
+       I_VCMPGTSS,
+       I_VCMPGT_OQPD,
+       I_VCMPGT_OQPS,
+       I_VCMPGT_OQSD,
+       I_VCMPGT_OQSS,
+       I_VCMPLEPD,
+       I_VCMPLEPS,
+       I_VCMPLESD,
+       I_VCMPLESS,
+       I_VCMPLE_OQPD,
+       I_VCMPLE_OQPS,
+       I_VCMPLE_OQSD,
+       I_VCMPLE_OQSS,
+       I_VCMPLTPD,
+       I_VCMPLTPS,
+       I_VCMPLTSD,
+       I_VCMPLTSS,
+       I_VCMPLT_OQPD,
+       I_VCMPLT_OQPS,
+       I_VCMPLT_OQSD,
+       I_VCMPLT_OQSS,
+       I_VCMPNEQPD,
+       I_VCMPNEQPS,
+       I_VCMPNEQSD,
+       I_VCMPNEQSS,
+       I_VCMPNEQ_OQPD,
+       I_VCMPNEQ_OQPS,
+       I_VCMPNEQ_OQSD,
+       I_VCMPNEQ_OQSS,
+       I_VCMPNEQ_OSPD,
+       I_VCMPNEQ_OSPS,
+       I_VCMPNEQ_OSSD,
+       I_VCMPNEQ_OSSS,
+       I_VCMPNEQ_USPD,
+       I_VCMPNEQ_USPS,
+       I_VCMPNEQ_USSD,
+       I_VCMPNEQ_USSS,
+       I_VCMPNGEPD,
+       I_VCMPNGEPS,
+       I_VCMPNGESD,
+       I_VCMPNGESS,
+       I_VCMPNGE_UQPD,
+       I_VCMPNGE_UQPS,
+       I_VCMPNGE_UQSD,
+       I_VCMPNGE_UQSS,
+       I_VCMPNGTPD,
+       I_VCMPNGTPS,
+       I_VCMPNGTSD,
+       I_VCMPNGTSS,
+       I_VCMPNGT_UQPD,
+       I_VCMPNGT_UQPS,
+       I_VCMPNGT_UQSD,
+       I_VCMPNGT_UQSS,
+       I_VCMPNLEPD,
+       I_VCMPNLEPS,
+       I_VCMPNLESD,
+       I_VCMPNLESS,
+       I_VCMPNLE_UQPD,
+       I_VCMPNLE_UQPS,
+       I_VCMPNLE_UQSD,
+       I_VCMPNLE_UQSS,
+       I_VCMPNLTPD,
+       I_VCMPNLTPS,
+       I_VCMPNLTSD,
+       I_VCMPNLTSS,
+       I_VCMPNLT_UQPD,
+       I_VCMPNLT_UQPS,
+       I_VCMPNLT_UQSD,
+       I_VCMPNLT_UQSS,
+       I_VCMPORDPD,
+       I_VCMPORDPS,
+       I_VCMPORDSD,
+       I_VCMPORDSS,
+       I_VCMPORD_SPD,
+       I_VCMPORD_SPS,
+       I_VCMPORD_SSD,
+       I_VCMPORD_SSS,
+       I_VCMPPD,
+       I_VCMPPS,
+       I_VCMPSD,
+       I_VCMPSS,
+       I_VCMPTRUEPD,
+       I_VCMPTRUEPS,
+       I_VCMPTRUESD,
+       I_VCMPTRUESS,
+       I_VCMPTRUE_USPD,
+       I_VCMPTRUE_USPS,
+       I_VCMPTRUE_USSD,
+       I_VCMPTRUE_USSS,
+       I_VCMPUNORDPD,
+       I_VCMPUNORDPS,
+       I_VCMPUNORDSD,
+       I_VCMPUNORDSS,
+       I_VCMPUNORD_SPD,
+       I_VCMPUNORD_SPS,
+       I_VCMPUNORD_SSD,
+       I_VCMPUNORD_SSS,
+       I_VCOMISD,
+       I_VCOMISS,
+       I_VCVTDQ2PD,
+       I_VCVTDQ2PS,
+       I_VCVTPD2DQ,
+       I_VCVTPD2PS,
+       I_VCVTPH2PS,
+       I_VCVTPS2DQ,
+       I_VCVTPS2PD,
+       I_VCVTPS2PH,
+       I_VCVTSD2SI,
+       I_VCVTSD2SS,
+       I_VCVTSI2SD,
+       I_VCVTSI2SS,
+       I_VCVTSS2SD,
+       I_VCVTSS2SI,
+       I_VCVTTPD2DQ,
+       I_VCVTTPS2DQ,
+       I_VCVTTSD2SI,
+       I_VCVTTSS2SI,
+       I_VDIVPD,
+       I_VDIVPS,
+       I_VDIVSD,
+       I_VDIVSS,
+       I_VDPPD,
+       I_VDPPS,
+       I_VERR,
+       I_VERW,
+       I_VEXTRACTF128,
+       I_VEXTRACTPS,
+       I_VFMADD123PD,
+       I_VFMADD123PS,
+       I_VFMADD123SD,
+       I_VFMADD123SS,
+       I_VFMADD132PD,
+       I_VFMADD132PS,
+       I_VFMADD132SD,
+       I_VFMADD132SS,
+       I_VFMADD213PD,
+       I_VFMADD213PS,
+       I_VFMADD213SD,
+       I_VFMADD213SS,
+       I_VFMADD231PD,
+       I_VFMADD231PS,
+       I_VFMADD231SD,
+       I_VFMADD231SS,
+       I_VFMADD312PD,
+       I_VFMADD312PS,
+       I_VFMADD312SD,
+       I_VFMADD312SS,
+       I_VFMADD321PD,
+       I_VFMADD321PS,
+       I_VFMADD321SD,
+       I_VFMADD321SS,
+       I_VFMADDPD,
+       I_VFMADDPS,
+       I_VFMADDSD,
+       I_VFMADDSS,
+       I_VFMADDSUB123PD,
+       I_VFMADDSUB123PS,
+       I_VFMADDSUB132PD,
+       I_VFMADDSUB132PS,
+       I_VFMADDSUB213PD,
+       I_VFMADDSUB213PS,
+       I_VFMADDSUB231PD,
+       I_VFMADDSUB231PS,
+       I_VFMADDSUB312PD,
+       I_VFMADDSUB312PS,
+       I_VFMADDSUB321PD,
+       I_VFMADDSUB321PS,
+       I_VFMADDSUBPD,
+       I_VFMADDSUBPS,
+       I_VFMSUB123PD,
+       I_VFMSUB123PS,
+       I_VFMSUB123SD,
+       I_VFMSUB123SS,
+       I_VFMSUB132PD,
+       I_VFMSUB132PS,
+       I_VFMSUB132SD,
+       I_VFMSUB132SS,
+       I_VFMSUB213PD,
+       I_VFMSUB213PS,
+       I_VFMSUB213SD,
+       I_VFMSUB213SS,
+       I_VFMSUB231PD,
+       I_VFMSUB231PS,
+       I_VFMSUB231SD,
+       I_VFMSUB231SS,
+       I_VFMSUB312PD,
+       I_VFMSUB312PS,
+       I_VFMSUB312SD,
+       I_VFMSUB312SS,
+       I_VFMSUB321PD,
+       I_VFMSUB321PS,
+       I_VFMSUB321SD,
+       I_VFMSUB321SS,
+       I_VFMSUBADD123PD,
+       I_VFMSUBADD123PS,
+       I_VFMSUBADD132PD,
+       I_VFMSUBADD132PS,
+       I_VFMSUBADD213PD,
+       I_VFMSUBADD213PS,
+       I_VFMSUBADD231PD,
+       I_VFMSUBADD231PS,
+       I_VFMSUBADD312PD,
+       I_VFMSUBADD312PS,
+       I_VFMSUBADD321PD,
+       I_VFMSUBADD321PS,
+       I_VFMSUBADDPD,
+       I_VFMSUBADDPS,
+       I_VFMSUBPD,
+       I_VFMSUBPS,
+       I_VFMSUBSD,
+       I_VFMSUBSS,
+       I_VFNMADD123PD,
+       I_VFNMADD123PS,
+       I_VFNMADD123SD,
+       I_VFNMADD123SS,
+       I_VFNMADD132PD,
+       I_VFNMADD132PS,
+       I_VFNMADD132SD,
+       I_VFNMADD132SS,
+       I_VFNMADD213PD,
+       I_VFNMADD213PS,
+       I_VFNMADD213SD,
+       I_VFNMADD213SS,
+       I_VFNMADD231PD,
+       I_VFNMADD231PS,
+       I_VFNMADD231SD,
+       I_VFNMADD231SS,
+       I_VFNMADD312PD,
+       I_VFNMADD312PS,
+       I_VFNMADD312SD,
+       I_VFNMADD312SS,
+       I_VFNMADD321PD,
+       I_VFNMADD321PS,
+       I_VFNMADD321SD,
+       I_VFNMADD321SS,
+       I_VFNMADDPD,
+       I_VFNMADDPS,
+       I_VFNMADDSD,
+       I_VFNMADDSS,
+       I_VFNMSUB123PD,
+       I_VFNMSUB123PS,
+       I_VFNMSUB123SD,
+       I_VFNMSUB123SS,
+       I_VFNMSUB132PD,
+       I_VFNMSUB132PS,
+       I_VFNMSUB132SD,
+       I_VFNMSUB132SS,
+       I_VFNMSUB213PD,
+       I_VFNMSUB213PS,
+       I_VFNMSUB213SD,
+       I_VFNMSUB213SS,
+       I_VFNMSUB231PD,
+       I_VFNMSUB231PS,
+       I_VFNMSUB231SD,
+       I_VFNMSUB231SS,
+       I_VFNMSUB312PD,
+       I_VFNMSUB312PS,
+       I_VFNMSUB312SD,
+       I_VFNMSUB312SS,
+       I_VFNMSUB321PD,
+       I_VFNMSUB321PS,
+       I_VFNMSUB321SD,
+       I_VFNMSUB321SS,
+       I_VFNMSUBPD,
+       I_VFNMSUBPS,
+       I_VFNMSUBSD,
+       I_VFNMSUBSS,
+       I_VFRCZPD,
+       I_VFRCZPS,
+       I_VFRCZSD,
+       I_VFRCZSS,
+       I_VHADDPD,
+       I_VHADDPS,
+       I_VHSUBPD,
+       I_VHSUBPS,
+       I_VINSERTF128,
+       I_VINSERTPS,
+       I_VLDDQU,
+       I_VLDMXCSR,
+       I_VLDQQU,
+       I_VMASKMOVDQU,
+       I_VMASKMOVPD,
+       I_VMASKMOVPS,
+       I_VMAXPD,
+       I_VMAXPS,
+       I_VMAXSD,
+       I_VMAXSS,
+       I_VMCALL,
+       I_VMCLEAR,
+       I_VMINPD,
+       I_VMINPS,
+       I_VMINSD,
+       I_VMINSS,
+       I_VMLAUNCH,
+       I_VMLOAD,
+       I_VMMCALL,
+       I_VMOVAPD,
+       I_VMOVAPS,
+       I_VMOVD,
+       I_VMOVDDUP,
+       I_VMOVDQA,
+       I_VMOVDQU,
+       I_VMOVHLPS,
+       I_VMOVHPD,
+       I_VMOVHPS,
+       I_VMOVLHPS,
+       I_VMOVLPD,
+       I_VMOVLPS,
+       I_VMOVMSKPD,
+       I_VMOVMSKPS,
+       I_VMOVNTDQ,
+       I_VMOVNTDQA,
+       I_VMOVNTPD,
+       I_VMOVNTPS,
+       I_VMOVNTQQ,
+       I_VMOVQ,
+       I_VMOVQQA,
+       I_VMOVQQU,
+       I_VMOVSD,
+       I_VMOVSHDUP,
+       I_VMOVSLDUP,
+       I_VMOVSS,
+       I_VMOVUPD,
+       I_VMOVUPS,
+       I_VMPSADBW,
+       I_VMPTRLD,
+       I_VMPTRST,
+       I_VMREAD,
+       I_VMRESUME,
+       I_VMRUN,
+       I_VMSAVE,
+       I_VMULPD,
+       I_VMULPS,
+       I_VMULSD,
+       I_VMULSS,
+       I_VMWRITE,
+       I_VMXOFF,
+       I_VMXON,
+       I_VORPD,
+       I_VORPS,
+       I_VPABSB,
+       I_VPABSD,
+       I_VPABSW,
+       I_VPACKSSDW,
+       I_VPACKSSWB,
+       I_VPACKUSDW,
+       I_VPACKUSWB,
+       I_VPADDB,
+       I_VPADDD,
+       I_VPADDQ,
+       I_VPADDSB,
+       I_VPADDSW,
+       I_VPADDUSB,
+       I_VPADDUSW,
+       I_VPADDW,
+       I_VPALIGNR,
+       I_VPAND,
+       I_VPANDN,
+       I_VPAVGB,
+       I_VPAVGW,
+       I_VPBLENDVB,
+       I_VPBLENDW,
+       I_VPCLMULHQHQDQ,
+       I_VPCLMULHQLQDQ,
+       I_VPCLMULLQHQDQ,
+       I_VPCLMULLQLQDQ,
+       I_VPCLMULQDQ,
+       I_VPCMOV,
+       I_VPCMPEQB,
+       I_VPCMPEQD,
+       I_VPCMPEQQ,
+       I_VPCMPEQW,
+       I_VPCMPESTRI,
+       I_VPCMPESTRM,
+       I_VPCMPGTB,
+       I_VPCMPGTD,
+       I_VPCMPGTQ,
+       I_VPCMPGTW,
+       I_VPCMPISTRI,
+       I_VPCMPISTRM,
+       I_VPCOMB,
+       I_VPCOMD,
+       I_VPCOMQ,
+       I_VPCOMUB,
+       I_VPCOMUD,
+       I_VPCOMUQ,
+       I_VPCOMUW,
+       I_VPCOMW,
+       I_VPERM2F128,
+       I_VPERMIL2PD,
+       I_VPERMIL2PS,
+       I_VPERMILMO2PD,
+       I_VPERMILMO2PS,
+       I_VPERMILMZ2PD,
+       I_VPERMILMZ2PS,
+       I_VPERMILPD,
+       I_VPERMILPS,
+       I_VPERMILTD2PD,
+       I_VPERMILTD2PS,
+       I_VPEXTRB,
+       I_VPEXTRD,
+       I_VPEXTRQ,
+       I_VPEXTRW,
+       I_VPHADDBD,
+       I_VPHADDBQ,
+       I_VPHADDBW,
+       I_VPHADDD,
+       I_VPHADDDQ,
+       I_VPHADDSW,
+       I_VPHADDUBD,
+       I_VPHADDUBQ,
+       I_VPHADDUBW,
+       I_VPHADDUDQ,
+       I_VPHADDUWD,
+       I_VPHADDUWQ,
+       I_VPHADDW,
+       I_VPHADDWD,
+       I_VPHADDWQ,
+       I_VPHMINPOSUW,
+       I_VPHSUBBW,
+       I_VPHSUBD,
+       I_VPHSUBDQ,
+       I_VPHSUBSW,
+       I_VPHSUBW,
+       I_VPHSUBWD,
+       I_VPINSRB,
+       I_VPINSRD,
+       I_VPINSRQ,
+       I_VPINSRW,
+       I_VPMACSDD,
+       I_VPMACSDQH,
+       I_VPMACSDQL,
+       I_VPMACSSDD,
+       I_VPMACSSDQH,
+       I_VPMACSSDQL,
+       I_VPMACSSWD,
+       I_VPMACSSWW,
+       I_VPMACSWD,
+       I_VPMACSWW,
+       I_VPMADCSSWD,
+       I_VPMADCSWD,
+       I_VPMADDUBSW,
+       I_VPMADDWD,
+       I_VPMAXSB,
+       I_VPMAXSD,
+       I_VPMAXSW,
+       I_VPMAXUB,
+       I_VPMAXUD,
+       I_VPMAXUW,
+       I_VPMINSB,
+       I_VPMINSD,
+       I_VPMINSW,
+       I_VPMINUB,
+       I_VPMINUD,
+       I_VPMINUW,
+       I_VPMOVMSKB,
+       I_VPMOVSXBD,
+       I_VPMOVSXBQ,
+       I_VPMOVSXBW,
+       I_VPMOVSXDQ,
+       I_VPMOVSXWD,
+       I_VPMOVSXWQ,
+       I_VPMOVZXBD,
+       I_VPMOVZXBQ,
+       I_VPMOVZXBW,
+       I_VPMOVZXDQ,
+       I_VPMOVZXWD,
+       I_VPMOVZXWQ,
+       I_VPMULDQ,
+       I_VPMULHRSW,
+       I_VPMULHUW,
+       I_VPMULHW,
+       I_VPMULLD,
+       I_VPMULLW,
+       I_VPMULUDQ,
+       I_VPOR,
+       I_VPPERM,
+       I_VPROTB,
+       I_VPROTD,
+       I_VPROTQ,
+       I_VPROTW,
+       I_VPSADBW,
+       I_VPSHAB,
+       I_VPSHAD,
+       I_VPSHAQ,
+       I_VPSHAW,
+       I_VPSHLB,
+       I_VPSHLD,
+       I_VPSHLQ,
+       I_VPSHLW,
+       I_VPSHUFB,
+       I_VPSHUFD,
+       I_VPSHUFHW,
+       I_VPSHUFLW,
+       I_VPSIGNB,
+       I_VPSIGND,
+       I_VPSIGNW,
+       I_VPSLLD,
+       I_VPSLLDQ,
+       I_VPSLLQ,
+       I_VPSLLW,
+       I_VPSRAD,
+       I_VPSRAW,
+       I_VPSRLD,
+       I_VPSRLDQ,
+       I_VPSRLQ,
+       I_VPSRLW,
+       I_VPSUBB,
+       I_VPSUBD,
+       I_VPSUBQ,
+       I_VPSUBSB,
+       I_VPSUBSW,
+       I_VPSUBUSB,
+       I_VPSUBUSW,
+       I_VPSUBW,
+       I_VPTEST,
+       I_VPUNPCKHBW,
+       I_VPUNPCKHDQ,
+       I_VPUNPCKHQDQ,
+       I_VPUNPCKHWD,
+       I_VPUNPCKLBW,
+       I_VPUNPCKLDQ,
+       I_VPUNPCKLQDQ,
+       I_VPUNPCKLWD,
+       I_VPXOR,
+       I_VRCPPS,
+       I_VRCPSS,
+       I_VROUNDPD,
+       I_VROUNDPS,
+       I_VROUNDSD,
+       I_VROUNDSS,
+       I_VRSQRTPS,
+       I_VRSQRTSS,
+       I_VSHUFPD,
+       I_VSHUFPS,
+       I_VSQRTPD,
+       I_VSQRTPS,
+       I_VSQRTSD,
+       I_VSQRTSS,
+       I_VSTMXCSR,
+       I_VSUBPD,
+       I_VSUBPS,
+       I_VSUBSD,
+       I_VSUBSS,
+       I_VTESTPD,
+       I_VTESTPS,
+       I_VUCOMISD,
+       I_VUCOMISS,
+       I_VUNPCKHPD,
+       I_VUNPCKHPS,
+       I_VUNPCKLPD,
+       I_VUNPCKLPS,
+       I_VXORPD,
+       I_VXORPS,
+       I_VZEROALL,
+       I_VZEROUPPER,
+       I_WBINVD,
+       I_WRMSR,
+       I_WRSHR,
+       I_XADD,
+       I_XBTS,
+       I_XCHG,
+       I_XCRYPTCBC,
+       I_XCRYPTCFB,
+       I_XCRYPTCTR,
+       I_XCRYPTECB,
+       I_XCRYPTOFB,
+       I_XGETBV,
+       I_XLAT,
+       I_XLATB,
+       I_XOR,
+       I_XORPD,
+       I_XORPS,
+       I_XRSTOR,
+       I_XSAVE,
+       I_XSETBV,
+       I_XSHA1,
+       I_XSHA256,
+       I_XSTORE,
+       I_CMOVcc,
+       I_Jcc,
+       I_SETcc,
+       I_none = -1
+};
+
+#define MAX_INSLEN 16
+#define FIRST_COND_OPCODE I_CMOVcc
+
+#endif /* NASM_INSNSI_H */
diff --git a/insnsn.c b/insnsn.c
new file mode 100644 (file)
index 0000000..cc27126
--- /dev/null
+++ b/insnsn.c
@@ -0,0 +1,1384 @@
+/* This file is auto-generated from insns.dat by insns.pl - don't edit it */
+
+#include "tables.h"
+
+const char * const nasm_insn_names[] = {
+       "aaa",
+       "aad",
+       "aam",
+       "aas",
+       "adc",
+       "add",
+       "addpd",
+       "addps",
+       "addsd",
+       "addss",
+       "addsubpd",
+       "addsubps",
+       "aesdec",
+       "aesdeclast",
+       "aesenc",
+       "aesenclast",
+       "aesimc",
+       "aeskeygenassist",
+       "and",
+       "andnpd",
+       "andnps",
+       "andpd",
+       "andps",
+       "arpl",
+       "bb0_reset",
+       "bb1_reset",
+       "blendpd",
+       "blendps",
+       "blendvpd",
+       "blendvps",
+       "bound",
+       "bsf",
+       "bsr",
+       "bswap",
+       "bt",
+       "btc",
+       "btr",
+       "bts",
+       "call",
+       "cbw",
+       "cdq",
+       "cdqe",
+       "clc",
+       "cld",
+       "clflush",
+       "clgi",
+       "cli",
+       "clts",
+       "cmc",
+       "cmp",
+       "cmpeqpd",
+       "cmpeqps",
+       "cmpeqsd",
+       "cmpeqss",
+       "cmplepd",
+       "cmpleps",
+       "cmplesd",
+       "cmpless",
+       "cmpltpd",
+       "cmpltps",
+       "cmpltsd",
+       "cmpltss",
+       "cmpneqpd",
+       "cmpneqps",
+       "cmpneqsd",
+       "cmpneqss",
+       "cmpnlepd",
+       "cmpnleps",
+       "cmpnlesd",
+       "cmpnless",
+       "cmpnltpd",
+       "cmpnltps",
+       "cmpnltsd",
+       "cmpnltss",
+       "cmpordpd",
+       "cmpordps",
+       "cmpordsd",
+       "cmpordss",
+       "cmppd",
+       "cmpps",
+       "cmpsb",
+       "cmpsd",
+       "cmpsq",
+       "cmpss",
+       "cmpsw",
+       "cmpunordpd",
+       "cmpunordps",
+       "cmpunordsd",
+       "cmpunordss",
+       "cmpxchg",
+       "cmpxchg16b",
+       "cmpxchg486",
+       "cmpxchg8b",
+       "comisd",
+       "comiss",
+       "cpuid",
+       "cpu_read",
+       "cpu_write",
+       "cqo",
+       "crc32",
+       "cvtdq2pd",
+       "cvtdq2ps",
+       "cvtpd2dq",
+       "cvtpd2pi",
+       "cvtpd2ps",
+       "cvtpi2pd",
+       "cvtpi2ps",
+       "cvtps2dq",
+       "cvtps2pd",
+       "cvtps2pi",
+       "cvtsd2si",
+       "cvtsd2ss",
+       "cvtsi2sd",
+       "cvtsi2ss",
+       "cvtss2sd",
+       "cvtss2si",
+       "cvttpd2dq",
+       "cvttpd2pi",
+       "cvttps2dq",
+       "cvttps2pi",
+       "cvttsd2si",
+       "cvttss2si",
+       "cwd",
+       "cwde",
+       "daa",
+       "das",
+       "db",
+       "dd",
+       "dec",
+       "div",
+       "divpd",
+       "divps",
+       "divsd",
+       "divss",
+       "dmint",
+       "do",
+       "dppd",
+       "dpps",
+       "dq",
+       "dt",
+       "dw",
+       "dy",
+       "emms",
+       "enter",
+       "equ",
+       "extractps",
+       "extrq",
+       "f2xm1",
+       "fabs",
+       "fadd",
+       "faddp",
+       "fbld",
+       "fbstp",
+       "fchs",
+       "fclex",
+       "fcmovb",
+       "fcmovbe",
+       "fcmove",
+       "fcmovnb",
+       "fcmovnbe",
+       "fcmovne",
+       "fcmovnu",
+       "fcmovu",
+       "fcom",
+       "fcomi",
+       "fcomip",
+       "fcomp",
+       "fcompp",
+       "fcos",
+       "fdecstp",
+       "fdisi",
+       "fdiv",
+       "fdivp",
+       "fdivr",
+       "fdivrp",
+       "femms",
+       "feni",
+       "ffree",
+       "ffreep",
+       "fiadd",
+       "ficom",
+       "ficomp",
+       "fidiv",
+       "fidivr",
+       "fild",
+       "fimul",
+       "fincstp",
+       "finit",
+       "fist",
+       "fistp",
+       "fisttp",
+       "fisub",
+       "fisubr",
+       "fld",
+       "fld1",
+       "fldcw",
+       "fldenv",
+       "fldl2e",
+       "fldl2t",
+       "fldlg2",
+       "fldln2",
+       "fldpi",
+       "fldz",
+       "fmul",
+       "fmulp",
+       "fnclex",
+       "fndisi",
+       "fneni",
+       "fninit",
+       "fnop",
+       "fnsave",
+       "fnstcw",
+       "fnstenv",
+       "fnstsw",
+       "fpatan",
+       "fprem",
+       "fprem1",
+       "fptan",
+       "frndint",
+       "frstor",
+       "fsave",
+       "fscale",
+       "fsetpm",
+       "fsin",
+       "fsincos",
+       "fsqrt",
+       "fst",
+       "fstcw",
+       "fstenv",
+       "fstp",
+       "fstsw",
+       "fsub",
+       "fsubp",
+       "fsubr",
+       "fsubrp",
+       "ftst",
+       "fucom",
+       "fucomi",
+       "fucomip",
+       "fucomp",
+       "fucompp",
+       "fwait",
+       "fxam",
+       "fxch",
+       "fxrstor",
+       "fxsave",
+       "fxtract",
+       "fyl2x",
+       "fyl2xp1",
+       "getsec",
+       "haddpd",
+       "haddps",
+       "hint_nop0",
+       "hint_nop1",
+       "hint_nop10",
+       "hint_nop11",
+       "hint_nop12",
+       "hint_nop13",
+       "hint_nop14",
+       "hint_nop15",
+       "hint_nop16",
+       "hint_nop17",
+       "hint_nop18",
+       "hint_nop19",
+       "hint_nop2",
+       "hint_nop20",
+       "hint_nop21",
+       "hint_nop22",
+       "hint_nop23",
+       "hint_nop24",
+       "hint_nop25",
+       "hint_nop26",
+       "hint_nop27",
+       "hint_nop28",
+       "hint_nop29",
+       "hint_nop3",
+       "hint_nop30",
+       "hint_nop31",
+       "hint_nop32",
+       "hint_nop33",
+       "hint_nop34",
+       "hint_nop35",
+       "hint_nop36",
+       "hint_nop37",
+       "hint_nop38",
+       "hint_nop39",
+       "hint_nop4",
+       "hint_nop40",
+       "hint_nop41",
+       "hint_nop42",
+       "hint_nop43",
+       "hint_nop44",
+       "hint_nop45",
+       "hint_nop46",
+       "hint_nop47",
+       "hint_nop48",
+       "hint_nop49",
+       "hint_nop5",
+       "hint_nop50",
+       "hint_nop51",
+       "hint_nop52",
+       "hint_nop53",
+       "hint_nop54",
+       "hint_nop55",
+       "hint_nop56",
+       "hint_nop57",
+       "hint_nop58",
+       "hint_nop59",
+       "hint_nop6",
+       "hint_nop60",
+       "hint_nop61",
+       "hint_nop62",
+       "hint_nop63",
+       "hint_nop7",
+       "hint_nop8",
+       "hint_nop9",
+       "hlt",
+       "hsubpd",
+       "hsubps",
+       "ibts",
+       "icebp",
+       "idiv",
+       "imul",
+       "in",
+       "inc",
+       "incbin",
+       "insb",
+       "insd",
+       "insertps",
+       "insertq",
+       "insw",
+       "int",
+       "int01",
+       "int03",
+       "int1",
+       "int3",
+       "into",
+       "invd",
+       "invept",
+       "invlpg",
+       "invlpga",
+       "invvpid",
+       "iret",
+       "iretd",
+       "iretq",
+       "iretw",
+       "jcxz",
+       "jecxz",
+       "jmp",
+       "jmpe",
+       "jrcxz",
+       "lahf",
+       "lar",
+       "lddqu",
+       "ldmxcsr",
+       "lds",
+       "lea",
+       "leave",
+       "les",
+       "lfence",
+       "lfs",
+       "lgdt",
+       "lgs",
+       "lidt",
+       "lldt",
+       "llwpcb",
+       "lmsw",
+       "loadall",
+       "loadall286",
+       "lodsb",
+       "lodsd",
+       "lodsq",
+       "lodsw",
+       "loop",
+       "loope",
+       "loopne",
+       "loopnz",
+       "loopz",
+       "lsl",
+       "lss",
+       "ltr",
+       "lwpins",
+       "lwpval",
+       "lzcnt",
+       "maskmovdqu",
+       "maskmovq",
+       "maxpd",
+       "maxps",
+       "maxsd",
+       "maxss",
+       "mfence",
+       "minpd",
+       "minps",
+       "minsd",
+       "minss",
+       "monitor",
+       "montmul",
+       "mov",
+       "movapd",
+       "movaps",
+       "movbe",
+       "movd",
+       "movddup",
+       "movdq2q",
+       "movdqa",
+       "movdqu",
+       "movhlps",
+       "movhpd",
+       "movhps",
+       "movlhps",
+       "movlpd",
+       "movlps",
+       "movmskpd",
+       "movmskps",
+       "movntdq",
+       "movntdqa",
+       "movnti",
+       "movntpd",
+       "movntps",
+       "movntq",
+       "movntsd",
+       "movntss",
+       "movq",
+       "movq2dq",
+       "movsb",
+       "movsd",
+       "movshdup",
+       "movsldup",
+       "movsq",
+       "movss",
+       "movsw",
+       "movsx",
+       "movsxd",
+       "movupd",
+       "movups",
+       "movzx",
+       "mpsadbw",
+       "mul",
+       "mulpd",
+       "mulps",
+       "mulsd",
+       "mulss",
+       "mwait",
+       "neg",
+       "nop",
+       "not",
+       "or",
+       "orpd",
+       "orps",
+       "out",
+       "outsb",
+       "outsd",
+       "outsw",
+       "pabsb",
+       "pabsd",
+       "pabsw",
+       "packssdw",
+       "packsswb",
+       "packusdw",
+       "packuswb",
+       "paddb",
+       "paddd",
+       "paddq",
+       "paddsb",
+       "paddsiw",
+       "paddsw",
+       "paddusb",
+       "paddusw",
+       "paddw",
+       "palignr",
+       "pand",
+       "pandn",
+       "pause",
+       "paveb",
+       "pavgb",
+       "pavgusb",
+       "pavgw",
+       "pblendvb",
+       "pblendw",
+       "pclmulhqhqdq",
+       "pclmulhqlqdq",
+       "pclmullqhqdq",
+       "pclmullqlqdq",
+       "pclmulqdq",
+       "pcmpeqb",
+       "pcmpeqd",
+       "pcmpeqq",
+       "pcmpeqw",
+       "pcmpestri",
+       "pcmpestrm",
+       "pcmpgtb",
+       "pcmpgtd",
+       "pcmpgtq",
+       "pcmpgtw",
+       "pcmpistri",
+       "pcmpistrm",
+       "pdistib",
+       "pextrb",
+       "pextrd",
+       "pextrq",
+       "pextrw",
+       "pf2id",
+       "pf2iw",
+       "pfacc",
+       "pfadd",
+       "pfcmpeq",
+       "pfcmpge",
+       "pfcmpgt",
+       "pfmax",
+       "pfmin",
+       "pfmul",
+       "pfnacc",
+       "pfpnacc",
+       "pfrcp",
+       "pfrcpit1",
+       "pfrcpit2",
+       "pfrcpv",
+       "pfrsqit1",
+       "pfrsqrt",
+       "pfrsqrtv",
+       "pfsub",
+       "pfsubr",
+       "phaddd",
+       "phaddsw",
+       "phaddw",
+       "phminposuw",
+       "phsubd",
+       "phsubsw",
+       "phsubw",
+       "pi2fd",
+       "pi2fw",
+       "pinsrb",
+       "pinsrd",
+       "pinsrq",
+       "pinsrw",
+       "pmachriw",
+       "pmaddubsw",
+       "pmaddwd",
+       "pmagw",
+       "pmaxsb",
+       "pmaxsd",
+       "pmaxsw",
+       "pmaxub",
+       "pmaxud",
+       "pmaxuw",
+       "pminsb",
+       "pminsd",
+       "pminsw",
+       "pminub",
+       "pminud",
+       "pminuw",
+       "pmovmskb",
+       "pmovsxbd",
+       "pmovsxbq",
+       "pmovsxbw",
+       "pmovsxdq",
+       "pmovsxwd",
+       "pmovsxwq",
+       "pmovzxbd",
+       "pmovzxbq",
+       "pmovzxbw",
+       "pmovzxdq",
+       "pmovzxwd",
+       "pmovzxwq",
+       "pmuldq",
+       "pmulhriw",
+       "pmulhrsw",
+       "pmulhrwa",
+       "pmulhrwc",
+       "pmulhuw",
+       "pmulhw",
+       "pmulld",
+       "pmullw",
+       "pmuludq",
+       "pmvgezb",
+       "pmvlzb",
+       "pmvnzb",
+       "pmvzb",
+       "pop",
+       "popa",
+       "popad",
+       "popaw",
+       "popcnt",
+       "popf",
+       "popfd",
+       "popfq",
+       "popfw",
+       "por",
+       "prefetch",
+       "prefetchnta",
+       "prefetcht0",
+       "prefetcht1",
+       "prefetcht2",
+       "prefetchw",
+       "psadbw",
+       "pshufb",
+       "pshufd",
+       "pshufhw",
+       "pshuflw",
+       "pshufw",
+       "psignb",
+       "psignd",
+       "psignw",
+       "pslld",
+       "pslldq",
+       "psllq",
+       "psllw",
+       "psrad",
+       "psraw",
+       "psrld",
+       "psrldq",
+       "psrlq",
+       "psrlw",
+       "psubb",
+       "psubd",
+       "psubq",
+       "psubsb",
+       "psubsiw",
+       "psubsw",
+       "psubusb",
+       "psubusw",
+       "psubw",
+       "pswapd",
+       "ptest",
+       "punpckhbw",
+       "punpckhdq",
+       "punpckhqdq",
+       "punpckhwd",
+       "punpcklbw",
+       "punpckldq",
+       "punpcklqdq",
+       "punpcklwd",
+       "push",
+       "pusha",
+       "pushad",
+       "pushaw",
+       "pushf",
+       "pushfd",
+       "pushfq",
+       "pushfw",
+       "pxor",
+       "rcl",
+       "rcpps",
+       "rcpss",
+       "rcr",
+       "rdm",
+       "rdmsr",
+       "rdpmc",
+       "rdshr",
+       "rdtsc",
+       "rdtscp",
+       "resb",
+       "resd",
+       "reso",
+       "resq",
+       "rest",
+       "resw",
+       "resy",
+       "ret",
+       "retf",
+       "retn",
+       "rol",
+       "ror",
+       "roundpd",
+       "roundps",
+       "roundsd",
+       "roundss",
+       "rsdc",
+       "rsldt",
+       "rsm",
+       "rsqrtps",
+       "rsqrtss",
+       "rsts",
+       "sahf",
+       "sal",
+       "salc",
+       "sar",
+       "sbb",
+       "scasb",
+       "scasd",
+       "scasq",
+       "scasw",
+       "sfence",
+       "sgdt",
+       "shl",
+       "shld",
+       "shr",
+       "shrd",
+       "shufpd",
+       "shufps",
+       "sidt",
+       "skinit",
+       "sldt",
+       "slwpcb",
+       "smi",
+       "smint",
+       "smintold",
+       "smsw",
+       "sqrtpd",
+       "sqrtps",
+       "sqrtsd",
+       "sqrtss",
+       "stc",
+       "std",
+       "stgi",
+       "sti",
+       "stmxcsr",
+       "stosb",
+       "stosd",
+       "stosq",
+       "stosw",
+       "str",
+       "sub",
+       "subpd",
+       "subps",
+       "subsd",
+       "subss",
+       "svdc",
+       "svldt",
+       "svts",
+       "swapgs",
+       "syscall",
+       "sysenter",
+       "sysexit",
+       "sysret",
+       "test",
+       "ucomisd",
+       "ucomiss",
+       "ud0",
+       "ud1",
+       "ud2",
+       "ud2a",
+       "ud2b",
+       "umov",
+       "unpckhpd",
+       "unpckhps",
+       "unpcklpd",
+       "unpcklps",
+       "vaddpd",
+       "vaddps",
+       "vaddsd",
+       "vaddss",
+       "vaddsubpd",
+       "vaddsubps",
+       "vaesdec",
+       "vaesdeclast",
+       "vaesenc",
+       "vaesenclast",
+       "vaesimc",
+       "vaeskeygenassist",
+       "vandnpd",
+       "vandnps",
+       "vandpd",
+       "vandps",
+       "vblendpd",
+       "vblendps",
+       "vblendvpd",
+       "vblendvps",
+       "vbroadcastf128",
+       "vbroadcastsd",
+       "vbroadcastss",
+       "vcmpeqpd",
+       "vcmpeqps",
+       "vcmpeqsd",
+       "vcmpeqss",
+       "vcmpeq_ospd",
+       "vcmpeq_osps",
+       "vcmpeq_ossd",
+       "vcmpeq_osss",
+       "vcmpeq_uqpd",
+       "vcmpeq_uqps",
+       "vcmpeq_uqsd",
+       "vcmpeq_uqss",
+       "vcmpeq_uspd",
+       "vcmpeq_usps",
+       "vcmpeq_ussd",
+       "vcmpeq_usss",
+       "vcmpfalsepd",
+       "vcmpfalseps",
+       "vcmpfalsesd",
+       "vcmpfalsess",
+       "vcmpfalse_ospd",
+       "vcmpfalse_osps",
+       "vcmpfalse_ossd",
+       "vcmpfalse_osss",
+       "vcmpgepd",
+       "vcmpgeps",
+       "vcmpgesd",
+       "vcmpgess",
+       "vcmpge_oqpd",
+       "vcmpge_oqps",
+       "vcmpge_oqsd",
+       "vcmpge_oqss",
+       "vcmpgtpd",
+       "vcmpgtps",
+       "vcmpgtsd",
+       "vcmpgtss",
+       "vcmpgt_oqpd",
+       "vcmpgt_oqps",
+       "vcmpgt_oqsd",
+       "vcmpgt_oqss",
+       "vcmplepd",
+       "vcmpleps",
+       "vcmplesd",
+       "vcmpless",
+       "vcmple_oqpd",
+       "vcmple_oqps",
+       "vcmple_oqsd",
+       "vcmple_oqss",
+       "vcmpltpd",
+       "vcmpltps",
+       "vcmpltsd",
+       "vcmpltss",
+       "vcmplt_oqpd",
+       "vcmplt_oqps",
+       "vcmplt_oqsd",
+       "vcmplt_oqss",
+       "vcmpneqpd",
+       "vcmpneqps",
+       "vcmpneqsd",
+       "vcmpneqss",
+       "vcmpneq_oqpd",
+       "vcmpneq_oqps",
+       "vcmpneq_oqsd",
+       "vcmpneq_oqss",
+       "vcmpneq_ospd",
+       "vcmpneq_osps",
+       "vcmpneq_ossd",
+       "vcmpneq_osss",
+       "vcmpneq_uspd",
+       "vcmpneq_usps",
+       "vcmpneq_ussd",
+       "vcmpneq_usss",
+       "vcmpngepd",
+       "vcmpngeps",
+       "vcmpngesd",
+       "vcmpngess",
+       "vcmpnge_uqpd",
+       "vcmpnge_uqps",
+       "vcmpnge_uqsd",
+       "vcmpnge_uqss",
+       "vcmpngtpd",
+       "vcmpngtps",
+       "vcmpngtsd",
+       "vcmpngtss",
+       "vcmpngt_uqpd",
+       "vcmpngt_uqps",
+       "vcmpngt_uqsd",
+       "vcmpngt_uqss",
+       "vcmpnlepd",
+       "vcmpnleps",
+       "vcmpnlesd",
+       "vcmpnless",
+       "vcmpnle_uqpd",
+       "vcmpnle_uqps",
+       "vcmpnle_uqsd",
+       "vcmpnle_uqss",
+       "vcmpnltpd",
+       "vcmpnltps",
+       "vcmpnltsd",
+       "vcmpnltss",
+       "vcmpnlt_uqpd",
+       "vcmpnlt_uqps",
+       "vcmpnlt_uqsd",
+       "vcmpnlt_uqss",
+       "vcmpordpd",
+       "vcmpordps",
+       "vcmpordsd",
+       "vcmpordss",
+       "vcmpord_spd",
+       "vcmpord_sps",
+       "vcmpord_ssd",
+       "vcmpord_sss",
+       "vcmppd",
+       "vcmpps",
+       "vcmpsd",
+       "vcmpss",
+       "vcmptruepd",
+       "vcmptrueps",
+       "vcmptruesd",
+       "vcmptruess",
+       "vcmptrue_uspd",
+       "vcmptrue_usps",
+       "vcmptrue_ussd",
+       "vcmptrue_usss",
+       "vcmpunordpd",
+       "vcmpunordps",
+       "vcmpunordsd",
+       "vcmpunordss",
+       "vcmpunord_spd",
+       "vcmpunord_sps",
+       "vcmpunord_ssd",
+       "vcmpunord_sss",
+       "vcomisd",
+       "vcomiss",
+       "vcvtdq2pd",
+       "vcvtdq2ps",
+       "vcvtpd2dq",
+       "vcvtpd2ps",
+       "vcvtph2ps",
+       "vcvtps2dq",
+       "vcvtps2pd",
+       "vcvtps2ph",
+       "vcvtsd2si",
+       "vcvtsd2ss",
+       "vcvtsi2sd",
+       "vcvtsi2ss",
+       "vcvtss2sd",
+       "vcvtss2si",
+       "vcvttpd2dq",
+       "vcvttps2dq",
+       "vcvttsd2si",
+       "vcvttss2si",
+       "vdivpd",
+       "vdivps",
+       "vdivsd",
+       "vdivss",
+       "vdppd",
+       "vdpps",
+       "verr",
+       "verw",
+       "vextractf128",
+       "vextractps",
+       "vfmadd123pd",
+       "vfmadd123ps",
+       "vfmadd123sd",
+       "vfmadd123ss",
+       "vfmadd132pd",
+       "vfmadd132ps",
+       "vfmadd132sd",
+       "vfmadd132ss",
+       "vfmadd213pd",
+       "vfmadd213ps",
+       "vfmadd213sd",
+       "vfmadd213ss",
+       "vfmadd231pd",
+       "vfmadd231ps",
+       "vfmadd231sd",
+       "vfmadd231ss",
+       "vfmadd312pd",
+       "vfmadd312ps",
+       "vfmadd312sd",
+       "vfmadd312ss",
+       "vfmadd321pd",
+       "vfmadd321ps",
+       "vfmadd321sd",
+       "vfmadd321ss",
+       "vfmaddpd",
+       "vfmaddps",
+       "vfmaddsd",
+       "vfmaddss",
+       "vfmaddsub123pd",
+       "vfmaddsub123ps",
+       "vfmaddsub132pd",
+       "vfmaddsub132ps",
+       "vfmaddsub213pd",
+       "vfmaddsub213ps",
+       "vfmaddsub231pd",
+       "vfmaddsub231ps",
+       "vfmaddsub312pd",
+       "vfmaddsub312ps",
+       "vfmaddsub321pd",
+       "vfmaddsub321ps",
+       "vfmaddsubpd",
+       "vfmaddsubps",
+       "vfmsub123pd",
+       "vfmsub123ps",
+       "vfmsub123sd",
+       "vfmsub123ss",
+       "vfmsub132pd",
+       "vfmsub132ps",
+       "vfmsub132sd",
+       "vfmsub132ss",
+       "vfmsub213pd",
+       "vfmsub213ps",
+       "vfmsub213sd",
+       "vfmsub213ss",
+       "vfmsub231pd",
+       "vfmsub231ps",
+       "vfmsub231sd",
+       "vfmsub231ss",
+       "vfmsub312pd",
+       "vfmsub312ps",
+       "vfmsub312sd",
+       "vfmsub312ss",
+       "vfmsub321pd",
+       "vfmsub321ps",
+       "vfmsub321sd",
+       "vfmsub321ss",
+       "vfmsubadd123pd",
+       "vfmsubadd123ps",
+       "vfmsubadd132pd",
+       "vfmsubadd132ps",
+       "vfmsubadd213pd",
+       "vfmsubadd213ps",
+       "vfmsubadd231pd",
+       "vfmsubadd231ps",
+       "vfmsubadd312pd",
+       "vfmsubadd312ps",
+       "vfmsubadd321pd",
+       "vfmsubadd321ps",
+       "vfmsubaddpd",
+       "vfmsubaddps",
+       "vfmsubpd",
+       "vfmsubps",
+       "vfmsubsd",
+       "vfmsubss",
+       "vfnmadd123pd",
+       "vfnmadd123ps",
+       "vfnmadd123sd",
+       "vfnmadd123ss",
+       "vfnmadd132pd",
+       "vfnmadd132ps",
+       "vfnmadd132sd",
+       "vfnmadd132ss",
+       "vfnmadd213pd",
+       "vfnmadd213ps",
+       "vfnmadd213sd",
+       "vfnmadd213ss",
+       "vfnmadd231pd",
+       "vfnmadd231ps",
+       "vfnmadd231sd",
+       "vfnmadd231ss",
+       "vfnmadd312pd",
+       "vfnmadd312ps",
+       "vfnmadd312sd",
+       "vfnmadd312ss",
+       "vfnmadd321pd",
+       "vfnmadd321ps",
+       "vfnmadd321sd",
+       "vfnmadd321ss",
+       "vfnmaddpd",
+       "vfnmaddps",
+       "vfnmaddsd",
+       "vfnmaddss",
+       "vfnmsub123pd",
+       "vfnmsub123ps",
+       "vfnmsub123sd",
+       "vfnmsub123ss",
+       "vfnmsub132pd",
+       "vfnmsub132ps",
+       "vfnmsub132sd",
+       "vfnmsub132ss",
+       "vfnmsub213pd",
+       "vfnmsub213ps",
+       "vfnmsub213sd",
+       "vfnmsub213ss",
+       "vfnmsub231pd",
+       "vfnmsub231ps",
+       "vfnmsub231sd",
+       "vfnmsub231ss",
+       "vfnmsub312pd",
+       "vfnmsub312ps",
+       "vfnmsub312sd",
+       "vfnmsub312ss",
+       "vfnmsub321pd",
+       "vfnmsub321ps",
+       "vfnmsub321sd",
+       "vfnmsub321ss",
+       "vfnmsubpd",
+       "vfnmsubps",
+       "vfnmsubsd",
+       "vfnmsubss",
+       "vfrczpd",
+       "vfrczps",
+       "vfrczsd",
+       "vfrczss",
+       "vhaddpd",
+       "vhaddps",
+       "vhsubpd",
+       "vhsubps",
+       "vinsertf128",
+       "vinsertps",
+       "vlddqu",
+       "vldmxcsr",
+       "vldqqu",
+       "vmaskmovdqu",
+       "vmaskmovpd",
+       "vmaskmovps",
+       "vmaxpd",
+       "vmaxps",
+       "vmaxsd",
+       "vmaxss",
+       "vmcall",
+       "vmclear",
+       "vminpd",
+       "vminps",
+       "vminsd",
+       "vminss",
+       "vmlaunch",
+       "vmload",
+       "vmmcall",
+       "vmovapd",
+       "vmovaps",
+       "vmovd",
+       "vmovddup",
+       "vmovdqa",
+       "vmovdqu",
+       "vmovhlps",
+       "vmovhpd",
+       "vmovhps",
+       "vmovlhps",
+       "vmovlpd",
+       "vmovlps",
+       "vmovmskpd",
+       "vmovmskps",
+       "vmovntdq",
+       "vmovntdqa",
+       "vmovntpd",
+       "vmovntps",
+       "vmovntqq",
+       "vmovq",
+       "vmovqqa",
+       "vmovqqu",
+       "vmovsd",
+       "vmovshdup",
+       "vmovsldup",
+       "vmovss",
+       "vmovupd",
+       "vmovups",
+       "vmpsadbw",
+       "vmptrld",
+       "vmptrst",
+       "vmread",
+       "vmresume",
+       "vmrun",
+       "vmsave",
+       "vmulpd",
+       "vmulps",
+       "vmulsd",
+       "vmulss",
+       "vmwrite",
+       "vmxoff",
+       "vmxon",
+       "vorpd",
+       "vorps",
+       "vpabsb",
+       "vpabsd",
+       "vpabsw",
+       "vpackssdw",
+       "vpacksswb",
+       "vpackusdw",
+       "vpackuswb",
+       "vpaddb",
+       "vpaddd",
+       "vpaddq",
+       "vpaddsb",
+       "vpaddsw",
+       "vpaddusb",
+       "vpaddusw",
+       "vpaddw",
+       "vpalignr",
+       "vpand",
+       "vpandn",
+       "vpavgb",
+       "vpavgw",
+       "vpblendvb",
+       "vpblendw",
+       "vpclmulhqhqdq",
+       "vpclmulhqlqdq",
+       "vpclmullqhqdq",
+       "vpclmullqlqdq",
+       "vpclmulqdq",
+       "vpcmov",
+       "vpcmpeqb",
+       "vpcmpeqd",
+       "vpcmpeqq",
+       "vpcmpeqw",
+       "vpcmpestri",
+       "vpcmpestrm",
+       "vpcmpgtb",
+       "vpcmpgtd",
+       "vpcmpgtq",
+       "vpcmpgtw",
+       "vpcmpistri",
+       "vpcmpistrm",
+       "vpcomb",
+       "vpcomd",
+       "vpcomq",
+       "vpcomub",
+       "vpcomud",
+       "vpcomuq",
+       "vpcomuw",
+       "vpcomw",
+       "vperm2f128",
+       "vpermil2pd",
+       "vpermil2ps",
+       "vpermilmo2pd",
+       "vpermilmo2ps",
+       "vpermilmz2pd",
+       "vpermilmz2ps",
+       "vpermilpd",
+       "vpermilps",
+       "vpermiltd2pd",
+       "vpermiltd2ps",
+       "vpextrb",
+       "vpextrd",
+       "vpextrq",
+       "vpextrw",
+       "vphaddbd",
+       "vphaddbq",
+       "vphaddbw",
+       "vphaddd",
+       "vphadddq",
+       "vphaddsw",
+       "vphaddubd",
+       "vphaddubq",
+       "vphaddubw",
+       "vphaddudq",
+       "vphadduwd",
+       "vphadduwq",
+       "vphaddw",
+       "vphaddwd",
+       "vphaddwq",
+       "vphminposuw",
+       "vphsubbw",
+       "vphsubd",
+       "vphsubdq",
+       "vphsubsw",
+       "vphsubw",
+       "vphsubwd",
+       "vpinsrb",
+       "vpinsrd",
+       "vpinsrq",
+       "vpinsrw",
+       "vpmacsdd",
+       "vpmacsdqh",
+       "vpmacsdql",
+       "vpmacssdd",
+       "vpmacssdqh",
+       "vpmacssdql",
+       "vpmacsswd",
+       "vpmacssww",
+       "vpmacswd",
+       "vpmacsww",
+       "vpmadcsswd",
+       "vpmadcswd",
+       "vpmaddubsw",
+       "vpmaddwd",
+       "vpmaxsb",
+       "vpmaxsd",
+       "vpmaxsw",
+       "vpmaxub",
+       "vpmaxud",
+       "vpmaxuw",
+       "vpminsb",
+       "vpminsd",
+       "vpminsw",
+       "vpminub",
+       "vpminud",
+       "vpminuw",
+       "vpmovmskb",
+       "vpmovsxbd",
+       "vpmovsxbq",
+       "vpmovsxbw",
+       "vpmovsxdq",
+       "vpmovsxwd",
+       "vpmovsxwq",
+       "vpmovzxbd",
+       "vpmovzxbq",
+       "vpmovzxbw",
+       "vpmovzxdq",
+       "vpmovzxwd",
+       "vpmovzxwq",
+       "vpmuldq",
+       "vpmulhrsw",
+       "vpmulhuw",
+       "vpmulhw",
+       "vpmulld",
+       "vpmullw",
+       "vpmuludq",
+       "vpor",
+       "vpperm",
+       "vprotb",
+       "vprotd",
+       "vprotq",
+       "vprotw",
+       "vpsadbw",
+       "vpshab",
+       "vpshad",
+       "vpshaq",
+       "vpshaw",
+       "vpshlb",
+       "vpshld",
+       "vpshlq",
+       "vpshlw",
+       "vpshufb",
+       "vpshufd",
+       "vpshufhw",
+       "vpshuflw",
+       "vpsignb",
+       "vpsignd",
+       "vpsignw",
+       "vpslld",
+       "vpslldq",
+       "vpsllq",
+       "vpsllw",
+       "vpsrad",
+       "vpsraw",
+       "vpsrld",
+       "vpsrldq",
+       "vpsrlq",
+       "vpsrlw",
+       "vpsubb",
+       "vpsubd",
+       "vpsubq",
+       "vpsubsb",
+       "vpsubsw",
+       "vpsubusb",
+       "vpsubusw",
+       "vpsubw",
+       "vptest",
+       "vpunpckhbw",
+       "vpunpckhdq",
+       "vpunpckhqdq",
+       "vpunpckhwd",
+       "vpunpcklbw",
+       "vpunpckldq",
+       "vpunpcklqdq",
+       "vpunpcklwd",
+       "vpxor",
+       "vrcpps",
+       "vrcpss",
+       "vroundpd",
+       "vroundps",
+       "vroundsd",
+       "vroundss",
+       "vrsqrtps",
+       "vrsqrtss",
+       "vshufpd",
+       "vshufps",
+       "vsqrtpd",
+       "vsqrtps",
+       "vsqrtsd",
+       "vsqrtss",
+       "vstmxcsr",
+       "vsubpd",
+       "vsubps",
+       "vsubsd",
+       "vsubss",
+       "vtestpd",
+       "vtestps",
+       "vucomisd",
+       "vucomiss",
+       "vunpckhpd",
+       "vunpckhps",
+       "vunpcklpd",
+       "vunpcklps",
+       "vxorpd",
+       "vxorps",
+       "vzeroall",
+       "vzeroupper",
+       "wbinvd",
+       "wrmsr",
+       "wrshr",
+       "xadd",
+       "xbts",
+       "xchg",
+       "xcryptcbc",
+       "xcryptcfb",
+       "xcryptctr",
+       "xcryptecb",
+       "xcryptofb",
+       "xgetbv",
+       "xlat",
+       "xlatb",
+       "xor",
+       "xorpd",
+       "xorps",
+       "xrstor",
+       "xsave",
+       "xsetbv",
+       "xsha1",
+       "xsha256",
+       "xstore",
+       "cmov",
+       "j",
+       "set"
+};
diff --git a/install-sh b/install-sh
new file mode 100755 (executable)
index 0000000..f39433a
--- /dev/null
@@ -0,0 +1,250 @@
+#! /bin/sh
+# 
+# install - install a program, script, or datafile
+# This comes from X11R5 (mit/util/scripts/install.sh).
+#
+# Copyright 1991 by the Massachusetts Institute of Technology
+#
+# Permission to use, copy, modify, distribute, and sell this software and its
+# documentation for any purpose is hereby granted without fee, provided that
+# the above copyright notice appear in all copies and that both that
+# copyright notice and this permission notice appear in supporting
+# documentation, and that the name of M.I.T. not be used in advertising or
+# publicity pertaining to distribution of the software without specific,
+# written prior permission.  M.I.T. makes no representations about the
+# suitability of this software for any purpose.  It is provided "as is"
+# without express or implied warranty.
+#
+# Calling this script install-sh is preferred over install.sh, to prevent
+# `make' implicit rules from creating a file called install from it
+# when there is no Makefile.
+#
+# This script is compatible with the BSD install script, but was written
+# from scratch.  It can only install one file at a time, a restriction
+# shared with many OS's install programs.
+
+
+# set DOITPROG to echo to test this script
+
+# Don't use :- since 4.3BSD and earlier shells don't like it.
+doit="${DOITPROG-}"
+
+
+# put in absolute paths if you don't have them in your path; or use env. vars.
+
+mvprog="${MVPROG-mv}"
+cpprog="${CPPROG-cp}"
+chmodprog="${CHMODPROG-chmod}"
+chownprog="${CHOWNPROG-chown}"
+chgrpprog="${CHGRPPROG-chgrp}"
+stripprog="${STRIPPROG-strip}"
+rmprog="${RMPROG-rm}"
+mkdirprog="${MKDIRPROG-mkdir}"
+
+transformbasename=""
+transform_arg=""
+instcmd="$mvprog"
+chmodcmd="$chmodprog 0755"
+chowncmd=""
+chgrpcmd=""
+stripcmd=""
+rmcmd="$rmprog -f"
+mvcmd="$mvprog"
+src=""
+dst=""
+dir_arg=""
+
+while [ x"$1" != x ]; do
+    case $1 in
+       -c) instcmd="$cpprog"
+           shift
+           continue;;
+
+       -d) dir_arg=true
+           shift
+           continue;;
+
+       -m) chmodcmd="$chmodprog $2"
+           shift
+           shift
+           continue;;
+
+       -o) chowncmd="$chownprog $2"
+           shift
+           shift
+           continue;;
+
+       -g) chgrpcmd="$chgrpprog $2"
+           shift
+           shift
+           continue;;
+
+       -s) stripcmd="$stripprog"
+           shift
+           continue;;
+
+       -t=*) transformarg=`echo $1 | sed 's/-t=//'`
+           shift
+           continue;;
+
+       -b=*) transformbasename=`echo $1 | sed 's/-b=//'`
+           shift
+           continue;;
+
+       *)  if [ x"$src" = x ]
+           then
+               src=$1
+           else
+               # this colon is to work around a 386BSD /bin/sh bug
+               :
+               dst=$1
+           fi
+           shift
+           continue;;
+    esac
+done
+
+if [ x"$src" = x ]
+then
+       echo "install:  no input file specified"
+       exit 1
+else
+       true
+fi
+
+if [ x"$dir_arg" != x ]; then
+       dst=$src
+       src=""
+       
+       if [ -d $dst ]; then
+               instcmd=:
+       else
+               instcmd=mkdir
+       fi
+else
+
+# Waiting for this to be detected by the "$instcmd $src $dsttmp" command
+# might cause directories to be created, which would be especially bad 
+# if $src (and thus $dsttmp) contains '*'.
+
+       if [ -f $src -o -d $src ]
+       then
+               true
+       else
+               echo "install:  $src does not exist"
+               exit 1
+       fi
+       
+       if [ x"$dst" = x ]
+       then
+               echo "install:  no destination specified"
+               exit 1
+       else
+               true
+       fi
+
+# If destination is a directory, append the input filename; if your system
+# does not like double slashes in filenames, you may need to add some logic
+
+       if [ -d $dst ]
+       then
+               dst="$dst"/`basename $src`
+       else
+               true
+       fi
+fi
+
+## this sed command emulates the dirname command
+dstdir=`echo $dst | sed -e 's,[^/]*$,,;s,/$,,;s,^$,.,'`
+
+# Make sure that the destination directory exists.
+#  this part is taken from Noah Friedman's mkinstalldirs script
+
+# Skip lots of stat calls in the usual case.
+if [ ! -d "$dstdir" ]; then
+defaultIFS='   
+'
+IFS="${IFS-${defaultIFS}}"
+
+oIFS="${IFS}"
+# Some sh's can't handle IFS=/ for some reason.
+IFS='%'
+set - `echo ${dstdir} | sed -e 's@/@%@g' -e 's@^%@/@'`
+IFS="${oIFS}"
+
+pathcomp=''
+
+while [ $# -ne 0 ] ; do
+       pathcomp="${pathcomp}${1}"
+       shift
+
+       if [ ! -d "${pathcomp}" ] ;
+        then
+               $mkdirprog "${pathcomp}"
+       else
+               true
+       fi
+
+       pathcomp="${pathcomp}/"
+done
+fi
+
+if [ x"$dir_arg" != x ]
+then
+       $doit $instcmd $dst &&
+
+       if [ x"$chowncmd" != x ]; then $doit $chowncmd $dst; else true ; fi &&
+       if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dst; else true ; fi &&
+       if [ x"$stripcmd" != x ]; then $doit $stripcmd $dst; else true ; fi &&
+       if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dst; else true ; fi
+else
+
+# If we're going to rename the final executable, determine the name now.
+
+       if [ x"$transformarg" = x ] 
+       then
+               dstfile=`basename $dst`
+       else
+               dstfile=`basename $dst $transformbasename | 
+                       sed $transformarg`$transformbasename
+       fi
+
+# don't allow the sed command to completely eliminate the filename
+
+       if [ x"$dstfile" = x ] 
+       then
+               dstfile=`basename $dst`
+       else
+               true
+       fi
+
+# Make a temp file name in the proper directory.
+
+       dsttmp=$dstdir/#inst.$$#
+
+# Move or copy the file name to the temp name
+
+       $doit $instcmd $src $dsttmp &&
+
+       trap "rm -f ${dsttmp}" 0 &&
+
+# and set any options; do chmod last to preserve setuid bits
+
+# If any of these fail, we abort the whole thing.  If we want to
+# ignore errors from any of these, just make sure not to ignore
+# errors from the above "$doit $instcmd $src $dsttmp" command.
+
+       if [ x"$chowncmd" != x ]; then $doit $chowncmd $dsttmp; else true;fi &&
+       if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dsttmp; else true;fi &&
+       if [ x"$stripcmd" != x ]; then $doit $stripcmd $dsttmp; else true;fi &&
+       if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dsttmp; else true;fi &&
+
+# Now rename the file to the real destination.
+
+       $doit $rmcmd -f $dstdir/$dstfile &&
+       $doit $mvcmd $dsttmp $dstdir/$dstfile 
+
+fi &&
+
+
+exit 0
diff --git a/inttypes/inttypes.h b/inttypes/inttypes.h
new file mode 100644 (file)
index 0000000..e353aa9
--- /dev/null
@@ -0,0 +1,201 @@
+/*
+ * inttypes.h
+ *
+ * Small ersatz subset of <inttypes.h>, deriving the types from
+ * <limits.h>.
+ *
+ * Important: the preprocessor may truncate numbers too large for it.
+ * Therefore, test the signed types only ... truncation won't generate
+ * a 01111111... bit pattern.
+ */
+
+#ifndef INTTYPES_H
+#define INTTYPES_H
+
+#include <limits.h>
+
+/*** 64-bit type: long or long long ***/
+
+/* Some old versions of gcc <limits.h> omit LLONG_MAX */
+#ifndef LLONG_MAX
+# ifdef __LONG_LONG_MAX__
+#  define LLONG_MAX __LONG_LONG_MAX__
+# else
+#  define LLONG_MAX 0          /* Assume long long is unusable */
+# endif
+#endif
+
+#if LONG_MAX == 9223372036854775807L
+
+/* long is 64 bits */
+typedef signed long            int64_t;
+typedef unsigned long          uint64_t;
+#define _scn64                 "l"
+#define _pri64                 "l"
+#define INT64_C(x)             x ## L
+#define UINT64_C(x)            x ## UL
+
+#elif LLONG_MAX == 9223372036854775807LL
+
+/* long long is 64 bits */
+typedef signed long long       int64_t;
+typedef unsigned long long     uint64_t;
+#define _scn64                 "ll"
+#define _pri64                 "ll"
+#define INT64_C(x)             x ## LL
+#define UINT64_C(x)            x ## ULL
+
+#else
+
+#error "Neither long nor long long is 64 bits in size"
+
+#endif
+
+/*** 32-bit type: int or long ***/
+
+#if INT_MAX == 2147483647
+
+/* int is 32 bits */
+typedef signed int             int32_t;
+typedef unsigned int           uint32_t;
+#define _scn32                 ""
+#define _pri32                 ""
+#define INT32_C(x)             x
+#define UINT32_C(x)            x ## U
+
+#elif LONG_MAX == 2147483647L
+
+/* long is 32 bits */
+typedef signed long            int32_t;
+typedef unsigned long          uint32_t;
+#define _scn32                 "l"
+#define _pri32                 "l"
+#define INT32_C(x)             x ## L
+#define UINT32_C(x)            x ## UL
+
+#else
+
+#error "Neither int nor long is 32 bits in size"
+
+#endif
+
+/*** 16-bit size: int or short ***/
+
+#if INT_MAX == 32767
+
+/* int is 16 bits */
+typedef signed int             int16_t;
+typedef unsigned int           uint16_t;
+#define _scn16                 ""
+#define _pri16                 ""
+#define INT16_C(x)             x
+#define UINT16_C(x)            x ## U
+
+#elif SHRT_MAX == 32767
+
+/* short is 16 bits */
+typedef signed short           int16_t;
+typedef unsigned short         uint16_t;
+#define _scn16                 "h"
+#define _pri16                 ""
+#define INT16_C(x)             x
+#define UINT16_C(x)            x ## U
+
+#else
+
+#error "Neither short nor int is 16 bits in size"
+
+#endif
+
+/*** 8-bit size: char ***/
+
+#if SCHAR_MAX == 127
+
+/* char is 8 bits */
+typedef signed char            int8_t;
+typedef unsigned char          uint8_t;
+#define _scn8                  "hh"
+#define _pri8                  ""
+#define INT8_C(x)              x
+#define UINT8_C(x)             x ## U
+
+#else
+
+#error "char is not 8 bits in size"
+
+#endif
+
+/* The rest of this is common to all models */
+
+#define PRId8          _pri8  "d"
+#define PRId16         _pri16 "d"
+#define PRId32         _pri32 "d"
+#define PRId64         _pri64 "d"
+
+#define PRIi8          _pri8  "i"
+#define PRIi16         _pri16 "i"
+#define PRIi32         _pri32 "i"
+#define PRIi64         _pri64 "i"
+
+#define PRIo8          _pri8  "o"
+#define PRIo16         _pri16 "o"
+#define PRIo32         _pri32 "o"
+#define PRIo64         _pri64 "o"
+
+#define PRIu8          _pri8  "u"
+#define PRIu16         _pri16 "u"
+#define PRIu32         _pri32 "u"
+#define PRIu64         _pri64 "u"
+
+#define PRIx8          _pri8  "x"
+#define PRIx16         _pri16 "x"
+#define PRIx32         _pri32 "x"
+#define PRIx64         _pri64 "x"
+
+#define PRIX8          _pri8  "X"
+#define PRIX16         _pri16 "X"
+#define PRIX32         _pri32 "X"
+#define PRIX64         _pri64 "X"
+
+#define SCNd8          _scn8  "d"
+#define SCNd16         _scn16 "d"
+#define SCNd32         _scn32 "d"
+#define SCNd64         _scn64 "d"
+
+#define SCNi8          _scn8  "i"
+#define SCNi16         _scn16 "i"
+#define SCNi32         _scn32 "i"
+#define SCNi64         _scn64 "i"
+
+#define SCNo8          _scn8  "o"
+#define SCNo16         _scn16 "o"
+#define SCNo32         _scn32 "o"
+#define SCNo64         _scn64 "o"
+
+#define SCNu8          _scn8  "u"
+#define SCNu16         _scn16 "u"
+#define SCNu32         _scn32 "u"
+#define SCNu64         _scn64 "u"
+
+#define SCNx8          _scn8  "x"
+#define SCNx16         _scn16 "x"
+#define SCNx32         _scn32 "x"
+#define SCNx64         _scn64 "x"
+
+#define INT8_MIN       INT8_C(-128)
+#define INT8_MAX       INT8_C(127)
+#define UINT8_MAX      UINT8_C(255)
+
+#define INT16_MIN      INT16_C(-32768)
+#define INT16_MAX      INT16_C(32767)
+#define UINT16_MAX     UINT16_C(65535)
+
+#define INT32_MIN      INT32_C(-2147483648)
+#define INT32_MAX      INT32_C(2147483647)
+#define UINT32_MAX     UINT32_C(4294967295)
+
+#define INT64_MIN      INT64_C(-9223372036854775808)
+#define INT64_MAX      INT64_C(9223372036854775807)
+#define UINT64_MAX     UINT64_C(18446744073709551615)
+
+#endif /* INTTYPES_H */
diff --git a/labels.c b/labels.c
new file mode 100644 (file)
index 0000000..9152552
--- /dev/null
+++ b/labels.c
@@ -0,0 +1,527 @@
+/* ----------------------------------------------------------------------- *
+ *   
+ *   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.
+ *
+ * ----------------------------------------------------------------------- */
+
+/*
+ * labels.c  label handling for the Netwide Assembler
+ */
+
+#include "compiler.h"
+
+#include <stdio.h>
+#include <string.h>
+#include <stdlib.h>
+#include <inttypes.h>
+
+#include "nasm.h"
+#include "nasmlib.h"
+#include "hashtbl.h"
+
+/*
+ * A local label is one that begins with exactly one period. Things
+ * that begin with _two_ periods are NASM-specific things.
+ *
+ * If TASM compatibility is enabled, a local label can also begin with
+ * @@, so @@local is a TASM compatible local label. Note that we only
+ * check for the first @ symbol, although TASM requires both.
+ */
+#define islocal(l)                                              \
+       (tasm_compatible_mode ?                                 \
+       (((l)[0] == '.' || (l)[0] == '@') && (l)[1] != '.') :   \
+       ((l)[0] == '.' && (l)[1] != '.'))
+#define islocalchar(c)                                         \
+       (tasm_compatible_mode ?                                  \
+       ((c) == '.' || (c) == '@') :                            \
+       ((c) == '.'))
+
+#define LABEL_BLOCK  128       /* no. of labels/block */
+#define LBLK_SIZE    (LABEL_BLOCK*sizeof(union label))
+
+#define END_LIST -3             /* don't clash with NO_SEG! */
+#define END_BLOCK -2
+#define BOGUS_VALUE -4
+
+#define PERMTS_SIZE  16384     /* size of text blocks */
+#if (PERMTS_SIZE < IDLEN_MAX)
+#error "IPERMTS_SIZE must be greater than or equal to IDLEN_MAX"
+#endif
+
+/* values for label.defn.is_global */
+#define DEFINED_BIT    1
+#define GLOBAL_BIT     2
+#define EXTERN_BIT     4
+#define COMMON_BIT     8
+
+#define NOT_DEFINED_YET 0
+#define TYPE_MASK 3
+#define LOCAL_SYMBOL (DEFINED_BIT)
+#define GLOBAL_PLACEHOLDER (GLOBAL_BIT)
+#define GLOBAL_SYMBOL (DEFINED_BIT|GLOBAL_BIT)
+
+union label {                   /* actual label structures */
+    struct {
+        int32_t segment;
+       int64_t offset;
+        char *label, *special;
+        int is_global, is_norm;
+    } defn;
+    struct {
+        int32_t movingon;
+        int64_t dummy;
+        union label *next;
+    } admin;
+};
+
+struct permts {                 /* permanent text storage */
+    struct permts *next;        /* for the linked list */
+    int size, usage;            /* size and used space in ... */
+    char data[PERMTS_SIZE];     /* ... the data block itself */
+};
+
+extern int64_t global_offset_changed;       /* defined in nasm.c */
+
+static struct hash_table ltab;         /* labels hash table */
+static union label *ldata;             /* all label data blocks */
+static union label *lfree;             /* labels free block */
+static struct permts *perm_head;        /* start of perm. text storage */
+static struct permts *perm_tail;        /* end of perm. text storage */
+
+static void init_block(union label *blk);
+static char *perm_copy(const char *string);
+
+static char *prevlabel;
+
+static bool initialized = false;
+
+char lprefix[PREFIX_MAX] = { 0 };
+char lpostfix[PREFIX_MAX] = { 0 };
+
+/*
+ * Internal routine: finds the `union label' corresponding to the
+ * given label name. Creates a new one, if it isn't found, and if
+ * `create' is true.
+ */
+static union label *find_label(char *label, int create)
+{
+    char *prev;
+    int prevlen, len;
+    union label *lptr, **lpp;
+    char label_str[IDLEN_MAX];
+    struct hash_insert ip;
+
+    if (islocal(label)) {
+        prev = prevlabel;
+       prevlen = strlen(prev);
+       len = strlen(label);
+       if (prevlen+len >= IDLEN_MAX)
+           return NULL;        /* Error... */
+       memcpy(label_str, prev, prevlen);
+       memcpy(label_str+prevlen, label, len+1);
+       label = label_str;
+    } else {
+        prev = "";
+       prevlen = 0;
+    }
+
+    lpp = (union label **) hash_find(&ltab, label, &ip);
+    lptr = lpp ? *lpp : NULL;
+
+    if (lptr || !create)
+       return lptr;
+
+    /* Create a new label... */
+    if (lfree->admin.movingon == END_BLOCK) {
+       /*
+        * must allocate a new block
+        */
+       lfree->admin.next =
+           (union label *)nasm_malloc(LBLK_SIZE);
+       lfree = lfree->admin.next;
+       init_block(lfree);
+    }
+
+    lfree->admin.movingon = BOGUS_VALUE;
+    lfree->defn.label = perm_copy(label);
+    lfree->defn.special = NULL;
+    lfree->defn.is_global = NOT_DEFINED_YET;
+
+    hash_add(&ip, lfree->defn.label, lfree);
+    return lfree++;
+}
+
+bool lookup_label(char *label, int32_t *segment, int64_t *offset)
+{
+    union label *lptr;
+
+    if (!initialized)
+        return false;
+
+    lptr = find_label(label, 0);
+    if (lptr && (lptr->defn.is_global & DEFINED_BIT)) {
+        *segment = lptr->defn.segment;
+        *offset = lptr->defn.offset;
+        return true;
+    } else
+        return false;
+}
+
+bool is_extern(char *label)
+{
+    union label *lptr;
+
+    if (!initialized)
+        return false;
+
+    lptr = find_label(label, 0);
+    return (lptr && (lptr->defn.is_global & EXTERN_BIT));
+}
+
+void redefine_label(char *label, int32_t segment, int64_t offset, char *special,
+                    bool is_norm, bool isextrn)
+{
+    union label *lptr;
+    int exi;
+
+    /* This routine possibly ought to check for phase errors.  Most assemblers
+     * check for phase errors at this point.  I don't know whether phase errors
+     * are even possible, nor whether they are checked somewhere else
+     */
+
+    (void)special;              /* Don't warn that this parameter is unused */
+    (void)is_norm;              /* Don't warn that this parameter is unused */
+    (void)isextrn;              /* Don't warn that this parameter is unused */
+
+#ifdef DEBUG
+#if DEBUG<3
+    if (!strncmp(label, "debugdump", 9))
+#endif
+        nasm_error(ERR_DEBUG, "redefine_label (%s, %"PRIx32", %"PRIx64", %s, %d, %d)",
+              label, segment, offset, special, is_norm, isextrn);
+#endif
+
+    lptr = find_label(label, 1);
+    if (!lptr)
+        nasm_error(ERR_PANIC, "can't find label `%s' on pass two", label);
+
+    if (!islocal(label)) {
+        if (!islocalchar(*label) && lptr->defn.is_norm)
+            prevlabel = lptr->defn.label;
+    }
+
+    if (lptr->defn.offset != offset)
+       global_offset_changed++;
+
+    lptr->defn.offset = offset;
+    lptr->defn.segment = segment;
+
+    if (pass0 == 1) {
+        exi = !!(lptr->defn.is_global & GLOBAL_BIT);
+        if (exi) {
+            char *xsymbol;
+            int slen;
+            slen = strlen(lprefix);
+            slen += strlen(lptr->defn.label);
+            slen += strlen(lpostfix);
+            slen++;             /* room for that null char */
+            xsymbol = nasm_malloc(slen);
+            snprintf(xsymbol, slen, "%s%s%s", lprefix, lptr->defn.label,
+                     lpostfix);
+
+            ofmt->symdef(xsymbol, segment, offset, exi,
+                         special ? special : lptr->defn.special);
+            ofmt->current_dfmt->debug_deflabel(xsymbol, segment, offset,
+                                               exi,
+                                               special ? special : lptr->
+                                               defn.special);
+/**    nasm_free(xsymbol);  ! outobj.c stores the pointer; ouch!!! **/
+        } else {
+            if ((lptr->defn.is_global & (GLOBAL_BIT | EXTERN_BIT)) !=
+                EXTERN_BIT) {
+                ofmt->symdef(lptr->defn.label, segment, offset, exi,
+                             special ? special : lptr->defn.special);
+                ofmt->current_dfmt->debug_deflabel(label, segment, offset,
+                                                   exi,
+                                                   special ? special :
+                                                   lptr->defn.special);
+            }
+        }
+    }
+    /* if (pass0 == 1) */
+}
+
+void define_label(char *label, int32_t segment, int64_t offset, char *special,
+                  bool is_norm, bool isextrn)
+{
+    union label *lptr;
+    int exi;
+
+#ifdef DEBUG
+#if DEBUG<3
+    if (!strncmp(label, "debugdump", 9))
+#endif
+        nasm_error(ERR_DEBUG, "define_label (%s, %"PRIx32", %"PRIx64", %s, %d, %d)",
+              label, segment, offset, special, is_norm, isextrn);
+#endif
+    lptr = find_label(label, 1);
+    if (lptr->defn.is_global & DEFINED_BIT) {
+        nasm_error(ERR_NONFATAL, "symbol `%s' redefined", label);
+        return;
+    }
+    lptr->defn.is_global |= DEFINED_BIT;
+    if (isextrn)
+        lptr->defn.is_global |= EXTERN_BIT;
+
+    if (!islocalchar(label[0]) && is_norm) {
+       /* not local, but not special either */
+        prevlabel = lptr->defn.label;
+    } else if (islocal(label) && !*prevlabel) {
+        nasm_error(ERR_NONFATAL, "attempt to define a local label before any"
+              " non-local labels");
+    }
+
+    lptr->defn.segment = segment;
+    lptr->defn.offset = offset;
+    lptr->defn.is_norm = (!islocalchar(label[0]) && is_norm);
+
+    if (pass0 == 1 || (!is_norm && !isextrn && (segment > 0) && (segment & 1))) {
+        exi = !!(lptr->defn.is_global & GLOBAL_BIT);
+        if (exi) {
+            char *xsymbol;
+            int slen;
+            slen = strlen(lprefix);
+            slen += strlen(lptr->defn.label);
+            slen += strlen(lpostfix);
+            slen++;             /* room for that null char */
+            xsymbol = nasm_malloc(slen);
+            snprintf(xsymbol, slen, "%s%s%s", lprefix, lptr->defn.label,
+                     lpostfix);
+
+            ofmt->symdef(xsymbol, segment, offset, exi,
+                         special ? special : lptr->defn.special);
+            ofmt->current_dfmt->debug_deflabel(xsymbol, segment, offset,
+                                               exi,
+                                               special ? special : lptr->
+                                               defn.special);
+/**    nasm_free(xsymbol);  ! outobj.c stores the pointer; ouch!!! **/
+        } else {
+            if ((lptr->defn.is_global & (GLOBAL_BIT | EXTERN_BIT)) !=
+                EXTERN_BIT) {
+                ofmt->symdef(lptr->defn.label, segment, offset, exi,
+                             special ? special : lptr->defn.special);
+                ofmt->current_dfmt->debug_deflabel(label, segment, offset,
+                                                   exi,
+                                                   special ? special :
+                                                   lptr->defn.special);
+            }
+        }
+    }                           /* if (pass0 == 1) */
+}
+
+void define_common(char *label, int32_t segment, int32_t size, char *special)
+{
+    union label *lptr;
+
+    lptr = find_label(label, 1);
+    if ((lptr->defn.is_global & DEFINED_BIT) &&
+       (passn == 1 || !(lptr->defn.is_global & COMMON_BIT))) {
+           nasm_error(ERR_NONFATAL, "symbol `%s' redefined", label);
+           return;
+    }
+    lptr->defn.is_global |= DEFINED_BIT|COMMON_BIT;
+
+    if (!islocalchar(label[0])) {
+        prevlabel = lptr->defn.label;
+    } else {
+        nasm_error(ERR_NONFATAL, "attempt to define a local label as a "
+              "common variable");
+       return;
+    }
+
+    lptr->defn.segment = segment;
+    lptr->defn.offset = 0;
+
+    if (pass0 == 0)
+       return;
+
+    ofmt->symdef(lptr->defn.label, segment, size, 2,
+                special ? special : lptr->defn.special);
+    ofmt->current_dfmt->debug_deflabel(lptr->defn.label, segment, size, 2,
+                                      special ? special : lptr->defn.
+                                      special);
+}
+
+void declare_as_global(char *label, char *special)
+{
+    union label *lptr;
+
+    if (islocal(label)) {
+        nasm_error(ERR_NONFATAL, "attempt to declare local symbol `%s' as"
+              " global", label);
+        return;
+    }
+    lptr = find_label(label, 1);
+    switch (lptr->defn.is_global & TYPE_MASK) {
+    case NOT_DEFINED_YET:
+        lptr->defn.is_global = GLOBAL_PLACEHOLDER;
+        lptr->defn.special = special ? perm_copy(special) : NULL;
+        break;
+    case GLOBAL_PLACEHOLDER:   /* already done: silently ignore */
+    case GLOBAL_SYMBOL:
+        break;
+    case LOCAL_SYMBOL:
+        if (!(lptr->defn.is_global & EXTERN_BIT)) {
+            nasm_error(ERR_WARNING, "symbol `%s': GLOBAL directive "
+                  "after symbol definition is an experimental feature", label);
+            lptr->defn.is_global = GLOBAL_SYMBOL;
+        }
+        break;
+    }
+}
+
+int init_labels(void)
+{
+    hash_init(&ltab, HASH_LARGE);
+
+    ldata = lfree = (union label *)nasm_malloc(LBLK_SIZE);
+    init_block(lfree);
+
+    perm_head =
+        perm_tail = (struct permts *)nasm_malloc(sizeof(struct permts));
+
+    perm_head->next = NULL;
+    perm_head->size = PERMTS_SIZE;
+    perm_head->usage = 0;
+
+    prevlabel = "";
+
+    initialized = true;
+
+    return 0;
+}
+
+void cleanup_labels(void)
+{
+    union label *lptr, *lhold;
+
+    initialized = false;
+
+    hash_free(&ltab);
+
+    lptr = lhold = ldata;
+    while (lptr) {
+       lptr = &lptr[LABEL_BLOCK-1];
+       lptr = lptr->admin.next;
+       nasm_free(lhold);
+       lhold = lptr;
+    }
+
+    while (perm_head) {
+        perm_tail = perm_head;
+        perm_head = perm_head->next;
+        nasm_free(perm_tail);
+    }
+}
+
+static void init_block(union label *blk)
+{
+    int j;
+
+    for (j = 0; j < LABEL_BLOCK - 1; j++)
+        blk[j].admin.movingon = END_LIST;
+    blk[LABEL_BLOCK - 1].admin.movingon = END_BLOCK;
+    blk[LABEL_BLOCK - 1].admin.next = NULL;
+}
+
+static char *perm_copy(const char *string)
+{
+    char *p;
+    int len = strlen(string)+1;
+
+    nasm_assert(len <= PERMTS_SIZE);
+
+    if (perm_tail->size - perm_tail->usage < len) {
+        perm_tail->next =
+            (struct permts *)nasm_malloc(sizeof(struct permts));
+        perm_tail = perm_tail->next;
+        perm_tail->next = NULL;
+        perm_tail->size = PERMTS_SIZE;
+        perm_tail->usage = 0;
+    }
+    p = perm_tail->data + perm_tail->usage;
+    memcpy(p, string, len);
+    perm_tail->usage += len;
+
+    return p;
+}
+
+char *local_scope(char *label)
+{
+   return islocal(label) ? prevlabel : "";
+}
+
+/*
+ * Notes regarding bug involving redefinition of external segments.
+ *
+ * Up to and including v0.97, the following code didn't work. From 0.97
+ * developers release 2 onwards, it will generate an error.
+ *
+ * EXTERN extlabel
+ * newlabel EQU extlabel + 1
+ *
+ * The results of allowing this code through are that two import records
+ * are generated, one for 'extlabel' and one for 'newlabel'.
+ *
+ * The reason for this is an inadequacy in the defined interface between
+ * the label manager and the output formats. The problem lies in how the
+ * output format driver tells that a label is an external label for which
+ * a label import record must be produced. Most (all except bin?) produce
+ * the record if the segment number of the label is not one of the internal
+ * segments that the output driver is producing.
+ *
+ * A simple fix to this would be to make the output formats keep track of
+ * which symbols they've produced import records for, and make them not
+ * produce import records for segments that are already defined.
+ *
+ * The best way, which is slightly harder but reduces duplication of code
+ * and should therefore make the entire system smaller and more stable is
+ * to change the interface between assembler, define_label(), and
+ * the output module. The changes that are needed are:
+ *
+ * The semantics of the 'isextern' flag passed to define_label() need
+ * examining. This information may or may not tell us what we need to
+ * know (ie should we be generating an import record at this point for this
+ * label). If these aren't the semantics, the semantics should be changed
+ * to this.
+ *
+ * The output module interface needs changing, so that the `isextern' flag
+ * is passed to the module, so that it can be easily tested for.
+ */
diff --git a/labels.h b/labels.h
new file mode 100644 (file)
index 0000000..865a557
--- /dev/null
+++ b/labels.h
@@ -0,0 +1,56 @@
+/* ----------------------------------------------------------------------- *
+ *   
+ *   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.
+ *
+ * ----------------------------------------------------------------------- */
+
+/* 
+ * labels.h  header file for labels.c
+ */
+
+#ifndef LABELS_H
+#define LABELS_H
+
+extern char lprefix[PREFIX_MAX];
+extern char lpostfix[PREFIX_MAX];
+
+bool lookup_label(char *label, int32_t *segment, int64_t *offset);
+bool is_extern(char *label);
+void define_label(char *label, int32_t segment, int64_t offset, char *special,
+                 bool is_norm, bool isextrn);
+void redefine_label(char *label, int32_t segment, int64_t offset, char *special,
+                    bool is_norm, bool isextrn);
+void define_common(char *label, int32_t segment, int32_t size, char *special);
+void declare_as_global(char *label, char *special);
+int init_labels(void);
+void cleanup_labels(void);
+char *local_scope(char *label);
+
+#endif /* LABELS_H */
diff --git a/lcc/README b/lcc/README
new file mode 100644 (file)
index 0000000..569b9be
--- /dev/null
@@ -0,0 +1,52 @@
+This directory contains the necessary files to port the C compiler
+``LCC'' (available by FTP from sunsite.doc.ic.ac.uk in the directory
+/computing/programming/languages/c/lcc) to compile for Linux (a.out
+or ELF) by using NASM as a back-end code generator.
+
+This patch has been tested on lcc version 3.6.
+
+To install:
+
+- Copy `x86nasm.md' into the `src' directory of the lcc tree.
+
+- Copy either `lin-elf.c' or `lin-aout.c' into the `etc' directory.
+
+- If you're installing for a.out, edit `x86nasm.md' and change the
+  conditional after the comment reading "CHANGE THIS FOR a.out" in
+  the `defsymbol' function from `#if 0' to `#if 1'.
+
+- Make the following changes to `bind.c' in the `src' directory:
+
+  - Near the top of the file, add a line that reads
+       extern Interface x86nasmIR;
+
+  - In the `bindings' array, add the lines
+        "x86-nasm",      &x86nasmIR,
+        "x86/nasm",      &x86nasmIR,
+    (in sensible looking places...)
+
+  A sample `bind.c' has been provided to show what the result of
+  this might look like. You might be able to get away with using it
+  directly...
+
+- Modify the lcc makefile to include rules for x86nasm.o: this will
+  have to be done in about three places. Just copy any line with
+  `x86' on it and modify it to read `x86nasm' everywhere. (Except
+  that in the list of object files that rcc is made up from, do
+  remember to ensure that every line but the last has a trailing
+  backslash...)
+
+- You may have to modify the contents of `lin-elf.c' or `lin-aout.c'
+  to reflect the true locations of files such as crt0.o, crt1.o,
+  ld-linux.so and so forth. If you don't know where to find these,
+  compile a short C program with `gcc -v' and see what command line
+  gcc feeds to `ld'.
+
+- You should now be able to build lcc, using `lin-elf.c' or
+  `lin-aout.c' as the system-dependent part of the `lcc' wrapper
+  program.
+
+- Symlink x86nasm.c into the `src' directory before attempting the
+  triple test, or the compile will fail.
+
+- Now it should pass the triple test, on either ELF or a.out. Voila!
diff --git a/lcc/bind.c b/lcc/bind.c
new file mode 100644 (file)
index 0000000..286431d
--- /dev/null
@@ -0,0 +1,23 @@
+#include "c.h"
+extern Interface nullIR, symbolicIR;
+extern Interface mipsebIR, mipselIR;
+extern Interface sparcIR, solarisIR;
+extern Interface x86IR, x86nasmIR;
+Binding bindings[] = {
+    "symbolic", &symbolicIR,
+    "mips-irix", &mipsebIR,
+    "mips-ultrix", &mipselIR,
+    "sparc-sun", &sparcIR,
+    "sparc-solaris", &solarisIR,
+    "x86-dos", &x86IR,
+    "x86-nasm", &x86nasmIR,
+    "symbolic/irix", &symbolicIR,       /* omit */
+    "mips/irix", &mipsebIR,     /* omit */
+    "mips/ultrix", &mipselIR,   /* omit */
+    "sparc/sun", &sparcIR,      /* omit */
+    "sparc/solaris", &solarisIR,        /* omit */
+    "x86/dos", &x86IR,          /* omit */
+    "x86/nasm", &x86nasmIR,     /* omit */
+    "null", &nullIR,
+    NULL, NULL
+};
diff --git a/lcc/lin-aout.c b/lcc/lin-aout.c
new file mode 100644 (file)
index 0000000..e4ac48f
--- /dev/null
@@ -0,0 +1,48 @@
+/* x86 running linux and using nasm as a.out */
+
+#include <string.h>
+
+#ifndef LCCDIR
+#define LCCDIR "/usr/local/lib/lcc/"
+#endif
+
+#define NASMPATH "/usr/local/bin/nasm"
+
+char *cpp[] = { LCCDIR "cpp", "-D__STDC__=1",
+    "-Di386", "-D__i386", "-D__i386__",
+    "-Dlinux", "-D__linux", "-D__linux__",
+    "-Dunix", "-D__unix", "-D__unix__",
+    "$1", "$2", "$3", 0
+};
+char *include[] = { "-I" LCCDIR "include", "-I/usr/local/include",
+    "-I/usr/include", 0
+};
+char *com[] = { LCCDIR "rcc", "-target=x86/nasm",
+    "$1", "$2", "$3", 0
+};
+char *as[] = { NASMPATH, "-a", "-faout", "-o", "$3", "$1", "$2", 0 };
+char *ld[] = { "/usr/bin/ld", "-m", "i386linux",
+    "-L/usr/i486-linuxaout/lib",
+    "-o", "$3", "$1",
+    "/usr/i486-linuxaout/lib/crt0.o",
+    "$2", "", "-lc", 0
+};
+static char *bbexit = LCCDIR "bbexit.o";
+
+extern char *concat(char *, char *);
+extern int access(const char *, int);
+
+int option(char *arg)
+{
+    if (strncmp(arg, "-lccdir=", 8) == 0) {
+        cpp[0] = concat(&arg[8], "/cpp");
+        include[0] = concat("-I", concat(&arg[8], "/include"));
+        com[0] = concat(&arg[8], "/rcc");
+        bbexit = concat(&arg[8], "/bbexit.o");
+    } else if (strcmp(arg, "-g") == 0) ;
+    else if (strcmp(arg, "-b") == 0 && access(bbexit, 4) == 0)
+        ld[9] = bbexit;
+    else
+        return 0;
+    return 1;
+}
diff --git a/lcc/lin-elf.c b/lcc/lin-elf.c
new file mode 100644 (file)
index 0000000..693309f
--- /dev/null
@@ -0,0 +1,49 @@
+/* x86 running linux and using nasm as ELF */
+
+#include <string.h>
+
+#ifndef LCCDIR
+#define LCCDIR "/usr/local/lib/lcc/"
+#endif
+
+#define NASMPATH "/usr/local/bin/nasm"
+
+char *cpp[] = { LCCDIR "cpp", "-D__STDC__=1",
+    "-D__ELF__", "-Di386", "-D__i386", "-D__i386__",
+    "-Dlinux", "-D__linux", "-D__linux__",
+    "$1", "$2", "$3", 0
+};
+char *include[] = { "-I" LCCDIR "include", "-I/usr/local/include",
+    "-I/usr/include", 0
+};
+char *com[] = { LCCDIR "rcc", "-target=x86/nasm",
+    "$1", "$2", "$3", 0
+};
+char *as[] = { NASMPATH, "-a", "-felf", "-o", "$3", "$1", "$2", 0 };
+char *ld[] = { "/usr/bin/ld", "-m", "elf_i386",
+    "-dynamic-linker", "/lib/ld-linux.so.1",
+    "-L/usr/i486-linux/lib",
+    "-o", "$3", "$1",
+    "/usr/lib/crt1.o", "/usr/lib/crti.o", "/usr/lib/crtbegin.o",
+    "$2", "",
+    "-lc", "", "/usr/lib/crtend.o", "/usr/lib/crtn.o", 0
+};
+static char *bbexit = LCCDIR "bbexit.o";
+
+extern char *concat(char *, char *);
+extern int access(const char *, int);
+
+int option(char *arg)
+{
+    if (strncmp(arg, "-lccdir=", 8) == 0) {
+        cpp[0] = concat(&arg[8], "/cpp");
+        include[0] = concat("-I", concat(&arg[8], "/include"));
+        com[0] = concat(&arg[8], "/rcc");
+        bbexit = concat(&arg[8], "/bbexit.o");
+    } else if (strcmp(arg, "-g") == 0) ;
+    else if (strcmp(arg, "-b") == 0 && access(bbexit, 4) == 0)
+        ld[13] = bbexit;
+    else
+        return 0;
+    return 1;
+}
diff --git a/lcc/x86nasm.md b/lcc/x86nasm.md
new file mode 100644 (file)
index 0000000..54d0be6
--- /dev/null
@@ -0,0 +1,703 @@
+%{
+enum { EAX=0, ECX=1, EDX=2, EBX=3, ESI=6, EDI=7 };
+#include "c.h"
+#define NODEPTR_TYPE Node
+#define OP_LABEL(p) ((p)->op)
+#define LEFT_CHILD(p) ((p)->kids[0])
+#define RIGHT_CHILD(p) ((p)->kids[1])
+#define STATE_LABEL(p) ((p)->x.state)
+static void address     ARGS((Symbol, Symbol, int));
+static void blkfetch    ARGS((int, int, int, int));
+static void blkloop     ARGS((int, int, int, int, int, int[]));
+static void blkstore    ARGS((int, int, int, int));
+static void defaddress  ARGS((Symbol));
+static void defconst    ARGS((int, Value));
+static void defstring   ARGS((int, char *));
+static void defsymbol   ARGS((Symbol));
+static void doarg       ARGS((Node));
+static void emit2       ARGS((Node));
+static void export      ARGS((Symbol));
+static void clobber     ARGS((Node));
+static void function    ARGS((Symbol, Symbol [], Symbol [], int));
+static void global      ARGS((Symbol));
+static void import      ARGS((Symbol));
+static void local       ARGS((Symbol));
+static void progbeg     ARGS((int, char **));
+static void progend     ARGS((void));
+static void segment     ARGS((int));
+static void space       ARGS((int));
+static void target      ARGS((Node));
+static int ckstack ARGS((Node, int));
+static int memop ARGS((Node));
+static int sametree ARGS((Node, Node));
+static Symbol charreg[32], shortreg[32], intreg[32];
+static Symbol fltreg[32];
+
+static int cseg;
+
+static Symbol quo, rem;
+
+%}
+%start stmt
+%term ADDD=306 ADDF=305 ADDI=309 ADDP=311 ADDU=310
+%term ADDRFP=279
+%term ADDRGP=263
+%term ADDRLP=295
+%term ARGB=41 ARGD=34 ARGF=33 ARGI=37 ARGP=39
+%term ASGNB=57 ASGNC=51 ASGND=50 ASGNF=49 ASGNI=53 ASGNP=55 ASGNS=52
+%term BANDU=390
+%term BCOMU=406
+%term BORU=422
+%term BXORU=438
+%term CALLB=217 CALLD=210 CALLF=209 CALLI=213 CALLV=216
+%term CNSTC=19 CNSTD=18 CNSTF=17 CNSTI=21 CNSTP=23 CNSTS=20 CNSTU=22
+%term CVCI=85 CVCU=86
+%term CVDF=97 CVDI=101
+%term CVFD=114
+%term CVIC=131 CVID=130 CVIS=132 CVIU=134
+%term CVPU=150
+%term CVSI=165 CVSU=166
+%term CVUC=179 CVUI=181 CVUP=183 CVUS=180
+%term DIVD=450 DIVF=449 DIVI=453 DIVU=454
+%term EQD=482 EQF=481 EQI=485
+%term GED=498 GEF=497 GEI=501 GEU=502
+%term GTD=514 GTF=513 GTI=517 GTU=518
+%term INDIRB=73 INDIRC=67 INDIRD=66 INDIRF=65 INDIRI=69 INDIRP=71 INDIRS=68
+%term JUMPV=584
+%term LABELV=600
+%term LED=530 LEF=529 LEI=533 LEU=534
+%term LOADB=233 LOADC=227 LOADD=226 LOADF=225 LOADI=229 LOADP=231 LOADS=228 LOADU=230
+%term LSHI=341 LSHU=342
+%term LTD=546 LTF=545 LTI=549 LTU=550
+%term MODI=357 MODU=358
+%term MULD=466 MULF=465 MULI=469 MULU=470
+%term NED=562 NEF=561 NEI=565
+%term NEGD=194 NEGF=193 NEGI=197
+%term RETD=242 RETF=241 RETI=245
+%term RSHI=373 RSHU=374
+%term SUBD=322 SUBF=321 SUBI=325 SUBP=327 SUBU=326
+%term VREGP=615
+%%
+reg:  INDIRC(VREGP)     "# read register\n"
+reg:  INDIRD(VREGP)     "# read register\n"
+reg:  INDIRF(VREGP)     "# read register\n"
+reg:  INDIRI(VREGP)     "# read register\n"
+reg:  INDIRP(VREGP)     "# read register\n"
+reg:  INDIRS(VREGP)     "# read register\n"
+stmt: ASGNC(VREGP,reg)  "# write register\n"
+stmt: ASGND(VREGP,reg)  "# write register\n"
+stmt: ASGNF(VREGP,reg)  "# write register\n"
+stmt: ASGNI(VREGP,reg)  "# write register\n"
+stmt: ASGNP(VREGP,reg)  "# write register\n"
+stmt: ASGNS(VREGP,reg)  "# write register\n"
+con: CNSTC  "%a"
+con: CNSTI  "%a"
+con: CNSTP  "%a"
+con: CNSTS  "%a"
+con: CNSTU  "%a"
+stmt: reg  ""
+reg: CVIU(reg)  "%0"  notarget(a)
+reg: CVPU(reg)  "%0"  notarget(a)
+reg: CVUI(reg)  "%0"  notarget(a)
+reg: CVUP(reg)  "%0"  notarget(a)
+acon: ADDRGP  "%a"
+acon: con     "%0"
+base: ADDRGP          "%a"
+base: reg             "%0"
+base: ADDI(reg,acon)  "%0 + (%1)"
+base: ADDP(reg,acon)  "%0 + (%1)"
+base: ADDU(reg,acon)  "%0 + (%1)"
+base: ADDRFP  "ebp + %a"
+base: ADDRLP  "ebp + %a"
+index: reg "%0"
+index: LSHI(reg,con1)  "%0*2"
+index: LSHI(reg,con2)  "%0*4"
+index: LSHI(reg,con3)  "%0*8"
+
+con1:  CNSTI  "1"  range(a, 1, 1)
+con1:  CNSTU  "1"  range(a, 1, 1)
+con2:  CNSTI  "2"  range(a, 2, 2)
+con2:  CNSTU  "2"  range(a, 2, 2)
+con3:  CNSTI  "3"  range(a, 3, 3)
+con3:  CNSTU  "3"  range(a, 3, 3)
+index: LSHU(reg,con1)  "%0*2"
+index: LSHU(reg,con2)  "%0*4"
+index: LSHU(reg,con3)  "%0*8"
+addr: base              "[%0]"
+addr: ADDI(index,base)  "[%1 + %0]"
+addr: ADDP(index,base)  "[%1 + %0]"
+addr: ADDU(index,base)  "[%1 + %0]"
+addr: index  "[%0]"
+mem: INDIRC(addr)  "byte %0"
+mem: INDIRI(addr)  "dword %0"
+mem: INDIRP(addr)  "dword %0"
+mem: INDIRS(addr)  "word %0"
+rc:   reg  "%0"
+rc:   con  "%0"
+
+mr:   reg  "%0"
+mr:   mem  "%0"
+
+mrc0: mem  "%0"
+mrc0: rc   "%0"
+mrc1: mem  "%0"  1
+mrc1: rc   "%0"
+
+mrc3: mem  "%0"  3
+mrc3: rc   "%0"
+reg: addr        "lea %c,%0\n"  1
+reg: mrc0        "mov %c,%0\n"  1
+reg: LOADC(reg)  "mov %c,%0\n"  move(a)
+reg: LOADI(reg)  "mov %c,%0\n"  move(a)
+reg: LOADP(reg)  "mov %c,%0\n"  move(a)
+reg: LOADS(reg)  "mov %c,%0\n"  move(a)
+reg: LOADU(reg)  "mov %c,%0\n"  move(a)
+reg: ADDI(reg,mrc1)  "?mov %c,%0\nadd %c,%1\n"  1
+reg: ADDP(reg,mrc1)  "?mov %c,%0\nadd %c,%1\n"  1
+reg: ADDU(reg,mrc1)  "?mov %c,%0\nadd %c,%1\n"  1
+reg: SUBI(reg,mrc1)  "?mov %c,%0\nsub %c,%1\n"  1
+reg: SUBP(reg,mrc1)  "?mov %c,%0\nsub %c,%1\n"  1
+reg: SUBU(reg,mrc1)  "?mov %c,%0\nsub %c,%1\n"  1
+reg: BANDU(reg,mrc1)  "?mov %c,%0\nand %c,%1\n"  1
+reg: BORU(reg,mrc1)   "?mov %c,%0\nor %c,%1\n"   1
+reg: BXORU(reg,mrc1)  "?mov %c,%0\nxor %c,%1\n"  1
+stmt: ASGNI(addr,ADDI(mem,con1))  "inc %1\n"  memop(a)
+stmt: ASGNI(addr,ADDU(mem,con1))  "inc %1\n"  memop(a)
+stmt: ASGNP(addr,ADDP(mem,con1))  "inc %1\n"  memop(a)
+stmt: ASGNI(addr,SUBI(mem,con1))  "dec %1\n"  memop(a)
+stmt: ASGNI(addr,SUBU(mem,con1))  "dec %1\n"  memop(a)
+stmt: ASGNP(addr,SUBP(mem,con1))  "dec %1\n"  memop(a)
+stmt: ASGNI(addr,ADDI(mem,rc))   "add %1,%2\n"  memop(a)
+stmt: ASGNI(addr,ADDU(mem,rc))   "add %1,%2\n"  memop(a)
+stmt: ASGNI(addr,SUBI(mem,rc))   "sub %1,%2\n"  memop(a)
+stmt: ASGNI(addr,SUBU(mem,rc))   "sub %1,%2\n"  memop(a)
+
+stmt: ASGNI(addr,BANDU(mem,rc))  "and %1,%2\n"  memop(a)
+stmt: ASGNI(addr,BORU(mem,rc))   "or %1,%2\n"   memop(a)
+stmt: ASGNI(addr,BXORU(mem,rc))  "xor %1,%2\n"  memop(a)
+reg: BCOMU(reg)  "?mov %c,%0\nnot %c\n"  2
+reg: NEGI(reg)   "?mov %c,%0\nneg %c\n"  2
+
+stmt: ASGNI(addr,BCOMU(mem))  "not %1\n"  memop(a)
+stmt: ASGNI(addr,NEGI(mem))   "neg %1\n"  memop(a)
+reg: LSHI(reg,rc5)  "?mov %c,%0\nsal %c,%1\n"  2
+reg: LSHU(reg,rc5)  "?mov %c,%0\nshl %c,%1\n"  2
+reg: RSHI(reg,rc5)  "?mov %c,%0\nsar %c,%1\n"  2
+reg: RSHU(reg,rc5)  "?mov %c,%0\nshr %c,%1\n"  2
+
+stmt: ASGNI(addr,LSHI(mem,rc5))  "sal %1,%2\n"  memop(a)
+stmt: ASGNI(addr,LSHU(mem,rc5))  "shl %1,%2\n"  memop(a)
+stmt: ASGNI(addr,RSHI(mem,rc5))  "sar %1,%2\n"  memop(a)
+stmt: ASGNI(addr,RSHU(mem,rc5))  "shr %1,%2\n"  memop(a)
+
+rc5: CNSTI  "%a"  range(a, 0, 31)
+rc5: reg    "cl"
+reg: MULI(reg,mrc3)  "?mov %c,%0\nimul %c,%1\n"  14
+reg: MULI(con,mr)    "imul %c,%1,%0\n"  13
+reg: MULU(reg,mr)  "mul %1\n"  13
+reg: DIVU(reg,reg)  "xor edx,edx\ndiv %1\n"
+reg: MODU(reg,reg)  "xor edx,edx\ndiv %1\n"
+reg: DIVI(reg,reg)  "cdq\nidiv %1\n"
+reg: MODI(reg,reg)  "cdq\nidiv %1\n"
+reg: CVIU(reg)  "mov %c,%0\n"  move(a)
+reg: CVPU(reg)  "mov %c,%0\n"  move(a)
+reg: CVUI(reg)  "mov %c,%0\n"  move(a)
+reg: CVUP(reg)  "mov %c,%0\n"  move(a)
+reg: CVCI(INDIRC(addr))  "movsx %c,byte %0\n"  3
+reg: CVCU(INDIRC(addr))  "movzx %c,byte %0\n"  3
+reg: CVSI(INDIRS(addr))  "movsx %c,word %0\n"  3
+reg: CVSU(INDIRS(addr))  "movzx %c,word %0\n"  3
+reg: CVCI(reg)  "# extend\n"  3
+reg: CVCU(reg)  "# extend\n"  3
+reg: CVSI(reg)  "# extend\n"  3
+reg: CVSU(reg)  "# extend\n"  3
+
+reg: CVIC(reg)  "# truncate\n"  1
+reg: CVIS(reg)  "# truncate\n"  1
+reg: CVUC(reg)  "# truncate\n"  1
+reg: CVUS(reg)  "# truncate\n"  1
+stmt: ASGNC(addr,rc)  "mov byte %0,%1\n"   1
+stmt: ASGNI(addr,rc)  "mov dword %0,%1\n"  1
+stmt: ASGNP(addr,rc)  "mov dword %0,%1\n"  1
+stmt: ASGNS(addr,rc)  "mov word %0,%1\n"   1
+stmt: ARGI(mrc3)  "push dword %0\n"  1
+stmt: ARGP(mrc3)  "push dword %0\n"  1
+stmt: ASGNB(reg,INDIRB(reg))  "mov ecx,%a\nrep movsb\n"
+stmt: ARGB(INDIRB(reg))  "sub esp,%a\nmov edi,esp\nmov ecx,%a\nrep movsb\n"
+
+memf: INDIRD(addr)        "qword %0"
+memf: INDIRF(addr)        "dword %0"
+memf: CVFD(INDIRF(addr))  "dword %0"
+reg: memf  "fld %0\n"  3
+stmt: ASGND(addr,reg)        "fstp qword %0\n"  7
+stmt: ASGNF(addr,reg)        "fstp dword %0\n"  7
+stmt: ASGNF(addr,CVDF(reg))  "fstp dword %0\n"  7
+stmt: ARGD(reg)  "sub esp,8\nfstp qword [esp]\n"
+stmt: ARGF(reg)  "sub esp,4\nfstp dword [esp]\n"
+reg: NEGD(reg)  "fchs\n"
+reg: NEGF(reg)  "fchs\n"
+reg: ADDD(reg,memf)  "fadd %1\n"
+reg: ADDD(reg,reg)  "faddp st1\n"
+reg: ADDF(reg,memf)  "fadd %1\n"
+reg: ADDF(reg,reg)  "faddp st1\n"
+reg: DIVD(reg,memf)  "fdiv %1\n"
+reg: DIVD(reg,reg)  "fdivp st1\n"
+reg: DIVF(reg,memf)  "fdiv %1\n"
+reg: DIVF(reg,reg)  "fdivp st1\n"
+reg: MULD(reg,memf)  "fmul %1\n"
+reg: MULD(reg,reg)  "fmulp st1\n"
+reg: MULF(reg,memf)  "fmul %1\n"
+reg: MULF(reg,reg)  "fmulp st1\n"
+reg: SUBD(reg,memf)  "fsub %1\n"
+reg: SUBD(reg,reg)  "fsubp st1\n"
+reg: SUBF(reg,memf)  "fsub %1\n"
+reg: SUBF(reg,reg)  "fsubp st1\n"
+reg: CVFD(reg)  "# CVFD\n"
+reg: CVDF(reg)  "sub esp,4\nfstp dword [esp]\nfld dword [esp]\nadd esp,4\n"  12
+
+stmt: ASGNI(addr,CVDI(reg))  "fistp dword %0\n"  29
+reg: CVDI(reg)  "sub esp,4\nfistp dword [esp]\npop %c\n" 31
+
+reg: CVID(INDIRI(addr))  "fild dword %0\n"  10
+reg: CVID(reg)  "push %0\nfild dword [esp]\nadd esp,4\n"  12
+
+addrj: ADDRGP  "%a"
+addrj: reg     "%0"  2
+addrj: mem     "%0"  2
+
+stmt:  JUMPV(addrj)  "jmp %0\n"  3
+stmt:  LABELV        "%a:\n"
+stmt: EQI(mem,rc)  "cmp %0,%1\nje near %a\n"   5
+stmt: GEI(mem,rc)  "cmp %0,%1\njge near %a\n"  5
+stmt: GTI(mem,rc)  "cmp %0,%1\njg near %a\n"   5
+stmt: LEI(mem,rc)  "cmp %0,%1\njle near %a\n"  5
+stmt: LTI(mem,rc)  "cmp %0,%1\njl near %a\n"   5
+stmt: NEI(mem,rc)  "cmp %0,%1\njne near %a\n"  5
+stmt: GEU(mem,rc)  "cmp %0,%1\njae near %a\n"  5
+stmt: GTU(mem,rc)  "cmp %0,%1\nja  near %a\n"  5
+stmt: LEU(mem,rc)  "cmp %0,%1\njbe near %a\n"  5
+stmt: LTU(mem,rc)  "cmp %0,%1\njb  near %a\n"  5
+stmt: EQI(reg,mrc1)  "cmp %0,%1\nje near %a\n"   4
+stmt: GEI(reg,mrc1)  "cmp %0,%1\njge near %a\n"  4
+stmt: GTI(reg,mrc1)  "cmp %0,%1\njg near %a\n"   4
+stmt: LEI(reg,mrc1)  "cmp %0,%1\njle near %a\n"  4
+stmt: LTI(reg,mrc1)  "cmp %0,%1\njl near %a\n"   4
+stmt: NEI(reg,mrc1)  "cmp %0,%1\njne near %a\n"  4
+
+stmt: GEU(reg,mrc1)  "cmp %0,%1\njae near %a\n"  4
+stmt: GTU(reg,mrc1)  "cmp %0,%1\nja near %a\n"   4
+stmt: LEU(reg,mrc1)  "cmp %0,%1\njbe near %a\n"  4
+stmt: LTU(reg,mrc1)  "cmp %0,%1\njb near %a\n"   4
+cmpf: memf  " %0"
+cmpf: reg   "p"
+stmt: EQD(cmpf,reg)  "fcomp%0\nfstsw ax\nsahf\nje near %a\n"
+stmt: GED(cmpf,reg)  "fcomp%0\nfstsw ax\nsahf\njbe near %a\n"
+stmt: GTD(cmpf,reg)  "fcomp%0\nfstsw ax\nsahf\njb near %a\n"
+stmt: LED(cmpf,reg)  "fcomp%0\nfstsw ax\nsahf\njae near %a\n"
+stmt: LTD(cmpf,reg)  "fcomp%0\nfstsw ax\nsahf\nja near %a\n"
+stmt: NED(cmpf,reg)  "fcomp%0\nfstsw ax\nsahf\njne near %a\n"
+
+stmt: EQF(cmpf,reg)  "fcomp%0\nfstsw ax\nsahf\nje near %a\n"
+stmt: GEF(cmpf,reg)  "fcomp%0\nfstsw ax\nsahf\njbe near %a\n"
+stmt: GTF(cmpf,reg)  "fcomp%0\nfstsw ax\nsahf\njb near %a\n"
+stmt: LEF(cmpf,reg)  "fcomp%0\nfstsw ax\nsahf\njae near %a\n"
+stmt: LTF(cmpf,reg)  "fcomp%0\nfstsw ax\nsahf\nja near %a\n"
+stmt: NEF(cmpf,reg)  "fcomp%0\nfstsw ax\nsahf\njne near %a\n"
+reg:  CALLI(addrj)  "call %0\nadd esp,%a\n"
+stmt: CALLV(addrj)  "call %0\nadd esp,%a\n"
+reg: CALLF(addrj)  "call %0\nadd esp,%a\n"
+reg: CALLD(addrj)  "call %0\nadd esp,%a\n"
+
+stmt: RETI(reg)  "# ret\n"
+stmt: RETF(reg)  "# ret\n"
+stmt: RETD(reg)  "# ret\n"
+%%
+static void progbeg(argc, argv) int argc; char *argv[]; {
+       int i;
+
+       {
+               union {
+                       char c;
+                       int i;
+               } u;
+               u.i = 0;
+               u.c = 1;
+               swap = (u.i == 1) != IR->little_endian;
+       }
+       parseflags(argc, argv);
+       intreg[EAX] = mkreg("eax", EAX, 1, IREG);
+       intreg[EDX] = mkreg("edx", EDX, 1, IREG);
+       intreg[ECX] = mkreg("ecx", ECX, 1, IREG);
+       intreg[EBX] = mkreg("ebx", EBX, 1, IREG);
+       intreg[ESI] = mkreg("esi", ESI, 1, IREG);
+       intreg[EDI] = mkreg("edi", EDI, 1, IREG);
+       shortreg[EAX] = mkreg("ax", EAX, 1, IREG);
+       shortreg[ECX] = mkreg("cx", ECX, 1, IREG);
+       shortreg[EDX] = mkreg("dx", EDX, 1, IREG);
+       shortreg[EBX] = mkreg("bx", EBX, 1, IREG);
+       shortreg[ESI] = mkreg("si", ESI, 1, IREG);
+       shortreg[EDI] = mkreg("di", EDI, 1, IREG);
+
+       charreg[EAX]  = mkreg("al", EAX, 1, IREG);
+       charreg[ECX]  = mkreg("cl", ECX, 1, IREG);
+       charreg[EDX]  = mkreg("dl", EDX, 1, IREG);
+       charreg[EBX]  = mkreg("bl", EBX, 1, IREG);
+       for (i = 0; i < 8; i++)
+               fltreg[i] = mkreg("%d", i, 0, FREG);
+       rmap[C] = mkwildcard(charreg);
+       rmap[S] = mkwildcard(shortreg);
+       rmap[P] = rmap[B] = rmap[U] = rmap[I] = mkwildcard(intreg);
+       rmap[F] = rmap[D] = mkwildcard(fltreg);
+       tmask[IREG] = (1<<EDI) | (1<<ESI) | (1<<EBX)
+                   | (1<<EDX) | (1<<ECX) | (1<<EAX);
+       vmask[IREG] = 0;
+       tmask[FREG] = 0xff;
+       vmask[FREG] = 0;
+       cseg = 0;
+       quo = mkreg("eax", EAX, 1, IREG);
+       quo->x.regnode->mask |= 1<<EDX;
+       rem = mkreg("edx", EDX, 1, IREG);
+       rem->x.regnode->mask |= 1<<EAX;
+}
+static void segment(n) int n; {
+       if (n == cseg)
+               return;
+       cseg = n;
+       if (cseg == CODE)
+               print("[section .text]\n");
+       else if (cseg == DATA || cseg == LIT)
+               print("[section .data]\n");
+       else if (cseg == BSS)
+               print("[section .bss]\n");
+}
+static void progend() {
+
+}
+static void target(p) Node p; {
+       assert(p);
+       switch (p->op) {
+       case RSHI: case RSHU: case LSHI: case LSHU:
+               if (generic(p->kids[1]->op) != CNST
+               && !(   generic(p->kids[1]->op) == INDIR
+                    && p->kids[1]->kids[0]->op == VREG+P
+                    && p->kids[1]->syms[RX]->u.t.cse
+                    && generic(p->kids[1]->syms[RX]->u.t.cse->op) == CNST
+)) {
+                       rtarget(p, 1, intreg[ECX]);
+                       setreg(p, intreg[EAX]);
+               }
+               break;
+       case MULU:
+               setreg(p, quo);
+               rtarget(p, 0, intreg[EAX]);
+               break;
+       case DIVI: case DIVU:
+               setreg(p, quo);
+               rtarget(p, 0, intreg[EAX]);
+               rtarget(p, 1, intreg[ECX]);
+               break;
+       case MODI: case MODU:
+               setreg(p, rem);
+               rtarget(p, 0, intreg[EAX]);
+               rtarget(p, 1, intreg[ECX]);
+               break;
+       case ASGNB:
+               rtarget(p, 0, intreg[EDI]);
+               rtarget(p->kids[1], 0, intreg[ESI]);
+               break;
+       case ARGB:
+               rtarget(p->kids[0], 0, intreg[ESI]);
+               break;
+       case CALLI: case CALLV:
+               setreg(p, intreg[EAX]);
+               break;
+       case RETI:
+               rtarget(p, 0, intreg[EAX]);
+               break;
+       }
+}
+
+static void clobber(p) Node p; {
+       static int nstack = 0;
+
+       assert(p);
+       nstack = ckstack(p, nstack);
+       assert(p->count > 0 || nstack == 0);
+       switch (p->op) {
+       case ASGNB: case ARGB:
+               spill(1<<ECX | 1<<ESI | 1<<EDI, IREG, p);
+               break;
+       case EQD: case LED: case GED: case LTD: case GTD: case NED:
+       case EQF: case LEF: case GEF: case LTF: case GTF: case NEF:
+               spill(1<<EAX, IREG, p);
+               break;
+       case CALLD: case CALLF:
+               spill(1<<EDX | 1<<EAX, IREG, p);
+               break;
+       }
+}
+#define isfp(p) (optype((p)->op)==F || optype((p)->op)==D)
+
+static int ckstack(p, n) Node p; int n; {
+       int i;
+
+       for (i = 0; i < NELEMS(p->x.kids) && p->x.kids[i]; i++)
+               if (isfp(p->x.kids[i]))
+                       n--;
+       if (isfp(p) && p->count > 0)
+               n++;
+       if (n > 8)
+               error("expression too complicated\n");
+       debug(fprint(2, "(ckstack(%x)=%d)\n", p, n));
+       assert(n >= 0);
+       return n;
+}
+static int memop(p) Node p; {
+       assert(p);
+       assert(generic(p->op) == ASGN);
+       assert(p->kids[0]);
+       assert(p->kids[1]);
+       if (generic(p->kids[1]->kids[0]->op) == INDIR
+       && sametree(p->kids[0], p->kids[1]->kids[0]->kids[0]))
+               return 3;
+       else
+               return LBURG_MAX;
+}
+static int sametree(p, q) Node p, q; {
+       return p == NULL && q == NULL
+       || p && q && p->op == q->op && p->syms[0] == q->syms[0]
+               && sametree(p->kids[0], q->kids[0])
+               && sametree(p->kids[1], q->kids[1]);
+}
+static void emit2(p) Node p; {
+#define preg(f) ((f)[getregnum(p->x.kids[0])]->x.name)
+
+       if (p->op == CVCI)
+               print("movsx %s,%s\n", p->syms[RX]->x.name
+, preg(charreg));
+       else if (p->op == CVCU)
+               print("movzx %s,%s\n", p->syms[RX]->x.name
+, preg(charreg));
+       else if (p->op == CVSI)
+               print("movsx %s,%s\n", p->syms[RX]->x.name
+, preg(shortreg));
+       else if (p->op == CVSU)
+               print("movzx %s,%s\n", p->syms[RX]->x.name
+, preg(shortreg));
+       else if (p->op == CVIC || p->op == CVIS
+             || p->op == CVUC || p->op == CVUS) {
+               char *dst = shortreg[getregnum(p)]->x.name;
+               char *src = preg(shortreg);
+               if (dst != src)
+                       print("mov %s,%s\n", dst, src);
+       }
+}
+
+static void doarg(p) Node p; {
+       assert(p && p->syms[0]);
+       mkactual(4, p->syms[0]->u.c.v.i);
+}
+static void blkfetch(k, off, reg, tmp)
+int k, off, reg, tmp; {}
+static void blkstore(k, off, reg, tmp)
+int k, off, reg, tmp; {}
+static void blkloop(dreg, doff, sreg, soff, size, tmps)
+int dreg, doff, sreg, soff, size, tmps[]; {}
+static void local(p) Symbol p; {
+       if (isfloat(p->type))
+               p->sclass = AUTO;
+       if (askregvar(p, rmap[ttob(p->type)]) == 0)
+               mkauto(p);
+}
+static void function(f, caller, callee, n)
+Symbol f, callee[], caller[]; int n; {
+       int i;
+
+       print("%s:\n", f->x.name);
+       print("push ebx\n");
+       print("push esi\n");
+       print("push edi\n");
+       print("push ebp\n");
+       print("mov ebp,esp\n");
+usedmask[0] = usedmask[1] = 0;
+freemask[0] = freemask[1] = ~(unsigned)0;
+       offset = 16 + 4;
+       for (i = 0; callee[i]; i++) {
+               Symbol p = callee[i];
+               Symbol q = caller[i];
+               assert(q);
+               p->x.offset = q->x.offset = offset;
+               p->x.name = q->x.name = stringf("%d", p->x.offset);
+               p->sclass = q->sclass = AUTO;
+               offset += roundup(q->type->size, 4);
+       }
+       assert(caller[i] == 0);
+       offset = maxoffset = 0;
+       gencode(caller, callee);
+       framesize = roundup(maxoffset, 4);
+       if (framesize > 0)
+               print("sub esp,%d\n", framesize);
+       emitcode();
+       print("mov esp,ebp\n");
+       print("pop ebp\n");
+       print("pop edi\n");
+       print("pop esi\n");
+       print("pop ebx\n");
+       print("ret\n");
+}
+static void defsymbol(p) Symbol p; {
+       if (p->scope >= LOCAL && p->sclass == STATIC)
+               p->x.name = stringf("L%d", genlabel(1));
+       else if (p->generated)
+               p->x.name = stringf("$L%s", p->name);
+       else if (p->scope == GLOBAL || p->sclass == EXTERN)
+       /* CHANGE THIS FOR a.out */
+#if 0
+               p->x.name = stringf("$_%s", p->name);
+#else
+               p->x.name = stringf("$%s", p->name);
+#endif
+       else if (p->scope == CONSTANTS
+       && (isint(p->type) || isptr(p->type))
+       && p->name[0] == '0' && p->name[1] == 'x')
+               p->x.name = stringf("0%sH", &p->name[2]);
+       else
+               p->x.name = p->name;
+}
+static void address(q, p, n) Symbol q, p; int n; {
+       if (p->scope == GLOBAL
+       || p->sclass == STATIC || p->sclass == EXTERN)
+               q->x.name = stringf("%s%s%d",
+                       p->x.name, n >= 0 ? "+" : "", n);
+       else {
+               q->x.offset = p->x.offset + n;
+               q->x.name = stringd(q->x.offset);
+       }
+}
+static void defconst(ty, v) int ty; Value v; {
+       switch (ty) {
+               case C: print("db %d\n",   v.uc); return;
+               case S: print("dw %d\n",   v.ss); return;
+               case I: print("dd %d\n",   v.i ); return;
+               case U: print("dd 0%xH\n", v.u ); return;
+               case P: print("dd 0%xH\n", v.p ); return;
+               case F:
+                       print("dd 0%xH\n", *(unsigned *)&v.f);
+                       return;
+               case D: {
+                       unsigned *p = (unsigned *)&v.d;
+                       print("dd 0%xH,0%xH\n", p[swap], p[1 - swap]);
+                       return;
+                       }
+       }
+       assert(0);
+}
+static void defaddress(p) Symbol p; {
+       print("dd %s\n", p->x.name);
+}
+static void defstring(n, str) int n; char *str; {
+       char *s;
+       int inquote = 1;
+
+       print("db '");
+
+       for (s = str; s < str + n; s++)
+       {
+               if ((*s & 0x7F) == *s && *s >= ' ' && *s != '\'') {
+                       if (!inquote){
+                               print(", '");
+                               inquote = 1;
+                       }
+                       print("%c",*s);
+               }
+               else
+               {
+                       if (inquote){
+                               print("', ");
+                               inquote = 0;
+                       }
+                       else
+                               print(", ");
+                       print("%d",*s);
+               }
+       }
+       if (inquote) print("'");
+       print("\n");
+}
+static void export(p) Symbol p; {
+       print("[global %s]\n", p->x.name);
+}
+static void import(p) Symbol p; {
+       if (p->ref > 0) {
+               print("[extern %s]\n", p->x.name);
+       }
+}
+static void global(p) Symbol p; {
+       int i;
+
+       if (p->u.seg == BSS)
+               print("resb ($-$$) & %d\n",
+                       p->type->align > 4 ? 3 : p->type->align-1);
+       else
+               print("times ($-$$) & %d nop\n",
+                       p->type->align > 4 ? 3 : p->type->align-1);
+       print("%s:\n", p->x.name);
+       if (p->u.seg == BSS)
+               print("resb %d\n", p->type->size);
+}
+static void space(n) int n; {
+       int i;
+
+       if (cseg != BSS)
+               print("times %d db 0\n", n);
+}
+Interface x86nasmIR = {
+       1, 1, 0,  /* char */
+       2, 2, 0,  /* short */
+       4, 4, 0,  /* int */
+       4, 4, 1,  /* float */
+       8, 4, 1,  /* double */
+       4, 4, 0,  /* T * */
+       0, 4, 0,  /* struct; so that ARGB keeps stack aligned */
+       1,        /* little_endian */
+       0,        /* mulops_calls */
+       0,        /* wants_callb */
+       1,        /* wants_argb */
+       0,        /* left_to_right */
+       0,        /* wants_dag */
+       address,
+       blockbeg,
+       blockend,
+       defaddress,
+       defconst,
+       defstring,
+       defsymbol,
+       emit,
+       export,
+       function,
+       gen,
+       global,
+       import,
+       local,
+       progbeg,
+       progend,
+       segment,
+       space,
+       0, 0, 0, 0, 0, 0, 0,
+       {1, blkfetch, blkstore, blkloop,
+           _label,
+           _rule,
+           _nts,
+           _kids,
+           _opname,
+           _arity,
+           _string,
+           _templates,
+           _isinstruction,
+           _ntname,
+           emit2,
+           doarg,
+           target,
+           clobber,
+}
+};
diff --git a/lib/snprintf.c b/lib/snprintf.c
new file mode 100644 (file)
index 0000000..01734dc
--- /dev/null
@@ -0,0 +1,25 @@
+/*
+ * snprintf()
+ *
+ * Implement snprintf() in terms of vsnprintf()
+ */
+
+#include "compiler.h"
+
+#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/strlcpy.c b/lib/strlcpy.c
new file mode 100644 (file)
index 0000000..4335359
--- /dev/null
@@ -0,0 +1,53 @@
+/*
+ * Copyright (c) 1998 Todd C. Miller <Todd.Miller@courtesan.com>
+ *
+ * Permission to use, copy, modify, and distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
+ * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
+ * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
+ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ */
+
+#include <sys/types.h>
+#include <string.h>
+#include "compiler.h"
+
+/*
+ * Copy src to string dst of size siz.  At most siz-1 characters
+ * will be copied.  Always NUL terminates (unless siz == 0).
+ * Returns strlen(src); if retval >= siz, truncation occurred.
+ */
+#ifndef HAVE_STRLCPY
+
+size_t strlcpy(char *dst, const char *src, size_t siz)
+{
+    char *d = dst;
+    const char *s = src;
+    size_t n = siz;
+
+    /* Copy as many bytes as will fit */
+    if (n != 0) {
+       while (--n != 0) {
+           if ((*d++ = *s++) == '\0')
+               break;
+       }
+    }
+
+    /* Not enough room in dst, add NUL and traverse rest of src */
+    if (n == 0) {
+       if (siz != 0)
+           *d = '\0';          /* NUL-terminate dst */
+       while (*s++)
+           ;
+    }
+
+    return(s - src - 1);       /* count does not include NUL */
+}
+
+#endif
diff --git a/lib/vsnprintf.c b/lib/vsnprintf.c
new file mode 100644 (file)
index 0000000..f5ae2fe
--- /dev/null
@@ -0,0 +1,49 @@
+/*
+ * vsnprintf()
+ *
+ * Poor substitute for a real vsnprintf() function for systems
+ * that don't have them...
+ */
+
+#include "compiler.h"
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <stdarg.h>
+#include <string.h>
+
+#include "nasmlib.h"
+
+#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/listing.c b/listing.c
new file mode 100644 (file)
index 0000000..5a09440
--- /dev/null
+++ b/listing.c
@@ -0,0 +1,387 @@
+/* ----------------------------------------------------------------------- *
+ *   
+ *   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.
+ *
+ * ----------------------------------------------------------------------- */
+
+/*
+ * listing.c    listing file generator for the Netwide Assembler
+ */
+
+#include "compiler.h"
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <stddef.h>
+#include <string.h>
+#include <ctype.h>
+#include <inttypes.h>
+
+#include "nasm.h"
+#include "nasmlib.h"
+#include "listing.h"
+
+#define LIST_MAX_LEN 216        /* something sensible */
+#define LIST_INDENT  40
+#define LIST_HEXBIT  18
+
+typedef struct MacroInhibit MacroInhibit;
+
+static struct MacroInhibit {
+    MacroInhibit *next;
+    int level;
+    int inhibiting;
+} *mistack;
+
+static char xdigit[] = "0123456789ABCDEF";
+
+#define HEX(a,b) (*(a)=xdigit[((b)>>4)&15],(a)[1]=xdigit[(b)&15]);
+
+static char listline[LIST_MAX_LEN];
+static bool listlinep;
+
+static char listerror[LIST_MAX_LEN];
+
+static char listdata[2 * LIST_INDENT];  /* we need less than that actually */
+static int32_t listoffset;
+
+static int32_t listlineno;
+
+static int32_t listp;
+
+static int suppress;            /* for INCBIN & TIMES special cases */
+
+static int listlevel, listlevel_e;
+
+static FILE *listfp;
+
+static void list_emit(void)
+{
+    int i;
+
+    if (!listlinep && !listdata[0])
+        return;
+
+    fprintf(listfp, "%6"PRId32" ", ++listlineno);
+
+    if (listdata[0])
+        fprintf(listfp, "%08"PRIX32" %-*s", listoffset, LIST_HEXBIT + 1,
+                listdata);
+    else
+        fprintf(listfp, "%*s", LIST_HEXBIT + 10, "");
+
+    if (listlevel_e)
+        fprintf(listfp, "%s<%d>", (listlevel < 10 ? " " : ""),
+                listlevel_e);
+    else if (listlinep)
+        fprintf(listfp, "    ");
+
+    if (listlinep)
+        fprintf(listfp, " %s", listline);
+
+    putc('\n', listfp);
+    listlinep = false;
+    listdata[0] = '\0';
+
+    if (listerror[0]) {
+       fprintf(listfp, "%6"PRId32"          ", ++listlineno);
+       for (i = 0; i < LIST_HEXBIT; i++)
+           putc('*', listfp);
+       
+       if (listlevel_e)
+           fprintf(listfp, " %s<%d>", (listlevel < 10 ? " " : ""),
+                   listlevel_e);
+       else
+           fprintf(listfp, "     ");
+
+       fprintf(listfp, "  %s\n", listerror);
+       listerror[0] = '\0';
+    }
+}
+
+static void list_init(char *fname, efunc error)
+{
+    listfp = fopen(fname, "w");
+    if (!listfp) {
+        error(ERR_NONFATAL, "unable to open listing file `%s'",
+             fname);
+        return;
+    }
+
+    *listline = '\0';
+    listlineno = 0;
+    *listerror = '\0';
+    listp = true;
+    listlevel = 0;
+    suppress = 0;
+    mistack = nasm_malloc(sizeof(MacroInhibit));
+    mistack->next = NULL;
+    mistack->level = 0;
+    mistack->inhibiting = true;
+}
+
+static void list_cleanup(void)
+{
+    if (!listp)
+        return;
+
+    while (mistack) {
+        MacroInhibit *temp = mistack;
+        mistack = temp->next;
+        nasm_free(temp);
+    }
+
+    list_emit();
+    fclose(listfp);
+}
+
+static void list_out(int32_t offset, char *str)
+{
+    if (strlen(listdata) + strlen(str) > LIST_HEXBIT) {
+        strcat(listdata, "-");
+        list_emit();
+    }
+    if (!listdata[0])
+        listoffset = offset;
+    strcat(listdata, str);
+}
+
+static void list_output(int32_t offset, const void *data,
+                       enum out_type type, uint64_t size)
+{
+    if (!listp || suppress || user_nolist)      /* fbk - 9/2/00 */
+        return;
+
+    switch (type) {
+    case OUT_RAWDATA:
+    {
+        uint8_t const *p = data;
+        char q[3];
+       if (size == 0 && !listdata[0])
+           listoffset = offset;
+        while (size--) {
+            HEX(q, *p);
+            q[2] = '\0';
+            list_out(offset++, q);
+            p++;
+        }
+       break;
+    }
+    case OUT_ADDRESS:
+    {
+        uint64_t d = *(int64_t *)data;
+        char q[20];
+        uint8_t p[8], *r = p;
+        if (size == 4) {
+            q[0] = '[';
+            q[9] = ']';
+            q[10] = '\0';
+            WRITELONG(r, d);
+            HEX(q + 1, p[0]);
+            HEX(q + 3, p[1]);
+            HEX(q + 5, p[2]);
+            HEX(q + 7, p[3]);
+            list_out(offset, q);
+        } else if (size == 8) {
+            q[0] = '[';
+            q[17] = ']';
+            q[18] = '\0';
+            WRITEDLONG(r, d);
+            HEX(q + 1,  p[0]);
+            HEX(q + 3,  p[1]);
+            HEX(q + 5,  p[2]);
+            HEX(q + 7,  p[3]);
+            HEX(q + 9,  p[4]);
+            HEX(q + 11, p[5]);
+            HEX(q + 13, p[6]);
+            HEX(q + 15, p[7]);
+            list_out(offset, q);
+        } else {
+            q[0] = '[';
+            q[5] = ']';
+            q[6] = '\0';
+            WRITESHORT(r, d);
+            HEX(q + 1, p[0]);
+            HEX(q + 3, p[1]);
+            list_out(offset, q);
+        }
+       break;
+    }
+    case OUT_REL2ADR:
+    {
+        uint32_t d = *(int32_t *)data;
+        char q[11];
+        uint8_t p[4], *r = p;
+        q[0] = '(';
+        q[5] = ')';
+        q[6] = '\0';
+        WRITESHORT(r, d);
+        HEX(q + 1, p[0]);
+        HEX(q + 3, p[1]);
+        list_out(offset, q);
+       break;
+    }
+    case OUT_REL4ADR:
+    {
+        uint32_t d = *(int32_t *)data;
+        char q[11];
+        uint8_t p[4], *r = p;
+        q[0] = '(';
+        q[9] = ')';
+        q[10] = '\0';
+        WRITELONG(r, d);
+        HEX(q + 1, p[0]);
+        HEX(q + 3, p[1]);
+        HEX(q + 5, p[2]);
+        HEX(q + 7, p[3]);
+        list_out(offset, q);
+       break;
+    }
+    case OUT_REL8ADR:
+    {
+        uint64_t d = *(int64_t *)data;
+        char q[19];
+        uint8_t p[8], *r = p;
+        q[0] = '(';
+        q[17] = ')';
+        q[18] = '\0';
+        WRITEDLONG(r, d);
+        HEX(q + 1, p[0]);
+        HEX(q + 3, p[1]);
+        HEX(q + 5, p[2]);
+        HEX(q + 7, p[3]);
+        HEX(q + 9, p[4]);
+        HEX(q + 11, p[5]);
+        HEX(q + 13, p[6]);
+        HEX(q + 15, p[7]);
+        list_out(offset, q);
+       break;
+    }
+    case OUT_RESERVE:
+    {
+        char q[20];
+        snprintf(q, sizeof(q), "<res %08"PRIX64">", size);
+        list_out(offset, q);
+       break;
+    }
+    }
+}
+
+static void list_line(int type, char *line)
+{
+    if (!listp)
+        return;
+    if (user_nolist) {          /* fbk - 9/2/00 */
+        listlineno++;
+        return;
+    }
+
+    if (mistack && mistack->inhibiting) {
+        if (type == LIST_MACRO)
+            return;
+        else {                  /* pop the m i stack */
+            MacroInhibit *temp = mistack;
+            mistack = temp->next;
+            nasm_free(temp);
+        }
+    }
+    list_emit();
+    listlinep = true;
+    strncpy(listline, line, LIST_MAX_LEN - 1);
+    listline[LIST_MAX_LEN - 1] = '\0';
+    listlevel_e = listlevel;
+}
+
+static void list_uplevel(int type)
+{
+    if (!listp)
+        return;
+    if (type == LIST_INCBIN || type == LIST_TIMES) {
+        suppress |= (type == LIST_INCBIN ? 1 : 2);
+        list_out(listoffset, type == LIST_INCBIN ? "<incbin>" : "<rept>");
+        return;
+    }
+
+    listlevel++;
+
+    if (mistack && mistack->inhibiting && type == LIST_INCLUDE) {
+        MacroInhibit *temp = nasm_malloc(sizeof(MacroInhibit));
+        temp->next = mistack;
+        temp->level = listlevel;
+        temp->inhibiting = false;
+        mistack = temp;
+    } else if (type == LIST_MACRO_NOLIST) {
+        MacroInhibit *temp = nasm_malloc(sizeof(MacroInhibit));
+        temp->next = mistack;
+        temp->level = listlevel;
+        temp->inhibiting = true;
+        mistack = temp;
+    }
+}
+
+static void list_downlevel(int type)
+{
+    if (!listp)
+        return;
+
+    if (type == LIST_INCBIN || type == LIST_TIMES) {
+        suppress &= ~(type == LIST_INCBIN ? 1 : 2);
+        return;
+    }
+
+    listlevel--;
+    while (mistack && mistack->level > listlevel) {
+        MacroInhibit *temp = mistack;
+        mistack = temp->next;
+        nasm_free(temp);
+    }
+}
+
+static void list_error(int severity, const char *pfx, const char *msg)
+{
+    if (!listfp)
+       return;
+
+    snprintf(listerror, sizeof listerror, "%s%s", pfx, msg);
+
+    if ((severity & ERR_MASK) >= ERR_FATAL)
+       list_emit();
+}
+
+
+ListGen nasmlist = {
+    list_init,
+    list_cleanup,
+    list_output,
+    list_line,
+    list_uplevel,
+    list_downlevel,
+    list_error
+};
diff --git a/listing.h b/listing.h
new file mode 100644 (file)
index 0000000..da2e849
--- /dev/null
+++ b/listing.h
@@ -0,0 +1,44 @@
+/* ----------------------------------------------------------------------- *
+ *   
+ *   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.
+ *
+ * ----------------------------------------------------------------------- */
+
+/* 
+ * listing.h   header file for listing.c
+ */
+
+#ifndef NASM_LISTING_H
+#define NASM_LISTING_H
+
+extern ListGen nasmlist;
+extern int user_nolist;         /* fbk - 9/1/00 */
+
+#endif
diff --git a/macros.c b/macros.c
new file mode 100644 (file)
index 0000000..5bd88f3
--- /dev/null
+++ b/macros.c
@@ -0,0 +1,516 @@
+/*
+ * Do not edit - this file auto-generated by macros.pl from:
+ *   ./standard.mac
+ *   version.mac
+ *   ./macros/altreg.mac
+ *   ./macros/smartalign.mac
+ *   ./output/outaout.mac
+ *   ./output/outas86.mac
+ *   ./output/outbin.mac
+ *   ./output/outcoff.mac
+ *   ./output/outelf.mac
+ *   ./output/outmacho.mac
+ *   ./output/outobj.mac
+ *   ./output/outrdf.mac
+ *   ./output/outrdf2.mac
+ */
+
+#include "tables.h"
+#include "nasmlib.h"
+#include "hashtbl.h"
+#include "output/outform.h"
+
+#if 1
+const unsigned char nasm_stdmac[] = {
+    /* From ./standard.mac */
+        /*    0 */ 209,'I','D','E','A','L',0,
+        /*    7 */ 209,'J','U','M','P','S',0,
+        /*   14 */ 209,'P','3','8','6',0,
+        /*   20 */ 209,'P','4','8','6',0,
+        /*   26 */ 209,'P','5','8','6',0,
+        /*   32 */ 209,'E','N','D',0,
+    /* End of TASM macros */
+        /*   37 */ 195,'_','_','F','I','L','E','_','_',0,
+        /*   47 */ 195,'_','_','L','I','N','E','_','_',0,
+        /*   57 */ 195,'_','_','B','I','T','S','_','_',0,
+        /*   67 */ 195,'_','_','S','E','C','T','_','_',0,
+        /*   77 */ 212,'s','e','c','t','i','o','n',' ','1','+','.','n','o','l','i','s','t',0,
+        /*   96 */ 195,'_','_','S','E','C','T','_','_',' ','[','s','e','c','t','i','o','n',' ','%','1',']',0,
+        /*  119 */ '_','_','S','E','C','T','_','_',0,
+        /*  128 */ 202,0,
+        /*  130 */ 212,'s','e','g','m','e','n','t',' ','1','+','.','n','o','l','i','s','t',0,
+        /*  149 */ 195,'_','_','S','E','C','T','_','_',' ','[','s','e','g','m','e','n','t',' ','%','1',']',0,
+        /*  172 */ '_','_','S','E','C','T','_','_',0,
+        /*  181 */ 202,0,
+        /*  183 */ 212,'a','b','s','o','l','u','t','e',' ','1','+','.','n','o','l','i','s','t',0,
+        /*  203 */ 195,'_','_','S','E','C','T','_','_',' ','[','a','b','s','o','l','u','t','e',' ','%','1',']',0,
+        /*  227 */ '_','_','S','E','C','T','_','_',0,
+        /*  236 */ 202,0,
+        /*  238 */ 212,'s','t','r','u','c',' ','1','-','2','.','n','o','l','i','s','t',' ','0',0,
+        /*  258 */ 221,0,
+        /*  260 */ 195,'%','$','s','t','r','u','c','n','a','m','e',' ','%','1',0,
+        /*  276 */ '[','a','b','s','o','l','u','t','e',' ','%','2',']',0,
+        /*  290 */ '%','$','s','t','r','u','c','n','a','m','e',':',0,
+        /*  303 */ 202,0,
+        /*  305 */ 212,'e','n','d','s','t','r','u','c',' ','0','.','n','o','l','i','s','t',0,
+        /*  324 */ '%','{','$','s','t','r','u','c','n','a','m','e','}','_','s','i','z','e',' ','e','q','u',' ','(','$','-','%','$','s','t','r','u','c','n','a','m','e',')',0,
+        /*  363 */ 220,0,
+        /*  365 */ '_','_','S','E','C','T','_','_',0,
+        /*  374 */ 202,0,
+        /*  376 */ 212,'i','s','t','r','u','c',' ','1','.','n','o','l','i','s','t',0,
+        /*  393 */ 221,0,
+        /*  395 */ 195,'%','$','s','t','r','u','c','n','a','m','e',' ','%','1',0,
+        /*  411 */ '%','$','s','t','r','u','c','s','t','a','r','t',':',0,
+        /*  425 */ 202,0,
+        /*  427 */ 212,'a','t',' ','1','-','2','+','.','n','o','l','i','s','t',0,
+        /*  443 */ 't','i','m','e','s',' ','(','%','1','-','%','$','s','t','r','u','c','n','a','m','e',')','-','(','$','-','%','$','s','t','r','u','c','s','t','a','r','t',')',' ','d','b',' ','0',0,
+        /*  488 */ '%','2',0,
+        /*  491 */ 202,0,
+        /*  493 */ 212,'i','e','n','d',' ','0','.','n','o','l','i','s','t',0,
+        /*  508 */ 't','i','m','e','s',' ','%','{','$','s','t','r','u','c','n','a','m','e','}','_','s','i','z','e','-','(','$','-','%','$','s','t','r','u','c','s','t','a','r','t',')',' ','d','b',' ','0',0,
+        /*  555 */ 220,0,
+        /*  557 */ 202,0,
+        /*  559 */ 212,'a','l','i','g','n',' ','1','-','2','+','.','n','o','l','i','s','t',' ','n','o','p',0,
+        /*  582 */ 't','i','m','e','s',' ','(','(','(','%','1',')',' ','-',' ','(','(','$','-','$','$',')',' ','%',' ','(','%','1',')',')',')',' ','%',' ','(','%','1',')',')',' ','%','2',0,
+        /*  625 */ 202,0,
+        /*  627 */ 212,'a','l','i','g','n','b',' ','1','-','2','+','.','n','o','l','i','s','t',0,
+        /*  647 */ 166,'%','2',0,
+        /*  651 */ 'r','e','s','b',' ','(','(','(','%','1',')',' ','-',' ','(','(','$','-','$','$',')',' ','%',' ','(','%','1',')',')',')',' ','%',' ','(','%','1',')',')',0,
+        /*  690 */ 199,0,
+        /*  692 */ 't','i','m','e','s',' ','(','(','(','%','1',')',' ','-',' ','(','(','$','-','$','$',')',' ','%',' ','(','%','1',')',')',')',' ','%',' ','(','%','1',')',')',' ','%','2',0,
+        /*  735 */ 200,0,
+        /*  737 */ 202,0,
+        /*  739 */ 212,'e','x','t','e','r','n',' ','1','-','*','.','n','o','l','i','s','t',0,
+        /*  758 */ 222,'%','0',0,
+        /*  762 */ '[','e','x','t','e','r','n',' ','%','1',']',0,
+        /*  774 */ 225,'1',0,
+        /*  777 */ 203,0,
+        /*  779 */ 202,0,
+        /*  781 */ 212,'b','i','t','s',' ','1','+','.','n','o','l','i','s','t',0,
+        /*  797 */ '[','b','i','t','s',' ','%','1',']',0,
+        /*  807 */ 202,0,
+        /*  809 */ 212,'u','s','e','1','6',' ','0','.','n','o','l','i','s','t',0,
+        /*  825 */ '[','b','i','t','s',' ','1','6',']',0,
+        /*  835 */ 202,0,
+        /*  837 */ 212,'u','s','e','3','2',' ','0','.','n','o','l','i','s','t',0,
+        /*  853 */ '[','b','i','t','s',' ','3','2',']',0,
+        /*  863 */ 202,0,
+        /*  865 */ 212,'u','s','e','6','4',' ','0','.','n','o','l','i','s','t',0,
+        /*  881 */ '[','b','i','t','s',' ','6','4',']',0,
+        /*  891 */ 202,0,
+        /*  893 */ 212,'g','l','o','b','a','l',' ','1','-','*','.','n','o','l','i','s','t',0,
+        /*  912 */ 222,'%','0',0,
+        /*  916 */ '[','g','l','o','b','a','l',' ','%','1',']',0,
+        /*  928 */ 225,'1',0,
+        /*  931 */ 203,0,
+        /*  933 */ 202,0,
+        /*  935 */ 212,'c','o','m','m','o','n',' ','1','-','*','.','n','o','l','i','s','t',0,
+        /*  954 */ 222,'%','0',0,
+        /*  958 */ '[','c','o','m','m','o','n',' ','%','1',']',0,
+        /*  970 */ 225,'1',0,
+        /*  973 */ 203,0,
+        /*  975 */ 202,0,
+        /*  977 */ 212,'c','p','u',' ','1','+','.','n','o','l','i','s','t',0,
+        /*  992 */ '[','c','p','u',' ','%','1',']',0,
+        /* 1001 */ 202,0,
+        /* 1003 */ 195,'_','_','F','L','O','A','T','_','D','A','Z','_','_',' ','n','o','d','a','z',0,
+        /* 1024 */ 195,'_','_','F','L','O','A','T','_','R','O','U','N','D','_','_',' ','n','e','a','r',0,
+        /* 1046 */ 195,'_','_','F','L','O','A','T','_','_',' ','_','_','F','L','O','A','T','_','D','A','Z','_','_',',','_','_','F','L','O','A','T','_','R','O','U','N','D','_','_',0,
+        /* 1087 */ 212,'f','l','o','a','t',' ','1','-','*','.','n','o','l','i','s','t',0,
+        /* 1105 */ 222,'%','0',0,
+        /* 1109 */ '[','f','l','o','a','t',' ','%','1',']',0,
+        /* 1120 */ 172,'%','1',',','d','a','z',0,
+        /* 1128 */ 195,'_','_','F','L','O','A','T','_','D','A','Z','_','_',' ','d','a','z',0,
+        /* 1147 */ 140,'%','1',',','n','o','d','a','z',0,
+        /* 1157 */ 195,'_','_','F','L','O','A','T','_','D','A','Z','_','_',' ','n','o','d','a','z',0,
+        /* 1178 */ 140,'%','1',',','n','e','a','r',0,
+        /* 1187 */ 195,'_','_','F','L','O','A','T','_','R','O','U','N','D','_','_',' ','n','e','a','r',0,
+        /* 1209 */ 140,'%','1',',','u','p',0,
+        /* 1216 */ 195,'_','_','F','L','O','A','T','_','R','O','U','N','D','_','_',' ','u','p',0,
+        /* 1236 */ 140,'%','1',',','d','o','w','n',0,
+        /* 1245 */ 195,'_','_','F','L','O','A','T','_','R','O','U','N','D','_','_',' ','d','o','w','n',0,
+        /* 1267 */ 140,'%','1',',','z','e','r','o',0,
+        /* 1276 */ 195,'_','_','F','L','O','A','T','_','R','O','U','N','D','_','_',' ','z','e','r','o',0,
+        /* 1298 */ 140,'%','1',',','d','e','f','a','u','l','t',0,
+        /* 1310 */ 195,'_','_','F','L','O','A','T','_','D','A','Z','_','_',' ','n','o','d','a','z',0,
+        /* 1331 */ 195,'_','_','F','L','O','A','T','_','R','O','U','N','D','_','_',' ','n','e','a','r',0,
+        /* 1353 */ 200,0,
+        /* 1355 */ 225,'1',0,
+        /* 1358 */ 203,0,
+        /* 1360 */ 202,0,
+        /* 1362 */ 212,'d','e','f','a','u','l','t',' ','1','+','.','n','o','l','i','s','t',0,
+        /* 1381 */ '[','d','e','f','a','u','l','t',' ','%','1',']',0,
+        /* 1394 */ 202,0,
+        /* 1396 */ 212,'i','n','c','b','i','n',' ','1','-','2','+','.','n','o','l','i','s','t',' ','0',0,
+        /* 1418 */ 221,0,
+        /* 1420 */ 219,'%','$','d','e','p',' ','%','1',0,
+        /* 1430 */ 198,'%','$','d','e','p',0,
+        /* 1437 */ '%','?',' ','%','$','d','e','p',',','%','2',0,
+        /* 1449 */ 220,0,
+        /* 1451 */ 202,0,
+
+    /* From version.mac */
+        /* 1453 */ 195,'_','_','N','A','S','M','_','M','A','J','O','R','_','_',' ','2',0,
+        /* 1471 */ 195,'_','_','N','A','S','M','_','M','I','N','O','R','_','_',' ','7',0,
+        /* 1489 */ 195,'_','_','N','A','S','M','_','S','U','B','M','I','N','O','R','_','_',' ','9','9',0,
+        /* 1511 */ 195,'_','_','N','A','S','M','_','P','A','T','C','H','L','E','V','E','L','_','_',' ','9','7',0,
+        /* 1535 */ 195,'_','_','N','A','S','M','_','V','E','R','S','I','O','N','_','I','D','_','_',' ','0','0','2','0','7','6','3','6','1','h',0,
+        /* 1567 */ 195,'_','_','N','A','S','M','_','V','E','R','_','_',' ', 34,'2','.','0','8','r','c','7', 34,0,
+        /* 1591 */ 0
+};
+#endif
+
+#if 1
+static const unsigned char nasm_stdmac_altreg[] = {
+    /* From ./macros/altreg.mac */
+        /*    0 */ 195,'_','_','U','S','E','_','A','L','T','R','E','G','_','_',0,
+        /*   16 */ 209,'r','8','l',' ',' ','r','8','b',0,
+        /*   26 */ 209,'r','9','l',' ',' ','r','9','b',0,
+        /*   36 */ 209,'r','1','0','l',' ','r','1','0','b',0,
+        /*   47 */ 209,'r','1','1','l',' ','r','1','1','b',0,
+        /*   58 */ 209,'r','1','2','l',' ','r','1','2','b',0,
+        /*   69 */ 209,'r','1','3','l',' ','r','1','3','b',0,
+        /*   80 */ 209,'r','1','4','l',' ','r','1','4','b',0,
+        /*   91 */ 209,'r','1','5','l',' ','r','1','5','b',0,
+        /*  102 */ 209,'r','0',' ',' ','r','a','x',0,
+        /*  111 */ 209,'r','1',' ',' ','r','c','x',0,
+        /*  120 */ 209,'r','2',' ',' ','r','d','x',0,
+        /*  129 */ 209,'r','3',' ',' ','r','b','x',0,
+        /*  138 */ 209,'r','4',' ',' ','r','s','p',0,
+        /*  147 */ 209,'r','5',' ',' ','r','b','p',0,
+        /*  156 */ 209,'r','6',' ',' ','r','s','i',0,
+        /*  165 */ 209,'r','7',' ',' ','r','d','i',0,
+        /*  174 */ 209,'r','0','d',' ','e','a','x',0,
+        /*  183 */ 209,'r','1','d',' ','e','c','x',0,
+        /*  192 */ 209,'r','2','d',' ','e','d','x',0,
+        /*  201 */ 209,'r','3','d',' ','e','b','x',0,
+        /*  210 */ 209,'r','4','d',' ','e','s','p',0,
+        /*  219 */ 209,'r','5','d',' ','e','b','p',0,
+        /*  228 */ 209,'r','6','d',' ','e','s','i',0,
+        /*  237 */ 209,'r','7','d',' ','e','d','i',0,
+        /*  246 */ 209,'r','0','w',' ','a','x',0,
+        /*  254 */ 209,'r','1','w',' ','c','x',0,
+        /*  262 */ 209,'r','2','w',' ','d','x',0,
+        /*  270 */ 209,'r','3','w',' ','b','x',0,
+        /*  278 */ 209,'r','4','w',' ','s','p',0,
+        /*  286 */ 209,'r','5','w',' ','b','p',0,
+        /*  294 */ 209,'r','6','w',' ','s','i',0,
+        /*  302 */ 209,'r','7','w',' ','d','i',0,
+        /*  310 */ 209,'r','0','b',' ','a','l',0,
+        /*  318 */ 209,'r','1','b',' ','c','l',0,
+        /*  326 */ 209,'r','2','b',' ','d','l',0,
+        /*  334 */ 209,'r','3','b',' ','b','l',0,
+        /*  342 */ 209,'r','4','b',' ','s','p','l',0,
+        /*  351 */ 209,'r','5','b',' ','b','p','l',0,
+        /*  360 */ 209,'r','6','b',' ','s','i','l',0,
+        /*  369 */ 209,'r','7','b',' ','d','i','l',0,
+        /*  378 */ 209,'r','0','l',' ','a','l',0,
+        /*  386 */ 209,'r','1','l',' ','c','l',0,
+        /*  394 */ 209,'r','2','l',' ','d','l',0,
+        /*  402 */ 209,'r','3','l',' ','b','l',0,
+        /*  410 */ 209,'r','4','l',' ','s','p','l',0,
+        /*  419 */ 209,'r','5','l',' ','b','p','l',0,
+        /*  428 */ 209,'r','6','l',' ','s','i','l',0,
+        /*  437 */ 209,'r','7','l',' ','d','i','l',0,
+        /*  446 */ 209,'r','0','h',' ','a','h',0,
+        /*  454 */ 209,'r','1','h',' ','c','h',0,
+        /*  462 */ 209,'r','2','h',' ','d','h',0,
+        /*  470 */ 209,'r','3','h',' ','b','h',0,
+        /*  478 */ 0
+};
+#endif
+
+#if 1
+static const unsigned char nasm_stdmac_smartalign[] = {
+    /* From ./macros/smartalign.mac */
+        /*    0 */ 195,'_','_','U','S','E','_','S','M','A','R','T','A','L','I','G','N','_','_',0,
+        /*   20 */ 212,'a','l','i','g','n','m','o','d','e',' ','1','-','2','.','n','o','l','i','s','t',0,
+        /*   42 */ 172,'%','1',',','n','o','p',0,
+        /*   50 */ 195,'_','_','A','L','I','G','N','_','J','M','P','_','T','H','R','E','S','H','O','L','D','_','_',' ','1','6',0,
+        /*   78 */ 195,'_','_','A','L','I','G','N','_','1','6','B','I','T','_','1','B','_','_',' ','0','x','9','0',0,
+        /*  103 */ 195,'_','_','A','L','I','G','N','_','1','6','B','I','T','_','G','R','O','U','P','_','_',' ','1',0,
+        /*  128 */ 195,'_','_','A','L','I','G','N','_','3','2','B','I','T','_','1','B','_','_',' ','0','x','9','0',0,
+        /*  153 */ 195,'_','_','A','L','I','G','N','_','3','2','B','I','T','_','G','R','O','U','P','_','_',' ','1',0,
+        /*  178 */ 195,'_','_','A','L','I','G','N','_','6','4','B','I','T','_','1','B','_','_',' ','0','x','9','0',0,
+        /*  203 */ 195,'_','_','A','L','I','G','N','_','6','4','B','I','T','_','G','R','O','U','P','_','_',' ','1',0,
+        /*  228 */ 140,'%','1',',','g','e','n','e','r','i','c',0,
+        /*  240 */ 195,'_','_','A','L','I','G','N','_','J','M','P','_','T','H','R','E','S','H','O','L','D','_','_',' ','8',0,
+        /*  267 */ 195,'_','_','A','L','I','G','N','_','1','6','B','I','T','_','1','B','_','_',' ','0','x','9','0',0,
+        /*  292 */ 195,'_','_','A','L','I','G','N','_','1','6','B','I','T','_','2','B','_','_',' ','0','x','8','9',',','0','x','f','6',0,
+        /*  322 */ 195,'_','_','A','L','I','G','N','_','1','6','B','I','T','_','3','B','_','_',' ','0','x','8','d',',','0','x','7','4',',','0','x','0','0',0,
+        /*  357 */ 195,'_','_','A','L','I','G','N','_','1','6','B','I','T','_','4','B','_','_',' ','0','x','8','d',',','0','x','b','4',',','0','x','0','0',',','0','x','0','0',0,
+        /*  397 */ 195,'_','_','A','L','I','G','N','_','1','6','B','I','T','_','5','B','_','_',' ','0','x','8','d',',','0','x','b','4',',','0','x','0','0',',','0','x','0','0',',','0','x','9','0',0,
+        /*  442 */ 195,'_','_','A','L','I','G','N','_','1','6','B','I','T','_','6','B','_','_',' ','0','x','8','d',',','0','x','b','4',',','0','x','0','0',',','0','x','0','0',',','0','x','8','9',',','0','x','f','f',0,
+        /*  492 */ 195,'_','_','A','L','I','G','N','_','1','6','B','I','T','_','7','B','_','_',' ','0','x','8','d',',','0','x','b','4',',','0','x','0','0',',','0','x','0','0',',','0','x','8','d',',','0','x','7','d',',','0','x','0','0',0,
+        /*  547 */ 195,'_','_','A','L','I','G','N','_','1','6','B','I','T','_','8','B','_','_',' ','0','x','8','d',',','0','x','b','4',',','0','x','0','0',',','0','x','0','0',',','0','x','8','d',',','0','x','b','d',',','0','x','0','0',',','0','x','0','0',0,
+        /*  607 */ 195,'_','_','A','L','I','G','N','_','1','6','B','I','T','_','G','R','O','U','P','_','_',' ','8',0,
+        /*  632 */ 195,'_','_','A','L','I','G','N','_','3','2','B','I','T','_','1','B','_','_',' ','0','x','9','0',0,
+        /*  657 */ 195,'_','_','A','L','I','G','N','_','3','2','B','I','T','_','2','B','_','_',' ','0','x','8','9',',','0','x','f','6',0,
+        /*  687 */ 195,'_','_','A','L','I','G','N','_','3','2','B','I','T','_','3','B','_','_',' ','0','x','8','d',',','0','x','7','6',',','0','x','0','0',0,
+        /*  722 */ 195,'_','_','A','L','I','G','N','_','3','2','B','I','T','_','4','B','_','_',' ','0','x','8','d',',','0','x','7','4',',','0','x','2','6',',','0','x','0','0',0,
+        /*  762 */ 195,'_','_','A','L','I','G','N','_','3','2','B','I','T','_','5','B','_','_',' ','0','x','9','0',',','0','x','8','d',',','0','x','7','4',',','0','x','2','6',',','0','x','0','0',0,
+        /*  807 */ 195,'_','_','A','L','I','G','N','_','3','2','B','I','T','_','6','B','_','_',' ','0','x','8','d',',','0','x','b','6',',','0','x','0','0',',','0','x','0','0',',','0','x','0','0',',','0','x','0','0',0,
+        /*  857 */ 195,'_','_','A','L','I','G','N','_','3','2','B','I','T','_','7','B','_','_',' ','0','x','8','d',',','0','x','b','4',',','0','x','2','6',',','0','x','0','0',',','0','x','0','0',',','0','x','0','0',',','0','x','0','0',0,
+        /*  912 */ 195,'_','_','A','L','I','G','N','_','3','2','B','I','T','_','G','R','O','U','P','_','_',' ','7',0,
+        /*  937 */ 195,'_','_','A','L','I','G','N','_','6','4','B','I','T','_','1','B','_','_',' ','0','x','9','0',0,
+        /*  962 */ 195,'_','_','A','L','I','G','N','_','6','4','B','I','T','_','2','B','_','_',' ','0','x','6','6',',','0','x','9','0',0,
+        /*  992 */ 195,'_','_','A','L','I','G','N','_','6','4','B','I','T','_','3','B','_','_',' ','0','x','6','6',',','0','x','6','6',',','0','x','9','0',0,
+        /* 1027 */ 195,'_','_','A','L','I','G','N','_','6','4','B','I','T','_','4','B','_','_',' ','0','x','6','6',',','0','x','6','6',',','0','x','6','6',',','0','x','9','0',0,
+        /* 1067 */ 195,'_','_','A','L','I','G','N','_','6','4','B','I','T','_','G','R','O','U','P','_','_',' ','4',0,
+        /* 1092 */ 140,'%','1',',','k','8',0,
+        /* 1099 */ 195,'_','_','A','L','I','G','N','_','J','M','P','_','T','H','R','E','S','H','O','L','D','_','_',' ','1','6',0,
+        /* 1127 */ 195,'_','_','A','L','I','G','N','_','1','6','B','I','T','_','1','B','_','_',' ','0','x','9','0',0,
+        /* 1152 */ 195,'_','_','A','L','I','G','N','_','1','6','B','I','T','_','2','B','_','_',' ','0','x','6','6',',','0','x','9','0',0,
+        /* 1182 */ 195,'_','_','A','L','I','G','N','_','1','6','B','I','T','_','3','B','_','_',' ','0','x','6','6',',','0','x','6','6',',','0','x','9','0',0,
+        /* 1217 */ 195,'_','_','A','L','I','G','N','_','1','6','B','I','T','_','4','B','_','_',' ','0','x','6','6',',','0','x','6','6',',','0','x','6','6',',','0','x','9','0',0,
+        /* 1257 */ 195,'_','_','A','L','I','G','N','_','1','6','B','I','T','_','G','R','O','U','P','_','_',' ','4',0,
+        /* 1282 */ 195,'_','_','A','L','I','G','N','_','3','2','B','I','T','_','1','B','_','_',' ','0','x','9','0',0,
+        /* 1307 */ 195,'_','_','A','L','I','G','N','_','3','2','B','I','T','_','2','B','_','_',' ','0','x','6','6',',','0','x','9','0',0,
+        /* 1337 */ 195,'_','_','A','L','I','G','N','_','3','2','B','I','T','_','3','B','_','_',' ','0','x','6','6',',','0','x','6','6',',','0','x','9','0',0,
+        /* 1372 */ 195,'_','_','A','L','I','G','N','_','3','2','B','I','T','_','4','B','_','_',' ','0','x','6','6',',','0','x','6','6',',','0','x','6','6',',','0','x','9','0',0,
+        /* 1412 */ 195,'_','_','A','L','I','G','N','_','3','2','B','I','T','_','G','R','O','U','P','_','_',' ','4',0,
+        /* 1437 */ 195,'_','_','A','L','I','G','N','_','6','4','B','I','T','_','1','B','_','_',' ','0','x','9','0',0,
+        /* 1462 */ 195,'_','_','A','L','I','G','N','_','6','4','B','I','T','_','2','B','_','_',' ','0','x','6','6',',','0','x','9','0',0,
+        /* 1492 */ 195,'_','_','A','L','I','G','N','_','6','4','B','I','T','_','3','B','_','_',' ','0','x','6','6',',','0','x','6','6',',','0','x','9','0',0,
+        /* 1527 */ 195,'_','_','A','L','I','G','N','_','6','4','B','I','T','_','4','B','_','_',' ','0','x','6','6',',','0','x','6','6',',','0','x','6','6',',','0','x','9','0',0,
+        /* 1567 */ 195,'_','_','A','L','I','G','N','_','6','4','B','I','T','_','G','R','O','U','P','_','_',' ','4',0,
+        /* 1592 */ 140,'%','1',',','k','7',0,
+        /* 1599 */ 195,'_','_','A','L','I','G','N','_','J','M','P','_','T','H','R','E','S','H','O','L','D','_','_',' ','1','6',0,
+        /* 1627 */ 195,'_','_','A','L','I','G','N','_','1','6','B','I','T','_','1','B','_','_',' ','0','x','9','0',0,
+        /* 1652 */ 195,'_','_','A','L','I','G','N','_','1','6','B','I','T','_','2','B','_','_',' ','0','x','6','6',',','0','x','9','0',0,
+        /* 1682 */ 195,'_','_','A','L','I','G','N','_','1','6','B','I','T','_','3','B','_','_',' ','0','x','6','6',',','0','x','6','6',',','0','x','9','0',0,
+        /* 1717 */ 195,'_','_','A','L','I','G','N','_','1','6','B','I','T','_','4','B','_','_',' ','0','x','6','6',',','0','x','6','6',',','0','x','6','6',',','0','x','9','0',0,
+        /* 1757 */ 195,'_','_','A','L','I','G','N','_','6','4','B','I','T','_','G','R','O','U','P','_','_',' ','4',0,
+        /* 1782 */ 195,'_','_','A','L','I','G','N','_','3','2','B','I','T','_','1','B','_','_',' ','0','x','9','0',0,
+        /* 1807 */ 195,'_','_','A','L','I','G','N','_','3','2','B','I','T','_','2','B','_','_',' ','0','x','8','b',',','0','x','c','0',0,
+        /* 1837 */ 195,'_','_','A','L','I','G','N','_','3','2','B','I','T','_','3','B','_','_',' ','0','x','8','d',',','0','x','0','4',',','0','x','2','0',0,
+        /* 1872 */ 195,'_','_','A','L','I','G','N','_','3','2','B','I','T','_','4','B','_','_',' ','0','x','8','d',',','0','x','4','4',',','0','x','2','0',',','0','x','0','0',0,
+        /* 1912 */ 195,'_','_','A','L','I','G','N','_','3','2','B','I','T','_','5','B','_','_',' ','0','x','8','d',',','0','x','4','4',',','0','x','2','0',',','0','x','0','0',',','0','x','9','0',0,
+        /* 1957 */ 195,'_','_','A','L','I','G','N','_','3','2','B','I','T','_','6','B','_','_',' ','0','x','8','d',',','0','x','8','0',',','0','x','0','0',',','0','x','0','0',',','0','x','0','0',',','0','x','0','0',0,
+        /* 2007 */ 195,'_','_','A','L','I','G','N','_','3','2','B','I','T','_','7','B','_','_',' ','0','x','8','d',',','0','x','0','4',',','0','x','0','5',',','0','x','0','0',',','0','x','0','0',',','0','x','0','0',',','0','x','0','0',0,
+        /* 2062 */ 195,'_','_','A','L','I','G','N','_','3','2','B','I','T','_','G','R','O','U','P','_','_',' ','7',0,
+        /* 2087 */ 195,'_','_','A','L','I','G','N','_','6','4','B','I','T','_','1','B','_','_',' ','0','x','9','0',0,
+        /* 2112 */ 195,'_','_','A','L','I','G','N','_','6','4','B','I','T','_','2','B','_','_',' ','0','x','6','6',',','0','x','9','0',0,
+        /* 2142 */ 195,'_','_','A','L','I','G','N','_','6','4','B','I','T','_','3','B','_','_',' ','0','x','6','6',',','0','x','6','6',',','0','x','9','0',0,
+        /* 2177 */ 195,'_','_','A','L','I','G','N','_','6','4','B','I','T','_','4','B','_','_',' ','0','x','6','6',',','0','x','6','6',',','0','x','6','6',',','0','x','9','0',0,
+        /* 2217 */ 195,'_','_','A','L','I','G','N','_','6','4','B','I','T','_','G','R','O','U','P','_','_',' ','4',0,
+        /* 2242 */ 140,'%','1',',','p','6',0,
+        /* 2249 */ 195,'_','_','A','L','I','G','N','_','J','M','P','_','T','H','R','E','S','H','O','L','D','_','_',' ','1','6',0,
+        /* 2277 */ 195,'_','_','A','L','I','G','N','_','1','6','B','I','T','_','1','B','_','_',' ','0','x','9','0',0,
+        /* 2302 */ 195,'_','_','A','L','I','G','N','_','1','6','B','I','T','_','2','B','_','_',' ','0','x','6','6',',','0','x','9','0',0,
+        /* 2332 */ 195,'_','_','A','L','I','G','N','_','1','6','B','I','T','_','3','B','_','_',' ','0','x','0','f',',','0','x','1','f',',','0','x','0','0',0,
+        /* 2367 */ 195,'_','_','A','L','I','G','N','_','1','6','B','I','T','_','4','B','_','_',' ','0','x','0','f',',','0','x','1','f',',','0','x','4','0',',','0','x','0','0',0,
+        /* 2407 */ 195,'_','_','A','L','I','G','N','_','1','6','B','I','T','_','G','R','O','U','P','_','_',' ','4',0,
+        /* 2432 */ 195,'_','_','A','L','I','G','N','_','3','2','B','I','T','_','1','B','_','_',' ','0','x','9','0',0,
+        /* 2457 */ 195,'_','_','A','L','I','G','N','_','3','2','B','I','T','_','2','B','_','_',' ','0','x','6','6',',','0','x','9','0',0,
+        /* 2487 */ 195,'_','_','A','L','I','G','N','_','3','2','B','I','T','_','3','B','_','_',' ','0','x','0','f',',','0','x','1','f',',','0','x','0','0',0,
+        /* 2522 */ 195,'_','_','A','L','I','G','N','_','3','2','B','I','T','_','4','B','_','_',' ','0','x','0','f',',','0','x','1','f',',','0','x','4','0',',','0','x','0','0',0,
+        /* 2562 */ 195,'_','_','A','L','I','G','N','_','3','2','B','I','T','_','5','B','_','_',' ','0','x','0','f',',','0','x','1','f',',','0','x','4','4',',','0','x','0','0',',','0','x','0','0',0,
+        /* 2607 */ 195,'_','_','A','L','I','G','N','_','3','2','B','I','T','_','6','B','_','_',' ','0','x','6','6',',','0','x','0','f',',','0','x','1','f',',','0','x','4','4',',','0','x','0','0',',','0','x','0','0',0,
+        /* 2657 */ 195,'_','_','A','L','I','G','N','_','3','2','B','I','T','_','7','B','_','_',' ','0','x','0','f',',','0','x','1','f',',','0','x','8','0',',','0','x','0','0',',','0','x','0','0',',','0','x','0','0',',','0','x','0','0',0,
+        /* 2712 */ 195,'_','_','A','L','I','G','N','_','3','2','B','I','T','_','8','B','_','_',' ','0','x','0','f',',','0','x','1','f',',','0','x','8','4',',','0','x','0','0',',','0','x','0','0',',','0','x','0','0',',','0','x','0','0',',','0','x','0','0',0,
+        /* 2772 */ 195,'_','_','A','L','I','G','N','_','3','2','B','I','T','_','G','R','O','U','P','_','_',' ','8',0,
+        /* 2797 */ 195,'_','_','A','L','I','G','N','_','6','4','B','I','T','_','1','B','_','_',' ','0','x','9','0',0,
+        /* 2822 */ 195,'_','_','A','L','I','G','N','_','6','4','B','I','T','_','2','B','_','_',' ','0','x','6','6',',','0','x','9','0',0,
+        /* 2852 */ 195,'_','_','A','L','I','G','N','_','6','4','B','I','T','_','3','B','_','_',' ','0','x','0','f',',','0','x','1','f',',','0','x','0','0',0,
+        /* 2887 */ 195,'_','_','A','L','I','G','N','_','6','4','B','I','T','_','4','B','_','_',' ','0','x','0','f',',','0','x','1','f',',','0','x','4','0',',','0','x','0','0',0,
+        /* 2927 */ 195,'_','_','A','L','I','G','N','_','6','4','B','I','T','_','5','B','_','_',' ','0','x','0','f',',','0','x','1','f',',','0','x','4','4',',','0','x','0','0',',','0','x','0','0',0,
+        /* 2972 */ 195,'_','_','A','L','I','G','N','_','6','4','B','I','T','_','6','B','_','_',' ','0','x','6','6',',','0','x','0','f',',','0','x','1','f',',','0','x','4','4',',','0','x','0','0',',','0','x','0','0',0,
+        /* 3022 */ 195,'_','_','A','L','I','G','N','_','6','4','B','I','T','_','7','B','_','_',' ','0','x','0','f',',','0','x','1','f',',','0','x','8','0',',','0','x','0','0',',','0','x','0','0',',','0','x','0','0',',','0','x','0','0',0,
+        /* 3077 */ 195,'_','_','A','L','I','G','N','_','6','4','B','I','T','_','8','B','_','_',' ','0','x','0','f',',','0','x','1','f',',','0','x','8','4',',','0','x','0','0',',','0','x','0','0',',','0','x','0','0',',','0','x','0','0',',','0','x','0','0',0,
+        /* 3137 */ 195,'_','_','A','L','I','G','N','_','6','4','B','I','T','_','G','R','O','U','P','_','_',' ','8',0,
+        /* 3162 */ 199,0,
+        /* 3164 */ 204,'u','n','k','n','o','w','n',' ','a','l','i','g','n','m','e','n','t',' ','m','o','d','e',':',' ','%','1',0,
+        /* 3192 */ 200,0,
+        /* 3194 */ 167,'%','2',0,
+        /* 3198 */ 235,'_','_','A','L','I','G','N','_','J','M','P','_','T','H','R','E','S','H','O','L','D','_','_',' ','%','2',0,
+        /* 3226 */ 200,0,
+        /* 3228 */ 235,'_','_','A','L','I','G','N','M','O','D','E','_','_',' ','%','1',',','_','_','A','L','I','G','N','_','J','M','P','_','T','H','R','E','S','H','O','L','D','_','_',0,
+        /* 3270 */ 202,0,
+        /* 3272 */ 231,'a','l','i','g','n',' ','1','-','2','+','.','n','o','l','i','s','t',0,
+        /* 3291 */ 212,'a','l','i','g','n',' ','1','-','2','+','.','n','o','l','i','s','t',0,
+        /* 3310 */ 167,'%','2',0,
+        /* 3314 */ 't','i','m','e','s',' ','(','(','(','%','1',')',' ','-',' ','(','(','$','-','$','$',')',' ','%',' ','(','%','1',')',')',')',' ','%',' ','(','%','1',')',')',' ','%','2',0,
+        /* 3357 */ 199,0,
+        /* 3359 */ 221,0,
+        /* 3361 */ 193,'%','$','p','a','d',' ','(','(','(','%','1',')',' ','-',' ','(','(','$','-','$','$',')',' ','%',' ','(','%','1',')',')',')',' ','%',' ','(','%','1',')',')',0,
+        /* 3402 */ 160,'%','$','p','a','d',' ','>',' ','_','_','A','L','I','G','N','_','J','M','P','_','T','H','R','E','S','H','O','L','D','_','_',0,
+        /* 3435 */ 'j','m','p',' ','%','$','e','n','d',0,
+        /* 3445 */ 't','i','m','e','s',' ','(','(','(','%','1',')',' ','-',' ','(','(','$','-','$','$',')',' ','%',' ','(','%','1',')',')',')',' ','%',' ','(','%','1',')',')',' ','n','o','p',0,
+        /* 3489 */ '%','$','e','n','d',':',0,
+        /* 3496 */ 199,0,
+        /* 3498 */ 't','i','m','e','s',' ','(','%','$','p','a','d',' ','/',' ','_','_','A','L','I','G','N','_','%','[','_','_','B','I','T','S','_','_',']','B','I','T','_','G','R','O','U','P','_','_',')',' ',  9,'d','b',' ','_','_','A','L','I','G','N','_','%','[','_','_','B','I','T','S','_','_',']','B','I','T','_','%','[','_','_','A','L','I','G','N','_','%','[','_','_','B','I','T','S','_','_',']','B','I','T','_','G','R','O','U','P','_','_',']','B','_','_',0,
+        /* 3609 */ 193,'%','$','p','a','d',' ','%','$','p','a','d',' ','%',' ','_','_','A','L','I','G','N','_','%','[','_','_','B','I','T','S','_','_',']','B','I','T','_','G','R','O','U','P','_','_',0,
+        /* 3655 */ 160,'%','$','p','a','d',' ','>',' ','0',0,
+        /* 3666 */ 'd','b',' ','_','_','A','L','I','G','N','_','%','[','_','_','B','I','T','S','_','_',']','B','I','T','_','%','[','%','$','p','a','d',']','B','_','_',0,
+        /* 3704 */ 200,0,
+        /* 3706 */ 200,0,
+        /* 3708 */ 220,0,
+        /* 3710 */ 200,0,
+        /* 3712 */ 202,0,
+        /* 3714 */ 'a','l','i','g','n','m','o','d','e',' ','g','e','n','e','r','i','c',0,
+        /* 3732 */ 0
+};
+#endif
+
+#if defined(OF_AOUT) || defined(OF_AOUTB)
+const unsigned char aout_stdmac[] = {
+    /* From ./output/outaout.mac */
+        /*    0 */ 195,'_','_','S','E','C','T','_','_',' ','[','s','e','c','t','i','o','n',' ','.','t','e','x','t',']',0,
+        /*   26 */ 218,'_','_','N','A','S','M','_','C','D','e','c','l','_','_',' ','1',0,
+        /*   44 */ 202,0,
+        /*   46 */ 0
+};
+#endif
+
+#if defined(OF_AS86)
+const unsigned char as86_stdmac[] = {
+    /* From ./output/outas86.mac */
+        /*    0 */ 195,'_','_','S','E','C','T','_','_',' ','[','s','e','c','t','i','o','n',' ','.','t','e','x','t',']',0,
+        /*   26 */ 218,'_','_','N','A','S','M','_','C','D','e','c','l','_','_',' ','1',0,
+        /*   44 */ 202,0,
+        /*   46 */ 0
+};
+#endif
+
+#if defined(OF_BIN)
+const unsigned char bin_stdmac[] = {
+    /* From ./output/outbin.mac */
+        /*    0 */ 195,'_','_','S','E','C','T','_','_',' ','[','s','e','c','t','i','o','n',' ','.','t','e','x','t',']',0,
+        /*   26 */ 212,'o','r','g',' ','1','+','.','n','o','l','i','s','t',0,
+        /*   41 */ '[','o','r','g',' ','%','1',']',0,
+        /*   50 */ 202,0,
+        /*   52 */ 218,'_','_','N','A','S','M','_','C','D','e','c','l','_','_',' ','1',0,
+        /*   70 */ 202,0,
+        /*   72 */ 0
+};
+#endif
+
+#if defined(OF_COFF) || defined(OF_WIN32) || defined(OF_WIN64)
+const unsigned char coff_stdmac[] = {
+    /* From ./output/outcoff.mac */
+        /*    0 */ 195,'_','_','S','E','C','T','_','_',' ','[','s','e','c','t','i','o','n',' ','.','t','e','x','t',']',0,
+        /*   26 */ 218,'_','_','N','A','S','M','_','C','D','e','c','l','_','_',' ','1',0,
+        /*   44 */ 202,0,
+        /*   46 */ 212,'e','x','p','o','r','t',' ','1','+','.','n','o','l','i','s','t',0,
+        /*   64 */ '[','e','x','p','o','r','t',' ','%','1',']',0,
+        /*   76 */ 202,0,
+        /*   78 */ 212,'s','a','f','e','s','e','h',' ','1','.','n','o','l','i','s','t',0,
+        /*   96 */ '[','s','a','f','e','s','e','h',' ','%','1',']',0,
+        /*  109 */ 202,0,
+        /*  111 */ 0
+};
+#endif
+
+#if defined(OF_ELF) || defined(OF_ELF32) || defined(OF_ELF64)
+const unsigned char elf_stdmac[] = {
+    /* From ./output/outelf.mac */
+        /*    0 */ 195,'_','_','S','E','C','T','_','_',' ','[','s','e','c','t','i','o','n',' ','.','t','e','x','t',']',0,
+        /*   26 */ 218,'_','_','N','A','S','M','_','C','D','e','c','l','_','_',' ','1',0,
+        /*   44 */ 195,'$','_','%','1',' ','$','%','1',0,
+        /*   54 */ 202,0,
+        /*   56 */ 218,'o','s','a','b','i',' ','1','+','.','n','o','l','i','s','t',0,
+        /*   73 */ '[','o','s','a','b','i',' ','%','1',']',0,
+        /*   84 */ 202,0,
+        /*   86 */ 0
+};
+#endif
+
+#if defined(OF_MACHO) || defined(OF_MACHO32) || defined(OF_MACHO64)
+const unsigned char macho_stdmac[] = {
+    /* From ./output/outmacho.mac */
+        /*    0 */ 195,'_','_','S','E','C','T','_','_',' ','[','s','e','c','t','i','o','n',' ','.','t','e','x','t',']',0,
+        /*   26 */ 218,'_','_','N','A','S','M','_','C','D','e','c','l','_','_',' ','1',0,
+        /*   44 */ 202,0,
+        /*   46 */ 0
+};
+#endif
+
+#if defined(OF_OBJ)
+const unsigned char obj_stdmac[] = {
+    /* From ./output/outobj.mac */
+        /*    0 */ 195,'_','_','S','E','C','T','_','_',' ','[','s','e','c','t','i','o','n',' ','.','t','e','x','t',']',0,
+        /*   26 */ 212,'g','r','o','u','p',' ','1','+','.','n','o','l','i','s','t',0,
+        /*   43 */ '[','g','r','o','u','p',' ','%','1',']',0,
+        /*   54 */ 202,0,
+        /*   56 */ 212,'u','p','p','e','r','c','a','s','e',' ','0','+','.','n','o','l','i','s','t',0,
+        /*   77 */ '[','u','p','p','e','r','c','a','s','e',' ','%','1',']',0,
+        /*   92 */ 202,0,
+        /*   94 */ 212,'e','x','p','o','r','t',' ','1','+','.','n','o','l','i','s','t',0,
+        /*  112 */ '[','e','x','p','o','r','t',' ','%','1',']',0,
+        /*  124 */ 202,0,
+        /*  126 */ 212,'i','m','p','o','r','t',' ','1','+','.','n','o','l','i','s','t',0,
+        /*  144 */ '[','i','m','p','o','r','t',' ','%','1',']',0,
+        /*  156 */ 202,0,
+        /*  158 */ 218,'_','_','N','A','S','M','_','C','D','e','c','l','_','_',' ','1',0,
+        /*  176 */ 202,0,
+        /*  178 */ 0
+};
+#endif
+
+#if defined(OF_RDF)
+const unsigned char rdf_stdmac[] = {
+    /* From ./output/outrdf.mac */
+        /*    0 */ 195,'_','_','S','E','C','T','_','_',' ','[','s','e','c','t','i','o','n',' ','.','t','e','x','t',']',0,
+        /*   26 */ 212,'l','i','b','r','a','r','y',' ','1','+','.','n','o','l','i','s','t',0,
+        /*   45 */ '[','l','i','b','r','a','r','y',' ','%','1',']',0,
+        /*   58 */ 202,0,
+        /*   60 */ 218,'_','_','N','A','S','M','_','C','D','e','c','l','_','_',' ','1',0,
+        /*   78 */ 202,0,
+        /*   80 */ 0
+};
+#endif
+
+#if defined(OF_RDF2)
+const unsigned char rdf2_stdmac[] = {
+    /* From ./output/outrdf2.mac */
+        /*    0 */ 195,'_','_','S','E','C','T','_','_',' ','[','s','e','c','t','i','o','n',' ','.','t','e','x','t',']',0,
+        /*   26 */ 212,'l','i','b','r','a','r','y',' ','1','+','.','n','o','l','i','s','t',0,
+        /*   45 */ '[','l','i','b','r','a','r','y',' ','%','1',']',0,
+        /*   58 */ 202,0,
+        /*   60 */ 212,'m','o','d','u','l','e',' ','1','+','.','n','o','l','i','s','t',0,
+        /*   78 */ '[','m','o','d','u','l','e',' ','%','1',']',0,
+        /*   90 */ 202,0,
+        /*   92 */ 218,'_','_','N','A','S','M','_','C','D','e','c','l','_','_',' ','1',0,
+        /*  110 */ 202,0,
+        /*  112 */ 0
+};
+#endif
+
+const unsigned char * const nasm_stdmac_after_tasm = &nasm_stdmac[37];
+
+const unsigned char *nasm_stdmac_find_package(const char *package)
+{
+    static const struct {
+         const char *package;
+         const unsigned char *macros;
+    } packages[2] = {
+        { "altreg", nasm_stdmac_altreg },
+        { "smartalign", nasm_stdmac_smartalign },
+    };
+#define UNUSED 16383
+    static const int16_t hash1[2] = {
+        0,
+        -1,
+    };
+    static const int16_t hash2[2] = {
+        1,
+        UNUSED,
+    };
+    uint32_t k1, k2;
+    uint64_t crc;
+    uint16_t ix;
+
+    crc = crc64i(UINT64_C(0x076259c3e291c26c), package);
+    k1 = (uint32_t)crc;
+    k2 = (uint32_t)(crc >> 32);
+
+    ix = hash1[k1 & 0x1] + hash2[k2 & 0x1];
+    if (ix >= 2)
+        return NULL;
+
+    if (nasm_stricmp(packages[ix].package, package))
+        return NULL;
+
+    return packages[ix].macros;
+}
diff --git a/macros.pl b/macros.pl
new file mode 100755 (executable)
index 0000000..911da8d
--- /dev/null
+++ b/macros.pl
@@ -0,0 +1,239 @@
+#!/usr/bin/perl
+## --------------------------------------------------------------------------
+##   
+##   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.
+##
+## --------------------------------------------------------------------------
+
+#
+# macros.pl   produce macros.c from standard.mac
+#
+
+require 'phash.ph';
+require 'pptok.ph';
+
+use bytes;
+
+my $fname;
+my $line = 0;
+my $index      = 0;
+my $tasm_count = 0;
+
+#
+# Print out a string as a character array
+#
+sub charcify(@) {
+    my $l = '';
+    my $c, $o;
+    foreach $o (unpack("C*", join('',@_))) {
+       $c = pack("C", $o);
+       if ($o < 32 || $o > 126 || $c eq '"' || $c eq "\\") {
+           $l .= sprintf("%3d,", $o);
+       } else {
+           $l .= "\'".$c."\',";
+       }
+    }
+    return $l;
+}
+
+#
+# Generate macros.c
+#
+open(OUT,"> macros.c\0") or die "unable to open macros.c\n";
+
+print OUT "/*\n";
+print OUT " * Do not edit - this file auto-generated by macros.pl from:\n";
+print OUT " *   ", join("\n *   ", @ARGV), "\n";
+print OUT " */\n";
+print OUT "\n";
+print OUT "#include \"tables.h\"\n";
+print OUT "#include \"nasmlib.h\"\n";
+print OUT "#include \"hashtbl.h\"\n";
+print OUT "#include \"output/outform.h\"\n";
+print OUT "\n";
+print OUT "#if 1\n";
+print OUT "const unsigned char nasm_stdmac[] = {";
+
+my $npkg = 0;
+my @pkg_list   = ();
+my %pkg_number = ();
+my $pkg;
+my @out_list   = ();
+my $outfmt;
+my $lastname;
+my $z;
+
+foreach $fname ( @ARGV ) {
+    open(INPUT,"< $fname\0") or die "$0: $fname: $!\n";
+    while (<INPUT>) {
+       $line++;
+       chomp;
+       while (/^(.*)\\$/) {
+           $_ = $1;
+           $_ .= <INPUT>;
+           chomp;
+           $line++;
+       }
+       if (m/^\s*\*END\*TASM\*MACROS\*\s*$/) {
+           $tasm_count = $index;
+           print OUT "    /* End of TASM macros */\n";
+       } elsif (m/^OUT:\s*(.*\S)\s*$/) {
+           undef $pkg;
+           my @out_alias = split(/\s+/, $1);
+           printf OUT "        /* %4d */ 0\n", $index++;
+           print OUT "};\n#endif\n";
+           $index = 0;
+           print OUT "\n";
+           my $pfx = '#if';
+           foreach my $al (@out_alias) {
+               print OUT $pfx, " defined(OF_\U${al}\E)";
+               $pfx = ' ||';
+           }
+           printf OUT "\nconst unsigned char %s_stdmac[] = {\n", $out_alias[0];
+           print  OUT "    /* From $fname */\n";
+           $lastname = $fname;
+           push(@out_list, $out_alias[0]);
+           $out_index{$out_alias[0]} = $index;
+       } elsif (m/^USE:\s*(\S+)\s*$/) {
+           $pkg = $1;
+           if (defined($pkg_number{$pkg})) {
+               die "$0: $fname: duplicate package: $pkg\n";
+           }
+           printf OUT "        /* %4d */ 0\n", $index++;
+           print OUT "};\n#endif\n";
+           $index = 0;
+           print OUT "\n#if 1\n";
+           printf OUT "static const unsigned char nasm_stdmac_%s[] = {\n", $pkg;
+           print  OUT "    /* From $fname */\n";
+           $lastname = $fname;
+           push(@pkg_list, $pkg);
+           $pkg_number{$pkg} = $npkg++;
+           $z = pack("C", $pptok_hash{'%define'}+128)."__USE_\U$pkg\E__";
+           printf OUT "        /* %4d */ %s0,\n", $index, charcify($z);
+           $index += length($z)+1;
+       } elsif (m/^\s*((\s*([^\"\';\s]+|\"[^\"]*\"|\'[^\']*\'))*)\s*(;.*)?$/) {
+           my $s1, $s2, $pd, $ws;
+           $s1 = $1;
+           $s2 = '';
+           while ($s1 =~ /(\%[a-zA-Z_][a-zA-Z0-9_]*)((\s+)(.*)|)$/) {
+               $s2 .= "$'";
+               $pd = $1;
+               $ws = $3;
+               $s1 = $4;
+               if (defined($pptok_hash{$pd}) &&
+                   $pptok_hash{$pd} <= 127) {
+                   $s2 .= pack("C", $pptok_hash{$pd}+128);
+               } else {
+                   $s2 .= $pd.$ws;
+               }
+           }
+           $s2 .= $s1;
+           if (length($s2) > 0) {
+               if ($lastname ne $fname) {
+                   print OUT "\n    /* From $fname */\n";
+                   $lastname = $fname;
+               }       
+               printf OUT "        /* %4d */ %s0,\n",
+                   $index, charcify($s2);
+               $index += length($s2)+1;
+           }
+       } else {
+           die "$fname:$line:  error unterminated quote";
+       }
+    }
+    close(INPUT);
+}
+printf OUT "        /* %4d */ 0\n};\n#endif\n\n", $index++;
+print OUT "const unsigned char * const nasm_stdmac_after_tasm = ",
+    "&nasm_stdmac[$tasm_count];\n\n";
+
+my @hashinfo = gen_perfect_hash(\%pkg_number);
+if (!@hashinfo) {
+    die "$0: no hash found\n";
+}
+# Paranoia...
+verify_hash_table(\%pkg_number, \@hashinfo);
+my ($n, $sv, $g) = @hashinfo;
+die if ($n & ($n-1));
+
+print OUT "const unsigned char *nasm_stdmac_find_package(const char *package)\n";
+print OUT "{\n";
+print OUT "    static const struct {\n";
+print OUT "         const char *package;\n";
+print OUT "         const unsigned char *macros;\n";
+print OUT "    } packages[$npkg] = {\n";
+foreach $pkg (@pkg_list) {
+    printf OUT "        { \"%s\", nasm_stdmac_%s },\n",
+       $pkg, $pkg;
+}
+print OUT "    };\n";
+
+# Put a large value in unused slots.  This makes it extremely unlikely
+# that any combination that involves unused slot will pass the range test.
+# This speeds up rejection of unrecognized tokens, i.e. identifiers.
+print OUT "#define UNUSED 16383\n";
+
+print OUT "    static const int16_t hash1[$n] = {\n";
+for ($i = 0; $i < $n; $i++) {
+    my $h = ${$g}[$i*2+0];
+    print OUT "        ", defined($h) ? $h : 'UNUSED', ",\n";
+}
+print OUT "    };\n";
+
+print OUT "    static const int16_t hash2[$n] = {\n";
+for ($i = 0; $i < $n; $i++) {
+    my $h = ${$g}[$i*2+1];
+    print OUT "        ", defined($h) ? $h : 'UNUSED', ",\n";
+}
+print OUT "    };\n";
+
+print OUT  "    uint32_t k1, k2;\n";
+print OUT  "    uint64_t crc;\n";
+# For correct overflow behavior, "ix" should be unsigned of the same
+# width as the hash arrays.
+print OUT  "    uint16_t ix;\n";
+print OUT  "\n";
+
+printf OUT "    crc = crc64i(UINT64_C(0x%08x%08x), package);\n",
+    $$sv[0], $$sv[1];
+print  OUT "    k1 = (uint32_t)crc;\n";
+print  OUT "    k2 = (uint32_t)(crc >> 32);\n";
+print  OUT "\n";
+printf OUT "    ix = hash1[k1 & 0x%x] + hash2[k2 & 0x%x];\n", $n-1, $n-1;
+printf OUT "    if (ix >= %d)\n", scalar(@pkg_list);
+print OUT  "        return NULL;\n";
+print OUT  "\n";
+print OUT  "    if (nasm_stricmp(packages[ix].package, package))\n";
+print OUT  "        return NULL;\n";
+print OUT  "\n";
+print OUT  "    return packages[ix].macros;\n";
+print OUT  "}\n";
+
+close(OUT);
diff --git a/macros/altreg.mac b/macros/altreg.mac
new file mode 100644 (file)
index 0000000..16134cd
--- /dev/null
@@ -0,0 +1,107 @@
+;; --------------------------------------------------------------------------
+;;   
+;;   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.
+;;
+;; --------------------------------------------------------------------------
+
+;;
+;; altreg.mac
+;;
+;; Alternate register names for 64-bit mode
+;;
+
+USE: altreg
+
+;;
+;; Intel documents R8L-R15L instead of R8B-R15B
+;; (Warning: this may confuse people with an AT&T-style assembly
+;; background, where "r8l" means R8D, etc.)
+;;
+%idefine r8l  r8b
+%idefine r9l  r9b
+%idefine r10l r10b
+%idefine r11l r11b
+%idefine r12l r12b
+%idefine r13l r13b
+%idefine r14l r14b
+%idefine r15l r15b
+
+;;
+;; Numeric register names for the lower 8 registers
+;;
+%idefine r0  rax
+%idefine r1  rcx
+%idefine r2  rdx
+%idefine r3  rbx
+%idefine r4  rsp
+%idefine r5  rbp
+%idefine r6  rsi
+%idefine r7  rdi
+
+%idefine r0d eax
+%idefine r1d ecx
+%idefine r2d edx
+%idefine r3d ebx
+%idefine r4d esp
+%idefine r5d ebp
+%idefine r6d esi
+%idefine r7d edi
+
+%idefine r0w ax
+%idefine r1w cx
+%idefine r2w dx
+%idefine r3w bx
+%idefine r4w sp
+%idefine r5w bp
+%idefine r6w si
+%idefine r7w di
+
+%idefine r0b al
+%idefine r1b cl
+%idefine r2b dl
+%idefine r3b bl
+%idefine r4b spl
+%idefine r5b bpl
+%idefine r6b sil
+%idefine r7b dil
+
+%idefine r0l al
+%idefine r1l cl
+%idefine r2l dl
+%idefine r3l bl
+%idefine r4l spl
+%idefine r5l bpl
+%idefine r6l sil
+%idefine r7l dil
+
+%idefine r0h ah
+%idefine r1h ch
+%idefine r2h dh
+%idefine r3h bh
diff --git a/macros/smartalign.mac b/macros/smartalign.mac
new file mode 100644 (file)
index 0000000..51779c6
--- /dev/null
@@ -0,0 +1,182 @@
+;; --------------------------------------------------------------------------
+;;   
+;;   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.
+;;
+;; --------------------------------------------------------------------------
+
+;
+; Smart alignment macros
+;
+USE: smartalign
+
+%imacro alignmode 1-2.nolist
+  %ifidni %1,nop
+    %define __ALIGN_JMP_THRESHOLD__ 16
+
+    %define __ALIGN_16BIT_1B__ 0x90
+    %define __ALIGN_16BIT_GROUP__ 1
+
+    %define __ALIGN_32BIT_1B__ 0x90
+    %define __ALIGN_32BIT_GROUP__ 1
+
+    %define __ALIGN_64BIT_1B__ 0x90
+    %define __ALIGN_64BIT_GROUP__ 1
+  %elifidni %1,generic
+    %define __ALIGN_JMP_THRESHOLD__ 8
+
+    %define __ALIGN_16BIT_1B__ 0x90
+    %define __ALIGN_16BIT_2B__ 0x89,0xf6
+    %define __ALIGN_16BIT_3B__ 0x8d,0x74,0x00
+    %define __ALIGN_16BIT_4B__ 0x8d,0xb4,0x00,0x00
+    %define __ALIGN_16BIT_5B__ 0x8d,0xb4,0x00,0x00,0x90
+    %define __ALIGN_16BIT_6B__ 0x8d,0xb4,0x00,0x00,0x89,0xff
+    %define __ALIGN_16BIT_7B__ 0x8d,0xb4,0x00,0x00,0x8d,0x7d,0x00
+    %define __ALIGN_16BIT_8B__ 0x8d,0xb4,0x00,0x00,0x8d,0xbd,0x00,0x00
+    %define __ALIGN_16BIT_GROUP__ 8
+
+    %define __ALIGN_32BIT_1B__ 0x90
+    %define __ALIGN_32BIT_2B__ 0x89,0xf6
+    %define __ALIGN_32BIT_3B__ 0x8d,0x76,0x00
+    %define __ALIGN_32BIT_4B__ 0x8d,0x74,0x26,0x00
+    %define __ALIGN_32BIT_5B__ 0x90,0x8d,0x74,0x26,0x00
+    %define __ALIGN_32BIT_6B__ 0x8d,0xb6,0x00,0x00,0x00,0x00
+    %define __ALIGN_32BIT_7B__ 0x8d,0xb4,0x26,0x00,0x00,0x00,0x00
+    %define __ALIGN_32BIT_GROUP__ 7
+
+    %define __ALIGN_64BIT_1B__ 0x90
+    %define __ALIGN_64BIT_2B__ 0x66,0x90
+    %define __ALIGN_64BIT_3B__ 0x66,0x66,0x90
+    %define __ALIGN_64BIT_4B__ 0x66,0x66,0x66,0x90
+    %define __ALIGN_64BIT_GROUP__ 4
+  %elifidni %1,k8
+    %define __ALIGN_JMP_THRESHOLD__ 16
+
+    %define __ALIGN_16BIT_1B__ 0x90
+    %define __ALIGN_16BIT_2B__ 0x66,0x90
+    %define __ALIGN_16BIT_3B__ 0x66,0x66,0x90
+    %define __ALIGN_16BIT_4B__ 0x66,0x66,0x66,0x90
+    %define __ALIGN_16BIT_GROUP__ 4
+
+    %define __ALIGN_32BIT_1B__ 0x90
+    %define __ALIGN_32BIT_2B__ 0x66,0x90
+    %define __ALIGN_32BIT_3B__ 0x66,0x66,0x90
+    %define __ALIGN_32BIT_4B__ 0x66,0x66,0x66,0x90
+    %define __ALIGN_32BIT_GROUP__ 4
+
+    %define __ALIGN_64BIT_1B__ 0x90
+    %define __ALIGN_64BIT_2B__ 0x66,0x90
+    %define __ALIGN_64BIT_3B__ 0x66,0x66,0x90
+    %define __ALIGN_64BIT_4B__ 0x66,0x66,0x66,0x90
+    %define __ALIGN_64BIT_GROUP__ 4
+  %elifidni %1,k7
+    %define __ALIGN_JMP_THRESHOLD__ 16
+
+    %define __ALIGN_16BIT_1B__ 0x90
+    %define __ALIGN_16BIT_2B__ 0x66,0x90
+    %define __ALIGN_16BIT_3B__ 0x66,0x66,0x90
+    %define __ALIGN_16BIT_4B__ 0x66,0x66,0x66,0x90
+    %define __ALIGN_64BIT_GROUP__ 4
+
+    %define __ALIGN_32BIT_1B__ 0x90
+    %define __ALIGN_32BIT_2B__ 0x8b,0xc0
+    %define __ALIGN_32BIT_3B__ 0x8d,0x04,0x20
+    %define __ALIGN_32BIT_4B__ 0x8d,0x44,0x20,0x00
+    %define __ALIGN_32BIT_5B__ 0x8d,0x44,0x20,0x00,0x90
+    %define __ALIGN_32BIT_6B__ 0x8d,0x80,0x00,0x00,0x00,0x00
+    %define __ALIGN_32BIT_7B__ 0x8d,0x04,0x05,0x00,0x00,0x00,0x00
+    %define __ALIGN_32BIT_GROUP__ 7
+
+    %define __ALIGN_64BIT_1B__ 0x90
+    %define __ALIGN_64BIT_2B__ 0x66,0x90
+    %define __ALIGN_64BIT_3B__ 0x66,0x66,0x90
+    %define __ALIGN_64BIT_4B__ 0x66,0x66,0x66,0x90
+    %define __ALIGN_64BIT_GROUP__ 4
+  %elifidni %1,p6
+    %define __ALIGN_JMP_THRESHOLD__ 16
+
+    %define __ALIGN_16BIT_1B__ 0x90
+    %define __ALIGN_16BIT_2B__ 0x66,0x90
+    %define __ALIGN_16BIT_3B__ 0x0f,0x1f,0x00
+    %define __ALIGN_16BIT_4B__ 0x0f,0x1f,0x40,0x00
+    %define __ALIGN_16BIT_GROUP__ 4
+
+    %define __ALIGN_32BIT_1B__ 0x90
+    %define __ALIGN_32BIT_2B__ 0x66,0x90
+    %define __ALIGN_32BIT_3B__ 0x0f,0x1f,0x00
+    %define __ALIGN_32BIT_4B__ 0x0f,0x1f,0x40,0x00
+    %define __ALIGN_32BIT_5B__ 0x0f,0x1f,0x44,0x00,0x00
+    %define __ALIGN_32BIT_6B__ 0x66,0x0f,0x1f,0x44,0x00,0x00
+    %define __ALIGN_32BIT_7B__ 0x0f,0x1f,0x80,0x00,0x00,0x00,0x00
+    %define __ALIGN_32BIT_8B__ 0x0f,0x1f,0x84,0x00,0x00,0x00,0x00,0x00
+    %define __ALIGN_32BIT_GROUP__ 8
+
+    %define __ALIGN_64BIT_1B__ 0x90
+    %define __ALIGN_64BIT_2B__ 0x66,0x90
+    %define __ALIGN_64BIT_3B__ 0x0f,0x1f,0x00
+    %define __ALIGN_64BIT_4B__ 0x0f,0x1f,0x40,0x00
+    %define __ALIGN_64BIT_5B__ 0x0f,0x1f,0x44,0x00,0x00
+    %define __ALIGN_64BIT_6B__ 0x66,0x0f,0x1f,0x44,0x00,0x00
+    %define __ALIGN_64BIT_7B__ 0x0f,0x1f,0x80,0x00,0x00,0x00,0x00
+    %define __ALIGN_64BIT_8B__ 0x0f,0x1f,0x84,0x00,0x00,0x00,0x00,0x00
+    %define __ALIGN_64BIT_GROUP__ 8
+  %else
+    %error unknown alignment mode: %1
+  %endif
+  %ifnempty %2
+    %xdefine __ALIGN_JMP_THRESHOLD__ %2
+  %endif
+  %xdefine __ALIGNMODE__ %1,__ALIGN_JMP_THRESHOLD__
+%endmacro
+
+%unimacro align 1-2+.nolist
+%imacro align 1-2+.nolist
+  %ifnempty %2
+    times (((%1) - (($-$$) % (%1))) % (%1)) %2
+  %else
+    %push
+    %assign %$pad (((%1) - (($-$$) % (%1))) % (%1))
+    %if %$pad > __ALIGN_JMP_THRESHOLD__
+      jmp %$end
+      ; We can't re-use %$pad here as $ will have changed!
+      times (((%1) - (($-$$) % (%1))) % (%1)) nop
+%$end:
+    %else
+      times (%$pad / __ALIGN_%[__BITS__]BIT_GROUP__) \
+       db __ALIGN_%[__BITS__]BIT_%[__ALIGN_%[__BITS__]BIT_GROUP__]B__
+      %assign %$pad %$pad % __ALIGN_%[__BITS__]BIT_GROUP__
+      %if %$pad > 0
+        db __ALIGN_%[__BITS__]BIT_%[%$pad]B__
+      %endif
+    %endif
+    %pop
+  %endif
+%endmacro
+
+       alignmode generic
diff --git a/misc/Doxyfile b/misc/Doxyfile
new file mode 100644 (file)
index 0000000..1bb1cc3
--- /dev/null
@@ -0,0 +1,752 @@
+# Doxyfile 1.2.5
+
+# This file describes the settings to be used by doxygen for a project
+#
+# All text after a hash (#) is considered a comment and will be ignored
+# The format is:
+#       TAG = value [value, ...]
+# For lists items can also be appended using:
+#       TAG += value [value, ...]
+# Values that contain spaces should be placed between quotes (" ")
+
+#---------------------------------------------------------------------------
+# General configuration options
+#---------------------------------------------------------------------------
+
+# The PROJECT_NAME tag is a single word (or a sequence of words surrounded 
+# by quotes) that should identify the project. 
+
+PROJECT_NAME           = "NASM - the Netwide Assembler"
+
+# The PROJECT_NUMBER tag can be used to enter a project or revision number. 
+# This could be handy for archiving the generated documentation or 
+# if some version control system is used.
+
+PROJECT_NUMBER         = 0.98
+
+# The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute) 
+# base path where the generated documentation will be put. 
+# If a relative path is entered, it will be relative to the location 
+# where doxygen was started. If left blank the current directory will be used.
+
+OUTPUT_DIRECTORY       = doxy
+
+# The OUTPUT_LANGUAGE tag is used to specify the language in which all 
+# documentation generated by doxygen is written. Doxygen will use this 
+# information to generate all constant output in the proper language. 
+# The default language is English, other supported languages are: 
+# Dutch, French, Italian, Czech, Swedish, German, Finnish, Japanese, 
+# Korean, Hungarian, Norwegian, Spanish, Romanian, Russian, Croatian, 
+# Polish, Portuguese and Slovene.
+
+OUTPUT_LANGUAGE        = English
+
+# If the EXTRACT_ALL tag is set to YES doxygen will assume all entities in 
+# documentation are documented, even if no documentation was available. 
+# Private class members and static file members will be hidden unless 
+# the EXTRACT_PRIVATE and EXTRACT_STATIC tags are set to YES 
+
+EXTRACT_ALL            = YES
+
+# If the EXTRACT_PRIVATE tag is set to YES all private members of a class 
+# will be included in the documentation. 
+
+EXTRACT_PRIVATE        = NO
+
+# If the EXTRACT_STATIC tag is set to YES all static members of a file 
+# will be included in the documentation. 
+
+EXTRACT_STATIC         = YES
+
+# If the HIDE_UNDOC_MEMBERS tag is set to YES, Doxygen will hide all 
+# undocumented members of documented classes, files or namespaces. 
+# If set to NO (the default) these members will be included in the 
+# various overviews, but no documentation section is generated. 
+# This option has no effect if EXTRACT_ALL is enabled. 
+
+HIDE_UNDOC_MEMBERS     = NO
+
+# If the HIDE_UNDOC_CLASSES tag is set to YES, Doxygen will hide all 
+# undocumented classes that are normally visible in the class hierarchy. 
+# If set to NO (the default) these class will be included in the various 
+# overviews. This option has no effect if EXTRACT_ALL is enabled. 
+
+HIDE_UNDOC_CLASSES     = NO
+
+# If the BRIEF_MEMBER_DESC tag is set to YES (the default) Doxygen will 
+# include brief member descriptions after the members that are listed in 
+# the file and class documentation (similar to JavaDoc). 
+# Set to NO to disable this. 
+
+BRIEF_MEMBER_DESC      = YES
+
+# If the REPEAT_BRIEF tag is set to YES (the default) Doxygen will prepend 
+# the brief description of a member or function before the detailed description. 
+# Note: if both HIDE_UNDOC_MEMBERS and BRIEF_MEMBER_DESC are set to NO, the 
+# brief descriptions will be completely suppressed. 
+
+REPEAT_BRIEF           = YES
+
+# If the ALWAYS_DETAILED_SEC and REPEAT_BRIEF tags are both set to YES then 
+# Doxygen will generate a detailed section even if there is only a brief 
+# description. 
+
+ALWAYS_DETAILED_SEC    = NO
+
+# If the FULL_PATH_NAMES tag is set to YES then Doxygen will prepend the full 
+# path before files name in the file list and in the header files. If set 
+# to NO the shortest path that makes the file name unique will be used. 
+
+FULL_PATH_NAMES        = NO
+
+# If the FULL_PATH_NAMES tag is set to YES then the STRIP_FROM_PATH tag 
+# can be used to strip a user defined part of the path. Stripping is 
+# only done if one of the specified strings matches the left-hand part of 
+# the path. It is allowed to use relative paths in the argument list.
+
+STRIP_FROM_PATH        = 
+
+# The INTERNAL_DOCS tag determines if documentation 
+# that is typed after a \internal command is included. If the tag is set 
+# to NO (the default) then the documentation will be excluded. 
+# Set it to YES to include the internal documentation. 
+
+INTERNAL_DOCS          = NO
+
+# If the CLASS_DIAGRAMS tag is set to YES (the default) Doxygen will 
+# generate a class diagram (in Html and LaTeX) for classes with base or 
+# super classes. Setting the tag to NO turns the diagrams off. 
+
+CLASS_DIAGRAMS         = YES
+
+# If the SOURCE_BROWSER tag is set to YES then a list of source files will 
+# be generated. Documented entities will be cross-referenced with these sources. 
+
+SOURCE_BROWSER         = YES
+
+# Setting the INLINE_SOURCES tag to YES will include the body 
+# of functions and classes directly in the documentation. 
+
+INLINE_SOURCES         = NO
+
+# Setting the STRIP_CODE_COMMENTS tag to YES (the default) will instruct 
+# doxygen to hide any special comment blocks from generated source code 
+# fragments. Normal C and C++ comments will always remain visible. 
+
+STRIP_CODE_COMMENTS    = YES
+
+# If the CASE_SENSE_NAMES tag is set to NO then Doxygen will only generate 
+# file names in lower case letters. If set to YES upper case letters are also 
+# allowed. This is useful if you have classes or files whose names only differ 
+# in case and if your file system supports case sensitive file names. Windows 
+# users are adviced to set this option to NO.
+
+CASE_SENSE_NAMES       = YES
+
+# If the HIDE_SCOPE_NAMES tag is set to NO (the default) then Doxygen 
+# will show members with their full class and namespace scopes in the 
+# documentation. If set to YES the scope will be hidden. 
+
+HIDE_SCOPE_NAMES       = NO
+
+# If the VERBATIM_HEADERS tag is set to YES (the default) then Doxygen 
+# will generate a verbatim copy of the header file for each class for 
+# which an include is specified. Set to NO to disable this. 
+
+VERBATIM_HEADERS       = YES
+
+# If the SHOW_INCLUDE_FILES tag is set to YES (the default) then Doxygen 
+# will put list of the files that are included by a file in the documentation 
+# of that file. 
+
+SHOW_INCLUDE_FILES     = YES
+
+# If the JAVADOC_AUTOBRIEF tag is set to YES then Doxygen 
+# will interpret the first line (until the first dot) of a JavaDoc-style 
+# comment as the brief description. If set to NO, the JavaDoc 
+# comments  will behave just like the Qt-style comments (thus requiring an 
+# explict @brief command for a brief description. 
+
+JAVADOC_AUTOBRIEF      = NO
+
+# If the INHERIT_DOCS tag is set to YES (the default) then an undocumented 
+# member inherits the documentation from any documented member that it 
+# reimplements. 
+
+INHERIT_DOCS           = YES
+
+# If the INLINE_INFO tag is set to YES (the default) then a tag [inline] 
+# is inserted in the documentation for inline members. 
+
+INLINE_INFO            = YES
+
+# If the SORT_MEMBER_DOCS tag is set to YES (the default) then doxygen 
+# will sort the (detailed) documentation of file and class members 
+# alphabetically by member name. If set to NO the members will appear in 
+# declaration order. 
+
+SORT_MEMBER_DOCS       = YES
+
+# If member grouping is used in the documentation and the DISTRIBUTE_GROUP_DOC 
+# tag is set to YES, then doxygen will reuse the documentation of the first 
+# member in the group (if any) for the other members of the group. By default 
+# all members of a group must be documented explicitly.
+
+DISTRIBUTE_GROUP_DOC   = NO
+
+# The TAB_SIZE tag can be used to set the number of spaces in a tab. 
+# Doxygen uses this value to replace tabs by spaces in code fragments. 
+
+TAB_SIZE               = 4
+
+# The ENABLE_SECTIONS tag can be used to enable conditional 
+# documentation sections, marked by \if sectionname ... \endif. 
+
+ENABLED_SECTIONS       = 
+
+# The GENERATE_TODOLIST tag can be used to enable (YES) or 
+# disable (NO) the todo list. This list is created by putting \todo 
+# commands in the documentation.
+
+GENERATE_TODOLIST      = YES
+
+# The GENERATE_TESTLIST tag can be used to enable (YES) or 
+# disable (NO) the test list. This list is created by putting \test 
+# commands in the documentation.
+
+GENERATE_TESTLIST      = YES
+
+# This tag can be used to specify a number of aliases that acts 
+# as commands in the documentation. An alias has the form "name=value". 
+# For example adding "sideeffect=\par Side Effects:\n" will allow you to 
+# put the command \sideeffect (or @sideeffect) in the documentation, which 
+# will result in a user defined paragraph with heading "Side Effects:". 
+# You can put \n's in the value part of an alias to insert newlines. 
+
+ALIASES                = 
+
+# The MAX_INITIALIZER_LINES tag determines the maximum number of lines 
+# the initial value of a variable or define consist of for it to appear in 
+# the documentation. If the initializer consists of more lines than specified 
+# here it will be hidden. Use a value of 0 to hide initializers completely. 
+# The appearance of the initializer of individual variables and defines in the 
+# documentation can be controlled using \showinitializer or \hideinitializer 
+# command in the documentation regardless of this setting. 
+
+MAX_INITIALIZER_LINES  = 30
+
+# Set the OPTIMIZE_OUTPUT_FOR_C tag to YES if your project consists of C sources 
+# only. Doxygen will then generate output that is more tailored for C. 
+# For instance some of the names that are used will be different. The list 
+# of all members will be omitted, etc. 
+
+OPTIMIZE_OUTPUT_FOR_C  = NO
+
+#---------------------------------------------------------------------------
+# configuration options related to warning and progress messages
+#---------------------------------------------------------------------------
+
+# The QUIET tag can be used to turn on/off the messages that are generated 
+# by doxygen. Possible values are YES and NO. If left blank NO is used. 
+
+QUIET                  = NO
+
+# The WARNINGS tag can be used to turn on/off the warning messages that are 
+# generated by doxygen. Possible values are YES and NO. If left blank 
+# NO is used. 
+
+WARNINGS               = YES
+
+# If WARN_IF_UNDOCUMENTED is set to YES, then doxygen will generate warnings 
+# for undocumented members. If EXTRACT_ALL is set to YES then this flag will 
+# automatically be disabled. 
+
+WARN_IF_UNDOCUMENTED   = YES
+
+# The WARN_FORMAT tag determines the format of the warning messages that 
+# doxygen can produce. The string should contain the $file, $line, and $text 
+# tags, which will be replaced by the file and line number from which the 
+# warning originated and the warning text. 
+
+WARN_FORMAT            = "$file:$line: $text"
+
+# The WARN_LOGFILE tag can be used to specify a file to which warning 
+# and error messages should be written. If left blank the output is written 
+# to stderr. 
+
+WARN_LOGFILE           = 
+
+#---------------------------------------------------------------------------
+# configuration options related to the input files
+#---------------------------------------------------------------------------
+
+# The INPUT tag can be used to specify the files and/or directories that contain 
+# documented source files. You may enter file names like "myfile.cpp" or 
+# directories like "/usr/src/myproject". Separate the files or directories 
+# with spaces. 
+
+INPUT                  = .
+
+# If the value of the INPUT tag contains directories, you can use the 
+# FILE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp 
+# and *.h) to filter out the source-files in the directories. If left 
+# blank all files are included. 
+
+FILE_PATTERNS          =  *.c *.h
+
+# The RECURSIVE tag can be used to turn specify whether or not subdirectories 
+# should be searched for input files as well. Possible values are YES and NO. 
+# If left blank NO is used. 
+
+RECURSIVE              = NO
+
+# The EXCLUDE tag can be used to specify files and/or directories that should 
+# excluded from the INPUT source files. This way you can easily exclude a 
+# subdirectory from a directory tree whose root is specified with the INPUT tag. 
+
+EXCLUDE                = 
+
+# If the value of the INPUT tag contains directories, you can use the 
+# EXCLUDE_PATTERNS tag to specify one or more wildcard patterns to exclude 
+# certain files from those directories. 
+
+EXCLUDE_PATTERNS       = 
+
+# The EXAMPLE_PATH tag can be used to specify one or more files or 
+# directories that contain example code fragments that are included (see 
+# the \include command). 
+
+EXAMPLE_PATH           = 
+
+# If the value of the EXAMPLE_PATH tag contains directories, you can use the 
+# EXAMPLE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp 
+# and *.h) to filter out the source-files in the directories. If left 
+# blank all files are included. 
+
+EXAMPLE_PATTERNS       = 
+
+# The IMAGE_PATH tag can be used to specify one or more files or 
+# directories that contain image that are included in the documentation (see 
+# the \image command). 
+
+IMAGE_PATH             = 
+
+# The INPUT_FILTER tag can be used to specify a program that doxygen should 
+# invoke to filter for each input file. Doxygen will invoke the filter program 
+# by executing (via popen()) the command <filter> <input-file>, where <filter> 
+# is the value of the INPUT_FILTER tag, and <input-file> is the name of an 
+# input file. Doxygen will then use the output that the filter program writes 
+# to standard output. 
+
+INPUT_FILTER           = 
+
+# If the FILTER_SOURCE_FILES tag is set to YES, the input filter (if set using 
+# INPUT_FILTER) will be used to filter the input files when producing source 
+# files to browse. 
+
+FILTER_SOURCE_FILES    = NO
+
+#---------------------------------------------------------------------------
+# configuration options related to the alphabetical class index
+#---------------------------------------------------------------------------
+
+# If the ALPHABETICAL_INDEX tag is set to YES, an alphabetical index 
+# of all compounds will be generated. Enable this if the project 
+# contains a lot of classes, structs, unions or interfaces. 
+
+ALPHABETICAL_INDEX     = NO
+
+# If the alphabetical index is enabled (see ALPHABETICAL_INDEX) then 
+# the COLS_IN_ALPHA_INDEX tag can be used to specify the number of columns 
+# in which this list will be split (can be a number in the range [1..20]) 
+
+COLS_IN_ALPHA_INDEX    = 5
+
+# In case all classes in a project start with a common prefix, all 
+# classes will be put under the same header in the alphabetical index. 
+# The IGNORE_PREFIX tag can be used to specify one or more prefixes that 
+# should be ignored while generating the index headers. 
+
+IGNORE_PREFIX          = 
+
+#---------------------------------------------------------------------------
+# configuration options related to the HTML output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_HTML tag is set to YES (the default) Doxygen will 
+# generate HTML output. 
+
+GENERATE_HTML          = YES
+
+# The HTML_OUTPUT tag is used to specify where the HTML docs will be put. 
+# If a relative path is entered the value of OUTPUT_DIRECTORY will be 
+# put in front of it. If left blank `html' will be used as the default path. 
+
+HTML_OUTPUT            = html
+
+# The HTML_HEADER tag can be used to specify a personal HTML header for 
+# each generated HTML page. If it is left blank doxygen will generate a 
+# standard header.
+
+HTML_HEADER            = 
+
+# The HTML_FOOTER tag can be used to specify a personal HTML footer for 
+# each generated HTML page. If it is left blank doxygen will generate a 
+# standard footer.
+
+HTML_FOOTER            = 
+
+# The HTML_STYLESHEET tag can be used to specify a user defined cascading 
+# style sheet that is used by each HTML page. It can be used to 
+# fine-tune the look of the HTML output. If the tag is left blank doxygen 
+# will generate a default style sheet 
+
+HTML_STYLESHEET        = 
+
+# If the HTML_ALIGN_MEMBERS tag is set to YES, the members of classes, 
+# files or namespaces will be aligned in HTML using tables. If set to 
+# NO a bullet list will be used. 
+
+HTML_ALIGN_MEMBERS     = YES
+
+# If the GENERATE_HTMLHELP tag is set to YES, additional index files 
+# will be generated that can be used as input for tools like the 
+# Microsoft HTML help workshop to generate a compressed HTML help file (.chm) 
+# of the generated HTML documentation. 
+
+GENERATE_HTMLHELP      = NO
+
+# The DISABLE_INDEX tag can be used to turn on/off the condensed index at 
+# top of each HTML page. The value NO (the default) enables the index and 
+# the value YES disables it. 
+
+DISABLE_INDEX          = NO
+
+# This tag can be used to set the number of enum values (range [1..20]) 
+# that doxygen will group on one line in the generated HTML documentation. 
+
+ENUM_VALUES_PER_LINE   = 4
+
+# If the GENERATE_TREEVIEW tag is set to YES, a side panel will be
+# generated containing a tree-like index structure (just like the one that 
+# is generated for HTML Help). For this to work a browser that supports 
+# JavaScript and frames is required (for instance Netscape 4.0+ 
+# or Internet explorer 4.0+). 
+
+GENERATE_TREEVIEW      = YES
+
+# If the treeview is enabled (see GENERATE_TREEVIEW) then this tag can be 
+# used to set the initial width (in pixels) of the frame in which the tree 
+# is shown. 
+
+TREEVIEW_WIDTH         = 250
+
+#---------------------------------------------------------------------------
+# configuration options related to the LaTeX output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_LATEX tag is set to YES (the default) Doxygen will 
+# generate Latex output. 
+
+GENERATE_LATEX         = YES
+
+# The LATEX_OUTPUT tag is used to specify where the LaTeX docs will be put. 
+# If a relative path is entered the value of OUTPUT_DIRECTORY will be 
+# put in front of it. If left blank `latex' will be used as the default path. 
+
+LATEX_OUTPUT           = latex
+
+# If the COMPACT_LATEX tag is set to YES Doxygen generates more compact 
+# LaTeX documents. This may be useful for small projects and may help to 
+# save some trees in general. 
+
+COMPACT_LATEX          = NO
+
+# The PAPER_TYPE tag can be used to set the paper type that is used 
+# by the printer. Possible values are: a4, a4wide, letter, legal and 
+# executive. If left blank a4wide will be used. 
+
+PAPER_TYPE             = a4wide
+
+# The EXTRA_PACKAGES tag can be to specify one or more names of LaTeX 
+# packages that should be included in the LaTeX output. 
+
+EXTRA_PACKAGES         = 
+
+# The LATEX_HEADER tag can be used to specify a personal LaTeX header for 
+# the generated latex document. The header should contain everything until 
+# the first chapter. If it is left blank doxygen will generate a 
+# standard header. Notice: only use this tag if you know what you are doing! 
+
+LATEX_HEADER           = 
+
+# If the PDF_HYPERLINKS tag is set to YES, the LaTeX that is generated 
+# is prepared for conversion to pdf (using ps2pdf). The pdf file will 
+# contain links (just like the HTML output) instead of page references 
+# This makes the output suitable for online browsing using a pdf viewer. 
+
+PDF_HYPERLINKS         = NO
+
+# If the USE_PDFLATEX tag is set to YES, pdflatex will be used instead of 
+# plain latex in the generated Makefile. Set this option to YES to get a 
+# higher quality PDF documentation. 
+
+USE_PDFLATEX           = NO
+
+# If the LATEX_BATCHMODE tag is set to YES, doxygen will add the \\batchmode. 
+# command to the generated LaTeX files. This will instruct LaTeX to keep 
+# running if errors occur, instead of asking the user for help. 
+# This option is also used when generating formulas in HTML. 
+
+LATEX_BATCHMODE        = NO
+
+#---------------------------------------------------------------------------
+# configuration options related to the RTF output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_RTF tag is set to YES Doxygen will generate RTF output 
+# The RTF output is optimised for Word 97 and may not look very pretty with 
+# other RTF readers or editors.
+
+GENERATE_RTF           = YES
+
+# The RTF_OUTPUT tag is used to specify where the RTF docs will be put. 
+# If a relative path is entered the value of OUTPUT_DIRECTORY will be 
+# put in front of it. If left blank `rtf' will be used as the default path. 
+
+RTF_OUTPUT             = rtf
+
+# If the COMPACT_RTF tag is set to YES Doxygen generates more compact 
+# RTF documents. This may be useful for small projects and may help to 
+# save some trees in general. 
+
+COMPACT_RTF            = NO
+
+# If the RTF_HYPERLINKS tag is set to YES, the RTF that is generated 
+# will contain hyperlink fields. The RTF file will 
+# contain links (just like the HTML output) instead of page references. 
+# This makes the output suitable for online browsing using a WORD or other. 
+# programs which support those fields. 
+# Note: wordpad (write) and others do not support links. 
+
+RTF_HYPERLINKS         = NO
+
+# Load stylesheet definitions from file. Syntax is similar to doxygen's 
+# config file, i.e. a series of assigments. You only have to provide 
+# replacements, missing definitions are set to their default value. 
+
+RTF_STYLESHEET_FILE    = 
+
+#---------------------------------------------------------------------------
+# configuration options related to the man page output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_MAN tag is set to YES (the default) Doxygen will 
+# generate man pages 
+
+GENERATE_MAN           = YES
+
+# The MAN_OUTPUT tag is used to specify where the man pages will be put. 
+# If a relative path is entered the value of OUTPUT_DIRECTORY will be 
+# put in front of it. If left blank `man' will be used as the default path. 
+
+MAN_OUTPUT             = man
+
+# The MAN_EXTENSION tag determines the extension that is added to 
+# the generated man pages (default is the subroutine's section .3) 
+
+MAN_EXTENSION          = .3
+
+#---------------------------------------------------------------------------
+# Configuration options related to the preprocessor   
+#---------------------------------------------------------------------------
+
+# If the ENABLE_PREPROCESSING tag is set to YES (the default) Doxygen will 
+# evaluate all C-preprocessor directives found in the sources and include 
+# files. 
+
+ENABLE_PREPROCESSING   = YES
+
+# If the MACRO_EXPANSION tag is set to YES Doxygen will expand all macro 
+# names in the source code. If set to NO (the default) only conditional 
+# compilation will be performed. Macro expansion can be done in a controlled 
+# way by setting EXPAND_ONLY_PREDEF to YES. 
+
+MACRO_EXPANSION        = NO
+
+# If the EXPAND_ONLY_PREDEF and MACRO_EXPANSION tags are both set to YES 
+# then the macro expansion is limited to the macros specified with the 
+# PREDEFINED and EXPAND_AS_PREDEFINED tags. 
+
+EXPAND_ONLY_PREDEF     = NO
+
+# If the SEARCH_INCLUDES tag is set to YES (the default) the includes files 
+# in the INCLUDE_PATH (see below) will be search if a #include is found. 
+
+SEARCH_INCLUDES        = YES
+
+# The INCLUDE_PATH tag can be used to specify one or more directories that 
+# contain include files that are not input files but should be processed by 
+# the preprocessor. 
+
+INCLUDE_PATH           = 
+
+# You can use the INCLUDE_FILE_PATTERNS tag to specify one or more wildcard 
+# patterns (like *.h and *.hpp) to filter out the header-files in the 
+# directories. If left blank, the patterns specified with FILE_PATTERNS will 
+# be used. 
+
+INCLUDE_FILE_PATTERNS  = 
+
+# The PREDEFINED tag can be used to specify one or more macro names that 
+# are defined before the preprocessor is started (similar to the -D option of 
+# gcc). The argument of the tag is a list of macros of the form: name 
+# or name=definition (no spaces). If the definition and the = are 
+# omitted =1 is assumed. 
+
+PREDEFINED             = 
+
+# If the MACRO_EXPANSION and EXPAND_PREDEF_ONLY tags are set to YES then 
+# this tag can be used to specify a list of macro names that should be expanded. 
+# The macro definition that is found in the sources will be used. 
+# Use the PREDEFINED tag if you want to use a different macro definition. 
+
+EXPAND_AS_DEFINED      = 
+
+#---------------------------------------------------------------------------
+# Configuration::addtions related to external references   
+#---------------------------------------------------------------------------
+
+# The TAGFILES tag can be used to specify one or more tagfiles. 
+
+TAGFILES               = 
+
+# When a file name is specified after GENERATE_TAGFILE, doxygen will create 
+# a tag file that is based on the input files it reads. 
+
+GENERATE_TAGFILE       = 
+
+# If the ALLEXTERNALS tag is set to YES all external classes will be listed 
+# in the class index. If set to NO only the inherited external classes 
+# will be listed. 
+
+ALLEXTERNALS           = NO
+
+# The PERL_PATH should be the absolute path and name of the perl script 
+# interpreter (i.e. the result of `which perl'). 
+
+PERL_PATH              = /usr/bin/perl
+
+#---------------------------------------------------------------------------
+# Configuration options related to the dot tool   
+#---------------------------------------------------------------------------
+
+# If you set the HAVE_DOT tag to YES then doxygen will assume the dot tool is 
+# available from the path. This tool is part of Graphviz, a graph visualization 
+# toolkit from AT&T and Lucent Bell Labs. The other options in this section 
+# have no effect if this option is set to NO (the default) 
+
+HAVE_DOT               = NO
+
+# If the CLASS_GRAPH and HAVE_DOT tags are set to YES then doxygen 
+# will generate a graph for each documented class showing the direct and 
+# indirect inheritance relations. Setting this tag to YES will force the 
+# the CLASS_DIAGRAMS tag to NO.
+
+CLASS_GRAPH            = YES
+
+# If the COLLABORATION_GRAPH and HAVE_DOT tags are set to YES then doxygen 
+# will generate a graph for each documented class showing the direct and 
+# indirect implementation dependencies (inheritance, containment, and 
+# class references variables) of the class with other documented classes. 
+
+COLLABORATION_GRAPH    = YES
+
+# If the ENABLE_PREPROCESSING, INCLUDE_GRAPH, and HAVE_DOT tags are set to 
+# YES then doxygen will generate a graph for each documented file showing 
+# the direct and indirect include dependencies of the file with other 
+# documented files. 
+
+INCLUDE_GRAPH          = YES
+
+# If the ENABLE_PREPROCESSING, INCLUDED_BY_GRAPH, and HAVE_DOT tags are set to 
+# YES then doxygen will generate a graph for each documented header file showing 
+# the documented files that directly or indirectly include this file 
+
+INCLUDED_BY_GRAPH      = YES
+
+# If the GRAPHICAL_HIERARCHY and HAVE_DOT tags are set to YES then doxygen 
+# will graphical hierarchy of all classes instead of a textual one. 
+
+GRAPHICAL_HIERARCHY    = YES
+
+# The tag DOT_PATH can be used to specify the path where the dot tool can be 
+# found. If left blank, it is assumed the dot tool can be found on the path. 
+
+DOT_PATH               = 
+
+# The MAX_DOT_GRAPH_WIDTH tag can be used to set the maximum allowed width 
+# (in pixels) of the graphs generated by dot. If a graph becomes larger than 
+# this value, doxygen will try to truncate the graph, so that it fits within 
+# the specified constraint. Beware that most browsers cannot cope with very 
+# large images. 
+
+MAX_DOT_GRAPH_WIDTH    = 1024
+
+# The MAX_DOT_GRAPH_HEIGHT tag can be used to set the maximum allows height 
+# (in pixels) of the graphs generated by dot. If a graph becomes larger than 
+# this value, doxygen will try to truncate the graph, so that it fits within 
+# the specified constraint. Beware that most browsers cannot cope with very 
+# large images. 
+
+MAX_DOT_GRAPH_HEIGHT   = 1024
+
+# If the GENERATE_LEGEND tag is set to YES (the default) Doxygen will 
+# generate a legend page explaining the meaning of the various boxes and 
+# arrows in the dot generated graphs. 
+
+GENERATE_LEGEND        = YES
+
+#---------------------------------------------------------------------------
+# Configuration::addtions related to the search engine   
+#---------------------------------------------------------------------------
+
+# The SEARCHENGINE tag specifies whether or not a search engine should be 
+# used. If set to NO the values of all tags below this one will be ignored. 
+
+SEARCHENGINE           = NO
+
+# The CGI_NAME tag should be the name of the CGI script that 
+# starts the search engine (doxysearch) with the correct parameters. 
+# A script with this name will be generated by doxygen. 
+
+CGI_NAME               = search.cgi
+
+# The CGI_URL tag should be the absolute URL to the directory where the 
+# cgi binaries are located. See the documentation of your http daemon for 
+# details. 
+
+CGI_URL                = 
+
+# The DOC_URL tag should be the absolute URL to the directory where the 
+# documentation is located. If left blank the absolute path to the 
+# documentation, with file:// prepended to it, will be used. 
+
+DOC_URL                = 
+
+# The DOC_ABSPATH tag should be the absolute path to the directory where the 
+# documentation is located. If left blank the directory on the local machine 
+# will be used. 
+
+DOC_ABSPATH            = 
+
+# The BIN_ABSPATH tag must point to the directory where the doxysearch binary 
+# is installed. 
+
+BIN_ABSPATH            = /usr/local/bin/
+
+# The EXT_DOC_PATHS tag can be used to specify one or more paths to 
+# documentation generated for other projects. This allows doxysearch to search 
+# the documentation for these projects as well. 
+
+EXT_DOC_PATHS          = 
diff --git a/misc/Nindent b/misc/Nindent
new file mode 100755 (executable)
index 0000000..0d75ccc
--- /dev/null
@@ -0,0 +1,18 @@
+#!/bin/sh
+PARAM="-npro -kr -i4 -ts8 -nut -sob -l80 -ss -ncs -cp1"
+RES=`indent --version`
+V1=`echo $RES | cut -d' ' -f3 | cut -d'.' -f1`
+V2=`echo $RES | cut -d' ' -f3 | cut -d'.' -f2`
+V3=`echo $RES | cut -d' ' -f3 | cut -d'.' -f3`
+if [ $V1 -gt 2 ]; then
+  PARAM="$PARAM -il0"
+elif [ $V1 -eq 2 ]; then
+  if [ $V2 -gt 2 ]; then
+    PARAM="$PARAM -il0";
+  elif [ $V2 -eq 2 ]; then
+    if [ $V3 -ge 10 ]; then
+      PARAM="$PARAM -il0"
+    fi
+  fi
+fi
+exec indent $PARAM "$@"
diff --git a/misc/README b/misc/README
new file mode 100644 (file)
index 0000000..f39ba4d
--- /dev/null
@@ -0,0 +1,2 @@
+There are various helpful bits and pieces for NASM,
+including but not limited to Simon photograph =)
diff --git a/misc/altreg.inc b/misc/altreg.inc
new file mode 100644 (file)
index 0000000..9892818
--- /dev/null
@@ -0,0 +1,72 @@
+;;
+;; altreg.inc
+;;
+;; Alternate register names for 64-bit mode
+;;
+
+;;
+;; Intel documents R8L-R15L instead of R8B-R15B
+;; (Warning: this may confuse people with an AT&T-style assembly
+;; background, where "r8l" means R8D, etc.)
+;;
+%idefine r8l  r8b
+%idefine r9l  r9b
+%idefine r10l r10b
+%idefine r11l r11b
+%idefine r12l r12b
+%idefine r13l r13b
+%idefine r14l r14b
+%idefine r15l r15b
+
+;;
+;; Numeric register names for the lower 8 registers
+;;
+%idefine r0  rax
+%idefine r1  rcx
+%idefine r2  rdx
+%idefine r3  rbx
+%idefine r4  rsp
+%idefine r5  rbp
+%idefine r6  rsi
+%idefine r7  rdi
+
+%idefine r0d eax
+%idefine r1d ecx
+%idefine r2d edx
+%idefine r3d ebx
+%idefine r4d esp
+%idefine r5d ebp
+%idefine r6d esi
+%idefine r7d edi
+
+%idefine r0w ax
+%idefine r1w cx
+%idefine r2w dx
+%idefine r3w bx
+%idefine r4w sp
+%idefine r5w bp
+%idefine r6w si
+%idefine r7w di
+
+%idefine r0b al
+%idefine r1b cl
+%idefine r2b dl
+%idefine r3b bl
+%idefine r4b spl
+%idefine r5b bpl
+%idefine r6b sil
+%idefine r7b dil
+
+%idefine r0l al
+%idefine r1l cl
+%idefine r2l dl
+%idefine r3l bl
+%idefine r4l spl
+%idefine r5l bpl
+%idefine r6l sil
+%idefine r7l dil
+
+%idefine r0h ah
+%idefine r1h ch
+%idefine r2h dh
+%idefine r3h bh
diff --git a/misc/c16.mac b/misc/c16.mac
new file mode 100644 (file)
index 0000000..50b5d5e
--- /dev/null
@@ -0,0 +1,82 @@
+; NASM macro set to make interfacing to 16-bit programs easier -*- nasm -*-
+
+
+
+%imacro proc 1                 ; begin a procedure definition
+
+%push proc
+
+         global %1
+
+%1:      push bp
+
+         mov bp,sp
+
+%ifdef FARCODE PASCAL          ; arguments may start at bp+4 or bp+6
+
+%assign %$arg 6
+
+%define %$firstarg 6
+
+%else
+
+%assign %$arg 4
+
+%define %$firstarg 4
+
+%endif
+
+%define %$procname %1
+
+%endmacro
+
+
+
+%imacro arg 0-1 2              ; used with the argument name as a label
+
+%00      equ %$arg
+
+                               ; we could possibly be adding some
+
+                               ; debug information at this point...?
+
+%assign %$arg %1+%$arg
+
+%endmacro
+
+
+
+%imacro endproc 0
+
+%ifnctx proc
+
+%error Mismatched `endproc'/`proc'
+
+%else
+
+          mov sp,bp
+
+          pop bp
+
+%ifdef PASCAL
+
+          retf %$arg - %$firstarg
+
+%elifdef FARCODE
+
+         retf
+
+%else
+
+         retn
+
+%endif
+
+__end_%$procname:              ; useful for calculating function size
+
+%pop
+
+%endif
+
+%endmacro
+
diff --git a/misc/c32.mac b/misc/c32.mac
new file mode 100644 (file)
index 0000000..f0c116b
--- /dev/null
@@ -0,0 +1,52 @@
+; NASM macro set to make interfacing to 32-bit programs easier -*- nasm -*-
+
+
+
+%imacro proc 1                 ; begin a procedure definition
+
+%push proc
+
+          global %1
+
+%1:       push ebp
+
+          mov ebp,esp
+
+%assign %$arg 8
+
+%define %$procname %1
+
+%endmacro
+
+
+
+%imacro arg 0-1 4              ; used with the argument name as a label
+
+%00      equ %$arg
+
+%assign %$arg %1+%$arg
+
+%endmacro
+
+
+
+%imacro endproc 0
+
+%ifnctx proc
+
+%error Mismatched `endproc'/`proc'
+
+%else
+
+         leave
+
+         ret
+
+__end_%$procname:              ; useful for calculating function size
+
+%pop
+
+%endif
+
+%endmacro
+
diff --git a/misc/cleanfile b/misc/cleanfile
new file mode 100755 (executable)
index 0000000..cefd29e
--- /dev/null
@@ -0,0 +1,176 @@
+#!/usr/bin/perl -w
+#
+# Clean a text file -- or directory of text files -- of stealth whitespace.
+# WARNING: this can be a highly destructive operation.  Use with caution.
+#
+
+use bytes;
+use File::Basename;
+
+# Default options
+$max_width = 79;
+
+# Clean up space-tab sequences, either by removing spaces or
+# replacing them with tabs.
+sub clean_space_tabs($)
+{
+    no bytes;                  # Tab alignment depends on characters
+
+    my($li) = @_;
+    my($lo) = '';
+    my $pos = 0;
+    my $nsp = 0;
+    my($i, $c);
+
+    for ($i = 0; $i < length($li); $i++) {
+       $c = substr($li, $i, 1);
+       if ($c eq "\t") {
+           my $npos = ($pos+$nsp+8) & ~7;
+           my $ntab = ($npos >> 3) - ($pos >> 3);
+           $lo .= "\t" x $ntab;
+           $pos = $npos;
+           $nsp = 0;
+       } elsif ($c eq "\n" || $c eq "\r") {
+           $lo .= " " x $nsp;
+           $pos += $nsp;
+           $nsp = 0;
+           $lo .= $c;
+           $pos = 0;
+       } elsif ($c eq " ") {
+           $nsp++;
+       } else {
+           $lo .= " " x $nsp;
+           $pos += $nsp;
+           $nsp = 0;
+           $lo .= $c;
+           $pos++;
+       }
+    }
+    $lo .= " " x $nsp;
+    return $lo;
+}
+
+# Compute the visual width of a string
+sub strwidth($) {
+    no bytes;                  # Tab alignment depends on characters
+
+    my($li) = @_;
+    my($c, $i);
+    my $pos = 0;
+    my $mlen = 0;
+
+    for ($i = 0; $i < length($li); $i++) {
+       $c = substr($li,$i,1);
+       if ($c eq "\t") {
+           $pos = ($pos+8) & ~7;
+       } elsif ($c eq "\n") {
+           $mlen = $pos if ($pos > $mlen);
+           $pos = 0;
+       } else {
+           $pos++;
+       }
+    }
+
+    $mlen = $pos if ($pos > $mlen);
+    return $mlen;
+}
+
+$name = basename($0);
+
+@files = ();
+
+while (defined($a = shift(@ARGV))) {
+    if ($a =~ /^-/) {
+       if ($a eq '-width' || $a eq '-w') {
+           $max_width = shift(@ARGV)+0;
+       } else {
+           print STDERR "Usage: $name [-width #] files...\n";
+           exit 1;
+       }
+    } else {
+       push(@files, $a);
+    }
+}
+
+foreach $f ( @files ) {
+    print STDERR "$name: $f\n";
+
+    if (! -f $f) {
+       print STDERR "$f: not a file\n";
+       next;
+    }
+
+    if (!open(FILE, '+<', $f)) {
+       print STDERR "$name: Cannot open file: $f: $!\n";
+       next;
+    }
+
+    binmode FILE;
+
+    # First, verify that it is not a binary file; consider any file
+    # with a zero byte to be a binary file.  Is there any better, or
+    # additional, heuristic that should be applied?
+    $is_binary = 0;
+
+    while (read(FILE, $data, 65536) > 0) {
+       if ($data =~ /\0/) {
+           $is_binary = 1;
+           last;
+       }
+    }
+
+    if ($is_binary) {
+       print STDERR "$name: $f: binary file\n";
+       next;
+    }
+
+    seek(FILE, 0, 0);
+
+    $in_bytes = 0;
+    $out_bytes = 0;
+    $blank_bytes = 0;
+
+    @blanks = ();
+    @lines  = ();
+    $lineno = 0;
+
+    while ( defined($line = <FILE>) ) {
+       $lineno++;
+       $in_bytes += length($line);
+       $line =~ s/[ \t\r]*$//;         # Remove trailing spaces
+       $line = clean_space_tabs($line);
+
+       if ( $line eq "\n" ) {
+           push(@blanks, $line);
+           $blank_bytes += length($line);
+       } else {
+           push(@lines, @blanks);
+           $out_bytes += $blank_bytes;
+           push(@lines, $line);
+           $out_bytes += length($line);
+           @blanks = ();
+           $blank_bytes = 0;
+       }
+
+       $l_width = strwidth($line);
+       if ($max_width && $l_width > $max_width) {
+           print STDERR
+               "$f:$lineno: line exceeds $max_width characters ($l_width)\n";
+       }
+    }
+
+    # Any blanks at the end of the file are discarded
+
+    if ($in_bytes != $out_bytes) {
+       # Only write to the file if changed
+       seek(FILE, 0, 0);
+       print FILE @lines;
+
+       if ( !defined($where = tell(FILE)) ||
+            !truncate(FILE, $where) ) {
+           die "$name: Failed to truncate modified file: $f: $!\n";
+       }
+    }
+
+    close(FILE);
+}
diff --git a/misc/cleanpatch b/misc/cleanpatch
new file mode 100755 (executable)
index 0000000..9680d03
--- /dev/null
@@ -0,0 +1,258 @@
+#!/usr/bin/perl -w
+#
+# Clean a patch file -- or directory of patch files -- of stealth whitespace.
+# WARNING: this can be a highly destructive operation.  Use with caution.
+#
+
+use bytes;
+use File::Basename;
+
+# Default options
+$max_width = 79;
+
+# Clean up space-tab sequences, either by removing spaces or
+# replacing them with tabs.
+sub clean_space_tabs($)
+{
+    no bytes;                  # Tab alignment depends on characters
+
+    my($li) = @_;
+    my($lo) = '';
+    my $pos = 0;
+    my $nsp = 0;
+    my($i, $c);
+
+    for ($i = 0; $i < length($li); $i++) {
+       $c = substr($li, $i, 1);
+       if ($c eq "\t") {
+           my $npos = ($pos+$nsp+8) & ~7;
+           my $ntab = ($npos >> 3) - ($pos >> 3);
+           $lo .= "\t" x $ntab;
+           $pos = $npos;
+           $nsp = 0;
+       } elsif ($c eq "\n" || $c eq "\r") {
+           $lo .= " " x $nsp;
+           $pos += $nsp;
+           $nsp = 0;
+           $lo .= $c;
+           $pos = 0;
+       } elsif ($c eq " ") {
+           $nsp++;
+       } else {
+           $lo .= " " x $nsp;
+           $pos += $nsp;
+           $nsp = 0;
+           $lo .= $c;
+           $pos++;
+       }
+    }
+    $lo .= " " x $nsp;
+    return $lo;
+}
+
+# Compute the visual width of a string
+sub strwidth($) {
+    no bytes;                  # Tab alignment depends on characters
+
+    my($li) = @_;
+    my($c, $i);
+    my $pos = 0;
+    my $mlen = 0;
+
+    for ($i = 0; $i < length($li); $i++) {
+       $c = substr($li,$i,1);
+       if ($c eq "\t") {
+           $pos = ($pos+8) & ~7;
+       } elsif ($c eq "\n") {
+           $mlen = $pos if ($pos > $mlen);
+           $pos = 0;
+       } else {
+           $pos++;
+       }
+    }
+
+    $mlen = $pos if ($pos > $mlen);
+    return $mlen;
+}
+
+$name = basename($0);
+
+@files = ();
+
+while (defined($a = shift(@ARGV))) {
+    if ($a =~ /^-/) {
+       if ($a eq '-width' || $a eq '-w') {
+           $max_width = shift(@ARGV)+0;
+       } else {
+           print STDERR "Usage: $name [-width #] files...\n";
+           exit 1;
+       }
+    } else {
+       push(@files, $a);
+    }
+}
+
+foreach $f ( @files ) {
+    print STDERR "$name: $f\n";
+
+    if (! -f $f) {
+       print STDERR "$f: not a file\n";
+       next;
+    }
+
+    if (!open(FILE, '+<', $f)) {
+       print STDERR "$name: Cannot open file: $f: $!\n";
+       next;
+    }
+
+    binmode FILE;
+
+    # First, verify that it is not a binary file; consider any file
+    # with a zero byte to be a binary file.  Is there any better, or
+    # additional, heuristic that should be applied?
+    $is_binary = 0;
+
+    while (read(FILE, $data, 65536) > 0) {
+       if ($data =~ /\0/) {
+           $is_binary = 1;
+           last;
+       }
+    }
+
+    if ($is_binary) {
+       print STDERR "$name: $f: binary file\n";
+       next;
+    }
+
+    seek(FILE, 0, 0);
+
+    $in_bytes = 0;
+    $out_bytes = 0;
+    $lineno = 0;
+
+    @lines  = ();
+
+    $in_hunk = 0;
+    $err = 0;
+
+    while ( defined($line = <FILE>) ) {
+       $lineno++;
+       $in_bytes += length($line);
+
+       if (!$in_hunk) {
+           if ($line =~
+               /^\@\@\s+\-([0-9]+),([0-9]+)\s+\+([0-9]+),([0-9]+)\s\@\@/) {
+               $minus_lines = $2;
+               $plus_lines = $4;
+               if ($minus_lines || $plus_lines) {
+                   $in_hunk = 1;
+                   @hunk_lines = ($line);
+               }
+           } else {
+               push(@lines, $line);
+               $out_bytes += length($line);
+           }
+       } else {
+           # We're in a hunk
+
+           if ($line =~ /^\+/) {
+               $plus_lines--;
+
+               $text = substr($line, 1);
+               $text =~ s/[ \t\r]*$//;         # Remove trailing spaces
+               $text = clean_space_tabs($text);
+
+               $l_width = strwidth($text);
+               if ($max_width && $l_width > $max_width) {
+                   print STDERR
+                       "$f:$lineno: adds line exceeds $max_width ",
+                       "characters ($l_width)\n";
+               }
+
+               push(@hunk_lines, '+'.$text);
+           } elsif ($line =~ /^\-/) {
+               $minus_lines--;
+               push(@hunk_lines, $line);
+           } elsif ($line =~ /^ /) {
+               $plus_lines--;
+               $minus_lines--;
+               push(@hunk_lines, $line);
+           } else {
+               print STDERR "$name: $f: malformed patch\n";
+               $err = 1;
+               last;
+           }
+
+           if ($plus_lines < 0 || $minus_lines < 0) {
+               print STDERR "$name: $f: malformed patch\n";
+               $err = 1;
+               last;
+           } elsif ($plus_lines == 0 && $minus_lines == 0) {
+               # End of a hunk.  Process this hunk.
+               my $i;
+               my $l;
+               my @h = ();
+               my $adj = 0;
+               my $done = 0;
+
+               for ($i = scalar(@hunk_lines)-1; $i > 0; $i--) {
+                   $l = $hunk_lines[$i];
+                   if (!$done && $l eq "+\n") {
+                       $adj++; # Skip this line
+                   } elsif ($l =~ /^[ +]/) {
+                       $done = 1;
+                       unshift(@h, $l);
+                   } else {
+                       unshift(@h, $l);
+                   }
+               }
+
+               $l = $hunk_lines[0];  # Hunk header
+               undef @hunk_lines;    # Free memory
+
+               if ($adj) {
+                   die unless
+                       ($l =~ /^\@\@\s+\-([0-9]+),([0-9]+)\s+\+([0-9]+),([0-9]+)\s\@\@(.*)$/);
+                   my $mstart = $1;
+                   my $mlin = $2;
+                   my $pstart = $3;
+                   my $plin = $4;
+                   my $tail = $5; # doesn't include the final newline
+
+                   $l = sprintf("@@ -%d,%d +%d,%d @@%s\n",
+                                $mstart, $mlin, $pstart, $plin-$adj,
+                                $tail);
+               }
+               unshift(@h, $l);
+
+               # Transfer to the output array
+               foreach $l (@h) {
+                   $out_bytes += length($l);
+                   push(@lines, $l);
+               }
+
+               $in_hunk = 0;
+           }
+       }
+    }
+
+    if ($in_hunk) {
+       print STDERR "$name: $f: malformed patch\n";
+       $err = 1;
+    }
+
+    if (!$err) {
+       if ($in_bytes != $out_bytes) {
+           # Only write to the file if changed
+           seek(FILE, 0, 0);
+           print FILE @lines;
+
+           if ( !defined($where = tell(FILE)) ||
+                !truncate(FILE, $where) ) {
+               die "$name: Failed to truncate modified file: $f: $!\n";
+           }
+       }
+    }
+
+    close(FILE);
+}
diff --git a/misc/crcgen.c b/misc/crcgen.c
new file mode 100644 (file)
index 0000000..f11e252
--- /dev/null
@@ -0,0 +1,44 @@
+#include <inttypes.h>
+#include <stdio.h>
+
+int main(int argc, char *argv[])
+{
+    /* Polynomial in bit-reversed notation */
+    uint64_t poly;
+    uint64_t crctab[256], v;
+    int i, j;
+
+    poly = strtoumax(argv[1], NULL, 0);
+
+    printf("/* C */\n");
+    printf("static const uint64_t crc64_tab[256] = {\n");
+    for (i = 0; i < 256; i++) {
+       v = i;
+       for (j = 0; j < 8; j++)
+           v = (v >> 1) ^ ((v & 1) ? poly : 0);
+       crctab[i] = v;
+    }
+
+    for (i = 0; i < 256; i += 2) {
+       printf("    /* %02x */ UINT64_C(0x%016"PRIx64"), "
+              "UINT64_C(0x%016"PRIx64")%s\n",
+              i, crctab[i], crctab[i+1], (i == 254) ? "" : ",");
+    }
+    printf("};\n\n");
+
+    printf("# perl\n");
+    printf("@crc64_tab = (\n");
+    for (i = 0; i < 256; i += 2) {
+       printf("    [0x%08"PRIx32", 0x%08"PRIx32"], "
+              "[0x%08"PRIx32", 0x%08"PRIx32"]%-1s    # %02x\n",
+              (uint32_t)(crctab[i] >> 32),
+              (uint32_t)(crctab[i]),
+              (uint32_t)(crctab[i+1] >> 32),
+              (uint32_t)(crctab[i+1]),
+              (i == 254) ? "" : ",",
+              i);
+    }
+    printf(");\n");
+
+    return 0;
+}
diff --git a/misc/exebin.mac b/misc/exebin.mac
new file mode 100644 (file)
index 0000000..8d1eaf8
--- /dev/null
@@ -0,0 +1,57 @@
+; -*- nasm -*-
+; NASM macro file to allow the `bin' output format to generate
+; simple .EXE files by constructing the EXE header by hand.
+; Adapted from a contribution by Yann Guidon <whygee_corp@hol.fr>
+
+%define EXE_stack_size EXE_realstacksize
+
+%macro EXE_begin 0
+         ORG 0E0h
+         section .text
+
+header_start:
+         db 4Dh,5Ah            ; EXE file signature
+         dw EXE_allocsize % 512
+         dw (EXE_allocsize + 511) / 512
+         dw 0                  ; relocation information: none
+         dw (header_end-header_start)/16 ; header size in paragraphs
+         dw (EXE_absssize + EXE_realstacksize) / 16 ; min extra mem
+         dw (EXE_absssize + EXE_realstacksize) / 16 ; max extra mem
+         dw -10h               ; Initial SS (before fixup)
+         dw EXE_endbss + EXE_realstacksize ; Initial SP (1K DPMI+1K STACK)
+         dw 0                  ; (no) Checksum
+         dw 100h               ; Initial IP - start just after the header
+         dw -10h               ; Initial CS (before fixup)
+         dw 0                  ; file offset to relocation table: none
+         dw 0                  ; (no overlay)
+         align 16,db 0
+header_end:
+
+EXE_startcode:
+         section .data
+EXE_startdata:
+         section .bss
+EXE_startbss:
+%endmacro
+
+%macro EXE_stack 1
+EXE_realstacksize equ %1
+%define EXE_stack_size EXE_bogusstacksize ; defeat EQU in EXE_end
+%endmacro
+
+%macro EXE_end 0
+         section .text
+EXE_endcode:
+         section .data
+EXE_enddata:
+         section .bss
+         alignb 4
+EXE_endbss:
+
+EXE_acodesize equ (EXE_endcode-EXE_startcode+3) & (~3)
+EXE_datasize equ EXE_enddata-EXE_startdata
+EXE_absssize equ (EXE_endbss-EXE_startbss+3) & (~3)
+EXE_allocsize equ EXE_acodesize + EXE_datasize
+
+EXE_stack_size equ 0x800       ; default if nothing else was used
+%endmacro
diff --git a/misc/exebin2.mac b/misc/exebin2.mac
new file mode 100644 (file)
index 0000000..89c6889
--- /dev/null
@@ -0,0 +1,114 @@
+; -*- nasm -*-
+
+; NASM macro file to allow the `bin' output format to generate
+
+; simple .EXE files by constructing the EXE header by hand.
+
+; Adapted from a contribution by Yann Guidon <whygee_corp@hol.fr>
+
+
+
+%define EXE_stack_size EXE_realstacksize
+
+
+
+%macro EXE_begin 0
+
+         ORG 0E0h
+
+         section .text
+
+
+
+header_start:
+
+         db 4Dh,5Ah            ; EXE file signature
+
+         dw EXE_allocsize % 512
+
+         dw (EXE_allocsize + 511) / 512
+
+         dw 0                  ; relocation information: none
+
+         dw (header_end-header_start)/16 ; header size in paragraphs
+
+         dw (EXE_absssize + EXE_realstacksize) / 16 ; min extra mem
+
+         dw (EXE_absssize + EXE_realstacksize) / 16 ; max extra mem
+
+         dw -10h               ; Initial SS (before fixup)
+
+         dw EXE_endbss + EXE_realstacksize ; Initial SP (1K DPMI+1K STACK)
+
+         dw 0                  ; (no) Checksum
+
+         dw 100h               ; Initial IP - start just after the header
+
+         dw -10h               ; Initial CS (before fixup)
+
+         dw 0                  ; file offset to relocation table: none
+
+         dw 0                  ; (no overlay)
+
+         align 16,db 0
+
+header_end:
+
+
+
+EXE_startcode:
+
+         section .data
+
+EXE_startdata:
+
+         section .bss
+
+EXE_startbss:
+
+%endmacro
+
+
+
+%macro EXE_stack 1
+
+EXE_realstacksize equ %1
+
+%define EXE_stack_size EXE_bogusstacksize ; defeat EQU in EXE_end
+
+%endmacro
+
+
+
+%macro EXE_end 0
+
+         section .text
+
+EXE_endcode:
+
+         section .data
+
+EXE_enddata:
+
+         section .bss
+
+         alignb 4
+
+EXE_endbss:
+
+
+
+EXE_acodesize equ (EXE_endcode-EXE_startcode+3) & (~3)
+
+EXE_datasize equ EXE_enddata-EXE_startdata
+
+EXE_absssize equ (EXE_endbss-EXE_startbss+3) & (~3)
+
+EXE_allocsize equ EXE_acodesize + EXE_datasize
+
+
+
+EXE_stack_size equ 0x800       ; default if nothing else was used
+
+%endmacro
+
diff --git a/misc/findleak.pl b/misc/findleak.pl
new file mode 100755 (executable)
index 0000000..dbb3367
--- /dev/null
@@ -0,0 +1,42 @@
+#!/usr/bin/perl
+# From: Ed Beroset <beroset@mindspring.com>
+
+my %mem = {};
+my %alloc = {};
+while(<>)
+{
+        if (/realloc\((0x[0-9a-f]+).*\).*returns \((0x[0-9a-f]+)/)
+        {
+                $mem{$1}--;
+                if ($mem{$1} != 0) {
+                        print "free before alloc! $_";
+                }
+                if ($mem{$2} != 0) {
+                        print "memory leak! $_";
+                }
+                $mem{$2}++;
+                $alloc{$2} = $_;
+        }
+        elsif (/free\((0x[0-9a-f]+)/)
+        {
+                $mem{$1}--;
+                if ($mem{$1} != 0) {
+                        print "free before alloc! $_";
+                }
+        }
+        elsif (m/returns (0x[0-9a-f]+)/)
+        {
+                if ($mem{$1} != 0) {
+                        print "memory leak! $_";
+                }
+                $mem{$1}++;
+                $alloc{$1} = $_;
+        }
+}
+foreach $goo (sort keys %mem)
+{
+        if ($mem{$goo})
+        {
+                print "$mem{$goo} $alloc{$goo}";
+        }
+}
diff --git a/misc/findleak.txt b/misc/findleak.txt
new file mode 100644 (file)
index 0000000..8a1cfdc
--- /dev/null
@@ -0,0 +1,59 @@
+Subject: [nasm-devel] tool to help find memory leaks
+Date: Fri, 02 Nov 2001 22:08:01 -0500
+From: Ed Beroset <beroset@mindspring.com>
+Reply-To: nasm-devel@yahoogroups.com
+To: nasm-devel@yahoogroups.com
+
+Here's a little Perl script I wrote a while ago to help track down memory
+leaks in nasm.  First, compile nasm with LOGALLOC defined (see
+nasmlib.c).  That creates a log file of all allocs and frees.  This Perl
+script reads that file and tells you which source code lines caused a leak
+(or a free of unallocated memory).  There are many leaks, almost all of
+them in the preprocessor.
+
+-+--- findleak.pl begins
+#!/usr/bin/perl
+my %mem = {};
+my %alloc = {};
+while(<>)
+{
+        if (/realloc\((0x[0-9a-f]+).*\).*returns \((0x[0-9a-f]+)/)
+        {
+                $mem{$1}--;
+                if ($mem{$1} != 0) {
+                        print "free before alloc! $_";
+                }
+                if ($mem{$2} != 0) {
+                        print "memory leak! $_";
+                }
+                $mem{$2}++;
+                $alloc{$2} = $_;
+        }
+        elsif (/free\((0x[0-9a-f]+)/)
+        {
+                $mem{$1}--;
+                if ($mem{$1} != 0) {
+                        print "free before alloc! $_";
+                }
+        }
+        elsif (m/returns (0x[0-9a-f]+)/)
+        {
+                if ($mem{$1} != 0) {
+                        print "memory leak! $_";
+                }
+                $mem{$1}++;
+                $alloc{$1} = $_;
+        }
+}
+foreach $goo (sort keys %mem)
+{
+        if ($mem{$goo})
+        {
+                print "$mem{$goo} $alloc{$goo}";
+        }
+}
+-+--- findleak.pl ends
+
+
+
+Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
diff --git a/misc/fmtinsns.pl b/misc/fmtinsns.pl
new file mode 100755 (executable)
index 0000000..848ee2d
--- /dev/null
@@ -0,0 +1,40 @@
+#!/usr/bin/perl
+#
+# Re-align the columns in insns.dat, and enforce case conventions
+#
+
+@cols = (0, 16, 48, 96);
+
+while ($line = <STDIN>) {
+    chomp $line;
+    if ($line !~ /^\s*(\;.*|)$/) {
+       ($ln = $line) =~ s/\s+$//;
+       if ($line =~ /^\s*(\S+)\s+(\S+)\s+(\S+|\[.*\])\s+(\S+)\s*$/) {
+           @fields = ($1, $2, $3, $4);
+           $fields[0] = "\U$fields[0]" unless ($fields[0] =~ /^[^a-z]+cc$/);
+           $fields[3] =~ s/\,+$//;
+           $fields[3] = "\U$fields[3]" unless ($fields[3] eq 'ignore');
+           $c = 0;
+           $line = '';
+           for ($i = 0; $i < scalar(@fields); $i++) {
+               if ($i > 0 && $c >= $cols[$i]) {
+                   $line .= ' ';
+                   $c++;
+               }       
+               while ($c < $cols[$i]) {
+                   $line .= "\t";
+                   $c = ($c+8) & ~7;
+               }
+               $line .= $fields[$i];
+               for ($j = 0; $j < length($fields[$i]); $j++) {
+                   if (substr($fields[$i], $j, 1) eq "\t") {
+                       $c = ($c+8) & ~7;
+                   } else {
+                       $c++;
+                   }
+               }
+           }
+       }
+    }
+    print $line, "\n";
+}
diff --git a/misc/genfma.pl b/misc/genfma.pl
new file mode 100755 (executable)
index 0000000..2b6a65c
--- /dev/null
@@ -0,0 +1,63 @@
+#!/usr/bin/perl
+%packed_insns = (
+    'vfmadd'    => 0x98,
+    'vfmaddsub' => 0x96,
+    'vfmsubadd' => 0x97,
+    'vfmsub'    => 0x9a,
+    'vfnmadd'   => 0x9c,
+    'vfnmsub'   => 0x9e
+    );
+
+%scalar_insns = (
+    'vfmadd'    => 0x99,
+    'vfmsub'    => 0x9b,
+    'vfnmadd'   => 0x9d,
+    'vfnmsub'   => 0x9f
+    );
+
+foreach $pi ( sort(keys(%packed_insns)) ) {
+    $op = $packed_insns{$pi};
+    foreach $order ('132', '213', '231') {
+       $xorder = substr($order,1,1).substr($order,0,1).substr($order,2,1);
+       foreach $o ($order, $xorder) {
+           for ($w = 0; $w < 2; $w++) {
+               $suf = $w  ? 'pd' : 'ps';
+               for ($l = 128; $l <= 256; $l <<= 1) {
+                   $sx  = ($l == 256) ? 'SY' : 'SO';
+                   $mm  = ($l == 256) ? 'ymm' : 'xmm';
+                   printf "%-15s %-31s %-8s%-39s %s\n",
+                       "\U${pi}${o}${suf}",
+                       "${mm}reg,${mm}reg,${mm}rm",
+                       "[rvm:",
+                       sprintf("vex.dds.%d.66.0f38.w%d %02x /r]",
+                           $l, $w, $op),
+                   "FMA,FUTURE,${sx}";
+               }
+           }
+       }
+       $op += 0x10;
+    }
+}
+
+foreach $si ( sort(keys(%scalar_insns)) ) {
+    $op = $scalar_insns{$si};
+    foreach $order ('132', '213', '231') {
+       $xorder = substr($order,1,1).substr($order,0,1).substr($order,2,1);
+       foreach $o ($order, $xorder) {
+           for ($w = 0; $w < 2; $w++) {
+               $suf = $w ? 'sd' : 'ss';
+               $sx  = $w ? 'SQ' : 'SD';
+               $l  = 128;
+               $mm  = 'xmm';
+               printf "%-15s %-31s %-8s%-39s %s\n",
+                   "\U${si}${o}${suf}",
+                   "${mm}reg,${mm}reg,${mm}rm",
+                   '[rvm:',
+                   sprintf("vex.dds.%d.66.0f38.w%d %02x /r]",
+                       $l, $w, $op),
+               "FMA,FUTURE,${sx}";
+           }
+       }
+       $op += 0x10;
+    }
+}
diff --git a/misc/hints.txt b/misc/hints.txt
new file mode 100644 (file)
index 0000000..576e1cf
--- /dev/null
@@ -0,0 +1,26 @@
+Subject: Re: [nasm-devel] P4 insns
+Date: Sat, 05 May 2001 11:39:36 -0500
+From: Kyle Markley <kmarkley@seffera.net>
+Reply-To: nasm-devel@yahoogroups.com
+To: nasm-devel@yahoogroups.com
+
+berkus wrote:
+>
+> Use The Source, NASM!
+>
+> Do we have the P4 'probable branch taken' (3e) and 'probable branch
+> not taken' (2e) prefixes opcodes?
+
+They're just segment override prefixes: 2e is CS, 3e is DS.  You can just
+say
+"cs jnz foo" for a not-taken hint, "ds jnz foo" for a taken hint.
+
+Maybe it would be nice to have a more suggestive name, but you could just
+%define one.
+
+---
+Kyle Markley
+
+
+
+Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
diff --git a/misc/magic b/misc/magic
new file mode 100644 (file)
index 0000000..0172f4a
--- /dev/null
@@ -0,0 +1,6 @@
+# Put the following lines in your /etc/magic file to get 'file' to recognise
+# RDOFF Object Files
+
+0       string          RDOFF           RDOFF Object File
+>5      byte            >32             version %c (little endian)
+>5      byte            <32             version %d (big endian)
diff --git a/misc/makedist.sh b/misc/makedist.sh
new file mode 100755 (executable)
index 0000000..3027196
--- /dev/null
@@ -0,0 +1,71 @@
+#!/bin/sh
+# * THIS SCRIPT IS OBSOLETE DO NOT USE *
+MAJORVER=`grep NASM_MAJOR_VER nasm.h | head -1 | cut -f3 -d' '`
+MINORVER=`grep NASM_MINOR_VER nasm.h | head -1 | cut -f3 -d' '`
+VERSION=`grep NASM_VER nasm.h | head -1 | cut -f3 -d' ' | sed s/\"//g`
+DOSVERSION="${MAJORVER}${MINORVER}"
+NASM_TAR_GZ=dist/nasm-${VERSION}.tar.gz
+NASM_ZIP=dist/nasm${DOSVERSION}s.zip
+NASM_DOS_ZIP=dist/nasm${DOSVERSION}.zip
+NASM_DOC_ZIP=dist/nasm${DOSVERSION}d.zip
+
+if [ -d dist ]; then rm -rf dist; fi
+if [ -d nasm-${VERSION} ]; then rm -rf nasm-${VERSION}; fi
+if [ ! -d dist ]; then mkdir dist; fi
+if [ -f dist/nasm.tar.gz ]; then rm dist/nasm.tar.gz; fi
+mkdir nasm-${VERSION}
+(cd nasm-${VERSION}; ln -s ../* .;
+ rm -f nasm-${VERSION} dist Checklist GNUmakefile)
+find nasm-${VERSION}/ -follow -name GNUmakefile > tar-exclude
+find nasm-${VERSION}/ -follow -name RCS >> tar-exclude
+find nasm-${VERSION}/ -follow -name '*.exe' >> tar-exclude
+find nasm-${VERSION}/ -follow -name '*.uu' >> tar-exclude
+find nasm-${VERSION}/ -follow -name '*,v' >> tar-exclude
+for i in nasm-${VERSION}/doc/{nasmdoc.hpj,nasmdoc.rtf,nasmdoc.texi,Readme};
+  do echo $i; done >> tar-exclude
+tar chvfX dist/nasm-${VERSION}.tar tar-exclude nasm-${VERSION}
+rm -f tar-exclude
+tar tf dist/nasm-${VERSION}.tar | (echo nasm.doc; sed \
+  -e 's:^nasm-[^/]*/::' \
+  -e 's:/$::' \
+  -e '/install-sh/d' \
+  -e '/makedist\.sh/d' \
+  -e '/exasm\.zip/d' \
+  -e '/config/d' \
+  -e '/doc\/.*\.html/d' \
+  -e '/doc\/Readme/d' \
+  -e '/doc\/nasmdoc\.ps/d' \
+  -e '/doc\/nasmdoc\.txt/d' \
+  -e '/doc\/nasmdoc\.rtf/d' \
+  -e '/doc\/nasmdoc\.hpj/d' \
+  -e '/doc\/nasmdoc\.texi/d' \
+  -e '/doc\/nasmdoc\.hlp/d' \
+  -e '/doc\/nasm\.info/d' \
+  ) | sort > zipfiles
+sed \
+  -e '/^[^\/]*\.\(c\|h\|pl\|bas\|dat\)$/d' \
+  -e '/^doc\(\/.*\)\?/d' \
+  -e '/standard\.mac/d' \
+  -e '/Makefile/d' \
+  -e '/rdoff/d' \
+  < zipfiles > zipfiles.dos
+gzip -9 dist/nasm-${VERSION}.tar
+rm -rf nasm-${VERSION}
+ln -s doc/nasmdoc.src nasm.doc
+zip -l -k ${NASM_ZIP} `cat zipfiles`
+zip -k ${NASM_ZIP} *.exe misc/exasm.zip
+zip -l -k ${NASM_DOS_ZIP} `cat zipfiles.dos`
+zip -k ${NASM_DOS_ZIP} *.exe misc/exasm.zip
+rm -f nasm.doc
+(cd doc; zip -l -k ../${NASM_DOC_ZIP} \
+  Readme \
+  nasmdoc.src rdsrc.pl inslist.pl \
+  nasmdoc.txt \
+  nasmdoc.ps \
+  *.html
+ zip -k ../${NASM_DOC_ZIP} \
+  nasmdoc.hlp \
+  nasm.info)
+rm -f zipfiles zipfiles.dos
+echo Distributions complete.
diff --git a/misc/myC32.mac b/misc/myC32.mac
new file mode 100644 (file)
index 0000000..e70fc82
--- /dev/null
@@ -0,0 +1,121 @@
+; NASM macro set to make interfacing to 32-bit programs easier
+; Also cool little macros to make NASM emulate some MASM things.
+;
+; Originally included in NASM.  Modifications by Peter Johnson, 1999.
+;
+
+%imacro proc 1                  ; begin a procedure definition
+%push proc
+          global %1
+%1:       push  ebp
+          mov   ebp, esp
+%assign %$arg 8
+;%assign %$argnum 0
+%define %$procname %1
+%endmacro
+
+%imacro arg 0-1 4               ; used with the argument name as a label
+%00       equ %$arg
+;%assign %$argnum %$argnum+1
+;.arg%$argnum   equ     %1
+%assign %$arg %1+%$arg
+%endmacro
+
+%imacro endproc 0
+%ifnctx proc
+%error Mismatched `endproc'/`proc'
+%else
+;        mov     esp, ebp
+;        pop     ebp
+%ifdef LEGACY_ENDPROC
+        ret
+%endif
+;__end_%$procname:               ; useful for calculating function size
+;          global %{$procname}_arglen
+;%{$procname}_arglen    equ     %$arg-8
+;%assign %$i 1
+;%rep %$argnum
+;          global %{$procname}_arg%$i
+;%{$procname}_arg%$i    equ     %{$procname}.arg%$i
+;%assign %$i %$i+1
+;%endrep
+%pop
+%endif
+%endmacro
+
+; redefine ret instructions for in-proc cases
+%imacro ret 0-1
+%ifnctx proc
+       ret     %1
+%else
+       mov     esp, ebp
+       pop     ebp
+       ret     %1
+%endif
+%endmacro
+
+%imacro retf 0-1
+%ifnctx proc
+       retf    %1
+%else
+       mov     esp, ebp
+       pop     ebp
+       retf    %1
+%endif
+%endmacro
+
+%imacro retn 0-1
+%ifnctx proc
+       retn    %1
+%else
+       mov     esp, ebp
+       pop     ebp
+       retn    %1
+%endif
+%endmacro
+
+; invoke calls a C function
+; defaults to word (16 bit) size parameters
+%macro invoke 1-*
+%rotate -1
+;%define invoketype word
+%rep (%0-1)
+;       %ifidni %1,dword
+;               %define invoketype dword
+;       %elifidni %1,word
+;               %define invoketype word
+;       %elifidni %1,byte
+;               %define invoketype byte
+;       %else
+        %ifidni %1, cs
+                o16 push %1
+        %elifidni %1, ds
+                o16 push %1
+        %elifidni %1, es
+                o16 push %1
+        %elifidni %1, fs
+                o16 push %1
+        %elifidni %1, gs
+                o16 push %1
+        %elifidni %1, word cs
+                o16 push %1
+        %elifidni %1, word ds
+                o16 push %1
+        %elifidni %1, word es
+                o16 push %1
+        %elifidni %1, word fs
+                o16 push %1
+        %elifidni %1, word gs
+                o16 push %1
+        %else
+                push %1
+        %endif
+;       %endif
+        %rotate -1
+%endrep
+call %1
+%if (%0!=1)
+        add esp, byte %{1}_arglen
+%endif
+%endmacro
+
diff --git a/misc/nasm.sl b/misc/nasm.sl
new file mode 100644 (file)
index 0000000..2ddb5c1
--- /dev/null
@@ -0,0 +1,320 @@
+% This file defines a NASM editor mode for the JED editor.
+% JED's home page is http://space.mit.edu/~davis/jed.html.
+%
+% To install, copy this file into your JED_LIBRARY directory
+% (/usr/local/jed/lib or C:\JED\LIB or whatever), then add the
+% following lines to your .jedrc or jed.rc file:
+%   autoload("nasm_mode", "nasm");
+%   add_mode_for_extension("nasm", "asm");
+% (you can of course replace "asm" with whatever file extension
+% you like to use for your NASM source files).
+
+variable Nasm_Instruction_Indent = 10;
+variable Nasm_Comment_Column = 33;
+variable Nasm_Comment_Space = 1;
+
+variable nasm_kw_2 = strcat("ahalaxbhblbpbtbxchclcscxdbdddhdidldqdsdtdwdxes",
+                           "fsgsinjajbjcjejgjljojpjsjzorsispssto");
+variable nasm_kw_3 = strncat("a16a32aaaaadaamaasadcaddandbsfbsrbtcbtrbtscbw",
+                            "cdqclccldclicmccmpcr0cr2cr3cr4cwddaadasdecdiv",
+                            "dr0dr1dr2dr3dr6dr7eaxebpebxecxediedxequesiesp",
+                            "farfldfsthltincintjaejbejgejlejmpjnajnbjncjne",
+                            "jngjnljnojnpjnsjnzjpejpolarldslealeslfslgslsl",
+                            "lssltrmm0mm1mm2mm3mm4mm5mm6mm7movmulnegnopnot",
+                            "o16o32outpopporrclrcrrepretrolrorrsmsalsarsbb",
+                            "segshlshrsmist0st1st2st3st4st5st6st7stcstdsti",
+                            "strsubtr3tr4tr5tr6tr7wrtxor", 9);
+variable nasm_kw_4 = strncat("arplbytecallcltscwdeemmsfabsfaddfbldfchsfcom",
+                            "fcosfdivfenifildfistfld1fldzfmulfnopfsinfstp",
+                            "fsubftstfxamfxchibtsidivimulinsbinsdinswint1",
+                            "int3intoinvdiretjcxzjnaejnbejngejnlelahflgdt",
+                            "lidtlldtlmswlocklongloopmovdmovqnearpandpopa",
+                            "popfpushpxorreperepzresbresdresqrestreswretf",
+                            "retnsahfsalcsetasetbsetcsetesetgsetlsetosetp",
+                            "setssetzsgdtshldshrdsidtsldtsmswtestumovverr",
+                            "verwwaitwordxaddxbtsxchg", 9);
+variable nasm_kw_5 = strncat("boundbswapcmovacmovbcmovccmovecmovgcmovlcmovo",
+                            "cmovpcmovscmovzcmpsbcmpsdcmpswcpuiddwordenter",
+                            "f2xm1faddpfbstpfclexfcomifcompfdisifdivpfdivr",
+                            "ffreefiaddficomfidivfimulfinitfistpfisubfldcw",
+                            "fldpifmulpfpremfptanfsavefsqrtfstcwfstswfsubp",
+                            "fsubrfucomfyl2xicebpint01iretdiretwjecxzleave",
+                            "lodsblodsdlodswloopeloopzmovsbmovsdmovswmovsx",
+                            "movzxoutsboutsdoutswpaddbpadddpaddwpandnpopad",
+                            "popawpopfdpopfwpslldpsllqpsllwpsradpsrawpsrld",
+                            "psrlqpsrlwpsubbpsubdpsubwpushapushfqwordrdmsr",
+                            "rdpmcrdtscrepnerepnzscasbscasdscaswsetaesetbe",
+                            "setgesetlesetnasetnbsetncsetnesetngsetnlsetno",
+                            "setnpsetnssetnzsetpesetposhortstosbstosdstosw",
+                            "timestwordwrmsrxlatb", 14);
+variable nasm_kw_6 = strncat("cmovaecmovbecmovgecmovlecmovnacmovnbcmovnc",
+                            "cmovnecmovngcmovnlcmovnocmovnpcmovnscmovnz",
+                            "cmovpecmovpofcmovbfcmovefcmovufcomipfcompp",
+                            "fdivrpficompfidivrfisubrfldenvfldl2efldl2t",
+                            "fldlg2fldln2fpatanfprem1frstorfscalefsetpm",
+                            "fstenvfsubrpfucomifucompincbininvlpgloopne",
+                            "loopnzpaddsbpaddswpmulhwpmullwpsubsbpsubsw",
+                            "pushadpushawpushfdpushfwsetnaesetnbesetnge",
+                            "setnlewbinvd", 9);
+variable nasm_kw_7 = strncat("cmovnaecmovnbecmovngecmovnlecmpxchgfcmovbe",
+                            "fcmovnbfcmovnefcmovnufdecstpfincstpfrndint",
+                            "fsincosfucomipfucomppfxtractfyl2xp1loadall",
+                            "paddusbpadduswpcmpeqbpcmpeqdpcmpeqwpcmpgtb",
+                            "pcmpgtdpcmpgtwpmaddwdpsubusbpsubusw", 5);
+variable nasm_kw_8 = "fcmovnbepackssdwpacksswbpackuswb";
+variable nasm_kw_9 = strcat("cmpxchg8bpunpckhbwpunpckhdqpunpckhwdpunpcklbw",
+                           "punpckldqpunpcklwd");
+variable nasm_kw_10 = "cmpxchg486loadall286";
+
+define nasm_indent_line() {
+    variable word, len, e, c;
+
+    e = eolp();
+
+    push_spot();
+    EXIT_BLOCK {
+       pop_spot();
+       if (what_column() <= Nasm_Instruction_Indent)
+           skip_white();
+    }
+
+    bol_skip_white();
+    c = what_column();
+
+    if (orelse
+       {looking_at_char(';')}
+       {looking_at_char('#')}
+       {looking_at_char('[')}) {
+       bol_trim();
+       pop_spot();
+       EXIT_BLOCK {
+       }
+       return;
+    }
+
+    if (looking_at_char('%')) {
+       go_right_1();
+       !if (orelse
+           {looking_at_char('$')}
+           {looking_at_char('%')}
+           {looking_at_char('+')}
+           {looking_at_char('-')}
+           {looking_at_char('0')}
+           {looking_at_char('1')}
+           {looking_at_char('2')}
+           {looking_at_char('3')}
+           {looking_at_char('4')}
+           {looking_at_char('5')}
+           {looking_at_char('6')}
+           {looking_at_char('7')}
+           {looking_at_char('8')}
+           {looking_at_char('9')}) {
+           bol_trim();
+           pop_spot();
+           EXIT_BLOCK {
+           }
+           return;
+       }
+       go_left_1();
+    }
+
+    push_mark();
+    skip_chars("%$+-");
+    skip_chars("0-9a-zA-Z_.");
+    word = bufsubstr();
+
+    if (orelse
+       {c == 1}
+       {looking_at_char(':')}) {
+       push_spot();
+       bol_trim();
+       pop_spot();
+       len = strlen(word);
+       if (looking_at_char(':')) {
+           go_right_1();
+           len++;
+       }
+       trim();
+       if (e or not(eolp())) {
+           if (len >= Nasm_Instruction_Indent) {
+               pop();
+               whitespace(1);
+           } else
+               whitespace(Nasm_Instruction_Indent - len);
+           if (e) {
+               pop_spot();
+               eol();
+               push_spot();
+           }
+       }
+    } else {
+       bol_trim();
+       whitespace(Nasm_Instruction_Indent);
+    }
+}
+
+define nasm_newline_indent() {
+    push_spot();
+    bol_skip_white();
+    if (eolp())
+       trim();
+    pop_spot();
+    newline();
+    nasm_indent_line();
+}
+
+define nasm_bol_self_ins() {
+    push_spot();
+    bskip_white();
+    bolp();
+    pop_spot();
+
+    call("self_insert_cmd");
+
+    % Grotty: force immediate update of the syntax highlighting.
+    insert_char('.');
+    deln(left(1));
+
+    if (())
+       nasm_indent_line();
+}
+
+define nasm_self_ins_ind() {
+    call("self_insert_cmd");
+
+    % Grotty: force immediate update of the syntax highlighting.
+    insert_char('.');
+    deln(left(1));
+
+    nasm_indent_line();
+}
+
+define nasm_insert_comment() {
+    variable spc;
+
+    bol_skip_white();
+    if (looking_at_char(';')) {
+       bol_trim();
+       go_right(1);
+       skip_white();
+       return;
+    } else if (eolp()) {
+       bol_trim();
+       insert("; ");
+       return;
+    }
+
+    forever {
+       skip_chars("^;\n'\"");
+       if (looking_at_char('\'')) {
+           go_right_1();
+           skip_chars("^'\n");
+           !if (eolp())
+               go_right_1();
+       } else if (looking_at_char('\"')) {
+           go_right_1();
+           skip_chars("^\"\n");
+           !if (eolp())
+               go_right_1();
+       } else if (looking_at_char(';')) {
+           !if (bolp()) {
+               go_left_1();
+               trim();
+               !if (looking_at_char(';'))
+                   go_right_1();
+           }
+           break;
+       } else {
+           break;
+       }
+    }
+    spc = Nasm_Comment_Column - what_column();
+    if (spc < Nasm_Comment_Space)
+       spc = Nasm_Comment_Space;
+    whitespace(spc);
+    if (eolp()) {
+       insert("; ");
+    } else {
+       go_right_1();
+       skip_white();
+    }
+}
+
+$1 = "NASM";
+create_syntax_table($1);
+
+define_syntax (";", "", '%', $1);
+define_syntax ("([", ")]", '(', $1);
+define_syntax ('"', '"', $1);
+define_syntax ('\'', '\'', $1);
+define_syntax ("0-9a-zA-Z_.@#", 'w', $1);
+define_syntax ("-+0-9a-fA-F.xXL", '0', $1);
+define_syntax (",:", ',', $1);
+define_syntax ('%', '#', $1);
+define_syntax ("|^&<>+-*/%~", '+', $1);
+
+set_syntax_flags($1,1);
+
+#ifdef HAS_DFA_SYNTAX
+
+dfa_enable_highlight_cache("nasm.dfa", $1);
+dfa_define_highlight_rule(";.*$", "comment", $1);
+dfa_define_highlight_rule("[A-Za-z_\\.\\?][A-Za-z0-9_\\.\\?\\$#@~]*",
+                     "Knormal", $1);
+dfa_define_highlight_rule("$([A-Za-z_\\.\\?][A-Za-z0-9_\\.\\?\\$#@~]*)?",
+                     "normal", $1);
+dfa_define_highlight_rule("[0-9]+(\\.[0-9]*)?([Ee][\\+\\-]?[0-9]*)?",
+                     "number", $1);
+dfa_define_highlight_rule("[0-9]+[QqBb]", "number", $1);
+dfa_define_highlight_rule("(0x|\\$[0-9A-Fa-f])[0-9A-Fa-f]*", "number", $1);
+dfa_define_highlight_rule("[0-9A-Fa-f]+[Hh]", "number", $1);
+dfa_define_highlight_rule("\"[^\"]*\"", "string", $1);
+dfa_define_highlight_rule("\"[^\"]*$", "string", $1);
+dfa_define_highlight_rule("'[^']*'", "string", $1);
+dfa_define_highlight_rule("'[^']*$", "string", $1);
+dfa_define_highlight_rule("[\\(\\)\\[\\],:]*", "delimiter", $1);
+dfa_define_highlight_rule("^[ \t]*#", "PQpreprocess", $1);
+dfa_define_highlight_rule("^[ \t]*\\%{?[^%\\$\\+\\-0-9]", "PQpreprocess", $1);
+dfa_define_highlight_rule("^%$", "preprocess", $1);
+dfa_define_highlight_rule("[\\|\\^&<>\\+\\-\\*/%~]*", "operator", $1);
+dfa_define_highlight_rule("%([%\\$]?-?[0-9A-Za-z_\\.\\?\\$~@]+|{[^}]*}?)",
+                     "preprocess", $1);
+dfa_define_highlight_rule("[ \t]*", "normal", $1);
+dfa_define_highlight_rule(".", "normal", $1);
+dfa_build_highlight_table($1);
+#endif
+
+define_keywords_n($1, nasm_kw_2, 2, 0);
+define_keywords_n($1, nasm_kw_3, 3, 0);
+define_keywords_n($1, nasm_kw_4, 4, 0);
+define_keywords_n($1, nasm_kw_5, 5, 0);
+define_keywords_n($1, nasm_kw_6, 6, 0);
+define_keywords_n($1, nasm_kw_7, 7, 0);
+define_keywords_n($1, nasm_kw_8, 8, 0);
+define_keywords_n($1, nasm_kw_9, 9, 0);
+define_keywords_n($1, nasm_kw_10, 10, 0);
+
+define_keywords_n($1, "org", 3, 1);
+define_keywords_n($1, "bitsiend", 4, 1);
+define_keywords_n($1, "aligngroupstruc", 5, 1);
+define_keywords_n($1, "alignbcommonexternglobalistruc", 6, 1);
+define_keywords_n($1, "sectionsegmentlibrary", 7, 1);
+define_keywords_n($1, "absoluteendstruc", 8, 1);
+define_keywords_n($1, "uppercase", 9, 1);
+
+!if (keymap_p ($1)) make_keymap ($1);
+definekey("nasm_bol_self_ins", ";", $1);
+definekey("nasm_bol_self_ins", "#", $1);
+definekey("nasm_bol_self_ins", "%", $1);
+definekey("nasm_bol_self_ins", "[", $1);
+definekey("nasm_self_ins_ind", ":", $1);
+definekey("nasm_insert_comment", "^[;", $1);
+
+define nasm_mode() {
+    set_mode("NASM", 4);
+    use_keymap ("NASM");
+    use_syntax_table ("NASM");
+    set_buffer_hook ("indent_hook", "nasm_indent_line");
+    set_buffer_hook ("newline_indent_hook", "nasm_newline_indent");
+    runhooks("nasm_mode_hook");
+}
diff --git a/misc/nasmstab b/misc/nasmstab
new file mode 100644 (file)
index 0000000..32ef67e
--- /dev/null
@@ -0,0 +1,296 @@
+#!/usr/bin/perl
+sub StabLine  ($ $ $ $ $ $) {
+        local ($comment,$n_strx,$type,$other,$desc,$value) = @_;
+        print $comment;
+        print "","dd",$n_strx;
+        print "","db",$type;
+        print "","db",$other;
+        print "","dw",$desc;
+        print "","dd","0" . $value . "h";
+}
+
+sub RStabLine  ($ $ $ $ $) {
+        local ($comment,$offset,$info,$type,$symbol) = @_;
+        print $comment;
+        print "","dd",$offset;
+        print "","db",$type;
+        print "","db",$symbol;
+        print "","dw",$info;
+}
+
+#this sub exists because i've no idea how to print non-ascii numbers in perl
+
+sub OutBin ( $ $ ) {
+        local ($offset, $shnum) = @_;
+        seek(FINAL,$offset,0);
+        if ( $shnum == 2 ) { printf FINAL "\x02" } ;
+        if ( $shnum == 3 ) { printf FINAL "\x03" } ;
+        if ( $shnum == 4 ) { printf FINAL "\x04" } ;
+        if ( $shnum == 5 ) { printf FINAL "\x05" } ;
+        if ( $shnum == 6 ) { printf FINAL "\x06" } ;
+        if ( $shnum == 7 ) { printf FINAL "\x07" } ;
+        if ( $shnum == 8 ) { printf FINAL "\x08" } ;
+        if ( $shnum == 9 ) { printf FINAL "\x09" } ;
+        if ( $shnum == 10 ) { printf FINAL "\x0a" } ;
+        if ( $shnum == 11 ) { printf FINAL "\x0b" } ;
+        if ( $shnum == 12 ) { printf FINAL "\x0c" } ;
+        if ( $shnum == 13 ) { printf FINAL "\x0d" } ;
+        if ( $shnum == 14 ) { printf FINAL "\x0e" } ;
+        if ( $shnum == 15 ) { printf FINAL "\x0f" } ;
+}
+
+sub DispHelp () {
+        $\="\n";
+        print "Usage:";
+        print "\t-f,--input-file";
+        print "\t\tThe input file name (only required option)";
+        print "\t-o,--output-file";
+        print "\t\tThe output file name (if not specified, *.asm becomes *.o";
+        print "\t\tand anything else becomes a.out)";
+        print "\t-l,--list-file";
+        print "\t\tThe listing file's name (default: trailing .asm is
+removed";
+        print "\t\tif there and .lst is appended)";
+        print "\t-s,--second-asm-file";
+        print "\t\tThe second asm file's name (default: trailing .asm is";
+        print "\t\tremoved if there and .nasm is appended)";
+        print "\n";
+        exit ;
+}
+
+if ( $ARGV[0] eq "" ) { $ARGV[0] = "-h" };
+
+$i = 0;
+$filename = "";
+$outname  = "";
+
+while ( $ARGV[$i] ne "" ) {
+        $_ = $ARGV[$i];
+        if ( m/^-/ ) {
+                if ( m/^-f$/ ) { $filename = $ARGV[++$i] };
+                if ( m/^-o$/ ) { $outname  = $ARGV[++$i] };
+                if ( m/^-l$/ ) { $listname = $ARGV[++$i] };
+                if ( m/^-s$/ ) { $asmname  = $ARGV[++$i] };
+                if ( m/^-h$/ ) { DispHelp };
+        } elsif ( m/^--\w+/ ) {
+                if ( m/^--input-file$/ )      { $filename = $ARGV[++$i] };
+                if ( m/^--output-file$/ )     { $outname  = $ARGV[++$i] };
+                if ( m/^--list-file$/ )       { $listname = $ARGV[++$i] };
+                if ( m/^--second-asm-file$/ ) { $asmname  = $ARGV[++$i] };
+                if ( m/^--help/ ) { DispHelp };
+        } elsif ( m/^--$/ ) {
+                while ( $ARGV[++$i] ) {
+                        $NasmOptions .= " ";
+                        $NasmOptions .= $_;
+                };
+        } else {
+                DispHelp()
+        };
+        $i++;
+};
+
+if ( $filename eq "" ) { DispHelp() };
+
+if ( $outname eq "" ) {
+        $outname = $filename;
+        $outname =~ s/\.asm/.o/;
+        if ( $outname eq $filename ) { $outname = "a.out" };
+};
+
+if ( $listname eq "" ) {
+        $listname = $filename;
+        $listname =~ s/\.asm//;
+        $listname .= ".lst";
+};
+
+if ( $asmname eq "" ) {
+        $asmname = $filename;
+        $asmname =~ s/\.asm//;
+        $asmname .= ".nasm";
+};
+
+$err = `nasm -f elf ${filename} -l ${listname} -o ${outname} `;
+
+if ( $err ) { die "\n$err\n"};
+
+open(LISTFILE,"${listname}") or die "\n $0: Could not reopen list file!\n";
+open(ASMFILE,">${asmname}")  or die "\n $0: Could not open asm file!\n";
+
+select ASMFILE;
+
+open(OLDASM,$filename) or die "\n$0: Cannot open file $filename\n";
+
+while ( $x = <OLDASM> ) {
+        print $x;
+}
+
+@stab = ("n_desc", "value");
+@rel_stab = ("offset");
+$i = 0;
+$current_section = "";
+$has_text = 'FALSE';
+$midst_of_macro = 'FALSE';
+$line_dec = 0 ;
+
+while ( $x = <LISTFILE> ) {
+        if ( $x =~ m/[^;]*%include/ ) {
+                $x = <LISTFILE>;
+                while ( $x =~ m/\s+\d+\s+\<\d+\>\s+/ ) {
+                        $x = <LISTFILE>;
+                        $line_dec++;
+                }
+        }
+        if ( $current_section eq ".text" ) {
+                if ( $x =~ m/^\s+(\S+)\s+(\S+)\s+(\S+)\s+[^<]+$/ ) {
+                        $stab[$i++] = $1-$line_dec;     #linenum
+                        $stab[$i++] = $2;               #offset
+                        $count++;
+                        if ( $3 =~ m/-/ ) {
+                                $x = <LISTFILE>;
+                                $line_dec++;
+                        }
+                        $midst_of_macro = 'FALSE';
+                } elsif ( $x =~ m/^\s+(\S+)\s+(\S+)\s+(\S+)\s+<\d+>/ ) {
+                        if ( $midst_of_macro eq 'TRUE' ) {
+                                $stab[$i] = $stab[$i-2]; #same linenum
+                                $line_dec++;
+                        } else {
+                                $stab[$i] = $1 - ++$line_dec;
+                                $midst_of_macro = 'TRUE';
+                        }
+                        $count++;
+                        $i++;
+                        $stab[$i++] = $2;
+                        if ( $3 =~ m/-/ ) {
+                                $x = <LISTFILE>;
+                                $line_dec++;
+                        }
+
+                }
+                $has_text = 'TRUE';
+        } elsif ( $x =~ m/\s+\S+\s+\S+\s+\S+\s+<\d+>/ ) { # is it a macro?
+                $line_dec++;
+        }
+        if ( $x =~ s/(section|segment)\s+([^\s]+)/$2/ ) {
+                        $current_section = $2;
+        }
+};
+
+close LISTFILE;
+
+unless ( $has_text eq "TRUE" ) {
+        $err = `nasm -f elf ${asmname} -o ${outname}`;
+        print STDERR $err;
+        exit;
+}
+
+#Write Stab section
+$, = "\t";      #output field separator
+$\ = "\n";      #output record separator
+
+print "section .stab noalloc";
+StabLine(";header",1,0,0,$count+1,length($filename)*2+3);
+StabLine(";so",length($asmname)+2,"064h",0,0,0);
+
+$offset = 12;
+$i = 0;
+$j = 0;
+$rel_stab[$j++] = $offset + 8;
+
+while ( $stab[$i] ) {
+        StabLine(";N_SLINE" . " " . ( ($i+2) / 2 ), 0, "044h", 0,
+                $stab[$i++], $stab[$i++]);
+        $offset += 12;
+        $rel_stab[$j++] = $offset + 8;
+}
+
+#Write .rel.stab section
+print "\n\nsection .rel.stab noalloc";
+
+open (READELF,"readelf -s ${outname} |") or die "\n$0: Could not run readelf\n";
+
+while ( $x = <READELF> ) {
+   if ( $x =~ m/\s+(\d+):\s+00000000\s+\d+\s+SECTION\s+\w+\s+\w+\s+1\s+/){ $textsymnum = $1;
+   };
+};
+close READELF;
+
+$i = 0;
+
+while ( $rel_stab[$i] ne "" ) {
+        RStabLine(";relocation for N_SLINE " . ($i), $rel_stab[$i], 0, 1, $textsymnum);
+        $i++;
+} ;
+
+#Write .stabstr section
+
+print "\n\nsection .stabstr noalloc";
+
+print "","db","0";
+print "","db",'"' . $asmname . '"';
+print "","db","0";
+print "","db",'"' . $asmname . '"' ;
+print "","db","0";
+
+close ASMFILE;
+
+$err = `nasm -f elf ${asmname} -o ${outname}`;
+
+if ( $err ) { die "\n$err\n" } ;
+
+open (READELF,"readelf -h -S ${outname} |") or die "\n$0: Could not run readelf\n";
+
+
+while ( $x = <READELF> ) {
+        if ( $x =~ m/Start\s+of\s+section\s+headers:\s+(\d+)\s+/ ) {
+                $shoff = $1;
+        }
+        if ( $x =~ m/Size\s+of\s+section\s+headers:\s+(\d+)\s+/ ) {
+                $shentsize = $1;
+        }
+        if ( $x =~ m/\[\s*(\d+)\]\s+.rel.stab\s+/ ) {
+                $relnum = $1;
+        }
+        if ( $x =~ m/\[\s*(\d+)\]\s+.stab\s+/ ) {
+                $stabnum = $1;
+        }
+        if ( $x =~ m/\[\s*(\d+)\]\s+.stabstr\s+/ ) {
+                $stabstrnum = $1;
+        }
+        if ( $x =~ m/\[\s*(\d+)\]\s+.symtab\s+/ ) {
+                $symtabnum = $1;
+        }
+}
+close READELF;
+
+sysopen (FINAL,"${outname}",2,0) or die "\n$0: Could not open ${outname}";
+$, = "";        #output field separator
+$\ = "";        #output record separator
+
+#set .rel.stab->type to rel
+OutBin($shoff + ($shentsize * $relnum) + 4,9);
+
+#set .rel.stab->link to .symtab
+OutBin($shoff + ($shentsize * $relnum) + 24,$symtabnum);
+
+#set .rel.stab->info to .stab
+OutBin($shoff + ($shentsize * $relnum) + 28,$stabnum);
+
+#set .rel.stab->entsize to 8
+OutBin($shoff + ($shentsize * $relnum) + 36,8);
+
+#set .stab->link to .stabstr
+OutBin($shoff + ($shentsize * $stabnum) + 24,$stabstrnum);
+
+#set .stab->entsize to 12
+OutBin($shoff + ($shentsize * $stabnum) + 36,12);
+
+#set .stabstr->type to strtab
+OutBin($shoff + ($shentsize * $stabstrnum) + 4,3);
+
+close FINAL;
+
+#Date: 17 Mar 2002 15:51:20 -0800
+#From: kitsred@hotmail.com (kired)
+#Newsgroups: alt.lang.asm
diff --git a/misc/omfdump.c b/misc/omfdump.c
new file mode 100644 (file)
index 0000000..322971e
--- /dev/null
@@ -0,0 +1,223 @@
+/*
+ * omfdump.c
+ *
+ * Very simple program to dump the contents of an OMF (OBJ) file
+ *
+ * This assumes a littleendian, unaligned-load-capable host and a
+ * C compiler which handles basic C99.
+ */
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <inttypes.h>
+#include <ctype.h>
+#include <fcntl.h>
+#include <unistd.h>
+#include <sys/mman.h>
+#include <sys/stat.h>
+
+const char *progname;
+
+static const char *record_types[256] =
+{
+    [0x80] = "THEADR",
+    [0x82] = "LHEADR",
+    [0x88] = "COMENT",
+    [0x8a] = "MODEND16",
+    [0x8b] = "MODEND32",
+    [0x8c] = "EXTDEF",
+    [0x90] = "PUBDEF16",
+    [0x91] = "PUBDEF32",
+    [0x94] = "LINNUM16",
+    [0x95] = "LINNUM32",
+    [0x96] = "LNAMES",
+    [0x98] = "SEGDEF16",
+    [0x99] = "SEGDEF32",
+    [0x9a] = "GRPDEF",
+    [0x9c] = "FIXUPP16",
+    [0x9d] = "FIXUPP32",
+    [0xa0] = "LEDATA16",
+    [0xa1] = "LEDATA32",
+    [0xa2] = "LIDATA16",
+    [0xa3] = "LIDATA32",
+    [0xb0] = "COMDEF",
+    [0xb2] = "BAKPAT16",
+    [0xb3] = "BAKPAT32",
+    [0xb4] = "LEXTDEF",
+    [0xb6] = "LPUBDEF16",
+    [0xb7] = "LPUBDEF32",
+    [0xb8] = "LCOMDEF",
+    [0xbc] = "CEXTDEF",
+    [0xc2] = "COMDAT16",
+    [0xc3] = "COMDAT32",
+    [0xc4] = "LINSYM16",
+    [0xc5] = "LINSYM32",
+    [0xc6] = "ALIAS",
+    [0xc8] = "NBKPAT16",
+    [0xc9] = "NBKPAT32",
+    [0xca] = "LLNAMES",
+    [0xcc] = "VERNUM",
+    [0xce] = "VENDEXT",
+    [0xf0] = "LIBHDR",
+    [0xf1] = "LIBEND",
+};
+
+typedef void (*dump_func)(uint8_t, const uint8_t *, size_t);
+
+static void hexdump_data(unsigned int offset, const uint8_t *data, size_t n)
+{
+    unsigned int i, j;
+
+    for (i = 0; i < n; i += 16) {
+       printf("  %04x: ", i+offset);
+       for (j = 0; j < 16; j++) {
+           if (i+j < n)
+               printf("%02x%c", data[i+j], (j == 7) ? '-' : ' ');
+           else
+               printf("   ");
+       }
+       printf(" :  ");
+       for (j = 0; j < 16; j++) {
+           if (i+j < n)
+               putchar(isprint(data[i+j]) ? data[i+j] : '.');
+       }
+       putchar('\n');
+    }
+}
+
+static void dump_unknown(uint8_t type, const uint8_t *data, size_t n)
+{
+    (void)type;
+    hexdump_data(0, data, n);
+}
+
+static void dump_coment(uint8_t type, const uint8_t *data, size_t n)
+{
+    uint8_t class;
+    static const char *coment_class[256] = {
+       [0x00] = "Translator",
+       [0x01] = "Copyright",
+       [0x81] = "Library specifier",
+       [0x9c] = "MS-DOS version",
+       [0x9d] = "Memory model",
+       [0x9e] = "DOSSEG",
+       [0x9f] = "Library search",
+       [0xa0] = "OMF extensions",
+       [0xa1] = "New OMF extension",
+       [0xa2] = "Link pass separator",
+       [0xa3] = "LIBMOD",
+       [0xa4] = "EXESTR",
+       [0xa6] = "INCERR",
+       [0xa7] = "NOPAD",
+       [0xa8] = "WKEXT",
+       [0xa9] = "LZEXT",
+       [0xda] = "Comment",
+       [0xdb] = "Compiler",
+       [0xdc] = "Date",
+       [0xdd] = "Timestamp",
+       [0xdf] = "User",
+       [0xe9] = "Dependency file",
+       [0xff] = "Command line"
+    };
+
+    if (n < 2) {
+       dump_unknown(type, data, n);
+       return;
+    }
+
+    type  = data[0];
+    class = data[1];
+
+    printf("  [NP=%d NL=%d UD=%02X] %02X %s\n",
+          (type >> 7) & 1,
+          (type >> 6) & 1,
+          type & 0x3f,
+          class,
+          coment_class[class] ? coment_class[class] : "???");
+
+    hexdump_data(2, data+2, n-2);
+}
+
+static const dump_func dump_type[256] =
+{
+    [0x88] = dump_coment,
+};
+
+int dump_omf(int fd)
+{
+    struct stat st;
+    size_t len, n;
+    uint8_t type;
+    const uint8_t *p, *data;
+
+    if (fstat(fd, &st))
+       return -1;
+
+    len = st.st_size;
+
+    data = mmap(NULL, len, PROT_READ, MAP_PRIVATE, fd, 0);
+    if (data == MAP_FAILED)
+       return -1;
+
+    p = data;
+    while (len >= 3) {
+       uint8_t csum;
+       int i;
+
+       type = p[0];
+       n = *(uint16_t *)(p+1);
+
+       printf("%02x %-10s %4zd bytes",
+              type,
+              record_types[type] ? record_types[type] : "???",
+              n);
+
+       if (len < n+3) {
+           printf("\n  (truncated, only %zd bytes left)\n", len-3);
+           break;              /* Truncated */
+       }
+
+       p += 3;       /* Header doesn't count in the length */
+       n--;          /* Remove checksum byte */
+
+       csum = 0;
+       for (i = -3; i < (int)n; i++)
+           csum -= p[i];
+
+       printf(", checksum %02X", p[i]);
+       if (csum == p[i])
+           printf(" (valid)\n");
+       else
+           printf(" (actual = %02X)\n", csum);
+
+       if (dump_type[type])
+           dump_type[type](type, p, n);
+       else
+           dump_unknown(type, p, n);
+
+       p   += n+1;
+       len -= (n+4);
+    }
+
+    munmap((void *)data, st.st_size);
+    return 0;
+}
+
+int main(int argc, char *argv[])
+{
+    int fd;
+    int i;
+
+    progname = argv[0];
+
+    for (i = 1; i < argc; i++) {
+       fd = open(argv[i], O_RDONLY);
+       if (fd < 0 || dump_omf(fd)) {
+           perror(argv[i]);
+           return 1;
+       }
+       close(fd);
+    }
+
+    return 0;
+}
diff --git a/misc/pmw.bat b/misc/pmw.bat
new file mode 100644 (file)
index 0000000..88b67a5
--- /dev/null
@@ -0,0 +1,9 @@
+@echo off
+rem some batch file to bind nasm and ndisasm with pmode/w
+rem a mega cool dos extender for watcom done by tran
+rem 
+rem max 8 megs, dpmi stack 256*16=4096, no banner
+pmwlite.exe nasm.exe
+pmwsetup.exe /X8388608 /P256 /B0 nasm.exe
+pmwlite.exe ndisasm.exe
+pmwsetup.exe /X8388608 /P256 /B0 ndisasm.exe
diff --git a/misc/proc32.ash b/misc/proc32.ash
new file mode 100644 (file)
index 0000000..f513b73
--- /dev/null
@@ -0,0 +1,441 @@
+;--------=========xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=========--------
+;
+;   Copyright (C) 1999 by Andrew Zabolotny
+;   Miscelaneous NASM macros that makes use of new preprocessor features
+; 
+;   This library is free software; you can redistribute it and/or
+;   modify it under the terms of the GNU Library General Public
+;   License as published by the Free Software Foundation; either
+;   version 2 of the License, or (at your option) any later version.
+; 
+;   This library is distributed in the hope that it will be useful,
+;   but WITHOUT ANY WARRANTY; without even the implied warranty of
+;   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+;   Library General Public License for more details.
+; 
+;   You should have received a copy of the GNU Library General Public
+;   License along with this library; if not, write to the Free
+;   Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+;
+;--------=========xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=========--------
+
+;   The macros in this file provides support for writing 32-bit C-callable
+;   NASM routines. For a short description of every macros see the
+;   corresponding comment before every one. Simple usage example:
+;
+;      proc    sin,1
+;              targ    %$angle
+;              fld     %$angle
+;              fsin
+;      endproc sin
+
+%ifndef __PROC32_ASH__
+%define __PROC32_ASH__
+
+[WARNING -macro-selfref]
+
+;-----======xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx======-----
+; Summary:
+;   Mangle a name to be compatible with the C compiler
+; Arguments:
+;   The name
+; Example:
+;              cname (my_func)
+;-----======xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx======-----
+%ifdef EXTERNC_UNDERSCORE
+               %define cname(x) _ %+ x
+%else
+               %define cname(x) x
+%endif
+
+;-----======xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx======-----
+; Summary:
+;   Import an external C procedure definition
+; Arguments:
+;   The name of external C procedure
+; Example:
+;              cextern printf
+;-----======xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx======-----
+%macro         cextern 1
+               %xdefine %1 cname(%1)
+       %ifidni __OUTPUT_FORMAT__,obj
+               extern  %1:wrt FLAT
+       %else
+               extern  %1
+       %endif
+%endmacro
+
+;-----======xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx======-----
+; Summary:
+;   Export an C procedure definition
+; Arguments:
+;   The name of C procedure
+; Example:
+;              cglobal my_printf
+;-----======xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx======-----
+%macro         cglobal 1
+               %xdefine %1 cname(%1)
+               global  %1
+%endmacro
+
+;-----======xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx======-----
+; Summary:
+;   Misc macros to deal with PIC shared libraries
+; Comment:
+;   Note that we have a different syntax for working with and without
+;   PIC shared libraries. In a PIC environment we should load first
+;   the address of the variable into a register and then work through
+;   that address, i.e: mov eax,myvar; mov [eax],1
+;   In a non-PIC environment we should directly write: mov myvar,1
+; Example:
+;              extvar  myvar
+;              GetGOT
+;      %ifdef PIC
+;              mov     ebx,myvar       ; get offset of myvar into ebx
+;      %else
+;              lea     ebx,myvar
+;      %endif
+;-----======xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx======-----
+%ifdef PIC
+               cextern _GLOBAL_OFFSET_TABLE_
+       %macro  GetGOT  0
+               %ifdef .$proc.stkofs
+                       %assign .$proc.stkofs .$proc.stkofs+4
+               %endif
+               call    %$Get_GOT
+       %$Get_GOT:
+               pop     ebx
+               add     ebx,_GLOBAL_OFFSET_TABLE_ + $$ - %$Get_GOT wrt ..gotpc
+       %endmacro
+       %macro  extvar  1
+               cextern %1
+               %xdefine %1 [ebx+%1 wrt ..got]
+       %endmacro
+%else
+       %define GetGOT
+       %macro  extvar  1
+               cextern %1
+       %endmacro
+%endif
+
+;-----======xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx======-----
+; Summary:
+;   Begin a procedure definition
+;   For performance reasons we don't use stack frame pointer EBP,
+;   instead we're using the [esp+xx] addressing. Because of this
+;   you should be careful when you work with stack pointer.
+;   The push/pop instructions are macros that are defined to
+;   deal correctly with these issues.
+; Arguments:
+;   First argument - the procedure name
+;   Second optional argument - the number of bytes for local variables
+;   The following arguments could specify the registers that should be
+;   pushed at beginning of procedure and popped before exiting
+; Example:
+;   proc       MyTestProc
+;   proc       MyTestProc,4,ebx,esi,edi
+;-----======xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx======-----
+%macro         proc    1-3+ 0
+               cglobal %1
+               %push   %1
+               align   16
+%1:
+               %xdefine %$proc.name %1
+       ; total size of local arguments
+               %assign %$proc.locsize (%2+3) & 0xFFFC
+       ; offset from esp to argument
+               %assign %$proc.argofs 4+%$proc.locsize
+       ; additional offset to args (tracks push/pops)
+               %assign .$proc.stkofs 0
+       ; offset from esp to local arguments
+               %assign %$proc.locofs 0
+       ; Now push the registers that we should save
+               %define %$proc.save %3
+       %if %$proc.locsize != 0
+               sub     esp,%$proc.locsize
+       %endif
+               push    %$proc.save
+%endmacro
+
+;-----======xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx======-----
+; Summary:
+;   Declare an argument passed on stack
+;   This macro defines two additional macros:
+;     first (with the name given by first argument) - [esp+xx]
+;     second (with a underscore appended to first argument) - esp+xx
+; Arguments:
+;   First argument defines the procedure argument name
+;   Second optional parameter defines the size of the argument
+;   Default value is 4 (a double word)
+; Example:
+;              arg     .my_float
+;              arg     .my_double,8
+;-----======xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx======-----
+%macro         arg     1-2 4
+       %ifndef %$proc.argofs
+               %error  "`arg' not in a proc context"
+       %else
+       ; Trick: temporary undefine .$proc.stkofs so that it won't be expanded
+               %assign %%. .$proc.stkofs
+               %undef .$proc.stkofs
+               %xdefine %{1}_ esp+%$proc.argofs+.$proc.stkofs
+               %xdefine %1 [esp+%$proc.argofs+.$proc.stkofs]
+               %assign .$proc.stkofs %%.
+               %assign %$proc.argofs %2+%$proc.argofs
+       %endif
+%endmacro
+
+;-----======xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx======-----
+; Summary:
+;   Declare an local variable
+;     first (with the name given by first argument) - [esp+xx]
+;     second (with  a slash prefixing the first argument) - esp+xx
+; Arguments:
+;   First argument defines the procedure argument name
+;   Second optional parameter defines the size of the argument
+;   Default value is 4 (a double word)
+; Example:
+;              loc     .int_value
+;              loc     .double_value,8
+;-----======xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx======-----
+%macro         loc     1-2 4
+       %ifndef %$proc.locofs
+               %error  "`loc' not in a proc context"
+       %elif %$proc.locofs + %2 > %$proc.locsize
+               %error  "local stack space exceeded"
+       %else
+               %assign %%. .$proc.stkofs
+               %undef .$proc.stkofs
+               %xdefine %{1}_ esp+%$proc.locofs+.$proc.stkofs
+               %xdefine %1 [esp+%$proc.locofs+.$proc.stkofs]
+               %assign .$proc.stkofs %%.
+               %assign %$proc.locofs %$proc.locofs+%2
+       %endif
+%endmacro
+
+;-----======xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx======-----
+; Summary:
+;   Get the type of given size into context-local variable %$type
+; Arguments:
+;   Size of type we want (1,2,4,8 or 10)
+; Example:
+;              type    4       ; gives "dword"
+;              type    10      ; gives "tword"
+;-----======xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx======-----
+%macro         type    1
+       %if %1 = 1
+               %define %$type byte
+       %elif %1 = 2
+               %define %$type word
+       %elif %1 = 4
+               %define %$type dword
+       %elif %1 = 8
+               %define %$type qword
+       %elif %1 = 10
+               %define %$type tword
+       %else
+               %define %$. %1
+               %error "unknown type for argument size %$."
+       %endif
+%endmacro
+
+;-----======xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx======-----
+; Summary:
+;   Same as `arg' but prepends "word", "dword" etc (typed arg)
+;     first (with the name given by first argument) - dword [esp+xx]
+;     second (with  a slash prefixing the first argument) - esp+xx
+; Arguments:
+;   Same as for `arg'
+; Example:
+;              targ    .my_float       ; .my_float is now "dword [esp+xxx]"
+;              targ    .my_double,8    ; .my_double is now "qword [esp+xxx]"
+;-----======xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx======-----
+%macro         targ    1-2 4
+       %ifndef %$proc.argofs
+               %error  "`targ' not in a proc context"
+       %else
+               arg     %1,%2
+               type    %2
+               %assign %%. .$proc.stkofs
+               %undef .$proc.stkofs
+               %xdefine %1 %$type %1
+               %assign .$proc.stkofs %%.
+       %endif
+%endmacro
+
+;-----======xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx======-----
+; Summary:
+;   Same as `loc' but prepends "word", "dword" etc (typed loc)
+;     first (with the name given by first argument) - dword [esp+xx]
+;     second (with  a slash prefixing the first argument) - esp+xx
+; Arguments:
+;   Same as for `loc'
+; Example:
+;              tloc    int_value
+;              tloc    double_value,8
+;-----======xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx======-----
+%macro         tloc    1-2 4
+       %ifndef %$proc.locofs
+               %error  "`tloc' not in a proc context"
+       %else
+               loc     %1,%2
+               type    %2
+               %assign %%. .$proc.stkofs
+               %undef .$proc.stkofs
+               %xdefine %1 %$type %1
+               %assign .$proc.stkofs %%.
+       %endif
+%endmacro
+
+;-----======xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx======-----
+; Summary:
+;   Finish a procedure
+;   Gives an error if proc/endproc pairs mismatch
+;   Defines an label called __end_(procedure name)
+;   which is useful for calculating function size
+; Arguments:
+;   (optional) The name of procedure
+; Example:
+;   endproc    MyTestProc
+;-----======xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx======-----
+%push  tmp     ; trick: define a dummy context to avoid error in next line
+%macro         endproc 0-1 %$proc.name
+       %ifndef %$proc.argofs
+               %error "`endproc' not in a proc context"
+       %elifnidn %$proc.name,%1
+               %define %$. %1
+               %error "endproc names mismatch: expected `%$proc.name'"
+               %error "but got `%$.' instead"
+       %elif %$proc.locofs < %$proc.locsize
+               %error  "unused local space declared (used %$proc.locofs, requested %$proc.locsize)"
+       %else
+%$exit:
+       ; Now pop the registers that we should restore on exit
+               pop     %$proc.save
+               %if %$proc.locsize != 0
+               add     esp,%$proc.locsize
+               %endif
+               ret
+__end_%1:
+               %pop
+       %endif
+%endmacro
+%pop
+
+;-----======xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx======-----
+; Summary:
+;   A replacement for "push" for use within procedures
+; Arguments:
+;   any number of registers which will be push'ed successively
+; Example:
+;              push    eax,ebx,ecx,edx
+;-----======xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx======-----
+%macro         push    0-*
+; dummy comment to avoid problems with "push" on the same line with a label
+       %rep    %0
+               push    %1
+               %rotate 1
+               %assign .$proc.stkofs .$proc.stkofs+4
+       %endrep
+%endmacro
+
+;-----======xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx======-----
+; Summary:
+;   A replacement for "pop" for use within procedures
+; Arguments:
+;   any number of registers which will be pop'ed in reverse order
+; Example:
+;              pop     eax,ebx,ecx,edx
+;-----======xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx======-----
+%macro         pop     0-*
+; dummy comment to avoid problems with "pop" on the same line with a label
+       %rep    %0
+               %rotate -1
+               pop     %1
+               %assign .$proc.stkofs .$proc.stkofs-4
+       %endrep
+%endmacro
+
+;-----======xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx======-----
+; Summary:
+;   Replacements for "pushfd" and "popfd" that takes care of esp
+; Example:
+;              pushfd
+;              popfd
+;-----======xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx======-----
+%macro         pushfd  0
+               pushfd
+               %assign .$proc.stkofs .$proc.stkofs+4
+%endmacro
+%macro         popfd   0
+               popfd
+               %assign .$proc.stkofs .$proc.stkofs-4
+%endmacro
+
+;-----======xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx======-----
+; Summary:
+;   Exit from current procedure (optionally on given condition)
+; Arguments:
+;   Either none or a condition code
+; Example:
+;              exit
+;              exit    nz
+;-----======xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx======-----
+%macro         exit    0-1 mp
+               j%1     near %$exit
+%endmacro
+
+;-----======xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx======-----
+; Summary:
+;   start an conditional branch
+; Arguments:
+;   A condition code
+;   second (optional) argument - "short" (by default - "near")
+; Example:
+;              if      nz
+;-----======xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx======-----
+%macro         if      1-2 near
+; dummy comment to avoid problems with "if" on the same line with a label
+               %push   if
+               j%-1    %2 %$elseif
+%endmacro
+
+;-----======xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx======-----
+; Summary:
+;   define the "else" branch of a conditional statement
+; Arguments:
+;   optionaly: "short" if jmp to endif is less than 128 bytes away
+; Example:
+;              else
+;-----======xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx======-----
+%macro         else    0-1
+       %ifnctx if
+               %error  "`else' without matching `if'"
+       %else
+               jmp     %1 %$endif
+%$elseif:
+               %define %$elseif_defined
+       %endif
+%endmacro
+
+;-----======xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx======-----
+; Summary:
+;   Finish am conditional statement
+; Arguments:
+;   none
+; Example:
+;              endif
+;-----======xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx======-----
+%macro         endif   0
+       %ifnctx if
+               %error  "`endif' without matching `if'"
+       %else
+               %ifndef %$elseif_defined
+%$elseif:
+               %endif
+%$endif:
+               %pop
+       %endif
+%endmacro
+
+%endif ; __PROC32_ASH__
diff --git a/misc/release b/misc/release
new file mode 100755 (executable)
index 0000000..9b8cffa
--- /dev/null
@@ -0,0 +1,96 @@
+#!/bin/bash -xe
+#
+# Generate a NASM release
+#
+# Usage: release version [destination]
+#
+
+version="$1"
+if [ -z "$1" ]; then
+    echo "Usage: $0 version [destination]" 1>&2
+    exit 1
+fi
+
+WHERE="$2"
+if [ -z "$WHERE" ]; then
+    WHERE=/var/tmp
+fi
+
+if [ -n "$GIT_DIR" ]; then
+    HERE="$GIT_DIR"
+else
+    HERE=`pwd`
+fi
+
+if [ x`cat version` != x"${version}" ]; then
+    echo "${version}" > version
+    git update-index version
+    git commit -m "Version ${version}" -- version
+fi
+git tag -m "NASM version ${version}" -f "nasm-${version}" 
+
+cd "$WHERE"
+rm -rf nasm-release.*
+work=nasm-release.$$
+mkdir $work
+cd $work
+unset GIT_DIR
+git clone -s -l "$HERE" nasm
+rm -rf nasm/.git nasm/.gitignore
+
+# Create files which are in the release but automatically generated
+cd nasm
+./autogen.sh
+./configure --prefix=/usr/local
+make perlreq spec
+make alldeps
+make distclean
+cd ..
+
+# Clean up any previous attempt
+rm -f ../nasm-"$version".tar.gz  ../nasm-"$version"-xdoc.tar.gz
+rm -f ../nasm-"$version".tar.bz2 ../nasm-"$version"-xdoc.tar.bz2
+rm -f ../nasm-"$version".zip     ../nasm-"$version"-xdoc.zip
+
+# Create tarfile (Unix convention: file includes prefix)
+mv nasm nasm-"$version"
+tar cvvf  nasm-"$version".tar nasm-"$version"
+bzip2 -9k nasm-"$version".tar
+gzip -9   nasm-"$version".tar
+mv nasm-"$version".tar.gz nasm-"$version".tar.bz2 ..
+
+# Create zipfile (DOS convention: no prefix, convert file endings)
+cd nasm-"$version"
+zip -9Dlr ../../nasm-"$version".zip * -x \*.jpg -x \*.zip -x \*.ico    # Text files
+zip -9Dgr ../../nasm-"$version".zip * -i \*.jpg -i \*.zip -i \*.ico    # Binary files
+cd ..
+
+# Record what we have already generated
+find nasm-"$version" -not -type d -print > main
+
+# Create documentation
+cd nasm-"$version"
+./configure --prefix=/usr/local
+make doc
+# Remove intermediate files.
+make cleaner
+cd ..
+
+# Remove non-documentation
+cat main | xargs rm -f
+
+# Create doc tarfile
+tar cvvf nasm-"$version"-xdoc.tar nasm-"$version"/doc
+bzip2 -9k nasm-"$version"-xdoc.tar
+gzip -9   nasm-"$version"-xdoc.tar
+mv nasm-"$version"-xdoc.tar.gz nasm-"$version"-xdoc.tar.bz2 ..
+
+# Create doc zipfile (DOS convention: no prefix, convert file endings)
+# (Note: generating Win .hlp files requires additional tools)
+cd nasm-"$version"
+zip -9Dlr ../../nasm-"$version"-xdoc.zip doc -x \*.pdf -x \*.info\*
+zip -9Dgr ../../nasm-"$version"-xdoc.zip doc -i \*.pdf -i \*.info\*
+
+# Clean up
+cd ../..
+rm -rf "$work"
diff --git a/misc/scitech.mac b/misc/scitech.mac
new file mode 100644 (file)
index 0000000..26f85f4
--- /dev/null
@@ -0,0 +1,1223 @@
+;****************************************************************************
+;*
+;*  ========================================================================
+;*
+;*    The contents of this file are subject to the SciTech MGL Public
+;*    License Version 1.0 (the "License"); you may not use this file
+;*    except in compliance with the License. You may obtain a copy of
+;*    the License at http://www.scitechsoft.com/mgl-license.txt
+;*
+;*    Software distributed under the License is distributed on an
+;*    "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
+;*    implied. See the License for the specific language governing
+;*    rights and limitations under the License.
+;*
+;*    The Original Code is Copyright (C) 1991-1998 SciTech Software, Inc.
+;*
+;*    The Initial Developer of the Original Code is SciTech Software, Inc.
+;*    All Rights Reserved.
+;*
+;*  ========================================================================
+;*
+;* Language:    NetWide Assembler (NASM) or Turbo Assembler (TASM)
+;* Environment: Any Intel Environment
+;*
+;* Description: Macros to provide memory model independant assembly language
+;*              module for C programming. Supports the large and flat memory
+;*                             models.
+;*
+;*             The defines that you should use when assembling modules that
+;*                             use this macro package are:
+;*
+;*                                     __LARGE__       Assemble for 16-bit large model
+;*                  __FLAT__    Assemble for 32-bit FLAT memory model
+;*                  __NOU__            No underscore for all external C labels
+;*                                     __NOU_VAR__     No underscore for global variables only
+;*
+;*                             The default settings are for 16-bit large memory model with
+;*                             leading underscores for symbol names.
+;*
+;*                             The main intent of the macro file is to enable programmers
+;*                             to write _one_ set of source that can be assembled to run
+;*                             in either 16 bit real and protected modes or 32 bit
+;*                             protected mode without the need to riddle the code with
+;*                             'if flatmodel' style conditional assembly (it is still there
+;*                             but nicely hidden by a macro layer that enhances the
+;*                             readability and understandability of the resulting code).
+;*
+;****************************************************************************
+
+; Include the appropriate version in here depending on the assembler. NASM
+; appears to always try and parse code, even if it is in a non-compiling
+; block of a ifdef expression, and hence crashes if we include the TASM
+; macro package in the same header file. Hence we split the macros up into
+; two separate header files.
+
+ifdef __NASM_MAJOR__
+
+;============================================================================
+; Macro package when compiling with NASM.
+;============================================================================
+
+; Turn off underscores for globals if disabled for all externals
+
+%ifdef __NOU__
+%define        __NOU_VAR__
+%endif
+
+; Define the __WINDOWS__ symbol if we are compiling for any Windows
+; environment
+
+%ifdef __WINDOWS16__
+%define        __WINDOWS__                     1
+%endif
+%ifdef __WINDOWS32__
+%define __WINDOWS__                    1
+%define __WINDOWS32_386__      1
+%endif
+
+; Macros for accessing 'generic' registers
+
+%ifdef __FLAT__
+%idefine _ax   eax
+%idefine _bx   ebx
+%idefine _cx   ecx
+%idefine _dx   edx
+%idefine _si   esi
+%idefine _di   edi
+%idefine _bp   ebp
+%idefine _sp   esp
+%idefine _es
+%idefine UCHAR         BYTE            ; Size of a character
+%idefine USHORT WORD           ; Size of a short
+%idefine UINT  DWORD           ; Size of an integer
+%idefine ULONG         DWORD           ; Size of a long
+%idefine BOOL  DWORD           ; Size of a boolean
+%idefine DPTR  DWORD           ; Size of a data pointer
+%idefine FDPTR         FWORD           ; Size of a far data pointer
+%idefine NDPTR         DWORD           ; Size of a near data pointer
+%idefine CPTR  DWORD           ; Size of a code pointer
+%idefine FCPTR         FWORD           ; Size of a far code pointer
+%idefine NCPTR         DWORD           ; Size of a near code pointer
+%idefine FPTR  NEAR            ; Distance for function pointers
+%idefine DUINT dd                      ; Declare a integer variable
+%idefine intsize 4
+%idefine flatmodel 1
+%else
+%idefine _ax   ax
+%idefine _bx   bx
+%idefine _cx   cx
+%idefine _dx   dx
+%idefine _si   si
+%idefine _di   di
+%idefine _bp   bp
+%idefine _sp   sp
+%idefine _es   es:
+%idefine UCHAR         BYTE            ; Size of a character
+%idefine USHORT WORD           ; Size of a short
+%idefine UINT  WORD            ; Size of an integer
+%idefine ULONG         DWORD           ; Size of a long
+%idefine BOOL  WORD            ; Size of a boolean
+%idefine DPTR  DWORD           ; Size of a data pointer
+%idefine FDPTR         DWORD           ; Size of a far data pointer
+%idefine NDPTR         WORD            ; Size of a near data pointer
+%idefine CPTR  DWORD           ; Size of a code pointer
+%idefine FCPTR         DWORD           ; Size of a far code pointer
+%idefine NCPTR         WORD            ; Size of a near code pointer
+%idefine FPTR   FAR                    ; Distance for function pointers
+%idefine DUINT dw                      ; Declare a integer variable
+%idefine intsize 2
+%endif
+%idefine invert ~
+%idefine offset
+%idefine use_nasm
+
+; Convert all jumps to near jumps, since NASM does not so this automatically
+
+%idefine jo            jo near
+%idefine jno   jno near
+%idefine jz            jz near
+%idefine jnz   jnz near
+%idefine je            je near
+%idefine jne   jne near
+%idefine jb            jb      near
+%idefine jbe   jbe     near
+%idefine ja            ja      near
+%idefine jae   jae     near
+%idefine jl            jl      near
+%idefine jle   jle     near
+%idefine jg            jg      near
+%idefine jge   jge     near
+%idefine jc            jc      near
+%idefine jnc   jnc     near
+%idefine js            js      near
+%idefine jns   jns     near
+
+%ifdef DOUBLE
+%idefine       REAL    QWORD
+%idefine       DREAL   dq
+%else
+%idefine       REAL    DWORD
+%idefine       DREAL   dd
+%endif
+
+; Boolean truth values (same as those in debug.h)
+
+%idefine False         0
+%idefine True          1
+%idefine No                    0
+%idefine Yes           1
+%idefine Yes           1
+
+; Macro to be invoked at the start of all modules to set up segments for
+; later use. Does nothing for NASM.
+
+%imacro header 1
+%endmacro
+
+; Macro to begin a data segment
+
+%imacro begdataseg 1
+%ifdef __GNUC__
+segment .data public class=DATA use32 flat
+%else
+%ifdef flatmodel
+segment _DATA public align=4 class=DATA use32 flat
+%else
+segment _DATA public align=4 class=DATA use16
+%endif
+%endif
+%endmacro
+
+; Macro to end a data segment
+
+%imacro enddataseg 1
+%endmacro
+
+; Macro to begin a code segment
+
+%imacro begcodeseg 1
+%ifdef __GNUC__
+segment .text public class=CODE use32 flat
+%else
+%ifdef flatmodel
+segment _TEXT public align=16 class=CODE use32 flat
+%else
+segment %1_TEXT public align=16 class=CODE use16
+%endif
+%endif
+%endmacro
+
+; Macro to begin a near code segment
+
+%imacro begcodeseg_near 0
+%ifdef __GNUC__
+segment .text public class=CODE use32 flat
+%else
+%ifdef flatmodel
+segment _TEXT public align=16 class=CODE use32 flat
+%else
+segment _TEXT public align=16 class=CODE use16
+%endif
+%endif
+%endmacro
+
+; Macro to end a code segment
+
+%imacro endcodeseg 1
+%endmacro
+
+; Macro to end a near code segment
+
+%imacro endcodeseg_near 0
+%endmacro
+
+; Macro for an extern C symbol. If the C compiler requires leading
+; underscores, then the underscores are added to the symbol names, otherwise
+; they are left off. The symbol name is referenced in the assembler code
+; using the non-underscored symbol name.
+
+%imacro cextern 2
+%ifdef __NOU_VAR__
+extern %1
+%else
+extern _%1
+%define        %1 _%1
+%endif
+%endmacro
+
+%imacro cexternfunc 2
+%ifdef __NOU__
+extern %1
+%else
+extern _%1
+%define        %1 _%1
+%endif
+%endmacro
+
+; Macro for a public C symbol. If the C compiler requires leading
+; underscores, then the underscores are added to the symbol names, otherwise
+; they are left off. The symbol name is referenced in the assembler code
+; using the non-underscored symbol name.
+
+%imacro cpublic 1
+%ifdef __NOU_VAR__
+global %1
+%1:
+%else
+global _%1
+_%1:
+%define        %1 _%1
+%endif
+%endmacro
+
+; Macro for an global C symbol. If the C compiler requires leading
+; underscores, then the underscores are added to the symbol names, otherwise
+; they are left off. The symbol name is referenced in the assembler code
+; using the non-underscored symbol name.
+
+%imacro cglobal 1
+%ifdef __NOU_VAR__
+global %1
+%else
+global _%1
+%define        %1 _%1
+%endif
+%endmacro
+
+; Macro for an global C function symbol. If the C compiler requires leading
+; underscores, then the underscores are added to the symbol names, otherwise
+; they are left off. The symbol name is referenced in the assembler code
+; using the non-underscored symbol name.
+
+%imacro cglobalfunc 1
+%ifdef __NOU__
+global %1
+%else
+global _%1
+%define        %1 _%1
+%endif
+%endmacro
+
+; Macro to start a C callable function. This will be a far function for
+; 16-bit code, and a near function for 32-bit code.
+
+%imacro cprocstatic 1
+%push cproc
+%1:
+%ifdef flatmodel
+%stacksize flat
+%define ret    retn
+%else
+%stacksize large
+%define ret    retf
+%endif
+%assign %$localsize 0
+%endmacro
+
+%imacro cprocstart 1
+%push cproc
+       cglobalfunc %1
+%1:
+%ifdef flatmodel
+%stacksize flat
+%define ret    retn
+%else
+%stacksize large
+%define ret    retf
+%endif
+%assign %$localsize 0
+%endmacro
+
+; This macro sets up a procedure to be exported from a 16 bit DLL. Since the
+; calling conventions are always _far _pascal for 16 bit DLL's, we actually
+; rename this routine with an extra underscore with 'C' calling conventions
+; and a small DLL stub will be provided by the high level code to call the
+; assembler routine.
+
+%imacro        cprocstartdll16 1
+%ifdef __WINDOWS16__
+cprocstart     _%1
+%else
+cprocstart     %1
+%endif
+%endmacro
+
+; Macro to start a C callable near function.
+
+%imacro cprocnear 1
+%push cproc
+       cglobalfunc %1
+%1:
+%define ret    retn
+%ifdef flatmodel
+%stacksize flat
+%else
+%stacksize small
+%endif
+%assign %$localsize 0
+%endmacro
+
+; Macro to start a C callable far function.
+
+%imacro cprocfar 1
+%push cproc
+       cglobalfunc %1
+%1:
+%define ret    retf
+%ifdef flatmodel
+%stacksize flat
+%else
+%stacksize large
+%endif
+%assign %$localsize 0
+%endmacro
+
+; Macro to end a C function
+
+%imacro cprocend 0
+%pop
+%endmacro
+
+; Macros for entering and exiting C callable functions. Note that we must
+; always save and restore the SI and DI registers for C functions, and for
+; 32 bit C functions we also need to save and restore EBX and clear the
+; direction flag.
+
+%imacro enter_c 0
+               push    _bp
+               mov     _bp,_sp
+%ifnidn        %$localsize,0
+               sub             _sp,%$localsize
+%endif
+%ifdef flatmodel
+               push    ebx
+%endif
+               push    _si
+               push    _di
+%endmacro
+
+%imacro leave_c 0
+               pop             _di
+               pop             _si
+%ifdef flatmodel
+               pop             ebx
+               cld
+%endif
+%ifnidn %$localsize,0
+               mov     _sp,_bp
+%endif
+               pop     _bp
+%endmacro
+
+%imacro   use_ebx 0
+%ifdef flatmodel
+               push    ebx
+%endif
+%endmacro
+
+%imacro   unuse_ebx 0
+%ifdef flatmodel
+               pop     ebx
+%endif
+%endmacro
+
+; Macros for saving and restoring the value of DS,ES,FS,GS when it is to
+; be used in assembly routines. This evaluates to nothing in the flat memory
+; model, but is saves and restores DS in the large memory model.
+
+%imacro        use_ds 0
+%ifndef flatmodel
+               push    ds
+%endif
+%endmacro
+
+%imacro        unuse_ds 0
+%ifndef flatmodel
+               pop             ds
+%endif
+%endmacro
+
+%imacro        use_es 0
+%ifndef flatmodel
+               push    es
+%endif
+%endmacro
+
+%imacro        unuse_es 0
+%ifndef flatmodel
+               pop             es
+%endif
+%endmacro
+
+; Macros for loading the address of a data pointer into a segment and
+; index register pair. The %imacro explicitly loads DS or ES in the 16 bit
+; memory model, or it simply loads the offset into the register in the flat
+; memory model since DS and ES always point to all addressable memory. You
+; must use the correct _REG (ie: _BX) %imacros for documentation purposes.
+
+%imacro        _lds    2
+%ifdef flatmodel
+               mov     %1,%2
+%else
+               lds             %1,%2
+%endif
+%endmacro
+
+%imacro   _les 2
+%ifdef flatmodel
+               mov     %1,%2
+%else
+               les             %1,%2
+%endif
+%endmacro
+
+; Macros for adding and subtracting a value from registers. Two value are
+; provided, one for 16 bit modes and another for 32 bit modes (the extended
+; register is used in 32 bit modes).
+
+%imacro   _add 3
+%ifdef flatmodel
+               add             e%1, %3
+%else
+               add             %1, %2
+%endif
+%endmacro
+
+%imacro        _sub    3
+%ifdef flatmodel
+               sub             e%1, %3
+%else
+               sub             %1, %2
+%endif
+%endmacro
+
+; Macro to clear the high order word for the 32 bit extended registers.
+; This is used to convert an unsigned 16 bit value to an unsigned 32 bit
+; value, and will evaluate to nothing in 16 bit modes.
+
+%imacro        clrhi   1
+%ifdef flatmodel
+               movzx   e%1,%1
+%endif
+%endmacro
+
+%imacro        sgnhi   1
+%ifdef flatmodel
+               movsx   e%1,%1
+%endif
+%endmacro
+
+; Macro to load an extended register with an integer value in either mode
+
+%imacro        loadint 2
+%ifdef flatmodel
+               mov             e%1,%2
+%else
+               xor             e%1,e%1
+               mov     %1,%2
+%endif
+%endmacro
+
+; Macros to load and store integer values with string instructions
+
+%imacro        LODSINT 0
+%ifdef flatmodel
+               lodsd
+%else
+               lodsw
+%endif
+%endmacro
+
+%imacro        STOSINT 0
+%ifdef flatmodel
+               stosd
+%else
+               stosw
+%endif
+%endmacro
+
+; Macros to provide resb, resw, resd compatibility with NASM
+
+%imacro        dclb 1
+times %1 db 0
+%endmacro
+
+%imacro        dclw 1
+times %1 dw 0
+%endmacro
+
+%imacro        dcld 1
+times %1 dd 0
+%endmacro
+
+; macros to declare assembler function stubs for function structures
+
+%imacro        BEGIN_STUBS_DEF 2
+begdataseg  _STUBS
+%ifdef __NOU_VAR__
+extern %1
+%define        STUBS_START     %1
+%else
+extern _%1
+%define        STUBS_START     _%1
+%endif
+enddataseg  _STUBS
+begcodeseg  _STUBS
+%assign off %2
+%endmacro
+
+%imacro   DECLARE_STUB 1
+%ifdef __NOU__
+               global %1
+%1:
+%else
+               global _%1
+_%1:
+%endif
+               jmp     [DWORD STUBS_START+off]
+%assign off off+4
+%endmacro
+
+%imacro DECLARE_STDCALL 2
+%ifdef STDCALL_MANGLE
+               global _%1@%2
+_%1@%2:
+%else
+%ifdef __GNUC__
+               global _%1
+_%1:
+%else
+               global %1
+%1:
+%endif
+%endif
+               jmp     [DWORD STUBS_START+off]
+%assign off off+4
+%endmacro
+
+%imacro   END_STUBS_DEF 0
+endcodeseg  _STUBS
+%endmacro
+
+; macros to declare assembler import stubs for binary loadable drivers
+
+%imacro        BEGIN_IMPORTS_DEF       1
+BEGIN_STUBS_DEF        %1,4
+%endmacro
+
+%imacro   DECLARE_IMP  1
+DECLARE_STUB   %1
+%endmacro
+
+%imacro   END_IMPORTS_DEF 0
+END_STUBS_DEF
+%endmacro
+
+else   ; __NASM_MAJOR__
+
+;============================================================================
+; Macro package when compiling with TASM.
+;============================================================================
+
+; Turn off underscores for globals if disabled for all externals
+
+ifdef  __NOU__
+__NOU_VAR__                    = 1
+endif
+
+; Define the __WINDOWS__ symbol if we are compiling for any Windows
+; environment
+
+ifdef  __WINDOWS16__
+__WINDOWS__            = 1
+endif
+ifdef  __WINDOWS32__
+__WINDOWS__            = 1
+__WINDOWS32_386__      = 1
+endif
+ifdef  __WIN386__
+__WINDOWS__            = 1
+__WINDOWS32_386__      = 1
+endif
+ifdef  __VXD__
+__WINDOWS__            = 1
+__WINDOWS32_386__      = 1
+               MASM
+               .386
+               NO_SEGMENTS     = 1
+               include vmm.inc                 ; IGNORE DEPEND
+               include vsegment.inc    ; IGNORE DEPEND
+               IDEAL
+endif
+
+; Macros for accessing 'generic' registers
+
+ifdef   __FLAT__
+               _ax                     EQU     eax             ; EAX is used for accumulator
+               _bx                     EQU     ebx             ; EBX is used for accumulator
+               _cx             EQU ecx     ; ECX is used for looping
+               _dx                     EQU     edx             ; EDX is used for data register
+               _si                     EQU     esi             ; ESI is the source index register
+               _di                     EQU     edi             ; EDI is the destination index register
+               _bp                     EQU     ebp             ; EBP is used for base pointer register
+               _sp                     EQU     esp             ; ESP is used for stack pointer register
+               _es                     EQU                     ; ES and DS are the same in 32 bit PM
+               typedef UCHAR BYTE              ; Size of a character
+               typedef USHORT WORD             ; Size of a short
+               typedef UINT DWORD              ; Size of an integer
+               typedef ULONG DWORD             ; Size of a long
+               typedef BOOL DWORD      ; Size of a boolean
+               typedef DPTR DWORD              ; Size of a data pointer
+               typedef FDPTR FWORD             ; Size of a far data pointer
+               typedef NDPTR DWORD             ; Size of a near data pointer
+               typedef CPTR DWORD              ; Size of a code pointer
+               typedef FCPTR FWORD             ; Size of a far code pointer
+               typedef NCPTR DWORD             ; Size of a near code pointer
+               typedef DUINT DWORD             ; Declare a integer variable
+               FPTR        EQU NEAR    ; Distance for function pointers
+               intsize         =       4               ; Size of an integer
+               flatmodel       =       1               ; This is a flat memory model
+               P386                    ; Turn on 386 code generation
+               MODEL       FLAT        ; Set up for 32 bit simplified FLAT model
+else
+               _ax                     EQU     ax              ; AX is used for accumulator
+               _bx                     EQU     bx              ; BX is used for accumulator
+               _cx             EQU cx          ; CX is used for looping
+               _dx                     EQU     dx              ; DX is used for data register
+               _si                     EQU     si              ; SI is the source index register
+               _di                     EQU     di              ; DI is the destination index register
+               _bp                     EQU     bp              ; BP is used for base pointer register
+               _sp                     EQU     sp              ; SP is used for stack pointer register
+               _es                     EQU es:         ; ES is used for segment override
+               typedef UCHAR BYTE      ; Size of a character
+               typedef USHORT WORD             ; Size of a short
+               typedef UINT WORD               ; Size of an integer
+               typedef ULONG DWORD             ; Size of a long
+               typedef BOOL WORD               ; Size of a boolean
+               typedef DPTR DWORD              ; Size of a data pointer
+               typedef FDPTR DWORD             ; Size of a far data pointer
+               typedef NDPTR WORD              ; Size of a near data pointer
+               typedef CPTR DWORD              ; Size of a code pointer
+               typedef FCPTR DWORD             ; Size of a far code pointer
+               typedef NCPTR WORD              ; Size of a near code pointer
+               typedef DUINT WORD              ; Declare a integer variable
+               FPTR        EQU FAR             ; Distance for function pointers
+               intsize         =       2               ; Size of an integer
+               P386                                    ; Turn on 386 code generation
+endif
+        invert      EQU not
+
+; Provide a typedef for real floating point numbers
+
+ifdef  DOUBLE
+typedef        REAL    QWORD
+typedef        DREAL   QWORD
+else
+typedef        REAL    DWORD
+typedef        DREAL   DWORD
+endif
+
+; Macros to access the floating point stack registers to convert them
+; from NASM style to TASM style
+
+st0                    EQU             st(0)
+st1                    EQU             st(1)
+st2                    EQU             st(2)
+st3                    EQU             st(3)
+st4                    EQU             st(4)
+st5                    EQU             st(5)
+st6                    EQU             st(6)
+st7                    EQU             st(7)
+st8                    EQU             st(8)
+
+; Boolean truth values (same as those in debug.h)
+
+ifndef __VXD__
+False          =               0
+True           =               1
+No                     =               0
+Yes                    =               1
+Yes                    =               1
+endif
+
+; Macros for the _DATA data segment. This segment contains initialised data.
+
+MACRO   begdataseg name
+ifdef  __VXD__
+               MASM
+VXD_LOCKED_DATA_SEG
+               IDEAL
+else
+ifdef   flatmodel
+               DATASEG
+else
+SEGMENT _DATA DWORD PUBLIC USE16 'DATA'
+endif
+endif
+ENDM
+
+MACRO   enddataseg name
+ifdef  __VXD__
+               MASM
+VXD_LOCKED_DATA_ENDS
+               IDEAL
+else
+ifndef  flatmodel
+ENDS    _DATA
+endif
+endif
+ENDM
+
+; Macro for the main code segment.
+
+MACRO   begcodeseg name
+ifdef  __VXD__
+               MASM
+VXD_LOCKED_CODE_SEG
+               IDEAL
+else
+ifdef   flatmodel
+               CODESEG
+               ASSUME  CS:FLAT,DS:FLAT,SS:FLAT
+else
+SEGMENT &name&_TEXT PARA PUBLIC USE16 'CODE'
+               ASSUME CS:&name&_TEXT,DS:_DATA
+endif
+endif
+ENDM
+
+; Macro for a near code segment
+
+MACRO   begcodeseg_near
+ifdef   flatmodel
+               CODESEG
+               ASSUME  CS:FLAT,DS:FLAT,SS:FLAT
+else
+SEGMENT _TEXT PARA PUBLIC USE16 'CODE'
+               ASSUME CS:_TEXT,DS:_DATA
+endif
+ENDM
+
+MACRO   endcodeseg name
+ifdef  __VXD__
+               MASM
+VXD_LOCKED_CODE_ENDS
+               IDEAL
+else
+ifndef  flatmodel
+ENDS    &name&_TEXT
+endif
+endif
+ENDM
+
+MACRO   endcodeseg_near
+ifndef  flatmodel
+ENDS    _TEXT
+endif
+ENDM
+
+; Macro to be invoked at the start of all modules to set up segments for
+; later use.
+
+MACRO   header name
+begdataseg name
+enddataseg name
+ENDM
+
+; Macro for an extern C symbol. If the C compiler requires leading
+; underscores, then the underscores are added to the symbol names, otherwise
+; they are left off. The symbol name is referenced in the assembler code
+; using the non-underscored symbol name.
+
+MACRO   cextern        name,size
+ifdef  __NOU_VAR__
+               EXTRN   name:size
+else
+               EXTRN   _&name&:size
+name   EQU             _&name&
+endif
+ENDM
+
+MACRO   cexternfunc    name,size
+ifdef  __NOU__
+               EXTRN   name:size
+else
+               EXTRN   _&name&:size
+name   EQU             _&name&
+endif
+ENDM
+
+MACRO   stdexternfunc  name,args,size
+ifdef  STDCALL_MANGLE
+               EXTRN   _&name&@&num_args&:size
+name   EQU             _&name&@&num_args
+else
+               EXTRN   name:size
+endif
+ENDM
+
+; Macro for a public C symbol. If the C compiler requires leading
+; underscores, then the underscores are added to the symbol names, otherwise
+; they are left off. The symbol name is referenced in the assembler code
+; using the non-underscored symbol name.
+
+MACRO  cpublic name
+ifdef  __NOU_VAR__
+name:
+               PUBLIC  name
+else
+_&name&:
+               PUBLIC  _&name&
+name   EQU             _&name&
+endif
+ENDM
+
+; Macro for an global C symbol. If the C compiler requires leading
+; underscores, then the underscores are added to the symbol names, otherwise
+; they are left off. The symbol name is referenced in the assembler code
+; using the non-underscored symbol name.
+
+MACRO  cglobal name
+ifdef  __NOU_VAR__
+               PUBLIC  name
+else
+               PUBLIC  _&name&
+name   EQU             _&name&
+endif
+ENDM
+
+; Macro for an global C function symbol. If the C compiler requires leading
+; underscores, then the underscores are added to the symbol names, otherwise
+; they are left off. The symbol name is referenced in the assembler code
+; using the non-underscored symbol name.
+
+MACRO  cglobalfunc name
+ifdef  __NOU__
+               PUBLIC  name
+else
+               PUBLIC  _&name&
+name   EQU             _&name&
+endif
+ENDM
+
+; Macro to start a C callable function. This will be a far function for
+; 16-bit code, and a near function for 32-bit code.
+
+MACRO   cprocstatic name               ; Set up model independant private proc
+ifdef flatmodel
+PROC           name NEAR
+else
+PROC    name FAR
+endif
+LocalSize      = 0
+ENDM
+
+MACRO   cprocstart name                ; Set up model independant proc
+ifdef flatmodel
+ifdef  __NOU__
+PROC           name NEAR
+else
+PROC           _&name& NEAR
+endif
+else
+ifdef  __NOU__
+PROC    name FAR
+else
+PROC    _&name& FAR
+endif
+endif
+LocalSize      = 0
+               cglobalfunc     name
+ENDM
+
+MACRO   cprocnear name                 ; Set up near proc
+ifdef  __NOU__
+PROC    name NEAR
+else
+PROC    _&name& NEAR
+endif
+LocalSize      = 0
+               cglobalfunc     name
+ENDM
+
+MACRO   cprocfar name           ; Set up far proc
+ifdef  __NOU__
+PROC    name FAR
+else
+PROC    _&name& FAR
+endif
+LocalSize      = 0
+               cglobalfunc     name
+ENDM
+
+MACRO   cprocend                  ; End procedure macro
+ENDP
+ENDM
+
+; This macro sets up a procedure to be exported from a 16 bit DLL. Since the
+; calling conventions are always _far _pascal for 16 bit DLL's, we actually
+; rename this routine with an extra underscore with 'C' calling conventions
+; and a small DLL stub will be provided by the high level code to call the
+; assembler routine.
+
+MACRO   cprocstartdll16 name
+ifdef  __WINDOWS16__
+cprocstart     _&name&
+else
+cprocstart     name
+endif
+ENDM
+
+; Macros for entering and exiting C callable functions. Note that we must
+; always save and restore the SI and DI registers for C functions, and for
+; 32 bit C functions we also need to save and restore EBX and clear the
+; direction flag.
+
+MACRO  save_c_regs
+ifdef  flatmodel
+               push    ebx
+endif
+               push    _si
+               push    _di
+ENDM
+
+MACRO  enter_c
+               push    _bp
+               mov     _bp,_sp
+       IFDIFI  <LocalSize>,<0>
+               sub             _sp,LocalSize
+       ENDIF
+               save_c_regs
+ENDM
+
+MACRO  restore_c_regs
+               pop             _di
+               pop             _si
+ifdef  flatmodel
+               pop             ebx
+endif
+ENDM
+
+MACRO  leave_c
+               restore_c_regs
+               cld
+       IFDIFI  <LocalSize>,<0>
+               mov     _sp,_bp
+       ENDIF
+               pop     _bp
+ENDM
+
+MACRO   use_ebx
+ifdef flatmodel
+               push    ebx
+endif
+ENDM
+
+MACRO   unuse_ebx
+ifdef flatmodel
+               pop     ebx
+endif
+ENDM
+
+; Macros for saving and restoring the value of DS,ES,FS,GS when it is to
+; be used in assembly routines. This evaluates to nothing in the flat memory
+; model, but is saves and restores DS in the large memory model.
+
+MACRO  use_ds
+ifndef flatmodel
+               push    ds
+endif
+ENDM
+
+MACRO  unuse_ds
+ifndef flatmodel
+               pop             ds
+endif
+ENDM
+
+MACRO  use_es
+ifndef flatmodel
+               push    es
+endif
+ENDM
+
+MACRO  unuse_es
+ifndef flatmodel
+               pop             es
+endif
+ENDM
+
+; Macros for loading the address of a data pointer into a segment and
+; index register pair. The macro explicitly loads DS or ES in the 16 bit
+; memory model, or it simply loads the offset into the register in the flat
+; memory model since DS and ES always point to all addressable memory. You
+; must use the correct _REG (ie: _BX) macros for documentation purposes.
+
+MACRO  _lds    reg, addr
+ifdef flatmodel
+               mov     reg,addr
+else
+               lds             reg,addr
+endif
+ENDM
+
+MACRO   _les   reg, addr
+ifdef flatmodel
+               mov     reg,addr
+else
+               les             reg,addr
+endif
+ENDM
+
+; Macros for adding and subtracting a value from registers. Two value are
+; provided, one for 16 bit modes and another for 32 bit modes (the extended
+; register is used in 32 bit modes).
+
+MACRO   _add   reg, val16, val32
+ifdef flatmodel
+               add             e&reg&, val32
+else
+               add             reg, val16
+endif
+ENDM
+
+MACRO  _sub    reg, val16, val32
+ifdef flatmodel
+               sub             e&reg&, val32
+else
+               sub             reg, val16
+endif
+ENDM
+
+; Macro to clear the high order word for the 32 bit extended registers.
+; This is used to convert an unsigned 16 bit value to an unsigned 32 bit
+; value, and will evaluate to nothing in 16 bit modes.
+
+MACRO  clrhi   reg
+ifdef  flatmodel
+               movzx   e&reg&,reg
+endif
+ENDM
+
+MACRO  sgnhi   reg
+ifdef  flatmodel
+               movsx   e&reg&,reg
+endif
+ENDM
+
+; Macro to load an extended register with an integer value in either mode
+
+MACRO  loadint reg,val
+ifdef flatmodel
+               mov             e&reg&,val
+else
+               xor             e&reg&,e&reg&
+               mov     reg,val
+endif
+ENDM
+
+; Macros to load and store integer values with string instructions
+
+MACRO  LODSINT
+ifdef flatmodel
+               lodsd
+else
+               lodsw
+endif
+ENDM
+
+MACRO  STOSINT
+ifdef flatmodel
+               stosd
+else
+               stosw
+endif
+ENDM
+
+; Macros to provide resb, resw, resd compatibility with NASM
+
+MACRO  dclb    count
+db     count dup (0)
+ENDM
+
+MACRO  dclw    count
+dw     count dup (0)
+ENDM
+
+MACRO  dcld    count
+dd     count dup (0)
+ENDM
+
+; Macros to provide resb, resw, resd compatibility with NASM
+
+MACRO  resb    count
+db     count dup (?)
+ENDM
+
+MACRO  resw    count
+dw     count dup (?)
+ENDM
+
+MACRO  resd    count
+dd     count dup (?)
+ENDM
+
+; Macros to declare assembler stubs for function structures
+
+MACRO  BEGIN_STUBS_DEF name, firstOffset
+begdataseg  _STUBS
+ifdef  __NOU_VAR__
+               EXTRN   name:DWORD
+STUBS_START    =   name
+else
+               EXTRN   _&name&:DWORD
+name   EQU             _&name&
+STUBS_START    =   _&name
+endif
+enddataseg  _STUBS
+begcodeseg  _STUBS
+off = firstOffset
+ENDM
+
+MACRO   DECLARE_STUB   name
+ifdef  __NOU__
+name:
+               PUBLIC  name
+else
+_&name:
+               PUBLIC  _&name
+endif
+               jmp     [DWORD STUBS_START+off]
+off = off + 4
+ENDM
+
+MACRO   DECLARE_STDCALL        name,num_args
+ifdef  STDCALL_MANGLE
+_&name&@&num_args&:
+               PUBLIC  _&name&@&num_args&
+else
+name:
+               PUBLIC  name
+endif
+               jmp     [DWORD STUBS_START+off]
+off = off + 4
+ENDM
+
+MACRO   END_STUBS_DEF
+endcodeseg  _STUBS
+ENDM
+
+MACRO  BEGIN_IMPORTS_DEF       name
+BEGIN_STUBS_DEF        name,4
+ENDM
+
+MACRO   DECLARE_IMP    name
+DECLARE_STUB   name
+ENDM
+
+MACRO   END_IMPORTS_DEF
+END_STUBS_DEF
+ENDM
+
+endif
diff --git a/misc/tag-release b/misc/tag-release
new file mode 100755 (executable)
index 0000000..efaa4c3
--- /dev/null
@@ -0,0 +1,13 @@
+#!/bin/sh
+version="$1"
+if [ -z "$version" ]; then
+  echo "Usage: $0 version" 1>&2
+  exit 1
+fi
+
+echo "$version" > version
+git add version
+git commit -m "NASM $version"
+git tag -a -m "NASM $version" nasm-"$version"
+git push
+git push --tags
diff --git a/misc/xcrcgen.c b/misc/xcrcgen.c
new file mode 100644 (file)
index 0000000..acfd48e
--- /dev/null
@@ -0,0 +1,80 @@
+/*
+ * Produce a "generalized CRC" table.  Assumes a platform with
+ * /dev/urandom -- otherwise reimplement get_random_byte().
+ */
+
+#include <errno.h>
+#include <fcntl.h>
+#include <inttypes.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <unistd.h>
+
+static uint8_t get_random_byte(void)
+{
+    static int fd = -1;
+    uint8_t buf;
+    int rv;
+
+    if (fd < 0)
+       fd = open("/dev/urandom", O_RDONLY);
+
+    do {
+       errno = 0;
+       rv = read(fd, &buf, 1);
+       if (rv < 1 && errno != EAGAIN)
+           abort();
+    } while (rv < 1);
+
+    return buf;
+}
+
+static void random_permute(uint8_t *buf)
+{
+    int i, j, k;
+    int m;
+
+    for (i = 0; i < 256; i++)
+       buf[i] = i;
+
+    m = 255;
+    for (i = 255; i > 0; i--) {
+       if (i <= (m >> 1))
+           m >>= 1;
+       do {
+           j = get_random_byte() & m;
+       } while (j > i);
+       k = buf[i];
+       buf[i] = buf[j];
+       buf[j] = k;
+    }
+}
+
+static void xcrc_table(uint64_t *buf)
+{
+    uint8_t perm[256];
+    int i, j;
+
+    memset(buf, 0, 8*256);     /* Make static checkers happy */
+
+    for (i = 0; i < 8; i++) {
+       random_permute(perm);
+       for (j = 0; j < 256; j++)
+           buf[j] = (buf[j] << 8) | perm[j];
+    }
+}
+
+int main(void)
+{
+    int i;
+    uint64_t buf[256];
+
+    xcrc_table(buf);
+
+    for (i = 0; i < 256; i++) {
+       printf("%016"PRIx64"\n", buf[i]);
+    }
+
+    return 0;
+}
diff --git a/mkdep.pl b/mkdep.pl
new file mode 100755 (executable)
index 0000000..9f80ed3
--- /dev/null
+++ b/mkdep.pl
@@ -0,0 +1,238 @@
+#!/usr/bin/perl
+## --------------------------------------------------------------------------
+##   
+##   Copyright 1996-2009 The NASM Authors - All Rights Reserved
+##   See the file AUTHORS included with the NASM distribution for
+##   the specific copyright holders.
+##
+##   Copyright 1996-2009 the NASM Authors - All rights reserved.
+##
+##   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.
+##
+## --------------------------------------------------------------------------
+
+#
+# Script to create Makefile-style dependencies.
+#
+# Usage: perl mkdep.pl [-s path-separator] [-o obj-ext] dir... > deps
+#
+
+use File::Spec;
+use File::Basename;
+use Fcntl;
+
+$barrier = "#-- Everything below is generated by mkdep.pl - do not edit --#\n";
+
+#
+# Scan files for dependencies
+#
+sub scandeps($) {
+    my($file) = @_;
+    my($line, $nf);
+    my(@xdeps) = ();
+    my(@mdeps) = ();
+
+    sysopen(FILE, $file, O_RDONLY)
+       or return;              # If not openable, assume generated
+
+    while ( defined($line = <FILE>) ) {
+       chomp $line;
+       $line =~ s:/\*.*\*/::g;
+       $line =~ s://.*$::;
+       if ( $line =~ /^\s*\#\s*include\s+\"(.*)\"\s*$/ ) {
+           $nf = $1;
+           push(@mdeps, $nf);
+           push(@xdeps, $nf) unless ( defined($deps{$nf}) );
+       }
+    }
+    close(FILE);
+    $deps{$file} = [@mdeps];
+
+    foreach $file ( @xdeps ) {
+       scandeps($file);
+    }
+}
+
+# %deps contains direct dependencies.  This subroutine resolves
+# indirect dependencies that result.
+sub alldeps($) {
+    my($file) = @_;
+    my(%adeps);
+    my($dep,$idep);
+
+    foreach $dep ( @{$deps{$file}} ) {
+       $adeps{$dep} = 1;
+       foreach $idep ( alldeps($dep) ) {
+           $adeps{$idep} = 1;
+       }
+    }
+    return sort(keys(%adeps));
+}
+
+# This converts a filename from host syntax to target syntax
+# This almost certainly works only on relative filenames...
+sub convert_file($$) {
+    my($file,$sep) = @_;
+    my(@fspec) = (basename($file));
+    while ( ($file = dirname($file)) ne File::Spec->curdir() &&
+           $file ne File::Spec->rootdir() ) {
+       unshift(@fspec, basename($file));
+    }
+
+    if ( $sep eq '' ) {
+       # This means kill path completely.  Used with Makes who do
+       # path searches, but doesn't handle output files in subdirectories,
+       # like OpenWatcom WMAKE.
+       return $fspec[scalar(@fspec)-1];
+    } else {
+       return join($sep, @fspec);
+    }
+}
+
+#
+# Insert dependencies into a Makefile
+#
+sub insert_deps($) {
+    my($file) = @_;
+    $nexttemp++;               # Unique serial number for each temp file
+    my($tmp) = File::Spec->catfile(dirname($file), 'tmp.'.$nexttemp);
+
+    sysopen(IN, $file, O_RDONLY)
+       or die "$0: Cannot open input: $file\n";
+    sysopen(OUT, $tmp, O_WRONLY|O_CREAT|O_TRUNC, 0666)
+       or die "$0: Cannot open output: $tmp\n";
+
+    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*\"([^\"]*)\"/ ) {
+           $parm = $1;  $val = $2;
+           if ( $parm eq 'object-ending' ) {
+               $obj = $val;
+           } elsif ( $parm eq 'path-separator' ) {
+               $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
+       }
+       print OUT $line;
+    }
+    close(IN);
+
+    my $e;
+    my %do_exclude = ();
+    foreach $e (@exclude) {
+       $do_exclude{$e} = 1;
+    }
+
+    my $dfile, $ofile, $str, $sl, $len;
+    my @deps, $dep;
+
+    print OUT $barrier;
+
+    foreach $dfile ( sort(keys(%deps)) ) {
+       if ( $dfile =~ /\.[Cc]$/ ) {
+           $ofile = $dfile; $ofile =~ s/\.[Cc]$//;
+           $str = convert_file($ofile,$sep).$obj.':';
+           $len = length($str);
+           print OUT $str;
+           foreach $dep ($dfile, alldeps($dfile)) {
+               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";
+       }
+    }
+    close(OUT);
+
+    (unlink($file) && rename($tmp, $file))
+       or die "$0: Failed to change $tmp -> $file\n";
+}
+
+#
+# Main program
+#
+
+%deps = ();
+@files = ();
+@mkfiles = ();
+$mkmode = 0;
+
+while ( defined($arg = shift(@ARGV)) ) {
+    if ( $arg eq '-m' ) {
+       $arg = shift(@ARGV);
+       push(@mkfiles, $arg);
+    } elsif ( $arg eq '-M' ) {
+       $mkmode = 1;            # Futher filenames are output Makefile names
+    } elsif ( $arg eq '--' && $mkmode ) {
+       $mkmode = 0;
+    } elsif ( $arg =~ /^-/ ) {
+       die "Unknown option: $arg\n";
+    } else {
+       if ( $mkmode ) {
+           push(@mkfiles, $arg);
+       } else {
+           push(@files, $arg);
+       }
+    }
+}
+
+foreach $dir ( @files ) {
+    opendir(DIR, $dir) or die "$0: Cannot open directory: $dir";
+
+    while ( $file = readdir(DIR) ) {
+       $path = ($dir eq File::Spec->curdir())
+           ? $file : File::Spec->catfile($dir,$file);
+       if ( $file =~ /\.[Cc]$/ ) {
+           scandeps($path);
+       }
+    }
+    closedir(DIR);
+}
+
+foreach $mkfile ( @mkfiles ) {
+    insert_deps($mkfile);
+}
diff --git a/nasm.1 b/nasm.1
new file mode 100644 (file)
index 0000000..257517e
--- /dev/null
+++ b/nasm.1
@@ -0,0 +1,535 @@
+.TH NASM 1 "The Netwide Assembler Project"
+.SH NAME
+nasm \- the Netwide Assembler, a portable 80x86 assembler
+.SH SYNOPSIS
+.B nasm
+[
+.B \-@
+response file
+] [
+.B \-f
+format
+] [
+.B \-o
+outfile
+] [
+.B \-l
+listfile
+] [
+.IR options ...
+] filename
+.br
+.B nasm \-h
+.br
+.B nasm \-v
+.SH DESCRIPTION
+The
+.B nasm
+command assembles the file
+.I filename
+and directs output to the file
+.I outfile
+if specified. If
+.I outfile
+is not specified,
+.B nasm
+will derive a default output file name from the name of its input
+file, usually by appending `.o' or `.obj', or by removing all
+extensions for a raw binary file. Failing that, the output file name
+will be `nasm.out'.
+.SS OPTIONS
+.TP
+.BI \-@ " filename"
+Causes
+.B nasm
+to process options from 
+.I filename
+as if they were included on the command line.
+.TP
+.B \-a
+Causes
+.B nasm
+to assemble the given input file without first applying the macro
+preprocessor.
+.TP
+.BI \-D " macro[=value]"
+Pre-defines a single-line macro.
+.TP
+.BI \-d " macro[=value]"
+Same as the
+.B \-D
+option.
+.TP
+.B \-e
+Causes
+.B nasm
+to preprocess the given input file, and write the output to
+.I stdout
+(or the specified output file name), and not actually assemble
+anything.
+.TP
+.BI \-f " format"
+Specifies the output file format. To see a list of valid output
+formats, use the
+.B -hf
+option.
+.TP
+.B \-g
+Causes
+.B nasm
+to generate debug information in selected format
+.TP
+.B \-h
+Causes
+.B nasm
+to exit immediately, after giving a summary of its invocation
+options.
+.TP
+.B \-hf
+Same as
+.B -h
+, but also lists all valid output formats.
+.TP
+.BI \-I " directory"
+Adds a directory to the search path for include files. The directory
+specification must include the trailing slash, as it will be
+directly prepended to the name of the include file.
+.TP
+.BI \-i " directory"
+Same as the
+.B \-I
+option.
+.TP
+.BI \-l " listfile"
+Causes an assembly listing to be directed to the given file, in
+which the original source is displayed on the right hand side (plus
+the source for included files and the expansions of multi-line
+macros) and the generated code is shown in hex on the left.
+.TP
+.B \-M
+Causes
+.B nasm
+to output Makefile-style dependencies to stdout; normal output is
+suppressed.
+.TP
+.BI \-MG " file"
+Same as
+.B \-M
+but assumes that missing Makefile dependecies are generated and added
+to dependency list without a prefix.
+.TP
+.BI \-MF " file"
+Output Makefile-style dependencies to the specified file.
+.TP
+.BI \-MD " file"
+Same as a combination of
+.B \-M
+and
+.B \-MF
+options.
+.TP
+.BI \-MT " file"
+Override the default name of the dependency target
+dependency target name. This is normally the same
+as the output filename, specified by the
+.B \-o
+option.
+.TP
+.BI \-MQ " file"
+The same as
+.B \-MT
+except it tries to quote characters that have special
+meaning in Makefile syntax. This is not foolproof,
+as not all characters with special meaning are quotable
+in Make.
+.TP
+.BI \-MP
+Emit phony target
+.TP
+.BI \-O " number"
+Optimize branch offsets.
+.ti
+.B \-O0
+:No optimization (default)
+.ti
+.B \-O1
+:Minimal optimization
+.ti
+.B \-Ox
+:Multipass optimization (recommended)
+.TP
+.BI \-o " outfile"
+Specifies a precise name for the output file, overriding
+.BR nasm 's
+default means of determining it.
+.TP
+.BI \-P " file"
+Specifies a file to be pre-included, before the main source file
+starts to be processed.
+.TP
+.BI \-p " file"
+Same as the
+.B \-P
+option.
+.TP
+.BI \-r
+Causes
+.B nasm
+to exit immediately, after displaying its version number.
+.I (obsolete)
+.TP
+.B \-s
+Causes
+.B nasm
+to send its error messages and/or help text to
+.I stdout
+instead of
+.IR stderr .
+.TP
+.B \-t
+Causes
+.B nasm
+to assemble in SciTech TASM compatible mode
+.TP
+.BI \-U " macro"
+Undefines a single-line macro.
+.TP
+.BI \-u " macro"
+Same as the
+.B \-U
+option.
+.TP
+.BI \-v
+Causes
+.B nasm
+to exit immediately, after displaying its version number.
+.TP
+.BI \-w [+-]foo
+Causes
+.B nasm
+to enable or disable certain classes of warning messages, for
+example
+.B \-w+orphan-labels
+or
+.B \-w-macro-params
+.TP
+.BI \-X " format"
+specifies error reporting format (gnu or vc).
+.TP
+.BI \-Z " filename"
+Causes
+.B nasm
+to redirect error messages to
+.IR filename .
+This option exists to support operating systems on which stderr is not
+easily redirected.
+.TP
+.BI \-\-prefix
+.TP
+.BI \-\-postfix
+Prepend or append (respectively) the given argument to all
+global or extern variables.
+.PP
+.RE
+.SS SYNTAX
+This man page does not fully describe the syntax of
+.BR nasm 's
+assembly language, but does give a summary of the differences from
+other assemblers.
+.PP
+.I Registers
+have no leading `%' sign, unlike
+.BR gas ,
+and floating-point stack registers are referred to as
+.IR st0 ,
+.IR st1 ,
+and so on.
+.PP
+.I Floating-point instructions
+may use either the single-operand form or the double. A
+.I TO
+keyword is provided; thus, one could either write
+.PP
+.ti +15n
+fadd st0,st1
+.br
+.ti +15n
+fadd st1,st0
+.PP
+or one could use the alternative single-operand forms
+.PP
+.ti +15n
+fadd st1
+.br
+.ti +15n
+fadd to st1
+.PP
+.I Uninitialised storage
+is reserved using the
+.IR RESB ,
+.IR RESW ,
+.IR RESD ,
+.IR RESQ ,
+.I REST
+and
+.I RESO
+pseudo-opcodes, each taking one parameter which gives the number of
+bytes, words, doublewords, quadwords or ten-byte words to reserve.
+.PP
+.I Repetition
+of data items is not done by the
+.I DUP
+keyword as seen in DOS assemblers, but by the use of the
+.I TIMES
+prefix, like this:
+.PP
+.ti +6n
+.ta 9n
+message:       times 3 db 'abc'
+.br
+.ti +15n
+times 64-$+message db 0
+.PP
+which defines the string `abcabcabc', followed by the right number
+of zero bytes to make the total length up to 64 bytes.
+.PP
+.I Symbol references
+are always understood to be immediate (i.e. the address of the
+symbol), unless square brackets are used, in which case the contents
+of the memory location are used. Thus:
+.PP
+.ti +15n
+mov ax,wordvar
+.PP
+loads AX with the address of the variable `wordvar', whereas
+.PP
+.ti +15n
+mov ax,[wordvar]
+.br
+.ti +15n
+mov ax,[wordvar+1]
+.br
+.ti +15n
+mov ax,[es:wordvar+bx]
+.PP
+all refer to the
+.I contents
+of memory locations. The syntaxes
+.PP
+.ti +15n
+mov ax,es:wordvar[bx]
+.br
+.ti +15n
+es mov ax,wordvar[1]
+.PP
+are not legal at all, although the use of a segment register name as
+an instruction prefix is valid, and can be used with instructions
+such as
+.I LODSB
+which can't be overridden any other way.
+.PP
+.I Constants
+may be expressed numerically in most formats: a trailing H, Q or B
+denotes hex, octal or binary respectively, and a leading `0x' or `$'
+denotes hex as well. Leading zeros are not treated specially at all.
+Character constants may be enclosed in single or double quotes;
+there is no escape character. The ordering is little-endian
+(reversed), so that the character constant
+.I 'abcd'
+denotes 0x64636261 and not 0x61626364.
+.PP
+.I Local labels
+begin with a period, and their `locality' is granted by the
+assembler prepending the name of the previous non-local symbol. Thus
+declaring a label `.loop' after a label `label' has actually defined
+a symbol called `label.loop'.
+.SS DIRECTIVES
+.I SECTION name
+or
+.I SEGMENT name
+causes
+.B nasm
+to direct all following code to the named section. Section names
+vary with output file format, although most formats support the
+names
+.IR .text ,
+.I .data
+and
+.IR .bss .
+(The exception is the
+.I obj
+format, in which all segments are user-definable.)
+.PP
+.I ABSOLUTE address
+causes
+.B nasm
+to position its notional assembly point at an absolute address: so
+no code or data may be generated, but you can use
+.IR RESB ,
+.I RESW
+and
+.I RESD
+to move the assembly point further on, and you can define labels. So
+this directive may be used to define data structures. When you have
+finished doing absolute assembly, you must issue another
+.I SECTION
+directive to return to normal assembly.
+.PP
+.I BITS 16,
+.I BITS 32
+or
+.I BITS 64
+switches the default processor mode for which
+.B nasm
+is generating code: it is equivalent to
+.I USE16
+or
+.I USE32
+in DOS assemblers.
+.PP
+.I EXTERN symbol
+and
+.I GLOBAL symbol
+import and export symbol definitions, respectively, from and to
+other modules. Note that the
+.I GLOBAL
+directive must appear before the definition of the symbol it refers
+to.
+.PP
+.I STRUC strucname
+and
+.IR ENDSTRUC ,
+when used to bracket a number of
+.IR RESB ,
+.I RESW
+or similar instructions, define a data structure. In addition to
+defining the offsets of the structure members, the construct also
+defines a symbol for the size of the structure, which is simply the
+structure name with
+.I _size
+tacked on to the end.
+.SS FORMAT-SPECIFIC DIRECTIVES
+.I ORG address
+is used by the
+.I bin
+flat-form binary output format, and specifies the address at which
+the output code will eventually be loaded.
+.PP
+.I GROUP grpname seg1 seg2...
+is used by the
+.I obj
+(Microsoft 16-bit) output format, and defines segment groups. This
+format also uses
+.IR UPPERCASE ,
+which directs that all segment, group and symbol names output to the
+object file should be in uppercase. Note that the actual assembly is
+still case sensitive.
+.PP
+.I LIBRARY libname
+is used by the
+.I rdf
+output format, and causes a dependency record to be written to the
+output file which indicates that the program requires a certain
+library in order to run.
+.SS MACRO PREPROCESSOR
+Single-line macros are defined using the
+.I %define
+or
+.I %idefine
+commands, in a similar fashion to the C preprocessor. They can be
+overloaded with respect to number of parameters, although defining a
+macro with no parameters prevents the definition of any macro with
+the same name taking parameters, and vice versa.
+.I %define
+defines macros whose names match case-sensitively, whereas
+.I %idefine
+defines case-insensitive macros.
+.PP
+Multi-line macros are defined using
+.I %macro
+and
+.I %imacro
+(the distinction is the same as that between
+.I %define
+and
+.IR %idefine ),
+whose syntax is as follows:
+.PP
+.ti +6n
+%macro
+.I name
+.IR minprm [- maxprm "][+][.nolist] [" defaults ]
+.br
+.ti +15n
+<some lines of macro expansion text>
+.br
+.ti +6n
+%endmacro
+.PP
+Again, these macros may be overloaded. The trailing plus sign
+indicates that any parameters after the last one get subsumed, with
+their separating commas, into the last parameter. The
+.I defaults
+part can be used to specify defaults for unspecified macro
+parameters after
+.IR minparam .
+.I %endm
+is a valid synonym for
+.IR %endmacro .
+.PP
+To refer to the macro parameters within a macro expansion, you use
+.IR %1 ,
+.I %2
+and so on. You can also enforce that a macro parameter should
+contain a condition code by using
+.IR %+1 ,
+and you can invert the condition code by using
+.IR %-1 .
+You can also define a label specific to a macro invocation by
+prefixing it with a double % sign.
+.PP
+Files can be included using the
+.I %include
+directive, which works like C.
+.PP
+The preprocessor has a `context stack', which may be used by one
+macro to store information that a later one will retrieve. You can
+push a context on the stack using
+.IR %push ,
+remove one using
+.IR %pop ,
+and change the name of the top context (without disturbing any
+associated definitions) using
+.IR %repl .
+Labels and
+.I %define
+macros specific to the top context may be defined by prefixing their
+names with %$, and things specific to the next context down with
+%$$, and so on.
+.PP
+Conditional assembly is done by means of
+.IR %ifdef ,
+.IR %ifndef ,
+.I %else
+and
+.I %endif
+as in C. (Except that
+.I %ifdef
+can accept several putative macro names, and will evaluate TRUE if
+any of them is defined.) In addition, the directives
+.I %ifctx
+and
+.I %ifnctx
+can be used to condition on the name of the top context on the
+context stack. The obvious set of `else-if' directives,
+.IR %elifdef ,
+.IR %elifndef ,
+.IR %elifctx
+and
+.IR %elifnctx
+are also supported.
+.SH BUGS
+Please report bugs through the bug tracker function at http://nasm.sourceforge.org.
+.SH SEE ALSO
+.BR as "(" 1 "),"
+.BR ld "(" 1 ")."
diff --git a/nasm.c b/nasm.c
new file mode 100644 (file)
index 0000000..d8f64c5
--- /dev/null
+++ b/nasm.c
@@ -0,0 +1,2120 @@
+/* ----------------------------------------------------------------------- *
+ *
+ *   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.
+ *
+ * ----------------------------------------------------------------------- */
+
+/*
+ * The Netwide Assembler main program module
+ */
+
+#include "compiler.h"
+
+#include <stdio.h>
+#include <stdarg.h>
+#include <stdlib.h>
+#include <string.h>
+#include <ctype.h>
+#include <inttypes.h>
+#include <limits.h>
+#include <time.h>
+
+#include "nasm.h"
+#include "nasmlib.h"
+#include "saa.h"
+#include "raa.h"
+#include "float.h"
+#include "stdscan.h"
+#include "insns.h"
+#include "preproc.h"
+#include "parser.h"
+#include "eval.h"
+#include "assemble.h"
+#include "labels.h"
+#include "output/outform.h"
+#include "listing.h"
+
+struct forwrefinfo {            /* info held on forward refs. */
+    int lineno;
+    int operand;
+};
+
+static int get_bits(char *value);
+static uint32_t get_cpu(char *cpu_str);
+static void parse_cmdline(int, char **);
+static void assemble_file(char *, StrList **);
+static void nasm_verror_gnu(int severity, const char *fmt, va_list args);
+static void nasm_verror_vc(int severity, const char *fmt, va_list args);
+static void nasm_verror_common(int severity, const char *fmt, va_list args);
+static bool is_suppressed_warning(int severity);
+static void usage(void);
+
+static int using_debug_info, opt_verbose_info;
+bool tasm_compatible_mode = false;
+int pass0, passn;
+int maxbits = 0;
+int globalrel = 0;
+
+static time_t official_compile_time;
+
+static char inname[FILENAME_MAX];
+static char outname[FILENAME_MAX];
+static char listname[FILENAME_MAX];
+static char errname[FILENAME_MAX];
+static int globallineno;        /* for forward-reference tracking */
+/* static int pass = 0; */
+struct ofmt *ofmt = &OF_DEFAULT;
+const struct dfmt *dfmt;
+
+static FILE *error_file;        /* Where to write error messages */
+
+FILE *ofile = NULL;
+int optimizing = -1;            /* number of optimization passes to take */
+static int sb, cmd_sb = 16;     /* by default */
+static uint32_t cmd_cpu = IF_PLEVEL;       /* highest level by default */
+static uint32_t cpu = IF_PLEVEL;   /* passed to insn_size & assemble.c */
+int64_t global_offset_changed;      /* referenced in labels.c */
+int64_t prev_offset_changed;
+int32_t stall_count;
+
+static struct location location;
+int in_abs_seg;                 /* Flag we are in ABSOLUTE seg */
+int32_t abs_seg;                   /* ABSOLUTE segment basis */
+int32_t abs_offset;                /* ABSOLUTE offset */
+
+static struct RAA *offsets;
+
+static struct SAA *forwrefs;    /* keep track of forward references */
+static const struct forwrefinfo *forwref;
+
+static Preproc *preproc;
+enum op_type {
+    op_normal,                  /* Preprocess and assemble */
+    op_preprocess,              /* Preprocess only */
+    op_depend,                  /* Generate dependencies */
+};
+static enum op_type operating_mode;
+/* Dependency flags */
+static bool depend_emit_phony = false;
+static bool depend_missing_ok = false;
+static const char *depend_target = NULL;
+static const char *depend_file = NULL;
+
+/*
+ * Which of the suppressible warnings are suppressed. Entry zero
+ * isn't an actual warning, but it used for -w+error/-Werror.
+ */
+
+static bool warning_on[ERR_WARN_MAX+1]; /* Current state */
+static bool warning_on_global[ERR_WARN_MAX+1]; /* Command-line state */
+
+static const struct warning {
+    const char *name;
+    const char *help;
+    bool enabled;
+} warnings[ERR_WARN_MAX+1] = {
+    {"error", "treat warnings as errors", false},
+    {"macro-params", "macro calls with wrong parameter count", true},
+    {"macro-selfref", "cyclic macro references", false},
+    {"macro-defaults", "macros with more default than optional parameters", true},
+    {"orphan-labels", "labels alone on lines without trailing `:'", true},
+    {"number-overflow", "numeric constant does not fit", true},
+    {"gnu-elf-extensions", "using 8- or 16-bit relocation in ELF32, a GNU extension", false},
+    {"float-overflow", "floating point overflow", true},
+    {"float-denorm", "floating point denormal", false},
+    {"float-underflow", "floating point underflow", false},
+    {"float-toolong", "too many digits in floating-point number", true},
+    {"user", "%warning directives", true},
+};
+
+/*
+ * This is a null preprocessor which just copies lines from input
+ * to output. It's used when someone explicitly requests that NASM
+ * not preprocess their source file.
+ */
+
+static void no_pp_reset(char *, int, ListGen *, StrList **);
+static char *no_pp_getline(void);
+static void no_pp_cleanup(int);
+static Preproc no_pp = {
+    no_pp_reset,
+    no_pp_getline,
+    no_pp_cleanup
+};
+
+/*
+ * get/set current offset...
+ */
+#define GET_CURR_OFFS (in_abs_seg?abs_offset:\
+                     raa_read(offsets,location.segment))
+#define SET_CURR_OFFS(x) (in_abs_seg?(void)(abs_offset=(x)):\
+                        (void)(offsets=raa_write(offsets,location.segment,(x))))
+
+static bool want_usage;
+static bool terminate_after_phase;
+int user_nolist = 0;            /* fbk 9/2/00 */
+
+static void nasm_fputs(const char *line, FILE * outfile)
+{
+    if (outfile) {
+        fputs(line, outfile);
+        putc('\n', outfile);
+    } else
+        puts(line);
+}
+
+/* Convert a struct tm to a POSIX-style time constant */
+static int64_t posix_mktime(struct tm *tm)
+{
+    int64_t t;
+    int64_t y = tm->tm_year;
+
+    /* See IEEE 1003.1:2004, section 4.14 */
+
+    t = (y-70)*365 + (y-69)/4 - (y-1)/100 + (y+299)/400;
+    t += tm->tm_yday;
+    t *= 24;
+    t += tm->tm_hour;
+    t *= 60;
+    t += tm->tm_min;
+    t *= 60;
+    t += tm->tm_sec;
+
+    return t;
+}
+
+static void define_macros_early(void)
+{
+    char temp[128];
+    struct tm lt, *lt_p, gm, *gm_p;
+    int64_t posix_time;
+
+    lt_p = localtime(&official_compile_time);
+    if (lt_p) {
+       lt = *lt_p;
+
+       strftime(temp, sizeof temp, "__DATE__=\"%Y-%m-%d\"", &lt);
+       pp_pre_define(temp);
+       strftime(temp, sizeof temp, "__DATE_NUM__=%Y%m%d", &lt);
+       pp_pre_define(temp);
+       strftime(temp, sizeof temp, "__TIME__=\"%H:%M:%S\"", &lt);
+       pp_pre_define(temp);
+       strftime(temp, sizeof temp, "__TIME_NUM__=%H%M%S", &lt);
+       pp_pre_define(temp);
+    }
+
+    gm_p = gmtime(&official_compile_time);
+    if (gm_p) {
+       gm = *gm_p;
+
+       strftime(temp, sizeof temp, "__UTC_DATE__=\"%Y-%m-%d\"", &gm);
+       pp_pre_define(temp);
+       strftime(temp, sizeof temp, "__UTC_DATE_NUM__=%Y%m%d", &gm);
+       pp_pre_define(temp);
+       strftime(temp, sizeof temp, "__UTC_TIME__=\"%H:%M:%S\"", &gm);
+       pp_pre_define(temp);
+       strftime(temp, sizeof temp, "__UTC_TIME_NUM__=%H%M%S", &gm);
+       pp_pre_define(temp);
+    }
+
+    if (gm_p)
+       posix_time = posix_mktime(&gm);
+    else if (lt_p)
+       posix_time = posix_mktime(&lt);
+    else
+       posix_time = 0;
+
+    if (posix_time) {
+       snprintf(temp, sizeof temp, "__POSIX_TIME__=%"PRId64, posix_time);
+       pp_pre_define(temp);
+    }
+}
+
+static void define_macros_late(void)
+{
+    char temp[128];
+
+    snprintf(temp, sizeof(temp), "__OUTPUT_FORMAT__=%s\n",
+            ofmt->shortname);
+    pp_pre_define(temp);
+}
+
+static void emit_dependencies(StrList *list)
+{
+    FILE *deps;
+    int linepos, len;
+    StrList *l, *nl;
+
+    if (depend_file && strcmp(depend_file, "-")) {
+       deps = fopen(depend_file, "w");
+       if (!deps) {
+           nasm_error(ERR_NONFATAL|ERR_NOFILE|ERR_USAGE,
+                        "unable to write dependency file `%s'", depend_file);
+           return;
+       }
+    } else {
+       deps = stdout;
+    }
+
+    linepos = fprintf(deps, "%s:", depend_target);
+    list_for_each(l, list) {
+       len = strlen(l->str);
+       if (linepos + len > 62) {
+           fprintf(deps, " \\\n ");
+           linepos = 1;
+       }
+       fprintf(deps, " %s", l->str);
+       linepos += len+1;
+    }
+    fprintf(deps, "\n\n");
+
+    list_for_each_safe(l, nl, list) {
+       if (depend_emit_phony)
+           fprintf(deps, "%s:\n\n", l->str);
+       nasm_free(l);
+    }
+
+    if (deps != stdout)
+       fclose(deps);
+}
+
+int main(int argc, char **argv)
+{
+    StrList *depend_list = NULL, **depend_ptr;
+
+    time(&official_compile_time);
+
+    pass0 = 0;
+    want_usage = terminate_after_phase = false;
+    nasm_set_verror(nasm_verror_gnu);
+
+    error_file = stderr;
+
+    tolower_init();
+
+    nasm_init_malloc_error();
+    offsets = raa_init();
+    forwrefs = saa_init((int32_t)sizeof(struct forwrefinfo));
+
+    preproc = &nasmpp;
+    operating_mode = op_normal;
+
+    seg_init();
+
+    /* Define some macros dependent on the runtime, but not
+       on the command line. */
+    define_macros_early();
+
+    parse_cmdline(argc, argv);
+
+    if (terminate_after_phase) {
+        if (want_usage)
+            usage();
+        return 1;
+    }
+
+    /* If debugging info is disabled, suppress any debug calls */
+    if (!using_debug_info)
+        ofmt->current_dfmt = &null_debug_form;
+
+    if (ofmt->stdmac)
+        pp_extra_stdmac(ofmt->stdmac);
+    parser_global_info(&location);
+    eval_global_info(ofmt, lookup_label, &location);
+
+    /* define some macros dependent of command-line */
+    define_macros_late();
+
+    depend_ptr = (depend_file || (operating_mode == op_depend))
+       ? &depend_list : NULL;
+    if (!depend_target)
+       depend_target = outname;
+
+    switch (operating_mode) {
+    case op_depend:
+        {
+            char *line;
+
+           if (depend_missing_ok)
+               pp_include_path(NULL);  /* "assume generated" */
+
+            preproc->reset(inname, 0, &nasmlist, depend_ptr);
+            if (outname[0] == '\0')
+                ofmt->filename(inname, outname);
+            ofile = NULL;
+            while ((line = preproc->getline()))
+                nasm_free(line);
+            preproc->cleanup(0);
+        }
+        break;
+
+    case op_preprocess:
+        {
+            char *line;
+            char *file_name = NULL;
+            int32_t prior_linnum = 0;
+            int lineinc = 0;
+
+            if (*outname) {
+                ofile = fopen(outname, "w");
+                if (!ofile)
+                    nasm_error(ERR_FATAL | ERR_NOFILE,
+                                 "unable to open output file `%s'",
+                                 outname);
+            } else
+                ofile = NULL;
+
+            location.known = false;
+
+           /* pass = 1; */
+            preproc->reset(inname, 3, &nasmlist, depend_ptr);
+
+            while ((line = preproc->getline())) {
+                /*
+                 * We generate %line directives if needed for later programs
+                 */
+                int32_t linnum = prior_linnum += lineinc;
+                int altline = src_get(&linnum, &file_name);
+                if (altline) {
+                    if (altline == 1 && lineinc == 1)
+                        nasm_fputs("", ofile);
+                    else {
+                        lineinc = (altline != -1 || lineinc != 1);
+                        fprintf(ofile ? ofile : stdout,
+                                "%%line %"PRId32"+%d %s\n", linnum, lineinc,
+                                file_name);
+                    }
+                    prior_linnum = linnum;
+                }
+                nasm_fputs(line, ofile);
+                nasm_free(line);
+            }
+            nasm_free(file_name);
+            preproc->cleanup(0);
+            if (ofile)
+                fclose(ofile);
+            if (ofile && terminate_after_phase)
+                remove(outname);
+           ofile = NULL;
+        }
+        break;
+
+    case op_normal:
+        {
+            /*
+             * We must call ofmt->filename _anyway_, even if the user
+             * has specified their own output file, because some
+             * formats (eg OBJ and COFF) use ofmt->filename to find out
+             * the name of the input file and then put that inside the
+             * file.
+             */
+            ofmt->filename(inname, outname);
+
+            ofile = fopen(outname, (ofmt->flags & OFMT_TEXT) ? "w" : "wb");
+            if (!ofile) {
+                nasm_error(ERR_FATAL | ERR_NOFILE,
+                             "unable to open output file `%s'", outname);
+            }
+
+            /*
+             * We must call init_labels() before ofmt->init() since
+             * some object formats will want to define labels in their
+             * init routines. (eg OS/2 defines the FLAT group)
+             */
+            init_labels();
+
+            ofmt->init();
+           dfmt = ofmt->current_dfmt;
+            dfmt->init();
+
+            assemble_file(inname, depend_ptr);
+
+            if (!terminate_after_phase) {
+                ofmt->cleanup(using_debug_info);
+                cleanup_labels();
+               fflush(ofile);
+               if (ferror(ofile)) {
+                   nasm_error(ERR_NONFATAL|ERR_NOFILE,
+                                "write error on output file `%s'", outname);
+               }
+           }
+
+           if (ofile) {
+               fclose(ofile);
+               if (terminate_after_phase)
+                   remove(outname);
+               ofile = NULL;
+           }
+        }
+        break;
+    }
+
+    if (depend_list && !terminate_after_phase)
+       emit_dependencies(depend_list);
+
+    if (want_usage)
+        usage();
+
+    raa_free(offsets);
+    saa_free(forwrefs);
+    eval_cleanup();
+    stdscan_cleanup();
+
+    return terminate_after_phase;
+}
+
+/*
+ * Get a parameter for a command line option.
+ * First arg must be in the form of e.g. -f...
+ */
+static char *get_param(char *p, char *q, bool *advance)
+{
+    *advance = false;
+    if (p[2]) /* the parameter's in the option */
+        return nasm_skip_spaces(p + 2);
+    if (q && q[0]) {
+        *advance = true;
+        return q;
+    }
+    nasm_error(ERR_NONFATAL | ERR_NOFILE | ERR_USAGE,
+                 "option `-%c' requires an argument", p[1]);
+    return NULL;
+}
+
+/*
+ * Copy a filename
+ */
+static void copy_filename(char *dst, const char *src)
+{
+    size_t len = strlen(src);
+
+    if (len >= (size_t)FILENAME_MAX) {
+       nasm_error(ERR_FATAL | ERR_NOFILE, "file name too long");
+       return;
+    }
+    strncpy(dst, src, FILENAME_MAX);
+}
+
+/*
+ * Convert a string to Make-safe form
+ */
+static char *quote_for_make(const char *str)
+{
+    const char *p;
+    char *os, *q;
+
+    size_t n = 1;              /* Terminating zero */
+    size_t nbs = 0;
+
+    if (!str)
+       return NULL;
+
+    for (p = str; *p; p++) {
+       switch (*p) {
+       case ' ':
+       case '\t':
+           /* Convert N backslashes + ws -> 2N+1 backslashes + ws */
+           n += nbs + 2;
+           nbs = 0;
+           break;
+       case '$':
+       case '#':
+           nbs = 0;
+           n += 2;
+           break;
+       case '\\':
+           nbs++;
+           n++;
+           break;
+       default:
+           nbs = 0;
+           n++;
+       break;
+       }
+    }
+
+    /* Convert N backslashes at the end of filename to 2N backslashes */
+    if (nbs)
+       n += nbs;
+
+    os = q = nasm_malloc(n);
+
+    nbs = 0;
+    for (p = str; *p; p++) {
+       switch (*p) {
+       case ' ':
+       case '\t':
+           while (nbs--)
+               *q++ = '\\';
+           *q++ = '\\';
+           *q++ = *p;
+           break;
+       case '$':
+           *q++ = *p;
+           *q++ = *p;
+           nbs = 0;
+           break;
+       case '#':
+           *q++ = '\\';
+           *q++ = *p;
+           nbs = 0;
+           break;
+       case '\\':
+           *q++ = *p;
+           nbs++;
+           break;
+       default:
+           *q++ = *p;
+           nbs = 0;
+       break;
+       }
+    }
+    while (nbs--)
+       *q++ = '\\';
+
+    *q = '\0';
+
+    return os;
+}
+
+struct textargs {
+    const char *label;
+    int value;
+};
+
+#define OPT_PREFIX 0
+#define OPT_POSTFIX 1
+struct textargs textopts[] = {
+    {"prefix", OPT_PREFIX},
+    {"postfix", OPT_POSTFIX},
+    {NULL, 0}
+};
+
+static bool stopoptions = false;
+static bool process_arg(char *p, char *q)
+{
+    char *param;
+    int i;
+    bool advance = false;
+    bool do_warn;
+
+    if (!p || !p[0])
+        return false;
+
+    if (p[0] == '-' && !stopoptions) {
+       if (strchr("oOfpPdDiIlFXuUZwW", p[1])) {
+           /* These parameters take values */
+           if (!(param = get_param(p, q, &advance)))
+               return advance;
+       }
+
+        switch (p[1]) {
+        case 's':
+            error_file = stdout;
+            break;
+
+       case 'o':               /* output file */
+           copy_filename(outname, param);
+           break;
+
+       case 'f':               /* output format */
+           ofmt = ofmt_find(param);
+           if (!ofmt) {
+               nasm_error(ERR_FATAL | ERR_NOFILE | ERR_USAGE,
+                            "unrecognised output format `%s' - "
+                            "use -hf for a list", param);
+           }
+           break;
+
+       case 'O':               /* Optimization level */
+       {
+           int opt;
+
+           if (!*param) {
+               /* Naked -O == -Ox */
+               optimizing = INT_MAX >> 1; /* Almost unlimited */
+           } else {
+               while (*param) {
+                   switch (*param) {
+                   case '0': case '1': case '2': case '3': case '4':
+                   case '5': case '6': case '7': case '8': case '9':
+                       opt = strtoul(param, &param, 10);
+
+                       /* -O0 -> optimizing == -1, 0.98 behaviour */
+                       /* -O1 -> optimizing == 0, 0.98.09 behaviour */
+                       if (opt < 2)
+                           optimizing = opt - 1;
+                       else
+                           optimizing = opt;
+                       break;
+
+                   case 'v':
+                   case '+':
+                       param++;
+                       opt_verbose_info = true;
+                       break;
+
+                   case 'x':
+                       param++;
+                       optimizing = INT_MAX >> 1; /* Almost unlimited */
+                       break;
+
+                   default:
+                       nasm_error(ERR_FATAL,
+                                    "unknown optimization option -O%c\n",
+                                    *param);
+                       break;
+                   }
+               }
+           }
+           break;
+       }
+
+       case 'p':                       /* pre-include */
+       case 'P':
+           pp_pre_include(param);
+           break;
+
+       case 'd':                       /* pre-define */
+       case 'D':
+           pp_pre_define(param);
+           break;
+
+       case 'u':                       /* un-define */
+       case 'U':
+           pp_pre_undefine(param);
+           break;
+
+       case 'i':                       /* include search path */
+       case 'I':
+           pp_include_path(param);
+           break;
+
+       case 'l':                       /* listing file */
+           copy_filename(listname, param);
+           break;
+
+       case 'Z':                       /* error messages file */
+           copy_filename(errname, param);
+           break;
+
+       case 'F':                       /* specify debug format */
+           ofmt->current_dfmt = dfmt_find(ofmt, param);
+           if (!ofmt->current_dfmt) {
+               nasm_error(ERR_FATAL | ERR_NOFILE | ERR_USAGE,
+                            "unrecognized debug format `%s' for"
+                            " output format `%s'",
+                            param, ofmt->shortname);
+           }
+           using_debug_info = true;
+           break;
+
+       case 'X':               /* specify error reporting format */
+           if (nasm_stricmp("vc", param) == 0)
+               nasm_set_verror(nasm_verror_vc);
+           else if (nasm_stricmp("gnu", param) == 0)
+               nasm_set_verror(nasm_verror_gnu);
+           else
+               nasm_error(ERR_FATAL | ERR_NOFILE | ERR_USAGE,
+                            "unrecognized error reporting format `%s'",
+                            param);
+            break;
+
+        case 'g':
+            using_debug_info = true;
+            break;
+
+        case 'h':
+            printf
+                ("usage: nasm [-@ response file] [-o outfile] [-f format] "
+                 "[-l listfile]\n"
+                 "            [options...] [--] filename\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 (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"
+                 "    -MF <file>  set Makefile dependency file\n"
+                 "    -MD <file>  assemble and generate dependencies\n"
+                 "    -MT <file>  dependency target name\n"
+                 "    -MQ <file>  dependency target name (quoted)\n"
+                 "    -MP         emit phony target\n\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");
+            printf
+                ("    -O<digit>   optimize branch offsets\n"
+                 "                -O0: No optimization (default)\n"
+                 "                -O1: Minimal optimization\n"
+                 "                -Ox: Multipass optimization (recommended)\n\n"
+                 "    -P<file>    pre-includes a file\n"
+                 "    -D<macro>[=<value>] pre-defines a macro\n"
+                 "    -U<macro>   undefines a macro\n"
+                 "    -X<format>  specifies error reporting format (gnu or vc)\n"
+                 "    -w+foo      enables warning foo (equiv. -Wfoo)\n"
+                 "    -w-foo      disable warning foo (equiv. -Wno-foo)\n\n"
+                 "--prefix,--postfix\n"
+                 "  this options prepend or append the given argument to all\n"
+                 "  extern and global variables\n\n"
+                 "Warnings:\n");
+            for (i = 0; i <= ERR_WARN_MAX; i++)
+                printf("    %-23s %s (default %s)\n",
+                       warnings[i].name, warnings[i].help,
+                       warnings[i].enabled ? "on" : "off");
+            printf
+                ("\nresponse files should contain command line parameters"
+                 ", one per line.\n");
+            if (p[2] == 'f') {
+                printf("\nvalid output formats for -f are"
+                       " (`*' denotes default):\n");
+                ofmt_list(ofmt, stdout);
+            } else {
+                printf("\nFor a list of valid output formats, use -hf.\n");
+                printf("For a list of debug formats, use -f <form> -y.\n");
+            }
+            exit(0);            /* never need usage message here */
+            break;
+
+        case 'y':
+            printf("\nvalid debug formats for '%s' output format are"
+                   " ('*' denotes default):\n", ofmt->shortname);
+            dfmt_list(ofmt, stdout);
+            exit(0);
+            break;
+
+        case 't':
+            tasm_compatible_mode = true;
+            break;
+
+        case 'v':
+           printf("NASM version %s compiled on %s%s\n",
+                  nasm_version, nasm_date, nasm_compile_options);
+           exit(0);        /* never need usage message here */
+            break;
+
+        case 'e':              /* preprocess only */
+       case 'E':
+            operating_mode = op_preprocess;
+            break;
+
+        case 'a':              /* assemble only - don't preprocess */
+            preproc = &no_pp;
+            break;
+
+       case 'W':
+           if (param[0] == 'n' && param[1] == 'o' && param[2] == '-') {
+               do_warn = false;
+               param += 3;
+           } else {
+               do_warn = true;
+           }
+           goto set_warning;
+
+        case 'w':
+            if (param[0] != '+' && param[0] != '-') {
+                nasm_error(ERR_NONFATAL | ERR_NOFILE | ERR_USAGE,
+                             "invalid option to `-w'");
+               break;
+            }
+           do_warn = (param[0] == '+');
+           param++;
+           goto set_warning;
+       set_warning:
+           for (i = 0; i <= ERR_WARN_MAX; i++)
+               if (!nasm_stricmp(param, warnings[i].name))
+                   break;
+           if (i <= ERR_WARN_MAX)
+               warning_on_global[i] = do_warn;
+           else if (!nasm_stricmp(param, "all"))
+               for (i = 1; i <= ERR_WARN_MAX; i++)
+                   warning_on_global[i] = do_warn;
+           else if (!nasm_stricmp(param, "none"))
+               for (i = 1; i <= ERR_WARN_MAX; i++)
+                   warning_on_global[i] = !do_warn;
+           else
+               nasm_error(ERR_NONFATAL | ERR_NOFILE | ERR_USAGE,
+                            "invalid warning `%s'", param);
+            break;
+
+        case 'M':
+           switch (p[2]) {
+           case 0:
+               operating_mode = op_depend;
+               break;
+           case 'G':
+               operating_mode = op_depend;
+               depend_missing_ok = true;
+               break;
+           case 'P':
+               depend_emit_phony = true;
+               break;
+           case 'D':
+               depend_file = q;
+               advance = true;
+               break;
+           case 'T':
+               depend_target = q;
+               advance = true;
+               break;
+           case 'Q':
+               depend_target = quote_for_make(q);
+               advance = true;
+               break;
+           default:
+               nasm_error(ERR_NONFATAL|ERR_NOFILE|ERR_USAGE,
+                            "unknown dependency option `-M%c'", p[2]);
+               break;
+           }
+           if (advance && (!q || !q[0])) {
+               nasm_error(ERR_NONFATAL|ERR_NOFILE|ERR_USAGE,
+                            "option `-M%c' requires a parameter", p[2]);
+               break;
+           }
+            break;
+
+        case '-':
+            {
+                int s;
+
+                if (p[2] == 0) {        /* -- => stop processing options */
+                    stopoptions = 1;
+                    break;
+                }
+                for (s = 0; textopts[s].label; s++) {
+                    if (!nasm_stricmp(p + 2, textopts[s].label)) {
+                        break;
+                    }
+                }
+
+                switch (s) {
+
+                case OPT_PREFIX:
+                case OPT_POSTFIX:
+                    {
+                        if (!q) {
+                            nasm_error(ERR_NONFATAL | ERR_NOFILE |
+                                         ERR_USAGE,
+                                         "option `--%s' requires an argument",
+                                         p + 2);
+                            break;
+                        } else {
+                            advance = 1, param = q;
+                        }
+
+                        if (s == OPT_PREFIX) {
+                            strncpy(lprefix, param, PREFIX_MAX - 1);
+                            lprefix[PREFIX_MAX - 1] = 0;
+                            break;
+                        }
+                        if (s == OPT_POSTFIX) {
+                            strncpy(lpostfix, param, POSTFIX_MAX - 1);
+                            lpostfix[POSTFIX_MAX - 1] = 0;
+                            break;
+                        }
+                        break;
+                    }
+                default:
+                    {
+                        nasm_error(ERR_NONFATAL | ERR_NOFILE | ERR_USAGE,
+                                     "unrecognised option `--%s'", p + 2);
+                        break;
+                    }
+                }
+                break;
+            }
+
+        default:
+            if (!ofmt->setinfo(GI_SWITCH, &p))
+                nasm_error(ERR_NONFATAL | ERR_NOFILE | ERR_USAGE,
+                             "unrecognised option `-%c'", p[1]);
+            break;
+        }
+    } else {
+        if (*inname) {
+            nasm_error(ERR_NONFATAL | ERR_NOFILE | ERR_USAGE,
+                         "more than one input file specified");
+        } else {
+            copy_filename(inname, p);
+       }
+    }
+
+    return advance;
+}
+
+#define ARG_BUF_DELTA 128
+
+static void process_respfile(FILE * rfile)
+{
+    char *buffer, *p, *q, *prevarg;
+    int bufsize, prevargsize;
+
+    bufsize = prevargsize = ARG_BUF_DELTA;
+    buffer = nasm_malloc(ARG_BUF_DELTA);
+    prevarg = nasm_malloc(ARG_BUF_DELTA);
+    prevarg[0] = '\0';
+
+    while (1) {                 /* Loop to handle all lines in file */
+        p = buffer;
+        while (1) {             /* Loop to handle long lines */
+            q = fgets(p, bufsize - (p - buffer), rfile);
+            if (!q)
+                break;
+            p += strlen(p);
+            if (p > buffer && p[-1] == '\n')
+                break;
+            if (p - buffer > bufsize - 10) {
+                int offset;
+                offset = p - buffer;
+                bufsize += ARG_BUF_DELTA;
+                buffer = nasm_realloc(buffer, bufsize);
+                p = buffer + offset;
+            }
+        }
+
+        if (!q && p == buffer) {
+            if (prevarg[0])
+                process_arg(prevarg, NULL);
+            nasm_free(buffer);
+            nasm_free(prevarg);
+            return;
+        }
+
+        /*
+         * Play safe: remove CRs, LFs and any spurious ^Zs, if any of
+         * them are present at the end of the line.
+         */
+        *(p = &buffer[strcspn(buffer, "\r\n\032")]) = '\0';
+
+        while (p > buffer && nasm_isspace(p[-1]))
+            *--p = '\0';
+
+        p = nasm_skip_spaces(buffer);
+
+        if (process_arg(prevarg, p))
+            *p = '\0';
+
+        if ((int) strlen(p) > prevargsize - 10) {
+            prevargsize += ARG_BUF_DELTA;
+            prevarg = nasm_realloc(prevarg, prevargsize);
+        }
+        strncpy(prevarg, p, prevargsize);
+    }
+}
+
+/* Function to process args from a string of args, rather than the
+ * argv array. Used by the environment variable and response file
+ * processing.
+ */
+static void process_args(char *args)
+{
+    char *p, *q, *arg, *prevarg;
+    char separator = ' ';
+
+    p = args;
+    if (*p && *p != '-')
+        separator = *p++;
+    arg = NULL;
+    while (*p) {
+        q = p;
+        while (*p && *p != separator)
+            p++;
+        while (*p == separator)
+            *p++ = '\0';
+        prevarg = arg;
+        arg = q;
+        if (process_arg(prevarg, arg))
+            arg = NULL;
+    }
+    if (arg)
+        process_arg(arg, NULL);
+}
+
+static void process_response_file(const char *file)
+{
+    char str[2048];
+    FILE *f = fopen(file, "r");
+    if (!f) {
+       perror(file);
+       exit(-1);
+    }
+    while (fgets(str, sizeof str, f)) {
+       process_args(str);
+    }
+    fclose(f);
+}
+
+static void parse_cmdline(int argc, char **argv)
+{
+    FILE *rfile;
+    char *envreal, *envcopy = NULL, *p, *arg;
+    int i;
+
+    *inname = *outname = *listname = *errname = '\0';
+    for (i = 0; i <= ERR_WARN_MAX; i++)
+       warning_on_global[i] = warnings[i].enabled;
+
+    /*
+     * First, process the NASMENV environment variable.
+     */
+    envreal = getenv("NASMENV");
+    arg = NULL;
+    if (envreal) {
+        envcopy = nasm_strdup(envreal);
+        process_args(envcopy);
+        nasm_free(envcopy);
+    }
+
+    /*
+     * Now process the actual command line.
+     */
+    while (--argc) {
+       bool advance;
+        argv++;
+        if (argv[0][0] == '@') {
+            /* We have a response file, so process this as a set of
+             * arguments like the environment variable. This allows us
+             * to have multiple arguments on a single line, which is
+             * different to the -@resp file processing below for regular
+             * NASM.
+             */
+           process_response_file(argv[0]+1);
+            argc--;
+            argv++;
+        }
+        if (!stopoptions && argv[0][0] == '-' && argv[0][1] == '@') {
+           p = get_param(argv[0], argc > 1 ? argv[1] : NULL, &advance);
+            if (p) {
+               rfile = fopen(p, "r");
+                if (rfile) {
+                    process_respfile(rfile);
+                    fclose(rfile);
+                } else
+                    nasm_error(ERR_NONFATAL | ERR_NOFILE | ERR_USAGE,
+                                 "unable to open response file `%s'", p);
+            }
+        } else
+            advance = process_arg(argv[0], argc > 1 ? argv[1] : NULL);
+        argv += advance, argc -= advance;
+    }
+
+    /* Look for basic command line typos.  This definitely doesn't
+       catch all errors, but it might help cases of fumbled fingers. */
+    if (!*inname)
+        nasm_error(ERR_NONFATAL | ERR_NOFILE | ERR_USAGE,
+                     "no input file specified");
+    else if (!strcmp(inname, errname) ||
+            !strcmp(inname, outname) ||
+            !strcmp(inname, listname) ||
+            (depend_file && !strcmp(inname, depend_file)))
+       nasm_error(ERR_FATAL | ERR_NOFILE | ERR_USAGE,
+                    "file `%s' is both input and output file",
+                    inname);
+
+    if (*errname) {
+       error_file = fopen(errname, "w");
+       if (!error_file) {
+           error_file = stderr;        /* Revert to default! */
+           nasm_error(ERR_FATAL | ERR_NOFILE | ERR_USAGE,
+                        "cannot open file `%s' for error messages",
+                        errname);
+       }
+    }
+}
+
+static enum directives getkw(char **directive, char **value);
+
+static void assemble_file(char *fname, StrList **depend_ptr)
+{
+    char *directive, *value, *p, *q, *special, *line;
+    insn output_ins;
+    int i, validid;
+    bool rn_error;
+    int32_t seg;
+    int64_t offs;
+    struct tokenval tokval;
+    expr *e;
+    int pass_max;
+
+    if (cmd_sb == 32 && cmd_cpu < IF_386)
+        nasm_error(ERR_FATAL, "command line: "
+                     "32-bit segment size requires a higher cpu");
+
+    pass_max = prev_offset_changed = (INT_MAX >> 1) + 2; /* Almost unlimited */
+    for (passn = 1; pass0 <= 2; passn++) {
+        int pass1, pass2;
+        ldfunc def_label;
+
+        pass1 = pass0 == 2 ? 2 : 1;    /* 1, 1, 1, ..., 1, 2 */
+        pass2 = passn > 1  ? 2 : 1;     /* 1, 2, 2, ..., 2, 2 */
+        /* pass0                           0, 0, 0, ..., 1, 2 */
+
+        def_label = passn > 1 ? redefine_label : define_label;
+
+        globalbits = sb = cmd_sb;   /* set 'bits' to command line default */
+        cpu = cmd_cpu;
+        if (pass0 == 2) {
+            if (*listname)
+                nasmlist.init(listname, nasm_error);
+        }
+        in_abs_seg = false;
+        global_offset_changed = 0;  /* set by redefine_label */
+        location.segment = ofmt->section(NULL, pass2, &sb);
+        globalbits = sb;
+        if (passn > 1) {
+            saa_rewind(forwrefs);
+            forwref = saa_rstruct(forwrefs);
+            raa_free(offsets);
+            offsets = raa_init();
+        }
+        preproc->reset(fname, pass1, &nasmlist,
+                      pass1 == 2 ? depend_ptr : NULL);
+        memcpy(warning_on, warning_on_global, (ERR_WARN_MAX+1) * sizeof(bool));
+
+        globallineno = 0;
+        if (passn == 1)
+            location.known = true;
+        location.offset = offs = GET_CURR_OFFS;
+
+        while ((line = preproc->getline())) {
+           enum directives d;
+            globallineno++;
+
+            /*
+            * Here we parse our directives; this is not handled by the
+            * 'real' parser.  This really should be a separate function.
+            */
+            directive = line;
+           d = getkw(&directive, &value);
+            if (d) {
+               int err = 0;
+
+                switch (d) {
+                case D_SEGMENT:                /* [SEGMENT n] */
+               case D_SECTION:
+                    seg = ofmt->section(value, pass2, &sb);
+                    if (seg == NO_SEG) {
+                        nasm_error(pass1 == 1 ? ERR_NONFATAL : ERR_PANIC,
+                                     "segment name `%s' not recognized",
+                                     value);
+                    } else {
+                        in_abs_seg = false;
+                        location.segment = seg;
+                    }
+                    break;
+                case D_EXTERN:         /* [EXTERN label:special] */
+                    if (*value == '$')
+                        value++;        /* skip initial $ if present */
+                    if (pass0 == 2) {
+                        q = value;
+                        while (*q && *q != ':')
+                            q++;
+                        if (*q == ':') {
+                            *q++ = '\0';
+                            ofmt->symdef(value, 0L, 0L, 3, q);
+                        }
+                    } else if (passn == 1) {
+                        q = value;
+                        validid = true;
+                        if (!isidstart(*q))
+                            validid = false;
+                        while (*q && *q != ':') {
+                            if (!isidchar(*q))
+                                validid = false;
+                            q++;
+                        }
+                        if (!validid) {
+                            nasm_error(ERR_NONFATAL,
+                                         "identifier expected after EXTERN");
+                            break;
+                        }
+                        if (*q == ':') {
+                            *q++ = '\0';
+                            special = q;
+                        } else
+                            special = NULL;
+                        if (!is_extern(value)) {        /* allow re-EXTERN to be ignored */
+                            int temp = pass0;
+                            pass0 = 1;  /* fake pass 1 in labels.c */
+                            declare_as_global(value, special);
+                            define_label(value, seg_alloc(), 0L, NULL,
+                                         false, true);
+                            pass0 = temp;
+                        }
+                    }           /* else  pass0 == 1 */
+                    break;
+                case D_BITS:           /* [BITS bits] */
+                    globalbits = sb = get_bits(value);
+                    break;
+                case D_GLOBAL:         /* [GLOBAL symbol:special] */
+                    if (*value == '$')
+                        value++;        /* skip initial $ if present */
+                    if (pass0 == 2) {   /* pass 2 */
+                        q = value;
+                        while (*q && *q != ':')
+                            q++;
+                        if (*q == ':') {
+                            *q++ = '\0';
+                            ofmt->symdef(value, 0L, 0L, 3, q);
+                        }
+                    } else if (pass2 == 1) {    /* pass == 1 */
+                        q = value;
+                        validid = true;
+                        if (!isidstart(*q))
+                            validid = false;
+                        while (*q && *q != ':') {
+                            if (!isidchar(*q))
+                                validid = false;
+                            q++;
+                        }
+                        if (!validid) {
+                            nasm_error(ERR_NONFATAL,
+                                         "identifier expected after GLOBAL");
+                            break;
+                        }
+                        if (*q == ':') {
+                            *q++ = '\0';
+                            special = q;
+                        } else
+                            special = NULL;
+                        declare_as_global(value, special);
+                    }           /* pass == 1 */
+                    break;
+                case D_COMMON:         /* [COMMON symbol size:special] */
+               {
+                   int64_t size;
+
+                    if (*value == '$')
+                        value++;        /* skip initial $ if present */
+                   p = value;
+                   validid = true;
+                   if (!isidstart(*p))
+                       validid = false;
+                   while (*p && !nasm_isspace(*p)) {
+                       if (!isidchar(*p))
+                           validid = false;
+                       p++;
+                   }
+                   if (!validid) {
+                       nasm_error(ERR_NONFATAL,
+                                    "identifier expected after COMMON");
+                       break;
+                   }
+                   if (*p) {
+                        p = nasm_zap_spaces_fwd(p);
+                       q = p;
+                       while (*q && *q != ':')
+                           q++;
+                       if (*q == ':') {
+                           *q++ = '\0';
+                           special = q;
+                       } else {
+                           special = NULL;
+                       }
+                       size = readnum(p, &rn_error);
+                       if (rn_error) {
+                           nasm_error(ERR_NONFATAL,
+                                        "invalid size specified"
+                                        " in COMMON declaration");
+                           break;
+                       }
+                   } else {
+                       nasm_error(ERR_NONFATAL,
+                                    "no size specified in"
+                                    " COMMON declaration");
+                       break;
+                   }
+
+                    if (pass0 < 2) {
+                       define_common(value, seg_alloc(), size, special);
+                    } else if (pass0 == 2) {
+                       if (special)
+                           ofmt->symdef(value, 0L, 0L, 3, special);
+                    }
+                    break;
+               }
+                case D_ABSOLUTE:               /* [ABSOLUTE address] */
+                    stdscan_reset();
+                    stdscan_set(value);
+                    tokval.t_type = TOKEN_INVALID;
+                    e = evaluate(stdscan, NULL, &tokval, NULL, pass2,
+                                 nasm_error, NULL);
+                    if (e) {
+                        if (!is_reloc(e))
+                            nasm_error(pass0 ==
+                                         1 ? ERR_NONFATAL : ERR_PANIC,
+                                         "cannot use non-relocatable expression as "
+                                         "ABSOLUTE address");
+                        else {
+                            abs_seg = reloc_seg(e);
+                            abs_offset = reloc_value(e);
+                        }
+                    } else if (passn == 1)
+                        abs_offset = 0x100;     /* don't go near zero in case of / */
+                    else
+                        nasm_error(ERR_PANIC, "invalid ABSOLUTE address "
+                                     "in pass two");
+                    in_abs_seg = true;
+                    location.segment = NO_SEG;
+                    break;
+                case D_DEBUG:          /* [DEBUG] */
+               {
+                   char debugid[128];
+                   bool badid, overlong;
+
+                    p = value;
+                    q = debugid;
+                   badid = overlong = false;
+                    if (!isidstart(*p)) {
+                        badid = true;
+                   } else {
+                       while (*p && !nasm_isspace(*p)) {
+                           if (q >= debugid + sizeof debugid - 1) {
+                               overlong = true;
+                               break;
+                           }
+                           if (!isidchar(*p))
+                               badid = true;
+                           *q++ = *p++;
+                       }
+                       *q = 0;
+                   }
+                    if (badid) {
+                       nasm_error(passn == 1 ? ERR_NONFATAL : ERR_PANIC,
+                                  "identifier expected after DEBUG");
+                       break;
+                   }
+                   if (overlong) {
+                       nasm_error(passn == 1 ? ERR_NONFATAL : ERR_PANIC,
+                                  "DEBUG identifier too long");
+                       break;
+                   }
+                    p = nasm_skip_spaces(p);
+                    if (pass0 == 2)
+                        dfmt->debug_directive(debugid, p);
+                    break;
+               }
+                case D_WARNING:                /* [WARNING {+|-|*}warn-name] */
+                    value = nasm_skip_spaces(value);
+                   switch(*value) {
+                   case '-': validid = 0; value++; break;
+                   case '+': validid = 1; value++; break;
+                   case '*': validid = 2; value++; break;
+                   default:  validid = 1; break;
+                   }
+
+                   for (i = 1; i <= ERR_WARN_MAX; i++)
+                       if (!nasm_stricmp(value, warnings[i].name))
+                           break;
+                   if (i <= ERR_WARN_MAX) {
+                       switch(validid) {
+                       case 0:
+                           warning_on[i] = false;
+                           break;
+                       case 1:
+                           warning_on[i] = true;
+                           break;
+                       case 2:
+                           warning_on[i] = warning_on_global[i];
+                           break;
+                       }
+                   }
+                   else
+                       nasm_error(ERR_NONFATAL,
+                                    "invalid warning id in WARNING directive");
+                    break;
+                case D_CPU:            /* [CPU] */
+                    cpu = get_cpu(value);
+                    break;
+                case D_LIST:           /* [LIST {+|-}] */
+                    value = nasm_skip_spaces(value);
+                    if (*value == '+') {
+                        user_nolist = 0;
+                    } else {
+                        if (*value == '-') {
+                            user_nolist = 1;
+                        } else {
+                           err = 1;
+                        }
+                    }
+                    break;
+               case D_DEFAULT:         /* [DEFAULT] */
+                   stdscan_reset();
+                    stdscan_set(value);
+                    tokval.t_type = TOKEN_INVALID;
+                   if (stdscan(NULL, &tokval) == TOKEN_SPECIAL) {
+                       switch ((int)tokval.t_integer) {
+                       case S_REL:
+                           globalrel = 1;
+                           break;
+                       case S_ABS:
+                           globalrel = 0;
+                           break;
+                       default:
+                           err = 1;
+                           break;
+                       }
+                   } else {
+                       err = 1;
+                   }
+                   break;
+               case D_FLOAT:
+                   if (float_option(value)) {
+                       nasm_error(pass1 == 1 ? ERR_NONFATAL : ERR_PANIC,
+                                    "unknown 'float' directive: %s",
+                                    value);
+                   }
+                   break;
+                default:
+                   if (!d || !ofmt->directive(d, value, pass2))
+                        nasm_error(pass1 == 1 ? ERR_NONFATAL : ERR_PANIC,
+                                     "unrecognised directive [%s]",
+                                     directive);
+                   break;
+                }
+               if (err) {
+                   nasm_error(ERR_NONFATAL,
+                                "invalid parameter to [%s] directive",
+                                directive);
+               }
+            } else {            /* it isn't a directive */
+                parse_line(pass1, line, &output_ins, def_label);
+
+                if (optimizing > 0) {
+                    if (forwref != NULL && globallineno == forwref->lineno) {
+                        output_ins.forw_ref = true;
+                        do {
+                            output_ins.oprs[forwref->operand].opflags |= OPFLAG_FORWARD;
+                            forwref = saa_rstruct(forwrefs);
+                        } while (forwref != NULL
+                                 && 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++) {
+                               if (output_ins.oprs[i].opflags & OPFLAG_FORWARD) {
+                                   struct forwrefinfo *fwinf =
+                                       (struct forwrefinfo *)
+                                       saa_wstruct(forwrefs);
+                                   fwinf->lineno = globallineno;
+                                fwinf->operand = i;
+                               }
+                           }
+                       }
+                    }
+                }
+
+                /*  forw_ref */
+                if (output_ins.opcode == I_EQU) {
+                    if (pass1 == 1) {
+                        /*
+                         * Special `..' EQUs get processed in pass two,
+                         * except `..@' macro-processor EQUs which are done
+                         * in the normal place.
+                         */
+                        if (!output_ins.label)
+                            nasm_error(ERR_NONFATAL,
+                                         "EQU not preceded by label");
+
+                        else if (output_ins.label[0] != '.' ||
+                                 output_ins.label[1] != '.' ||
+                                 output_ins.label[2] == '@') {
+                            if (output_ins.operands == 1 &&
+                                (output_ins.oprs[0].type & IMMEDIATE) &&
+                                output_ins.oprs[0].wrt == NO_SEG) {
+                                bool isext = !!(output_ins.oprs[0].opflags
+                                               & OPFLAG_EXTERN);
+                                def_label(output_ins.label,
+                                          output_ins.oprs[0].segment,
+                                          output_ins.oprs[0].offset, NULL,
+                                          false, isext);
+                            } else if (output_ins.operands == 2
+                                       && (output_ins.oprs[0].type & IMMEDIATE)
+                                       && (output_ins.oprs[0].type & COLON)
+                                       && output_ins.oprs[0].segment == NO_SEG
+                                       && output_ins.oprs[0].wrt == NO_SEG
+                                       && (output_ins.oprs[1].type & IMMEDIATE)
+                                       && output_ins.oprs[1].segment == NO_SEG
+                                       && output_ins.oprs[1].wrt == NO_SEG) {
+                                def_label(output_ins.label,
+                                          output_ins.oprs[0].offset | SEG_ABS,
+                                          output_ins.oprs[1].offset,
+                                         NULL, false, false);
+                            } else
+                                nasm_error(ERR_NONFATAL,
+                                             "bad syntax for EQU");
+                        }
+                    } else {
+                        /*
+                         * Special `..' EQUs get processed here, except
+                         * `..@' macro processor EQUs which are done above.
+                         */
+                        if (output_ins.label[0] == '.' &&
+                            output_ins.label[1] == '.' &&
+                            output_ins.label[2] != '@') {
+                            if (output_ins.operands == 1 &&
+                                (output_ins.oprs[0].type & IMMEDIATE)) {
+                                define_label(output_ins.label,
+                                             output_ins.oprs[0].segment,
+                                             output_ins.oprs[0].offset,
+                                             NULL, false, false);
+                            } else if (output_ins.operands == 2
+                                       && (output_ins.oprs[0].type & IMMEDIATE)
+                                       && (output_ins.oprs[0].type & COLON)
+                                       && output_ins.oprs[0].segment == NO_SEG
+                                       && (output_ins.oprs[1].type & IMMEDIATE)
+                                       && output_ins.oprs[1].segment == NO_SEG) {
+                                define_label(output_ins.label,
+                                             output_ins.oprs[0].offset | SEG_ABS,
+                                             output_ins.oprs[1].offset,
+                                             NULL, false, false);
+                            } else
+                                nasm_error(ERR_NONFATAL,
+                                             "bad syntax for EQU");
+                        }
+                    }
+                } else {        /* instruction isn't an EQU */
+
+                    if (pass1 == 1) {
+
+                        int64_t l = insn_size(location.segment, offs, sb, cpu,
+                                           &output_ins, nasm_error);
+
+                        /* if (using_debug_info)  && output_ins.opcode != -1) */
+                        if (using_debug_info)
+                        {       /* fbk 03/25/01 */
+                            /* this is done here so we can do debug type info */
+                            int32_t typeinfo =
+                                TYS_ELEMENTS(output_ins.operands);
+                            switch (output_ins.opcode) {
+                            case I_RESB:
+                                typeinfo =
+                                    TYS_ELEMENTS(output_ins.oprs[0].offset) | TY_BYTE;
+                                break;
+                            case I_RESW:
+                                typeinfo =
+                                    TYS_ELEMENTS(output_ins.oprs[0].offset) | TY_WORD;
+                                break;
+                            case I_RESD:
+                                typeinfo =
+                                    TYS_ELEMENTS(output_ins.oprs[0].offset) | TY_DWORD;
+                                break;
+                            case I_RESQ:
+                                typeinfo =
+                                    TYS_ELEMENTS(output_ins.oprs[0].offset) | TY_QWORD;
+                                break;
+                            case I_REST:
+                                typeinfo =
+                                    TYS_ELEMENTS(output_ins.oprs[0].offset) | TY_TBYTE;
+                                break;
+                            case I_RESO:
+                                typeinfo =
+                                    TYS_ELEMENTS(output_ins.oprs[0].offset) | TY_OWORD;
+                                break;
+                            case I_RESY:
+                                typeinfo =
+                                    TYS_ELEMENTS(output_ins.oprs[0].offset) | TY_YWORD;
+                                break;
+                            case I_DB:
+                                typeinfo |= TY_BYTE;
+                                break;
+                            case I_DW:
+                                typeinfo |= TY_WORD;
+                                break;
+                            case I_DD:
+                                if (output_ins.eops_float)
+                                    typeinfo |= TY_FLOAT;
+                                else
+                                    typeinfo |= TY_DWORD;
+                                break;
+                            case I_DQ:
+                                typeinfo |= TY_QWORD;
+                                break;
+                            case I_DT:
+                                typeinfo |= TY_TBYTE;
+                                break;
+                           case I_DO:
+                               typeinfo |= TY_OWORD;
+                               break;
+                           case I_DY:
+                               typeinfo |= TY_YWORD;
+                               break;
+                            default:
+                                typeinfo = TY_LABEL;
+
+                            }
+
+                            dfmt->debug_typevalue(typeinfo);
+                        }
+                        if (l != -1) {
+                            offs += l;
+                            SET_CURR_OFFS(offs);
+                        }
+                        /*
+                         * else l == -1 => invalid instruction, which will be
+                         * flagged as an error on pass 2
+                         */
+
+                    } else {
+                        offs += assemble(location.segment, offs, sb, cpu,
+                                         &output_ins, ofmt, nasm_error,
+                                         &nasmlist);
+                        SET_CURR_OFFS(offs);
+
+                    }
+                }               /* not an EQU */
+                cleanup_insn(&output_ins);
+            }
+            nasm_free(line);
+            location.offset = offs = GET_CURR_OFFS;
+        }                       /* end while (line = preproc->getline... */
+
+        if (pass0 == 2 && global_offset_changed && !terminate_after_phase)
+            nasm_error(ERR_NONFATAL,
+                        "phase error detected at end of assembly.");
+
+        if (pass1 == 1)
+            preproc->cleanup(1);
+
+        if ((passn > 1 && !global_offset_changed) || pass0 == 2) {
+            pass0++;
+       } else if (global_offset_changed &&
+                global_offset_changed < prev_offset_changed) {
+            prev_offset_changed = global_offset_changed;
+            stall_count = 0;
+       } else {
+           stall_count++;
+       }
+
+       if (terminate_after_phase)
+           break;
+
+        if ((stall_count > 997) || (passn >= pass_max)) {
+            /* We get here if the labels don't converge
+             * Example: FOO equ FOO + 1
+             */
+             nasm_error(ERR_NONFATAL,
+                          "Can't find valid values for all labels "
+                          "after %d passes, giving up.", passn);
+            nasm_error(ERR_NONFATAL,
+                         "Possible causes: recursive EQUs, macro abuse.");
+            break;
+       }
+    }
+
+    preproc->cleanup(0);
+    nasmlist.cleanup();
+    if (!terminate_after_phase && opt_verbose_info) {
+       /*  -On and -Ov switches */
+        fprintf(stdout, "info: assembly required 1+%d+1 passes\n", passn-3);
+    }
+}
+
+static enum directives getkw(char **directive, char **value)
+{
+    char *p, *q, *buf;
+
+    buf = nasm_skip_spaces(*directive);
+
+    /* it should be enclosed in [ ] */
+    if (*buf != '[')
+        return D_NONE;
+    q = strchr(buf, ']');
+    if (!q)
+        return D_NONE;
+
+    /* stip off the comments */
+    p = strchr(buf, ';');
+    if (p) {
+        if (p < q) /* ouch! somwhere inside */
+            return D_NONE;
+        *p = '\0';
+    }
+
+    /* no brace, no trailing spaces */
+    *q = '\0';
+    nasm_zap_spaces_rev(--q);
+
+    /* directive */
+    p = nasm_skip_spaces(++buf);
+    q = nasm_skip_word(p);
+    if (!q)
+        return D_NONE; /* sigh... no value there */
+    *q = '\0';
+    *directive = p;
+
+    /* and value finally */
+    p = nasm_skip_spaces(++q);
+    *value = p;
+
+    return find_directive(*directive);
+}
+
+/**
+ * gnu style error reporting
+ * This function prints an error message to error_file in the
+ * style used by GNU. An example would be:
+ * file.asm:50: error: blah blah blah
+ * where file.asm is the name of the file, 50 is the line number on
+ * which the error occurs (or is detected) and "error:" is one of
+ * the possible optional diagnostics -- it can be "error" or "warning"
+ * or something else.  Finally the line terminates with the actual
+ * error message.
+ *
+ * @param severity the severity of the warning or error
+ * @param fmt the printf style format string
+ */
+static void nasm_verror_gnu(int severity, const char *fmt, va_list ap)
+{
+    char *currentfile = NULL;
+    int32_t lineno = 0;
+
+    if (is_suppressed_warning(severity))
+        return;
+
+    if (!(severity & ERR_NOFILE))
+        src_get(&lineno, &currentfile);
+
+    if (currentfile) {
+       fprintf(error_file, "%s:%"PRId32": ", currentfile, lineno);
+       nasm_free(currentfile);
+    } else {
+       fputs("nasm: ", error_file);
+    }
+
+    nasm_verror_common(severity, fmt, ap);
+}
+
+/**
+ * MS style error reporting
+ * This function prints an error message to error_file in the
+ * style used by Visual C and some other Microsoft tools. An example
+ * would be:
+ * file.asm(50) : error: blah blah blah
+ * where file.asm is the name of the file, 50 is the line number on
+ * which the error occurs (or is detected) and "error:" is one of
+ * the possible optional diagnostics -- it can be "error" or "warning"
+ * or something else.  Finally the line terminates with the actual
+ * error message.
+ *
+ * @param severity the severity of the warning or error
+ * @param fmt the printf style format string
+ */
+static void nasm_verror_vc(int severity, const char *fmt, va_list ap)
+{
+    char *currentfile = NULL;
+    int32_t lineno = 0;
+
+    if (is_suppressed_warning(severity))
+        return;
+
+    if (!(severity & ERR_NOFILE))
+        src_get(&lineno, &currentfile);
+
+    if (currentfile) {
+        fprintf(error_file, "%s(%"PRId32") : ", currentfile, lineno);
+        nasm_free(currentfile);
+    } else {
+        fputs("nasm: ", error_file);
+    }
+
+    nasm_verror_common(severity, fmt, ap);
+}
+
+/**
+ * check for supressed warning
+ * checks for suppressed warning or pass one only warning and we're
+ * not in pass 1
+ *
+ * @param severity the severity of the warning or error
+ * @return true if we should abort error/warning printing
+ */
+static bool is_suppressed_warning(int severity)
+{
+    /*
+     * See if it's a suppressed warning.
+     */
+    return (severity & ERR_MASK) == ERR_WARNING &&
+       (((severity & ERR_WARN_MASK) != 0 &&
+         !warning_on[(severity & ERR_WARN_MASK) >> ERR_WARN_SHR]) ||
+        /* See if it's a pass-one only warning and we're not in pass one. */
+        ((severity & ERR_PASS1) && pass0 != 1) ||
+        ((severity & ERR_PASS2) && pass0 != 2));
+}
+
+/**
+ * common error reporting
+ * This is the common back end of the error reporting schemes currently
+ * implemented.  It prints the nature of the warning and then the
+ * specific error message to error_file and may or may not return.  It
+ * doesn't return if the error severity is a "panic" or "debug" type.
+ *
+ * @param severity the severity of the warning or error
+ * @param fmt the printf style format string
+ */
+static void nasm_verror_common(int severity, const char *fmt, va_list args)
+{
+    char msg[1024];
+    const char *pfx;
+
+    switch (severity & (ERR_MASK|ERR_NO_SEVERITY)) {
+    case ERR_WARNING:
+        pfx = "warning: ";
+        break;
+    case ERR_NONFATAL:
+        pfx = "error: ";
+        break;
+    case ERR_FATAL:
+        pfx = "fatal: ";
+        break;
+    case ERR_PANIC:
+        pfx = "panic: ";
+        break;
+    case ERR_DEBUG:
+        pfx = "debug: ";
+        break;
+    default:
+       pfx = "";
+       break;
+    }
+
+    vsnprintf(msg, sizeof msg, fmt, args);
+
+    fprintf(error_file, "%s%s\n", pfx, msg);
+
+    if (*listname)
+       nasmlist.error(severity, pfx, msg);
+
+    if (severity & ERR_USAGE)
+        want_usage = true;
+
+    switch (severity & ERR_MASK) {
+    case ERR_DEBUG:
+        /* no further action, by definition */
+        break;
+    case ERR_WARNING:
+       if (warning_on[0])      /* Treat warnings as errors */
+           terminate_after_phase = true;
+       break;
+    case ERR_NONFATAL:
+        terminate_after_phase = true;
+        break;
+    case ERR_FATAL:
+        if (ofile) {
+            fclose(ofile);
+            remove(outname);
+           ofile = NULL;
+        }
+        if (want_usage)
+            usage();
+        exit(1);                /* instantly die */
+        break;                  /* placate silly compilers */
+    case ERR_PANIC:
+        fflush(NULL);
+        /*     abort();        *//* halt, catch fire, and dump core */
+        exit(3);
+        break;
+    }
+}
+
+static void usage(void)
+{
+    fputs("type `nasm -h' for help\n", error_file);
+}
+
+#define BUF_DELTA 512
+
+static FILE *no_pp_fp;
+static ListGen *no_pp_list;
+static int32_t no_pp_lineinc;
+
+static void no_pp_reset(char *file, int pass, ListGen * listgen,
+                       StrList **deplist)
+{
+    src_set_fname(nasm_strdup(file));
+    src_set_linnum(0);
+    no_pp_lineinc = 1;
+    no_pp_fp = fopen(file, "r");
+    if (!no_pp_fp)
+        nasm_error(ERR_FATAL | ERR_NOFILE,
+                  "unable to open input file `%s'", file);
+    no_pp_list = listgen;
+    (void)pass;                 /* placate compilers */
+
+    if (deplist) {
+       StrList *sl = nasm_malloc(strlen(file)+1+sizeof sl->next);
+       sl->next = NULL;
+       strcpy(sl->str, file);
+       *deplist = sl;
+    }
+}
+
+static char *no_pp_getline(void)
+{
+    char *buffer, *p, *q;
+    int bufsize;
+
+    bufsize = BUF_DELTA;
+    buffer = nasm_malloc(BUF_DELTA);
+    src_set_linnum(src_get_linnum() + no_pp_lineinc);
+
+    while (1) {                 /* Loop to handle %line */
+
+        p = buffer;
+        while (1) {             /* Loop to handle long lines */
+            q = fgets(p, bufsize - (p - buffer), no_pp_fp);
+            if (!q)
+                break;
+            p += strlen(p);
+            if (p > buffer && p[-1] == '\n')
+                break;
+            if (p - buffer > bufsize - 10) {
+                int offset;
+                offset = p - buffer;
+                bufsize += BUF_DELTA;
+                buffer = nasm_realloc(buffer, bufsize);
+                p = buffer + offset;
+            }
+        }
+
+        if (!q && p == buffer) {
+            nasm_free(buffer);
+            return NULL;
+        }
+
+        /*
+         * Play safe: remove CRs, LFs and any spurious ^Zs, if any of
+         * them are present at the end of the line.
+         */
+        buffer[strcspn(buffer, "\r\n\032")] = '\0';
+
+        if (!nasm_strnicmp(buffer, "%line", 5)) {
+            int32_t ln;
+            int li;
+            char *nm = nasm_malloc(strlen(buffer));
+            if (sscanf(buffer + 5, "%"PRId32"+%d %s", &ln, &li, nm) == 3) {
+                nasm_free(src_set_fname(nm));
+                src_set_linnum(ln);
+                no_pp_lineinc = li;
+                continue;
+            }
+            nasm_free(nm);
+        }
+        break;
+    }
+
+    no_pp_list->line(LIST_READ, buffer);
+
+    return buffer;
+}
+
+static void no_pp_cleanup(int pass)
+{
+    (void)pass;                     /* placate GCC */
+    fclose(no_pp_fp);
+}
+
+static uint32_t get_cpu(char *value)
+{
+    if (!strcmp(value, "8086"))
+        return IF_8086;
+    if (!strcmp(value, "186"))
+        return IF_186;
+    if (!strcmp(value, "286"))
+        return IF_286;
+    if (!strcmp(value, "386"))
+        return IF_386;
+    if (!strcmp(value, "486"))
+        return IF_486;
+    if (!strcmp(value, "586") || !nasm_stricmp(value, "pentium"))
+        return IF_PENT;
+    if (!strcmp(value, "686") ||
+        !nasm_stricmp(value, "ppro") ||
+        !nasm_stricmp(value, "pentiumpro") || !nasm_stricmp(value, "p2"))
+        return IF_P6;
+    if (!nasm_stricmp(value, "p3") || !nasm_stricmp(value, "katmai"))
+        return IF_KATMAI;
+    if (!nasm_stricmp(value, "p4") ||   /* is this right? -- jrc */
+        !nasm_stricmp(value, "willamette"))
+        return IF_WILLAMETTE;
+    if (!nasm_stricmp(value, "prescott"))
+        return IF_PRESCOTT;
+    if (!nasm_stricmp(value, "x64") ||
+        !nasm_stricmp(value, "x86-64"))
+        return IF_X86_64;
+    if (!nasm_stricmp(value, "ia64") ||
+        !nasm_stricmp(value, "ia-64") ||
+        !nasm_stricmp(value, "itanium") ||
+        !nasm_stricmp(value, "itanic") || !nasm_stricmp(value, "merced"))
+        return IF_IA64;
+
+    nasm_error(pass0 < 2 ? ERR_NONFATAL : ERR_FATAL,
+                 "unknown 'cpu' type");
+
+    return IF_PLEVEL;           /* the maximum level */
+}
+
+static int get_bits(char *value)
+{
+    int i;
+
+    if ((i = atoi(value)) == 16)
+        return i;               /* set for a 16-bit segment */
+    else if (i == 32) {
+        if (cpu < IF_386) {
+            nasm_error(ERR_NONFATAL,
+                         "cannot specify 32-bit segment on processor below a 386");
+            i = 16;
+        }
+    } else if (i == 64) {
+        if (cpu < IF_X86_64) {
+            nasm_error(ERR_NONFATAL,
+                         "cannot specify 64-bit segment on processor below an x86-64");
+            i = 16;
+        }
+        if (i != maxbits) {
+            nasm_error(ERR_NONFATAL,
+                         "%s output format does not support 64-bit code",
+                         ofmt->shortname);
+            i = 16;
+        }
+    } else {
+        nasm_error(pass0 < 2 ? ERR_NONFATAL : ERR_FATAL,
+                     "`%s' is not a valid segment size; must be 16, 32 or 64",
+                     value);
+        i = 16;
+    }
+    return i;
+}
diff --git a/nasm.h b/nasm.h
new file mode 100644 (file)
index 0000000..5d5aae7
--- /dev/null
+++ b/nasm.h
@@ -0,0 +1,893 @@
+/* ----------------------------------------------------------------------- *
+ *   
+ *   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.
+ *
+ * ----------------------------------------------------------------------- */
+
+/* 
+ * nasm.h   main header file for the Netwide Assembler: inter-module interface
+ */
+
+#ifndef NASM_NASM_H
+#define NASM_NASM_H
+
+#include "compiler.h"
+
+#include <stdio.h>
+#include <inttypes.h>
+#include "nasmlib.h"
+#include "preproc.h"
+#include "insnsi.h"            /* For enum opcode */
+#include "directives.h"                /* For enum directive */
+#include "opflags.h"
+
+#define NO_SEG -1L              /* null segment value */
+#define SEG_ABS 0x40000000L     /* mask for far-absolute segments */
+
+#ifndef FILENAME_MAX
+#define FILENAME_MAX 256
+#endif
+
+#ifndef PREFIX_MAX
+#define PREFIX_MAX 10
+#endif
+
+#ifndef POSTFIX_MAX
+#define POSTFIX_MAX 10
+#endif
+
+#define IDLEN_MAX 4096
+
+/*
+ * Name pollution problems: <time.h> on Digital UNIX pulls in some
+ * strange hardware header file which sees fit to define R_SP. We
+ * undefine it here so as not to break the enum below.
+ */
+#ifdef R_SP
+#undef R_SP
+#endif
+
+/*
+ * We must declare the existence of this structure type up here,
+ * since we have to reference it before we define it...
+ */
+struct ofmt;
+
+/*
+ * values for the `type' parameter to an output function.
+ *
+ * Exceptions are OUT_RELxADR, which denote an x-byte relocation
+ * which will be a relative jump. For this we need to know the
+ * distance in bytes from the start of the relocated record until
+ * the end of the containing instruction. _This_ is what is stored
+ * in the size part of the parameter, in this case.
+ *
+ * Also OUT_RESERVE denotes reservation of N bytes of BSS space,
+ * and the contents of the "data" parameter is irrelevant.
+ *
+ * The "data" parameter for the output function points to a "int32_t",
+ * containing the address in question, unless the type is
+ * OUT_RAWDATA, in which case it points to an "uint8_t"
+ * array.
+ */
+enum out_type {
+    OUT_RAWDATA,               /* Plain bytes */
+    OUT_ADDRESS,               /* An address (symbol value) */
+    OUT_RESERVE,               /* Reserved bytes (RESB et al) */
+    OUT_REL2ADR,               /* 2-byte relative address */
+    OUT_REL4ADR,               /* 4-byte relative address */
+    OUT_REL8ADR,               /* 8-byte relative address */
+};
+
+/*
+ * -----------------------
+ * Other function typedefs
+ * -----------------------
+ */
+
+/*
+ * A label-lookup function should look like this.
+ */
+typedef bool (*lfunc) (char *label, int32_t *segment, int64_t *offset);
+
+/*
+ * And a label-definition function like this. The boolean parameter
+ * `is_norm' states whether the label is a `normal' label (which
+ * should affect the local-label system), or something odder like
+ * an EQU or a segment-base symbol, which shouldn't.
+ */
+typedef void (*ldfunc)(char *label, int32_t segment, int64_t offset,
+                      char *special, bool is_norm, bool isextrn);
+void define_label(char *label, int32_t segment, int64_t offset,
+                 char *special, bool is_norm, bool isextrn);
+
+/*
+ * List-file generators should look like this:
+ */
+typedef struct {
+    /*
+     * Called to initialize the listing file generator. Before this
+     * is called, the other routines will silently do nothing when
+     * called. The `char *' parameter is the file name to write the
+     * listing to.
+     */
+    void (*init) (char *, efunc);
+
+    /*
+     * Called to clear stuff up and close the listing file.
+     */
+    void (*cleanup) (void);
+
+    /*
+     * Called to output binary data. Parameters are: the offset;
+     * the data; the data type. Data types are similar to the
+     * output-format interface, only OUT_ADDRESS will _always_ be
+     * displayed as if it's relocatable, so ensure that any non-
+     * relocatable address has been converted to OUT_RAWDATA by
+     * then. Note that OUT_RAWDATA,0 is a valid data type, and is a
+     * dummy call used to give the listing generator an offset to
+     * work with when doing things like uplevel(LIST_TIMES) or
+     * uplevel(LIST_INCBIN).
+     */
+    void (*output) (int32_t, const void *, enum out_type, uint64_t);
+
+    /*
+     * Called to send a text line to the listing generator. The
+     * `int' parameter is LIST_READ or LIST_MACRO depending on
+     * whether the line came directly from an input file or is the
+     * result of a multi-line macro expansion.
+     */
+    void (*line) (int, char *);
+
+    /*
+     * Called to change one of the various levelled mechanisms in
+     * the listing generator. LIST_INCLUDE and LIST_MACRO can be
+     * used to increase the nesting level of include files and
+     * macro expansions; LIST_TIMES and LIST_INCBIN switch on the
+     * two binary-output-suppression mechanisms for large-scale
+     * pseudo-instructions.
+     *
+     * LIST_MACRO_NOLIST is synonymous with LIST_MACRO except that
+     * it indicates the beginning of the expansion of a `nolist'
+     * macro, so anything under that level won't be expanded unless
+     * it includes another file.
+     */
+    void (*uplevel) (int);
+
+    /*
+     * Reverse the effects of uplevel.
+     */
+    void (*downlevel) (int);
+
+    /*
+     * Called on a warning or error, with the error message.
+     */
+    void (*error)(int severity, const char *pfx, const char *msg);
+} ListGen;
+
+/*
+ * Token types returned by the scanner, in addition to ordinary
+ * ASCII character values, and zero for end-of-string.
+ */
+enum token_type {              /* token types, other than chars */
+    TOKEN_INVALID = -1,         /* a placeholder value */
+    TOKEN_EOS = 0,              /* end of string */
+    TOKEN_EQ = '=', TOKEN_GT = '>', TOKEN_LT = '<',     /* aliases */
+    TOKEN_ID = 256,            /* identifier */
+    TOKEN_NUM,                 /* numeric constant */
+    TOKEN_ERRNUM,              /* malformed numeric constant */
+    TOKEN_STR,                 /* string constant */
+    TOKEN_ERRSTR,               /* unterminated string constant */
+    TOKEN_FLOAT,                /* floating-point constant */
+    TOKEN_REG,                 /* register name */
+    TOKEN_INSN,                        /* instruction name */
+    TOKEN_HERE, TOKEN_BASE,     /* $ and $$ */
+    TOKEN_SPECIAL,              /* BYTE, WORD, DWORD, QWORD, FAR, NEAR, etc */
+    TOKEN_PREFIX,               /* A32, O16, LOCK, REPNZ, TIMES, etc */
+    TOKEN_SHL, TOKEN_SHR,       /* << and >> */
+    TOKEN_SDIV, TOKEN_SMOD,     /* // and %% */
+    TOKEN_GE, TOKEN_LE, TOKEN_NE,       /* >=, <= and <> (!= is same as <>) */
+    TOKEN_DBL_AND, TOKEN_DBL_OR, TOKEN_DBL_XOR, /* &&, || and ^^ */
+    TOKEN_SEG, TOKEN_WRT,       /* SEG and WRT */
+    TOKEN_FLOATIZE,            /* __floatX__ */
+    TOKEN_STRFUNC,             /* __utf16__, __utf32__ */
+};
+
+enum floatize {
+    FLOAT_8,
+    FLOAT_16,
+    FLOAT_32,
+    FLOAT_64,
+    FLOAT_80M,
+    FLOAT_80E,
+    FLOAT_128L,
+    FLOAT_128H,
+};
+
+/* Must match the list in string_transform(), in strfunc.c */
+enum strfunc {
+    STRFUNC_UTF16,
+    STRFUNC_UTF32,
+};
+
+size_t string_transform(char *, size_t, char **, enum strfunc);
+
+/*
+ * The expression evaluator must be passed a scanner function; a
+ * standard scanner is provided as part of nasmlib.c. The
+ * preprocessor will use a different one. Scanners, and the
+ * token-value structures they return, look like this.
+ *
+ * The return value from the scanner is always a copy of the
+ * `t_type' field in the structure.
+ */
+struct tokenval {
+    enum token_type t_type;
+    char *t_charptr;
+    int64_t t_integer, t_inttwo;
+};
+typedef int (*scanner) (void *private_data, struct tokenval * tv);
+
+struct location {
+    int64_t offset;
+    int32_t segment;
+    int known;
+};
+
+/*
+ * Expression-evaluator datatype. Expressions, within the
+ * evaluator, are stored as an array of these beasts, terminated by
+ * a record with type==0. Mostly, it's a vector type: each type
+ * denotes some kind of a component, and the value denotes the
+ * multiple of that component present in the expression. The
+ * exception is the WRT type, whose `value' field denotes the
+ * segment to which the expression is relative. These segments will
+ * be segment-base types, i.e. either odd segment values or SEG_ABS
+ * types. So it is still valid to assume that anything with a
+ * `value' field of zero is insignificant.
+ */
+typedef struct {
+    int32_t type;                  /* a register, or EXPR_xxx */
+    int64_t value;                 /* must be >= 32 bits */
+} expr;
+
+/*
+ * Library routines to manipulate expression data types.
+ */
+int is_reloc(expr *);
+int is_simple(expr *);
+int is_really_simple(expr *);
+int is_unknown(expr *);
+int is_just_unknown(expr *);
+int64_t reloc_value(expr *);
+int32_t reloc_seg(expr *);
+int32_t reloc_wrt(expr *);
+
+/*
+ * The evaluator can also return hints about which of two registers
+ * used in an expression should be the base register. See also the
+ * `operand' structure.
+ */
+struct eval_hints {
+    int64_t base;
+    int type;
+};
+
+/*
+ * The actual expression evaluator function looks like this. When
+ * called, it expects the first token of its expression to already
+ * be in `*tv'; if it is not, set tv->t_type to TOKEN_INVALID and
+ * it will start by calling the scanner.
+ *
+ * If a forward reference happens during evaluation, the evaluator
+ * must set `*fwref' to true if `fwref' is non-NULL.
+ *
+ * `critical' is non-zero if the expression may not contain forward
+ * references. The evaluator will report its own error if this
+ * occurs; if `critical' is 1, the error will be "symbol not
+ * defined before use", whereas if `critical' is 2, the error will
+ * be "symbol undefined".
+ *
+ * If `critical' has bit 8 set (in addition to its main value: 0x101
+ * and 0x102 correspond to 1 and 2) then an extended expression
+ * syntax is recognised, in which relational operators such as =, <
+ * and >= are accepted, as well as low-precedence logical operators
+ * &&, ^^ and ||.
+ *
+ * If `hints' is non-NULL, it gets filled in with some hints as to
+ * the base register in complex effective addresses.
+ */
+#define CRITICAL 0x100
+typedef expr *(*evalfunc) (scanner sc, void *scprivate,
+                           struct tokenval * tv, int *fwref, int critical,
+                           efunc error, struct eval_hints * hints);
+
+/*
+ * Special values for expr->type.  These come after EXPR_REG_END
+ * as defined in regs.h.
+ */
+
+#define EXPR_UNKNOWN   (EXPR_REG_END+1) /* forward references */
+#define EXPR_SIMPLE    (EXPR_REG_END+2)
+#define EXPR_WRT       (EXPR_REG_END+3)
+#define EXPR_SEGBASE   (EXPR_REG_END+4)
+
+/*
+ * Linked list of strings...
+ */
+typedef struct string_list {
+    struct string_list *next;
+    char str[1];
+} StrList;
+
+/*
+ * preprocessors ought to look like this:
+ */
+typedef struct preproc_ops {
+    /*
+     * Called at the start of a pass; given a file name, the number
+     * of the pass, an error reporting function, an evaluator
+     * function, and a listing generator to talk to.
+     */
+    void (*reset) (char *, int, ListGen *, StrList **);
+
+    /*
+     * Called to fetch a line of preprocessed source. The line
+     * returned has been malloc'ed, and so should be freed after
+     * use.
+     */
+    char *(*getline) (void);
+
+    /*
+     * Called at the end of a pass.
+     */
+    void (*cleanup) (int);
+} Preproc;
+
+extern Preproc nasmpp;
+
+/*
+ * ----------------------------------------------------------------
+ * Some lexical properties of the NASM source language, included
+ * here because they are shared between the parser and preprocessor
+ * ----------------------------------------------------------------
+ */
+
+/*
+ * isidstart matches any character that may start an identifier, and isidchar
+ * matches any character that may appear at places other than the start of an
+ * identifier. E.g. a period may only appear at the start of an identifier
+ * (for local labels), whereas a number may appear anywhere *but* at the
+ * start.
+ */
+
+#define isidstart(c) ( nasm_isalpha(c) || (c)=='_' || (c)=='.' || (c)=='?' \
+                                  || (c)=='@' )
+#define isidchar(c)  ( isidstart(c) || nasm_isdigit(c) || \
+                      (c)=='$' || (c)=='#' || (c)=='~' )
+
+/* Ditto for numeric constants. */
+
+#define isnumstart(c)  ( nasm_isdigit(c) || (c)=='$' )
+#define isnumchar(c)   ( nasm_isalnum(c) || (c)=='_' )
+
+/* This returns the numeric value of a given 'digit'. */
+
+#define numvalue(c)  ((c)>='a' ? (c)-'a'+10 : (c)>='A' ? (c)-'A'+10 : (c)-'0')
+
+/*
+ * Data-type flags that get passed to listing-file routines.
+ */
+enum {
+    LIST_READ, LIST_MACRO, LIST_MACRO_NOLIST, LIST_INCLUDE,
+    LIST_INCBIN, LIST_TIMES
+};
+
+/*
+ * -----------------------------------------------------------
+ * Format of the `insn' structure returned from `parser.c' and
+ * passed into `assemble.c'
+ * -----------------------------------------------------------
+ */
+
+/* Register names automatically generated from regs.dat */
+#include "regs.h"
+
+enum ccode {                   /* condition code names */
+    C_A, C_AE, C_B, C_BE, C_C, C_E, C_G, C_GE, C_L, C_LE, C_NA, C_NAE,
+    C_NB, C_NBE, C_NC, C_NE, C_NG, C_NGE, C_NL, C_NLE, C_NO, C_NP,
+    C_NS, C_NZ, C_O, C_P, C_PE, C_PO, C_S, C_Z,
+    C_none = -1
+};
+
+/*
+ * REX flags
+ */
+#define REX_REAL       0x4f    /* Actual REX prefix bits */
+#define REX_B          0x01    /* ModRM r/m extension */
+#define REX_X          0x02    /* SIB index extension */
+#define REX_R          0x04    /* ModRM reg extension */
+#define REX_W          0x08    /* 64-bit operand size */
+#define REX_L          0x20    /* Use LOCK prefix instead of REX.R */
+#define REX_P          0x40    /* REX prefix present/required */
+#define REX_H          0x80    /* High register present, REX forbidden */
+#define REX_D          0x0100  /* Instruction uses DREX instead of REX */
+#define REX_OC         0x0200  /* DREX suffix has the OC0 bit set */
+#define REX_V          0x0400  /* Instruction uses VEX/XOP instead of REX */
+#define REX_NH         0x0800  /* Instruction which doesn't use high regs */
+
+/*
+ * REX_V "classes" (prefixes which behave like VEX)
+ */
+enum vex_class {
+    RV_VEX             = 0,    /* C4/C5 */
+    RV_XOP             = 1     /* 8F */
+};
+
+/*
+ * Note that because segment registers may be used as instruction
+ * prefixes, we must ensure the enumerations for prefixes and
+ * register names do not overlap.
+ */
+enum prefixes {                        /* instruction prefixes */
+    P_none = 0,
+    PREFIX_ENUM_START = REG_ENUM_LIMIT,
+    P_A16 = PREFIX_ENUM_START, P_A32, P_A64, P_ASP,
+    P_LOCK, P_O16, P_O32, P_O64, P_OSP,
+    P_REP, P_REPE, P_REPNE, P_REPNZ, P_REPZ, P_TIMES,
+    P_WAIT,
+    PREFIX_ENUM_LIMIT
+};
+
+enum extop_type {              /* extended operand types */
+    EOT_NOTHING,
+    EOT_DB_STRING,             /* Byte string */
+    EOT_DB_STRING_FREE,                /* Byte string which should be nasm_free'd*/
+    EOT_DB_NUMBER,             /* Integer */
+};
+
+enum ea_flags {                        /* special EA flags */
+    EAF_BYTEOFFS =  1,          /* force offset part to byte size */
+    EAF_WORDOFFS =  2,          /* force offset part to [d]word size */
+    EAF_TIMESTWO =  4,          /* really do EAX*2 not EAX+EAX */
+    EAF_REL     =  8,          /* IP-relative addressing */
+    EAF_ABS      = 16,         /* non-IP-relative addressing */
+    EAF_FSGS    = 32           /* fs/gs segment override present */
+};
+
+enum eval_hint {                /* values for `hinttype' */
+    EAH_NOHINT   = 0,           /* no hint at all - our discretion */
+    EAH_MAKEBASE = 1,           /* try to make given reg the base */
+    EAH_NOTBASE  = 2            /* try _not_ to make reg the base */
+};
+
+typedef struct operand {       /* operand to an instruction */
+    opflags_t type;             /* type of operand */
+    int disp_size;              /* 0 means default; 16; 32; 64 */
+    enum reg_enum basereg, indexreg; /* address registers */
+    int scale;                 /* index scale */
+    int hintbase;
+    enum eval_hint hinttype;    /* hint as to real base register */
+    int32_t segment;            /* immediate segment, if needed */
+    int64_t offset;             /* any immediate number */
+    int32_t wrt;                /* segment base it's relative to */
+    int eaflags;                /* special EA flags */
+    int opflags;                /* see OPFLAG_* defines below */
+} operand;
+
+#define OPFLAG_FORWARD         1       /* operand is a forward reference */
+#define OPFLAG_EXTERN          2       /* operand is an external reference */
+#define OPFLAG_UNKNOWN         4       /* operand is an unknown reference */
+                                       /* (always a forward reference also) */
+
+typedef struct extop {          /* extended operand */
+    struct extop *next;         /* linked list */
+    char *stringval;           /* if it's a string, then here it is */
+    size_t stringlen;           /* ... and here's how long it is */
+    int64_t offset;             /* ... it's given here ... */
+    int32_t segment;            /* if it's a number/address, then... */
+    int32_t wrt;                /* ... and here */
+    enum extop_type type;      /* defined above */
+} extop;
+
+/* Prefix positions: each type of prefix goes in a specific slot.
+   This affects the final ordering of the assembled output, which
+   shouldn't matter to the processor, but if you have stylistic
+   preferences, you can change this.  REX prefixes are handled
+   differently for the time being.
+
+   Note that LOCK and REP are in the same slot.  This is
+   an x86 architectural constraint. */
+enum prefix_pos {
+    PPS_WAIT,                  /* WAIT (technically not a prefix!) */
+    PPS_LREP,                  /* Lock or REP prefix */
+    PPS_SEG,                   /* Segment override prefix */
+    PPS_OSIZE,                 /* Operand size prefix */
+    PPS_ASIZE,                 /* Address size prefix */
+    MAXPREFIX                  /* Total number of prefix slots */
+};
+
+/* If you need to change this, also change it in insns.pl */
+#define MAX_OPERANDS 5
+
+typedef struct insn {          /* an instruction itself */
+    char *label;               /* the label defined, or NULL */
+    enum prefixes prefixes[MAXPREFIX]; /* instruction prefixes, if any */
+    enum opcode opcode;         /* the opcode - not just the string */
+    enum ccode condition;       /* the condition code, if Jcc/SETcc */
+    int operands;               /* how many operands? 0-3
+                                 * (more if db et al) */
+    int addr_size;             /* address size */
+    operand oprs[MAX_OPERANDS]; /* the operands, defined as above */
+    extop *eops;                /* extended operands */
+    int eops_float;             /* true if DD and floating */
+    int32_t times;              /* repeat count (TIMES prefix) */
+    bool forw_ref;              /* is there a forward reference? */
+    int rex;                   /* Special REX Prefix */
+    int drexdst;               /* Destination register for DREX/VEX suffix */
+    int vex_cm;                        /* Class and M field for VEX prefix */
+    int vex_wlp;               /* W, P and L information for VEX prefix */
+} insn;
+
+enum geninfo { GI_SWITCH };
+/*
+ * ------------------------------------------------------------
+ * The data structure defining an output format driver, and the
+ * interfaces to the functions therein.
+ * ------------------------------------------------------------
+ */
+
+struct ofmt {
+    /*
+     * This is a short (one-liner) description of the type of
+     * output generated by the driver.
+     */
+    const char *fullname;
+
+    /*
+     * This is a single keyword used to select the driver.
+     */
+    const char *shortname;
+
+    /*
+     * Output format flags.
+     */
+#define OFMT_TEXT      1       /* Text file format */
+    unsigned int flags;
+
+    /*
+     * this is a pointer to the first element of the debug information
+     */
+    struct dfmt **debug_formats;
+
+    /*
+     * and a pointer to the element that is being used
+     * note: this is set to the default at compile time and changed if the
+     * -F option is selected.  If developing a set of new debug formats for
+     * an output format, be sure to set this to whatever default you want
+     *
+     */
+    const struct dfmt *current_dfmt;
+
+    /*
+     * This, if non-NULL, is a NULL-terminated list of `char *'s
+     * pointing to extra standard macros supplied by the object
+     * format (e.g. a sensible initial default value of __SECT__,
+     * and user-level equivalents for any format-specific
+     * directives).
+     */
+    macros_t *stdmac;
+
+    /*
+     * This procedure is called at the start of an output session to set
+     * up internal parameters.
+     */
+    void (*init)(void);
+
+    /*
+     * This procedure is called to pass generic information to the
+     * object file.  The first parameter gives the information type
+     * (currently only command line switches)
+     * and the second parameter gives the value.  This function returns
+     * 1 if recognized, 0 if unrecognized
+     */
+    int (*setinfo) (enum geninfo type, char **string);
+
+    /*
+     * This procedure is called by assemble() to write actual
+     * generated code or data to the object file. Typically it
+     * doesn't have to actually _write_ it, just store it for
+     * later.
+     *
+     * The `type' argument specifies the type of output data, and
+     * usually the size as well: its contents are described below.
+     */
+    void (*output) (int32_t segto, const void *data,
+                   enum out_type type, uint64_t size,
+                    int32_t segment, int32_t wrt);
+
+    /*
+     * This procedure is called once for every symbol defined in
+     * the module being assembled. It gives the name and value of
+     * the symbol, in NASM's terms, and indicates whether it has
+     * been declared to be global. Note that the parameter "name",
+     * when passed, will point to a piece of static storage
+     * allocated inside the label manager - it's safe to keep using
+     * that pointer, because the label manager doesn't clean up
+     * until after the output driver has.
+     *
+     * Values of `is_global' are: 0 means the symbol is local; 1
+     * means the symbol is global; 2 means the symbol is common (in
+     * which case `offset' holds the _size_ of the variable).
+     * Anything else is available for the output driver to use
+     * internally.
+     *
+     * This routine explicitly _is_ allowed to call the label
+     * manager to define further symbols, if it wants to, even
+     * though it's been called _from_ the label manager. That much
+     * re-entrancy is guaranteed in the label manager. However, the
+     * label manager will in turn call this routine, so it should
+     * be prepared to be re-entrant itself.
+     *
+     * The `special' parameter contains special information passed
+     * through from the command that defined the label: it may have
+     * been an EXTERN, a COMMON or a GLOBAL. The distinction should
+     * be obvious to the output format from the other parameters.
+     */
+    void (*symdef) (char *name, int32_t segment, int64_t offset,
+                   int is_global, char *special);
+
+    /*
+     * This procedure is called when the source code requests a
+     * segment change. It should return the corresponding segment
+     * _number_ for the name, or NO_SEG if the name is not a valid
+     * segment name.
+     *
+     * It may also be called with NULL, in which case it is to
+     * return the _default_ section number for starting assembly in.
+     *
+     * It is allowed to modify the string it is given a pointer to.
+     *
+     * It is also allowed to specify a default instruction size for
+     * the segment, by setting `*bits' to 16 or 32. Or, if it
+     * doesn't wish to define a default, it can leave `bits' alone.
+     */
+    int32_t (*section) (char *name, int pass, int *bits);
+
+    /*
+     * This procedure is called to modify the segment base values
+     * returned from the SEG operator. It is given a segment base
+     * value (i.e. a segment value with the low bit set), and is
+     * required to produce in return a segment value which may be
+     * different. It can map segment bases to absolute numbers by
+     * means of returning SEG_ABS types.
+     *
+     * It should return NO_SEG if the segment base cannot be
+     * determined; the evaluator (which calls this routine) is
+     * responsible for throwing an error condition if that occurs
+     * in pass two or in a critical expression.
+     */
+    int32_t (*segbase) (int32_t segment);
+
+    /*
+     * This procedure is called to allow the output driver to
+     * process its own specific directives. When called, it has the
+     * directive word in `directive' and the parameter string in
+     * `value'. It is called in both assembly passes, and `pass'
+     * will be either 1 or 2.
+     *
+     * This procedure should return zero if it does not _recognise_
+     * the directive, so that the main program can report an error.
+     * If it recognises the directive but then has its own errors,
+     * it should report them itself and then return non-zero. It
+     * should also return non-zero if it correctly processes the
+     * directive.
+     */
+    int (*directive)(enum directives directive, char *value, int pass);
+
+    /*
+     * This procedure is called before anything else - even before
+     * the "init" routine - and is passed the name of the input
+     * file from which this output file is being generated. It
+     * should return its preferred name for the output file in
+     * `outname', if outname[0] is not '\0', and do nothing to
+     * `outname' otherwise. Since it is called before the driver is
+     * properly initialized, it has to be passed its error handler
+     * separately.
+     *
+     * This procedure may also take its own copy of the input file
+     * name for use in writing the output file: it is _guaranteed_
+     * that it will be called before the "init" routine.
+     *
+     * The parameter `outname' points to an area of storage
+     * guaranteed to be at least FILENAME_MAX in size.
+     */
+    void (*filename) (char *inname, char *outname);
+
+    /*
+     * This procedure is called after assembly finishes, to allow
+     * the output driver to clean itself up and free its memory.
+     * Typically, it will also be the point at which the object
+     * file actually gets _written_.
+     *
+     * One thing the cleanup routine should always do is to close
+     * the output file pointer.
+     */
+    void (*cleanup) (int debuginfo);
+};
+
+extern struct ofmt *ofmt;
+extern FILE *ofile;
+
+/*
+ * ------------------------------------------------------------
+ * The data structure defining a debug format driver, and the
+ * interfaces to the functions therein.
+ * ------------------------------------------------------------
+ */
+
+struct dfmt {
+    /*
+     * This is a short (one-liner) description of the type of
+     * output generated by the driver.
+     */
+    const char *fullname;
+
+    /*
+     * This is a single keyword used to select the driver.
+     */
+    const char *shortname;
+
+    /*
+     * init - called initially to set up local pointer to object format.
+     */
+    void (*init)(void);
+
+    /*
+     * linenum - called any time there is output with a change of
+     * line number or file.
+     */
+    void (*linenum)(const char *filename, int32_t linenumber, int32_t segto);
+
+    /*
+     * debug_deflabel - called whenever a label is defined. Parameters
+     * are the same as to 'symdef()' in the output format. This function
+     * would be called before the output format version.
+     */
+
+    void (*debug_deflabel)(char *name, int32_t segment, int64_t offset,
+                          int is_global, char *special);
+    /*
+     * debug_directive - called whenever a DEBUG directive other than 'LINE'
+     * is encountered. 'directive' contains the first parameter to the
+     * DEBUG directive, and params contains the rest. For example,
+     * 'DEBUG VAR _somevar:int' would translate to a call to this
+     * function with 'directive' equal to "VAR" and 'params' equal to
+     * "_somevar:int".
+     */
+    void (*debug_directive)(const char *directive, const char *params);
+
+    /*
+     * typevalue - called whenever the assembler wishes to register a type
+     * for the last defined label.  This routine MUST detect if a type was
+     * already registered and not re-register it.
+     */
+    void (*debug_typevalue)(int32_t type);
+
+    /*
+     * debug_output - called whenever output is required
+     * 'type' is the type of info required, and this is format-specific
+     */
+    void (*debug_output)(int type, void *param);
+
+    /*
+     * cleanup - called after processing of file is complete
+     */
+    void (*cleanup)(void);
+};
+
+extern const struct dfmt *dfmt;
+
+/*
+ * The type definition macros
+ * for debugging
+ *
+ * low 3 bits: reserved
+ * next 5 bits: type
+ * next 24 bits: number of elements for arrays (0 for labels)
+ */
+
+#define TY_UNKNOWN 0x00
+#define TY_LABEL   0x08
+#define TY_BYTE    0x10
+#define TY_WORD    0x18
+#define TY_DWORD   0x20
+#define TY_FLOAT   0x28
+#define TY_QWORD   0x30
+#define TY_TBYTE   0x38
+#define TY_OWORD   0x40
+#define TY_YWORD   0x48
+#define TY_COMMON  0xE0
+#define TY_SEG     0xE8
+#define TY_EXTERN  0xF0
+#define TY_EQU     0xF8
+
+#define TYM_TYPE(x) ((x) & 0xF8)
+#define TYM_ELEMENTS(x) (((x) & 0xFFFFFF00) >> 8)
+
+#define TYS_ELEMENTS(x)  ((x) << 8)
+
+/*
+ * -----
+ * Special tokens
+ * -----
+ */
+
+enum special_tokens {
+    SPECIAL_ENUM_START = PREFIX_ENUM_LIMIT,
+    S_ABS = SPECIAL_ENUM_START,
+    S_BYTE, S_DWORD, S_FAR, S_LONG, S_NEAR, S_NOSPLIT,
+    S_OWORD, S_QWORD, S_REL, S_SHORT, S_STRICT, S_TO, S_TWORD, S_WORD, S_YWORD,
+    SPECIAL_ENUM_LIMIT
+};
+
+/*
+ * -----
+ * Global modes
+ * -----
+ */
+
+/*
+ * This declaration passes the "pass" number to all other modules
+ * "pass0" assumes the values: 0, 0, ..., 0, 1, 2
+ * where 0 = optimizing pass
+ *       1 = pass 1
+ *       2 = pass 2
+ */
+
+extern int pass0;
+extern int passn;              /* Actual pass number */
+
+extern bool tasm_compatible_mode;
+extern int optimizing;
+extern int globalbits;          /* 16, 32 or 64-bit mode */
+extern int globalrel;          /* default to relative addressing? */
+extern int maxbits;            /* max bits supported by output */
+
+/*
+ * NASM version strings, defined in ver.c
+ */
+extern const char nasm_version[];
+extern const char nasm_date[];
+extern const char nasm_compile_options[];
+extern const char nasm_comment[];
+extern const char nasm_signature[];
+
+#endif
diff --git a/nasm.nsi b/nasm.nsi
new file mode 100644 (file)
index 0000000..48feaa9
--- /dev/null
+++ b/nasm.nsi
@@ -0,0 +1,204 @@
+#!Nsis Installer Command Script
+
+#
+# Copyright (c) 2009, Shao Miller (shao.miller@yrdsb.edu.on.ca)
+# Copyright (c) 2009, Cyrill Gorcunov (gorcunov@gmail.com)
+# All rights reserved.
+#
+# The script requires NSIS v2.45 (or any later)
+#
+# 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 <copyright holder> 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.
+
+!include "version.nsh"
+!define PRODUCT_NAME "Netwide Assembler"
+!define PRODUCT_SHORT_NAME "nasm"
+!define PACKAGE_NAME "${PRODUCT_NAME} ${VERSION}"
+!define PACKAGE_SHORT_NAME "${PRODUCT_SHORT_NAME}-${VERSION}"
+
+SetCompressor lzma
+
+!define MULTIUSER_EXECUTIONLEVEL Highest
+!define MULTIUSER_MUI
+!define MULTIUSER_INSTALLMODE_COMMANDLINE
+!define MULTIUSER_INSTALLMODE_INSTDIR "${PRODUCT_SHORT_NAME}"
+!include MultiUser.nsh
+
+!insertmacro MULTIUSER_PAGE_INSTALLMODE
+!insertmacro MULTIUSER_INSTALLMODEPAGE_INTERFACE
+
+;--------------------------------
+;General
+
+;Name and file
+Name "${PACKAGE_NAME}"
+OutFile "${PACKAGE_SHORT_NAME}-installer.exe"
+
+;Get installation folder from registry if available
+InstallDirRegKey HKCU "Software\${PRODUCT_SHORT_NAME}" ""
+
+;Request application privileges for Windows Vista
+RequestExecutionLevel user
+
+;--------------------------------
+;Variables
+
+Var StartMenuFolder
+Var CmdFailed
+
+;--------------------------------
+;Interface Settings
+Caption "${PACKAGE_SHORT_NAME} installation"
+Icon "nsis/nasm.ico"
+UninstallIcon "nsis/nasm-un.ico"
+
+!define MUI_ABORTWARNING
+
+;--------------------------------
+;Pages
+
+!insertmacro MUI_PAGE_COMPONENTS
+!insertmacro MUI_PAGE_DIRECTORY
+
+;Start Menu Folder Page Configuration
+!define MUI_STARTMENUPAGE_REGISTRY_ROOT "HKCU"
+!define MUI_STARTMENUPAGE_REGISTRY_KEY "Software\${PRODUCT_SHORT_NAME}"
+!define MUI_STARTMENUPAGE_REGISTRY_VALUENAME "${PRODUCT_SHORT_NAME}"
+
+!insertmacro MUI_PAGE_STARTMENU Application $StartMenuFolder
+
+!insertmacro MUI_PAGE_INSTFILES
+
+!insertmacro MUI_UNPAGE_CONFIRM
+!insertmacro MUI_UNPAGE_INSTFILES
+
+;--------------------------------
+;Installer Sections
+
+!insertmacro MUI_LANGUAGE English
+
+Section "NASM" SecNasm
+    Sectionin RO
+    SetOutPath "$INSTDIR"
+    File "LICENSE"
+    File "nasm.exe"
+    File "ndisasm.exe"
+    File "nsis/nasm.ico"
+
+    ;Store installation folder
+    WriteRegStr HKCU "Software\${PRODUCT_SHORT_NAME}" "" $INSTDIR
+
+    ;Store shortcuts folder
+    WriteRegStr HKCU "Software\${PRODUCT_SHORT_NAME}\" "lnk" $SMPROGRAMS\$StartMenuFolder
+
+    ;
+    ; the bat we need
+    StrCpy $CmdFailed "true"
+    FileOpen $0 "nasmpath.bat" w
+    IfErrors skip
+    StrCpy $CmdFailed "false"
+    FileWrite $0 "@set path=$INSTDIR;%path%$\r$\n"
+    FileWrite $0 "@%comspec%"
+    FileClose $0
+    CreateShortCut "$DESKTOP\${PRODUCT_SHORT_NAME}.lnk" "$INSTDIR\nasmpath.bat" "" "$INSTDIR\nasm.ico" 0
+skip:
+    ;Create uninstaller
+    WriteUninstaller "$INSTDIR\Uninstall.exe"
+
+    !insertmacro MUI_STARTMENU_WRITE_BEGIN Application
+
+    ;Create shortcuts
+    CreateDirectory "$SMPROGRAMS\$StartMenuFolder"
+    StrCmp $CmdFailed "true" +2
+    CreateShortCut "$SMPROGRAMS\$StartMenuFolder\${PRODUCT_SHORT_NAME}-shell.lnk" "$INSTDIR\nasmpath.bat"
+    CreateShortCut  "$SMPROGRAMS\$StartMenuFolder\${PRODUCT_SHORT_NAME}.lnk" "$INSTDIR\nasm.exe" "" "$INSTDIR\nasm.ico" 0
+    CreateShortCut  "$SMPROGRAMS\$StartMenuFolder\Uninstall.lnk" "$INSTDIR\Uninstall.exe"
+
+    !insertmacro MUI_STARTMENU_WRITE_END
+SectionEnd
+
+Section "RDOFF" SecRdoff
+    CreateDirectory "$INSTDIR\rdoff"
+    SetOutPath "$INSTDIR\rdoff"
+    File "rdoff/ldrdf.exe"
+    File "rdoff/rdf2bin.exe"
+    File "rdoff/rdf2com.exe"
+    File "rdoff/rdf2ith.exe"
+    File "rdoff/rdf2ihx.exe"
+    File "rdoff/rdf2srec.exe"
+    File "rdoff/rdfdump.exe"
+    File "rdoff/rdflib.exe"
+    File "rdoff/rdx.exe"
+SectionEnd
+
+Section "Manual" SecManual
+    SetOutPath "$INSTDIR"
+    File "doc/nasmdoc.pdf"
+    CreateShortCut "$SMPROGRAMS\$StartMenuFolder\Manual.lnk" "$INSTDIR\nasmdoc.pdf"
+SectionEnd
+
+Section "VS8 integration" SecVS8
+    CreateDirectory "$INSTDIR\contrib\VSrules"
+    SetOutPath "$INSTDIR\contrib\VSrules"
+    File "contrib/VSrules/nasm.README"
+    File "contrib/VSrules/nasm.rules"
+SectionEnd
+
+;--------------------------------
+;Descriptions
+
+    ;Language strings
+    LangString DESC_SecNasm ${LANG_ENGLISH}     "NASM assembler and disassember modules"
+    LangString DESC_SecManual ${LANG_ENGLISH}   "Complete NASM manual (pdf file)"
+    LangString DESC_SecRdoff ${LANG_ENGLISH}    "RDOFF utilities (you may not need it if you don't know what is it)"
+    LangString DESC_SecVS8 ${LANG_ENGLISH}      "Visual Studio 2008 NASM integration (rules file)"
+
+    ;Assign language strings to sections
+    !insertmacro MUI_FUNCTION_DESCRIPTION_BEGIN
+    !insertmacro MUI_DESCRIPTION_TEXT ${SecNasm} $(DESC_SecNasm)
+    !insertmacro MUI_DESCRIPTION_TEXT ${SecRdoff} $(DESC_SecRdoff)
+    !insertmacro MUI_DESCRIPTION_TEXT ${SecManual} $(DESC_SecManual)
+    !insertmacro MUI_DESCRIPTION_TEXT ${SecVS8} $(DESC_SecVS8)
+    !insertmacro MUI_FUNCTION_DESCRIPTION_END
+
+;--------------------------------
+;Uninstaller Section
+
+Section "Uninstall"
+    ;
+    ; files on HDD
+    RMDir /r /rebootok "$INSTDIR"
+    Delete /rebootok "$DESKTOP\${PRODUCT_SHORT_NAME}.lnk"
+    ;
+    ; Start Menu folder
+    ReadRegStr $0 HKCU Software\${PRODUCT_SHORT_NAME} "lnk"
+    Delete /rebootok "$0\*"
+    RMDir "$0"
+    DeleteRegKey /ifempty HKCU "Software\${PRODUCT_SHORT_NAME}"
+SectionEnd
+
+;
+; MUI requires this hooks
+Function .onInit
+    !insertmacro MULTIUSER_INIT
+FunctionEnd
+
+Function un.onInit
+    !insertmacro MULTIUSER_UNINIT
+FunctionEnd
diff --git a/nasm.spec b/nasm.spec
new file mode 100644 (file)
index 0000000..628276b
--- /dev/null
+++ b/nasm.spec
@@ -0,0 +1,104 @@
+# -*- coding: utf-8 -*-
+%define nasm_version 2.08rc7
+Summary: The Netwide Assembler, a portable x86 assembler with Intel-like syntax
+Name: nasm
+Version: 2.07.99.97
+Release: 1
+License: BSD
+Group: Development/Languages
+Source: http://www.nasm.us/pub/nasm/releasebuilds/%{nasm_version}/nasm-%{nasm_version}.tar.bz2
+URL: http://www.nasm.us/
+BuildRoot: /tmp/rpm-build-nasm
+Prefix: %{_prefix}
+BuildPrereq: perl
+BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
+Requires(post): /sbin/install-info
+Requires(preun): /sbin/install-info
+
+%package doc
+Summary: Extensive documentation for NASM
+Group: Development/Languages
+Prereq: /sbin/install-info
+
+%package rdoff
+Summary: Tools for the RDOFF binary format, sometimes used with NASM.
+Group: Development/Tools
+
+%description
+NASM is the Netwide Assembler, a free portable assembler for the Intel
+80x86 microprocessor series, using primarily the traditional Intel
+instruction mnemonics and syntax.
+
+%description doc
+Extensive documentation for the Netwide Assembler, NASM, in HTML,
+info, PostScript and text formats.
+
+%description rdoff
+Tools for the operating-system independent RDOFF binary format, which
+is sometimes used with the Netwide Assembler (NASM).  These tools
+include linker, library manager, loader, and information dump.
+
+%prep
+%setup -q -n nasm-%{nasm_version}
+
+%build
+%configure
+make %{?_smp_mflags} everything
+
+%install
+rm -rf "$RPM_BUILD_ROOT"
+mkdir -p "$RPM_BUILD_ROOT"/%{_bindir}
+mkdir -p "$RPM_BUILD_ROOT"/%{_mandir}/man1
+mkdir -p "$RPM_BUILD_ROOT"/%{_infodir}
+mkdir -p "$RPM_BUILD_ROOT"/usr/tempdoc
+%makeinstall install_everything        docdir="$RPM_BUILD_ROOT"/usr/tempdoc
+cp -a $RPM_BUILD_ROOT/usr/tempdoc/html \
+   $RPM_BUILD_ROOT/usr/tempdoc/nasmdoc.{ps,txt,pdf} .
+gzip -9f nasmdoc.{ps,txt}
+# remove unpackaged files from the buildroot
+rm -rf $RPM_BUILD_ROOT%{_prefix}/tempdoc
+
+%clean
+rm -rf "$RPM_BUILD_ROOT"
+
+%post
+/sbin/install-info %{_infodir}/nasm.info.gz %{_infodir}/dir || :
+
+%preun
+if [ $1 = 0 ]; then
+  /sbin/install-info --delete %{_infodir}/nasm.info.gz %{_infodir}/dir || :
+fi
+
+%files
+%defattr(-,root,root)
+%doc AUTHORS CHANGES README TODO
+%{_bindir}/nasm
+%{_bindir}/ndisasm
+%{_mandir}/man1/nasm.1*
+%{_mandir}/man1/ndisasm.1*
+%{_infodir}/nasm.info*.gz
+
+%files doc
+%defattr(-,root,root)
+%doc html nasmdoc.txt.gz nasmdoc.pdf nasmdoc.ps.gz
+
+%files rdoff
+%defattr(-,root,root)
+%{_bindir}/ldrdf
+%{_bindir}/rdf2bin
+%{_bindir}/rdf2com
+%{_bindir}/rdf2ihx
+%{_bindir}/rdf2ith
+%{_bindir}/rdf2srec
+%{_bindir}/rdfdump
+%{_bindir}/rdflib
+%{_bindir}/rdx
+%{_mandir}/man1/ldrdf.1*
+%{_mandir}/man1/rdf2bin.1*
+%{_mandir}/man1/rdf2com.1*
+%{_mandir}/man1/rdf2ihx.1*
+%{_mandir}/man1/rdf2ith.1*
+%{_mandir}/man1/rdf2srec.1*
+%{_mandir}/man1/rdfdump.1*
+%{_mandir}/man1/rdflib.1*
+%{_mandir}/man1/rdx.1*
diff --git a/nasm.spec.in b/nasm.spec.in
new file mode 100644 (file)
index 0000000..1b70521
--- /dev/null
@@ -0,0 +1,104 @@
+# -*- coding: utf-8 -*-
+%define nasm_version @@NASM_VER@@
+Summary: The Netwide Assembler, a portable x86 assembler with Intel-like syntax
+Name: nasm
+Version: @@NASM_MANGLED_VER@@
+Release: 1
+License: BSD
+Group: Development/Languages
+Source: http://www.nasm.us/pub/nasm/releasebuilds/%{nasm_version}/nasm-%{nasm_version}.tar.bz2
+URL: http://www.nasm.us/
+BuildRoot: /tmp/rpm-build-nasm
+Prefix: %{_prefix}
+BuildPrereq: perl
+BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
+Requires(post): /sbin/install-info
+Requires(preun): /sbin/install-info
+
+%package doc
+Summary: Extensive documentation for NASM
+Group: Development/Languages
+Prereq: /sbin/install-info
+
+%package rdoff
+Summary: Tools for the RDOFF binary format, sometimes used with NASM.
+Group: Development/Tools
+
+%description
+NASM is the Netwide Assembler, a free portable assembler for the Intel
+80x86 microprocessor series, using primarily the traditional Intel
+instruction mnemonics and syntax.
+
+%description doc
+Extensive documentation for the Netwide Assembler, NASM, in HTML,
+info, PostScript and text formats.
+
+%description rdoff
+Tools for the operating-system independent RDOFF binary format, which
+is sometimes used with the Netwide Assembler (NASM).  These tools
+include linker, library manager, loader, and information dump.
+
+%prep
+%setup -q -n nasm-%{nasm_version}
+
+%build
+%configure
+make %{?_smp_mflags} everything
+
+%install
+rm -rf "$RPM_BUILD_ROOT"
+mkdir -p "$RPM_BUILD_ROOT"/%{_bindir}
+mkdir -p "$RPM_BUILD_ROOT"/%{_mandir}/man1
+mkdir -p "$RPM_BUILD_ROOT"/%{_infodir}
+mkdir -p "$RPM_BUILD_ROOT"/usr/tempdoc
+%makeinstall install_everything        docdir="$RPM_BUILD_ROOT"/usr/tempdoc
+cp -a $RPM_BUILD_ROOT/usr/tempdoc/html \
+   $RPM_BUILD_ROOT/usr/tempdoc/nasmdoc.{ps,txt,pdf} .
+gzip -9f nasmdoc.{ps,txt}
+# remove unpackaged files from the buildroot
+rm -rf $RPM_BUILD_ROOT%{_prefix}/tempdoc
+
+%clean
+rm -rf "$RPM_BUILD_ROOT"
+
+%post
+/sbin/install-info %{_infodir}/nasm.info.gz %{_infodir}/dir || :
+
+%preun
+if [ $1 = 0 ]; then
+  /sbin/install-info --delete %{_infodir}/nasm.info.gz %{_infodir}/dir || :
+fi
+
+%files
+%defattr(-,root,root)
+%doc AUTHORS CHANGES README TODO
+%{_bindir}/nasm
+%{_bindir}/ndisasm
+%{_mandir}/man1/nasm.1*
+%{_mandir}/man1/ndisasm.1*
+%{_infodir}/nasm.info*.gz
+
+%files doc
+%defattr(-,root,root)
+%doc html nasmdoc.txt.gz nasmdoc.pdf nasmdoc.ps.gz
+
+%files rdoff
+%defattr(-,root,root)
+%{_bindir}/ldrdf
+%{_bindir}/rdf2bin
+%{_bindir}/rdf2com
+%{_bindir}/rdf2ihx
+%{_bindir}/rdf2ith
+%{_bindir}/rdf2srec
+%{_bindir}/rdfdump
+%{_bindir}/rdflib
+%{_bindir}/rdx
+%{_mandir}/man1/ldrdf.1*
+%{_mandir}/man1/rdf2bin.1*
+%{_mandir}/man1/rdf2com.1*
+%{_mandir}/man1/rdf2ihx.1*
+%{_mandir}/man1/rdf2ith.1*
+%{_mandir}/man1/rdf2srec.1*
+%{_mandir}/man1/rdfdump.1*
+%{_mandir}/man1/rdflib.1*
+%{_mandir}/man1/rdx.1*
diff --git a/nasmlib.c b/nasmlib.c
new file mode 100644 (file)
index 0000000..b4ca34e
--- /dev/null
+++ b/nasmlib.c
@@ -0,0 +1,729 @@
+/* ----------------------------------------------------------------------- *
+ *   
+ *   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.
+ *
+ * ----------------------------------------------------------------------- */
+
+/*
+ * nasmlib.c   library routines for the Netwide Assembler
+ */
+
+#include "compiler.h"
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <ctype.h>
+#include <inttypes.h>
+
+#include "nasm.h"
+#include "nasmlib.h"
+#include "insns.h"
+
+int globalbits = 0;    /* defined in nasm.h, works better here for ASM+DISASM */
+static vefunc nasm_verror;     /* Global error handling function */
+
+#ifdef LOGALLOC
+static FILE *logfp;
+#endif
+
+/* Uninitialized -> all zero by C spec */
+const uint8_t zero_buffer[ZERO_BUF_SIZE];
+
+/*
+ * Prepare a table of tolower() results.  This avoids function calls
+ * on some platforms.
+ */
+
+unsigned char nasm_tolower_tab[256];
+
+void tolower_init(void)
+{
+    int i;
+
+    for (i = 0; i < 256; i++)
+       nasm_tolower_tab[i] = tolower(i);
+}
+
+void nasm_set_verror(vefunc ve)
+{
+    nasm_verror = ve;
+}
+
+void nasm_error(int severity, const char *fmt, ...)
+{
+    va_list ap;
+
+    va_start(ap, fmt);
+    nasm_verror(severity, fmt, ap);
+    va_end(ap);
+}
+
+void nasm_init_malloc_error(void)
+{
+#ifdef LOGALLOC
+    logfp = fopen("malloc.log", "w");
+    setvbuf(logfp, NULL, _IOLBF, BUFSIZ);
+    fprintf(logfp, "null pointer is %p\n", NULL);
+#endif
+}
+
+#ifdef LOGALLOC
+void *nasm_malloc_log(const char *file, int line, size_t size)
+#else
+void *nasm_malloc(size_t size)
+#endif
+{
+    void *p = malloc(size);
+    if (!p)
+        nasm_error(ERR_FATAL | ERR_NOFILE, "out of memory");
+#ifdef LOGALLOC
+    else
+        fprintf(logfp, "%s %d malloc(%ld) returns %p\n",
+                file, line, (long)size, p);
+#endif
+    return p;
+}
+
+#ifdef LOGALLOC
+void *nasm_zalloc_log(const char *file, int line, size_t size)
+#else
+void *nasm_zalloc(size_t size)
+#endif
+{
+    void *p = calloc(size, 1);
+    if (!p)
+        nasm_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;
+}
+
+#ifdef LOGALLOC
+void *nasm_realloc_log(const char *file, int line, void *q, size_t size)
+#else
+void *nasm_realloc(void *q, size_t size)
+#endif
+{
+    void *p = q ? realloc(q, size) : malloc(size);
+    if (!p)
+        nasm_error(ERR_FATAL | ERR_NOFILE, "out of memory");
+#ifdef LOGALLOC
+    else if (q)
+        fprintf(logfp, "%s %d realloc(%p,%ld) returns %p\n",
+                file, line, q, (long)size, p);
+    else
+        fprintf(logfp, "%s %d malloc(%ld) returns %p\n",
+                file, line, (long)size, p);
+#endif
+    return p;
+}
+
+#ifdef LOGALLOC
+void nasm_free_log(const char *file, int line, void *q)
+#else
+void nasm_free(void *q)
+#endif
+{
+    if (q) {
+#ifdef LOGALLOC
+        fprintf(logfp, "%s %d free(%p)\n", file, line, q);
+#endif
+        free(q);
+    }
+}
+
+#ifdef LOGALLOC
+char *nasm_strdup_log(const char *file, int line, const char *s)
+#else
+char *nasm_strdup(const char *s)
+#endif
+{
+    char *p;
+    int size = strlen(s) + 1;
+
+    p = malloc(size);
+    if (!p)
+        nasm_error(ERR_FATAL | ERR_NOFILE, "out of memory");
+#ifdef LOGALLOC
+    else
+        fprintf(logfp, "%s %d strdup(%ld) returns %p\n",
+                file, line, (long)size, p);
+#endif
+    strcpy(p, s);
+    return p;
+}
+
+#ifdef LOGALLOC
+char *nasm_strndup_log(const char *file, int line, const char *s, size_t len)
+#else
+char *nasm_strndup(const char *s, size_t len)
+#endif
+{
+    char *p;
+    int size = len + 1;
+
+    p = malloc(size);
+    if (!p)
+        nasm_error(ERR_FATAL | ERR_NOFILE, "out of memory");
+#ifdef LOGALLOC
+    else
+        fprintf(logfp, "%s %d strndup(%ld) returns %p\n",
+                file, line, (long)size, p);
+#endif
+    strncpy(p, s, len);
+    p[len] = '\0';
+    return p;
+}
+
+no_return nasm_assert_failed(const char *file, int line, const char *msg)
+{
+    nasm_error(ERR_FATAL, "assertion %s failed at %s:%d", msg, file, line);
+    exit(1);
+}
+
+#ifndef nasm_stricmp
+int nasm_stricmp(const char *s1, const char *s2)
+{
+    unsigned char c1, c2;
+    int d;
+
+    while (1) {
+       c1 = nasm_tolower(*s1++);
+       c2 = nasm_tolower(*s2++);
+       d = c1-c2;
+
+       if (d)
+           return d;
+       if (!c1)
+           break;
+    }
+    return 0;
+}
+#endif
+
+#ifndef nasm_strnicmp
+int nasm_strnicmp(const char *s1, const char *s2, size_t n)
+{
+    unsigned char c1, c2;
+    int d;
+
+    while (n--) {
+       c1 = nasm_tolower(*s1++);
+       c2 = nasm_tolower(*s2++);
+       d = c1-c2;
+
+       if (d)
+           return d;
+       if (!c1)
+           break;
+    }
+    return 0;
+}
+#endif
+
+int nasm_memicmp(const char *s1, const char *s2, size_t n)
+{
+    unsigned char c1, c2;
+    int d;
+
+    while (n--) {
+       c1 = nasm_tolower(*s1++);
+       c2 = nasm_tolower(*s2++);
+       d = c1-c2;
+       if (d)
+           return d;
+    }
+    return 0;
+}
+
+#ifndef nasm_strsep
+char *nasm_strsep(char **stringp, const char *delim)
+{
+        char *s = *stringp;
+        char *e;
+
+        if (!s)
+                return NULL;
+
+        e = strpbrk(s, delim);
+        if (e)
+                *e++ = '\0';
+
+        *stringp = e;
+        return s;
+}
+#endif
+
+
+#define lib_isnumchar(c)   (nasm_isalnum(c) || (c) == '$' || (c) == '_')
+#define numvalue(c)  ((c)>='a' ? (c)-'a'+10 : (c)>='A' ? (c)-'A'+10 : (c)-'0')
+
+static int radix_letter(char c)
+{
+    switch (c) {
+    case 'b': case 'B':
+    case 'y': case 'Y':
+       return 2;               /* Binary */
+    case 'o': case 'O':
+    case 'q': case 'Q':
+       return 8;               /* Octal */
+    case 'h': case 'H':
+    case 'x': case 'X':
+       return 16;              /* Hexadecimal */
+    case 'd': case 'D':
+    case 't': case 'T':
+       return 10;              /* Decimal */
+    default:
+       return 0;               /* Not a known radix letter */
+    }
+}
+
+int64_t readnum(char *str, bool *error)
+{
+    char *r = str, *q;
+    int32_t pradix, sradix, radix;
+    int plen, slen, len;
+    uint64_t result, checklimit;
+    int digit, last;
+    bool warn = false;
+    int sign = 1;
+
+    *error = false;
+
+    while (nasm_isspace(*r))
+        r++;                    /* find start of number */
+
+    /*
+     * If the number came from make_tok_num (as a result of an %assign), it
+     * might have a '-' built into it (rather than in a preceeding token).
+     */
+    if (*r == '-') {
+        r++;
+        sign = -1;
+    }
+
+    q = r;
+
+    while (lib_isnumchar(*q))
+        q++;                    /* find end of number */
+
+    len = q-r;
+    if (!len) {
+       /* Not numeric */
+       *error = true;
+       return 0;
+    }
+
+    /*
+     * Handle radix formats:
+     *
+     * 0<radix-letter><string>
+     * $<string>               (hexadecimal)
+     * <string><radix-letter>
+     */
+    pradix = sradix = 0;
+    plen = slen = 0;
+
+    if (len > 2 && *r == '0' && (pradix = radix_letter(r[1])) != 0)
+       plen = 2;
+    else if (len > 1 && *r == '$')
+       pradix = 16, plen = 1;
+
+    if (len > 1 && (sradix = radix_letter(q[-1])) != 0)
+       slen = 1;
+
+    if (pradix > sradix) {
+       radix = pradix;
+       r += plen;
+    } else if (sradix > pradix) {
+       radix = sradix;
+       q -= slen;
+    } else {
+       /* Either decimal, or invalid -- if invalid, we'll trip up
+          further down. */
+       radix = 10;
+    }
+
+    /*
+     * `checklimit' must be 2**64 / radix. We can't do that in
+     * 64-bit arithmetic, which we're (probably) using, so we
+     * cheat: since we know that all radices we use are even, we
+     * can divide 2**63 by radix/2 instead.
+     */
+    checklimit = 0x8000000000000000ULL / (radix >> 1);
+
+    /*
+     * Calculate the highest allowable value for the last digit of a
+     * 64-bit constant... in radix 10, it is 6, otherwise it is 0
+     */
+    last = (radix == 10 ? 6 : 0);
+
+    result = 0;
+    while (*r && r < q) {
+       if (*r != '_') {
+           if (*r < '0' || (*r > '9' && *r < 'A')
+               || (digit = numvalue(*r)) >= radix) {
+               *error = true;
+               return 0;
+           }
+           if (result > checklimit ||
+               (result == checklimit && digit >= last)) {
+               warn = true;
+           }
+
+           result = radix * result + digit;
+       }
+        r++;
+    }
+
+    if (warn)
+        nasm_error(ERR_WARNING | ERR_PASS1 | ERR_WARN_NOV,
+                  "numeric constant %s does not fit in 64 bits",
+                  str);
+
+    return result * sign;
+}
+
+int64_t readstrnum(char *str, int length, bool *warn)
+{
+    int64_t charconst = 0;
+    int i;
+
+    *warn = false;
+
+    str += length;
+    if (globalbits == 64) {
+        for (i = 0; i < length; i++) {
+            if (charconst & 0xFF00000000000000ULL)
+                *warn = true;
+            charconst = (charconst << 8) + (uint8_t)*--str;
+        }
+    } else {
+        for (i = 0; i < length; i++) {
+            if (charconst & 0xFF000000UL)
+                *warn = true;
+            charconst = (charconst << 8) + (uint8_t)*--str;
+        }
+    }
+    return charconst;
+}
+
+static int32_t next_seg;
+
+void seg_init(void)
+{
+    next_seg = 0;
+}
+
+int32_t seg_alloc(void)
+{
+    return (next_seg += 2) - 2;
+}
+
+#ifdef WORDS_LITTLEENDIAN
+
+void fwriteint16_t(uint16_t data, FILE * fp)
+{
+    fwrite(&data, 1, 2, fp);
+}
+
+void fwriteint32_t(uint32_t data, FILE * fp)
+{
+    fwrite(&data, 1, 4, fp);
+}
+
+void fwriteint64_t(uint64_t data, FILE * fp)
+{
+    fwrite(&data, 1, 8, fp);
+}
+
+void fwriteaddr(uint64_t data, int size, FILE * fp)
+{
+    fwrite(&data, 1, size, fp);
+}
+
+#else /* not WORDS_LITTLEENDIAN */
+
+void fwriteint16_t(uint16_t data, FILE * fp)
+{
+    char buffer[2], *p = buffer;
+    WRITESHORT(p, data);
+    fwrite(buffer, 1, 2, fp);
+}
+
+void fwriteint32_t(uint32_t data, FILE * fp)
+{
+    char buffer[4], *p = buffer;
+    WRITELONG(p, data);
+    fwrite(buffer, 1, 4, fp);
+}
+
+void fwriteint64_t(uint64_t data, FILE * fp)
+{
+    char buffer[8], *p = buffer;
+    WRITEDLONG(p, data);
+    fwrite(buffer, 1, 8, fp);
+}
+
+void fwriteaddr(uint64_t data, int size, FILE * fp)
+{
+    char buffer[8], *p = buffer;
+    WRITEADDR(p, data, size);
+    fwrite(buffer, 1, size, fp);
+}
+
+#endif
+
+size_t fwritezero(size_t bytes, FILE *fp)
+{
+    size_t count = 0;
+    size_t blksize;
+    size_t rv;
+
+    while (bytes) {
+       blksize = (bytes < ZERO_BUF_SIZE) ? bytes : ZERO_BUF_SIZE;
+
+       rv = fwrite(zero_buffer, 1, blksize, fp);
+       if (!rv)
+           break;
+
+       count += rv;
+       bytes -= rv;
+    }
+
+    return count;
+}
+
+void standard_extension(char *inname, char *outname, char *extension)
+{
+    char *p, *q;
+
+    if (*outname)               /* file name already exists, */
+        return;                 /* so do nothing */
+    q = inname;
+    p = outname;
+    while (*q)
+        *p++ = *q++;            /* copy, and find end of string */
+    *p = '\0';                  /* terminate it */
+    while (p > outname && *--p != '.') ;        /* find final period (or whatever) */
+    if (*p != '.')
+        while (*p)
+            p++;                /* go back to end if none found */
+    if (!strcmp(p, extension)) {        /* is the extension already there? */
+        if (*extension)
+            nasm_error(ERR_WARNING | ERR_NOFILE,
+                      "file name already ends in `%s': "
+                      "output will be in `nasm.out'", extension);
+        else
+            nasm_error(ERR_WARNING | ERR_NOFILE,
+                      "file name already has no extension: "
+                      "output will be in `nasm.out'");
+        strcpy(outname, "nasm.out");
+    } else
+        strcpy(p, extension);
+}
+
+/*
+ * Common list of prefix names
+ */
+static const char *prefix_names[] = {
+    "a16", "a32", "a64", "asp", "lock", "o16", "o32", "o64", "osp",
+    "rep", "repe", "repne", "repnz", "repz", "times", "wait"
+};
+
+const char *prefix_name(int token)
+{
+    unsigned int prefix = token-PREFIX_ENUM_START;
+    if (prefix > elements(prefix_names))
+       return NULL;
+
+    return prefix_names[prefix];
+}
+
+/*
+ * Binary search.
+ */
+int bsi(const char *string, const char **array, int size)
+{
+    int i = -1, j = size;       /* always, i < index < j */
+    while (j - i >= 2) {
+        int k = (i + j) / 2;
+        int l = strcmp(string, array[k]);
+        if (l < 0)              /* it's in the first half */
+            j = k;
+        else if (l > 0)         /* it's in the second half */
+            i = k;
+        else                    /* we've got it :) */
+            return k;
+    }
+    return -1;                  /* we haven't got it :( */
+}
+
+int bsii(const char *string, const char **array, int size)
+{
+    int i = -1, j = size;       /* always, i < index < j */
+    while (j - i >= 2) {
+        int k = (i + j) / 2;
+        int l = nasm_stricmp(string, array[k]);
+        if (l < 0)              /* it's in the first half */
+            j = k;
+        else if (l > 0)         /* it's in the second half */
+            i = k;
+        else                    /* we've got it :) */
+            return k;
+    }
+    return -1;                  /* we haven't got it :( */
+}
+
+static char *file_name = NULL;
+static int32_t line_number = 0;
+
+char *src_set_fname(char *newname)
+{
+    char *oldname = file_name;
+    file_name = newname;
+    return oldname;
+}
+
+int32_t src_set_linnum(int32_t newline)
+{
+    int32_t oldline = line_number;
+    line_number = newline;
+    return oldline;
+}
+
+int32_t src_get_linnum(void)
+{
+    return line_number;
+}
+
+int src_get(int32_t *xline, char **xname)
+{
+    if (!file_name || !*xname || strcmp(*xname, file_name)) {
+        nasm_free(*xname);
+        *xname = file_name ? nasm_strdup(file_name) : NULL;
+        *xline = line_number;
+        return -2;
+    }
+    if (*xline != line_number) {
+        int32_t tmp = line_number - *xline;
+        *xline = line_number;
+        return tmp;
+    }
+    return 0;
+}
+
+char *nasm_strcat(const char *one, const char *two)
+{
+    char *rslt;
+    int l1 = strlen(one);
+    rslt = nasm_malloc(l1 + strlen(two) + 1);
+    strcpy(rslt, one);
+    strcpy(rslt + l1, two);
+    return rslt;
+}
+
+/* skip leading spaces */
+char *nasm_skip_spaces(const char *p)
+{
+    if (p)
+        while (*p && nasm_isspace(*p))
+            p++;
+    return (char *)p;
+}
+
+/* skip leading non-spaces */
+char *nasm_skip_word(const char *p)
+{
+    if (p)
+        while (*p && !nasm_isspace(*p))
+            p++;
+    return (char *)p;
+}
+
+/* zap leading spaces with zero */
+char *nasm_zap_spaces_fwd(char *p)
+{
+    if (p)
+        while (*p && nasm_isspace(*p))
+            *p++ = 0x0;
+    return p;
+}
+
+/* zap spaces with zero in reverse order */
+char *nasm_zap_spaces_rev(char *p)
+{
+    if (p)
+        while (*p && nasm_isspace(*p))
+            *p-- = 0x0;
+    return p;
+}
+
+/*
+ * initialized data bytes length from opcode
+ */
+int idata_bytes(int opcode)
+{
+    int ret;
+    switch (opcode) {
+    case I_DB:
+        ret = 1;
+        break;
+    case I_DW:
+        ret = 2;
+        break;
+    case I_DD:
+        ret = 4;
+        break;
+    case I_DQ:
+        ret = 8;
+        break;
+    case I_DT:
+        ret = 10;
+        break;
+    case I_DO:
+        ret = 16;
+        break;
+    case I_DY:
+        ret = 32;
+        break;
+    case I_none:
+        ret = -1;
+        break;
+    default:
+        ret = 0;
+        break;
+    }
+    return ret;
+}
diff --git a/nasmlib.h b/nasmlib.h
new file mode 100644 (file)
index 0000000..372095c
--- /dev/null
+++ b/nasmlib.h
@@ -0,0 +1,446 @@
+/* ----------------------------------------------------------------------- *
+ *
+ *   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.
+ *
+ * ----------------------------------------------------------------------- */
+
+/*
+ * nasmlib.h    header file for nasmlib.c
+ */
+
+#ifndef NASM_NASMLIB_H
+#define NASM_NASMLIB_H
+
+#include "compiler.h"
+
+#include <inttypes.h>
+#include <stdio.h>
+#include <string.h>
+#ifdef HAVE_STRINGS_H
+#include <strings.h>
+#endif
+
+/*
+ * tolower table -- avoids a function call on some platforms.
+ * NOTE: unlike the tolower() function in ctype, EOF is *NOT*
+ * a permitted value, for obvious reasons.
+ */
+void tolower_init(void);
+extern unsigned char nasm_tolower_tab[256];
+#define nasm_tolower(x) nasm_tolower_tab[(unsigned char)(x)]
+
+/* Wrappers around <ctype.h> functions */
+/* These are only valid for values that cannot include EOF */
+#define nasm_isspace(x)  isspace((unsigned char)(x))
+#define nasm_isalpha(x)  isalpha((unsigned char)(x))
+#define nasm_isdigit(x)  isdigit((unsigned char)(x))
+#define nasm_isalnum(x)  isalnum((unsigned char)(x))
+#define nasm_isxdigit(x) isxdigit((unsigned char)(x))
+
+/*
+ * If this is defined, the wrappers around malloc et al will
+ * transform into logging variants, which will cause NASM to create
+ * a file called `malloc.log' when run, and spew details of all its
+ * memory management into that. That can then be analysed to detect
+ * memory leaks and potentially other problems too.
+ */
+/* #define LOGALLOC */
+
+/*
+ * -------------------------
+ * Error reporting functions
+ * -------------------------
+ */
+
+/*
+ * An error reporting function should look like this.
+ */
+typedef void (*efunc) (int severity, const char *fmt, ...);
+typedef void (*vefunc) (int severity, const char *fmt, va_list ap);
+#ifdef __GNUC__
+void nasm_error(int severity, const char *fmt, ...) __attribute__((format(printf, 2, 3)));
+#else
+void nasm_error(int severity, const char *fmt, ...);
+#endif
+void nasm_set_verror(vefunc);
+
+/*
+ * These are the error severity codes which get passed as the first
+ * argument to an efunc.
+ */
+
+#define ERR_DEBUG       0x00000008      /* put out debugging message */
+#define ERR_WARNING     0x00000000      /* warn only: no further action */
+#define ERR_NONFATAL    0x00000001      /* terminate assembly after phase */
+#define ERR_FATAL       0x00000002      /* instantly fatal: exit with error */
+#define ERR_PANIC       0x00000003      /* internal error: panic instantly
+                                         * and dump core for reference */
+#define ERR_MASK        0x0000000F      /* mask off the above codes */
+#define ERR_NOFILE      0x00000010      /* don't give source file name/line */
+#define ERR_USAGE       0x00000020      /* print a usage message */
+#define ERR_PASS1       0x00000040      /* only print this error on pass one */
+#define ERR_PASS2       0x00000080
+#define ERR_NO_SEVERITY 0x00000100      /* suppress printing severity */
+
+/*
+ * These codes define specific types of suppressible warning.
+ */
+
+#define ERR_WARN_MASK   0xFFFFF000      /* the mask for this feature */
+#define ERR_WARN_SHR    12              /* how far to shift right */
+
+#define WARN(x) ((x) << ERR_WARN_SHR)
+
+#define ERR_WARN_MNP            WARN( 1) /* macro-num-parameters warning */
+#define ERR_WARN_MSR            WARN( 2) /* macro self-reference */
+#define ERR_WARN_MDP            WARN( 3) /* macro default parameters check */
+#define ERR_WARN_OL             WARN( 4) /* orphan label (no colon, and
+                                          * alone on line) */
+#define ERR_WARN_NOV            WARN( 5) /* numeric overflow */
+#define ERR_WARN_GNUELF         WARN( 6) /* using GNU ELF extensions */
+#define ERR_WARN_FL_OVERFLOW    WARN( 7) /* FP overflow */
+#define ERR_WARN_FL_DENORM      WARN( 8) /* FP denormal */
+#define ERR_WARN_FL_UNDERFLOW   WARN( 9) /* FP underflow */
+#define ERR_WARN_FL_TOOLONG     WARN(10) /* FP too many digits */
+#define ERR_WARN_USER           WARN(11) /* %warning directives */
+#define ERR_WARN_MAX            11       /* the highest numbered one */
+
+/*
+ * Wrappers around malloc, realloc and free. nasm_malloc will
+ * fatal-error and die rather than return NULL; nasm_realloc will
+ * do likewise, and will also guarantee to work right on being
+ * passed a NULL pointer; nasm_free will do nothing if it is passed
+ * a NULL pointer.
+ */
+void nasm_init_malloc_error(void);
+#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(const char *, size_t);
+#else
+void *nasm_malloc_log(const char *, int, size_t);
+void *nasm_zalloc_log(const char *, int, size_t);
+void *nasm_realloc_log(const char *, int, void *, size_t);
+void nasm_free_log(const char *, int, void *);
+char *nasm_strdup_log(const char *, int, const char *);
+char *nasm_strndup_log(const char *, int, const char *, size_t);
+#define nasm_malloc(x) nasm_malloc_log(__FILE__,__LINE__,x)
+#define nasm_zalloc(x) nasm_zalloc_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)
+#define nasm_strndup(x,y) nasm_strndup_log(__FILE__,__LINE__,x,y)
+#endif
+
+/*
+ * NASM assert failure
+ */
+no_return nasm_assert_failed(const char *, int, const char *);
+#define nasm_assert(x)                                          \
+    do {                                                        \
+        if (unlikely(!(x)))                                     \
+            nasm_assert_failed(__FILE__,__LINE__,#x);           \
+    } while (0)
+
+/*
+ * NASM failure at build time if x != 0
+ */
+#define nasm_build_assert(x) (void)(sizeof(char[1-2*!!(x)]))
+
+/*
+ * ANSI doesn't guarantee the presence of `stricmp' or
+ * `strcasecmp'.
+ */
+#if defined(HAVE_STRCASECMP)
+#define nasm_stricmp strcasecmp
+#elif defined(HAVE_STRICMP)
+#define nasm_stricmp stricmp
+#else
+int nasm_stricmp(const char *, const char *);
+#endif
+
+#if defined(HAVE_STRNCASECMP)
+#define nasm_strnicmp strncasecmp
+#elif defined(HAVE_STRNICMP)
+#define nasm_strnicmp strnicmp
+#else
+int nasm_strnicmp(const char *, const char *, size_t);
+#endif
+
+int nasm_memicmp(const char *, const char *, size_t);
+
+#if defined(HAVE_STRSEP)
+#define nasm_strsep strsep
+#else
+char *nasm_strsep(char **stringp, const char *delim);
+#endif
+
+
+/*
+ * Convert a string into a number, using NASM number rules. Sets
+ * `*error' to true if an error occurs, and false otherwise.
+ */
+int64_t readnum(char *str, bool *error);
+
+/*
+ * Convert a character constant into a number. Sets
+ * `*warn' to true if an overflow occurs, and false otherwise.
+ * str points to and length covers the middle of the string,
+ * without the quotes.
+ */
+int64_t readstrnum(char *str, int length, bool *warn);
+
+/*
+ * seg_init: Initialise the segment-number allocator.
+ * seg_alloc: allocate a hitherto unused segment number.
+ */
+void seg_init(void);
+int32_t seg_alloc(void);
+
+/*
+ * many output formats will be able to make use of this: a standard
+ * function to add an extension to the name of the input file
+ */
+void standard_extension(char *inname, char *outname, char *extension);
+
+/*
+ * Utility macros...
+ *
+ * This is a useful #define which I keep meaning to use more often:
+ * the number of elements of a statically defined array.
+ */
+
+#define elements(x)     ( sizeof(x) / sizeof(*(x)) )
+
+/*
+ * List handling
+ *
+ *  list_for_each - regular iterator over list
+ *  list_for_each_safe - the same but safe against list items removal
+ */
+#define list_for_each(pos, head)                        \
+    for (pos = head; pos; pos = pos->next)
+#define list_for_each_safe(pos, n, head)                \
+    for (pos = head, n = (pos ? pos->next : NULL); pos; \
+        pos = n, n = (n ? n->next : NULL))
+
+/*
+ * some handy macros that will probably be of use in more than one
+ * output format: convert integers into little-endian byte packed
+ * format in memory
+ */
+
+#if X86_MEMORY
+
+#define WRITECHAR(p,v)                          \
+    do {                                        \
+        *(uint8_t *)(p) = (v);                  \
+        (p) += 1;                               \
+    } while (0)
+
+#define WRITESHORT(p,v)                         \
+    do {                                        \
+        *(uint16_t *)(p) = (v);                 \
+        (p) += 2;                               \
+    } while (0)
+
+#define WRITELONG(p,v)                          \
+    do {                                        \
+        *(uint32_t *)(p) = (v);                 \
+        (p) += 4;                               \
+    } while (0)
+
+#define WRITEDLONG(p,v)                         \
+    do {                                        \
+        *(uint64_t *)(p) = (v);                 \
+        (p) += 8;                               \
+    } while (0)
+
+#define WRITEADDR(p,v,s)                        \
+    do {                                        \
+        uint64_t _wa_v = (v);                   \
+        memcpy((p), &_wa_v, (s));               \
+        (p) += (s);                             \
+    } while (0)
+
+#else /* !X86_MEMORY */
+
+#define WRITECHAR(p,v)                          \
+    do {                                        \
+        uint8_t *_wc_p = (uint8_t *)(p);        \
+        uint8_t _wc_v = (v);                    \
+        _wc_p[0] = _wc_v;                       \
+        (p) = (void *)(_wc_p + 1);              \
+    } while (0)
+
+#define WRITESHORT(p,v)                         \
+    do {                                        \
+        uint8_t *_ws_p = (uint8_t *)(p);        \
+        uint16_t _ws_v = (v);                   \
+        _ws_p[0] = _ws_v;                       \
+        _ws_p[1] = _ws_v >> 8;                  \
+        (p) = (void *)(_ws_p + 2);              \
+    } while (0)
+
+#define WRITELONG(p,v)                          \
+    do {                                        \
+        uint8_t *_wl_p = (uint8_t *)(p);        \
+        uint32_t _wl_v = (v);                   \
+        _wl_p[0] = _wl_v;                       \
+        _wl_p[1] = _wl_v >> 8;                  \
+        _wl_p[2] = _wl_v >> 16;                 \
+        _wl_p[3] = _wl_v >> 24;                 \
+        (p) = (void *)(_wl_p + 4);              \
+    } while (0)
+
+#define WRITEDLONG(p,v)                         \
+    do {                                        \
+        uint8_t *_wq_p = (uint8_t *)(p);        \
+        uint64_t _wq_v = (v);                   \
+        _wq_p[0] = _wq_v;                       \
+        _wq_p[1] = _wq_v >> 8;                  \
+        _wq_p[2] = _wq_v >> 16;                 \
+        _wq_p[3] = _wq_v >> 24;                 \
+        _wq_p[4] = _wq_v >> 32;                 \
+        _wq_p[5] = _wq_v >> 40;                 \
+        _wq_p[6] = _wq_v >> 48;                 \
+        _wq_p[7] = _wq_v >> 56;                 \
+        (p) = (void *)(_wq_p + 8);              \
+    } while (0)
+
+#define WRITEADDR(p,v,s)                        \
+    do {                                        \
+        int _wa_s = (s);                        \
+        uint64_t _wa_v = (v);                   \
+        while (_wa_s--) {                       \
+            WRITECHAR(p,_wa_v);                 \
+            _wa_v >>= 8;                        \
+        }                                       \
+    } while(0)
+
+#endif
+
+/*
+ * and routines to do the same thing to a file
+ */
+#define fwriteint8_t(d,f) putc(d,f)
+void fwriteint16_t(uint16_t data, FILE * fp);
+void fwriteint32_t(uint32_t data, FILE * fp);
+void fwriteint64_t(uint64_t data, FILE * fp);
+void fwriteaddr(uint64_t data, int size, FILE * fp);
+
+/*
+ * Binary search routine. Returns index into `array' of an entry
+ * matching `string', or <0 if no match. `array' is taken to
+ * contain `size' elements.
+ *
+ * bsi() is case sensitive, bsii() is case insensitive.
+ */
+int bsi(const char *string, const char **array, int size);
+int bsii(const char *string, const char **array, int size);
+
+char *src_set_fname(char *newname);
+int32_t src_set_linnum(int32_t newline);
+int32_t src_get_linnum(void);
+/*
+ * src_get may be used if you simply want to know the source file and line.
+ * It is also used if you maintain private status about the source location
+ * It return 0 if the information was the same as the last time you
+ * checked, -1 if the name changed and (new-old) if just the line changed.
+ */
+int src_get(int32_t *xline, char **xname);
+
+char *nasm_strcat(const char *one, const char *two);
+
+char *nasm_skip_spaces(const char *p);
+char *nasm_skip_word(const char *p);
+char *nasm_zap_spaces_fwd(char *p);
+char *nasm_zap_spaces_rev(char *p);
+
+const char *prefix_name(int);
+
+#define ZERO_BUF_SIZE 4096
+extern const uint8_t zero_buffer[ZERO_BUF_SIZE];
+size_t fwritezero(size_t bytes, FILE *fp);
+
+static inline bool overflow_general(int64_t value, int bytes)
+{
+    int sbit;
+    int64_t vmax, vmin;
+
+    if (bytes >= 8)
+        return false;
+
+    sbit = (bytes << 3) - 1;
+    vmax =  ((int64_t)2 << sbit) - 1;
+    vmin = -((int64_t)1 << sbit);
+
+    return value < vmin || value > vmax;
+}
+
+static inline bool overflow_signed(int64_t value, int bytes)
+{
+    int sbit;
+    int64_t vmax, vmin;
+
+    if (bytes >= 8)
+        return false;
+
+    sbit = (bytes << 3) - 1;
+    vmax =  ((int64_t)1 << sbit) - 1;
+    vmin = -((int64_t)1 << sbit);
+
+    return value < vmin || value > vmax;
+}
+
+static inline bool overflow_unsigned(int64_t value, int bytes)
+{
+    int sbit;
+    int64_t vmax, vmin;
+
+    if (bytes >= 8)
+        return false;
+
+    sbit = (bytes << 3) - 1;
+    vmax = ((int64_t)2 << sbit) - 1;
+    vmin = 0;
+
+    return value < vmin || value > vmax;
+}
+
+int idata_bytes(int opcode);
+
+/* check if value is power of 2 */
+#define is_power2(v)   ((v) && ((v) & ((v) - 1)) == 0)
+
+#endif
diff --git a/ndisasm.1 b/ndisasm.1
new file mode 100644 (file)
index 0000000..622500f
--- /dev/null
+++ b/ndisasm.1
@@ -0,0 +1,129 @@
+.\"
+.\" This file is part of NASM and is released under the NASM License.
+.\"
+.TH NDISASM 1 "The Netwide Assembler Project"
+.SH NAME
+ndisasm \- the Netwide Disassembler, an 80x86 binary file disassembler
+.SH SYNOPSIS
+.B ndisasm
+[
+.B \-o
+origin
+] [
+.B \-s
+sync-point [...]]
+[
+.B \-a
+|
+.B \-i
+] [
+.B \-b
+bits
+] [
+.B -u
+] [
+.B \-e
+hdrlen
+] [
+.B \-k
+offset,length [...]]
+infile
+.br
+.B ndisasm \-h
+.br
+.B ndisasm \-r
+.SH DESCRIPTION
+The
+.B ndisasm
+command generates a disassembly listing of the binary file
+.I infile
+and directs it to stdout.
+.SS OPTIONS
+.TP
+.B \-h
+Causes
+.B ndisasm
+to exit immediately, after giving a summary of its invocation
+options.
+.TP
+.BI \-r
+Causes
+.B ndisasm
+to exit immediately, after displaying its version number.
+.TP
+.BI \-o " origin"
+Specifies the notional load address for the file. This option causes
+.B ndisasm
+to get the addresses it lists down the left hand margin, and the
+target addresses of PC-relative jumps and calls, right.
+.TP
+.BI \-s " sync-point"
+Manually specifies a synchronisation address, such that
+.B ndisasm
+will not output any machine instruction which encompasses bytes on
+both sides of the address. Hence the instruction which
+.I starts
+at that address will be correctly disassembled.
+.TP
+.BI \-e " hdrlen"
+Specifies a number of bytes to discard from the beginning of the
+file before starting disassembly. This does not count towards the
+calculation of the disassembly offset: the first
+.I disassembled
+instruction will be shown starting at the given load address.
+.TP
+.BI \-k " offset,length"
+Specifies that
+.I length
+bytes, starting from disassembly offset
+.IR offset ,
+should be skipped over without generating any output. The skipped
+bytes still count towards the calculation of the disassembly offset.
+.TP
+.BR \-a " or " \-i
+Enables automatic (or intelligent) sync mode, in which
+.B ndisasm
+will attempt to guess where synchronisation should be performed, by
+means of examining the target addresses of the relative jumps and
+calls it disassembles.
+.TP
+.BI \-b " bits"
+Specifies 16-, 32- or 64-bit mode. The default is 16-bit mode.
+.TP
+.B \-u
+Specifies 32-bit mode, more compactly than using `-b 32'.
+.TP
+.BI \-p " vendor"
+Prefers instructions as defined by
+.I vendor
+in case of a conflict.  Known
+.I vendor
+names include
+.BR intel ,
+.BR amd ,
+.BR cyrix ,
+and
+.BR idt .
+The default is
+.BR intel .
+.PP
+.RE
+.SH RESTRICTIONS
+.B ndisasm
+only disassembles binary files: it has no understanding of the
+header information present in object or executable files. If you
+want to disassemble an object file, you should probably be using
+.BR objdump "(" 1 ")."
+.PP
+Auto-sync mode won't necessarily cure all your synchronisation
+problems: a sync marker can only be placed automatically if a jump
+or call instruction is found to refer to it
+.I before
+.B ndisasm
+actually disassembles that part of the code. Also, if spurious jumps
+or calls result from disassembling non-machine-code data, sync
+markers may get placed in strange places. Feel free to turn
+auto-sync off and go back to doing it manually if necessary.
+.PP
+.SH SEE ALSO
+.BR objdump "(" 1 ")."
diff --git a/ndisasm.c b/ndisasm.c
new file mode 100644 (file)
index 0000000..710d1f0
--- /dev/null
+++ b/ndisasm.c
@@ -0,0 +1,390 @@
+/* ----------------------------------------------------------------------- *
+ *   
+ *   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.
+ *
+ * ----------------------------------------------------------------------- */
+
+/*
+ * ndisasm.c   the Netwide Disassembler main module
+ */
+
+#include "compiler.h"
+
+#include <stdio.h>
+#include <stdarg.h>
+#include <stdlib.h>
+#include <string.h>
+#include <ctype.h>
+#include <errno.h>
+#include <inttypes.h>
+
+#include "insns.h"
+#include "nasm.h"
+#include "nasmlib.h"
+#include "sync.h"
+#include "disasm.h"
+
+#define BPL 8                   /* bytes per line of hex dump */
+
+static const char *help =
+    "usage: ndisasm [-a] [-i] [-h] [-r] [-u] [-b bits] [-o origin] [-s sync...]\n"
+    "               [-e bytes] [-k start,bytes] [-p vendor] file\n"
+    "   -a or -i activates auto (intelligent) sync\n"
+    "   -u same as -b 32\n"
+    "   -b 16, -b 32 or -b 64 sets the processor mode\n"
+    "   -h displays this text\n"
+    "   -r or -v displays the version number\n"
+    "   -e skips <bytes> bytes of header\n"
+    "   -k avoids disassembling <bytes> bytes from position <start>\n"
+    "   -p selects the preferred vendor instruction set (intel, amd, cyrix, idt)\n";
+
+static void output_ins(uint32_t, uint8_t *, int, char *);
+static void skip(uint32_t dist, FILE * fp);
+
+static void ndisasm_verror(int severity, const char *fmt, va_list va)
+{
+    vfprintf(stderr, fmt, va);
+
+    if (severity & ERR_FATAL)
+       exit(1);
+}
+
+int main(int argc, char **argv)
+{
+    char buffer[INSN_MAX * 2], *p, *ep, *q;
+    char outbuf[256];
+    char *pname = *argv;
+    char *filename = NULL;
+    uint32_t nextsync, synclen, initskip = 0L;
+    int lenread;
+    int32_t lendis;
+    bool autosync = false;
+    int bits = 16, b;
+    bool eof = false;
+    uint32_t prefer = 0;
+    bool rn_error;
+    int32_t offset;
+    FILE *fp;
+
+    tolower_init();
+    nasm_set_verror(ndisasm_verror);
+    nasm_init_malloc_error();
+
+    offset = 0;
+    init_sync();
+
+    while (--argc) {
+        char *v, *vv, *p = *++argv;
+        if (*p == '-' && p[1]) {
+            p++;
+            while (*p)
+                switch (nasm_tolower(*p)) {
+                case 'a':      /* auto or intelligent sync */
+                case 'i':
+                    autosync = true;
+                    p++;
+                    break;
+                case 'h':
+                    fputs(help, stderr);
+                    return 0;
+                case 'r':
+                case 'v':
+                    fprintf(stderr,
+                            "NDISASM version %s compiled on %s\n",
+                           nasm_version, nasm_date);
+                    return 0;
+                case 'u':      /* -u for -b 32, -uu for -b 64 */
+                   if (bits < 64)
+                       bits <<= 1;
+                    p++;
+                    break;
+                case 'b':      /* bits */
+                    v = p[1] ? p + 1 : --argc ? *++argv : NULL;
+                    if (!v) {
+                        fprintf(stderr, "%s: `-b' requires an argument\n",
+                                pname);
+                        return 1;
+                    }
+                   b = strtoul(v, &ep, 10);
+                   if (*ep || !(bits == 16 || bits == 32 || bits == 64)) {
+                        fprintf(stderr, "%s: argument to `-b' should"
+                                " be 16, 32 or 64\n", pname);
+                    } else {
+                       bits = b;
+                   }
+                    p = "";     /* force to next argument */
+                    break;
+                case 'o':      /* origin */
+                    v = p[1] ? p + 1 : --argc ? *++argv : NULL;
+                    if (!v) {
+                        fprintf(stderr, "%s: `-o' requires an argument\n",
+                                pname);
+                        return 1;
+                    }
+                    offset = readnum(v, &rn_error);
+                    if (rn_error) {
+                        fprintf(stderr,
+                                "%s: `-o' requires a numeric argument\n",
+                                pname);
+                        return 1;
+                    }
+                    p = "";     /* force to next argument */
+                    break;
+                case 's':      /* sync point */
+                    v = p[1] ? p + 1 : --argc ? *++argv : NULL;
+                    if (!v) {
+                        fprintf(stderr, "%s: `-s' requires an argument\n",
+                                pname);
+                        return 1;
+                    }
+                    add_sync(readnum(v, &rn_error), 0L);
+                    if (rn_error) {
+                        fprintf(stderr,
+                                "%s: `-s' requires a numeric argument\n",
+                                pname);
+                        return 1;
+                    }
+                    p = "";     /* force to next argument */
+                    break;
+                case 'e':      /* skip a header */
+                    v = p[1] ? p + 1 : --argc ? *++argv : NULL;
+                    if (!v) {
+                        fprintf(stderr, "%s: `-e' requires an argument\n",
+                                pname);
+                        return 1;
+                    }
+                    initskip = readnum(v, &rn_error);
+                    if (rn_error) {
+                        fprintf(stderr,
+                                "%s: `-e' requires a numeric argument\n",
+                                pname);
+                        return 1;
+                    }
+                    p = "";     /* force to next argument */
+                    break;
+                case 'k':      /* skip a region */
+                    v = p[1] ? p + 1 : --argc ? *++argv : NULL;
+                    if (!v) {
+                        fprintf(stderr, "%s: `-k' requires an argument\n",
+                                pname);
+                        return 1;
+                    }
+                    vv = strchr(v, ',');
+                    if (!vv) {
+                        fprintf(stderr,
+                                "%s: `-k' requires two numbers separated"
+                                " by a comma\n", pname);
+                        return 1;
+                    }
+                    *vv++ = '\0';
+                    nextsync = readnum(v, &rn_error);
+                    if (rn_error) {
+                        fprintf(stderr,
+                                "%s: `-k' requires numeric arguments\n",
+                                pname);
+                        return 1;
+                    }
+                    synclen = readnum(vv, &rn_error);
+                    if (rn_error) {
+                        fprintf(stderr,
+                                "%s: `-k' requires numeric arguments\n",
+                                pname);
+                        return 1;
+                    }
+                    add_sync(nextsync, synclen);
+                    p = "";     /* force to next argument */
+                    break;
+                case 'p':      /* preferred vendor */
+                    v = p[1] ? p + 1 : --argc ? *++argv : NULL;
+                    if (!v) {
+                        fprintf(stderr, "%s: `-p' requires an argument\n",
+                                pname);
+                        return 1;
+                    }
+                    if (!strcmp(v, "intel")) {
+                        prefer = 0;     /* Default */
+                    } else if (!strcmp(v, "amd")) {
+                        prefer = IF_AMD | IF_3DNOW;
+                    } else if (!strcmp(v, "cyrix")) {
+                        prefer = IF_CYRIX | IF_3DNOW;
+                    } else if (!strcmp(v, "idt") || !strcmp(v, "centaur")
+                               || !strcmp(v, "winchip")) {
+                        prefer = IF_3DNOW;
+                    } else {
+                        fprintf(stderr,
+                                "%s: unknown vendor `%s' specified with `-p'\n",
+                                pname, v);
+                        return 1;
+                    }
+                    p = "";     /* force to next argument */
+                    break;
+                default:       /*bf */
+                    fprintf(stderr, "%s: unrecognised option `-%c'\n",
+                            pname, *p);
+                    return 1;
+                }
+        } else if (!filename) {
+            filename = p;
+        } else {
+            fprintf(stderr, "%s: more than one filename specified\n",
+                    pname);
+            return 1;
+        }
+    }
+
+    if (!filename) {
+        fprintf(stderr, help, pname);
+        return 0;
+    }
+
+    if (strcmp(filename, "-")) {
+        fp = fopen(filename, "rb");
+        if (!fp) {
+            fprintf(stderr, "%s: unable to open `%s': %s\n",
+                    pname, filename, strerror(errno));
+            return 1;
+        }
+    } else
+        fp = stdin;
+
+    if (initskip > 0)
+        skip(initskip, fp);
+
+    /*
+     * This main loop is really horrible, and wants rewriting with
+     * an axe. It'll stay the way it is for a while though, until I
+     * find the energy...
+     */
+
+    p = q = buffer;
+    nextsync = next_sync(offset, &synclen);
+    do {
+        uint32_t to_read = buffer + sizeof(buffer) - p;
+       if ((nextsync || synclen) &&
+           to_read > nextsync - offset - (p - q))
+            to_read = nextsync - offset - (p - q);
+        if (to_read) {
+            lenread = fread(p, 1, to_read, fp);
+            if (lenread == 0)
+                eof = true;     /* help along systems with bad feof */
+        } else
+            lenread = 0;
+        p += lenread;
+        if ((nextsync || synclen) &&
+           (uint32_t)offset == nextsync) {
+            if (synclen) {
+                fprintf(stdout, "%08"PRIX32"  skipping 0x%"PRIX32" bytes\n",
+                       offset, synclen);
+                offset += synclen;
+                skip(synclen, fp);
+            }
+            p = q = buffer;
+            nextsync = next_sync(offset, &synclen);
+        }
+        while (p > q && (p - q >= INSN_MAX || lenread == 0)) {
+            lendis =
+                disasm((uint8_t *) q, outbuf, sizeof(outbuf), bits,
+                      offset, autosync, prefer);
+            if (!lendis || lendis > (p - q)
+                || ((nextsync || synclen) &&
+                   (uint32_t)lendis > nextsync - offset))
+                lendis = eatbyte((uint8_t *) q, outbuf, sizeof(outbuf), bits);
+            output_ins(offset, (uint8_t *) q, lendis, outbuf);
+            q += lendis;
+            offset += lendis;
+        }
+        if (q >= buffer + INSN_MAX) {
+            uint8_t *r = (uint8_t *) buffer, *s = (uint8_t *) q;
+            int count = p - q;
+            while (count--)
+                *r++ = *s++;
+            p -= (q - buffer);
+            q = buffer;
+        }
+    } while (lenread > 0 || !(eof || feof(fp)));
+
+    if (fp != stdin)
+        fclose(fp);
+
+    return 0;
+}
+
+static void output_ins(uint32_t offset, uint8_t *data,
+                       int datalen, char *insn)
+{
+    int bytes;
+    fprintf(stdout, "%08"PRIX32"  ", offset);
+
+    bytes = 0;
+    while (datalen > 0 && bytes < BPL) {
+        fprintf(stdout, "%02X", *data++);
+        bytes++;
+        datalen--;
+    }
+
+    fprintf(stdout, "%*s%s\n", (BPL + 1 - bytes) * 2, "", insn);
+
+    while (datalen > 0) {
+        fprintf(stdout, "         -");
+        bytes = 0;
+        while (datalen > 0 && bytes < BPL) {
+            fprintf(stdout, "%02X", *data++);
+            bytes++;
+            datalen--;
+        }
+        fprintf(stdout, "\n");
+    }
+}
+
+/*
+ * Skip a certain amount of data in a file, either by seeking if
+ * possible, or if that fails then by reading and discarding.
+ */
+static void skip(uint32_t dist, FILE * fp)
+{
+    char buffer[256];           /* should fit on most stacks :-) */
+
+    /*
+     * Got to be careful with fseek: at least one fseek I've tried
+     * doesn't approve of SEEK_CUR. So I'll use SEEK_SET and
+     * ftell... horrible but apparently necessary.
+     */
+    if (fseek(fp, dist + ftell(fp), SEEK_SET)) {
+        while (dist > 0) {
+            uint32_t len = (dist < sizeof(buffer) ?
+                                 dist : sizeof(buffer));
+            if (fread(buffer, 1, len, fp) < len) {
+                perror("fread");
+                exit(1);
+            }
+            dist -= len;
+        }
+    }
+}
diff --git a/nsis/nasm-un.ico b/nsis/nasm-un.ico
new file mode 100644 (file)
index 0000000..90d338c
Binary files /dev/null and b/nsis/nasm-un.ico differ
diff --git a/nsis/nasm.ico b/nsis/nasm.ico
new file mode 100644 (file)
index 0000000..b1a9d63
Binary files /dev/null and b/nsis/nasm.ico differ
diff --git a/opflags.h b/opflags.h
new file mode 100644 (file)
index 0000000..b491244
--- /dev/null
+++ b/opflags.h
@@ -0,0 +1,239 @@
+/* ----------------------------------------------------------------------- *
+ *   
+ *   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.
+ *
+ * ----------------------------------------------------------------------- */
+
+/*
+ * opflags.h - operand flags
+ */
+
+#ifndef NASM_OPFLAGS_H
+#define NASM_OPFLAGS_H
+
+#include "compiler.h"
+
+/*
+ * Here we define the operand types. These are implemented as bit
+ * masks, since some are subsets of others; e.g. AX in a MOV
+ * instruction is a special operand type, whereas AX in other
+ * contexts is just another 16-bit register. (Also, consider CL in
+ * shift instructions, DX in OUT, etc.)
+ *
+ * The basic concept here is that
+ *    (class & ~operand) == 0
+ *
+ * if and only if "operand" belongs to class type "class".
+ *
+ * The bits are assigned as follows:
+ *
+ * Bits 0-7, 23, 29: sizes
+ *  0:  8 bits (BYTE)
+ *  1: 16 bits (WORD)
+ *  2: 32 bits (DWORD)
+ *  3: 64 bits (QWORD)
+ *  4: 80 bits (TWORD)
+ *  5: FAR
+ *  6: NEAR
+ *  7: SHORT
+ * 23: 256 bits (YWORD)
+ * 29: 128 bits (OWORD)
+ *
+ * Bits 8-11 modifiers
+ *  8: TO
+ *  9: COLON
+ * 10: STRICT
+ * 11: (reserved)
+ *
+ * Bits 12-15: type of operand
+ * 12: REGISTER
+ * 13: IMMEDIATE
+ * 14: MEMORY (always has REGMEM attribute as well)
+ * 15: REGMEM (valid EA operand)
+ *
+ * Bits 16-19, 28: subclasses
+ * With REG_CDT:
+ * 16: REG_CREG (CRx)
+ * 17: REG_DREG (DRx)
+ * 18: REG_TREG (TRx)
+
+ * With REG_GPR:
+ * 16: REG_ACCUM  (AL, AX, EAX, RAX)
+ * 17: REG_COUNT  (CL, CX, ECX, RCX)
+ * 18: REG_DATA   (DL, DX, EDX, RDX)
+ * 19: REG_HIGH   (AH, CH, DH, BH)
+ * 28: REG_NOTACC (not REG_ACCUM)
+ *
+ * With REG_SREG:
+ * 16: REG_CS
+ * 17: REG_DESS (DS, ES, SS)
+ * 18: REG_FSGS
+ * 19: REG_SEG67
+ *
+ * With FPUREG:
+ * 16: FPU0
+ *
+ * With XMMREG:
+ * 16: XMM0
+ *
+ * With YMMREG:
+ * 16: YMM0
+ *
+ * With MEMORY:
+ * 16: MEM_OFFS (this is a simple offset)
+ * 17: IP_REL (IP-relative offset)
+ *
+ * With IMMEDIATE:
+ * 16: UNITY (1)
+ * 17: BYTENESS16 (-128..127)
+ * 18: BYTENESS32 (-128..127)
+ * 19: BYTENESS64 (-128..127)
+ *
+ * Bits 20-22, 24-27: register classes
+ * 20: REG_CDT (CRx, DRx, TRx)
+ * 21: RM_GPR (REG_GPR) (integer register)
+ * 22: REG_SREG
+ * 24: FPUREG
+ * 25: RM_MMX (MMXREG)
+ * 26: RM_XMM (XMMREG)
+ * 27: RM_YMM (YMMREG)
+ *
+ * Bit 31 is currently unallocated.
+ *
+ * 30: SAME_AS
+ * Special flag only used in instruction patterns; means this operand
+ * has to be identical to another operand.  Currently only supported
+ * for registers.
+ */
+
+typedef uint32_t opflags_t;
+
+/* Size, and other attributes, of the operand */
+#define BITS8           0x00000001U
+#define BITS16          0x00000002U
+#define BITS32          0x00000004U
+#define BITS64          0x00000008U   /* x64 and FPU only */
+#define BITS80          0x00000010U   /* FPU only */
+#define BITS128         0x20000000U
+#define BITS256         0x00800000U
+#define FAR             0x00000020U   /* grotty: this means 16:16 or */
+                                       /* 16:32, like in CALL/JMP */
+#define NEAR            0x00000040U
+#define SHORT           0x00000080U   /* and this means what it says :) */
+
+#define SIZE_MASK       0x208000FFU   /* all the size attributes */
+
+/* Modifiers */
+#define MODIFIER_MASK   0x00000f00U
+#define TO              0x00000100U   /* reverse effect in FADD, FSUB &c */
+#define COLON           0x00000200U   /* operand is followed by a colon */
+#define STRICT          0x00000400U   /* do not optimize this operand */
+
+/* Type of operand: memory reference, register, etc. */
+#define OPTYPE_MASK     0x0000f000U
+#define REGISTER        0x00001000U   /* register number in 'basereg' */
+#define IMMEDIATE       0x00002000U
+#define MEMORY          0x0000c000U
+#define REGMEM          0x00008000U   /* for r/m, ie EA, operands */
+
+#define is_class(class, op)     (!((opflags_t)(class) & ~(opflags_t)(op)))
+
+/* Register classes */
+#define REG_EA          0x00009000U   /* 'normal' reg, qualifies as EA */
+#define RM_GPR          0x00208000U   /* integer operand */
+#define REG_GPR         0x00209000U   /* integer register */
+#define REG8            0x00209001U   /*  8-bit GPR  */
+#define REG16           0x00209002U   /* 16-bit GPR */
+#define REG32           0x00209004U   /* 32-bit GPR */
+#define REG64           0x00209008U   /* 64-bit GPR */
+#define FPUREG          0x01001000U   /* floating point stack registers */
+#define FPU0            0x01011000U   /* FPU stack register zero */
+#define RM_MMX          0x02008000U   /* MMX operand */
+#define MMXREG          0x02009000U   /* MMX register */
+#define RM_XMM          0x04008000U   /* XMM (SSE) operand */
+#define XMMREG          0x04009000U   /* XMM (SSE) register */
+#define XMM0            0x04019000U   /* XMM register zero */
+#define RM_YMM          0x08008000U   /* YMM (AVX) operand */
+#define YMMREG          0x08009000U   /* YMM (AVX) register */
+#define YMM0            0x08019000U   /* YMM register zero */
+#define REG_CDT         0x00101004U   /* CRn, DRn and TRn */
+#define REG_CREG        0x00111004U   /* CRn */
+#define REG_DREG        0x00121004U   /* DRn */
+#define REG_TREG        0x00141004U   /* TRn */
+#define REG_SREG        0x00401002U   /* any segment register */
+#define REG_CS          0x00411002U   /* CS */
+#define REG_DESS        0x00421002U   /* DS, ES, SS */
+#define REG_FSGS        0x00441002U   /* FS, GS */
+#define REG_SEG67       0x00481002U   /* Unimplemented segment registers */
+
+#define REG_RIP         0x00801008U   /* RIP relative addressing */
+#define REG_EIP         0x00801004U   /* EIP relative addressing */
+
+/* Special GPRs */
+#define REG_SMASK       0x100f0000U   /* a mask for the following */
+#define REG_ACCUM       0x00219000U   /* accumulator: AL, AX, EAX, RAX */
+#define REG_AL          0x00219001U
+#define REG_AX          0x00219002U
+#define REG_EAX         0x00219004U
+#define REG_RAX         0x00219008U
+#define REG_COUNT       0x10229000U   /* counter: CL, CX, ECX, RCX */
+#define REG_CL          0x10229001U
+#define REG_CX          0x10229002U
+#define REG_ECX         0x10229004U
+#define REG_RCX         0x10229008U
+#define REG_DL          0x10249001U   /* data: DL, DX, EDX, RDX */
+#define REG_DX          0x10249002U
+#define REG_EDX         0x10249004U
+#define REG_RDX         0x10249008U
+#define REG_HIGH        0x10289001U   /* high regs: AH, CH, DH, BH */
+#define REG_NOTACC      0x10000000U   /* non-accumulator register */
+#define REG8NA          0x10209001U   /*  8-bit non-acc GPR  */
+#define REG16NA         0x10209002U   /* 16-bit non-acc GPR */
+#define REG32NA         0x10209004U   /* 32-bit non-acc GPR */
+#define REG64NA         0x10209008U   /* 64-bit non-acc GPR */
+
+/* special types of EAs */
+#define MEM_OFFS        0x0001c000U   /* simple [address] offset - absolute! */
+#define IP_REL          0x0002c000U   /* IP-relative offset */
+
+/* memory which matches any type of r/m operand */
+#define MEMORY_ANY      (MEMORY|RM_GPR|RM_MMX|RM_XMM|RM_YMM)
+
+/* special type of immediate operand */
+#define UNITY           0x00012000U   /* for shift/rotate instructions */
+#define SBYTE16         0x00022000U   /* for op r16,immediate instrs. */
+#define SBYTE32         0x00042000U   /* for op r32,immediate instrs. */
+#define SBYTE64         0x00082000U   /* for op r64,immediate instrs. */
+#define BYTENESS        0x000e0000U   /* for testing for byteness */
+
+/* special flags */
+#define SAME_AS         0x40000000U
+
+#endif /* NASM_OPFLAGS_H */
diff --git a/output/dwarf.h b/output/dwarf.h
new file mode 100644 (file)
index 0000000..cc3c530
--- /dev/null
@@ -0,0 +1,566 @@
+/* ----------------------------------------------------------------------- *
+ *
+ *   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.
+ *
+ * ----------------------------------------------------------------------- */
+
+#ifndef OUTPUT_DWARF_H
+#define OUTPUT_DWARF_H
+
+/*
+ * based on DWARF 3 standart
+ */
+
+enum dwarf_tag {
+       DW_TAG_padding                  = 0x00,
+       DW_TAG_array_type               = 0x01,
+       DW_TAG_class_type               = 0x02,
+       DW_TAG_entry_point              = 0x03,
+       DW_TAG_enumeration_type         = 0x04,
+       DW_TAG_formal_parameter         = 0x05,
+       DW_TAG_global_subroutine        = 0x06,
+       DW_TAG_global_variable          = 0x07,
+       DW_TAG_label                    = 0x0a,
+       DW_TAG_lexical_block            = 0x0b,
+       DW_TAG_local_variable           = 0x0c,
+       DW_TAG_member                   = 0x0d,
+       DW_TAG_pointer_type             = 0x0f,
+       DW_TAG_reference_type           = 0x10,
+       DW_TAG_compile_unit             = 0x11,
+       DW_TAG_string_type              = 0x12,
+       DW_TAG_structure_type           = 0x13,
+       DW_TAG_subroutine               = 0x14,
+       DW_TAG_subroutine_type          = 0x15,
+       DW_TAG_typedef                  = 0x16,
+       DW_TAG_union_type               = 0x17,
+       DW_TAG_unspecified_parameters   = 0x18,
+       DW_TAG_variant                  = 0x19,
+       DW_TAG_common_block             = 0x1a,
+       DW_TAG_common_inclusion         = 0x1b,
+       DW_TAG_inheritance              = 0x1c,
+       DW_TAG_inlined_subroutine       = 0x1d,
+       DW_TAG_module                   = 0x1e,
+       DW_TAG_ptr_to_member_type       = 0x1f,
+       DW_TAG_set_type                 = 0x20,
+       DW_TAG_subrange_type            = 0x21,
+       DW_TAG_with_stmt                = 0x22,
+       DW_TAG_access_declaration       = 0x23,
+       DW_TAG_base_type                = 0x24,
+       DW_TAG_catch_block              = 0x25,
+       DW_TAG_const_type               = 0x26,
+       DW_TAG_constant                 = 0x27,
+       DW_TAG_enumerator               = 0x28,
+       DW_TAG_file_type                = 0x29,
+       DW_TAG_friend                   = 0x2a,
+       DW_TAG_namelist                 = 0x2b,
+       DW_TAG_namelist_item            = 0x2c,
+       DW_TAG_packed_type              = 0x2d,
+       DW_TAG_subprogram               = 0x2e,
+       DW_TAG_template_type_parameter  = 0x2f,
+       DW_TAG_template_value_parameter = 0x30,
+       DW_TAG_thrown_type              = 0x31,
+       DW_TAG_try_block                = 0x32,
+       DW_TAG_variant_part             = 0x33,
+       DW_TAG_variable                 = 0x34,
+       DW_TAG_volatile_type            = 0x35,
+       DW_TAG_dwarf_procedure          = 0x36,
+       DW_TAG_restrict_type            = 0x37,
+       DW_TAG_interface_type           = 0x38,
+       DW_TAG_namespace                = 0x39,
+       DW_TAG_imported_module          = 0x3a,
+       DW_TAG_unspecified_type         = 0x3b,
+       DW_TAG_partial_unit             = 0x3c,
+       DW_TAG_imported_unit            = 0x3d,
+       DW_TAG_condition                = 0x3f,
+       DW_TAG_shared_type              = 0x40,
+
+       DW_TAG_lo_user                  = 0x4080,
+       DW_TAG_hi_user                  = 0xffff
+};
+
+enum dwarf_child {
+       DW_CHILDREN_no          = 0x00,
+       DW_CHILDREN_yes         = 0x01
+};
+
+enum dwarf_form {
+       DW_FORM_addr            = 0x01,
+       DW_FORM_block2          = 0x03,
+       DW_FORM_block4          = 0x04,
+       DW_FORM_data2           = 0x05,
+       DW_FORM_data4           = 0x06,
+       DW_FORM_data8           = 0x07,
+       DW_FORM_string          = 0x08,
+       DW_FORM_block           = 0x09,
+       DW_FORM_block1          = 0x0a,
+       DW_FORM_data1           = 0x0b,
+       DW_FORM_flag            = 0x0c,
+       DW_FORM_sdata           = 0x0d,
+       DW_FORM_strp            = 0x0e,
+       DW_FORM_udata           = 0x0f,
+       DW_FORM_ref_addr        = 0x10,
+       DW_FORM_ref1            = 0x11,
+       DW_FORM_ref2            = 0x12,
+       DW_FORM_ref4            = 0x13,
+       DW_FORM_ref8            = 0x14,
+       DW_FORM_ref_udata       = 0x15,
+       DW_FORM_indirect        = 0x16
+};
+
+enum dwarf_attribute {
+       DW_AT_sibling           = 0x01,
+       DW_AT_location          = 0x02,
+       DW_AT_name              = 0x03,
+       DW_AT_ordering          = 0x09,
+       DW_AT_byte_size         = 0x0b,
+       DW_AT_bit_offset        = 0x0c,
+       DW_AT_bit_size          = 0x0d,
+       DW_AT_stmt_list         = 0x10,
+       DW_AT_low_pc            = 0x11,
+       DW_AT_high_pc           = 0x12,
+       DW_AT_language          = 0x13,
+       DW_AT_discr             = 0x15,
+       DW_AT_discr_value       = 0x16,
+       DW_AT_visibility        = 0x17,
+       DW_AT_import            = 0x18,
+       DW_AT_string_length     = 0x19,
+       DW_AT_common_reference  = 0x1a,
+       DW_AT_comp_dir          = 0x1b,
+       DW_AT_const_value       = 0x1c,
+       DW_AT_containing_type   = 0x1d,
+       DW_AT_default_value     = 0x1e,
+       DW_AT_inline            = 0x20,
+       DW_AT_is_optional       = 0x21,
+       DW_AT_lower_bound       = 0x22,
+       DW_AT_producer          = 0x25,
+       DW_AT_prototyped        = 0x27,
+       DW_AT_return_addr       = 0x2a,
+       DW_AT_start_scope       = 0x2c,
+       DW_AT_bit_stride        = 0x2e,
+       DW_AT_upper_bound       = 0x2f,
+       DW_AT_abstract_origin   = 0x31,
+       DW_AT_accessibility     = 0x32,
+       DW_AT_address_class     = 0x33,
+       DW_AT_artificial        = 0x34,
+       DW_AT_base_types        = 0x35,
+       DW_AT_calling_convention= 0x36,
+       DW_AT_count             = 0x37,
+       DW_AT_data_member_location = 0x38,
+       DW_AT_decl_column       = 0x39,
+       DW_AT_decl_file         = 0x3a,
+       DW_AT_decl_line         = 0x3b,
+       DW_AT_declaration       = 0x3c,
+       DW_AT_discr_list        = 0x3d,
+       DW_AT_encoding          = 0x3e,
+       DW_AT_external          = 0x3f,
+       DW_AT_frame_base        = 0x40,
+       DW_AT_friend            = 0x41,
+       DW_AT_identifier_case   = 0x42,
+       DW_AT_macro_info        = 0x43,
+       DW_AT_namelist_item     = 0x44,
+       DW_AT_priority          = 0x45,
+       DW_AT_segment           = 0x46,
+       DW_AT_specification     = 0x47,
+       DW_AT_static_link       = 0x48,
+       DW_AT_type              = 0x49,
+       DW_AT_use_location      = 0x4a,
+       DW_AT_variable_parameter = 0x4b,
+       DW_AT_virtuality        = 0x4c,
+       DW_AT_vtable_elem_location = 0x4d,
+       DW_AT_allocated         = 0x4e,
+       DW_AT_associated        = 0x4f,
+       DW_AT_data_location     = 0x50,
+       DW_AT_byte_stride       = 0x51,
+       DW_AT_entry_pc          = 0x52,
+       DW_AT_use_UTF8          = 0x53,
+       DW_AT_extension         = 0x54,
+       DW_AT_ranges            = 0x55,
+       DW_AT_trampoline        = 0x56,
+       DW_AT_call_column       = 0x57,
+       DW_AT_call_file         = 0x58,
+       DW_AT_call_line         = 0x59,
+       DW_AT_description       = 0x5a,
+       DW_AT_binary_scale      = 0x5b,
+       DW_AT_decimal_scale     = 0x5c,
+       DW_AT_small             = 0x5d,
+       DW_AT_decimal_sign      = 0x5e,
+       DW_AT_digit_count       = 0x5f,
+       DW_AT_picture_string    = 0x60,
+       DW_AT_mutable           = 0x61,
+       DW_AT_threads_scaled    = 0x62,
+       DW_AT_explicit          = 0x63,
+       DW_AT_object_pointer    = 0x64,
+       DW_AT_endianity         = 0x65,
+       DW_AT_elemental         = 0x66,
+       DW_AT_pure              = 0x67,
+       DW_AT_recursive         = 0x68,
+
+       DW_AT_lo_user           = 0x2000,
+       DW_AT_hi_user           = 0x3fff
+};
+
+enum dwarf_op {
+       DW_OP_addr              = 0x03,
+       DW_OP_deref             = 0x06,
+       DW_OP_const1u           = 0x08,
+       DW_OP_const1s           = 0x09,
+       DW_OP_const2u           = 0x0a,
+       DW_OP_const2s           = 0x0b,
+       DW_OP_const4u           = 0x0c,
+       DW_OP_const4s           = 0x0d,
+       DW_OP_const8u           = 0x0e,
+       DW_OP_const8s           = 0x0f,
+       DW_OP_constu            = 0x10,
+       DW_OP_consts            = 0x11,
+       DW_OP_dup               = 0x12,
+       DW_OP_drop              = 0x13,
+       DW_OP_over              = 0x14,
+       DW_OP_pick              = 0x15,
+       DW_OP_swap              = 0x16,
+       DW_OP_rot               = 0x17,
+       DW_OP_xderef            = 0x18,
+       DW_OP_abs               = 0x19,
+       DW_OP_and               = 0x1a,
+       DW_OP_div               = 0x1b,
+       DW_OP_minus             = 0x1c,
+       DW_OP_mod               = 0x1d,
+       DW_OP_mul               = 0x1e,
+       DW_OP_neg               = 0x1f,
+       DW_OP_not               = 0x20,
+       DW_OP_or                = 0x21,
+       DW_OP_plus              = 0x22,
+       DW_OP_plus_uconst       = 0x23,
+       DW_OP_shl               = 0x24,
+       DW_OP_shr               = 0x25,
+       DW_OP_shra              = 0x26,
+       DW_OP_xor               = 0x27,
+       DW_OP_skip              = 0x2f,
+       DW_OP_bra               = 0x28,
+       DW_OP_eq                = 0x29,
+       DW_OP_ge                = 0x2a,
+       DW_OP_gt                = 0x2b,
+       DW_OP_le                = 0x2c,
+       DW_OP_lt                = 0x2d,
+       DW_OP_ne                = 0x2e,
+       DW_OP_lit0              = 0x30,
+       DW_OP_lit1              = 0x31,
+       DW_OP_lit2              = 0x32,
+       DW_OP_lit3              = 0x33,
+       DW_OP_lit4              = 0x34,
+       DW_OP_lit5              = 0x35,
+       DW_OP_lit6              = 0x36,
+       DW_OP_lit7              = 0x37,
+       DW_OP_lit8              = 0x38,
+       DW_OP_lit9              = 0x39,
+       DW_OP_lit10             = 0x3a,
+       DW_OP_lit11             = 0x3b,
+       DW_OP_lit12             = 0x3c,
+       DW_OP_lit13             = 0x3d,
+       DW_OP_lit14             = 0x3e,
+       DW_OP_lit15             = 0x3f,
+       DW_OP_lit16             = 0x40,
+       DW_OP_lit17             = 0x41,
+       DW_OP_lit18             = 0x42,
+       DW_OP_lit19             = 0x43,
+       DW_OP_lit20             = 0x44,
+       DW_OP_lit21             = 0x45,
+       DW_OP_lit22             = 0x46,
+       DW_OP_lit23             = 0x47,
+       DW_OP_lit24             = 0x48,
+       DW_OP_lit25             = 0x49,
+       DW_OP_lit26             = 0x4a,
+       DW_OP_lit27             = 0x4b,
+       DW_OP_lit28             = 0x4c,
+       DW_OP_lit29             = 0x4d,
+       DW_OP_lit30             = 0x4e,
+       DW_OP_lit31             = 0x4f,
+       DW_OP_reg0              = 0x50,
+       DW_OP_reg1              = 0x51,
+       DW_OP_reg2              = 0x52,
+       DW_OP_reg3              = 0x53,
+       DW_OP_reg4              = 0x54,
+       DW_OP_reg5              = 0x55,
+       DW_OP_reg6              = 0x56,
+       DW_OP_reg7              = 0x57,
+       DW_OP_reg8              = 0x58,
+       DW_OP_reg9              = 0x59,
+       DW_OP_reg10             = 0x5a,
+       DW_OP_reg11             = 0x5b,
+       DW_OP_reg12             = 0x5c,
+       DW_OP_reg13             = 0x5d,
+       DW_OP_reg14             = 0x5e,
+       DW_OP_reg15             = 0x5f,
+       DW_OP_reg16             = 0x60,
+       DW_OP_reg17             = 0x61,
+       DW_OP_reg18             = 0x62,
+       DW_OP_reg19             = 0x63,
+       DW_OP_reg20             = 0x64,
+       DW_OP_reg21             = 0x65,
+       DW_OP_reg22             = 0x66,
+       DW_OP_reg23             = 0x67,
+       DW_OP_reg24             = 0x68,
+       DW_OP_reg25             = 0x69,
+       DW_OP_reg26             = 0x6a,
+       DW_OP_reg27             = 0x6b,
+       DW_OP_reg28             = 0x6c,
+       DW_OP_reg29             = 0x6d,
+       DW_OP_reg30             = 0x6e,
+       DW_OP_reg31             = 0x6f,
+       DW_OP_breg0             = 0x70,
+       DW_OP_breg1             = 0x71,
+       DW_OP_breg2             = 0x72,
+       DW_OP_breg3             = 0x73,
+       DW_OP_breg4             = 0x74,
+       DW_OP_breg5             = 0x75,
+       DW_OP_breg6             = 0x76,
+       DW_OP_breg7             = 0x77,
+       DW_OP_breg8             = 0x78,
+       DW_OP_breg9             = 0x79,
+       DW_OP_breg10            = 0x7a,
+       DW_OP_breg11            = 0x7b,
+       DW_OP_breg12            = 0x7c,
+       DW_OP_breg13            = 0x7d,
+       DW_OP_breg14            = 0x7e,
+       DW_OP_breg15            = 0x7f,
+       DW_OP_breg16            = 0x80,
+       DW_OP_breg17            = 0x81,
+       DW_OP_breg18            = 0x82,
+       DW_OP_breg19            = 0x83,
+       DW_OP_breg20            = 0x84,
+       DW_OP_breg21            = 0x85,
+       DW_OP_breg22            = 0x86,
+       DW_OP_breg23            = 0x87,
+       DW_OP_breg24            = 0x88,
+       DW_OP_breg25            = 0x89,
+       DW_OP_breg26            = 0x8a,
+       DW_OP_breg27            = 0x8b,
+       DW_OP_breg28            = 0x8c,
+       DW_OP_breg29            = 0x8d,
+       DW_OP_breg30            = 0x8e,
+       DW_OP_breg31            = 0x8f,
+       DW_OP_regx              = 0x90,
+       DW_OP_fbreg             = 0x91,
+       DW_OP_bregx             = 0x92,
+       DW_OP_piece             = 0x93,
+       DW_OP_deref_size        = 0x94,
+       DW_OP_xderef_size       = 0x95,
+       DW_OP_nop               = 0x96,
+       DW_OP_push_object_address = 0x97,
+       DW_OP_call2             = 0x98,
+       DW_OP_call4             = 0x99,
+       DW_OP_call_ref          = 0x9a ,
+       DW_OP_form_tls_address  = 0x9b,
+       DW_OP_call_frame_cfa    = 0x9c,
+       DW_OP_bit_piece         = 0x9d,
+
+       DW_OP_lo_user           = 0xe0,
+       DW_OP_hi_user           = 0xff
+};
+
+enum dwarf_base_type {
+       DW_ATE_address          = 0x01,
+       DW_ATE_boolean          = 0x02,
+       DW_ATE_complex_float    = 0x03,
+       DW_ATE_float            = 0x04,
+       DW_ATE_signed           = 0x05,
+       DW_ATE_signed_char      = 0x06,
+       DW_ATE_unsigned         = 0x07,
+       DW_ATE_unsigned_char    = 0x08,
+       DW_ATE_imaginary_float  = 0x09,
+       DW_ATE_packed_decimal   = 0x0a,
+       DW_ATE_numeric_string   = 0x0b,
+       DW_ATE_edited           = 0x0c,
+       DW_ATE_signed_fixed     = 0x0d,
+       DW_ATE_unsigned_fixed   = 0x0e,
+       DW_ATE_decimal_float    = 0x0f,
+
+       DW_ATE_lo_user          = 0x80,
+       DW_ATE_hi_user          = 0xff
+};
+
+enum dwarf_decimal_sign {
+       DW_DS_unsigned                  = 0x01,
+       DW_DS_leading_overpunch         = 0x02,
+       DW_DS_trailing_overpunch        = 0x03,
+       DW_DS_leading_separate          = 0x04,
+       DW_DS_trailing_separate         = 0x05
+};
+
+enum dwarf_endianity {
+       DW_END_default  = 0x00,
+       DW_END_big      = 0x01,
+       DW_END_little   = 0x02,
+
+       DW_END_lo_user  = 0x40,
+       DW_END_hi_user  = 0xff
+};
+
+enum dwarf_accessibility {
+       DW_ACCESS_public        = 0x01,
+       DW_ACCESS_protected     = 0x02,
+       DW_ACCESS_private       = 0x03
+};
+
+enum dwarf_visibility {
+       DW_VIS_local            = 0x01,
+       DW_VIS_exported         = 0x02,
+       DW_VIS_qualified        = 0x03
+};
+
+enum dwarf_virtuality {
+       DW_VIRTUALITY_none              = 0x00,
+       DW_VIRTUALITY_virtual           = 0x01,
+       DW_VIRTUALITY_pure_virtual      = 0x02
+};
+
+enum dwarf_language {
+       DW_LANG_C89             = 0x0001,
+       DW_LANG_C               = 0x0002,
+       DW_LANG_Ada83           = 0x0003,
+       DW_LANG_C_plus_plus     = 0x0004,
+       DW_LANG_Cobol74         = 0x0005,
+       DW_LANG_Cobol85         = 0x0006,
+       DW_LANG_Fortran77       = 0x0007,
+       DW_LANG_Fortran90       = 0x0008,
+       DW_LANG_Pascal83        = 0x0009,
+       DW_LANG_Modula2         = 0x000a,
+       DW_LANG_Java            = 0x000b,
+       DW_LANG_C99             = 0x000c,
+       DW_LANG_Ada95           = 0x000d,
+       DW_LANG_Fortran95       = 0x000e,
+       DW_LANG_PLI             = 0x000f,
+       DW_LANG_ObjC            = 0x0010,
+       DW_LANG_ObjC_plus_plus  = 0x0011,
+       DW_LANG_UPC             = 0x0012,
+       DW_LANG_D               = 0x0013,
+
+       DW_LANG_Mips_Assembler  = 0x8001,
+
+       DW_LANG_lo_user         = 0x8000,
+       DW_LANG_hi_user         = 0xffff
+};
+
+enum dwarf_identifier_case {
+       DW_ID_case_sensitive    = 0x00,
+       DW_ID_up_case           = 0x01,
+       DW_ID_down_case         = 0x02,
+       DW_ID_case_insensitive  = 0x03
+};
+
+enum dwarf_calling_conversion {
+       DW_CC_normal    = 0x01,
+       DW_CC_program   = 0x02,
+       DW_CC_nocall    = 0x03,
+
+       DW_CC_lo_user   = 0x40,
+       DW_CC_hi_user   = 0xff
+};
+
+enum dwarf_inline {
+       DW_INL_not_inlined              = 0x00,
+       DW_INL_inlined                  = 0x01,
+       DW_INL_declared_not_inlined     = 0x02,
+       DW_INL_declared_inlined         = 0x03
+};
+
+enum dwarf_ordering {
+       DW_ORD_row_major = 0x00,
+       DW_ORD_col_major = 0x01
+};
+
+enum dwarf_discriminant {
+       DW_DSC_label = 0x00,
+       DW_DSC_range = 0x01
+};
+
+enum dwarf_line_number {
+       DW_LNS_extended_op      = 0x00,
+       DW_LNS_copy             = 0x01,
+       DW_LNS_advance_pc       = 0x02,
+       DW_LNS_advance_line     = 0x03,
+       DW_LNS_set_file         = 0x04,
+       DW_LNS_set_column       = 0x05,
+       DW_LNS_negate_stmt      = 0x06,
+       DW_LNS_set_basic_block  = 0x07,
+       DW_LNS_const_add_pc     = 0x08,
+       DW_LNS_fixed_advance_pc = 0x09,
+       DW_LNS_set_prologue_end = 0x0a,
+       DW_LNS_set_epilogue_begin = 0x0b,
+       DW_LNS_set_isa          = 0x0c
+};
+
+enum dwarf_line_number_extended {
+       DW_LNE_end_sequence     = 0x01,
+       DW_LNE_set_address      = 0x02,
+       DW_LNE_define_file      = 0x03,
+       DW_LNE_lo_user          = 0x80,
+       DW_LNE_hi_user          = 0xff
+};
+
+enum dwarf_macinfo_type {
+       DW_MACINFO_define       = 0x01,
+       DW_MACINFO_undef        = 0x02,
+       DW_MACINFO_start_file   = 0x03,
+       DW_MACINFO_end_file     = 0x04,
+       DW_MACINFO_vendor_ext   = 0xff
+};
+
+enum dwarf_call_frame {
+       DW_CFA_advance_loc              = 0x01,
+       DW_CFA_offset                   = 0x02,
+       DW_CFA_restore                  = 0x03,
+       DW_CFA_nop                      = 0x00,
+       DW_CFA_set_loc                  = 0x01,
+       DW_CFA_advance_loc1             = 0x02,
+       DW_CFA_advance_loc2             = 0x03,
+       DW_CFA_advance_loc4             = 0x04,
+       DW_CFA_offset_extended          = 0x05,
+       DW_CFA_restore_extended         = 0x06,
+       DW_CFA_undefined                = 0x07,
+       DW_CFA_same_value               = 0x08,
+       DW_CFA_register                 = 0x09,
+       DW_CFA_remember_state           = 0x0a,
+       DW_CFA_restore_state            = 0x0b,
+       DW_CFA_def_cfa                  = 0x0c,
+       DW_CFA_def_cfa_register         = 0x0d,
+       DW_CFA_def_cfa_offset           = 0x0e,
+       DW_CFA_def_cfa_expression       = 0x0f,
+       DW_CFA_expression               = 0x10,
+       DW_CFA_offset_extended_sf       = 0x11,
+       DW_CFA_def_cfa_sf               = 0x12,
+       DW_CFA_def_cfa_offset_sf        = 0x13,
+       DW_CFA_val_offset               = 0x14,
+       DW_CFA_val_offset_sf            = 0x15,
+       DW_CFA_val_expression           = 0x16,
+       DW_CFA_lo_user                  = 0x1c,
+       DW_CFA_hi_user                  = 0x3f
+};
+
+#endif /* OUTPUT_DWARF_H */
diff --git a/output/elf.h b/output/elf.h
new file mode 100644 (file)
index 0000000..ebdbfe6
--- /dev/null
@@ -0,0 +1,534 @@
+/* ----------------------------------------------------------------------- *
+ *
+ *   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.
+ *
+ * ----------------------------------------------------------------------- */
+
+#ifndef OUTPUT_ELF_H
+#define OUTPUT_ELF_H
+
+/*
+ * Since NASM support both Elf32/64 file formats
+ * we need to cover all types, structures, typedefs and etc
+ */
+
+#include "compiler.h"
+#include <inttypes.h>
+
+/* Segment types */
+#define PT_NULL         0
+#define PT_LOAD         1
+#define PT_DYNAMIC      2
+#define PT_INTERP       3
+#define PT_NOTE         4
+#define PT_SHLIB        5
+#define PT_PHDR         6
+#define PT_LOOS         0x60000000
+#define PT_HIOS         0x6fffffff
+#define PT_LOPROC       0x70000000
+#define PT_HIPROC       0x7fffffff
+#define PT_GNU_EH_FRAME 0x6474e550  /* Extension, eh? */
+
+/* ELF file types */
+#define ET_NONE         0
+#define ET_REL          1
+#define ET_EXEC         2
+#define ET_DYN          3
+#define ET_CORE         4
+#define ET_LOPROC       0xff00
+#define ET_HIPROC       0xffff
+
+/* ELF machine types */
+#define EM_NONE         0
+#define EM_M32          1
+#define EM_SPARC        2
+#define EM_386          3
+#define EM_68K          4
+#define EM_88K          5
+#define EM_486          6       /* Not used in Linux at least */
+#define EM_860          7
+#define EM_MIPS         8       /* R3k, bigendian(?) */
+#define EM_MIPS_RS4_BE  10      /* R4k BE */
+#define EM_PARISC       15
+#define EM_SPARC32PLUS  18
+#define EM_PPC          20
+#define EM_PPC64        21
+#define EM_S390         22
+#define EM_SH           42
+#define EM_SPARCV9      43      /* v9 = SPARC64 */
+#define EM_H8_300H      47
+#define EM_H8S          48
+#define EM_IA_64        50
+#define EM_X86_64       62
+#define EM_CRIS         76
+#define EM_V850         87
+#define EM_ALPHA        0x9026  /* Interrim Alpha that stuck around */
+#define EM_CYGNUS_V850  0x9080  /* Old v850 ID used by Cygnus */
+#define EM_S390_OLD     0xA390  /* Obsolete interrim value for S/390 */
+
+/* Dynamic type values */
+#define DT_NULL         0
+#define DT_NEEDED       1
+#define DT_PLTRELSZ     2
+#define DT_PLTGOT       3
+#define DT_HASH         4
+#define DT_STRTAB       5
+#define DT_SYMTAB       6
+#define DT_RELA         7
+#define DT_RELASZ       8
+#define DT_RELAENT      9
+#define DT_STRSZ        10
+#define DT_SYMENT       11
+#define DT_INIT         12
+#define DT_FINI         13
+#define DT_SONAME       14
+#define DT_RPATH        15
+#define DT_SYMBOLIC     16
+#define DT_REL          17
+#define DT_RELSZ        18
+#define DT_RELENT       19
+#define DT_PLTREL       20
+#define DT_DEBUG        21
+#define DT_TEXTREL      22
+#define DT_JMPREL       23
+#define DT_LOPROC       0x70000000
+#define DT_HIPROC       0x7fffffff
+
+/* Auxilliary table entries */
+#define AT_NULL         0       /* end of vector */
+#define AT_IGNORE       1       /* entry should be ignored */
+#define AT_EXECFD       2       /* file descriptor of program */
+#define AT_PHDR         3       /* program headers for program */
+#define AT_PHENT        4       /* size of program header entry */
+#define AT_PHNUM        5       /* number of program headers */
+#define AT_PAGESZ       6       /* system page size */
+#define AT_BASE         7       /* base address of interpreter */
+#define AT_FLAGS        8       /* flags */
+#define AT_ENTRY        9       /* entry point of program */
+#define AT_NOTELF       10      /* program is not ELF */
+#define AT_UID          11      /* real uid */
+#define AT_EUID         12      /* effective uid */
+#define AT_GID          13      /* real gid */
+#define AT_EGID         14      /* effective gid */
+#define AT_PLATFORM     15      /* string identifying CPU for optimizations */
+#define AT_HWCAP        16      /* arch dependent hints at CPU capabilities */
+#define AT_CLKTCK       17      /* frequency at which times() increments */
+/* 18..22 = ? */
+#define AT_SECURE       23      /* secure mode boolean */
+
+/* Program header permission flags */
+#define PF_X            0x1
+#define PF_W            0x2
+#define PF_R            0x4
+
+/* Section header types */
+#define SHT_NULL        0
+#define SHT_PROGBITS    1
+#define SHT_SYMTAB      2
+#define SHT_STRTAB      3
+#define SHT_RELA        4
+#define SHT_HASH        5
+#define SHT_DYNAMIC     6
+#define SHT_NOTE        7
+#define SHT_NOBITS      8
+#define SHT_REL         9
+#define SHT_SHLIB       10
+#define SHT_DYNSYM      11
+#define SHT_NUM         12
+#define SHT_LOPROC      0x70000000
+#define SHT_HIPROC      0x7fffffff
+#define SHT_LOUSER      0x80000000
+#define SHT_HIUSER      0xffffffff
+
+/* Section header flags */
+#define SHF_WRITE            (1 << 0)   /* Writable */
+#define SHF_ALLOC            (1 << 1)   /* Occupies memory during execution */
+#define SHF_EXECINSTR        (1 << 2)   /* Executable */
+#define SHF_MERGE            (1 << 4)   /* Might be merged */
+#define SHF_STRINGS          (1 << 5)   /* Contains nul-terminated strings */
+#define SHF_INFO_LINK        (1 << 6)   /* `sh_info' contains SHT index */
+#define SHF_LINK_ORDER       (1 << 7)   /* Preserve order after combining */
+#define SHF_OS_NONCONFORMING (1 << 8)   /* Non-standard OS specific handling required */
+#define SHF_GROUP            (1 << 9)   /* Section is member of a group.  */
+#define SHF_TLS              (1 << 10)  /* Section hold thread-local data.  */
+
+/* Special section numbers */
+#define SHN_UNDEF       0
+#define SHN_LORESERVE   0xff00
+#define SHN_LOPROC      0xff00
+#define SHN_HIPROC      0xff1f
+#define SHN_ABS         0xfff1
+#define SHN_COMMON      0xfff2
+#define SHN_HIRESERVE   0xffff
+
+/* Lenght of magic at the start of a file */
+#define EI_NIDENT       16
+
+/* Magic number constants... */
+#define EI_MAG0         0       /* e_ident[] indexes */
+#define EI_MAG1         1
+#define EI_MAG2         2
+#define EI_MAG3         3
+#define EI_CLASS        4
+#define EI_DATA         5
+#define EI_VERSION      6
+#define EI_OSABI        7
+#define EI_PAD          8
+
+#define ELFMAG0         0x7f    /* EI_MAG */
+#define ELFMAG1         'E'
+#define ELFMAG2         'L'
+#define ELFMAG3         'F'
+#define ELFMAG          "\177ELF"
+#define SELFMAG         4
+
+#define ELFCLASSNONE    0       /* EI_CLASS */
+#define ELFCLASS32      1
+#define ELFCLASS64      2
+#define ELFCLASSNUM     3
+
+#define ELFDATANONE     0       /* e_ident[EI_DATA] */
+#define ELFDATA2LSB     1
+#define ELFDATA2MSB     2
+
+#define EV_NONE         0       /* e_version, EI_VERSION */
+#define EV_CURRENT      1
+#define EV_NUM          2
+
+#define ELFOSABI_NONE   0
+#define ELFOSABI_LINUX  3
+
+/* Legal values for ST_BIND subfield of st_info (symbol binding).  */
+#define STB_LOCAL       0       /* Local symbol */
+#define STB_GLOBAL      1       /* Global symbol */
+#define STB_WEAK        2       /* Weak symbol */
+#define STB_NUM         3       /* Number of defined types.  */
+#define STB_LOOS        10      /* Start of OS-specific */
+#define STB_HIOS        12      /* End of OS-specific */
+#define STB_LOPROC      13      /* Start of processor-specific */
+#define STB_HIPROC      15      /* End of processor-specific */
+
+/* Symbol types */
+#define STT_NOTYPE      0       /* Symbol type is unspecified */
+#define STT_OBJECT      1       /* Symbol is a data object */
+#define STT_FUNC        2       /* Symbol is a code object */
+#define STT_SECTION     3       /* Symbol associated with a section */
+#define STT_FILE        4       /* Symbol's name is file name */
+#define STT_COMMON      5       /* Symbol is a common data object */
+#define STT_TLS         6       /* Symbol is thread-local data object*/
+#define STT_NUM         7       /* Number of defined types.  */
+
+/* Symbol visibilities */
+#define STV_DEFAULT     0       /* Default symbol visibility rules */
+#define STV_INTERNAL    1       /* Processor specific hidden class */
+#define STV_HIDDEN      2       /* Sym unavailable in other modules */
+#define STV_PROTECTED   3       /* Not preemptible, not exported */
+
+/* Both Elf32_Sym and Elf64_Sym use the same one-byte st_info field  */
+#define ELF32_ST_BIND(i)      ((i) >> 4)
+#define ELF32_ST_MKBIND(i)    ((i) << 4)  /* just a helper */
+#define ELF32_ST_TYPE(i)      ((i) & 0xf)
+#define ELF32_ST_INFO(b, i)   (ELF_ST_MKBIND(b) + ELF_ST_TYPE(i))
+
+#define ELF64_ST_BIND(i)      ELF32_ST_BIND(i)
+#define ELF64_ST_MKBIND(i)    ELF32_ST_MKBIND(i)
+#define ELF64_ST_TYPE(i)      ELF32_ST_TYPE(i)
+#define ELF64_ST_INFO(b, i)   ELF32_ST_INFO(b, i)
+
+/*
+ * ELF standard typedefs (yet more proof that <stdint.h> was way overdue)
+ */
+
+typedef uint16_t    Elf32_Half;
+typedef int16_t     Elf32_SHalf;
+typedef uint32_t    Elf32_Word;
+typedef int32_t     Elf32_Sword;
+typedef uint64_t    Elf32_Xword;
+typedef int64_t     Elf32_Sxword;
+
+typedef uint32_t    Elf32_Off;
+typedef uint32_t    Elf32_Addr;
+typedef uint16_t    Elf32_Section;
+
+typedef uint16_t    Elf64_Half;
+typedef int16_t     Elf64_SHalf;
+typedef uint32_t    Elf64_Word;
+typedef int32_t     Elf64_Sword;
+typedef uint64_t    Elf64_Xword;
+typedef int64_t     Elf64_Sxword;
+
+typedef uint64_t    Elf64_Off;
+typedef uint64_t    Elf64_Addr;
+typedef uint16_t    Elf64_Section;
+
+/*
+ * Dynamic header
+ */
+
+typedef struct elf32_dyn {
+    Elf32_Sword d_tag;
+    union {
+        Elf32_Sword d_val;
+        Elf32_Addr d_ptr;
+    } d_un;
+} Elf32_Dyn;
+
+typedef struct elf64_dyn {
+    Elf64_Sxword d_tag;
+    union {
+        Elf64_Xword d_val;
+        Elf64_Addr d_ptr;
+    } d_un;
+} Elf64_Dyn;
+
+/*
+ * Relocations
+ */
+
+#define ELF32_R_SYM(x)  ((x) >> 8)
+#define ELF32_R_TYPE(x) ((x) & 0xff)
+
+typedef struct elf32_rel {
+    Elf32_Addr r_offset;
+    Elf32_Word r_info;
+} Elf32_Rel;
+
+typedef struct elf32_rela {
+    Elf32_Addr r_offset;
+    Elf32_Word r_info;
+    Elf32_Sword r_addend;
+} Elf32_Rela;
+
+enum reloc32_type {
+    R_386_32            =  1,   /* ordinary absolute relocation */
+    R_386_PC32          =  2,   /* PC-relative relocation */
+    R_386_GOT32         =  3,   /* an offset into GOT */
+    R_386_PLT32         =  4,   /* a PC-relative offset into PLT */
+    R_386_COPY          =  5,   /* ??? */
+    R_386_GLOB_DAT      =  6,   /* ??? */
+    R_386_JUMP_SLOT     =  7,   /* ??? */
+    R_386_RELATIVE      =  8,   /* ??? */
+    R_386_GOTOFF        =  9,   /* an offset from GOT base */
+    R_386_GOTPC         = 10,   /* a PC-relative offset _to_ GOT */
+    R_386_TLS_TPOFF     = 14,   /* Offset in static TLS block */
+    R_386_TLS_IE        = 15,   /* Address of GOT entry for static TLS block offset */
+    /* These are GNU extensions, but useful */
+    R_386_16            = 20,   /* A 16-bit absolute relocation */
+    R_386_PC16          = 21,   /* A 16-bit PC-relative relocation */
+    R_386_8             = 22,   /* An 8-bit absolute relocation */
+    R_386_PC8           = 23    /* An 8-bit PC-relative relocation */
+};
+
+#define ELF64_R_SYM(x)  ((x) >> 32)
+#define ELF64_R_TYPE(x) ((x) & 0xffffffff)
+
+typedef struct elf64_rel {
+    Elf64_Addr r_offset;
+    Elf64_Xword r_info;
+} Elf64_Rel;
+
+typedef struct elf64_rela {
+    Elf64_Addr r_offset;
+    Elf64_Xword r_info;
+    Elf64_Sxword r_addend;
+} Elf64_Rela;
+
+enum reloc64_type {
+    R_X86_64_NONE       =  0,   /* No reloc */
+    R_X86_64_64         =  1,   /* Direct 64 bit  */
+    R_X86_64_PC32       =  2,   /* PC relative 32 bit signed */
+    R_X86_64_GOT32      =  3,   /* 32 bit GOT entry */
+    R_X86_64_PLT32      =  4,   /* 32 bit PLT address */
+    R_X86_64_COPY       =  5,   /* Copy symbol at runtime */
+    R_X86_64_GLOB_DAT   =  6,   /* Create GOT entry */
+    R_X86_64_JUMP_SLOT  =  7,   /* Create PLT entry */
+    R_X86_64_RELATIVE   =  8,   /* Adjust by program base */
+    R_X86_64_GOTPCREL   =  9,   /* 32 bit signed PC relative offset to GOT */
+    R_X86_64_32         = 10,   /* Direct 32 bit zero extended */
+    R_X86_64_32S        = 11,   /* Direct 32 bit sign extended */
+    R_X86_64_16         = 12,   /* Direct 16 bit zero extended */
+    R_X86_64_PC16       = 13,   /* 16 bit sign extended pc relative */
+    R_X86_64_8          = 14,   /* Direct 8 bit sign extended  */
+    R_X86_64_PC8        = 15,   /* 8 bit sign extended pc relative */
+    R_X86_64_DTPMOD64   = 16,   /* ID of module containing symbol */
+    R_X86_64_DTPOFF64   = 17,   /* Offset in module's TLS block */
+    R_X86_64_TPOFF64    = 18,   /* Offset in initial TLS block */
+    R_X86_64_TLSGD      = 19,   /* 32 bit signed PC relative offset to two GOT entries for GD symbol */
+    R_X86_64_TLSLD      = 20,   /* 32 bit signed PC relative offset to two GOT entries for LD symbol */
+    R_X86_64_DTPOFF32   = 21,   /* Offset in TLS block */
+    R_X86_64_GOTTPOFF   = 22,   /* 32 bit signed PC relative offset to GOT entry for IE symbol */
+    R_X86_64_TPOFF32    = 23,   /* Offset in initial TLS block */
+    R_X86_64_PC64       = 24,   /* word64 S + A - P */
+    R_X86_64_GOTOFF64   = 25,   /* word64 S + A - GOT */
+    R_X86_64_GOTPC32    = 26,   /* word32 GOT + A - P */
+    R_X86_64_GOT64      = 27,   /* word64 G + A */
+    R_X86_64_GOTPCREL64 = 28,   /* word64 G + GOT - P + A */
+    R_X86_64_GOTPC64    = 29,   /* word64 GOT - P + A */
+    R_X86_64_GOTPLT64   = 30,   /* word64 G + A */
+    R_X86_64_PLTOFF64   = 31,   /* word64 L - GOT + A */
+    R_X86_64_SIZE32     = 32,   /* word32 Z + A */
+    R_X86_64_SIZE64     = 33,   /* word64 Z + A */
+    R_X86_64_GOTPC32_TLSDESC = 34,  /* word32 */
+    R_X86_64_TLSDESC_CALL    = 35,  /* none */
+    R_X86_64_TLSDESC    = 36    /* word64?2 */
+};
+
+/*
+ * Symbol
+ */
+
+typedef struct elf32_sym {
+    Elf32_Word st_name;
+    Elf32_Addr st_value;
+    Elf32_Word st_size;
+    unsigned char st_info;
+    unsigned char st_other;
+    Elf32_Half st_shndx;
+} Elf32_Sym;
+
+typedef struct elf64_sym {
+    Elf64_Word st_name;
+    unsigned char st_info;
+    unsigned char st_other;
+    Elf64_Half st_shndx;
+    Elf64_Addr st_value;
+    Elf64_Xword st_size;
+} Elf64_Sym;
+
+/*
+ * Main file header
+ */
+
+typedef struct elf32_hdr {
+    unsigned char e_ident[EI_NIDENT];
+    Elf32_Half e_type;
+    Elf32_Half e_machine;
+    Elf32_Word e_version;
+    Elf32_Addr e_entry;
+    Elf32_Off e_phoff;
+    Elf32_Off e_shoff;
+    Elf32_Word e_flags;
+    Elf32_Half e_ehsize;
+    Elf32_Half e_phentsize;
+    Elf32_Half e_phnum;
+    Elf32_Half e_shentsize;
+    Elf32_Half e_shnum;
+    Elf32_Half e_shstrndx;
+} Elf32_Ehdr;
+
+typedef struct elf64_hdr {
+    unsigned char e_ident[EI_NIDENT];
+    Elf64_Half e_type;
+    Elf64_Half e_machine;
+    Elf64_Word e_version;
+    Elf64_Addr e_entry;
+    Elf64_Off e_phoff;
+    Elf64_Off e_shoff;
+    Elf64_Word e_flags;
+    Elf64_Half e_ehsize;
+    Elf64_Half e_phentsize;
+    Elf64_Half e_phnum;
+    Elf64_Half e_shentsize;
+    Elf64_Half e_shnum;
+    Elf64_Half e_shstrndx;
+} Elf64_Ehdr;
+
+/*
+ * Program header
+ */
+
+typedef struct elf32_phdr {
+    Elf32_Word p_type;
+    Elf32_Off p_offset;
+    Elf32_Addr p_vaddr;
+    Elf32_Addr p_paddr;
+    Elf32_Word p_filesz;
+    Elf32_Word p_memsz;
+    Elf32_Word p_flags;
+    Elf32_Word p_align;
+} Elf32_Phdr;
+
+typedef struct elf64_phdr {
+    Elf64_Word p_type;
+    Elf64_Word p_flags;
+    Elf64_Off p_offset;
+    Elf64_Addr p_vaddr;
+    Elf64_Addr p_paddr;
+    Elf64_Xword p_filesz;
+    Elf64_Xword p_memsz;
+    Elf64_Xword p_align;
+} Elf64_Phdr;
+
+/*
+ * Section header
+ */
+
+typedef struct elf32_shdr {
+    Elf32_Word sh_name;
+    Elf32_Word sh_type;
+    Elf32_Word sh_flags;
+    Elf32_Addr sh_addr;
+    Elf32_Off sh_offset;
+    Elf32_Word sh_size;
+    Elf32_Word sh_link;
+    Elf32_Word sh_info;
+    Elf32_Word sh_addralign;
+    Elf32_Word sh_entsize;
+} Elf32_Shdr;
+
+typedef struct elf64_shdr {
+    Elf64_Word sh_name;
+    Elf64_Word sh_type;
+    Elf64_Xword sh_flags;
+    Elf64_Addr sh_addr;
+    Elf64_Off sh_offset;
+    Elf64_Xword sh_size;
+    Elf64_Word sh_link;
+    Elf64_Word sh_info;
+    Elf64_Xword sh_addralign;
+    Elf64_Xword sh_entsize;
+} Elf64_Shdr;
+
+/*
+ * Note header
+ */
+typedef struct elf32_note {
+    Elf32_Word n_namesz;    /* Name size */
+    Elf32_Word n_descsz;    /* Content size */
+    Elf32_Word n_type;      /* Content type */
+} Elf32_Nhdr;
+
+typedef struct elf64_note {
+    Elf64_Word n_namesz;    /* Name size */
+    Elf64_Word n_descsz;    /* Content size */
+    Elf64_Word n_type;      /* Content type */
+} Elf64_Nhdr;
+
+#endif /* OUTPUT_ELF_H */
diff --git a/output/nulldbg.c b/output/nulldbg.c
new file mode 100644 (file)
index 0000000..c7bace1
--- /dev/null
@@ -0,0 +1,91 @@
+/* ----------------------------------------------------------------------- *
+ *   
+ *   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.
+ *
+ * ----------------------------------------------------------------------- */
+
+#include "nasm.h"
+#include "nasmlib.h"
+
+void null_debug_init(void)
+{
+}
+
+void null_debug_linenum(const char *filename, int32_t linenumber, int32_t segto)
+{
+       (void)filename;
+       (void)linenumber;
+       (void)segto;
+}
+
+void null_debug_deflabel(char *name, int32_t segment, int64_t offset,
+                         int is_global, char *special)
+{
+       (void)name;
+       (void)segment;
+       (void)offset;
+       (void)is_global;
+       (void)special;
+}
+
+void null_debug_directive(const char *directive, const char *params)
+{
+       (void)directive;
+       (void)params;
+}
+
+void null_debug_typevalue(int32_t type)
+{
+       (void)type;
+}
+
+void null_debug_output(int type, void *param)
+{
+       (void)type;
+       (void)param;
+}
+
+void null_debug_cleanup(void)
+{
+}
+
+struct dfmt null_debug_form = {
+    "Null debug format",
+    "null",
+    null_debug_init,
+    null_debug_linenum,
+    null_debug_deflabel,
+    null_debug_directive,
+    null_debug_typevalue,
+    null_debug_output,
+    null_debug_cleanup
+};
+
+struct dfmt *null_debug_arr[2] = { &null_debug_form, NULL };
diff --git a/output/nullout.c b/output/nullout.c
new file mode 100644 (file)
index 0000000..228fa16
--- /dev/null
@@ -0,0 +1,51 @@
+/* ----------------------------------------------------------------------- *
+ *   
+ *   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.
+ *
+ * ----------------------------------------------------------------------- */
+
+#include "nasm.h"
+#include "nasmlib.h"
+#include "output/outlib.h"
+
+int null_setinfo(enum geninfo type, char **string)
+{
+    (void)type;
+    (void)string;
+    return 0;
+}
+
+int null_directive(enum directives directive, char *value, int pass)
+{
+    (void)directive;
+    (void)value;
+    (void)pass;
+    return 0;
+}
diff --git a/output/outaout.c b/output/outaout.c
new file mode 100644 (file)
index 0000000..e2a9075
--- /dev/null
@@ -0,0 +1,955 @@
+/* ----------------------------------------------------------------------- *
+ *   
+ *   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.
+ *
+ * ----------------------------------------------------------------------- */
+
+/* 
+ * outaout.c   output routines for the Netwide Assembler to produce
+ *             Linux a.out object files
+ */
+
+#include "compiler.h"
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <ctype.h>
+#include <inttypes.h>
+
+#include "nasm.h"
+#include "nasmlib.h"
+#include "saa.h"
+#include "raa.h"
+#include "stdscan.h"
+#include "eval.h"
+#include "output/outform.h"
+#include "output/outlib.h"
+
+#if defined OF_AOUT || defined OF_AOUTB
+
+#define RELTYPE_ABSOLUTE 0x00
+#define RELTYPE_RELATIVE 0x01
+#define RELTYPE_GOTPC    0x01   /* no explicit GOTPC in a.out */
+#define RELTYPE_GOTOFF   0x10
+#define RELTYPE_GOT      0x10   /* distinct from GOTOFF bcos sym not sect */
+#define RELTYPE_PLT      0x21
+#define RELTYPE_SYMFLAG  0x08
+
+struct Reloc {
+    struct Reloc *next;
+    int32_t address;               /* relative to _start_ of section */
+    int32_t symbol;                /* symbol number or -ve section id */
+    int bytes;                  /* 2 or 4 */
+    int reltype;                /* see above */
+};
+
+struct Symbol {
+    int32_t strpos;                /* string table position of name */
+    int type;                   /* symbol type - see flags below */
+    int32_t value;                 /* address, or COMMON variable size */
+    int32_t size;                  /* size for data or function exports */
+    int32_t segment;               /* back-reference used by gsym_reloc */
+    struct Symbol *next;        /* list of globals in each section */
+    struct Symbol *nextfwd;     /* list of unresolved-size symbols */
+    char *name;                 /* for unresolved-size symbols */
+    int32_t symnum;                /* index into symbol table */
+};
+
+/*
+ * Section IDs - used in Reloc.symbol when negative, and in
+ * Symbol.type when positive.
+ */
+#define SECT_ABS 2              /* absolute value */
+#define SECT_TEXT 4             /* text section */
+#define SECT_DATA 6             /* data section */
+#define SECT_BSS 8              /* bss section */
+#define SECT_MASK 0xE           /* mask out any of the above */
+
+/*
+ * More flags used in Symbol.type.
+ */
+#define SYM_GLOBAL 1            /* it's a global symbol */
+#define SYM_DATA 0x100          /* used for shared libs */
+#define SYM_FUNCTION 0x200      /* used for shared libs */
+#define SYM_WITH_SIZE 0x4000    /* not output; internal only */
+
+/*
+ * Bit more explanation of symbol types: SECT_xxx denotes a local
+ * symbol. SECT_xxx|SYM_GLOBAL denotes a global symbol, defined in
+ * this module. Just SYM_GLOBAL, with zero value, denotes an
+ * external symbol referenced in this module. And just SYM_GLOBAL,
+ * but with a non-zero value, declares a C `common' variable, of
+ * size `value'.
+ */
+
+struct Section {
+    struct SAA *data;
+    uint32_t len, size, nrelocs;
+    int32_t index;
+    struct Reloc *head, **tail;
+    struct Symbol *gsyms, *asym;
+};
+
+static struct Section stext, sdata, sbss;
+
+static struct SAA *syms;
+static uint32_t nsyms;
+
+static struct RAA *bsym;
+
+static struct SAA *strs;
+static uint32_t strslen;
+
+static struct Symbol *fwds;
+
+static int bsd;
+static int is_pic;
+
+static void aout_write(void);
+static void aout_write_relocs(struct Reloc *);
+static void aout_write_syms(void);
+static void aout_sect_write(struct Section *, const uint8_t *,
+                            uint32_t);
+static void aout_pad_sections(void);
+static void aout_fixup_relocs(struct Section *);
+
+/*
+ * Special section numbers which are used to define special
+ * symbols, which can be used with WRT to provide PIC relocation
+ * types.
+ */
+static int32_t aout_gotpc_sect, aout_gotoff_sect;
+static int32_t aout_got_sect, aout_plt_sect;
+static int32_t aout_sym_sect;
+
+static void aoutg_init(void)
+{
+    stext.data = saa_init(1L);
+    stext.head = NULL;
+    stext.tail = &stext.head;
+    sdata.data = saa_init(1L);
+    sdata.head = NULL;
+    sdata.tail = &sdata.head;
+    stext.len = stext.size = sdata.len = sdata.size = sbss.len = 0;
+    stext.nrelocs = sdata.nrelocs = 0;
+    stext.gsyms = sdata.gsyms = sbss.gsyms = NULL;
+    stext.index = seg_alloc();
+    sdata.index = seg_alloc();
+    sbss.index = seg_alloc();
+    stext.asym = sdata.asym = sbss.asym = NULL;
+    syms = saa_init((int32_t)sizeof(struct Symbol));
+    nsyms = 0;
+    bsym = raa_init();
+    strs = saa_init(1L);
+    strslen = 0;
+    fwds = NULL;
+}
+
+#ifdef OF_AOUT
+
+static void aout_init(void)
+{
+    bsd = false;
+    aoutg_init();
+
+    aout_gotpc_sect = aout_gotoff_sect = aout_got_sect =
+        aout_plt_sect = aout_sym_sect = NO_SEG;
+}
+
+#endif
+
+#ifdef OF_AOUTB
+
+extern struct ofmt of_aoutb;
+
+static void aoutb_init(void)
+{
+    bsd = true;
+    aoutg_init();
+
+    is_pic = 0x00;              /* may become 0x40 */
+
+    aout_gotpc_sect = seg_alloc();
+    define_label("..gotpc", aout_gotpc_sect + 1, 0L, NULL, false, false);
+    aout_gotoff_sect = seg_alloc();
+    define_label("..gotoff", aout_gotoff_sect + 1, 0L, NULL, false, false);
+    aout_got_sect = seg_alloc();
+    define_label("..got", aout_got_sect + 1, 0L, NULL, false, false);
+    aout_plt_sect = seg_alloc();
+    define_label("..plt", aout_plt_sect + 1, 0L, NULL, false, false);
+    aout_sym_sect = seg_alloc();
+    define_label("..sym", aout_sym_sect + 1, 0L, NULL, false, false);
+}
+
+#endif
+
+static void aout_cleanup(int debuginfo)
+{
+    struct Reloc *r;
+
+    (void)debuginfo;
+
+    aout_pad_sections();
+    aout_fixup_relocs(&stext);
+    aout_fixup_relocs(&sdata);
+    aout_write();
+    saa_free(stext.data);
+    while (stext.head) {
+        r = stext.head;
+        stext.head = stext.head->next;
+        nasm_free(r);
+    }
+    saa_free(sdata.data);
+    while (sdata.head) {
+        r = sdata.head;
+        sdata.head = sdata.head->next;
+        nasm_free(r);
+    }
+    saa_free(syms);
+    raa_free(bsym);
+    saa_free(strs);
+}
+
+static int32_t aout_section_names(char *name, int pass, int *bits)
+{
+
+    (void)pass;
+
+    /*
+     * Default to 32 bits.
+     */
+    if (!name)
+        *bits = 32;
+
+    if (!name)
+        return stext.index;
+
+    if (!strcmp(name, ".text"))
+        return stext.index;
+    else if (!strcmp(name, ".data"))
+        return sdata.index;
+    else if (!strcmp(name, ".bss"))
+        return sbss.index;
+    else
+        return NO_SEG;
+}
+
+static void aout_deflabel(char *name, int32_t segment, int64_t offset,
+                          int is_global, char *special)
+{
+    int pos = strslen + 4;
+    struct Symbol *sym;
+    int special_used = false;
+
+    if (name[0] == '.' && name[1] == '.' && name[2] != '@') {
+        /*
+         * This is a NASM special symbol. We never allow it into
+         * the a.out symbol table, even if it's a valid one. If it
+         * _isn't_ a valid one, we should barf immediately.
+         */
+        if (strcmp(name, "..gotpc") && strcmp(name, "..gotoff") &&
+            strcmp(name, "..got") && strcmp(name, "..plt") &&
+            strcmp(name, "..sym"))
+            nasm_error(ERR_NONFATAL, "unrecognised special symbol `%s'", name);
+        return;
+    }
+
+    if (is_global == 3) {
+        struct Symbol **s;
+        /*
+         * Fix up a forward-reference symbol size from the first
+         * pass.
+         */
+        for (s = &fwds; *s; s = &(*s)->nextfwd)
+            if (!strcmp((*s)->name, name)) {
+                struct tokenval tokval;
+                expr *e;
+                char *p = special;
+
+                while (*p && !nasm_isspace(*p))
+                    p++;
+                while (*p && nasm_isspace(*p))
+                    p++;
+                stdscan_reset();
+                stdscan_set(p);
+                tokval.t_type = TOKEN_INVALID;
+                e = evaluate(stdscan, NULL, &tokval, NULL, 1, nasm_error, NULL);
+                if (e) {
+                    if (!is_simple(e))
+                        nasm_error(ERR_NONFATAL, "cannot use relocatable"
+                              " expression as symbol size");
+                    else
+                        (*s)->size = reloc_value(e);
+                }
+
+                /*
+                 * Remove it from the list of unresolved sizes.
+                 */
+                nasm_free((*s)->name);
+                *s = (*s)->nextfwd;
+                return;
+            }
+        return;                 /* it wasn't an important one */
+    }
+
+    saa_wbytes(strs, name, (int32_t)(1 + strlen(name)));
+    strslen += 1 + strlen(name);
+
+    sym = saa_wstruct(syms);
+
+    sym->strpos = pos;
+    sym->type = is_global ? SYM_GLOBAL : 0;
+    sym->segment = segment;
+    if (segment == NO_SEG)
+        sym->type |= SECT_ABS;
+    else if (segment == stext.index) {
+        sym->type |= SECT_TEXT;
+        if (is_global) {
+            sym->next = stext.gsyms;
+            stext.gsyms = sym;
+        } else if (!stext.asym)
+            stext.asym = sym;
+    } else if (segment == sdata.index) {
+        sym->type |= SECT_DATA;
+        if (is_global) {
+            sym->next = sdata.gsyms;
+            sdata.gsyms = sym;
+        } else if (!sdata.asym)
+            sdata.asym = sym;
+    } else if (segment == sbss.index) {
+        sym->type |= SECT_BSS;
+        if (is_global) {
+            sym->next = sbss.gsyms;
+            sbss.gsyms = sym;
+        } else if (!sbss.asym)
+            sbss.asym = sym;
+    } else
+        sym->type = SYM_GLOBAL;
+    if (is_global == 2)
+        sym->value = offset;
+    else
+        sym->value = (sym->type == SYM_GLOBAL ? 0 : offset);
+
+    if (is_global && sym->type != SYM_GLOBAL) {
+        /*
+         * Global symbol exported _from_ this module. We must check
+         * the special text for type information.
+         */
+
+        if (special) {
+            int n = strcspn(special, " ");
+
+            if (!nasm_strnicmp(special, "function", n))
+                sym->type |= SYM_FUNCTION;
+            else if (!nasm_strnicmp(special, "data", n) ||
+                     !nasm_strnicmp(special, "object", n))
+                sym->type |= SYM_DATA;
+            else
+                nasm_error(ERR_NONFATAL, "unrecognised symbol type `%.*s'",
+                      n, special);
+            if (special[n]) {
+                struct tokenval tokval;
+                expr *e;
+                int fwd = false;
+                char *saveme = stdscan_get();
+
+                if (!bsd) {
+                    nasm_error(ERR_NONFATAL, "Linux a.out does not support"
+                          " symbol size information");
+                } else {
+                    while (special[n] && nasm_isspace(special[n]))
+                        n++;
+                    /*
+                     * We have a size expression; attempt to
+                     * evaluate it.
+                     */
+                    sym->type |= SYM_WITH_SIZE;
+                    stdscan_reset();
+                    stdscan_set(special + n);
+                    tokval.t_type = TOKEN_INVALID;
+                    e = evaluate(stdscan, NULL, &tokval, &fwd, 0, nasm_error,
+                                 NULL);
+                    if (fwd) {
+                        sym->nextfwd = fwds;
+                        fwds = sym;
+                        sym->name = nasm_strdup(name);
+                    } else if (e) {
+                        if (!is_simple(e))
+                            nasm_error(ERR_NONFATAL, "cannot use relocatable"
+                                  " expression as symbol size");
+                        else
+                            sym->size = reloc_value(e);
+                    }
+                }
+                stdscan_set(saveme);
+            }
+            special_used = true;
+        }
+    }
+
+    /*
+     * define the references from external-symbol segment numbers
+     * to these symbol records.
+     */
+    if (segment != NO_SEG && segment != stext.index &&
+        segment != sdata.index && segment != sbss.index)
+        bsym = raa_write(bsym, segment, nsyms);
+    sym->symnum = nsyms;
+
+    nsyms++;
+    if (sym->type & SYM_WITH_SIZE)
+        nsyms++;                /* and another for the size */
+
+    if (special && !special_used)
+        nasm_error(ERR_NONFATAL, "no special symbol features supported here");
+}
+
+static void aout_add_reloc(struct Section *sect, int32_t segment,
+                           int reltype, int bytes)
+{
+    struct Reloc *r;
+
+    r = *sect->tail = nasm_malloc(sizeof(struct Reloc));
+    sect->tail = &r->next;
+    r->next = NULL;
+
+    r->address = sect->len;
+    r->symbol = (segment == NO_SEG ? -SECT_ABS :
+                 segment == stext.index ? -SECT_TEXT :
+                 segment == sdata.index ? -SECT_DATA :
+                 segment == sbss.index ? -SECT_BSS :
+                 raa_read(bsym, segment));
+    r->reltype = reltype;
+    if (r->symbol >= 0)
+        r->reltype |= RELTYPE_SYMFLAG;
+    r->bytes = bytes;
+
+    sect->nrelocs++;
+}
+
+/*
+ * This routine deals with ..got and ..sym relocations: the more
+ * complicated kinds. In shared-library writing, some relocations
+ * with respect to global symbols must refer to the precise symbol
+ * rather than referring to an offset from the base of the section
+ * _containing_ the symbol. Such relocations call to this routine,
+ * which searches the symbol list for the symbol in question.
+ *
+ * RELTYPE_GOT references require the _exact_ symbol address to be
+ * used; RELTYPE_ABSOLUTE references can be at an offset from the
+ * symbol. The boolean argument `exact' tells us this.
+ *
+ * Return value is the adjusted value of `addr', having become an
+ * offset from the symbol rather than the section. Should always be
+ * zero when returning from an exact call.
+ *
+ * Limitation: if you define two symbols at the same place,
+ * confusion will occur.
+ *
+ * Inefficiency: we search, currently, using a linked list which
+ * isn't even necessarily sorted.
+ */
+static int32_t aout_add_gsym_reloc(struct Section *sect,
+                                int32_t segment, int32_t offset,
+                                int type, int bytes, int exact)
+{
+    struct Symbol *sym, *sm, *shead;
+    struct Reloc *r;
+
+    /*
+     * First look up the segment to find whether it's text, data,
+     * bss or an external symbol.
+     */
+    shead = NULL;
+    if (segment == stext.index)
+        shead = stext.gsyms;
+    else if (segment == sdata.index)
+        shead = sdata.gsyms;
+    else if (segment == sbss.index)
+        shead = sbss.gsyms;
+    if (!shead) {
+        if (exact && offset != 0)
+            nasm_error(ERR_NONFATAL, "unable to find a suitable global symbol"
+                  " for this reference");
+        else
+            aout_add_reloc(sect, segment, type, bytes);
+        return offset;
+    }
+
+    if (exact) {
+        /*
+         * Find a symbol pointing _exactly_ at this one.
+         */
+        list_for_each(sym, shead)
+            if (sym->value == offset)
+                break;
+    } else {
+        /*
+         * Find the nearest symbol below this one.
+         */
+        sym = NULL;
+        list_for_each(sm, shead)
+            if (sm->value <= offset && (!sym || sm->value > sym->value))
+                sym = sm;
+    }
+    if (!sym && exact) {
+        nasm_error(ERR_NONFATAL, "unable to find a suitable global symbol"
+              " for this reference");
+        return 0;
+    }
+
+    r = *sect->tail = nasm_malloc(sizeof(struct Reloc));
+    sect->tail = &r->next;
+    r->next = NULL;
+
+    r->address = sect->len;
+    r->symbol = sym->symnum;
+    r->reltype = type | RELTYPE_SYMFLAG;
+    r->bytes = bytes;
+
+    sect->nrelocs++;
+
+    return offset - sym->value;
+}
+
+/*
+ * This routine deals with ..gotoff relocations. These _must_ refer
+ * to a symbol, due to a perversity of *BSD's PIC implementation,
+ * and it must be a non-global one as well; so we store `asym', the
+ * first nonglobal symbol defined in each section, and always work
+ * from that. Relocation type is always RELTYPE_GOTOFF.
+ *
+ * Return value is the adjusted value of `addr', having become an
+ * offset from the `asym' symbol rather than the section.
+ */
+static int32_t aout_add_gotoff_reloc(struct Section *sect, int32_t segment,
+                                  int32_t offset, int bytes)
+{
+    struct Reloc *r;
+    struct Symbol *asym;
+
+    /*
+     * First look up the segment to find whether it's text, data,
+     * bss or an external symbol.
+     */
+    asym = NULL;
+    if (segment == stext.index)
+        asym = stext.asym;
+    else if (segment == sdata.index)
+        asym = sdata.asym;
+    else if (segment == sbss.index)
+        asym = sbss.asym;
+    if (!asym)
+        nasm_error(ERR_NONFATAL, "`..gotoff' relocations require a non-global"
+              " symbol in the section");
+
+    r = *sect->tail = nasm_malloc(sizeof(struct Reloc));
+    sect->tail = &r->next;
+    r->next = NULL;
+
+    r->address = sect->len;
+    r->symbol = asym->symnum;
+    r->reltype = RELTYPE_GOTOFF;
+    r->bytes = bytes;
+
+    sect->nrelocs++;
+
+    return offset - asym->value;
+}
+
+static void aout_out(int32_t segto, const void *data,
+                    enum out_type type, uint64_t size,
+                     int32_t segment, int32_t wrt)
+{
+    struct Section *s;
+    int32_t addr;
+    uint8_t mydata[4], *p;
+
+    /*
+     * handle absolute-assembly (structure definitions)
+     */
+    if (segto == NO_SEG) {
+        if (type != OUT_RESERVE)
+            nasm_error(ERR_NONFATAL, "attempt to assemble code in [ABSOLUTE]"
+                  " space");
+        return;
+    }
+
+    if (segto == stext.index)
+        s = &stext;
+    else if (segto == sdata.index)
+        s = &sdata;
+    else if (segto == sbss.index)
+        s = NULL;
+    else {
+        nasm_error(ERR_WARNING, "attempt to assemble code in"
+              " segment %d: defaulting to `.text'", segto);
+        s = &stext;
+    }
+
+    if (!s && type != OUT_RESERVE) {
+        nasm_error(ERR_WARNING, "attempt to initialize memory in the"
+              " BSS section: ignored");
+        sbss.len += realsize(type, size);
+        return;
+    }
+
+    if (type == OUT_RESERVE) {
+        if (s) {
+            nasm_error(ERR_WARNING, "uninitialized space declared in"
+                  " %s section: zeroing",
+                  (segto == stext.index ? "code" : "data"));
+            aout_sect_write(s, NULL, size);
+        } else
+            sbss.len += size;
+    } else if (type == OUT_RAWDATA) {
+        if (segment != NO_SEG)
+            nasm_error(ERR_PANIC, "OUT_RAWDATA with other than NO_SEG");
+        aout_sect_write(s, data, size);
+    } else if (type == OUT_ADDRESS) {
+        addr = *(int64_t *)data;
+        if (segment != NO_SEG) {
+            if (segment % 2) {
+                nasm_error(ERR_NONFATAL, "a.out format does not support"
+                      " segment base references");
+            } else {
+                if (wrt == NO_SEG) {
+                    aout_add_reloc(s, segment, RELTYPE_ABSOLUTE,
+                                   size);
+                } else if (!bsd) {
+                    nasm_error(ERR_NONFATAL,
+                          "Linux a.out format does not support"
+                          " any use of WRT");
+                    wrt = NO_SEG;       /* we can at least _try_ to continue */
+                } else if (wrt == aout_gotpc_sect + 1) {
+                    is_pic = 0x40;
+                    aout_add_reloc(s, segment, RELTYPE_GOTPC, size);
+                } else if (wrt == aout_gotoff_sect + 1) {
+                    is_pic = 0x40;
+                    addr = aout_add_gotoff_reloc(s, segment,
+                                                 addr, size);
+                } else if (wrt == aout_got_sect + 1) {
+                    is_pic = 0x40;
+                    addr =
+                        aout_add_gsym_reloc(s, segment, addr, RELTYPE_GOT,
+                                            size, true);
+                } else if (wrt == aout_sym_sect + 1) {
+                    addr = aout_add_gsym_reloc(s, segment, addr,
+                                               RELTYPE_ABSOLUTE, size,
+                                               false);
+                } else if (wrt == aout_plt_sect + 1) {
+                    is_pic = 0x40;
+                    nasm_error(ERR_NONFATAL,
+                          "a.out format cannot produce non-PC-"
+                          "relative PLT references");
+                } else {
+                    nasm_error(ERR_NONFATAL,
+                          "a.out format does not support this"
+                          " use of WRT");
+                    wrt = NO_SEG;       /* we can at least _try_ to continue */
+                }
+            }
+        }
+        p = mydata;
+        if (size == 2)
+            WRITESHORT(p, addr);
+        else
+            WRITELONG(p, addr);
+        aout_sect_write(s, mydata, size);
+    } else if (type == OUT_REL2ADR) {
+        if (segment == segto)
+            nasm_error(ERR_PANIC, "intra-segment OUT_REL2ADR");
+        if (segment != NO_SEG && segment % 2) {
+            nasm_error(ERR_NONFATAL, "a.out format does not support"
+                  " segment base references");
+        } else {
+            if (wrt == NO_SEG) {
+                aout_add_reloc(s, segment, RELTYPE_RELATIVE, 2);
+            } else if (!bsd) {
+                nasm_error(ERR_NONFATAL, "Linux a.out format does not support"
+                      " any use of WRT");
+                wrt = NO_SEG;   /* we can at least _try_ to continue */
+            } else if (wrt == aout_plt_sect + 1) {
+                is_pic = 0x40;
+                aout_add_reloc(s, segment, RELTYPE_PLT, 2);
+            } else if (wrt == aout_gotpc_sect + 1 ||
+                       wrt == aout_gotoff_sect + 1 ||
+                       wrt == aout_got_sect + 1) {
+                nasm_error(ERR_NONFATAL, "a.out format cannot produce PC-"
+                      "relative GOT references");
+            } else {
+                nasm_error(ERR_NONFATAL, "a.out format does not support this"
+                      " use of WRT");
+                wrt = NO_SEG;   /* we can at least _try_ to continue */
+            }
+        }
+        p = mydata;
+        WRITESHORT(p, *(int64_t *)data - (size + s->len));
+        aout_sect_write(s, mydata, 2L);
+    } else if (type == OUT_REL4ADR) {
+        if (segment == segto)
+            nasm_error(ERR_PANIC, "intra-segment OUT_REL4ADR");
+        if (segment != NO_SEG && segment % 2) {
+            nasm_error(ERR_NONFATAL, "a.out format does not support"
+                  " segment base references");
+        } else {
+            if (wrt == NO_SEG) {
+                aout_add_reloc(s, segment, RELTYPE_RELATIVE, 4);
+            } else if (!bsd) {
+                nasm_error(ERR_NONFATAL, "Linux a.out format does not support"
+                      " any use of WRT");
+                wrt = NO_SEG;   /* we can at least _try_ to continue */
+            } else if (wrt == aout_plt_sect + 1) {
+                is_pic = 0x40;
+                aout_add_reloc(s, segment, RELTYPE_PLT, 4);
+            } else if (wrt == aout_gotpc_sect + 1 ||
+                       wrt == aout_gotoff_sect + 1 ||
+                       wrt == aout_got_sect + 1) {
+                nasm_error(ERR_NONFATAL, "a.out format cannot produce PC-"
+                      "relative GOT references");
+            } else {
+                nasm_error(ERR_NONFATAL, "a.out format does not support this"
+                      " use of WRT");
+                wrt = NO_SEG;   /* we can at least _try_ to continue */
+            }
+        }
+        p = mydata;
+        WRITELONG(p, *(int64_t *)data - (size + s->len));
+        aout_sect_write(s, mydata, 4L);
+    }
+}
+
+static void aout_pad_sections(void)
+{
+    static uint8_t pad[] = { 0x90, 0x90, 0x90, 0x90 };
+    /*
+     * Pad each of the text and data sections with NOPs until their
+     * length is a multiple of four. (NOP == 0x90.) Also increase
+     * the length of the BSS section similarly.
+     */
+    aout_sect_write(&stext, pad, (-(int32_t)stext.len) & 3);
+    aout_sect_write(&sdata, pad, (-(int32_t)sdata.len) & 3);
+    sbss.len = (sbss.len + 3) & ~3;
+}
+
+/*
+ * a.out files have the curious property that all references to
+ * things in the data or bss sections are done by addresses which
+ * are actually relative to the start of the _text_ section, in the
+ * _file_. (No relation to what happens after linking. No idea why
+ * this should be so. It's very strange.) So we have to go through
+ * the relocation table, _after_ the final size of each section is
+ * known, and fix up the relocations pointed to.
+ */
+static void aout_fixup_relocs(struct Section *sect)
+{
+    struct Reloc *r;
+
+    saa_rewind(sect->data);
+    list_for_each(r, sect->head) {
+        uint8_t *p, *q, blk[4];
+        int32_t l;
+
+        saa_fread(sect->data, r->address, blk, (int32_t)r->bytes);
+        p = q = blk;
+        l = *p++;
+        if (r->bytes > 1) {
+            l += ((int32_t)*p++) << 8;
+            if (r->bytes == 4) {
+                l += ((int32_t)*p++) << 16;
+                l += ((int32_t)*p++) << 24;
+            }
+        }
+        if (r->symbol == -SECT_DATA)
+            l += stext.len;
+        else if (r->symbol == -SECT_BSS)
+            l += stext.len + sdata.len;
+        if (r->bytes == 4)
+            WRITELONG(q, l);
+        else if (r->bytes == 2)
+            WRITESHORT(q, l);
+        else
+            *q++ = l & 0xFF;
+        saa_fwrite(sect->data, r->address, blk, (int32_t)r->bytes);
+    }
+}
+
+static void aout_write(void)
+{
+    /*
+     * Emit the a.out header.
+     */
+    /* OMAGIC, M_386 or MID_I386, no flags */
+    fwriteint32_t(bsd ? 0x07018600 | is_pic : 0x640107L, ofile);
+    fwriteint32_t(stext.len, ofile);
+    fwriteint32_t(sdata.len, ofile);
+    fwriteint32_t(sbss.len, ofile);
+    fwriteint32_t(nsyms * 12, ofile);     /* length of symbol table */
+    fwriteint32_t(0L, ofile);     /* object files have no entry point */
+    fwriteint32_t(stext.nrelocs * 8, ofile);      /* size of text relocs */
+    fwriteint32_t(sdata.nrelocs * 8, ofile);      /* size of data relocs */
+
+    /*
+     * Write out the code section and the data section.
+     */
+    saa_fpwrite(stext.data, ofile);
+    saa_fpwrite(sdata.data, ofile);
+
+    /*
+     * Write out the relocations.
+     */
+    aout_write_relocs(stext.head);
+    aout_write_relocs(sdata.head);
+
+    /*
+     * Write the symbol table.
+     */
+    aout_write_syms();
+
+    /*
+     * And the string table.
+     */
+    fwriteint32_t(strslen + 4, ofile);    /* length includes length count */
+    saa_fpwrite(strs, ofile);
+}
+
+static void aout_write_relocs(struct Reloc *r)
+{
+    list_for_each(r, r) {
+        uint32_t word2;
+
+        fwriteint32_t(r->address, ofile);
+
+        if (r->symbol >= 0)
+            word2 = r->symbol;
+        else
+            word2 = -r->symbol;
+        word2 |= r->reltype << 24;
+        word2 |= (r->bytes == 1 ? 0 :
+                  r->bytes == 2 ? 0x2000000L : 0x4000000L);
+        fwriteint32_t(word2, ofile);
+    }
+}
+
+static void aout_write_syms(void)
+{
+    uint32_t i;
+
+    saa_rewind(syms);
+    for (i = 0; i < nsyms; i++) {
+        struct Symbol *sym = saa_rstruct(syms);
+        fwriteint32_t(sym->strpos, ofile);
+        fwriteint32_t((int32_t)sym->type & ~SYM_WITH_SIZE, ofile);
+        /*
+         * Fix up the symbol value now we know the final section
+         * sizes.
+         */
+        if ((sym->type & SECT_MASK) == SECT_DATA)
+            sym->value += stext.len;
+        if ((sym->type & SECT_MASK) == SECT_BSS)
+            sym->value += stext.len + sdata.len;
+        fwriteint32_t(sym->value, ofile);
+        /*
+         * Output a size record if necessary.
+         */
+        if (sym->type & SYM_WITH_SIZE) {
+            fwriteint32_t(sym->strpos, ofile);
+            fwriteint32_t(0x0DL, ofile);  /* special value: means size */
+            fwriteint32_t(sym->size, ofile);
+            i++;                /* use up another of `nsyms' */
+        }
+    }
+}
+
+static void aout_sect_write(struct Section *sect,
+                            const uint8_t *data, uint32_t len)
+{
+    saa_wbytes(sect->data, data, len);
+    sect->len += len;
+}
+
+static int32_t aout_segbase(int32_t segment)
+{
+    return segment;
+}
+
+static void aout_filename(char *inname, char *outname)
+{
+    standard_extension(inname, outname, ".o");
+}
+
+extern macros_t aout_stdmac[];
+
+#endif                          /* OF_AOUT || OF_AOUTB */
+
+#ifdef OF_AOUT
+
+struct ofmt of_aout = {
+    "Linux a.out object files",
+    "aout",
+    0,
+    null_debug_arr,
+    &null_debug_form,
+    aout_stdmac,
+    aout_init,
+    null_setinfo,
+    aout_out,
+    aout_deflabel,
+    aout_section_names,
+    aout_segbase,
+    null_directive,
+    aout_filename,
+    aout_cleanup
+};
+
+#endif
+
+#ifdef OF_AOUTB
+
+struct ofmt of_aoutb = {
+    "NetBSD/FreeBSD a.out object files",
+    "aoutb",
+    0,
+    null_debug_arr,
+    &null_debug_form,
+    aout_stdmac,
+    aoutb_init,
+    null_setinfo,
+    aout_out,
+    aout_deflabel,
+    aout_section_names,
+    aout_segbase,
+    null_directive,
+    aout_filename,
+    aout_cleanup
+};
+
+#endif
diff --git a/output/outaout.mac b/output/outaout.mac
new file mode 100644 (file)
index 0000000..cd23852
--- /dev/null
@@ -0,0 +1,37 @@
+;; --------------------------------------------------------------------------
+;;   
+;;   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.
+;;
+;; --------------------------------------------------------------------------
+
+OUT: aout aoutb
+%define __SECT__ [section .text]
+%macro __NASM_CDecl__ 1
+%endmacro
diff --git a/output/outas86.c b/output/outas86.c
new file mode 100644 (file)
index 0000000..877eebd
--- /dev/null
@@ -0,0 +1,647 @@
+/* ----------------------------------------------------------------------- *
+ *   
+ *   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.
+ *
+ * ----------------------------------------------------------------------- */
+
+/* 
+ * outas86.c   output routines for the Netwide Assembler to produce
+ *             Linux as86 (bin86-0.3) object files
+ */
+
+#include "compiler.h"
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <ctype.h>
+#include <inttypes.h>
+
+#include "nasm.h"
+#include "nasmlib.h"
+#include "saa.h"
+#include "raa.h"
+#include "output/outform.h"
+#include "output/outlib.h"
+
+#ifdef OF_AS86
+
+struct Piece {
+    struct Piece *next;
+    int type;                   /* 0 = absolute, 1 = seg, 2 = sym */
+    int32_t offset;            /* relative offset */
+    int number;                        /* symbol/segment number (4=bss) */
+    int32_t bytes;             /* size of reloc or of absolute data */
+    bool relative;             /* relative address? */
+};
+
+struct Symbol {
+    int32_t strpos;            /* string table position of name */
+    int flags;                  /* symbol flags */
+    int segment;                /* 4=bss at this point */
+    int32_t value;             /* address, or COMMON variable size */
+};
+
+/*
+ * Section IDs - used in Piece.number and Symbol.segment.
+ */
+#define SECT_TEXT 0             /* text section */
+#define SECT_DATA 3             /* data section */
+#define SECT_BSS 4              /* bss section */
+
+/*
+ * Flags used in Symbol.flags.
+ */
+#define SYM_ENTRY (1<<8)
+#define SYM_EXPORT (1<<7)
+#define SYM_IMPORT (1<<6)
+#define SYM_ABSOLUTE (1<<4)
+
+struct Section {
+    struct SAA *data;
+    uint32_t datalen, size, len;
+    int32_t index;
+    struct Piece *head, *last, **tail;
+};
+
+static char as86_module[FILENAME_MAX];
+
+static struct Section stext, sdata;
+static uint32_t bsslen;
+static int32_t bssindex;
+
+static struct SAA *syms;
+static uint32_t nsyms;
+
+static struct RAA *bsym;
+
+static struct SAA *strs;
+static uint32_t strslen;
+
+static int as86_reloc_size;
+
+static void as86_write(void);
+static void as86_write_section(struct Section *, int);
+static int as86_add_string(char *name);
+static void as86_sect_write(struct Section *, const uint8_t *,
+                            uint32_t);
+
+static void as86_init(void)
+{
+    stext.data = saa_init(1L);
+    stext.datalen = 0L;
+    stext.head = stext.last = NULL;
+    stext.tail = &stext.head;
+    sdata.data = saa_init(1L);
+    sdata.datalen = 0L;
+    sdata.head = sdata.last = NULL;
+    sdata.tail = &sdata.head;
+    bsslen =
+        stext.len = stext.datalen = stext.size =
+        sdata.len = sdata.datalen = sdata.size = 0;
+    stext.index = seg_alloc();
+    sdata.index = seg_alloc();
+    bssindex = seg_alloc();
+    syms = saa_init((int32_t)sizeof(struct Symbol));
+    nsyms = 0;
+    bsym = raa_init();
+    strs = saa_init(1L);
+    strslen = 0;
+
+    as86_add_string(as86_module);
+}
+
+static void as86_cleanup(int debuginfo)
+{
+    struct Piece *p;
+
+    (void)debuginfo;
+
+    as86_write();
+    saa_free(stext.data);
+    while (stext.head) {
+        p = stext.head;
+        stext.head = stext.head->next;
+        nasm_free(p);
+    }
+    saa_free(sdata.data);
+    while (sdata.head) {
+        p = sdata.head;
+        sdata.head = sdata.head->next;
+        nasm_free(p);
+    }
+    saa_free(syms);
+    raa_free(bsym);
+    saa_free(strs);
+}
+
+static int32_t as86_section_names(char *name, int pass, int *bits)
+{
+
+    (void)pass;
+
+    /*
+     * Default is 16 bits.
+     */
+    if (!name)
+        *bits = 16;
+
+    if (!name)
+        return stext.index;
+
+    if (!strcmp(name, ".text"))
+        return stext.index;
+    else if (!strcmp(name, ".data"))
+        return sdata.index;
+    else if (!strcmp(name, ".bss"))
+        return bssindex;
+    else
+        return NO_SEG;
+}
+
+static int as86_add_string(char *name)
+{
+    int pos = strslen;
+    int length = strlen(name);
+
+    saa_wbytes(strs, name, (int32_t)(length + 1));
+    strslen += 1 + length;
+
+    return pos;
+}
+
+static void as86_deflabel(char *name, int32_t segment, int64_t offset,
+                          int is_global, char *special)
+{
+    bool is_start = false;
+    struct Symbol *sym;
+
+    if (special)
+        nasm_error(ERR_NONFATAL, "as86 format does not support any"
+              " special symbol types");
+
+
+    if (name[0] == '.' && name[1] == '.' && name[2] != '@') {
+       if (strcmp(name, "..start")) {
+           nasm_error(ERR_NONFATAL, "unrecognised special symbol `%s'", name);
+           return;
+       } else {
+           is_start = true;
+       }
+    }
+
+    sym = saa_wstruct(syms);
+
+    sym->strpos = as86_add_string(name);
+    sym->flags = 0;
+
+    if (is_start)
+      sym->flags = SYM_ENTRY;
+
+    if (segment == NO_SEG)
+        sym->flags |= SYM_ABSOLUTE, sym->segment = 0;
+    else if (segment == stext.index)
+        sym->segment = SECT_TEXT;
+    else if (segment == sdata.index)
+        sym->segment = SECT_DATA;
+    else if (segment == bssindex)
+        sym->segment = SECT_BSS;
+    else {
+        sym->flags |= SYM_IMPORT;
+        sym->segment = 15;
+    }
+
+    if (is_global == 2)
+        sym->segment = 3;       /* already have IMPORT */
+
+    if (is_global && !(sym->flags & SYM_IMPORT))
+        sym->flags |= SYM_EXPORT;
+
+    sym->value = offset;
+
+    /*
+     * define the references from external-symbol segment numbers
+     * to these symbol records.
+     */
+    if (segment != NO_SEG && segment != stext.index &&
+        segment != sdata.index && segment != bssindex)
+        bsym = raa_write(bsym, segment, nsyms);
+
+    nsyms++;
+}
+
+static void as86_add_piece(struct Section *sect, int type, int32_t offset,
+                           int32_t segment, int32_t bytes, int relative)
+{
+    struct Piece *p;
+
+    sect->len += bytes;
+
+    if (type == 0 && sect->last && sect->last->type == 0) {
+        sect->last->bytes += bytes;
+        return;
+    }
+
+    p = sect->last = *sect->tail = nasm_malloc(sizeof(struct Piece));
+    sect->tail = &p->next;
+    p->next = NULL;
+
+    p->type = type;
+    p->offset = offset;
+    p->bytes = bytes;
+    p->relative = relative;
+
+    if (type == 1 && segment == stext.index)
+        p->number = SECT_TEXT;
+    else if (type == 1 && segment == sdata.index)
+        p->number = SECT_DATA;
+    else if (type == 1 && segment == bssindex)
+        p->number = SECT_BSS;
+    else if (type == 1)
+        p->number = raa_read(bsym, segment), p->type = 2;
+}
+
+static void as86_out(int32_t segto, const void *data,
+                    enum out_type type, uint64_t size,
+                     int32_t segment, int32_t wrt)
+{
+    struct Section *s;
+    int32_t offset;
+    uint8_t mydata[4], *p;
+
+    if (wrt != NO_SEG) {
+        wrt = NO_SEG;           /* continue to do _something_ */
+        nasm_error(ERR_NONFATAL, "WRT not supported by as86 output format");
+    }
+
+    /*
+     * handle absolute-assembly (structure definitions)
+     */
+    if (segto == NO_SEG) {
+        if (type != OUT_RESERVE)
+            nasm_error(ERR_NONFATAL, "attempt to assemble code in [ABSOLUTE]"
+                  " space");
+        return;
+    }
+
+    if (segto == stext.index)
+        s = &stext;
+    else if (segto == sdata.index)
+        s = &sdata;
+    else if (segto == bssindex)
+        s = NULL;
+    else {
+        nasm_error(ERR_WARNING, "attempt to assemble code in"
+              " segment %d: defaulting to `.text'", segto);
+        s = &stext;
+    }
+
+    if (!s && type != OUT_RESERVE) {
+        nasm_error(ERR_WARNING, "attempt to initialize memory in the"
+              " BSS section: ignored");
+       bsslen += realsize(type, size);
+        return;
+    }
+
+    if (type == OUT_RESERVE) {
+        if (s) {
+            nasm_error(ERR_WARNING, "uninitialized space declared in"
+                  " %s section: zeroing",
+                  (segto == stext.index ? "code" : "data"));
+            as86_sect_write(s, NULL, size);
+            as86_add_piece(s, 0, 0L, 0L, size, 0);
+        } else
+            bsslen += size;
+    } else if (type == OUT_RAWDATA) {
+        if (segment != NO_SEG)
+            nasm_error(ERR_PANIC, "OUT_RAWDATA with other than NO_SEG");
+        as86_sect_write(s, data, size);
+        as86_add_piece(s, 0, 0L, 0L, size, 0);
+    } else if (type == OUT_ADDRESS) {
+        if (segment != NO_SEG) {
+            if (segment % 2) {
+                nasm_error(ERR_NONFATAL, "as86 format does not support"
+                      " segment base references");
+            } else {
+                offset = *(int64_t *)data;
+                as86_add_piece(s, 1, offset, segment, size, 0);
+            }
+        } else {
+            p = mydata;
+            WRITELONG(p, *(int64_t *)data);
+            as86_sect_write(s, data, size);
+            as86_add_piece(s, 0, 0L, 0L, size, 0);
+        }
+    } else if (type == OUT_REL2ADR) {
+        if (segment == segto)
+            nasm_error(ERR_PANIC, "intra-segment OUT_REL2ADR");
+        if (segment != NO_SEG) {
+            if (segment % 2) {
+                nasm_error(ERR_NONFATAL, "as86 format does not support"
+                      " segment base references");
+            } else {
+                offset = *(int64_t *)data;
+                as86_add_piece(s, 1, offset - size + 2, segment, 2L,
+                               1);
+            }
+        }
+    } else if (type == OUT_REL4ADR) {
+        if (segment == segto)
+            nasm_error(ERR_PANIC, "intra-segment OUT_REL4ADR");
+        if (segment != NO_SEG) {
+            if (segment % 2) {
+                nasm_error(ERR_NONFATAL, "as86 format does not support"
+                      " segment base references");
+            } else {
+                offset = *(int64_t *)data;
+                as86_add_piece(s, 1, offset - size + 4, segment, 4L,
+                               1);
+            }
+        }
+    }
+}
+
+static void as86_write(void)
+{
+    uint32_t i;
+    int32_t symlen, seglen, segsize;
+
+    /*
+     * First, go through the symbol records working out how big
+     * each will be. Also fix up BSS references at this time, and
+     * set the flags words up completely.
+     */
+    symlen = 0;
+    saa_rewind(syms);
+    for (i = 0; i < nsyms; i++) {
+        struct Symbol *sym = saa_rstruct(syms);
+        if (sym->segment == SECT_BSS)
+            sym->segment = SECT_DATA, sym->value += sdata.len;
+        sym->flags |= sym->segment;
+        if (sym->value == 0)
+            sym->flags |= 0 << 14, symlen += 4;
+        else if (sym->value >= 0 && sym->value <= 255)
+            sym->flags |= 1 << 14, symlen += 5;
+        else if (sym->value >= 0 && sym->value <= 65535L)
+            sym->flags |= 2 << 14, symlen += 6;
+        else
+            sym->flags |= 3 << 14, symlen += 8;
+    }
+
+    /*
+     * Now do the same for the segments, and get the segment size
+     * descriptor word at the same time.
+     */
+    seglen = segsize = 0;
+    if ((uint32_t)stext.len > 65535L)
+        segsize |= 0x03000000L, seglen += 4;
+    else
+        segsize |= 0x02000000L, seglen += 2;
+    if ((uint32_t)sdata.len > 65535L)
+        segsize |= 0xC0000000L, seglen += 4;
+    else
+        segsize |= 0x80000000L, seglen += 2;
+
+    /*
+     * Emit the as86 header.
+     */
+    fwriteint32_t(0x000186A3L, ofile);
+    fputc(0x2A, ofile);
+    fwriteint32_t(27 + symlen + seglen + strslen, ofile); /* header length */
+    fwriteint32_t(stext.len + sdata.len + bsslen, ofile);
+    fwriteint16_t(strslen, ofile);
+    fwriteint16_t(0, ofile);     /* class = revision = 0 */
+    fwriteint32_t(0x55555555L, ofile);    /* segment max sizes: always this */
+    fwriteint32_t(segsize, ofile);        /* segment size descriptors */
+    if (segsize & 0x01000000L)
+        fwriteint32_t(stext.len, ofile);
+    else
+        fwriteint16_t(stext.len, ofile);
+    if (segsize & 0x40000000L)
+        fwriteint32_t(sdata.len + bsslen, ofile);
+    else
+        fwriteint16_t(sdata.len + bsslen, ofile);
+    fwriteint16_t(nsyms, ofile);
+
+    /*
+     * Write the symbol table.
+     */
+    saa_rewind(syms);
+    for (i = 0; i < nsyms; i++) {
+        struct Symbol *sym = saa_rstruct(syms);
+        fwriteint16_t(sym->strpos, ofile);
+        fwriteint16_t(sym->flags, ofile);
+        switch (sym->flags & (3 << 14)) {
+        case 0 << 14:
+            break;
+        case 1 << 14:
+            fputc(sym->value, ofile);
+            break;
+        case 2 << 14:
+            fwriteint16_t(sym->value, ofile);
+            break;
+        case 3 << 14:
+            fwriteint32_t(sym->value, ofile);
+            break;
+        }
+    }
+
+    /*
+     * Write out the string table.
+     */
+    saa_fpwrite(strs, ofile);
+
+    /*
+     * Write the program text.
+     */
+    as86_reloc_size = -1;
+    as86_write_section(&stext, SECT_TEXT);
+    as86_write_section(&sdata, SECT_DATA);
+    /*
+     * Append the BSS section to the .data section
+     */
+    if (bsslen > 65535L) {
+        fputc(0x13, ofile);
+        fwriteint32_t(bsslen, ofile);
+    } else if (bsslen > 255) {
+        fputc(0x12, ofile);
+        fwriteint16_t(bsslen, ofile);
+    } else if (bsslen) {
+        fputc(0x11, ofile);
+        fputc(bsslen, ofile);
+    }
+
+    fputc(0, ofile);           /* termination */
+}
+
+static void as86_set_rsize(int size)
+{
+    if (as86_reloc_size != size) {
+        switch (as86_reloc_size = size) {
+        case 1:
+            fputc(0x01, ofile);
+            break;
+        case 2:
+            fputc(0x02, ofile);
+            break;
+        case 4:
+            fputc(0x03, ofile);
+            break;
+        default:
+            nasm_error(ERR_PANIC, "bizarre relocation size %d", size);
+           break;
+        }
+    }
+}
+
+static void as86_write_section(struct Section *sect, int index)
+{
+    struct Piece *p;
+    uint32_t s;
+    int32_t length;
+
+    fputc(0x20 + index, ofile);        /* select the right section */
+
+    saa_rewind(sect->data);
+
+    for (p = sect->head; p; p = p->next)
+        switch (p->type) {
+        case 0:
+            /*
+             * Absolute data. Emit it in chunks of at most 64
+             * bytes.
+             */
+            length = p->bytes;
+            do {
+                char buf[64];
+                int32_t tmplen = (length > 64 ? 64 : length);
+                fputc(0x40 | (tmplen & 0x3F), ofile);
+                saa_rnbytes(sect->data, buf, tmplen);
+                fwrite(buf, 1, tmplen, ofile);
+                length -= tmplen;
+            } while (length > 0);
+            break;
+        case 1:
+            /*
+             * A segment-type relocation. First fix up the BSS.
+             */
+            if (p->number == SECT_BSS)
+                p->number = SECT_DATA, p->offset += sdata.len;
+            as86_set_rsize(p->bytes);
+            fputc(0x80 | (p->relative ? 0x20 : 0) | p->number, ofile);
+            if (as86_reloc_size == 2)
+                fwriteint16_t(p->offset, ofile);
+            else
+                fwriteint32_t(p->offset, ofile);
+            break;
+        case 2:
+            /*
+             * A symbol-type relocation.
+             */
+            as86_set_rsize(p->bytes);
+            s = p->offset;
+            if (s > 65535L)
+                s = 3;
+            else if (s > 255)
+                s = 2;
+            else if (s > 0)
+                s = 1;
+            else
+                s = 0;
+            fputc(0xC0 |
+                  (p->relative ? 0x20 : 0) |
+                  (p->number > 255 ? 0x04 : 0) | s, ofile);
+            if (p->number > 255)
+                fwriteint16_t(p->number, ofile);
+            else
+                fputc(p->number, ofile);
+            switch ((int)s) {
+            case 0:
+                break;
+            case 1:
+                fputc(p->offset, ofile);
+                break;
+            case 2:
+                fwriteint16_t(p->offset, ofile);
+                break;
+            case 3:
+                fwriteint32_t(p->offset, ofile);
+                break;
+            }
+            break;
+        }
+}
+
+static void as86_sect_write(struct Section *sect,
+                            const uint8_t *data, uint32_t len)
+{
+    saa_wbytes(sect->data, data, len);
+    sect->datalen += len;
+}
+
+static int32_t as86_segbase(int32_t segment)
+{
+    return segment;
+}
+
+static void as86_filename(char *inname, char *outname)
+{
+    char *p;
+
+    if ((p = strrchr(inname, '.')) != NULL) {
+        strncpy(as86_module, inname, p - inname);
+        as86_module[p - inname] = '\0';
+    } else
+        strcpy(as86_module, inname);
+
+    standard_extension(inname, outname, ".o");
+}
+
+extern macros_t as86_stdmac[];
+
+struct ofmt of_as86 = {
+    "Linux as86 (bin86 version 0.3) object files",
+    "as86",
+    0,
+    null_debug_arr,
+    &null_debug_form,
+    as86_stdmac,
+    as86_init,
+    null_setinfo,
+    as86_out,
+    as86_deflabel,
+    as86_section_names,
+    as86_segbase,
+    null_directive,
+    as86_filename,
+    as86_cleanup
+};
+
+#endif                          /* OF_AS86 */
diff --git a/output/outas86.mac b/output/outas86.mac
new file mode 100644 (file)
index 0000000..f0bd2e4
--- /dev/null
@@ -0,0 +1,37 @@
+;; --------------------------------------------------------------------------
+;;   
+;;   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.
+;;
+;; --------------------------------------------------------------------------
+
+OUT: as86
+%define __SECT__ [section .text]
+%macro __NASM_CDecl__ 1
+%endmacro
diff --git a/output/outbin.c b/output/outbin.c
new file mode 100644 (file)
index 0000000..41c28f3
--- /dev/null
@@ -0,0 +1,1719 @@
+/* ----------------------------------------------------------------------- *
+ *   
+ *   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.
+ *
+ * ----------------------------------------------------------------------- */
+
+/* 
+ * outbin.c output routines for the Netwide Assembler to produce
+ *    flat-form binary files
+ */
+
+/* This is the extended version of NASM's original binary output
+ * format.  It is backward compatible with the original BIN format,
+ * and contains support for multiple sections and advanced section
+ * ordering.
+ *
+ * Feature summary:
+ *
+ * - Users can create an arbitrary number of sections; they are not
+ *   limited to just ".text", ".data", and ".bss".
+ *
+ * - Sections can be either progbits or nobits type.
+ *
+ * - You can specify that they be aligned at a certian boundary
+ *   following the previous section ("align="), or positioned at an
+ *   arbitrary byte-granular location ("start=").
+ *
+ * - You can specify a "virtual" start address for a section, which
+ *   will be used for the calculation for all address references
+ *   with respect to that section ("vstart=").
+ *
+ * - The ORG directive, as well as the section/segment directive
+ *   arguments ("align=", "start=", "vstart="), can take a critical
+ *   expression as their value.  For example: "align=(1 << 12)".
+ *
+ * - You can generate map files using the 'map' directive.
+ *
+ */
+
+/* Uncomment the following define if you want sections to adapt
+ * their progbits/nobits state depending on what type of
+ * instructions are issued, rather than defaulting to progbits.
+ * Note that this behavior violates the specification.
+
+#define ABIN_SMART_ADAPT
+
+*/
+
+#include "compiler.h"
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <ctype.h>
+#include <inttypes.h>
+
+#include "nasm.h"
+#include "nasmlib.h"
+#include "saa.h"
+#include "stdscan.h"
+#include "labels.h"
+#include "eval.h"
+#include "output/outform.h"
+#include "output/outlib.h"
+
+#ifdef OF_BIN
+
+static FILE *rf = NULL;
+static void (*do_output)(void);
+
+/* Section flags keep track of which attributes the user has defined. */
+#define START_DEFINED       0x001
+#define ALIGN_DEFINED       0x002
+#define FOLLOWS_DEFINED     0x004
+#define VSTART_DEFINED      0x008
+#define VALIGN_DEFINED      0x010
+#define VFOLLOWS_DEFINED    0x020
+#define TYPE_DEFINED        0x040
+#define TYPE_PROGBITS       0x080
+#define TYPE_NOBITS         0x100
+
+/* This struct is used to keep track of symbols for map-file generation. */
+static struct bin_label {
+    char *name;
+    struct bin_label *next;
+} *no_seg_labels, **nsl_tail;
+
+static struct Section {
+    char *name;
+    struct SAA *contents;
+    int64_t length;                /* section length in bytes */
+
+/* Section attributes */
+    int flags;                  /* see flag definitions above */
+    uint64_t align;        /* section alignment */
+    uint64_t valign;       /* notional section alignment */
+    uint64_t start;        /* section start address */
+    uint64_t vstart;       /* section virtual start address */
+    char *follows;              /* the section that this one will follow */
+    char *vfollows;             /* the section that this one will notionally follow */
+    int32_t start_index;           /* NASM section id for non-relocated version */
+    int32_t vstart_index;          /* the NASM section id */
+
+    struct bin_label *labels;   /* linked-list of label handles for map output. */
+    struct bin_label **labels_end;      /* Holds address of end of labels list. */
+    struct Section *ifollows;   /* Points to previous section (implicit follows). */
+    struct Section *next;       /* This links sections with a defined start address. */
+
+/* The extended bin format allows for sections to have a "virtual"
+ * start address.  This is accomplished by creating two sections:
+ * one beginning at the Load Memory Address and the other beginning
+ * at the Virtual Memory Address.  The LMA section is only used to
+ * define the section.<section_name>.start label, but there isn't
+ * any other good way for us to handle that label.
+ */
+
+} *sections, *last_section;
+
+static struct Reloc {
+    struct Reloc *next;
+    int32_t posn;
+    int32_t bytes;
+    int32_t secref;
+    int32_t secrel;
+    struct Section *target;
+} *relocs, **reloctail;
+
+static uint8_t format_mode;       /* 0 = original bin, 1 = extended bin */
+static int32_t current_section;    /* only really needed if format_mode = 0 */
+static uint64_t origin;
+static int origin_defined;
+
+/* Stuff we need for map-file generation. */
+#define MAP_ORIGIN       1
+#define MAP_SUMMARY      2
+#define MAP_SECTIONS     4
+#define MAP_SYMBOLS      8
+static int map_control = 0;
+static char *infile, *outfile;
+
+extern macros_t bin_stdmac[];
+
+static void add_reloc(struct Section *s, int32_t bytes, int32_t secref,
+                      int32_t secrel)
+{
+    struct Reloc *r;
+
+    r = *reloctail = nasm_malloc(sizeof(struct Reloc));
+    reloctail = &r->next;
+    r->next = NULL;
+    r->posn = s->length;
+    r->bytes = bytes;
+    r->secref = secref;
+    r->secrel = secrel;
+    r->target = s;
+}
+
+static struct Section *find_section_by_name(const char *name)
+{
+    struct Section *s;
+
+    list_for_each(s, sections)
+        if (!strcmp(s->name, name))
+            break;
+    return s;
+}
+
+static struct Section *find_section_by_index(int32_t index)
+{
+    struct Section *s;
+
+    list_for_each(s, sections)
+        if ((index == s->vstart_index) || (index == s->start_index))
+            break;
+    return s;
+}
+
+static struct Section *create_section(char *name)
+{                               /* Create a new section. */
+    last_section->next = nasm_malloc(sizeof(struct Section));
+    last_section->next->ifollows = last_section;
+    last_section = last_section->next;
+    last_section->labels = NULL;
+    last_section->labels_end = &(last_section->labels);
+
+    /* Initialize section attributes. */
+    last_section->name = nasm_strdup(name);
+    last_section->contents = saa_init(1L);
+    last_section->follows = last_section->vfollows = 0;
+    last_section->length = 0;
+    last_section->flags = 0;
+    last_section->next = NULL;
+
+    /* Register our sections with NASM. */
+    last_section->vstart_index = seg_alloc();
+    last_section->start_index = seg_alloc();
+    return last_section;
+}
+
+static void bin_cleanup(int debuginfo)
+{
+    struct Section *g, **gp;
+    struct Section *gs = NULL, **gsp;
+    struct Section *s, **sp;
+    struct Section *nobits = NULL, **nt;
+    struct Section *last_progbits;
+    struct bin_label *l;
+    struct Reloc *r;
+    uint64_t pend;
+    int h;
+
+    (void)debuginfo;      /* placate optimizers */
+
+#ifdef DEBUG
+    nasm_error(ERR_DEBUG,
+            "bin_cleanup: Sections were initially referenced in this order:\n");
+    for (h = 0, s = sections; s; h++, s = s->next)
+        fprintf(stdout, "%i. %s\n", h, s->name);
+#endif
+
+    /* Assembly has completed, so now we need to generate the output file.
+     * Step 1: Separate progbits and nobits sections into separate lists.
+     * Step 2: Sort the progbits sections into their output order.
+     * Step 3: Compute start addresses for all progbits sections.
+     * Step 4: Compute vstart addresses for all sections.
+     * Step 5: Apply relocations.
+     * Step 6: Write the sections' data to the output file.
+     * Step 7: Generate the map file.
+     * Step 8: Release all allocated memory.
+     */
+
+    /* To do: Smart section-type adaptation could leave some empty sections
+     * without a defined type (progbits/nobits).  Won't fix now since this
+     * feature will be disabled.  */
+
+    /* Step 1: Split progbits and nobits sections into separate lists. */
+
+    nt = &nobits;
+    /* Move nobits sections into a separate list.  Also pre-process nobits
+     * sections' attributes. */
+    for (sp = &sections->next, s = sections->next; s; s = *sp) {        /* Skip progbits sections. */
+        if (s->flags & TYPE_PROGBITS) {
+            sp = &s->next;
+            continue;
+        }
+        /* Do some special pre-processing on nobits sections' attributes. */
+        if (s->flags & (START_DEFINED | ALIGN_DEFINED | FOLLOWS_DEFINED)) {     /* Check for a mixture of real and virtual section attributes. */
+            if (s->flags & (VSTART_DEFINED | VALIGN_DEFINED |
+                           VFOLLOWS_DEFINED))
+                nasm_error(ERR_FATAL|ERR_NOFILE,
+                      "cannot mix real and virtual attributes"
+                      " in nobits section (%s)", s->name);
+            /* Real and virtual attributes mean the same thing for nobits sections. */
+            if (s->flags & START_DEFINED) {
+                s->vstart = s->start;
+                s->flags |= VSTART_DEFINED;
+            }
+            if (s->flags & ALIGN_DEFINED) {
+                s->valign = s->align;
+                s->flags |= VALIGN_DEFINED;
+            }
+            if (s->flags & FOLLOWS_DEFINED) {
+                s->vfollows = s->follows;
+                s->flags |= VFOLLOWS_DEFINED;
+                s->flags &= ~FOLLOWS_DEFINED;
+            }
+        }
+        /* Every section must have a start address. */
+        if (s->flags & VSTART_DEFINED) {
+            s->start = s->vstart;
+            s->flags |= START_DEFINED;
+        }
+        /* Move the section into the nobits list. */
+        *sp = s->next;
+        s->next = NULL;
+        *nt = s;
+        nt = &s->next;
+    }
+
+    /* Step 2: Sort the progbits sections into their output order. */
+
+    /* In Step 2 we move around sections in groups.  A group
+     * begins with a section (group leader) that has a user-
+     * defined start address or follows section.  The remainder
+     * of the group is made up of the sections that implicitly
+     * follow the group leader (i.e., they were defined after
+     * the group leader and were not given an explicit start
+     * address or follows section by the user). */
+
+    /* For anyone attempting to read this code:
+     * g (group) points to a group of sections, the first one of which has
+     *   a user-defined start address or follows section.
+     * gp (g previous) holds the location of the pointer to g.
+     * gs (g scan) is a temp variable that we use to scan to the end of the group.
+     * gsp (gs previous) holds the location of the pointer to gs.
+     * nt (nobits tail) points to the nobits section-list tail.
+     */
+
+    /* Link all 'follows' groups to their proper position.  To do
+     * this we need to know three things: the start of the group
+     * to relocate (g), the section it is following (s), and the
+     * end of the group we're relocating (gs). */
+    for (gp = &sections, g = sections; g; g = gs) {     /* Find the next follows group that is out of place (g). */
+        if (!(g->flags & FOLLOWS_DEFINED)) {
+            while (g->next) {
+                if ((g->next->flags & FOLLOWS_DEFINED) &&
+                    strcmp(g->name, g->next->follows))
+                    break;
+                g = g->next;
+            }
+            if (!g->next)
+                break;
+            gp = &g->next;
+            g = g->next;
+        }
+        /* Find the section that this group follows (s). */
+        for (sp = &sections, s = sections;
+             s && strcmp(s->name, g->follows);
+             sp = &s->next, s = s->next) ;
+        if (!s)
+            nasm_error(ERR_FATAL|ERR_NOFILE, "section %s follows an invalid or"
+                  " unknown section (%s)", g->name, g->follows);
+        if (s->next && (s->next->flags & FOLLOWS_DEFINED) &&
+            !strcmp(s->name, s->next->follows))
+            nasm_error(ERR_FATAL|ERR_NOFILE, "sections %s and %s can't both follow"
+                  " section %s", g->name, s->next->name, s->name);
+        /* Find the end of the current follows group (gs). */
+        for (gsp = &g->next, gs = g->next;
+             gs && (gs != s) && !(gs->flags & START_DEFINED);
+             gsp = &gs->next, gs = gs->next) {
+            if (gs->next && (gs->next->flags & FOLLOWS_DEFINED) &&
+                strcmp(gs->name, gs->next->follows)) {
+                gsp = &gs->next;
+                gs = gs->next;
+                break;
+            }
+        }
+        /* Re-link the group after its follows section. */
+        *gsp = s->next;
+        s->next = g;
+        *gp = gs;
+    }
+
+    /* Link all 'start' groups to their proper position.  Once
+     * again we need to know g, s, and gs (see above).  The main
+     * difference is we already know g since we sort by moving
+     * groups from the 'unsorted' list into a 'sorted' list (g
+     * will always be the first section in the unsorted list). */
+    for (g = sections, sections = NULL; g; g = gs) {    /* Find the section that we will insert this group before (s). */
+        for (sp = &sections, s = sections; s; sp = &s->next, s = s->next)
+            if ((s->flags & START_DEFINED) && (g->start < s->start))
+                break;
+        /* Find the end of the group (gs). */
+        for (gs = g->next, gsp = &g->next;
+             gs && !(gs->flags & START_DEFINED);
+             gsp = &gs->next, gs = gs->next) ;
+        /* Re-link the group before the target section. */
+        *sp = g;
+        *gsp = s;
+    }
+
+    /* Step 3: Compute start addresses for all progbits sections. */
+
+    /* Make sure we have an origin and a start address for the first section. */
+    if (origin_defined) {
+       if (sections->flags & START_DEFINED) {
+            /* Make sure this section doesn't begin before the origin. */
+            if (sections->start < origin)
+                nasm_error(ERR_FATAL|ERR_NOFILE, "section %s begins"
+                      " before program origin", sections->name);
+       } else if (sections->flags & ALIGN_DEFINED) {
+            sections->start = ((origin + sections->align - 1) &
+                               ~(sections->align - 1));
+       } else {
+            sections->start = origin;
+       }
+    } else {
+        if (!(sections->flags & START_DEFINED))
+            sections->start = 0;
+        origin = sections->start;
+    }
+    sections->flags |= START_DEFINED;
+
+    /* Make sure each section has an explicit start address.  If it
+     * doesn't, then compute one based its alignment and the end of
+     * the previous section. */
+    for (pend = sections->start, g = s = sections; g; g = g->next) {    /* Find the next section that could cause an overlap situation
+                                                                         * (has a defined start address, and is not zero length). */
+        if (g == s)
+            for (s = g->next;
+                 s && ((s->length == 0) || !(s->flags & START_DEFINED));
+                 s = s->next) ;
+        /* Compute the start address of this section, if necessary. */
+        if (!(g->flags & START_DEFINED)) {      /* Default to an alignment of 4 if unspecified. */
+            if (!(g->flags & ALIGN_DEFINED)) {
+                g->align = 4;
+                g->flags |= ALIGN_DEFINED;
+            }
+            /* Set the section start address. */
+            g->start = (pend + g->align - 1) & ~(g->align - 1);
+            g->flags |= START_DEFINED;
+        }
+        /* Ugly special case for progbits sections' virtual attributes:
+         *   If there is a defined valign, but no vstart and no vfollows, then
+         *   we valign after the previous progbits section.  This case doesn't
+         *   really make much sense for progbits sections with a defined start
+         *   address, but it is possible and we must do *something*.
+         * Not-so-ugly special case:
+         *   If a progbits section has no virtual attributes, we set the
+         *   vstart equal to the start address.  */
+        if (!(g->flags & (VSTART_DEFINED | VFOLLOWS_DEFINED))) {
+            if (g->flags & VALIGN_DEFINED)
+                g->vstart = (pend + g->valign - 1) & ~(g->valign - 1);
+            else
+                g->vstart = g->start;
+            g->flags |= VSTART_DEFINED;
+        }
+        /* Ignore zero-length sections. */
+        if (g->start < pend)
+            continue;
+        /* Compute the span of this section. */
+        pend = g->start + g->length;
+        /* Check for section overlap. */
+        if (s) {
+           if (s->start < origin)
+               nasm_error(ERR_FATAL|ERR_NOFILE, "section %s beings before program origin",
+                     s->name);
+           if (g->start > s->start)
+                nasm_error(ERR_FATAL|ERR_NOFILE, "sections %s ~ %s and %s overlap!",
+                      gs->name, g->name, s->name);
+            if (pend > s->start)
+                nasm_error(ERR_FATAL|ERR_NOFILE, "sections %s and %s overlap!",
+                      g->name, s->name);
+        }
+        /* Remember this section as the latest >0 length section. */
+        gs = g;
+    }
+
+    /* Step 4: Compute vstart addresses for all sections. */
+
+    /* Attach the nobits sections to the end of the progbits sections. */
+    for (s = sections; s->next; s = s->next) ;
+    s->next = nobits;
+    last_progbits = s;
+    /*
+     * Scan for sections that don't have a vstart address.  If we find
+     * one we'll attempt to compute its vstart.  If we can't compute
+     * the vstart, we leave it alone and come back to it in a
+     * subsequent scan.  We continue scanning and re-scanning until
+     * we've gone one full cycle without computing any vstarts.
+     */
+    do {                        /* Do one full scan of the sections list. */
+        for (h = 0, g = sections; g; g = g->next) {
+            if (g->flags & VSTART_DEFINED)
+                continue;
+            /* Find the section that this one virtually follows.  */
+            if (g->flags & VFOLLOWS_DEFINED) {
+                for (s = sections; s && strcmp(g->vfollows, s->name);
+                     s = s->next) ;
+                if (!s)
+                    nasm_error(ERR_FATAL|ERR_NOFILE,
+                          "section %s vfollows unknown section (%s)",
+                          g->name, g->vfollows);
+            } else if (g->ifollows != NULL)
+                for (s = sections; s && (s != g->ifollows); s = s->next) ;
+            /* The .bss section is the only one with ifollows = NULL.
+              In this case we implicitly follow the last progbits
+              section.  */
+            else
+                s = last_progbits;
+
+            /* If the section we're following has a vstart, we can proceed. */
+            if (s->flags & VSTART_DEFINED) {    /* Default to virtual alignment of four. */
+                if (!(g->flags & VALIGN_DEFINED)) {
+                    g->valign = 4;
+                    g->flags |= VALIGN_DEFINED;
+                }
+                /* Compute the vstart address. */
+                g->vstart = (s->vstart + s->length + g->valign - 1)
+                   & ~(g->valign - 1);
+               g->flags |= VSTART_DEFINED;
+                h++;
+                /* Start and vstart mean the same thing for nobits sections. */
+                if (g->flags & TYPE_NOBITS)
+                    g->start = g->vstart;
+            }
+        }
+    } while (h);
+
+    /* Now check for any circular vfollows references, which will manifest
+     * themselves as sections without a defined vstart. */
+    for (h = 0, s = sections; s; s = s->next) {
+        if (!(s->flags & VSTART_DEFINED)) {     /* Non-fatal errors after assembly has completed are generally a
+                                                 * no-no, but we'll throw a fatal one eventually so it's ok.  */
+            nasm_error(ERR_NONFATAL, "cannot compute vstart for section %s",
+                  s->name);
+            h++;
+        }
+    }
+    if (h)
+        nasm_error(ERR_FATAL|ERR_NOFILE, "circular vfollows path detected");
+
+#ifdef DEBUG
+    nasm_error(ERR_DEBUG,
+            "bin_cleanup: Confirm final section order for output file:\n");
+    for (h = 0, s = sections; s && (s->flags & TYPE_PROGBITS);
+         h++, s = s->next)
+        fprintf(stdout, "%i. %s\n", h, s->name);
+#endif
+
+    /* Step 5: Apply relocations. */
+
+    /* Prepare the sections for relocating. */
+    list_for_each(s, sections)
+        saa_rewind(s->contents);
+    /* Apply relocations. */
+    list_for_each(r, relocs) {
+        uint8_t *p, *q, mydata[8];
+        int64_t l;
+
+        saa_fread(r->target->contents, r->posn, mydata, r->bytes);
+        p = q = mydata;
+        l = *p++;
+
+        if (r->bytes > 1) {
+            l += ((int64_t)*p++) << 8;
+            if (r->bytes >= 4) {
+                l += ((int64_t)*p++) << 16;
+                l += ((int64_t)*p++) << 24;
+            }
+            if (r->bytes == 8) {
+                l += ((int64_t)*p++) << 32;
+                l += ((int64_t)*p++) << 40;
+                l += ((int64_t)*p++) << 48;
+                l += ((int64_t)*p++) << 56;
+            }
+        }
+
+        s = find_section_by_index(r->secref);
+        if (s) {
+            if (r->secref == s->start_index)
+                l += s->start;
+            else
+                l += s->vstart;
+        }
+        s = find_section_by_index(r->secrel);
+        if (s) {
+            if (r->secrel == s->start_index)
+                l -= s->start;
+            else
+                l -= s->vstart;
+        }
+
+        if (r->bytes >= 4)
+            WRITEDLONG(q, l);
+        else if (r->bytes == 2)
+            WRITESHORT(q, l);
+        else
+            *q++ = (uint8_t)(l & 0xFF);
+        saa_fwrite(r->target->contents, r->posn, mydata, r->bytes);
+    }
+
+    /* Step 6: Write the section data to the output file. */
+    do_output();
+
+    /* Step 7: Generate the map file. */
+
+    if (map_control) {
+        static const char not_defined[] = "not defined";
+
+        /* Display input and output file names. */
+        fprintf(rf, "\n- NASM Map file ");
+        for (h = 63; h; h--)
+            fputc('-', rf);
+        fprintf(rf, "\n\nSource file:  %s\nOutput file:  %s\n\n",
+                infile, outfile);
+
+        if (map_control & MAP_ORIGIN) { /* Display program origin. */
+            fprintf(rf, "-- Program origin ");
+            for (h = 61; h; h--)
+                fputc('-', rf);
+            fprintf(rf, "\n\n%08"PRIX64"\n\n", origin);
+        }
+        /* Display sections summary. */
+        if (map_control & MAP_SUMMARY) {
+            fprintf(rf, "-- Sections (summary) ");
+            for (h = 57; h; h--)
+                fputc('-', rf);
+            fprintf(rf, "\n\nVstart            Start             Stop              "
+                    "Length    Class     Name\n");
+            list_for_each(s, sections) {
+                fprintf(rf, "%16"PRIX64"  %16"PRIX64"  %16"PRIX64"  %08"PRIX64"  ",
+                        s->vstart, s->start, s->start + s->length,
+                        s->length);
+                if (s->flags & TYPE_PROGBITS)
+                    fprintf(rf, "progbits  ");
+                else
+                    fprintf(rf, "nobits    ");
+                fprintf(rf, "%s\n", s->name);
+            }
+            fprintf(rf, "\n");
+        }
+        /* Display detailed section information. */
+        if (map_control & MAP_SECTIONS) {
+            fprintf(rf, "-- Sections (detailed) ");
+            for (h = 56; h; h--)
+                fputc('-', rf);
+            fprintf(rf, "\n\n");
+            list_for_each(s, sections) {
+                fprintf(rf, "---- Section %s ", s->name);
+                for (h = 65 - strlen(s->name); h; h--)
+                    fputc('-', rf);
+                fprintf(rf, "\n\nclass:     ");
+                if (s->flags & TYPE_PROGBITS)
+                    fprintf(rf, "progbits");
+                else
+                    fprintf(rf, "nobits");
+                fprintf(rf, "\nlength:    %16"PRIX64"\nstart:     %16"PRIX64""
+                        "\nalign:     ", s->length, s->start);
+                if (s->flags & ALIGN_DEFINED)
+                    fprintf(rf, "%16"PRIX64"", s->align);
+                else
+                    fputs(not_defined, rf);
+                fprintf(rf, "\nfollows:   ");
+                if (s->flags & FOLLOWS_DEFINED)
+                    fprintf(rf, "%s", s->follows);
+                else
+                    fputs(not_defined, rf);
+                fprintf(rf, "\nvstart:    %16"PRIX64"\nvalign:    ", s->vstart);
+                if (s->flags & VALIGN_DEFINED)
+                    fprintf(rf, "%16"PRIX64"", s->valign);
+                else
+                    fputs(not_defined, rf);
+                fprintf(rf, "\nvfollows:  ");
+                if (s->flags & VFOLLOWS_DEFINED)
+                    fprintf(rf, "%s", s->vfollows);
+                else
+                    fputs(not_defined, rf);
+                fprintf(rf, "\n\n");
+            }
+        }
+        /* Display symbols information. */
+        if (map_control & MAP_SYMBOLS) {
+            int32_t segment;
+            int64_t offset;
+
+            fprintf(rf, "-- Symbols ");
+            for (h = 68; h; h--)
+                fputc('-', rf);
+            fprintf(rf, "\n\n");
+            if (no_seg_labels) {
+                fprintf(rf, "---- No Section ");
+                for (h = 63; h; h--)
+                    fputc('-', rf);
+                fprintf(rf, "\n\nValue     Name\n");
+                list_for_each(l, no_seg_labels) {
+                    lookup_label(l->name, &segment, &offset);
+                    fprintf(rf, "%08"PRIX64"  %s\n", offset, l->name);
+                }
+                fprintf(rf, "\n\n");
+            }
+            list_for_each(s, sections) {
+                if (s->labels) {
+                    fprintf(rf, "---- Section %s ", s->name);
+                    for (h = 65 - strlen(s->name); h; h--)
+                        fputc('-', rf);
+                    fprintf(rf, "\n\nReal              Virtual           Name\n");
+                    list_for_each(l, s->labels) {
+                        lookup_label(l->name, &segment, &offset);
+                        fprintf(rf, "%16"PRIX64"  %16"PRIX64"  %s\n",
+                                s->start + offset, s->vstart + offset,
+                                l->name);
+                    }
+                    fprintf(rf, "\n");
+                }
+            }
+        }
+    }
+
+    /* Close the report file. */
+    if (map_control && (rf != stdout) && (rf != stderr))
+        fclose(rf);
+
+    /* Step 8: Release all allocated memory. */
+
+    /* Free sections, label pointer structs, etc.. */
+    while (sections) {
+        s = sections;
+        sections = s->next;
+        saa_free(s->contents);
+        nasm_free(s->name);
+        if (s->flags & FOLLOWS_DEFINED)
+            nasm_free(s->follows);
+        if (s->flags & VFOLLOWS_DEFINED)
+            nasm_free(s->vfollows);
+        while (s->labels) {
+            l = s->labels;
+            s->labels = l->next;
+            nasm_free(l);
+        }
+        nasm_free(s);
+    }
+
+    /* Free no-section labels. */
+    while (no_seg_labels) {
+        l = no_seg_labels;
+        no_seg_labels = l->next;
+        nasm_free(l);
+    }
+
+    /* Free relocation structures. */
+    while (relocs) {
+        r = relocs->next;
+        nasm_free(relocs);
+        relocs = r;
+    }
+}
+
+static void bin_out(int32_t segto, const void *data,
+                   enum out_type type, uint64_t size,
+                    int32_t segment, int32_t wrt)
+{
+    uint8_t *p, mydata[8];
+    struct Section *s;
+
+    if (wrt != NO_SEG) {
+        wrt = NO_SEG;           /* continue to do _something_ */
+        nasm_error(ERR_NONFATAL, "WRT not supported by binary output format");
+    }
+
+    /* Handle absolute-assembly (structure definitions). */
+    if (segto == NO_SEG) {
+        if (type != OUT_RESERVE)
+            nasm_error(ERR_NONFATAL, "attempt to assemble code in"
+                  " [ABSOLUTE] space");
+        return;
+    }
+
+    /* Find the segment we are targeting. */
+    s = find_section_by_index(segto);
+    if (!s)
+        nasm_error(ERR_PANIC, "code directed to nonexistent segment?");
+
+    /* "Smart" section-type adaptation code. */
+    if (!(s->flags & TYPE_DEFINED)) {
+        if (type == OUT_RESERVE)
+            s->flags |= TYPE_DEFINED | TYPE_NOBITS;
+        else
+            s->flags |= TYPE_DEFINED | TYPE_PROGBITS;
+    }
+
+    if ((s->flags & TYPE_NOBITS) && (type != OUT_RESERVE))
+        nasm_error(ERR_WARNING, "attempt to initialize memory in a"
+              " nobits section: ignored");
+
+    if (type == OUT_ADDRESS) {
+        if (segment != NO_SEG && !find_section_by_index(segment)) {
+            if (segment % 2)
+                nasm_error(ERR_NONFATAL, "binary output format does not support"
+                      " segment base references");
+            else
+                nasm_error(ERR_NONFATAL, "binary output format does not support"
+                      " external references");
+            segment = NO_SEG;
+        }
+        if (s->flags & TYPE_PROGBITS) {
+            if (segment != NO_SEG)
+                add_reloc(s, size, segment, -1L);
+            p = mydata;
+           WRITEADDR(p, *(int64_t *)data, size);
+            saa_wbytes(s->contents, mydata, size);
+        }
+        s->length += size;
+    } else if (type == OUT_RAWDATA) {
+        if (s->flags & TYPE_PROGBITS)
+            saa_wbytes(s->contents, data, size);
+        s->length += size;
+    } else if (type == OUT_RESERVE) {
+        if (s->flags & TYPE_PROGBITS) {
+            nasm_error(ERR_WARNING, "uninitialized space declared in"
+                  " %s section: zeroing", s->name);
+            saa_wbytes(s->contents, NULL, size);
+        }
+        s->length += size;
+    } else if (type == OUT_REL2ADR || type == OUT_REL4ADR ||
+              type == OUT_REL8ADR) {
+       int64_t addr = *(int64_t *)data - size;
+       size = realsize(type, size);
+        if (segment != NO_SEG && !find_section_by_index(segment)) {
+            if (segment % 2)
+                nasm_error(ERR_NONFATAL, "binary output format does not support"
+                      " segment base references");
+            else
+                nasm_error(ERR_NONFATAL, "binary output format does not support"
+                      " external references");
+            segment = NO_SEG;
+        }
+        if (s->flags & TYPE_PROGBITS) {
+            add_reloc(s, size, segment, segto);
+            p = mydata;
+           WRITEADDR(p, addr - s->length, size);
+            saa_wbytes(s->contents, mydata, size);
+        }
+        s->length += size;
+    }
+}
+
+static void bin_deflabel(char *name, int32_t segment, int64_t offset,
+                         int is_global, char *special)
+{
+    (void)segment;              /* Don't warn that this parameter is unused */
+    (void)offset;               /* Don't warn that this parameter is unused */
+
+    if (special)
+        nasm_error(ERR_NONFATAL, "binary format does not support any"
+              " special symbol types");
+    else if (name[0] == '.' && name[1] == '.' && name[2] != '@')
+        nasm_error(ERR_NONFATAL, "unrecognised special symbol `%s'", name);
+    else if (is_global == 2)
+        nasm_error(ERR_NONFATAL, "binary output format does not support common"
+              " variables");
+    else {
+        struct Section *s;
+        struct bin_label ***ltp;
+
+        /* Remember label definition so we can look it up later when
+         * creating the map file. */
+        s = find_section_by_index(segment);
+        if (s)
+            ltp = &(s->labels_end);
+        else
+            ltp = &nsl_tail;
+        (**ltp) = nasm_malloc(sizeof(struct bin_label));
+        (**ltp)->name = name;
+        (**ltp)->next = NULL;
+        *ltp = &((**ltp)->next);
+    }
+
+}
+
+/* These constants and the following function are used
+ * by bin_secname() to parse attribute assignments. */
+
+enum { ATTRIB_START, ATTRIB_ALIGN, ATTRIB_FOLLOWS,
+    ATTRIB_VSTART, ATTRIB_VALIGN, ATTRIB_VFOLLOWS,
+    ATTRIB_NOBITS, ATTRIB_PROGBITS
+};
+
+static int bin_read_attribute(char **line, int *attribute,
+                              uint64_t *value)
+{
+    expr *e;
+    int attrib_name_size;
+    struct tokenval tokval;
+    char *exp;
+
+    /* Skip whitespace. */
+    while (**line && nasm_isspace(**line))
+        (*line)++;
+    if (!**line)
+        return 0;
+
+    /* Figure out what attribute we're reading. */
+    if (!nasm_strnicmp(*line, "align=", 6)) {
+        *attribute = ATTRIB_ALIGN;
+        attrib_name_size = 6;
+    } else if (format_mode) {
+        if (!nasm_strnicmp(*line, "start=", 6)) {
+            *attribute = ATTRIB_START;
+            attrib_name_size = 6;
+        } else if (!nasm_strnicmp(*line, "follows=", 8)) {
+            *attribute = ATTRIB_FOLLOWS;
+            *line += 8;
+            return 1;
+        } else if (!nasm_strnicmp(*line, "vstart=", 7)) {
+            *attribute = ATTRIB_VSTART;
+            attrib_name_size = 7;
+        } else if (!nasm_strnicmp(*line, "valign=", 7)) {
+            *attribute = ATTRIB_VALIGN;
+            attrib_name_size = 7;
+        } else if (!nasm_strnicmp(*line, "vfollows=", 9)) {
+            *attribute = ATTRIB_VFOLLOWS;
+            *line += 9;
+            return 1;
+        } else if (!nasm_strnicmp(*line, "nobits", 6) &&
+                   (nasm_isspace((*line)[6]) || ((*line)[6] == '\0'))) {
+            *attribute = ATTRIB_NOBITS;
+            *line += 6;
+            return 1;
+        } else if (!nasm_strnicmp(*line, "progbits", 8) &&
+                   (nasm_isspace((*line)[8]) || ((*line)[8] == '\0'))) {
+            *attribute = ATTRIB_PROGBITS;
+            *line += 8;
+            return 1;
+        } else
+            return 0;
+    } else
+        return 0;
+
+    /* Find the end of the expression. */
+    if ((*line)[attrib_name_size] != '(') {
+        /* Single term (no parenthesis). */
+        exp = *line += attrib_name_size;
+        while (**line && !nasm_isspace(**line))
+            (*line)++;
+        if (**line) {
+            **line = '\0';
+            (*line)++;
+        }
+    } else {
+        char c;
+        int pcount = 1;
+
+        /* Full expression (delimited by parenthesis) */
+        exp = *line += attrib_name_size + 1;
+        while (1) {
+            (*line) += strcspn(*line, "()'\"");
+            if (**line == '(') {
+                ++(*line);
+                ++pcount;
+            }
+            if (**line == ')') {
+                ++(*line);
+                --pcount;
+                if (!pcount)
+                    break;
+            }
+            if ((**line == '"') || (**line == '\'')) {
+                c = **line;
+                while (**line) {
+                    ++(*line);
+                    if (**line == c)
+                        break;
+                }
+                if (!**line) {
+                    nasm_error(ERR_NONFATAL,
+                          "invalid syntax in `section' directive");
+                    return -1;
+                }
+                ++(*line);
+            }
+            if (!**line) {
+                nasm_error(ERR_NONFATAL, "expecting `)'");
+                return -1;
+            }
+        }
+        *(*line - 1) = '\0';    /* Terminate the expression. */
+    }
+
+    /* Check for no value given. */
+    if (!*exp) {
+        nasm_error(ERR_WARNING, "No value given to attribute in"
+              " `section' directive");
+        return -1;
+    }
+
+    /* Read and evaluate the expression. */
+    stdscan_reset();
+    stdscan_set(exp);
+    tokval.t_type = TOKEN_INVALID;
+    e = evaluate(stdscan, NULL, &tokval, NULL, 1, nasm_error, NULL);
+    if (e) {
+        if (!is_really_simple(e)) {
+            nasm_error(ERR_NONFATAL, "section attribute value must be"
+                  " a critical expression");
+            return -1;
+        }
+    } else {
+        nasm_error(ERR_NONFATAL, "Invalid attribute value"
+              " specified in `section' directive.");
+        return -1;
+    }
+    *value = (uint64_t)reloc_value(e);
+    return 1;
+}
+
+static void bin_assign_attributes(struct Section *sec, char *astring)
+{
+    int attribute, check;
+    uint64_t value;
+    char *p;
+
+    while (1) {                 /* Get the next attribute. */
+        check = bin_read_attribute(&astring, &attribute, &value);
+        /* Skip bad attribute. */
+        if (check == -1)
+            continue;
+        /* Unknown section attribute, so skip it and warn the user. */
+        if (!check) {
+            if (!*astring)
+                break;          /* End of line. */
+            else {
+                p = astring;
+                while (*astring && !nasm_isspace(*astring))
+                    astring++;
+                if (*astring) {
+                    *astring = '\0';
+                    astring++;
+                }
+                nasm_error(ERR_WARNING, "ignoring unknown section attribute:"
+                      " \"%s\"", p);
+            }
+            continue;
+        }
+
+        switch (attribute) {    /* Handle nobits attribute. */
+        case ATTRIB_NOBITS:
+            if ((sec->flags & TYPE_DEFINED)
+                && (sec->flags & TYPE_PROGBITS))
+                nasm_error(ERR_NONFATAL,
+                      "attempt to change section type"
+                      " from progbits to nobits");
+            else
+                sec->flags |= TYPE_DEFINED | TYPE_NOBITS;
+            continue;
+
+            /* Handle progbits attribute. */
+        case ATTRIB_PROGBITS:
+            if ((sec->flags & TYPE_DEFINED) && (sec->flags & TYPE_NOBITS))
+                nasm_error(ERR_NONFATAL, "attempt to change section type"
+                      " from nobits to progbits");
+            else
+                sec->flags |= TYPE_DEFINED | TYPE_PROGBITS;
+            continue;
+
+            /* Handle align attribute. */
+        case ATTRIB_ALIGN:
+            if (!format_mode && (!strcmp(sec->name, ".text")))
+                nasm_error(ERR_NONFATAL, "cannot specify an alignment"
+                      " to the .text section");
+            else {
+                if (!value || ((value - 1) & value))
+                    nasm_error(ERR_NONFATAL, "argument to `align' is not a"
+                          " power of two");
+                else {          /* Alignment is already satisfied if the previous
+                                 * align value is greater. */
+                    if ((sec->flags & ALIGN_DEFINED)
+                        && (value < sec->align))
+                        value = sec->align;
+
+                    /* Don't allow a conflicting align value. */
+                    if ((sec->flags & START_DEFINED)
+                        && (sec->start & (value - 1)))
+                        nasm_error(ERR_NONFATAL,
+                              "`align' value conflicts "
+                              "with section start address");
+                    else {
+                        sec->align = value;
+                        sec->flags |= ALIGN_DEFINED;
+                    }
+                }
+            }
+            continue;
+
+            /* Handle valign attribute. */
+        case ATTRIB_VALIGN:
+            if (!value || ((value - 1) & value))
+                nasm_error(ERR_NONFATAL, "argument to `valign' is not a"
+                      " power of two");
+            else {              /* Alignment is already satisfied if the previous
+                                 * align value is greater. */
+                if ((sec->flags & VALIGN_DEFINED) && (value < sec->valign))
+                    value = sec->valign;
+
+                /* Don't allow a conflicting valign value. */
+                if ((sec->flags & VSTART_DEFINED)
+                    && (sec->vstart & (value - 1)))
+                    nasm_error(ERR_NONFATAL,
+                          "`valign' value conflicts "
+                          "with `vstart' address");
+                else {
+                    sec->valign = value;
+                    sec->flags |= VALIGN_DEFINED;
+                }
+            }
+            continue;
+
+            /* Handle start attribute. */
+        case ATTRIB_START:
+            if (sec->flags & FOLLOWS_DEFINED)
+                nasm_error(ERR_NONFATAL, "cannot combine `start' and `follows'"
+                      " section attributes");
+            else if ((sec->flags & START_DEFINED) && (value != sec->start))
+                nasm_error(ERR_NONFATAL, "section start address redefined");
+            else {
+                sec->start = value;
+                sec->flags |= START_DEFINED;
+                if (sec->flags & ALIGN_DEFINED) {
+                    if (sec->start & (sec->align - 1))
+                        nasm_error(ERR_NONFATAL, "`start' address conflicts"
+                              " with section alignment");
+                    sec->flags ^= ALIGN_DEFINED;
+                }
+            }
+            continue;
+
+            /* Handle vstart attribute. */
+        case ATTRIB_VSTART:
+            if (sec->flags & VFOLLOWS_DEFINED)
+                nasm_error(ERR_NONFATAL,
+                      "cannot combine `vstart' and `vfollows'"
+                      " section attributes");
+            else if ((sec->flags & VSTART_DEFINED)
+                     && (value != sec->vstart))
+                nasm_error(ERR_NONFATAL,
+                      "section virtual start address"
+                      " (vstart) redefined");
+            else {
+                sec->vstart = value;
+                sec->flags |= VSTART_DEFINED;
+                if (sec->flags & VALIGN_DEFINED) {
+                    if (sec->vstart & (sec->valign - 1))
+                        nasm_error(ERR_NONFATAL, "`vstart' address conflicts"
+                              " with `valign' value");
+                    sec->flags ^= VALIGN_DEFINED;
+                }
+            }
+            continue;
+
+            /* Handle follows attribute. */
+        case ATTRIB_FOLLOWS:
+            p = astring;
+            astring += strcspn(astring, " \t");
+            if (astring == p)
+                nasm_error(ERR_NONFATAL, "expecting section name for `follows'"
+                      " attribute");
+            else {
+                *(astring++) = '\0';
+                if (sec->flags & START_DEFINED)
+                    nasm_error(ERR_NONFATAL,
+                          "cannot combine `start' and `follows'"
+                          " section attributes");
+                sec->follows = nasm_strdup(p);
+                sec->flags |= FOLLOWS_DEFINED;
+            }
+            continue;
+
+            /* Handle vfollows attribute. */
+        case ATTRIB_VFOLLOWS:
+            if (sec->flags & VSTART_DEFINED)
+                nasm_error(ERR_NONFATAL,
+                      "cannot combine `vstart' and `vfollows'"
+                      " section attributes");
+            else {
+                p = astring;
+                astring += strcspn(astring, " \t");
+                if (astring == p)
+                    nasm_error(ERR_NONFATAL,
+                          "expecting section name for `vfollows'"
+                          " attribute");
+                else {
+                    *(astring++) = '\0';
+                    sec->vfollows = nasm_strdup(p);
+                    sec->flags |= VFOLLOWS_DEFINED;
+                }
+            }
+            continue;
+        }
+    }
+}
+
+static void bin_define_section_labels(void)
+{
+    static int labels_defined = 0;
+    struct Section *sec;
+    char *label_name;
+    size_t base_len;
+
+    if (labels_defined)
+        return;
+    list_for_each(sec, sections) {
+        base_len = strlen(sec->name) + 8;
+        label_name = nasm_malloc(base_len + 8);
+        strcpy(label_name, "section.");
+        strcpy(label_name + 8, sec->name);
+
+        /* section.<name>.start */
+        strcpy(label_name + base_len, ".start");
+        define_label(label_name, sec->start_index, 0L, NULL, 0, 0);
+
+        /* section.<name>.vstart */
+        strcpy(label_name + base_len, ".vstart");
+        define_label(label_name, sec->vstart_index, 0L, NULL, 0, 0);
+
+        nasm_free(label_name);
+    }
+    labels_defined = 1;
+}
+
+static int32_t bin_secname(char *name, int pass, int *bits)
+{
+    char *p;
+    struct Section *sec;
+
+    /* bin_secname is called with *name = NULL at the start of each
+     * pass.  Use this opportunity to establish the default section
+     * (default is BITS-16 ".text" segment).
+     */
+    if (!name) {                /* Reset ORG and section attributes at the start of each pass. */
+        origin_defined = 0;
+        list_for_each(sec, sections)
+            sec->flags &= ~(START_DEFINED | VSTART_DEFINED |
+                            ALIGN_DEFINED | VALIGN_DEFINED);
+
+        /* Define section start and vstart labels. */
+        if (format_mode && (pass != 1))
+            bin_define_section_labels();
+
+        /* Establish the default (.text) section. */
+        *bits = 16;
+        sec = find_section_by_name(".text");
+        sec->flags |= TYPE_DEFINED | TYPE_PROGBITS;
+        current_section = sec->vstart_index;
+        return current_section;
+    }
+
+    /* Attempt to find the requested section.  If it does not
+     * exist, create it. */
+    p = name;
+    while (*p && !nasm_isspace(*p))
+        p++;
+    if (*p)
+        *p++ = '\0';
+    sec = find_section_by_name(name);
+    if (!sec) {
+        sec = create_section(name);
+        if (!strcmp(name, ".data"))
+            sec->flags |= TYPE_DEFINED | TYPE_PROGBITS;
+        else if (!strcmp(name, ".bss")) {
+            sec->flags |= TYPE_DEFINED | TYPE_NOBITS;
+            sec->ifollows = NULL;
+        } else if (!format_mode) {
+            nasm_error(ERR_NONFATAL, "section name must be "
+                  ".text, .data, or .bss");
+            return current_section;
+        }
+    }
+
+    /* Handle attribute assignments. */
+    if (pass != 1)
+        bin_assign_attributes(sec, p);
+
+#ifndef ABIN_SMART_ADAPT
+    /* The following line disables smart adaptation of
+     * PROGBITS/NOBITS section types (it forces sections to
+     * default to PROGBITS). */
+    if ((pass != 1) && !(sec->flags & TYPE_DEFINED))
+        sec->flags |= TYPE_DEFINED | TYPE_PROGBITS;
+#endif
+
+    /* Set the current section and return. */
+    current_section = sec->vstart_index;
+    return current_section;
+}
+
+static int bin_directive(enum directives directive, char *args, int pass)
+{
+    switch (directive) {
+    case D_ORG:
+    {
+        struct tokenval tokval;
+        uint64_t value;
+        expr *e;
+
+        stdscan_reset();
+        stdscan_set(args);
+        tokval.t_type = TOKEN_INVALID;
+        e = evaluate(stdscan, NULL, &tokval, NULL, 1, nasm_error, NULL);
+        if (e) {
+            if (!is_really_simple(e))
+                nasm_error(ERR_NONFATAL, "org value must be a critical"
+                      " expression");
+            else {
+                value = reloc_value(e);
+                /* Check for ORG redefinition. */
+                if (origin_defined && (value != origin))
+                    nasm_error(ERR_NONFATAL, "program origin redefined");
+                else {
+                    origin = value;
+                    origin_defined = 1;
+                }
+            }
+        } else
+            nasm_error(ERR_NONFATAL, "No or invalid offset specified"
+                  " in ORG directive.");
+        return 1;
+    }
+    case D_MAP:
+    {
+    /* The 'map' directive allows the user to generate section
+     * and symbol information to stdout, stderr, or to a file. */
+       char *p;
+       
+        if (pass != 1)
+            return 1;
+        args += strspn(args, " \t");
+        while (*args) {
+            p = args;
+            args += strcspn(args, " \t");
+            if (*args != '\0')
+                *(args++) = '\0';
+            if (!nasm_stricmp(p, "all"))
+                map_control |=
+                    MAP_ORIGIN | MAP_SUMMARY | MAP_SECTIONS | MAP_SYMBOLS;
+            else if (!nasm_stricmp(p, "brief"))
+                map_control |= MAP_ORIGIN | MAP_SUMMARY;
+            else if (!nasm_stricmp(p, "sections"))
+                map_control |= MAP_ORIGIN | MAP_SUMMARY | MAP_SECTIONS;
+            else if (!nasm_stricmp(p, "segments"))
+                map_control |= MAP_ORIGIN | MAP_SUMMARY | MAP_SECTIONS;
+            else if (!nasm_stricmp(p, "symbols"))
+                map_control |= MAP_SYMBOLS;
+            else if (!rf) {
+                if (!nasm_stricmp(p, "stdout"))
+                    rf = stdout;
+                else if (!nasm_stricmp(p, "stderr"))
+                    rf = stderr;
+                else {          /* Must be a filename. */
+                    rf = fopen(p, "wt");
+                    if (!rf) {
+                        nasm_error(ERR_WARNING, "unable to open map file `%s'",
+                              p);
+                        map_control = 0;
+                        return 1;
+                    }
+                }
+            } else
+                nasm_error(ERR_WARNING, "map file already specified");
+        }
+        if (map_control == 0)
+            map_control |= MAP_ORIGIN | MAP_SUMMARY;
+        if (!rf)
+            rf = stdout;
+        return 1;
+    }
+    default:
+       return 0;
+    }
+}
+
+static void bin_filename(char *inname, char *outname)
+{
+    standard_extension(inname, outname, "");
+    infile = inname;
+    outfile = outname;
+}
+
+static void ith_filename(char *inname, char *outname)
+{
+    standard_extension(inname, outname, ".ith");
+    infile = inname;
+    outfile = outname;
+}
+
+static void srec_filename(char *inname, char *outname)
+{
+    standard_extension(inname, outname, ".srec");
+    infile = inname;
+    outfile = outname;
+}
+
+static int32_t bin_segbase(int32_t segment)
+{
+    return segment;
+}
+
+static int bin_set_info(enum geninfo type, char **val)
+{
+    (void)type;
+    (void)val;
+    return 0;
+}
+
+struct ofmt of_bin, of_ith, of_srec;
+static void binfmt_init(void);
+static void do_output_bin(void);
+static void do_output_ith(void);
+static void do_output_srec(void);
+
+static void bin_init(void)
+{
+    do_output = do_output_bin;
+    binfmt_init();
+}
+
+static void ith_init(void)
+{
+    do_output = do_output_ith;
+    binfmt_init();
+}    
+    
+static void srec_init(void)
+{
+    do_output = do_output_srec;
+    binfmt_init();
+}
+
+static void binfmt_init(void)
+{
+    maxbits = 64;               /* Support 64-bit Segments */
+    relocs = NULL;
+    reloctail = &relocs;
+    origin_defined = 0;
+    no_seg_labels = NULL;
+    nsl_tail = &no_seg_labels;
+    format_mode = 1;            /* Extended bin format
+                                 * (set this to zero for old bin format). */
+
+    /* Create default section (.text). */
+    sections = last_section = nasm_malloc(sizeof(struct Section));
+    last_section->next = NULL;
+    last_section->name = nasm_strdup(".text");
+    last_section->contents = saa_init(1L);
+    last_section->follows = last_section->vfollows = 0;
+    last_section->ifollows = NULL;
+    last_section->length = 0;
+    last_section->flags = TYPE_DEFINED | TYPE_PROGBITS;
+    last_section->labels = NULL;
+    last_section->labels_end = &(last_section->labels);
+    last_section->start_index = seg_alloc();
+    last_section->vstart_index = current_section = seg_alloc();
+}
+
+/* Generate binary file output */
+static void do_output_bin(void)
+{
+    struct Section *s;
+    uint64_t addr = origin;
+
+    /* Write the progbits sections to the output file. */
+    list_for_each(s, sections) {
+       /* Skip non-progbits sections */
+       if (!(s->flags & TYPE_PROGBITS))
+           continue;
+       /* Skip zero-length sections */
+       if (s->length == 0)
+            continue;
+
+        /* Pad the space between sections. */
+       nasm_assert(addr <= s->start);
+       fwritezero(s->start - addr, ofile);
+
+        /* Write the section to the output file. */
+       saa_fpwrite(s->contents, ofile);
+        
+       /* Keep track of the current file position */
+       addr = s->start + s->length;
+    }
+}
+
+/* Generate Intel hex file output */
+static int write_ith_record(unsigned int len, uint16_t addr,
+                           uint8_t type, void *data)
+{
+    char buf[1+2+4+2+255*2+2+2];
+    char *p = buf;
+    uint8_t csum, *dptr = data;
+    unsigned int i;
+
+    nasm_assert(len <= 255);
+
+    csum = len + addr + (addr >> 8) + type;
+    for (i = 0; i < len; i++)
+       csum += dptr[i];
+    csum = -csum;
+
+    p += sprintf(p, ":%02X%04X%02X", len, addr, type);
+    for (i = 0; i < len; i++)
+       p += sprintf(p, "%02X", dptr[i]);
+    p += sprintf(p, "%02X\n", csum);
+
+    if (fwrite(buf, 1, p-buf, ofile) != (size_t)(p-buf))
+       return -1;
+
+    return 0;
+}
+
+static void do_output_ith(void)
+{
+    uint8_t buf[32];
+    struct Section *s;
+    uint64_t addr, hiaddr, hilba;
+    uint64_t length;
+    unsigned int chunk;
+
+    /* Write the progbits sections to the output file. */
+    hilba = 0;
+    list_for_each(s, sections) {
+       /* Skip non-progbits sections */
+       if (!(s->flags & TYPE_PROGBITS))
+           continue;
+       /* Skip zero-length sections */
+       if (s->length == 0)
+            continue;
+
+       addr   = s->start;
+       length = s->length;
+       saa_rewind(s->contents);
+
+       while (length) {
+           hiaddr = addr >> 16;
+           if (hiaddr != hilba) {
+               buf[0] = hiaddr >> 8;
+               buf[1] = hiaddr;
+               write_ith_record(2, 0, 4, buf);
+               hilba = hiaddr;
+           }
+
+           chunk = 32 - (addr & 31);
+           if (length < chunk)
+               chunk = length;
+
+           saa_rnbytes(s->contents, buf, chunk);
+           write_ith_record(chunk, (uint16_t)addr, 0, buf);
+
+           addr += chunk;
+           length -= chunk;
+       }
+    }
+
+    /* Write closing record */
+    write_ith_record(0, 0, 1, NULL);
+}
+
+/* Generate Motorola S-records */
+static int write_srecord(unsigned int len,  unsigned int alen,
+                        uint32_t addr, uint8_t type, void *data)
+{
+    char buf[2+2+8+255*2+2+2];
+    char *p = buf;
+    uint8_t csum, *dptr = data;
+    unsigned int i;
+
+    nasm_assert(len <= 255);
+
+    switch (alen) {
+    case 2:
+       addr &= 0xffff;
+       break;
+    case 3:
+       addr &= 0xffffff;
+       break;
+    case 4:
+       break;
+    default:
+       nasm_assert(0);
+       break;
+    }
+
+    csum = (len+alen+1) + addr + (addr >> 8) + (addr >> 16) + (addr >> 24);
+    for (i = 0; i < len; i++)
+       csum += dptr[i];
+    csum = 0xff-csum;
+
+    p += sprintf(p, "S%c%02X%0*X", type, len+alen+1, alen*2, addr);
+    for (i = 0; i < len; i++)
+       p += sprintf(p, "%02X", dptr[i]);
+    p += sprintf(p, "%02X\n", csum);
+
+    if (fwrite(buf, 1, p-buf, ofile) != (size_t)(p-buf))
+       return -1;
+
+    return 0;
+}
+
+static void do_output_srec(void)
+{
+    uint8_t buf[32];
+    struct Section *s;
+    uint64_t addr, maxaddr;
+    uint64_t length;
+    int alen;
+    unsigned int chunk;
+    char dtype, etype;
+
+    maxaddr = 0;
+    list_for_each(s, sections) {
+       /* Skip non-progbits sections */
+       if (!(s->flags & TYPE_PROGBITS))
+           continue;
+       /* Skip zero-length sections */
+       if (s->length == 0)
+            continue;
+
+       addr = s->start + s->length - 1;
+       if (addr > maxaddr)
+           maxaddr = addr;
+    }
+
+    if (maxaddr <= 0xffff) {
+       alen  = 2;
+       dtype = '1';            /* S1 = 16-bit data */
+       etype = '9';            /* S9 = 16-bit end */
+    } else if (maxaddr <= 0xffffff) {
+       alen = 3;
+       dtype = '2';            /* S2 = 24-bit data */
+       etype = '8';            /* S8 = 24-bit end */
+    } else {
+       alen = 4;
+       dtype = '3';            /* S3 = 32-bit data */
+       etype = '7';            /* S7 = 32-bit end */
+    }
+
+    /* Write head record */
+    write_srecord(0, 2, 0, '0', NULL);
+
+    /* Write the progbits sections to the output file. */
+    list_for_each(s, sections) {
+       /* Skip non-progbits sections */
+       if (!(s->flags & TYPE_PROGBITS))
+           continue;
+       /* Skip zero-length sections */
+       if (s->length == 0)
+            continue;
+
+       addr   = s->start;
+       length = s->length;
+       saa_rewind(s->contents);
+
+       while (length) {
+           chunk = 32 - (addr & 31);
+           if (length < chunk)
+               chunk = length;
+
+           saa_rnbytes(s->contents, buf, chunk);
+           write_srecord(chunk, alen, (uint32_t)addr, dtype, buf);
+
+           addr += chunk;
+           length -= chunk;
+       }
+    }
+
+    /* Write closing record */
+    write_srecord(0, alen, 0, etype, NULL);
+}
+
+
+struct ofmt of_bin = {
+    "flat-form binary files (e.g. DOS .COM, .SYS)",
+    "bin",
+    0,
+    null_debug_arr,
+    &null_debug_form,
+    bin_stdmac,
+    bin_init,
+    bin_set_info,
+    bin_out,
+    bin_deflabel,
+    bin_secname,
+    bin_segbase,
+    bin_directive,
+    bin_filename,
+    bin_cleanup
+};
+
+struct ofmt of_ith = {
+    "Intel hex",
+    "ith",
+    OFMT_TEXT,
+    null_debug_arr,
+    &null_debug_form,
+    bin_stdmac,
+    ith_init,
+    bin_set_info,
+    bin_out,
+    bin_deflabel,
+    bin_secname,
+    bin_segbase,
+    bin_directive,
+    ith_filename,
+    bin_cleanup
+};
+
+struct ofmt of_srec = {
+    "Motorola S-records",
+    "srec",
+    0,
+    null_debug_arr,
+    &null_debug_form,
+    bin_stdmac,
+    srec_init,
+    bin_set_info,
+    bin_out,
+    bin_deflabel,
+    bin_secname,
+    bin_segbase,
+    bin_directive,
+    srec_filename,
+    bin_cleanup
+};
+
+#endif                          /* #ifdef OF_BIN */
diff --git a/output/outbin.mac b/output/outbin.mac
new file mode 100644 (file)
index 0000000..be7fefa
--- /dev/null
@@ -0,0 +1,40 @@
+;; --------------------------------------------------------------------------
+;;   
+;;   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.
+;;
+;; --------------------------------------------------------------------------
+
+OUT: bin
+%define __SECT__ [section .text]
+%imacro org 1+.nolist
+[org %1]
+%endmacro
+%macro __NASM_CDecl__ 1
+%endmacro
diff --git a/output/outcoff.c b/output/outcoff.c
new file mode 100644 (file)
index 0000000..5dc4023
--- /dev/null
@@ -0,0 +1,1065 @@
+/* ----------------------------------------------------------------------- *
+ *   
+ *   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.
+ *
+ * ----------------------------------------------------------------------- */
+
+/* 
+ * outcoff.c   output routines for the Netwide Assembler to produce
+ *             COFF object files (for DJGPP and Win32)
+ */
+
+#include "compiler.h"
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <ctype.h>
+#include <time.h>
+#include <inttypes.h>
+
+#include "nasm.h"
+#include "nasmlib.h"
+#include "saa.h"
+#include "raa.h"
+#include "eval.h"
+#include "output/outform.h"
+#include "output/outlib.h"
+
+#if defined(OF_COFF) || defined(OF_WIN32) || defined(OF_WIN64)
+
+/*
+ * Notes on COFF:
+ *
+ * (0) When I say `standard COFF' below, I mean `COFF as output and
+ * used by DJGPP'. I assume DJGPP gets it right.
+ *
+ * (1) Win32 appears to interpret the term `relative relocation'
+ * differently from standard COFF. Standard COFF understands a
+ * relative relocation to mean that during relocation you add the
+ * address of the symbol you're referencing, and subtract the base
+ * address of the section you're in. Win32 COFF, by contrast, seems
+ * to add the address of the symbol and then subtract the address
+ * of THE BYTE AFTER THE RELOCATED DWORD. Hence the two formats are
+ * subtly incompatible.
+ *
+ * (2) Win32 doesn't bother putting any flags in the header flags
+ * field (at offset 0x12 into the file).
+ *
+ * (3) Win32 uses some extra flags into the section header table:
+ * it defines flags 0x80000000 (writable), 0x40000000 (readable)
+ * and 0x20000000 (executable), and uses them in the expected
+ * combinations. It also defines 0x00100000 through 0x00700000 for
+ * section alignments of 1 through 64 bytes.
+ *
+ * (4) Both standard COFF and Win32 COFF seem to use the DWORD
+ * field directly after the section name in the section header
+ * table for something strange: they store what the address of the
+ * section start point _would_ be, if you laid all the sections end
+ * to end starting at zero. Dunno why. Microsoft's documentation
+ * lists this field as "Virtual Size of Section", which doesn't
+ * seem to fit at all. In fact, Win32 even includes non-linked
+ * sections such as .drectve in this calculation.
+ *
+ * Newer versions of MASM seem to have changed this to be zero, and
+ * that apparently matches the COFF spec, so go with that.
+ *
+ * (5) Standard COFF does something very strange to common
+ * variables: the relocation point for a common variable is as far
+ * _before_ the variable as its size stretches out _after_ it. So
+ * we must fix up common variable references. Win32 seems to be
+ * sensible on this one.
+ */
+
+/* Flag which version of COFF we are currently outputting. */
+static bool win32, win64;
+
+static int32_t imagebase_sect;
+#define WRT_IMAGEBASE "..imagebase"
+
+struct Reloc {
+    struct Reloc *next;
+    int32_t address;           /* relative to _start_ of section */
+    int32_t symbol;            /* symbol number */
+    enum {
+        SECT_SYMBOLS,
+        ABS_SYMBOL,
+        REAL_SYMBOLS
+    } symbase;                  /* relocation for symbol number :) */
+    int16_t type;
+};
+
+/* possible values for Reloc->type */
+#define IMAGE_REL_AMD64_ADDR64         0x0001
+#define IMAGE_REL_AMD64_ADDR32         0x0002
+#define IMAGE_REL_AMD64_ADDR32NB       0x0003
+#define IMAGE_REL_AMD64_REL32          0x0004
+#define IMAGE_REL_I386_DIR32           0x0006
+#define IMAGE_REL_I386_DIR32NB         0x0007
+#define IMAGE_REL_I386_REL32           0x0014
+
+struct Symbol {
+    char name[9];
+    int32_t strpos;            /* string table position of name */
+    int32_t value;             /* address, or COMMON variable size */
+    int section;                /* section number where it's defined
+                                 * - in COFF codes, not NASM codes */
+    bool is_global;              /* is it a global symbol or not? */
+    int16_t type;              /* 0 - notype, 0x20 - function */
+    int32_t namlen;            /* full name length */
+};
+
+static char coff_infile[FILENAME_MAX];
+
+struct Section {
+    struct SAA *data;
+    uint32_t len;
+    int nrelocs;
+    int32_t index;
+    struct Reloc *head, **tail;
+    uint32_t flags;        /* section flags */
+    char name[9];
+    int32_t pos, relpos;
+};
+
+#define TEXT_FLAGS ((win32 | win64) ? 0x60500020L : 0x20L)
+#define DATA_FLAGS ((win32 | win64) ? 0xC0300040L : 0x40L)
+#define BSS_FLAGS ((win32 | win64) ? 0xC0300080L : 0x80L)
+#define INFO_FLAGS 0x00100A00L
+#define RDATA_FLAGS ((win32 | win64) ? 0x40400040L : 0x40L)
+
+#define SECT_DELTA 32
+static struct Section **sects;
+static int nsects, sectlen;
+
+static struct SAA *syms;
+static uint32_t nsyms;
+
+static int32_t def_seg;
+
+static int initsym;
+
+static struct RAA *bsym, *symval;
+
+static struct SAA *strs;
+static uint32_t strslen;
+
+static void coff_gen_init(void);
+static void coff_sect_write(struct Section *, const uint8_t *,
+                            uint32_t);
+static void coff_write(void);
+static void coff_section_header(char *, int32_t, int32_t, int32_t, int32_t, int, int32_t);
+static void coff_write_relocs(struct Section *);
+static void coff_write_symbols(void);
+
+static void coff_win32_init(void)
+{
+    win32 = true;
+    win64 = false;
+    coff_gen_init();
+}
+
+static void coff_win64_init(void)
+{
+    maxbits = 64;
+    win32 = false;
+    win64 = true;
+    coff_gen_init();
+    imagebase_sect = seg_alloc()+1;
+    define_label(WRT_IMAGEBASE, imagebase_sect, 0, NULL, false, false);
+}
+
+static void coff_std_init(void)
+{
+    win32 = win64 = false;
+    coff_gen_init();
+}
+
+static void coff_gen_init(void)
+{
+
+    sects = NULL;
+    nsects = sectlen = 0;
+    syms = saa_init(sizeof(struct Symbol));
+    nsyms = 0;
+    bsym = raa_init();
+    symval = raa_init();
+    strs = saa_init(1);
+    strslen = 0;
+    def_seg = seg_alloc();
+}
+
+static void coff_cleanup(int debuginfo)
+{
+    struct Reloc *r;
+    int i;
+
+    (void)debuginfo;
+
+    coff_write();
+    for (i = 0; i < nsects; i++) {
+        if (sects[i]->data)
+            saa_free(sects[i]->data);
+        while (sects[i]->head) {
+            r = sects[i]->head;
+            sects[i]->head = sects[i]->head->next;
+            nasm_free(r);
+        }
+        nasm_free(sects[i]);
+    }
+    nasm_free(sects);
+    saa_free(syms);
+    raa_free(bsym);
+    raa_free(symval);
+    saa_free(strs);
+}
+
+static int coff_make_section(char *name, uint32_t flags)
+{
+    struct Section *s;
+
+    s = nasm_malloc(sizeof(*s));
+
+    if (flags != BSS_FLAGS)
+        s->data = saa_init(1);
+    else
+        s->data = NULL;
+    s->head = NULL;
+    s->tail = &s->head;
+    s->len = 0;
+    s->nrelocs = 0;
+    if (!strcmp(name, ".text"))
+        s->index = def_seg;
+    else
+        s->index = seg_alloc();
+    strncpy(s->name, name, 8);
+    s->name[8] = '\0';
+    s->flags = flags;
+
+    if (nsects >= sectlen) {
+       sectlen += SECT_DELTA;
+        sects = nasm_realloc(sects, sectlen * sizeof(*sects));
+    }
+    sects[nsects++] = s;
+
+    return nsects - 1;
+}
+
+static int32_t coff_section_names(char *name, int pass, int *bits)
+{
+    char *p;
+    uint32_t flags, align_and = ~0L, align_or = 0L;
+    int i;
+
+    /*
+     * Set default bits.
+     */
+    if (!name) {
+        if(win64)
+            *bits = 64;
+        else
+            *bits = 32;
+    }
+
+    if (!name)
+        return def_seg;
+
+    p = name;
+    while (*p && !nasm_isspace(*p))
+        p++;
+    if (*p)
+        *p++ = '\0';
+    if (strlen(name) > 8) {
+        nasm_error(ERR_WARNING, "COFF section names limited to 8 characters:"
+              " truncating");
+        name[8] = '\0';
+    }
+    flags = 0;
+
+    while (*p && nasm_isspace(*p))
+        p++;
+    while (*p) {
+        char *q = p;
+        while (*p && !nasm_isspace(*p))
+            p++;
+        if (*p)
+            *p++ = '\0';
+        while (*p && nasm_isspace(*p))
+            p++;
+
+        if (!nasm_stricmp(q, "code") || !nasm_stricmp(q, "text")) {
+            flags = TEXT_FLAGS;
+        } else if (!nasm_stricmp(q, "data")) {
+            flags = DATA_FLAGS;
+        } else if (!nasm_stricmp(q, "rdata")) {
+            if (win32 | win64)
+                flags = RDATA_FLAGS;
+            else {
+                flags = DATA_FLAGS;     /* gotta do something */
+                nasm_error(ERR_NONFATAL, "standard COFF does not support"
+                      " read-only data sections");
+            }
+        } else if (!nasm_stricmp(q, "bss")) {
+            flags = BSS_FLAGS;
+        } else if (!nasm_stricmp(q, "info")) {
+            if (win32 | win64)
+                flags = INFO_FLAGS;
+            else {
+                flags = DATA_FLAGS;     /* gotta do something */
+                nasm_error(ERR_NONFATAL, "standard COFF does not support"
+                      " informational sections");
+            }
+        } else if (!nasm_strnicmp(q, "align=", 6)) {
+            if (!(win32 | win64))
+                nasm_error(ERR_NONFATAL, "standard COFF does not support"
+                      " section alignment specification");
+            else {
+                if (q[6 + strspn(q + 6, "0123456789")])
+                    nasm_error(ERR_NONFATAL,
+                          "argument to `align' is not numeric");
+                else {
+                    unsigned int align = atoi(q + 6);
+                    if (!align || ((align - 1) & align))
+                        nasm_error(ERR_NONFATAL, "argument to `align' is not a"
+                              " power of two");
+                    else if (align > 64)
+                        nasm_error(ERR_NONFATAL, "Win32 cannot align sections"
+                              " to better than 64-byte boundaries");
+                    else {
+                        align_and = ~0x00F00000L;
+                        align_or = (align == 1 ? 0x00100000L :
+                                    align == 2 ? 0x00200000L :
+                                    align == 4 ? 0x00300000L :
+                                    align == 8 ? 0x00400000L :
+                                    align == 16 ? 0x00500000L :
+                                    align ==
+                                    32 ? 0x00600000L : 0x00700000L);
+                    }
+                }
+            }
+        }
+    }
+
+    for (i = 0; i < nsects; i++)
+        if (!strcmp(name, sects[i]->name))
+            break;
+    if (i == nsects) {
+        if (!flags) {
+            if (!strcmp(name, ".data"))
+                flags = DATA_FLAGS;
+            else if (!strcmp(name, ".rdata"))
+                flags = RDATA_FLAGS;
+            else if (!strcmp(name, ".bss"))
+                flags = BSS_FLAGS;
+           else if (win64 && !strcmp(name, ".pdata"))
+               flags = 0x40300040; /* rdata align=4 */
+           else if (win64 && !strcmp(name, ".xdata"))
+               flags = 0x40400040; /* rdate align=8 */
+            else
+                flags = TEXT_FLAGS;
+        }
+        i = coff_make_section(name, flags);
+        if (flags)
+            sects[i]->flags = flags;
+        sects[i]->flags &= align_and;
+        sects[i]->flags |= align_or;
+    } else if (pass == 1) {
+        if (flags)
+            nasm_error(ERR_WARNING, "section attributes ignored on"
+                  " redeclaration of section `%s'", name);
+    }
+
+    return sects[i]->index;
+}
+
+static void coff_deflabel(char *name, int32_t segment, int64_t offset,
+                          int is_global, char *special)
+{
+    int pos = strslen + 4;
+    struct Symbol *sym;
+
+    if (special)
+        nasm_error(ERR_NONFATAL, "COFF format does not support any"
+              " special symbol types");
+
+    if (name[0] == '.' && name[1] == '.' && name[2] != '@') {
+       if (strcmp(name,WRT_IMAGEBASE))
+            nasm_error(ERR_NONFATAL, "unrecognized special symbol `%s'", name);
+        return;
+    }
+
+    if (strlen(name) > 8) {
+       size_t nlen = strlen(name)+1;
+        saa_wbytes(strs, name, nlen);
+       strslen += nlen;
+    } else
+        pos = -1;
+
+    sym = saa_wstruct(syms);
+
+    sym->strpos = pos;
+    sym->namlen = strlen(name);
+    if (pos == -1)
+        strcpy(sym->name, name);
+    sym->is_global = !!is_global;
+    sym->type = 0;             /* Default to T_NULL (no type) */
+    if (segment == NO_SEG)
+        sym->section = -1;      /* absolute symbol */
+    else {
+        int i;
+        sym->section = 0;
+        for (i = 0; i < nsects; i++)
+            if (segment == sects[i]->index) {
+                sym->section = i + 1;
+                break;
+            }
+        if (!sym->section)
+            sym->is_global = true;
+    }
+    if (is_global == 2)
+        sym->value = offset;
+    else
+        sym->value = (sym->section == 0 ? 0 : offset);
+
+    /*
+     * define the references from external-symbol segment numbers
+     * to these symbol records.
+     */
+    if (sym->section == 0) {
+        bsym = raa_write(bsym, segment, nsyms);
+    }
+
+    if (segment != NO_SEG)
+        symval = raa_write(symval, segment, sym->section ? 0 : sym->value);
+
+    nsyms++;
+}
+
+static int32_t coff_add_reloc(struct Section *sect, int32_t segment,
+                               int16_t type)
+{
+    struct Reloc *r;
+
+    r = *sect->tail = nasm_malloc(sizeof(struct Reloc));
+    sect->tail = &r->next;
+    r->next = NULL;
+
+    r->address = sect->len;
+    if (segment == NO_SEG)
+        r->symbol = 0, r->symbase = ABS_SYMBOL;
+    else {
+        int i;
+        r->symbase = REAL_SYMBOLS;
+        for (i = 0; i < nsects; i++)
+            if (segment == sects[i]->index) {
+                r->symbol = i * 2;
+                r->symbase = SECT_SYMBOLS;
+                break;
+            }
+        if (r->symbase == REAL_SYMBOLS)
+            r->symbol = raa_read(bsym, segment);
+    }
+    r->type = type;
+
+    sect->nrelocs++;
+
+    /*
+     * Return the fixup for standard COFF common variables.
+     */
+    if (r->symbase == REAL_SYMBOLS && !(win32 | win64))
+        return raa_read(symval, segment);
+    else
+        return 0;
+}
+
+static void coff_out(int32_t segto, const void *data,
+                    enum out_type type, uint64_t size,
+                     int32_t segment, int32_t wrt)
+{
+    struct Section *s;
+    uint8_t mydata[8], *p;
+    int i;
+
+    if (wrt != NO_SEG && !win64) {
+        wrt = NO_SEG;           /* continue to do _something_ */
+        nasm_error(ERR_NONFATAL, "WRT not supported by COFF output formats");
+    }
+
+    /*
+     * handle absolute-assembly (structure definitions)
+     */
+    if (segto == NO_SEG) {
+        if (type != OUT_RESERVE)
+            nasm_error(ERR_NONFATAL, "attempt to assemble code in [ABSOLUTE]"
+                  " space");
+        return;
+    }
+
+    s = NULL;
+    for (i = 0; i < nsects; i++)
+        if (segto == sects[i]->index) {
+            s = sects[i];
+            break;
+        }
+    if (!s) {
+        int tempint;            /* ignored */
+        if (segto != coff_section_names(".text", 2, &tempint))
+            nasm_error(ERR_PANIC, "strange segment conditions in COFF driver");
+        else
+            s = sects[nsects - 1];
+    }
+
+    /* magically default to 'wrt ..imagebase' in .pdata and .xdata */
+    if (win64 && wrt == NO_SEG &&
+       (!strcmp(s->name,".pdata") || !strcmp(s->name,".xdata")))
+       wrt = imagebase_sect;
+
+    if (!s->data && type != OUT_RESERVE) {
+        nasm_error(ERR_WARNING, "attempt to initialize memory in"
+              " BSS section `%s': ignored", s->name);
+        s->len += realsize(type, size);
+        return;
+    }
+
+    if (type == OUT_RESERVE) {
+        if (s->data) {
+            nasm_error(ERR_WARNING, "uninitialised space declared in"
+                  " non-BSS section `%s': zeroing", s->name);
+            coff_sect_write(s, NULL, size);
+        } else
+            s->len += size;
+    } else if (type == OUT_RAWDATA) {
+        if (segment != NO_SEG)
+            nasm_error(ERR_PANIC, "OUT_RAWDATA with other than NO_SEG");
+        coff_sect_write(s, data, size);
+    } else if (type == OUT_ADDRESS) {
+        if (!(win64)) {
+            if (size != 4 && (segment != NO_SEG || wrt != NO_SEG))
+                nasm_error(ERR_NONFATAL, "COFF format does not support non-32-bit"
+                      " relocations");
+            else {
+                int32_t fix = 0;
+                if (segment != NO_SEG || wrt != NO_SEG) {
+                    if (wrt != NO_SEG) {
+                        nasm_error(ERR_NONFATAL, "COFF format does not support"
+                              " WRT types");
+                    } else if (segment % 2) {
+                        nasm_error(ERR_NONFATAL, "COFF format does not support"
+                              " segment base references");
+                    } else
+                        fix = coff_add_reloc(s, segment, IMAGE_REL_I386_DIR32);
+                }
+                p = mydata;
+                WRITELONG(p, *(int64_t *)data + fix);
+                coff_sect_write(s, mydata, size);
+            }
+        } else {
+            int32_t fix = 0;
+            p = mydata;
+            if (size == 8) {
+               if (wrt == imagebase_sect) {
+                   nasm_error(ERR_NONFATAL, "operand size mismatch: 'wrt "
+                       WRT_IMAGEBASE "' is a 32-bit operand");
+               }
+                fix = coff_add_reloc(s, segment, IMAGE_REL_AMD64_ADDR64);
+                WRITEDLONG(p, *(int64_t *)data + fix);
+                coff_sect_write(s, mydata, size);
+            } else {
+                fix = coff_add_reloc(s, segment,
+                       wrt == imagebase_sect ? IMAGE_REL_AMD64_ADDR32NB:
+                                               IMAGE_REL_AMD64_ADDR32);
+                WRITELONG(p, *(int64_t *)data + fix);
+                coff_sect_write(s, mydata, size);
+            }
+        }
+    } else if (type == OUT_REL2ADR) {
+        nasm_error(ERR_NONFATAL, "COFF format does not support 16-bit"
+              " relocations");
+    } else if (type == OUT_REL4ADR) {
+        if (segment == segto && !(win64))  /* Acceptable for RIP-relative */
+            nasm_error(ERR_PANIC, "intra-segment OUT_REL4ADR");
+        else if (segment == NO_SEG && win32)
+            nasm_error(ERR_NONFATAL, "Win32 COFF does not correctly support"
+                  " relative references to absolute addresses");
+        else {
+            int32_t fix = 0;
+            if (segment != NO_SEG && segment % 2) {
+                nasm_error(ERR_NONFATAL, "COFF format does not support"
+                      " segment base references");
+            } else
+                fix = coff_add_reloc(s, segment,
+                       win64 ? IMAGE_REL_AMD64_REL32 : IMAGE_REL_I386_REL32);
+            p = mydata;
+            if (win32 | win64) {
+                WRITELONG(p, *(int64_t *)data + 4 - size + fix);
+            } else {
+                WRITELONG(p, *(int64_t *)data - (size + s->len) + fix);
+            }
+            coff_sect_write(s, mydata, 4L);
+        }
+
+    }
+}
+
+static void coff_sect_write(struct Section *sect,
+                            const uint8_t *data, uint32_t len)
+{
+    saa_wbytes(sect->data, data, len);
+    sect->len += len;
+}
+
+typedef struct tagString {
+    struct tagString *next;
+    int len;
+    char *String;
+} STRING;
+
+#define EXPORT_SECTION_NAME ".drectve"
+#define EXPORT_SECTION_FLAGS INFO_FLAGS
+/*
+#define EXPORT_SECTION_NAME ".text"
+#define EXPORT_SECTION_FLAGS TEXT_FLAGS
+*/
+
+static STRING *Exports = NULL;
+static struct Section *directive_sec;
+void AddExport(char *name)
+{
+    STRING *rvp = Exports, *newS;
+
+    newS = (STRING *) nasm_malloc(sizeof(STRING));
+    newS->len = strlen(name);
+    newS->next = NULL;
+    newS->String = (char *)nasm_malloc(newS->len + 1);
+    strcpy(newS->String, name);
+    if (rvp == NULL) {
+        int i;
+
+        for (i = 0; i < nsects; i++) {
+            if (!strcmp(EXPORT_SECTION_NAME, sects[i]->name))
+                break;
+       }
+
+        if (i == nsects)
+           i = coff_make_section(EXPORT_SECTION_NAME, EXPORT_SECTION_FLAGS);
+
+       directive_sec = sects[i];
+        Exports = newS;
+    } else {
+        while (rvp->next) {
+            if (!strcmp(rvp->String, name))
+                return;
+            rvp = rvp->next;
+        }
+        rvp->next = newS;
+    }
+}
+
+static void BuildExportTable(STRING **rvp)
+{
+    STRING *p, *t;
+
+    if (!rvp || !*rvp)
+        return;
+
+    list_for_each_safe(p, t, *rvp) {
+        coff_sect_write(directive_sec, (uint8_t *)"-export:", 8);
+        coff_sect_write(directive_sec, (uint8_t *)p->String, p->len);
+        coff_sect_write(directive_sec, (uint8_t *)" ", 1);
+        nasm_free(p->String);
+        nasm_free(p);
+    }
+
+    *rvp = NULL;
+}
+
+static int coff_directives(enum directives directive, char *value, int pass)
+{
+    switch (directive) {
+    case D_EXPORT:
+    {
+        char *q, *name;
+
+        if (pass == 2)
+            return 1;           /* ignore in pass two */
+        name = q = value;
+        while (*q && !nasm_isspace(*q))
+            q++;
+        if (nasm_isspace(*q)) {
+            *q++ = '\0';
+            while (*q && nasm_isspace(*q))
+                q++;
+        }
+
+        if (!*name) {
+            nasm_error(ERR_NONFATAL, "`export' directive requires export name");
+            return 1;
+        }
+        if (*q) {
+            nasm_error(ERR_NONFATAL, "unrecognized export qualifier `%s'", q);
+            return 1;
+        }
+        AddExport(name);
+        return 1;
+    }
+    case D_SAFESEH:
+    {
+       static int sxseg=-1;
+       int i;
+
+       if (!win32)             /* Only applicable for -f win32 */
+           return 0;
+
+       if (sxseg==-1)
+       {   for (i = 0; i < nsects; i++)
+               if (!strcmp(".sxdata",sects[i]->name))
+                   break;
+           if (i == nsects)
+               sxseg = coff_make_section(".sxdata",0x200);
+           else
+               sxseg = i;
+       }
+       /* pass0 == 2 is the only time when the full set of symbols are
+          guaranteed to be present; it is the final output pass. */
+       if (pass0 == 2) {
+           uint32_t n;
+           saa_rewind(syms);
+           for (n = 0; n < nsyms; n++) {
+               struct Symbol *sym = saa_rstruct(syms);
+               bool equals;
+
+               /* sym->strpos is biased by 4, because symbol
+                * table is prefixed with table length */
+               if (sym->strpos >=4) {
+                   char *name = nasm_malloc(sym->namlen+1);
+                   saa_fread(strs, sym->strpos-4, name, sym->namlen);
+                   name[sym->namlen] = '\0';
+                   equals = !strcmp(value,name);
+                   nasm_free(name);
+               }
+               else
+                   equals = !strcmp(value,sym->name);
+
+               if (equals) {
+                   /* this value arithmetics effectively reflects
+                    * initsym in coff_write(): 2 for file, 1 for
+                    * .absolute and two per each section */
+                   unsigned char value[4],*p=value;
+                   WRITELONG(p,n + 2 + 1 + nsects*2);
+                   coff_sect_write(sects[sxseg],value,4);
+                   sym->type = 0x20;
+                   break;
+               }
+           }
+           if (n == nsyms) {
+               nasm_error(ERR_NONFATAL,
+                     "`safeseh' directive requires valid symbol");
+           }
+       }
+       return 1;
+    }
+    default:
+       return 0;
+    }
+}
+
+static void coff_write(void)
+{
+    int32_t pos, sympos, vsize;
+    int i;
+
+    /* fill in the .drectve section with -export's */
+    BuildExportTable(&Exports);
+
+    if (win32) {
+       /* add default value for @feat.00, this allows to 'link /safeseh' */
+       uint32_t n;
+
+       saa_rewind(syms);
+       for (n = 0; n < nsyms; n++) {
+            struct Symbol *sym = saa_rstruct(syms);
+           if (sym->strpos == -1 && !strcmp("@feat.00",sym->name))
+               break;
+       }
+       if (n == nsyms)
+           coff_deflabel("@feat.00",NO_SEG,1,0,NULL);
+    }
+
+    /*
+     * Work out how big the file will get. Calculate the start of
+     * the `real' symbols at the same time.
+     */
+    pos = 0x14 + 0x28 * nsects;
+    initsym = 3;                /* two for the file, one absolute */
+    for (i = 0; i < nsects; i++) {
+        if (sects[i]->data) {
+            sects[i]->pos = pos;
+            pos += sects[i]->len;
+            sects[i]->relpos = pos;
+            pos += 10 * sects[i]->nrelocs;
+        } else
+            sects[i]->pos = sects[i]->relpos = 0L;
+        initsym += 2;           /* two for each section */
+    }
+    sympos = pos;
+
+    /*
+     * Output the COFF header.
+     */
+    if (win64)
+        fwriteint16_t(0x8664, ofile);  /* MACHINE_x86-64 */
+    else
+        fwriteint16_t(0x014C, ofile);  /* MACHINE_i386 */
+    fwriteint16_t(nsects, ofile); /* number of sections */
+    fwriteint32_t(time(NULL), ofile);      /* time stamp */
+    fwriteint32_t(sympos, ofile);
+    fwriteint32_t(nsyms + initsym, ofile);
+    fwriteint16_t(0, ofile);      /* no optional header */
+    /* Flags: 32-bit, no line numbers. Win32 doesn't even bother with them. */
+    fwriteint16_t((win32 | win64) ? 0 : 0x104, ofile);
+
+    /*
+     * Output the section headers.
+     */
+    vsize = 0L;
+    for (i = 0; i < nsects; i++) {
+        coff_section_header(sects[i]->name, vsize, sects[i]->len,
+                            sects[i]->pos, sects[i]->relpos,
+                            sects[i]->nrelocs, sects[i]->flags);
+        vsize += sects[i]->len;
+    }
+
+    /*
+     * Output the sections and their relocations.
+     */
+    for (i = 0; i < nsects; i++)
+        if (sects[i]->data) {
+            saa_fpwrite(sects[i]->data, ofile);
+            coff_write_relocs(sects[i]);
+        }
+
+    /*
+     * Output the symbol and string tables.
+     */
+    coff_write_symbols();
+    fwriteint32_t(strslen + 4, ofile);     /* length includes length count */
+    saa_fpwrite(strs, ofile);
+}
+
+static void coff_section_header(char *name, int32_t vsize,
+                                int32_t datalen, int32_t datapos,
+                                int32_t relpos, int nrelocs, int32_t flags)
+{
+    char padname[8];
+
+    (void)vsize;
+
+    memset(padname, 0, 8);
+    strncpy(padname, name, 8);
+    fwrite(padname, 8, 1, ofile);
+    fwriteint32_t(0, ofile);   /* Virtual size field - set to 0 or vsize */
+    fwriteint32_t(0L, ofile);      /* RVA/offset - we ignore */
+    fwriteint32_t(datalen, ofile);
+    fwriteint32_t(datapos, ofile);
+    fwriteint32_t(relpos, ofile);
+    fwriteint32_t(0L, ofile);      /* no line numbers - we don't do 'em */
+    fwriteint16_t(nrelocs, ofile);
+    fwriteint16_t(0, ofile);      /* again, no line numbers */
+    fwriteint32_t(flags, ofile);
+}
+
+static void coff_write_relocs(struct Section *s)
+{
+    struct Reloc *r;
+
+    for (r = s->head; r; r = r->next) {
+        fwriteint32_t(r->address, ofile);
+        fwriteint32_t(r->symbol + (r->symbase == REAL_SYMBOLS ? initsym :
+                                r->symbase == ABS_SYMBOL ? initsym - 1 :
+                                r->symbase == SECT_SYMBOLS ? 2 : 0),
+                   ofile);
+       fwriteint16_t(r->type, ofile);
+    }
+}
+
+static void coff_symbol(char *name, int32_t strpos, int32_t value,
+                        int section, int type, int storageclass, int aux)
+{
+    char padname[8];
+
+    if (name) {
+        memset(padname, 0, 8);
+        strncpy(padname, name, 8);
+        fwrite(padname, 8, 1, ofile);
+    } else {
+        fwriteint32_t(0, ofile);
+        fwriteint32_t(strpos, ofile);
+    }
+    fwriteint32_t(value, ofile);
+    fwriteint16_t(section, ofile);
+    fwriteint16_t(type, ofile);
+    fputc(storageclass, ofile);
+    fputc(aux, ofile);
+}
+
+static void coff_write_symbols(void)
+{
+    char filename[18];
+    uint32_t i;
+
+    /*
+     * The `.file' record, and the file name auxiliary record.
+     */
+    coff_symbol(".file", 0L, 0L, -2, 0, 0x67, 1);
+    memset(filename, 0, 18);
+    strncpy(filename, coff_infile, 18);
+    fwrite(filename, 18, 1, ofile);
+
+    /*
+     * The section records, with their auxiliaries.
+     */
+    memset(filename, 0, 18);    /* useful zeroed buffer */
+
+    for (i = 0; i < (uint32_t) nsects; i++) {
+        coff_symbol(sects[i]->name, 0L, 0L, i + 1, 0, 3, 1);
+        fwriteint32_t(sects[i]->len, ofile);
+        fwriteint16_t(sects[i]->nrelocs, ofile);
+        fwrite(filename, 12, 1, ofile);
+    }
+
+    /*
+     * The absolute symbol, for relative-to-absolute relocations.
+     */
+    coff_symbol(".absolut", 0L, 0L, -1, 0, 3, 0);
+
+    /*
+     * The real symbols.
+     */
+    saa_rewind(syms);
+    for (i = 0; i < nsyms; i++) {
+        struct Symbol *sym = saa_rstruct(syms);
+        coff_symbol(sym->strpos == -1 ? sym->name : NULL,
+                    sym->strpos, sym->value, sym->section,
+                    sym->type, sym->is_global ? 2 : 3, 0);
+    }
+}
+
+static int32_t coff_segbase(int32_t segment)
+{
+    return segment;
+}
+
+static void coff_std_filename(char *inname, char *outname)
+{
+    strcpy(coff_infile, inname);
+    standard_extension(inname, outname, ".o");
+}
+
+static void coff_win32_filename(char *inname, char *outname)
+{
+    strcpy(coff_infile, inname);
+    standard_extension(inname, outname, ".obj");
+}
+
+extern macros_t coff_stdmac[];
+
+static int coff_set_info(enum geninfo type, char **val)
+{
+    (void)type;
+    (void)val;
+    return 0;
+}
+#endif                          /* defined(OF_COFF) || defined(OF_WIN32) */
+
+#ifdef OF_COFF
+
+struct ofmt of_coff = {
+    "COFF (i386) object files (e.g. DJGPP for DOS)",
+    "coff",
+    0,
+    null_debug_arr,
+    &null_debug_form,
+    coff_stdmac,
+    coff_std_init,
+    coff_set_info,
+    coff_out,
+    coff_deflabel,
+    coff_section_names,
+    coff_segbase,
+    coff_directives,
+    coff_std_filename,
+    coff_cleanup
+};
+
+#endif
+
+#ifdef OF_WIN32
+
+struct ofmt of_win32 = {
+    "Microsoft Win32 (i386) object files",
+    "win32",
+    0,
+    null_debug_arr,
+    &null_debug_form,
+    coff_stdmac,
+    coff_win32_init,
+    coff_set_info,
+    coff_out,
+    coff_deflabel,
+    coff_section_names,
+    coff_segbase,
+    coff_directives,
+    coff_win32_filename,
+    coff_cleanup
+};
+
+#endif
+
+#ifdef OF_WIN64
+
+struct ofmt of_win64 = {
+    "Microsoft Win64 (x86-64) object files",
+    "win64",
+    0,
+    null_debug_arr,
+    &null_debug_form,
+    coff_stdmac,
+    coff_win64_init,
+    coff_set_info,
+    coff_out,
+    coff_deflabel,
+    coff_section_names,
+    coff_segbase,
+    coff_directives,
+    coff_win32_filename,
+    coff_cleanup
+};
+
+#endif
diff --git a/output/outcoff.mac b/output/outcoff.mac
new file mode 100644 (file)
index 0000000..2b8b12f
--- /dev/null
@@ -0,0 +1,43 @@
+;; --------------------------------------------------------------------------
+;;   
+;;   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.
+;;
+;; --------------------------------------------------------------------------
+
+OUT: coff win32 win64
+%define __SECT__ [section .text]
+%macro __NASM_CDecl__ 1
+%endmacro
+%imacro export 1+.nolist
+[export %1]
+%endmacro
+%imacro safeseh 1.nolist
+[safeseh %1]
+%endmacro
diff --git a/output/outdbg.c b/output/outdbg.c
new file mode 100644 (file)
index 0000000..891bc17
--- /dev/null
@@ -0,0 +1,268 @@
+/* ----------------------------------------------------------------------- *
+ *   
+ *   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.
+ *
+ * ----------------------------------------------------------------------- */
+
+/*
+ * outdbg.c    output routines for the Netwide Assembler to produce
+ *             a debugging trace
+ */
+
+#include "compiler.h"
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <ctype.h>
+#include <inttypes.h>
+
+#include "nasm.h"
+#include "nasmlib.h"
+#include "output/outform.h"
+
+#ifdef OF_DBG
+
+struct Section {
+    struct Section *next;
+    int32_t number;
+    char *name;
+} *dbgsect;
+
+struct ofmt of_dbg;
+static void dbg_init(void)
+{
+    dbgsect = NULL;
+    fprintf(ofile, "NASM Output format debug dump\n");
+}
+
+static void dbg_cleanup(int debuginfo)
+{
+    (void)debuginfo;
+    of_dbg.current_dfmt->cleanup();
+    while (dbgsect) {
+        struct Section *tmp = dbgsect;
+        dbgsect = dbgsect->next;
+        nasm_free(tmp->name);
+        nasm_free(tmp);
+    }
+}
+
+static int32_t dbg_section_names(char *name, int pass, int *bits)
+{
+    int seg;
+
+    /*
+     * We must have an initial default: let's make it 16.
+     */
+    if (!name)
+        *bits = 16;
+
+    if (!name)
+        fprintf(ofile, "section_name on init: returning %d\n",
+                seg = seg_alloc());
+    else {
+        int n = strcspn(name, " \t");
+        char *sname = nasm_strndup(name, n);
+        struct Section *s;
+
+        seg = NO_SEG;
+        for (s = dbgsect; s; s = s->next)
+            if (!strcmp(s->name, sname))
+                seg = s->number;
+
+        if (seg == NO_SEG) {
+            s = nasm_malloc(sizeof(*s));
+            s->name = sname;
+            s->number = seg = seg_alloc();
+            s->next = dbgsect;
+            dbgsect = s;
+            fprintf(ofile, "section_name %s (pass %d): returning %d\n",
+                    name, pass, seg);
+        }
+    }
+    return seg;
+}
+
+static void dbg_deflabel(char *name, int32_t segment, int64_t offset,
+                         int is_global, char *special)
+{
+    fprintf(ofile, "deflabel %s := %08"PRIx32":%016"PRIx64" %s (%d)%s%s\n",
+            name, segment, offset,
+            is_global == 2 ? "common" : is_global ? "global" : "local",
+            is_global, special ? ": " : "", special);
+}
+
+static void dbg_out(int32_t segto, const void *data,
+                   enum out_type type, uint64_t size,
+                    int32_t segment, int32_t wrt)
+{
+    int32_t ldata;
+    int id;
+
+    fprintf(ofile, "out to %"PRIx32", len = %"PRIu64": ", segto, size);
+
+    switch (type) {
+    case OUT_RESERVE:
+        fprintf(ofile, "reserved.\n");
+        break;
+    case OUT_RAWDATA:
+        fprintf(ofile, "raw data = ");
+        while (size--) {
+            id = *(uint8_t *)data;
+            data = (char *)data + 1;
+            fprintf(ofile, "%02x ", id);
+        }
+        fprintf(ofile, "\n");
+        break;
+    case OUT_ADDRESS:
+       ldata = *(int64_t *)data;
+        fprintf(ofile, "addr %08"PRIx32" (seg %08"PRIx32", wrt %08"PRIx32")\n", ldata,
+                segment, wrt);
+        break;
+    case OUT_REL2ADR:
+        fprintf(ofile, "rel2adr %04"PRIx16" (seg %08"PRIx32")\n",
+               (uint16_t)*(int64_t *)data, segment);
+        break;
+    case OUT_REL4ADR:
+        fprintf(ofile, "rel4adr %08"PRIx32" (seg %08"PRIx32")\n",
+               (uint32_t)*(int64_t *)data,
+                segment);
+        break;
+    case OUT_REL8ADR:
+        fprintf(ofile, "rel8adr %016"PRIx64" (seg %08"PRIx32")\n",
+               (uint64_t)*(int64_t *)data, segment);
+        break;
+    default:
+        fprintf(ofile, "unknown\n");
+        break;
+    }
+}
+
+static int32_t dbg_segbase(int32_t segment)
+{
+    return segment;
+}
+
+static int dbg_directive(enum directives directive, char *value, int pass)
+{
+    fprintf(ofile, "directive [%s] value [%s] (pass %d)\n",
+            directives[directive], value, pass);
+    return 1;
+}
+
+static void dbg_filename(char *inname, char *outname)
+{
+    standard_extension(inname, outname, ".dbg");
+}
+
+static int dbg_set_info(enum geninfo type, char **val)
+{
+    (void)type;
+    (void)val;
+    return 0;
+}
+
+char *types[] = {
+    "unknown", "label", "byte", "word", "dword", "float", "qword", "tbyte"
+};
+void dbgdbg_init(void)
+{
+    fprintf(ofile, "   With debug info\n");
+}
+static void dbgdbg_cleanup(void)
+{
+}
+
+static void dbgdbg_linnum(const char *lnfname, int32_t lineno, int32_t segto)
+{
+    fprintf(ofile, "dbglinenum %s(%"PRId32") := %08"PRIx32"\n",
+           lnfname, lineno, segto);
+}
+static void dbgdbg_deflabel(char *name, int32_t segment,
+                            int64_t offset, int is_global, char *special)
+{
+    fprintf(ofile, "dbglabel %s := %08"PRIx32":%016"PRIx64" %s (%d)%s%s\n",
+            name,
+            segment, offset,
+            is_global == 2 ? "common" : is_global ? "global" : "local",
+            is_global, special ? ": " : "", special);
+}
+static void dbgdbg_define(const char *type, const char *params)
+{
+    fprintf(ofile, "dbgdirective [%s] value [%s]\n", type, params);
+}
+static void dbgdbg_output(int output_type, void *param)
+{
+    (void)output_type;
+    (void)param;
+}
+static void dbgdbg_typevalue(int32_t type)
+{
+    fprintf(ofile, "new type: %s(%"PRIX32")\n",
+            types[TYM_TYPE(type) >> 3], TYM_ELEMENTS(type));
+}
+static struct dfmt debug_debug_form = {
+    "Trace of all info passed to debug stage",
+    "debug",
+    dbgdbg_init,
+    dbgdbg_linnum,
+    dbgdbg_deflabel,
+    dbgdbg_define,
+    dbgdbg_typevalue,
+    dbgdbg_output,
+    dbgdbg_cleanup,
+};
+
+static struct dfmt *debug_debug_arr[3] = {
+    &debug_debug_form,
+    &null_debug_form,
+    NULL
+};
+
+struct ofmt of_dbg = {
+    "Trace of all info passed to output stage",
+    "dbg",
+    OFMT_TEXT,
+    debug_debug_arr,
+    &debug_debug_form,
+    NULL,
+    dbg_init,
+    dbg_set_info,
+    dbg_out,
+    dbg_deflabel,
+    dbg_section_names,
+    dbg_segbase,
+    dbg_directive,
+    dbg_filename,
+    dbg_cleanup
+};
+
+#endif                          /* OF_DBG */
diff --git a/output/outelf.c b/output/outelf.c
new file mode 100644 (file)
index 0000000..e80d913
--- /dev/null
@@ -0,0 +1,67 @@
+/* ----------------------------------------------------------------------- *
+ *   
+ *   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.
+ *
+ * ----------------------------------------------------------------------- */
+
+/*
+ * Common code for outelf32 and outelf64
+ */
+
+#include "compiler.h"
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <inttypes.h>
+
+#include "nasm.h"
+#include "output/outform.h"
+
+#include "output/dwarf.h"
+#include "output/elf.h"
+#include "output/outelf.h"
+
+#if defined(OF_ELF32) || defined(OF_ELF64)
+
+const struct elf_known_section elf_known_sections[] = {
+    { ".text",    SHT_PROGBITS, SHF_ALLOC|SHF_EXECINSTR,     16 },
+    { ".rodata",  SHT_PROGBITS, SHF_ALLOC,                    4 },
+    { ".lrodata", SHT_PROGBITS, SHF_ALLOC,                    4 },
+    { ".data",    SHT_PROGBITS, SHF_ALLOC|SHF_WRITE,          4 },
+    { ".ldata",   SHT_PROGBITS, SHF_ALLOC|SHF_WRITE,          4 },
+    { ".bss",     SHT_NOBITS,   SHF_ALLOC|SHF_WRITE,          4 },
+    { ".lbss",    SHT_NOBITS,   SHF_ALLOC|SHF_WRITE,          4 },
+    { ".tdata",   SHT_PROGBITS, SHF_ALLOC|SHF_WRITE|SHF_TLS,  4 },
+    { ".tbss",    SHT_NOBITS,   SHF_ALLOC|SHF_WRITE|SHF_TLS,  4 },
+    { ".comment", SHT_PROGBITS, 0,                            1 },
+    { NULL,       SHT_PROGBITS, SHF_ALLOC,                    1 } /* default */
+};
+
+#endif /* defined(OF_ELF32) || defined(OF_ELF64) */
diff --git a/output/outelf.h b/output/outelf.h
new file mode 100644 (file)
index 0000000..93a620c
--- /dev/null
@@ -0,0 +1,95 @@
+/* ----------------------------------------------------------------------- *
+ *
+ *   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.
+ *
+ * ----------------------------------------------------------------------- */
+
+/*
+ * Internal definitions common to outelf32 and outelf64
+ */
+#ifndef OUTPUT_OUTELF_H
+#define OUTPUT_OUTELF_H
+
+#include "output/elf.h"
+
+/* symbol binding */
+#define SYM_GLOBAL      ELF32_ST_MKBIND(STB_GLOBAL)
+#define SYM_LOCAL       ELF32_ST_MKBIND(STB_LOCAL)
+
+#define GLOBAL_TEMP_BASE  0x40000000 /* bigger than any sane symbol index */
+
+#define SEG_ALIGN 16            /* alignment of sections in file */
+#define SEG_ALIGN_1 (SEG_ALIGN-1)
+
+/* this stuff is needed for the stabs debugging format */
+#define TY_STABSSYMLIN 0x40     /* ouch */
+
+/* this stuff is needed for the dwarf debugging format */
+#define TY_DEBUGSYMLIN 0x40     /* internal call to debug_out */
+
+/* Known sections with nonstandard defaults */
+struct elf_known_section {
+    const char *name;   /* Name of section */
+    int type;           /* Section type (SHT_) */
+    uint32_t flags;     /* Section flags (SHF_) */
+    uint32_t align;     /* Section alignment */
+};
+extern const struct elf_known_section elf_known_sections[];
+
+/*
+ * Special ELF sections (after the real sections but before debugging ones)
+ */
+#define sec_shstrtab            (nsects + 1)
+#define sec_symtab              (nsects + 2)
+#define sec_strtab              (nsects + 3)
+#define sec_numspecial          3
+
+/*
+ * Debugging ELF sections (last in the file)
+ */
+
+/* stabs */
+#define sec_stab                (nsections-3)
+#define sec_stabstr             (nsections-2)
+#define sec_rel_stab            (nsections-1)
+
+/* dwarf */
+#define sec_debug_aranges       (nsections-10)
+#define sec_rela_debug_aranges  (nsections-9)
+#define sec_debug_pubnames      (nsections-8)
+#define sec_debug_info          (nsections-7)
+#define sec_rela_debug_info     (nsections-6)
+#define sec_debug_abbrev        (nsections-5)
+#define sec_debug_line          (nsections-4)
+#define sec_rela_debug_line     (nsections-3)
+#define sec_debug_frame         (nsections-2)
+#define sec_debug_loc           (nsections-1)
+
+#endif /* OUTPUT_OUTELF_H */
diff --git a/output/outelf.mac b/output/outelf.mac
new file mode 100644 (file)
index 0000000..d32520f
--- /dev/null
@@ -0,0 +1,41 @@
+;; --------------------------------------------------------------------------
+;;   
+;;   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.
+;;
+;; --------------------------------------------------------------------------
+
+OUT: elf elf32 elf64
+%define __SECT__ [section .text]
+%macro __NASM_CDecl__ 1
+%define $_%1 $%1
+%endmacro
+%macro osabi 1+.nolist
+[osabi %1]
+%endmacro
diff --git a/output/outelf32.c b/output/outelf32.c
new file mode 100644 (file)
index 0000000..0ce2113
--- /dev/null
@@ -0,0 +1,2191 @@
+/* ----------------------------------------------------------------------- *
+ *
+ *   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.
+ *
+ * ----------------------------------------------------------------------- */
+
+/*
+ * outelf32.c   output routines for the Netwide Assembler to produce
+ *              ELF32 (i386 of course) object file format
+ */
+
+#include "compiler.h"
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <ctype.h>
+#include <inttypes.h>
+
+#include "nasm.h"
+#include "nasmlib.h"
+#include "saa.h"
+#include "raa.h"
+#include "stdscan.h"
+#include "eval.h"
+#include "output/outform.h"
+#include "output/outlib.h"
+#include "rbtree.h"
+
+#include "output/dwarf.h"
+#include "output/stabs.h"
+#include "output/outelf.h"
+
+#ifdef OF_ELF32
+
+/*
+ * Relocation types.
+ */
+struct Reloc {
+    struct Reloc *next;
+    int32_t address;            /* relative to _start_ of section */
+    int32_t symbol;             /*  symbol index */
+    int type;                   /* type of relocation */
+};
+
+struct Symbol {
+    struct rbtree symv;         /* symbol value and symbol rbtree */
+    int32_t strpos;             /* string table position of name */
+    int32_t section;            /* section ID of the symbol */
+    int type;                   /* symbol type */
+    int other;                  /* symbol visibility */
+    int32_t size;               /* size of symbol */
+    int32_t globnum;            /* symbol table offset if global */
+    struct Symbol *nextfwd;     /* list of unresolved-size symbols */
+    char *name;                 /* used temporarily if in above list */
+};
+
+struct Section {
+    struct SAA *data;
+    uint32_t len, size, nrelocs;
+    int32_t index;
+    int type;                   /* SHT_PROGBITS or SHT_NOBITS */
+    uint32_t align;             /* alignment: power of two */
+    uint32_t flags;             /* section flags */
+    char *name;
+    struct SAA *rel;
+    int32_t rellen;
+    struct Reloc *head, **tail;
+    struct rbtree *gsyms;       /* global symbols in section */
+};
+
+#define SECT_DELTA 32
+static struct Section **sects;
+static int nsects, sectlen;
+
+#define SHSTR_DELTA 256
+static char *shstrtab;
+static int shstrtablen, shstrtabsize;
+
+static struct SAA *syms;
+static uint32_t nlocals, nglobs, ndebugs; /* Symbol counts */
+
+static int32_t def_seg;
+
+static struct RAA *bsym;
+
+static struct SAA *strs;
+static uint32_t strslen;
+
+static struct Symbol *fwds;
+
+static char elf_module[FILENAME_MAX];
+
+static uint8_t elf_osabi = 0;   /* Default OSABI = 0 (System V or Linux) */
+static uint8_t elf_abiver = 0;  /* Current ABI version */
+
+extern struct ofmt of_elf32;
+extern struct ofmt of_elf;
+
+#define SOC(ln,aa) ln - line_base + (line_range * aa) + opcode_base
+
+static struct ELF_SECTDATA {
+    void *data;
+    int32_t len;
+    bool is_saa;
+} *elf_sects;
+static int elf_nsect, nsections;
+static int32_t elf_foffs;
+
+static void elf_write(void);
+static void elf_sect_write(struct Section *, const uint8_t *,
+                           uint32_t);
+static void elf_section_header(int, int, int, void *, bool, int32_t, int, int,
+                               int, int);
+static void elf_write_sections(void);
+static struct SAA *elf_build_symtab(int32_t *, int32_t *);
+static struct SAA *elf_build_reltab(int32_t *, struct Reloc *);
+static void add_sectname(char *, char *);
+
+struct stabentry {
+    uint32_t n_strx;
+    uint8_t n_type;
+    uint8_t n_other;
+    uint16_t n_desc;
+    uint32_t n_value;
+};
+
+struct erel {
+    int offset, info;
+};
+
+struct symlininfo {
+    int offset;
+    int section;                /* section index */
+    char *name;                 /* shallow-copied pointer of section name */
+};
+
+struct linelist {
+    struct symlininfo info;
+    int line;
+    char *filename;
+    struct linelist *next;
+    struct linelist *last;
+};
+
+struct sectlist {
+    struct SAA *psaa;
+    int section;
+    int line;
+    int offset;
+    int file;
+    struct sectlist *next;
+    struct sectlist *last;
+};
+
+/* common debug variables */
+static int currentline = 1;
+static int debug_immcall = 0;
+
+/* stabs debug variables */
+static struct linelist *stabslines = 0;
+static int numlinestabs = 0;
+static char *stabs_filename = 0;
+static uint8_t *stabbuf = 0, *stabstrbuf = 0, *stabrelbuf = 0;
+static int stablen, stabstrlen, stabrellen;
+
+/* dwarf debug variables */
+static struct linelist *dwarf_flist = 0, *dwarf_clist = 0, *dwarf_elist = 0;
+static struct sectlist *dwarf_fsect = 0, *dwarf_csect = 0, *dwarf_esect = 0;
+static int dwarf_numfiles = 0, dwarf_nsections;
+static uint8_t *arangesbuf = 0, *arangesrelbuf = 0, *pubnamesbuf = 0, *infobuf = 0,  *inforelbuf = 0,
+               *abbrevbuf = 0, *linebuf = 0, *linerelbuf = 0, *framebuf = 0, *locbuf = 0;
+static int8_t line_base = -5, line_range = 14, opcode_base = 13;
+static int arangeslen, arangesrellen, pubnameslen, infolen, inforellen,
+           abbrevlen, linelen, linerellen, framelen, loclen;
+static int32_t dwarf_infosym, dwarf_abbrevsym, dwarf_linesym;
+
+static struct dfmt df_dwarf;
+static struct dfmt df_stabs;
+static struct Symbol *lastsym;
+
+/* common debugging routines */
+static void debug32_typevalue(int32_t);
+static void debug32_deflabel(char *, int32_t, int64_t, int, char *);
+static void debug32_directive(const char *, const char *);
+
+/* stabs debugging routines */
+static void stabs32_linenum(const char *filename, int32_t linenumber, int32_t);
+static void stabs32_output(int, void *);
+static void stabs32_generate(void);
+static void stabs32_cleanup(void);
+
+/* dwarf debugging routines */
+static void dwarf32_init(void);
+static void dwarf32_linenum(const char *filename, int32_t linenumber, int32_t);
+static void dwarf32_output(int, void *);
+static void dwarf32_generate(void);
+static void dwarf32_cleanup(void);
+static void dwarf32_findfile(const char *);
+static void dwarf32_findsect(const int);
+
+/*
+ * Special NASM section numbers which are used to define ELF special
+ * symbols, which can be used with WRT to provide PIC and TLS
+ * relocation types.
+ */
+static int32_t elf_gotpc_sect, elf_gotoff_sect;
+static int32_t elf_got_sect, elf_plt_sect;
+static int32_t elf_sym_sect, elf_tlsie_sect;
+
+static void elf_init(void)
+{
+    sects = NULL;
+    nsects = sectlen = 0;
+    syms = saa_init((int32_t)sizeof(struct Symbol));
+    nlocals = nglobs = ndebugs = 0;
+    bsym = raa_init();
+    strs = saa_init(1L);
+    saa_wbytes(strs, "\0", 1L);
+    saa_wbytes(strs, elf_module, strlen(elf_module)+1);
+    strslen = 2 + strlen(elf_module);
+    shstrtab = NULL;
+    shstrtablen = shstrtabsize = 0;;
+    add_sectname("", "");
+
+    fwds = NULL;
+
+    elf_gotpc_sect = seg_alloc();
+    define_label("..gotpc", elf_gotpc_sect + 1, 0L, NULL, false, false);
+    elf_gotoff_sect = seg_alloc();
+    define_label("..gotoff", elf_gotoff_sect + 1, 0L, NULL, false, false);
+    elf_got_sect = seg_alloc();
+    define_label("..got", elf_got_sect + 1, 0L, NULL, false, false);
+    elf_plt_sect = seg_alloc();
+    define_label("..plt", elf_plt_sect + 1, 0L, NULL, false, false);
+    elf_sym_sect = seg_alloc();
+    define_label("..sym", elf_sym_sect + 1, 0L, NULL, false, false);
+    elf_tlsie_sect = seg_alloc();
+    define_label("..tlsie", elf_tlsie_sect + 1, 0L, NULL, false, false);
+
+    def_seg = seg_alloc();
+}
+
+static void elf_init_hack(void)
+{
+    of_elf32.current_dfmt = of_elf.current_dfmt; /* Sync debugging format */
+    elf_init();
+}
+
+static void elf_cleanup(int debuginfo)
+{
+    struct Reloc *r;
+    int i;
+
+    (void)debuginfo;
+
+    elf_write();
+    for (i = 0; i < nsects; i++) {
+        if (sects[i]->type != SHT_NOBITS)
+            saa_free(sects[i]->data);
+        if (sects[i]->head)
+            saa_free(sects[i]->rel);
+        while (sects[i]->head) {
+            r = sects[i]->head;
+            sects[i]->head = sects[i]->head->next;
+            nasm_free(r);
+        }
+    }
+    nasm_free(sects);
+    saa_free(syms);
+    raa_free(bsym);
+    saa_free(strs);
+    if (of_elf32.current_dfmt) {
+        of_elf32.current_dfmt->cleanup();
+    }
+}
+
+static void add_sectname(char *firsthalf, char *secondhalf)
+{
+    int len = strlen(firsthalf) + strlen(secondhalf);
+    while (shstrtablen + len + 1 > shstrtabsize)
+        shstrtab = nasm_realloc(shstrtab, (shstrtabsize += SHSTR_DELTA));
+    strcpy(shstrtab + shstrtablen, firsthalf);
+    strcat(shstrtab + shstrtablen, secondhalf);
+    shstrtablen += len + 1;
+}
+
+static int elf_make_section(char *name, int type, int flags, int align)
+{
+    struct Section *s;
+
+    s = nasm_malloc(sizeof(*s));
+
+    if (type != SHT_NOBITS)
+        s->data = saa_init(1L);
+    s->head = NULL;
+    s->tail = &s->head;
+    s->len = s->size = 0;
+    s->nrelocs = 0;
+    if (!strcmp(name, ".text"))
+        s->index = def_seg;
+    else
+        s->index = seg_alloc();
+    add_sectname("", name);
+    s->name = nasm_malloc(1 + strlen(name));
+    strcpy(s->name, name);
+    s->type = type;
+    s->flags = flags;
+    s->align = align;
+    s->gsyms = NULL;
+
+    if (nsects >= sectlen)
+        sects = nasm_realloc(sects, (sectlen += SECT_DELTA) * sizeof(*sects));
+    sects[nsects++] = s;
+
+    return nsects - 1;
+}
+
+
+static int32_t elf_section_names(char *name, int pass, int *bits)
+{
+    char *p;
+    uint32_t flags, flags_and, flags_or;
+    uint32_t align;
+    int type, i;
+
+    /*
+     * Default is 32 bits.
+     */
+    if (!name) {
+        *bits = 32;
+        return def_seg;
+    }
+
+    p = nasm_skip_word(name);
+    if (*p)
+        *p++ = '\0';
+    flags_and = flags_or = type = align = 0;
+
+    p = nasm_skip_spaces(p);
+    while (*p) {
+        char *q = p;
+        p = nasm_skip_word(p);
+        if (*p)
+            *p++ = '\0';
+        p = nasm_skip_spaces(p);
+
+        if (!nasm_strnicmp(q, "align=", 6)) {
+            align = atoi(q + 6);
+            if (align == 0)
+                align = 1;
+            if ((align - 1) & align) {  /* means it's not a power of two */
+                nasm_error(ERR_NONFATAL, "section alignment %d is not"
+                      " a power of two", align);
+                align = 1;
+            }
+        } else if (!nasm_stricmp(q, "alloc")) {
+            flags_and |= SHF_ALLOC;
+            flags_or |= SHF_ALLOC;
+        } else if (!nasm_stricmp(q, "noalloc")) {
+            flags_and |= SHF_ALLOC;
+            flags_or &= ~SHF_ALLOC;
+        } else if (!nasm_stricmp(q, "exec")) {
+            flags_and |= SHF_EXECINSTR;
+            flags_or |= SHF_EXECINSTR;
+        } else if (!nasm_stricmp(q, "noexec")) {
+            flags_and |= SHF_EXECINSTR;
+            flags_or &= ~SHF_EXECINSTR;
+        } else if (!nasm_stricmp(q, "write")) {
+            flags_and |= SHF_WRITE;
+            flags_or |= SHF_WRITE;
+        } else if (!nasm_stricmp(q, "tls")) {
+            flags_and |= SHF_TLS;
+            flags_or |= SHF_TLS;
+        } else if (!nasm_stricmp(q, "nowrite")) {
+            flags_and |= SHF_WRITE;
+            flags_or &= ~SHF_WRITE;
+        } else if (!nasm_stricmp(q, "progbits")) {
+            type = SHT_PROGBITS;
+        } else if (!nasm_stricmp(q, "nobits")) {
+            type = SHT_NOBITS;
+        } else if (pass == 1) {
+            nasm_error(ERR_WARNING, "Unknown section attribute '%s' ignored on"
+                  " declaration of section `%s'", q, name);
+        }
+    }
+
+    if (!strcmp(name, ".shstrtab") ||
+        !strcmp(name, ".symtab") ||
+        !strcmp(name, ".strtab")) {
+        nasm_error(ERR_NONFATAL, "attempt to redefine reserved section"
+              "name `%s'", name);
+        return NO_SEG;
+    }
+
+    for (i = 0; i < nsects; i++)
+        if (!strcmp(name, sects[i]->name))
+            break;
+    if (i == nsects) {
+        const struct elf_known_section *ks = elf_known_sections;
+
+        while (ks->name) {
+            if (!strcmp(name, ks->name))
+                break;
+            ks++;
+        }
+
+        type = type ? type : ks->type;
+        align = align ? align : ks->align;
+        flags = (ks->flags & ~flags_and) | flags_or;
+
+        i = elf_make_section(name, type, flags, align);
+    } else if (pass == 1) {
+          if ((type && sects[i]->type != type)
+              || (align && sects[i]->align != align)
+              || (flags_and && ((sects[i]->flags & flags_and) != flags_or)))
+            nasm_error(ERR_WARNING, "section attributes ignored on"
+                  " redeclaration of section `%s'", name);
+    }
+
+    return sects[i]->index;
+}
+
+static void elf_deflabel(char *name, int32_t segment, int64_t offset,
+                         int is_global, char *special)
+{
+    int pos = strslen;
+    struct Symbol *sym;
+    bool special_used = false;
+
+#if defined(DEBUG) && DEBUG>2
+    nasm_error(ERR_DEBUG,
+            " elf_deflabel: %s, seg=%"PRIx32", off=%"PRIx64", is_global=%d, %s\n",
+            name, segment, offset, is_global, special);
+#endif
+    if (name[0] == '.' && name[1] == '.' && name[2] != '@') {
+        /*
+         * This is a NASM special symbol. We never allow it into
+         * the ELF symbol table, even if it's a valid one. If it
+         * _isn't_ a valid one, we should barf immediately.
+         */
+        if (strcmp(name, "..gotpc") && strcmp(name, "..gotoff") &&
+            strcmp(name, "..got") && strcmp(name, "..plt") &&
+            strcmp(name, "..sym") && strcmp(name, "..tlsie"))
+            nasm_error(ERR_NONFATAL, "unrecognised special symbol `%s'", name);
+        return;
+    }
+
+    if (is_global == 3) {
+        struct Symbol **s;
+        /*
+         * Fix up a forward-reference symbol size from the first
+         * pass.
+         */
+        for (s = &fwds; *s; s = &(*s)->nextfwd)
+            if (!strcmp((*s)->name, name)) {
+                struct tokenval tokval;
+                expr *e;
+                char *p = nasm_skip_spaces(nasm_skip_word(special));
+
+                stdscan_reset();
+                stdscan_set(p);
+                tokval.t_type = TOKEN_INVALID;
+                e = evaluate(stdscan, NULL, &tokval, NULL, 1, nasm_error, NULL);
+                if (e) {
+                    if (!is_simple(e))
+                        nasm_error(ERR_NONFATAL, "cannot use relocatable"
+                              " expression as symbol size");
+                    else
+                        (*s)->size = reloc_value(e);
+                }
+
+                /*
+                 * Remove it from the list of unresolved sizes.
+                 */
+                nasm_free((*s)->name);
+                *s = (*s)->nextfwd;
+                return;
+            }
+        return;                 /* it wasn't an important one */
+    }
+
+    saa_wbytes(strs, name, (int32_t)(1 + strlen(name)));
+    strslen += 1 + strlen(name);
+
+    lastsym = sym = saa_wstruct(syms);
+
+    memset(&sym->symv, 0, sizeof(struct rbtree));
+
+    sym->strpos = pos;
+    sym->type = is_global ? SYM_GLOBAL : SYM_LOCAL;
+    sym->other = STV_DEFAULT;
+    sym->size = 0;
+    if (segment == NO_SEG)
+        sym->section = SHN_ABS;
+    else {
+        int i;
+        sym->section = SHN_UNDEF;
+        if (segment == def_seg) {
+            /* we have to be sure at least text section is there */
+            int tempint;
+            if (segment != elf_section_names(".text", 2, &tempint))
+                nasm_error(ERR_PANIC, "strange segment conditions in ELF driver");
+        }
+        for (i = 0; i < nsects; i++) {
+            if (segment == sects[i]->index) {
+                sym->section = i + 1;
+                break;
+            }
+        }
+    }
+
+    if (is_global == 2) {
+        sym->size = offset;
+        sym->symv.key = 0;
+        sym->section = SHN_COMMON;
+        /*
+         * We have a common variable. Check the special text to see
+         * if it's a valid number and power of two; if so, store it
+         * as the alignment for the common variable.
+         */
+        if (special) {
+            bool err;
+            sym->symv.key = readnum(special, &err);
+            if (err)
+                nasm_error(ERR_NONFATAL, "alignment constraint `%s' is not a"
+                      " valid number", special);
+            else if ((sym->symv.key | (sym->symv.key - 1)) != 2 * sym->symv.key - 1)
+                nasm_error(ERR_NONFATAL, "alignment constraint `%s' is not a"
+                      " power of two", special);
+        }
+        special_used = true;
+    } else
+        sym->symv.key = (sym->section == SHN_UNDEF ? 0 : offset);
+
+    if (sym->type == SYM_GLOBAL) {
+        /*
+         * If sym->section == SHN_ABS, then the first line of the
+         * else section would cause a core dump, because its a reference
+         * beyond the end of the section array.
+         * This behaviour is exhibited by this code:
+         *     GLOBAL crash_nasm
+         *     crash_nasm equ 0
+         * To avoid such a crash, such requests are silently discarded.
+         * This may not be the best solution.
+         */
+        if (sym->section == SHN_UNDEF || sym->section == SHN_COMMON) {
+            bsym = raa_write(bsym, segment, nglobs);
+        } else if (sym->section != SHN_ABS) {
+            /*
+             * This is a global symbol; so we must add it to the rbtree
+             * of global symbols in its section.
+             *
+             * In addition, we check the special text for symbol
+             * type and size information.
+             */
+            sects[sym->section-1]->gsyms =
+                rb_insert(sects[sym->section-1]->gsyms, &sym->symv);
+
+            if (special) {
+                int n = strcspn(special, " \t");
+
+                if (!nasm_strnicmp(special, "function", n))
+                    sym->type |= STT_FUNC;
+                else if (!nasm_strnicmp(special, "data", n) ||
+                         !nasm_strnicmp(special, "object", n))
+                    sym->type |= STT_OBJECT;
+                else if (!nasm_strnicmp(special, "notype", n))
+                    sym->type |= STT_NOTYPE;
+                else
+                    nasm_error(ERR_NONFATAL, "unrecognised symbol type `%.*s'",
+                          n, special);
+                special += n;
+
+                special = nasm_skip_spaces(special);
+                if (*special) {
+                    n = strcspn(special, " \t");
+                    if (!nasm_strnicmp(special, "default", n))
+                        sym->other = STV_DEFAULT;
+                    else if (!nasm_strnicmp(special, "internal", n))
+                        sym->other = STV_INTERNAL;
+                    else if (!nasm_strnicmp(special, "hidden", n))
+                        sym->other = STV_HIDDEN;
+                    else if (!nasm_strnicmp(special, "protected", n))
+                        sym->other = STV_PROTECTED;
+                    else
+                        n = 0;
+                    special += n;
+                }
+
+                if (*special) {
+                    struct tokenval tokval;
+                    expr *e;
+                    int fwd = 0;
+                    char *saveme = stdscan_get();
+
+                    while (special[n] && nasm_isspace(special[n]))
+                        n++;
+                    /*
+                     * We have a size expression; attempt to
+                     * evaluate it.
+                     */
+                    stdscan_reset();
+                    stdscan_set(special + n);
+                    tokval.t_type = TOKEN_INVALID;
+                    e = evaluate(stdscan, NULL, &tokval, &fwd, 0, nasm_error,
+                                 NULL);
+                    if (fwd) {
+                        sym->nextfwd = fwds;
+                        fwds = sym;
+                        sym->name = nasm_strdup(name);
+                    } else if (e) {
+                        if (!is_simple(e))
+                            nasm_error(ERR_NONFATAL, "cannot use relocatable"
+                                  " expression as symbol size");
+                        else
+                            sym->size = reloc_value(e);
+                    }
+                    stdscan_set(saveme);
+                }
+                special_used = true;
+            }
+            /*
+             * If TLS segment, mark symbol accordingly.
+             */
+            if (sects[sym->section - 1]->flags & SHF_TLS) {
+                sym->type &= 0xf0;
+                sym->type |= STT_TLS;
+            }
+        }
+        sym->globnum = nglobs;
+        nglobs++;
+    } else
+        nlocals++;
+
+    if (special && !special_used)
+        nasm_error(ERR_NONFATAL, "no special symbol features supported here");
+}
+
+static void elf_add_reloc(struct Section *sect, int32_t segment, int type)
+{
+    struct Reloc *r;
+
+    r = *sect->tail = nasm_malloc(sizeof(struct Reloc));
+    sect->tail = &r->next;
+    r->next = NULL;
+
+    r->address = sect->len;
+    if (segment == NO_SEG)
+        r->symbol = 0;
+    else {
+        int i;
+        r->symbol = 0;
+        for (i = 0; i < nsects; i++)
+            if (segment == sects[i]->index)
+                r->symbol = i + 2;
+        if (!r->symbol)
+            r->symbol = GLOBAL_TEMP_BASE + raa_read(bsym, segment);
+    }
+    r->type = type;
+
+    sect->nrelocs++;
+}
+
+/*
+ * This routine deals with ..got and ..sym relocations: the more
+ * complicated kinds. In shared-library writing, some relocations
+ * with respect to global symbols must refer to the precise symbol
+ * rather than referring to an offset from the base of the section
+ * _containing_ the symbol. Such relocations call to this routine,
+ * which searches the symbol list for the symbol in question.
+ *
+ * R_386_GOT32 references require the _exact_ symbol address to be
+ * used; R_386_32 references can be at an offset from the symbol.
+ * The boolean argument `exact' tells us this.
+ *
+ * Return value is the adjusted value of `addr', having become an
+ * offset from the symbol rather than the section. Should always be
+ * zero when returning from an exact call.
+ *
+ * Limitation: if you define two symbols at the same place,
+ * confusion will occur.
+ *
+ * Inefficiency: we search, currently, using a linked list which
+ * isn't even necessarily sorted.
+ */
+static int32_t elf_add_gsym_reloc(struct Section *sect,
+                               int32_t segment, uint32_t offset,
+                               int type, bool exact)
+{
+    struct Reloc *r;
+    struct Section *s;
+    struct Symbol *sym;
+    struct rbtree *srb;
+    int i;
+
+    /*
+     * First look up the segment/offset pair and find a global
+     * symbol corresponding to it. If it's not one of our segments,
+     * then it must be an external symbol, in which case we're fine
+     * doing a normal elf_add_reloc after first sanity-checking
+     * that the offset from the symbol is zero.
+     */
+    s = NULL;
+    for (i = 0; i < nsects; i++)
+        if (segment == sects[i]->index) {
+            s = sects[i];
+            break;
+        }
+    if (!s) {
+        if (exact && offset != 0)
+            nasm_error(ERR_NONFATAL, "unable to find a suitable global symbol"
+                  " for this reference");
+        else
+            elf_add_reloc(sect, segment, type);
+        return offset;
+    }
+
+    srb = rb_search(s->gsyms, offset);
+    if (!srb || (exact && srb->key != offset)) {
+        nasm_error(ERR_NONFATAL, "unable to find a suitable global symbol"
+                    " for this reference");
+        return 0;
+    }
+    sym = container_of(srb, struct Symbol, symv);
+
+    r = *sect->tail = nasm_malloc(sizeof(struct Reloc));
+    sect->tail = &r->next;
+    r->next = NULL;
+
+    r->address = sect->len;
+    r->symbol = GLOBAL_TEMP_BASE + sym->globnum;
+    r->type = type;
+
+    sect->nrelocs++;
+
+    return offset - sym->symv.key;
+}
+
+static void elf_out(int32_t segto, const void *data,
+                    enum out_type type, uint64_t size,
+                    int32_t segment, int32_t wrt)
+{
+    struct Section *s;
+    int32_t addr;
+    uint8_t mydata[4], *p;
+    int i;
+    static struct symlininfo sinfo;
+
+    /*
+     * handle absolute-assembly (structure definitions)
+     */
+    if (segto == NO_SEG) {
+        if (type != OUT_RESERVE)
+            nasm_error(ERR_NONFATAL, "attempt to assemble code in [ABSOLUTE]"
+                  " space");
+        return;
+    }
+
+    s = NULL;
+    for (i = 0; i < nsects; i++)
+        if (segto == sects[i]->index) {
+            s = sects[i];
+            break;
+        }
+    if (!s) {
+        int tempint;            /* ignored */
+        if (segto != elf_section_names(".text", 2, &tempint))
+            nasm_error(ERR_PANIC, "strange segment conditions in ELF driver");
+        else {
+            s = sects[nsects - 1];
+            i = nsects - 1;
+        }
+    }
+
+    /* again some stabs debugging stuff */
+    if (of_elf32.current_dfmt) {
+        sinfo.offset = s->len;
+        sinfo.section = i;
+        sinfo.name = s->name;
+        of_elf32.current_dfmt->debug_output(TY_STABSSYMLIN, &sinfo);
+    }
+    /* end of debugging stuff */
+
+    if (s->type == SHT_NOBITS && type != OUT_RESERVE) {
+        nasm_error(ERR_WARNING, "attempt to initialize memory in"
+              " BSS section `%s': ignored", s->name);
+        s->len += realsize(type, size);
+        return;
+    }
+
+    if (type == OUT_RESERVE) {
+        if (s->type == SHT_PROGBITS) {
+            nasm_error(ERR_WARNING, "uninitialized space declared in"
+                  " non-BSS section `%s': zeroing", s->name);
+            elf_sect_write(s, NULL, size);
+        } else
+            s->len += size;
+    } else if (type == OUT_RAWDATA) {
+        if (segment != NO_SEG)
+            nasm_error(ERR_PANIC, "OUT_RAWDATA with other than NO_SEG");
+        elf_sect_write(s, data, size);
+    } else if (type == OUT_ADDRESS) {
+        bool gnu16 = false;
+        addr = *(int64_t *)data;
+        if (segment != NO_SEG) {
+            if (segment % 2) {
+                nasm_error(ERR_NONFATAL, "ELF format does not support"
+                      " segment base references");
+            } else {
+                if (wrt == NO_SEG) {
+                    if (size == 2) {
+                        gnu16 = true;
+                        elf_add_reloc(s, segment, R_386_16);
+                    } else {
+                        elf_add_reloc(s, segment, R_386_32);
+                    }
+                } else if (wrt == elf_gotpc_sect + 1) {
+                    /*
+                     * The user will supply GOT relative to $$. ELF
+                     * will let us have GOT relative to $. So we
+                     * need to fix up the data item by $-$$.
+                     */
+                    addr += s->len;
+                    elf_add_reloc(s, segment, R_386_GOTPC);
+                } else if (wrt == elf_gotoff_sect + 1) {
+                    elf_add_reloc(s, segment, R_386_GOTOFF);
+                } else if (wrt == elf_tlsie_sect + 1) {
+                    addr = elf_add_gsym_reloc(s, segment, addr,
+                                              R_386_TLS_IE, true);
+                } else if (wrt == elf_got_sect + 1) {
+                    addr = elf_add_gsym_reloc(s, segment, addr,
+                                              R_386_GOT32, true);
+                } else if (wrt == elf_sym_sect + 1) {
+                    if (size == 2) {
+                        gnu16 = true;
+                        addr = elf_add_gsym_reloc(s, segment, addr,
+                                                  R_386_16, false);
+                    } else {
+                        addr = elf_add_gsym_reloc(s, segment, addr,
+                                                  R_386_32, false);
+                    }
+                } else if (wrt == elf_plt_sect + 1) {
+                    nasm_error(ERR_NONFATAL, "ELF format cannot produce non-PC-"
+                          "relative PLT references");
+                } else {
+                    nasm_error(ERR_NONFATAL, "ELF format does not support this"
+                          " use of WRT");
+                    wrt = NO_SEG;       /* we can at least _try_ to continue */
+                }
+            }
+        }
+        p = mydata;
+        if (gnu16) {
+            nasm_error(ERR_WARNING | ERR_WARN_GNUELF,
+                  "16-bit relocations in ELF is a GNU extension");
+            WRITESHORT(p, addr);
+        } else {
+            if (size != 4 && segment != NO_SEG) {
+                nasm_error(ERR_NONFATAL,
+                      "Unsupported non-32-bit ELF relocation");
+            }
+            WRITELONG(p, addr);
+        }
+        elf_sect_write(s, mydata, size);
+    } else if (type == OUT_REL2ADR) {
+        if (segment == segto)
+            nasm_error(ERR_PANIC, "intra-segment OUT_REL2ADR");
+        if (segment != NO_SEG && segment % 2) {
+            nasm_error(ERR_NONFATAL, "ELF format does not support"
+                  " segment base references");
+        } else {
+            if (wrt == NO_SEG) {
+                nasm_error(ERR_WARNING | ERR_WARN_GNUELF,
+                      "16-bit relocations in ELF is a GNU extension");
+                elf_add_reloc(s, segment, R_386_PC16);
+            } else {
+                nasm_error(ERR_NONFATAL,
+                      "Unsupported non-32-bit ELF relocation");
+            }
+        }
+        p = mydata;
+        WRITESHORT(p, *(int64_t *)data - size);
+        elf_sect_write(s, mydata, 2L);
+    } else if (type == OUT_REL4ADR) {
+        if (segment == segto)
+            nasm_error(ERR_PANIC, "intra-segment OUT_REL4ADR");
+        if (segment != NO_SEG && segment % 2) {
+            nasm_error(ERR_NONFATAL, "ELF format does not support"
+                  " segment base references");
+        } else {
+            if (wrt == NO_SEG) {
+                elf_add_reloc(s, segment, R_386_PC32);
+            } else if (wrt == elf_plt_sect + 1) {
+                elf_add_reloc(s, segment, R_386_PLT32);
+            } else if (wrt == elf_gotpc_sect + 1 ||
+                       wrt == elf_gotoff_sect + 1 ||
+                       wrt == elf_got_sect + 1) {
+                nasm_error(ERR_NONFATAL, "ELF format cannot produce PC-"
+                      "relative GOT references");
+            } else {
+                nasm_error(ERR_NONFATAL, "ELF format does not support this"
+                      " use of WRT");
+                wrt = NO_SEG;   /* we can at least _try_ to continue */
+            }
+        }
+        p = mydata;
+        WRITELONG(p, *(int64_t *)data - size);
+        elf_sect_write(s, mydata, 4L);
+    }
+}
+
+static void elf_write(void)
+{
+    int align;
+    char *p;
+    int i;
+
+    struct SAA *symtab;
+    int32_t symtablen, symtablocal;
+
+    /*
+     * Work out how many sections we will have. We have SHN_UNDEF,
+     * then the flexible user sections, then the fixed sections
+     * `.shstrtab', `.symtab' and `.strtab', then optionally
+     * relocation sections for the user sections.
+     */
+    nsections = sec_numspecial + 1;
+    if (of_elf32.current_dfmt == &df_stabs)
+        nsections += 3;
+    else if (of_elf32.current_dfmt == &df_dwarf)
+        nsections += 10;
+
+    add_sectname("", ".shstrtab");
+    add_sectname("", ".symtab");
+    add_sectname("", ".strtab");
+    for (i = 0; i < nsects; i++) {
+        nsections++;            /* for the section itself */
+        if (sects[i]->head) {
+            nsections++;        /* for its relocations */
+            add_sectname(".rel", sects[i]->name);
+        }
+    }
+
+    if (of_elf32.current_dfmt == &df_stabs) {
+        /* in case the debug information is wanted, just add these three sections... */
+        add_sectname("", ".stab");
+        add_sectname("", ".stabstr");
+        add_sectname(".rel", ".stab");
+    } else if (of_elf32.current_dfmt == &df_dwarf) {
+        /* the dwarf debug standard specifies the following ten sections,
+           not all of which are currently implemented,
+           although all of them are defined. */
+        add_sectname("", ".debug_aranges");
+        add_sectname(".rela", ".debug_aranges");
+        add_sectname("", ".debug_pubnames");
+        add_sectname("", ".debug_info");
+        add_sectname(".rela", ".debug_info");
+        add_sectname("", ".debug_abbrev");
+        add_sectname("", ".debug_line");
+        add_sectname(".rela", ".debug_line");
+        add_sectname("", ".debug_frame");
+        add_sectname("", ".debug_loc");
+    }
+
+    /*
+     * Output the ELF header.
+     */
+    fwrite("\177ELF\1\1\1", 7, 1, ofile);
+    fputc(elf_osabi, ofile);
+    fputc(elf_abiver, ofile);
+    fwritezero(7, ofile);
+    fwriteint16_t(1, ofile);        /* ET_REL relocatable file */
+    fwriteint16_t(3, ofile);        /* EM_386 processor ID */
+    fwriteint32_t(1L, ofile);       /* EV_CURRENT file format version */
+    fwriteint32_t(0L, ofile);       /* no entry point */
+    fwriteint32_t(0L, ofile);       /* no program header table */
+    fwriteint32_t(0x40L, ofile);    /* section headers straight after
+                                     * ELF header plus alignment */
+    fwriteint32_t(0L, ofile);       /* 386 defines no special flags */
+    fwriteint16_t(0x34, ofile);     /* size of ELF header */
+    fwriteint16_t(0, ofile);        /* no program header table, again */
+    fwriteint16_t(0, ofile);        /* still no program header table */
+    fwriteint16_t(0x28, ofile);     /* size of section header */
+    fwriteint16_t(nsections, ofile);      /* number of sections */
+    fwriteint16_t(sec_shstrtab, ofile);   /* string table section index for
+                                           * section header table */
+    fwriteint32_t(0L, ofile);       /* align to 0x40 bytes */
+    fwriteint32_t(0L, ofile);
+    fwriteint32_t(0L, ofile);
+
+    /*
+     * Build the symbol table and relocation tables.
+     */
+    symtab = elf_build_symtab(&symtablen, &symtablocal);
+    for (i = 0; i < nsects; i++)
+        if (sects[i]->head)
+            sects[i]->rel = elf_build_reltab(&sects[i]->rellen,
+                                             sects[i]->head);
+
+    /*
+     * Now output the section header table.
+     */
+
+    elf_foffs = 0x40 + 0x28 * nsections;
+    align = ((elf_foffs + SEG_ALIGN_1) & ~SEG_ALIGN_1) - elf_foffs;
+    elf_foffs += align;
+    elf_nsect = 0;
+    elf_sects = nasm_malloc(sizeof(*elf_sects) * nsections);
+
+    /* SHN_UNDEF */
+    elf_section_header(0, SHT_NULL, 0, NULL, false, 0, SHN_UNDEF, 0, 0, 0);
+    p = shstrtab + 1;
+
+    /* The normal sections */
+    for (i = 0; i < nsects; i++) {
+        elf_section_header(p - shstrtab, sects[i]->type, sects[i]->flags,
+                           (sects[i]->type == SHT_PROGBITS ?
+                            sects[i]->data : NULL), true,
+                           sects[i]->len, 0, 0, sects[i]->align, 0);
+        p += strlen(p) + 1;
+    }
+
+    /* .shstrtab */
+    elf_section_header(p - shstrtab, SHT_STRTAB, 0, shstrtab, false,
+                        shstrtablen, 0, 0, 1, 0);
+    p += strlen(p) + 1;
+
+    /* .symtab */
+    elf_section_header(p - shstrtab, SHT_SYMTAB, 0, symtab, true,
+                        symtablen, sec_strtab, symtablocal, 4, 16);
+    p += strlen(p) + 1;
+
+    /* .strtab */
+    elf_section_header(p - shstrtab, SHT_STRTAB, 0, strs, true,
+                        strslen, 0, 0, 1, 0);
+    p += strlen(p) + 1;
+
+    /* The relocation sections */
+    for (i = 0; i < nsects; i++)
+        if (sects[i]->head) {
+            elf_section_header(p - shstrtab, SHT_REL, 0, sects[i]->rel, true,
+                               sects[i]->rellen, sec_symtab, i + 1, 4, 8);
+            p += strlen(p) + 1;
+        }
+
+    if (of_elf32.current_dfmt == &df_stabs) {
+        /* for debugging information, create the last three sections
+           which are the .stab , .stabstr and .rel.stab sections respectively */
+
+        /* this function call creates the stab sections in memory */
+        stabs32_generate();
+
+        if (stabbuf && stabstrbuf && stabrelbuf) {
+            elf_section_header(p - shstrtab, SHT_PROGBITS, 0, stabbuf, false,
+                                stablen, sec_stabstr, 0, 4, 12);
+            p += strlen(p) + 1;
+
+            elf_section_header(p - shstrtab, SHT_STRTAB, 0, stabstrbuf, false,
+                               stabstrlen, 0, 0, 4, 0);
+            p += strlen(p) + 1;
+
+            /* link -> symtable  info -> section to refer to */
+            elf_section_header(p - shstrtab, SHT_REL, 0, stabrelbuf, false,
+                                stabrellen, sec_symtab, sec_stab, 4, 8);
+            p += strlen(p) + 1;
+        }
+    } else if (of_elf32.current_dfmt == &df_dwarf) {
+            /* for dwarf debugging information, create the ten dwarf sections */
+
+            /* this function call creates the dwarf sections in memory */
+            if (dwarf_fsect)
+                dwarf32_generate();
+
+            elf_section_header(p - shstrtab, SHT_PROGBITS, 0, arangesbuf, false,
+                               arangeslen, 0, 0, 1, 0);
+            p += strlen(p) + 1;
+
+            elf_section_header(p - shstrtab, SHT_RELA, 0, arangesrelbuf, false,
+                               arangesrellen, sec_symtab, sec_debug_aranges,
+                               1, 12);
+            p += strlen(p) + 1;
+
+            elf_section_header(p - shstrtab, SHT_PROGBITS, 0, pubnamesbuf,
+                               false, pubnameslen, 0, 0, 1, 0);
+            p += strlen(p) + 1;
+
+            elf_section_header(p - shstrtab, SHT_PROGBITS, 0, infobuf, false,
+                               infolen, 0, 0, 1, 0);
+            p += strlen(p) + 1;
+
+            elf_section_header(p - shstrtab, SHT_RELA, 0, inforelbuf, false,
+                               inforellen, sec_symtab, sec_debug_info, 1, 12);
+            p += strlen(p) + 1;
+
+            elf_section_header(p - shstrtab, SHT_PROGBITS, 0, abbrevbuf, false,
+                               abbrevlen, 0, 0, 1, 0);
+            p += strlen(p) + 1;
+
+            elf_section_header(p - shstrtab, SHT_PROGBITS, 0, linebuf, false,
+                               linelen, 0, 0, 1, 0);
+            p += strlen(p) + 1;
+
+            elf_section_header(p - shstrtab, SHT_RELA, 0, linerelbuf, false,
+                               linerellen, sec_symtab, sec_debug_line, 1, 12);
+            p += strlen(p) + 1;
+
+            elf_section_header(p - shstrtab, SHT_PROGBITS, 0, framebuf, false,
+                               framelen, 0, 0, 8, 0);
+            p += strlen(p) + 1;
+
+            elf_section_header(p - shstrtab, SHT_PROGBITS, 0, locbuf, false,
+                               loclen, 0, 0, 1, 0);
+            p += strlen(p) + 1;
+    }
+    fwritezero(align, ofile);
+
+    /*
+     * Now output the sections.
+     */
+    elf_write_sections();
+
+    nasm_free(elf_sects);
+    saa_free(symtab);
+}
+
+static struct SAA *elf_build_symtab(int32_t *len, int32_t *local)
+{
+    struct SAA *s = saa_init(1L);
+    struct Symbol *sym;
+    uint8_t entry[16], *p;
+    int i;
+
+    *len = *local = 0;
+
+    /*
+     * First, an all-zeros entry, required by the ELF spec.
+     */
+    saa_wbytes(s, NULL, 16L);   /* null symbol table entry */
+    *len += 16;
+    (*local)++;
+
+    /*
+     * Next, an entry for the file name.
+     */
+    p = entry;
+    WRITELONG(p, 1);            /* we know it's 1st entry in strtab */
+    WRITELONG(p, 0);            /* no value */
+    WRITELONG(p, 0);            /* no size either */
+    WRITESHORT(p, STT_FILE);    /* type FILE */
+    WRITESHORT(p, SHN_ABS);
+    saa_wbytes(s, entry, 16L);
+    *len += 16;
+    (*local)++;
+
+    /*
+     * Now some standard symbols defining the segments, for relocation
+     * purposes.
+     */
+    for (i = 1; i <= nsects; i++) {
+        p = entry;
+        WRITELONG(p, 0);        /* no symbol name */
+        WRITELONG(p, 0);        /* offset zero */
+        WRITELONG(p, 0);        /* size zero */
+        WRITESHORT(p, STT_SECTION);       /* type, binding, and visibility */
+        WRITESHORT(p, i);       /* section id */
+        saa_wbytes(s, entry, 16L);
+        *len += 16;
+        (*local)++;
+    }
+
+    /*
+     * Now the other local symbols.
+     */
+    saa_rewind(syms);
+    while ((sym = saa_rstruct(syms))) {
+        if (sym->type & SYM_GLOBAL)
+            continue;
+        p = entry;
+        WRITELONG(p, sym->strpos);
+        WRITELONG(p, sym->symv.key);
+        WRITELONG(p, sym->size);
+        WRITECHAR(p, sym->type);        /* type and binding */
+        WRITECHAR(p, sym->other);       /* visibility */
+        WRITESHORT(p, sym->section);
+        saa_wbytes(s, entry, 16L);
+        *len += 16;
+        (*local)++;
+    }
+     /*
+      * dwarf needs symbols for debug sections
+      * which are relocation targets.
+      */
+//*** fix for 32 bit
+     if (of_elf32.current_dfmt == &df_dwarf) {
+        dwarf_infosym = *local;
+        p = entry;
+        WRITELONG(p, 0);        /* no symbol name */
+        WRITELONG(p, (uint32_t) 0);         /* offset zero */
+        WRITELONG(p, (uint32_t) 0);         /* size zero */
+        WRITESHORT(p, STT_SECTION);         /* type, binding, and visibility */
+        WRITESHORT(p, sec_debug_info);      /* section id */
+        saa_wbytes(s, entry, 16L);
+        *len += 16;
+        (*local)++;
+        dwarf_abbrevsym = *local;
+        p = entry;
+        WRITELONG(p, 0);        /* no symbol name */
+        WRITELONG(p, (uint32_t) 0);         /* offset zero */
+        WRITELONG(p, (uint32_t) 0);         /* size zero */
+        WRITESHORT(p, STT_SECTION);         /* type, binding, and visibility */
+        WRITESHORT(p, sec_debug_abbrev);    /* section id */
+        saa_wbytes(s, entry, 16L);
+        *len += 16;
+        (*local)++;
+        dwarf_linesym = *local;
+        p = entry;
+        WRITELONG(p, 0);        /* no symbol name */
+        WRITELONG(p, (uint32_t) 0);         /* offset zero */
+        WRITELONG(p, (uint32_t) 0);         /* size zero */
+        WRITESHORT(p, STT_SECTION);         /* type, binding, and visibility */
+        WRITESHORT(p, sec_debug_line);      /* section id */
+        saa_wbytes(s, entry, 16L);
+        *len += 16;
+        (*local)++;
+     }
+
+    /*
+     * Now the global symbols.
+     */
+    saa_rewind(syms);
+    while ((sym = saa_rstruct(syms))) {
+        if (!(sym->type & SYM_GLOBAL))
+            continue;
+        p = entry;
+        WRITELONG(p, sym->strpos);
+        WRITELONG(p, sym->symv.key);
+        WRITELONG(p, sym->size);
+        WRITECHAR(p, sym->type);        /* type and binding */
+        WRITECHAR(p, sym->other);       /* visibility */
+        WRITESHORT(p, sym->section);
+        saa_wbytes(s, entry, 16L);
+        *len += 16;
+    }
+
+    return s;
+}
+
+static struct SAA *elf_build_reltab(int32_t *len, struct Reloc *r)
+{
+    struct SAA *s;
+    uint8_t *p, entry[8];
+    int32_t global_offset;
+
+    if (!r)
+        return NULL;
+
+    s = saa_init(1L);
+    *len = 0;
+
+    /*
+     * How to onvert from a global placeholder to a real symbol index;
+     * the +2 refers to the two special entries, the null entry and
+     * the filename entry.
+     */
+    global_offset = -GLOBAL_TEMP_BASE + nsects + nlocals + ndebugs + 2;
+
+    while (r) {
+        int32_t sym = r->symbol;
+
+        /*
+         * Create a real symbol index; the +2 refers to the two special
+         * entries, the null entry and the filename entry.
+         */
+        if (sym >= GLOBAL_TEMP_BASE)
+            sym += global_offset;
+
+        p = entry;
+        WRITELONG(p, r->address);
+        WRITELONG(p, (sym << 8) + r->type);
+        saa_wbytes(s, entry, 8L);
+        *len += 8;
+
+        r = r->next;
+    }
+
+    return s;
+}
+
+static void elf_section_header(int name, int type, int flags,
+                               void *data, bool is_saa, int32_t datalen,
+                               int link, int info, int align, int eltsize)
+{
+    elf_sects[elf_nsect].data = data;
+    elf_sects[elf_nsect].len = datalen;
+    elf_sects[elf_nsect].is_saa = is_saa;
+    elf_nsect++;
+
+    fwriteint32_t((int32_t)name, ofile);
+    fwriteint32_t((int32_t)type, ofile);
+    fwriteint32_t((int32_t)flags, ofile);
+    fwriteint32_t(0L, ofile);      /* no address, ever, in object files */
+    fwriteint32_t(type == 0 ? 0L : elf_foffs, ofile);
+    fwriteint32_t(datalen, ofile);
+    if (data)
+        elf_foffs += (datalen + SEG_ALIGN_1) & ~SEG_ALIGN_1;
+    fwriteint32_t((int32_t)link, ofile);
+    fwriteint32_t((int32_t)info, ofile);
+    fwriteint32_t((int32_t)align, ofile);
+    fwriteint32_t((int32_t)eltsize, ofile);
+}
+
+static void elf_write_sections(void)
+{
+    int i;
+    for (i = 0; i < elf_nsect; i++)
+        if (elf_sects[i].data) {
+            int32_t len = elf_sects[i].len;
+            int32_t reallen = (len + SEG_ALIGN_1) & ~SEG_ALIGN_1;
+            int32_t align = reallen - len;
+            if (elf_sects[i].is_saa)
+                saa_fpwrite(elf_sects[i].data, ofile);
+            else
+                fwrite(elf_sects[i].data, len, 1, ofile);
+            fwritezero(align, ofile);
+        }
+}
+
+static void elf_sect_write(struct Section *sect,
+                           const uint8_t *data, uint32_t len)
+{
+    saa_wbytes(sect->data, data, len);
+    sect->len += len;
+}
+
+static int32_t elf_segbase(int32_t segment)
+{
+    return segment;
+}
+
+static int elf_directive(enum directives directive, char *value, int pass)
+{
+    bool err;
+    int64_t n;
+    char *p;
+
+    switch (directive) {
+    case D_OSABI:
+        if (pass == 2)
+            return 1; /* ignore in pass 2 */
+
+        n = readnum(value, &err);
+        if (err) {
+            nasm_error(ERR_NONFATAL, "`osabi' directive requires a parameter");
+            return 1;
+        }
+        if (n < 0 || n > 255) {
+            nasm_error(ERR_NONFATAL, "valid osabi numbers are 0 to 255");
+            return 1;
+        }
+        elf_osabi  = n;
+        elf_abiver = 0;
+
+        if ((p = strchr(value,',')) == NULL)
+            return 1;
+
+        n = readnum(p+1, &err);
+        if (err || n < 0 || n > 255) {
+            nasm_error(ERR_NONFATAL, "invalid ABI version number (valid: 0 to 255)");
+            return 1;
+        }
+
+        elf_abiver = n;
+        return 1;
+
+    default:
+        return 0;
+    }
+}
+
+static void elf_filename(char *inname, char *outname)
+{
+    strcpy(elf_module, inname);
+    standard_extension(inname, outname, ".o");
+}
+
+extern macros_t elf_stdmac[];
+
+static int elf_set_info(enum geninfo type, char **val)
+{
+    (void)type;
+    (void)val;
+    return 0;
+}
+static struct dfmt df_dwarf = {
+    "ELF32 (i386) dwarf debug format for Linux/Unix",
+    "dwarf",
+    dwarf32_init,
+    dwarf32_linenum,
+    debug32_deflabel,
+    debug32_directive,
+    debug32_typevalue,
+    dwarf32_output,
+    dwarf32_cleanup
+};
+static struct dfmt df_stabs = {
+    "ELF32 (i386) stabs debug format for Linux/Unix",
+    "stabs",
+    null_debug_init,
+    stabs32_linenum,
+    debug32_deflabel,
+    debug32_directive,
+    debug32_typevalue,
+    stabs32_output,
+    stabs32_cleanup
+};
+
+struct dfmt *elf32_debugs_arr[3] = { &df_dwarf, &df_stabs, NULL };
+
+struct ofmt of_elf32 = {
+    "ELF32 (i386) object files (e.g. Linux)",
+    "elf32",
+    0,
+    elf32_debugs_arr,
+    &df_stabs,
+    elf_stdmac,
+    elf_init,
+    elf_set_info,
+    elf_out,
+    elf_deflabel,
+    elf_section_names,
+    elf_segbase,
+    elf_directive,
+    elf_filename,
+    elf_cleanup
+};
+
+struct ofmt of_elf = {
+    "ELF (short name for ELF32) ",
+    "elf",
+    0,
+    elf32_debugs_arr,
+    &df_stabs,
+    elf_stdmac,
+    elf_init_hack,
+    elf_set_info,
+    elf_out,
+    elf_deflabel,
+    elf_section_names,
+    elf_segbase,
+    elf_directive,
+    elf_filename,
+    elf_cleanup
+};
+/* again, the stabs debugging stuff (code) */
+
+static void stabs32_linenum(const char *filename, int32_t linenumber,
+                            int32_t segto)
+{
+    (void)segto;
+
+    if (!stabs_filename) {
+        stabs_filename = (char *)nasm_malloc(strlen(filename) + 1);
+        strcpy(stabs_filename, filename);
+    } else {
+        if (strcmp(stabs_filename, filename)) {
+            /*
+             * yep, a memory leak...this program is one-shot anyway, so who cares...
+             * in fact, this leak comes in quite handy to maintain a list of files
+             * encountered so far in the symbol lines...
+             */
+
+            /* why not nasm_free(stabs_filename); we're done with the old one */
+
+            stabs_filename = (char *)nasm_malloc(strlen(filename) + 1);
+            strcpy(stabs_filename, filename);
+        }
+    }
+    debug_immcall = 1;
+    currentline = linenumber;
+}
+
+static void debug32_deflabel(char *name, int32_t segment, int64_t offset, int is_global,
+                    char *special)
+{
+   (void)name;
+   (void)segment;
+   (void)offset;
+   (void)is_global;
+   (void)special;
+}
+
+static void debug32_directive(const char *directive, const char *params)
+{
+   (void)directive;
+   (void)params;
+}
+
+static void debug32_typevalue(int32_t type)
+{
+    int32_t stype, ssize;
+    switch (TYM_TYPE(type)) {
+        case TY_LABEL:
+            ssize = 0;
+            stype = STT_NOTYPE;
+            break;
+        case TY_BYTE:
+            ssize = 1;
+            stype = STT_OBJECT;
+            break;
+        case TY_WORD:
+            ssize = 2;
+            stype = STT_OBJECT;
+            break;
+        case TY_DWORD:
+            ssize = 4;
+            stype = STT_OBJECT;
+            break;
+        case TY_FLOAT:
+            ssize = 4;
+            stype = STT_OBJECT;
+            break;
+        case TY_QWORD:
+            ssize = 8;
+            stype = STT_OBJECT;
+            break;
+        case TY_TBYTE:
+            ssize = 10;
+            stype = STT_OBJECT;
+            break;
+        case TY_OWORD:
+            ssize = 16;
+            stype = STT_OBJECT;
+            break;
+        case TY_YWORD:
+            ssize = 32;
+            stype = STT_OBJECT;
+            break;
+        case TY_COMMON:
+            ssize = 0;
+            stype = STT_COMMON;
+            break;
+        case TY_SEG:
+            ssize = 0;
+            stype = STT_SECTION;
+            break;
+        case TY_EXTERN:
+            ssize = 0;
+            stype = STT_NOTYPE;
+            break;
+        case TY_EQU:
+            ssize = 0;
+            stype = STT_NOTYPE;
+            break;
+        default:
+            ssize = 0;
+            stype = STT_NOTYPE;
+            break;
+    }
+    if (stype == STT_OBJECT && lastsym && !lastsym->type) {
+        lastsym->size = ssize;
+        lastsym->type = stype;
+    }
+}
+
+static void stabs32_output(int type, void *param)
+{
+    struct symlininfo *s;
+    struct linelist *el;
+    if (type == TY_STABSSYMLIN) {
+        if (debug_immcall) {
+            s = (struct symlininfo *)param;
+            if (!(sects[s->section]->flags & SHF_EXECINSTR))
+                return; /* we are only interested in the text stuff */
+            numlinestabs++;
+            el = (struct linelist *)nasm_malloc(sizeof(struct linelist));
+            el->info.offset = s->offset;
+            el->info.section = s->section;
+            el->info.name = s->name;
+            el->line = currentline;
+            el->filename = stabs_filename;
+            el->next = 0;
+            if (stabslines) {
+                stabslines->last->next = el;
+                stabslines->last = el;
+            } else {
+                stabslines = el;
+                stabslines->last = el;
+            }
+        }
+    }
+    debug_immcall = 0;
+}
+
+#define WRITE_STAB(p,n_strx,n_type,n_other,n_desc,n_value)  \
+    do {                                                    \
+        WRITELONG(p,n_strx);                                \
+        WRITECHAR(p,n_type);                                \
+        WRITECHAR(p,n_other);                               \
+        WRITESHORT(p,n_desc);                               \
+        WRITELONG(p,n_value);                               \
+    } while (0)
+
+/* for creating the .stab , .stabstr and .rel.stab sections in memory */
+
+static void stabs32_generate(void)
+{
+    int i, numfiles, strsize, numstabs = 0, currfile, mainfileindex;
+    uint8_t *sbuf, *ssbuf, *rbuf, *sptr, *rptr;
+    char **allfiles;
+    int *fileidx;
+
+    struct linelist *ptr;
+
+    ptr = stabslines;
+
+    allfiles = (char **)nasm_malloc(numlinestabs * sizeof(char *));
+    for (i = 0; i < numlinestabs; i++)
+        allfiles[i] = 0;
+    numfiles = 0;
+    while (ptr) {
+        if (numfiles == 0) {
+            allfiles[0] = ptr->filename;
+            numfiles++;
+        } else {
+            for (i = 0; i < numfiles; i++) {
+                if (!strcmp(allfiles[i], ptr->filename))
+                    break;
+            }
+            if (i >= numfiles) {
+                allfiles[i] = ptr->filename;
+                numfiles++;
+            }
+        }
+        ptr = ptr->next;
+    }
+    strsize = 1;
+    fileidx = (int *)nasm_malloc(numfiles * sizeof(int));
+    for (i = 0; i < numfiles; i++) {
+        fileidx[i] = strsize;
+        strsize += strlen(allfiles[i]) + 1;
+    }
+    mainfileindex = 0;
+    for (i = 0; i < numfiles; i++) {
+        if (!strcmp(allfiles[i], elf_module)) {
+            mainfileindex = i;
+            break;
+        }
+    }
+
+    /*
+     * worst case size of the stab buffer would be:
+     * the sourcefiles changes each line, which would mean 1 SOL, 1 SYMLIN per line
+     * plus one "ending" entry
+     */
+    sbuf = (uint8_t *)nasm_malloc((numlinestabs * 2 + 4) *
+                                    sizeof(struct stabentry));
+    ssbuf = (uint8_t *)nasm_malloc(strsize);
+    rbuf = (uint8_t *)nasm_malloc(numlinestabs * 8 * (2 + 3));
+    rptr = rbuf;
+
+    for (i = 0; i < numfiles; i++)
+        strcpy((char *)ssbuf + fileidx[i], allfiles[i]);
+    ssbuf[0] = 0;
+
+    stabstrlen = strsize;       /* set global variable for length of stab strings */
+
+    sptr = sbuf;
+    ptr = stabslines;
+    numstabs = 0;
+
+    if (ptr) {
+        /*
+         * this is the first stab, its strx points to the filename of the
+         * the source-file, the n_desc field should be set to the number
+         * of remaining stabs
+         */
+        WRITE_STAB(sptr, fileidx[0], 0, 0, 0, strlen(allfiles[0] + 12));
+
+        /* this is the stab for the main source file */
+        WRITE_STAB(sptr, fileidx[mainfileindex], N_SO, 0, 0, 0);
+
+        /* relocation table entry */
+
+        /*
+         * Since the symbol table has two entries before
+         * the section symbols, the index in the info.section
+         * member must be adjusted by adding 2
+         */
+
+        WRITELONG(rptr, (sptr - sbuf) - 4);
+        WRITELONG(rptr, ((ptr->info.section + 2) << 8) | R_386_32);
+
+        numstabs++;
+        currfile = mainfileindex;
+    }
+
+    while (ptr) {
+        if (strcmp(allfiles[currfile], ptr->filename)) {
+            /* oops file has changed... */
+            for (i = 0; i < numfiles; i++)
+                if (!strcmp(allfiles[i], ptr->filename))
+                    break;
+            currfile = i;
+            WRITE_STAB(sptr, fileidx[currfile], N_SOL, 0, 0,
+                       ptr->info.offset);
+            numstabs++;
+
+            /* relocation table entry */
+            WRITELONG(rptr, (sptr - sbuf) - 4);
+            WRITELONG(rptr, ((ptr->info.section + 2) << 8) | R_386_32);
+        }
+
+        WRITE_STAB(sptr, 0, N_SLINE, 0, ptr->line, ptr->info.offset);
+        numstabs++;
+
+        /* relocation table entry */
+
+        WRITELONG(rptr, (sptr - sbuf) - 4);
+        WRITELONG(rptr, ((ptr->info.section + 2) << 8) | R_386_32);
+
+        ptr = ptr->next;
+
+    }
+
+    /* this is an "ending" token */
+    WRITE_STAB(sptr, 0, N_SO, 0, 0, 0);
+    numstabs++;
+
+    ((struct stabentry *)sbuf)->n_desc = numstabs;
+
+    nasm_free(allfiles);
+    nasm_free(fileidx);
+
+    stablen = (sptr - sbuf);
+    stabrellen = (rptr - rbuf);
+    stabrelbuf = rbuf;
+    stabbuf = sbuf;
+    stabstrbuf = ssbuf;
+}
+
+static void stabs32_cleanup(void)
+{
+    struct linelist *ptr, *del;
+    if (!stabslines)
+        return;
+
+    ptr = stabslines;
+    while (ptr) {
+        del = ptr;
+        ptr = ptr->next;
+        nasm_free(del);
+    }
+
+    nasm_free(stabbuf);
+    nasm_free(stabrelbuf);
+    nasm_free(stabstrbuf);
+}
+
+/* dwarf routines */
+
+static void dwarf32_init(void)
+{
+    ndebugs = 3; /* 3 debug symbols */
+}
+
+static void dwarf32_linenum(const char *filename, int32_t linenumber,
+                            int32_t segto)
+{
+    (void)segto;
+    dwarf32_findfile(filename);
+    debug_immcall = 1;
+    currentline = linenumber;
+}
+
+/* called from elf_out with type == TY_DEBUGSYMLIN */
+static void dwarf32_output(int type, void *param)
+{
+    int ln, aa, inx, maxln, soc;
+    struct symlininfo *s;
+    struct SAA *plinep;
+
+    (void)type;
+
+    s = (struct symlininfo *)param;
+
+    /* line number info is only gathered for executable sections */
+    if (!(sects[s->section]->flags & SHF_EXECINSTR))
+        return;
+
+    /* Check if section index has changed */
+    if (!(dwarf_csect && (dwarf_csect->section) == (s->section)))
+        dwarf32_findsect(s->section);
+
+    /* do nothing unless line or file has changed */
+    if (!debug_immcall)
+        return;
+
+    ln = currentline - dwarf_csect->line;
+    aa = s->offset - dwarf_csect->offset;
+    inx = dwarf_clist->line;
+    plinep = dwarf_csect->psaa;
+    /* check for file change */
+    if (!(inx == dwarf_csect->file)) {
+        saa_write8(plinep,DW_LNS_set_file);
+        saa_write8(plinep,inx);
+        dwarf_csect->file = inx;
+    }
+    /* check for line change */
+    if (ln) {
+        /* test if in range of special op code */
+        maxln = line_base + line_range;
+        soc = (ln - line_base) + (line_range * aa) + opcode_base;
+        if (ln >= line_base && ln < maxln && soc < 256) {
+            saa_write8(plinep,soc);
+        } else {
+            saa_write8(plinep,DW_LNS_advance_line);
+            saa_wleb128s(plinep,ln);
+            if (aa) {
+                saa_write8(plinep,DW_LNS_advance_pc);
+                saa_wleb128u(plinep,aa);
+            }
+        }
+        dwarf_csect->line = currentline;
+        dwarf_csect->offset = s->offset;
+    }
+
+    /* show change handled */
+    debug_immcall = 0;
+}
+
+
+static void dwarf32_generate(void)
+{
+    uint8_t *pbuf;
+    int indx;
+    struct linelist *ftentry;
+    struct SAA *paranges, *ppubnames, *pinfo, *pabbrev, *plines, *plinep;
+    struct SAA *parangesrel, *plinesrel, *pinforel;
+    struct sectlist *psect;
+    size_t saalen, linepoff, totlen, highaddr;
+
+    /* write epilogues for each line program range */
+    /* and build aranges section */
+    paranges = saa_init(1L);
+    parangesrel = saa_init(1L);
+    saa_write16(paranges,2);    /* dwarf version */
+    saa_write32(parangesrel, paranges->datalen+4);
+    saa_write32(parangesrel, (dwarf_infosym << 8) +  R_386_32); /* reloc to info */
+    saa_write32(parangesrel, 0);
+    saa_write32(paranges,0);    /* offset into info */
+    saa_write8(paranges,4);     /* pointer size */
+    saa_write8(paranges,0);     /* not segmented */
+    saa_write32(paranges,0);    /* padding */
+    /* iterate though sectlist entries */
+    psect = dwarf_fsect;
+    totlen = 0;
+    highaddr = 0;
+    for (indx = 0; indx < dwarf_nsections; indx++) {
+        plinep = psect->psaa;
+        /* Line Number Program Epilogue */
+        saa_write8(plinep,2);           /* std op 2 */
+        saa_write8(plinep,(sects[psect->section]->len)-psect->offset);
+        saa_write8(plinep,DW_LNS_extended_op);
+        saa_write8(plinep,1);           /* operand length */
+        saa_write8(plinep,DW_LNE_end_sequence);
+        totlen += plinep->datalen;
+        /* range table relocation entry */
+        saa_write32(parangesrel, paranges->datalen + 4);
+        saa_write32(parangesrel, ((uint32_t) (psect->section + 2) << 8) +  R_386_32);
+        saa_write32(parangesrel, (uint32_t) 0);
+        /* range table entry */
+        saa_write32(paranges,0x0000);   /* range start */
+        saa_write32(paranges,sects[psect->section]->len); /* range length */
+        highaddr += sects[psect->section]->len;
+        /* done with this entry */
+        psect = psect->next;
+    }
+    saa_write32(paranges,0);    /* null address */
+    saa_write32(paranges,0);    /* null length */
+    saalen = paranges->datalen;
+    arangeslen = saalen + 4;
+    arangesbuf = pbuf = nasm_malloc(arangeslen);
+    WRITELONG(pbuf,saalen);     /* initial length */
+    saa_rnbytes(paranges, pbuf, saalen);
+    saa_free(paranges);
+
+    /* build rela.aranges section */
+    arangesrellen = saalen = parangesrel->datalen;
+    arangesrelbuf = pbuf = nasm_malloc(arangesrellen);
+    saa_rnbytes(parangesrel, pbuf, saalen);
+    saa_free(parangesrel);
+
+    /* build pubnames section */
+    ppubnames = saa_init(1L);
+    saa_write16(ppubnames,3);   /* dwarf version */
+    saa_write32(ppubnames,0);   /* offset into info */
+    saa_write32(ppubnames,0);   /* space used in info */
+    saa_write32(ppubnames,0);   /* end of list */
+    saalen = ppubnames->datalen;
+    pubnameslen = saalen + 4;
+    pubnamesbuf = pbuf = nasm_malloc(pubnameslen);
+    WRITELONG(pbuf,saalen);     /* initial length */
+    saa_rnbytes(ppubnames, pbuf, saalen);
+    saa_free(ppubnames);
+
+    /* build info section */
+    pinfo = saa_init(1L);
+    pinforel = saa_init(1L);
+    saa_write16(pinfo,2);       /* dwarf version */
+    saa_write32(pinforel, pinfo->datalen + 4);
+    saa_write32(pinforel, (dwarf_abbrevsym << 8) +  R_386_32); /* reloc to abbrev */
+    saa_write32(pinforel, 0);
+    saa_write32(pinfo,0);       /* offset into abbrev */
+    saa_write8(pinfo,4);        /* pointer size */
+    saa_write8(pinfo,1);        /* abbrviation number LEB128u */
+    saa_write32(pinforel, pinfo->datalen + 4);
+    saa_write32(pinforel, ((dwarf_fsect->section + 2) << 8) +  R_386_32);
+    saa_write32(pinforel, 0);
+    saa_write32(pinfo,0);       /* DW_AT_low_pc */
+    saa_write32(pinforel, pinfo->datalen + 4);
+    saa_write32(pinforel, ((dwarf_fsect->section + 2) << 8) +  R_386_32);
+    saa_write32(pinforel, 0);
+    saa_write32(pinfo,highaddr);    /* DW_AT_high_pc */
+    saa_write32(pinforel, pinfo->datalen + 4);
+    saa_write32(pinforel, (dwarf_linesym << 8) +  R_386_32); /* reloc to line */
+    saa_write32(pinforel, 0);
+    saa_write32(pinfo,0);       /* DW_AT_stmt_list */
+    saa_wbytes(pinfo, elf_module, strlen(elf_module)+1);
+    saa_wbytes(pinfo, nasm_signature, strlen(nasm_signature)+1);
+    saa_write16(pinfo,DW_LANG_Mips_Assembler);
+    saa_write8(pinfo,2);        /* abbrviation number LEB128u */
+    saa_write32(pinforel, pinfo->datalen + 4);
+    saa_write32(pinforel, ((dwarf_fsect->section + 2) << 8) +  R_386_32);
+    saa_write32(pinforel, 0);
+    saa_write32(pinfo,0);       /* DW_AT_low_pc */
+    saa_write32(pinfo,0);       /* DW_AT_frame_base */
+    saa_write8(pinfo,0);        /* end of entries */
+    saalen = pinfo->datalen;
+    infolen = saalen + 4;
+    infobuf = pbuf = nasm_malloc(infolen);
+    WRITELONG(pbuf,saalen);     /* initial length */
+    saa_rnbytes(pinfo, pbuf, saalen);
+    saa_free(pinfo);
+
+    /* build rela.info section */
+    inforellen = saalen = pinforel->datalen;
+    inforelbuf = pbuf = nasm_malloc(inforellen);
+    saa_rnbytes(pinforel, pbuf, saalen);
+    saa_free(pinforel);
+
+    /* build abbrev section */
+    pabbrev = saa_init(1L);
+    saa_write8(pabbrev,1);      /* entry number LEB128u */
+    saa_write8(pabbrev,DW_TAG_compile_unit);    /* tag LEB128u */
+    saa_write8(pabbrev,1);      /* has children */
+    /* the following attributes and forms are all LEB128u values */
+    saa_write8(pabbrev,DW_AT_low_pc);
+    saa_write8(pabbrev,DW_FORM_addr);
+    saa_write8(pabbrev,DW_AT_high_pc);
+    saa_write8(pabbrev,DW_FORM_addr);
+    saa_write8(pabbrev,DW_AT_stmt_list);
+    saa_write8(pabbrev,DW_FORM_data4);
+    saa_write8(pabbrev,DW_AT_name);
+    saa_write8(pabbrev,DW_FORM_string);
+    saa_write8(pabbrev,DW_AT_producer);
+    saa_write8(pabbrev,DW_FORM_string);
+    saa_write8(pabbrev,DW_AT_language);
+    saa_write8(pabbrev,DW_FORM_data2);
+    saa_write16(pabbrev,0);     /* end of entry */
+    /* LEB128u usage same as above */
+    saa_write8(pabbrev,2);      /* entry number */
+    saa_write8(pabbrev,DW_TAG_subprogram);
+    saa_write8(pabbrev,0);      /* no children */
+    saa_write8(pabbrev,DW_AT_low_pc);
+    saa_write8(pabbrev,DW_FORM_addr);
+    saa_write8(pabbrev,DW_AT_frame_base);
+    saa_write8(pabbrev,DW_FORM_data4);
+    saa_write16(pabbrev,0);     /* end of entry */
+    abbrevlen = saalen = pabbrev->datalen;
+    abbrevbuf = pbuf = nasm_malloc(saalen);
+    saa_rnbytes(pabbrev, pbuf, saalen);
+    saa_free(pabbrev);
+
+    /* build line section */
+    /* prolog */
+    plines = saa_init(1L);
+    saa_write8(plines,1);           /* Minimum Instruction Length */
+    saa_write8(plines,1);           /* Initial value of 'is_stmt' */
+    saa_write8(plines,line_base);   /* Line Base */
+    saa_write8(plines,line_range);  /* Line Range */
+    saa_write8(plines,opcode_base); /* Opcode Base */
+    /* standard opcode lengths (# of LEB128u operands) */
+    saa_write8(plines,0);           /* Std opcode 1 length */
+    saa_write8(plines,1);           /* Std opcode 2 length */
+    saa_write8(plines,1);           /* Std opcode 3 length */
+    saa_write8(plines,1);           /* Std opcode 4 length */
+    saa_write8(plines,1);           /* Std opcode 5 length */
+    saa_write8(plines,0);           /* Std opcode 6 length */
+    saa_write8(plines,0);           /* Std opcode 7 length */
+    saa_write8(plines,0);           /* Std opcode 8 length */
+    saa_write8(plines,1);           /* Std opcode 9 length */
+    saa_write8(plines,0);           /* Std opcode 10 length */
+    saa_write8(plines,0);           /* Std opcode 11 length */
+    saa_write8(plines,1);           /* Std opcode 12 length */
+    /* Directory Table */
+    saa_write8(plines,0);           /* End of table */
+    /* File Name Table */
+    ftentry = dwarf_flist;
+    for (indx = 0; indx < dwarf_numfiles; indx++) {
+        saa_wbytes(plines, ftentry->filename, (int32_t)(strlen(ftentry->filename) + 1));
+        saa_write8(plines,0);       /* directory  LEB128u */
+        saa_write8(plines,0);       /* time LEB128u */
+        saa_write8(plines,0);       /* size LEB128u */
+        ftentry = ftentry->next;
+    }
+    saa_write8(plines,0);           /* End of table */
+    linepoff = plines->datalen;
+    linelen = linepoff + totlen + 10;
+    linebuf = pbuf = nasm_malloc(linelen);
+    WRITELONG(pbuf,linelen-4);      /* initial length */
+    WRITESHORT(pbuf,3);             /* dwarf version */
+    WRITELONG(pbuf,linepoff);       /* offset to line number program */
+    /* write line header */
+    saalen = linepoff;
+    saa_rnbytes(plines, pbuf, saalen);   /* read a given no. of bytes */
+    pbuf += linepoff;
+    saa_free(plines);
+    /* concatonate line program ranges */
+    linepoff += 13;
+    plinesrel = saa_init(1L);
+    psect = dwarf_fsect;
+    for (indx = 0; indx < dwarf_nsections; indx++) {
+        saa_write32(plinesrel, linepoff);
+        saa_write32(plinesrel, ((uint32_t) (psect->section + 2) << 8) +  R_386_32);
+        saa_write32(plinesrel, (uint32_t) 0);
+        plinep = psect->psaa;
+        saalen = plinep->datalen;
+        saa_rnbytes(plinep, pbuf, saalen);
+        pbuf += saalen;
+        linepoff += saalen;
+        saa_free(plinep);
+        /* done with this entry */
+        psect = psect->next;
+    }
+
+
+    /* build rela.lines section */
+    linerellen =saalen = plinesrel->datalen;
+    linerelbuf = pbuf = nasm_malloc(linerellen);
+    saa_rnbytes(plinesrel, pbuf, saalen);
+    saa_free(plinesrel);
+
+    /* build frame section */
+    framelen = 4;
+    framebuf = pbuf = nasm_malloc(framelen);
+    WRITELONG(pbuf,framelen-4); /* initial length */
+
+    /* build loc section */
+    loclen = 16;
+    locbuf = pbuf = nasm_malloc(loclen);
+    WRITELONG(pbuf,0);  /* null  beginning offset */
+    WRITELONG(pbuf,0);  /* null  ending offset */
+}
+
+static void dwarf32_cleanup(void)
+{
+    nasm_free(arangesbuf);
+    nasm_free(arangesrelbuf);
+    nasm_free(pubnamesbuf);
+    nasm_free(infobuf);
+    nasm_free(inforelbuf);
+    nasm_free(abbrevbuf);
+    nasm_free(linebuf);
+    nasm_free(linerelbuf);
+    nasm_free(framebuf);
+    nasm_free(locbuf);
+}
+
+static void dwarf32_findfile(const char * fname)
+{
+    int finx;
+    struct linelist *match;
+
+    /* return if fname is current file name */
+    if (dwarf_clist && !(strcmp(fname, dwarf_clist->filename)))
+        return;
+
+    /* search for match */
+    match = 0;
+    if (dwarf_flist) {
+        match = dwarf_flist;
+        for (finx = 0; finx < dwarf_numfiles; finx++) {
+            if (!(strcmp(fname, match->filename))) {
+                dwarf_clist = match;
+                return;
+            }
+        }
+    }
+
+    /* add file name to end of list */
+    dwarf_clist = (struct linelist *)nasm_malloc(sizeof(struct linelist));
+    dwarf_numfiles++;
+    dwarf_clist->line = dwarf_numfiles;
+    dwarf_clist->filename = nasm_malloc(strlen(fname) + 1);
+    strcpy(dwarf_clist->filename,fname);
+    dwarf_clist->next = 0;
+    if (!dwarf_flist) {     /* if first entry */
+        dwarf_flist = dwarf_elist = dwarf_clist;
+        dwarf_clist->last = 0;
+    } else {                /* chain to previous entry */
+        dwarf_elist->next = dwarf_clist;
+        dwarf_elist = dwarf_clist;
+    }
+}
+
+static void dwarf32_findsect(const int index)
+{
+    int sinx;
+    struct sectlist *match;
+    struct SAA *plinep;
+
+    /* return if index is current section index */
+    if (dwarf_csect && (dwarf_csect->section == index))
+        return;
+
+    /* search for match */
+    match = 0;
+    if (dwarf_fsect) {
+        match = dwarf_fsect;
+        for (sinx = 0; sinx < dwarf_nsections; sinx++) {
+            if ((match->section == index)) {
+                dwarf_csect = match;
+                return;
+            }
+            match = match->next;
+        }
+    }
+
+    /* add entry to end of list */
+    dwarf_csect = (struct sectlist *)nasm_malloc(sizeof(struct sectlist));
+    dwarf_nsections++;
+    dwarf_csect->psaa = plinep = saa_init(1L);
+    dwarf_csect->line = 1;
+    dwarf_csect->offset = 0;
+    dwarf_csect->file = 1;
+    dwarf_csect->section = index;
+    dwarf_csect->next = 0;
+    /* set relocatable address at start of line program */
+    saa_write8(plinep,DW_LNS_extended_op);
+    saa_write8(plinep,5);   /* operand length */
+    saa_write8(plinep,DW_LNE_set_address);
+    saa_write32(plinep,0);  /* Start Address */
+
+    if (!dwarf_fsect) { /* if first entry */
+        dwarf_fsect = dwarf_esect = dwarf_csect;
+        dwarf_csect->last = 0;
+    } else {            /* chain to previous entry */
+        dwarf_esect->next = dwarf_csect;
+        dwarf_esect = dwarf_csect;
+    }
+}
+
+#endif /* OF_ELF */
diff --git a/output/outelf64.c b/output/outelf64.c
new file mode 100644 (file)
index 0000000..fb373b7
--- /dev/null
@@ -0,0 +1,2267 @@
+/* ----------------------------------------------------------------------- *
+ *
+ *   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.
+ *
+ * ----------------------------------------------------------------------- */
+
+/*
+ * outelf64.c   output routines for the Netwide Assembler to produce
+ *              ELF64 (x86_64 of course) object file format
+ */
+
+#include "compiler.h"
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <ctype.h>
+#include <inttypes.h>
+
+#include "nasm.h"
+#include "nasmlib.h"
+#include "saa.h"
+#include "raa.h"
+#include "stdscan.h"
+#include "eval.h"
+#include "output/outform.h"
+#include "output/outlib.h"
+#include "rbtree.h"
+
+#include "output/dwarf.h"
+#include "output/stabs.h"
+#include "output/outelf.h"
+
+#ifdef OF_ELF64
+
+#define SOC(ln,aa) ln - line_base + (line_range * aa) + opcode_base
+
+struct Reloc {
+    struct Reloc *next;
+    int64_t address;            /* relative to _start_ of section */
+    int64_t symbol;             /* symbol index */
+    int64_t offset;             /* symbol addend */
+    int type;                   /* type of relocation */
+};
+
+struct Symbol {
+    struct rbtree symv;         /* symbol value and rbtree of globals */
+    int32_t strpos;             /* string table position of name */
+    int32_t section;            /* section ID of the symbol */
+    int type;                   /* symbol type */
+    int other;                  /* symbol visibility */
+    int32_t size;               /* size of symbol */
+    int32_t globnum;            /* symbol table offset if global */
+    struct Symbol *nextfwd;     /* list of unresolved-size symbols */
+    char *name;                 /* used temporarily if in above list */
+};
+
+struct Section {
+    struct SAA *data;
+    uint64_t len, size;
+    uint32_t nrelocs;
+    int32_t index;              /* index into sects array */
+    int type;                   /* SHT_PROGBITS or SHT_NOBITS */
+    uint64_t align;             /* alignment: power of two */
+    uint64_t flags;             /* section flags */
+    char *name;
+    struct SAA *rel;
+    uint64_t rellen;
+    struct Reloc *head, **tail;
+    struct rbtree *gsyms;       /* global symbols in section */
+};
+
+#define SECT_DELTA 32
+static struct Section **sects;
+static int nsects, sectlen;
+
+#define SHSTR_DELTA 256
+static char *shstrtab;
+static int shstrtablen, shstrtabsize;
+
+static struct SAA *syms;
+static uint32_t nlocals, nglobs, ndebugs;
+
+static int32_t def_seg;
+
+static struct RAA *bsym;
+
+static struct SAA *strs;
+static uint32_t strslen;
+
+static struct Symbol *fwds;
+
+static char elf_module[FILENAME_MAX];
+
+static uint8_t elf_osabi = 0;   /* Default OSABI = 0 (System V or Linux) */
+static uint8_t elf_abiver = 0;  /* Current ABI version */
+
+extern struct ofmt of_elf64;
+
+static struct ELF_SECTDATA {
+    void *data;
+    int64_t len;
+    bool is_saa;
+} *elf_sects;
+static int elf_nsect, nsections;
+static int64_t elf_foffs;
+
+static void elf_write(void);
+static void elf_sect_write(struct Section *, const void *, size_t);
+static void elf_sect_writeaddr(struct Section *, int64_t, size_t);
+static void elf_section_header(int, int, uint64_t, void *, bool, uint64_t, int, int,
+                               int, int);
+static void elf_write_sections(void);
+static struct SAA *elf_build_symtab(int32_t *, int32_t *);
+static struct SAA *elf_build_reltab(uint64_t *, struct Reloc *);
+static void add_sectname(char *, char *);
+
+struct stabentry {
+    uint32_t n_strx;
+    uint8_t n_type;
+    uint8_t n_other;
+    uint16_t n_desc;
+    uint32_t n_value;
+};
+
+struct erel {
+    int offset, info;
+};
+
+struct symlininfo {
+    int offset;
+    int section;                /* index into sects[] */
+    int segto;                  /* internal section number */
+    char *name;                 /* shallow-copied pointer of section name */
+};
+
+struct linelist {
+    struct symlininfo info;
+    int line;
+    char *filename;
+    struct linelist *next;
+    struct linelist *last;
+};
+
+struct sectlist {
+    struct SAA *psaa;
+    int section;
+    int line;
+    int offset;
+    int file;
+    struct sectlist *next;
+    struct sectlist *last;
+};
+
+/* common debug variables */
+static int currentline = 1;
+static int debug_immcall = 0;
+
+/* stabs debug variables */
+static struct linelist *stabslines = 0;
+static int numlinestabs = 0;
+static char *stabs_filename = 0;
+static int symtabsection;
+static uint8_t *stabbuf = 0, *stabstrbuf = 0, *stabrelbuf = 0;
+static int stablen, stabstrlen, stabrellen;
+
+/* dwarf debug variables */
+static struct linelist *dwarf_flist = 0, *dwarf_clist = 0, *dwarf_elist = 0;
+static struct sectlist *dwarf_fsect = 0, *dwarf_csect = 0, *dwarf_esect = 0;
+static int dwarf_numfiles = 0, dwarf_nsections;
+static uint8_t *arangesbuf = 0, *arangesrelbuf = 0, *pubnamesbuf = 0, *infobuf = 0,  *inforelbuf = 0,
+               *abbrevbuf = 0, *linebuf = 0, *linerelbuf = 0, *framebuf = 0, *locbuf = 0;
+static int8_t line_base = -5, line_range = 14, opcode_base = 13;
+static int arangeslen, arangesrellen, pubnameslen, infolen, inforellen,
+           abbrevlen, linelen, linerellen, framelen, loclen;
+static int64_t dwarf_infosym, dwarf_abbrevsym, dwarf_linesym;
+
+
+static struct dfmt df_dwarf;
+static struct dfmt df_stabs;
+static struct Symbol *lastsym;
+
+/* common debugging routines */
+static void debug64_typevalue(int32_t);
+static void debug64_deflabel(char *, int32_t, int64_t, int, char *);
+static void debug64_directive(const char *, const char *);
+
+/* stabs debugging routines */
+static void stabs64_linenum(const char *filename, int32_t linenumber, int32_t);
+static void stabs64_output(int, void *);
+static void stabs64_generate(void);
+static void stabs64_cleanup(void);
+
+/* dwarf debugging routines */
+static void dwarf64_init(void);
+static void dwarf64_linenum(const char *filename, int32_t linenumber, int32_t);
+static void dwarf64_output(int, void *);
+static void dwarf64_generate(void);
+static void dwarf64_cleanup(void);
+static void dwarf64_findfile(const char *);
+static void dwarf64_findsect(const int);
+
+/*
+ * Special section numbers which are used to define ELF special
+ * symbols, which can be used with WRT to provide PIC relocation
+ * types.
+ */
+static int32_t elf_gotpc_sect, elf_gotoff_sect;
+static int32_t elf_got_sect, elf_plt_sect;
+static int32_t elf_sym_sect;
+static int32_t elf_gottpoff_sect;
+
+static void elf_init(void)
+{
+    maxbits = 64;
+    sects = NULL;
+    nsects = sectlen = 0;
+    syms = saa_init((int32_t)sizeof(struct Symbol));
+    nlocals = nglobs = ndebugs = 0;
+    bsym = raa_init();
+    strs = saa_init(1L);
+    saa_wbytes(strs, "\0", 1L);
+    saa_wbytes(strs, elf_module, (int32_t)(strlen(elf_module) + 1));
+    strslen = 2 + strlen(elf_module);
+    shstrtab = NULL;
+    shstrtablen = shstrtabsize = 0;;
+    add_sectname("", "");
+
+    fwds = NULL;
+
+    elf_gotpc_sect = seg_alloc();
+    define_label("..gotpc", elf_gotpc_sect + 1, 0L, NULL, false, false);
+    elf_gotoff_sect = seg_alloc();
+    define_label("..gotoff", elf_gotoff_sect + 1, 0L, NULL, false, false);
+    elf_got_sect = seg_alloc();
+    define_label("..got", elf_got_sect + 1, 0L, NULL, false, false);
+    elf_plt_sect = seg_alloc();
+    define_label("..plt", elf_plt_sect + 1, 0L, NULL, false, false);
+    elf_sym_sect = seg_alloc();
+    define_label("..sym", elf_sym_sect + 1, 0L, NULL, false, false);
+    elf_gottpoff_sect = seg_alloc();
+    define_label("..gottpoff", elf_gottpoff_sect + 1, 0L, NULL, false, false);
+
+    def_seg = seg_alloc();
+
+}
+
+static void elf_cleanup(int debuginfo)
+{
+    struct Reloc *r;
+    int i;
+
+    (void)debuginfo;
+
+    elf_write();
+    for (i = 0; i < nsects; i++) {
+        if (sects[i]->type != SHT_NOBITS)
+            saa_free(sects[i]->data);
+        if (sects[i]->head)
+            saa_free(sects[i]->rel);
+        while (sects[i]->head) {
+            r = sects[i]->head;
+            sects[i]->head = sects[i]->head->next;
+            nasm_free(r);
+        }
+    }
+    nasm_free(sects);
+    saa_free(syms);
+    raa_free(bsym);
+    saa_free(strs);
+    if (of_elf64.current_dfmt) {
+        of_elf64.current_dfmt->cleanup();
+    }
+}
+
+/* add entry to the elf .shstrtab section */
+static void add_sectname(char *firsthalf, char *secondhalf)
+{
+    int len = strlen(firsthalf) + strlen(secondhalf);
+    while (shstrtablen + len + 1 > shstrtabsize)
+        shstrtab = nasm_realloc(shstrtab, (shstrtabsize += SHSTR_DELTA));
+    strcpy(shstrtab + shstrtablen, firsthalf);
+    strcat(shstrtab + shstrtablen, secondhalf);
+    shstrtablen += len + 1;
+}
+
+static int elf_make_section(char *name, int type, int flags, int align)
+{
+    struct Section *s;
+
+    s = nasm_malloc(sizeof(*s));
+
+    if (type != SHT_NOBITS)
+        s->data = saa_init(1L);
+    s->head = NULL;
+    s->tail = &s->head;
+    s->len = s->size = 0;
+    s->nrelocs = 0;
+    if (!strcmp(name, ".text"))
+        s->index = def_seg;
+    else
+        s->index = seg_alloc();
+    add_sectname("", name);
+    s->name = nasm_malloc(1 + strlen(name));
+    strcpy(s->name, name);
+    s->type = type;
+    s->flags = flags;
+    s->align = align;
+    s->gsyms = NULL;
+
+    if (nsects >= sectlen)
+        sects = nasm_realloc(sects, (sectlen += SECT_DELTA) * sizeof(*sects));
+    sects[nsects++] = s;
+
+    return nsects - 1;
+}
+
+static int32_t elf_section_names(char *name, int pass, int *bits)
+{
+    char *p;
+    uint32_t flags, flags_and, flags_or;
+    uint64_t align;
+    int type, i;
+
+    /*
+     * Default is 64 bits.
+     */
+    if (!name) {
+        *bits = 64;
+        return def_seg;
+    }
+
+    p = nasm_skip_word(name);
+    if (*p)
+        *p++ = '\0';
+    flags_and = flags_or = type = align = 0;
+
+    p = nasm_skip_spaces(p);
+    while (*p) {
+        char *q = p;
+        p = nasm_skip_word(p);
+        if (*p)
+            *p++ = '\0';
+        p = nasm_skip_spaces(p);
+
+        if (!nasm_strnicmp(q, "align=", 6)) {
+            align = atoi(q + 6);
+            if (align == 0)
+                align = 1;
+            if ((align - 1) & align) {  /* means it's not a power of two */
+                nasm_error(ERR_NONFATAL, "section alignment %"PRId64" is not"
+                      " a power of two", align);
+                align = 1;
+            }
+        } else if (!nasm_stricmp(q, "alloc")) {
+            flags_and |= SHF_ALLOC;
+            flags_or |= SHF_ALLOC;
+        } else if (!nasm_stricmp(q, "noalloc")) {
+            flags_and |= SHF_ALLOC;
+            flags_or &= ~SHF_ALLOC;
+        } else if (!nasm_stricmp(q, "exec")) {
+            flags_and |= SHF_EXECINSTR;
+            flags_or |= SHF_EXECINSTR;
+        } else if (!nasm_stricmp(q, "noexec")) {
+            flags_and |= SHF_EXECINSTR;
+            flags_or &= ~SHF_EXECINSTR;
+        } else if (!nasm_stricmp(q, "write")) {
+            flags_and |= SHF_WRITE;
+            flags_or |= SHF_WRITE;
+        } else if (!nasm_stricmp(q, "tls")) {
+            flags_and |= SHF_TLS;
+            flags_or |= SHF_TLS;
+        } else if (!nasm_stricmp(q, "nowrite")) {
+            flags_and |= SHF_WRITE;
+            flags_or &= ~SHF_WRITE;
+        } else if (!nasm_stricmp(q, "progbits")) {
+            type = SHT_PROGBITS;
+        } else if (!nasm_stricmp(q, "nobits")) {
+            type = SHT_NOBITS;
+        } else if (pass == 1) {
+            nasm_error(ERR_WARNING, "Unknown section attribute '%s' ignored on"
+                  " declaration of section `%s'", q, name);
+        }
+    }
+
+    if (!strcmp(name, ".shstrtab") ||
+        !strcmp(name, ".symtab") ||
+        !strcmp(name, ".strtab")) {
+        nasm_error(ERR_NONFATAL, "attempt to redefine reserved section"
+              "name `%s'", name);
+        return NO_SEG;
+    }
+
+    for (i = 0; i < nsects; i++)
+        if (!strcmp(name, sects[i]->name))
+            break;
+    if (i == nsects) {
+        const struct elf_known_section *ks = elf_known_sections;
+
+        while (ks->name) {
+            if (!strcmp(name, ks->name))
+                break;
+            ks++;
+        }
+
+        type = type ? type : ks->type;
+        align = align ? align : ks->align;
+        flags = (ks->flags & ~flags_and) | flags_or;
+
+        i = elf_make_section(name, type, flags, align);
+    } else if (pass == 1) {
+          if ((type && sects[i]->type != type)
+             || (align && sects[i]->align != align)
+             || (flags_and && ((sects[i]->flags & flags_and) != flags_or)))
+            nasm_error(ERR_WARNING, "incompatible section attributes ignored on"
+                  " redeclaration of section `%s'", name);
+    }
+
+    return sects[i]->index;
+}
+
+static void elf_deflabel(char *name, int32_t segment, int64_t offset,
+                         int is_global, char *special)
+{
+    int pos = strslen;
+    struct Symbol *sym;
+    bool special_used = false;
+
+#if defined(DEBUG) && DEBUG>2
+    nasm_error(ERR_DEBUG,
+            " elf_deflabel: %s, seg=%"PRIx32", off=%"PRIx64", is_global=%d, %s\n",
+            name, segment, offset, is_global, special);
+#endif
+    if (name[0] == '.' && name[1] == '.' && name[2] != '@') {
+        /*
+         * This is a NASM special symbol. We never allow it into
+         * the ELF symbol table, even if it's a valid one. If it
+         * _isn't_ a valid one, we should barf immediately.
+         */
+        if (strcmp(name, "..gotpc") && strcmp(name, "..gotoff") &&
+            strcmp(name, "..got") && strcmp(name, "..plt") &&
+            strcmp(name, "..sym") && strcmp(name, "..gottpoff"))
+            nasm_error(ERR_NONFATAL, "unrecognised special symbol `%s'", name);
+        return;
+    }
+
+    if (is_global == 3) {
+        struct Symbol **s;
+        /*
+         * Fix up a forward-reference symbol size from the first
+         * pass.
+         */
+        for (s = &fwds; *s; s = &(*s)->nextfwd)
+            if (!strcmp((*s)->name, name)) {
+                struct tokenval tokval;
+                expr *e;
+                char *p = nasm_skip_spaces(nasm_skip_word(special));
+
+                stdscan_reset();
+                stdscan_set(p);
+                tokval.t_type = TOKEN_INVALID;
+                e = evaluate(stdscan, NULL, &tokval, NULL, 1, nasm_error, NULL);
+                if (e) {
+                    if (!is_simple(e))
+                        nasm_error(ERR_NONFATAL, "cannot use relocatable"
+                              " expression as symbol size");
+                    else
+                        (*s)->size = reloc_value(e);
+                }
+
+                /*
+                 * Remove it from the list of unresolved sizes.
+                 */
+                nasm_free((*s)->name);
+                *s = (*s)->nextfwd;
+                return;
+            }
+        return;                 /* it wasn't an important one */
+    }
+
+    saa_wbytes(strs, name, (int32_t)(1 + strlen(name)));
+    strslen += 1 + strlen(name);
+
+    lastsym = sym = saa_wstruct(syms);
+
+    memset(&sym->symv, 0, sizeof(struct rbtree));
+
+    sym->strpos = pos;
+    sym->type = is_global ? SYM_GLOBAL : SYM_LOCAL;
+    sym->other = STV_DEFAULT;
+    sym->size = 0;
+    if (segment == NO_SEG)
+        sym->section = SHN_ABS;
+    else {
+        int i;
+        sym->section = SHN_UNDEF;
+        if (segment == def_seg) {
+            /* we have to be sure at least text section is there */
+            int tempint;
+            if (segment != elf_section_names(".text", 2, &tempint))
+                nasm_error(ERR_PANIC, "strange segment conditions in ELF driver");
+        }
+        for (i = 0; i < nsects; i++) {
+            if (segment == sects[i]->index) {
+                sym->section = i + 1;
+                break;
+            }
+        }
+    }
+
+    if (is_global == 2) {
+        sym->size = offset;
+        sym->symv.key = 0;
+        sym->section = SHN_COMMON;
+        /*
+         * We have a common variable. Check the special text to see
+         * if it's a valid number and power of two; if so, store it
+         * as the alignment for the common variable.
+         */
+        if (special) {
+            bool err;
+            sym->symv.key = readnum(special, &err);
+            if (err)
+                nasm_error(ERR_NONFATAL, "alignment constraint `%s' is not a"
+                      " valid number", special);
+            else if ((sym->symv.key | (sym->symv.key - 1)) != 2 * sym->symv.key - 1)
+                nasm_error(ERR_NONFATAL, "alignment constraint `%s' is not a"
+                      " power of two", special);
+        }
+        special_used = true;
+    } else
+        sym->symv.key = (sym->section == SHN_UNDEF ? 0 : offset);
+
+    if (sym->type == SYM_GLOBAL) {
+        /*
+         * If sym->section == SHN_ABS, then the first line of the
+         * else section would cause a core dump, because its a reference
+         * beyond the end of the section array.
+         * This behaviour is exhibited by this code:
+         *     GLOBAL crash_nasm
+         *     crash_nasm equ 0
+         * To avoid such a crash, such requests are silently discarded.
+         * This may not be the best solution.
+         */
+        if (sym->section == SHN_UNDEF || sym->section == SHN_COMMON) {
+            bsym = raa_write(bsym, segment, nglobs);
+        } else if (sym->section != SHN_ABS) {
+            /*
+             * This is a global symbol; so we must add it to the rbtree
+             * of global symbols in its section.
+             *
+             * In addition, we check the special text for symbol
+             * type and size information.
+             */
+            sects[sym->section-1]->gsyms =
+                rb_insert(sects[sym->section-1]->gsyms, &sym->symv);
+
+            if (special) {
+                int n = strcspn(special, " \t");
+
+                if (!nasm_strnicmp(special, "function", n))
+                    sym->type |= STT_FUNC;
+                else if (!nasm_strnicmp(special, "data", n) ||
+                         !nasm_strnicmp(special, "object", n))
+                    sym->type |= STT_OBJECT;
+                else if (!nasm_strnicmp(special, "notype", n))
+                    sym->type |= STT_NOTYPE;
+                else
+                    nasm_error(ERR_NONFATAL, "unrecognised symbol type `%.*s'",
+                          n, special);
+                special += n;
+
+                special = nasm_skip_spaces(special);
+                if (*special) {
+                    n = strcspn(special, " \t");
+                    if (!nasm_strnicmp(special, "default", n))
+                        sym->other = STV_DEFAULT;
+                    else if (!nasm_strnicmp(special, "internal", n))
+                        sym->other = STV_INTERNAL;
+                    else if (!nasm_strnicmp(special, "hidden", n))
+                        sym->other = STV_HIDDEN;
+                    else if (!nasm_strnicmp(special, "protected", n))
+                        sym->other = STV_PROTECTED;
+                    else
+                        n = 0;
+                    special += n;
+                }
+
+                if (*special) {
+                    struct tokenval tokval;
+                    expr *e;
+                    int fwd = 0;
+                    char *saveme = stdscan_get();
+
+                    while (special[n] && nasm_isspace(special[n]))
+                        n++;
+                    /*
+                     * We have a size expression; attempt to
+                     * evaluate it.
+                     */
+                    stdscan_reset();
+                    stdscan_set(special + n);
+                    tokval.t_type = TOKEN_INVALID;
+                    e = evaluate(stdscan, NULL, &tokval, &fwd, 0, nasm_error,
+                                 NULL);
+                    if (fwd) {
+                        sym->nextfwd = fwds;
+                        fwds = sym;
+                        sym->name = nasm_strdup(name);
+                    } else if (e) {
+                        if (!is_simple(e))
+                            nasm_error(ERR_NONFATAL, "cannot use relocatable"
+                                  " expression as symbol size");
+                        else
+                            sym->size = reloc_value(e);
+                    }
+                    stdscan_set(saveme);
+                }
+                special_used = true;
+            }
+            /*
+             * If TLS segment, mark symbol accordingly.
+             */
+            if (sects[sym->section - 1]->flags & SHF_TLS) {
+                sym->type &= 0xf0;
+                sym->type |= STT_TLS;
+            }
+        }
+        sym->globnum = nglobs;
+        nglobs++;
+    } else
+        nlocals++;
+
+    if (special && !special_used)
+        nasm_error(ERR_NONFATAL, "no special symbol features supported here");
+}
+
+static void elf_add_reloc(struct Section *sect, int32_t segment,
+                          int64_t offset, int type)
+{
+    struct Reloc *r;
+    r = *sect->tail = nasm_malloc(sizeof(struct Reloc));
+    sect->tail = &r->next;
+    r->next = NULL;
+
+    r->address = sect->len;
+    r->offset = offset;
+    if (segment == NO_SEG)
+        r->symbol = 0;
+    else {
+        int i;
+        r->symbol = 0;
+        for (i = 0; i < nsects; i++)
+            if (segment == sects[i]->index)
+                r->symbol = i + 2;
+        if (!r->symbol)
+            r->symbol = GLOBAL_TEMP_BASE + raa_read(bsym, segment);
+    }
+    r->type = type;
+
+    sect->nrelocs++;
+}
+
+/*
+ * This routine deals with ..got and ..sym relocations: the more
+ * complicated kinds. In shared-library writing, some relocations
+ * with respect to global symbols must refer to the precise symbol
+ * rather than referring to an offset from the base of the section
+ * _containing_ the symbol. Such relocations call to this routine,
+ * which searches the symbol list for the symbol in question.
+ *
+ * R_386_GOT32 references require the _exact_ symbol address to be
+ * used; R_386_32 references can be at an offset from the symbol.
+ * The boolean argument `exact' tells us this.
+ *
+ * Return value is the adjusted value of `addr', having become an
+ * offset from the symbol rather than the section. Should always be
+ * zero when returning from an exact call.
+ *
+ * Limitation: if you define two symbols at the same place,
+ * confusion will occur.
+ *
+ * Inefficiency: we search, currently, using a linked list which
+ * isn't even necessarily sorted.
+ */
+static void elf_add_gsym_reloc(struct Section *sect,
+                               int32_t segment, uint64_t offset, int64_t pcrel,
+                               int type, bool exact)
+{
+    struct Reloc *r;
+    struct Section *s;
+    struct Symbol *sym;
+    struct rbtree *srb;
+    int i;
+
+    /*
+     * First look up the segment/offset pair and find a global
+     * symbol corresponding to it. If it's not one of our segments,
+     * then it must be an external symbol, in which case we're fine
+     * doing a normal elf_add_reloc after first sanity-checking
+     * that the offset from the symbol is zero.
+     */
+    s = NULL;
+    for (i = 0; i < nsects; i++)
+        if (segment == sects[i]->index) {
+            s = sects[i];
+            break;
+        }
+
+    if (!s) {
+        if (exact && offset)
+            nasm_error(ERR_NONFATAL, "invalid access to an external symbol");
+        else
+            elf_add_reloc(sect, segment, offset - pcrel, type);
+        return;
+    }
+
+    srb = rb_search(s->gsyms, offset);
+    if (!srb || (exact && srb->key != offset)) {
+        nasm_error(ERR_NONFATAL, "unable to find a suitable global symbol"
+              " for this reference");
+        return;
+    }
+    sym = container_of(srb, struct Symbol, symv);
+
+    r = *sect->tail = nasm_malloc(sizeof(struct Reloc));
+    sect->tail = &r->next;
+    r->next = NULL;
+
+    r->address = sect->len;
+    r->offset = offset - pcrel - sym->symv.key;
+    r->symbol = GLOBAL_TEMP_BASE + sym->globnum;
+    r->type = type;
+
+    sect->nrelocs++;
+}
+
+static void elf_out(int32_t segto, const void *data,
+                    enum out_type type, uint64_t size,
+                    int32_t segment, int32_t wrt)
+{
+    struct Section *s;
+    int64_t addr, zero;
+    int i;
+    static struct symlininfo sinfo;
+
+    zero = 0;
+
+#if defined(DEBUG) && DEBUG>2
+    if (data)
+        nasm_error(ERR_DEBUG,
+                   " elf_out line: %d type: %x seg: %"PRIx32" segto: %"PRIx32" bytes: %"PRIx64" data: %"PRIx64"\n",
+                   currentline, type, segment, segto, size, *(int64_t *)data);
+    else
+        nasm_error(ERR_DEBUG,
+                   " elf_out line: %d type: %x seg: %"PRIx32" segto: %"PRIx32" bytes: %"PRIx64"\n",
+                   currentline, type, segment, segto, size);
+#endif
+
+    /*
+     * handle absolute-assembly (structure definitions)
+     */
+    if (segto == NO_SEG) {
+        if (type != OUT_RESERVE)
+            nasm_error(ERR_NONFATAL, "attempt to assemble code in [ABSOLUTE]"
+                  " space");
+        return;
+    }
+
+    s = NULL;
+    for (i = 0; i < nsects; i++)
+        if (segto == sects[i]->index) {
+            s = sects[i];
+            break;
+        }
+    if (!s) {
+        int tempint;            /* ignored */
+        if (segto != elf_section_names(".text", 2, &tempint))
+            nasm_error(ERR_PANIC, "strange segment conditions in ELF driver");
+        else {
+            s = sects[nsects - 1];
+            i = nsects - 1;
+        }
+    }
+    /* invoke current debug_output routine */
+    if (of_elf64.current_dfmt) {
+        sinfo.offset = s->len;
+        sinfo.section = i;
+        sinfo.segto = segto;
+        sinfo.name = s->name;
+        of_elf64.current_dfmt->debug_output(TY_DEBUGSYMLIN, &sinfo);
+    }
+    /* end of debugging stuff */
+
+    if (s->type == SHT_NOBITS && type != OUT_RESERVE) {
+        nasm_error(ERR_WARNING, "attempt to initialize memory in"
+              " BSS section `%s': ignored", s->name);
+        s->len += realsize(type, size);
+        return;
+    }
+
+    if (type == OUT_RESERVE) {
+        if (s->type == SHT_PROGBITS) {
+            nasm_error(ERR_WARNING, "uninitialized space declared in"
+                  " non-BSS section `%s': zeroing", s->name);
+            elf_sect_write(s, NULL, size);
+        } else
+            s->len += size;
+    } else if (type == OUT_RAWDATA) {
+        if (segment != NO_SEG)
+            nasm_error(ERR_PANIC, "OUT_RAWDATA with other than NO_SEG");
+        elf_sect_write(s, data, size);
+    } else if (type == OUT_ADDRESS) {
+        addr = *(int64_t *)data;
+        if (segment == NO_SEG) {
+            /* Do nothing */
+        } else if (segment % 2) {
+            nasm_error(ERR_NONFATAL, "ELF format does not support"
+                  " segment base references");
+        } else {
+            if (wrt == NO_SEG) {
+                switch ((int)size) {
+                case 1:
+                    elf_add_reloc(s, segment, addr, R_X86_64_8);
+                    break;
+                case 2:
+                    elf_add_reloc(s, segment, addr, R_X86_64_16);
+                    break;
+                case 4:
+                    elf_add_reloc(s, segment, addr, R_X86_64_32);
+                    break;
+                case 8:
+                    elf_add_reloc(s, segment, addr, R_X86_64_64);
+                    break;
+                default:
+                    nasm_error(ERR_PANIC, "internal error elf64-hpa-871");
+                    break;
+                }
+                addr = 0;
+            } else if (wrt == elf_gotpc_sect + 1) {
+                /*
+                 * The user will supply GOT relative to $$. ELF
+                 * will let us have GOT relative to $. So we
+                 * need to fix up the data item by $-$$.
+                 */
+                addr += s->len;
+                elf_add_reloc(s, segment, addr, R_X86_64_GOTPC32);
+                addr = 0;
+            } else if (wrt == elf_gotoff_sect + 1) {
+                if (size != 8) {
+                    nasm_error(ERR_NONFATAL, "ELF64 requires ..gotoff "
+                          "references to be qword");
+                } else {
+                    elf_add_reloc(s, segment, addr, R_X86_64_GOTOFF64);
+                    addr = 0;
+                }
+            } else if (wrt == elf_got_sect + 1) {
+                switch ((int)size) {
+                case 4:
+                    elf_add_gsym_reloc(s, segment, addr, 0,
+                                       R_X86_64_GOT32, true);
+                    addr = 0;
+                    break;
+                case 8:
+                    elf_add_gsym_reloc(s, segment, addr, 0,
+                                       R_X86_64_GOT64, true);
+                    addr = 0;
+                    break;
+                default:
+                    nasm_error(ERR_NONFATAL, "invalid ..got reference");
+                    break;
+                }
+            } else if (wrt == elf_sym_sect + 1) {
+                switch ((int)size) {
+                case 1:
+                    elf_add_gsym_reloc(s, segment, addr, 0,
+                                       R_X86_64_8, false);
+                    addr = 0;
+                    break;
+                case 2:
+                    elf_add_gsym_reloc(s, segment, addr, 0,
+                                       R_X86_64_16, false);
+                    addr = 0;
+                    break;
+                case 4:
+                    elf_add_gsym_reloc(s, segment, addr, 0,
+                                       R_X86_64_32, false);
+                    addr = 0;
+                    break;
+                case 8:
+                    elf_add_gsym_reloc(s, segment, addr, 0,
+                                       R_X86_64_64, false);
+                    addr = 0;
+                    break;
+                default:
+                    nasm_error(ERR_PANIC, "internal error elf64-hpa-903");
+                    break;
+                }
+            } else if (wrt == elf_plt_sect + 1) {
+                nasm_error(ERR_NONFATAL, "ELF format cannot produce non-PC-"
+                      "relative PLT references");
+            } else {
+                nasm_error(ERR_NONFATAL, "ELF format does not support this"
+                      " use of WRT");
+            }
+        }
+        elf_sect_writeaddr(s, addr, size);
+    } else if (type == OUT_REL2ADR) {
+        addr = *(int64_t *)data - size;
+        if (segment == segto)
+            nasm_error(ERR_PANIC, "intra-segment OUT_REL2ADR");
+        if (segment == NO_SEG) {
+            /* Do nothing */
+        } else if (segment % 2) {
+            nasm_error(ERR_NONFATAL, "ELF format does not support"
+                  " segment base references");
+        } else {
+            if (wrt == NO_SEG) {
+                elf_add_reloc(s, segment, addr, R_X86_64_PC16);
+                addr = 0;
+            } else {
+                nasm_error(ERR_NONFATAL,
+                      "Unsupported non-32-bit ELF relocation [2]");
+            }
+        }
+        elf_sect_writeaddr(s, addr, 2);
+    } else if (type == OUT_REL4ADR) {
+        addr = *(int64_t *)data - size;
+        if (segment == segto)
+            nasm_error(ERR_PANIC, "intra-segment OUT_REL4ADR");
+        if (segment == NO_SEG) {
+            /* Do nothing */
+        } else if (segment % 2) {
+            nasm_error(ERR_NONFATAL, "ELF64 format does not support"
+                  " segment base references");
+        } else {
+            if (wrt == NO_SEG) {
+                elf_add_reloc(s, segment, addr, R_X86_64_PC32);
+                addr = 0;
+            } else if (wrt == elf_plt_sect + 1) {
+                elf_add_gsym_reloc(s, segment, addr+size, size,
+                                   R_X86_64_PLT32, true);
+                addr = 0;
+            } else if (wrt == elf_gotpc_sect + 1 ||
+                       wrt == elf_got_sect + 1) {
+                elf_add_gsym_reloc(s, segment, addr+size, size,
+                                   R_X86_64_GOTPCREL, true);
+                addr = 0;
+            } else if (wrt == elf_gotoff_sect + 1 ||
+                       wrt == elf_got_sect + 1) {
+                nasm_error(ERR_NONFATAL, "ELF64 requires ..gotoff references to be "
+                      "qword absolute");
+            } else if (wrt == elf_gottpoff_sect + 1) {
+                elf_add_gsym_reloc(s, segment, addr+size, size,
+                                   R_X86_64_GOTTPOFF, true);
+                addr = 0;
+            } else {
+                nasm_error(ERR_NONFATAL, "ELF64 format does not support this"
+                      " use of WRT");
+            }
+        }
+        elf_sect_writeaddr(s, addr, 4);
+    } else if (type == OUT_REL8ADR) {
+        addr = *(int64_t *)data - size;
+        if (segment == segto)
+            nasm_error(ERR_PANIC, "intra-segment OUT_REL8ADR");
+        if (segment == NO_SEG) {
+            /* Do nothing */
+        } else if (segment % 2) {
+            nasm_error(ERR_NONFATAL, "ELF64 format does not support"
+                  " segment base references");
+        } else {
+            if (wrt == NO_SEG) {
+                elf_add_reloc(s, segment, addr, R_X86_64_PC64);
+                addr = 0;
+            } else if (wrt == elf_gotpc_sect + 1 ||
+                       wrt == elf_got_sect + 1) {
+                elf_add_gsym_reloc(s, segment, addr+size, size,
+                                   R_X86_64_GOTPCREL64, true);
+                addr = 0;
+            } else if (wrt == elf_gotoff_sect + 1 ||
+                       wrt == elf_got_sect + 1) {
+                nasm_error(ERR_NONFATAL, "ELF64 requires ..gotoff references to be "
+                      "absolute");
+            } else if (wrt == elf_gottpoff_sect + 1) {
+                nasm_error(ERR_NONFATAL, "ELF64 requires ..gottpoff references to be "
+                      "dword");
+            } else {
+                nasm_error(ERR_NONFATAL, "ELF64 format does not support this"
+                      " use of WRT");
+            }
+        }
+        elf_sect_writeaddr(s, addr, 8);
+    }
+}
+
+static void elf_write(void)
+{
+    int align;
+    char *p;
+    int i;
+
+    struct SAA *symtab;
+    int32_t symtablen, symtablocal;
+
+    /*
+     * Work out how many sections we will have. We have SHN_UNDEF,
+     * then the flexible user sections, then the fixed sections
+     * `.shstrtab', `.symtab' and `.strtab', then optionally
+     * relocation sections for the user sections.
+     */
+    nsections = sec_numspecial + 1;
+    if (of_elf64.current_dfmt == &df_stabs)
+        nsections += 3;
+    else if (of_elf64.current_dfmt == &df_dwarf)
+        nsections += 10;
+
+    add_sectname("", ".shstrtab");
+    add_sectname("", ".symtab");
+    add_sectname("", ".strtab");
+    for (i = 0; i < nsects; i++) {
+        nsections++;            /* for the section itself */
+        if (sects[i]->head) {
+            nsections++;        /* for its relocations */
+            add_sectname(".rela", sects[i]->name);
+        }
+    }
+
+    if (of_elf64.current_dfmt == &df_stabs) {
+        /* in case the debug information is wanted, just add these three sections... */
+        add_sectname("", ".stab");
+        add_sectname("", ".stabstr");
+        add_sectname(".rel", ".stab");
+    }
+
+    else if (of_elf64.current_dfmt == &df_dwarf) {
+        /* the dwarf debug standard specifies the following ten sections,
+           not all of which are currently implemented,
+           although all of them are defined. */
+        #define debug_aranges (int64_t) (nsections-10)
+        #define debug_info (int64_t) (nsections-7)
+        #define debug_abbrev (int64_t) (nsections-5)
+        #define debug_line (int64_t) (nsections-4)
+        add_sectname("", ".debug_aranges");
+        add_sectname(".rela", ".debug_aranges");
+        add_sectname("", ".debug_pubnames");
+        add_sectname("", ".debug_info");
+        add_sectname(".rela", ".debug_info");
+        add_sectname("", ".debug_abbrev");
+        add_sectname("", ".debug_line");
+        add_sectname(".rela", ".debug_line");
+        add_sectname("", ".debug_frame");
+        add_sectname("", ".debug_loc");
+    }
+
+    /*
+     * Output the ELF header.
+     */
+    fwrite("\177ELF\2\1\1", 7, 1, ofile);
+    fputc(elf_osabi, ofile);
+    fputc(elf_abiver, ofile);
+    fwritezero(7, ofile);
+    fwriteint16_t(ET_REL, ofile);      /* relocatable file */
+    fwriteint16_t(EM_X86_64, ofile);      /* processor ID */
+    fwriteint32_t(1L, ofile);      /* EV_CURRENT file format version */
+    fwriteint64_t(0L, ofile);      /* no entry point */
+    fwriteint64_t(0L, ofile);      /* no program header table */
+    fwriteint64_t(0x40L, ofile);   /* section headers straight after
+                                 * ELF header plus alignment */
+    fwriteint32_t(0L, ofile);      /* 386 defines no special flags */
+    fwriteint16_t(0x40, ofile);   /* size of ELF header */
+    fwriteint16_t(0, ofile);      /* no program header table, again */
+    fwriteint16_t(0, ofile);      /* still no program header table */
+    fwriteint16_t(sizeof(Elf64_Shdr), ofile);   /* size of section header */
+    fwriteint16_t(nsections, ofile);      /* number of sections */
+    fwriteint16_t(sec_shstrtab, ofile);   /* string table section index for
+                                           * section header table */
+
+    /*
+     * Build the symbol table and relocation tables.
+     */
+    symtab = elf_build_symtab(&symtablen, &symtablocal);
+    for (i = 0; i < nsects; i++)
+        if (sects[i]->head)
+            sects[i]->rel = elf_build_reltab(&sects[i]->rellen,
+                                             sects[i]->head);
+
+    /*
+     * Now output the section header table.
+     */
+
+    elf_foffs = 0x40 + sizeof(Elf64_Shdr) * nsections;
+    align = ((elf_foffs + SEG_ALIGN_1) & ~SEG_ALIGN_1) - elf_foffs;
+    elf_foffs += align;
+    elf_nsect = 0;
+    elf_sects = nasm_malloc(sizeof(*elf_sects) * nsections);
+
+    /* SHN_UNDEF */
+    elf_section_header(0, SHT_NULL, 0, NULL, false, 0, SHN_UNDEF, 0, 0, 0);
+    p = shstrtab + 1;
+
+    /* The normal sections */
+    for (i = 0; i < nsects; i++) {
+        elf_section_header(p - shstrtab, sects[i]->type, sects[i]->flags,
+                           (sects[i]->type == SHT_PROGBITS ?
+                            sects[i]->data : NULL), true,
+                           sects[i]->len, 0, 0, sects[i]->align, 0);
+        p += strlen(p) + 1;
+    }
+
+    /* .shstrtab */
+    elf_section_header(p - shstrtab, SHT_STRTAB, 0, shstrtab, false,
+                       shstrtablen, 0, 0, 1, 0);
+    p += strlen(p) + 1;
+
+    /* .symtab */
+    elf_section_header(p - shstrtab, SHT_SYMTAB, 0, symtab, true,
+                       symtablen, sec_strtab, symtablocal, 4, 24);
+    p += strlen(p) + 1;
+
+    /* .strtab */
+    elf_section_header(p - shstrtab, SHT_STRTAB, 0, strs, true,
+                       strslen, 0, 0, 1, 0);
+    p += strlen(p) + 1;
+
+    /* The relocation sections */
+    for (i = 0; i < nsects; i++)
+        if (sects[i]->head) {
+            elf_section_header(p - shstrtab, SHT_RELA, 0, sects[i]->rel, true,
+                               sects[i]->rellen, sec_symtab, i + 1, 4, 24);
+            p += strlen(p) + 1;
+        }
+
+    if (of_elf64.current_dfmt == &df_stabs) {
+        /* for debugging information, create the last three sections
+           which are the .stab , .stabstr and .rel.stab sections respectively */
+
+        /* this function call creates the stab sections in memory */
+        stabs64_generate();
+
+        if (stabbuf && stabstrbuf && stabrelbuf) {
+            elf_section_header(p - shstrtab, SHT_PROGBITS, 0, stabbuf, false,
+                               stablen, sec_stabstr, 0, 4, 12);
+            p += strlen(p) + 1;
+
+            elf_section_header(p - shstrtab, SHT_STRTAB, 0, stabstrbuf, false,
+                               stabstrlen, 0, 0, 4, 0);
+            p += strlen(p) + 1;
+
+            /* link -> symtable  info -> section to refer to */
+            elf_section_header(p - shstrtab, SHT_REL, 0, stabrelbuf, false,
+                               stabrellen, symtabsection, sec_stab, 4, 16);
+            p += strlen(p) + 1;
+        }
+    }
+    else if (of_elf64.current_dfmt == &df_dwarf) {
+            /* for dwarf debugging information, create the ten dwarf sections */
+
+            /* this function call creates the dwarf sections in memory */
+            if (dwarf_fsect)
+                dwarf64_generate();
+
+            elf_section_header(p - shstrtab, SHT_PROGBITS, 0, arangesbuf, false,
+                               arangeslen, 0, 0, 1, 0);
+            p += strlen(p) + 1;
+
+            elf_section_header(p - shstrtab, SHT_RELA, 0, arangesrelbuf, false,
+                               arangesrellen, symtabsection, debug_aranges, 1, 24);
+            p += strlen(p) + 1;
+
+            elf_section_header(p - shstrtab, SHT_PROGBITS, 0, pubnamesbuf, false,
+                               pubnameslen, 0, 0, 1, 0);
+            p += strlen(p) + 1;
+
+            elf_section_header(p - shstrtab, SHT_PROGBITS, 0, infobuf, false,
+                               infolen, 0, 0, 1, 0);
+            p += strlen(p) + 1;
+
+            elf_section_header(p - shstrtab, SHT_RELA, 0, inforelbuf, false,
+                               inforellen, symtabsection, debug_info, 1, 24);
+            p += strlen(p) + 1;
+
+            elf_section_header(p - shstrtab, SHT_PROGBITS, 0, abbrevbuf, false,
+                               abbrevlen, 0, 0, 1, 0);
+            p += strlen(p) + 1;
+
+            elf_section_header(p - shstrtab, SHT_PROGBITS, 0, linebuf, false,
+                               linelen, 0, 0, 1, 0);
+            p += strlen(p) + 1;
+
+            elf_section_header(p - shstrtab, SHT_RELA, 0, linerelbuf, false,
+                               linerellen, symtabsection, debug_line, 1, 24);
+            p += strlen(p) + 1;
+
+            elf_section_header(p - shstrtab, SHT_PROGBITS, 0, framebuf, false,
+                               framelen, 0, 0, 8, 0);
+            p += strlen(p) + 1;
+
+            elf_section_header(p - shstrtab, SHT_PROGBITS, 0, locbuf, false,
+                               loclen, 0, 0, 1, 0);
+            p += strlen(p) + 1;
+    }
+    fwritezero(align, ofile);
+
+    /*
+     * Now output the sections.
+     */
+    elf_write_sections();
+
+    nasm_free(elf_sects);
+    saa_free(symtab);
+}
+
+static struct SAA *elf_build_symtab(int32_t *len, int32_t *local)
+{
+    struct SAA *s = saa_init(1L);
+    struct Symbol *sym;
+    uint8_t entry[24], *p;
+    int i;
+
+    *len = *local = 0;
+
+    /*
+     * First, an all-zeros entry, required by the ELF spec.
+     */
+    saa_wbytes(s, NULL, 24L);   /* null symbol table entry */
+    *len += 24;
+    (*local)++;
+
+    /*
+     * Next, an entry for the file name.
+     */
+    p = entry;
+    WRITELONG(p, 1);            /* we know it's 1st entry in strtab */
+    WRITESHORT(p, STT_FILE);    /* type FILE */
+    WRITESHORT(p, SHN_ABS);
+    WRITEDLONG(p, (uint64_t) 0);  /* no value */
+    WRITEDLONG(p, (uint64_t) 0);  /* no size either */
+    saa_wbytes(s, entry, 24L);
+    *len += 24;
+    (*local)++;
+
+    /*
+     * Now some standard symbols defining the segments, for relocation
+     * purposes.
+     */
+    for (i = 1; i <= nsects; i++) {
+        p = entry;
+        WRITELONG(p, 0);        /* no symbol name */
+        WRITESHORT(p, STT_SECTION);       /* type, binding, and visibility */
+        WRITESHORT(p, i);       /* section id */
+        WRITEDLONG(p, (uint64_t) 0);        /* offset zero */
+        WRITEDLONG(p, (uint64_t) 0);        /* size zero */
+        saa_wbytes(s, entry, 24L);
+        *len += 24;
+        (*local)++;
+    }
+
+
+    /*
+     * Now the other local symbols.
+     */
+    saa_rewind(syms);
+    while ((sym = saa_rstruct(syms))) {
+        if (sym->type & SYM_GLOBAL)
+            continue;
+        p = entry;
+        WRITELONG(p, sym->strpos);      /* index into symbol string table */
+        WRITECHAR(p, sym->type);        /* type and binding */
+        WRITECHAR(p, sym->other);       /* visibility */
+        WRITESHORT(p, sym->section);    /* index into section header table */
+        WRITEDLONG(p, (int64_t)sym->symv.key); /* value of symbol */
+        WRITEDLONG(p, (int64_t)sym->size);  /* size of symbol */
+        saa_wbytes(s, entry, 24L);
+        *len += 24;
+        (*local)++;
+    }
+     /*
+      * dwarf needs symbols for debug sections
+      * which are relocation targets.
+      */
+     if (of_elf64.current_dfmt == &df_dwarf) {
+        dwarf_infosym = *local;
+        p = entry;
+        WRITELONG(p, 0);        /* no symbol name */
+        WRITESHORT(p, STT_SECTION);       /* type, binding, and visibility */
+        WRITESHORT(p, debug_info);       /* section id */
+        WRITEDLONG(p, (uint64_t) 0);        /* offset zero */
+        WRITEDLONG(p, (uint64_t) 0);        /* size zero */
+        saa_wbytes(s, entry, 24L);
+        *len += 24;
+        (*local)++;
+        dwarf_abbrevsym = *local;
+        p = entry;
+        WRITELONG(p, 0);        /* no symbol name */
+        WRITESHORT(p, STT_SECTION);       /* type, binding, and visibility */
+        WRITESHORT(p, debug_abbrev);       /* section id */
+        WRITEDLONG(p, (uint64_t) 0);        /* offset zero */
+        WRITEDLONG(p, (uint64_t) 0);        /* size zero */
+        saa_wbytes(s, entry, 24L);
+        *len += 24;
+        (*local)++;
+        dwarf_linesym = *local;
+        p = entry;
+        WRITELONG(p, 0);        /* no symbol name */
+        WRITESHORT(p, STT_SECTION);       /* type, binding, and visibility */
+        WRITESHORT(p, debug_line);       /* section id */
+        WRITEDLONG(p, (uint64_t) 0);        /* offset zero */
+        WRITEDLONG(p, (uint64_t) 0);        /* size zero */
+        saa_wbytes(s, entry, 24L);
+        *len += 24;
+        (*local)++;
+     }
+
+    /*
+     * Now the global symbols.
+     */
+    saa_rewind(syms);
+    while ((sym = saa_rstruct(syms))) {
+        if (!(sym->type & SYM_GLOBAL))
+            continue;
+        p = entry;
+        WRITELONG(p, sym->strpos);
+        WRITECHAR(p, sym->type);        /* type and binding */
+        WRITECHAR(p, sym->other);       /* visibility */
+        WRITESHORT(p, sym->section);
+        WRITEDLONG(p, (int64_t)sym->symv.key);
+        WRITEDLONG(p, (int64_t)sym->size);
+        saa_wbytes(s, entry, 24L);
+        *len += 24;
+    }
+
+    return s;
+}
+
+static struct SAA *elf_build_reltab(uint64_t *len, struct Reloc *r)
+{
+    struct SAA *s;
+    uint8_t *p, entry[24];
+    int32_t global_offset;
+
+    if (!r)
+        return NULL;
+
+    s = saa_init(1L);
+    *len = 0;
+
+    /*
+     * How to onvert from a global placeholder to a real symbol index;
+     * the +2 refers to the two special entries, the null entry and
+     * the filename entry.
+     */
+    global_offset = -GLOBAL_TEMP_BASE + nsects + nlocals + ndebugs + 2;
+
+    while (r) {
+        int32_t sym = r->symbol;
+
+        if (sym >= GLOBAL_TEMP_BASE)
+            sym += global_offset;
+
+        p = entry;
+        WRITEDLONG(p, r->address);
+        WRITELONG(p, r->type);
+        WRITELONG(p, sym);
+        WRITEDLONG(p, r->offset);
+        saa_wbytes(s, entry, 24L);
+        *len += 24;
+
+        r = r->next;
+    }
+
+    return s;
+}
+
+static void elf_section_header(int name, int type, uint64_t flags,
+                               void *data, bool is_saa, uint64_t datalen,
+                               int link, int info, int align, int eltsize)
+{
+    elf_sects[elf_nsect].data = data;
+    elf_sects[elf_nsect].len = datalen;
+    elf_sects[elf_nsect].is_saa = is_saa;
+    elf_nsect++;
+
+    fwriteint32_t((int32_t)name, ofile);
+    fwriteint32_t((int32_t)type, ofile);
+    fwriteint64_t((int64_t)flags, ofile);
+    fwriteint64_t(0L, ofile);      /* no address, ever, in object files */
+    fwriteint64_t(type == 0 ? 0L : elf_foffs, ofile);
+    fwriteint64_t(datalen, ofile);
+    if (data)
+        elf_foffs += (datalen + SEG_ALIGN_1) & ~SEG_ALIGN_1;
+    fwriteint32_t((int32_t)link, ofile);
+    fwriteint32_t((int32_t)info, ofile);
+    fwriteint64_t((int64_t)align, ofile);
+    fwriteint64_t((int64_t)eltsize, ofile);
+}
+
+static void elf_write_sections(void)
+{
+    int i;
+    for (i = 0; i < elf_nsect; i++)
+        if (elf_sects[i].data) {
+            int32_t len = elf_sects[i].len;
+            int32_t reallen = (len + SEG_ALIGN_1) & ~SEG_ALIGN_1;
+            int32_t align = reallen - len;
+            if (elf_sects[i].is_saa)
+                saa_fpwrite(elf_sects[i].data, ofile);
+            else
+                fwrite(elf_sects[i].data, len, 1, ofile);
+            fwritezero(align, ofile);
+        }
+}
+
+static void elf_sect_write(struct Section *sect, const void *data, size_t len)
+{
+    saa_wbytes(sect->data, data, len);
+    sect->len += len;
+}
+static void elf_sect_writeaddr(struct Section *sect, int64_t data, size_t len)
+{
+    saa_writeaddr(sect->data, data, len);
+    sect->len += len;
+}
+
+static int32_t elf_segbase(int32_t segment)
+{
+    return segment;
+}
+
+static int elf_directive(enum directives directive, char *value, int pass)
+{
+    bool err;
+    int64_t n;
+    char *p;
+
+    switch (directive) {
+    case D_OSABI:
+        if (pass == 2)
+            return 1;           /* ignore in pass 2 */
+
+        n = readnum(value, &err);
+        if (err) {
+            nasm_error(ERR_NONFATAL, "`osabi' directive requires a parameter");
+            return 1;
+        }
+        if (n < 0 || n > 255) {
+            nasm_error(ERR_NONFATAL, "valid osabi numbers are 0 to 255");
+            return 1;
+        }
+        elf_osabi  = n;
+        elf_abiver = 0;
+
+        if ((p = strchr(value,',')) == NULL)
+            return 1;
+
+        n = readnum(p+1, &err);
+        if (err || n < 0 || n > 255) {
+            nasm_error(ERR_NONFATAL, "invalid ABI version number (valid: 0 to 255)");
+            return 1;
+        }
+
+        elf_abiver = n;
+        return 1;
+
+    default:
+        return 0;
+    }
+}
+
+static void elf_filename(char *inname, char *outname)
+{
+    strcpy(elf_module, inname);
+    standard_extension(inname, outname, ".o");
+}
+
+extern macros_t elf_stdmac[];
+
+static int elf_set_info(enum geninfo type, char **val)
+{
+    (void)type;
+    (void)val;
+    return 0;
+}
+static struct dfmt df_dwarf = {
+    "ELF64 (x86-64) dwarf debug format for Linux/Unix",
+    "dwarf",
+    dwarf64_init,
+    dwarf64_linenum,
+    debug64_deflabel,
+    debug64_directive,
+    debug64_typevalue,
+    dwarf64_output,
+    dwarf64_cleanup
+};
+static struct dfmt df_stabs = {
+    "ELF64 (x86-64) stabs debug format for Linux/Unix",
+    "stabs",
+    null_debug_init,
+    stabs64_linenum,
+    debug64_deflabel,
+    debug64_directive,
+    debug64_typevalue,
+    stabs64_output,
+    stabs64_cleanup
+};
+
+struct dfmt *elf64_debugs_arr[3] = { &df_dwarf, &df_stabs, NULL };
+
+struct ofmt of_elf64 = {
+    "ELF64 (x86_64) object files (e.g. Linux)",
+    "elf64",
+    0,
+    elf64_debugs_arr,
+    &df_stabs,
+    elf_stdmac,
+    elf_init,
+    elf_set_info,
+    elf_out,
+    elf_deflabel,
+    elf_section_names,
+    elf_segbase,
+    elf_directive,
+    elf_filename,
+    elf_cleanup
+};
+
+/* common debugging routines */
+static void debug64_deflabel(char *name, int32_t segment, int64_t offset,
+                             int is_global, char *special)
+{
+    (void)name;
+    (void)segment;
+    (void)offset;
+    (void)is_global;
+    (void)special;
+}
+
+static void debug64_directive(const char *directive, const char *params)
+{
+    (void)directive;
+    (void)params;
+}
+
+static void debug64_typevalue(int32_t type)
+{
+    int32_t stype, ssize;
+    switch (TYM_TYPE(type)) {
+        case TY_LABEL:
+            ssize = 0;
+            stype = STT_NOTYPE;
+            break;
+        case TY_BYTE:
+            ssize = 1;
+            stype = STT_OBJECT;
+            break;
+        case TY_WORD:
+            ssize = 2;
+            stype = STT_OBJECT;
+            break;
+        case TY_DWORD:
+            ssize = 4;
+            stype = STT_OBJECT;
+            break;
+        case TY_FLOAT:
+            ssize = 4;
+            stype = STT_OBJECT;
+            break;
+        case TY_QWORD:
+            ssize = 8;
+            stype = STT_OBJECT;
+            break;
+        case TY_TBYTE:
+            ssize = 10;
+            stype = STT_OBJECT;
+            break;
+        case TY_OWORD:
+            ssize = 16;
+            stype = STT_OBJECT;
+            break;
+        case TY_YWORD:
+            ssize = 32;
+            stype = STT_OBJECT;
+            break;
+        case TY_COMMON:
+            ssize = 0;
+            stype = STT_COMMON;
+            break;
+        case TY_SEG:
+            ssize = 0;
+            stype = STT_SECTION;
+            break;
+        case TY_EXTERN:
+            ssize = 0;
+            stype = STT_NOTYPE;
+            break;
+        case TY_EQU:
+            ssize = 0;
+            stype = STT_NOTYPE;
+            break;
+        default:
+            ssize = 0;
+            stype = STT_NOTYPE;
+            break;
+    }
+    if (stype == STT_OBJECT && lastsym && !lastsym->type) {
+        lastsym->size = ssize;
+        lastsym->type = stype;
+    }
+}
+
+/* stabs debugging routines */
+
+static void stabs64_linenum(const char *filename, int32_t linenumber, int32_t segto)
+{
+    (void)segto;
+    if (!stabs_filename) {
+        stabs_filename = (char *)nasm_malloc(strlen(filename) + 1);
+        strcpy(stabs_filename, filename);
+    } else {
+        if (strcmp(stabs_filename, filename)) {
+            /* yep, a memory leak...this program is one-shot anyway, so who cares...
+               in fact, this leak comes in quite handy to maintain a list of files
+               encountered so far in the symbol lines... */
+
+            /* why not nasm_free(stabs_filename); we're done with the old one */
+
+            stabs_filename = (char *)nasm_malloc(strlen(filename) + 1);
+            strcpy(stabs_filename, filename);
+        }
+    }
+    debug_immcall = 1;
+    currentline = linenumber;
+}
+
+
+static void stabs64_output(int type, void *param)
+{
+    struct symlininfo *s;
+    struct linelist *el;
+    if (type == TY_DEBUGSYMLIN) {
+        if (debug_immcall) {
+            s = (struct symlininfo *)param;
+            if (!(sects[s->section]->flags & SHF_EXECINSTR))
+                return; /* line info is only collected for executable sections */
+            numlinestabs++;
+            el = (struct linelist *)nasm_malloc(sizeof(struct linelist));
+            el->info.offset = s->offset;
+            el->info.section = s->section;
+            el->info.name = s->name;
+            el->line = currentline;
+            el->filename = stabs_filename;
+            el->next = 0;
+            if (stabslines) {
+                stabslines->last->next = el;
+                stabslines->last = el;
+            } else {
+                stabslines = el;
+                stabslines->last = el;
+            }
+        }
+    }
+    debug_immcall = 0;
+}
+
+#define WRITE_STAB(p,n_strx,n_type,n_other,n_desc,n_value)  \
+    do {                                                    \
+        WRITELONG(p,n_strx);                                \
+        WRITECHAR(p,n_type);                                \
+        WRITECHAR(p,n_other);                               \
+        WRITESHORT(p,n_desc);                               \
+        WRITELONG(p,n_value);                               \
+    } while (0)
+
+/* for creating the .stab , .stabstr and .rel.stab sections in memory */
+
+static void stabs64_generate(void)
+{
+    int i, numfiles, strsize, numstabs = 0, currfile, mainfileindex;
+    uint8_t *sbuf, *ssbuf, *rbuf, *sptr, *rptr;
+    char **allfiles;
+    int *fileidx;
+
+    struct linelist *ptr;
+
+    ptr = stabslines;
+
+    allfiles = (char **)nasm_malloc(numlinestabs * sizeof(char *));
+    for (i = 0; i < numlinestabs; i++)
+        allfiles[i] = 0;
+    numfiles = 0;
+    while (ptr) {
+        if (numfiles == 0) {
+            allfiles[0] = ptr->filename;
+            numfiles++;
+        } else {
+            for (i = 0; i < numfiles; i++) {
+                if (!strcmp(allfiles[i], ptr->filename))
+                    break;
+            }
+            if (i >= numfiles) {
+                allfiles[i] = ptr->filename;
+                numfiles++;
+            }
+        }
+        ptr = ptr->next;
+    }
+    strsize = 1;
+    fileidx = (int *)nasm_malloc(numfiles * sizeof(int));
+    for (i = 0; i < numfiles; i++) {
+        fileidx[i] = strsize;
+        strsize += strlen(allfiles[i]) + 1;
+    }
+    mainfileindex = 0;
+    for (i = 0; i < numfiles; i++) {
+        if (!strcmp(allfiles[i], elf_module)) {
+            mainfileindex = i;
+            break;
+        }
+    }
+
+    /*
+     * worst case size of the stab buffer would be:
+     * the sourcefiles changes each line, which would mean 1 SOL, 1 SYMLIN per line
+     * plus one "ending" entry
+     */
+    sbuf = (uint8_t *)nasm_malloc((numlinestabs * 2 + 4) *
+                                    sizeof(struct stabentry));
+    ssbuf = (uint8_t *)nasm_malloc(strsize);
+    rbuf = (uint8_t *)nasm_malloc(numlinestabs * 16 * (2 + 3));
+    rptr = rbuf;
+
+    for (i = 0; i < numfiles; i++)
+        strcpy((char *)ssbuf + fileidx[i], allfiles[i]);
+    ssbuf[0] = 0;
+
+    stabstrlen = strsize;       /* set global variable for length of stab strings */
+
+    sptr = sbuf;
+    ptr = stabslines;
+    numstabs = 0;
+
+    if (ptr) {
+        /*
+         * this is the first stab, its strx points to the filename of the
+         * the source-file, the n_desc field should be set to the number
+         * of remaining stabs
+         */
+        WRITE_STAB(sptr, fileidx[0], 0, 0, 0, strlen(allfiles[0] + 12));
+
+        /* this is the stab for the main source file */
+        WRITE_STAB(sptr, fileidx[mainfileindex], N_SO, 0, 0, 0);
+
+        /* relocation table entry */
+
+        /*
+         * Since the symbol table has two entries before
+         * the section symbols, the index in the info.section
+         * member must be adjusted by adding 2
+         */
+
+        WRITEDLONG(rptr, (int64_t)(sptr - sbuf) - 4);
+        WRITELONG(rptr, R_X86_64_32);
+        WRITELONG(rptr, ptr->info.section + 2);
+
+        numstabs++;
+        currfile = mainfileindex;
+    }
+
+    while (ptr) {
+        if (strcmp(allfiles[currfile], ptr->filename)) {
+            /* oops file has changed... */
+            for (i = 0; i < numfiles; i++)
+                if (!strcmp(allfiles[i], ptr->filename))
+                    break;
+            currfile = i;
+            WRITE_STAB(sptr, fileidx[currfile], N_SOL, 0, 0,
+                       ptr->info.offset);
+            numstabs++;
+
+            /* relocation table entry */
+
+            WRITEDLONG(rptr, (int64_t)(sptr - sbuf) - 4);
+            WRITELONG(rptr, R_X86_64_32);
+            WRITELONG(rptr, ptr->info.section + 2);
+        }
+
+        WRITE_STAB(sptr, 0, N_SLINE, 0, ptr->line, ptr->info.offset);
+        numstabs++;
+
+        /* relocation table entry */
+
+        WRITEDLONG(rptr, (int64_t)(sptr - sbuf) - 4);
+        WRITELONG(rptr, R_X86_64_32);
+        WRITELONG(rptr, ptr->info.section + 2);
+
+        ptr = ptr->next;
+
+    }
+
+    /* this is an "ending" token */
+    WRITE_STAB(sptr, 0, N_SO, 0, 0, 0);
+    numstabs++;
+
+    ((struct stabentry *)sbuf)->n_desc = numstabs;
+
+    nasm_free(allfiles);
+    nasm_free(fileidx);
+
+    stablen = (sptr - sbuf);
+    stabrellen = (rptr - rbuf);
+    stabrelbuf = rbuf;
+    stabbuf = sbuf;
+    stabstrbuf = ssbuf;
+}
+
+static void stabs64_cleanup(void)
+{
+    struct linelist *ptr, *del;
+    if (!stabslines)
+        return;
+
+    ptr = stabslines;
+    while (ptr) {
+        del = ptr;
+        ptr = ptr->next;
+        nasm_free(del);
+    }
+
+    nasm_free(stabbuf);
+    nasm_free(stabrelbuf);
+    nasm_free(stabstrbuf);
+}
+
+/* dwarf routines */
+
+static void dwarf64_init(void)
+{
+    ndebugs = 3; /* 3 debug symbols */
+}
+
+static void dwarf64_linenum(const char *filename, int32_t linenumber,
+                            int32_t segto)
+{
+    (void)segto;
+    dwarf64_findfile(filename);
+    debug_immcall = 1;
+    currentline = linenumber;
+}
+
+/* called from elf_out with type == TY_DEBUGSYMLIN */
+static void dwarf64_output(int type, void *param)
+{
+    int ln, aa, inx, maxln, soc;
+    struct symlininfo *s;
+    struct SAA *plinep;
+
+    (void)type;
+
+    s = (struct symlininfo *)param;
+
+    /* line number info is only gathered for executable sections */
+    if (!(sects[s->section]->flags & SHF_EXECINSTR))
+        return;
+
+    /* Check if section index has changed */
+    if (!(dwarf_csect && (dwarf_csect->section) == (s->section)))
+        dwarf64_findsect(s->section);
+
+    /* do nothing unless line or file has changed */
+    if (!debug_immcall)
+        return;
+
+    ln = currentline - dwarf_csect->line;
+    aa = s->offset - dwarf_csect->offset;
+    inx = dwarf_clist->line;
+    plinep = dwarf_csect->psaa;
+    /* check for file change */
+    if (!(inx == dwarf_csect->file)) {
+        saa_write8(plinep,DW_LNS_set_file);
+        saa_write8(plinep,inx);
+        dwarf_csect->file = inx;
+    }
+    /* check for line change */
+    if (ln) {
+        /* test if in range of special op code */
+        maxln = line_base + line_range;
+        soc = (ln - line_base) + (line_range * aa) + opcode_base;
+        if (ln >= line_base && ln < maxln && soc < 256) {
+            saa_write8(plinep,soc);
+        } else {
+            saa_write8(plinep,DW_LNS_advance_line);
+            saa_wleb128s(plinep,ln);
+            if (aa) {
+                saa_write8(plinep,DW_LNS_advance_pc);
+                saa_wleb128u(plinep,aa);
+            }
+        }
+        dwarf_csect->line = currentline;
+        dwarf_csect->offset = s->offset;
+    }
+
+    /* show change handled */
+    debug_immcall = 0;
+}
+
+
+static void dwarf64_generate(void)
+{
+    uint8_t *pbuf;
+    int indx;
+    struct linelist *ftentry;
+    struct SAA *paranges, *ppubnames, *pinfo, *pabbrev, *plines, *plinep;
+    struct SAA *parangesrel, *plinesrel, *pinforel;
+    struct sectlist *psect;
+    size_t saalen, linepoff, totlen, highaddr;
+
+    /* write epilogues for each line program range */
+    /* and build aranges section */
+    paranges = saa_init(1L);
+    parangesrel = saa_init(1L);
+    saa_write16(paranges,3);            /* dwarf version */
+    saa_write64(parangesrel, paranges->datalen+4);
+    saa_write64(parangesrel, (dwarf_infosym << 32) +  R_X86_64_32); /* reloc to info */
+    saa_write64(parangesrel, 0);
+    saa_write32(paranges,0);            /* offset into info */
+    saa_write8(paranges,8);             /* pointer size */
+    saa_write8(paranges,0);             /* not segmented */
+    saa_write32(paranges,0);            /* padding */
+    /* iterate though sectlist entries */
+     psect = dwarf_fsect;
+     totlen = 0;
+     highaddr = 0;
+     for (indx = 0; indx < dwarf_nsections; indx++)
+     {
+         plinep = psect->psaa;
+         /* Line Number Program Epilogue */
+         saa_write8(plinep,2);                 /* std op 2 */
+         saa_write8(plinep,(sects[psect->section]->len)-psect->offset);
+         saa_write8(plinep,DW_LNS_extended_op);
+         saa_write8(plinep,1);                 /* operand length */
+         saa_write8(plinep,DW_LNE_end_sequence);
+         totlen += plinep->datalen;
+         /* range table relocation entry */
+         saa_write64(parangesrel, paranges->datalen + 4);
+         saa_write64(parangesrel, ((uint64_t) (psect->section + 2) << 32) +  R_X86_64_64);
+         saa_write64(parangesrel, (uint64_t) 0);
+         /* range table entry */
+         saa_write64(paranges,0x0000);         /* range start */
+         saa_write64(paranges,sects[psect->section]->len);     /* range length */
+         highaddr += sects[psect->section]->len;
+         /* done with this entry */
+         psect = psect->next;
+     }
+    saa_write64(paranges,0);           /* null address */
+    saa_write64(paranges,0);           /* null length */
+    saalen = paranges->datalen;
+    arangeslen = saalen + 4;
+    arangesbuf = pbuf = nasm_malloc(arangeslen);
+    WRITELONG(pbuf,saalen);                    /* initial length */
+    saa_rnbytes(paranges, pbuf, saalen);
+    saa_free(paranges);
+
+    /* build rela.aranges section */
+    arangesrellen = saalen = parangesrel->datalen;
+    arangesrelbuf = pbuf = nasm_malloc(arangesrellen); 
+    saa_rnbytes(parangesrel, pbuf, saalen);
+    saa_free(parangesrel);
+
+    /* build pubnames section */
+    ppubnames = saa_init(1L);
+    saa_write16(ppubnames,3);   /* dwarf version */
+    saa_write32(ppubnames,0);   /* offset into info */
+    saa_write32(ppubnames,0);   /* space used in info */
+    saa_write32(ppubnames,0);   /* end of list */
+    saalen = ppubnames->datalen;
+    pubnameslen = saalen + 4;
+    pubnamesbuf = pbuf = nasm_malloc(pubnameslen);
+    WRITELONG(pbuf,saalen);     /* initial length */
+    saa_rnbytes(ppubnames, pbuf, saalen);
+    saa_free(ppubnames);
+
+    /* build info section */
+    pinfo = saa_init(1L);
+    pinforel = saa_init(1L);
+    saa_write16(pinfo,3);                      /* dwarf version */
+    saa_write64(pinforel, pinfo->datalen + 4);
+    saa_write64(pinforel, (dwarf_abbrevsym << 32) +  R_X86_64_32); /* reloc to abbrev */
+    saa_write64(pinforel, 0);
+    saa_write32(pinfo,0);                      /* offset into abbrev */
+    saa_write8(pinfo,8);                       /* pointer size */
+    saa_write8(pinfo,1);                       /* abbrviation number LEB128u */
+    saa_write64(pinforel, pinfo->datalen + 4);
+    saa_write64(pinforel, ((uint64_t)(dwarf_fsect->section + 2) << 32) +  R_X86_64_64);
+    saa_write64(pinforel, 0);
+    saa_write64(pinfo,0);                      /* DW_AT_low_pc */
+    saa_write64(pinforel, pinfo->datalen + 4);
+    saa_write64(pinforel, ((uint64_t)(dwarf_fsect->section + 2) << 32) +  R_X86_64_64);
+    saa_write64(pinforel, 0);
+    saa_write64(pinfo,highaddr);               /* DW_AT_high_pc */
+    saa_write64(pinforel, pinfo->datalen + 4);
+    saa_write64(pinforel, (dwarf_linesym << 32) +  R_X86_64_32); /* reloc to line */
+    saa_write64(pinforel, 0);
+    saa_write32(pinfo,0);                      /* DW_AT_stmt_list */
+    saa_wbytes(pinfo, elf_module, strlen(elf_module)+1);
+    saa_wbytes(pinfo, nasm_signature, strlen(nasm_signature)+1);
+    saa_write16(pinfo,DW_LANG_Mips_Assembler);
+    saa_write8(pinfo,2);                       /* abbrviation number LEB128u */
+    saa_write64(pinforel, pinfo->datalen + 4);
+    saa_write64(pinforel, ((uint64_t)(dwarf_fsect->section + 2) << 32) +  R_X86_64_64);
+    saa_write64(pinforel, 0);
+    saa_write64(pinfo,0);                      /* DW_AT_low_pc */
+    saa_write64(pinfo,0);                      /* DW_AT_frame_base */
+    saa_write8(pinfo,0);                       /* end of entries */
+    saalen = pinfo->datalen;
+    infolen = saalen + 4;
+    infobuf = pbuf = nasm_malloc(infolen);
+    WRITELONG(pbuf,saalen);     /* initial length */
+    saa_rnbytes(pinfo, pbuf, saalen);
+    saa_free(pinfo);
+
+    /* build rela.info section */
+    inforellen = saalen = pinforel->datalen;
+    inforelbuf = pbuf = nasm_malloc(inforellen);
+    saa_rnbytes(pinforel, pbuf, saalen);
+    saa_free(pinforel);
+
+    /* build abbrev section */
+    pabbrev = saa_init(1L);
+    saa_write8(pabbrev,1);      /* entry number LEB128u */
+    saa_write8(pabbrev,DW_TAG_compile_unit);    /* tag LEB128u */
+    saa_write8(pabbrev,1);      /* has children */
+    /* the following attributes and forms are all LEB128u values */
+    saa_write8(pabbrev,DW_AT_low_pc);
+    saa_write8(pabbrev,DW_FORM_addr);
+    saa_write8(pabbrev,DW_AT_high_pc);
+    saa_write8(pabbrev,DW_FORM_addr);
+    saa_write8(pabbrev,DW_AT_stmt_list);
+    saa_write8(pabbrev,DW_FORM_data4);
+    saa_write8(pabbrev,DW_AT_name);
+    saa_write8(pabbrev,DW_FORM_string);
+    saa_write8(pabbrev,DW_AT_producer);
+    saa_write8(pabbrev,DW_FORM_string);
+    saa_write8(pabbrev,DW_AT_language);
+    saa_write8(pabbrev,DW_FORM_data2);
+    saa_write16(pabbrev,0);     /* end of entry */
+    /* LEB128u usage same as above */
+    saa_write8(pabbrev,2);      /* entry number */
+    saa_write8(pabbrev,DW_TAG_subprogram);
+    saa_write8(pabbrev,0);      /* no children */
+    saa_write8(pabbrev,DW_AT_low_pc);
+    saa_write8(pabbrev,DW_FORM_addr);
+    saa_write8(pabbrev,DW_AT_frame_base);
+    saa_write8(pabbrev,DW_FORM_data4);
+    saa_write16(pabbrev,0);     /* end of entry */
+    abbrevlen = saalen = pabbrev->datalen;
+    abbrevbuf = pbuf = nasm_malloc(saalen);
+    saa_rnbytes(pabbrev, pbuf, saalen);
+    saa_free(pabbrev);
+
+    /* build line section */
+    /* prolog */
+    plines = saa_init(1L);
+    saa_write8(plines,1);                      /* Minimum Instruction Length */
+    saa_write8(plines,1);                      /* Initial value of 'is_stmt' */
+    saa_write8(plines,line_base);              /* Line Base */
+    saa_write8(plines,line_range);     /* Line Range */
+    saa_write8(plines,opcode_base);    /* Opcode Base */
+    /* standard opcode lengths (# of LEB128u operands) */
+    saa_write8(plines,0);                      /* Std opcode 1 length */
+    saa_write8(plines,1);                      /* Std opcode 2 length */
+    saa_write8(plines,1);                      /* Std opcode 3 length */
+    saa_write8(plines,1);                      /* Std opcode 4 length */
+    saa_write8(plines,1);                      /* Std opcode 5 length */
+    saa_write8(plines,0);                      /* Std opcode 6 length */
+    saa_write8(plines,0);                      /* Std opcode 7 length */
+    saa_write8(plines,0);                      /* Std opcode 8 length */
+    saa_write8(plines,1);                      /* Std opcode 9 length */
+    saa_write8(plines,0);                      /* Std opcode 10 length */
+    saa_write8(plines,0);                      /* Std opcode 11 length */
+    saa_write8(plines,1);                      /* Std opcode 12 length */
+    /* Directory Table */ 
+    saa_write8(plines,0);                      /* End of table */
+    /* File Name Table */
+    ftentry = dwarf_flist;
+    for (indx = 0;indx<dwarf_numfiles;indx++)
+    {
+      saa_wbytes(plines, ftentry->filename, (int32_t)(strlen(ftentry->filename) + 1));
+      saa_write8(plines,0);                    /* directory  LEB128u */
+      saa_write8(plines,0);                    /* time LEB128u */
+      saa_write8(plines,0);                    /* size LEB128u */
+      ftentry = ftentry->next;
+    }
+    saa_write8(plines,0);                      /* End of table */
+    linepoff = plines->datalen;
+    linelen = linepoff + totlen + 10;
+    linebuf = pbuf = nasm_malloc(linelen);
+    WRITELONG(pbuf,linelen-4);         /* initial length */
+    WRITESHORT(pbuf,3);                        /* dwarf version */
+    WRITELONG(pbuf,linepoff);          /* offset to line number program */
+    /* write line header */
+    saalen = linepoff;
+    saa_rnbytes(plines, pbuf, saalen);   /* read a given no. of bytes */
+    pbuf += linepoff;
+    saa_free(plines);
+    /* concatonate line program ranges */
+    linepoff += 13;
+    plinesrel = saa_init(1L);
+    psect = dwarf_fsect;
+    for (indx = 0; indx < dwarf_nsections; indx++) {
+        saa_write64(plinesrel, linepoff);
+        saa_write64(plinesrel, ((uint64_t) (psect->section + 2) << 32) +  R_X86_64_64);
+        saa_write64(plinesrel, (uint64_t) 0);
+        plinep = psect->psaa;
+        saalen = plinep->datalen;
+        saa_rnbytes(plinep, pbuf, saalen);
+        pbuf += saalen;
+        linepoff += saalen;
+        saa_free(plinep);
+        /* done with this entry */
+        psect = psect->next;
+    }
+
+
+    /* build rela.lines section */
+    linerellen =saalen = plinesrel->datalen;
+    linerelbuf = pbuf = nasm_malloc(linerellen);
+    saa_rnbytes(plinesrel, pbuf, saalen);
+    saa_free(plinesrel);
+
+    /* build frame section */
+    framelen = 4;
+    framebuf = pbuf = nasm_malloc(framelen);
+    WRITELONG(pbuf,framelen-4); /* initial length */
+
+    /* build loc section */
+    loclen = 16;
+    locbuf = pbuf = nasm_malloc(loclen);
+    WRITEDLONG(pbuf,0);  /* null  beginning offset */
+    WRITEDLONG(pbuf,0);  /* null  ending offset */
+}
+
+static void dwarf64_cleanup(void)
+{
+    nasm_free(arangesbuf);
+    nasm_free(arangesrelbuf);
+    nasm_free(pubnamesbuf);
+    nasm_free(infobuf);
+    nasm_free(inforelbuf);
+    nasm_free(abbrevbuf);
+    nasm_free(linebuf);
+    nasm_free(linerelbuf);
+    nasm_free(framebuf);
+    nasm_free(locbuf);
+}
+
+static void dwarf64_findfile(const char * fname)
+{
+    int finx;
+    struct linelist *match;
+
+    /* return if fname is current file name */
+    if (dwarf_clist && !(strcmp(fname, dwarf_clist->filename)))
+        return;
+
+    /* search for match */
+    match = 0;
+    if (dwarf_flist) {
+        match = dwarf_flist;
+        for (finx = 0; finx < dwarf_numfiles; finx++) {
+            if (!(strcmp(fname, match->filename))) {
+                dwarf_clist = match;
+                return;
+            }
+        }
+    }
+
+    /* add file name to end of list */
+    dwarf_clist = (struct linelist *)nasm_malloc(sizeof(struct linelist));
+    dwarf_numfiles++;
+    dwarf_clist->line = dwarf_numfiles;
+    dwarf_clist->filename = nasm_malloc(strlen(fname) + 1);
+    strcpy(dwarf_clist->filename,fname);
+    dwarf_clist->next = 0;
+    if (!dwarf_flist) {     /* if first entry */
+        dwarf_flist = dwarf_elist = dwarf_clist;
+        dwarf_clist->last = 0;
+    } else {                /* chain to previous entry */
+        dwarf_elist->next = dwarf_clist;
+        dwarf_elist = dwarf_clist;
+    }
+}
+
+static void dwarf64_findsect(const int index)
+{
+    int sinx;
+    struct sectlist *match;
+    struct SAA *plinep;
+
+    /* return if index is current section index */
+    if (dwarf_csect && (dwarf_csect->section == index))
+        return;
+
+    /* search for match */
+    match = 0;
+    if (dwarf_fsect) {
+        match = dwarf_fsect;
+        for (sinx = 0; sinx < dwarf_nsections; sinx++) {
+            if ((match->section == index)) {
+                dwarf_csect = match;
+                return;
+            }
+            match = match->next;
+        }
+    }
+
+    /* add entry to end of list */
+    dwarf_csect = (struct sectlist *)nasm_malloc(sizeof(struct sectlist));
+    dwarf_nsections++;
+    dwarf_csect->psaa = plinep = saa_init(1L);
+    dwarf_csect->line = 1;
+    dwarf_csect->offset = 0;
+    dwarf_csect->file = 1;
+    dwarf_csect->section = index;
+    dwarf_csect->next = 0;
+    /* set relocatable address at start of line program */
+    saa_write8(plinep,DW_LNS_extended_op);
+    saa_write8(plinep,9);   /* operand length */
+    saa_write8(plinep,DW_LNE_set_address);
+    saa_write64(plinep,0);  /* Start Address */
+
+    if (!dwarf_fsect) { /* if first entry */
+        dwarf_fsect = dwarf_esect = dwarf_csect;
+        dwarf_csect->last = 0;
+    } else {            /* chain to previous entry */
+        dwarf_esect->next = dwarf_csect;
+        dwarf_esect = dwarf_csect;
+    }
+}
+
+#endif /* OF_ELF */
diff --git a/output/outform.c b/output/outform.c
new file mode 100644 (file)
index 0000000..fa30986
--- /dev/null
@@ -0,0 +1,92 @@
+/* ----------------------------------------------------------------------- *
+ *   
+ *   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.
+ *
+ * ----------------------------------------------------------------------- */
+
+/*
+ * outform.c   manages a list of output formats, and associates
+ *             them with their relevant drivers. Also has a
+ *             routine to find the correct driver given a name
+ *             for it
+ */
+
+#include "compiler.h"
+
+#include <stdio.h>
+#include <string.h>
+#include <inttypes.h>
+
+#define BUILD_DRIVERS_ARRAY
+#include "output/outform.h"
+
+struct ofmt *ofmt_find(char *name)
+{                               /* find driver */
+    struct ofmt **ofp, *of;
+
+    for (ofp = drivers; (of = *ofp); ofp++) {
+        if (!nasm_stricmp(name, of->shortname))
+            return of;
+    }
+    return NULL;
+}
+
+struct dfmt *dfmt_find(struct ofmt *ofmt, char *name)
+{                               /* find driver */
+    struct dfmt **dfp, *df;
+
+    for (dfp = ofmt->debug_formats; (df = *dfp); dfp++) {
+        if (!nasm_stricmp(name, df->shortname))
+            return df;
+    }
+    return NULL;
+}
+
+void ofmt_list(struct ofmt *deffmt, FILE * fp)
+{
+    struct ofmt **ofp, *of;
+
+    for (ofp = drivers; (of = *ofp); ofp++) {
+        fprintf(fp, "  %c %-10s%s\n",
+                of == deffmt ? '*' : ' ',
+                of->shortname, of->fullname);
+    }
+}
+
+void dfmt_list(struct ofmt *ofmt, FILE *fp)
+{
+    struct dfmt **dfp, *df;
+
+    for (dfp = ofmt->debug_formats; (df = *dfp); dfp++) {
+        fprintf(fp, "  %c %-10s%s\n",
+                df == ofmt->current_dfmt ? '*' : ' ',
+                df->shortname, df->fullname);
+    }
+}
diff --git a/output/outform.h b/output/outform.h
new file mode 100644 (file)
index 0000000..318e716
--- /dev/null
@@ -0,0 +1,344 @@
+/* ----------------------------------------------------------------------- *
+ *   
+ *   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.
+ *
+ * ----------------------------------------------------------------------- */
+
+/*
+ * outform.h    header file for binding output format drivers to the
+ *              remainder of the code in the Netwide Assembler
+ */
+
+/*
+ * This header file allows configuration of which output formats
+ * get compiled into the NASM binary. You can configure by defining
+ * various preprocessor symbols beginning with "OF_", either on the
+ * compiler command line or at the top of this file.
+ *
+ * OF_ONLY                -- only include specified object formats
+ * OF_name                -- ensure that output format 'name' is included
+ * OF_NO_name             -- remove output format 'name'
+ * OF_DOS                 -- ensure that 'obj', 'bin', 'win32' & 'win64' are included.
+ * OF_UNIX                -- ensure that 'aout', 'aoutb', 'coff', 'elf32' & 'elf64' are in.
+ * OF_OTHERS              -- ensure that 'bin', 'as86', 'rdf' 'macho32' & 'macho64' are in.
+ * OF_ALL                 -- ensure that all formats are included.
+ *                           note that this doesn't include 'dbg', which is
+ *                           only really useful if you're doing development
+ *                           work on NASM. Define OF_DBG if you want this.
+ *
+ * OF_DEFAULT=of_name     -- ensure that 'name' is the default format.
+ *
+ * eg: -DOF_UNIX -DOF_ELF32 -DOF_DEFAULT=of_elf32 would be a suitable config
+ * for an average linux system.
+ *
+ * Default config = -DOF_ALL -DOF_DEFAULT=of_bin
+ *
+ * You probably only want to set these options while compiling 'nasm.c'. */
+
+#ifndef NASM_OUTFORM_H
+#define NASM_OUTFORM_H
+
+#include "nasm.h"
+
+/* -------------- USER MODIFIABLE PART ---------------- */
+
+/*
+ * Insert #defines here in accordance with the configuration
+ * instructions above.
+ *
+ * E.g.
+ *
+ * #define OF_ONLY
+ * #define OF_OBJ
+ * #define OF_BIN
+ *
+ * for a 16-bit DOS assembler with no extraneous formats.
+ */
+
+/* ------------ END USER MODIFIABLE PART -------------- */
+
+/* ====configurable info begins here==== */
+/* formats configurable:
+ * bin,obj,elf32,elf64,aout,aoutb,coff,win32,as86,rdf2,macho32,macho64 */
+
+/* process options... */
+
+#ifndef OF_ONLY
+#ifndef OF_ALL
+#define OF_ALL                  /* default is to have all formats */
+#endif
+#endif
+
+#ifdef OF_ALL                   /* set all formats on... */
+#ifndef OF_BIN
+#define OF_BIN
+#endif
+#ifndef OF_OBJ
+#define OF_OBJ
+#endif
+#ifndef OF_ELF32
+#define OF_ELF32
+#endif
+#ifndef OF_ELF64
+#define OF_ELF64
+#endif
+#ifndef OF_COFF
+#define OF_COFF
+#endif
+#ifndef OF_AOUT
+#define OF_AOUT
+#endif
+#ifndef OF_AOUTB
+#define OF_AOUTB
+#endif
+#ifndef OF_WIN32
+#define OF_WIN32
+#endif
+#ifndef OF_WIN64
+#define OF_WIN64
+#endif
+#ifndef OF_AS86
+#define OF_AS86
+#endif
+#ifndef OF_RDF2
+#define OF_RDF2
+#endif
+#ifndef OF_IEEE
+#define OF_IEEE
+#endif
+#ifndef OF_MACHO32
+#define OF_MACHO32
+#endif
+#ifndef OF_MACHO64
+#define OF_MACHO64
+#endif
+#ifndef OF_DBG
+#define OF_DBG
+#endif
+#endif                          /* OF_ALL */
+
+/* turn on groups of formats specified.... */
+#ifdef OF_DOS
+#ifndef OF_OBJ
+#define OF_OBJ
+#endif
+#ifndef OF_BIN
+#define OF_BIN
+#endif
+#ifndef OF_COFF
+#define OF_COFF                        /* COFF is used by DJGPP */
+#endif
+#ifndef OF_WIN32
+#define OF_WIN32
+#endif
+#ifndef OF_WIN64
+#define OF_WIN64
+#endif
+#endif
+
+#ifdef OF_UNIX
+#ifndef OF_AOUT
+#define OF_AOUT
+#endif
+#ifndef OF_AOUTB
+#define OF_AOUTB
+#endif
+#ifndef OF_COFF
+#define OF_COFF
+#endif
+#ifndef OF_ELF32
+#define OF_ELF32
+#endif
+#ifndef OF_ELF64
+#define OF_ELF64
+#endif
+#endif
+
+#ifdef OF_OTHERS
+#ifndef OF_BIN
+#define OF_BIN
+#endif
+#ifndef OF_AS86
+#define OF_AS86
+#endif
+#ifndef OF_RDF2
+#define OF_RDF2
+#endif
+#ifndef OF_IEEE
+#define OF_IEEE
+#endif
+#ifndef OF_MACHO32
+#define OF_MACHO32
+#endif
+#ifndef OF_MACHO64
+#define OF_MACHO64
+#endif
+#endif
+
+/* finally... override any format specifically specified to be off */
+#ifdef OF_NO_BIN
+#undef OF_BIN
+#endif
+#ifdef OF_NO_OBJ
+#undef OF_OBJ
+#endif
+#ifdef OF_NO_ELF32
+#undef OF_ELF32
+#endif
+#ifdef OF_NO_ELF64
+#undef OF_ELF64
+#endif
+#ifdef OF_NO_AOUT
+#undef OF_AOUT
+#endif
+#ifdef OF_NO_AOUTB
+#undef OF_AOUTB
+#endif
+#ifdef OF_NO_COFF
+#undef OF_COFF
+#endif
+#ifdef OF_NO_WIN32
+#undef OF_WIN32
+#endif
+#ifdef OF_NO_WIN64
+#undef OF_WIN64
+#endif
+#ifdef OF_NO_AS86
+#undef OF_AS86
+#endif
+#ifdef OF_NO_RDF2
+#undef OF_RDF2
+#endif
+#ifdef OF_NO_IEEE
+#undef OF_IEEE
+#endif
+#ifdef OF_NO_MACHO32
+#undef OF_MACHO32
+#endif
+#ifdef OF_NO_MACHO64
+#undef OF_MACHO64
+#endif
+#ifdef OF_NO_DBG
+#undef OF_DBG
+#endif
+
+#ifndef OF_DEFAULT
+#define OF_DEFAULT of_bin
+#endif
+
+extern struct ofmt of_bin;
+extern struct ofmt of_ith;
+extern struct ofmt of_srec;
+extern struct ofmt of_aout;
+extern struct ofmt of_aoutb;
+extern struct ofmt of_coff;
+extern struct ofmt of_elf32;
+extern struct ofmt of_elf;
+extern struct ofmt of_elf64;
+extern struct ofmt of_as86;
+extern struct ofmt of_obj;
+extern struct ofmt of_win32;
+extern struct ofmt of_win64;
+extern struct ofmt of_rdf2;
+extern struct ofmt of_ieee;
+extern struct ofmt of_macho32;
+extern struct ofmt of_macho;
+extern struct ofmt of_macho64;
+extern struct ofmt of_dbg;
+
+#ifdef BUILD_DRIVERS_ARRAY      /* only if included from outform.c */
+
+/* pull in the externs for the different formats, then make the *drivers
+ * array based on the above defines */
+
+static struct ofmt *drivers[] = {
+#ifdef OF_BIN
+    &of_bin,
+    &of_ith,
+    &of_srec,
+#endif
+#ifdef OF_AOUT
+    &of_aout,
+#endif
+#ifdef OF_AOUTB
+    &of_aoutb,
+#endif
+#ifdef OF_COFF
+    &of_coff,
+#endif
+#ifdef OF_ELF32
+    &of_elf32,
+    &of_elf,
+#endif
+#ifdef OF_ELF64
+    &of_elf64,
+#endif
+#ifdef OF_AS86
+    &of_as86,
+#endif
+#ifdef OF_OBJ
+    &of_obj,
+#endif
+#ifdef OF_WIN32
+    &of_win32,
+#endif
+#ifdef OF_WIN64
+    &of_win64,
+#endif
+#ifdef OF_RDF2
+    &of_rdf2,
+#endif
+#ifdef OF_IEEE
+    &of_ieee,
+#endif
+#ifdef OF_MACHO32
+    &of_macho32,
+       &of_macho,
+#endif
+#ifdef OF_MACHO64
+    &of_macho64,
+#endif
+#ifdef OF_DBG
+    &of_dbg,
+#endif
+
+    NULL
+};
+
+#endif                          /* BUILD_DRIVERS_ARRAY */
+
+struct ofmt *ofmt_find(char *);
+struct dfmt *dfmt_find(struct ofmt *, char *);
+void ofmt_list(struct ofmt *, FILE *);
+void dfmt_list(struct ofmt *ofmt, FILE * fp);
+struct ofmt *ofmt_register(efunc error);
+extern struct dfmt null_debug_form;
+
+#endif                          /* NASM_OUTFORM_H */
diff --git a/output/outieee.c b/output/outieee.c
new file mode 100644 (file)
index 0000000..e3245f5
--- /dev/null
@@ -0,0 +1,1510 @@
+/* ----------------------------------------------------------------------- *
+ *   
+ *   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.
+ *
+ * ----------------------------------------------------------------------- */
+
+/*
+ * outieee.c   output routines for the Netwide Assembler to produce
+ *             IEEE-std object files
+ */
+
+/* notes: I have tried to make this correspond to the IEEE version
+ * of the standard, specifically the primary ASCII version.  It should
+ * be trivial to create the binary version given this source (which is
+ * one of MANY things that have to be done to make this correspond to
+ * the hp-microtek version of the standard).
+ *
+ * 16-bit support is assumed to use 24-bit addresses
+ * The linker can sort out segmentation-specific stuff
+ * if it keeps track of externals
+ * in terms of being relative to section bases
+ *
+ * A non-standard variable type, the 'Yn' variable, has been introduced.
+ * Basically it is a reference to extern 'n'- denoting the low limit
+ * (L-variable) of the section that extern 'n' is defined in.  Like the
+ * x variable, there may be no explicit assignment to it, it is derived
+ * from the public definition corresponding to the extern name.  This
+ * is required because the one thing the mufom guys forgot to do well was
+ * take into account segmented architectures.
+ *
+ * I use comment classes for various things and these are undefined by
+ * the standard.
+ *
+ * Debug info should be considered totally non-standard (local labels are
+ * standard but linenum records are not covered by the standard.
+ * Type defs have the standard format but absolute meanings for ordinal
+ * types are not covered by the standard.)
+ *
+ * David Lindauer, LADsoft
+ */
+#include "compiler.h"
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <time.h>
+#include <stdarg.h>             /* Note: we need the ANSI version of stdarg.h */
+#include <ctype.h>
+#include <inttypes.h>
+
+#include "nasm.h"
+#include "nasmlib.h"
+#include "output/outform.h"
+#include "output/outlib.h"
+
+#ifdef OF_IEEE
+
+#define ARRAY_BOT 0x1
+
+static char ieee_infile[FILENAME_MAX];
+static int ieee_uppercase;
+
+static bool any_segs;
+static int arrindex;
+
+#define HUNKSIZE 1024           /* Size of the data hunk */
+#define EXT_BLKSIZ 512
+#define LDPERLINE 32            /* bytes per line in output */
+
+struct ieeeSection;
+
+struct LineNumber {
+    struct LineNumber *next;
+    struct ieeeSection *segment;
+    int32_t offset;
+    int32_t lineno;
+};
+
+static struct FileName {
+    struct FileName *next;
+    char *name;
+    int32_t index;
+} *fnhead, **fntail;
+
+static struct Array {
+    struct Array *next;
+    unsigned size;
+    int basetype;
+} *arrhead, **arrtail;
+
+static struct ieeePublic {
+    struct ieeePublic *next;
+    char *name;
+    int32_t offset;
+    int32_t segment;               /* only if it's far-absolute */
+    int32_t index;
+    int type;                   /* for debug purposes */
+} *fpubhead, **fpubtail, *last_defined;
+
+static struct ieeeExternal {
+    struct ieeeExternal *next;
+    char *name;
+    int32_t commonsize;
+} *exthead, **exttail;
+
+static int externals;
+
+static struct ExtBack {
+    struct ExtBack *next;
+    int index[EXT_BLKSIZ];
+} *ebhead, **ebtail;
+
+/* NOTE: the first segment MUST be the lineno segment */
+static struct ieeeSection {
+    struct ieeeObjData *data, *datacurr;
+    struct ieeeSection *next;
+    struct ieeeFixupp *fptr, *flptr;
+    int32_t index;                 /* the NASM segment id */
+    int32_t ieee_index;            /* the OBJ-file segment index */
+    int32_t currentpos;
+    int32_t align;                 /* can be SEG_ABS + absolute addr */
+    int32_t startpos;
+    enum {
+        CMB_PRIVATE = 0,
+        CMB_PUBLIC = 2,
+        CMB_COMMON = 6
+    } combine;
+    int32_t use32;                 /* is this segment 32-bit? */
+    struct ieeePublic *pubhead, **pubtail, *lochead, **loctail;
+    char *name;
+} *seghead, **segtail, *ieee_seg_needs_update;
+
+struct ieeeObjData {
+    struct ieeeObjData *next;
+    uint8_t data[HUNKSIZE];
+};
+
+struct ieeeFixupp {
+    struct ieeeFixupp *next;
+    enum {
+        FT_SEG = 0,
+        FT_REL = 1,
+        FT_OFS = 2,
+        FT_EXT = 3,
+        FT_WRT = 4,
+        FT_EXTREL = 5,
+        FT_EXTWRT = 6,
+        FT_EXTSEG = 7
+    } ftype;
+    int16_t size;
+    int32_t id1;
+    int32_t id2;
+    int32_t offset;
+    int32_t addend;
+};
+
+static int32_t ieee_entry_seg, ieee_entry_ofs;
+static int checksum;
+
+extern struct ofmt of_ieee;
+
+static void ieee_data_new(struct ieeeSection *);
+static void ieee_write_fixup(int32_t, int32_t, struct ieeeSection *,
+                             int, uint64_t, int32_t);
+static void ieee_install_fixup(struct ieeeSection *, struct ieeeFixupp *);
+static int32_t ieee_segment(char *, int, int *);
+static void ieee_write_file(int debuginfo);
+static void ieee_write_byte(struct ieeeSection *, int);
+static void ieee_write_word(struct ieeeSection *, int);
+static void ieee_write_dword(struct ieeeSection *, int32_t);
+static void ieee_putascii(char *, ...);
+static void ieee_putcs(int);
+static int32_t ieee_putld(int32_t, int32_t, uint8_t *);
+static int32_t ieee_putlr(struct ieeeFixupp *);
+static void ieee_unqualified_name(char *, char *);
+
+/*
+ * pup init
+ */
+static void ieee_init(void)
+{
+    any_segs = false;
+    fpubhead = NULL;
+    fpubtail = &fpubhead;
+    exthead = NULL;
+    exttail = &exthead;
+    externals = 1;
+    ebhead = NULL;
+    ebtail = &ebhead;
+    seghead = ieee_seg_needs_update = NULL;
+    segtail = &seghead;
+    ieee_entry_seg = NO_SEG;
+    ieee_uppercase = false;
+    checksum = 0;
+}
+
+static int ieee_set_info(enum geninfo type, char **val)
+{
+    (void)type;
+    (void)val;
+
+    return 0;
+}
+
+/*
+ * Rundown
+ */
+static void ieee_cleanup(int debuginfo)
+{
+    ieee_write_file(debuginfo);
+    of_ieee.current_dfmt->cleanup();
+    while (seghead) {
+        struct ieeeSection *segtmp = seghead;
+        seghead = seghead->next;
+        while (segtmp->pubhead) {
+            struct ieeePublic *pubtmp = segtmp->pubhead;
+            segtmp->pubhead = pubtmp->next;
+            nasm_free(pubtmp);
+        }
+        while (segtmp->fptr) {
+            struct ieeeFixupp *fixtmp = segtmp->fptr;
+            segtmp->fptr = fixtmp->next;
+            nasm_free(fixtmp);
+        }
+        while (segtmp->data) {
+            struct ieeeObjData *dattmp = segtmp->data;
+            segtmp->data = dattmp->next;
+            nasm_free(dattmp);
+        }
+        nasm_free(segtmp);
+    }
+    while (fpubhead) {
+        struct ieeePublic *pubtmp = fpubhead;
+        fpubhead = fpubhead->next;
+        nasm_free(pubtmp);
+    }
+    while (exthead) {
+        struct ieeeExternal *exttmp = exthead;
+        exthead = exthead->next;
+        nasm_free(exttmp);
+    }
+    while (ebhead) {
+        struct ExtBack *ebtmp = ebhead;
+        ebhead = ebhead->next;
+        nasm_free(ebtmp);
+    }
+}
+
+/*
+ * callback for labels
+ */
+static void ieee_deflabel(char *name, int32_t segment,
+                          int64_t offset, int is_global, char *special)
+{
+    /*
+     * We have three cases:
+     *
+     * (i) `segment' is a segment-base. If so, set the name field
+     * for the segment structure it refers to, and then
+     * return.
+     *
+     * (ii) `segment' is one of our segments, or a SEG_ABS segment.
+     * Save the label position for later output of a PUBDEF record.
+     *
+     *
+     * (iii) `segment' is not one of our segments. Save the label
+     * position for later output of an EXTDEF.
+     */
+    struct ieeeExternal *ext;
+    struct ExtBack *eb;
+    struct ieeeSection *seg;
+    int i;
+
+    if (special) {
+        nasm_error(ERR_NONFATAL, "unrecognised symbol type `%s'", special);
+    }
+    /*
+     * First check for the double-period, signifying something
+     * unusual.
+     */
+    if (name[0] == '.' && name[1] == '.') {
+        if (!strcmp(name, "..start")) {
+            ieee_entry_seg = segment;
+            ieee_entry_ofs = offset;
+        }
+        return;
+    }
+
+    /*
+     * Case (i):
+     */
+    if (ieee_seg_needs_update) {
+        ieee_seg_needs_update->name = name;
+        return;
+    }
+    if (segment < SEG_ABS && segment != NO_SEG && segment % 2)
+        return;
+
+    /*
+     * case (ii)
+     */
+    if (segment >= SEG_ABS) {
+        /*
+         * SEG_ABS subcase of (ii).
+         */
+        if (is_global) {
+            struct ieeePublic *pub;
+
+            pub = *fpubtail = nasm_malloc(sizeof(*pub));
+            fpubtail = &pub->next;
+            pub->next = NULL;
+            pub->name = name;
+            pub->offset = offset;
+            pub->segment = segment & ~SEG_ABS;
+        }
+        return;
+    }
+
+    for (seg = seghead; seg && is_global; seg = seg->next)
+        if (seg->index == segment) {
+            struct ieeePublic *pub;
+
+            last_defined = pub = *seg->pubtail = nasm_malloc(sizeof(*pub));
+            seg->pubtail = &pub->next;
+            pub->next = NULL;
+            pub->name = name;
+            pub->offset = offset;
+            pub->index = seg->ieee_index;
+            pub->segment = -1;
+            return;
+        }
+
+    /*
+     * Case (iii).
+     */
+    if (is_global) {
+        ext = *exttail = nasm_malloc(sizeof(*ext));
+        ext->next = NULL;
+        exttail = &ext->next;
+        ext->name = name;
+        if (is_global == 2)
+            ext->commonsize = offset;
+        else
+            ext->commonsize = 0;
+        i = segment / 2;
+        eb = ebhead;
+        if (!eb) {
+            eb = *ebtail = nasm_malloc(sizeof(*eb));
+            eb->next = NULL;
+            ebtail = &eb->next;
+        }
+        while (i > EXT_BLKSIZ) {
+            if (eb && eb->next)
+                eb = eb->next;
+            else {
+                eb = *ebtail = nasm_malloc(sizeof(*eb));
+                eb->next = NULL;
+                ebtail = &eb->next;
+            }
+            i -= EXT_BLKSIZ;
+        }
+        eb->index[i] = externals++;
+    }
+
+}
+
+/*
+ * Put data out
+ */
+static void ieee_out(int32_t segto, const void *data,
+                    enum out_type type, uint64_t size,
+                     int32_t segment, int32_t wrt)
+{
+    const uint8_t *ucdata;
+    int32_t ldata;
+    struct ieeeSection *seg;
+
+    /*
+     * handle absolute-assembly (structure definitions)
+     */
+    if (segto == NO_SEG) {
+        if (type != OUT_RESERVE)
+            nasm_error(ERR_NONFATAL, "attempt to assemble code in [ABSOLUTE]"
+                  " space");
+        return;
+    }
+
+    /*
+     * If `any_segs' is still false, we must define a default
+     * segment.
+     */
+    if (!any_segs) {
+        int tempint;            /* ignored */
+        if (segto != ieee_segment("__NASMDEFSEG", 2, &tempint))
+            nasm_error(ERR_PANIC, "strange segment conditions in IEEE driver");
+    }
+
+    /*
+     * Find the segment we are targetting.
+     */
+    for (seg = seghead; seg; seg = seg->next)
+        if (seg->index == segto)
+            break;
+    if (!seg)
+        nasm_error(ERR_PANIC, "code directed to nonexistent segment?");
+
+    if (type == OUT_RAWDATA) {
+        ucdata = data;
+        while (size--)
+            ieee_write_byte(seg, *ucdata++);
+    } else if (type == OUT_ADDRESS || type == OUT_REL2ADR ||
+               type == OUT_REL4ADR) {
+        if (segment == NO_SEG && type != OUT_ADDRESS)
+            nasm_error(ERR_NONFATAL, "relative call to absolute address not"
+                  " supported by IEEE format");
+        ldata = *(int64_t *)data;
+        if (type == OUT_REL2ADR)
+            ldata += (size - 2);
+        if (type == OUT_REL4ADR)
+            ldata += (size - 4);
+        ieee_write_fixup(segment, wrt, seg, size, type, ldata);
+        if (size == 2)
+            ieee_write_word(seg, ldata);
+        else
+            ieee_write_dword(seg, ldata);
+    } else if (type == OUT_RESERVE) {
+        while (size--)
+            ieee_write_byte(seg, 0);
+    }
+}
+
+static void ieee_data_new(struct ieeeSection *segto)
+{
+
+    if (!segto->data)
+        segto->data = segto->datacurr =
+            nasm_malloc(sizeof(*(segto->datacurr)));
+    else
+        segto->datacurr = segto->datacurr->next =
+            nasm_malloc(sizeof(*(segto->datacurr)));
+    segto->datacurr->next = NULL;
+}
+
+/*
+ * this routine is unalduterated bloatware.  I usually don't do this
+ * but I might as well see what it is like on a harmless program.
+ * If anyone wants to optimize this is a good canditate!
+ */
+static void ieee_write_fixup(int32_t segment, int32_t wrt,
+                             struct ieeeSection *segto, int size,
+                             uint64_t realtype, int32_t offset)
+{
+    struct ieeeSection *target;
+    struct ieeeFixupp s;
+
+    /* Don't put a fixup for things NASM can calculate */
+    if (wrt == NO_SEG && segment == NO_SEG)
+        return;
+
+    s.ftype = -1;
+    /* if it is a WRT offset */
+    if (wrt != NO_SEG) {
+        s.ftype = FT_WRT;
+        s.addend = offset;
+        if (wrt >= SEG_ABS)
+            s.id1 = -(wrt - SEG_ABS);
+        else {
+            if (wrt % 2 && realtype != OUT_REL2ADR
+                && realtype != OUT_REL4ADR) {
+                wrt--;
+
+                for (target = seghead; target; target = target->next)
+                    if (target->index == wrt)
+                        break;
+                if (target) {
+                    s.id1 = target->ieee_index;
+                    for (target = seghead; target; target = target->next)
+                        if (target->index == segment)
+                            break;
+
+                    if (target)
+                        s.id2 = target->ieee_index;
+                    else {
+                        /*
+                         * Now we assume the segment field is being used
+                         * to hold an extern index
+                         */
+                        int32_t i = segment / 2;
+                        struct ExtBack *eb = ebhead;
+                        while (i > EXT_BLKSIZ) {
+                            if (eb)
+                                eb = eb->next;
+                            else
+                                break;
+                            i -= EXT_BLKSIZ;
+                        }
+                        /* if we have an extern decide the type and make a record
+                         */
+                        if (eb) {
+                            s.ftype = FT_EXTWRT;
+                            s.addend = 0;
+                            s.id2 = eb->index[i];
+                        } else
+                            nasm_error(ERR_NONFATAL,
+                                  "Source of WRT must be an offset");
+                    }
+
+                } else
+                    nasm_error(ERR_PANIC,
+                          "unrecognised WRT value in ieee_write_fixup");
+            } else
+                nasm_error(ERR_NONFATAL, "target of WRT must be a section ");
+        }
+        s.size = size;
+        ieee_install_fixup(segto, &s);
+        return;
+    }
+    /* Pure segment fixup ? */
+    if (segment != NO_SEG) {
+        s.ftype = FT_SEG;
+        s.id1 = 0;
+        if (segment >= SEG_ABS) {
+            /* absolute far segment fixup */
+            s.id1 = -(segment - ~SEG_ABS);
+        } else if (segment % 2) {
+            /* fixup to named segment */
+            /* look it up */
+            for (target = seghead; target; target = target->next)
+                if (target->index == segment - 1)
+                    break;
+            if (target)
+                s.id1 = target->ieee_index;
+            else {
+                /*
+                 * Now we assume the segment field is being used
+                 * to hold an extern index
+                 */
+                int32_t i = segment / 2;
+                struct ExtBack *eb = ebhead;
+                while (i > EXT_BLKSIZ) {
+                    if (eb)
+                        eb = eb->next;
+                    else
+                        break;
+                    i -= EXT_BLKSIZ;
+                }
+                /* if we have an extern decide the type and make a record
+                 */
+                if (eb) {
+                    if (realtype == OUT_REL2ADR || realtype == OUT_REL4ADR) {
+                        nasm_error(ERR_PANIC,
+                              "Segment of a rel not supported in ieee_write_fixup");
+                    } else {
+                        /* If we want the segment */
+                        s.ftype = FT_EXTSEG;
+                        s.addend = 0;
+                        s.id1 = eb->index[i];
+                    }
+
+                } else
+                    /* If we get here the seg value doesn't make sense */
+                    nasm_error(ERR_PANIC,
+                          "unrecognised segment value in ieee_write_fixup");
+            }
+
+        } else {
+            /* Assume we are offsetting directly from a section
+             * So look up the target segment
+             */
+            for (target = seghead; target; target = target->next)
+                if (target->index == segment)
+                    break;
+            if (target) {
+                if (realtype == OUT_REL2ADR || realtype == OUT_REL4ADR) {
+                    /* PC rel to a known offset */
+                    s.id1 = target->ieee_index;
+                    s.ftype = FT_REL;
+                    s.size = size;
+                    s.addend = offset;
+                } else {
+                    /* We were offsetting from a seg */
+                    s.id1 = target->ieee_index;
+                    s.ftype = FT_OFS;
+                    s.size = size;
+                    s.addend = offset;
+                }
+            } else {
+                /*
+                 * Now we assume the segment field is being used
+                 * to hold an extern index
+                 */
+                int32_t i = segment / 2;
+                struct ExtBack *eb = ebhead;
+                while (i > EXT_BLKSIZ) {
+                    if (eb)
+                        eb = eb->next;
+                    else
+                        break;
+                    i -= EXT_BLKSIZ;
+                }
+                /* if we have an extern decide the type and make a record
+                 */
+                if (eb) {
+                    if (realtype == OUT_REL2ADR || realtype == OUT_REL4ADR) {
+                        s.ftype = FT_EXTREL;
+                        s.addend = 0;
+                        s.id1 = eb->index[i];
+                    } else {
+                        /* else we want the external offset */
+                        s.ftype = FT_EXT;
+                        s.addend = 0;
+                        s.id1 = eb->index[i];
+                    }
+
+                } else
+                    /* If we get here the seg value doesn't make sense */
+                    nasm_error(ERR_PANIC,
+                          "unrecognised segment value in ieee_write_fixup");
+            }
+        }
+        if (size != 2 && s.ftype == FT_SEG)
+            nasm_error(ERR_NONFATAL, "IEEE format can only handle 2-byte"
+                  " segment base references");
+        s.size = size;
+        ieee_install_fixup(segto, &s);
+        return;
+    }
+    /* should never get here */
+}
+static void ieee_install_fixup(struct ieeeSection *seg,
+                               struct ieeeFixupp *fix)
+{
+    struct ieeeFixupp *f;
+    f = nasm_malloc(sizeof(struct ieeeFixupp));
+    memcpy(f, fix, sizeof(struct ieeeFixupp));
+    f->offset = seg->currentpos;
+    seg->currentpos += fix->size;
+    f->next = NULL;
+    if (seg->fptr)
+        seg->flptr = seg->flptr->next = f;
+    else
+        seg->fptr = seg->flptr = f;
+
+}
+
+/*
+ * segment registry
+ */
+static int32_t ieee_segment(char *name, int pass, int *bits)
+{
+    /*
+     * We call the label manager here to define a name for the new
+     * segment, and when our _own_ label-definition stub gets
+     * called in return, it should register the new segment name
+     * using the pointer it gets passed. That way we save memory,
+     * by sponging off the label manager.
+     */
+    if (!name) {
+        *bits = 16;
+        if (!any_segs)
+            return 0;
+        return seghead->index;
+    } else {
+        struct ieeeSection *seg;
+        int ieee_idx, attrs;
+       bool rn_error;
+        char *p;
+
+        /*
+         * Look for segment attributes.
+         */
+        attrs = 0;
+        while (*name == '.')
+            name++;             /* hack, but a documented one */
+        p = name;
+        while (*p && !nasm_isspace(*p))
+            p++;
+        if (*p) {
+            *p++ = '\0';
+            while (*p && nasm_isspace(*p))
+                *p++ = '\0';
+        }
+        while (*p) {
+            while (*p && !nasm_isspace(*p))
+                p++;
+            if (*p) {
+                *p++ = '\0';
+                while (*p && nasm_isspace(*p))
+                    *p++ = '\0';
+            }
+
+            attrs++;
+        }
+
+        ieee_idx = 1;
+        for (seg = seghead; seg; seg = seg->next) {
+            ieee_idx++;
+            if (!strcmp(seg->name, name)) {
+                if (attrs > 0 && pass == 1)
+                    nasm_error(ERR_WARNING, "segment attributes specified on"
+                          " redeclaration of segment: ignoring");
+                if (seg->use32)
+                    *bits = 32;
+                else
+                    *bits = 16;
+                return seg->index;
+            }
+        }
+
+        *segtail = seg = nasm_malloc(sizeof(*seg));
+        seg->next = NULL;
+        segtail = &seg->next;
+        seg->index = seg_alloc();
+        seg->ieee_index = ieee_idx;
+        any_segs = true;
+        seg->name = NULL;
+        seg->currentpos = 0;
+        seg->align = 1;         /* default */
+        seg->use32 = *bits == 32;       /* default to user spec */
+        seg->combine = CMB_PUBLIC;      /* default */
+        seg->pubhead = NULL;
+        seg->pubtail = &seg->pubhead;
+        seg->data = NULL;
+        seg->fptr = NULL;
+        seg->lochead = NULL;
+        seg->loctail = &seg->lochead;
+
+        /*
+         * Process the segment attributes.
+         */
+        p = name;
+        while (attrs--) {
+            p += strlen(p);
+            while (!*p)
+                p++;
+
+            /*
+             * `p' contains a segment attribute.
+             */
+            if (!nasm_stricmp(p, "private"))
+                seg->combine = CMB_PRIVATE;
+            else if (!nasm_stricmp(p, "public"))
+                seg->combine = CMB_PUBLIC;
+            else if (!nasm_stricmp(p, "common"))
+                seg->combine = CMB_COMMON;
+            else if (!nasm_stricmp(p, "use16"))
+                seg->use32 = false;
+            else if (!nasm_stricmp(p, "use32"))
+                seg->use32 = true;
+            else if (!nasm_strnicmp(p, "align=", 6)) {
+                seg->align = readnum(p + 6, &rn_error);
+                if (seg->align == 0)
+                    seg->align = 1;
+                if (rn_error) {
+                    seg->align = 1;
+                    nasm_error(ERR_NONFATAL, "segment alignment should be"
+                          " numeric");
+                }
+                switch ((int)seg->align) {
+                case 1:        /* BYTE */
+                case 2:        /* WORD */
+                case 4:        /* DWORD */
+                case 16:       /* PARA */
+                case 256:      /* PAGE */
+                case 8:
+                case 32:
+                case 64:
+                case 128:
+                    break;
+                default:
+                    nasm_error(ERR_NONFATAL, "invalid alignment value %d",
+                          seg->align);
+                    seg->align = 1;
+                    break;
+                }
+            } else if (!nasm_strnicmp(p, "absolute=", 9)) {
+                seg->align = SEG_ABS + readnum(p + 9, &rn_error);
+                if (rn_error)
+                    nasm_error(ERR_NONFATAL, "argument to `absolute' segment"
+                          " attribute should be numeric");
+            }
+        }
+
+        ieee_seg_needs_update = seg;
+        if (seg->align >= SEG_ABS)
+            define_label(name, NO_SEG, seg->align - SEG_ABS,
+                        NULL, false, false);
+        else
+            define_label(name, seg->index + 1, 0L, NULL, false, false);
+        ieee_seg_needs_update = NULL;
+
+        if (seg->use32)
+            *bits = 32;
+        else
+            *bits = 16;
+        return seg->index;
+    }
+}
+
+/*
+ * directives supported
+ */
+static int ieee_directive(enum directives directive, char *value, int pass)
+{
+
+    (void)value;
+    (void)pass;
+
+    switch (directive) {
+    case D_UPPERCASE:
+        ieee_uppercase = true;
+        return 1;
+       
+    default:
+       return 0;
+    }
+}
+
+/*
+ * Return segment data
+ */
+static int32_t ieee_segbase(int32_t segment)
+{
+    struct ieeeSection *seg;
+
+    /*
+     * Find the segment in our list.
+     */
+    for (seg = seghead; seg; seg = seg->next)
+        if (seg->index == segment - 1)
+            break;
+
+    if (!seg)
+        return segment;         /* not one of ours - leave it alone */
+
+    if (seg->align >= SEG_ABS)
+        return seg->align;      /* absolute segment */
+
+    return segment;             /* no special treatment */
+}
+
+/*
+ * filename
+ */
+static void ieee_filename(char *inname, char *outname)
+{
+    strcpy(ieee_infile, inname);
+    standard_extension(inname, outname, ".o");
+}
+
+static void ieee_write_file(int debuginfo)
+{
+    struct tm *thetime;
+    time_t reltime;
+    struct FileName *fn;
+    struct ieeeSection *seg;
+    struct ieeePublic *pub, *loc;
+    struct ieeeExternal *ext;
+    struct ieeeObjData *data;
+    struct ieeeFixupp *fix;
+    struct Array *arr;
+    int i;
+
+    /*
+     * Write the module header
+     */
+    ieee_putascii("MBFNASM,%02X%s.\n", strlen(ieee_infile), ieee_infile);
+
+    /*
+     * Write the NASM boast comment.
+     */
+    ieee_putascii("CO0,%02X%s.\n", strlen(nasm_comment), nasm_comment);
+
+    /*
+     * write processor-specific information
+     */
+    ieee_putascii("AD8,4,L.\n");
+
+    /*
+     * date and time
+     */
+    time(&reltime);
+    thetime = localtime(&reltime);
+    ieee_putascii("DT%04d%02d%02d%02d%02d%02d.\n",
+                  1900 + thetime->tm_year, thetime->tm_mon + 1,
+                  thetime->tm_mday, thetime->tm_hour, thetime->tm_min,
+                  thetime->tm_sec);
+    /*
+     * if debugging, dump file names
+     */
+    for (fn = fnhead; fn && debuginfo; fn = fn->next) {
+        ieee_putascii("C0105,%02X%s.\n", strlen(fn->name), fn->name);
+    }
+
+    ieee_putascii("CO101,07ENDHEAD.\n");
+    /*
+     * the standard doesn't specify when to put checksums,
+     * we'll just do it periodically.
+     */
+    ieee_putcs(false);
+
+    /*
+     * Write the section headers
+     */
+    seg = seghead;
+    if (!debuginfo && !strcmp(seg->name, "??LINE"))
+        seg = seg->next;
+    while (seg) {
+        char buf[256];
+        char attrib;
+        switch (seg->combine) {
+        case CMB_PUBLIC:
+        default:
+            attrib = 'C';
+            break;
+        case CMB_PRIVATE:
+            attrib = 'S';
+            break;
+        case CMB_COMMON:
+            attrib = 'M';
+            break;
+        }
+        ieee_unqualified_name(buf, seg->name);
+        if (seg->align >= SEG_ABS) {
+            ieee_putascii("ST%X,A,%02X%s.\n", seg->ieee_index,
+                          strlen(buf), buf);
+            ieee_putascii("ASL%X,%lX.\n", seg->ieee_index,
+                          (seg->align - SEG_ABS) * 16);
+        } else {
+            ieee_putascii("ST%X,%c,%02X%s.\n", seg->ieee_index, attrib,
+                          strlen(buf), buf);
+            ieee_putascii("SA%X,%lX.\n", seg->ieee_index, seg->align);
+            ieee_putascii("ASS%X,%X.\n", seg->ieee_index,
+                          seg->currentpos);
+        }
+        seg = seg->next;
+    }
+    /*
+     * write the start address if there is one
+     */
+    if (ieee_entry_seg) {
+        for (seg = seghead; seg; seg = seg->next)
+            if (seg->index == ieee_entry_seg)
+                break;
+        if (!seg)
+            nasm_error(ERR_PANIC, "Start address records are incorrect");
+        else
+            ieee_putascii("ASG,R%X,%lX,+.\n", seg->ieee_index,
+                          ieee_entry_ofs);
+    }
+
+    ieee_putcs(false);
+    /*
+     * Write the publics
+     */
+    i = 1;
+    for (seg = seghead; seg; seg = seg->next) {
+        for (pub = seg->pubhead; pub; pub = pub->next) {
+            char buf[256];
+            ieee_unqualified_name(buf, pub->name);
+            ieee_putascii("NI%X,%02X%s.\n", i, strlen(buf), buf);
+            if (pub->segment == -1)
+                ieee_putascii("ASI%X,R%X,%lX,+.\n", i, pub->index,
+                              pub->offset);
+            else
+                ieee_putascii("ASI%X,%lX,%lX,+.\n", i, pub->segment * 16,
+                              pub->offset);
+            if (debuginfo) {
+                if (pub->type >= 0x100)
+                    ieee_putascii("ATI%X,T%X.\n", i, pub->type - 0x100);
+                else
+                    ieee_putascii("ATI%X,%X.\n", i, pub->type);
+            }
+            i++;
+        }
+    }
+    pub = fpubhead;
+    i = 1;
+    while (pub) {
+        char buf[256];
+        ieee_unqualified_name(buf, pub->name);
+        ieee_putascii("NI%X,%02X%s.\n", i, strlen(buf), buf);
+        if (pub->segment == -1)
+            ieee_putascii("ASI%X,R%X,%lX,+.\n", i, pub->index,
+                          pub->offset);
+        else
+            ieee_putascii("ASI%X,%lX,%lX,+.\n", i, pub->segment * 16,
+                          pub->offset);
+        if (debuginfo) {
+            if (pub->type >= 0x100)
+                ieee_putascii("ATI%X,T%X.\n", i, pub->type - 0x100);
+            else
+                ieee_putascii("ATI%X,%X.\n", i, pub->type);
+        }
+        i++;
+        pub = pub->next;
+    }
+    /*
+     * Write the externals
+     */
+    ext = exthead;
+    i = 1;
+    while (ext) {
+        char buf[256];
+        ieee_unqualified_name(buf, ext->name);
+        ieee_putascii("NX%X,%02X%s.\n", i++, strlen(buf), buf);
+        ext = ext->next;
+    }
+    ieee_putcs(false);
+
+    /*
+     * IEEE doesn't have a standard pass break record
+     * so use the ladsoft variant
+     */
+    ieee_putascii("CO100,06ENDSYM.\n");
+
+    /*
+     * now put types
+     */
+    i = ARRAY_BOT;
+    for (arr = arrhead; arr && debuginfo; arr = arr->next) {
+        ieee_putascii("TY%X,20,%X,%lX.\n", i++, arr->basetype,
+                      arr->size);
+    }
+    /*
+     * now put locals
+     */
+    i = 1;
+    for (seg = seghead; seg && debuginfo; seg = seg->next) {
+        for (loc = seg->lochead; loc; loc = loc->next) {
+            char buf[256];
+            ieee_unqualified_name(buf, loc->name);
+            ieee_putascii("NN%X,%02X%s.\n", i, strlen(buf), buf);
+            if (loc->segment == -1)
+                ieee_putascii("ASN%X,R%X,%lX,+.\n", i, loc->index,
+                              loc->offset);
+            else
+                ieee_putascii("ASN%X,%lX,%lX,+.\n", i, loc->segment * 16,
+                              loc->offset);
+            if (debuginfo) {
+                if (loc->type >= 0x100)
+                    ieee_putascii("ATN%X,T%X.\n", i, loc->type - 0x100);
+                else
+                    ieee_putascii("ATN%X,%X.\n", i, loc->type);
+            }
+            i++;
+        }
+    }
+
+    /*
+     *  put out section data;
+     */
+    seg = seghead;
+    if (!debuginfo && !strcmp(seg->name, "??LINE"))
+        seg = seg->next;
+    while (seg) {
+        if (seg->currentpos) {
+            int32_t size, org = 0;
+            data = seg->data;
+            ieee_putascii("SB%X.\n", seg->ieee_index);
+            fix = seg->fptr;
+            while (fix) {
+                size = HUNKSIZE - (org % HUNKSIZE);
+                size =
+                    size + org >
+                    seg->currentpos ? seg->currentpos - org : size;
+                size = fix->offset - org > size ? size : fix->offset - org;
+                org = ieee_putld(org, org + size, data->data);
+                if (org % HUNKSIZE == 0)
+                    data = data->next;
+                if (org == fix->offset) {
+                    org += ieee_putlr(fix);
+                    fix = fix->next;
+                }
+            }
+            while (org < seg->currentpos && data) {
+                size =
+                    seg->currentpos - org >
+                    HUNKSIZE ? HUNKSIZE : seg->currentpos - org;
+                org = ieee_putld(org, org + size, data->data);
+                data = data->next;
+            }
+            ieee_putcs(false);
+
+        }
+        seg = seg->next;
+    }
+    /*
+     * module end record
+     */
+    ieee_putascii("ME.\n");
+}
+
+static void ieee_write_byte(struct ieeeSection *seg, int data)
+{
+    int temp;
+    if (!(temp = seg->currentpos++ % HUNKSIZE))
+        ieee_data_new(seg);
+    seg->datacurr->data[temp] = data;
+}
+
+static void ieee_write_word(struct ieeeSection *seg, int data)
+{
+    ieee_write_byte(seg, data & 0xFF);
+    ieee_write_byte(seg, (data >> 8) & 0xFF);
+}
+
+static void ieee_write_dword(struct ieeeSection *seg, int32_t data)
+{
+    ieee_write_byte(seg, data & 0xFF);
+    ieee_write_byte(seg, (data >> 8) & 0xFF);
+    ieee_write_byte(seg, (data >> 16) & 0xFF);
+    ieee_write_byte(seg, (data >> 24) & 0xFF);
+}
+static void ieee_putascii(char *format, ...)
+{
+    char buffer[256];
+    int i, l;
+    va_list ap;
+
+    va_start(ap, format);
+    vsnprintf(buffer, sizeof(buffer), format, ap);
+    l = strlen(buffer);
+    for (i = 0; i < l; i++)
+        if ((uint8_t)buffer[i] > 31)
+            checksum += buffer[i];
+    va_end(ap);
+    fputs(buffer, ofile);
+}
+
+/*
+ * put out a checksum record */
+static void ieee_putcs(int toclear)
+{
+    if (toclear) {
+        ieee_putascii("CS.\n");
+    } else {
+        checksum += 'C';
+        checksum += 'S';
+        ieee_putascii("CS%02X.\n", checksum & 127);
+    }
+    checksum = 0;
+}
+
+static int32_t ieee_putld(int32_t start, int32_t end, uint8_t *buf)
+{
+    int32_t val;
+    if (start == end)
+        return (start);
+    val = start % HUNKSIZE;
+    /* fill up multiple lines */
+    while (end - start >= LDPERLINE) {
+        int i;
+        ieee_putascii("LD");
+        for (i = 0; i < LDPERLINE; i++) {
+            ieee_putascii("%02X", buf[val++]);
+            start++;
+        }
+        ieee_putascii(".\n");
+    }
+    /* if no partial lines */
+    if (start == end)
+        return (start);
+    /* make a partial line */
+    ieee_putascii("LD");
+    while (start < end) {
+        ieee_putascii("%02X", buf[val++]);
+        start++;
+    }
+    ieee_putascii(".\n");
+    return (start);
+}
+static int32_t ieee_putlr(struct ieeeFixupp *p)
+{
+/*
+ * To deal with the vagaries of segmentation the LADsoft linker
+ * defines two types of segments: absolute and virtual.  Note that
+ * 'absolute' in this context is a different thing from the IEEE
+ * definition of an absolute segment type, which is also supported. If a
+ * sement is linked in virtual mode the low limit (L-var) is
+ * subtracted from each R,X, and P variable which appears in an
+ * expression, so that we can have relative offsets.  Meanwhile
+ * in the ABSOLUTE mode this subtraction is not done and
+ * so we can use absolute offsets from 0.  In the LADsoft linker
+ * this configuration is not done in the assemblker source but in
+ * a source the linker reads.  Generally this type of thing only
+ * becomes an issue if real mode code is used.  A pure 32-bit linker could
+ * get away without defining the virtual mode...
+ */
+    char buf[40];
+    int32_t size = p->size;
+    switch (p->ftype) {
+    case FT_SEG:
+        if (p->id1 < 0)
+            sprintf(buf, "%"PRIX32"", -p->id1);
+        else
+            sprintf(buf, "L%"PRIX32",10,/", p->id1);
+        break;
+    case FT_OFS:
+        sprintf(buf, "R%"PRIX32",%"PRIX32",+", p->id1, p->addend);
+        break;
+    case FT_REL:
+        sprintf(buf, "R%"PRIX32",%"PRIX32",+,P,-,%X,-", p->id1, p->addend, p->size);
+        break;
+
+    case FT_WRT:
+        if (p->id2 < 0)
+            sprintf(buf, "R%"PRIX32",%"PRIX32",+,L%"PRIX32",+,%"PRIX32",-", p->id2, p->addend,
+                    p->id2, -p->id1 * 16);
+        else
+            sprintf(buf, "R%"PRIX32",%"PRIX32",+,L%"PRIX32",+,L%"PRIX32",-", p->id2, p->addend,
+                    p->id2, p->id1);
+        break;
+    case FT_EXT:
+        sprintf(buf, "X%"PRIX32"", p->id1);
+        break;
+    case FT_EXTREL:
+        sprintf(buf, "X%"PRIX32",P,-,%"PRIX32",-", p->id1, size);
+        break;
+    case FT_EXTSEG:
+        /* We needed a non-ieee hack here.
+         * We introduce the Y variable, which is the low
+         * limit of the native segment the extern resides in
+         */
+        sprintf(buf, "Y%"PRIX32",10,/", p->id1);
+        break;
+    case FT_EXTWRT:
+        if (p->id2 < 0)
+            sprintf(buf, "X%"PRIX32",Y%"PRIX32",+,%"PRIX32",-", p->id2, p->id2,
+                    -p->id1 * 16);
+        else
+            sprintf(buf, "X%"PRIX32",Y%"PRIX32",+,L%"PRIX32",-", p->id2, p->id2, p->id1);
+        break;
+    }
+    ieee_putascii("LR(%s,%"PRIX32").\n", buf, size);
+
+    return (size);
+}
+
+/* Dump all segment data (text and fixups )*/
+
+static void ieee_unqualified_name(char *dest, char *source)
+{
+    if (ieee_uppercase) {
+        while (*source)
+            *dest++ = toupper(*source++);
+        *dest = 0;
+    } else
+        strcpy(dest, source);
+}
+void dbgls_init(void)
+{
+    int tempint;
+
+    fnhead = NULL;
+    fntail = &fnhead;
+    arrindex = ARRAY_BOT;
+    arrhead = NULL;
+    arrtail = &arrhead;
+    ieee_segment("??LINE", 2, &tempint);
+    any_segs = false;
+}
+static void dbgls_cleanup(void)
+{
+    struct ieeeSection *segtmp;
+    while (fnhead) {
+        struct FileName *fntemp = fnhead;
+        fnhead = fnhead->next;
+        nasm_free(fntemp->name);
+        nasm_free(fntemp);
+    }
+    for (segtmp = seghead; segtmp; segtmp = segtmp->next) {
+        while (segtmp->lochead) {
+            struct ieeePublic *loctmp = segtmp->lochead;
+            segtmp->lochead = loctmp->next;
+            nasm_free(loctmp->name);
+            nasm_free(loctmp);
+        }
+    }
+    while (arrhead) {
+        struct Array *arrtmp = arrhead;
+        arrhead = arrhead->next;
+        nasm_free(arrtmp);
+    }
+}
+
+/*
+ * because this routine is not bracketed in
+ * the main program, this routine will be called even if there
+ * is no request for debug info
+ * so, we have to make sure the ??LINE segment is avaialbe
+ * as the first segment when this debug format is selected
+ */
+static void dbgls_linnum(const char *lnfname, int32_t lineno, int32_t segto)
+{
+    struct FileName *fn;
+    struct ieeeSection *seg;
+    int i = 0;
+    if (segto == NO_SEG)
+        return;
+
+    /*
+     * If `any_segs' is still false, we must define a default
+     * segment.
+     */
+    if (!any_segs) {
+        int tempint;            /* ignored */
+        if (segto != ieee_segment("__NASMDEFSEG", 2, &tempint))
+            nasm_error(ERR_PANIC, "strange segment conditions in OBJ driver");
+    }
+
+    /*
+     * Find the segment we are targetting.
+     */
+    for (seg = seghead; seg; seg = seg->next)
+        if (seg->index == segto)
+            break;
+    if (!seg)
+        nasm_error(ERR_PANIC, "lineno directed to nonexistent segment?");
+
+    for (fn = fnhead; fn; fn = fn->next) {
+        if (!nasm_stricmp(lnfname, fn->name))
+            break;
+        i++;
+    }
+    if (!fn) {
+        fn = nasm_malloc(sizeof(*fn));
+        fn->name = nasm_malloc(strlen(lnfname) + 1);
+        fn->index = i;
+        strcpy(fn->name, lnfname);
+        fn->next = NULL;
+        *fntail = fn;
+        fntail = &fn->next;
+    }
+    ieee_write_byte(seghead, fn->index);
+    ieee_write_word(seghead, lineno);
+    ieee_write_fixup(segto, NO_SEG, seghead, 4, OUT_ADDRESS,
+                     seg->currentpos);
+
+}
+static void dbgls_deflabel(char *name, int32_t segment,
+                           int64_t offset, int is_global, char *special)
+{
+    struct ieeeSection *seg;
+
+    /* Keep compiler from warning about special */
+    (void)special;
+
+    /*
+     * If it's a special-retry from pass two, discard it.
+     */
+    if (is_global == 3)
+        return;
+
+    /*
+     * First check for the double-period, signifying something
+     * unusual.
+     */
+    if (name[0] == '.' && name[1] == '.' && name[2] != '@') {
+        return;
+    }
+
+    /*
+     * Case (i):
+     */
+    if (ieee_seg_needs_update)
+        return;
+    if (segment < SEG_ABS && segment != NO_SEG && segment % 2)
+        return;
+
+    if (segment >= SEG_ABS || segment == NO_SEG) {
+        return;
+    }
+
+    /*
+     * If `any_segs' is still false, we might need to define a
+     * default segment, if they're trying to declare a label in
+     * `first_seg'.  But the label should exist due to a prior
+     * call to ieee_deflabel so we can skip that.
+     */
+
+    for (seg = seghead; seg; seg = seg->next)
+        if (seg->index == segment) {
+            struct ieeePublic *loc;
+            /*
+             * Case (ii). Maybe MODPUB someday?
+             */
+            if (!is_global) {
+                last_defined = loc = nasm_malloc(sizeof(*loc));
+                *seg->loctail = loc;
+                seg->loctail = &loc->next;
+                loc->next = NULL;
+                loc->name = nasm_strdup(name);
+                loc->offset = offset;
+                loc->segment = -1;
+                loc->index = seg->ieee_index;
+            }
+        }
+}
+static void dbgls_typevalue(int32_t type)
+{
+    int elem = TYM_ELEMENTS(type);
+    type = TYM_TYPE(type);
+
+    if (!last_defined)
+        return;
+
+    switch (type) {
+    case TY_BYTE:
+        last_defined->type = 1; /* uint8_t */
+        break;
+    case TY_WORD:
+        last_defined->type = 3; /* unsigned word */
+        break;
+    case TY_DWORD:
+        last_defined->type = 5; /* unsigned dword */
+        break;
+    case TY_FLOAT:
+        last_defined->type = 9; /* float */
+        break;
+    case TY_QWORD:
+        last_defined->type = 10;        /* qword */
+        break;
+    case TY_TBYTE:
+        last_defined->type = 11;        /* TBYTE */
+        break;
+    default:
+        last_defined->type = 0x10;      /* near label */
+        break;
+    }
+
+    if (elem > 1) {
+        struct Array *arrtmp = nasm_malloc(sizeof(*arrtmp));
+        int vtype = last_defined->type;
+        arrtmp->size = elem;
+        arrtmp->basetype = vtype;
+        arrtmp->next = NULL;
+        last_defined->type = arrindex++ + 0x100;
+        *arrtail = arrtmp;
+        arrtail = &(arrtmp->next);
+    }
+    last_defined = NULL;
+}
+static void dbgls_output(int output_type, void *param)
+{
+    (void)output_type;
+    (void)param;
+}
+static struct dfmt ladsoft_debug_form = {
+    "LADsoft Debug Records",
+    "ladsoft",
+    dbgls_init,
+    dbgls_linnum,
+    dbgls_deflabel,
+    null_debug_directive,
+    dbgls_typevalue,
+    dbgls_output,
+    dbgls_cleanup,
+};
+static struct dfmt *ladsoft_debug_arr[3] = {
+    &ladsoft_debug_form,
+    &null_debug_form,
+    NULL
+};
+struct ofmt of_ieee = {
+    "IEEE-695 (LADsoft variant) object file format",
+    "ieee",
+    OFMT_TEXT,
+    ladsoft_debug_arr,
+    &ladsoft_debug_form,
+    NULL,
+    ieee_init,
+    ieee_set_info,
+    ieee_out,
+    ieee_deflabel,
+    ieee_segment,
+    ieee_segbase,
+    ieee_directive,
+    ieee_filename,
+    ieee_cleanup
+};
+
+#endif                          /* OF_IEEE */
diff --git a/output/outlib.c b/output/outlib.c
new file mode 100644 (file)
index 0000000..56ac6cd
--- /dev/null
@@ -0,0 +1,56 @@
+/* ----------------------------------------------------------------------- *
+ *   
+ *   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.
+ *
+ * ----------------------------------------------------------------------- */
+
+/*
+ * libout.c
+ *
+ * Common routines for the output backends.
+ */
+
+#include "compiler.h"
+#include "nasm.h"
+#include "output/outlib.h"
+
+uint64_t realsize(enum out_type type, uint64_t size)
+{
+    switch (type) {
+    case OUT_REL2ADR:
+       return 2;
+    case OUT_REL4ADR:
+       return 4;
+    case OUT_REL8ADR:
+       return 8;
+    default:
+       return size;
+    }
+}
diff --git a/output/outlib.h b/output/outlib.h
new file mode 100644 (file)
index 0000000..f3cd1bc
--- /dev/null
@@ -0,0 +1,59 @@
+/* ----------------------------------------------------------------------- *
+ *   
+ *   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.
+ *
+ * ----------------------------------------------------------------------- */
+
+#ifndef NASM_OUTLIB_H
+#define NASM_OUTLIB_H
+
+#include "nasm.h"
+
+uint64_t realsize(enum out_type type, uint64_t size);
+
+/* Do-nothing versions of some output routines */
+int null_setinfo(enum geninfo type, char **string);
+int null_directive(enum directives directive, char *value, int pass);
+
+/* Do-nothing versions of all the debug routines */
+struct ofmt;
+void null_debug_init(void);
+void null_debug_linenum(const char *filename, int32_t linenumber,
+                       int32_t segto);
+void null_debug_deflabel(char *name, int32_t segment, int64_t offset,
+                         int is_global, char *special);
+void null_debug_directive(const char *directive, const char *params);
+void null_debug_typevalue(int32_t type);
+void null_debug_output(int type, void *param);
+void null_debug_cleanup(void);
+extern struct dfmt *null_debug_arr[2];
+
+#endif /* NASM_OUTLIB_H */
+
diff --git a/output/outmacho.mac b/output/outmacho.mac
new file mode 100644 (file)
index 0000000..f1cdf18
--- /dev/null
@@ -0,0 +1,37 @@
+;; --------------------------------------------------------------------------
+;;   
+;;   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.
+;;
+;; --------------------------------------------------------------------------
+
+OUT: macho macho32 macho64
+%define __SECT__ [section .text]
+%macro __NASM_CDecl__ 1
+%endmacro
diff --git a/output/outmacho32.c b/output/outmacho32.c
new file mode 100644 (file)
index 0000000..1a211a6
--- /dev/null
@@ -0,0 +1,1357 @@
+/* ----------------------------------------------------------------------- *
+ *   
+ *   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.
+ *
+ * ----------------------------------------------------------------------- */
+
+/*
+ * outmacho.c  output routines for the Netwide Assembler to produce
+ *             NeXTstep/OpenStep/Rhapsody/Darwin/MacOS X object files
+ */
+
+/* Most of this file is, like Mach-O itself, based on a.out. For more
+ * guidelines see outaout.c.  */
+
+#include "compiler.h"
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <ctype.h>
+#include <inttypes.h>
+
+#include "nasm.h"
+#include "nasmlib.h"
+#include "saa.h"
+#include "raa.h"
+#include "eval.h"
+#include "output/outform.h"
+#include "output/outlib.h"
+
+#if defined(OF_MACHO32)
+
+/* Mach-O in-file header structure sizes */
+#define MACHO_HEADER_SIZE      (28)
+#define MACHO_SEGCMD_SIZE      (56)
+#define MACHO_SECTCMD_SIZE     (68)
+#define MACHO_SYMCMD_SIZE      (24)
+#define MACHO_NLIST_SIZE       (12)
+#define MACHO_RELINFO_SIZE     (8)
+
+/* Mach-O file header values */
+#define        MH_MAGIC                (0xfeedface)
+#define CPU_TYPE_I386          (7)     /* x86 platform */
+#define        CPU_SUBTYPE_I386_ALL    (3)     /* all-x86 compatible */
+#define        MH_OBJECT               (0x1)   /* object file */
+
+#define        LC_SEGMENT              (0x1)   /* segment load command */
+#define LC_SYMTAB              (0x2)   /* symbol table load command */
+
+#define        VM_PROT_NONE    (0x00)
+#define VM_PROT_READ   (0x01)
+#define VM_PROT_WRITE  (0x02)
+#define VM_PROT_EXECUTE        (0x04)
+
+#define VM_PROT_DEFAULT        (VM_PROT_READ | VM_PROT_WRITE | VM_PROT_EXECUTE)
+#define VM_PROT_ALL    (VM_PROT_READ | VM_PROT_WRITE | VM_PROT_EXECUTE)
+
+struct section {
+    /* nasm internal data */
+    struct section *next;
+    struct SAA *data;
+    int32_t index;
+    struct reloc *relocs;
+    int align;
+
+    /* data that goes into the file */
+    char sectname[16];          /* what this section is called */
+    char segname[16];           /* segment this section will be in */
+    uint32_t addr;         /* in-memory address (subject to alignment) */
+    uint32_t size;         /* in-memory and -file size  */
+    uint32_t nreloc;       /* relocation entry count */
+    uint32_t flags;        /* type and attributes (masked) */
+};
+
+#define SECTION_TYPE   0x000000ff      /* section type mask */
+
+#define        S_REGULAR       (0x0)   /* standard section */
+#define        S_ZEROFILL      (0x1)   /* zerofill, in-memory only */
+
+#define SECTION_ATTRIBUTES_SYS   0x00ffff00     /* system setable attributes */
+#define S_ATTR_SOME_INSTRUCTIONS 0x00000400     /* section contains some
+                                                   machine instructions */
+#define S_ATTR_EXT_RELOC         0x00000200     /* section has external
+                                                   relocation entries */
+#define S_ATTR_LOC_RELOC         0x00000100     /* section has local
+                                                   relocation entries */
+
+
+static struct sectmap {
+    const char *nasmsect;
+    const char *segname;
+    const char *sectname;
+    const int32_t flags;
+} sectmap[] = {
+    {".text", "__TEXT", "__text", S_REGULAR|S_ATTR_SOME_INSTRUCTIONS},
+    {".data", "__DATA", "__data", S_REGULAR},
+    {".rodata", "__DATA", "__const", S_REGULAR},
+    {".bss", "__DATA", "__bss", S_ZEROFILL},
+    {NULL, NULL, NULL, 0}
+};
+
+struct reloc {
+    /* nasm internal data */
+    struct reloc *next;
+
+    /* data that goes into the file */
+    int32_t addr;                  /* op's offset in section */
+    unsigned int snum:24,       /* contains symbol index if
+                               ** ext otherwise in-file
+                               ** section number */
+       pcrel:1,                /* relative relocation */
+       length:2,               /* 0=byte, 1=word, 2=int32_t */
+       ext:1,                  /* external symbol referenced */
+       type:4;                 /* reloc type, 0 for us */
+};
+
+#define        R_ABS           0       /* absolute relocation */
+#define R_SCATTERED    0x80000000      /* reloc entry is scattered if
+                                       ** highest bit == 1 */
+
+struct symbol {
+    /* nasm internal data */
+    struct symbol *next;       /* next symbol in the list */
+    char *name;                        /* name of this symbol */
+    int32_t initial_snum;              /* symbol number used above in
+                                  reloc */
+    int32_t snum;                      /* true snum for reloc */
+
+    /* data that goes into the file */
+    int32_t strx;                  /* string table index */
+    uint8_t type;         /* symbol type */
+    uint8_t sect;         /* NO_SECT or section number */
+    int16_t desc;                 /* for stab debugging, 0 for us */
+    uint32_t value;        /* offset of symbol in section */
+};
+
+/* symbol type bits */
+#define        N_EXT   0x01            /* global or external symbol */
+
+#define        N_UNDF  0x0             /* undefined symbol | n_sect == */
+#define        N_ABS   0x2             /* absolute symbol  |  NO_SECT */
+#define        N_SECT  0xe             /* defined symbol, n_sect holds
+                               ** section number */
+
+#define        N_TYPE  0x0e            /* type bit mask */
+
+#define DEFAULT_SECTION_ALIGNMENT 0 /* byte (i.e. no) alignment */
+
+/* special section number values */
+#define        NO_SECT         0       /* no section, invalid */
+#define MAX_SECT       255     /* maximum number of sections */
+
+static struct section *sects, **sectstail;
+static struct symbol *syms, **symstail;
+static uint32_t nsyms;
+
+/* These variables are set by macho_layout_symbols() to organize
+   the symbol table and string table in order the dynamic linker
+   expects.  They are then used in macho_write() to put out the
+   symbols and strings in that order.
+
+   The order of the symbol table is:
+     local symbols
+     defined external symbols (sorted by name)
+     undefined external symbols (sorted by name)
+
+   The order of the string table is:
+     strings for external symbols
+     strings for local symbols
+ */
+static uint32_t ilocalsym = 0;
+static uint32_t iextdefsym = 0;
+static uint32_t iundefsym = 0;
+static uint32_t nlocalsym;
+static uint32_t nextdefsym;
+static uint32_t nundefsym;
+static struct symbol **extdefsyms = NULL;
+static struct symbol **undefsyms = NULL;
+
+static struct RAA *extsyms;
+static struct SAA *strs;
+static uint32_t strslen;
+
+extern struct ofmt of_macho;
+
+/* Global file information. This should be cleaned up into either
+   a structure or as function arguments.  */
+uint32_t head_ncmds = 0;
+uint32_t head_sizeofcmds = 0;
+uint32_t seg_filesize = 0;
+uint32_t seg_vmsize = 0;
+uint32_t seg_nsects = 0;
+uint32_t rel_padcnt = 0;
+
+
+#define xstrncpy(xdst, xsrc)                                           \
+    memset(xdst, '\0', sizeof(xdst));  /* zero out whole buffer */     \
+    strncpy(xdst, xsrc, sizeof(xdst)); /* copy over string */          \
+    xdst[sizeof(xdst) - 1] = '\0';      /* proper null-termination */
+
+#define align(x, y)                                                    \
+    (((x) + (y) - 1) & ~((y) - 1))      /* align x to multiple of y */
+
+#define alignint32_t(x)                                                        \
+    align(x, sizeof(int32_t))      /* align x to int32_t boundary */
+
+static void debug_reloc (struct reloc *);
+static void debug_section_relocs (struct section *) _unused;
+
+static int exact_log2 (uint32_t align)
+{
+    if (align == 0) {
+       return 0;
+    } else if (align & (align-1)) {
+       return -1;              /* Not a power of 2 */
+    } else {
+#ifdef HAVE_GNUC_4
+       return __builtin_ctzl (align);
+#else
+       uint32_t result = 0;
+
+       /* We know exactly one bit is set at this point. */
+       if (align & 0xffff0000)
+           result |= 16;
+       if (align & 0xff00ff00)
+           result |= 8;
+       if (align & 0xf0f0f0f0)
+           result |= 4;
+       if (align & 0xcccccccc)
+           result |= 2;
+       if (align & 0xaaaaaaaa)
+           result |= 1;
+
+       return result;
+#endif
+    }
+}
+
+static struct section *get_section_by_name(const char *segname,
+                                           const char *sectname)
+{
+    struct section *s;
+
+    for (s = sects; s != NULL; s = s->next)
+        if (!strcmp(s->segname, segname) && !strcmp(s->sectname, sectname))
+            break;
+
+    return s;
+}
+
+static struct section *get_section_by_index(const int32_t index)
+{
+    struct section *s;
+
+    for (s = sects; s != NULL; s = s->next)
+        if (index == s->index)
+            break;
+
+    return s;
+}
+
+static int32_t get_section_index_by_name(const char *segname,
+                                      const char *sectname)
+{
+    struct section *s;
+
+    for (s = sects; s != NULL; s = s->next)
+        if (!strcmp(s->segname, segname) && !strcmp(s->sectname, sectname))
+            return s->index;
+
+    return -1;
+}
+
+static char *get_section_name_by_index(const int32_t index)
+{
+    struct section *s;
+
+    for (s = sects; s != NULL; s = s->next)
+        if (index == s->index)
+            return s->sectname;
+
+    return NULL;
+}
+
+static uint8_t get_section_fileindex_by_index(const int32_t index)
+{
+    struct section *s;
+    uint8_t i = 1;
+
+    for (s = sects; s != NULL && i < MAX_SECT; s = s->next, ++i)
+        if (index == s->index)
+            return i;
+
+    if (i == MAX_SECT)
+        nasm_error(ERR_WARNING,
+              "too many sections (>255) - clipped by fileindex");
+
+    return NO_SECT;
+}
+
+static void macho_init(void)
+{
+    char zero = 0;
+
+    sects = NULL;
+    sectstail = &sects;
+
+    syms = NULL;
+    symstail = &syms;
+    nsyms = 0;
+    nlocalsym = 0;
+    nextdefsym = 0;
+    nundefsym = 0;
+
+    extsyms = raa_init();
+    strs = saa_init(1L);
+
+    /* string table starts with a zero byte - don't ask why */
+    saa_wbytes(strs, &zero, sizeof(char));
+    strslen = 1;
+}
+
+static void sect_write(struct section *sect,
+                       const uint8_t *data, uint32_t len)
+{
+    saa_wbytes(sect->data, data, len);
+    sect->size += len;
+}
+
+static void add_reloc(struct section *sect, int32_t section,
+                      int pcrel, int bytes)
+{
+    struct reloc *r;
+    int32_t fi;
+
+    /* NeXT as puts relocs in reversed order (address-wise) into the
+     ** files, so we do the same, doesn't seem to make much of a
+     ** difference either way */
+    r = nasm_malloc(sizeof(struct reloc));
+    r->next = sect->relocs;
+    sect->relocs = r;
+
+    /* the current end of the section will be the symbol's address for
+     ** now, might have to be fixed by macho_fixup_relocs() later on. make
+     ** sure we don't make the symbol scattered by setting the highest
+     ** bit by accident */
+    r->addr = sect->size & ~R_SCATTERED;
+    r->ext = 0;
+    r->pcrel = pcrel;
+
+    /* match byte count 1, 2, 4 to length codes 0, 1, 2 respectively */
+    r->length = bytes >> 1;
+
+    /* vanilla relocation (GENERIC_RELOC_VANILLA) */
+    r->type = 0;
+
+    if (section == NO_SEG) {
+        /* absolute local symbol if no section index given */
+        r->snum = R_ABS;
+    } else {
+        fi = get_section_fileindex_by_index(section);
+
+        if (fi == NO_SECT) {
+            /* external symbol if no section with that index known,
+             ** symbol number was saved in macho_symdef() */
+            r->snum = raa_read(extsyms, section);
+            r->ext = 1;
+        } else {
+            /* local symbol in section fi */
+            r->snum = fi;
+        }
+    }
+
+    ++sect->nreloc;
+}
+
+static void macho_output(int32_t secto, const void *data,
+                        enum out_type type, uint64_t size,
+                         int32_t section, int32_t wrt)
+{
+    struct section *s, *sbss;
+    int32_t addr;
+    uint8_t mydata[4], *p;
+
+    if (wrt != NO_SEG) {
+        wrt = NO_SEG;
+        nasm_error(ERR_NONFATAL, "WRT not supported by Mach-O output format");
+        /* continue to do _something_ */
+    }
+
+    if (secto == NO_SEG) {
+        if (type != OUT_RESERVE)
+            nasm_error(ERR_NONFATAL, "attempt to assemble code in "
+                  "[ABSOLUTE] space");
+
+        return;
+    }
+
+    s = get_section_by_index(secto);
+
+    if (s == NULL) {
+        nasm_error(ERR_WARNING, "attempt to assemble code in"
+              " section %d: defaulting to `.text'", secto);
+        s = get_section_by_name("__TEXT", "__text");
+
+        /* should never happen */
+        if (s == NULL)
+            nasm_error(ERR_PANIC, "text section not found");
+    }
+
+    sbss = get_section_by_name("__DATA", "__bss");
+
+    if (s == sbss && type != OUT_RESERVE) {
+        nasm_error(ERR_WARNING, "attempt to initialize memory in the"
+              " BSS section: ignored");
+        s->size += realsize(type, size);
+        return;
+    }
+
+    switch (type) {
+    case OUT_RESERVE:
+        if (s != sbss) {
+            nasm_error(ERR_WARNING, "uninitialized space declared in"
+                  " %s section: zeroing",
+                  get_section_name_by_index(secto));
+
+            sect_write(s, NULL, size);
+        } else
+            s->size += size;
+
+        break;
+
+    case OUT_RAWDATA:
+        if (section != NO_SEG)
+            nasm_error(ERR_PANIC, "OUT_RAWDATA with other than NO_SEG");
+
+        sect_write(s, data, size);
+        break;
+
+    case OUT_ADDRESS:
+        addr = *(int64_t *)data;
+
+        if (section != NO_SEG) {
+            if (section % 2) {
+                nasm_error(ERR_NONFATAL, "Mach-O format does not support"
+                      " section base references");
+            } else
+                add_reloc(s, section, 0, size);
+        }
+
+        p = mydata;
+       WRITEADDR(p, addr, size);
+        sect_write(s, mydata, size);
+        break;
+
+    case OUT_REL2ADR:
+        if (section == secto)
+            nasm_error(ERR_PANIC, "intra-section OUT_REL2ADR");
+
+        if (section != NO_SEG && section % 2) {
+            nasm_error(ERR_NONFATAL, "Mach-O format does not support"
+                  " section base references");
+        } else
+            add_reloc(s, section, 1, 2);
+
+        p = mydata;
+        WRITESHORT(p, *(int32_t *)data - (size + s->size));
+        sect_write(s, mydata, 2L);
+        break;
+
+    case OUT_REL4ADR:
+        if (section == secto)
+            nasm_error(ERR_PANIC, "intra-section OUT_REL4ADR");
+
+        if (section != NO_SEG && section % 2) {
+            nasm_error(ERR_NONFATAL, "Mach-O format does not support"
+                  " section base references");
+        } else
+            add_reloc(s, section, 1, 4);
+
+        p = mydata;
+        WRITELONG(p, *(int32_t *)data - (size + s->size));
+        sect_write(s, mydata, 4L);
+        break;
+
+    default:
+        nasm_error(ERR_PANIC, "unknown output type?");
+        break;
+    }
+}
+
+static int32_t macho_section(char *name, int pass, int *bits)
+{
+    int32_t index, originalIndex;
+    char *sectionAttributes;
+    struct sectmap *sm;
+    struct section *s;
+
+    (void)pass;
+
+    /* Default to 32 bits. */
+    if (!name) {
+        *bits = 32;
+        name = ".text";
+        sectionAttributes = NULL;
+    } else {
+        sectionAttributes = name;
+        name = nasm_strsep(&sectionAttributes, " \t");
+    }
+
+    for (sm = sectmap; sm->nasmsect != NULL; ++sm) {
+        /* make lookup into section name translation table */
+        if (!strcmp(name, sm->nasmsect)) {
+            char *currentAttribute;
+
+            /* try to find section with that name */
+            originalIndex = index = get_section_index_by_name(sm->segname,
+                                                              sm->sectname);
+
+            /* create it if it doesn't exist yet */
+            if (index == -1) {
+                s = *sectstail = nasm_malloc(sizeof(struct section));
+                s->next = NULL;
+                sectstail = &s->next;
+
+                s->data = saa_init(1L);
+                s->index = seg_alloc();
+                s->relocs = NULL;
+                s->align = -1;
+
+                xstrncpy(s->segname, sm->segname);
+                xstrncpy(s->sectname, sm->sectname);
+                s->size = 0;
+                s->nreloc = 0;
+                s->flags = sm->flags;
+
+                index = s->index;
+            } else {
+                s = get_section_by_index(index);
+            }
+
+            while ((NULL != sectionAttributes)
+                   && (currentAttribute = nasm_strsep(&sectionAttributes, " \t"))) {
+                if (0 != *currentAttribute) {
+                    if (!nasm_strnicmp("align=", currentAttribute, 6)) {
+                        char *end;
+                        int newAlignment, value;
+
+                        value = strtoul(currentAttribute + 6, (char**)&end, 0);
+                        newAlignment = exact_log2(value);
+
+                        if (0 != *end) {
+                            nasm_error(ERR_PANIC,
+                                  "unknown or missing alignment value \"%s\" "
+                                      "specified for section \"%s\"",
+                                  currentAttribute + 6,
+                                  name);
+                            return NO_SEG;
+                        } else if (0 > newAlignment) {
+                            nasm_error(ERR_PANIC,
+                                  "alignment of %d (for section \"%s\") is not "
+                                      "a power of two",
+                                  value,
+                                  name);
+                            return NO_SEG;
+                        }
+
+                        if ((-1 != originalIndex)
+                            && (s->align != newAlignment)
+                           && (s->align != -1)) {
+                            nasm_error(ERR_PANIC,
+                                  "section \"%s\" has already been specified "
+                                      "with alignment %d, conflicts with new "
+                                      "alignment of %d",
+                            name,
+                            (1 << s->align),
+                            value);
+                            return NO_SEG;
+                        }
+
+                        s->align = newAlignment;
+                    } else if (!nasm_stricmp("data", currentAttribute)) {
+                        /* Do nothing; 'data' is implicit */
+                    } else {
+                        nasm_error(ERR_PANIC,
+                              "unknown section attribute %s for section %s",
+                              currentAttribute,
+                              name);
+                        return NO_SEG;
+                    }
+                }
+            }
+
+            return index;
+        }
+    }
+
+    nasm_error(ERR_PANIC, "invalid section name %s", name);
+    return NO_SEG;
+}
+
+static void macho_symdef(char *name, int32_t section, int64_t offset,
+                         int is_global, char *special)
+{
+    struct symbol *sym;
+
+    if (special) {
+        nasm_error(ERR_NONFATAL, "The Mach-O output format does "
+              "not support any special symbol types");
+        return;
+    }
+
+    if (is_global == 3) {
+        nasm_error(ERR_NONFATAL, "The Mach-O format does not "
+              "(yet) support forward reference fixups.");
+        return;
+    }
+
+    sym = *symstail = nasm_malloc(sizeof(struct symbol));
+    sym->next = NULL;
+    symstail = &sym->next;
+
+    sym->name = name;
+    sym->strx = strslen;
+    sym->type = 0;
+    sym->desc = 0;
+    sym->value = offset;
+    sym->initial_snum = -1;
+
+    /* external and common symbols get N_EXT */
+    if (is_global != 0)
+        sym->type |= N_EXT;
+
+    if (section == NO_SEG) {
+        /* symbols in no section get absolute */
+        sym->type |= N_ABS;
+        sym->sect = NO_SECT;
+    } else {
+        sym->type |= N_SECT;
+
+        /* get the in-file index of the section the symbol was defined in */
+        sym->sect = get_section_fileindex_by_index(section);
+
+        if (sym->sect == NO_SECT) {
+            /* remember symbol number of references to external
+             ** symbols, this works because every external symbol gets
+             ** its own section number allocated internally by nasm and
+             ** can so be used as a key */
+           extsyms = raa_write(extsyms, section, nsyms);
+           sym->initial_snum = nsyms;
+
+            switch (is_global) {
+            case 1:
+            case 2:
+                /* there isn't actually a difference between global
+                 ** and common symbols, both even have their size in
+                 ** sym->value */
+                sym->type = N_EXT;
+                break;
+
+            default:
+                /* give an error on unfound section if it's not an
+                 ** external or common symbol (assemble_file() does a
+                 ** seg_alloc() on every call for them) */
+                nasm_error(ERR_PANIC, "in-file index for section %d not found",
+                      section);
+            }
+        }
+    }
+
+    ++nsyms;
+}
+
+static int32_t macho_segbase(int32_t section)
+{
+    return section;
+}
+
+static void macho_filename(char *inname, char *outname)
+{
+    standard_extension(inname, outname, ".o");
+}
+
+extern macros_t macho_stdmac[];
+
+/* Comparison function for qsort symbol layout.  */
+static int layout_compare (const struct symbol **s1,
+                          const struct symbol **s2)
+{
+    return (strcmp ((*s1)->name, (*s2)->name));
+}
+
+/* The native assembler does a few things in a similar function
+
+       * Remove temporary labels
+       * Sort symbols according to local, external, undefined (by name)
+       * Order the string table
+
+   We do not remove temporary labels right now.
+
+   numsyms is the total number of symbols we have. strtabsize is the
+   number entries in the string table.  */
+
+static void macho_layout_symbols (uint32_t *numsyms,
+                                 uint32_t *strtabsize)
+{
+    struct symbol *sym, **symp;
+    uint32_t i,j;
+
+    *numsyms = 0;
+    *strtabsize = sizeof (char);
+
+    symp = &syms;
+
+    while ((sym = *symp)) {
+       /* Undefined symbols are now external.  */
+       if (sym->type == N_UNDF)
+           sym->type |= N_EXT;
+
+       if ((sym->type & N_EXT) == 0) {
+           sym->snum = *numsyms;
+           *numsyms = *numsyms + 1;
+           nlocalsym++;
+       }
+       else {
+           if ((sym->type & N_TYPE) != N_UNDF)
+               nextdefsym++;
+           else
+               nundefsym++;
+
+           /* If we handle debug info we'll want
+              to check for it here instead of just
+              adding the symbol to the string table.  */
+           sym->strx = *strtabsize;
+           saa_wbytes (strs, sym->name, (int32_t)(strlen(sym->name) + 1));
+           *strtabsize += strlen(sym->name) + 1;
+       }
+       symp = &(sym->next);
+    }
+
+    /* Next, sort the symbols.  Most of this code is a direct translation from
+       the Apple cctools symbol layout. We need to keep compatibility with that.  */
+    /* Set the indexes for symbol groups into the symbol table */
+    ilocalsym = 0;
+    iextdefsym = nlocalsym;
+    iundefsym = nlocalsym + nextdefsym;
+
+    /* allocate arrays for sorting externals by name */
+    extdefsyms = nasm_malloc(nextdefsym * sizeof(struct symbol *));
+    undefsyms = nasm_malloc(nundefsym * sizeof(struct symbol *));
+
+    i = 0;
+    j = 0;
+
+    symp = &syms;
+
+    while ((sym = *symp)) {
+
+       if((sym->type & N_EXT) == 0) {
+           sym->strx = *strtabsize;
+           saa_wbytes (strs, sym->name, (int32_t)(strlen (sym->name) + 1));
+           *strtabsize += strlen(sym->name) + 1;
+       }
+       else {
+           if((sym->type & N_TYPE) != N_UNDF)
+               extdefsyms[i++] = sym;
+           else
+               undefsyms[j++] = sym;
+       }
+       symp = &(sym->next);
+    }
+
+    qsort(extdefsyms, nextdefsym, sizeof(struct symbol *),
+         (int (*)(const void *, const void *))layout_compare);
+    qsort(undefsyms, nundefsym, sizeof(struct symbol *),
+         (int (*)(const void *, const void *))layout_compare);
+
+    for(i = 0; i < nextdefsym; i++) {
+       extdefsyms[i]->snum = *numsyms;
+       *numsyms += 1;
+    }
+    for(j = 0; j < nundefsym; j++) {
+       undefsyms[j]->snum = *numsyms;
+       *numsyms += 1;
+    }
+}
+
+/* Calculate some values we'll need for writing later.  */
+
+static void macho_calculate_sizes (void)
+{
+    struct section *s;
+
+    /* count sections and calculate in-memory and in-file offsets */
+    for (s = sects; s != NULL; s = s->next) {
+        uint32_t pad = 0;
+
+        /* zerofill sections aren't actually written to the file */
+        if ((s->flags & SECTION_TYPE) != S_ZEROFILL)
+            seg_filesize += s->size;
+
+        /* recalculate segment address based on alignment and vm size */
+        s->addr = seg_vmsize;
+        /* we need section alignment to calculate final section address */
+        if (s->align == -1)
+            s->align = DEFAULT_SECTION_ALIGNMENT;
+        if(s->align) {
+            uint32_t newaddr = align(s->addr, 1 << s->align);
+            pad = newaddr - s->addr;
+            s->addr = newaddr;
+        }
+
+        seg_vmsize += s->size + pad;
+        ++seg_nsects;
+    }
+
+    /* calculate size of all headers, load commands and sections to
+    ** get a pointer to the start of all the raw data */
+    if (seg_nsects > 0) {
+        ++head_ncmds;
+        head_sizeofcmds +=
+            MACHO_SEGCMD_SIZE + seg_nsects * MACHO_SECTCMD_SIZE;
+    }
+
+    if (nsyms > 0) {
+       ++head_ncmds;
+       head_sizeofcmds += MACHO_SYMCMD_SIZE;
+    }
+}
+
+/* Write out the header information for the file.  */
+
+static void macho_write_header (void)
+{
+    fwriteint32_t(MH_MAGIC, ofile);    /* magic */
+    fwriteint32_t(CPU_TYPE_I386, ofile);       /* CPU type */
+    fwriteint32_t(CPU_SUBTYPE_I386_ALL, ofile);        /* CPU subtype */
+    fwriteint32_t(MH_OBJECT, ofile);   /* Mach-O file type */
+    fwriteint32_t(head_ncmds, ofile);  /* number of load commands */
+    fwriteint32_t(head_sizeofcmds, ofile);     /* size of load commands */
+    fwriteint32_t(0, ofile);   /* no flags */
+}
+
+/* Write out the segment load command at offset.  */
+
+static uint32_t macho_write_segment (uint32_t offset)
+{
+    uint32_t rel_base = alignint32_t (offset + seg_filesize);
+    uint32_t s_reloff = 0;
+    struct section *s;
+
+    fwriteint32_t(LC_SEGMENT, ofile);        /* cmd == LC_SEGMENT */
+
+    /* size of load command including section load commands */
+    fwriteint32_t(MACHO_SEGCMD_SIZE + seg_nsects *
+              MACHO_SECTCMD_SIZE, ofile);
+
+    /* in an MH_OBJECT file all sections are in one unnamed (name
+    ** all zeros) segment */
+    fwritezero(16, ofile);
+    fwriteint32_t(0, ofile); /* in-memory offset */
+    fwriteint32_t(seg_vmsize, ofile);        /* in-memory size */
+    fwriteint32_t(offset, ofile);    /* in-file offset to data */
+    fwriteint32_t(seg_filesize, ofile);      /* in-file size */
+    fwriteint32_t(VM_PROT_DEFAULT, ofile);   /* maximum vm protection */
+    fwriteint32_t(VM_PROT_DEFAULT, ofile);   /* initial vm protection */
+    fwriteint32_t(seg_nsects, ofile);        /* number of sections */
+    fwriteint32_t(0, ofile); /* no flags */
+
+    /* emit section headers */
+    for (s = sects; s != NULL; s = s->next) {
+       fwrite(s->sectname, sizeof(s->sectname), 1, ofile);
+       fwrite(s->segname, sizeof(s->segname), 1, ofile);
+       fwriteint32_t(s->addr, ofile);
+       fwriteint32_t(s->size, ofile);
+
+       /* dummy data for zerofill sections or proper values */
+       if ((s->flags & SECTION_TYPE) != S_ZEROFILL) {
+           fwriteint32_t(offset, ofile);
+           /* Write out section alignment, as a power of two.
+              e.g. 32-bit word alignment would be 2 (2^^2 = 4).  */
+           if (s->align == -1)
+               s->align = DEFAULT_SECTION_ALIGNMENT;
+           fwriteint32_t(s->align, ofile);
+           /* To be compatible with cctools as we emit
+              a zero reloff if we have no relocations.  */
+           fwriteint32_t(s->nreloc ? rel_base + s_reloff : 0, ofile);
+           fwriteint32_t(s->nreloc, ofile);
+
+           offset += s->size;
+           s_reloff += s->nreloc * MACHO_RELINFO_SIZE;
+       } else {
+           fwriteint32_t(0, ofile);
+           fwriteint32_t(0, ofile);
+           fwriteint32_t(0, ofile);
+           fwriteint32_t(0, ofile);
+       }
+
+       fwriteint32_t(s->flags, ofile);      /* flags */
+       fwriteint32_t(0, ofile);     /* reserved */
+       fwriteint32_t(0, ofile);     /* reserved */
+    }
+
+    rel_padcnt = rel_base - offset;
+    offset = rel_base + s_reloff;
+
+    return offset;
+}
+
+/* For a given chain of relocs r, write out the entire relocation
+   chain to the object file.  */
+
+static void macho_write_relocs (struct reloc *r)
+{
+    while (r) {
+       uint32_t word2;
+
+       fwriteint32_t(r->addr, ofile); /* reloc offset */
+
+       word2 = r->snum;
+       word2 |= r->pcrel << 24;
+       word2 |= r->length << 25;
+       word2 |= r->ext << 27;
+       word2 |= r->type << 28;
+       fwriteint32_t(word2, ofile); /* reloc data */
+
+       r = r->next;
+    }
+}
+
+/* Write out the section data.  */
+static void macho_write_section (void)
+{
+    struct section *s, *s2;
+    struct reloc *r;
+    uint8_t fi, *p, *q, blk[4];
+    int32_t l;
+
+    for (s = sects; s != NULL; s = s->next) {
+       if ((s->flags & SECTION_TYPE) == S_ZEROFILL)
+           continue;
+
+       /* no padding needs to be done to the sections */
+
+       /* Like a.out Mach-O references things in the data or bss
+        * sections by addresses which are actually relative to the
+        * start of the _text_ section, in the _file_. See outaout.c
+        * for more information. */
+       saa_rewind(s->data);
+       for (r = s->relocs; r != NULL; r = r->next) {
+           saa_fread(s->data, r->addr, blk, (int32_t)r->length << 1);
+           p = q = blk;
+           l = *p++;
+
+           /* get offset based on relocation type */
+           if (r->length > 0) {
+               l += ((int32_t)*p++) << 8;
+
+               if (r->length == 2) {
+                   l += ((int32_t)*p++) << 16;
+                   l += ((int32_t)*p++) << 24;
+               }
+           }
+
+           /* If the relocation is internal add to the current section
+              offset. Otherwise the only value we need is the symbol
+              offset which we already have. The linker takes care
+              of the rest of the address.  */
+           if (!r->ext) {
+            /* generate final address by section address and offset */
+                   for (s2 = sects, fi = 1;
+                       s2 != NULL; s2 = s2->next, fi++) {
+                       if (fi == r->snum) {
+                           l += s2->addr;
+                           break;
+                       }
+                   }
+           }
+
+           /* write new offset back */
+           if (r->length == 2)
+               WRITELONG(q, l);
+           else if (r->length == 1)
+               WRITESHORT(q, l);
+           else
+               *q++ = l & 0xFF;
+
+           saa_fwrite(s->data, r->addr, blk, (int32_t)r->length << 1);
+       }
+
+       /* dump the section data to file */
+       saa_fpwrite(s->data, ofile);
+    }
+
+    /* pad last section up to reloc entries on int32_t boundary */
+    fwritezero(rel_padcnt, ofile);
+
+    /* emit relocation entries */
+    for (s = sects; s != NULL; s = s->next)
+       macho_write_relocs (s->relocs);
+}
+
+/* Write out the symbol table. We should already have sorted this
+   before now.  */
+static void macho_write_symtab (void)
+{
+    struct symbol *sym;
+    struct section *s;
+    int32_t fi;
+    uint32_t i;
+
+    /* we don't need to pad here since MACHO_RELINFO_SIZE == 8 */
+
+    for (sym = syms; sym != NULL; sym = sym->next) {
+       if ((sym->type & N_EXT) == 0) {
+           fwriteint32_t(sym->strx, ofile);            /* string table entry number */
+           fwrite(&sym->type, 1, 1, ofile);    /* symbol type */
+           fwrite(&sym->sect, 1, 1, ofile);    /* section */
+           fwriteint16_t(sym->desc, ofile);    /* description */
+
+           /* Fix up the symbol value now that we know the final section
+              sizes.  */
+           if (((sym->type & N_TYPE) == N_SECT) && (sym->sect != NO_SECT)) {
+                   for (s = sects, fi = 1; s != NULL; s = s->next, fi++) {
+                       if (fi == sym->sect) {
+                           sym->value += s->addr;
+                           break;
+                       }
+                   }
+           }
+
+           fwriteint32_t(sym->value, ofile);   /* value (i.e. offset) */
+       }
+    }
+
+    for (i = 0; i < nextdefsym; i++) {
+       sym = extdefsyms[i];
+       fwriteint32_t(sym->strx, ofile);
+       fwrite(&sym->type, 1, 1, ofile);        /* symbol type */
+       fwrite(&sym->sect, 1, 1, ofile);        /* section */
+       fwriteint16_t(sym->desc, ofile);        /* description */
+
+       /* Fix up the symbol value now that we know the final section
+          sizes.  */
+       if (((sym->type & N_TYPE) == N_SECT) && (sym->sect != NO_SECT)) {
+           for (s = sects, fi = 1;
+                s != NULL && fi < sym->sect; s = s->next, ++fi)
+               sym->value += s->size;
+       }
+
+       fwriteint32_t(sym->value, ofile);       /* value (i.e. offset) */
+    }
+
+     for (i = 0; i < nundefsym; i++) {
+        sym = undefsyms[i];
+        fwriteint32_t(sym->strx, ofile);
+        fwrite(&sym->type, 1, 1, ofile);       /* symbol type */
+        fwrite(&sym->sect, 1, 1, ofile);       /* section */
+        fwriteint16_t(sym->desc, ofile);       /* description */
+
+        /* Fix up the symbol value now that we know the final section
+           sizes.  */
+        if (((sym->type & N_TYPE) == N_SECT) && (sym->sect != NO_SECT)) {
+            for (s = sects, fi = 1;
+                 s != NULL && fi < sym->sect; s = s->next, ++fi)
+                sym->value += s->size;
+        }
+
+        fwriteint32_t(sym->value, ofile);      /* value (i.e. offset) */
+     }
+}
+
+/* Fixup the snum in the relocation entries, we should be
+   doing this only for externally undefined symbols. */
+static void macho_fixup_relocs (struct reloc *r)
+{
+    struct symbol *sym;
+    uint32_t i;
+
+    while (r != NULL) {
+       if (r->ext) {
+           for (i = 0; i < nundefsym; i++) {
+               sym = undefsyms[i];
+               if (sym->initial_snum == r->snum) {
+                   r->snum = sym->snum;
+                   break;
+               }
+           }
+       }
+       r = r->next;
+    }
+}
+
+/* Write out the object file.  */
+
+static void macho_write (void)
+{
+    uint32_t offset = 0;
+
+    /* mach-o object file structure:
+    **
+    ** mach header
+    **  uint32_t magic
+    **  int   cpu type
+    **  int   cpu subtype
+    **  uint32_t mach file type
+    **  uint32_t number of load commands
+    **  uint32_t size of all load commands
+    **   (includes section struct size of segment command)
+    **  uint32_t flags
+    **
+    ** segment command
+    **  uint32_t command type == LC_SEGMENT
+    **  uint32_t size of load command
+    **   (including section load commands)
+    **  char[16] segment name
+    **  uint32_t in-memory offset
+    **  uint32_t in-memory size
+    **  uint32_t in-file offset to data area
+    **  uint32_t in-file size
+    **   (in-memory size excluding zerofill sections)
+    **  int   maximum vm protection
+    **  int   initial vm protection
+    **  uint32_t number of sections
+    **  uint32_t flags
+    **
+    ** section commands
+    **   char[16] section name
+    **   char[16] segment name
+    **   uint32_t in-memory offset
+    **   uint32_t in-memory size
+    **   uint32_t in-file offset
+    **   uint32_t alignment
+    **    (irrelevant in MH_OBJECT)
+    **   uint32_t in-file offset of relocation entires
+    **   uint32_t number of relocations
+    **   uint32_t flags
+    **   uint32_t reserved
+    **   uint32_t reserved
+    **
+    ** symbol table command
+    **  uint32_t command type == LC_SYMTAB
+    **  uint32_t size of load command
+    **  uint32_t symbol table offset
+    **  uint32_t number of symbol table entries
+    **  uint32_t string table offset
+    **  uint32_t string table size
+    **
+    ** raw section data
+    **
+    ** padding to int32_t boundary
+    **
+    ** relocation data (struct reloc)
+    ** int32_t offset
+    **  uint data (symbolnum, pcrel, length, extern, type)
+    **
+    ** symbol table data (struct nlist)
+    **  int32_t  string table entry number
+    **  uint8_t type
+    **   (extern, absolute, defined in section)
+    **  uint8_t section
+    **   (0 for global symbols, section number of definition (>= 1, <=
+    **   254) for local symbols, size of variable for common symbols
+    **   [type == extern])
+    **  int16_t description
+    **   (for stab debugging format)
+    **  uint32_t value (i.e. file offset) of symbol or stab offset
+    **
+    ** string table data
+    **  list of null-terminated strings
+    */
+
+    /* Emit the Mach-O header.  */
+    macho_write_header();
+
+    offset = MACHO_HEADER_SIZE + head_sizeofcmds;
+
+    /* emit the segment load command */
+    if (seg_nsects > 0)
+       offset = macho_write_segment (offset);
+    else
+        nasm_error(ERR_WARNING, "no sections?");
+
+    if (nsyms > 0) {
+        /* write out symbol command */
+        fwriteint32_t(LC_SYMTAB, ofile); /* cmd == LC_SYMTAB */
+        fwriteint32_t(MACHO_SYMCMD_SIZE, ofile); /* size of load command */
+        fwriteint32_t(offset, ofile);    /* symbol table offset */
+        fwriteint32_t(nsyms, ofile);     /* number of symbol
+                                         ** table entries */
+
+        offset += nsyms * MACHO_NLIST_SIZE;
+        fwriteint32_t(offset, ofile);    /* string table offset */
+        fwriteint32_t(strslen, ofile);   /* string table size */
+    }
+
+    /* emit section data */
+    if (seg_nsects > 0)
+       macho_write_section ();
+
+    /* emit symbol table if we have symbols */
+    if (nsyms > 0)
+       macho_write_symtab ();
+
+    /* we don't need to pad here since MACHO_NLIST_SIZE == 12 */
+
+    /* emit string table */
+    saa_fpwrite(strs, ofile);
+}
+/* We do quite a bit here, starting with finalizing all of the data
+   for the object file, writing, and then freeing all of the data from
+   the file.  */
+
+static void macho_cleanup(int debuginfo)
+{
+    struct section *s;
+    struct reloc *r;
+    struct symbol *sym;
+
+    (void)debuginfo;
+
+    /* Sort all symbols.  */
+    macho_layout_symbols (&nsyms, &strslen);
+
+    /* Fixup relocation entries */
+    for (s = sects; s != NULL; s = s->next) {
+       macho_fixup_relocs (s->relocs);
+    }
+
+    /* First calculate and finalize needed values.  */
+    macho_calculate_sizes();
+    macho_write();
+
+    /* free up everything */
+    while (sects->next) {
+        s = sects;
+        sects = sects->next;
+
+        saa_free(s->data);
+        while (s->relocs != NULL) {
+            r = s->relocs;
+            s->relocs = s->relocs->next;
+            nasm_free(r);
+        }
+
+        nasm_free(s);
+    }
+
+    saa_free(strs);
+    raa_free(extsyms);
+
+    if (syms) {
+    while (syms->next) {
+       sym = syms;
+       syms = syms->next;
+
+       nasm_free (sym);
+    }
+}
+}
+
+/* Debugging routines.  */
+static void debug_reloc (struct reloc *r)
+{
+    fprintf (stdout, "reloc:\n");
+    fprintf (stdout, "\taddr: %"PRId32"\n", r->addr);
+    fprintf (stdout, "\tsnum: %d\n", r->snum);
+    fprintf (stdout, "\tpcrel: %d\n", r->pcrel);
+    fprintf (stdout, "\tlength: %d\n", r->length);
+    fprintf (stdout, "\text: %d\n", r->ext);
+    fprintf (stdout, "\ttype: %d\n", r->type);
+}
+
+static void debug_section_relocs (struct section *s)
+{
+    struct reloc *r = s->relocs;
+
+    fprintf (stdout, "relocs for section %s:\n\n", s->sectname);
+
+    while (r != NULL) {
+       debug_reloc (r);
+       r = r->next;
+    }
+}
+
+struct ofmt of_macho32 = {
+    "NeXTstep/OpenStep/Rhapsody/Darwin/MacOS X (i386) object files",
+    "macho32",
+    0,
+    null_debug_arr,
+    &null_debug_form,
+    macho_stdmac,
+    macho_init,
+    null_setinfo,
+    macho_output,
+    macho_symdef,
+    macho_section,
+    macho_segbase,
+    null_directive,
+    macho_filename,
+    macho_cleanup
+};
+
+struct ofmt of_macho = {
+    "MACHO (short name for MACHO32)",
+    "macho",
+    0,
+    null_debug_arr,
+    &null_debug_form,
+    macho_stdmac,
+    macho_init,
+    null_setinfo,
+    macho_output,
+    macho_symdef,
+    macho_section,
+    macho_segbase,
+    null_directive,
+    macho_filename,
+    macho_cleanup
+};
+
+#endif
+
+/*
+ * Local Variables:
+ * mode:c
+ * c-basic-offset:4
+ * End:
+ *
+ * end of file */
diff --git a/output/outmacho64.c b/output/outmacho64.c
new file mode 100644 (file)
index 0000000..dfe523b
--- /dev/null
@@ -0,0 +1,1508 @@
+/* ----------------------------------------------------------------------- *
+ *   
+ *   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.
+ *
+ * ----------------------------------------------------------------------- */
+
+/*
+ * outmacho64.c        output routines for the Netwide Assembler to produce
+ *             NeXTstep/OpenStep/Rhapsody/Darwin/MacOS X (x86_64) object files
+ */
+
+/* Most of this file is, like Mach-O itself, based on a.out. For more
+ * guidelines see outaout.c.  */
+
+#include "compiler.h"
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <ctype.h>
+#include <inttypes.h>
+
+#include "nasm.h"
+#include "nasmlib.h"
+#include "saa.h"
+#include "raa.h"
+#include "output/outform.h"
+#include "output/outlib.h"
+
+#if defined(OF_MACHO64)
+
+/* Mach-O in-file header structure sizes */
+#define MACHO_HEADER64_SIZE            (32)
+#define MACHO_SEGCMD64_SIZE            (72)
+#define MACHO_SECTCMD64_SIZE   (80)
+#define MACHO_SYMCMD_SIZE              (24)
+#define MACHO_NLIST64_SIZE             (16)
+#define MACHO_RELINFO64_SIZE   (8)
+
+/* Mach-O file header values */
+#define        MH_MAGIC_64             (0xfeedfacf)
+#define CPU_TYPE_X86_64 (0x01000007) /* x86-64 platform */
+#define        CPU_SUBTYPE_I386_ALL    (3)     /* all-x86 compatible */
+#define        MH_OBJECT               (0x1)   /* object file */
+
+#define        LC_SEGMENT_64   (0x19)  /* segment load command */
+#define LC_SYMTAB              (0x2)   /* symbol table load command */
+
+#define        VM_PROT_NONE    (0x00)
+#define VM_PROT_READ   (0x01)
+#define VM_PROT_WRITE  (0x02)
+#define VM_PROT_EXECUTE        (0x04)
+
+#define VM_PROT_DEFAULT        (VM_PROT_READ | VM_PROT_WRITE | VM_PROT_EXECUTE)
+#define VM_PROT_ALL    (VM_PROT_READ | VM_PROT_WRITE | VM_PROT_EXECUTE)
+
+struct section {
+    /* nasm internal data */
+    struct section *next;
+    struct SAA *data;
+    int32_t index;
+    struct reloc *relocs;
+    int align;
+
+    /* data that goes into the file */
+    char sectname[16];          /* what this section is called */
+    char segname[16];           /* segment this section will be in */
+    uint64_t addr;         /* in-memory address (subject to alignment) */
+    uint64_t size;         /* in-memory and -file size  */
+    uint32_t nreloc;       /* relocation entry count */
+    uint32_t flags;        /* type and attributes (masked) */
+       uint32_t extreloc;     /* external relocations */
+};
+
+#define SECTION_TYPE   0x000000ff      /* section type mask */
+
+#define        S_REGULAR       (0x0)   /* standard section */
+#define        S_ZEROFILL      (0x1)   /* zerofill, in-memory only */
+
+#define SECTION_ATTRIBUTES_SYS   0x00ffff00     /* system setable attributes */
+#define S_ATTR_SOME_INSTRUCTIONS 0x00000400     /* section contains some
+                                                   machine instructions */
+#define S_ATTR_EXT_RELOC         0x00000200     /* section has external
+                                                   relocation entries */
+#define S_ATTR_LOC_RELOC         0x00000100     /* section has local
+                                                   relocation entries */
+#define S_ATTR_PURE_INSTRUCTIONS 0x80000000            /* section uses pure
+                                                                                                  machine instructions */
+
+static struct sectmap {
+    const char *nasmsect;
+    const char *segname;
+    const char *sectname;
+    const int32_t flags;
+} sectmap[] = {
+    {".text", "__TEXT", "__text", S_REGULAR|S_ATTR_SOME_INSTRUCTIONS|S_ATTR_PURE_INSTRUCTIONS},
+    {".data", "__DATA", "__data", S_REGULAR},
+    {".rodata", "__DATA", "__const", S_REGULAR},
+    {".bss", "__DATA", "__bss", S_ZEROFILL},
+    {NULL, NULL, NULL, 0}
+};
+
+struct reloc {
+    /* nasm internal data */
+    struct reloc *next;
+
+    /* data that goes into the file */
+    int32_t addr;                  /* op's offset in section */
+    uint32_t snum:24,       /* contains symbol index if
+                               ** ext otherwise in-file
+                               ** section number */
+       pcrel:1,                /* relative relocation */
+       length:2,               /* 0=byte, 1=word, 2=int32_t, 3=int64_t */
+       ext:1,                  /* external symbol referenced */
+       type:4;                 /* reloc type */
+};
+
+#define        R_ABS           0       /* absolute relocation */
+#define R_SCATTERED    0x80000000      /* reloc entry is scattered if
+                                       ** highest bit == 1 */
+
+struct symbol {
+    /* nasm internal data */
+    struct symbol *next;       /* next symbol in the list */
+    char *name;                        /* name of this symbol */
+    int32_t initial_snum;              /* symbol number used above in
+                                  reloc */
+    int32_t snum;                      /* true snum for reloc */
+
+    /* data that goes into the file */
+    uint32_t strx;                  /* string table index */
+    uint8_t type;         /* symbol type */
+    uint8_t sect;         /* NO_SECT or section number */
+    uint16_t desc;                 /* for stab debugging, 0 for us */
+    uint64_t value;        /* offset of symbol in section */
+};
+
+/* symbol type bits */
+#define        N_EXT   0x01            /* global or external symbol */
+
+#define        N_UNDF  0x0             /* undefined symbol | n_sect == */
+#define        N_ABS   0x2             /* absolute symbol  |  NO_SECT */
+#define        N_SECT  0xe             /* defined symbol, n_sect holds
+                               ** section number */
+
+#define        N_TYPE  0x0e            /* type bit mask */
+
+#define DEFAULT_SECTION_ALIGNMENT 0 /* byte (i.e. no) alignment */
+
+/* special section number values */
+#define        NO_SECT         0       /* no section, invalid */
+#define MAX_SECT       255     /* maximum number of sections */
+
+static struct section *sects, **sectstail;
+static struct symbol *syms, **symstail;
+static uint32_t nsyms;
+
+/* These variables are set by macho_layout_symbols() to organize
+   the symbol table and string table in order the dynamic linker
+   expects.  They are then used in macho_write() to put out the
+   symbols and strings in that order.
+
+   The order of the symbol table is:
+     local symbols
+     defined external symbols (sorted by name)
+     undefined external symbols (sorted by name)
+
+   The order of the string table is:
+     strings for external symbols
+     strings for local symbols
+ */
+static uint32_t ilocalsym = 0;
+static uint32_t iextdefsym = 0;
+static uint32_t iundefsym = 0;
+static uint32_t nlocalsym;
+static uint32_t nextdefsym;
+static uint32_t nundefsym;
+static struct symbol **extdefsyms = NULL;
+static struct symbol **undefsyms = NULL;
+
+static struct RAA *extsyms;
+static struct SAA *strs;
+static uint32_t strslen;
+
+extern struct ofmt of_macho64;
+
+/* Global file information. This should be cleaned up into either
+   a structure or as function arguments.  */
+uint32_t head_ncmds64 = 0;
+uint32_t head_sizeofcmds64 = 0;
+uint64_t seg_filesize64 = 0;
+uint64_t seg_vmsize64 = 0;
+uint32_t seg_nsects64 = 0;
+uint64_t rel_padcnt64 = 0;
+
+
+#define xstrncpy(xdst, xsrc)                                           \
+    memset(xdst, '\0', sizeof(xdst));  /* zero out whole buffer */     \
+    strncpy(xdst, xsrc, sizeof(xdst)); /* copy over string */          \
+    xdst[sizeof(xdst) - 1] = '\0';      /* proper null-termination */
+
+#define align(x, y)                                                    \
+    (((x) + (y) - 1) & ~((y) - 1))      /* align x to multiple of y */
+
+#define alignint32_t(x)                                                        \
+    align(x, sizeof(int32_t))      /* align x to int32_t boundary */
+
+#define alignint64_t(x)                                                        \
+    align(x, sizeof(int64_t))      /* align x to int64_t boundary */
+
+static void debug_reloc (struct reloc *);
+static void debug_section_relocs (struct section *) _unused;
+
+static int exact_log2 (uint32_t align)
+{
+    if (align == 0) {
+       return 0;
+    } else if (align & (align-1)) {
+       return -1;              /* Not a power of 2 */
+    } else {
+#ifdef HAVE_GNUC_4
+       return __builtin_ctzl (align);
+#else
+       uint32_t result = 0;
+
+       /* We know exactly one bit is set at this point. */
+       if (align & 0xffff0000)
+           result |= 16;
+       if (align & 0xff00ff00)
+           result |= 8;
+       if (align & 0xf0f0f0f0)
+           result |= 4;
+       if (align & 0xcccccccc)
+           result |= 2;
+       if (align & 0xaaaaaaaa)
+           result |= 1;
+
+       return result;
+#endif
+    }
+}
+
+static struct section *get_section_by_name(const char *segname,
+                                           const char *sectname)
+{
+    struct section *s;
+
+    for (s = sects; s != NULL; s = s->next)
+        if (!strcmp(s->segname, segname) && !strcmp(s->sectname, sectname))
+            break;
+
+    return s;
+}
+
+static struct section *get_section_by_index(const int32_t index)
+{
+    struct section *s;
+
+    for (s = sects; s != NULL; s = s->next)
+        if (index == s->index)
+            break;
+
+    return s;
+}
+
+static int32_t get_section_index_by_name(const char *segname,
+                                      const char *sectname)
+{
+    struct section *s;
+
+    for (s = sects; s != NULL; s = s->next)
+        if (!strcmp(s->segname, segname) && !strcmp(s->sectname, sectname))
+            return s->index;
+
+    return -1;
+}
+
+static char *get_section_name_by_index(const int32_t index)
+{
+    struct section *s;
+
+    for (s = sects; s != NULL; s = s->next)
+        if (index == s->index)
+            return s->sectname;
+
+    return NULL;
+}
+
+static uint8_t get_section_fileindex_by_index(const int32_t index)
+{
+    struct section *s;
+    uint8_t i = 1;
+
+    for (s = sects; s != NULL && i < MAX_SECT; s = s->next, ++i)
+        if (index == s->index)
+            return i;
+
+    if (i == MAX_SECT)
+        nasm_error(ERR_WARNING,
+              "too many sections (>255) - clipped by fileindex");
+
+    return NO_SECT;
+}
+
+static struct symbol *get_closest_section_symbol_by_offset(uint8_t fileindex, int64_t offset)
+{
+       struct symbol *sym;
+
+       for (sym = syms; sym != NULL; sym = sym->next) {
+               if ((sym->sect != NO_SECT) &&
+                       (sym->sect == fileindex) &&
+                       ((int64_t)sym->value >= offset))
+                               return sym;
+       }
+
+       return NULL;
+}
+
+
+/*
+ * Special section numbers which are used to define Mach-O special
+ * symbols, which can be used with WRT to provide PIC relocation
+ * types.
+ */
+static int32_t macho_gotpcrel_sect;
+
+static void macho_init(void)
+{
+    char zero = 0;
+
+    maxbits = 64;
+
+    sects = NULL;
+    sectstail = &sects;
+
+    syms = NULL;
+    symstail = &syms;
+    nsyms = 0;
+    nlocalsym = 0;
+    nextdefsym = 0;
+    nundefsym = 0;
+
+    extsyms = raa_init();
+    strs = saa_init(1L);
+
+    /* string table starts with a zero byte - don't ask why */
+    saa_wbytes(strs, &zero, sizeof(char));
+    strslen = 1;
+
+    /* add special symbol for ..gotpcrel */
+    macho_gotpcrel_sect = seg_alloc();
+    macho_gotpcrel_sect++;
+    define_label("..gotpcrel", macho_gotpcrel_sect, 0L, NULL, false, false);
+}
+
+static void sect_write(struct section *sect,
+                       const uint8_t *data, uint32_t len)
+{
+    saa_wbytes(sect->data, data, len);
+    sect->size += len;
+}
+
+static int32_t add_reloc(struct section *sect, int32_t section,
+                      int pcrel, int bytes, int64_t reloff)
+{
+    struct reloc *r;
+    struct symbol *sym;
+    int32_t fi;
+    int32_t adjustment = 0;
+
+    /* NeXT as puts relocs in reversed order (address-wise) into the
+     ** files, so we do the same, doesn't seem to make much of a
+     ** difference either way */
+    r = nasm_malloc(sizeof(struct reloc));
+    r->next = sect->relocs;
+    sect->relocs = r;
+
+    /* the current end of the section will be the symbol's address for
+     ** now, might have to be fixed by macho_fixup_relocs() later on. make
+     ** sure we don't make the symbol scattered by setting the highest
+     ** bit by accident */
+    r->addr = sect->size & ~R_SCATTERED;
+    r->ext = 1;
+    r->pcrel = (pcrel ? 1 : 0);
+
+    /* match byte count 1, 2, 4, 8 to length codes 0, 1, 2, 3 respectively */
+       switch(bytes){
+               case 1:
+                       r->length = 0;
+                       break;
+               case 2:
+                       r->length = 1;
+                       break;
+               case 4:
+                       r->length = 2;
+                       break;
+               case 8:
+                       r->length = 3;
+                       break;
+               default:
+                       break;
+       }
+
+    /* set default relocation values */
+    r->type = 0;                                       // X86_64_RELOC_UNSIGNED
+       r->snum = R_ABS;                                // Absolute Symbol (indicates no relocation)
+
+       /* absolute relocation */
+       if (pcrel == 0) {
+       
+               /* intra-section */
+               if (section == NO_SEG) {
+                       // r->snum = R_ABS;             // Set above
+                       
+               /* inter-section */
+               } else {
+                       fi = get_section_fileindex_by_index(section);
+                       
+                       /* external */
+                       if (fi == NO_SECT) {
+                               r->snum = raa_read(extsyms, section);
+                               
+                       /* local */
+                       } else {
+                               sym = get_closest_section_symbol_by_offset(fi, reloff);
+                               r->snum = sym->initial_snum;
+                               adjustment = sym->value;
+                       }
+               }
+
+       /* relative relocation */
+       } else if (pcrel == 1) {
+
+               /* intra-section */
+               if (section == NO_SEG) {
+                       r->type = 1;                    // X86_64_RELOC_SIGNED
+
+               /* inter-section */
+               } else {
+                       r->type = 2;                    // X86_64_RELOC_BRANCH
+                       fi = get_section_fileindex_by_index(section);
+
+                       /* external */
+                       if (fi == NO_SECT) {
+                               sect->extreloc = 1;
+                               r->snum = raa_read(extsyms, section);
+               
+                       /* local */
+                       } else {
+                               sym = get_closest_section_symbol_by_offset(fi, reloff);
+                               r->snum = sym->initial_snum;
+                               adjustment = sym->value;
+                       }
+               }
+               
+       /* subtractor */
+       } else if (pcrel == 2) {
+               r->pcrel = 0;
+               r->type = 5;                            // X86_64_RELOC_SUBTRACTOR
+
+       /* gotpcrel */
+       } else if (pcrel == 3) {
+               r->type = 4;                            // X86_64_RELOC_GOT
+               r->snum = macho_gotpcrel_sect;
+
+       /* gotpcrel MOVQ load */
+       } else if (pcrel == 4) {
+               r->type = 3;                            // X86_64_RELOC_GOT_LOAD
+               r->snum = macho_gotpcrel_sect;
+       }
+
+       ++sect->nreloc;
+
+       return adjustment;
+}
+
+static void macho_output(int32_t secto, const void *data,
+                        enum out_type type, uint64_t size,
+                         int32_t section, int32_t wrt)
+{
+    struct section *s, *sbss;
+    int64_t addr;
+    uint8_t mydata[16], *p, gotload;
+
+    if (secto == NO_SEG) {
+        if (type != OUT_RESERVE)
+            nasm_error(ERR_NONFATAL, "attempt to assemble code in "
+                  "[ABSOLUTE] space");
+
+        return;
+    }
+
+    s = get_section_by_index(secto);
+
+    if (s == NULL) {
+        nasm_error(ERR_WARNING, "attempt to assemble code in"
+              " section %d: defaulting to `.text'", secto);
+        s = get_section_by_name("__TEXT", "__text");
+
+        /* should never happen */
+        if (s == NULL)
+            nasm_error(ERR_PANIC, "text section not found");
+    }
+
+    sbss = get_section_by_name("__DATA", "__bss");
+
+    if (s == sbss && type != OUT_RESERVE) {
+        nasm_error(ERR_WARNING, "attempt to initialize memory in the"
+              " BSS section: ignored");
+        s->size += realsize(type, size);
+        return;
+    }
+
+    switch (type) {
+    case OUT_RESERVE:
+        if (s != sbss) {
+            nasm_error(ERR_WARNING, "uninitialized space declared in"
+                  " %s section: zeroing",
+                  get_section_name_by_index(secto));
+
+            sect_write(s, NULL, size);
+        } else
+            s->size += size;
+
+        break;
+
+    case OUT_RAWDATA:
+        if (section != NO_SEG)
+            nasm_error(ERR_PANIC, "OUT_RAWDATA with other than NO_SEG");
+
+        sect_write(s, data, size);
+        break;
+
+    case OUT_ADDRESS:
+        addr = *(int64_t *)data;
+        if (section != NO_SEG) {
+            if (section % 2) {
+                nasm_error(ERR_NONFATAL, "Mach-O format does not support"
+                      " section base references");
+            } else {
+                               if (wrt == NO_SEG) {
+                                       if (size < 8) {
+                                               nasm_error(ERR_NONFATAL, "Mach-O 64-bit format does not support"
+                                                       " 32-bit absolute addresses");
+                                       /*
+                                        Seemingly, Mach-O's X86_64_RELOC_SUBTRACTOR would require
+                                        pre-determined knowledge of where the image base would be,
+                                        making it impractical for use in intermediate object files
+                                        */
+                                       } else {
+                                               addr -= add_reloc(s, section, 0, size, addr);                                   // X86_64_RELOC_UNSIGNED
+                                       }
+                               } else {
+                                       nasm_error(ERR_NONFATAL, "Mach-O format does not support"
+                                               " this use of WRT");
+                               }
+                       }
+               }
+
+        p = mydata;
+               WRITEADDR(p, addr, size);
+        sect_write(s, mydata, size);
+        break;
+
+    case OUT_REL2ADR:
+        p = mydata;
+        WRITESHORT(p, *(int64_t *)data);
+
+        if (section == secto)
+            nasm_error(ERR_PANIC, "intra-section OUT_REL2ADR");
+
+               if (section == NO_SEG) {
+                       /* Do nothing */
+        } else if (section % 2) {
+            nasm_error(ERR_NONFATAL, "Mach-O format does not support"
+                  " section base references");
+        } else {
+                       nasm_error(ERR_NONFATAL, "Unsupported non-32-bit"
+                                 " Macho-O relocation [2]");
+               }
+
+        sect_write(s, mydata, 2L);
+        break;
+
+    case OUT_REL4ADR:
+        p = mydata;
+               WRITELONG(p, *(int64_t *)data);
+
+        if (section == secto)
+            nasm_error(ERR_PANIC, "intra-section OUT_REL4ADR");
+
+        if (section != NO_SEG && section % 2) {
+            nasm_error(ERR_NONFATAL, "Mach-O format does not support"
+                  " section base references");
+        } else {
+                       if (wrt == NO_SEG) {
+                               *mydata -= add_reloc(s, section, 1, 4, (int64_t)*mydata);                               // X86_64_RELOC_SIGNED/BRANCH
+                       } else if (wrt == macho_gotpcrel_sect) {
+                               if (s->data->datalen > 1) {
+                                       saa_fread(s->data, s->data->datalen-2, &gotload, 1);                            // Retrieve Instruction Opcode
+                               } else {
+                                       gotload = 0;
+                               }
+                               if (gotload == 0x8B) {                                                                                                  // Check for MOVQ Opcode
+                                       *mydata -= add_reloc(s, section, 4, 4, (int64_t)*mydata);                       // X86_64_GOT_LOAD (MOVQ load)
+                               } else {
+                                       *mydata -= add_reloc(s, section, 3, 4, (int64_t)*mydata);                       // X86_64_GOT
+                               }
+                       } else {
+                               nasm_error(ERR_NONFATAL, "Mach-O format does not support"
+                                   " this use of WRT");
+                               wrt = NO_SEG;   /* we can at least _try_ to continue */
+                       }
+               }
+
+        sect_write(s, mydata, 4L);
+        break;
+
+    default:
+        nasm_error(ERR_PANIC, "unknown output type?");
+        break;
+    }
+}
+
+static int32_t macho_section(char *name, int pass, int *bits)
+{
+    int32_t index, originalIndex;
+    char *sectionAttributes;
+    struct sectmap *sm;
+    struct section *s;
+
+    (void)pass;
+
+    /* Default to 64 bits. */
+    if (!name) {
+        *bits = 64;
+        name = ".text";
+        sectionAttributes = NULL;
+    } else {
+        sectionAttributes = name;
+        name = nasm_strsep(&sectionAttributes, " \t");
+    }
+
+    for (sm = sectmap; sm->nasmsect != NULL; ++sm) {
+        /* make lookup into section name translation table */
+        if (!strcmp(name, sm->nasmsect)) {
+            char *currentAttribute;
+
+            /* try to find section with that name */
+            originalIndex = index = get_section_index_by_name(sm->segname,
+                                                              sm->sectname);
+
+            /* create it if it doesn't exist yet */
+            if (index == -1) {
+                s = *sectstail = nasm_malloc(sizeof(struct section));
+                s->next = NULL;
+                sectstail = &s->next;
+
+                s->data = saa_init(1L);
+                s->index = seg_alloc();
+                s->relocs = NULL;
+                s->align = -1;
+
+                xstrncpy(s->segname, sm->segname);
+                xstrncpy(s->sectname, sm->sectname);
+                s->size = 0;
+                s->nreloc = 0;
+                s->flags = sm->flags;
+
+                index = s->index;
+            } else {
+                s = get_section_by_index(index);
+            }
+
+            while ((NULL != sectionAttributes)
+                   && (currentAttribute = nasm_strsep(&sectionAttributes, " \t"))) {
+                if (0 != *currentAttribute) {
+                    if (!nasm_strnicmp("align=", currentAttribute, 6)) {
+                        char *end;
+                        int newAlignment, value;
+
+                        value = strtoul(currentAttribute + 6, (char**)&end, 0);
+                        newAlignment = exact_log2(value);
+
+                        if (0 != *end) {
+                            nasm_error(ERR_PANIC,
+                                  "unknown or missing alignment value \"%s\" "
+                                      "specified for section \"%s\"",
+                                  currentAttribute + 6,
+                                  name);
+                            return NO_SEG;
+                        } else if (0 > newAlignment) {
+                            nasm_error(ERR_PANIC,
+                                  "alignment of %d (for section \"%s\") is not "
+                                      "a power of two",
+                                  value,
+                                  name);
+                            return NO_SEG;
+                        }
+
+                        if ((-1 != originalIndex)
+                            && (s->align != newAlignment)
+                           && (s->align != -1)) {
+                            nasm_error(ERR_PANIC,
+                                  "section \"%s\" has already been specified "
+                                      "with alignment %d, conflicts with new "
+                                      "alignment of %d",
+                            name,
+                            (1 << s->align),
+                            value);
+                            return NO_SEG;
+                        }
+
+                        s->align = newAlignment;
+                    } else if (!nasm_stricmp("data", currentAttribute)) {
+                        /* Do nothing; 'data' is implicit */
+                    } else {
+                        nasm_error(ERR_PANIC,
+                              "unknown section attribute %s for section %s",
+                              currentAttribute,
+                              name);
+                        return NO_SEG;
+                    }
+                }
+            }
+
+            return index;
+        }
+    }
+
+    nasm_error(ERR_PANIC, "invalid section name %s", name);
+    return NO_SEG;
+}
+
+static void macho_symdef(char *name, int32_t section, int64_t offset,
+                         int is_global, char *special)
+{
+    struct symbol *sym;
+
+    if (special) {
+        nasm_error(ERR_NONFATAL, "The Mach-O output format does "
+              "not support any special symbol types");
+        return;
+    }
+
+    if (is_global == 3) {
+        nasm_error(ERR_NONFATAL, "The Mach-O format does not "
+              "(yet) support forward reference fixups.");
+        return;
+    }
+
+       if (name[0] == '.' && name[1] == '.' && name[2] != '@') {
+        /*
+         * This is a NASM special symbol. We never allow it into
+         * the Macho-O symbol table, even if it's a valid one. If it
+         * _isn't_ a valid one, we should barf immediately.
+         */
+        if (strcmp(name, "..gotpcrel"))
+            nasm_error(ERR_NONFATAL, "unrecognized special symbol `%s'", name);
+         return;
+    }
+
+    sym = *symstail = nasm_malloc(sizeof(struct symbol));
+    sym->next = NULL;
+    symstail = &sym->next;
+
+    sym->name = name;
+    sym->strx = strslen;
+    sym->type = 0;
+    sym->desc = 0;
+    sym->value = offset;
+    sym->initial_snum = -1;
+
+    /* external and common symbols get N_EXT */
+    if (is_global != 0) {
+        sym->type |= N_EXT;
+       }
+
+    if (section == NO_SEG) {
+        /* symbols in no section get absolute */
+        sym->type |= N_ABS;
+        sym->sect = NO_SECT;
+    } else {
+        sym->type |= N_SECT;
+
+        /* get the in-file index of the section the symbol was defined in */
+        sym->sect = get_section_fileindex_by_index(section);
+               
+               /* track the initially allocated symbol number for use in future fix-ups */
+               sym->initial_snum = nsyms;
+
+        if (sym->sect == NO_SECT) {
+
+            /* remember symbol number of references to external
+             ** symbols, this works because every external symbol gets
+             ** its own section number allocated internally by nasm and
+             ** can so be used as a key */
+                       extsyms = raa_write(extsyms, section, nsyms);
+
+            switch (is_global) {
+            case 1:
+            case 2:
+                /* there isn't actually a difference between global
+                 ** and common symbols, both even have their size in
+                 ** sym->value */
+                sym->type = N_EXT;
+                break;
+
+            default:
+                /* give an error on unfound section if it's not an
+                 ** external or common symbol (assemble_file() does a
+                 ** seg_alloc() on every call for them) */
+                nasm_error(ERR_PANIC, "in-file index for section %d not found",
+                      section);
+            }
+        }
+    }
+    ++nsyms;
+}
+
+static int32_t macho_segbase(int32_t section)
+{
+    return section;
+}
+
+static void macho_filename(char *inname, char *outname)
+{
+    standard_extension(inname, outname, ".o");
+}
+
+extern macros_t macho_stdmac[];
+
+/* Comparison function for qsort symbol layout.  */
+static int layout_compare (const struct symbol **s1,
+                          const struct symbol **s2)
+{
+    return (strcmp ((*s1)->name, (*s2)->name));
+}
+
+/* The native assembler does a few things in a similar function
+
+       * Remove temporary labels
+       * Sort symbols according to local, external, undefined (by name)
+       * Order the string table
+
+   We do not remove temporary labels right now.
+
+   numsyms is the total number of symbols we have. strtabsize is the
+   number entries in the string table.  */
+
+static void macho_layout_symbols (uint32_t *numsyms,
+                                 uint32_t *strtabsize)
+{
+    struct symbol *sym, **symp;
+    uint32_t i,j;
+
+    *numsyms = 0;
+    *strtabsize = sizeof (char);
+
+    symp = &syms;
+
+    while ((sym = *symp)) {
+       /* Undefined symbols are now external.  */
+       if (sym->type == N_UNDF)
+           sym->type |= N_EXT;
+
+       if ((sym->type & N_EXT) == 0) {
+           sym->snum = *numsyms;
+           *numsyms = *numsyms + 1;
+           nlocalsym++;
+       }
+       else {
+               if ((sym->type & N_TYPE) != N_UNDF) {
+                       nextdefsym++;
+           } else {
+                       nundefsym++;
+               }
+
+           /* If we handle debug info we'll want
+              to check for it here instead of just
+              adding the symbol to the string table.  */
+           sym->strx = *strtabsize;
+           saa_wbytes (strs, sym->name, (int32_t)(strlen(sym->name) + 1));
+           *strtabsize += strlen(sym->name) + 1;
+       }
+       symp = &(sym->next);
+    }
+
+    /* Next, sort the symbols.  Most of this code is a direct translation from
+       the Apple cctools symbol layout. We need to keep compatibility with that.  */
+    /* Set the indexes for symbol groups into the symbol table */
+    ilocalsym = 0;
+    iextdefsym = nlocalsym;
+    iundefsym = nlocalsym + nextdefsym;
+
+    /* allocate arrays for sorting externals by name */
+    extdefsyms = nasm_malloc(nextdefsym * sizeof(struct symbol *));
+    undefsyms = nasm_malloc(nundefsym * sizeof(struct symbol *));
+
+    i = 0;
+    j = 0;
+
+    symp = &syms;
+
+    while ((sym = *symp)) {
+
+       if((sym->type & N_EXT) == 0) {
+           sym->strx = *strtabsize;
+           saa_wbytes (strs, sym->name, (int32_t)(strlen (sym->name) + 1));
+           *strtabsize += strlen(sym->name) + 1;
+       }
+       else {
+               if((sym->type & N_TYPE) != N_UNDF) {
+                       extdefsyms[i++] = sym;
+           } else {
+                       undefsyms[j++] = sym;
+               }
+       }
+       symp = &(sym->next);
+    }
+
+    qsort(extdefsyms, nextdefsym, sizeof(struct symbol *),
+         (int (*)(const void *, const void *))layout_compare);
+    qsort(undefsyms, nundefsym, sizeof(struct symbol *),
+         (int (*)(const void *, const void *))layout_compare);
+
+    for(i = 0; i < nextdefsym; i++) {
+       extdefsyms[i]->snum = *numsyms;
+       *numsyms += 1;
+    }
+    for(j = 0; j < nundefsym; j++) {
+       undefsyms[j]->snum = *numsyms;
+       *numsyms += 1;
+    }
+}
+
+/* Calculate some values we'll need for writing later.  */
+
+static void macho_calculate_sizes (void)
+{
+    struct section *s;
+
+    /* count sections and calculate in-memory and in-file offsets */
+    for (s = sects; s != NULL; s = s->next) {
+        uint64_t pad = 0;
+
+        /* zerofill sections aren't actually written to the file */
+        if ((s->flags & SECTION_TYPE) != S_ZEROFILL)
+            seg_filesize64 += s->size;
+
+        /* recalculate segment address based on alignment and vm size */
+        s->addr = seg_vmsize64;
+        /* we need section alignment to calculate final section address */
+        if (s->align == -1)
+            s->align = DEFAULT_SECTION_ALIGNMENT;
+        if(s->align) {
+            uint64_t newaddr = align(s->addr, 1 << s->align);
+            pad = newaddr - s->addr;
+            s->addr = newaddr;
+        }
+
+        seg_vmsize64 += s->size + pad;
+        ++seg_nsects64;
+    }
+
+    /* calculate size of all headers, load commands and sections to
+    ** get a pointer to the start of all the raw data */
+    if (seg_nsects64 > 0) {
+        ++head_ncmds64;
+        head_sizeofcmds64 +=
+            MACHO_SEGCMD64_SIZE + seg_nsects64 * MACHO_SECTCMD64_SIZE;
+    }
+
+    if (nsyms > 0) {
+       ++head_ncmds64;
+       head_sizeofcmds64 += MACHO_SYMCMD_SIZE;
+    }
+}
+
+/* Write out the header information for the file.  */
+
+static void macho_write_header (void)
+{
+    fwriteint32_t(MH_MAGIC_64, ofile); /* magic */
+    fwriteint32_t(CPU_TYPE_X86_64, ofile);     /* CPU type */
+    fwriteint32_t(CPU_SUBTYPE_I386_ALL, ofile);        /* CPU subtype */
+    fwriteint32_t(MH_OBJECT, ofile);   /* Mach-O file type */
+    fwriteint32_t(head_ncmds64, ofile);        /* number of load commands */
+    fwriteint32_t(head_sizeofcmds64, ofile);   /* size of load commands */
+    fwriteint32_t(0, ofile);   /* no flags */
+       fwriteint32_t(0, ofile); /* reserved for future use */
+}
+
+/* Write out the segment load command at offset.  */
+
+static uint32_t macho_write_segment (uint64_t offset)
+{
+    uint64_t rel_base = alignint64_t (offset + seg_filesize64);
+    uint32_t s_reloff = 0;
+    struct section *s;
+
+    fwriteint32_t(LC_SEGMENT_64, ofile);        /* cmd == LC_SEGMENT_64 */
+
+    /* size of load command including section load commands */
+    fwriteint32_t(MACHO_SEGCMD64_SIZE + seg_nsects64 *
+              MACHO_SECTCMD64_SIZE, ofile);
+
+    /* in an MH_OBJECT file all sections are in one unnamed (name
+    ** all zeros) segment */
+    fwritezero(16, ofile);
+    fwriteint64_t(0, ofile); /* in-memory offset */
+    fwriteint64_t(seg_vmsize64, ofile);        /* in-memory size */
+    fwriteint64_t(offset, ofile);    /* in-file offset to data */
+    fwriteint64_t(seg_filesize64, ofile);      /* in-file size */
+    fwriteint32_t(VM_PROT_DEFAULT, ofile);   /* maximum vm protection */
+    fwriteint32_t(VM_PROT_DEFAULT, ofile);   /* initial vm protection */
+    fwriteint32_t(seg_nsects64, ofile);        /* number of sections */
+    fwriteint32_t(0, ofile); /* no flags */
+
+    /* emit section headers */
+    for (s = sects; s != NULL; s = s->next) {
+        fwrite(s->sectname, sizeof(s->sectname), 1, ofile);
+        fwrite(s->segname, sizeof(s->segname), 1, ofile);
+        fwriteint64_t(s->addr, ofile);
+        fwriteint64_t(s->size, ofile);
+
+        /* dummy data for zerofill sections or proper values */
+        if ((s->flags & SECTION_TYPE) != S_ZEROFILL) {
+            fwriteint32_t(offset, ofile);
+            /* Write out section alignment, as a power of two.
+            e.g. 32-bit word alignment would be 2 (2^2 = 4).  */
+            if (s->align == -1)
+                s->align = DEFAULT_SECTION_ALIGNMENT;
+            fwriteint32_t(s->align, ofile);
+            /* To be compatible with cctools as we emit
+            a zero reloff if we have no relocations.  */
+            fwriteint32_t(s->nreloc ? rel_base + s_reloff : 0, ofile);
+            fwriteint32_t(s->nreloc, ofile);
+
+            offset += s->size;
+            s_reloff += s->nreloc * MACHO_RELINFO64_SIZE;
+        } else {
+            fwriteint32_t(0, ofile);
+            fwriteint32_t(0, ofile);
+            fwriteint32_t(0, ofile);
+            fwriteint32_t(0, ofile);
+        }
+               
+               if (s->nreloc) {
+                       s->flags |= S_ATTR_LOC_RELOC;
+                       if (s->extreloc)
+                               s->flags |= S_ATTR_EXT_RELOC;
+               }
+
+        fwriteint32_t(s->flags, ofile);      /* flags */
+        fwriteint32_t(0, ofile);     /* reserved */
+        fwriteint32_t(0, ofile);     /* reserved */
+               
+               fwriteint32_t(0, ofile);     /* align */
+    }
+
+    rel_padcnt64 = rel_base - offset;
+    offset = rel_base + s_reloff;
+
+    return offset;
+}
+
+/* For a given chain of relocs r, write out the entire relocation
+   chain to the object file.  */
+
+static void macho_write_relocs (struct reloc *r)
+{
+    while (r) {
+       uint32_t word2;
+
+       fwriteint32_t(r->addr, ofile); /* reloc offset */
+
+       word2 = r->snum;
+       word2 |= r->pcrel << 24;
+       word2 |= r->length << 25;
+       word2 |= r->ext << 27;
+       word2 |= r->type << 28;
+       fwriteint32_t(word2, ofile); /* reloc data */
+       r = r->next;
+    }
+}
+
+/* Write out the section data.  */
+static void macho_write_section (void)
+{
+    struct section *s, *s2;
+    struct reloc *r;
+    uint8_t fi, *p, *q, blk[8];
+       int32_t len;
+    int64_t l;
+
+    for (s = sects; s != NULL; s = s->next) {
+       if ((s->flags & SECTION_TYPE) == S_ZEROFILL)
+           continue;
+
+       /* no padding needs to be done to the sections */
+
+       /* Like a.out Mach-O references things in the data or bss
+        * sections by addresses which are actually relative to the
+        * start of the _text_ section, in the _file_. See outaout.c
+        * for more information. */
+       saa_rewind(s->data);
+       for (r = s->relocs; r != NULL; r = r->next) {
+               len = (int32_t)r->length << 1;
+               if(len > 4) len = 8;
+           saa_fread(s->data, r->addr, blk, len);
+           p = q = blk;
+           l = *p++;
+
+           /* get offset based on relocation type */
+           if (r->length > 0) {
+                       l += ((int64_t)*p++) << 8;
+
+                       if (r->length > 1) {
+                               l += ((int64_t)*p++) << 16;
+                               l += ((int64_t)*p++) << 24;
+                       }
+
+                       if (r->length > 2) {
+                               l += ((int64_t)*p++) << 32;
+                               l += ((int64_t)*p++) << 40;
+                               l += ((int64_t)*p++) << 48;
+                               l += ((int64_t)*p++) << 56;
+                       }
+                       
+                       
+           }
+       
+           /* If the relocation is internal add to the current section
+              offset. Otherwise the only value we need is the symbol
+              offset which we already have. The linker takes care
+              of the rest of the address.  */
+           if (!r->ext) {
+            /* generate final address by section address and offset */
+                   for (s2 = sects, fi = 1;
+                       s2 != NULL; s2 = s2->next, fi++) {
+                       if (fi == r->snum) {
+                           l += s2->addr;
+                           break;
+                       }
+                   }
+           }
+
+           /* write new offset back */
+               if (r->length == 3)
+               WRITEDLONG(q, l);
+               else if (r->length == 2)
+               WRITELONG(q, l);
+           else if (r->length == 1)
+               WRITESHORT(q, l);
+           else
+               *q++ = l & 0xFF;
+
+           saa_fwrite(s->data, r->addr, blk, len);
+       }
+
+       /* dump the section data to file */
+       saa_fpwrite(s->data, ofile);
+    }
+
+    /* pad last section up to reloc entries on int64_t boundary */
+    fwritezero(rel_padcnt64, ofile);
+
+    /* emit relocation entries */
+    for (s = sects; s != NULL; s = s->next)
+       macho_write_relocs (s->relocs);
+}
+
+/* Write out the symbol table. We should already have sorted this
+   before now.  */
+static void macho_write_symtab (void)
+{
+    struct symbol *sym;
+    struct section *s;
+    int64_t fi;
+    uint64_t i;
+
+    /* we don't need to pad here since MACHO_RELINFO_SIZE == 8 */
+
+    for (sym = syms; sym != NULL; sym = sym->next) {
+       if ((sym->type & N_EXT) == 0) {
+           fwriteint32_t(sym->strx, ofile);            /* string table entry number */
+           fwrite(&sym->type, 1, 1, ofile);    /* symbol type */
+           fwrite(&sym->sect, 1, 1, ofile);    /* section */
+           fwriteint16_t(sym->desc, ofile);    /* description */
+
+           /* Fix up the symbol value now that we know the final section
+              sizes.  */
+           if (((sym->type & N_TYPE) == N_SECT) && (sym->sect != NO_SECT)) {
+                   for (s = sects, fi = 1; s != NULL; s = s->next, fi++) {
+                       if (fi == sym->sect) {
+                           sym->value += s->addr;
+                           break;
+                       }
+                   }
+           }
+
+           fwriteint64_t(sym->value, ofile);   /* value (i.e. offset) */
+       }
+    }
+
+    for (i = 0; i < nextdefsym; i++) {
+       sym = extdefsyms[i];
+       fwriteint32_t(sym->strx, ofile);
+       fwrite(&sym->type, 1, 1, ofile);        /* symbol type */
+       fwrite(&sym->sect, 1, 1, ofile);        /* section */
+       fwriteint16_t(sym->desc, ofile);        /* description */
+
+       /* Fix up the symbol value now that we know the final section
+          sizes.  */
+       if (((sym->type & N_TYPE) == N_SECT) && (sym->sect != NO_SECT)) {
+           for (s = sects, fi = 1;
+                s != NULL && fi < sym->sect; s = s->next, ++fi)
+               sym->value += s->size;
+       }
+
+       fwriteint64_t(sym->value, ofile);       /* value (i.e. offset) */
+    }
+
+     for (i = 0; i < nundefsym; i++) {
+        sym = undefsyms[i];
+        fwriteint32_t(sym->strx, ofile);
+        fwrite(&sym->type, 1, 1, ofile);       /* symbol type */
+        fwrite(&sym->sect, 1, 1, ofile);       /* section */
+        fwriteint16_t(sym->desc, ofile);       /* description */
+
+        // Fix up the symbol value now that we know the final section sizes.
+        if (((sym->type & N_TYPE) == N_SECT) && (sym->sect != NO_SECT)) {
+            for (s = sects, fi = 1;
+                 s != NULL && fi < sym->sect; s = s->next, ++fi)
+                sym->value += s->size;
+        }
+
+        fwriteint64_t(sym->value, ofile);      // value (i.e. offset)
+     }
+
+}
+
+/* Fixup the snum in the relocation entries, we should be
+   doing this only for externally referenced symbols. */
+static void macho_fixup_relocs (struct reloc *r)
+{
+    struct symbol *sym;
+
+    while (r != NULL) {
+       if (r->ext) {
+       for (sym = syms; sym != NULL; sym = sym->next) {
+               if (sym->initial_snum == r->snum) {
+                       r->snum = sym->snum;
+                       break;
+               }
+       }
+       }
+       r = r->next;
+    }
+}
+
+/* Write out the object file.  */
+
+static void macho_write (void)
+{
+    uint64_t offset = 0;
+
+    /* mach-o object file structure:
+    **
+    ** mach header
+    **  uint32_t magic
+    **  int   cpu type
+    **  int   cpu subtype
+    **  uint32_t mach file type
+    **  uint32_t number of load commands
+    **  uint32_t size of all load commands
+    **   (includes section struct size of segment command)
+    **  uint32_t flags
+    **
+    ** segment command
+    **  uint32_t command type == LC_SEGMENT_64
+    **  uint32_t size of load command
+    **   (including section load commands)
+    **  char[16] segment name
+    **  uint64_t in-memory offset
+    **  uint64_t in-memory size
+    **  uint64_t in-file offset to data area
+    **  uint64_t in-file size
+    **   (in-memory size excluding zerofill sections)
+    **  int   maximum vm protection
+    **  int   initial vm protection
+    **  uint32_t number of sections
+    **  uint32_t flags
+    **
+    ** section commands
+    **   char[16] section name
+    **   char[16] segment name
+    **   uint64_t in-memory offset
+    **   uint64_t in-memory size
+    **   uint32_t in-file offset
+    **   uint32_t alignment
+    **    (irrelevant in MH_OBJECT)
+    **   uint32_t in-file offset of relocation entires
+    **   uint32_t number of relocations
+    **   uint32_t flags
+    **   uint32_t reserved
+    **   uint32_t reserved
+    **
+    ** symbol table command
+    **  uint32_t command type == LC_SYMTAB
+    **  uint32_t size of load command
+    **  uint32_t symbol table offset
+    **  uint32_t number of symbol table entries
+    **  uint32_t string table offset
+    **  uint32_t string table size
+    **
+    ** raw section data
+    **
+    ** padding to int64_t boundary
+    **
+    ** relocation data (struct reloc)
+    ** int32_t offset
+    **  uint data (symbolnum, pcrel, length, extern, type)
+    **
+    ** symbol table data (struct nlist)
+    **  int32_t  string table entry number
+    **  uint8_t type
+    **   (extern, absolute, defined in section)
+    **  uint8_t section
+    **   (0 for global symbols, section number of definition (>= 1, <=
+    **   254) for local symbols, size of variable for common symbols
+    **   [type == extern])
+    **  int16_t description
+    **   (for stab debugging format)
+    **  uint64_t value (i.e. file offset) of symbol or stab offset
+    **
+    ** string table data
+    **  list of null-terminated strings
+    */
+
+    /* Emit the Mach-O header.  */
+    macho_write_header();
+
+    offset = MACHO_HEADER64_SIZE + head_sizeofcmds64;
+
+    /* emit the segment load command */
+    if (seg_nsects64 > 0)
+       offset = macho_write_segment (offset);
+    else
+        nasm_error(ERR_WARNING, "no sections?");
+
+    if (nsyms > 0) {
+        /* write out symbol command */
+        fwriteint32_t(LC_SYMTAB, ofile); /* cmd == LC_SYMTAB */
+        fwriteint32_t(MACHO_SYMCMD_SIZE, ofile); /* size of load command */
+        fwriteint32_t(offset, ofile);    /* symbol table offset */
+        fwriteint32_t(nsyms, ofile);     /* number of symbol
+                                         ** table entries */
+
+        offset += nsyms * MACHO_NLIST64_SIZE;
+        fwriteint32_t(offset, ofile);    /* string table offset */
+        fwriteint32_t(strslen, ofile);   /* string table size */
+    }
+
+    /* emit section data */
+    if (seg_nsects64 > 0)
+       macho_write_section ();
+
+    /* emit symbol table if we have symbols */
+    if (nsyms > 0)
+       macho_write_symtab ();
+
+    /* we don't need to pad here since MACHO_NLIST64_SIZE == 16 */
+
+    /* emit string table */
+    saa_fpwrite(strs, ofile);
+}
+/* We do quite a bit here, starting with finalizing all of the data
+   for the object file, writing, and then freeing all of the data from
+   the file.  */
+
+static void macho_cleanup(int debuginfo)
+{
+    struct section *s;
+    struct reloc *r;
+    struct symbol *sym;
+
+    (void)debuginfo;
+
+    /* Sort all symbols.  */
+    macho_layout_symbols (&nsyms, &strslen);
+
+    /* Fixup relocation entries */
+    for (s = sects; s != NULL; s = s->next) {
+       macho_fixup_relocs (s->relocs);
+    }
+
+    /* First calculate and finalize needed values.  */
+    macho_calculate_sizes();
+    macho_write();
+
+    /* free up everything */
+    while (sects->next) {
+        s = sects;
+        sects = sects->next;
+
+        saa_free(s->data);
+        while (s->relocs != NULL) {
+            r = s->relocs;
+            s->relocs = s->relocs->next;
+            nasm_free(r);
+        }
+
+        nasm_free(s);
+    }
+
+    saa_free(strs);
+    raa_free(extsyms);
+
+    if (syms) {
+    while (syms->next) {
+       sym = syms;
+       syms = syms->next;
+
+       nasm_free (sym);
+    }
+}
+}
+
+/* Debugging routines.  */
+static void debug_reloc (struct reloc *r)
+{
+    fprintf (stdout, "reloc:\n");
+    fprintf (stdout, "\taddr: %"PRId32"\n", r->addr);
+    fprintf (stdout, "\tsnum: %d\n", r->snum);
+    fprintf (stdout, "\tpcrel: %d\n", r->pcrel);
+    fprintf (stdout, "\tlength: %d\n", r->length);
+    fprintf (stdout, "\text: %d\n", r->ext);
+    fprintf (stdout, "\ttype: %d\n", r->type);
+}
+
+static void debug_section_relocs (struct section *s)
+{
+    struct reloc *r = s->relocs;
+
+    fprintf (stdout, "relocs for section %s:\n\n", s->sectname);
+
+    while (r != NULL) {
+       debug_reloc (r);
+       r = r->next;
+    }
+}
+
+struct ofmt of_macho64 = {
+    "NeXTstep/OpenStep/Rhapsody/Darwin/MacOS X (x86_64) object files",
+    "macho64",
+    0,
+    null_debug_arr,
+    &null_debug_form,
+    macho_stdmac,
+    macho_init,
+    null_setinfo,
+    macho_output,
+    macho_symdef,
+    macho_section,
+    macho_segbase,
+    null_directive,
+    macho_filename,
+    macho_cleanup
+};
+
+#endif
+
+/*
+ * Local Variables:
+ * mode:c
+ * c-basic-offset:4
+ * End:
+ *
+ * end of file */
diff --git a/output/outobj.c b/output/outobj.c
new file mode 100644 (file)
index 0000000..804ff52
--- /dev/null
@@ -0,0 +1,2567 @@
+/* ----------------------------------------------------------------------- *
+ *   
+ *   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.
+ *
+ * ----------------------------------------------------------------------- */
+
+/*
+ * outobj.c    output routines for the Netwide Assembler to produce
+ *             .OBJ object files
+ */
+
+#include "compiler.h"
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <ctype.h>
+#include <inttypes.h>
+
+#include "nasm.h"
+#include "nasmlib.h"
+#include "stdscan.h"
+#include "eval.h"
+#include "output/outform.h"
+#include "output/outlib.h"
+
+#ifdef OF_OBJ
+
+/*
+ * outobj.c is divided into two sections.  The first section is low level
+ * routines for creating obj records;  It has nearly zero NASM specific
+ * code.  The second section is high level routines for processing calls and
+ * data structures from the rest of NASM into obj format.
+ *
+ * It should be easy (though not zero work) to lift the first section out for
+ * use as an obj file writer for some other assembler or compiler.
+ */
+
+/*
+ * These routines are built around the ObjRecord data struture.  An ObjRecord
+ * holds an object file record that may be under construction or complete.
+ *
+ * A major function of these routines is to support continuation of an obj
+ * record into the next record when the maximum record size is exceeded.  The
+ * high level code does not need to worry about where the record breaks occur.
+ * It does need to do some minor extra steps to make the automatic continuation
+ * work.  Those steps may be skipped for records where the high level knows no
+ * continuation could be required.
+ *
+ * 1) An ObjRecord is allocated and cleared by obj_new, or an existing ObjRecord
+ *    is cleared by obj_clear.
+ *
+ * 2) The caller should fill in .type.
+ *
+ * 3) If the record is continuable and there is processing that must be done at
+ *    the start of each record then the caller should fill in .ori with the
+ *    address of the record initializer routine.
+ *
+ * 4) If the record is continuable and it should be saved (rather than emitted
+ *    immediately) as each record is done, the caller should set .up to be a
+ *    pointer to a location in which the caller keeps the master pointer to the
+ *    ObjRecord.  When the record is continued, the obj_bump routine will then
+ *    allocate a new ObjRecord structure and update the master pointer.
+ *
+ * 5) If the .ori field was used then the caller should fill in the .parm with
+ *    any data required by the initializer.
+ *
+ * 6) The caller uses the routines: obj_byte, obj_word, obj_rword, obj_dword,
+ *    obj_x, obj_index, obj_value and obj_name to fill in the various kinds of
+ *    data required for this record.
+ *
+ * 7) If the record is continuable, the caller should call obj_commit at each
+ *    point where breaking the record is permitted.
+ *
+ * 8) To write out the record, the caller should call obj_emit2.  If the
+ *    caller has called obj_commit for all data written then he can get slightly
+ *    faster code by calling obj_emit instead of obj_emit2.
+ *
+ * Most of these routines return an ObjRecord pointer.  This will be the input
+ * pointer most of the time and will be the new location if the ObjRecord
+ * moved as a result of the call.  The caller may ignore the return value in
+ * three cases:  It is a "Never Reallocates" routine;  or  The caller knows
+ * continuation is not possible;  or  The caller uses the master pointer for the
+ * next operation.
+ */
+
+#define RECORD_MAX (1024-3)     /* maximal size of any record except type+reclen */
+#define OBJ_PARMS  3            /* maximum .parm used by any .ori routine */
+
+#define FIX_08_LOW      0x8000  /* location type for various fixup subrecords */
+#define FIX_16_OFFSET   0x8400
+#define FIX_16_SELECTOR 0x8800
+#define FIX_32_POINTER  0x8C00
+#define FIX_08_HIGH     0x9000
+#define FIX_32_OFFSET   0xA400
+#define FIX_48_POINTER  0xAC00
+
+enum RecordID {                 /* record ID codes */
+
+    THEADR = 0x80,              /* module header */
+    COMENT = 0x88,              /* comment record */
+
+    LINNUM = 0x94,              /* line number record */
+    LNAMES = 0x96,              /* list of names */
+
+    SEGDEF = 0x98,              /* segment definition */
+    GRPDEF = 0x9A,              /* group definition */
+    EXTDEF = 0x8C,              /* external definition */
+    PUBDEF = 0x90,              /* public definition */
+    COMDEF = 0xB0,              /* common definition */
+
+    LEDATA = 0xA0,              /* logical enumerated data */
+    FIXUPP = 0x9C,              /* fixups (relocations) */
+    FIXU32 = 0x9D,              /* 32-bit fixups (relocations) */
+
+    MODEND = 0x8A,              /* module end */
+    MODE32 = 0x8B               /* module end for 32-bit objects */
+};
+
+enum ComentID {                 /* ID codes for comment records */
+
+    dEXTENDED = 0xA1,           /* tells that we are using translator-specific extensions */
+    dLINKPASS = 0xA2,           /* link pass 2 marker */
+    dTYPEDEF = 0xE3,            /* define a type */
+    dSYM = 0xE6,                /* symbol debug record */
+    dFILNAME = 0xE8,            /* file name record */
+    dCOMPDEF = 0xEA             /* compiler type info */
+};
+
+typedef struct ObjRecord ObjRecord;
+typedef void ORI(ObjRecord * orp);
+
+struct ObjRecord {
+    ORI *ori;                   /* Initialization routine           */
+    int used;                   /* Current data size                */
+    int committed;              /* Data size at last boundary       */
+    int x_size;                 /* (see obj_x)                      */
+    unsigned int type;          /* Record type                      */
+    ObjRecord *child;           /* Associated record below this one */
+    ObjRecord **up;             /* Master pointer to this ObjRecord */
+    ObjRecord *back;            /* Previous part of this record     */
+    uint32_t parm[OBJ_PARMS];      /* Parameters for ori routine       */
+    uint8_t buf[RECORD_MAX + 3];
+};
+
+static void obj_fwrite(ObjRecord * orp);
+static void ori_ledata(ObjRecord * orp);
+static void ori_pubdef(ObjRecord * orp);
+static void ori_null(ObjRecord * orp);
+static ObjRecord *obj_commit(ObjRecord * orp);
+
+static bool obj_uppercase;       /* Flag: all names in uppercase */
+static bool obj_use32;           /* Flag: at least one segment is 32-bit */
+
+/*
+ * Clear an ObjRecord structure.  (Never reallocates).
+ * To simplify reuse of ObjRecord's, .type, .ori and .parm are not cleared.
+ */
+static ObjRecord *obj_clear(ObjRecord * orp)
+{
+    orp->used = 0;
+    orp->committed = 0;
+    orp->x_size = 0;
+    orp->child = NULL;
+    orp->up = NULL;
+    orp->back = NULL;
+    return (orp);
+}
+
+/*
+ * Emit an ObjRecord structure.  (Never reallocates).
+ * The record is written out preceeded (recursively) by its previous part (if
+ * any) and followed (recursively) by its child (if any).
+ * The previous part and the child are freed.  The main ObjRecord is cleared,
+ * not freed.
+ */
+static ObjRecord *obj_emit(ObjRecord * orp)
+{
+    if (orp->back) {
+        obj_emit(orp->back);
+        nasm_free(orp->back);
+    }
+
+    if (orp->committed)
+        obj_fwrite(orp);
+
+    if (orp->child) {
+        obj_emit(orp->child);
+        nasm_free(orp->child);
+    }
+
+    return (obj_clear(orp));
+}
+
+/*
+ * Commit and Emit a record.  (Never reallocates).
+ */
+static ObjRecord *obj_emit2(ObjRecord * orp)
+{
+    obj_commit(orp);
+    return (obj_emit(orp));
+}
+
+/*
+ * Allocate and clear a new ObjRecord;  Also sets .ori to ori_null
+ */
+static ObjRecord *obj_new(void)
+{
+    ObjRecord *orp;
+
+    orp = obj_clear(nasm_malloc(sizeof(ObjRecord)));
+    orp->ori = ori_null;
+    return (orp);
+}
+
+/*
+ * Advance to the next record because the existing one is full or its x_size
+ * is incompatible.
+ * Any uncommited data is moved into the next record.
+ */
+static ObjRecord *obj_bump(ObjRecord * orp)
+{
+    ObjRecord *nxt;
+    int used = orp->used;
+    int committed = orp->committed;
+
+    if (orp->up) {
+        *orp->up = nxt = obj_new();
+        nxt->ori = orp->ori;
+        nxt->type = orp->type;
+        nxt->up = orp->up;
+        nxt->back = orp;
+        memcpy(nxt->parm, orp->parm, sizeof(orp->parm));
+    } else
+        nxt = obj_emit(orp);
+
+    used -= committed;
+    if (used) {
+        nxt->committed = 1;
+        nxt->ori(nxt);
+        nxt->committed = nxt->used;
+        memcpy(nxt->buf + nxt->committed, orp->buf + committed, used);
+        nxt->used = nxt->committed + used;
+    }
+
+    return (nxt);
+}
+
+/*
+ * Advance to the next record if necessary to allow the next field to fit.
+ */
+static ObjRecord *obj_check(ObjRecord * orp, int size)
+{
+    if (orp->used + size > RECORD_MAX)
+        orp = obj_bump(orp);
+
+    if (!orp->committed) {
+        orp->committed = 1;
+        orp->ori(orp);
+        orp->committed = orp->used;
+    }
+
+    return (orp);
+}
+
+/*
+ * All data written so far is commited to the current record (won't be moved to
+ * the next record in case of continuation).
+ */
+static ObjRecord *obj_commit(ObjRecord * orp)
+{
+    orp->committed = orp->used;
+    return (orp);
+}
+
+/*
+ * Write a byte
+ */
+static ObjRecord *obj_byte(ObjRecord * orp, uint8_t val)
+{
+    orp = obj_check(orp, 1);
+    orp->buf[orp->used] = val;
+    orp->used++;
+    return (orp);
+}
+
+/*
+ * Write a word
+ */
+static ObjRecord *obj_word(ObjRecord * orp, unsigned int val)
+{
+    orp = obj_check(orp, 2);
+    orp->buf[orp->used] = val;
+    orp->buf[orp->used + 1] = val >> 8;
+    orp->used += 2;
+    return (orp);
+}
+
+/*
+ * Write a reversed word
+ */
+static ObjRecord *obj_rword(ObjRecord * orp, unsigned int val)
+{
+    orp = obj_check(orp, 2);
+    orp->buf[orp->used] = val >> 8;
+    orp->buf[orp->used + 1] = val;
+    orp->used += 2;
+    return (orp);
+}
+
+/*
+ * Write a dword
+ */
+static ObjRecord *obj_dword(ObjRecord * orp, uint32_t val)
+{
+    orp = obj_check(orp, 4);
+    orp->buf[orp->used] = val;
+    orp->buf[orp->used + 1] = val >> 8;
+    orp->buf[orp->used + 2] = val >> 16;
+    orp->buf[orp->used + 3] = val >> 24;
+    orp->used += 4;
+    return (orp);
+}
+
+/*
+ * All fields of "size x" in one obj record must be the same size (either 16
+ * bits or 32 bits).  There is a one bit flag in each record which specifies
+ * which.
+ * This routine is used to force the current record to have the desired
+ * x_size.  x_size is normally automatic (using obj_x), so that this
+ * routine should be used outside obj_x, only to provide compatibility with
+ * linkers that have bugs in their processing of the size bit.
+ */
+
+static ObjRecord *obj_force(ObjRecord * orp, int x)
+{
+    if (orp->x_size == (x ^ 48))
+        orp = obj_bump(orp);
+    orp->x_size = x;
+    return (orp);
+}
+
+/*
+ * This routine writes a field of size x.  The caller does not need to worry at
+ * all about whether 16-bits or 32-bits are required.
+ */
+static ObjRecord *obj_x(ObjRecord * orp, uint32_t val)
+{
+    if (orp->type & 1)
+        orp->x_size = 32;
+    if (val > 0xFFFF)
+        orp = obj_force(orp, 32);
+    if (orp->x_size == 32) {
+       ObjRecord *nxt = obj_dword(orp, val);
+       nxt->x_size = 32;       /* x_size is cleared when a record overflows */
+       return nxt;
+    }
+    orp->x_size = 16;
+    return (obj_word(orp, val));
+}
+
+/*
+ * Writes an index
+ */
+static ObjRecord *obj_index(ObjRecord * orp, unsigned int val)
+{
+    if (val < 128)
+        return (obj_byte(orp, val));
+    return (obj_word(orp, (val >> 8) | (val << 8) | 0x80));
+}
+
+/*
+ * Writes a variable length value
+ */
+static ObjRecord *obj_value(ObjRecord * orp, uint32_t val)
+{
+    if (val <= 128)
+        return (obj_byte(orp, val));
+    if (val <= 0xFFFF) {
+        orp = obj_byte(orp, 129);
+        return (obj_word(orp, val));
+    }
+    if (val <= 0xFFFFFF)
+        return (obj_dword(orp, (val << 8) + 132));
+    orp = obj_byte(orp, 136);
+    return (obj_dword(orp, val));
+}
+
+/*
+ * Writes a counted string
+ */
+static ObjRecord *obj_name(ObjRecord * orp, const char *name)
+{
+    int len = strlen(name);
+    uint8_t *ptr;
+
+    orp = obj_check(orp, len + 1);
+    ptr = orp->buf + orp->used;
+    *ptr++ = len;
+    orp->used += len + 1;
+    if (obj_uppercase)
+        while (--len >= 0) {
+            *ptr++ = toupper(*name);
+            name++;
+    } else
+        memcpy(ptr, name, len);
+    return (orp);
+}
+
+/*
+ * Initializer for an LEDATA record.
+ * parm[0] = offset
+ * parm[1] = segment index
+ * During the use of a LEDATA ObjRecord, parm[0] is constantly updated to
+ * represent the offset that would be required if the record were split at the
+ * last commit point.
+ * parm[2] is a copy of parm[0] as it was when the current record was initted.
+ */
+static void ori_ledata(ObjRecord * orp)
+{
+    obj_index(orp, orp->parm[1]);
+    orp->parm[2] = orp->parm[0];
+    obj_x(orp, orp->parm[0]);
+}
+
+/*
+ * Initializer for a PUBDEF record.
+ * parm[0] = group index
+ * parm[1] = segment index
+ * parm[2] = frame (only used when both indexes are zero)
+ */
+static void ori_pubdef(ObjRecord * orp)
+{
+    obj_index(orp, orp->parm[0]);
+    obj_index(orp, orp->parm[1]);
+    if (!(orp->parm[0] | orp->parm[1]))
+        obj_word(orp, orp->parm[2]);
+}
+
+/*
+ * Initializer for a LINNUM record.
+ * parm[0] = group index
+ * parm[1] = segment index
+ */
+static void ori_linnum(ObjRecord * orp)
+{
+    obj_index(orp, orp->parm[0]);
+    obj_index(orp, orp->parm[1]);
+}
+
+/*
+ * Initializer for a local vars record.
+ */
+static void ori_local(ObjRecord * orp)
+{
+    obj_byte(orp, 0x40);
+    obj_byte(orp, dSYM);
+}
+
+/*
+ * Null initializer for records that continue without any header info
+ */
+static void ori_null(ObjRecord * orp)
+{
+    (void)orp;                  /* Do nothing */
+}
+
+/*
+ * This concludes the low level section of outobj.c
+ */
+
+static char obj_infile[FILENAME_MAX];
+
+static int32_t first_seg;
+static bool any_segs;
+static int passtwo;
+static int arrindex;
+
+#define GROUP_MAX 256           /* we won't _realistically_ have more
+                                 * than this many segs in a group */
+#define EXT_BLKSIZ 256          /* block size for externals list */
+
+struct Segment;                 /* need to know these structs exist */
+struct Group;
+
+struct LineNumber {
+    struct LineNumber *next;
+    struct Segment *segment;
+    int32_t offset;
+    int32_t lineno;
+};
+
+static struct FileName {
+    struct FileName *next;
+    char *name;
+    struct LineNumber *lnhead, **lntail;
+    int index;
+} *fnhead, **fntail;
+
+static struct Array {
+    struct Array *next;
+    unsigned size;
+    int basetype;
+} *arrhead, **arrtail;
+
+#define ARRAYBOT 31             /* magic number  for first array index */
+
+static struct Public {
+    struct Public *next;
+    char *name;
+    int32_t offset;
+    int32_t segment;               /* only if it's far-absolute */
+    int type;                   /* only for local debug syms */
+} *fpubhead, **fpubtail, *last_defined;
+
+static struct External {
+    struct External *next;
+    char *name;
+    int32_t commonsize;
+    int32_t commonelem;            /* element size if FAR, else zero */
+    int index;                  /* OBJ-file external index */
+    enum {
+        DEFWRT_NONE,            /* no unusual default-WRT */
+        DEFWRT_STRING,          /* a string we don't yet understand */
+        DEFWRT_SEGMENT,         /* a segment */
+        DEFWRT_GROUP            /* a group */
+    } defwrt_type;
+    union {
+        char *string;
+        struct Segment *seg;
+        struct Group *grp;
+    } defwrt_ptr;
+    struct External *next_dws;  /* next with DEFWRT_STRING */
+} *exthead, **exttail, *dws;
+
+static int externals;
+
+static struct ExtBack {
+    struct ExtBack *next;
+    struct External *exts[EXT_BLKSIZ];
+} *ebhead, **ebtail;
+
+static struct Segment {
+    struct Segment *next;
+    int32_t index;                 /* the NASM segment id */
+    int32_t obj_index;             /* the OBJ-file segment index */
+    struct Group *grp;          /* the group it beint32_ts to */
+    uint32_t currentpos;
+    int32_t align;                 /* can be SEG_ABS + absolute addr */
+    enum {
+        CMB_PRIVATE = 0,
+        CMB_PUBLIC = 2,
+        CMB_STACK = 5,
+        CMB_COMMON = 6
+    } combine;
+    bool use32;                 /* is this segment 32-bit? */
+    struct Public *pubhead, **pubtail, *lochead, **loctail;
+    char *name;
+    char *segclass, *overlay;   /* `class' is a C++ keyword :-) */
+    ObjRecord *orp;
+} *seghead, **segtail, *obj_seg_needs_update;
+
+static struct Group {
+    struct Group *next;
+    char *name;
+    int32_t index;                 /* NASM segment id */
+    int32_t obj_index;             /* OBJ-file group index */
+    int32_t nentries;              /* number of elements... */
+    int32_t nindices;              /* ...and number of index elts... */
+    union {
+        int32_t index;
+        char *name;
+    } segs[GROUP_MAX];          /* ...in this */
+} *grphead, **grptail, *obj_grp_needs_update;
+
+static struct ImpDef {
+    struct ImpDef *next;
+    char *extname;
+    char *libname;
+    unsigned int impindex;
+    char *impname;
+} *imphead, **imptail;
+
+static struct ExpDef {
+    struct ExpDef *next;
+    char *intname;
+    char *extname;
+    unsigned int ordinal;
+    int flags;
+} *exphead, **exptail;
+
+#define EXPDEF_FLAG_ORDINAL  0x80
+#define EXPDEF_FLAG_RESIDENT 0x40
+#define EXPDEF_FLAG_NODATA   0x20
+#define EXPDEF_MASK_PARMCNT  0x1F
+
+static int32_t obj_entry_seg, obj_entry_ofs;
+
+struct ofmt of_obj;
+
+/* The current segment */
+static struct Segment *current_seg;
+
+static int32_t obj_segment(char *, int, int *);
+static void obj_write_file(int debuginfo);
+static int obj_directive(enum directives, char *, int);
+
+static void obj_init(void)
+{
+    first_seg = seg_alloc();
+    any_segs = false;
+    fpubhead = NULL;
+    fpubtail = &fpubhead;
+    exthead = NULL;
+    exttail = &exthead;
+    imphead = NULL;
+    imptail = &imphead;
+    exphead = NULL;
+    exptail = &exphead;
+    dws = NULL;
+    externals = 0;
+    ebhead = NULL;
+    ebtail = &ebhead;
+    seghead = obj_seg_needs_update = NULL;
+    segtail = &seghead;
+    grphead = obj_grp_needs_update = NULL;
+    grptail = &grphead;
+    obj_entry_seg = NO_SEG;
+    obj_uppercase = false;
+    obj_use32 = false;
+    passtwo = 0;
+    current_seg = NULL;
+}
+
+static int obj_set_info(enum geninfo type, char **val)
+{
+    (void)type;
+    (void)val;
+
+    return 0;
+}
+static void obj_cleanup(int debuginfo)
+{
+    obj_write_file(debuginfo);
+    of_obj.current_dfmt->cleanup();
+    while (seghead) {
+        struct Segment *segtmp = seghead;
+        seghead = seghead->next;
+        while (segtmp->pubhead) {
+            struct Public *pubtmp = segtmp->pubhead;
+            segtmp->pubhead = pubtmp->next;
+            nasm_free(pubtmp->name);
+            nasm_free(pubtmp);
+        }
+        nasm_free(segtmp->segclass);
+        nasm_free(segtmp->overlay);
+        nasm_free(segtmp);
+    }
+    while (fpubhead) {
+        struct Public *pubtmp = fpubhead;
+        fpubhead = fpubhead->next;
+        nasm_free(pubtmp->name);
+        nasm_free(pubtmp);
+    }
+    while (exthead) {
+        struct External *exttmp = exthead;
+        exthead = exthead->next;
+        nasm_free(exttmp);
+    }
+    while (imphead) {
+        struct ImpDef *imptmp = imphead;
+        imphead = imphead->next;
+        nasm_free(imptmp->extname);
+        nasm_free(imptmp->libname);
+        nasm_free(imptmp->impname);     /* nasm_free won't mind if it's NULL */
+        nasm_free(imptmp);
+    }
+    while (exphead) {
+        struct ExpDef *exptmp = exphead;
+        exphead = exphead->next;
+        nasm_free(exptmp->extname);
+        nasm_free(exptmp->intname);
+        nasm_free(exptmp);
+    }
+    while (ebhead) {
+        struct ExtBack *ebtmp = ebhead;
+        ebhead = ebhead->next;
+        nasm_free(ebtmp);
+    }
+    while (grphead) {
+        struct Group *grptmp = grphead;
+        grphead = grphead->next;
+        nasm_free(grptmp);
+    }
+}
+
+static void obj_ext_set_defwrt(struct External *ext, char *id)
+{
+    struct Segment *seg;
+    struct Group *grp;
+
+    for (seg = seghead; seg; seg = seg->next)
+        if (!strcmp(seg->name, id)) {
+            ext->defwrt_type = DEFWRT_SEGMENT;
+            ext->defwrt_ptr.seg = seg;
+            nasm_free(id);
+            return;
+        }
+
+    for (grp = grphead; grp; grp = grp->next)
+        if (!strcmp(grp->name, id)) {
+            ext->defwrt_type = DEFWRT_GROUP;
+            ext->defwrt_ptr.grp = grp;
+            nasm_free(id);
+            return;
+        }
+
+    ext->defwrt_type = DEFWRT_STRING;
+    ext->defwrt_ptr.string = id;
+    ext->next_dws = dws;
+    dws = ext;
+}
+
+static void obj_deflabel(char *name, int32_t segment,
+                         int64_t offset, int is_global, char *special)
+{
+    /*
+     * We have three cases:
+     *
+     * (i) `segment' is a segment-base. If so, set the name field
+     * for the segment or group structure it refers to, and then
+     * return.
+     *
+     * (ii) `segment' is one of our segments, or a SEG_ABS segment.
+     * Save the label position for later output of a PUBDEF record.
+     * (Or a MODPUB, if we work out how.)
+     *
+     * (iii) `segment' is not one of our segments. Save the label
+     * position for later output of an EXTDEF, and also store a
+     * back-reference so that we can map later references to this
+     * segment number to the external index.
+     */
+    struct External *ext;
+    struct ExtBack *eb;
+    struct Segment *seg;
+    int i;
+    bool used_special = false;   /* have we used the special text? */
+
+#if defined(DEBUG) && DEBUG>2
+    nasm_error(ERR_DEBUG,
+            " obj_deflabel: %s, seg=%"PRIx32", off=%"PRIx64", is_global=%d, %s\n",
+            name, segment, offset, is_global, special);
+#endif
+
+    /*
+     * If it's a special-retry from pass two, discard it.
+     */
+    if (is_global == 3)
+        return;
+
+    /*
+     * First check for the double-period, signifying something
+     * unusual.
+     */
+    if (name[0] == '.' && name[1] == '.' && name[2] != '@') {
+        if (!strcmp(name, "..start")) {
+            obj_entry_seg = segment;
+            obj_entry_ofs = offset;
+            return;
+        }
+        nasm_error(ERR_NONFATAL, "unrecognised special symbol `%s'", name);
+    }
+
+    /*
+     * Case (i):
+     */
+    if (obj_seg_needs_update) {
+        obj_seg_needs_update->name = name;
+        return;
+    } else if (obj_grp_needs_update) {
+        obj_grp_needs_update->name = name;
+        return;
+    }
+    if (segment < SEG_ABS && segment != NO_SEG && segment % 2)
+        return;
+
+    if (segment >= SEG_ABS || segment == NO_SEG) {
+        /*
+         * SEG_ABS subcase of (ii).
+         */
+        if (is_global) {
+            struct Public *pub;
+
+            pub = *fpubtail = nasm_malloc(sizeof(*pub));
+            fpubtail = &pub->next;
+            pub->next = NULL;
+            pub->name = nasm_strdup(name);
+            pub->offset = offset;
+            pub->segment = (segment == NO_SEG ? 0 : segment & ~SEG_ABS);
+        }
+        if (special)
+            nasm_error(ERR_NONFATAL, "OBJ supports no special symbol features"
+                  " for this symbol type");
+        return;
+    }
+
+    /*
+     * If `any_segs' is still false, we might need to define a
+     * default segment, if they're trying to declare a label in
+     * `first_seg'.
+     */
+    if (!any_segs && segment == first_seg) {
+        int tempint;            /* ignored */
+        if (segment != obj_segment("__NASMDEFSEG", 2, &tempint))
+            nasm_error(ERR_PANIC, "strange segment conditions in OBJ driver");
+    }
+
+    for (seg = seghead; seg && is_global; seg = seg->next)
+        if (seg->index == segment) {
+            struct Public *loc = nasm_malloc(sizeof(*loc));
+            /*
+             * Case (ii). Maybe MODPUB someday?
+             */
+            *seg->pubtail = loc;
+            seg->pubtail = &loc->next;
+            loc->next = NULL;
+            loc->name = nasm_strdup(name);
+            loc->offset = offset;
+
+            if (special)
+                nasm_error(ERR_NONFATAL,
+                      "OBJ supports no special symbol features"
+                      " for this symbol type");
+            return;
+        }
+
+    /*
+     * Case (iii).
+     */
+    if (is_global) {
+        ext = *exttail = nasm_malloc(sizeof(*ext));
+        ext->next = NULL;
+        exttail = &ext->next;
+        ext->name = name;
+        /* Place by default all externs into the current segment */
+        ext->defwrt_type = DEFWRT_NONE;
+
+/* 28-Apr-2002 - John Coffman
+  The following code was introduced on 12-Aug-2000, and breaks fixups
+  on code passed thru the MSC 5.1 linker (3.66) and MSC 6.00A linker
+  (5.10).  It was introduced after FIXUP32 was added, and may be needed
+  for 32-bit segments.  The following will get 16-bit segments working
+  again, and maybe someone can correct the 'if' condition which is
+  actually needed.
+*/
+#if 0
+        if (current_seg) {
+#else
+        if (current_seg && current_seg->use32) {
+            if (current_seg->grp) {
+                ext->defwrt_type = DEFWRT_GROUP;
+                ext->defwrt_ptr.grp = current_seg->grp;
+            } else {
+                ext->defwrt_type = DEFWRT_SEGMENT;
+                ext->defwrt_ptr.seg = current_seg;
+            }
+        }
+#endif
+
+        if (is_global == 2) {
+            ext->commonsize = offset;
+            ext->commonelem = 1;        /* default FAR */
+        } else
+            ext->commonsize = 0;
+    } else
+        return;
+
+    /*
+     * Now process the special text, if any, to find default-WRT
+     * specifications and common-variable element-size and near/far
+     * specifications.
+     */
+    while (special && *special) {
+        used_special = true;
+
+        /*
+         * We might have a default-WRT specification.
+         */
+        if (!nasm_strnicmp(special, "wrt", 3)) {
+            char *p;
+            int len;
+            special += 3;
+            special += strspn(special, " \t");
+            p = nasm_strndup(special, len = strcspn(special, ":"));
+            obj_ext_set_defwrt(ext, p);
+            special += len;
+            if (*special && *special != ':')
+                nasm_error(ERR_NONFATAL, "`:' expected in special symbol"
+                      " text for `%s'", ext->name);
+            else if (*special == ':')
+                special++;
+        }
+
+        /*
+         * The NEAR or FAR keywords specify nearness or
+         * farness. FAR gives default element size 1.
+         */
+        if (!nasm_strnicmp(special, "far", 3)) {
+            if (ext->commonsize)
+                ext->commonelem = 1;
+            else
+                nasm_error(ERR_NONFATAL,
+                      "`%s': `far' keyword may only be applied"
+                      " to common variables\n", ext->name);
+            special += 3;
+            special += strspn(special, " \t");
+        } else if (!nasm_strnicmp(special, "near", 4)) {
+            if (ext->commonsize)
+                ext->commonelem = 0;
+            else
+                nasm_error(ERR_NONFATAL,
+                      "`%s': `far' keyword may only be applied"
+                      " to common variables\n", ext->name);
+            special += 4;
+            special += strspn(special, " \t");
+        }
+
+        /*
+         * If it's a common, and anything else remains on the line
+         * before a further colon, evaluate it as an expression and
+         * use that as the element size. Forward references aren't
+         * allowed.
+         */
+        if (*special == ':')
+            special++;
+        else if (*special) {
+            if (ext->commonsize) {
+                expr *e;
+                struct tokenval tokval;
+
+                stdscan_reset();
+                stdscan_set(special);
+                tokval.t_type = TOKEN_INVALID;
+                e = evaluate(stdscan, NULL, &tokval, NULL, 1, nasm_error, NULL);
+                if (e) {
+                    if (!is_simple(e))
+                        nasm_error(ERR_NONFATAL, "cannot use relocatable"
+                              " expression as common-variable element size");
+                    else
+                        ext->commonelem = reloc_value(e);
+                }
+                special = stdscan_get();
+            } else {
+                nasm_error(ERR_NONFATAL,
+                      "`%s': element-size specifications only"
+                      " apply to common variables", ext->name);
+                while (*special && *special != ':')
+                    special++;
+                if (*special == ':')
+                    special++;
+            }
+        }
+    }
+
+    i = segment / 2;
+    eb = ebhead;
+    if (!eb) {
+        eb = *ebtail = nasm_malloc(sizeof(*eb));
+        eb->next = NULL;
+        ebtail = &eb->next;
+    }
+    while (i >= EXT_BLKSIZ) {
+        if (eb && eb->next)
+            eb = eb->next;
+        else {
+            eb = *ebtail = nasm_malloc(sizeof(*eb));
+            eb->next = NULL;
+            ebtail = &eb->next;
+        }
+        i -= EXT_BLKSIZ;
+    }
+    eb->exts[i] = ext;
+    ext->index = ++externals;
+
+    if (special && !used_special)
+        nasm_error(ERR_NONFATAL, "OBJ supports no special symbol features"
+              " for this symbol type");
+}
+
+/* forward declaration */
+static void obj_write_fixup(ObjRecord * orp, int bytes,
+                            int segrel, int32_t seg, int32_t wrt,
+                            struct Segment *segto);
+
+static void obj_out(int32_t segto, const void *data,
+                   enum out_type type, uint64_t size,
+                    int32_t segment, int32_t wrt)
+{
+    const uint8_t *ucdata;
+    int32_t ldata;
+    struct Segment *seg;
+    ObjRecord *orp;
+
+    /*
+     * handle absolute-assembly (structure definitions)
+     */
+    if (segto == NO_SEG) {
+        if (type != OUT_RESERVE)
+            nasm_error(ERR_NONFATAL, "attempt to assemble code in [ABSOLUTE]"
+                  " space");
+        return;
+    }
+
+    /*
+     * If `any_segs' is still false, we must define a default
+     * segment.
+     */
+    if (!any_segs) {
+        int tempint;            /* ignored */
+        if (segto != obj_segment("__NASMDEFSEG", 2, &tempint))
+            nasm_error(ERR_PANIC, "strange segment conditions in OBJ driver");
+    }
+
+    /*
+     * Find the segment we are targetting.
+     */
+    for (seg = seghead; seg; seg = seg->next)
+        if (seg->index == segto)
+            break;
+    if (!seg)
+        nasm_error(ERR_PANIC, "code directed to nonexistent segment?");
+
+    orp = seg->orp;
+    orp->parm[0] = seg->currentpos;
+
+    if (type == OUT_RAWDATA) {
+        ucdata = data;
+        while (size > 0) {
+            unsigned int len;
+            orp = obj_check(seg->orp, 1);
+            len = RECORD_MAX - orp->used;
+            if (len > size)
+                len = size;
+            memcpy(orp->buf + orp->used, ucdata, len);
+            orp->committed = orp->used += len;
+            orp->parm[0] = seg->currentpos += len;
+            ucdata += len;
+            size -= len;
+        }
+    } else if (type == OUT_ADDRESS || type == OUT_REL2ADR ||
+               type == OUT_REL4ADR) {
+        int rsize;
+
+        if (segment == NO_SEG && type != OUT_ADDRESS)
+            nasm_error(ERR_NONFATAL, "relative call to absolute address not"
+                  " supported by OBJ format");
+        if (segment >= SEG_ABS)
+            nasm_error(ERR_NONFATAL, "far-absolute relocations not supported"
+                  " by OBJ format");
+        ldata = *(int64_t *)data;
+        if (type == OUT_REL2ADR) {
+            ldata += (size - 2);
+            size = 2;
+        } else if (type == OUT_REL4ADR) {
+            ldata += (size - 4);
+            size = 4;
+        }
+        if (size == 2)
+            orp = obj_word(orp, ldata);
+        else
+            orp = obj_dword(orp, ldata);
+        rsize = size;
+        if (segment < SEG_ABS && (segment != NO_SEG && segment % 2) &&
+            size == 4) {
+            /*
+             * This is a 4-byte segment-base relocation such as
+             * `MOV EAX,SEG foo'. OBJ format can't actually handle
+             * these, but if the constant term has the 16 low bits
+             * zero, we can just apply a 2-byte segment-base
+             * relocation to the low word instead.
+             */
+            rsize = 2;
+            if (ldata & 0xFFFF)
+                nasm_error(ERR_NONFATAL, "OBJ format cannot handle complex"
+                      " dword-size segment base references");
+        }
+        if (segment != NO_SEG)
+            obj_write_fixup(orp, rsize,
+                            (type == OUT_ADDRESS ? 0x4000 : 0),
+                            segment, wrt, seg);
+        seg->currentpos += size;
+    } else if (type == OUT_RESERVE) {
+        if (orp->committed)
+            orp = obj_bump(orp);
+        seg->currentpos += size;
+    }
+    obj_commit(orp);
+}
+
+static void obj_write_fixup(ObjRecord * orp, int bytes,
+                            int segrel, int32_t seg, int32_t wrt,
+                            struct Segment *segto)
+{
+    unsigned locat;
+    int method;
+    int base;
+    int32_t tidx, fidx;
+    struct Segment *s = NULL;
+    struct Group *g = NULL;
+    struct External *e = NULL;
+    ObjRecord *forp;
+
+    if (bytes == 1) {
+        nasm_error(ERR_NONFATAL, "`obj' output driver does not support"
+              " one-byte relocations");
+        return;
+    }
+
+    forp = orp->child;
+    if (forp == NULL) {
+        orp->child = forp = obj_new();
+        forp->up = &(orp->child);
+        /* We should choose between FIXUPP and FIXU32 record type */
+        /* If we're targeting a 32-bit segment, use a FIXU32 record */
+        if (segto->use32)
+            forp->type = FIXU32;
+        else
+            forp->type = FIXUPP;
+    }
+
+    if (seg % 2) {
+        base = true;
+        locat = FIX_16_SELECTOR;
+        seg--;
+        if (bytes != 2)
+            nasm_error(ERR_PANIC, "OBJ: 4-byte segment base fixup got"
+                  " through sanity check");
+    } else {
+        base = false;
+        locat = (bytes == 2) ? FIX_16_OFFSET : FIX_32_OFFSET;
+        if (!segrel)
+            /*
+             * There is a bug in tlink that makes it process self relative
+             * fixups incorrectly if the x_size doesn't match the location
+             * size.
+             */
+            forp = obj_force(forp, bytes << 3);
+    }
+
+    forp = obj_rword(forp, locat | segrel | (orp->parm[0] - orp->parm[2]));
+
+    tidx = fidx = -1, method = 0;       /* placate optimisers */
+
+    /*
+     * See if we can find the segment ID in our segment list. If
+     * so, we have a T4 (LSEG) target.
+     */
+    for (s = seghead; s; s = s->next)
+        if (s->index == seg)
+            break;
+    if (s)
+        method = 4, tidx = s->obj_index;
+    else {
+        for (g = grphead; g; g = g->next)
+            if (g->index == seg)
+                break;
+        if (g)
+            method = 5, tidx = g->obj_index;
+        else {
+            int32_t i = seg / 2;
+            struct ExtBack *eb = ebhead;
+            while (i >= EXT_BLKSIZ) {
+                if (eb)
+                    eb = eb->next;
+                else
+                    break;
+                i -= EXT_BLKSIZ;
+            }
+            if (eb)
+                method = 6, e = eb->exts[i], tidx = e->index;
+            else
+                nasm_error(ERR_PANIC,
+                      "unrecognised segment value in obj_write_fixup");
+        }
+    }
+
+    /*
+     * If no WRT given, assume the natural default, which is method
+     * F5 unless:
+     *
+     * - we are doing an OFFSET fixup for a grouped segment, in
+     *   which case we require F1 (group).
+     *
+     * - we are doing an OFFSET fixup for an external with a
+     *   default WRT, in which case we must honour the default WRT.
+     */
+    if (wrt == NO_SEG) {
+        if (!base && s && s->grp)
+            method |= 0x10, fidx = s->grp->obj_index;
+        else if (!base && e && e->defwrt_type != DEFWRT_NONE) {
+            if (e->defwrt_type == DEFWRT_SEGMENT)
+                method |= 0x00, fidx = e->defwrt_ptr.seg->obj_index;
+            else if (e->defwrt_type == DEFWRT_GROUP)
+                method |= 0x10, fidx = e->defwrt_ptr.grp->obj_index;
+            else {
+                nasm_error(ERR_NONFATAL, "default WRT specification for"
+                      " external `%s' unresolved", e->name);
+                method |= 0x50, fidx = -1;      /* got to do _something_ */
+            }
+        } else
+            method |= 0x50, fidx = -1;
+    } else {
+        /*
+         * See if we can find the WRT-segment ID in our segment
+         * list. If so, we have a F0 (LSEG) frame.
+         */
+        for (s = seghead; s; s = s->next)
+            if (s->index == wrt - 1)
+                break;
+        if (s)
+            method |= 0x00, fidx = s->obj_index;
+        else {
+            for (g = grphead; g; g = g->next)
+                if (g->index == wrt - 1)
+                    break;
+            if (g)
+                method |= 0x10, fidx = g->obj_index;
+            else {
+                int32_t i = wrt / 2;
+                struct ExtBack *eb = ebhead;
+                while (i >= EXT_BLKSIZ) {
+                    if (eb)
+                        eb = eb->next;
+                    else
+                        break;
+                    i -= EXT_BLKSIZ;
+                }
+                if (eb)
+                    method |= 0x20, fidx = eb->exts[i]->index;
+                else
+                    nasm_error(ERR_PANIC,
+                          "unrecognised WRT value in obj_write_fixup");
+            }
+        }
+    }
+
+    forp = obj_byte(forp, method);
+    if (fidx != -1)
+        forp = obj_index(forp, fidx);
+    forp = obj_index(forp, tidx);
+    obj_commit(forp);
+}
+
+static int32_t obj_segment(char *name, int pass, int *bits)
+{
+    /*
+     * We call the label manager here to define a name for the new
+     * segment, and when our _own_ label-definition stub gets
+     * called in return, it should register the new segment name
+     * using the pointer it gets passed. That way we save memory,
+     * by sponging off the label manager.
+     */
+#if defined(DEBUG) && DEBUG>=3
+    nasm_error(ERR_DEBUG, " obj_segment: < %s >, pass=%d, *bits=%d\n",
+            name, pass, *bits);
+#endif
+    if (!name) {
+        *bits = 16;
+        current_seg = NULL;
+        return first_seg;
+    } else {
+        struct Segment *seg;
+        struct Group *grp;
+        struct External **extp;
+        int obj_idx, i, attrs;
+       bool rn_error;
+        char *p;
+
+        /*
+         * Look for segment attributes.
+         */
+        attrs = 0;
+        while (*name == '.')
+            name++;             /* hack, but a documented one */
+        p = name;
+        while (*p && !nasm_isspace(*p))
+            p++;
+        if (*p) {
+            *p++ = '\0';
+            while (*p && nasm_isspace(*p))
+                *p++ = '\0';
+        }
+        while (*p) {
+            while (*p && !nasm_isspace(*p))
+                p++;
+            if (*p) {
+                *p++ = '\0';
+                while (*p && nasm_isspace(*p))
+                    *p++ = '\0';
+            }
+
+            attrs++;
+        }
+
+        obj_idx = 1;
+        for (seg = seghead; seg; seg = seg->next) {
+            obj_idx++;
+            if (!strcmp(seg->name, name)) {
+                if (attrs > 0 && pass == 1)
+                    nasm_error(ERR_WARNING, "segment attributes specified on"
+                          " redeclaration of segment: ignoring");
+                if (seg->use32)
+                    *bits = 32;
+                else
+                    *bits = 16;
+                current_seg = seg;
+                return seg->index;
+            }
+        }
+
+        *segtail = seg = nasm_malloc(sizeof(*seg));
+        seg->next = NULL;
+        segtail = &seg->next;
+        seg->index = (any_segs ? seg_alloc() : first_seg);
+        seg->obj_index = obj_idx;
+        seg->grp = NULL;
+        any_segs = true;
+        seg->name = NULL;
+        seg->currentpos = 0;
+        seg->align = 1;         /* default */
+        seg->use32 = false;     /* default */
+        seg->combine = CMB_PUBLIC;      /* default */
+        seg->segclass = seg->overlay = NULL;
+        seg->pubhead = NULL;
+        seg->pubtail = &seg->pubhead;
+        seg->lochead = NULL;
+        seg->loctail = &seg->lochead;
+        seg->orp = obj_new();
+        seg->orp->up = &(seg->orp);
+        seg->orp->ori = ori_ledata;
+        seg->orp->type = LEDATA;
+        seg->orp->parm[1] = obj_idx;
+
+        /*
+         * Process the segment attributes.
+         */
+        p = name;
+        while (attrs--) {
+            p += strlen(p);
+            while (!*p)
+                p++;
+
+            /*
+             * `p' contains a segment attribute.
+             */
+            if (!nasm_stricmp(p, "private"))
+                seg->combine = CMB_PRIVATE;
+            else if (!nasm_stricmp(p, "public"))
+                seg->combine = CMB_PUBLIC;
+            else if (!nasm_stricmp(p, "common"))
+                seg->combine = CMB_COMMON;
+            else if (!nasm_stricmp(p, "stack"))
+                seg->combine = CMB_STACK;
+            else if (!nasm_stricmp(p, "use16"))
+                seg->use32 = false;
+            else if (!nasm_stricmp(p, "use32"))
+                seg->use32 = true;
+            else if (!nasm_stricmp(p, "flat")) {
+                /*
+                 * This segment is an OS/2 FLAT segment. That means
+                 * that its default group is group FLAT, even if
+                 * the group FLAT does not explicitly _contain_ the
+                 * segment.
+                 *
+                 * When we see this, we must create the group
+                 * `FLAT', containing no segments, if it does not
+                 * already exist; then we must set the default
+                 * group of this segment to be the FLAT group.
+                 */
+                struct Group *grp;
+                for (grp = grphead; grp; grp = grp->next)
+                    if (!strcmp(grp->name, "FLAT"))
+                        break;
+                if (!grp) {
+                    obj_directive(D_GROUP, "FLAT", 1);
+                    for (grp = grphead; grp; grp = grp->next)
+                        if (!strcmp(grp->name, "FLAT"))
+                            break;
+                    if (!grp)
+                        nasm_error(ERR_PANIC, "failure to define FLAT?!");
+                }
+                seg->grp = grp;
+            } else if (!nasm_strnicmp(p, "class=", 6))
+                seg->segclass = nasm_strdup(p + 6);
+            else if (!nasm_strnicmp(p, "overlay=", 8))
+                seg->overlay = nasm_strdup(p + 8);
+            else if (!nasm_strnicmp(p, "align=", 6)) {
+                seg->align = readnum(p + 6, &rn_error);
+                if (rn_error) {
+                    seg->align = 1;
+                    nasm_error(ERR_NONFATAL, "segment alignment should be"
+                          " numeric");
+                }
+                switch ((int)seg->align) {
+                case 1:        /* BYTE */
+                case 2:        /* WORD */
+                case 4:        /* DWORD */
+                case 16:       /* PARA */
+                case 256:      /* PAGE */
+                case 4096:     /* PharLap extension */
+                    break;
+                case 8:
+                    nasm_error(ERR_WARNING,
+                          "OBJ format does not support alignment"
+                          " of 8: rounding up to 16");
+                    seg->align = 16;
+                    break;
+                case 32:
+                case 64:
+                case 128:
+                    nasm_error(ERR_WARNING,
+                          "OBJ format does not support alignment"
+                          " of %d: rounding up to 256", seg->align);
+                    seg->align = 256;
+                    break;
+                case 512:
+                case 1024:
+                case 2048:
+                    nasm_error(ERR_WARNING,
+                          "OBJ format does not support alignment"
+                          " of %d: rounding up to 4096", seg->align);
+                    seg->align = 4096;
+                    break;
+                default:
+                    nasm_error(ERR_NONFATAL, "invalid alignment value %d",
+                          seg->align);
+                    seg->align = 1;
+                    break;
+                }
+            } else if (!nasm_strnicmp(p, "absolute=", 9)) {
+                seg->align = SEG_ABS + readnum(p + 9, &rn_error);
+                if (rn_error)
+                    nasm_error(ERR_NONFATAL, "argument to `absolute' segment"
+                          " attribute should be numeric");
+            }
+        }
+
+        /* We need to know whenever we have at least one 32-bit segment */
+        obj_use32 |= seg->use32;
+
+        obj_seg_needs_update = seg;
+        if (seg->align >= SEG_ABS)
+            define_label(name, NO_SEG, seg->align - SEG_ABS,
+                        NULL, false, false);
+        else
+            define_label(name, seg->index + 1, 0L,
+                        NULL, false, false);
+        obj_seg_needs_update = NULL;
+
+        /*
+         * See if this segment is defined in any groups.
+         */
+        for (grp = grphead; grp; grp = grp->next) {
+            for (i = grp->nindices; i < grp->nentries; i++) {
+                if (!strcmp(grp->segs[i].name, seg->name)) {
+                    nasm_free(grp->segs[i].name);
+                    grp->segs[i] = grp->segs[grp->nindices];
+                    grp->segs[grp->nindices++].index = seg->obj_index;
+                    if (seg->grp)
+                        nasm_error(ERR_WARNING,
+                                  "segment `%s' is already part of"
+                                  " a group: first one takes precedence",
+                                  seg->name);
+                    else
+                        seg->grp = grp;
+                }
+            }
+        }
+
+        /*
+         * Walk through the list of externals with unresolved
+         * default-WRT clauses, and resolve any that point at this
+         * segment.
+         */
+        extp = &dws;
+        while (*extp) {
+            if ((*extp)->defwrt_type == DEFWRT_STRING &&
+                !strcmp((*extp)->defwrt_ptr.string, seg->name)) {
+                nasm_free((*extp)->defwrt_ptr.string);
+                (*extp)->defwrt_type = DEFWRT_SEGMENT;
+                (*extp)->defwrt_ptr.seg = seg;
+                *extp = (*extp)->next_dws;
+            } else
+                extp = &(*extp)->next_dws;
+        }
+
+        if (seg->use32)
+            *bits = 32;
+        else
+            *bits = 16;
+        current_seg = seg;
+        return seg->index;
+    }
+}
+
+static int obj_directive(enum directives directive, char *value, int pass)
+{
+    switch (directive) {
+    case D_GROUP:
+    {
+        char *p, *q, *v;
+        if (pass == 1) {
+            struct Group *grp;
+            struct Segment *seg;
+            struct External **extp;
+            int obj_idx;
+
+            q = value;
+            while (*q == '.')
+                q++;            /* hack, but a documented one */
+            v = q;
+            while (*q && !nasm_isspace(*q))
+                q++;
+            if (nasm_isspace(*q)) {
+                *q++ = '\0';
+                while (*q && nasm_isspace(*q))
+                    q++;
+            }
+            /*
+             * Here we used to sanity-check the group directive to
+             * ensure nobody tried to declare a group containing no
+             * segments. However, OS/2 does this as standard
+             * practice, so the sanity check has been removed.
+             *
+             * if (!*q) {
+             *     nasm_error(ERR_NONFATAL,"GROUP directive contains no segments");
+             *     return 1;
+             * }
+             */
+
+            obj_idx = 1;
+            for (grp = grphead; grp; grp = grp->next) {
+                obj_idx++;
+                if (!strcmp(grp->name, v)) {
+                    nasm_error(ERR_NONFATAL, "group `%s' defined twice", v);
+                    return 1;
+                }
+            }
+
+            *grptail = grp = nasm_malloc(sizeof(*grp));
+            grp->next = NULL;
+            grptail = &grp->next;
+            grp->index = seg_alloc();
+            grp->obj_index = obj_idx;
+            grp->nindices = grp->nentries = 0;
+            grp->name = NULL;
+
+            obj_grp_needs_update = grp;
+            define_label(v, grp->index + 1, 0L, NULL, false, false);
+            obj_grp_needs_update = NULL;
+
+            while (*q) {
+                p = q;
+                while (*q && !nasm_isspace(*q))
+                    q++;
+                if (nasm_isspace(*q)) {
+                    *q++ = '\0';
+                    while (*q && nasm_isspace(*q))
+                        q++;
+                }
+                /*
+                 * Now p contains a segment name. Find it.
+                 */
+                for (seg = seghead; seg; seg = seg->next)
+                    if (!strcmp(seg->name, p))
+                        break;
+                if (seg) {
+                    /*
+                     * We have a segment index. Shift a name entry
+                     * to the end of the array to make room.
+                     */
+                    grp->segs[grp->nentries++] = grp->segs[grp->nindices];
+                    grp->segs[grp->nindices++].index = seg->obj_index;
+                    if (seg->grp)
+                        nasm_error(ERR_WARNING,
+                              "segment `%s' is already part of"
+                              " a group: first one takes precedence",
+                              seg->name);
+                    else
+                        seg->grp = grp;
+                } else {
+                    /*
+                     * We have an as-yet undefined segment.
+                     * Remember its name, for later.
+                     */
+                    grp->segs[grp->nentries++].name = nasm_strdup(p);
+                }
+            }
+
+            /*
+             * Walk through the list of externals with unresolved
+             * default-WRT clauses, and resolve any that point at
+             * this group.
+             */
+            extp = &dws;
+            while (*extp) {
+                if ((*extp)->defwrt_type == DEFWRT_STRING &&
+                    !strcmp((*extp)->defwrt_ptr.string, grp->name)) {
+                    nasm_free((*extp)->defwrt_ptr.string);
+                    (*extp)->defwrt_type = DEFWRT_GROUP;
+                    (*extp)->defwrt_ptr.grp = grp;
+                    *extp = (*extp)->next_dws;
+                } else
+                    extp = &(*extp)->next_dws;
+            }
+        }
+        return 1;
+    }
+    case D_UPPERCASE:
+        obj_uppercase = true;
+        return 1;
+
+    case D_IMPORT:
+    {
+        char *q, *extname, *libname, *impname;
+
+        if (pass == 2)
+            return 1;           /* ignore in pass two */
+        extname = q = value;
+        while (*q && !nasm_isspace(*q))
+            q++;
+        if (nasm_isspace(*q)) {
+            *q++ = '\0';
+            while (*q && nasm_isspace(*q))
+                q++;
+        }
+
+        libname = q;
+        while (*q && !nasm_isspace(*q))
+            q++;
+        if (nasm_isspace(*q)) {
+            *q++ = '\0';
+            while (*q && nasm_isspace(*q))
+                q++;
+        }
+
+        impname = q;
+
+        if (!*extname || !*libname)
+            nasm_error(ERR_NONFATAL, "`import' directive requires symbol name"
+                  " and library name");
+        else {
+            struct ImpDef *imp;
+            bool err = false;
+
+            imp = *imptail = nasm_malloc(sizeof(struct ImpDef));
+            imptail = &imp->next;
+            imp->next = NULL;
+            imp->extname = nasm_strdup(extname);
+            imp->libname = nasm_strdup(libname);
+            imp->impindex = readnum(impname, &err);
+            if (!*impname || err)
+                imp->impname = nasm_strdup(impname);
+            else
+                imp->impname = NULL;
+        }
+
+        return 1;
+    }
+    case D_EXPORT:
+    {
+        char *q, *extname, *intname, *v;
+        struct ExpDef *export;
+        int flags = 0;
+        unsigned int ordinal = 0;
+
+        if (pass == 2)
+            return 1;           /* ignore in pass two */
+        intname = q = value;
+        while (*q && !nasm_isspace(*q))
+            q++;
+        if (nasm_isspace(*q)) {
+            *q++ = '\0';
+            while (*q && nasm_isspace(*q))
+                q++;
+        }
+
+        extname = q;
+        while (*q && !nasm_isspace(*q))
+            q++;
+        if (nasm_isspace(*q)) {
+            *q++ = '\0';
+            while (*q && nasm_isspace(*q))
+                q++;
+        }
+
+        if (!*intname) {
+            nasm_error(ERR_NONFATAL, "`export' directive requires export name");
+            return 1;
+        }
+        if (!*extname) {
+            extname = intname;
+            intname = "";
+        }
+        while (*q) {
+            v = q;
+            while (*q && !nasm_isspace(*q))
+                q++;
+            if (nasm_isspace(*q)) {
+                *q++ = '\0';
+                while (*q && nasm_isspace(*q))
+                    q++;
+            }
+            if (!nasm_stricmp(v, "resident"))
+                flags |= EXPDEF_FLAG_RESIDENT;
+            else if (!nasm_stricmp(v, "nodata"))
+                flags |= EXPDEF_FLAG_NODATA;
+            else if (!nasm_strnicmp(v, "parm=", 5)) {
+                bool err = false;
+                flags |= EXPDEF_MASK_PARMCNT & readnum(v + 5, &err);
+                if (err) {
+                    nasm_error(ERR_NONFATAL,
+                          "value `%s' for `parm' is non-numeric", v + 5);
+                    return 1;
+                }
+            } else {
+                bool err = false;
+                ordinal = readnum(v, &err);
+                if (err) {
+                    nasm_error(ERR_NONFATAL,
+                          "unrecognised export qualifier `%s'", v);
+                    return 1;
+                }
+                flags |= EXPDEF_FLAG_ORDINAL;
+            }
+        }
+
+        export = *exptail = nasm_malloc(sizeof(struct ExpDef));
+        exptail = &export->next;
+        export->next = NULL;
+        export->extname = nasm_strdup(extname);
+        export->intname = nasm_strdup(intname);
+        export->ordinal = ordinal;
+        export->flags = flags;
+
+        return 1;
+    }
+    default:
+       return 0;
+    }
+}
+
+static int32_t obj_segbase(int32_t segment)
+{
+    struct Segment *seg;
+
+    /*
+     * Find the segment in our list.
+     */
+    for (seg = seghead; seg; seg = seg->next)
+        if (seg->index == segment - 1)
+            break;
+
+    if (!seg) {
+        /*
+         * Might be an external with a default WRT.
+         */
+        int32_t i = segment / 2;
+        struct ExtBack *eb = ebhead;
+        struct External *e;
+
+        while (i >= EXT_BLKSIZ) {
+            if (eb)
+                eb = eb->next;
+            else
+                break;
+            i -= EXT_BLKSIZ;
+        }
+        if (eb) {
+            e = eb->exts[i];
+           if (!e) {
+               nasm_assert(pass0 == 0);
+               /* Not available - can happen during optimization */
+               return NO_SEG;
+           }
+
+           switch (e->defwrt_type) {
+           case DEFWRT_NONE:
+                return segment; /* fine */
+           case DEFWRT_SEGMENT:
+                return e->defwrt_ptr.seg->index + 1;
+           case DEFWRT_GROUP:
+                return e->defwrt_ptr.grp->index + 1;
+           default:
+                return NO_SEG;  /* can't tell what it is */
+           }
+        }
+
+        return segment;         /* not one of ours - leave it alone */
+    }
+
+    if (seg->align >= SEG_ABS)
+        return seg->align;      /* absolute segment */
+    if (seg->grp)
+        return seg->grp->index + 1;     /* grouped segment */
+
+    return segment;             /* no special treatment */
+}
+
+static void obj_filename(char *inname, char *outname)
+{
+    strcpy(obj_infile, inname);
+    standard_extension(inname, outname, ".obj");
+}
+
+static void obj_write_file(int debuginfo)
+{
+    struct Segment *seg, *entry_seg_ptr = 0;
+    struct FileName *fn;
+    struct LineNumber *ln;
+    struct Group *grp;
+    struct Public *pub, *loc;
+    struct External *ext;
+    struct ImpDef *imp;
+    struct ExpDef *export;
+    int lname_idx;
+    ObjRecord *orp;
+
+    /*
+     * Write the THEADR module header.
+     */
+    orp = obj_new();
+    orp->type = THEADR;
+    obj_name(orp, obj_infile);
+    obj_emit2(orp);
+
+    /*
+     * Write the NASM boast comment.
+     */
+    orp->type = COMENT;
+    obj_rword(orp, 0);          /* comment type zero */
+    obj_name(orp, nasm_comment);
+    obj_emit2(orp);
+
+    orp->type = COMENT;
+    /*
+     * Write the IMPDEF records, if any.
+     */
+    for (imp = imphead; imp; imp = imp->next) {
+        obj_rword(orp, 0xA0);   /* comment class A0 */
+        obj_byte(orp, 1);       /* subfunction 1: IMPDEF */
+        if (imp->impname)
+            obj_byte(orp, 0);   /* import by name */
+        else
+            obj_byte(orp, 1);   /* import by ordinal */
+        obj_name(orp, imp->extname);
+        obj_name(orp, imp->libname);
+        if (imp->impname)
+            obj_name(orp, imp->impname);
+        else
+            obj_word(orp, imp->impindex);
+        obj_emit2(orp);
+    }
+
+    /*
+     * Write the EXPDEF records, if any.
+     */
+    for (export = exphead; export; export = export->next) {
+        obj_rword(orp, 0xA0);   /* comment class A0 */
+        obj_byte(orp, 2);       /* subfunction 2: EXPDEF */
+        obj_byte(orp, export->flags);
+        obj_name(orp, export->extname);
+        obj_name(orp, export->intname);
+        if (export->flags & EXPDEF_FLAG_ORDINAL)
+            obj_word(orp, export->ordinal);
+        obj_emit2(orp);
+    }
+
+    /* we're using extended OMF if we put in debug info */
+    if (debuginfo) {
+        orp->type = COMENT;
+        obj_byte(orp, 0x40);
+        obj_byte(orp, dEXTENDED);
+        obj_emit2(orp);
+    }
+
+    /*
+     * Write the first LNAMES record, containing LNAME one, which
+     * is null. Also initialize the LNAME counter.
+     */
+    orp->type = LNAMES;
+    obj_byte(orp, 0);
+    lname_idx = 1;
+    /*
+     * Write some LNAMES for the segment names
+     */
+    for (seg = seghead; seg; seg = seg->next) {
+        orp = obj_name(orp, seg->name);
+        if (seg->segclass)
+            orp = obj_name(orp, seg->segclass);
+        if (seg->overlay)
+            orp = obj_name(orp, seg->overlay);
+        obj_commit(orp);
+    }
+    /*
+     * Write some LNAMES for the group names
+     */
+    for (grp = grphead; grp; grp = grp->next) {
+        orp = obj_name(orp, grp->name);
+        obj_commit(orp);
+    }
+    obj_emit(orp);
+
+    /*
+     * Write the SEGDEF records.
+     */
+    orp->type = SEGDEF;
+    for (seg = seghead; seg; seg = seg->next) {
+        int acbp;
+        uint32_t seglen = seg->currentpos;
+
+        acbp = (seg->combine << 2);     /* C field */
+
+        if (seg->use32)
+            acbp |= 0x01;       /* P bit is Use32 flag */
+        else if (seglen == 0x10000L) {
+            seglen = 0;         /* This special case may be needed for old linkers */
+            acbp |= 0x02;       /* B bit */
+        }
+
+        /* A field */
+        if (seg->align >= SEG_ABS)
+            /* acbp |= 0x00 */ ;
+        else if (seg->align >= 4096) {
+            if (seg->align > 4096)
+                nasm_error(ERR_NONFATAL, "segment `%s' requires more alignment"
+                      " than OBJ format supports", seg->name);
+            acbp |= 0xC0;       /* PharLap extension */
+        } else if (seg->align >= 256) {
+            acbp |= 0x80;
+        } else if (seg->align >= 16) {
+            acbp |= 0x60;
+        } else if (seg->align >= 4) {
+            acbp |= 0xA0;
+        } else if (seg->align >= 2) {
+            acbp |= 0x40;
+        } else
+            acbp |= 0x20;
+
+        obj_byte(orp, acbp);
+        if (seg->align & SEG_ABS) {
+            obj_x(orp, seg->align - SEG_ABS);   /* Frame */
+            obj_byte(orp, 0);   /* Offset */
+        }
+        obj_x(orp, seglen);
+        obj_index(orp, ++lname_idx);
+        obj_index(orp, seg->segclass ? ++lname_idx : 1);
+        obj_index(orp, seg->overlay ? ++lname_idx : 1);
+        obj_emit2(orp);
+    }
+
+    /*
+     * Write the GRPDEF records.
+     */
+    orp->type = GRPDEF;
+    for (grp = grphead; grp; grp = grp->next) {
+        int i;
+
+        if (grp->nindices != grp->nentries) {
+            for (i = grp->nindices; i < grp->nentries; i++) {
+                nasm_error(ERR_NONFATAL, "group `%s' contains undefined segment"
+                      " `%s'", grp->name, grp->segs[i].name);
+                nasm_free(grp->segs[i].name);
+                grp->segs[i].name = NULL;
+            }
+        }
+        obj_index(orp, ++lname_idx);
+        for (i = 0; i < grp->nindices; i++) {
+            obj_byte(orp, 0xFF);
+            obj_index(orp, grp->segs[i].index);
+        }
+        obj_emit2(orp);
+    }
+
+    /*
+     * Write the PUBDEF records: first the ones in the segments,
+     * then the far-absolutes.
+     */
+    orp->type = PUBDEF;
+    orp->ori = ori_pubdef;
+    for (seg = seghead; seg; seg = seg->next) {
+        orp->parm[0] = seg->grp ? seg->grp->obj_index : 0;
+        orp->parm[1] = seg->obj_index;
+        for (pub = seg->pubhead; pub; pub = pub->next) {
+            orp = obj_name(orp, pub->name);
+            orp = obj_x(orp, pub->offset);
+            orp = obj_byte(orp, 0);     /* type index */
+            obj_commit(orp);
+        }
+        obj_emit(orp);
+    }
+    orp->parm[0] = 0;
+    orp->parm[1] = 0;
+    for (pub = fpubhead; pub; pub = pub->next) {        /* pub-crawl :-) */
+        if (orp->parm[2] != (uint32_t)pub->segment) {
+            obj_emit(orp);
+            orp->parm[2] = pub->segment;
+        }
+        orp = obj_name(orp, pub->name);
+        orp = obj_x(orp, pub->offset);
+        orp = obj_byte(orp, 0); /* type index */
+        obj_commit(orp);
+    }
+    obj_emit(orp);
+
+    /*
+     * Write the EXTDEF and COMDEF records, in order.
+     */
+    orp->ori = ori_null;
+    for (ext = exthead; ext; ext = ext->next) {
+        if (ext->commonsize == 0) {
+            if (orp->type != EXTDEF) {
+                obj_emit(orp);
+                orp->type = EXTDEF;
+            }
+            orp = obj_name(orp, ext->name);
+            orp = obj_index(orp, 0);
+        } else {
+            if (orp->type != COMDEF) {
+                obj_emit(orp);
+                orp->type = COMDEF;
+            }
+            orp = obj_name(orp, ext->name);
+            orp = obj_index(orp, 0);
+            if (ext->commonelem) {
+                orp = obj_byte(orp, 0x61);      /* far communal */
+                orp = obj_value(orp, (ext->commonsize / ext->commonelem));
+                orp = obj_value(orp, ext->commonelem);
+            } else {
+                orp = obj_byte(orp, 0x62);      /* near communal */
+                orp = obj_value(orp, ext->commonsize);
+            }
+        }
+        obj_commit(orp);
+    }
+    obj_emit(orp);
+
+    /*
+     * Write a COMENT record stating that the linker's first pass
+     * may stop processing at this point. Exception is if our
+     * MODEND record specifies a start point, in which case,
+     * according to some variants of the documentation, this COMENT
+     * should be omitted. So we'll omit it just in case.
+     * But, TASM puts it in all the time so if we are using
+     * TASM debug stuff we are putting it in
+     */
+    if (debuginfo || obj_entry_seg == NO_SEG) {
+        orp->type = COMENT;
+        obj_byte(orp, 0x40);
+        obj_byte(orp, dLINKPASS);
+        obj_byte(orp, 1);
+        obj_emit2(orp);
+    }
+
+    /*
+     * 1) put out the compiler type
+     * 2) Put out the type info.  The only type we are using is near label #19
+     */
+    if (debuginfo) {
+        int i;
+        struct Array *arrtmp = arrhead;
+        orp->type = COMENT;
+        obj_byte(orp, 0x40);
+        obj_byte(orp, dCOMPDEF);
+        obj_byte(orp, 4);
+        obj_byte(orp, 0);
+        obj_emit2(orp);
+
+        obj_byte(orp, 0x40);
+        obj_byte(orp, dTYPEDEF);
+        obj_word(orp, 0x18);    /* type # for linking */
+        obj_word(orp, 6);       /* size of type */
+        obj_byte(orp, 0x2a);    /* absolute type for debugging */
+        obj_emit2(orp);
+        obj_byte(orp, 0x40);
+        obj_byte(orp, dTYPEDEF);
+        obj_word(orp, 0x19);    /* type # for linking */
+        obj_word(orp, 0);       /* size of type */
+        obj_byte(orp, 0x24);    /* absolute type for debugging */
+        obj_byte(orp, 0);       /* near/far specifier */
+        obj_emit2(orp);
+        obj_byte(orp, 0x40);
+        obj_byte(orp, dTYPEDEF);
+        obj_word(orp, 0x1A);    /* type # for linking */
+        obj_word(orp, 0);       /* size of type */
+        obj_byte(orp, 0x24);    /* absolute type for debugging */
+        obj_byte(orp, 1);       /* near/far specifier */
+        obj_emit2(orp);
+        obj_byte(orp, 0x40);
+        obj_byte(orp, dTYPEDEF);
+        obj_word(orp, 0x1b);    /* type # for linking */
+        obj_word(orp, 0);       /* size of type */
+        obj_byte(orp, 0x23);    /* absolute type for debugging */
+        obj_byte(orp, 0);
+        obj_byte(orp, 0);
+        obj_byte(orp, 0);
+        obj_emit2(orp);
+        obj_byte(orp, 0x40);
+        obj_byte(orp, dTYPEDEF);
+        obj_word(orp, 0x1c);    /* type # for linking */
+        obj_word(orp, 0);       /* size of type */
+        obj_byte(orp, 0x23);    /* absolute type for debugging */
+        obj_byte(orp, 0);
+        obj_byte(orp, 4);
+        obj_byte(orp, 0);
+        obj_emit2(orp);
+        obj_byte(orp, 0x40);
+        obj_byte(orp, dTYPEDEF);
+        obj_word(orp, 0x1d);    /* type # for linking */
+        obj_word(orp, 0);       /* size of type */
+        obj_byte(orp, 0x23);    /* absolute type for debugging */
+        obj_byte(orp, 0);
+        obj_byte(orp, 1);
+        obj_byte(orp, 0);
+        obj_emit2(orp);
+        obj_byte(orp, 0x40);
+        obj_byte(orp, dTYPEDEF);
+        obj_word(orp, 0x1e);    /* type # for linking */
+        obj_word(orp, 0);       /* size of type */
+        obj_byte(orp, 0x23);    /* absolute type for debugging */
+        obj_byte(orp, 0);
+        obj_byte(orp, 5);
+        obj_byte(orp, 0);
+        obj_emit2(orp);
+
+        /* put out the array types */
+        for (i = ARRAYBOT; i < arrindex; i++) {
+            obj_byte(orp, 0x40);
+            obj_byte(orp, dTYPEDEF);
+            obj_word(orp, i);   /* type # for linking */
+            obj_word(orp, arrtmp->size);        /* size of type */
+            obj_byte(orp, 0x1A);        /* absolute type for debugging (array) */
+            obj_byte(orp, arrtmp->basetype);    /* base type */
+            obj_emit2(orp);
+            arrtmp = arrtmp->next;
+        }
+    }
+    /*
+     * write out line number info with a LINNUM record
+     * switch records when we switch segments, and output the
+     * file in a pseudo-TASM fashion.  The record switch is naive; that
+     * is that one file may have many records for the same segment
+     * if there are lots of segment switches
+     */
+    if (fnhead && debuginfo) {
+        seg = fnhead->lnhead->segment;
+
+        for (fn = fnhead; fn; fn = fn->next) {
+            /* write out current file name */
+            orp->type = COMENT;
+            orp->ori = ori_null;
+            obj_byte(orp, 0x40);
+            obj_byte(orp, dFILNAME);
+            obj_byte(orp, 0);
+            obj_name(orp, fn->name);
+            obj_dword(orp, 0);
+            obj_emit2(orp);
+
+            /* write out line numbers this file */
+
+            orp->type = LINNUM;
+            orp->ori = ori_linnum;
+            for (ln = fn->lnhead; ln; ln = ln->next) {
+                if (seg != ln->segment) {
+                    /* if we get here have to flush the buffer and start
+                     * a new record for a new segment
+                     */
+                    seg = ln->segment;
+                    obj_emit(orp);
+                }
+                orp->parm[0] = seg->grp ? seg->grp->obj_index : 0;
+                orp->parm[1] = seg->obj_index;
+                orp = obj_word(orp, ln->lineno);
+                orp = obj_x(orp, ln->offset);
+                obj_commit(orp);
+            }
+            obj_emit(orp);
+        }
+    }
+    /*
+     * we are going to locate the entry point segment now
+     * rather than wait until the MODEND record, because,
+     * then we can output a special symbol to tell where the
+     * entry point is.
+     *
+     */
+    if (obj_entry_seg != NO_SEG) {
+        for (seg = seghead; seg; seg = seg->next) {
+            if (seg->index == obj_entry_seg) {
+                entry_seg_ptr = seg;
+                break;
+            }
+        }
+        if (!seg)
+            nasm_error(ERR_NONFATAL, "entry point is not in this module");
+    }
+
+    /*
+     * get ready to put out symbol records
+     */
+    orp->type = COMENT;
+    orp->ori = ori_local;
+
+    /*
+     * put out a symbol for the entry point
+     * no dots in this symbol, because, borland does
+     * not (officially) support dots in label names
+     * and I don't know what various versions of TLINK will do
+     */
+    if (debuginfo && obj_entry_seg != NO_SEG) {
+        orp = obj_name(orp, "start_of_program");
+        orp = obj_word(orp, 0x19);      /* type: near label */
+        orp = obj_index(orp, seg->grp ? seg->grp->obj_index : 0);
+        orp = obj_index(orp, seg->obj_index);
+        orp = obj_x(orp, obj_entry_ofs);
+        obj_commit(orp);
+    }
+
+    /*
+     * put out the local labels
+     */
+    for (seg = seghead; seg && debuginfo; seg = seg->next) {
+        /* labels this seg */
+        for (loc = seg->lochead; loc; loc = loc->next) {
+            orp = obj_name(orp, loc->name);
+            orp = obj_word(orp, loc->type);
+            orp = obj_index(orp, seg->grp ? seg->grp->obj_index : 0);
+            orp = obj_index(orp, seg->obj_index);
+            orp = obj_x(orp, loc->offset);
+            obj_commit(orp);
+        }
+    }
+    if (orp->used)
+        obj_emit(orp);
+
+    /*
+     * Write the LEDATA/FIXUPP pairs.
+     */
+    for (seg = seghead; seg; seg = seg->next) {
+        obj_emit(seg->orp);
+        nasm_free(seg->orp);
+    }
+
+    /*
+     * Write the MODEND module end marker.
+     */
+    orp->type = obj_use32 ? MODE32 : MODEND;
+    orp->ori = ori_null;
+    if (entry_seg_ptr) {
+        orp->type = entry_seg_ptr->use32 ? MODE32 : MODEND;
+        obj_byte(orp, 0xC1);
+        seg = entry_seg_ptr;
+        if (seg->grp) {
+            obj_byte(orp, 0x10);
+            obj_index(orp, seg->grp->obj_index);
+        } else {
+            /*
+             * the below changed to prevent TLINK crashing.
+             * Previous more efficient version read:
+             *
+             *  obj_byte (orp, 0x50);
+             */
+            obj_byte(orp, 0x00);
+            obj_index(orp, seg->obj_index);
+        }
+        obj_index(orp, seg->obj_index);
+        obj_x(orp, obj_entry_ofs);
+    } else
+        obj_byte(orp, 0);
+    obj_emit2(orp);
+    nasm_free(orp);
+}
+
+static void obj_fwrite(ObjRecord * orp)
+{
+    unsigned int cksum, len;
+    uint8_t *ptr;
+
+    cksum = orp->type;
+    if (orp->x_size == 32)
+        cksum |= 1;
+    fputc(cksum, ofile);
+    len = orp->committed + 1;
+    cksum += (len & 0xFF) + ((len >> 8) & 0xFF);
+    fwriteint16_t(len, ofile);
+    fwrite(orp->buf, 1, len - 1, ofile);
+    for (ptr = orp->buf; --len; ptr++)
+        cksum += *ptr;
+    fputc((-cksum) & 0xFF, ofile);
+}
+
+extern macros_t obj_stdmac[];
+
+void dbgbi_init(void)
+{
+    fnhead = NULL;
+    fntail = &fnhead;
+    arrindex = ARRAYBOT;
+    arrhead = NULL;
+    arrtail = &arrhead;
+}
+static void dbgbi_cleanup(void)
+{
+    struct Segment *segtmp;
+    while (fnhead) {
+        struct FileName *fntemp = fnhead;
+        while (fnhead->lnhead) {
+            struct LineNumber *lntemp = fnhead->lnhead;
+            fnhead->lnhead = lntemp->next;
+            nasm_free(lntemp);
+        }
+        fnhead = fnhead->next;
+        nasm_free(fntemp->name);
+        nasm_free(fntemp);
+    }
+    for (segtmp = seghead; segtmp; segtmp = segtmp->next) {
+        while (segtmp->lochead) {
+            struct Public *loctmp = segtmp->lochead;
+            segtmp->lochead = loctmp->next;
+            nasm_free(loctmp->name);
+            nasm_free(loctmp);
+        }
+    }
+    while (arrhead) {
+        struct Array *arrtmp = arrhead;
+        arrhead = arrhead->next;
+        nasm_free(arrtmp);
+    }
+}
+
+static void dbgbi_linnum(const char *lnfname, int32_t lineno, int32_t segto)
+{
+    struct FileName *fn;
+    struct LineNumber *ln;
+    struct Segment *seg;
+
+    if (segto == NO_SEG)
+        return;
+
+    /*
+     * If `any_segs' is still false, we must define a default
+     * segment.
+     */
+    if (!any_segs) {
+        int tempint;            /* ignored */
+        if (segto != obj_segment("__NASMDEFSEG", 2, &tempint))
+            nasm_error(ERR_PANIC, "strange segment conditions in OBJ driver");
+    }
+
+    /*
+     * Find the segment we are targetting.
+     */
+    for (seg = seghead; seg; seg = seg->next)
+        if (seg->index == segto)
+            break;
+    if (!seg)
+        nasm_error(ERR_PANIC, "lineno directed to nonexistent segment?");
+
+/*    for (fn = fnhead; fn; fn = fnhead->next) */
+    for (fn = fnhead; fn; fn = fn->next)        /* fbk - Austin Lunnen - John Fine */
+        if (!nasm_stricmp(lnfname, fn->name))
+            break;
+    if (!fn) {
+        fn = nasm_malloc(sizeof(*fn));
+        fn->name = nasm_malloc(strlen(lnfname) + 1);
+        strcpy(fn->name, lnfname);
+        fn->lnhead = NULL;
+        fn->lntail = &fn->lnhead;
+        fn->next = NULL;
+        *fntail = fn;
+        fntail = &fn->next;
+    }
+    ln = nasm_malloc(sizeof(*ln));
+    ln->segment = seg;
+    ln->offset = seg->currentpos;
+    ln->lineno = lineno;
+    ln->next = NULL;
+    *fn->lntail = ln;
+    fn->lntail = &ln->next;
+
+}
+static void dbgbi_deflabel(char *name, int32_t segment,
+                           int64_t offset, int is_global, char *special)
+{
+    struct Segment *seg;
+
+    (void)special;
+
+    /*
+     * If it's a special-retry from pass two, discard it.
+     */
+    if (is_global == 3)
+        return;
+
+    /*
+     * First check for the double-period, signifying something
+     * unusual.
+     */
+    if (name[0] == '.' && name[1] == '.' && name[2] != '@') {
+        return;
+    }
+
+    /*
+     * Case (i):
+     */
+    if (obj_seg_needs_update) {
+        return;
+    } else if (obj_grp_needs_update) {
+        return;
+    }
+    if (segment < SEG_ABS && segment != NO_SEG && segment % 2)
+        return;
+
+    if (segment >= SEG_ABS || segment == NO_SEG) {
+        return;
+    }
+
+    /*
+     * If `any_segs' is still false, we might need to define a
+     * default segment, if they're trying to declare a label in
+     * `first_seg'.  But the label should exist due to a prior
+     * call to obj_deflabel so we can skip that.
+     */
+
+    for (seg = seghead; seg; seg = seg->next)
+        if (seg->index == segment) {
+            struct Public *loc = nasm_malloc(sizeof(*loc));
+            /*
+             * Case (ii). Maybe MODPUB someday?
+             */
+            last_defined = *seg->loctail = loc;
+            seg->loctail = &loc->next;
+            loc->next = NULL;
+            loc->name = nasm_strdup(name);
+            loc->offset = offset;
+        }
+}
+static void dbgbi_typevalue(int32_t type)
+{
+    int vsize;
+    int elem = TYM_ELEMENTS(type);
+    type = TYM_TYPE(type);
+
+    if (!last_defined)
+        return;
+
+    switch (type) {
+    case TY_BYTE:
+        last_defined->type = 8; /* uint8_t */
+        vsize = 1;
+        break;
+    case TY_WORD:
+        last_defined->type = 10;        /* unsigned word */
+        vsize = 2;
+        break;
+    case TY_DWORD:
+        last_defined->type = 12;        /* unsigned dword */
+        vsize = 4;
+        break;
+    case TY_FLOAT:
+        last_defined->type = 14;        /* float */
+        vsize = 4;
+        break;
+    case TY_QWORD:
+        last_defined->type = 15;        /* qword */
+        vsize = 8;
+        break;
+    case TY_TBYTE:
+        last_defined->type = 16;        /* TBYTE */
+        vsize = 10;
+        break;
+    default:
+        last_defined->type = 0x19;      /*label */
+        vsize = 0;
+        break;
+    }
+
+    if (elem > 1) {
+        struct Array *arrtmp = nasm_malloc(sizeof(*arrtmp));
+        int vtype = last_defined->type;
+        arrtmp->size = vsize * elem;
+        arrtmp->basetype = vtype;
+        arrtmp->next = NULL;
+        last_defined->type = arrindex++;
+        *arrtail = arrtmp;
+        arrtail = &(arrtmp->next);
+    }
+    last_defined = NULL;
+}
+static void dbgbi_output(int output_type, void *param)
+{
+    (void)output_type;
+    (void)param;
+}
+static struct dfmt borland_debug_form = {
+    "Borland Debug Records",
+    "borland",
+    dbgbi_init,
+    dbgbi_linnum,
+    dbgbi_deflabel,
+    null_debug_directive,
+    dbgbi_typevalue,
+    dbgbi_output,
+    dbgbi_cleanup,
+};
+
+static struct dfmt *borland_debug_arr[3] = {
+    &borland_debug_form,
+    &null_debug_form,
+    NULL
+};
+
+struct ofmt of_obj = {
+    "MS-DOS 16-bit/32-bit OMF object files",
+    "obj",
+    0,
+    borland_debug_arr,
+    &borland_debug_form,
+    obj_stdmac,
+    obj_init,
+    obj_set_info,
+    obj_out,
+    obj_deflabel,
+    obj_segment,
+    obj_segbase,
+    obj_directive,
+    obj_filename,
+    obj_cleanup
+};
+#endif                          /* OF_OBJ */
diff --git a/output/outobj.mac b/output/outobj.mac
new file mode 100644 (file)
index 0000000..a5da833
--- /dev/null
@@ -0,0 +1,49 @@
+;; --------------------------------------------------------------------------
+;;   
+;;   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.
+;;
+;; --------------------------------------------------------------------------
+
+OUT: obj
+%define __SECT__ [section .text]
+%imacro group 1+.nolist
+[group %1]
+%endmacro
+%imacro uppercase 0+.nolist
+[uppercase %1]
+%endmacro
+%imacro export 1+.nolist
+[export %1]
+%endmacro
+%imacro import 1+.nolist
+[import %1]
+%endmacro
+%macro __NASM_CDecl__ 1
+%endmacro
diff --git a/output/outrdf.mac b/output/outrdf.mac
new file mode 100644 (file)
index 0000000..64a7ac1
--- /dev/null
@@ -0,0 +1,40 @@
+;; --------------------------------------------------------------------------
+;;   
+;;   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.
+;;
+;; --------------------------------------------------------------------------
+
+OUT: rdf
+%define __SECT__ [section .text]
+%imacro library 1+.nolist
+[library %1]
+%endmacro
+%macro __NASM_CDecl__ 1
+%endmacro
diff --git a/output/outrdf2.c b/output/outrdf2.c
new file mode 100644 (file)
index 0000000..6d95803
--- /dev/null
@@ -0,0 +1,797 @@
+/* ----------------------------------------------------------------------- *
+ *   
+ *   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.
+ *
+ * ----------------------------------------------------------------------- */
+
+/*
+ * outrdf2.c   output routines for the Netwide Assembler to produce
+ *             RDOFF version 2 format object files, which Julian originally
+ *             planned to use it in his MOSCOW operating system.
+ */
+
+#include "compiler.h"
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <ctype.h>
+#include <assert.h>
+#include <inttypes.h>
+
+#include "nasm.h"
+#include "nasmlib.h"
+#include "saa.h"
+#include "output/outform.h"
+#include "output/outlib.h"
+
+/* VERBOSE_WARNINGS: define this to add some extra warnings... */
+#define VERBOSE_WARNINGS
+
+#ifdef OF_RDF2
+
+#include "rdoff/rdoff.h"
+
+/* This signature is written to start of RDOFF files */
+static const char *RDOFF2Id = RDOFF2_SIGNATURE;
+
+/* Note that whenever a segment is referred to in the RDOFF file, its number
+ * is always half of the segment number that NASM uses to refer to it; this
+ * is because NASM only allocates even numbered segments, so as to not
+ * waste any of the 16 bits of segment number written to the file - this
+ * allows up to 65533 external labels to be defined; otherwise it would be
+ * 32764. */
+
+#define COUNT_SEGTYPES 9
+
+static char *segmenttypes[COUNT_SEGTYPES] = {
+    "null", "text", "code", "data",
+    "comment", "lcomment", "pcomment",
+    "symdebug", "linedebug"
+};
+
+static int segmenttypenumbers[COUNT_SEGTYPES] = {
+    0, 1, 1, 2, 3, 4, 5, 6, 7
+};
+
+/* code for managing buffers needed to separate code and data into individual
+ * sections until they are ready to be written to the file.
+ * We'd better hope that it all fits in memory else we're buggered... */
+
+#define BUF_BLOCK_LEN 4088      /* selected to match page size (4096)
+                                 * on 80x86 machines for efficiency */
+
+/***********************************************************************
+ * Actual code to deal with RDOFF2 ouput format begins here...
+ */
+
+/* global variables set during the initialisation phase */
+
+static struct SAA *seg[RDF_MAXSEGS];    /* seg 0 = code, seg 1 = data */
+static struct SAA *header;      /* relocation/import/export records */
+
+static struct seginfo {
+    char *segname;
+    int segnumber;
+    uint16_t segtype;
+    uint16_t segreserved;
+    int32_t seglength;
+} segments[RDF_MAXSEGS];
+
+static int nsegments;
+
+static int32_t bsslength;
+static int32_t headerlength;
+
+static void rdf2_init(void)
+{
+    int segtext, segdata, segbss;
+
+    maxbits = 64;
+
+    /* set up the initial segments */
+    segments[0].segname = ".text";
+    segments[0].segnumber = 0;
+    segments[0].segtype = 1;
+    segments[0].segreserved = 0;
+    segments[0].seglength = 0;
+
+    segments[1].segname = ".data";
+    segments[1].segnumber = 1;
+    segments[1].segtype = 2;
+    segments[1].segreserved = 0;
+    segments[1].seglength = 0;
+
+    segments[2].segname = ".bss";
+    segments[2].segnumber = 2;
+    segments[2].segtype = 0xFFFF;       /* reserved - should never be produced */
+    segments[2].segreserved = 0;
+    segments[2].seglength = 0;
+
+    nsegments = 3;
+
+    seg[0] = saa_init(1L);
+    seg[1] = saa_init(1L);
+    seg[2] = NULL;              /* special case! */
+
+    header = saa_init(1L);
+
+    segtext = seg_alloc();
+    segdata = seg_alloc();
+    segbss = seg_alloc();
+    if (segtext != 0 || segdata != 2 || segbss != 4)
+        nasm_error(ERR_PANIC,
+              "rdf segment numbers not allocated as expected (%d,%d,%d)",
+              segtext, segdata, segbss);
+    bsslength = 0;
+    headerlength = 0;
+}
+
+static int32_t rdf2_section_names(char *name, int pass, int *bits)
+{
+    int i;
+    bool err;
+    char *p, *q;
+    int code = -1;
+    int reserved = 0;
+
+    (void)pass;
+
+    /*
+     * Default is 32 bits, in the text segment.
+     */
+    if (!name) {
+        *bits = 32;
+        return 0;
+    }
+
+    /* look for segment type code following segment name */
+    p = name;
+    while (*p && !nasm_isspace(*p))
+        p++;
+    if (*p) {                   /* we're now in whitespace */
+        *p++ = '\0';
+        while (*p && nasm_isspace(80))
+            *p++ = '\0';
+    }
+    if (*p) {                   /* we're now in an attribute value */
+        /*
+         * see if we have an optional ',number' following the type code
+         */
+        if ((q = strchr(p, ','))) {
+            *q++ = '\0';
+
+            reserved = readnum(q, &err);
+            if (err) {
+                nasm_error(ERR_NONFATAL,
+                      "value following comma must be numeric");
+                reserved = 0;
+            }
+        }
+        /*
+         * check it against the text strings in segmenttypes
+         */
+
+        for (i = 0; i < COUNT_SEGTYPES; i++)
+            if (!nasm_stricmp(p, segmenttypes[i])) {
+                code = segmenttypenumbers[i];
+                break;
+            }
+        if (code == -1) {       /* didn't find anything */
+            code = readnum(p, &err);
+            if (err) {
+                nasm_error(ERR_NONFATAL, "unrecognised RDF segment type (%s)",
+                      p);
+                code = 3;
+            }
+        }
+    }
+    for (i = 0; i < nsegments; i++) {
+        if (!strcmp(name, segments[i].segname)) {
+            if (code != -1 || reserved != 0)
+                nasm_error(ERR_NONFATAL, "segment attributes specified on"
+                      " redeclaration of segment");
+            return segments[i].segnumber * 2;
+        }
+    }
+
+    /* declaring a new segment! */
+
+    if (code == -1) {
+        nasm_error(ERR_NONFATAL, "new segment declared without type code");
+        code = 3;
+    }
+    if (nsegments == RDF_MAXSEGS) {
+        nasm_error(ERR_FATAL, "reached compiled-in maximum segment limit (%d)",
+              RDF_MAXSEGS);
+        return NO_SEG;
+    }
+
+    segments[nsegments].segname = nasm_strdup(name);
+    i = seg_alloc();
+    if (i % 2 != 0)
+        nasm_error(ERR_PANIC, "seg_alloc() returned odd number");
+    segments[nsegments].segnumber = i >> 1;
+    segments[nsegments].segtype = code;
+    segments[nsegments].segreserved = reserved;
+    segments[nsegments].seglength = 0;
+
+    seg[nsegments] = saa_init(1L);
+
+    return i;
+}
+
+/*
+ * Write relocation record
+ */
+static void write_reloc_rec(struct RelocRec *r)
+{
+    char buf[4], *b;
+
+    if (r->refseg != (uint16_t) NO_SEG && (r->refseg & 1))        /* segment base ref */
+        r->type = RDFREC_SEGRELOC;
+
+    r->refseg >>= 1;            /* adjust segment nos to RDF rather than NASM */
+
+    saa_wbytes(header, &r->type, 1);
+    saa_wbytes(header, &r->reclen, 1);
+    saa_wbytes(header, &r->segment, 1);
+    b = buf;
+    WRITELONG(b, r->offset);
+    saa_wbytes(header, buf, 4);
+    saa_wbytes(header, &r->length, 1);
+    b = buf;
+    WRITESHORT(b, r->refseg);
+    saa_wbytes(header, buf, 2);
+    headerlength += r->reclen + 2;
+}
+
+/*
+ * Write export record
+ */
+static void write_export_rec(struct ExportRec *r)
+{
+    char buf[4], *b;
+
+    r->segment >>= 1;
+
+    saa_wbytes(header, &r->type, 1);
+    saa_wbytes(header, &r->reclen, 1);
+    saa_wbytes(header, &r->flags, 1);
+    saa_wbytes(header, &r->segment, 1);
+    b = buf;
+    WRITELONG(b, r->offset);
+    saa_wbytes(header, buf, 4);
+    saa_wbytes(header, r->label, strlen(r->label) + 1);
+    headerlength += r->reclen + 2;
+}
+
+static void write_import_rec(struct ImportRec *r)
+{
+    char buf[4], *b;
+
+    r->segment >>= 1;
+
+    saa_wbytes(header, &r->type, 1);
+    saa_wbytes(header, &r->reclen, 1);
+    saa_wbytes(header, &r->flags, 1);
+    b = buf;
+    WRITESHORT(b, r->segment);
+    saa_wbytes(header, buf, 2);
+    saa_wbytes(header, r->label, strlen(r->label) + 1);
+    headerlength += r->reclen + 2;
+}
+
+/*
+ * Write BSS record
+ */
+static void write_bss_rec(struct BSSRec *r)
+{
+    char buf[4], *b;
+
+    saa_wbytes(header, &r->type, 1);
+    saa_wbytes(header, &r->reclen, 1);
+    b = buf;
+    WRITELONG(b, r->amount);
+    saa_wbytes(header, buf, 4);
+    headerlength += r->reclen + 2;
+}
+
+/*
+ * Write common variable record
+ */
+static void write_common_rec(struct CommonRec *r)
+{
+    char buf[4], *b;
+
+    r->segment >>= 1;
+
+    saa_wbytes(header, &r->type, 1);
+    saa_wbytes(header, &r->reclen, 1);
+    b = buf;
+    WRITESHORT(b, r->segment);
+    saa_wbytes(header, buf, 2);
+    b = buf;
+    WRITELONG(b, r->size);
+    saa_wbytes(header, buf, 4);
+    b = buf;
+    WRITESHORT(b, r->align);
+    saa_wbytes(header, buf, 2);
+    saa_wbytes(header, r->label, strlen(r->label) + 1);
+    headerlength += r->reclen + 2;
+}
+
+/*
+ * Write library record
+ */
+static void write_dll_rec(struct DLLRec *r)
+{
+    saa_wbytes(header, &r->type, 1);
+    saa_wbytes(header, &r->reclen, 1);
+    saa_wbytes(header, r->libname, strlen(r->libname) + 1);
+    headerlength += r->reclen + 2;
+}
+
+/*
+ * Write module name record
+ */
+static void write_modname_rec(struct ModRec *r)
+{
+    saa_wbytes(header, &r->type, 1);
+    saa_wbytes(header, &r->reclen, 1);
+    saa_wbytes(header, r->modname, strlen(r->modname) + 1);
+    headerlength += r->reclen + 2;
+}
+
+/*
+ * Handle export, import and common records.
+ */
+static void rdf2_deflabel(char *name, int32_t segment, int64_t offset,
+                          int is_global, char *special)
+{
+    struct ExportRec r;
+    struct ImportRec ri;
+    struct CommonRec ci;
+    static int farsym = 0;
+    static int i;
+    char symflags = 0;
+    int len;
+
+    /* Check if the label length is OK */
+    if ((len = strlen(name)) >= EXIM_LABEL_MAX) {
+        nasm_error(ERR_NONFATAL, "label size exceeds %d bytes", EXIM_LABEL_MAX);
+        return;
+    }
+    if (!len) {
+        nasm_error(ERR_NONFATAL, "zero-length label");
+        return;
+    }
+
+    if (is_global == 2) {
+        /* Common variable */
+        ci.type = RDFREC_COMMON;
+        ci.size = offset;
+        ci.segment = segment;
+        strcpy(ci.label, name);
+        ci.reclen = 9 + len;
+        ci.align = 0;
+
+        /*
+         * Check the special text to see if it's a valid number and power
+         * of two; if so, store it as the alignment for the common variable.
+         */
+        if (special) {
+            bool err;
+            ci.align = readnum(special, &err);
+            if (err)
+                nasm_error(ERR_NONFATAL, "alignment constraint `%s' is not a"
+                      " valid number", special);
+            else if ((ci.align | (ci.align - 1)) != 2 * ci.align - 1)
+                nasm_error(ERR_NONFATAL, "alignment constraint `%s' is not a"
+                      " power of two", special);
+        }
+        write_common_rec(&ci);
+    }
+
+    /* We don't care about local labels or fix-up hints */
+    if (is_global != 1)
+        return;
+
+    if (special) {
+        while (*special == ' ' || *special == '\t')
+            special++;
+
+        if (!nasm_strnicmp(special, "export", 6)) {
+            special += 6;
+            symflags |= SYM_GLOBAL;
+        } else if (!nasm_strnicmp(special, "import", 6)) {
+            special += 6;
+            symflags |= SYM_IMPORT;
+        }
+
+        if (*special) {
+            while (nasm_isspace(*special))
+                special++;
+            if (!nasm_stricmp(special, "far")) {
+                farsym = 1;
+            } else if (!nasm_stricmp(special, "near")) {
+                farsym = 0;
+            } else if (!nasm_stricmp(special, "proc") ||
+                       !nasm_stricmp(special, "function")) {
+                symflags |= SYM_FUNCTION;
+            } else if (!nasm_stricmp(special, "data") ||
+                       !nasm_stricmp(special, "object")) {
+                symflags |= SYM_DATA;
+            } else
+                nasm_error(ERR_NONFATAL, "unrecognised symbol type `%s'",
+                      special);
+        }
+    }
+
+    if (name[0] == '.' && name[1] == '.' && name[2] != '@') {
+        nasm_error(ERR_NONFATAL, "unrecognised special symbol `%s'", name);
+        return;
+    }
+
+    for (i = 0; i < nsegments; i++) {
+        if (segments[i].segnumber == segment >> 1)
+            break;
+    }
+
+    if (i >= nsegments) {       /* EXTERN declaration */
+        ri.type = farsym ? RDFREC_FARIMPORT : RDFREC_IMPORT;
+        if (symflags & SYM_GLOBAL)
+            nasm_error(ERR_NONFATAL,
+                  "symbol type conflict - EXTERN cannot be EXPORT");
+        ri.flags = symflags;
+        ri.segment = segment;
+        strcpy(ri.label, name);
+        ri.reclen = 4 + len;
+        write_import_rec(&ri);
+    } else if (is_global) {
+        r.type = RDFREC_GLOBAL; /* GLOBAL declaration */
+        if (symflags & SYM_IMPORT)
+            nasm_error(ERR_NONFATAL,
+                  "symbol type conflict - GLOBAL cannot be IMPORT");
+        r.flags = symflags;
+        r.segment = segment;
+        r.offset = offset;
+        strcpy(r.label, name);
+        r.reclen = 7 + len;
+        write_export_rec(&r);
+    }
+}
+
+static void membufwrite(int segment, const void *data, int bytes)
+{
+    int i;
+    char buf[4], *b;
+
+    for (i = 0; i < nsegments; i++) {
+        if (segments[i].segnumber == segment)
+            break;
+    }
+    if (i == nsegments)
+        nasm_error(ERR_PANIC, "can't find segment %d", segment);
+
+    if (bytes < 0) {
+        b = buf;
+        if (bytes == -2)
+            WRITESHORT(b, *(int16_t *)data);
+        else
+            WRITELONG(b, *(int32_t *)data);
+        data = buf;
+        bytes = -bytes;
+    }
+    segments[i].seglength += bytes;
+    saa_wbytes(seg[i], data, bytes);
+}
+
+static int getsegmentlength(int segment)
+{
+    int i;
+    for (i = 0; i < nsegments; i++) {
+        if (segments[i].segnumber == segment)
+            break;
+    }
+    if (i == nsegments)
+        nasm_error(ERR_PANIC, "can't find segment %d", segment);
+
+    return segments[i].seglength;
+}
+
+static void rdf2_out(int32_t segto, const void *data,
+                    enum out_type type, uint64_t size,
+                     int32_t segment, int32_t wrt)
+{
+    struct RelocRec rr;
+    uint8_t databuf[8], *pd;
+    int seg;
+
+    if (segto == NO_SEG) {
+        if (type != OUT_RESERVE)
+            nasm_error(ERR_NONFATAL,
+                  "attempt to assemble code in ABSOLUTE space");
+        return;
+    }
+
+    segto >>= 1;                /* convert NASM segment no to RDF number */
+
+    for (seg = 0; seg < nsegments; seg++) {
+        if (segments[seg].segnumber == segto)
+            break;
+    }
+    if (seg >= nsegments) {
+        nasm_error(ERR_NONFATAL,
+              "specified segment not supported by rdf output format");
+        return;
+    }
+
+    if (wrt != NO_SEG) {
+        wrt = NO_SEG;           /* continue to do _something_ */
+        nasm_error(ERR_NONFATAL, "WRT not supported by rdf output format");
+    }
+
+    if (segto == 2 && type != OUT_RESERVE) {
+        nasm_error(ERR_NONFATAL, "BSS segments may not be initialized");
+
+        /* just reserve the space for now... */
+
+        if (type == OUT_REL2ADR)
+            size = 2;
+        else
+            size = 4;
+        type = OUT_RESERVE;
+    }
+
+    if (type == OUT_RESERVE) {
+        if (segto == 2)         /* BSS segment space reserverd */
+            bsslength += size;
+        else
+            while (size--)
+                membufwrite(segto, databuf, 1);
+    } else if (type == OUT_RAWDATA) {
+        if (segment != NO_SEG)
+            nasm_error(ERR_PANIC, "OUT_RAWDATA with other than NO_SEG");
+
+        membufwrite(segto, data, size);
+    } else if (type == OUT_ADDRESS) {
+
+        /* if segment == NO_SEG then we are writing an address of an
+           object within the same segment - do not produce reloc rec. */
+
+        /* FIXME - is this behaviour sane? at first glance it doesn't
+           appear to be. Must test this thoroughly...! */
+
+        if (segment != NO_SEG) {
+            /* it's an address, so we must write a relocation record */
+
+            rr.type = RDFREC_RELOC;     /* type signature */
+            rr.reclen = 8;
+            rr.segment = segto; /* segment we're currently in */
+            rr.offset = getsegmentlength(segto);        /* current offset */
+            rr.length = size;  /* length of reference */
+            rr.refseg = segment;        /* segment referred to */
+            write_reloc_rec(&rr);
+        }
+
+        pd = databuf;           /* convert address to little-endian */
+       WRITEADDR(pd, *(int64_t *)data, size);
+        membufwrite(segto, databuf, size);
+    } else if (type == OUT_REL2ADR) {
+        if (segment == segto)
+            nasm_error(ERR_PANIC, "intra-segment OUT_REL2ADR");
+
+        rr.reclen = 8;
+        rr.offset = getsegmentlength(segto);    /* current offset */
+        rr.length = 2;          /* length of reference */
+        rr.refseg = segment;    /* segment referred to (will be >>1'd) */
+
+        if (segment != NO_SEG && segment % 2) {
+            rr.type = RDFREC_SEGRELOC;
+            rr.segment = segto; /* memory base refs *aren't ever* relative! */
+            write_reloc_rec(&rr);
+
+            /* what do we put in the code? Simply the data. This should almost
+             * always be zero, unless someone's doing segment arithmetic...
+             */
+            rr.offset = *(int64_t *)data;
+        } else {
+            rr.type = RDFREC_RELOC;     /* type signature */
+            rr.segment = segto + 64;    /* segment we're currently in + rel flag */
+            write_reloc_rec(&rr);
+
+            /* work out what to put in the code: offset of the end of this operand,
+             * subtracted from any data specified, so that loader can just add
+             * address of imported symbol onto it to get address relative to end of
+             * instruction: import_address + data(offset) - end_of_instrn */
+
+            rr.offset = *(int32_t *)data - (rr.offset + size);
+        }
+
+        membufwrite(segto, &rr.offset, -2);
+    } else if (type == OUT_REL4ADR) {
+        if ((segment == segto) && (globalbits != 64))
+            nasm_error(ERR_PANIC, "intra-segment OUT_REL4ADR");
+        if (segment != NO_SEG && segment % 2) {
+            nasm_error(ERR_PANIC, "erm... 4 byte segment base ref?");
+        }
+
+        rr.type = RDFREC_RELOC; /* type signature */
+        rr.segment = segto + 64;        /* segment we're currently in + rel tag */
+        rr.offset = getsegmentlength(segto);    /* current offset */
+        rr.length = 4;          /* length of reference */
+        rr.refseg = segment;    /* segment referred to */
+        rr.reclen = 8;
+        write_reloc_rec(&rr);
+
+        rr.offset = *(int64_t *)data - (rr.offset + size);
+
+        membufwrite(segto, &rr.offset, -4);
+    }
+}
+
+static void rdf2_cleanup(int debuginfo)
+{
+    int32_t l;
+    struct BSSRec bs;
+    int i;
+
+    (void)debuginfo;
+
+    /* should write imported & exported symbol declarations to header here */
+
+    /* generate the output file... */
+    fwrite(RDOFF2Id, 6, 1, ofile);      /* file type magic number */
+
+    if (bsslength != 0) {       /* reserve BSS */
+        bs.type = RDFREC_BSS;
+        bs.amount = bsslength;
+        bs.reclen = 4;
+        write_bss_rec(&bs);
+    }
+
+    /*
+     * calculate overall length of the output object
+     */
+    l = headerlength + 4;
+
+    for (i = 0; i < nsegments; i++) {
+        if (i == 2)
+            continue;           /* skip BSS segment */
+        l += 10 + segments[i].seglength;
+    }
+    l += 10;                    /* null segment */
+
+    fwriteint32_t(l, ofile);
+
+    fwriteint32_t(headerlength, ofile);
+    saa_fpwrite(header, ofile); /* dump header */
+    saa_free(header);
+
+    for (i = 0; i < nsegments; i++) {
+        if (i == 2)
+            continue;
+
+        fwriteint16_t(segments[i].segtype, ofile);
+        fwriteint16_t(segments[i].segnumber, ofile);
+        fwriteint16_t(segments[i].segreserved, ofile);
+        fwriteint32_t(segments[i].seglength, ofile);
+
+        saa_fpwrite(seg[i], ofile);
+        saa_free(seg[i]);
+    }
+
+    /* null segment - write 10 bytes of zero */
+    fwriteint32_t(0, ofile);
+    fwriteint32_t(0, ofile);
+    fwriteint16_t(0, ofile);
+}
+
+static int32_t rdf2_segbase(int32_t segment)
+{
+    return segment;
+}
+
+/*
+ * Handle RDOFF2 specific directives
+ */
+static int rdf2_directive(enum directives directive, char *value, int pass)
+{
+    size_t n;
+
+    switch (directive) {
+    case D_LIBRARY:
+       n = strlen(value);
+       if (n >= MODLIB_NAME_MAX) {
+           nasm_error(ERR_NONFATAL, "name size exceeds %d bytes", MODLIB_NAME_MAX);
+           return 1;
+       }
+        if (pass == 1) {
+            struct DLLRec r;
+            r.type = RDFREC_DLL;
+            r.reclen = n + 1;
+            strcpy(r.libname, value);
+            write_dll_rec(&r);
+        }
+        return 1;
+       
+    case D_MODULE:
+       if ((n = strlen(value)) >= MODLIB_NAME_MAX) {
+           nasm_error(ERR_NONFATAL, "name size exceeds %d bytes", MODLIB_NAME_MAX);
+           return 1;
+       }
+        if (pass == 1) {
+            struct ModRec r;
+            r.type = RDFREC_MODNAME;
+            r.reclen = n + 1;
+            strcpy(r.modname, value);
+            write_modname_rec(&r);
+        }
+        return 1;
+
+    default:
+       return 0;
+    }
+}
+
+static void rdf2_filename(char *inname, char *outname)
+{
+    standard_extension(inname, outname, ".rdf");
+}
+
+extern macros_t rdf2_stdmac[];
+
+static int rdf2_set_info(enum geninfo type, char **val)
+{
+    (void)type;
+    (void)val;
+    return 0;
+}
+
+struct ofmt of_rdf2 = {
+    "Relocatable Dynamic Object File Format v2.0",
+    "rdf",
+    0,
+    null_debug_arr,
+    &null_debug_form,
+    rdf2_stdmac,
+    rdf2_init,
+    rdf2_set_info,
+    rdf2_out,
+    rdf2_deflabel,
+    rdf2_section_names,
+    rdf2_segbase,
+    rdf2_directive,
+    rdf2_filename,
+    rdf2_cleanup
+};
+
+#endif                          /* OF_RDF2 */
diff --git a/output/outrdf2.mac b/output/outrdf2.mac
new file mode 100644 (file)
index 0000000..4875c50
--- /dev/null
@@ -0,0 +1,43 @@
+;; --------------------------------------------------------------------------
+;;   
+;;   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.
+;;
+;; --------------------------------------------------------------------------
+
+OUT: rdf2
+%define __SECT__ [section .text]
+%imacro library 1+.nolist
+[library %1]
+%endmacro
+%imacro module 1+.nolist
+[module %1]
+%endmacro
+%macro __NASM_CDecl__ 1
+%endmacro
diff --git a/output/stabs.h b/output/stabs.h
new file mode 100644 (file)
index 0000000..1480d88
--- /dev/null
@@ -0,0 +1,145 @@
+/* ----------------------------------------------------------------------- *
+ *
+ *   Copyright 1996-2010 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.
+ *
+ * ----------------------------------------------------------------------- */
+
+#ifndef STABS_H_
+#define STABS_H_
+
+#include <ctype.h>
+#include <inttypes.h>
+
+#include "compiler.h"
+#include "nasmlib.h"
+#include "nasm.h"
+
+/* offsets */
+enum stab_offsets {
+    STAB_strdxoff   = 0,
+    STAB_typeoff    = 4,
+    STAB_otheroff   = 5,
+    STAB_descoff    = 6,
+    STAB_valoff     = 8,
+    STAB_stabsize   = 12,
+};
+
+/* stab/non-stab types */
+enum stab_types {
+    N_UNDF      = 0x00,
+    N_ABS       = 0x02,
+    N_ABS_EXT   = 0x03,
+    N_TEXT      = 0x04,
+    N_TEXT_EXT  = 0x05,
+    N_DATA      = 0x06,
+    N_DATA_EXT  = 0x07,
+    N_BSS       = 0x08,
+    N_BSS_EXT   = 0x09,
+    N_FN_SEQ    = 0x0c,
+    N_INDR      = 0x0a,
+    N_COMM      = 0x12,
+    N_SETA      = 0x14,
+    N_SETA_EXT  = 0x15,
+    N_SETT      = 0x16,
+    N_SETT_EXT  = 0x17,
+    N_SETD      = 0x18,
+    N_SETD_EXT  = 0x19,
+    N_SETB      = 0x1a,
+    N_SETB_EXT  = 0x1b,
+    N_SETV      = 0x1c,
+    N_SETV_EXT  = 0x1d,
+    N_WARNING   = 0x1e,
+    N_FN        = 0x1f,
+    N_GSYM      = 0x20,
+    N_FNAME     = 0x22,
+    N_FUN       = 0x24,
+    N_STSYM     = 0x26,
+    N_LCSYM     = 0x28,
+    N_MAIN      = 0x2a,
+    N_ROSYM     = 0x2c,
+    N_BNSYM     = 0x2e,
+    N_PC        = 0x30,
+    N_NSYMS     = 0x32,
+    N_NOMAP     = 0x34,
+    N_OBJ       = 0x38,
+    N_OPT       = 0x3c,
+    N_RSYM      = 0x40,
+    N_M2C       = 0x42,
+    N_SLINE     = 0x44,
+    N_DSLINE    = 0x46,
+    N_BSLINE    = 0x48,
+    N_BROWS     = 0x48,
+    N_DEFD      = 0x4a,
+    N_FLINE     = 0x4c,
+    N_ENSYM     = 0x4e,
+    N_EHDECL    = 0x50,
+    N_MOD2      = 0x50,
+    N_CATCH     = 0x54,
+    N_SSYM      = 0x60,
+    N_ENDM      = 0x62,
+    N_SO        = 0x64, /* ID for main source file */
+    N_OSO       = 0x66,
+    N_ALIAS     = 0x6c,
+    N_LSYM      = 0x80,
+    N_BINCL     = 0x82,
+    N_SOL       = 0x84, /* ID for sub-source file */
+    N_PSYM      = 0xa0,
+    N_EINCL     = 0xa2,
+    N_ENTRY     = 0xa4,
+    N_LBRAC     = 0xc0,
+    N_EXCL      = 0xc2,
+    N_SCOPE     = 0xc4,
+    N_PATCH     = 0xd0,
+    N_RBRAC     = 0xe0,
+    N_BCOMM     = 0xe2,
+    N_ECOMM     = 0xe4,
+    N_ECOML     = 0xe8,
+    N_WITH      = 0xea,
+    N_NBTEXT    = 0xf0,
+    N_NBDATA    = 0xf2,
+    N_NBBSS     = 0xf4,
+    N_NBSTS     = 0xf6,
+    N_NBLCS     = 0xf8,
+    N_LENG      = 0xfe,
+};
+
+enum stab_source_file {
+    N_SO_AS         = 0x01,
+    N_SO_C          = 0x02,
+    N_SO_ANSI_C     = 0x03,
+    N_SO_CC         = 0x04,
+    N_SO_FORTRAN    = 0x05,
+    N_SO_PASCAL     = 0x06,
+    N_SO_FORTRAN90  = 0x07,
+    N_SO_OBJC       = 0x32,
+    N_SO_OBJCPLUS   = 0x33,
+};
+
+#endif /* STABS_H_ */
diff --git a/parser.c b/parser.c
new file mode 100644 (file)
index 0000000..ea36e86
--- /dev/null
+++ b/parser.c
@@ -0,0 +1,974 @@
+/* ----------------------------------------------------------------------- *
+ *
+ *   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.
+ *
+ * ----------------------------------------------------------------------- */
+
+/*
+ * parser.c   source line parser for the Netwide Assembler
+ */
+
+#include "compiler.h"
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <stddef.h>
+#include <string.h>
+#include <ctype.h>
+#include <inttypes.h>
+
+#include "nasm.h"
+#include "insns.h"
+#include "nasmlib.h"
+#include "stdscan.h"
+#include "eval.h"
+#include "parser.h"
+#include "float.h"
+#include "tables.h"
+
+extern int in_abs_seg;          /* ABSOLUTE segment flag */
+extern int32_t abs_seg;         /* ABSOLUTE segment */
+extern int32_t abs_offset;      /* ABSOLUTE segment offset */
+
+static int is_comma_next(void);
+
+static int i;
+static struct tokenval tokval;
+static struct location *location;       /* Pointer to current line's segment,offset */
+
+void parser_global_info(struct location * locp)
+{
+    location = locp;
+}
+
+static int prefix_slot(enum prefixes prefix)
+{
+    switch (prefix) {
+    case P_WAIT:
+        return PPS_WAIT;
+    case R_CS:
+    case R_DS:
+    case R_SS:
+    case R_ES:
+    case R_FS:
+    case R_GS:
+        return PPS_SEG;
+    case P_LOCK:
+    case P_REP:
+    case P_REPE:
+    case P_REPZ:
+    case P_REPNE:
+    case P_REPNZ:
+        return PPS_LREP;
+    case P_O16:
+    case P_O32:
+    case P_O64:
+    case P_OSP:
+        return PPS_OSIZE;
+    case P_A16:
+    case P_A32:
+    case P_A64:
+    case P_ASP:
+        return PPS_ASIZE;
+    default:
+        nasm_error(ERR_PANIC, "Invalid value %d passed to prefix_slot()", prefix);
+        return -1;
+    }
+}
+
+static void process_size_override(insn *result, int operand)
+{
+    if (tasm_compatible_mode) {
+        switch ((int)tokval.t_integer) {
+            /* For TASM compatibility a size override inside the
+             * brackets changes the size of the operand, not the
+             * address type of the operand as it does in standard
+             * NASM syntax. Hence:
+             *
+             *  mov     eax,[DWORD val]
+             *
+             * is valid syntax in TASM compatibility mode. Note that
+             * you lose the ability to override the default address
+             * type for the instruction, but we never use anything
+             * but 32-bit flat model addressing in our code.
+             */
+        case S_BYTE:
+            result->oprs[operand].type |= BITS8;
+            break;
+        case S_WORD:
+            result->oprs[operand].type |= BITS16;
+            break;
+        case S_DWORD:
+        case S_LONG:
+            result->oprs[operand].type |= BITS32;
+            break;
+        case S_QWORD:
+            result->oprs[operand].type |= BITS64;
+            break;
+        case S_TWORD:
+            result->oprs[operand].type |= BITS80;
+            break;
+        case S_OWORD:
+            result->oprs[operand].type |= BITS128;
+            break;
+        default:
+            nasm_error(ERR_NONFATAL,
+                       "invalid operand size specification");
+            break;
+        }
+    } else {
+        /* Standard NASM compatible syntax */
+        switch ((int)tokval.t_integer) {
+        case S_NOSPLIT:
+            result->oprs[operand].eaflags |= EAF_TIMESTWO;
+            break;
+        case S_REL:
+            result->oprs[operand].eaflags |= EAF_REL;
+            break;
+        case S_ABS:
+            result->oprs[operand].eaflags |= EAF_ABS;
+            break;
+        case S_BYTE:
+            result->oprs[operand].disp_size = 8;
+            result->oprs[operand].eaflags |= EAF_BYTEOFFS;
+            break;
+        case P_A16:
+        case P_A32:
+        case P_A64:
+            if (result->prefixes[PPS_ASIZE] &&
+                result->prefixes[PPS_ASIZE] != tokval.t_integer)
+                nasm_error(ERR_NONFATAL,
+                           "conflicting address size specifications");
+            else
+                result->prefixes[PPS_ASIZE] = tokval.t_integer;
+            break;
+        case S_WORD:
+            result->oprs[operand].disp_size = 16;
+            result->oprs[operand].eaflags |= EAF_WORDOFFS;
+            break;
+        case S_DWORD:
+        case S_LONG:
+            result->oprs[operand].disp_size = 32;
+            result->oprs[operand].eaflags |= EAF_WORDOFFS;
+            break;
+        case S_QWORD:
+            result->oprs[operand].disp_size = 64;
+            result->oprs[operand].eaflags |= EAF_WORDOFFS;
+            break;
+        default:
+            nasm_error(ERR_NONFATAL, "invalid size specification in"
+                       " effective address");
+            break;
+        }
+    }
+}
+
+insn *parse_line(int pass, char *buffer, insn *result, ldfunc ldef)
+{
+    int operand;
+    int critical;
+    struct eval_hints hints;
+    int j;
+    bool first;
+    bool insn_is_label = false;
+    bool recover;
+
+restart_parse:
+    first = true;
+    result->forw_ref = false;
+
+    stdscan_reset();
+    stdscan_set(buffer);
+    i = stdscan(NULL, &tokval);
+
+    result->label = NULL;       /* Assume no label */
+    result->eops = NULL;        /* must do this, whatever happens */
+    result->operands = 0;       /* must initialize this */
+
+    if (i == 0) {               /* blank line - ignore */
+        result->opcode = I_none;    /* and no instruction either */
+        return result;
+    }
+    if (i != TOKEN_ID && i != TOKEN_INSN && i != TOKEN_PREFIX &&
+        (i != TOKEN_REG || (REG_SREG & ~nasm_reg_flags[tokval.t_integer]))) {
+        nasm_error(ERR_NONFATAL, "label or instruction expected"
+              " at start of line");
+        result->opcode = I_none;
+        return result;
+    }
+
+    if (i == TOKEN_ID || (insn_is_label && i == TOKEN_INSN)) {
+        /* there's a label here */
+        first = false;
+        result->label = tokval.t_charptr;
+        i = stdscan(NULL, &tokval);
+        if (i == ':') {         /* skip over the optional colon */
+            i = stdscan(NULL, &tokval);
+        } else if (i == 0) {
+            nasm_error(ERR_WARNING | ERR_WARN_OL | ERR_PASS1,
+                  "label alone on a line without a colon might be in error");
+        }
+        if (i != TOKEN_INSN || tokval.t_integer != I_EQU) {
+            /*
+             * FIXME: location->segment could be NO_SEG, in which case
+             * it is possible we should be passing 'abs_seg'. Look into this.
+             * Work out whether that is *really* what we should be doing.
+             * Generally fix things. I think this is right as it is, but
+             * am still not certain.
+             */
+            ldef(result->label, in_abs_seg ? abs_seg : location->segment,
+                 location->offset, NULL, true, false);
+        }
+    }
+
+    if (i == 0) {
+        result->opcode = I_none;    /* this line contains just a label */
+        return result;
+    }
+
+    for (j = 0; j < MAXPREFIX; j++)
+        result->prefixes[j] = P_none;
+    result->times = 1L;
+
+    while (i == TOKEN_PREFIX ||
+           (i == TOKEN_REG && !(REG_SREG & ~nasm_reg_flags[tokval.t_integer])))
+    {
+        first = false;
+
+        /*
+         * Handle special case: the TIMES prefix.
+         */
+        if (i == TOKEN_PREFIX && tokval.t_integer == P_TIMES) {
+            expr *value;
+
+            i = stdscan(NULL, &tokval);
+            value =
+                evaluate(stdscan, NULL, &tokval, NULL, pass0, nasm_error, NULL);
+            i = tokval.t_type;
+            if (!value) {       /* but, error in evaluator */
+                result->opcode = I_none;    /* unrecoverable parse error: */
+                return result;  /* ignore this instruction */
+            }
+            if (!is_simple(value)) {
+                nasm_error(ERR_NONFATAL,
+                      "non-constant argument supplied to TIMES");
+                result->times = 1L;
+            } else {
+                result->times = value->value;
+                if (value->value < 0 && pass0 == 2) {
+                    nasm_error(ERR_NONFATAL, "TIMES value %"PRId64" is negative",
+                          value->value);
+                    result->times = 0;
+                }
+            }
+        } else {
+            int slot = prefix_slot(tokval.t_integer);
+            if (result->prefixes[slot]) {
+               if (result->prefixes[slot] == tokval.t_integer)
+                    nasm_error(ERR_WARNING,
+                               "instruction has redundant prefixes");
+               else
+                    nasm_error(ERR_NONFATAL,
+                               "instruction has conflicting prefixes");
+            }
+            result->prefixes[slot] = tokval.t_integer;
+            i = stdscan(NULL, &tokval);
+        }
+    }
+
+    if (i != TOKEN_INSN) {
+        int j;
+        enum prefixes pfx;
+
+        for (j = 0; j < MAXPREFIX; j++)
+            if ((pfx = result->prefixes[j]) != P_none)
+                break;
+
+        if (i == 0 && pfx != P_none) {
+            /*
+             * Instruction prefixes are present, but no actual
+             * instruction. This is allowed: at this point we
+             * invent a notional instruction of RESB 0.
+             */
+            result->opcode = I_RESB;
+            result->operands = 1;
+            result->oprs[0].type = IMMEDIATE;
+            result->oprs[0].offset = 0L;
+            result->oprs[0].segment = result->oprs[0].wrt = NO_SEG;
+            return result;
+        } else {
+            nasm_error(ERR_NONFATAL, "parser: instruction expected");
+            result->opcode = I_none;
+            return result;
+        }
+    }
+
+    result->opcode = tokval.t_integer;
+    result->condition = tokval.t_inttwo;
+
+    /*
+     * INCBIN cannot be satisfied with incorrectly
+     * evaluated operands, since the correct values _must_ be known
+     * on the first pass. Hence, even in pass one, we set the
+     * `critical' flag on calling evaluate(), so that it will bomb
+     * out on undefined symbols.
+     */
+    if (result->opcode == I_INCBIN) {
+        critical = (pass0 < 2 ? 1 : 2);
+
+    } else
+        critical = (pass == 2 ? 2 : 0);
+
+    if (result->opcode == I_DB || result->opcode == I_DW ||
+        result->opcode == I_DD || result->opcode == I_DQ ||
+        result->opcode == I_DT || result->opcode == I_DO ||
+        result->opcode == I_DY || result->opcode == I_INCBIN) {
+        extop *eop, **tail = &result->eops, **fixptr;
+        int oper_num = 0;
+        int32_t sign;
+
+        result->eops_float = false;
+
+        /*
+         * Begin to read the DB/DW/DD/DQ/DT/DO/INCBIN operands.
+         */
+        while (1) {
+            i = stdscan(NULL, &tokval);
+            if (i == 0)
+                break;
+            else if (first && i == ':') {
+                insn_is_label = true;
+                goto restart_parse;
+            }
+            first = false;
+            fixptr = tail;
+            eop = *tail = nasm_malloc(sizeof(extop));
+            tail = &eop->next;
+            eop->next = NULL;
+            eop->type = EOT_NOTHING;
+            oper_num++;
+            sign = +1;
+
+            /*
+             * is_comma_next() here is to distinguish this from
+             * a string used as part of an expression...
+             */
+            if (i == TOKEN_STR && is_comma_next()) {
+                eop->type = EOT_DB_STRING;
+                eop->stringval = tokval.t_charptr;
+                eop->stringlen = tokval.t_inttwo;
+                i = stdscan(NULL, &tokval);     /* eat the comma */
+            } else if (i == TOKEN_STRFUNC) {
+                bool parens = false;
+                const char *funcname = tokval.t_charptr;
+                enum strfunc func = tokval.t_integer;
+                i = stdscan(NULL, &tokval);
+                if (i == '(') {
+                    parens = true;
+                    i = stdscan(NULL, &tokval);
+                }
+                if (i != TOKEN_STR) {
+                    nasm_error(ERR_NONFATAL,
+                               "%s must be followed by a string constant",
+                               funcname);
+                        eop->type = EOT_NOTHING;
+                } else {
+                    eop->type = EOT_DB_STRING_FREE;
+                    eop->stringlen =
+                        string_transform(tokval.t_charptr, tokval.t_inttwo,
+                                         &eop->stringval, func);
+                    if (eop->stringlen == (size_t)-1) {
+                        nasm_error(ERR_NONFATAL, "invalid string for transform");
+                        eop->type = EOT_NOTHING;
+                    }
+                }
+                if (parens && i && i != ')') {
+                    i = stdscan(NULL, &tokval);
+                    if (i != ')') {
+                        nasm_error(ERR_NONFATAL, "unterminated %s function",
+                                   funcname);
+                    }
+                }
+                if (i && i != ',')
+                    i = stdscan(NULL, &tokval);
+            } else if (i == '-' || i == '+') {
+                char *save = stdscan_get();
+                int token = i;
+                sign = (i == '-') ? -1 : 1;
+                i = stdscan(NULL, &tokval);
+                if (i != TOKEN_FLOAT) {
+                    stdscan_set(save);
+                    i = tokval.t_type = token;
+                    goto is_expression;
+                } else {
+                    goto is_float;
+                }
+            } else if (i == TOKEN_FLOAT) {
+is_float:
+                eop->type = EOT_DB_STRING;
+                result->eops_float = true;
+
+                eop->stringlen = idata_bytes(result->opcode);
+                if (eop->stringlen > 16) {
+                    nasm_error(ERR_NONFATAL, "floating-point constant"
+                               " encountered in DY instruction");
+                    eop->stringlen = 0;
+                } else if (eop->stringlen < 1) {
+                    nasm_error(ERR_NONFATAL, "floating-point constant"
+                               " encountered in unknown instruction");
+                    /*
+                     * fix suggested by Pedro Gimeno... original line was:
+                     * eop->type = EOT_NOTHING;
+                     */
+                    eop->stringlen = 0;
+                }
+
+                eop = nasm_realloc(eop, sizeof(extop) + eop->stringlen);
+                tail = &eop->next;
+                *fixptr = eop;
+                eop->stringval = (char *)eop + sizeof(extop);
+                if (!eop->stringlen ||
+                    !float_const(tokval.t_charptr, sign,
+                                 (uint8_t *)eop->stringval,
+                                 eop->stringlen, nasm_error))
+                    eop->type = EOT_NOTHING;
+                i = stdscan(NULL, &tokval); /* eat the comma */
+            } else {
+                /* anything else, assume it is an expression */
+                expr *value;
+
+is_expression:
+                value = evaluate(stdscan, NULL, &tokval, NULL,
+                                 critical, nasm_error, NULL);
+                i = tokval.t_type;
+                if (!value) {   /* error in evaluator */
+                    result->opcode = I_none;        /* unrecoverable parse error: */
+                    return result;      /* ignore this instruction */
+                }
+                if (is_unknown(value)) {
+                    eop->type = EOT_DB_NUMBER;
+                    eop->offset = 0;    /* doesn't matter what we put */
+                    eop->segment = eop->wrt = NO_SEG;   /* likewise */
+                } else if (is_reloc(value)) {
+                    eop->type = EOT_DB_NUMBER;
+                    eop->offset = reloc_value(value);
+                    eop->segment = reloc_seg(value);
+                    eop->wrt = reloc_wrt(value);
+                } else {
+                    nasm_error(ERR_NONFATAL,
+                          "operand %d: expression is not simple"
+                          " or relocatable", oper_num);
+                }
+            }
+
+            /*
+             * We're about to call stdscan(), which will eat the
+             * comma that we're currently sitting on between
+             * arguments. However, we'd better check first that it
+             * _is_ a comma.
+             */
+            if (i == 0)         /* also could be EOL */
+                break;
+            if (i != ',') {
+                nasm_error(ERR_NONFATAL, "comma expected after operand %d",
+                      oper_num);
+                result->opcode = I_none;    /* unrecoverable parse error: */
+                return result;  /* ignore this instruction */
+            }
+        }
+
+        if (result->opcode == I_INCBIN) {
+            /*
+             * Correct syntax for INCBIN is that there should be
+             * one string operand, followed by one or two numeric
+             * operands.
+             */
+            if (!result->eops || result->eops->type != EOT_DB_STRING)
+                nasm_error(ERR_NONFATAL, "`incbin' expects a file name");
+            else if (result->eops->next &&
+                     result->eops->next->type != EOT_DB_NUMBER)
+                nasm_error(ERR_NONFATAL, "`incbin': second parameter is"
+                      " non-numeric");
+            else if (result->eops->next && result->eops->next->next &&
+                     result->eops->next->next->type != EOT_DB_NUMBER)
+                nasm_error(ERR_NONFATAL, "`incbin': third parameter is"
+                      " non-numeric");
+            else if (result->eops->next && result->eops->next->next &&
+                     result->eops->next->next->next)
+                nasm_error(ERR_NONFATAL,
+                      "`incbin': more than three parameters");
+            else
+                return result;
+            /*
+             * If we reach here, one of the above errors happened.
+             * Throw the instruction away.
+             */
+            result->opcode = I_none;
+            return result;
+        } else /* DB ... */ if (oper_num == 0)
+            nasm_error(ERR_WARNING | ERR_PASS1,
+                  "no operand for data declaration");
+        else
+            result->operands = oper_num;
+
+        return result;
+    }
+
+    /* right. Now we begin to parse the operands. There may be up to four
+     * of these, separated by commas, and terminated by a zero token. */
+
+    for (operand = 0; operand < MAX_OPERANDS; operand++) {
+        expr *value;            /* used most of the time */
+        int mref;               /* is this going to be a memory ref? */
+        int bracket;            /* is it a [] mref, or a & mref? */
+        int setsize = 0;
+
+        result->oprs[operand].disp_size = 0;    /* have to zero this whatever */
+        result->oprs[operand].eaflags = 0;      /* and this */
+        result->oprs[operand].opflags = 0;
+
+        i = stdscan(NULL, &tokval);
+        if (i == 0)
+            break;              /* end of operands: get out of here */
+        else if (first && i == ':') {
+            insn_is_label = true;
+            goto restart_parse;
+        }
+        first = false;
+        result->oprs[operand].type = 0; /* so far, no override */
+        while (i == TOKEN_SPECIAL) {    /* size specifiers */
+            switch ((int)tokval.t_integer) {
+            case S_BYTE:
+                if (!setsize)   /* we want to use only the first */
+                    result->oprs[operand].type |= BITS8;
+                setsize = 1;
+                break;
+            case S_WORD:
+                if (!setsize)
+                    result->oprs[operand].type |= BITS16;
+                setsize = 1;
+                break;
+            case S_DWORD:
+            case S_LONG:
+                if (!setsize)
+                    result->oprs[operand].type |= BITS32;
+                setsize = 1;
+                break;
+            case S_QWORD:
+                if (!setsize)
+                    result->oprs[operand].type |= BITS64;
+                setsize = 1;
+                break;
+            case S_TWORD:
+                if (!setsize)
+                    result->oprs[operand].type |= BITS80;
+                setsize = 1;
+                break;
+            case S_OWORD:
+                if (!setsize)
+                    result->oprs[operand].type |= BITS128;
+                setsize = 1;
+                break;
+            case S_YWORD:
+                if (!setsize)
+                    result->oprs[operand].type |= BITS256;
+                setsize = 1;
+                break;
+            case S_TO:
+                result->oprs[operand].type |= TO;
+                break;
+            case S_STRICT:
+                result->oprs[operand].type |= STRICT;
+                break;
+            case S_FAR:
+                result->oprs[operand].type |= FAR;
+                break;
+            case S_NEAR:
+                result->oprs[operand].type |= NEAR;
+                break;
+            case S_SHORT:
+                result->oprs[operand].type |= SHORT;
+                break;
+            default:
+                nasm_error(ERR_NONFATAL, "invalid operand size specification");
+            }
+            i = stdscan(NULL, &tokval);
+        }
+
+        if (i == '[' || i == '&') {     /* memory reference */
+            mref = true;
+            bracket = (i == '[');
+            i = stdscan(NULL, &tokval); /* then skip the colon */
+            while (i == TOKEN_SPECIAL || i == TOKEN_PREFIX) {
+                process_size_override(result, operand);
+                i = stdscan(NULL, &tokval);
+            }
+        } else {                /* immediate operand, or register */
+            mref = false;
+            bracket = false;    /* placate optimisers */
+        }
+
+        if ((result->oprs[operand].type & FAR) && !mref &&
+            result->opcode != I_JMP && result->opcode != I_CALL) {
+            nasm_error(ERR_NONFATAL, "invalid use of FAR operand specifier");
+        }
+
+        value = evaluate(stdscan, NULL, &tokval,
+                         &result->oprs[operand].opflags,
+                         critical, nasm_error, &hints);
+        i = tokval.t_type;
+        if (result->oprs[operand].opflags & OPFLAG_FORWARD) {
+            result->forw_ref = true;
+        }
+        if (!value) {           /* nasm_error in evaluator */
+            result->opcode = I_none;        /* unrecoverable parse error: */
+            return result;      /* ignore this instruction */
+        }
+        if (i == ':' && mref) { /* it was seg:offset */
+            /*
+             * Process the segment override.
+             */
+            if (value[1].type != 0 || value->value != 1 ||
+                REG_SREG & ~nasm_reg_flags[value->type])
+                nasm_error(ERR_NONFATAL, "invalid segment override");
+            else if (result->prefixes[PPS_SEG])
+                nasm_error(ERR_NONFATAL,
+                      "instruction has conflicting segment overrides");
+            else {
+                result->prefixes[PPS_SEG] = value->type;
+                if (!(REG_FSGS & ~nasm_reg_flags[value->type]))
+                    result->oprs[operand].eaflags |= EAF_FSGS;
+            }
+
+            i = stdscan(NULL, &tokval); /* then skip the colon */
+            while (i == TOKEN_SPECIAL || i == TOKEN_PREFIX) {
+                process_size_override(result, operand);
+                i = stdscan(NULL, &tokval);
+            }
+            value = evaluate(stdscan, NULL, &tokval,
+                             &result->oprs[operand].opflags,
+                             critical, nasm_error, &hints);
+            i = tokval.t_type;
+            if (result->oprs[operand].opflags & OPFLAG_FORWARD) {
+                result->forw_ref = true;
+            }
+            /* and get the offset */
+            if (!value) {       /* but, error in evaluator */
+                result->opcode = I_none;    /* unrecoverable parse error: */
+                return result;  /* ignore this instruction */
+            }
+        }
+
+        recover = false;
+        if (mref && bracket) {  /* find ] at the end */
+            if (i != ']') {
+                nasm_error(ERR_NONFATAL, "parser: expecting ]");
+                recover = true;
+            } else {            /* we got the required ] */
+                i = stdscan(NULL, &tokval);
+                if (i != 0 && i != ',') {
+                    nasm_error(ERR_NONFATAL, "comma or end of line expected");
+                    recover = true;
+                }
+            }
+        } else {                /* immediate operand */
+            if (i != 0 && i != ',' && i != ':') {
+                nasm_error(ERR_NONFATAL, "comma, colon or end of line expected");
+                recover = true;
+            } else if (i == ':') {
+                result->oprs[operand].type |= COLON;
+            }
+        }
+        if (recover) {
+            do {                /* error recovery */
+                i = stdscan(NULL, &tokval);
+            } while (i != 0 && i != ',');
+        }
+
+        /*
+         * now convert the exprs returned from evaluate()
+         * into operand descriptions...
+         */
+
+        if (mref) {             /* it's a memory reference */
+            expr *e = value;
+            int b, i, s;        /* basereg, indexreg, scale */
+            int64_t o;          /* offset */
+
+            b = i = -1, o = s = 0;
+            result->oprs[operand].hintbase = hints.base;
+            result->oprs[operand].hinttype = hints.type;
+
+            if (e->type && e->type <= EXPR_REG_END) {   /* this bit's a register */
+                if (e->value == 1)      /* in fact it can be basereg */
+                    b = e->type;
+                else            /* no, it has to be indexreg */
+                    i = e->type, s = e->value;
+                e++;
+            }
+            if (e->type && e->type <= EXPR_REG_END) {   /* it's a 2nd register */
+                if (b != -1)    /* If the first was the base, ... */
+                    i = e->type, s = e->value;  /* second has to be indexreg */
+
+                else if (e->value != 1) {       /* If both want to be index */
+                    nasm_error(ERR_NONFATAL,
+                          "beroset-p-592-invalid effective address");
+                    result->opcode = I_none;
+                    return result;
+                } else
+                    b = e->type;
+                e++;
+            }
+            if (e->type != 0) { /* is there an offset? */
+                if (e->type <= EXPR_REG_END) {  /* in fact, is there an error? */
+                    nasm_error(ERR_NONFATAL,
+                          "beroset-p-603-invalid effective address");
+                    result->opcode = I_none;
+                    return result;
+                } else {
+                    if (e->type == EXPR_UNKNOWN) {
+                        result->oprs[operand].opflags |= OPFLAG_UNKNOWN;
+                        o = 0;  /* doesn't matter what */
+                        result->oprs[operand].wrt = NO_SEG;     /* nor this */
+                        result->oprs[operand].segment = NO_SEG; /* or this */
+                        while (e->type)
+                            e++;        /* go to the end of the line */
+                    } else {
+                        if (e->type == EXPR_SIMPLE) {
+                            o = e->value;
+                            e++;
+                        }
+                        if (e->type == EXPR_WRT) {
+                            result->oprs[operand].wrt = e->value;
+                            e++;
+                        } else
+                            result->oprs[operand].wrt = NO_SEG;
+                        /*
+                         * Look for a segment base type.
+                         */
+                        if (e->type && e->type < EXPR_SEGBASE) {
+                            nasm_error(ERR_NONFATAL,
+                                  "beroset-p-630-invalid effective address");
+                            result->opcode = I_none;
+                            return result;
+                        }
+                        while (e->type && e->value == 0)
+                            e++;
+                        if (e->type && e->value != 1) {
+                            nasm_error(ERR_NONFATAL,
+                                  "beroset-p-637-invalid effective address");
+                            result->opcode = I_none;
+                            return result;
+                        }
+                        if (e->type) {
+                            result->oprs[operand].segment =
+                                e->type - EXPR_SEGBASE;
+                            e++;
+                        } else
+                            result->oprs[operand].segment = NO_SEG;
+                        while (e->type && e->value == 0)
+                            e++;
+                        if (e->type) {
+                            nasm_error(ERR_NONFATAL,
+                                  "beroset-p-650-invalid effective address");
+                            result->opcode = I_none;
+                            return result;
+                        }
+                    }
+                }
+            } else {
+                o = 0;
+                result->oprs[operand].wrt = NO_SEG;
+                result->oprs[operand].segment = NO_SEG;
+            }
+
+            if (e->type != 0) { /* there'd better be nothing left! */
+                nasm_error(ERR_NONFATAL,
+                      "beroset-p-663-invalid effective address");
+                result->opcode = I_none;
+                return result;
+            }
+
+            /* It is memory, but it can match any r/m operand */
+            result->oprs[operand].type |= MEMORY_ANY;
+
+            if (b == -1 && (i == -1 || s == 0)) {
+                int is_rel = globalbits == 64 &&
+                    !(result->oprs[operand].eaflags & EAF_ABS) &&
+                    ((globalrel &&
+                      !(result->oprs[operand].eaflags & EAF_FSGS)) ||
+                     (result->oprs[operand].eaflags & EAF_REL));
+
+                result->oprs[operand].type |= is_rel ? IP_REL : MEM_OFFS;
+            }
+            result->oprs[operand].basereg = b;
+            result->oprs[operand].indexreg = i;
+            result->oprs[operand].scale = s;
+            result->oprs[operand].offset = o;
+        } else {                /* it's not a memory reference */
+            if (is_just_unknown(value)) {       /* it's immediate but unknown */
+                result->oprs[operand].type |= IMMEDIATE;
+                result->oprs[operand].opflags |= OPFLAG_UNKNOWN;
+                result->oprs[operand].offset = 0;       /* don't care */
+                result->oprs[operand].segment = NO_SEG; /* don't care again */
+                result->oprs[operand].wrt = NO_SEG;     /* still don't care */
+
+                if(optimizing >= 0 && !(result->oprs[operand].type & STRICT))
+                {
+                    /* Be optimistic */
+                    result->oprs[operand].type |= SBYTE16 | SBYTE32 | SBYTE64;
+                }
+            } else if (is_reloc(value)) {       /* it's immediate */
+                result->oprs[operand].type |= IMMEDIATE;
+                result->oprs[operand].offset = reloc_value(value);
+                result->oprs[operand].segment = reloc_seg(value);
+                result->oprs[operand].wrt = reloc_wrt(value);
+                if (is_simple(value)) {
+                    if (reloc_value(value) == 1)
+                        result->oprs[operand].type |= UNITY;
+                    if (optimizing >= 0 &&
+                        !(result->oprs[operand].type & STRICT)) {
+                        int64_t v64 = reloc_value(value);
+                        int32_t v32 = (int32_t)v64;
+                        int16_t v16 = (int16_t)v32;
+
+                       if (v64 >= -128 && v64 <= 127)
+                            result->oprs[operand].type |= SBYTE64;
+                       if (v32 >= -128 && v32 <= 127)
+                            result->oprs[operand].type |= SBYTE32;
+                       if (v16 >= -128 && v16 <= 127)
+                            result->oprs[operand].type |= SBYTE16;
+                    }
+                }
+            } else {            /* it's a register */
+                unsigned int rs;
+
+                if (value->type >= EXPR_SIMPLE || value->value != 1) {
+                    nasm_error(ERR_NONFATAL, "invalid operand type");
+                    result->opcode = I_none;
+                    return result;
+                }
+
+                /*
+                 * check that its only 1 register, not an expression...
+                 */
+                for (i = 1; value[i].type; i++)
+                    if (value[i].value) {
+                        nasm_error(ERR_NONFATAL, "invalid operand type");
+                        result->opcode = I_none;
+                        return result;
+                    }
+
+                /* clear overrides, except TO which applies to FPU regs */
+                if (result->oprs[operand].type & ~TO) {
+                    /*
+                     * we want to produce a warning iff the specified size
+                     * is different from the register size
+                     */
+                    rs = result->oprs[operand].type & SIZE_MASK;
+                } else
+                    rs = 0;
+
+                result->oprs[operand].type &= TO;
+                result->oprs[operand].type |= REGISTER;
+                result->oprs[operand].type |= nasm_reg_flags[value->type];
+                result->oprs[operand].basereg = value->type;
+
+                if (rs && (result->oprs[operand].type & SIZE_MASK) != rs)
+                    nasm_error(ERR_WARNING | ERR_PASS1,
+                          "register size specification ignored");
+            }
+        }
+    }
+
+    result->operands = operand; /* set operand count */
+
+    /* clear remaining operands */
+    while (operand < MAX_OPERANDS)
+        result->oprs[operand++].type = 0;
+
+    /*
+     * Transform RESW, RESD, RESQ, REST, RESO, RESY into RESB.
+     */
+    switch (result->opcode) {
+    case I_RESW:
+        result->opcode = I_RESB;
+        result->oprs[0].offset *= 2;
+        break;
+    case I_RESD:
+        result->opcode = I_RESB;
+        result->oprs[0].offset *= 4;
+        break;
+    case I_RESQ:
+        result->opcode = I_RESB;
+        result->oprs[0].offset *= 8;
+        break;
+    case I_REST:
+        result->opcode = I_RESB;
+        result->oprs[0].offset *= 10;
+        break;
+    case I_RESO:
+        result->opcode = I_RESB;
+        result->oprs[0].offset *= 16;
+        break;
+    case I_RESY:
+        result->opcode = I_RESB;
+        result->oprs[0].offset *= 32;
+        break;
+    default:
+        break;
+    }
+
+    return result;
+}
+
+static int is_comma_next(void)
+{
+    char *p;
+    int i;
+    struct tokenval tv;
+
+    p = stdscan_get();
+    i = stdscan(NULL, &tv);
+    stdscan_set(p);
+    return (i == ',' || i == ';' || !i);
+}
+
+void cleanup_insn(insn * i)
+{
+    extop *e;
+
+    while ((e = i->eops)) {
+        i->eops = e->next;
+        if (e->type == EOT_DB_STRING_FREE)
+            nasm_free(e->stringval);
+        nasm_free(e);
+    }
+}
diff --git a/parser.h b/parser.h
new file mode 100644 (file)
index 0000000..9b2b6d6
--- /dev/null
+++ b/parser.h
@@ -0,0 +1,46 @@
+/* ----------------------------------------------------------------------- *
+ *   
+ *   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.
+ *
+ * ----------------------------------------------------------------------- */
+
+/* 
+ * parser.h   header file for the parser module of the Netwide
+ *            Assembler
+ */
+
+#ifndef NASM_PARSER_H
+#define NASM_PARSER_H
+
+void parser_global_info(struct location *locp);
+insn *parse_line(int pass, char *buffer, insn *result, ldfunc ldef);
+void cleanup_insn(insn *instruction);
+
+#endif
diff --git a/perllib/README b/perllib/README
new file mode 100644 (file)
index 0000000..8f067ec
--- /dev/null
@@ -0,0 +1,5 @@
+This directory contains the following Perl modules from CPAN:
+
+Graph-0.84
+
+See the .pod documentation for copyright and license terms.
diff --git a/perllib/crc64.ph b/perllib/crc64.ph
new file mode 100644 (file)
index 0000000..30a4775
--- /dev/null
@@ -0,0 +1,158 @@
+# -*- perl -*-
+#
+# Pure Perl implementation of the same CRC64 implementation used
+# elsewhere in NASM.
+#
+# Note: Perl may have 32- or 64-bit integers; we need to handle both
+# without overflowing into floating point (yuck), so handle them as
+# pairs of 32-bit numbers.  Ordering is BIGENDIAN.
+#
+
+@crc64_tab = (
+    [0x00000000, 0x00000000], [0x7ad870c8, 0x30358979],
+    [0xf5b0e190, 0x606b12f2], [0x8f689158, 0x505e9b8b],
+    [0xc038e573, 0x9841b68f], [0xbae095bb, 0xa8743ff6],
+    [0x358804e3, 0xf82aa47d], [0x4f50742b, 0xc81f2d04],
+    [0xab28ecb4, 0x6814fe75], [0xd1f09c7c, 0x5821770c],
+    [0x5e980d24, 0x087fec87], [0x24407dec, 0x384a65fe],
+    [0x6b1009c7, 0xf05548fa], [0x11c8790f, 0xc060c183],
+    [0x9ea0e857, 0x903e5a08], [0xe478989f, 0xa00bd371],
+    [0x7d08ff3b, 0x88be6f81], [0x07d08ff3, 0xb88be6f8],
+    [0x88b81eab, 0xe8d57d73], [0xf2606e63, 0xd8e0f40a],
+    [0xbd301a48, 0x10ffd90e], [0xc7e86a80, 0x20ca5077],
+    [0x4880fbd8, 0x7094cbfc], [0x32588b10, 0x40a14285],
+    [0xd620138f, 0xe0aa91f4], [0xacf86347, 0xd09f188d],
+    [0x2390f21f, 0x80c18306], [0x594882d7, 0xb0f40a7f],
+    [0x1618f6fc, 0x78eb277b], [0x6cc08634, 0x48deae02],
+    [0xe3a8176c, 0x18803589], [0x997067a4, 0x28b5bcf0],
+    [0xfa11fe77, 0x117cdf02], [0x80c98ebf, 0x2149567b],
+    [0x0fa11fe7, 0x7117cdf0], [0x75796f2f, 0x41224489],
+    [0x3a291b04, 0x893d698d], [0x40f16bcc, 0xb908e0f4],
+    [0xcf99fa94, 0xe9567b7f], [0xb5418a5c, 0xd963f206],
+    [0x513912c3, 0x79682177], [0x2be1620b, 0x495da80e],
+    [0xa489f353, 0x19033385], [0xde51839b, 0x2936bafc],
+    [0x9101f7b0, 0xe12997f8], [0xebd98778, 0xd11c1e81],
+    [0x64b11620, 0x8142850a], [0x1e6966e8, 0xb1770c73],
+    [0x8719014c, 0x99c2b083], [0xfdc17184, 0xa9f739fa],
+    [0x72a9e0dc, 0xf9a9a271], [0x08719014, 0xc99c2b08],
+    [0x4721e43f, 0x0183060c], [0x3df994f7, 0x31b68f75],
+    [0xb29105af, 0x61e814fe], [0xc8497567, 0x51dd9d87],
+    [0x2c31edf8, 0xf1d64ef6], [0x56e99d30, 0xc1e3c78f],
+    [0xd9810c68, 0x91bd5c04], [0xa3597ca0, 0xa188d57d],
+    [0xec09088b, 0x6997f879], [0x96d17843, 0x59a27100],
+    [0x19b9e91b, 0x09fcea8b], [0x636199d3, 0x39c963f2],
+    [0xdf7adabd, 0x7a6e2d6f], [0xa5a2aa75, 0x4a5ba416],
+    [0x2aca3b2d, 0x1a053f9d], [0x50124be5, 0x2a30b6e4],
+    [0x1f423fce, 0xe22f9be0], [0x659a4f06, 0xd21a1299],
+    [0xeaf2de5e, 0x82448912], [0x902aae96, 0xb271006b],
+    [0x74523609, 0x127ad31a], [0x0e8a46c1, 0x224f5a63],
+    [0x81e2d799, 0x7211c1e8], [0xfb3aa751, 0x42244891],
+    [0xb46ad37a, 0x8a3b6595], [0xceb2a3b2, 0xba0eecec],
+    [0x41da32ea, 0xea507767], [0x3b024222, 0xda65fe1e],
+    [0xa2722586, 0xf2d042ee], [0xd8aa554e, 0xc2e5cb97],
+    [0x57c2c416, 0x92bb501c], [0x2d1ab4de, 0xa28ed965],
+    [0x624ac0f5, 0x6a91f461], [0x1892b03d, 0x5aa47d18],
+    [0x97fa2165, 0x0afae693], [0xed2251ad, 0x3acf6fea],
+    [0x095ac932, 0x9ac4bc9b], [0x7382b9fa, 0xaaf135e2],
+    [0xfcea28a2, 0xfaafae69], [0x8632586a, 0xca9a2710],
+    [0xc9622c41, 0x02850a14], [0xb3ba5c89, 0x32b0836d],
+    [0x3cd2cdd1, 0x62ee18e6], [0x460abd19, 0x52db919f],
+    [0x256b24ca, 0x6b12f26d], [0x5fb35402, 0x5b277b14],
+    [0xd0dbc55a, 0x0b79e09f], [0xaa03b592, 0x3b4c69e6],
+    [0xe553c1b9, 0xf35344e2], [0x9f8bb171, 0xc366cd9b],
+    [0x10e32029, 0x93385610], [0x6a3b50e1, 0xa30ddf69],
+    [0x8e43c87e, 0x03060c18], [0xf49bb8b6, 0x33338561],
+    [0x7bf329ee, 0x636d1eea], [0x012b5926, 0x53589793],
+    [0x4e7b2d0d, 0x9b47ba97], [0x34a35dc5, 0xab7233ee],
+    [0xbbcbcc9d, 0xfb2ca865], [0xc113bc55, 0xcb19211c],
+    [0x5863dbf1, 0xe3ac9dec], [0x22bbab39, 0xd3991495],
+    [0xadd33a61, 0x83c78f1e], [0xd70b4aa9, 0xb3f20667],
+    [0x985b3e82, 0x7bed2b63], [0xe2834e4a, 0x4bd8a21a],
+    [0x6debdf12, 0x1b863991], [0x1733afda, 0x2bb3b0e8],
+    [0xf34b3745, 0x8bb86399], [0x8993478d, 0xbb8deae0],
+    [0x06fbd6d5, 0xebd3716b], [0x7c23a61d, 0xdbe6f812],
+    [0x3373d236, 0x13f9d516], [0x49aba2fe, 0x23cc5c6f],
+    [0xc6c333a6, 0x7392c7e4], [0xbc1b436e, 0x43a74e9d],
+    [0x95ac9329, 0xac4bc9b5], [0xef74e3e1, 0x9c7e40cc],
+    [0x601c72b9, 0xcc20db47], [0x1ac40271, 0xfc15523e],
+    [0x5594765a, 0x340a7f3a], [0x2f4c0692, 0x043ff643],
+    [0xa02497ca, 0x54616dc8], [0xdafce702, 0x6454e4b1],
+    [0x3e847f9d, 0xc45f37c0], [0x445c0f55, 0xf46abeb9],
+    [0xcb349e0d, 0xa4342532], [0xb1eceec5, 0x9401ac4b],
+    [0xfebc9aee, 0x5c1e814f], [0x8464ea26, 0x6c2b0836],
+    [0x0b0c7b7e, 0x3c7593bd], [0x71d40bb6, 0x0c401ac4],
+    [0xe8a46c12, 0x24f5a634], [0x927c1cda, 0x14c02f4d],
+    [0x1d148d82, 0x449eb4c6], [0x67ccfd4a, 0x74ab3dbf],
+    [0x289c8961, 0xbcb410bb], [0x5244f9a9, 0x8c8199c2],
+    [0xdd2c68f1, 0xdcdf0249], [0xa7f41839, 0xecea8b30],
+    [0x438c80a6, 0x4ce15841], [0x3954f06e, 0x7cd4d138],
+    [0xb63c6136, 0x2c8a4ab3], [0xcce411fe, 0x1cbfc3ca],
+    [0x83b465d5, 0xd4a0eece], [0xf96c151d, 0xe49567b7],
+    [0x76048445, 0xb4cbfc3c], [0x0cdcf48d, 0x84fe7545],
+    [0x6fbd6d5e, 0xbd3716b7], [0x15651d96, 0x8d029fce],
+    [0x9a0d8cce, 0xdd5c0445], [0xe0d5fc06, 0xed698d3c],
+    [0xaf85882d, 0x2576a038], [0xd55df8e5, 0x15432941],
+    [0x5a3569bd, 0x451db2ca], [0x20ed1975, 0x75283bb3],
+    [0xc49581ea, 0xd523e8c2], [0xbe4df122, 0xe51661bb],
+    [0x3125607a, 0xb548fa30], [0x4bfd10b2, 0x857d7349],
+    [0x04ad6499, 0x4d625e4d], [0x7e751451, 0x7d57d734],
+    [0xf11d8509, 0x2d094cbf], [0x8bc5f5c1, 0x1d3cc5c6],
+    [0x12b59265, 0x35897936], [0x686de2ad, 0x05bcf04f],
+    [0xe70573f5, 0x55e26bc4], [0x9ddd033d, 0x65d7e2bd],
+    [0xd28d7716, 0xadc8cfb9], [0xa85507de, 0x9dfd46c0],
+    [0x273d9686, 0xcda3dd4b], [0x5de5e64e, 0xfd965432],
+    [0xb99d7ed1, 0x5d9d8743], [0xc3450e19, 0x6da80e3a],
+    [0x4c2d9f41, 0x3df695b1], [0x36f5ef89, 0x0dc31cc8],
+    [0x79a59ba2, 0xc5dc31cc], [0x037deb6a, 0xf5e9b8b5],
+    [0x8c157a32, 0xa5b7233e], [0xf6cd0afa, 0x9582aa47],
+    [0x4ad64994, 0xd625e4da], [0x300e395c, 0xe6106da3],
+    [0xbf66a804, 0xb64ef628], [0xc5bed8cc, 0x867b7f51],
+    [0x8aeeace7, 0x4e645255], [0xf036dc2f, 0x7e51db2c],
+    [0x7f5e4d77, 0x2e0f40a7], [0x05863dbf, 0x1e3ac9de],
+    [0xe1fea520, 0xbe311aaf], [0x9b26d5e8, 0x8e0493d6],
+    [0x144e44b0, 0xde5a085d], [0x6e963478, 0xee6f8124],
+    [0x21c64053, 0x2670ac20], [0x5b1e309b, 0x16452559],
+    [0xd476a1c3, 0x461bbed2], [0xaeaed10b, 0x762e37ab],
+    [0x37deb6af, 0x5e9b8b5b], [0x4d06c667, 0x6eae0222],
+    [0xc26e573f, 0x3ef099a9], [0xb8b627f7, 0x0ec510d0],
+    [0xf7e653dc, 0xc6da3dd4], [0x8d3e2314, 0xf6efb4ad],
+    [0x0256b24c, 0xa6b12f26], [0x788ec284, 0x9684a65f],
+    [0x9cf65a1b, 0x368f752e], [0xe62e2ad3, 0x06bafc57],
+    [0x6946bb8b, 0x56e467dc], [0x139ecb43, 0x66d1eea5],
+    [0x5ccebf68, 0xaecec3a1], [0x2616cfa0, 0x9efb4ad8],
+    [0xa97e5ef8, 0xcea5d153], [0xd3a62e30, 0xfe90582a],
+    [0xb0c7b7e3, 0xc7593bd8], [0xca1fc72b, 0xf76cb2a1],
+    [0x45775673, 0xa732292a], [0x3faf26bb, 0x9707a053],
+    [0x70ff5290, 0x5f188d57], [0x0a272258, 0x6f2d042e],
+    [0x854fb300, 0x3f739fa5], [0xff97c3c8, 0x0f4616dc],
+    [0x1bef5b57, 0xaf4dc5ad], [0x61372b9f, 0x9f784cd4],
+    [0xee5fbac7, 0xcf26d75f], [0x9487ca0f, 0xff135e26],
+    [0xdbd7be24, 0x370c7322], [0xa10fceec, 0x0739fa5b],
+    [0x2e675fb4, 0x576761d0], [0x54bf2f7c, 0x6752e8a9],
+    [0xcdcf48d8, 0x4fe75459], [0xb7173810, 0x7fd2dd20],
+    [0x387fa948, 0x2f8c46ab], [0x42a7d980, 0x1fb9cfd2],
+    [0x0df7adab, 0xd7a6e2d6], [0x772fdd63, 0xe7936baf],
+    [0xf8474c3b, 0xb7cdf024], [0x829f3cf3, 0x87f8795d],
+    [0x66e7a46c, 0x27f3aa2c], [0x1c3fd4a4, 0x17c62355],
+    [0x935745fc, 0x4798b8de], [0xe98f3534, 0x77ad31a7],
+    [0xa6df411f, 0xbfb21ca3], [0xdc0731d7, 0x8f8795da],
+    [0x536fa08f, 0xdfd90e51], [0x29b7d047, 0xefec8728]
+    );
+
+sub crc64($$) {
+    my ($cv, $str) = @_;
+    my $c;
+    my @cc = @$cv;
+    $cc[0] %= 4294967296;
+    $cc[1] %= 4294967296;
+
+    foreach $c (unpack("C*", $str)) {
+       my @ct = @{$crc64_tab[($cc[1] & 0xff) ^ $c]};
+
+       $cc[1] = $ct[1] ^
+           ((($cc[1] & 0xffffff00) >> 8) | (($cc[0] & 0xff) << 24));
+       $cc[0] = $ct[0] ^ (($cc[0] & 0xffffff00) >> 8);
+    }
+
+    return @cc;
+}
diff --git a/perllib/gensv.pl b/perllib/gensv.pl
new file mode 100755 (executable)
index 0000000..b80ccbe
--- /dev/null
@@ -0,0 +1,34 @@
+#!/usr/bin/perl
+#
+# Generate a list of rotation vectors so we always use the same set.
+# This needs to be run on a platform with /dev/urandom.
+#
+
+($n) = @ARGV;
+
+sysopen(UR, '/dev/urandom', O_RDONLY) or die;
+
+$maxlen = 78;
+
+print "\@random_sv_vectors = (\n";
+$outl = '   ';
+
+for ($i = 0; $i < $n; $i++) {
+
+    die if (sysread(UR, $x8, 8) != 8);
+    @n = unpack("V*", $x8);
+
+    $xl = sprintf(" [0x%08x, 0x%08x]%s",
+                 $n[0], $n[1],
+                 ($i == $n-1) ? '' : ',');
+    if (length($outl.$xl) > $maxlen) {
+       print $outl, "\n";
+       $outl = '   ';
+    }
+    $outl .= $xl;
+}
+close(UR);
+
+print $outl, "\n";
+print ");\n";
+print "1;\n";
diff --git a/perllib/phash.ph b/perllib/phash.ph
new file mode 100644 (file)
index 0000000..8feb6b7
--- /dev/null
@@ -0,0 +1,228 @@
+# -*- perl -*-
+#
+# Perfect Minimal Hash Generator written in Perl, which produces
+# C output.
+#
+# Requires the CPAN Graph module (tested against 0.81, 0.83, 0.84)
+#
+
+require 'random_sv_vectors.ph';
+require 'crc64.ph';
+
+#
+# Compute the prehash for a key
+#
+# prehash(key, sv, N)
+#
+sub prehash($$$) {
+    my($key, $n, $sv) = @_;
+    my @c = crc64($sv, $key);
+
+    # Create a bipartite graph...
+    $k1 = (($c[1] & ($n-1)) << 1) + 0; # low word
+    $k2 = (($c[0] & ($n-1)) << 1) + 1; # high word
+
+    return ($k1, $k2);
+}
+
+#
+# Walk the assignment graph, return true on success
+#
+sub walk_graph($$$$) {
+    my($nodeval,$nodeneigh,$n,$v) = @_;
+    my $nx;
+
+    # print STDERR "Vertex $n value $v\n";
+    $$nodeval[$n] = $v;
+
+    foreach $nx (@{$$nodeneigh[$n]}) {
+       # $nx -> [neigh, hash]
+       my ($o, $e) = @$nx;
+
+       # print STDERR "Edge $n,$o value $e: ";
+       my $ov;
+       if (defined($ov = $$nodeval[$o])) {
+           if ($v+$ov != $e) {
+               # Cyclic graph with collision
+               # print STDERR "error, should be ", $v+$ov, "\n";
+               return 0;
+           } else {
+               # print STDERR "ok\n";
+           }
+       } else {
+           return 0 unless (walk_graph($nodeval, $nodeneigh, $o, $e-$v));
+       }
+    }
+    return 1;
+}
+
+#
+# Generate the function assuming a given N.
+#
+# gen_hash_n(N, sv, \%data, run)
+#
+sub gen_hash_n($$$$) {
+    my($n, $sv, $href, $run) = @_;
+    my @keys = keys(%{$href});
+    my $i, $sv;
+    my $gr;
+    my $k, $v;
+    my $gsize = 2*$n;
+    my @nodeval;
+    my @nodeneigh;
+    my %edges;
+
+    for ($i = 0; $i < $gsize; $i++) {
+       $nodeneigh[$i] = [];
+    }
+
+    %edges = ();
+    foreach $k (@keys) {
+       my ($pf1, $pf2) = prehash($k, $n, $sv);
+       ($pf1,$pf2) = ($pf2,$pf1) if ($pf1 > $pf2); # Canonicalize order
+
+       my $pf = "$pf1,$pf2";
+       my $e = ${$href}{$k};
+       my $xkey;
+
+       if (defined($xkey = $edges{$pf})) {
+           next if ($e == ${$href}{$xkey}); # Duplicate hash, safe to ignore
+           if (defined($run)) {
+               print STDERR "$run: Collision: $pf: $k with $xkey\n";
+           }
+           return;
+       }
+
+       # print STDERR "Edge $pf value $e from $k\n";
+
+       $edges{$pf} = $k;
+       push(@{$nodeneigh[$pf1]}, [$pf2, $e]);
+       push(@{$nodeneigh[$pf2]}, [$pf1, $e]);
+    }
+
+    # Now we need to assign values to each vertex, so that for each
+    # edge, the sum of the values for the two vertices give the value
+    # for the edge (which is our hash index.)  If we find an impossible
+    # sitation, the graph was cyclic.
+    @nodeval = (undef) x $gsize;
+
+    for ($i = 0; $i < $gsize; $i++) {
+       if (scalar(@{$nodeneigh[$i]})) {
+           # This vertex has neighbors (is used)
+           if (!defined($nodeval[$i])) {
+               # First vertex in a cluster
+               unless (walk_graph(\@nodeval, \@nodeneigh, $i, 0)) {
+                   if (defined($run)) {
+                       print STDERR "$run: Graph is cyclic\n";
+                   }
+                   return;
+               }
+           }
+       }
+    }
+
+    # for ($i = 0; $i < $n; $i++) {
+    #  print STDERR "Vertex ", $i, ": ", $g[$i], "\n";
+    # }
+
+    if (defined($run)) {
+       printf STDERR "$run: Done: n = $n, sv = [0x%08x, 0x%08x]\n",
+       $$sv[0], $$sv[1];
+    }
+
+    return ($n, $sv, \@nodeval);
+}
+
+#
+# Driver for generating the function
+#
+# gen_perfect_hash(\%data)
+#
+sub gen_perfect_hash($) {
+    my($href) = @_;
+    my @keys = keys(%{$href});
+    my @hashinfo;
+    my $n, $i, $j, $sv, $maxj;
+    my $run = 1;
+
+    # Minimal power of 2 value for N with enough wiggle room.
+    # The scaling constant must be larger than 0.5 in order for the
+    # algorithm to ever terminate.
+    my $room = scalar(@keys)*0.8;
+    $n = 1;
+    while ($n < $room) {
+       $n <<= 1;
+    }
+
+    # Number of times to try...
+    $maxj = scalar @random_sv_vectors;
+
+    for ($i = 0; $i < 4; $i++) {
+       printf STDERR "%d vectors, trying n = %d...\n",
+               scalar @keys, $n;
+       for ($j = 0; $j < $maxj; $j++) {
+           $sv = $random_sv_vectors[$j];
+           @hashinfo = gen_hash_n($n, $sv, $href, $run++);
+           return @hashinfo if (defined(@hashinfo));
+       }
+       $n <<= 1;
+    }
+
+    return;
+}
+
+#
+# Read input file
+#
+sub read_input() {
+    my $key,$val;
+    my %out;
+    my $x = 0;
+
+    while (defined($l = <STDIN>)) {
+       chomp $l;
+       $l =~ s/\s*(\#.*|)$//;
+
+       next if ($l eq '');
+
+       if ($l =~ /^([^=]+)\=([^=]+)$/) {
+           $out{$1} = $2;
+           $x = $2;
+       } else {
+           $out{$l} = $x;
+       }
+       $x++;
+    }
+
+    return %out;
+}
+
+#
+# Verify that the hash table is actually correct...
+#
+sub verify_hash_table($$)
+{
+    my ($href, $hashinfo) = @_;
+    my ($n, $sv, $g) = @{$hashinfo};
+    my $k;
+    my $err = 0;
+
+    foreach $k (keys(%$href)) {
+       my ($pf1, $pf2) = prehash($k, $n, $sv);
+       my $g1 = ${$g}[$pf1];
+       my $g2 = ${$g}[$pf2];
+
+       if ($g1+$g2 != ${$href}{$k}) {
+           printf STDERR "%s(%d,%d): %d+%d = %d != %d\n",
+           $k, $pf1, $pf2, $g1, $g2, $g1+$g2, ${$href}{$k};
+           $err = 1;
+       } else {
+           # printf STDERR "%s: %d+%d = %d ok\n",
+           # $k, $g1, $g2, $g1+$g2;
+       }
+    }
+
+    die "$0: hash validation error\n" if ($err);
+}
+
+1;
diff --git a/perllib/random_sv_vectors.ph b/perllib/random_sv_vectors.ph
new file mode 100644 (file)
index 0000000..db2dc6e
--- /dev/null
@@ -0,0 +1,67 @@
+@random_sv_vectors = (
+    [0x076259c3, 0xe291c26c], [0xaee7ac5c, 0xcabdec91],
+    [0x5d3862fb, 0x2e8a3060], [0x6fb3635c, 0x4783593a],
+    [0x13f0eafb, 0x407e486a], [0x7436afdd, 0xd04c4829],
+    [0xace2d0e4, 0x80575791], [0x2dd9a392, 0xdc1e869e],
+    [0x199c3e38, 0x026a9d67], [0x9f911c85, 0x3a489c87],
+    [0x9ac31028, 0x0b6e14b2], [0x2ccfbcf9, 0x3f9f2308],
+    [0x2e0210fb, 0x392f380f], [0x14ab403a, 0x81a11065],
+    [0xd496f63c, 0x53196b13], [0x48a34d7f, 0x2ffc6036],
+    [0x34ea8e9d, 0xcd1ed098], [0x2da1a3f2, 0x3d6c23f2],
+    [0xca7374da, 0x06054f89], [0xc909a0bb, 0x31d6c0d2],
+    [0x87454496, 0x15b360d7], [0x9eebbd12, 0x89532131],
+    [0x1119c65b, 0xd9e49705], [0x60c3be0b, 0xd6cc7c8a],
+    [0x117723cd, 0x40af090f], [0xfc284f51, 0x3dcf4c06],
+    [0xb41fcda4, 0xec03644c], [0xd99e1ea7, 0x84eaf76d],
+    [0x534b956a, 0x06d3fb8d], [0x2da4bb09, 0x078092eb],
+    [0x6a5be463, 0xbfa51a88], [0xc4e8be95, 0xe7eec27c],
+    [0x15a1fbb9, 0xfadc08cd], [0x0bcfab08, 0xbccade0f],
+    [0x629f1f6c, 0x90ccede7], [0x5c2b26aa, 0x1f0b1fce],
+    [0xdfe0e3fd, 0xbd7c3cfb], [0xa1628ca9, 0x90a05686],
+    [0xbf0267f2, 0xd2964139], [0x8009a9b9, 0xd2195918],
+    [0xfcc7b5f8, 0xc108c643], [0xf447d4b0, 0x71953863],
+    [0x95d091ed, 0xdbe01948], [0x81dec325, 0x2bfecda2],
+    [0x2ed2acaa, 0x7eeaa0d0], [0xb7b0a20e, 0x8bf5c01b],
+    [0x75eb3917, 0xfd2f758f], [0xb33a5b49, 0x8a8cedf6],
+    [0x3aaf2757, 0x69b319a9], [0x32cfa41b, 0xeba36f19],
+    [0xf54209dd, 0x941f3a08], [0x232703bb, 0x786a6f84],
+    [0x4937b242, 0xc9f07398], [0x74dc5d39, 0x550a58e8],
+    [0x6c9aebdc, 0x8fda5069], [0x5ae6d62a, 0x05cd24a3],
+    [0x8111e50a, 0xc1c6d19b], [0xb980a92b, 0x448b4d1f],
+    [0x568cf58a, 0x8bcb93ca], [0xfe96002f, 0x410cd2f1],
+    [0xaf511e45, 0x99e4872f], [0x822c20bc, 0x3db49ddd],
+    [0x184fec4e, 0xbb82ec52], [0x30ca5326, 0xf3180297],
+    [0x97962aa4, 0x7d4bc6d4], [0x9199a315, 0x8e9f18c6],
+    [0xead69a7e, 0x3262a683], [0xe261ec00, 0x81edc47a],
+    [0x06080c0e, 0x6d18fa9f], [0x1771ec43, 0x6747ed66],
+    [0xe71fe587, 0xe81ad0f3], [0xf083e80c, 0x0898bcd8],
+    [0x30328c5a, 0x2efb4ee7], [0xd04fa5d7, 0xec9c9f18],
+    [0x87820480, 0x48932224], [0xb1f18815, 0x1b27e3e3],
+    [0x79aa440c, 0xdf17a8fc], [0x8a83d404, 0x10fdec8c],
+    [0x7d4dfe60, 0x573561ee], [0x60315c7d, 0xa0692af6],
+    [0xb3ca4d52, 0x89ca832f], [0x9ebc5c79, 0xa84a28fc],
+    [0xdfa76008, 0x7772cf7c], [0xb0e3a15f, 0xbdc35aee],
+    [0x6e252b03, 0x32b2107d], [0x20dcc2a3, 0x21987229],
+    [0x848e3ad8, 0xe692a0c6], [0xdd07fa50, 0x0b64e1ae],
+    [0xc4072bc2, 0x2f120bba], [0xdb3af26e, 0xacab0c48],
+    [0xd7d4b59a, 0xcf72a7a7], [0x4628de45, 0x4dfb2750],
+    [0x7519211f, 0x4798b536], [0x19984af3, 0xffd2aa19],
+    [0x1372d9c0, 0x7512153a], [0x295d19da, 0x497416e5],
+    [0x70932c73, 0x8a9bf591], [0xa0960860, 0xfaa7dc61],
+    [0xd425f548, 0x43aeda4d], [0xaa2573c7, 0x01a2553d],
+    [0x988e71d7, 0xd3c004a4], [0x3da87545, 0x2197af10],
+    [0x2f89e592, 0xa686e2fc], [0x7b88018a, 0xae66d575],
+    [0x93215591, 0xed69e6ea], [0x4fcacc4a, 0x4d2aba97],
+    [0xbedb923b, 0x500b2f1a], [0x0b6d8aa0, 0x232511b0],
+    [0x282fb3ee, 0x23695de0], [0x0c455dfe, 0x820cca3f],
+    [0xe893868c, 0x87f698f6], [0xb6428730, 0x56e576ce],
+    [0xf3843ee7, 0xba79bc28], [0xa1c9ca45, 0x30c479c1],
+    [0xbfc244c2, 0xa9af65f0], [0x6eeb88eb, 0x62b4479c],
+    [0xcc328fe5, 0x60f5c9bf], [0x31aa2c21, 0xc55575fb],
+    [0x9429492d, 0x8e80612a], [0xb12fe59e, 0xf0e1e97b],
+    [0xc2501dad, 0x4a9f4bbf], [0x65ae8366, 0x3e8b0983],
+    [0xd5fc062a, 0xba74f808], [0x7398cc0a, 0x39a6a269],
+    [0x5581dd60, 0xff79d28c], [0xea5e52b3, 0x9be66c71],
+    [0x8f6e02a4, 0xe27318b5], [0xe8bceb99, 0xa48a7f2c],
+);
+1;
diff --git a/phash.pl b/phash.pl
new file mode 100755 (executable)
index 0000000..e1071b2
--- /dev/null
+++ b/phash.pl
@@ -0,0 +1,83 @@
+#!/usr/bin/perl
+## --------------------------------------------------------------------------
+##   
+##   Copyright 1996-2009 the NASM Authors - All rights reserved.
+##
+##   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.
+##
+## --------------------------------------------------------------------------
+
+#
+# Perfect Minimal Hash Generator written in Perl, which produces
+# C output.
+#
+
+require 'phash.ph';
+
+#
+# Main program
+#
+sub main() {
+    my $n;
+    my %data;
+    my @hashinfo;
+    my $x, $i;
+
+    %data = read_input();
+    @hashinfo = gen_perfect_hash(\%data);
+
+    if (!defined(@hashinfo)) {
+       die "$0: no hash found\n";
+    }
+
+    verify_hash_table(\%data, \@hashinfo);
+
+    ($n, $sv, $f1, $f2, $g) = @hashinfo;
+
+    print "static int HASHNAME_fg1[$n] =\n";
+    print "{\n";
+    for ($i = 0; $i < $n; $i++) {
+       print "\t", ${$g}[${$f1}[$i]], "\n";
+    }
+    print "};\n\n";
+
+    print "static int HASHNAME_fg2[$n] =\n";
+    print "{\n";
+    for ($i = 0; $i < $n; $i++) {
+       print "\t", ${$g}[${$f2}[$i]], "\n";
+    }
+    print "};\n\n";
+
+    print "struct p_hash HASHNAME =\n";
+    print "{\n";
+    print "\t$n\n";
+    print "\t$sv\n";
+    print "\tHASHNAME_fg1,\n";
+    print "\tHASHNAME_fg2,\n";
+    print "};\n";
+}
+
+main();
diff --git a/pptok.c b/pptok.c
new file mode 100644 (file)
index 0000000..f94dcc2
--- /dev/null
+++ b/pptok.c
@@ -0,0 +1,510 @@
+/* Automatically generated from ./pptok.dat by ./pptok.pl */
+/* Do not edit */
+
+#include "compiler.h"
+#include <inttypes.h>
+#include <ctype.h>
+#include "nasmlib.h"
+#include "hashtbl.h"
+#include "preproc.h"
+
+const char * const pp_directives[108] = {
+    "%elif",
+    "%elifn",
+    "%elifctx",
+    "%elifnctx",
+    "%elifdef",
+    "%elifndef",
+    "%elifempty",
+    "%elifnempty",
+    "%elifid",
+    "%elifnid",
+    "%elifidn",
+    "%elifnidn",
+    "%elifidni",
+    "%elifnidni",
+    "%elifmacro",
+    "%elifnmacro",
+    "%elifnum",
+    "%elifnnum",
+    "%elifstr",
+    "%elifnstr",
+    "%eliftoken",
+    "%elifntoken",
+    NULL,
+    NULL,
+    NULL,
+    NULL,
+    NULL,
+    NULL,
+    NULL,
+    NULL,
+    NULL,
+    NULL,
+    "%if",
+    "%ifn",
+    "%ifctx",
+    "%ifnctx",
+    "%ifdef",
+    "%ifndef",
+    "%ifempty",
+    "%ifnempty",
+    "%ifid",
+    "%ifnid",
+    "%ifidn",
+    "%ifnidn",
+    "%ifidni",
+    "%ifnidni",
+    "%ifmacro",
+    "%ifnmacro",
+    "%ifnum",
+    "%ifnnum",
+    "%ifstr",
+    "%ifnstr",
+    "%iftoken",
+    "%ifntoken",
+    NULL,
+    NULL,
+    NULL,
+    NULL,
+    NULL,
+    NULL,
+    NULL,
+    NULL,
+    NULL,
+    NULL,
+    "%arg",
+    "%assign",
+    "%clear",
+    "%define",
+    "%defstr",
+    "%deftok",
+    "%depend",
+    "%else",
+    "%endif",
+    "%endm",
+    "%endmacro",
+    "%endrep",
+    "%error",
+    "%exitmacro",
+    "%exitrep",
+    "%fatal",
+    "%iassign",
+    "%idefine",
+    "%idefstr",
+    "%ideftok",
+    "%imacro",
+    "%include",
+    "%irmacro",
+    "%ixdefine",
+    "%line",
+    "%local",
+    "%macro",
+    "%pathsearch",
+    "%pop",
+    "%push",
+    "%rep",
+    "%repl",
+    "%rmacro",
+    "%rotate",
+    "%stacksize",
+    "%strcat",
+    "%strlen",
+    "%substr",
+    "%undef",
+    "%unimacro",
+    "%unmacro",
+    "%use",
+    "%warning",
+    "%xdefine",
+};
+const uint8_t pp_directives_len[108] = {
+    5,
+    6,
+    8,
+    9,
+    8,
+    9,
+    10,
+    11,
+    7,
+    8,
+    8,
+    9,
+    9,
+    10,
+    10,
+    11,
+    8,
+    9,
+    8,
+    9,
+    10,
+    11,
+    0,
+    0,
+    0,
+    0,
+    0,
+    0,
+    0,
+    0,
+    0,
+    0,
+    3,
+    4,
+    6,
+    7,
+    6,
+    7,
+    8,
+    9,
+    5,
+    6,
+    6,
+    7,
+    7,
+    8,
+    8,
+    9,
+    6,
+    7,
+    6,
+    7,
+    8,
+    9,
+    0,
+    0,
+    0,
+    0,
+    0,
+    0,
+    0,
+    0,
+    0,
+    0,
+    4,
+    7,
+    6,
+    7,
+    7,
+    7,
+    7,
+    5,
+    6,
+    5,
+    9,
+    7,
+    6,
+    10,
+    8,
+    6,
+    8,
+    8,
+    8,
+    8,
+    7,
+    8,
+    8,
+    9,
+    5,
+    6,
+    6,
+    11,
+    4,
+    5,
+    4,
+    5,
+    7,
+    7,
+    10,
+    7,
+    7,
+    7,
+    6,
+    9,
+    8,
+    4,
+    8,
+    8,
+};
+enum preproc_token pp_token_hash(const char *token)
+{
+#define UNUSED 16383
+    static const int16_t hash1[128] = {
+        UNUSED,
+        UNUSED,
+        0,
+        0,
+        0,
+        0,
+        UNUSED,
+        UNUSED,
+        UNUSED,
+        UNUSED,
+        UNUSED,
+        UNUSED,
+        UNUSED,
+        UNUSED,
+        0,
+        UNUSED,
+        UNUSED,
+        0,
+        0,
+        UNUSED,
+        0,
+        UNUSED,
+        UNUSED,
+        UNUSED,
+        0,
+        -49,
+        UNUSED,
+        0,
+        UNUSED,
+        -60,
+        0,
+        UNUSED,
+        UNUSED,
+        -44,
+        UNUSED,
+        UNUSED,
+        -49,
+        UNUSED,
+        UNUSED,
+        0,
+        UNUSED,
+        UNUSED,
+        0,
+        UNUSED,
+        UNUSED,
+        UNUSED,
+        46,
+        UNUSED,
+        UNUSED,
+        47,
+        5,
+        UNUSED,
+        -54,
+        65,
+        UNUSED,
+        UNUSED,
+        0,
+        UNUSED,
+        UNUSED,
+        38,
+        UNUSED,
+        30,
+        0,
+        UNUSED,
+        6,
+        35,
+        UNUSED,
+        UNUSED,
+        60,
+        34,
+        UNUSED,
+        134,
+        UNUSED,
+        -88,
+        -11,
+        41,
+        15,
+        0,
+        129,
+        -86,
+        UNUSED,
+        UNUSED,
+        82,
+        0,
+        UNUSED,
+        14,
+        97,
+        -65,
+        -104,
+        0,
+        -12,
+        -76,
+        UNUSED,
+        UNUSED,
+        UNUSED,
+        1,
+        UNUSED,
+        0,
+        10,
+        UNUSED,
+        -145,
+        UNUSED,
+        105,
+        UNUSED,
+        82,
+        UNUSED,
+        41,
+        85,
+        UNUSED,
+        22,
+        0,
+        UNUSED,
+        UNUSED,
+        UNUSED,
+        77,
+        UNUSED,
+        UNUSED,
+        UNUSED,
+        9,
+        91,
+        -6,
+        UNUSED,
+        UNUSED,
+        UNUSED,
+        UNUSED,
+        106,
+        42,
+        UNUSED,
+    };
+    static const int16_t hash2[128] = {
+        UNUSED,
+        0,
+        UNUSED,
+        0,
+        UNUSED,
+        UNUSED,
+        0,
+        UNUSED,
+        UNUSED,
+        0,
+        UNUSED,
+        UNUSED,
+        UNUSED,
+        UNUSED,
+        UNUSED,
+        UNUSED,
+        UNUSED,
+        0,
+        82,
+        0,
+        64,
+        UNUSED,
+        0,
+        UNUSED,
+        0,
+        0,
+        UNUSED,
+        UNUSED,
+        UNUSED,
+        66,
+        UNUSED,
+        UNUSED,
+        UNUSED,
+        UNUSED,
+        UNUSED,
+        0,
+        123,
+        0,
+        UNUSED,
+        19,
+        99,
+        63,
+        UNUSED,
+        116,
+        UNUSED,
+        182,
+        UNUSED,
+        UNUSED,
+        UNUSED,
+        0,
+        UNUSED,
+        -39,
+        UNUSED,
+        88,
+        UNUSED,
+        UNUSED,
+        UNUSED,
+        UNUSED,
+        87,
+        UNUSED,
+        40,
+        UNUSED,
+        UNUSED,
+        141,
+        UNUSED,
+        UNUSED,
+        UNUSED,
+        102,
+        UNUSED,
+        44,
+        105,
+        149,
+        UNUSED,
+        21,
+        51,
+        0,
+        UNUSED,
+        UNUSED,
+        UNUSED,
+        0,
+        UNUSED,
+        UNUSED,
+        UNUSED,
+        33,
+        0,
+        0,
+        92,
+        UNUSED,
+        48,
+        72,
+        UNUSED,
+        7,
+        42,
+        65,
+        UNUSED,
+        UNUSED,
+        114,
+        50,
+        UNUSED,
+        UNUSED,
+        UNUSED,
+        UNUSED,
+        UNUSED,
+        UNUSED,
+        98,
+        100,
+        71,
+        UNUSED,
+        19,
+        63,
+        32,
+        UNUSED,
+        UNUSED,
+        UNUSED,
+        96,
+        15,
+        84,
+        132,
+        UNUSED,
+        37,
+        UNUSED,
+        9,
+        18,
+        UNUSED,
+        UNUSED,
+        75,
+        97,
+        UNUSED,
+    };
+    uint32_t k1, k2;
+    uint64_t crc;
+    uint16_t ix;
+
+    crc = crc64i(UINT64_C(0xaee7ac5ccabdec91), token);
+    k1 = (uint32_t)crc;
+    k2 = (uint32_t)(crc >> 32);
+
+    ix = hash1[k1 & 0x7f] + hash2[k2 & 0x7f];
+    if (ix >= 108)
+        return PP_INVALID;
+
+    if (!pp_directives[ix] || nasm_stricmp(pp_directives[ix], token))
+        return PP_INVALID;
+
+    return ix;
+}
diff --git a/pptok.dat b/pptok.dat
new file mode 100644 (file)
index 0000000..76ca360
--- /dev/null
+++ b/pptok.dat
@@ -0,0 +1,94 @@
+## --------------------------------------------------------------------------
+##   
+##   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.
+##
+## --------------------------------------------------------------------------
+
+#
+# A * at the end indicates a condition; the list of conditions are
+# on lines starting with *; the negatives are auto-generated
+#
+*
+*ctx
+*def
+*empty
+*id
+*idn
+*idni
+*macro
+*num
+*str
+*token
+%arg
+%assign
+%clear
+%define
+%defstr
+%deftok
+%depend
+%elif*
+%else
+%endif
+%endm
+%endmacro
+%endrep
+%error
+%exitmacro
+%exitrep
+%fatal
+%iassign
+%idefine
+%idefstr
+%ideftok
+%if*
+%imacro
+%irmacro
+%include
+%ixdefine
+%line
+%local
+%macro
+%pathsearch
+%pop
+%push
+%rep
+%repl
+%rmacro
+%rotate
+%stacksize
+%strcat
+%strlen
+%substr
+%undef
+%unimacro
+%unmacro
+%use
+%warning
+%xdefine
diff --git a/pptok.h b/pptok.h
new file mode 100644 (file)
index 0000000..2a4c280
--- /dev/null
+++ b/pptok.h
@@ -0,0 +1,159 @@
+/* Automatically generated from ./pptok.dat by ./pptok.pl */
+/* Do not edit */
+
+enum preproc_token {
+    PP_ELIF          =   0,
+    PP_ELIFN         =   1,
+    PP_ELIFCTX       =   2,
+    PP_ELIFNCTX      =   3,
+    PP_ELIFDEF       =   4,
+    PP_ELIFNDEF      =   5,
+    PP_ELIFEMPTY     =   6,
+    PP_ELIFNEMPTY    =   7,
+    PP_ELIFID        =   8,
+    PP_ELIFNID       =   9,
+    PP_ELIFIDN       =  10,
+    PP_ELIFNIDN      =  11,
+    PP_ELIFIDNI      =  12,
+    PP_ELIFNIDNI     =  13,
+    PP_ELIFMACRO     =  14,
+    PP_ELIFNMACRO    =  15,
+    PP_ELIFNUM       =  16,
+    PP_ELIFNNUM      =  17,
+    PP_ELIFSTR       =  18,
+    PP_ELIFNSTR      =  19,
+    PP_ELIFTOKEN     =  20,
+    PP_ELIFNTOKEN    =  21,
+    PP_IF            =  32,
+    PP_IFN           =  33,
+    PP_IFCTX         =  34,
+    PP_IFNCTX        =  35,
+    PP_IFDEF         =  36,
+    PP_IFNDEF        =  37,
+    PP_IFEMPTY       =  38,
+    PP_IFNEMPTY      =  39,
+    PP_IFID          =  40,
+    PP_IFNID         =  41,
+    PP_IFIDN         =  42,
+    PP_IFNIDN        =  43,
+    PP_IFIDNI        =  44,
+    PP_IFNIDNI       =  45,
+    PP_IFMACRO       =  46,
+    PP_IFNMACRO      =  47,
+    PP_IFNUM         =  48,
+    PP_IFNNUM        =  49,
+    PP_IFSTR         =  50,
+    PP_IFNSTR        =  51,
+    PP_IFTOKEN       =  52,
+    PP_IFNTOKEN      =  53,
+    PP_ARG           =  64,
+    PP_ASSIGN        =  65,
+    PP_CLEAR         =  66,
+    PP_DEFINE        =  67,
+    PP_DEFSTR        =  68,
+    PP_DEFTOK        =  69,
+    PP_DEPEND        =  70,
+    PP_ELSE          =  71,
+    PP_ENDIF         =  72,
+    PP_ENDM          =  73,
+    PP_ENDMACRO      =  74,
+    PP_ENDREP        =  75,
+    PP_ERROR         =  76,
+    PP_EXITMACRO     =  77,
+    PP_EXITREP       =  78,
+    PP_FATAL         =  79,
+    PP_IASSIGN       =  80,
+    PP_IDEFINE       =  81,
+    PP_IDEFSTR       =  82,
+    PP_IDEFTOK       =  83,
+    PP_IMACRO        =  84,
+    PP_INCLUDE       =  85,
+    PP_IRMACRO       =  86,
+    PP_IXDEFINE      =  87,
+    PP_LINE          =  88,
+    PP_LOCAL         =  89,
+    PP_MACRO         =  90,
+    PP_PATHSEARCH    =  91,
+    PP_POP           =  92,
+    PP_PUSH          =  93,
+    PP_REP           =  94,
+    PP_REPL          =  95,
+    PP_RMACRO        =  96,
+    PP_ROTATE        =  97,
+    PP_STACKSIZE     =  98,
+    PP_STRCAT        =  99,
+    PP_STRLEN        = 100,
+    PP_SUBSTR        = 101,
+    PP_UNDEF         = 102,
+    PP_UNIMACRO      = 103,
+    PP_UNMACRO       = 104,
+    PP_USE           = 105,
+    PP_WARNING       = 106,
+    PP_XDEFINE       = 107,
+    PP_INVALID       =  -1
+};
+
+enum pp_conditional {
+    PPC_IF           =   0,
+    PPC_IFCTX        =   2,
+    PPC_IFDEF        =   4,
+    PPC_IFEMPTY      =   6,
+    PPC_IFID         =   8,
+    PPC_IFIDN        =  10,
+    PPC_IFIDNI       =  12,
+    PPC_IFMACRO      =  14,
+    PPC_IFNUM        =  16,
+    PPC_IFSTR        =  18,
+    PPC_IFTOKEN      =  20,
+};
+
+#define PP_COND(x)     ((enum pp_conditional)((x) & 0x1e))
+#define PP_IS_COND(x)  ((unsigned int)(x) < PP_ARG)
+#define PP_NEGATIVE(x) ((x) & 1)
+
+#define CASE_PP_ELIF \
+       case PP_ELIF: \
+       case PP_ELIFN:\
+       case PP_ELIFCTX: \
+       case PP_ELIFNCTX:\
+       case PP_ELIFDEF: \
+       case PP_ELIFNDEF:\
+       case PP_ELIFEMPTY: \
+       case PP_ELIFNEMPTY:\
+       case PP_ELIFID: \
+       case PP_ELIFNID:\
+       case PP_ELIFIDN: \
+       case PP_ELIFNIDN:\
+       case PP_ELIFIDNI: \
+       case PP_ELIFNIDNI:\
+       case PP_ELIFMACRO: \
+       case PP_ELIFNMACRO:\
+       case PP_ELIFNUM: \
+       case PP_ELIFNNUM:\
+       case PP_ELIFSTR: \
+       case PP_ELIFNSTR:\
+       case PP_ELIFTOKEN: \
+       case PP_ELIFNTOKEN
+#define CASE_PP_IF \
+       case PP_IF: \
+       case PP_IFN:\
+       case PP_IFCTX: \
+       case PP_IFNCTX:\
+       case PP_IFDEF: \
+       case PP_IFNDEF:\
+       case PP_IFEMPTY: \
+       case PP_IFNEMPTY:\
+       case PP_IFID: \
+       case PP_IFNID:\
+       case PP_IFIDN: \
+       case PP_IFNIDN:\
+       case PP_IFIDNI: \
+       case PP_IFNIDNI:\
+       case PP_IFMACRO: \
+       case PP_IFNMACRO:\
+       case PP_IFNUM: \
+       case PP_IFNNUM:\
+       case PP_IFSTR: \
+       case PP_IFNSTR:\
+       case PP_IFTOKEN: \
+       case PP_IFNTOKEN
diff --git a/pptok.ph b/pptok.ph
new file mode 100644 (file)
index 0000000..4eedeb6
--- /dev/null
+++ b/pptok.ph
@@ -0,0 +1,94 @@
+# Automatically generated from ./pptok.dat by ./pptok.pl
+# Do not edit
+
+%pptok_hash = (
+    '%elif' => 0,
+    '%elifn' => 1,
+    '%elifctx' => 2,
+    '%elifnctx' => 3,
+    '%elifdef' => 4,
+    '%elifndef' => 5,
+    '%elifempty' => 6,
+    '%elifnempty' => 7,
+    '%elifid' => 8,
+    '%elifnid' => 9,
+    '%elifidn' => 10,
+    '%elifnidn' => 11,
+    '%elifidni' => 12,
+    '%elifnidni' => 13,
+    '%elifmacro' => 14,
+    '%elifnmacro' => 15,
+    '%elifnum' => 16,
+    '%elifnnum' => 17,
+    '%elifstr' => 18,
+    '%elifnstr' => 19,
+    '%eliftoken' => 20,
+    '%elifntoken' => 21,
+    '%if' => 32,
+    '%ifn' => 33,
+    '%ifctx' => 34,
+    '%ifnctx' => 35,
+    '%ifdef' => 36,
+    '%ifndef' => 37,
+    '%ifempty' => 38,
+    '%ifnempty' => 39,
+    '%ifid' => 40,
+    '%ifnid' => 41,
+    '%ifidn' => 42,
+    '%ifnidn' => 43,
+    '%ifidni' => 44,
+    '%ifnidni' => 45,
+    '%ifmacro' => 46,
+    '%ifnmacro' => 47,
+    '%ifnum' => 48,
+    '%ifnnum' => 49,
+    '%ifstr' => 50,
+    '%ifnstr' => 51,
+    '%iftoken' => 52,
+    '%ifntoken' => 53,
+    '%arg' => 64,
+    '%assign' => 65,
+    '%clear' => 66,
+    '%define' => 67,
+    '%defstr' => 68,
+    '%deftok' => 69,
+    '%depend' => 70,
+    '%else' => 71,
+    '%endif' => 72,
+    '%endm' => 73,
+    '%endmacro' => 74,
+    '%endrep' => 75,
+    '%error' => 76,
+    '%exitmacro' => 77,
+    '%exitrep' => 78,
+    '%fatal' => 79,
+    '%iassign' => 80,
+    '%idefine' => 81,
+    '%idefstr' => 82,
+    '%ideftok' => 83,
+    '%imacro' => 84,
+    '%include' => 85,
+    '%irmacro' => 86,
+    '%ixdefine' => 87,
+    '%line' => 88,
+    '%local' => 89,
+    '%macro' => 90,
+    '%pathsearch' => 91,
+    '%pop' => 92,
+    '%push' => 93,
+    '%rep' => 94,
+    '%repl' => 95,
+    '%rmacro' => 96,
+    '%rotate' => 97,
+    '%stacksize' => 98,
+    '%strcat' => 99,
+    '%strlen' => 100,
+    '%substr' => 101,
+    '%undef' => 102,
+    '%unimacro' => 103,
+    '%unmacro' => 104,
+    '%use' => 105,
+    '%warning' => 106,
+    '%xdefine' => 107,
+);
+1;
diff --git a/pptok.pl b/pptok.pl
new file mode 100755 (executable)
index 0000000..c9738d3
--- /dev/null
+++ b/pptok.pl
@@ -0,0 +1,270 @@
+#!/usr/bin/perl
+## --------------------------------------------------------------------------
+##   
+##   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.
+##
+## --------------------------------------------------------------------------
+
+#
+# Produce pptok.c, pptok.h and pptok.ph from pptok.dat
+#
+
+require 'phash.ph';
+
+my($what, $in, $out) = @ARGV;
+
+#
+# Read pptok.dat
+#
+open(IN, "< $in") or die "$0: cannot open: $in\n";
+while (defined($line = <IN>)) {
+    chomp $line;
+    $line =~ s/^\s+//;         # Remove leading whitespace
+    $line =~ s/\s*\#.*$//;     # Remove comments and trailing whitespace
+    next if ($line eq '');
+
+    if ($line =~ /^\%(.*)\*$/) {
+       push(@cctok, $1);
+    } elsif ($line =~ /^\%(.*)$/) {
+       push(@pptok, $1);
+    } elsif ($line =~ /^\*(.*)$/) {
+       push(@cond, $1);
+    }
+}
+close(IN);
+
+@cctok = sort @cctok;
+@cond = sort @cond;
+@pptok = sort @pptok;
+
+# Generate the expanded list including conditionals.  The conditionals
+# are at the beginning, padded to a power of 2, with the inverses
+# interspersed; this allows a simple mask to pick out the condition.
+
+while ((scalar @cond) & (scalar @cond)-1) {
+    push(@cond, undef);
+}
+
+@cptok = ();
+foreach $ct (@cctok) {
+    foreach $cc (@cond) {
+       if (defined($cc)) {
+           push(@cptok, $ct.$cc);
+           push(@cptok, $ct.'n'.$cc);
+       } else {
+           push(@cptok, undef, undef);
+       }
+    }
+}
+$first_uncond = $pptok[0];
+@pptok = (@cptok, @pptok);
+
+open(OUT, "> $out") or die "$0: cannot open: $out\n";
+
+#
+# Output pptok.h
+#
+if ($what eq 'h') {
+    print OUT "/* Automatically generated from $in by $0 */\n";
+    print OUT "/* Do not edit */\n";
+    print OUT "\n";
+
+    print OUT "enum preproc_token {\n";
+    $n = 0;
+    foreach $pt (@pptok) {
+       if (defined($pt)) {
+           printf OUT "    %-16s = %3d,\n", "PP_\U$pt\E", $n;
+       }
+       $n++;
+    }
+    printf OUT "    %-16s = %3d\n", 'PP_INVALID', -1;
+    print OUT "};\n";
+    print OUT "\n";
+
+    print  OUT "enum pp_conditional {\n";
+    $n = 0;
+    foreach $cc (@cond) {
+       if (defined($cc)) {
+           printf OUT "    %-16s = %3d,\n", "PPC_IF\U$cc\E", $n;
+       }
+       $n += 2;
+    }
+    print  OUT "};\n\n";
+
+    printf OUT "#define PP_COND(x)     ((enum pp_conditional)((x) & 0x%x))\n",
+       (scalar(@cond)-1) << 1;
+    print  OUT "#define PP_IS_COND(x)  ((unsigned int)(x) < PP_\U$first_uncond\E)\n";
+    print  OUT "#define PP_NEGATIVE(x) ((x) & 1)\n";
+    print  OUT "\n";
+
+    foreach $ct (@cctok) {
+       print OUT "#define CASE_PP_\U$ct\E";
+       $pref = " \\\n";
+       foreach $cc (@cond) {
+           if (defined($cc)) {
+               print OUT "$pref\tcase PP_\U${ct}${cc}\E: \\\n";
+               print OUT "\tcase PP_\U${ct}N${cc}\E";
+               $pref = ":\\\n";
+           }
+       }
+       print OUT "\n";         # No colon or newline on the last one
+    }
+}
+
+#
+# Output pptok.c
+#
+if ($what eq 'c') {
+    print OUT "/* Automatically generated from $in by $0 */\n";
+    print OUT "/* Do not edit */\n";
+    print OUT "\n";
+
+    my %tokens = ();
+    my @tokendata = ();
+
+    my $n = 0;
+    foreach $pt (@pptok) {
+       if (defined($pt)) {
+           $tokens{'%'.$pt} = $n;
+           if ($pt =~ /[\@\[\]\\_]/) {
+               # Fail on characters which look like upper-case letters
+               # to the quick-and-dirty downcasing in the prehash
+               # (see below)
+               die "$in: invalid character in token: $pt";
+           }
+       }
+       $n++;
+    }
+
+    my @hashinfo = gen_perfect_hash(\%tokens);
+    if (!defined(@hashinfo)) {
+       die "$0: no hash found\n";
+    }
+
+    # Paranoia...
+    verify_hash_table(\%tokens, \@hashinfo);
+
+    ($n, $sv, $g) = @hashinfo;
+    $sv2 = $sv+2;
+
+    die if ($n & ($n-1));
+
+    print OUT "#include \"compiler.h\"\n";
+    print OUT "#include <inttypes.h>\n";
+    print OUT "#include <ctype.h>\n";
+    print OUT "#include \"nasmlib.h\"\n";
+    print OUT "#include \"hashtbl.h\"\n";
+    print OUT "#include \"preproc.h\"\n";
+    print OUT "\n";
+
+    # Note that this is global.
+    printf OUT "const char * const pp_directives[%d] = {\n", scalar(@pptok);
+    foreach $d (@pptok) {
+       if (defined($d)) {
+           print OUT "    \"%$d\",\n";
+       } else {
+           print OUT "    NULL,\n";
+       }
+    }
+    print OUT  "};\n";
+
+    printf OUT "const uint8_t pp_directives_len[%d] = {\n", scalar(@pptok);
+    foreach $d (@pptok) {
+       printf OUT "    %d,\n", defined($d) ? length($d)+1 : 0;
+    }
+    print OUT  "};\n";
+
+    print OUT "enum preproc_token pp_token_hash(const char *token)\n";
+    print OUT "{\n";
+
+    # Put a large value in unused slots.  This makes it extremely unlikely
+    # that any combination that involves unused slot will pass the range test.
+    # This speeds up rejection of unrecognized tokens, i.e. identifiers.
+    print OUT "#define UNUSED 16383\n";
+
+    print OUT "    static const int16_t hash1[$n] = {\n";
+    for ($i = 0; $i < $n; $i++) {
+       my $h = ${$g}[$i*2+0];
+       print OUT "        ", defined($h) ? $h : 'UNUSED', ",\n";
+    }
+    print OUT "    };\n";
+
+    print OUT "    static const int16_t hash2[$n] = {\n";
+    for ($i = 0; $i < $n; $i++) {
+       my $h = ${$g}[$i*2+1];
+       print OUT "        ", defined($h) ? $h : 'UNUSED', ",\n";
+    }
+    print OUT "    };\n";
+
+    print OUT  "    uint32_t k1, k2;\n";
+    print OUT  "    uint64_t crc;\n";
+    # For correct overflow behavior, "ix" should be unsigned of the same
+    # width as the hash arrays.
+    print OUT  "    uint16_t ix;\n";
+    print OUT  "\n";
+
+    printf OUT "    crc = crc64i(UINT64_C(0x%08x%08x), token);\n",
+       $$sv[0], $$sv[1];
+    print  OUT "    k1 = (uint32_t)crc;\n";
+    print  OUT "    k2 = (uint32_t)(crc >> 32);\n";
+    print  OUT "\n";
+    printf OUT "    ix = hash1[k1 & 0x%x] + hash2[k2 & 0x%x];\n", $n-1, $n-1;
+    printf OUT "    if (ix >= %d)\n", scalar(@pptok);
+    print OUT  "        return PP_INVALID;\n";
+    print OUT  "\n";
+
+    print OUT  "    if (!pp_directives[ix] || nasm_stricmp(pp_directives[ix], token))\n";
+    print OUT  "        return PP_INVALID;\n";
+    print OUT  "\n";
+    print OUT  "    return ix;\n";
+    print OUT  "}\n";
+}
+
+#
+# Output pptok.ph
+#
+if ($what eq 'ph') {
+    print OUT "# Automatically generated from $in by $0\n";
+    print OUT "# Do not edit\n";
+    print OUT "\n";
+    
+    print OUT "%pptok_hash = (\n";
+    $n = 0;
+    foreach $tok (@pptok) {
+       if (defined($tok)) {
+           printf OUT "    '%%%s' => %d,\n", $tok, $n;
+       }
+       $n++;
+    }
+    print OUT ");\n";
+    print OUT "1;\n";
+}
+
+    
diff --git a/preproc.c b/preproc.c
new file mode 100644 (file)
index 0000000..45c0264
--- /dev/null
+++ b/preproc.c
@@ -0,0 +1,4943 @@
+/* ----------------------------------------------------------------------- *
+ *   
+ *   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.
+ *
+ * ----------------------------------------------------------------------- */
+
+/*
+ * preproc.c   macro preprocessor for the Netwide Assembler
+ */
+
+/* Typical flow of text through preproc
+ *
+ * pp_getline gets tokenized lines, either
+ *
+ *   from a macro expansion
+ *
+ * or
+ *   {
+ *   read_line  gets raw text from stdmacpos, or predef, or current input file
+ *   tokenize   converts to tokens
+ *   }
+ *
+ * expand_mmac_params is used to expand %1 etc., unless a macro is being
+ * defined or a false conditional is being processed
+ * (%0, %1, %+1, %-1, %%foo
+ *
+ * do_directive checks for directives
+ *
+ * expand_smacro is used to expand single line macros
+ *
+ * expand_mmacro is used to expand multi-line macros
+ *
+ * detoken is used to convert the line back to text
+ */
+
+#include "compiler.h"
+
+#include <stdio.h>
+#include <stdarg.h>
+#include <stdlib.h>
+#include <stddef.h>
+#include <string.h>
+#include <ctype.h>
+#include <limits.h>
+#include <inttypes.h>
+
+#include "nasm.h"
+#include "nasmlib.h"
+#include "preproc.h"
+#include "hashtbl.h"
+#include "quote.h"
+#include "stdscan.h"
+#include "eval.h"
+#include "tokens.h"
+#include "tables.h"
+
+typedef struct SMacro SMacro;
+typedef struct MMacro MMacro;
+typedef struct MMacroInvocation MMacroInvocation;
+typedef struct Context Context;
+typedef struct Token Token;
+typedef struct Blocks Blocks;
+typedef struct Line Line;
+typedef struct Include Include;
+typedef struct Cond Cond;
+typedef struct IncPath IncPath;
+
+/*
+ * Note on the storage of both SMacro and MMacros: the hash table
+ * indexes them case-insensitively, and we then have to go through a
+ * linked list of potential case aliases (and, for MMacros, parameter
+ * ranges); this is to preserve the matching semantics of the earlier
+ * code.  If the number of case aliases for a specific macro is a
+ * performance issue, you may want to reconsider your coding style.
+ */
+
+/*
+ * Store the definition of a single-line macro.
+ */
+struct SMacro {
+    SMacro *next;
+    char *name;
+    bool casesense;
+    bool in_progress;
+    unsigned int nparam;
+    Token *expansion;
+};
+
+/*
+ * Store the definition of a multi-line macro. This is also used to
+ * store the interiors of `%rep...%endrep' blocks, which are
+ * effectively self-re-invoking multi-line macros which simply
+ * don't have a name or bother to appear in the hash tables. %rep
+ * blocks are signified by having a NULL `name' field.
+ *
+ * In a MMacro describing a `%rep' block, the `in_progress' field
+ * isn't merely boolean, but gives the number of repeats left to
+ * run.
+ *
+ * The `next' field is used for storing MMacros in hash tables; the
+ * `next_active' field is for stacking them on istk entries.
+ *
+ * When a MMacro is being expanded, `params', `iline', `nparam',
+ * `paramlen', `rotate' and `unique' are local to the invocation.
+ */
+struct MMacro {
+    MMacro *next;
+    MMacroInvocation *prev;      /* previous invocation */
+    char *name;
+    int nparam_min, nparam_max;
+    bool casesense;
+    bool plus;                   /* is the last parameter greedy? */
+    bool nolist;                 /* is this macro listing-inhibited? */
+    int64_t in_progress;         /* is this macro currently being expanded? */
+    int32_t max_depth;           /* maximum number of recursive expansions allowed */
+    Token *dlist;               /* All defaults as one list */
+    Token **defaults;           /* Parameter default pointers */
+    int ndefs;                  /* number of default parameters */
+    Line *expansion;
+
+    MMacro *next_active;
+    MMacro *rep_nest;           /* used for nesting %rep */
+    Token **params;             /* actual parameters */
+    Token *iline;               /* invocation line */
+    unsigned int nparam, rotate;
+    int *paramlen;
+    uint64_t unique;
+    int lineno;                 /* Current line number on expansion */
+       uint64_t condcnt;           /* number of if blocks... */
+};
+
+
+/* Store the definition of a multi-line macro, as defined in a
+ * previous recursive macro expansion.
+ */
+struct MMacroInvocation {
+    MMacroInvocation *prev;     /* previous invocation */
+    Token **params;             /* actual parameters */
+    Token *iline;               /* invocation line */
+    unsigned int nparam, rotate;
+    int *paramlen;
+    uint64_t unique;
+    uint64_t condcnt;
+};
+
+
+/*
+ * The context stack is composed of a linked list of these.
+ */
+struct Context {
+    Context *next;
+    char *name;
+    struct hash_table localmac;
+    uint32_t number;
+};
+
+/*
+ * This is the internal form which we break input lines up into.
+ * Typically stored in linked lists.
+ *
+ * Note that `type' serves a double meaning: TOK_SMAC_PARAM is not
+ * necessarily used as-is, but is intended to denote the number of
+ * the substituted parameter. So in the definition
+ *
+ *     %define a(x,y) ( (x) & ~(y) )
+ *
+ * the token representing `x' will have its type changed to
+ * TOK_SMAC_PARAM, but the one representing `y' will be
+ * TOK_SMAC_PARAM+1.
+ *
+ * TOK_INTERNAL_STRING is a dirty hack: it's a single string token
+ * which doesn't need quotes around it. Used in the pre-include
+ * mechanism as an alternative to trying to find a sensible type of
+ * quote to use on the filename we were passed.
+ */
+enum pp_token_type {
+    TOK_NONE = 0, TOK_WHITESPACE, TOK_COMMENT, TOK_ID,
+    TOK_PREPROC_ID, TOK_STRING,
+    TOK_NUMBER, TOK_FLOAT, TOK_SMAC_END, TOK_OTHER,
+    TOK_INTERNAL_STRING,
+    TOK_PREPROC_Q, TOK_PREPROC_QQ,
+    TOK_PASTE,                 /* %+ */
+    TOK_INDIRECT,              /* %[...] */
+    TOK_SMAC_PARAM,            /* MUST BE LAST IN THE LIST!!! */
+    TOK_MAX = INT_MAX          /* Keep compiler from reducing the range */
+};
+
+struct Token {
+    Token *next;
+    char *text;
+    union {
+       SMacro *mac;            /* associated macro for TOK_SMAC_END */
+       size_t len;             /* scratch length field */
+    } a;                       /* Auxiliary data */
+    enum pp_token_type type;
+};
+
+/*
+ * Multi-line macro definitions are stored as a linked list of
+ * these, which is essentially a container to allow several linked
+ * lists of Tokens.
+ *
+ * Note that in this module, linked lists are treated as stacks
+ * wherever possible. For this reason, Lines are _pushed_ on to the
+ * `expansion' field in MMacro structures, so that the linked list,
+ * if walked, would give the macro lines in reverse order; this
+ * means that we can walk the list when expanding a macro, and thus
+ * push the lines on to the `expansion' field in _istk_ in reverse
+ * order (so that when popped back off they are in the right
+ * order). It may seem cockeyed, and it relies on my design having
+ * an even number of steps in, but it works...
+ *
+ * Some of these structures, rather than being actual lines, are
+ * markers delimiting the end of the expansion of a given macro.
+ * This is for use in the cycle-tracking and %rep-handling code.
+ * Such structures have `finishes' non-NULL, and `first' NULL. All
+ * others have `finishes' NULL, but `first' may still be NULL if
+ * the line is blank.
+ */
+struct Line {
+    Line *next;
+    MMacro *finishes;
+    Token *first;
+};
+
+/*
+ * To handle an arbitrary level of file inclusion, we maintain a
+ * stack (ie linked list) of these things.
+ */
+struct Include {
+    Include *next;
+    FILE *fp;
+    Cond *conds;
+    Line *expansion;
+    char *fname;
+    int lineno, lineinc;
+    MMacro *mstk;               /* stack of active macros/reps */
+};
+
+/*
+ * Include search path. This is simply a list of strings which get
+ * prepended, in turn, to the name of an include file, in an
+ * attempt to find the file if it's not in the current directory.
+ */
+struct IncPath {
+    IncPath *next;
+    char *path;
+};
+
+/*
+ * Conditional assembly: we maintain a separate stack of these for
+ * each level of file inclusion. (The only reason we keep the
+ * stacks separate is to ensure that a stray `%endif' in a file
+ * included from within the true branch of a `%if' won't terminate
+ * it and cause confusion: instead, rightly, it'll cause an error.)
+ */
+struct Cond {
+    Cond *next;
+    int state;
+};
+enum {
+    /*
+     * These states are for use just after %if or %elif: IF_TRUE
+     * means the condition has evaluated to truth so we are
+     * currently emitting, whereas IF_FALSE means we are not
+     * currently emitting but will start doing so if a %else comes
+     * up. In these states, all directives are admissible: %elif,
+     * %else and %endif. (And of course %if.)
+     */
+    COND_IF_TRUE, COND_IF_FALSE,
+    /*
+     * These states come up after a %else: ELSE_TRUE means we're
+     * emitting, and ELSE_FALSE means we're not. In ELSE_* states,
+     * any %elif or %else will cause an error.
+     */
+    COND_ELSE_TRUE, COND_ELSE_FALSE,
+    /*
+     * These states mean that we're not emitting now, and also that
+     * nothing until %endif will be emitted at all. COND_DONE is
+     * used when we've had our moment of emission
+     * and have now started seeing %elifs. COND_NEVER is used when
+     * the condition construct in question is contained within a
+     * non-emitting branch of a larger condition construct,
+     * or if there is an error.
+     */
+    COND_DONE, COND_NEVER
+};
+#define emitting(x) ( (x) == COND_IF_TRUE || (x) == COND_ELSE_TRUE )
+
+/*
+ * These defines are used as the possible return values for do_directive
+ */
+#define NO_DIRECTIVE_FOUND  0
+#define DIRECTIVE_FOUND            1
+
+/*
+ * This define sets the upper limit for smacro and recursive mmacro
+ * expansions
+ */
+#define DEADMAN_LIMIT (1 << 20)
+
+/*
+ * Condition codes. Note that we use c_ prefix not C_ because C_ is
+ * used in nasm.h for the "real" condition codes. At _this_ level,
+ * we treat CXZ and ECXZ as condition codes, albeit non-invertible
+ * ones, so we need a different enum...
+ */
+static const char * const conditions[] = {
+    "a", "ae", "b", "be", "c", "cxz", "e", "ecxz", "g", "ge", "l", "le",
+    "na", "nae", "nb", "nbe", "nc", "ne", "ng", "nge", "nl", "nle", "no",
+    "np", "ns", "nz", "o", "p", "pe", "po", "rcxz", "s", "z"
+};
+enum pp_conds {
+    c_A, c_AE, c_B, c_BE, c_C, c_CXZ, c_E, c_ECXZ, c_G, c_GE, c_L, c_LE,
+    c_NA, c_NAE, c_NB, c_NBE, c_NC, c_NE, c_NG, c_NGE, c_NL, c_NLE, c_NO,
+    c_NP, c_NS, c_NZ, c_O, c_P, c_PE, c_PO, c_RCXZ, c_S, c_Z,
+    c_none = -1
+};
+static const enum pp_conds inverse_ccs[] = {
+    c_NA, c_NAE, c_NB, c_NBE, c_NC, -1, c_NE, -1, c_NG, c_NGE, c_NL, c_NLE,
+    c_A, c_AE, c_B, c_BE, c_C, c_E, c_G, c_GE, c_L, c_LE, c_O, c_P, c_S,
+    c_Z, c_NO, c_NP, c_PO, c_PE, -1, c_NS, c_NZ
+};
+
+/*
+ * Directive names.
+ */
+/* If this is a an IF, ELIF, ELSE or ENDIF keyword */
+static int is_condition(enum preproc_token arg)
+{
+    return PP_IS_COND(arg) || (arg == PP_ELSE) || (arg == PP_ENDIF);
+}
+
+/* For TASM compatibility we need to be able to recognise TASM compatible
+ * conditional compilation directives. Using the NASM pre-processor does
+ * not work, so we look for them specifically from the following list and
+ * then jam in the equivalent NASM directive into the input stream.
+ */
+
+enum {
+    TM_ARG, TM_ELIF, TM_ELSE, TM_ENDIF, TM_IF, TM_IFDEF, TM_IFDIFI,
+    TM_IFNDEF, TM_INCLUDE, TM_LOCAL
+};
+
+static const char * const tasm_directives[] = {
+    "arg", "elif", "else", "endif", "if", "ifdef", "ifdifi",
+    "ifndef", "include", "local"
+};
+
+static int StackSize = 4;
+static char *StackPointer = "ebp";
+static int ArgOffset = 8;
+static int LocalOffset = 0;
+
+static Context *cstk;
+static Include *istk;
+static IncPath *ipath = NULL;
+
+static int pass;                /* HACK: pass 0 = generate dependencies only */
+static StrList **dephead, **deptail; /* Dependency list */
+
+static uint64_t unique;    /* unique identifier numbers */
+
+static Line *predef = NULL;
+static bool do_predef;
+
+static ListGen *list;
+
+/*
+ * The current set of multi-line macros we have defined.
+ */
+static struct hash_table mmacros;
+
+/*
+ * The current set of single-line macros we have defined.
+ */
+static struct hash_table smacros;
+
+/*
+ * The multi-line macro we are currently defining, or the %rep
+ * block we are currently reading, if any.
+ */
+static MMacro *defining;
+
+static uint64_t nested_mac_count;
+static uint64_t nested_rep_count;
+
+/*
+ * The number of macro parameters to allocate space for at a time.
+ */
+#define PARAM_DELTA 16
+
+/*
+ * The standard macro set: defined in macros.c in the array nasm_stdmac.
+ * This gives our position in the macro set, when we're processing it.
+ */
+static macros_t *stdmacpos;
+
+/*
+ * The extra standard macros that come from the object format, if
+ * any.
+ */
+static macros_t *extrastdmac = NULL;
+static bool any_extrastdmac;
+
+/*
+ * Tokens are allocated in blocks to improve speed
+ */
+#define TOKEN_BLOCKSIZE 4096
+static Token *freeTokens = NULL;
+struct Blocks {
+    Blocks *next;
+    void *chunk;
+};
+
+static Blocks blocks = { NULL, NULL };
+
+/*
+ * Forward declarations.
+ */
+static Token *expand_mmac_params(Token * tline);
+static Token *expand_smacro(Token * tline);
+static Token *expand_id(Token * tline);
+static Context *get_ctx(const char *name, const char **namep,
+                       bool all_contexts);
+static void make_tok_num(Token * tok, int64_t val);
+static void error(int severity, const char *fmt, ...);
+static void error_precond(int severity, const char *fmt, ...);
+static void *new_Block(size_t size);
+static void delete_Blocks(void);
+static Token *new_Token(Token * next, enum pp_token_type type,
+                       const char *text, int txtlen);
+static Token *delete_Token(Token * t);
+
+/*
+ * Macros for safe checking of token pointers, avoid *(NULL)
+ */
+#define tok_type_(x,t) ((x) && (x)->type == (t))
+#define skip_white_(x) if (tok_type_((x), TOK_WHITESPACE)) (x)=(x)->next
+#define tok_is_(x,v) (tok_type_((x), TOK_OTHER) && !strcmp((x)->text,(v)))
+#define tok_isnt_(x,v) ((x) && ((x)->type!=TOK_OTHER || strcmp((x)->text,(v))))
+
+/* Handle TASM specific directives, which do not contain a % in
+ * front of them. We do it here because I could not find any other
+ * place to do it for the moment, and it is a hack (ideally it would
+ * be nice to be able to use the NASM pre-processor to do it).
+ */
+static char *check_tasm_directive(char *line)
+{
+    int32_t i, j, k, m, len;
+    char *p, *q, *oldline, oldchar;
+
+    p = nasm_skip_spaces(line);
+
+    /* Binary search for the directive name */
+    i = -1;
+    j = elements(tasm_directives);
+    q = nasm_skip_word(p);
+    len = q - p;
+    if (len) {
+        oldchar = p[len];
+        p[len] = 0;
+        while (j - i > 1) {
+            k = (j + i) / 2;
+            m = nasm_stricmp(p, tasm_directives[k]);
+            if (m == 0) {
+                /* We have found a directive, so jam a % in front of it
+                 * so that NASM will then recognise it as one if it's own.
+                 */
+                p[len] = oldchar;
+                len = strlen(p);
+                oldline = line;
+                line = nasm_malloc(len + 2);
+                line[0] = '%';
+                if (k == TM_IFDIFI) {
+                    /*
+                    * NASM does not recognise IFDIFI, so we convert
+                    * it to %if 0. This is not used in NASM
+                    * compatible code, but does need to parse for the
+                    * TASM macro package.
+                     */
+                    strcpy(line + 1, "if 0");
+                } else {
+                    memcpy(line + 1, p, len + 1);
+                }
+                nasm_free(oldline);
+                return line;
+            } else if (m < 0) {
+                j = k;
+            } else
+                i = k;
+        }
+        p[len] = oldchar;
+    }
+    return line;
+}
+
+/*
+ * The pre-preprocessing stage... This function translates line
+ * number indications as they emerge from GNU cpp (`# lineno "file"
+ * flags') into NASM preprocessor line number indications (`%line
+ * lineno file').
+ */
+static char *prepreproc(char *line)
+{
+    int lineno, fnlen;
+    char *fname, *oldline;
+
+    if (line[0] == '#' && line[1] == ' ') {
+        oldline = line;
+        fname = oldline + 2;
+        lineno = atoi(fname);
+        fname += strspn(fname, "0123456789 ");
+        if (*fname == '"')
+            fname++;
+        fnlen = strcspn(fname, "\"");
+        line = nasm_malloc(20 + fnlen);
+        snprintf(line, 20 + fnlen, "%%line %d %.*s", lineno, fnlen, fname);
+        nasm_free(oldline);
+    }
+    if (tasm_compatible_mode)
+        return check_tasm_directive(line);
+    return line;
+}
+
+/*
+ * Free a linked list of tokens.
+ */
+static void free_tlist(Token * list)
+{
+    while (list) {
+        list = delete_Token(list);
+    }
+}
+
+/*
+ * Free a linked list of lines.
+ */
+static void free_llist(Line * list)
+{
+    Line *l;
+    while (list) {
+        l = list;
+        list = list->next;
+        free_tlist(l->first);
+        nasm_free(l);
+    }
+}
+
+/*
+ * Free an MMacro
+ */
+static void free_mmacro(MMacro * m)
+{
+    nasm_free(m->name);
+    free_tlist(m->dlist);
+    nasm_free(m->defaults);
+    free_llist(m->expansion);
+    nasm_free(m);
+}
+
+/*
+ * Free all currently defined macros, and free the hash tables
+ */
+static void free_smacro_table(struct hash_table *smt)
+{
+    SMacro *s;
+    const char *key;
+    struct hash_tbl_node *it = NULL;
+
+    while ((s = hash_iterate(smt, &it, &key)) != NULL) {
+       nasm_free((void *)key);
+       while (s) {
+           SMacro *ns = s->next;
+           nasm_free(s->name);
+           free_tlist(s->expansion);
+           nasm_free(s);
+           s = ns;
+       }
+    }
+    hash_free(smt);
+}
+
+static void free_mmacro_table(struct hash_table *mmt)
+{
+    MMacro *m;
+    const char *key;
+    struct hash_tbl_node *it = NULL;
+
+    it = NULL;
+    while ((m = hash_iterate(mmt, &it, &key)) != NULL) {
+       nasm_free((void *)key);
+       while (m) {
+           MMacro *nm = m->next;
+           free_mmacro(m);
+           m = nm;
+       }
+    }
+    hash_free(mmt);
+}
+
+static void free_macros(void)
+{
+    free_smacro_table(&smacros);
+    free_mmacro_table(&mmacros);
+}
+
+/*
+ * Initialize the hash tables
+ */
+static void init_macros(void)
+{
+    hash_init(&smacros, HASH_LARGE);
+    hash_init(&mmacros, HASH_LARGE);
+}
+
+/*
+ * Pop the context stack.
+ */
+static void ctx_pop(void)
+{
+    Context *c = cstk;
+
+    cstk = cstk->next;
+    free_smacro_table(&c->localmac);
+    nasm_free(c->name);
+    nasm_free(c);
+}
+
+/*
+ * Search for a key in the hash index; adding it if necessary
+ * (in which case we initialize the data pointer to NULL.)
+ */
+static void **
+hash_findi_add(struct hash_table *hash, const char *str)
+{
+    struct hash_insert hi;
+    void **r;
+    char *strx;
+
+    r = hash_findi(hash, str, &hi);
+    if (r)
+       return r;
+
+    strx = nasm_strdup(str);   /* Use a more efficient allocator here? */
+    return hash_add(&hi, strx, NULL);
+}
+
+/*
+ * Like hash_findi, but returns the data element rather than a pointer
+ * to it.  Used only when not adding a new element, hence no third
+ * argument.
+ */
+static void *
+hash_findix(struct hash_table *hash, const char *str)
+{
+    void **p;
+
+    p = hash_findi(hash, str, NULL);
+    return p ? *p : NULL;
+}
+
+#define BUF_DELTA 512
+/*
+ * Read a line from the top file in istk, handling multiple CR/LFs
+ * at the end of the line read, and handling spurious ^Zs. Will
+ * return lines from the standard macro set if this has not already
+ * been done.
+ */
+static char *read_line(void)
+{
+    char *buffer, *p, *q;
+    int bufsize, continued_count;
+
+    if (stdmacpos) {
+       unsigned char c;
+       const unsigned char *p = stdmacpos;
+       char *ret, *q;
+       size_t len = 0;
+       while ((c = *p++)) {
+           if (c >= 0x80)
+               len += pp_directives_len[c-0x80]+1;
+           else
+               len++;
+       }
+       ret = nasm_malloc(len+1);
+       q = ret;
+       while ((c = *stdmacpos++)) {
+           if (c >= 0x80) {
+               memcpy(q, pp_directives[c-0x80], pp_directives_len[c-0x80]);
+               q += pp_directives_len[c-0x80];
+               *q++ = ' ';
+           } else {
+               *q++ = c;
+           }
+       }
+       stdmacpos = p;
+       *q = '\0';
+
+       if (!*stdmacpos) {
+           /* This was the last of the standard macro chain... */
+           stdmacpos = NULL;
+           if (any_extrastdmac) {
+               stdmacpos = extrastdmac;
+               any_extrastdmac = false;
+           } else if (do_predef) {
+               Line *pd, *l;
+               Token *head, **tail, *t;
+
+               /*
+                * Nasty hack: here we push the contents of
+                * `predef' on to the top-level expansion stack,
+                * since this is the most convenient way to
+                * implement the pre-include and pre-define
+                * features.
+                */
+               for (pd = predef; pd; pd = pd->next) {
+                   head = NULL;
+                   tail = &head;
+                   for (t = pd->first; t; t = t->next) {
+                       *tail = new_Token(NULL, t->type, t->text, 0);
+                       tail = &(*tail)->next;
+                   }
+                   l = nasm_malloc(sizeof(Line));
+                   l->next = istk->expansion;
+                   l->first = head;
+                   l->finishes = NULL;
+                   istk->expansion = l;
+               }
+               do_predef = false;
+           }
+       }
+       return ret;
+    }
+
+    bufsize = BUF_DELTA;
+    buffer = nasm_malloc(BUF_DELTA);
+    p = buffer;
+    continued_count = 0;
+    while (1) {
+        q = fgets(p, bufsize - (p - buffer), istk->fp);
+        if (!q)
+            break;
+        p += strlen(p);
+        if (p > buffer && p[-1] == '\n') {
+            /* Convert backslash-CRLF line continuation sequences into
+               nothing at all (for DOS and Windows) */
+            if (((p - 2) > buffer) && (p[-3] == '\\') && (p[-2] == '\r')) {
+                p -= 3;
+                *p = 0;
+                continued_count++;
+            }
+            /* Also convert backslash-LF line continuation sequences into
+               nothing at all (for Unix) */
+            else if (((p - 1) > buffer) && (p[-2] == '\\')) {
+                p -= 2;
+                *p = 0;
+                continued_count++;
+            } else {
+                break;
+            }
+        }
+        if (p - buffer > bufsize - 10) {
+            int32_t offset = p - buffer;
+            bufsize += BUF_DELTA;
+            buffer = nasm_realloc(buffer, bufsize);
+            p = buffer + offset;        /* prevent stale-pointer problems */
+        }
+    }
+
+    if (!q && p == buffer) {
+        nasm_free(buffer);
+        return NULL;
+    }
+
+    src_set_linnum(src_get_linnum() + istk->lineinc +
+                   (continued_count * istk->lineinc));
+
+    /*
+     * Play safe: remove CRs as well as LFs, if any of either are
+     * present at the end of the line.
+     */
+    while (--p >= buffer && (*p == '\n' || *p == '\r'))
+        *p = '\0';
+
+    /*
+     * Handle spurious ^Z, which may be inserted into source files
+     * by some file transfer utilities.
+     */
+    buffer[strcspn(buffer, "\032")] = '\0';
+
+    list->line(LIST_READ, buffer);
+
+    return buffer;
+}
+
+/*
+ * Tokenize a line of text. This is a very simple process since we
+ * don't need to parse the value out of e.g. numeric tokens: we
+ * simply split one string into many.
+ */
+static Token *tokenize(char *line)
+{
+    char c, *p = line;
+    enum pp_token_type type;
+    Token *list = NULL;
+    Token *t, **tail = &list;
+
+    while (*line) {
+        p = line;
+        if (*p == '%') {
+            p++;
+           if (*p == '+' && !nasm_isdigit(p[1])) {
+               p++;
+               type = TOK_PASTE;
+           } else if (nasm_isdigit(*p) ||
+                      ((*p == '-' || *p == '+') && nasm_isdigit(p[1]))) {
+                do {
+                    p++;
+                }
+                while (nasm_isdigit(*p));
+                type = TOK_PREPROC_ID;
+            } else if (*p == '{') {
+                p++;
+                while (*p && *p != '}') {
+                    p[-1] = *p;
+                    p++;
+                }
+                p[-1] = '\0';
+                if (*p)
+                    p++;
+                type = TOK_PREPROC_ID;
+           } else if (*p == '[') {
+               int lvl = 1;
+               line += 2;      /* Skip the leading %[ */
+               p++;
+               while (lvl && (c = *p++)) {
+                   switch (c) {
+                   case ']':
+                       lvl--;
+                       break;
+                   case '%':
+                       if (*p == '[')
+                           lvl++;
+                       break;
+                   case '\'':
+                   case '\"':
+                   case '`':
+                       p = nasm_skip_string(p)+1;
+                       break;
+                   default:
+                       break;
+                   }
+               }
+               p--;
+               if (*p)
+                   *p++ = '\0';
+               if (lvl)
+                   error(ERR_NONFATAL, "unterminated %[ construct");
+               type = TOK_INDIRECT;
+           } else if (*p == '?') {
+               type = TOK_PREPROC_Q; /* %? */
+               p++;
+               if (*p == '?') {
+                   type = TOK_PREPROC_QQ; /* %?? */
+                   p++;
+               }
+            } else if (isidchar(*p) ||
+                       ((*p == '!' || *p == '%' || *p == '$') &&
+                        isidchar(p[1]))) {
+                do {
+                    p++;
+                }
+                while (isidchar(*p));
+                type = TOK_PREPROC_ID;
+            } else {
+                type = TOK_OTHER;
+                if (*p == '%')
+                    p++;
+            }
+        } else if (isidstart(*p) || (*p == '$' && isidstart(p[1]))) {
+            type = TOK_ID;
+            p++;
+            while (*p && isidchar(*p))
+                p++;
+        } else if (*p == '\'' || *p == '"' || *p == '`') {
+            /*
+             * A string token.
+             */
+            type = TOK_STRING;
+           p = nasm_skip_string(p);
+
+            if (*p) {
+                p++;
+            } else {
+                error(ERR_WARNING|ERR_PASS1, "unterminated string");
+                /* Handling unterminated strings by UNV */
+                /* type = -1; */
+            }
+        } else if (p[0] == '$' && p[1] == '$') {
+            type = TOK_OTHER;  /* TOKEN_BASE */
+            p += 2;
+        } else if (isnumstart(*p)) {
+           bool is_hex = false;
+           bool is_float = false;
+           bool has_e = false;
+           char c, *r;
+
+            /*
+             * A numeric token.
+             */
+
+           if (*p == '$') {
+               p++;
+               is_hex = true;
+           }
+
+           for (;;) {
+               c = *p++;
+
+               if (!is_hex && (c == 'e' || c == 'E')) {
+                   has_e = true;
+                   if (*p == '+' || *p == '-') {
+                       /* e can only be followed by +/- if it is either a
+                          prefixed hex number or a floating-point number */
+                       p++;
+                       is_float = true;
+                   }
+               } else if (c == 'H' || c == 'h' || c == 'X' || c == 'x') {
+                   is_hex = true;
+               } else if (c == 'P' || c == 'p') {
+                   is_float = true;
+                   if (*p == '+' || *p == '-')
+                       p++;
+               } else if (isnumchar(c) || c == '_')
+                   ; /* just advance */
+               else if (c == '.') {
+                   /* we need to deal with consequences of the legacy
+                      parser, like "1.nolist" being two tokens
+                      (TOK_NUMBER, TOK_ID) here; at least give it
+                      a shot for now.  In the future, we probably need
+                      a flex-based scanner with proper pattern matching
+                      to do it as well as it can be done.  Nothing in
+                      the world is going to help the person who wants
+                      0x123.p16 interpreted as two tokens, though. */
+                   r = p;
+                   while (*r == '_')
+                       r++;
+
+                   if (nasm_isdigit(*r) || (is_hex && nasm_isxdigit(*r)) ||
+                       (!is_hex && (*r == 'e' || *r == 'E')) ||
+                       (*r == 'p' || *r == 'P')) {
+                       p = r;
+                       is_float = true;
+                   } else
+                       break;  /* Terminate the token */
+               } else
+                   break;
+           }
+           p--;        /* Point to first character beyond number */
+
+           if (p == line+1 && *line == '$') {
+               type = TOK_OTHER; /* TOKEN_HERE */
+           } else {
+               if (has_e && !is_hex) {
+                   /* 1e13 is floating-point, but 1e13h is not */
+                   is_float = true;
+               }
+
+               type = is_float ? TOK_FLOAT : TOK_NUMBER;
+           }
+        } else if (nasm_isspace(*p)) {
+            type = TOK_WHITESPACE;
+            p = nasm_skip_spaces(p);
+            /*
+             * Whitespace just before end-of-line is discarded by
+             * pretending it's a comment; whitespace just before a
+             * comment gets lumped into the comment.
+             */
+            if (!*p || *p == ';') {
+                type = TOK_COMMENT;
+                while (*p)
+                    p++;
+            }
+        } else if (*p == ';') {
+            type = TOK_COMMENT;
+            while (*p)
+                p++;
+        } else {
+            /*
+             * Anything else is an operator of some kind. We check
+             * for all the double-character operators (>>, <<, //,
+             * %%, <=, >=, ==, !=, <>, &&, ||, ^^), but anything
+             * else is a single-character operator.
+             */
+            type = TOK_OTHER;
+            if ((p[0] == '>' && p[1] == '>') ||
+                (p[0] == '<' && p[1] == '<') ||
+                (p[0] == '/' && p[1] == '/') ||
+                (p[0] == '<' && p[1] == '=') ||
+                (p[0] == '>' && p[1] == '=') ||
+                (p[0] == '=' && p[1] == '=') ||
+                (p[0] == '!' && p[1] == '=') ||
+                (p[0] == '<' && p[1] == '>') ||
+                (p[0] == '&' && p[1] == '&') ||
+                (p[0] == '|' && p[1] == '|') ||
+                (p[0] == '^' && p[1] == '^')) {
+                p++;
+            }
+            p++;
+        }
+
+        /* Handling unterminated string by UNV */
+        /*if (type == -1)
+         {
+         *tail = t = new_Token(NULL, TOK_STRING, line, p-line+1);
+         t->text[p-line] = *line;
+         tail = &t->next;
+         }
+         else */
+        if (type != TOK_COMMENT) {
+            *tail = t = new_Token(NULL, type, line, p - line);
+            tail = &t->next;
+        }
+        line = p;
+    }
+    return list;
+}
+
+/*
+ * this function allocates a new managed block of memory and
+ * returns a pointer to the block.  The managed blocks are
+ * deleted only all at once by the delete_Blocks function.
+ */
+static void *new_Block(size_t size)
+{
+    Blocks *b = &blocks;
+
+    /* first, get to the end of the linked list */
+    while (b->next)
+        b = b->next;
+    /* now allocate the requested chunk */
+    b->chunk = nasm_malloc(size);
+
+    /* now allocate a new block for the next request */
+    b->next = nasm_malloc(sizeof(Blocks));
+    /* and initialize the contents of the new block */
+    b->next->next = NULL;
+    b->next->chunk = NULL;
+    return b->chunk;
+}
+
+/*
+ * this function deletes all managed blocks of memory
+ */
+static void delete_Blocks(void)
+{
+    Blocks *a, *b = &blocks;
+
+    /*
+     * keep in mind that the first block, pointed to by blocks
+     * is a static and not dynamically allocated, so we don't
+     * free it.
+     */
+    while (b) {
+        if (b->chunk)
+            nasm_free(b->chunk);
+        a = b;
+        b = b->next;
+        if (a != &blocks)
+            nasm_free(a);
+    }
+}
+
+/*
+ *  this function creates a new Token and passes a pointer to it
+ *  back to the caller.  It sets the type and text elements, and
+ *  also the a.mac and next elements to NULL.
+ */
+static Token *new_Token(Token * next, enum pp_token_type type,
+                       const char *text, int txtlen)
+{
+    Token *t;
+    int i;
+
+    if (!freeTokens) {
+        freeTokens = (Token *) new_Block(TOKEN_BLOCKSIZE * sizeof(Token));
+        for (i = 0; i < TOKEN_BLOCKSIZE - 1; i++)
+            freeTokens[i].next = &freeTokens[i + 1];
+        freeTokens[i].next = NULL;
+    }
+    t = freeTokens;
+    freeTokens = t->next;
+    t->next = next;
+    t->a.mac = NULL;
+    t->type = type;
+    if (type == TOK_WHITESPACE || !text) {
+        t->text = NULL;
+    } else {
+        if (txtlen == 0)
+            txtlen = strlen(text);
+        t->text = nasm_malloc(txtlen+1);
+        memcpy(t->text, text, txtlen);
+        t->text[txtlen] = '\0';
+    }
+    return t;
+}
+
+static Token *delete_Token(Token * t)
+{
+    Token *next = t->next;
+    nasm_free(t->text);
+    t->next = freeTokens;
+    freeTokens = t;
+    return next;
+}
+
+/*
+ * Convert a line of tokens back into text.
+ * If expand_locals is not zero, identifiers of the form "%$*xxx"
+ * will be transformed into ..@ctxnum.xxx
+ */
+static char *detoken(Token * tlist, bool expand_locals)
+{
+    Token *t;
+    int len;
+    char *line, *p;
+    const char *q;
+
+    len = 0;
+    for (t = tlist; t; t = t->next) {
+        if (t->type == TOK_PREPROC_ID && t->text[1] == '!') {
+            char *p = getenv(t->text + 2);
+            nasm_free(t->text);
+            if (p)
+                t->text = nasm_strdup(p);
+            else
+                t->text = NULL;
+        }
+        /* Expand local macros here and not during preprocessing */
+        if (expand_locals &&
+            t->type == TOK_PREPROC_ID && t->text &&
+            t->text[0] == '%' && t->text[1] == '$') {
+           const char *q;
+           char *p;
+            Context *ctx = get_ctx(t->text, &q, false);
+            if (ctx) {
+                char buffer[40];
+                snprintf(buffer, sizeof(buffer), "..@%"PRIu32".", ctx->number);
+                p = nasm_strcat(buffer, q);
+                nasm_free(t->text);
+                t->text = p;
+            }
+        }
+        if (t->type == TOK_WHITESPACE) {
+            len++;
+        } else if (t->text) {
+            len += strlen(t->text);
+        }
+    }
+    p = line = nasm_malloc(len + 1);
+    for (t = tlist; t; t = t->next) {
+        if (t->type == TOK_WHITESPACE) {
+            *p++ = ' ';
+        } else if (t->text) {
+           q = t->text;
+           while (*q)
+               *p++ = *q++;
+        }
+    }
+    *p = '\0';
+    return line;
+}
+
+/*
+ * A scanner, suitable for use by the expression evaluator, which
+ * operates on a line of Tokens. Expects a pointer to a pointer to
+ * the first token in the line to be passed in as its private_data
+ * field.
+ *
+ * FIX: This really needs to be unified with stdscan.
+ */
+static int ppscan(void *private_data, struct tokenval *tokval)
+{
+    Token **tlineptr = private_data;
+    Token *tline;
+    char ourcopy[MAX_KEYWORD+1], *p, *r, *s;
+
+    do {
+        tline = *tlineptr;
+        *tlineptr = tline ? tline->next : NULL;
+    }
+    while (tline && (tline->type == TOK_WHITESPACE ||
+                     tline->type == TOK_COMMENT));
+
+    if (!tline)
+        return tokval->t_type = TOKEN_EOS;
+
+    tokval->t_charptr = tline->text;
+
+    if (tline->text[0] == '$' && !tline->text[1])
+        return tokval->t_type = TOKEN_HERE;
+    if (tline->text[0] == '$' && tline->text[1] == '$' && !tline->text[2])
+        return tokval->t_type = TOKEN_BASE;
+
+    if (tline->type == TOK_ID) {
+        p = tokval->t_charptr = tline->text;
+        if (p[0] == '$') {
+            tokval->t_charptr++;
+            return tokval->t_type = TOKEN_ID;
+        }
+
+        for (r = p, s = ourcopy; *r; r++) {
+           if (r >= p+MAX_KEYWORD)
+               return tokval->t_type = TOKEN_ID; /* Not a keyword */
+            *s++ = nasm_tolower(*r);
+       }
+        *s = '\0';
+        /* right, so we have an identifier sitting in temp storage. now,
+         * is it actually a register or instruction name, or what? */
+       return nasm_token_hash(ourcopy, tokval);
+    }
+
+    if (tline->type == TOK_NUMBER) {
+       bool rn_error;
+       tokval->t_integer = readnum(tline->text, &rn_error);
+       tokval->t_charptr = tline->text;
+       if (rn_error)
+           return tokval->t_type = TOKEN_ERRNUM;
+       else
+           return tokval->t_type = TOKEN_NUM;
+    }
+
+    if (tline->type == TOK_FLOAT) {
+       return tokval->t_type = TOKEN_FLOAT;
+    }
+
+    if (tline->type == TOK_STRING) {
+       char bq, *ep;
+
+       bq = tline->text[0];
+        tokval->t_charptr = tline->text;
+        tokval->t_inttwo = nasm_unquote(tline->text, &ep);
+
+       if (ep[0] != bq || ep[1] != '\0')
+           return tokval->t_type = TOKEN_ERRSTR;
+       else
+           return tokval->t_type = TOKEN_STR;
+    }
+
+    if (tline->type == TOK_OTHER) {
+        if (!strcmp(tline->text, "<<"))
+            return tokval->t_type = TOKEN_SHL;
+        if (!strcmp(tline->text, ">>"))
+            return tokval->t_type = TOKEN_SHR;
+        if (!strcmp(tline->text, "//"))
+            return tokval->t_type = TOKEN_SDIV;
+        if (!strcmp(tline->text, "%%"))
+            return tokval->t_type = TOKEN_SMOD;
+        if (!strcmp(tline->text, "=="))
+            return tokval->t_type = TOKEN_EQ;
+        if (!strcmp(tline->text, "<>"))
+            return tokval->t_type = TOKEN_NE;
+        if (!strcmp(tline->text, "!="))
+            return tokval->t_type = TOKEN_NE;
+        if (!strcmp(tline->text, "<="))
+            return tokval->t_type = TOKEN_LE;
+        if (!strcmp(tline->text, ">="))
+            return tokval->t_type = TOKEN_GE;
+        if (!strcmp(tline->text, "&&"))
+            return tokval->t_type = TOKEN_DBL_AND;
+        if (!strcmp(tline->text, "^^"))
+            return tokval->t_type = TOKEN_DBL_XOR;
+        if (!strcmp(tline->text, "||"))
+            return tokval->t_type = TOKEN_DBL_OR;
+    }
+
+    /*
+     * We have no other options: just return the first character of
+     * the token text.
+     */
+    return tokval->t_type = tline->text[0];
+}
+
+/*
+ * Compare a string to the name of an existing macro; this is a
+ * simple wrapper which calls either strcmp or nasm_stricmp
+ * depending on the value of the `casesense' parameter.
+ */
+static int mstrcmp(const char *p, const char *q, bool casesense)
+{
+    return casesense ? strcmp(p, q) : nasm_stricmp(p, q);
+}
+
+/*
+ * Compare a string to the name of an existing macro; this is a
+ * simple wrapper which calls either strcmp or nasm_stricmp
+ * depending on the value of the `casesense' parameter.
+ */
+static int mmemcmp(const char *p, const char *q, size_t l, bool casesense)
+{
+    return casesense ? memcmp(p, q, l) : nasm_memicmp(p, q, l);
+}
+
+/*
+ * Return the Context structure associated with a %$ token. Return
+ * NULL, having _already_ reported an error condition, if the
+ * context stack isn't deep enough for the supplied number of $
+ * signs.
+ * If all_contexts == true, contexts that enclose current are
+ * also scanned for such smacro, until it is found; if not -
+ * only the context that directly results from the number of $'s
+ * in variable's name.
+ *
+ * If "namep" is non-NULL, set it to the pointer to the macro name
+ * tail, i.e. the part beyond %$...
+ */
+static Context *get_ctx(const char *name, const char **namep,
+                       bool all_contexts)
+{
+    Context *ctx;
+    SMacro *m;
+    int i;
+
+    if (namep)
+       *namep = name;
+
+    if (!name || name[0] != '%' || name[1] != '$')
+        return NULL;
+
+    if (!cstk) {
+        error(ERR_NONFATAL, "`%s': context stack is empty", name);
+        return NULL;
+    }
+
+    name += 2;
+    ctx = cstk;
+    i = 0;
+    while (ctx && *name == '$') {
+       name++;
+       i++;
+       ctx = ctx->next;
+    }
+    if (!ctx) {
+        error(ERR_NONFATAL, "`%s': context stack is only"
+              " %d level%s deep", name, i, (i == 1 ? "" : "s"));
+        return NULL;
+    }
+
+    if (namep)
+       *namep = name;
+
+    if (!all_contexts)
+        return ctx;
+
+    do {
+        /* Search for this smacro in found context */
+        m = hash_findix(&ctx->localmac, name);
+        while (m) {
+            if (!mstrcmp(m->name, name, m->casesense))
+                return ctx;
+            m = m->next;
+        }
+        ctx = ctx->next;
+    }
+    while (ctx);
+    return NULL;
+}
+
+/*
+ * Check to see if a file is already in a string list
+ */
+static bool in_list(const StrList *list, const char *str)
+{
+    while (list) {
+       if (!strcmp(list->str, str))
+           return true;
+       list = list->next;
+    }
+    return false;
+}
+
+/*
+ * Open an include file. This routine must always return a valid
+ * file pointer if it returns - it's responsible for throwing an
+ * ERR_FATAL and bombing out completely if not. It should also try
+ * the include path one by one until it finds the file or reaches
+ * the end of the path.
+ */
+static FILE *inc_fopen(const char *file, StrList **dhead, StrList ***dtail,
+                      bool missing_ok)
+{
+    FILE *fp;
+    char *prefix = "";
+    IncPath *ip = ipath;
+    int len = strlen(file);
+    size_t prefix_len = 0;
+    StrList *sl;
+
+    while (1) {
+        sl = nasm_malloc(prefix_len+len+1+sizeof sl->next);
+       memcpy(sl->str, prefix, prefix_len);
+       memcpy(sl->str+prefix_len, file, len+1);
+        fp = fopen(sl->str, "r");
+       if (fp && dhead && !in_list(*dhead, sl->str)) {
+           sl->next = NULL;
+           **dtail = sl;
+           *dtail = &sl->next;
+        } else {
+           nasm_free(sl);
+       }
+        if (fp)
+            return fp;
+       if (!ip) {
+           if (!missing_ok)
+               break;
+           prefix = NULL;
+       } else {
+           prefix = ip->path;
+           ip = ip->next;
+       }
+       if (prefix) {
+           prefix_len = strlen(prefix);
+       } else {
+           /* -MG given and file not found */
+           if (dhead && !in_list(*dhead, file)) {
+               sl = nasm_malloc(len+1+sizeof sl->next);
+               sl->next = NULL;
+               strcpy(sl->str, file);
+               **dtail = sl;
+               *dtail = &sl->next;
+           }
+           return NULL;
+       }
+    }
+
+    error(ERR_FATAL, "unable to open include file `%s'", file);
+    return NULL;                /* never reached - placate compilers */
+}
+
+/*
+ * Determine if we should warn on defining a single-line macro of
+ * name `name', with `nparam' parameters. If nparam is 0 or -1, will
+ * return true if _any_ single-line macro of that name is defined.
+ * Otherwise, will return true if a single-line macro with either
+ * `nparam' or no parameters is defined.
+ *
+ * If a macro with precisely the right number of parameters is
+ * defined, or nparam is -1, the address of the definition structure
+ * will be returned in `defn'; otherwise NULL will be returned. If `defn'
+ * is NULL, no action will be taken regarding its contents, and no
+ * error will occur.
+ *
+ * Note that this is also called with nparam zero to resolve
+ * `ifdef'.
+ *
+ * If you already know which context macro belongs to, you can pass
+ * the context pointer as first parameter; if you won't but name begins
+ * with %$ the context will be automatically computed. If all_contexts
+ * is true, macro will be searched in outer contexts as well.
+ */
+static bool
+smacro_defined(Context * ctx, const char *name, int nparam, SMacro ** defn,
+               bool nocase)
+{
+    struct hash_table *smtbl;
+    SMacro *m;
+
+    if (ctx) {
+       smtbl = &ctx->localmac;
+    } else if (name[0] == '%' && name[1] == '$') {
+       if (cstk)
+            ctx = get_ctx(name, &name, false);
+        if (!ctx)
+            return false;       /* got to return _something_ */
+       smtbl = &ctx->localmac;
+    } else {
+       smtbl = &smacros;
+    }
+    m = (SMacro *) hash_findix(smtbl, name);
+
+    while (m) {
+        if (!mstrcmp(m->name, name, m->casesense && nocase) &&
+            (nparam <= 0 || m->nparam == 0 || nparam == (int) m->nparam)) {
+            if (defn) {
+                if (nparam == (int) m->nparam || nparam == -1)
+                    *defn = m;
+                else
+                    *defn = NULL;
+            }
+            return true;
+        }
+        m = m->next;
+    }
+
+    return false;
+}
+
+/*
+ * Count and mark off the parameters in a multi-line macro call.
+ * This is called both from within the multi-line macro expansion
+ * code, and also to mark off the default parameters when provided
+ * in a %macro definition line.
+ */
+static void count_mmac_params(Token * t, int *nparam, Token *** params)
+{
+    int paramsize, brace;
+
+    *nparam = paramsize = 0;
+    *params = NULL;
+    while (t) {
+       /* +1: we need space for the final NULL */
+        if (*nparam+1 >= paramsize) {
+            paramsize += PARAM_DELTA;
+            *params = nasm_realloc(*params, sizeof(**params) * paramsize);
+        }
+        skip_white_(t);
+        brace = false;
+        if (tok_is_(t, "{"))
+            brace = true;
+        (*params)[(*nparam)++] = t;
+        while (tok_isnt_(t, brace ? "}" : ","))
+            t = t->next;
+        if (t) {                /* got a comma/brace */
+            t = t->next;
+            if (brace) {
+                /*
+                 * Now we've found the closing brace, look further
+                 * for the comma.
+                 */
+                skip_white_(t);
+                if (tok_isnt_(t, ",")) {
+                    error(ERR_NONFATAL,
+                          "braces do not enclose all of macro parameter");
+                    while (tok_isnt_(t, ","))
+                        t = t->next;
+                }
+                if (t)
+                    t = t->next;        /* eat the comma */
+            }
+        }
+    }
+}
+
+/*
+ * Determine whether one of the various `if' conditions is true or
+ * not.
+ *
+ * We must free the tline we get passed.
+ */
+static bool if_condition(Token * tline, enum preproc_token ct)
+{
+    enum pp_conditional i = PP_COND(ct);
+    bool j;
+    Token *t, *tt, **tptr, *origline;
+    struct tokenval tokval;
+    expr *evalresult;
+    enum pp_token_type needtype;
+
+    origline = tline;
+
+    switch (i) {
+    case PPC_IFCTX:
+        j = false;              /* have we matched yet? */
+        while (true) {
+            skip_white_(tline);
+            if (!tline)
+                break;
+            if (tline->type != TOK_ID) {
+                error(ERR_NONFATAL,
+                      "`%s' expects context identifiers", pp_directives[ct]);
+                free_tlist(origline);
+                return -1;
+            }
+            if (cstk && cstk->name && !nasm_stricmp(tline->text, cstk->name))
+                j = true;
+            tline = tline->next;
+        }
+       break;
+
+    case PPC_IFDEF:
+        j = false;              /* have we matched yet? */
+        while (tline) {
+            skip_white_(tline);
+            if (!tline || (tline->type != TOK_ID &&
+                           (tline->type != TOK_PREPROC_ID ||
+                            tline->text[1] != '$'))) {
+                error(ERR_NONFATAL,
+                      "`%s' expects macro identifiers", pp_directives[ct]);
+               goto fail;
+            }
+            if (smacro_defined(NULL, tline->text, 0, NULL, true))
+                j = true;
+            tline = tline->next;
+        }
+       break;
+
+    case PPC_IFIDN:
+    case PPC_IFIDNI:
+        tline = expand_smacro(tline);
+        t = tt = tline;
+        while (tok_isnt_(tt, ","))
+            tt = tt->next;
+        if (!tt) {
+            error(ERR_NONFATAL,
+                  "`%s' expects two comma-separated arguments",
+                  pp_directives[ct]);
+           goto fail;
+        }
+        tt = tt->next;
+        j = true;               /* assume equality unless proved not */
+        while ((t->type != TOK_OTHER || strcmp(t->text, ",")) && tt) {
+            if (tt->type == TOK_OTHER && !strcmp(tt->text, ",")) {
+                error(ERR_NONFATAL, "`%s': more than one comma on line",
+                      pp_directives[ct]);
+               goto fail;
+            }
+            if (t->type == TOK_WHITESPACE) {
+                t = t->next;
+                continue;
+            }
+            if (tt->type == TOK_WHITESPACE) {
+                tt = tt->next;
+                continue;
+            }
+            if (tt->type != t->type) {
+                j = false;      /* found mismatching tokens */
+                break;
+            }
+            /* When comparing strings, need to unquote them first */
+            if (t->type == TOK_STRING) {
+               size_t l1 = nasm_unquote(t->text, NULL);
+               size_t l2 = nasm_unquote(tt->text, NULL);
+
+               if (l1 != l2) {
+                   j = false;
+                   break;
+               }
+               if (mmemcmp(t->text, tt->text, l1, i == PPC_IFIDN)) {
+                   j = false;
+                   break;
+               }
+            } else if (mstrcmp(tt->text, t->text, i == PPC_IFIDN) != 0) {
+                j = false;      /* found mismatching tokens */
+                break;
+            }
+
+            t = t->next;
+            tt = tt->next;
+        }
+        if ((t->type != TOK_OTHER || strcmp(t->text, ",")) || tt)
+            j = false;          /* trailing gunk on one end or other */
+       break;
+
+    case PPC_IFMACRO:
+    {
+       bool found = false;
+       MMacro searching, *mmac;
+
+       skip_white_(tline);
+       tline = expand_id(tline);
+       if (!tok_type_(tline, TOK_ID)) {
+           error(ERR_NONFATAL,
+                 "`%s' expects a macro name", pp_directives[ct]);
+           goto fail;
+       }
+       searching.name = nasm_strdup(tline->text);
+       searching.casesense = true;
+       searching.plus = false;
+       searching.nolist = false;
+       searching.in_progress = 0;
+       searching.max_depth = 0;
+       searching.rep_nest = NULL;
+       searching.nparam_min = 0;
+       searching.nparam_max = INT_MAX;
+       tline = expand_smacro(tline->next);
+       skip_white_(tline);
+       if (!tline) {
+       } else if (!tok_type_(tline, TOK_NUMBER)) {
+           error(ERR_NONFATAL,
+                 "`%s' expects a parameter count or nothing",
+                 pp_directives[ct]);
+       } else {
+           searching.nparam_min = searching.nparam_max =
+               readnum(tline->text, &j);
+           if (j)
+               error(ERR_NONFATAL,
+                     "unable to parse parameter count `%s'",
+                     tline->text);
+       }
+       if (tline && tok_is_(tline->next, "-")) {
+           tline = tline->next->next;
+           if (tok_is_(tline, "*"))
+               searching.nparam_max = INT_MAX;
+           else if (!tok_type_(tline, TOK_NUMBER))
+               error(ERR_NONFATAL,
+                     "`%s' expects a parameter count after `-'",
+                     pp_directives[ct]);
+           else {
+               searching.nparam_max = readnum(tline->text, &j);
+               if (j)
+                   error(ERR_NONFATAL,
+                         "unable to parse parameter count `%s'",
+                         tline->text);
+               if (searching.nparam_min > searching.nparam_max)
+                   error(ERR_NONFATAL,
+                         "minimum parameter count exceeds maximum");
+           }
+       }
+       if (tline && tok_is_(tline->next, "+")) {
+           tline = tline->next;
+           searching.plus = true;
+       }
+       mmac = (MMacro *) hash_findix(&mmacros, searching.name);
+       while (mmac) {
+           if (!strcmp(mmac->name, searching.name) &&
+               (mmac->nparam_min <= searching.nparam_max
+                || searching.plus)
+               && (searching.nparam_min <= mmac->nparam_max
+                   || mmac->plus)) {
+               found = true;
+               break;
+           }
+           mmac = mmac->next;
+       }
+       if (tline && tline->next)
+           error(ERR_WARNING|ERR_PASS1,
+                 "trailing garbage after %%ifmacro ignored");
+       nasm_free(searching.name);
+       j = found;
+       break;
+    }
+
+    case PPC_IFID:
+       needtype = TOK_ID;
+       goto iftype;
+    case PPC_IFNUM:
+       needtype = TOK_NUMBER;
+       goto iftype;
+    case PPC_IFSTR:
+       needtype = TOK_STRING;
+       goto iftype;
+
+    iftype:
+       t = tline = expand_smacro(tline);
+
+       while (tok_type_(t, TOK_WHITESPACE) ||
+              (needtype == TOK_NUMBER &&
+               tok_type_(t, TOK_OTHER) &&
+               (t->text[0] == '-' || t->text[0] == '+') &&
+               !t->text[1]))
+           t = t->next;
+
+       j = tok_type_(t, needtype);
+       break;
+
+    case PPC_IFTOKEN:
+       t = tline = expand_smacro(tline);
+       while (tok_type_(t, TOK_WHITESPACE))
+           t = t->next;
+
+       j = false;
+       if (t) {
+           t = t->next;        /* Skip the actual token */
+           while (tok_type_(t, TOK_WHITESPACE))
+               t = t->next;
+           j = !t;             /* Should be nothing left */
+       }
+       break;
+
+    case PPC_IFEMPTY:
+       t = tline = expand_smacro(tline);
+       while (tok_type_(t, TOK_WHITESPACE))
+           t = t->next;
+
+       j = !t;                 /* Should be empty */
+       break;
+
+    case PPC_IF:
+        t = tline = expand_smacro(tline);
+        tptr = &t;
+        tokval.t_type = TOKEN_INVALID;
+        evalresult = evaluate(ppscan, tptr, &tokval,
+                              NULL, pass | CRITICAL, error, NULL);
+        if (!evalresult)
+            return -1;
+        if (tokval.t_type)
+            error(ERR_WARNING|ERR_PASS1,
+                  "trailing garbage after expression ignored");
+        if (!is_simple(evalresult)) {
+            error(ERR_NONFATAL,
+                  "non-constant value given to `%s'", pp_directives[ct]);
+           goto fail;
+        }
+        j = reloc_value(evalresult) != 0;
+       break;
+
+    default:
+        error(ERR_FATAL,
+              "preprocessor directive `%s' not yet implemented",
+              pp_directives[ct]);
+       goto fail;
+    }
+
+    free_tlist(origline);
+    return j ^ PP_NEGATIVE(ct);
+
+fail:
+    free_tlist(origline);
+    return -1;
+}
+
+/*
+ * Common code for defining an smacro
+ */
+static bool define_smacro(Context *ctx, const char *mname, bool casesense,
+                         int nparam, Token *expansion)
+{
+    SMacro *smac, **smhead;
+    struct hash_table *smtbl;
+
+    if (smacro_defined(ctx, mname, nparam, &smac, casesense)) {
+       if (!smac) {
+           error(ERR_WARNING|ERR_PASS1,
+                 "single-line macro `%s' defined both with and"
+                 " without parameters", mname);
+
+           /* Some instances of the old code considered this a failure,
+              some others didn't.  What is the right thing to do here? */
+           free_tlist(expansion);
+           return false;       /* Failure */
+       } else {
+           /*
+            * We're redefining, so we have to take over an
+            * existing SMacro structure. This means freeing
+            * what was already in it.
+            */
+           nasm_free(smac->name);
+           free_tlist(smac->expansion);
+       }
+    } else {
+       smtbl  = ctx ? &ctx->localmac : &smacros;
+       smhead = (SMacro **) hash_findi_add(smtbl, mname);
+       smac = nasm_malloc(sizeof(SMacro));
+       smac->next = *smhead;
+       *smhead = smac;
+    }
+    smac->name = nasm_strdup(mname);
+    smac->casesense = casesense;
+    smac->nparam = nparam;
+    smac->expansion = expansion;
+    smac->in_progress = false;
+    return true;               /* Success */
+}
+
+/*
+ * Undefine an smacro
+ */
+static void undef_smacro(Context *ctx, const char *mname)
+{
+    SMacro **smhead, *s, **sp;
+    struct hash_table *smtbl;
+
+    smtbl = ctx ? &ctx->localmac : &smacros;
+    smhead = (SMacro **)hash_findi(smtbl, mname, NULL);
+
+    if (smhead) {
+       /*
+        * We now have a macro name... go hunt for it.
+        */
+       sp = smhead;
+       while ((s = *sp) != NULL) {
+           if (!mstrcmp(s->name, mname, s->casesense)) {
+               *sp = s->next;
+               nasm_free(s->name);
+               free_tlist(s->expansion);
+               nasm_free(s);
+           } else {
+               sp = &s->next;
+           }
+       }
+    }
+}
+
+/*
+ * Parse a mmacro specification.
+ */
+static bool parse_mmacro_spec(Token *tline, MMacro *def, const char *directive)
+{
+    bool err;
+
+    tline = tline->next;
+    skip_white_(tline);
+    tline = expand_id(tline);
+    if (!tok_type_(tline, TOK_ID)) {
+       error(ERR_NONFATAL, "`%s' expects a macro name", directive);
+       return false;
+    }
+
+    def->prev = NULL;
+    def->name = nasm_strdup(tline->text);
+    def->plus = false;
+    def->nolist = false;
+    def->in_progress = 0;
+    def->rep_nest = NULL;
+    def->nparam_min = 0;
+    def->nparam_max = 0;
+
+    tline = expand_smacro(tline->next);
+    skip_white_(tline);
+    if (!tok_type_(tline, TOK_NUMBER)) {
+       error(ERR_NONFATAL, "`%s' expects a parameter count", directive);
+    } else {
+       def->nparam_min = def->nparam_max =
+           readnum(tline->text, &err);
+       if (err)
+           error(ERR_NONFATAL,
+                 "unable to parse parameter count `%s'", tline->text);
+    }
+    if (tline && tok_is_(tline->next, "-")) {
+       tline = tline->next->next;
+       if (tok_is_(tline, "*")) {
+           def->nparam_max = INT_MAX;
+       } else if (!tok_type_(tline, TOK_NUMBER)) {
+           error(ERR_NONFATAL,
+                 "`%s' expects a parameter count after `-'", directive);
+       } else {
+           def->nparam_max = readnum(tline->text, &err);
+           if (err) {
+               error(ERR_NONFATAL, "unable to parse parameter count `%s'",
+                     tline->text);
+           }
+           if (def->nparam_min > def->nparam_max) {
+               error(ERR_NONFATAL, "minimum parameter count exceeds maximum");
+           }
+       }
+    }
+    if (tline && tok_is_(tline->next, "+")) {
+       tline = tline->next;
+       def->plus = true;
+    }
+    if (tline && tok_type_(tline->next, TOK_ID) &&
+       !nasm_stricmp(tline->next->text, ".nolist")) {
+       tline = tline->next;
+       def->nolist = true;
+    }
+       
+    /*
+     * Handle default parameters.
+     */
+    if (tline && tline->next) {
+       def->dlist = tline->next;
+       tline->next = NULL;
+       count_mmac_params(def->dlist, &def->ndefs, &def->defaults);
+    } else {
+       def->dlist = NULL;
+       def->defaults = NULL;
+    }
+    def->expansion = NULL;
+
+    if (def->defaults && def->ndefs > def->nparam_max - def->nparam_min &&
+       !def->plus)
+       error(ERR_WARNING|ERR_PASS1|ERR_WARN_MDP,
+             "too many default macro parameters");
+
+    return true;
+}
+
+
+/*
+ * Decode a size directive
+ */
+static int parse_size(const char *str) {
+    static const char *size_names[] =
+       { "byte", "dword", "oword", "qword", "tword", "word", "yword" };
+    static const int sizes[] =
+       { 0, 1, 4, 16, 8, 10, 2, 32 };
+
+    return sizes[bsii(str, size_names, elements(size_names))+1];
+}
+
+/*
+ * nasm_unquote with error if the string contains NUL characters.
+ * If the string contains NUL characters, issue an error and return
+ * the C len, i.e. truncate at the NUL.
+ */
+static size_t nasm_unquote_cstr(char *qstr, enum preproc_token directive)
+{
+    size_t len = nasm_unquote(qstr, NULL);
+    size_t clen = strlen(qstr);
+
+    if (len != clen)
+       error(ERR_NONFATAL, "NUL character in `%s' directive",
+             pp_directives[directive]);
+
+    return clen;
+}
+
+/**
+ * find and process preprocessor directive in passed line
+ * Find out if a line contains a preprocessor directive, and deal
+ * with it if so.
+ *
+ * If a directive _is_ found, it is the responsibility of this routine
+ * (and not the caller) to free_tlist() the line.
+ *
+ * @param tline a pointer to the current tokeninzed line linked list
+ * @return DIRECTIVE_FOUND or NO_DIRECTIVE_FOUND
+ *
+ */
+static int do_directive(Token * tline)
+{
+    enum preproc_token i;
+    int j;
+    bool err;
+    int nparam;
+    bool nolist;
+    bool casesense;
+    int k, m;
+    int offset;
+    char *p, *pp;
+    const char *mname;
+    Include *inc;
+    Context *ctx;
+    Cond *cond;
+    MMacro *mmac, **mmhead;
+    Token *t, *tt, *param_start, *macro_start, *last, **tptr, *origline;
+    Line *l;
+    struct tokenval tokval;
+    expr *evalresult;
+    MMacro *tmp_defining;       /* Used when manipulating rep_nest */
+    int64_t count;
+    size_t len;
+    int severity;
+
+    origline = tline;
+
+    skip_white_(tline);
+    if (!tline || !tok_type_(tline, TOK_PREPROC_ID) ||
+        (tline->text[1] == '%' || tline->text[1] == '$'
+         || tline->text[1] == '!'))
+        return NO_DIRECTIVE_FOUND;
+
+    i = pp_token_hash(tline->text);
+
+    /*
+     * If we're in a non-emitting branch of a condition construct,
+     * or walking to the end of an already terminated %rep block,
+     * we should ignore all directives except for condition
+     * directives.
+     */
+    if (((istk->conds && !emitting(istk->conds->state)) ||
+         (istk->mstk && !istk->mstk->in_progress)) && !is_condition(i)) {
+        return NO_DIRECTIVE_FOUND;
+    }
+
+    /*
+     * If we're defining a macro or reading a %rep block, we should
+     * ignore all directives except for %macro/%imacro (which nest),
+     * %endm/%endmacro, and (only if we're in a %rep block) %endrep.
+     * If we're in a %rep block, another %rep nests, so should be let through.
+     */
+    if (defining && i != PP_MACRO && i != PP_IMACRO &&
+       i != PP_RMACRO &&  i != PP_IRMACRO &&
+        i != PP_ENDMACRO && i != PP_ENDM &&
+        (defining->name || (i != PP_ENDREP && i != PP_REP))) {
+        return NO_DIRECTIVE_FOUND;
+    }
+
+    if (defining) {
+        if (i == PP_MACRO || i == PP_IMACRO ||
+           i == PP_RMACRO || i == PP_IRMACRO) {
+            nested_mac_count++;
+            return NO_DIRECTIVE_FOUND;
+        } else if (nested_mac_count > 0) {
+            if (i == PP_ENDMACRO) {
+                nested_mac_count--;
+                return NO_DIRECTIVE_FOUND;
+            }
+        }
+        if (!defining->name) {
+            if (i == PP_REP) {
+                nested_rep_count++;
+                return NO_DIRECTIVE_FOUND;
+            } else if (nested_rep_count > 0) {
+                if (i == PP_ENDREP) {
+                    nested_rep_count--;
+                    return NO_DIRECTIVE_FOUND;
+                }
+            }
+        }
+    }
+
+    switch (i) {
+    case PP_INVALID:
+        error(ERR_NONFATAL, "unknown preprocessor directive `%s'",
+              tline->text);
+        return NO_DIRECTIVE_FOUND;      /* didn't get it */
+
+    case PP_STACKSIZE:
+        /* Directive to tell NASM what the default stack size is. The
+         * default is for a 16-bit stack, and this can be overriden with
+         * %stacksize large.
+         * the following form:
+         *
+         *      ARG arg1:WORD, arg2:DWORD, arg4:QWORD
+         */
+        tline = tline->next;
+        if (tline && tline->type == TOK_WHITESPACE)
+            tline = tline->next;
+        if (!tline || tline->type != TOK_ID) {
+            error(ERR_NONFATAL, "`%%stacksize' missing size parameter");
+            free_tlist(origline);
+            return DIRECTIVE_FOUND;
+        }
+        if (nasm_stricmp(tline->text, "flat") == 0) {
+            /* All subsequent ARG directives are for a 32-bit stack */
+            StackSize = 4;
+            StackPointer = "ebp";
+            ArgOffset = 8;
+            LocalOffset = 0;
+        } else if (nasm_stricmp(tline->text, "flat64") == 0) {
+            /* All subsequent ARG directives are for a 64-bit stack */
+            StackSize = 8;
+            StackPointer = "rbp";
+            ArgOffset = 8;
+            LocalOffset = 0;
+        } else if (nasm_stricmp(tline->text, "large") == 0) {
+            /* All subsequent ARG directives are for a 16-bit stack,
+             * far function call.
+             */
+            StackSize = 2;
+            StackPointer = "bp";
+            ArgOffset = 4;
+            LocalOffset = 0;
+        } else if (nasm_stricmp(tline->text, "small") == 0) {
+            /* All subsequent ARG directives are for a 16-bit stack,
+             * far function call. We don't support near functions.
+             */
+            StackSize = 2;
+            StackPointer = "bp";
+            ArgOffset = 6;
+            LocalOffset = 0;
+        } else {
+            error(ERR_NONFATAL, "`%%stacksize' invalid size type");
+            free_tlist(origline);
+            return DIRECTIVE_FOUND;
+        }
+        free_tlist(origline);
+        return DIRECTIVE_FOUND;
+
+    case PP_ARG:
+        /* TASM like ARG directive to define arguments to functions, in
+         * the following form:
+         *
+         *      ARG arg1:WORD, arg2:DWORD, arg4:QWORD
+         */
+        offset = ArgOffset;
+        do {
+            char *arg, directive[256];
+            int size = StackSize;
+
+            /* Find the argument name */
+            tline = tline->next;
+            if (tline && tline->type == TOK_WHITESPACE)
+                tline = tline->next;
+            if (!tline || tline->type != TOK_ID) {
+                error(ERR_NONFATAL, "`%%arg' missing argument parameter");
+                free_tlist(origline);
+                return DIRECTIVE_FOUND;
+            }
+            arg = tline->text;
+
+            /* Find the argument size type */
+            tline = tline->next;
+            if (!tline || tline->type != TOK_OTHER
+                || tline->text[0] != ':') {
+                error(ERR_NONFATAL,
+                      "Syntax error processing `%%arg' directive");
+                free_tlist(origline);
+                return DIRECTIVE_FOUND;
+            }
+            tline = tline->next;
+            if (!tline || tline->type != TOK_ID) {
+                error(ERR_NONFATAL, "`%%arg' missing size type parameter");
+                free_tlist(origline);
+                return DIRECTIVE_FOUND;
+            }
+
+            /* Allow macro expansion of type parameter */
+            tt = tokenize(tline->text);
+            tt = expand_smacro(tt);
+           size = parse_size(tt->text);
+           if (!size) {
+                error(ERR_NONFATAL,
+                      "Invalid size type for `%%arg' missing directive");
+                free_tlist(tt);
+                free_tlist(origline);
+                return DIRECTIVE_FOUND;
+            }
+            free_tlist(tt);
+
+           /* Round up to even stack slots */
+           size = (size+StackSize-1) & ~(StackSize-1);
+
+            /* Now define the macro for the argument */
+            snprintf(directive, sizeof(directive), "%%define %s (%s+%d)",
+                     arg, StackPointer, offset);
+            do_directive(tokenize(directive));
+            offset += size;
+
+            /* Move to the next argument in the list */
+            tline = tline->next;
+            if (tline && tline->type == TOK_WHITESPACE)
+                tline = tline->next;
+        } while (tline && tline->type == TOK_OTHER && tline->text[0] == ',');
+       ArgOffset = offset;
+        free_tlist(origline);
+        return DIRECTIVE_FOUND;
+
+    case PP_LOCAL:
+        /* TASM like LOCAL directive to define local variables for a
+         * function, in the following form:
+         *
+         *      LOCAL local1:WORD, local2:DWORD, local4:QWORD = LocalSize
+         *
+         * The '= LocalSize' at the end is ignored by NASM, but is
+         * required by TASM to define the local parameter size (and used
+         * by the TASM macro package).
+         */
+        offset = LocalOffset;
+        do {
+            char *local, directive[256];
+            int size = StackSize;
+
+            /* Find the argument name */
+            tline = tline->next;
+            if (tline && tline->type == TOK_WHITESPACE)
+                tline = tline->next;
+            if (!tline || tline->type != TOK_ID) {
+                error(ERR_NONFATAL,
+                      "`%%local' missing argument parameter");
+                free_tlist(origline);
+                return DIRECTIVE_FOUND;
+            }
+            local = tline->text;
+
+            /* Find the argument size type */
+            tline = tline->next;
+            if (!tline || tline->type != TOK_OTHER
+                || tline->text[0] != ':') {
+                error(ERR_NONFATAL,
+                      "Syntax error processing `%%local' directive");
+                free_tlist(origline);
+                return DIRECTIVE_FOUND;
+            }
+            tline = tline->next;
+            if (!tline || tline->type != TOK_ID) {
+                error(ERR_NONFATAL,
+                      "`%%local' missing size type parameter");
+                free_tlist(origline);
+                return DIRECTIVE_FOUND;
+            }
+
+            /* Allow macro expansion of type parameter */
+            tt = tokenize(tline->text);
+            tt = expand_smacro(tt);
+           size = parse_size(tt->text);
+           if (!size) {
+                error(ERR_NONFATAL,
+                      "Invalid size type for `%%local' missing directive");
+                free_tlist(tt);
+                free_tlist(origline);
+                return DIRECTIVE_FOUND;
+            }
+            free_tlist(tt);
+
+           /* Round up to even stack slots */
+           size = (size+StackSize-1) & ~(StackSize-1);
+
+            offset += size;    /* Negative offset, increment before */
+
+           /* Now define the macro for the argument */
+            snprintf(directive, sizeof(directive), "%%define %s (%s-%d)",
+                     local, StackPointer, offset);
+            do_directive(tokenize(directive));
+
+            /* Now define the assign to setup the enter_c macro correctly */
+            snprintf(directive, sizeof(directive),
+                     "%%assign %%$localsize %%$localsize+%d", size);
+            do_directive(tokenize(directive));
+
+            /* Move to the next argument in the list */
+            tline = tline->next;
+            if (tline && tline->type == TOK_WHITESPACE)
+                tline = tline->next;
+        } while (tline && tline->type == TOK_OTHER && tline->text[0] == ',');
+       LocalOffset = offset;
+        free_tlist(origline);
+        return DIRECTIVE_FOUND;
+
+    case PP_CLEAR:
+        if (tline->next)
+            error(ERR_WARNING|ERR_PASS1,
+                 "trailing garbage after `%%clear' ignored");
+       free_macros();
+       init_macros();
+        free_tlist(origline);
+        return DIRECTIVE_FOUND;
+
+    case PP_DEPEND:
+       t = tline->next = expand_smacro(tline->next);
+        skip_white_(t);
+        if (!t || (t->type != TOK_STRING &&
+                  t->type != TOK_INTERNAL_STRING)) {
+            error(ERR_NONFATAL, "`%%depend' expects a file name");
+            free_tlist(origline);
+            return DIRECTIVE_FOUND;     /* but we did _something_ */
+        }
+        if (t->next)
+            error(ERR_WARNING|ERR_PASS1,
+                  "trailing garbage after `%%depend' ignored");
+       p = t->text;
+        if (t->type != TOK_INTERNAL_STRING)
+           nasm_unquote_cstr(p, i);
+       if (dephead && !in_list(*dephead, p)) {
+           StrList *sl = nasm_malloc(strlen(p)+1+sizeof sl->next);
+           sl->next = NULL;
+           strcpy(sl->str, p);
+           *deptail = sl;
+           deptail = &sl->next;
+       }
+       free_tlist(origline);
+        return DIRECTIVE_FOUND;
+
+    case PP_INCLUDE:
+       t = tline->next = expand_smacro(tline->next);
+        skip_white_(t);
+
+        if (!t || (t->type != TOK_STRING &&
+                  t->type != TOK_INTERNAL_STRING)) {
+            error(ERR_NONFATAL, "`%%include' expects a file name");
+            free_tlist(origline);
+            return DIRECTIVE_FOUND;     /* but we did _something_ */
+        }
+        if (t->next)
+            error(ERR_WARNING|ERR_PASS1,
+                  "trailing garbage after `%%include' ignored");
+       p = t->text;
+        if (t->type != TOK_INTERNAL_STRING)
+           nasm_unquote_cstr(p, i);
+        inc = nasm_malloc(sizeof(Include));
+        inc->next = istk;
+        inc->conds = NULL;
+        inc->fp = inc_fopen(p, dephead, &deptail, pass == 0);
+       if (!inc->fp) {
+           /* -MG given but file not found */
+           nasm_free(inc);
+       } else {
+           inc->fname = src_set_fname(nasm_strdup(p));
+           inc->lineno = src_set_linnum(0);
+           inc->lineinc = 1;
+           inc->expansion = NULL;
+           inc->mstk = NULL;
+           istk = inc;
+           list->uplevel(LIST_INCLUDE);
+       }
+       free_tlist(origline);
+        return DIRECTIVE_FOUND;
+
+    case PP_USE:
+    {
+       static macros_t *use_pkg;
+       const char *pkg_macro;
+
+       tline = tline->next;
+       skip_white_(tline);
+       tline = expand_id(tline);
+
+        if (!tline || (tline->type != TOK_STRING &&
+                      tline->type != TOK_INTERNAL_STRING &&
+                      tline->type != TOK_ID)) {
+            error(ERR_NONFATAL, "`%%use' expects a package name");
+            free_tlist(origline);
+            return DIRECTIVE_FOUND;     /* but we did _something_ */
+       }
+        if (tline->next)
+            error(ERR_WARNING|ERR_PASS1,
+                  "trailing garbage after `%%use' ignored");
+       if (tline->type == TOK_STRING)
+           nasm_unquote_cstr(tline->text, i);
+       use_pkg = nasm_stdmac_find_package(tline->text);
+       if (!use_pkg)
+           error(ERR_NONFATAL, "unknown `%%use' package: %s", tline->text);
+       /* The first string will be <%define>__USE_*__ */
+       pkg_macro = (char *)use_pkg + 1;
+       if (!smacro_defined(NULL, pkg_macro, 0, NULL, true)) {
+           /* Not already included, go ahead and include it */
+           stdmacpos = use_pkg;
+       }
+       free_tlist(origline);
+        return DIRECTIVE_FOUND;
+    }
+    case PP_PUSH:
+    case PP_REPL:
+    case PP_POP:
+        tline = tline->next;
+        skip_white_(tline);
+        tline = expand_id(tline);
+       if (tline) {
+           if (!tok_type_(tline, TOK_ID)) {
+               error(ERR_NONFATAL, "`%s' expects a context identifier",
+                     pp_directives[i]);
+               free_tlist(origline);
+               return DIRECTIVE_FOUND;     /* but we did _something_ */
+           }
+           if (tline->next)
+               error(ERR_WARNING|ERR_PASS1,
+                     "trailing garbage after `%s' ignored",
+                     pp_directives[i]);
+           p = nasm_strdup(tline->text);
+       } else {
+           p = NULL;           /* Anonymous */
+       }
+
+       if (i == PP_PUSH) {
+           ctx = nasm_malloc(sizeof(Context));
+           ctx->next = cstk;
+           hash_init(&ctx->localmac, HASH_SMALL);
+           ctx->name = p;
+           ctx->number = unique++;
+           cstk = ctx;
+       } else {
+           /* %pop or %repl */
+           if (!cstk) {
+               error(ERR_NONFATAL, "`%s': context stack is empty",
+                     pp_directives[i]);
+           } else if (i == PP_POP) {
+               if (p && (!cstk->name || nasm_stricmp(p, cstk->name)))
+                   error(ERR_NONFATAL, "`%%pop' in wrong context: %s, "
+                         "expected %s",
+                         cstk->name ? cstk->name : "anonymous", p);
+               else
+                   ctx_pop();
+           } else {
+               /* i == PP_REPL */
+               nasm_free(cstk->name);
+               cstk->name = p;
+               p = NULL;
+           }
+           nasm_free(p);
+       }
+        free_tlist(origline);
+       return DIRECTIVE_FOUND;
+    case PP_FATAL:
+       severity = ERR_FATAL;
+       goto issue_error;
+    case PP_ERROR:
+       severity = ERR_NONFATAL;
+       goto issue_error;
+    case PP_WARNING:
+       severity = ERR_WARNING|ERR_WARN_USER;
+       goto issue_error;
+
+    issue_error:
+    {
+       /* Only error out if this is the final pass */
+       if (pass != 2 && i != PP_FATAL)
+           return DIRECTIVE_FOUND;
+       
+       tline->next = expand_smacro(tline->next);
+       tline = tline->next;
+       skip_white_(tline);
+       t = tline ? tline->next : NULL;
+       skip_white_(t);
+       if (tok_type_(tline, TOK_STRING) && !t) {
+           /* The line contains only a quoted string */
+           p = tline->text;
+           nasm_unquote(p, NULL); /* Ignore NUL character truncation */
+           error(severity, "%s",  p);
+       } else {
+           /* Not a quoted string, or more than a quoted string */
+           p = detoken(tline, false);
+           error(severity, "%s",  p);
+           nasm_free(p);
+       }
+       free_tlist(origline);
+       return DIRECTIVE_FOUND;
+    }
+
+    CASE_PP_IF:
+        if (istk->conds && !emitting(istk->conds->state))
+            j = COND_NEVER;
+        else {
+            j = if_condition(tline->next, i);
+            tline->next = NULL; /* it got freed */
+            j = j < 0 ? COND_NEVER : j ? COND_IF_TRUE : COND_IF_FALSE;
+        }
+        cond = nasm_malloc(sizeof(Cond));
+        cond->next = istk->conds;
+        cond->state = j;
+        istk->conds = cond;
+               if(istk->mstk)
+            istk->mstk->condcnt ++;
+       free_tlist(origline);
+        return DIRECTIVE_FOUND;
+
+    CASE_PP_ELIF:
+        if (!istk->conds)
+            error(ERR_FATAL, "`%s': no matching `%%if'", pp_directives[i]);
+        switch(istk->conds->state) {
+       case COND_IF_TRUE:
+           istk->conds->state = COND_DONE;
+           break;
+
+       case COND_DONE:
+       case COND_NEVER:
+           break;
+
+       case COND_ELSE_TRUE:
+       case COND_ELSE_FALSE:
+           error_precond(ERR_WARNING|ERR_PASS1,
+                         "`%%elif' after `%%else' ignored");
+           istk->conds->state = COND_NEVER;
+           break;
+
+       case COND_IF_FALSE:
+           /*
+            * IMPORTANT: In the case of %if, we will already have
+            * called expand_mmac_params(); however, if we're
+            * processing an %elif we must have been in a
+            * non-emitting mode, which would have inhibited
+            * the normal invocation of expand_mmac_params().
+            * Therefore, we have to do it explicitly here.
+            */
+           j = if_condition(expand_mmac_params(tline->next), i);
+           tline->next = NULL; /* it got freed */
+           istk->conds->state =
+               j < 0 ? COND_NEVER : j ? COND_IF_TRUE : COND_IF_FALSE;
+           break;
+        }
+       free_tlist(origline);
+        return DIRECTIVE_FOUND;
+
+    case PP_ELSE:
+        if (tline->next)
+            error_precond(ERR_WARNING|ERR_PASS1,
+                         "trailing garbage after `%%else' ignored");
+        if (!istk->conds)
+            error(ERR_FATAL, "`%%else': no matching `%%if'");
+        switch(istk->conds->state) {
+       case COND_IF_TRUE:
+       case COND_DONE:
+           istk->conds->state = COND_ELSE_FALSE;
+           break;
+
+       case COND_NEVER:
+           break;
+
+       case COND_IF_FALSE:
+           istk->conds->state = COND_ELSE_TRUE;
+           break;
+
+       case COND_ELSE_TRUE:
+       case COND_ELSE_FALSE:
+           error_precond(ERR_WARNING|ERR_PASS1,
+                         "`%%else' after `%%else' ignored.");
+           istk->conds->state = COND_NEVER;
+           break;
+        }
+        free_tlist(origline);
+        return DIRECTIVE_FOUND;
+
+    case PP_ENDIF:
+        if (tline->next)
+            error_precond(ERR_WARNING|ERR_PASS1,
+                         "trailing garbage after `%%endif' ignored");
+        if (!istk->conds)
+            error(ERR_FATAL, "`%%endif': no matching `%%if'");
+        cond = istk->conds;
+        istk->conds = cond->next;
+        nasm_free(cond);
+               if(istk->mstk)
+            istk->mstk->condcnt --;
+        free_tlist(origline);
+        return DIRECTIVE_FOUND;
+               
+    case PP_RMACRO:
+    case PP_IRMACRO:
+    case PP_MACRO:
+    case PP_IMACRO:
+        if (defining) {
+            error(ERR_FATAL, "`%s': already defining a macro",
+                 pp_directives[i]);
+           return DIRECTIVE_FOUND;
+       }
+       defining = nasm_malloc(sizeof(MMacro));
+       defining->max_depth =
+           (i == PP_RMACRO) || (i == PP_IRMACRO) ? DEADMAN_LIMIT : 0;
+       defining->casesense = (i == PP_MACRO) || (i == PP_RMACRO);
+       if (!parse_mmacro_spec(tline, defining, pp_directives[i])) {
+           nasm_free(defining);
+           defining = NULL;
+           return DIRECTIVE_FOUND;
+       }
+
+        mmac = (MMacro *) hash_findix(&mmacros, defining->name);
+        while (mmac) {
+            if (!strcmp(mmac->name, defining->name) &&
+                (mmac->nparam_min <= defining->nparam_max
+                 || defining->plus)
+                && (defining->nparam_min <= mmac->nparam_max
+                    || mmac->plus)) {
+                error(ERR_WARNING|ERR_PASS1,
+                      "redefining multi-line macro `%s'", defining->name);
+               return DIRECTIVE_FOUND;
+            }
+            mmac = mmac->next;
+        }
+        free_tlist(origline);
+        return DIRECTIVE_FOUND;
+
+    case PP_ENDM:
+    case PP_ENDMACRO:
+        if (! (defining && defining->name)) {
+            error(ERR_NONFATAL, "`%s': not defining a macro", tline->text);
+            return DIRECTIVE_FOUND;
+        }
+        mmhead = (MMacro **) hash_findi_add(&mmacros, defining->name);
+        defining->next = *mmhead;
+        *mmhead = defining;
+        defining = NULL;
+        free_tlist(origline);
+        return DIRECTIVE_FOUND;
+
+    case PP_EXITMACRO:
+        /*
+         * We must search along istk->expansion until we hit a
+         * macro-end marker for a macro with a name. Then we 
+         * bypass all lines between exitmacro and endmacro.
+         */
+       for (l = istk->expansion; l; l = l->next)
+            if (l->finishes && l->finishes->name)
+               break;
+
+        if (l) {
+           /*
+            * Remove all conditional entries relative to this
+            * macro invocation. (safe to do in this context)
+            */
+            for ( ; l->finishes->condcnt > 0; l->finishes->condcnt --) {
+                cond = istk->conds;
+                istk->conds = cond->next;
+                nasm_free(cond);
+            }
+            istk->expansion = l;
+        } else {
+            error(ERR_NONFATAL, "`%%exitmacro' not within `%%macro' block");
+       }
+        free_tlist(origline);
+        return DIRECTIVE_FOUND;
+
+    case PP_UNMACRO:
+    case PP_UNIMACRO:
+    {
+       MMacro **mmac_p;
+       MMacro spec;
+
+       spec.casesense = (i == PP_UNMACRO);
+       if (!parse_mmacro_spec(tline, &spec, pp_directives[i])) {
+           return DIRECTIVE_FOUND;
+       }
+        mmac_p = (MMacro **) hash_findi(&mmacros, spec.name, NULL);
+        while (mmac_p && *mmac_p) {
+           mmac = *mmac_p;
+            if (mmac->casesense == spec.casesense &&
+               !mstrcmp(mmac->name, spec.name, spec.casesense) &&
+                mmac->nparam_min == spec.nparam_min &&
+                mmac->nparam_max == spec.nparam_max &&
+               mmac->plus == spec.plus) {
+               *mmac_p = mmac->next;
+               free_mmacro(mmac);
+           } else {
+               mmac_p = &mmac->next;
+           }
+       }
+       free_tlist(origline);
+       free_tlist(spec.dlist);
+       return DIRECTIVE_FOUND;
+    }
+
+    case PP_ROTATE:
+        if (tline->next && tline->next->type == TOK_WHITESPACE)
+            tline = tline->next;
+        if (!tline->next) {
+            free_tlist(origline);
+            error(ERR_NONFATAL, "`%%rotate' missing rotate count");
+            return DIRECTIVE_FOUND;
+        }
+        t = expand_smacro(tline->next);
+        tline->next = NULL;
+        free_tlist(origline);
+        tline = t;
+        tptr = &t;
+        tokval.t_type = TOKEN_INVALID;
+        evalresult =
+            evaluate(ppscan, tptr, &tokval, NULL, pass, error, NULL);
+        free_tlist(tline);
+        if (!evalresult)
+            return DIRECTIVE_FOUND;
+        if (tokval.t_type)
+            error(ERR_WARNING|ERR_PASS1,
+                  "trailing garbage after expression ignored");
+        if (!is_simple(evalresult)) {
+            error(ERR_NONFATAL, "non-constant value given to `%%rotate'");
+            return DIRECTIVE_FOUND;
+        }
+        mmac = istk->mstk;
+        while (mmac && !mmac->name)     /* avoid mistaking %reps for macros */
+            mmac = mmac->next_active;
+        if (!mmac) {
+            error(ERR_NONFATAL, "`%%rotate' invoked outside a macro call");
+        } else if (mmac->nparam == 0) {
+            error(ERR_NONFATAL,
+                  "`%%rotate' invoked within macro without parameters");
+        } else {
+           int rotate = mmac->rotate + reloc_value(evalresult);
+
+           rotate %= (int)mmac->nparam;
+           if (rotate < 0)
+               rotate += mmac->nparam;
+
+           mmac->rotate = rotate;
+        }
+        return DIRECTIVE_FOUND;
+
+    case PP_REP:
+        nolist = false;
+        do {
+            tline = tline->next;
+        } while (tok_type_(tline, TOK_WHITESPACE));
+
+        if (tok_type_(tline, TOK_ID) &&
+            nasm_stricmp(tline->text, ".nolist") == 0) {
+            nolist = true;
+            do {
+                tline = tline->next;
+            } while (tok_type_(tline, TOK_WHITESPACE));
+        }
+
+        if (tline) {
+            t = expand_smacro(tline);
+            tptr = &t;
+            tokval.t_type = TOKEN_INVALID;
+            evalresult =
+                evaluate(ppscan, tptr, &tokval, NULL, pass, error, NULL);
+            if (!evalresult) {
+                free_tlist(origline);
+                return DIRECTIVE_FOUND;
+            }
+            if (tokval.t_type)
+                error(ERR_WARNING|ERR_PASS1,
+                      "trailing garbage after expression ignored");
+            if (!is_simple(evalresult)) {
+                error(ERR_NONFATAL, "non-constant value given to `%%rep'");
+                return DIRECTIVE_FOUND;
+            }
+            count = reloc_value(evalresult) + 1;
+        } else {
+            error(ERR_NONFATAL, "`%%rep' expects a repeat count");
+            count = 0;
+        }
+        free_tlist(origline);
+
+        tmp_defining = defining;
+        defining = nasm_malloc(sizeof(MMacro));
+       defining->prev = NULL;
+        defining->name = NULL;  /* flags this macro as a %rep block */
+        defining->casesense = false;
+        defining->plus = false;
+        defining->nolist = nolist;
+        defining->in_progress = count;
+       defining->max_depth = 0;
+        defining->nparam_min = defining->nparam_max = 0;
+        defining->defaults = NULL;
+        defining->dlist = NULL;
+        defining->expansion = NULL;
+        defining->next_active = istk->mstk;
+        defining->rep_nest = tmp_defining;
+        return DIRECTIVE_FOUND;
+
+    case PP_ENDREP:
+        if (!defining || defining->name) {
+            error(ERR_NONFATAL, "`%%endrep': no matching `%%rep'");
+            return DIRECTIVE_FOUND;
+        }
+
+        /*
+         * Now we have a "macro" defined - although it has no name
+         * and we won't be entering it in the hash tables - we must
+         * push a macro-end marker for it on to istk->expansion.
+         * After that, it will take care of propagating itself (a
+         * macro-end marker line for a macro which is really a %rep
+         * block will cause the macro to be re-expanded, complete
+         * with another macro-end marker to ensure the process
+         * continues) until the whole expansion is forcibly removed
+         * from istk->expansion by a %exitrep.
+         */
+        l = nasm_malloc(sizeof(Line));
+        l->next = istk->expansion;
+        l->finishes = defining;
+        l->first = NULL;
+        istk->expansion = l;
+
+        istk->mstk = defining;
+
+        list->uplevel(defining->nolist ? LIST_MACRO_NOLIST : LIST_MACRO);
+        tmp_defining = defining;
+        defining = defining->rep_nest;
+        free_tlist(origline);
+        return DIRECTIVE_FOUND;
+
+    case PP_EXITREP:
+        /*
+         * We must search along istk->expansion until we hit a
+         * macro-end marker for a macro with no name. Then we set
+         * its `in_progress' flag to 0.
+         */
+        for (l = istk->expansion; l; l = l->next)
+            if (l->finishes && !l->finishes->name)
+               break;
+
+        if (l)
+            l->finishes->in_progress = 1;
+        else
+            error(ERR_NONFATAL, "`%%exitrep' not within `%%rep' block");
+        free_tlist(origline);
+        return DIRECTIVE_FOUND;
+
+    case PP_XDEFINE:
+    case PP_IXDEFINE:
+    case PP_DEFINE:
+    case PP_IDEFINE:
+       casesense = (i == PP_DEFINE || i == PP_XDEFINE);
+
+        tline = tline->next;
+        skip_white_(tline);
+        tline = expand_id(tline);
+        if (!tline || (tline->type != TOK_ID &&
+                       (tline->type != TOK_PREPROC_ID ||
+                        tline->text[1] != '$'))) {
+            error(ERR_NONFATAL, "`%s' expects a macro identifier",
+                 pp_directives[i]);
+            free_tlist(origline);
+            return DIRECTIVE_FOUND;
+        }
+
+        ctx = get_ctx(tline->text, &mname, false);
+        last = tline;
+        param_start = tline = tline->next;
+        nparam = 0;
+
+        /* Expand the macro definition now for %xdefine and %ixdefine */
+        if ((i == PP_XDEFINE) || (i == PP_IXDEFINE))
+            tline = expand_smacro(tline);
+
+        if (tok_is_(tline, "(")) {
+            /*
+             * This macro has parameters.
+             */
+
+            tline = tline->next;
+            while (1) {
+                skip_white_(tline);
+                if (!tline) {
+                    error(ERR_NONFATAL, "parameter identifier expected");
+                    free_tlist(origline);
+                    return DIRECTIVE_FOUND;
+                }
+                if (tline->type != TOK_ID) {
+                    error(ERR_NONFATAL,
+                          "`%s': parameter identifier expected",
+                          tline->text);
+                    free_tlist(origline);
+                    return DIRECTIVE_FOUND;
+                }
+                tline->type = TOK_SMAC_PARAM + nparam++;
+                tline = tline->next;
+                skip_white_(tline);
+                if (tok_is_(tline, ",")) {
+                    tline = tline->next;
+                } else {
+                   if (!tok_is_(tline, ")")) {
+                       error(ERR_NONFATAL,
+                             "`)' expected to terminate macro template");
+                       free_tlist(origline);
+                       return DIRECTIVE_FOUND;
+                   }
+                   break;
+               }
+            }
+            last = tline;
+            tline = tline->next;
+        }
+        if (tok_type_(tline, TOK_WHITESPACE))
+            last = tline, tline = tline->next;
+        macro_start = NULL;
+        last->next = NULL;
+        t = tline;
+        while (t) {
+            if (t->type == TOK_ID) {
+                for (tt = param_start; tt; tt = tt->next)
+                    if (tt->type >= TOK_SMAC_PARAM &&
+                        !strcmp(tt->text, t->text))
+                        t->type = tt->type;
+            }
+            tt = t->next;
+            t->next = macro_start;
+            macro_start = t;
+            t = tt;
+        }
+        /*
+         * Good. We now have a macro name, a parameter count, and a
+         * token list (in reverse order) for an expansion. We ought
+         * to be OK just to create an SMacro, store it, and let
+         * free_tlist have the rest of the line (which we have
+         * carefully re-terminated after chopping off the expansion
+         * from the end).
+         */
+        define_smacro(ctx, mname, casesense, nparam, macro_start);
+        free_tlist(origline);
+        return DIRECTIVE_FOUND;
+
+    case PP_UNDEF:
+        tline = tline->next;
+        skip_white_(tline);
+        tline = expand_id(tline);
+        if (!tline || (tline->type != TOK_ID &&
+                       (tline->type != TOK_PREPROC_ID ||
+                        tline->text[1] != '$'))) {
+            error(ERR_NONFATAL, "`%%undef' expects a macro identifier");
+            free_tlist(origline);
+            return DIRECTIVE_FOUND;
+        }
+        if (tline->next) {
+            error(ERR_WARNING|ERR_PASS1,
+                  "trailing garbage after macro name ignored");
+        }
+
+        /* Find the context that symbol belongs to */
+        ctx = get_ctx(tline->text, &mname, false);
+       undef_smacro(ctx, mname);
+       free_tlist(origline);
+        return DIRECTIVE_FOUND;
+
+    case PP_DEFSTR:
+    case PP_IDEFSTR:
+       casesense = (i == PP_DEFSTR);
+
+        tline = tline->next;
+        skip_white_(tline);
+        tline = expand_id(tline);
+        if (!tline || (tline->type != TOK_ID &&
+                       (tline->type != TOK_PREPROC_ID ||
+                        tline->text[1] != '$'))) {
+            error(ERR_NONFATAL, "`%s' expects a macro identifier",
+                 pp_directives[i]);
+            free_tlist(origline);
+            return DIRECTIVE_FOUND;
+        }
+
+        ctx = get_ctx(tline->text, &mname, false);
+        last = tline;
+        tline = expand_smacro(tline->next);
+       last->next = NULL;
+
+        while (tok_type_(tline, TOK_WHITESPACE))
+           tline = delete_Token(tline);
+
+       p = detoken(tline, false);
+        macro_start = nasm_malloc(sizeof(*macro_start));
+        macro_start->next = NULL;
+       macro_start->text = nasm_quote(p, strlen(p));
+       macro_start->type = TOK_STRING;
+        macro_start->a.mac = NULL;
+       nasm_free(p);
+
+        /*
+         * We now have a macro name, an implicit parameter count of
+         * zero, and a string token to use as an expansion. Create
+         * and store an SMacro.
+         */
+       define_smacro(ctx, mname, casesense, 0, macro_start);
+        free_tlist(origline);
+        return DIRECTIVE_FOUND;
+               
+    case PP_DEFTOK:
+    case PP_IDEFTOK:
+       casesense = (i == PP_DEFTOK);
+       
+        tline = tline->next;
+        skip_white_(tline);
+        tline = expand_id(tline);
+        if (!tline || (tline->type != TOK_ID &&
+                       (tline->type != TOK_PREPROC_ID ||
+                        tline->text[1] != '$'))) {
+            error(ERR_NONFATAL,
+                  "`%s' expects a macro identifier as first parameter",
+                 pp_directives[i]);
+            free_tlist(origline);
+            return DIRECTIVE_FOUND;
+        }
+        ctx = get_ctx(tline->text, &mname, false);
+        last = tline;
+        tline = expand_smacro(tline->next);
+        last->next = NULL;
+
+        t = tline;
+        while (tok_type_(t, TOK_WHITESPACE))
+            t = t->next;
+        /* t should now point to the string */
+        if (t->type != TOK_STRING) {
+            error(ERR_NONFATAL,
+                  "`%s` requires string as second parameter",
+                 pp_directives[i]);
+            free_tlist(tline);
+            free_tlist(origline);
+            return DIRECTIVE_FOUND;
+        }
+
+       nasm_unquote_cstr(t->text, i);
+       macro_start = tokenize(t->text);
+       
+        /*
+         * We now have a macro name, an implicit parameter count of
+         * zero, and a numeric token to use as an expansion. Create
+         * and store an SMacro.
+         */
+       define_smacro(ctx, mname, casesense, 0, macro_start);
+        free_tlist(tline);
+        free_tlist(origline);
+        return DIRECTIVE_FOUND;
+
+    case PP_PATHSEARCH:
+    {
+       FILE *fp;
+       StrList *xsl = NULL;
+       StrList **xst = &xsl;
+
+       casesense = true;
+
+        tline = tline->next;
+        skip_white_(tline);
+        tline = expand_id(tline);
+        if (!tline || (tline->type != TOK_ID &&
+                       (tline->type != TOK_PREPROC_ID ||
+                        tline->text[1] != '$'))) {
+            error(ERR_NONFATAL,
+                  "`%%pathsearch' expects a macro identifier as first parameter");
+            free_tlist(origline);
+            return DIRECTIVE_FOUND;
+        }
+        ctx = get_ctx(tline->text, &mname, false);
+        last = tline;
+        tline = expand_smacro(tline->next);
+        last->next = NULL;
+
+       t = tline;
+        while (tok_type_(t, TOK_WHITESPACE))
+            t = t->next;
+
+        if (!t || (t->type != TOK_STRING &&
+                  t->type != TOK_INTERNAL_STRING)) {
+            error(ERR_NONFATAL, "`%%pathsearch' expects a file name");
+           free_tlist(tline);
+            free_tlist(origline);
+            return DIRECTIVE_FOUND;     /* but we did _something_ */
+        }
+        if (t->next)
+            error(ERR_WARNING|ERR_PASS1,
+                  "trailing garbage after `%%pathsearch' ignored");
+       p = t->text;
+        if (t->type != TOK_INTERNAL_STRING)
+           nasm_unquote(p, NULL);
+
+       fp = inc_fopen(p, &xsl, &xst, true);
+       if (fp) {
+           p = xsl->str;
+           fclose(fp);         /* Don't actually care about the file */
+       }
+        macro_start = nasm_malloc(sizeof(*macro_start));
+        macro_start->next = NULL;
+       macro_start->text = nasm_quote(p, strlen(p));
+       macro_start->type = TOK_STRING;
+        macro_start->a.mac = NULL;
+       if (xsl)
+           nasm_free(xsl);
+
+        /*
+         * We now have a macro name, an implicit parameter count of
+         * zero, and a string token to use as an expansion. Create
+         * and store an SMacro.
+         */
+       define_smacro(ctx, mname, casesense, 0, macro_start);
+       free_tlist(tline);
+        free_tlist(origline);
+        return DIRECTIVE_FOUND;
+    }
+
+    case PP_STRLEN:
+       casesense = true;
+
+        tline = tline->next;
+        skip_white_(tline);
+        tline = expand_id(tline);
+        if (!tline || (tline->type != TOK_ID &&
+                       (tline->type != TOK_PREPROC_ID ||
+                        tline->text[1] != '$'))) {
+            error(ERR_NONFATAL,
+                  "`%%strlen' expects a macro identifier as first parameter");
+            free_tlist(origline);
+            return DIRECTIVE_FOUND;
+        }
+        ctx = get_ctx(tline->text, &mname, false);
+        last = tline;
+        tline = expand_smacro(tline->next);
+        last->next = NULL;
+
+        t = tline;
+        while (tok_type_(t, TOK_WHITESPACE))
+            t = t->next;
+        /* t should now point to the string */
+        if (t->type != TOK_STRING) {
+            error(ERR_NONFATAL,
+                  "`%%strlen` requires string as second parameter");
+            free_tlist(tline);
+            free_tlist(origline);
+            return DIRECTIVE_FOUND;
+        }
+
+        macro_start = nasm_malloc(sizeof(*macro_start));
+        macro_start->next = NULL;
+        make_tok_num(macro_start, nasm_unquote(t->text, NULL));
+        macro_start->a.mac = NULL;
+
+        /*
+         * We now have a macro name, an implicit parameter count of
+         * zero, and a numeric token to use as an expansion. Create
+         * and store an SMacro.
+         */
+       define_smacro(ctx, mname, casesense, 0, macro_start);
+        free_tlist(tline);
+        free_tlist(origline);
+        return DIRECTIVE_FOUND;
+
+    case PP_STRCAT:
+       casesense = true;
+
+        tline = tline->next;
+        skip_white_(tline);
+        tline = expand_id(tline);
+        if (!tline || (tline->type != TOK_ID &&
+                       (tline->type != TOK_PREPROC_ID ||
+                        tline->text[1] != '$'))) {
+            error(ERR_NONFATAL,
+                  "`%%strcat' expects a macro identifier as first parameter");
+            free_tlist(origline);
+            return DIRECTIVE_FOUND;
+        }
+        ctx = get_ctx(tline->text, &mname, false);
+        last = tline;
+        tline = expand_smacro(tline->next);
+        last->next = NULL;
+
+       len = 0;
+       for (t = tline; t; t = t->next) {
+           switch (t->type) {
+           case TOK_WHITESPACE:
+               break;
+           case TOK_STRING:
+               len += t->a.len = nasm_unquote(t->text, NULL);
+               break;
+           case TOK_OTHER:
+               if (!strcmp(t->text, ",")) /* permit comma separators */
+                   break;
+               /* else fall through */
+           default:
+               error(ERR_NONFATAL,
+                     "non-string passed to `%%strcat' (%d)", t->type);
+               free_tlist(tline);
+               free_tlist(origline);
+               return DIRECTIVE_FOUND;
+           }
+       }
+
+       p = pp = nasm_malloc(len);
+       for (t = tline; t; t = t->next) {
+           if (t->type == TOK_STRING) {
+               memcpy(p, t->text, t->a.len);
+               p += t->a.len;
+           }
+       }
+
+        /*
+         * We now have a macro name, an implicit parameter count of
+         * zero, and a numeric token to use as an expansion. Create
+         * and store an SMacro.
+         */
+       macro_start = new_Token(NULL, TOK_STRING, NULL, 0);
+       macro_start->text = nasm_quote(pp, len);
+       nasm_free(pp);
+       define_smacro(ctx, mname, casesense, 0, macro_start);
+        free_tlist(tline);
+        free_tlist(origline);
+        return DIRECTIVE_FOUND;
+
+    case PP_SUBSTR:
+    {
+       int64_t a1, a2;
+       size_t len;
+
+       casesense = true;
+
+        tline = tline->next;
+        skip_white_(tline);
+        tline = expand_id(tline);
+        if (!tline || (tline->type != TOK_ID &&
+                       (tline->type != TOK_PREPROC_ID ||
+                        tline->text[1] != '$'))) {
+            error(ERR_NONFATAL,
+                  "`%%substr' expects a macro identifier as first parameter");
+            free_tlist(origline);
+            return DIRECTIVE_FOUND;
+        }
+        ctx = get_ctx(tline->text, &mname, false);
+        last = tline;
+        tline = expand_smacro(tline->next);
+        last->next = NULL;
+
+        t = tline->next;
+        while (tok_type_(t, TOK_WHITESPACE))
+            t = t->next;
+
+        /* t should now point to the string */
+        if (t->type != TOK_STRING) {
+            error(ERR_NONFATAL,
+                  "`%%substr` requires string as second parameter");
+            free_tlist(tline);
+            free_tlist(origline);
+            return DIRECTIVE_FOUND;
+        }
+
+        tt = t->next;
+        tptr = &tt;
+        tokval.t_type = TOKEN_INVALID;
+        evalresult = evaluate(ppscan, tptr, &tokval, NULL,
+                             pass, error, NULL);
+        if (!evalresult) {
+            free_tlist(tline);
+            free_tlist(origline);
+            return DIRECTIVE_FOUND;
+        } else if (!is_simple(evalresult)) {
+            error(ERR_NONFATAL, "non-constant value given to `%%substr`");
+            free_tlist(tline);
+            free_tlist(origline);
+            return DIRECTIVE_FOUND;
+        }
+       a1 = evalresult->value-1;
+
+        while (tok_type_(tt, TOK_WHITESPACE))
+            tt = tt->next;
+       if (!tt) {
+           a2 = 1;             /* Backwards compatibility: one character */
+       } else {
+           tokval.t_type = TOKEN_INVALID;
+           evalresult = evaluate(ppscan, tptr, &tokval, NULL,
+                                 pass, error, NULL);
+           if (!evalresult) {
+               free_tlist(tline);
+               free_tlist(origline);
+               return DIRECTIVE_FOUND;
+           } else if (!is_simple(evalresult)) {
+               error(ERR_NONFATAL, "non-constant value given to `%%substr`");
+               free_tlist(tline);
+               free_tlist(origline);
+               return DIRECTIVE_FOUND;
+           }
+           a2 = evalresult->value;
+       }
+
+       len = nasm_unquote(t->text, NULL);
+       if (a2 < 0)
+           a2 = a2+1+len-a1;
+       if (a1+a2 > (int64_t)len)
+           a2 = len-a1;
+
+        macro_start = nasm_malloc(sizeof(*macro_start));
+        macro_start->next = NULL;
+        macro_start->text = nasm_quote((a1 < 0) ? "" : t->text+a1, a2);
+        macro_start->type = TOK_STRING;
+        macro_start->a.mac = NULL;
+
+        /*
+         * We now have a macro name, an implicit parameter count of
+         * zero, and a numeric token to use as an expansion. Create
+         * and store an SMacro.
+         */
+       define_smacro(ctx, mname, casesense, 0, macro_start);
+        free_tlist(tline);
+        free_tlist(origline);
+        return DIRECTIVE_FOUND;
+    }
+
+    case PP_ASSIGN:
+    case PP_IASSIGN:
+       casesense = (i == PP_ASSIGN);
+
+        tline = tline->next;
+        skip_white_(tline);
+        tline = expand_id(tline);
+        if (!tline || (tline->type != TOK_ID &&
+                       (tline->type != TOK_PREPROC_ID ||
+                        tline->text[1] != '$'))) {
+            error(ERR_NONFATAL,
+                  "`%%%sassign' expects a macro identifier",
+                  (i == PP_IASSIGN ? "i" : ""));
+            free_tlist(origline);
+            return DIRECTIVE_FOUND;
+        }
+        ctx = get_ctx(tline->text, &mname, false);
+        last = tline;
+        tline = expand_smacro(tline->next);
+        last->next = NULL;
+
+        t = tline;
+        tptr = &t;
+        tokval.t_type = TOKEN_INVALID;
+        evalresult =
+            evaluate(ppscan, tptr, &tokval, NULL, pass, error, NULL);
+        free_tlist(tline);
+        if (!evalresult) {
+            free_tlist(origline);
+            return DIRECTIVE_FOUND;
+        }
+
+        if (tokval.t_type)
+            error(ERR_WARNING|ERR_PASS1,
+                  "trailing garbage after expression ignored");
+
+        if (!is_simple(evalresult)) {
+            error(ERR_NONFATAL,
+                  "non-constant value given to `%%%sassign'",
+                  (i == PP_IASSIGN ? "i" : ""));
+            free_tlist(origline);
+            return DIRECTIVE_FOUND;
+        }
+
+        macro_start = nasm_malloc(sizeof(*macro_start));
+        macro_start->next = NULL;
+        make_tok_num(macro_start, reloc_value(evalresult));
+        macro_start->a.mac = NULL;
+
+        /*
+         * We now have a macro name, an implicit parameter count of
+         * zero, and a numeric token to use as an expansion. Create
+         * and store an SMacro.
+         */
+       define_smacro(ctx, mname, casesense, 0, macro_start);
+        free_tlist(origline);
+        return DIRECTIVE_FOUND;
+
+    case PP_LINE:
+        /*
+         * Syntax is `%line nnn[+mmm] [filename]'
+         */
+        tline = tline->next;
+        skip_white_(tline);
+        if (!tok_type_(tline, TOK_NUMBER)) {
+            error(ERR_NONFATAL, "`%%line' expects line number");
+            free_tlist(origline);
+            return DIRECTIVE_FOUND;
+        }
+        k = readnum(tline->text, &err);
+        m = 1;
+        tline = tline->next;
+        if (tok_is_(tline, "+")) {
+            tline = tline->next;
+            if (!tok_type_(tline, TOK_NUMBER)) {
+                error(ERR_NONFATAL, "`%%line' expects line increment");
+                free_tlist(origline);
+                return DIRECTIVE_FOUND;
+            }
+            m = readnum(tline->text, &err);
+            tline = tline->next;
+        }
+        skip_white_(tline);
+        src_set_linnum(k);
+        istk->lineinc = m;
+        if (tline) {
+            nasm_free(src_set_fname(detoken(tline, false)));
+        }
+        free_tlist(origline);
+        return DIRECTIVE_FOUND;
+
+    default:
+        error(ERR_FATAL,
+              "preprocessor directive `%s' not yet implemented",
+              pp_directives[i]);
+       return DIRECTIVE_FOUND;
+    }
+}
+
+/*
+ * Ensure that a macro parameter contains a condition code and
+ * nothing else. Return the condition code index if so, or -1
+ * otherwise.
+ */
+static int find_cc(Token * t)
+{
+    Token *tt;
+    int i, j, k, m;
+
+    if (!t)
+       return -1;              /* Probably a %+ without a space */
+
+    skip_white_(t);
+    if (t->type != TOK_ID)
+        return -1;
+    tt = t->next;
+    skip_white_(tt);
+    if (tt && (tt->type != TOK_OTHER || strcmp(tt->text, ",")))
+        return -1;
+
+    i = -1;
+    j = elements(conditions);
+    while (j - i > 1) {
+        k = (j + i) / 2;
+        m = nasm_stricmp(t->text, conditions[k]);
+        if (m == 0) {
+            i = k;
+            j = -2;
+            break;
+        } else if (m < 0) {
+            j = k;
+        } else
+            i = k;
+    }
+    if (j != -2)
+        return -1;
+    return i;
+}
+
+static bool paste_tokens(Token **head, bool handle_paste_tokens)
+{
+    Token **tail, *t, *tt;
+    Token **paste_head;
+    bool did_paste = false;
+    char *tmp;
+
+    /* Now handle token pasting... */
+    paste_head = NULL;
+    tail = head;
+    while ((t = *tail) && (tt = t->next)) {
+        switch (t->type) {
+        case TOK_WHITESPACE:
+            if (tt->type == TOK_WHITESPACE) {
+               /* Zap adjacent whitespace tokens */
+                t->next = delete_Token(tt);
+            } else {
+               /* Do not advance paste_head here */
+               tail = &t->next;
+           }
+            break;
+        case TOK_ID:
+       case TOK_PREPROC_ID:
+        case TOK_NUMBER:
+       case TOK_FLOAT:
+       {
+           size_t len = 0;
+           char *tmp, *p;
+
+           while (tt && (tt->type == TOK_ID || tt->type == TOK_PREPROC_ID ||
+                         tt->type == TOK_NUMBER || tt->type == TOK_FLOAT ||
+                         tt->type == TOK_OTHER)) {
+               len += strlen(tt->text);
+               tt = tt->next;
+           }
+
+           /* Now tt points to the first token after the potential
+              paste area... */
+           if (tt != t->next) {
+               /* We have at least two tokens... */
+               len += strlen(t->text);
+               p = tmp = nasm_malloc(len+1);
+
+               while (t != tt) {
+                   strcpy(p, t->text);
+                   p = strchr(p, '\0');
+                   t = delete_Token(t);
+               }
+
+               t = *tail = tokenize(tmp);
+               nasm_free(tmp);
+
+               while (t->next) {
+                   tail = &t->next;
+                   t = t->next;
+               }
+               t->next = tt;   /* Attach the remaining token chain */
+
+               did_paste = true;
+           }
+           paste_head = tail;
+           tail = &t->next;
+           break;
+       }
+       case TOK_PASTE:         /* %+ */
+           if (handle_paste_tokens) {
+               /* Zap %+ and whitespace tokens to the right */
+               while (t && (t->type == TOK_WHITESPACE ||
+                            t->type == TOK_PASTE))
+                   t = *tail = delete_Token(t);
+               if (!paste_head || !t)
+                   break;      /* Nothing to paste with */
+               tail = paste_head;
+               t = *tail;
+               tt = t->next;
+               while (tok_type_(tt, TOK_WHITESPACE))
+                   tt = t->next = delete_Token(tt);
+
+               if (tt) {
+                   tmp = nasm_strcat(t->text, tt->text);
+                   delete_Token(t);
+                   tt = delete_Token(tt);
+                   t = *tail = tokenize(tmp);
+                   nasm_free(tmp);
+                   while (t->next) {
+                       tail = &t->next;
+                       t = t->next;
+                   }
+                   t->next = tt; /* Attach the remaining token chain */
+                   did_paste = true;
+               }
+               paste_head = tail;
+               tail = &t->next;
+               break;
+           }
+           /* else fall through */
+       default:
+           tail = paste_head = &t->next;
+           break;
+        }
+    }
+    return did_paste;
+}
+/*
+ * Expand MMacro-local things: parameter references (%0, %n, %+n,
+ * %-n) and MMacro-local identifiers (%%foo) as well as
+ * macro indirection (%[...]).
+ */
+static Token *expand_mmac_params(Token * tline)
+{
+    Token *t, *tt, **tail, *thead;
+    bool changed = false;
+
+    tail = &thead;
+    thead = NULL;
+
+    while (tline) {
+        if (tline->type == TOK_PREPROC_ID &&
+            (((tline->text[1] == '+' || tline->text[1] == '-')
+              && tline->text[2]) || tline->text[1] == '%'
+             || (tline->text[1] >= '0' && tline->text[1] <= '9'))) {
+            char *text = NULL;
+            int type = 0, cc;   /* type = 0 to placate optimisers */
+            char tmpbuf[30];
+            unsigned int n;
+           int i;
+            MMacro *mac;
+
+            t = tline;
+            tline = tline->next;
+
+            mac = istk->mstk;
+            while (mac && !mac->name)   /* avoid mistaking %reps for macros */
+                mac = mac->next_active;
+            if (!mac)
+                error(ERR_NONFATAL, "`%s': not in a macro call", t->text);
+            else
+                switch (t->text[1]) {
+                    /*
+                     * We have to make a substitution of one of the
+                     * forms %1, %-1, %+1, %%foo, %0.
+                     */
+                case '0':
+                    type = TOK_NUMBER;
+                    snprintf(tmpbuf, sizeof(tmpbuf), "%d", mac->nparam);
+                    text = nasm_strdup(tmpbuf);
+                    break;
+                case '%':
+                    type = TOK_ID;
+                    snprintf(tmpbuf, sizeof(tmpbuf), "..@%"PRIu64".",
+                             mac->unique);
+                    text = nasm_strcat(tmpbuf, t->text + 2);
+                    break;
+                case '-':
+                    n = atoi(t->text + 2) - 1;
+                    if (n >= mac->nparam)
+                        tt = NULL;
+                    else {
+                        if (mac->nparam > 1)
+                            n = (n + mac->rotate) % mac->nparam;
+                        tt = mac->params[n];
+                    }
+                    cc = find_cc(tt);
+                    if (cc == -1) {
+                        error(ERR_NONFATAL,
+                              "macro parameter %d is not a condition code",
+                              n + 1);
+                        text = NULL;
+                    } else {
+                        type = TOK_ID;
+                        if (inverse_ccs[cc] == -1) {
+                            error(ERR_NONFATAL,
+                                  "condition code `%s' is not invertible",
+                                  conditions[cc]);
+                            text = NULL;
+                        } else
+                            text = nasm_strdup(conditions[inverse_ccs[cc]]);
+                    }
+                    break;
+                case '+':
+                    n = atoi(t->text + 2) - 1;
+                    if (n >= mac->nparam)
+                        tt = NULL;
+                    else {
+                        if (mac->nparam > 1)
+                            n = (n + mac->rotate) % mac->nparam;
+                        tt = mac->params[n];
+                    }
+                    cc = find_cc(tt);
+                    if (cc == -1) {
+                        error(ERR_NONFATAL,
+                              "macro parameter %d is not a condition code",
+                              n + 1);
+                        text = NULL;
+                    } else {
+                        type = TOK_ID;
+                        text = nasm_strdup(conditions[cc]);
+                    }
+                    break;
+                default:
+                    n = atoi(t->text + 1) - 1;
+                    if (n >= mac->nparam)
+                        tt = NULL;
+                    else {
+                        if (mac->nparam > 1)
+                            n = (n + mac->rotate) % mac->nparam;
+                        tt = mac->params[n];
+                    }
+                    if (tt) {
+                        for (i = 0; i < mac->paramlen[n]; i++) {
+                            *tail = new_Token(NULL, tt->type, tt->text, 0);
+                            tail = &(*tail)->next;
+                            tt = tt->next;
+                        }
+                    }
+                    text = NULL;        /* we've done it here */
+                    break;
+                }
+            if (!text) {
+                delete_Token(t);
+            } else {
+                *tail = t;
+                tail = &t->next;
+                t->type = type;
+                nasm_free(t->text);
+                t->text = text;
+                t->a.mac = NULL;
+            }
+           changed = true;
+            continue;
+       } else if (tline->type == TOK_INDIRECT) {
+           t = tline;
+           tline = tline->next;
+           tt = tokenize(t->text);
+           tt = expand_mmac_params(tt);
+           tt = expand_smacro(tt);
+           *tail = tt;
+           while (tt) {
+               tt->a.mac = NULL; /* Necessary? */
+               tail = &tt->next;
+               tt = tt->next;
+           }
+           delete_Token(t);
+           changed = true;
+        } else {
+            t = *tail = tline;
+            tline = tline->next;
+            t->a.mac = NULL;
+            tail = &t->next;
+        }
+    }
+    *tail = NULL;
+
+    if (changed)
+       paste_tokens(&thead, false);
+
+    return thead;
+}
+
+/*
+ * Expand all single-line macro calls made in the given line.
+ * Return the expanded version of the line. The original is deemed
+ * to be destroyed in the process. (In reality we'll just move
+ * Tokens from input to output a lot of the time, rather than
+ * actually bothering to destroy and replicate.)
+ */
+
+static Token *expand_smacro(Token * tline)
+{
+    Token *t, *tt, *mstart, **tail, *thead;
+    struct hash_table *smtbl;
+    SMacro *head = NULL, *m;
+    Token **params;
+    int *paramsize;
+    unsigned int nparam, sparam;
+    int brackets;
+    Token *org_tline = tline;
+    Context *ctx;
+    const char *mname;
+    int deadman = DEADMAN_LIMIT;
+    bool expanded;
+
+    /*
+     * Trick: we should avoid changing the start token pointer since it can
+     * be contained in "next" field of other token. Because of this
+     * we allocate a copy of first token and work with it; at the end of
+     * routine we copy it back
+     */
+    if (org_tline) {
+        tline =
+            new_Token(org_tline->next, org_tline->type, org_tline->text,
+                      0);
+        tline->a.mac = org_tline->a.mac;
+        nasm_free(org_tline->text);
+        org_tline->text = NULL;
+    }
+
+    expanded = true;           /* Always expand %+ at least once */
+
+again:
+    tail = &thead;
+    thead = NULL;
+
+    while (tline) {             /* main token loop */
+       if (!--deadman) {
+           error(ERR_NONFATAL, "interminable macro recursion");
+            goto err;
+       }
+
+        if ((mname = tline->text)) {
+            /* if this token is a local macro, look in local context */
+            if (tline->type == TOK_ID || tline->type == TOK_PREPROC_ID)
+                ctx = get_ctx(mname, &mname, true);
+           else
+               ctx = NULL;
+           smtbl = ctx ? &ctx->localmac : &smacros;
+           head = (SMacro *) hash_findix(smtbl, mname);
+
+            /*
+             * We've hit an identifier. As in is_mmacro below, we first
+             * check whether the identifier is a single-line macro at
+             * all, then think about checking for parameters if
+             * necessary.
+             */
+           for (m = head; m; m = m->next)
+               if (!mstrcmp(m->name, mname, m->casesense))
+                   break;
+           if (m) {
+               mstart = tline;
+               params = NULL;
+               paramsize = NULL;
+               if (m->nparam == 0) {
+                   /*
+                    * Simple case: the macro is parameterless. Discard the
+                    * one token that the macro call took, and push the
+                    * expansion back on the to-do stack.
+                    */
+                   if (!m->expansion) {
+                       if (!strcmp("__FILE__", m->name)) {
+                           int32_t num = 0;
+                           char *file = NULL;
+                           src_get(&num, &file);
+                           tline->text = nasm_quote(file, strlen(file));
+                           tline->type = TOK_STRING;
+                           nasm_free(file);
+                           continue;
+                       }
+                       if (!strcmp("__LINE__", m->name)) {
+                           nasm_free(tline->text);
+                           make_tok_num(tline, src_get_linnum());
+                           continue;
+                       }
+                       if (!strcmp("__BITS__", m->name)) {
+                           nasm_free(tline->text);
+                           make_tok_num(tline, globalbits);
+                            continue;
+                       }
+                       tline = delete_Token(tline);
+                       continue;
+                   }
+               } else {
+                   /*
+                    * Complicated case: at least one macro with this name
+                     * exists and takes parameters. We must find the
+                     * parameters in the call, count them, find the SMacro
+                     * that corresponds to that form of the macro call, and
+                     * substitute for the parameters when we expand. What a
+                     * pain.
+                     */
+                    /*tline = tline->next;
+                     skip_white_(tline); */
+                    do {
+                        t = tline->next;
+                        while (tok_type_(t, TOK_SMAC_END)) {
+                            t->a.mac->in_progress = false;
+                            t->text = NULL;
+                            t = tline->next = delete_Token(t);
+                        }
+                        tline = t;
+                    } while (tok_type_(tline, TOK_WHITESPACE));
+                    if (!tok_is_(tline, "(")) {
+                        /*
+                         * This macro wasn't called with parameters: ignore
+                         * the call. (Behaviour borrowed from gnu cpp.)
+                         */
+                        tline = mstart;
+                        m = NULL;
+                    } else {
+                        int paren = 0;
+                        int white = 0;
+                        brackets = 0;
+                        nparam = 0;
+                        sparam = PARAM_DELTA;
+                        params = nasm_malloc(sparam * sizeof(Token *));
+                        params[0] = tline->next;
+                        paramsize = nasm_malloc(sparam * sizeof(int));
+                        paramsize[0] = 0;
+                        while (true) {  /* parameter loop */
+                            /*
+                             * For some unusual expansions
+                             * which concatenates function call
+                             */
+                            t = tline->next;
+                            while (tok_type_(t, TOK_SMAC_END)) {
+                                t->a.mac->in_progress = false;
+                                t->text = NULL;
+                                t = tline->next = delete_Token(t);
+                            }
+                            tline = t;
+
+                            if (!tline) {
+                                error(ERR_NONFATAL,
+                                      "macro call expects terminating `)'");
+                                break;
+                            }
+                            if (tline->type == TOK_WHITESPACE
+                                && brackets <= 0) {
+                                if (paramsize[nparam])
+                                    white++;
+                                else
+                                    params[nparam] = tline->next;
+                                continue;       /* parameter loop */
+                            }
+                            if (tline->type == TOK_OTHER
+                                && tline->text[1] == 0) {
+                                char ch = tline->text[0];
+                                if (ch == ',' && !paren && brackets <= 0) {
+                                    if (++nparam >= sparam) {
+                                        sparam += PARAM_DELTA;
+                                        params = nasm_realloc(params,
+                                                              sparam *
+                                                              sizeof(Token
+                                                                     *));
+                                        paramsize =
+                                            nasm_realloc(paramsize,
+                                                         sparam *
+                                                         sizeof(int));
+                                    }
+                                    params[nparam] = tline->next;
+                                    paramsize[nparam] = 0;
+                                    white = 0;
+                                    continue;   /* parameter loop */
+                                }
+                                if (ch == '{' &&
+                                    (brackets > 0 || (brackets == 0 &&
+                                                      !paramsize[nparam])))
+                                {
+                                    if (!(brackets++)) {
+                                        params[nparam] = tline->next;
+                                        continue;       /* parameter loop */
+                                    }
+                                }
+                                if (ch == '}' && brackets > 0)
+                                    if (--brackets == 0) {
+                                        brackets = -1;
+                                        continue;       /* parameter loop */
+                                    }
+                                if (ch == '(' && !brackets)
+                                    paren++;
+                                if (ch == ')' && brackets <= 0)
+                                    if (--paren < 0)
+                                        break;
+                            }
+                            if (brackets < 0) {
+                                brackets = 0;
+                                error(ERR_NONFATAL, "braces do not "
+                                      "enclose all of macro parameter");
+                            }
+                            paramsize[nparam] += white + 1;
+                            white = 0;
+                        }       /* parameter loop */
+                        nparam++;
+                        while (m && (m->nparam != nparam ||
+                                     mstrcmp(m->name, mname,
+                                             m->casesense)))
+                            m = m->next;
+                        if (!m)
+                            error(ERR_WARNING|ERR_PASS1|ERR_WARN_MNP,
+                                  "macro `%s' exists, "
+                                  "but not taking %d parameters",
+                                  mstart->text, nparam);
+                    }
+                }
+                if (m && m->in_progress)
+                    m = NULL;
+                if (!m) {       /* in progess or didn't find '(' or wrong nparam */
+                    /*
+                     * Design question: should we handle !tline, which
+                     * indicates missing ')' here, or expand those
+                     * macros anyway, which requires the (t) test a few
+                     * lines down?
+                     */
+                    nasm_free(params);
+                    nasm_free(paramsize);
+                    tline = mstart;
+                } else {
+                    /*
+                     * Expand the macro: we are placed on the last token of the
+                     * call, so that we can easily split the call from the
+                     * following tokens. We also start by pushing an SMAC_END
+                     * token for the cycle removal.
+                     */
+                    t = tline;
+                    if (t) {
+                        tline = t->next;
+                        t->next = NULL;
+                    }
+                    tt = new_Token(tline, TOK_SMAC_END, NULL, 0);
+                    tt->a.mac = m;
+                    m->in_progress = true;
+                    tline = tt;
+                    for (t = m->expansion; t; t = t->next) {
+                        if (t->type >= TOK_SMAC_PARAM) {
+                            Token *pcopy = tline, **ptail = &pcopy;
+                            Token *ttt, *pt;
+                            int i;
+
+                            ttt = params[t->type - TOK_SMAC_PARAM];
+                            for (i = paramsize[t->type - TOK_SMAC_PARAM];
+                                 --i >= 0;) {
+                                pt = *ptail =
+                                    new_Token(tline, ttt->type, ttt->text,
+                                              0);
+                                ptail = &pt->next;
+                                ttt = ttt->next;
+                            }
+                            tline = pcopy;
+                       } else if (t->type == TOK_PREPROC_Q) {
+                           tt = new_Token(tline, TOK_ID, mname, 0);
+                           tline = tt;
+                       } else if (t->type == TOK_PREPROC_QQ) {
+                           tt = new_Token(tline, TOK_ID, m->name, 0);
+                           tline = tt;
+                        } else {
+                            tt = new_Token(tline, t->type, t->text, 0);
+                            tline = tt;
+                        }
+                    }
+
+                    /*
+                     * Having done that, get rid of the macro call, and clean
+                     * up the parameters.
+                     */
+                    nasm_free(params);
+                    nasm_free(paramsize);
+                    free_tlist(mstart);
+                   expanded = true;
+                    continue;   /* main token loop */
+                }
+            }
+        }
+
+        if (tline->type == TOK_SMAC_END) {
+            tline->a.mac->in_progress = false;
+            tline = delete_Token(tline);
+        } else {
+            t = *tail = tline;
+            tline = tline->next;
+            t->a.mac = NULL;
+            t->next = NULL;
+            tail = &t->next;
+        }
+    }
+
+    /*
+     * Now scan the entire line and look for successive TOK_IDs that resulted
+     * after expansion (they can't be produced by tokenize()). The successive
+     * TOK_IDs should be concatenated.
+     * Also we look for %+ tokens and concatenate the tokens before and after
+     * them (without white spaces in between).
+     */
+    if (expanded && paste_tokens(&thead, true)) {
+       /*
+        * If we concatenated something, *and* we had previously expanded
+        * an actual macro, scan the lines again for macros...
+        */
+        tline = thead;
+       expanded = false;
+        goto again;
+    }
+
+err:
+    if (org_tline) {
+        if (thead) {
+            *org_tline = *thead;
+            /* since we just gave text to org_line, don't free it */
+            thead->text = NULL;
+            delete_Token(thead);
+        } else {
+            /* the expression expanded to empty line;
+               we can't return NULL for some reasons
+               we just set the line to a single WHITESPACE token. */
+            memset(org_tline, 0, sizeof(*org_tline));
+            org_tline->text = NULL;
+            org_tline->type = TOK_WHITESPACE;
+        }
+        thead = org_tline;
+    }
+
+    return thead;
+}
+
+/*
+ * Similar to expand_smacro but used exclusively with macro identifiers
+ * right before they are fetched in. The reason is that there can be
+ * identifiers consisting of several subparts. We consider that if there
+ * are more than one element forming the name, user wants a expansion,
+ * otherwise it will be left as-is. Example:
+ *
+ *     %define %$abc cde
+ *
+ * the identifier %$abc will be left as-is so that the handler for %define
+ * will suck it and define the corresponding value. Other case:
+ *
+ *     %define _%$abc cde
+ *
+ * In this case user wants name to be expanded *before* %define starts
+ * working, so we'll expand %$abc into something (if it has a value;
+ * otherwise it will be left as-is) then concatenate all successive
+ * PP_IDs into one.
+ */
+static Token *expand_id(Token * tline)
+{
+    Token *cur, *oldnext = NULL;
+
+    if (!tline || !tline->next)
+        return tline;
+
+    cur = tline;
+    while (cur->next &&
+           (cur->next->type == TOK_ID ||
+            cur->next->type == TOK_PREPROC_ID
+            || cur->next->type == TOK_NUMBER))
+        cur = cur->next;
+
+    /* If identifier consists of just one token, don't expand */
+    if (cur == tline)
+        return tline;
+
+    if (cur) {
+        oldnext = cur->next;    /* Detach the tail past identifier */
+        cur->next = NULL;       /* so that expand_smacro stops here */
+    }
+
+    tline = expand_smacro(tline);
+
+    if (cur) {
+        /* expand_smacro possibly changhed tline; re-scan for EOL */
+        cur = tline;
+        while (cur && cur->next)
+            cur = cur->next;
+        if (cur)
+            cur->next = oldnext;
+    }
+
+    return tline;
+}
+
+/*
+ * Determine whether the given line constitutes a multi-line macro
+ * call, and return the MMacro structure called if so. Doesn't have
+ * to check for an initial label - that's taken care of in
+ * expand_mmacro - but must check numbers of parameters. Guaranteed
+ * to be called with tline->type == TOK_ID, so the putative macro
+ * name is easy to find.
+ */
+static MMacro *is_mmacro(Token * tline, Token *** params_array)
+{
+    MMacro *head, *m;
+    Token **params;
+    int nparam;
+
+    head = (MMacro *) hash_findix(&mmacros, tline->text);
+
+    /*
+     * Efficiency: first we see if any macro exists with the given
+     * name. If not, we can return NULL immediately. _Then_ we
+     * count the parameters, and then we look further along the
+     * list if necessary to find the proper MMacro.
+     */
+    for (m = head; m; m = m->next)
+        if (!mstrcmp(m->name, tline->text, m->casesense))
+            break;
+    if (!m)
+        return NULL;
+
+    /*
+     * OK, we have a potential macro. Count and demarcate the
+     * parameters.
+     */
+    count_mmac_params(tline->next, &nparam, &params);
+
+    /*
+     * So we know how many parameters we've got. Find the MMacro
+     * structure that handles this number.
+     */
+    while (m) {
+        if (m->nparam_min <= nparam
+            && (m->plus || nparam <= m->nparam_max)) {
+            /*
+             * This one is right. Just check if cycle removal
+             * prohibits us using it before we actually celebrate...
+             */
+           if (m->in_progress > m->max_depth) {
+               if (m->max_depth > 0) {
+                   error(ERR_WARNING,
+                         "reached maximum recursion depth of %i",
+                         m->max_depth);
+               }
+               nasm_free(params);
+               return NULL;
+           }
+            /*
+             * It's right, and we can use it. Add its default
+             * parameters to the end of our list if necessary.
+             */
+            if (m->defaults && nparam < m->nparam_min + m->ndefs) {
+                params =
+                    nasm_realloc(params,
+                                 ((m->nparam_min + m->ndefs +
+                                   1) * sizeof(*params)));
+                while (nparam < m->nparam_min + m->ndefs) {
+                    params[nparam] = m->defaults[nparam - m->nparam_min];
+                    nparam++;
+                }
+            }
+            /*
+             * If we've gone over the maximum parameter count (and
+             * we're in Plus mode), ignore parameters beyond
+             * nparam_max.
+             */
+            if (m->plus && nparam > m->nparam_max)
+                nparam = m->nparam_max;
+            /*
+             * Then terminate the parameter list, and leave.
+             */
+            if (!params) {      /* need this special case */
+                params = nasm_malloc(sizeof(*params));
+                nparam = 0;
+            }
+            params[nparam] = NULL;
+            *params_array = params;
+            return m;
+        }
+        /*
+         * This one wasn't right: look for the next one with the
+         * same name.
+         */
+        for (m = m->next; m; m = m->next)
+            if (!mstrcmp(m->name, tline->text, m->casesense))
+                break;
+    }
+
+    /*
+     * After all that, we didn't find one with the right number of
+     * parameters. Issue a warning, and fail to expand the macro.
+     */
+    error(ERR_WARNING|ERR_PASS1|ERR_WARN_MNP,
+          "macro `%s' exists, but not taking %d parameters",
+          tline->text, nparam);
+    nasm_free(params);
+    return NULL;
+}
+
+
+/*
+ * Save MMacro invocation specific fields in
+ * preparation for a recursive macro expansion
+ */
+static void push_mmacro(MMacro *m)
+{
+    MMacroInvocation *i;
+
+    i = nasm_malloc(sizeof(MMacroInvocation));
+    i->prev = m->prev;
+    i->params = m->params;
+    i->iline = m->iline;
+    i->nparam = m->nparam;
+    i->rotate = m->rotate;
+    i->paramlen = m->paramlen;
+    i->unique = m->unique;
+       i->condcnt = m->condcnt;
+    m->prev = i;
+}
+
+
+/*
+ * Restore MMacro invocation specific fields that were
+ * saved during a previous recursive macro expansion
+ */
+static void pop_mmacro(MMacro *m)
+{
+    MMacroInvocation *i;
+
+    if (m->prev) {
+       i = m->prev;
+       m->prev = i->prev;
+       m->params = i->params;
+       m->iline = i->iline;
+       m->nparam = i->nparam;
+       m->rotate = i->rotate;
+       m->paramlen = i->paramlen;
+       m->unique = i->unique;
+       m->condcnt = i->condcnt;
+       nasm_free(i);
+    }
+}
+
+
+/*
+ * Expand the multi-line macro call made by the given line, if
+ * there is one to be expanded. If there is, push the expansion on
+ * istk->expansion and return 1. Otherwise return 0.
+ */
+static int expand_mmacro(Token * tline)
+{
+    Token *startline = tline;
+    Token *label = NULL;
+    int dont_prepend = 0;
+    Token **params, *t, *mtok, *tt;
+    MMacro *m;
+    Line *l, *ll;
+    int i, nparam, *paramlen;
+    const char *mname;
+
+    t = tline;
+    skip_white_(t);
+    /*    if (!tok_type_(t, TOK_ID))  Lino 02/25/02 */
+    if (!tok_type_(t, TOK_ID) && !tok_type_(t, TOK_PREPROC_ID))
+        return 0;
+    mtok = t;
+    m = is_mmacro(t, &params);
+    if (m) {
+       mname = t->text;
+    } else {
+        Token *last;
+        /*
+         * We have an id which isn't a macro call. We'll assume
+         * it might be a label; we'll also check to see if a
+         * colon follows it. Then, if there's another id after
+         * that lot, we'll check it again for macro-hood.
+         */
+        label = last = t;
+        t = t->next;
+        if (tok_type_(t, TOK_WHITESPACE))
+            last = t, t = t->next;
+        if (tok_is_(t, ":")) {
+            dont_prepend = 1;
+            last = t, t = t->next;
+            if (tok_type_(t, TOK_WHITESPACE))
+                last = t, t = t->next;
+        }
+        if (!tok_type_(t, TOK_ID) || !(m = is_mmacro(t, &params)))
+            return 0;
+        last->next = NULL;
+        mname = t->text;
+        tline = t;
+    }
+
+    /*
+     * Fix up the parameters: this involves stripping leading and
+     * trailing whitespace, then stripping braces if they are
+     * present.
+     */
+    for (nparam = 0; params[nparam]; nparam++) ;
+    paramlen = nparam ? nasm_malloc(nparam * sizeof(*paramlen)) : NULL;
+
+    for (i = 0; params[i]; i++) {
+        int brace = false;
+        int comma = (!m->plus || i < nparam - 1);
+
+        t = params[i];
+        skip_white_(t);
+        if (tok_is_(t, "{"))
+            t = t->next, brace = true, comma = false;
+        params[i] = t;
+        paramlen[i] = 0;
+        while (t) {
+            if (comma && t->type == TOK_OTHER && !strcmp(t->text, ","))
+                break;          /* ... because we have hit a comma */
+            if (comma && t->type == TOK_WHITESPACE
+                && tok_is_(t->next, ","))
+                break;          /* ... or a space then a comma */
+            if (brace && t->type == TOK_OTHER && !strcmp(t->text, "}"))
+                break;          /* ... or a brace */
+            t = t->next;
+            paramlen[i]++;
+        }
+    }
+
+    /*
+     * OK, we have a MMacro structure together with a set of
+     * parameters. We must now go through the expansion and push
+     * copies of each Line on to istk->expansion. Substitution of
+     * parameter tokens and macro-local tokens doesn't get done
+     * until the single-line macro substitution process; this is
+     * because delaying them allows us to change the semantics
+     * later through %rotate.
+     *
+     * First, push an end marker on to istk->expansion, mark this
+     * macro as in progress, and set up its invocation-specific
+     * variables.
+     */
+    ll = nasm_malloc(sizeof(Line));
+    ll->next = istk->expansion;
+    ll->finishes = m;
+    ll->first = NULL;
+    istk->expansion = ll;
+       
+    /*
+     * Save the previous MMacro expansion in the case of
+     * macro recursion
+     */
+    if (m->max_depth && m->in_progress)
+       push_mmacro(m);
+
+    m->in_progress ++;
+    m->params = params;
+    m->iline = tline;
+    m->nparam = nparam;
+    m->rotate = 0;
+    m->paramlen = paramlen;
+    m->unique = unique++;
+    m->lineno = 0;
+    m->condcnt = 0;
+
+    m->next_active = istk->mstk;
+    istk->mstk = m;
+
+    for (l = m->expansion; l; l = l->next) {
+        Token **tail;
+
+        ll = nasm_malloc(sizeof(Line));
+        ll->finishes = NULL;
+        ll->next = istk->expansion;
+        istk->expansion = ll;
+        tail = &ll->first;
+
+        for (t = l->first; t; t = t->next) {
+            Token *x = t;
+           switch (t->type) {
+           case TOK_PREPROC_Q:
+               tt = *tail = new_Token(NULL, TOK_ID, mname, 0);
+               break;
+           case TOK_PREPROC_QQ:
+               tt = *tail = new_Token(NULL, TOK_ID, m->name, 0);
+               break;
+           case TOK_PREPROC_ID:
+               if (t->text[1] == '0' && t->text[2] == '0') {
+                   dont_prepend = -1;
+                   x = label;
+                   if (!x)
+                       continue;
+               }
+               /* fall through */
+           default:
+               tt = *tail = new_Token(NULL, x->type, x->text, 0);
+               break;
+           }
+           tail = &tt->next;
+       }
+        *tail = NULL;
+    }
+
+    /*
+     * If we had a label, push it on as the first line of
+     * the macro expansion.
+     */
+    if (label) {
+        if (dont_prepend < 0)
+            free_tlist(startline);
+        else {
+            ll = nasm_malloc(sizeof(Line));
+            ll->finishes = NULL;
+            ll->next = istk->expansion;
+            istk->expansion = ll;
+            ll->first = startline;
+            if (!dont_prepend) {
+                while (label->next)
+                    label = label->next;
+                label->next = tt = new_Token(NULL, TOK_OTHER, ":", 0);
+            }
+        }
+    }
+
+    list->uplevel(m->nolist ? LIST_MACRO_NOLIST : LIST_MACRO);
+
+    return 1;
+}
+
+/* The function that actually does the error reporting */
+static void verror(int severity, const char *fmt, va_list arg)
+{
+    char buff[1024];
+
+    vsnprintf(buff, sizeof(buff), fmt, arg);
+
+    if (istk && istk->mstk && istk->mstk->name)
+        nasm_error(severity, "(%s:%d) %s", istk->mstk->name,
+               istk->mstk->lineno, buff);
+    else
+        nasm_error(severity, "%s", buff);
+}
+
+/*
+ * Since preprocessor always operate only on the line that didn't
+ * arrived yet, we should always use ERR_OFFBY1.
+ */
+static void error(int severity, const char *fmt, ...)
+{
+    va_list arg;
+
+    /* If we're in a dead branch of IF or something like it, ignore the error */
+    if (istk && istk->conds && !emitting(istk->conds->state))
+        return;
+
+    va_start(arg, fmt);
+    verror(severity, fmt, arg);
+    va_end(arg);
+}
+
+/*
+ * Because %else etc are evaluated in the state context
+ * of the previous branch, errors might get lost with error():
+ *   %if 0 ... %else trailing garbage ... %endif
+ * So %else etc should report errors with this function.
+ */
+static void error_precond(int severity, const char *fmt, ...)
+{
+    va_list arg;
+
+    /* Only ignore the error if it's really in a dead branch */
+    if (istk && istk->conds && istk->conds->state == COND_NEVER)
+        return;
+
+    va_start(arg, fmt);
+    verror(severity, fmt, arg);
+    va_end(arg);
+}
+
+static void
+pp_reset(char *file, int apass, ListGen * listgen, StrList **deplist)
+{
+    Token *t;
+
+    cstk = NULL;
+    istk = nasm_malloc(sizeof(Include));
+    istk->next = NULL;
+    istk->conds = NULL;
+    istk->expansion = NULL;
+    istk->mstk = NULL;
+    istk->fp = fopen(file, "r");
+    istk->fname = NULL;
+    src_set_fname(nasm_strdup(file));
+    src_set_linnum(0);
+    istk->lineinc = 1;
+    if (!istk->fp)
+        error(ERR_FATAL|ERR_NOFILE, "unable to open input file `%s'",
+              file);
+    defining = NULL;
+    nested_mac_count = 0;
+    nested_rep_count = 0;
+    init_macros();
+    unique = 0;
+    if (tasm_compatible_mode) {
+        stdmacpos = nasm_stdmac;
+    } else {
+        stdmacpos = nasm_stdmac_after_tasm;
+    }
+    any_extrastdmac = extrastdmac && *extrastdmac;
+    do_predef = true;
+    list = listgen;
+
+    /*
+     * 0 for dependencies, 1 for preparatory passes, 2 for final pass.
+     * The caller, however, will also pass in 3 for preprocess-only so
+     * we can set __PASS__ accordingly.
+     */
+    pass = apass > 2 ? 2 : apass;
+
+    dephead = deptail = deplist;
+    if (deplist) {
+       StrList *sl = nasm_malloc(strlen(file)+1+sizeof sl->next);
+       sl->next = NULL;
+       strcpy(sl->str, file);
+       *deptail = sl;
+       deptail = &sl->next;
+    }
+
+    /*
+     * Define the __PASS__ macro.  This is defined here unlike
+     * all the other builtins, because it is special -- it varies between
+     * passes.
+     */
+    t = nasm_malloc(sizeof(*t));
+    t->next = NULL;
+    make_tok_num(t, apass);
+    t->a.mac = NULL;
+    define_smacro(NULL, "__PASS__", true, 0, t);
+}
+
+static char *pp_getline(void)
+{
+    char *line;
+    Token *tline;
+
+    while (1) {
+        /*
+         * Fetch a tokenized line, either from the macro-expansion
+         * buffer or from the input file.
+         */
+        tline = NULL;
+        while (istk->expansion && istk->expansion->finishes) {
+            Line *l = istk->expansion;
+            if (!l->finishes->name && l->finishes->in_progress > 1) {
+                Line *ll;
+
+                /*
+                 * This is a macro-end marker for a macro with no
+                 * name, which means it's not really a macro at all
+                 * but a %rep block, and the `in_progress' field is
+                 * more than 1, meaning that we still need to
+                 * repeat. (1 means the natural last repetition; 0
+                 * means termination by %exitrep.) We have
+                 * therefore expanded up to the %endrep, and must
+                 * push the whole block on to the expansion buffer
+                 * again. We don't bother to remove the macro-end
+                 * marker: we'd only have to generate another one
+                 * if we did.
+                 */
+                l->finishes->in_progress--;
+                for (l = l->finishes->expansion; l; l = l->next) {
+                    Token *t, *tt, **tail;
+
+                    ll = nasm_malloc(sizeof(Line));
+                    ll->next = istk->expansion;
+                    ll->finishes = NULL;
+                    ll->first = NULL;
+                    tail = &ll->first;
+
+                    for (t = l->first; t; t = t->next) {
+                        if (t->text || t->type == TOK_WHITESPACE) {
+                            tt = *tail =
+                                new_Token(NULL, t->type, t->text, 0);
+                            tail = &tt->next;
+                        }
+                    }
+
+                    istk->expansion = ll;
+                }
+            } else {
+                /*
+                 * Check whether a `%rep' was started and not ended
+                 * within this macro expansion. This can happen and
+                 * should be detected. It's a fatal error because
+                 * I'm too confused to work out how to recover
+                 * sensibly from it.
+                 */
+                if (defining) {
+                    if (defining->name)
+                        error(ERR_PANIC,
+                              "defining with name in expansion");
+                    else if (istk->mstk->name)
+                        error(ERR_FATAL,
+                              "`%%rep' without `%%endrep' within"
+                              " expansion of macro `%s'",
+                              istk->mstk->name);
+                }
+
+                /*
+                 * FIXME:  investigate the relationship at this point between
+                 * istk->mstk and l->finishes
+                 */
+                {
+                    MMacro *m = istk->mstk;
+                    istk->mstk = m->next_active;
+                    if (m->name) {
+                        /*
+                         * This was a real macro call, not a %rep, and
+                         * therefore the parameter information needs to
+                         * be freed.
+                         */
+                       if (m->prev) {
+                           pop_mmacro(m);
+                           l->finishes->in_progress --;
+                       } else {
+                            nasm_free(m->params);
+                            free_tlist(m->iline);
+                           nasm_free(m->paramlen);
+                           l->finishes->in_progress = 0;
+                       }
+                    } else
+                        free_mmacro(m);
+                }
+                istk->expansion = l->next;
+                nasm_free(l);
+                list->downlevel(LIST_MACRO);
+            }
+        }
+        while (1) {             /* until we get a line we can use */
+
+            if (istk->expansion) {      /* from a macro expansion */
+                char *p;
+                Line *l = istk->expansion;
+                if (istk->mstk)
+                    istk->mstk->lineno++;
+                tline = l->first;
+                istk->expansion = l->next;
+                nasm_free(l);
+                p = detoken(tline, false);
+                list->line(LIST_MACRO, p);
+                nasm_free(p);
+                break;
+            }
+            line = read_line();
+            if (line) {         /* from the current input file */
+                line = prepreproc(line);
+                tline = tokenize(line);
+                nasm_free(line);
+                break;
+            }
+            /*
+             * The current file has ended; work down the istk
+             */
+            {
+                Include *i = istk;
+                fclose(i->fp);
+                if (i->conds)
+                    error(ERR_FATAL,
+                          "expected `%%endif' before end of file");
+                /* only set line and file name if there's a next node */
+                if (i->next) {
+                    src_set_linnum(i->lineno);
+                    nasm_free(src_set_fname(i->fname));
+               }
+                istk = i->next;
+                list->downlevel(LIST_INCLUDE);
+                nasm_free(i);
+                if (!istk)
+                    return NULL;
+                if (istk->expansion && istk->expansion->finishes)
+                    break;
+            }
+        }
+
+        /*
+         * We must expand MMacro parameters and MMacro-local labels
+         * _before_ we plunge into directive processing, to cope
+         * with things like `%define something %1' such as STRUC
+         * uses. Unless we're _defining_ a MMacro, in which case
+         * those tokens should be left alone to go into the
+         * definition; and unless we're in a non-emitting
+         * condition, in which case we don't want to meddle with
+         * anything.
+         */
+        if (!defining && !(istk->conds && !emitting(istk->conds->state))
+            && !(istk->mstk && !istk->mstk->in_progress)) {
+            tline = expand_mmac_params(tline);
+       }
+
+        /*
+         * Check the line to see if it's a preprocessor directive.
+         */
+        if (do_directive(tline) == DIRECTIVE_FOUND) {
+            continue;
+        } else if (defining) {
+            /*
+             * We're defining a multi-line macro. We emit nothing
+             * at all, and just
+             * shove the tokenized line on to the macro definition.
+             */
+            Line *l = nasm_malloc(sizeof(Line));
+            l->next = defining->expansion;
+            l->first = tline;
+            l->finishes = NULL;
+            defining->expansion = l;
+            continue;
+        } else if (istk->conds && !emitting(istk->conds->state)) {
+            /*
+             * We're in a non-emitting branch of a condition block.
+             * Emit nothing at all, not even a blank line: when we
+             * emerge from the condition we'll give a line-number
+             * directive so we keep our place correctly.
+             */
+            free_tlist(tline);
+            continue;
+        } else if (istk->mstk && !istk->mstk->in_progress) {
+            /*
+             * We're in a %rep block which has been terminated, so
+             * we're walking through to the %endrep without
+             * emitting anything. Emit nothing at all, not even a
+             * blank line: when we emerge from the %rep block we'll
+             * give a line-number directive so we keep our place
+             * correctly.
+             */
+            free_tlist(tline);
+            continue;
+        } else {
+            tline = expand_smacro(tline);
+            if (!expand_mmacro(tline)) {
+                /*
+                 * De-tokenize the line again, and emit it.
+                 */
+                line = detoken(tline, true);
+                free_tlist(tline);
+                break;
+            } else {
+                continue;       /* expand_mmacro calls free_tlist */
+            }
+        }
+    }
+
+    return line;
+}
+
+static void pp_cleanup(int pass)
+{
+    if (defining) {
+        if (defining->name) {
+            error(ERR_NONFATAL,
+                  "end of file while still defining macro `%s'",
+                  defining->name);
+        } else {
+            error(ERR_NONFATAL, "end of file while still in %%rep");
+        }
+
+        free_mmacro(defining);
+    }
+    while (cstk)
+        ctx_pop();
+    free_macros();
+    while (istk) {
+        Include *i = istk;
+        istk = istk->next;
+        fclose(i->fp);
+        nasm_free(i->fname);
+        nasm_free(i);
+    }
+    while (cstk)
+        ctx_pop();
+    nasm_free(src_set_fname(NULL));
+    if (pass == 0) {
+       IncPath *i;
+        free_llist(predef);
+        delete_Blocks();
+       while ((i = ipath)) {
+           ipath = i->next;
+           if (i->path)
+               nasm_free(i->path);
+           nasm_free(i);
+       }
+    }
+}
+
+void pp_include_path(char *path)
+{
+    IncPath *i;
+
+    i = nasm_malloc(sizeof(IncPath));
+    i->path = path ? nasm_strdup(path) : NULL;
+    i->next = NULL;
+
+    if (ipath) {
+        IncPath *j = ipath;
+        while (j->next)
+            j = j->next;
+        j->next = i;
+    } else {
+        ipath = i;
+    }
+}
+
+void pp_pre_include(char *fname)
+{
+    Token *inc, *space, *name;
+    Line *l;
+
+    name = new_Token(NULL, TOK_INTERNAL_STRING, fname, 0);
+    space = new_Token(name, TOK_WHITESPACE, NULL, 0);
+    inc = new_Token(space, TOK_PREPROC_ID, "%include", 0);
+
+    l = nasm_malloc(sizeof(Line));
+    l->next = predef;
+    l->first = inc;
+    l->finishes = NULL;
+    predef = l;
+}
+
+void pp_pre_define(char *definition)
+{
+    Token *def, *space;
+    Line *l;
+    char *equals;
+
+    equals = strchr(definition, '=');
+    space = new_Token(NULL, TOK_WHITESPACE, NULL, 0);
+    def = new_Token(space, TOK_PREPROC_ID, "%define", 0);
+    if (equals)
+        *equals = ' ';
+    space->next = tokenize(definition);
+    if (equals)
+        *equals = '=';
+
+    l = nasm_malloc(sizeof(Line));
+    l->next = predef;
+    l->first = def;
+    l->finishes = NULL;
+    predef = l;
+}
+
+void pp_pre_undefine(char *definition)
+{
+    Token *def, *space;
+    Line *l;
+
+    space = new_Token(NULL, TOK_WHITESPACE, NULL, 0);
+    def = new_Token(space, TOK_PREPROC_ID, "%undef", 0);
+    space->next = tokenize(definition);
+
+    l = nasm_malloc(sizeof(Line));
+    l->next = predef;
+    l->first = def;
+    l->finishes = NULL;
+    predef = l;
+}
+
+/*
+ * Added by Keith Kanios:
+ *
+ * This function is used to assist with "runtime" preprocessor
+ * directives. (e.g. pp_runtime("%define __BITS__ 64");)
+ *
+ * ERRORS ARE IGNORED HERE, SO MAKE COMPLETELY SURE THAT YOU
+ * PASS A VALID STRING TO THIS FUNCTION!!!!!
+ */
+
+void pp_runtime(char *definition)
+{
+    Token *def;
+
+    def = tokenize(definition);
+    if (do_directive(def) == NO_DIRECTIVE_FOUND)
+        free_tlist(def);
+
+}
+
+void pp_extra_stdmac(macros_t *macros)
+{
+    extrastdmac = macros;
+}
+
+static void make_tok_num(Token * tok, int64_t val)
+{
+    char numbuf[20];
+    snprintf(numbuf, sizeof(numbuf), "%"PRId64"", val);
+    tok->text = nasm_strdup(numbuf);
+    tok->type = TOK_NUMBER;
+}
+
+Preproc nasmpp = {
+    pp_reset,
+    pp_getline,
+    pp_cleanup
+};
diff --git a/preproc.h b/preproc.h
new file mode 100644 (file)
index 0000000..e48adda
--- /dev/null
+++ b/preproc.h
@@ -0,0 +1,57 @@
+/* ----------------------------------------------------------------------- *
+ *   
+ *   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.
+ *
+ * ----------------------------------------------------------------------- */
+
+/* 
+ * preproc.h  header file for preproc.c
+ */
+
+#ifndef NASM_PREPROC_H
+#define NASM_PREPROC_H
+
+#include "pptok.h"
+
+extern const char * const pp_directives[];
+extern const uint8_t pp_directives_len[];
+
+/* Pointer to a macro chain */
+typedef const unsigned char macros_t;
+
+enum preproc_token pp_token_hash(const char *token);
+void pp_include_path(char *);
+void pp_pre_include(char *);
+void pp_pre_define(char *);
+void pp_pre_undefine(char *);
+void pp_runtime(char *);
+void pp_extra_stdmac(macros_t *);
+
+#endif
diff --git a/quote.c b/quote.c
new file mode 100644 (file)
index 0000000..2cb55b1
--- /dev/null
+++ b/quote.c
@@ -0,0 +1,477 @@
+/* ----------------------------------------------------------------------- *
+ *   
+ *   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.
+ *
+ * ----------------------------------------------------------------------- */
+
+/*
+ * quote.c
+ */
+
+#include "compiler.h"
+
+#include <stdlib.h>
+
+#include "nasmlib.h"
+#include "quote.h"
+
+#define numvalue(c)  ((c)>='a' ? (c)-'a'+10 : (c)>='A' ? (c)-'A'+10 : (c)-'0')
+
+char *nasm_quote(char *str, size_t len)
+{
+    char c, c1, *p, *q, *nstr, *ep;
+    unsigned char uc;
+    bool sq_ok, dq_ok;
+    size_t qlen;
+
+    sq_ok = dq_ok = true;
+    ep = str+len;
+    qlen = 0;                  /* Length if we need `...` quotes */
+    for (p = str; p < ep; p++) {
+       c = *p;
+       switch (c) {
+       case '\'':
+           sq_ok = false;
+           qlen++;
+           break;
+       case '\"':
+           dq_ok = false;
+           qlen++;
+           break;
+       case '`':
+       case '\\':
+           qlen += 2;
+           break;
+       default:
+           if (c < ' ' || c > '~') {
+               sq_ok = dq_ok = false;
+               switch (c) {
+               case '\a':
+               case '\b':
+               case '\t':
+               case '\n':
+               case '\v':
+               case '\f':
+               case '\r':
+               case 27:
+                   qlen += 2;
+                   break;
+               default:
+                   c1 = (p+1 < ep) ? p[1] : 0;
+                   if (c1 >= '0' && c1 <= '7')
+                       uc = 0377; /* Must use the full form */
+                   else
+                       uc = c;
+                   if (uc > 077)
+                       qlen++;
+                   if (uc > 07)
+                       qlen++;
+                   qlen += 2;
+                   break;
+               }
+           } else {
+               qlen++;
+           }
+           break;
+       }
+    }
+
+    if (sq_ok || dq_ok) {
+       /* Use '...' or "..." */
+       nstr = nasm_malloc(len+3);
+       nstr[0] = nstr[len+1] = sq_ok ? '\'' : '\"';
+       nstr[len+2] = '\0';
+       memcpy(nstr+1, str, len);
+    } else {
+       /* Need to use `...` quoted syntax */
+       nstr = nasm_malloc(qlen+3);
+       q = nstr;
+       *q++ = '`';
+       for (p = str; p < ep; p++) {
+           c = *p;
+           switch (c) {
+           case '`':
+           case '\\':
+               *q++ = '\\';
+               *q++ = c;
+               break;
+           case 7:
+               *q++ = '\\';
+               *q++ = 'a';
+               break;
+           case 8:
+               *q++ = '\\';
+               *q++ = 'b';
+               break;
+           case 9:
+               *q++ = '\\';
+               *q++ = 't';
+               break;
+           case 10:
+               *q++ = '\\';
+               *q++ = 'n';
+               break;
+           case 11:
+               *q++ = '\\';
+               *q++ = 'v';
+               break;
+           case 12:
+               *q++ = '\\';
+               *q++ = 'f';
+               break;
+           case 13:
+               *q++ = '\\';
+               *q++ = 'r';
+               break;
+           case 27:
+               *q++ = '\\';
+               *q++ = 'e';
+               break;
+           default:
+               if (c < ' ' || c > '~') {
+                   c1 = (p+1 < ep) ? p[1] : 0;
+                   if (c1 >= '0' && c1 <= '7')
+                       uc = 0377; /* Must use the full form */
+                   else
+                       uc = c;
+                   *q++ = '\\';
+                   if (uc > 077)
+                       *q++ = ((unsigned char)c >> 6) + '0';
+                   if (uc > 07)
+                       *q++ = (((unsigned char)c >> 3) & 7) + '0';
+                   *q++ = ((unsigned char)c & 7) + '0';
+                   break;
+               } else {
+                   *q++ = c;
+               }
+               break;
+           }
+       }
+       *q++ = '`';
+       *q++ = '\0';
+       nasm_assert((size_t)(q-nstr) == qlen+3);
+    }
+    return nstr;
+}
+
+static char *emit_utf8(char *q, int32_t v)
+{
+    if (v < 0) {
+       /* Impossible - do nothing */
+    } else if (v <= 0x7f) {
+       *q++ = v;
+    } else if (v <= 0x000007ff) {
+       *q++ = 0xc0 | (v >> 6);
+       *q++ = 0x80 | (v & 63);
+    } else if (v <= 0x0000ffff) {
+       *q++ = 0xe0 | (v >> 12);
+       *q++ = 0x80 | ((v >> 6) & 63);
+       *q++ = 0x80 | (v & 63);
+    } else if (v <= 0x001fffff) {
+       *q++ = 0xf0 | (v >> 18);
+       *q++ = 0x80 | ((v >> 12) & 63);
+       *q++ = 0x80 | ((v >> 6) & 63);
+       *q++ = 0x80 | (v & 63);
+    } else if (v <= 0x03ffffff) {
+       *q++ = 0xf8 | (v >> 24);
+       *q++ = 0x80 | ((v >> 18) & 63);
+       *q++ = 0x80 | ((v >> 12) & 63);
+       *q++ = 0x80 | ((v >> 6) & 63);
+       *q++ = 0x80 | (v & 63);
+    } else {
+       *q++ = 0xfc | (v >> 30);
+       *q++ = 0x80 | ((v >> 24) & 63);
+       *q++ = 0x80 | ((v >> 18) & 63);
+       *q++ = 0x80 | ((v >> 12) & 63);
+       *q++ = 0x80 | ((v >> 6) & 63);
+       *q++ = 0x80 | (v & 63);
+    }
+    return q;
+}
+
+/*
+ * Do an *in-place* dequoting of the specified string, returning the
+ * resulting length (which may be containing embedded nulls.)
+ *
+ * In-place replacement is possible since the unquoted length is always
+ * shorter than or equal to the quoted length.
+ *
+ * *ep points to the final quote, or to the null if improperly quoted.
+ */
+size_t nasm_unquote(char *str, char **ep)
+{
+    char bq;
+    char *p, *q;
+    char *escp = NULL;
+    char c;
+    enum unq_state {
+       st_start,
+       st_backslash,
+       st_hex,
+       st_oct,
+       st_ucs,
+    } state;
+    int ndig = 0;
+    int32_t nval = 0;
+
+    p = q = str;
+    
+    bq = *p++;
+    if (!bq)
+       return 0;
+
+    switch (bq) {
+    case '\'':
+    case '\"':
+       /* '...' or "..." string */
+       while ((c = *p) && c != bq) {
+           p++;
+           *q++ = c;
+       }
+       *q = '\0';
+       break;
+
+    case '`':
+       /* `...` string */
+       state = st_start;
+
+       while ((c = *p)) {
+           p++;
+           switch (state) {
+           case st_start:
+               switch (c) {
+               case '\\':
+                   state = st_backslash;
+                   break;
+               case '`':
+                   p--;
+                   goto out;
+               default:
+                   *q++ = c;
+                   break;
+               }
+               break;
+
+           case st_backslash:
+               state = st_start;
+               escp = p;       /* Beginning of argument sequence */
+               nval = 0;
+               switch (c) {
+               case 'a':
+                   *q++ = 7;
+                   break;
+               case 'b':
+                   *q++ = 8;
+                   break;
+               case 'e':
+                   *q++ = 27;
+                   break;
+               case 'f':
+                   *q++ = 12;
+                   break;
+               case 'n':
+                   *q++ = 10;
+                   break;
+               case 'r':
+                   *q++ = 13;
+                   break;
+               case 't':
+                   *q++ = 9;
+                   break;
+               case 'u':
+                   state = st_ucs;
+                   ndig = 4;
+                   break;
+               case 'U':
+                   state = st_ucs;
+                   ndig = 8;
+                   break;
+               case 'v':
+                   *q++ = 11;
+                   break;
+               case 'x':
+               case 'X':
+                   state = st_hex;
+                   ndig = 2;
+                   break;
+               case '0':
+               case '1':
+               case '2':
+               case '3':
+               case '4':
+               case '5':
+               case '6':
+               case '7':
+                   state = st_oct;
+                   ndig = 2;   /* Up to two more digits */
+                   nval = c - '0';
+                   break;
+               default:
+                   *q++ = c;
+                   break;
+               }
+               break;
+
+           case st_oct:
+               if (c >= '0' && c <= '7') {
+                   nval = (nval << 3) + (c - '0');
+                   if (!--ndig) {
+                       *q++ = nval;
+                       state = st_start;
+                   }
+               } else {
+                   p--;        /* Process this character again */
+                   *q++ = nval;
+                   state = st_start;
+               }
+               break;
+
+           case st_hex:
+               if ((c >= '0' && c <= '9') ||
+                   (c >= 'A' && c <= 'F') ||
+                   (c >= 'a' && c <= 'f')) {
+                   nval = (nval << 4) + numvalue(c);
+                   if (!--ndig) {
+                       *q++ = nval;
+                       state = st_start;
+                   }
+               } else {
+                   p--;        /* Process this character again */
+                   *q++ = (p > escp) ? nval : escp[-1];
+                   state = st_start;
+               }
+               break;
+
+           case st_ucs:
+               if ((c >= '0' && c <= '9') ||
+                   (c >= 'A' && c <= 'F') ||
+                   (c >= 'a' && c <= 'f')) {
+                   nval = (nval << 4) + numvalue(c);
+                   if (!--ndig) {
+                       q = emit_utf8(q, nval);
+                       state = st_start;
+                   }
+               } else {
+                   p--;        /* Process this character again */
+                   if (p > escp)
+                       q = emit_utf8(q, nval);
+                   else
+                       *q++ = escp[-1];
+                   state = st_start;
+               }
+               break;
+           }
+       }
+       switch (state) {
+       case st_start:
+       case st_backslash:
+           break;
+       case st_oct:
+           *q++ = nval;
+           break;
+       case st_hex:
+           *q++ = (p > escp) ? nval : escp[-1];
+           break;
+       case st_ucs:
+           if (p > escp)
+               q = emit_utf8(q, nval);
+           else
+               *q++ = escp[-1];
+           break;
+       }
+    out:
+       break;
+
+    default:
+       /* Not a quoted string, just return the input... */
+       p = q = strchr(str, '\0');
+       break;
+    }
+
+    if (ep)
+       *ep = p;
+    return q-str;
+}
+
+/*
+ * Find the end of a quoted string; returns the pointer to the terminating
+ * character (either the ending quote or the null character, if unterminated.)
+ */
+char *nasm_skip_string(char *str)
+{
+    char bq;
+    char *p;
+    char c;
+    enum unq_state {
+       st_start,
+       st_backslash,
+    } state;
+
+    bq = str[0];
+    if (bq == '\'' || bq == '\"') {
+       /* '...' or "..." string */
+       for (p = str+1; *p && *p != bq; p++)
+           ;
+       return p;
+    } else if (bq == '`') {
+       /* `...` string */
+       p = str+1;
+       state = st_start;
+
+       while ((c = *p++)) {
+           switch (state) {
+           case st_start:
+               switch (c) {
+               case '\\':
+                   state = st_backslash;
+                   break;
+               case '`':
+                   return p-1; /* Found the end */
+               default:
+                   break;
+               }
+               break;
+
+           case st_backslash:
+               /*
+                * Note: for the purpose of finding the end of the string,
+                * all successor states to st_backslash are functionally
+                * equivalent to st_start, since either a backslash or
+                * a backquote will force a return to the st_start state.
+                */
+               state = st_start;
+               break;
+           }
+       }
+       return p;               /* Unterminated string... */
+    } else {
+       return str;             /* Not a string... */
+    }
+}
diff --git a/quote.h b/quote.h
new file mode 100644 (file)
index 0000000..13089cb
--- /dev/null
+++ b/quote.h
@@ -0,0 +1,44 @@
+/* ----------------------------------------------------------------------- *
+ *   
+ *   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.
+ *
+ * ----------------------------------------------------------------------- */
+
+#ifndef NASM_QUOTE_H
+#define NASM_QUOTE_H
+
+#include "compiler.h"
+
+char *nasm_quote(char *str, size_t len);
+size_t nasm_unquote(char *str, char **endptr);
+char *nasm_skip_string(char *str);
+
+#endif /* NASM_QUOTE_H */
+
diff --git a/raa.c b/raa.c
new file mode 100644 (file)
index 0000000..be912a4
--- /dev/null
+++ b/raa.c
@@ -0,0 +1,128 @@
+/* ----------------------------------------------------------------------- *
+ *   
+ *   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.
+ *
+ * ----------------------------------------------------------------------- */
+
+#include "nasmlib.h"
+#include "raa.h"
+
+#define LEAFSIZ (sizeof(RAA)-sizeof(RAA_UNION)+sizeof(RAA_LEAF))
+#define BRANCHSIZ (sizeof(RAA)-sizeof(RAA_UNION)+sizeof(RAA_BRANCH))
+
+#define LAYERSHIFT(r) ( (r)->layers==0 ? RAA_BLKSHIFT : RAA_LAYERSHIFT )
+
+static struct RAA *real_raa_init(int layers)
+{
+    struct RAA *r;
+    int i;
+
+    if (layers == 0) {
+        r = nasm_zalloc(LEAFSIZ);
+        r->shift = 0;
+    } else {
+        r = nasm_malloc(BRANCHSIZ);
+        r->layers = layers;
+        for (i = 0; i < RAA_LAYERSIZE; i++)
+            r->u.b.data[i] = NULL;
+        r->shift =
+            (RAA_BLKSHIFT - RAA_LAYERSHIFT) + layers * RAA_LAYERSHIFT;
+    }
+    return r;
+}
+
+struct RAA *raa_init(void)
+{
+    return real_raa_init(0);
+}
+
+void raa_free(struct RAA *r)
+{
+    if (r->layers) {
+        struct RAA **p;
+        for (p = r->u.b.data; p - r->u.b.data < RAA_LAYERSIZE; p++)
+            if (*p)
+                raa_free(*p);
+    }
+    nasm_free(r);
+}
+
+int64_t raa_read(struct RAA *r, int32_t posn)
+{
+    if ((uint32_t) posn >= (UINT32_C(1) << (r->shift + LAYERSHIFT(r))))
+        return 0;               /* Return 0 for undefined entries */
+    while (r->layers > 0) {
+        int32_t l = posn >> r->shift;
+        posn &= (UINT32_C(1) << r->shift) - 1;
+        r = r->u.b.data[l];
+        if (!r)
+            return 0;           /* Return 0 for undefined entries */
+    }
+    return r->u.l.data[posn];
+}
+
+struct RAA *raa_write(struct RAA *r, int32_t posn, int64_t value)
+{
+    struct RAA *result;
+
+    nasm_assert(posn >= 0);
+
+    while ((UINT32_C(1) << (r->shift + LAYERSHIFT(r))) <= (uint32_t) posn) {
+        /*
+         * Must add a layer.
+         */
+        struct RAA *s;
+        int i;
+
+        s = nasm_malloc(BRANCHSIZ);
+        for (i = 0; i < RAA_LAYERSIZE; i++)
+            s->u.b.data[i] = NULL;
+        s->layers = r->layers + 1;
+        s->shift = LAYERSHIFT(r) + r->shift;
+        s->u.b.data[0] = r;
+        r = s;
+    }
+
+    result = r;
+
+    while (r->layers > 0) {
+        struct RAA **s;
+        int32_t l = posn >> r->shift;
+        posn &= (UINT32_C(1) << r->shift) - 1;
+        s = &r->u.b.data[l];
+        if (!*s)
+            *s = real_raa_init(r->layers - 1);
+        r = *s;
+    }
+
+    r->u.l.data[posn] = value;
+
+    return result;
+}
diff --git a/raa.h b/raa.h
new file mode 100644 (file)
index 0000000..d47f84c
--- /dev/null
+++ b/raa.h
@@ -0,0 +1,89 @@
+/* ----------------------------------------------------------------------- *
+ *   
+ *   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.
+ *
+ * ----------------------------------------------------------------------- */
+
+#ifndef NASM_RAA_H
+#define NASM_RAA_H 1
+
+#include "compiler.h"
+
+/*
+ * Routines to manage a dynamic random access array of int64_ts which
+ * may grow in size to be more than the largest single malloc'able
+ * chunk.
+ */
+
+#define RAA_BLKSHIFT   15      /* 2**this many longs allocated at once */
+#define RAA_BLKSIZE    (1 << RAA_BLKSHIFT)
+#define RAA_LAYERSHIFT 15      /* 2**this many _pointers_ allocated */
+#define RAA_LAYERSIZE  (1 << RAA_LAYERSHIFT)
+
+typedef struct RAA RAA;
+typedef union RAA_UNION RAA_UNION;
+typedef struct RAA_LEAF RAA_LEAF;
+typedef struct RAA_BRANCH RAA_BRANCH;
+
+struct RAA {
+    /*
+     * Number of layers below this one to get to the real data. 0
+     * means this structure is a leaf, holding RAA_BLKSIZE real
+     * data items; 1 and above mean it's a branch, holding
+     * RAA_LAYERSIZE pointers to the next level branch or leaf
+     * structures.
+     */
+    int layers;
+
+    /*
+     * Number of real data items spanned by one position in the
+     * `data' array at this level. This number is 0 trivially, for
+     * a leaf (level 0): for a level 1 branch it should be
+     * RAA_BLKSHIFT, and for a level 2 branch it's
+     * RAA_LAYERSHIFT+RAA_BLKSHIFT.
+     */
+    int shift;
+
+    union RAA_UNION {
+        struct RAA_LEAF {
+            int64_t data[RAA_BLKSIZE];
+        } l;
+        struct RAA_BRANCH {
+            struct RAA *data[RAA_LAYERSIZE];
+        } b;
+    } u;
+};
+
+struct RAA *raa_init(void);
+void raa_free(struct RAA *);
+int64_t raa_read(struct RAA *, int32_t);
+struct RAA *raa_write(struct RAA *r, int32_t posn, int64_t value);
+
+#endif                          /* NASM_RAA_H */
diff --git a/rbtree.c b/rbtree.c
new file mode 100644 (file)
index 0000000..5af6067
--- /dev/null
+++ b/rbtree.c
@@ -0,0 +1,119 @@
+/* ----------------------------------------------------------------------- *
+ *   
+ *   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.
+ *
+ * ----------------------------------------------------------------------- */
+
+/*
+ * rbtree.c
+ *
+ * Simple implementation of a left-leaning red-black tree with 64-bit
+ * integer keys.  The search operation will return the highest node <=
+ * the key; only search and insert are supported, but additional
+ * standard llrbtree operations can be coded up at will.
+ *
+ * See http://www.cs.princeton.edu/~rs/talks/LLRB/RedBlack.pdf for
+ * information about left-leaning red-black trees.
+ */
+
+#include "rbtree.h"
+
+struct rbtree *rb_search(struct rbtree *tree, uint64_t key)
+{
+    struct rbtree *best = NULL;
+
+    while (tree) {
+       if (tree->key == key)
+           return tree;
+       else if (tree->key > key)
+           tree = tree->left;
+       else {
+           best = tree;
+           tree = tree->right;
+       }
+    }
+    return best;
+}
+
+static bool is_red(struct rbtree *h)
+{
+    return h && h->red;
+}
+
+static struct rbtree *rotate_left(struct rbtree *h)
+{
+    struct rbtree *x = h->right;
+    h->right = x->left;
+    x->left = h;
+    x->red = x->left->red;
+    x->left->red = true;
+    return x;
+}
+
+static struct rbtree *rotate_right(struct rbtree *h)
+{
+    struct rbtree *x = h->left;
+    h->left = x->right;
+    x->right = h;
+    x->red = x->right->red;
+    x->right->red = true;
+    return x;
+}
+
+static void color_flip(struct rbtree *h)
+{
+    h->red = !h->red;
+    h->left->red = !h->left->red;
+    h->right->red = !h->right->red;
+}
+
+struct rbtree *rb_insert(struct rbtree *tree, struct rbtree *node)
+{
+    if (!tree) {
+       node->red = true;
+       return node;
+    }
+
+    if (is_red(tree->left) && is_red(tree->right))
+       color_flip(tree);
+
+    if (node->key < tree->key)
+       tree->left = rb_insert(tree->left, node);
+    else
+       tree->right = rb_insert(tree->right, node);
+
+    if (is_red(tree->right))
+       tree = rotate_left(tree);
+
+    if (is_red(tree->left) && is_red(tree->left->left))
+       tree = rotate_right(tree);
+
+    return tree;
+}
diff --git a/rbtree.h b/rbtree.h
new file mode 100644 (file)
index 0000000..ef34789
--- /dev/null
+++ b/rbtree.h
@@ -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.
+ *
+ * ----------------------------------------------------------------------- */
+
+#ifndef NASM_RBTREE_H
+#define NASM_RBTREE_H
+
+#include "compiler.h"
+#include <inttypes.h>
+
+/* This structure should be embedded in a larger data structure;
+   the final output from rb_search() can then be converted back
+   to the larger data structure via container_of(). */
+struct rbtree {
+    uint64_t key;
+    struct rbtree *left, *right;
+    bool red;
+};
+
+struct rbtree *rb_insert(struct rbtree *, struct rbtree *);
+struct rbtree *rb_search(struct rbtree *, uint64_t);
+
+#endif /* NASM_RBTREE_H */
diff --git a/rdoff/Makefile.in b/rdoff/Makefile.in
new file mode 100644 (file)
index 0000000..93f2e2a
--- /dev/null
@@ -0,0 +1,105 @@
+#
+# Auto-configuring Makefile for RDOFF object file utils; part of the
+# Netwide Assembler
+#
+# The Netwide Assembler is copyright (C) 1996 Simon Tatham and
+# Julian Hall. All rights reserved. The software is
+# redistributable under the license given in the file "LICENSE"
+# distributed in the NASM archive.
+
+top_srcdir     = @top_srcdir@
+srcdir         = @srcdir@
+VPATH          = @srcdir@
+prefix         = @prefix@
+exec_prefix    = @exec_prefix@
+bindir         = @bindir@
+mandir         = @mandir@
+datarootdir    = @datarootdir@
+
+CC             = @CC@
+CFLAGS         = @CFLAGS@
+BUILD_CFLAGS   = $(CFLAGS) @DEFS@
+INTERNAL_CFLAGS = -I$(srcdir) -I$(top_srcdir)
+ALL_CFLAGS     = $(BUILD_CFLAGS) $(INTERNAL_CFLAGS)
+LDFLAGS                = @LDFLAGS@
+
+INSTALL                = @INSTALL@
+INSTALL_PROGRAM        = @INSTALL_PROGRAM@
+INSTALL_DATA   = @INSTALL_DATA@
+LN_S           = @LN_S@
+MKDIR          = mkdir
+
+LDRDFLIBS      = rdoff.o nasmlib.o symtab.o collectn.o rdlib.o segtab.o hash.o
+RDXLIBS        = rdoff.o rdfload.o symtab.o collectn.o hash.o
+
+# Binary suffixes
+O               = @OBJEXT@
+X               = @EXEEXT@
+
+PROGRAMS = rdfdump$(X) ldrdf$(X) rdx$(X) rdflib$(X) \
+          rdf2bin$(X) rdf2com$(X) rdf2ith$(X) rdf2ihx$(X) rdf2srec$(X)
+
+.SUFFIXES: .c .i .s .$(O) .1 .man
+
+.c.$(O):
+       $(CC) -c $(ALL_CFLAGS) $<
+
+all: $(PROGRAMS)
+
+rdfdump$(X): rdfdump.$(O) rdoff.$(O)
+       $(CC) $(LDFLAGS) -o rdfdump$(X) rdfdump.$(O) rdoff.$(O)
+ldrdf$(X): ldrdf.$(O) $(LDRDFLIBS)
+       $(CC) $(LDFLAGS) -o ldrdf$(X) ldrdf.$(O) $(LDRDFLIBS)
+rdx$(X): rdx.$(O) $(RDXLIBS)
+       $(CC) $(LDFLAGS) -o rdx$(X) rdx.$(O) $(RDXLIBS)
+rdflib$(X): rdflib.$(O)
+       $(CC) $(LDFLAGS) -o rdflib$(X) rdflib.$(O)
+rdf2bin$(X): rdf2bin.$(O) $(RDXLIBS) nasmlib.$(O)
+       $(CC) $(LDFLAGS) -o rdf2bin$(X) rdf2bin.$(O) $(RDXLIBS) nasmlib.$(O)
+rdf2com$(X):
+       rm -f rdf2com$(X) && $(LN_S) rdf2bin$(X) rdf2com$(X)
+rdf2ith$(X):
+       rm -f rdf2ith$(X) && $(LN_S) rdf2bin$(X) rdf2ith$(X)
+rdf2ihx$(X):
+       rm -f rdf2ihx$(X) && $(LN_S) rdf2bin$(X) rdf2ihx$(X)
+rdf2srec$(X):
+       rm -f rdf2srec$(X) && $(LN_S) rdf2bin$(X) rdf2srec$(X)
+
+rdf2ihx.$(O): rdf2ihx.c
+rdf2bin.$(O): rdf2bin.c
+rdfdump.$(O): rdfdump.c
+rdoff.$(O): rdoff.c rdoff.h
+ldrdf.$(O): ldrdf.c rdoff.h ../nasmlib.h symtab.h collectn.h rdlib.h
+symtab.$(O): symtab.c symtab.h
+collectn.$(O): collectn.c collectn.h
+rdx.$(O): rdx.c rdoff.h rdfload.h symtab.h
+rdfload.$(O): rdfload.c rdfload.h rdoff.h collectn.h symtab.h
+rdlib.$(O): rdlib.c rdlib.h
+rdflib.$(O): rdflib.c
+segtab.$(O): segtab.c
+
+nasmlib.$(O): $(top_srcdir)/nasmlib.c
+       cd .. && $(MAKE) nasmlib.$(O)
+       cp ../nasmlib.$(O) .
+
+clean:
+       rm -f *.$(O) $(PROGRAMS)
+
+spotless: clean
+       rm -f Makefile
+
+distclean: spotless
+
+install: all
+       $(MKDIR) -p $(INSTALLROOT)$(bindir)
+       $(INSTALL_PROGRAM) rdfdump$(X) $(INSTALLROOT)$(bindir)/rdfdump$(X)
+       $(INSTALL_PROGRAM) ldrdf$(X) $(INSTALLROOT)$(bindir)/ldrdf$(X)
+       $(INSTALL_PROGRAM) rdx$(X) $(INSTALLROOT)$(bindir)/rdx$(X)
+       $(INSTALL_PROGRAM) rdflib$(X) $(INSTALLROOT)$(bindir)/rdflib$(X)
+       $(INSTALL_PROGRAM) rdf2bin$(X) $(INSTALLROOT)$(bindir)/rdf2bin$(X)
+       cd $(INSTALLROOT)$(bindir) && rm -f rdf2com$(X) && $(LN_S) rdf2bin$(X) rdf2com$(X)
+       cd $(INSTALLROOT)$(bindir) && rm -f rdf2ith$(X) && $(LN_S) rdf2bin$(X) rdf2ith$(X)
+       cd $(INSTALLROOT)$(bindir) && rm -f rdf2ihx$(X) && $(LN_S) rdf2bin$(X) rdf2ihx$(X)
+       cd $(INSTALLROOT)$(bindir) && rm -f rdf2srec$(X) && $(LN_S) rdf2bin$(X) rdf2srec$(X)
+       $(MKDIR) -p $(INSTALLROOT)$(mandir)/man1
+       $(INSTALL_DATA) $(srcdir)/*.1 $(INSTALLROOT)$(mandir)/man1/
diff --git a/rdoff/Mkfiles/Makefile.dj b/rdoff/Mkfiles/Makefile.dj
new file mode 100644 (file)
index 0000000..5621ed6
--- /dev/null
@@ -0,0 +1,75 @@
+# Generated automatically from Makefile.in by configure.
+#
+# Auto-configuring Makefile for RDOFF object file utils; part of the
+# Netwide Assembler
+#
+# The Netwide Assembler is copyright (C) 1996 Simon Tatham and
+# Julian Hall. All rights reserved. The software is
+# redistributable under the license given in the file "LICENSE"
+# distributed in the NASM archive.
+
+# You may need to adjust these values.
+
+prefix = /djgpp
+CC = gcc -s
+CFLAGS = -O2 -I..
+
+# You _shouldn't_ need to adjust anything below this line.
+
+exec_prefix = ${prefix}
+bindir = ${exec_prefix}/bin
+mandir = ${prefix}/man
+
+INSTALL = /usr/bin/install -c
+INSTALL_PROGRAM = ${INSTALL}
+INSTALL_DATA = ${INSTALL} -m 644
+LN_S = ln -s
+
+LDRDFLIBS = rdoff.o ../nasmlib.o symtab.o hash.o collectn.o rdlib.o segtab.o
+RDXLIBS = rdoff.o rdfload.o symtab.o hash.o collectn.o
+
+.c.o:
+       $(CC) -c $(CFLAGS) $*.c
+
+all: rdfdump ldrdf rdx rdflib rdf2bin rdf2com
+
+rdfdump: rdfdump.o rdoff.o
+       $(CC) -o rdfdump rdfdump.o rdoff.o
+
+ldrdf: ldrdf.o $(LDRDFLIBS)
+       $(CC) -o ldrdf ldrdf.o $(LDRDFLIBS)
+rdx: rdx.o $(RDXLIBS)
+       $(CC) -o rdx rdx.o $(RDXLIBS)
+rdflib: rdflib.o
+       $(CC) -o rdflib rdflib.o
+rdf2bin: rdf2bin.o $(RDXLIBS) nasmlib.o
+       $(CC) -o rdf2bin rdf2bin.o $(RDXLIBS) nasmlib.o
+rdf2com:
+       $(LN_S) rdf2bin rdf2com
+
+rdf2bin.o: rdf2bin.c
+rdfdump.o: rdfdump.c
+rdoff.o: rdoff.c rdoff.h
+ldrdf.o: ldrdf.c rdoff.h ../nasmlib.h symtab.h collectn.h rdlib.h
+symtab.o: symtab.c symtab.h hash.h
+collectn.o: collectn.c collectn.h
+rdx.o: rdx.c rdoff.h rdfload.h symtab.h
+rdfload.o: rdfload.c rdfload.h rdoff.h collectn.h symtab.h
+rdlib.o: rdlib.c rdlib.h
+rdflib.o: rdflib.c
+hash.o: hash.c hash.h
+segtab.o: segtab.c segtab.h
+
+nasmlib.o: ../nasmlib.c ../nasmlib.h ../names.c ../nasm.h
+       $(CC) -c $(CFLAGS) ../nasmlib.c
+
+clean:
+       rm -f *.o rdfdump ldrdf rdx rdflib rdf2bin rdf2com
+
+install: rdfdump ldrdf rdx rdflib rdf2bin rdf2com
+       $(INSTALL_PROGRAM) rdfdump $(bindir)/rdfdump
+       $(INSTALL_PROGRAM) ldrdf $(bindir)/ldrdf
+       $(INSTALL_PROGRAM) rdx $(bindir)/rdx
+       $(INSTALL_PROGRAM) rdflib $(bindir)/rdflib
+       $(INSTALL_PROGRAM) rdf2bin $(bindir)/rdf2bin
+       cd $(bindir); $(LN_S) rdf2bin rdf2com
diff --git a/rdoff/Mkfiles/Makefile.emx b/rdoff/Mkfiles/Makefile.emx
new file mode 100644 (file)
index 0000000..aa53588
--- /dev/null
@@ -0,0 +1,76 @@
+# Generated automatically from Makefile.in by configure.
+# $Id$
+#
+# Auto-configuring Makefile for RDOFF object file utils; part of the
+# Netwide Assembler
+#
+# The Netwide Assembler is copyright (C) 1996 Simon Tatham and
+# Julian Hall. All rights reserved. The software is
+# redistributable under the license given in the file "LICENSE"
+# distributed in the NASM archive.
+
+top_srcdir     = ..
+srcdir         = .
+prefix         = /usr/local
+exec_prefix    = ${prefix}
+bindir         = ${exec_prefix}/bin
+mandir         = ${prefix}/man
+
+CC             = gcc
+CFLAGS         = -s -Zomf -O2 -fomit-frame-pointer -Wall -ansi -pedantic -I$(srcdir) -I$(top_srcdir)
+LDFLAGS                = -s -Zomf -Zexe -Zcrtdll
+LIBS           = -lgcc
+
+INSTALL                = .././install-sh -c
+INSTALL_PROGRAM        = ${INSTALL}
+INSTALL_DATA   = ${INSTALL} -m 644
+
+LDRDFLIBS      = rdoff.o nasmlib.o symtab.o collectn.o rdlib.o segtab.o hash.o
+RDXLIBS        = rdoff.o rdfload.o symtab.o collectn.o hash.o
+
+.c.o:
+       $(CC) -c $(CFLAGS) -o $@ $<
+
+all: rdfdump ldrdf rdx rdflib rdf2bin
+
+rdfdump: rdfdump.o rdoff.o
+       $(CC) $(LDFLAGS) -o rdfdump rdfdump.o rdoff.o $(LIBS)
+ldrdf: ldrdf.o $(LDRDFLIBS)
+       $(CC) $(LDFLAGS) -o ldrdf ldrdf.o $(LDRDFLIBS) $(LIBS)
+rdx: rdx.o $(RDXLIBS)
+       $(CC) $(LDFLAGS) -o rdx rdx.o $(RDXLIBS) $(LIBS)
+rdflib: rdflib.o
+       $(CC) $(LDFLAGS) -o rdflib rdflib.o $(LIBS)
+rdf2bin: rdf2bin.o $(RDXLIBS) nasmlib.o
+       $(CC) $(LDFLAGS) -o rdf2bin rdf2bin.o $(RDXLIBS) nasmlib.o $(LIBS)
+
+rdf2bin.o: rdf2bin.c
+rdfdump.o: rdfdump.c
+rdoff.o: rdoff.c rdoff.h
+ldrdf.o: ldrdf.c rdoff.h $(top_srcdir)/nasmlib.h symtab.h collectn.h rdlib.h
+symtab.o: symtab.c symtab.h
+collectn.o: collectn.c collectn.h
+rdx.o: rdx.c rdoff.h rdfload.h symtab.h
+rdfload.o: rdfload.c rdfload.h rdoff.h collectn.h symtab.h
+rdlib.o: rdlib.c rdlib.h
+rdflib.o: rdflib.c
+segtab.o: segtab.c
+
+nasmlib.o: $(top_srcdir)/nasmlib.c
+       $(CC) -c $(CFLAGS) -o $@ $(top_srcdir)/nasmlib.c
+
+clean:
+       rm -f *.o rdfdump ldrdf rdx rdflib rdf2bin rdf2com
+
+spotless: clean
+       rm -f Makefile
+
+distclean: spotless
+
+install: rdfdump ldrdf rdx rdflib rdf2bin rdf2com
+       $(INSTALL_PROGRAM) rdfdump $(INSTALLROOT)$(bindir)/rdfdump
+       $(INSTALL_PROGRAM) ldrdf $(INSTALLROOT)$(bindir)/ldrdf
+       $(INSTALL_PROGRAM) rdx $(INSTALLROOT)$(bindir)/rdx
+       $(INSTALL_PROGRAM) rdflib $(INSTALLROOT)$(bindir)/rdflib
+       $(INSTALL_PROGRAM) rdf2bin $(INSTALLROOT)$(bindir)/rdf2bin
+       cd $(INSTALLROOT)$(bindir) && rm -f rdf2com && $(LN_S) rdf2bin rdf2com
diff --git a/rdoff/Mkfiles/Makefile.sc b/rdoff/Mkfiles/Makefile.sc
new file mode 100644 (file)
index 0000000..501d487
--- /dev/null
@@ -0,0 +1,56 @@
+# Makefile for RDOFF object file utils; part of the Netwide Assembler
+#
+# The Netwide Assembler is copyright (C) 1996 Simon Tatham and
+# Julian Hall. All rights reserved. The software is
+# redistributable under the license given in the file "LICENSE"
+# distributed in the NASM archive.
+#
+# This Makefile is designed for use under Unix (probably fairly
+# portably).
+
+CC = sc
+CCFLAGS = -I..\ -c -a1 -mn -Nc -w2 -w7 -o+time -5
+LINK = link
+LINKFLAGS = /noi /exet:NT /su:console
+
+OBJ=obj
+EXE=.exe
+
+NASMLIB = ..\nasmlib.$(OBJ)
+NASMLIB_H = ..\nasmlib.h
+LDRDFLIBS = rdoff.$(OBJ) $(NASMLIB) symtab.$(OBJ) collectn.$(OBJ) rdlib.$(OBJ)
+RDXLIBS = rdoff.$(OBJ) rdfload.$(OBJ) symtab.$(OBJ) collectn.$(OBJ)
+
+.c.$(OBJ):
+       $(CC) $(CCFLAGS) $*.c
+
+all : rdfdump$(EXE) ldrdf$(EXE) rdx$(EXE) rdflib$(EXE) rdf2bin$(EXE) rdf2com$(EXE)
+
+rdfdump$(EXE)   : rdfdump.$(OBJ)
+        $(LINK) $(LINKFLAGS) rdfdump.$(OBJ), rdfdump$(EXE);
+ldrdf$(EXE)     : ldrdf.$(OBJ) $(LDRDFLIBS)
+        $(LINK) $(LINKFLAGS) ldrdf.$(OBJ) $(LDRDFLIBS), ldrdf$(EXE);
+rdx$(EXE)       : rdx.$(OBJ) $(RDXLIBS)
+        $(LINK) $(LINKFLAGS) rdx.$(OBJ) $(RDXLIBS), rdx$(EXE);
+rdflib$(EXE)    : rdflib.$(OBJ)
+        $(LINK) $(LINKFLAGS) rdflib.$(OBJ), rdflib$(EXE);
+rdf2bin$(EXE)   : rdf2bin.$(OBJ) $(RDXLIBS) $(NASMLIB)
+        $(LINK) $(LINKFLAGS) rdf2bin.$(OBJ) $(RDXLIBS) $(NASMLIB), rdf2bin$(EXE);
+rdf2com$(EXE)   : rdf2bin$(EXE)
+        copy rdf2bin$(EXE) rdf2com$(EXE)
+
+rdf2bin.$(OBJ)  : rdf2bin.c
+rdfdump.$(OBJ)  : rdfdump.c
+rdoff.$(OBJ)    : rdoff.c rdoff.h
+ldrdf.$(OBJ)    : ldrdf.c rdoff.h $(NASMLIB_H) symtab.h collectn.h rdlib.h
+symtab.$(OBJ)   : symtab.c symtab.h
+collectn.$(OBJ) : collectn.c collectn.h
+rdx.$(OBJ)      : rdx.c rdoff.h rdfload.h symtab.h
+rdfload.$(OBJ)  : rdfload.c rdfload.h rdoff.h collectn.h symtab.h
+rdlib.$(OBJ)    : rdlib.c rdlib.h
+rdflib.$(OBJ)   : rdflib.c
+
+clean :
+        del *.$(OBJ) rdfdump$(EXE) ldrdf$(EXE) rdx$(EXE) rdflib$(EXE) rdf2bin$(EXE)
+
+
diff --git a/rdoff/Mkfiles/Makefile.unx b/rdoff/Mkfiles/Makefile.unx
new file mode 100644 (file)
index 0000000..9041b41
--- /dev/null
@@ -0,0 +1,75 @@
+# Generated automatically from Makefile.in by configure.
+#
+# Auto-configuring Makefile for RDOFF object file utils; part of the
+# Netwide Assembler
+#
+# The Netwide Assembler is copyright (C) 1996 Simon Tatham and
+# Julian Hall. All rights reserved. The software is
+# redistributable under the license given in the file "LICENSE"
+# distributed in the NASM archive.
+
+# You may need to adjust these values.
+
+prefix = /usr/local
+CC = cc
+CFLAGS = -O -I..
+
+# You _shouldn't_ need to adjust anything below this line.
+
+exec_prefix = ${prefix}
+bindir = ${exec_prefix}/bin
+mandir = ${prefix}/man
+
+INSTALL = /usr/bin/install -c
+INSTALL_PROGRAM = ${INSTALL}
+INSTALL_DATA = ${INSTALL} -m 644
+LN_S = ln -s
+
+LDRDFLIBS = rdoff.o ../nasmlib.o symtab.o hash.o collectn.o rdlib.o segtab.o
+RDXLIBS = rdoff.o rdfload.o symtab.o hash.o collectn.o
+
+.c.o:
+       $(CC) -c $(CFLAGS) $*.c
+
+all: rdfdump ldrdf rdx rdflib rdf2bin rdf2com
+
+rdfdump: rdfdump.o rdoff.o
+       $(CC) -o rdfdump rdfdump.o rdoff.o
+
+ldrdf: ldrdf.o $(LDRDFLIBS)
+       $(CC) -o ldrdf ldrdf.o $(LDRDFLIBS)
+rdx: rdx.o $(RDXLIBS)
+       $(CC) -o rdx rdx.o $(RDXLIBS)
+rdflib: rdflib.o
+       $(CC) -o rdflib rdflib.o
+rdf2bin: rdf2bin.o $(RDXLIBS) nasmlib.o
+       $(CC) -o rdf2bin rdf2bin.o $(RDXLIBS) nasmlib.o
+rdf2com:
+       $(LN_S) rdf2bin rdf2com
+
+rdf2bin.o: rdf2bin.c
+rdfdump.o: rdfdump.c
+rdoff.o: rdoff.c rdoff.h
+ldrdf.o: ldrdf.c rdoff.h ../nasmlib.h symtab.h collectn.h rdlib.h
+symtab.o: symtab.c symtab.h hash.h
+collectn.o: collectn.c collectn.h
+rdx.o: rdx.c rdoff.h rdfload.h symtab.h
+rdfload.o: rdfload.c rdfload.h rdoff.h collectn.h symtab.h
+rdlib.o: rdlib.c rdlib.h
+rdflib.o: rdflib.c
+hash.o: hash.c hash.h
+segtab.o: segtab.c segtab.h
+
+nasmlib.o: ../nasmlib.c ../nasmlib.h ../names.c ../nasm.h
+       $(CC) -c $(CFLAGS) ../nasmlib.c
+
+clean:
+       rm -f *.o rdfdump ldrdf rdx rdflib rdf2bin rdf2com
+
+install: rdfdump ldrdf rdx rdflib rdf2bin rdf2com
+       $(INSTALL_PROGRAM) rdfdump $(bindir)/rdfdump
+       $(INSTALL_PROGRAM) ldrdf $(bindir)/ldrdf
+       $(INSTALL_PROGRAM) rdx $(bindir)/rdx
+       $(INSTALL_PROGRAM) rdflib $(bindir)/rdflib
+       $(INSTALL_PROGRAM) rdf2bin $(bindir)/rdf2bin
+       cd $(bindir); $(LN_S) rdf2bin rdf2com
diff --git a/rdoff/Mkfiles/README b/rdoff/Mkfiles/README
new file mode 100644 (file)
index 0000000..7e68499
--- /dev/null
@@ -0,0 +1,4 @@
+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 and run make.
diff --git a/rdoff/README b/rdoff/README
new file mode 100644 (file)
index 0000000..a5a6fd1
--- /dev/null
@@ -0,0 +1,185 @@
+*******
+This file is getting obsolete. RDOFF documentation is written in Texinfo now.
+Directory doc/ contains Texinfo source (rdoff.texi) and makefile for creating
+different output formats (info, HTML, PostScript and PDF).
+*******
+
+RDOFF Utilities, version 0.3.2
+==============================
+
+The files contained in this directory are the C source code of a set
+of tools (and general purpose library files) for the manipulation of
+RDOFF version 2 object files. Note that these programs (with the
+exception of 'rdfdump') will NOT work with version 1 object files.
+Version 1 of RDOFF is no longer supported.
+
+There is also a 'doc' directory with 'v1-v2' file, which documents the
+differences between RDOFF 1 and 2, and an 'rdoff2.texi' (texinfo source),
+with complete documentation for the new format.
+
+Here is a brief summary of the programs' usage:
+
+
+rdfdump
+=======
+
+This tool prints a list of the header records in an RDOFF object in 
+human-readable form, and optionally prints a hex dump of the contents
+of the segments.
+
+Usage:
+       rdfdump [-v] filename
+
+The -v flag specifies that the hex dump (see above) should be printed.
+
+Changes from previous versions:
+
+* rdfdump supports both version 1 and 2 of RDOFF.
+* rdfdump now gives warnings if the RDOFF2 format is violated (it
+  looks for incorrect lengths for header records, and checks the
+  overall length count at the start of the file)
+
+
+ldrdf
+=====
+
+This tool is a version of unix 'ld' (or DOS 'link') for use with RDOFF
+files. It is capable of linking RDOFF objects, and libraries produced
+with the 'rdlib' utility discussed below.
+
+In normal usage, its command line takes the form:
+
+       ldrdf [-o output-file] object files [-llibrary ...]
+
+Modules in libraries are not linked to the program unless they are
+referred to.
+
+Most of its options are not implemented, but those that are are listed here:
+
+  -2   redirect all output from stderr to stdout. It is useful for some
+       systems which don't have such a redirection in shell (e.g. DOS).
+
+  -v   increase verbosity level. Currently 4 verbosity levels are 
+       available: default (which only prints error information), normal
+       (which prints information about the produced object, -v), medium
+       (which prints information about what the program is doing, -v -v)
+       and high (which prints all available information, -v -v -v).
+
+  -a   change alignment value to which multiple segments combigned into
+       a single segment should be aligned (must be either 1, 2, 4, 8,
+       16, 32 or 256. Default is 16).
+       
+  -s   strip exported symbols from output file. Symbols marked as
+       SYM_GLOBAL are never stripped.
+       
+  -x   warn about unresolved symbols.
+  
+  -xe  issue an error when at least one symbol is unresolved.
+       
+  -o name      write output to file <name>. The default output filename
+               is 'aout.rdx'.
+               
+  -j path      specify search path for object files. Default path is a
+               current directory.
+               
+  -L path      specify search path for libraries. Default path is a
+               current directory.
+               
+  -g file      embed 'file' as a first header record with type 'generic'.
+               
+
+rdx
+===
+
+This program simply loads and executes an RDOFF object, by calling
+'_main', which it expects to be a C-style function, which will accept
+two parameters, argc and argv in normal C style.
+
+
+rdflib
+======
+
+This program creates a library file for use with ldrdf.
+
+It is supplied with a shell script 'makelib' which should probably be used
+to create libraries.
+
+Usage:
+       rdflib command library [optional arguments]
+
+Valid commands are:
+
+       c       Create (or truncate) the library
+       a       Add a module (requires a filename and a name to give the
+               module, ie 'rdflib a libc.rdl strcpy.rdf strcpy' puts the
+               file 'strcpy.rdf' into 'libc.rdl', and calls it 'strcpy'.
+       x       Extract (arguments are the opposite to the 'a' command,
+               ie you'd do 'rdflib x libc.rdl strcpy strcpy.rdf to get
+               a copy of strcpy.rdf back out again...)
+        t       List modules in the library
+       d       Delete modules from library
+       r       Replace a module in library with a new file
+
+
+Library functions
+=================
+
+The files 'rdoff.c', 'rdoff.h', 'rdfload.c' and 'rdfload.h' contain
+code which you may find useful. They retain the same interface as
+the previous version, so any code that used them previously should
+still work OK (maybe). 'rdoff.c' contains at the top a line:
+
+#define STRICT_ERRORS
+
+Comment this line out if you wish to use record types other than the
+7 predefined types; it will then not report such records as an error,
+but accept them gracefully, and read them byte for byte into
+a 'generic record' (see the definition of GenericRec in 'rdoff.h').
+
+If you are using these functions to write RDF modules (rather than
+just reading them), then please note the existance of a new function
+'rdfaddsegment(rdf_headerbuf,long)'. This must be called once for
+each segment in your object, to tell the header writing functions
+how long the segment is.
+
+
+BUGS
+====
+
+This product has recently undergone a major revision, and as such there 
+are probably several bugs left over from the testing phase (although the
+previous version had quite a few that have now been fixed!). Could you
+please report any bugs to maintainers at the addresses below, including the
+following information:
+
+  - A description of the bug
+  - What you think the program should be doing
+  - Which programs you are using
+  - Which operating system you are using, and which C compiler was used to
+    compile the programs (or state that the pre-compiled versions were used).
+  - If appropriate, any of the following:
+    * source code (preferably cut down to a minimum that will still assemble
+      and show the bug)
+    * the output of rdfdump on produced modules (or send the module if the
+      problem is in code generated)
+    * exact descriptions of error messages/symptoms/etc
+
+
+TODO
+====
+
+There are still various things unimplemented that we would like to add.
+If you want to find out what these are, search near the top of each *.c
+file for a comment containing the word 'TODO'. A brief list is given here:
+
+- Improve the performace of ldrdf (there are several enhancements I can think
+  of that wouldn't be too hard to add)
+- Stop assuming that we're on a little endian machine
+- Check for more bugs
+
+
+MAINTAINERS
+===========
+
+Yuri Zaporogets <yuriz@users.sf.net> - primary maintainer
+Julian Hall <jules@dsf.org.uk> - original designer and author
diff --git a/rdoff/collectn.c b/rdoff/collectn.c
new file mode 100644 (file)
index 0000000..317c528
--- /dev/null
@@ -0,0 +1,45 @@
+/*
+ * collectn.c - implements variable length pointer arrays [collections].
+ *
+ * This file is public domain.
+ */
+
+#include "compiler.h"
+#include <stdlib.h>
+#include "collectn.h"
+
+void collection_init(Collection * c)
+{
+    int i;
+
+    for (i = 0; i < 32; i++)
+        c->p[i] = NULL;
+    c->next = NULL;
+}
+
+void **colln(Collection * c, int index)
+{
+    while (index >= 32) {
+        index -= 32;
+        if (c->next == NULL) {
+            c->next = malloc(sizeof(Collection));
+            collection_init(c->next);
+        }
+        c = c->next;
+    }
+    return &(c->p[index]);
+}
+
+void collection_reset(Collection * c)
+{
+    int i;
+
+    if (c->next) {
+        collection_reset(c->next);
+        free(c->next);
+    }
+
+    c->next = NULL;
+    for (i = 0; i < 32; i++)
+        c->p[i] = NULL;
+}
diff --git a/rdoff/collectn.h b/rdoff/collectn.h
new file mode 100644 (file)
index 0000000..bcd75b8
--- /dev/null
@@ -0,0 +1,22 @@
+/*
+ * collectn.h - header file for 'collection' abstract data type.
+ *
+ * This file is public domain, and does not come under the NASM license.
+ * It, aint32_t with 'collectn.c' implements what is basically a variable
+ * length array (of pointers).
+ */
+
+#ifndef RDOFF_COLLECTN_H
+#define RDOFF_COLLECTN_H 1
+
+typedef struct tagCollection {
+    void *p[32];                /* array of pointers to objects */
+
+    struct tagCollection *next;
+} Collection;
+
+void collection_init(Collection * c);
+void **colln(Collection * c, int index);
+void collection_reset(Collection * c);
+
+#endif
diff --git a/rdoff/doc/Makefile b/rdoff/doc/Makefile
new file mode 100644 (file)
index 0000000..e4f24f5
--- /dev/null
@@ -0,0 +1,37 @@
+#
+# Make info documentation
+#
+
+AUXFILES = *.aux *.cp *.fn *.ky *.log *.pg *.toc *.tp *.vr *.dvi
+
+SRCS = rdoff.texi
+OUTS = rdoff.info rdoff.html rdoff.ps rdoff.pdf
+
+
+## Implicit rules
+%.html : %.texi
+       makeinfo --html $<
+
+%.dvi : %.texi
+       texi2dvi $<
+
+%.ps: %.dvi
+       dvips $<
+
+%.pdf: %.dvi
+       dvipdf $<
+
+
+## Explicit rules
+all: info
+
+info: rdoff.info
+
+html: rdoff.html
+
+ps: rdoff.ps
+
+pdf: rdoff.pdf
+
+clean:
+       rm -f $(OUTS) $(AUXFILES)
diff --git a/rdoff/doc/rdoff.texi b/rdoff/doc/rdoff.texi
new file mode 100644 (file)
index 0000000..4431287
--- /dev/null
@@ -0,0 +1,137 @@
+\input texinfo @c -*-texinfo-*-
+@c %**start of header
+@setfilename rdoff.info
+@settitle Relocatable Dynamic Object File Format (RDOFF)
+@afourpaper
+@c %**end of header
+
+@titlepage
+@title Relocatable Dynamic Object File Format (RDOFF)
+@author Yuri Zaporogets @email{yuriz@@ukr.net}
+@author Julian Hall @email{jules@@dsf.org.uk}
+@end titlepage
+
+@ifinfo
+Copyright @copyright{} 2002-2004 Netwide Assembler Project.
+Written by Yuri Zaporogets @email{yuriz@@users.sf.net}
+Based on various sources and notes written by Julian Hall @email{jules@@dsf.org.uk}
+Distributed under GNU documentation license.
+@end ifinfo
+
+@ifnottex
+@node Top, Overview, (dir), (dir)
+@top RDOFF
+
+RDOFF is a Relocatable Dynamic Object File Format.
+
+@end ifnottex
+
+@menu
+* Overview::           Introduction.
+* Structure::          Structure of RDOFF file.
+* Utilities::          Description of RDOFF utilities.
+@end menu
+
+@node Overview
+@chapter Introduction
+
+RDOFF was designed initially to test the object-file production
+interface to NASM. It soon became apparent that it could be enhanced
+for use in serious applications due to its simplicity; code to load
+and execute an RDOFF object module is very simple. It also contains
+enhancements to allow it to be linked with a dynamic link library at
+either run- or load- time, depending on how complex you wish to make
+your loader.
+
+@node Structure
+@chapter Structure of RDOFF file
+
+RDOFF module consists of three parts:
+
+@itemize
+@item Master header
+@item Header (may be omited)
+@item Sections
+@end itemize
+
+@dfn{Master header} contains signature, version and size information.
+
+@dfn{Header} consists of zero or more @ref{Records, records}.
+
+@dfn{Sections} represent actual contents of the file. Each section is prepended
+by a section header.
+
+@node Records, , ,Structure
+@section Records that may appear in RDOFF header
+
+@menu
+* Relocation::         Relocation records.
+* Import::             Declaring external symbols.
+* Export::             Declaring public and exported symbols.
+* DLL::                        Specifying a run-time library name.
+* BSS::                        Reserving space in BSS section.
+* Segment relocation:: Complexity of relocation in segmented systems.
+* Far import::         External 'far' symbols.
+* Module name::                Specifying module name.
+* Common variable::    Declaring common variables.
+* Generic record::     Embedding general-purpose data into the header.
+@end menu
+
+@node Relocation
+@subsection Relocation records
+
+@node Import
+@subsection Declaring external and imported symbols
+
+@node Export
+@subsection Declaring public and exported symbols
+
+@node DLL
+@subsection Specifying a run-time library name
+
+@node BSS
+@subsection Reserving space in BSS section
+
+@node Segment relocation
+@subsection Complexity of relocation in segmented systems
+
+@node Far import
+@subsection External 'far' symbols.
+
+@node Module name
+@subsection Specifying module name.
+
+@node Common variable
+@subsection Declaring common variables.
+
+@node Generic record
+@subsection Embedding general-purpose data into the header.
+
+
+@node Utilities
+@chapter RDOFF utilities
+
+@menu
+* rdfdump::            Dump the contents of RDOFF file.
+* ldrdf::              RDOFF linker.
+* rdflib::             RDOFF librarian.
+* rdlar::              New RDOFF librarian/archiver.
+* rdx::                        Load and execute RDOFF module.
+@end menu
+
+@node rdfdump
+@section @command{rdfdump} - dump the contents of RDOFF file
+
+@node ldrdf
+@section @command{ldrdf} - RDOFF linker
+
+@node rdflib
+@section @command{rdflib} - RDOFF librarian
+
+@node rdlar
+@section @command{rdlar} - new RDOFF librarian/archiver
+
+@node rdx
+@section @command{rdx} - load and execute RDOFF module
+
+@bye
diff --git a/rdoff/doc/v1-v2.txt b/rdoff/doc/v1-v2.txt
new file mode 100644 (file)
index 0000000..800896b
--- /dev/null
@@ -0,0 +1,62 @@
+Differences between RDOFF versions 1 & 2
+========================================
+
+This document is designed primarily for people maintaining code which
+uses RDOFF version 1, and would like to upgrade that code to work
+with version 2.
+
+The main changes are summarised here:
+
+Overall format
+==============
+
+The overall format has changed somewhat since version 1, in order
+to make RDOFF more flexible. After the file type identifier (which
+has been changed to 'RDOFF2', obviously), there is now a 4 byte
+integer describing the length of the object module. This allows
+multiple objects to be concatenated, while the loader can easily
+build an index of the locations of each object. This isn't as
+pointless as it sounds; I'm using RDOFF in a microkernel operating
+system, and this is the ideal way of loading multiple driver modules
+at boot time.
+
+There are also no longer a fixed number of segments; instead there
+is a list of segments, immediately following the header.
+Each segment is preceded by a 10 byte header giving information about
+that segment. This header has the following format:
+
+Length Description
+2      Type
+2      Number
+2      Reserved
+4      Length
+
+'Type' is a number describing what sort of segment it is (eg text, data,
+comment, debug info). See 'rdoff2.txt' for a list of the segment types.
+'Number' is the number used to refer to the segment in the header records.
+Not all segments will be loaded; it is only intended that one code
+and one data segment will be loaded into memory. It is possible, however,
+for a loaded segment to contain a reference to an unloaded segment.
+This is an error, and should be flagged at load time. Or maybe you should
+load the segment... its up to you, really.
+
+The segment's data immediately follows the end of the segment header.
+
+HEADER RECORDS
+==============
+
+All of the header records have changed in this version, but not
+substantially. Each record type has had a content-length code added,
+a single byte immediately following the type byte. This contains the
+length of the rest of the record (excluding the type and length bytes,
+but including the terminating nulls on any strings in the record).
+
+There are two new record types, Segment Relocation (6), and FAR import (7).
+The record formats are identical to Relocation (1) and import (2). They are
+only of real use on systems using segmented architectures. Systems using
+a flat model should treat FAR import (7) exactly the same as an import (2),
+and should either flag segment relocation as an error, or attempt to figure
+out whether it is a reference to a code or data symbol, and set the value
+referenced to the according selector value. I am opting for the former
+approach, and would recommend that others working on 32 bit flat systems
+do the same.
diff --git a/rdoff/hash.c b/rdoff/hash.c
new file mode 100644 (file)
index 0000000..ad2b568
--- /dev/null
@@ -0,0 +1,122 @@
+/* ----------------------------------------------------------------------- *
+ *   
+ *   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.
+ *
+ * ----------------------------------------------------------------------- */
+
+/*
+ * hash.h     Routines to calculate a CRC32 hash value
+ *
+ *   These routines donated to the NASM effort by Graeme Defty.
+ */
+
+#include "compiler.h"
+
+#include "hash.h"
+
+const uint32_t consttab[] = {
+    0x00000000, 0x77073096, 0xEE0E612C, 0x990951BA,
+    0x076DC419, 0x706AF48F, 0xE963A535, 0x9E6495A3,
+    0x0EDB8832, 0x79DCB8A4, 0xE0D5E91E, 0x97D2D988,
+    0x09B64C2B, 0x7EB17CBD, 0xE7B82D07, 0x90BF1D91,
+    0x1DB71064, 0x6AB020F2, 0xF3B97148, 0x84BE41DE,
+    0x1ADAD47D, 0x6DDDE4EB, 0xF4D4B551, 0x83D385C7,
+    0x136C9856, 0x646BA8C0, 0xFD62F97A, 0x8A65C9EC,
+    0x14015C4F, 0x63066CD9, 0xFA0F3D63, 0x8D080DF5,
+    0x3B6E20C8, 0x4C69105E, 0xD56041E4, 0xA2677172,
+    0x3C03E4D1, 0x4B04D447, 0xD20D85FD, 0xA50AB56B,
+    0x35B5A8FA, 0x42B2986C, 0xDBBBC9D6, 0xACBCF940,
+    0x32D86CE3, 0x45DF5C75, 0xDCD60DCF, 0xABD13D59,
+    0x26D930AC, 0x51DE003A, 0xC8D75180, 0xBFD06116,
+    0x21B4F4B5, 0x56B3C423, 0xCFBA9599, 0xB8BDA50F,
+    0x2802B89E, 0x5F058808, 0xC60CD9B2, 0xB10BE924,
+    0x2F6F7C87, 0x58684C11, 0xC1611DAB, 0xB6662D3D,
+    0x76DC4190, 0x01DB7106, 0x98D220BC, 0xEFD5102A,
+    0x71B18589, 0x06B6B51F, 0x9FBFE4A5, 0xE8B8D433,
+    0x7807C9A2, 0x0F00F934, 0x9609A88E, 0xE10E9818,
+    0x7F6A0DBB, 0x086D3D2D, 0x91646C97, 0xE6635C01,
+    0x6B6B51F4, 0x1C6C6162, 0x856530D8, 0xF262004E,
+    0x6C0695ED, 0x1B01A57B, 0x8208F4C1, 0xF50FC457,
+    0x65B0D9C6, 0x12B7E950, 0x8BBEB8EA, 0xFCB9887C,
+    0x62DD1DDF, 0x15DA2D49, 0x8CD37CF3, 0xFBD44C65,
+    0x4DB26158, 0x3AB551CE, 0xA3BC0074, 0xD4BB30E2,
+    0x4ADFA541, 0x3DD895D7, 0xA4D1C46D, 0xD3D6F4FB,
+    0x4369E96A, 0x346ED9FC, 0xAD678846, 0xDA60B8D0,
+    0x44042D73, 0x33031DE5, 0xAA0A4C5F, 0xDD0D7CC9,
+    0x5005713C, 0x270241AA, 0xBE0B1010, 0xC90C2086,
+    0x5768B525, 0x206F85B3, 0xB966D409, 0xCE61E49F,
+    0x5EDEF90E, 0x29D9C998, 0xB0D09822, 0xC7D7A8B4,
+    0x59B33D17, 0x2EB40D81, 0xB7BD5C3B, 0xC0BA6CAD,
+    0xEDB88320, 0x9ABFB3B6, 0x03B6E20C, 0x74B1D29A,
+    0xEAD54739, 0x9DD277AF, 0x04DB2615, 0x73DC1683,
+    0xE3630B12, 0x94643B84, 0x0D6D6A3E, 0x7A6A5AA8,
+    0xE40ECF0B, 0x9309FF9D, 0x0A00AE27, 0x7D079EB1,
+    0xF00F9344, 0x8708A3D2, 0x1E01F268, 0x6906C2FE,
+    0xF762575D, 0x806567CB, 0x196C3671, 0x6E6B06E7,
+    0xFED41B76, 0x89D32BE0, 0x10DA7A5A, 0x67DD4ACC,
+    0xF9B9DF6F, 0x8EBEEFF9, 0x17B7BE43, 0x60B08ED5,
+    0xD6D6A3E8, 0xA1D1937E, 0x38D8C2C4, 0x4FDFF252,
+    0xD1BB67F1, 0xA6BC5767, 0x3FB506DD, 0x48B2364B,
+    0xD80D2BDA, 0xAF0A1B4C, 0x36034AF6, 0x41047A60,
+    0xDF60EFC3, 0xA867DF55, 0x316E8EEF, 0x4669BE79,
+    0xCB61B38C, 0xBC66831A, 0x256FD2A0, 0x5268E236,
+    0xCC0C7795, 0xBB0B4703, 0x220216B9, 0x5505262F,
+    0xC5BA3BBE, 0xB2BD0B28, 0x2BB45A92, 0x5CB36A04,
+    0xC2D7FFA7, 0xB5D0CF31, 0x2CD99E8B, 0x5BDEAE1D,
+    0x9B64C2B0, 0xEC63F226, 0x756AA39C, 0x026D930A,
+    0x9C0906A9, 0xEB0E363F, 0x72076785, 0x05005713,
+    0x95BF4A82, 0xE2B87A14, 0x7BB12BAE, 0x0CB61B38,
+    0x92D28E9B, 0xE5D5BE0D, 0x7CDCEFB7, 0x0BDBDF21,
+    0x86D3D2D4, 0xF1D4E242, 0x68DDB3F8, 0x1FDA836E,
+    0x81BE16CD, 0xF6B9265B, 0x6FB077E1, 0x18B74777,
+    0x88085AE6, 0xFF0F6A70, 0x66063BCA, 0x11010B5C,
+    0x8F659EFF, 0xF862AE69, 0x616BFFD3, 0x166CCF45,
+    0xA00AE278, 0xD70DD2EE, 0x4E048354, 0x3903B3C2,
+    0xA7672661, 0xD06016F7, 0x4969474D, 0x3E6E77DB,
+    0xAED16A4A, 0xD9D65ADC, 0x40DF0B66, 0x37D83BF0,
+    0xA9BCAE53, 0xDEBB9EC5, 0x47B2CF7F, 0x30B5FFE9,
+    0xBDBDF21C, 0xCABAC28A, 0x53B39330, 0x24B4A3A6,
+    0xBAD03605, 0xCDD70693, 0x54DE5729, 0x23D967BF,
+    0xB3667A2E, 0xC4614AB8, 0x5D681B02, 0x2A6F2B94,
+    0xB40BBE37, 0xC30C8EA1, 0x5A05DF1B, 0x2D02EF8D
+};
+
+uint32_t hash(const char *name)
+{
+    register const char *n;
+    register uint32_t hashval = 0xffffffff;
+
+    for (n = name; *n; n++)
+        hashval = (hashval >> 8) ^ consttab[(hashval ^ *n) & 0xff];
+
+    hashval ^= 0xffffffff;
+
+    return hashval;
+}
diff --git a/rdoff/hash.h b/rdoff/hash.h
new file mode 100644 (file)
index 0000000..a6920e7
--- /dev/null
@@ -0,0 +1,18 @@
+/* hash.h     Routines to calculate a CRC32 hash value
+ *
+ *   These routines donated to the NASM effort by Graeme Defty.
+ *
+ * The Netwide Assembler is copyright (C) 1996 Simon Tatham and
+ * Julian Hall. All rights reserved. The software is
+ * redistributable under the license given in the file "LICENSE"
+ * distributed in the NASM archive.
+ */
+
+#ifndef RDOFF_HASH_H
+#define RDOFF_HASH_H 1
+
+#include <inttypes.h>
+
+uint32_t hash(const char *name);
+
+#endif
diff --git a/rdoff/ldrdf.1 b/rdoff/ldrdf.1
new file mode 100644 (file)
index 0000000..d0a2c21
--- /dev/null
@@ -0,0 +1,41 @@
+.TH LDRDF 1 "September 6, 1999" "Debian Project" "Debian Manual"
+.SH NAME
+ldrdf \- link RDOFF objects and libraries produced by rdflib(1)
+.SH SYNOPSIS
+.B ldrdf
+.RI "[-o " output-file ]
+.I object-file\c
+.RI "... [-l" library "...]"
+.SH DESCRIPTION
+.B ldrdf
+is a version of unix
+.BR ld (1)
+(or DOS LINK) for use with RDOFF files.  It is capable of linking RDOFF
+objects, and libraries produced with the
+.BR rdflib (1)
+utility.
+.PP
+Libraries must be specified with their path as no search is performed.
+Modules in libraries are not linked to the program unless they are
+referred to.
+.SH OPTIONS
+.TP
+.RI "-o " output-file
+Specify an output file.  The default output filename is
+.RI ' aout.rdx '.
+.TP
+-v
+Increase verbosity level.  Currently 4 verbosity levels are available:
+default (which only prints error information), normal (which prints
+information about the produced object, -v), medium (which prints information
+about what the program is doing, -v -v) and high (which prints all available
+information, -v -v -v).
+.TP
+-p
+Change alignment value to which multiple segments combigned into a single
+segment should be aligned (must be either 1, 2, 4, 8, 16, 32 or 256; default
+is 16).
+.SH AUTHORS
+Julian Hall <jules@earthcorp.com>.
+.PP
+This manual page was written by Matej Vela <vela@debian.org>.
diff --git a/rdoff/ldrdf.c b/rdoff/ldrdf.c
new file mode 100644 (file)
index 0000000..2ddada3
--- /dev/null
@@ -0,0 +1,1360 @@
+/* ----------------------------------------------------------------------- *
+ *   
+ *   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.
+ *
+ * ----------------------------------------------------------------------- */
+
+/*
+ * ldrdf.c - RDOFF Object File linker/loader main program.
+ */
+
+/*
+ * TODO:
+ * - enhance search of required export symbols in libraries (now depends
+ *   on modules order in library)
+ * - keep a cache of symbol names in each library module so
+ *   we don't have to constantly recheck the file
+ * - general performance improvements
+ *
+ * BUGS & LIMITATIONS: this program doesn't support multiple code, data
+ * or bss segments, therefore for 16 bit programs whose code, data or BSS
+ * segment exceeds 64K in size, it will not work. This program probably
+ * won't work if compiled by a 16 bit compiler. Try DJGPP if you're running
+ * under DOS. '#define STINGY_MEMORY' may help a little.
+ */
+
+#include "compiler.h"
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+
+#define RDOFF_UTILS
+
+#include "rdoff.h"
+#include "symtab.h"
+#include "collectn.h"
+#include "rdlib.h"
+#include "segtab.h"
+#include "nasmlib.h"
+
+#define LDRDF_VERSION "1.07"
+
+/* #define STINGY_MEMORY */
+
+/* =======================================================================
+ * Types & macros that are private to this program
+ */
+
+struct segment_infonode {
+    int dest_seg;               /* output segment to be placed into, -1 to
+                                   skip linking this segment */
+    int32_t reloc;                 /* segment's relocation factor */
+};
+
+struct modulenode {
+    rdffile f;                  /* the RDOFF file structure */
+    struct segment_infonode seginfo[RDF_MAXSEGS];       /* what are we doing
+                                                           with each segment? */
+    void *header;
+    char *name;
+    struct modulenode *next;
+    int32_t bss_reloc;
+};
+
+#include "ldsegs.h"
+
+#define newstr(str) strcpy(malloc(strlen(str) + 1),str)
+#define newstrcat(s1,s2) strcat(strcpy(malloc(strlen(s1)+strlen(s2)+1),s1),s2)
+
+/* ==========================================================================
+ * Function prototypes of private utility functions
+ */
+
+void processmodule(const char *filename, struct modulenode *mod);
+int allocnewseg(uint16_t type, uint16_t reserved);
+int findsegment(uint16_t type, uint16_t reserved);
+void symtab_add(const char *symbol, int segment, int32_t offset);
+int symtab_get(const char *symbol, int *segment, int32_t *offset);
+
+/* =========================================================================
+ * Global data structures.
+ */
+
+/* a linked list of modules that will be included in the output */
+struct modulenode *modules = NULL;
+struct modulenode *lastmodule = NULL;
+
+/* a linked list of libraries to be searched for unresolved imported symbols */
+struct librarynode *libraries = NULL;
+struct librarynode *lastlib = NULL;
+
+/* the symbol table */
+void *symtab = NULL;
+
+/* objects search path */
+char *objpath = NULL;
+
+/* libraries search path */
+char *libpath = NULL;
+
+/* file to embed as a generic record */
+char *generic_rec_file = NULL;
+
+/* error file */
+static FILE *error_file;
+
+/* the header of the output file, built up stage by stage */
+rdf_headerbuf *newheader = NULL;
+
+/* The current state of segment allocation, including information about
+ * which output segment numbers have been allocated, and their types and
+ * amount of data which has already been allocated inside them.
+ */
+struct SegmentHeaderRec outputseg[RDF_MAXSEGS];
+int nsegs = 0;
+int32_t bss_length;
+
+/* global options which affect how the program behaves */
+struct ldrdfoptions {
+    int verbose;
+    int align;
+    int dynalink;
+    int strip;
+    int respfile;
+    int stderr_redir;
+    int objpath;
+    int libpath;
+} options;
+
+int errorcount = 0;             /* determines main program exit status */
+
+/* =========================================================================
+ * Utility functions
+ */
+
+/*
+ * initsegments()
+ *
+ * sets up segments 0, 1, and 2, the initial code data and bss segments
+ */
+void initsegments()
+{
+    nsegs = 3;
+    outputseg[0].type = 1;
+    outputseg[0].number = 0;
+    outputseg[0].reserved = 0;
+    outputseg[0].length = 0;
+    outputseg[1].type = 2;
+    outputseg[1].number = 1;
+    outputseg[1].reserved = 0;
+    outputseg[1].length = 0;
+    outputseg[2].type = 0xFFFF; /* reserved segment type */
+    outputseg[2].number = 2;
+    outputseg[2].reserved = 0;
+    outputseg[2].length = 0;
+    bss_length = 0;
+}
+
+/*
+ * loadmodule
+ *
+ * Determine the characteristics of a module, and decide what to do with
+ * each segment it contains (including determining destination segments and
+ * relocation factors for segments that        are kept).
+ */
+void loadmodule(const char *filename)
+{
+    if (options.verbose)
+        printf("loading `%s'\n", filename);
+
+    /* allocate a new module entry on the end of the modules list */
+    if (!modules) {
+        modules = malloc(sizeof(*modules));
+        lastmodule = modules;
+    } else {
+        lastmodule->next = malloc(sizeof(*modules));
+        lastmodule = lastmodule->next;
+    }
+
+    if (!lastmodule) {
+        fprintf(stderr, "ldrdf: out of memory\n");
+        exit(1);
+    }
+
+    /* open the file using 'rdfopen', which returns nonzero on error */
+    if (rdfopen(&lastmodule->f, filename) != 0) {
+        rdfperror("ldrdf", filename);
+        exit(1);
+    }
+
+    /*
+     * store information about the module, and determine what segments
+     * it contains, and what we should do with them (determine relocation
+     * factor if we decide to keep them)
+     */
+    lastmodule->header = NULL;
+    lastmodule->name = strdup(filename);
+    lastmodule->next = NULL;
+
+    processmodule(filename, lastmodule);
+}
+
+/*
+ * processmodule()
+ *
+ * step through each segment, determine what exactly we're doing with
+ * it, and if we intend to keep it, determine (a) which segment to
+ * put it in and (b) whereabouts in that segment it will end up.
+ * (b) is fairly easy, because we're now keeping track of how big each
+ * segment in our output file is...
+ */
+void processmodule(const char *filename, struct modulenode *mod)
+{
+    struct segconfig sconf;
+    int seg, outseg;
+    void *header;
+    rdfheaderrec *hr;
+    int32_t bssamount = 0;
+    int bss_was_referenced = 0;
+
+    memset(&sconf, 0, sizeof sconf);
+
+    for (seg = 0; seg < mod->f.nsegs; seg++) {
+        /*
+         * get the segment configuration for this type from the segment
+         * table. getsegconfig() is a macro, defined in ldsegs.h.
+         */
+        getsegconfig(sconf, mod->f.seg[seg].type);
+
+        if (options.verbose > 1) {
+            printf("%s %04x [%04x:%10s] ", filename,
+                   mod->f.seg[seg].number, mod->f.seg[seg].type,
+                   sconf.typedesc);
+        }
+        /*
+         * sconf->dowhat tells us what to do with a segment of this type.
+         */
+        switch (sconf.dowhat) {
+        case SEG_IGNORE:
+            /*
+             * Set destination segment to -1, to indicate that this segment
+             * should be ignored for the purpose of output, ie it is left
+             * out of the linked executable.
+             */
+            mod->seginfo[seg].dest_seg = -1;
+            if (options.verbose > 1)
+                printf("IGNORED\n");
+            break;
+
+        case SEG_NEWSEG:
+            /*
+             * The configuration tells us to create a new segment for
+             * each occurrence of this segment type.
+             */
+            outseg = allocnewseg(sconf.mergetype,
+                                 mod->f.seg[seg].reserved);
+            mod->seginfo[seg].dest_seg = outseg;
+            mod->seginfo[seg].reloc = 0;
+            outputseg[outseg].length = mod->f.seg[seg].length;
+            if (options.verbose > 1)
+                printf("=> %04x:%08"PRIx32" (+%04"PRIx32")\n", outseg,
+                       mod->seginfo[seg].reloc, mod->f.seg[seg].length);
+            break;
+
+        case SEG_MERGE:
+            /*
+             * The configuration tells us to merge the segment with
+             * a previously existing segment of type 'sconf.mergetype',
+             * if one exists. Otherwise a new segment is created.
+             * This is handled transparently by 'findsegment()'.
+             */
+            outseg = findsegment(sconf.mergetype,
+                                 mod->f.seg[seg].reserved);
+            mod->seginfo[seg].dest_seg = outseg;
+
+            /*
+             * We need to add alignment to these segments.
+             */
+            if (outputseg[outseg].length % options.align != 0)
+                outputseg[outseg].length +=
+                    options.align -
+                    (outputseg[outseg].length % options.align);
+
+            mod->seginfo[seg].reloc = outputseg[outseg].length;
+            outputseg[outseg].length += mod->f.seg[seg].length;
+
+            if (options.verbose > 1)
+                printf("=> %04x:%08"PRIx32" (+%04"PRIx32")\n", outseg,
+                       mod->seginfo[seg].reloc, mod->f.seg[seg].length);
+        }
+
+    }
+
+    /*
+     * extract symbols from the header, and dump them into the
+     * symbol table
+     */
+    header = malloc(mod->f.header_len);
+    if (!header) {
+        fprintf(stderr, "ldrdf: not enough memory\n");
+        exit(1);
+    }
+    if (rdfloadseg(&mod->f, RDOFF_HEADER, header)) {
+        rdfperror("ldrdf", filename);
+        exit(1);
+    }
+
+    while ((hr = rdfgetheaderrec(&mod->f))) {
+        switch (hr->type) {
+        case RDFREC_IMPORT:    /* imported symbol */
+        case RDFREC_FARIMPORT:
+            /* Define with seg = -1 */
+            symtab_add(hr->i.label, -1, 0);
+            break;
+
+        case RDFREC_GLOBAL:{   /* exported symbol */
+                int destseg;
+                int32_t destreloc;
+
+                if (hr->e.segment == 2) {
+                    bss_was_referenced = 1;
+                    destreloc = bss_length;
+                    if (destreloc % options.align != 0)
+                        destreloc +=
+                            options.align - (destreloc % options.align);
+                    destseg = 2;
+                } else {
+                    if ((destseg =
+                         mod->seginfo[(int)hr->e.segment].dest_seg) == -1)
+                        continue;
+                    destreloc = mod->seginfo[(int)hr->e.segment].reloc;
+                }
+                symtab_add(hr->e.label, destseg, destreloc + hr->e.offset);
+                break;
+            }
+
+        case RDFREC_BSS:       /* BSS reservation */
+            /*
+             * first, amalgamate all BSS reservations in this module
+             * into one, because we allow this in the output format.
+             */
+            bssamount += hr->b.amount;
+            break;
+
+        case RDFREC_COMMON:{   /* Common variable */
+                symtabEnt *ste = symtabFind(symtab, hr->c.label);
+
+                /* Is the symbol already in the table? */
+                if (ste)
+                    break;
+
+                /* Align the variable */
+                if (bss_length % hr->c.align != 0)
+                    bss_length += hr->c.align - (bss_length % hr->c.align);
+                if (options.verbose > 1) {
+                    printf("%s %04x common '%s' => 0002:%08"PRIx32" (+%04"PRIx32")\n",
+                           filename, hr->c.segment, hr->c.label,
+                           bss_length, hr->c.size);
+                }
+
+                symtab_add(hr->c.label, 2, bss_length);
+                mod->bss_reloc = bss_length;
+                bss_length += hr->c.size;
+                break;
+            }
+        }
+    }
+
+    if (bssamount != 0 || bss_was_referenced) {
+        /*
+         * handle the BSS segment - first pad the existing bss length
+         * to the correct alignment, then store the length in bss_reloc
+         * for this module. Then add this module's BSS length onto
+         * bss_length.
+         */
+        if (bss_length % options.align != 0)
+            bss_length += options.align - (bss_length % options.align);
+
+        mod->bss_reloc = bss_length;
+        if (options.verbose > 1) {
+            printf("%s 0002 [            BSS] => 0002:%08"PRIx32" (+%04"PRIx32")\n",
+                   filename, bss_length, bssamount);
+        }
+        bss_length += bssamount;
+    }
+#ifdef STINGY_MEMORY
+    /*
+     * we free the header buffer here, to save memory later.
+     * this isn't efficient, but probably halves the memory usage
+     * of this program...
+     */
+    mod->f.header_loc = NULL;
+    free(header);
+
+#endif
+
+}
+
+/*
+ * Return 1 if a given module is in the list, 0 otherwise.
+ */
+int lookformodule(const char *name)
+{
+    struct modulenode *curr = modules;
+
+    while (curr) {
+        if (!strcmp(name, curr->name))
+            return 1;
+        curr = curr->next;
+    }
+    return 0;
+}
+
+/*
+ * allocnewseg()
+ * findsegment()
+ *
+ * These functions manipulate the array of output segments, and are used
+ * by processmodule(). allocnewseg() allocates a segment in the array,
+ * initialising it to be empty. findsegment() first scans the array for
+ * a segment of the type requested, and if one isn't found allocates a
+ * new one.
+ */
+int allocnewseg(uint16_t type, uint16_t reserved)
+{
+    outputseg[nsegs].type = type;
+    outputseg[nsegs].number = nsegs;
+    outputseg[nsegs].reserved = reserved;
+    outputseg[nsegs].length = 0;
+    outputseg[nsegs].offset = 0;
+    outputseg[nsegs].data = NULL;
+
+    return nsegs++;
+}
+
+int findsegment(uint16_t type, uint16_t reserved)
+{
+    int i;
+
+    for (i = 0; i < nsegs; i++)
+        if (outputseg[i].type == type)
+            return i;
+
+    return allocnewseg(type, reserved);
+}
+
+/*
+ * symtab_add()
+ *
+ * inserts a symbol into the global symbol table, which associates symbol
+ * names either with addresses, or a marker that the symbol hasn't been
+ * resolved yet, or possibly that the symbol has been defined as
+ * contained in a dynamic [load time/run time] linked library.
+ *
+ * segment = -1 => not yet defined
+ * segment = -2 => defined as dll symbol
+ *
+ * If the symbol is already defined, and the new segment >= 0, then
+ * if the original segment was < 0 the symbol is redefined, otherwise
+ * a duplicate symbol warning is issued. If new segment == -1, this
+ * routine won't change a previously existing symbol. It will change
+ * to segment = -2 only if the segment was previously < 0.
+ */
+void symtab_add(const char *symbol, int segment, int32_t offset)
+{
+    symtabEnt *ste;
+
+    ste = symtabFind(symtab, symbol);
+    if (ste) {
+        if (ste->segment >= 0) {
+            /*
+             * symbol previously defined
+             */
+            if (segment < 0)
+                return;
+            fprintf(error_file, "warning: `%s' redefined\n", symbol);
+            return;
+        }
+
+        /*
+         * somebody wanted the symbol, and put an undefined symbol
+         * marker into the table
+         */
+        if (segment == -1)
+            return;
+        /*
+         * we have more information now - update the symbol's entry
+         */
+        ste->segment = segment;
+        ste->offset = offset;
+        ste->flags = 0;
+        return;
+    }
+    /*
+     * this is the first declaration of this symbol
+     */
+    ste = malloc(sizeof(symtabEnt));
+    if (!ste) {
+        fprintf(stderr, "ldrdf: out of memory\n");
+        exit(1);
+    }
+    ste->name = strdup(symbol);
+    ste->segment = segment;
+    ste->offset = offset;
+    ste->flags = 0;
+    symtabInsert(symtab, ste);
+}
+
+/*
+ * symtab_get()
+ *
+ * Retrieves the values associated with a symbol. Undefined symbols
+ * are assumed to have -1:0 associated. Returns 1 if the symbol was
+ * successfully located.
+ */
+int symtab_get(const char *symbol, int *segment, int32_t *offset)
+{
+    symtabEnt *ste = symtabFind(symtab, symbol);
+    if (!ste) {
+        *segment = -1;
+        *offset = 0;
+        return 0;
+    } else {
+        *segment = ste->segment;
+        *offset = ste->offset;
+        return 1;
+    }
+}
+
+/*
+ * add_library()
+ *
+ * checks that a library can be opened and is in the correct format,
+ * then adds it to the linked list of libraries.
+ */
+void add_library(const char *name)
+{
+    if (rdl_verify(name)) {
+        rdl_perror("ldrdf", name);
+        errorcount++;
+        return;
+    }
+    if (!libraries) {
+        lastlib = libraries = malloc(sizeof(*libraries));
+        if (!libraries) {
+            fprintf(stderr, "ldrdf: out of memory\n");
+            exit(1);
+        }
+    } else {
+        lastlib->next = malloc(sizeof(*libraries));
+        if (!lastlib->next) {
+            fprintf(stderr, "ldrdf: out of memory\n");
+            exit(1);
+        }
+        lastlib = lastlib->next;
+    }
+    lastlib->next = NULL;
+    if (rdl_open(lastlib, name)) {
+        rdl_perror("ldrdf", name);
+        errorcount++;
+        return;
+    }
+}
+
+/*
+ * search_libraries()
+ *
+ * scans through the list of libraries, attempting to match symbols
+ * defined in library modules against symbols that are referenced but
+ * not defined (segment = -1 in the symbol table)
+ *
+ * returns 1 if any extra library modules are included, indicating that
+ * another pass through the library list should be made (possibly).
+ */
+int search_libraries()
+{
+    struct librarynode *cur;
+    rdffile f;
+    int i;
+    void *header;
+    int segment;
+    int32_t offset;
+    int doneanything = 0, pass = 1, keepfile;
+    rdfheaderrec *hr;
+
+    cur = libraries;
+
+    while (cur) {
+        if (options.verbose > 2)
+            printf("scanning library `%s', pass %d...\n", cur->name, pass);
+
+        for (i = 0; rdl_openmodule(cur, i, &f) == 0; i++) {
+            if (pass == 2 && lookformodule(f.name))
+                continue;
+
+            if (options.verbose > 3)
+                printf("  looking in module `%s'\n", f.name);
+
+            header = malloc(f.header_len);
+            if (!header) {
+                fprintf(stderr, "ldrdf: not enough memory\n");
+                exit(1);
+            }
+            if (rdfloadseg(&f, RDOFF_HEADER, header)) {
+                rdfperror("ldrdf", f.name);
+                errorcount++;
+                return 0;
+            }
+
+            keepfile = 0;
+
+            while ((hr = rdfgetheaderrec(&f))) {
+                /* We're only interested in exports, so skip others */
+                if (hr->type != RDFREC_GLOBAL)
+                    continue;
+
+                /*
+                 * If the symbol is marked as SYM_GLOBAL, somebody will be
+                 * definitely interested in it..
+                 */
+                if ((hr->e.flags & SYM_GLOBAL) == 0) {
+                    /*
+                     * otherwise the symbol is just public. Find it in
+                     * the symbol table. If the symbol isn't defined, we
+                     * aren't interested, so go on to the next.
+                     * If it is defined as anything but -1, we're also not
+                     * interested. But if it is defined as -1, insert this
+                     * module into the list of modules to use, and go
+                     * immediately on to the next module...
+                     */
+                    if (!symtab_get(hr->e.label, &segment, &offset)
+                        || segment != -1)
+                        continue;
+                }
+
+                doneanything = 1;
+                keepfile = 1;
+
+                /*
+                 * as there are undefined symbols, we can assume that
+                 * there are modules on the module list by the time
+                 * we get here.
+                 */
+                lastmodule->next = malloc(sizeof(*lastmodule->next));
+                if (!lastmodule->next) {
+                    fprintf(stderr, "ldrdf: not enough memory\n");
+                    exit(1);
+                }
+                lastmodule = lastmodule->next;
+                memcpy(&lastmodule->f, &f, sizeof(f));
+                lastmodule->name = strdup(f.name);
+                lastmodule->next = NULL;
+                processmodule(f.name, lastmodule);
+                break;
+            }
+            if (!keepfile) {
+                free(f.name);
+                f.name = NULL;
+                f.fp = NULL;
+            }
+        }
+        if (rdl_error != 0 && rdl_error != RDL_ENOTFOUND)
+            rdl_perror("ldrdf", cur->name);
+
+        cur = cur->next;
+        if (cur == NULL && pass == 1) {
+            cur = libraries;
+            pass++;
+        }
+    }
+
+    return doneanything;
+}
+
+/*
+ * write_output()
+ *
+ * this takes the linked list of modules, and walks through it, merging
+ * all the modules into a single output module, and then writes this to a
+ * file.
+ */
+void write_output(const char *filename)
+{
+    FILE *f;
+    rdf_headerbuf *rdfheader;
+    struct modulenode *cur;
+    int i, availableseg, seg, localseg, isrelative;
+    void *header;
+    rdfheaderrec *hr, newrec;
+    symtabEnt *se;
+    segtab segs;
+    int32_t offset;
+    uint8_t *data;
+
+    if ((f = fopen(filename, "wb")) == NULL) {
+        fprintf(stderr, "ldrdf: couldn't open %s for output\n", filename);
+        exit(1);
+    }
+    if ((rdfheader = rdfnewheader()) == NULL) {
+        fprintf(stderr, "ldrdf: out of memory\n");
+        exit(1);
+    }
+
+    /*
+     * If '-g' option was given, first record in output file will be a
+     * `generic' record, filled with a given file content.
+     * This can be useful, for example, when constructing multiboot
+     * compliant kernels.
+     */
+    if (generic_rec_file) {
+        FILE *ff;
+
+        if (options.verbose)
+            printf("\nadding generic record from binary file %s\n",
+                   generic_rec_file);
+
+        hr = (rdfheaderrec *) malloc(sizeof(struct GenericRec));
+        if ((ff = fopen(generic_rec_file, "r")) == NULL) {
+            fprintf(stderr, "ldrdf: couldn't open %s for input\n",
+                    generic_rec_file);
+            exit(1);
+        }
+        i = fread(hr->g.data, 1, sizeof(hr->g.data), ff);
+        fseek(ff, 0, SEEK_END);
+        if (ftell(ff) > (long)sizeof(hr->g.data)) {
+            fprintf(error_file,
+                    "warning: maximum generic record size is %u, "
+                   "rest of file ignored\n",
+                    (unsigned int)sizeof(hr->g.data));
+        }
+        fclose(ff);
+
+        hr->g.type = 0;
+        hr->g.reclen = i;
+        rdfaddheader(rdfheader, hr);
+        free(hr);
+    }
+
+    if (options.verbose)
+        printf("\nbuilding output module (%d segments)\n", nsegs);
+
+    /*
+     * Allocate the memory for the segments. We may be better off
+     * building the output module one segment at a time when running
+     * under 16 bit DOS, but that would be a slower way of doing this.
+     * And you could always use DJGPP...
+     */
+    for (i = 0; i < nsegs; i++) {
+        outputseg[i].data = NULL;
+        if (!outputseg[i].length)
+            continue;
+        outputseg[i].data = malloc(outputseg[i].length);
+        if (!outputseg[i].data) {
+            fprintf(stderr, "ldrdf: out of memory\n");
+            exit(1);
+        }
+    }
+
+    /*
+     * initialise availableseg, used to allocate segment numbers for
+     * imported and exported labels...
+     */
+    availableseg = nsegs;
+
+    /*
+     * Step through the modules, performing required actions on each one
+     */
+    for (cur = modules; cur; cur = cur->next) {
+        /*
+         * Read the actual segment contents into the correct places in
+         * the newly allocated segments
+         */
+
+        for (i = 0; i < cur->f.nsegs; i++) {
+            int dest = cur->seginfo[i].dest_seg;
+
+            if (dest == -1)
+                continue;
+            if (rdfloadseg(&cur->f, i,
+                           outputseg[dest].data + cur->seginfo[i].reloc)) {
+                rdfperror("ldrdf", cur->name);
+                exit(1);
+            }
+        }
+
+        /*
+         * Perform fixups, and add new header records where required
+         */
+
+        header = malloc(cur->f.header_len);
+        if (!header) {
+            fprintf(stderr, "ldrdf: out of memory\n");
+            exit(1);
+        }
+
+        if (cur->f.header_loc)
+            rdfheaderrewind(&cur->f);
+        else if (rdfloadseg(&cur->f, RDOFF_HEADER, header)) {
+            rdfperror("ldrdf", cur->name);
+            exit(1);
+        }
+
+        /*
+         * we need to create a local segment number -> location
+         * table for the segments in this module.
+         */
+        init_seglocations(&segs);
+        for (i = 0; i < cur->f.nsegs; i++) {
+            add_seglocation(&segs, cur->f.seg[i].number,
+                            cur->seginfo[i].dest_seg,
+                            cur->seginfo[i].reloc);
+        }
+        /*
+         * and the BSS segment (doh!)
+         */
+        add_seglocation(&segs, 2, 2, cur->bss_reloc);
+
+        while ((hr = rdfgetheaderrec(&cur->f))) {
+            switch (hr->type) {
+            case RDFREC_RELOC: /* relocation record - need to do a fixup */
+                /*
+                 * First correct the offset stored in the segment from
+                 * the start of the segment (which may well have changed).
+                 *
+                 * To do this we add to the number stored the relocation
+                 * factor associated with the segment that contains the
+                 * target segment.
+                 *
+                 * The relocation could be a relative relocation, in which
+                 * case we have to first subtract the amount we've relocated
+                 * the containing segment by.
+                 */
+                if (!get_seglocation(&segs, hr->r.refseg, &seg, &offset)) {
+                    fprintf(stderr,
+                            "%s: reloc to undefined segment %04x\n",
+                            cur->name, (int)hr->r.refseg);
+                    errorcount++;
+                    break;
+                }
+
+                isrelative =
+                    (hr->r.segment & RDOFF_RELATIVEMASK) ==
+                    RDOFF_RELATIVEMASK;
+                hr->r.segment &= (RDOFF_RELATIVEMASK - 1);
+
+                if (hr->r.segment == 2 ||
+                    (localseg =
+                     rdffindsegment(&cur->f, hr->r.segment)) == -1) {
+                    fprintf(stderr, "%s: reloc from %s segment (%d)\n",
+                            cur->name,
+                            hr->r.segment == 2 ? "BSS" : "unknown",
+                            hr->r.segment);
+                    errorcount++;
+                    break;
+                }
+
+                if (hr->r.length != 1 && hr->r.length != 2 &&
+                    hr->r.length != 4) {
+                    fprintf(stderr, "%s: nonstandard length reloc "
+                            "(%d bytes)\n", cur->name, hr->r.length);
+                    errorcount++;
+                    break;
+                }
+
+                /*
+                 * okay, now the relocation is in the segment pointed to by
+                 * cur->seginfo[localseg], and we know everything else is
+                 * okay to go ahead and do the relocation
+                 */
+                data = outputseg[cur->seginfo[localseg].dest_seg].data;
+                data += cur->seginfo[localseg].reloc + hr->r.offset;
+
+                /*
+                 * data now points to the reference that needs
+                 * relocation. Calculate the relocation factor.
+                 * Factor is:
+                 *      offset of referred object in segment [in offset]
+                 *      (- relocation of localseg, if ref is relative)
+                 * For simplicity, the result is stored in 'offset'.
+                 * Then add 'offset' onto the value at data.
+                 */
+
+                if (isrelative)
+                    offset -= cur->seginfo[localseg].reloc;
+                switch (hr->r.length) {
+                case 1:
+                    offset += *data;
+                    if (offset < -127 || offset > 128)
+                        fprintf(error_file,
+                                "warning: relocation out of range "
+                                "at %s(%02x:%08"PRIx32")\n", cur->name,
+                                (int)hr->r.segment, hr->r.offset);
+                    *data = (char)offset;
+                    break;
+                case 2:
+                    offset += *(int16_t *)data;
+                    if (offset < -32767 || offset > 32768)
+                        fprintf(error_file,
+                                "warning: relocation out of range "
+                                "at %s(%02x:%08"PRIx32")\n", cur->name,
+                                (int)hr->r.segment, hr->r.offset);
+                    *(int16_t *)data = (int16_t)offset;
+                    break;
+                case 4:
+                    *(int32_t *)data += offset;
+                    /* we can't easily detect overflow on this one */
+                    break;
+                }
+
+                /*
+                 * If the relocation was relative between two symbols in
+                 * the same segment, then we're done.
+                 *
+                 * Otherwise, we need to output a new relocation record
+                 * with the references updated segment and offset...
+                 */
+                if (!isrelative || cur->seginfo[localseg].dest_seg != seg) {
+                    hr->r.segment = cur->seginfo[localseg].dest_seg;
+                    hr->r.offset += cur->seginfo[localseg].reloc;
+                    hr->r.refseg = seg;
+                    if (isrelative)
+                        hr->r.segment += RDOFF_RELATIVEMASK;
+                    rdfaddheader(rdfheader, hr);
+                }
+                break;
+
+            case RDFREC_IMPORT:        /* import symbol */
+            case RDFREC_FARIMPORT:
+                /*
+                 * scan the global symbol table for the symbol
+                 * and associate its location with the segment number
+                 * for this module
+                 */
+                se = symtabFind(symtab, hr->i.label);
+                if (!se || se->segment == -1) {
+                    if (!options.dynalink && !(hr->i.flags & SYM_IMPORT)) {
+                        fprintf(error_file,
+                                "error: unresolved reference to `%s'"
+                                " in module `%s'\n", hr->i.label,
+                                cur->name);
+                        errorcount++;
+                    }
+                    /*
+                     * we need to allocate a segment number for this
+                     * symbol, and store it in the symbol table for
+                     * future reference
+                     */
+                    if (!se) {
+                        se = malloc(sizeof(*se));
+                        if (!se) {
+                            fprintf(stderr, "ldrdf: out of memory\n");
+                            exit(1);
+                        }
+                        se->name = strdup(hr->i.label);
+                        se->flags = 0;
+                        se->segment = availableseg++;
+                        se->offset = 0;
+                        symtabInsert(symtab, se);
+                    } else {
+                        se->segment = availableseg++;
+                        se->offset = 0;
+                    }
+                    /*
+                     * output a header record that imports it to the
+                     * recently allocated segment number...
+                     */
+                    newrec = *hr;
+                    newrec.i.segment = se->segment;
+                    rdfaddheader(rdfheader, &newrec);
+                }
+
+                add_seglocation(&segs, hr->i.segment, se->segment,
+                                se->offset);
+                break;
+
+            case RDFREC_GLOBAL:        /* export symbol */
+                /*
+                 * need to insert an export for this symbol into the new
+                 * header, unless we're stripping symbols. Even if we're
+                 * stripping, put the symbol if it's marked as SYM_GLOBAL.
+                 */
+                if (options.strip && !(hr->e.flags & SYM_GLOBAL))
+                    break;
+
+                if (hr->e.segment == 2) {
+                    seg = 2;
+                    offset = cur->bss_reloc;
+                } else {
+                    localseg = rdffindsegment(&cur->f, hr->e.segment);
+                    if (localseg == -1) {
+                        fprintf(stderr, "%s: exported symbol `%s' from "
+                                "unrecognised segment\n", cur->name,
+                                hr->e.label);
+                        errorcount++;
+                        break;
+                    }
+                    offset = cur->seginfo[localseg].reloc;
+                    seg = cur->seginfo[localseg].dest_seg;
+                }
+
+                hr->e.segment = seg;
+                hr->e.offset += offset;
+                rdfaddheader(rdfheader, hr);
+                break;
+
+            case RDFREC_MODNAME:       /* module name */
+                /*
+                 * Insert module name record if export symbols
+                 * are not stripped.
+                 * If module name begins with '$' - insert it anyway.
+                 */
+                if (options.strip && hr->m.modname[0] != '$')
+                    break;
+                rdfaddheader(rdfheader, hr);
+                break;
+
+            case RDFREC_DLL:   /* DLL name */
+                /*
+                 * Insert DLL name if it begins with '$'
+                 */
+                if (hr->d.libname[0] != '$')
+                    break;
+                rdfaddheader(rdfheader, hr);
+                break;
+
+            case RDFREC_SEGRELOC:      /* segment fixup */
+                /*
+                 * modify the segment numbers if necessary, and
+                 * pass straight through to the output module header
+                 *
+                 * *** FIXME ***
+                 */
+                if (hr->r.segment == 2) {
+                    fprintf(stderr, "%s: segment fixup in BSS section\n",
+                            cur->name);
+                    errorcount++;
+                    break;
+                }
+                localseg = rdffindsegment(&cur->f, hr->r.segment);
+                if (localseg == -1) {
+                    fprintf(stderr, "%s: segment fixup in unrecognised"
+                            " segment (%d)\n", cur->name, hr->r.segment);
+                    errorcount++;
+                    break;
+                }
+                hr->r.segment = cur->seginfo[localseg].dest_seg;
+                hr->r.offset += cur->seginfo[localseg].reloc;
+
+                if (!get_seglocation(&segs, hr->r.refseg, &seg, &offset)) {
+                    fprintf(stderr, "%s: segment fixup to undefined "
+                            "segment %04x\n", cur->name,
+                            (int)hr->r.refseg);
+                    errorcount++;
+                    break;
+                }
+                hr->r.refseg = seg;
+                rdfaddheader(rdfheader, hr);
+                break;
+
+            case RDFREC_COMMON:        /* Common variable */
+                /* Is this symbol already in the table? */
+                se = symtabFind(symtab, hr->c.label);
+                if (!se) {
+                    printf("%s is not in symtab yet\n", hr->c.label);
+                    break;
+                }
+                /* Add segment location */
+                add_seglocation(&segs, hr->c.segment, se->segment,
+                                se->offset);
+                break;
+            }
+        }
+
+        free(header);
+        done_seglocations(&segs);
+
+    }
+
+    /*
+     * combined BSS reservation for the entire results
+     */
+    newrec.type = RDFREC_BSS;
+    newrec.b.reclen = 4;
+    newrec.b.amount = bss_length;
+    rdfaddheader(rdfheader, &newrec);
+
+    /*
+     * Write the header
+     */
+    for (i = 0; i < nsegs; i++) {
+        if (i == 2)
+            continue;
+        rdfaddsegment(rdfheader, outputseg[i].length);
+    }
+
+    rdfwriteheader(f, rdfheader);
+    rdfdoneheader(rdfheader);
+
+    /*
+     * Step through the segments, one at a time, writing out into
+     * the output file
+     */
+    for (i = 0; i < nsegs; i++) {
+        uint16_t s;
+        int32_t l;
+
+        if (i == 2)
+            continue;
+
+        s = translateint16_t(outputseg[i].type);
+        fwrite(&s, 2, 1, f);
+        s = translateint16_t(outputseg[i].number);
+        fwrite(&s, 2, 1, f);
+        s = translateint16_t(outputseg[i].reserved);
+        fwrite(&s, 2, 1, f);
+        l = translateint32_t(outputseg[i].length);
+        fwrite(&l, 4, 1, f);
+
+        fwrite(outputseg[i].data, outputseg[i].length, 1, f);
+    }
+
+    fwritezero(10, f);
+}
+
+/* =========================================================================
+ * Main program
+ */
+
+void usage()
+{
+    printf("usage:\n"
+           "   ldrdf [options] object modules ... [-llibrary ...]\n"
+           "   ldrdf -r\n"
+           "options:\n"
+           "   -v[=n]          increase verbosity by 1, or set it to n\n"
+           "   -a nn           set segment alignment value (default 16)\n"
+           "   -s              strip public symbols\n"
+           "   -dy             Unix-style dynamic linking\n"
+           "   -o name         write output in file 'name'\n"
+           "   -j path         specify objects search path\n"
+           "   -L path         specify libraries search path\n"
+           "   -g file         embed 'file' as a first header record with type 'generic'\n");
+    exit(0);
+}
+
+int main(int argc, char **argv)
+{
+    char *outname = "aout.rdf";
+    int moduleloaded = 0;
+    char *respstrings[128] = { 0, };
+
+    options.verbose = 0;
+    options.align = 16;
+    options.dynalink = 0;
+    options.strip = 0;
+
+    error_file = stderr;
+
+    argc--, argv++;
+    if (argc == 0)
+        usage();
+    while (argc && *argv && **argv == '-' && argv[0][1] != 'l') {
+        switch (argv[0][1]) {
+        case 'r':
+            printf("ldrdf (linker for RDF files) version " LDRDF_VERSION
+                   "\n");
+            printf("RDOFF2 revision %s\n", RDOFF2_REVISION);
+            exit(0);
+        case 'v':
+            if (argv[0][2] == '=') {
+                options.verbose = argv[0][3] - '0';
+                if (options.verbose < 0 || options.verbose > 9) {
+                    fprintf(stderr,
+                            "ldrdf: verbosity level must be a number"
+                            " between 0 and 9\n");
+                    exit(1);
+                }
+            } else
+                options.verbose++;
+            break;
+        case 'a':
+            options.align = atoi(argv[1]);
+            if (options.align <= 0) {
+                fprintf(stderr,
+                        "ldrdf: -a expects a positive number argument\n");
+                exit(1);
+            }
+            argv++, argc--;
+            break;
+        case 's':
+            options.strip = 1;
+            break;
+        case 'd':
+            if (argv[0][2] == 'y')
+                options.dynalink = 1;
+            break;
+        case 'o':
+            outname = argv[1];
+            argv++, argc--;
+            break;
+        case 'j':
+            if (!objpath) {
+                options.objpath = 1;
+                objpath = argv[1];
+                argv++, argc--;
+                break;
+            } else {
+                fprintf(stderr,
+                        "ldrdf: more than one objects search path specified\n");
+                exit(1);
+            }
+        case 'L':
+            if (!libpath) {
+                options.libpath = 1;
+                libpath = argv[1];
+                argv++, argc--;
+                break;
+            } else {
+                fprintf(stderr,
+                        "ldrdf: more than one libraries search path specified\n");
+                exit(1);
+            }
+        case '@':{
+                int i = 0;
+                char buf[256];
+                FILE *f;
+
+                options.respfile = 1;
+                if (argv[1] != NULL)
+                    f = fopen(argv[1], "r");
+                else {
+                    fprintf(stderr,
+                            "ldrdf: no response file name specified\n");
+                    exit(1);
+                }
+
+                if (f == NULL) {
+                    fprintf(stderr,
+                            "ldrdf: unable to open response file\n");
+                    exit(1);
+                }
+
+                argv++, argc--;
+                while (fgets(buf, sizeof(buf), f) != NULL) {
+                    char *p;
+                    if (buf[0] == '\n')
+                        continue;
+                    if ((p = strchr(buf, '\n')) != NULL)
+                        *p = '\0';
+                    if (i >= 128) {
+                        fprintf(stderr, "ldrdf: too many input files\n");
+                        exit(1);
+                    }
+                    *(respstrings + i) = newstr(buf);
+                    argc++, i++;
+                }
+                break;
+            }
+        case '2':
+            options.stderr_redir = 1;
+            error_file = stdout;
+            break;
+        case 'g':
+            generic_rec_file = argv[1];
+            argv++, argc--;
+            break;
+        default:
+            usage();
+        }
+        argv++, argc--;
+    }
+
+    if (options.verbose > 4) {
+        printf("ldrdf invoked with options:\n");
+        printf("    section alignment: %d bytes\n", options.align);
+        printf("    output name: `%s'\n", outname);
+        if (options.strip)
+            printf("    strip symbols\n");
+        if (options.dynalink)
+            printf("    Unix-style dynamic linking\n");
+        if (options.objpath)
+            printf("    objects search path: %s\n", objpath);
+        if (options.libpath)
+            printf("    libraries search path: %s\n", libpath);
+        printf("\n");
+    }
+
+    symtab = symtabNew();
+    initsegments();
+
+    if (!symtab) {
+        fprintf(stderr, "ldrdf: out of memory\n");
+        exit(1);
+    }
+
+    while (argc) {
+        if (!*argv)
+            argv = respstrings;
+        if (!*argv)
+            break;
+        if (!strncmp(*argv, "-l", 2)) {
+            if (libpath && (argv[0][2] != '/'))
+                add_library(newstrcat(libpath, *argv + 2));
+            else
+                add_library(*argv + 2);
+        } else {
+            if (objpath && (argv[0][0] != '/'))
+                loadmodule(newstrcat(objpath, *argv));
+            else
+                loadmodule(*argv);
+            moduleloaded = 1;
+        }
+        argv++, argc--;
+    }
+
+    if (!moduleloaded) {
+        printf("ldrdf: nothing to do. ldrdf -h for usage\n");
+        return 0;
+    }
+
+    search_libraries();
+
+    if (options.verbose > 2) {
+        printf("symbol table:\n");
+        symtabDump(symtab, stdout);
+    }
+
+    write_output(outname);
+
+    if (errorcount > 0)
+        exit(1);
+    return 0;
+}
diff --git a/rdoff/ldsegs.h b/rdoff/ldsegs.h
new file mode 100644 (file)
index 0000000..fcecdf6
--- /dev/null
@@ -0,0 +1,60 @@
+/*
+ * ldsegs.h    Data for 'ldrdf' to determine what to do with different
+ *             types of segment. This may be useful in other contexts also.
+ */
+
+#ifndef RDOFF_LDSEGS_H
+#define RDOFF_LDSEGS_H 1
+
+#include <inttypes.h>
+
+struct segconfig {
+    uint16_t typelow, typehi;  /* range of seg nos for which this is valid */
+    char *typedesc;            /* a description of the segment type */
+    uint16_t dowhat;           /* one of the SEG_xxxx values below */
+    uint16_t mergetype;                /* if SEG_MERGE what type segment do we merge
+                                  with?
+                                   0 -> same type of segment. This type is also
+                                   used with SEG_NEWSEG. */
+};
+
+#define SEG_IGNORE 0
+#define SEG_NEWSEG 1
+#define SEG_MERGE  2
+
+#define SEGCONFIGMAX 11
+
+struct segconfig sconft[SEGCONFIGMAX] = {
+    {0x0000, 0x0000, "NULL segment", 0, 0},
+    {0x0001, 0x0001, "text", 2, 0},
+    {0x0002, 0x0002, "data", 2, 0},
+    {0x0003, 0x0003, "comment(ignored)", 0, 0},
+    {0x0004, 0x0005, "comment(kept)", 2, 0},
+    {0x0006, 0x0007, "debug information", 2, 0},
+    {0x0008, 0x001F, "reserved(general extensions)", 1, 0},
+    {0x0020, 0x0FFF, "reserved(MOSCOW)", 1, 0},
+    {0x1000, 0x7FFF, "reserved(system dependant)", 1, 0},
+    {0x8000, 0xFFFE, "reserved(other)", 1, 0},
+    {0xFFFF, 0xFFFF, "invalid segment", 0, 0}
+};
+
+#define getsegconfig(target,number)                            \
+    {                                                          \
+       int _i;                                                 \
+       int _t = number;                                                \
+       for (_i = 0; _i < SEGCONFIGMAX; _i++)                   \
+          if (_t >= sconft[_i].typelow && _t <= sconft[_i].typehi)     \
+          {                                                    \
+              target = sconft[_i];                             \
+              if (target.mergetype == 0) target.mergetype = _t;        \
+              break;                                           \
+          }                                                    \
+       if (_i == SEGCONFIGMAX)                                 \
+       {                                                       \
+          fprintf(stderr, "PANIC: can't find segment %04X in segconfig\n",\
+                  _t);                                         \
+          exit(1);                                             \
+       }                                                       \
+    }
+
+#endif
diff --git a/rdoff/rdf2bin.1 b/rdoff/rdf2bin.1
new file mode 100644 (file)
index 0000000..d274d58
--- /dev/null
@@ -0,0 +1,65 @@
+.TH RDF2BIN 1 "September 6, 1999" "Debian Project" "Debian Manual"
+.SH NAME
+rdf2bin, rdf2com \- convert an RDOFF object file to flat binary
+.SH SYNOPSIS
+.B rdf2bin
+.RI "[\-o " relocation-origin ]
+.RI "[\-p " segment-alignment ]
+.RI "[\-f " format ]
+.I input-file
+.I output-file
+.br
+.B rdf2com
+.RI "[\-p " segment-alignment ]
+.I input-file
+.I output-file
+.br
+.B rdf2ith
+.RI "[\-o " relocation-origin ]
+.RI "[\-p " segment-alignment ]
+.I input-file
+.I output-file
+.br
+.B rdf2srec
+.RI "[\-o " relocation-origin ]
+.RI "[\-p " segment-alignment ]
+.I input-file
+.I output-file
+.SH OPTIONS
+.TP
+.RI "\-o " relocation-origin
+Relocate at origin
+.IR relocation-origin .
+If invoked as
+.BR rdf2com ,
+the default relocation origin will be 0x100. Else, the default origin is 0.
+.TP
+.RI "\-p " segment-alignment
+Pad segments until their size is a multiple of
+.IR segment-alignment .
+By default, 16 is used.
+.TP
+.RI "\-f " format
+Specify the output format.  The currently supported formats are binary
+.RI ( bin ),
+DOS COM (binary with origin 0x100)
+.RI ( com )
+Intel hex
+.RI ( ith
+or
+.IR ihx ),
+and
+Motorola S-Records
+.RI ( srec ).
+If not specified, the format is set by the command name.
+.SH AUTHORS
+Julian Hall <jules@earthcorp.com>, H. Peter Anvin <hpa@zytor.com>.
+.PP
+This manual page was written by Matej Vela <vela@debian.org>.
+.SH BUGS
+This utility currently only supports the classic segments
+.IR .text ,
+.I .data
+and
+.IR .bss .
+
diff --git a/rdoff/rdf2bin.c b/rdoff/rdf2bin.c
new file mode 100644 (file)
index 0000000..72e5104
--- /dev/null
@@ -0,0 +1,430 @@
+/* ----------------------------------------------------------------------- *
+ *   
+ *   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.
+ *
+ * ----------------------------------------------------------------------- */
+
+/*
+ * rdf2bin.c - convert an RDOFF object file to flat binary
+ */
+
+#include "compiler.h"
+
+#include <stdlib.h>
+#include <stdio.h>
+#include <string.h>
+#include <ctype.h>
+#include <errno.h>
+
+#include "rdfload.h"
+#include "nasmlib.h"
+
+const char *progname;
+
+static uint32_t origin = 0;
+static bool origin_def = false;
+static uint32_t align = 16;
+static bool align_def = false;
+
+struct output_format {
+    const char *name;
+    const char *mode;
+    int (*init)(FILE *f);
+    int (*output)(FILE *f, void *data, uint32_t bytes, uint32_t where);
+    int (*fini)(FILE *f);
+};
+
+static int null_init_fini(FILE *f)
+{
+    (void)f;
+    return 0;
+}
+
+static int com_init(FILE *f)
+{
+    (void)f;
+    if (!origin_def)
+       origin = 0x100;
+    return 0;
+}
+
+static int output_bin(FILE *f, void *data, uint32_t bytes, uint32_t where)
+{
+    static uint32_t offset = 0;        /* Current file offset, if applicable */
+    size_t pad;
+
+    if (where-origin < offset) {
+       fprintf(stderr, "%s: internal error: backwards movement\n", progname);
+       exit(1);
+    }
+
+    pad = (where-origin) - offset;
+    if (fwritezero(pad, f) != pad)
+       return -1;
+    offset += pad;
+
+    if (fwrite(data, 1, bytes, f) != bytes)
+       return -1;
+    offset += bytes;
+
+    return 0;
+}
+
+static int write_ith_record(FILE *f, unsigned int len, uint16_t addr,
+                           uint8_t type, void *data)
+{
+    char buf[1+2+4+2+255*2+2+2];
+    char *p = buf;
+    uint8_t csum, *dptr = data;
+    unsigned int i;
+
+    if (len > 255) {
+       fprintf(stderr, "%s: internal error: invalid ith record size\n",
+               progname);
+       exit(1);
+    }
+
+    csum = len + addr + (addr >> 8) + type;
+    for (i = 0; i < len; i++)
+       csum += dptr[i];
+    csum = -csum;
+
+    p += sprintf(p, ":%02X%04X%02X", len, addr, type);
+    for (i = 0; i < len; i++)
+       p += sprintf(p, "%02X", dptr[i]);
+    p += sprintf(p, "%02X\n", csum);
+
+    if (fwrite(buf, 1, p-buf, f) != (size_t)(p-buf))
+       return -1;
+
+    return 0;
+}
+
+static int output_ith(FILE *f, void *data, uint32_t bytes, uint32_t where)
+{
+    static uint32_t last = 0;  /* Last address written */
+    uint8_t abuf[2];
+    uint8_t *dbuf = data;
+    uint32_t chunk;
+
+    while (bytes) {
+       if ((where ^ last) & ~0xffff) {
+           abuf[0] = where >> 24;
+           abuf[1] = where >> 16;
+           if (write_ith_record(f, 2, 0, 4, abuf))
+               return -1;
+       }
+
+       /* Output up to 32 bytes, but always end on an aligned boundary */
+       chunk = 32 - (where & 31);
+       if (bytes < chunk)
+           chunk = bytes;
+
+       if (write_ith_record(f, chunk, (uint16_t)where, 0, dbuf))
+           return -1;
+
+       dbuf += chunk;
+       last = where + chunk - 1;
+       where += chunk;
+       bytes -= chunk;
+    }
+    return 0;
+}
+
+static int fini_ith(FILE *f)
+{
+    /* XXX: entry point? */
+    return write_ith_record(f, 0, 0, 1, NULL);
+}
+
+static int write_srecord(FILE *f, unsigned int len,  unsigned int alen,
+                        uint32_t addr, uint8_t type, void *data)
+{
+    char buf[2+2+8+255*2+2+2];
+    char *p = buf;
+    uint8_t csum, *dptr = data;
+    unsigned int i;
+
+    if (len > 255) {
+       fprintf(stderr, "%s: internal error: invalid srec record size\n",
+               progname);
+       exit(1);
+    }
+
+    switch (alen) {
+    case 2:
+       addr &= 0xffff;
+       break;
+    case 3:
+       addr &= 0xffffff;
+       break;
+    case 4:
+       break;
+    default:
+       fprintf(stderr, "%s: internal error: invalid srec address length\n",
+               progname);
+       exit(1);
+    }
+
+    csum = (len+alen+1) + addr + (addr >> 8) + (addr >> 16) + (addr >> 24);
+    for (i = 0; i < len; i++)
+       csum += dptr[i];
+    csum = 0xff-csum;
+
+    p += sprintf(p, "S%c%02X%0*X", type, len+alen+1, alen*2, addr);
+    for (i = 0; i < len; i++)
+       p += sprintf(p, "%02X", dptr[i]);
+    p += sprintf(p, "%02X\n", csum);
+
+    if (fwrite(buf, 1, p-buf, f) != (size_t)(p-buf))
+       return -1;
+
+    return 0;
+}
+
+static int init_srec(FILE *f)
+{
+    return write_srecord(f, 0, 2, 0, '0', NULL);
+}
+
+static int fini_srec(FILE *f)
+{
+    /* XXX: entry point? */
+    return write_srecord(f, 0, 4, 0, '7', NULL);
+}
+
+static int output_srec(FILE *f, void *data, uint32_t bytes, uint32_t where)
+{
+    uint8_t *dbuf = data;
+    unsigned int chunk;
+
+    while (bytes) {
+       /* Output up to 32 bytes, but always end on an aligned boundary */
+       chunk = 32 - (where & 31);
+       if (bytes < chunk)
+           chunk = bytes;
+
+       if (write_srecord(f, chunk, 4, where, '3', dbuf))
+           return -1;
+
+       dbuf += chunk;
+       where += chunk;
+       bytes -= chunk;
+    }
+    return 0;
+}
+
+static struct output_format output_formats[] = {
+    { "bin",  "wb", null_init_fini, output_bin, null_init_fini },
+    { "com",  "wb", com_init, output_bin, null_init_fini },
+    { "ith",  "wt", null_init_fini, output_ith, fini_ith },
+    { "ihx",  "wt", null_init_fini, output_ith, fini_ith },
+    { "srec", "wt", init_srec, output_srec, fini_srec },
+    { NULL, NULL, NULL, NULL, NULL }
+};
+
+static const char *getformat(const char *pathname)
+{
+    const char *p;
+    static char fmt_buf[16];
+
+    /* 
+     * Search backwards for the string "rdf2" followed by a string
+     * of alphanumeric characters.  This should handle path prefixes,
+     * as well as extensions (e.g. C:\FOO\RDF2SREC.EXE).
+     */
+    for (p = strchr(pathname, '\0')-1 ; p >= pathname ; p--) {
+       if (!nasm_stricmp(p, "rdf2")) {
+           const char *q = p+4;
+           char *r = fmt_buf;
+           while (isalnum(*q) && r < fmt_buf+sizeof fmt_buf-1)
+               *r++ = *q++;
+           *r = '\0';
+           if (fmt_buf[0])
+               return fmt_buf;
+       }
+     }
+    return NULL;
+}
+
+static void usage(void)
+{
+    fprintf(stderr,
+           "Usage: %s [options] input-file output-file\n"
+           "Options:\n"
+           "    -o origin       Specify the relocation origin\n"
+           "    -p alignment    Specify minimum segment alignment\n"
+           "    -f format       Select format (bin, com, ith, srec)\n"
+           "    -q              Run quiet\n"
+           "    -v              Run verbose\n",
+           progname);
+}
+
+int main(int argc, char **argv)
+{
+    rdfmodule *m;
+    bool err;
+    FILE *of;
+    int codepad, datapad;
+    const char *format = NULL;
+    const struct output_format *fmt;
+    bool quiet = false;
+
+    progname = argv[0];
+
+    if (argc < 2) {
+       usage();
+        return 1;
+    }
+
+    argv++, argc--;
+
+    while (argc > 2) {
+       if (argv[0][0] == '-' && argv[0][1] && !argv[0][2]) {
+           switch (argv[0][1]) {
+           case 'o':
+               argv++, argc--;
+               origin = readnum(*argv, &err);
+               if (err) {
+                   fprintf(stderr, "%s: invalid parameter: %s\n",
+                           progname, *argv);
+                   return 1;
+               }
+               origin_def = true;
+               break;
+           case 'p':
+               argv++, argc--;
+               align = readnum(*argv, &err);
+               if (err) {
+                   fprintf(stderr, "%s: invalid parameter: %s\n",
+                           progname, *argv);
+                   return 1;
+               }
+               align_def = true;
+               break;
+           case 'f':
+               argv++, argc--;
+               format = *argv;
+               break;
+           case 'q':
+               quiet = true;
+               break;
+           case 'v':
+               quiet = false;
+               break;
+           case 'h':
+               usage();
+               return 0;
+           default:
+               fprintf(stderr, "%s: unknown option: %s\n",
+                       progname, *argv);
+               return 1;
+           }
+       }
+        argv++, argc--;
+    }
+
+    if (argc < 2) {
+       usage();
+        return 1;
+    }
+
+    if (!format)
+       format = getformat(progname);
+
+    if (!format) {
+       fprintf(stderr, "%s: unable to determine desired output format\n",
+               progname);
+       return 1;
+    }
+
+    for (fmt = output_formats; fmt->name; fmt++) {
+       if (!nasm_stricmp(format, fmt->name))
+           break;
+    }
+
+    if (!fmt->name) {
+       fprintf(stderr, "%s: unknown output format: %s\n", progname, format);
+       return 1;
+    }
+
+    m = rdfload(*argv);
+
+    if (!m) {
+        rdfperror(progname, *argv);
+        return 1;
+    }
+
+    if (!quiet)
+       printf("relocating %s: origin=%"PRIx32", align=%d\n",
+              *argv, origin, align);
+
+    m->textrel = origin;
+    m->datarel = origin + m->f.seg[0].length;
+    if (m->datarel % align != 0) {
+        codepad = align - (m->datarel % align);
+        m->datarel += codepad;
+    } else
+        codepad = 0;
+
+    m->bssrel = m->datarel + m->f.seg[1].length;
+    if (m->bssrel % align != 0) {
+        datapad = align - (m->bssrel % align);
+        m->bssrel += datapad;
+    } else
+        datapad = 0;
+
+    if (!quiet)
+       printf("code: %08"PRIx32"\ndata: %08"PRIx32"\nbss:  %08"PRIx32"\n",
+              m->textrel, m->datarel, m->bssrel);
+
+    rdf_relocate(m);
+
+    argv++;
+
+    of = fopen(*argv, fmt->mode);
+    if (!of) {
+        fprintf(stderr, "%s: could not open output file %s: %s\n",
+               progname, *argv, strerror(errno));
+        return 1;
+    }
+
+    if (fmt->init(of) ||
+       fmt->output(of, m->t, m->f.seg[0].length, m->textrel) ||
+       fmt->output(of, m->d, m->f.seg[1].length, m->datarel) ||
+       fmt->fini(of)) {
+        fprintf(stderr, "%s: error writing to %s: %s\n",
+               progname, *argv, strerror(errno));
+        return 1;
+    }
+
+    fclose(of);
+    return 0;
+}
diff --git a/rdoff/rdf2com.1 b/rdoff/rdf2com.1
new file mode 100644 (file)
index 0000000..43b3307
--- /dev/null
@@ -0,0 +1 @@
+.so man1/rdf2bin.1
diff --git a/rdoff/rdf2ihx.1 b/rdoff/rdf2ihx.1
new file mode 100644 (file)
index 0000000..43b3307
--- /dev/null
@@ -0,0 +1 @@
+.so man1/rdf2bin.1
diff --git a/rdoff/rdf2ith.1 b/rdoff/rdf2ith.1
new file mode 100644 (file)
index 0000000..43b3307
--- /dev/null
@@ -0,0 +1 @@
+.so man1/rdf2bin.1
diff --git a/rdoff/rdf2srec.1 b/rdoff/rdf2srec.1
new file mode 100644 (file)
index 0000000..43b3307
--- /dev/null
@@ -0,0 +1 @@
+.so man1/rdf2bin.1
diff --git a/rdoff/rdfdump.1 b/rdoff/rdfdump.1
new file mode 100644 (file)
index 0000000..cf61484
--- /dev/null
@@ -0,0 +1,24 @@
+.TH RDFDUMP 1 "September 6, 1999" "Debian Project" "Debian Manual"
+.SH NAME
+rdfdump \- dumps an RDOFF object in human-readable form
+.SH SYNOPSIS
+.B rdfdump
+[-v]
+.RI < filename >
+.SH DESCRIPTION
+.B rdfdump
+prints a list of the header records in an RDOFF object in human-readable
+form, and optionally prints a hex dump of the contents of the segments.
+.PP
+.B rdfdump
+supports both version 1 and 2 of RDOFF.  It will give warnings if the RDOFF2
+format is violated (it looks for incorrect lengths for header records, and
+checks the overall length count at the start of the file).
+.SH OPTIONS
+.TP
+-v
+Print a hex dump of the contents of the segments.
+.SH AUTHORS
+Julian Hall <jules@earthcorp.com>.
+.PP
+This manual page was written by Matej Vela <vela@debian.org>.
diff --git a/rdoff/rdfdump.c b/rdoff/rdfdump.c
new file mode 100644 (file)
index 0000000..0e55c67
--- /dev/null
@@ -0,0 +1,347 @@
+/* ----------------------------------------------------------------------- *
+ *   
+ *   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.
+ *
+ * ----------------------------------------------------------------------- */
+
+/*
+ * rdfdump.c - dump RDOFF file header.
+ */
+
+#include "compiler.h"
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+
+#define RDOFF_UTILS
+
+#include "rdoff.h"
+
+#define PROGRAM_VERSION        "2.3"
+
+FILE *infile;
+
+void print_header(int32_t length, int rdf_version)
+{
+    char buf[129], t, l, s, flags;
+    uint8_t reclen;
+    int32_t o, ll;
+    uint16_t rs;
+
+    while (length > 0) {
+        fread(&t, 1, 1, infile);
+        if (rdf_version >= 2) {
+            fread(&reclen, 1, 1, infile);
+        }
+        switch (t) {
+        case RDFREC_GENERIC:   /* generic record */
+            printf("  generic record (length=%d)\n", (int)reclen);
+            fseek(infile, reclen, SEEK_CUR);
+            break;
+
+        case RDFREC_RELOC:     /* relocation record */
+        case RDFREC_SEGRELOC:  /* segment relocation */
+            fread(&s, 1, 1, infile);
+            fread(&o, 4, 1, infile);
+            fread(&l, 1, 1, infile);
+            fread(&rs, 2, 1, infile);
+            printf("  %s: location (%04x:%08"PRIx32"), length %d, "
+                   "referred seg %04x\n",
+                   t == 1 ? "relocation" : "seg relocation", (int)s,
+                   translateint32_t(o), (int)l, translateint16_t(rs));
+            if (rdf_version >= 2 && reclen != 8)
+                printf("    warning: reclen != 8\n");
+            if (rdf_version == 1)
+                length -= 9;
+            if (rdf_version == 1 && t == 6)
+                printf
+                    ("    warning: seg relocation not supported in RDOFF1\n");
+            break;
+
+        case RDFREC_IMPORT:    /* import record */
+        case RDFREC_FARIMPORT: /* import far symbol */
+            fread(&flags, 1, 1, infile);
+            fread(&rs, 2, 1, infile);
+            ll = 0;
+
+            if (rdf_version == 1) {
+                do {
+                    fread(&buf[ll], 1, 1, infile);
+                } while (buf[ll++]);
+            } else {
+                for (; ll < reclen - 3; ll++)
+                    fread(&buf[ll], 1, 1, infile);
+            }
+
+            if (t == 7)
+                printf("far ");
+            printf((flags & SYM_IMPORT) ? "  import" : "  extern");
+            if (flags & SYM_FUNCTION)
+                printf(" proc");
+            if (flags & SYM_DATA)
+                printf(" data");
+            printf(": segment %04x = %s\n", translateint16_t(rs), buf);
+            if (rdf_version == 1)
+                length -= ll + 3;
+            if (rdf_version == 1 && t == 7)
+                printf
+                    ("    warning: far import not supported in RDOFF1\n");
+            break;
+
+        case RDFREC_GLOBAL:    /* export record */
+            fread(&flags, 1, 1, infile);
+            fread(&s, 1, 1, infile);
+            fread(&o, 4, 1, infile);
+            ll = 0;
+
+            if (rdf_version == 1) {
+                do {
+                    fread(&buf[ll], 1, 1, infile);
+                } while (buf[ll++]);
+            } else {
+                for (; ll < reclen - 6; ll++)
+                    fread(&buf[ll], 1, 1, infile);
+            }
+            printf((flags & SYM_GLOBAL) ? "  export" : "  public");
+            if (flags & SYM_FUNCTION)
+                printf(" proc");
+            if (flags & SYM_DATA)
+                printf(" data");
+            printf(": (%04x:%08"PRIx32") = %s\n", (int)s, translateint32_t(o), buf);
+            if (rdf_version == 1)
+                length -= ll + 6;
+            break;
+
+        case RDFREC_DLL:       /* DLL and Module records */
+        case RDFREC_MODNAME:
+            ll = 0;
+            if (rdf_version == 1) {
+                do {
+                    fread(&buf[ll], 1, 1, infile);
+                } while (buf[ll++]);
+            } else {
+                for (; ll < reclen; ll++)
+                    fread(&buf[ll], 1, 1, infile);
+            }
+            if (t == 4)
+                printf("  dll: %s\n", buf);
+            else
+                printf("  module: %s\n", buf);
+            if (rdf_version == 1)
+                length -= ll + 1;
+            break;
+
+        case RDFREC_BSS:       /* BSS reservation */
+            fread(&ll, 4, 1, infile);
+            printf("  bss reservation: %08"PRIx32" bytes\n", translateint32_t(ll));
+            if (rdf_version == 1)
+                length -= 5;
+            if (rdf_version > 1 && reclen != 4)
+                printf("    warning: reclen != 4\n");
+            break;
+
+        case RDFREC_COMMON:{
+                uint16_t seg, align;
+                uint32_t size;
+
+                fread(&seg, 2, 1, infile);
+                fread(&size, 4, 1, infile);
+                fread(&align, 2, 1, infile);
+                for (ll = 0; ll < reclen - 8; ll++)
+                    fread(buf + ll, 1, 1, infile);
+                printf("  common: segment %04x = %s, %"PRId32":%d\n",
+                       translateint16_t(seg), buf, translateint32_t(size),
+                       translateint16_t(align));
+                break;
+            }
+
+        default:
+            printf("  unrecognized record (type %d", (int)t);
+            if (rdf_version > 1) {
+                printf(", length %d", (int)reclen);
+                fseek(infile, reclen, SEEK_CUR);
+            } else
+                length--;
+            printf(")\n");
+        }
+        if (rdf_version != 1)
+            length -= 2 + reclen;
+    }
+}
+
+int main(int argc, char **argv)
+{
+    char id[7];
+    int32_t l;
+    uint16_t s;
+    int verbose = 0;
+    int32_t offset;
+    int foundnullsegment = 0;
+    int version;
+    int32_t segmentcontentlength = 0;
+    int nsegments = 0;
+    int32_t headerlength = 0;
+    int32_t objectlength = 0;
+
+    printf("RDOFF dump utility, version %s\n", PROGRAM_VERSION);
+    printf("RDOFF2 revision %s\n", RDOFF2_REVISION);
+    puts("Copyright (c) 1996,99 Julian R Hall\n"
+         "Improvements and fixes (c) 2002-2004 RET & COM Research.");
+
+    if (argc < 2) {
+        fputs("Usage: rdfdump [-v] <filename>\n", stderr);
+        exit(1);
+    }
+
+    if (!strcmp(argv[1], "-v")) {
+        verbose = 1;
+        if (argc < 3) {
+            fputs("required parameter missing\n", stderr);
+            exit(1);
+        }
+        argv++;
+    }
+
+    infile = fopen(argv[1], "rb");
+    if (!infile) {
+        fprintf(stderr, "rdfdump: Could not open %s\n", argv[1]);
+        exit(1);
+    }
+
+    fread(id, 6, 1, infile);
+    if (strncmp(id, "RDOFF", 5)) {
+        fputs("rdfdump: File does not contain valid RDOFF header\n",
+              stderr);
+        exit(1);
+    }
+
+    printf("File %s: RDOFF version %c\n\n", argv[1], id[5]);
+    if (id[5] < '1' || id[5] > '2') {
+        fprintf(stderr, "rdfdump: unknown RDOFF version '%c'\n", id[5]);
+        exit(1);
+    }
+    version = id[5] - '0';
+
+    if (version > 1) {
+        fread(&l, 4, 1, infile);
+        objectlength = translateint32_t(l);
+        printf("Object content size: %"PRId32" bytes\n", objectlength);
+    }
+
+    fread(&l, 4, 1, infile);
+    headerlength = translateint32_t(l);
+    printf("Header (%"PRId32" bytes):\n", headerlength);
+    print_header(headerlength, version);
+
+    if (version == 1) {
+        fread(&l, 4, 1, infile);
+        l = translateint32_t(l);
+        printf("\nText segment length = %"PRId32" bytes\n", l);
+        offset = 0;
+        while (l--) {
+            fread(id, 1, 1, infile);
+            if (verbose) {
+                if (offset % 16 == 0)
+                    printf("\n%08"PRIx32" ", offset);
+                printf(" %02x", (int)(uint8_t)id[0]);
+                offset++;
+            }
+        }
+        if (verbose)
+            printf("\n\n");
+
+        fread(&l, 4, 1, infile);
+        l = translateint32_t(l);
+        printf("Data segment length = %"PRId32" bytes\n", l);
+
+        if (verbose) {
+            offset = 0;
+            while (l--) {
+                fread(id, 1, 1, infile);
+                if (offset % 16 == 0)
+                    printf("\n%08"PRIx32" ", offset);
+                printf(" %02x", (int)(uint8_t)id[0]);
+                offset++;
+            }
+            printf("\n");
+        }
+    } else {
+        do {
+            fread(&s, 2, 1, infile);
+            s = translateint16_t(s);
+            if (!s) {
+                printf("\nNULL segment\n");
+                foundnullsegment = 1;
+                break;
+            }
+            printf("\nSegment:\n  Type   = %04X (%s)\n", (int)s,
+                   translatesegmenttype(s));
+            nsegments++;
+
+            fread(&s, 2, 1, infile);
+            printf("  Number = %04X\n", (int)translateint16_t(s));
+            fread(&s, 2, 1, infile);
+            printf("  Resrvd = %04X\n", (int)translateint16_t(s));
+            fread(&l, 4, 1, infile);
+            l = translateint32_t(l);
+            printf("  Length = %"PRId32" bytes\n", l);
+            segmentcontentlength += l;
+
+            offset = 0;
+            while (l--) {
+                fread(id, 1, 1, infile);
+                if (verbose) {
+                    if (offset % 16 == 0)
+                        printf("\n%08"PRIx32" ", offset);
+                    printf(" %02x", (int)(uint8_t)id[0]);
+                    offset++;
+                }
+            }
+            if (verbose)
+                printf("\n");
+        } while (!feof(infile));
+        if (!foundnullsegment)
+            printf("\nWarning: unexpected end of file - "
+                   "NULL segment not found\n");
+
+        printf("\nTotal number of segments: %d\n", nsegments);
+        printf("Total segment content length: %"PRId32" bytes\n",
+               segmentcontentlength);
+
+        /* calculate what the total object content length should have been */
+        l = segmentcontentlength + 10 * (nsegments + 1) + headerlength + 4;
+        if (l != objectlength)
+            printf("Warning: actual object length (%"PRId32") != "
+                   "stored object length (%"PRId32")\n", l, objectlength);
+    }
+    fclose(infile);
+    return 0;
+}
diff --git a/rdoff/rdflib.1 b/rdoff/rdflib.1
new file mode 100644 (file)
index 0000000..bba1032
--- /dev/null
@@ -0,0 +1,39 @@
+.TH RDFLIB 1 "September 6, 1999" "Debian Project" "Debian Manual"
+.SH NAME
+rdflib \- manage a library file for use with ldrdf(1)
+.SH SYNOPSIS
+.B rdflib
+.I command
+.I arguments
+.SH DESCRIPTION
+.B rdflib
+manages a library file which can be used by
+.BR ldrdf (1).
+It is supplied with a shell script
+.B makelib
+which should probably be used to create libraries.
+.SH COMMANDS
+.TP
+.BI c " library-file"
+Create (or truncate) a library.
+.TP
+.BI a " library-file object-file module"
+Add the
+.I object-file
+to the library under the name
+.IR module .
+.TP
+.BI x " library-file module object-file"
+Extract a
+.I module
+from the library to the file
+.IR object-file .
+.TP
+.B t " library-file"
+Display a list of modules in the library.
+.SH NOTES
+A remove command will be added soon.
+.SH AUTHORS
+Julian Hall <jules@earthcorp.com>.
+.PP
+This manual page was written by Matej Vela <vela@debian.org>.
diff --git a/rdoff/rdflib.c b/rdoff/rdflib.c
new file mode 100644 (file)
index 0000000..1213bea
--- /dev/null
@@ -0,0 +1,428 @@
+/* ----------------------------------------------------------------------- *
+ *   
+ *   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.
+ *
+ * ----------------------------------------------------------------------- */
+
+/* rdflib - manipulate RDOFF library files (.rdl) */
+
+/*
+ * an rdoff library is simply a sequence of RDOFF object files, each
+ * preceded by the name of the module, an ASCII string of up to 255
+ * characters, terminated by a zero.
+ *
+ * When a library is being created, special signature block is placed
+ * in the beginning of the file. It is a string 'RDLIB' followed by a
+ * version number, then int32_t content size and a int32_t time stamp.
+ * The module name of the signature block is '.sig'.
+ *
+ *
+ * There may be an optional directory placed on the end of the file.
+ * The format of the directory will be 'RDLDD' followed by a version
+ * number, followed by the length of the directory, and then the
+ * directory, the format of which has not yet been designed.
+ * The module name of the directory must be '.dir'.
+ *
+ * All module names beginning with '.' are reserved for possible future
+ * extensions. The linker ignores all such modules, assuming they have
+ * the format of a six uint8_t type & version identifier followed by int32_t
+ * content size, followed by data.
+ */
+
+#include "compiler.h"
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <errno.h>
+#include <string.h>
+#include <inttypes.h>
+#include <time.h>
+#include <inttypes.h>
+
+/* functions supported:
+ *   create a library  (no extra operands required)
+ *   add a module from a library (requires filename and name to give mod.)
+ *   replace a module in a library (requires given name and filename)
+ *   delete a module from a library (requires given name)
+ *   extract a module from the library (requires given name and filename)
+ *   list modules
+ */
+
+const char *usage =
+    "usage:\n"
+    "  rdflib x libname [extra operands]\n\n"
+    "  where x is one of:\n"
+    "    c - create library\n"
+    "    a - add module (operands = filename module-name)\n"
+    "    x - extract               (module-name filename)\n"
+    "    r - replace               (module-name filename)\n"
+    "    d - delete                (module-name)\n" "    t - list\n";
+
+/* Library signature */
+const char *rdl_signature = "RDLIB2", *sig_modname = ".sig";
+
+char **_argv;
+
+#define _ENDIANNESS 0           /* 0 for little, 1 for big */
+
+static void int32_ttolocal(int32_t *l)
+{
+#if _ENDIANNESS
+    uint8_t t;
+    uint8_t *p = (uint8_t *)l;
+
+    t = p[0];
+    p[0] = p[3];
+    p[3] = t;
+    t = p[1];
+    p[1] = p[2];
+    p[2] = p[1];
+#else
+    (void)l;             /* placate optimizers */
+#endif
+}
+
+char copybytes(FILE * fp, FILE * fp2, int n)
+{
+    int i, t = 0;
+
+    for (i = 0; i < n; i++) {
+        t = fgetc(fp);
+        if (t == EOF) {
+            fprintf(stderr, "rdflib: premature end of file in '%s'\n",
+                    _argv[2]);
+            exit(1);
+        }
+        if (fp2)
+            if (fputc(t, fp2) == EOF) {
+                fprintf(stderr, "rdflib: write error\n");
+                exit(1);
+            }
+    }
+    return (char)t;             /* return last char read */
+}
+
+int32_t copyint32_t(FILE * fp, FILE * fp2)
+{
+    int32_t l;
+    int i, t;
+    uint8_t *p = (uint8_t *)&l;
+
+    for (i = 0; i < 4; i++) {   /* skip magic no */
+        t = fgetc(fp);
+        if (t == EOF) {
+            fprintf(stderr, "rdflib: premature end of file in '%s'\n",
+                    _argv[2]);
+            exit(1);
+        }
+        if (fp2)
+            if (fputc(t, fp2) == EOF) {
+                fprintf(stderr, "rdflib: write error\n");
+                exit(1);
+            }
+        *p++ = t;
+    }
+    int32_ttolocal(&l);
+    return l;
+}
+
+int main(int argc, char **argv)
+{
+    FILE *fp, *fp2 = NULL, *fptmp;
+    char *p, buf[256], c;
+    int i;
+    int32_t l;
+    time_t t;
+    char rdbuf[10];
+
+    _argv = argv;
+
+    if (argc < 3 || !strncmp(argv[1], "-h", 2)
+        || !strncmp(argv[1], "--h", 3)) {
+        fputs(usage, stdout);
+        exit(1);
+    }
+
+    switch (argv[1][0]) {
+    case 'c':                  /* create library */
+        fp = fopen(argv[2], "wb");
+        if (!fp) {
+            fprintf(stderr, "rdflib: could not open '%s'\n", argv[2]);
+            perror("rdflib");
+            exit(1);
+        }
+        fwrite(sig_modname, 1, strlen(sig_modname) + 1, fp);
+        fwrite(rdl_signature, 1, strlen(rdl_signature), fp);
+        l = sizeof(t = time(NULL));
+        fwrite(&l, sizeof(l), 1, fp);
+        fwrite(&t, 1, l, fp);
+        fclose(fp);
+        break;
+
+    case 'a':                  /* add module */
+        if (argc < 5) {
+            fprintf(stderr, "rdflib: required parameter missing\n");
+            exit(1);
+        }
+        fp = fopen(argv[2], "ab");
+        if (!fp) {
+            fprintf(stderr, "rdflib: could not open '%s'\n", argv[2]);
+            perror("rdflib");
+            exit(1);
+        }
+
+        fp2 = fopen(argv[3], "rb");
+        if (!fp2) {
+            fprintf(stderr, "rdflib: could not open '%s'\n", argv[3]);
+            perror("rdflib");
+            exit(1);
+        }
+
+        p = argv[4];
+        do {
+            if (fputc(*p, fp) == EOF) {
+                fprintf(stderr, "rdflib: write error\n");
+                exit(1);
+            }
+        } while (*p++);
+
+        while (!feof(fp2)) {
+            i = fgetc(fp2);
+            if (i == EOF) {
+                break;
+            }
+
+            if (fputc(i, fp) == EOF) {
+                fprintf(stderr, "rdflib: write error\n");
+                exit(1);
+            }
+        }
+        fclose(fp2);
+        fclose(fp);
+        break;
+
+    case 'x':
+        if (argc < 5) {
+            fprintf(stderr, "rdflib: required parameter missing\n");
+            exit(1);
+        }
+    case 't':
+        fp = fopen(argv[2], "rb");
+        if (!fp) {
+            fprintf(stderr, "rdflib: could not open '%s'\n", argv[2]);
+            perror("rdflib");
+            exit(1);
+        }
+
+        fp2 = NULL;
+        while (!feof(fp)) {
+            /* read name */
+            p = buf;
+            while ((*(p++) = (char)fgetc(fp)))
+                if (feof(fp))
+                    break;
+
+            if (feof(fp))
+                break;
+
+            fp2 = NULL;
+            if (argv[1][0] == 'x') {
+                /* check against desired name */
+                if (!strcmp(buf, argv[3])) {
+                    fp2 = fopen(argv[4], "wb");
+                    if (!fp2) {
+                        fprintf(stderr, "rdflib: could not open '%s'\n",
+                                argv[4]);
+                        perror("rdflib");
+                        exit(1);
+                    }
+                }
+            } else
+                printf("%-40s ", buf);
+
+            /* step over the RDOFF file, extracting type information for
+             * the listing, and copying it if fp2 != NULL */
+
+            if (buf[0] == '.') {
+
+                if (argv[1][0] == 't')
+                    for (i = 0; i < 6; i++)
+                        printf("%c", copybytes(fp, fp2, 1));
+                else
+                    copybytes(fp, fp2, 6);
+
+                l = copyint32_t(fp, fp2);
+
+                if (argv[1][0] == 't')
+                    printf("   %"PRId32" bytes content\n", l);
+
+                copybytes(fp, fp2, l);
+            } else if ((c = copybytes(fp, fp2, 6)) >= '2') {    /* version 2 or above */
+                l = copyint32_t(fp, fp2);
+
+                if (argv[1][0] == 't')
+                    printf("RDOFF%c   %"PRId32" bytes content\n", c, l);
+                copybytes(fp, fp2, l);  /* entire object */
+            } else {
+                if (argv[1][0] == 't')
+                    printf("RDOFF1\n");
+                /*
+                 * version 1 object, so we don't have an object content
+                 * length field.
+                 */
+                copybytes(fp, fp2, copyint32_t(fp, fp2));  /* header */
+                copybytes(fp, fp2, copyint32_t(fp, fp2));  /* text */
+                copybytes(fp, fp2, copyint32_t(fp, fp2));  /* data */
+            }
+
+            if (fp2)
+                break;
+        }
+        fclose(fp);
+        if (fp2)
+            fclose(fp2);
+        else if (argv[1][0] == 'x') {
+            fprintf(stderr, "rdflib: module '%s' not found in '%s'\n",
+                    argv[3], argv[2]);
+            exit(1);
+        }
+        break;
+
+    case 'r':                  /* replace module */
+        argc--;
+    case 'd':                  /* delete module */
+        if (argc < 4) {
+            fprintf(stderr, "rdflib: required parameter missing\n");
+            exit(1);
+        }
+
+        fp = fopen(argv[2], "rb");
+        if (!fp) {
+            fprintf(stderr, "rdflib: could not open '%s'\n", argv[2]);
+            perror("rdflib");
+            exit(1);
+        }
+
+        if (argv[1][0] == 'r') {
+            fp2 = fopen(argv[4], "rb");
+            if (!fp2) {
+                fprintf(stderr, "rdflib: could not open '%s'\n", argv[4]);
+                perror("rdflib");
+                exit(1);
+            }
+        }
+
+        fptmp = tmpfile();
+        if (!fptmp) {
+            fprintf(stderr, "rdflib: could not open temporary file\n");
+            perror("rdflib");
+            exit(1);
+        }
+
+        /* copy library into temporary file */
+        fseek(fp, 0, SEEK_END); /* get file length */
+        l = ftell(fp);
+        fseek(fp, 0, SEEK_SET);
+        copybytes(fp, fptmp, l);
+        rewind(fptmp);
+        freopen(argv[2], "wb", fp);
+
+        while (!feof(fptmp)) {
+            /* read name */
+            p = buf;
+            while ((*(p++) = (char)fgetc(fptmp)))
+                if (feof(fptmp))
+                    break;
+
+            if (feof(fptmp))
+                break;
+
+            /* check against desired name */
+            if (!strcmp(buf, argv[3])) {
+                fread(p = rdbuf, 1, sizeof(rdbuf), fptmp);
+                l = *(int32_t *)(p + 6);
+                fseek(fptmp, l, SEEK_CUR);
+                break;
+            } else {
+                fwrite(buf, 1, strlen(buf) + 1, fp);    /* module name */
+                if ((c = copybytes(fptmp, fp, 6)) >= '2') {
+                    l = copyint32_t(fptmp, fp);    /* version 2 or above */
+                    copybytes(fptmp, fp, l);    /* entire object */
+                }
+            }
+        }
+
+        if (argv[1][0] == 'r') {
+            /* copy new module into library */
+            p = argv[3];
+            do {
+                if (fputc(*p, fp) == EOF) {
+                    fprintf(stderr, "rdflib: write error\n");
+                    exit(1);
+                }
+            } while (*p++);
+
+            while (!feof(fp2)) {
+                i = fgetc(fp2);
+                if (i == EOF) {
+                    break;
+                }
+                if (fputc(i, fp) == EOF) {
+                    fprintf(stderr, "rdflib: write error\n");
+                    exit(1);
+                }
+            }
+            fclose(fp2);
+        }
+
+        /* copy rest of library if any */
+        while (!feof(fptmp)) {
+            i = fgetc(fptmp);
+            if (i == EOF) {
+                break;
+            }
+
+            if (fputc(i, fp) == EOF) {
+                fprintf(stderr, "rdflib: write error\n");
+                exit(1);
+            }
+        }
+
+        fclose(fp);
+        fclose(fptmp);
+        break;
+
+    default:
+        fprintf(stderr, "rdflib: command '%c' not recognized\n",
+                argv[1][0]);
+        exit(1);
+    }
+    return 0;
+}
diff --git a/rdoff/rdfload.c b/rdoff/rdfload.c
new file mode 100644 (file)
index 0000000..4fd3dbd
--- /dev/null
@@ -0,0 +1,212 @@
+/* ----------------------------------------------------------------------- *
+ *   
+ *   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.
+ *
+ * ----------------------------------------------------------------------- */
+
+/*
+ * rdfload.c   RDOFF Object File loader library
+ */
+
+/*
+ * TODO: this has been modified from previous version only in very
+ * simplistic ways. Needs to be improved drastically, especially:
+ *   - support for more than the 2 standard segments
+ *   - support for segment relocations (hard to do in ANSI C)
+ */
+
+#include "compiler.h"
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+
+#include "rdfload.h"
+#include "symtab.h"
+#include "collectn.h"
+
+extern int rdf_errno;
+
+rdfmodule *rdfload(const char *filename)
+{
+    rdfmodule *f;
+    int32_t bsslength = 0;
+    char *hdr;
+    rdfheaderrec *r;
+
+    f = malloc(sizeof(rdfmodule));
+    if (f == NULL) {
+        rdf_errno = RDF_ERR_NOMEM;
+        return NULL;
+    }
+
+    f->symtab = symtabNew();
+    if (!f->symtab) {
+        free(f);
+        rdf_errno = RDF_ERR_NOMEM;
+        return NULL;
+    }
+
+    /* open the file */
+    if (rdfopen(&(f->f), filename)) {
+        free(f);
+        return NULL;
+    }
+
+    /* read in text and data segments, and header */
+
+    f->t = malloc(f->f.seg[0].length);
+    f->d = malloc(f->f.seg[1].length);  /* BSS seg allocated later */
+    hdr = malloc(f->f.header_len);
+
+    if (!f->t || !f->d || !hdr) {
+        rdf_errno = RDF_ERR_NOMEM;
+        rdfclose(&f->f);
+        if (f->t)
+            free(f->t);
+        if (f->d)
+            free(f->d);
+        free(f);
+        return NULL;
+    }
+
+    if (rdfloadseg(&f->f, RDOFF_HEADER, hdr) ||
+        rdfloadseg(&f->f, RDOFF_CODE, f->t) ||
+        rdfloadseg(&f->f, RDOFF_DATA, f->d)) {
+        rdfclose(&f->f);
+        free(f->t);
+        free(f->d);
+        free(f);
+        free(hdr);
+        return NULL;
+    }
+
+    rdfclose(&f->f);
+
+    /* Allocate BSS segment; step through header and count BSS records */
+
+    while ((r = rdfgetheaderrec(&f->f))) {
+        if (r->type == 5)
+            bsslength += r->b.amount;
+    }
+
+    f->b = malloc(bsslength);
+    if (bsslength && (!f->b)) {
+        free(f->t);
+        free(f->d);
+        free(f);
+        free(hdr);
+        rdf_errno = RDF_ERR_NOMEM;
+        return NULL;
+    }
+
+    rdfheaderrewind(&f->f);
+
+    f->textrel = (int32_t)(size_t)f->t;
+    f->datarel = (int32_t)(size_t)f->d;
+    f->bssrel  = (int32_t)(size_t)f->b;
+
+    return f;
+}
+
+int rdf_relocate(rdfmodule * m)
+{
+    rdfheaderrec *r;
+    Collection imports;
+    symtabEnt e;
+    int32_t rel;
+    uint8_t *seg;
+
+    rdfheaderrewind(&m->f);
+    collection_init(&imports);
+
+    while ((r = rdfgetheaderrec(&m->f))) {
+        switch (r->type) {
+        case 1:                /* Relocation record */
+
+            /* calculate relocation factor */
+
+            if (r->r.refseg == 0)
+                rel = m->textrel;
+            else if (r->r.refseg == 1)
+                rel = m->datarel;
+            else if (r->r.refseg == 2)
+                rel = m->bssrel;
+            else
+                /* We currently do not support load-time linkage.
+                   This should be added some time soon... */
+
+                return 1;       /* return error code */
+
+            if ((r->r.segment & 63) == 0)
+                seg = m->t;
+            else if ((r->r.segment & 63) == 1)
+                seg = m->d;
+            else
+                continue;       /* relocation not in a loaded segment */
+
+            /* it doesn't matter in this case that the code is non-portable,
+               as the entire concept of executing a module like this is
+               non-portable */
+            switch (r->r.length) {
+            case 1:
+                seg[r->r.offset] += (char)rel;
+                break;
+            case 2:
+                *(uint16_t *) (seg + r->r.offset) += (uint16_t) rel;
+                break;
+            case 4:
+                *(int32_t *)(seg + r->r.offset) += rel;
+                break;
+            }
+            break;
+
+        case 3:                /* export record - add to symtab */
+            e.segment = r->e.segment;
+            e.offset = r->e.offset + (e.segment == 0 ? m->textrel :     /* 0 -> code */
+                                      e.segment == 1 ? m->datarel :     /* 1 -> data */
+                                      m->bssrel);       /* 2 -> bss  */
+            e.flags = 0;
+            e.name = malloc(strlen(r->e.label) + 1);
+            if (!e.name)
+                return 1;
+
+            strcpy(e.name, r->e.label);
+            symtabInsert(m->symtab, &e);
+            break;
+
+        case 6:                /* segment relocation */
+            fprintf(stderr, "%s: segment relocation not supported by this "
+                    "loader\n", m->f.name);
+            return 1;
+        }
+    }
+    return 0;
+}
diff --git a/rdoff/rdfload.h b/rdoff/rdfload.h
new file mode 100644 (file)
index 0000000..87d7ecc
--- /dev/null
@@ -0,0 +1,31 @@
+/* rdfload.h   RDOFF Object File loader library header file
+ *
+ * The Netwide Assembler is copyright (C) 1996 Simon Tatham and
+ * Julian Hall. All rights reserved. The software is
+ * redistributable under the license given in the file "LICENSE"
+ * distributed in the NASM archive.
+ *
+ * See the file 'rdfload.c' for special license information for this
+ * file.
+ */
+
+#ifndef RDOFF_RDFLOAD_H
+#define RDOFF_RDFLOAD_H 1
+
+#define RDOFF_UTILS
+
+#include "rdoff.h"
+
+typedef struct RDFModuleStruct {
+    rdffile f;                  /* file structure */
+    uint8_t *t, *d, *b;   /* text, data, and bss segments */
+    uint32_t textrel;
+    uint32_t datarel;
+    uint32_t bssrel;
+    void *symtab;
+} rdfmodule;
+
+rdfmodule *rdfload(const char *filename);
+int rdf_relocate(rdfmodule * m);
+
+#endif
diff --git a/rdoff/rdlar.c b/rdoff/rdlar.c
new file mode 100644 (file)
index 0000000..98b0f8f
--- /dev/null
@@ -0,0 +1,490 @@
+/* ----------------------------------------------------------------------- *
+ *   
+ *   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.
+ *
+ * ----------------------------------------------------------------------- */
+
+/*
+ * rdlar.c - new librarian/archiver for RDOFF2.
+ */
+
+#include "compiler.h"
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <ctype.h>
+#include <stdarg.h>
+#include <string.h>
+#include <errno.h>
+#include <time.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+
+#include "rdlar.h"
+
+#define PROGRAM_VERSION "0.1"
+
+/** Constants **/
+const char commands[] = "adnrtx";
+const char modifiers[] = "cflouvV";
+
+/** Global variables **/
+char *progname = "rdlar";
+char **_argv = NULL;
+struct {
+    bool createok;
+    bool usefname;
+    bool align;
+    bool odate;
+    bool fresh;
+    int verbose;
+} options = {
+0, 0, 0, 0, 0, 0};
+
+#define _ENDIANNESS 0           /* 0 for little, 1 for big */
+
+/*
+ * Convert int32_t to little endian (if we were compiled on big-endian machine)
+ */
+static void int32_ttolocal(int32_t *l)
+{
+#if _ENDIANNESS
+    uint8_t t;
+    uint8_t *p = (uint8_t *)l;
+
+    t = p[0];
+    p[0] = p[3];
+    p[3] = t;
+    t = p[1];
+    p[1] = p[2];
+    p[2] = p[1];
+#endif
+}
+
+/*
+ * Print version information
+ */
+void show_version(void)
+{
+    puts("New RDOFF2 librarian/archiver, version " PROGRAM_VERSION);
+}
+
+/*
+ * Print usage instructions
+ */
+void usage(void)
+{
+    printf("Usage:  %s [-]{%s}[%s] libfile [module-name] [files]\n",
+           progname, commands, modifiers);
+    puts(" commands:\n"
+         "  a            - add module(s) to the library\n"
+         "  d            - delete module(s) from the library\n"
+         "  n            - create the library\n"
+         "  r            - replace module(s)\n"
+         "  t            - display contents of library\n"
+         "  x            - extract module(s)\n"
+         " command specific modifiers:\n"
+         "  o            - preserve original dates\n"
+         "  u            - only replace modules that are newer than library contents\n"
+         " generic modifiers:\n"
+         "  c            - do not warn if the library had to be created\n"
+         "  f            - use file name as a module name\n"
+         "  v            - be verbose\n"
+         "  V            - display version information");
+}
+
+/*
+ * Print an error message and exit
+ */
+void error_exit(int errcode, bool useperror, const char *fmt, ...)
+{
+    va_list ap;
+
+    fprintf(stderr, "%s: ", progname);
+    va_start(ap, fmt);
+    vfprintf(stderr, fmt, ap);
+    va_end(ap);
+    putc('\n', stderr);
+    if (useperror)
+        perror(progname);
+    exit(errcode);
+}
+
+/*
+ * Fill in and write a header
+ */
+void put_header(struct rdlm_hdr *hdr, FILE * libfp, char *modname)
+{
+    int n = 0;
+
+    hdr->hdrsize = sizeof(*hdr);
+    if (modname)
+        hdr->hdrsize += (n = strlen(modname) + 1);
+    if (libfp == NULL)
+        return;
+    if (fwrite(hdr, 1, sizeof(*hdr), libfp) != sizeof(*hdr) ||
+        (modname && (fwrite(modname, 1, n, libfp) != n)))
+        error_exit(3, true, "could not write header");
+}
+
+/*
+ * Copy n bytes from one file to another and return last character read.
+ */
+char copybytes(FILE * fp, FILE * fp2, int n)
+{
+    int i, t = 0;
+
+    for (i = 0; i < n; i++) {
+        t = fgetc(fp);
+        if (t == EOF)
+            error_exit(1, false, "premature end of file in '%s'",
+                       _argv[2]);
+        if (fp2)
+            if (fputc(t, fp2) == EOF)
+                error_exit(1, false, "write error");
+    }
+    return (char)t;
+}
+
+/*
+ * Copy uint32_t from one file to another.
+ * Return local presentation of int32_t.
+ */
+int32_t copyint32_t(FILE * fp, FILE * fp2)
+{
+    int32_t l;
+    int i, t;
+    uint8_t *p = (uint8_t *)&l;
+
+    for (i = 0; i < 4; i++) {
+        t = fgetc(fp);
+        if (t == EOF)
+            error_exit(1, false, "premature end of file in '%s'",
+                       _argv[2]);
+        if (fp2)
+            if (fputc(t, fp2) == EOF)
+                error_exit(1, false, "write error");
+        *p++ = t;
+    }
+    int32_ttolocal(&l);
+    return l;
+}
+
+/*
+ * Create a new library
+ */
+int create_library(char *libname)
+{
+    FILE *libfp;
+    struct rdlm_hdr hdr;
+
+    hdr.magic = RDLAMAG;
+    hdr.hdrsize = 0;
+    hdr.date = time(NULL);
+    hdr.owner = getuid();
+    hdr.group = getgid();
+    hdr.mode = umask(022);
+    hdr.size = 0;
+
+    libfp = fopen(libname, "wb");
+    if (!libfp)
+        error_exit(1, true, "could not open '%s'\n", libname);
+
+    /* Write library header */
+    put_header(&hdr, libfp, NULL);
+
+    fclose(libfp);
+    return true;
+}
+
+/*
+ * Add a module to the library
+ */
+int add_module(FILE * libfp, const char *fname, char *modname)
+{
+    FILE *modfp;
+    struct rdlm_hdr hdr = { RDLMMAG, 0, 0, 0, 0, 0, 0 };
+    struct stat finfo;
+    int i;
+
+    if (options.verbose)
+        fprintf(stderr, "adding module %s\n", modname);
+
+    /* Initialize some fields in the module header */
+    if (stat(fname, &finfo) < 0)
+        error_exit(1, true, "could not stat '%s'", fname);
+    hdr.date = finfo.st_mtime;
+    hdr.owner = finfo.st_uid;
+    hdr.group = finfo.st_gid;
+    hdr.size = finfo.st_size;
+
+    modfp = fopen(fname, "rb");
+    if (!modfp)
+        error_exit(1, true, "could not open '%s'", fname);
+
+    /* Write module header */
+    put_header(&hdr, libfp, modname);
+
+    /* Put the module itself */
+    while (!feof(modfp)) {
+        i = fgetc(modfp);
+        if (i == EOF)
+            break;
+        if (fputc(i, libfp) == EOF)
+            error_exit(1, false, "write error");
+    }
+
+    fclose(modfp);
+    return true;
+}
+
+/*
+ * Main
+ */
+int main(int argc, char **argv)
+{
+    FILE *libfp, *tmpfp, *modfp = NULL;
+    struct stat finfo;
+    struct rdlm_hdr hdr;
+    char buf[MAXMODNAMELEN], *p = NULL;
+    char c;
+    int i;
+
+    progname = argv[0];
+    _argv = argv;
+
+    if (argc < 2) {
+        usage();
+        exit(1);
+    }
+
+    /* Check whether some modifiers were specified */
+    for (i = 1; i < strlen(argv[1]); i++) {
+        switch (c = argv[1][i]) {
+        case 'c':
+            options.createok = true;
+            break;
+        case 'f':
+            options.usefname = true;
+            break;
+        case 'l':
+            options.align = true;
+            break;
+        case 'o':
+            options.odate = true;
+            break;
+        case 'u':
+            options.fresh = true;
+            break;
+        case 'v':
+            options.verbose++;
+            break;
+        case 'V':
+            show_version();
+            exit(0);
+        default:
+            if (strchr(commands, c) == NULL)
+                error_exit(2, false, "invalid command or modifier '%c'",
+                           c);
+        }
+    }
+
+    if (argc < 3)
+        error_exit(2, false, "missing library name");
+
+    /* Process the command */
+    if (argv[1][0] == '-')
+        argv[1]++;
+    switch (c = argv[1][0]) {
+    case 'a':                  /* add a module */
+        if (argc < 4 || (!options.usefname && argc != 5))
+            error_exit(2, false, "invalid number of arguments");
+
+        /* Check if a library already exists. If not - create it */
+        if (access(argv[2], F_OK) < 0) {
+            if (!options.createok)
+                fprintf(stderr, "creating library %s\n", argv[2]);
+            create_library(argv[2]);
+        }
+
+        libfp = fopen(argv[2], "ab");
+        if (!libfp)
+            error_exit(1, true, "could not open '%s'", argv[2]);
+
+        if (!options.usefname)
+            add_module(libfp, argv[4], argv[3]);
+        else
+            for (i = 3; i < argc; i++)
+                add_module(libfp, argv[i], argv[i]);
+
+        fclose(libfp);
+        break;
+
+    case 'n':                  /* create library */
+        create_library(argv[2]);
+        break;
+
+    case 'x':                  /* extract module(s) */
+        if (!options.usefname)
+            argc--;
+        if (argc < 4)
+            error_exit(2, false, "required parameter missing");
+        p = options.usefname ? argv[3] : argv[4];
+    case 't':                  /* list library contents */
+        libfp = fopen(argv[2], "rb");
+        if (!libfp)
+            error_exit(1, true, "could not open '%s'\n", argv[2]);
+
+        /* Read library header */
+        if (fread(&hdr, 1, sizeof(hdr), libfp) != sizeof(hdr) ||
+            hdr.magic != RDLAMAG)
+            error_exit(1, false, "invalid library format");
+
+        /* Walk through the library looking for requested module */
+        while (!feof(libfp)) {
+            /* Read module header */
+            i = fread(&hdr, 1, sizeof(hdr), libfp);
+            if (feof(libfp))
+                break;
+            if (i != sizeof(hdr) || hdr.magic != RDLMMAG)
+                error_exit(1, false, "invalid module header");
+            /* Read module name */
+            i = hdr.hdrsize - sizeof(hdr);
+            if (i > sizeof(buf) || fread(buf, 1, i, libfp) != i)
+                error_exit(1, false, "invalid module name");
+            if (c == 'x') {
+                /* Check against desired name */
+                if (!strcmp(buf, argv[3])) {
+                    if (options.verbose)
+                        fprintf(stderr,
+                                "extracting module %s to file %s\n", buf,
+                                p);
+                    modfp = fopen(p, "wb");
+                    if (!modfp)
+                        error_exit(1, true, "could not open '%s'", p);
+                }
+            } else {
+                printf("%-40s ", buf);
+                if (options.verbose) {
+                    printf("%ld bytes", hdr.size);
+                }
+                putchar('\n');
+            }
+
+            copybytes(libfp, modfp, hdr.size);
+            if (modfp)
+                break;
+        }
+
+        fclose(libfp);
+        if (modfp)
+            fclose(modfp);
+        else if (c == 'x')
+            error_exit(1, false, "module '%s' not found in '%s'",
+                       argv[3], argv[2]);
+        break;
+
+    case 'r':                  /* replace module(s) */
+        argc--;
+        if (stat(argv[4], &finfo) < 0)
+            error_exit(1, true, "could not stat '%s'", argv[4]);
+    case 'd':                  /* delete module(s) */
+        if (argc < 4)
+            error_exit(2, false, "required parameter missing");
+
+        libfp = fopen(argv[2], "rb");
+        if (!libfp)
+            error_exit(1, true, "could not open '%s'", argv[2]);
+
+        /* Copy the library into a temporary file */
+        tmpfp = tmpfile();
+        if (!tmpfp)
+            error_exit(1, true, "could not open temporary file");
+
+        stat(argv[2], &finfo);
+        copybytes(libfp, tmpfp, finfo.st_size);
+        rewind(tmpfp);
+        freopen(argv[2], "wb", libfp);
+
+        /* Read library header and write it to a new file */
+        if (fread(&hdr, 1, sizeof(hdr), tmpfp) != sizeof(hdr) ||
+            hdr.magic != RDLAMAG)
+            error_exit(1, false, "invalid library format");
+        put_header(&hdr, libfp, NULL);
+
+        /* Walk through the library looking for requested module */
+        while (!feof(tmpfp)) {
+            /* Read module header */
+            if (fread(&hdr, 1, sizeof(hdr), tmpfp) != sizeof(hdr) ||
+                hdr.magic != RDLMMAG)
+                error_exit(1, false, "invalid module header");
+            /* Read module name */
+            i = hdr.hdrsize - sizeof(hdr);
+            if (i > sizeof(buf) || fread(buf, 1, i, tmpfp) != i)
+                error_exit(1, false, "invalid module name");
+            /* Check against desired name */
+            if (!strcmp(buf, argv[3]) &&
+                (c == 'd' || !options.odate
+                 || finfo.st_mtime <= hdr.date)) {
+                if (options.verbose)
+                    fprintf(stderr, "deleting module %s\n", buf);
+                fseek(tmpfp, hdr.size, SEEK_CUR);
+                break;
+            } else {
+                put_header(&hdr, libfp, buf);
+                copybytes(tmpfp, libfp, hdr.size);
+            }
+        }
+
+        if (c == 'r') {
+            /* Copy new module into library */
+            p = options.usefname ? argv[4] : argv[3];
+            add_module(libfp, argv[4], p);
+        }
+
+        /* Copy rest of library if any */
+        while (!feof(tmpfp)) {
+            if ((i = fgetc(tmpfp)) == EOF)
+                break;
+
+            if (fputc(i, libfp) == EOF)
+                error_exit(1, false, "write error");
+        }
+
+        fclose(libfp);
+        fclose(tmpfp);
+        break;
+
+    default:
+        error_exit(2, false, "invalid command '%c'\n", c);
+    }
+
+    return 0;
+}
diff --git a/rdoff/rdlar.h b/rdoff/rdlar.h
new file mode 100644 (file)
index 0000000..ee00f2e
--- /dev/null
@@ -0,0 +1,38 @@
+/*
+ * rdlar.h - definitions of new RDOFF library/archive format.
+ */
+
+#ifndef RDOFF_RDLAR_H
+#define RDOFF_RDLAR_H 1
+
+#include <inttypes.h>
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+/* For non-POSIX operating systems */
+#ifndef HAVE_GETUID
+# define getuid() 0
+#endif
+#ifndef HAVE_GETGID
+# define getgid() 0
+#endif
+
+#define RDLAMAG                0x414C4452      /* Archive magic */
+#define RDLMMAG                0x4D4C4452      /* Member magic */
+
+#define MAXMODNAMELEN  256     /* Maximum length of module name */
+
+struct rdlm_hdr {
+    uint32_t magic;        /* Must be RDLAMAG */
+    uint32_t hdrsize;      /* Header size + sizeof(module_name) */
+    uint32_t date;         /* Creation date */
+    uint32_t owner;        /* UID */
+    uint32_t group;        /* GID */
+    uint32_t mode;         /* File mode */
+    uint32_t size;         /* File size */
+    /* NULL-terminated module name immediately follows */
+};
+
+#endif
diff --git a/rdoff/rdlib.c b/rdoff/rdlib.c
new file mode 100644 (file)
index 0000000..31dbdb4
--- /dev/null
@@ -0,0 +1,296 @@
+/* ----------------------------------------------------------------------- *
+ *   
+ *   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.
+ *
+ * ----------------------------------------------------------------------- */
+
+/*
+ * rdlib.c - routines for manipulating RDOFF libraries (.rdl)
+ */
+
+#include "compiler.h"
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+
+#define RDOFF_UTILS
+
+#include "rdoff.h"
+#include "rdlib.h"
+#include "rdlar.h"
+
+/* See Texinfo documentation about new RDOFF libraries format */
+
+int rdl_error = 0;
+
+char *rdl_errors[5] = {
+    "no error", "could not open file", "invalid file structure",
+    "file contains modules of an unsupported RDOFF version",
+    "module not found"
+};
+
+int rdl_verify(const char *filename)
+{
+    FILE *fp = fopen(filename, "rb");
+    char buf[257];
+    int i;
+    int32_t length;
+    static char lastverified[256];
+    static int lastresult = -1;
+
+    if (lastresult != -1 && !strcmp(filename, lastverified))
+        return lastresult;
+
+    strcpy(lastverified, filename);
+
+    if (!fp)
+        return (rdl_error = lastresult = 1);
+
+    while (!feof(fp)) {
+        i = 0;
+
+        while (fread(buf + i, 1, 1, fp) == 1 && buf[i] && i < 257)
+            i++;
+        if (feof(fp))
+            break;
+
+        if (buf[0] == '.') {
+            /*
+             * A special module, eg a signature block or a directory.
+             * Format of such a module is defined to be:
+             *   six char type identifier
+             *   int32_t count bytes content
+             *   content
+             * so we can handle it uniformaly with RDOFF2 modules.
+             */
+            fread(buf, 6, 1, fp);
+            buf[6] = 0;
+            /* Currently, nothing useful to do with signature block.. */
+        } else {
+            fread(buf, 6, 1, fp);
+            buf[6] = 0;
+            if (strncmp(buf, "RDOFF", 5)) {
+                return rdl_error = lastresult = 2;
+            } else if (buf[5] != '2') {
+                return rdl_error = lastresult = 3;
+            }
+        }
+        fread(&length, 4, 1, fp);
+        fseek(fp, length, SEEK_CUR);    /* skip over the module */
+    }
+    fclose(fp);
+    return lastresult = 0;      /* library in correct format */
+}
+
+int rdl_open(struct librarynode *lib, const char *name)
+{
+    int i = rdl_verify(name);
+    if (i)
+        return i;
+
+    lib->fp = NULL;
+    lib->name = strdup(name);
+    lib->referenced = 0;
+    lib->next = NULL;
+    return 0;
+}
+
+void rdl_close(struct librarynode *lib)
+{
+    if (lib->fp)
+        fclose(lib->fp);
+    free(lib->name);
+}
+
+int rdl_searchlib(struct librarynode *lib, const char *label, rdffile * f)
+{
+    char buf[512];
+    int i, t;
+    void *hdr;
+    rdfheaderrec *r;
+    int32_t l;
+
+    rdl_error = 0;
+    lib->referenced++;
+
+    if (!lib->fp) {
+        lib->fp = fopen(lib->name, "rb");
+
+        if (!lib->fp) {
+            rdl_error = 1;
+            return 0;
+        }
+    } else
+        rewind(lib->fp);
+
+    while (!feof(lib->fp)) {
+        /*
+         * read the module name from the file, and prepend
+         * the library name and '.' to it.
+         */
+        strcpy(buf, lib->name);
+
+        i = strlen(lib->name);
+        buf[i++] = '.';
+        t = i;
+        while (fread(buf + i, 1, 1, lib->fp) == 1 && buf[i] && i < 512)
+            i++;
+
+        buf[i] = 0;
+
+        if (feof(lib->fp))
+            break;
+        if (!strcmp(buf + t, ".dir")) { /* skip over directory */
+            fread(&l, 4, 1, lib->fp);
+            fseek(lib->fp, l, SEEK_CUR);
+            continue;
+        }
+        /*
+         * open the RDOFF module
+         */
+        if (rdfopenhere(f, lib->fp, &lib->referenced, buf)) {
+            rdl_error = 16 * rdf_errno;
+            return 0;
+        }
+        /*
+         * read in the header, and scan for exported symbols
+         */
+        hdr = malloc(f->header_len);
+        rdfloadseg(f, RDOFF_HEADER, hdr);
+
+        while ((r = rdfgetheaderrec(f))) {
+            if (r->type != 3)   /* not an export */
+                continue;
+
+            if (!strcmp(r->e.label, label)) {   /* match! */
+                free(hdr);      /* reset to 'just open' */
+                f->header_loc = NULL;   /* state... */
+                f->header_fp = 0;
+                return 1;
+            }
+        }
+
+        /* find start of next module... */
+        i = f->eof_offset;
+        rdfclose(f);
+        fseek(lib->fp, i, SEEK_SET);
+    }
+
+    /*
+     * close the file if nobody else is using it
+     */
+    lib->referenced--;
+    if (!lib->referenced) {
+        fclose(lib->fp);
+        lib->fp = NULL;
+    }
+    return 0;
+}
+
+int rdl_openmodule(struct librarynode *lib, int moduleno, rdffile * f)
+{
+    char buf[512];
+    int i, cmod, t;
+    int32_t length;
+
+    lib->referenced++;
+
+    if (!lib->fp) {
+        lib->fp = fopen(lib->name, "rb");
+        if (!lib->fp) {
+            lib->referenced--;
+            return (rdl_error = 1);
+        }
+    } else
+        rewind(lib->fp);
+
+    cmod = -1;
+    while (!feof(lib->fp)) {
+        strcpy(buf, lib->name);
+        i = strlen(buf);
+        buf[i++] = '.';
+        t = i;
+        while (fread(buf + i, 1, 1, lib->fp) == 1 && buf[i] && i < 512)
+            i++;
+        buf[i] = 0;
+        if (feof(lib->fp))
+            break;
+
+        if (buf[t] != '.')      /* special module - not counted in the numbering */
+            cmod++;             /* of RDOFF modules - must be referred to by name */
+
+        if (cmod == moduleno) {
+            rdl_error = 16 *
+                rdfopenhere(f, lib->fp, &lib->referenced, buf);
+            lib->referenced--;
+            if (!lib->referenced) {
+                fclose(lib->fp);
+                lib->fp = NULL;
+            }
+            return rdl_error;
+        }
+
+        fread(buf, 6, 1, lib->fp);
+        buf[6] = 0;
+        if (buf[t] == '.') {
+            /* do nothing */
+        } else if (strncmp(buf, "RDOFF", 5)) {
+            if (!--lib->referenced) {
+                fclose(lib->fp);
+                lib->fp = NULL;
+            }
+            return rdl_error = 2;
+        } else if (buf[5] != '2') {
+            if (!--lib->referenced) {
+                fclose(lib->fp);
+                lib->fp = NULL;
+            }
+            return rdl_error = 3;
+        }
+
+        fread(&length, 4, 1, lib->fp);
+        fseek(lib->fp, length, SEEK_CUR);       /* skip over the module */
+    }
+    if (!--lib->referenced) {
+        fclose(lib->fp);
+        lib->fp = NULL;
+    }
+    return rdl_error = 4;       /* module not found */
+}
+
+void rdl_perror(const char *apname, const char *filename)
+{
+    if (rdl_error >= 16)
+        rdfperror(apname, filename);
+    else
+        fprintf(stderr, "%s:%s:%s\n", apname, filename,
+                rdl_errors[rdl_error]);
+}
diff --git a/rdoff/rdlib.h b/rdoff/rdlib.h
new file mode 100644 (file)
index 0000000..e1b3c5a
--- /dev/null
@@ -0,0 +1,62 @@
+/* ----------------------------------------------------------------------- *
+ *   
+ *   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.
+ *
+ * ----------------------------------------------------------------------- */
+
+/*
+ * rdlib.h     Functions for manipulating libraries of RDOFF object files.
+ */
+
+#ifndef RDOFF_RDLIB_H
+#define RDOFF_RDLIB_H 1
+
+struct librarynode {
+    char *name;
+    FILE *fp;                   /* initialised to NULL - always check */
+    int referenced;             /* & open if required. Close afterwards */
+    struct librarynode *next;   /* if ! referenced. */
+};
+
+extern int rdl_error;
+
+#define RDL_EOPEN     1
+#define RDL_EINVALID  2
+#define RDL_EVERSION  3
+#define RDL_ENOTFOUND 4
+
+int rdl_verify(const char *filename);
+int rdl_open(struct librarynode *lib, const char *filename);
+int rdl_searchlib(struct librarynode *lib, const char *label, rdffile * f);
+int rdl_openmodule(struct librarynode *lib, int module, rdffile * f);
+
+void rdl_perror(const char *apname, const char *filename);
+
+#endif
diff --git a/rdoff/rdoff.c b/rdoff/rdoff.c
new file mode 100644 (file)
index 0000000..3c7b336
--- /dev/null
@@ -0,0 +1,611 @@
+/* ----------------------------------------------------------------------- *
+ *   
+ *   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.
+ *
+ * ----------------------------------------------------------------------- */
+
+/*
+ * rdoff.c     library of routines for manipulating rdoff files
+ */
+
+/* TODO:       The functions in this module assume they are running
+ *             on a little-endian machine. This should be fixed to
+ *             make it portable.
+ */
+
+#include "compiler.h"
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <errno.h>
+#include <inttypes.h>
+
+#define RDOFF_UTILS
+
+#include "rdoff.h"
+
+#define newstr(str) strcpy(malloc(strlen(str) + 1),str)
+#define newstrcat(s1,s2) strcat(strcpy(malloc(strlen(s1) + strlen(s2) + 1), \
+                                       s1),s2)
+
+/*
+ * Comment this out to allow the module to read & write header record types
+ * that it isn't aware of. With this defined, unrecognised header records
+ * will generate error number 8, reported as 'unknown extended header record'.
+ */
+
+#define STRICT_ERRORS
+
+/* ========================================================================
+ * Code for memory buffers (for delayed writing of header until we know
+ * how int32_t it is).
+ * ======================================================================== */
+
+memorybuffer *newmembuf()
+{
+    memorybuffer *t;
+
+    t = malloc(sizeof(memorybuffer));
+    if (!t)
+        return NULL;
+
+    t->length = 0;
+    t->next = NULL;
+    return t;
+}
+
+void membufwrite(memorybuffer * const b, void *data, int bytes)
+{
+    uint16_t w;
+    int32_t l;
+    char *c;
+
+    if (b->next) {              /* memory buffer full - use next buffer */
+        membufwrite(b->next, data, bytes);
+        return;
+    }
+
+    if ((bytes < 0 && b->length - bytes > BUF_BLOCK_LEN)
+        || (bytes > 0 && b->length + bytes > BUF_BLOCK_LEN)) {
+
+        /* buffer full and no next allocated... allocate and initialise next
+         * buffer */
+        b->next = newmembuf();
+        membufwrite(b->next, data, bytes);
+        return;
+    }
+
+    switch (bytes) {
+    case -4:                   /* convert to little-endian */
+        l = *(int32_t *)data;
+        b->buffer[b->length++] = l & 0xFF;
+        l >>= 8;
+        b->buffer[b->length++] = l & 0xFF;
+        l >>= 8;
+        b->buffer[b->length++] = l & 0xFF;
+        l >>= 8;
+        b->buffer[b->length++] = l & 0xFF;
+        break;
+
+    case -2:
+        w = *(uint16_t *) data;
+        b->buffer[b->length++] = w & 0xFF;
+        w >>= 8;
+        b->buffer[b->length++] = w & 0xFF;
+        break;
+
+    default:
+        c = data;
+        while (bytes--)
+            b->buffer[b->length++] = *c++;
+        break;
+    }
+}
+
+void membufdump(memorybuffer * b, FILE * fp)
+{
+    if (!b)
+        return;
+
+    fwrite(b->buffer, 1, b->length, fp);
+
+    membufdump(b->next, fp);
+}
+
+int membuflength(memorybuffer * b)
+{
+    if (!b)
+        return 0;
+    return b->length + membuflength(b->next);
+}
+
+void freemembuf(memorybuffer * b)
+{
+    if (!b)
+        return;
+    freemembuf(b->next);
+    free(b);
+}
+
+/* =========================================================================
+   General purpose routines and variables used by the library functions
+   ========================================================================= */
+
+/*
+ * translateint32_t() and translateint16_t()
+ *
+ * translate from little endian to local representation
+ */
+int32_t translateint32_t(int32_t in)
+{
+    int32_t r;
+    uint8_t *i;
+
+    i = (uint8_t *)&in;
+    r = i[3];
+    r = (r << 8) + i[2];
+    r = (r << 8) + i[1];
+    r = (r << 8) + *i;
+
+    return r;
+}
+
+uint16_t translateint16_t(uint16_t in)
+{
+    uint16_t r;
+    uint8_t *i;
+
+    i = (uint8_t *)&in;
+    r = (i[1] << 8) + i[0];
+
+    return r;
+}
+
+/* Segment types */
+static char *knownsegtypes[8] = {
+    "NULL", "text", "data", "object comment",
+    "linked comment", "loader comment",
+    "symbolic debug", "line number debug"
+};
+
+/* Get a textual string describing the segment type */
+char *translatesegmenttype(uint16_t type)
+{
+    if (type < 8)
+        return knownsegtypes[type];
+    if (type < 0x0020)
+        return "reserved";
+    if (type < 0x1000)
+        return "reserved - Moscow";
+    if (type < 0x8000)
+        return "reserved - system dependant";
+    if (type < 0xFFFF)
+        return "reserved - other";
+    if (type == 0xFFFF)
+        return "invalid type code";
+    return "type code out of range";
+}
+
+/* This signature is written to the start of RDOFF files */
+const char *RDOFFId = RDOFF2_SIGNATURE;
+
+/* Error messages. Must correspond to the codes defined in rdoff.h */
+const char *rdf_errors[11] = {
+    /* 0 */ "no error occurred",
+    /* 1 */ "could not open file",
+    /* 2 */ "invalid file format",
+    /* 3 */ "error reading file",
+    /* 4 */ "unknown error",
+    /* 5 */ "header not read",
+    /* 6 */ "out of memory",
+    /* 7 */ "RDOFF v1 not supported",
+    /* 8 */ "unknown extended header record",
+    /* 9 */ "header record of known type but unknown length",
+    /* 10 */ "no such segment"
+};
+
+int rdf_errno = 0;
+
+/* ========================================================================
+   The library functions
+   ======================================================================== */
+
+int rdfopen(rdffile * f, const char *name)
+{
+    FILE *fp;
+
+    fp = fopen(name, "rb");
+    if (!fp)
+        return rdf_errno = RDF_ERR_OPEN;
+
+    return rdfopenhere(f, fp, NULL, name);
+}
+
+int rdfopenhere(rdffile * f, FILE * fp, int *refcount, const char *name)
+{
+    char buf[8];
+    int32_t initpos;
+    int32_t l;
+    uint16_t s;
+
+    if (translateint32_t(0x01020304) != 0x01020304) {
+        /* fix this to be portable! */
+        fputs("*** this program requires a little endian machine\n",
+              stderr);
+        fprintf(stderr, "01020304h = %08"PRIx32"h\n", translateint32_t(0x01020304));
+        exit(3);
+    }
+
+    f->fp = fp;
+    initpos = ftell(fp);
+
+    fread(buf, 6, 1, f->fp);    /* read header */
+    buf[6] = 0;
+
+    if (strcmp(buf, RDOFFId)) {
+        fclose(f->fp);
+        if (!strcmp(buf, "RDOFF1"))
+            return rdf_errno = RDF_ERR_VER;
+        return rdf_errno = RDF_ERR_FORMAT;
+    }
+
+    if (fread(&l, 1, 4, f->fp) != 4
+        || fread(&f->header_len, 1, 4, f->fp) != 4) {
+        fclose(f->fp);
+        return rdf_errno = RDF_ERR_READ;
+    }
+
+    f->header_ofs = ftell(f->fp);
+    f->eof_offset = f->header_ofs + translateint32_t(l) - 4;
+
+    if (fseek(f->fp, f->header_len, SEEK_CUR)) {
+        fclose(f->fp);
+        return rdf_errno = RDF_ERR_FORMAT;      /* seek past end of file...? */
+    }
+
+    if (fread(&s, 1, 2, f->fp) != 2) {
+        fclose(f->fp);
+        return rdf_errno = RDF_ERR_READ;
+    }
+
+    f->nsegs = 0;
+
+    while (s != 0) {
+        f->seg[f->nsegs].type = s;
+        if (fread(&f->seg[f->nsegs].number, 1, 2, f->fp) != 2 ||
+            fread(&f->seg[f->nsegs].reserved, 1, 2, f->fp) != 2 ||
+            fread(&f->seg[f->nsegs].length, 1, 4, f->fp) != 4) {
+            fclose(f->fp);
+            return rdf_errno = RDF_ERR_READ;
+        }
+
+        f->seg[f->nsegs].offset = ftell(f->fp);
+        if (fseek(f->fp, f->seg[f->nsegs].length, SEEK_CUR)) {
+            fclose(f->fp);
+            return rdf_errno = RDF_ERR_FORMAT;
+        }
+        f->nsegs++;
+
+        if (fread(&s, 1, 2, f->fp) != 2) {
+            fclose(f->fp);
+            return rdf_errno = RDF_ERR_READ;
+        }
+    }
+
+    if (f->eof_offset != ftell(f->fp) + 8) {    /* +8 = skip null segment header */
+        fprintf(stderr, "warning: eof_offset [%"PRId32"] and actual eof offset "
+                "[%ld] don't match\n", f->eof_offset, ftell(f->fp) + 8);
+    }
+    fseek(f->fp, initpos, SEEK_SET);
+    f->header_loc = NULL;
+
+    f->name = newstr(name);
+    f->refcount = refcount;
+    if (refcount)
+        (*refcount)++;
+    return RDF_OK;
+}
+
+int rdfclose(rdffile * f)
+{
+    if (!f->refcount || !--(*f->refcount)) {
+        fclose(f->fp);
+        f->fp = NULL;
+    }
+    free(f->name);
+
+    return 0;
+}
+
+/*
+ * Print the message for last error (from rdf_errno)
+ */
+void rdfperror(const char *app, const char *name)
+{
+    fprintf(stderr, "%s:%s: %s\n", app, name, rdf_errors[rdf_errno]);
+    if (rdf_errno == RDF_ERR_OPEN || rdf_errno == RDF_ERR_READ) {
+        perror(app);
+    }
+}
+
+/*
+ * Find the segment by its number.
+ * Returns segment array index, or -1 if segment with such number was not found.
+ */
+int rdffindsegment(rdffile * f, int segno)
+{
+    int i;
+    for (i = 0; i < f->nsegs; i++)
+        if (f->seg[i].number == segno)
+            return i;
+    return -1;
+}
+
+/*
+ * Load the segment. Returns status.
+ */
+int rdfloadseg(rdffile * f, int segment, void *buffer)
+{
+    int32_t fpos;
+    size_t slen;
+
+    switch (segment) {
+    case RDOFF_HEADER:
+        fpos = f->header_ofs;
+        slen = f->header_len;
+        f->header_loc = (uint8_t *) buffer;
+        f->header_fp = 0;
+        break;
+    default:
+        if (segment < f->nsegs) {
+            fpos = f->seg[segment].offset;
+            slen = f->seg[segment].length;
+            f->seg[segment].data = (uint8_t *) buffer;
+        } else {
+            return rdf_errno = RDF_ERR_SEGMENT;
+        }
+    }
+
+    if (fseek(f->fp, fpos, SEEK_SET))
+        return rdf_errno = RDF_ERR_UNKNOWN;
+
+    if (fread(buffer, 1, slen, f->fp) != slen)
+        return rdf_errno = RDF_ERR_READ;
+
+    return RDF_OK;
+}
+
+/* Macros for reading integers from header in memory */
+
+#define RI8(v) v = f->header_loc[f->header_fp++]
+#define RI16(v) { v = (f->header_loc[f->header_fp] + \
+                      (f->header_loc[f->header_fp+1] << 8)); \
+                 f->header_fp += 2; }
+
+#define RI32(v) { v = (f->header_loc[f->header_fp] + \
+                      (f->header_loc[f->header_fp+1] << 8) + \
+                      (f->header_loc[f->header_fp+2] << 16) + \
+                      (f->header_loc[f->header_fp+3] << 24)); \
+                 f->header_fp += 4; }
+
+#define RS(str,max) { for(i=0;i<max;i++){\
+  RI8(str[i]); if (!str[i]) break;} str[i]=0; }
+
+/*
+ * Read a header record.
+ * Returns the address of record, or NULL in case of error.
+ */
+rdfheaderrec *rdfgetheaderrec(rdffile * f)
+{
+    static rdfheaderrec r;
+    int i;
+
+    if (!f->header_loc) {
+        rdf_errno = RDF_ERR_HEADER;
+        return NULL;
+    }
+
+    if (f->header_fp >= f->header_len)
+        return 0;
+
+    RI8(r.type);
+    RI8(r.g.reclen);
+
+    switch (r.type) {
+    case RDFREC_RELOC:         /* Relocation record */
+    case RDFREC_SEGRELOC:
+        if (r.r.reclen != 8) {
+            rdf_errno = RDF_ERR_RECLEN;
+            return NULL;
+        }
+        RI8(r.r.segment);
+        RI32(r.r.offset);
+        RI8(r.r.length);
+        RI16(r.r.refseg);
+        break;
+
+    case RDFREC_IMPORT:        /* Imported symbol record */
+    case RDFREC_FARIMPORT:
+        RI8(r.i.flags);
+        RI16(r.i.segment);
+        RS(r.i.label, EXIM_LABEL_MAX);
+        break;
+
+    case RDFREC_GLOBAL:        /* Exported symbol record */
+        RI8(r.e.flags);
+        RI8(r.e.segment);
+        RI32(r.e.offset);
+        RS(r.e.label, EXIM_LABEL_MAX);
+        break;
+
+    case RDFREC_DLL:           /* DLL record */
+        RS(r.d.libname, MODLIB_NAME_MAX);
+        break;
+
+    case RDFREC_BSS:           /* BSS reservation record */
+        if (r.r.reclen != 4) {
+            rdf_errno = RDF_ERR_RECLEN;
+            return NULL;
+        }
+        RI32(r.b.amount);
+        break;
+
+    case RDFREC_MODNAME:       /* Module name record */
+        RS(r.m.modname, MODLIB_NAME_MAX);
+        break;
+
+    case RDFREC_COMMON:        /* Common variable */
+        RI16(r.c.segment);
+        RI32(r.c.size);
+        RI16(r.c.align);
+        RS(r.c.label, EXIM_LABEL_MAX);
+        break;
+
+    default:
+#ifdef STRICT_ERRORS
+        rdf_errno = RDF_ERR_RECTYPE;    /* unknown header record */
+        return NULL;
+#else
+        for (i = 0; i < r.g.reclen; i++)
+            RI8(r.g.data[i]);
+#endif
+    }
+    return &r;
+}
+
+/*
+ * Rewind to the beginning of the file
+ */
+void rdfheaderrewind(rdffile * f)
+{
+    f->header_fp = 0;
+}
+
+rdf_headerbuf *rdfnewheader(void)
+{
+    rdf_headerbuf *hb = malloc(sizeof(rdf_headerbuf));
+    if (hb == NULL)
+        return NULL;
+
+    hb->buf = newmembuf();
+    hb->nsegments = 0;
+    hb->seglength = 0;
+
+    return hb;
+}
+
+int rdfaddheader(rdf_headerbuf * h, rdfheaderrec * r)
+{
+#ifndef STRICT_ERRORS
+    int i;
+#endif
+    membufwrite(h->buf, &r->type, 1);
+    membufwrite(h->buf, &r->g.reclen, 1);
+
+    switch (r->type) {
+    case RDFREC_GENERIC:       /* generic */
+        membufwrite(h->buf, &r->g.data, r->g.reclen);
+        break;
+    case RDFREC_RELOC:
+    case RDFREC_SEGRELOC:
+        membufwrite(h->buf, &r->r.segment, 1);
+        membufwrite(h->buf, &r->r.offset, -4);
+        membufwrite(h->buf, &r->r.length, 1);
+        membufwrite(h->buf, &r->r.refseg, -2);  /* 9 bytes written */
+        break;
+
+    case RDFREC_IMPORT:        /* import */
+    case RDFREC_FARIMPORT:
+        membufwrite(h->buf, &r->i.flags, 1);
+        membufwrite(h->buf, &r->i.segment, -2);
+        membufwrite(h->buf, &r->i.label, strlen(r->i.label) + 1);
+        break;
+
+    case RDFREC_GLOBAL:        /* export */
+        membufwrite(h->buf, &r->e.flags, 1);
+        membufwrite(h->buf, &r->e.segment, 1);
+        membufwrite(h->buf, &r->e.offset, -4);
+        membufwrite(h->buf, &r->e.label, strlen(r->e.label) + 1);
+        break;
+
+    case RDFREC_DLL:           /* DLL */
+        membufwrite(h->buf, &r->d.libname, strlen(r->d.libname) + 1);
+        break;
+
+    case RDFREC_BSS:           /* BSS */
+        membufwrite(h->buf, &r->b.amount, -4);
+        break;
+
+    case RDFREC_MODNAME:       /* Module name */
+        membufwrite(h->buf, &r->m.modname, strlen(r->m.modname) + 1);
+        break;
+
+    default:
+#ifdef STRICT_ERRORS
+        return rdf_errno = RDF_ERR_RECTYPE;
+#else
+        for (i = 0; i < r->g.reclen; i++)
+            membufwrite(h->buf, r->g.data[i], 1);
+#endif
+    }
+    return 0;
+}
+
+int rdfaddsegment(rdf_headerbuf * h, int32_t seglength)
+{
+    h->nsegments++;
+    h->seglength += seglength;
+    return 0;
+}
+
+int rdfwriteheader(FILE * fp, rdf_headerbuf * h)
+{
+    int32_t l, l2;
+
+    fwrite(RDOFFId, 1, strlen(RDOFFId), fp);
+
+    l = membuflength(h->buf);
+    l2 = l + 14 + 10 * h->nsegments + h->seglength;
+    l = translateint32_t(l);
+    l2 = translateint32_t(l2);
+    fwrite(&l2, 4, 1, fp);      /* object length */
+    fwrite(&l, 4, 1, fp);       /* header length */
+
+    membufdump(h->buf, fp);
+
+    return 0;                   /* no error handling in here... CHANGE THIS! */
+}
+
+void rdfdoneheader(rdf_headerbuf * h)
+{
+    freemembuf(h->buf);
+    free(h);
+}
diff --git a/rdoff/rdoff.h b/rdoff/rdoff.h
new file mode 100644 (file)
index 0000000..a161733
--- /dev/null
@@ -0,0 +1,293 @@
+/* ----------------------------------------------------------------------- *
+ *   
+ *   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.
+ *
+ * ----------------------------------------------------------------------- */
+
+/*
+ * rdoff.h     RDOFF Object File manipulation routines header file
+ */
+
+#ifndef RDOFF_RDOFF_H
+#define RDOFF_RDOFF_H 1
+
+#include <inttypes.h>
+
+/*
+ * RDOFF definitions. They are used by RDOFF utilities and by NASM's
+ * 'outrdf2.c' output module.
+ */
+
+/* RDOFF format revision (currently used only when printing the version) */
+#define RDOFF2_REVISION                "0.6.1"
+
+/* RDOFF2 file signature */
+#define RDOFF2_SIGNATURE       "RDOFF2"
+
+/* Maximum size of an import/export label (including trailing zero) */
+#define EXIM_LABEL_MAX         64
+
+/* Maximum size of library or module name (including trailing zero) */
+#define MODLIB_NAME_MAX                128
+
+/* Maximum number of segments that we can handle in one file */
+#define RDF_MAXSEGS            64
+
+/* Record types that may present the RDOFF header */
+#define RDFREC_GENERIC         0
+#define RDFREC_RELOC           1
+#define RDFREC_IMPORT          2
+#define RDFREC_GLOBAL          3
+#define RDFREC_DLL             4
+#define RDFREC_BSS             5
+#define RDFREC_SEGRELOC                6
+#define RDFREC_FARIMPORT       7
+#define RDFREC_MODNAME         8
+#define RDFREC_COMMON          10
+
+/*
+ * Generic record - contains the type and length field, plus a 128 byte
+ * array 'data'
+ */
+struct GenericRec {
+    uint8_t type;
+    uint8_t reclen;
+    char data[128];
+};
+
+/*
+ * Relocation record
+ */
+struct RelocRec {
+    uint8_t type;                  /* must be 1 */
+    uint8_t reclen;                /* content length */
+    uint8_t segment;               /* only 0 for code, or 1 for data supported,
+                                   but add 64 for relative refs (ie do not require
+                                   reloc @ loadtime, only linkage) */
+    int32_t offset;                /* from start of segment in which reference is loc'd */
+    uint8_t length;                /* 1 2 or 4 bytes */
+    uint16_t refseg;              /* segment to which reference refers to */
+};
+
+/*
+ * Extern/import record
+ */
+struct ImportRec {
+    uint8_t type;                  /* must be 2 */
+    uint8_t reclen;                /* content length */
+    uint8_t flags;                 /* SYM_* flags (see below) */
+    uint16_t segment;             /* segment number allocated to the label for reloc
+                                   records - label is assumed to be at offset zero
+                                   in this segment, so linker must fix up with offset
+                                   of segment and of offset within segment */
+    char label[EXIM_LABEL_MAX]; /* zero terminated, should be written to file
+                                   until the zero, but not after it */
+};
+
+/*
+ * Public/export record
+ */
+struct ExportRec {
+    uint8_t type;                  /* must be 3 */
+    uint8_t reclen;                /* content length */
+    uint8_t flags;                 /* SYM_* flags (see below) */
+    uint8_t segment;               /* segment referred to (0/1/2) */
+    int32_t offset;                /* offset within segment */
+    char label[EXIM_LABEL_MAX]; /* zero terminated as in import */
+};
+
+/*
+ * DLL record
+ */
+struct DLLRec {
+    uint8_t type;                  /* must be 4 */
+    uint8_t reclen;                /* content length */
+    char libname[MODLIB_NAME_MAX];      /* name of library to link with at load time */
+};
+
+/*
+ * BSS record
+ */
+struct BSSRec {
+    uint8_t type;                  /* must be 5 */
+    uint8_t reclen;                /* content length */
+    int32_t amount;                /* number of bytes BSS to reserve */
+};
+
+/*
+ * Module name record
+ */
+struct ModRec {
+    uint8_t type;                  /* must be 8 */
+    uint8_t reclen;                /* content length */
+    char modname[MODLIB_NAME_MAX];      /* module name */
+};
+
+/*
+ * Common variable record
+ */
+struct CommonRec {
+    uint8_t type;                  /* must be 10 */
+    uint8_t reclen;                /* equals 7+label length */
+    uint16_t segment;             /* segment number */
+    int32_t size;                  /* size of common variable */
+    uint16_t align;               /* alignment (power of two) */
+    char label[EXIM_LABEL_MAX]; /* zero terminated as in import */
+};
+
+/* Flags for ExportRec */
+#define SYM_DATA       1
+#define SYM_FUNCTION   2
+#define SYM_GLOBAL     4
+#define SYM_IMPORT     8
+
+/*** The following part is used only by the utilities *************************/
+
+#ifdef RDOFF_UTILS
+
+/* Some systems don't define this automatically */
+#if !defined(strdup)
+extern char *strdup(const char *);
+#endif
+
+typedef union RDFHeaderRec {
+    char type;                  /* invariant throughout all below */
+    struct GenericRec g;        /* type 0 */
+    struct RelocRec r;          /* type == 1 / 6 */
+    struct ImportRec i;         /* type == 2 / 7 */
+    struct ExportRec e;         /* type == 3 */
+    struct DLLRec d;            /* type == 4 */
+    struct BSSRec b;            /* type == 5 */
+    struct ModRec m;            /* type == 8 */
+    struct CommonRec c;         /* type == 10 */
+} rdfheaderrec;
+
+struct SegmentHeaderRec {
+    /* information from file */
+    uint16_t type;
+    uint16_t number;
+    uint16_t reserved;
+    int32_t length;
+
+    /* information built up here */
+    int32_t offset;
+    uint8_t *data;                 /* pointer to segment data if it exists in memory */
+};
+
+typedef struct RDFFileInfo {
+    FILE *fp;                   /* file descriptor; must be open to use this struct */
+    int rdoff_ver;              /* should be 1; any higher => not guaranteed to work */
+    int32_t header_len;
+    int32_t header_ofs;
+
+    uint8_t *header_loc;           /* keep location of header */
+    int32_t header_fp;             /* current location within header for reading */
+
+    struct SegmentHeaderRec seg[RDF_MAXSEGS];
+    int nsegs;
+
+    int32_t eof_offset;            /* offset of the first uint8_t beyond the end of this
+                                   module */
+
+    char *name;                 /* name of module in libraries */
+    int *refcount;              /* pointer to reference count on file, or NULL */
+} rdffile;
+
+#define BUF_BLOCK_LEN 4088      /* selected to match page size (4096)
+                                 * on 80x86 machines for efficiency */
+typedef struct memorybuffer {
+    int length;
+    uint8_t buffer[BUF_BLOCK_LEN];
+    struct memorybuffer *next;
+} memorybuffer;
+
+typedef struct {
+    memorybuffer *buf;          /* buffer containing header records */
+    int nsegments;              /* number of segments to be written */
+    int32_t seglength;             /* total length of all the segments */
+} rdf_headerbuf;
+
+/* segments used by RDOFF, understood by rdoffloadseg */
+#define RDOFF_CODE     0
+#define RDOFF_DATA     1
+#define RDOFF_HEADER   -1
+/* mask for 'segment' in relocation records to find if relative relocation */
+#define RDOFF_RELATIVEMASK 64
+/* mask to find actual segment value in relocation records */
+#define RDOFF_SEGMENTMASK 63
+
+extern int rdf_errno;
+
+/* rdf_errno can hold these error codes */
+enum {
+    /* 0 */ RDF_OK,
+    /* 1 */ RDF_ERR_OPEN,
+    /* 2 */ RDF_ERR_FORMAT,
+    /* 3 */ RDF_ERR_READ,
+    /* 4 */ RDF_ERR_UNKNOWN,
+    /* 5 */ RDF_ERR_HEADER,
+    /* 6 */ RDF_ERR_NOMEM,
+    /* 7 */ RDF_ERR_VER,
+    /* 8 */ RDF_ERR_RECTYPE,
+    /* 9 */ RDF_ERR_RECLEN,
+    /* 10 */ RDF_ERR_SEGMENT
+};
+
+/* utility functions */
+int32_t translateint32_t(int32_t in);
+uint16_t translateint16_t(uint16_t in);
+char *translatesegmenttype(uint16_t type);
+
+/* RDOFF file manipulation functions */
+int rdfopen(rdffile * f, const char *name);
+int rdfopenhere(rdffile * f, FILE * fp, int *refcount, const char *name);
+int rdfclose(rdffile * f);
+int rdffindsegment(rdffile * f, int segno);
+int rdfloadseg(rdffile * f, int segment, void *buffer);
+rdfheaderrec *rdfgetheaderrec(rdffile * f);     /* returns static storage */
+void rdfheaderrewind(rdffile * f);      /* back to start of header */
+void rdfperror(const char *app, const char *name);
+
+/* functions to write a new RDOFF header to a file -
+   use rdfnewheader to allocate a header, rdfaddheader to add records to it,
+   rdfaddsegment to notify the header routines that a segment exists, and
+   to tell it how int32_t the segment will be.
+   rdfwriteheader to write the file id, object length, and header
+   to a file, and then rdfdoneheader to dispose of the header */
+
+rdf_headerbuf *rdfnewheader(void);
+int rdfaddheader(rdf_headerbuf * h, rdfheaderrec * r);
+int rdfaddsegment(rdf_headerbuf * h, int32_t seglength);
+int rdfwriteheader(FILE * fp, rdf_headerbuf * h);
+void rdfdoneheader(rdf_headerbuf * h);
+
+#endif                          /* RDOFF_UTILS */
+
+#endif                          /* RDOFF_RDOFF_H */
diff --git a/rdoff/rdx.1 b/rdoff/rdx.1
new file mode 100644 (file)
index 0000000..a864056
--- /dev/null
@@ -0,0 +1,21 @@
+.TH RDX 1 "September 6, 1999" "Debian Project" "Debian Manual"
+.SH NAME
+rdx \- load and execute an RDOFF object
+.SH SYNOPSIS
+.B rdx
+.I object
+.SH DESCRIPTION
+.B rdx
+loads an RDOFF
+.IR object ,
+and then calls
+.RB ` _main ',
+which it expects to be a C-style function, accepting two parameters,
+.I argc
+and
+.I argv
+in normal C style.
+.SH AUTHORS
+Julian Hall <jules@earthcorp.com>.
+.PP
+This manual page was written by Matej Vela <vela@debian.org>.
diff --git a/rdoff/rdx.c b/rdoff/rdx.c
new file mode 100644 (file)
index 0000000..240ab59
--- /dev/null
@@ -0,0 +1,88 @@
+/* ----------------------------------------------------------------------- *
+ *   
+ *   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.
+ *
+ * ----------------------------------------------------------------------- */
+
+/*
+ * rdx.c       RDOFF Object File loader program
+ */
+
+/* note: most of the actual work of this program is done by the modules
+   "rdfload.c", which loads and relocates the object file, and by "rdoff.c",
+   which contains general purpose routines to manipulate RDOFF object
+   files. You can use these files in your own program to load RDOFF objects
+   and execute the code in them in a similar way to what is shown here. */
+
+#include "compiler.h"
+
+#include <stdio.h>
+#include <stdlib.h>
+
+#include "rdfload.h"
+#include "symtab.h"
+
+typedef int (*main_fn) (int, char **);  /* Main function prototype */
+
+int main(int argc, char **argv)
+{
+    rdfmodule *m;
+    main_fn code;
+    symtabEnt *s;
+
+    if (argc < 2) {
+        puts("usage: rdx <rdoff-executable> [params]\n");
+        exit(255);
+    }
+
+    m = rdfload(argv[1]);
+
+    if (!m) {
+        rdfperror("rdx", argv[1]);
+        exit(255);
+    }
+
+    rdf_relocate(m);            /* in this instance, the default relocation
+                                   values will work fine, but they may need changing
+                                   in other cases... */
+
+    s = symtabFind(m->symtab, "_main");
+    if (!s) {
+        fprintf(stderr, "rdx: could not find symbol '_main' in '%s'\n",
+                argv[1]);
+        exit(255);
+    }
+
+    code = (main_fn)(size_t) s->offset;
+
+    argv++, argc--;             /* remove 'rdx' from command line */
+
+    return code(argc, argv);    /* execute */
+}
diff --git a/rdoff/segtab.c b/rdoff/segtab.c
new file mode 100644 (file)
index 0000000..4a4c5b8
--- /dev/null
@@ -0,0 +1,175 @@
+/* ----------------------------------------------------------------------- *
+ *   
+ *   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.
+ *
+ * ----------------------------------------------------------------------- */
+
+#include "compiler.h"
+
+#include <stdio.h>
+#include <stdlib.h>
+#include "segtab.h"
+
+struct segtabnode {
+    int localseg;
+    int destseg;
+    int32_t offset;
+
+    struct segtabnode *left;
+    struct segtabnode *right;
+    /*
+     * counts of how many are left or right, for use in reorganising
+     * the tree
+     */
+    int leftcount;
+    int rightcount;
+};
+
+/*
+ * init_seglocations()
+ * add_seglocation()
+ * get_seglocation()
+ * done_seglocation()
+ *
+ * functions used by write_output() to manipulate associations
+ * between segment numbers and locations (which are built up on a per
+ * module basis, but we only need one module at a time...)
+ *
+ * implementation: we build a binary tree.
+ */
+
+void init_seglocations(segtab * root)
+{
+    *root = NULL;
+}
+
+void descend_tree_add(struct segtabnode **node,
+                      int localseg, int destseg, int32_t offset)
+{
+    struct segtabnode *n;
+
+    if (*node == NULL) {
+        *node = malloc(sizeof(**node));
+        if (!*node) {
+            fprintf(stderr, "segment table: out of memory\n");
+            exit(1);
+        }
+        (*node)->localseg = localseg;
+        (*node)->offset = offset;
+        (*node)->left = NULL;
+        (*node)->leftcount = 0;
+        (*node)->right = NULL;
+        (*node)->rightcount = 0;
+        (*node)->destseg = destseg;
+        return;
+    }
+
+    if (localseg < (*node)->localseg) {
+        (*node)->leftcount++;
+        descend_tree_add(&(*node)->left, localseg, destseg, offset);
+
+        if ((*node)->leftcount > (*node)->rightcount + 2) {
+            n = *node;
+            *node = n->left;
+            n->left = (*node)->right;
+            n->leftcount = (*node)->rightcount;
+            (*node)->right = n;
+            (*node)->rightcount = n->leftcount + n->rightcount + 1;
+        }
+    } else {
+        (*node)->rightcount++;
+        descend_tree_add(&(*node)->right, localseg, destseg, offset);
+
+        if ((*node)->rightcount > (*node)->leftcount + 2) {
+            n = *node;
+            *node = n->right;
+            n->right = (*node)->left;
+            n->rightcount = (*node)->leftcount;
+            (*node)->left = n;
+            (*node)->leftcount = n->leftcount + n->rightcount + 1;
+        }
+    }
+}
+
+void add_seglocation(segtab * root, int localseg, int destseg, int32_t offset)
+{
+    descend_tree_add((struct segtabnode **)root, localseg, destseg,
+                     offset);
+}
+
+int get_seglocation(segtab * root, int localseg, int *destseg,
+                    int32_t *offset)
+{
+    struct segtabnode *n = (struct segtabnode *)*root;
+
+    while (n && n->localseg != localseg) {
+        if (localseg < n->localseg)
+            n = n->left;
+        else
+            n = n->right;
+    }
+    if (n) {
+        *destseg = n->destseg;
+        *offset = n->offset;
+        return 1;
+    } else
+        return 0;
+}
+
+void freenode(struct segtabnode *n)
+{
+    if (!n)
+        return;
+    freenode(n->left);
+    freenode(n->right);
+    free(n);
+}
+
+void done_seglocations(segtab * root)
+{
+    freenode(*root);
+    *root = NULL;
+}
+
+#if 0
+void printnode(int i, struct segtabnode *n)
+{
+    if (!n)
+        return;
+    printnode(i + 1, n->left);
+    printf("%*s%d %d %ld\n", i, "", n->localseg, n->destseg, n->offset);
+    printnode(i + 1, n->right);
+}
+
+void printtable()
+{
+    printnode(0, root);
+}
+#endif
diff --git a/rdoff/segtab.h b/rdoff/segtab.h
new file mode 100644 (file)
index 0000000..87ef017
--- /dev/null
@@ -0,0 +1,46 @@
+/* ----------------------------------------------------------------------- *
+ *   
+ *   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.
+ *
+ * ----------------------------------------------------------------------- */
+
+#ifndef RDOFF_SEGTAB_H
+#define RDOFF_SEGTAB_H 1
+
+#include <inttypes.h>
+
+typedef void *segtab;
+
+void init_seglocations(segtab * r);
+void add_seglocation(segtab * r, int localseg, int destseg, int32_t offset);
+int get_seglocation(segtab * r, int localseg, int *destseg, int32_t *offset);
+void done_seglocations(segtab * r);
+
+#endif
diff --git a/rdoff/symtab.c b/rdoff/symtab.c
new file mode 100644 (file)
index 0000000..1dfee1a
--- /dev/null
@@ -0,0 +1,159 @@
+/* ----------------------------------------------------------------------- *
+ *   
+ *   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.
+ *
+ * ----------------------------------------------------------------------- */
+
+/* 
+ * symtab.c     Routines to maintain and manipulate a symbol table
+ *
+ *   These routines donated to the NASM effort by Graeme Defty.
+ */
+
+#include "compiler.h"
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+
+#include "symtab.h"
+#include "hash.h"
+
+#define SYMTABSIZE 64
+#define slotnum(x) (hash((x)) % SYMTABSIZE)
+
+/* ------------------------------------- */
+/* Private data types */
+
+typedef struct tagSymtabNode {
+    struct tagSymtabNode *next;
+    symtabEnt ent;
+} symtabNode;
+
+typedef symtabNode *(symtabTab[SYMTABSIZE]);
+
+typedef symtabTab *symtab;
+
+/* ------------------------------------- */
+void *symtabNew(void)
+{
+    symtab mytab;
+
+    mytab = (symtabTab *) calloc(SYMTABSIZE, sizeof(symtabNode *));
+    if (mytab == NULL) {
+        fprintf(stderr, "symtab: out of memory\n");
+        exit(3);
+    }
+
+    return mytab;
+}
+
+/* ------------------------------------- */
+void symtabDone(void *stab)
+{
+    symtab mytab = (symtab) stab;
+    int i;
+    symtabNode *this, *next;
+
+    for (i = 0; i < SYMTABSIZE; ++i) {
+
+        for (this = (*mytab)[i]; this; this = next) {
+            next = this->next;
+            free(this);
+        }
+
+    }
+    free(*mytab);
+}
+
+/* ------------------------------------- */
+void symtabInsert(void *stab, symtabEnt * ent)
+{
+    symtab mytab = (symtab) stab;
+    symtabNode *node;
+    int slot;
+
+    node = malloc(sizeof(symtabNode));
+    if (node == NULL) {
+        fprintf(stderr, "symtab: out of memory\n");
+        exit(3);
+    }
+
+    slot = slotnum(ent->name);
+
+    node->ent = *ent;
+    node->next = (*mytab)[slot];
+    (*mytab)[slot] = node;
+}
+
+/* ------------------------------------- */
+symtabEnt *symtabFind(void *stab, const char *name)
+{
+    symtab mytab = (symtab) stab;
+    int slot = slotnum(name);
+    symtabNode *node = (*mytab)[slot];
+
+    while (node) {
+        if (!strcmp(node->ent.name, name)) {
+            return &(node->ent);
+        }
+        node = node->next;
+    }
+
+    return NULL;
+}
+
+/* ------------------------------------- */
+void symtabDump(void *stab, FILE * of)
+{
+    symtab mytab = (symtab) stab;
+    int i;
+    char *SegNames[3] = { "code", "data", "bss" };
+
+    fprintf(of, "Symbol table is ...\n");
+    for (i = 0; i < SYMTABSIZE; ++i) {
+        symtabNode *l = (symtabNode *) (*mytab)[i];
+
+        if (l) {
+            fprintf(of, " ... slot %d ...\n", i);
+        }
+        while (l) {
+            if ((l->ent.segment) == -1) {
+                fprintf(of, "%-32s Unresolved reference\n", l->ent.name);
+            } else {
+                fprintf(of, "%-32s %s:%08"PRIx32" (%"PRId32")\n", l->ent.name,
+                        SegNames[l->ent.segment],
+                        l->ent.offset, l->ent.flags);
+            }
+            l = l->next;
+        }
+    }
+    fprintf(of, "........... end of Symbol table.\n");
+}
diff --git a/rdoff/symtab.h b/rdoff/symtab.h
new file mode 100644 (file)
index 0000000..0dc8c7b
--- /dev/null
@@ -0,0 +1,56 @@
+/* ----------------------------------------------------------------------- *
+ *   
+ *   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.
+ *
+ * ----------------------------------------------------------------------- */
+
+/*
+ * symtab.h    Header file for symbol table manipulation routines
+ */
+
+#ifndef RDOFF_SYMTAB_H
+#define RDOFF_SYMTAB_H 1
+
+#include <inttypes.h>
+
+typedef struct {
+    char *name;
+    int segment;
+    int32_t offset;
+    int32_t flags;
+} symtabEnt;
+
+void *symtabNew(void);
+void symtabDone(void *symtab);
+void symtabInsert(void *symtab, symtabEnt * ent);
+symtabEnt *symtabFind(void *symtab, const char *name);
+void symtabDump(void *symtab, FILE * of);
+
+#endif
diff --git a/rdoff/test/Makefile b/rdoff/test/Makefile
new file mode 100644 (file)
index 0000000..658a6d4
--- /dev/null
@@ -0,0 +1,10 @@
+RDT  = $(patsubst %.asm,%.rdf,$(wildcard *.asm))
+NASM = ../../nasm
+
+all: $(RDT)
+
+%.rdf: %.asm
+       $(NASM) -f rdf -o $@ -l $*.lst $<
+
+clean:
+       rm -f *.rdf *.rdx *.lst
diff --git a/rdoff/test/makelib.sh b/rdoff/test/makelib.sh
new file mode 100644 (file)
index 0000000..520bb19
--- /dev/null
@@ -0,0 +1,14 @@
+#! /bin/sh
+
+[ $1 ] || {
+    echo "Usage: $0 <library name> <module> [...]"
+    exit 1
+}
+
+libname=$1; shift
+
+rdflib c $libname
+
+for f in $*; do
+       rdflib a $libname $f $f
+done
diff --git a/rdoff/test/rdfseg.asm b/rdoff/test/rdfseg.asm
new file mode 100644 (file)
index 0000000..4c6f587
--- /dev/null
@@ -0,0 +1,20 @@
+       ;; program to test inter-segment production and linkage of RDF objects
+
+       ;; [1] should produce segment base ref
+       ;; [2] should produce standard relocation
+       
+[GLOBAL _main]
+[EXTERN _puts: far]
+[BITS 16]
+       
+_main:
+       mov ax, seg _message    ; 0000 [1]
+       mov ds, ax              ; 0003
+       mov dx, _message        ; 0005 [2]
+       call far _puts          ; 0008 [2][1]
+       xor ax,ax               ; 000D
+       int 21h                 ; 000F
+       
+[SECTION .data]
+_message:      db 'Hello, World', 10, 13, 0
+       
\ No newline at end of file
diff --git a/rdoff/test/rdfseg2.asm b/rdoff/test/rdfseg2.asm
new file mode 100644 (file)
index 0000000..2b9e4fd
--- /dev/null
@@ -0,0 +1,12 @@
+       ;; library function for rdfseg - this file is linked as a far segment
+
+[BITS 16]
+[GLOBAL _puts]
+_puts:
+       ;; can't remember how to print a string in DOS, but if anyone wants
+       ;; to actually test this program, it should be fairly easy to put
+       ;; in here!
+
+       retf
+
+       
\ No newline at end of file
diff --git a/rdoff/test/rdftest1.asm b/rdoff/test/rdftest1.asm
new file mode 100644 (file)
index 0000000..76f1e43
--- /dev/null
@@ -0,0 +1,54 @@
+       ;; program to test RDOFF production and linkage
+
+       ;; items to test include:
+       ;;      [1] relocation within the same segment in each module
+       ;;      [2] relocation to different segments in same module
+       ;;      [3] relocation to same segment in different module
+       ;;      [4] relocation to different segment in different module
+       ;;      [5] relative relocation to same module
+       ;;      [6] relative relocation to different module
+       ;;      [7] correct generation of BSS addresses
+
+[SECTION .text]
+[BITS 32]
+       
+_main:
+       mov ax,localdata        ; [2] (16 bit) => 66 b8 0000
+       mov eax,localdata2      ; [2] (32 bit) => b8 0000000a
+
+[EXTERN _fardata]
+
+       mov eax,[_fardata]      ; [4] => a1 00000000 (+20)
+       mov cx,next             ; [1] => 66 b9 0012
+next:
+       call localproc          ; [5] => e8 00000019
+
+[EXTERN _farproc]
+       mov eax,_farproc        ; [3] => b8 00000000 (+40+0)
+       call _farproc           ; [6] => e8 -$ (-0+40+0) (=1f)
+
+       mov eax,localbss        ; [7] => b8 00000000
+
+[GLOBAL _term]
+_term: xor ax,ax               ; => 66 31 c0
+       int 21h                 ; => cd 21
+       jmp _term               ; => e9 -0a (=fffffff6)
+
+localproc:     
+       ret                     ; => c3
+
+[GLOBAL _test1proc]
+_test1proc:
+       call localproc          ; [5] => e8 -$ (-0+0+?) (=-6=fffffffa)
+       ret                     ; => c3
+                       
+[SECTION .data]
+[GLOBAL localdata2]
+localdata:     db 'localdata',0
+localdata2:    db 'localdata2',0
+farref:                dd _fardata     ; [3] => 0 (+20)
+localref:      dd _main        ; [2] => 0 (+0)
+
+[SECTION .bss]
+localbss:      resw 4          ; reserve 8 bytes BSS
+       
\ No newline at end of file
diff --git a/rdoff/test/rdftest2.asm b/rdoff/test/rdftest2.asm
new file mode 100644 (file)
index 0000000..25b8c18
--- /dev/null
@@ -0,0 +1,33 @@
+       ;; rdftest2.asm - test linkage and generation of RDOFF files
+
+[SECTION .text]
+[BITS 32]
+
+[GLOBAL _farproc]
+[EXTERN _test1proc]
+[EXTERN localdata2]
+[EXTERN _term]
+_farproc:
+       
+       mov bx,localdata2       ; [4] 0 => 66 bb 000a(+0)
+       mov eax,_term           ; [3] 5 => b8 00000000(+26+0)
+       call _test1proc         ; [6] A => e8 fffffff2(-40+0+31)(=ffffffe3)
+
+       mov eax,_farproc        ; [1] => b8 00000000(+40)
+       add eax,[_fardata]      ; [2] => 03 05 00000000(+20)
+
+       mov ebx,mybssdata       ; [7] => bb 00000000(+08)
+       call myproc             ; [5] => e8 00000001
+       ret
+
+myproc:
+       add eax,ebx
+       ret
+       
+[SECTION .data]
+[GLOBAL _fardata]
+_fardata:      dw _term        ; [4]
+_localref:     dd _farproc     ; [2]
+
+[SECTION .bss]
+mybssdata:     resw 1
diff --git a/rdoff/test/rdtlib.asm b/rdoff/test/rdtlib.asm
new file mode 100644 (file)
index 0000000..6c2b8ec
--- /dev/null
@@ -0,0 +1,48 @@
+       ;; library functions for rdtmain - test of rdx linking and execution
+
+       ;; library function = _strcmp, defined as in C
+
+[SECTION .text]
+[BITS 32]
+
+[GLOBAL _strcmp]
+_strcmp:
+       push ebp
+       mov ebp,esp
+
+       ;; ebp+8 = first paramater, ebp+12 = second
+
+       mov esi,[ebp+8]
+       mov edi,[ebp+12]
+
+.loop:
+       mov cl,byte [esi]
+       mov dl,byte [edi]
+       cmp cl,dl
+       jb .below
+       ja .above
+       or cl,cl
+       jz .match
+       inc esi
+       inc edi
+       jmp .loop
+
+.below:        
+       mov eax,-1
+       pop ebp
+       ret
+       
+.above:
+       mov eax,1
+       pop ebp
+       ret
+
+.match:
+       xor eax,eax
+       pop ebp
+       ret
+
+[SECTION .data]
+[GLOBAL _message]
+
+_message:      db 'hello',0
\ No newline at end of file
diff --git a/rdoff/test/rdtmain.asm b/rdoff/test/rdtmain.asm
new file mode 100644 (file)
index 0000000..626a2e2
--- /dev/null
@@ -0,0 +1,47 @@
+       ;; rdtmain - main part of test program for RDX execution.
+       ;; returns true (0) if its parameter equals the phrase "hello"
+       ;; "hello" is stored in the library part, to complicate the
+       ;; linkage.
+
+       ;; assemble and link with the following commands:
+       ;; nasm -f rdf rdtmain.asm
+       ;; nasm -f rdf rdtlib.asm
+       ;; ldrdf rdtmain.rdf rdtlib.rdf -o rdxtest.rdx
+
+       ;; run with 'rdx rdxtest.rdx [parameters]' on a Linux (or possibly
+       ;; other 32 bit OS) systems (x86 architectures only!)
+       ;; try using '&& echo Yes' afterwards to find out when it returns 0.
+       
+[EXTERN _strcmp]               ; strcmp is an imported function
+[EXTERN _message]              ; imported data
+[SECTION .text]
+[BITS 32]
+
+       ;; main(int argc,char **argv)
+[GLOBAL _main]
+_main:
+       push ebp
+       mov ebp,esp
+
+       ;; ebp+8 = argc, ebp+12 = argv
+
+       cmp dword [ebp+8],2
+       jb error                ; cause error if < 1 parameters
+
+       mov eax, [ebp+12]       ; eax = argv
+
+       mov ebx, [eax+4]        ; ebx = argv[1]
+       mov ecx, _message       ; ecx = "hello"
+
+       push ecx
+       push ebx
+       call _strcmp            ; compare strings
+       add esp,8               ; caller clears stack
+       
+       pop ebp
+       ret                     ; return return value of _strcmp
+       
+error:
+       mov eax,2               ; return 2 on error
+       pop ebp
+       ret
diff --git a/rdoff/test/testlib.asm b/rdoff/test/testlib.asm
new file mode 100644 (file)
index 0000000..6ee3d89
--- /dev/null
@@ -0,0 +1,18 @@
+; program to test retrieval of and linkage to modules in libraries by
+; ldrdf
+
+[SECTION .text]
+[GLOBAL _main]
+[EXTERN _strcmp]
+
+_main:
+       push dword string1
+       push dword string2
+       call _strcmp
+       add esp,8               ; doh! clear up stack ;-)
+       ret
+
+[SECTION .data]
+
+string1:       db 'abc',0      ; try changing these strings and see
+string2:       db 'abd',0      ; what happens!
diff --git a/regdis.c b/regdis.c
new file mode 100644 (file)
index 0000000..f1434f0
--- /dev/null
+++ b/regdis.c
@@ -0,0 +1,17 @@
+/* automatically generated from ./regs.dat - do not edit */
+
+#include "regdis.h"
+
+const enum reg_enum nasm_rd_creg    [16] = {R_CR0,R_CR1,R_CR2,R_CR3,R_CR4,R_CR5,R_CR6,R_CR7,R_CR8,R_CR9,R_CR10,R_CR11,R_CR12,R_CR13,R_CR14,R_CR15};
+const enum reg_enum nasm_rd_dreg    [16] = {R_DR0,R_DR1,R_DR2,R_DR3,R_DR4,R_DR5,R_DR6,R_DR7,R_DR8,R_DR9,R_DR10,R_DR11,R_DR12,R_DR13,R_DR14,R_DR15};
+const enum reg_enum nasm_rd_fpureg  [ 8] = {R_ST0,R_ST1,R_ST2,R_ST3,R_ST4,R_ST5,R_ST6,R_ST7};
+const enum reg_enum nasm_rd_mmxreg  [ 8] = {R_MM0,R_MM1,R_MM2,R_MM3,R_MM4,R_MM5,R_MM6,R_MM7};
+const enum reg_enum nasm_rd_reg16   [16] = {R_AX,R_CX,R_DX,R_BX,R_SP,R_BP,R_SI,R_DI,R_R8W,R_R9W,R_R10W,R_R11W,R_R12W,R_R13W,R_R14W,R_R15W};
+const enum reg_enum nasm_rd_reg32   [16] = {R_EAX,R_ECX,R_EDX,R_EBX,R_ESP,R_EBP,R_ESI,R_EDI,R_R8D,R_R9D,R_R10D,R_R11D,R_R12D,R_R13D,R_R14D,R_R15D};
+const enum reg_enum nasm_rd_reg64   [16] = {R_RAX,R_RCX,R_RDX,R_RBX,R_RSP,R_RBP,R_RSI,R_RDI,R_R8,R_R9,R_R10,R_R11,R_R12,R_R13,R_R14,R_R15};
+const enum reg_enum nasm_rd_reg8    [ 8] = {R_AL,R_CL,R_DL,R_BL,R_AH,R_CH,R_DH,R_BH};
+const enum reg_enum nasm_rd_reg8_rex[16] = {R_AL,R_CL,R_DL,R_BL,R_SPL,R_BPL,R_SIL,R_DIL,R_R8B,R_R9B,R_R10B,R_R11B,R_R12B,R_R13B,R_R14B,R_R15B};
+const enum reg_enum nasm_rd_sreg    [ 8] = {R_ES,R_CS,R_SS,R_DS,R_FS,R_GS,R_SEGR6,R_SEGR7};
+const enum reg_enum nasm_rd_treg    [ 8] = {R_TR0,R_TR1,R_TR2,R_TR3,R_TR4,R_TR5,R_TR6,R_TR7};
+const enum reg_enum nasm_rd_xmmreg  [16] = {R_XMM0,R_XMM1,R_XMM2,R_XMM3,R_XMM4,R_XMM5,R_XMM6,R_XMM7,R_XMM8,R_XMM9,R_XMM10,R_XMM11,R_XMM12,R_XMM13,R_XMM14,R_XMM15};
+const enum reg_enum nasm_rd_ymmreg  [16] = {R_YMM0,R_YMM1,R_YMM2,R_YMM3,R_YMM4,R_YMM5,R_YMM6,R_YMM7,R_YMM8,R_YMM9,R_YMM10,R_YMM11,R_YMM12,R_YMM13,R_YMM14,R_YMM15};
diff --git a/regdis.h b/regdis.h
new file mode 100644 (file)
index 0000000..799843f
--- /dev/null
+++ b/regdis.h
@@ -0,0 +1,22 @@
+/* automatically generated from ./regs.dat - do not edit */
+
+#ifndef NASM_REGDIS_H
+#define NASM_REGDIS_H
+
+#include "regs.h"
+
+extern const enum reg_enum nasm_rd_creg    [16];
+extern const enum reg_enum nasm_rd_dreg    [16];
+extern const enum reg_enum nasm_rd_fpureg  [ 8];
+extern const enum reg_enum nasm_rd_mmxreg  [ 8];
+extern const enum reg_enum nasm_rd_reg16   [16];
+extern const enum reg_enum nasm_rd_reg32   [16];
+extern const enum reg_enum nasm_rd_reg64   [16];
+extern const enum reg_enum nasm_rd_reg8    [ 8];
+extern const enum reg_enum nasm_rd_reg8_rex[16];
+extern const enum reg_enum nasm_rd_sreg    [ 8];
+extern const enum reg_enum nasm_rd_treg    [ 8];
+extern const enum reg_enum nasm_rd_xmmreg  [16];
+extern const enum reg_enum nasm_rd_ymmreg  [16];
+
+#endif /* NASM_REGDIS_H */
diff --git a/regflags.c b/regflags.c
new file mode 100644 (file)
index 0000000..7ba6649
--- /dev/null
@@ -0,0 +1,172 @@
+/* automatically generated from ./regs.dat - do not edit */
+
+#include "tables.h"
+#include "nasm.h"
+
+const opflags_t nasm_reg_flags[] = {
+    0,
+    REG_HIGH,       /* ah    */
+    REG_AL,         /* al    */
+    REG_AX,         /* ax    */
+    REG_HIGH,       /* bh    */
+    REG8NA,         /* bl    */
+    REG16NA,        /* bp    */
+    REG8NA,         /* bpl   */
+    REG16NA,        /* bx    */
+    REG_HIGH,       /* ch    */
+    REG_CL,         /* cl    */
+    REG_CREG,       /* cr0   */
+    REG_CREG,       /* cr1   */
+    REG_CREG,       /* cr10  */
+    REG_CREG,       /* cr11  */
+    REG_CREG,       /* cr12  */
+    REG_CREG,       /* cr13  */
+    REG_CREG,       /* cr14  */
+    REG_CREG,       /* cr15  */
+    REG_CREG,       /* cr2   */
+    REG_CREG,       /* cr3   */
+    REG_CREG,       /* cr4   */
+    REG_CREG,       /* cr5   */
+    REG_CREG,       /* cr6   */
+    REG_CREG,       /* cr7   */
+    REG_CREG,       /* cr8   */
+    REG_CREG,       /* cr9   */
+    REG_CS,         /* cs    */
+    REG_CX,         /* cx    */
+    REG_HIGH,       /* dh    */
+    REG16NA,        /* di    */
+    REG8NA,         /* dil   */
+    REG_DL,         /* dl    */
+    REG_DREG,       /* dr0   */
+    REG_DREG,       /* dr1   */
+    REG_DREG,       /* dr10  */
+    REG_DREG,       /* dr11  */
+    REG_DREG,       /* dr12  */
+    REG_DREG,       /* dr13  */
+    REG_DREG,       /* dr14  */
+    REG_DREG,       /* dr15  */
+    REG_DREG,       /* dr2   */
+    REG_DREG,       /* dr3   */
+    REG_DREG,       /* dr4   */
+    REG_DREG,       /* dr5   */
+    REG_DREG,       /* dr6   */
+    REG_DREG,       /* dr7   */
+    REG_DREG,       /* dr8   */
+    REG_DREG,       /* dr9   */
+    REG_DESS,       /* ds    */
+    REG_DX,         /* dx    */
+    REG_EAX,        /* eax   */
+    REG32NA,        /* ebp   */
+    REG32NA,        /* ebx   */
+    REG_ECX,        /* ecx   */
+    REG32NA,        /* edi   */
+    REG_EDX,        /* edx   */
+    REG_DESS,       /* es    */
+    REG32NA,        /* esi   */
+    REG32NA,        /* esp   */
+    REG_FSGS,       /* fs    */
+    REG_FSGS,       /* gs    */
+    MMXREG,         /* mm0   */
+    MMXREG,         /* mm1   */
+    MMXREG,         /* mm2   */
+    MMXREG,         /* mm3   */
+    MMXREG,         /* mm4   */
+    MMXREG,         /* mm5   */
+    MMXREG,         /* mm6   */
+    MMXREG,         /* mm7   */
+    REG64NA,        /* r10   */
+    REG8NA,         /* r10b  */
+    REG32NA,        /* r10d  */
+    REG16NA,        /* r10w  */
+    REG64NA,        /* r11   */
+    REG8NA,         /* r11b  */
+    REG32NA,        /* r11d  */
+    REG16NA,        /* r11w  */
+    REG64NA,        /* r12   */
+    REG8NA,         /* r12b  */
+    REG32NA,        /* r12d  */
+    REG16NA,        /* r12w  */
+    REG64NA,        /* r13   */
+    REG8NA,         /* r13b  */
+    REG32NA,        /* r13d  */
+    REG16NA,        /* r13w  */
+    REG64NA,        /* r14   */
+    REG8NA,         /* r14b  */
+    REG32NA,        /* r14d  */
+    REG16NA,        /* r14w  */
+    REG64NA,        /* r15   */
+    REG8NA,         /* r15b  */
+    REG32NA,        /* r15d  */
+    REG16NA,        /* r15w  */
+    REG64NA,        /* r8    */
+    REG8NA,         /* r8b   */
+    REG32NA,        /* r8d   */
+    REG16NA,        /* r8w   */
+    REG64NA,        /* r9    */
+    REG8NA,         /* r9b   */
+    REG32NA,        /* r9d   */
+    REG16NA,        /* r9w   */
+    REG_RAX,        /* rax   */
+    REG64NA,        /* rbp   */
+    REG64NA,        /* rbx   */
+    REG_RCX,        /* rcx   */
+    REG64NA,        /* rdi   */
+    REG_RDX,        /* rdx   */
+    REG64NA,        /* rsi   */
+    REG64NA,        /* rsp   */
+    REG_SEG67,      /* segr6 */
+    REG_SEG67,      /* segr7 */
+    REG16NA,        /* si    */
+    REG8NA,         /* sil   */
+    REG16NA,        /* sp    */
+    REG8NA,         /* spl   */
+    REG_DESS,       /* ss    */
+    FPU0,           /* st0   */
+    FPUREG,         /* st1   */
+    FPUREG,         /* st2   */
+    FPUREG,         /* st3   */
+    FPUREG,         /* st4   */
+    FPUREG,         /* st5   */
+    FPUREG,         /* st6   */
+    FPUREG,         /* st7   */
+    REG_TREG,       /* tr0   */
+    REG_TREG,       /* tr1   */
+    REG_TREG,       /* tr2   */
+    REG_TREG,       /* tr3   */
+    REG_TREG,       /* tr4   */
+    REG_TREG,       /* tr5   */
+    REG_TREG,       /* tr6   */
+    REG_TREG,       /* tr7   */
+    XMM0,           /* xmm0  */
+    XMMREG,         /* xmm1  */
+    XMMREG,         /* xmm10 */
+    XMMREG,         /* xmm11 */
+    XMMREG,         /* xmm12 */
+    XMMREG,         /* xmm13 */
+    XMMREG,         /* xmm14 */
+    XMMREG,         /* xmm15 */
+    XMMREG,         /* xmm2  */
+    XMMREG,         /* xmm3  */
+    XMMREG,         /* xmm4  */
+    XMMREG,         /* xmm5  */
+    XMMREG,         /* xmm6  */
+    XMMREG,         /* xmm7  */
+    XMMREG,         /* xmm8  */
+    XMMREG,         /* xmm9  */
+    YMM0,           /* ymm0  */
+    YMMREG,         /* ymm1  */
+    YMMREG,         /* ymm10 */
+    YMMREG,         /* ymm11 */
+    YMMREG,         /* ymm12 */
+    YMMREG,         /* ymm13 */
+    YMMREG,         /* ymm14 */
+    YMMREG,         /* ymm15 */
+    YMMREG,         /* ymm2  */
+    YMMREG,         /* ymm3  */
+    YMMREG,         /* ymm4  */
+    YMMREG,         /* ymm5  */
+    YMMREG,         /* ymm6  */
+    YMMREG,         /* ymm7  */
+    YMMREG,         /* ymm8  */
+    YMMREG,         /* ymm9  */
+};
diff --git a/regs.c b/regs.c
new file mode 100644 (file)
index 0000000..9c410cb
--- /dev/null
+++ b/regs.c
@@ -0,0 +1,170 @@
+/* automatically generated from ./regs.dat - do not edit */
+
+#include "tables.h"
+
+const char * const nasm_reg_names[] = {
+    "ah",
+    "al",
+    "ax",
+    "bh",
+    "bl",
+    "bp",
+    "bpl",
+    "bx",
+    "ch",
+    "cl",
+    "cr0",
+    "cr1",
+    "cr10",
+    "cr11",
+    "cr12",
+    "cr13",
+    "cr14",
+    "cr15",
+    "cr2",
+    "cr3",
+    "cr4",
+    "cr5",
+    "cr6",
+    "cr7",
+    "cr8",
+    "cr9",
+    "cs",
+    "cx",
+    "dh",
+    "di",
+    "dil",
+    "dl",
+    "dr0",
+    "dr1",
+    "dr10",
+    "dr11",
+    "dr12",
+    "dr13",
+    "dr14",
+    "dr15",
+    "dr2",
+    "dr3",
+    "dr4",
+    "dr5",
+    "dr6",
+    "dr7",
+    "dr8",
+    "dr9",
+    "ds",
+    "dx",
+    "eax",
+    "ebp",
+    "ebx",
+    "ecx",
+    "edi",
+    "edx",
+    "es",
+    "esi",
+    "esp",
+    "fs",
+    "gs",
+    "mm0",
+    "mm1",
+    "mm2",
+    "mm3",
+    "mm4",
+    "mm5",
+    "mm6",
+    "mm7",
+    "r10",
+    "r10b",
+    "r10d",
+    "r10w",
+    "r11",
+    "r11b",
+    "r11d",
+    "r11w",
+    "r12",
+    "r12b",
+    "r12d",
+    "r12w",
+    "r13",
+    "r13b",
+    "r13d",
+    "r13w",
+    "r14",
+    "r14b",
+    "r14d",
+    "r14w",
+    "r15",
+    "r15b",
+    "r15d",
+    "r15w",
+    "r8",
+    "r8b",
+    "r8d",
+    "r8w",
+    "r9",
+    "r9b",
+    "r9d",
+    "r9w",
+    "rax",
+    "rbp",
+    "rbx",
+    "rcx",
+    "rdi",
+    "rdx",
+    "rsi",
+    "rsp",
+    "segr6",
+    "segr7",
+    "si",
+    "sil",
+    "sp",
+    "spl",
+    "ss",
+    "st0",
+    "st1",
+    "st2",
+    "st3",
+    "st4",
+    "st5",
+    "st6",
+    "st7",
+    "tr0",
+    "tr1",
+    "tr2",
+    "tr3",
+    "tr4",
+    "tr5",
+    "tr6",
+    "tr7",
+    "xmm0",
+    "xmm1",
+    "xmm10",
+    "xmm11",
+    "xmm12",
+    "xmm13",
+    "xmm14",
+    "xmm15",
+    "xmm2",
+    "xmm3",
+    "xmm4",
+    "xmm5",
+    "xmm6",
+    "xmm7",
+    "xmm8",
+    "xmm9",
+    "ymm0",
+    "ymm1",
+    "ymm10",
+    "ymm11",
+    "ymm12",
+    "ymm13",
+    "ymm14",
+    "ymm15",
+    "ymm2",
+    "ymm3",
+    "ymm4",
+    "ymm5",
+    "ymm6",
+    "ymm7",
+    "ymm8",
+    "ymm9"
+};
diff --git a/regs.dat b/regs.dat
new file mode 100644 (file)
index 0000000..105c9ef
--- /dev/null
+++ b/regs.dat
@@ -0,0 +1,119 @@
+## --------------------------------------------------------------------------
+##   
+##   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 registers and their classes; classes are defined in nasm.h
+#
+# The columns are:
+#
+# register name, assembler class, disassembler class(es), x86 register number
+#
+# If the register name ends in two numbers separated by a dash, then it is
+# repeated as many times as indicated, and the register number is
+# updated with it.
+#
+
+# General-purpose registers
+al     REG_AL          reg8,reg8_rex   0
+ah     REG_HIGH        reg8            4
+ax     REG_AX          reg16           0
+eax    REG_EAX         reg32           0
+rax    REG_RAX         reg64           0
+bl     REG8NA          reg8,reg8_rex   3
+bh     REG_HIGH        reg8            7
+bx     REG16NA         reg16           3
+ebx    REG32NA         reg32           3
+rbx    REG64NA         reg64           3
+cl     REG_CL          reg8,reg8_rex   1
+ch     REG_HIGH        reg8            5
+cx     REG_CX          reg16           1
+ecx    REG_ECX         reg32           1
+rcx    REG_RCX         reg64           1
+dl     REG_DL          reg8,reg8_rex   2
+dh     REG_HIGH        reg8            6
+dx     REG_DX          reg16           2
+edx    REG_EDX         reg32           2
+rdx    REG_RDX         reg64           2
+spl    REG8NA          reg8_rex        4
+sp     REG16NA         reg16           4
+esp    REG32NA         reg32           4
+rsp    REG64NA         reg64           4
+bpl    REG8NA          reg8_rex        5
+bp     REG16NA         reg16           5
+ebp    REG32NA         reg32           5
+rbp    REG64NA         reg64           5
+sil    REG8NA          reg8_rex        6
+si     REG16NA         reg16           6
+esi    REG32NA         reg32           6
+rsi    REG64NA         reg64           6
+dil    REG8NA          reg8_rex        7
+di     REG16NA         reg16           7
+edi    REG32NA         reg32           7
+rdi    REG64NA         reg64           7
+r8-15b REG8NA          reg8_rex        8
+r8-15w REG16NA         reg16           8
+r8-15d REG32NA         reg32           8
+r8-15  REG64NA         reg64           8
+
+# Segment registers
+cs     REG_CS          sreg            1
+ds     REG_DESS        sreg            3
+es     REG_DESS        sreg            0
+ss     REG_DESS        sreg            2
+fs     REG_FSGS        sreg            4
+gs     REG_FSGS        sreg            5
+segr6-7        REG_SEG67       sreg            6
+
+# Control registers
+cr0-15 REG_CREG        creg            0
+
+# Debug registers
+dr0-15 REG_DREG        dreg            0
+
+# Test registers
+tr0-7  REG_TREG        treg            0
+
+# Floating-point registers
+st0    FPU0            fpureg          0
+st1-7  FPUREG          fpureg          1
+
+# MMX registers
+mm0-7  MMXREG          mmxreg          0
+
+# SSE registers
+xmm0   XMM0            xmmreg          0
+xmm1-15        XMMREG          xmmreg          1
+
+# AVX registers
+ymm0   YMM0            ymmreg          0
+ymm1-15        YMMREG          ymmreg          1
diff --git a/regs.h b/regs.h
new file mode 100644 (file)
index 0000000..ecb01a6
--- /dev/null
+++ b/regs.h
@@ -0,0 +1,346 @@
+/* automatically generated from ./regs.dat - do not edit */
+
+#ifndef NASM_REGS_H
+#define NASM_REGS_H
+
+#define EXPR_REG_START 1
+
+enum reg_enum {
+    R_zero = 0,
+    R_none = -1,
+    R_AH = EXPR_REG_START,
+    R_AL,
+    R_AX,
+    R_BH,
+    R_BL,
+    R_BP,
+    R_BPL,
+    R_BX,
+    R_CH,
+    R_CL,
+    R_CR0,
+    R_CR1,
+    R_CR10,
+    R_CR11,
+    R_CR12,
+    R_CR13,
+    R_CR14,
+    R_CR15,
+    R_CR2,
+    R_CR3,
+    R_CR4,
+    R_CR5,
+    R_CR6,
+    R_CR7,
+    R_CR8,
+    R_CR9,
+    R_CS,
+    R_CX,
+    R_DH,
+    R_DI,
+    R_DIL,
+    R_DL,
+    R_DR0,
+    R_DR1,
+    R_DR10,
+    R_DR11,
+    R_DR12,
+    R_DR13,
+    R_DR14,
+    R_DR15,
+    R_DR2,
+    R_DR3,
+    R_DR4,
+    R_DR5,
+    R_DR6,
+    R_DR7,
+    R_DR8,
+    R_DR9,
+    R_DS,
+    R_DX,
+    R_EAX,
+    R_EBP,
+    R_EBX,
+    R_ECX,
+    R_EDI,
+    R_EDX,
+    R_ES,
+    R_ESI,
+    R_ESP,
+    R_FS,
+    R_GS,
+    R_MM0,
+    R_MM1,
+    R_MM2,
+    R_MM3,
+    R_MM4,
+    R_MM5,
+    R_MM6,
+    R_MM7,
+    R_R10,
+    R_R10B,
+    R_R10D,
+    R_R10W,
+    R_R11,
+    R_R11B,
+    R_R11D,
+    R_R11W,
+    R_R12,
+    R_R12B,
+    R_R12D,
+    R_R12W,
+    R_R13,
+    R_R13B,
+    R_R13D,
+    R_R13W,
+    R_R14,
+    R_R14B,
+    R_R14D,
+    R_R14W,
+    R_R15,
+    R_R15B,
+    R_R15D,
+    R_R15W,
+    R_R8,
+    R_R8B,
+    R_R8D,
+    R_R8W,
+    R_R9,
+    R_R9B,
+    R_R9D,
+    R_R9W,
+    R_RAX,
+    R_RBP,
+    R_RBX,
+    R_RCX,
+    R_RDI,
+    R_RDX,
+    R_RSI,
+    R_RSP,
+    R_SEGR6,
+    R_SEGR7,
+    R_SI,
+    R_SIL,
+    R_SP,
+    R_SPL,
+    R_SS,
+    R_ST0,
+    R_ST1,
+    R_ST2,
+    R_ST3,
+    R_ST4,
+    R_ST5,
+    R_ST6,
+    R_ST7,
+    R_TR0,
+    R_TR1,
+    R_TR2,
+    R_TR3,
+    R_TR4,
+    R_TR5,
+    R_TR6,
+    R_TR7,
+    R_XMM0,
+    R_XMM1,
+    R_XMM10,
+    R_XMM11,
+    R_XMM12,
+    R_XMM13,
+    R_XMM14,
+    R_XMM15,
+    R_XMM2,
+    R_XMM3,
+    R_XMM4,
+    R_XMM5,
+    R_XMM6,
+    R_XMM7,
+    R_XMM8,
+    R_XMM9,
+    R_YMM0,
+    R_YMM1,
+    R_YMM10,
+    R_YMM11,
+    R_YMM12,
+    R_YMM13,
+    R_YMM14,
+    R_YMM15,
+    R_YMM2,
+    R_YMM3,
+    R_YMM4,
+    R_YMM5,
+    R_YMM6,
+    R_YMM7,
+    R_YMM8,
+    R_YMM9,
+    REG_ENUM_LIMIT
+};
+
+#define EXPR_REG_END 164
+
+#define REG_NUM_AH       4
+#define REG_NUM_AL       0
+#define REG_NUM_AX       0
+#define REG_NUM_BH       7
+#define REG_NUM_BL       3
+#define REG_NUM_BP       5
+#define REG_NUM_BPL      5
+#define REG_NUM_BX       3
+#define REG_NUM_CH       5
+#define REG_NUM_CL       1
+#define REG_NUM_CR0      0
+#define REG_NUM_CR1      1
+#define REG_NUM_CR10    10
+#define REG_NUM_CR11    11
+#define REG_NUM_CR12    12
+#define REG_NUM_CR13    13
+#define REG_NUM_CR14    14
+#define REG_NUM_CR15    15
+#define REG_NUM_CR2      2
+#define REG_NUM_CR3      3
+#define REG_NUM_CR4      4
+#define REG_NUM_CR5      5
+#define REG_NUM_CR6      6
+#define REG_NUM_CR7      7
+#define REG_NUM_CR8      8
+#define REG_NUM_CR9      9
+#define REG_NUM_CS       1
+#define REG_NUM_CX       1
+#define REG_NUM_DH       6
+#define REG_NUM_DI       7
+#define REG_NUM_DIL      7
+#define REG_NUM_DL       2
+#define REG_NUM_DR0      0
+#define REG_NUM_DR1      1
+#define REG_NUM_DR10    10
+#define REG_NUM_DR11    11
+#define REG_NUM_DR12    12
+#define REG_NUM_DR13    13
+#define REG_NUM_DR14    14
+#define REG_NUM_DR15    15
+#define REG_NUM_DR2      2
+#define REG_NUM_DR3      3
+#define REG_NUM_DR4      4
+#define REG_NUM_DR5      5
+#define REG_NUM_DR6      6
+#define REG_NUM_DR7      7
+#define REG_NUM_DR8      8
+#define REG_NUM_DR9      9
+#define REG_NUM_DS       3
+#define REG_NUM_DX       2
+#define REG_NUM_EAX      0
+#define REG_NUM_EBP      5
+#define REG_NUM_EBX      3
+#define REG_NUM_ECX      1
+#define REG_NUM_EDI      7
+#define REG_NUM_EDX      2
+#define REG_NUM_ES       0
+#define REG_NUM_ESI      6
+#define REG_NUM_ESP      4
+#define REG_NUM_FS       4
+#define REG_NUM_GS       5
+#define REG_NUM_MM0      0
+#define REG_NUM_MM1      1
+#define REG_NUM_MM2      2
+#define REG_NUM_MM3      3
+#define REG_NUM_MM4      4
+#define REG_NUM_MM5      5
+#define REG_NUM_MM6      6
+#define REG_NUM_MM7      7
+#define REG_NUM_R10     10
+#define REG_NUM_R10B    10
+#define REG_NUM_R10D    10
+#define REG_NUM_R10W    10
+#define REG_NUM_R11     11
+#define REG_NUM_R11B    11
+#define REG_NUM_R11D    11
+#define REG_NUM_R11W    11
+#define REG_NUM_R12     12
+#define REG_NUM_R12B    12
+#define REG_NUM_R12D    12
+#define REG_NUM_R12W    12
+#define REG_NUM_R13     13
+#define REG_NUM_R13B    13
+#define REG_NUM_R13D    13
+#define REG_NUM_R13W    13
+#define REG_NUM_R14     14
+#define REG_NUM_R14B    14
+#define REG_NUM_R14D    14
+#define REG_NUM_R14W    14
+#define REG_NUM_R15     15
+#define REG_NUM_R15B    15
+#define REG_NUM_R15D    15
+#define REG_NUM_R15W    15
+#define REG_NUM_R8       8
+#define REG_NUM_R8B      8
+#define REG_NUM_R8D      8
+#define REG_NUM_R8W      8
+#define REG_NUM_R9       9
+#define REG_NUM_R9B      9
+#define REG_NUM_R9D      9
+#define REG_NUM_R9W      9
+#define REG_NUM_RAX      0
+#define REG_NUM_RBP      5
+#define REG_NUM_RBX      3
+#define REG_NUM_RCX      1
+#define REG_NUM_RDI      7
+#define REG_NUM_RDX      2
+#define REG_NUM_RSI      6
+#define REG_NUM_RSP      4
+#define REG_NUM_SEGR6    6
+#define REG_NUM_SEGR7    7
+#define REG_NUM_SI       6
+#define REG_NUM_SIL      6
+#define REG_NUM_SP       4
+#define REG_NUM_SPL      4
+#define REG_NUM_SS       2
+#define REG_NUM_ST0      0
+#define REG_NUM_ST1      1
+#define REG_NUM_ST2      2
+#define REG_NUM_ST3      3
+#define REG_NUM_ST4      4
+#define REG_NUM_ST5      5
+#define REG_NUM_ST6      6
+#define REG_NUM_ST7      7
+#define REG_NUM_TR0      0
+#define REG_NUM_TR1      1
+#define REG_NUM_TR2      2
+#define REG_NUM_TR3      3
+#define REG_NUM_TR4      4
+#define REG_NUM_TR5      5
+#define REG_NUM_TR6      6
+#define REG_NUM_TR7      7
+#define REG_NUM_XMM0     0
+#define REG_NUM_XMM1     1
+#define REG_NUM_XMM10   10
+#define REG_NUM_XMM11   11
+#define REG_NUM_XMM12   12
+#define REG_NUM_XMM13   13
+#define REG_NUM_XMM14   14
+#define REG_NUM_XMM15   15
+#define REG_NUM_XMM2     2
+#define REG_NUM_XMM3     3
+#define REG_NUM_XMM4     4
+#define REG_NUM_XMM5     5
+#define REG_NUM_XMM6     6
+#define REG_NUM_XMM7     7
+#define REG_NUM_XMM8     8
+#define REG_NUM_XMM9     9
+#define REG_NUM_YMM0     0
+#define REG_NUM_YMM1     1
+#define REG_NUM_YMM10   10
+#define REG_NUM_YMM11   11
+#define REG_NUM_YMM12   12
+#define REG_NUM_YMM13   13
+#define REG_NUM_YMM14   14
+#define REG_NUM_YMM15   15
+#define REG_NUM_YMM2     2
+#define REG_NUM_YMM3     3
+#define REG_NUM_YMM4     4
+#define REG_NUM_YMM5     5
+#define REG_NUM_YMM6     6
+#define REG_NUM_YMM7     7
+#define REG_NUM_YMM8     8
+#define REG_NUM_YMM9     9
+
+
+#endif /* NASM_REGS_H */
diff --git a/regs.pl b/regs.pl
new file mode 100755 (executable)
index 0000000..82c4829
--- /dev/null
+++ b/regs.pl
@@ -0,0 +1,204 @@
+#!/usr/bin/perl
+## --------------------------------------------------------------------------
+##   
+##   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.
+##
+## --------------------------------------------------------------------------
+
+#
+# Read regs.dat and output regs.h and regs.c (included in names.c)
+#
+
+$nline = 0;
+
+sub toint($) {
+    my($v) = @_;
+
+    return ($v =~ /^0/) ? oct $v : $v+0;
+}
+
+sub process_line($) {
+    my($line) = @_;
+    my @v;
+
+    if ( $line !~ /^\s*(\S+)\s*(\S+)\s*(\S+)\s*([0-9]+)$/i ) {
+       die "regs.dat:$nline: invalid input\n";
+    }
+    $reg      = $1;
+    $aclass   = $2;
+    $dclasses = $3;
+    $x86regno = toint($4);
+
+    if ($reg =~ /^(.*[^0-9])([0-9]+)\-([0-9]+)(|[^0-9].*)$/) {
+       $nregs = $3-$2+1;
+       $reg = $1.$2.$4;
+       $reg_nr = $2;
+       $reg_prefix = $1;
+       $reg_suffix = $4;
+    } else {
+       $nregs = 1;
+       undef $reg_prefix, $reg_suffix;
+    }
+
+    while ($nregs--) {
+       $regs{$reg} = $aclass;
+       $regvals{$reg} = $x86regno;
+
+       foreach $dclass (split(/,/, $dclasses)) {
+           if ( !defined($disclass{$dclass}) ) {
+               $disclass{$dclass} = [];
+           }
+
+           $disclass{$dclass}->[$x86regno] = $reg;
+       }
+
+       # Compute the next register, if any
+       if (defined($reg_prefix)) {
+           $x86regno++;
+           $reg_nr++;
+           $reg = sprintf("%s%u%s", $reg_prefix, $reg_nr, $reg_suffix);
+       } else {
+           # Not a dashed sequence
+           die if ($nregs);
+       }
+    }
+}
+
+($fmt, $file) = @ARGV;
+
+%regs = ();
+%regvals = ();
+%disclass = ();
+open(REGS, "< ${file}") or die "$0: Cannot open $file\n";
+while ( defined($line = <REGS>) ) {
+    $nline++;
+
+    chomp $line;
+    $line =~ s/\s*(\#.*|)$//;
+
+    next if ( $line eq '' );
+
+    process_line($line);
+}
+close(REGS);
+
+if ( $fmt eq 'h' ) {
+    # Output regs.h
+    print "/* automatically generated from $file - do not edit */\n\n";
+    print "#ifndef NASM_REGS_H\n";
+    print "#define NASM_REGS_H\n\n";
+
+    $expr_regs = 1;
+    printf "#define EXPR_REG_START %d\n\n", $expr_regs;
+    print "enum reg_enum {\n";
+    # Unfortunately the code uses both 0 and -1 as "no register" in
+    # different places...
+    print "    R_zero = 0,\n";
+    print "    R_none = -1,\n";
+    $attach = ' = EXPR_REG_START'; # EXPR_REG_START == 1
+    foreach $reg ( sort(keys(%regs)) ) {
+       print "    R_\U${reg}\E${attach},\n";
+       $attach = '';
+       $expr_regs++;
+    }
+    print "    REG_ENUM_LIMIT\n";
+    print "};\n\n";
+    printf "#define EXPR_REG_END %d\n\n", $expr_regs-1;
+    foreach $reg ( sort(keys(%regs)) ) {
+       printf "#define %-15s %2d\n", "REG_NUM_\U${reg}", $regvals{$reg};
+    }
+    print "\n\n#endif /* NASM_REGS_H */\n";
+} elsif ( $fmt eq 'c' ) {
+    # Output regs.c
+    print "/* automatically generated from $file - do not edit */\n\n";
+    print "#include \"tables.h\"\n\n";
+    print "const char * const nasm_reg_names[] = "; $ch = '{';
+    # This one has no dummy entry for 0
+    foreach $reg ( sort(keys(%regs)) ) {
+       print "$ch\n    \"${reg}\"";
+       $ch = ',';
+    }
+    print "\n};\n";
+} elsif ( $fmt eq 'fc' ) {
+    # Output regflags.c
+    print "/* automatically generated from $file - do not edit */\n\n";
+    print "#include \"tables.h\"\n";
+    print "#include \"nasm.h\"\n\n";
+    print "const opflags_t nasm_reg_flags[] = {\n";
+    printf "    0,\n";         # Dummy entry for 0
+    foreach $reg ( sort(keys(%regs)) ) {
+       # Print the class of the register
+       printf "    %-15s /* %-5s */\n",
+               $regs{$reg}.',', $reg;
+    }
+    print "};\n";
+} elsif ( $fmt eq 'vc' ) {
+    # Output regvals.c
+    print "/* automatically generated from $file - do not edit */\n\n";
+    print "#include \"tables.h\"\n\n";
+    print "const int nasm_regvals[] = {\n";
+    print "    -1,\n";         # Dummy entry for 0
+    foreach $reg ( sort(keys(%regs)) ) {
+       # Print the x86 value of the register
+       printf "    %2d,  /* %-5s */\n", $regvals{$reg}, $reg;
+    }
+    print "};\n";
+} elsif ( $fmt eq 'dc' ) {
+    # Output regdis.c
+    print "/* automatically generated from $file - do not edit */\n\n";
+    print "#include \"regdis.h\"\n\n";
+    foreach $class ( sort(keys(%disclass)) ) {
+       printf "const enum reg_enum nasm_rd_%-8s[%2d] = {",
+               $class, scalar @{$disclass{$class}};
+       @foo = @{$disclass{$class}};
+       @bar = ();
+       for ( $i = 0 ; $i < scalar(@foo) ; $i++ ) {
+            if (defined($foo[$i])) {
+               push(@bar, "R_\U$foo[$i]\E");
+           } else {
+               die "$0: No register name for class $class, value $i\n";
+            }
+       }
+       print join(',', @bar), "};\n";
+    }
+} elsif ( $fmt eq 'dh' ) {
+    # Output regdis.h
+    print "/* automatically generated from $file - do not edit */\n\n";
+    print "#ifndef NASM_REGDIS_H\n";
+    print "#define NASM_REGDIS_H\n\n";
+    print "#include \"regs.h\"\n\n";
+    foreach $class ( sort(keys(%disclass)) ) {
+       printf "extern const enum reg_enum nasm_rd_%-8s[%2d];\n",
+               $class, scalar @{$disclass{$class}};
+    }
+    print "\n#endif /* NASM_REGDIS_H */\n";
+} else {
+    die "$0: Unknown output format\n";
+}
diff --git a/regvals.c b/regvals.c
new file mode 100644 (file)
index 0000000..2a8737c
--- /dev/null
+++ b/regvals.c
@@ -0,0 +1,171 @@
+/* automatically generated from ./regs.dat - do not edit */
+
+#include "tables.h"
+
+const int nasm_regvals[] = {
+    -1,
+     4,  /* ah    */
+     0,  /* al    */
+     0,  /* ax    */
+     7,  /* bh    */
+     3,  /* bl    */
+     5,  /* bp    */
+     5,  /* bpl   */
+     3,  /* bx    */
+     5,  /* ch    */
+     1,  /* cl    */
+     0,  /* cr0   */
+     1,  /* cr1   */
+    10,  /* cr10  */
+    11,  /* cr11  */
+    12,  /* cr12  */
+    13,  /* cr13  */
+    14,  /* cr14  */
+    15,  /* cr15  */
+     2,  /* cr2   */
+     3,  /* cr3   */
+     4,  /* cr4   */
+     5,  /* cr5   */
+     6,  /* cr6   */
+     7,  /* cr7   */
+     8,  /* cr8   */
+     9,  /* cr9   */
+     1,  /* cs    */
+     1,  /* cx    */
+     6,  /* dh    */
+     7,  /* di    */
+     7,  /* dil   */
+     2,  /* dl    */
+     0,  /* dr0   */
+     1,  /* dr1   */
+    10,  /* dr10  */
+    11,  /* dr11  */
+    12,  /* dr12  */
+    13,  /* dr13  */
+    14,  /* dr14  */
+    15,  /* dr15  */
+     2,  /* dr2   */
+     3,  /* dr3   */
+     4,  /* dr4   */
+     5,  /* dr5   */
+     6,  /* dr6   */
+     7,  /* dr7   */
+     8,  /* dr8   */
+     9,  /* dr9   */
+     3,  /* ds    */
+     2,  /* dx    */
+     0,  /* eax   */
+     5,  /* ebp   */
+     3,  /* ebx   */
+     1,  /* ecx   */
+     7,  /* edi   */
+     2,  /* edx   */
+     0,  /* es    */
+     6,  /* esi   */
+     4,  /* esp   */
+     4,  /* fs    */
+     5,  /* gs    */
+     0,  /* mm0   */
+     1,  /* mm1   */
+     2,  /* mm2   */
+     3,  /* mm3   */
+     4,  /* mm4   */
+     5,  /* mm5   */
+     6,  /* mm6   */
+     7,  /* mm7   */
+    10,  /* r10   */
+    10,  /* r10b  */
+    10,  /* r10d  */
+    10,  /* r10w  */
+    11,  /* r11   */
+    11,  /* r11b  */
+    11,  /* r11d  */
+    11,  /* r11w  */
+    12,  /* r12   */
+    12,  /* r12b  */
+    12,  /* r12d  */
+    12,  /* r12w  */
+    13,  /* r13   */
+    13,  /* r13b  */
+    13,  /* r13d  */
+    13,  /* r13w  */
+    14,  /* r14   */
+    14,  /* r14b  */
+    14,  /* r14d  */
+    14,  /* r14w  */
+    15,  /* r15   */
+    15,  /* r15b  */
+    15,  /* r15d  */
+    15,  /* r15w  */
+     8,  /* r8    */
+     8,  /* r8b   */
+     8,  /* r8d   */
+     8,  /* r8w   */
+     9,  /* r9    */
+     9,  /* r9b   */
+     9,  /* r9d   */
+     9,  /* r9w   */
+     0,  /* rax   */
+     5,  /* rbp   */
+     3,  /* rbx   */
+     1,  /* rcx   */
+     7,  /* rdi   */
+     2,  /* rdx   */
+     6,  /* rsi   */
+     4,  /* rsp   */
+     6,  /* segr6 */
+     7,  /* segr7 */
+     6,  /* si    */
+     6,  /* sil   */
+     4,  /* sp    */
+     4,  /* spl   */
+     2,  /* ss    */
+     0,  /* st0   */
+     1,  /* st1   */
+     2,  /* st2   */
+     3,  /* st3   */
+     4,  /* st4   */
+     5,  /* st5   */
+     6,  /* st6   */
+     7,  /* st7   */
+     0,  /* tr0   */
+     1,  /* tr1   */
+     2,  /* tr2   */
+     3,  /* tr3   */
+     4,  /* tr4   */
+     5,  /* tr5   */
+     6,  /* tr6   */
+     7,  /* tr7   */
+     0,  /* xmm0  */
+     1,  /* xmm1  */
+    10,  /* xmm10 */
+    11,  /* xmm11 */
+    12,  /* xmm12 */
+    13,  /* xmm13 */
+    14,  /* xmm14 */
+    15,  /* xmm15 */
+     2,  /* xmm2  */
+     3,  /* xmm3  */
+     4,  /* xmm4  */
+     5,  /* xmm5  */
+     6,  /* xmm6  */
+     7,  /* xmm7  */
+     8,  /* xmm8  */
+     9,  /* xmm9  */
+     0,  /* ymm0  */
+     1,  /* ymm1  */
+    10,  /* ymm10 */
+    11,  /* ymm11 */
+    12,  /* ymm12 */
+    13,  /* ymm13 */
+    14,  /* ymm14 */
+    15,  /* ymm15 */
+     2,  /* ymm2  */
+     3,  /* ymm3  */
+     4,  /* ymm4  */
+     5,  /* ymm5  */
+     6,  /* ymm6  */
+     7,  /* ymm7  */
+     8,  /* ymm8  */
+     9,  /* ymm9  */
+};
diff --git a/saa.c b/saa.c
new file mode 100644 (file)
index 0000000..157aba3
--- /dev/null
+++ b/saa.c
@@ -0,0 +1,417 @@
+/* ----------------------------------------------------------------------- *
+ *   
+ *   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.
+ *
+ * ----------------------------------------------------------------------- */
+
+#include "compiler.h"
+#include "nasmlib.h"
+#include "saa.h"
+
+/* Aggregate SAA components smaller than this */
+#define SAA_BLKSHIFT   16
+#define SAA_BLKLEN     ((size_t)1 << SAA_BLKSHIFT)
+
+struct SAA *saa_init(size_t elem_len)
+{
+    struct SAA *s;
+    char *data;
+
+    s = nasm_zalloc(sizeof(struct SAA));
+
+    if (elem_len >= SAA_BLKLEN)
+        s->blk_len = elem_len;
+    else
+        s->blk_len = SAA_BLKLEN - (SAA_BLKLEN % elem_len);
+
+    s->elem_len = elem_len;
+    s->length = s->blk_len;
+    data = nasm_malloc(s->blk_len);
+    s->nblkptrs = s->nblks = 1;
+    s->blk_ptrs = nasm_malloc(sizeof(char *));
+    s->blk_ptrs[0] = data;
+    s->wblk = s->rblk = &s->blk_ptrs[0];
+
+    return s;
+}
+
+void saa_free(struct SAA *s)
+{
+    char **p;
+    size_t n;
+
+    for (p = s->blk_ptrs, n = s->nblks; n; p++, n--)
+        nasm_free(*p);
+
+    nasm_free(s->blk_ptrs);
+    nasm_free(s);
+}
+
+/* Add one allocation block to an SAA */
+static void saa_extend(struct SAA *s)
+{
+    size_t blkn = s->nblks++;
+
+    if (blkn >= s->nblkptrs) {
+        size_t rindex = s->rblk - s->blk_ptrs;
+        size_t windex = s->wblk - s->blk_ptrs;
+
+        s->nblkptrs <<= 1;
+        s->blk_ptrs =
+            nasm_realloc(s->blk_ptrs, s->nblkptrs * sizeof(char *));
+
+        s->rblk = s->blk_ptrs + rindex;
+        s->wblk = s->blk_ptrs + windex;
+    }
+
+    s->blk_ptrs[blkn] = nasm_malloc(s->blk_len);
+    s->length += s->blk_len;
+}
+
+void *saa_wstruct(struct SAA *s)
+{
+    void *p;
+
+    nasm_assert((s->wpos % s->elem_len) == 0);
+
+    if (s->wpos + s->elem_len > s->blk_len) {
+        nasm_assert(s->wpos == s->blk_len);
+        if (s->wptr + s->elem_len > s->length)
+            saa_extend(s);
+        s->wblk++;
+        s->wpos = 0;
+    }
+
+    p = *s->wblk + s->wpos;
+    s->wpos += s->elem_len;
+    s->wptr += s->elem_len;
+
+    if (s->wptr > s->datalen)
+        s->datalen = s->wptr;
+
+    return p;
+}
+
+void saa_wbytes(struct SAA *s, const void *data, size_t len)
+{
+    const char *d = data;
+
+    while (len) {
+        size_t l = s->blk_len - s->wpos;
+        if (l > len)
+            l = len;
+        if (l) {
+            if (d) {
+                memcpy(*s->wblk + s->wpos, d, l);
+                d += l;
+            } else
+                memset(*s->wblk + s->wpos, 0, l);
+            s->wpos += l;
+            s->wptr += l;
+            len -= l;
+
+            if (s->datalen < s->wptr)
+                s->datalen = s->wptr;
+        }
+        if (len) {
+            if (s->wptr >= s->length)
+                saa_extend(s);
+            s->wblk++;
+            s->wpos = 0;
+        }
+    }
+}
+
+void saa_rewind(struct SAA *s)
+{
+    s->rblk = s->blk_ptrs;
+    s->rpos = s->rptr = 0;
+}
+
+void *saa_rstruct(struct SAA *s)
+{
+    void *p;
+
+    if (s->rptr + s->elem_len > s->datalen)
+        return NULL;
+
+    nasm_assert((s->rpos % s->elem_len) == 0);
+
+    if (s->rpos + s->elem_len > s->blk_len) {
+        s->rblk++;
+        s->rpos = 0;
+    }
+
+    p = *s->rblk + s->rpos;
+    s->rpos += s->elem_len;
+    s->rptr += s->elem_len;
+
+    return p;
+}
+
+const void *saa_rbytes(struct SAA *s, size_t * lenp)
+{
+    const void *p;
+    size_t len;
+
+    if (s->rptr >= s->datalen) {
+        *lenp = 0;
+        return NULL;
+    }
+
+    if (s->rpos >= s->blk_len) {
+        s->rblk++;
+        s->rpos = 0;
+    }
+
+    len = *lenp;
+    if (len > s->datalen - s->rptr)
+        len = s->datalen - s->rptr;
+    if (len > s->blk_len - s->rpos)
+        len = s->blk_len - s->rpos;
+
+    *lenp = len;
+    p = *s->rblk + s->rpos;
+
+    s->rpos += len;
+    s->rptr += len;
+
+    return p;
+}
+
+void saa_rnbytes(struct SAA *s, void *data, size_t len)
+{
+    char *d = data;
+
+    nasm_assert(s->rptr + len <= s->datalen);
+
+    while (len) {
+        size_t l;
+        const void *p;
+
+        l = len;
+        p = saa_rbytes(s, &l);
+
+        memcpy(d, p, l);
+        d += l;
+        len -= l;
+    }
+}
+
+/* Same as saa_rnbytes, except position the counter first */
+void saa_fread(struct SAA *s, size_t posn, void *data, size_t len)
+{
+    size_t ix;
+
+    nasm_assert(posn + len <= s->datalen);
+
+    if (likely(s->blk_len == SAA_BLKLEN)) {
+        ix = posn >> SAA_BLKSHIFT;
+        s->rpos = posn & (SAA_BLKLEN - 1);
+    } else {
+        ix = posn / s->blk_len;
+        s->rpos = posn % s->blk_len;
+    }
+    s->rptr = posn;
+    s->rblk = &s->blk_ptrs[ix];
+
+    saa_rnbytes(s, data, len);
+}
+
+/* Same as saa_wbytes, except position the counter first */
+void saa_fwrite(struct SAA *s, size_t posn, const void *data, size_t len)
+{
+    size_t ix;
+
+    /* Seek beyond the end of the existing array not supported */
+    nasm_assert(posn <= s->datalen);
+
+    if (likely(s->blk_len == SAA_BLKLEN)) {
+        ix = posn >> SAA_BLKSHIFT;
+        s->wpos = posn & (SAA_BLKLEN - 1);
+    } else {
+        ix = posn / s->blk_len;
+        s->wpos = posn % s->blk_len;
+    }
+    s->wptr = posn;
+    s->wblk = &s->blk_ptrs[ix];
+
+    if (!s->wpos) {
+        s->wpos = s->blk_len;
+        s->wblk--;
+    }
+
+    saa_wbytes(s, data, len);
+}
+
+void saa_fpwrite(struct SAA *s, FILE * fp)
+{
+    const char *data;
+    size_t len;
+
+    saa_rewind(s);
+    while (len = s->datalen, (data = saa_rbytes(s, &len)) != NULL)
+        fwrite(data, 1, len, fp);
+}
+
+void saa_write8(struct SAA *s, uint8_t v)
+{
+    saa_wbytes(s, &v, 1);
+}
+
+#ifdef WORDS_LITTEENDIAN
+
+void saa_write16(struct SAA *s, uint16_t v)
+{
+    saa_wbytes(s, &v, 2);
+}
+
+void saa_write32(struct SAA *s, uint32_t v)
+{
+    saa_wbytes(s, &v, 4);
+}
+
+void saa_write64(struct SAA *s, uint64_t v)
+{
+    saa_wbytes(s, &v, 8);
+}
+
+void saa_writeaddr(struct SAA *s, uint64_t v, size_t len)
+{
+    saa_wbytes(s, &v, len);
+}
+
+#else                           /* not WORDS_LITTLEENDIAN */
+
+void saa_write16(struct SAA *s, uint16_t v)
+{
+    uint8_t b[2];
+
+    b[0] = v;
+    b[1] = v >> 8;
+    saa_wbytes(s, b, 2);
+}
+
+void saa_write32(struct SAA *s, uint32_t v)
+{
+    uint8_t b[4];
+
+    b[0] = v;
+    b[1] = v >> 8;
+    b[2] = v >> 16;
+    b[3] = v >> 24;
+    saa_wbytes(s, b, 4);
+}
+
+void saa_write64(struct SAA *s, uint64_t v)
+{
+    uint8_t b[8];
+
+    b[0] = v;
+    b[1] = v >> 8;
+    b[2] = v >> 16;
+    b[3] = v >> 24;
+    b[4] = v >> 32;
+    b[5] = v >> 40;
+    b[6] = v >> 48;
+    b[7] = v >> 56;
+    saa_wbytes(s, b, 8);
+}
+
+void saa_writeaddr(struct SAA *s, uint64_t v, size_t len)
+{
+    uint8_t b[8];
+
+    b[0] = v;
+    b[1] = v >> 8;
+    b[2] = v >> 16;
+    b[3] = v >> 24;
+    b[4] = v >> 32;
+    b[5] = v >> 40;
+    b[6] = v >> 48;
+    b[7] = v >> 56;
+
+    saa_wbytes(s, &v, len);
+}
+
+#endif                          /* WORDS_LITTLEENDIAN */
+
+/* write unsigned LEB128 value to SAA */
+void saa_wleb128u(struct SAA *psaa, int value)
+{
+    char temp[64], *ptemp;
+    uint8_t byte;
+    int len;
+
+    ptemp = temp;
+    len = 0;
+    do {
+        byte = value & 127;
+        value >>= 7;
+        if (value != 0)         /* more bytes to come */
+            byte |= 0x80;
+        *ptemp = byte;
+        ptemp++;
+        len++;
+    } while (value != 0);
+    saa_wbytes(psaa, temp, len);
+}
+
+/* write signed LEB128 value to SAA */
+void saa_wleb128s(struct SAA *psaa, int value)
+{
+    char temp[64], *ptemp;
+    uint8_t byte;
+    bool more, negative;
+    int size, len;
+
+    ptemp = temp;
+    more = 1;
+    negative = (value < 0);
+    size = sizeof(int) * 8;
+    len = 0;
+    while (more) {
+        byte = value & 0x7f;
+        value >>= 7;
+        if (negative)
+            /* sign extend */
+            value |= -(1 << (size - 7));
+        /* sign bit of byte is second high order bit (0x40) */
+        if ((value == 0 && !(byte & 0x40)) ||
+            ((value == -1) && (byte & 0x40)))
+            more = 0;
+        else
+            byte |= 0x80;
+        *ptemp = byte;
+        ptemp++;
+        len++;
+    }
+    saa_wbytes(psaa, temp, len);
+}
diff --git a/saa.h b/saa.h
new file mode 100644 (file)
index 0000000..8a8bd07
--- /dev/null
+++ b/saa.h
@@ -0,0 +1,93 @@
+/* ----------------------------------------------------------------------- *
+ *   
+ *   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.
+ *
+ * ----------------------------------------------------------------------- */
+
+#ifndef NASM_SAA_H
+#define NASM_SAA_H
+
+#include "compiler.h"
+
+/*
+ * Routines to manage a dynamic sequential-access array, under the
+ * same restriction on maximum mallocable block. This array may be
+ * written to in two ways: a contiguous chunk can be reserved of a
+ * given size with a pointer returned OR single-byte data may be
+ * written. The array can also be read back in the same two ways:
+ * as a series of big byte-data blocks or as a list of structures
+ * of a given size.
+ */
+
+struct SAA {
+    /*
+     * members `end' and `elem_len' are only valid in first link in
+     * list; `rptr' and `rpos' are used for reading
+     */
+    size_t elem_len;            /* Size of each element */
+    size_t blk_len;             /* Size of each allocation block */
+    size_t nblks;               /* Total number of allocated blocks */
+    size_t nblkptrs;            /* Total number of allocation block pointers */
+    size_t length;              /* Total allocated length of the array */
+    size_t datalen;             /* Total data length of the array */
+    char **wblk;                /* Write block pointer */
+    size_t wpos;                /* Write position inside block */
+    size_t wptr;                /* Absolute write position */
+    char **rblk;                /* Read block pointer */
+    size_t rpos;                /* Read position inside block */
+    size_t rptr;                /* Absolute read position */
+    char **blk_ptrs;            /* Pointer to pointer blocks */
+};
+
+struct SAA *saa_init(size_t elem_len);  /* 1 == byte */
+void saa_free(struct SAA *);
+void *saa_wstruct(struct SAA *);        /* return a structure of elem_len */
+void saa_wbytes(struct SAA *, const void *, size_t);    /* write arbitrary bytes */
+void saa_rewind(struct SAA *);  /* for reading from beginning */
+void *saa_rstruct(struct SAA *);        /* return NULL on EOA */
+const void *saa_rbytes(struct SAA *, size_t *); /* return 0 on EOA */
+void saa_rnbytes(struct SAA *, void *, size_t); /* read a given no. of bytes */
+/* random access */
+void saa_fread(struct SAA *, size_t, void *, size_t);
+void saa_fwrite(struct SAA *, size_t, const void *, size_t);
+
+/* dump to file */
+void saa_fpwrite(struct SAA *, FILE *);
+
+/* Write specific-sized values */
+void saa_write8(struct SAA *s, uint8_t v);
+void saa_write16(struct SAA *s, uint16_t v);
+void saa_write32(struct SAA *s, uint32_t v);
+void saa_write64(struct SAA *s, uint64_t v);
+void saa_wleb128u(struct SAA *, int);   /* write unsigned LEB128 value */
+void saa_wleb128s(struct SAA *, int);   /* write signed LEB128 value */
+void saa_writeaddr(struct SAA *, uint64_t, size_t);
+
+#endif                          /* NASM_SAA_H */
diff --git a/standard.mac b/standard.mac
new file mode 100644 (file)
index 0000000..a3e8eea
--- /dev/null
@@ -0,0 +1,189 @@
+;; --------------------------------------------------------------------------
+;;   
+;;   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.
+;;
+;; --------------------------------------------------------------------------
+
+; Standard macro set for NASM -*- nasm -*-
+
+; Macros to make NASM ignore some TASM directives before the first include
+; directive.
+
+    %idefine IDEAL
+    %idefine JUMPS
+    %idefine P386
+    %idefine P486
+    %idefine P586
+    %idefine END
+
+; This is a magic token which indicates the end of the TASM macros
+*END*TASM*MACROS*
+
+; Note that although some user-level forms of directives are defined
+; here, not all of them are: the user-level form of a format-specific
+; directive should be defined in the module for that directive.
+
+; These three need to be defined, though the actual definitions will
+; be constantly updated during preprocessing.
+%define __FILE__
+%define __LINE__
+%define __BITS__
+
+%define __SECT__               ; it ought to be defined, even if as nothing
+
+%imacro section 1+.nolist
+%define __SECT__ [section %1]
+         __SECT__
+%endmacro
+%imacro segment 1+.nolist
+%define __SECT__ [segment %1]
+         __SECT__
+%endmacro
+
+%imacro absolute 1+.nolist
+%define __SECT__ [absolute %1]
+         __SECT__
+%endmacro
+
+%imacro struc 1-2.nolist 0
+%push
+%define %$strucname %1
+[absolute %2]
+%$strucname:                   ; allow definition of `.member' to work sanely
+%endmacro
+%imacro endstruc 0.nolist
+%{$strucname}_size equ ($-%$strucname)
+%pop
+__SECT__
+%endmacro
+
+%imacro istruc 1.nolist
+%push
+%define %$strucname %1
+%$strucstart:
+%endmacro
+%imacro at 1-2+.nolist
+         times (%1-%$strucname)-($-%$strucstart) db 0
+         %2
+%endmacro
+%imacro iend 0.nolist
+         times %{$strucname}_size-($-%$strucstart) db 0
+%pop
+%endmacro
+
+%imacro align 1-2+.nolist nop
+         times (((%1) - (($-$$) % (%1))) % (%1)) %2
+%endmacro
+%imacro alignb 1-2+.nolist
+         %ifempty %2
+               resb (((%1) - (($-$$) % (%1))) % (%1))
+         %else
+               times (((%1) - (($-$$) % (%1))) % (%1)) %2
+         %endif
+%endmacro
+
+%imacro extern 1-*.nolist
+%rep %0
+[extern %1]
+%rotate 1
+%endrep
+%endmacro
+
+%imacro bits 1+.nolist
+[bits %1]
+%endmacro
+
+%imacro use16 0.nolist
+[bits 16]
+%endmacro
+%imacro use32 0.nolist
+[bits 32]
+%endmacro
+%imacro use64 0.nolist
+[bits 64]
+%endmacro
+
+%imacro global 1-*.nolist
+%rep %0
+[global %1]
+%rotate 1
+%endrep
+%endmacro
+
+%imacro common 1-*.nolist
+%rep %0
+[common %1]
+%rotate 1
+%endrep
+%endmacro
+
+%imacro cpu 1+.nolist
+[cpu %1]
+%endmacro
+
+%define __FLOAT_DAZ__ nodaz
+%define __FLOAT_ROUND__ near
+; __FLOAT__ contains the whole floating-point configuration so it can
+; be saved and restored
+%define __FLOAT__ __FLOAT_DAZ__,__FLOAT_ROUND__
+%imacro float 1-*.nolist
+%rep %0
+[float %1]
+%ifidni %1,daz
+%define __FLOAT_DAZ__ daz
+%elifidni %1,nodaz
+%define __FLOAT_DAZ__ nodaz
+%elifidni %1,near
+%define __FLOAT_ROUND__ near
+%elifidni %1,up
+%define __FLOAT_ROUND__ up
+%elifidni %1,down
+%define __FLOAT_ROUND__ down
+%elifidni %1,zero
+%define __FLOAT_ROUND__ zero
+%elifidni %1,default
+%define __FLOAT_DAZ__ nodaz
+%define __FLOAT_ROUND__ near
+%endif
+%rotate 1
+%endrep
+%endmacro
+
+%imacro default 1+.nolist
+[default %1]
+%endmacro
+
+%imacro incbin 1-2+.nolist 0
+%push
+%pathsearch %$dep %1
+%depend %$dep
+       %? %$dep,%2
+%pop
+%endmacro
diff --git a/stdscan.c b/stdscan.c
new file mode 100644 (file)
index 0000000..b7d8000
--- /dev/null
+++ b/stdscan.c
@@ -0,0 +1,272 @@
+/* ----------------------------------------------------------------------- *
+ *
+ *   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.
+ *
+ * ----------------------------------------------------------------------- */
+
+#include "compiler.h"
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <ctype.h>
+#include <inttypes.h>
+
+#include "nasm.h"
+#include "nasmlib.h"
+#include "quote.h"
+#include "stdscan.h"
+#include "insns.h"
+
+/*
+ * Standard scanner routine used by parser.c and some output
+ * formats. It keeps a succession of temporary-storage strings in
+ * stdscan_tempstorage, which can be cleared using stdscan_reset.
+ */
+static char *stdscan_bufptr = NULL;
+static char **stdscan_tempstorage = NULL;
+static int stdscan_tempsize = 0, stdscan_templen = 0;
+#define STDSCAN_TEMP_DELTA 256
+
+void stdscan_set(char *str)
+{
+        stdscan_bufptr = str;
+}
+
+char *stdscan_get(void)
+{
+        return stdscan_bufptr;
+}
+
+static void stdscan_pop(void)
+{
+    nasm_free(stdscan_tempstorage[--stdscan_templen]);
+}
+
+void stdscan_reset(void)
+{
+    while (stdscan_templen > 0)
+        stdscan_pop();
+}
+
+/*
+ * Unimportant cleanup is done to avoid confusing people who are trying
+ * to debug real memory leaks
+ */
+void stdscan_cleanup(void)
+{
+    stdscan_reset();
+    nasm_free(stdscan_tempstorage);
+}
+
+static char *stdscan_copy(char *p, int len)
+{
+    char *text;
+
+    text = nasm_malloc(len + 1);
+    memcpy(text, p, len);
+    text[len] = '\0';
+
+    if (stdscan_templen >= stdscan_tempsize) {
+        stdscan_tempsize += STDSCAN_TEMP_DELTA;
+        stdscan_tempstorage = nasm_realloc(stdscan_tempstorage,
+                                           stdscan_tempsize *
+                                           sizeof(char *));
+    }
+    stdscan_tempstorage[stdscan_templen++] = text;
+
+    return text;
+}
+
+int stdscan(void *private_data, struct tokenval *tv)
+{
+    char ourcopy[MAX_KEYWORD + 1], *r, *s;
+
+    (void)private_data;         /* Don't warn that this parameter is unused */
+
+    stdscan_bufptr = nasm_skip_spaces(stdscan_bufptr);
+    if (!*stdscan_bufptr)
+        return tv->t_type = TOKEN_EOS;
+
+    /* we have a token; either an id, a number or a char */
+    if (isidstart(*stdscan_bufptr) ||
+        (*stdscan_bufptr == '$' && isidstart(stdscan_bufptr[1]))) {
+        /* now we've got an identifier */
+        bool is_sym = false;
+
+        if (*stdscan_bufptr == '$') {
+            is_sym = true;
+            stdscan_bufptr++;
+        }
+
+        r = stdscan_bufptr++;
+        /* read the entire buffer to advance the buffer pointer but... */
+        while (isidchar(*stdscan_bufptr))
+            stdscan_bufptr++;
+
+        /* ... copy only up to IDLEN_MAX-1 characters */
+        tv->t_charptr = stdscan_copy(r, stdscan_bufptr - r < IDLEN_MAX ?
+                                     stdscan_bufptr - r : IDLEN_MAX - 1);
+
+        if (is_sym || stdscan_bufptr - r > MAX_KEYWORD)
+            return tv->t_type = TOKEN_ID;       /* bypass all other checks */
+
+        for (s = tv->t_charptr, r = ourcopy; *s; s++)
+            *r++ = nasm_tolower(*s);
+        *r = '\0';
+        /* right, so we have an identifier sitting in temp storage. now,
+         * is it actually a register or instruction name, or what? */
+        return nasm_token_hash(ourcopy, tv);
+    } else if (*stdscan_bufptr == '$' && !isnumchar(stdscan_bufptr[1])) {
+        /*
+         * It's a $ sign with no following hex number; this must
+         * mean it's a Here token ($), evaluating to the current
+         * assembly location, or a Base token ($$), evaluating to
+         * the base of the current segment.
+         */
+        stdscan_bufptr++;
+        if (*stdscan_bufptr == '$') {
+            stdscan_bufptr++;
+            return tv->t_type = TOKEN_BASE;
+        }
+        return tv->t_type = TOKEN_HERE;
+    } else if (isnumstart(*stdscan_bufptr)) {   /* now we've got a number */
+        bool rn_error;
+        bool is_hex = false;
+        bool is_float = false;
+        bool has_e = false;
+        char c;
+
+        r = stdscan_bufptr;
+
+        if (*stdscan_bufptr == '$') {
+            stdscan_bufptr++;
+            is_hex = true;
+        }
+
+        for (;;) {
+            c = *stdscan_bufptr++;
+
+            if (!is_hex && (c == 'e' || c == 'E')) {
+                has_e = true;
+                if (*stdscan_bufptr == '+' || *stdscan_bufptr == '-') {
+                    /*
+                     * e can only be followed by +/- if it is either a
+                     * prefixed hex number or a floating-point number
+                     */
+                    is_float = true;
+                    stdscan_bufptr++;
+                }
+            } else if (c == 'H' || c == 'h' || c == 'X' || c == 'x') {
+                is_hex = true;
+            } else if (c == 'P' || c == 'p') {
+                is_float = true;
+                if (*stdscan_bufptr == '+' || *stdscan_bufptr == '-')
+                    stdscan_bufptr++;
+            } else if (isnumchar(c) || c == '_')
+                ; /* just advance */
+            else if (c == '.')
+                is_float = true;
+            else
+                break;
+        }
+        stdscan_bufptr--;       /* Point to first character beyond number */
+
+        if (has_e && !is_hex) {
+            /* 1e13 is floating-point, but 1e13h is not */
+            is_float = true;
+        }
+
+        if (is_float) {
+            tv->t_charptr = stdscan_copy(r, stdscan_bufptr - r);
+            return tv->t_type = TOKEN_FLOAT;
+        } else {
+            r = stdscan_copy(r, stdscan_bufptr - r);
+            tv->t_integer = readnum(r, &rn_error);
+            stdscan_pop();
+            if (rn_error) {
+                /* some malformation occurred */
+                return tv->t_type = TOKEN_ERRNUM;
+            }
+            tv->t_charptr = NULL;
+            return tv->t_type = TOKEN_NUM;
+        }
+    } else if (*stdscan_bufptr == '\'' || *stdscan_bufptr == '"' ||
+               *stdscan_bufptr == '`') {
+        /* a quoted string */
+        char start_quote = *stdscan_bufptr;
+        tv->t_charptr = stdscan_bufptr;
+        tv->t_inttwo = nasm_unquote(tv->t_charptr, &stdscan_bufptr);
+        if (*stdscan_bufptr != start_quote)
+            return tv->t_type = TOKEN_ERRSTR;
+        stdscan_bufptr++;       /* Skip final quote */
+        return tv->t_type = TOKEN_STR;
+    } else if (*stdscan_bufptr == ';') {
+        /* a comment has happened - stay */
+        return tv->t_type = TOKEN_EOS;
+    } else if (stdscan_bufptr[0] == '>' && stdscan_bufptr[1] == '>') {
+        stdscan_bufptr += 2;
+        return tv->t_type = TOKEN_SHR;
+    } else if (stdscan_bufptr[0] == '<' && stdscan_bufptr[1] == '<') {
+        stdscan_bufptr += 2;
+        return tv->t_type = TOKEN_SHL;
+    } else if (stdscan_bufptr[0] == '/' && stdscan_bufptr[1] == '/') {
+        stdscan_bufptr += 2;
+        return tv->t_type = TOKEN_SDIV;
+    } else if (stdscan_bufptr[0] == '%' && stdscan_bufptr[1] == '%') {
+        stdscan_bufptr += 2;
+        return tv->t_type = TOKEN_SMOD;
+    } else if (stdscan_bufptr[0] == '=' && stdscan_bufptr[1] == '=') {
+        stdscan_bufptr += 2;
+        return tv->t_type = TOKEN_EQ;
+    } else if (stdscan_bufptr[0] == '<' && stdscan_bufptr[1] == '>') {
+        stdscan_bufptr += 2;
+        return tv->t_type = TOKEN_NE;
+    } else if (stdscan_bufptr[0] == '!' && stdscan_bufptr[1] == '=') {
+        stdscan_bufptr += 2;
+        return tv->t_type = TOKEN_NE;
+    } else if (stdscan_bufptr[0] == '<' && stdscan_bufptr[1] == '=') {
+        stdscan_bufptr += 2;
+        return tv->t_type = TOKEN_LE;
+    } else if (stdscan_bufptr[0] == '>' && stdscan_bufptr[1] == '=') {
+        stdscan_bufptr += 2;
+        return tv->t_type = TOKEN_GE;
+    } else if (stdscan_bufptr[0] == '&' && stdscan_bufptr[1] == '&') {
+        stdscan_bufptr += 2;
+        return tv->t_type = TOKEN_DBL_AND;
+    } else if (stdscan_bufptr[0] == '^' && stdscan_bufptr[1] == '^') {
+        stdscan_bufptr += 2;
+        return tv->t_type = TOKEN_DBL_XOR;
+    } else if (stdscan_bufptr[0] == '|' && stdscan_bufptr[1] == '|') {
+        stdscan_bufptr += 2;
+        return tv->t_type = TOKEN_DBL_OR;
+    } else                      /* just an ordinary char */
+        return tv->t_type = (uint8_t)(*stdscan_bufptr++);
+}
diff --git a/stdscan.h b/stdscan.h
new file mode 100644 (file)
index 0000000..8dbc2d0
--- /dev/null
+++ b/stdscan.h
@@ -0,0 +1,49 @@
+/* ----------------------------------------------------------------------- *
+ *   
+ *   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.
+ *
+ * ----------------------------------------------------------------------- */
+
+/* 
+ * stdscan.h   header file for stdscan.c
+ */
+
+#ifndef NASM_STDSCAN_H
+#define NASM_STDSCAN_H
+
+/* Standard scanner */
+void stdscan_set(char *str);
+char *stdscan_get(void);
+void stdscan_reset(void);
+int stdscan(void *private_data, struct tokenval *tv);
+int nasm_token_hash(const char *token, struct tokenval *tv);
+void stdscan_cleanup(void);
+
+#endif
diff --git a/strfunc.c b/strfunc.c
new file mode 100644 (file)
index 0000000..a34f738
--- /dev/null
+++ b/strfunc.c
@@ -0,0 +1,203 @@
+/* ----------------------------------------------------------------------- *
+ *   
+ *   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.
+ *
+ * ----------------------------------------------------------------------- */
+
+/*
+ * strfunc.c
+ *
+ * String transformation functions
+ */
+
+#include "nasmlib.h"
+#include "nasm.h"
+
+/*
+ * Convert a string in UTF-8 format to UTF-16LE
+ */
+static size_t utf8_to_16le(uint8_t *str, size_t len, char *op)
+{
+#define EMIT(x) do { if (op) { WRITESHORT(op,x); } outlen++; } while(0)
+
+    size_t outlen = 0;
+    int expect = 0;
+    uint8_t c;
+    uint32_t v = 0, vmin = 0;
+
+    while (len--) {
+       c = *str++;
+
+       if (expect) {
+           if ((c & 0xc0) != 0x80) {
+               expect = 0;
+               return -1;
+           } else {
+               v = (v << 6) | (c & 0x3f);
+               if (!--expect) {
+                   if (v < vmin || v > 0x10ffff ||
+                       (v >= 0xd800 && v <= 0xdfff)) {
+                       return -1;
+                   } else if (v > 0xffff) {
+                       v -= 0x10000;
+                       EMIT(0xd800 | (v >> 10));
+                       EMIT(0xdc00 | (v & 0x3ff));
+                   } else {
+                       EMIT(v);
+                   }
+               }
+               continue;
+           }
+       }
+
+       if (c < 0x80) {
+           EMIT(c);
+       } else if (c < 0xc0 || c >= 0xfe) {
+           /* Invalid UTF-8 */
+           return -1;
+       } else if (c < 0xe0) {
+           v = c & 0x1f;
+           expect = 1;
+           vmin = 0x80;
+       } else if (c < 0xf0) {
+           v = c & 0x0f;
+           expect = 2;
+           vmin = 0x800;
+       } else if (c < 0xf8) {
+           v = c & 0x07;
+           expect = 3;
+           vmin = 0x10000;
+       } else if (c < 0xfc) {
+           v = c & 0x03;
+           expect = 4;
+           vmin = 0x200000;
+       } else {
+           v = c & 0x01;
+           expect = 5;
+           vmin = 0x4000000;
+       }
+    }
+
+    return expect ? (size_t)-1 : outlen << 1;
+
+#undef EMIT
+}
+
+/*
+ * Convert a string in UTF-8 format to UTF-32LE
+ */
+static size_t utf8_to_32le(uint8_t *str, size_t len, char *op)
+{
+#define EMIT(x) do { if (op) { WRITELONG(op,x); } outlen++; } while(0)
+
+    size_t outlen = 0;
+    int expect = 0;
+    uint8_t c;
+    uint32_t v = 0, vmin = 0;
+
+    while (len--) {
+       c = *str++;
+
+       if (expect) {
+           if ((c & 0xc0) != 0x80) {
+               return -1;
+           } else {
+               v = (v << 6) | (c & 0x3f);
+               if (!--expect) {
+                   if (v < vmin || (v >= 0xd800 && v <= 0xdfff)) {
+                       return -1;
+                   } else {
+                       EMIT(v);
+                   }
+               }
+               continue;
+           }
+       }
+
+       if (c < 0x80) {
+           EMIT(c);
+       } else if (c < 0xc0 || c >= 0xfe) {
+           /* Invalid UTF-8 */
+           return -1;
+       } else if (c < 0xe0) {
+           v = c & 0x1f;
+           expect = 1;
+           vmin = 0x80;
+       } else if (c < 0xf0) {
+           v = c & 0x0f;
+           expect = 2;
+           vmin = 0x800;
+       } else if (c < 0xf8) {
+           v = c & 0x07;
+           expect = 3;
+           vmin = 0x10000;
+       } else if (c < 0xfc) {
+           v = c & 0x03;
+           expect = 4;
+           vmin = 0x200000;
+       } else {
+           v = c & 0x01;
+           expect = 5;
+           vmin = 0x4000000;
+       }
+    }
+
+    return expect ? (size_t)-1 : outlen << 2;
+
+#undef EMIT
+}
+
+typedef size_t (*transform_func)(uint8_t *, size_t, char *);
+
+/*
+ * Apply a specific string transform and return it in a nasm_malloc'd
+ * buffer, returning the length.  On error, returns (size_t)-1 and no
+ * buffer is allocated.
+ */
+size_t string_transform(char *str, size_t len, char **out, enum strfunc func)
+{
+    /* This should match enum strfunc in nasm.h */
+    static const transform_func str_transforms[] = {
+       utf8_to_16le,
+       utf8_to_32le,
+    };
+    transform_func transform = str_transforms[func];
+    size_t outlen;
+    uint8_t *s = (uint8_t *)str;
+    char *buf;
+
+    outlen = transform(s, len, NULL);
+    if (outlen == (size_t)-1)
+       return -1;
+
+    *out = buf = nasm_malloc(outlen+1);
+    buf[outlen] = '\0';                /* Forcibly null-terminate the buffer */
+    return transform(s, len, buf);
+}
diff --git a/sync.c b/sync.c
new file mode 100644 (file)
index 0000000..b1a7031
--- /dev/null
+++ b/sync.c
@@ -0,0 +1,133 @@
+/* ----------------------------------------------------------------------- *
+ *
+ *   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.
+ *
+ * ----------------------------------------------------------------------- */
+
+/*
+ * sync.c   the Netwide Disassembler synchronisation processing module
+ */
+
+#include "compiler.h"
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <limits.h>
+#include <inttypes.h>
+
+#include "nasmlib.h"
+#include "sync.h"
+
+#define SYNC_MAX_SHIFT          31
+#define SYNC_MAX_SIZE           (1U << SYNC_MAX_SHIFT)
+
+/* initial # of sync points (*must* be power of two)*/
+#define SYNC_INITIAL_CHUNK      (1U << 12)
+
+/*
+ * This lot manages the current set of sync points by means of a
+ * heap (priority queue) structure.
+ */
+
+static struct Sync {
+    uint32_t pos;
+    uint32_t length;
+} *synx;
+
+static uint32_t max_synx, nsynx;
+
+static inline void swap_sync(uint32_t dst, uint32_t src)
+{
+    struct Sync t = synx[dst];
+    synx[dst] = synx[src];
+    synx[src] = t;
+}
+
+void init_sync(void)
+{
+    max_synx = SYNC_INITIAL_CHUNK;
+    synx = nasm_malloc((max_synx + 1) * sizeof(*synx));
+    nsynx = 0;
+}
+
+void add_sync(uint32_t pos, uint32_t length)
+{
+    uint32_t i;
+
+    if (nsynx >= max_synx) {
+        if (max_synx >= SYNC_MAX_SIZE) /* too many sync points! */
+            return;
+        max_synx = (max_synx << 1);
+        synx = nasm_realloc(synx, (max_synx + 1) * sizeof(*synx));
+    }
+
+    nsynx++;
+    synx[nsynx].pos = pos;
+    synx[nsynx].length = length;
+
+    for (i = nsynx; i > 1; i /= 2) {
+        if (synx[i / 2].pos > synx[i].pos)
+            swap_sync(i / 2, i);
+    }
+}
+
+uint32_t next_sync(uint32_t position, uint32_t *length)
+{
+    while (nsynx > 0 && synx[1].pos + synx[1].length <= position) {
+        uint32_t i, j;
+
+        swap_sync(nsynx, 1);
+        nsynx--;
+
+        i = 1;
+        while (i * 2 <= nsynx) {
+            j = i * 2;
+            if (synx[j].pos < synx[i].pos &&
+                (j + 1 > nsynx || synx[j + 1].pos > synx[j].pos)) {
+                swap_sync(j, i);
+                i = j;
+            } else if (j + 1 <= nsynx && synx[j + 1].pos < synx[i].pos) {
+                swap_sync(j + 1, i);
+                i = j + 1;
+            } else
+                break;
+        }
+    }
+
+    if (nsynx > 0) {
+        if (length)
+            *length = synx[1].length;
+        return synx[1].pos;
+    } else {
+        if (length)
+            *length = 0L;
+        return 0;
+    }
+}
diff --git a/sync.h b/sync.h
new file mode 100644 (file)
index 0000000..27d8e8b
--- /dev/null
+++ b/sync.h
@@ -0,0 +1,45 @@
+/* ----------------------------------------------------------------------- *
+ *   
+ *   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.
+ *
+ * ----------------------------------------------------------------------- */
+
+/* 
+ * sync.h   header file for sync.c
+ */
+
+#ifndef NASM_SYNC_H
+#define NASM_SYNC_H
+
+void init_sync(void);
+void add_sync(uint32_t position, uint32_t length);
+uint32_t next_sync(uint32_t position, uint32_t *length);
+
+#endif
diff --git a/syncfiles.pl b/syncfiles.pl
new file mode 100755 (executable)
index 0000000..4da87f9
--- /dev/null
@@ -0,0 +1,126 @@
+#!/usr/bin/perl
+## --------------------------------------------------------------------------
+##   
+##   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.
+##
+## --------------------------------------------------------------------------
+
+#
+# Sync the output file list between Makefiles
+# Use the mkdep.pl parameters to get the filename syntax
+#
+# The first file is the source file; the other ones target.
+#
+%def_hints = ('object-ending' => '.o',
+             'path-separator' => '/',
+             'continuation' => "\\");
+
+sub do_transform($$) {
+    my($l, $h) = @_;
+    my($ps) = $$h{'path-separator'};
+
+    $l =~ s/\x01/$$h{'object-ending'}/g;
+    $l =~ s/\x03/$$h{'continuation'}/g;
+
+    if ($ps eq '') {
+       # Remove the path separator and the preceeding directory
+       $l =~ s/[^\s\=]*\x02//g;
+    } else {
+       # Convert the path separator
+       $l =~ s/\x02/$ps/g;
+    }
+
+    return $l;
+}
+
+@file_list = ();
+
+$first = 1;
+$first_file = $ARGV[0];
+die unless (defined($first_file));
+
+foreach $file (@ARGV) {
+    open(FILE, "< $file\0") or die;
+
+    # First, read the syntax hints
+    %hints = %def_hints;
+    while (defined($line = <FILE>)) {
+       if ( $line =~ /^\s*\#\s*@([a-z0-9-]+):\s*\"([^\"]*)\"/ ) {
+           $hints{$1} = $2;
+       }
+    }
+
+    # Read and process the file
+    seek(FILE,0,0);
+    @lines = ();
+    $processing = 0;
+    while (defined($line = <FILE>)) {
+       chomp $line;
+       if ($processing) {
+           if ($line eq '#-- End File Lists --#') {
+               push(@lines, $line."\n");
+               $processing = 0;
+           } elsif ($first) {
+               my $xl = $line;
+               my $oe = "\Q$hints{'object-ending'}";
+               my $ps = "\Q$hints{'path-separator'}";
+               my $cn = "\Q$hints{'continuation'}";
+
+               $xl =~ s/${oe}(\s|$)/\x01$1/g;
+               $xl =~ s/${ps}/\x02/g;
+               $xl =~ s/${cn}$/\x03/;
+               push(@file_list, $xl);
+               push(@lines, $line);
+           }
+       } else {
+           push(@lines, $line."\n");
+           if ($line eq '#-- Begin File Lists --#') {
+               $processing = 1;
+               if (!$first) {
+                   push(@lines, "# Edit in $first_file, not here!\n");
+                   foreach $l (@file_list) {
+                       push(@lines, do_transform($l, \%hints)."\n");
+                   }
+               }
+           }
+       }
+    }
+    close(FILE);
+
+    # Write the file back out
+    if (!$first) {
+       open(FILE, "> $file\0") or die;
+       print FILE @lines;
+       close(FILE);
+    }
+
+    undef @lines;
+    $first = 0;
+}
diff --git a/tables.h b/tables.h
new file mode 100644 (file)
index 0000000..e6f84cb
--- /dev/null
+++ b/tables.h
@@ -0,0 +1,69 @@
+/* ----------------------------------------------------------------------- *
+ *   
+ *   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.
+ *
+ * ----------------------------------------------------------------------- */
+
+/*
+ * tables.h
+ *
+ * Declarations for auto-generated tables
+ */
+
+#ifndef NASM_TABLES_H
+#define NASM_TABLES_H
+
+#include "compiler.h"
+#include <inttypes.h>
+#include "insnsi.h"            /* For enum opcode */
+#include "opflags.h"           /* For opflags_t */
+
+/* --- From standard.mac via macros.pl: --- */
+
+/* macros.c */
+extern const unsigned char nasm_stdmac[];
+extern const unsigned char * const nasm_stdmac_after_tasm;
+const unsigned char *nasm_stdmac_find_package(const char *);
+
+/* --- From insns.dat via insns.pl: --- */
+
+/* insnsn.c */
+extern const char * const nasm_insn_names[];
+
+/* --- From regs.dat via regs.pl: --- */
+
+/* regs.c */
+extern const char * const nasm_reg_names[];
+/* regflags.c */
+extern const opflags_t nasm_reg_flags[];
+/* regvals.c */
+extern const int nasm_regvals[];
+
+#endif /* NASM_TABLES_H */
diff --git a/test/Makefile b/test/Makefile
new file mode 100644 (file)
index 0000000..8b51359
--- /dev/null
@@ -0,0 +1,91 @@
+.SUFFIXES: .bin .o .o64 .obj .obj64 .exe .asm .lst .pl
+
+NASM   = ../nasm
+NASMOPT = -Ox -I../misc $(OPT)
+PERL   = perl
+TESTS  = $(wildcard *.asm)
+
+%.bin: %.asm $(NASM)
+       $(NASM) $(NASMOPT) -f bin -o $@ -l $*.lst $<
+
+%.ith: %.asm $(NASM)
+       $(NASM) $(NASMOPT) -f ith -o $@ -l $*.lst $<
+
+%.srec: %.asm $(NASM)
+       $(NASM) $(NASMOPT) -f srec -o $@ -l $*.lst $<
+
+%.o: %.asm $(NASM)
+       $(NASM) $(NASMOPT) -f elf32 -o $@ -l $*.lst $<
+
+%.o64: %.asm $(NASM)
+       $(NASM) $(NASMOPT) -f elf64 -o $@ -l $*.lst $<
+
+%.obj: %.asm $(NASM)
+       $(NASM) $(NASMOPT) -f obj -o $@ -l $*.lst $<
+
+%.coff: %.asm $(NASM)
+       $(NASM) $(NASMOPT) -f coff -o $@ -l $*.lst $<
+
+%.win32: %.asm $(NASM)
+       $(NASM) $(NASMOPT) -f win32 -o $@ -l $*.lst $<
+
+%.win64: %.asm $(NASM)
+       $(NASM) $(NASMOPT) -f win64 -o $@ -l $*.lst $<
+
+%.mo32: %.asm $(NASM)
+       $(NASM) $(NASMOPT) -f macho32 -o $@ -l $*.lst $<
+
+%.mo64: %.asm $(NASM)
+       $(NASM) $(NASMOPT) -f macho64 -o $@ -l $*.lst $<
+
+%.dbg: %.asm $(NASM)
+       $(NASM) $(NASMOPT) -f dbg -o $@ -l $*.lst $<
+
+%.asm: %.pl
+       $(PERL) $< > $@
+
+all:
+
+golden: performtest.pl $(TESTS)
+       $(PERL) performtest.pl --golden --nasm='$(NASM)' $(TESTS)
+
+test:  performtest.pl $(NASM) $(TESTS)
+       $(PERL) performtest.pl --nasm='$(NASM)' $(TESTS)
+
+diff:  performtest.pl $(NASM) $(TESTS)
+       $(PERL) performtest.pl --diff --nasm='$(NASM)' $(TESTS)
+
+clean:
+       rm -f *.com *.o *.o64 *.obj *.win32 *.win64 *.exe *.lst *.bin
+       rm -f *.dbg *.coff *.ith *.srec *.mo32 *.mo64
+       rm -rf testresults
+       rm -f elftest elftest64
+
+spotless: clean
+       rm -rf golden
+
+#
+# Test for ELF32 shared libraries; assumes an x86 Linux system
+#
+elfso.o: elfso.asm $(NASM)
+       $(NASM) $(NASMOPT) -f elf32 -F stabs -o $@ -l $*.lst $<
+
+elfso.so: elfso.o
+       $(LD) -m elf_i386 -shared -o $@ $<
+
+elftest: elftest.c elfso.so
+       $(CC) -g -m32 -o $@ $^
+       -env LD_LIBRARY_PATH=.:$$LD_LIBRARY_PATH ./elftest
+
+#
+# Test for ELF64 shared libraries; assumes an x86-64 Linux system
+#
+elf64so.o: elf64so.asm $(NASM)
+       $(NASM) $(NASMOPT) -f elf64 -F dwarf -o $@ -l $*.lst $<
+
+elf64so.so: elf64so.o
+       $(LD) -shared -o $@ $<
+
+elftest64: elftest64.c elf64so.so
+       $(CC) -g -o $@ $^
+       -env LD_LIBRARY_PATH=.:$$LD_LIBRARY_PATH ./elftest64
diff --git a/test/_file_.asm b/test/_file_.asm
new file mode 100644 (file)
index 0000000..f633feb
--- /dev/null
@@ -0,0 +1,5 @@
+;Testname=bin; Arguments=-fbin -o_file_.bin; Files=stdout stderr _file_.bin
+       db __FILE__, `\r\n`
+       db __FILE__, `\r\n`
+       dw __LINE__
+       dw __LINE__
diff --git a/test/_version.asm b/test/_version.asm
new file mode 100644 (file)
index 0000000..d20a74d
--- /dev/null
@@ -0,0 +1,2 @@
+;Testname=version; Arguments=-v; Files=stdout
+;Dummy test to record version numbers
diff --git a/test/a32offs.asm b/test/a32offs.asm
new file mode 100644 (file)
index 0000000..4d17e0e
--- /dev/null
@@ -0,0 +1,9 @@
+;Testname=unoptimized; Arguments=-O0 -fbin -oa32offs.bin; Files=a32offs.bin stdout stderr
+;Testname=optimized;   Arguments=-Ox -fbin -oa32offs.bin; Files=a32offs.bin stdout stderr
+       bits 16
+foo:   a32 loop foo
+bar:   loop bar, ecx
+       
+       bits 32
+baz:   a16 loop baz
+qux:   loop qux, cx
diff --git a/test/absolute.asm b/test/absolute.asm
new file mode 100644 (file)
index 0000000..31c8178
--- /dev/null
@@ -0,0 +1,40 @@
+;Testname=bin; Arguments=-fbin -oabsolute.bin; Files=stdout stderr absolute.bin
+       org 7c00h
+init_foo:
+       jmp init_bar
+       nop
+       nop
+       nop
+       nop
+       nop
+       nop
+       nop
+       nop
+       nop
+       nop
+       nop
+       nop
+       nop
+       
+init_bar:
+       mov [b1],dl
+       mov [b2],edx
+       nop
+       nop
+       nop
+       nop
+       nop
+       nop
+       nop
+       nop
+       nop
+       nop
+       nop
+       nop
+       nop
+       ret
+               
+       absolute init_bar+7
+b1:    resb 1
+b2:    resd 6
+
diff --git a/test/addr64x.asm b/test/addr64x.asm
new file mode 100644 (file)
index 0000000..c7a64f5
--- /dev/null
@@ -0,0 +1,18 @@
+;Testname=O0; Arguments=-O0 -fbin -oaddr64.bin; Files=stdout stderr addr64.bin
+;Testname=O1; Arguments=-O1 -fbin -oaddr64.bin; Files=stdout stderr addr64.bin
+;Testname=Ox; Arguments=-Ox -fbin -oaddr64.bin; Files=stdout stderr addr64.bin
+       bits    64
+       mov     rdx,[rax]
+       mov     eax,[byte rsp+0x01]
+       mov     eax,[byte rsp-0x01]
+       mov     eax,[byte rsp+0xFF]
+       mov     eax,[byte rsp-0xFF]
+       mov     eax,[rsp+0x08]
+       mov     eax,[rsp-0x01]
+       mov     eax,[rsp+0xFF]
+       mov     eax,[rsp-0xFF]
+       mov     rax,[rsp+56]
+       mov     [rsi],dl
+       mov     byte [rsi],'-'
+       mov     [rsi],al
+       mov     byte [rsi],' '
diff --git a/test/align13.asm b/test/align13.asm
new file mode 100644 (file)
index 0000000..556373f
--- /dev/null
@@ -0,0 +1,16 @@
+; Test of non-power-of-2 alignment
+
+       bits 32
+
+       inc eax
+       inc eax
+       align 13
+       inc eax
+       inc eax
+       align 13
+       inc eax
+       inc eax
+       align 13
+       align 13 ;should do nothing
+       inc eax
+       inc eax
diff --git a/test/align13s.asm b/test/align13s.asm
new file mode 100644 (file)
index 0000000..dab21a2
--- /dev/null
@@ -0,0 +1,16 @@
+; Test of non-power-of-2 alignment
+%use smartalign
+
+       bits 32
+
+       inc eax
+       inc eax
+       align 13
+       inc eax
+       inc eax
+       align 13
+       inc eax
+       inc eax
+       align 13
+       inc eax
+       inc eax
diff --git a/test/alonesym-obj.asm b/test/alonesym-obj.asm
new file mode 100644 (file)
index 0000000..6be4d5d
--- /dev/null
@@ -0,0 +1,163 @@
+section         DOS32DATA align=16 public use32 FLAT class=DOS32DATA
+
+                global sym0000
+                global sym0001
+                global sym0002
+                global sym0003
+                global sym0004
+                global sym0005
+                global sym0006
+                global sym0007
+                global sym0008
+                global sym0009
+                global sym0010
+                global sym0011
+                global sym0012
+                global sym0013
+                global sym0014
+                global sym0015
+                global sym0016
+                global sym0017
+                global sym0018
+                global sym0019
+                global sym0020
+                global sym0021
+                global sym0022
+                global sym0023
+                global sym0024
+                global sym0025
+                global sym0026
+                global sym0027
+                global sym0028
+                global sym0029
+                global sym0030
+                global sym0031
+                global sym0032
+                global sym0033
+                global sym0034
+                global sym0035
+                global sym0036
+                global sym0037
+                global sym0038
+                global sym0039
+                global sym0040
+                global sym0041
+                global sym0042
+                global sym0043
+                global sym0044
+                global sym0045
+                global sym0046
+                global sym0047
+                global sym0048
+                global sym0049
+                global sym0050
+                global sym0051
+                global sym0052
+                global sym0053
+                global sym0054
+                global sym0055
+                global sym0056
+                global sym0057
+                global sym0058
+                global sym0059
+                global sym0060
+                global sym0061
+                global sym0062
+                global sym0063
+                global sym0064
+                global sym0065
+                global sym0066
+                global sym0067
+                global sym0068
+                global sym0069
+                global sym0070
+                global sym0071
+                global sym0072
+                global sym0073
+                global sym0074
+                global sym0075
+                global sym0076
+                global sym0077
+                global s
+
+
+                resb 20000h
+sym0000         resd 1
+sym0001         resd 1
+sym0002         resd 1
+sym0003         resd 1
+sym0004         resd 1
+sym0005         resd 1
+sym0006         resd 1
+sym0007         resd 1
+sym0008         resd 1
+sym0009         resd 1
+sym0010         resd 1
+sym0011         resd 1
+sym0012         resd 1
+sym0013         resd 1
+sym0014         resd 1
+sym0015         resd 1
+sym0016         resd 1
+sym0017         resd 1
+sym0018         resd 1
+sym0019         resd 1
+sym0020         resd 1
+sym0021         resd 1
+sym0022         resd 1
+sym0023         resd 1
+sym0024         resd 1
+sym0025         resd 1
+sym0026         resd 1
+sym0027         resd 1
+sym0028         resd 1
+sym0029         resd 1
+sym0030         resd 1
+sym0031         resd 1
+sym0032         resd 1
+sym0033         resd 1
+sym0034         resd 1
+sym0035         resd 1
+sym0036         resd 1
+sym0037         resd 1
+sym0038         resd 1
+sym0039         resd 1
+sym0040         resd 1
+sym0041         resd 1
+sym0042         resd 1
+sym0043         resd 1
+sym0044         resd 1
+sym0045         resd 1
+sym0046         resd 1
+sym0047         resd 1
+sym0048         resd 1
+sym0049         resd 1
+sym0050         resd 1
+sym0051         resd 1
+sym0052         resd 1
+sym0053         resd 1
+sym0054         resd 1
+sym0055         resd 1
+sym0056         resd 1
+sym0057         resd 1
+sym0058         resd 1
+sym0059         resd 1
+sym0060         resd 1
+sym0061         resd 1
+sym0062         resd 1
+sym0063         resd 1
+sym0064         resd 1
+sym0065         resd 1
+sym0066         resd 1
+sym0067         resd 1
+sym0068         resd 1
+sym0069         resd 1
+sym0070         resd 1
+sym0071         resd 1
+sym0072         resd 1
+sym0073         resd 1
+sym0074         resd 1
+sym0075         resd 1
+sym0076         resd 1
+sym0077         resd 1
+s               resd 1
diff --git a/test/andbyte.asm b/test/andbyte.asm
new file mode 100644 (file)
index 0000000..3d3b1c1
--- /dev/null
@@ -0,0 +1,15 @@
+;Testname=test; Arguments=-fbin -oandbyte.bin; Files=stdout stderr andbyte.bin
+;Testname=otest; Arguments=-Ox -fbin -oandbyte.bin; Files=stdout stderr andbyte.bin
+
+       bits 16
+
+       add sp, byte -0x10
+       add sp, -0x10
+       adc sp, byte -0x10
+       adc sp, -0x10
+       and sp, byte -0x10
+       and sp, -0x10
+       sbb sp, byte -0x10
+       sbb sp, -0x10
+       sub sp, byte -0x10
+       sub sp, -0x10
diff --git a/test/aoutso.asm b/test/aoutso.asm
new file mode 100644 (file)
index 0000000..aab35a5
--- /dev/null
@@ -0,0 +1,99 @@
+;Testname=unoptimized; Arguments=-O0 -faoutb -oaoutso.o; Files=stdout stderr aoutso.o
+;Testname=optimized;   Arguments=-Ox -faoutb -oaoutso.o; Files=stdout stderr aoutso.o
+
+; test source file for assembling to NetBSD/FreeBSD a.out shared library
+; build with:
+;    nasm -f aoutb aoutso.asm
+;    ld -Bshareable -o aoutso.so aoutso.o
+; test with:
+;    cc -o aoutso aouttest.c aoutso.so
+;    ./aoutso
+
+; This file should test the following:
+; [1] Define and export a global text-section symbol
+; [2] Define and export a global data-section symbol
+; [3] Define and export a global BSS-section symbol
+; [4] Define a non-global text-section symbol
+; [5] Define a non-global data-section symbol
+; [6] Define a non-global BSS-section symbol
+; [7] Define a COMMON symbol
+; [8] Define a NASM local label
+; [9] Reference a NASM local label
+; [10] Import an external symbol
+; [11] Make a PC-relative call to an external symbol
+; [12] Reference a text-section symbol in the text section
+; [13] Reference a data-section symbol in the text section
+; [14] Reference a BSS-section symbol in the text section
+; [15] Reference a text-section symbol in the data section
+; [16] Reference a data-section symbol in the data section
+; [17] Reference a BSS-section symbol in the data section
+
+         BITS 32
+         EXTERN __GLOBAL_OFFSET_TABLE_
+         GLOBAL _lrotate:function ; [1]
+         GLOBAL _greet:function ; [1]
+         GLOBAL _asmstr:data _asmstr.end-_asmstr ; [2]
+         GLOBAL _textptr:data 4 ; [2]
+         GLOBAL _selfptr:data 4 ; [2]
+         GLOBAL _integer:data 4 ; [3]
+         EXTERN _printf        ; [10]
+         COMMON _commvar 4     ; [7]
+
+         SECTION .text
+
+; prototype: long lrotate(long x, int num);
+_lrotate:                      ; [1]
+         push ebp
+         mov ebp,esp
+         mov eax,[ebp+8]
+         mov ecx,[ebp+12]
+.label   rol eax,1             ; [4] [8]
+         loop .label           ; [9] [12]
+         mov esp,ebp
+         pop ebp
+         ret
+
+; prototype: void greet(void);
+_greet   push ebx              ; we'll use EBX for GOT, so save it
+         call .getgot
+.getgot:  pop ebx
+         add ebx,__GLOBAL_OFFSET_TABLE_ + $$ - .getgot wrt ..gotpc
+         mov eax,[ebx+_integer wrt ..got] ; [14]
+         mov eax,[eax]
+         inc eax
+         mov [ebx+localint wrt ..gotoff],eax ; [14]
+         mov eax,[ebx+_commvar wrt ..got]
+         push dword [eax]
+         mov eax,[ebx+localptr wrt ..gotoff] ; [13]
+         push dword [eax]
+         mov eax,[ebx+_integer wrt ..got] ; [1] [14]
+         push dword [eax]
+         lea eax,[ebx+_printfstr wrt ..gotoff]
+         push eax              ; [13]
+         call _printf wrt ..plt ; [11]
+         add esp,16
+         pop ebx
+         ret
+
+         SECTION .data
+
+; a string
+_asmstr          db 'hello, world', 0  ; [2]
+.end
+
+; a string for Printf
+_printfstr db "integer==%d, localint==%d, commvar=%d"
+         db 10, 0
+
+; some pointers
+localptr  dd localint          ; [5] [17]
+_textptr  dd _greet wrt ..sym  ; [15]
+_selfptr  dd _selfptr wrt ..sym        ; [16]
+
+         SECTION .bss
+
+; an integer
+_integer  resd 1               ; [3]
+
+; a local integer
+localint  resd 1               ; [6]
diff --git a/test/aouttest.asm b/test/aouttest.asm
new file mode 100644 (file)
index 0000000..10d0e10
--- /dev/null
@@ -0,0 +1,86 @@
+;Testname=unoptimized; Arguments=-O0 -faout -oaouttest.o; Files=stdout stderr aouttest.o
+;Testname=optimized;   Arguments=-Ox -faout -oaouttest.o; Files=stdout stderr aouttest.o
+
+; test source file for assembling to a.out
+; build with:
+;    nasm -f aout aouttest.asm
+;    gcc -o aouttest aouttest.c aouttest.o
+; (assuming your gcc is a.out)
+
+; This file should test the following:
+; [1] Define and export a global text-section symbol
+; [2] Define and export a global data-section symbol
+; [3] Define and export a global BSS-section symbol
+; [4] Define a non-global text-section symbol
+; [5] Define a non-global data-section symbol
+; [6] Define a non-global BSS-section symbol
+; [7] Define a COMMON symbol
+; [8] Define a NASM local label
+; [9] Reference a NASM local label
+; [10] Import an external symbol
+; [11] Make a PC-relative call to an external symbol
+; [12] Reference a text-section symbol in the text section
+; [13] Reference a data-section symbol in the text section
+; [14] Reference a BSS-section symbol in the text section
+; [15] Reference a text-section symbol in the data section
+; [16] Reference a data-section symbol in the data section
+; [17] Reference a BSS-section symbol in the data section
+
+         BITS 32
+         GLOBAL _lrotate       ; [1]
+         GLOBAL _greet         ; [1]
+         GLOBAL _asmstr        ; [2]
+         GLOBAL _textptr       ; [2]
+         GLOBAL _selfptr       ; [2]
+         GLOBAL _integer       ; [3]
+         EXTERN _printf        ; [10]
+         COMMON _commvar 4     ; [7]
+
+         SECTION .text
+
+; prototype: long lrotate(long x, int num);
+_lrotate:                      ; [1]
+         push ebp
+         mov ebp,esp
+         mov eax,[ebp+8]
+         mov ecx,[ebp+12]
+.label   rol eax,1             ; [4] [8]
+         loop .label           ; [9] [12]
+         mov esp,ebp
+         pop ebp
+         ret
+
+; prototype: void greet(void);
+_greet   mov eax,[_integer]    ; [14]
+         inc eax
+         mov [localint],eax    ; [14]
+         push dword [_commvar]
+         mov eax,[localptr]    ; [13]
+         push dword [eax]
+         push dword [_integer] ; [1] [14]
+         push dword _printfstr ; [13]
+         call _printf          ; [11]
+         add esp,16
+         ret
+
+         SECTION .data
+
+; a string
+_asmstr          db 'hello, world', 0  ; [2]
+
+; a string for Printf
+_printfstr db "integer==%d, localint==%d, commvar=%d"
+         db 10, 0
+
+; some pointers
+localptr  dd localint          ; [5] [17]
+_textptr  dd _greet            ; [15]
+_selfptr  dd _selfptr          ; [16]
+
+         SECTION .bss
+
+; an integer
+_integer  resd 1               ; [3]
+
+; a local integer
+localint  resd 1               ; [6]
diff --git a/test/aouttest.c b/test/aouttest.c
new file mode 100644 (file)
index 0000000..2514ce1
--- /dev/null
@@ -0,0 +1,36 @@
+/*
+ * test source file for assembling to a.out
+ * build with:
+ *    nasm -f aout aouttest.asm
+ *    gcc -o aouttest aouttest.c aouttest.o
+ * (assuming your gcc is a.out)
+ */
+
+#include <stdio.h>
+#include <inttypes.h>
+
+extern int lrotate(int32_t, int);
+extern void greet(void);
+extern int8_t asmstr[];
+extern void *selfptr;
+extern void *textptr;
+extern int integer, commvar;
+
+int main(void)
+{
+
+    printf("Testing lrotate: should get 0x00400000, 0x00000001\n");
+    printf("lrotate(0x00040000, 4) = 0x%08lx\n", lrotate(0x40000, 4));
+    printf("lrotate(0x00040000, 14) = 0x%08lx\n", lrotate(0x40000, 14));
+
+    printf("This string should read `hello, world': `%s'\n", asmstr);
+
+    printf("The integers here should be 1234, 1235 and 4321:\n");
+    integer = 1234;
+    commvar = 4321;
+    greet();
+
+    printf("These pointers should be equal: %p and %p\n", &greet, textptr);
+
+    printf("So should these: %p and %p\n", selfptr, &selfptr);
+}
diff --git a/test/avx.asm b/test/avx.asm
new file mode 100644 (file)
index 0000000..9e5e15b
--- /dev/null
@@ -0,0 +1,53 @@
+;Testname=unoptimized; Arguments=-O0 -fbin -oavx.bin; Files=stdout stderr avx.bin
+;Testname=optimized;   Arguments=-Ox -fbin -oavx.bin; Files=stdout stderr avx.bin
+
+               bits 64
+               blendvpd        xmm2,xmm1,xmm0
+
+               vblendvpd       xmm2,xmm1,xmm0,xmm0
+               vblendvpd       xmm2,xmm1,xmm0
+               vblendvpd       ymm2,ymm1,ymm0,ymm0
+               vblendvpd       ymm2,ymm1,ymm0
+
+               vcvtsi2sd       xmm9,xmm10,ecx
+               vcvtsi2sd       xmm9,xmm10,rcx
+               vcvtsi2sd       xmm9,xmm10,dword [rdi]
+               vcvtsi2sd       xmm9,xmm10,qword [rdi]
+
+               vpermil2ps      xmm0,xmm1,[rdi],xmm3,0
+               vpermil2ps      xmm0,xmm1,xmm2,[rdi],1
+               vpermil2ps      ymm0,ymm1,ymm2,ymm3,2
+               vpermil2ps      ymm0,ymm1,ymm2,[rdi],3
+               vpermil2ps      ymm0,ymm1,[rdi],ymm3,2
+               vpermil2ps      ymm0,ymm1,ymm2,[rdi],3
+
+               vpextrb         [rax],xmm1,0x33
+               vpextrw         [rax],xmm1,0x33
+               vpextrd         [rax],xmm1,0x33
+               vpextrq         [rax],xmm1,0x33
+               vpextrb         rax,xmm1,0x33
+               vpextrw         rax,xmm1,0x33
+               vpextrd         rax,xmm1,0x33
+               vpextrq         rax,xmm1,0x33
+               vpextrb         eax,xmm1,0x33
+               vpextrw         eax,xmm1,0x33
+               vpextrd         eax,xmm1,0x33
+;              vpextrq         eax,xmm1,0x33
+
+               vcvtpd2ps       xmm0,xmm1
+               vcvtpd2ps       xmm0,oword [rsi]
+               vcvtpd2ps       xmm0,ymm1
+               vcvtpd2ps       xmm0,yword [rsi]
+;              vcvtpd2ps       xmm0,[rsi]
+
+               vcvtpd2dq       xmm0,xmm1
+               vcvtpd2dq       xmm0,oword [rsi]
+               vcvtpd2dq       xmm0,ymm1
+               vcvtpd2dq       xmm0,yword [rsi]
+;              vcvtpd2dq       xmm0,[rsi]
+
+               vcvttpd2dq      xmm0,xmm1
+               vcvttpd2dq      xmm0,oword [rsi]
+               vcvttpd2dq      xmm0,ymm1
+               vcvttpd2dq      xmm0,yword [rsi]
+;              vcvttpd2dq      xmm0,[rsi]
diff --git a/test/avx005.asm b/test/avx005.asm
new file mode 100644 (file)
index 0000000..0876514
--- /dev/null
@@ -0,0 +1,529 @@
+;Testname=avx005; Arguments=-fbin -oavx005.bin -Ox; Files=stdout stderr avx005.bin
+
+%define regxmm xmm0
+%define regymm ymm0
+%define mem [0]
+%define imm 3
+
+%macro x 1+.nolist
+ %1 ; comment this line if RELAXed variants are not supported
+%endmacro
+
+  VFMADDSUB132PS regxmm,regxmm,mem        ; VEX_FMA,SO
+  VFMADDSUB132PS regxmm,regxmm,regxmm     ; VEX_FMA
+  VFMADDSUB132PS regymm,regymm,mem        ; VEX_FMA,SY
+  VFMADDSUB132PS regymm,regymm,regymm     ; VEX_FMA
+
+x VFMADDSUB312PS regxmm,regxmm,mem        ; VEX_FMA,RELAX,SO
+x VFMADDSUB312PS regxmm,regxmm,regxmm     ; VEX_FMA,RELAX
+x VFMADDSUB312PS regymm,regymm,mem        ; VEX_FMA,RELAX,SY
+x VFMADDSUB312PS regymm,regymm,regymm     ; VEX_FMA,RELAX
+
+  VFMADDSUB132PD regxmm,regxmm,mem        ; VEX_FMA,SO
+  VFMADDSUB132PD regxmm,regxmm,regxmm     ; VEX_FMA
+  VFMADDSUB132PD regymm,regymm,mem        ; VEX_FMA,SY
+  VFMADDSUB132PD regymm,regymm,regymm     ; VEX_FMA
+
+x VFMADDSUB312PD regxmm,regxmm,mem        ; VEX_FMA,RELAX,SO
+x VFMADDSUB312PD regxmm,regxmm,regxmm     ; VEX_FMA,RELAX
+x VFMADDSUB312PD regymm,regymm,mem        ; VEX_FMA,RELAX,SY
+x VFMADDSUB312PD regymm,regymm,regymm     ; VEX_FMA,RELAX
+
+  VFMSUBADD132PS regxmm,regxmm,mem        ; VEX_FMA,SO
+  VFMSUBADD132PS regxmm,regxmm,regxmm     ; VEX_FMA
+  VFMSUBADD132PS regymm,regymm,mem        ; VEX_FMA,SY
+  VFMSUBADD132PS regymm,regymm,regymm     ; VEX_FMA
+
+x VFMSUBADD312PS regxmm,regxmm,mem        ; VEX_FMA,RELAX,SO
+x VFMSUBADD312PS regxmm,regxmm,regxmm     ; VEX_FMA,RELAX
+x VFMSUBADD312PS regymm,regymm,mem        ; VEX_FMA,RELAX,SY
+x VFMSUBADD312PS regymm,regymm,regymm     ; VEX_FMA,RELAX
+
+  VFMSUBADD132PD regxmm,regxmm,mem        ; VEX_FMA,SO
+  VFMSUBADD132PD regxmm,regxmm,regxmm     ; VEX_FMA
+  VFMSUBADD132PD regymm,regymm,mem        ; VEX_FMA,SY
+  VFMSUBADD132PD regymm,regymm,regymm     ; VEX_FMA
+
+x VFMSUBADD312PD regxmm,regxmm,mem        ; VEX_FMA,RELAX,SO
+x VFMSUBADD312PD regxmm,regxmm,regxmm     ; VEX_FMA,RELAX
+x VFMSUBADD312PD regymm,regymm,mem        ; VEX_FMA,RELAX,SY
+x VFMSUBADD312PD regymm,regymm,regymm     ; VEX_FMA,RELAX
+
+  VFMADD132PS    regxmm,regxmm,mem        ; VEX_FMA,SO
+  VFMADD132PS    regxmm,regxmm,regxmm     ; VEX_FMA
+  VFMADD132PS    regymm,regymm,mem        ; VEX_FMA,SY
+  VFMADD132PS    regymm,regymm,regymm     ; VEX_FMA
+
+x VFMADD312PS    regxmm,regxmm,mem        ; VEX_FMA,RELAX,SO
+x VFMADD312PS    regxmm,regxmm,regxmm     ; VEX_FMA,RELAX
+x VFMADD312PS    regymm,regymm,mem        ; VEX_FMA,RELAX,SY
+x VFMADD312PS    regymm,regymm,regymm     ; VEX_FMA,RELAX
+
+  VFMADD132PD    regxmm,regxmm,mem        ; VEX_FMA,SO
+  VFMADD132PD    regxmm,regxmm,regxmm     ; VEX_FMA
+  VFMADD132PD    regymm,regymm,mem        ; VEX_FMA,SY
+  VFMADD132PD    regymm,regymm,regymm     ; VEX_FMA
+
+x VFMADD312PD    regxmm,regxmm,mem        ; VEX_FMA,RELAX,SO
+x VFMADD312PD    regxmm,regxmm,regxmm     ; VEX_FMA,RELAX
+x VFMADD312PD    regymm,regymm,mem        ; VEX_FMA,RELAX,SY
+x VFMADD312PD    regymm,regymm,regymm     ; VEX_FMA,RELAX
+
+  VFMADD132SS    regxmm,regxmm,mem        ; VEX_FMA,SD
+  VFMADD132SS    regxmm,regxmm,regxmm     ; VEX_FMA
+
+x VFMADD312SS    regxmm,regxmm,mem        ; VEX_FMA,RELAX,SD
+x VFMADD312SS    regxmm,regxmm,regxmm     ; VEX_FMA,RELAX
+
+  VFMADD132SD    regxmm,regxmm,mem        ; VEX_FMA,SQ
+  VFMADD132SD    regxmm,regxmm,regxmm     ; VEX_FMA
+
+x VFMADD312SD    regxmm,regxmm,mem        ; VEX_FMA,RELAX,SQ
+x VFMADD312SD    regxmm,regxmm,regxmm     ; VEX_FMA,RELAX
+
+  VFMSUB132PS    regxmm,regxmm,mem        ; VEX_FMA,SO
+  VFMSUB132PS    regxmm,regxmm,regxmm     ; VEX_FMA
+  VFMSUB132PS    regymm,regymm,mem        ; VEX_FMA,SY
+  VFMSUB132PS    regymm,regymm,regymm     ; VEX_FMA
+
+x VFMSUB312PS    regxmm,regxmm,mem        ; VEX_FMA,RELAX,SO
+x VFMSUB312PS    regxmm,regxmm,regxmm     ; VEX_FMA,RELAX
+x VFMSUB312PS    regymm,regymm,mem        ; VEX_FMA,RELAX,SY
+x VFMSUB312PS    regymm,regymm,regymm     ; VEX_FMA,RELAX
+
+  VFMSUB132PD    regxmm,regxmm,mem        ; VEX_FMA,SO
+  VFMSUB132PD    regxmm,regxmm,regxmm     ; VEX_FMA
+  VFMSUB132PD    regymm,regymm,mem        ; VEX_FMA,SY
+  VFMSUB132PD    regymm,regymm,regymm     ; VEX_FMA
+
+x VFMSUB312PD    regxmm,regxmm,mem        ; VEX_FMA,RELAX,SO
+x VFMSUB312PD    regxmm,regxmm,regxmm     ; VEX_FMA,RELAX
+x VFMSUB312PD    regymm,regymm,mem        ; VEX_FMA,RELAX,SY
+x VFMSUB312PD    regymm,regymm,regymm     ; VEX_FMA,RELAX
+
+  VFMSUB132SS    regxmm,regxmm,mem        ; VEX_FMA,SD
+  VFMSUB132SS    regxmm,regxmm,regxmm     ; VEX_FMA
+
+x VFMSUB312SS    regxmm,regxmm,mem        ; VEX_FMA,RELAX,SD
+x VFMSUB312SS    regxmm,regxmm,regxmm     ; VEX_FMA,RELAX
+
+  VFMSUB132SD    regxmm,regxmm,mem        ; VEX_FMA,SQ
+  VFMSUB132SD    regxmm,regxmm,regxmm     ; VEX_FMA
+
+x VFMSUB312SD    regxmm,regxmm,mem        ; VEX_FMA,RELAX,SQ
+x VFMSUB312SD    regxmm,regxmm,regxmm     ; VEX_FMA,RELAX
+
+  VFNMADD132PS   regxmm,regxmm,mem        ; VEX_FMA,SO
+  VFNMADD132PS   regxmm,regxmm,regxmm     ; VEX_FMA
+  VFNMADD132PS   regymm,regymm,mem        ; VEX_FMA,SY
+  VFNMADD132PS   regymm,regymm,regymm     ; VEX_FMA
+
+x VFNMADD312PS   regxmm,regxmm,mem        ; VEX_FMA,RELAX,SO
+x VFNMADD312PS   regxmm,regxmm,regxmm     ; VEX_FMA,RELAX
+x VFNMADD312PS   regymm,regymm,mem        ; VEX_FMA,RELAX,SY
+x VFNMADD312PS   regymm,regymm,regymm     ; VEX_FMA,RELAX
+
+  VFNMADD132PD   regxmm,regxmm,mem        ; VEX_FMA,SO
+  VFNMADD132PD   regxmm,regxmm,regxmm     ; VEX_FMA
+  VFNMADD132PD   regymm,regymm,mem        ; VEX_FMA,SY
+  VFNMADD132PD   regymm,regymm,regymm     ; VEX_FMA
+
+x VFNMADD312PD   regxmm,regxmm,mem        ; VEX_FMA,RELAX,SO
+x VFNMADD312PD   regxmm,regxmm,regxmm     ; VEX_FMA,RELAX
+x VFNMADD312PD   regymm,regymm,mem        ; VEX_FMA,RELAX,SY
+x VFNMADD312PD   regymm,regymm,regymm     ; VEX_FMA,RELAX
+
+  VFNMADD132SS   regxmm,regxmm,mem        ; VEX_FMA,SD
+  VFNMADD132SS   regxmm,regxmm,regxmm     ; VEX_FMA
+
+x VFNMADD312SS   regxmm,regxmm,mem        ; VEX_FMA,RELAX,SD
+x VFNMADD312SS   regxmm,regxmm,regxmm     ; VEX_FMA,RELAX
+
+  VFNMADD132SD   regxmm,regxmm,mem        ; VEX_FMA,SQ
+  VFNMADD132SD   regxmm,regxmm,regxmm     ; VEX_FMA
+
+x VFNMADD312SD   regxmm,regxmm,mem        ; VEX_FMA,RELAX,SQ
+x VFNMADD312SD   regxmm,regxmm,regxmm     ; VEX_FMA,RELAX
+
+  VFNMSUB132PS   regxmm,regxmm,mem        ; VEX_FMA,SO
+  VFNMSUB132PS   regxmm,regxmm,regxmm     ; VEX_FMA
+  VFNMSUB132PS   regymm,regymm,mem        ; VEX_FMA,SY
+  VFNMSUB132PS   regymm,regymm,regymm     ; VEX_FMA
+
+x VFNMSUB312PS   regxmm,regxmm,mem        ; VEX_FMA,RELAX,SO
+x VFNMSUB312PS   regxmm,regxmm,regxmm     ; VEX_FMA,RELAX
+x VFNMSUB312PS   regymm,regymm,mem        ; VEX_FMA,RELAX,SY
+x VFNMSUB312PS   regymm,regymm,regymm     ; VEX_FMA,RELAX
+
+  VFNMSUB132PD   regxmm,regxmm,mem        ; VEX_FMA,SO
+  VFNMSUB132PD   regxmm,regxmm,regxmm     ; VEX_FMA
+  VFNMSUB132PD   regymm,regymm,mem        ; VEX_FMA,SY
+  VFNMSUB132PD   regymm,regymm,regymm     ; VEX_FMA
+
+x VFNMSUB312PD   regxmm,regxmm,mem        ; VEX_FMA,RELAX,SO
+x VFNMSUB312PD   regxmm,regxmm,regxmm     ; VEX_FMA,RELAX
+x VFNMSUB312PD   regymm,regymm,mem        ; VEX_FMA,RELAX,SY
+x VFNMSUB312PD   regymm,regymm,regymm     ; VEX_FMA,RELAX
+
+  VFNMSUB132SS   regxmm,regxmm,mem        ; VEX_FMA,SD
+  VFNMSUB132SS   regxmm,regxmm,regxmm     ; VEX_FMA
+
+x VFNMSUB312SS   regxmm,regxmm,mem        ; VEX_FMA,RELAX,SD
+x VFNMSUB312SS   regxmm,regxmm,regxmm     ; VEX_FMA,RELAX
+
+  VFNMSUB132SD   regxmm,regxmm,mem        ; VEX_FMA,SQ
+  VFNMSUB132SD   regxmm,regxmm,regxmm     ; VEX_FMA
+
+x VFNMSUB312SD   regxmm,regxmm,mem        ; VEX_FMA,RELAX,SQ
+x VFNMSUB312SD   regxmm,regxmm,regxmm     ; VEX_FMA,RELAX
+
+  VFMADDSUB213PS regxmm,regxmm,mem        ; VEX_FMA,SO
+  VFMADDSUB213PS regxmm,regxmm,regxmm     ; VEX_FMA
+  VFMADDSUB213PS regymm,regymm,mem        ; VEX_FMA,SY
+  VFMADDSUB213PS regymm,regymm,regymm     ; VEX_FMA
+
+x VFMADDSUB123PS regxmm,regxmm,mem        ; VEX_FMA,RELAX,SO
+x VFMADDSUB123PS regxmm,regxmm,regxmm     ; VEX_FMA,RELAX
+x VFMADDSUB123PS regymm,regymm,mem        ; VEX_FMA,RELAX,SY
+x VFMADDSUB123PS regymm,regymm,regymm     ; VEX_FMA,RELAX
+
+  VFMADDSUB213PD regxmm,regxmm,mem        ; VEX_FMA,SO
+  VFMADDSUB213PD regxmm,regxmm,regxmm     ; VEX_FMA
+  VFMADDSUB213PD regymm,regymm,mem        ; VEX_FMA,SY
+  VFMADDSUB213PD regymm,regymm,regymm     ; VEX_FMA
+
+x VFMADDSUB123PD regxmm,regxmm,mem        ; VEX_FMA,RELAX,SO
+x VFMADDSUB123PD regxmm,regxmm,regxmm     ; VEX_FMA,RELAX
+x VFMADDSUB123PD regymm,regymm,mem        ; VEX_FMA,RELAX,SY
+x VFMADDSUB123PD regymm,regymm,regymm     ; VEX_FMA,RELAX
+
+  VFMSUBADD213PS regxmm,regxmm,mem        ; VEX_FMA,SO
+  VFMSUBADD213PS regxmm,regxmm,regxmm     ; VEX_FMA
+  VFMSUBADD213PS regymm,regymm,mem        ; VEX_FMA,SY
+  VFMSUBADD213PS regymm,regymm,regymm     ; VEX_FMA
+
+x VFMSUBADD123PS regxmm,regxmm,mem        ; VEX_FMA,RELAX,SO
+x VFMSUBADD123PS regxmm,regxmm,regxmm     ; VEX_FMA,RELAX
+x VFMSUBADD123PS regymm,regymm,mem        ; VEX_FMA,RELAX,SY
+x VFMSUBADD123PS regymm,regymm,regymm     ; VEX_FMA,RELAX
+
+  VFMSUBADD213PD regxmm,regxmm,mem        ; VEX_FMA,SO
+  VFMSUBADD213PD regxmm,regxmm,regxmm     ; VEX_FMA
+  VFMSUBADD213PD regymm,regymm,mem        ; VEX_FMA,SY
+  VFMSUBADD213PD regymm,regymm,regymm     ; VEX_FMA
+
+x VFMSUBADD123PD regxmm,regxmm,mem        ; VEX_FMA,RELAX,SO
+x VFMSUBADD123PD regxmm,regxmm,regxmm     ; VEX_FMA,RELAX
+x VFMSUBADD123PD regymm,regymm,mem        ; VEX_FMA,RELAX,SY
+x VFMSUBADD123PD regymm,regymm,regymm     ; VEX_FMA,RELAX
+
+  VFMADD213PS    regxmm,regxmm,mem        ; VEX_FMA,SO
+  VFMADD213PS    regxmm,regxmm,regxmm     ; VEX_FMA
+  VFMADD213PS    regymm,regymm,mem        ; VEX_FMA,SY
+  VFMADD213PS    regymm,regymm,regymm     ; VEX_FMA
+
+x VFMADD123PS    regxmm,regxmm,mem        ; VEX_FMA,RELAX,SO
+x VFMADD123PS    regxmm,regxmm,regxmm     ; VEX_FMA,RELAX
+x VFMADD123PS    regymm,regymm,mem        ; VEX_FMA,RELAX,SY
+x VFMADD123PS    regymm,regymm,regymm     ; VEX_FMA,RELAX
+
+  VFMADD213PD    regxmm,regxmm,mem        ; VEX_FMA,SO
+  VFMADD213PD    regxmm,regxmm,regxmm     ; VEX_FMA
+  VFMADD213PD    regymm,regymm,mem        ; VEX_FMA,SY
+  VFMADD213PD    regymm,regymm,regymm     ; VEX_FMA
+
+x VFMADD123PD    regxmm,regxmm,mem        ; VEX_FMA,RELAX,SO
+x VFMADD123PD    regxmm,regxmm,regxmm     ; VEX_FMA,RELAX
+x VFMADD123PD    regymm,regymm,mem        ; VEX_FMA,RELAX,SY
+x VFMADD123PD    regymm,regymm,regymm     ; VEX_FMA,RELAX
+
+  VFMADD213SS    regxmm,regxmm,mem        ; VEX_FMA,SD
+  VFMADD213SS    regxmm,regxmm,regxmm     ; VEX_FMA
+
+x VFMADD123SS    regxmm,regxmm,mem        ; VEX_FMA,RELAX,SD
+x VFMADD123SS    regxmm,regxmm,regxmm     ; VEX_FMA,RELAX
+
+  VFMADD213SD    regxmm,regxmm,mem        ; VEX_FMA,SQ
+  VFMADD213SD    regxmm,regxmm,regxmm     ; VEX_FMA
+
+x VFMADD123SD    regxmm,regxmm,mem        ; VEX_FMA,RELAX,SQ
+x VFMADD123SD    regxmm,regxmm,regxmm     ; VEX_FMA,RELAX
+
+  VFMSUB213PS    regxmm,regxmm,mem        ; VEX_FMA,SO
+  VFMSUB213PS    regxmm,regxmm,regxmm     ; VEX_FMA
+  VFMSUB213PS    regymm,regymm,mem        ; VEX_FMA,SY
+  VFMSUB213PS    regymm,regymm,regymm     ; VEX_FMA
+
+x VFMSUB123PS    regxmm,regxmm,mem        ; VEX_FMA,RELAX,SO
+x VFMSUB123PS    regxmm,regxmm,regxmm     ; VEX_FMA,RELAX
+x VFMSUB123PS    regymm,regymm,mem        ; VEX_FMA,RELAX,SY
+x VFMSUB123PS    regymm,regymm,regymm     ; VEX_FMA,RELAX
+
+  VFMSUB213PD    regxmm,regxmm,mem        ; VEX_FMA,SO
+  VFMSUB213PD    regxmm,regxmm,regxmm     ; VEX_FMA
+  VFMSUB213PD    regymm,regymm,mem        ; VEX_FMA,SY
+  VFMSUB213PD    regymm,regymm,regymm     ; VEX_FMA
+
+x VFMSUB123PD    regxmm,regxmm,mem        ; VEX_FMA,RELAX,SO
+x VFMSUB123PD    regxmm,regxmm,regxmm     ; VEX_FMA,RELAX
+x VFMSUB123PD    regymm,regymm,mem        ; VEX_FMA,RELAX,SY
+x VFMSUB123PD    regymm,regymm,regymm     ; VEX_FMA,RELAX
+
+  VFMSUB213SS    regxmm,regxmm,mem        ; VEX_FMA,SD
+  VFMSUB213SS    regxmm,regxmm,regxmm     ; VEX_FMA
+
+x VFMSUB123SS    regxmm,regxmm,mem        ; VEX_FMA,RELAX,SD
+x VFMSUB123SS    regxmm,regxmm,regxmm     ; VEX_FMA,RELAX
+
+  VFMSUB213SD    regxmm,regxmm,mem        ; VEX_FMA,SQ
+  VFMSUB213SD    regxmm,regxmm,regxmm     ; VEX_FMA
+
+x VFMSUB123SD    regxmm,regxmm,mem        ; VEX_FMA,RELAX,SQ
+x VFMSUB123SD    regxmm,regxmm,regxmm     ; VEX_FMA,RELAX
+
+  VFNMADD213PS   regxmm,regxmm,mem        ; VEX_FMA,SO
+  VFNMADD213PS   regxmm,regxmm,regxmm     ; VEX_FMA
+  VFNMADD213PS   regymm,regymm,mem        ; VEX_FMA,SY
+  VFNMADD213PS   regymm,regymm,regymm     ; VEX_FMA
+
+x VFNMADD123PS   regxmm,regxmm,mem        ; VEX_FMA,RELAX,SO
+x VFNMADD123PS   regxmm,regxmm,regxmm     ; VEX_FMA,RELAX
+x VFNMADD123PS   regymm,regymm,mem        ; VEX_FMA,RELAX,SY
+x VFNMADD123PS   regymm,regymm,regymm     ; VEX_FMA,RELAX
+
+  VFNMADD213PD   regxmm,regxmm,mem        ; VEX_FMA,SO
+  VFNMADD213PD   regxmm,regxmm,regxmm     ; VEX_FMA
+  VFNMADD213PD   regymm,regymm,mem        ; VEX_FMA,SY
+  VFNMADD213PD   regymm,regymm,regymm     ; VEX_FMA
+
+x VFNMADD123PD   regxmm,regxmm,mem        ; VEX_FMA,RELAX,SO
+x VFNMADD123PD   regxmm,regxmm,regxmm     ; VEX_FMA,RELAX
+x VFNMADD123PD   regymm,regymm,mem        ; VEX_FMA,RELAX,SY
+x VFNMADD123PD   regymm,regymm,regymm     ; VEX_FMA,RELAX
+
+  VFNMADD213SS   regxmm,regxmm,mem        ; VEX_FMA,SD
+  VFNMADD213SS   regxmm,regxmm,regxmm     ; VEX_FMA
+
+x VFNMADD123SS   regxmm,regxmm,mem        ; VEX_FMA,RELAX,SD
+x VFNMADD123SS   regxmm,regxmm,regxmm     ; VEX_FMA,RELAX
+
+  VFNMADD213SD   regxmm,regxmm,mem        ; VEX_FMA,SQ
+  VFNMADD213SD   regxmm,regxmm,regxmm     ; VEX_FMA
+
+x VFNMADD123SD   regxmm,regxmm,mem        ; VEX_FMA,RELAX,SQ
+x VFNMADD123SD   regxmm,regxmm,regxmm     ; VEX_FMA,RELAX
+
+  VFNMSUB213PS   regxmm,regxmm,mem        ; VEX_FMA,SO
+  VFNMSUB213PS   regxmm,regxmm,regxmm     ; VEX_FMA
+  VFNMSUB213PS   regymm,regymm,mem        ; VEX_FMA,SY
+  VFNMSUB213PS   regymm,regymm,regymm     ; VEX_FMA
+
+x VFNMSUB123PS   regxmm,regxmm,mem        ; VEX_FMA,RELAX,SO
+x VFNMSUB123PS   regxmm,regxmm,regxmm     ; VEX_FMA,RELAX
+x VFNMSUB123PS   regymm,regymm,mem        ; VEX_FMA,RELAX,SY
+x VFNMSUB123PS   regymm,regymm,regymm     ; VEX_FMA,RELAX
+
+  VFNMSUB213PD   regxmm,regxmm,mem        ; VEX_FMA,SO
+  VFNMSUB213PD   regxmm,regxmm,regxmm     ; VEX_FMA
+  VFNMSUB213PD   regymm,regymm,mem        ; VEX_FMA,SY
+  VFNMSUB213PD   regymm,regymm,regymm     ; VEX_FMA
+
+x VFNMSUB123PD   regxmm,regxmm,mem        ; VEX_FMA,RELAX,SO
+x VFNMSUB123PD   regxmm,regxmm,regxmm     ; VEX_FMA,RELAX
+x VFNMSUB123PD   regymm,regymm,mem        ; VEX_FMA,RELAX,SY
+x VFNMSUB123PD   regymm,regymm,regymm     ; VEX_FMA,RELAX
+
+  VFNMSUB213SS   regxmm,regxmm,mem        ; VEX_FMA,SD
+  VFNMSUB213SS   regxmm,regxmm,regxmm     ; VEX_FMA
+
+x VFNMSUB123SS   regxmm,regxmm,mem        ; VEX_FMA,RELAX,SD
+x VFNMSUB123SS   regxmm,regxmm,regxmm     ; VEX_FMA,RELAX
+
+  VFNMSUB213SD   regxmm,regxmm,mem        ; VEX_FMA,SQ
+  VFNMSUB213SD   regxmm,regxmm,regxmm     ; VEX_FMA
+
+x VFNMSUB123SD   regxmm,regxmm,mem        ; VEX_FMA,RELAX,SQ
+x VFNMSUB123SD   regxmm,regxmm,regxmm     ; VEX_FMA,RELAX
+
+  VFMADDSUB231PS regxmm,regxmm,mem        ; VEX_FMA,SO
+  VFMADDSUB231PS regxmm,regxmm,regxmm     ; VEX_FMA
+  VFMADDSUB231PS regymm,regymm,mem        ; VEX_FMA,SY
+  VFMADDSUB231PS regymm,regymm,regymm     ; VEX_FMA
+
+x VFMADDSUB321PS regxmm,regxmm,mem        ; VEX_FMA,RELAX,SO
+x VFMADDSUB321PS regxmm,regxmm,regxmm     ; VEX_FMA,RELAX
+x VFMADDSUB321PS regymm,regymm,mem        ; VEX_FMA,RELAX,SY
+x VFMADDSUB321PS regymm,regymm,regymm     ; VEX_FMA,RELAX
+
+  VFMADDSUB231PD regxmm,regxmm,mem        ; VEX_FMA,SO
+  VFMADDSUB231PD regxmm,regxmm,regxmm     ; VEX_FMA
+  VFMADDSUB231PD regymm,regymm,mem        ; VEX_FMA,SY
+  VFMADDSUB231PD regymm,regymm,regymm     ; VEX_FMA
+
+x VFMADDSUB321PD regxmm,regxmm,mem        ; VEX_FMA,RELAX,SO
+x VFMADDSUB321PD regxmm,regxmm,regxmm     ; VEX_FMA,RELAX
+x VFMADDSUB321PD regymm,regymm,mem        ; VEX_FMA,RELAX,SY
+x VFMADDSUB321PD regymm,regymm,regymm     ; VEX_FMA,RELAX
+
+  VFMSUBADD231PS regxmm,regxmm,mem        ; VEX_FMA,SO
+  VFMSUBADD231PS regxmm,regxmm,regxmm     ; VEX_FMA
+  VFMSUBADD231PS regymm,regymm,mem        ; VEX_FMA,SY
+  VFMSUBADD231PS regymm,regymm,regymm     ; VEX_FMA
+
+x VFMSUBADD321PS regxmm,regxmm,mem        ; VEX_FMA,RELAX,SO
+x VFMSUBADD321PS regxmm,regxmm,regxmm     ; VEX_FMA,RELAX
+x VFMSUBADD321PS regymm,regymm,mem        ; VEX_FMA,RELAX,SY
+x VFMSUBADD321PS regymm,regymm,regymm     ; VEX_FMA,RELAX
+
+  VFMSUBADD231PD regxmm,regxmm,mem        ; VEX_FMA,SO
+  VFMSUBADD231PD regxmm,regxmm,regxmm     ; VEX_FMA
+  VFMSUBADD231PD regymm,regymm,mem        ; VEX_FMA,SY
+  VFMSUBADD231PD regymm,regymm,regymm     ; VEX_FMA
+
+x VFMSUBADD321PD regxmm,regxmm,mem        ; VEX_FMA,RELAX,SO
+x VFMSUBADD321PD regxmm,regxmm,regxmm     ; VEX_FMA,RELAX
+x VFMSUBADD321PD regymm,regymm,mem        ; VEX_FMA,RELAX,SY
+x VFMSUBADD321PD regymm,regymm,regymm     ; VEX_FMA,RELAX
+
+  VFMADD231PS    regxmm,regxmm,mem        ; VEX_FMA,SO
+  VFMADD231PS    regxmm,regxmm,regxmm     ; VEX_FMA
+  VFMADD231PS    regymm,regymm,mem        ; VEX_FMA,SY
+  VFMADD231PS    regymm,regymm,regymm     ; VEX_FMA
+
+x VFMADD321PS    regxmm,regxmm,mem        ; VEX_FMA,RELAX,SO
+x VFMADD321PS    regxmm,regxmm,regxmm     ; VEX_FMA,RELAX
+x VFMADD321PS    regymm,regymm,mem        ; VEX_FMA,RELAX,SY
+x VFMADD321PS    regymm,regymm,regymm     ; VEX_FMA,RELAX
+
+  VFMADD231PD    regxmm,regxmm,mem        ; VEX_FMA,SO
+  VFMADD231PD    regxmm,regxmm,regxmm     ; VEX_FMA
+  VFMADD231PD    regymm,regymm,mem        ; VEX_FMA,SY
+  VFMADD231PD    regymm,regymm,regymm     ; VEX_FMA
+
+x VFMADD321PD    regxmm,regxmm,mem        ; VEX_FMA,RELAX,SO
+x VFMADD321PD    regxmm,regxmm,regxmm     ; VEX_FMA,RELAX
+x VFMADD321PD    regymm,regymm,mem        ; VEX_FMA,RELAX,SY
+x VFMADD321PD    regymm,regymm,regymm     ; VEX_FMA,RELAX
+
+  VFMADD231SS    regxmm,regxmm,mem        ; VEX_FMA,SD
+  VFMADD231SS    regxmm,regxmm,regxmm     ; VEX_FMA
+
+x VFMADD321SS    regxmm,regxmm,mem        ; VEX_FMA,RELAX,SD
+x VFMADD321SS    regxmm,regxmm,regxmm     ; VEX_FMA,RELAX
+
+  VFMADD231SD    regxmm,regxmm,mem        ; VEX_FMA,SQ
+  VFMADD231SD    regxmm,regxmm,regxmm     ; VEX_FMA
+
+x VFMADD321SD    regxmm,regxmm,mem        ; VEX_FMA,RELAX,SQ
+x VFMADD321SD    regxmm,regxmm,regxmm     ; VEX_FMA,RELAX
+
+  VFMSUB231PS    regxmm,regxmm,mem        ; VEX_FMA,SO
+  VFMSUB231PS    regxmm,regxmm,regxmm     ; VEX_FMA
+  VFMSUB231PS    regymm,regymm,mem        ; VEX_FMA,SY
+  VFMSUB231PS    regymm,regymm,regymm     ; VEX_FMA
+
+x VFMSUB321PS    regxmm,regxmm,mem        ; VEX_FMA,RELAX,SO
+x VFMSUB321PS    regxmm,regxmm,regxmm     ; VEX_FMA,RELAX
+x VFMSUB321PS    regymm,regymm,mem        ; VEX_FMA,RELAX,SY
+x VFMSUB321PS    regymm,regymm,regymm     ; VEX_FMA,RELAX
+
+  VFMSUB231PD    regxmm,regxmm,mem        ; VEX_FMA,SO
+  VFMSUB231PD    regxmm,regxmm,regxmm     ; VEX_FMA
+  VFMSUB231PD    regymm,regymm,mem        ; VEX_FMA,SY
+  VFMSUB231PD    regymm,regymm,regymm     ; VEX_FMA
+
+x VFMSUB321PD    regxmm,regxmm,mem        ; VEX_FMA,RELAX,SO
+x VFMSUB321PD    regxmm,regxmm,regxmm     ; VEX_FMA,RELAX
+x VFMSUB321PD    regymm,regymm,mem        ; VEX_FMA,RELAX,SY
+x VFMSUB321PD    regymm,regymm,regymm     ; VEX_FMA,RELAX
+
+  VFMSUB231SS    regxmm,regxmm,mem        ; VEX_FMA,SD
+  VFMSUB231SS    regxmm,regxmm,regxmm     ; VEX_FMA
+
+x VFMSUB321SS    regxmm,regxmm,mem        ; VEX_FMA,RELAX,SD
+x VFMSUB321SS    regxmm,regxmm,regxmm     ; VEX_FMA,RELAX
+
+  VFMSUB231SD    regxmm,regxmm,mem        ; VEX_FMA,SQ
+  VFMSUB231SD    regxmm,regxmm,regxmm     ; VEX_FMA
+
+x VFMSUB321SD    regxmm,regxmm,mem        ; VEX_FMA,RELAX,SQ
+x VFMSUB321SD    regxmm,regxmm,regxmm     ; VEX_FMA,RELAX
+
+  VFNMADD231PS   regxmm,regxmm,mem        ; VEX_FMA,SO
+  VFNMADD231PS   regxmm,regxmm,regxmm     ; VEX_FMA
+  VFNMADD231PS   regymm,regymm,mem        ; VEX_FMA,SY
+  VFNMADD231PS   regymm,regymm,regymm     ; VEX_FMA
+
+x VFNMADD321PS   regxmm,regxmm,mem        ; VEX_FMA,RELAX,SO
+x VFNMADD321PS   regxmm,regxmm,regxmm     ; VEX_FMA,RELAX
+x VFNMADD321PS   regymm,regymm,mem        ; VEX_FMA,RELAX,SY
+x VFNMADD321PS   regymm,regymm,regymm     ; VEX_FMA,RELAX
+
+  VFNMADD231PD   regxmm,regxmm,mem        ; VEX_FMA,SO
+  VFNMADD231PD   regxmm,regxmm,regxmm     ; VEX_FMA
+  VFNMADD231PD   regymm,regymm,mem        ; VEX_FMA,SY
+  VFNMADD231PD   regymm,regymm,regymm     ; VEX_FMA
+
+x VFNMADD321PD   regxmm,regxmm,mem        ; VEX_FMA,RELAX,SO
+x VFNMADD321PD   regxmm,regxmm,regxmm     ; VEX_FMA,RELAX
+x VFNMADD321PD   regymm,regymm,mem        ; VEX_FMA,RELAX,SY
+x VFNMADD321PD   regymm,regymm,regymm     ; VEX_FMA,RELAX
+
+  VFNMADD231SS   regxmm,regxmm,mem        ; VEX_FMA,SD
+  VFNMADD231SS   regxmm,regxmm,regxmm     ; VEX_FMA
+
+x VFNMADD321SS   regxmm,regxmm,mem        ; VEX_FMA,RELAX,SD
+x VFNMADD321SS   regxmm,regxmm,regxmm     ; VEX_FMA,RELAX
+
+  VFNMADD231SD   regxmm,regxmm,mem        ; VEX_FMA,SQ
+  VFNMADD231SD   regxmm,regxmm,regxmm     ; VEX_FMA
+
+x VFNMADD321SD   regxmm,regxmm,mem        ; VEX_FMA,RELAX,SQ
+x VFNMADD321SD   regxmm,regxmm,regxmm     ; VEX_FMA,RELAX
+
+  VFNMSUB231PS   regxmm,regxmm,mem        ; VEX_FMA,SO
+  VFNMSUB231PS   regxmm,regxmm,regxmm     ; VEX_FMA
+  VFNMSUB231PS   regymm,regymm,mem        ; VEX_FMA,SY
+  VFNMSUB231PS   regymm,regymm,regymm     ; VEX_FMA
+
+x VFNMSUB321PS   regxmm,regxmm,mem        ; VEX_FMA,RELAX,SO
+x VFNMSUB321PS   regxmm,regxmm,regxmm     ; VEX_FMA,RELAX
+x VFNMSUB321PS   regymm,regymm,mem        ; VEX_FMA,RELAX,SY
+x VFNMSUB321PS   regymm,regymm,regymm     ; VEX_FMA,RELAX
+
+  VFNMSUB231PD   regxmm,regxmm,mem        ; VEX_FMA,SO
+  VFNMSUB231PD   regxmm,regxmm,regxmm     ; VEX_FMA
+  VFNMSUB231PD   regymm,regymm,mem        ; VEX_FMA,SY
+  VFNMSUB231PD   regymm,regymm,regymm     ; VEX_FMA
+
+x VFNMSUB321PD   regxmm,regxmm,mem        ; VEX_FMA,RELAX,SO
+x VFNMSUB321PD   regxmm,regxmm,regxmm     ; VEX_FMA,RELAX
+x VFNMSUB321PD   regymm,regymm,mem        ; VEX_FMA,RELAX,SY
+x VFNMSUB321PD   regymm,regymm,regymm     ; VEX_FMA,RELAX
+
+  VFNMSUB231SS   regxmm,regxmm,mem        ; VEX_FMA,SD
+  VFNMSUB231SS   regxmm,regxmm,regxmm     ; VEX_FMA
+
+x VFNMSUB321SS   regxmm,regxmm,mem        ; VEX_FMA,RELAX,SD
+x VFNMSUB321SS   regxmm,regxmm,regxmm     ; VEX_FMA,RELAX
+
+  VFNMSUB231SD   regxmm,regxmm,mem        ; VEX_FMA,SQ
+  VFNMSUB231SD   regxmm,regxmm,regxmm     ; VEX_FMA
+
+x VFNMSUB321SD   regxmm,regxmm,mem        ; VEX_FMA,RELAX,SQ
+x VFNMSUB321SD   regxmm,regxmm,regxmm     ; VEX_FMA,RELAX
+
+  VPCLMULLQLQDQ  regxmm,regxmm,mem        ; PCLMUL,VEX_AVX,SO
+  VPCLMULLQLQDQ  regxmm,regxmm,regxmm     ; PCLMUL,VEX_AVX
+  VPCLMULHQLQDQ  regxmm,regxmm,mem        ; PCLMUL,VEX_AVX,SO
+  VPCLMULHQLQDQ  regxmm,regxmm,regxmm     ; PCLMUL,VEX_AVX
+  VPCLMULLQHQDQ  regxmm,regxmm,mem        ; PCLMUL,VEX_AVX,SO
+  VPCLMULLQHQDQ  regxmm,regxmm,regxmm     ; PCLMUL,VEX_AVX
+  VPCLMULHQHQDQ  regxmm,regxmm,mem        ; PCLMUL,VEX_AVX,SO
+  VPCLMULHQHQDQ  regxmm,regxmm,regxmm     ; PCLMUL,VEX_AVX
+  VPCLMULQDQ     regxmm,regxmm,mem,imm    ; PCLMUL,VEX_AVX,SB3,SO
+  VPCLMULQDQ     regxmm,regxmm,regxmm,imm ; PCLMUL,VEX_AVX,SB3
+
+; EOF
+
+                
diff --git a/test/bcd.asm b/test/bcd.asm
new file mode 100644 (file)
index 0000000..bb45ca6
--- /dev/null
@@ -0,0 +1,21 @@
+       dt 765432109876543210p
+       dt -765432109876543210p
+       dt +765432109876543210p
+       dt 123p
+       dt -456p
+       dt +789p
+       dt 98765432109876543210p
+       dt 123.0
+       dt 0x123p+44
+       dt 789p
+
+       dt 0p765432109876543210
+       dt -0p765432109876543210
+       dt +0p765432109876543210
+       dt 0p123
+       dt -0p456
+       dt +0p789
+       dt 0p98765432109876543210
+       dt 123.0
+       dt 0x123p+44
+       dt 0p789
diff --git a/test/binexe.asm b/test/binexe.asm
new file mode 100644 (file)
index 0000000..2a9eb6e
--- /dev/null
@@ -0,0 +1,35 @@
+;Testname=unoptimized; Arguments=-O0 -fbin -obinexe.exe -i../misc/; Files=stdout stderr binexe.exe
+;Testname=optimized;   Arguments=-Ox -fbin -obinexe.exe -i../misc/; Files=stdout stderr binexe.exe
+
+; Demonstration of how to write an entire .EXE format program by using
+; the `exebin.mac' macro package.
+; To build:
+;    nasm -fbin binexe.asm -o binexe.exe -ipath
+; (where `path' is such as to allow the %include directive to find
+; exebin.mac)
+; To test:
+;    binexe
+; (should print `hello, world')
+
+%include "exebin.mac"
+
+         EXE_begin
+         EXE_stack 64          ; demonstrates overriding the 0x800 default
+
+         section .text
+
+         mov ax,cs
+         mov ds,ax
+
+         mov dx,hello
+         mov ah,9
+         int 0x21
+
+         mov ax,0x4c00
+         int 0x21
+
+         section .data
+
+hello:   db 'hello, world', 13, 10, '$'
+
+         EXE_end
diff --git a/test/bintest.asm b/test/bintest.asm
new file mode 100644 (file)
index 0000000..57a3b2d
--- /dev/null
@@ -0,0 +1,59 @@
+;Testname=unoptimized; Arguments=-O0 -fbin -obintest.bin; Files=stdout stderr bintest.bin
+;Testname=optimized;   Arguments=-Ox -fbin -obintest.bin; Files=stdout stderr bintest.bin
+
+; test source file for assembling to binary files
+; build with:
+;    nasm -f bin -o bintest.com bintest.asm
+
+; When run (as a DOS .COM file), this program should print
+;    hello, world
+; on two successive lines, then exit cleanly.
+
+; This file should test the following:
+; [1] Define a text-section symbol
+; [2] Define a data-section symbol
+; [3] Define a BSS-section symbol
+; [4] Define a NASM local label
+; [5] Reference a NASM local label
+; [6] Reference a text-section symbol in the text section
+; [7] Reference a data-section symbol in the text section
+; [8] Reference a BSS-section symbol in the text section
+; [9] Reference a text-section symbol in the data section
+; [10] Reference a data-section symbol in the data section
+; [11] Reference a BSS-section symbol in the data section
+
+         BITS 16
+         ORG 0x100
+
+         SECTION .text
+
+         jmp start             ; [6]
+
+endX     mov ax,0x4c00         ; [1]
+         int 0x21
+
+start    mov byte [bss_sym],',' ; [1] [8]
+         mov bx,[bssptr]       ; [7]
+         mov al,[bx]
+         mov bx,[dataptr]      ; [7]
+         mov [bx],al
+         mov cx,2
+.loop    mov dx,datasym        ; [1] [4] [7]
+         mov ah,9
+         push cx
+         int 0x21
+         pop cx
+         loop .loop            ; [5] [6]
+         mov bx,[textptr]      ; [7]
+         jmp bx
+
+         SECTION .data
+
+datasym          db 'hello  world', 13, 10, '$' ; [2]
+bssptr   dw bss_sym            ; [2] [11]
+dataptr          dw datasym+5          ; [2] [10]
+textptr          dw endX               ; [2] [9]
+
+         SECTION .bss
+
+bss_sym          resb 1                ; [3]
diff --git a/test/bisect.sh b/test/bisect.sh
new file mode 100755 (executable)
index 0000000..98bdb37
--- /dev/null
@@ -0,0 +1,22 @@
+#!/bin/sh
+
+# Usage:
+
+# Make a test and a golden file, read ./performtest.pl --help
+
+# cd nasm
+# cp -r test somewhere (copy test dir out of the tree)
+# git bisect start HEAD nasm-2.07 (where HEAD is bad and nasm-2.07 is good)
+# git bisect run somewhere/test/bisect.sh br2148476 (what you want to test)
+
+# Done
+
+
+# Slow but sure
+./autogen.sh
+./configure
+make
+
+NASMDIR=$(pwd)
+cd $(dirname "$0")
+./performtest.pl "--nasm=$NASMDIR/nasm" "$1.asm" --verbose
diff --git a/test/br1879590.asm b/test/br1879590.asm
new file mode 100644 (file)
index 0000000..23e3872
--- /dev/null
@@ -0,0 +1,25 @@
+;Testname=unoptimized; Arguments=-O0 -fbin -obr1879590.bin; Files=stdout stderr br1879590.bin
+;Testname=optimized;   Arguments=-Ox -fbin -obr1879590.bin; Files=stdout stderr br1879590.bin
+
+       bits 32
+
+       pavgb mm0,[ebx]
+       pavgb mm0,qword [ebx]
+       pavgw mm0,[ebx]
+       pavgw mm0,qword [ebx]
+       pavgb xmm0,[ebx]
+       pavgb xmm0,oword [ebx]
+       pavgw xmm0,[ebx]
+       pavgw xmm0,oword [ebx]
+
+       bits 64
+
+       pavgb mm0,[rbx]
+       pavgb mm0,qword [rbx]
+       pavgw mm0,[rbx]
+       pavgw mm0,qword [rbx]
+       pavgb xmm0,[rbx]
+       pavgb xmm0,oword [rbx]
+       pavgw xmm0,[rbx]
+       pavgw xmm0,oword [rbx]
+
diff --git a/test/br2003451.asm b/test/br2003451.asm
new file mode 100644 (file)
index 0000000..fb309a9
--- /dev/null
@@ -0,0 +1,15 @@
+       cpu 8086
+       org 0
+
+       ; MOV r/m16,imm16
+       ; (imm16 given as number)
+       mov word [bx], 10h
+
+       ; MOV r/m16,imm16
+       ; (imm16 given as label)
+       mov word [bx], label
+
+       align 10h
+
+       ; This label is at address 10h
+label:
diff --git a/test/br2030823.asm b/test/br2030823.asm
new file mode 100644 (file)
index 0000000..ce7ba43
--- /dev/null
@@ -0,0 +1,5 @@
+       bits 64
+       VFMADDPD xmm0, xmm1, [0], xmm3
+       VFMADDPD xmm0, xmm1, xmm2, [0]
+       VFMADDPD ymm0, ymm1, [0], ymm3
+       VFMADDPD ymm0, ymm1, ymm2, [0]
diff --git a/test/br2148476.asm b/test/br2148476.asm
new file mode 100644 (file)
index 0000000..b1ff0e8
--- /dev/null
@@ -0,0 +1,221 @@
+;Testname=test; Arguments=-fbin -obr2148476.bin; Files=stdout stderr br2148476.bin
+
+       bits 64
+
+       cvtdq2pd xmm0, xmm1
+       cvtdq2pd xmm0, [rdi]
+       cvtdq2pd xmm0, qword [rdi]
+
+       cvtdq2ps xmm0, xmm1
+       cvtdq2ps xmm0, [rdi]
+       cvtdq2ps xmm0, oword [rdi]
+
+       cvtpd2dq xmm0, xmm1
+       cvtpd2dq xmm0, [rdi]
+       cvtpd2dq xmm0, oword [rdi]
+
+       cvtpd2pi mm0, xmm1
+       cvtpd2pi mm0, [rdi]
+       cvtpd2pi mm0, oword [rdi]
+
+       cvtpd2ps xmm0, xmm1
+       cvtpd2ps xmm0, [rdi]
+       cvtpd2ps xmm0, oword [rdi]
+
+       cvtpi2pd xmm0, mm1
+       cvtpi2pd xmm0, [rdi]
+       cvtpi2pd xmm0, qword [rdi]
+
+       cvtpi2ps xmm0, mm1
+       cvtpi2ps xmm0, [rdi]
+       cvtpi2ps xmm0, qword [rdi]
+
+       cvtps2dq xmm0, xmm1
+       cvtps2dq xmm0, [rdi]
+       cvtps2dq xmm0, oword [rdi]
+
+       cvtps2pd xmm0, xmm1
+       cvtps2pd xmm0, [rdi]
+       cvtps2pd xmm0, qword [rdi]
+
+       cvtps2pi mm0, xmm1
+       cvtps2pi mm0, [rdi]
+       cvtps2pi mm0, qword [rdi]
+
+       cvtsd2si eax, xmm1
+       cvtsd2si eax, [rdi]
+       cvtsd2si eax, qword [rdi]
+       cvtsd2si rax, xmm1
+       cvtsd2si rax, [rdi]
+       cvtsd2si rax, qword [rdi]
+
+       cvtsd2ss xmm0, xmm1
+       cvtsd2ss xmm0, [rdi]
+       cvtsd2ss xmm0, qword [rdi]
+
+       cvtsi2sd xmm0, eax
+       cvtsi2sd xmm0, [rdi]    ; Compatibility
+       cvtsi2sd xmm0, dword [rdi]
+       cvtsi2sd xmm0, rax
+       cvtsi2sd xmm0, qword [rdi]
+
+       cvtsi2ss xmm0, eax
+       cvtsi2ss xmm0, [rdi]    ; Compatibility
+       cvtsi2ss xmm0, dword [rdi]
+       cvtsi2ss xmm0, rax
+       cvtsi2ss xmm0, qword [rdi]
+
+       cvtss2sd xmm0, xmm1
+       cvtss2sd xmm0, [rdi]
+       cvtss2sd xmm0, dword [rdi]
+
+       cvtss2si eax, xmm1
+       cvtss2si eax, [rdi]
+       cvtss2si eax, dword [rdi]
+       cvtss2si rax, xmm1
+       cvtss2si rax, [rdi]
+       cvtss2si rax, dword [rdi]
+
+       cvttpd2dq xmm0, xmm1
+       cvttpd2dq xmm0, [rdi]
+       cvttpd2dq xmm0, oword [rdi]
+
+       cvttpd2pi mm0, xmm1
+       cvttpd2pi mm0, [rdi]
+       cvttpd2pi mm0, oword [rdi]
+
+       cvttps2dq xmm0, xmm1
+       cvttps2dq xmm0, [rdi]
+       cvttps2dq xmm0, oword [rdi]
+
+       cvttps2pi mm0, xmm1
+       cvttps2pi mm0, [rdi]
+       cvttps2pi mm0, qword [rdi]
+
+       cvttsd2si eax, xmm1
+       cvttsd2si eax, [rdi]    ; Compatibility
+       cvttsd2si eax, qword [rdi]
+       cvttsd2si rax, xmm1
+       cvttsd2si rax, [rdi]
+       cvttsd2si rax, qword [rdi]
+
+       cvttss2si eax, xmm1
+       cvttss2si eax, [rdi]    ; Compatibility
+       cvttss2si eax, dword [rdi]
+       cvttss2si rax, xmm1
+       cvttss2si rax, [rdi]
+       cvttss2si rax, dword [rdi]
+
+       vcvtdq2pd xmm0, xmm1
+       vcvtdq2pd xmm0, [rdi]
+       vcvtdq2pd xmm0, qword [rdi]
+       vcvtdq2pd ymm0, xmm1
+       vcvtdq2pd ymm0, [rdi]
+       vcvtdq2pd ymm0, oword [rdi]
+
+       vcvtdq2ps xmm0, xmm1
+       vcvtdq2ps xmm0, [rdi]
+       vcvtdq2ps xmm0, oword [rdi]
+       vcvtdq2ps ymm0, ymm1
+       vcvtdq2ps ymm0, [rdi]
+       vcvtdq2ps ymm0, yword [rdi]
+
+       vcvtpd2dq xmm0, xmm1
+       vcvtpd2dq xmm0, oword [rdi]
+       vcvtpd2dq xmm0, ymm1
+       vcvtpd2dq xmm0, yword [rdi]
+
+       vcvtpd2ps xmm0, xmm1
+       vcvtpd2ps xmm0, oword [rdi]
+       vcvtpd2ps xmm0, ymm1
+       vcvtpd2ps xmm0, yword [rdi]
+
+       vcvtps2dq xmm0, xmm1
+       vcvtps2dq xmm0, [rdi]
+       vcvtps2dq xmm0, oword [rdi]
+       vcvtps2dq ymm0, ymm1
+       vcvtps2dq ymm0, [rdi]
+       vcvtps2dq ymm0, yword [rdi]
+
+       vcvtps2pd xmm0, xmm1
+       vcvtps2pd xmm0, [rdi]
+       vcvtps2pd xmm0, qword [rdi]
+       vcvtps2pd ymm0, xmm1
+       vcvtps2pd ymm0, [rdi]
+       vcvtps2pd ymm0, oword [rdi]
+
+       vcvtsd2si eax, xmm1
+       vcvtsd2si eax, [rdi]
+       vcvtsd2si eax, qword [rdi]
+       vcvtsd2si rax, xmm1
+       vcvtsd2si rax, [rdi]
+       vcvtsd2si rax, qword [rdi]
+
+       vcvtsd2ss xmm0, xmm1
+       vcvtsd2ss xmm0, [rdi]
+       vcvtsd2ss xmm0, qword [rdi]
+       vcvtsd2ss xmm0, xmm1, xmm2
+       vcvtsd2ss xmm0, xmm1, [rdi]
+       vcvtsd2ss xmm0, xmm1, qword [rdi]
+
+       vcvtsi2sd xmm0, eax
+       vcvtsi2sd xmm0, [rdi]   ; Compatibility
+       vcvtsi2sd xmm0, dword [rdi]
+       vcvtsi2sd xmm0, rax
+       vcvtsi2sd xmm0, qword [rdi]
+       vcvtsi2sd xmm0, xmm1, eax
+       vcvtsi2sd xmm0, xmm1, [rdi]     ; Compatibility
+       vcvtsi2sd xmm0, xmm1, dword [rdi]
+       vcvtsi2sd xmm0, xmm1, rax
+       vcvtsi2sd xmm0, xmm1, qword [rdi]
+
+       vcvtsi2ss xmm0, eax
+       vcvtsi2ss xmm0, [rdi]   ; Compatibility
+       vcvtsi2ss xmm0, dword [rdi]
+       vcvtsi2ss xmm0, rax
+       vcvtsi2ss xmm0, qword [rdi]
+       vcvtsi2ss xmm0, xmm1, eax
+       vcvtsi2ss xmm0, xmm1, [rdi]     ; Compatibility
+       vcvtsi2ss xmm0, xmm1, dword [rdi]
+       vcvtsi2ss xmm0, xmm1, rax
+       vcvtsi2ss xmm0, xmm1, qword [rdi]
+
+       vcvtss2sd xmm0, xmm1
+       vcvtss2sd xmm0, [rdi]
+       vcvtss2sd xmm0, dword [rdi]
+       vcvtss2sd xmm0, xmm1, xmm2
+       vcvtss2sd xmm0, xmm1, [rdi]
+       vcvtss2sd xmm0, xmm1, dword [rdi]
+
+       vcvtss2si eax, xmm1
+       vcvtss2si eax, [rdi]
+       vcvtss2si eax, dword [rdi]
+       vcvtss2si rax, xmm1
+       vcvtss2si rax, [rdi]
+       vcvtss2si rax, dword [rdi]
+
+       vcvttpd2dq xmm0, xmm1
+       vcvttpd2dq xmm0, oword [rdi]
+       vcvttpd2dq xmm0, ymm1
+       vcvttpd2dq xmm0, yword [rdi]
+
+       vcvttps2dq xmm0, xmm1
+       vcvttps2dq xmm0, [rdi]
+       vcvttps2dq xmm0, oword [rdi]
+       vcvttps2dq ymm0, ymm1
+       vcvttps2dq ymm0, [rdi]
+       vcvttps2dq ymm0, yword [rdi]
+
+       vcvttsd2si eax, xmm1
+       vcvttsd2si eax, [rdi]   ; Compatibility
+       vcvttsd2si eax, qword [rdi]
+       vcvttsd2si rax, xmm1
+       vcvttsd2si rax, [rdi]
+       vcvttsd2si rax, qword [rdi]
+
+       vcvttss2si eax, xmm1
+       vcvttss2si eax, [rdi]   ; Compatibility
+       vcvttss2si eax, dword [rdi]
+       vcvttss2si rax, xmm1
+       vcvttss2si rax, [rdi]
+       vcvttss2si rax, dword [rdi]
diff --git a/test/br2222615.asm b/test/br2222615.asm
new file mode 100644 (file)
index 0000000..7acef6c
--- /dev/null
@@ -0,0 +1,19 @@
+;Testname=noerror; Arguments=-fbin -obr2222615.bin; Files=stdout stderr br2222615.bin
+;Testname=error; Arguments=-DERROR -fbin -obr2222615.bin; Files=stdout stderr br2222615.bin
+
+%macro bluttan 0
+       nop
+%endmacro
+
+%ifnmacro bluttan
+ %error "bluttan is a macro"
+%endif
+
+%ifmacro blej
+ %error "blej is not a macro"
+%endif
+
+%ifdef ERROR
+ %ifnmacro
+ %endif
+%endif
diff --git a/test/br560575.asm b/test/br560575.asm
new file mode 100644 (file)
index 0000000..a252db6
--- /dev/null
@@ -0,0 +1,17 @@
+;Testname=aout;  Arguments=-faout  -obr560575.o; Files=stderr stdout br560575.o
+;Testname=aoutb; Arguments=-faoutb -obr560575.o; Files=stderr stdout br560575.o
+;Testname=coff;  Arguments=-fcoff  -obr560575.o; Files=stderr stdout br560575.o
+;Testname=elf32; Arguments=-felf32 -obr560575.o; Files=stderr stdout br560575.o
+;Testname=elf64; Arguments=-felf64 -obr560575.o; Files=stderr stdout br560575.o
+;Testname=as86;  Arguments=-fas86  -obr560575.o; Files=stderr stdout br560575.o
+;Testname=win32; Arguments=-fwin32 -obr560575.o; Files=stderr stdout br560575.o
+;Testname=win64; Arguments=-fwin64 -obr560575.o; Files=stderr stdout br560575.o
+;Testname=rdf;   Arguments=-frdf   -obr560575.o; Files=stderr stdout br560575.o
+;Testname=ieee;  Arguments=-fieee  -obr560575.o; Files=stderr stdout br560575.o
+;Testname=macho; Arguments=-fmacho -obr560575.o; Files=stderr stdout br560575.o
+
+;Test for bug report 560575 - Using SEG with non-relocatable values doesn't work
+;
+       dw seg ~1
+       dw seg "a"
+       dw seg 'a'
diff --git a/test/br560873.asm b/test/br560873.asm
new file mode 100644 (file)
index 0000000..2133492
--- /dev/null
@@ -0,0 +1,27 @@
+;Testname=unoptimized; Arguments=-O0 -frdf -obr560873.rdf; Files=stdout stderr br560873.rdf
+;Testname=optimized;   Arguments=-Ox -frdf -obr560873.rdf; Files=stdout stderr br560873.rdf
+
+label:
+       bits 16
+       call far dword label
+       mov [label],ax
+       mov [label],eax
+       mov [word label],ax
+       mov [word label],eax
+       mov [dword label],ax
+       mov [dword label],eax
+       push 3700
+       push word 3700
+       push dword 3700
+       
+       bits 32
+       call far word label
+       mov [label],ax
+       mov [label],eax
+       mov [word label],ax
+       mov [word label],eax
+       mov [dword label],ax
+       mov [dword label],eax
+       push 3700
+       push word 3700
+       push dword 3700
diff --git a/test/br890790.asm b/test/br890790.asm
new file mode 100644 (file)
index 0000000..a002382
--- /dev/null
@@ -0,0 +1,7 @@
+;Testname=test; Arguments=-fbin -obr890790.bin; Files=stdout stderr br890790.bin
+%rep 5
+  db 0
+  %include "br890790_i.asm"
+%endrep
+
+db 1
diff --git a/test/br890790_i.asm b/test/br890790_i.asm
new file mode 100644 (file)
index 0000000..7ff797f
--- /dev/null
@@ -0,0 +1 @@
+db 2
diff --git a/test/changed.asm b/test/changed.asm
new file mode 100644 (file)
index 0000000..7ea2cc4
--- /dev/null
@@ -0,0 +1,383 @@
+;This file demonstrates many of the differences between NASM version X and NASM
+;version 0.97
+;
+; changed.asm is copyright (C) 1998 John S. Fine
+;
+;  It may be redistributed under the same conditions as NASM as described in
+;  LICENSE file in the NASM archive
+;_________________________________
+;
+;  nasm changed.asm -l changed.lst
+;
+; When assembled without any -d switches, it includes examples which:
+;       Work correctly in version X
+;  and  Work incorrectly and/or display warnings in version 0.97
+;  and  Do not prevent the generation of output in version 0.97
+;
+; Not all the differences can be seen in the .lst file.  I suggest that you use
+; "ndisasm changes"  to examine the code actually generated.
+;_________________________________
+;
+;  nasm changed.asm -l changed.lst -doldmsg
+;
+; When assembled with -doldmsg, it adds examples which:
+;       Work correctly in version X
+;  and  Generate error messages in version 0.97 and do not generate output
+;_________________________________
+;
+;  nasm changed.asm -l changed.lst -doldcrash
+;
+; When assembled with -doldcrash, it adds examples which:
+;       Work correctly in version X
+;  and  Cause NASM to crash in version 0.97
+;_________________________________
+;
+;  nasm changed.asm -l changed.lst -dnewmsg
+;
+; When assembled with -dnewmsg, it adds examples which:
+;       Generate error messages in version X
+;  and  Generate wrong output without warning or error message in version 0.97
+;-----------------------------------------------------------------------------
+
+; Please note that I have reported the name of the person who made the
+; correction based on very limited information.  In several cases, I am sure I
+; will identify the wrong author.  Please send me any corrections;  I don't
+; intend to insult or exclude anyone.
+
+;-----------------------------------------------------------------------------
+; Bug fixed by Simon in assemble()
+;
+; The following generated "call next" / "call next-1" instead of
+; two copies of "call next"
+;
+       times 2 a16 call next
+next:
+
+;-----------------------------------------------------------------------------
+; Bug fixed by John in parse_line()  (and other routines)
+;
+; This used to jmp to prior.1, when it should be here.1
+;
+prior:
+.1:
+here:  jmp     .1
+.1:
+
+;-----------------------------------------------------------------------------
+; Bug fixed by John in assemble()
+;
+; Strings used in dq and dt were not zero filled correctly
+;
+       dq      'b'
+
+
+;-----------------------------------------------------------------------------
+; Bug fixed by Simon in isn_names[]
+;
+; Was not recognised as an instruction
+;
+       int01                   ; Instead of INT1
+
+;-----------------------------------------------------------------------------
+; Bug fixed by Jim Hague in ???
+;
+; Forward references were instruction level rather than per operand
+;
+       shr word [forwardref],1
+forwardref:
+
+;-----------------------------------------------------------------------------
+; Bug fixed by John in preproc.c
+;
+; It used to silently discard id characters appended to a multi-line
+; macro parameter (such as the x in %1x below).
+;
+%macro xxx 1
+%1: nop
+%{1}x: jmp %1x
+%endmacro
+xxx yyy
+
+;-----------------------------------------------------------------------------
+; Bug added by John in preproc.c 0.98-J4, removed by John in 0.98-J5
+;
+; Tested here to make sure it stays removed
+;
+%macro TestElse 1
+%if %1=0
+%elif %1=1
+nop
+%endif
+%endmacro
+TestElse 1
+
+%ifdef oldmsg
+;***************************************************************
+;
+; The following examples will generate error messages in 0.97 and will generate
+; correct output in the new version.
+
+;-----------------------------------------------------------------------------
+; Bug fixed by Simon in isns.dat
+;
+; The optional "near" was not permitted on JMP and CALL
+;
+       jmp near here
+
+;-----------------------------------------------------------------------------
+; Feature added by Simon in stdscan()
+;
+; You can now use the numeric value of strings in %assign
+;
+%assign xxx 'ABCD'
+       dd xxx
+
+;-----------------------------------------------------------------------------
+; Feature added by John in add_vectors()
+;
+; Stranger address expressions are now supported as long as they resolve to
+; something valid.
+;
+       mov ax, [eax + ebx + ecx - eax]
+
+;-----------------------------------------------------------------------------
+; Bug fixed by Simon in ???
+;
+; The EQU directive affected local labels in a way that was inconsistent
+; between passes
+;
+.local:
+neither equ $
+       jmp .local
+
+;-----------------------------------------------------------------------------
+; Feature added by Jules in parse_line
+;
+; You can override a size specifier
+;
+%define arg1 dword [bp+4]
+       cmp word arg1, 2
+
+;-----------------------------------------------------------------------------
+; Bug fixed by John in preproc.c
+;
+; You could not use a label on the same line with a macro invocation, if the
+; macro definition began with a preprocessor directive.
+;
+       struc mytype
+.long  resd    1
+       endstruc
+
+lbl    istruc mytype
+       at mytype.long, dd 'ABCD'
+       iend
+
+;-----------------------------------------------------------------------------
+; Warning removed by John in preproc.c
+;
+; In order to allow macros that extend the definition of instructions, I
+; disabled the warning on a multi-line macro referencing itself.
+;
+%endif                 ;NASM 0.97 doesn't handle %0 etc. inside false %if
+%macro push 1-*                ;
+%rep %0                        ;
+push %1                        ;
+%rotate 1              ;
+%endrep                        ;
+%endmacro              ;
+%ifdef oldmsg          ;
+
+       push ax,bx
+
+;-----------------------------------------------------------------------------
+; Warning removed by John in preproc.c
+;
+; To support other types of macros that extend the definition of instructions,
+; I disabled the warning on a multi-line macro called with the wrong number of
+; parameters.  PUSH and POP can be extended equally well by either method, but
+; other intruction extensions may need one method or the other, so I made both
+; work.
+;
+; Note that neither of these warnings was really needed, because a later stage
+; of NASM would almost always give an adequate error message if the macro use
+; really was wrong.
+;
+%endif
+%macro pop 2-*
+%rep %0
+pop %1
+%rotate 1
+%endrep
+%endmacro
+%ifdef oldmsg
+
+       pop ax,bx
+%endif
+
+
+%ifdef newmsg  ;***************************************************************
+
+;-----------------------------------------------------------------------------
+; Bug fixed by John in parse_line()  (and other routines)
+;
+; This invalid code used to assemble without errors
+;
+myself equ myself+1
+       jmp myself
+
+;-----------------------------------------------------------------------------
+; Change made by John in preproc.c
+;
+; In 0.97, an id that appears as a label on a macro invocation was always
+; prepended to the first line of the macro expansion.  That caused several
+; bugs, but also could be used in tricks like the arg macro in c16.mac and
+; c32.mac.
+;
+; In version X, an id that appears as a label on a macro invocation will
+; normally be defined as a label for the address at which the macro is
+; invoked, regardless of whether the first line of the macro expansion is
+; something that can take a label.  The new token %00 may be used for any
+; of the situations in which the old prepend behavior was doing something
+; tricky but useful.  %00 can also be used more than once and in places
+; other than the start of the expansion.
+;
+%endif
+%assign arg_off 0
+
+%imacro arg 0-1 2              ;arg defined the old way
+         equ arg_off
+%assign arg_off %1+arg_off
+%endmacro
+
+%ifdef newmsg
+arg_example arg
+%endif
+
+%imacro arg2 0-1 2             ;arg defined the new way
+%00      equ arg_off
+%assign arg_off %1+arg_off
+%endmacro
+
+%ifdef oldmsg
+arg_example2 arg2
+
+;-----------------------------------------------------------------------------
+; Change made by Jules and John in INSNS.DAT
+;
+; Various instruction in which the size of an immediate is built-in to the
+; instruction set, now allow you to redundantly specify that size as long
+; as you specify it correctly
+;
+       AAD     byte 5
+       AAM     byte 5
+       BT      bx, byte 3
+       BTC     cx, byte 4
+       BTR     dx, byte 5
+       BTS     si, byte 6
+       IN      eax, byte 0x40
+       INT     byte 21h
+       OUT     byte 70h, ax
+       RET     word 2
+       RETN    word 2
+       RETF    word 4
+
+; note "ENTER" has not been changed yet.
+
+;-----------------------------------------------------------------------------
+; Enhancement by hpa in insns.dat et al
+;
+; Simplified adding new instructions, and added some missing instructions
+;
+       int03                   ; Instead of INT3
+       ud1                     ; No documented mnemonic for this one
+       ud2
+       sysenter
+       sysexit
+       syscall
+       sysret
+       fxsave [ebx]
+       fxrstor [es:ebx+esi*4+0x3000]
+
+;-----------------------------------------------------------------------------
+; Enhancement by hpa in insns.dat et al
+;
+; Actually make SSE work, and use the -p option to ndisasm to select
+; one of several aliased opcodes
+;
+       sqrtps xmm0,[ebx+10]    ; SSE opcode
+       paddsiw mm0,[ebx+10]    ; Cyrix opcode with the same byte seq.
+       
+;-----------------------------------------------------------------------------
+; Enhancement by hpa in preproc.c
+;
+; Support %undef to remoce a single-line macro
+;
+%define        TEST_ME 42
+%ifndef TEST_ME
+%error "TEST_ME not defined after %define"
+%endif
+                       
+%undef  TEST_ME
+%ifdef  TEST_ME
+%error "TEST_ME defined after %undef"
+%endif
+
+;-----------------------------------------------------------------------------
+; Bug fix by hpa in insns.dat
+;
+; PSHUFW and PINSRW weren't handling the implicit sizes correctly; all of
+; the entries below are (or should be) legal
+;
+       pshufw mm2, mm1, 3
+       pshufw mm3,[ebx],2
+       pshufw mm7,[0+edi*8],1
+       
+       pshufw mm2, mm1, byte 3
+       pshufw mm3,[ebx],byte 2
+       pshufw mm7,[0+edi*8],byte 1
+
+       pshufw mm2, mm1, 3
+       pshufw mm3, qword [ebx], 2
+       pshufw mm7, qword [0+edi*8], 1
+
+       pshufw mm2, mm1, byte 3
+       pshufw mm3, qword [ebx], byte 2
+       pshufw mm7, qword [0+edi*8], byte 1
+
+       pinsrw mm1, [esi], 1
+       pinsrw mm1, word [esi], 1
+       pinsrw mm1, [esi], byte 1
+       pinsrw mm1, word [esi], byte 1
+
+       
+%endif                         ; oldmsg
+       
+%ifdef oldcrash  ;*************************************************************
+
+This_label_is_256_characters_long__There_used_to_be_a_bug_in_stdscan_which_made_it_crash_when_it_did_a_keyword_search_on_any_label_longer_than_255_characters__Now_anything_longer_than_MAX_KEYWORD_is_always_a_symbol__It_will_not_even_try_a_keyword_search___
+
+;-----------------------------------------------------------------------------
+; Bug fixed by John in preproc.c
+;
+; Builds of NASM that prohibit dereferencing a NULL pointer used to crash if a
+; macro that started with a blank line was invoked with a label
+;
+%macro empty_macro 0
+
+%endm
+
+emlabel empty_macro
+       jmp     emlabel
+
+;-----------------------------------------------------------------------------
+; Enhancement by Conan Brink in preproc.c
+;
+; Allow %rep to be nested
+;
+%rep 4
+%rep 5
+       nop
+%endrep
+%endrep
+
+%endif
diff --git a/test/cofftest.asm b/test/cofftest.asm
new file mode 100644 (file)
index 0000000..6b845e2
--- /dev/null
@@ -0,0 +1,85 @@
+;Cannot be automatically tested because it differs every time,
+;I guess because of a date/time field.
+
+; test source file for assembling to COFF
+; build with (under DJGPP, for example):
+;    nasm -f coff cofftest.asm
+;    gcc -o cofftest cofftest.c cofftest.o
+
+; This file should test the following:
+; [1] Define and export a global text-section symbol
+; [2] Define and export a global data-section symbol
+; [3] Define and export a global BSS-section symbol
+; [4] Define a non-global text-section symbol
+; [5] Define a non-global data-section symbol
+; [6] Define a non-global BSS-section symbol
+; [7] Define a COMMON symbol
+; [8] Define a NASM local label
+; [9] Reference a NASM local label
+; [10] Import an external symbol
+; [11] Make a PC-relative call to an external symbol
+; [12] Reference a text-section symbol in the text section
+; [13] Reference a data-section symbol in the text section
+; [14] Reference a BSS-section symbol in the text section
+; [15] Reference a text-section symbol in the data section
+; [16] Reference a data-section symbol in the data section
+; [17] Reference a BSS-section symbol in the data section
+
+         BITS 32
+         GLOBAL _lrotate       ; [1]
+         GLOBAL _greet         ; [1]
+         GLOBAL _asmstr        ; [2]
+         GLOBAL _textptr       ; [2]
+         GLOBAL _selfptr       ; [2]
+         GLOBAL _integer       ; [3]
+         EXTERN _printf        ; [10]
+         COMMON _commvar 4     ; [7]
+
+         SECTION .text
+
+; prototype: long lrotate(long x, int num);
+_lrotate:                      ; [1]
+         push ebp
+         mov ebp,esp
+         mov eax,[ebp+8]
+         mov ecx,[ebp+12]
+.label   rol eax,1             ; [4] [8]
+         loop .label           ; [9] [12]
+         mov esp,ebp
+         pop ebp
+         ret
+
+; prototype: void greet(void);
+_greet   mov eax,[_integer]    ; [14]
+         inc eax
+         mov [localint],eax    ; [14]
+         push dword [_commvar]
+         mov eax,[localptr]    ; [13]
+         push dword [eax]
+         push dword [_integer] ; [1] [14]
+         push dword _printfstr ; [13]
+         call _printf          ; [11]
+         add esp,16
+         ret
+
+         SECTION .data
+
+; a string
+_asmstr          db 'hello, world', 0  ; [2]
+
+; a string for Printf
+_printfstr db "integer==%d, localint==%d, commvar=%d"
+         db 10, 0
+
+; some pointers
+localptr  dd localint          ; [5] [17]
+_textptr  dd _greet            ; [15]
+_selfptr  dd _selfptr          ; [16]
+
+         SECTION .bss
+
+; an integer
+_integer  resd 1               ; [3]
+
+; a local integer
+localint  resd 1               ; [6]
diff --git a/test/cofftest.c b/test/cofftest.c
new file mode 100644 (file)
index 0000000..77f610f
--- /dev/null
@@ -0,0 +1,35 @@
+/*
+ * test source file for assembling to COFF
+ * build with (under DJGPP, for example):
+ *    nasm -f coff cofftest.asm
+ *    gcc -o cofftest cofftest.c cofftest.o
+ */
+
+#include <stdio.h>
+#include <inttypes.h>
+
+extern int lrotate(int32_t, int);
+extern void greet(void);
+extern int8_t asmstr[];
+extern void *selfptr;
+extern void *textptr;
+extern int integer, commvar;
+
+int main(void)
+{
+
+    printf("Testing lrotate: should get 0x00400000, 0x00000001\n");
+    printf("lrotate(0x00040000, 4) = 0x%08lx\n", lrotate(0x40000, 4));
+    printf("lrotate(0x00040000, 14) = 0x%08lx\n", lrotate(0x40000, 14));
+
+    printf("This string should read `hello, world': `%s'\n", asmstr);
+
+    printf("The integers here should be 1234, 1235 and 4321:\n");
+    integer = 1234;
+    commvar = 4321;
+    greet();
+
+    printf("These pointers should be equal: %p and %p\n", &greet, textptr);
+
+    printf("So should these: %p and %p\n", selfptr, &selfptr);
+}
diff --git a/test/crc32.asm b/test/crc32.asm
new file mode 100644 (file)
index 0000000..c1ddb29
--- /dev/null
@@ -0,0 +1,37 @@
+;Testname=test; Arguments=-fbin -ocrc32.bin; Files=stdout stderr crc32.bin
+
+       bits 16
+
+       crc32 eax,cl
+       crc32 eax,byte [di]
+       crc32 eax,cx
+       crc32 eax,word [di]
+       crc32 eax,ecx
+       crc32 eax,dword [di]
+
+       bits 32
+       align 16
+
+       crc32 eax,cl
+       crc32 eax,byte [edi]
+       crc32 eax,cx
+       crc32 eax,word [edi]
+       crc32 eax,ecx
+       crc32 eax,dword [edi]
+
+       bits 64
+       align 16
+
+       crc32 eax,cl
+       crc32 eax,byte [rdi]
+       crc32 eax,r9b
+       crc32 eax,cx
+       crc32 eax,word [rdi]
+       crc32 eax,ecx
+       crc32 eax,dword [rdi]
+       crc32 rax,cl
+       crc32 rax,byte [rdi]
+       crc32 rax,r9b
+       crc32 rax,rcx
+       crc32 rax,qword [rdi]
+       crc32 rax,r9
diff --git a/test/dtbcd.asm b/test/dtbcd.asm
new file mode 100644 (file)
index 0000000..fcccff6
--- /dev/null
@@ -0,0 +1,72 @@
+;
+; This is a macro to generate packed BCD constants.
+; It is obsoleted by "dt" with a packed BCD value with a "p"
+; suffix, but it is included here as a rest of nested %rep.
+;
+%macro dtbcd 1-*.nolist
+  %push dtbcd
+  %rep %0
+    %defstr %$abc %1
+    %substr %$sign %$abc 1
+    %if %$sign == '-'
+      %substr %$abc %$abc 2,-1
+      %xdefine %$sign 0x80
+    %elif %$sign == '+'
+      %substr %$abc %$abc 2,-1
+      %xdefine %$sign 0x00
+    %else
+      %xdefine %$sign 0x00
+    %endif
+    %strlen %$abclen %$abc
+    %defstr %$abclen_str %$abclen
+    %assign %$pos %$abclen
+    %assign %$bc 0
+    %assign %$ld -1
+    %rep %$abclen
+      %substr %$chr %$abc %$pos
+      %assign %$pos %$pos-1
+      %if %$chr >= '0' && %$chr <= '9'
+        %if %$ld < 0
+          %assign %$ld %$chr-'0'
+          %assign %$bc %$bc+1
+          %if %$bc > 9
+            %warning "too many digits in BCD constant"
+           %exitrep
+          %endif
+        %else
+          db %$ld+((%$chr-'0') << 4)
+         %assign %$ld -1
+        %endif
+      %elif %$chr == '_'
+        ; Do nothing...
+      %else
+        %error "invalid character in BCD constant"
+       %exitrep
+      %endif
+    %endrep
+    %if %$ld >= 0
+      db %$ld
+    %endif
+    %rep 9-%$bc
+      db 0
+    %endrep
+    db %$sign
+    %rotate 1
+  %endrep
+  %pop
+%endmacro
+
+       dtbcd 123, -456, +789
+       dt 123p, -456p, +789p
+       dtbcd 765432109876543210
+       dt 765432109876543210p
+       dtbcd -765432109876543210
+       dt -765432109876543210p
+       dtbcd +765_432_109_876_543_210
+       dt +765_432_109_876_543_210p
+       dtbcd -765_432_109_876_543_210
+       dt -765_432_109_876_543_210p
+
+       ;; Both of these should warn...
+       dtbcd 8_765_432_109_876_543_210
+       dt 8_765_432_109_876_543_210p
diff --git a/test/elf64so.asm b/test/elf64so.asm
new file mode 100644 (file)
index 0000000..f1b2346
--- /dev/null
@@ -0,0 +1,118 @@
+; test source file for assembling to ELF64 shared library
+; build with:
+;    nasm -f elf64 elf64so.asm
+;    ld -shared -o elf64so.so elf64so.o
+; test with:
+;    gcc -o elf64so elftest64.c ./elf64so.so
+;    ./elf64so
+
+; This file should test the following:
+; [1] Define and export a global text-section symbol
+; [2] Define and export a global data-section symbol
+; [3] Define and export a global BSS-section symbol
+; [4] Define a non-global text-section symbol
+; [5] Define a non-global data-section symbol
+; [6] Define a non-global BSS-section symbol
+; [7] Define a COMMON symbol
+; [8] Define a NASM local label
+; [9] Reference a NASM local label
+; [10] Import an external symbol
+; [11] Make a PC-relative call to an external symbol
+; [12] Reference a text-section symbol in the text section
+; [13] Reference a data-section symbol in the text section
+; [14] Reference a BSS-section symbol in the text section
+; [15] Reference a text-section symbol in the data section
+; [16] Reference a data-section symbol in the data section
+; [17] Reference a BSS-section symbol in the data section
+
+         BITS 64
+         GLOBAL lrotate:function ; [1]
+         GLOBAL greet_s:function ; [1]
+         GLOBAL greet_m:function ; [1]
+         GLOBAL asmstr:data asmstr.end-asmstr ; [2]
+         GLOBAL textptr:data 8 ; [2]
+         GLOBAL selfptr:data 8 ; [2]
+         GLOBAL useless:data 8 ; [3]
+         GLOBAL integer:data 8 ; [3]
+         EXTERN printf         ; [10]
+         COMMON commvar 8:8    ; [7]
+         EXTERN _GLOBAL_OFFSET_TABLE_
+
+         SECTION .text
+
+; prototype: long lrotate(long x, int num);
+lrotate:                       ; [1]
+         push rbp
+         mov rbp,rsp
+         mov rax,rdi
+         mov rcx,rsi
+.label   rol rax,1             ; [4] [8]
+         loop .label           ; [9] [12]
+         mov rsp,rbp
+         pop rbp
+         ret
+
+;; prototype: void greet_*(void);
+;; 
+;;  Arguments are:     rdi - rsi - rdx - rcx - r8 - r9
+;;  Registers:         rbx, rbp, r12-r15 are saved
+;; greet_s() is Small PIC model, greet_m() is Medium PIC model
+;; (Large model cannot be linked with other code)
+;;
+greet_s:
+         ;;  This instruction is useless, this is only a test...
+         cmp qword [rel integer wrt ..got],0
+         mov rax,[rel commvar wrt ..got] ; &commvar
+         mov rcx,[rax]                   ; commvar
+         mov rax,[rel integer wrt ..got] ; &integer
+         mov rsi,[rax]
+         lea rdx,[rsi+1]
+         mov [rel localint],rdx ; localint = integer+1
+         mov rax,[rel localptr] ; localptr
+         mov rdx,[rax]          ; *localptr = localint
+         lea rdi,[rel printfstr]
+         xor eax,eax           ; No fp arguments
+         jmp printf wrt ..plt  ; [10]
+
+greet_m:
+         push r15              ; Used by convention...
+         lea r15,[rel _GLOBAL_OFFSET_TABLE_]
+         mov rax,[rel commvar wrt ..got] ; &commvar
+         mov rcx,[rax]                   ; commvar
+         mov rax,[rel integer wrt ..got] ; &integer
+         mov rsi,[rax]
+         lea rdx,[rsi+1]
+         mov rax,localint wrt ..gotoff  ; &localint - r15
+         mov [rax+r15],rdx      ; localint = integer+1
+         mov rax,localptr wrt ..gotoff ; &localptr - r15
+         mov rax,[rax+r15]      ; localptr
+         mov rdx,[rax]          ; *localptr = localint
+         mov rdi,printfstr wrt ..gotoff ; &printfstr - r15
+         add rdi,r15           ; &printfstr 
+         xor eax,eax           ; No fp arguments
+         pop r15
+         jmp printf wrt ..plt  ; [10]
+
+         SECTION .data
+
+; a string
+asmstr   db 'hello, world', 0  ; [2]
+.end:
+
+; a string for Printf
+printfstr db "integer=%ld, localint=%ld, commvar=%ld", 10, 0
+
+; some pointers
+localptr  dq localint          ; [5] [17]
+textptr          dq greet_s wrt ..sym  ; [15]
+selfptr          dq selfptr wrt ..sym  ; [16]
+
+         SECTION .bss
+; a useless symbol
+useless          resq 1
+       
+; an integer
+integer          resq 1                ; [3]
+
+; a local integer
+localint  resq 1               ; [6]
diff --git a/test/elfso.asm b/test/elfso.asm
new file mode 100644 (file)
index 0000000..e72497b
--- /dev/null
@@ -0,0 +1,100 @@
+;Testname=unoptimized; Arguments=-O0 -felf -oelfso.o; Files=stdout stderr elfso.o
+;Testname=optimized;   Arguments=-Ox -felf -oelfso.o; Files=stdout stderr elfso.o
+
+; test source file for assembling to ELF shared library
+; build with:
+;    nasm -f elf elfso.asm
+;    ld -shared -o elfso.so elfso.o
+; test with:
+;    gcc -o elfso elftest.c ./elfso.so
+;    ./elfso
+; (assuming your gcc is ELF, and you're running bash)
+
+; This file should test the following:
+; [1] Define and export a global text-section symbol
+; [2] Define and export a global data-section symbol
+; [3] Define and export a global BSS-section symbol
+; [4] Define a non-global text-section symbol
+; [5] Define a non-global data-section symbol
+; [6] Define a non-global BSS-section symbol
+; [7] Define a COMMON symbol
+; [8] Define a NASM local label
+; [9] Reference a NASM local label
+; [10] Import an external symbol
+; [11] Make a PC-relative call to an external symbol
+; [12] Reference a text-section symbol in the text section
+; [13] Reference a data-section symbol in the text section
+; [14] Reference a BSS-section symbol in the text section
+; [15] Reference a text-section symbol in the data section
+; [16] Reference a data-section symbol in the data section
+; [17] Reference a BSS-section symbol in the data section
+
+         BITS 32
+         GLOBAL lrotate:function ; [1]
+         GLOBAL greet:function ; [1]
+         GLOBAL asmstr:data asmstr.end-asmstr ; [2]
+         GLOBAL textptr:data 4 ; [2]
+         GLOBAL selfptr:data 4 ; [2]
+         GLOBAL integer:data 4 ; [3]
+         EXTERN printf         ; [10]
+         COMMON commvar 4:4    ; [7]
+         EXTERN _GLOBAL_OFFSET_TABLE_
+
+         SECTION .text
+
+; prototype: long lrotate(long x, int num);
+lrotate:                       ; [1]
+         push ebp
+         mov ebp,esp
+         mov eax,[ebp+8]
+         mov ecx,[ebp+12]
+.label   rol eax,1             ; [4] [8]
+         loop .label           ; [9] [12]
+         mov esp,ebp
+         pop ebp
+         ret
+
+; prototype: void greet(void);
+greet    push ebx              ; we'll use EBX for GOT, so save it
+         call .getgot
+.getgot:  pop ebx
+         add ebx,_GLOBAL_OFFSET_TABLE_ + $$ - .getgot wrt ..gotpc
+         mov eax,[ebx+integer wrt ..got] ; [14]
+         mov eax,[eax]
+         inc eax
+         mov [ebx+localint wrt ..gotoff],eax ; [14]
+         mov eax,[ebx+commvar wrt ..got]
+         push dword [eax]
+         mov eax,[ebx+localptr wrt ..gotoff] ; [13]
+         push dword [eax]
+         mov eax,[ebx+integer wrt ..got] ; [1] [14]
+         push dword [eax]
+         lea eax,[ebx+printfstr wrt ..gotoff]
+         push eax              ; [13]
+         call printf wrt ..plt ; [11]
+         add esp,16
+         pop ebx
+         ret
+
+         SECTION .data
+
+; a string
+asmstr   db 'hello, world', 0  ; [2]
+.end
+
+; a string for Printf
+printfstr db "integer==%d, localint==%d, commvar=%d"
+         db 10, 0
+
+; some pointers
+localptr  dd localint          ; [5] [17]
+textptr          dd greet wrt ..sym    ; [15]
+selfptr          dd selfptr wrt ..sym  ; [16]
+
+         SECTION .bss
+
+; an integer
+integer          resd 1                ; [3]
+
+; a local integer
+localint  resd 1               ; [6]
diff --git a/test/elftest.asm b/test/elftest.asm
new file mode 100644 (file)
index 0000000..fcfb362
--- /dev/null
@@ -0,0 +1,87 @@
+; test source file for assembling to ELF
+; build with:
+;    nasm -f elf elftest.asm
+;    gcc -o elftest elftest.c elftest.o
+; (assuming your gcc is ELF)
+
+; This file should test the following:
+; [1] Define and export a global text-section symbol
+; [2] Define and export a global data-section symbol
+; [3] Define and export a global BSS-section symbol
+; [4] Define a non-global text-section symbol
+; [5] Define a non-global data-section symbol
+; [6] Define a non-global BSS-section symbol
+; [7] Define a COMMON symbol
+; [8] Define a NASM local label
+; [9] Reference a NASM local label
+; [10] Import an external symbol
+; [11] Make a PC-relative call to an external symbol
+; [12] Reference a text-section symbol in the text section
+; [13] Reference a data-section symbol in the text section
+; [14] Reference a BSS-section symbol in the text section
+; [15] Reference a text-section symbol in the data section
+; [16] Reference a data-section symbol in the data section
+; [17] Reference a BSS-section symbol in the data section
+; [18] Define a non-global rodata-section symbol
+
+         BITS 32
+         GLOBAL lrotate        ; [1]
+         GLOBAL greet          ; [1]
+         GLOBAL asmstr         ; [2]
+         GLOBAL textptr        ; [2]
+         GLOBAL selfptr        ; [2]
+         GLOBAL integer        ; [3]
+         EXTERN printf         ; [10]
+         COMMON commvar 4      ; [7]
+
+         SECTION .text
+
+; prototype: long lrotate(long x, int num);
+lrotate:                       ; [1]
+         push ebp
+         mov ebp,esp
+         mov eax,[ebp+8]
+         mov ecx,[ebp+12]
+.label   rol eax,1             ; [4] [8]
+         loop .label           ; [9] [12]
+         mov esp,ebp
+         pop ebp
+         ret
+
+; prototype: void greet(void);
+greet    mov eax,[integer]     ; [14]
+         inc eax
+         mov [localint],eax    ; [14]
+         push dword [commvar]
+         mov eax,[localptr]    ; [13]
+         push dword [eax]
+         push dword [integer]  ; [1] [14]
+         push dword printfstr  ; [13]
+         call printf           ; [11]
+         add esp,16
+         ret
+
+         SECTION .data
+
+; a string
+asmstr   db 'hello, world', 0  ; [2]
+
+; a string for Printf
+printfstr db "integer==%d, localint==%d, commvar=%d"
+         db 10, 0
+
+; some pointers
+localptr  dd localint          ; [5] [17]
+textptr          dd greet              ; [15]
+selfptr          dd selfptr            ; [16]
+
+         SECTION .bss
+
+; an integer
+integer          resd 1                ; [3]
+
+; a local integer
+localint  resd 1               ; [6]
+
+         SECTION .rodata
+readonly  dd readonly          ; [18]
diff --git a/test/elftest.c b/test/elftest.c
new file mode 100644 (file)
index 0000000..42b3f7e
--- /dev/null
@@ -0,0 +1,38 @@
+/*
+ * test source file for assembling to ELF
+ * build with:
+ *    nasm -f elf elftest.asm
+ *    gcc -o elftest elftest.c elftest.o
+ * (assuming your gcc is ELF)
+ */
+
+#include <stdio.h>
+#include <inttypes.h>
+
+extern int lrotate(int32_t, int);
+extern void greet(void);
+extern int8_t asmstr[];
+extern void *selfptr;
+extern void *textptr;
+extern int integer, commvar;
+
+int main(void)
+{
+
+    printf("Testing lrotate: should get 0x00400000, 0x00000001\n");
+    printf("lrotate(0x00040000, 4) = 0x%08lx\n", lrotate(0x40000, 4));
+    printf("lrotate(0x00040000, 14) = 0x%08lx\n", lrotate(0x40000, 14));
+
+    printf("This string should read `hello, world': `%s'\n", asmstr);
+
+    printf("The integers here should be 1234, 1235 and 4321:\n");
+    integer = 1234;
+    commvar = 4321;
+    greet();
+
+    printf("These pointers should be equal: %p and %p\n", &greet, textptr);
+
+    printf("So should these: %p and %p\n", selfptr, &selfptr);
+
+    return 0;
+}
diff --git a/test/elftest64.c b/test/elftest64.c
new file mode 100644 (file)
index 0000000..1f3dec1
--- /dev/null
@@ -0,0 +1,43 @@
+/*
+ *  build with:
+ *     nasm -f elf64 elf64so.asm
+ *     ld -shared -o elf64so.so elf64so.o
+ * test with:
+ *     gcc -o elf64so elftest64.c ./elf64so.so
+ *     ./elf64so
+ */
+
+#include <stdio.h>
+#include <inttypes.h>
+
+extern long lrotate(long, int);
+extern void greet_s(void);
+extern void greet_m(void);
+extern int8_t asmstr[];
+extern void *selfptr;
+extern void *textptr;
+extern long integer;
+long commvar;
+
+int main(void)
+{
+
+    printf("Testing lrotate: should get 0x00400000, 0x00000001\n");
+    printf("lrotate(0x00040000, 4) = 0x%08lx\n", lrotate(0x40000, 4));
+    printf("lrotate(0x00040000, 46) = 0x%08lx\n", lrotate(0x40000, 46));
+
+    printf("This string should read `hello, world': `%s'\n", asmstr);
+
+    printf("&integer = %p, &commvar = %p\n", &integer, &commvar);
+    printf("The integers here should be 1234, 1235 and 4321:\n");
+    integer = 1234;
+    commvar = 4321;
+    greet_s();
+    greet_m();
+
+    printf("These pointers should be equal: %p and %p\n", &greet_s, textptr);
+
+    printf("So should these: %p and %p\n", selfptr, &selfptr);
+
+    return 0;
+}
diff --git a/test/elif.asm b/test/elif.asm
new file mode 100644 (file)
index 0000000..49e6668
--- /dev/null
@@ -0,0 +1,39 @@
+;Testname=unoptimized; Arguments=-O0 -fobj -oelif.obj; Files=stdout stderr elif.obj
+;Testname=optimized;   Arguments=-Ox -fobj -oelif.obj; Files=stdout stderr elif.obj
+
+%macro DosPrintMsg 1+
+%ifnid %1
+section .data
+%%str_to_print:db %1
+section .text
+ mov dx,%%str_to_print
+ mov ah,9
+ int 0x21
+%else
+ mov dx,(%1)
+ mov ah,9
+ int 0x21
+%endif
+%endmacro
+
+%macro DosExit 1
+%if (%1) == 0
+;use short-form return 0 exit
+ int 0x20
+%elif ((%1) < 256) && ((%1) > 0)
+ mov ax,0x4C00 | (%1)
+ int 0x21
+%else
+%error Invalid return value
+%endif
+%endmacro
+
+org 0x100
+ DosPrintMsg predefined_str
+ DosPrintMsg "Using string with macro-defined label",10,0
+ DosExit 0
+ DosExit 1
+ DosExit 256
+
+section .data
+predefined_str:db "Using string with predefined label",10,0
diff --git a/test/expimp.asm b/test/expimp.asm
new file mode 100644 (file)
index 0000000..89e32a1
--- /dev/null
@@ -0,0 +1,90 @@
+;Testname=O0; Arguments=-O0 -fbin -oexpimp.bin; Files=stdout stderr expimp.bin
+;Testname=O1; Arguments=-O1 -fbin -oexpimp.bin; Files=stdout stderr expimp.bin
+;Testname=Ox; Arguments=-Ox -fbin -oexpimp.bin; Files=stdout stderr expimp.bin
+;Testname=error-O0; Arguments=-O0 -fbin -oexpimp.bin -DERROR; Files=stdout stderr expimp.bin
+;Testname=error-Ox; Arguments=-Ox -fbin -oexpimp.bin -DERROR; Files=stdout stderr expimp.bin
+
+;
+; Test of explicitly and implicitly sized operands
+;
+       BITS 32
+
+       add esi,2                       ; Implicit
+       add esi,123456h                 ; Implicit
+       add esi,byte 2                  ; Explicit
+       add esi,dword 2                 ; Explicit
+       add esi,dword 123456h           ; Explicit
+       add esi,byte 123456h            ; Explicit Truncation
+
+       add esi,strict 2                ; Implicit Strict
+       add esi,strict 123456h          ; Implicit Strict
+       add esi,strict byte 2           ; Explicit Strict
+       add esi,strict dword 2          ; Explicit Strict
+       add esi,strict dword 123456h    ; Explicit Strict
+       add esi,strict byte 123456h     ; Explicit Strict Truncation
+
+       add eax,2                       ; Implicit
+       add eax,123456h                 ; Implicit
+       add eax,byte 2                  ; Explicit
+       add eax,dword 2                 ; Explicit
+       add eax,dword 123456h           ; Explicit
+       add eax,byte 123456h            ; Explicit Truncation
+
+       add eax,strict 2                ; Implicit Strict
+       add eax,strict 123456h          ; Implicit Strict
+       add eax,strict byte 2           ; Explicit Strict
+       add eax,strict dword 2          ; Explicit Strict
+       add eax,strict dword 123456h    ; Explicit Strict
+       add eax,strict byte 123456h     ; Explicit Strict Truncation
+
+       imul dx,3                       ; Implicit
+       imul dx,byte 3                  ; Explicit
+       imul dx,word 3                  ; Explicit
+       imul dx,strict byte 3           ; Explicit Strict
+       imul dx,strict word 3           ; Explicit Strict
+
+;
+; Same thing with branches
+;
+start:
+       jmp short start                 ; Explicit
+       jmp near start                  ; Explicit
+       jmp word start                  ; Explicit
+       jmp dword start                 ; Explicit
+       jmp short forward               ; Explicit
+       jmp near forward                ; Explicit
+       jmp word forward                ; Explicit
+       jmp dword forward               ; Explicit
+%ifdef ERROR
+       jmp short faraway               ; Explicit (ERROR)
+%endif
+       jmp near faraway                ; Explicit
+       jmp word faraway                ; Explicit
+       jmp dword faraway               ; Explicit
+       jmp start                       ; Implicit
+       jmp forward                     ; Implicit
+       jmp faraway                     ; Implicit
+
+       jmp strict short start          ; Explicit Strict
+       jmp strict near start           ; Explicit Strict
+       jmp strict word start           ; Explicit Strict
+       jmp strict dword start          ; Explicit Strict
+       jmp strict short forward        ; Explicit Strict
+       jmp strict near forward         ; Explicit Strict
+       jmp strict word forward         ; Explicit Strict
+       jmp strict dword forward        ; Explicit Strict
+%ifdef ERROR
+       jmp strict short faraway        ; Explicit (ERROR)
+%endif
+       jmp strict near faraway         ; Explicit Strict
+       jmp strict word faraway         ; Explicit Strict
+       jmp strict dword faraway        ; Explicit Strict
+       jmp strict start                ; Implicit Strict
+       jmp strict forward              ; Implicit Strict
+       jmp strict faraway              ; Implicit Strict
+forward:
+
+       times 256 nop
+faraway:
+
+
diff --git a/test/far64.asm b/test/far64.asm
new file mode 100644 (file)
index 0000000..e18bca4
--- /dev/null
@@ -0,0 +1,10 @@
+;Testname=test; Arguments=-fbin -ofar64.bin; Files=stdout stderr far64.bin
+; BR 2039212
+       bits 64
+
+       call qword far [rax]
+       jmp qword far [rax]
+       call dword far [rax]
+       jmp dword far [rax]
+       call far [rax]
+       jmp far [rax]
diff --git a/test/float.asm b/test/float.asm
new file mode 100644 (file)
index 0000000..88519b2
--- /dev/null
@@ -0,0 +1,186 @@
+;Testname=unoptimized; Arguments=-O0 -fbin -ofloat.bin; Files=stdout stderr float.bin
+;Testname=optimized;   Arguments=-Ox -fbin -ofloat.bin; Files=stdout stderr float.bin
+
+;
+; Test of floating-point formats
+;
+
+; 8-bit
+       db 1.0
+       db +1.0
+       db -1.0
+       db 1.5
+       db +1.5
+       db -1.5
+       db 0.0
+       db +0.0
+       db -0.0
+       db 1.83203125
+       db +1.83203125
+       db -1.83203125
+       db 1.83203125e1
+       db +1.83203125e1
+       db -1.83203125e1
+       db 1.83203125e-1
+       db +1.83203125e-1
+       db -1.83203125e-1
+       db 1.13203125e-2                ; Denormal!
+       db +1.13203125e-2               ; Denormal!
+       db -1.13203125e-2               ; Denormal!
+       db __Infinity__
+       db +__Infinity__
+       db -__Infinity__
+       db __NaN__
+       db __QNaN__
+       db __SNaN__
+       db 3.1415926535_8979323846_2643383279_5028841971_6939937510_5
+
+; 16-bit
+       dw 1.0
+       dw +1.0
+       dw -1.0
+       dw 1.5
+       dw +1.5
+       dw -1.5
+       dw 0.0
+       dw +0.0
+       dw -0.0
+       dw 1.83203125
+       dw +1.83203125
+       dw -1.83203125
+       dw 1.83203125e3
+       dw +1.83203125e3
+       dw -1.83203125e3
+       dw 1.83203125e-3
+       dw +1.83203125e-3
+       dw -1.83203125e-3
+       dw 1.83203125e-6                ; Denormal!
+       dw +1.83203125e-6               ; Denormal!
+       dw -1.83203125e-6               ; Denormal!
+       dw __Infinity__
+       dw +__Infinity__
+       dw -__Infinity__
+       dw __NaN__
+       dw __QNaN__
+       dw __SNaN__
+       dw 3.1415926535_8979323846_2643383279_5028841971_6939937510_5
+
+; 32-bit
+       dd 1.0
+       dd +1.0
+       dd -1.0
+       dd 1.5
+       dd +1.5
+       dd -1.5
+       dd 0.0
+       dd +0.0
+       dd -0.0
+       dd 1.83203125
+       dd +1.83203125
+       dd -1.83203125
+       dd 1.83203125e15
+       dd +1.83203125e15
+       dd -1.83203125e15
+       dd 1.83203125e-15
+       dd +1.83203125e-15
+       dd -1.83203125e-15
+       dd 1.83203125e-40               ; Denormal!
+       dd +1.83203125e-40              ; Denormal!
+       dd -1.83203125e-40              ; Denormal!
+       dd __Infinity__
+       dd +__Infinity__
+       dd -__Infinity__
+       dd __NaN__
+       dd __QNaN__
+       dd __SNaN__
+       dd 3.1415926535_8979323846_2643383279_5028841971_6939937510_5
+
+; 64-bit
+       dq 1.0
+       dq +1.0
+       dq -1.0
+       dq 1.5
+       dq +1.5
+       dq -1.5
+       dq 0.0
+       dq +0.0
+       dq -0.0
+       dq 1.83203125
+       dq +1.83203125
+       dq -1.83203125
+       dq 1.83203125e300
+       dq +1.83203125e300
+       dq -1.83203125e300
+       dq 1.83203125e-300
+       dq +1.83203125e-300
+       dq -1.83203125e-300
+       dq 1.83203125e-320              ; Denormal!
+       dq +1.83203125e-320             ; Denormal!
+       dq -1.83203125e-320             ; Denormal!
+       dq __Infinity__
+       dq +__Infinity__
+       dq -__Infinity__
+       dq __NaN__
+       dq __QNaN__
+       dq __SNaN__
+       dq 3.1415926535_8979323846_2643383279_5028841971_6939937510_5
+       
+; 80-bit
+       dt 1.0
+       dt +1.0
+       dt -1.0
+       dt 1.5
+       dt +1.5
+       dt -1.5
+       dt 0.0
+       dt +0.0
+       dt -0.0
+       dt 1.83203125
+       dt +1.83203125
+       dt -1.83203125
+       dt 1.83203125e+4000
+       dt +1.83203125e+4000
+       dt -1.83203125e+4000
+       dt 1.83203125e-4000
+       dt +1.83203125e-4000
+       dt -1.83203125e-4000
+       dt 1.83203125e-4940             ; Denormal!
+       dt +1.83203125e-4940            ; Denormal!
+       dt -1.83203125e-4940            ; Denormal!
+       dt __Infinity__
+       dt +__Infinity__
+       dt -__Infinity__
+       dt __NaN__
+       dt __QNaN__
+       dt __SNaN__
+       dt 3.1415926535_8979323846_2643383279_5028841971_6939937510_5
+
+; 128-bit
+       do 1.0
+       do +1.0
+       do -1.0
+       do 1.5
+       do +1.5
+       do -1.5
+       do 0.0
+       do +0.0
+       do -0.0
+       do 1.83203125
+       do +1.83203125
+       do -1.83203125
+       do 1.83203125e+4000
+       do +1.83203125e+4000
+       do -1.83203125e+4000
+       do 1.83203125e-4000
+       do +1.83203125e-4000
+       do -1.83203125e-4000
+       do 1.83203125e-4940             ; Denormal!
+       do +1.83203125e-4940            ; Denormal!
+       do -1.83203125e-4940            ; Denormal!
+       do __Infinity__
+       do +__Infinity__
+       do -__Infinity__
+       do __NaN__
+       do __QNaN__
+       do __SNaN__
+       do 3.1415926535_8979323846_2643383279_5028841971_6939937510_5
diff --git a/test/float8.asm b/test/float8.asm
new file mode 100644 (file)
index 0000000..d59abec
--- /dev/null
@@ -0,0 +1,135 @@
+;Testname=unoptimized; Arguments=-O0 -fbin -ofloat8.bin; Files=stdout stderr float8.bin
+;Testname=optimized;   Arguments=-Ox -fbin -ofloat8.bin; Files=stdout stderr float8.bin
+
+; Test of 8-bit floating-point constants
+
+       ; Zero
+       db 0.0                  ; 00h
+
+       ; Denorms
+       db 0.001953125          ; 01h
+       db 0.00390625           ; 02h
+       db 0.005859375          ; 03h
+       db 0.0078125            ; 04h
+       db 0.009765625          ; 05h
+       db 0.01171875           ; 06h
+       db 0.013671875          ; 07h
+
+       ; Normals
+       db 0.015625             ; 08h
+       db 0.017578125          ; 09h
+       db 0.01953125           ; 0Ah
+       db 0.021484375          ; 0Bh
+       db 0.0234375            ; 0Ch
+       db 0.025390625          ; 0Dh
+       db 0.02734375           ; 0Eh
+       db 0.029296875          ; 0Fh
+       db 0.03125              ; 10h
+       db 0.03515625           ; 11h
+       db 0.0390625            ; 12h
+       db 0.04296875           ; 13h
+       db 0.046875             ; 14h
+       db 0.05078125           ; 15h
+       db 0.0546875            ; 16h
+       db 0.05859375           ; 17h
+       db 0.0625               ; 18h
+       db 0.0703125            ; 19h
+       db 0.078125             ; 1Ah
+       db 0.0859375            ; 1Bh
+       db 0.09375              ; 1Ch
+       db 0.1015625            ; 1Dh
+       db 0.109375             ; 1Eh
+       db 0.1171875            ; 1Fh
+       db 0.125                ; 20h
+       db 0.140625             ; 21h
+       db 0.15625              ; 22h
+       db 0.171875             ; 23h
+       db 0.1875               ; 24h
+       db 0.203125             ; 25h
+       db 0.21875              ; 26h
+       db 0.234375             ; 27h
+       db 0.25                 ; 28h
+       db 0.28125              ; 29h
+       db 0.3125               ; 2Ah
+       db 0.34375              ; 2Bh
+       db 0.375                ; 2Ch
+       db 0.40625              ; 2Dh
+       db 0.4375               ; 2Eh
+       db 0.46875              ; 2Fh
+       db 0.5                  ; 30h
+       db 0.5625               ; 31h
+       db 0.625                ; 32h
+       db 0.6875               ; 33h
+       db 0.75                 ; 34h
+       db 0.8125               ; 35h
+       db 0.875                ; 36h
+       db 0.9375               ; 37h
+       db 1.0                  ; 38h
+       db 1.125                ; 39h
+       db 1.25                 ; 3Ah
+       db 1.375                ; 3Bh
+       db 1.5                  ; 3Ch
+       db 1.625                ; 3Dh
+       db 1.75                 ; 3Eh
+       db 1.875                ; 3Fh
+       db 2.0                  ; 40h
+       db 2.25                 ; 41h
+       db 2.5                  ; 42h
+       db 2.75                 ; 43h
+       db 3.0                  ; 44h
+       db 3.25                 ; 45h
+       db 3.5                  ; 46h
+       db 3.75                 ; 47h
+       db 4.0                  ; 48h
+       db 4.5                  ; 49h
+       db 5.0                  ; 4Ah
+       db 5.5                  ; 4Bh
+       db 6.0                  ; 4Ch
+       db 6.5                  ; 4Dh
+       db 7.0                  ; 4Eh
+       db 7.5                  ; 4Fh
+       db 8.0                  ; 50h
+       db 9.0                  ; 51h
+       db 10.0                 ; 52h
+       db 11.0                 ; 53h
+       db 12.0                 ; 54h
+       db 13.0                 ; 55h
+       db 14.0                 ; 56h
+       db 15.0                 ; 57h
+       db 16.0                 ; 58h
+       db 18.0                 ; 59h
+       db 20.0                 ; 5Ah
+       db 22.0                 ; 5Bh
+       db 24.0                 ; 5Ch
+       db 26.0                 ; 5Dh
+       db 28.0                 ; 5Eh
+       db 30.0                 ; 5Fh
+       db 32.0                 ; 60h
+       db 36.0                 ; 61h
+       db 40.0                 ; 62h
+       db 44.0                 ; 63h
+       db 48.0                 ; 64h
+       db 52.0                 ; 65h
+       db 56.0                 ; 66h
+       db 60.0                 ; 67h
+       db 64.0                 ; 68h
+       db 72.0                 ; 69h
+       db 80.0                 ; 6Ah
+       db 88.0                 ; 6Bh
+       db 96.0                 ; 6Ch
+       db 104.0                ; 6Dh
+       db 112.0                ; 6Eh
+       db 120.0                ; 6Fh
+       db 128.0                ; 70h
+       db 144.0                ; 71h
+       db 160.0                ; 72h
+       db 176.0                ; 73h
+       db 192.0                ; 74h
+       db 208.0                ; 75h
+       db 224.0                ; 76h
+       db 240.0                ; 77h
+
+       ; Exceptionals
+       db __Infinity__         ; 78h
+       db __SNaN__             ; 79h
+       db __QNaN__             ; 7Ch
diff --git a/test/floatb.asm b/test/floatb.asm
new file mode 100644 (file)
index 0000000..dc0422e
--- /dev/null
@@ -0,0 +1,35 @@
+;Testname=unoptimized; Arguments=-O0 -fbin -ofloatb.bin; Files=stdout stderr floatb.bin
+;Testname=optimized;   Arguments=-Ox -fbin -ofloatb.bin; Files=stdout stderr floatb.bin
+
+       ;; Known problematic floating-point numbers and their proper
+       ;; encoding...
+
+       bits 64
+       
+       dd 1.1e10
+       dd 0x5023e9ac   ; Should be...
+       
+       dd 50.40e9
+       dd 0x513bc130   ; Should be...
+
+       dq 1.4e23
+       dq 0x44bda56a4b0835c0
+
+       dq 50.48e21
+       dq 0x44a5610d7502feae
+
+       dt 1.2e28
+       dq 0x9b18ab5df7180b6c
+       dw 0x405c
+       
+       dt 50.46e25
+       dq 0xd0b29a67e95dcb60
+       dw 0x4057
+
+       ;; Way too big numbers, should overflow to +Inf
+       dd 1.0E646456955
+       dd 1.0E646456956
+       dd 1.0E2147483646
+       dd 1.0E2147483647
+       dd 1.0E2147483648
+       dd 1.0E2147483649
diff --git a/test/floatexp.asm b/test/floatexp.asm
new file mode 100644 (file)
index 0000000..2bc359e
--- /dev/null
@@ -0,0 +1,382 @@
+;Testname=unoptimized; Arguments=-O0 -fbin -ofloatexp.bin; Files=stdout stderr floatexp.bin
+;Testname=optimized;   Arguments=-Ox -fbin -ofloatexp.bin; Files=stdout stderr floatexp.bin
+
+       bits 64
+;
+; Test of floating-point formats
+;
+
+; 8-bit
+       mov al,__float8__(1.0)
+       mov al,__float8__(+1.0)
+       mov al,__float8__(-1.0)
+       mov al,__float8__(0.0)
+       mov al,__float8__(+0.0)
+       mov al,__float8__(-0.0)
+       mov al,__float8__(1.83203125)
+       mov al,__float8__(+1.83203125)
+       mov al,__float8__(-1.83203125)
+       mov al,__float8__(1.83203125e1)
+       mov al,__float8__(+1.83203125e1)
+       mov al,__float8__(-1.83203125e1)
+       mov al,__float8__(1.83203125e-1)
+       mov al,__float8__(+1.83203125e-1)
+       mov al,__float8__(-1.83203125e-1)
+       mov al,__float8__(1.13203125e-2)                ; Denormal!
+       mov al,__float8__(+1.13203125e-2)               ; Denormal!
+       mov al,__float8__(-1.13203125e-2)               ; Denormal!
+       mov al,__float8__(__Infinity__)
+       mov al,__float8__(+__Infinity__)
+       mov al,__float8__(-__Infinity__)
+       mov al,__float8__(__NaN__)
+       mov al,__float8__(__QNaN__)
+       mov al,__float8__(__SNaN__)
+
+; 16-bit
+       mov ax,__float16__(1.0)
+       mov ax,__float16__(+1.0)
+       mov ax,__float16__(-1.0)
+       mov ax,__float16__(0.0)
+       mov ax,__float16__(+0.0)
+       mov ax,__float16__(-0.0)
+       mov ax,__float16__(1.83203125)
+       mov ax,__float16__(+1.83203125)
+       mov ax,__float16__(-1.83203125)
+       mov ax,__float16__(1.83203125e3)
+       mov ax,__float16__(+1.83203125e3)
+       mov ax,__float16__(-1.83203125e3)
+       mov ax,__float16__(1.83203125e-3)
+       mov ax,__float16__(+1.83203125e-3)
+       mov ax,__float16__(-1.83203125e-3)
+       mov ax,__float16__(1.83203125e-6)               ; Denormal!
+       mov ax,__float16__(+1.83203125e-6)              ; Denormal!
+       mov ax,__float16__(-1.83203125e-6)              ; Denormal!
+       mov ax,__float16__(__Infinity__)
+       mov ax,__float16__(+__Infinity__)
+       mov ax,__float16__(-__Infinity__)
+       mov ax,__float16__(__NaN__)
+       mov ax,__float16__(__QNaN__)
+       mov ax,__float16__(__SNaN__)
+
+; 32-bit
+       mov eax,__float32__(1.0)
+       mov eax,__float32__(+1.0)
+       mov eax,__float32__(-1.0)
+       mov eax,__float32__(0.0)
+       mov eax,__float32__(+0.0)
+       mov eax,__float32__(-0.0)
+       mov eax,__float32__(1.83203125)
+       mov eax,__float32__(+1.83203125)
+       mov eax,__float32__(-1.83203125)
+       mov eax,__float32__(1.83203125e15)
+       mov eax,__float32__(+1.83203125e15)
+       mov eax,__float32__(-1.83203125e15)
+       mov eax,__float32__(1.83203125e-15)
+       mov eax,__float32__(+1.83203125e-15)
+       mov eax,__float32__(-1.83203125e-15)
+       mov eax,__float32__(1.83203125e-40)             ; Denormal!
+       mov eax,__float32__(+1.83203125e-40)            ; Denormal!
+       mov eax,__float32__(-1.83203125e-40)            ; Denormal!
+       mov eax,__float32__(__Infinity__)
+       mov eax,__float32__(+__Infinity__)
+       mov eax,__float32__(-__Infinity__)
+       mov eax,__float32__(__NaN__)
+       mov eax,__float32__(__QNaN__)
+       mov eax,__float32__(__SNaN__)
+
+; 64-bit
+       mov rax,__float64__(1.0)
+       mov rax,__float64__(+1.0)
+       mov rax,__float64__(-1.0)
+       mov rax,__float64__(0.0)
+       mov rax,__float64__(+0.0)
+       mov rax,__float64__(-0.0)
+       mov rax,__float64__(1.83203125)
+       mov rax,__float64__(+1.83203125)
+       mov rax,__float64__(-1.83203125)
+       mov rax,__float64__(1.83203125e300)
+       mov rax,__float64__(+1.83203125e300)
+       mov rax,__float64__(-1.83203125e300)
+       mov rax,__float64__(1.83203125e-300)
+       mov rax,__float64__(+1.83203125e-300)
+       mov rax,__float64__(-1.83203125e-300)
+       mov rax,__float64__(1.83203125e-320)            ; Denormal!
+       mov rax,__float64__(+1.83203125e-320)           ; Denormal!
+       mov rax,__float64__(-1.83203125e-320)           ; Denormal!
+       mov rax,__float64__(__Infinity__)
+       mov rax,__float64__(+__Infinity__)
+       mov rax,__float64__(-__Infinity__)
+       mov rax,__float64__(__NaN__)
+       mov rax,__float64__(__QNaN__)
+       mov rax,__float64__(__SNaN__)
+
+; 80-bit
+       mov rax,__float80m__(1.0)
+       mov ax,__float80e__(1.0)
+       mov rax,__float80m__(+1.0)
+       mov ax,__float80e__(+1.0)
+       mov rax,__float80m__(-1.0)
+       mov ax,__float80e__(-1.0)
+       mov rax,__float80m__(0.0)
+       mov ax,__float80e__(0.0)
+       mov rax,__float80m__(+0.0)
+       mov ax,__float80e__(+0.0)
+       mov rax,__float80m__(-0.0)
+       mov ax,__float80e__(-0.0)
+       mov rax,__float80m__(1.83203125)
+       mov ax,__float80e__(1.83203125)
+       mov rax,__float80m__(+1.83203125)
+       mov ax,__float80e__(+1.83203125)
+       mov rax,__float80m__(-1.83203125)
+       mov ax,__float80e__(-1.83203125)
+       mov rax,__float80m__(1.83203125e+4000)
+       mov ax,__float80e__(1.83203125e+4000)
+       mov rax,__float80m__(+1.83203125e+4000)
+       mov ax,__float80e__(+1.83203125e+4000)
+       mov rax,__float80m__(-1.83203125e+4000)
+       mov ax,__float80e__(-1.83203125e+4000)
+       mov rax,__float80m__(1.83203125e-4000)
+       mov ax,__float80e__(1.83203125e-4000)
+       mov rax,__float80m__(+1.83203125e-4000)
+       mov ax,__float80e__(+1.83203125e-4000)
+       mov rax,__float80m__(-1.83203125e-4000)
+       mov ax,__float80e__(-1.83203125e-4000)
+       mov rax,__float80m__(1.83203125e-4940)          ; Denormal!
+       mov ax,__float80e__(1.83203125e-4940)           ; Denormal!
+       mov rax,__float80m__(+1.83203125e-4940)         ; Denormal!
+       mov ax,__float80e__(+1.83203125e-4940)          ; Denormal!
+       mov rax,__float80m__(-1.83203125e-4940)         ; Denormal!
+       mov ax,__float80e__(-1.83203125e-4940)          ; Denormal!
+       mov rax,__float80m__(__Infinity__)
+       mov ax,__float80e__(__Infinity__)
+       mov rax,__float80m__(+__Infinity__)
+       mov ax,__float80e__(+__Infinity__)
+       mov rax,__float80m__(-__Infinity__)
+       mov ax,__float80e__(-__Infinity__)
+       mov rax,__float80m__(__NaN__)
+       mov ax,__float80e__(__NaN__)
+       mov rax,__float80m__(__QNaN__)
+       mov ax,__float80e__(__QNaN__)
+       mov rax,__float80m__(__SNaN__)
+       mov ax,__float80e__(__SNaN__)
+
+; 128-bit
+       mov rax,__float128l__(1.0)
+       mov rax,__float128h__(1.0)
+       mov rax,__float128l__(+1.0)
+       mov rax,__float128h__(+1.0)
+       mov rax,__float128l__(-1.0)
+       mov rax,__float128h__(-1.0)
+       mov rax,__float128l__(0.0)
+       mov rax,__float128h__(0.0)
+       mov rax,__float128l__(+0.0)
+       mov rax,__float128h__(+0.0)
+       mov rax,__float128l__(-0.0)
+       mov rax,__float128h__(-0.0)
+       mov rax,__float128l__(1.83203125)
+       mov rax,__float128h__(1.83203125)
+       mov rax,__float128l__(+1.83203125)
+       mov rax,__float128h__(+1.83203125)
+       mov rax,__float128l__(-1.83203125)
+       mov rax,__float128h__(-1.83203125)
+       mov rax,__float128l__(1.83203125e+4000)
+       mov rax,__float128h__(1.83203125e+4000)
+       mov rax,__float128l__(+1.83203125e+4000)
+       mov rax,__float128h__(+1.83203125e+4000)
+       mov rax,__float128l__(-1.83203125e+4000)
+       mov rax,__float128h__(-1.83203125e+4000)
+       mov rax,__float128l__(1.83203125e-4000)
+       mov rax,__float128h__(1.83203125e-4000)
+       mov rax,__float128l__(+1.83203125e-4000)
+       mov rax,__float128h__(+1.83203125e-4000)
+       mov rax,__float128l__(-1.83203125e-4000)
+       mov rax,__float128h__(-1.83203125e-4000)
+       mov rax,__float128l__(1.83203125e-4940)         ; Denormal!
+       mov rax,__float128h__(1.83203125e-4940)         ; Denormal!
+       mov rax,__float128l__(+1.83203125e-4940)                ; Denormal!
+       mov rax,__float128h__(+1.83203125e-4940)                ; Denormal!
+       mov rax,__float128l__(-1.83203125e-4940)                ; Denormal!
+       mov rax,__float128h__(-1.83203125e-4940)                ; Denormal!
+       mov rax,__float128l__(__Infinity__)
+       mov rax,__float128h__(__Infinity__)
+       mov rax,__float128l__(+__Infinity__)
+       mov rax,__float128h__(+__Infinity__)
+       mov rax,__float128l__(-__Infinity__)
+       mov rax,__float128h__(-__Infinity__)
+       mov rax,__float128l__(__NaN__)
+       mov rax,__float128h__(__NaN__)
+       mov rax,__float128l__(__QNaN__)
+       mov rax,__float128h__(__QNaN__)
+       mov rax,__float128l__(__SNaN__)
+       mov rax,__float128h__(__SNaN__)
+
+;
+; Test hexadecimal floating-point numbers
+;
+; 16-bit
+       mov ax,__float16__(1.0)
+       mov ax,__float16__(0x1.0)
+       mov ax,__float16__(2.0)
+       mov ax,__float16__(0x2.0)
+       mov ax,__float16__(0x1.0p+1)
+       mov ax,__float16__(0x1.0p-1)
+       mov ax,__float16__(0x0.0)
+       mov ax,__float16__(0x1.23456789)
+       mov ax,__float16__(0x0.123456789)
+       mov ax,__float16__(0x0.0000123456789)
+       mov ax,__float16__(0x1.23456789p10)
+       mov ax,__float16__(0x1.23456789p+10)
+       mov ax,__float16__(0x1.23456789p-10)
+       mov ax,__float16__(0x0.123456789p10)
+       mov ax,__float16__(0x0.123456789p+10)
+       mov ax,__float16__(0x0.123456789abcdef0123456789abcdef012345p-10)
+       mov ax,__float16__(0x0.0000123456789)
+       mov ax,__float16__(0x0.0000123456789p+10)
+       mov ax,__float16__(0x0.0000123456789p-10)
+
+; 32-bit
+       mov eax,__float32__(1.0)
+       mov eax,__float32__(0x1.0)
+       mov eax,__float32__(2.0)
+       mov eax,__float32__(0x2.0)
+       mov eax,__float32__(0x1.0p+1)
+       mov eax,__float32__(0x1.0p-1)
+       mov eax,__float32__(0x0.0)
+       mov eax,__float32__(0x1.23456789)
+       mov eax,__float32__(0x0.123456789)
+       mov eax,__float32__(0x0.0000123456789)
+       mov eax,__float32__(0x1.23456789p10)
+       mov eax,__float32__(0x1.23456789p+10)
+       mov eax,__float32__(0x1.23456789p-10)
+       mov eax,__float32__(0x0.123456789p10)
+       mov eax,__float32__(0x0.123456789p+10)
+       mov eax,__float32__(0x0.123456789abcdef0123456789abcdef012345p-10)
+       mov eax,__float32__(0x0.0000123456789)
+       mov eax,__float32__(0x0.0000123456789p+10)
+       mov eax,__float32__(0x0.0000123456789p-10)
+       mov eax,__float32__(0x123456789.0)
+       mov eax,__float32__(0x0000123456789.0)
+       mov eax,__float32__(0x123456789.0p+0)
+       mov eax,__float32__(0x123456789.0p+64)
+
+; 64-bit
+       mov rax,__float64__(1.0)
+       mov rax,__float64__(0x1.0)
+       mov rax,__float64__(2.0)
+       mov rax,__float64__(0x2.0)
+       mov rax,__float64__(0x1.0p+1)
+       mov rax,__float64__(0x1.0p-1)
+       mov rax,__float64__(0x0.0)
+       mov rax,__float64__(0x1.23456789)
+       mov rax,__float64__(0x0.123456789)
+       mov rax,__float64__(0x0.0000123456789)
+       mov rax,__float64__(0x1.23456789p10)
+       mov rax,__float64__(0x1.23456789p+10)
+       mov rax,__float64__(0x1.23456789p-10)
+       mov rax,__float64__(0x0.123456789p10)
+       mov rax,__float64__(0x0.123456789p+10)
+       mov rax,__float64__(0x0.123456789abcdef0123456789abcdef012345p-10)
+       mov rax,__float64__(0x0.0000123456789)
+       mov rax,__float64__(0x0.0000123456789p+10)
+       mov rax,__float64__(0x0.0000123456789p-10)
+       mov rax,__float64__(0x123456789.0)
+       mov rax,__float64__(0x0000123456789.0)
+       mov rax,__float64__(0x123456789.0p+0)
+       mov rax,__float64__(0x123456789.0p+300)
+       
+; 80-bit
+       mov rax,__float80m__(1.0)
+       mov ax,__float80e__(1.0)
+       mov rax,__float80m__(0x1.0)
+       mov ax,__float80e__(0x1.0)
+       mov rax,__float80m__(2.0)
+       mov ax,__float80e__(2.0)
+       mov rax,__float80m__(0x2.0)
+       mov ax,__float80e__(0x2.0)
+       mov rax,__float80m__(0x1.0p+1)
+       mov ax,__float80e__(0x1.0p+1)
+       mov rax,__float80m__(0x1.0p-1)
+       mov ax,__float80e__(0x1.0p-1)
+       mov rax,__float80m__(0x0.0)
+       mov ax,__float80e__(0x0.0)
+       mov rax,__float80m__(0x1.23456789)
+       mov ax,__float80e__(0x1.23456789)
+       mov rax,__float80m__(0x0.123456789)
+       mov ax,__float80e__(0x0.123456789)
+       mov rax,__float80m__(0x0.0000123456789)
+       mov ax,__float80e__(0x0.0000123456789)
+       mov rax,__float80m__(0x1.23456789p10)
+       mov ax,__float80e__(0x1.23456789p10)
+       mov rax,__float80m__(0x1.23456789p+10)
+       mov ax,__float80e__(0x1.23456789p+10)
+       mov rax,__float80m__(0x1.23456789p-10)
+       mov ax,__float80e__(0x1.23456789p-10)
+       mov rax,__float80m__(0x0.123456789p10)
+       mov ax,__float80e__(0x0.123456789p10)
+       mov rax,__float80m__(0x0.123456789p+10)
+       mov ax,__float80e__(0x0.123456789p+10)
+       mov rax,__float80m__(0x0.123456789abcdef0123456789abcdef012345p-10)
+       mov ax,__float80e__(0x0.123456789abcdef0123456789abcdef012345p-10)
+       mov rax,__float80m__(0x0.0000123456789)
+       mov ax,__float80e__(0x0.0000123456789)
+       mov rax,__float80m__(0x0.0000123456789p+10)
+       mov ax,__float80e__(0x0.0000123456789p+10)
+       mov rax,__float80m__(0x0.0000123456789p-10)
+       mov ax,__float80e__(0x0.0000123456789p-10)
+       mov rax,__float80m__(0x123456789.0)
+       mov ax,__float80e__(0x123456789.0)
+       mov rax,__float80m__(0x0000123456789.0)
+       mov ax,__float80e__(0x0000123456789.0)
+       mov rax,__float80m__(0x123456789.0p+0)
+       mov ax,__float80e__(0x123456789.0p+0)
+       mov rax,__float80m__(0x123456789.0p+1024)
+       mov ax,__float80e__(0x123456789.0p+1024)
+
+; 128-bit
+       mov rax,__float128l__(1.0)
+       mov rax,__float128h__(1.0)
+       mov rax,__float128l__(0x1.0)
+       mov rax,__float128h__(0x1.0)
+       mov rax,__float128l__(2.0)
+       mov rax,__float128h__(2.0)
+       mov rax,__float128l__(0x2.0)
+       mov rax,__float128h__(0x2.0)
+       mov rax,__float128l__(0x1.0p+1)
+       mov rax,__float128h__(0x1.0p+1)
+       mov rax,__float128l__(0x1.0p-1)
+       mov rax,__float128h__(0x1.0p-1)
+       mov rax,__float128l__(0x0.0)
+       mov rax,__float128h__(0x0.0)
+       mov rax,__float128l__(0x1.23456789)
+       mov rax,__float128h__(0x1.23456789)
+       mov rax,__float128l__(0x0.123456789)
+       mov rax,__float128h__(0x0.123456789)
+       mov rax,__float128l__(0x0.0000123456789)
+       mov rax,__float128h__(0x0.0000123456789)
+       mov rax,__float128l__(0x1.23456789p10)
+       mov rax,__float128h__(0x1.23456789p10)
+       mov rax,__float128l__(0x1.23456789p+10)
+       mov rax,__float128h__(0x1.23456789p+10)
+       mov rax,__float128l__(0x1.23456789p-10)
+       mov rax,__float128h__(0x1.23456789p-10)
+       mov rax,__float128l__(0x0.123456789p10)
+       mov rax,__float128h__(0x0.123456789p10)
+       mov rax,__float128l__(0x0.123456789p+10)
+       mov rax,__float128h__(0x0.123456789p+10)
+       mov rax,__float128l__(0x0.123456789abcdef0123456789abcdef012345p-10)
+       mov rax,__float128h__(0x0.123456789abcdef0123456789abcdef012345p-10)
+       mov rax,__float128l__(0x0.0000123456789)
+       mov rax,__float128h__(0x0.0000123456789)
+       mov rax,__float128l__(0x0.0000123456789p+10)
+       mov rax,__float128h__(0x0.0000123456789p+10)
+       mov rax,__float128l__(0x0.0000123456789p-10)
+       mov rax,__float128h__(0x0.0000123456789p-10)
+       mov rax,__float128l__(0x123456789.0)
+       mov rax,__float128h__(0x123456789.0)
+       mov rax,__float128l__(0x0000123456789.0)
+       mov rax,__float128h__(0x0000123456789.0)
+       mov rax,__float128l__(0x123456789.0p+0)
+       mov rax,__float128h__(0x123456789.0p+0)
+       mov rax,__float128l__(0x123456789.0p+1024)
+       mov rax,__float128h__(0x123456789.0p+1024)
diff --git a/test/floatize.asm b/test/floatize.asm
new file mode 100644 (file)
index 0000000..cc0bbe9
--- /dev/null
@@ -0,0 +1,19 @@
+;Testname=unoptimized; Arguments=-O0 -fbin -ofloatize.bin; Files=stdout stderr floatize.bin
+;Testname=optimized;   Arguments=-Ox -fbin -ofloatize.bin; Files=stdout stderr floatize.bin
+
+%assign        x13     13+26
+%assign f16   __float16__(1.6e-7)
+%assign f32   __float32__(1.6e-7)
+%assign f64   __float64__(1.6e-7)
+%assign f80m  __float80m__(1.6e-7)
+%assign f80e  __float80e__(1.6e-7)
+%assign f128l __float128l__(1.6e-7)
+%assign f128h __float128h__(1.6e-7)
+
+       dw f16
+       dd f32
+       dq f64
+       dq f80m
+       dw f80e
+       dq f128l
+       dq f128h
diff --git a/test/floattest.asm b/test/floattest.asm
new file mode 100644 (file)
index 0000000..3c7ba8b
--- /dev/null
@@ -0,0 +1,28 @@
+;Testname=optimized; Arguments=-Ox -felf -ofloattest.o; Files=stdout stderr floattest.o
+
+; nasm -O99 -f elf32 floattest.asm
+; ld -m elf_i386 -o floattest floattest.o -I/lib/ld-linux.so.2 -lc
+
+       global _start
+       extern printf
+
+       section .text
+_start:
+
+       fld qword [num1]
+       fadd qword [num2]
+       sub esp, 8
+       fstp qword [esp]
+       push fmt
+       call printf
+       add esp, 4*3
+
+       mov eax, 1
+       xor ebx, ebx
+       int 80h
+
+       section .data
+num1   dq 41.5
+num2   dq 0.5
+
+fmt    db "%f", 10, 0
diff --git a/test/floatx.asm b/test/floatx.asm
new file mode 100644 (file)
index 0000000..7368e50
--- /dev/null
@@ -0,0 +1,525 @@
+;
+; floatx.asm
+;
+; Test hexadecimal floating-point numbers
+
+%define Inf __Infinity__
+%define NaN __QNaN__
+
+; 16-bit
+       dw 1.0
+       dw 0x1.0
+       dw 2.0
+       dw 0x2.0
+       dw 0x1.0p+1
+       dw 0x1.0p-1
+       dw 0x0.0
+       dw 0x1.23456789
+       dw 0x0.123456789
+       dw 0x0.0000123456789
+       dw 0x1.23456789p10
+       dw 0x1.23456789p+10
+       dw 0x1.23456789p-10
+       dw 0x0.123456789p10
+       dw 0x0.123456789p+10
+       dw 0x0.123456789abcdef0123456789abcdef012345p-10
+       dw 0x0.0000123456789
+       dw 0x0.0000123456789p+10
+       dw 0x0.0000123456789p-10
+       dw 0x1.0p-25            ; Underflow
+       dw 0x1.01p-25           ; Rounds to denorm
+       dw 0x1.0p-24            ; Smallest denorm
+       dw 0x1.ffffffffffffffffffffffffffffp-16 ; Rounds to denorm
+       dw 0x1.0p-15            ; Denorm
+       dw 0x1.ffffffffffffffffffffffffffffp-15 ; Rounds to normal
+       dw 0x1.0p-14            ; Smallest non-denorm
+       dw 0x1.0p+15            ; Biggest possible exponent
+       dw 0x1.ffffffffffffffffffffffffffffp+15 ; Rounds to infinity
+       dw Inf                  ; Infinity
+       dw NaN
+
+; 32-bit
+       dd 1.0
+       dd 0x1.0
+       dd 2.0
+       dd 0x2.0
+       dd 0x1.0p+1
+       dd 0x1.0p-1
+       dd 0x0.0
+       dd 0x1.23456789
+       dd 0x0.123456789
+       dd 0x0.0000123456789
+       dd 0x1.23456789p10
+       dd 0x1.23456789p+10
+       dd 0x1.23456789p-10
+       dd 0x0.123456789p10
+       dd 0x0.123456789p+10
+       dd 0x0.123456789abcdef0123456789abcdef012345p-10
+       dd 0x0.0000123456789
+       dd 0x0.0000123456789p+10
+       dd 0x0.0000123456789p-10
+       dd 0x123456789.0
+       dd 0x0000123456789.0
+       dd 0x123456789.0p+0
+       dd 0x123456789.0p+64
+       dd 0x1.0p-150           ; Underflow
+       dd 0x1.01p-150          ; Rounds to denorm
+       dd 0x1.0p-149           ; Smallest denorm
+       dd 0x1.ffffffffffffffffffffffffffffp-128        ; Rounds to denorm
+       dd 0x1.0p-127           ; Denorm
+       dd 0x1.ffffffffffffffffffffffffffffp-127        ; Rounds to normal
+       dd 0x1.0p-126           ; Smallest non-denorm
+       dd 0x1.0p+127           ; Biggest possible exponent
+       dd 0x1.ffffffffffffffffffffffffffffp+127        ; Rounds to infinity
+       dd Inf                  ; Infinity
+       dd NaN
+
+; 64-bit
+       dq 1.0
+       dq 0x1.0
+       dq 2.0
+       dq 0x2.0
+       dq 0x1.0p+1
+       dq 0x1.0p-1
+       dq 0x0.0
+       dq 0x1.23456789
+       dq 0x0.123456789
+       dq 0x0.0000123456789
+       dq 0x1.23456789p10
+       dq 0x1.23456789p+10
+       dq 0x1.23456789p-10
+       dq 0x0.123456789p10
+       dq 0x0.123456789p+10
+       dq 0x0.123456789abcdef0123456789abcdef012345p-10
+       dq 0x0.0000123456789
+       dq 0x0.0000123456789p+10
+       dq 0x0.0000123456789p-10
+       dq 0x123456789.0
+       dq 0x0000123456789.0
+       dq 0x123456789.0p+0
+       dq 0x123456789.0p+300
+       dq 0x1.0p-1075          ; Underflow
+       dq 0x1.01p-1075         ; Rounds to denorm
+       dq 0x1.0p-1074          ; Smallest denorm
+       dq 0x1.ffffffffffffffffffffffffffffp-1024       ; Rounds to denorm
+       dq 0x1.0p-1023          ; Denorm
+       dq 0x1.ffffffffffffffffffffffffffffp-1023       ; Rounds to normal
+       dq 0x1.0p-1022          ; Smallest non-denorm
+       dq 0x1.0p+1023          ; Biggest possible exponent
+       dq 0x1.ffffffffffffffffffffffffffffp+1023       ; Rounds to infinity
+       dq Inf                  ; Infinity
+       dq NaN
+
+; 80-bit
+       dt 1.0
+       dt 0x1.0
+       dt 2.0
+       dt 0x2.0
+       dt 0x1.0p+1
+       dt 0x1.0p-1
+       dt 0x0.0
+       dt 0x1.23456789
+       dt 0x0.123456789
+       dt 0x0.0000123456789
+       dt 0x1.23456789p10
+       dt 0x1.23456789p+10
+       dt 0x1.23456789p-10
+       dt 0x0.123456789p10
+       dt 0x0.123456789p+10
+       dt 0x0.123456789abcdef0123456789abcdef012345p-10
+       dt 0x0.0000123456789
+       dt 0x0.0000123456789p+10
+       dt 0x0.0000123456789p-10
+       dt 0x123456789.0
+       dt 0x0000123456789.0
+       dt 0x123456789.0p+0
+       dt 0x123456789.0p+1024
+       dt 0x1.0p-16446         ; Underflow
+       dt 0x1.01p-16446        ; Rounds to denorm
+       dt 0x1.0p-16445         ; Smallest denorm
+       dt 0x1.ffffffffffffffffffffffffffffp-16384      ; Rounds to denorm
+       dt 0x1.0p-16383         ; Denorm
+       dt 0x1.ffffffffffffffffffffffffffffp-16383      ; Rounds to normal
+       dt 0x1.0p-16382         ; Smallest non-denorm
+       dt 0x1.0p+16383         ; Biggest possible exponent
+       dt 0x1.ffffffffffffffffffffffffffffp+16383      ; Rounds to infinity
+       dt Inf                  ; Infinity
+       dt NaN
+
+; 128-bit
+       do 1.0
+       do 0x1.0
+       do 2.0
+       do 0x2.0
+       do 0x1.0p+1
+       do 0x1.0p-1
+       do 0x0.0
+       do 0x1.23456789
+       do 0x0.123456789
+       do 0x0.0000123456789
+       do 0x1.23456789p10
+       do 0x1.23456789p+10
+       do 0x1.23456789p-10
+       do 0x0.123456789p10
+       do 0x0.123456789p+10
+       do 0x0.123456789abcdef0123456789abcdef012345p-10
+       do 0x0.0000123456789
+       do 0x0.0000123456789p+10
+       do 0x0.0000123456789p-10
+       do 0x123456789.0
+       do 0x0000123456789.0
+       do 0x123456789.0p+0
+       do 0x123456789.0p+1024
+       do 0x1.0p-16495         ; Underflow
+       do 0x1.01p-16495        ; Rounds to denorm
+       do 0x1.0p-16494         ; Smallest denorm
+       do 0x1.ffffffffffffffffffffffffffffffffp-16384  ; Rounds to denorm
+       do 0x1.0p-16383         ; Denorm
+       do 0x1.ffffffffffffffffffffffffffffffffp-16383  ; Rounds to normal
+       do 0x1.0p-16382         ; Smallest non-denorm
+       do 0x1.0p+16383         ; Biggest possible exponent
+       do 0x1.ffffffffffffffffffffffffffffffffp+16383  ; Rounds to infinity
+       do Inf                  ; Infinity
+       do NaN
+
+; 16-bit
+       dw 1.0
+       dw 0h1.0
+       dw 2.0
+       dw 0h2.0
+       dw 0h1.0p+1
+       dw 0h1.0p-1
+       dw 0h0.0
+       dw 0h1.23456789
+       dw 0h0.123456789
+       dw 0h0.0000123456789
+       dw 0h1.23456789p10
+       dw 0h1.23456789p+10
+       dw 0h1.23456789p-10
+       dw 0h0.123456789p10
+       dw 0h0.123456789p+10
+       dw 0h0.123456789abcdef0123456789abcdef012345p-10
+       dw 0h0.0000123456789
+       dw 0h0.0000123456789p+10
+       dw 0h0.0000123456789p-10
+       dw 0h1.0p-25            ; Underflow
+       dw 0h1.0p-24            ; Smallest denorm
+       dw 0h1.ffffffffffffffffffffffffffffp-16 ; Rounds to denorm
+       dw 0h1.0p-15            ; Denorm
+       dw 0h1.ffffffffffffffffffffffffffffp-15 ; Rounds to normal
+       dw 0h1.0p-14            ; Smallest non-denorm
+       dw 0h1.0p+15            ; Biggest possible exponent
+       dw 0h1.ffffffffffffffffffffffffffffp+15 ; Rounds to infinity
+       dw Inf                  ; Infinity
+       dw NaN
+
+; 32-bit
+       dd 1.0
+       dd 0h1.0
+       dd 2.0
+       dd 0h2.0
+       dd 0h1.0p+1
+       dd 0h1.0p-1
+       dd 0h0.0
+       dd 0h1.23456789
+       dd 0h0.123456789
+       dd 0h0.0000123456789
+       dd 0h1.23456789p10
+       dd 0h1.23456789p+10
+       dd 0h1.23456789p-10
+       dd 0h0.123456789p10
+       dd 0h0.123456789p+10
+       dd 0h0.123456789abcdef0123456789abcdef012345p-10
+       dd 0h0.0000123456789
+       dd 0h0.0000123456789p+10
+       dd 0h0.0000123456789p-10
+       dd 0h123456789.0
+       dd 0h0000123456789.0
+       dd 0h123456789.0p+0
+       dd 0h123456789.0p+64
+       dd 0h1.0p-150           ; Underflow
+       dd 0h1.0p-149           ; Smallest denorm
+       dd 0h1.ffffffffffffffffffffffffffffp-128        ; Rounds to denorm
+       dd 0h1.0p-127           ; Denorm
+       dd 0h1.ffffffffffffffffffffffffffffp-127        ; Rounds to normal
+       dd 0h1.0p-126           ; Smallest non-denorm
+       dd 0h1.0p+127           ; Biggest possible exponent
+       dd 0h1.ffffffffffffffffffffffffffffp+127        ; Rounds to infinity
+       dd Inf                  ; Infinity
+       dd NaN
+
+; 64-bit
+       dq 1.0
+       dq 0h1.0
+       dq 2.0
+       dq 0h2.0
+       dq 0h1.0p+1
+       dq 0h1.0p-1
+       dq 0h0.0
+       dq 0h1.23456789
+       dq 0h0.123456789
+       dq 0h0.0000123456789
+       dq 0h1.23456789p10
+       dq 0h1.23456789p+10
+       dq 0h1.23456789p-10
+       dq 0h0.123456789p10
+       dq 0h0.123456789p+10
+       dq 0h0.123456789abcdef0123456789abcdef012345p-10
+       dq 0h0.0000123456789
+       dq 0h0.0000123456789p+10
+       dq 0h0.0000123456789p-10
+       dq 0h123456789.0
+       dq 0h0000123456789.0
+       dq 0h123456789.0p+0
+       dq 0h123456789.0p+300
+       dq 0h1.0p-1075          ; Underflow
+       dq 0h1.0p-1074          ; Smallest denorm
+       dq 0h1.ffffffffffffffffffffffffffffp-1024       ; Rounds to denorm
+       dq 0h1.0p-1023          ; Denorm
+       dq 0h1.ffffffffffffffffffffffffffffp-1023       ; Rounds to normal
+       dq 0h1.0p-1022          ; Smallest non-denorm
+       dq 0h1.0p+1023          ; Biggest possible exponent
+       dq 0h1.ffffffffffffffffffffffffffffp+1023       ; Rounds to infinity
+       dq Inf                  ; Infinity
+       dq NaN
+
+; 80-bit
+       dt 1.0
+       dt 0h1.0
+       dt 2.0
+       dt 0h2.0
+       dt 0h1.0p+1
+       dt 0h1.0p-1
+       dt 0h0.0
+       dt 0h1.23456789
+       dt 0h0.123456789
+       dt 0h0.0000123456789
+       dt 0h1.23456789p10
+       dt 0h1.23456789p+10
+       dt 0h1.23456789p-10
+       dt 0h0.123456789p10
+       dt 0h0.123456789p+10
+       dt 0h0.123456789abcdef0123456789abcdef012345p-10
+       dt 0h0.0000123456789
+       dt 0h0.0000123456789p+10
+       dt 0h0.0000123456789p-10
+       dt 0h123456789.0
+       dt 0h0000123456789.0
+       dt 0h123456789.0p+0
+       dt 0h123456789.0p+1024
+       dt 0h1.0p-16446         ; Underflow
+       dt 0h1.0p-16445         ; Smallest denorm
+       dt 0h1.ffffffffffffffffffffffffffffp-16384      ; Rounds to denorm
+       dt 0h1.0p-16383         ; Denorm
+       dt 0h1.ffffffffffffffffffffffffffffp-16383      ; Rounds to normal
+       dt 0h1.0p-16382         ; Smallest non-denorm
+       dt 0h1.0p+16383         ; Biggest possible exponent
+       dt 0h1.ffffffffffffffffffffffffffffp+16383      ; Rounds to infinity
+       dt Inf                  ; Infinity
+       dt NaN
+
+; 128-bit
+       do 1.0
+       do 0h1.0
+       do 2.0
+       do 0h2.0
+       do 0h1.0p+1
+       do 0h1.0p-1
+       do 0h0.0
+       do 0h1.23456789
+       do 0h0.123456789
+       do 0h0.0000123456789
+       do 0h1.23456789p10
+       do 0h1.23456789p+10
+       do 0h1.23456789p-10
+       do 0h0.123456789p10
+       do 0h0.123456789p+10
+       do 0h0.123456789abcdef0123456789abcdef012345p-10
+       do 0h0.0000123456789
+       do 0h0.0000123456789p+10
+       do 0h0.0000123456789p-10
+       do 0h123456789.0
+       do 0h0000123456789.0
+       do 0h123456789.0p+0
+       do 0h123456789.0p+1024
+       do 0h1.0p-16495         ; Underflow
+       do 0h1.0p-16494         ; Smallest denorm
+       do 0h1.ffffffffffffffffffffffffffffffffp-16384  ; Rounds to denorm
+       do 0h1.0p-16383         ; Denorm
+       do 0h1.ffffffffffffffffffffffffffffffffp-16383  ; Rounds to normal
+       do 0h1.0p-16382         ; Smallest non-denorm
+       do 0h1.0p+16383         ; Biggest possible exponent
+       do 0h1.ffffffffffffffffffffffffffffffffp+16383  ; Rounds to infinity
+       do Inf                  ; Infinity
+       do NaN
+
+; 16-bit
+       dw 1.0
+       dw $1.0
+       dw 2.0
+       dw $2.0
+       dw $1.0p+1
+       dw $1.0p-1
+       dw $0.0
+       dw $1.23456789
+       dw $0.123456789
+       dw $0.0000123456789
+       dw $1.23456789p10
+       dw $1.23456789p+10
+       dw $1.23456789p-10
+       dw $0.123456789p10
+       dw $0.123456789p+10
+       dw $0.123456789abcdef0123456789abcdef012345p-10
+       dw $0.0000123456789
+       dw $0.0000123456789p+10
+       dw $0.0000123456789p-10
+       dw $1.0p-25             ; Underflow
+       dw $1.0p-24             ; Smallest denorm
+       dw $1.ffffffffffffffffffffffffffffp-16  ; Rounds to denorm
+       dw $1.0p-15             ; Denorm
+       dw $1.ffffffffffffffffffffffffffffp-15  ; Rounds to normal
+       dw $1.0p-14             ; Smallest non-denorm
+       dw $1.0p+15             ; Biggest possible exponent
+       dw $1.ffffffffffffffffffffffffffffp+15  ; Rounds to infinity
+       dw Inf                  ; Infinity
+       dw NaN
+
+; 32-bit
+       dd 1.0
+       dd $1.0
+       dd 2.0
+       dd $2.0
+       dd $1.0p+1
+       dd $1.0p-1
+       dd $0.0
+       dd $1.23456789
+       dd $0.123456789
+       dd $0.0000123456789
+       dd $1.23456789p10
+       dd $1.23456789p+10
+       dd $1.23456789p-10
+       dd $0.123456789p10
+       dd $0.123456789p+10
+       dd $0.123456789abcdef0123456789abcdef012345p-10
+       dd $0.0000123456789
+       dd $0.0000123456789p+10
+       dd $0.0000123456789p-10
+       dd $123456789.0
+       dd $0000123456789.0
+       dd $123456789.0p+0
+       dd $123456789.0p+64
+       dd $1.0p-150            ; Underflow
+       dd $1.0p-149            ; Smallest denorm
+       dd $1.ffffffffffffffffffffffffffffp-128 ; Rounds to denorm
+       dd $1.0p-127            ; Denorm
+       dd $1.ffffffffffffffffffffffffffffp-127 ; Rounds to normal
+       dd $1.0p-126            ; Smallest non-denorm
+       dd $1.0p+127            ; Biggest possible exponent
+       dd $1.ffffffffffffffffffffffffffffp+127 ; Rounds to infinity
+       dd Inf                  ; Infinity
+       dd NaN
+
+; 64-bit
+       dq 1.0
+       dq $1.0
+       dq 2.0
+       dq $2.0
+       dq $1.0p+1
+       dq $1.0p-1
+       dq $0.0
+       dq $1.23456789
+       dq $0.123456789
+       dq $0.0000123456789
+       dq $1.23456789p10
+       dq $1.23456789p+10
+       dq $1.23456789p-10
+       dq $0.123456789p10
+       dq $0.123456789p+10
+       dq $0.123456789abcdef0123456789abcdef012345p-10
+       dq $0.0000123456789
+       dq $0.0000123456789p+10
+       dq $0.0000123456789p-10
+       dq $123456789.0
+       dq $0000123456789.0
+       dq $123456789.0p+0
+       dq $123456789.0p+300
+       dq $1.0p-1075           ; Underflow
+       dq $1.0p-1074           ; Smallest denorm
+       dq $1.ffffffffffffffffffffffffffffp-1024        ; Rounds to denorm
+       dq $1.0p-1023           ; Denorm
+       dq $1.ffffffffffffffffffffffffffffp-1023        ; Rounds to normal
+       dq $1.0p-1022           ; Smallest non-denorm
+       dq $1.0p+1023           ; Biggest possible exponent
+       dq $1.ffffffffffffffffffffffffffffp+1023        ; Rounds to infinity
+       dq Inf                  ; Infinity
+       dq NaN
+
+; 80-bit
+       dt 1.0
+       dt $1.0
+       dt 2.0
+       dt $2.0
+       dt $1.0p+1
+       dt $1.0p-1
+       dt $0.0
+       dt $1.23456789
+       dt $0.123456789
+       dt $0.0000123456789
+       dt $1.23456789p10
+       dt $1.23456789p+10
+       dt $1.23456789p-10
+       dt $0.123456789p10
+       dt $0.123456789p+10
+       dt $0.123456789abcdef0123456789abcdef012345p-10
+       dt $0.0000123456789
+       dt $0.0000123456789p+10
+       dt $0.0000123456789p-10
+       dt $123456789.0
+       dt $0000123456789.0
+       dt $123456789.0p+0
+       dt $123456789.0p+1024
+       dt $1.0p-16446          ; Underflow
+       dt $1.0p-16445          ; Smallest denorm
+       dt $1.ffffffffffffffffffffffffffffp-16384       ; Rounds to denorm
+       dt $1.0p-16383          ; Denorm
+       dt $1.ffffffffffffffffffffffffffffp-16383       ; Rounds to normal
+       dt $1.0p-16382          ; Smallest non-denorm
+       dt $1.0p+16383          ; Biggest possible exponent
+       dt $1.ffffffffffffffffffffffffffffp+16383       ; Rounds to infinity
+       dt Inf                  ; Infinity
+       dt NaN
+
+; 128-bit
+       do 1.0
+       do $1.0
+       do 2.0
+       do $2.0
+       do $1.0p+1
+       do $1.0p-1
+       do $0.0
+       do $1.23456789
+       do $0.123456789
+       do $0.0000123456789
+       do $1.23456789p10
+       do $1.23456789p+10
+       do $1.23456789p-10
+       do $0.123456789p10
+       do $0.123456789p+10
+       do $0.123456789abcdef0123456789abcdef012345p-10
+       do $0.0000123456789
+       do $0.0000123456789p+10
+       do $0.0000123456789p-10
+       do $123456789.0
+       do $0000123456789.0
+       do $123456789.0p+0
+       do $123456789.0p+1024
+       do $1.0p-16495          ; Underflow
+       do $1.0p-16494          ; Smallest denorm
+       do $1.ffffffffffffffffffffffffffffffffp-16384   ; Rounds to denorm
+       do $1.0p-16383          ; Denorm
+       do $1.ffffffffffffffffffffffffffffffffp-16383   ; Rounds to normal
+       do $1.0p-16382          ; Smallest non-denorm
+       do $1.0p+16383          ; Biggest possible exponent
+       do $1.ffffffffffffffffffffffffffffffffp+16383   ; Rounds to infinity
+       do Inf                  ; Infinity
+       do NaN
diff --git a/test/fpu.asm b/test/fpu.asm
new file mode 100644 (file)
index 0000000..4051fdd
--- /dev/null
@@ -0,0 +1,127 @@
+;Testname=test; Arguments=-fbin -ofpu.bin; Files=stdout stderr fpu.bin
+
+; relaxed encodings for FPU instructions, which NASM should support
+; -----------------------------------------------------------------
+
+%define void
+%define reg_fpu0 st0
+%define reg_fpu st1
+
+; no operands instead of one operand:
+
+  ; F(U)COM(P), FCOM2, FCOMP3, FCOMP5
+
+    FCOM            void
+    FCOMP           void
+    FUCOM           void
+    FUCOMP          void
+;    FCOM2           void
+;    FCOMP3          void
+;    FCOMP5          void
+
+  ; FLD, FST, FSTP, FSTP1, FSTP8, FSTP9
+
+    FLD             void
+    FST             void
+    FSTP            void
+;    FSTP1           void
+;    FSTP8           void
+;    FSTP9           void
+
+  ; FXCH, FXCH4, FXCH7, FFREE, FFREEP
+
+    FXCH            void
+;    FXCH4           void
+;    FXCH7           void
+    FFREE           void
+    FFREEP          void
+
+; no operands instead of two operands:
+
+  ; FADD(P), FMUL(P), FSUBR(P), FSUB(P), FDIVR(P), FDIV(P)
+
+    FADD            void
+    FADDP           void
+    FMUL            void
+    FMULP           void
+    FSUBR           void
+    FSUBRP          void
+    FSUB            void
+    FSUBP           void
+    FDIVR           void
+    FDIVRP          void
+    FDIV            void
+    FDIVP           void
+
+; one operand instead of two operands:
+
+  ; FADD, FMUL, FSUB, FSUBR, FDIV, FDIVR
+
+    FADD            reg_fpu
+    FMUL            reg_fpu
+    FSUB            reg_fpu
+    FSUBR           reg_fpu
+    FDIV            reg_fpu
+    FDIVR           reg_fpu
+
+  ; FADD, FMUL, FSUBR, FSUB, FDIVR, FDIV (with TO qualifier)
+
+    FADD            to reg_fpu
+    FMUL            to reg_fpu
+    FSUBR           to reg_fpu
+    FSUB            to reg_fpu
+    FDIVR           to reg_fpu
+    FDIV            to reg_fpu
+
+  ; FADDP, FMULP, FSUBRP, FSUBP, FDIVRP, FDIVP
+
+    FADDP           reg_fpu
+    FMULP           reg_fpu
+    FSUBRP          reg_fpu
+    FSUBP           reg_fpu
+    FDIVRP          reg_fpu
+    FDIVP           reg_fpu
+
+  ; FCMOV(N)B, FCMOV(N)E, FCMOV(N)BE, FCMOV(N)U, and F(U)COMI(P)
+
+    FCMOVB          reg_fpu
+    FCMOVNB         reg_fpu
+    FCMOVE          reg_fpu
+    FCMOVNE         reg_fpu
+    FCMOVBE         reg_fpu
+    FCMOVNBE        reg_fpu
+    FCMOVU          reg_fpu
+    FCMOVNU         reg_fpu
+    FCOMI           reg_fpu
+    FCOMIP          reg_fpu
+    FUCOMI          reg_fpu
+    FUCOMIP         reg_fpu
+
+; two operands instead of one operand:
+
+  ; these don't really exist, and thus are _NOT_ supported:
+
+;   FCOM            reg_fpu,reg_fpu0
+;   FCOM            reg_fpu0,reg_fpu
+;   FUCOM           reg_fpu,reg_fpu0
+;   FUCOM           reg_fpu0,reg_fpu
+;   FCOMP           reg_fpu,reg_fpu0
+;   FCOMP           reg_fpu0,reg_fpu
+;   FUCOMP          reg_fpu,reg_fpu0
+;   FUCOMP          reg_fpu0,reg_fpu
+
+;   FCOM2           reg_fpu,reg_fpu0
+;   FCOM2           reg_fpu0,reg_fpu
+;   FCOMP3          reg_fpu,reg_fpu0
+;   FCOMP3          reg_fpu0,reg_fpu
+;   FCOMP5          reg_fpu,reg_fpu0
+;   FCOMP5          reg_fpu0,reg_fpu
+
+;   FXCH            reg_fpu,reg_fpu0
+;   FXCH            reg_fpu0,reg_fpu
+;   FXCH4           reg_fpu,reg_fpu0
+;   FXCH4           reg_fpu0,reg_fpu
+;   FXCH7           reg_fpu,reg_fpu0
+;   FXCH7           reg_fpu0,reg_fpu
+
+; EOF
diff --git a/test/fwdopt.asm b/test/fwdopt.asm
new file mode 100644 (file)
index 0000000..48dbc3f
--- /dev/null
@@ -0,0 +1,133 @@
+;Testname=test; Arguments=-fbin -ofwdopt.bin; Files=stdout stderr fwdopt.bin
+n0:    jmp n1
+n1:    jmp n2
+n2:    jmp n3
+n3:    jmp n4
+n4:    jmp n5
+n5:    jmp n6
+n6:    jmp n7
+n7:    jmp n8
+n8:    jmp n9
+n9:    jmp n10
+n10:   jmp n11
+n11:   jmp n12
+n12:   jmp n13
+n13:   jmp n14
+n14:   jmp n15
+n15:   jmp n16
+n16:   jmp n17
+n17:   jmp n18
+n18:   jmp n19
+n19:   jmp n20
+n20:   jmp n21
+n21:   jmp n22
+n22:   jmp n23
+n23:   jmp n24
+n24:   jmp n25
+n25:   jmp n26
+n26:   jmp n27
+n27:   jmp n28
+n28:   jmp n29
+n29:   jmp n30
+n30:   jmp n31
+n31:   jmp n32
+n32:   jmp n33
+n33:   jmp n34
+n34:   jmp n35
+n35:   jmp n36
+n36:   jmp n37
+n37:   jmp n38
+n38:   jmp n39
+n39:   jmp n40
+n40:   jmp n41
+n41:   jmp n42
+n42:   jmp n43
+n43:   jmp n44
+n44:   jmp n45
+n45:   jmp n46
+n46:   jmp n47
+n47:   jmp n48
+n48:   jmp n49
+n49:   jmp n50
+n50:   jmp n51
+n51:   jmp n52
+n52:   jmp n53
+n53:   jmp n54
+n54:   jmp n55
+n55:   jmp n56
+n56:   jmp n57
+n57:   jmp n58
+n58:   jmp n59
+n59:   jmp n60
+n60:   jmp n61
+n61:   jmp n62
+n62:   jmp n63
+n63:   jmp n64
+n64:   jmp n65
+n65:   jmp n66
+n66:   jmp n67
+n67:   jmp n68
+n68:   jmp n69
+n69:   jmp n70
+n70:   jmp n71
+n71:   jmp n72
+n72:   jmp n73
+n73:   jmp n74
+n74:   jmp n75
+n75:   jmp n76
+n76:   jmp n77
+n77:   jmp n78
+n78:   jmp n79
+n79:   jmp n80
+n80:   jmp n81
+n81:   jmp n82
+n82:   jmp n83
+n83:   jmp n84
+n84:   jmp n85
+n85:   jmp n86
+n86:   jmp n87
+n87:   jmp n88
+n88:   jmp n89
+n89:   jmp n90
+n90:   jmp n91
+n91:   jmp n92
+n92:   jmp n93
+n93:   jmp n94
+n94:   jmp n95
+n95:   jmp n96
+n96:   jmp n97
+n97:   jmp n98
+n98:   jmp n99
+n99:   jmp n100
+n100:  jmp n101
+n101:  jmp n102
+n102:  jmp n103
+n103:  jmp n104
+n104:  jmp n105
+n105:  jmp n106
+n106:  jmp n107
+n107:  jmp n108
+n108:  jmp n109
+n109:  jmp n110
+n110:  jmp n111
+n111:  jmp n112
+n112:  jmp n113
+n113:  jmp n114
+n114:  jmp n115
+n115:  jmp n116
+n116:  jmp n117
+n117:  jmp n118
+n118:  jmp n119
+n119:  jmp n120
+n120:  jmp n121
+n121:  jmp n122
+n122:  jmp n123
+n123:  jmp n124
+n124:  jmp n125
+n125:  jmp n126
+n126:  jmp n127
+n127:  jmp n0
+
+       ;;  This should emit exactly 3 NOP bytes
+       times 260-($-$$) nop
+       hlt
diff --git a/test/fwdoptpp.asm b/test/fwdoptpp.asm
new file mode 100644 (file)
index 0000000..e1f5dd6
--- /dev/null
@@ -0,0 +1,150 @@
+;Testname=error; Arguments=-fbin -DERROR -ofwdoptpp.bin; Files=stdout stderr fwdoptpp.bin
+;Testname=fatal; Arguments=-fbin -DFATAL -ofwdoptpp.bin; Files=stdout stderr fwdoptpp.bin
+;Testname=warning; Arguments=-fbin -DWARNING -ofwdoptpp.bin; Files=stdout stderr fwdoptpp.bin
+
+%ifndef ERROR
+  %ifndef FATAL
+    %ifndef WARNING
+      %define ERROR 1
+    %endif
+  %endif
+%endif
+       
+n0:    jmp n1
+n1:    jmp n2
+n2:    jmp n3
+n3:    jmp n4
+n4:    jmp n5
+n5:    jmp n6
+n6:    jmp n7
+n7:    jmp n8
+n8:    jmp n9
+n9:    jmp n10
+n10:   jmp n11
+n11:   jmp n12
+n12:   jmp n13
+n13:   jmp n14
+n14:   jmp n15
+n15:   jmp n16
+n16:   jmp n17
+n17:   jmp n18
+n18:   jmp n19
+n19:   jmp n20
+n20:   jmp n21
+n21:   jmp n22
+n22:   jmp n23
+n23:   jmp n24
+n24:   jmp n25
+n25:   jmp n26
+n26:   jmp n27
+n27:   jmp n28
+n28:   jmp n29
+n29:   jmp n30
+n30:   jmp n31
+n31:   jmp n32
+n32:   jmp n33
+n33:   jmp n34
+n34:   jmp n35
+n35:   jmp n36
+n36:   jmp n37
+n37:   jmp n38
+n38:   jmp n39
+n39:   jmp n40
+n40:   jmp n41
+n41:   jmp n42
+n42:   jmp n43
+n43:   jmp n44
+n44:   jmp n45
+n45:   jmp n46
+n46:   jmp n47
+n47:   jmp n48
+n48:   jmp n49
+n49:   jmp n50
+n50:   jmp n51
+n51:   jmp n52
+n52:   jmp n53
+n53:   jmp n54
+n54:   jmp n55
+n55:   jmp n56
+n56:   jmp n57
+n57:   jmp n58
+n58:   jmp n59
+n59:   jmp n60
+n60:   jmp n61
+n61:   jmp n62
+n62:   jmp n63
+n63:   jmp n64
+n64:   jmp n65
+n65:   jmp n66
+n66:   jmp n67
+n67:   jmp n68
+n68:   jmp n69
+n69:   jmp n70
+n70:   jmp n71
+n71:   jmp n72
+n72:   jmp n73
+n73:   jmp n74
+n74:   jmp n75
+n75:   jmp n76
+n76:   jmp n77
+n77:   jmp n78
+n78:   jmp n79
+n79:   jmp n80
+n80:   jmp n81
+n81:   jmp n82
+n82:   jmp n83
+n83:   jmp n84
+n84:   jmp n85
+n85:   jmp n86
+n86:   jmp n87
+n87:   jmp n88
+n88:   jmp n89
+n89:   jmp n90
+n90:   jmp n91
+n91:   jmp n92
+n92:   jmp n93
+n93:   jmp n94
+n94:   jmp n95
+n95:   jmp n96
+n96:   jmp n97
+n97:   jmp n98
+n98:   jmp n99
+n99:   jmp n100
+n100:  jmp n101
+n101:  jmp n102
+n102:  jmp n103
+n103:  jmp n104
+n104:  jmp n105
+n105:  jmp n106
+n106:  jmp n107
+n107:  jmp n108
+n108:  jmp n109
+n109:  jmp n110
+n110:  jmp n111
+n111:  jmp n112
+n112:  jmp n113
+n113:  jmp n114
+n114:  jmp n115
+n115:  jmp n116
+n116:  jmp n117
+n117:  jmp n118
+n118:  jmp n119
+n119:  jmp n120
+n120:  jmp n121
+n121:  jmp n122
+n122:  jmp n123
+n123:  jmp n124
+n124:  jmp n125
+n125:  jmp n126
+n126:  jmp n127
+n127:  jmp n0
+       
+%if ($-$$) > 257
+  %ifdef FATAL
+    %fatal "Out of space!"
+  %elifdef ERROR
+    %error "Out of space!"
+  %elifdef WARNING
+    %warning "Out of space!"
+  %endif
+%endif
diff --git a/test/gotoff64.asm b/test/gotoff64.asm
new file mode 100644 (file)
index 0000000..05f5882
--- /dev/null
@@ -0,0 +1,25 @@
+;Testname=noerr; Arguments=-felf64 -ogotoff64.o; Files=stdout stderr gotoff64.o
+;Testname=err; Arguments=-DERROR -felf64 -ogotoff64.o; Files=stdout stderr gotoff64.o
+
+       bits 64
+       default rel
+
+       extern foo
+
+       mov r15,[foo wrt ..got]
+       lea r12,[foo wrt ..got]
+%ifdef ERROR
+       lea rax,[foo wrt ..gotoff]
+       mov rax,[foo wrt ..gotoff]
+%endif
+
+       default abs
+
+       mov r15,[foo wrt ..got]
+       lea r12,[foo wrt ..got]
+       mov rax,[qword foo wrt ..got]
+%ifdef ERROR
+       lea rax,[foo wrt ..gotoff]
+       mov rax,[foo wrt ..gotoff]
+%endif
+       mov rax,[qword foo wrt ..gotoff]
diff --git a/test/ifelse.asm b/test/ifelse.asm
new file mode 100644 (file)
index 0000000..bbb0d79
--- /dev/null
@@ -0,0 +1,46 @@
+;Testname=ifelse; Arguments=-fbin -oifelse.bin; Files=stdout stderr ifelse.bin
+
+;No problems -> db 3
+%if 0
+ db 0
+%elif 0 > 0
+ db 1
+%elif 1 < 1
+ db 2
+%else
+ db 3
+%endif
+
+;Garbage after else, elif after else -> db 5
+%if 0
+  db 4
+%else trailing garbage
+  db 5
+%elif 1
+  db 6
+%endif
+
+;Garbage after endif ->
+%if 0
+  db 7
+%endif trailing garbage
+
+;else after else -> db 9
+%if 0
+  db 8
+%else
+  db 9
+%else
+  db 10
+%endif
+
+;Problem preprocessed out, no warning ->
+%if 0
+  %if 1
+    db 11
+  %else
+    db 12
+  %else
+    db 13
+  %endif
+%endif
diff --git a/test/ifmacro.asm b/test/ifmacro.asm
new file mode 100644 (file)
index 0000000..53f3d29
--- /dev/null
@@ -0,0 +1,413 @@
+;Testname=test; Arguments=-fbin -oifmacro.txt; Files=stdout stderr ifmacro.txt
+
+;
+; ifmacro.asm
+;
+; Test of the new ifmacro directive
+;
+; This file produces a human-readable text file when compiled
+; with -f bin
+;
+
+%define LF 10
+
+%macro dummy 2
+       db 'This is a dummy macro, '
+       db 'arg1 = ', %1, ', '
+       db 'arg2 = ', %2, LF
+%endmacro
+
+       dummy 'this', 'that'
+
+%ifdef CR
+       db '%ifdef CR', LF
+%endif
+
+%ifdef LF
+       db '%ifdef LF', LF
+%endif
+
+%ifmacro dummy 1
+       db '%ifmacro dummy 1', LF
+%endif
+
+%ifmacro dummy 2
+       db '%ifmacro dummy 2', LF
+%endif
+
+%ifmacro dummy 3
+       db '%ifmacro dummy 3', LF
+%endif
+
+%ifmacro dummy 1+
+       db '%ifmacro dummy 1+', LF
+%endif
+
+%ifmacro dummy 2+
+       db '%ifmacro dummy 2+', LF
+%endif
+
+%ifmacro dummy 3+
+       db '%ifmacro dummy 3+', LF
+%endif
+
+%ifmacro dummy
+       db '%ifmacro dummy', LF
+%endif
+
+%ifmacro dummy 0-1
+       db '%ifmacro dummy 0-1', LF
+%endif
+
+%ifmacro dummy 1-2
+       db '%ifmacro dummy 1-2', LF
+%endif
+
+%ifmacro dummy 2-3
+       db '%ifmacro dummy 2-3', LF
+%endif
+
+%ifmacro dummy 3-4
+       db '%ifmacro dummy 3-4', LF
+%endif
+
+%ifmacro LF
+       db '%ifmacro LF', LF
+%endif
+
+%ifndef CR
+       db '%ifndef CR', LF
+%endif
+
+%ifndef LF
+       db '%ifndef LF', LF
+%endif
+
+%ifnmacro dummy 1
+       db '%ifnmacro dummy 1', LF
+%endif
+
+%ifnmacro dummy 2
+       db '%ifnmacro dummy 2', LF
+%endif
+
+%ifnmacro dummy 3
+       db '%ifnmacro dummy 3', LF
+%endif
+
+%ifnmacro dummy 1+
+       db '%ifnmacro dummy 1+', LF
+%endif
+
+%ifnmacro dummy 2+
+       db '%ifnmacro dummy 2+', LF
+%endif
+
+%ifnmacro dummy 3+
+       db '%ifnmacro dummy 3+', LF
+%endif
+
+%ifnmacro dummy
+       db '%ifnmacro dummy', LF
+%endif
+
+%ifnmacro dummy 0-1
+       db '%ifnmacro dummy 0-1', LF
+%endif
+
+%ifnmacro dummy 1-2
+       db '%ifnmacro dummy 1-2', LF
+%endif
+
+%ifnmacro dummy 2-3
+       db '%ifnmacro dummy 2-3', LF
+%endif
+
+%ifnmacro dummy 3-4
+       db '%ifnmacro dummy 3-4', LF
+%endif
+
+%ifnmacro LF
+       db '%ifnmacro LF', LF
+%endif
+
+%if 0
+%elifdef CR
+       db '%elifdef CR', CR
+%endif
+
+%if 0
+%elifdef LF
+       db '%elifdef LF', LF
+%endif
+
+%if 0
+%elifmacro dummy 1
+       db '%elifmacro dummy 1', LF
+%endif
+
+%if 0
+%elifmacro dummy 2
+       db '%elifmacro dummy 2', LF
+%endif
+
+%if 0
+%elifmacro dummy 3
+       db '%elifmacro dummy 3', LF
+%endif
+
+%if 0
+%elifmacro dummy 1+
+       db '%elifmacro dummy 1+', LF
+%endif
+
+%if 0
+%elifmacro dummy 2+
+       db '%elifmacro dummy 2+', LF
+%endif
+
+%if 0
+%elifmacro dummy 3+
+       db '%elifmacro dummy 3+', LF
+%endif
+
+%if 0
+%elifmacro dummy
+       db '%elifmacro dummy', LF
+%endif
+
+%if 0
+%elifmacro dummy 0-1
+       db '%elifmacro dummy 0-1', LF
+%endif
+
+%if 0
+%elifmacro dummy 1-2
+       db '%elifmacro dummy 1-2', LF
+%endif
+
+%if 0
+%elifmacro dummy 2-3
+       db '%elifmacro dummy 2-3', LF
+%endif
+
+%if 0
+%elifmacro dummy 3-4
+       db '%elifmacro dummy 3-4', LF
+%endif
+
+%if 0
+%elifmacro LF
+       db '%elifmacro LF', LF
+%endif
+
+%if 0
+%elifndef CR
+       db '%elifndef CR', LF
+%endif
+
+%if 0
+%elifndef LF
+       db '%elifndef LF', LF
+%endif
+
+%if 0
+%elifnmacro dummy 1
+       db '%elifnmacro dummy 1', LF
+%endif
+
+%if 0
+%elifnmacro dummy 2
+       db '%elifnmacro dummy 2', LF
+%endif
+
+%if 0
+%elifnmacro dummy 3
+       db '%elifnmacro dummy 3', LF
+%endif
+
+%if 0
+%elifnmacro dummy 1+
+       db '%elifnmacro dummy 1+', LF
+%endif
+
+%if 0
+%elifnmacro dummy 2+
+       db '%elifnmacro dummy 2+', LF
+%endif
+
+%if 0
+%elifnmacro dummy 3+
+       db '%elifnmacro dummy 3+', LF
+%endif
+
+%if 0
+%elifnmacro dummy
+       db '%elifnmacro dummy', LF
+%endif
+
+%if 0
+%elifnmacro dummy 0-1
+       db '%elifnmacro dummy 0-1', LF
+%endif
+
+%if 0
+%elifnmacro dummy 1-2
+       db '%elifnmacro dummy 1-2', LF
+%endif
+
+%if 0
+%elifnmacro dummy 2-3
+       db '%elifnmacro dummy 2-3', LF
+%endif
+
+%if 0
+%elifnmacro dummy 3-4
+       db '%elifnmacro dummy 3-4', LF
+%endif
+
+%if 0
+%elifnmacro LF
+       db '%elifnmacro LF', LF
+%endif
+
+%if 1
+%elifdef CR
+       db 'bad %elifdef CR', LF
+%endif
+
+%if 1
+%elifdef LF
+       db 'bad %elifdef LF', LF
+%endif
+
+%if 1
+%elifmacro dummy 1
+       db 'bad %elifmacro dummy 1', LF
+%endif
+
+%if 1
+%elifmacro dummy 2
+       db 'bad %elifmacro dummy 2', LF
+%endif
+
+%if 1
+%elifmacro dummy 3
+       db 'bad %elifmacro dummy 3', LF
+%endif
+
+%if 1
+%elifmacro dummy 1+
+       db 'bad %elifmacro dummy 1+', LF
+%endif
+
+%if 1
+%elifmacro dummy 2+
+       db 'bad %elifmacro dummy 2+', LF
+%endif
+
+%if 1
+%elifmacro dummy 3+
+       db 'bad %elifmacro dummy 3+', LF
+%endif
+
+%if 1
+%elifmacro dummy
+       db 'bad %elifmacro dummy', LF
+%endif
+
+%if 1
+%elifmacro dummy 0-1
+       db 'bad %elifmacro dummy 0-1', LF
+%endif
+
+%if 1
+%elifmacro dummy 1-2
+       db 'bad %elifmacro dummy 1-2', LF
+%endif
+
+%if 1
+%elifmacro dummy 2-3
+       db 'bad %elifmacro dummy 2-3', LF
+%endif
+
+%if 1
+%elifmacro dummy 3-4
+       db 'bad %elifmacro dummy 3-4', LF
+%endif
+
+%if 1
+%elifmacro LF
+       db 'bad %elifmacro LF', LF
+%endif
+
+%if 1
+%elifndef CR
+       db 'bad %elifndef CR', LF
+%endif
+
+%if 1
+%elifndef LF
+       db 'bad %elifndef LF', LF
+%endif
+
+%if 1
+%elifnmacro dummy 1
+       db 'bad %elifnmacro dummy 1', LF
+%endif
+
+%if 1
+%elifnmacro dummy 2
+       db 'bad %elifnmacro dummy 2', LF
+%endif
+
+%if 1
+%elifnmacro dummy 3
+       db 'bad %elifnmacro dummy 3', LF
+%endif
+
+%if 1
+%elifnmacro dummy 1+
+       db 'bad %elifnmacro dummy 1+', LF
+%endif
+
+%if 1
+%elifnmacro dummy 2+
+       db 'bad %elifnmacro dummy 2+', LF
+%endif
+
+%if 1
+%elifnmacro dummy 3+
+       db 'bad %elifnmacro dummy 3+', LF
+%endif
+
+%if 1
+%elifnmacro dummy
+       db 'bad %elifnmacro dummy', LF
+%endif
+
+%if 1
+%elifnmacro dummy 0-1
+       db 'bad %elifnmacro dummy 0-1', LF
+%endif
+
+%if 1
+%elifnmacro dummy 1-2
+       db 'bad %elifnmacro dummy 1-2', LF
+%endif
+
+%if 1
+%elifnmacro dummy 2-3
+       db 'bad %elifnmacro dummy 2-3', LF
+%endif
+
+%if 1
+%elifnmacro dummy 3-4
+       db 'bad %elifnmacro dummy 3-4', LF
+%endif
+
+%if 1
+%elifnmacro LF
+       db 'bad %elifnmacro LF', LF
+%endif
+
diff --git a/test/iftoken.asm b/test/iftoken.asm
new file mode 100644 (file)
index 0000000..7a0fec4
--- /dev/null
@@ -0,0 +1,317 @@
+;Testname=test; Arguments=-fbin -oiftoken.txt; Files=stdout stderr iftoken.txt
+
+%define ZMACRO
+%define NMACRO 1
+%define TMACRO 1 2
+       db 'N "":'
+%iftoken 
+       db ' token'
+%else
+       db ' ntoken'
+%endif
+%ifempty 
+       db ' empty'
+%else
+       db ' nempty'
+%endif
+       db 10
+       db 'C "":'
+%iftoken  ; With a comment!
+       db ' token'
+%else
+       db ' ntoken'
+%endif
+%ifempty  ; With a comment!
+       db ' empty'
+%else
+       db ' nempty'
+%endif
+       db 10
+       db 'N "ZMACRO":'
+%iftoken ZMACRO
+       db ' token'
+%else
+       db ' ntoken'
+%endif
+%ifempty ZMACRO
+       db ' empty'
+%else
+       db ' nempty'
+%endif
+       db 10
+       db 'C "ZMACRO":'
+%iftoken ZMACRO ; With a comment!
+       db ' token'
+%else
+       db ' ntoken'
+%endif
+%ifempty ZMACRO ; With a comment!
+       db ' empty'
+%else
+       db ' nempty'
+%endif
+       db 10
+       db 'N "NMACRO":'
+%iftoken NMACRO
+       db ' token'
+%else
+       db ' ntoken'
+%endif
+%ifempty NMACRO
+       db ' empty'
+%else
+       db ' nempty'
+%endif
+       db 10
+       db 'C "NMACRO":'
+%iftoken NMACRO ; With a comment!
+       db ' token'
+%else
+       db ' ntoken'
+%endif
+%ifempty NMACRO ; With a comment!
+       db ' empty'
+%else
+       db ' nempty'
+%endif
+       db 10
+       db 'N "TMACRO":'
+%iftoken TMACRO
+       db ' token'
+%else
+       db ' ntoken'
+%endif
+%ifempty TMACRO
+       db ' empty'
+%else
+       db ' nempty'
+%endif
+       db 10
+       db 'C "TMACRO":'
+%iftoken TMACRO ; With a comment!
+       db ' token'
+%else
+       db ' ntoken'
+%endif
+%ifempty TMACRO ; With a comment!
+       db ' empty'
+%else
+       db ' nempty'
+%endif
+       db 10
+       db 'N "1":'
+%iftoken 1
+       db ' token'
+%else
+       db ' ntoken'
+%endif
+%ifempty 1
+       db ' empty'
+%else
+       db ' nempty'
+%endif
+       db 10
+       db 'C "1":'
+%iftoken 1 ; With a comment!
+       db ' token'
+%else
+       db ' ntoken'
+%endif
+%ifempty 1 ; With a comment!
+       db ' empty'
+%else
+       db ' nempty'
+%endif
+       db 10
+       db 'N "+1":'
+%iftoken +1
+       db ' token'
+%else
+       db ' ntoken'
+%endif
+%ifempty +1
+       db ' empty'
+%else
+       db ' nempty'
+%endif
+       db 10
+       db 'C "+1":'
+%iftoken +1 ; With a comment!
+       db ' token'
+%else
+       db ' ntoken'
+%endif
+%ifempty +1 ; With a comment!
+       db ' empty'
+%else
+       db ' nempty'
+%endif
+       db 10
+       db 'N "1 2":'
+%iftoken 1 2
+       db ' token'
+%else
+       db ' ntoken'
+%endif
+%ifempty 1 2
+       db ' empty'
+%else
+       db ' nempty'
+%endif
+       db 10
+       db 'C "1 2":'
+%iftoken 1 2 ; With a comment!
+       db ' token'
+%else
+       db ' ntoken'
+%endif
+%ifempty 1 2 ; With a comment!
+       db ' empty'
+%else
+       db ' nempty'
+%endif
+       db 10
+       db 'N "1,2":'
+%iftoken 1,2
+       db ' token'
+%else
+       db ' ntoken'
+%endif
+%ifempty 1,2
+       db ' empty'
+%else
+       db ' nempty'
+%endif
+       db 10
+       db 'C "1,2":'
+%iftoken 1,2 ; With a comment!
+       db ' token'
+%else
+       db ' ntoken'
+%endif
+%ifempty 1,2 ; With a comment!
+       db ' empty'
+%else
+       db ' nempty'
+%endif
+       db 10
+       db 'N "foo":'
+%iftoken foo
+       db ' token'
+%else
+       db ' ntoken'
+%endif
+%ifempty foo
+       db ' empty'
+%else
+       db ' nempty'
+%endif
+       db 10
+       db 'C "foo":'
+%iftoken foo ; With a comment!
+       db ' token'
+%else
+       db ' ntoken'
+%endif
+%ifempty foo ; With a comment!
+       db ' empty'
+%else
+       db ' nempty'
+%endif
+       db 10
+       db 'N "foo bar":'
+%iftoken foo bar
+       db ' token'
+%else
+       db ' ntoken'
+%endif
+%ifempty foo bar
+       db ' empty'
+%else
+       db ' nempty'
+%endif
+       db 10
+       db 'C "foo bar":'
+%iftoken foo bar ; With a comment!
+       db ' token'
+%else
+       db ' ntoken'
+%endif
+%ifempty foo bar ; With a comment!
+       db ' empty'
+%else
+       db ' nempty'
+%endif
+       db 10
+       db 'N "%":'
+%iftoken %
+       db ' token'
+%else
+       db ' ntoken'
+%endif
+%ifempty %
+       db ' empty'
+%else
+       db ' nempty'
+%endif
+       db 10
+       db 'C "%":'
+%iftoken % ; With a comment!
+       db ' token'
+%else
+       db ' ntoken'
+%endif
+%ifempty % ; With a comment!
+       db ' empty'
+%else
+       db ' nempty'
+%endif
+       db 10
+       db 'N "+foo":'
+%iftoken +foo
+       db ' token'
+%else
+       db ' ntoken'
+%endif
+%ifempty +foo
+       db ' empty'
+%else
+       db ' nempty'
+%endif
+       db 10
+       db 'C "+foo":'
+%iftoken +foo ; With a comment!
+       db ' token'
+%else
+       db ' ntoken'
+%endif
+%ifempty +foo ; With a comment!
+       db ' empty'
+%else
+       db ' nempty'
+%endif
+       db 10
+       db 'N "<<":'
+%iftoken <<
+       db ' token'
+%else
+       db ' ntoken'
+%endif
+%ifempty <<
+       db ' empty'
+%else
+       db ' nempty'
+%endif
+       db 10
+       db 'C "<<":'
+%iftoken << ; With a comment!
+       db ' token'
+%else
+       db ' ntoken'
+%endif
+%ifempty << ; With a comment!
+       db ' empty'
+%else
+       db ' nempty'
+%endif
+       db 10
diff --git a/test/iftoken.pl b/test/iftoken.pl
new file mode 100755 (executable)
index 0000000..925dd40
--- /dev/null
@@ -0,0 +1,32 @@
+#!/usr/bin/perl
+
+@list = ('', 'ZMACRO', 'NMACRO', 'TMACRO', '1', '+1', '1 2', '1,2',
+        'foo', 'foo bar', '%', '+foo', '<<');
+@tests = ('token', 'empty');
+
+print ";Testname=test; Arguments=-fbin -oiftoken.txt; Files=stdout stderr iftoken.txt"
+print "%define ZMACRO\n";
+print "%define NMACRO 1\n";
+print "%define TMACRO 1 2\n";
+
+foreach $x (@list) {
+    print "\tdb 'N \"$x\":'\n";
+    foreach $t (@tests) {
+       print "%if$t $x\n";
+       print "\tdb ' $t'\n";
+       print "%else\n";
+       print "\tdb ' n$t'\n";
+       print "%endif\n";
+    }
+    print "\tdb 10\n";
+
+    print "\tdb 'C \"$x\":'\n";
+    foreach $t (@tests) {
+       print "%if$t $x ; With a comment!\n";
+       print "\tdb ' $t'\n";
+       print "%else\n";
+       print "\tdb ' n$t'\n";
+       print "%endif\n";
+    }
+    print "\tdb 10\n";
+}
diff --git a/test/imacro.asm b/test/imacro.asm
new file mode 100644 (file)
index 0000000..bc397cc
--- /dev/null
@@ -0,0 +1,8 @@
+;Testname=test; Arguments=-fbin -oimacro.bin; Files=stdout stderr imacro.bin
+
+%imacro Zero 1
+       xor %1,%1
+%endmacro
+
+       Zero eax
+       zero eax
diff --git a/test/imm64.asm b/test/imm64.asm
new file mode 100644 (file)
index 0000000..ac50c62
--- /dev/null
@@ -0,0 +1,7 @@
+       bits 64
+       mov rax,11223344h
+       mov rax,dword 11223344h
+       mov eax,11223344h
+       mov [rax],dword 11223344h               ; 32-bit operation
+       mov qword [rax],11223344h
+       mov qword [rax],dword 11223344h
diff --git a/test/immwarn.asm b/test/immwarn.asm
new file mode 100644 (file)
index 0000000..8bffbfa
--- /dev/null
@@ -0,0 +1,91 @@
+;Testname=onowarn; Arguments=-Ox -DOPT=1 -DWARN=0 -fbin -oimmwarn.bin; Files=stdout stderr immwarn.bin
+;Testname=owarn; Arguments=-Ox -DOPT=1 -DWARN=1 -fbin -oimmwarn.bin; Files=stdout stderr immwarn.bin
+;Testname=nowarn; Arguments=-O0 -DOPT=0 -DWARN=0 -fbin -oimmwarn.bin; Files=stdout stderr immwarn.bin
+;Testname=warn; Arguments=-O0 -DOPT=1 -DWARN=1 -fbin -oimmwarn.bin; Files=stdout stderr immwarn.bin
+
+%ifndef WARN
+  %define WARN 1
+%endif
+
+       bits 16
+       push 1
+%if WARN
+       push 0ffffffffh
+%endif
+       push -1
+       push 0ffffh
+       push byte 0FFFFh
+
+       add ax,0FFFFh
+%if WARN
+       add ax,0FFFFFFFFh
+%endif
+       add ax,-1
+       add ax,byte 0FFFFh
+%if WARN
+       add ax,byte 0FFFFFFFFh
+%endif
+       add ax,-1
+
+       add cx,0FFFFh
+%if WARN
+       add cx,0FFFFFFFFh
+%endif
+       add cx,-1
+       add cx,byte 0FFFFh
+%if WARN
+       add cx,byte 0FFFFFFFFh
+%endif
+       add cx,-1
+
+       bits 32
+       push 1
+       push 0ffffffffh
+       push -1
+       push 0ffffh
+
+       push byte 1
+%if WARN
+       push byte 0ffffh
+%endif
+       push byte -1
+
+       push word 1
+       push word 0ffffh
+       push word -1
+
+       push dword 1
+       push dword 0ffffffffh
+       push dword -1
+
+       add eax,0FFFFh
+       add eax,0FFFFFFFFh
+       add eax,-1
+
+       add ecx,0FFFFh
+       add ecx,0FFFFFFFFh
+       add ecx,-1
+
+       bits 64
+       mov eax,7fffffffh
+       mov eax,80000000h
+       mov rax,7fffffffh
+       mov rax,80000000h
+%if WARN
+       mov rax,dword 80000000h
+%endif
+       add rcx,0FFFFh
+%if WARN
+       add rcx,0FFFFFFFFh
+%endif
+       add rcx,-1
+
+       add ecx,0FFFFh
+       add ecx,0FFFFFFFFh
+       add ecx,-1
+
+       push byte 1
+%if WARN
+       push byte 0ffffffffh
+%endif
+       push byte -1
diff --git a/test/imul.asm b/test/imul.asm
new file mode 100644 (file)
index 0000000..d30d25f
--- /dev/null
@@ -0,0 +1,117 @@
+;Testname=nowarn; Arguments=-fbin -oimul.bin; Files=stdout stderr imul.bin
+;Testname=warn; Arguments=-DWARN -fbin -oimul.bin; Files=stdout stderr imul.bin
+
+%macro test 1-3 5 -2
+       bits %1
+
+%undef MEM
+%if %1 == 16
+  %define MEM [di]
+%elif %1 == 32
+  %define MEM [edi]
+%elif %1 == 64
+  %define MEM [rdi]
+%endif
+
+       imul al
+       imul byte MEM
+       imul ax
+       imul word MEM
+       imul eax
+       imul dword MEM
+%if %1 == 64
+       imul rdx
+       imul qword MEM
+%endif
+       
+       imul ax,cx
+       imul ax,MEM
+       imul ax,word MEM
+       imul eax,ecx
+       imul eax,MEM
+       imul eax,dword MEM
+%if %1 == 64
+       imul rax,rcx
+       imul rax,MEM
+       imul rax,qword MEM
+%endif
+
+       imul ax,cx,%2
+       imul ax,cx,byte %2
+       imul ax,MEM,%2
+       imul ax,word MEM,%2
+       imul eax,ecx,%2
+       imul eax,ecx,byte %2
+       imul eax,MEM,%2
+       imul eax,dword MEM,%2
+%if %1 == 64
+       imul rax,rcx,%2
+       imul rax,rcx,byte %2
+       imul rax,MEM,%2
+       imul rax,qword MEM,%2
+%endif
+
+       imul ax,%2
+       imul ax,byte %2
+       imul eax,%2
+       imul eax,byte %2
+%if %1 == 64
+       imul rax,%2
+       imul rax,byte %2
+%endif
+
+       imul ax,cx,0x1234
+       imul ax,MEM,0x1234
+       imul ax,word MEM,0x1234
+       imul eax,ecx,0x12345678
+       imul eax,MEM,0x12345678
+       imul eax,dword MEM,0x12345678
+%if %1 == 64
+       imul rax,rcx,0x12345678
+       imul rax,MEM,0x12345678
+       imul rax,qword MEM,0x12345678
+%endif
+
+       imul ax,0x1234
+       imul eax,0x12345678
+%if %1 == 64
+       imul rax,0x12345678
+%endif
+
+       imul ax,cx,0xfffe
+       imul ax,MEM,0xfffe
+       imul ax,word MEM,0xfffe
+       imul ax,cx,0xfe
+       imul ax,MEM,0xfe
+       imul ax,word MEM,0xfe
+       imul eax,ecx,0xfffffffe
+       imul eax,MEM,0xfffffffe
+       imul eax,dword MEM,0xfffffffe
+       imul eax,ecx,0xfffe
+       imul eax,MEM,0xfffe
+       imul eax,dword MEM,0xfffe
+%if %1 == 64
+       imul rax,rcx,%3
+       imul rax,MEM,%3
+       imul rax,qword MEM,%3
+       imul rax,rcx,0xfffe
+       imul rax,MEM,0xfffe
+       imul rax,qword MEM,0xfffe
+%endif
+
+       imul ax,0xfffe
+       imul eax,0xfffffffe
+%if %1 == 64
+       imul rax,%3
+%endif
+%endmacro
+
+       test 16
+       test 32
+       test 64
+
+%ifdef WARN
+       test 16,0x999
+       test 32,0x999999
+       test 64,0x999999999,0xfffffffe
+%endif
diff --git a/test/inc1.asm b/test/inc1.asm
new file mode 100644 (file)
index 0000000..0e1058b
--- /dev/null
@@ -0,0 +1,6 @@
+; This file is part of the include test.
+; See inctest.asm for build instructions.
+
+message:  db 'hello, world',13,10,'$'
+
+%include "inc2.asm"
diff --git a/test/inc2.asm b/test/inc2.asm
new file mode 100644 (file)
index 0000000..c3ba2f7
--- /dev/null
@@ -0,0 +1,8 @@
+; This file is part of the include test.
+; See inctest.asm for build instructions.
+
+_main:   mov dx,message
+         mov ah,9
+         int 21h
+         mov ax,4c00h
+         int 21h
diff --git a/test/inctest.asm b/test/inctest.asm
new file mode 100644 (file)
index 0000000..35f2910
--- /dev/null
@@ -0,0 +1,15 @@
+;Testname=test; Arguments=-fbin -oinctest.com; Files=stdout stderr inctest.com
+
+; This file, plus inc1.asm and inc2.asm, test NASM's file inclusion
+; mechanism.
+;
+; This produces a DOS .COM file: to assemble, use
+;    nasm -f bin inctest.asm -o inctest.com
+; and when run, it should print `hello, world'.
+
+         BITS 16
+         ORG 0x100
+
+         jmp _main
+
+%include "inc1.asm"
diff --git a/test/insnlbl.asm b/test/insnlbl.asm
new file mode 100644 (file)
index 0000000..e456372
--- /dev/null
@@ -0,0 +1,12 @@
+;Testname=test; Arguments=-fbin -oinsnlbl.bin; Files=stdout stderr insnlbl.bin
+
+;
+; Test "instruction as label" -- make opcodes legal as labels if
+; they are followed by a colon.
+;
+
+do:    jmp dq+2
+       dw do, add, sub, dq
+add:   jmp add-2
+sub:   jmp do+2
+dq:    dw $-sub
diff --git a/test/invlpga.asm b/test/invlpga.asm
new file mode 100644 (file)
index 0000000..21ab4b4
--- /dev/null
@@ -0,0 +1,11 @@
+;Testname=unoptimized; Arguments=-fbin -oinvlpga.bin;     Files=stdout stderr invlpga.bin
+;Testname=optimized;   Arguments=-fbin -oinvlpga.bin -Ox; Files=stdout stderr invlpga.bin
+
+       bits 32
+       invlpga
+       invlpga ax,ecx
+       invlpga eax,ecx
+       bits 64
+       invlpga
+       invlpga eax,ecx
+       invlpga rax,ecx
diff --git a/test/jmp64.asm b/test/jmp64.asm
new file mode 100644 (file)
index 0000000..f007b9e
--- /dev/null
@@ -0,0 +1,15 @@
+;Testname=test; Arguments=-fbin -ojmp64.bin; Files=stdout stderr jmp64.bin
+
+       bits 64
+       jmp rcx
+       jmp [rax]
+       jmp qword [rax]
+       jmp far [rax]
+       jmp far dword [rax]
+       jmp far qword [rax]
+       call rcx
+       call [rax]
+       call qword [rax]
+       call far [rax]
+       call far dword [rax]
+       call far qword [rax]
diff --git a/test/lar_lsl.asm b/test/lar_lsl.asm
new file mode 100644 (file)
index 0000000..a0a9c0e
--- /dev/null
@@ -0,0 +1,124 @@
+;Testname=test; Arguments=-fbin -olar_lsl.bin; Files=stdout stderr lar_lsl.bin
+
+; LAR/LSL
+;---------
+
+; 1x ; = invalid due to lack of REX
+; 3x ; = invalid due to Mw
+
+%macro m 1
+
+  bits 16
+
+       %1  ax, ax
+       %1  ax,eax
+;      %1  ax,rax
+
+       %1 eax, ax
+       %1 eax,eax
+;      %1 eax,rax
+
+;      %1 rax, ax
+;      %1 rax,eax
+;      %1 rax,rax
+
+       %1  ax,      [0]
+       %1  ax, word [0]
+;;;    %1  ax,dword [0]
+;      %1  ax,qword [0]
+
+       %1 eax,      [0]
+       %1 eax, word [0]
+;;;    %1 eax,dword [0]
+;      %1 eax,qword [0]
+
+;      %1 rax,      [0]
+;      %1 rax, word [0]
+;      %1 rax,dword [0]
+;      %1 rax,qword [0]
+
+  bits 32
+
+       %1  ax, ax
+       %1  ax,eax
+;      %1  ax,rax
+
+       %1 eax, ax
+       %1 eax,eax
+;      %1 eax,rax
+
+;      %1 rax, ax
+;      %1 rax,eax
+;      %1 rax,rax
+
+       %1  ax,      [0]
+       %1  ax, word [0]
+;;;    %1  ax,dword [0]
+;      %1  ax,qword [0]
+
+       %1 eax,      [0]
+       %1 eax, word [0]
+;;;    %1 eax,dword [0]
+;      %1 eax,qword [0]
+
+;      %1 rax,      [0]
+;      %1 rax, word [0]
+;      %1 rax,dword [0]
+;      %1 rax,qword [0]
+
+  bits 64
+
+       %1  ax, ax
+       %1  ax,eax
+       %1  ax,rax      ; $TODO: shouldn't emit REX.W $
+
+       %1 eax, ax
+       %1 eax,eax
+       %1 eax,rax      ; $TODO: shouldn't emit REX.W $
+
+       %1 rax, ax
+       %1 rax,eax
+       %1 rax,rax
+
+       %1  ax,      [0]
+       %1  ax, word [0]
+;;;    %1  ax,dword [0]
+;;;    %1  ax,qword [0]
+
+       %1 eax,      [0]
+       %1 eax, word [0]
+;;;    %1 eax,dword [0]
+;;;    %1 eax,qword [0]
+
+       %1 rax,      [0]
+       %1 rax, word [0]
+;;;    %1 rax,dword [0]
+;;;    %1 rax,qword [0]
+
+%endmacro
+
+m lar
+
+m lsl
+
+bits 16
+lar ax,[ si]
+lar ax,[esi]
+bits 32
+lar ax,[ si]
+lar ax,[esi]
+bits 64
+lar ax,[esi]
+lar ax,[rsi]
+
+bits 16
+lsl ax,[ si]
+lsl ax,[esi]
+bits 32
+lsl ax,[ si]
+lsl ax,[esi]
+bits 64
+lar ax,[esi]
+lsl ax,[rsi]
+
+; EOF
diff --git a/test/larlsl.asm b/test/larlsl.asm
new file mode 100644 (file)
index 0000000..cddaac7
--- /dev/null
@@ -0,0 +1,23 @@
+;Testname=test; Arguments=-fbin -olarlsl.bin; Files=stdout stderr larlsl.bin
+
+       bits 64
+
+       lar ax,bx
+       lar ax,[rsi]
+       lar ax,word [rsi]
+       lar eax,bx
+       lar eax,[rsi]
+       lar eax,word [rsi]
+       lar rax,bx
+       lar rax,[rsi]
+       lar rax,word [rsi]
+
+       lsl ax,bx
+       lsl ax,[rsi]
+       lsl ax,word [rsi]
+       lsl eax,bx
+       lsl eax,[rsi]
+       lsl eax,word [rsi]
+       lsl rax,bx
+       lsl rax,[rsi]
+       lsl rax,word [rsi]
diff --git a/test/lnxhello.asm b/test/lnxhello.asm
new file mode 100644 (file)
index 0000000..1aa5a5f
--- /dev/null
@@ -0,0 +1,54 @@
+;Testname=aout;  Arguments=-faout  -olnxhello.o -Ox; Files=stdout stderr lnxhello.o
+;Testname=aoutb; Arguments=-faoutb -olnxhello.o -Ox; Files=stdout stderr lnxhello.o
+;Testname=as86;  Arguments=-fas86  -olnxhello.o -Ox; Files=stdout stderr lnxhello.o
+;Testname=elf32; Arguments=-felf32 -olnxhello.o -Ox; Files=stdout stderr lnxhello.o
+
+;
+; Assembly "Hello, World!" for Linux
+;
+
+
+; Properly defined in <sys/syscall.h>
+%define SYS_exit       1
+%define SYS_write      4
+
+       section .text
+
+       global _start
+_start:
+       ; gdb doesn't like to stop at the entry point address, so
+       ; we put a nop here for pure convenience
+       nop                             
+
+
+write_hello:
+       mov edx, hello_len
+       mov ecx, hello
+       
+.loop:
+       mov eax, SYS_write
+       mov ebx, 1                      ; stdout
+       int 80h
+
+       cmp eax, -4096
+       ja error
+
+       add ecx, eax
+       sub edx, eax
+       jnz .loop
+
+ok:    
+       mov eax, SYS_exit
+       xor ebx, ebx
+       int 80h
+       hlt
+
+error:
+       mov eax, SYS_exit
+       mov ebx, 1              ; Error
+       int 80h
+       hlt
+       
+       section .rodata
+hello: db "Hello, World!", 10
+hello_len equ $-hello
diff --git a/test/local.asm b/test/local.asm
new file mode 100644 (file)
index 0000000..8a42bb8
--- /dev/null
@@ -0,0 +1,19 @@
+;Testname=test; Arguments=-fbin -olocal.bin; Files=stdout stderr local.bin
+       bits 32
+
+%push bluttan
+
+%define %$localsize 0
+
+%stacksize flat
+%local l1:qword, l2:dword, l3:dword, l4:qword
+%arg a1:qword, a2:dword, a3:dword, a4:qword
+
+       mov eax,[a1]
+       mov ebx,[a2]
+       mov ecx,[a3]
+       mov edx,[a4]
+       mov [l1],eax
+       mov [l2],ebx
+       mov [l3],ecx
+       mov [l4],edx
diff --git a/test/loopoffs.asm b/test/loopoffs.asm
new file mode 100644 (file)
index 0000000..54ef4ac
--- /dev/null
@@ -0,0 +1,12 @@
+;Testname=unoptimized; Arguments=-fbin -oloopoffs.bin -O0; Files=stdout stderr loopoffs.bin
+;Testname=optimized;   Arguments=-fbin -oloopoffs.bin -Ox; Files=stdout stderr loopoffs.bin
+       bits 16
+delay: loop delay
+       loop $
+delay2:        a32 loop delay2
+       a32 loop $
+delay3:        loop delay3,ecx
+       loop $,ecx
+delay4:        a32 loop delay4,ecx
+       a32 loop $,ecx
+       
\ No newline at end of file
diff --git a/test/macro-defaults.asm b/test/macro-defaults.asm
new file mode 100644 (file)
index 0000000..047f205
--- /dev/null
@@ -0,0 +1,64 @@
+;Testname=warning;    Arguments=-fbin -omacdef.bin -w+macro-defaults; Files=stdout stderr macdef.bin
+;Testname=nonwarning; Arguments=-fbin -omacdef.bin -w-macro-defaults; Files=stdout stderr macdef.bin
+
+%MACRO mmac_fix 1 a
+ ; While defined to take one parameter, any invocation will
+ ; see two, due to the default parameter.
+ %warning %0 %1 %2 %3 %4 %5
+%ENDMACRO
+mmac_fix one
+
+%MACRO mmac_var 1-2 a,b
+ ; While defined to take one or two parameters, invocations
+ ; will see three, due to the default parameters.
+ %warning %0 %1 %2 %3 %4 %5
+%ENDMACRO
+mmac_var one
+mmac_var one,two
+
+%MACRO mmac_plus 1-2+ a,b
+ ; This does not warn. Although this looks like two default
+ ; parameters, it ends up being only one: the "+" limits it
+ ; to two parameters; if invoked without a second parameter
+ ; the second parameter will be "a,b".
+ %warning %0 %1 %2 %3 %4 %5
+ ;Check rotating behaviour
+%ENDMACRO
+mmac_plus one
+mmac_plus one,two
+mmac_plus one,two,three
+
+%MACRO mmac_star 1-* a,b
+ ; This does not warn. Because the "*" extends the range of
+ ; parameters to infinity, the "a,b" default parameters can
+ ; not exceed that range.
+ %warning %0 %1 %2 %3 %4 %5
+%ENDMACRO
+mmac_star one
+mmac_star one,two
+mmac_star one,two,three
+
+%MACRO mmac_rotate 0-* a,b
+ %warning %0 %1 %2 %3 %4 %5
+ ;%rotate should rotate all parameters
+ %rotate 1
+ %warning %0 %1 %2 %3 %4 %5
+%ENDMACRO
+mmac_rotate
+mmac_rotate one
+mmac_rotate one,two
+mmac_rotate one,two,three
+
+;Scope / evaluation time test
+%define  I 0
+%assign  J 0
+%xdefine K 0
+
+%MACRO mmac_scope 0 I J K
+ %warning %1 %2 %3
+%ENDMACRO
+
+%define  I 1
+%assign  J 1
+%xdefine K 1
+mmac_scope
diff --git a/test/mmxsize.asm b/test/mmxsize.asm
new file mode 100644 (file)
index 0000000..0a47839
--- /dev/null
@@ -0,0 +1,38 @@
+;Testname=unoptimized; Arguments=-fbin -ommxsize.bin -O0; Files=stdout stderr mmxsize.bin
+;Testname=optimized;   Arguments=-fbin -ommxsize.bin -Ox; Files=stdout stderr mmxsize.bin
+       bits 32
+       movd mm0,eax
+       movd mm0,[foo]
+       movq mm0,[foo]
+       movd mm0,dword [foo]
+       movq mm0,qword [foo]
+       movmskps eax,xmm1
+       movmskpd eax,xmm1
+       nop
+       movd xmm0,eax
+       movd xmm0,[foo]
+       movq xmm0,[foo]
+       movd xmm0,dword [foo]
+       movq xmm0,qword [foo]
+       nop
+
+       bits 64
+       movd mm0,eax
+       movq mm0,[foo]
+       movd mm0,dword [foo]
+       movq mm0,qword [foo]
+       movq mm0,rax
+       movmskps eax,xmm1
+       movmskpd eax,xmm1
+       nop
+       movd xmm0,eax
+       movq xmm0,[foo]
+       movd xmm0,dword [foo]
+       movq xmm0,qword [foo]
+       movq xmm0,rax
+       movmskps rax,xmm1
+       movmskpd rax,xmm1
+       nop
+       
+       section .bss
+foo    resq 1
diff --git a/test/movimm.asm b/test/movimm.asm
new file mode 100644 (file)
index 0000000..c34c166
--- /dev/null
@@ -0,0 +1,28 @@
+;Testname=unoptimized; Arguments=-fbin -omovimm.bin -O0; Files=stdout stderr movimm.bin
+;Testname=optimized;   Arguments=-fbin -omovimm.bin -Ox; Files=stdout stderr movimm.bin
+       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/movnti.asm b/test/movnti.asm
new file mode 100644 (file)
index 0000000..920f327
--- /dev/null
@@ -0,0 +1,10 @@
+;Testname=test; Arguments=-fbin -omovnti.bin; Files=stdout stderr movnti.bin
+; BR 2028995
+
+       bits 16
+       movnti [si],eax
+       bits 32
+       movnti [esi],eax
+       bits 64
+       movnti [rsi],eax
+       movnti [rsi],rax
diff --git a/test/multisection.asm b/test/multisection.asm
new file mode 100644 (file)
index 0000000..34e7f7d
--- /dev/null
@@ -0,0 +1,96 @@
+;Testname=aout;  Arguments=-faout  -olnxhello.o -Ox; Files=stdout stderr lnxhello.o
+;Testname=aoutb; Arguments=-faoutb -olnxhello.o -Ox; Files=stdout stderr lnxhello.o
+;Testname=as86;  Arguments=-fas86  -olnxhello.o -Ox; Files=stdout stderr lnxhello.o
+;Testname=elf32; Arguments=-felf32 -olnxhello.o -Ox; Files=stdout stderr lnxhello.o
+;Testname=elf64; Arguments=-felf64 -olnxhello.o -Ox; Files=stdout stderr lnxhello.o
+;Testname=obj;   Arguments=-fobj   -olnxhello.o -Ox; Files=stdout stderr lnxhello.o
+;Testname=rdf;   Arguments=-frdf   -olnxhello.o -Ox; Files=stdout stderr lnxhello.o
+;Testname=win32; Arguments=-fwin32 -olnxhello.o -Ox; Files=stdout stderr lnxhello.o
+;Testname=win64; Arguments=-fwin64 -olnxhello.o -Ox; Files=stdout stderr lnxhello.o
+
+; To test where code that is placed before any explicit SECTION
+; gets placed, and what happens if a .text section has an ORG
+;statement, uncomment the following lines.
+;
+;      times   10h     nop
+;
+;section .text
+;org 0x300
+;      times   20h     inc ax
+
+; let's see which of these sections can be placed in the specified order.
+
+section .appspecific
+section .data
+section .stringdata
+section .mytext
+section .code
+section .extra_code
+
+
+section .stringdata
+mystr1: db "Hello, this is string 1", 13, 10, '$'
+
+section .extra_code
+org 0x200
+bits 16
+more:
+   mov si, asciz1
+   mov ah, 0x0E
+   xor bx, bx
+.print:
+   lodsb
+   test al, al
+   jz .end
+   int  0x10
+   jmp short .print
+.end:
+
+   xor ax, ax
+   int 0x16
+
+   mov ax, 0x4c00
+   int 0x21
+
+section .appspecific
+asciz1: db "This is string 2", 0
+
+section .code
+org 0x100
+bits 16
+
+start:
+   mov dx, mystr1
+   mov ah, 9
+   int 0x21
+
+   xor ax, ax
+   int 0x16
+
+   jmp more
+
+section .text
+       xor     eax,eax
+       times   50h nop
+
+section .mytext
+
+       xor     ebx,ebx
+
+section .data
+       db      95h,95h,95h,95h,95h,95h,95h,95h
+
+section .hmm
+       resd    2
+
+section .bss
+       resd    8
+
+section .final1
+       inc     ax
+
+section .final2
+       inc     bx
+
+section .final3
+       inc     cx
diff --git a/test/nasmformat.asm b/test/nasmformat.asm
new file mode 100644 (file)
index 0000000..ea19b92
--- /dev/null
@@ -0,0 +1,17 @@
+;Testname=obj; Arguments=-fobj -onasmfomat.o; Files=stdout stderr nasmfomat.o
+;Testname=bin; Arguments=-fbin -onasmfomat.o; Files=stdout stderr nasmfomat.o
+;Testname=rdf; Arguments=-frdf -onasmfomat.o; Files=stdout stderr nasmfomat.o
+
+%if __OUTPUT_FORMAT__ == 'bin'
+
+db 'This is binary format file'
+
+%elif __OUTPUT_FORMAT__ == 'obj'
+
+db 'This is object format file'
+
+%else
+
+db 'This is some other format file'
+
+%endif
diff --git a/test/new b/test/new
new file mode 100755 (executable)
index 0000000..403b4fb
--- /dev/null
+++ b/test/new
@@ -0,0 +1,9 @@
+#!/bin/sh
+for f; do
+  if [ -e "$f".asm ]; then
+    # For safety...
+    echo "$0: $f already exists" 1>&2
+    exit 1
+  fi
+  echo ";Testname=test; Arguments=-fbin -o$f.bin; Files=stdout stderr $f.bin" > "$f".asm
+done
diff --git a/test/nop.asm b/test/nop.asm
new file mode 100644 (file)
index 0000000..71b7f7b
--- /dev/null
@@ -0,0 +1,17 @@
+;Testname=unoptimized; Arguments=-fbin -onop.bin;     Files=stdout stderr nop.bin
+;Testname=optimized;   Arguments=-fbin -onop.bin -Ox; Files=stdout stderr nop.bin
+
+       bits 64
+
+       nop
+       o64 nop
+       pause
+       o64 pause
+
+       xchg ax,ax
+       xchg eax,eax
+       xchg rax,rax
+       
+       rep xchg ax,ax
+       rep xchg eax,eax
+       rep xchg rax,rax
diff --git a/test/nullfile.asm b/test/nullfile.asm
new file mode 100644 (file)
index 0000000..83e306e
--- /dev/null
@@ -0,0 +1,4 @@
+;Testname=test; Arguments=-fbin -onull.bin; Files=stdout stderr null.bin
+;
+; A file that produces no output has been known to occationally crash NASM.
+;
diff --git a/test/objexe.asm b/test/objexe.asm
new file mode 100644 (file)
index 0000000..9959f40
--- /dev/null
@@ -0,0 +1,30 @@
+; Demonstration of how to write an entire .EXE format program as a .OBJ
+; file to be linked. Tested with the VAL free linker.
+; To build:
+;    nasm -fobj objexe.asm
+;    val objexe.obj,objexe.exe;
+; To test:
+;    objexe
+; (should print `hello, world')
+         
+         segment code
+
+..start:  mov ax,data
+         mov ds,ax
+         mov ax,stack
+         mov ss,ax
+         mov sp,stacktop
+
+         mov dx,hello
+         mov ah,9
+         int 0x21
+
+         mov ax,0x4c00
+         int 0x21
+
+         segment data
+hello:   db 'hello, world', 13, 10, '$'
+
+         segment stack stack
+         resb 64
+stacktop:
diff --git a/test/objlink.c b/test/objlink.c
new file mode 100644 (file)
index 0000000..b767b01
--- /dev/null
@@ -0,0 +1,33 @@
+/*
+ * test source file for assembling to Microsoft 16-bit .OBJ
+ * build with (16-bit Microsoft C):
+ *    nasm -f obj objtest.asm
+ *    cl /AL objtest.obj objlink.c
+ * other compilers should work too, provided they handle large
+ * model in the same way as MS C
+ */
+
+#include <stdio.h>
+#include <inttypes.h>
+
+int8_t text[] = "hello, world\n";
+
+extern void function(int8_t *);
+extern int bsssym, commvar;
+extern void *selfptr;
+extern void *selfptr2;
+
+int main(void)
+{
+    printf("these should be identical: %p, %p\n",
+           (int32_t)selfptr, (int32_t)&selfptr);
+    printf("these should be equivalent but different: %p, %p\n",
+           (int32_t)selfptr2, (int32_t)&selfptr2);
+    printf("you should see \"hello, world\" twice:\n");
+    bsssym = 0xF00D;
+    commvar = 0xD00F;
+    function(text);
+    printf("this should be 0xF00E: 0x%X\n", bsssym);
+    printf("this should be 0xD00E: 0x%X\n", commvar);
+    return 0;
+}
diff --git a/test/objtest.asm b/test/objtest.asm
new file mode 100644 (file)
index 0000000..03b7f9e
--- /dev/null
@@ -0,0 +1,85 @@
+;Testname=unoptimized; Arguments=-O0 -fobj -oobj.o; Files=stdout stderr obj.o
+;Testname=optimized;   Arguments=-Ox -fobj -oobj.o; Files=stdout stderr obj.o
+
+; test source file for assembling to Microsoft 16-bit .OBJ
+; build with (16-bit Microsoft C):
+;    nasm -f obj objtest.asm
+;    cl /AL objtest.obj objlink.c
+; other compilers should work too, provided they handle large
+; model in the same way as MS C
+
+; This file should test the following:
+; [1] Define and export a global symbol
+; [2] Define a non-global symbol
+; [3] Define a common symbol
+; [4] Define a NASM local label
+; [5] Reference a NASM local label
+; [6] Import an external symbol
+; [7] Make a PC-relative relocated reference
+; [8] Reference a symbol in the same section as itself
+; [9] Reference a symbol in a different segment from itself
+; [10] Define a segment group
+; [11] Take the offset of a symbol in a grouped segment w.r.t. its segment
+; [12] Reserve uninitialised data space in a segment
+; [13] Directly take the segment address of a segment
+; [14] Directly take the segment address of a group
+; [15] Use SEG on a non-external
+; [16] Use SEG on an external
+
+         bits 16
+
+         global _bsssym        ; [1]
+         global _function      ; [1]
+         global _selfptr       ; [1]
+         global _selfptr2      ; [1]
+         common _commvar 2     ; [3]
+         extern _printf        ; [6]
+
+         group mygroup mybss mydata ; [10]
+         group mygroup2 mycode mycode2 ; [10]
+
+         segment mycode private
+
+_function push bp
+         mov bp,sp
+         push ds
+         mov ax,mygroup        ; [14]
+         mov ds,ax
+         inc word [_bsssym]    ; [9]
+         mov ax,seg _commvar
+         mov ds,ax
+         dec word [_commvar]
+         pop ds
+         mov ax,[bp+6]
+         mov dx,[bp+8]
+         push dx
+         push ax
+         push dx
+         push ax
+         call far [cs:.printf] ; [5] [8]
+         pop ax
+         pop ax
+         call trampoline       ; [7]
+         pop ax
+         pop ax
+         mov sp,bp
+         pop bp
+         retf
+
+.printf          dw _printf, seg _printf ; [2] [4] [16]
+
+         segment mycode2 private
+
+trampoline: pop ax
+         push cs
+         push ax
+         jmp far _printf
+
+         segment mybss private
+
+_bsssym          resw 64               ; [12]
+
+         segment mydata private
+
+_selfptr  dw _selfptr, seg _selfptr ; [8] [15]
+_selfptr2 dw _selfptr2 wrt mydata, mydata ; [11] [13]
diff --git a/test/optimization.asm b/test/optimization.asm
new file mode 100644 (file)
index 0000000..d78209d
--- /dev/null
@@ -0,0 +1,104 @@
+;Testname=O0; Arguments=-O0 -fbin -ooptimization.bin; Files=stdout stderr optimization.bin
+;Testname=O1; Arguments=-O1 -fbin -ooptimization.bin; Files=stdout stderr optimization.bin
+;Testname=Ox; Arguments=-Ox -fbin -ooptimization.bin; Files=stdout stderr optimization.bin
+
+BITS 32
+
+; Simple
+jmp foo
+times 124 nop
+foo:
+
+; Must start short to converge optimally
+jmp car
+times 127 nop
+car:
+
+; Always near
+jmp cdr
+times 128 nop
+cdr:
+
+
+; Simple
+add eax, quux2 - quux1
+quux1:
+times 127 nop
+quux2:
+
+; Must start short
+corge1:
+add eax, corge2 - corge1
+times 127 - 3 nop
+corge2:
+
+
+; Simple
+lea eax, [bolug2-bolug1]
+bolug1:
+times 127 nop
+bolug2:
+
+; Must start short
+calog1:
+lea eax, [calog2-calog1]
+times 127 - 3 nop
+calog2:
+
+
+; Simple
+lea eax, [eax+dolug2-dolug1]
+dolug1:
+times 127 nop
+dolug2:
+
+; Must start short
+ealog1:
+lea eax, [eax+ealog2-ealog1]
+times 127 - 3 nop
+ealog2:
+
+; Must stay long!
+lea eax, [eax+folug2-folug1]
+folug1:
+times 128 nop
+folug2:
+
+; Must stay long!
+galog1:
+lea eax, [eax+galog2-galog1]
+times 128 - 3 nop
+galog2:
+
+; Sbyte tests...
+onetwentysix   equ 126
+onetwentynine  equ 129
+       
+add eax,onetwentyseven         ; sbyte (forward)
+add eax,onetwentyeight         ; not sbyte (forward)
+add eax,onetwentyseven         ; sbyte (forward)
+add eax,onetwentysix           ; sbyte (backward)
+add eax,onetwentynine          ; not sbyte (backward)
+add ecx,onetwentyseven         ; sbyte (forward)
+add ecx,onetwentyeight         ; not sbyte (forward)
+add ecx,onetwentyseven         ; sbyte (forward)
+add ecx,onetwentysix           ; sbyte (backward)
+add ecx,onetwentynine          ; not sbyte (backward)
+       
+onetwentyseven equ 127
+onetwentyeight equ 128
+
+; Simple
+add eax, holug2-holug1
+holug1:
+times 127 nop
+holug2:
+
+; Must start short
+ialog1:
+add eax, ialog2-ialog1
+times 127 - 3 nop
+ialog2:
+       
+; Do not confuse forward references and segmentless addresses!
+jmp 12345
diff --git a/test/org.asm b/test/org.asm
new file mode 100644 (file)
index 0000000..792c39a
--- /dev/null
@@ -0,0 +1,18 @@
+;Testname=elf64; Arguments=-Ox -felf64 -oorg.o; Files=stdout stderr org.o
+;Testname=win64; Arguments=-Ox -fwin64 -oorg.o; Files=stdout stderr org.o
+
+;
+; Simple test of a 64-bit org directive
+; 
+               bits 64
+               org 0xffffffffffff0000
+
+hello:         jmp there
+               nop
+               nop
+there:
+               add rax,[rsp+rbx]
+               inc eax
+
+               section .data
+there_ptr      dq there
diff --git a/test/perf/label.pl b/test/perf/label.pl
new file mode 100755 (executable)
index 0000000..9b59768
--- /dev/null
@@ -0,0 +1,18 @@
+#!/usr/bin/perl
+#
+# Generate a test case for label lookup performance
+#
+
+($len) = @ARGV;
+$len = 100000 unless ($len);
+
+print "\tbits 32\n";
+print "\tsection .data\n";
+print "\n";
+
+for ($i = 0; $i < $len; $i++) {
+    print "l$i:\n";
+    for ($j = 0; $j < 8; $j++) {
+       print "\tdd l", int(rand($i+1)), "\n";
+    }
+}
diff --git a/test/perf/macro.pl b/test/perf/macro.pl
new file mode 100755 (executable)
index 0000000..b729805
--- /dev/null
@@ -0,0 +1,18 @@
+#!/usr/bin/perl
+#
+# Generate a test case for macro lookup performance
+#
+
+($len) = @ARGV;
+$len = 100000 unless ($len);
+
+print "\tbits 32\n";
+print "\tsection .data\n";
+print "\n";
+
+for ($i = 0; $i < $len; $i++) {
+    print "%define m$i $i\n";
+    for ($j = 0; $j < 8; $j++) {
+       print "\tdd m", int(rand($i+1)), "\n";
+    }
+}
diff --git a/test/perf/token.pl b/test/perf/token.pl
new file mode 100755 (executable)
index 0000000..4a9e3ae
--- /dev/null
@@ -0,0 +1,23 @@
+#!/usr/bin/perl
+#
+# Generate a test case for token lookup performance
+#
+
+@insns = qw(add sub adc sbb and or xor mov);
+@regs  = qw(eax ebx ecx edx esp ebp esi edi);
+
+srand(0);
+sub pickone(@) {
+    return $_[int(rand(scalar @_))];
+}
+
+($len) = @ARGV;
+$len = 1000000 unless ($len);
+
+print "\tbits 32\n";
+print "\n";
+
+for ($i = 0; $i < $len; $i++) {
+    print "\t", pickone(@insns), " ",
+        pickone(@regs), ",", pickone(@regs), "\n";
+}
diff --git a/test/performtest.pl b/test/performtest.pl
new file mode 100755 (executable)
index 0000000..f7865b3
--- /dev/null
@@ -0,0 +1,192 @@
+#!/usr/bin/perl
+#Perform tests on nasm
+
+use strict;
+use warnings;
+
+use Getopt::Long qw(GetOptions);
+use Pod::Usage qw(pod2usage);
+
+use File::Basename qw(fileparse);
+use File::Compare qw(compare compare_text);
+use File::Copy qw(move);
+use File::Path qw(mkpath rmtree);
+
+#sub debugprint { print (pop() . "\n"); }
+ sub debugprint { }
+
+my $globalresult = 0;
+
+#Process one testfile
+sub perform {
+    my ($clean, $diff, $golden, $nasm, $quiet, $testpath) = @_;
+    my ($stdoutfile, $stderrfile) = ("stdout", "stderr");
+
+    my ($testname, $ignoredpath, $ignoredsuffix) = fileparse($testpath, ".asm");
+    debugprint $testname;
+
+    my $outputdir = $golden ? "golden" : "testresults";
+
+    mkdir "$outputdir" unless -d "$outputdir";
+
+    if ($clean) {
+        rmtree "$outputdir/$testname";
+        return;
+    }
+
+    if(-d "$outputdir/$testname") {
+        rmtree "$outputdir/$testname";
+    }
+
+    open(TESTFILE, '<', $testpath) or (warn "Can't open $testpath\n", return);
+    TEST:
+    while(<TESTFILE>) {
+        #See if there is a test case
+        last unless /Testname=(.*);\s*Arguments=(.*);\s*Files=(.*)/;
+        my ($subname, $arguments, $files) = ($1, $2, $3);
+        debugprint("$subname | $arguments | $files");
+
+        #Call nasm with this test case
+        system("$nasm $arguments $testpath > $stdoutfile 2> $stderrfile");
+        debugprint("$nasm $arguments $testpath > $stdoutfile 2> $stderrfile ----> $?");
+
+        #Move the output to the test dir
+        mkpath("$outputdir/$testname/$subname");
+        foreach(split / /,$files) {
+            if (-f $_) {
+                move($_, "$outputdir/$testname/$subname/$_") or die $!
+            }
+        }
+        unlink ("$stdoutfile", "$stderrfile"); #Just to be sure
+
+        if($golden) {
+            print "Test $testname/$subname created.\n" unless $quiet;
+        } else {
+            #Compare them with the golden files
+            my $result = 0;
+            my @failedfiles = ();
+            foreach(split / /, $files) {
+                if(-f "$outputdir/$testname/$subname/$_") {
+                    my $temp;
+                    if($_ eq $stdoutfile or $_ eq $stderrfile) {
+                        #Compare stdout and stderr in text mode so line ending changes won't matter
+                        $temp = compare_text("$outputdir/$testname/$subname/$_", "golden/$testname/$subname/$_",
+                                             sub { my ($a, $b) = @_;
+                                                   $a =~ s/\r//g;
+                                                   $b =~ s/\r//g;
+                                                   $a ne $b; } );
+                    } else {
+                        $temp = compare("$outputdir/$testname/$subname/$_", "golden/$testname/$subname/$_");
+                    }
+
+                    if($temp == 1) {
+                        #different
+                        $result = 1;
+                        $globalresult = 1;
+                        push @failedfiles, $_;
+                    } elsif($temp == -1) {
+                        #error
+                        print "Can't compare at $testname/$subname file $_\n";
+                        next TEST;
+                    }
+                } elsif (-f "golden/$testname/$subname/$_") {
+                    #File exists in golden but not in output
+                    $result = 1;
+                    $globalresult = 1;
+                    push @failedfiles, $_;
+                }
+            }
+
+            if($result == 0) {
+                print "Test $testname/$subname succeeded.\n" unless $quiet;
+            } elsif ($result == 1) {
+                print "Test $testname/$subname failed on @failedfiles.\n";
+                if($diff) {
+                    for(@failedfiles) {
+                        if($_ eq $stdoutfile or $_ eq $stderrfile) {
+                            system "diff -u golden/$testname/$subname/$_ $outputdir/$testname/$subname/$_";
+                            print "\n";
+                        }
+                    }
+                }
+            } else {
+                die "Impossible result";
+            }
+        }
+    }
+    close(TESTFILE);
+}
+
+my $nasm;
+my $clean = 0;
+my $diff = 0;
+my $golden = 0;
+my $help = 0;
+my $verbose = 0;
+
+GetOptions('clean' => \$clean,
+           'diff'=> \$diff,
+           'golden' => \$golden,
+           'help' => \$help,
+           'verbose' => \$verbose,
+           'nasm=s' => \$nasm
+          ) or pod2usage();
+
+pod2usage() if $help;
+die "Please specify either --nasm or --clean. Use --help for help.\n"
+unless $nasm or $clean;
+die "Please specify the test files, e.g. *.asm\n" unless @ARGV;
+
+unless (!defined $nasm or -x $nasm) {
+  warn "Warning: $nasm may not be executable. Expect problems.\n\n";
+  sleep 5;
+}
+
+perform($clean, $diff, $golden, $nasm, ! $verbose, $_) foreach @ARGV;
+exit $globalresult;
+
+__END__
+
+=head1 NAME
+
+performtest.pl - NASM regression tester based on golden files
+
+=head1 SYNOPSIS
+
+performtest.pl [options] [testfile.asm ...]
+
+Runs NASM on the specified test files and compare the results
+with "golden" output files.
+
+ Options:
+     --clean     Clean up test results (or golden files with --golden)
+     --diff      Execute diff when stdout or stderr don't match
+     --golden    Create golden files
+     --help      Get this help
+     --nasm=file Specify the file name for the NASM executable, e.g. ../nasm
+     --verbose   Get more output
+
+     If --clean is not specified, --nasm is required.
+
+ testfile.asm ...:
+    One or more files that NASM should be tested with,
+    often *.asm in the test directory.
+    It should contain one or more option lines at the start,
+    in the following format:
+
+;Testname=<testname>; Arguments=<arguments to nasm>; Files=<output files>
+
+    If no such lines are found at the start, the file is skipped.
+    testname should ideally describe the arguments, eg. unoptimized for -O0.
+    arguments can be an optimization level (-O), an output format (-f),
+    an output file specifier (-o) etc.
+    The output files should be a space seperated list of files that will
+    be checked for regressions. This should often be the output file
+    and the special files stdout and stderr.
+
+Any mismatch could be a regression,
+but it doesn't have to be. COFF files have a timestamp which
+makes this method useless. ELF files have a comment section
+with the current version of NASM, so they will change each version number.
+
+=cut
diff --git a/test/pinsr16.asm b/test/pinsr16.asm
new file mode 100644 (file)
index 0000000..0159839
--- /dev/null
@@ -0,0 +1,53 @@
+;Testname=test; Arguments=-O0 -fbin -opinsr16.bin; Files=stdout stderr pinsr16.bin
+       bits 16
+
+       pinsrw mm0,eax,0
+       pinsrw mm1,si,0
+       pinsrw mm2,[bx],0
+       pinsrw mm3,word [bx],0
+
+       pinsrb xmm0,eax,0
+       pinsrb xmm1,sil,0
+;      pinsrb xmm1,bh,0
+       pinsrb xmm2,[bx],0
+       pinsrb xmm3,byte [bx],0
+
+       pinsrw xmm0,eax,0
+       pinsrw xmm1,si,0
+       pinsrw xmm2,[bx],0
+       pinsrw xmm3,word [bx],0
+
+       pinsrd xmm0,eax,0
+       pinsrd xmm1,esi,0
+       pinsrd xmm2,[bx],0
+       pinsrd xmm3,dword [bx],0
+
+       vpinsrb xmm0,eax,0
+       vpinsrb xmm1,bl,0
+       vpinsrb xmm2,[bx],0
+       vpinsrb xmm3,byte [bx],0
+
+       vpinsrw xmm0,eax,0
+       vpinsrw xmm1,si,0
+       vpinsrw xmm2,[bx],0
+       vpinsrw xmm3,word [bx],0
+
+       vpinsrd xmm0,eax,0
+       vpinsrd xmm1,esi,0
+       vpinsrd xmm2,[bx],0
+       vpinsrd xmm3,dword [bx],0
+
+       vpinsrb xmm4,xmm0,eax,0
+       vpinsrb xmm5,xmm1,bl,0
+       vpinsrb xmm6,xmm2,[bx],0
+       vpinsrb xmm7,xmm3,byte [bx],0
+
+       vpinsrw xmm4,xmm0,eax,0
+       vpinsrw xmm5,xmm1,si,0
+       vpinsrw xmm6,xmm2,[bx],0
+       vpinsrw xmm7,xmm3,word [bx],0
+
+       vpinsrd xmm4,xmm0,eax,0
+       vpinsrd xmm5,xmm1,esi,0
+       vpinsrd xmm6,xmm2,[bx],0
+       vpinsrd xmm7,xmm3,dword [bx],0
diff --git a/test/pinsr32.asm b/test/pinsr32.asm
new file mode 100644 (file)
index 0000000..24b3e58
--- /dev/null
@@ -0,0 +1,53 @@
+;Testname=test; Arguments=-O0 -fbin -opinsr32.bin; Files=stdout stderr pinsr32.bin
+       bits 32
+
+       pinsrw mm0,eax,0
+       pinsrw mm1,si,0
+       pinsrw mm2,[ecx],0
+       pinsrw mm3,word [ecx],0
+
+       pinsrb xmm0,eax,0
+       pinsrb xmm1,sil,0
+;      pinsrb xmm1,bh,0
+       pinsrb xmm2,[ecx],0
+       pinsrb xmm3,byte [ecx],0
+
+       pinsrw xmm0,eax,0
+       pinsrw xmm1,si,0
+       pinsrw xmm2,[ecx],0
+       pinsrw xmm3,word [ecx],0
+
+       pinsrd xmm0,eax,0
+       pinsrd xmm1,esi,0
+       pinsrd xmm2,[ecx],0
+       pinsrd xmm3,dword [ecx],0
+
+       vpinsrb xmm0,eax,0
+       vpinsrb xmm1,bl,0
+       vpinsrb xmm2,[ecx],0
+       vpinsrb xmm3,byte [ecx],0
+
+       vpinsrw xmm0,eax,0
+       vpinsrw xmm1,si,0
+       vpinsrw xmm2,[ecx],0
+       vpinsrw xmm3,word [ecx],0
+
+       vpinsrd xmm0,eax,0
+       vpinsrd xmm1,esi,0
+       vpinsrd xmm2,[ecx],0
+       vpinsrd xmm3,dword [ecx],0
+
+       vpinsrb xmm4,xmm0,eax,0
+       vpinsrb xmm5,xmm1,bl,0
+       vpinsrb xmm6,xmm2,[ecx],0
+       vpinsrb xmm7,xmm3,byte [ecx],0
+
+       vpinsrw xmm4,xmm0,eax,0
+       vpinsrw xmm5,xmm1,si,0
+       vpinsrw xmm6,xmm2,[ecx],0
+       vpinsrw xmm7,xmm3,word [ecx],0
+
+       vpinsrd xmm4,xmm0,eax,0
+       vpinsrd xmm5,xmm1,esi,0
+       vpinsrd xmm6,xmm2,[ecx],0
+       vpinsrd xmm7,xmm3,dword [ecx],0
diff --git a/test/pinsr64.asm b/test/pinsr64.asm
new file mode 100644 (file)
index 0000000..8eedfdd
--- /dev/null
@@ -0,0 +1,68 @@
+;Testname=test; Arguments=-O0 -fbin -opinsr64.bin; Files=stdout stderr pinsr64.bin
+       bits 64
+
+       pinsrw mm0,eax,0
+       pinsrw mm1,si,0
+       pinsrw mm2,[rcx],0
+       pinsrw mm3,word [rcx],0
+
+       pinsrb xmm0,eax,0
+       pinsrb xmm1,sil,0
+;      pinsrb xmm1,bh,0
+       pinsrb xmm2,[rcx],0
+       pinsrb xmm3,byte [rcx],0
+
+       pinsrw xmm0,eax,0
+       pinsrw xmm1,si,0
+       pinsrw xmm2,[rcx],0
+       pinsrw xmm3,word [rcx],0
+
+       pinsrd xmm0,eax,0
+       pinsrd xmm1,esi,0
+       pinsrd xmm2,[rcx],0
+       pinsrd xmm3,dword [rcx],0
+
+       pinsrq xmm0,rax,0
+       pinsrq xmm1,rsi,0
+       pinsrq xmm2,[rcx],0
+       pinsrq xmm3,qword [rcx],0
+
+       vpinsrb xmm0,eax,0
+       vpinsrb xmm1,sil,0
+       vpinsrb xmm2,[rcx],0
+       vpinsrb xmm3,byte [rcx],0
+
+       vpinsrw xmm0,eax,0
+       vpinsrw xmm1,si,0
+       vpinsrw xmm2,[rcx],0
+       vpinsrw xmm3,word [rcx],0
+
+       vpinsrd xmm0,eax,0
+       vpinsrd xmm1,esi,0
+       vpinsrd xmm2,[rcx],0
+       vpinsrd xmm3,dword [rcx],0
+
+       vpinsrq xmm0,rax,0
+       vpinsrq xmm1,rsi,0
+       vpinsrq xmm2,[rcx],0
+       vpinsrq xmm3,qword [rcx],0
+
+       vpinsrb xmm4,xmm0,eax,0
+       vpinsrb xmm5,xmm1,sil,0
+       vpinsrb xmm6,xmm2,[rcx],0
+       vpinsrb xmm7,xmm3,byte [rcx],0
+
+       vpinsrw xmm4,xmm0,eax,0
+       vpinsrw xmm5,xmm1,si,0
+       vpinsrw xmm6,xmm2,[rcx],0
+       vpinsrw xmm7,xmm3,word [rcx],0
+
+       vpinsrd xmm4,xmm0,eax,0
+       vpinsrd xmm5,xmm1,esi,0
+       vpinsrd xmm6,xmm2,[rcx],0
+       vpinsrd xmm7,xmm3,dword [rcx],0
+
+       vpinsrq xmm4,xmm0,rax,0
+       vpinsrq xmm5,xmm1,rsi,0
+       vpinsrq xmm6,xmm2,[rcx],0
+       vpinsrq xmm7,xmm3,qword [rdx],0
diff --git a/test/popcnt.asm b/test/popcnt.asm
new file mode 100644 (file)
index 0000000..0009619
--- /dev/null
@@ -0,0 +1,32 @@
+;Testname=test; Arguments=-fbin -opopcnt.bin; Files=stdout stderr popcnt.bin
+
+       bits 16
+
+       popcnt ax,cx
+       popcnt ax,[si]
+       popcnt ax,word [si]
+       popcnt eax,ecx
+       popcnt eax,[si]
+       popcnt eax,dword [si]
+
+       bits 32
+
+       popcnt ax,cx
+       popcnt ax,[esi]
+       popcnt ax,word [esi]
+       popcnt eax,ecx
+       popcnt eax,[esi]
+       popcnt eax,dword [esi]
+
+       bits 64
+
+       popcnt ax,cx
+       popcnt ax,[rsi]
+       popcnt ax,word [rsi]
+       popcnt eax,ecx
+       popcnt eax,[rsi]
+       popcnt eax,dword [rsi]
+       popcnt rax,rcx
+       popcnt rax,[rsi]
+       popcnt rax,qword [rsi]
+       
\ No newline at end of file
diff --git a/test/ppindirect.asm b/test/ppindirect.asm
new file mode 100644 (file)
index 0000000..0a30d07
--- /dev/null
@@ -0,0 +1,42 @@
+;Testname=test; Arguments=-E -o ppindirect.out; Files=ppindirect.out
+
+; Fun tests of the preprocessor indirection mode...
+
+%assign foo1           11
+%assign foo11          1111
+%assign foo2           22
+%assign foo22          2222
+%assign foo3           33
+%assign foo33          3333
+%assign n              2
+foo%[foo%[n]]*100
+foo%[n]*100
+%assign foo%[foo%[n]]  foo%[foo%[n]]*100
+;%assign foo%[n]               foo%[n]*100
+
+       foo1
+       foo2
+       foo3
+       foo11
+       foo22
+       foo33
+
+%define foo33bar       999999
+       %[foo%[foo3]bar]
+       
+%assign bctr 0
+%macro bluttan 0
+%assign bctr bctr+1
+%assign bluttan%[bctr] bctr
+%defstr bstr bluttan%[bctr]
+       bluttan%[bctr]
+       bstr
+%endmacro
+
+%rep 20
+       bluttan
+%endrep
+%rep 20
+       bluttan%[bctr]
+%assign bctr bctr-1
+%endrep
diff --git a/test/pushseg.asm b/test/pushseg.asm
new file mode 100644 (file)
index 0000000..7bd7c95
--- /dev/null
@@ -0,0 +1,17 @@
+;Testname=test; Arguments=-fbin -opushseg.bin; Files=stdout stderr pushseg.bin
+
+       bits 16
+
+       push cs
+       push ds
+       push es
+       push ss
+       push fs
+       push gs
+
+       pop gs
+       pop fs
+       pop ss
+       pop es
+       pop ds
+       pop cs          ; 8086 only, does not disassemble
diff --git a/test/r13.asm b/test/r13.asm
new file mode 100644 (file)
index 0000000..88079e1
--- /dev/null
@@ -0,0 +1,15 @@
+;Testname=test; Arguments=-fbin -or13.bin; Files=stdout stderr r13.bin
+
+       bits 64
+       mov rax,[rbx]
+       mov rax,[rbx*4]
+       mov rax,[rbx+rbx*2]
+       mov rax,[r13+rbx*2]
+       mov rax,[rbp]
+       mov rax,[rbp*4]
+       mov rax,[rbp+rbp*2]
+       mov rax,[rbp+r13*2]
+       mov rax,[r13]
+       mov rax,[r13*4]
+       mov rax,[r13+rbp*2]
+       mov rax,[r13+r13*2]
diff --git a/test/radix.asm b/test/radix.asm
new file mode 100644 (file)
index 0000000..1c56457
--- /dev/null
@@ -0,0 +1,54 @@
+;Testname=test; Arguments=-fbin -oradix.bin; Files=stdout stderr radix.bin
+
+       ;;  Integer constants...
+
+       dd 1010_0101            ; Decimal
+       dd 01010_0101           ; Decimal (*not* octal!)
+       dd 0d1010_0101          ; Decimal
+       dd 0t1010_0101          ; Decimal
+       dd 1010_0101d           ; Decimal
+       dd 1010_0101t           ; Decimal
+
+       dd 0b1010_0101          ; Binary
+       dd 0y1010_0101          ; Binary
+       dd 1010_0101b           ; Binary
+       dd 1010_0101y           ; Binary
+
+       dd 0o1010_0101          ; Octal
+       dd 0q1010_0101          ; Octal
+       dd 1010_0101o           ; Octal
+       dd 1010_0101q           ; Octal
+
+       dd 0h1010_0101          ; Hex
+       dd 0x1010_0101          ; Hex
+       dd 1010_0101h           ; Hex
+       dd 1010_0101x           ; Hex
+       dd $1010_0101           ; Hex
+
+       db 0h                   ; Zero!
+       db 0x                   ; Zero!
+       db 0b                   ; Zero!
+       db 0dh                  ; Hex
+       db 0bh                  ; Hex
+       db 0dx                  ; Hex
+       db 0bx                  ; Hex
+       db 0hd                  ; Hex
+       db 0hb                  ; Hex
+       db 0xd                  ; Hex
+       db 0xb                  ; Hex
+       
+       ;; Floating-point constants
+       ;; All of these should output B4A21147
+       dd 3.7282705e+4         ; Decimal
+       dd 00003.7282705e+4     ; Decimal
+       dd 0d3.7282705e+4       ; Decimal
+       dd 0t3.7282705e+4       ; Decimal
+
+       dd 0x1.23456789p+15     ; Hex
+       dd 0h1.23456789p+15     ; Hex
+       
+       dd 0o1.10642547422p+15  ; Octal
+       dd 0q1.10642547422p+15  ; Octal
+
+       dd 0b1.0010_0011_0100_0101_0110_0111_1000_1001p+15 ; Binary
+       dd 0y1.0010_0011_0100_0101_0110_0111_1000_1001p+15 ; Binary
diff --git a/test/riprel.asm b/test/riprel.asm
new file mode 100644 (file)
index 0000000..757a8dd
--- /dev/null
@@ -0,0 +1,5357 @@
+;Testname=unoptimized; Arguments=-fbin -oriprel.bin -O0; Files=stdout stderr riprel.bin
+;Testname=optimized;   Arguments=-fbin -oriprel.bin -Ox; Files=stdout stderr riprel.bin
+       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 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 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,[a64 foo]
+       mov bl,[a64 foo]
+       mov ax,[a64 foo]
+       mov bx,[a64 foo]
+       mov eax,[a64 foo]
+       mov ebx,[a64 foo]
+       mov rax,[a64 foo]
+       mov rbx,[a64 foo]
+       mov al,[a64 0xaaaaaaaaaaaaaaaa]
+       mov bl,[a64 0xaaaaaaaaaaaaaaaa]
+       mov ax,[a64 0xaaaaaaaaaaaaaaaa]
+       mov bx,[a64 0xaaaaaaaaaaaaaaaa]
+       mov eax,[a64 0xaaaaaaaaaaaaaaaa]
+       mov ebx,[a64 0xaaaaaaaaaaaaaaaa]
+       mov rax,[a64 0xaaaaaaaaaaaaaaaa]
+       mov rbx,[a64 0xaaaaaaaaaaaaaaaa]
+       mov al,[a64 0xbbbbbbbb]
+       mov bl,[a64 0xbbbbbbbb]
+       mov ax,[a64 0xbbbbbbbb]
+       mov bx,[a64 0xbbbbbbbb]
+       mov eax,[a64 0xbbbbbbbb]
+       mov ebx,[a64 0xbbbbbbbb]
+       mov rax,[a64 0xbbbbbbbb]
+       mov rbx,[a64 0xbbbbbbbb]
+       mov al,[a64 0xffffffffcccccccc]
+       mov bl,[a64 0xffffffffcccccccc]
+       mov ax,[a64 0xffffffffcccccccc]
+       mov bx,[a64 0xffffffffcccccccc]
+       mov eax,[a64 0xffffffffcccccccc]
+       mov ebx,[a64 0xffffffffcccccccc]
+       mov rax,[a64 0xffffffffcccccccc]
+       mov rbx,[a64 0xffffffffcccccccc]
+
+       mov al,[a64 dword foo]
+       mov bl,[a64 dword foo]
+       mov ax,[a64 dword foo]
+       mov bx,[a64 dword foo]
+       mov eax,[a64 dword foo]
+       mov ebx,[a64 dword foo]
+       mov rax,[a64 dword foo]
+       mov rbx,[a64 dword foo]
+       mov al,[a64 dword 0xaaaaaaaaaaaaaaaa]
+       mov bl,[a64 dword 0xaaaaaaaaaaaaaaaa]
+       mov ax,[a64 dword 0xaaaaaaaaaaaaaaaa]
+       mov bx,[a64 dword 0xaaaaaaaaaaaaaaaa]
+       mov eax,[a64 dword 0xaaaaaaaaaaaaaaaa]
+       mov ebx,[a64 dword 0xaaaaaaaaaaaaaaaa]
+       mov rax,[a64 dword 0xaaaaaaaaaaaaaaaa]
+       mov rbx,[a64 dword 0xaaaaaaaaaaaaaaaa]
+       mov al,[a64 dword 0xbbbbbbbb]
+       mov bl,[a64 dword 0xbbbbbbbb]
+       mov ax,[a64 dword 0xbbbbbbbb]
+       mov bx,[a64 dword 0xbbbbbbbb]
+       mov eax,[a64 dword 0xbbbbbbbb]
+       mov ebx,[a64 dword 0xbbbbbbbb]
+       mov rax,[a64 dword 0xbbbbbbbb]
+       mov rbx,[a64 dword 0xbbbbbbbb]
+       mov al,[a64 dword 0xffffffffcccccccc]
+       mov bl,[a64 dword 0xffffffffcccccccc]
+       mov ax,[a64 dword 0xffffffffcccccccc]
+       mov bx,[a64 dword 0xffffffffcccccccc]
+       mov eax,[a64 dword 0xffffffffcccccccc]
+       mov ebx,[a64 dword 0xffffffffcccccccc]
+       mov rax,[a64 dword 0xffffffffcccccccc]
+       mov rbx,[a64 dword 0xffffffffcccccccc]
+
+       mov al,[a64 qword foo]
+       mov bl,[a64 qword foo]
+       mov ax,[a64 qword foo]
+       mov bx,[a64 qword foo]
+       mov eax,[a64 qword foo]
+       mov ebx,[a64 qword foo]
+       mov rax,[a64 qword foo]
+       mov rbx,[a64 qword foo]
+       mov al,[a64 qword 0xaaaaaaaaaaaaaaaa]
+       mov bl,[a64 qword 0xaaaaaaaaaaaaaaaa]
+       mov ax,[a64 qword 0xaaaaaaaaaaaaaaaa]
+       mov bx,[a64 qword 0xaaaaaaaaaaaaaaaa]
+       mov eax,[a64 qword 0xaaaaaaaaaaaaaaaa]
+       mov ebx,[a64 qword 0xaaaaaaaaaaaaaaaa]
+       mov rax,[a64 qword 0xaaaaaaaaaaaaaaaa]
+       mov rbx,[a64 qword 0xaaaaaaaaaaaaaaaa]
+       mov al,[a64 qword 0xbbbbbbbb]
+       mov bl,[a64 qword 0xbbbbbbbb]
+       mov ax,[a64 qword 0xbbbbbbbb]
+       mov bx,[a64 qword 0xbbbbbbbb]
+       mov eax,[a64 qword 0xbbbbbbbb]
+       mov ebx,[a64 qword 0xbbbbbbbb]
+       mov rax,[a64 qword 0xbbbbbbbb]
+       mov rbx,[a64 qword 0xbbbbbbbb]
+       mov al,[a64 qword 0xffffffffcccccccc]
+       mov bl,[a64 qword 0xffffffffcccccccc]
+       mov ax,[a64 qword 0xffffffffcccccccc]
+       mov bx,[a64 qword 0xffffffffcccccccc]
+       mov eax,[a64 qword 0xffffffffcccccccc]
+       mov ebx,[a64 qword 0xffffffffcccccccc]
+       mov rax,[a64 qword 0xffffffffcccccccc]
+       mov rbx,[a64 qword 0xffffffffcccccccc]
+
+       mov al,[a32 foo]
+       mov bl,[a32 foo]
+       mov ax,[a32 foo]
+       mov bx,[a32 foo]
+       mov eax,[a32 foo]
+       mov ebx,[a32 foo]
+       mov rax,[a32 foo]
+       mov rbx,[a32 foo]
+       mov al,[a32 0xaaaaaaaaaaaaaaaa]
+       mov bl,[a32 0xaaaaaaaaaaaaaaaa]
+       mov ax,[a32 0xaaaaaaaaaaaaaaaa]
+       mov bx,[a32 0xaaaaaaaaaaaaaaaa]
+       mov eax,[a32 0xaaaaaaaaaaaaaaaa]
+       mov ebx,[a32 0xaaaaaaaaaaaaaaaa]
+       mov rax,[a32 0xaaaaaaaaaaaaaaaa]
+       mov rbx,[a32 0xaaaaaaaaaaaaaaaa]
+       mov al,[a32 0xbbbbbbbb]
+       mov bl,[a32 0xbbbbbbbb]
+       mov ax,[a32 0xbbbbbbbb]
+       mov bx,[a32 0xbbbbbbbb]
+       mov eax,[a32 0xbbbbbbbb]
+       mov ebx,[a32 0xbbbbbbbb]
+       mov rax,[a32 0xbbbbbbbb]
+       mov rbx,[a32 0xbbbbbbbb]
+       mov al,[a32 0xffffffffcccccccc]
+       mov bl,[a32 0xffffffffcccccccc]
+       mov ax,[a32 0xffffffffcccccccc]
+       mov bx,[a32 0xffffffffcccccccc]
+       mov eax,[a32 0xffffffffcccccccc]
+       mov ebx,[a32 0xffffffffcccccccc]
+       mov rax,[a32 0xffffffffcccccccc]
+       mov rbx,[a32 0xffffffffcccccccc]
+
+       mov al,[a32 dword foo]
+       mov bl,[a32 dword foo]
+       mov ax,[a32 dword foo]
+       mov bx,[a32 dword foo]
+       mov eax,[a32 dword foo]
+       mov ebx,[a32 dword foo]
+       mov rax,[a32 dword foo]
+       mov rbx,[a32 dword foo]
+       mov al,[a32 dword 0xaaaaaaaaaaaaaaaa]
+       mov bl,[a32 dword 0xaaaaaaaaaaaaaaaa]
+       mov ax,[a32 dword 0xaaaaaaaaaaaaaaaa]
+       mov bx,[a32 dword 0xaaaaaaaaaaaaaaaa]
+       mov eax,[a32 dword 0xaaaaaaaaaaaaaaaa]
+       mov ebx,[a32 dword 0xaaaaaaaaaaaaaaaa]
+       mov rax,[a32 dword 0xaaaaaaaaaaaaaaaa]
+       mov rbx,[a32 dword 0xaaaaaaaaaaaaaaaa]
+       mov al,[a32 dword 0xbbbbbbbb]
+       mov bl,[a32 dword 0xbbbbbbbb]
+       mov ax,[a32 dword 0xbbbbbbbb]
+       mov bx,[a32 dword 0xbbbbbbbb]
+       mov eax,[a32 dword 0xbbbbbbbb]
+       mov ebx,[a32 dword 0xbbbbbbbb]
+       mov rax,[a32 dword 0xbbbbbbbb]
+       mov rbx,[a32 dword 0xbbbbbbbb]
+       mov al,[a32 dword 0xffffffffcccccccc]
+       mov bl,[a32 dword 0xffffffffcccccccc]
+       mov ax,[a32 dword 0xffffffffcccccccc]
+       mov bx,[a32 dword 0xffffffffcccccccc]
+       mov eax,[a32 dword 0xffffffffcccccccc]
+       mov ebx,[a32 dword 0xffffffffcccccccc]
+       mov rax,[a32 dword 0xffffffffcccccccc]
+       mov rbx,[a32 dword 0xffffffffcccccccc]
+
+       mov al,[a32 qword foo]
+       mov bl,[a32 qword foo]
+       mov ax,[a32 qword foo]
+       mov bx,[a32 qword foo]
+       mov eax,[a32 qword foo]
+       mov ebx,[a32 qword foo]
+       mov rax,[a32 qword foo]
+       mov rbx,[a32 qword foo]
+       mov al,[a32 qword 0xaaaaaaaaaaaaaaaa]
+       mov bl,[a32 qword 0xaaaaaaaaaaaaaaaa]
+       mov ax,[a32 qword 0xaaaaaaaaaaaaaaaa]
+       mov bx,[a32 qword 0xaaaaaaaaaaaaaaaa]
+       mov eax,[a32 qword 0xaaaaaaaaaaaaaaaa]
+       mov ebx,[a32 qword 0xaaaaaaaaaaaaaaaa]
+       mov rax,[a32 qword 0xaaaaaaaaaaaaaaaa]
+       mov rbx,[a32 qword 0xaaaaaaaaaaaaaaaa]
+       mov al,[a32 qword 0xbbbbbbbb]
+       mov bl,[a32 qword 0xbbbbbbbb]
+       mov ax,[a32 qword 0xbbbbbbbb]
+       mov bx,[a32 qword 0xbbbbbbbb]
+       mov eax,[a32 qword 0xbbbbbbbb]
+       mov ebx,[a32 qword 0xbbbbbbbb]
+       mov rax,[a32 qword 0xbbbbbbbb]
+       mov rbx,[a32 qword 0xbbbbbbbb]
+       mov al,[a32 qword 0xffffffffcccccccc]
+       mov bl,[a32 qword 0xffffffffcccccccc]
+       mov ax,[a32 qword 0xffffffffcccccccc]
+       mov bx,[a32 qword 0xffffffffcccccccc]
+       mov eax,[a32 qword 0xffffffffcccccccc]
+       mov ebx,[a32 qword 0xffffffffcccccccc]
+       mov rax,[a32 qword 0xffffffffcccccccc]
+       mov rbx,[a32 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,[a64 abs foo]
+       mov bl,[a64 abs foo]
+       mov ax,[a64 abs foo]
+       mov bx,[a64 abs foo]
+       mov eax,[a64 abs foo]
+       mov ebx,[a64 abs foo]
+       mov rax,[a64 abs foo]
+       mov rbx,[a64 abs foo]
+       mov al,[a64 abs 0xaaaaaaaaaaaaaaaa]
+       mov bl,[a64 abs 0xaaaaaaaaaaaaaaaa]
+       mov ax,[a64 abs 0xaaaaaaaaaaaaaaaa]
+       mov bx,[a64 abs 0xaaaaaaaaaaaaaaaa]
+       mov eax,[a64 abs 0xaaaaaaaaaaaaaaaa]
+       mov ebx,[a64 abs 0xaaaaaaaaaaaaaaaa]
+       mov rax,[a64 abs 0xaaaaaaaaaaaaaaaa]
+       mov rbx,[a64 abs 0xaaaaaaaaaaaaaaaa]
+       mov al,[a64 abs 0xbbbbbbbb]
+       mov bl,[a64 abs 0xbbbbbbbb]
+       mov ax,[a64 abs 0xbbbbbbbb]
+       mov bx,[a64 abs 0xbbbbbbbb]
+       mov eax,[a64 abs 0xbbbbbbbb]
+       mov ebx,[a64 abs 0xbbbbbbbb]
+       mov rax,[a64 abs 0xbbbbbbbb]
+       mov rbx,[a64 abs 0xbbbbbbbb]
+       mov al,[a64 abs 0xffffffffcccccccc]
+       mov bl,[a64 abs 0xffffffffcccccccc]
+       mov ax,[a64 abs 0xffffffffcccccccc]
+       mov bx,[a64 abs 0xffffffffcccccccc]
+       mov eax,[a64 abs 0xffffffffcccccccc]
+       mov ebx,[a64 abs 0xffffffffcccccccc]
+       mov rax,[a64 abs 0xffffffffcccccccc]
+       mov rbx,[a64 abs 0xffffffffcccccccc]
+
+       mov al,[a64 abs dword foo]
+       mov bl,[a64 abs dword foo]
+       mov ax,[a64 abs dword foo]
+       mov bx,[a64 abs dword foo]
+       mov eax,[a64 abs dword foo]
+       mov ebx,[a64 abs dword foo]
+       mov rax,[a64 abs dword foo]
+       mov rbx,[a64 abs dword foo]
+       mov al,[a64 abs dword 0xaaaaaaaaaaaaaaaa]
+       mov bl,[a64 abs dword 0xaaaaaaaaaaaaaaaa]
+       mov ax,[a64 abs dword 0xaaaaaaaaaaaaaaaa]
+       mov bx,[a64 abs dword 0xaaaaaaaaaaaaaaaa]
+       mov eax,[a64 abs dword 0xaaaaaaaaaaaaaaaa]
+       mov ebx,[a64 abs dword 0xaaaaaaaaaaaaaaaa]
+       mov rax,[a64 abs dword 0xaaaaaaaaaaaaaaaa]
+       mov rbx,[a64 abs dword 0xaaaaaaaaaaaaaaaa]
+       mov al,[a64 abs dword 0xbbbbbbbb]
+       mov bl,[a64 abs dword 0xbbbbbbbb]
+       mov ax,[a64 abs dword 0xbbbbbbbb]
+       mov bx,[a64 abs dword 0xbbbbbbbb]
+       mov eax,[a64 abs dword 0xbbbbbbbb]
+       mov ebx,[a64 abs dword 0xbbbbbbbb]
+       mov rax,[a64 abs dword 0xbbbbbbbb]
+       mov rbx,[a64 abs dword 0xbbbbbbbb]
+       mov al,[a64 abs dword 0xffffffffcccccccc]
+       mov bl,[a64 abs dword 0xffffffffcccccccc]
+       mov ax,[a64 abs dword 0xffffffffcccccccc]
+       mov bx,[a64 abs dword 0xffffffffcccccccc]
+       mov eax,[a64 abs dword 0xffffffffcccccccc]
+       mov ebx,[a64 abs dword 0xffffffffcccccccc]
+       mov rax,[a64 abs dword 0xffffffffcccccccc]
+       mov rbx,[a64 abs dword 0xffffffffcccccccc]
+
+       mov al,[a64 abs qword foo]
+       mov bl,[a64 abs qword foo]
+       mov ax,[a64 abs qword foo]
+       mov bx,[a64 abs qword foo]
+       mov eax,[a64 abs qword foo]
+       mov ebx,[a64 abs qword foo]
+       mov rax,[a64 abs qword foo]
+       mov rbx,[a64 abs qword foo]
+       mov al,[a64 abs qword 0xaaaaaaaaaaaaaaaa]
+       mov bl,[a64 abs qword 0xaaaaaaaaaaaaaaaa]
+       mov ax,[a64 abs qword 0xaaaaaaaaaaaaaaaa]
+       mov bx,[a64 abs qword 0xaaaaaaaaaaaaaaaa]
+       mov eax,[a64 abs qword 0xaaaaaaaaaaaaaaaa]
+       mov ebx,[a64 abs qword 0xaaaaaaaaaaaaaaaa]
+       mov rax,[a64 abs qword 0xaaaaaaaaaaaaaaaa]
+       mov rbx,[a64 abs qword 0xaaaaaaaaaaaaaaaa]
+       mov al,[a64 abs qword 0xbbbbbbbb]
+       mov bl,[a64 abs qword 0xbbbbbbbb]
+       mov ax,[a64 abs qword 0xbbbbbbbb]
+       mov bx,[a64 abs qword 0xbbbbbbbb]
+       mov eax,[a64 abs qword 0xbbbbbbbb]
+       mov ebx,[a64 abs qword 0xbbbbbbbb]
+       mov rax,[a64 abs qword 0xbbbbbbbb]
+       mov rbx,[a64 abs qword 0xbbbbbbbb]
+       mov al,[a64 abs qword 0xffffffffcccccccc]
+       mov bl,[a64 abs qword 0xffffffffcccccccc]
+       mov ax,[a64 abs qword 0xffffffffcccccccc]
+       mov bx,[a64 abs qword 0xffffffffcccccccc]
+       mov eax,[a64 abs qword 0xffffffffcccccccc]
+       mov ebx,[a64 abs qword 0xffffffffcccccccc]
+       mov rax,[a64 abs qword 0xffffffffcccccccc]
+       mov rbx,[a64 abs qword 0xffffffffcccccccc]
+
+       mov al,[a32 abs foo]
+       mov bl,[a32 abs foo]
+       mov ax,[a32 abs foo]
+       mov bx,[a32 abs foo]
+       mov eax,[a32 abs foo]
+       mov ebx,[a32 abs foo]
+       mov rax,[a32 abs foo]
+       mov rbx,[a32 abs foo]
+       mov al,[a32 abs 0xaaaaaaaaaaaaaaaa]
+       mov bl,[a32 abs 0xaaaaaaaaaaaaaaaa]
+       mov ax,[a32 abs 0xaaaaaaaaaaaaaaaa]
+       mov bx,[a32 abs 0xaaaaaaaaaaaaaaaa]
+       mov eax,[a32 abs 0xaaaaaaaaaaaaaaaa]
+       mov ebx,[a32 abs 0xaaaaaaaaaaaaaaaa]
+       mov rax,[a32 abs 0xaaaaaaaaaaaaaaaa]
+       mov rbx,[a32 abs 0xaaaaaaaaaaaaaaaa]
+       mov al,[a32 abs 0xbbbbbbbb]
+       mov bl,[a32 abs 0xbbbbbbbb]
+       mov ax,[a32 abs 0xbbbbbbbb]
+       mov bx,[a32 abs 0xbbbbbbbb]
+       mov eax,[a32 abs 0xbbbbbbbb]
+       mov ebx,[a32 abs 0xbbbbbbbb]
+       mov rax,[a32 abs 0xbbbbbbbb]
+       mov rbx,[a32 abs 0xbbbbbbbb]
+       mov al,[a32 abs 0xffffffffcccccccc]
+       mov bl,[a32 abs 0xffffffffcccccccc]
+       mov ax,[a32 abs 0xffffffffcccccccc]
+       mov bx,[a32 abs 0xffffffffcccccccc]
+       mov eax,[a32 abs 0xffffffffcccccccc]
+       mov ebx,[a32 abs 0xffffffffcccccccc]
+       mov rax,[a32 abs 0xffffffffcccccccc]
+       mov rbx,[a32 abs 0xffffffffcccccccc]
+
+       mov al,[a32 abs dword foo]
+       mov bl,[a32 abs dword foo]
+       mov ax,[a32 abs dword foo]
+       mov bx,[a32 abs dword foo]
+       mov eax,[a32 abs dword foo]
+       mov ebx,[a32 abs dword foo]
+       mov rax,[a32 abs dword foo]
+       mov rbx,[a32 abs dword foo]
+       mov al,[a32 abs dword 0xaaaaaaaaaaaaaaaa]
+       mov bl,[a32 abs dword 0xaaaaaaaaaaaaaaaa]
+       mov ax,[a32 abs dword 0xaaaaaaaaaaaaaaaa]
+       mov bx,[a32 abs dword 0xaaaaaaaaaaaaaaaa]
+       mov eax,[a32 abs dword 0xaaaaaaaaaaaaaaaa]
+       mov ebx,[a32 abs dword 0xaaaaaaaaaaaaaaaa]
+       mov rax,[a32 abs dword 0xaaaaaaaaaaaaaaaa]
+       mov rbx,[a32 abs dword 0xaaaaaaaaaaaaaaaa]
+       mov al,[a32 abs dword 0xbbbbbbbb]
+       mov bl,[a32 abs dword 0xbbbbbbbb]
+       mov ax,[a32 abs dword 0xbbbbbbbb]
+       mov bx,[a32 abs dword 0xbbbbbbbb]
+       mov eax,[a32 abs dword 0xbbbbbbbb]
+       mov ebx,[a32 abs dword 0xbbbbbbbb]
+       mov rax,[a32 abs dword 0xbbbbbbbb]
+       mov rbx,[a32 abs dword 0xbbbbbbbb]
+       mov al,[a32 abs dword 0xffffffffcccccccc]
+       mov bl,[a32 abs dword 0xffffffffcccccccc]
+       mov ax,[a32 abs dword 0xffffffffcccccccc]
+       mov bx,[a32 abs dword 0xffffffffcccccccc]
+       mov eax,[a32 abs dword 0xffffffffcccccccc]
+       mov ebx,[a32 abs dword 0xffffffffcccccccc]
+       mov rax,[a32 abs dword 0xffffffffcccccccc]
+       mov rbx,[a32 abs dword 0xffffffffcccccccc]
+
+       mov al,[a32 abs qword foo]
+       mov bl,[a32 abs qword foo]
+       mov ax,[a32 abs qword foo]
+       mov bx,[a32 abs qword foo]
+       mov eax,[a32 abs qword foo]
+       mov ebx,[a32 abs qword foo]
+       mov rax,[a32 abs qword foo]
+       mov rbx,[a32 abs qword foo]
+       mov al,[a32 abs qword 0xaaaaaaaaaaaaaaaa]
+       mov bl,[a32 abs qword 0xaaaaaaaaaaaaaaaa]
+       mov ax,[a32 abs qword 0xaaaaaaaaaaaaaaaa]
+       mov bx,[a32 abs qword 0xaaaaaaaaaaaaaaaa]
+       mov eax,[a32 abs qword 0xaaaaaaaaaaaaaaaa]
+       mov ebx,[a32 abs qword 0xaaaaaaaaaaaaaaaa]
+       mov rax,[a32 abs qword 0xaaaaaaaaaaaaaaaa]
+       mov rbx,[a32 abs qword 0xaaaaaaaaaaaaaaaa]
+       mov al,[a32 abs qword 0xbbbbbbbb]
+       mov bl,[a32 abs qword 0xbbbbbbbb]
+       mov ax,[a32 abs qword 0xbbbbbbbb]
+       mov bx,[a32 abs qword 0xbbbbbbbb]
+       mov eax,[a32 abs qword 0xbbbbbbbb]
+       mov ebx,[a32 abs qword 0xbbbbbbbb]
+       mov rax,[a32 abs qword 0xbbbbbbbb]
+       mov rbx,[a32 abs qword 0xbbbbbbbb]
+       mov al,[a32 abs qword 0xffffffffcccccccc]
+       mov bl,[a32 abs qword 0xffffffffcccccccc]
+       mov ax,[a32 abs qword 0xffffffffcccccccc]
+       mov bx,[a32 abs qword 0xffffffffcccccccc]
+       mov eax,[a32 abs qword 0xffffffffcccccccc]
+       mov ebx,[a32 abs qword 0xffffffffcccccccc]
+       mov rax,[a32 abs qword 0xffffffffcccccccc]
+       mov rbx,[a32 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 al,[a64 rel foo]
+       mov bl,[a64 rel foo]
+       mov ax,[a64 rel foo]
+       mov bx,[a64 rel foo]
+       mov eax,[a64 rel foo]
+       mov ebx,[a64 rel foo]
+       mov rax,[a64 rel foo]
+       mov rbx,[a64 rel foo]
+       mov al,[a64 rel 0xaaaaaaaaaaaaaaaa]
+       mov bl,[a64 rel 0xaaaaaaaaaaaaaaaa]
+       mov ax,[a64 rel 0xaaaaaaaaaaaaaaaa]
+       mov bx,[a64 rel 0xaaaaaaaaaaaaaaaa]
+       mov eax,[a64 rel 0xaaaaaaaaaaaaaaaa]
+       mov ebx,[a64 rel 0xaaaaaaaaaaaaaaaa]
+       mov rax,[a64 rel 0xaaaaaaaaaaaaaaaa]
+       mov rbx,[a64 rel 0xaaaaaaaaaaaaaaaa]
+       mov al,[a64 rel 0xbbbbbbbb]
+       mov bl,[a64 rel 0xbbbbbbbb]
+       mov ax,[a64 rel 0xbbbbbbbb]
+       mov bx,[a64 rel 0xbbbbbbbb]
+       mov eax,[a64 rel 0xbbbbbbbb]
+       mov ebx,[a64 rel 0xbbbbbbbb]
+       mov rax,[a64 rel 0xbbbbbbbb]
+       mov rbx,[a64 rel 0xbbbbbbbb]
+       mov al,[a64 rel 0xffffffffcccccccc]
+       mov bl,[a64 rel 0xffffffffcccccccc]
+       mov ax,[a64 rel 0xffffffffcccccccc]
+       mov bx,[a64 rel 0xffffffffcccccccc]
+       mov eax,[a64 rel 0xffffffffcccccccc]
+       mov ebx,[a64 rel 0xffffffffcccccccc]
+       mov rax,[a64 rel 0xffffffffcccccccc]
+       mov rbx,[a64 rel 0xffffffffcccccccc]
+
+       mov al,[a64 rel dword foo]
+       mov bl,[a64 rel dword foo]
+       mov ax,[a64 rel dword foo]
+       mov bx,[a64 rel dword foo]
+       mov eax,[a64 rel dword foo]
+       mov ebx,[a64 rel dword foo]
+       mov rax,[a64 rel dword foo]
+       mov rbx,[a64 rel dword foo]
+       mov al,[a64 rel dword 0xaaaaaaaaaaaaaaaa]
+       mov bl,[a64 rel dword 0xaaaaaaaaaaaaaaaa]
+       mov ax,[a64 rel dword 0xaaaaaaaaaaaaaaaa]
+       mov bx,[a64 rel dword 0xaaaaaaaaaaaaaaaa]
+       mov eax,[a64 rel dword 0xaaaaaaaaaaaaaaaa]
+       mov ebx,[a64 rel dword 0xaaaaaaaaaaaaaaaa]
+       mov rax,[a64 rel dword 0xaaaaaaaaaaaaaaaa]
+       mov rbx,[a64 rel dword 0xaaaaaaaaaaaaaaaa]
+       mov al,[a64 rel dword 0xbbbbbbbb]
+       mov bl,[a64 rel dword 0xbbbbbbbb]
+       mov ax,[a64 rel dword 0xbbbbbbbb]
+       mov bx,[a64 rel dword 0xbbbbbbbb]
+       mov eax,[a64 rel dword 0xbbbbbbbb]
+       mov ebx,[a64 rel dword 0xbbbbbbbb]
+       mov rax,[a64 rel dword 0xbbbbbbbb]
+       mov rbx,[a64 rel dword 0xbbbbbbbb]
+       mov al,[a64 rel dword 0xffffffffcccccccc]
+       mov bl,[a64 rel dword 0xffffffffcccccccc]
+       mov ax,[a64 rel dword 0xffffffffcccccccc]
+       mov bx,[a64 rel dword 0xffffffffcccccccc]
+       mov eax,[a64 rel dword 0xffffffffcccccccc]
+       mov ebx,[a64 rel dword 0xffffffffcccccccc]
+       mov rax,[a64 rel dword 0xffffffffcccccccc]
+       mov rbx,[a64 rel dword 0xffffffffcccccccc]
+
+       mov al,[a64 rel qword foo]
+       mov bl,[a64 rel qword foo]
+       mov ax,[a64 rel qword foo]
+       mov bx,[a64 rel qword foo]
+       mov eax,[a64 rel qword foo]
+       mov ebx,[a64 rel qword foo]
+       mov rax,[a64 rel qword foo]
+       mov rbx,[a64 rel qword foo]
+       mov al,[a64 rel qword 0xaaaaaaaaaaaaaaaa]
+       mov bl,[a64 rel qword 0xaaaaaaaaaaaaaaaa]
+       mov ax,[a64 rel qword 0xaaaaaaaaaaaaaaaa]
+       mov bx,[a64 rel qword 0xaaaaaaaaaaaaaaaa]
+       mov eax,[a64 rel qword 0xaaaaaaaaaaaaaaaa]
+       mov ebx,[a64 rel qword 0xaaaaaaaaaaaaaaaa]
+       mov rax,[a64 rel qword 0xaaaaaaaaaaaaaaaa]
+       mov rbx,[a64 rel qword 0xaaaaaaaaaaaaaaaa]
+       mov al,[a64 rel qword 0xbbbbbbbb]
+       mov bl,[a64 rel qword 0xbbbbbbbb]
+       mov ax,[a64 rel qword 0xbbbbbbbb]
+       mov bx,[a64 rel qword 0xbbbbbbbb]
+       mov eax,[a64 rel qword 0xbbbbbbbb]
+       mov ebx,[a64 rel qword 0xbbbbbbbb]
+       mov rax,[a64 rel qword 0xbbbbbbbb]
+       mov rbx,[a64 rel qword 0xbbbbbbbb]
+       mov al,[a64 rel qword 0xffffffffcccccccc]
+       mov bl,[a64 rel qword 0xffffffffcccccccc]
+       mov ax,[a64 rel qword 0xffffffffcccccccc]
+       mov bx,[a64 rel qword 0xffffffffcccccccc]
+       mov eax,[a64 rel qword 0xffffffffcccccccc]
+       mov ebx,[a64 rel qword 0xffffffffcccccccc]
+       mov rax,[a64 rel qword 0xffffffffcccccccc]
+       mov rbx,[a64 rel qword 0xffffffffcccccccc]
+
+       mov al,[a32 rel foo]
+       mov bl,[a32 rel foo]
+       mov ax,[a32 rel foo]
+       mov bx,[a32 rel foo]
+       mov eax,[a32 rel foo]
+       mov ebx,[a32 rel foo]
+       mov rax,[a32 rel foo]
+       mov rbx,[a32 rel foo]
+       mov al,[a32 rel 0xaaaaaaaaaaaaaaaa]
+       mov bl,[a32 rel 0xaaaaaaaaaaaaaaaa]
+       mov ax,[a32 rel 0xaaaaaaaaaaaaaaaa]
+       mov bx,[a32 rel 0xaaaaaaaaaaaaaaaa]
+       mov eax,[a32 rel 0xaaaaaaaaaaaaaaaa]
+       mov ebx,[a32 rel 0xaaaaaaaaaaaaaaaa]
+       mov rax,[a32 rel 0xaaaaaaaaaaaaaaaa]
+       mov rbx,[a32 rel 0xaaaaaaaaaaaaaaaa]
+       mov al,[a32 rel 0xbbbbbbbb]
+       mov bl,[a32 rel 0xbbbbbbbb]
+       mov ax,[a32 rel 0xbbbbbbbb]
+       mov bx,[a32 rel 0xbbbbbbbb]
+       mov eax,[a32 rel 0xbbbbbbbb]
+       mov ebx,[a32 rel 0xbbbbbbbb]
+       mov rax,[a32 rel 0xbbbbbbbb]
+       mov rbx,[a32 rel 0xbbbbbbbb]
+       mov al,[a32 rel 0xffffffffcccccccc]
+       mov bl,[a32 rel 0xffffffffcccccccc]
+       mov ax,[a32 rel 0xffffffffcccccccc]
+       mov bx,[a32 rel 0xffffffffcccccccc]
+       mov eax,[a32 rel 0xffffffffcccccccc]
+       mov ebx,[a32 rel 0xffffffffcccccccc]
+       mov rax,[a32 rel 0xffffffffcccccccc]
+       mov rbx,[a32 rel 0xffffffffcccccccc]
+
+       mov al,[a32 rel dword foo]
+       mov bl,[a32 rel dword foo]
+       mov ax,[a32 rel dword foo]
+       mov bx,[a32 rel dword foo]
+       mov eax,[a32 rel dword foo]
+       mov ebx,[a32 rel dword foo]
+       mov rax,[a32 rel dword foo]
+       mov rbx,[a32 rel dword foo]
+       mov al,[a32 rel dword 0xaaaaaaaaaaaaaaaa]
+       mov bl,[a32 rel dword 0xaaaaaaaaaaaaaaaa]
+       mov ax,[a32 rel dword 0xaaaaaaaaaaaaaaaa]
+       mov bx,[a32 rel dword 0xaaaaaaaaaaaaaaaa]
+       mov eax,[a32 rel dword 0xaaaaaaaaaaaaaaaa]
+       mov ebx,[a32 rel dword 0xaaaaaaaaaaaaaaaa]
+       mov rax,[a32 rel dword 0xaaaaaaaaaaaaaaaa]
+       mov rbx,[a32 rel dword 0xaaaaaaaaaaaaaaaa]
+       mov al,[a32 rel dword 0xbbbbbbbb]
+       mov bl,[a32 rel dword 0xbbbbbbbb]
+       mov ax,[a32 rel dword 0xbbbbbbbb]
+       mov bx,[a32 rel dword 0xbbbbbbbb]
+       mov eax,[a32 rel dword 0xbbbbbbbb]
+       mov ebx,[a32 rel dword 0xbbbbbbbb]
+       mov rax,[a32 rel dword 0xbbbbbbbb]
+       mov rbx,[a32 rel dword 0xbbbbbbbb]
+       mov al,[a32 rel dword 0xffffffffcccccccc]
+       mov bl,[a32 rel dword 0xffffffffcccccccc]
+       mov ax,[a32 rel dword 0xffffffffcccccccc]
+       mov bx,[a32 rel dword 0xffffffffcccccccc]
+       mov eax,[a32 rel dword 0xffffffffcccccccc]
+       mov ebx,[a32 rel dword 0xffffffffcccccccc]
+       mov rax,[a32 rel dword 0xffffffffcccccccc]
+       mov rbx,[a32 rel dword 0xffffffffcccccccc]
+
+       mov al,[a32 rel qword foo]
+       mov bl,[a32 rel qword foo]
+       mov ax,[a32 rel qword foo]
+       mov bx,[a32 rel qword foo]
+       mov eax,[a32 rel qword foo]
+       mov ebx,[a32 rel qword foo]
+       mov rax,[a32 rel qword foo]
+       mov rbx,[a32 rel qword foo]
+       mov al,[a32 rel qword 0xaaaaaaaaaaaaaaaa]
+       mov bl,[a32 rel qword 0xaaaaaaaaaaaaaaaa]
+       mov ax,[a32 rel qword 0xaaaaaaaaaaaaaaaa]
+       mov bx,[a32 rel qword 0xaaaaaaaaaaaaaaaa]
+       mov eax,[a32 rel qword 0xaaaaaaaaaaaaaaaa]
+       mov ebx,[a32 rel qword 0xaaaaaaaaaaaaaaaa]
+       mov rax,[a32 rel qword 0xaaaaaaaaaaaaaaaa]
+       mov rbx,[a32 rel qword 0xaaaaaaaaaaaaaaaa]
+       mov al,[a32 rel qword 0xbbbbbbbb]
+       mov bl,[a32 rel qword 0xbbbbbbbb]
+       mov ax,[a32 rel qword 0xbbbbbbbb]
+       mov bx,[a32 rel qword 0xbbbbbbbb]
+       mov eax,[a32 rel qword 0xbbbbbbbb]
+       mov ebx,[a32 rel qword 0xbbbbbbbb]
+       mov rax,[a32 rel qword 0xbbbbbbbb]
+       mov rbx,[a32 rel qword 0xbbbbbbbb]
+       mov al,[a32 rel qword 0xffffffffcccccccc]
+       mov bl,[a32 rel qword 0xffffffffcccccccc]
+       mov ax,[a32 rel qword 0xffffffffcccccccc]
+       mov bx,[a32 rel qword 0xffffffffcccccccc]
+       mov eax,[a32 rel qword 0xffffffffcccccccc]
+       mov ebx,[a32 rel qword 0xffffffffcccccccc]
+       mov rax,[a32 rel qword 0xffffffffcccccccc]
+       mov rbx,[a32 rel qword 0xffffffffcccccccc]
+
+       mov al,[fs:foo]
+       mov bl,[fs:foo]
+       mov ax,[fs:foo]
+       mov bx,[fs:foo]
+       mov eax,[fs:foo]
+       mov ebx,[fs:foo]
+       mov rax,[fs:foo]
+       mov rbx,[fs:foo]
+       mov al,[fs:0xaaaaaaaaaaaaaaaa]
+       mov bl,[fs:0xaaaaaaaaaaaaaaaa]
+       mov ax,[fs:0xaaaaaaaaaaaaaaaa]
+       mov bx,[fs:0xaaaaaaaaaaaaaaaa]
+       mov eax,[fs:0xaaaaaaaaaaaaaaaa]
+       mov ebx,[fs:0xaaaaaaaaaaaaaaaa]
+       mov rax,[fs:0xaaaaaaaaaaaaaaaa]
+       mov rbx,[fs:0xaaaaaaaaaaaaaaaa]
+       mov al,[fs:0xbbbbbbbb]
+       mov bl,[fs:0xbbbbbbbb]
+       mov ax,[fs:0xbbbbbbbb]
+       mov bx,[fs:0xbbbbbbbb]
+       mov eax,[fs:0xbbbbbbbb]
+       mov ebx,[fs:0xbbbbbbbb]
+       mov rax,[fs:0xbbbbbbbb]
+       mov rbx,[fs:0xbbbbbbbb]
+       mov al,[fs:0xffffffffcccccccc]
+       mov bl,[fs:0xffffffffcccccccc]
+       mov ax,[fs:0xffffffffcccccccc]
+       mov bx,[fs:0xffffffffcccccccc]
+       mov eax,[fs:0xffffffffcccccccc]
+       mov ebx,[fs:0xffffffffcccccccc]
+       mov rax,[fs:0xffffffffcccccccc]
+       mov rbx,[fs:0xffffffffcccccccc]
+
+       mov al,[dword fs:foo]
+       mov bl,[dword fs:foo]
+       mov ax,[dword fs:foo]
+       mov bx,[dword fs:foo]
+       mov eax,[dword fs:foo]
+       mov ebx,[dword fs:foo]
+       mov rax,[dword fs:foo]
+       mov rbx,[dword fs:foo]
+       mov al,[dword fs:0xaaaaaaaaaaaaaaaa]
+       mov bl,[dword fs:0xaaaaaaaaaaaaaaaa]
+       mov ax,[dword fs:0xaaaaaaaaaaaaaaaa]
+       mov bx,[dword fs:0xaaaaaaaaaaaaaaaa]
+       mov eax,[dword fs:0xaaaaaaaaaaaaaaaa]
+       mov ebx,[dword fs:0xaaaaaaaaaaaaaaaa]
+       mov rax,[dword fs:0xaaaaaaaaaaaaaaaa]
+       mov rbx,[dword fs:0xaaaaaaaaaaaaaaaa]
+       mov al,[dword fs:0xbbbbbbbb]
+       mov bl,[dword fs:0xbbbbbbbb]
+       mov ax,[dword fs:0xbbbbbbbb]
+       mov bx,[dword fs:0xbbbbbbbb]
+       mov eax,[dword fs:0xbbbbbbbb]
+       mov ebx,[dword fs:0xbbbbbbbb]
+       mov rax,[dword fs:0xbbbbbbbb]
+       mov rbx,[dword fs:0xbbbbbbbb]
+       mov al,[dword fs:0xffffffffcccccccc]
+       mov bl,[dword fs:0xffffffffcccccccc]
+       mov ax,[dword fs:0xffffffffcccccccc]
+       mov bx,[dword fs:0xffffffffcccccccc]
+       mov eax,[dword fs:0xffffffffcccccccc]
+       mov ebx,[dword fs:0xffffffffcccccccc]
+       mov rax,[dword fs:0xffffffffcccccccc]
+       mov rbx,[dword fs:0xffffffffcccccccc]
+
+       mov al,[qword fs:foo]
+       mov bl,[qword fs:foo]
+       mov ax,[qword fs:foo]
+       mov bx,[qword fs:foo]
+       mov eax,[qword fs:foo]
+       mov ebx,[qword fs:foo]
+       mov rax,[qword fs:foo]
+       mov rbx,[qword fs:foo]
+       mov al,[qword fs:0xaaaaaaaaaaaaaaaa]
+       mov bl,[qword fs:0xaaaaaaaaaaaaaaaa]
+       mov ax,[qword fs:0xaaaaaaaaaaaaaaaa]
+       mov bx,[qword fs:0xaaaaaaaaaaaaaaaa]
+       mov eax,[qword fs:0xaaaaaaaaaaaaaaaa]
+       mov ebx,[qword fs:0xaaaaaaaaaaaaaaaa]
+       mov rax,[qword fs:0xaaaaaaaaaaaaaaaa]
+       mov rbx,[qword fs:0xaaaaaaaaaaaaaaaa]
+       mov al,[qword fs:0xbbbbbbbb]
+       mov bl,[qword fs:0xbbbbbbbb]
+       mov ax,[qword fs:0xbbbbbbbb]
+       mov bx,[qword fs:0xbbbbbbbb]
+       mov eax,[qword fs:0xbbbbbbbb]
+       mov ebx,[qword fs:0xbbbbbbbb]
+       mov rax,[qword fs:0xbbbbbbbb]
+       mov rbx,[qword fs:0xbbbbbbbb]
+       mov al,[qword fs:0xffffffffcccccccc]
+       mov bl,[qword fs:0xffffffffcccccccc]
+       mov ax,[qword fs:0xffffffffcccccccc]
+       mov bx,[qword fs:0xffffffffcccccccc]
+       mov eax,[qword fs:0xffffffffcccccccc]
+       mov ebx,[qword fs:0xffffffffcccccccc]
+       mov rax,[qword fs:0xffffffffcccccccc]
+       mov rbx,[qword fs:0xffffffffcccccccc]
+
+       mov al,[a64 fs:foo]
+       mov bl,[a64 fs:foo]
+       mov ax,[a64 fs:foo]
+       mov bx,[a64 fs:foo]
+       mov eax,[a64 fs:foo]
+       mov ebx,[a64 fs:foo]
+       mov rax,[a64 fs:foo]
+       mov rbx,[a64 fs:foo]
+       mov al,[a64 fs:0xaaaaaaaaaaaaaaaa]
+       mov bl,[a64 fs:0xaaaaaaaaaaaaaaaa]
+       mov ax,[a64 fs:0xaaaaaaaaaaaaaaaa]
+       mov bx,[a64 fs:0xaaaaaaaaaaaaaaaa]
+       mov eax,[a64 fs:0xaaaaaaaaaaaaaaaa]
+       mov ebx,[a64 fs:0xaaaaaaaaaaaaaaaa]
+       mov rax,[a64 fs:0xaaaaaaaaaaaaaaaa]
+       mov rbx,[a64 fs:0xaaaaaaaaaaaaaaaa]
+       mov al,[a64 fs:0xbbbbbbbb]
+       mov bl,[a64 fs:0xbbbbbbbb]
+       mov ax,[a64 fs:0xbbbbbbbb]
+       mov bx,[a64 fs:0xbbbbbbbb]
+       mov eax,[a64 fs:0xbbbbbbbb]
+       mov ebx,[a64 fs:0xbbbbbbbb]
+       mov rax,[a64 fs:0xbbbbbbbb]
+       mov rbx,[a64 fs:0xbbbbbbbb]
+       mov al,[a64 fs:0xffffffffcccccccc]
+       mov bl,[a64 fs:0xffffffffcccccccc]
+       mov ax,[a64 fs:0xffffffffcccccccc]
+       mov bx,[a64 fs:0xffffffffcccccccc]
+       mov eax,[a64 fs:0xffffffffcccccccc]
+       mov ebx,[a64 fs:0xffffffffcccccccc]
+       mov rax,[a64 fs:0xffffffffcccccccc]
+       mov rbx,[a64 fs:0xffffffffcccccccc]
+
+       mov al,[a64 dword fs:foo]
+       mov bl,[a64 dword fs:foo]
+       mov ax,[a64 dword fs:foo]
+       mov bx,[a64 dword fs:foo]
+       mov eax,[a64 dword fs:foo]
+       mov ebx,[a64 dword fs:foo]
+       mov rax,[a64 dword fs:foo]
+       mov rbx,[a64 dword fs:foo]
+       mov al,[a64 dword fs:0xaaaaaaaaaaaaaaaa]
+       mov bl,[a64 dword fs:0xaaaaaaaaaaaaaaaa]
+       mov ax,[a64 dword fs:0xaaaaaaaaaaaaaaaa]
+       mov bx,[a64 dword fs:0xaaaaaaaaaaaaaaaa]
+       mov eax,[a64 dword fs:0xaaaaaaaaaaaaaaaa]
+       mov ebx,[a64 dword fs:0xaaaaaaaaaaaaaaaa]
+       mov rax,[a64 dword fs:0xaaaaaaaaaaaaaaaa]
+       mov rbx,[a64 dword fs:0xaaaaaaaaaaaaaaaa]
+       mov al,[a64 dword fs:0xbbbbbbbb]
+       mov bl,[a64 dword fs:0xbbbbbbbb]
+       mov ax,[a64 dword fs:0xbbbbbbbb]
+       mov bx,[a64 dword fs:0xbbbbbbbb]
+       mov eax,[a64 dword fs:0xbbbbbbbb]
+       mov ebx,[a64 dword fs:0xbbbbbbbb]
+       mov rax,[a64 dword fs:0xbbbbbbbb]
+       mov rbx,[a64 dword fs:0xbbbbbbbb]
+       mov al,[a64 dword fs:0xffffffffcccccccc]
+       mov bl,[a64 dword fs:0xffffffffcccccccc]
+       mov ax,[a64 dword fs:0xffffffffcccccccc]
+       mov bx,[a64 dword fs:0xffffffffcccccccc]
+       mov eax,[a64 dword fs:0xffffffffcccccccc]
+       mov ebx,[a64 dword fs:0xffffffffcccccccc]
+       mov rax,[a64 dword fs:0xffffffffcccccccc]
+       mov rbx,[a64 dword fs:0xffffffffcccccccc]
+
+       mov al,[a64 qword fs:foo]
+       mov bl,[a64 qword fs:foo]
+       mov ax,[a64 qword fs:foo]
+       mov bx,[a64 qword fs:foo]
+       mov eax,[a64 qword fs:foo]
+       mov ebx,[a64 qword fs:foo]
+       mov rax,[a64 qword fs:foo]
+       mov rbx,[a64 qword fs:foo]
+       mov al,[a64 qword fs:0xaaaaaaaaaaaaaaaa]
+       mov bl,[a64 qword fs:0xaaaaaaaaaaaaaaaa]
+       mov ax,[a64 qword fs:0xaaaaaaaaaaaaaaaa]
+       mov bx,[a64 qword fs:0xaaaaaaaaaaaaaaaa]
+       mov eax,[a64 qword fs:0xaaaaaaaaaaaaaaaa]
+       mov ebx,[a64 qword fs:0xaaaaaaaaaaaaaaaa]
+       mov rax,[a64 qword fs:0xaaaaaaaaaaaaaaaa]
+       mov rbx,[a64 qword fs:0xaaaaaaaaaaaaaaaa]
+       mov al,[a64 qword fs:0xbbbbbbbb]
+       mov bl,[a64 qword fs:0xbbbbbbbb]
+       mov ax,[a64 qword fs:0xbbbbbbbb]
+       mov bx,[a64 qword fs:0xbbbbbbbb]
+       mov eax,[a64 qword fs:0xbbbbbbbb]
+       mov ebx,[a64 qword fs:0xbbbbbbbb]
+       mov rax,[a64 qword fs:0xbbbbbbbb]
+       mov rbx,[a64 qword fs:0xbbbbbbbb]
+       mov al,[a64 qword fs:0xffffffffcccccccc]
+       mov bl,[a64 qword fs:0xffffffffcccccccc]
+       mov ax,[a64 qword fs:0xffffffffcccccccc]
+       mov bx,[a64 qword fs:0xffffffffcccccccc]
+       mov eax,[a64 qword fs:0xffffffffcccccccc]
+       mov ebx,[a64 qword fs:0xffffffffcccccccc]
+       mov rax,[a64 qword fs:0xffffffffcccccccc]
+       mov rbx,[a64 qword fs:0xffffffffcccccccc]
+
+       mov al,[a32 fs:foo]
+       mov bl,[a32 fs:foo]
+       mov ax,[a32 fs:foo]
+       mov bx,[a32 fs:foo]
+       mov eax,[a32 fs:foo]
+       mov ebx,[a32 fs:foo]
+       mov rax,[a32 fs:foo]
+       mov rbx,[a32 fs:foo]
+       mov al,[a32 fs:0xaaaaaaaaaaaaaaaa]
+       mov bl,[a32 fs:0xaaaaaaaaaaaaaaaa]
+       mov ax,[a32 fs:0xaaaaaaaaaaaaaaaa]
+       mov bx,[a32 fs:0xaaaaaaaaaaaaaaaa]
+       mov eax,[a32 fs:0xaaaaaaaaaaaaaaaa]
+       mov ebx,[a32 fs:0xaaaaaaaaaaaaaaaa]
+       mov rax,[a32 fs:0xaaaaaaaaaaaaaaaa]
+       mov rbx,[a32 fs:0xaaaaaaaaaaaaaaaa]
+       mov al,[a32 fs:0xbbbbbbbb]
+       mov bl,[a32 fs:0xbbbbbbbb]
+       mov ax,[a32 fs:0xbbbbbbbb]
+       mov bx,[a32 fs:0xbbbbbbbb]
+       mov eax,[a32 fs:0xbbbbbbbb]
+       mov ebx,[a32 fs:0xbbbbbbbb]
+       mov rax,[a32 fs:0xbbbbbbbb]
+       mov rbx,[a32 fs:0xbbbbbbbb]
+       mov al,[a32 fs:0xffffffffcccccccc]
+       mov bl,[a32 fs:0xffffffffcccccccc]
+       mov ax,[a32 fs:0xffffffffcccccccc]
+       mov bx,[a32 fs:0xffffffffcccccccc]
+       mov eax,[a32 fs:0xffffffffcccccccc]
+       mov ebx,[a32 fs:0xffffffffcccccccc]
+       mov rax,[a32 fs:0xffffffffcccccccc]
+       mov rbx,[a32 fs:0xffffffffcccccccc]
+
+       mov al,[a32 dword fs:foo]
+       mov bl,[a32 dword fs:foo]
+       mov ax,[a32 dword fs:foo]
+       mov bx,[a32 dword fs:foo]
+       mov eax,[a32 dword fs:foo]
+       mov ebx,[a32 dword fs:foo]
+       mov rax,[a32 dword fs:foo]
+       mov rbx,[a32 dword fs:foo]
+       mov al,[a32 dword fs:0xaaaaaaaaaaaaaaaa]
+       mov bl,[a32 dword fs:0xaaaaaaaaaaaaaaaa]
+       mov ax,[a32 dword fs:0xaaaaaaaaaaaaaaaa]
+       mov bx,[a32 dword fs:0xaaaaaaaaaaaaaaaa]
+       mov eax,[a32 dword fs:0xaaaaaaaaaaaaaaaa]
+       mov ebx,[a32 dword fs:0xaaaaaaaaaaaaaaaa]
+       mov rax,[a32 dword fs:0xaaaaaaaaaaaaaaaa]
+       mov rbx,[a32 dword fs:0xaaaaaaaaaaaaaaaa]
+       mov al,[a32 dword fs:0xbbbbbbbb]
+       mov bl,[a32 dword fs:0xbbbbbbbb]
+       mov ax,[a32 dword fs:0xbbbbbbbb]
+       mov bx,[a32 dword fs:0xbbbbbbbb]
+       mov eax,[a32 dword fs:0xbbbbbbbb]
+       mov ebx,[a32 dword fs:0xbbbbbbbb]
+       mov rax,[a32 dword fs:0xbbbbbbbb]
+       mov rbx,[a32 dword fs:0xbbbbbbbb]
+       mov al,[a32 dword fs:0xffffffffcccccccc]
+       mov bl,[a32 dword fs:0xffffffffcccccccc]
+       mov ax,[a32 dword fs:0xffffffffcccccccc]
+       mov bx,[a32 dword fs:0xffffffffcccccccc]
+       mov eax,[a32 dword fs:0xffffffffcccccccc]
+       mov ebx,[a32 dword fs:0xffffffffcccccccc]
+       mov rax,[a32 dword fs:0xffffffffcccccccc]
+       mov rbx,[a32 dword fs:0xffffffffcccccccc]
+
+       mov al,[a32 qword fs:foo]
+       mov bl,[a32 qword fs:foo]
+       mov ax,[a32 qword fs:foo]
+       mov bx,[a32 qword fs:foo]
+       mov eax,[a32 qword fs:foo]
+       mov ebx,[a32 qword fs:foo]
+       mov rax,[a32 qword fs:foo]
+       mov rbx,[a32 qword fs:foo]
+       mov al,[a32 qword fs:0xaaaaaaaaaaaaaaaa]
+       mov bl,[a32 qword fs:0xaaaaaaaaaaaaaaaa]
+       mov ax,[a32 qword fs:0xaaaaaaaaaaaaaaaa]
+       mov bx,[a32 qword fs:0xaaaaaaaaaaaaaaaa]
+       mov eax,[a32 qword fs:0xaaaaaaaaaaaaaaaa]
+       mov ebx,[a32 qword fs:0xaaaaaaaaaaaaaaaa]
+       mov rax,[a32 qword fs:0xaaaaaaaaaaaaaaaa]
+       mov rbx,[a32 qword fs:0xaaaaaaaaaaaaaaaa]
+       mov al,[a32 qword fs:0xbbbbbbbb]
+       mov bl,[a32 qword fs:0xbbbbbbbb]
+       mov ax,[a32 qword fs:0xbbbbbbbb]
+       mov bx,[a32 qword fs:0xbbbbbbbb]
+       mov eax,[a32 qword fs:0xbbbbbbbb]
+       mov ebx,[a32 qword fs:0xbbbbbbbb]
+       mov rax,[a32 qword fs:0xbbbbbbbb]
+       mov rbx,[a32 qword fs:0xbbbbbbbb]
+       mov al,[a32 qword fs:0xffffffffcccccccc]
+       mov bl,[a32 qword fs:0xffffffffcccccccc]
+       mov ax,[a32 qword fs:0xffffffffcccccccc]
+       mov bx,[a32 qword fs:0xffffffffcccccccc]
+       mov eax,[a32 qword fs:0xffffffffcccccccc]
+       mov ebx,[a32 qword fs:0xffffffffcccccccc]
+       mov rax,[a32 qword fs:0xffffffffcccccccc]
+       mov rbx,[a32 qword fs:0xffffffffcccccccc]
+
+       mov al,[abs fs:foo]
+       mov bl,[abs fs:foo]
+       mov ax,[abs fs:foo]
+       mov bx,[abs fs:foo]
+       mov eax,[abs fs:foo]
+       mov ebx,[abs fs:foo]
+       mov rax,[abs fs:foo]
+       mov rbx,[abs fs:foo]
+       mov al,[abs fs:0xaaaaaaaaaaaaaaaa]
+       mov bl,[abs fs:0xaaaaaaaaaaaaaaaa]
+       mov ax,[abs fs:0xaaaaaaaaaaaaaaaa]
+       mov bx,[abs fs:0xaaaaaaaaaaaaaaaa]
+       mov eax,[abs fs:0xaaaaaaaaaaaaaaaa]
+       mov ebx,[abs fs:0xaaaaaaaaaaaaaaaa]
+       mov rax,[abs fs:0xaaaaaaaaaaaaaaaa]
+       mov rbx,[abs fs:0xaaaaaaaaaaaaaaaa]
+       mov al,[abs fs:0xbbbbbbbb]
+       mov bl,[abs fs:0xbbbbbbbb]
+       mov ax,[abs fs:0xbbbbbbbb]
+       mov bx,[abs fs:0xbbbbbbbb]
+       mov eax,[abs fs:0xbbbbbbbb]
+       mov ebx,[abs fs:0xbbbbbbbb]
+       mov rax,[abs fs:0xbbbbbbbb]
+       mov rbx,[abs fs:0xbbbbbbbb]
+       mov al,[abs fs:0xffffffffcccccccc]
+       mov bl,[abs fs:0xffffffffcccccccc]
+       mov ax,[abs fs:0xffffffffcccccccc]
+       mov bx,[abs fs:0xffffffffcccccccc]
+       mov eax,[abs fs:0xffffffffcccccccc]
+       mov ebx,[abs fs:0xffffffffcccccccc]
+       mov rax,[abs fs:0xffffffffcccccccc]
+       mov rbx,[abs fs:0xffffffffcccccccc]
+
+       mov al,[abs dword fs:foo]
+       mov bl,[abs dword fs:foo]
+       mov ax,[abs dword fs:foo]
+       mov bx,[abs dword fs:foo]
+       mov eax,[abs dword fs:foo]
+       mov ebx,[abs dword fs:foo]
+       mov rax,[abs dword fs:foo]
+       mov rbx,[abs dword fs:foo]
+       mov al,[abs dword fs:0xaaaaaaaaaaaaaaaa]
+       mov bl,[abs dword fs:0xaaaaaaaaaaaaaaaa]
+       mov ax,[abs dword fs:0xaaaaaaaaaaaaaaaa]
+       mov bx,[abs dword fs:0xaaaaaaaaaaaaaaaa]
+       mov eax,[abs dword fs:0xaaaaaaaaaaaaaaaa]
+       mov ebx,[abs dword fs:0xaaaaaaaaaaaaaaaa]
+       mov rax,[abs dword fs:0xaaaaaaaaaaaaaaaa]
+       mov rbx,[abs dword fs:0xaaaaaaaaaaaaaaaa]
+       mov al,[abs dword fs:0xbbbbbbbb]
+       mov bl,[abs dword fs:0xbbbbbbbb]
+       mov ax,[abs dword fs:0xbbbbbbbb]
+       mov bx,[abs dword fs:0xbbbbbbbb]
+       mov eax,[abs dword fs:0xbbbbbbbb]
+       mov ebx,[abs dword fs:0xbbbbbbbb]
+       mov rax,[abs dword fs:0xbbbbbbbb]
+       mov rbx,[abs dword fs:0xbbbbbbbb]
+       mov al,[abs dword fs:0xffffffffcccccccc]
+       mov bl,[abs dword fs:0xffffffffcccccccc]
+       mov ax,[abs dword fs:0xffffffffcccccccc]
+       mov bx,[abs dword fs:0xffffffffcccccccc]
+       mov eax,[abs dword fs:0xffffffffcccccccc]
+       mov ebx,[abs dword fs:0xffffffffcccccccc]
+       mov rax,[abs dword fs:0xffffffffcccccccc]
+       mov rbx,[abs dword fs:0xffffffffcccccccc]
+
+       mov al,[abs qword fs:foo]
+       mov bl,[abs qword fs:foo]
+       mov ax,[abs qword fs:foo]
+       mov bx,[abs qword fs:foo]
+       mov eax,[abs qword fs:foo]
+       mov ebx,[abs qword fs:foo]
+       mov rax,[abs qword fs:foo]
+       mov rbx,[abs qword fs:foo]
+       mov al,[abs qword fs:0xaaaaaaaaaaaaaaaa]
+       mov bl,[abs qword fs:0xaaaaaaaaaaaaaaaa]
+       mov ax,[abs qword fs:0xaaaaaaaaaaaaaaaa]
+       mov bx,[abs qword fs:0xaaaaaaaaaaaaaaaa]
+       mov eax,[abs qword fs:0xaaaaaaaaaaaaaaaa]
+       mov ebx,[abs qword fs:0xaaaaaaaaaaaaaaaa]
+       mov rax,[abs qword fs:0xaaaaaaaaaaaaaaaa]
+       mov rbx,[abs qword fs:0xaaaaaaaaaaaaaaaa]
+       mov al,[abs qword fs:0xbbbbbbbb]
+       mov bl,[abs qword fs:0xbbbbbbbb]
+       mov ax,[abs qword fs:0xbbbbbbbb]
+       mov bx,[abs qword fs:0xbbbbbbbb]
+       mov eax,[abs qword fs:0xbbbbbbbb]
+       mov ebx,[abs qword fs:0xbbbbbbbb]
+       mov rax,[abs qword fs:0xbbbbbbbb]
+       mov rbx,[abs qword fs:0xbbbbbbbb]
+       mov al,[abs qword fs:0xffffffffcccccccc]
+       mov bl,[abs qword fs:0xffffffffcccccccc]
+       mov ax,[abs qword fs:0xffffffffcccccccc]
+       mov bx,[abs qword fs:0xffffffffcccccccc]
+       mov eax,[abs qword fs:0xffffffffcccccccc]
+       mov ebx,[abs qword fs:0xffffffffcccccccc]
+       mov rax,[abs qword fs:0xffffffffcccccccc]
+       mov rbx,[abs qword fs:0xffffffffcccccccc]
+
+       mov al,[a64 abs fs:foo]
+       mov bl,[a64 abs fs:foo]
+       mov ax,[a64 abs fs:foo]
+       mov bx,[a64 abs fs:foo]
+       mov eax,[a64 abs fs:foo]
+       mov ebx,[a64 abs fs:foo]
+       mov rax,[a64 abs fs:foo]
+       mov rbx,[a64 abs fs:foo]
+       mov al,[a64 abs fs:0xaaaaaaaaaaaaaaaa]
+       mov bl,[a64 abs fs:0xaaaaaaaaaaaaaaaa]
+       mov ax,[a64 abs fs:0xaaaaaaaaaaaaaaaa]
+       mov bx,[a64 abs fs:0xaaaaaaaaaaaaaaaa]
+       mov eax,[a64 abs fs:0xaaaaaaaaaaaaaaaa]
+       mov ebx,[a64 abs fs:0xaaaaaaaaaaaaaaaa]
+       mov rax,[a64 abs fs:0xaaaaaaaaaaaaaaaa]
+       mov rbx,[a64 abs fs:0xaaaaaaaaaaaaaaaa]
+       mov al,[a64 abs fs:0xbbbbbbbb]
+       mov bl,[a64 abs fs:0xbbbbbbbb]
+       mov ax,[a64 abs fs:0xbbbbbbbb]
+       mov bx,[a64 abs fs:0xbbbbbbbb]
+       mov eax,[a64 abs fs:0xbbbbbbbb]
+       mov ebx,[a64 abs fs:0xbbbbbbbb]
+       mov rax,[a64 abs fs:0xbbbbbbbb]
+       mov rbx,[a64 abs fs:0xbbbbbbbb]
+       mov al,[a64 abs fs:0xffffffffcccccccc]
+       mov bl,[a64 abs fs:0xffffffffcccccccc]
+       mov ax,[a64 abs fs:0xffffffffcccccccc]
+       mov bx,[a64 abs fs:0xffffffffcccccccc]
+       mov eax,[a64 abs fs:0xffffffffcccccccc]
+       mov ebx,[a64 abs fs:0xffffffffcccccccc]
+       mov rax,[a64 abs fs:0xffffffffcccccccc]
+       mov rbx,[a64 abs fs:0xffffffffcccccccc]
+
+       mov al,[a64 abs dword fs:foo]
+       mov bl,[a64 abs dword fs:foo]
+       mov ax,[a64 abs dword fs:foo]
+       mov bx,[a64 abs dword fs:foo]
+       mov eax,[a64 abs dword fs:foo]
+       mov ebx,[a64 abs dword fs:foo]
+       mov rax,[a64 abs dword fs:foo]
+       mov rbx,[a64 abs dword fs:foo]
+       mov al,[a64 abs dword fs:0xaaaaaaaaaaaaaaaa]
+       mov bl,[a64 abs dword fs:0xaaaaaaaaaaaaaaaa]
+       mov ax,[a64 abs dword fs:0xaaaaaaaaaaaaaaaa]
+       mov bx,[a64 abs dword fs:0xaaaaaaaaaaaaaaaa]
+       mov eax,[a64 abs dword fs:0xaaaaaaaaaaaaaaaa]
+       mov ebx,[a64 abs dword fs:0xaaaaaaaaaaaaaaaa]
+       mov rax,[a64 abs dword fs:0xaaaaaaaaaaaaaaaa]
+       mov rbx,[a64 abs dword fs:0xaaaaaaaaaaaaaaaa]
+       mov al,[a64 abs dword fs:0xbbbbbbbb]
+       mov bl,[a64 abs dword fs:0xbbbbbbbb]
+       mov ax,[a64 abs dword fs:0xbbbbbbbb]
+       mov bx,[a64 abs dword fs:0xbbbbbbbb]
+       mov eax,[a64 abs dword fs:0xbbbbbbbb]
+       mov ebx,[a64 abs dword fs:0xbbbbbbbb]
+       mov rax,[a64 abs dword fs:0xbbbbbbbb]
+       mov rbx,[a64 abs dword fs:0xbbbbbbbb]
+       mov al,[a64 abs dword fs:0xffffffffcccccccc]
+       mov bl,[a64 abs dword fs:0xffffffffcccccccc]
+       mov ax,[a64 abs dword fs:0xffffffffcccccccc]
+       mov bx,[a64 abs dword fs:0xffffffffcccccccc]
+       mov eax,[a64 abs dword fs:0xffffffffcccccccc]
+       mov ebx,[a64 abs dword fs:0xffffffffcccccccc]
+       mov rax,[a64 abs dword fs:0xffffffffcccccccc]
+       mov rbx,[a64 abs dword fs:0xffffffffcccccccc]
+
+       mov al,[a64 abs qword fs:foo]
+       mov bl,[a64 abs qword fs:foo]
+       mov ax,[a64 abs qword fs:foo]
+       mov bx,[a64 abs qword fs:foo]
+       mov eax,[a64 abs qword fs:foo]
+       mov ebx,[a64 abs qword fs:foo]
+       mov rax,[a64 abs qword fs:foo]
+       mov rbx,[a64 abs qword fs:foo]
+       mov al,[a64 abs qword fs:0xaaaaaaaaaaaaaaaa]
+       mov bl,[a64 abs qword fs:0xaaaaaaaaaaaaaaaa]
+       mov ax,[a64 abs qword fs:0xaaaaaaaaaaaaaaaa]
+       mov bx,[a64 abs qword fs:0xaaaaaaaaaaaaaaaa]
+       mov eax,[a64 abs qword fs:0xaaaaaaaaaaaaaaaa]
+       mov ebx,[a64 abs qword fs:0xaaaaaaaaaaaaaaaa]
+       mov rax,[a64 abs qword fs:0xaaaaaaaaaaaaaaaa]
+       mov rbx,[a64 abs qword fs:0xaaaaaaaaaaaaaaaa]
+       mov al,[a64 abs qword fs:0xbbbbbbbb]
+       mov bl,[a64 abs qword fs:0xbbbbbbbb]
+       mov ax,[a64 abs qword fs:0xbbbbbbbb]
+       mov bx,[a64 abs qword fs:0xbbbbbbbb]
+       mov eax,[a64 abs qword fs:0xbbbbbbbb]
+       mov ebx,[a64 abs qword fs:0xbbbbbbbb]
+       mov rax,[a64 abs qword fs:0xbbbbbbbb]
+       mov rbx,[a64 abs qword fs:0xbbbbbbbb]
+       mov al,[a64 abs qword fs:0xffffffffcccccccc]
+       mov bl,[a64 abs qword fs:0xffffffffcccccccc]
+       mov ax,[a64 abs qword fs:0xffffffffcccccccc]
+       mov bx,[a64 abs qword fs:0xffffffffcccccccc]
+       mov eax,[a64 abs qword fs:0xffffffffcccccccc]
+       mov ebx,[a64 abs qword fs:0xffffffffcccccccc]
+       mov rax,[a64 abs qword fs:0xffffffffcccccccc]
+       mov rbx,[a64 abs qword fs:0xffffffffcccccccc]
+
+       mov al,[a32 abs fs:foo]
+       mov bl,[a32 abs fs:foo]
+       mov ax,[a32 abs fs:foo]
+       mov bx,[a32 abs fs:foo]
+       mov eax,[a32 abs fs:foo]
+       mov ebx,[a32 abs fs:foo]
+       mov rax,[a32 abs fs:foo]
+       mov rbx,[a32 abs fs:foo]
+       mov al,[a32 abs fs:0xaaaaaaaaaaaaaaaa]
+       mov bl,[a32 abs fs:0xaaaaaaaaaaaaaaaa]
+       mov ax,[a32 abs fs:0xaaaaaaaaaaaaaaaa]
+       mov bx,[a32 abs fs:0xaaaaaaaaaaaaaaaa]
+       mov eax,[a32 abs fs:0xaaaaaaaaaaaaaaaa]
+       mov ebx,[a32 abs fs:0xaaaaaaaaaaaaaaaa]
+       mov rax,[a32 abs fs:0xaaaaaaaaaaaaaaaa]
+       mov rbx,[a32 abs fs:0xaaaaaaaaaaaaaaaa]
+       mov al,[a32 abs fs:0xbbbbbbbb]
+       mov bl,[a32 abs fs:0xbbbbbbbb]
+       mov ax,[a32 abs fs:0xbbbbbbbb]
+       mov bx,[a32 abs fs:0xbbbbbbbb]
+       mov eax,[a32 abs fs:0xbbbbbbbb]
+       mov ebx,[a32 abs fs:0xbbbbbbbb]
+       mov rax,[a32 abs fs:0xbbbbbbbb]
+       mov rbx,[a32 abs fs:0xbbbbbbbb]
+       mov al,[a32 abs fs:0xffffffffcccccccc]
+       mov bl,[a32 abs fs:0xffffffffcccccccc]
+       mov ax,[a32 abs fs:0xffffffffcccccccc]
+       mov bx,[a32 abs fs:0xffffffffcccccccc]
+       mov eax,[a32 abs fs:0xffffffffcccccccc]
+       mov ebx,[a32 abs fs:0xffffffffcccccccc]
+       mov rax,[a32 abs fs:0xffffffffcccccccc]
+       mov rbx,[a32 abs fs:0xffffffffcccccccc]
+
+       mov al,[a32 abs dword fs:foo]
+       mov bl,[a32 abs dword fs:foo]
+       mov ax,[a32 abs dword fs:foo]
+       mov bx,[a32 abs dword fs:foo]
+       mov eax,[a32 abs dword fs:foo]
+       mov ebx,[a32 abs dword fs:foo]
+       mov rax,[a32 abs dword fs:foo]
+       mov rbx,[a32 abs dword fs:foo]
+       mov al,[a32 abs dword fs:0xaaaaaaaaaaaaaaaa]
+       mov bl,[a32 abs dword fs:0xaaaaaaaaaaaaaaaa]
+       mov ax,[a32 abs dword fs:0xaaaaaaaaaaaaaaaa]
+       mov bx,[a32 abs dword fs:0xaaaaaaaaaaaaaaaa]
+       mov eax,[a32 abs dword fs:0xaaaaaaaaaaaaaaaa]
+       mov ebx,[a32 abs dword fs:0xaaaaaaaaaaaaaaaa]
+       mov rax,[a32 abs dword fs:0xaaaaaaaaaaaaaaaa]
+       mov rbx,[a32 abs dword fs:0xaaaaaaaaaaaaaaaa]
+       mov al,[a32 abs dword fs:0xbbbbbbbb]
+       mov bl,[a32 abs dword fs:0xbbbbbbbb]
+       mov ax,[a32 abs dword fs:0xbbbbbbbb]
+       mov bx,[a32 abs dword fs:0xbbbbbbbb]
+       mov eax,[a32 abs dword fs:0xbbbbbbbb]
+       mov ebx,[a32 abs dword fs:0xbbbbbbbb]
+       mov rax,[a32 abs dword fs:0xbbbbbbbb]
+       mov rbx,[a32 abs dword fs:0xbbbbbbbb]
+       mov al,[a32 abs dword fs:0xffffffffcccccccc]
+       mov bl,[a32 abs dword fs:0xffffffffcccccccc]
+       mov ax,[a32 abs dword fs:0xffffffffcccccccc]
+       mov bx,[a32 abs dword fs:0xffffffffcccccccc]
+       mov eax,[a32 abs dword fs:0xffffffffcccccccc]
+       mov ebx,[a32 abs dword fs:0xffffffffcccccccc]
+       mov rax,[a32 abs dword fs:0xffffffffcccccccc]
+       mov rbx,[a32 abs dword fs:0xffffffffcccccccc]
+
+       mov al,[a32 abs qword fs:foo]
+       mov bl,[a32 abs qword fs:foo]
+       mov ax,[a32 abs qword fs:foo]
+       mov bx,[a32 abs qword fs:foo]
+       mov eax,[a32 abs qword fs:foo]
+       mov ebx,[a32 abs qword fs:foo]
+       mov rax,[a32 abs qword fs:foo]
+       mov rbx,[a32 abs qword fs:foo]
+       mov al,[a32 abs qword fs:0xaaaaaaaaaaaaaaaa]
+       mov bl,[a32 abs qword fs:0xaaaaaaaaaaaaaaaa]
+       mov ax,[a32 abs qword fs:0xaaaaaaaaaaaaaaaa]
+       mov bx,[a32 abs qword fs:0xaaaaaaaaaaaaaaaa]
+       mov eax,[a32 abs qword fs:0xaaaaaaaaaaaaaaaa]
+       mov ebx,[a32 abs qword fs:0xaaaaaaaaaaaaaaaa]
+       mov rax,[a32 abs qword fs:0xaaaaaaaaaaaaaaaa]
+       mov rbx,[a32 abs qword fs:0xaaaaaaaaaaaaaaaa]
+       mov al,[a32 abs qword fs:0xbbbbbbbb]
+       mov bl,[a32 abs qword fs:0xbbbbbbbb]
+       mov ax,[a32 abs qword fs:0xbbbbbbbb]
+       mov bx,[a32 abs qword fs:0xbbbbbbbb]
+       mov eax,[a32 abs qword fs:0xbbbbbbbb]
+       mov ebx,[a32 abs qword fs:0xbbbbbbbb]
+       mov rax,[a32 abs qword fs:0xbbbbbbbb]
+       mov rbx,[a32 abs qword fs:0xbbbbbbbb]
+       mov al,[a32 abs qword fs:0xffffffffcccccccc]
+       mov bl,[a32 abs qword fs:0xffffffffcccccccc]
+       mov ax,[a32 abs qword fs:0xffffffffcccccccc]
+       mov bx,[a32 abs qword fs:0xffffffffcccccccc]
+       mov eax,[a32 abs qword fs:0xffffffffcccccccc]
+       mov ebx,[a32 abs qword fs:0xffffffffcccccccc]
+       mov rax,[a32 abs qword fs:0xffffffffcccccccc]
+       mov rbx,[a32 abs qword fs:0xffffffffcccccccc]
+
+       mov al,[rel fs:foo]
+       mov bl,[rel fs:foo]
+       mov ax,[rel fs:foo]
+       mov bx,[rel fs:foo]
+       mov eax,[rel fs:foo]
+       mov ebx,[rel fs:foo]
+       mov rax,[rel fs:foo]
+       mov rbx,[rel fs:foo]
+       mov al,[rel fs:0xaaaaaaaaaaaaaaaa]
+       mov bl,[rel fs:0xaaaaaaaaaaaaaaaa]
+       mov ax,[rel fs:0xaaaaaaaaaaaaaaaa]
+       mov bx,[rel fs:0xaaaaaaaaaaaaaaaa]
+       mov eax,[rel fs:0xaaaaaaaaaaaaaaaa]
+       mov ebx,[rel fs:0xaaaaaaaaaaaaaaaa]
+       mov rax,[rel fs:0xaaaaaaaaaaaaaaaa]
+       mov rbx,[rel fs:0xaaaaaaaaaaaaaaaa]
+       mov al,[rel fs:0xbbbbbbbb]
+       mov bl,[rel fs:0xbbbbbbbb]
+       mov ax,[rel fs:0xbbbbbbbb]
+       mov bx,[rel fs:0xbbbbbbbb]
+       mov eax,[rel fs:0xbbbbbbbb]
+       mov ebx,[rel fs:0xbbbbbbbb]
+       mov rax,[rel fs:0xbbbbbbbb]
+       mov rbx,[rel fs:0xbbbbbbbb]
+       mov al,[rel fs:0xffffffffcccccccc]
+       mov bl,[rel fs:0xffffffffcccccccc]
+       mov ax,[rel fs:0xffffffffcccccccc]
+       mov bx,[rel fs:0xffffffffcccccccc]
+       mov eax,[rel fs:0xffffffffcccccccc]
+       mov ebx,[rel fs:0xffffffffcccccccc]
+       mov rax,[rel fs:0xffffffffcccccccc]
+       mov rbx,[rel fs:0xffffffffcccccccc]
+
+       mov al,[rel dword fs:foo]
+       mov bl,[rel dword fs:foo]
+       mov ax,[rel dword fs:foo]
+       mov bx,[rel dword fs:foo]
+       mov eax,[rel dword fs:foo]
+       mov ebx,[rel dword fs:foo]
+       mov rax,[rel dword fs:foo]
+       mov rbx,[rel dword fs:foo]
+       mov al,[rel dword fs:0xaaaaaaaaaaaaaaaa]
+       mov bl,[rel dword fs:0xaaaaaaaaaaaaaaaa]
+       mov ax,[rel dword fs:0xaaaaaaaaaaaaaaaa]
+       mov bx,[rel dword fs:0xaaaaaaaaaaaaaaaa]
+       mov eax,[rel dword fs:0xaaaaaaaaaaaaaaaa]
+       mov ebx,[rel dword fs:0xaaaaaaaaaaaaaaaa]
+       mov rax,[rel dword fs:0xaaaaaaaaaaaaaaaa]
+       mov rbx,[rel dword fs:0xaaaaaaaaaaaaaaaa]
+       mov al,[rel dword fs:0xbbbbbbbb]
+       mov bl,[rel dword fs:0xbbbbbbbb]
+       mov ax,[rel dword fs:0xbbbbbbbb]
+       mov bx,[rel dword fs:0xbbbbbbbb]
+       mov eax,[rel dword fs:0xbbbbbbbb]
+       mov ebx,[rel dword fs:0xbbbbbbbb]
+       mov rax,[rel dword fs:0xbbbbbbbb]
+       mov rbx,[rel dword fs:0xbbbbbbbb]
+       mov al,[rel dword fs:0xffffffffcccccccc]
+       mov bl,[rel dword fs:0xffffffffcccccccc]
+       mov ax,[rel dword fs:0xffffffffcccccccc]
+       mov bx,[rel dword fs:0xffffffffcccccccc]
+       mov eax,[rel dword fs:0xffffffffcccccccc]
+       mov ebx,[rel dword fs:0xffffffffcccccccc]
+       mov rax,[rel dword fs:0xffffffffcccccccc]
+       mov rbx,[rel dword fs:0xffffffffcccccccc]
+
+       mov al,[rel qword fs:foo]
+       mov bl,[rel qword fs:foo]
+       mov ax,[rel qword fs:foo]
+       mov bx,[rel qword fs:foo]
+       mov eax,[rel qword fs:foo]
+       mov ebx,[rel qword fs:foo]
+       mov rax,[rel qword fs:foo]
+       mov rbx,[rel qword fs:foo]
+       mov al,[rel qword fs:0xaaaaaaaaaaaaaaaa]
+       mov bl,[rel qword fs:0xaaaaaaaaaaaaaaaa]
+       mov ax,[rel qword fs:0xaaaaaaaaaaaaaaaa]
+       mov bx,[rel qword fs:0xaaaaaaaaaaaaaaaa]
+       mov eax,[rel qword fs:0xaaaaaaaaaaaaaaaa]
+       mov ebx,[rel qword fs:0xaaaaaaaaaaaaaaaa]
+       mov rax,[rel qword fs:0xaaaaaaaaaaaaaaaa]
+       mov rbx,[rel qword fs:0xaaaaaaaaaaaaaaaa]
+       mov al,[rel qword fs:0xbbbbbbbb]
+       mov bl,[rel qword fs:0xbbbbbbbb]
+       mov ax,[rel qword fs:0xbbbbbbbb]
+       mov bx,[rel qword fs:0xbbbbbbbb]
+       mov eax,[rel qword fs:0xbbbbbbbb]
+       mov ebx,[rel qword fs:0xbbbbbbbb]
+       mov rax,[rel qword fs:0xbbbbbbbb]
+       mov rbx,[rel qword fs:0xbbbbbbbb]
+       mov al,[rel qword fs:0xffffffffcccccccc]
+       mov bl,[rel qword fs:0xffffffffcccccccc]
+       mov ax,[rel qword fs:0xffffffffcccccccc]
+       mov bx,[rel qword fs:0xffffffffcccccccc]
+       mov eax,[rel qword fs:0xffffffffcccccccc]
+       mov ebx,[rel qword fs:0xffffffffcccccccc]
+       mov rax,[rel qword fs:0xffffffffcccccccc]
+       mov rbx,[rel qword fs:0xffffffffcccccccc]
+
+       mov al,[a64 rel fs:foo]
+       mov bl,[a64 rel fs:foo]
+       mov ax,[a64 rel fs:foo]
+       mov bx,[a64 rel fs:foo]
+       mov eax,[a64 rel fs:foo]
+       mov ebx,[a64 rel fs:foo]
+       mov rax,[a64 rel fs:foo]
+       mov rbx,[a64 rel fs:foo]
+       mov al,[a64 rel fs:0xaaaaaaaaaaaaaaaa]
+       mov bl,[a64 rel fs:0xaaaaaaaaaaaaaaaa]
+       mov ax,[a64 rel fs:0xaaaaaaaaaaaaaaaa]
+       mov bx,[a64 rel fs:0xaaaaaaaaaaaaaaaa]
+       mov eax,[a64 rel fs:0xaaaaaaaaaaaaaaaa]
+       mov ebx,[a64 rel fs:0xaaaaaaaaaaaaaaaa]
+       mov rax,[a64 rel fs:0xaaaaaaaaaaaaaaaa]
+       mov rbx,[a64 rel fs:0xaaaaaaaaaaaaaaaa]
+       mov al,[a64 rel fs:0xbbbbbbbb]
+       mov bl,[a64 rel fs:0xbbbbbbbb]
+       mov ax,[a64 rel fs:0xbbbbbbbb]
+       mov bx,[a64 rel fs:0xbbbbbbbb]
+       mov eax,[a64 rel fs:0xbbbbbbbb]
+       mov ebx,[a64 rel fs:0xbbbbbbbb]
+       mov rax,[a64 rel fs:0xbbbbbbbb]
+       mov rbx,[a64 rel fs:0xbbbbbbbb]
+       mov al,[a64 rel fs:0xffffffffcccccccc]
+       mov bl,[a64 rel fs:0xffffffffcccccccc]
+       mov ax,[a64 rel fs:0xffffffffcccccccc]
+       mov bx,[a64 rel fs:0xffffffffcccccccc]
+       mov eax,[a64 rel fs:0xffffffffcccccccc]
+       mov ebx,[a64 rel fs:0xffffffffcccccccc]
+       mov rax,[a64 rel fs:0xffffffffcccccccc]
+       mov rbx,[a64 rel fs:0xffffffffcccccccc]
+
+       mov al,[a64 rel dword fs:foo]
+       mov bl,[a64 rel dword fs:foo]
+       mov ax,[a64 rel dword fs:foo]
+       mov bx,[a64 rel dword fs:foo]
+       mov eax,[a64 rel dword fs:foo]
+       mov ebx,[a64 rel dword fs:foo]
+       mov rax,[a64 rel dword fs:foo]
+       mov rbx,[a64 rel dword fs:foo]
+       mov al,[a64 rel dword fs:0xaaaaaaaaaaaaaaaa]
+       mov bl,[a64 rel dword fs:0xaaaaaaaaaaaaaaaa]
+       mov ax,[a64 rel dword fs:0xaaaaaaaaaaaaaaaa]
+       mov bx,[a64 rel dword fs:0xaaaaaaaaaaaaaaaa]
+       mov eax,[a64 rel dword fs:0xaaaaaaaaaaaaaaaa]
+       mov ebx,[a64 rel dword fs:0xaaaaaaaaaaaaaaaa]
+       mov rax,[a64 rel dword fs:0xaaaaaaaaaaaaaaaa]
+       mov rbx,[a64 rel dword fs:0xaaaaaaaaaaaaaaaa]
+       mov al,[a64 rel dword fs:0xbbbbbbbb]
+       mov bl,[a64 rel dword fs:0xbbbbbbbb]
+       mov ax,[a64 rel dword fs:0xbbbbbbbb]
+       mov bx,[a64 rel dword fs:0xbbbbbbbb]
+       mov eax,[a64 rel dword fs:0xbbbbbbbb]
+       mov ebx,[a64 rel dword fs:0xbbbbbbbb]
+       mov rax,[a64 rel dword fs:0xbbbbbbbb]
+       mov rbx,[a64 rel dword fs:0xbbbbbbbb]
+       mov al,[a64 rel dword fs:0xffffffffcccccccc]
+       mov bl,[a64 rel dword fs:0xffffffffcccccccc]
+       mov ax,[a64 rel dword fs:0xffffffffcccccccc]
+       mov bx,[a64 rel dword fs:0xffffffffcccccccc]
+       mov eax,[a64 rel dword fs:0xffffffffcccccccc]
+       mov ebx,[a64 rel dword fs:0xffffffffcccccccc]
+       mov rax,[a64 rel dword fs:0xffffffffcccccccc]
+       mov rbx,[a64 rel dword fs:0xffffffffcccccccc]
+
+       mov al,[a64 rel qword fs:foo]
+       mov bl,[a64 rel qword fs:foo]
+       mov ax,[a64 rel qword fs:foo]
+       mov bx,[a64 rel qword fs:foo]
+       mov eax,[a64 rel qword fs:foo]
+       mov ebx,[a64 rel qword fs:foo]
+       mov rax,[a64 rel qword fs:foo]
+       mov rbx,[a64 rel qword fs:foo]
+       mov al,[a64 rel qword fs:0xaaaaaaaaaaaaaaaa]
+       mov bl,[a64 rel qword fs:0xaaaaaaaaaaaaaaaa]
+       mov ax,[a64 rel qword fs:0xaaaaaaaaaaaaaaaa]
+       mov bx,[a64 rel qword fs:0xaaaaaaaaaaaaaaaa]
+       mov eax,[a64 rel qword fs:0xaaaaaaaaaaaaaaaa]
+       mov ebx,[a64 rel qword fs:0xaaaaaaaaaaaaaaaa]
+       mov rax,[a64 rel qword fs:0xaaaaaaaaaaaaaaaa]
+       mov rbx,[a64 rel qword fs:0xaaaaaaaaaaaaaaaa]
+       mov al,[a64 rel qword fs:0xbbbbbbbb]
+       mov bl,[a64 rel qword fs:0xbbbbbbbb]
+       mov ax,[a64 rel qword fs:0xbbbbbbbb]
+       mov bx,[a64 rel qword fs:0xbbbbbbbb]
+       mov eax,[a64 rel qword fs:0xbbbbbbbb]
+       mov ebx,[a64 rel qword fs:0xbbbbbbbb]
+       mov rax,[a64 rel qword fs:0xbbbbbbbb]
+       mov rbx,[a64 rel qword fs:0xbbbbbbbb]
+       mov al,[a64 rel qword fs:0xffffffffcccccccc]
+       mov bl,[a64 rel qword fs:0xffffffffcccccccc]
+       mov ax,[a64 rel qword fs:0xffffffffcccccccc]
+       mov bx,[a64 rel qword fs:0xffffffffcccccccc]
+       mov eax,[a64 rel qword fs:0xffffffffcccccccc]
+       mov ebx,[a64 rel qword fs:0xffffffffcccccccc]
+       mov rax,[a64 rel qword fs:0xffffffffcccccccc]
+       mov rbx,[a64 rel qword fs:0xffffffffcccccccc]
+
+       mov al,[a32 rel fs:foo]
+       mov bl,[a32 rel fs:foo]
+       mov ax,[a32 rel fs:foo]
+       mov bx,[a32 rel fs:foo]
+       mov eax,[a32 rel fs:foo]
+       mov ebx,[a32 rel fs:foo]
+       mov rax,[a32 rel fs:foo]
+       mov rbx,[a32 rel fs:foo]
+       mov al,[a32 rel fs:0xaaaaaaaaaaaaaaaa]
+       mov bl,[a32 rel fs:0xaaaaaaaaaaaaaaaa]
+       mov ax,[a32 rel fs:0xaaaaaaaaaaaaaaaa]
+       mov bx,[a32 rel fs:0xaaaaaaaaaaaaaaaa]
+       mov eax,[a32 rel fs:0xaaaaaaaaaaaaaaaa]
+       mov ebx,[a32 rel fs:0xaaaaaaaaaaaaaaaa]
+       mov rax,[a32 rel fs:0xaaaaaaaaaaaaaaaa]
+       mov rbx,[a32 rel fs:0xaaaaaaaaaaaaaaaa]
+       mov al,[a32 rel fs:0xbbbbbbbb]
+       mov bl,[a32 rel fs:0xbbbbbbbb]
+       mov ax,[a32 rel fs:0xbbbbbbbb]
+       mov bx,[a32 rel fs:0xbbbbbbbb]
+       mov eax,[a32 rel fs:0xbbbbbbbb]
+       mov ebx,[a32 rel fs:0xbbbbbbbb]
+       mov rax,[a32 rel fs:0xbbbbbbbb]
+       mov rbx,[a32 rel fs:0xbbbbbbbb]
+       mov al,[a32 rel fs:0xffffffffcccccccc]
+       mov bl,[a32 rel fs:0xffffffffcccccccc]
+       mov ax,[a32 rel fs:0xffffffffcccccccc]
+       mov bx,[a32 rel fs:0xffffffffcccccccc]
+       mov eax,[a32 rel fs:0xffffffffcccccccc]
+       mov ebx,[a32 rel fs:0xffffffffcccccccc]
+       mov rax,[a32 rel fs:0xffffffffcccccccc]
+       mov rbx,[a32 rel fs:0xffffffffcccccccc]
+
+       mov al,[a32 rel dword fs:foo]
+       mov bl,[a32 rel dword fs:foo]
+       mov ax,[a32 rel dword fs:foo]
+       mov bx,[a32 rel dword fs:foo]
+       mov eax,[a32 rel dword fs:foo]
+       mov ebx,[a32 rel dword fs:foo]
+       mov rax,[a32 rel dword fs:foo]
+       mov rbx,[a32 rel dword fs:foo]
+       mov al,[a32 rel dword fs:0xaaaaaaaaaaaaaaaa]
+       mov bl,[a32 rel dword fs:0xaaaaaaaaaaaaaaaa]
+       mov ax,[a32 rel dword fs:0xaaaaaaaaaaaaaaaa]
+       mov bx,[a32 rel dword fs:0xaaaaaaaaaaaaaaaa]
+       mov eax,[a32 rel dword fs:0xaaaaaaaaaaaaaaaa]
+       mov ebx,[a32 rel dword fs:0xaaaaaaaaaaaaaaaa]
+       mov rax,[a32 rel dword fs:0xaaaaaaaaaaaaaaaa]
+       mov rbx,[a32 rel dword fs:0xaaaaaaaaaaaaaaaa]
+       mov al,[a32 rel dword fs:0xbbbbbbbb]
+       mov bl,[a32 rel dword fs:0xbbbbbbbb]
+       mov ax,[a32 rel dword fs:0xbbbbbbbb]
+       mov bx,[a32 rel dword fs:0xbbbbbbbb]
+       mov eax,[a32 rel dword fs:0xbbbbbbbb]
+       mov ebx,[a32 rel dword fs:0xbbbbbbbb]
+       mov rax,[a32 rel dword fs:0xbbbbbbbb]
+       mov rbx,[a32 rel dword fs:0xbbbbbbbb]
+       mov al,[a32 rel dword fs:0xffffffffcccccccc]
+       mov bl,[a32 rel dword fs:0xffffffffcccccccc]
+       mov ax,[a32 rel dword fs:0xffffffffcccccccc]
+       mov bx,[a32 rel dword fs:0xffffffffcccccccc]
+       mov eax,[a32 rel dword fs:0xffffffffcccccccc]
+       mov ebx,[a32 rel dword fs:0xffffffffcccccccc]
+       mov rax,[a32 rel dword fs:0xffffffffcccccccc]
+       mov rbx,[a32 rel dword fs:0xffffffffcccccccc]
+
+       mov al,[a32 rel qword fs:foo]
+       mov bl,[a32 rel qword fs:foo]
+       mov ax,[a32 rel qword fs:foo]
+       mov bx,[a32 rel qword fs:foo]
+       mov eax,[a32 rel qword fs:foo]
+       mov ebx,[a32 rel qword fs:foo]
+       mov rax,[a32 rel qword fs:foo]
+       mov rbx,[a32 rel qword fs:foo]
+       mov al,[a32 rel qword fs:0xaaaaaaaaaaaaaaaa]
+       mov bl,[a32 rel qword fs:0xaaaaaaaaaaaaaaaa]
+       mov ax,[a32 rel qword fs:0xaaaaaaaaaaaaaaaa]
+       mov bx,[a32 rel qword fs:0xaaaaaaaaaaaaaaaa]
+       mov eax,[a32 rel qword fs:0xaaaaaaaaaaaaaaaa]
+       mov ebx,[a32 rel qword fs:0xaaaaaaaaaaaaaaaa]
+       mov rax,[a32 rel qword fs:0xaaaaaaaaaaaaaaaa]
+       mov rbx,[a32 rel qword fs:0xaaaaaaaaaaaaaaaa]
+       mov al,[a32 rel qword fs:0xbbbbbbbb]
+       mov bl,[a32 rel qword fs:0xbbbbbbbb]
+       mov ax,[a32 rel qword fs:0xbbbbbbbb]
+       mov bx,[a32 rel qword fs:0xbbbbbbbb]
+       mov eax,[a32 rel qword fs:0xbbbbbbbb]
+       mov ebx,[a32 rel qword fs:0xbbbbbbbb]
+       mov rax,[a32 rel qword fs:0xbbbbbbbb]
+       mov rbx,[a32 rel qword fs:0xbbbbbbbb]
+       mov al,[a32 rel qword fs:0xffffffffcccccccc]
+       mov bl,[a32 rel qword fs:0xffffffffcccccccc]
+       mov ax,[a32 rel qword fs:0xffffffffcccccccc]
+       mov bx,[a32 rel qword fs:0xffffffffcccccccc]
+       mov eax,[a32 rel qword fs:0xffffffffcccccccc]
+       mov ebx,[a32 rel qword fs:0xffffffffcccccccc]
+       mov rax,[a32 rel qword fs:0xffffffffcccccccc]
+       mov rbx,[a32 rel qword fs:0xffffffffcccccccc]
+
+       mov al,[es:foo]
+       mov bl,[es:foo]
+       mov ax,[es:foo]
+       mov bx,[es:foo]
+       mov eax,[es:foo]
+       mov ebx,[es:foo]
+       mov rax,[es:foo]
+       mov rbx,[es:foo]
+       mov al,[es:0xaaaaaaaaaaaaaaaa]
+       mov bl,[es:0xaaaaaaaaaaaaaaaa]
+       mov ax,[es:0xaaaaaaaaaaaaaaaa]
+       mov bx,[es:0xaaaaaaaaaaaaaaaa]
+       mov eax,[es:0xaaaaaaaaaaaaaaaa]
+       mov ebx,[es:0xaaaaaaaaaaaaaaaa]
+       mov rax,[es:0xaaaaaaaaaaaaaaaa]
+       mov rbx,[es:0xaaaaaaaaaaaaaaaa]
+       mov al,[es:0xbbbbbbbb]
+       mov bl,[es:0xbbbbbbbb]
+       mov ax,[es:0xbbbbbbbb]
+       mov bx,[es:0xbbbbbbbb]
+       mov eax,[es:0xbbbbbbbb]
+       mov ebx,[es:0xbbbbbbbb]
+       mov rax,[es:0xbbbbbbbb]
+       mov rbx,[es:0xbbbbbbbb]
+       mov al,[es:0xffffffffcccccccc]
+       mov bl,[es:0xffffffffcccccccc]
+       mov ax,[es:0xffffffffcccccccc]
+       mov bx,[es:0xffffffffcccccccc]
+       mov eax,[es:0xffffffffcccccccc]
+       mov ebx,[es:0xffffffffcccccccc]
+       mov rax,[es:0xffffffffcccccccc]
+       mov rbx,[es:0xffffffffcccccccc]
+
+       mov al,[dword es:foo]
+       mov bl,[dword es:foo]
+       mov ax,[dword es:foo]
+       mov bx,[dword es:foo]
+       mov eax,[dword es:foo]
+       mov ebx,[dword es:foo]
+       mov rax,[dword es:foo]
+       mov rbx,[dword es:foo]
+       mov al,[dword es:0xaaaaaaaaaaaaaaaa]
+       mov bl,[dword es:0xaaaaaaaaaaaaaaaa]
+       mov ax,[dword es:0xaaaaaaaaaaaaaaaa]
+       mov bx,[dword es:0xaaaaaaaaaaaaaaaa]
+       mov eax,[dword es:0xaaaaaaaaaaaaaaaa]
+       mov ebx,[dword es:0xaaaaaaaaaaaaaaaa]
+       mov rax,[dword es:0xaaaaaaaaaaaaaaaa]
+       mov rbx,[dword es:0xaaaaaaaaaaaaaaaa]
+       mov al,[dword es:0xbbbbbbbb]
+       mov bl,[dword es:0xbbbbbbbb]
+       mov ax,[dword es:0xbbbbbbbb]
+       mov bx,[dword es:0xbbbbbbbb]
+       mov eax,[dword es:0xbbbbbbbb]
+       mov ebx,[dword es:0xbbbbbbbb]
+       mov rax,[dword es:0xbbbbbbbb]
+       mov rbx,[dword es:0xbbbbbbbb]
+       mov al,[dword es:0xffffffffcccccccc]
+       mov bl,[dword es:0xffffffffcccccccc]
+       mov ax,[dword es:0xffffffffcccccccc]
+       mov bx,[dword es:0xffffffffcccccccc]
+       mov eax,[dword es:0xffffffffcccccccc]
+       mov ebx,[dword es:0xffffffffcccccccc]
+       mov rax,[dword es:0xffffffffcccccccc]
+       mov rbx,[dword es:0xffffffffcccccccc]
+
+       mov al,[qword es:foo]
+       mov bl,[qword es:foo]
+       mov ax,[qword es:foo]
+       mov bx,[qword es:foo]
+       mov eax,[qword es:foo]
+       mov ebx,[qword es:foo]
+       mov rax,[qword es:foo]
+       mov rbx,[qword es:foo]
+       mov al,[qword es:0xaaaaaaaaaaaaaaaa]
+       mov bl,[qword es:0xaaaaaaaaaaaaaaaa]
+       mov ax,[qword es:0xaaaaaaaaaaaaaaaa]
+       mov bx,[qword es:0xaaaaaaaaaaaaaaaa]
+       mov eax,[qword es:0xaaaaaaaaaaaaaaaa]
+       mov ebx,[qword es:0xaaaaaaaaaaaaaaaa]
+       mov rax,[qword es:0xaaaaaaaaaaaaaaaa]
+       mov rbx,[qword es:0xaaaaaaaaaaaaaaaa]
+       mov al,[qword es:0xbbbbbbbb]
+       mov bl,[qword es:0xbbbbbbbb]
+       mov ax,[qword es:0xbbbbbbbb]
+       mov bx,[qword es:0xbbbbbbbb]
+       mov eax,[qword es:0xbbbbbbbb]
+       mov ebx,[qword es:0xbbbbbbbb]
+       mov rax,[qword es:0xbbbbbbbb]
+       mov rbx,[qword es:0xbbbbbbbb]
+       mov al,[qword es:0xffffffffcccccccc]
+       mov bl,[qword es:0xffffffffcccccccc]
+       mov ax,[qword es:0xffffffffcccccccc]
+       mov bx,[qword es:0xffffffffcccccccc]
+       mov eax,[qword es:0xffffffffcccccccc]
+       mov ebx,[qword es:0xffffffffcccccccc]
+       mov rax,[qword es:0xffffffffcccccccc]
+       mov rbx,[qword es:0xffffffffcccccccc]
+
+       mov al,[a64 es:foo]
+       mov bl,[a64 es:foo]
+       mov ax,[a64 es:foo]
+       mov bx,[a64 es:foo]
+       mov eax,[a64 es:foo]
+       mov ebx,[a64 es:foo]
+       mov rax,[a64 es:foo]
+       mov rbx,[a64 es:foo]
+       mov al,[a64 es:0xaaaaaaaaaaaaaaaa]
+       mov bl,[a64 es:0xaaaaaaaaaaaaaaaa]
+       mov ax,[a64 es:0xaaaaaaaaaaaaaaaa]
+       mov bx,[a64 es:0xaaaaaaaaaaaaaaaa]
+       mov eax,[a64 es:0xaaaaaaaaaaaaaaaa]
+       mov ebx,[a64 es:0xaaaaaaaaaaaaaaaa]
+       mov rax,[a64 es:0xaaaaaaaaaaaaaaaa]
+       mov rbx,[a64 es:0xaaaaaaaaaaaaaaaa]
+       mov al,[a64 es:0xbbbbbbbb]
+       mov bl,[a64 es:0xbbbbbbbb]
+       mov ax,[a64 es:0xbbbbbbbb]
+       mov bx,[a64 es:0xbbbbbbbb]
+       mov eax,[a64 es:0xbbbbbbbb]
+       mov ebx,[a64 es:0xbbbbbbbb]
+       mov rax,[a64 es:0xbbbbbbbb]
+       mov rbx,[a64 es:0xbbbbbbbb]
+       mov al,[a64 es:0xffffffffcccccccc]
+       mov bl,[a64 es:0xffffffffcccccccc]
+       mov ax,[a64 es:0xffffffffcccccccc]
+       mov bx,[a64 es:0xffffffffcccccccc]
+       mov eax,[a64 es:0xffffffffcccccccc]
+       mov ebx,[a64 es:0xffffffffcccccccc]
+       mov rax,[a64 es:0xffffffffcccccccc]
+       mov rbx,[a64 es:0xffffffffcccccccc]
+
+       mov al,[a64 dword es:foo]
+       mov bl,[a64 dword es:foo]
+       mov ax,[a64 dword es:foo]
+       mov bx,[a64 dword es:foo]
+       mov eax,[a64 dword es:foo]
+       mov ebx,[a64 dword es:foo]
+       mov rax,[a64 dword es:foo]
+       mov rbx,[a64 dword es:foo]
+       mov al,[a64 dword es:0xaaaaaaaaaaaaaaaa]
+       mov bl,[a64 dword es:0xaaaaaaaaaaaaaaaa]
+       mov ax,[a64 dword es:0xaaaaaaaaaaaaaaaa]
+       mov bx,[a64 dword es:0xaaaaaaaaaaaaaaaa]
+       mov eax,[a64 dword es:0xaaaaaaaaaaaaaaaa]
+       mov ebx,[a64 dword es:0xaaaaaaaaaaaaaaaa]
+       mov rax,[a64 dword es:0xaaaaaaaaaaaaaaaa]
+       mov rbx,[a64 dword es:0xaaaaaaaaaaaaaaaa]
+       mov al,[a64 dword es:0xbbbbbbbb]
+       mov bl,[a64 dword es:0xbbbbbbbb]
+       mov ax,[a64 dword es:0xbbbbbbbb]
+       mov bx,[a64 dword es:0xbbbbbbbb]
+       mov eax,[a64 dword es:0xbbbbbbbb]
+       mov ebx,[a64 dword es:0xbbbbbbbb]
+       mov rax,[a64 dword es:0xbbbbbbbb]
+       mov rbx,[a64 dword es:0xbbbbbbbb]
+       mov al,[a64 dword es:0xffffffffcccccccc]
+       mov bl,[a64 dword es:0xffffffffcccccccc]
+       mov ax,[a64 dword es:0xffffffffcccccccc]
+       mov bx,[a64 dword es:0xffffffffcccccccc]
+       mov eax,[a64 dword es:0xffffffffcccccccc]
+       mov ebx,[a64 dword es:0xffffffffcccccccc]
+       mov rax,[a64 dword es:0xffffffffcccccccc]
+       mov rbx,[a64 dword es:0xffffffffcccccccc]
+
+       mov al,[a64 qword es:foo]
+       mov bl,[a64 qword es:foo]
+       mov ax,[a64 qword es:foo]
+       mov bx,[a64 qword es:foo]
+       mov eax,[a64 qword es:foo]
+       mov ebx,[a64 qword es:foo]
+       mov rax,[a64 qword es:foo]
+       mov rbx,[a64 qword es:foo]
+       mov al,[a64 qword es:0xaaaaaaaaaaaaaaaa]
+       mov bl,[a64 qword es:0xaaaaaaaaaaaaaaaa]
+       mov ax,[a64 qword es:0xaaaaaaaaaaaaaaaa]
+       mov bx,[a64 qword es:0xaaaaaaaaaaaaaaaa]
+       mov eax,[a64 qword es:0xaaaaaaaaaaaaaaaa]
+       mov ebx,[a64 qword es:0xaaaaaaaaaaaaaaaa]
+       mov rax,[a64 qword es:0xaaaaaaaaaaaaaaaa]
+       mov rbx,[a64 qword es:0xaaaaaaaaaaaaaaaa]
+       mov al,[a64 qword es:0xbbbbbbbb]
+       mov bl,[a64 qword es:0xbbbbbbbb]
+       mov ax,[a64 qword es:0xbbbbbbbb]
+       mov bx,[a64 qword es:0xbbbbbbbb]
+       mov eax,[a64 qword es:0xbbbbbbbb]
+       mov ebx,[a64 qword es:0xbbbbbbbb]
+       mov rax,[a64 qword es:0xbbbbbbbb]
+       mov rbx,[a64 qword es:0xbbbbbbbb]
+       mov al,[a64 qword es:0xffffffffcccccccc]
+       mov bl,[a64 qword es:0xffffffffcccccccc]
+       mov ax,[a64 qword es:0xffffffffcccccccc]
+       mov bx,[a64 qword es:0xffffffffcccccccc]
+       mov eax,[a64 qword es:0xffffffffcccccccc]
+       mov ebx,[a64 qword es:0xffffffffcccccccc]
+       mov rax,[a64 qword es:0xffffffffcccccccc]
+       mov rbx,[a64 qword es:0xffffffffcccccccc]
+
+       mov al,[a32 es:foo]
+       mov bl,[a32 es:foo]
+       mov ax,[a32 es:foo]
+       mov bx,[a32 es:foo]
+       mov eax,[a32 es:foo]
+       mov ebx,[a32 es:foo]
+       mov rax,[a32 es:foo]
+       mov rbx,[a32 es:foo]
+       mov al,[a32 es:0xaaaaaaaaaaaaaaaa]
+       mov bl,[a32 es:0xaaaaaaaaaaaaaaaa]
+       mov ax,[a32 es:0xaaaaaaaaaaaaaaaa]
+       mov bx,[a32 es:0xaaaaaaaaaaaaaaaa]
+       mov eax,[a32 es:0xaaaaaaaaaaaaaaaa]
+       mov ebx,[a32 es:0xaaaaaaaaaaaaaaaa]
+       mov rax,[a32 es:0xaaaaaaaaaaaaaaaa]
+       mov rbx,[a32 es:0xaaaaaaaaaaaaaaaa]
+       mov al,[a32 es:0xbbbbbbbb]
+       mov bl,[a32 es:0xbbbbbbbb]
+       mov ax,[a32 es:0xbbbbbbbb]
+       mov bx,[a32 es:0xbbbbbbbb]
+       mov eax,[a32 es:0xbbbbbbbb]
+       mov ebx,[a32 es:0xbbbbbbbb]
+       mov rax,[a32 es:0xbbbbbbbb]
+       mov rbx,[a32 es:0xbbbbbbbb]
+       mov al,[a32 es:0xffffffffcccccccc]
+       mov bl,[a32 es:0xffffffffcccccccc]
+       mov ax,[a32 es:0xffffffffcccccccc]
+       mov bx,[a32 es:0xffffffffcccccccc]
+       mov eax,[a32 es:0xffffffffcccccccc]
+       mov ebx,[a32 es:0xffffffffcccccccc]
+       mov rax,[a32 es:0xffffffffcccccccc]
+       mov rbx,[a32 es:0xffffffffcccccccc]
+
+       mov al,[a32 dword es:foo]
+       mov bl,[a32 dword es:foo]
+       mov ax,[a32 dword es:foo]
+       mov bx,[a32 dword es:foo]
+       mov eax,[a32 dword es:foo]
+       mov ebx,[a32 dword es:foo]
+       mov rax,[a32 dword es:foo]
+       mov rbx,[a32 dword es:foo]
+       mov al,[a32 dword es:0xaaaaaaaaaaaaaaaa]
+       mov bl,[a32 dword es:0xaaaaaaaaaaaaaaaa]
+       mov ax,[a32 dword es:0xaaaaaaaaaaaaaaaa]
+       mov bx,[a32 dword es:0xaaaaaaaaaaaaaaaa]
+       mov eax,[a32 dword es:0xaaaaaaaaaaaaaaaa]
+       mov ebx,[a32 dword es:0xaaaaaaaaaaaaaaaa]
+       mov rax,[a32 dword es:0xaaaaaaaaaaaaaaaa]
+       mov rbx,[a32 dword es:0xaaaaaaaaaaaaaaaa]
+       mov al,[a32 dword es:0xbbbbbbbb]
+       mov bl,[a32 dword es:0xbbbbbbbb]
+       mov ax,[a32 dword es:0xbbbbbbbb]
+       mov bx,[a32 dword es:0xbbbbbbbb]
+       mov eax,[a32 dword es:0xbbbbbbbb]
+       mov ebx,[a32 dword es:0xbbbbbbbb]
+       mov rax,[a32 dword es:0xbbbbbbbb]
+       mov rbx,[a32 dword es:0xbbbbbbbb]
+       mov al,[a32 dword es:0xffffffffcccccccc]
+       mov bl,[a32 dword es:0xffffffffcccccccc]
+       mov ax,[a32 dword es:0xffffffffcccccccc]
+       mov bx,[a32 dword es:0xffffffffcccccccc]
+       mov eax,[a32 dword es:0xffffffffcccccccc]
+       mov ebx,[a32 dword es:0xffffffffcccccccc]
+       mov rax,[a32 dword es:0xffffffffcccccccc]
+       mov rbx,[a32 dword es:0xffffffffcccccccc]
+
+       mov al,[a32 qword es:foo]
+       mov bl,[a32 qword es:foo]
+       mov ax,[a32 qword es:foo]
+       mov bx,[a32 qword es:foo]
+       mov eax,[a32 qword es:foo]
+       mov ebx,[a32 qword es:foo]
+       mov rax,[a32 qword es:foo]
+       mov rbx,[a32 qword es:foo]
+       mov al,[a32 qword es:0xaaaaaaaaaaaaaaaa]
+       mov bl,[a32 qword es:0xaaaaaaaaaaaaaaaa]
+       mov ax,[a32 qword es:0xaaaaaaaaaaaaaaaa]
+       mov bx,[a32 qword es:0xaaaaaaaaaaaaaaaa]
+       mov eax,[a32 qword es:0xaaaaaaaaaaaaaaaa]
+       mov ebx,[a32 qword es:0xaaaaaaaaaaaaaaaa]
+       mov rax,[a32 qword es:0xaaaaaaaaaaaaaaaa]
+       mov rbx,[a32 qword es:0xaaaaaaaaaaaaaaaa]
+       mov al,[a32 qword es:0xbbbbbbbb]
+       mov bl,[a32 qword es:0xbbbbbbbb]
+       mov ax,[a32 qword es:0xbbbbbbbb]
+       mov bx,[a32 qword es:0xbbbbbbbb]
+       mov eax,[a32 qword es:0xbbbbbbbb]
+       mov ebx,[a32 qword es:0xbbbbbbbb]
+       mov rax,[a32 qword es:0xbbbbbbbb]
+       mov rbx,[a32 qword es:0xbbbbbbbb]
+       mov al,[a32 qword es:0xffffffffcccccccc]
+       mov bl,[a32 qword es:0xffffffffcccccccc]
+       mov ax,[a32 qword es:0xffffffffcccccccc]
+       mov bx,[a32 qword es:0xffffffffcccccccc]
+       mov eax,[a32 qword es:0xffffffffcccccccc]
+       mov ebx,[a32 qword es:0xffffffffcccccccc]
+       mov rax,[a32 qword es:0xffffffffcccccccc]
+       mov rbx,[a32 qword es:0xffffffffcccccccc]
+
+       mov al,[abs es:foo]
+       mov bl,[abs es:foo]
+       mov ax,[abs es:foo]
+       mov bx,[abs es:foo]
+       mov eax,[abs es:foo]
+       mov ebx,[abs es:foo]
+       mov rax,[abs es:foo]
+       mov rbx,[abs es:foo]
+       mov al,[abs es:0xaaaaaaaaaaaaaaaa]
+       mov bl,[abs es:0xaaaaaaaaaaaaaaaa]
+       mov ax,[abs es:0xaaaaaaaaaaaaaaaa]
+       mov bx,[abs es:0xaaaaaaaaaaaaaaaa]
+       mov eax,[abs es:0xaaaaaaaaaaaaaaaa]
+       mov ebx,[abs es:0xaaaaaaaaaaaaaaaa]
+       mov rax,[abs es:0xaaaaaaaaaaaaaaaa]
+       mov rbx,[abs es:0xaaaaaaaaaaaaaaaa]
+       mov al,[abs es:0xbbbbbbbb]
+       mov bl,[abs es:0xbbbbbbbb]
+       mov ax,[abs es:0xbbbbbbbb]
+       mov bx,[abs es:0xbbbbbbbb]
+       mov eax,[abs es:0xbbbbbbbb]
+       mov ebx,[abs es:0xbbbbbbbb]
+       mov rax,[abs es:0xbbbbbbbb]
+       mov rbx,[abs es:0xbbbbbbbb]
+       mov al,[abs es:0xffffffffcccccccc]
+       mov bl,[abs es:0xffffffffcccccccc]
+       mov ax,[abs es:0xffffffffcccccccc]
+       mov bx,[abs es:0xffffffffcccccccc]
+       mov eax,[abs es:0xffffffffcccccccc]
+       mov ebx,[abs es:0xffffffffcccccccc]
+       mov rax,[abs es:0xffffffffcccccccc]
+       mov rbx,[abs es:0xffffffffcccccccc]
+
+       mov al,[abs dword es:foo]
+       mov bl,[abs dword es:foo]
+       mov ax,[abs dword es:foo]
+       mov bx,[abs dword es:foo]
+       mov eax,[abs dword es:foo]
+       mov ebx,[abs dword es:foo]
+       mov rax,[abs dword es:foo]
+       mov rbx,[abs dword es:foo]
+       mov al,[abs dword es:0xaaaaaaaaaaaaaaaa]
+       mov bl,[abs dword es:0xaaaaaaaaaaaaaaaa]
+       mov ax,[abs dword es:0xaaaaaaaaaaaaaaaa]
+       mov bx,[abs dword es:0xaaaaaaaaaaaaaaaa]
+       mov eax,[abs dword es:0xaaaaaaaaaaaaaaaa]
+       mov ebx,[abs dword es:0xaaaaaaaaaaaaaaaa]
+       mov rax,[abs dword es:0xaaaaaaaaaaaaaaaa]
+       mov rbx,[abs dword es:0xaaaaaaaaaaaaaaaa]
+       mov al,[abs dword es:0xbbbbbbbb]
+       mov bl,[abs dword es:0xbbbbbbbb]
+       mov ax,[abs dword es:0xbbbbbbbb]
+       mov bx,[abs dword es:0xbbbbbbbb]
+       mov eax,[abs dword es:0xbbbbbbbb]
+       mov ebx,[abs dword es:0xbbbbbbbb]
+       mov rax,[abs dword es:0xbbbbbbbb]
+       mov rbx,[abs dword es:0xbbbbbbbb]
+       mov al,[abs dword es:0xffffffffcccccccc]
+       mov bl,[abs dword es:0xffffffffcccccccc]
+       mov ax,[abs dword es:0xffffffffcccccccc]
+       mov bx,[abs dword es:0xffffffffcccccccc]
+       mov eax,[abs dword es:0xffffffffcccccccc]
+       mov ebx,[abs dword es:0xffffffffcccccccc]
+       mov rax,[abs dword es:0xffffffffcccccccc]
+       mov rbx,[abs dword es:0xffffffffcccccccc]
+
+       mov al,[abs qword es:foo]
+       mov bl,[abs qword es:foo]
+       mov ax,[abs qword es:foo]
+       mov bx,[abs qword es:foo]
+       mov eax,[abs qword es:foo]
+       mov ebx,[abs qword es:foo]
+       mov rax,[abs qword es:foo]
+       mov rbx,[abs qword es:foo]
+       mov al,[abs qword es:0xaaaaaaaaaaaaaaaa]
+       mov bl,[abs qword es:0xaaaaaaaaaaaaaaaa]
+       mov ax,[abs qword es:0xaaaaaaaaaaaaaaaa]
+       mov bx,[abs qword es:0xaaaaaaaaaaaaaaaa]
+       mov eax,[abs qword es:0xaaaaaaaaaaaaaaaa]
+       mov ebx,[abs qword es:0xaaaaaaaaaaaaaaaa]
+       mov rax,[abs qword es:0xaaaaaaaaaaaaaaaa]
+       mov rbx,[abs qword es:0xaaaaaaaaaaaaaaaa]
+       mov al,[abs qword es:0xbbbbbbbb]
+       mov bl,[abs qword es:0xbbbbbbbb]
+       mov ax,[abs qword es:0xbbbbbbbb]
+       mov bx,[abs qword es:0xbbbbbbbb]
+       mov eax,[abs qword es:0xbbbbbbbb]
+       mov ebx,[abs qword es:0xbbbbbbbb]
+       mov rax,[abs qword es:0xbbbbbbbb]
+       mov rbx,[abs qword es:0xbbbbbbbb]
+       mov al,[abs qword es:0xffffffffcccccccc]
+       mov bl,[abs qword es:0xffffffffcccccccc]
+       mov ax,[abs qword es:0xffffffffcccccccc]
+       mov bx,[abs qword es:0xffffffffcccccccc]
+       mov eax,[abs qword es:0xffffffffcccccccc]
+       mov ebx,[abs qword es:0xffffffffcccccccc]
+       mov rax,[abs qword es:0xffffffffcccccccc]
+       mov rbx,[abs qword es:0xffffffffcccccccc]
+
+       mov al,[a64 abs es:foo]
+       mov bl,[a64 abs es:foo]
+       mov ax,[a64 abs es:foo]
+       mov bx,[a64 abs es:foo]
+       mov eax,[a64 abs es:foo]
+       mov ebx,[a64 abs es:foo]
+       mov rax,[a64 abs es:foo]
+       mov rbx,[a64 abs es:foo]
+       mov al,[a64 abs es:0xaaaaaaaaaaaaaaaa]
+       mov bl,[a64 abs es:0xaaaaaaaaaaaaaaaa]
+       mov ax,[a64 abs es:0xaaaaaaaaaaaaaaaa]
+       mov bx,[a64 abs es:0xaaaaaaaaaaaaaaaa]
+       mov eax,[a64 abs es:0xaaaaaaaaaaaaaaaa]
+       mov ebx,[a64 abs es:0xaaaaaaaaaaaaaaaa]
+       mov rax,[a64 abs es:0xaaaaaaaaaaaaaaaa]
+       mov rbx,[a64 abs es:0xaaaaaaaaaaaaaaaa]
+       mov al,[a64 abs es:0xbbbbbbbb]
+       mov bl,[a64 abs es:0xbbbbbbbb]
+       mov ax,[a64 abs es:0xbbbbbbbb]
+       mov bx,[a64 abs es:0xbbbbbbbb]
+       mov eax,[a64 abs es:0xbbbbbbbb]
+       mov ebx,[a64 abs es:0xbbbbbbbb]
+       mov rax,[a64 abs es:0xbbbbbbbb]
+       mov rbx,[a64 abs es:0xbbbbbbbb]
+       mov al,[a64 abs es:0xffffffffcccccccc]
+       mov bl,[a64 abs es:0xffffffffcccccccc]
+       mov ax,[a64 abs es:0xffffffffcccccccc]
+       mov bx,[a64 abs es:0xffffffffcccccccc]
+       mov eax,[a64 abs es:0xffffffffcccccccc]
+       mov ebx,[a64 abs es:0xffffffffcccccccc]
+       mov rax,[a64 abs es:0xffffffffcccccccc]
+       mov rbx,[a64 abs es:0xffffffffcccccccc]
+
+       mov al,[a64 abs dword es:foo]
+       mov bl,[a64 abs dword es:foo]
+       mov ax,[a64 abs dword es:foo]
+       mov bx,[a64 abs dword es:foo]
+       mov eax,[a64 abs dword es:foo]
+       mov ebx,[a64 abs dword es:foo]
+       mov rax,[a64 abs dword es:foo]
+       mov rbx,[a64 abs dword es:foo]
+       mov al,[a64 abs dword es:0xaaaaaaaaaaaaaaaa]
+       mov bl,[a64 abs dword es:0xaaaaaaaaaaaaaaaa]
+       mov ax,[a64 abs dword es:0xaaaaaaaaaaaaaaaa]
+       mov bx,[a64 abs dword es:0xaaaaaaaaaaaaaaaa]
+       mov eax,[a64 abs dword es:0xaaaaaaaaaaaaaaaa]
+       mov ebx,[a64 abs dword es:0xaaaaaaaaaaaaaaaa]
+       mov rax,[a64 abs dword es:0xaaaaaaaaaaaaaaaa]
+       mov rbx,[a64 abs dword es:0xaaaaaaaaaaaaaaaa]
+       mov al,[a64 abs dword es:0xbbbbbbbb]
+       mov bl,[a64 abs dword es:0xbbbbbbbb]
+       mov ax,[a64 abs dword es:0xbbbbbbbb]
+       mov bx,[a64 abs dword es:0xbbbbbbbb]
+       mov eax,[a64 abs dword es:0xbbbbbbbb]
+       mov ebx,[a64 abs dword es:0xbbbbbbbb]
+       mov rax,[a64 abs dword es:0xbbbbbbbb]
+       mov rbx,[a64 abs dword es:0xbbbbbbbb]
+       mov al,[a64 abs dword es:0xffffffffcccccccc]
+       mov bl,[a64 abs dword es:0xffffffffcccccccc]
+       mov ax,[a64 abs dword es:0xffffffffcccccccc]
+       mov bx,[a64 abs dword es:0xffffffffcccccccc]
+       mov eax,[a64 abs dword es:0xffffffffcccccccc]
+       mov ebx,[a64 abs dword es:0xffffffffcccccccc]
+       mov rax,[a64 abs dword es:0xffffffffcccccccc]
+       mov rbx,[a64 abs dword es:0xffffffffcccccccc]
+
+       mov al,[a64 abs qword es:foo]
+       mov bl,[a64 abs qword es:foo]
+       mov ax,[a64 abs qword es:foo]
+       mov bx,[a64 abs qword es:foo]
+       mov eax,[a64 abs qword es:foo]
+       mov ebx,[a64 abs qword es:foo]
+       mov rax,[a64 abs qword es:foo]
+       mov rbx,[a64 abs qword es:foo]
+       mov al,[a64 abs qword es:0xaaaaaaaaaaaaaaaa]
+       mov bl,[a64 abs qword es:0xaaaaaaaaaaaaaaaa]
+       mov ax,[a64 abs qword es:0xaaaaaaaaaaaaaaaa]
+       mov bx,[a64 abs qword es:0xaaaaaaaaaaaaaaaa]
+       mov eax,[a64 abs qword es:0xaaaaaaaaaaaaaaaa]
+       mov ebx,[a64 abs qword es:0xaaaaaaaaaaaaaaaa]
+       mov rax,[a64 abs qword es:0xaaaaaaaaaaaaaaaa]
+       mov rbx,[a64 abs qword es:0xaaaaaaaaaaaaaaaa]
+       mov al,[a64 abs qword es:0xbbbbbbbb]
+       mov bl,[a64 abs qword es:0xbbbbbbbb]
+       mov ax,[a64 abs qword es:0xbbbbbbbb]
+       mov bx,[a64 abs qword es:0xbbbbbbbb]
+       mov eax,[a64 abs qword es:0xbbbbbbbb]
+       mov ebx,[a64 abs qword es:0xbbbbbbbb]
+       mov rax,[a64 abs qword es:0xbbbbbbbb]
+       mov rbx,[a64 abs qword es:0xbbbbbbbb]
+       mov al,[a64 abs qword es:0xffffffffcccccccc]
+       mov bl,[a64 abs qword es:0xffffffffcccccccc]
+       mov ax,[a64 abs qword es:0xffffffffcccccccc]
+       mov bx,[a64 abs qword es:0xffffffffcccccccc]
+       mov eax,[a64 abs qword es:0xffffffffcccccccc]
+       mov ebx,[a64 abs qword es:0xffffffffcccccccc]
+       mov rax,[a64 abs qword es:0xffffffffcccccccc]
+       mov rbx,[a64 abs qword es:0xffffffffcccccccc]
+
+       mov al,[a32 abs es:foo]
+       mov bl,[a32 abs es:foo]
+       mov ax,[a32 abs es:foo]
+       mov bx,[a32 abs es:foo]
+       mov eax,[a32 abs es:foo]
+       mov ebx,[a32 abs es:foo]
+       mov rax,[a32 abs es:foo]
+       mov rbx,[a32 abs es:foo]
+       mov al,[a32 abs es:0xaaaaaaaaaaaaaaaa]
+       mov bl,[a32 abs es:0xaaaaaaaaaaaaaaaa]
+       mov ax,[a32 abs es:0xaaaaaaaaaaaaaaaa]
+       mov bx,[a32 abs es:0xaaaaaaaaaaaaaaaa]
+       mov eax,[a32 abs es:0xaaaaaaaaaaaaaaaa]
+       mov ebx,[a32 abs es:0xaaaaaaaaaaaaaaaa]
+       mov rax,[a32 abs es:0xaaaaaaaaaaaaaaaa]
+       mov rbx,[a32 abs es:0xaaaaaaaaaaaaaaaa]
+       mov al,[a32 abs es:0xbbbbbbbb]
+       mov bl,[a32 abs es:0xbbbbbbbb]
+       mov ax,[a32 abs es:0xbbbbbbbb]
+       mov bx,[a32 abs es:0xbbbbbbbb]
+       mov eax,[a32 abs es:0xbbbbbbbb]
+       mov ebx,[a32 abs es:0xbbbbbbbb]
+       mov rax,[a32 abs es:0xbbbbbbbb]
+       mov rbx,[a32 abs es:0xbbbbbbbb]
+       mov al,[a32 abs es:0xffffffffcccccccc]
+       mov bl,[a32 abs es:0xffffffffcccccccc]
+       mov ax,[a32 abs es:0xffffffffcccccccc]
+       mov bx,[a32 abs es:0xffffffffcccccccc]
+       mov eax,[a32 abs es:0xffffffffcccccccc]
+       mov ebx,[a32 abs es:0xffffffffcccccccc]
+       mov rax,[a32 abs es:0xffffffffcccccccc]
+       mov rbx,[a32 abs es:0xffffffffcccccccc]
+
+       mov al,[a32 abs dword es:foo]
+       mov bl,[a32 abs dword es:foo]
+       mov ax,[a32 abs dword es:foo]
+       mov bx,[a32 abs dword es:foo]
+       mov eax,[a32 abs dword es:foo]
+       mov ebx,[a32 abs dword es:foo]
+       mov rax,[a32 abs dword es:foo]
+       mov rbx,[a32 abs dword es:foo]
+       mov al,[a32 abs dword es:0xaaaaaaaaaaaaaaaa]
+       mov bl,[a32 abs dword es:0xaaaaaaaaaaaaaaaa]
+       mov ax,[a32 abs dword es:0xaaaaaaaaaaaaaaaa]
+       mov bx,[a32 abs dword es:0xaaaaaaaaaaaaaaaa]
+       mov eax,[a32 abs dword es:0xaaaaaaaaaaaaaaaa]
+       mov ebx,[a32 abs dword es:0xaaaaaaaaaaaaaaaa]
+       mov rax,[a32 abs dword es:0xaaaaaaaaaaaaaaaa]
+       mov rbx,[a32 abs dword es:0xaaaaaaaaaaaaaaaa]
+       mov al,[a32 abs dword es:0xbbbbbbbb]
+       mov bl,[a32 abs dword es:0xbbbbbbbb]
+       mov ax,[a32 abs dword es:0xbbbbbbbb]
+       mov bx,[a32 abs dword es:0xbbbbbbbb]
+       mov eax,[a32 abs dword es:0xbbbbbbbb]
+       mov ebx,[a32 abs dword es:0xbbbbbbbb]
+       mov rax,[a32 abs dword es:0xbbbbbbbb]
+       mov rbx,[a32 abs dword es:0xbbbbbbbb]
+       mov al,[a32 abs dword es:0xffffffffcccccccc]
+       mov bl,[a32 abs dword es:0xffffffffcccccccc]
+       mov ax,[a32 abs dword es:0xffffffffcccccccc]
+       mov bx,[a32 abs dword es:0xffffffffcccccccc]
+       mov eax,[a32 abs dword es:0xffffffffcccccccc]
+       mov ebx,[a32 abs dword es:0xffffffffcccccccc]
+       mov rax,[a32 abs dword es:0xffffffffcccccccc]
+       mov rbx,[a32 abs dword es:0xffffffffcccccccc]
+
+       mov al,[a32 abs qword es:foo]
+       mov bl,[a32 abs qword es:foo]
+       mov ax,[a32 abs qword es:foo]
+       mov bx,[a32 abs qword es:foo]
+       mov eax,[a32 abs qword es:foo]
+       mov ebx,[a32 abs qword es:foo]
+       mov rax,[a32 abs qword es:foo]
+       mov rbx,[a32 abs qword es:foo]
+       mov al,[a32 abs qword es:0xaaaaaaaaaaaaaaaa]
+       mov bl,[a32 abs qword es:0xaaaaaaaaaaaaaaaa]
+       mov ax,[a32 abs qword es:0xaaaaaaaaaaaaaaaa]
+       mov bx,[a32 abs qword es:0xaaaaaaaaaaaaaaaa]
+       mov eax,[a32 abs qword es:0xaaaaaaaaaaaaaaaa]
+       mov ebx,[a32 abs qword es:0xaaaaaaaaaaaaaaaa]
+       mov rax,[a32 abs qword es:0xaaaaaaaaaaaaaaaa]
+       mov rbx,[a32 abs qword es:0xaaaaaaaaaaaaaaaa]
+       mov al,[a32 abs qword es:0xbbbbbbbb]
+       mov bl,[a32 abs qword es:0xbbbbbbbb]
+       mov ax,[a32 abs qword es:0xbbbbbbbb]
+       mov bx,[a32 abs qword es:0xbbbbbbbb]
+       mov eax,[a32 abs qword es:0xbbbbbbbb]
+       mov ebx,[a32 abs qword es:0xbbbbbbbb]
+       mov rax,[a32 abs qword es:0xbbbbbbbb]
+       mov rbx,[a32 abs qword es:0xbbbbbbbb]
+       mov al,[a32 abs qword es:0xffffffffcccccccc]
+       mov bl,[a32 abs qword es:0xffffffffcccccccc]
+       mov ax,[a32 abs qword es:0xffffffffcccccccc]
+       mov bx,[a32 abs qword es:0xffffffffcccccccc]
+       mov eax,[a32 abs qword es:0xffffffffcccccccc]
+       mov ebx,[a32 abs qword es:0xffffffffcccccccc]
+       mov rax,[a32 abs qword es:0xffffffffcccccccc]
+       mov rbx,[a32 abs qword es:0xffffffffcccccccc]
+
+       mov al,[rel es:foo]
+       mov bl,[rel es:foo]
+       mov ax,[rel es:foo]
+       mov bx,[rel es:foo]
+       mov eax,[rel es:foo]
+       mov ebx,[rel es:foo]
+       mov rax,[rel es:foo]
+       mov rbx,[rel es:foo]
+       mov al,[rel es:0xaaaaaaaaaaaaaaaa]
+       mov bl,[rel es:0xaaaaaaaaaaaaaaaa]
+       mov ax,[rel es:0xaaaaaaaaaaaaaaaa]
+       mov bx,[rel es:0xaaaaaaaaaaaaaaaa]
+       mov eax,[rel es:0xaaaaaaaaaaaaaaaa]
+       mov ebx,[rel es:0xaaaaaaaaaaaaaaaa]
+       mov rax,[rel es:0xaaaaaaaaaaaaaaaa]
+       mov rbx,[rel es:0xaaaaaaaaaaaaaaaa]
+       mov al,[rel es:0xbbbbbbbb]
+       mov bl,[rel es:0xbbbbbbbb]
+       mov ax,[rel es:0xbbbbbbbb]
+       mov bx,[rel es:0xbbbbbbbb]
+       mov eax,[rel es:0xbbbbbbbb]
+       mov ebx,[rel es:0xbbbbbbbb]
+       mov rax,[rel es:0xbbbbbbbb]
+       mov rbx,[rel es:0xbbbbbbbb]
+       mov al,[rel es:0xffffffffcccccccc]
+       mov bl,[rel es:0xffffffffcccccccc]
+       mov ax,[rel es:0xffffffffcccccccc]
+       mov bx,[rel es:0xffffffffcccccccc]
+       mov eax,[rel es:0xffffffffcccccccc]
+       mov ebx,[rel es:0xffffffffcccccccc]
+       mov rax,[rel es:0xffffffffcccccccc]
+       mov rbx,[rel es:0xffffffffcccccccc]
+
+       mov al,[rel dword es:foo]
+       mov bl,[rel dword es:foo]
+       mov ax,[rel dword es:foo]
+       mov bx,[rel dword es:foo]
+       mov eax,[rel dword es:foo]
+       mov ebx,[rel dword es:foo]
+       mov rax,[rel dword es:foo]
+       mov rbx,[rel dword es:foo]
+       mov al,[rel dword es:0xaaaaaaaaaaaaaaaa]
+       mov bl,[rel dword es:0xaaaaaaaaaaaaaaaa]
+       mov ax,[rel dword es:0xaaaaaaaaaaaaaaaa]
+       mov bx,[rel dword es:0xaaaaaaaaaaaaaaaa]
+       mov eax,[rel dword es:0xaaaaaaaaaaaaaaaa]
+       mov ebx,[rel dword es:0xaaaaaaaaaaaaaaaa]
+       mov rax,[rel dword es:0xaaaaaaaaaaaaaaaa]
+       mov rbx,[rel dword es:0xaaaaaaaaaaaaaaaa]
+       mov al,[rel dword es:0xbbbbbbbb]
+       mov bl,[rel dword es:0xbbbbbbbb]
+       mov ax,[rel dword es:0xbbbbbbbb]
+       mov bx,[rel dword es:0xbbbbbbbb]
+       mov eax,[rel dword es:0xbbbbbbbb]
+       mov ebx,[rel dword es:0xbbbbbbbb]
+       mov rax,[rel dword es:0xbbbbbbbb]
+       mov rbx,[rel dword es:0xbbbbbbbb]
+       mov al,[rel dword es:0xffffffffcccccccc]
+       mov bl,[rel dword es:0xffffffffcccccccc]
+       mov ax,[rel dword es:0xffffffffcccccccc]
+       mov bx,[rel dword es:0xffffffffcccccccc]
+       mov eax,[rel dword es:0xffffffffcccccccc]
+       mov ebx,[rel dword es:0xffffffffcccccccc]
+       mov rax,[rel dword es:0xffffffffcccccccc]
+       mov rbx,[rel dword es:0xffffffffcccccccc]
+
+       mov al,[rel qword es:foo]
+       mov bl,[rel qword es:foo]
+       mov ax,[rel qword es:foo]
+       mov bx,[rel qword es:foo]
+       mov eax,[rel qword es:foo]
+       mov ebx,[rel qword es:foo]
+       mov rax,[rel qword es:foo]
+       mov rbx,[rel qword es:foo]
+       mov al,[rel qword es:0xaaaaaaaaaaaaaaaa]
+       mov bl,[rel qword es:0xaaaaaaaaaaaaaaaa]
+       mov ax,[rel qword es:0xaaaaaaaaaaaaaaaa]
+       mov bx,[rel qword es:0xaaaaaaaaaaaaaaaa]
+       mov eax,[rel qword es:0xaaaaaaaaaaaaaaaa]
+       mov ebx,[rel qword es:0xaaaaaaaaaaaaaaaa]
+       mov rax,[rel qword es:0xaaaaaaaaaaaaaaaa]
+       mov rbx,[rel qword es:0xaaaaaaaaaaaaaaaa]
+       mov al,[rel qword es:0xbbbbbbbb]
+       mov bl,[rel qword es:0xbbbbbbbb]
+       mov ax,[rel qword es:0xbbbbbbbb]
+       mov bx,[rel qword es:0xbbbbbbbb]
+       mov eax,[rel qword es:0xbbbbbbbb]
+       mov ebx,[rel qword es:0xbbbbbbbb]
+       mov rax,[rel qword es:0xbbbbbbbb]
+       mov rbx,[rel qword es:0xbbbbbbbb]
+       mov al,[rel qword es:0xffffffffcccccccc]
+       mov bl,[rel qword es:0xffffffffcccccccc]
+       mov ax,[rel qword es:0xffffffffcccccccc]
+       mov bx,[rel qword es:0xffffffffcccccccc]
+       mov eax,[rel qword es:0xffffffffcccccccc]
+       mov ebx,[rel qword es:0xffffffffcccccccc]
+       mov rax,[rel qword es:0xffffffffcccccccc]
+       mov rbx,[rel qword es:0xffffffffcccccccc]
+
+       mov al,[a64 rel es:foo]
+       mov bl,[a64 rel es:foo]
+       mov ax,[a64 rel es:foo]
+       mov bx,[a64 rel es:foo]
+       mov eax,[a64 rel es:foo]
+       mov ebx,[a64 rel es:foo]
+       mov rax,[a64 rel es:foo]
+       mov rbx,[a64 rel es:foo]
+       mov al,[a64 rel es:0xaaaaaaaaaaaaaaaa]
+       mov bl,[a64 rel es:0xaaaaaaaaaaaaaaaa]
+       mov ax,[a64 rel es:0xaaaaaaaaaaaaaaaa]
+       mov bx,[a64 rel es:0xaaaaaaaaaaaaaaaa]
+       mov eax,[a64 rel es:0xaaaaaaaaaaaaaaaa]
+       mov ebx,[a64 rel es:0xaaaaaaaaaaaaaaaa]
+       mov rax,[a64 rel es:0xaaaaaaaaaaaaaaaa]
+       mov rbx,[a64 rel es:0xaaaaaaaaaaaaaaaa]
+       mov al,[a64 rel es:0xbbbbbbbb]
+       mov bl,[a64 rel es:0xbbbbbbbb]
+       mov ax,[a64 rel es:0xbbbbbbbb]
+       mov bx,[a64 rel es:0xbbbbbbbb]
+       mov eax,[a64 rel es:0xbbbbbbbb]
+       mov ebx,[a64 rel es:0xbbbbbbbb]
+       mov rax,[a64 rel es:0xbbbbbbbb]
+       mov rbx,[a64 rel es:0xbbbbbbbb]
+       mov al,[a64 rel es:0xffffffffcccccccc]
+       mov bl,[a64 rel es:0xffffffffcccccccc]
+       mov ax,[a64 rel es:0xffffffffcccccccc]
+       mov bx,[a64 rel es:0xffffffffcccccccc]
+       mov eax,[a64 rel es:0xffffffffcccccccc]
+       mov ebx,[a64 rel es:0xffffffffcccccccc]
+       mov rax,[a64 rel es:0xffffffffcccccccc]
+       mov rbx,[a64 rel es:0xffffffffcccccccc]
+
+       mov al,[a64 rel dword es:foo]
+       mov bl,[a64 rel dword es:foo]
+       mov ax,[a64 rel dword es:foo]
+       mov bx,[a64 rel dword es:foo]
+       mov eax,[a64 rel dword es:foo]
+       mov ebx,[a64 rel dword es:foo]
+       mov rax,[a64 rel dword es:foo]
+       mov rbx,[a64 rel dword es:foo]
+       mov al,[a64 rel dword es:0xaaaaaaaaaaaaaaaa]
+       mov bl,[a64 rel dword es:0xaaaaaaaaaaaaaaaa]
+       mov ax,[a64 rel dword es:0xaaaaaaaaaaaaaaaa]
+       mov bx,[a64 rel dword es:0xaaaaaaaaaaaaaaaa]
+       mov eax,[a64 rel dword es:0xaaaaaaaaaaaaaaaa]
+       mov ebx,[a64 rel dword es:0xaaaaaaaaaaaaaaaa]
+       mov rax,[a64 rel dword es:0xaaaaaaaaaaaaaaaa]
+       mov rbx,[a64 rel dword es:0xaaaaaaaaaaaaaaaa]
+       mov al,[a64 rel dword es:0xbbbbbbbb]
+       mov bl,[a64 rel dword es:0xbbbbbbbb]
+       mov ax,[a64 rel dword es:0xbbbbbbbb]
+       mov bx,[a64 rel dword es:0xbbbbbbbb]
+       mov eax,[a64 rel dword es:0xbbbbbbbb]
+       mov ebx,[a64 rel dword es:0xbbbbbbbb]
+       mov rax,[a64 rel dword es:0xbbbbbbbb]
+       mov rbx,[a64 rel dword es:0xbbbbbbbb]
+       mov al,[a64 rel dword es:0xffffffffcccccccc]
+       mov bl,[a64 rel dword es:0xffffffffcccccccc]
+       mov ax,[a64 rel dword es:0xffffffffcccccccc]
+       mov bx,[a64 rel dword es:0xffffffffcccccccc]
+       mov eax,[a64 rel dword es:0xffffffffcccccccc]
+       mov ebx,[a64 rel dword es:0xffffffffcccccccc]
+       mov rax,[a64 rel dword es:0xffffffffcccccccc]
+       mov rbx,[a64 rel dword es:0xffffffffcccccccc]
+
+       mov al,[a64 rel qword es:foo]
+       mov bl,[a64 rel qword es:foo]
+       mov ax,[a64 rel qword es:foo]
+       mov bx,[a64 rel qword es:foo]
+       mov eax,[a64 rel qword es:foo]
+       mov ebx,[a64 rel qword es:foo]
+       mov rax,[a64 rel qword es:foo]
+       mov rbx,[a64 rel qword es:foo]
+       mov al,[a64 rel qword es:0xaaaaaaaaaaaaaaaa]
+       mov bl,[a64 rel qword es:0xaaaaaaaaaaaaaaaa]
+       mov ax,[a64 rel qword es:0xaaaaaaaaaaaaaaaa]
+       mov bx,[a64 rel qword es:0xaaaaaaaaaaaaaaaa]
+       mov eax,[a64 rel qword es:0xaaaaaaaaaaaaaaaa]
+       mov ebx,[a64 rel qword es:0xaaaaaaaaaaaaaaaa]
+       mov rax,[a64 rel qword es:0xaaaaaaaaaaaaaaaa]
+       mov rbx,[a64 rel qword es:0xaaaaaaaaaaaaaaaa]
+       mov al,[a64 rel qword es:0xbbbbbbbb]
+       mov bl,[a64 rel qword es:0xbbbbbbbb]
+       mov ax,[a64 rel qword es:0xbbbbbbbb]
+       mov bx,[a64 rel qword es:0xbbbbbbbb]
+       mov eax,[a64 rel qword es:0xbbbbbbbb]
+       mov ebx,[a64 rel qword es:0xbbbbbbbb]
+       mov rax,[a64 rel qword es:0xbbbbbbbb]
+       mov rbx,[a64 rel qword es:0xbbbbbbbb]
+       mov al,[a64 rel qword es:0xffffffffcccccccc]
+       mov bl,[a64 rel qword es:0xffffffffcccccccc]
+       mov ax,[a64 rel qword es:0xffffffffcccccccc]
+       mov bx,[a64 rel qword es:0xffffffffcccccccc]
+       mov eax,[a64 rel qword es:0xffffffffcccccccc]
+       mov ebx,[a64 rel qword es:0xffffffffcccccccc]
+       mov rax,[a64 rel qword es:0xffffffffcccccccc]
+       mov rbx,[a64 rel qword es:0xffffffffcccccccc]
+
+       mov al,[a32 rel es:foo]
+       mov bl,[a32 rel es:foo]
+       mov ax,[a32 rel es:foo]
+       mov bx,[a32 rel es:foo]
+       mov eax,[a32 rel es:foo]
+       mov ebx,[a32 rel es:foo]
+       mov rax,[a32 rel es:foo]
+       mov rbx,[a32 rel es:foo]
+       mov al,[a32 rel es:0xaaaaaaaaaaaaaaaa]
+       mov bl,[a32 rel es:0xaaaaaaaaaaaaaaaa]
+       mov ax,[a32 rel es:0xaaaaaaaaaaaaaaaa]
+       mov bx,[a32 rel es:0xaaaaaaaaaaaaaaaa]
+       mov eax,[a32 rel es:0xaaaaaaaaaaaaaaaa]
+       mov ebx,[a32 rel es:0xaaaaaaaaaaaaaaaa]
+       mov rax,[a32 rel es:0xaaaaaaaaaaaaaaaa]
+       mov rbx,[a32 rel es:0xaaaaaaaaaaaaaaaa]
+       mov al,[a32 rel es:0xbbbbbbbb]
+       mov bl,[a32 rel es:0xbbbbbbbb]
+       mov ax,[a32 rel es:0xbbbbbbbb]
+       mov bx,[a32 rel es:0xbbbbbbbb]
+       mov eax,[a32 rel es:0xbbbbbbbb]
+       mov ebx,[a32 rel es:0xbbbbbbbb]
+       mov rax,[a32 rel es:0xbbbbbbbb]
+       mov rbx,[a32 rel es:0xbbbbbbbb]
+       mov al,[a32 rel es:0xffffffffcccccccc]
+       mov bl,[a32 rel es:0xffffffffcccccccc]
+       mov ax,[a32 rel es:0xffffffffcccccccc]
+       mov bx,[a32 rel es:0xffffffffcccccccc]
+       mov eax,[a32 rel es:0xffffffffcccccccc]
+       mov ebx,[a32 rel es:0xffffffffcccccccc]
+       mov rax,[a32 rel es:0xffffffffcccccccc]
+       mov rbx,[a32 rel es:0xffffffffcccccccc]
+
+       mov al,[a32 rel dword es:foo]
+       mov bl,[a32 rel dword es:foo]
+       mov ax,[a32 rel dword es:foo]
+       mov bx,[a32 rel dword es:foo]
+       mov eax,[a32 rel dword es:foo]
+       mov ebx,[a32 rel dword es:foo]
+       mov rax,[a32 rel dword es:foo]
+       mov rbx,[a32 rel dword es:foo]
+       mov al,[a32 rel dword es:0xaaaaaaaaaaaaaaaa]
+       mov bl,[a32 rel dword es:0xaaaaaaaaaaaaaaaa]
+       mov ax,[a32 rel dword es:0xaaaaaaaaaaaaaaaa]
+       mov bx,[a32 rel dword es:0xaaaaaaaaaaaaaaaa]
+       mov eax,[a32 rel dword es:0xaaaaaaaaaaaaaaaa]
+       mov ebx,[a32 rel dword es:0xaaaaaaaaaaaaaaaa]
+       mov rax,[a32 rel dword es:0xaaaaaaaaaaaaaaaa]
+       mov rbx,[a32 rel dword es:0xaaaaaaaaaaaaaaaa]
+       mov al,[a32 rel dword es:0xbbbbbbbb]
+       mov bl,[a32 rel dword es:0xbbbbbbbb]
+       mov ax,[a32 rel dword es:0xbbbbbbbb]
+       mov bx,[a32 rel dword es:0xbbbbbbbb]
+       mov eax,[a32 rel dword es:0xbbbbbbbb]
+       mov ebx,[a32 rel dword es:0xbbbbbbbb]
+       mov rax,[a32 rel dword es:0xbbbbbbbb]
+       mov rbx,[a32 rel dword es:0xbbbbbbbb]
+       mov al,[a32 rel dword es:0xffffffffcccccccc]
+       mov bl,[a32 rel dword es:0xffffffffcccccccc]
+       mov ax,[a32 rel dword es:0xffffffffcccccccc]
+       mov bx,[a32 rel dword es:0xffffffffcccccccc]
+       mov eax,[a32 rel dword es:0xffffffffcccccccc]
+       mov ebx,[a32 rel dword es:0xffffffffcccccccc]
+       mov rax,[a32 rel dword es:0xffffffffcccccccc]
+       mov rbx,[a32 rel dword es:0xffffffffcccccccc]
+
+       mov al,[a32 rel qword es:foo]
+       mov bl,[a32 rel qword es:foo]
+       mov ax,[a32 rel qword es:foo]
+       mov bx,[a32 rel qword es:foo]
+       mov eax,[a32 rel qword es:foo]
+       mov ebx,[a32 rel qword es:foo]
+       mov rax,[a32 rel qword es:foo]
+       mov rbx,[a32 rel qword es:foo]
+       mov al,[a32 rel qword es:0xaaaaaaaaaaaaaaaa]
+       mov bl,[a32 rel qword es:0xaaaaaaaaaaaaaaaa]
+       mov ax,[a32 rel qword es:0xaaaaaaaaaaaaaaaa]
+       mov bx,[a32 rel qword es:0xaaaaaaaaaaaaaaaa]
+       mov eax,[a32 rel qword es:0xaaaaaaaaaaaaaaaa]
+       mov ebx,[a32 rel qword es:0xaaaaaaaaaaaaaaaa]
+       mov rax,[a32 rel qword es:0xaaaaaaaaaaaaaaaa]
+       mov rbx,[a32 rel qword es:0xaaaaaaaaaaaaaaaa]
+       mov al,[a32 rel qword es:0xbbbbbbbb]
+       mov bl,[a32 rel qword es:0xbbbbbbbb]
+       mov ax,[a32 rel qword es:0xbbbbbbbb]
+       mov bx,[a32 rel qword es:0xbbbbbbbb]
+       mov eax,[a32 rel qword es:0xbbbbbbbb]
+       mov ebx,[a32 rel qword es:0xbbbbbbbb]
+       mov rax,[a32 rel qword es:0xbbbbbbbb]
+       mov rbx,[a32 rel qword es:0xbbbbbbbb]
+       mov al,[a32 rel qword es:0xffffffffcccccccc]
+       mov bl,[a32 rel qword es:0xffffffffcccccccc]
+       mov ax,[a32 rel qword es:0xffffffffcccccccc]
+       mov bx,[a32 rel qword es:0xffffffffcccccccc]
+       mov eax,[a32 rel qword es:0xffffffffcccccccc]
+       mov ebx,[a32 rel qword es:0xffffffffcccccccc]
+       mov rax,[a32 rel qword es:0xffffffffcccccccc]
+       mov rbx,[a32 rel qword es:0xffffffffcccccccc]
+
+
+       default rel
+
+       mov al,[foo]
+       mov bl,[foo]
+       mov ax,[foo]
+       mov bx,[foo]
+       mov eax,[foo]
+       mov ebx,[foo]
+       mov rax,[foo]
+       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 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,[a64 foo]
+       mov bl,[a64 foo]
+       mov ax,[a64 foo]
+       mov bx,[a64 foo]
+       mov eax,[a64 foo]
+       mov ebx,[a64 foo]
+       mov rax,[a64 foo]
+       mov rbx,[a64 foo]
+       mov al,[a64 0xaaaaaaaaaaaaaaaa]
+       mov bl,[a64 0xaaaaaaaaaaaaaaaa]
+       mov ax,[a64 0xaaaaaaaaaaaaaaaa]
+       mov bx,[a64 0xaaaaaaaaaaaaaaaa]
+       mov eax,[a64 0xaaaaaaaaaaaaaaaa]
+       mov ebx,[a64 0xaaaaaaaaaaaaaaaa]
+       mov rax,[a64 0xaaaaaaaaaaaaaaaa]
+       mov rbx,[a64 0xaaaaaaaaaaaaaaaa]
+       mov al,[a64 0xbbbbbbbb]
+       mov bl,[a64 0xbbbbbbbb]
+       mov ax,[a64 0xbbbbbbbb]
+       mov bx,[a64 0xbbbbbbbb]
+       mov eax,[a64 0xbbbbbbbb]
+       mov ebx,[a64 0xbbbbbbbb]
+       mov rax,[a64 0xbbbbbbbb]
+       mov rbx,[a64 0xbbbbbbbb]
+       mov al,[a64 0xffffffffcccccccc]
+       mov bl,[a64 0xffffffffcccccccc]
+       mov ax,[a64 0xffffffffcccccccc]
+       mov bx,[a64 0xffffffffcccccccc]
+       mov eax,[a64 0xffffffffcccccccc]
+       mov ebx,[a64 0xffffffffcccccccc]
+       mov rax,[a64 0xffffffffcccccccc]
+       mov rbx,[a64 0xffffffffcccccccc]
+
+       mov al,[a64 dword foo]
+       mov bl,[a64 dword foo]
+       mov ax,[a64 dword foo]
+       mov bx,[a64 dword foo]
+       mov eax,[a64 dword foo]
+       mov ebx,[a64 dword foo]
+       mov rax,[a64 dword foo]
+       mov rbx,[a64 dword foo]
+       mov al,[a64 dword 0xaaaaaaaaaaaaaaaa]
+       mov bl,[a64 dword 0xaaaaaaaaaaaaaaaa]
+       mov ax,[a64 dword 0xaaaaaaaaaaaaaaaa]
+       mov bx,[a64 dword 0xaaaaaaaaaaaaaaaa]
+       mov eax,[a64 dword 0xaaaaaaaaaaaaaaaa]
+       mov ebx,[a64 dword 0xaaaaaaaaaaaaaaaa]
+       mov rax,[a64 dword 0xaaaaaaaaaaaaaaaa]
+       mov rbx,[a64 dword 0xaaaaaaaaaaaaaaaa]
+       mov al,[a64 dword 0xbbbbbbbb]
+       mov bl,[a64 dword 0xbbbbbbbb]
+       mov ax,[a64 dword 0xbbbbbbbb]
+       mov bx,[a64 dword 0xbbbbbbbb]
+       mov eax,[a64 dword 0xbbbbbbbb]
+       mov ebx,[a64 dword 0xbbbbbbbb]
+       mov rax,[a64 dword 0xbbbbbbbb]
+       mov rbx,[a64 dword 0xbbbbbbbb]
+       mov al,[a64 dword 0xffffffffcccccccc]
+       mov bl,[a64 dword 0xffffffffcccccccc]
+       mov ax,[a64 dword 0xffffffffcccccccc]
+       mov bx,[a64 dword 0xffffffffcccccccc]
+       mov eax,[a64 dword 0xffffffffcccccccc]
+       mov ebx,[a64 dword 0xffffffffcccccccc]
+       mov rax,[a64 dword 0xffffffffcccccccc]
+       mov rbx,[a64 dword 0xffffffffcccccccc]
+
+       mov al,[a64 qword foo]
+       mov bl,[a64 qword foo]
+       mov ax,[a64 qword foo]
+       mov bx,[a64 qword foo]
+       mov eax,[a64 qword foo]
+       mov ebx,[a64 qword foo]
+       mov rax,[a64 qword foo]
+       mov rbx,[a64 qword foo]
+       mov al,[a64 qword 0xaaaaaaaaaaaaaaaa]
+       mov bl,[a64 qword 0xaaaaaaaaaaaaaaaa]
+       mov ax,[a64 qword 0xaaaaaaaaaaaaaaaa]
+       mov bx,[a64 qword 0xaaaaaaaaaaaaaaaa]
+       mov eax,[a64 qword 0xaaaaaaaaaaaaaaaa]
+       mov ebx,[a64 qword 0xaaaaaaaaaaaaaaaa]
+       mov rax,[a64 qword 0xaaaaaaaaaaaaaaaa]
+       mov rbx,[a64 qword 0xaaaaaaaaaaaaaaaa]
+       mov al,[a64 qword 0xbbbbbbbb]
+       mov bl,[a64 qword 0xbbbbbbbb]
+       mov ax,[a64 qword 0xbbbbbbbb]
+       mov bx,[a64 qword 0xbbbbbbbb]
+       mov eax,[a64 qword 0xbbbbbbbb]
+       mov ebx,[a64 qword 0xbbbbbbbb]
+       mov rax,[a64 qword 0xbbbbbbbb]
+       mov rbx,[a64 qword 0xbbbbbbbb]
+       mov al,[a64 qword 0xffffffffcccccccc]
+       mov bl,[a64 qword 0xffffffffcccccccc]
+       mov ax,[a64 qword 0xffffffffcccccccc]
+       mov bx,[a64 qword 0xffffffffcccccccc]
+       mov eax,[a64 qword 0xffffffffcccccccc]
+       mov ebx,[a64 qword 0xffffffffcccccccc]
+       mov rax,[a64 qword 0xffffffffcccccccc]
+       mov rbx,[a64 qword 0xffffffffcccccccc]
+
+       mov al,[a32 foo]
+       mov bl,[a32 foo]
+       mov ax,[a32 foo]
+       mov bx,[a32 foo]
+       mov eax,[a32 foo]
+       mov ebx,[a32 foo]
+       mov rax,[a32 foo]
+       mov rbx,[a32 foo]
+       mov al,[a32 0xaaaaaaaaaaaaaaaa]
+       mov bl,[a32 0xaaaaaaaaaaaaaaaa]
+       mov ax,[a32 0xaaaaaaaaaaaaaaaa]
+       mov bx,[a32 0xaaaaaaaaaaaaaaaa]
+       mov eax,[a32 0xaaaaaaaaaaaaaaaa]
+       mov ebx,[a32 0xaaaaaaaaaaaaaaaa]
+       mov rax,[a32 0xaaaaaaaaaaaaaaaa]
+       mov rbx,[a32 0xaaaaaaaaaaaaaaaa]
+       mov al,[a32 0xbbbbbbbb]
+       mov bl,[a32 0xbbbbbbbb]
+       mov ax,[a32 0xbbbbbbbb]
+       mov bx,[a32 0xbbbbbbbb]
+       mov eax,[a32 0xbbbbbbbb]
+       mov ebx,[a32 0xbbbbbbbb]
+       mov rax,[a32 0xbbbbbbbb]
+       mov rbx,[a32 0xbbbbbbbb]
+       mov al,[a32 0xffffffffcccccccc]
+       mov bl,[a32 0xffffffffcccccccc]
+       mov ax,[a32 0xffffffffcccccccc]
+       mov bx,[a32 0xffffffffcccccccc]
+       mov eax,[a32 0xffffffffcccccccc]
+       mov ebx,[a32 0xffffffffcccccccc]
+       mov rax,[a32 0xffffffffcccccccc]
+       mov rbx,[a32 0xffffffffcccccccc]
+
+       mov al,[a32 dword foo]
+       mov bl,[a32 dword foo]
+       mov ax,[a32 dword foo]
+       mov bx,[a32 dword foo]
+       mov eax,[a32 dword foo]
+       mov ebx,[a32 dword foo]
+       mov rax,[a32 dword foo]
+       mov rbx,[a32 dword foo]
+       mov al,[a32 dword 0xaaaaaaaaaaaaaaaa]
+       mov bl,[a32 dword 0xaaaaaaaaaaaaaaaa]
+       mov ax,[a32 dword 0xaaaaaaaaaaaaaaaa]
+       mov bx,[a32 dword 0xaaaaaaaaaaaaaaaa]
+       mov eax,[a32 dword 0xaaaaaaaaaaaaaaaa]
+       mov ebx,[a32 dword 0xaaaaaaaaaaaaaaaa]
+       mov rax,[a32 dword 0xaaaaaaaaaaaaaaaa]
+       mov rbx,[a32 dword 0xaaaaaaaaaaaaaaaa]
+       mov al,[a32 dword 0xbbbbbbbb]
+       mov bl,[a32 dword 0xbbbbbbbb]
+       mov ax,[a32 dword 0xbbbbbbbb]
+       mov bx,[a32 dword 0xbbbbbbbb]
+       mov eax,[a32 dword 0xbbbbbbbb]
+       mov ebx,[a32 dword 0xbbbbbbbb]
+       mov rax,[a32 dword 0xbbbbbbbb]
+       mov rbx,[a32 dword 0xbbbbbbbb]
+       mov al,[a32 dword 0xffffffffcccccccc]
+       mov bl,[a32 dword 0xffffffffcccccccc]
+       mov ax,[a32 dword 0xffffffffcccccccc]
+       mov bx,[a32 dword 0xffffffffcccccccc]
+       mov eax,[a32 dword 0xffffffffcccccccc]
+       mov ebx,[a32 dword 0xffffffffcccccccc]
+       mov rax,[a32 dword 0xffffffffcccccccc]
+       mov rbx,[a32 dword 0xffffffffcccccccc]
+
+       mov al,[a32 qword foo]
+       mov bl,[a32 qword foo]
+       mov ax,[a32 qword foo]
+       mov bx,[a32 qword foo]
+       mov eax,[a32 qword foo]
+       mov ebx,[a32 qword foo]
+       mov rax,[a32 qword foo]
+       mov rbx,[a32 qword foo]
+       mov al,[a32 qword 0xaaaaaaaaaaaaaaaa]
+       mov bl,[a32 qword 0xaaaaaaaaaaaaaaaa]
+       mov ax,[a32 qword 0xaaaaaaaaaaaaaaaa]
+       mov bx,[a32 qword 0xaaaaaaaaaaaaaaaa]
+       mov eax,[a32 qword 0xaaaaaaaaaaaaaaaa]
+       mov ebx,[a32 qword 0xaaaaaaaaaaaaaaaa]
+       mov rax,[a32 qword 0xaaaaaaaaaaaaaaaa]
+       mov rbx,[a32 qword 0xaaaaaaaaaaaaaaaa]
+       mov al,[a32 qword 0xbbbbbbbb]
+       mov bl,[a32 qword 0xbbbbbbbb]
+       mov ax,[a32 qword 0xbbbbbbbb]
+       mov bx,[a32 qword 0xbbbbbbbb]
+       mov eax,[a32 qword 0xbbbbbbbb]
+       mov ebx,[a32 qword 0xbbbbbbbb]
+       mov rax,[a32 qword 0xbbbbbbbb]
+       mov rbx,[a32 qword 0xbbbbbbbb]
+       mov al,[a32 qword 0xffffffffcccccccc]
+       mov bl,[a32 qword 0xffffffffcccccccc]
+       mov ax,[a32 qword 0xffffffffcccccccc]
+       mov bx,[a32 qword 0xffffffffcccccccc]
+       mov eax,[a32 qword 0xffffffffcccccccc]
+       mov ebx,[a32 qword 0xffffffffcccccccc]
+       mov rax,[a32 qword 0xffffffffcccccccc]
+       mov rbx,[a32 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,[a64 abs foo]
+       mov bl,[a64 abs foo]
+       mov ax,[a64 abs foo]
+       mov bx,[a64 abs foo]
+       mov eax,[a64 abs foo]
+       mov ebx,[a64 abs foo]
+       mov rax,[a64 abs foo]
+       mov rbx,[a64 abs foo]
+       mov al,[a64 abs 0xaaaaaaaaaaaaaaaa]
+       mov bl,[a64 abs 0xaaaaaaaaaaaaaaaa]
+       mov ax,[a64 abs 0xaaaaaaaaaaaaaaaa]
+       mov bx,[a64 abs 0xaaaaaaaaaaaaaaaa]
+       mov eax,[a64 abs 0xaaaaaaaaaaaaaaaa]
+       mov ebx,[a64 abs 0xaaaaaaaaaaaaaaaa]
+       mov rax,[a64 abs 0xaaaaaaaaaaaaaaaa]
+       mov rbx,[a64 abs 0xaaaaaaaaaaaaaaaa]
+       mov al,[a64 abs 0xbbbbbbbb]
+       mov bl,[a64 abs 0xbbbbbbbb]
+       mov ax,[a64 abs 0xbbbbbbbb]
+       mov bx,[a64 abs 0xbbbbbbbb]
+       mov eax,[a64 abs 0xbbbbbbbb]
+       mov ebx,[a64 abs 0xbbbbbbbb]
+       mov rax,[a64 abs 0xbbbbbbbb]
+       mov rbx,[a64 abs 0xbbbbbbbb]
+       mov al,[a64 abs 0xffffffffcccccccc]
+       mov bl,[a64 abs 0xffffffffcccccccc]
+       mov ax,[a64 abs 0xffffffffcccccccc]
+       mov bx,[a64 abs 0xffffffffcccccccc]
+       mov eax,[a64 abs 0xffffffffcccccccc]
+       mov ebx,[a64 abs 0xffffffffcccccccc]
+       mov rax,[a64 abs 0xffffffffcccccccc]
+       mov rbx,[a64 abs 0xffffffffcccccccc]
+
+       mov al,[a64 abs dword foo]
+       mov bl,[a64 abs dword foo]
+       mov ax,[a64 abs dword foo]
+       mov bx,[a64 abs dword foo]
+       mov eax,[a64 abs dword foo]
+       mov ebx,[a64 abs dword foo]
+       mov rax,[a64 abs dword foo]
+       mov rbx,[a64 abs dword foo]
+       mov al,[a64 abs dword 0xaaaaaaaaaaaaaaaa]
+       mov bl,[a64 abs dword 0xaaaaaaaaaaaaaaaa]
+       mov ax,[a64 abs dword 0xaaaaaaaaaaaaaaaa]
+       mov bx,[a64 abs dword 0xaaaaaaaaaaaaaaaa]
+       mov eax,[a64 abs dword 0xaaaaaaaaaaaaaaaa]
+       mov ebx,[a64 abs dword 0xaaaaaaaaaaaaaaaa]
+       mov rax,[a64 abs dword 0xaaaaaaaaaaaaaaaa]
+       mov rbx,[a64 abs dword 0xaaaaaaaaaaaaaaaa]
+       mov al,[a64 abs dword 0xbbbbbbbb]
+       mov bl,[a64 abs dword 0xbbbbbbbb]
+       mov ax,[a64 abs dword 0xbbbbbbbb]
+       mov bx,[a64 abs dword 0xbbbbbbbb]
+       mov eax,[a64 abs dword 0xbbbbbbbb]
+       mov ebx,[a64 abs dword 0xbbbbbbbb]
+       mov rax,[a64 abs dword 0xbbbbbbbb]
+       mov rbx,[a64 abs dword 0xbbbbbbbb]
+       mov al,[a64 abs dword 0xffffffffcccccccc]
+       mov bl,[a64 abs dword 0xffffffffcccccccc]
+       mov ax,[a64 abs dword 0xffffffffcccccccc]
+       mov bx,[a64 abs dword 0xffffffffcccccccc]
+       mov eax,[a64 abs dword 0xffffffffcccccccc]
+       mov ebx,[a64 abs dword 0xffffffffcccccccc]
+       mov rax,[a64 abs dword 0xffffffffcccccccc]
+       mov rbx,[a64 abs dword 0xffffffffcccccccc]
+
+       mov al,[a64 abs qword foo]
+       mov bl,[a64 abs qword foo]
+       mov ax,[a64 abs qword foo]
+       mov bx,[a64 abs qword foo]
+       mov eax,[a64 abs qword foo]
+       mov ebx,[a64 abs qword foo]
+       mov rax,[a64 abs qword foo]
+       mov rbx,[a64 abs qword foo]
+       mov al,[a64 abs qword 0xaaaaaaaaaaaaaaaa]
+       mov bl,[a64 abs qword 0xaaaaaaaaaaaaaaaa]
+       mov ax,[a64 abs qword 0xaaaaaaaaaaaaaaaa]
+       mov bx,[a64 abs qword 0xaaaaaaaaaaaaaaaa]
+       mov eax,[a64 abs qword 0xaaaaaaaaaaaaaaaa]
+       mov ebx,[a64 abs qword 0xaaaaaaaaaaaaaaaa]
+       mov rax,[a64 abs qword 0xaaaaaaaaaaaaaaaa]
+       mov rbx,[a64 abs qword 0xaaaaaaaaaaaaaaaa]
+       mov al,[a64 abs qword 0xbbbbbbbb]
+       mov bl,[a64 abs qword 0xbbbbbbbb]
+       mov ax,[a64 abs qword 0xbbbbbbbb]
+       mov bx,[a64 abs qword 0xbbbbbbbb]
+       mov eax,[a64 abs qword 0xbbbbbbbb]
+       mov ebx,[a64 abs qword 0xbbbbbbbb]
+       mov rax,[a64 abs qword 0xbbbbbbbb]
+       mov rbx,[a64 abs qword 0xbbbbbbbb]
+       mov al,[a64 abs qword 0xffffffffcccccccc]
+       mov bl,[a64 abs qword 0xffffffffcccccccc]
+       mov ax,[a64 abs qword 0xffffffffcccccccc]
+       mov bx,[a64 abs qword 0xffffffffcccccccc]
+       mov eax,[a64 abs qword 0xffffffffcccccccc]
+       mov ebx,[a64 abs qword 0xffffffffcccccccc]
+       mov rax,[a64 abs qword 0xffffffffcccccccc]
+       mov rbx,[a64 abs qword 0xffffffffcccccccc]
+
+       mov al,[a32 abs foo]
+       mov bl,[a32 abs foo]
+       mov ax,[a32 abs foo]
+       mov bx,[a32 abs foo]
+       mov eax,[a32 abs foo]
+       mov ebx,[a32 abs foo]
+       mov rax,[a32 abs foo]
+       mov rbx,[a32 abs foo]
+       mov al,[a32 abs 0xaaaaaaaaaaaaaaaa]
+       mov bl,[a32 abs 0xaaaaaaaaaaaaaaaa]
+       mov ax,[a32 abs 0xaaaaaaaaaaaaaaaa]
+       mov bx,[a32 abs 0xaaaaaaaaaaaaaaaa]
+       mov eax,[a32 abs 0xaaaaaaaaaaaaaaaa]
+       mov ebx,[a32 abs 0xaaaaaaaaaaaaaaaa]
+       mov rax,[a32 abs 0xaaaaaaaaaaaaaaaa]
+       mov rbx,[a32 abs 0xaaaaaaaaaaaaaaaa]
+       mov al,[a32 abs 0xbbbbbbbb]
+       mov bl,[a32 abs 0xbbbbbbbb]
+       mov ax,[a32 abs 0xbbbbbbbb]
+       mov bx,[a32 abs 0xbbbbbbbb]
+       mov eax,[a32 abs 0xbbbbbbbb]
+       mov ebx,[a32 abs 0xbbbbbbbb]
+       mov rax,[a32 abs 0xbbbbbbbb]
+       mov rbx,[a32 abs 0xbbbbbbbb]
+       mov al,[a32 abs 0xffffffffcccccccc]
+       mov bl,[a32 abs 0xffffffffcccccccc]
+       mov ax,[a32 abs 0xffffffffcccccccc]
+       mov bx,[a32 abs 0xffffffffcccccccc]
+       mov eax,[a32 abs 0xffffffffcccccccc]
+       mov ebx,[a32 abs 0xffffffffcccccccc]
+       mov rax,[a32 abs 0xffffffffcccccccc]
+       mov rbx,[a32 abs 0xffffffffcccccccc]
+
+       mov al,[a32 abs dword foo]
+       mov bl,[a32 abs dword foo]
+       mov ax,[a32 abs dword foo]
+       mov bx,[a32 abs dword foo]
+       mov eax,[a32 abs dword foo]
+       mov ebx,[a32 abs dword foo]
+       mov rax,[a32 abs dword foo]
+       mov rbx,[a32 abs dword foo]
+       mov al,[a32 abs dword 0xaaaaaaaaaaaaaaaa]
+       mov bl,[a32 abs dword 0xaaaaaaaaaaaaaaaa]
+       mov ax,[a32 abs dword 0xaaaaaaaaaaaaaaaa]
+       mov bx,[a32 abs dword 0xaaaaaaaaaaaaaaaa]
+       mov eax,[a32 abs dword 0xaaaaaaaaaaaaaaaa]
+       mov ebx,[a32 abs dword 0xaaaaaaaaaaaaaaaa]
+       mov rax,[a32 abs dword 0xaaaaaaaaaaaaaaaa]
+       mov rbx,[a32 abs dword 0xaaaaaaaaaaaaaaaa]
+       mov al,[a32 abs dword 0xbbbbbbbb]
+       mov bl,[a32 abs dword 0xbbbbbbbb]
+       mov ax,[a32 abs dword 0xbbbbbbbb]
+       mov bx,[a32 abs dword 0xbbbbbbbb]
+       mov eax,[a32 abs dword 0xbbbbbbbb]
+       mov ebx,[a32 abs dword 0xbbbbbbbb]
+       mov rax,[a32 abs dword 0xbbbbbbbb]
+       mov rbx,[a32 abs dword 0xbbbbbbbb]
+       mov al,[a32 abs dword 0xffffffffcccccccc]
+       mov bl,[a32 abs dword 0xffffffffcccccccc]
+       mov ax,[a32 abs dword 0xffffffffcccccccc]
+       mov bx,[a32 abs dword 0xffffffffcccccccc]
+       mov eax,[a32 abs dword 0xffffffffcccccccc]
+       mov ebx,[a32 abs dword 0xffffffffcccccccc]
+       mov rax,[a32 abs dword 0xffffffffcccccccc]
+       mov rbx,[a32 abs dword 0xffffffffcccccccc]
+
+       mov al,[a32 abs qword foo]
+       mov bl,[a32 abs qword foo]
+       mov ax,[a32 abs qword foo]
+       mov bx,[a32 abs qword foo]
+       mov eax,[a32 abs qword foo]
+       mov ebx,[a32 abs qword foo]
+       mov rax,[a32 abs qword foo]
+       mov rbx,[a32 abs qword foo]
+       mov al,[a32 abs qword 0xaaaaaaaaaaaaaaaa]
+       mov bl,[a32 abs qword 0xaaaaaaaaaaaaaaaa]
+       mov ax,[a32 abs qword 0xaaaaaaaaaaaaaaaa]
+       mov bx,[a32 abs qword 0xaaaaaaaaaaaaaaaa]
+       mov eax,[a32 abs qword 0xaaaaaaaaaaaaaaaa]
+       mov ebx,[a32 abs qword 0xaaaaaaaaaaaaaaaa]
+       mov rax,[a32 abs qword 0xaaaaaaaaaaaaaaaa]
+       mov rbx,[a32 abs qword 0xaaaaaaaaaaaaaaaa]
+       mov al,[a32 abs qword 0xbbbbbbbb]
+       mov bl,[a32 abs qword 0xbbbbbbbb]
+       mov ax,[a32 abs qword 0xbbbbbbbb]
+       mov bx,[a32 abs qword 0xbbbbbbbb]
+       mov eax,[a32 abs qword 0xbbbbbbbb]
+       mov ebx,[a32 abs qword 0xbbbbbbbb]
+       mov rax,[a32 abs qword 0xbbbbbbbb]
+       mov rbx,[a32 abs qword 0xbbbbbbbb]
+       mov al,[a32 abs qword 0xffffffffcccccccc]
+       mov bl,[a32 abs qword 0xffffffffcccccccc]
+       mov ax,[a32 abs qword 0xffffffffcccccccc]
+       mov bx,[a32 abs qword 0xffffffffcccccccc]
+       mov eax,[a32 abs qword 0xffffffffcccccccc]
+       mov ebx,[a32 abs qword 0xffffffffcccccccc]
+       mov rax,[a32 abs qword 0xffffffffcccccccc]
+       mov rbx,[a32 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 al,[a64 rel foo]
+       mov bl,[a64 rel foo]
+       mov ax,[a64 rel foo]
+       mov bx,[a64 rel foo]
+       mov eax,[a64 rel foo]
+       mov ebx,[a64 rel foo]
+       mov rax,[a64 rel foo]
+       mov rbx,[a64 rel foo]
+       mov al,[a64 rel 0xaaaaaaaaaaaaaaaa]
+       mov bl,[a64 rel 0xaaaaaaaaaaaaaaaa]
+       mov ax,[a64 rel 0xaaaaaaaaaaaaaaaa]
+       mov bx,[a64 rel 0xaaaaaaaaaaaaaaaa]
+       mov eax,[a64 rel 0xaaaaaaaaaaaaaaaa]
+       mov ebx,[a64 rel 0xaaaaaaaaaaaaaaaa]
+       mov rax,[a64 rel 0xaaaaaaaaaaaaaaaa]
+       mov rbx,[a64 rel 0xaaaaaaaaaaaaaaaa]
+       mov al,[a64 rel 0xbbbbbbbb]
+       mov bl,[a64 rel 0xbbbbbbbb]
+       mov ax,[a64 rel 0xbbbbbbbb]
+       mov bx,[a64 rel 0xbbbbbbbb]
+       mov eax,[a64 rel 0xbbbbbbbb]
+       mov ebx,[a64 rel 0xbbbbbbbb]
+       mov rax,[a64 rel 0xbbbbbbbb]
+       mov rbx,[a64 rel 0xbbbbbbbb]
+       mov al,[a64 rel 0xffffffffcccccccc]
+       mov bl,[a64 rel 0xffffffffcccccccc]
+       mov ax,[a64 rel 0xffffffffcccccccc]
+       mov bx,[a64 rel 0xffffffffcccccccc]
+       mov eax,[a64 rel 0xffffffffcccccccc]
+       mov ebx,[a64 rel 0xffffffffcccccccc]
+       mov rax,[a64 rel 0xffffffffcccccccc]
+       mov rbx,[a64 rel 0xffffffffcccccccc]
+
+       mov al,[a64 rel dword foo]
+       mov bl,[a64 rel dword foo]
+       mov ax,[a64 rel dword foo]
+       mov bx,[a64 rel dword foo]
+       mov eax,[a64 rel dword foo]
+       mov ebx,[a64 rel dword foo]
+       mov rax,[a64 rel dword foo]
+       mov rbx,[a64 rel dword foo]
+       mov al,[a64 rel dword 0xaaaaaaaaaaaaaaaa]
+       mov bl,[a64 rel dword 0xaaaaaaaaaaaaaaaa]
+       mov ax,[a64 rel dword 0xaaaaaaaaaaaaaaaa]
+       mov bx,[a64 rel dword 0xaaaaaaaaaaaaaaaa]
+       mov eax,[a64 rel dword 0xaaaaaaaaaaaaaaaa]
+       mov ebx,[a64 rel dword 0xaaaaaaaaaaaaaaaa]
+       mov rax,[a64 rel dword 0xaaaaaaaaaaaaaaaa]
+       mov rbx,[a64 rel dword 0xaaaaaaaaaaaaaaaa]
+       mov al,[a64 rel dword 0xbbbbbbbb]
+       mov bl,[a64 rel dword 0xbbbbbbbb]
+       mov ax,[a64 rel dword 0xbbbbbbbb]
+       mov bx,[a64 rel dword 0xbbbbbbbb]
+       mov eax,[a64 rel dword 0xbbbbbbbb]
+       mov ebx,[a64 rel dword 0xbbbbbbbb]
+       mov rax,[a64 rel dword 0xbbbbbbbb]
+       mov rbx,[a64 rel dword 0xbbbbbbbb]
+       mov al,[a64 rel dword 0xffffffffcccccccc]
+       mov bl,[a64 rel dword 0xffffffffcccccccc]
+       mov ax,[a64 rel dword 0xffffffffcccccccc]
+       mov bx,[a64 rel dword 0xffffffffcccccccc]
+       mov eax,[a64 rel dword 0xffffffffcccccccc]
+       mov ebx,[a64 rel dword 0xffffffffcccccccc]
+       mov rax,[a64 rel dword 0xffffffffcccccccc]
+       mov rbx,[a64 rel dword 0xffffffffcccccccc]
+
+       mov al,[a64 rel qword foo]
+       mov bl,[a64 rel qword foo]
+       mov ax,[a64 rel qword foo]
+       mov bx,[a64 rel qword foo]
+       mov eax,[a64 rel qword foo]
+       mov ebx,[a64 rel qword foo]
+       mov rax,[a64 rel qword foo]
+       mov rbx,[a64 rel qword foo]
+       mov al,[a64 rel qword 0xaaaaaaaaaaaaaaaa]
+       mov bl,[a64 rel qword 0xaaaaaaaaaaaaaaaa]
+       mov ax,[a64 rel qword 0xaaaaaaaaaaaaaaaa]
+       mov bx,[a64 rel qword 0xaaaaaaaaaaaaaaaa]
+       mov eax,[a64 rel qword 0xaaaaaaaaaaaaaaaa]
+       mov ebx,[a64 rel qword 0xaaaaaaaaaaaaaaaa]
+       mov rax,[a64 rel qword 0xaaaaaaaaaaaaaaaa]
+       mov rbx,[a64 rel qword 0xaaaaaaaaaaaaaaaa]
+       mov al,[a64 rel qword 0xbbbbbbbb]
+       mov bl,[a64 rel qword 0xbbbbbbbb]
+       mov ax,[a64 rel qword 0xbbbbbbbb]
+       mov bx,[a64 rel qword 0xbbbbbbbb]
+       mov eax,[a64 rel qword 0xbbbbbbbb]
+       mov ebx,[a64 rel qword 0xbbbbbbbb]
+       mov rax,[a64 rel qword 0xbbbbbbbb]
+       mov rbx,[a64 rel qword 0xbbbbbbbb]
+       mov al,[a64 rel qword 0xffffffffcccccccc]
+       mov bl,[a64 rel qword 0xffffffffcccccccc]
+       mov ax,[a64 rel qword 0xffffffffcccccccc]
+       mov bx,[a64 rel qword 0xffffffffcccccccc]
+       mov eax,[a64 rel qword 0xffffffffcccccccc]
+       mov ebx,[a64 rel qword 0xffffffffcccccccc]
+       mov rax,[a64 rel qword 0xffffffffcccccccc]
+       mov rbx,[a64 rel qword 0xffffffffcccccccc]
+
+       mov al,[a32 rel foo]
+       mov bl,[a32 rel foo]
+       mov ax,[a32 rel foo]
+       mov bx,[a32 rel foo]
+       mov eax,[a32 rel foo]
+       mov ebx,[a32 rel foo]
+       mov rax,[a32 rel foo]
+       mov rbx,[a32 rel foo]
+       mov al,[a32 rel 0xaaaaaaaaaaaaaaaa]
+       mov bl,[a32 rel 0xaaaaaaaaaaaaaaaa]
+       mov ax,[a32 rel 0xaaaaaaaaaaaaaaaa]
+       mov bx,[a32 rel 0xaaaaaaaaaaaaaaaa]
+       mov eax,[a32 rel 0xaaaaaaaaaaaaaaaa]
+       mov ebx,[a32 rel 0xaaaaaaaaaaaaaaaa]
+       mov rax,[a32 rel 0xaaaaaaaaaaaaaaaa]
+       mov rbx,[a32 rel 0xaaaaaaaaaaaaaaaa]
+       mov al,[a32 rel 0xbbbbbbbb]
+       mov bl,[a32 rel 0xbbbbbbbb]
+       mov ax,[a32 rel 0xbbbbbbbb]
+       mov bx,[a32 rel 0xbbbbbbbb]
+       mov eax,[a32 rel 0xbbbbbbbb]
+       mov ebx,[a32 rel 0xbbbbbbbb]
+       mov rax,[a32 rel 0xbbbbbbbb]
+       mov rbx,[a32 rel 0xbbbbbbbb]
+       mov al,[a32 rel 0xffffffffcccccccc]
+       mov bl,[a32 rel 0xffffffffcccccccc]
+       mov ax,[a32 rel 0xffffffffcccccccc]
+       mov bx,[a32 rel 0xffffffffcccccccc]
+       mov eax,[a32 rel 0xffffffffcccccccc]
+       mov ebx,[a32 rel 0xffffffffcccccccc]
+       mov rax,[a32 rel 0xffffffffcccccccc]
+       mov rbx,[a32 rel 0xffffffffcccccccc]
+
+       mov al,[a32 rel dword foo]
+       mov bl,[a32 rel dword foo]
+       mov ax,[a32 rel dword foo]
+       mov bx,[a32 rel dword foo]
+       mov eax,[a32 rel dword foo]
+       mov ebx,[a32 rel dword foo]
+       mov rax,[a32 rel dword foo]
+       mov rbx,[a32 rel dword foo]
+       mov al,[a32 rel dword 0xaaaaaaaaaaaaaaaa]
+       mov bl,[a32 rel dword 0xaaaaaaaaaaaaaaaa]
+       mov ax,[a32 rel dword 0xaaaaaaaaaaaaaaaa]
+       mov bx,[a32 rel dword 0xaaaaaaaaaaaaaaaa]
+       mov eax,[a32 rel dword 0xaaaaaaaaaaaaaaaa]
+       mov ebx,[a32 rel dword 0xaaaaaaaaaaaaaaaa]
+       mov rax,[a32 rel dword 0xaaaaaaaaaaaaaaaa]
+       mov rbx,[a32 rel dword 0xaaaaaaaaaaaaaaaa]
+       mov al,[a32 rel dword 0xbbbbbbbb]
+       mov bl,[a32 rel dword 0xbbbbbbbb]
+       mov ax,[a32 rel dword 0xbbbbbbbb]
+       mov bx,[a32 rel dword 0xbbbbbbbb]
+       mov eax,[a32 rel dword 0xbbbbbbbb]
+       mov ebx,[a32 rel dword 0xbbbbbbbb]
+       mov rax,[a32 rel dword 0xbbbbbbbb]
+       mov rbx,[a32 rel dword 0xbbbbbbbb]
+       mov al,[a32 rel dword 0xffffffffcccccccc]
+       mov bl,[a32 rel dword 0xffffffffcccccccc]
+       mov ax,[a32 rel dword 0xffffffffcccccccc]
+       mov bx,[a32 rel dword 0xffffffffcccccccc]
+       mov eax,[a32 rel dword 0xffffffffcccccccc]
+       mov ebx,[a32 rel dword 0xffffffffcccccccc]
+       mov rax,[a32 rel dword 0xffffffffcccccccc]
+       mov rbx,[a32 rel dword 0xffffffffcccccccc]
+
+       mov al,[a32 rel qword foo]
+       mov bl,[a32 rel qword foo]
+       mov ax,[a32 rel qword foo]
+       mov bx,[a32 rel qword foo]
+       mov eax,[a32 rel qword foo]
+       mov ebx,[a32 rel qword foo]
+       mov rax,[a32 rel qword foo]
+       mov rbx,[a32 rel qword foo]
+       mov al,[a32 rel qword 0xaaaaaaaaaaaaaaaa]
+       mov bl,[a32 rel qword 0xaaaaaaaaaaaaaaaa]
+       mov ax,[a32 rel qword 0xaaaaaaaaaaaaaaaa]
+       mov bx,[a32 rel qword 0xaaaaaaaaaaaaaaaa]
+       mov eax,[a32 rel qword 0xaaaaaaaaaaaaaaaa]
+       mov ebx,[a32 rel qword 0xaaaaaaaaaaaaaaaa]
+       mov rax,[a32 rel qword 0xaaaaaaaaaaaaaaaa]
+       mov rbx,[a32 rel qword 0xaaaaaaaaaaaaaaaa]
+       mov al,[a32 rel qword 0xbbbbbbbb]
+       mov bl,[a32 rel qword 0xbbbbbbbb]
+       mov ax,[a32 rel qword 0xbbbbbbbb]
+       mov bx,[a32 rel qword 0xbbbbbbbb]
+       mov eax,[a32 rel qword 0xbbbbbbbb]
+       mov ebx,[a32 rel qword 0xbbbbbbbb]
+       mov rax,[a32 rel qword 0xbbbbbbbb]
+       mov rbx,[a32 rel qword 0xbbbbbbbb]
+       mov al,[a32 rel qword 0xffffffffcccccccc]
+       mov bl,[a32 rel qword 0xffffffffcccccccc]
+       mov ax,[a32 rel qword 0xffffffffcccccccc]
+       mov bx,[a32 rel qword 0xffffffffcccccccc]
+       mov eax,[a32 rel qword 0xffffffffcccccccc]
+       mov ebx,[a32 rel qword 0xffffffffcccccccc]
+       mov rax,[a32 rel qword 0xffffffffcccccccc]
+       mov rbx,[a32 rel qword 0xffffffffcccccccc]
+
+       mov al,[fs:foo]
+       mov bl,[fs:foo]
+       mov ax,[fs:foo]
+       mov bx,[fs:foo]
+       mov eax,[fs:foo]
+       mov ebx,[fs:foo]
+       mov rax,[fs:foo]
+       mov rbx,[fs:foo]
+       mov al,[fs:0xaaaaaaaaaaaaaaaa]
+       mov bl,[fs:0xaaaaaaaaaaaaaaaa]
+       mov ax,[fs:0xaaaaaaaaaaaaaaaa]
+       mov bx,[fs:0xaaaaaaaaaaaaaaaa]
+       mov eax,[fs:0xaaaaaaaaaaaaaaaa]
+       mov ebx,[fs:0xaaaaaaaaaaaaaaaa]
+       mov rax,[fs:0xaaaaaaaaaaaaaaaa]
+       mov rbx,[fs:0xaaaaaaaaaaaaaaaa]
+       mov al,[fs:0xbbbbbbbb]
+       mov bl,[fs:0xbbbbbbbb]
+       mov ax,[fs:0xbbbbbbbb]
+       mov bx,[fs:0xbbbbbbbb]
+       mov eax,[fs:0xbbbbbbbb]
+       mov ebx,[fs:0xbbbbbbbb]
+       mov rax,[fs:0xbbbbbbbb]
+       mov rbx,[fs:0xbbbbbbbb]
+       mov al,[fs:0xffffffffcccccccc]
+       mov bl,[fs:0xffffffffcccccccc]
+       mov ax,[fs:0xffffffffcccccccc]
+       mov bx,[fs:0xffffffffcccccccc]
+       mov eax,[fs:0xffffffffcccccccc]
+       mov ebx,[fs:0xffffffffcccccccc]
+       mov rax,[fs:0xffffffffcccccccc]
+       mov rbx,[fs:0xffffffffcccccccc]
+
+       mov al,[dword fs:foo]
+       mov bl,[dword fs:foo]
+       mov ax,[dword fs:foo]
+       mov bx,[dword fs:foo]
+       mov eax,[dword fs:foo]
+       mov ebx,[dword fs:foo]
+       mov rax,[dword fs:foo]
+       mov rbx,[dword fs:foo]
+       mov al,[dword fs:0xaaaaaaaaaaaaaaaa]
+       mov bl,[dword fs:0xaaaaaaaaaaaaaaaa]
+       mov ax,[dword fs:0xaaaaaaaaaaaaaaaa]
+       mov bx,[dword fs:0xaaaaaaaaaaaaaaaa]
+       mov eax,[dword fs:0xaaaaaaaaaaaaaaaa]
+       mov ebx,[dword fs:0xaaaaaaaaaaaaaaaa]
+       mov rax,[dword fs:0xaaaaaaaaaaaaaaaa]
+       mov rbx,[dword fs:0xaaaaaaaaaaaaaaaa]
+       mov al,[dword fs:0xbbbbbbbb]
+       mov bl,[dword fs:0xbbbbbbbb]
+       mov ax,[dword fs:0xbbbbbbbb]
+       mov bx,[dword fs:0xbbbbbbbb]
+       mov eax,[dword fs:0xbbbbbbbb]
+       mov ebx,[dword fs:0xbbbbbbbb]
+       mov rax,[dword fs:0xbbbbbbbb]
+       mov rbx,[dword fs:0xbbbbbbbb]
+       mov al,[dword fs:0xffffffffcccccccc]
+       mov bl,[dword fs:0xffffffffcccccccc]
+       mov ax,[dword fs:0xffffffffcccccccc]
+       mov bx,[dword fs:0xffffffffcccccccc]
+       mov eax,[dword fs:0xffffffffcccccccc]
+       mov ebx,[dword fs:0xffffffffcccccccc]
+       mov rax,[dword fs:0xffffffffcccccccc]
+       mov rbx,[dword fs:0xffffffffcccccccc]
+
+       mov al,[qword fs:foo]
+       mov bl,[qword fs:foo]
+       mov ax,[qword fs:foo]
+       mov bx,[qword fs:foo]
+       mov eax,[qword fs:foo]
+       mov ebx,[qword fs:foo]
+       mov rax,[qword fs:foo]
+       mov rbx,[qword fs:foo]
+       mov al,[qword fs:0xaaaaaaaaaaaaaaaa]
+       mov bl,[qword fs:0xaaaaaaaaaaaaaaaa]
+       mov ax,[qword fs:0xaaaaaaaaaaaaaaaa]
+       mov bx,[qword fs:0xaaaaaaaaaaaaaaaa]
+       mov eax,[qword fs:0xaaaaaaaaaaaaaaaa]
+       mov ebx,[qword fs:0xaaaaaaaaaaaaaaaa]
+       mov rax,[qword fs:0xaaaaaaaaaaaaaaaa]
+       mov rbx,[qword fs:0xaaaaaaaaaaaaaaaa]
+       mov al,[qword fs:0xbbbbbbbb]
+       mov bl,[qword fs:0xbbbbbbbb]
+       mov ax,[qword fs:0xbbbbbbbb]
+       mov bx,[qword fs:0xbbbbbbbb]
+       mov eax,[qword fs:0xbbbbbbbb]
+       mov ebx,[qword fs:0xbbbbbbbb]
+       mov rax,[qword fs:0xbbbbbbbb]
+       mov rbx,[qword fs:0xbbbbbbbb]
+       mov al,[qword fs:0xffffffffcccccccc]
+       mov bl,[qword fs:0xffffffffcccccccc]
+       mov ax,[qword fs:0xffffffffcccccccc]
+       mov bx,[qword fs:0xffffffffcccccccc]
+       mov eax,[qword fs:0xffffffffcccccccc]
+       mov ebx,[qword fs:0xffffffffcccccccc]
+       mov rax,[qword fs:0xffffffffcccccccc]
+       mov rbx,[qword fs:0xffffffffcccccccc]
+
+       mov al,[a64 fs:foo]
+       mov bl,[a64 fs:foo]
+       mov ax,[a64 fs:foo]
+       mov bx,[a64 fs:foo]
+       mov eax,[a64 fs:foo]
+       mov ebx,[a64 fs:foo]
+       mov rax,[a64 fs:foo]
+       mov rbx,[a64 fs:foo]
+       mov al,[a64 fs:0xaaaaaaaaaaaaaaaa]
+       mov bl,[a64 fs:0xaaaaaaaaaaaaaaaa]
+       mov ax,[a64 fs:0xaaaaaaaaaaaaaaaa]
+       mov bx,[a64 fs:0xaaaaaaaaaaaaaaaa]
+       mov eax,[a64 fs:0xaaaaaaaaaaaaaaaa]
+       mov ebx,[a64 fs:0xaaaaaaaaaaaaaaaa]
+       mov rax,[a64 fs:0xaaaaaaaaaaaaaaaa]
+       mov rbx,[a64 fs:0xaaaaaaaaaaaaaaaa]
+       mov al,[a64 fs:0xbbbbbbbb]
+       mov bl,[a64 fs:0xbbbbbbbb]
+       mov ax,[a64 fs:0xbbbbbbbb]
+       mov bx,[a64 fs:0xbbbbbbbb]
+       mov eax,[a64 fs:0xbbbbbbbb]
+       mov ebx,[a64 fs:0xbbbbbbbb]
+       mov rax,[a64 fs:0xbbbbbbbb]
+       mov rbx,[a64 fs:0xbbbbbbbb]
+       mov al,[a64 fs:0xffffffffcccccccc]
+       mov bl,[a64 fs:0xffffffffcccccccc]
+       mov ax,[a64 fs:0xffffffffcccccccc]
+       mov bx,[a64 fs:0xffffffffcccccccc]
+       mov eax,[a64 fs:0xffffffffcccccccc]
+       mov ebx,[a64 fs:0xffffffffcccccccc]
+       mov rax,[a64 fs:0xffffffffcccccccc]
+       mov rbx,[a64 fs:0xffffffffcccccccc]
+
+       mov al,[a64 dword fs:foo]
+       mov bl,[a64 dword fs:foo]
+       mov ax,[a64 dword fs:foo]
+       mov bx,[a64 dword fs:foo]
+       mov eax,[a64 dword fs:foo]
+       mov ebx,[a64 dword fs:foo]
+       mov rax,[a64 dword fs:foo]
+       mov rbx,[a64 dword fs:foo]
+       mov al,[a64 dword fs:0xaaaaaaaaaaaaaaaa]
+       mov bl,[a64 dword fs:0xaaaaaaaaaaaaaaaa]
+       mov ax,[a64 dword fs:0xaaaaaaaaaaaaaaaa]
+       mov bx,[a64 dword fs:0xaaaaaaaaaaaaaaaa]
+       mov eax,[a64 dword fs:0xaaaaaaaaaaaaaaaa]
+       mov ebx,[a64 dword fs:0xaaaaaaaaaaaaaaaa]
+       mov rax,[a64 dword fs:0xaaaaaaaaaaaaaaaa]
+       mov rbx,[a64 dword fs:0xaaaaaaaaaaaaaaaa]
+       mov al,[a64 dword fs:0xbbbbbbbb]
+       mov bl,[a64 dword fs:0xbbbbbbbb]
+       mov ax,[a64 dword fs:0xbbbbbbbb]
+       mov bx,[a64 dword fs:0xbbbbbbbb]
+       mov eax,[a64 dword fs:0xbbbbbbbb]
+       mov ebx,[a64 dword fs:0xbbbbbbbb]
+       mov rax,[a64 dword fs:0xbbbbbbbb]
+       mov rbx,[a64 dword fs:0xbbbbbbbb]
+       mov al,[a64 dword fs:0xffffffffcccccccc]
+       mov bl,[a64 dword fs:0xffffffffcccccccc]
+       mov ax,[a64 dword fs:0xffffffffcccccccc]
+       mov bx,[a64 dword fs:0xffffffffcccccccc]
+       mov eax,[a64 dword fs:0xffffffffcccccccc]
+       mov ebx,[a64 dword fs:0xffffffffcccccccc]
+       mov rax,[a64 dword fs:0xffffffffcccccccc]
+       mov rbx,[a64 dword fs:0xffffffffcccccccc]
+
+       mov al,[a64 qword fs:foo]
+       mov bl,[a64 qword fs:foo]
+       mov ax,[a64 qword fs:foo]
+       mov bx,[a64 qword fs:foo]
+       mov eax,[a64 qword fs:foo]
+       mov ebx,[a64 qword fs:foo]
+       mov rax,[a64 qword fs:foo]
+       mov rbx,[a64 qword fs:foo]
+       mov al,[a64 qword fs:0xaaaaaaaaaaaaaaaa]
+       mov bl,[a64 qword fs:0xaaaaaaaaaaaaaaaa]
+       mov ax,[a64 qword fs:0xaaaaaaaaaaaaaaaa]
+       mov bx,[a64 qword fs:0xaaaaaaaaaaaaaaaa]
+       mov eax,[a64 qword fs:0xaaaaaaaaaaaaaaaa]
+       mov ebx,[a64 qword fs:0xaaaaaaaaaaaaaaaa]
+       mov rax,[a64 qword fs:0xaaaaaaaaaaaaaaaa]
+       mov rbx,[a64 qword fs:0xaaaaaaaaaaaaaaaa]
+       mov al,[a64 qword fs:0xbbbbbbbb]
+       mov bl,[a64 qword fs:0xbbbbbbbb]
+       mov ax,[a64 qword fs:0xbbbbbbbb]
+       mov bx,[a64 qword fs:0xbbbbbbbb]
+       mov eax,[a64 qword fs:0xbbbbbbbb]
+       mov ebx,[a64 qword fs:0xbbbbbbbb]
+       mov rax,[a64 qword fs:0xbbbbbbbb]
+       mov rbx,[a64 qword fs:0xbbbbbbbb]
+       mov al,[a64 qword fs:0xffffffffcccccccc]
+       mov bl,[a64 qword fs:0xffffffffcccccccc]
+       mov ax,[a64 qword fs:0xffffffffcccccccc]
+       mov bx,[a64 qword fs:0xffffffffcccccccc]
+       mov eax,[a64 qword fs:0xffffffffcccccccc]
+       mov ebx,[a64 qword fs:0xffffffffcccccccc]
+       mov rax,[a64 qword fs:0xffffffffcccccccc]
+       mov rbx,[a64 qword fs:0xffffffffcccccccc]
+
+       mov al,[a32 fs:foo]
+       mov bl,[a32 fs:foo]
+       mov ax,[a32 fs:foo]
+       mov bx,[a32 fs:foo]
+       mov eax,[a32 fs:foo]
+       mov ebx,[a32 fs:foo]
+       mov rax,[a32 fs:foo]
+       mov rbx,[a32 fs:foo]
+       mov al,[a32 fs:0xaaaaaaaaaaaaaaaa]
+       mov bl,[a32 fs:0xaaaaaaaaaaaaaaaa]
+       mov ax,[a32 fs:0xaaaaaaaaaaaaaaaa]
+       mov bx,[a32 fs:0xaaaaaaaaaaaaaaaa]
+       mov eax,[a32 fs:0xaaaaaaaaaaaaaaaa]
+       mov ebx,[a32 fs:0xaaaaaaaaaaaaaaaa]
+       mov rax,[a32 fs:0xaaaaaaaaaaaaaaaa]
+       mov rbx,[a32 fs:0xaaaaaaaaaaaaaaaa]
+       mov al,[a32 fs:0xbbbbbbbb]
+       mov bl,[a32 fs:0xbbbbbbbb]
+       mov ax,[a32 fs:0xbbbbbbbb]
+       mov bx,[a32 fs:0xbbbbbbbb]
+       mov eax,[a32 fs:0xbbbbbbbb]
+       mov ebx,[a32 fs:0xbbbbbbbb]
+       mov rax,[a32 fs:0xbbbbbbbb]
+       mov rbx,[a32 fs:0xbbbbbbbb]
+       mov al,[a32 fs:0xffffffffcccccccc]
+       mov bl,[a32 fs:0xffffffffcccccccc]
+       mov ax,[a32 fs:0xffffffffcccccccc]
+       mov bx,[a32 fs:0xffffffffcccccccc]
+       mov eax,[a32 fs:0xffffffffcccccccc]
+       mov ebx,[a32 fs:0xffffffffcccccccc]
+       mov rax,[a32 fs:0xffffffffcccccccc]
+       mov rbx,[a32 fs:0xffffffffcccccccc]
+
+       mov al,[a32 dword fs:foo]
+       mov bl,[a32 dword fs:foo]
+       mov ax,[a32 dword fs:foo]
+       mov bx,[a32 dword fs:foo]
+       mov eax,[a32 dword fs:foo]
+       mov ebx,[a32 dword fs:foo]
+       mov rax,[a32 dword fs:foo]
+       mov rbx,[a32 dword fs:foo]
+       mov al,[a32 dword fs:0xaaaaaaaaaaaaaaaa]
+       mov bl,[a32 dword fs:0xaaaaaaaaaaaaaaaa]
+       mov ax,[a32 dword fs:0xaaaaaaaaaaaaaaaa]
+       mov bx,[a32 dword fs:0xaaaaaaaaaaaaaaaa]
+       mov eax,[a32 dword fs:0xaaaaaaaaaaaaaaaa]
+       mov ebx,[a32 dword fs:0xaaaaaaaaaaaaaaaa]
+       mov rax,[a32 dword fs:0xaaaaaaaaaaaaaaaa]
+       mov rbx,[a32 dword fs:0xaaaaaaaaaaaaaaaa]
+       mov al,[a32 dword fs:0xbbbbbbbb]
+       mov bl,[a32 dword fs:0xbbbbbbbb]
+       mov ax,[a32 dword fs:0xbbbbbbbb]
+       mov bx,[a32 dword fs:0xbbbbbbbb]
+       mov eax,[a32 dword fs:0xbbbbbbbb]
+       mov ebx,[a32 dword fs:0xbbbbbbbb]
+       mov rax,[a32 dword fs:0xbbbbbbbb]
+       mov rbx,[a32 dword fs:0xbbbbbbbb]
+       mov al,[a32 dword fs:0xffffffffcccccccc]
+       mov bl,[a32 dword fs:0xffffffffcccccccc]
+       mov ax,[a32 dword fs:0xffffffffcccccccc]
+       mov bx,[a32 dword fs:0xffffffffcccccccc]
+       mov eax,[a32 dword fs:0xffffffffcccccccc]
+       mov ebx,[a32 dword fs:0xffffffffcccccccc]
+       mov rax,[a32 dword fs:0xffffffffcccccccc]
+       mov rbx,[a32 dword fs:0xffffffffcccccccc]
+
+       mov al,[a32 qword fs:foo]
+       mov bl,[a32 qword fs:foo]
+       mov ax,[a32 qword fs:foo]
+       mov bx,[a32 qword fs:foo]
+       mov eax,[a32 qword fs:foo]
+       mov ebx,[a32 qword fs:foo]
+       mov rax,[a32 qword fs:foo]
+       mov rbx,[a32 qword fs:foo]
+       mov al,[a32 qword fs:0xaaaaaaaaaaaaaaaa]
+       mov bl,[a32 qword fs:0xaaaaaaaaaaaaaaaa]
+       mov ax,[a32 qword fs:0xaaaaaaaaaaaaaaaa]
+       mov bx,[a32 qword fs:0xaaaaaaaaaaaaaaaa]
+       mov eax,[a32 qword fs:0xaaaaaaaaaaaaaaaa]
+       mov ebx,[a32 qword fs:0xaaaaaaaaaaaaaaaa]
+       mov rax,[a32 qword fs:0xaaaaaaaaaaaaaaaa]
+       mov rbx,[a32 qword fs:0xaaaaaaaaaaaaaaaa]
+       mov al,[a32 qword fs:0xbbbbbbbb]
+       mov bl,[a32 qword fs:0xbbbbbbbb]
+       mov ax,[a32 qword fs:0xbbbbbbbb]
+       mov bx,[a32 qword fs:0xbbbbbbbb]
+       mov eax,[a32 qword fs:0xbbbbbbbb]
+       mov ebx,[a32 qword fs:0xbbbbbbbb]
+       mov rax,[a32 qword fs:0xbbbbbbbb]
+       mov rbx,[a32 qword fs:0xbbbbbbbb]
+       mov al,[a32 qword fs:0xffffffffcccccccc]
+       mov bl,[a32 qword fs:0xffffffffcccccccc]
+       mov ax,[a32 qword fs:0xffffffffcccccccc]
+       mov bx,[a32 qword fs:0xffffffffcccccccc]
+       mov eax,[a32 qword fs:0xffffffffcccccccc]
+       mov ebx,[a32 qword fs:0xffffffffcccccccc]
+       mov rax,[a32 qword fs:0xffffffffcccccccc]
+       mov rbx,[a32 qword fs:0xffffffffcccccccc]
+
+       mov al,[abs fs:foo]
+       mov bl,[abs fs:foo]
+       mov ax,[abs fs:foo]
+       mov bx,[abs fs:foo]
+       mov eax,[abs fs:foo]
+       mov ebx,[abs fs:foo]
+       mov rax,[abs fs:foo]
+       mov rbx,[abs fs:foo]
+       mov al,[abs fs:0xaaaaaaaaaaaaaaaa]
+       mov bl,[abs fs:0xaaaaaaaaaaaaaaaa]
+       mov ax,[abs fs:0xaaaaaaaaaaaaaaaa]
+       mov bx,[abs fs:0xaaaaaaaaaaaaaaaa]
+       mov eax,[abs fs:0xaaaaaaaaaaaaaaaa]
+       mov ebx,[abs fs:0xaaaaaaaaaaaaaaaa]
+       mov rax,[abs fs:0xaaaaaaaaaaaaaaaa]
+       mov rbx,[abs fs:0xaaaaaaaaaaaaaaaa]
+       mov al,[abs fs:0xbbbbbbbb]
+       mov bl,[abs fs:0xbbbbbbbb]
+       mov ax,[abs fs:0xbbbbbbbb]
+       mov bx,[abs fs:0xbbbbbbbb]
+       mov eax,[abs fs:0xbbbbbbbb]
+       mov ebx,[abs fs:0xbbbbbbbb]
+       mov rax,[abs fs:0xbbbbbbbb]
+       mov rbx,[abs fs:0xbbbbbbbb]
+       mov al,[abs fs:0xffffffffcccccccc]
+       mov bl,[abs fs:0xffffffffcccccccc]
+       mov ax,[abs fs:0xffffffffcccccccc]
+       mov bx,[abs fs:0xffffffffcccccccc]
+       mov eax,[abs fs:0xffffffffcccccccc]
+       mov ebx,[abs fs:0xffffffffcccccccc]
+       mov rax,[abs fs:0xffffffffcccccccc]
+       mov rbx,[abs fs:0xffffffffcccccccc]
+
+       mov al,[abs dword fs:foo]
+       mov bl,[abs dword fs:foo]
+       mov ax,[abs dword fs:foo]
+       mov bx,[abs dword fs:foo]
+       mov eax,[abs dword fs:foo]
+       mov ebx,[abs dword fs:foo]
+       mov rax,[abs dword fs:foo]
+       mov rbx,[abs dword fs:foo]
+       mov al,[abs dword fs:0xaaaaaaaaaaaaaaaa]
+       mov bl,[abs dword fs:0xaaaaaaaaaaaaaaaa]
+       mov ax,[abs dword fs:0xaaaaaaaaaaaaaaaa]
+       mov bx,[abs dword fs:0xaaaaaaaaaaaaaaaa]
+       mov eax,[abs dword fs:0xaaaaaaaaaaaaaaaa]
+       mov ebx,[abs dword fs:0xaaaaaaaaaaaaaaaa]
+       mov rax,[abs dword fs:0xaaaaaaaaaaaaaaaa]
+       mov rbx,[abs dword fs:0xaaaaaaaaaaaaaaaa]
+       mov al,[abs dword fs:0xbbbbbbbb]
+       mov bl,[abs dword fs:0xbbbbbbbb]
+       mov ax,[abs dword fs:0xbbbbbbbb]
+       mov bx,[abs dword fs:0xbbbbbbbb]
+       mov eax,[abs dword fs:0xbbbbbbbb]
+       mov ebx,[abs dword fs:0xbbbbbbbb]
+       mov rax,[abs dword fs:0xbbbbbbbb]
+       mov rbx,[abs dword fs:0xbbbbbbbb]
+       mov al,[abs dword fs:0xffffffffcccccccc]
+       mov bl,[abs dword fs:0xffffffffcccccccc]
+       mov ax,[abs dword fs:0xffffffffcccccccc]
+       mov bx,[abs dword fs:0xffffffffcccccccc]
+       mov eax,[abs dword fs:0xffffffffcccccccc]
+       mov ebx,[abs dword fs:0xffffffffcccccccc]
+       mov rax,[abs dword fs:0xffffffffcccccccc]
+       mov rbx,[abs dword fs:0xffffffffcccccccc]
+
+       mov al,[abs qword fs:foo]
+       mov bl,[abs qword fs:foo]
+       mov ax,[abs qword fs:foo]
+       mov bx,[abs qword fs:foo]
+       mov eax,[abs qword fs:foo]
+       mov ebx,[abs qword fs:foo]
+       mov rax,[abs qword fs:foo]
+       mov rbx,[abs qword fs:foo]
+       mov al,[abs qword fs:0xaaaaaaaaaaaaaaaa]
+       mov bl,[abs qword fs:0xaaaaaaaaaaaaaaaa]
+       mov ax,[abs qword fs:0xaaaaaaaaaaaaaaaa]
+       mov bx,[abs qword fs:0xaaaaaaaaaaaaaaaa]
+       mov eax,[abs qword fs:0xaaaaaaaaaaaaaaaa]
+       mov ebx,[abs qword fs:0xaaaaaaaaaaaaaaaa]
+       mov rax,[abs qword fs:0xaaaaaaaaaaaaaaaa]
+       mov rbx,[abs qword fs:0xaaaaaaaaaaaaaaaa]
+       mov al,[abs qword fs:0xbbbbbbbb]
+       mov bl,[abs qword fs:0xbbbbbbbb]
+       mov ax,[abs qword fs:0xbbbbbbbb]
+       mov bx,[abs qword fs:0xbbbbbbbb]
+       mov eax,[abs qword fs:0xbbbbbbbb]
+       mov ebx,[abs qword fs:0xbbbbbbbb]
+       mov rax,[abs qword fs:0xbbbbbbbb]
+       mov rbx,[abs qword fs:0xbbbbbbbb]
+       mov al,[abs qword fs:0xffffffffcccccccc]
+       mov bl,[abs qword fs:0xffffffffcccccccc]
+       mov ax,[abs qword fs:0xffffffffcccccccc]
+       mov bx,[abs qword fs:0xffffffffcccccccc]
+       mov eax,[abs qword fs:0xffffffffcccccccc]
+       mov ebx,[abs qword fs:0xffffffffcccccccc]
+       mov rax,[abs qword fs:0xffffffffcccccccc]
+       mov rbx,[abs qword fs:0xffffffffcccccccc]
+
+       mov al,[a64 abs fs:foo]
+       mov bl,[a64 abs fs:foo]
+       mov ax,[a64 abs fs:foo]
+       mov bx,[a64 abs fs:foo]
+       mov eax,[a64 abs fs:foo]
+       mov ebx,[a64 abs fs:foo]
+       mov rax,[a64 abs fs:foo]
+       mov rbx,[a64 abs fs:foo]
+       mov al,[a64 abs fs:0xaaaaaaaaaaaaaaaa]
+       mov bl,[a64 abs fs:0xaaaaaaaaaaaaaaaa]
+       mov ax,[a64 abs fs:0xaaaaaaaaaaaaaaaa]
+       mov bx,[a64 abs fs:0xaaaaaaaaaaaaaaaa]
+       mov eax,[a64 abs fs:0xaaaaaaaaaaaaaaaa]
+       mov ebx,[a64 abs fs:0xaaaaaaaaaaaaaaaa]
+       mov rax,[a64 abs fs:0xaaaaaaaaaaaaaaaa]
+       mov rbx,[a64 abs fs:0xaaaaaaaaaaaaaaaa]
+       mov al,[a64 abs fs:0xbbbbbbbb]
+       mov bl,[a64 abs fs:0xbbbbbbbb]
+       mov ax,[a64 abs fs:0xbbbbbbbb]
+       mov bx,[a64 abs fs:0xbbbbbbbb]
+       mov eax,[a64 abs fs:0xbbbbbbbb]
+       mov ebx,[a64 abs fs:0xbbbbbbbb]
+       mov rax,[a64 abs fs:0xbbbbbbbb]
+       mov rbx,[a64 abs fs:0xbbbbbbbb]
+       mov al,[a64 abs fs:0xffffffffcccccccc]
+       mov bl,[a64 abs fs:0xffffffffcccccccc]
+       mov ax,[a64 abs fs:0xffffffffcccccccc]
+       mov bx,[a64 abs fs:0xffffffffcccccccc]
+       mov eax,[a64 abs fs:0xffffffffcccccccc]
+       mov ebx,[a64 abs fs:0xffffffffcccccccc]
+       mov rax,[a64 abs fs:0xffffffffcccccccc]
+       mov rbx,[a64 abs fs:0xffffffffcccccccc]
+
+       mov al,[a64 abs dword fs:foo]
+       mov bl,[a64 abs dword fs:foo]
+       mov ax,[a64 abs dword fs:foo]
+       mov bx,[a64 abs dword fs:foo]
+       mov eax,[a64 abs dword fs:foo]
+       mov ebx,[a64 abs dword fs:foo]
+       mov rax,[a64 abs dword fs:foo]
+       mov rbx,[a64 abs dword fs:foo]
+       mov al,[a64 abs dword fs:0xaaaaaaaaaaaaaaaa]
+       mov bl,[a64 abs dword fs:0xaaaaaaaaaaaaaaaa]
+       mov ax,[a64 abs dword fs:0xaaaaaaaaaaaaaaaa]
+       mov bx,[a64 abs dword fs:0xaaaaaaaaaaaaaaaa]
+       mov eax,[a64 abs dword fs:0xaaaaaaaaaaaaaaaa]
+       mov ebx,[a64 abs dword fs:0xaaaaaaaaaaaaaaaa]
+       mov rax,[a64 abs dword fs:0xaaaaaaaaaaaaaaaa]
+       mov rbx,[a64 abs dword fs:0xaaaaaaaaaaaaaaaa]
+       mov al,[a64 abs dword fs:0xbbbbbbbb]
+       mov bl,[a64 abs dword fs:0xbbbbbbbb]
+       mov ax,[a64 abs dword fs:0xbbbbbbbb]
+       mov bx,[a64 abs dword fs:0xbbbbbbbb]
+       mov eax,[a64 abs dword fs:0xbbbbbbbb]
+       mov ebx,[a64 abs dword fs:0xbbbbbbbb]
+       mov rax,[a64 abs dword fs:0xbbbbbbbb]
+       mov rbx,[a64 abs dword fs:0xbbbbbbbb]
+       mov al,[a64 abs dword fs:0xffffffffcccccccc]
+       mov bl,[a64 abs dword fs:0xffffffffcccccccc]
+       mov ax,[a64 abs dword fs:0xffffffffcccccccc]
+       mov bx,[a64 abs dword fs:0xffffffffcccccccc]
+       mov eax,[a64 abs dword fs:0xffffffffcccccccc]
+       mov ebx,[a64 abs dword fs:0xffffffffcccccccc]
+       mov rax,[a64 abs dword fs:0xffffffffcccccccc]
+       mov rbx,[a64 abs dword fs:0xffffffffcccccccc]
+
+       mov al,[a64 abs qword fs:foo]
+       mov bl,[a64 abs qword fs:foo]
+       mov ax,[a64 abs qword fs:foo]
+       mov bx,[a64 abs qword fs:foo]
+       mov eax,[a64 abs qword fs:foo]
+       mov ebx,[a64 abs qword fs:foo]
+       mov rax,[a64 abs qword fs:foo]
+       mov rbx,[a64 abs qword fs:foo]
+       mov al,[a64 abs qword fs:0xaaaaaaaaaaaaaaaa]
+       mov bl,[a64 abs qword fs:0xaaaaaaaaaaaaaaaa]
+       mov ax,[a64 abs qword fs:0xaaaaaaaaaaaaaaaa]
+       mov bx,[a64 abs qword fs:0xaaaaaaaaaaaaaaaa]
+       mov eax,[a64 abs qword fs:0xaaaaaaaaaaaaaaaa]
+       mov ebx,[a64 abs qword fs:0xaaaaaaaaaaaaaaaa]
+       mov rax,[a64 abs qword fs:0xaaaaaaaaaaaaaaaa]
+       mov rbx,[a64 abs qword fs:0xaaaaaaaaaaaaaaaa]
+       mov al,[a64 abs qword fs:0xbbbbbbbb]
+       mov bl,[a64 abs qword fs:0xbbbbbbbb]
+       mov ax,[a64 abs qword fs:0xbbbbbbbb]
+       mov bx,[a64 abs qword fs:0xbbbbbbbb]
+       mov eax,[a64 abs qword fs:0xbbbbbbbb]
+       mov ebx,[a64 abs qword fs:0xbbbbbbbb]
+       mov rax,[a64 abs qword fs:0xbbbbbbbb]
+       mov rbx,[a64 abs qword fs:0xbbbbbbbb]
+       mov al,[a64 abs qword fs:0xffffffffcccccccc]
+       mov bl,[a64 abs qword fs:0xffffffffcccccccc]
+       mov ax,[a64 abs qword fs:0xffffffffcccccccc]
+       mov bx,[a64 abs qword fs:0xffffffffcccccccc]
+       mov eax,[a64 abs qword fs:0xffffffffcccccccc]
+       mov ebx,[a64 abs qword fs:0xffffffffcccccccc]
+       mov rax,[a64 abs qword fs:0xffffffffcccccccc]
+       mov rbx,[a64 abs qword fs:0xffffffffcccccccc]
+
+       mov al,[a32 abs fs:foo]
+       mov bl,[a32 abs fs:foo]
+       mov ax,[a32 abs fs:foo]
+       mov bx,[a32 abs fs:foo]
+       mov eax,[a32 abs fs:foo]
+       mov ebx,[a32 abs fs:foo]
+       mov rax,[a32 abs fs:foo]
+       mov rbx,[a32 abs fs:foo]
+       mov al,[a32 abs fs:0xaaaaaaaaaaaaaaaa]
+       mov bl,[a32 abs fs:0xaaaaaaaaaaaaaaaa]
+       mov ax,[a32 abs fs:0xaaaaaaaaaaaaaaaa]
+       mov bx,[a32 abs fs:0xaaaaaaaaaaaaaaaa]
+       mov eax,[a32 abs fs:0xaaaaaaaaaaaaaaaa]
+       mov ebx,[a32 abs fs:0xaaaaaaaaaaaaaaaa]
+       mov rax,[a32 abs fs:0xaaaaaaaaaaaaaaaa]
+       mov rbx,[a32 abs fs:0xaaaaaaaaaaaaaaaa]
+       mov al,[a32 abs fs:0xbbbbbbbb]
+       mov bl,[a32 abs fs:0xbbbbbbbb]
+       mov ax,[a32 abs fs:0xbbbbbbbb]
+       mov bx,[a32 abs fs:0xbbbbbbbb]
+       mov eax,[a32 abs fs:0xbbbbbbbb]
+       mov ebx,[a32 abs fs:0xbbbbbbbb]
+       mov rax,[a32 abs fs:0xbbbbbbbb]
+       mov rbx,[a32 abs fs:0xbbbbbbbb]
+       mov al,[a32 abs fs:0xffffffffcccccccc]
+       mov bl,[a32 abs fs:0xffffffffcccccccc]
+       mov ax,[a32 abs fs:0xffffffffcccccccc]
+       mov bx,[a32 abs fs:0xffffffffcccccccc]
+       mov eax,[a32 abs fs:0xffffffffcccccccc]
+       mov ebx,[a32 abs fs:0xffffffffcccccccc]
+       mov rax,[a32 abs fs:0xffffffffcccccccc]
+       mov rbx,[a32 abs fs:0xffffffffcccccccc]
+
+       mov al,[a32 abs dword fs:foo]
+       mov bl,[a32 abs dword fs:foo]
+       mov ax,[a32 abs dword fs:foo]
+       mov bx,[a32 abs dword fs:foo]
+       mov eax,[a32 abs dword fs:foo]
+       mov ebx,[a32 abs dword fs:foo]
+       mov rax,[a32 abs dword fs:foo]
+       mov rbx,[a32 abs dword fs:foo]
+       mov al,[a32 abs dword fs:0xaaaaaaaaaaaaaaaa]
+       mov bl,[a32 abs dword fs:0xaaaaaaaaaaaaaaaa]
+       mov ax,[a32 abs dword fs:0xaaaaaaaaaaaaaaaa]
+       mov bx,[a32 abs dword fs:0xaaaaaaaaaaaaaaaa]
+       mov eax,[a32 abs dword fs:0xaaaaaaaaaaaaaaaa]
+       mov ebx,[a32 abs dword fs:0xaaaaaaaaaaaaaaaa]
+       mov rax,[a32 abs dword fs:0xaaaaaaaaaaaaaaaa]
+       mov rbx,[a32 abs dword fs:0xaaaaaaaaaaaaaaaa]
+       mov al,[a32 abs dword fs:0xbbbbbbbb]
+       mov bl,[a32 abs dword fs:0xbbbbbbbb]
+       mov ax,[a32 abs dword fs:0xbbbbbbbb]
+       mov bx,[a32 abs dword fs:0xbbbbbbbb]
+       mov eax,[a32 abs dword fs:0xbbbbbbbb]
+       mov ebx,[a32 abs dword fs:0xbbbbbbbb]
+       mov rax,[a32 abs dword fs:0xbbbbbbbb]
+       mov rbx,[a32 abs dword fs:0xbbbbbbbb]
+       mov al,[a32 abs dword fs:0xffffffffcccccccc]
+       mov bl,[a32 abs dword fs:0xffffffffcccccccc]
+       mov ax,[a32 abs dword fs:0xffffffffcccccccc]
+       mov bx,[a32 abs dword fs:0xffffffffcccccccc]
+       mov eax,[a32 abs dword fs:0xffffffffcccccccc]
+       mov ebx,[a32 abs dword fs:0xffffffffcccccccc]
+       mov rax,[a32 abs dword fs:0xffffffffcccccccc]
+       mov rbx,[a32 abs dword fs:0xffffffffcccccccc]
+
+       mov al,[a32 abs qword fs:foo]
+       mov bl,[a32 abs qword fs:foo]
+       mov ax,[a32 abs qword fs:foo]
+       mov bx,[a32 abs qword fs:foo]
+       mov eax,[a32 abs qword fs:foo]
+       mov ebx,[a32 abs qword fs:foo]
+       mov rax,[a32 abs qword fs:foo]
+       mov rbx,[a32 abs qword fs:foo]
+       mov al,[a32 abs qword fs:0xaaaaaaaaaaaaaaaa]
+       mov bl,[a32 abs qword fs:0xaaaaaaaaaaaaaaaa]
+       mov ax,[a32 abs qword fs:0xaaaaaaaaaaaaaaaa]
+       mov bx,[a32 abs qword fs:0xaaaaaaaaaaaaaaaa]
+       mov eax,[a32 abs qword fs:0xaaaaaaaaaaaaaaaa]
+       mov ebx,[a32 abs qword fs:0xaaaaaaaaaaaaaaaa]
+       mov rax,[a32 abs qword fs:0xaaaaaaaaaaaaaaaa]
+       mov rbx,[a32 abs qword fs:0xaaaaaaaaaaaaaaaa]
+       mov al,[a32 abs qword fs:0xbbbbbbbb]
+       mov bl,[a32 abs qword fs:0xbbbbbbbb]
+       mov ax,[a32 abs qword fs:0xbbbbbbbb]
+       mov bx,[a32 abs qword fs:0xbbbbbbbb]
+       mov eax,[a32 abs qword fs:0xbbbbbbbb]
+       mov ebx,[a32 abs qword fs:0xbbbbbbbb]
+       mov rax,[a32 abs qword fs:0xbbbbbbbb]
+       mov rbx,[a32 abs qword fs:0xbbbbbbbb]
+       mov al,[a32 abs qword fs:0xffffffffcccccccc]
+       mov bl,[a32 abs qword fs:0xffffffffcccccccc]
+       mov ax,[a32 abs qword fs:0xffffffffcccccccc]
+       mov bx,[a32 abs qword fs:0xffffffffcccccccc]
+       mov eax,[a32 abs qword fs:0xffffffffcccccccc]
+       mov ebx,[a32 abs qword fs:0xffffffffcccccccc]
+       mov rax,[a32 abs qword fs:0xffffffffcccccccc]
+       mov rbx,[a32 abs qword fs:0xffffffffcccccccc]
+
+       mov al,[rel fs:foo]
+       mov bl,[rel fs:foo]
+       mov ax,[rel fs:foo]
+       mov bx,[rel fs:foo]
+       mov eax,[rel fs:foo]
+       mov ebx,[rel fs:foo]
+       mov rax,[rel fs:foo]
+       mov rbx,[rel fs:foo]
+       mov al,[rel fs:0xaaaaaaaaaaaaaaaa]
+       mov bl,[rel fs:0xaaaaaaaaaaaaaaaa]
+       mov ax,[rel fs:0xaaaaaaaaaaaaaaaa]
+       mov bx,[rel fs:0xaaaaaaaaaaaaaaaa]
+       mov eax,[rel fs:0xaaaaaaaaaaaaaaaa]
+       mov ebx,[rel fs:0xaaaaaaaaaaaaaaaa]
+       mov rax,[rel fs:0xaaaaaaaaaaaaaaaa]
+       mov rbx,[rel fs:0xaaaaaaaaaaaaaaaa]
+       mov al,[rel fs:0xbbbbbbbb]
+       mov bl,[rel fs:0xbbbbbbbb]
+       mov ax,[rel fs:0xbbbbbbbb]
+       mov bx,[rel fs:0xbbbbbbbb]
+       mov eax,[rel fs:0xbbbbbbbb]
+       mov ebx,[rel fs:0xbbbbbbbb]
+       mov rax,[rel fs:0xbbbbbbbb]
+       mov rbx,[rel fs:0xbbbbbbbb]
+       mov al,[rel fs:0xffffffffcccccccc]
+       mov bl,[rel fs:0xffffffffcccccccc]
+       mov ax,[rel fs:0xffffffffcccccccc]
+       mov bx,[rel fs:0xffffffffcccccccc]
+       mov eax,[rel fs:0xffffffffcccccccc]
+       mov ebx,[rel fs:0xffffffffcccccccc]
+       mov rax,[rel fs:0xffffffffcccccccc]
+       mov rbx,[rel fs:0xffffffffcccccccc]
+
+       mov al,[rel dword fs:foo]
+       mov bl,[rel dword fs:foo]
+       mov ax,[rel dword fs:foo]
+       mov bx,[rel dword fs:foo]
+       mov eax,[rel dword fs:foo]
+       mov ebx,[rel dword fs:foo]
+       mov rax,[rel dword fs:foo]
+       mov rbx,[rel dword fs:foo]
+       mov al,[rel dword fs:0xaaaaaaaaaaaaaaaa]
+       mov bl,[rel dword fs:0xaaaaaaaaaaaaaaaa]
+       mov ax,[rel dword fs:0xaaaaaaaaaaaaaaaa]
+       mov bx,[rel dword fs:0xaaaaaaaaaaaaaaaa]
+       mov eax,[rel dword fs:0xaaaaaaaaaaaaaaaa]
+       mov ebx,[rel dword fs:0xaaaaaaaaaaaaaaaa]
+       mov rax,[rel dword fs:0xaaaaaaaaaaaaaaaa]
+       mov rbx,[rel dword fs:0xaaaaaaaaaaaaaaaa]
+       mov al,[rel dword fs:0xbbbbbbbb]
+       mov bl,[rel dword fs:0xbbbbbbbb]
+       mov ax,[rel dword fs:0xbbbbbbbb]
+       mov bx,[rel dword fs:0xbbbbbbbb]
+       mov eax,[rel dword fs:0xbbbbbbbb]
+       mov ebx,[rel dword fs:0xbbbbbbbb]
+       mov rax,[rel dword fs:0xbbbbbbbb]
+       mov rbx,[rel dword fs:0xbbbbbbbb]
+       mov al,[rel dword fs:0xffffffffcccccccc]
+       mov bl,[rel dword fs:0xffffffffcccccccc]
+       mov ax,[rel dword fs:0xffffffffcccccccc]
+       mov bx,[rel dword fs:0xffffffffcccccccc]
+       mov eax,[rel dword fs:0xffffffffcccccccc]
+       mov ebx,[rel dword fs:0xffffffffcccccccc]
+       mov rax,[rel dword fs:0xffffffffcccccccc]
+       mov rbx,[rel dword fs:0xffffffffcccccccc]
+
+       mov al,[rel qword fs:foo]
+       mov bl,[rel qword fs:foo]
+       mov ax,[rel qword fs:foo]
+       mov bx,[rel qword fs:foo]
+       mov eax,[rel qword fs:foo]
+       mov ebx,[rel qword fs:foo]
+       mov rax,[rel qword fs:foo]
+       mov rbx,[rel qword fs:foo]
+       mov al,[rel qword fs:0xaaaaaaaaaaaaaaaa]
+       mov bl,[rel qword fs:0xaaaaaaaaaaaaaaaa]
+       mov ax,[rel qword fs:0xaaaaaaaaaaaaaaaa]
+       mov bx,[rel qword fs:0xaaaaaaaaaaaaaaaa]
+       mov eax,[rel qword fs:0xaaaaaaaaaaaaaaaa]
+       mov ebx,[rel qword fs:0xaaaaaaaaaaaaaaaa]
+       mov rax,[rel qword fs:0xaaaaaaaaaaaaaaaa]
+       mov rbx,[rel qword fs:0xaaaaaaaaaaaaaaaa]
+       mov al,[rel qword fs:0xbbbbbbbb]
+       mov bl,[rel qword fs:0xbbbbbbbb]
+       mov ax,[rel qword fs:0xbbbbbbbb]
+       mov bx,[rel qword fs:0xbbbbbbbb]
+       mov eax,[rel qword fs:0xbbbbbbbb]
+       mov ebx,[rel qword fs:0xbbbbbbbb]
+       mov rax,[rel qword fs:0xbbbbbbbb]
+       mov rbx,[rel qword fs:0xbbbbbbbb]
+       mov al,[rel qword fs:0xffffffffcccccccc]
+       mov bl,[rel qword fs:0xffffffffcccccccc]
+       mov ax,[rel qword fs:0xffffffffcccccccc]
+       mov bx,[rel qword fs:0xffffffffcccccccc]
+       mov eax,[rel qword fs:0xffffffffcccccccc]
+       mov ebx,[rel qword fs:0xffffffffcccccccc]
+       mov rax,[rel qword fs:0xffffffffcccccccc]
+       mov rbx,[rel qword fs:0xffffffffcccccccc]
+
+       mov al,[a64 rel fs:foo]
+       mov bl,[a64 rel fs:foo]
+       mov ax,[a64 rel fs:foo]
+       mov bx,[a64 rel fs:foo]
+       mov eax,[a64 rel fs:foo]
+       mov ebx,[a64 rel fs:foo]
+       mov rax,[a64 rel fs:foo]
+       mov rbx,[a64 rel fs:foo]
+       mov al,[a64 rel fs:0xaaaaaaaaaaaaaaaa]
+       mov bl,[a64 rel fs:0xaaaaaaaaaaaaaaaa]
+       mov ax,[a64 rel fs:0xaaaaaaaaaaaaaaaa]
+       mov bx,[a64 rel fs:0xaaaaaaaaaaaaaaaa]
+       mov eax,[a64 rel fs:0xaaaaaaaaaaaaaaaa]
+       mov ebx,[a64 rel fs:0xaaaaaaaaaaaaaaaa]
+       mov rax,[a64 rel fs:0xaaaaaaaaaaaaaaaa]
+       mov rbx,[a64 rel fs:0xaaaaaaaaaaaaaaaa]
+       mov al,[a64 rel fs:0xbbbbbbbb]
+       mov bl,[a64 rel fs:0xbbbbbbbb]
+       mov ax,[a64 rel fs:0xbbbbbbbb]
+       mov bx,[a64 rel fs:0xbbbbbbbb]
+       mov eax,[a64 rel fs:0xbbbbbbbb]
+       mov ebx,[a64 rel fs:0xbbbbbbbb]
+       mov rax,[a64 rel fs:0xbbbbbbbb]
+       mov rbx,[a64 rel fs:0xbbbbbbbb]
+       mov al,[a64 rel fs:0xffffffffcccccccc]
+       mov bl,[a64 rel fs:0xffffffffcccccccc]
+       mov ax,[a64 rel fs:0xffffffffcccccccc]
+       mov bx,[a64 rel fs:0xffffffffcccccccc]
+       mov eax,[a64 rel fs:0xffffffffcccccccc]
+       mov ebx,[a64 rel fs:0xffffffffcccccccc]
+       mov rax,[a64 rel fs:0xffffffffcccccccc]
+       mov rbx,[a64 rel fs:0xffffffffcccccccc]
+
+       mov al,[a64 rel dword fs:foo]
+       mov bl,[a64 rel dword fs:foo]
+       mov ax,[a64 rel dword fs:foo]
+       mov bx,[a64 rel dword fs:foo]
+       mov eax,[a64 rel dword fs:foo]
+       mov ebx,[a64 rel dword fs:foo]
+       mov rax,[a64 rel dword fs:foo]
+       mov rbx,[a64 rel dword fs:foo]
+       mov al,[a64 rel dword fs:0xaaaaaaaaaaaaaaaa]
+       mov bl,[a64 rel dword fs:0xaaaaaaaaaaaaaaaa]
+       mov ax,[a64 rel dword fs:0xaaaaaaaaaaaaaaaa]
+       mov bx,[a64 rel dword fs:0xaaaaaaaaaaaaaaaa]
+       mov eax,[a64 rel dword fs:0xaaaaaaaaaaaaaaaa]
+       mov ebx,[a64 rel dword fs:0xaaaaaaaaaaaaaaaa]
+       mov rax,[a64 rel dword fs:0xaaaaaaaaaaaaaaaa]
+       mov rbx,[a64 rel dword fs:0xaaaaaaaaaaaaaaaa]
+       mov al,[a64 rel dword fs:0xbbbbbbbb]
+       mov bl,[a64 rel dword fs:0xbbbbbbbb]
+       mov ax,[a64 rel dword fs:0xbbbbbbbb]
+       mov bx,[a64 rel dword fs:0xbbbbbbbb]
+       mov eax,[a64 rel dword fs:0xbbbbbbbb]
+       mov ebx,[a64 rel dword fs:0xbbbbbbbb]
+       mov rax,[a64 rel dword fs:0xbbbbbbbb]
+       mov rbx,[a64 rel dword fs:0xbbbbbbbb]
+       mov al,[a64 rel dword fs:0xffffffffcccccccc]
+       mov bl,[a64 rel dword fs:0xffffffffcccccccc]
+       mov ax,[a64 rel dword fs:0xffffffffcccccccc]
+       mov bx,[a64 rel dword fs:0xffffffffcccccccc]
+       mov eax,[a64 rel dword fs:0xffffffffcccccccc]
+       mov ebx,[a64 rel dword fs:0xffffffffcccccccc]
+       mov rax,[a64 rel dword fs:0xffffffffcccccccc]
+       mov rbx,[a64 rel dword fs:0xffffffffcccccccc]
+
+       mov al,[a64 rel qword fs:foo]
+       mov bl,[a64 rel qword fs:foo]
+       mov ax,[a64 rel qword fs:foo]
+       mov bx,[a64 rel qword fs:foo]
+       mov eax,[a64 rel qword fs:foo]
+       mov ebx,[a64 rel qword fs:foo]
+       mov rax,[a64 rel qword fs:foo]
+       mov rbx,[a64 rel qword fs:foo]
+       mov al,[a64 rel qword fs:0xaaaaaaaaaaaaaaaa]
+       mov bl,[a64 rel qword fs:0xaaaaaaaaaaaaaaaa]
+       mov ax,[a64 rel qword fs:0xaaaaaaaaaaaaaaaa]
+       mov bx,[a64 rel qword fs:0xaaaaaaaaaaaaaaaa]
+       mov eax,[a64 rel qword fs:0xaaaaaaaaaaaaaaaa]
+       mov ebx,[a64 rel qword fs:0xaaaaaaaaaaaaaaaa]
+       mov rax,[a64 rel qword fs:0xaaaaaaaaaaaaaaaa]
+       mov rbx,[a64 rel qword fs:0xaaaaaaaaaaaaaaaa]
+       mov al,[a64 rel qword fs:0xbbbbbbbb]
+       mov bl,[a64 rel qword fs:0xbbbbbbbb]
+       mov ax,[a64 rel qword fs:0xbbbbbbbb]
+       mov bx,[a64 rel qword fs:0xbbbbbbbb]
+       mov eax,[a64 rel qword fs:0xbbbbbbbb]
+       mov ebx,[a64 rel qword fs:0xbbbbbbbb]
+       mov rax,[a64 rel qword fs:0xbbbbbbbb]
+       mov rbx,[a64 rel qword fs:0xbbbbbbbb]
+       mov al,[a64 rel qword fs:0xffffffffcccccccc]
+       mov bl,[a64 rel qword fs:0xffffffffcccccccc]
+       mov ax,[a64 rel qword fs:0xffffffffcccccccc]
+       mov bx,[a64 rel qword fs:0xffffffffcccccccc]
+       mov eax,[a64 rel qword fs:0xffffffffcccccccc]
+       mov ebx,[a64 rel qword fs:0xffffffffcccccccc]
+       mov rax,[a64 rel qword fs:0xffffffffcccccccc]
+       mov rbx,[a64 rel qword fs:0xffffffffcccccccc]
+
+       mov al,[a32 rel fs:foo]
+       mov bl,[a32 rel fs:foo]
+       mov ax,[a32 rel fs:foo]
+       mov bx,[a32 rel fs:foo]
+       mov eax,[a32 rel fs:foo]
+       mov ebx,[a32 rel fs:foo]
+       mov rax,[a32 rel fs:foo]
+       mov rbx,[a32 rel fs:foo]
+       mov al,[a32 rel fs:0xaaaaaaaaaaaaaaaa]
+       mov bl,[a32 rel fs:0xaaaaaaaaaaaaaaaa]
+       mov ax,[a32 rel fs:0xaaaaaaaaaaaaaaaa]
+       mov bx,[a32 rel fs:0xaaaaaaaaaaaaaaaa]
+       mov eax,[a32 rel fs:0xaaaaaaaaaaaaaaaa]
+       mov ebx,[a32 rel fs:0xaaaaaaaaaaaaaaaa]
+       mov rax,[a32 rel fs:0xaaaaaaaaaaaaaaaa]
+       mov rbx,[a32 rel fs:0xaaaaaaaaaaaaaaaa]
+       mov al,[a32 rel fs:0xbbbbbbbb]
+       mov bl,[a32 rel fs:0xbbbbbbbb]
+       mov ax,[a32 rel fs:0xbbbbbbbb]
+       mov bx,[a32 rel fs:0xbbbbbbbb]
+       mov eax,[a32 rel fs:0xbbbbbbbb]
+       mov ebx,[a32 rel fs:0xbbbbbbbb]
+       mov rax,[a32 rel fs:0xbbbbbbbb]
+       mov rbx,[a32 rel fs:0xbbbbbbbb]
+       mov al,[a32 rel fs:0xffffffffcccccccc]
+       mov bl,[a32 rel fs:0xffffffffcccccccc]
+       mov ax,[a32 rel fs:0xffffffffcccccccc]
+       mov bx,[a32 rel fs:0xffffffffcccccccc]
+       mov eax,[a32 rel fs:0xffffffffcccccccc]
+       mov ebx,[a32 rel fs:0xffffffffcccccccc]
+       mov rax,[a32 rel fs:0xffffffffcccccccc]
+       mov rbx,[a32 rel fs:0xffffffffcccccccc]
+
+       mov al,[a32 rel dword fs:foo]
+       mov bl,[a32 rel dword fs:foo]
+       mov ax,[a32 rel dword fs:foo]
+       mov bx,[a32 rel dword fs:foo]
+       mov eax,[a32 rel dword fs:foo]
+       mov ebx,[a32 rel dword fs:foo]
+       mov rax,[a32 rel dword fs:foo]
+       mov rbx,[a32 rel dword fs:foo]
+       mov al,[a32 rel dword fs:0xaaaaaaaaaaaaaaaa]
+       mov bl,[a32 rel dword fs:0xaaaaaaaaaaaaaaaa]
+       mov ax,[a32 rel dword fs:0xaaaaaaaaaaaaaaaa]
+       mov bx,[a32 rel dword fs:0xaaaaaaaaaaaaaaaa]
+       mov eax,[a32 rel dword fs:0xaaaaaaaaaaaaaaaa]
+       mov ebx,[a32 rel dword fs:0xaaaaaaaaaaaaaaaa]
+       mov rax,[a32 rel dword fs:0xaaaaaaaaaaaaaaaa]
+       mov rbx,[a32 rel dword fs:0xaaaaaaaaaaaaaaaa]
+       mov al,[a32 rel dword fs:0xbbbbbbbb]
+       mov bl,[a32 rel dword fs:0xbbbbbbbb]
+       mov ax,[a32 rel dword fs:0xbbbbbbbb]
+       mov bx,[a32 rel dword fs:0xbbbbbbbb]
+       mov eax,[a32 rel dword fs:0xbbbbbbbb]
+       mov ebx,[a32 rel dword fs:0xbbbbbbbb]
+       mov rax,[a32 rel dword fs:0xbbbbbbbb]
+       mov rbx,[a32 rel dword fs:0xbbbbbbbb]
+       mov al,[a32 rel dword fs:0xffffffffcccccccc]
+       mov bl,[a32 rel dword fs:0xffffffffcccccccc]
+       mov ax,[a32 rel dword fs:0xffffffffcccccccc]
+       mov bx,[a32 rel dword fs:0xffffffffcccccccc]
+       mov eax,[a32 rel dword fs:0xffffffffcccccccc]
+       mov ebx,[a32 rel dword fs:0xffffffffcccccccc]
+       mov rax,[a32 rel dword fs:0xffffffffcccccccc]
+       mov rbx,[a32 rel dword fs:0xffffffffcccccccc]
+
+       mov al,[a32 rel qword fs:foo]
+       mov bl,[a32 rel qword fs:foo]
+       mov ax,[a32 rel qword fs:foo]
+       mov bx,[a32 rel qword fs:foo]
+       mov eax,[a32 rel qword fs:foo]
+       mov ebx,[a32 rel qword fs:foo]
+       mov rax,[a32 rel qword fs:foo]
+       mov rbx,[a32 rel qword fs:foo]
+       mov al,[a32 rel qword fs:0xaaaaaaaaaaaaaaaa]
+       mov bl,[a32 rel qword fs:0xaaaaaaaaaaaaaaaa]
+       mov ax,[a32 rel qword fs:0xaaaaaaaaaaaaaaaa]
+       mov bx,[a32 rel qword fs:0xaaaaaaaaaaaaaaaa]
+       mov eax,[a32 rel qword fs:0xaaaaaaaaaaaaaaaa]
+       mov ebx,[a32 rel qword fs:0xaaaaaaaaaaaaaaaa]
+       mov rax,[a32 rel qword fs:0xaaaaaaaaaaaaaaaa]
+       mov rbx,[a32 rel qword fs:0xaaaaaaaaaaaaaaaa]
+       mov al,[a32 rel qword fs:0xbbbbbbbb]
+       mov bl,[a32 rel qword fs:0xbbbbbbbb]
+       mov ax,[a32 rel qword fs:0xbbbbbbbb]
+       mov bx,[a32 rel qword fs:0xbbbbbbbb]
+       mov eax,[a32 rel qword fs:0xbbbbbbbb]
+       mov ebx,[a32 rel qword fs:0xbbbbbbbb]
+       mov rax,[a32 rel qword fs:0xbbbbbbbb]
+       mov rbx,[a32 rel qword fs:0xbbbbbbbb]
+       mov al,[a32 rel qword fs:0xffffffffcccccccc]
+       mov bl,[a32 rel qword fs:0xffffffffcccccccc]
+       mov ax,[a32 rel qword fs:0xffffffffcccccccc]
+       mov bx,[a32 rel qword fs:0xffffffffcccccccc]
+       mov eax,[a32 rel qword fs:0xffffffffcccccccc]
+       mov ebx,[a32 rel qword fs:0xffffffffcccccccc]
+       mov rax,[a32 rel qword fs:0xffffffffcccccccc]
+       mov rbx,[a32 rel qword fs:0xffffffffcccccccc]
+
+       mov al,[es:foo]
+       mov bl,[es:foo]
+       mov ax,[es:foo]
+       mov bx,[es:foo]
+       mov eax,[es:foo]
+       mov ebx,[es:foo]
+       mov rax,[es:foo]
+       mov rbx,[es:foo]
+       mov al,[es:0xaaaaaaaaaaaaaaaa]
+       mov bl,[es:0xaaaaaaaaaaaaaaaa]
+       mov ax,[es:0xaaaaaaaaaaaaaaaa]
+       mov bx,[es:0xaaaaaaaaaaaaaaaa]
+       mov eax,[es:0xaaaaaaaaaaaaaaaa]
+       mov ebx,[es:0xaaaaaaaaaaaaaaaa]
+       mov rax,[es:0xaaaaaaaaaaaaaaaa]
+       mov rbx,[es:0xaaaaaaaaaaaaaaaa]
+       mov al,[es:0xbbbbbbbb]
+       mov bl,[es:0xbbbbbbbb]
+       mov ax,[es:0xbbbbbbbb]
+       mov bx,[es:0xbbbbbbbb]
+       mov eax,[es:0xbbbbbbbb]
+       mov ebx,[es:0xbbbbbbbb]
+       mov rax,[es:0xbbbbbbbb]
+       mov rbx,[es:0xbbbbbbbb]
+       mov al,[es:0xffffffffcccccccc]
+       mov bl,[es:0xffffffffcccccccc]
+       mov ax,[es:0xffffffffcccccccc]
+       mov bx,[es:0xffffffffcccccccc]
+       mov eax,[es:0xffffffffcccccccc]
+       mov ebx,[es:0xffffffffcccccccc]
+       mov rax,[es:0xffffffffcccccccc]
+       mov rbx,[es:0xffffffffcccccccc]
+
+       mov al,[dword es:foo]
+       mov bl,[dword es:foo]
+       mov ax,[dword es:foo]
+       mov bx,[dword es:foo]
+       mov eax,[dword es:foo]
+       mov ebx,[dword es:foo]
+       mov rax,[dword es:foo]
+       mov rbx,[dword es:foo]
+       mov al,[dword es:0xaaaaaaaaaaaaaaaa]
+       mov bl,[dword es:0xaaaaaaaaaaaaaaaa]
+       mov ax,[dword es:0xaaaaaaaaaaaaaaaa]
+       mov bx,[dword es:0xaaaaaaaaaaaaaaaa]
+       mov eax,[dword es:0xaaaaaaaaaaaaaaaa]
+       mov ebx,[dword es:0xaaaaaaaaaaaaaaaa]
+       mov rax,[dword es:0xaaaaaaaaaaaaaaaa]
+       mov rbx,[dword es:0xaaaaaaaaaaaaaaaa]
+       mov al,[dword es:0xbbbbbbbb]
+       mov bl,[dword es:0xbbbbbbbb]
+       mov ax,[dword es:0xbbbbbbbb]
+       mov bx,[dword es:0xbbbbbbbb]
+       mov eax,[dword es:0xbbbbbbbb]
+       mov ebx,[dword es:0xbbbbbbbb]
+       mov rax,[dword es:0xbbbbbbbb]
+       mov rbx,[dword es:0xbbbbbbbb]
+       mov al,[dword es:0xffffffffcccccccc]
+       mov bl,[dword es:0xffffffffcccccccc]
+       mov ax,[dword es:0xffffffffcccccccc]
+       mov bx,[dword es:0xffffffffcccccccc]
+       mov eax,[dword es:0xffffffffcccccccc]
+       mov ebx,[dword es:0xffffffffcccccccc]
+       mov rax,[dword es:0xffffffffcccccccc]
+       mov rbx,[dword es:0xffffffffcccccccc]
+
+       mov al,[qword es:foo]
+       mov bl,[qword es:foo]
+       mov ax,[qword es:foo]
+       mov bx,[qword es:foo]
+       mov eax,[qword es:foo]
+       mov ebx,[qword es:foo]
+       mov rax,[qword es:foo]
+       mov rbx,[qword es:foo]
+       mov al,[qword es:0xaaaaaaaaaaaaaaaa]
+       mov bl,[qword es:0xaaaaaaaaaaaaaaaa]
+       mov ax,[qword es:0xaaaaaaaaaaaaaaaa]
+       mov bx,[qword es:0xaaaaaaaaaaaaaaaa]
+       mov eax,[qword es:0xaaaaaaaaaaaaaaaa]
+       mov ebx,[qword es:0xaaaaaaaaaaaaaaaa]
+       mov rax,[qword es:0xaaaaaaaaaaaaaaaa]
+       mov rbx,[qword es:0xaaaaaaaaaaaaaaaa]
+       mov al,[qword es:0xbbbbbbbb]
+       mov bl,[qword es:0xbbbbbbbb]
+       mov ax,[qword es:0xbbbbbbbb]
+       mov bx,[qword es:0xbbbbbbbb]
+       mov eax,[qword es:0xbbbbbbbb]
+       mov ebx,[qword es:0xbbbbbbbb]
+       mov rax,[qword es:0xbbbbbbbb]
+       mov rbx,[qword es:0xbbbbbbbb]
+       mov al,[qword es:0xffffffffcccccccc]
+       mov bl,[qword es:0xffffffffcccccccc]
+       mov ax,[qword es:0xffffffffcccccccc]
+       mov bx,[qword es:0xffffffffcccccccc]
+       mov eax,[qword es:0xffffffffcccccccc]
+       mov ebx,[qword es:0xffffffffcccccccc]
+       mov rax,[qword es:0xffffffffcccccccc]
+       mov rbx,[qword es:0xffffffffcccccccc]
+
+       mov al,[a64 es:foo]
+       mov bl,[a64 es:foo]
+       mov ax,[a64 es:foo]
+       mov bx,[a64 es:foo]
+       mov eax,[a64 es:foo]
+       mov ebx,[a64 es:foo]
+       mov rax,[a64 es:foo]
+       mov rbx,[a64 es:foo]
+       mov al,[a64 es:0xaaaaaaaaaaaaaaaa]
+       mov bl,[a64 es:0xaaaaaaaaaaaaaaaa]
+       mov ax,[a64 es:0xaaaaaaaaaaaaaaaa]
+       mov bx,[a64 es:0xaaaaaaaaaaaaaaaa]
+       mov eax,[a64 es:0xaaaaaaaaaaaaaaaa]
+       mov ebx,[a64 es:0xaaaaaaaaaaaaaaaa]
+       mov rax,[a64 es:0xaaaaaaaaaaaaaaaa]
+       mov rbx,[a64 es:0xaaaaaaaaaaaaaaaa]
+       mov al,[a64 es:0xbbbbbbbb]
+       mov bl,[a64 es:0xbbbbbbbb]
+       mov ax,[a64 es:0xbbbbbbbb]
+       mov bx,[a64 es:0xbbbbbbbb]
+       mov eax,[a64 es:0xbbbbbbbb]
+       mov ebx,[a64 es:0xbbbbbbbb]
+       mov rax,[a64 es:0xbbbbbbbb]
+       mov rbx,[a64 es:0xbbbbbbbb]
+       mov al,[a64 es:0xffffffffcccccccc]
+       mov bl,[a64 es:0xffffffffcccccccc]
+       mov ax,[a64 es:0xffffffffcccccccc]
+       mov bx,[a64 es:0xffffffffcccccccc]
+       mov eax,[a64 es:0xffffffffcccccccc]
+       mov ebx,[a64 es:0xffffffffcccccccc]
+       mov rax,[a64 es:0xffffffffcccccccc]
+       mov rbx,[a64 es:0xffffffffcccccccc]
+
+       mov al,[a64 dword es:foo]
+       mov bl,[a64 dword es:foo]
+       mov ax,[a64 dword es:foo]
+       mov bx,[a64 dword es:foo]
+       mov eax,[a64 dword es:foo]
+       mov ebx,[a64 dword es:foo]
+       mov rax,[a64 dword es:foo]
+       mov rbx,[a64 dword es:foo]
+       mov al,[a64 dword es:0xaaaaaaaaaaaaaaaa]
+       mov bl,[a64 dword es:0xaaaaaaaaaaaaaaaa]
+       mov ax,[a64 dword es:0xaaaaaaaaaaaaaaaa]
+       mov bx,[a64 dword es:0xaaaaaaaaaaaaaaaa]
+       mov eax,[a64 dword es:0xaaaaaaaaaaaaaaaa]
+       mov ebx,[a64 dword es:0xaaaaaaaaaaaaaaaa]
+       mov rax,[a64 dword es:0xaaaaaaaaaaaaaaaa]
+       mov rbx,[a64 dword es:0xaaaaaaaaaaaaaaaa]
+       mov al,[a64 dword es:0xbbbbbbbb]
+       mov bl,[a64 dword es:0xbbbbbbbb]
+       mov ax,[a64 dword es:0xbbbbbbbb]
+       mov bx,[a64 dword es:0xbbbbbbbb]
+       mov eax,[a64 dword es:0xbbbbbbbb]
+       mov ebx,[a64 dword es:0xbbbbbbbb]
+       mov rax,[a64 dword es:0xbbbbbbbb]
+       mov rbx,[a64 dword es:0xbbbbbbbb]
+       mov al,[a64 dword es:0xffffffffcccccccc]
+       mov bl,[a64 dword es:0xffffffffcccccccc]
+       mov ax,[a64 dword es:0xffffffffcccccccc]
+       mov bx,[a64 dword es:0xffffffffcccccccc]
+       mov eax,[a64 dword es:0xffffffffcccccccc]
+       mov ebx,[a64 dword es:0xffffffffcccccccc]
+       mov rax,[a64 dword es:0xffffffffcccccccc]
+       mov rbx,[a64 dword es:0xffffffffcccccccc]
+
+       mov al,[a64 qword es:foo]
+       mov bl,[a64 qword es:foo]
+       mov ax,[a64 qword es:foo]
+       mov bx,[a64 qword es:foo]
+       mov eax,[a64 qword es:foo]
+       mov ebx,[a64 qword es:foo]
+       mov rax,[a64 qword es:foo]
+       mov rbx,[a64 qword es:foo]
+       mov al,[a64 qword es:0xaaaaaaaaaaaaaaaa]
+       mov bl,[a64 qword es:0xaaaaaaaaaaaaaaaa]
+       mov ax,[a64 qword es:0xaaaaaaaaaaaaaaaa]
+       mov bx,[a64 qword es:0xaaaaaaaaaaaaaaaa]
+       mov eax,[a64 qword es:0xaaaaaaaaaaaaaaaa]
+       mov ebx,[a64 qword es:0xaaaaaaaaaaaaaaaa]
+       mov rax,[a64 qword es:0xaaaaaaaaaaaaaaaa]
+       mov rbx,[a64 qword es:0xaaaaaaaaaaaaaaaa]
+       mov al,[a64 qword es:0xbbbbbbbb]
+       mov bl,[a64 qword es:0xbbbbbbbb]
+       mov ax,[a64 qword es:0xbbbbbbbb]
+       mov bx,[a64 qword es:0xbbbbbbbb]
+       mov eax,[a64 qword es:0xbbbbbbbb]
+       mov ebx,[a64 qword es:0xbbbbbbbb]
+       mov rax,[a64 qword es:0xbbbbbbbb]
+       mov rbx,[a64 qword es:0xbbbbbbbb]
+       mov al,[a64 qword es:0xffffffffcccccccc]
+       mov bl,[a64 qword es:0xffffffffcccccccc]
+       mov ax,[a64 qword es:0xffffffffcccccccc]
+       mov bx,[a64 qword es:0xffffffffcccccccc]
+       mov eax,[a64 qword es:0xffffffffcccccccc]
+       mov ebx,[a64 qword es:0xffffffffcccccccc]
+       mov rax,[a64 qword es:0xffffffffcccccccc]
+       mov rbx,[a64 qword es:0xffffffffcccccccc]
+
+       mov al,[a32 es:foo]
+       mov bl,[a32 es:foo]
+       mov ax,[a32 es:foo]
+       mov bx,[a32 es:foo]
+       mov eax,[a32 es:foo]
+       mov ebx,[a32 es:foo]
+       mov rax,[a32 es:foo]
+       mov rbx,[a32 es:foo]
+       mov al,[a32 es:0xaaaaaaaaaaaaaaaa]
+       mov bl,[a32 es:0xaaaaaaaaaaaaaaaa]
+       mov ax,[a32 es:0xaaaaaaaaaaaaaaaa]
+       mov bx,[a32 es:0xaaaaaaaaaaaaaaaa]
+       mov eax,[a32 es:0xaaaaaaaaaaaaaaaa]
+       mov ebx,[a32 es:0xaaaaaaaaaaaaaaaa]
+       mov rax,[a32 es:0xaaaaaaaaaaaaaaaa]
+       mov rbx,[a32 es:0xaaaaaaaaaaaaaaaa]
+       mov al,[a32 es:0xbbbbbbbb]
+       mov bl,[a32 es:0xbbbbbbbb]
+       mov ax,[a32 es:0xbbbbbbbb]
+       mov bx,[a32 es:0xbbbbbbbb]
+       mov eax,[a32 es:0xbbbbbbbb]
+       mov ebx,[a32 es:0xbbbbbbbb]
+       mov rax,[a32 es:0xbbbbbbbb]
+       mov rbx,[a32 es:0xbbbbbbbb]
+       mov al,[a32 es:0xffffffffcccccccc]
+       mov bl,[a32 es:0xffffffffcccccccc]
+       mov ax,[a32 es:0xffffffffcccccccc]
+       mov bx,[a32 es:0xffffffffcccccccc]
+       mov eax,[a32 es:0xffffffffcccccccc]
+       mov ebx,[a32 es:0xffffffffcccccccc]
+       mov rax,[a32 es:0xffffffffcccccccc]
+       mov rbx,[a32 es:0xffffffffcccccccc]
+
+       mov al,[a32 dword es:foo]
+       mov bl,[a32 dword es:foo]
+       mov ax,[a32 dword es:foo]
+       mov bx,[a32 dword es:foo]
+       mov eax,[a32 dword es:foo]
+       mov ebx,[a32 dword es:foo]
+       mov rax,[a32 dword es:foo]
+       mov rbx,[a32 dword es:foo]
+       mov al,[a32 dword es:0xaaaaaaaaaaaaaaaa]
+       mov bl,[a32 dword es:0xaaaaaaaaaaaaaaaa]
+       mov ax,[a32 dword es:0xaaaaaaaaaaaaaaaa]
+       mov bx,[a32 dword es:0xaaaaaaaaaaaaaaaa]
+       mov eax,[a32 dword es:0xaaaaaaaaaaaaaaaa]
+       mov ebx,[a32 dword es:0xaaaaaaaaaaaaaaaa]
+       mov rax,[a32 dword es:0xaaaaaaaaaaaaaaaa]
+       mov rbx,[a32 dword es:0xaaaaaaaaaaaaaaaa]
+       mov al,[a32 dword es:0xbbbbbbbb]
+       mov bl,[a32 dword es:0xbbbbbbbb]
+       mov ax,[a32 dword es:0xbbbbbbbb]
+       mov bx,[a32 dword es:0xbbbbbbbb]
+       mov eax,[a32 dword es:0xbbbbbbbb]
+       mov ebx,[a32 dword es:0xbbbbbbbb]
+       mov rax,[a32 dword es:0xbbbbbbbb]
+       mov rbx,[a32 dword es:0xbbbbbbbb]
+       mov al,[a32 dword es:0xffffffffcccccccc]
+       mov bl,[a32 dword es:0xffffffffcccccccc]
+       mov ax,[a32 dword es:0xffffffffcccccccc]
+       mov bx,[a32 dword es:0xffffffffcccccccc]
+       mov eax,[a32 dword es:0xffffffffcccccccc]
+       mov ebx,[a32 dword es:0xffffffffcccccccc]
+       mov rax,[a32 dword es:0xffffffffcccccccc]
+       mov rbx,[a32 dword es:0xffffffffcccccccc]
+
+       mov al,[a32 qword es:foo]
+       mov bl,[a32 qword es:foo]
+       mov ax,[a32 qword es:foo]
+       mov bx,[a32 qword es:foo]
+       mov eax,[a32 qword es:foo]
+       mov ebx,[a32 qword es:foo]
+       mov rax,[a32 qword es:foo]
+       mov rbx,[a32 qword es:foo]
+       mov al,[a32 qword es:0xaaaaaaaaaaaaaaaa]
+       mov bl,[a32 qword es:0xaaaaaaaaaaaaaaaa]
+       mov ax,[a32 qword es:0xaaaaaaaaaaaaaaaa]
+       mov bx,[a32 qword es:0xaaaaaaaaaaaaaaaa]
+       mov eax,[a32 qword es:0xaaaaaaaaaaaaaaaa]
+       mov ebx,[a32 qword es:0xaaaaaaaaaaaaaaaa]
+       mov rax,[a32 qword es:0xaaaaaaaaaaaaaaaa]
+       mov rbx,[a32 qword es:0xaaaaaaaaaaaaaaaa]
+       mov al,[a32 qword es:0xbbbbbbbb]
+       mov bl,[a32 qword es:0xbbbbbbbb]
+       mov ax,[a32 qword es:0xbbbbbbbb]
+       mov bx,[a32 qword es:0xbbbbbbbb]
+       mov eax,[a32 qword es:0xbbbbbbbb]
+       mov ebx,[a32 qword es:0xbbbbbbbb]
+       mov rax,[a32 qword es:0xbbbbbbbb]
+       mov rbx,[a32 qword es:0xbbbbbbbb]
+       mov al,[a32 qword es:0xffffffffcccccccc]
+       mov bl,[a32 qword es:0xffffffffcccccccc]
+       mov ax,[a32 qword es:0xffffffffcccccccc]
+       mov bx,[a32 qword es:0xffffffffcccccccc]
+       mov eax,[a32 qword es:0xffffffffcccccccc]
+       mov ebx,[a32 qword es:0xffffffffcccccccc]
+       mov rax,[a32 qword es:0xffffffffcccccccc]
+       mov rbx,[a32 qword es:0xffffffffcccccccc]
+
+       mov al,[abs es:foo]
+       mov bl,[abs es:foo]
+       mov ax,[abs es:foo]
+       mov bx,[abs es:foo]
+       mov eax,[abs es:foo]
+       mov ebx,[abs es:foo]
+       mov rax,[abs es:foo]
+       mov rbx,[abs es:foo]
+       mov al,[abs es:0xaaaaaaaaaaaaaaaa]
+       mov bl,[abs es:0xaaaaaaaaaaaaaaaa]
+       mov ax,[abs es:0xaaaaaaaaaaaaaaaa]
+       mov bx,[abs es:0xaaaaaaaaaaaaaaaa]
+       mov eax,[abs es:0xaaaaaaaaaaaaaaaa]
+       mov ebx,[abs es:0xaaaaaaaaaaaaaaaa]
+       mov rax,[abs es:0xaaaaaaaaaaaaaaaa]
+       mov rbx,[abs es:0xaaaaaaaaaaaaaaaa]
+       mov al,[abs es:0xbbbbbbbb]
+       mov bl,[abs es:0xbbbbbbbb]
+       mov ax,[abs es:0xbbbbbbbb]
+       mov bx,[abs es:0xbbbbbbbb]
+       mov eax,[abs es:0xbbbbbbbb]
+       mov ebx,[abs es:0xbbbbbbbb]
+       mov rax,[abs es:0xbbbbbbbb]
+       mov rbx,[abs es:0xbbbbbbbb]
+       mov al,[abs es:0xffffffffcccccccc]
+       mov bl,[abs es:0xffffffffcccccccc]
+       mov ax,[abs es:0xffffffffcccccccc]
+       mov bx,[abs es:0xffffffffcccccccc]
+       mov eax,[abs es:0xffffffffcccccccc]
+       mov ebx,[abs es:0xffffffffcccccccc]
+       mov rax,[abs es:0xffffffffcccccccc]
+       mov rbx,[abs es:0xffffffffcccccccc]
+
+       mov al,[abs dword es:foo]
+       mov bl,[abs dword es:foo]
+       mov ax,[abs dword es:foo]
+       mov bx,[abs dword es:foo]
+       mov eax,[abs dword es:foo]
+       mov ebx,[abs dword es:foo]
+       mov rax,[abs dword es:foo]
+       mov rbx,[abs dword es:foo]
+       mov al,[abs dword es:0xaaaaaaaaaaaaaaaa]
+       mov bl,[abs dword es:0xaaaaaaaaaaaaaaaa]
+       mov ax,[abs dword es:0xaaaaaaaaaaaaaaaa]
+       mov bx,[abs dword es:0xaaaaaaaaaaaaaaaa]
+       mov eax,[abs dword es:0xaaaaaaaaaaaaaaaa]
+       mov ebx,[abs dword es:0xaaaaaaaaaaaaaaaa]
+       mov rax,[abs dword es:0xaaaaaaaaaaaaaaaa]
+       mov rbx,[abs dword es:0xaaaaaaaaaaaaaaaa]
+       mov al,[abs dword es:0xbbbbbbbb]
+       mov bl,[abs dword es:0xbbbbbbbb]
+       mov ax,[abs dword es:0xbbbbbbbb]
+       mov bx,[abs dword es:0xbbbbbbbb]
+       mov eax,[abs dword es:0xbbbbbbbb]
+       mov ebx,[abs dword es:0xbbbbbbbb]
+       mov rax,[abs dword es:0xbbbbbbbb]
+       mov rbx,[abs dword es:0xbbbbbbbb]
+       mov al,[abs dword es:0xffffffffcccccccc]
+       mov bl,[abs dword es:0xffffffffcccccccc]
+       mov ax,[abs dword es:0xffffffffcccccccc]
+       mov bx,[abs dword es:0xffffffffcccccccc]
+       mov eax,[abs dword es:0xffffffffcccccccc]
+       mov ebx,[abs dword es:0xffffffffcccccccc]
+       mov rax,[abs dword es:0xffffffffcccccccc]
+       mov rbx,[abs dword es:0xffffffffcccccccc]
+
+       mov al,[abs qword es:foo]
+       mov bl,[abs qword es:foo]
+       mov ax,[abs qword es:foo]
+       mov bx,[abs qword es:foo]
+       mov eax,[abs qword es:foo]
+       mov ebx,[abs qword es:foo]
+       mov rax,[abs qword es:foo]
+       mov rbx,[abs qword es:foo]
+       mov al,[abs qword es:0xaaaaaaaaaaaaaaaa]
+       mov bl,[abs qword es:0xaaaaaaaaaaaaaaaa]
+       mov ax,[abs qword es:0xaaaaaaaaaaaaaaaa]
+       mov bx,[abs qword es:0xaaaaaaaaaaaaaaaa]
+       mov eax,[abs qword es:0xaaaaaaaaaaaaaaaa]
+       mov ebx,[abs qword es:0xaaaaaaaaaaaaaaaa]
+       mov rax,[abs qword es:0xaaaaaaaaaaaaaaaa]
+       mov rbx,[abs qword es:0xaaaaaaaaaaaaaaaa]
+       mov al,[abs qword es:0xbbbbbbbb]
+       mov bl,[abs qword es:0xbbbbbbbb]
+       mov ax,[abs qword es:0xbbbbbbbb]
+       mov bx,[abs qword es:0xbbbbbbbb]
+       mov eax,[abs qword es:0xbbbbbbbb]
+       mov ebx,[abs qword es:0xbbbbbbbb]
+       mov rax,[abs qword es:0xbbbbbbbb]
+       mov rbx,[abs qword es:0xbbbbbbbb]
+       mov al,[abs qword es:0xffffffffcccccccc]
+       mov bl,[abs qword es:0xffffffffcccccccc]
+       mov ax,[abs qword es:0xffffffffcccccccc]
+       mov bx,[abs qword es:0xffffffffcccccccc]
+       mov eax,[abs qword es:0xffffffffcccccccc]
+       mov ebx,[abs qword es:0xffffffffcccccccc]
+       mov rax,[abs qword es:0xffffffffcccccccc]
+       mov rbx,[abs qword es:0xffffffffcccccccc]
+
+       mov al,[a64 abs es:foo]
+       mov bl,[a64 abs es:foo]
+       mov ax,[a64 abs es:foo]
+       mov bx,[a64 abs es:foo]
+       mov eax,[a64 abs es:foo]
+       mov ebx,[a64 abs es:foo]
+       mov rax,[a64 abs es:foo]
+       mov rbx,[a64 abs es:foo]
+       mov al,[a64 abs es:0xaaaaaaaaaaaaaaaa]
+       mov bl,[a64 abs es:0xaaaaaaaaaaaaaaaa]
+       mov ax,[a64 abs es:0xaaaaaaaaaaaaaaaa]
+       mov bx,[a64 abs es:0xaaaaaaaaaaaaaaaa]
+       mov eax,[a64 abs es:0xaaaaaaaaaaaaaaaa]
+       mov ebx,[a64 abs es:0xaaaaaaaaaaaaaaaa]
+       mov rax,[a64 abs es:0xaaaaaaaaaaaaaaaa]
+       mov rbx,[a64 abs es:0xaaaaaaaaaaaaaaaa]
+       mov al,[a64 abs es:0xbbbbbbbb]
+       mov bl,[a64 abs es:0xbbbbbbbb]
+       mov ax,[a64 abs es:0xbbbbbbbb]
+       mov bx,[a64 abs es:0xbbbbbbbb]
+       mov eax,[a64 abs es:0xbbbbbbbb]
+       mov ebx,[a64 abs es:0xbbbbbbbb]
+       mov rax,[a64 abs es:0xbbbbbbbb]
+       mov rbx,[a64 abs es:0xbbbbbbbb]
+       mov al,[a64 abs es:0xffffffffcccccccc]
+       mov bl,[a64 abs es:0xffffffffcccccccc]
+       mov ax,[a64 abs es:0xffffffffcccccccc]
+       mov bx,[a64 abs es:0xffffffffcccccccc]
+       mov eax,[a64 abs es:0xffffffffcccccccc]
+       mov ebx,[a64 abs es:0xffffffffcccccccc]
+       mov rax,[a64 abs es:0xffffffffcccccccc]
+       mov rbx,[a64 abs es:0xffffffffcccccccc]
+
+       mov al,[a64 abs dword es:foo]
+       mov bl,[a64 abs dword es:foo]
+       mov ax,[a64 abs dword es:foo]
+       mov bx,[a64 abs dword es:foo]
+       mov eax,[a64 abs dword es:foo]
+       mov ebx,[a64 abs dword es:foo]
+       mov rax,[a64 abs dword es:foo]
+       mov rbx,[a64 abs dword es:foo]
+       mov al,[a64 abs dword es:0xaaaaaaaaaaaaaaaa]
+       mov bl,[a64 abs dword es:0xaaaaaaaaaaaaaaaa]
+       mov ax,[a64 abs dword es:0xaaaaaaaaaaaaaaaa]
+       mov bx,[a64 abs dword es:0xaaaaaaaaaaaaaaaa]
+       mov eax,[a64 abs dword es:0xaaaaaaaaaaaaaaaa]
+       mov ebx,[a64 abs dword es:0xaaaaaaaaaaaaaaaa]
+       mov rax,[a64 abs dword es:0xaaaaaaaaaaaaaaaa]
+       mov rbx,[a64 abs dword es:0xaaaaaaaaaaaaaaaa]
+       mov al,[a64 abs dword es:0xbbbbbbbb]
+       mov bl,[a64 abs dword es:0xbbbbbbbb]
+       mov ax,[a64 abs dword es:0xbbbbbbbb]
+       mov bx,[a64 abs dword es:0xbbbbbbbb]
+       mov eax,[a64 abs dword es:0xbbbbbbbb]
+       mov ebx,[a64 abs dword es:0xbbbbbbbb]
+       mov rax,[a64 abs dword es:0xbbbbbbbb]
+       mov rbx,[a64 abs dword es:0xbbbbbbbb]
+       mov al,[a64 abs dword es:0xffffffffcccccccc]
+       mov bl,[a64 abs dword es:0xffffffffcccccccc]
+       mov ax,[a64 abs dword es:0xffffffffcccccccc]
+       mov bx,[a64 abs dword es:0xffffffffcccccccc]
+       mov eax,[a64 abs dword es:0xffffffffcccccccc]
+       mov ebx,[a64 abs dword es:0xffffffffcccccccc]
+       mov rax,[a64 abs dword es:0xffffffffcccccccc]
+       mov rbx,[a64 abs dword es:0xffffffffcccccccc]
+
+       mov al,[a64 abs qword es:foo]
+       mov bl,[a64 abs qword es:foo]
+       mov ax,[a64 abs qword es:foo]
+       mov bx,[a64 abs qword es:foo]
+       mov eax,[a64 abs qword es:foo]
+       mov ebx,[a64 abs qword es:foo]
+       mov rax,[a64 abs qword es:foo]
+       mov rbx,[a64 abs qword es:foo]
+       mov al,[a64 abs qword es:0xaaaaaaaaaaaaaaaa]
+       mov bl,[a64 abs qword es:0xaaaaaaaaaaaaaaaa]
+       mov ax,[a64 abs qword es:0xaaaaaaaaaaaaaaaa]
+       mov bx,[a64 abs qword es:0xaaaaaaaaaaaaaaaa]
+       mov eax,[a64 abs qword es:0xaaaaaaaaaaaaaaaa]
+       mov ebx,[a64 abs qword es:0xaaaaaaaaaaaaaaaa]
+       mov rax,[a64 abs qword es:0xaaaaaaaaaaaaaaaa]
+       mov rbx,[a64 abs qword es:0xaaaaaaaaaaaaaaaa]
+       mov al,[a64 abs qword es:0xbbbbbbbb]
+       mov bl,[a64 abs qword es:0xbbbbbbbb]
+       mov ax,[a64 abs qword es:0xbbbbbbbb]
+       mov bx,[a64 abs qword es:0xbbbbbbbb]
+       mov eax,[a64 abs qword es:0xbbbbbbbb]
+       mov ebx,[a64 abs qword es:0xbbbbbbbb]
+       mov rax,[a64 abs qword es:0xbbbbbbbb]
+       mov rbx,[a64 abs qword es:0xbbbbbbbb]
+       mov al,[a64 abs qword es:0xffffffffcccccccc]
+       mov bl,[a64 abs qword es:0xffffffffcccccccc]
+       mov ax,[a64 abs qword es:0xffffffffcccccccc]
+       mov bx,[a64 abs qword es:0xffffffffcccccccc]
+       mov eax,[a64 abs qword es:0xffffffffcccccccc]
+       mov ebx,[a64 abs qword es:0xffffffffcccccccc]
+       mov rax,[a64 abs qword es:0xffffffffcccccccc]
+       mov rbx,[a64 abs qword es:0xffffffffcccccccc]
+
+       mov al,[a32 abs es:foo]
+       mov bl,[a32 abs es:foo]
+       mov ax,[a32 abs es:foo]
+       mov bx,[a32 abs es:foo]
+       mov eax,[a32 abs es:foo]
+       mov ebx,[a32 abs es:foo]
+       mov rax,[a32 abs es:foo]
+       mov rbx,[a32 abs es:foo]
+       mov al,[a32 abs es:0xaaaaaaaaaaaaaaaa]
+       mov bl,[a32 abs es:0xaaaaaaaaaaaaaaaa]
+       mov ax,[a32 abs es:0xaaaaaaaaaaaaaaaa]
+       mov bx,[a32 abs es:0xaaaaaaaaaaaaaaaa]
+       mov eax,[a32 abs es:0xaaaaaaaaaaaaaaaa]
+       mov ebx,[a32 abs es:0xaaaaaaaaaaaaaaaa]
+       mov rax,[a32 abs es:0xaaaaaaaaaaaaaaaa]
+       mov rbx,[a32 abs es:0xaaaaaaaaaaaaaaaa]
+       mov al,[a32 abs es:0xbbbbbbbb]
+       mov bl,[a32 abs es:0xbbbbbbbb]
+       mov ax,[a32 abs es:0xbbbbbbbb]
+       mov bx,[a32 abs es:0xbbbbbbbb]
+       mov eax,[a32 abs es:0xbbbbbbbb]
+       mov ebx,[a32 abs es:0xbbbbbbbb]
+       mov rax,[a32 abs es:0xbbbbbbbb]
+       mov rbx,[a32 abs es:0xbbbbbbbb]
+       mov al,[a32 abs es:0xffffffffcccccccc]
+       mov bl,[a32 abs es:0xffffffffcccccccc]
+       mov ax,[a32 abs es:0xffffffffcccccccc]
+       mov bx,[a32 abs es:0xffffffffcccccccc]
+       mov eax,[a32 abs es:0xffffffffcccccccc]
+       mov ebx,[a32 abs es:0xffffffffcccccccc]
+       mov rax,[a32 abs es:0xffffffffcccccccc]
+       mov rbx,[a32 abs es:0xffffffffcccccccc]
+
+       mov al,[a32 abs dword es:foo]
+       mov bl,[a32 abs dword es:foo]
+       mov ax,[a32 abs dword es:foo]
+       mov bx,[a32 abs dword es:foo]
+       mov eax,[a32 abs dword es:foo]
+       mov ebx,[a32 abs dword es:foo]
+       mov rax,[a32 abs dword es:foo]
+       mov rbx,[a32 abs dword es:foo]
+       mov al,[a32 abs dword es:0xaaaaaaaaaaaaaaaa]
+       mov bl,[a32 abs dword es:0xaaaaaaaaaaaaaaaa]
+       mov ax,[a32 abs dword es:0xaaaaaaaaaaaaaaaa]
+       mov bx,[a32 abs dword es:0xaaaaaaaaaaaaaaaa]
+       mov eax,[a32 abs dword es:0xaaaaaaaaaaaaaaaa]
+       mov ebx,[a32 abs dword es:0xaaaaaaaaaaaaaaaa]
+       mov rax,[a32 abs dword es:0xaaaaaaaaaaaaaaaa]
+       mov rbx,[a32 abs dword es:0xaaaaaaaaaaaaaaaa]
+       mov al,[a32 abs dword es:0xbbbbbbbb]
+       mov bl,[a32 abs dword es:0xbbbbbbbb]
+       mov ax,[a32 abs dword es:0xbbbbbbbb]
+       mov bx,[a32 abs dword es:0xbbbbbbbb]
+       mov eax,[a32 abs dword es:0xbbbbbbbb]
+       mov ebx,[a32 abs dword es:0xbbbbbbbb]
+       mov rax,[a32 abs dword es:0xbbbbbbbb]
+       mov rbx,[a32 abs dword es:0xbbbbbbbb]
+       mov al,[a32 abs dword es:0xffffffffcccccccc]
+       mov bl,[a32 abs dword es:0xffffffffcccccccc]
+       mov ax,[a32 abs dword es:0xffffffffcccccccc]
+       mov bx,[a32 abs dword es:0xffffffffcccccccc]
+       mov eax,[a32 abs dword es:0xffffffffcccccccc]
+       mov ebx,[a32 abs dword es:0xffffffffcccccccc]
+       mov rax,[a32 abs dword es:0xffffffffcccccccc]
+       mov rbx,[a32 abs dword es:0xffffffffcccccccc]
+
+       mov al,[a32 abs qword es:foo]
+       mov bl,[a32 abs qword es:foo]
+       mov ax,[a32 abs qword es:foo]
+       mov bx,[a32 abs qword es:foo]
+       mov eax,[a32 abs qword es:foo]
+       mov ebx,[a32 abs qword es:foo]
+       mov rax,[a32 abs qword es:foo]
+       mov rbx,[a32 abs qword es:foo]
+       mov al,[a32 abs qword es:0xaaaaaaaaaaaaaaaa]
+       mov bl,[a32 abs qword es:0xaaaaaaaaaaaaaaaa]
+       mov ax,[a32 abs qword es:0xaaaaaaaaaaaaaaaa]
+       mov bx,[a32 abs qword es:0xaaaaaaaaaaaaaaaa]
+       mov eax,[a32 abs qword es:0xaaaaaaaaaaaaaaaa]
+       mov ebx,[a32 abs qword es:0xaaaaaaaaaaaaaaaa]
+       mov rax,[a32 abs qword es:0xaaaaaaaaaaaaaaaa]
+       mov rbx,[a32 abs qword es:0xaaaaaaaaaaaaaaaa]
+       mov al,[a32 abs qword es:0xbbbbbbbb]
+       mov bl,[a32 abs qword es:0xbbbbbbbb]
+       mov ax,[a32 abs qword es:0xbbbbbbbb]
+       mov bx,[a32 abs qword es:0xbbbbbbbb]
+       mov eax,[a32 abs qword es:0xbbbbbbbb]
+       mov ebx,[a32 abs qword es:0xbbbbbbbb]
+       mov rax,[a32 abs qword es:0xbbbbbbbb]
+       mov rbx,[a32 abs qword es:0xbbbbbbbb]
+       mov al,[a32 abs qword es:0xffffffffcccccccc]
+       mov bl,[a32 abs qword es:0xffffffffcccccccc]
+       mov ax,[a32 abs qword es:0xffffffffcccccccc]
+       mov bx,[a32 abs qword es:0xffffffffcccccccc]
+       mov eax,[a32 abs qword es:0xffffffffcccccccc]
+       mov ebx,[a32 abs qword es:0xffffffffcccccccc]
+       mov rax,[a32 abs qword es:0xffffffffcccccccc]
+       mov rbx,[a32 abs qword es:0xffffffffcccccccc]
+
+       mov al,[rel es:foo]
+       mov bl,[rel es:foo]
+       mov ax,[rel es:foo]
+       mov bx,[rel es:foo]
+       mov eax,[rel es:foo]
+       mov ebx,[rel es:foo]
+       mov rax,[rel es:foo]
+       mov rbx,[rel es:foo]
+       mov al,[rel es:0xaaaaaaaaaaaaaaaa]
+       mov bl,[rel es:0xaaaaaaaaaaaaaaaa]
+       mov ax,[rel es:0xaaaaaaaaaaaaaaaa]
+       mov bx,[rel es:0xaaaaaaaaaaaaaaaa]
+       mov eax,[rel es:0xaaaaaaaaaaaaaaaa]
+       mov ebx,[rel es:0xaaaaaaaaaaaaaaaa]
+       mov rax,[rel es:0xaaaaaaaaaaaaaaaa]
+       mov rbx,[rel es:0xaaaaaaaaaaaaaaaa]
+       mov al,[rel es:0xbbbbbbbb]
+       mov bl,[rel es:0xbbbbbbbb]
+       mov ax,[rel es:0xbbbbbbbb]
+       mov bx,[rel es:0xbbbbbbbb]
+       mov eax,[rel es:0xbbbbbbbb]
+       mov ebx,[rel es:0xbbbbbbbb]
+       mov rax,[rel es:0xbbbbbbbb]
+       mov rbx,[rel es:0xbbbbbbbb]
+       mov al,[rel es:0xffffffffcccccccc]
+       mov bl,[rel es:0xffffffffcccccccc]
+       mov ax,[rel es:0xffffffffcccccccc]
+       mov bx,[rel es:0xffffffffcccccccc]
+       mov eax,[rel es:0xffffffffcccccccc]
+       mov ebx,[rel es:0xffffffffcccccccc]
+       mov rax,[rel es:0xffffffffcccccccc]
+       mov rbx,[rel es:0xffffffffcccccccc]
+
+       mov al,[rel dword es:foo]
+       mov bl,[rel dword es:foo]
+       mov ax,[rel dword es:foo]
+       mov bx,[rel dword es:foo]
+       mov eax,[rel dword es:foo]
+       mov ebx,[rel dword es:foo]
+       mov rax,[rel dword es:foo]
+       mov rbx,[rel dword es:foo]
+       mov al,[rel dword es:0xaaaaaaaaaaaaaaaa]
+       mov bl,[rel dword es:0xaaaaaaaaaaaaaaaa]
+       mov ax,[rel dword es:0xaaaaaaaaaaaaaaaa]
+       mov bx,[rel dword es:0xaaaaaaaaaaaaaaaa]
+       mov eax,[rel dword es:0xaaaaaaaaaaaaaaaa]
+       mov ebx,[rel dword es:0xaaaaaaaaaaaaaaaa]
+       mov rax,[rel dword es:0xaaaaaaaaaaaaaaaa]
+       mov rbx,[rel dword es:0xaaaaaaaaaaaaaaaa]
+       mov al,[rel dword es:0xbbbbbbbb]
+       mov bl,[rel dword es:0xbbbbbbbb]
+       mov ax,[rel dword es:0xbbbbbbbb]
+       mov bx,[rel dword es:0xbbbbbbbb]
+       mov eax,[rel dword es:0xbbbbbbbb]
+       mov ebx,[rel dword es:0xbbbbbbbb]
+       mov rax,[rel dword es:0xbbbbbbbb]
+       mov rbx,[rel dword es:0xbbbbbbbb]
+       mov al,[rel dword es:0xffffffffcccccccc]
+       mov bl,[rel dword es:0xffffffffcccccccc]
+       mov ax,[rel dword es:0xffffffffcccccccc]
+       mov bx,[rel dword es:0xffffffffcccccccc]
+       mov eax,[rel dword es:0xffffffffcccccccc]
+       mov ebx,[rel dword es:0xffffffffcccccccc]
+       mov rax,[rel dword es:0xffffffffcccccccc]
+       mov rbx,[rel dword es:0xffffffffcccccccc]
+
+       mov al,[rel qword es:foo]
+       mov bl,[rel qword es:foo]
+       mov ax,[rel qword es:foo]
+       mov bx,[rel qword es:foo]
+       mov eax,[rel qword es:foo]
+       mov ebx,[rel qword es:foo]
+       mov rax,[rel qword es:foo]
+       mov rbx,[rel qword es:foo]
+       mov al,[rel qword es:0xaaaaaaaaaaaaaaaa]
+       mov bl,[rel qword es:0xaaaaaaaaaaaaaaaa]
+       mov ax,[rel qword es:0xaaaaaaaaaaaaaaaa]
+       mov bx,[rel qword es:0xaaaaaaaaaaaaaaaa]
+       mov eax,[rel qword es:0xaaaaaaaaaaaaaaaa]
+       mov ebx,[rel qword es:0xaaaaaaaaaaaaaaaa]
+       mov rax,[rel qword es:0xaaaaaaaaaaaaaaaa]
+       mov rbx,[rel qword es:0xaaaaaaaaaaaaaaaa]
+       mov al,[rel qword es:0xbbbbbbbb]
+       mov bl,[rel qword es:0xbbbbbbbb]
+       mov ax,[rel qword es:0xbbbbbbbb]
+       mov bx,[rel qword es:0xbbbbbbbb]
+       mov eax,[rel qword es:0xbbbbbbbb]
+       mov ebx,[rel qword es:0xbbbbbbbb]
+       mov rax,[rel qword es:0xbbbbbbbb]
+       mov rbx,[rel qword es:0xbbbbbbbb]
+       mov al,[rel qword es:0xffffffffcccccccc]
+       mov bl,[rel qword es:0xffffffffcccccccc]
+       mov ax,[rel qword es:0xffffffffcccccccc]
+       mov bx,[rel qword es:0xffffffffcccccccc]
+       mov eax,[rel qword es:0xffffffffcccccccc]
+       mov ebx,[rel qword es:0xffffffffcccccccc]
+       mov rax,[rel qword es:0xffffffffcccccccc]
+       mov rbx,[rel qword es:0xffffffffcccccccc]
+
+       mov al,[a64 rel es:foo]
+       mov bl,[a64 rel es:foo]
+       mov ax,[a64 rel es:foo]
+       mov bx,[a64 rel es:foo]
+       mov eax,[a64 rel es:foo]
+       mov ebx,[a64 rel es:foo]
+       mov rax,[a64 rel es:foo]
+       mov rbx,[a64 rel es:foo]
+       mov al,[a64 rel es:0xaaaaaaaaaaaaaaaa]
+       mov bl,[a64 rel es:0xaaaaaaaaaaaaaaaa]
+       mov ax,[a64 rel es:0xaaaaaaaaaaaaaaaa]
+       mov bx,[a64 rel es:0xaaaaaaaaaaaaaaaa]
+       mov eax,[a64 rel es:0xaaaaaaaaaaaaaaaa]
+       mov ebx,[a64 rel es:0xaaaaaaaaaaaaaaaa]
+       mov rax,[a64 rel es:0xaaaaaaaaaaaaaaaa]
+       mov rbx,[a64 rel es:0xaaaaaaaaaaaaaaaa]
+       mov al,[a64 rel es:0xbbbbbbbb]
+       mov bl,[a64 rel es:0xbbbbbbbb]
+       mov ax,[a64 rel es:0xbbbbbbbb]
+       mov bx,[a64 rel es:0xbbbbbbbb]
+       mov eax,[a64 rel es:0xbbbbbbbb]
+       mov ebx,[a64 rel es:0xbbbbbbbb]
+       mov rax,[a64 rel es:0xbbbbbbbb]
+       mov rbx,[a64 rel es:0xbbbbbbbb]
+       mov al,[a64 rel es:0xffffffffcccccccc]
+       mov bl,[a64 rel es:0xffffffffcccccccc]
+       mov ax,[a64 rel es:0xffffffffcccccccc]
+       mov bx,[a64 rel es:0xffffffffcccccccc]
+       mov eax,[a64 rel es:0xffffffffcccccccc]
+       mov ebx,[a64 rel es:0xffffffffcccccccc]
+       mov rax,[a64 rel es:0xffffffffcccccccc]
+       mov rbx,[a64 rel es:0xffffffffcccccccc]
+
+       mov al,[a64 rel dword es:foo]
+       mov bl,[a64 rel dword es:foo]
+       mov ax,[a64 rel dword es:foo]
+       mov bx,[a64 rel dword es:foo]
+       mov eax,[a64 rel dword es:foo]
+       mov ebx,[a64 rel dword es:foo]
+       mov rax,[a64 rel dword es:foo]
+       mov rbx,[a64 rel dword es:foo]
+       mov al,[a64 rel dword es:0xaaaaaaaaaaaaaaaa]
+       mov bl,[a64 rel dword es:0xaaaaaaaaaaaaaaaa]
+       mov ax,[a64 rel dword es:0xaaaaaaaaaaaaaaaa]
+       mov bx,[a64 rel dword es:0xaaaaaaaaaaaaaaaa]
+       mov eax,[a64 rel dword es:0xaaaaaaaaaaaaaaaa]
+       mov ebx,[a64 rel dword es:0xaaaaaaaaaaaaaaaa]
+       mov rax,[a64 rel dword es:0xaaaaaaaaaaaaaaaa]
+       mov rbx,[a64 rel dword es:0xaaaaaaaaaaaaaaaa]
+       mov al,[a64 rel dword es:0xbbbbbbbb]
+       mov bl,[a64 rel dword es:0xbbbbbbbb]
+       mov ax,[a64 rel dword es:0xbbbbbbbb]
+       mov bx,[a64 rel dword es:0xbbbbbbbb]
+       mov eax,[a64 rel dword es:0xbbbbbbbb]
+       mov ebx,[a64 rel dword es:0xbbbbbbbb]
+       mov rax,[a64 rel dword es:0xbbbbbbbb]
+       mov rbx,[a64 rel dword es:0xbbbbbbbb]
+       mov al,[a64 rel dword es:0xffffffffcccccccc]
+       mov bl,[a64 rel dword es:0xffffffffcccccccc]
+       mov ax,[a64 rel dword es:0xffffffffcccccccc]
+       mov bx,[a64 rel dword es:0xffffffffcccccccc]
+       mov eax,[a64 rel dword es:0xffffffffcccccccc]
+       mov ebx,[a64 rel dword es:0xffffffffcccccccc]
+       mov rax,[a64 rel dword es:0xffffffffcccccccc]
+       mov rbx,[a64 rel dword es:0xffffffffcccccccc]
+
+       mov al,[a64 rel qword es:foo]
+       mov bl,[a64 rel qword es:foo]
+       mov ax,[a64 rel qword es:foo]
+       mov bx,[a64 rel qword es:foo]
+       mov eax,[a64 rel qword es:foo]
+       mov ebx,[a64 rel qword es:foo]
+       mov rax,[a64 rel qword es:foo]
+       mov rbx,[a64 rel qword es:foo]
+       mov al,[a64 rel qword es:0xaaaaaaaaaaaaaaaa]
+       mov bl,[a64 rel qword es:0xaaaaaaaaaaaaaaaa]
+       mov ax,[a64 rel qword es:0xaaaaaaaaaaaaaaaa]
+       mov bx,[a64 rel qword es:0xaaaaaaaaaaaaaaaa]
+       mov eax,[a64 rel qword es:0xaaaaaaaaaaaaaaaa]
+       mov ebx,[a64 rel qword es:0xaaaaaaaaaaaaaaaa]
+       mov rax,[a64 rel qword es:0xaaaaaaaaaaaaaaaa]
+       mov rbx,[a64 rel qword es:0xaaaaaaaaaaaaaaaa]
+       mov al,[a64 rel qword es:0xbbbbbbbb]
+       mov bl,[a64 rel qword es:0xbbbbbbbb]
+       mov ax,[a64 rel qword es:0xbbbbbbbb]
+       mov bx,[a64 rel qword es:0xbbbbbbbb]
+       mov eax,[a64 rel qword es:0xbbbbbbbb]
+       mov ebx,[a64 rel qword es:0xbbbbbbbb]
+       mov rax,[a64 rel qword es:0xbbbbbbbb]
+       mov rbx,[a64 rel qword es:0xbbbbbbbb]
+       mov al,[a64 rel qword es:0xffffffffcccccccc]
+       mov bl,[a64 rel qword es:0xffffffffcccccccc]
+       mov ax,[a64 rel qword es:0xffffffffcccccccc]
+       mov bx,[a64 rel qword es:0xffffffffcccccccc]
+       mov eax,[a64 rel qword es:0xffffffffcccccccc]
+       mov ebx,[a64 rel qword es:0xffffffffcccccccc]
+       mov rax,[a64 rel qword es:0xffffffffcccccccc]
+       mov rbx,[a64 rel qword es:0xffffffffcccccccc]
+
+       mov al,[a32 rel es:foo]
+       mov bl,[a32 rel es:foo]
+       mov ax,[a32 rel es:foo]
+       mov bx,[a32 rel es:foo]
+       mov eax,[a32 rel es:foo]
+       mov ebx,[a32 rel es:foo]
+       mov rax,[a32 rel es:foo]
+       mov rbx,[a32 rel es:foo]
+       mov al,[a32 rel es:0xaaaaaaaaaaaaaaaa]
+       mov bl,[a32 rel es:0xaaaaaaaaaaaaaaaa]
+       mov ax,[a32 rel es:0xaaaaaaaaaaaaaaaa]
+       mov bx,[a32 rel es:0xaaaaaaaaaaaaaaaa]
+       mov eax,[a32 rel es:0xaaaaaaaaaaaaaaaa]
+       mov ebx,[a32 rel es:0xaaaaaaaaaaaaaaaa]
+       mov rax,[a32 rel es:0xaaaaaaaaaaaaaaaa]
+       mov rbx,[a32 rel es:0xaaaaaaaaaaaaaaaa]
+       mov al,[a32 rel es:0xbbbbbbbb]
+       mov bl,[a32 rel es:0xbbbbbbbb]
+       mov ax,[a32 rel es:0xbbbbbbbb]
+       mov bx,[a32 rel es:0xbbbbbbbb]
+       mov eax,[a32 rel es:0xbbbbbbbb]
+       mov ebx,[a32 rel es:0xbbbbbbbb]
+       mov rax,[a32 rel es:0xbbbbbbbb]
+       mov rbx,[a32 rel es:0xbbbbbbbb]
+       mov al,[a32 rel es:0xffffffffcccccccc]
+       mov bl,[a32 rel es:0xffffffffcccccccc]
+       mov ax,[a32 rel es:0xffffffffcccccccc]
+       mov bx,[a32 rel es:0xffffffffcccccccc]
+       mov eax,[a32 rel es:0xffffffffcccccccc]
+       mov ebx,[a32 rel es:0xffffffffcccccccc]
+       mov rax,[a32 rel es:0xffffffffcccccccc]
+       mov rbx,[a32 rel es:0xffffffffcccccccc]
+
+       mov al,[a32 rel dword es:foo]
+       mov bl,[a32 rel dword es:foo]
+       mov ax,[a32 rel dword es:foo]
+       mov bx,[a32 rel dword es:foo]
+       mov eax,[a32 rel dword es:foo]
+       mov ebx,[a32 rel dword es:foo]
+       mov rax,[a32 rel dword es:foo]
+       mov rbx,[a32 rel dword es:foo]
+       mov al,[a32 rel dword es:0xaaaaaaaaaaaaaaaa]
+       mov bl,[a32 rel dword es:0xaaaaaaaaaaaaaaaa]
+       mov ax,[a32 rel dword es:0xaaaaaaaaaaaaaaaa]
+       mov bx,[a32 rel dword es:0xaaaaaaaaaaaaaaaa]
+       mov eax,[a32 rel dword es:0xaaaaaaaaaaaaaaaa]
+       mov ebx,[a32 rel dword es:0xaaaaaaaaaaaaaaaa]
+       mov rax,[a32 rel dword es:0xaaaaaaaaaaaaaaaa]
+       mov rbx,[a32 rel dword es:0xaaaaaaaaaaaaaaaa]
+       mov al,[a32 rel dword es:0xbbbbbbbb]
+       mov bl,[a32 rel dword es:0xbbbbbbbb]
+       mov ax,[a32 rel dword es:0xbbbbbbbb]
+       mov bx,[a32 rel dword es:0xbbbbbbbb]
+       mov eax,[a32 rel dword es:0xbbbbbbbb]
+       mov ebx,[a32 rel dword es:0xbbbbbbbb]
+       mov rax,[a32 rel dword es:0xbbbbbbbb]
+       mov rbx,[a32 rel dword es:0xbbbbbbbb]
+       mov al,[a32 rel dword es:0xffffffffcccccccc]
+       mov bl,[a32 rel dword es:0xffffffffcccccccc]
+       mov ax,[a32 rel dword es:0xffffffffcccccccc]
+       mov bx,[a32 rel dword es:0xffffffffcccccccc]
+       mov eax,[a32 rel dword es:0xffffffffcccccccc]
+       mov ebx,[a32 rel dword es:0xffffffffcccccccc]
+       mov rax,[a32 rel dword es:0xffffffffcccccccc]
+       mov rbx,[a32 rel dword es:0xffffffffcccccccc]
+
+       mov al,[a32 rel qword es:foo]
+       mov bl,[a32 rel qword es:foo]
+       mov ax,[a32 rel qword es:foo]
+       mov bx,[a32 rel qword es:foo]
+       mov eax,[a32 rel qword es:foo]
+       mov ebx,[a32 rel qword es:foo]
+       mov rax,[a32 rel qword es:foo]
+       mov rbx,[a32 rel qword es:foo]
+       mov al,[a32 rel qword es:0xaaaaaaaaaaaaaaaa]
+       mov bl,[a32 rel qword es:0xaaaaaaaaaaaaaaaa]
+       mov ax,[a32 rel qword es:0xaaaaaaaaaaaaaaaa]
+       mov bx,[a32 rel qword es:0xaaaaaaaaaaaaaaaa]
+       mov eax,[a32 rel qword es:0xaaaaaaaaaaaaaaaa]
+       mov ebx,[a32 rel qword es:0xaaaaaaaaaaaaaaaa]
+       mov rax,[a32 rel qword es:0xaaaaaaaaaaaaaaaa]
+       mov rbx,[a32 rel qword es:0xaaaaaaaaaaaaaaaa]
+       mov al,[a32 rel qword es:0xbbbbbbbb]
+       mov bl,[a32 rel qword es:0xbbbbbbbb]
+       mov ax,[a32 rel qword es:0xbbbbbbbb]
+       mov bx,[a32 rel qword es:0xbbbbbbbb]
+       mov eax,[a32 rel qword es:0xbbbbbbbb]
+       mov ebx,[a32 rel qword es:0xbbbbbbbb]
+       mov rax,[a32 rel qword es:0xbbbbbbbb]
+       mov rbx,[a32 rel qword es:0xbbbbbbbb]
+       mov al,[a32 rel qword es:0xffffffffcccccccc]
+       mov bl,[a32 rel qword es:0xffffffffcccccccc]
+       mov ax,[a32 rel qword es:0xffffffffcccccccc]
+       mov bx,[a32 rel qword es:0xffffffffcccccccc]
+       mov eax,[a32 rel qword es:0xffffffffcccccccc]
+       mov ebx,[a32 rel qword es:0xffffffffcccccccc]
+       mov rax,[a32 rel qword es:0xffffffffcccccccc]
+       mov rbx,[a32 rel qword es:0xffffffffcccccccc]
+
+
+foo:
diff --git a/test/riprel.pl b/test/riprel.pl
new file mode 100755 (executable)
index 0000000..61af723
--- /dev/null
@@ -0,0 +1,29 @@
+#!/usr/bin/perl
+
+print ";Testname=unoptimized; Arguments=-fbin -oriprel.bin -O0; Files=stdout stderr riprel.bin\n";
+print ";Testname=optimized;   Arguments=-fbin -oriprel.bin -Ox; Files=stdout stderr riprel.bin\n";
+
+
+print "\tbits 64\n";
+
+foreach $mode ('abs', 'rel') {
+    print "\n\tdefault $mode\n\n";
+
+    foreach $so ('', 'fs:', 'es:') {
+       foreach $rq ('', 'abs ', 'rel ') {
+           foreach $ao ('', 'a64 ', 'a32 ') {
+               foreach $sq ('', 'dword ', 'qword ') {
+                   foreach $v ('foo', '0xaaaaaaaaaaaaaaaa', '0xbbbbbbbb',
+                               '0xffffffffcccccccc') {
+                       foreach $r (    'al', 'bl', 'ax', 'bx', 'eax', 'ebx', 'rax', 'rbx') {
+                           print "\tmov $r,[$ao$rq$sq$so$v]\n";
+                       }
+                   }
+                   print "\n";
+               }
+           }
+       }
+    }
+}
+
+print "\nfoo:\n";
diff --git a/test/riprel2.asm b/test/riprel2.asm
new file mode 100644 (file)
index 0000000..2d13d3e
--- /dev/null
@@ -0,0 +1,11 @@
+;Testname=unoptimized; Arguments=-fbin -oriprel2.bin -O0; Files=stdout stderr riprel.bin
+;Testname=optimized;   Arguments=-fbin -oriprel2.bin -Ox; Files=stdout stderr riprel.bin
+
+       bits 64
+
+       default rel
+       mov dword [foo],12345678h
+       mov qword [foo],12345678h
+       mov [foo],rax
+       mov dword [foo],12345678h
+foo:
diff --git a/test/smartalign16.asm b/test/smartalign16.asm
new file mode 100644 (file)
index 0000000..42915de
--- /dev/null
@@ -0,0 +1,36 @@
+;Testname=test; Arguments=-fbin -osmartalign16.bin; Files=stdout stderr smartalign16.bin
+
+%use smartalign
+
+       bits 16
+
+       alignmode nop, 32
+       add ax,ax
+       align 32
+
+       alignmode generic, 32
+       add ax,ax
+       align 32
+
+       alignmode k7, 32
+       add ax,ax
+       align 32
+
+       alignmode k8, 32
+       add ax,ax
+       align 32
+
+       alignmode p6, 32
+       add ax,ax
+       align 32
+
+       add ecx,ecx
+       align 32
+       add edx,edx
+       align 128
+       add ebx,ebx
+       align 256
+       add esi,esi
+       align 512
+
+       add edi,edi
diff --git a/test/smartalign32.asm b/test/smartalign32.asm
new file mode 100644 (file)
index 0000000..64d65b0
--- /dev/null
@@ -0,0 +1,36 @@
+;Testname=test; Arguments=-fbin -osmartalign32.bin; Files=stdout stderr smartalign32.bin
+
+%use smartalign
+
+       bits 32
+
+       alignmode nop, 32
+       add ax,ax
+       align 32
+
+       alignmode generic, 32
+       add ax,ax
+       align 32
+
+       alignmode k7, 32
+       add ax,ax
+       align 32
+
+       alignmode k8, 32
+       add ax,ax
+       align 32
+
+       alignmode p6, 32
+       add ax,ax
+       align 32
+
+       add ecx,ecx
+       align 32
+       add edx,edx
+       align 128
+       add ebx,ebx
+       align 256
+       add esi,esi
+       align 512
+
+       add edi,edi
diff --git a/test/smartalign64.asm b/test/smartalign64.asm
new file mode 100644 (file)
index 0000000..74454ca
--- /dev/null
@@ -0,0 +1,36 @@
+;Testname=test; Arguments=-fbin -osmartalign64.bin; Files=stdout stderr smartalign64.bin
+
+%use smartalign
+
+       bits 64
+
+       alignmode nop, 32
+       add ax,ax
+       align 32
+
+       alignmode generic, 32
+       add ax,ax
+       align 32
+
+       alignmode k7, 32
+       add ax,ax
+       align 32
+
+       alignmode k8, 32
+       add ax,ax
+       align 32
+
+       alignmode p6, 32
+       add ax,ax
+       align 32
+
+       add ecx,ecx
+       align 32
+       add edx,edx
+       align 128
+       add ebx,ebx
+       align 256
+       add esi,esi
+       align 512
+
+       add edi,edi
diff --git a/test/struc.asm b/test/struc.asm
new file mode 100644 (file)
index 0000000..3c8c1b4
--- /dev/null
@@ -0,0 +1,33 @@
+;Testname=test; Arguments=-fbin -ostruc.bin; Files=stdout stderr struc.bin
+
+bits 32
+
+; Simple struc example
+struc teststruc1
+  .long: resd 1
+  .word: resw 1
+  .byte: resb 1
+  .str:  resb 32
+endstruc
+
+; Reference with offset
+mov [ebp - 40 + teststruc1.word], ax
+
+istruc teststruc1
+ at .word, db 5
+iend
+
+; Struc with base offset
+; should be the same as the previous stuc
+struc teststruc2, -40
+  .long: resd 1
+  .word: resw 1
+  .byte: resb 1
+  .str:  resb 32
+endstruc
+
+mov [ebp + teststruc2.word], ax
+
+istruc teststruc2
+ at .word, db 5
+iend
diff --git a/test/test67.asm b/test/test67.asm
new file mode 100644 (file)
index 0000000..7cf300d
--- /dev/null
@@ -0,0 +1,38 @@
+;Testname=unoptimized; Arguments=-fbin -otest67.bin -O0; Files=stdout stderr test67.bin
+;Testname=optimized;   Arguments=-fbin -otest67.bin -Ox; Files=stdout stderr test67.bin
+
+       bits 16
+
+       mov ax,[bx]
+       mov ax,[foo]
+       mov ax,[word foo]
+       mov ax,[dword foo]
+       mov ax,[ebx]
+       rep movsb
+       a16 rep movsb
+       a32 rep movsb
+       a32 mov ax,bx
+
+       bits 32
+
+       mov ax,[bx]
+       mov ax,[foo]
+       mov ax,[word foo]
+       mov ax,[dword foo]
+       mov ax,[ebx]
+       rep movsb
+       a16 rep movsb
+       a32 rep movsb
+
+       bits 64
+
+       mov ax,[rbx]
+       mov ax,[foo]
+       mov ax,[qword foo]
+       mov ax,[dword foo]
+       mov ax,[ebx]
+       rep movsb
+       a32 rep movsb
+       a64 rep movsb
+
+foo:
diff --git a/test/testdos.asm b/test/testdos.asm
new file mode 100644 (file)
index 0000000..2f6bf91
--- /dev/null
@@ -0,0 +1,13 @@
+;Testname=test; Arguments=-fbin -otestdos.bin; Files=stdout stderr testdos.bin
+;
+; This file was known to miscompile with the 16-bit NASM built
+; under Borland C++ 3.1, so keep it around for testing...
+;
+; The proper output looks like:
+;
+; 00000000 A10300
+; 00000003 EA0000FFFF
+;
+       org 0100h
+       mov ax,[3]
+       jmp 0FFFFh:0000
diff --git a/test/testnos3.asm b/test/testnos3.asm
new file mode 100644 (file)
index 0000000..b243e15
--- /dev/null
@@ -0,0 +1,973 @@
+;Testname=test; Arguments=-fbin -otestnos3.bin; Files=stdout stderr testnos3.bin
+;
+; Double-precision floating point tests, derived from Fred Tydeman's posting
+; of 26 February 1996 to comp.arch.arithmetic, via David M. Gay's gdtoa
+; package.
+;
+       bits 64
+
+       dq      9.e0306
+       dq      0x7fa9a2028368022e
+
+       dq      4.e-079
+       dq      0x2fa7b6d71d20b96c
+
+       dq      7.e-261
+       dq      0x09eb8d7e32be6396
+
+       dq      6.e-025
+       dq      0x3ae7361cb863de62
+
+       dq      7.e-161
+       dq      0x1eaf7e0db3799aa3
+
+       dq      7.e0289
+       dq      0x7c1cbb547777a285
+
+       dq      5.e0079
+       dq      0x507afcef51f0fb5f
+
+       dq      1.e0080
+       dq      0x508afcef51f0fb5f
+
+       dq      7.e-303
+       dq      0x0133339131c46f8b
+
+       dq      5.e0152
+       dq      0x5fa317e5ef3ab327
+
+       dq      5.e0125
+       dq      0x5a07a2ecc414a03f
+
+       dq      2.e0126
+       dq      0x5a27a2ecc414a03f
+
+       dq      7.e-141
+       dq      0x22d5570f59bd178c
+
+       dq      4.e-192
+       dq      0x18323ff06eea847a
+
+       dq      9.e0043
+       dq      0x49102498ea6df0c4
+
+       dq      1.e0303
+       dq      0x7ed754e31cd072da
+
+       dq      95.e-089
+       dq      0x2dde3cbc9907fdc8
+
+       dq      85.e0194
+       dq      0x689d1c26db7d0dae
+
+       dq      69.e0267
+       dq      0x77c0b7cb60c994da
+
+       dq      97.e-019
+       dq      0x3c665dde8e688ba6
+
+       dq      37.e0046
+       dq      0x49d033d7eca0adef
+
+       dq      74.e0046
+       dq      0x49e033d7eca0adef
+
+       dq      61.e-099
+       dq      0x2bc0ad836f269a17
+
+       dq      53.e-208
+       dq      0x151b39ae1909c31b
+
+       dq      93.e-234
+       dq      0x0fc27b2e4f210075
+
+       dq      79.e-095
+       dq      0x2c9a5db812948281
+
+       dq      87.e-274
+       dq      0x0772d36cf48e7abd
+
+       dq      83.e0025
+       dq      0x4585747ab143e353
+
+       dq      17.e-036
+       dq      0x38b698ccdc60015a
+
+       dq      53.e0033
+       dq      0x47246a3418629ef6
+
+       dq      51.e-074
+       dq      0x30ecd5bee57763e6
+
+       dq      63.e-022
+       dq      0x3bbdc03b8fd7016a
+
+       dq      839.e0143
+       dq      0x5e3ae03f245703e2
+
+       dq      749.e-182
+       dq      0x1abf14727744c63e
+
+       dq      999.e-026
+       dq      0x3b282782afe1869e
+
+       dq      345.e0266
+       dq      0x77b0b7cb60c994da
+
+       dq      914.e-102
+       dq      0x2b5ffc81bc29f02b
+
+       dq      829.e0102
+       dq      0x55b7221a79cdd1d9
+
+       dq      307.e0090
+       dq      0x5322d6b183fe4b55
+
+       dq      859.e0182
+       dq      0x6654374d8b87ac63
+
+       dq      283.e0085
+       dq      0x5216c309024bab4b
+
+       dq      589.e0187
+       dq      0x675526be9c22eb17
+
+       dq      302.e0176
+       dq      0x64fdcf7df8f573b7
+
+       dq      604.e0176
+       dq      0x650dcf7df8f573b7
+
+       dq      761.e-244
+       dq      0x0de03cea3586452e
+
+       dq      647.e0230
+       dq      0x7044d64d4079150c
+
+       dq      755.e0174
+       dq      0x64a7d93193f78fc6
+
+       dq      255.e-075
+       dq      0x30dcd5bee57763e6
+
+       dq      3391.e0055
+       dq      0x4c159bd3ad46e346
+
+       dq      4147.e-015
+       dq      0x3d923d1b5eb1d778
+
+       dq      3996.e-026
+       dq      0x3b482782afe1869e
+
+       dq      1998.e-026
+       dq      0x3b382782afe1869e
+
+       dq      3338.e-296
+       dq      0x0335519ac5142aab
+
+       dq      1669.e-296
+       dq      0x0325519ac5142aab
+
+       dq      8699.e-276
+       dq      0x0772d2df246ecd2d
+
+       dq      5311.e0243
+       dq      0x73284e91f4aa0fdb
+
+       dq      7903.e-096
+       dq      0x2cd07c2d27a5b989
+
+       dq      7611.e-226
+       dq      0x11d19b8744033457
+
+       dq      3257.e0058
+       dq      0x4cb444b34a6fb3eb
+
+       dq      6514.e0058
+       dq      0x4cc444b34a6fb3eb
+
+       dq      3571.e0263
+       dq      0x77462644c61d41aa
+
+       dq      7142.e0263
+       dq      0x77562644c61d41aa
+
+       dq      5311.e0242
+       dq      0x72f3720e5d54d97c
+
+       dq      1617.e-063
+       dq      0x3384c98fce16152e
+
+       dq      51881.e0037
+       dq      0x4897d2950dc76da4
+
+       dq      31441.e-118
+       dq      0x285ef890f5de4c86
+
+       dq      30179.e0079
+       dq      0x5143e272a77478e8
+
+       dq      60358.e0079
+       dq      0x5153e272a77478e8
+
+       dq      63876.e-020
+       dq      0x3cc703856844bdbf
+
+       dq      31938.e-020
+       dq      0x3cb703856844bdbf
+
+       dq      46073.e-032
+       dq      0x3a42405b773fbdf3
+
+       dq      32941.e0051
+       dq      0x4b757eb8ad52a5c9
+
+       dq      82081.e0041
+       dq      0x49770105df3d47cb
+
+       dq      38701.e-215
+       dq      0x1440492a4a8a37fd
+
+       dq      62745.e0047
+       dq      0x4ab0c52fe6dc6a1b
+
+       dq      12549.e0048
+       dq      0x4ac0c52fe6dc6a1b
+
+       dq      64009.e-183
+       dq      0x1af099b393b84832
+
+       dq      89275.e0261
+       dq      0x77262644c61d41aa
+
+       dq      75859.e0025
+       dq      0x46232645e1ba93f0
+
+       dq      57533.e0287
+       dq      0x7c8272ed2307f56a
+
+       dq      584169.e0229
+       dq      0x70ad657059dc79aa
+
+       dq      940189.e-112
+       dq      0x29eb99d6240c1a28
+
+       dq      416121.e0197
+       dq      0x6a00fd07ed297f80
+
+       dq      832242.e0197
+       dq      0x6a10fd07ed297f80
+
+       dq      584738.e0076
+       dq      0x50e8a85eb277e645
+
+       dq      933587.e-140
+       dq      0x241b248728b9c117
+
+       dq      252601.e0121
+       dq      0x5a2dda592e398dd7
+
+       dq      358423.e0274
+       dq      0x79f9463b59b8f2bd
+
+       dq      892771.e-213
+       dq      0x14f25818c7294f27
+
+       dq      410405.e0040
+       dq      0x49670105df3d47cb
+
+       dq      928609.e-261
+       dq      0x0afbe2dd66200bef
+
+       dq      302276.e-254
+       dq      0x0c55a462d91c6ab3
+
+       dq      920657.e-023
+       dq      0x3c653a9985dbde6c
+
+       dq      609019.e-025
+       dq      0x3bf1f99e11ea0a24
+
+       dq      252601.e0120
+       dq      0x59f7e1e0f1c7a4ac
+
+       dq      654839.e-060
+       dq      0x34b00e7db3b3f242
+
+       dq      8823691.e0130
+       dq      0x5c5e597c0b94b7ae
+
+       dq      2920845.e0228
+       dq      0x709d657059dc79aa
+
+       dq      9210917.e0080
+       dq      0x51fda232347e6032
+
+       dq      5800419.e-303
+       dq      0x026e58ffa48f4fce
+
+       dq      6119898.e-243
+       dq      0x0ee3ecf22ea07863
+
+       dq      3059949.e-243
+       dq      0x0ed3ecf22ea07863
+
+       dq      2572231.e0223
+       dq      0x6f90f73be1dff9ad
+
+       dq      5444097.e-021
+       dq      0x3cf8849dd33c95af
+
+       dq      5783893.e-127
+       dq      0x26f7e5902ce0e151
+
+       dq      3865421.e-225
+       dq      0x1295d4fe53afec65
+
+       dq      4590831.e0156
+       dq      0x61b4689b4a5fa201
+
+       dq      9181662.e0156
+       dq      0x61c4689b4a5fa201
+
+       dq      5906361.e-027
+       dq      0x3bbbe45a312d08a0
+
+       dq      7315057.e0235
+       dq      0x7225f0d408362a72
+
+       dq      9088115.e0106
+       dq      0x5762e51a84a3c6a0
+
+       dq      1817623.e0107
+       dq      0x5772e51a84a3c6a0
+
+       dq      44118455.e0129
+       dq      0x5c4e597c0b94b7ae
+
+       dq      35282041.e0293
+       dq      0x7e5512d5273e62e8
+
+       dq      31279898.e-291
+       dq      0x05129b01b6885d36
+
+       dq      15639949.e-291
+       dq      0x05029b01b6885d36
+
+       dq      27966061.e0145
+       dq      0x5f955bcf72fd10f9
+
+       dq      55932122.e0145
+       dq      0x5fa55bcf72fd10f9
+
+       dq      70176353.e-053
+       dq      0x36900683a21de855
+
+       dq      40277543.e-032
+       dq      0x3adf29ca0ff893b1
+
+       dq      50609263.e0157
+       dq      0x622193aff1f1c8e3
+
+       dq      66094077.e0077
+       dq      0x518b37c4b7928317
+
+       dq      84863171.e0114
+       dq      0x59406e98f5ec8f37
+
+       dq      89396333.e0264
+       dq      0x786526f061ca9053
+
+       dq      87575437.e-309
+       dq      0x016e07320602056c
+
+       dq      78693511.e-044
+       dq      0x3870bc7b7603a2ca
+
+       dq      90285923.e-206
+       dq      0x16d1470083f89d48
+
+       dq      30155207.e-030
+       dq      0x3b423a4ad20748a2
+
+       dq      245540327.e0121
+       dq      0x5acc569e968e0944
+
+       dq      263125459.e0287
+       dq      0x7d44997a298b2f2e
+
+       dq      566446538.e-257
+       dq      0x0c64472ba9550e86
+
+       dq      283223269.e-257
+       dq      0x0c54472ba9550e86
+
+       dq      245540327.e0122
+       dq      0x5b01b6231e18c5cb
+
+       dq      491080654.e0122
+       dq      0x5b11b6231e18c5cb
+
+       dq      971212611.e-126
+       dq      0x27a397d3c9745d2f
+
+       dq      229058583.e0052
+       dq      0x4c76ce94febdc7a5
+
+       dq      325270231.e0039
+       dq      0x49cc7ccf90c9f8ab
+
+       dq      989648089.e-035
+       dq      0x3a8880a3d515e849
+
+       dq      653777767.e0273
+       dq      0x7a720223f2b3a881
+
+       dq      923091487.e0209
+       dq      0x6d30bc60e6896717
+
+       dq      526250918.e0288
+       dq      0x7d89bfd8b3edfafa
+
+       dq      350301748.e-309
+       dq      0x018e07320602056c
+
+       dq      741111169.e-203
+       dq      0x17a14fe7daf8f3ae
+
+       dq      667284113.e-240
+       dq      0x0ff09355f8050c02
+
+       dq      1227701635.e0120
+       dq      0x5abc569e968e0944
+
+       dq      9981396317.e-182
+       dq      0x1c38afe10a2a66aa
+
+       dq      5232604057.e-298
+       dq      0x041465b896c24520
+
+       dq      5572170023.e-088
+       dq      0x2fb0847822f765b2
+
+       dq      1964322616.e0122
+       dq      0x5b31b6231e18c5cb
+
+       dq      3928645232.e0122
+       dq      0x5b41b6231e18c5cb
+
+       dq      8715380633.e-058
+       dq      0x35f4614c3219891f
+
+       dq      4856063055.e-127
+       dq      0x279397d3c9745d2f
+
+       dq      8336960483.e-153
+       dq      0x223a06a1024b95e1
+
+       dq      1007046393.e-155
+       dq      0x21a01891fc4717fd
+
+       dq      5378822089.e-176
+       dq      0x1d695fd4c88d4b1b
+
+       dq      5981342308.e-190
+       dq      0x1a83db11ac608107
+
+       dq      7214782613.e-086
+       dq      0x3020b552d2edcdea
+
+       dq      5458466829.e0142
+       dq      0x5f70acde6a98eb4c
+
+       dq      9078555839.e-109
+       dq      0x2b5fc575867314ee
+
+       dq      6418488827.e0079
+       dq      0x526021f14ed7b3fa
+
+       dq      65325840981.e0069
+       dq      0x5081a151ddbd3c4a
+
+       dq      49573485983.e0089
+       dq      0x54a221bd871d2cf4
+
+       dq      46275205733.e0074
+       dq      0x51830e6c7d4e3480
+
+       dq      92550411466.e0074
+       dq      0x51930e6c7d4e3480
+
+       dq      41129842097.e-202
+       dq      0x1832c3e72d179607
+
+       dq      93227267727.e-049
+       dq      0x380960fe08d5847f
+
+       dq      41297294357.e0185
+       dq      0x688c49437fccfadb
+
+       dq      41534892987.e-067
+       dq      0x343a12666477886d
+
+       dq      42333842451.e0201
+       dq      0x6be0189a26df575f
+
+       dq      78564021519.e-227
+       dq      0x131155515fd37265
+
+       dq      53587107423.e-061
+       dq      0x35800a19a3ffd981
+
+       dq      53827010643.e-200
+       dq      0x18a32fa69a69bd6d
+
+       dq      83356057653.e0193
+       dq      0x6a4544e6daee2a18
+
+       dq      45256834646.e-118
+       dq      0x29a541ecdfd48694
+
+       dq      45392779195.e-110
+       dq      0x2b4fc575867314ee
+
+       dq      23934638219.e0291
+       dq      0x7e81deaf40ead9a0
+
+       dq      995779191233.e0113
+       dq      0x59e2d44edcc51304
+
+       dq      997422852243.e-265
+       dq      0x0b676688faee99bc
+
+       dq      653532977297.e-123
+       dq      0x28d925a0aabcdc68
+
+       dq      938885684947.e0147
+       dq      0x60f11894b202e9f4
+
+       dq      619534293513.e0124
+       dq      0x5c210c20303fe0f1
+
+       dq      539879452414.e-042
+       dq      0x39a5e66dc3d6bdb5
+
+       dq      742522891517.e0259
+       dq      0x782c1c352fc3c309
+
+       dq      254901016865.e-022
+       dq      0x3dbc06d366394441
+
+       dq      685763015669.e0280
+       dq      0x7c85fd7aa44d9477
+
+       dq      384865004907.e-285
+       dq      0x072aa65b58639e69
+
+       dq      286556458711.e0081
+       dq      0x5321958b36c5102b
+
+       dq      573112917422.e0081
+       dq      0x5331958b36c5102b
+
+       dq      769525178383.e-150
+       dq      0x234253ec0e161420
+
+       dq      416780288265.e0192
+       dq      0x6a3544e6daee2a18
+
+       dq      226963895975.e-111
+       dq      0x2b3fc575867314ee
+
+       dq      665592809339.e0063
+       dq      0x4f778b6516c2b478
+
+       dq      3891901811465.e0217
+       dq      0x6f99ab8261990292
+
+       dq      4764593340755.e0069
+       dq      0x50e4177a9915fbf8
+
+       dq      6336156586177.e0269
+       dq      0x7a7173f76c63b792
+
+       dq      8233559360849.e0095
+       dq      0x56566fee05649a7a
+
+       dq      3662265515198.e-107
+       dq      0x2c538e6edd48f2a3
+
+       dq      1831132757599.e-107
+       dq      0x2c438e6edd48f2a3
+
+       dq      7812878489261.e-179
+       dq      0x1d726dae7bbeda75
+
+       dq      6363857920591.e0145
+       dq      0x60b28a61cf9483b7
+
+       dq      8811915538555.e0082
+       dq      0x53a51f508b287ae7
+
+       dq      9997878507563.e-195
+       dq      0x1a253db2fea1ea31
+
+       dq      9224786422069.e-291
+       dq      0x0634ee5d56b32957
+
+       dq      6284426329974.e-294
+       dq      0x058d3409dfbca26f
+
+       dq      9199302046091.e-062
+       dq      0x35c135972630774c
+
+       dq      6070482281213.e-122
+       dq      0x29423fa9e6fcf47e
+
+       dq      2780161250963.e-301
+       dq      0x0405acc2053064c2
+
+       dq      8233559360849.e0094
+       dq      0x5621f324d11d4862
+
+       dq      72027097041701.e0206
+       dq      0x6d94677812d3a606
+
+       dq      97297545286625.e0215
+       dq      0x6f79ab8261990292
+
+       dq      99021992302453.e-025
+       dq      0x3da5c6714def374c
+
+       dq      54104687080198.e-022
+       dq      0x3e373cdf8db7a7bc
+
+       dq      33519685743233.e0089
+       dq      0x5537f203339c9629
+
+       dq      67039371486466.e0089
+       dq      0x5547f203339c9629
+
+       dq      39064392446305.e-180
+       dq      0x1d626dae7bbeda75
+
+       dq      17796979903653.e0261
+       dq      0x78e072f3819c1321
+
+       dq      28921916763211.e0038
+       dq      0x4a9eebabe0957af3
+
+       dq      87605699161665.e0155
+       dq      0x6302920f96e7f9ef
+
+       dq      41921560615349.e-067
+       dq      0x34d9b2a5c4041e4b
+
+       dq      80527976643809.e0061
+       dq      0x4f7c7c5aea080a49
+
+       dq      72335858886654.e-159
+       dq      0x21cce77c2b3328fc
+
+       dq      52656615219377.e0102
+       dq      0x57f561def4a9ee32
+
+       dq      15400733123779.e-072
+       dq      0x33b8bf7e7fa6f02a
+
+       dq      77003665618895.e-073
+       dq      0x33a8bf7e7fa6f02a
+
+       dq      475603213226859.e-042
+       dq      0x3a42d73088f4050a
+
+       dq      972708181182949.e0116
+       dq      0x5b218a7f36172332
+
+       dq      246411729980464.e-071
+       dq      0x342eef5e1f90ac34
+
+       dq      123205864990232.e-071
+       dq      0x341eef5e1f90ac34
+
+       dq      609610927149051.e-255
+       dq      0x0e104273b18918b1
+
+       dq      475603213226859.e-041
+       dq      0x3a778cfcab31064d
+
+       dq      672574798934795.e0065
+       dq      0x508226c684c87261
+
+       dq      134514959786959.e0066
+       dq      0x509226c684c87261
+
+       dq      294897574603217.e-151
+       dq      0x2395f2df5e675a0f
+
+       dq      723047919080275.e0036
+       dq      0x4a7eebabe0957af3
+
+       dq      660191429952702.e-088
+       dq      0x30bddc7e975c5045
+
+       dq      330095714976351.e-088
+       dq      0x30addc7e975c5045
+
+       dq      578686871093232.e-159
+       dq      0x21fce77c2b3328fc
+
+       dq      144671717773308.e-159
+       dq      0x21dce77c2b3328fc
+
+       dq      385018328094475.e-074
+       dq      0x3398bf7e7fa6f02a
+
+       dq      330095714976351.e-089
+       dq      0x3077e3987916a69e
+
+       dq      2215901545757777.e-212
+       dq      0x171a80a6e566428c
+
+       dq      1702061899637397.e-276
+       dq      0x09cacc46749dccfe
+
+       dq      1864950924021923.e0213
+       dq      0x6f53ae60753af6ca
+
+       dq      3729901848043846.e0213
+       dq      0x6f63ae60753af6ca
+
+       dq      7487252720986826.e-165
+       dq      0x20f8823a57adbef9
+
+       dq      3743626360493413.e-165
+       dq      0x20e8823a57adbef9
+
+       dq      4988915232824583.e0119
+       dq      0x5be5f6de9d5d6b5b
+
+       dq      3771476185376383.e0277
+       dq      0x7cae3c14d6916ce9
+
+       dq      6182410494241627.e-119
+       dq      0x2a81b96458445d07
+
+       dq      2572981889477453.e0142
+       dq      0x609dfc11fbf46087
+
+       dq      7793560217139653.e0051
+       dq      0x4dd280461b856ec5
+
+       dq      9163942927285259.e-202
+       dq      0x194fe601457dce4d
+
+       dq      6353227084707473.e0155
+       dq      0x63650aff653ffe8a
+
+       dq      4431803091515554.e-211
+       dq      0x176090684f5fe998
+
+       dq      9324754620109615.e0211
+       dq      0x6f0f7d6721f7f144
+
+       dq      8870461176410409.e0263
+       dq      0x79d90529a37b7e22
+
+       dq      90372559027740405.e0143
+       dq      0x612491daad0ba280
+
+       dq      18074511805548081.e0146
+       dq      0x61a011f2d73116f4
+
+       dq      54897030182071313.e0029
+       dq      0x496ec55666d8f9ec
+
+       dq      76232626624829156.e-032
+       dq      0x3ccb7738011e75fe
+
+       dq      59898021767894608.e-165
+       dq      0x2128823a57adbef9
+
+       dq      29949010883947304.e-165
+       dq      0x2118823a57adbef9
+
+       dq      26153245263757307.e0049
+       dq      0x4d83de005bd620df
+
+       dq      27176258005319167.e-261
+       dq      0x0d27c0747bd76fa1
+
+       dq      18074511805548081.e0147
+       dq      0x61d4166f8cfd5cb1
+
+       dq      24691002732654881.e-115
+       dq      0x2b759a2783ce70ab
+
+       dq      58483921078398283.e0057
+       dq      0x4f408ce499519ce3
+
+       dq      64409240769861689.e-159
+       dq      0x22692238f7987779
+
+       dq      94080055902682397.e-242
+       dq      0x11364981e39e66ca
+
+       dq      31766135423537365.e0154
+       dq      0x63550aff653ffe8a
+
+       dq      68985865317742005.e0164
+       dq      0x657a999ddec72aca
+
+       dq      13797173063548401.e0165
+       dq      0x658a999ddec72aca
+
+       dq      902042358290366539.e-281
+       dq      0x09522dc01ca1cb8c
+
+       dq      238296178309629163.e0272
+       dq      0x7c038fd93f1f5342
+
+       dq      783308178698887621.e0226
+       dq      0x72925ae62cb346d8
+
+       dq      439176241456570504.e0029
+       dq      0x499ec55666d8f9ec
+
+       dq      899810892172646163.e0283
+       dq      0x7e6adf51fa055e03
+
+       dq      926145344610700019.e-225
+       dq      0x14f307a67f1f69ff
+
+       dq      653831131593932675.e0047
+       dq      0x4d63de005bd620df
+
+       dq      130766226318786535.e0048
+       dq      0x4d73de005bd620df
+
+       dq      557035730189854663.e-294
+       dq      0x0693bfac6bc4767b
+
+       dq      902042358290366539.e-280
+       dq      0x0986b93023ca3e6f
+
+       dq      272104041512242479.e0200
+       dq      0x6d13bbb4bf05f087
+
+       dq      544208083024484958.e0200
+       dq      0x6d23bbb4bf05f087
+
+       dq      680429695511221511.e0192
+       dq      0x6b808ebc116f8a20
+
+       dq      308975121073410857.e0236
+       dq      0x7490db75cc001072
+
+       dq      792644927852378159.e0078
+       dq      0x53d7bff336d8ff06
+
+       dq      783308178698887621.e0223
+       dq      0x71f2cbac35f71140
+
+       dq      8396094300569779681.e-252
+       dq      0x0f8ab223efcee35a
+
+       dq      3507665085003296281.e-074
+       dq      0x346b85c026a264e4
+
+       dq      7322325862592278999.e0074
+       dq      0x5336775b6caa5ae0
+
+       dq      6014546754280072926.e0209
+       dq      0x6f396397b06732a4
+
+       dq      7120190517612959703.e0120
+       dq      0x5cc3220dcd5899fd
+
+       dq      3507665085003296281.e-073
+       dq      0x34a1339818257f0f
+
+       dq      4345544743100783551.e-218
+       dq      0x168a9c42e5b6d89f
+
+       dq      9778613303868468131.e-090
+       dq      0x313146fe1075e1ef
+
+       dq      7539204280836061195.e-082
+       dq      0x32d3d969e3dbe723
+
+       dq      7862637540082247119.e-202
+       dq      0x19eaba3262ee707b
+
+       dq      2176832332097939832.e0200
+       dq      0x6d43bbb4bf05f087
+
+       dq      8643988913946659879.e0115
+       dq      0x5bbe71ec1ed0a4f9
+
+       dq      5529436763613147623.e0138
+       dq      0x6079c677be6f236e
+
+       dq      6764958008109694533.e-173
+       dq      0x1fed06692e6f5ef6
+
+       dq      6802601037806061975.e0197
+       dq      0x6cbf92bacb3cb40c
+
+       dq      1360520207561212395.e0198
+       dq      0x6ccf92bacb3cb40c
+
+       dq      62259110684423957791.e0047
+       dq      0x4dcd8f2cfc20d6e8
+
+       dq      88800290202542652011.e-226
+       dq      0x1526cec51a43f41a
+
+       dq      41010852717673354694.e-221
+       dq      0x162012954b6aabba
+
+       dq      20505426358836677347.e-221
+       dq      0x161012954b6aabba
+
+       dq      66102447903809911604.e0055
+       dq      0x4f7762068a24fd55
+
+       dq      35600952588064798515.e0119
+       dq      0x5cb3220dcd5899fd
+
+       dq      14371240869903838702.e0205
+       dq      0x6e78d92d2bcc7a81
+
+       dq      57500690832492901689.e0043
+       dq      0x4cf65d3e2acd616b
+
+       dq      23432630639573022093.e-107
+       dq      0x2dbdd54c40a2f25f
+
+       dq      62259110684423957791.e0048
+       dq      0x4e02797c1d948651
+
+       dq      35620497849450218807.e-306
+       dq      0x0475b22082529425
+
+       dq      69658634627134074624.e0200
+       dq      0x6d93bbb4bf05f087
+
+       dq      99440755792436956989.e-062
+       dq      0x37362d10462a26f4
+
+       dq      55277197169490210673.e0081
+       dq      0x54d945bfa911e32a
+
+       dq      36992084760177624177.e-318
+       dq      0x01f8c5f9551c2f9a
+
+       dq      30888265282878466443.e-111
+       dq      0x2cf01b8ef28251fc
+
+       dq      2.4703282292062327208828439643411068618252990130716238221279284125033775363510437593264991818081799618989828234772285886546332835517796989819938739800539093906315035659515570226392290858392449105184435931802849936536152500319370457678249219365623669863658480757001585769269903706311928279558551332927834338409351978015531246597263579574622766465272827220056374006485499977096599470454020828166226237857393450736339007967761930577506740176324673600968951340535537458516661134223766678604162159680461914467291840300530057530849048765391711386591646239524912623653881879636239373280423891018672348497668235089863388587925628302755995657524455507255189313690836254779186948667994968324049705821028513185451396213837722826145437693412532098591327667236328125e-324
+       dq      0x0000000000000000
+
+       dq      2.47032822920623272e-324
+       dq      0x0000000000000000
diff --git a/test/time.asm b/test/time.asm
new file mode 100644 (file)
index 0000000..ee4b9b7
--- /dev/null
@@ -0,0 +1,11 @@
+;Not automatically testable because it is not constant
+       db __DATE__, 13, 10
+       db __TIME__, 13, 10
+       db __UTC_DATE__, 13, 10
+       db __UTC_TIME__, 13, 10
+       align 4
+       dd __DATE_NUM__
+       dd __TIME_NUM__
+       dd __UTC_DATE_NUM__
+       dd __UTC_TIME_NUM__
+       dd __POSIX_TIME__
diff --git a/test/tmap.nas b/test/tmap.nas
new file mode 100644 (file)
index 0000000..51b477f
--- /dev/null
@@ -0,0 +1,1447 @@
+;; NASM note: this file abuses the section flags in such a way that\r
+;; NASM 0.98.37 broke when this was compiled with:\r
+;; nasm -o tmap.o -f elf -DLINUX tmap.nas\r
+\r
+;;-----------------------------------------------------------------------------\r
+;;\r
+;; $Id$\r
+;;\r
+;; Copyright (C) 1998-2000 by DooM Legacy Team.\r
+;;\r
+;; This program is free software; you can redistribute it and/or\r
+;; modify it under the terms of the GNU General Public License\r
+;; as published by the Free Software Foundation; either version 2\r
+;; of the License, or (at your option) any later version.\r
+;;\r
+;; This program is distributed in the hope that it will be useful,\r
+;; but WITHOUT ANY WARRANTY; without even the implied warranty of\r
+;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\r
+;; GNU General Public License for more details.\r
+;;\r
+;;\r
+;; $Log$
+;; Revision 1.2  2003/09/10 23:33:38  hpa
+;; Use the version of tmap.nas that actually caused problems
+;;\r
+;; Revision 1.10  2001/02/24 13:35:21  bpereira\r
+;; no message\r
+;;\r
+;; Revision 1.9  2001/02/10 15:24:19  hurdler\r
+;; Apply Rob's patch for Linux version\r
+;;\r
+;; Revision 1.8  2000/11/12 09:48:15  bpereira\r
+;; no message\r
+;;\r
+;; Revision 1.7  2000/11/06 20:52:16  bpereira\r
+;; no message\r
+;;\r
+;; Revision 1.6  2000/11/03 11:48:40  hurdler\r
+;; Fix compiling problem under win32 with 3D-Floors and FragglScript (to verify!)\r
+;;\r
+;; Revision 1.5  2000/11/03 03:27:17  stroggonmeth\r
+;; Again with the bug fixing...\r
+;;\r
+;; Revision 1.4  2000/11/02 17:50:10  stroggonmeth\r
+;; Big 3Dfloors & FraggleScript commit!!\r
+;;\r
+;; Revision 1.3  2000/04/24 20:24:38  bpereira\r
+;; no message\r
+;;\r
+;; Revision 1.2  2000/02/27 00:42:11  hurdler\r
+;; fix CR+LF problem\r
+;;\r
+;; Revision 1.1.1.1  2000/02/22 20:32:32  hurdler\r
+;; Initial import into CVS (v1.29 pr3)\r
+;;\r
+;;\r
+;; DESCRIPTION:\r
+;;      assembler optimised rendering code for software mode\r
+;;      draw floor spans, and wall columns.\r
+;;\r
+;;-----------------------------------------------------------------------------\r
+\r
+\r
+[BITS 32]\r
+\r
+%ifdef LINUX\r
+%macro cextern 1\r
+[extern %1]\r
+%endmacro\r
+\r
+%macro cglobal 1\r
+[global %1]\r
+%endmacro\r
+\r
+%define CODE_SEG .data\r
+%else\r
+%macro cextern 1\r
+%define %1 _%1\r
+[extern %1]\r
+%endmacro\r
+\r
+%macro cglobal 1\r
+%define %1 _%1\r
+[global %1]\r
+%endmacro\r
+\r
+%define CODE_SEG .text                         \r
+%endif\r
+\r
+\r
+;; externs\r
+;; columns\r
+cextern dc_x\r
+cextern dc_yl\r
+cextern dc_yh\r
+cextern ylookup\r
+cextern columnofs\r
+cextern dc_source\r
+cextern dc_texturemid\r
+cextern dc_iscale\r
+cextern centery\r
+cextern dc_colormap\r
+cextern dc_transmap\r
+cextern colormaps\r
+\r
+;; spans\r
+cextern ds_x1\r
+cextern ds_x2\r
+cextern ds_y\r
+cextern ds_xfrac\r
+cextern ds_yfrac\r
+cextern ds_xstep\r
+cextern ds_ystep\r
+cextern ds_source\r
+cextern ds_colormap\r
+;cextern ds_textureheight\r
+\r
+; polygon edge rasterizer\r
+cextern prastertab\r
+\r
+\r
+;;----------------------------------------------------------------------\r
+;;\r
+;; R_DrawColumn\r
+;;\r
+;; New  optimised version 10-01-1998 by D.Fabrice and P.Boris\r
+;; TO DO: optimise it much farther... should take at most 3 cycles/pix\r
+;;      once it's fixed, add code to patch the offsets so that it\r
+;;      works in every screen width.\r
+;;\r
+;;----------------------------------------------------------------------\r
+\r
+[SECTION .data]\r
+\r
+;;.align        4\r
+loopcount       dd      0\r
+pixelcount      dd      0\r
+tystep          dd      0\r
+\r
+[SECTION CODE_SEG write]\r
+\r
+;----------------------------------------------------------------------------\r
+;fixed_t FixedMul (fixed_t a, fixed_t b)\r
+;----------------------------------------------------------------------------\r
+cglobal FixedMul\r
+;       align   16\r
+FixedMul:\r
+        mov     eax,[esp+4]\r
+        imul    dword [esp+8]\r
+        shrd    eax,edx,16\r
+        ret\r
+\r
+;----------------------------------------------------------------------------\r
+;fixed_t FixedDiv2 (fixed_t a, fixed_t b);\r
+;----------------------------------------------------------------------------\r
+cglobal FixedDiv2\r
+;       align   16\r
+FixedDiv2:\r
+        mov     eax,[esp+4]\r
+        mov     edx,eax                 ;; these two instructions allow the next\r
+        sar     edx,31                  ;; two to pair, on the Pentium processor.\r
+        shld    edx,eax,16\r
+        sal     eax,16\r
+        idiv    dword [esp+8]\r
+        ret\r
+\r
+;----------------------------------------------------------------------------\r
+; void  ASM_PatchRowBytes (int rowbytes);\r
+;----------------------------------------------------------------------------\r
+cglobal ASM_PatchRowBytes\r
+;       align   16\r
+ASM_PatchRowBytes:\r
+        mov     eax,[esp+4]\r
+        mov     [p1+2],eax\r
+        mov     [p2+2],eax\r
+        mov     [p3+2],eax\r
+        mov     [p4+2],eax\r
+        mov     [p5+2],eax\r
+        mov     [p6+2],eax\r
+        mov     [p7+2],eax\r
+        mov     [p8+2],eax\r
+        mov     [p9+2],eax\r
+        mov     [pa+2],eax\r
+        mov     [pb+2],eax\r
+        mov     [pc+2],eax\r
+        mov     [pd+2],eax\r
+        mov     [pe+2],eax\r
+        mov     [pf+2],eax\r
+        mov     [pg+2],eax\r
+        mov     [ph+2],eax\r
+        mov     [pi+2],eax\r
+        mov     [pj+2],eax\r
+        mov     [pk+2],eax\r
+        mov     [pl+2],eax\r
+        mov     [pm+2],eax\r
+        mov     [pn+2],eax\r
+        mov     [po+2],eax\r
+        mov     [pp+2],eax\r
+        mov     [pq+2],eax\r
+        add     eax,eax\r
+        mov     [q1+2],eax\r
+        mov     [q2+2],eax\r
+        mov     [q3+2],eax\r
+        mov     [q4+2],eax\r
+        mov     [q5+2],eax\r
+        mov     [q6+2],eax\r
+        mov     [q7+2],eax\r
+        mov     [q8+2],eax\r
+        ret\r
+\r
+\r
+;----------------------------------------------------------------------------\r
+; 8bpp column drawer\r
+;----------------------------------------------------------------------------\r
+\r
+cglobal R_DrawColumn_8\r
+;       align   16\r
+R_DrawColumn_8:\r
+        push    ebp                     ;; preserve caller's stack frame pointer\r
+        push    esi                     ;; preserve register variables\r
+        push    edi\r
+        push    ebx\r
+;;\r
+;; dest = ylookup[dc_yl] + columnofs[dc_x];\r
+;;\r
+        mov     ebp,[dc_yl]\r
+        mov     ebx,ebp\r
+        mov     edi,[ylookup+ebx*4]\r
+        mov     ebx,[dc_x]\r
+        add     edi,[columnofs+ebx*4]  ;; edi = dest\r
+;;\r
+;; pixelcount = yh - yl + 1\r
+;;\r
+        mov     eax,[dc_yh]\r
+        inc     eax\r
+        sub     eax,ebp                 ;; pixel count\r
+        mov     [pixelcount],eax        ;; save for final pixel\r
+        jle     near vdone                   ;; nothing to scale\r
+;;\r
+;; frac = dc_texturemid - (centery-dc_yl)*fracstep;\r
+;;\r
+        mov     ecx,[dc_iscale]        ;; fracstep\r
+        mov     eax,[centery]\r
+        sub     eax,ebp\r
+        imul    eax,ecx\r
+        mov     edx,[dc_texturemid]\r
+        sub     edx,eax\r
+        mov     ebx,edx\r
+        shr     ebx,16                  ;; frac int.\r
+        and     ebx,0x7f\r
+        shl     edx,16                  ;; y frac up\r
+\r
+        mov     ebp,ecx\r
+        shl     ebp,16                  ;; fracstep f. up\r
+        shr     ecx,16                  ;; fracstep i. ->cl\r
+        and     cl,0x7f\r
+        mov     esi,[dc_source]\r
+;;\r
+;; lets rock :) !\r
+;;\r
+        mov     eax,[pixelcount]\r
+        mov     dh,al\r
+        shr     eax,2\r
+        mov     ch,al                   ;; quad count\r
+        mov     eax,[dc_colormap]\r
+        test    dh,0x3\r
+        je      near v4quadloop\r
+;;\r
+;;  do un-even pixel\r
+;;\r
+        test    dh,0x1\r
+        je      two_uneven\r
+\r
+        mov     al,[esi+ebx]            ;; prep un-even loops\r
+        add     edx,ebp                 ;; ypos f += ystep f\r
+        adc     bl,cl                   ;; ypos i += ystep i\r
+        mov     dl,[eax]                ;; colormap texel\r
+        and     bl,0x7f                 ;; mask 0-127 texture index\r
+        mov     [edi],dl                ;; output pixel\r
+p1:     add     edi,0x12345678\r
+;;\r
+;;  do two non-quad-aligned pixels\r
+;;\r
+two_uneven:\r
+        test    dh,0x2\r
+        je      f3\r
+\r
+        mov     al,[esi+ebx]            ;; fetch source texel\r
+        add     edx,ebp                 ;; ypos f += ystep f\r
+        adc     bl,cl                   ;; ypos i += ystep i\r
+        mov     dl,[eax]                ;; colormap texel\r
+        and     bl,0x7f                 ;; mask 0-127 texture index\r
+        mov     [edi],dl                ;; output pixel\r
+        mov     al,[esi+ebx]\r
+        add     edx,ebp                 ;; fetch source texel\r
+        adc     bl,cl                   ;; ypos f += ystep f\r
+        mov     dl,[eax]                ;; ypos i += ystep i\r
+        and     bl,0x7f                 ;; colormap texel\r
+p2:     add     edi,0x12345678          ;; mask 0-127 texture index\r
+        mov     [edi],dl\r
+p3:     add     edi,0x12345678          ;; output pixel\r
+;;\r
+;;  test if there was at least 4 pixels\r
+;;\r
+f3:\r
+        test    ch,0xff                 ;; test quad count\r
+        je      near vdone\r
+;;\r
+;; ebp : ystep frac. upper 16 bits\r
+;; edx : y     frac. upper 16 bits\r
+;; ebx : y     i.    lower 7 bits,  masked for index\r
+;; ecx : ch = counter, cl = y step i.\r
+;; eax : colormap aligned 256\r
+;; esi : source texture column\r
+;; edi : dest screen\r
+;;\r
+v4quadloop:\r
+        mov     dh,0x7f                 ;; prep mask\r
+align 4\r
+vquadloop:\r
+        mov     al,[esi+ebx]            ;; prep loop\r
+        add     edx,ebp                 ;; ypos f += ystep f\r
+        adc     bl,cl                   ;; ypos i += ystep i\r
+        mov     dl,[eax]                ;; colormap texel\r
+        mov     [edi],dl                ;; output pixel\r
+        and     bl,0x7f                 ;; mask 0-127 texture index\r
+\r
+        mov     al,[esi+ebx]            ;; fetch source texel\r
+        add     edx,ebp\r
+        adc     bl,cl\r
+p4:     add     edi,0x12345678\r
+        mov     dl,[eax]\r
+        and     bl,0x7f\r
+        mov     [edi],dl\r
+\r
+        mov     al,[esi+ebx]            ;; fetch source texel\r
+        add     edx,ebp\r
+        adc     bl,cl\r
+p5:     add     edi,0x12345678\r
+        mov     dl,[eax]\r
+        and     bl,0x7f\r
+        mov     [edi],dl\r
+\r
+        mov     al,[esi+ebx]            ;; fetch source texel\r
+        add     edx,ebp\r
+        adc     bl,cl\r
+p6:     add     edi,0x12345678\r
+        mov     dl,[eax]\r
+        and     bl,0x7f\r
+        mov     [edi],dl\r
+\r
+p7:     add     edi,0x12345678\r
+\r
+        dec     ch\r
+        jne     vquadloop\r
+\r
+vdone:\r
+        pop     ebx                     ;; restore register variables\r
+        pop     edi\r
+        pop     esi\r
+        pop     ebp                     ;; restore caller's stack frame pointer\r
+        ret\r
+\r
+;;----------------------------------------------------------------------\r
+;;13-02-98:\r
+;;      R_DrawSkyColumn : same as R_DrawColumn but:\r
+;;\r
+;;      - wrap around 256 instead of 127.\r
+;;      this is needed because we have a higher texture for mouselook,\r
+;;      we need at least 200 lines for the sky.\r
+;;\r
+;;      NOTE: the sky should never wrap, so it could use a faster method.\r
+;;            for the moment, we'll still use a wrapping method...\r
+;;\r
+;;      IT S JUST A QUICK CUT N PASTE, WAS NOT OPTIMISED AS IT SHOULD BE !!!\r
+;;\r
+;;----------------------------------------------------------------------\r
+\r
+cglobal R_DrawSkyColumn_8\r
+;       align   16\r
+R_DrawSkyColumn_8:\r
+        push    ebp\r
+        push    esi\r
+        push    edi\r
+        push    ebx\r
+;;\r
+;; dest = ylookup[dc_yl] + columnofs[dc_x];\r
+;;\r
+        mov     ebp,[dc_yl]\r
+        mov     ebx,ebp\r
+        mov     edi,[ylookup+ebx*4]\r
+        mov     ebx,[dc_x]\r
+        add     edi,[columnofs+ebx*4]   ;; edi = dest\r
+;;\r
+;; pixelcount = yh - yl + 1\r
+;;\r
+        mov     eax,[dc_yh]\r
+        inc     eax\r
+        sub     eax,ebp                 ;; pixel count\r
+        mov     [pixelcount],eax        ;; save for final pixel\r
+        jle     near    vskydone        ;; nothing to scale\r
+;;\r
+;; frac = dc_texturemid - (centery-dc_yl)*fracstep;\r
+;;\r
+        mov     ecx,[dc_iscale]        ;; fracstep\r
+        mov     eax,[centery]\r
+        sub     eax,ebp\r
+        imul    eax,ecx\r
+        mov     edx,[dc_texturemid]\r
+        sub     edx,eax\r
+        mov     ebx,edx\r
+        shr     ebx,16                  ;; frac int.\r
+        and     ebx,0xff\r
+        shl     edx,16                  ;; y frac up\r
+        mov     ebp,ecx\r
+        shl     ebp,16                  ;; fracstep f. up\r
+        shr     ecx,16                  ;; fracstep i. ->cl\r
+        mov     esi,[dc_source]\r
+;;\r
+;; lets rock :) !\r
+;;\r
+        mov     eax,[pixelcount]\r
+        mov     dh,al\r
+        shr     eax,0x2\r
+        mov     ch,al                   ;; quad count\r
+        mov     eax,[dc_colormap]\r
+        test    dh,0x3\r
+        je      vskyquadloop\r
+;;\r
+;;  do un-even pixel\r
+;;\r
+        test    dh,0x1\r
+        je      f2\r
+        mov     al,[esi+ebx]            ;; prep un-even loops\r
+        add     edx,ebp                 ;; ypos f += ystep f\r
+        adc     bl,cl                   ;; ypos i += ystep i\r
+        mov     dl,[eax]                ;; colormap texel\r
+        mov     [edi],dl                ;; output pixel\r
+p8:     add     edi,0x12345678\r
+;;\r
+;;  do two non-quad-aligned pixels\r
+;;\r
+f2:     test    dh,0x2\r
+        je      skyf3\r
+\r
+        mov     al,[esi+ebx]            ;; fetch source texel\r
+        add     edx,ebp                 ;; ypos f += ystep f\r
+        adc     bl,cl                   ;; ypos i += ystep i\r
+        mov     dl,[eax]                ;; colormap texel\r
+        mov     [edi],dl                ;; output pixel\r
+\r
+        mov     al,[esi+ebx]            ;; fetch source texel\r
+        add     edx,ebp                 ;; ypos f += ystep f\r
+        adc     bl,cl                   ;; ypos i += ystep i\r
+        mov     dl,[eax]                ;; colormap texel\r
+p9:     add     edi,0x12345678\r
+        mov     [edi],dl                ;; output pixel\r
+\r
+pa:     add     edi,0x12345678\r
+;;\r
+;;  test if there was at least 4 pixels\r
+;;\r
+skyf3:  test    ch,0xff                 ;; test quad count\r
+        je      vskydone\r
+;;\r
+;; ebp : ystep frac. upper 24 bits\r
+;; edx : y     frac. upper 24 bits\r
+;; ebx : y     i.    lower 7 bits,  masked for index\r
+;; ecx : ch = counter, cl = y step i.\r
+;; eax : colormap aligned 256\r
+;; esi : source texture column\r
+;; edi : dest screen\r
+;;\r
+align 4\r
+vskyquadloop:\r
+        mov     al,[esi+ebx]            ;; prep loop\r
+        add     edx,ebp                 ;; ypos f += ystep f\r
+        mov     dl,[eax]                ;; colormap texel\r
+        adc     bl,cl                   ;; ypos i += ystep i\r
+        mov     [edi],dl                ;; output pixel\r
+\r
+        mov     al,[esi+ebx]            ;; fetch source texel\r
+        add     edx,ebp\r
+        adc     bl,cl\r
+pb:     add     edi,0x12345678\r
+        mov     dl,[eax]\r
+        mov     [edi],dl\r
+\r
+        mov     al,[esi+ebx]            ;; fetch source texel\r
+        add     edx,ebp\r
+        adc     bl,cl\r
+pc:     add     edi,0x12345678\r
+        mov     dl,[eax]\r
+        mov     [edi],dl\r
+\r
+        mov     al,[esi+ebx]            ;; fetch source texel\r
+        add     edx,ebp\r
+        adc     bl,cl\r
+pd:     add     edi,0x12345678\r
+        mov     dl,[eax]\r
+        mov     [edi],dl\r
+\r
+pe:     add     edi,0x12345678\r
+\r
+        dec     ch\r
+        jne     vskyquadloop\r
+vskydone:\r
+        pop     ebx\r
+        pop     edi\r
+        pop     esi\r
+        pop     ebp\r
+        ret\r
+\r
+\r
+;;----------------------------------------------------------------------\r
+;; R_DrawTranslucentColumn_8\r
+;;\r
+;; Vertical column texture drawer, with transparency. Replaces Doom2's\r
+;; 'fuzz' effect, which was not so beautiful.\r
+;; Transparency is always impressive in some way, don't know why...\r
+;;----------------------------------------------------------------------\r
+\r
+cglobal R_DrawTranslucentColumn_8\r
+R_DrawTranslucentColumn_8:\r
+        push    ebp                     ;; preserve caller's stack frame pointer\r
+        push    esi                     ;; preserve register variables\r
+        push    edi\r
+        push    ebx\r
+;;\r
+;; dest = ylookup[dc_yl] + columnofs[dc_x];\r
+;;\r
+        mov     ebp,[dc_yl]\r
+        mov     ebx,ebp\r
+        mov     edi,[ylookup+ebx*4]\r
+        mov     ebx,[dc_x]\r
+        add     edi,[columnofs+ebx*4]   ;; edi = dest\r
+;;\r
+;; pixelcount = yh - yl + 1\r
+;;\r
+        mov     eax,[dc_yh]\r
+        inc     eax\r
+        sub     eax,ebp                 ;; pixel count\r
+        mov     [pixelcount],eax        ;; save for final pixel\r
+        jle     near    vtdone         ;; nothing to scale\r
+;;\r
+;; frac = dc_texturemid - (centery-dc_yl)*fracstep;\r
+;;\r
+        mov     ecx,[dc_iscale]        ;; fracstep\r
+        mov     eax,[centery]\r
+        sub     eax,ebp\r
+        imul    eax,ecx\r
+        mov     edx,[dc_texturemid]\r
+        sub     edx,eax\r
+        mov     ebx,edx\r
+\r
+        shr     ebx,16                  ;; frac int.\r
+        and     ebx,0x7f\r
+        shl     edx,16                  ;; y frac up\r
+\r
+        mov     ebp,ecx\r
+        shl     ebp,16                  ;; fracstep f. up\r
+        shr     ecx,16                  ;; fracstep i. ->cl\r
+        and     cl,0x7f\r
+        push    cx\r
+        mov     ecx,edx\r
+        pop     cx\r
+        mov     edx,[dc_colormap]\r
+        mov     esi,[dc_source]\r
+;;\r
+;; lets rock :) !\r
+;;\r
+        mov     eax,[pixelcount]\r
+        shr     eax,0x2\r
+        test    byte [pixelcount],0x3\r
+        mov     ch,al                   ;; quad count\r
+        mov     eax,[dc_transmap]\r
+        je      vt4quadloop\r
+;;\r
+;;  do un-even pixel\r
+;;\r
+        test    byte [pixelcount],0x1\r
+        je      trf2\r
+\r
+        mov     ah,[esi+ebx]            ;; fetch texel : colormap number\r
+        add     ecx,ebp\r
+        adc     bl,cl\r
+        mov     al,[edi]                ;; fetch dest  : index into colormap\r
+        and     bl,0x7f\r
+        mov     dl,[eax]\r
+        mov     dl,[edx]\r
+        mov     [edi],dl\r
+pf:     add     edi,0x12345678\r
+;;\r
+;;  do two non-quad-aligned pixels\r
+;;\r
+trf2:    test    byte [pixelcount],0x2\r
+        je      trf3\r
+\r
+        mov     ah,[esi+ebx]            ;; fetch texel : colormap number\r
+        add     ecx,ebp\r
+        adc     bl,cl\r
+        mov     al,[edi]                ;; fetch dest  : index into colormap\r
+        and     bl,0x7f\r
+        mov     dl,[eax]\r
+        mov     dl,[edx]\r
+        mov     [edi],dl\r
+pg:     add     edi,0x12345678\r
+\r
+        mov     ah,[esi+ebx]            ;; fetch texel : colormap number\r
+        add     ecx,ebp\r
+        adc     bl,cl\r
+        mov     al,[edi]                ;; fetch dest  : index into colormap\r
+        and     bl,0x7f\r
+        mov     dl,[eax]\r
+        mov     dl,[edx]\r
+        mov     [edi],dl\r
+ph:     add     edi,0x12345678\r
+;;\r
+;;  test if there was at least 4 pixels\r
+;;\r
+trf3:   test    ch,0xff                 ;; test quad count\r
+        je near vtdone\r
+\r
+;;\r
+;; ebp : ystep frac. upper 24 bits\r
+;; edx : y     frac. upper 24 bits\r
+;; ebx : y     i.    lower 7 bits,  masked for index\r
+;; ecx : ch = counter, cl = y step i.\r
+;; eax : colormap aligned 256\r
+;; esi : source texture column\r
+;; edi : dest screen\r
+;;\r
+vt4quadloop:\r
+        mov     ah,[esi+ebx]            ;; fetch texel : colormap number\r
+        mov     [tystep],ebp\r
+pi:     add     edi,0x12345678\r
+        mov     al,[edi]                ;; fetch dest  : index into colormap\r
+pj:     sub     edi,0x12345678\r
+        mov     ebp,edi\r
+pk:     sub     edi,0x12345678\r
+        jmp short inloop\r
+align 4\r
+vtquadloop:\r
+        add     ecx,[tystep]\r
+        adc     bl,cl\r
+q1:     add     ebp,0x23456789\r
+        and     bl,0x7f\r
+        mov     dl,[eax]\r
+        mov     ah,[esi+ebx]            ;; fetch texel : colormap number\r
+        mov     dl,[edx]\r
+        mov     [edi],dl\r
+        mov     al,[ebp]                ;; fetch dest   : index into colormap\r
+inloop:\r
+        add     ecx,[tystep]\r
+        adc     bl,cl\r
+q2:     add     edi,0x23456789\r
+        and     bl,0x7f\r
+        mov     dl,[eax]\r
+        mov     ah,[esi+ebx]            ;; fetch texel : colormap number\r
+        mov     dl,[edx]\r
+        mov     [ebp+0x0],dl\r
+        mov     al,[edi]                ;; fetch dest   : index into colormap\r
+\r
+        add     ecx,[tystep]\r
+        adc     bl,cl\r
+q3:     add     ebp,0x23456789\r
+        and     bl,0x7f\r
+        mov     dl,[eax]\r
+        mov     ah,[esi+ebx]            ;; fetch texel : colormap number\r
+        mov     dl,[edx]\r
+        mov     [edi],dl\r
+        mov     al,[ebp]                ;; fetch dest   : index into colormap\r
+\r
+        add     ecx,[tystep]\r
+        adc     bl,cl\r
+q4:     add     edi,0x23456789\r
+        and     bl,0x7f\r
+        mov     dl,[eax]\r
+        mov     ah,[esi+ebx]            ;; fetch texel : colormap number\r
+        mov     dl,[edx]\r
+        mov     [ebp],dl\r
+        mov     al,[edi]                ;; fetch dest   : index into colormap\r
+\r
+        dec     ch\r
+        jne     vtquadloop\r
+vtdone:\r
+        pop     ebx\r
+        pop     edi\r
+        pop     esi\r
+        pop     ebp\r
+        ret\r
+\r
+\r
+;;----------------------------------------------------------------------\r
+;; R_DrawShadeColumn\r
+;;\r
+;;   for smoke..etc.. test.\r
+;;----------------------------------------------------------------------\r
+cglobal R_DrawShadeColumn_8\r
+R_DrawShadeColumn_8:\r
+        push    ebp                     ;; preserve caller's stack frame pointer\r
+        push    esi                     ;; preserve register variables\r
+        push    edi\r
+        push    ebx\r
+\r
+;;\r
+;; dest = ylookup[dc_yl] + columnofs[dc_x];\r
+;;\r
+        mov     ebp,[dc_yl]\r
+        mov     ebx,ebp\r
+        mov     edi,[ylookup+ebx*4]\r
+        mov     ebx,[dc_x]\r
+        add     edi,[columnofs+ebx*4]  ;; edi = dest\r
+;;\r
+;; pixelcount = yh - yl + 1\r
+;;\r
+        mov     eax,[dc_yh]\r
+        inc     eax\r
+        sub     eax,ebp                 ;; pixel count\r
+        mov     [pixelcount],eax       ;; save for final pixel\r
+        jle near shdone                ;; nothing to scale\r
+;;\r
+;; frac = dc_texturemid - (centery-dc_yl)*fracstep;\r
+;;\r
+        mov     ecx,[dc_iscale]        ;; fracstep\r
+        mov     eax,[centery]\r
+        sub     eax,ebp\r
+        imul    eax,ecx\r
+        mov     edx,[dc_texturemid]\r
+        sub     edx,eax\r
+        mov     ebx,edx\r
+        shr     ebx,16                  ;; frac int.\r
+        and     ebx,byte +0x7f\r
+        shl     edx,16                  ;; y frac up\r
+\r
+        mov     ebp,ecx\r
+        shl     ebp,16                  ;; fracstep f. up\r
+        shr     ecx,16                  ;; fracstep i. ->cl\r
+        and     cl,0x7f\r
+\r
+        mov     esi,[dc_source]\r
+;;\r
+;; lets rock :) !\r
+;;\r
+        mov     eax,[pixelcount]\r
+        mov     dh,al\r
+        shr     eax,2\r
+        mov     ch,al                   ;; quad count\r
+        mov     eax,[colormaps]\r
+        test    dh,3\r
+        je      sh4quadloop\r
+;;\r
+;;  do un-even pixel\r
+;;\r
+        test    dh,0x1\r
+        je      shf2\r
+\r
+        mov     ah,[esi+ebx]            ;; fetch texel : colormap number\r
+        add     edx,ebp\r
+        adc     bl,cl\r
+        mov     al,[edi]                ;; fetch dest  : index into colormap\r
+        and     bl,0x7f\r
+        mov     dl,[eax]\r
+        mov     [edi],dl\r
+pl:     add     edi,0x12345678\r
+;;\r
+;;  do two non-quad-aligned pixels\r
+;;\r
+shf2:\r
+        test    dh,0x2\r
+        je      shf3\r
+\r
+        mov     ah,[esi+ebx]            ;; fetch texel : colormap number\r
+        add     edx,ebp\r
+        adc     bl,cl\r
+        mov     al,[edi]                ;; fetch dest  : index into colormap\r
+        and     bl,0x7f\r
+        mov     dl,[eax]\r
+        mov     [edi],dl\r
+pm:     add     edi,0x12345678\r
+\r
+        mov     ah,[esi+ebx]            ;; fetch texel : colormap number\r
+        add     edx,ebp\r
+        adc     bl,cl\r
+        mov     al,[edi]                ;; fetch dest  : index into colormap\r
+        and     bl,0x7f\r
+        mov     dl,[eax]\r
+        mov     [edi],dl\r
+pn:     add     edi,0x12345678\r
+;;\r
+;;  test if there was at least 4 pixels\r
+;;\r
+shf3:\r
+        test    ch,0xff                 ;; test quad count\r
+        je near shdone\r
+\r
+;;\r
+;; ebp : ystep frac. upper 24 bits\r
+;; edx : y     frac. upper 24 bits\r
+;; ebx : y     i.    lower 7 bits,  masked for index\r
+;; ecx : ch = counter, cl = y step i.\r
+;; eax : colormap aligned 256\r
+;; esi : source texture column\r
+;; edi : dest screen\r
+;;\r
+sh4quadloop:\r
+        mov     dh,0x7f                 ;; prep mask\r
+        mov     ah,[esi+ebx]            ;; fetch texel : colormap number\r
+        mov     [tystep],ebp\r
+po:     add     edi,0x12345678\r
+        mov     al,[edi]                ;; fetch dest  : index into colormap\r
+pp:     sub     edi,0x12345678\r
+        mov     ebp,edi\r
+pq:     sub     edi,0x12345678\r
+        jmp short shinloop\r
+\r
+align  4\r
+shquadloop:\r
+        add     edx,[tystep]\r
+        adc     bl,cl\r
+        and     bl,dh\r
+q5:     add     ebp,0x12345678\r
+        mov     dl,[eax]\r
+        mov     ah,[esi+ebx]            ;; fetch texel : colormap number\r
+        mov     [edi],dl\r
+        mov     al,[ebp]                ;; fetch dest : index into colormap\r
+shinloop:\r
+        add     edx,[tystep]\r
+        adc     bl,cl\r
+        and     bl,dh\r
+q6:     add     edi,0x12345678\r
+        mov     dl,[eax]\r
+        mov     ah,[esi+ebx]            ;; fetch texel : colormap number\r
+        mov     [ebp],dl\r
+        mov     al,[edi]                ;; fetch dest : index into colormap\r
+\r
+        add     edx,[tystep]\r
+        adc     bl,cl\r
+        and     bl,dh\r
+q7:     add     ebp,0x12345678\r
+        mov     dl,[eax]\r
+        mov     ah,[esi+ebx]            ;; fetch texel : colormap number\r
+        mov     [edi],dl\r
+        mov     al,[ebp]                ;; fetch dest : index into colormap\r
+\r
+        add     edx,[tystep]\r
+        adc     bl,cl\r
+        and     bl,dh\r
+q8:     add     edi,0x12345678\r
+        mov     dl,[eax]\r
+        mov     ah,[esi+ebx]            ;; fetch texel : colormap number\r
+        mov     [ebp],dl\r
+        mov     al,[edi]                ;; fetch dest : index into colormap\r
+\r
+        dec     ch\r
+        jne     shquadloop\r
+\r
+shdone:\r
+        pop     ebx                     ;; restore register variables\r
+        pop     edi\r
+        pop     esi\r
+        pop     ebp                     ;; restore caller's stack frame pointer\r
+        ret\r
+\r
+\r
+\r
+;;----------------------------------------------------------------------\r
+;;\r
+;;      R_DrawSpan\r
+;;\r
+;;      Horizontal texture mapping\r
+;;\r
+;;----------------------------------------------------------------------\r
+\r
+\r
+[SECTION .data]\r
+\r
+oldcolormap     dd      0\r
+\r
+[SECTION CODE_SEG write]\r
+\r
+cglobal R_DrawSpan_8\r
+R_DrawSpan_8:\r
+        push    ebp                     ;; preserve caller's stack frame pointer\r
+        push    esi                     ;; preserve register variables\r
+        push    edi\r
+        push    ebx\r
+;;\r
+;; initilise registers\r
+;;\r
+  \r
+        mov     edx, [ds_xfrac]\r
+        mov     eax, [ds_ystep]\r
+        ror     edx, 14\r
+        ror     eax, 15\r
+        mov      bl, dl\r
+        mov     ecx, [ds_xstep]\r
+        mov      dh, al\r
+        mov      ax, 1\r
+        mov     [tystep], eax\r
+\r
+\r
+        mov     eax, [ds_yfrac]\r
+        ror     ecx, 13\r
+        ror     eax, 16\r
+        mov      dl, cl\r
+        mov      bh, al\r
+        xor      cx, cx\r
+        and     ebx, 0x3fff\r
+        mov     [pixelcount],ecx\r
+\r
+        mov     ecx, [ds_x2]\r
+        mov     edi, [ds_y]\r
+        mov     esi, [ds_x1]\r
+        mov     edi, [ylookup+edi*4]\r
+        mov     ebp, ebx\r
+        add     edi, [columnofs+esi*4]\r
+        sub     esi, ecx                ;; pixel count\r
+        shr     ebp, 2\r
+        mov     ecx, [ds_colormap]\r
+        mov      ax, si\r
+        mov     esi, [ds_source]\r
+        sar      ax,1\r
+        jnc     near .midloop           ;; check parity\r
+\r
+;   summary\r
+; edx = high16bit xfrac[0..13], ah=ystep[16..24] al=xtep[14..21]\r
+; ebx = high16bit =0, bh=yfrac[16..24], bl=xfrac[14..21] \r
+; ecx = colormap table cl=0 (colormap is aligned 8 bits)\r
+; eax = high16bit yfrac[0..15], dx = count\r
+; esi = flat texture source\r
+; edi = screeen buffer destination\r
+; ebp = work register\r
+; pixelcount = high16bit xstep[0..13] rest to 0\r
+; tystep     = high16bit ystep[0..15] low 16 bit = 2 (increment of count)\r
+\r
+align 4\r
+.loop\r
+        add     eax, [tystep]\r
+         mov      cl, [esi+ebp]\r
+        adc      bh, dh\r
+         mov      cl, [ecx]\r
+        and      bh, 0x3f \r
+         mov   [edi], cl\r
+        mov     ebp, ebx        \r
+         inc     edi\r
+         shr     ebp, 2\r
+\r
+.midloop:\r
+        add     edx, [pixelcount]\r
+         mov      cl, [esi+ebp]\r
+        adc      bl, dl\r
+         mov      cl, [ecx]\r
+        mov     ebp, ebx \r
+         mov   [edi], cl\r
+        inc     edi\r
+         shr     ebp, 2\r
+\r
+        test    eax, 0xffff\r
+        jnz     near .loop\r
+\r
+.hdone: pop     ebx                     ;; restore register variables\r
+        pop     edi\r
+        pop     esi\r
+        pop     ebp                     ;; restore caller's stack frame pointer\r
+        ret\r
+\r
+\r
+[SECTION .data]\r
+\r
+obelix          dd      0\r
+etaussi         dd      0\r
+\r
+[SECTION CODE_SEG]\r
+\r
+cglobal R_DrawSpan_8_old\r
+R_DrawSpan_8_old:\r
+        push    ebp                     ;; preserve caller's stack frame pointer\r
+        push    esi                     ;; preserve register variables\r
+        push    edi\r
+        push    ebx\r
+;;\r
+;; find loop count\r
+;;\r
+        mov     eax,[ds_x2]\r
+        inc     eax\r
+        sub     eax,[ds_x1]             ;; pixel count\r
+        mov     [pixelcount],eax        ;; save for final pixel\r
+        js near .hdone                  ;; nothing to scale\r
+        shr     eax,0x1                 ;; double pixel count\r
+        mov     [loopcount],eax\r
+;;\r
+;; build composite position\r
+;;\r
+        mov     ebp,[ds_xfrac]\r
+        shl     ebp,10\r
+        and     ebp,0xffff0000\r
+        mov     eax,[ds_yfrac]\r
+        shr     eax,6\r
+        and     eax,0xffff\r
+        mov     edi,[ds_y]\r
+        or      ebp,eax\r
+\r
+        mov     esi,[ds_source]\r
+;;\r
+;; calculate screen dest\r
+;;\r
+        mov     edi,[ylookup+edi*4]\r
+        mov     eax,[ds_x1]\r
+        add     edi,[columnofs+eax*4]\r
+;;\r
+;; build composite step\r
+;;\r
+        mov     ebx,[ds_xstep]\r
+        shl     ebx,10\r
+        and     ebx,0xffff0000\r
+        mov     eax,[ds_ystep]\r
+        shr     eax,6\r
+        and     eax,0xffff\r
+        or      ebx,eax\r
+\r
+        mov     [obelix],ebx\r
+        mov     [etaussi],esi\r
+\r
+;; %eax      aligned colormap\r
+;; %ebx      aligned colormap\r
+;; %ecx,%edx  scratch\r
+;; %esi      virtual source\r
+;; %edi      moving destination pointer\r
+;; %ebp      frac\r
+\r
+        mov     eax,[ds_colormap]\r
+        mov     ecx,ebp\r
+        add     ebp,ebx                 ;; advance frac pointer\r
+        shr     cx,10\r
+        rol     ecx,6\r
+        and     ecx,4095                ;; finish calculation for third pixel\r
+        mov     edx,ebp\r
+        shr     dx,10\r
+        rol     edx,6\r
+        add     ebp,ebx                 ;; advance frac pointer\r
+        and     edx,4095                ;; finish calculation for fourth pixel\r
+        mov     ebx,eax\r
+        mov     al,[esi+ecx]            ;; get first pixel\r
+        mov     bl,[esi+edx]            ;; get second pixel\r
+\r
+        test dword [pixelcount],0xfffffffe\r
+\r
+        mov     dl,[eax]                ;; color translate first pixel\r
+\r
+;;      movw    $0xf0f0,%dx             ;;see visplanes start\r
+\r
+        je      .hchecklast\r
+\r
+        mov     dh,[ebx]                ;; color translate second pixel\r
+        mov     esi,[loopcount]\r
+align 4\r
+.hdoubleloop:\r
+        mov     ecx,ebp\r
+        shr     cx,10\r
+        rol     ecx,6\r
+         add     ebp,[obelix]            ;; advance frac pointer\r
+        mov     [edi],dx                ;; write first pixel\r
+         and     ecx,4095                ;; finish calculation for third pixel\r
+        mov     edx,ebp\r
+        shr     dx,10\r
+        rol     edx,6\r
+         add     ecx,[etaussi]\r
+        and     edx,4095                ;; finish calculation for fourth pixel\r
+         mov     al,[ecx]                ;; get third pixel\r
+        add     ebp,[obelix]            ;; advance frac pointer\r
+         add     edx,[etaussi]\r
+        mov     bl,[edx]                ;; get fourth pixel\r
+         mov     dl,[eax]                ;; color translate third pixel\r
+        add     edi,byte +0x2           ;; advance to third pixel destination\r
+         dec     esi                     ;; done with loop?\r
+        mov     dh,[ebx]                ;; color translate fourth pixel\r
+         jne     .hdoubleloop\r
+;; check for final pixel\r
+.hchecklast:\r
+        test dword [pixelcount],0x1\r
+        je      .hdone\r
+        mov     [edi],dl                ;; write final pixel\r
+.hdone: pop     ebx                     ;; restore register variables\r
+        pop     edi\r
+        pop     esi\r
+        pop     ebp                     ;; restore caller's stack frame pointer\r
+        ret\r
+\r
+\r
+;; ========================================================================\r
+;;  Rasterization des segments d'un polyg\93ne textur\82 de mani\8are LINEAIRE.\r
+;;  Il s'agit donc d'interpoler les coordonn\82es aux bords de la texture en\r
+;;  m\88me temps que les abscisses minx/maxx pour chaque ligne.\r
+;;  L'argument 'dir' indique quels bords de la texture sont interpolés:\r
+;;    0 : segments associ\82s aux bord SUPERIEUR et INFERIEUR ( TY constant )\r
+;;    1 : segments associ\82s aux bord GAUCHE    et DROITE    ( TX constant )\r
+;; ========================================================================\r
+;;\r
+;;  void   rasterize_segment_tex( LONG x1, LONG y1, LONG x2, LONG y2, LONG tv1, LONG tv2, LONG tc, LONG dir );\r
+;;                                   ARG1     ARG2     ARG3     ARG4      ARG5      ARG6     ARG7       ARG8\r
+;;\r
+;;  Pour dir = 0, (tv1,tv2) = (tX1,tX2), tc = tY, en effet TY est constant.\r
+;;\r
+;;  Pour dir = 1, (tv1,tv2) = (tY1,tY2), tc = tX, en effet TX est constant.\r
+;;\r
+;;\r
+;;  Uses:  extern struct rastery *_rastertab;\r
+;;\r
+\r
+[SECTION CODE_SEG write]\r
+\r
+MINX            EQU    0\r
+MAXX            EQU    4\r
+TX1             EQU    8\r
+TY1             EQU    12\r
+TX2             EQU    16\r
+TY2             EQU    20\r
+RASTERY_SIZEOF  EQU    24\r
+\r
+cglobal rasterize_segment_tex\r
+rasterize_segment_tex:\r
+        push    ebp\r
+        mov     ebp,esp\r
+\r
+        sub     esp,byte +0x8           ;; alloue les variables locales\r
+\r
+        push    ebx\r
+        push    esi\r
+        push    edi\r
+        o16 mov ax,es\r
+        push    eax\r
+\r
+;;        #define DX       [ebp-4]\r
+;;        #define TD       [ebp-8]\r
+\r
+        mov     eax,[ebp+0xc]           ;; y1\r
+        mov     ebx,[ebp+0x14]          ;; y2\r
+        cmp     ebx,eax\r
+        je near .L_finished             ;; special (y1==y2) segment horizontal, exit!\r
+\r
+        jg near .L_rasterize_right\r
+\r
+;;rasterize_left:       ;; on rasterize un segment \85 la GAUCHE du polyg\93ne\r
+\r
+        mov     ecx,eax\r
+        sub     ecx,ebx\r
+        inc     ecx                     ;; y1-y2+1\r
+\r
+        mov     eax,RASTERY_SIZEOF\r
+        mul     ebx                     ;; * y2\r
+        mov     esi,[prastertab]\r
+        add     esi,eax                 ;; point into rastertab[y2]\r
+\r
+        mov     eax,[ebp+0x8]           ;; ARG1\r
+        sub     eax,[ebp+0x10]          ;; ARG3\r
+        shl     eax,0x10                ;;     ((x1-x2)<<PRE) ...\r
+        cdq\r
+        idiv    ecx                     ;; dx =     ...        / (y1-y2+1)\r
+        mov     [ebp-0x4],eax           ;; DX\r
+\r
+        mov     eax,[ebp+0x18]          ;; ARG5\r
+        sub     eax,[ebp+0x1c]          ;; ARG6\r
+        shl     eax,0x10\r
+        cdq\r
+        idiv    ecx                     ;;      tdx =((tx1-tx2)<<PRE) / (y1-y2+1)\r
+        mov     [ebp-0x8],eax           ;; idem tdy =((ty1-ty2)<<PRE) / (y1-y2+1)\r
+\r
+        mov     eax,[ebp+0x10]          ;; ARG3\r
+        shl     eax,0x10                ;; x = x2<<PRE\r
+\r
+        mov     ebx,[ebp+0x1c]          ;; ARG6\r
+        shl     ebx,0x10                ;; tx = tx2<<PRE    d0\r
+                                        ;; ty = ty2<<PRE    d1\r
+        mov     edx,[ebp+0x20]          ;; ARG7\r
+        shl     edx,0x10                ;; ty = ty<<PRE     d0\r
+                                        ;; tx = tx<<PRE     d1\r
+        push    ebp\r
+        mov     edi,[ebp-0x4]           ;; DX\r
+        cmp     dword [ebp+0x24],byte +0x0      ;; ARG8   direction ?\r
+\r
+        mov     ebp,[ebp-0x8]           ;; TD\r
+        je      .L_rleft_h_loop\r
+;;\r
+;; TY varie, TX est constant\r
+;;\r
+.L_rleft_v_loop:\r
+        mov     [esi+MINX],eax           ;; rastertab[y].minx = x\r
+          add     ebx,ebp\r
+        mov     [esi+TX1],edx           ;;             .tx1  = tx\r
+          add     eax,edi\r
+        mov     [esi+TY1],ebx           ;;             .ty1  = ty\r
+\r
+        ;;addl    DX, %eax        // x     += dx\r
+        ;;addl    TD, %ebx        // ty    += tdy\r
+\r
+        add     esi,RASTERY_SIZEOF      ;; next raster line into rastertab[]\r
+        dec     ecx\r
+        jne     .L_rleft_v_loop\r
+        pop     ebp\r
+        jmp     .L_finished\r
+;;\r
+;; TX varie, TY est constant\r
+;;\r
+.L_rleft_h_loop:\r
+        mov     [esi+MINX],eax           ;; rastertab[y].minx = x\r
+          add     eax,edi\r
+        mov     [esi+TX1],ebx           ;;             .tx1  = tx\r
+          add     ebx,ebp\r
+        mov     [esi+TY1],edx           ;;             .ty1  = ty\r
+\r
+        ;;addl    DX, %eax        // x     += dx\r
+        ;;addl    TD, %ebx        // tx    += tdx\r
+\r
+        add     esi,RASTERY_SIZEOF      ;; next raster line into rastertab[]\r
+        dec     ecx\r
+        jne     .L_rleft_h_loop\r
+        pop     ebp\r
+        jmp     .L_finished\r
+;;\r
+;; on rasterize un segment \85 la DROITE du polyg\93ne\r
+;;\r
+.L_rasterize_right:\r
+        mov     ecx,ebx\r
+        sub     ecx,eax\r
+        inc     ecx                     ;; y2-y1+1\r
+\r
+        mov     ebx,RASTERY_SIZEOF\r
+        mul     ebx                     ;;   * y1\r
+        mov     esi,[prastertab]\r
+        add     esi,eax                 ;;  point into rastertab[y1]\r
+\r
+        mov     eax,[ebp+0x10]          ;; ARG3\r
+        sub     eax,[ebp+0x8]           ;; ARG1\r
+        shl     eax,0x10                ;; ((x2-x1)<<PRE) ...\r
+        cdq\r
+        idiv    ecx                     ;;  dx =     ...        / (y2-y1+1)\r
+        mov     [ebp-0x4],eax           ;; DX\r
+\r
+        mov     eax,[ebp+0x1c]          ;; ARG6\r
+        sub     eax,[ebp+0x18]          ;; ARG5\r
+        shl     eax,0x10\r
+        cdq\r
+        idiv    ecx                     ;;       tdx =((tx2-tx1)<<PRE) / (y2-y1+1)\r
+        mov     [ebp-0x8],eax           ;;  idem tdy =((ty2-ty1)<<PRE) / (y2-y1+1)\r
+\r
+        mov     eax,[ebp+0x8]           ;; ARG1\r
+        shl     eax,0x10                ;; x  = x1<<PRE\r
+\r
+        mov     ebx,[ebp+0x18]          ;; ARG5\r
+        shl     ebx,0x10                ;; tx = tx1<<PRE    d0\r
+                                        ;; ty = ty1<<PRE    d1\r
+        mov     edx,[ebp+0x20]          ;; ARG7\r
+        shl     edx,0x10                ;; ty = ty<<PRE     d0\r
+                                        ;; tx = tx<<PRE     d1\r
+        push    ebp\r
+        mov     edi,[ebp-0x4]           ;; DX\r
+\r
+        cmp     dword [ebp+0x24], 0     ;; direction ?\r
+\r
+         mov     ebp,[ebp-0x8]          ;; TD\r
+        je      .L_rright_h_loop\r
+;;\r
+;; TY varie, TX est constant\r
+;;\r
+.L_rright_v_loop:\r
+\r
+        mov     [esi+MAXX],eax           ;; rastertab[y].maxx = x\r
+          add     ebx,ebp\r
+        mov     [esi+TX2],edx          ;;             .tx2  = tx\r
+          add     eax,edi\r
+        mov     [esi+TY2],ebx          ;;             .ty2  = ty\r
+\r
+        ;;addl    DX, %eax        // x     += dx\r
+        ;;addl    TD, %ebx        // ty    += tdy\r
+\r
+        add     esi,RASTERY_SIZEOF\r
+        dec     ecx\r
+        jne     .L_rright_v_loop\r
+\r
+        pop     ebp\r
+\r
+        jmp     short .L_finished\r
+;;\r
+;; TX varie, TY est constant\r
+;;\r
+.L_rright_h_loop:\r
+        mov     [esi+MAXX],eax           ;; rastertab[y].maxx = x\r
+          add     eax,edi\r
+        mov     [esi+TX2],ebx          ;;             .tx2  = tx\r
+          add     ebx,ebp\r
+        mov     [esi+TY2],edx          ;;             .ty2  = ty\r
+\r
+        ;;addl    DX, %eax        // x     += dx\r
+        ;;addl    TD, %ebx        // tx    += tdx\r
+\r
+        add     esi,RASTERY_SIZEOF\r
+        dec     ecx\r
+        jne     .L_rright_h_loop\r
+\r
+        pop     ebp\r
+\r
+.L_finished:\r
+        pop     eax\r
+        o16 mov es,ax\r
+        pop     edi\r
+        pop     esi\r
+        pop     ebx\r
+\r
+        mov     esp,ebp\r
+        pop     ebp\r
+        ret\r
+\r
+\r
+;;; this version can draw 64x64 tiles, but they would have to be arranged 4 per row,\r
+;; so that the stride from one line to the next is 256\r
+;;\r
+;; .data\r
+;;xstep         dd      0\r
+;;ystep         dd      0\r
+;;texwidth      dd      64              ;; texture width\r
+;; .text\r
+;; this code is kept in case we add high-detail floor textures for example (256x256)\r
+;       align   16\r
+;_R_DrawSpan_8:\r
+;       push ebp                        ;; preserve caller's stack frame pointer\r
+;       push esi                        ;; preserve register variables\r
+;       push edi\r
+;       push ebx\r
+;;\r
+;; find loop count\r
+;;\r
+;       mov eax,[ds_x2]\r
+;       inc eax\r
+;       sub eax,[ds_x1]                 ;; pixel count\r
+;       mov [pixelcount],eax            ;; save for final pixel\r
+;       js near .hdone                  ;; nothing to scale\r
+;;\r
+;; calculate screen dest\r
+;;\r
+;       mov edi,[ds_y]\r
+;       mov edi,[ylookup+edi*4]\r
+;       mov eax,[ds_x1]\r
+;       add edi,[columnofs+eax*4]\r
+;;\r
+;; prepare registers for inner loop\r
+;;\r
+;       xor eax,eax\r
+;       mov edx,[ds_xfrac]\r
+;       ror edx,16\r
+;       mov al,dl\r
+;       mov ecx,[ds_yfrac]\r
+;       ror ecx,16\r
+;       mov ah,cl\r
+;\r
+;       mov ebx,[ds_xstep]\r
+;       ror ebx,16\r
+;       mov ch,bl\r
+;       and ebx,0xffff0000\r
+;       mov [xstep],ebx\r
+;       mov ebx,[ds_ystep]\r
+;       ror ebx,16\r
+;       mov dh,bl\r
+;       and ebx,0xffff0000\r
+;       mov [ystep],ebx\r
+;\r
+;       mov esi,[ds_source]\r
+;\r
+;;; %eax      Yi,Xi in %ah,%al\r
+;;; %ebx      aligned colormap\r
+;;; %ecx      Yfrac upper, dXi in %ch, %cl is counter (upto 1024pels, =4x256)\r
+;;; %edx      Xfrac upper, dYi in %dh, %dl receives mapped pixels from (ebx)\r
+;;;  ystep    dYfrac, add to %ecx, low word is 0\r
+;;;  xstep    dXfrac, add to %edx, low word is 0\r
+;;; %ebp      temporary register serves as offset like %eax\r
+;;; %esi      virtual source\r
+;;; %edi      moving destination pointer\r
+;\r
+;       mov ebx,[pixelcount]\r
+;       shr ebx,0x2                     ;; 4 pixels per loop\r
+;       test bl,0xff\r
+;       je near .hchecklast\r
+;       mov cl,bl\r
+;\r
+;       mov ebx,[dc_colormap]\r
+;;;\r
+;;; prepare loop with first pixel\r
+;;;\r
+;       add ecx,[ystep]                 ;;pr\82a1\r
+;       adc ah,dh\r
+;       add edx,[xstep]\r
+;       adc al,ch\r
+;       and eax,0x3f3f\r
+;       mov bl,[esi+eax]                ;;pr\82b1\r
+;       mov dl,[ebx]                    ;;pr\82c1\r
+;\r
+;       add ecx,[ystep]                 ;;a2\r
+;        adc ah,dh\r
+;\r
+;.hdoubleloop:\r
+;       mov [edi+1],dl\r
+;        add edx,[xstep]\r
+;       adc al,ch\r
+;        add edi,byte +0x2\r
+;       mov ebp,eax\r
+;        add ecx,[ystep]\r
+;       adc ah,dh\r
+;        and ebp,0x3f3f\r
+;       add edx,[xstep]\r
+;        mov bl,[esi+ebp]\r
+;       adc al,ch\r
+;        mov dl,[ebx]\r
+;       and eax,0x3f3f\r
+;        mov [edi],dl\r
+;       mov bl,[esi+eax]\r
+;        add ecx,[ystep]\r
+;       adc ah,dh\r
+;        add edx,[xstep]\r
+;       adc al,ch\r
+;        mov dl,[ebx]\r
+;       mov ebp,eax\r
+;        mov [edi+1],dl\r
+;       and ebp,0x3f3f\r
+;        add ecx,[ystep]\r
+;       adc ah,dh\r
+;        mov bl,[esi+ebp]\r
+;       add edi,byte +0x2\r
+;        add edx,[xstep]\r
+;       adc al,ch\r
+;        mov dl,[ebx]\r
+;       and eax,0x3f3f\r
+;        mov [edi],dl\r
+;       mov bl,[esi+eax]\r
+;        add ecx,[ystep]\r
+;       adc ah,dh\r
+;        mov dl,[ebx]\r
+;       dec cl\r
+;        jne near .hdoubleloop\r
+;;; check for final pixel\r
+;.hchecklast:\r
+;;; to do\r
+;.hdone:\r
+;       pop ebx\r
+;       pop edi\r
+;       pop esi\r
+;       pop ebp\r
+;       ret\r
diff --git a/test/uscore.asm b/test/uscore.asm
new file mode 100644 (file)
index 0000000..ec61443
--- /dev/null
@@ -0,0 +1,15 @@
+;Testname=test; Arguments=-fbin -ouscore.bin; Files=stdout stderr uscore.bin
+       dd 0x1234_5678
+       dd 305_419_896          ; Same number as above it
+       dd 0x1e16               ; NOT a floating-point number!
+       dd 1e16h                ; NOT a floating-point number!
+       dd 1e16_h               ; NOT a floating-point number!
+       dd $1e16                ; NOT a floating-point number!
+       dd $1e+16               ; NOT a floating-point number!
+       dd 1e16                 ; THIS is a floating-point number!
+       dd 1e+16
+       dd 1.e+16
+       dd 1e+1_6
+       dd 1e1_6
+       dd 1.0e16
+       dd 1_0e16               ; This is 1e17, not 1e16!
diff --git a/test/utf.asm b/test/utf.asm
new file mode 100644 (file)
index 0000000..4b894f8
--- /dev/null
@@ -0,0 +1,30 @@
+;Testname=test;  Arguments=-fbin -outf.bin;         Files=stdout stderr utf.bin
+;Testname=error; Arguments=-fbin -outf.bin -DERROR; Files=stdout stderr utf.bin
+%define u(x) __utf16__(x)
+%define w(x) __utf32__(x)
+
+       db `Test \u306a\U0001abcd\n`
+       dw u(`Test \u306a\U0001abcd\n`)
+       dd w(`Test \u306a\U0001abcd\n`)
+
+       db `\u306a`
+       db `\xe3\x81\xaa`
+
+       dw __utf16__ "Hello, World!"
+
+       nop
+
+       mov ax,u(`a`)
+       mov bx,u(`\u306a`)
+       mov cx,u(`\xe3\x81\xaa`)
+       mov eax,u(`ab`)
+       mov ebx,u(`\U0001abcd`)
+       mov ecx,w(`\U0001abcd`)
+
+%ifdef ERROR
+       dw __utf16__ 33
+       dw __utf16__, 46
+       dw __utf16__("Hello, World!",16)
+       dw __utf16__("Hello, World!",16
+       dw u(`\xff`)
+%endif
diff --git a/test/vmread.asm b/test/vmread.asm
new file mode 100644 (file)
index 0000000..551c71a
--- /dev/null
@@ -0,0 +1,26 @@
+;Testname=test; Arguments=-fbin -ovmread.bin; Files=stdout stderr vmread.bin
+
+       bits 32
+       vmread dword [0], eax
+       vmwrite eax, dword [0]
+       vmread [0], eax
+       vmwrite eax, [0]
+
+       bits 64
+       vmread qword [0], rax
+       vmwrite rax, qword [0]
+       vmread [0], rax
+       vmwrite rax, [0]
+
+%ifdef ERROR
+       bits 32
+       vmread qword [0], eax
+       vmwrite eax, qword [0]
+
+       bits 64
+       vmread dword [0], eax
+       vmwrite eax, dword [0]
+
+       vmread qword [0], eax
+       vmwrite eax, qword [0]
+%endif
\ No newline at end of file
diff --git a/test/weirdpaste.asm b/test/weirdpaste.asm
new file mode 100644 (file)
index 0000000..46bfa90
--- /dev/null
@@ -0,0 +1,29 @@
+;Testname=preproc; Arguments=-E; Files=stdout stderr
+;Testname=bin; Arguments=-fbin -oweirdpaste.bin; Files=stdout stderr weirdpaste.bin
+
+       %define foo xyzzy
+%define bar 1e+10
+
+%define xyzzy1e 15
+
+%macro dx 2
+%assign        xx %1%2
+       dw xx
+%endmacro
+
+       dx foo, bar
+
+%macro df 2
+%assign xy __float32__(%1e+%2)
+       dd xy
+       dd %1e+%2
+%endmacro
+
+       df 1, 36
+       df 33, 20
+       df 0, 2
+       df 1.2, 5
+
+
+%define N 1e%++%+ 5
+       dd N, 1e+5
diff --git a/test/xchg.asm b/test/xchg.asm
new file mode 100644 (file)
index 0000000..9c826dd
--- /dev/null
@@ -0,0 +1,96 @@
+;Testname=unoptimized; Arguments=-fbin -oxchg.bin -O0; Files=stdout stderr xchg.bin
+;Testname=optimized;   Arguments=-fbin -oxchg.bin -Ox; Files=stdout stderr xchg.bin
+
+%macro x 2
+       xchg %1,%2
+       xchg %2,%1
+%endmacro
+
+       bits 16
+       
+       x ax,ax
+       x ax,cx
+       x ax,dx
+       x ax,bx
+       x ax,sp
+       x ax,bp
+       x ax,si
+       x ax,di
+       x eax,eax
+       x eax,ecx
+       x eax,edx
+       x eax,ebx
+       x eax,esp
+       x eax,ebp
+       x eax,esi
+       x eax,edi
+
+       bits 32
+       
+       x ax,ax
+       x ax,cx
+       x ax,dx
+       x ax,bx
+       x ax,sp
+       x ax,bp
+       x ax,si
+       x ax,di
+       x eax,eax
+       x eax,ecx
+       x eax,edx
+       x eax,ebx
+       x eax,esp
+       x eax,ebp
+       x eax,esi
+       x eax,edi
+
+       bits 64
+       
+       x ax,ax
+       x ax,cx
+       x ax,dx
+       x ax,bx
+       x ax,sp
+       x ax,bp
+       x ax,si
+       x ax,di
+       x ax,r8w
+       x ax,r9w
+       x ax,r10w
+       x ax,r11w
+       x ax,r12w
+       x ax,r13w
+       x ax,r14w
+       x ax,r15w
+       x eax,eax
+       x eax,ecx
+       x eax,edx
+       x eax,ebx
+       x eax,esp
+       x eax,ebp
+       x eax,esi
+       x eax,edi
+       x eax,r8d
+       x eax,r9d
+       x eax,r10d
+       x eax,r11d
+       x eax,r12d
+       x eax,r13d
+       x eax,r14d
+       x eax,r15d
+       x rax,rax
+       x rax,rcx
+       x rax,rdx
+       x rax,rbx
+       x rax,rsp
+       x rax,rbp
+       x rax,rsi
+       x rax,rdi
+       x rax,r8
+       x rax,r9
+       x rax,r10
+       x rax,r11
+       x rax,r12
+       x rax,r13
+       x rax,r14
+       x rax,r15
diff --git a/test/xcrypt.asm b/test/xcrypt.asm
new file mode 100644 (file)
index 0000000..55a3f5d
--- /dev/null
@@ -0,0 +1,24 @@
+;Testname=test; Arguments=-fbin -oxcrypt.bin; Files=stdout stderr xcrypt.bin
+; BR 2029829
+
+       bits 32
+
+       rep xstore
+       rep xcryptecb
+       rep xcryptcbc
+       rep xcryptctr
+       rep xcryptcfb
+       rep xcryptofb
+       rep montmul
+       rep xsha1
+       rep xsha256
+
+       xstore
+       xcryptecb
+       xcryptcbc
+       xcryptctr
+       xcryptcfb
+       xcryptofb
+       montmul
+       xsha1
+       xsha256
diff --git a/test/zerobyte.asm b/test/zerobyte.asm
new file mode 100644 (file)
index 0000000..c3a0441
--- /dev/null
@@ -0,0 +1,22 @@
+;Testname=test; Arguments=-fbin -ozerobyte.bin; Files=stdout stderr zerobyte.bin
+       bits 64
+
+       mov eax,bar-foo
+
+foo:
+       add al,r10b
+bar:
+
+       lldt ax
+       lldt r8w
+       ltr [rax]
+       sldt eax
+       sldt r8d
+       str eax
+       str rax
+       str r8d
+       str r8
+       verr ax
+       verr r8w
+       verw ax
+       verw r8w
diff --git a/tokens.dat b/tokens.dat
new file mode 100644 (file)
index 0000000..c7d3b97
--- /dev/null
@@ -0,0 +1,96 @@
+## --------------------------------------------------------------------------
+##   
+##   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.
+##
+## --------------------------------------------------------------------------
+
+#
+# Tokens other than instructions and registers
+#
+
+% TOKEN_PREFIX, 0, P_*
+a16
+a32
+a64
+asp
+lock
+o16
+o32
+o64
+osp
+rep
+repe
+repne
+repnz
+repz
+times
+wait
+
+% TOKEN_SPECIAL, 0, S_*
+abs
+byte
+dword
+far
+long
+near
+nosplit
+oword
+qword
+rel
+short
+strict
+to
+tword
+word
+yword
+
+% TOKEN_FLOAT, 0, 0
+__infinity__
+__nan__
+__qnan__
+__snan__
+
+% TOKEN_FLOATIZE, 0, FLOAT_{__float*__}
+__float8__
+__float16__
+__float32__
+__float64__
+__float80m__
+__float80e__
+__float128l__
+__float128h__
+
+% TOKEN_STRFUNC, 0, STRFUNC_{__*__}
+__utf16__
+__utf32__
+
+% TOKEN_*, 0, 0
+seg
+wrt
diff --git a/tokens.h b/tokens.h
new file mode 100644 (file)
index 0000000..f9308f1
--- /dev/null
+++ b/tokens.h
@@ -0,0 +1,11 @@
+/*
+ * This file is generated from insns.dat, regs.dat and token.dat
+ * by tokhash.pl; do not edit.
+ */
+
+#ifndef NASM_TOKENS_H
+#define NASM_TOKENS_H
+
+#define MAX_KEYWORD 16 /* length of longest keyword */
+
+#endif /* NASM_TOKENS_H */
diff --git a/tokhash.c b/tokhash.c
new file mode 100644 (file)
index 0000000..ee2b303
--- /dev/null
+++ b/tokhash.c
@@ -0,0 +1,5821 @@
+/*
+ * This file is generated from insns.dat, regs.dat and token.dat
+ * by tokhash.pl; do not edit.
+ */
+
+#include "compiler.h"
+#include <string.h>
+#include "nasm.h"
+#include "hashtbl.h"
+#include "insns.h"
+
+struct tokendata {
+    const char *string;
+    int16_t tokentype;
+    int16_t aux;
+    int32_t num;
+};
+
+int nasm_token_hash(const char *token, struct tokenval *tv)
+{
+#define UNUSED 16383
+    static const int16_t hash1[2048] = {
+        0,
+        0,
+        0,
+        UNUSED,
+        UNUSED,
+        UNUSED,
+        UNUSED,
+        UNUSED,
+        0,
+        0,
+        UNUSED,
+        UNUSED,
+        0,
+        0,
+        0,
+        0,
+        0,
+        UNUSED,
+        UNUSED,
+        0,
+        0,
+        0,
+        UNUSED,
+        0,
+        0,
+        0,
+        UNUSED,
+        894,
+        0,
+        0,
+        UNUSED,
+        0,
+        UNUSED,
+        UNUSED,
+        0,
+        0,
+        UNUSED,
+        UNUSED,
+        UNUSED,
+        UNUSED,
+        0,
+        UNUSED,
+        0,
+        0,
+        0,
+        UNUSED,
+        UNUSED,
+        0,
+        UNUSED,
+        0,
+        UNUSED,
+        UNUSED,
+        0,
+        0,
+        0,
+        0,
+        UNUSED,
+        0,
+        UNUSED,
+        UNUSED,
+        0,
+        UNUSED,
+        0,
+        0,
+        0,
+        UNUSED,
+        UNUSED,
+        0,
+        UNUSED,
+        0,
+        0,
+        UNUSED,
+        UNUSED,
+        0,
+        UNUSED,
+        0,
+        UNUSED,
+        0,
+        UNUSED,
+        0,
+        0,
+        UNUSED,
+        UNUSED,
+        UNUSED,
+        0,
+        UNUSED,
+        UNUSED,
+        UNUSED,
+        903,
+        504,
+        0,
+        0,
+        0,
+        UNUSED,
+        0,
+        UNUSED,
+        0,
+        0,
+        UNUSED,
+        252,
+        -2115,
+        1076,
+        UNUSED,
+        UNUSED,
+        0,
+        0,
+        0,
+        -322,
+        0,
+        UNUSED,
+        UNUSED,
+        UNUSED,
+        -1210,
+        1011,
+        0,
+        UNUSED,
+        0,
+        0,
+        124,
+        0,
+        -317,
+        UNUSED,
+        UNUSED,
+        UNUSED,
+        0,
+        UNUSED,
+        4,
+        UNUSED,
+        UNUSED,
+        197,
+        UNUSED,
+        UNUSED,
+        UNUSED,
+        0,
+        0,
+        0,
+        0,
+        UNUSED,
+        UNUSED,
+        0,
+        -245,
+        UNUSED,
+        UNUSED,
+        0,
+        0,
+        UNUSED,
+        UNUSED,
+        UNUSED,
+        0,
+        291,
+        509,
+        0,
+        UNUSED,
+        907,
+        0,
+        UNUSED,
+        UNUSED,
+        UNUSED,
+        0,
+        -1787,
+        UNUSED,
+        UNUSED,
+        UNUSED,
+        0,
+        0,
+        UNUSED,
+        UNUSED,
+        0,
+        0,
+        0,
+        UNUSED,
+        0,
+        UNUSED,
+        UNUSED,
+        0,
+        UNUSED,
+        UNUSED,
+        0,
+        0,
+        2503,
+        UNUSED,
+        UNUSED,
+        UNUSED,
+        UNUSED,
+        UNUSED,
+        -1835,
+        UNUSED,
+        UNUSED,
+        UNUSED,
+        UNUSED,
+        UNUSED,
+        UNUSED,
+        UNUSED,
+        UNUSED,
+        UNUSED,
+        753,
+        0,
+        UNUSED,
+        UNUSED,
+        0,
+        0,
+        UNUSED,
+        UNUSED,
+        1753,
+        0,
+        0,
+        UNUSED,
+        0,
+        0,
+        UNUSED,
+        0,
+        1513,
+        UNUSED,
+        UNUSED,
+        UNUSED,
+        -5,
+        UNUSED,
+        UNUSED,
+        357,
+        UNUSED,
+        UNUSED,
+        0,
+        0,
+        UNUSED,
+        0,
+        0,
+        UNUSED,
+        797,
+        UNUSED,
+        UNUSED,
+        925,
+        0,
+        UNUSED,
+        UNUSED,
+        UNUSED,
+        0,
+        UNUSED,
+        UNUSED,
+        0,
+        UNUSED,
+        UNUSED,
+        0,
+        UNUSED,
+        UNUSED,
+        0,
+        UNUSED,
+        0,
+        UNUSED,
+        0,
+        0,
+        UNUSED,
+        0,
+        0,
+        UNUSED,
+        0,
+        0,
+        559,
+        362,
+        UNUSED,
+        UNUSED,
+        UNUSED,
+        UNUSED,
+        1007,
+        0,
+        UNUSED,
+        -748,
+        0,
+        1413,
+        103,
+        UNUSED,
+        UNUSED,
+        0,
+        UNUSED,
+        1679,
+        184,
+        UNUSED,
+        0,
+        UNUSED,
+        UNUSED,
+        UNUSED,
+        UNUSED,
+        -1635,
+        1155,
+        UNUSED,
+        UNUSED,
+        UNUSED,
+        754,
+        239,
+        0,
+        0,
+        UNUSED,
+        0,
+        UNUSED,
+        -146,
+        UNUSED,
+        UNUSED,
+        UNUSED,
+        0,
+        UNUSED,
+        0,
+        UNUSED,
+        0,
+        0,
+        UNUSED,
+        UNUSED,
+        UNUSED,
+        0,
+        -302,
+        0,
+        0,
+        UNUSED,
+        0,
+        0,
+        914,
+        UNUSED,
+        UNUSED,
+        UNUSED,
+        0,
+        0,
+        0,
+        UNUSED,
+        0,
+        UNUSED,
+        UNUSED,
+        UNUSED,
+        0,
+        UNUSED,
+        0,
+        1029,
+        UNUSED,
+        178,
+        0,
+        0,
+        UNUSED,
+        0,
+        757,
+        UNUSED,
+        UNUSED,
+        0,
+        0,
+        0,
+        1125,
+        UNUSED,
+        UNUSED,
+        UNUSED,
+        UNUSED,
+        0,
+        UNUSED,
+        UNUSED,
+        UNUSED,
+        0,
+        UNUSED,
+        0,
+        1320,
+        -283,
+        UNUSED,
+        105,
+        UNUSED,
+        22,
+        UNUSED,
+        0,
+        UNUSED,
+        UNUSED,
+        UNUSED,
+        UNUSED,
+        1147,
+        0,
+        UNUSED,
+        0,
+        259,
+        UNUSED,
+        922,
+        UNUSED,
+        16,
+        -1765,
+        UNUSED,
+        UNUSED,
+        UNUSED,
+        UNUSED,
+        1046,
+        UNUSED,
+        UNUSED,
+        UNUSED,
+        UNUSED,
+        UNUSED,
+        0,
+        -249,
+        UNUSED,
+        UNUSED,
+        UNUSED,
+        1296,
+        UNUSED,
+        UNUSED,
+        UNUSED,
+        UNUSED,
+        UNUSED,
+        UNUSED,
+        UNUSED,
+        0,
+        0,
+        UNUSED,
+        UNUSED,
+        70,
+        1215,
+        UNUSED,
+        0,
+        UNUSED,
+        75,
+        1407,
+        1342,
+        UNUSED,
+        0,
+        0,
+        UNUSED,
+        0,
+        1920,
+        0,
+        UNUSED,
+        1128,
+        0,
+        0,
+        0,
+        0,
+        0,
+        0,
+        UNUSED,
+        0,
+        46,
+        UNUSED,
+        0,
+        -333,
+        UNUSED,
+        UNUSED,
+        0,
+        UNUSED,
+        0,
+        -73,
+        UNUSED,
+        0,
+        1201,
+        UNUSED,
+        96,
+        UNUSED,
+        UNUSED,
+        -387,
+        UNUSED,
+        UNUSED,
+        UNUSED,
+        UNUSED,
+        UNUSED,
+        0,
+        220,
+        0,
+        0,
+        UNUSED,
+        -1780,
+        1866,
+        -694,
+        453,
+        0,
+        0,
+        1388,
+        UNUSED,
+        0,
+        0,
+        -364,
+        UNUSED,
+        315,
+        UNUSED,
+        UNUSED,
+        UNUSED,
+        UNUSED,
+        655,
+        457,
+        -863,
+        943,
+        371,
+        UNUSED,
+        UNUSED,
+        21,
+        662,
+        UNUSED,
+        1285,
+        0,
+        1103,
+        UNUSED,
+        UNUSED,
+        UNUSED,
+        0,
+        325,
+        0,
+        0,
+        0,
+        UNUSED,
+        0,
+        -196,
+        882,
+        0,
+        0,
+        450,
+        800,
+        UNUSED,
+        UNUSED,
+        UNUSED,
+        0,
+        UNUSED,
+        UNUSED,
+        UNUSED,
+        UNUSED,
+        UNUSED,
+        UNUSED,
+        1112,
+        415,
+        UNUSED,
+        UNUSED,
+        -820,
+        UNUSED,
+        UNUSED,
+        UNUSED,
+        535,
+        UNUSED,
+        723,
+        940,
+        UNUSED,
+        -595,
+        UNUSED,
+        UNUSED,
+        0,
+        UNUSED,
+        0,
+        146,
+        1913,
+        UNUSED,
+        UNUSED,
+        -43,
+        UNUSED,
+        UNUSED,
+        571,
+        -587,
+        1492,
+        2451,
+        1143,
+        UNUSED,
+        0,
+        UNUSED,
+        0,
+        205,
+        UNUSED,
+        UNUSED,
+        0,
+        -532,
+        UNUSED,
+        613,
+        1381,
+        UNUSED,
+        1028,
+        UNUSED,
+        0,
+        1208,
+        -733,
+        0,
+        526,
+        UNUSED,
+        UNUSED,
+        UNUSED,
+        0,
+        -623,
+        0,
+        0,
+        11,
+        -124,
+        0,
+        UNUSED,
+        0,
+        UNUSED,
+        -37,
+        -1522,
+        0,
+        0,
+        598,
+        UNUSED,
+        0,
+        68,
+        0,
+        0,
+        0,
+        0,
+        UNUSED,
+        0,
+        -1501,
+        0,
+        UNUSED,
+        UNUSED,
+        0,
+        UNUSED,
+        UNUSED,
+        UNUSED,
+        -9,
+        UNUSED,
+        1682,
+        -566,
+        UNUSED,
+        UNUSED,
+        0,
+        UNUSED,
+        -1091,
+        UNUSED,
+        95,
+        UNUSED,
+        UNUSED,
+        1306,
+        -254,
+        UNUSED,
+        0,
+        0,
+        0,
+        -1668,
+        UNUSED,
+        -954,
+        0,
+        UNUSED,
+        953,
+        0,
+        0,
+        1631,
+        UNUSED,
+        UNUSED,
+        0,
+        0,
+        UNUSED,
+        UNUSED,
+        0,
+        104,
+        0,
+        UNUSED,
+        -164,
+        UNUSED,
+        UNUSED,
+        UNUSED,
+        UNUSED,
+        2399,
+        0,
+        446,
+        UNUSED,
+        0,
+        UNUSED,
+        UNUSED,
+        0,
+        0,
+        542,
+        UNUSED,
+        324,
+        1237,
+        UNUSED,
+        UNUSED,
+        UNUSED,
+        UNUSED,
+        -880,
+        424,
+        342,
+        -986,
+        0,
+        UNUSED,
+        UNUSED,
+        1791,
+        0,
+        UNUSED,
+        0,
+        1174,
+        0,
+        0,
+        UNUSED,
+        UNUSED,
+        253,
+        0,
+        UNUSED,
+        UNUSED,
+        227,
+        1337,
+        -1799,
+        323,
+        UNUSED,
+        0,
+        0,
+        UNUSED,
+        UNUSED,
+        685,
+        -1785,
+        1172,
+        -148,
+        725,
+        515,
+        998,
+        UNUSED,
+        UNUSED,
+        UNUSED,
+        UNUSED,
+        1133,
+        862,
+        0,
+        0,
+        716,
+        UNUSED,
+        UNUSED,
+        1329,
+        UNUSED,
+        UNUSED,
+        2198,
+        0,
+        UNUSED,
+        UNUSED,
+        UNUSED,
+        0,
+        UNUSED,
+        0,
+        UNUSED,
+        UNUSED,
+        UNUSED,
+        2652,
+        UNUSED,
+        UNUSED,
+        55,
+        0,
+        UNUSED,
+        UNUSED,
+        UNUSED,
+        0,
+        UNUSED,
+        UNUSED,
+        0,
+        UNUSED,
+        0,
+        361,
+        0,
+        UNUSED,
+        -272,
+        UNUSED,
+        1234,
+        UNUSED,
+        135,
+        UNUSED,
+        9,
+        1448,
+        UNUSED,
+        UNUSED,
+        906,
+        1360,
+        UNUSED,
+        421,
+        UNUSED,
+        -205,
+        -848,
+        UNUSED,
+        1132,
+        216,
+        -279,
+        UNUSED,
+        1005,
+        UNUSED,
+        UNUSED,
+        UNUSED,
+        UNUSED,
+        UNUSED,
+        0,
+        77,
+        -150,
+        UNUSED,
+        UNUSED,
+        0,
+        -20,
+        UNUSED,
+        179,
+        -560,
+        UNUSED,
+        UNUSED,
+        0,
+        UNUSED,
+        UNUSED,
+        796,
+        658,
+        UNUSED,
+        UNUSED,
+        UNUSED,
+        402,
+        165,
+        1034,
+        UNUSED,
+        53,
+        -325,
+        673,
+        1190,
+        UNUSED,
+        UNUSED,
+        -627,
+        0,
+        0,
+        2209,
+        UNUSED,
+        0,
+        1073,
+        -526,
+        946,
+        -204,
+        -352,
+        UNUSED,
+        1066,
+        -627,
+        UNUSED,
+        -17,
+        UNUSED,
+        UNUSED,
+        218,
+        UNUSED,
+        UNUSED,
+        1150,
+        130,
+        UNUSED,
+        1110,
+        1212,
+        UNUSED,
+        UNUSED,
+        UNUSED,
+        UNUSED,
+        1365,
+        UNUSED,
+        UNUSED,
+        1563,
+        UNUSED,
+        1143,
+        UNUSED,
+        0,
+        99,
+        651,
+        UNUSED,
+        0,
+        -1144,
+        0,
+        UNUSED,
+        760,
+        UNUSED,
+        216,
+        679,
+        UNUSED,
+        UNUSED,
+        844,
+        0,
+        -46,
+        890,
+        UNUSED,
+        UNUSED,
+        UNUSED,
+        UNUSED,
+        -815,
+        UNUSED,
+        717,
+        UNUSED,
+        15,
+        0,
+        UNUSED,
+        UNUSED,
+        -556,
+        672,
+        942,
+        -352,
+        UNUSED,
+        UNUSED,
+        0,
+        UNUSED,
+        UNUSED,
+        UNUSED,
+        275,
+        736,
+        0,
+        UNUSED,
+        UNUSED,
+        UNUSED,
+        0,
+        -625,
+        1063,
+        -1350,
+        UNUSED,
+        -752,
+        UNUSED,
+        0,
+        692,
+        622,
+        432,
+        -133,
+        UNUSED,
+        -278,
+        1361,
+        UNUSED,
+        UNUSED,
+        UNUSED,
+        1098,
+        UNUSED,
+        432,
+        -331,
+        634,
+        240,
+        1405,
+        668,
+        2739,
+        -1061,
+        UNUSED,
+        UNUSED,
+        317,
+        UNUSED,
+        410,
+        148,
+        UNUSED,
+        987,
+        UNUSED,
+        556,
+        UNUSED,
+        -524,
+        UNUSED,
+        0,
+        UNUSED,
+        1373,
+        UNUSED,
+        UNUSED,
+        636,
+        835,
+        1897,
+        UNUSED,
+        UNUSED,
+        -746,
+        296,
+        UNUSED,
+        UNUSED,
+        1044,
+        UNUSED,
+        290,
+        -508,
+        -500,
+        -651,
+        UNUSED,
+        UNUSED,
+        UNUSED,
+        UNUSED,
+        1465,
+        UNUSED,
+        UNUSED,
+        1522,
+        -302,
+        865,
+        UNUSED,
+        UNUSED,
+        45,
+        -392,
+        UNUSED,
+        -1166,
+        0,
+        946,
+        UNUSED,
+        UNUSED,
+        UNUSED,
+        -1001,
+        559,
+        0,
+        251,
+        44,
+        199,
+        81,
+        UNUSED,
+        UNUSED,
+        UNUSED,
+        UNUSED,
+        0,
+        327,
+        0,
+        UNUSED,
+        -932,
+        -501,
+        -1089,
+        -15,
+        0,
+        469,
+        1639,
+        0,
+        698,
+        308,
+        UNUSED,
+        UNUSED,
+        -363,
+        958,
+        0,
+        UNUSED,
+        UNUSED,
+        UNUSED,
+        0,
+        0,
+        272,
+        UNUSED,
+        613,
+        -382,
+        UNUSED,
+        UNUSED,
+        -479,
+        0,
+        UNUSED,
+        UNUSED,
+        426,
+        -200,
+        UNUSED,
+        952,
+        25,
+        0,
+        1363,
+        UNUSED,
+        -387,
+        244,
+        UNUSED,
+        UNUSED,
+        620,
+        UNUSED,
+        -1106,
+        UNUSED,
+        444,
+        UNUSED,
+        332,
+        UNUSED,
+        UNUSED,
+        UNUSED,
+        -452,
+        UNUSED,
+        563,
+        0,
+        UNUSED,
+        UNUSED,
+        UNUSED,
+        90,
+        532,
+        UNUSED,
+        1594,
+        557,
+        0,
+        UNUSED,
+        0,
+        UNUSED,
+        457,
+        UNUSED,
+        UNUSED,
+        UNUSED,
+        217,
+        -1241,
+        199,
+        1349,
+        1068,
+        321,
+        UNUSED,
+        1651,
+        UNUSED,
+        396,
+        UNUSED,
+        -278,
+        UNUSED,
+        UNUSED,
+        UNUSED,
+        1545,
+        UNUSED,
+        UNUSED,
+        0,
+        UNUSED,
+        1584,
+        0,
+        UNUSED,
+        UNUSED,
+        1428,
+        UNUSED,
+        UNUSED,
+        UNUSED,
+        UNUSED,
+        UNUSED,
+        -263,
+        UNUSED,
+        -20,
+        1398,
+        UNUSED,
+        UNUSED,
+        UNUSED,
+        UNUSED,
+        1113,
+        -206,
+        152,
+        -333,
+        UNUSED,
+        818,
+        723,
+        168,
+        UNUSED,
+        896,
+        276,
+        -409,
+        UNUSED,
+        978,
+        734,
+        UNUSED,
+        UNUSED,
+        UNUSED,
+        619,
+        UNUSED,
+        0,
+        0,
+        82,
+        UNUSED,
+        -170,
+        UNUSED,
+        996,
+        UNUSED,
+        UNUSED,
+        UNUSED,
+        648,
+        UNUSED,
+        UNUSED,
+        -281,
+        1135,
+        391,
+        UNUSED,
+        -30,
+        0,
+        0,
+        -689,
+        UNUSED,
+        UNUSED,
+        -440,
+        UNUSED,
+        818,
+        -160,
+        474,
+        UNUSED,
+        UNUSED,
+        UNUSED,
+        1069,
+        233,
+        UNUSED,
+        845,
+        955,
+        UNUSED,
+        0,
+        1073,
+        UNUSED,
+        UNUSED,
+        UNUSED,
+        -1917,
+        UNUSED,
+        999,
+        UNUSED,
+        UNUSED,
+        UNUSED,
+        UNUSED,
+        0,
+        1024,
+        0,
+        407,
+        UNUSED,
+        1573,
+        1085,
+        -239,
+        0,
+        510,
+        UNUSED,
+        1088,
+        UNUSED,
+        175,
+        0,
+        UNUSED,
+        UNUSED,
+        UNUSED,
+        UNUSED,
+        495,
+        1196,
+        UNUSED,
+        0,
+        UNUSED,
+        -442,
+        UNUSED,
+        UNUSED,
+        UNUSED,
+        1059,
+        332,
+        UNUSED,
+        UNUSED,
+        UNUSED,
+        -762,
+        2306,
+        UNUSED,
+        0,
+        180,
+        1380,
+        UNUSED,
+        UNUSED,
+        UNUSED,
+        696,
+        UNUSED,
+        485,
+        -399,
+        630,
+        -1299,
+        1615,
+        -1201,
+        1199,
+        UNUSED,
+        UNUSED,
+        19,
+        UNUSED,
+        UNUSED,
+        UNUSED,
+        UNUSED,
+        UNUSED,
+        UNUSED,
+        0,
+        UNUSED,
+        UNUSED,
+        UNUSED,
+        UNUSED,
+        396,
+        60,
+        UNUSED,
+        UNUSED,
+        UNUSED,
+        367,
+        UNUSED,
+        UNUSED,
+        636,
+        UNUSED,
+        0,
+        86,
+        253,
+        UNUSED,
+        UNUSED,
+        UNUSED,
+        UNUSED,
+        1296,
+        1335,
+        UNUSED,
+        UNUSED,
+        741,
+        UNUSED,
+        UNUSED,
+        1464,
+        UNUSED,
+        UNUSED,
+        389,
+        920,
+        1549,
+        UNUSED,
+        UNUSED,
+        UNUSED,
+        UNUSED,
+        UNUSED,
+        1480,
+        686,
+        UNUSED,
+        10,
+        400,
+        814,
+        608,
+        UNUSED,
+        327,
+        -875,
+        UNUSED,
+        UNUSED,
+        0,
+        -1508,
+        UNUSED,
+        UNUSED,
+        0,
+        0,
+        0,
+        1568,
+        0,
+        0,
+        932,
+        0,
+        UNUSED,
+        UNUSED,
+        1664,
+        300,
+        UNUSED,
+        -107,
+        UNUSED,
+        -180,
+        406,
+        904,
+        UNUSED,
+        1869,
+        UNUSED,
+        UNUSED,
+        204,
+        238,
+        UNUSED,
+        UNUSED,
+        UNUSED,
+        -2438,
+        754,
+        UNUSED,
+        1048,
+        81,
+        UNUSED,
+        UNUSED,
+        UNUSED,
+        UNUSED,
+        212,
+        UNUSED,
+        0,
+        UNUSED,
+        UNUSED,
+        1503,
+        UNUSED,
+        1670,
+        291,
+        -450,
+        UNUSED,
+        120,
+        888,
+        1375,
+        UNUSED,
+        -888,
+        1180,
+        0,
+        -234,
+        UNUSED,
+        1179,
+        UNUSED,
+        145,
+        UNUSED,
+        UNUSED,
+        UNUSED,
+        824,
+        UNUSED,
+        367,
+        1031,
+        343,
+        UNUSED,
+        -1558,
+        -212,
+        UNUSED,
+        UNUSED,
+        1092,
+        328,
+        1643,
+        UNUSED,
+        UNUSED,
+        UNUSED,
+        -785,
+        1371,
+        1299,
+        879,
+        UNUSED,
+        424,
+        1229,
+        -151,
+        UNUSED,
+        643,
+        UNUSED,
+        UNUSED,
+        UNUSED,
+        1528,
+        1583,
+        UNUSED,
+        919,
+        UNUSED,
+        1284,
+        UNUSED,
+        UNUSED,
+        UNUSED,
+        UNUSED,
+        UNUSED,
+        UNUSED,
+        UNUSED,
+        UNUSED,
+        1546,
+        0,
+        1898,
+        UNUSED,
+        UNUSED,
+        UNUSED,
+        UNUSED,
+        84,
+        UNUSED,
+        UNUSED,
+        484,
+        894,
+        UNUSED,
+        1511,
+        UNUSED,
+        747,
+        -885,
+        -1564,
+        417,
+        -43,
+        855,
+        -1819,
+        UNUSED,
+        -570,
+        1314,
+        158,
+        UNUSED,
+        UNUSED,
+        UNUSED,
+        UNUSED,
+        1460,
+        UNUSED,
+        UNUSED,
+        UNUSED,
+        0,
+        UNUSED,
+        -452,
+        UNUSED,
+        0,
+        UNUSED,
+        1189,
+        1011,
+        UNUSED,
+        175,
+        UNUSED,
+        UNUSED,
+        396,
+        1419,
+        -369,
+        909,
+        116,
+        UNUSED,
+        1077,
+        UNUSED,
+        UNUSED,
+        1359,
+        869,
+        UNUSED,
+        949,
+        35,
+        627,
+        UNUSED,
+        UNUSED,
+        UNUSED,
+        300,
+        1039,
+        UNUSED,
+        1953,
+        -512,
+        UNUSED,
+        966,
+        456,
+        547,
+        UNUSED,
+        1407,
+        UNUSED,
+        UNUSED,
+        UNUSED,
+        UNUSED,
+        UNUSED,
+        UNUSED,
+        -506,
+        990,
+        UNUSED,
+        798,
+        1872,
+        UNUSED,
+        0,
+        0,
+        1057,
+        UNUSED,
+        1489,
+        UNUSED,
+        -1784,
+        -761,
+        UNUSED,
+        -507,
+        UNUSED,
+        UNUSED,
+        902,
+        739,
+        UNUSED,
+        UNUSED,
+        -290,
+        968,
+        1557,
+        1465,
+        UNUSED,
+        1616,
+        UNUSED,
+        1434,
+        334,
+        UNUSED,
+        -532,
+        UNUSED,
+        58,
+        UNUSED,
+        UNUSED,
+        351,
+        819,
+        594,
+        UNUSED,
+        386,
+        -2004,
+        504,
+        0,
+        UNUSED,
+        UNUSED,
+        126,
+        1037,
+        UNUSED,
+        159,
+        UNUSED,
+        UNUSED,
+        1356,
+        UNUSED,
+        UNUSED,
+        1078,
+        UNUSED,
+        506,
+        1095,
+        951,
+        UNUSED,
+        UNUSED,
+        0,
+        324,
+        1289,
+        843,
+        0,
+        UNUSED,
+        UNUSED,
+        573,
+        475,
+        UNUSED,
+        UNUSED,
+        UNUSED,
+        UNUSED,
+        UNUSED,
+        1010,
+        1124,
+        UNUSED,
+        UNUSED,
+        1487,
+        UNUSED,
+        UNUSED,
+        0,
+        UNUSED,
+        789,
+        1570,
+        -1182,
+        1187,
+        UNUSED,
+        1520,
+        21,
+        UNUSED,
+        620,
+        854,
+        UNUSED,
+        UNUSED,
+        -72,
+        1195,
+        0,
+        20,
+        UNUSED,
+        UNUSED,
+        UNUSED,
+        UNUSED,
+        1790,
+        4,
+        UNUSED,
+        -1272,
+        947,
+        UNUSED,
+        UNUSED,
+        UNUSED,
+        823,
+        0,
+        UNUSED,
+        UNUSED,
+        UNUSED,
+        1003,
+        118,
+        980,
+        564,
+        1252,
+        2285,
+        535,
+        UNUSED,
+        807,
+        UNUSED,
+        575,
+        1978,
+        UNUSED,
+        UNUSED,
+        490,
+        UNUSED,
+        UNUSED,
+        436,
+        1315,
+        UNUSED,
+        0,
+        701,
+        UNUSED,
+        UNUSED,
+        UNUSED,
+        413,
+        530,
+        1431,
+        -623,
+        2505,
+        UNUSED,
+        -273,
+        UNUSED,
+        UNUSED,
+        0,
+        UNUSED,
+        611,
+        UNUSED,
+        56,
+        UNUSED,
+        -73,
+        UNUSED,
+        0,
+        UNUSED,
+        UNUSED,
+        307,
+        UNUSED,
+        UNUSED,
+        173,
+        1334,
+        1295,
+        196,
+        -547,
+        -150,
+        UNUSED,
+        UNUSED,
+        UNUSED,
+        UNUSED,
+        -419,
+        743,
+        691,
+        480,
+        UNUSED,
+        1048,
+        UNUSED,
+        UNUSED,
+        262,
+        639,
+        881,
+        UNUSED,
+        UNUSED,
+        -158,
+        UNUSED,
+        991,
+        1507,
+        UNUSED,
+        -751,
+        UNUSED,
+        UNUSED,
+        UNUSED,
+        -566,
+        0,
+        -46,
+        UNUSED,
+        UNUSED,
+        959,
+        0,
+        896,
+        -574,
+        -95,
+        177,
+        1584,
+        UNUSED,
+        UNUSED,
+        540,
+        UNUSED,
+        -589,
+        672,
+        UNUSED,
+        467,
+        113,
+        UNUSED,
+        -460,
+        560,
+        UNUSED,
+        UNUSED,
+        UNUSED,
+        UNUSED,
+        1935,
+        1281,
+        382,
+        830,
+        774,
+        318,
+        1355,
+        1184,
+        UNUSED,
+        UNUSED,
+        565,
+        UNUSED,
+        1348,
+        208,
+        443,
+        UNUSED,
+        -517,
+        372,
+        UNUSED,
+        UNUSED,
+        48,
+        UNUSED,
+        UNUSED,
+        75,
+        UNUSED,
+        UNUSED,
+        240,
+        0,
+        -220,
+        UNUSED,
+        UNUSED,
+        -170,
+        UNUSED,
+        UNUSED,
+        19,
+        UNUSED,
+        UNUSED,
+        UNUSED,
+        UNUSED,
+        884,
+        1217,
+        -93,
+        UNUSED,
+        UNUSED,
+        UNUSED,
+        1395,
+        528,
+        296,
+        929,
+        UNUSED,
+        UNUSED,
+        7,
+        335,
+        UNUSED,
+        1146,
+        1161,
+        1394,
+        UNUSED,
+        UNUSED,
+        UNUSED,
+        1212,
+        7,
+        1600,
+        1119,
+        UNUSED,
+        UNUSED,
+        UNUSED,
+        UNUSED,
+        -105,
+        1547,
+        0,
+        UNUSED,
+        875,
+        UNUSED,
+        -103,
+        138,
+        UNUSED,
+        UNUSED,
+        1426,
+        1208,
+        0,
+        UNUSED,
+        -379,
+        379,
+        53,
+        1327,
+        UNUSED,
+        UNUSED,
+        211,
+        UNUSED,
+        UNUSED,
+        -136,
+        851,
+        UNUSED,
+        1706,
+        1235,
+        99,
+        UNUSED,
+        UNUSED,
+        812,
+        UNUSED,
+        UNUSED,
+        848,
+        UNUSED,
+        1596,
+        202,
+        UNUSED,
+        UNUSED,
+        -122,
+        622,
+        1628,
+        -688,
+        391,
+        540,
+        1008,
+        352,
+        UNUSED,
+        571,
+        UNUSED,
+        -237,
+        1098,
+        UNUSED,
+        825,
+        UNUSED,
+        -2097,
+        1023,
+        UNUSED,
+        836,
+        -292,
+        UNUSED,
+        UNUSED,
+        47,
+        -233,
+        UNUSED,
+        1470,
+        391,
+        UNUSED,
+        UNUSED,
+        UNUSED,
+        517,
+        UNUSED,
+        UNUSED,
+        UNUSED,
+        905,
+        UNUSED,
+        269,
+        UNUSED,
+        1157,
+        473,
+        -701,
+        UNUSED,
+        UNUSED,
+        707,
+        UNUSED,
+        UNUSED,
+        750,
+        UNUSED,
+        UNUSED,
+        UNUSED,
+        UNUSED,
+        401,
+        UNUSED,
+        UNUSED,
+        -805,
+        1009,
+        0,
+        1094,
+        507,
+        741,
+        UNUSED,
+        1614,
+        UNUSED,
+        476,
+        891,
+        1241,
+        969,
+        -56,
+        UNUSED,
+        -341,
+        UNUSED,
+        285,
+        944,
+        1557,
+        UNUSED,
+        -410,
+        UNUSED,
+        -907,
+        UNUSED,
+        -241,
+        UNUSED,
+        UNUSED,
+        UNUSED,
+        1815,
+        UNUSED,
+        1481,
+        762,
+        978,
+        222,
+        UNUSED,
+        -958,
+        UNUSED,
+        UNUSED,
+        834,
+        1429,
+        UNUSED,
+        568,
+        UNUSED,
+        993,
+        UNUSED,
+        299,
+        UNUSED,
+        UNUSED,
+        UNUSED,
+        UNUSED,
+        UNUSED,
+        700,
+        UNUSED,
+        1290,
+        -733,
+        UNUSED,
+        0,
+        746,
+        801,
+        UNUSED,
+        721,
+        UNUSED,
+        1654,
+        UNUSED,
+        990,
+        UNUSED,
+        UNUSED,
+        UNUSED,
+        1126,
+        -631,
+        UNUSED,
+        -1843,
+        1456,
+        -468,
+        UNUSED,
+        937,
+        UNUSED,
+        -328,
+        UNUSED,
+        -107,
+        UNUSED,
+        1627,
+        1460,
+        UNUSED,
+        UNUSED,
+        0,
+        UNUSED,
+        290,
+        675,
+        1210,
+        UNUSED,
+        UNUSED,
+        1184,
+        UNUSED,
+        340,
+        UNUSED,
+        1279,
+        947,
+        1255,
+        UNUSED,
+        -105,
+        636,
+        UNUSED,
+        1610,
+        418,
+        40,
+        346,
+        619,
+        1736,
+        750,
+        UNUSED,
+        -853,
+        UNUSED,
+        120,
+        -171,
+        UNUSED,
+        2,
+        10,
+        UNUSED,
+        UNUSED,
+        -372,
+        1855,
+        -879,
+        51,
+        UNUSED,
+        UNUSED,
+        1405,
+        UNUSED,
+        UNUSED,
+        -594,
+        UNUSED,
+        828,
+        UNUSED,
+        855,
+        UNUSED,
+        1165,
+        1530,
+        331,
+        43,
+        1299,
+        336,
+        108,
+        -62,
+        1497,
+        UNUSED,
+        UNUSED,
+        141,
+        46,
+        UNUSED,
+        UNUSED,
+        UNUSED,
+        UNUSED,
+        -364,
+        275,
+        UNUSED,
+        1139,
+        -45,
+        UNUSED,
+        UNUSED,
+        UNUSED,
+        75,
+        -749,
+        886,
+        UNUSED,
+        338,
+        22,
+        -70,
+        217,
+        UNUSED,
+        951,
+        UNUSED,
+        UNUSED,
+        95,
+        -160,
+        UNUSED,
+        UNUSED,
+        UNUSED,
+        UNUSED,
+        UNUSED,
+        648,
+        1162,
+        UNUSED,
+        UNUSED,
+        UNUSED,
+        841,
+        UNUSED,
+        UNUSED,
+        -1711,
+        767,
+        UNUSED,
+        UNUSED,
+        822,
+        -833,
+        UNUSED,
+        536,
+        UNUSED,
+        63,
+        1287,
+        534,
+        1538,
+        -1130,
+        UNUSED,
+        UNUSED,
+    };
+    static const int16_t hash2[2048] = {
+        0,
+        0,
+        UNUSED,
+        UNUSED,
+        UNUSED,
+        0,
+        0,
+        UNUSED,
+        UNUSED,
+        0,
+        UNUSED,
+        UNUSED,
+        UNUSED,
+        0,
+        UNUSED,
+        UNUSED,
+        UNUSED,
+        UNUSED,
+        UNUSED,
+        UNUSED,
+        UNUSED,
+        UNUSED,
+        0,
+        UNUSED,
+        UNUSED,
+        UNUSED,
+        UNUSED,
+        UNUSED,
+        0,
+        0,
+        0,
+        0,
+        UNUSED,
+        0,
+        0,
+        UNUSED,
+        0,
+        UNUSED,
+        670,
+        UNUSED,
+        0,
+        UNUSED,
+        0,
+        UNUSED,
+        UNUSED,
+        298,
+        0,
+        UNUSED,
+        UNUSED,
+        3412,
+        UNUSED,
+        UNUSED,
+        UNUSED,
+        UNUSED,
+        UNUSED,
+        0,
+        0,
+        UNUSED,
+        0,
+        UNUSED,
+        UNUSED,
+        0,
+        0,
+        0,
+        0,
+        UNUSED,
+        UNUSED,
+        54,
+        UNUSED,
+        0,
+        0,
+        0,
+        0,
+        UNUSED,
+        0,
+        UNUSED,
+        UNUSED,
+        0,
+        -892,
+        645,
+        0,
+        UNUSED,
+        0,
+        3358,
+        UNUSED,
+        UNUSED,
+        UNUSED,
+        UNUSED,
+        UNUSED,
+        0,
+        UNUSED,
+        UNUSED,
+        581,
+        0,
+        UNUSED,
+        0,
+        0,
+        0,
+        0,
+        UNUSED,
+        UNUSED,
+        UNUSED,
+        UNUSED,
+        UNUSED,
+        0,
+        UNUSED,
+        0,
+        0,
+        UNUSED,
+        -541,
+        0,
+        -66,
+        1170,
+        UNUSED,
+        0,
+        0,
+        1051,
+        0,
+        UNUSED,
+        UNUSED,
+        -1251,
+        0,
+        705,
+        UNUSED,
+        UNUSED,
+        UNUSED,
+        UNUSED,
+        78,
+        0,
+        0,
+        UNUSED,
+        UNUSED,
+        0,
+        0,
+        0,
+        UNUSED,
+        UNUSED,
+        UNUSED,
+        2589,
+        UNUSED,
+        UNUSED,
+        0,
+        223,
+        1556,
+        0,
+        691,
+        UNUSED,
+        944,
+        0,
+        UNUSED,
+        -818,
+        UNUSED,
+        UNUSED,
+        UNUSED,
+        -734,
+        0,
+        UNUSED,
+        0,
+        UNUSED,
+        UNUSED,
+        -1208,
+        2107,
+        UNUSED,
+        0,
+        0,
+        UNUSED,
+        UNUSED,
+        UNUSED,
+        1414,
+        UNUSED,
+        UNUSED,
+        171,
+        UNUSED,
+        0,
+        1490,
+        UNUSED,
+        0,
+        UNUSED,
+        UNUSED,
+        UNUSED,
+        0,
+        UNUSED,
+        UNUSED,
+        0,
+        0,
+        UNUSED,
+        UNUSED,
+        0,
+        0,
+        911,
+        UNUSED,
+        0,
+        1160,
+        UNUSED,
+        UNUSED,
+        0,
+        313,
+        UNUSED,
+        UNUSED,
+        UNUSED,
+        UNUSED,
+        0,
+        -543,
+        0,
+        0,
+        UNUSED,
+        UNUSED,
+        UNUSED,
+        0,
+        722,
+        430,
+        1204,
+        UNUSED,
+        0,
+        1522,
+        UNUSED,
+        1112,
+        UNUSED,
+        1027,
+        0,
+        0,
+        0,
+        2065,
+        UNUSED,
+        0,
+        UNUSED,
+        0,
+        UNUSED,
+        -176,
+        1446,
+        395,
+        UNUSED,
+        2380,
+        UNUSED,
+        258,
+        UNUSED,
+        UNUSED,
+        UNUSED,
+        UNUSED,
+        2127,
+        UNUSED,
+        UNUSED,
+        0,
+        0,
+        0,
+        UNUSED,
+        0,
+        UNUSED,
+        2776,
+        0,
+        0,
+        0,
+        0,
+        UNUSED,
+        0,
+        0,
+        UNUSED,
+        0,
+        0,
+        646,
+        0,
+        UNUSED,
+        UNUSED,
+        UNUSED,
+        0,
+        UNUSED,
+        2530,
+        449,
+        3314,
+        UNUSED,
+        UNUSED,
+        UNUSED,
+        UNUSED,
+        0,
+        UNUSED,
+        -787,
+        UNUSED,
+        UNUSED,
+        0,
+        UNUSED,
+        0,
+        0,
+        1280,
+        UNUSED,
+        UNUSED,
+        UNUSED,
+        0,
+        1408,
+        UNUSED,
+        -599,
+        1450,
+        UNUSED,
+        UNUSED,
+        143,
+        UNUSED,
+        0,
+        1342,
+        1171,
+        UNUSED,
+        0,
+        UNUSED,
+        UNUSED,
+        UNUSED,
+        0,
+        684,
+        0,
+        0,
+        UNUSED,
+        1904,
+        UNUSED,
+        UNUSED,
+        UNUSED,
+        -987,
+        UNUSED,
+        986,
+        UNUSED,
+        0,
+        -1153,
+        UNUSED,
+        -387,
+        0,
+        UNUSED,
+        UNUSED,
+        UNUSED,
+        UNUSED,
+        UNUSED,
+        129,
+        UNUSED,
+        875,
+        UNUSED,
+        2400,
+        UNUSED,
+        UNUSED,
+        UNUSED,
+        UNUSED,
+        UNUSED,
+        0,
+        UNUSED,
+        -562,
+        0,
+        989,
+        -231,
+        UNUSED,
+        UNUSED,
+        1668,
+        UNUSED,
+        UNUSED,
+        0,
+        UNUSED,
+        972,
+        UNUSED,
+        UNUSED,
+        -704,
+        0,
+        334,
+        383,
+        86,
+        0,
+        UNUSED,
+        0,
+        UNUSED,
+        0,
+        UNUSED,
+        UNUSED,
+        UNUSED,
+        1043,
+        0,
+        0,
+        2473,
+        UNUSED,
+        2427,
+        0,
+        UNUSED,
+        0,
+        377,
+        1382,
+        UNUSED,
+        0,
+        UNUSED,
+        UNUSED,
+        0,
+        UNUSED,
+        UNUSED,
+        UNUSED,
+        311,
+        UNUSED,
+        UNUSED,
+        365,
+        UNUSED,
+        -148,
+        0,
+        0,
+        UNUSED,
+        1083,
+        -602,
+        951,
+        182,
+        UNUSED,
+        0,
+        0,
+        3071,
+        UNUSED,
+        1133,
+        UNUSED,
+        UNUSED,
+        1250,
+        0,
+        UNUSED,
+        0,
+        0,
+        2267,
+        UNUSED,
+        0,
+        UNUSED,
+        UNUSED,
+        0,
+        UNUSED,
+        658,
+        1645,
+        0,
+        UNUSED,
+        389,
+        38,
+        UNUSED,
+        0,
+        -506,
+        UNUSED,
+        UNUSED,
+        362,
+        UNUSED,
+        0,
+        1471,
+        UNUSED,
+        UNUSED,
+        UNUSED,
+        UNUSED,
+        UNUSED,
+        217,
+        2272,
+        UNUSED,
+        0,
+        UNUSED,
+        0,
+        1673,
+        0,
+        2193,
+        0,
+        -669,
+        240,
+        UNUSED,
+        UNUSED,
+        UNUSED,
+        0,
+        UNUSED,
+        UNUSED,
+        0,
+        1669,
+        234,
+        UNUSED,
+        UNUSED,
+        UNUSED,
+        429,
+        UNUSED,
+        UNUSED,
+        UNUSED,
+        0,
+        0,
+        UNUSED,
+        UNUSED,
+        0,
+        UNUSED,
+        3172,
+        UNUSED,
+        0,
+        0,
+        0,
+        1576,
+        2057,
+        0,
+        1124,
+        UNUSED,
+        -195,
+        0,
+        0,
+        UNUSED,
+        0,
+        642,
+        0,
+        UNUSED,
+        UNUSED,
+        1374,
+        794,
+        0,
+        0,
+        UNUSED,
+        -169,
+        2517,
+        1935,
+        UNUSED,
+        933,
+        -172,
+        -122,
+        0,
+        UNUSED,
+        470,
+        481,
+        0,
+        1652,
+        UNUSED,
+        658,
+        UNUSED,
+        UNUSED,
+        UNUSED,
+        0,
+        UNUSED,
+        UNUSED,
+        UNUSED,
+        UNUSED,
+        UNUSED,
+        UNUSED,
+        UNUSED,
+        966,
+        164,
+        UNUSED,
+        0,
+        47,
+        224,
+        UNUSED,
+        -17,
+        -313,
+        UNUSED,
+        0,
+        0,
+        UNUSED,
+        UNUSED,
+        0,
+        0,
+        UNUSED,
+        -969,
+        UNUSED,
+        2995,
+        0,
+        UNUSED,
+        0,
+        644,
+        0,
+        0,
+        UNUSED,
+        -111,
+        1315,
+        UNUSED,
+        UNUSED,
+        472,
+        UNUSED,
+        0,
+        UNUSED,
+        UNUSED,
+        UNUSED,
+        UNUSED,
+        0,
+        UNUSED,
+        926,
+        0,
+        UNUSED,
+        UNUSED,
+        UNUSED,
+        0,
+        0,
+        UNUSED,
+        0,
+        UNUSED,
+        756,
+        UNUSED,
+        0,
+        896,
+        UNUSED,
+        UNUSED,
+        867,
+        UNUSED,
+        -963,
+        320,
+        -447,
+        -528,
+        UNUSED,
+        0,
+        -317,
+        62,
+        0,
+        UNUSED,
+        1173,
+        831,
+        UNUSED,
+        UNUSED,
+        0,
+        UNUSED,
+        UNUSED,
+        790,
+        UNUSED,
+        1136,
+        -1549,
+        -309,
+        UNUSED,
+        0,
+        UNUSED,
+        0,
+        UNUSED,
+        1566,
+        1621,
+        0,
+        UNUSED,
+        0,
+        -180,
+        UNUSED,
+        UNUSED,
+        UNUSED,
+        UNUSED,
+        UNUSED,
+        0,
+        UNUSED,
+        1452,
+        0,
+        UNUSED,
+        0,
+        UNUSED,
+        0,
+        UNUSED,
+        845,
+        404,
+        0,
+        UNUSED,
+        UNUSED,
+        UNUSED,
+        UNUSED,
+        UNUSED,
+        UNUSED,
+        126,
+        UNUSED,
+        UNUSED,
+        1551,
+        0,
+        1271,
+        UNUSED,
+        UNUSED,
+        UNUSED,
+        UNUSED,
+        1381,
+        1685,
+        UNUSED,
+        832,
+        676,
+        0,
+        UNUSED,
+        1058,
+        1028,
+        UNUSED,
+        163,
+        UNUSED,
+        618,
+        914,
+        UNUSED,
+        UNUSED,
+        UNUSED,
+        1565,
+        553,
+        UNUSED,
+        0,
+        UNUSED,
+        UNUSED,
+        -948,
+        1353,
+        UNUSED,
+        245,
+        0,
+        UNUSED,
+        UNUSED,
+        1451,
+        0,
+        1246,
+        UNUSED,
+        UNUSED,
+        635,
+        UNUSED,
+        UNUSED,
+        UNUSED,
+        403,
+        -485,
+        -311,
+        -1178,
+        UNUSED,
+        UNUSED,
+        0,
+        -835,
+        1316,
+        0,
+        649,
+        UNUSED,
+        941,
+        1175,
+        UNUSED,
+        177,
+        1307,
+        51,
+        UNUSED,
+        -275,
+        UNUSED,
+        0,
+        0,
+        108,
+        UNUSED,
+        1505,
+        -988,
+        UNUSED,
+        -734,
+        UNUSED,
+        23,
+        UNUSED,
+        UNUSED,
+        UNUSED,
+        0,
+        0,
+        796,
+        0,
+        UNUSED,
+        503,
+        UNUSED,
+        UNUSED,
+        UNUSED,
+        1305,
+        -209,
+        -14,
+        UNUSED,
+        UNUSED,
+        733,
+        UNUSED,
+        74,
+        UNUSED,
+        -509,
+        UNUSED,
+        UNUSED,
+        1104,
+        891,
+        0,
+        UNUSED,
+        UNUSED,
+        0,
+        0,
+        1207,
+        -51,
+        1101,
+        0,
+        37,
+        UNUSED,
+        UNUSED,
+        UNUSED,
+        1328,
+        0,
+        1052,
+        225,
+        UNUSED,
+        UNUSED,
+        UNUSED,
+        UNUSED,
+        552,
+        793,
+        189,
+        455,
+        UNUSED,
+        -1284,
+        310,
+        90,
+        564,
+        UNUSED,
+        UNUSED,
+        UNUSED,
+        0,
+        450,
+        UNUSED,
+        UNUSED,
+        160,
+        UNUSED,
+        355,
+        0,
+        UNUSED,
+        699,
+        0,
+        1663,
+        1132,
+        479,
+        UNUSED,
+        UNUSED,
+        0,
+        0,
+        UNUSED,
+        UNUSED,
+        592,
+        UNUSED,
+        0,
+        550,
+        UNUSED,
+        0,
+        UNUSED,
+        64,
+        UNUSED,
+        UNUSED,
+        940,
+        0,
+        1554,
+        0,
+        1108,
+        10,
+        UNUSED,
+        UNUSED,
+        471,
+        UNUSED,
+        UNUSED,
+        UNUSED,
+        UNUSED,
+        208,
+        416,
+        1453,
+        1739,
+        631,
+        237,
+        -105,
+        0,
+        UNUSED,
+        UNUSED,
+        0,
+        385,
+        UNUSED,
+        0,
+        0,
+        UNUSED,
+        536,
+        -866,
+        10,
+        UNUSED,
+        UNUSED,
+        0,
+        143,
+        0,
+        293,
+        273,
+        UNUSED,
+        UNUSED,
+        666,
+        345,
+        UNUSED,
+        0,
+        -305,
+        UNUSED,
+        262,
+        0,
+        -559,
+        0,
+        UNUSED,
+        UNUSED,
+        UNUSED,
+        UNUSED,
+        UNUSED,
+        UNUSED,
+        936,
+        UNUSED,
+        UNUSED,
+        484,
+        UNUSED,
+        UNUSED,
+        523,
+        UNUSED,
+        UNUSED,
+        0,
+        UNUSED,
+        505,
+        1336,
+        UNUSED,
+        UNUSED,
+        0,
+        724,
+        UNUSED,
+        78,
+        UNUSED,
+        939,
+        0,
+        0,
+        599,
+        -37,
+        UNUSED,
+        1479,
+        -15,
+        0,
+        798,
+        UNUSED,
+        UNUSED,
+        469,
+        114,
+        484,
+        UNUSED,
+        0,
+        UNUSED,
+        -338,
+        0,
+        UNUSED,
+        -567,
+        UNUSED,
+        464,
+        UNUSED,
+        UNUSED,
+        -588,
+        220,
+        766,
+        UNUSED,
+        0,
+        0,
+        0,
+        0,
+        UNUSED,
+        UNUSED,
+        UNUSED,
+        UNUSED,
+        UNUSED,
+        UNUSED,
+        1562,
+        UNUSED,
+        UNUSED,
+        134,
+        UNUSED,
+        -311,
+        480,
+        0,
+        -538,
+        UNUSED,
+        485,
+        1146,
+        UNUSED,
+        390,
+        715,
+        0,
+        UNUSED,
+        UNUSED,
+        UNUSED,
+        UNUSED,
+        58,
+        UNUSED,
+        1005,
+        1148,
+        1461,
+        132,
+        52,
+        1900,
+        784,
+        UNUSED,
+        UNUSED,
+        1437,
+        UNUSED,
+        0,
+        533,
+        UNUSED,
+        UNUSED,
+        694,
+        UNUSED,
+        UNUSED,
+        0,
+        UNUSED,
+        1203,
+        UNUSED,
+        1594,
+        UNUSED,
+        UNUSED,
+        573,
+        0,
+        629,
+        UNUSED,
+        293,
+        0,
+        128,
+        0,
+        278,
+        UNUSED,
+        1698,
+        0,
+        988,
+        1936,
+        UNUSED,
+        UNUSED,
+        427,
+        UNUSED,
+        UNUSED,
+        UNUSED,
+        1313,
+        UNUSED,
+        0,
+        UNUSED,
+        UNUSED,
+        39,
+        UNUSED,
+        1189,
+        301,
+        0,
+        1173,
+        1477,
+        -687,
+        UNUSED,
+        UNUSED,
+        UNUSED,
+        -717,
+        476,
+        -86,
+        -131,
+        UNUSED,
+        0,
+        0,
+        UNUSED,
+        -569,
+        358,
+        -1150,
+        UNUSED,
+        UNUSED,
+        UNUSED,
+        689,
+        1454,
+        UNUSED,
+        UNUSED,
+        -481,
+        1615,
+        UNUSED,
+        1544,
+        UNUSED,
+        0,
+        UNUSED,
+        477,
+        1604,
+        0,
+        UNUSED,
+        674,
+        UNUSED,
+        94,
+        UNUSED,
+        1649,
+        UNUSED,
+        UNUSED,
+        UNUSED,
+        848,
+        UNUSED,
+        1329,
+        UNUSED,
+        UNUSED,
+        UNUSED,
+        1370,
+        UNUSED,
+        770,
+        1468,
+        UNUSED,
+        586,
+        UNUSED,
+        -140,
+        1072,
+        0,
+        UNUSED,
+        768,
+        -102,
+        231,
+        1440,
+        428,
+        -294,
+        UNUSED,
+        970,
+        1125,
+        763,
+        565,
+        1065,
+        -1325,
+        UNUSED,
+        697,
+        1143,
+        1622,
+        UNUSED,
+        1425,
+        398,
+        UNUSED,
+        329,
+        2441,
+        1049,
+        1240,
+        1640,
+        UNUSED,
+        731,
+        UNUSED,
+        1666,
+        0,
+        UNUSED,
+        UNUSED,
+        0,
+        UNUSED,
+        253,
+        1022,
+        UNUSED,
+        1468,
+        0,
+        UNUSED,
+        1416,
+        -188,
+        1486,
+        862,
+        1802,
+        UNUSED,
+        1606,
+        UNUSED,
+        UNUSED,
+        700,
+        0,
+        UNUSED,
+        UNUSED,
+        -69,
+        UNUSED,
+        UNUSED,
+        UNUSED,
+        2834,
+        587,
+        736,
+        0,
+        UNUSED,
+        UNUSED,
+        -802,
+        18,
+        UNUSED,
+        860,
+        UNUSED,
+        UNUSED,
+        940,
+        -892,
+        -307,
+        UNUSED,
+        -180,
+        167,
+        UNUSED,
+        UNUSED,
+        UNUSED,
+        UNUSED,
+        1438,
+        UNUSED,
+        572,
+        UNUSED,
+        1428,
+        UNUSED,
+        UNUSED,
+        -108,
+        1149,
+        -466,
+        UNUSED,
+        UNUSED,
+        486,
+        UNUSED,
+        663,
+        1653,
+        UNUSED,
+        1257,
+        -907,
+        UNUSED,
+        UNUSED,
+        UNUSED,
+        -1181,
+        955,
+        405,
+        179,
+        0,
+        1345,
+        UNUSED,
+        181,
+        0,
+        1504,
+        UNUSED,
+        -347,
+        2371,
+        UNUSED,
+        232,
+        1053,
+        107,
+        495,
+        1486,
+        0,
+        UNUSED,
+        UNUSED,
+        747,
+        UNUSED,
+        UNUSED,
+        UNUSED,
+        49,
+        0,
+        1340,
+        UNUSED,
+        1330,
+        UNUSED,
+        1109,
+        -1229,
+        UNUSED,
+        984,
+        UNUSED,
+        1656,
+        -520,
+        791,
+        1162,
+        UNUSED,
+        489,
+        0,
+        UNUSED,
+        UNUSED,
+        UNUSED,
+        834,
+        UNUSED,
+        265,
+        1437,
+        565,
+        -1096,
+        914,
+        -682,
+        1499,
+        UNUSED,
+        UNUSED,
+        -441,
+        -12,
+        UNUSED,
+        712,
+        954,
+        1357,
+        -1491,
+        1039,
+        0,
+        UNUSED,
+        UNUSED,
+        1053,
+        689,
+        UNUSED,
+        UNUSED,
+        UNUSED,
+        1591,
+        UNUSED,
+        983,
+        UNUSED,
+        405,
+        UNUSED,
+        UNUSED,
+        994,
+        57,
+        1688,
+        1377,
+        1488,
+        1635,
+        UNUSED,
+        UNUSED,
+        UNUSED,
+        UNUSED,
+        UNUSED,
+        UNUSED,
+        59,
+        15,
+        UNUSED,
+        567,
+        739,
+        1397,
+        -78,
+        1109,
+        1439,
+        0,
+        UNUSED,
+        348,
+        1535,
+        390,
+        UNUSED,
+        UNUSED,
+        404,
+        UNUSED,
+        1461,
+        365,
+        UNUSED,
+        1621,
+        UNUSED,
+        206,
+        1532,
+        0,
+        0,
+        UNUSED,
+        24,
+        UNUSED,
+        219,
+        1181,
+        UNUSED,
+        412,
+        1154,
+        UNUSED,
+        870,
+        UNUSED,
+        280,
+        -1419,
+        UNUSED,
+        UNUSED,
+        163,
+        UNUSED,
+        UNUSED,
+        0,
+        1524,
+        UNUSED,
+        1536,
+        1341,
+        1292,
+        448,
+        584,
+        UNUSED,
+        1025,
+        UNUSED,
+        UNUSED,
+        UNUSED,
+        401,
+        UNUSED,
+        UNUSED,
+        UNUSED,
+        230,
+        UNUSED,
+        873,
+        -458,
+        1001,
+        UNUSED,
+        897,
+        1435,
+        79,
+        521,
+        1023,
+        393,
+        UNUSED,
+        UNUSED,
+        0,
+        UNUSED,
+        0,
+        1163,
+        UNUSED,
+        2267,
+        -851,
+        1870,
+        1638,
+        UNUSED,
+        1475,
+        694,
+        1617,
+        344,
+        UNUSED,
+        UNUSED,
+        UNUSED,
+        1257,
+        UNUSED,
+        0,
+        UNUSED,
+        UNUSED,
+        0,
+        UNUSED,
+        25,
+        0,
+        UNUSED,
+        223,
+        UNUSED,
+        366,
+        UNUSED,
+        252,
+        436,
+        UNUSED,
+        72,
+        UNUSED,
+        869,
+        -682,
+        UNUSED,
+        0,
+        1541,
+        1019,
+        1153,
+        1478,
+        UNUSED,
+        1601,
+        374,
+        27,
+        1629,
+        493,
+        192,
+        1094,
+        1196,
+        0,
+        1463,
+        1647,
+        UNUSED,
+        UNUSED,
+        UNUSED,
+        0,
+        1178,
+        UNUSED,
+        155,
+        UNUSED,
+        1041,
+        UNUSED,
+        UNUSED,
+        462,
+        1250,
+        UNUSED,
+        -177,
+        UNUSED,
+        UNUSED,
+        0,
+        UNUSED,
+        1200,
+        UNUSED,
+        UNUSED,
+        229,
+        268,
+        UNUSED,
+        UNUSED,
+        1034,
+        2167,
+        -23,
+        1067,
+        0,
+        UNUSED,
+        UNUSED,
+        1590,
+        326,
+        1420,
+        UNUSED,
+        UNUSED,
+        -1182,
+        UNUSED,
+        1073,
+        UNUSED,
+        UNUSED,
+        888,
+        -1419,
+        877,
+        1275,
+        849,
+        765,
+        UNUSED,
+        UNUSED,
+        UNUSED,
+        UNUSED,
+        1015,
+        UNUSED,
+        UNUSED,
+        UNUSED,
+        1253,
+        UNUSED,
+        UNUSED,
+        445,
+        UNUSED,
+        1174,
+        UNUSED,
+        UNUSED,
+        UNUSED,
+        1311,
+        -820,
+        UNUSED,
+        -137,
+        1464,
+        UNUSED,
+        0,
+        8,
+        UNUSED,
+        69,
+        -813,
+        UNUSED,
+        282,
+        UNUSED,
+        931,
+        46,
+        UNUSED,
+        548,
+        -688,
+        UNUSED,
+        UNUSED,
+        UNUSED,
+        UNUSED,
+        UNUSED,
+        UNUSED,
+        UNUSED,
+        419,
+        UNUSED,
+        UNUSED,
+        UNUSED,
+        UNUSED,
+        UNUSED,
+        UNUSED,
+        1180,
+        UNUSED,
+        109,
+        UNUSED,
+        0,
+        UNUSED,
+        UNUSED,
+        UNUSED,
+        UNUSED,
+        0,
+        UNUSED,
+        UNUSED,
+        161,
+        403,
+        UNUSED,
+        1540,
+        UNUSED,
+        407,
+        UNUSED,
+        UNUSED,
+        23,
+        1478,
+        1436,
+        89,
+        -421,
+        0,
+        UNUSED,
+        UNUSED,
+        UNUSED,
+        2041,
+        UNUSED,
+        UNUSED,
+        0,
+        UNUSED,
+        UNUSED,
+        -132,
+        -1677,
+        -653,
+        1079,
+        UNUSED,
+        182,
+        1691,
+        UNUSED,
+        483,
+        1303,
+        623,
+        UNUSED,
+        913,
+        447,
+        UNUSED,
+        UNUSED,
+        UNUSED,
+        UNUSED,
+        1474,
+        UNUSED,
+        UNUSED,
+        UNUSED,
+        UNUSED,
+        661,
+        293,
+        0,
+        555,
+        0,
+        1533,
+        2333,
+        UNUSED,
+        UNUSED,
+        298,
+        0,
+        2332,
+        UNUSED,
+        UNUSED,
+        -1049,
+        UNUSED,
+        UNUSED,
+        837,
+        UNUSED,
+        837,
+        617,
+        UNUSED,
+        UNUSED,
+        UNUSED,
+        UNUSED,
+        UNUSED,
+        205,
+        UNUSED,
+        0,
+        233,
+        1168,
+        UNUSED,
+        57,
+        448,
+        -40,
+        UNUSED,
+        UNUSED,
+        805,
+        UNUSED,
+        1215,
+        338,
+        UNUSED,
+        UNUSED,
+        UNUSED,
+        UNUSED,
+        UNUSED,
+        1423,
+        840,
+        573,
+        1002,
+        UNUSED,
+        930,
+        901,
+        67,
+        726,
+        720,
+        -191,
+        260,
+        1457,
+        1211,
+        79,
+        239,
+        UNUSED,
+        UNUSED,
+        723,
+        1033,
+        971,
+        871,
+        649,
+        481,
+        UNUSED,
+        UNUSED,
+        1142,
+        0,
+        UNUSED,
+        UNUSED,
+        0,
+        -600,
+        UNUSED,
+        116,
+        UNUSED,
+        UNUSED,
+        UNUSED,
+        13,
+        122,
+        1127,
+        UNUSED,
+        UNUSED,
+        UNUSED,
+        UNUSED,
+        137,
+        0,
+        UNUSED,
+        UNUSED,
+        UNUSED,
+        251,
+        UNUSED,
+        UNUSED,
+        UNUSED,
+        94,
+        1400,
+        UNUSED,
+        UNUSED,
+        UNUSED,
+        1815,
+        UNUSED,
+        1257,
+        UNUSED,
+        1368,
+        710,
+        1578,
+        879,
+        1376,
+        UNUSED,
+        UNUSED,
+        UNUSED,
+        UNUSED,
+        UNUSED,
+        406,
+        777,
+        146,
+        -1043,
+        147,
+        UNUSED,
+        UNUSED,
+        UNUSED,
+        UNUSED,
+        2132,
+        303,
+        39,
+        1342,
+        0,
+        UNUSED,
+        1451,
+        UNUSED,
+        UNUSED,
+        2283,
+        UNUSED,
+        -771,
+        -690,
+        -813,
+        1083,
+        UNUSED,
+        UNUSED,
+        796,
+        1369,
+        UNUSED,
+        676,
+        UNUSED,
+        1026,
+        380,
+        UNUSED,
+        UNUSED,
+        827,
+        UNUSED,
+        461,
+        288,
+        UNUSED,
+        UNUSED,
+        UNUSED,
+        213,
+        277,
+        1511,
+        1390,
+        579,
+        UNUSED,
+        -336,
+        1587,
+        UNUSED,
+        UNUSED,
+        1626,
+        UNUSED,
+        1254,
+        UNUSED,
+        UNUSED,
+        81,
+        UNUSED,
+        UNUSED,
+        UNUSED,
+        479,
+        UNUSED,
+        516,
+        637,
+        UNUSED,
+        1763,
+        UNUSED,
+        3026,
+        780,
+        UNUSED,
+        UNUSED,
+        UNUSED,
+        821,
+        1021,
+        778,
+        139,
+        1300,
+        UNUSED,
+        747,
+        UNUSED,
+        183,
+        396,
+        UNUSED,
+        UNUSED,
+        UNUSED,
+        322,
+        356,
+        699,
+        195,
+        1570,
+        UNUSED,
+        UNUSED,
+        614,
+        UNUSED,
+        UNUSED,
+        UNUSED,
+        711,
+        735,
+        0,
+        1482,
+        UNUSED,
+        395,
+        297,
+        1036,
+        1364,
+        UNUSED,
+        -254,
+        677,
+        1087,
+        1145,
+        880,
+        963,
+        UNUSED,
+        1657,
+        0,
+        672,
+        UNUSED,
+        -851,
+        0,
+        689,
+        1288,
+        UNUSED,
+        UNUSED,
+        286,
+        UNUSED,
+        UNUSED,
+        UNUSED,
+        1424,
+        UNUSED,
+        158,
+        UNUSED,
+        1924,
+        685,
+        UNUSED,
+        1035,
+        UNUSED,
+        -25,
+        3181,
+        533,
+        UNUSED,
+        -227,
+        1494,
+        139,
+        437,
+        -300,
+        UNUSED,
+        413,
+        UNUSED,
+        -212,
+        -510,
+        221,
+        1661,
+        1499,
+        -1188,
+        UNUSED,
+        0,
+        1493,
+        1672,
+        UNUSED,
+        UNUSED,
+        UNUSED,
+        UNUSED,
+        UNUSED,
+        UNUSED,
+        UNUSED,
+        UNUSED,
+        UNUSED,
+        -95,
+        UNUSED,
+        UNUSED,
+        4,
+        499,
+        UNUSED,
+        UNUSED,
+        0,
+        1579,
+        190,
+        UNUSED,
+        UNUSED,
+        533,
+        UNUSED,
+        590,
+        -929,
+        130,
+        484,
+        871,
+        UNUSED,
+        1523,
+        UNUSED,
+        UNUSED,
+        -712,
+        UNUSED,
+        1585,
+        UNUSED,
+        UNUSED,
+        -871,
+        UNUSED,
+        UNUSED,
+        UNUSED,
+        891,
+        -815,
+        UNUSED,
+        -628,
+        1076,
+        UNUSED,
+        326,
+        742,
+        UNUSED,
+        585,
+        UNUSED,
+        775,
+        650,
+        119,
+        UNUSED,
+        -373,
+        UNUSED,
+        UNUSED,
+        1036,
+        UNUSED,
+        UNUSED,
+        UNUSED,
+        UNUSED,
+        42,
+        UNUSED,
+        UNUSED,
+        829,
+        UNUSED,
+        234,
+        UNUSED,
+        UNUSED,
+        UNUSED,
+        545,
+        UNUSED,
+        -667,
+        UNUSED,
+        287,
+        2916,
+        UNUSED,
+        92,
+        1422,
+        -875,
+        -1177,
+        UNUSED,
+        UNUSED,
+        UNUSED,
+        1080,
+        675,
+        UNUSED,
+        -926,
+        -40,
+        UNUSED,
+        UNUSED,
+        281,
+        1474,
+        UNUSED,
+        -1015,
+        -534,
+        1374,
+        UNUSED,
+        UNUSED,
+        910,
+        UNUSED,
+        -1782,
+        -262,
+        UNUSED,
+        1058,
+        UNUSED,
+        -430,
+        UNUSED,
+        1248,
+        616,
+        UNUSED,
+        UNUSED,
+        534,
+        1519,
+        549,
+        UNUSED,
+        UNUSED,
+        1258,
+        UNUSED,
+        -700,
+        295,
+        201,
+        UNUSED,
+        UNUSED,
+        2052,
+        UNUSED,
+        921,
+        1214,
+        1091,
+        UNUSED,
+        895,
+        UNUSED,
+        1055,
+        UNUSED,
+        1421,
+        148,
+        302,
+        1000,
+        213,
+        385,
+        UNUSED,
+        UNUSED,
+        857,
+        894,
+        5,
+        1198,
+        UNUSED,
+        UNUSED,
+        1559,
+        UNUSED,
+        2541,
+        UNUSED,
+        1331,
+        -173,
+        659,
+        752,
+        UNUSED,
+        299,
+        1106,
+        UNUSED,
+        660,
+        792,
+        UNUSED,
+        1166,
+        501,
+        UNUSED,
+        1200,
+        1556,
+        UNUSED,
+        UNUSED,
+        -154,
+        UNUSED,
+        -1209,
+        UNUSED,
+        1214,
+        889,
+        UNUSED,
+        UNUSED,
+        666,
+        -1479,
+        UNUSED,
+        63,
+        UNUSED,
+        UNUSED,
+        59,
+        UNUSED,
+        1160,
+        UNUSED,
+        UNUSED,
+        610,
+        UNUSED,
+        76,
+        974,
+        231,
+        UNUSED,
+        1302,
+        235,
+        UNUSED,
+        1580,
+        74,
+        319,
+        UNUSED,
+        -699,
+        UNUSED,
+        UNUSED,
+        UNUSED,
+        UNUSED,
+        UNUSED,
+        UNUSED,
+        UNUSED,
+        UNUSED,
+        UNUSED,
+        UNUSED,
+        UNUSED,
+        465,
+        1586,
+        -1011,
+        UNUSED,
+        1260,
+        UNUSED,
+        UNUSED,
+        130,
+        135,
+        UNUSED,
+        UNUSED,
+        491,
+    };
+    static const struct tokendata tokendata[1677] = {
+        { "db", TOKEN_INSN, C_none, I_DB },
+        { "dw", TOKEN_INSN, C_none, I_DW },
+        { "dd", TOKEN_INSN, C_none, I_DD },
+        { "dq", TOKEN_INSN, C_none, I_DQ },
+        { "dt", TOKEN_INSN, C_none, I_DT },
+        { "do", TOKEN_INSN, C_none, I_DO },
+        { "dy", TOKEN_INSN, C_none, I_DY },
+        { "resb", TOKEN_INSN, C_none, I_RESB },
+        { "resw", TOKEN_INSN, C_none, I_RESW },
+        { "resd", TOKEN_INSN, C_none, I_RESD },
+        { "resq", TOKEN_INSN, C_none, I_RESQ },
+        { "rest", TOKEN_INSN, C_none, I_REST },
+        { "reso", TOKEN_INSN, C_none, I_RESO },
+        { "resy", TOKEN_INSN, C_none, I_RESY },
+        { "aaa", TOKEN_INSN, C_none, I_AAA },
+        { "aad", TOKEN_INSN, C_none, I_AAD },
+        { "aam", TOKEN_INSN, C_none, I_AAM },
+        { "aas", TOKEN_INSN, C_none, I_AAS },
+        { "adc", TOKEN_INSN, C_none, I_ADC },
+        { "add", TOKEN_INSN, C_none, I_ADD },
+        { "and", TOKEN_INSN, C_none, I_AND },
+        { "arpl", TOKEN_INSN, C_none, I_ARPL },
+        { "bb0_reset", TOKEN_INSN, C_none, I_BB0_RESET },
+        { "bb1_reset", TOKEN_INSN, C_none, I_BB1_RESET },
+        { "bound", TOKEN_INSN, C_none, I_BOUND },
+        { "bsf", TOKEN_INSN, C_none, I_BSF },
+        { "bsr", TOKEN_INSN, C_none, I_BSR },
+        { "bswap", TOKEN_INSN, C_none, I_BSWAP },
+        { "bt", TOKEN_INSN, C_none, I_BT },
+        { "btc", TOKEN_INSN, C_none, I_BTC },
+        { "btr", TOKEN_INSN, C_none, I_BTR },
+        { "bts", TOKEN_INSN, C_none, I_BTS },
+        { "call", TOKEN_INSN, C_none, I_CALL },
+        { "cbw", TOKEN_INSN, C_none, I_CBW },
+        { "cdq", TOKEN_INSN, C_none, I_CDQ },
+        { "cdqe", TOKEN_INSN, C_none, I_CDQE },
+        { "clc", TOKEN_INSN, C_none, I_CLC },
+        { "cld", TOKEN_INSN, C_none, I_CLD },
+        { "clgi", TOKEN_INSN, C_none, I_CLGI },
+        { "cli", TOKEN_INSN, C_none, I_CLI },
+        { "clts", TOKEN_INSN, C_none, I_CLTS },
+        { "cmc", TOKEN_INSN, C_none, I_CMC },
+        { "cmp", TOKEN_INSN, C_none, I_CMP },
+        { "cmpsb", TOKEN_INSN, C_none, I_CMPSB },
+        { "cmpsd", TOKEN_INSN, C_none, I_CMPSD },
+        { "cmpsq", TOKEN_INSN, C_none, I_CMPSQ },
+        { "cmpsw", TOKEN_INSN, C_none, I_CMPSW },
+        { "cmpxchg", TOKEN_INSN, C_none, I_CMPXCHG },
+        { "cmpxchg486", TOKEN_INSN, C_none, I_CMPXCHG486 },
+        { "cmpxchg8b", TOKEN_INSN, C_none, I_CMPXCHG8B },
+        { "cmpxchg16b", TOKEN_INSN, C_none, I_CMPXCHG16B },
+        { "cpuid", TOKEN_INSN, C_none, I_CPUID },
+        { "cpu_read", TOKEN_INSN, C_none, I_CPU_READ },
+        { "cpu_write", TOKEN_INSN, C_none, I_CPU_WRITE },
+        { "cqo", TOKEN_INSN, C_none, I_CQO },
+        { "cwd", TOKEN_INSN, C_none, I_CWD },
+        { "cwde", TOKEN_INSN, C_none, I_CWDE },
+        { "daa", TOKEN_INSN, C_none, I_DAA },
+        { "das", TOKEN_INSN, C_none, I_DAS },
+        { "dec", TOKEN_INSN, C_none, I_DEC },
+        { "div", TOKEN_INSN, C_none, I_DIV },
+        { "dmint", TOKEN_INSN, C_none, I_DMINT },
+        { "emms", TOKEN_INSN, C_none, I_EMMS },
+        { "enter", TOKEN_INSN, C_none, I_ENTER },
+        { "equ", TOKEN_INSN, C_none, I_EQU },
+        { "f2xm1", TOKEN_INSN, C_none, I_F2XM1 },
+        { "fabs", TOKEN_INSN, C_none, I_FABS },
+        { "fadd", TOKEN_INSN, C_none, I_FADD },
+        { "faddp", TOKEN_INSN, C_none, I_FADDP },
+        { "fbld", TOKEN_INSN, C_none, I_FBLD },
+        { "fbstp", TOKEN_INSN, C_none, I_FBSTP },
+        { "fchs", TOKEN_INSN, C_none, I_FCHS },
+        { "fclex", TOKEN_INSN, C_none, I_FCLEX },
+        { "fcmovb", TOKEN_INSN, C_none, I_FCMOVB },
+        { "fcmovbe", TOKEN_INSN, C_none, I_FCMOVBE },
+        { "fcmove", TOKEN_INSN, C_none, I_FCMOVE },
+        { "fcmovnb", TOKEN_INSN, C_none, I_FCMOVNB },
+        { "fcmovnbe", TOKEN_INSN, C_none, I_FCMOVNBE },
+        { "fcmovne", TOKEN_INSN, C_none, I_FCMOVNE },
+        { "fcmovnu", TOKEN_INSN, C_none, I_FCMOVNU },
+        { "fcmovu", TOKEN_INSN, C_none, I_FCMOVU },
+        { "fcom", TOKEN_INSN, C_none, I_FCOM },
+        { "fcomi", TOKEN_INSN, C_none, I_FCOMI },
+        { "fcomip", TOKEN_INSN, C_none, I_FCOMIP },
+        { "fcomp", TOKEN_INSN, C_none, I_FCOMP },
+        { "fcompp", TOKEN_INSN, C_none, I_FCOMPP },
+        { "fcos", TOKEN_INSN, C_none, I_FCOS },
+        { "fdecstp", TOKEN_INSN, C_none, I_FDECSTP },
+        { "fdisi", TOKEN_INSN, C_none, I_FDISI },
+        { "fdiv", TOKEN_INSN, C_none, I_FDIV },
+        { "fdivp", TOKEN_INSN, C_none, I_FDIVP },
+        { "fdivr", TOKEN_INSN, C_none, I_FDIVR },
+        { "fdivrp", TOKEN_INSN, C_none, I_FDIVRP },
+        { "femms", TOKEN_INSN, C_none, I_FEMMS },
+        { "feni", TOKEN_INSN, C_none, I_FENI },
+        { "ffree", TOKEN_INSN, C_none, I_FFREE },
+        { "ffreep", TOKEN_INSN, C_none, I_FFREEP },
+        { "fiadd", TOKEN_INSN, C_none, I_FIADD },
+        { "ficom", TOKEN_INSN, C_none, I_FICOM },
+        { "ficomp", TOKEN_INSN, C_none, I_FICOMP },
+        { "fidiv", TOKEN_INSN, C_none, I_FIDIV },
+        { "fidivr", TOKEN_INSN, C_none, I_FIDIVR },
+        { "fild", TOKEN_INSN, C_none, I_FILD },
+        { "fimul", TOKEN_INSN, C_none, I_FIMUL },
+        { "fincstp", TOKEN_INSN, C_none, I_FINCSTP },
+        { "finit", TOKEN_INSN, C_none, I_FINIT },
+        { "fist", TOKEN_INSN, C_none, I_FIST },
+        { "fistp", TOKEN_INSN, C_none, I_FISTP },
+        { "fisttp", TOKEN_INSN, C_none, I_FISTTP },
+        { "fisub", TOKEN_INSN, C_none, I_FISUB },
+        { "fisubr", TOKEN_INSN, C_none, I_FISUBR },
+        { "fld", TOKEN_INSN, C_none, I_FLD },
+        { "fld1", TOKEN_INSN, C_none, I_FLD1 },
+        { "fldcw", TOKEN_INSN, C_none, I_FLDCW },
+        { "fldenv", TOKEN_INSN, C_none, I_FLDENV },
+        { "fldl2e", TOKEN_INSN, C_none, I_FLDL2E },
+        { "fldl2t", TOKEN_INSN, C_none, I_FLDL2T },
+        { "fldlg2", TOKEN_INSN, C_none, I_FLDLG2 },
+        { "fldln2", TOKEN_INSN, C_none, I_FLDLN2 },
+        { "fldpi", TOKEN_INSN, C_none, I_FLDPI },
+        { "fldz", TOKEN_INSN, C_none, I_FLDZ },
+        { "fmul", TOKEN_INSN, C_none, I_FMUL },
+        { "fmulp", TOKEN_INSN, C_none, I_FMULP },
+        { "fnclex", TOKEN_INSN, C_none, I_FNCLEX },
+        { "fndisi", TOKEN_INSN, C_none, I_FNDISI },
+        { "fneni", TOKEN_INSN, C_none, I_FNENI },
+        { "fninit", TOKEN_INSN, C_none, I_FNINIT },
+        { "fnop", TOKEN_INSN, C_none, I_FNOP },
+        { "fnsave", TOKEN_INSN, C_none, I_FNSAVE },
+        { "fnstcw", TOKEN_INSN, C_none, I_FNSTCW },
+        { "fnstenv", TOKEN_INSN, C_none, I_FNSTENV },
+        { "fnstsw", TOKEN_INSN, C_none, I_FNSTSW },
+        { "fpatan", TOKEN_INSN, C_none, I_FPATAN },
+        { "fprem", TOKEN_INSN, C_none, I_FPREM },
+        { "fprem1", TOKEN_INSN, C_none, I_FPREM1 },
+        { "fptan", TOKEN_INSN, C_none, I_FPTAN },
+        { "frndint", TOKEN_INSN, C_none, I_FRNDINT },
+        { "frstor", TOKEN_INSN, C_none, I_FRSTOR },
+        { "fsave", TOKEN_INSN, C_none, I_FSAVE },
+        { "fscale", TOKEN_INSN, C_none, I_FSCALE },
+        { "fsetpm", TOKEN_INSN, C_none, I_FSETPM },
+        { "fsin", TOKEN_INSN, C_none, I_FSIN },
+        { "fsincos", TOKEN_INSN, C_none, I_FSINCOS },
+        { "fsqrt", TOKEN_INSN, C_none, I_FSQRT },
+        { "fst", TOKEN_INSN, C_none, I_FST },
+        { "fstcw", TOKEN_INSN, C_none, I_FSTCW },
+        { "fstenv", TOKEN_INSN, C_none, I_FSTENV },
+        { "fstp", TOKEN_INSN, C_none, I_FSTP },
+        { "fstsw", TOKEN_INSN, C_none, I_FSTSW },
+        { "fsub", TOKEN_INSN, C_none, I_FSUB },
+        { "fsubp", TOKEN_INSN, C_none, I_FSUBP },
+        { "fsubr", TOKEN_INSN, C_none, I_FSUBR },
+        { "fsubrp", TOKEN_INSN, C_none, I_FSUBRP },
+        { "ftst", TOKEN_INSN, C_none, I_FTST },
+        { "fucom", TOKEN_INSN, C_none, I_FUCOM },
+        { "fucomi", TOKEN_INSN, C_none, I_FUCOMI },
+        { "fucomip", TOKEN_INSN, C_none, I_FUCOMIP },
+        { "fucomp", TOKEN_INSN, C_none, I_FUCOMP },
+        { "fucompp", TOKEN_INSN, C_none, I_FUCOMPP },
+        { "fxam", TOKEN_INSN, C_none, I_FXAM },
+        { "fxch", TOKEN_INSN, C_none, I_FXCH },
+        { "fxtract", TOKEN_INSN, C_none, I_FXTRACT },
+        { "fyl2x", TOKEN_INSN, C_none, I_FYL2X },
+        { "fyl2xp1", TOKEN_INSN, C_none, I_FYL2XP1 },
+        { "hlt", TOKEN_INSN, C_none, I_HLT },
+        { "ibts", TOKEN_INSN, C_none, I_IBTS },
+        { "icebp", TOKEN_INSN, C_none, I_ICEBP },
+        { "idiv", TOKEN_INSN, C_none, I_IDIV },
+        { "imul", TOKEN_INSN, C_none, I_IMUL },
+        { "in", TOKEN_INSN, C_none, I_IN },
+        { "inc", TOKEN_INSN, C_none, I_INC },
+        { "incbin", TOKEN_INSN, C_none, I_INCBIN },
+        { "insb", TOKEN_INSN, C_none, I_INSB },
+        { "insd", TOKEN_INSN, C_none, I_INSD },
+        { "insw", TOKEN_INSN, C_none, I_INSW },
+        { "int", TOKEN_INSN, C_none, I_INT },
+        { "int01", TOKEN_INSN, C_none, I_INT01 },
+        { "int1", TOKEN_INSN, C_none, I_INT1 },
+        { "int03", TOKEN_INSN, C_none, I_INT03 },
+        { "int3", TOKEN_INSN, C_none, I_INT3 },
+        { "into", TOKEN_INSN, C_none, I_INTO },
+        { "invd", TOKEN_INSN, C_none, I_INVD },
+        { "invlpg", TOKEN_INSN, C_none, I_INVLPG },
+        { "invlpga", TOKEN_INSN, C_none, I_INVLPGA },
+        { "iret", TOKEN_INSN, C_none, I_IRET },
+        { "iretd", TOKEN_INSN, C_none, I_IRETD },
+        { "iretq", TOKEN_INSN, C_none, I_IRETQ },
+        { "iretw", TOKEN_INSN, C_none, I_IRETW },
+        { "jcxz", TOKEN_INSN, C_none, I_JCXZ },
+        { "jecxz", TOKEN_INSN, C_none, I_JECXZ },
+        { "jrcxz", TOKEN_INSN, C_none, I_JRCXZ },
+        { "jmp", TOKEN_INSN, C_none, I_JMP },
+        { "jmpe", TOKEN_INSN, C_none, I_JMPE },
+        { "lahf", TOKEN_INSN, C_none, I_LAHF },
+        { "lar", TOKEN_INSN, C_none, I_LAR },
+        { "lds", TOKEN_INSN, C_none, I_LDS },
+        { "lea", TOKEN_INSN, C_none, I_LEA },
+        { "leave", TOKEN_INSN, C_none, I_LEAVE },
+        { "les", TOKEN_INSN, C_none, I_LES },
+        { "lfence", TOKEN_INSN, C_none, I_LFENCE },
+        { "lfs", TOKEN_INSN, C_none, I_LFS },
+        { "lgdt", TOKEN_INSN, C_none, I_LGDT },
+        { "lgs", TOKEN_INSN, C_none, I_LGS },
+        { "lidt", TOKEN_INSN, C_none, I_LIDT },
+        { "lldt", TOKEN_INSN, C_none, I_LLDT },
+        { "lmsw", TOKEN_INSN, C_none, I_LMSW },
+        { "loadall", TOKEN_INSN, C_none, I_LOADALL },
+        { "loadall286", TOKEN_INSN, C_none, I_LOADALL286 },
+        { "lodsb", TOKEN_INSN, C_none, I_LODSB },
+        { "lodsd", TOKEN_INSN, C_none, I_LODSD },
+        { "lodsq", TOKEN_INSN, C_none, I_LODSQ },
+        { "lodsw", TOKEN_INSN, C_none, I_LODSW },
+        { "loop", TOKEN_INSN, C_none, I_LOOP },
+        { "loope", TOKEN_INSN, C_none, I_LOOPE },
+        { "loopne", TOKEN_INSN, C_none, I_LOOPNE },
+        { "loopnz", TOKEN_INSN, C_none, I_LOOPNZ },
+        { "loopz", TOKEN_INSN, C_none, I_LOOPZ },
+        { "lsl", TOKEN_INSN, C_none, I_LSL },
+        { "lss", TOKEN_INSN, C_none, I_LSS },
+        { "ltr", TOKEN_INSN, C_none, I_LTR },
+        { "mfence", TOKEN_INSN, C_none, I_MFENCE },
+        { "monitor", TOKEN_INSN, C_none, I_MONITOR },
+        { "mov", TOKEN_INSN, C_none, I_MOV },
+        { "movd", TOKEN_INSN, C_none, I_MOVD },
+        { "movq", TOKEN_INSN, C_none, I_MOVQ },
+        { "movsb", TOKEN_INSN, C_none, I_MOVSB },
+        { "movsd", TOKEN_INSN, C_none, I_MOVSD },
+        { "movsq", TOKEN_INSN, C_none, I_MOVSQ },
+        { "movsw", TOKEN_INSN, C_none, I_MOVSW },
+        { "movsx", TOKEN_INSN, C_none, I_MOVSX },
+        { "movsxd", TOKEN_INSN, C_none, I_MOVSXD },
+        { "movzx", TOKEN_INSN, C_none, I_MOVZX },
+        { "mul", TOKEN_INSN, C_none, I_MUL },
+        { "mwait", TOKEN_INSN, C_none, I_MWAIT },
+        { "neg", TOKEN_INSN, C_none, I_NEG },
+        { "nop", TOKEN_INSN, C_none, I_NOP },
+        { "not", TOKEN_INSN, C_none, I_NOT },
+        { "or", TOKEN_INSN, C_none, I_OR },
+        { "out", TOKEN_INSN, C_none, I_OUT },
+        { "outsb", TOKEN_INSN, C_none, I_OUTSB },
+        { "outsd", TOKEN_INSN, C_none, I_OUTSD },
+        { "outsw", TOKEN_INSN, C_none, I_OUTSW },
+        { "packssdw", TOKEN_INSN, C_none, I_PACKSSDW },
+        { "packsswb", TOKEN_INSN, C_none, I_PACKSSWB },
+        { "packuswb", TOKEN_INSN, C_none, I_PACKUSWB },
+        { "paddb", TOKEN_INSN, C_none, I_PADDB },
+        { "paddd", TOKEN_INSN, C_none, I_PADDD },
+        { "paddsb", TOKEN_INSN, C_none, I_PADDSB },
+        { "paddsiw", TOKEN_INSN, C_none, I_PADDSIW },
+        { "paddsw", TOKEN_INSN, C_none, I_PADDSW },
+        { "paddusb", TOKEN_INSN, C_none, I_PADDUSB },
+        { "paddusw", TOKEN_INSN, C_none, I_PADDUSW },
+        { "paddw", TOKEN_INSN, C_none, I_PADDW },
+        { "pand", TOKEN_INSN, C_none, I_PAND },
+        { "pandn", TOKEN_INSN, C_none, I_PANDN },
+        { "pause", TOKEN_INSN, C_none, I_PAUSE },
+        { "paveb", TOKEN_INSN, C_none, I_PAVEB },
+        { "pavgusb", TOKEN_INSN, C_none, I_PAVGUSB },
+        { "pcmpeqb", TOKEN_INSN, C_none, I_PCMPEQB },
+        { "pcmpeqd", TOKEN_INSN, C_none, I_PCMPEQD },
+        { "pcmpeqw", TOKEN_INSN, C_none, I_PCMPEQW },
+        { "pcmpgtb", TOKEN_INSN, C_none, I_PCMPGTB },
+        { "pcmpgtd", TOKEN_INSN, C_none, I_PCMPGTD },
+        { "pcmpgtw", TOKEN_INSN, C_none, I_PCMPGTW },
+        { "pdistib", TOKEN_INSN, C_none, I_PDISTIB },
+        { "pf2id", TOKEN_INSN, C_none, I_PF2ID },
+        { "pfacc", TOKEN_INSN, C_none, I_PFACC },
+        { "pfadd", TOKEN_INSN, C_none, I_PFADD },
+        { "pfcmpeq", TOKEN_INSN, C_none, I_PFCMPEQ },
+        { "pfcmpge", TOKEN_INSN, C_none, I_PFCMPGE },
+        { "pfcmpgt", TOKEN_INSN, C_none, I_PFCMPGT },
+        { "pfmax", TOKEN_INSN, C_none, I_PFMAX },
+        { "pfmin", TOKEN_INSN, C_none, I_PFMIN },
+        { "pfmul", TOKEN_INSN, C_none, I_PFMUL },
+        { "pfrcp", TOKEN_INSN, C_none, I_PFRCP },
+        { "pfrcpit1", TOKEN_INSN, C_none, I_PFRCPIT1 },
+        { "pfrcpit2", TOKEN_INSN, C_none, I_PFRCPIT2 },
+        { "pfrsqit1", TOKEN_INSN, C_none, I_PFRSQIT1 },
+        { "pfrsqrt", TOKEN_INSN, C_none, I_PFRSQRT },
+        { "pfsub", TOKEN_INSN, C_none, I_PFSUB },
+        { "pfsubr", TOKEN_INSN, C_none, I_PFSUBR },
+        { "pi2fd", TOKEN_INSN, C_none, I_PI2FD },
+        { "pmachriw", TOKEN_INSN, C_none, I_PMACHRIW },
+        { "pmaddwd", TOKEN_INSN, C_none, I_PMADDWD },
+        { "pmagw", TOKEN_INSN, C_none, I_PMAGW },
+        { "pmulhriw", TOKEN_INSN, C_none, I_PMULHRIW },
+        { "pmulhrwa", TOKEN_INSN, C_none, I_PMULHRWA },
+        { "pmulhrwc", TOKEN_INSN, C_none, I_PMULHRWC },
+        { "pmulhw", TOKEN_INSN, C_none, I_PMULHW },
+        { "pmullw", TOKEN_INSN, C_none, I_PMULLW },
+        { "pmvgezb", TOKEN_INSN, C_none, I_PMVGEZB },
+        { "pmvlzb", TOKEN_INSN, C_none, I_PMVLZB },
+        { "pmvnzb", TOKEN_INSN, C_none, I_PMVNZB },
+        { "pmvzb", TOKEN_INSN, C_none, I_PMVZB },
+        { "pop", TOKEN_INSN, C_none, I_POP },
+        { "popa", TOKEN_INSN, C_none, I_POPA },
+        { "popad", TOKEN_INSN, C_none, I_POPAD },
+        { "popaw", TOKEN_INSN, C_none, I_POPAW },
+        { "popf", TOKEN_INSN, C_none, I_POPF },
+        { "popfd", TOKEN_INSN, C_none, I_POPFD },
+        { "popfq", TOKEN_INSN, C_none, I_POPFQ },
+        { "popfw", TOKEN_INSN, C_none, I_POPFW },
+        { "por", TOKEN_INSN, C_none, I_POR },
+        { "prefetch", TOKEN_INSN, C_none, I_PREFETCH },
+        { "prefetchw", TOKEN_INSN, C_none, I_PREFETCHW },
+        { "pslld", TOKEN_INSN, C_none, I_PSLLD },
+        { "psllq", TOKEN_INSN, C_none, I_PSLLQ },
+        { "psllw", TOKEN_INSN, C_none, I_PSLLW },
+        { "psrad", TOKEN_INSN, C_none, I_PSRAD },
+        { "psraw", TOKEN_INSN, C_none, I_PSRAW },
+        { "psrld", TOKEN_INSN, C_none, I_PSRLD },
+        { "psrlq", TOKEN_INSN, C_none, I_PSRLQ },
+        { "psrlw", TOKEN_INSN, C_none, I_PSRLW },
+        { "psubb", TOKEN_INSN, C_none, I_PSUBB },
+        { "psubd", TOKEN_INSN, C_none, I_PSUBD },
+        { "psubsb", TOKEN_INSN, C_none, I_PSUBSB },
+        { "psubsiw", TOKEN_INSN, C_none, I_PSUBSIW },
+        { "psubsw", TOKEN_INSN, C_none, I_PSUBSW },
+        { "psubusb", TOKEN_INSN, C_none, I_PSUBUSB },
+        { "psubusw", TOKEN_INSN, C_none, I_PSUBUSW },
+        { "psubw", TOKEN_INSN, C_none, I_PSUBW },
+        { "punpckhbw", TOKEN_INSN, C_none, I_PUNPCKHBW },
+        { "punpckhdq", TOKEN_INSN, C_none, I_PUNPCKHDQ },
+        { "punpckhwd", TOKEN_INSN, C_none, I_PUNPCKHWD },
+        { "punpcklbw", TOKEN_INSN, C_none, I_PUNPCKLBW },
+        { "punpckldq", TOKEN_INSN, C_none, I_PUNPCKLDQ },
+        { "punpcklwd", TOKEN_INSN, C_none, I_PUNPCKLWD },
+        { "push", TOKEN_INSN, C_none, I_PUSH },
+        { "pusha", TOKEN_INSN, C_none, I_PUSHA },
+        { "pushad", TOKEN_INSN, C_none, I_PUSHAD },
+        { "pushaw", TOKEN_INSN, C_none, I_PUSHAW },
+        { "pushf", TOKEN_INSN, C_none, I_PUSHF },
+        { "pushfd", TOKEN_INSN, C_none, I_PUSHFD },
+        { "pushfq", TOKEN_INSN, C_none, I_PUSHFQ },
+        { "pushfw", TOKEN_INSN, C_none, I_PUSHFW },
+        { "pxor", TOKEN_INSN, C_none, I_PXOR },
+        { "rcl", TOKEN_INSN, C_none, I_RCL },
+        { "rcr", TOKEN_INSN, C_none, I_RCR },
+        { "rdshr", TOKEN_INSN, C_none, I_RDSHR },
+        { "rdmsr", TOKEN_INSN, C_none, I_RDMSR },
+        { "rdpmc", TOKEN_INSN, C_none, I_RDPMC },
+        { "rdtsc", TOKEN_INSN, C_none, I_RDTSC },
+        { "rdtscp", TOKEN_INSN, C_none, I_RDTSCP },
+        { "ret", TOKEN_INSN, C_none, I_RET },
+        { "retf", TOKEN_INSN, C_none, I_RETF },
+        { "retn", TOKEN_INSN, C_none, I_RETN },
+        { "rol", TOKEN_INSN, C_none, I_ROL },
+        { "ror", TOKEN_INSN, C_none, I_ROR },
+        { "rdm", TOKEN_INSN, C_none, I_RDM },
+        { "rsdc", TOKEN_INSN, C_none, I_RSDC },
+        { "rsldt", TOKEN_INSN, C_none, I_RSLDT },
+        { "rsm", TOKEN_INSN, C_none, I_RSM },
+        { "rsts", TOKEN_INSN, C_none, I_RSTS },
+        { "sahf", TOKEN_INSN, C_none, I_SAHF },
+        { "sal", TOKEN_INSN, C_none, I_SAL },
+        { "salc", TOKEN_INSN, C_none, I_SALC },
+        { "sar", TOKEN_INSN, C_none, I_SAR },
+        { "sbb", TOKEN_INSN, C_none, I_SBB },
+        { "scasb", TOKEN_INSN, C_none, I_SCASB },
+        { "scasd", TOKEN_INSN, C_none, I_SCASD },
+        { "scasq", TOKEN_INSN, C_none, I_SCASQ },
+        { "scasw", TOKEN_INSN, C_none, I_SCASW },
+        { "sfence", TOKEN_INSN, C_none, I_SFENCE },
+        { "sgdt", TOKEN_INSN, C_none, I_SGDT },
+        { "shl", TOKEN_INSN, C_none, I_SHL },
+        { "shld", TOKEN_INSN, C_none, I_SHLD },
+        { "shr", TOKEN_INSN, C_none, I_SHR },
+        { "shrd", TOKEN_INSN, C_none, I_SHRD },
+        { "sidt", TOKEN_INSN, C_none, I_SIDT },
+        { "sldt", TOKEN_INSN, C_none, I_SLDT },
+        { "skinit", TOKEN_INSN, C_none, I_SKINIT },
+        { "smi", TOKEN_INSN, C_none, I_SMI },
+        { "smint", TOKEN_INSN, C_none, I_SMINT },
+        { "smintold", TOKEN_INSN, C_none, I_SMINTOLD },
+        { "smsw", TOKEN_INSN, C_none, I_SMSW },
+        { "stc", TOKEN_INSN, C_none, I_STC },
+        { "std", TOKEN_INSN, C_none, I_STD },
+        { "stgi", TOKEN_INSN, C_none, I_STGI },
+        { "sti", TOKEN_INSN, C_none, I_STI },
+        { "stosb", TOKEN_INSN, C_none, I_STOSB },
+        { "stosd", TOKEN_INSN, C_none, I_STOSD },
+        { "stosq", TOKEN_INSN, C_none, I_STOSQ },
+        { "stosw", TOKEN_INSN, C_none, I_STOSW },
+        { "str", TOKEN_INSN, C_none, I_STR },
+        { "sub", TOKEN_INSN, C_none, I_SUB },
+        { "svdc", TOKEN_INSN, C_none, I_SVDC },
+        { "svldt", TOKEN_INSN, C_none, I_SVLDT },
+        { "svts", TOKEN_INSN, C_none, I_SVTS },
+        { "swapgs", TOKEN_INSN, C_none, I_SWAPGS },
+        { "syscall", TOKEN_INSN, C_none, I_SYSCALL },
+        { "sysenter", TOKEN_INSN, C_none, I_SYSENTER },
+        { "sysexit", TOKEN_INSN, C_none, I_SYSEXIT },
+        { "sysret", TOKEN_INSN, C_none, I_SYSRET },
+        { "test", TOKEN_INSN, C_none, I_TEST },
+        { "ud0", TOKEN_INSN, C_none, I_UD0 },
+        { "ud1", TOKEN_INSN, C_none, I_UD1 },
+        { "ud2b", TOKEN_INSN, C_none, I_UD2B },
+        { "ud2", TOKEN_INSN, C_none, I_UD2 },
+        { "ud2a", TOKEN_INSN, C_none, I_UD2A },
+        { "umov", TOKEN_INSN, C_none, I_UMOV },
+        { "verr", TOKEN_INSN, C_none, I_VERR },
+        { "verw", TOKEN_INSN, C_none, I_VERW },
+        { "fwait", TOKEN_INSN, C_none, I_FWAIT },
+        { "wbinvd", TOKEN_INSN, C_none, I_WBINVD },
+        { "wrshr", TOKEN_INSN, C_none, I_WRSHR },
+        { "wrmsr", TOKEN_INSN, C_none, I_WRMSR },
+        { "xadd", TOKEN_INSN, C_none, I_XADD },
+        { "xbts", TOKEN_INSN, C_none, I_XBTS },
+        { "xchg", TOKEN_INSN, C_none, I_XCHG },
+        { "xlatb", TOKEN_INSN, C_none, I_XLATB },
+        { "xlat", TOKEN_INSN, C_none, I_XLAT },
+        { "xor", TOKEN_INSN, C_none, I_XOR },
+        { "cmova", TOKEN_INSN, C_A, I_CMOVcc },
+        { "cmovae", TOKEN_INSN, C_AE, I_CMOVcc },
+        { "cmovb", TOKEN_INSN, C_B, I_CMOVcc },
+        { "cmovbe", TOKEN_INSN, C_BE, I_CMOVcc },
+        { "cmovc", TOKEN_INSN, C_C, I_CMOVcc },
+        { "cmove", TOKEN_INSN, C_E, I_CMOVcc },
+        { "cmovg", TOKEN_INSN, C_G, I_CMOVcc },
+        { "cmovge", TOKEN_INSN, C_GE, I_CMOVcc },
+        { "cmovl", TOKEN_INSN, C_L, I_CMOVcc },
+        { "cmovle", TOKEN_INSN, C_LE, I_CMOVcc },
+        { "cmovna", TOKEN_INSN, C_NA, I_CMOVcc },
+        { "cmovnae", TOKEN_INSN, C_NAE, I_CMOVcc },
+        { "cmovnb", TOKEN_INSN, C_NB, I_CMOVcc },
+        { "cmovnbe", TOKEN_INSN, C_NBE, I_CMOVcc },
+        { "cmovnc", TOKEN_INSN, C_NC, I_CMOVcc },
+        { "cmovne", TOKEN_INSN, C_NE, I_CMOVcc },
+        { "cmovng", TOKEN_INSN, C_NG, I_CMOVcc },
+        { "cmovnge", TOKEN_INSN, C_NGE, I_CMOVcc },
+        { "cmovnl", TOKEN_INSN, C_NL, I_CMOVcc },
+        { "cmovnle", TOKEN_INSN, C_NLE, I_CMOVcc },
+        { "cmovno", TOKEN_INSN, C_NO, I_CMOVcc },
+        { "cmovnp", TOKEN_INSN, C_NP, I_CMOVcc },
+        { "cmovns", TOKEN_INSN, C_NS, I_CMOVcc },
+        { "cmovnz", TOKEN_INSN, C_NZ, I_CMOVcc },
+        { "cmovo", TOKEN_INSN, C_O, I_CMOVcc },
+        { "cmovp", TOKEN_INSN, C_P, I_CMOVcc },
+        { "cmovpe", TOKEN_INSN, C_PE, I_CMOVcc },
+        { "cmovpo", TOKEN_INSN, C_PO, I_CMOVcc },
+        { "cmovs", TOKEN_INSN, C_S, I_CMOVcc },
+        { "cmovz", TOKEN_INSN, C_Z, I_CMOVcc },
+        { "ja", TOKEN_INSN, C_A, I_Jcc },
+        { "jae", TOKEN_INSN, C_AE, I_Jcc },
+        { "jb", TOKEN_INSN, C_B, I_Jcc },
+        { "jbe", TOKEN_INSN, C_BE, I_Jcc },
+        { "jc", TOKEN_INSN, C_C, I_Jcc },
+        { "je", TOKEN_INSN, C_E, I_Jcc },
+        { "jg", TOKEN_INSN, C_G, I_Jcc },
+        { "jge", TOKEN_INSN, C_GE, I_Jcc },
+        { "jl", TOKEN_INSN, C_L, I_Jcc },
+        { "jle", TOKEN_INSN, C_LE, I_Jcc },
+        { "jna", TOKEN_INSN, C_NA, I_Jcc },
+        { "jnae", TOKEN_INSN, C_NAE, I_Jcc },
+        { "jnb", TOKEN_INSN, C_NB, I_Jcc },
+        { "jnbe", TOKEN_INSN, C_NBE, I_Jcc },
+        { "jnc", TOKEN_INSN, C_NC, I_Jcc },
+        { "jne", TOKEN_INSN, C_NE, I_Jcc },
+        { "jng", TOKEN_INSN, C_NG, I_Jcc },
+        { "jnge", TOKEN_INSN, C_NGE, I_Jcc },
+        { "jnl", TOKEN_INSN, C_NL, I_Jcc },
+        { "jnle", TOKEN_INSN, C_NLE, I_Jcc },
+        { "jno", TOKEN_INSN, C_NO, I_Jcc },
+        { "jnp", TOKEN_INSN, C_NP, I_Jcc },
+        { "jns", TOKEN_INSN, C_NS, I_Jcc },
+        { "jnz", TOKEN_INSN, C_NZ, I_Jcc },
+        { "jo", TOKEN_INSN, C_O, I_Jcc },
+        { "jp", TOKEN_INSN, C_P, I_Jcc },
+        { "jpe", TOKEN_INSN, C_PE, I_Jcc },
+        { "jpo", TOKEN_INSN, C_PO, I_Jcc },
+        { "js", TOKEN_INSN, C_S, I_Jcc },
+        { "jz", TOKEN_INSN, C_Z, I_Jcc },
+        { "seta", TOKEN_INSN, C_A, I_SETcc },
+        { "setae", TOKEN_INSN, C_AE, I_SETcc },
+        { "setb", TOKEN_INSN, C_B, I_SETcc },
+        { "setbe", TOKEN_INSN, C_BE, I_SETcc },
+        { "setc", TOKEN_INSN, C_C, I_SETcc },
+        { "sete", TOKEN_INSN, C_E, I_SETcc },
+        { "setg", TOKEN_INSN, C_G, I_SETcc },
+        { "setge", TOKEN_INSN, C_GE, I_SETcc },
+        { "setl", TOKEN_INSN, C_L, I_SETcc },
+        { "setle", TOKEN_INSN, C_LE, I_SETcc },
+        { "setna", TOKEN_INSN, C_NA, I_SETcc },
+        { "setnae", TOKEN_INSN, C_NAE, I_SETcc },
+        { "setnb", TOKEN_INSN, C_NB, I_SETcc },
+        { "setnbe", TOKEN_INSN, C_NBE, I_SETcc },
+        { "setnc", TOKEN_INSN, C_NC, I_SETcc },
+        { "setne", TOKEN_INSN, C_NE, I_SETcc },
+        { "setng", TOKEN_INSN, C_NG, I_SETcc },
+        { "setnge", TOKEN_INSN, C_NGE, I_SETcc },
+        { "setnl", TOKEN_INSN, C_NL, I_SETcc },
+        { "setnle", TOKEN_INSN, C_NLE, I_SETcc },
+        { "setno", TOKEN_INSN, C_NO, I_SETcc },
+        { "setnp", TOKEN_INSN, C_NP, I_SETcc },
+        { "setns", TOKEN_INSN, C_NS, I_SETcc },
+        { "setnz", TOKEN_INSN, C_NZ, I_SETcc },
+        { "seto", TOKEN_INSN, C_O, I_SETcc },
+        { "setp", TOKEN_INSN, C_P, I_SETcc },
+        { "setpe", TOKEN_INSN, C_PE, I_SETcc },
+        { "setpo", TOKEN_INSN, C_PO, I_SETcc },
+        { "sets", TOKEN_INSN, C_S, I_SETcc },
+        { "setz", TOKEN_INSN, C_Z, I_SETcc },
+        { "addps", TOKEN_INSN, C_none, I_ADDPS },
+        { "addss", TOKEN_INSN, C_none, I_ADDSS },
+        { "andnps", TOKEN_INSN, C_none, I_ANDNPS },
+        { "andps", TOKEN_INSN, C_none, I_ANDPS },
+        { "cmpeqps", TOKEN_INSN, C_none, I_CMPEQPS },
+        { "cmpeqss", TOKEN_INSN, C_none, I_CMPEQSS },
+        { "cmpleps", TOKEN_INSN, C_none, I_CMPLEPS },
+        { "cmpless", TOKEN_INSN, C_none, I_CMPLESS },
+        { "cmpltps", TOKEN_INSN, C_none, I_CMPLTPS },
+        { "cmpltss", TOKEN_INSN, C_none, I_CMPLTSS },
+        { "cmpneqps", TOKEN_INSN, C_none, I_CMPNEQPS },
+        { "cmpneqss", TOKEN_INSN, C_none, I_CMPNEQSS },
+        { "cmpnleps", TOKEN_INSN, C_none, I_CMPNLEPS },
+        { "cmpnless", TOKEN_INSN, C_none, I_CMPNLESS },
+        { "cmpnltps", TOKEN_INSN, C_none, I_CMPNLTPS },
+        { "cmpnltss", TOKEN_INSN, C_none, I_CMPNLTSS },
+        { "cmpordps", TOKEN_INSN, C_none, I_CMPORDPS },
+        { "cmpordss", TOKEN_INSN, C_none, I_CMPORDSS },
+        { "cmpunordps", TOKEN_INSN, C_none, I_CMPUNORDPS },
+        { "cmpunordss", TOKEN_INSN, C_none, I_CMPUNORDSS },
+        { "cmpps", TOKEN_INSN, C_none, I_CMPPS },
+        { "cmpss", TOKEN_INSN, C_none, I_CMPSS },
+        { "comiss", TOKEN_INSN, C_none, I_COMISS },
+        { "cvtpi2ps", TOKEN_INSN, C_none, I_CVTPI2PS },
+        { "cvtps2pi", TOKEN_INSN, C_none, I_CVTPS2PI },
+        { "cvtsi2ss", TOKEN_INSN, C_none, I_CVTSI2SS },
+        { "cvtss2si", TOKEN_INSN, C_none, I_CVTSS2SI },
+        { "cvttps2pi", TOKEN_INSN, C_none, I_CVTTPS2PI },
+        { "cvttss2si", TOKEN_INSN, C_none, I_CVTTSS2SI },
+        { "divps", TOKEN_INSN, C_none, I_DIVPS },
+        { "divss", TOKEN_INSN, C_none, I_DIVSS },
+        { "ldmxcsr", TOKEN_INSN, C_none, I_LDMXCSR },
+        { "maxps", TOKEN_INSN, C_none, I_MAXPS },
+        { "maxss", TOKEN_INSN, C_none, I_MAXSS },
+        { "minps", TOKEN_INSN, C_none, I_MINPS },
+        { "minss", TOKEN_INSN, C_none, I_MINSS },
+        { "movaps", TOKEN_INSN, C_none, I_MOVAPS },
+        { "movhps", TOKEN_INSN, C_none, I_MOVHPS },
+        { "movlhps", TOKEN_INSN, C_none, I_MOVLHPS },
+        { "movlps", TOKEN_INSN, C_none, I_MOVLPS },
+        { "movhlps", TOKEN_INSN, C_none, I_MOVHLPS },
+        { "movmskps", TOKEN_INSN, C_none, I_MOVMSKPS },
+        { "movntps", TOKEN_INSN, C_none, I_MOVNTPS },
+        { "movss", TOKEN_INSN, C_none, I_MOVSS },
+        { "movups", TOKEN_INSN, C_none, I_MOVUPS },
+        { "mulps", TOKEN_INSN, C_none, I_MULPS },
+        { "mulss", TOKEN_INSN, C_none, I_MULSS },
+        { "orps", TOKEN_INSN, C_none, I_ORPS },
+        { "rcpps", TOKEN_INSN, C_none, I_RCPPS },
+        { "rcpss", TOKEN_INSN, C_none, I_RCPSS },
+        { "rsqrtps", TOKEN_INSN, C_none, I_RSQRTPS },
+        { "rsqrtss", TOKEN_INSN, C_none, I_RSQRTSS },
+        { "shufps", TOKEN_INSN, C_none, I_SHUFPS },
+        { "sqrtps", TOKEN_INSN, C_none, I_SQRTPS },
+        { "sqrtss", TOKEN_INSN, C_none, I_SQRTSS },
+        { "stmxcsr", TOKEN_INSN, C_none, I_STMXCSR },
+        { "subps", TOKEN_INSN, C_none, I_SUBPS },
+        { "subss", TOKEN_INSN, C_none, I_SUBSS },
+        { "ucomiss", TOKEN_INSN, C_none, I_UCOMISS },
+        { "unpckhps", TOKEN_INSN, C_none, I_UNPCKHPS },
+        { "unpcklps", TOKEN_INSN, C_none, I_UNPCKLPS },
+        { "xorps", TOKEN_INSN, C_none, I_XORPS },
+        { "fxrstor", TOKEN_INSN, C_none, I_FXRSTOR },
+        { "fxsave", TOKEN_INSN, C_none, I_FXSAVE },
+        { "xgetbv", TOKEN_INSN, C_none, I_XGETBV },
+        { "xsetbv", TOKEN_INSN, C_none, I_XSETBV },
+        { "xsave", TOKEN_INSN, C_none, I_XSAVE },
+        { "xrstor", TOKEN_INSN, C_none, I_XRSTOR },
+        { "prefetchnta", TOKEN_INSN, C_none, I_PREFETCHNTA },
+        { "prefetcht0", TOKEN_INSN, C_none, I_PREFETCHT0 },
+        { "prefetcht1", TOKEN_INSN, C_none, I_PREFETCHT1 },
+        { "prefetcht2", TOKEN_INSN, C_none, I_PREFETCHT2 },
+        { "maskmovq", TOKEN_INSN, C_none, I_MASKMOVQ },
+        { "movntq", TOKEN_INSN, C_none, I_MOVNTQ },
+        { "pavgb", TOKEN_INSN, C_none, I_PAVGB },
+        { "pavgw", TOKEN_INSN, C_none, I_PAVGW },
+        { "pextrw", TOKEN_INSN, C_none, I_PEXTRW },
+        { "pinsrw", TOKEN_INSN, C_none, I_PINSRW },
+        { "pmaxsw", TOKEN_INSN, C_none, I_PMAXSW },
+        { "pmaxub", TOKEN_INSN, C_none, I_PMAXUB },
+        { "pminsw", TOKEN_INSN, C_none, I_PMINSW },
+        { "pminub", TOKEN_INSN, C_none, I_PMINUB },
+        { "pmovmskb", TOKEN_INSN, C_none, I_PMOVMSKB },
+        { "pmulhuw", TOKEN_INSN, C_none, I_PMULHUW },
+        { "psadbw", TOKEN_INSN, C_none, I_PSADBW },
+        { "pshufw", TOKEN_INSN, C_none, I_PSHUFW },
+        { "pf2iw", TOKEN_INSN, C_none, I_PF2IW },
+        { "pfnacc", TOKEN_INSN, C_none, I_PFNACC },
+        { "pfpnacc", TOKEN_INSN, C_none, I_PFPNACC },
+        { "pi2fw", TOKEN_INSN, C_none, I_PI2FW },
+        { "pswapd", TOKEN_INSN, C_none, I_PSWAPD },
+        { "maskmovdqu", TOKEN_INSN, C_none, I_MASKMOVDQU },
+        { "clflush", TOKEN_INSN, C_none, I_CLFLUSH },
+        { "movntdq", TOKEN_INSN, C_none, I_MOVNTDQ },
+        { "movnti", TOKEN_INSN, C_none, I_MOVNTI },
+        { "movntpd", TOKEN_INSN, C_none, I_MOVNTPD },
+        { "movdqa", TOKEN_INSN, C_none, I_MOVDQA },
+        { "movdqu", TOKEN_INSN, C_none, I_MOVDQU },
+        { "movdq2q", TOKEN_INSN, C_none, I_MOVDQ2Q },
+        { "movq2dq", TOKEN_INSN, C_none, I_MOVQ2DQ },
+        { "paddq", TOKEN_INSN, C_none, I_PADDQ },
+        { "pmuludq", TOKEN_INSN, C_none, I_PMULUDQ },
+        { "pshufd", TOKEN_INSN, C_none, I_PSHUFD },
+        { "pshufhw", TOKEN_INSN, C_none, I_PSHUFHW },
+        { "pshuflw", TOKEN_INSN, C_none, I_PSHUFLW },
+        { "pslldq", TOKEN_INSN, C_none, I_PSLLDQ },
+        { "psrldq", TOKEN_INSN, C_none, I_PSRLDQ },
+        { "psubq", TOKEN_INSN, C_none, I_PSUBQ },
+        { "punpckhqdq", TOKEN_INSN, C_none, I_PUNPCKHQDQ },
+        { "punpcklqdq", TOKEN_INSN, C_none, I_PUNPCKLQDQ },
+        { "addpd", TOKEN_INSN, C_none, I_ADDPD },
+        { "addsd", TOKEN_INSN, C_none, I_ADDSD },
+        { "andnpd", TOKEN_INSN, C_none, I_ANDNPD },
+        { "andpd", TOKEN_INSN, C_none, I_ANDPD },
+        { "cmpeqpd", TOKEN_INSN, C_none, I_CMPEQPD },
+        { "cmpeqsd", TOKEN_INSN, C_none, I_CMPEQSD },
+        { "cmplepd", TOKEN_INSN, C_none, I_CMPLEPD },
+        { "cmplesd", TOKEN_INSN, C_none, I_CMPLESD },
+        { "cmpltpd", TOKEN_INSN, C_none, I_CMPLTPD },
+        { "cmpltsd", TOKEN_INSN, C_none, I_CMPLTSD },
+        { "cmpneqpd", TOKEN_INSN, C_none, I_CMPNEQPD },
+        { "cmpneqsd", TOKEN_INSN, C_none, I_CMPNEQSD },
+        { "cmpnlepd", TOKEN_INSN, C_none, I_CMPNLEPD },
+        { "cmpnlesd", TOKEN_INSN, C_none, I_CMPNLESD },
+        { "cmpnltpd", TOKEN_INSN, C_none, I_CMPNLTPD },
+        { "cmpnltsd", TOKEN_INSN, C_none, I_CMPNLTSD },
+        { "cmpordpd", TOKEN_INSN, C_none, I_CMPORDPD },
+        { "cmpordsd", TOKEN_INSN, C_none, I_CMPORDSD },
+        { "cmpunordpd", TOKEN_INSN, C_none, I_CMPUNORDPD },
+        { "cmpunordsd", TOKEN_INSN, C_none, I_CMPUNORDSD },
+        { "cmppd", TOKEN_INSN, C_none, I_CMPPD },
+        { "comisd", TOKEN_INSN, C_none, I_COMISD },
+        { "cvtdq2pd", TOKEN_INSN, C_none, I_CVTDQ2PD },
+        { "cvtdq2ps", TOKEN_INSN, C_none, I_CVTDQ2PS },
+        { "cvtpd2dq", TOKEN_INSN, C_none, I_CVTPD2DQ },
+        { "cvtpd2pi", TOKEN_INSN, C_none, I_CVTPD2PI },
+        { "cvtpd2ps", TOKEN_INSN, C_none, I_CVTPD2PS },
+        { "cvtpi2pd", TOKEN_INSN, C_none, I_CVTPI2PD },
+        { "cvtps2dq", TOKEN_INSN, C_none, I_CVTPS2DQ },
+        { "cvtps2pd", TOKEN_INSN, C_none, I_CVTPS2PD },
+        { "cvtsd2si", TOKEN_INSN, C_none, I_CVTSD2SI },
+        { "cvtsd2ss", TOKEN_INSN, C_none, I_CVTSD2SS },
+        { "cvtsi2sd", TOKEN_INSN, C_none, I_CVTSI2SD },
+        { "cvtss2sd", TOKEN_INSN, C_none, I_CVTSS2SD },
+        { "cvttpd2pi", TOKEN_INSN, C_none, I_CVTTPD2PI },
+        { "cvttpd2dq", TOKEN_INSN, C_none, I_CVTTPD2DQ },
+        { "cvttps2dq", TOKEN_INSN, C_none, I_CVTTPS2DQ },
+        { "cvttsd2si", TOKEN_INSN, C_none, I_CVTTSD2SI },
+        { "divpd", TOKEN_INSN, C_none, I_DIVPD },
+        { "divsd", TOKEN_INSN, C_none, I_DIVSD },
+        { "maxpd", TOKEN_INSN, C_none, I_MAXPD },
+        { "maxsd", TOKEN_INSN, C_none, I_MAXSD },
+        { "minpd", TOKEN_INSN, C_none, I_MINPD },
+        { "minsd", TOKEN_INSN, C_none, I_MINSD },
+        { "movapd", TOKEN_INSN, C_none, I_MOVAPD },
+        { "movhpd", TOKEN_INSN, C_none, I_MOVHPD },
+        { "movlpd", TOKEN_INSN, C_none, I_MOVLPD },
+        { "movmskpd", TOKEN_INSN, C_none, I_MOVMSKPD },
+        { "movupd", TOKEN_INSN, C_none, I_MOVUPD },
+        { "mulpd", TOKEN_INSN, C_none, I_MULPD },
+        { "mulsd", TOKEN_INSN, C_none, I_MULSD },
+        { "orpd", TOKEN_INSN, C_none, I_ORPD },
+        { "shufpd", TOKEN_INSN, C_none, I_SHUFPD },
+        { "sqrtpd", TOKEN_INSN, C_none, I_SQRTPD },
+        { "sqrtsd", TOKEN_INSN, C_none, I_SQRTSD },
+        { "subpd", TOKEN_INSN, C_none, I_SUBPD },
+        { "subsd", TOKEN_INSN, C_none, I_SUBSD },
+        { "ucomisd", TOKEN_INSN, C_none, I_UCOMISD },
+        { "unpckhpd", TOKEN_INSN, C_none, I_UNPCKHPD },
+        { "unpcklpd", TOKEN_INSN, C_none, I_UNPCKLPD },
+        { "xorpd", TOKEN_INSN, C_none, I_XORPD },
+        { "addsubpd", TOKEN_INSN, C_none, I_ADDSUBPD },
+        { "addsubps", TOKEN_INSN, C_none, I_ADDSUBPS },
+        { "haddpd", TOKEN_INSN, C_none, I_HADDPD },
+        { "haddps", TOKEN_INSN, C_none, I_HADDPS },
+        { "hsubpd", TOKEN_INSN, C_none, I_HSUBPD },
+        { "hsubps", TOKEN_INSN, C_none, I_HSUBPS },
+        { "lddqu", TOKEN_INSN, C_none, I_LDDQU },
+        { "movddup", TOKEN_INSN, C_none, I_MOVDDUP },
+        { "movshdup", TOKEN_INSN, C_none, I_MOVSHDUP },
+        { "movsldup", TOKEN_INSN, C_none, I_MOVSLDUP },
+        { "vmcall", TOKEN_INSN, C_none, I_VMCALL },
+        { "vmclear", TOKEN_INSN, C_none, I_VMCLEAR },
+        { "vmlaunch", TOKEN_INSN, C_none, I_VMLAUNCH },
+        { "vmload", TOKEN_INSN, C_none, I_VMLOAD },
+        { "vmmcall", TOKEN_INSN, C_none, I_VMMCALL },
+        { "vmptrld", TOKEN_INSN, C_none, I_VMPTRLD },
+        { "vmptrst", TOKEN_INSN, C_none, I_VMPTRST },
+        { "vmread", TOKEN_INSN, C_none, I_VMREAD },
+        { "vmresume", TOKEN_INSN, C_none, I_VMRESUME },
+        { "vmrun", TOKEN_INSN, C_none, I_VMRUN },
+        { "vmsave", TOKEN_INSN, C_none, I_VMSAVE },
+        { "vmwrite", TOKEN_INSN, C_none, I_VMWRITE },
+        { "vmxoff", TOKEN_INSN, C_none, I_VMXOFF },
+        { "vmxon", TOKEN_INSN, C_none, I_VMXON },
+        { "invept", TOKEN_INSN, C_none, I_INVEPT },
+        { "invvpid", TOKEN_INSN, C_none, I_INVVPID },
+        { "pabsb", TOKEN_INSN, C_none, I_PABSB },
+        { "pabsw", TOKEN_INSN, C_none, I_PABSW },
+        { "pabsd", TOKEN_INSN, C_none, I_PABSD },
+        { "palignr", TOKEN_INSN, C_none, I_PALIGNR },
+        { "phaddw", TOKEN_INSN, C_none, I_PHADDW },
+        { "phaddd", TOKEN_INSN, C_none, I_PHADDD },
+        { "phaddsw", TOKEN_INSN, C_none, I_PHADDSW },
+        { "phsubw", TOKEN_INSN, C_none, I_PHSUBW },
+        { "phsubd", TOKEN_INSN, C_none, I_PHSUBD },
+        { "phsubsw", TOKEN_INSN, C_none, I_PHSUBSW },
+        { "pmaddubsw", TOKEN_INSN, C_none, I_PMADDUBSW },
+        { "pmulhrsw", TOKEN_INSN, C_none, I_PMULHRSW },
+        { "pshufb", TOKEN_INSN, C_none, I_PSHUFB },
+        { "psignb", TOKEN_INSN, C_none, I_PSIGNB },
+        { "psignw", TOKEN_INSN, C_none, I_PSIGNW },
+        { "psignd", TOKEN_INSN, C_none, I_PSIGND },
+        { "extrq", TOKEN_INSN, C_none, I_EXTRQ },
+        { "insertq", TOKEN_INSN, C_none, I_INSERTQ },
+        { "movntsd", TOKEN_INSN, C_none, I_MOVNTSD },
+        { "movntss", TOKEN_INSN, C_none, I_MOVNTSS },
+        { "lzcnt", TOKEN_INSN, C_none, I_LZCNT },
+        { "blendpd", TOKEN_INSN, C_none, I_BLENDPD },
+        { "blendps", TOKEN_INSN, C_none, I_BLENDPS },
+        { "blendvpd", TOKEN_INSN, C_none, I_BLENDVPD },
+        { "blendvps", TOKEN_INSN, C_none, I_BLENDVPS },
+        { "dppd", TOKEN_INSN, C_none, I_DPPD },
+        { "dpps", TOKEN_INSN, C_none, I_DPPS },
+        { "extractps", TOKEN_INSN, C_none, I_EXTRACTPS },
+        { "insertps", TOKEN_INSN, C_none, I_INSERTPS },
+        { "movntdqa", TOKEN_INSN, C_none, I_MOVNTDQA },
+        { "mpsadbw", TOKEN_INSN, C_none, I_MPSADBW },
+        { "packusdw", TOKEN_INSN, C_none, I_PACKUSDW },
+        { "pblendvb", TOKEN_INSN, C_none, I_PBLENDVB },
+        { "pblendw", TOKEN_INSN, C_none, I_PBLENDW },
+        { "pcmpeqq", TOKEN_INSN, C_none, I_PCMPEQQ },
+        { "pextrb", TOKEN_INSN, C_none, I_PEXTRB },
+        { "pextrd", TOKEN_INSN, C_none, I_PEXTRD },
+        { "pextrq", TOKEN_INSN, C_none, I_PEXTRQ },
+        { "phminposuw", TOKEN_INSN, C_none, I_PHMINPOSUW },
+        { "pinsrb", TOKEN_INSN, C_none, I_PINSRB },
+        { "pinsrd", TOKEN_INSN, C_none, I_PINSRD },
+        { "pinsrq", TOKEN_INSN, C_none, I_PINSRQ },
+        { "pmaxsb", TOKEN_INSN, C_none, I_PMAXSB },
+        { "pmaxsd", TOKEN_INSN, C_none, I_PMAXSD },
+        { "pmaxud", TOKEN_INSN, C_none, I_PMAXUD },
+        { "pmaxuw", TOKEN_INSN, C_none, I_PMAXUW },
+        { "pminsb", TOKEN_INSN, C_none, I_PMINSB },
+        { "pminsd", TOKEN_INSN, C_none, I_PMINSD },
+        { "pminud", TOKEN_INSN, C_none, I_PMINUD },
+        { "pminuw", TOKEN_INSN, C_none, I_PMINUW },
+        { "pmovsxbw", TOKEN_INSN, C_none, I_PMOVSXBW },
+        { "pmovsxbd", TOKEN_INSN, C_none, I_PMOVSXBD },
+        { "pmovsxbq", TOKEN_INSN, C_none, I_PMOVSXBQ },
+        { "pmovsxwd", TOKEN_INSN, C_none, I_PMOVSXWD },
+        { "pmovsxwq", TOKEN_INSN, C_none, I_PMOVSXWQ },
+        { "pmovsxdq", TOKEN_INSN, C_none, I_PMOVSXDQ },
+        { "pmovzxbw", TOKEN_INSN, C_none, I_PMOVZXBW },
+        { "pmovzxbd", TOKEN_INSN, C_none, I_PMOVZXBD },
+        { "pmovzxbq", TOKEN_INSN, C_none, I_PMOVZXBQ },
+        { "pmovzxwd", TOKEN_INSN, C_none, I_PMOVZXWD },
+        { "pmovzxwq", TOKEN_INSN, C_none, I_PMOVZXWQ },
+        { "pmovzxdq", TOKEN_INSN, C_none, I_PMOVZXDQ },
+        { "pmuldq", TOKEN_INSN, C_none, I_PMULDQ },
+        { "pmulld", TOKEN_INSN, C_none, I_PMULLD },
+        { "ptest", TOKEN_INSN, C_none, I_PTEST },
+        { "roundpd", TOKEN_INSN, C_none, I_ROUNDPD },
+        { "roundps", TOKEN_INSN, C_none, I_ROUNDPS },
+        { "roundsd", TOKEN_INSN, C_none, I_ROUNDSD },
+        { "roundss", TOKEN_INSN, C_none, I_ROUNDSS },
+        { "crc32", TOKEN_INSN, C_none, I_CRC32 },
+        { "pcmpestri", TOKEN_INSN, C_none, I_PCMPESTRI },
+        { "pcmpestrm", TOKEN_INSN, C_none, I_PCMPESTRM },
+        { "pcmpistri", TOKEN_INSN, C_none, I_PCMPISTRI },
+        { "pcmpistrm", TOKEN_INSN, C_none, I_PCMPISTRM },
+        { "pcmpgtq", TOKEN_INSN, C_none, I_PCMPGTQ },
+        { "popcnt", TOKEN_INSN, C_none, I_POPCNT },
+        { "getsec", TOKEN_INSN, C_none, I_GETSEC },
+        { "pfrcpv", TOKEN_INSN, C_none, I_PFRCPV },
+        { "pfrsqrtv", TOKEN_INSN, C_none, I_PFRSQRTV },
+        { "movbe", TOKEN_INSN, C_none, I_MOVBE },
+        { "aesenc", TOKEN_INSN, C_none, I_AESENC },
+        { "aesenclast", TOKEN_INSN, C_none, I_AESENCLAST },
+        { "aesdec", TOKEN_INSN, C_none, I_AESDEC },
+        { "aesdeclast", TOKEN_INSN, C_none, I_AESDECLAST },
+        { "aesimc", TOKEN_INSN, C_none, I_AESIMC },
+        { "aeskeygenassist", TOKEN_INSN, C_none, I_AESKEYGENASSIST },
+        { "vaesenc", TOKEN_INSN, C_none, I_VAESENC },
+        { "vaesenclast", TOKEN_INSN, C_none, I_VAESENCLAST },
+        { "vaesdec", TOKEN_INSN, C_none, I_VAESDEC },
+        { "vaesdeclast", TOKEN_INSN, C_none, I_VAESDECLAST },
+        { "vaesimc", TOKEN_INSN, C_none, I_VAESIMC },
+        { "vaeskeygenassist", TOKEN_INSN, C_none, I_VAESKEYGENASSIST },
+        { "vaddpd", TOKEN_INSN, C_none, I_VADDPD },
+        { "vaddps", TOKEN_INSN, C_none, I_VADDPS },
+        { "vaddsd", TOKEN_INSN, C_none, I_VADDSD },
+        { "vaddss", TOKEN_INSN, C_none, I_VADDSS },
+        { "vaddsubpd", TOKEN_INSN, C_none, I_VADDSUBPD },
+        { "vaddsubps", TOKEN_INSN, C_none, I_VADDSUBPS },
+        { "vandpd", TOKEN_INSN, C_none, I_VANDPD },
+        { "vandps", TOKEN_INSN, C_none, I_VANDPS },
+        { "vandnpd", TOKEN_INSN, C_none, I_VANDNPD },
+        { "vandnps", TOKEN_INSN, C_none, I_VANDNPS },
+        { "vblendpd", TOKEN_INSN, C_none, I_VBLENDPD },
+        { "vblendps", TOKEN_INSN, C_none, I_VBLENDPS },
+        { "vblendvpd", TOKEN_INSN, C_none, I_VBLENDVPD },
+        { "vblendvps", TOKEN_INSN, C_none, I_VBLENDVPS },
+        { "vbroadcastss", TOKEN_INSN, C_none, I_VBROADCASTSS },
+        { "vbroadcastsd", TOKEN_INSN, C_none, I_VBROADCASTSD },
+        { "vbroadcastf128", TOKEN_INSN, C_none, I_VBROADCASTF128 },
+        { "vcmpeqpd", TOKEN_INSN, C_none, I_VCMPEQPD },
+        { "vcmpltpd", TOKEN_INSN, C_none, I_VCMPLTPD },
+        { "vcmplepd", TOKEN_INSN, C_none, I_VCMPLEPD },
+        { "vcmpunordpd", TOKEN_INSN, C_none, I_VCMPUNORDPD },
+        { "vcmpneqpd", TOKEN_INSN, C_none, I_VCMPNEQPD },
+        { "vcmpnltpd", TOKEN_INSN, C_none, I_VCMPNLTPD },
+        { "vcmpnlepd", TOKEN_INSN, C_none, I_VCMPNLEPD },
+        { "vcmpordpd", TOKEN_INSN, C_none, I_VCMPORDPD },
+        { "vcmpeq_uqpd", TOKEN_INSN, C_none, I_VCMPEQ_UQPD },
+        { "vcmpngepd", TOKEN_INSN, C_none, I_VCMPNGEPD },
+        { "vcmpngtpd", TOKEN_INSN, C_none, I_VCMPNGTPD },
+        { "vcmpfalsepd", TOKEN_INSN, C_none, I_VCMPFALSEPD },
+        { "vcmpneq_oqpd", TOKEN_INSN, C_none, I_VCMPNEQ_OQPD },
+        { "vcmpgepd", TOKEN_INSN, C_none, I_VCMPGEPD },
+        { "vcmpgtpd", TOKEN_INSN, C_none, I_VCMPGTPD },
+        { "vcmptruepd", TOKEN_INSN, C_none, I_VCMPTRUEPD },
+        { "vcmpeq_ospd", TOKEN_INSN, C_none, I_VCMPEQ_OSPD },
+        { "vcmplt_oqpd", TOKEN_INSN, C_none, I_VCMPLT_OQPD },
+        { "vcmple_oqpd", TOKEN_INSN, C_none, I_VCMPLE_OQPD },
+        { "vcmpunord_spd", TOKEN_INSN, C_none, I_VCMPUNORD_SPD },
+        { "vcmpneq_uspd", TOKEN_INSN, C_none, I_VCMPNEQ_USPD },
+        { "vcmpnlt_uqpd", TOKEN_INSN, C_none, I_VCMPNLT_UQPD },
+        { "vcmpnle_uqpd", TOKEN_INSN, C_none, I_VCMPNLE_UQPD },
+        { "vcmpord_spd", TOKEN_INSN, C_none, I_VCMPORD_SPD },
+        { "vcmpeq_uspd", TOKEN_INSN, C_none, I_VCMPEQ_USPD },
+        { "vcmpnge_uqpd", TOKEN_INSN, C_none, I_VCMPNGE_UQPD },
+        { "vcmpngt_uqpd", TOKEN_INSN, C_none, I_VCMPNGT_UQPD },
+        { "vcmpfalse_ospd", TOKEN_INSN, C_none, I_VCMPFALSE_OSPD },
+        { "vcmpneq_ospd", TOKEN_INSN, C_none, I_VCMPNEQ_OSPD },
+        { "vcmpge_oqpd", TOKEN_INSN, C_none, I_VCMPGE_OQPD },
+        { "vcmpgt_oqpd", TOKEN_INSN, C_none, I_VCMPGT_OQPD },
+        { "vcmptrue_uspd", TOKEN_INSN, C_none, I_VCMPTRUE_USPD },
+        { "vcmppd", TOKEN_INSN, C_none, I_VCMPPD },
+        { "vcmpeqps", TOKEN_INSN, C_none, I_VCMPEQPS },
+        { "vcmpltps", TOKEN_INSN, C_none, I_VCMPLTPS },
+        { "vcmpleps", TOKEN_INSN, C_none, I_VCMPLEPS },
+        { "vcmpunordps", TOKEN_INSN, C_none, I_VCMPUNORDPS },
+        { "vcmpneqps", TOKEN_INSN, C_none, I_VCMPNEQPS },
+        { "vcmpnltps", TOKEN_INSN, C_none, I_VCMPNLTPS },
+        { "vcmpnleps", TOKEN_INSN, C_none, I_VCMPNLEPS },
+        { "vcmpordps", TOKEN_INSN, C_none, I_VCMPORDPS },
+        { "vcmpeq_uqps", TOKEN_INSN, C_none, I_VCMPEQ_UQPS },
+        { "vcmpngeps", TOKEN_INSN, C_none, I_VCMPNGEPS },
+        { "vcmpngtps", TOKEN_INSN, C_none, I_VCMPNGTPS },
+        { "vcmpfalseps", TOKEN_INSN, C_none, I_VCMPFALSEPS },
+        { "vcmpneq_oqps", TOKEN_INSN, C_none, I_VCMPNEQ_OQPS },
+        { "vcmpgeps", TOKEN_INSN, C_none, I_VCMPGEPS },
+        { "vcmpgtps", TOKEN_INSN, C_none, I_VCMPGTPS },
+        { "vcmptrueps", TOKEN_INSN, C_none, I_VCMPTRUEPS },
+        { "vcmpeq_osps", TOKEN_INSN, C_none, I_VCMPEQ_OSPS },
+        { "vcmplt_oqps", TOKEN_INSN, C_none, I_VCMPLT_OQPS },
+        { "vcmple_oqps", TOKEN_INSN, C_none, I_VCMPLE_OQPS },
+        { "vcmpunord_sps", TOKEN_INSN, C_none, I_VCMPUNORD_SPS },
+        { "vcmpneq_usps", TOKEN_INSN, C_none, I_VCMPNEQ_USPS },
+        { "vcmpnlt_uqps", TOKEN_INSN, C_none, I_VCMPNLT_UQPS },
+        { "vcmpnle_uqps", TOKEN_INSN, C_none, I_VCMPNLE_UQPS },
+        { "vcmpord_sps", TOKEN_INSN, C_none, I_VCMPORD_SPS },
+        { "vcmpeq_usps", TOKEN_INSN, C_none, I_VCMPEQ_USPS },
+        { "vcmpnge_uqps", TOKEN_INSN, C_none, I_VCMPNGE_UQPS },
+        { "vcmpngt_uqps", TOKEN_INSN, C_none, I_VCMPNGT_UQPS },
+        { "vcmpfalse_osps", TOKEN_INSN, C_none, I_VCMPFALSE_OSPS },
+        { "vcmpneq_osps", TOKEN_INSN, C_none, I_VCMPNEQ_OSPS },
+        { "vcmpge_oqps", TOKEN_INSN, C_none, I_VCMPGE_OQPS },
+        { "vcmpgt_oqps", TOKEN_INSN, C_none, I_VCMPGT_OQPS },
+        { "vcmptrue_usps", TOKEN_INSN, C_none, I_VCMPTRUE_USPS },
+        { "vcmpps", TOKEN_INSN, C_none, I_VCMPPS },
+        { "vcmpeqsd", TOKEN_INSN, C_none, I_VCMPEQSD },
+        { "vcmpltsd", TOKEN_INSN, C_none, I_VCMPLTSD },
+        { "vcmplesd", TOKEN_INSN, C_none, I_VCMPLESD },
+        { "vcmpunordsd", TOKEN_INSN, C_none, I_VCMPUNORDSD },
+        { "vcmpneqsd", TOKEN_INSN, C_none, I_VCMPNEQSD },
+        { "vcmpnltsd", TOKEN_INSN, C_none, I_VCMPNLTSD },
+        { "vcmpnlesd", TOKEN_INSN, C_none, I_VCMPNLESD },
+        { "vcmpordsd", TOKEN_INSN, C_none, I_VCMPORDSD },
+        { "vcmpeq_uqsd", TOKEN_INSN, C_none, I_VCMPEQ_UQSD },
+        { "vcmpngesd", TOKEN_INSN, C_none, I_VCMPNGESD },
+        { "vcmpngtsd", TOKEN_INSN, C_none, I_VCMPNGTSD },
+        { "vcmpfalsesd", TOKEN_INSN, C_none, I_VCMPFALSESD },
+        { "vcmpneq_oqsd", TOKEN_INSN, C_none, I_VCMPNEQ_OQSD },
+        { "vcmpgesd", TOKEN_INSN, C_none, I_VCMPGESD },
+        { "vcmpgtsd", TOKEN_INSN, C_none, I_VCMPGTSD },
+        { "vcmptruesd", TOKEN_INSN, C_none, I_VCMPTRUESD },
+        { "vcmpeq_ossd", TOKEN_INSN, C_none, I_VCMPEQ_OSSD },
+        { "vcmplt_oqsd", TOKEN_INSN, C_none, I_VCMPLT_OQSD },
+        { "vcmple_oqsd", TOKEN_INSN, C_none, I_VCMPLE_OQSD },
+        { "vcmpunord_ssd", TOKEN_INSN, C_none, I_VCMPUNORD_SSD },
+        { "vcmpneq_ussd", TOKEN_INSN, C_none, I_VCMPNEQ_USSD },
+        { "vcmpnlt_uqsd", TOKEN_INSN, C_none, I_VCMPNLT_UQSD },
+        { "vcmpnle_uqsd", TOKEN_INSN, C_none, I_VCMPNLE_UQSD },
+        { "vcmpord_ssd", TOKEN_INSN, C_none, I_VCMPORD_SSD },
+        { "vcmpeq_ussd", TOKEN_INSN, C_none, I_VCMPEQ_USSD },
+        { "vcmpnge_uqsd", TOKEN_INSN, C_none, I_VCMPNGE_UQSD },
+        { "vcmpngt_uqsd", TOKEN_INSN, C_none, I_VCMPNGT_UQSD },
+        { "vcmpfalse_ossd", TOKEN_INSN, C_none, I_VCMPFALSE_OSSD },
+        { "vcmpneq_ossd", TOKEN_INSN, C_none, I_VCMPNEQ_OSSD },
+        { "vcmpge_oqsd", TOKEN_INSN, C_none, I_VCMPGE_OQSD },
+        { "vcmpgt_oqsd", TOKEN_INSN, C_none, I_VCMPGT_OQSD },
+        { "vcmptrue_ussd", TOKEN_INSN, C_none, I_VCMPTRUE_USSD },
+        { "vcmpsd", TOKEN_INSN, C_none, I_VCMPSD },
+        { "vcmpeqss", TOKEN_INSN, C_none, I_VCMPEQSS },
+        { "vcmpltss", TOKEN_INSN, C_none, I_VCMPLTSS },
+        { "vcmpless", TOKEN_INSN, C_none, I_VCMPLESS },
+        { "vcmpunordss", TOKEN_INSN, C_none, I_VCMPUNORDSS },
+        { "vcmpneqss", TOKEN_INSN, C_none, I_VCMPNEQSS },
+        { "vcmpnltss", TOKEN_INSN, C_none, I_VCMPNLTSS },
+        { "vcmpnless", TOKEN_INSN, C_none, I_VCMPNLESS },
+        { "vcmpordss", TOKEN_INSN, C_none, I_VCMPORDSS },
+        { "vcmpeq_uqss", TOKEN_INSN, C_none, I_VCMPEQ_UQSS },
+        { "vcmpngess", TOKEN_INSN, C_none, I_VCMPNGESS },
+        { "vcmpngtss", TOKEN_INSN, C_none, I_VCMPNGTSS },
+        { "vcmpfalsess", TOKEN_INSN, C_none, I_VCMPFALSESS },
+        { "vcmpneq_oqss", TOKEN_INSN, C_none, I_VCMPNEQ_OQSS },
+        { "vcmpgess", TOKEN_INSN, C_none, I_VCMPGESS },
+        { "vcmpgtss", TOKEN_INSN, C_none, I_VCMPGTSS },
+        { "vcmptruess", TOKEN_INSN, C_none, I_VCMPTRUESS },
+        { "vcmpeq_osss", TOKEN_INSN, C_none, I_VCMPEQ_OSSS },
+        { "vcmplt_oqss", TOKEN_INSN, C_none, I_VCMPLT_OQSS },
+        { "vcmple_oqss", TOKEN_INSN, C_none, I_VCMPLE_OQSS },
+        { "vcmpunord_sss", TOKEN_INSN, C_none, I_VCMPUNORD_SSS },
+        { "vcmpneq_usss", TOKEN_INSN, C_none, I_VCMPNEQ_USSS },
+        { "vcmpnlt_uqss", TOKEN_INSN, C_none, I_VCMPNLT_UQSS },
+        { "vcmpnle_uqss", TOKEN_INSN, C_none, I_VCMPNLE_UQSS },
+        { "vcmpord_sss", TOKEN_INSN, C_none, I_VCMPORD_SSS },
+        { "vcmpeq_usss", TOKEN_INSN, C_none, I_VCMPEQ_USSS },
+        { "vcmpnge_uqss", TOKEN_INSN, C_none, I_VCMPNGE_UQSS },
+        { "vcmpngt_uqss", TOKEN_INSN, C_none, I_VCMPNGT_UQSS },
+        { "vcmpfalse_osss", TOKEN_INSN, C_none, I_VCMPFALSE_OSSS },
+        { "vcmpneq_osss", TOKEN_INSN, C_none, I_VCMPNEQ_OSSS },
+        { "vcmpge_oqss", TOKEN_INSN, C_none, I_VCMPGE_OQSS },
+        { "vcmpgt_oqss", TOKEN_INSN, C_none, I_VCMPGT_OQSS },
+        { "vcmptrue_usss", TOKEN_INSN, C_none, I_VCMPTRUE_USSS },
+        { "vcmpss", TOKEN_INSN, C_none, I_VCMPSS },
+        { "vcomisd", TOKEN_INSN, C_none, I_VCOMISD },
+        { "vcomiss", TOKEN_INSN, C_none, I_VCOMISS },
+        { "vcvtdq2pd", TOKEN_INSN, C_none, I_VCVTDQ2PD },
+        { "vcvtdq2ps", TOKEN_INSN, C_none, I_VCVTDQ2PS },
+        { "vcvtpd2dq", TOKEN_INSN, C_none, I_VCVTPD2DQ },
+        { "vcvtpd2ps", TOKEN_INSN, C_none, I_VCVTPD2PS },
+        { "vcvtps2dq", TOKEN_INSN, C_none, I_VCVTPS2DQ },
+        { "vcvtps2pd", TOKEN_INSN, C_none, I_VCVTPS2PD },
+        { "vcvtsd2si", TOKEN_INSN, C_none, I_VCVTSD2SI },
+        { "vcvtsd2ss", TOKEN_INSN, C_none, I_VCVTSD2SS },
+        { "vcvtsi2sd", TOKEN_INSN, C_none, I_VCVTSI2SD },
+        { "vcvtsi2ss", TOKEN_INSN, C_none, I_VCVTSI2SS },
+        { "vcvtss2sd", TOKEN_INSN, C_none, I_VCVTSS2SD },
+        { "vcvtss2si", TOKEN_INSN, C_none, I_VCVTSS2SI },
+        { "vcvttpd2dq", TOKEN_INSN, C_none, I_VCVTTPD2DQ },
+        { "vcvttps2dq", TOKEN_INSN, C_none, I_VCVTTPS2DQ },
+        { "vcvttsd2si", TOKEN_INSN, C_none, I_VCVTTSD2SI },
+        { "vcvttss2si", TOKEN_INSN, C_none, I_VCVTTSS2SI },
+        { "vdivpd", TOKEN_INSN, C_none, I_VDIVPD },
+        { "vdivps", TOKEN_INSN, C_none, I_VDIVPS },
+        { "vdivsd", TOKEN_INSN, C_none, I_VDIVSD },
+        { "vdivss", TOKEN_INSN, C_none, I_VDIVSS },
+        { "vdppd", TOKEN_INSN, C_none, I_VDPPD },
+        { "vdpps", TOKEN_INSN, C_none, I_VDPPS },
+        { "vextractf128", TOKEN_INSN, C_none, I_VEXTRACTF128 },
+        { "vextractps", TOKEN_INSN, C_none, I_VEXTRACTPS },
+        { "vhaddpd", TOKEN_INSN, C_none, I_VHADDPD },
+        { "vhaddps", TOKEN_INSN, C_none, I_VHADDPS },
+        { "vhsubpd", TOKEN_INSN, C_none, I_VHSUBPD },
+        { "vhsubps", TOKEN_INSN, C_none, I_VHSUBPS },
+        { "vinsertf128", TOKEN_INSN, C_none, I_VINSERTF128 },
+        { "vinsertps", TOKEN_INSN, C_none, I_VINSERTPS },
+        { "vlddqu", TOKEN_INSN, C_none, I_VLDDQU },
+        { "vldqqu", TOKEN_INSN, C_none, I_VLDQQU },
+        { "vldmxcsr", TOKEN_INSN, C_none, I_VLDMXCSR },
+        { "vmaskmovdqu", TOKEN_INSN, C_none, I_VMASKMOVDQU },
+        { "vmaskmovps", TOKEN_INSN, C_none, I_VMASKMOVPS },
+        { "vmaskmovpd", TOKEN_INSN, C_none, I_VMASKMOVPD },
+        { "vmaxpd", TOKEN_INSN, C_none, I_VMAXPD },
+        { "vmaxps", TOKEN_INSN, C_none, I_VMAXPS },
+        { "vmaxsd", TOKEN_INSN, C_none, I_VMAXSD },
+        { "vmaxss", TOKEN_INSN, C_none, I_VMAXSS },
+        { "vminpd", TOKEN_INSN, C_none, I_VMINPD },
+        { "vminps", TOKEN_INSN, C_none, I_VMINPS },
+        { "vminsd", TOKEN_INSN, C_none, I_VMINSD },
+        { "vminss", TOKEN_INSN, C_none, I_VMINSS },
+        { "vmovapd", TOKEN_INSN, C_none, I_VMOVAPD },
+        { "vmovaps", TOKEN_INSN, C_none, I_VMOVAPS },
+        { "vmovq", TOKEN_INSN, C_none, I_VMOVQ },
+        { "vmovd", TOKEN_INSN, C_none, I_VMOVD },
+        { "vmovddup", TOKEN_INSN, C_none, I_VMOVDDUP },
+        { "vmovdqa", TOKEN_INSN, C_none, I_VMOVDQA },
+        { "vmovqqa", TOKEN_INSN, C_none, I_VMOVQQA },
+        { "vmovdqu", TOKEN_INSN, C_none, I_VMOVDQU },
+        { "vmovqqu", TOKEN_INSN, C_none, I_VMOVQQU },
+        { "vmovhlps", TOKEN_INSN, C_none, I_VMOVHLPS },
+        { "vmovhpd", TOKEN_INSN, C_none, I_VMOVHPD },
+        { "vmovhps", TOKEN_INSN, C_none, I_VMOVHPS },
+        { "vmovlhps", TOKEN_INSN, C_none, I_VMOVLHPS },
+        { "vmovlpd", TOKEN_INSN, C_none, I_VMOVLPD },
+        { "vmovlps", TOKEN_INSN, C_none, I_VMOVLPS },
+        { "vmovmskpd", TOKEN_INSN, C_none, I_VMOVMSKPD },
+        { "vmovmskps", TOKEN_INSN, C_none, I_VMOVMSKPS },
+        { "vmovntdq", TOKEN_INSN, C_none, I_VMOVNTDQ },
+        { "vmovntqq", TOKEN_INSN, C_none, I_VMOVNTQQ },
+        { "vmovntdqa", TOKEN_INSN, C_none, I_VMOVNTDQA },
+        { "vmovntpd", TOKEN_INSN, C_none, I_VMOVNTPD },
+        { "vmovntps", TOKEN_INSN, C_none, I_VMOVNTPS },
+        { "vmovsd", TOKEN_INSN, C_none, I_VMOVSD },
+        { "vmovshdup", TOKEN_INSN, C_none, I_VMOVSHDUP },
+        { "vmovsldup", TOKEN_INSN, C_none, I_VMOVSLDUP },
+        { "vmovss", TOKEN_INSN, C_none, I_VMOVSS },
+        { "vmovupd", TOKEN_INSN, C_none, I_VMOVUPD },
+        { "vmovups", TOKEN_INSN, C_none, I_VMOVUPS },
+        { "vmpsadbw", TOKEN_INSN, C_none, I_VMPSADBW },
+        { "vmulpd", TOKEN_INSN, C_none, I_VMULPD },
+        { "vmulps", TOKEN_INSN, C_none, I_VMULPS },
+        { "vmulsd", TOKEN_INSN, C_none, I_VMULSD },
+        { "vmulss", TOKEN_INSN, C_none, I_VMULSS },
+        { "vorpd", TOKEN_INSN, C_none, I_VORPD },
+        { "vorps", TOKEN_INSN, C_none, I_VORPS },
+        { "vpabsb", TOKEN_INSN, C_none, I_VPABSB },
+        { "vpabsw", TOKEN_INSN, C_none, I_VPABSW },
+        { "vpabsd", TOKEN_INSN, C_none, I_VPABSD },
+        { "vpacksswb", TOKEN_INSN, C_none, I_VPACKSSWB },
+        { "vpackssdw", TOKEN_INSN, C_none, I_VPACKSSDW },
+        { "vpackuswb", TOKEN_INSN, C_none, I_VPACKUSWB },
+        { "vpackusdw", TOKEN_INSN, C_none, I_VPACKUSDW },
+        { "vpaddb", TOKEN_INSN, C_none, I_VPADDB },
+        { "vpaddw", TOKEN_INSN, C_none, I_VPADDW },
+        { "vpaddd", TOKEN_INSN, C_none, I_VPADDD },
+        { "vpaddq", TOKEN_INSN, C_none, I_VPADDQ },
+        { "vpaddsb", TOKEN_INSN, C_none, I_VPADDSB },
+        { "vpaddsw", TOKEN_INSN, C_none, I_VPADDSW },
+        { "vpaddusb", TOKEN_INSN, C_none, I_VPADDUSB },
+        { "vpaddusw", TOKEN_INSN, C_none, I_VPADDUSW },
+        { "vpalignr", TOKEN_INSN, C_none, I_VPALIGNR },
+        { "vpand", TOKEN_INSN, C_none, I_VPAND },
+        { "vpandn", TOKEN_INSN, C_none, I_VPANDN },
+        { "vpavgb", TOKEN_INSN, C_none, I_VPAVGB },
+        { "vpavgw", TOKEN_INSN, C_none, I_VPAVGW },
+        { "vpblendvb", TOKEN_INSN, C_none, I_VPBLENDVB },
+        { "vpblendw", TOKEN_INSN, C_none, I_VPBLENDW },
+        { "vpcmpestri", TOKEN_INSN, C_none, I_VPCMPESTRI },
+        { "vpcmpestrm", TOKEN_INSN, C_none, I_VPCMPESTRM },
+        { "vpcmpistri", TOKEN_INSN, C_none, I_VPCMPISTRI },
+        { "vpcmpistrm", TOKEN_INSN, C_none, I_VPCMPISTRM },
+        { "vpcmpeqb", TOKEN_INSN, C_none, I_VPCMPEQB },
+        { "vpcmpeqw", TOKEN_INSN, C_none, I_VPCMPEQW },
+        { "vpcmpeqd", TOKEN_INSN, C_none, I_VPCMPEQD },
+        { "vpcmpeqq", TOKEN_INSN, C_none, I_VPCMPEQQ },
+        { "vpcmpgtb", TOKEN_INSN, C_none, I_VPCMPGTB },
+        { "vpcmpgtw", TOKEN_INSN, C_none, I_VPCMPGTW },
+        { "vpcmpgtd", TOKEN_INSN, C_none, I_VPCMPGTD },
+        { "vpcmpgtq", TOKEN_INSN, C_none, I_VPCMPGTQ },
+        { "vpermilpd", TOKEN_INSN, C_none, I_VPERMILPD },
+        { "vpermiltd2pd", TOKEN_INSN, C_none, I_VPERMILTD2PD },
+        { "vpermilmo2pd", TOKEN_INSN, C_none, I_VPERMILMO2PD },
+        { "vpermilmz2pd", TOKEN_INSN, C_none, I_VPERMILMZ2PD },
+        { "vpermil2pd", TOKEN_INSN, C_none, I_VPERMIL2PD },
+        { "vpermilps", TOKEN_INSN, C_none, I_VPERMILPS },
+        { "vpermiltd2ps", TOKEN_INSN, C_none, I_VPERMILTD2PS },
+        { "vpermilmo2ps", TOKEN_INSN, C_none, I_VPERMILMO2PS },
+        { "vpermilmz2ps", TOKEN_INSN, C_none, I_VPERMILMZ2PS },
+        { "vpermil2ps", TOKEN_INSN, C_none, I_VPERMIL2PS },
+        { "vperm2f128", TOKEN_INSN, C_none, I_VPERM2F128 },
+        { "vpextrb", TOKEN_INSN, C_none, I_VPEXTRB },
+        { "vpextrw", TOKEN_INSN, C_none, I_VPEXTRW },
+        { "vpextrd", TOKEN_INSN, C_none, I_VPEXTRD },
+        { "vpextrq", TOKEN_INSN, C_none, I_VPEXTRQ },
+        { "vphaddw", TOKEN_INSN, C_none, I_VPHADDW },
+        { "vphaddd", TOKEN_INSN, C_none, I_VPHADDD },
+        { "vphaddsw", TOKEN_INSN, C_none, I_VPHADDSW },
+        { "vphminposuw", TOKEN_INSN, C_none, I_VPHMINPOSUW },
+        { "vphsubw", TOKEN_INSN, C_none, I_VPHSUBW },
+        { "vphsubd", TOKEN_INSN, C_none, I_VPHSUBD },
+        { "vphsubsw", TOKEN_INSN, C_none, I_VPHSUBSW },
+        { "vpinsrb", TOKEN_INSN, C_none, I_VPINSRB },
+        { "vpinsrw", TOKEN_INSN, C_none, I_VPINSRW },
+        { "vpinsrd", TOKEN_INSN, C_none, I_VPINSRD },
+        { "vpinsrq", TOKEN_INSN, C_none, I_VPINSRQ },
+        { "vpmaddwd", TOKEN_INSN, C_none, I_VPMADDWD },
+        { "vpmaddubsw", TOKEN_INSN, C_none, I_VPMADDUBSW },
+        { "vpmaxsb", TOKEN_INSN, C_none, I_VPMAXSB },
+        { "vpmaxsw", TOKEN_INSN, C_none, I_VPMAXSW },
+        { "vpmaxsd", TOKEN_INSN, C_none, I_VPMAXSD },
+        { "vpmaxub", TOKEN_INSN, C_none, I_VPMAXUB },
+        { "vpmaxuw", TOKEN_INSN, C_none, I_VPMAXUW },
+        { "vpmaxud", TOKEN_INSN, C_none, I_VPMAXUD },
+        { "vpminsb", TOKEN_INSN, C_none, I_VPMINSB },
+        { "vpminsw", TOKEN_INSN, C_none, I_VPMINSW },
+        { "vpminsd", TOKEN_INSN, C_none, I_VPMINSD },
+        { "vpminub", TOKEN_INSN, C_none, I_VPMINUB },
+        { "vpminuw", TOKEN_INSN, C_none, I_VPMINUW },
+        { "vpminud", TOKEN_INSN, C_none, I_VPMINUD },
+        { "vpmovmskb", TOKEN_INSN, C_none, I_VPMOVMSKB },
+        { "vpmovsxbw", TOKEN_INSN, C_none, I_VPMOVSXBW },
+        { "vpmovsxbd", TOKEN_INSN, C_none, I_VPMOVSXBD },
+        { "vpmovsxbq", TOKEN_INSN, C_none, I_VPMOVSXBQ },
+        { "vpmovsxwd", TOKEN_INSN, C_none, I_VPMOVSXWD },
+        { "vpmovsxwq", TOKEN_INSN, C_none, I_VPMOVSXWQ },
+        { "vpmovsxdq", TOKEN_INSN, C_none, I_VPMOVSXDQ },
+        { "vpmovzxbw", TOKEN_INSN, C_none, I_VPMOVZXBW },
+        { "vpmovzxbd", TOKEN_INSN, C_none, I_VPMOVZXBD },
+        { "vpmovzxbq", TOKEN_INSN, C_none, I_VPMOVZXBQ },
+        { "vpmovzxwd", TOKEN_INSN, C_none, I_VPMOVZXWD },
+        { "vpmovzxwq", TOKEN_INSN, C_none, I_VPMOVZXWQ },
+        { "vpmovzxdq", TOKEN_INSN, C_none, I_VPMOVZXDQ },
+        { "vpmulhuw", TOKEN_INSN, C_none, I_VPMULHUW },
+        { "vpmulhrsw", TOKEN_INSN, C_none, I_VPMULHRSW },
+        { "vpmulhw", TOKEN_INSN, C_none, I_VPMULHW },
+        { "vpmullw", TOKEN_INSN, C_none, I_VPMULLW },
+        { "vpmulld", TOKEN_INSN, C_none, I_VPMULLD },
+        { "vpmuludq", TOKEN_INSN, C_none, I_VPMULUDQ },
+        { "vpmuldq", TOKEN_INSN, C_none, I_VPMULDQ },
+        { "vpor", TOKEN_INSN, C_none, I_VPOR },
+        { "vpsadbw", TOKEN_INSN, C_none, I_VPSADBW },
+        { "vpshufb", TOKEN_INSN, C_none, I_VPSHUFB },
+        { "vpshufd", TOKEN_INSN, C_none, I_VPSHUFD },
+        { "vpshufhw", TOKEN_INSN, C_none, I_VPSHUFHW },
+        { "vpshuflw", TOKEN_INSN, C_none, I_VPSHUFLW },
+        { "vpsignb", TOKEN_INSN, C_none, I_VPSIGNB },
+        { "vpsignw", TOKEN_INSN, C_none, I_VPSIGNW },
+        { "vpsignd", TOKEN_INSN, C_none, I_VPSIGND },
+        { "vpslldq", TOKEN_INSN, C_none, I_VPSLLDQ },
+        { "vpsrldq", TOKEN_INSN, C_none, I_VPSRLDQ },
+        { "vpsllw", TOKEN_INSN, C_none, I_VPSLLW },
+        { "vpslld", TOKEN_INSN, C_none, I_VPSLLD },
+        { "vpsllq", TOKEN_INSN, C_none, I_VPSLLQ },
+        { "vpsraw", TOKEN_INSN, C_none, I_VPSRAW },
+        { "vpsrad", TOKEN_INSN, C_none, I_VPSRAD },
+        { "vpsrlw", TOKEN_INSN, C_none, I_VPSRLW },
+        { "vpsrld", TOKEN_INSN, C_none, I_VPSRLD },
+        { "vpsrlq", TOKEN_INSN, C_none, I_VPSRLQ },
+        { "vptest", TOKEN_INSN, C_none, I_VPTEST },
+        { "vpsubb", TOKEN_INSN, C_none, I_VPSUBB },
+        { "vpsubw", TOKEN_INSN, C_none, I_VPSUBW },
+        { "vpsubd", TOKEN_INSN, C_none, I_VPSUBD },
+        { "vpsubq", TOKEN_INSN, C_none, I_VPSUBQ },
+        { "vpsubsb", TOKEN_INSN, C_none, I_VPSUBSB },
+        { "vpsubsw", TOKEN_INSN, C_none, I_VPSUBSW },
+        { "vpsubusb", TOKEN_INSN, C_none, I_VPSUBUSB },
+        { "vpsubusw", TOKEN_INSN, C_none, I_VPSUBUSW },
+        { "vpunpckhbw", TOKEN_INSN, C_none, I_VPUNPCKHBW },
+        { "vpunpckhwd", TOKEN_INSN, C_none, I_VPUNPCKHWD },
+        { "vpunpckhdq", TOKEN_INSN, C_none, I_VPUNPCKHDQ },
+        { "vpunpckhqdq", TOKEN_INSN, C_none, I_VPUNPCKHQDQ },
+        { "vpunpcklbw", TOKEN_INSN, C_none, I_VPUNPCKLBW },
+        { "vpunpcklwd", TOKEN_INSN, C_none, I_VPUNPCKLWD },
+        { "vpunpckldq", TOKEN_INSN, C_none, I_VPUNPCKLDQ },
+        { "vpunpcklqdq", TOKEN_INSN, C_none, I_VPUNPCKLQDQ },
+        { "vpxor", TOKEN_INSN, C_none, I_VPXOR },
+        { "vrcpps", TOKEN_INSN, C_none, I_VRCPPS },
+        { "vrcpss", TOKEN_INSN, C_none, I_VRCPSS },
+        { "vrsqrtps", TOKEN_INSN, C_none, I_VRSQRTPS },
+        { "vrsqrtss", TOKEN_INSN, C_none, I_VRSQRTSS },
+        { "vroundpd", TOKEN_INSN, C_none, I_VROUNDPD },
+        { "vroundps", TOKEN_INSN, C_none, I_VROUNDPS },
+        { "vroundsd", TOKEN_INSN, C_none, I_VROUNDSD },
+        { "vroundss", TOKEN_INSN, C_none, I_VROUNDSS },
+        { "vshufpd", TOKEN_INSN, C_none, I_VSHUFPD },
+        { "vshufps", TOKEN_INSN, C_none, I_VSHUFPS },
+        { "vsqrtpd", TOKEN_INSN, C_none, I_VSQRTPD },
+        { "vsqrtps", TOKEN_INSN, C_none, I_VSQRTPS },
+        { "vsqrtsd", TOKEN_INSN, C_none, I_VSQRTSD },
+        { "vsqrtss", TOKEN_INSN, C_none, I_VSQRTSS },
+        { "vstmxcsr", TOKEN_INSN, C_none, I_VSTMXCSR },
+        { "vsubpd", TOKEN_INSN, C_none, I_VSUBPD },
+        { "vsubps", TOKEN_INSN, C_none, I_VSUBPS },
+        { "vsubsd", TOKEN_INSN, C_none, I_VSUBSD },
+        { "vsubss", TOKEN_INSN, C_none, I_VSUBSS },
+        { "vtestps", TOKEN_INSN, C_none, I_VTESTPS },
+        { "vtestpd", TOKEN_INSN, C_none, I_VTESTPD },
+        { "vucomisd", TOKEN_INSN, C_none, I_VUCOMISD },
+        { "vucomiss", TOKEN_INSN, C_none, I_VUCOMISS },
+        { "vunpckhpd", TOKEN_INSN, C_none, I_VUNPCKHPD },
+        { "vunpckhps", TOKEN_INSN, C_none, I_VUNPCKHPS },
+        { "vunpcklpd", TOKEN_INSN, C_none, I_VUNPCKLPD },
+        { "vunpcklps", TOKEN_INSN, C_none, I_VUNPCKLPS },
+        { "vxorpd", TOKEN_INSN, C_none, I_VXORPD },
+        { "vxorps", TOKEN_INSN, C_none, I_VXORPS },
+        { "vzeroall", TOKEN_INSN, C_none, I_VZEROALL },
+        { "vzeroupper", TOKEN_INSN, C_none, I_VZEROUPPER },
+        { "pclmullqlqdq", TOKEN_INSN, C_none, I_PCLMULLQLQDQ },
+        { "pclmulhqlqdq", TOKEN_INSN, C_none, I_PCLMULHQLQDQ },
+        { "pclmullqhqdq", TOKEN_INSN, C_none, I_PCLMULLQHQDQ },
+        { "pclmulhqhqdq", TOKEN_INSN, C_none, I_PCLMULHQHQDQ },
+        { "pclmulqdq", TOKEN_INSN, C_none, I_PCLMULQDQ },
+        { "vpclmullqlqdq", TOKEN_INSN, C_none, I_VPCLMULLQLQDQ },
+        { "vpclmulhqlqdq", TOKEN_INSN, C_none, I_VPCLMULHQLQDQ },
+        { "vpclmullqhqdq", TOKEN_INSN, C_none, I_VPCLMULLQHQDQ },
+        { "vpclmulhqhqdq", TOKEN_INSN, C_none, I_VPCLMULHQHQDQ },
+        { "vpclmulqdq", TOKEN_INSN, C_none, I_VPCLMULQDQ },
+        { "vfmadd132ps", TOKEN_INSN, C_none, I_VFMADD132PS },
+        { "vfmadd132pd", TOKEN_INSN, C_none, I_VFMADD132PD },
+        { "vfmadd312ps", TOKEN_INSN, C_none, I_VFMADD312PS },
+        { "vfmadd312pd", TOKEN_INSN, C_none, I_VFMADD312PD },
+        { "vfmadd213ps", TOKEN_INSN, C_none, I_VFMADD213PS },
+        { "vfmadd213pd", TOKEN_INSN, C_none, I_VFMADD213PD },
+        { "vfmadd123ps", TOKEN_INSN, C_none, I_VFMADD123PS },
+        { "vfmadd123pd", TOKEN_INSN, C_none, I_VFMADD123PD },
+        { "vfmadd231ps", TOKEN_INSN, C_none, I_VFMADD231PS },
+        { "vfmadd231pd", TOKEN_INSN, C_none, I_VFMADD231PD },
+        { "vfmadd321ps", TOKEN_INSN, C_none, I_VFMADD321PS },
+        { "vfmadd321pd", TOKEN_INSN, C_none, I_VFMADD321PD },
+        { "vfmaddsub132ps", TOKEN_INSN, C_none, I_VFMADDSUB132PS },
+        { "vfmaddsub132pd", TOKEN_INSN, C_none, I_VFMADDSUB132PD },
+        { "vfmaddsub312ps", TOKEN_INSN, C_none, I_VFMADDSUB312PS },
+        { "vfmaddsub312pd", TOKEN_INSN, C_none, I_VFMADDSUB312PD },
+        { "vfmaddsub213ps", TOKEN_INSN, C_none, I_VFMADDSUB213PS },
+        { "vfmaddsub213pd", TOKEN_INSN, C_none, I_VFMADDSUB213PD },
+        { "vfmaddsub123ps", TOKEN_INSN, C_none, I_VFMADDSUB123PS },
+        { "vfmaddsub123pd", TOKEN_INSN, C_none, I_VFMADDSUB123PD },
+        { "vfmaddsub231ps", TOKEN_INSN, C_none, I_VFMADDSUB231PS },
+        { "vfmaddsub231pd", TOKEN_INSN, C_none, I_VFMADDSUB231PD },
+        { "vfmaddsub321ps", TOKEN_INSN, C_none, I_VFMADDSUB321PS },
+        { "vfmaddsub321pd", TOKEN_INSN, C_none, I_VFMADDSUB321PD },
+        { "vfmsub132ps", TOKEN_INSN, C_none, I_VFMSUB132PS },
+        { "vfmsub132pd", TOKEN_INSN, C_none, I_VFMSUB132PD },
+        { "vfmsub312ps", TOKEN_INSN, C_none, I_VFMSUB312PS },
+        { "vfmsub312pd", TOKEN_INSN, C_none, I_VFMSUB312PD },
+        { "vfmsub213ps", TOKEN_INSN, C_none, I_VFMSUB213PS },
+        { "vfmsub213pd", TOKEN_INSN, C_none, I_VFMSUB213PD },
+        { "vfmsub123ps", TOKEN_INSN, C_none, I_VFMSUB123PS },
+        { "vfmsub123pd", TOKEN_INSN, C_none, I_VFMSUB123PD },
+        { "vfmsub231ps", TOKEN_INSN, C_none, I_VFMSUB231PS },
+        { "vfmsub231pd", TOKEN_INSN, C_none, I_VFMSUB231PD },
+        { "vfmsub321ps", TOKEN_INSN, C_none, I_VFMSUB321PS },
+        { "vfmsub321pd", TOKEN_INSN, C_none, I_VFMSUB321PD },
+        { "vfmsubadd132ps", TOKEN_INSN, C_none, I_VFMSUBADD132PS },
+        { "vfmsubadd132pd", TOKEN_INSN, C_none, I_VFMSUBADD132PD },
+        { "vfmsubadd312ps", TOKEN_INSN, C_none, I_VFMSUBADD312PS },
+        { "vfmsubadd312pd", TOKEN_INSN, C_none, I_VFMSUBADD312PD },
+        { "vfmsubadd213ps", TOKEN_INSN, C_none, I_VFMSUBADD213PS },
+        { "vfmsubadd213pd", TOKEN_INSN, C_none, I_VFMSUBADD213PD },
+        { "vfmsubadd123ps", TOKEN_INSN, C_none, I_VFMSUBADD123PS },
+        { "vfmsubadd123pd", TOKEN_INSN, C_none, I_VFMSUBADD123PD },
+        { "vfmsubadd231ps", TOKEN_INSN, C_none, I_VFMSUBADD231PS },
+        { "vfmsubadd231pd", TOKEN_INSN, C_none, I_VFMSUBADD231PD },
+        { "vfmsubadd321ps", TOKEN_INSN, C_none, I_VFMSUBADD321PS },
+        { "vfmsubadd321pd", TOKEN_INSN, C_none, I_VFMSUBADD321PD },
+        { "vfnmadd132ps", TOKEN_INSN, C_none, I_VFNMADD132PS },
+        { "vfnmadd132pd", TOKEN_INSN, C_none, I_VFNMADD132PD },
+        { "vfnmadd312ps", TOKEN_INSN, C_none, I_VFNMADD312PS },
+        { "vfnmadd312pd", TOKEN_INSN, C_none, I_VFNMADD312PD },
+        { "vfnmadd213ps", TOKEN_INSN, C_none, I_VFNMADD213PS },
+        { "vfnmadd213pd", TOKEN_INSN, C_none, I_VFNMADD213PD },
+        { "vfnmadd123ps", TOKEN_INSN, C_none, I_VFNMADD123PS },
+        { "vfnmadd123pd", TOKEN_INSN, C_none, I_VFNMADD123PD },
+        { "vfnmadd231ps", TOKEN_INSN, C_none, I_VFNMADD231PS },
+        { "vfnmadd231pd", TOKEN_INSN, C_none, I_VFNMADD231PD },
+        { "vfnmadd321ps", TOKEN_INSN, C_none, I_VFNMADD321PS },
+        { "vfnmadd321pd", TOKEN_INSN, C_none, I_VFNMADD321PD },
+        { "vfnmsub132ps", TOKEN_INSN, C_none, I_VFNMSUB132PS },
+        { "vfnmsub132pd", TOKEN_INSN, C_none, I_VFNMSUB132PD },
+        { "vfnmsub312ps", TOKEN_INSN, C_none, I_VFNMSUB312PS },
+        { "vfnmsub312pd", TOKEN_INSN, C_none, I_VFNMSUB312PD },
+        { "vfnmsub213ps", TOKEN_INSN, C_none, I_VFNMSUB213PS },
+        { "vfnmsub213pd", TOKEN_INSN, C_none, I_VFNMSUB213PD },
+        { "vfnmsub123ps", TOKEN_INSN, C_none, I_VFNMSUB123PS },
+        { "vfnmsub123pd", TOKEN_INSN, C_none, I_VFNMSUB123PD },
+        { "vfnmsub231ps", TOKEN_INSN, C_none, I_VFNMSUB231PS },
+        { "vfnmsub231pd", TOKEN_INSN, C_none, I_VFNMSUB231PD },
+        { "vfnmsub321ps", TOKEN_INSN, C_none, I_VFNMSUB321PS },
+        { "vfnmsub321pd", TOKEN_INSN, C_none, I_VFNMSUB321PD },
+        { "vfmadd132ss", TOKEN_INSN, C_none, I_VFMADD132SS },
+        { "vfmadd132sd", TOKEN_INSN, C_none, I_VFMADD132SD },
+        { "vfmadd312ss", TOKEN_INSN, C_none, I_VFMADD312SS },
+        { "vfmadd312sd", TOKEN_INSN, C_none, I_VFMADD312SD },
+        { "vfmadd213ss", TOKEN_INSN, C_none, I_VFMADD213SS },
+        { "vfmadd213sd", TOKEN_INSN, C_none, I_VFMADD213SD },
+        { "vfmadd123ss", TOKEN_INSN, C_none, I_VFMADD123SS },
+        { "vfmadd123sd", TOKEN_INSN, C_none, I_VFMADD123SD },
+        { "vfmadd231ss", TOKEN_INSN, C_none, I_VFMADD231SS },
+        { "vfmadd231sd", TOKEN_INSN, C_none, I_VFMADD231SD },
+        { "vfmadd321ss", TOKEN_INSN, C_none, I_VFMADD321SS },
+        { "vfmadd321sd", TOKEN_INSN, C_none, I_VFMADD321SD },
+        { "vfmsub132ss", TOKEN_INSN, C_none, I_VFMSUB132SS },
+        { "vfmsub132sd", TOKEN_INSN, C_none, I_VFMSUB132SD },
+        { "vfmsub312ss", TOKEN_INSN, C_none, I_VFMSUB312SS },
+        { "vfmsub312sd", TOKEN_INSN, C_none, I_VFMSUB312SD },
+        { "vfmsub213ss", TOKEN_INSN, C_none, I_VFMSUB213SS },
+        { "vfmsub213sd", TOKEN_INSN, C_none, I_VFMSUB213SD },
+        { "vfmsub123ss", TOKEN_INSN, C_none, I_VFMSUB123SS },
+        { "vfmsub123sd", TOKEN_INSN, C_none, I_VFMSUB123SD },
+        { "vfmsub231ss", TOKEN_INSN, C_none, I_VFMSUB231SS },
+        { "vfmsub231sd", TOKEN_INSN, C_none, I_VFMSUB231SD },
+        { "vfmsub321ss", TOKEN_INSN, C_none, I_VFMSUB321SS },
+        { "vfmsub321sd", TOKEN_INSN, C_none, I_VFMSUB321SD },
+        { "vfnmadd132ss", TOKEN_INSN, C_none, I_VFNMADD132SS },
+        { "vfnmadd132sd", TOKEN_INSN, C_none, I_VFNMADD132SD },
+        { "vfnmadd312ss", TOKEN_INSN, C_none, I_VFNMADD312SS },
+        { "vfnmadd312sd", TOKEN_INSN, C_none, I_VFNMADD312SD },
+        { "vfnmadd213ss", TOKEN_INSN, C_none, I_VFNMADD213SS },
+        { "vfnmadd213sd", TOKEN_INSN, C_none, I_VFNMADD213SD },
+        { "vfnmadd123ss", TOKEN_INSN, C_none, I_VFNMADD123SS },
+        { "vfnmadd123sd", TOKEN_INSN, C_none, I_VFNMADD123SD },
+        { "vfnmadd231ss", TOKEN_INSN, C_none, I_VFNMADD231SS },
+        { "vfnmadd231sd", TOKEN_INSN, C_none, I_VFNMADD231SD },
+        { "vfnmadd321ss", TOKEN_INSN, C_none, I_VFNMADD321SS },
+        { "vfnmadd321sd", TOKEN_INSN, C_none, I_VFNMADD321SD },
+        { "vfnmsub132ss", TOKEN_INSN, C_none, I_VFNMSUB132SS },
+        { "vfnmsub132sd", TOKEN_INSN, C_none, I_VFNMSUB132SD },
+        { "vfnmsub312ss", TOKEN_INSN, C_none, I_VFNMSUB312SS },
+        { "vfnmsub312sd", TOKEN_INSN, C_none, I_VFNMSUB312SD },
+        { "vfnmsub213ss", TOKEN_INSN, C_none, I_VFNMSUB213SS },
+        { "vfnmsub213sd", TOKEN_INSN, C_none, I_VFNMSUB213SD },
+        { "vfnmsub123ss", TOKEN_INSN, C_none, I_VFNMSUB123SS },
+        { "vfnmsub123sd", TOKEN_INSN, C_none, I_VFNMSUB123SD },
+        { "vfnmsub231ss", TOKEN_INSN, C_none, I_VFNMSUB231SS },
+        { "vfnmsub231sd", TOKEN_INSN, C_none, I_VFNMSUB231SD },
+        { "vfnmsub321ss", TOKEN_INSN, C_none, I_VFNMSUB321SS },
+        { "vfnmsub321sd", TOKEN_INSN, C_none, I_VFNMSUB321SD },
+        { "xstore", TOKEN_INSN, C_none, I_XSTORE },
+        { "xcryptecb", TOKEN_INSN, C_none, I_XCRYPTECB },
+        { "xcryptcbc", TOKEN_INSN, C_none, I_XCRYPTCBC },
+        { "xcryptctr", TOKEN_INSN, C_none, I_XCRYPTCTR },
+        { "xcryptcfb", TOKEN_INSN, C_none, I_XCRYPTCFB },
+        { "xcryptofb", TOKEN_INSN, C_none, I_XCRYPTOFB },
+        { "montmul", TOKEN_INSN, C_none, I_MONTMUL },
+        { "xsha1", TOKEN_INSN, C_none, I_XSHA1 },
+        { "xsha256", TOKEN_INSN, C_none, I_XSHA256 },
+        { "llwpcb", TOKEN_INSN, C_none, I_LLWPCB },
+        { "slwpcb", TOKEN_INSN, C_none, I_SLWPCB },
+        { "lwpval", TOKEN_INSN, C_none, I_LWPVAL },
+        { "lwpins", TOKEN_INSN, C_none, I_LWPINS },
+        { "vcvtph2ps", TOKEN_INSN, C_none, I_VCVTPH2PS },
+        { "vcvtps2ph", TOKEN_INSN, C_none, I_VCVTPS2PH },
+        { "vfmaddpd", TOKEN_INSN, C_none, I_VFMADDPD },
+        { "vfmaddps", TOKEN_INSN, C_none, I_VFMADDPS },
+        { "vfmaddsd", TOKEN_INSN, C_none, I_VFMADDSD },
+        { "vfmaddss", TOKEN_INSN, C_none, I_VFMADDSS },
+        { "vfmaddsubpd", TOKEN_INSN, C_none, I_VFMADDSUBPD },
+        { "vfmaddsubps", TOKEN_INSN, C_none, I_VFMADDSUBPS },
+        { "vfmsubaddpd", TOKEN_INSN, C_none, I_VFMSUBADDPD },
+        { "vfmsubaddps", TOKEN_INSN, C_none, I_VFMSUBADDPS },
+        { "vfmsubpd", TOKEN_INSN, C_none, I_VFMSUBPD },
+        { "vfmsubps", TOKEN_INSN, C_none, I_VFMSUBPS },
+        { "vfmsubsd", TOKEN_INSN, C_none, I_VFMSUBSD },
+        { "vfmsubss", TOKEN_INSN, C_none, I_VFMSUBSS },
+        { "vfnmaddpd", TOKEN_INSN, C_none, I_VFNMADDPD },
+        { "vfnmaddps", TOKEN_INSN, C_none, I_VFNMADDPS },
+        { "vfnmaddsd", TOKEN_INSN, C_none, I_VFNMADDSD },
+        { "vfnmaddss", TOKEN_INSN, C_none, I_VFNMADDSS },
+        { "vfnmsubpd", TOKEN_INSN, C_none, I_VFNMSUBPD },
+        { "vfnmsubps", TOKEN_INSN, C_none, I_VFNMSUBPS },
+        { "vfnmsubsd", TOKEN_INSN, C_none, I_VFNMSUBSD },
+        { "vfnmsubss", TOKEN_INSN, C_none, I_VFNMSUBSS },
+        { "vfrczpd", TOKEN_INSN, C_none, I_VFRCZPD },
+        { "vfrczps", TOKEN_INSN, C_none, I_VFRCZPS },
+        { "vfrczsd", TOKEN_INSN, C_none, I_VFRCZSD },
+        { "vfrczss", TOKEN_INSN, C_none, I_VFRCZSS },
+        { "vpcmov", TOKEN_INSN, C_none, I_VPCMOV },
+        { "vpcomb", TOKEN_INSN, C_none, I_VPCOMB },
+        { "vpcomd", TOKEN_INSN, C_none, I_VPCOMD },
+        { "vpcomq", TOKEN_INSN, C_none, I_VPCOMQ },
+        { "vpcomub", TOKEN_INSN, C_none, I_VPCOMUB },
+        { "vpcomud", TOKEN_INSN, C_none, I_VPCOMUD },
+        { "vpcomuq", TOKEN_INSN, C_none, I_VPCOMUQ },
+        { "vpcomuw", TOKEN_INSN, C_none, I_VPCOMUW },
+        { "vpcomw", TOKEN_INSN, C_none, I_VPCOMW },
+        { "vphaddbd", TOKEN_INSN, C_none, I_VPHADDBD },
+        { "vphaddbq", TOKEN_INSN, C_none, I_VPHADDBQ },
+        { "vphaddbw", TOKEN_INSN, C_none, I_VPHADDBW },
+        { "vphadddq", TOKEN_INSN, C_none, I_VPHADDDQ },
+        { "vphaddubd", TOKEN_INSN, C_none, I_VPHADDUBD },
+        { "vphaddubq", TOKEN_INSN, C_none, I_VPHADDUBQ },
+        { "vphaddubw", TOKEN_INSN, C_none, I_VPHADDUBW },
+        { "vphaddudq", TOKEN_INSN, C_none, I_VPHADDUDQ },
+        { "vphadduwd", TOKEN_INSN, C_none, I_VPHADDUWD },
+        { "vphadduwq", TOKEN_INSN, C_none, I_VPHADDUWQ },
+        { "vphaddwd", TOKEN_INSN, C_none, I_VPHADDWD },
+        { "vphaddwq", TOKEN_INSN, C_none, I_VPHADDWQ },
+        { "vphsubbw", TOKEN_INSN, C_none, I_VPHSUBBW },
+        { "vphsubdq", TOKEN_INSN, C_none, I_VPHSUBDQ },
+        { "vphsubwd", TOKEN_INSN, C_none, I_VPHSUBWD },
+        { "vpmacsdd", TOKEN_INSN, C_none, I_VPMACSDD },
+        { "vpmacsdqh", TOKEN_INSN, C_none, I_VPMACSDQH },
+        { "vpmacsdql", TOKEN_INSN, C_none, I_VPMACSDQL },
+        { "vpmacssdd", TOKEN_INSN, C_none, I_VPMACSSDD },
+        { "vpmacssdqh", TOKEN_INSN, C_none, I_VPMACSSDQH },
+        { "vpmacssdql", TOKEN_INSN, C_none, I_VPMACSSDQL },
+        { "vpmacsswd", TOKEN_INSN, C_none, I_VPMACSSWD },
+        { "vpmacssww", TOKEN_INSN, C_none, I_VPMACSSWW },
+        { "vpmacswd", TOKEN_INSN, C_none, I_VPMACSWD },
+        { "vpmacsww", TOKEN_INSN, C_none, I_VPMACSWW },
+        { "vpmadcsswd", TOKEN_INSN, C_none, I_VPMADCSSWD },
+        { "vpmadcswd", TOKEN_INSN, C_none, I_VPMADCSWD },
+        { "vpperm", TOKEN_INSN, C_none, I_VPPERM },
+        { "vprotb", TOKEN_INSN, C_none, I_VPROTB },
+        { "vprotd", TOKEN_INSN, C_none, I_VPROTD },
+        { "vprotq", TOKEN_INSN, C_none, I_VPROTQ },
+        { "vprotw", TOKEN_INSN, C_none, I_VPROTW },
+        { "vpshab", TOKEN_INSN, C_none, I_VPSHAB },
+        { "vpshad", TOKEN_INSN, C_none, I_VPSHAD },
+        { "vpshaq", TOKEN_INSN, C_none, I_VPSHAQ },
+        { "vpshaw", TOKEN_INSN, C_none, I_VPSHAW },
+        { "vpshlb", TOKEN_INSN, C_none, I_VPSHLB },
+        { "vpshld", TOKEN_INSN, C_none, I_VPSHLD },
+        { "vpshlq", TOKEN_INSN, C_none, I_VPSHLQ },
+        { "vpshlw", TOKEN_INSN, C_none, I_VPSHLW },
+        { "hint_nop0", TOKEN_INSN, C_none, I_HINT_NOP0 },
+        { "hint_nop1", TOKEN_INSN, C_none, I_HINT_NOP1 },
+        { "hint_nop2", TOKEN_INSN, C_none, I_HINT_NOP2 },
+        { "hint_nop3", TOKEN_INSN, C_none, I_HINT_NOP3 },
+        { "hint_nop4", TOKEN_INSN, C_none, I_HINT_NOP4 },
+        { "hint_nop5", TOKEN_INSN, C_none, I_HINT_NOP5 },
+        { "hint_nop6", TOKEN_INSN, C_none, I_HINT_NOP6 },
+        { "hint_nop7", TOKEN_INSN, C_none, I_HINT_NOP7 },
+        { "hint_nop8", TOKEN_INSN, C_none, I_HINT_NOP8 },
+        { "hint_nop9", TOKEN_INSN, C_none, I_HINT_NOP9 },
+        { "hint_nop10", TOKEN_INSN, C_none, I_HINT_NOP10 },
+        { "hint_nop11", TOKEN_INSN, C_none, I_HINT_NOP11 },
+        { "hint_nop12", TOKEN_INSN, C_none, I_HINT_NOP12 },
+        { "hint_nop13", TOKEN_INSN, C_none, I_HINT_NOP13 },
+        { "hint_nop14", TOKEN_INSN, C_none, I_HINT_NOP14 },
+        { "hint_nop15", TOKEN_INSN, C_none, I_HINT_NOP15 },
+        { "hint_nop16", TOKEN_INSN, C_none, I_HINT_NOP16 },
+        { "hint_nop17", TOKEN_INSN, C_none, I_HINT_NOP17 },
+        { "hint_nop18", TOKEN_INSN, C_none, I_HINT_NOP18 },
+        { "hint_nop19", TOKEN_INSN, C_none, I_HINT_NOP19 },
+        { "hint_nop20", TOKEN_INSN, C_none, I_HINT_NOP20 },
+        { "hint_nop21", TOKEN_INSN, C_none, I_HINT_NOP21 },
+        { "hint_nop22", TOKEN_INSN, C_none, I_HINT_NOP22 },
+        { "hint_nop23", TOKEN_INSN, C_none, I_HINT_NOP23 },
+        { "hint_nop24", TOKEN_INSN, C_none, I_HINT_NOP24 },
+        { "hint_nop25", TOKEN_INSN, C_none, I_HINT_NOP25 },
+        { "hint_nop26", TOKEN_INSN, C_none, I_HINT_NOP26 },
+        { "hint_nop27", TOKEN_INSN, C_none, I_HINT_NOP27 },
+        { "hint_nop28", TOKEN_INSN, C_none, I_HINT_NOP28 },
+        { "hint_nop29", TOKEN_INSN, C_none, I_HINT_NOP29 },
+        { "hint_nop30", TOKEN_INSN, C_none, I_HINT_NOP30 },
+        { "hint_nop31", TOKEN_INSN, C_none, I_HINT_NOP31 },
+        { "hint_nop32", TOKEN_INSN, C_none, I_HINT_NOP32 },
+        { "hint_nop33", TOKEN_INSN, C_none, I_HINT_NOP33 },
+        { "hint_nop34", TOKEN_INSN, C_none, I_HINT_NOP34 },
+        { "hint_nop35", TOKEN_INSN, C_none, I_HINT_NOP35 },
+        { "hint_nop36", TOKEN_INSN, C_none, I_HINT_NOP36 },
+        { "hint_nop37", TOKEN_INSN, C_none, I_HINT_NOP37 },
+        { "hint_nop38", TOKEN_INSN, C_none, I_HINT_NOP38 },
+        { "hint_nop39", TOKEN_INSN, C_none, I_HINT_NOP39 },
+        { "hint_nop40", TOKEN_INSN, C_none, I_HINT_NOP40 },
+        { "hint_nop41", TOKEN_INSN, C_none, I_HINT_NOP41 },
+        { "hint_nop42", TOKEN_INSN, C_none, I_HINT_NOP42 },
+        { "hint_nop43", TOKEN_INSN, C_none, I_HINT_NOP43 },
+        { "hint_nop44", TOKEN_INSN, C_none, I_HINT_NOP44 },
+        { "hint_nop45", TOKEN_INSN, C_none, I_HINT_NOP45 },
+        { "hint_nop46", TOKEN_INSN, C_none, I_HINT_NOP46 },
+        { "hint_nop47", TOKEN_INSN, C_none, I_HINT_NOP47 },
+        { "hint_nop48", TOKEN_INSN, C_none, I_HINT_NOP48 },
+        { "hint_nop49", TOKEN_INSN, C_none, I_HINT_NOP49 },
+        { "hint_nop50", TOKEN_INSN, C_none, I_HINT_NOP50 },
+        { "hint_nop51", TOKEN_INSN, C_none, I_HINT_NOP51 },
+        { "hint_nop52", TOKEN_INSN, C_none, I_HINT_NOP52 },
+        { "hint_nop53", TOKEN_INSN, C_none, I_HINT_NOP53 },
+        { "hint_nop54", TOKEN_INSN, C_none, I_HINT_NOP54 },
+        { "hint_nop55", TOKEN_INSN, C_none, I_HINT_NOP55 },
+        { "hint_nop56", TOKEN_INSN, C_none, I_HINT_NOP56 },
+        { "hint_nop57", TOKEN_INSN, C_none, I_HINT_NOP57 },
+        { "hint_nop58", TOKEN_INSN, C_none, I_HINT_NOP58 },
+        { "hint_nop59", TOKEN_INSN, C_none, I_HINT_NOP59 },
+        { "hint_nop60", TOKEN_INSN, C_none, I_HINT_NOP60 },
+        { "hint_nop61", TOKEN_INSN, C_none, I_HINT_NOP61 },
+        { "hint_nop62", TOKEN_INSN, C_none, I_HINT_NOP62 },
+        { "hint_nop63", TOKEN_INSN, C_none, I_HINT_NOP63 },
+        { "al", TOKEN_REG, 0, R_AL },
+        { "ah", TOKEN_REG, 0, R_AH },
+        { "ax", TOKEN_REG, 0, R_AX },
+        { "eax", TOKEN_REG, 0, R_EAX },
+        { "rax", TOKEN_REG, 0, R_RAX },
+        { "bl", TOKEN_REG, 0, R_BL },
+        { "bh", TOKEN_REG, 0, R_BH },
+        { "bx", TOKEN_REG, 0, R_BX },
+        { "ebx", TOKEN_REG, 0, R_EBX },
+        { "rbx", TOKEN_REG, 0, R_RBX },
+        { "cl", TOKEN_REG, 0, R_CL },
+        { "ch", TOKEN_REG, 0, R_CH },
+        { "cx", TOKEN_REG, 0, R_CX },
+        { "ecx", TOKEN_REG, 0, R_ECX },
+        { "rcx", TOKEN_REG, 0, R_RCX },
+        { "dl", TOKEN_REG, 0, R_DL },
+        { "dh", TOKEN_REG, 0, R_DH },
+        { "dx", TOKEN_REG, 0, R_DX },
+        { "edx", TOKEN_REG, 0, R_EDX },
+        { "rdx", TOKEN_REG, 0, R_RDX },
+        { "spl", TOKEN_REG, 0, R_SPL },
+        { "sp", TOKEN_REG, 0, R_SP },
+        { "esp", TOKEN_REG, 0, R_ESP },
+        { "rsp", TOKEN_REG, 0, R_RSP },
+        { "bpl", TOKEN_REG, 0, R_BPL },
+        { "bp", TOKEN_REG, 0, R_BP },
+        { "ebp", TOKEN_REG, 0, R_EBP },
+        { "rbp", TOKEN_REG, 0, R_RBP },
+        { "sil", TOKEN_REG, 0, R_SIL },
+        { "si", TOKEN_REG, 0, R_SI },
+        { "esi", TOKEN_REG, 0, R_ESI },
+        { "rsi", TOKEN_REG, 0, R_RSI },
+        { "dil", TOKEN_REG, 0, R_DIL },
+        { "di", TOKEN_REG, 0, R_DI },
+        { "edi", TOKEN_REG, 0, R_EDI },
+        { "rdi", TOKEN_REG, 0, R_RDI },
+        { "r8b", TOKEN_REG, 0, R_R8B },
+        { "r9b", TOKEN_REG, 0, R_R9B },
+        { "r10b", TOKEN_REG, 0, R_R10B },
+        { "r11b", TOKEN_REG, 0, R_R11B },
+        { "r12b", TOKEN_REG, 0, R_R12B },
+        { "r13b", TOKEN_REG, 0, R_R13B },
+        { "r14b", TOKEN_REG, 0, R_R14B },
+        { "r15b", TOKEN_REG, 0, R_R15B },
+        { "r8w", TOKEN_REG, 0, R_R8W },
+        { "r9w", TOKEN_REG, 0, R_R9W },
+        { "r10w", TOKEN_REG, 0, R_R10W },
+        { "r11w", TOKEN_REG, 0, R_R11W },
+        { "r12w", TOKEN_REG, 0, R_R12W },
+        { "r13w", TOKEN_REG, 0, R_R13W },
+        { "r14w", TOKEN_REG, 0, R_R14W },
+        { "r15w", TOKEN_REG, 0, R_R15W },
+        { "r8d", TOKEN_REG, 0, R_R8D },
+        { "r9d", TOKEN_REG, 0, R_R9D },
+        { "r10d", TOKEN_REG, 0, R_R10D },
+        { "r11d", TOKEN_REG, 0, R_R11D },
+        { "r12d", TOKEN_REG, 0, R_R12D },
+        { "r13d", TOKEN_REG, 0, R_R13D },
+        { "r14d", TOKEN_REG, 0, R_R14D },
+        { "r15d", TOKEN_REG, 0, R_R15D },
+        { "r8", TOKEN_REG, 0, R_R8 },
+        { "r9", TOKEN_REG, 0, R_R9 },
+        { "r10", TOKEN_REG, 0, R_R10 },
+        { "r11", TOKEN_REG, 0, R_R11 },
+        { "r12", TOKEN_REG, 0, R_R12 },
+        { "r13", TOKEN_REG, 0, R_R13 },
+        { "r14", TOKEN_REG, 0, R_R14 },
+        { "r15", TOKEN_REG, 0, R_R15 },
+        { "cs", TOKEN_REG, 0, R_CS },
+        { "ds", TOKEN_REG, 0, R_DS },
+        { "es", TOKEN_REG, 0, R_ES },
+        { "ss", TOKEN_REG, 0, R_SS },
+        { "fs", TOKEN_REG, 0, R_FS },
+        { "gs", TOKEN_REG, 0, R_GS },
+        { "segr6", TOKEN_REG, 0, R_SEGR6 },
+        { "segr7", TOKEN_REG, 0, R_SEGR7 },
+        { "cr0", TOKEN_REG, 0, R_CR0 },
+        { "cr1", TOKEN_REG, 0, R_CR1 },
+        { "cr2", TOKEN_REG, 0, R_CR2 },
+        { "cr3", TOKEN_REG, 0, R_CR3 },
+        { "cr4", TOKEN_REG, 0, R_CR4 },
+        { "cr5", TOKEN_REG, 0, R_CR5 },
+        { "cr6", TOKEN_REG, 0, R_CR6 },
+        { "cr7", TOKEN_REG, 0, R_CR7 },
+        { "cr8", TOKEN_REG, 0, R_CR8 },
+        { "cr9", TOKEN_REG, 0, R_CR9 },
+        { "cr10", TOKEN_REG, 0, R_CR10 },
+        { "cr11", TOKEN_REG, 0, R_CR11 },
+        { "cr12", TOKEN_REG, 0, R_CR12 },
+        { "cr13", TOKEN_REG, 0, R_CR13 },
+        { "cr14", TOKEN_REG, 0, R_CR14 },
+        { "cr15", TOKEN_REG, 0, R_CR15 },
+        { "dr0", TOKEN_REG, 0, R_DR0 },
+        { "dr1", TOKEN_REG, 0, R_DR1 },
+        { "dr2", TOKEN_REG, 0, R_DR2 },
+        { "dr3", TOKEN_REG, 0, R_DR3 },
+        { "dr4", TOKEN_REG, 0, R_DR4 },
+        { "dr5", TOKEN_REG, 0, R_DR5 },
+        { "dr6", TOKEN_REG, 0, R_DR6 },
+        { "dr7", TOKEN_REG, 0, R_DR7 },
+        { "dr8", TOKEN_REG, 0, R_DR8 },
+        { "dr9", TOKEN_REG, 0, R_DR9 },
+        { "dr10", TOKEN_REG, 0, R_DR10 },
+        { "dr11", TOKEN_REG, 0, R_DR11 },
+        { "dr12", TOKEN_REG, 0, R_DR12 },
+        { "dr13", TOKEN_REG, 0, R_DR13 },
+        { "dr14", TOKEN_REG, 0, R_DR14 },
+        { "dr15", TOKEN_REG, 0, R_DR15 },
+        { "tr0", TOKEN_REG, 0, R_TR0 },
+        { "tr1", TOKEN_REG, 0, R_TR1 },
+        { "tr2", TOKEN_REG, 0, R_TR2 },
+        { "tr3", TOKEN_REG, 0, R_TR3 },
+        { "tr4", TOKEN_REG, 0, R_TR4 },
+        { "tr5", TOKEN_REG, 0, R_TR5 },
+        { "tr6", TOKEN_REG, 0, R_TR6 },
+        { "tr7", TOKEN_REG, 0, R_TR7 },
+        { "st0", TOKEN_REG, 0, R_ST0 },
+        { "st1", TOKEN_REG, 0, R_ST1 },
+        { "st2", TOKEN_REG, 0, R_ST2 },
+        { "st3", TOKEN_REG, 0, R_ST3 },
+        { "st4", TOKEN_REG, 0, R_ST4 },
+        { "st5", TOKEN_REG, 0, R_ST5 },
+        { "st6", TOKEN_REG, 0, R_ST6 },
+        { "st7", TOKEN_REG, 0, R_ST7 },
+        { "mm0", TOKEN_REG, 0, R_MM0 },
+        { "mm1", TOKEN_REG, 0, R_MM1 },
+        { "mm2", TOKEN_REG, 0, R_MM2 },
+        { "mm3", TOKEN_REG, 0, R_MM3 },
+        { "mm4", TOKEN_REG, 0, R_MM4 },
+        { "mm5", TOKEN_REG, 0, R_MM5 },
+        { "mm6", TOKEN_REG, 0, R_MM6 },
+        { "mm7", TOKEN_REG, 0, R_MM7 },
+        { "xmm0", TOKEN_REG, 0, R_XMM0 },
+        { "xmm1", TOKEN_REG, 0, R_XMM1 },
+        { "xmm2", TOKEN_REG, 0, R_XMM2 },
+        { "xmm3", TOKEN_REG, 0, R_XMM3 },
+        { "xmm4", TOKEN_REG, 0, R_XMM4 },
+        { "xmm5", TOKEN_REG, 0, R_XMM5 },
+        { "xmm6", TOKEN_REG, 0, R_XMM6 },
+        { "xmm7", TOKEN_REG, 0, R_XMM7 },
+        { "xmm8", TOKEN_REG, 0, R_XMM8 },
+        { "xmm9", TOKEN_REG, 0, R_XMM9 },
+        { "xmm10", TOKEN_REG, 0, R_XMM10 },
+        { "xmm11", TOKEN_REG, 0, R_XMM11 },
+        { "xmm12", TOKEN_REG, 0, R_XMM12 },
+        { "xmm13", TOKEN_REG, 0, R_XMM13 },
+        { "xmm14", TOKEN_REG, 0, R_XMM14 },
+        { "xmm15", TOKEN_REG, 0, R_XMM15 },
+        { "ymm0", TOKEN_REG, 0, R_YMM0 },
+        { "ymm1", TOKEN_REG, 0, R_YMM1 },
+        { "ymm2", TOKEN_REG, 0, R_YMM2 },
+        { "ymm3", TOKEN_REG, 0, R_YMM3 },
+        { "ymm4", TOKEN_REG, 0, R_YMM4 },
+        { "ymm5", TOKEN_REG, 0, R_YMM5 },
+        { "ymm6", TOKEN_REG, 0, R_YMM6 },
+        { "ymm7", TOKEN_REG, 0, R_YMM7 },
+        { "ymm8", TOKEN_REG, 0, R_YMM8 },
+        { "ymm9", TOKEN_REG, 0, R_YMM9 },
+        { "ymm10", TOKEN_REG, 0, R_YMM10 },
+        { "ymm11", TOKEN_REG, 0, R_YMM11 },
+        { "ymm12", TOKEN_REG, 0, R_YMM12 },
+        { "ymm13", TOKEN_REG, 0, R_YMM13 },
+        { "ymm14", TOKEN_REG, 0, R_YMM14 },
+        { "ymm15", TOKEN_REG, 0, R_YMM15 },
+        { "a16", TOKEN_PREFIX, 0, P_A16 },
+        { "a32", TOKEN_PREFIX, 0, P_A32 },
+        { "a64", TOKEN_PREFIX, 0, P_A64 },
+        { "asp", TOKEN_PREFIX, 0, P_ASP },
+        { "lock", TOKEN_PREFIX, 0, P_LOCK },
+        { "o16", TOKEN_PREFIX, 0, P_O16 },
+        { "o32", TOKEN_PREFIX, 0, P_O32 },
+        { "o64", TOKEN_PREFIX, 0, P_O64 },
+        { "osp", TOKEN_PREFIX, 0, P_OSP },
+        { "rep", TOKEN_PREFIX, 0, P_REP },
+        { "repe", TOKEN_PREFIX, 0, P_REPE },
+        { "repne", TOKEN_PREFIX, 0, P_REPNE },
+        { "repnz", TOKEN_PREFIX, 0, P_REPNZ },
+        { "repz", TOKEN_PREFIX, 0, P_REPZ },
+        { "times", TOKEN_PREFIX, 0, P_TIMES },
+        { "wait", TOKEN_PREFIX, 0, P_WAIT },
+        { "abs", TOKEN_SPECIAL, 0, S_ABS },
+        { "byte", TOKEN_SPECIAL, 0, S_BYTE },
+        { "dword", TOKEN_SPECIAL, 0, S_DWORD },
+        { "far", TOKEN_SPECIAL, 0, S_FAR },
+        { "long", TOKEN_SPECIAL, 0, S_LONG },
+        { "near", TOKEN_SPECIAL, 0, S_NEAR },
+        { "nosplit", TOKEN_SPECIAL, 0, S_NOSPLIT },
+        { "oword", TOKEN_SPECIAL, 0, S_OWORD },
+        { "qword", TOKEN_SPECIAL, 0, S_QWORD },
+        { "rel", TOKEN_SPECIAL, 0, S_REL },
+        { "short", TOKEN_SPECIAL, 0, S_SHORT },
+        { "strict", TOKEN_SPECIAL, 0, S_STRICT },
+        { "to", TOKEN_SPECIAL, 0, S_TO },
+        { "tword", TOKEN_SPECIAL, 0, S_TWORD },
+        { "word", TOKEN_SPECIAL, 0, S_WORD },
+        { "yword", TOKEN_SPECIAL, 0, S_YWORD },
+        { "__infinity__", TOKEN_FLOAT, 0, 0 },
+        { "__nan__", TOKEN_FLOAT, 0, 0 },
+        { "__qnan__", TOKEN_FLOAT, 0, 0 },
+        { "__snan__", TOKEN_FLOAT, 0, 0 },
+        { "__float8__", TOKEN_FLOATIZE, 0, FLOAT_8 },
+        { "__float16__", TOKEN_FLOATIZE, 0, FLOAT_16 },
+        { "__float32__", TOKEN_FLOATIZE, 0, FLOAT_32 },
+        { "__float64__", TOKEN_FLOATIZE, 0, FLOAT_64 },
+        { "__float80m__", TOKEN_FLOATIZE, 0, FLOAT_80M },
+        { "__float80e__", TOKEN_FLOATIZE, 0, FLOAT_80E },
+        { "__float128l__", TOKEN_FLOATIZE, 0, FLOAT_128L },
+        { "__float128h__", TOKEN_FLOATIZE, 0, FLOAT_128H },
+        { "__utf16__", TOKEN_STRFUNC, 0, STRFUNC_UTF16 },
+        { "__utf32__", TOKEN_STRFUNC, 0, STRFUNC_UTF32 },
+        { "seg", TOKEN_SEG, 0, 0 },
+        { "wrt", TOKEN_WRT, 0, 0 },
+    };
+    uint32_t k1, k2;
+    uint64_t crc;
+    uint16_t ix;
+    const struct tokendata *data;
+
+    crc = crc64(UINT64_C(0x13f0eafb407e486a), token);
+    k1 = (uint32_t)crc;
+    k2 = (uint32_t)(crc >> 32);
+
+    ix = hash1[k1 & 0x7ff] + hash2[k2 & 0x7ff];
+    if (ix >= 1677)
+        return tv->t_type = TOKEN_ID;
+
+    data = &tokendata[ix];
+    if (strcmp(data->string, token))
+        return tv->t_type = TOKEN_ID;
+
+    tv->t_integer = data->num;
+    tv->t_inttwo  = data->aux;
+    return tv->t_type = data->tokentype;
+}
diff --git a/tokhash.pl b/tokhash.pl
new file mode 100755 (executable)
index 0000000..0c69c03
--- /dev/null
@@ -0,0 +1,275 @@
+#!/usr/bin/perl
+## --------------------------------------------------------------------------
+##   
+##   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.
+##
+## --------------------------------------------------------------------------
+
+#
+# Generate a perfect hash for token parsing
+#
+# Usage: tokenhash.pl insns.dat regs.dat tokens.dat
+#
+
+require 'phash.ph';
+
+my($output, $insns_dat, $regs_dat, $tokens_dat) = @ARGV;
+
+%tokens = ();
+@tokendata = ();
+
+#
+# List of condition codes
+#
+@conditions = ('a', 'ae', 'b', 'be', 'c', 'e', 'g', 'ge', 'l', 'le',
+              'na', 'nae', 'nb', 'nbe', 'nc', 'ne', 'ng', 'nge', 'nl',
+              'nle', 'no', 'np', 'ns', 'nz', 'o', 'p', 'pe', 'po', 's', 'z');
+
+#
+# Read insns.dat
+#
+open(ID, "< ${insns_dat}") or die "$0: cannot open $insns_dat: $!\n";
+while (defined($line = <ID>)) {
+    if ($line =~ /^([A-Z0-9_]+)(|cc)\s/) {
+       $insn = $1.$2;
+       ($token = $1) =~ tr/A-Z/a-z/;
+
+       if ($2 eq '') {
+           # Single instruction token
+           if (!defined($tokens{$token})) {
+               $tokens{$token} = scalar @tokendata;
+               push(@tokendata, "\"${token}\", TOKEN_INSN, C_none, I_${insn}");
+           }
+       } else {
+           # Conditional instruction
+           foreach $cc (@conditions) {
+               if (!defined($tokens{$token.$cc})) {
+                   $tokens{$token.$cc} = scalar @tokendata;
+                   push(@tokendata, "\"${token}${cc}\", TOKEN_INSN, C_\U$cc\E, I_${insn}");
+               }
+           }
+       }
+    }
+}
+close(ID);
+
+#
+# Read regs.dat
+#
+open(RD, "< ${regs_dat}") or die "$0: cannot open $regs_dat: $!\n";
+while (defined($line = <RD>)) {
+    if ($line =~ /^([a-z0-9_-]+)\s/) {
+       $reg = $1;
+
+       if ($reg =~ /^(.*[^0-9])([0-9]+)\-([0-9]+)(|[^0-9].*)$/) {
+           $nregs = $3-$2+1;
+           $reg = $1.$2.$4;
+           $reg_nr = $2;
+           $reg_prefix = $1;
+           $reg_suffix = $4;
+       } else {
+           $nregs = 1;
+           undef $reg_prefix, $reg_suffix;
+       }
+
+       while ($nregs--) {
+           if (defined($tokens{$reg})) {
+               die "Duplicate definition: $reg\n";
+           }
+           $tokens{$reg} = scalar @tokendata;
+           push(@tokendata, "\"${reg}\", TOKEN_REG, 0, R_\U${reg}\E");
+
+           if (defined($reg_prefix)) {
+               $reg_nr++;
+               $reg = sprintf("%s%u%s", $reg_prefix, $reg_nr, $reg_suffix);
+           } else {
+               # Not a dashed sequence
+               die if ($nregs);
+           }
+       }
+    }
+}
+close(RD);
+
+#
+# Read tokens.dat
+#
+open(TD, "< ${tokens_dat}") or die "$0: cannot open $tokens_dat: $!\n";
+while (defined($line = <TD>)) {
+    if ($line =~ /^\%\s+(.*)$/) {
+       $pattern = $1;
+    } elsif ($line =~ /^([a-z0-9_-]+)/) {
+       $token = $1;
+
+       if (defined($tokens{$token})) {
+           die "Duplicate definition: $token\n";
+       }
+       $tokens{$token} = scalar @tokendata;
+
+       $data = $pattern;
+       if ($data =~ /^(.*)\{(.*)\}(.*)$/) {
+           my $head = $1, $tail = $3;
+           my $px = $2;
+
+           $px =~ s/\*/(.*)/g;
+           if ($token =~ /$px/i) {
+               $data = $head."\U$1".$tail;
+           } else {
+               die "$0: token $token doesn't match $px\n";
+           }
+       }
+
+       $data =~ s/\*/\U$token/g;
+
+       push(@tokendata, "\"$token\", $data");
+    }
+}
+close(TD);
+
+if ($output eq 'h') {
+    #
+    # tokens.h
+    #
+
+    $max_len = 0;
+    foreach $token (keys(%tokens)) {
+       if (length($token) > $max_len) {
+           $max_len = length($token);
+       }
+    }
+
+    print "/*\n";
+    print " * This file is generated from insns.dat, regs.dat and token.dat\n";
+    print " * by tokhash.pl; do not edit.\n";
+    print " */\n";
+    print "\n";
+
+    print "#ifndef NASM_TOKENS_H\n";
+    print "#define NASM_TOKENS_H\n";
+    print "\n";
+    print "#define MAX_KEYWORD $max_len /* length of longest keyword */\n";
+    print "\n";
+    print "#endif /* NASM_TOKENS_H */\n";
+} elsif ($output eq 'c') {
+    #
+    # tokhash.c
+    #
+
+    @hashinfo = gen_perfect_hash(\%tokens);
+    if (!defined(@hashinfo)) {
+       die "$0: no hash found\n";
+    }
+
+    # Paranoia...
+    verify_hash_table(\%tokens, \@hashinfo);
+
+    ($n, $sv, $g) = @hashinfo;
+    $sv2 = $sv+2;
+
+    die if ($n & ($n-1));
+
+    print "/*\n";
+    print " * This file is generated from insns.dat, regs.dat and token.dat\n";
+    print " * by tokhash.pl; do not edit.\n";
+    print " */\n";
+    print "\n";
+
+    print "#include \"compiler.h\"\n";
+    print "#include <string.h>\n";
+    print "#include \"nasm.h\"\n";
+    print "#include \"hashtbl.h\"\n";
+    print "#include \"insns.h\"\n";
+    print "\n";
+
+    # These somewhat odd sizes and ordering thereof are due to the
+    # relative ranges of the types; this makes it fit in 16 bytes on
+    # 64-bit machines and 12 bytes on 32-bit machines.
+    print "struct tokendata {\n";
+    print "    const char *string;\n";
+    print "    int16_t tokentype;\n";
+    print "    int16_t aux;\n";
+    print "    int32_t num;\n";
+    print "};\n";
+    print "\n";
+
+    print "int nasm_token_hash(const char *token, struct tokenval *tv)\n";
+    print "{\n";
+
+    # Put a large value in unused slots.  This makes it extremely unlikely
+    # that any combination that involves unused slot will pass the range test.
+    # This speeds up rejection of unrecognized tokens, i.e. identifiers.
+    print "#define UNUSED 16383\n";
+
+    print "    static const int16_t hash1[$n] = {\n";
+    for ($i = 0; $i < $n; $i++) {
+       my $h = ${$g}[$i*2+0];
+       print "        ", defined($h) ? $h : 'UNUSED', ",\n";
+    }
+    print "    };\n";
+
+    print "    static const int16_t hash2[$n] = {\n";
+    for ($i = 0; $i < $n; $i++) {
+       my $h = ${$g}[$i*2+1];
+       print "        ", defined($h) ? $h : 'UNUSED', ",\n";
+    }
+    print "    };\n";
+
+    printf "    static const struct tokendata tokendata[%d] = {\n", scalar(@tokendata);
+    foreach $d (@tokendata) {
+       print "        { ", $d, " },\n";
+    }
+    print  "    };\n";
+
+    print  "    uint32_t k1, k2;\n";
+    print  "    uint64_t crc;\n";
+    # For correct overflow behavior, "ix" should be unsigned of the same
+    # width as the hash arrays.
+    print  "    uint16_t ix;\n";
+    print  "    const struct tokendata *data;\n";
+    print  "\n";
+    printf "    crc = crc64(UINT64_C(0x%08x%08x), token);\n",
+       $$sv[0], $$sv[1];
+    print  "    k1 = (uint32_t)crc;\n";
+    print  "    k2 = (uint32_t)(crc >> 32);\n";
+    print  "\n";
+    printf "    ix = hash1[k1 & 0x%x] + hash2[k2 & 0x%x];\n", $n-1, $n-1;
+    printf "    if (ix >= %d)\n", scalar(@tokendata);
+    print  "        return tv->t_type = TOKEN_ID;\n";
+    print  "\n";
+    print  "    data = &tokendata[ix];\n";
+
+    print  "    if (strcmp(data->string, token))\n";
+    print  "        return tv->t_type = TOKEN_ID;\n";
+    print  "\n";
+    print  "    tv->t_integer = data->num;\n";
+    print  "    tv->t_inttwo  = data->aux;\n";
+    print  "    return tv->t_type = data->tokentype;\n";
+    print  "}\n";
+}
diff --git a/ver.c b/ver.c
new file mode 100644 (file)
index 0000000..a7c4608
--- /dev/null
+++ b/ver.c
@@ -0,0 +1,51 @@
+/* ----------------------------------------------------------------------- *
+ *   
+ *   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.
+ *
+ * ----------------------------------------------------------------------- */
+
+#include "nasm.h"
+#include "version.h"
+
+/* This is printed when entering nasm -v */
+const char nasm_version[] = NASM_VER;
+const char nasm_date[] = __DATE__;
+const char nasm_compile_options[] = ""
+#ifdef DEBUG
+    " with -DDEBUG"
+#endif
+    ;
+
+/* These are used by some backends. */
+const char nasm_comment[] =
+    "The Netwide Assembler " NASM_VER;
+
+const char nasm_signature[] =
+    "NASM " NASM_VER;
diff --git a/version b/version
new file mode 100644 (file)
index 0000000..d1dac17
--- /dev/null
+++ b/version
@@ -0,0 +1 @@
+2.08rc7
diff --git a/version.h b/version.h
new file mode 100644 (file)
index 0000000..966115e
--- /dev/null
+++ b/version.h
@@ -0,0 +1,9 @@
+#ifndef NASM_VERSION_H
+#define NASM_VERSION_H
+#define NASM_MAJOR_VER      2
+#define NASM_MINOR_VER      7
+#define NASM_SUBMINOR_VER   99
+#define NASM_PATCHLEVEL_VER 97
+#define NASM_VERSION_ID     0x02076361
+#define NASM_VER            "2.08rc7"
+#endif /* NASM_VERSION_H */
diff --git a/version.mac b/version.mac
new file mode 100644 (file)
index 0000000..315c8fb
--- /dev/null
@@ -0,0 +1,6 @@
+%define __NASM_MAJOR__ 2
+%define __NASM_MINOR__ 7
+%define __NASM_SUBMINOR__ 99
+%define __NASM_PATCHLEVEL__ 97
+%define __NASM_VERSION_ID__ 002076361h
+%define __NASM_VER__ "2.08rc7"
diff --git a/version.mak b/version.mak
new file mode 100644 (file)
index 0000000..e6cb9ce
--- /dev/null
@@ -0,0 +1,5 @@
+NASM_VER=2.08rc7
+NASM_MAJOR_VER=2
+NASM_MINOR_VER=7
+NASM_SUBMINOR_VER=99
+NASM_PATCHLEVEL_VER=97
diff --git a/version.nsh b/version.nsh
new file mode 100644 (file)
index 0000000..c55e706
--- /dev/null
@@ -0,0 +1,5 @@
+!define VERSION "2.08rc7"
+!define MAJOR_VER 7
+!define MINOR_VER 7
+!define SUBMINOR_VER 99
+!define PATCHLEVEL_VER 97
diff --git a/version.pl b/version.pl
new file mode 100755 (executable)
index 0000000..e4157a2
--- /dev/null
@@ -0,0 +1,185 @@
+#!/usr/bin/perl
+## --------------------------------------------------------------------------
+##   
+##   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.
+##
+## --------------------------------------------------------------------------
+
+#
+# version.pl
+#
+# Parse the NASM version file and produce appropriate macros
+#
+# The NASM version number is assumed to consist of:
+#
+# <major>.<minor>[.<subminor>][pl<patchlevel>]]<tail>
+#
+# ... 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:
+#
+# version.h:
+# NASM_MAJOR_VER
+# 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
+#
+# version.mac:
+# __NASM_MAJOR__
+# __NASM_MINOR__
+# __NASM_SUBMINOR__
+# __NASM_PATCHLEVEL__
+# __NASM_SNAPSHOT__
+# __NASM_VERSION_ID__
+# __NASM_VER__
+#
+
+($what) = @ARGV;
+
+$line = <STDIN>;
+chomp $line;
+
+undef $man, $min, $smin, $plvl, $tail;
+$is_rc = 0;
+
+if ( $line =~ /^([0-9]+)\.([0-9]+)(.*)$/ ) {
+    $maj  = $1;
+    $min  = $2;
+    $tail = $3;
+    if ( $tail =~ /^\.([0-9]+)(.*)$/ ) {
+       $smin = $1;
+       $tail = $2;
+    }
+    if ( $tail =~ /^(pl|\.)([0-9]+)(.*)$/ ) {
+       $plvl = $2;
+       $tail = $3;
+    } elsif ( $tail =~ /^rc([0-9]+)(.*)$/ ) {
+       $is_rc = 1;
+       $plvl = $1;
+       $tail = $2;
+    }
+} else {
+    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;
+
+if ($is_rc) {
+    $nplvl += 90;
+    if ($nsmin > 0) {
+       $nsmin--;
+    } else {
+       $nsmin = 99;
+       if ($nmin > 0) {
+           $nmin--;
+       } else {
+           $nmin = 99;
+           $nmaj--;
+       }
+    }
+}
+
+$nasm_id = ($nmaj << 24)+($nmin << 16)+($nsmin << 8)+$nplvl;
+
+$mangled_ver = sprintf("%d.%02d", $nmaj, $nmin);
+if ($nsmin || $nplvl || defined($snapshot)) {
+    $mangled_ver .= sprintf(".%02d", $nsmin);
+    if ($nplvl || defined($snapshot)) {
+       $mangled_ver .= '.'.$nplvl;
+    }
+}
+($mtail = $tail) =~ tr/-/./;
+$mangled_ver .= $mtail;
+
+if ( $what eq 'h' ) {
+    print  "#ifndef NASM_VERSION_H\n";
+    print  "#define NASM_VERSION_H\n";
+    printf "#define NASM_MAJOR_VER      %d\n", $nmaj;
+    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";
+} elsif ( $what eq 'mac' ) {
+    printf "%%define __NASM_MAJOR__ %d\n", $nmaj;
+    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' ) {
+    printf "s/\@\@NASM_MAJOR\@\@/%d/g\n", $nmaj;
+    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;
+    printf "s/\@\@NASM_MANGLED_VER\@\@/%s/g\n", $mangled_ver;
+} elsif ( $what eq 'make' ) {
+    printf "NASM_VER=%s\n", $line;
+    printf "NASM_MAJOR_VER=%d\n", $nmaj;
+    printf "NASM_MINOR_VER=%d\n", $nmin;
+    printf "NASM_SUBMINOR_VER=%d\n", $nsmin;
+    printf "NASM_PATCHLEVEL_VER=%d\n", $nplvl;
+} elsif ( $what eq 'nsis' ) {
+    printf "!define VERSION \"%s\"\n", $line;
+    printf "!define MAJOR_VER %d\n", $nmin;
+    printf "!define MINOR_VER %d\n", $nmin;
+    printf "!define SUBMINOR_VER %d\n", $nsmin;
+    printf "!define PATCHLEVEL_VER %d\n", $nplvl;
+} elsif ( $what eq 'id' ) {
+    print $nasm_id, "\n";       # Print ID in decimal
+} elsif ( $what eq 'xid' ) {
+    printf "0x%08x\n", $nasm_id; # Print ID in hexadecimal
+} else {
+    die "$0: Unknown output: $what\n";
+}
+
+exit 0;
diff --git a/version.sed b/version.sed
new file mode 100644 (file)
index 0000000..3285127
--- /dev/null
@@ -0,0 +1,9 @@
+s/@@NASM_MAJOR@@/2/g
+s/@@NASM_MINOR@@/7/g
+s/@@NASM_SUBMINOR@@/99/g
+s/@@NASM_PATCHLEVEL@@/97/g
+s/@@NASM_SNAPSHOT@@/0/g
+s/@@NASM_VERSION_ID@@/34038625/g
+s/@@NASM_VERSION_XID@@/0x02076361/g
+s/@@NASM_VER@@/2.08rc7/g
+s/@@NASM_MANGLED_VER@@/2.07.99.97/g