Merge "Sync with upstream yasm 1.2.0 source tarball."
diff --git a/Mkfiles/dj/YASM-VERSION.h b/Mkfiles/dj/YASM-VERSION.h
new file mode 100644
index 0000000..41966a5
--- /dev/null
+++ b/Mkfiles/dj/YASM-VERSION.h
@@ -0,0 +1,2 @@
+#define PACKAGE_STRING "yasm 1.2.0"
+#define PACKAGE_VERSION "1.2.0"
diff --git a/Mkfiles/vc10/YASM-VERSION.h b/Mkfiles/vc10/YASM-VERSION.h
new file mode 100644
index 0000000..41966a5
--- /dev/null
+++ b/Mkfiles/vc10/YASM-VERSION.h
@@ -0,0 +1,2 @@
+#define PACKAGE_STRING "yasm 1.2.0"
+#define PACKAGE_VERSION "1.2.0"
diff --git a/Mkfiles/vc10/config.h b/Mkfiles/vc10/config.h
new file mode 100644
index 0000000..efb7cbe
--- /dev/null
+++ b/Mkfiles/vc10/config.h
@@ -0,0 +1,170 @@
+#include "YASM-VERSION.h"

+#define yasm__splitpath(path, tail)     yasm__splitpath_win(path, tail)

+#define yasm__abspath(path)             yasm__abspath_win(path)

+#define yasm__combpath(from, to)        yasm__combpath_win(from, to)

+

+/* Command name to run C preprocessor */

+#define CPP_PROG "cpp"

+

+/* */

+/* #undef ENABLE_NLS */

+

+/* Define if you have the `abort' function. */

+#define HAVE_ABORT 1

+

+/* */

+/* #undef HAVE_CATGETS */

+

+/* Define to 1 if you have the MacOS X function CFLocaleCopyCurrent in the

+   CoreFoundation framework. */

+/* #undef HAVE_CFLOCALECOPYCURRENT */

+

+/* Define to 1 if you have the MacOS X function CFPreferencesCopyAppValue in

+   the CoreFoundation framework. */

+/* #undef HAVE_CFPREFERENCESCOPYAPPVALUE */

+

+/* Define if the GNU dcgettext() function is already present or preinstalled.

+   */

+/* #undef HAVE_DCGETTEXT */

+

+/* Define to 1 if you have the <direct.h> header file. */

+#define HAVE_DIRECT_H 1

+

+/* Define to 1 if you have the `getcwd' function. */

+#define HAVE_GETCWD 1

+

+/* */

+/* #undef HAVE_GETTEXT */

+

+/* Define if you have the GNU C Library */

+/* #undef HAVE_GNU_C_LIBRARY */

+

+/* Define if you have the iconv() function. */

+/* #undef HAVE_ICONV */

+

+/* Define if you have the <inttypes.h> header file. */

+/* #undef HAVE_INTTYPES_H */

+

+/* */

+/* #undef HAVE_LC_MESSAGES */

+

+/* Define to 1 if you have the <libgen.h> header file. */

+/* #undef HAVE_LIBGEN_H */

+

+/* Define if you have the <memory.h> header file. */

+/* #undef HAVE_MEMORY_H */

+

+/* Define if you have the `mergesort' function. */

+/* #undef HAVE_MERGESORT */

+

+/* Define to 1 if you have the `popen' function. */

+/* #undef HAVE_POPEN */

+

+/* Define if you have the <stdint.h> header file. */

+/* #undef HAVE_STDINT_H */

+

+/* Define if you have the <stdlib.h> header file. */

+#define HAVE_STDLIB_H 1

+

+/* */

+/* #undef HAVE_STPCPY */

+

+/* Define if you have the `strcasecmp' function. */

+/* #undef HAVE_STRCASECMP */

+

+/* Define if you have the `strcmpi' function. */

+/* #undef HAVE_STRCMPI */

+

+/* Define if you have the `stricmp' function. */

+/* #undefine HAVE_STRICMP */

+

+/* Define if you have the <strings.h> header file. */

+/* #undef HAVE_STRINGS_H */

+

+/* Define if you have the <string.h> header file. */

+#define HAVE_STRING_H 1

+

+/* Define if you have the `strncasecmp' function. */

+/* #undef HAVE_STRNCASECMP */

+

+/* Define if you have the `strsep' function. */

+/* #undef HAVE_STRSEP */

+

+/* Define if you have the <sys/stat.h> header file. */

+/* #undef HAVE_SYS_STAT_H */

+

+/* Define if you have the <sys/types.h> header file. */

+#define HAVE_SYS_TYPES_H 1

+

+/* Define if you have the `toascii' function. */

+#define HAVE_TOASCII 1

+#define toascii __toascii

+

+/* Define 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 you have the `_stricmp' function. */

+#define HAVE__STRICMP 1

+

+/* Name of package */

+#define PACKAGE "yasm"

+

+/* Define to the address where bug reports for this package should be sent. */

+#define PACKAGE_BUGREPORT "bug-yasm@tortall.net"

+

+/* Define to the full name of this package. */

+#define PACKAGE_NAME "yasm"

+

+/* Define to the full name and version of this package. */

+/*#define PACKAGE_STRING "yasm HEAD"*/

+

+/* Define to the one symbol short name of this package. */

+#define PACKAGE_TARNAME "yasm"

+

+/* Define to the version of this package. */

+/*#define PACKAGE_VERSION "HEAD"*/

+

+/* Define if the C compiler supports function prototypes. */

+#define PROTOTYPES 1

+

+/* The size of a `char', as computed by sizeof. */

+/* #undef SIZEOF_CHAR */

+

+/* The size of a `int', as computed by sizeof. */

+/* #undef SIZEOF_INT */

+

+/* The size of a `long', as computed by sizeof. */

+/* #undef SIZEOF_LONG */

+

+/* The size of a `short', as computed by sizeof. */

+/* #undef SIZEOF_SHORT */

+

+/* The size of a `void*', as computed by sizeof. */

+/* #undef SIZEOF_VOIDP */

+

+/* Define if you have the ANSI C header files. */

+#define STDC_HEADERS 1

+

+/* Version number of package */

+#define VERSION "HEAD"

+

+/* Define if using the dmalloc debugging malloc package */

+/* #undef WITH_DMALLOC */

+

+/* Define like PROTOTYPES; this can be used by system headers. */

+#define __PROTOTYPES 1

+

+/* Define to empty if `const' does not conform to ANSI C. */

+/* #undef const */

+

+/* Define as `__inline' if that's what the C compiler calls it, or to nothing

+   if it is not supported. */

+#ifndef __cplusplus

+/* #undef inline */

+#endif

+

+/* Define to `unsigned' if <sys/types.h> doesn't define. */

+/* #undef size_t */

diff --git a/Mkfiles/vc10/crt_secure_no_deprecate.props b/Mkfiles/vc10/crt_secure_no_deprecate.props
new file mode 100644
index 0000000..16e9f0d
--- /dev/null
+++ b/Mkfiles/vc10/crt_secure_no_deprecate.props
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="utf-8"?>

+<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">

+  <PropertyGroup>

+    <_ProjectFileVersion>10.0.21006.1</_ProjectFileVersion>

+  </PropertyGroup>

+  <ItemDefinitionGroup>

+    <ClCompile>

+      <PreprocessorDefinitions>_CRT_SECURE_NO_DEPRECATE;%(PreprocessorDefinitions)</PreprocessorDefinitions>

+    </ClCompile>

+  </ItemDefinitionGroup>

+</Project>
\ No newline at end of file
diff --git a/Mkfiles/vc10/crt_secure_no_deprecate.vsprops b/Mkfiles/vc10/crt_secure_no_deprecate.vsprops
new file mode 100644
index 0000000..d61ba30
--- /dev/null
+++ b/Mkfiles/vc10/crt_secure_no_deprecate.vsprops
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="Windows-1252"?>

+<VisualStudioPropertySheet

+	ProjectType="Visual C++"

+	Version="8.00"

+	Name="crt_secure_no_deprecate"

+	>

+	<Tool

+		Name="VCCLCompilerTool"

+		PreprocessorDefinitions="_CRT_SECURE_NO_DEPRECATE"

+	/>

+</VisualStudioPropertySheet>

diff --git a/Mkfiles/vc10/genmacro/genmacro.vcxproj b/Mkfiles/vc10/genmacro/genmacro.vcxproj
new file mode 100644
index 0000000..15cf169
--- /dev/null
+++ b/Mkfiles/vc10/genmacro/genmacro.vcxproj
@@ -0,0 +1,117 @@
+<?xml version="1.0" encoding="utf-8"?>

+<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">

+  <ItemGroup Label="ProjectConfigurations">

+    <ProjectConfiguration Include="Debug|Win32">

+      <Configuration>Debug</Configuration>

+      <Platform>Win32</Platform>

+    </ProjectConfiguration>

+    <ProjectConfiguration Include="Release|Win32">

+      <Configuration>Release</Configuration>

+      <Platform>Win32</Platform>

+    </ProjectConfiguration>

+  </ItemGroup>

+  <PropertyGroup Label="Globals">

+    <ProjectGuid>{225700A5-07B8-434E-AD61-555278BF6733}</ProjectGuid>

+    <RootNamespace>genmacro</RootNamespace>

+    <Keyword>Win32Proj</Keyword>

+  </PropertyGroup>

+  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />

+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">

+    <ConfigurationType>Application</ConfigurationType>

+    <CharacterSet>MultiByte</CharacterSet>

+  </PropertyGroup>

+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">

+    <ConfigurationType>Application</ConfigurationType>

+    <CharacterSet>MultiByte</CharacterSet>

+  </PropertyGroup>

+  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />

+  <ImportGroup Label="ExtensionSettings">

+  </ImportGroup>

+  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets">

+    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" />

+    <Import Project="..\crt_secure_no_deprecate.props" />

+  </ImportGroup>

+  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets">

+    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" />

+    <Import Project="..\crt_secure_no_deprecate.props" />

+  </ImportGroup>

+  <PropertyGroup Label="UserMacros" />

+  <PropertyGroup>

+    <_ProjectFileVersion>10.0.21006.1</_ProjectFileVersion>

+    <OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(Platform)\$(Configuration)\</OutDir>

+    <IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(Platform)\$(Configuration)\</IntDir>

+    <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</LinkIncremental>

+    <OutDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(Platform)\$(Configuration)\</OutDir>

+    <IntDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(Platform)\$(Configuration)\</IntDir>

+    <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">false</LinkIncremental>

+  </PropertyGroup>

+  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">

+    <ClCompile>

+      <Optimization>Disabled</Optimization>

+      <PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>

+      <MinimalRebuild>true</MinimalRebuild>

+      <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>

+      <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>

+      <PrecompiledHeader>

+      </PrecompiledHeader>

+      <ProgramDataBaseFileName>$(IntDir)</ProgramDataBaseFileName>

+      <WarningLevel>Level3</WarningLevel>

+      <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>

+      <CompileAs>Default</CompileAs>

+    </ClCompile>

+    <Link>

+      <OutputFile>$(OutDir)genmacro.exe</OutputFile>

+      <GenerateDebugInformation>true</GenerateDebugInformation>

+      <ProgramDatabaseFile>$(OutDir)$(TargetName).pdb</ProgramDatabaseFile>

+      <SubSystem>Console</SubSystem>

+      <RandomizedBaseAddress>false</RandomizedBaseAddress>

+      <DataExecutionPrevention>

+      </DataExecutionPrevention>

+      <TargetMachine>MachineX86</TargetMachine>

+    </Link>

+    <PostBuildEvent>

+      <Command>run.bat "$(TargetPath)"</Command>

+    </PostBuildEvent>

+  </ItemDefinitionGroup>

+  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">

+    <ClCompile>

+      <Optimization>Full</Optimization>

+      <PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>

+      <RuntimeLibrary>MultiThreaded</RuntimeLibrary>

+      <PrecompiledHeader>

+      </PrecompiledHeader>

+      <ProgramDataBaseFileName>$(IntDir)</ProgramDataBaseFileName>

+      <WarningLevel>Level3</WarningLevel>

+      <CompileAs>Default</CompileAs>

+    </ClCompile>

+    <Link>

+      <OutputFile>$(OutDir)genmacro.exe</OutputFile>

+      <ProgramDatabaseFile>$(OutDir)$(TargetName).pdb</ProgramDatabaseFile>

+      <SubSystem>Console</SubSystem>

+      <OptimizeReferences>true</OptimizeReferences>

+      <EnableCOMDATFolding>true</EnableCOMDATFolding>

+      <RandomizedBaseAddress>false</RandomizedBaseAddress>

+      <DataExecutionPrevention>

+      </DataExecutionPrevention>

+      <TargetMachine>MachineX86</TargetMachine>

+    </Link>

+    <PostBuildEvent>

+      <Command>run.bat "$(TargetPath)"</Command>

+    </PostBuildEvent>

+  </ItemDefinitionGroup>

+  <ItemGroup>

+    <ClCompile Include="..\..\..\tools\genmacro\genmacro.c" />

+  </ItemGroup>

+  <ItemGroup>

+    <None Include="run.bat" />

+  </ItemGroup>

+  <ItemGroup>

+    <ProjectReference Include="..\genversion\genversion.vcxproj">

+      <Project>{b545983b-8ee0-4a7b-a67a-e749eeae62a2}</Project>

+      <ReferenceOutputAssembly>false</ReferenceOutputAssembly>

+    </ProjectReference>

+  </ItemGroup>

+  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />

+  <ImportGroup Label="ExtensionTargets">

+  </ImportGroup>

+</Project>
\ No newline at end of file
diff --git a/Mkfiles/vc10/genmacro/genmacro.vcxproj.filters b/Mkfiles/vc10/genmacro/genmacro.vcxproj.filters
new file mode 100644
index 0000000..b9d110e
--- /dev/null
+++ b/Mkfiles/vc10/genmacro/genmacro.vcxproj.filters
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="utf-8"?>

+<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">

+  <ItemGroup>

+    <Filter Include="Source Files">

+      <UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>

+      <Extensions>cpp;c;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>

+    </Filter>

+  </ItemGroup>

+  <ItemGroup>

+    <ClCompile Include="..\..\..\tools\genmacro\genmacro.c">

+      <Filter>Source Files</Filter>

+    </ClCompile>

+  </ItemGroup>

+  <ItemGroup>

+    <None Include="run.bat" />

+  </ItemGroup>

+</Project>
\ No newline at end of file
diff --git a/Mkfiles/vc10/genmacro/run.bat b/Mkfiles/vc10/genmacro/run.bat
new file mode 100644
index 0000000..d2fbb98
--- /dev/null
+++ b/Mkfiles/vc10/genmacro/run.bat
@@ -0,0 +1,5 @@
+cd ..\..\..

+%1 nasm-version.c nasm_version_mac version.mac

+%1 nasm-macros.c nasm_standard_mac modules\parsers\nasm\nasm-std.mac

+%1 win64-nasm.c win64_nasm_stdmac modules\objfmts\coff\win64-nasm.mac

+%1 win64-gas.c win64_gas_stdmac modules\objfmts\coff\win64-gas.mac

diff --git a/Mkfiles/vc10/genmodule/genmodule.vcxproj b/Mkfiles/vc10/genmodule/genmodule.vcxproj
new file mode 100644
index 0000000..eca6ce8
--- /dev/null
+++ b/Mkfiles/vc10/genmodule/genmodule.vcxproj
@@ -0,0 +1,118 @@
+<?xml version="1.0" encoding="utf-8"?>

+<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">

+  <ItemGroup Label="ProjectConfigurations">

+    <ProjectConfiguration Include="Debug|Win32">

+      <Configuration>Debug</Configuration>

+      <Platform>Win32</Platform>

+    </ProjectConfiguration>

+    <ProjectConfiguration Include="Release|Win32">

+      <Configuration>Release</Configuration>

+      <Platform>Win32</Platform>

+    </ProjectConfiguration>

+  </ItemGroup>

+  <PropertyGroup Label="Globals">

+    <ProjectGuid>{F0E8B707-00C5-4FF2-B8EF-7C39817132A0}</ProjectGuid>

+    <RootNamespace>genmodule</RootNamespace>

+    <Keyword>Win32Proj</Keyword>

+  </PropertyGroup>

+  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />

+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">

+    <ConfigurationType>Application</ConfigurationType>

+    <CharacterSet>MultiByte</CharacterSet>

+  </PropertyGroup>

+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">

+    <ConfigurationType>Application</ConfigurationType>

+    <CharacterSet>MultiByte</CharacterSet>

+  </PropertyGroup>

+  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />

+  <ImportGroup Label="ExtensionSettings">

+  </ImportGroup>

+  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets">

+    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" />

+    <Import Project="..\crt_secure_no_deprecate.props" />

+  </ImportGroup>

+  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets">

+    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" />

+    <Import Project="..\crt_secure_no_deprecate.props" />

+  </ImportGroup>

+  <PropertyGroup Label="UserMacros" />

+  <PropertyGroup>

+    <_ProjectFileVersion>10.0.21006.1</_ProjectFileVersion>

+    <OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(Platform)\$(Configuration)\</OutDir>

+    <IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(Platform)\$(Configuration)\</IntDir>

+    <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</LinkIncremental>

+    <OutDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(Platform)\$(Configuration)\</OutDir>

+    <IntDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(Platform)\$(Configuration)\</IntDir>

+    <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">false</LinkIncremental>

+  </PropertyGroup>

+  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">

+    <ClCompile>

+      <Optimization>Disabled</Optimization>

+      <AdditionalIncludeDirectories>%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>

+      <PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;FILTERMODE;%(PreprocessorDefinitions)</PreprocessorDefinitions>

+      <MinimalRebuild>true</MinimalRebuild>

+      <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>

+      <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>

+      <PrecompiledHeader>

+      </PrecompiledHeader>

+      <AssemblerListingLocation>$(IntDir)</AssemblerListingLocation>

+      <ProgramDataBaseFileName>$(IntDir)</ProgramDataBaseFileName>

+      <WarningLevel>Level3</WarningLevel>

+      <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>

+      <CompileAs>Default</CompileAs>

+    </ClCompile>

+    <Link>

+      <OutputFile>$(OutDir)genmodule.exe</OutputFile>

+      <GenerateDebugInformation>true</GenerateDebugInformation>

+      <ProgramDatabaseFile>$(OutDir)$(TargetName).pdb</ProgramDatabaseFile>

+      <SubSystem>Console</SubSystem>

+      <RandomizedBaseAddress>false</RandomizedBaseAddress>

+      <DataExecutionPrevention>

+      </DataExecutionPrevention>

+      <TargetMachine>MachineX86</TargetMachine>

+    </Link>

+    <PostBuildEvent>

+      <Command>run.bat "$(TargetPath)"</Command>

+    </PostBuildEvent>

+  </ItemDefinitionGroup>

+  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">

+    <ClCompile>

+      <Optimization>Full</Optimization>

+      <AdditionalIncludeDirectories>%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>

+      <PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;FILTERMODE;%(PreprocessorDefinitions)</PreprocessorDefinitions>

+      <RuntimeLibrary>MultiThreaded</RuntimeLibrary>

+      <PrecompiledHeader>

+      </PrecompiledHeader>

+      <AssemblerListingLocation>$(IntDir)</AssemblerListingLocation>

+      <ProgramDataBaseFileName>$(IntDir)</ProgramDataBaseFileName>

+      <WarningLevel>Level3</WarningLevel>

+      <CompileAs>Default</CompileAs>

+    </ClCompile>

+    <Link>

+      <OutputFile>$(OutDir)genmodule.exe</OutputFile>

+      <ProgramDatabaseFile>$(OutDir)$(TargetName).pdb</ProgramDatabaseFile>

+      <SubSystem>Console</SubSystem>

+      <OptimizeReferences>true</OptimizeReferences>

+      <EnableCOMDATFolding>true</EnableCOMDATFolding>

+      <RandomizedBaseAddress>false</RandomizedBaseAddress>

+      <DataExecutionPrevention>

+      </DataExecutionPrevention>

+      <TargetMachine>MachineX86</TargetMachine>

+    </Link>

+    <PostBuildEvent>

+      <Command>run.bat "$(TargetPath)"</Command>

+    </PostBuildEvent>

+  </ItemDefinitionGroup>

+  <ItemGroup>

+    <ClCompile Include="..\..\..\libyasm\genmodule.c" />

+  </ItemGroup>

+  <ItemGroup>

+    <None Include="run.bat" />

+  </ItemGroup>

+  <ItemGroup>

+    <ClInclude Include="..\..\..\libyasm\compat-queue.h" />

+  </ItemGroup>

+  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />

+  <ImportGroup Label="ExtensionTargets">

+  </ImportGroup>

+</Project>
\ No newline at end of file
diff --git a/Mkfiles/vc10/genmodule/genmodule.vcxproj.filters b/Mkfiles/vc10/genmodule/genmodule.vcxproj.filters
new file mode 100644
index 0000000..e977736
--- /dev/null
+++ b/Mkfiles/vc10/genmodule/genmodule.vcxproj.filters
@@ -0,0 +1,20 @@
+<?xml version="1.0" encoding="utf-8"?>

+<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">

+  <ItemGroup>

+    <Filter Include="Source Files">

+      <UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>

+      <Extensions>cpp;c;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>

+    </Filter>

+  </ItemGroup>

+  <ItemGroup>

+    <ClCompile Include="..\..\..\libyasm\genmodule.c">

+      <Filter>Source Files</Filter>

+    </ClCompile>

+  </ItemGroup>

+  <ItemGroup>

+    <None Include="run.bat" />

+  </ItemGroup>

+  <ItemGroup>

+    <ClInclude Include="..\..\..\libyasm\compat-queue.h" />

+  </ItemGroup>

+</Project>
\ No newline at end of file
diff --git a/Mkfiles/vc10/genmodule/run.bat b/Mkfiles/vc10/genmodule/run.bat
new file mode 100644
index 0000000..e34a416
--- /dev/null
+++ b/Mkfiles/vc10/genmodule/run.bat
@@ -0,0 +1,3 @@
+@echo off

+cd ..\..\..

+%1 libyasm\module.in Makefile.am

diff --git a/Mkfiles/vc10/genperf/genperf.vcxproj b/Mkfiles/vc10/genperf/genperf.vcxproj
new file mode 100644
index 0000000..9d14bf5
--- /dev/null
+++ b/Mkfiles/vc10/genperf/genperf.vcxproj
@@ -0,0 +1,144 @@
+<?xml version="1.0" encoding="utf-8"?>

+<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">

+  <ItemGroup Label="ProjectConfigurations">

+    <ProjectConfiguration Include="Debug|Win32">

+      <Configuration>Debug</Configuration>

+      <Platform>Win32</Platform>

+    </ProjectConfiguration>

+    <ProjectConfiguration Include="Release|Win32">

+      <Configuration>Release</Configuration>

+      <Platform>Win32</Platform>

+    </ProjectConfiguration>

+  </ItemGroup>

+  <PropertyGroup Label="Globals">

+    <ProjectGuid>{C45A8B59-8B59-4D5D-A8E8-FB090F8DD619}</ProjectGuid>

+    <RootNamespace>genperf</RootNamespace>

+    <Keyword>Win32Proj</Keyword>

+  </PropertyGroup>

+  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />

+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">

+    <ConfigurationType>Application</ConfigurationType>

+    <CharacterSet>MultiByte</CharacterSet>

+  </PropertyGroup>

+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">

+    <ConfigurationType>Application</ConfigurationType>

+    <CharacterSet>MultiByte</CharacterSet>

+  </PropertyGroup>

+  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />

+  <ImportGroup Label="ExtensionSettings">

+  </ImportGroup>

+  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets">

+    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" />

+    <Import Project="..\crt_secure_no_deprecate.props" />

+  </ImportGroup>

+  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets">

+    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" />

+    <Import Project="..\crt_secure_no_deprecate.props" />

+  </ImportGroup>

+  <PropertyGroup Label="UserMacros" />

+  <PropertyGroup>

+    <_ProjectFileVersion>10.0.21006.1</_ProjectFileVersion>

+    <OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(Platform)\$(Configuration)\</OutDir>

+    <IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(Platform)\$(Configuration)\</IntDir>

+    <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</LinkIncremental>

+    <OutDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(Platform)\$(Configuration)\</OutDir>

+    <IntDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(Platform)\$(Configuration)\</IntDir>

+    <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">false</LinkIncremental>

+    <PreBuildEventUseInBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">false</PreBuildEventUseInBuild>

+    <PreBuildEventUseInBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">false</PreBuildEventUseInBuild>

+    <PreLinkEventUseInBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">false</PreLinkEventUseInBuild>

+    <PreLinkEventUseInBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">false</PreLinkEventUseInBuild>

+  </PropertyGroup>

+  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">

+    <ClCompile>

+      <Optimization>Disabled</Optimization>

+      <AdditionalIncludeDirectories>..;../../..;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>

+      <PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;STDC_HEADERS;%(PreprocessorDefinitions)</PreprocessorDefinitions>

+      <MinimalRebuild>true</MinimalRebuild>

+      <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>

+      <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>

+      <PrecompiledHeader>

+      </PrecompiledHeader>

+      <ProgramDataBaseFileName>$(IntDir)</ProgramDataBaseFileName>

+      <WarningLevel>Level3</WarningLevel>

+      <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>

+      <CompileAs>Default</CompileAs>

+    </ClCompile>

+    <Link>

+      <OutputFile>$(OutDir)genperf.exe</OutputFile>

+      <GenerateDebugInformation>true</GenerateDebugInformation>

+      <ProgramDatabaseFile>$(OutDir)$(TargetName).pdb</ProgramDatabaseFile>

+      <SubSystem>Console</SubSystem>

+      <RandomizedBaseAddress>false</RandomizedBaseAddress>

+      <DataExecutionPrevention>

+      </DataExecutionPrevention>

+      <TargetMachine>MachineX86</TargetMachine>

+    </Link>

+    <PostBuildEvent>

+      <Command>

+      </Command>

+    </PostBuildEvent>

+    <CustomBuildStep>

+      <Command>run.bat "$(TargetPath)"</Command>

+    </CustomBuildStep>

+    <CustomBuildStep>

+      <Outputs>x86insn_nasm.c;x86insn_gas.c;x86cpu.c;x86regtmod.c;%(Outputs)</Outputs>

+    </CustomBuildStep>

+  </ItemDefinitionGroup>

+  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">

+    <ClCompile>

+      <Optimization>Full</Optimization>

+      <AdditionalIncludeDirectories>..;../../..;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>

+      <PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;STDC_HEADERS;%(PreprocessorDefinitions)</PreprocessorDefinitions>

+      <RuntimeLibrary>MultiThreaded</RuntimeLibrary>

+      <PrecompiledHeader>

+      </PrecompiledHeader>

+      <ProgramDataBaseFileName>$(IntDir)</ProgramDataBaseFileName>

+      <WarningLevel>Level3</WarningLevel>

+      <CompileAs>Default</CompileAs>

+    </ClCompile>

+    <Link>

+      <OutputFile>$(OutDir)genperf.exe</OutputFile>

+      <ProgramDatabaseFile>$(OutDir)$(TargetName).pdb</ProgramDatabaseFile>

+      <SubSystem>Console</SubSystem>

+      <OptimizeReferences>true</OptimizeReferences>

+      <EnableCOMDATFolding>true</EnableCOMDATFolding>

+      <RandomizedBaseAddress>false</RandomizedBaseAddress>

+      <DataExecutionPrevention>

+      </DataExecutionPrevention>

+      <TargetMachine>MachineX86</TargetMachine>

+    </Link>

+    <PostBuildEvent>

+      <Command>

+      </Command>

+    </PostBuildEvent>

+    <CustomBuildStep>

+      <Command>run.bat "$(TargetPath)"</Command>

+    </CustomBuildStep>

+    <CustomBuildStep>

+      <Outputs>x86insn_nasm.c;x86insn_gas.c;x86cpu.c;x86regtmod.c;%(Outputs)</Outputs>

+    </CustomBuildStep>

+  </ItemDefinitionGroup>

+  <ItemGroup>

+    <ClCompile Include="..\..\..\tools\genperf\genperf.c" />

+    <ClCompile Include="..\..\..\tools\genperf\perfect.c" />

+    <ClCompile Include="..\..\..\libyasm\phash.c" />

+    <ClCompile Include="..\..\..\libyasm\xmalloc.c" />

+    <ClCompile Include="..\..\..\libyasm\xstrdup.c" />

+  </ItemGroup>

+  <ItemGroup>

+    <ClInclude Include="..\..\..\libyasm\compat-queue.h" />

+    <ClInclude Include="..\..\..\libyasm\phash.h" />

+    <ClInclude Include="..\..\..\tools\genperf\perfect.h" />

+    <ClInclude Include="..\..\..\tools\genperf\standard.h" />

+    <ClInclude Include="..\..\..\util.h" />

+    <ClInclude Include="..\config.h" />

+    <ClInclude Include="..\libyasm-stdint.h" />

+  </ItemGroup>

+  <ItemGroup>

+    <None Include="run.bat" />

+  </ItemGroup>

+  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />

+  <ImportGroup Label="ExtensionTargets">

+  </ImportGroup>

+</Project>
\ No newline at end of file
diff --git a/Mkfiles/vc10/genperf/genperf.vcxproj.filters b/Mkfiles/vc10/genperf/genperf.vcxproj.filters
new file mode 100644
index 0000000..f45157d
--- /dev/null
+++ b/Mkfiles/vc10/genperf/genperf.vcxproj.filters
@@ -0,0 +1,56 @@
+<?xml version="1.0" encoding="utf-8"?>

+<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">

+  <ItemGroup>

+    <Filter Include="Header Files">

+      <UniqueIdentifier>{3C1E9AA8-6338-4CED-99F1-BEBA80607BD5}</UniqueIdentifier>

+      <Extensions>h;hpp;hxx;hm;inl;inc;xsd</Extensions>

+    </Filter>

+    <Filter Include="Source Files">

+      <UniqueIdentifier>{1062695D-1C50-4068-8313-73A409885BC1}</UniqueIdentifier>

+      <Extensions>cpp;c;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>

+    </Filter>

+  </ItemGroup>

+  <ItemGroup>

+    <ClCompile Include="..\..\..\libyasm\phash.c">

+      <Filter>Source Files</Filter>

+    </ClCompile>

+    <ClCompile Include="..\..\..\libyasm\xmalloc.c">

+      <Filter>Source Files</Filter>

+    </ClCompile>

+    <ClCompile Include="..\..\..\libyasm\xstrdup.c">

+      <Filter>Source Files</Filter>

+    </ClCompile>

+    <ClCompile Include="..\..\..\tools\genperf\genperf.c">

+      <Filter>Source Files</Filter>

+    </ClCompile>

+    <ClCompile Include="..\..\..\tools\genperf\perfect.c">

+      <Filter>Source Files</Filter>

+    </ClCompile>

+  </ItemGroup>

+  <ItemGroup>

+    <ClInclude Include="..\..\..\tools\genperf\perfect.h">

+      <Filter>Header Files</Filter>

+    </ClInclude>

+    <ClInclude Include="..\..\..\tools\genperf\standard.h">

+      <Filter>Header Files</Filter>

+    </ClInclude>

+    <ClInclude Include="..\..\..\util.h">

+      <Filter>Header Files</Filter>

+    </ClInclude>

+    <ClInclude Include="..\..\..\libyasm\compat-queue.h">

+      <Filter>Header Files</Filter>

+    </ClInclude>

+    <ClInclude Include="..\libyasm-stdint.h">

+      <Filter>Header Files</Filter>

+    </ClInclude>

+    <ClInclude Include="..\..\..\libyasm\phash.h">

+      <Filter>Header Files</Filter>

+    </ClInclude>

+    <ClInclude Include="..\config.h">

+      <Filter>Header Files</Filter>

+    </ClInclude>

+  </ItemGroup>

+  <ItemGroup>

+    <None Include="run.bat" />

+  </ItemGroup>

+</Project>
\ No newline at end of file
diff --git a/Mkfiles/vc10/genperf/run.bat b/Mkfiles/vc10/genperf/run.bat
new file mode 100644
index 0000000..5827138
--- /dev/null
+++ b/Mkfiles/vc10/genperf/run.bat
@@ -0,0 +1,28 @@
+cd ..\..\..

+@echo off

+for /f "usebackq tokens=1*" %%f in (`reg query HKCR\Python.File\shell\open\command`) do (set _my_=%%f %%g)

+goto next%errorlevel%

+

+:next1

+echo Building without Python ...

+goto therest

+

+:next0

+echo Building with Python ...

+set _res_=%_my_:*REG_SZ=%

+set _end_=%_res_:*exe"=%

+call set _python_=%%_res_:%_end_%=%%

+call %_python_% modules\arch\x86\gen_x86_insn.py

+

+:therest

+@echo on

+call :update %1 x86insn_nasm.gperf x86insn_nasm.c

+call :update %1 x86insn_gas.gperf x86insn_gas.c

+call :update %1 modules\arch\x86\x86cpu.gperf x86cpu.c

+call :update %1 modules\arch\x86\x86regtmod.gperf x86regtmod.c

+goto :eof

+

+:update

+%1 %2 tf

+call mkfiles\vc10\out_copy_rename tf .\ %3

+del tf

diff --git a/Mkfiles/vc10/genstring/genstring.vcxproj b/Mkfiles/vc10/genstring/genstring.vcxproj
new file mode 100644
index 0000000..118ec80
--- /dev/null
+++ b/Mkfiles/vc10/genstring/genstring.vcxproj
@@ -0,0 +1,111 @@
+<?xml version="1.0" encoding="utf-8"?>

+<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">

+  <ItemGroup Label="ProjectConfigurations">

+    <ProjectConfiguration Include="Debug|Win32">

+      <Configuration>Debug</Configuration>

+      <Platform>Win32</Platform>

+    </ProjectConfiguration>

+    <ProjectConfiguration Include="Release|Win32">

+      <Configuration>Release</Configuration>

+      <Platform>Win32</Platform>

+    </ProjectConfiguration>

+  </ItemGroup>

+  <PropertyGroup Label="Globals">

+    <ProjectGuid>{021CEB0A-F721-4F59-B349-9CEEAF244459}</ProjectGuid>

+    <RootNamespace>genstring</RootNamespace>

+    <Keyword>Win32Proj</Keyword>

+  </PropertyGroup>

+  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />

+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">

+    <ConfigurationType>Application</ConfigurationType>

+    <CharacterSet>MultiByte</CharacterSet>

+  </PropertyGroup>

+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">

+    <ConfigurationType>Application</ConfigurationType>

+    <CharacterSet>MultiByte</CharacterSet>

+  </PropertyGroup>

+  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />

+  <ImportGroup Label="ExtensionSettings">

+  </ImportGroup>

+  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets">

+    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" />

+    <Import Project="..\crt_secure_no_deprecate.props" />

+  </ImportGroup>

+  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets">

+    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" />

+    <Import Project="..\crt_secure_no_deprecate.props" />

+  </ImportGroup>

+  <PropertyGroup Label="UserMacros" />

+  <PropertyGroup>

+    <_ProjectFileVersion>10.0.21006.1</_ProjectFileVersion>

+    <OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(Platform)\$(Configuration)\</OutDir>

+    <IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(Platform)\$(Configuration)\</IntDir>

+    <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</LinkIncremental>

+    <OutDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(Platform)\$(Configuration)\</OutDir>

+    <IntDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(Platform)\$(Configuration)\</IntDir>

+    <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">false</LinkIncremental>

+  </PropertyGroup>

+  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">

+    <ClCompile>

+      <Optimization>Disabled</Optimization>

+      <PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>

+      <MinimalRebuild>true</MinimalRebuild>

+      <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>

+      <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>

+      <PrecompiledHeader>

+      </PrecompiledHeader>

+      <ProgramDataBaseFileName>$(IntDir)</ProgramDataBaseFileName>

+      <WarningLevel>Level3</WarningLevel>

+      <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>

+      <CompileAs>Default</CompileAs>

+    </ClCompile>

+    <Link>

+      <OutputFile>$(OutDir)genstring.exe</OutputFile>

+      <GenerateDebugInformation>true</GenerateDebugInformation>

+      <ProgramDatabaseFile>$(OutDir)$(TargetName).pdb</ProgramDatabaseFile>

+      <SubSystem>Console</SubSystem>

+      <RandomizedBaseAddress>false</RandomizedBaseAddress>

+      <DataExecutionPrevention>

+      </DataExecutionPrevention>

+      <TargetMachine>MachineX86</TargetMachine>

+    </Link>

+    <PostBuildEvent>

+      <Command>run.bat "$(TargetPath)"</Command>

+    </PostBuildEvent>

+  </ItemDefinitionGroup>

+  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">

+    <ClCompile>

+      <Optimization>Full</Optimization>

+      <PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>

+      <RuntimeLibrary>MultiThreaded</RuntimeLibrary>

+      <PrecompiledHeader>

+      </PrecompiledHeader>

+      <ProgramDataBaseFileName>$(IntDir)</ProgramDataBaseFileName>

+      <WarningLevel>Level3</WarningLevel>

+      <CompileAs>Default</CompileAs>

+    </ClCompile>

+    <Link>

+      <OutputFile>$(OutDir)genstring.exe</OutputFile>

+      <ProgramDatabaseFile>$(OutDir)$(TargetName).pdb</ProgramDatabaseFile>

+      <SubSystem>Console</SubSystem>

+      <OptimizeReferences>true</OptimizeReferences>

+      <EnableCOMDATFolding>true</EnableCOMDATFolding>

+      <RandomizedBaseAddress>false</RandomizedBaseAddress>

+      <DataExecutionPrevention>

+      </DataExecutionPrevention>

+      <TargetMachine>MachineX86</TargetMachine>

+    </Link>

+    <PostBuildEvent>

+      <Command>run.bat "$(TargetPath)"</Command>

+    </PostBuildEvent>

+  </ItemDefinitionGroup>

+  <ItemGroup>

+    <ClCompile Include="..\..\..\genstring.c" />

+  </ItemGroup>

+  <ItemGroup>

+    <None Include="run.bat" />

+  </ItemGroup>

+  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />

+  <ImportGroup Label="ExtensionTargets">

+  </ImportGroup>

+</Project>
\ No newline at end of file
diff --git a/Mkfiles/vc10/genstring/genstring.vcxproj.filters b/Mkfiles/vc10/genstring/genstring.vcxproj.filters
new file mode 100644
index 0000000..4ec3efa
--- /dev/null
+++ b/Mkfiles/vc10/genstring/genstring.vcxproj.filters
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="utf-8"?>

+<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">

+  <ItemGroup>

+    <Filter Include="Source Files">

+      <UniqueIdentifier>{28EBE11C-5BE8-4935-9381-F57696749E0C}</UniqueIdentifier>

+      <Extensions>cpp;c;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>

+    </Filter>

+  </ItemGroup>

+  <ItemGroup>

+    <ClCompile Include="..\..\..\genstring.c">

+      <Filter>Source Files</Filter>

+    </ClCompile>

+  </ItemGroup>

+  <ItemGroup>

+    <None Include="run.bat" />

+  </ItemGroup>

+</Project>
\ No newline at end of file
diff --git a/Mkfiles/vc10/genstring/run.bat b/Mkfiles/vc10/genstring/run.bat
new file mode 100644
index 0000000..5864b1d
--- /dev/null
+++ b/Mkfiles/vc10/genstring/run.bat
@@ -0,0 +1,2 @@
+cd ..\..\..

+%1 license_msg license.c COPYING

diff --git a/Mkfiles/vc10/genversion/genversion.vcxproj b/Mkfiles/vc10/genversion/genversion.vcxproj
new file mode 100644
index 0000000..1bfd9e7
--- /dev/null
+++ b/Mkfiles/vc10/genversion/genversion.vcxproj
@@ -0,0 +1,119 @@
+<?xml version="1.0" encoding="utf-8"?>

+<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">

+  <ItemGroup Label="ProjectConfigurations">

+    <ProjectConfiguration Include="Debug|Win32">

+      <Configuration>Debug</Configuration>

+      <Platform>Win32</Platform>

+    </ProjectConfiguration>

+    <ProjectConfiguration Include="Release|Win32">

+      <Configuration>Release</Configuration>

+      <Platform>Win32</Platform>

+    </ProjectConfiguration>

+  </ItemGroup>

+  <PropertyGroup Label="Globals">

+    <ProjectGuid>{B545983B-8EE0-4A7B-A67A-E749EEAE62A2}</ProjectGuid>

+    <RootNamespace>genversion</RootNamespace>

+    <Keyword>Win32Proj</Keyword>

+  </PropertyGroup>

+  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />

+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">

+    <ConfigurationType>Application</ConfigurationType>

+    <CharacterSet>MultiByte</CharacterSet>

+  </PropertyGroup>

+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">

+    <ConfigurationType>Application</ConfigurationType>

+    <CharacterSet>MultiByte</CharacterSet>

+  </PropertyGroup>

+  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />

+  <ImportGroup Label="ExtensionSettings">

+  </ImportGroup>

+  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets">

+    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" />

+    <Import Project="..\crt_secure_no_deprecate.props" />

+  </ImportGroup>

+  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets">

+    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" />

+    <Import Project="..\crt_secure_no_deprecate.props" />

+  </ImportGroup>

+  <PropertyGroup Label="UserMacros" />

+  <PropertyGroup>

+    <_ProjectFileVersion>10.0.21006.1</_ProjectFileVersion>

+    <OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(Platform)\$(Configuration)\</OutDir>

+    <IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(Platform)\$(Configuration)\</IntDir>

+    <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</LinkIncremental>

+    <OutDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(Platform)\$(Configuration)\</OutDir>

+    <IntDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(Platform)\$(Configuration)\</IntDir>

+    <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">false</LinkIncremental>

+  </PropertyGroup>

+  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">

+    <ClCompile>

+      <Optimization>Disabled</Optimization>

+      <AdditionalIncludeDirectories>..\..\vc10;../../..;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>

+      <PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>

+      <MinimalRebuild>true</MinimalRebuild>

+      <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>

+      <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>

+      <PrecompiledHeader>

+      </PrecompiledHeader>

+      <ProgramDataBaseFileName>$(IntDir)</ProgramDataBaseFileName>

+      <WarningLevel>Level3</WarningLevel>

+      <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>

+      <CompileAs>Default</CompileAs>

+    </ClCompile>

+    <Link>

+      <OutputFile>$(OutDir)genversion.exe</OutputFile>

+      <GenerateDebugInformation>true</GenerateDebugInformation>

+      <ProgramDatabaseFile>$(OutDir)$(TargetName).pdb</ProgramDatabaseFile>

+      <SubSystem>Console</SubSystem>

+      <RandomizedBaseAddress>false</RandomizedBaseAddress>

+      <DataExecutionPrevention>

+      </DataExecutionPrevention>

+      <TargetMachine>MachineX86</TargetMachine>

+    </Link>

+    <PostBuildEvent>

+      <Command>run.bat "$(TargetPath)"</Command>

+    </PostBuildEvent>

+    <PreBuildEvent>

+      <Command>runpre.bat</Command>

+    </PreBuildEvent>

+  </ItemDefinitionGroup>

+  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">

+    <ClCompile>

+      <Optimization>Full</Optimization>

+      <AdditionalIncludeDirectories>..\..\vc10;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>

+      <PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>

+      <RuntimeLibrary>MultiThreaded</RuntimeLibrary>

+      <PrecompiledHeader>

+      </PrecompiledHeader>

+      <ProgramDataBaseFileName>$(IntDir)</ProgramDataBaseFileName>

+      <WarningLevel>Level3</WarningLevel>

+      <CompileAs>Default</CompileAs>

+    </ClCompile>

+    <Link>

+      <OutputFile>$(OutDir)genversion.exe</OutputFile>

+      <ProgramDatabaseFile>$(OutDir)$(TargetName).pdb</ProgramDatabaseFile>

+      <SubSystem>Console</SubSystem>

+      <OptimizeReferences>true</OptimizeReferences>

+      <EnableCOMDATFolding>true</EnableCOMDATFolding>

+      <RandomizedBaseAddress>false</RandomizedBaseAddress>

+      <DataExecutionPrevention>

+      </DataExecutionPrevention>

+      <TargetMachine>MachineX86</TargetMachine>

+    </Link>

+    <PostBuildEvent>

+      <Command>run.bat "$(TargetPath)"</Command>

+    </PostBuildEvent>

+  </ItemDefinitionGroup>

+  <ItemGroup>

+    <ClCompile Include="..\..\..\modules\preprocs\nasm\genversion.c" />

+  </ItemGroup>

+  <ItemGroup>

+    <ClInclude Include="..\config.h" />

+  </ItemGroup>

+  <ItemGroup>

+    <None Include="run.bat" />

+  </ItemGroup>

+  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />

+  <ImportGroup Label="ExtensionTargets">

+  </ImportGroup>

+</Project>
\ No newline at end of file
diff --git a/Mkfiles/vc10/genversion/genversion.vcxproj.filters b/Mkfiles/vc10/genversion/genversion.vcxproj.filters
new file mode 100644
index 0000000..a5fd059
--- /dev/null
+++ b/Mkfiles/vc10/genversion/genversion.vcxproj.filters
@@ -0,0 +1,26 @@
+<?xml version="1.0" encoding="utf-8"?>

+<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">

+  <ItemGroup>

+    <Filter Include="Header Files">

+      <UniqueIdentifier>{2acbec3a-0ed8-4b2e-826e-a84c7d35f205}</UniqueIdentifier>

+      <Extensions>h;hpp;hxx;hm;inl</Extensions>

+    </Filter>

+    <Filter Include="Source Files">

+      <UniqueIdentifier>{E67ED277-E4F2-4D79-8C9E-962BAC164F3F}</UniqueIdentifier>

+      <Extensions>cpp;c;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>

+    </Filter>

+  </ItemGroup>

+  <ItemGroup>

+    <ClCompile Include="..\..\..\modules\preprocs\nasm\genversion.c">

+      <Filter>Source Files</Filter>

+    </ClCompile>

+  </ItemGroup>

+  <ItemGroup>

+    <ClInclude Include="..\config.h">

+      <Filter>Header Files</Filter>

+    </ClInclude>

+  </ItemGroup>

+  <ItemGroup>

+    <None Include="run.bat" />

+  </ItemGroup>

+</Project>
\ No newline at end of file
diff --git a/Mkfiles/vc10/genversion/run.bat b/Mkfiles/vc10/genversion/run.bat
new file mode 100644
index 0000000..30edf8f
--- /dev/null
+++ b/Mkfiles/vc10/genversion/run.bat
@@ -0,0 +1,2 @@
+cd ..\..\..

+%1 version.mac

diff --git a/Mkfiles/vc10/libyasm-stdint.h b/Mkfiles/vc10/libyasm-stdint.h
new file mode 100644
index 0000000..fed61b3
--- /dev/null
+++ b/Mkfiles/vc10/libyasm-stdint.h
@@ -0,0 +1,8 @@
+#ifndef _UINTPTR_T_DEFINED

+#ifdef _WIN64

+#include <vadefs.h>

+#else

+typedef unsigned long uintptr_t;

+#endif

+#define _UINTPTR_T_DEFINED

+#endif

diff --git a/Mkfiles/vc10/libyasm/libyasm.vcxproj b/Mkfiles/vc10/libyasm/libyasm.vcxproj
new file mode 100644
index 0000000..1498e31
--- /dev/null
+++ b/Mkfiles/vc10/libyasm/libyasm.vcxproj
@@ -0,0 +1,273 @@
+<?xml version="1.0" encoding="utf-8"?>

+<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">

+  <ItemGroup Label="ProjectConfigurations">

+    <ProjectConfiguration Include="Debug|Win32">

+      <Configuration>Debug</Configuration>

+      <Platform>Win32</Platform>

+    </ProjectConfiguration>

+    <ProjectConfiguration Include="Debug|x64">

+      <Configuration>Debug</Configuration>

+      <Platform>x64</Platform>

+    </ProjectConfiguration>

+    <ProjectConfiguration Include="Release|Win32">

+      <Configuration>Release</Configuration>

+      <Platform>Win32</Platform>

+    </ProjectConfiguration>

+    <ProjectConfiguration Include="Release|x64">

+      <Configuration>Release</Configuration>

+      <Platform>x64</Platform>

+    </ProjectConfiguration>

+  </ItemGroup>

+  <PropertyGroup Label="Globals">

+    <ProjectGuid>{29FE7874-1256-4AD6-B889-68E399DC9608}</ProjectGuid>

+    <RootNamespace>libyasm</RootNamespace>

+  </PropertyGroup>

+  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />

+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">

+    <ConfigurationType>StaticLibrary</ConfigurationType>

+    <UseOfMfc>false</UseOfMfc>

+    <CharacterSet>MultiByte</CharacterSet>

+  </PropertyGroup>

+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">

+    <ConfigurationType>StaticLibrary</ConfigurationType>

+    <UseOfMfc>false</UseOfMfc>

+    <CharacterSet>MultiByte</CharacterSet>

+  </PropertyGroup>

+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">

+    <ConfigurationType>StaticLibrary</ConfigurationType>

+    <UseOfMfc>false</UseOfMfc>

+    <CharacterSet>MultiByte</CharacterSet>

+  </PropertyGroup>

+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">

+    <ConfigurationType>StaticLibrary</ConfigurationType>

+    <UseOfMfc>false</UseOfMfc>

+    <CharacterSet>MultiByte</CharacterSet>

+  </PropertyGroup>

+  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />

+  <ImportGroup Label="ExtensionSettings">

+  </ImportGroup>

+  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets">

+    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" />

+    <Import Project="..\crt_secure_no_deprecate.props" />

+  </ImportGroup>

+  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets">

+    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" />

+    <Import Project="..\crt_secure_no_deprecate.props" />

+  </ImportGroup>

+  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets">

+    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" />

+    <Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC71.props" />

+    <Import Project="..\crt_secure_no_deprecate.props" />

+  </ImportGroup>

+  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets">

+    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" />

+    <Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC71.props" />

+    <Import Project="..\crt_secure_no_deprecate.props" />

+  </ImportGroup>

+  <PropertyGroup Label="UserMacros" />

+  <PropertyGroup>

+    <_ProjectFileVersion>10.0.21006.1</_ProjectFileVersion>

+    <OutDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(Platform)\$(Configuration)\</OutDir>

+    <IntDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(Platform)\$(Configuration)\</IntDir>

+    <OutDir Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(Platform)\$(Configuration)\</OutDir>

+    <IntDir Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(Platform)\$(Configuration)\</IntDir>

+    <OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(Platform)\$(Configuration)\</OutDir>

+    <IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(Platform)\$(Configuration)\</IntDir>

+    <OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(Platform)\$(Configuration)\</OutDir>

+    <IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(Platform)\$(Configuration)\</IntDir>

+  </PropertyGroup>

+  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">

+    <ClCompile>

+      <Optimization>Full</Optimization>

+      <InlineFunctionExpansion>Default</InlineFunctionExpansion>

+      <AdditionalIncludeDirectories>..;../../..;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>

+      <PreprocessorDefinitions>NDEBUG;WIN32;_LIB;HAVE_CONFIG_H;%(PreprocessorDefinitions)</PreprocessorDefinitions>

+      <StringPooling>true</StringPooling>

+      <RuntimeLibrary>MultiThreaded</RuntimeLibrary>

+      <FunctionLevelLinking>true</FunctionLevelLinking>

+      <PrecompiledHeader>

+      </PrecompiledHeader>

+      <AssemblerListingLocation>$(IntDir)</AssemblerListingLocation>

+      <ObjectFileName>$(IntDir)</ObjectFileName>

+      <ProgramDataBaseFileName>$(IntDir)</ProgramDataBaseFileName>

+      <WarningLevel>Level3</WarningLevel>

+      <SuppressStartupBanner>true</SuppressStartupBanner>

+      <CompileAs>Default</CompileAs>

+      <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>

+    </ClCompile>

+    <ResourceCompile>

+      <PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>

+      <Culture>0x0409</Culture>

+    </ResourceCompile>

+    <Lib>

+      <OutputFile>$(OutDir)libyasm.lib</OutputFile>

+      <SuppressStartupBanner>true</SuppressStartupBanner>

+    </Lib>

+  </ItemDefinitionGroup>

+  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">

+    <Midl>

+      <TargetEnvironment>X64</TargetEnvironment>

+    </Midl>

+    <ClCompile>

+      <Optimization>Full</Optimization>

+      <InlineFunctionExpansion>Default</InlineFunctionExpansion>

+      <AdditionalIncludeDirectories>..;../../..;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>

+      <PreprocessorDefinitions>NDEBUG;_LIB;HAVE_CONFIG_H;WIN64;%(PreprocessorDefinitions)</PreprocessorDefinitions>

+      <StringPooling>true</StringPooling>

+      <RuntimeLibrary>MultiThreaded</RuntimeLibrary>

+      <FunctionLevelLinking>true</FunctionLevelLinking>

+      <PrecompiledHeader>

+      </PrecompiledHeader>

+      <PrecompiledHeaderOutputFile>

+      </PrecompiledHeaderOutputFile>

+      <AssemblerListingLocation>$(IntDir)</AssemblerListingLocation>

+      <ObjectFileName>$(IntDir)</ObjectFileName>

+      <ProgramDataBaseFileName>$(IntDir)</ProgramDataBaseFileName>

+      <WarningLevel>Level3</WarningLevel>

+      <SuppressStartupBanner>true</SuppressStartupBanner>

+      <CompileAs>Default</CompileAs>

+      <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>

+    </ClCompile>

+    <ResourceCompile>

+      <PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>

+      <Culture>0x0409</Culture>

+    </ResourceCompile>

+    <Lib>

+      <OutputFile>$(OutDir)libyasm.lib</OutputFile>

+      <SuppressStartupBanner>true</SuppressStartupBanner>

+    </Lib>

+  </ItemDefinitionGroup>

+  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">

+    <ClCompile>

+      <Optimization>Disabled</Optimization>

+      <AdditionalIncludeDirectories>..;../../..;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>

+      <PreprocessorDefinitions>_DEBUG;WIN32;_LIB;HAVE_CONFIG_H;%(PreprocessorDefinitions)</PreprocessorDefinitions>

+      <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>

+      <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>

+      <PrecompiledHeader>

+      </PrecompiledHeader>

+      <AssemblerListingLocation>$(IntDir)</AssemblerListingLocation>

+      <ObjectFileName>$(IntDir)</ObjectFileName>

+      <ProgramDataBaseFileName>$(IntDir)</ProgramDataBaseFileName>

+      <WarningLevel>Level3</WarningLevel>

+      <SuppressStartupBanner>true</SuppressStartupBanner>

+      <CompileAs>Default</CompileAs>

+      <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>

+    </ClCompile>

+    <ResourceCompile>

+      <PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>

+      <Culture>0x0409</Culture>

+    </ResourceCompile>

+    <Lib>

+      <OutputFile>$(OutDir)libyasm.lib</OutputFile>

+      <SuppressStartupBanner>true</SuppressStartupBanner>

+    </Lib>

+  </ItemDefinitionGroup>

+  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">

+    <Midl>

+      <TargetEnvironment>X64</TargetEnvironment>

+    </Midl>

+    <ClCompile>

+      <Optimization>Disabled</Optimization>

+      <AdditionalIncludeDirectories>..;../../..;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>

+      <PreprocessorDefinitions>_DEBUG;_LIB;HAVE_CONFIG_H;WIN64;%(PreprocessorDefinitions)</PreprocessorDefinitions>

+      <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>

+      <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>

+      <PrecompiledHeader>

+      </PrecompiledHeader>

+      <PrecompiledHeaderOutputFile>

+      </PrecompiledHeaderOutputFile>

+      <AssemblerListingLocation>$(IntDir)</AssemblerListingLocation>

+      <ObjectFileName>$(IntDir)</ObjectFileName>

+      <ProgramDataBaseFileName>$(IntDir)</ProgramDataBaseFileName>

+      <WarningLevel>Level3</WarningLevel>

+      <SuppressStartupBanner>true</SuppressStartupBanner>

+      <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>

+      <CompileAs>Default</CompileAs>

+    </ClCompile>

+    <ResourceCompile>

+      <PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>

+      <Culture>0x0409</Culture>

+    </ResourceCompile>

+    <Lib>

+      <OutputFile>$(OutDir)libyasm.lib</OutputFile>

+      <SuppressStartupBanner>true</SuppressStartupBanner>

+    </Lib>

+  </ItemDefinitionGroup>

+  <ItemGroup>

+    <ClCompile Include="..\..\..\libyasm\assocdat.c" />

+    <ClCompile Include="..\..\..\libyasm\bc-align.c" />

+    <ClCompile Include="..\..\..\libyasm\bc-data.c" />

+    <ClCompile Include="..\..\..\libyasm\bc-incbin.c" />

+    <ClCompile Include="..\..\..\libyasm\bc-org.c" />

+    <ClCompile Include="..\..\..\libyasm\bc-reserve.c" />

+    <ClCompile Include="..\..\..\libyasm\bitvect.c" />

+    <ClCompile Include="..\..\..\libyasm\bytecode.c" />

+    <ClCompile Include="..\..\..\libyasm\errwarn.c" />

+    <ClCompile Include="..\..\..\libyasm\expr.c" />

+    <ClCompile Include="..\..\..\libyasm\file.c" />

+    <ClCompile Include="..\..\..\libyasm\floatnum.c" />

+    <ClCompile Include="..\..\..\libyasm\hamt.c" />

+    <ClCompile Include="..\..\..\libyasm\insn.c" />

+    <ClCompile Include="..\..\..\libyasm\intnum.c" />

+    <ClCompile Include="..\..\..\libyasm\inttree.c" />

+    <ClCompile Include="..\..\..\libyasm\linemap.c" />

+    <ClCompile Include="..\..\..\libyasm\md5.c" />

+    <ClCompile Include="..\..\..\libyasm\mergesort.c" />

+    <ClCompile Include="..\..\..\module.c" />

+    <ClCompile Include="..\..\..\libyasm\phash.c" />

+    <ClCompile Include="..\..\..\libyasm\section.c" />

+    <ClCompile Include="..\..\..\libyasm\strcasecmp.c" />

+    <ClCompile Include="..\..\..\libyasm\strsep.c" />

+    <ClCompile Include="..\..\..\libyasm\symrec.c" />

+    <ClCompile Include="..\..\..\libyasm\valparam.c" />

+    <ClCompile Include="..\..\..\libyasm\value.c" />

+    <ClCompile Include="..\..\..\libyasm\xmalloc.c" />

+    <ClCompile Include="..\..\..\libyasm\xstrdup.c" />

+  </ItemGroup>

+  <ItemGroup>

+    <ClInclude Include="..\..\..\libyasm.h" />

+    <ClInclude Include="..\..\..\libyasm\file.h" />

+    <ClInclude Include="..\..\..\libyasm\arch.h" />

+    <ClInclude Include="..\..\..\libyasm\assocdat.h" />

+    <ClInclude Include="..\..\..\libyasm\bitvect.h" />

+    <ClInclude Include="..\..\..\libyasm\bytecode.h" />

+    <ClInclude Include="..\..\..\libyasm\compat-queue.h" />

+    <ClInclude Include="..\..\..\libyasm\coretype.h" />

+    <ClInclude Include="..\..\..\libyasm\dbgfmt.h" />

+    <ClInclude Include="..\..\..\libyasm\errwarn.h" />

+    <ClInclude Include="..\..\..\libyasm\expr.h" />

+    <ClInclude Include="..\..\..\libyasm\floatnum.h" />

+    <ClInclude Include="..\..\..\libyasm\hamt.h" />

+    <ClInclude Include="..\..\..\libyasm\insn.h" />

+    <ClInclude Include="..\..\..\libyasm\intnum.h" />

+    <ClInclude Include="..\..\..\libyasm\inttree.h" />

+    <ClInclude Include="..\..\..\libyasm\linemap.h" />

+    <ClInclude Include="..\..\..\libyasm\listfmt.h" />

+    <ClInclude Include="..\..\..\libyasm\md5.h" />

+    <ClInclude Include="..\..\..\libyasm\module.h" />

+    <ClInclude Include="..\..\..\libyasm\objfmt.h" />

+    <ClInclude Include="..\..\..\libyasm\parser.h" />

+    <ClInclude Include="..\..\..\libyasm\phash.h" />

+    <ClInclude Include="..\..\..\libyasm\preproc.h" />

+    <ClInclude Include="..\..\..\libyasm\section.h" />

+    <ClInclude Include="..\..\..\libyasm\symrec.h" />

+    <ClInclude Include="..\..\..\libyasm\valparam.h" />

+    <ClInclude Include="..\..\..\libyasm\value.h" />

+    <ClInclude Include="..\..\..\util.h" />

+    <ClInclude Include="..\config.h" />

+    <ClInclude Include="..\libyasm-stdint.h" />

+  </ItemGroup>

+  <ItemGroup>

+    <None Include="..\..\..\libyasm\module.in" />

+  </ItemGroup>

+  <ItemGroup>

+    <ProjectReference Include="..\genmodule\genmodule.vcxproj">

+      <Project>{f0e8b707-00c5-4ff2-b8ef-7c39817132a0}</Project>

+      <ReferenceOutputAssembly>false</ReferenceOutputAssembly>

+    </ProjectReference>

+  </ItemGroup>

+  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />

+  <ImportGroup Label="ExtensionTargets">

+  </ImportGroup>

+</Project>
\ No newline at end of file
diff --git a/Mkfiles/vc10/libyasm/libyasm.vcxproj.filters b/Mkfiles/vc10/libyasm/libyasm.vcxproj.filters
new file mode 100644
index 0000000..d1ee279
--- /dev/null
+++ b/Mkfiles/vc10/libyasm/libyasm.vcxproj.filters
@@ -0,0 +1,200 @@
+<?xml version="1.0" encoding="utf-8"?>

+<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">

+  <ItemGroup>

+    <Filter Include="Header Files">

+      <UniqueIdentifier>{4ca3b698-9d01-4e4e-ae00-5c98da045efe}</UniqueIdentifier>

+      <Extensions>h;hpp;hxx;hm;inl</Extensions>

+    </Filter>

+    <Filter Include="Source Files">

+      <UniqueIdentifier>{68607062-982d-4251-9a1a-30f76474983d}</UniqueIdentifier>

+      <Extensions>cpp;c;cxx;rc;def;r;odl;idl;hpj;bat</Extensions>

+    </Filter>

+  </ItemGroup>

+  <ItemGroup>

+    <ClCompile Include="..\..\..\libyasm\assocdat.c">

+      <Filter>Source Files</Filter>

+    </ClCompile>

+    <ClCompile Include="..\..\..\libyasm\bc-align.c">

+      <Filter>Source Files</Filter>

+    </ClCompile>

+    <ClCompile Include="..\..\..\libyasm\bc-data.c">

+      <Filter>Source Files</Filter>

+    </ClCompile>

+    <ClCompile Include="..\..\..\libyasm\bc-incbin.c">

+      <Filter>Source Files</Filter>

+    </ClCompile>

+    <ClCompile Include="..\..\..\libyasm\bc-org.c">

+      <Filter>Source Files</Filter>

+    </ClCompile>

+    <ClCompile Include="..\..\..\libyasm\bc-reserve.c">

+      <Filter>Source Files</Filter>

+    </ClCompile>

+    <ClCompile Include="..\..\..\libyasm\bitvect.c">

+      <Filter>Source Files</Filter>

+    </ClCompile>

+    <ClCompile Include="..\..\..\libyasm\bytecode.c">

+      <Filter>Source Files</Filter>

+    </ClCompile>

+    <ClCompile Include="..\..\..\libyasm\errwarn.c">

+      <Filter>Source Files</Filter>

+    </ClCompile>

+    <ClCompile Include="..\..\..\libyasm\expr.c">

+      <Filter>Source Files</Filter>

+    </ClCompile>

+    <ClCompile Include="..\..\..\libyasm\file.c">

+      <Filter>Source Files</Filter>

+    </ClCompile>

+    <ClCompile Include="..\..\..\libyasm\floatnum.c">

+      <Filter>Source Files</Filter>

+    </ClCompile>

+    <ClCompile Include="..\..\..\libyasm\hamt.c">

+      <Filter>Source Files</Filter>

+    </ClCompile>

+    <ClCompile Include="..\..\..\libyasm\insn.c">

+      <Filter>Source Files</Filter>

+    </ClCompile>

+    <ClCompile Include="..\..\..\libyasm\intnum.c">

+      <Filter>Source Files</Filter>

+    </ClCompile>

+    <ClCompile Include="..\..\..\libyasm\inttree.c">

+      <Filter>Source Files</Filter>

+    </ClCompile>

+    <ClCompile Include="..\..\..\libyasm\linemap.c">

+      <Filter>Source Files</Filter>

+    </ClCompile>

+    <ClCompile Include="..\..\..\libyasm\md5.c">

+      <Filter>Source Files</Filter>

+    </ClCompile>

+    <ClCompile Include="..\..\..\libyasm\mergesort.c">

+      <Filter>Source Files</Filter>

+    </ClCompile>

+    <ClCompile Include="..\..\..\libyasm\phash.c">

+      <Filter>Source Files</Filter>

+    </ClCompile>

+    <ClCompile Include="..\..\..\libyasm\section.c">

+      <Filter>Source Files</Filter>

+    </ClCompile>

+    <ClCompile Include="..\..\..\libyasm\strcasecmp.c">

+      <Filter>Source Files</Filter>

+    </ClCompile>

+    <ClCompile Include="..\..\..\libyasm\strsep.c">

+      <Filter>Source Files</Filter>

+    </ClCompile>

+    <ClCompile Include="..\..\..\libyasm\symrec.c">

+      <Filter>Source Files</Filter>

+    </ClCompile>

+    <ClCompile Include="..\..\..\libyasm\valparam.c">

+      <Filter>Source Files</Filter>

+    </ClCompile>

+    <ClCompile Include="..\..\..\libyasm\value.c">

+      <Filter>Source Files</Filter>

+    </ClCompile>

+    <ClCompile Include="..\..\..\libyasm\xmalloc.c">

+      <Filter>Source Files</Filter>

+    </ClCompile>

+    <ClCompile Include="..\..\..\libyasm\xstrdup.c">

+      <Filter>Source Files</Filter>

+    </ClCompile>

+    <ClCompile Include="..\..\..\module.c">

+      <Filter>Source Files</Filter>

+    </ClCompile>

+  </ItemGroup>

+  <ItemGroup>

+    <ClInclude Include="..\..\..\libyasm\arch.h">

+      <Filter>Header Files</Filter>

+    </ClInclude>

+    <ClInclude Include="..\..\..\libyasm\assocdat.h">

+      <Filter>Header Files</Filter>

+    </ClInclude>

+    <ClInclude Include="..\..\..\libyasm\bitvect.h">

+      <Filter>Header Files</Filter>

+    </ClInclude>

+    <ClInclude Include="..\..\..\libyasm\bytecode.h">

+      <Filter>Header Files</Filter>

+    </ClInclude>

+    <ClInclude Include="..\..\..\libyasm\compat-queue.h">

+      <Filter>Header Files</Filter>

+    </ClInclude>

+    <ClInclude Include="..\..\..\libyasm\coretype.h">

+      <Filter>Header Files</Filter>

+    </ClInclude>

+    <ClInclude Include="..\..\..\libyasm\dbgfmt.h">

+      <Filter>Header Files</Filter>

+    </ClInclude>

+    <ClInclude Include="..\..\..\libyasm\errwarn.h">

+      <Filter>Header Files</Filter>

+    </ClInclude>

+    <ClInclude Include="..\..\..\libyasm\expr.h">

+      <Filter>Header Files</Filter>

+    </ClInclude>

+    <ClInclude Include="..\..\..\libyasm\file.h">

+      <Filter>Source Files</Filter>

+    </ClInclude>

+    <ClInclude Include="..\..\..\libyasm\floatnum.h">

+      <Filter>Header Files</Filter>

+    </ClInclude>

+    <ClInclude Include="..\..\..\libyasm\hamt.h">

+      <Filter>Header Files</Filter>

+    </ClInclude>

+    <ClInclude Include="..\..\..\libyasm\insn.h">

+      <Filter>Header Files</Filter>

+    </ClInclude>

+    <ClInclude Include="..\..\..\libyasm\intnum.h">

+      <Filter>Header Files</Filter>

+    </ClInclude>

+    <ClInclude Include="..\..\..\libyasm\inttree.h">

+      <Filter>Header Files</Filter>

+    </ClInclude>

+    <ClInclude Include="..\..\..\libyasm\linemap.h">

+      <Filter>Header Files</Filter>

+    </ClInclude>

+    <ClInclude Include="..\..\..\libyasm\md5.h">

+      <Filter>Header Files</Filter>

+    </ClInclude>

+    <ClInclude Include="..\..\..\libyasm\objfmt.h">

+      <Filter>Header Files</Filter>

+    </ClInclude>

+    <ClInclude Include="..\..\..\libyasm\parser.h">

+      <Filter>Header Files</Filter>

+    </ClInclude>

+    <ClInclude Include="..\..\..\libyasm\phash.h">

+      <Filter>Header Files</Filter>

+    </ClInclude>

+    <ClInclude Include="..\..\..\libyasm\preproc.h">

+      <Filter>Header Files</Filter>

+    </ClInclude>

+    <ClInclude Include="..\..\..\libyasm\section.h">

+      <Filter>Header Files</Filter>

+    </ClInclude>

+    <ClInclude Include="..\..\..\libyasm\symrec.h">

+      <Filter>Header Files</Filter>

+    </ClInclude>

+    <ClInclude Include="..\..\..\libyasm\valparam.h">

+      <Filter>Header Files</Filter>

+    </ClInclude>

+    <ClInclude Include="..\..\..\libyasm\value.h">

+      <Filter>Header Files</Filter>

+    </ClInclude>

+    <ClInclude Include="..\config.h">

+      <Filter>Header Files</Filter>

+    </ClInclude>

+    <ClInclude Include="..\libyasm-stdint.h">

+      <Filter>Header Files</Filter>

+    </ClInclude>

+    <ClInclude Include="..\..\..\libyasm.h">

+      <Filter>Header Files</Filter>

+    </ClInclude>

+    <ClInclude Include="..\..\..\libyasm\listfmt.h">

+      <Filter>Header Files</Filter>

+    </ClInclude>

+    <ClInclude Include="..\..\..\libyasm\module.h">

+      <Filter>Header Files</Filter>

+    </ClInclude>

+    <ClInclude Include="..\..\..\util.h">

+      <Filter>Header Files</Filter>

+    </ClInclude>

+  </ItemGroup>

+  <ItemGroup>

+    <None Include="..\..\..\libyasm\module.in" />

+  </ItemGroup>

+</Project>
\ No newline at end of file
diff --git a/Mkfiles/vc10/modules/modules.vcxproj b/Mkfiles/vc10/modules/modules.vcxproj
new file mode 100644
index 0000000..9e1f917
--- /dev/null
+++ b/Mkfiles/vc10/modules/modules.vcxproj
@@ -0,0 +1,319 @@
+<?xml version="1.0" encoding="utf-8"?>

+<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">

+  <ItemGroup Label="ProjectConfigurations">

+    <ProjectConfiguration Include="Debug|Win32">

+      <Configuration>Debug</Configuration>

+      <Platform>Win32</Platform>

+    </ProjectConfiguration>

+    <ProjectConfiguration Include="Debug|x64">

+      <Configuration>Debug</Configuration>

+      <Platform>x64</Platform>

+    </ProjectConfiguration>

+    <ProjectConfiguration Include="Release|Win32">

+      <Configuration>Release</Configuration>

+      <Platform>Win32</Platform>

+    </ProjectConfiguration>

+    <ProjectConfiguration Include="Release|x64">

+      <Configuration>Release</Configuration>

+      <Platform>x64</Platform>

+    </ProjectConfiguration>

+  </ItemGroup>

+  <PropertyGroup Label="Globals">

+    <ProjectGuid>{D715A3D4-EFAA-442E-AD8B-5B4FF64E1DD6}</ProjectGuid>

+    <RootNamespace>modules</RootNamespace>

+  </PropertyGroup>

+  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />

+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">

+    <ConfigurationType>StaticLibrary</ConfigurationType>

+    <UseOfMfc>false</UseOfMfc>

+    <CharacterSet>MultiByte</CharacterSet>

+  </PropertyGroup>

+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">

+    <ConfigurationType>StaticLibrary</ConfigurationType>

+    <UseOfMfc>false</UseOfMfc>

+    <CharacterSet>MultiByte</CharacterSet>

+  </PropertyGroup>

+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">

+    <ConfigurationType>StaticLibrary</ConfigurationType>

+    <UseOfMfc>false</UseOfMfc>

+    <CharacterSet>MultiByte</CharacterSet>

+  </PropertyGroup>

+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">

+    <ConfigurationType>StaticLibrary</ConfigurationType>

+    <UseOfMfc>false</UseOfMfc>

+    <CharacterSet>MultiByte</CharacterSet>

+  </PropertyGroup>

+  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />

+  <ImportGroup Label="ExtensionSettings">

+  </ImportGroup>

+  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets">

+    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" />

+    <Import Project="..\crt_secure_no_deprecate.props" />

+  </ImportGroup>

+  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets">

+    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" />

+    <Import Project="..\crt_secure_no_deprecate.props" />

+  </ImportGroup>

+  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets">

+    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" />

+    <Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC71.props" />

+    <Import Project="..\crt_secure_no_deprecate.props" />

+  </ImportGroup>

+  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets">

+    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" />

+    <Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC71.props" />

+    <Import Project="..\crt_secure_no_deprecate.props" />

+  </ImportGroup>

+  <PropertyGroup Label="UserMacros" />

+  <PropertyGroup>

+    <_ProjectFileVersion>10.0.21006.1</_ProjectFileVersion>

+    <OutDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(Platform)\$(Configuration)\</OutDir>

+    <IntDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(Platform)\$(Configuration)\</IntDir>

+    <OutDir Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(Platform)\$(Configuration)\</OutDir>

+    <IntDir Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(Platform)\$(Configuration)\</IntDir>

+    <OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(Platform)\$(Configuration)\</OutDir>

+    <IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(Platform)\$(Configuration)\</IntDir>

+    <OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(Platform)\$(Configuration)\</OutDir>

+    <IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(Platform)\$(Configuration)\</IntDir>

+  </PropertyGroup>

+  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">

+    <ClCompile>

+      <Optimization>Full</Optimization>

+      <InlineFunctionExpansion>Default</InlineFunctionExpansion>

+      <AdditionalIncludeDirectories>..;../../..;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>

+      <PreprocessorDefinitions>NDEBUG;WIN32;_LIB;HAVE_CONFIG_H;%(PreprocessorDefinitions)</PreprocessorDefinitions>

+      <StringPooling>true</StringPooling>

+      <RuntimeLibrary>MultiThreaded</RuntimeLibrary>

+      <FunctionLevelLinking>true</FunctionLevelLinking>

+      <PrecompiledHeader>

+      </PrecompiledHeader>

+      <PrecompiledHeaderOutputFile>

+      </PrecompiledHeaderOutputFile>

+      <AssemblerListingLocation>$(IntDir)</AssemblerListingLocation>

+      <ObjectFileName>$(IntDir)</ObjectFileName>

+      <ProgramDataBaseFileName>$(IntDir)</ProgramDataBaseFileName>

+      <WarningLevel>Level3</WarningLevel>

+      <SuppressStartupBanner>true</SuppressStartupBanner>

+      <CompileAs>Default</CompileAs>

+      <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>

+    </ClCompile>

+    <ResourceCompile>

+      <PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>

+      <Culture>0x0409</Culture>

+    </ResourceCompile>

+    <Lib>

+      <OutputFile>$(OutDir)modules.lib</OutputFile>

+      <SuppressStartupBanner>true</SuppressStartupBanner>

+    </Lib>

+  </ItemDefinitionGroup>

+  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">

+    <PreBuildEvent>

+      <Command>

+      </Command>

+    </PreBuildEvent>

+    <Midl>

+      <TargetEnvironment>X64</TargetEnvironment>

+    </Midl>

+    <ClCompile>

+      <Optimization>Full</Optimization>

+      <InlineFunctionExpansion>Default</InlineFunctionExpansion>

+      <AdditionalIncludeDirectories>..;../../..;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>

+      <PreprocessorDefinitions>NDEBUG;_LIB;HAVE_CONFIG_H;WIN64;%(PreprocessorDefinitions)</PreprocessorDefinitions>

+      <StringPooling>true</StringPooling>

+      <RuntimeLibrary>MultiThreaded</RuntimeLibrary>

+      <FunctionLevelLinking>true</FunctionLevelLinking>

+      <PrecompiledHeader>

+      </PrecompiledHeader>

+      <PrecompiledHeaderOutputFile>

+      </PrecompiledHeaderOutputFile>

+      <AssemblerListingLocation>$(IntDir)</AssemblerListingLocation>

+      <ObjectFileName>$(IntDir)</ObjectFileName>

+      <ProgramDataBaseFileName>$(IntDir)</ProgramDataBaseFileName>

+      <WarningLevel>Level3</WarningLevel>

+      <SuppressStartupBanner>true</SuppressStartupBanner>

+      <CompileAs>Default</CompileAs>

+      <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>

+    </ClCompile>

+    <ResourceCompile>

+      <PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>

+      <Culture>0x0409</Culture>

+    </ResourceCompile>

+    <Lib>

+      <OutputFile>$(OutDir)modules.lib</OutputFile>

+      <SuppressStartupBanner>true</SuppressStartupBanner>

+    </Lib>

+  </ItemDefinitionGroup>

+  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">

+    <ClCompile>

+      <Optimization>Disabled</Optimization>

+      <AdditionalIncludeDirectories>..;../../..;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>

+      <PreprocessorDefinitions>_DEBUG;WIN32;_LIB;HAVE_CONFIG_H;%(PreprocessorDefinitions)</PreprocessorDefinitions>

+      <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>

+      <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>

+      <PrecompiledHeader>

+      </PrecompiledHeader>

+      <PrecompiledHeaderOutputFile>

+      </PrecompiledHeaderOutputFile>

+      <AssemblerListingLocation>$(IntDir)</AssemblerListingLocation>

+      <ObjectFileName>$(IntDir)</ObjectFileName>

+      <ProgramDataBaseFileName>$(IntDir)</ProgramDataBaseFileName>

+      <WarningLevel>Level3</WarningLevel>

+      <SuppressStartupBanner>true</SuppressStartupBanner>

+      <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>

+      <CompileAs>Default</CompileAs>

+    </ClCompile>

+    <ResourceCompile>

+      <PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>

+      <Culture>0x0409</Culture>

+    </ResourceCompile>

+    <Lib>

+      <OutputFile>$(OutDir)modules.lib</OutputFile>

+      <SuppressStartupBanner>true</SuppressStartupBanner>

+    </Lib>

+  </ItemDefinitionGroup>

+  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">

+    <Midl>

+      <TargetEnvironment>X64</TargetEnvironment>

+    </Midl>

+    <ClCompile>

+      <Optimization>Disabled</Optimization>

+      <AdditionalIncludeDirectories>..;../../..;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>

+      <PreprocessorDefinitions>_DEBUG;_LIB;HAVE_CONFIG_H;WIN64;%(PreprocessorDefinitions)</PreprocessorDefinitions>

+      <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>

+      <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>

+      <PrecompiledHeader>

+      </PrecompiledHeader>

+      <PrecompiledHeaderOutputFile>

+      </PrecompiledHeaderOutputFile>

+      <AssemblerListingLocation>$(IntDir)</AssemblerListingLocation>

+      <ObjectFileName>$(IntDir)</ObjectFileName>

+      <ProgramDataBaseFileName>$(IntDir)</ProgramDataBaseFileName>

+      <WarningLevel>Level3</WarningLevel>

+      <SuppressStartupBanner>true</SuppressStartupBanner>

+      <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>

+      <CompileAs>Default</CompileAs>

+    </ClCompile>

+    <ResourceCompile>

+      <PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>

+      <Culture>0x0409</Culture>

+    </ResourceCompile>

+    <Lib>

+      <OutputFile>$(OutDir)modules.lib</OutputFile>

+      <SuppressStartupBanner>true</SuppressStartupBanner>

+    </Lib>

+  </ItemDefinitionGroup>

+  <ItemGroup>

+    <ClCompile Include="..\..\..\modules\arch\lc3b\lc3barch.c" />

+    <ClCompile Include="..\..\..\modules\arch\lc3b\lc3bbc.c" />

+    <ClCompile Include="..\..\..\lc3bid.c" />

+    <ClCompile Include="..\..\..\modules\arch\x86\x86arch.c" />

+    <ClCompile Include="..\..\..\modules\arch\x86\x86bc.c" />

+    <ClCompile Include="..\..\..\modules\parsers\gas\gas-parse-intel.c" />

+    <ClCompile Include="..\..\..\modules\preprocs\gas\gas-eval.c" />

+    <ClCompile Include="..\..\..\modules\preprocs\gas\gas-preproc.c" />

+    <ClCompile Include="..\..\..\x86cpu.c" />

+    <ClCompile Include="..\..\..\modules\arch\x86\x86expr.c" />

+    <ClCompile Include="..\..\..\modules\arch\x86\x86id.c" />

+    <ClCompile Include="..\..\..\x86regtmod.c" />

+    <ClCompile Include="..\..\..\modules\dbgfmts\codeview\cv-dbgfmt.c" />

+    <ClCompile Include="..\..\..\modules\dbgfmts\codeview\cv-symline.c" />

+    <ClCompile Include="..\..\..\modules\dbgfmts\codeview\cv-type.c" />

+    <ClCompile Include="..\..\..\modules\dbgfmts\dwarf2\dwarf2-aranges.c" />

+    <ClCompile Include="..\..\..\modules\dbgfmts\dwarf2\dwarf2-dbgfmt.c" />

+    <ClCompile Include="..\..\..\modules\dbgfmts\dwarf2\dwarf2-info.c" />

+    <ClCompile Include="..\..\..\modules\dbgfmts\dwarf2\dwarf2-line.c" />

+    <ClCompile Include="..\..\..\modules\dbgfmts\null\null-dbgfmt.c" />

+    <ClCompile Include="..\..\..\modules\dbgfmts\stabs\stabs-dbgfmt.c" />

+    <ClCompile Include="..\..\..\modules\objfmts\bin\bin-objfmt.c" />

+    <ClCompile Include="..\..\..\modules\objfmts\coff\coff-objfmt.c" />

+    <ClCompile Include="..\..\..\modules\objfmts\dbg\dbg-objfmt.c" />

+    <ClCompile Include="..\..\..\modules\objfmts\elf\elf-objfmt.c" />

+    <ClCompile Include="..\..\..\modules\objfmts\elf\elf-x86-amd64.c" />

+    <ClCompile Include="..\..\..\modules\objfmts\elf\elf-x86-x86.c" />

+    <ClCompile Include="..\..\..\modules\objfmts\elf\elf.c" />

+    <ClCompile Include="..\..\..\modules\objfmts\macho\macho-objfmt.c" />

+    <ClCompile Include="..\..\..\modules\objfmts\rdf\rdf-objfmt.c" />

+    <ClCompile Include="..\..\..\modules\objfmts\coff\win64-except.c" />

+    <ClCompile Include="..\..\..\modules\objfmts\xdf\xdf-objfmt.c" />

+    <ClCompile Include="..\..\..\modules\parsers\gas\gas-parse.c" />

+    <ClCompile Include="..\..\..\modules\parsers\gas\gas-parser.c" />

+    <ClCompile Include="..\..\..\gas-token.c" />

+    <ClCompile Include="..\..\..\modules\parsers\nasm\nasm-parse.c" />

+    <ClCompile Include="..\..\..\modules\parsers\nasm\nasm-parser.c" />

+    <ClCompile Include="..\..\..\nasm-token.c" />

+    <ClCompile Include="..\..\..\modules\preprocs\nasm\nasm-eval.c" />

+    <ClCompile Include="..\..\..\modules\preprocs\nasm\nasm-pp.c" />

+    <ClCompile Include="..\..\..\modules\preprocs\nasm\nasm-preproc.c" />

+    <ClCompile Include="..\..\..\modules\preprocs\nasm\nasmlib.c" />

+    <ClCompile Include="..\..\..\modules\preprocs\raw\raw-preproc.c" />

+    <ClCompile Include="..\..\..\modules\preprocs\cpp\cpp-preproc.c" />

+    <ClCompile Include="..\..\..\modules\listfmts\nasm\nasm-listfmt.c" />

+  </ItemGroup>

+  <ItemGroup>

+    <ClInclude Include="..\..\..\libyasm.h" />

+    <ClInclude Include="..\..\..\libyasm\arch.h" />

+    <ClInclude Include="..\..\..\libyasm\bitvect.h" />

+    <ClInclude Include="..\..\..\libyasm\bytecode.h" />

+    <ClInclude Include="..\..\..\libyasm\compat-queue.h" />

+    <ClInclude Include="..\..\..\libyasm\coretype.h" />

+    <ClInclude Include="..\..\..\libyasm\dbgfmt.h" />

+    <ClInclude Include="..\..\..\libyasm\errwarn.h" />

+    <ClInclude Include="..\..\..\libyasm\expr.h" />

+    <ClInclude Include="..\..\..\libyasm\file.h" />

+    <ClInclude Include="..\..\..\libyasm\floatnum.h" />

+    <ClInclude Include="..\..\..\libyasm\hamt.h" />

+    <ClInclude Include="..\..\..\libyasm\insn.h" />

+    <ClInclude Include="..\..\..\libyasm\intnum.h" />

+    <ClInclude Include="..\..\..\libyasm\linemap.h" />

+    <ClInclude Include="..\..\..\libyasm\listfmt.h" />

+    <ClInclude Include="..\..\..\libyasm\md5.h" />

+    <ClInclude Include="..\..\..\libyasm\module.h" />

+    <ClInclude Include="..\..\..\libyasm\objfmt.h" />

+    <ClInclude Include="..\..\..\libyasm\parser.h" />

+    <ClInclude Include="..\..\..\libyasm\phash.h" />

+    <ClInclude Include="..\..\..\libyasm\preproc.h" />

+    <ClInclude Include="..\..\..\libyasm\section.h" />

+    <ClInclude Include="..\..\..\libyasm\symrec.h" />

+    <ClInclude Include="..\..\..\libyasm\valparam.h" />

+    <ClInclude Include="..\..\..\libyasm\value.h" />

+    <ClInclude Include="..\..\..\modules\arch\lc3b\lc3barch.h" />

+    <ClInclude Include="..\..\..\modules\arch\x86\x86arch.h" />

+    <ClInclude Include="..\..\..\modules\dbgfmts\codeview\cv-dbgfmt.h" />

+    <ClInclude Include="..\..\..\modules\dbgfmts\dwarf2\dwarf2-dbgfmt.h" />

+    <ClInclude Include="..\..\..\modules\objfmts\coff\coff-objfmt.h" />

+    <ClInclude Include="..\..\..\modules\objfmts\elf\elf-machine.h" />

+    <ClInclude Include="..\..\..\modules\objfmts\elf\elf.h" />

+    <ClInclude Include="..\..\..\modules\parsers\gas\gas-parser.h" />

+    <ClInclude Include="..\..\..\modules\parsers\nasm\nasm-parser-struct.h" />

+    <ClInclude Include="..\..\..\modules\parsers\nasm\nasm-parser.h" />

+    <ClInclude Include="..\..\..\modules\preprocs\gas\gas-eval.h" />

+    <ClInclude Include="..\..\..\modules\preprocs\nasm\nasm-eval.h" />

+    <ClInclude Include="..\..\..\modules\preprocs\nasm\nasm-pp.h" />

+    <ClInclude Include="..\..\..\modules\preprocs\nasm\nasm.h" />

+    <ClInclude Include="..\..\..\modules\preprocs\nasm\nasmlib.h" />

+    <ClInclude Include="..\..\..\util.h" />

+    <ClInclude Include="..\config.h" />

+    <ClInclude Include="..\libyasm-stdint.h" />

+  </ItemGroup>

+  <ItemGroup>

+    <ProjectReference Include="..\genmacro\genmacro.vcxproj">

+      <Project>{225700a5-07b8-434e-ad61-555278bf6733}</Project>

+      <ReferenceOutputAssembly>false</ReferenceOutputAssembly>

+    </ProjectReference>

+    <ProjectReference Include="..\genperf\genperf.vcxproj">

+      <Project>{c45a8b59-8b59-4d5d-a8e8-fb090f8dd619}</Project>

+      <ReferenceOutputAssembly>false</ReferenceOutputAssembly>

+    </ProjectReference>

+    <ProjectReference Include="..\libyasm\libyasm.vcxproj">

+      <Project>{29fe7874-1256-4ad6-b889-68e399dc9608}</Project>

+      <ReferenceOutputAssembly>false</ReferenceOutputAssembly>

+    </ProjectReference>

+    <ProjectReference Include="..\re2c\re2c.vcxproj">

+      <Project>{3c58be13-50a3-4583-984d-d8902b3d7713}</Project>

+      <ReferenceOutputAssembly>false</ReferenceOutputAssembly>

+    </ProjectReference>

+  </ItemGroup>

+  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />

+  <ImportGroup Label="ExtensionTargets">

+  </ImportGroup>

+</Project>
\ No newline at end of file
diff --git a/Mkfiles/vc10/modules/modules.vcxproj.filters b/Mkfiles/vc10/modules/modules.vcxproj.filters
new file mode 100644
index 0000000..d66bf48
--- /dev/null
+++ b/Mkfiles/vc10/modules/modules.vcxproj.filters
@@ -0,0 +1,253 @@
+<?xml version="1.0" encoding="utf-8"?>

+<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">

+  <ItemGroup>

+    <Filter Include="Source Files">

+      <UniqueIdentifier>{39c89f91-d860-4396-a49f-86b8b7a51c33}</UniqueIdentifier>

+      <Extensions>cpp;c;cxx;rc;def;r;odl;idl;hpj;bat</Extensions>

+    </Filter>

+    <Filter Include="Source Files\arch">

+      <UniqueIdentifier>{be0cdf28-cbed-4774-b3cc-b63e4e3fa0a9}</UniqueIdentifier>

+    </Filter>

+    <Filter Include="Source Files\dbgfmts">

+      <UniqueIdentifier>{491cc60a-889b-4f53-aae9-f4d7d6aa667a}</UniqueIdentifier>

+    </Filter>

+    <Filter Include="Source Files\listfmts">

+      <UniqueIdentifier>{c084015d-3c3e-4379-8746-ae5cffcec79e}</UniqueIdentifier>

+    </Filter>

+    <Filter Include="Source Files\listfmts\nasm">

+      <UniqueIdentifier>{3333e0b3-e95f-44f6-9000-58d4da368360}</UniqueIdentifier>

+    </Filter>

+    <Filter Include="Source Files\objfmts">

+      <UniqueIdentifier>{528f2955-ceba-4691-a36c-054f119e3dcc}</UniqueIdentifier>

+    </Filter>

+    <Filter Include="Source Files\parsers">

+      <UniqueIdentifier>{81686d52-eb71-4d4a-a830-66c45afb808f}</UniqueIdentifier>

+    </Filter>

+    <Filter Include="Source Files\preprocs">

+      <UniqueIdentifier>{98fe1e43-3794-4639-bf29-14b0c569754f}</UniqueIdentifier>

+    </Filter>

+    <Filter Include="Source Files\preprocs\cpp">

+      <UniqueIdentifier>{6b3956d4-0bff-4e8e-af61-a7e59b476fa4}</UniqueIdentifier>

+    </Filter>

+    <Filter Include="Source Files\preprocs\gas">

+      <UniqueIdentifier>{446fad62-ac17-49e9-8263-33481f04f182}</UniqueIdentifier>

+    </Filter>

+    <Filter Include="Source Files\preprocs\nasm">

+      <UniqueIdentifier>{33fb7fc8-61f9-428d-9c94-7a4912fbb678}</UniqueIdentifier>

+    </Filter>

+    <Filter Include="Source Files\preprocs\raw">

+      <UniqueIdentifier>{48fc77ec-7d78-4c0a-bfc2-9aa76faf5d7f}</UniqueIdentifier>

+    </Filter>

+  </ItemGroup>

+  <ItemGroup>

+    <ClCompile Include="..\..\..\gas-token.c">

+      <Filter>Source Files\parsers</Filter>

+    </ClCompile>

+    <ClCompile Include="..\..\..\lc3bid.c">

+      <Filter>Source Files\arch</Filter>

+    </ClCompile>

+    <ClCompile Include="..\..\..\modules\arch\lc3b\lc3barch.c">

+      <Filter>Source Files\arch</Filter>

+    </ClCompile>

+    <ClCompile Include="..\..\..\modules\arch\lc3b\lc3bbc.c">

+      <Filter>Source Files\arch</Filter>

+    </ClCompile>

+    <ClCompile Include="..\..\..\modules\arch\x86\x86arch.c">

+      <Filter>Source Files\arch</Filter>

+    </ClCompile>

+    <ClCompile Include="..\..\..\modules\arch\x86\x86bc.c">

+      <Filter>Source Files\arch</Filter>

+    </ClCompile>

+    <ClCompile Include="..\..\..\modules\arch\x86\x86expr.c">

+      <Filter>Source Files\arch</Filter>

+    </ClCompile>

+    <ClCompile Include="..\..\..\modules\arch\x86\x86id.c">

+      <Filter>Source Files\arch</Filter>

+    </ClCompile>

+    <ClCompile Include="..\..\..\modules\dbgfmts\codeview\cv-dbgfmt.c">

+      <Filter>Source Files\dbgfmts</Filter>

+    </ClCompile>

+    <ClCompile Include="..\..\..\modules\dbgfmts\codeview\cv-symline.c">

+      <Filter>Source Files\dbgfmts</Filter>

+    </ClCompile>

+    <ClCompile Include="..\..\..\modules\dbgfmts\codeview\cv-type.c">

+      <Filter>Source Files\dbgfmts</Filter>

+    </ClCompile>

+    <ClCompile Include="..\..\..\modules\dbgfmts\dwarf2\dwarf2-aranges.c">

+      <Filter>Source Files\dbgfmts</Filter>

+    </ClCompile>

+    <ClCompile Include="..\..\..\modules\dbgfmts\dwarf2\dwarf2-dbgfmt.c">

+      <Filter>Source Files\dbgfmts</Filter>

+    </ClCompile>

+    <ClCompile Include="..\..\..\modules\dbgfmts\dwarf2\dwarf2-info.c">

+      <Filter>Source Files\dbgfmts</Filter>

+    </ClCompile>

+    <ClCompile Include="..\..\..\modules\dbgfmts\dwarf2\dwarf2-line.c">

+      <Filter>Source Files\dbgfmts</Filter>

+    </ClCompile>

+    <ClCompile Include="..\..\..\modules\dbgfmts\null\null-dbgfmt.c">

+      <Filter>Source Files\dbgfmts</Filter>

+    </ClCompile>

+    <ClCompile Include="..\..\..\modules\dbgfmts\stabs\stabs-dbgfmt.c">

+      <Filter>Source Files\dbgfmts</Filter>

+    </ClCompile>

+    <ClCompile Include="..\..\..\modules\listfmts\nasm\nasm-listfmt.c">

+      <Filter>Source Files\listfmts\nasm</Filter>

+    </ClCompile>

+    <ClCompile Include="..\..\..\modules\objfmts\bin\bin-objfmt.c">

+      <Filter>Source Files\objfmts</Filter>

+    </ClCompile>

+    <ClCompile Include="..\..\..\modules\objfmts\coff\coff-objfmt.c">

+      <Filter>Source Files\objfmts</Filter>

+    </ClCompile>

+    <ClCompile Include="..\..\..\modules\objfmts\coff\win64-except.c">

+      <Filter>Source Files\objfmts</Filter>

+    </ClCompile>

+    <ClCompile Include="..\..\..\modules\objfmts\dbg\dbg-objfmt.c">

+      <Filter>Source Files\objfmts</Filter>

+    </ClCompile>

+    <ClCompile Include="..\..\..\modules\objfmts\elf\elf-objfmt.c">

+      <Filter>Source Files\objfmts</Filter>

+    </ClCompile>

+    <ClCompile Include="..\..\..\modules\objfmts\elf\elf-x86-amd64.c">

+      <Filter>Source Files\objfmts</Filter>

+    </ClCompile>

+    <ClCompile Include="..\..\..\modules\objfmts\elf\elf-x86-x86.c">

+      <Filter>Source Files\objfmts</Filter>

+    </ClCompile>

+    <ClCompile Include="..\..\..\modules\objfmts\elf\elf.c">

+      <Filter>Source Files\objfmts</Filter>

+    </ClCompile>

+    <ClCompile Include="..\..\..\modules\objfmts\macho\macho-objfmt.c">

+      <Filter>Source Files\objfmts</Filter>

+    </ClCompile>

+    <ClCompile Include="..\..\..\modules\objfmts\rdf\rdf-objfmt.c">

+      <Filter>Source Files\objfmts</Filter>

+    </ClCompile>

+    <ClCompile Include="..\..\..\modules\objfmts\xdf\xdf-objfmt.c">

+      <Filter>Source Files\objfmts</Filter>

+    </ClCompile>

+    <ClCompile Include="..\..\..\modules\parsers\gas\gas-parse-intel.c">

+      <Filter>Source Files\parsers</Filter>

+    </ClCompile>

+    <ClCompile Include="..\..\..\modules\parsers\gas\gas-parse.c">

+      <Filter>Source Files\parsers</Filter>

+    </ClCompile>

+    <ClCompile Include="..\..\..\modules\parsers\gas\gas-parser.c">

+      <Filter>Source Files\parsers</Filter>

+    </ClCompile>

+    <ClCompile Include="..\..\..\modules\parsers\nasm\nasm-parse.c">

+      <Filter>Source Files\parsers</Filter>

+    </ClCompile>

+    <ClCompile Include="..\..\..\modules\parsers\nasm\nasm-parser.c">

+      <Filter>Source Files\parsers</Filter>

+    </ClCompile>

+    <ClCompile Include="..\..\..\modules\preprocs\cpp\cpp-preproc.c">

+      <Filter>Source Files\preprocs\cpp</Filter>

+    </ClCompile>

+    <ClCompile Include="..\..\..\modules\preprocs\gas\gas-eval.c">

+      <Filter>Source Files\preprocs\gas</Filter>

+    </ClCompile>

+    <ClCompile Include="..\..\..\modules\preprocs\gas\gas-preproc.c">

+      <Filter>Source Files\preprocs\gas</Filter>

+    </ClCompile>

+    <ClCompile Include="..\..\..\modules\preprocs\nasm\nasm-eval.c">

+      <Filter>Source Files\preprocs\nasm</Filter>

+    </ClCompile>

+    <ClCompile Include="..\..\..\modules\preprocs\nasm\nasm-pp.c">

+      <Filter>Source Files\preprocs\nasm</Filter>

+    </ClCompile>

+    <ClCompile Include="..\..\..\modules\preprocs\nasm\nasm-preproc.c">

+      <Filter>Source Files\preprocs\nasm</Filter>

+    </ClCompile>

+    <ClCompile Include="..\..\..\modules\preprocs\nasm\nasmlib.c">

+      <Filter>Source Files\preprocs\nasm</Filter>

+    </ClCompile>

+    <ClCompile Include="..\..\..\modules\preprocs\raw\raw-preproc.c">

+      <Filter>Source Files\preprocs\raw</Filter>

+    </ClCompile>

+    <ClCompile Include="..\..\..\nasm-token.c">

+      <Filter>Source Files\parsers</Filter>

+    </ClCompile>

+    <ClCompile Include="..\..\..\x86cpu.c">

+      <Filter>Source Files\arch</Filter>

+    </ClCompile>

+    <ClCompile Include="..\..\..\x86regtmod.c">

+      <Filter>Source Files\arch</Filter>

+    </ClCompile>

+  </ItemGroup>

+  <ItemGroup>

+    <ClInclude Include="..\..\..\modules\arch\lc3b\lc3barch.h">

+      <Filter>Source Files\arch</Filter>

+    </ClInclude>

+    <ClInclude Include="..\..\..\modules\arch\x86\x86arch.h">

+      <Filter>Source Files\arch</Filter>

+    </ClInclude>

+    <ClInclude Include="..\..\..\modules\dbgfmts\codeview\cv-dbgfmt.h">

+      <Filter>Source Files\dbgfmts</Filter>

+    </ClInclude>

+    <ClInclude Include="..\..\..\modules\dbgfmts\dwarf2\dwarf2-dbgfmt.h">

+      <Filter>Source Files\dbgfmts</Filter>

+    </ClInclude>

+    <ClInclude Include="..\..\..\modules\objfmts\coff\coff-objfmt.h">

+      <Filter>Source Files\objfmts</Filter>

+    </ClInclude>

+    <ClInclude Include="..\..\..\modules\objfmts\elf\elf-machine.h">

+      <Filter>Source Files\objfmts</Filter>

+    </ClInclude>

+    <ClInclude Include="..\..\..\modules\objfmts\elf\elf.h">

+      <Filter>Source Files\objfmts</Filter>

+    </ClInclude>

+    <ClInclude Include="..\..\..\modules\parsers\gas\gas-parser.h">

+      <Filter>Source Files\parsers</Filter>

+    </ClInclude>

+    <ClInclude Include="..\..\..\modules\parsers\nasm\nasm-parser.h">

+      <Filter>Source Files\parsers</Filter>

+    </ClInclude>

+    <ClInclude Include="..\..\..\modules\preprocs\gas\gas-eval.h">

+      <Filter>Source Files\preprocs\gas</Filter>

+    </ClInclude>

+    <ClInclude Include="..\..\..\modules\preprocs\nasm\nasm-eval.h">

+      <Filter>Source Files\preprocs\nasm</Filter>

+    </ClInclude>

+    <ClInclude Include="..\..\..\modules\preprocs\nasm\nasm-pp.h">

+      <Filter>Source Files\preprocs\nasm</Filter>

+    </ClInclude>

+    <ClInclude Include="..\..\..\modules\preprocs\nasm\nasm.h">

+      <Filter>Source Files\preprocs\nasm</Filter>

+    </ClInclude>

+    <ClInclude Include="..\..\..\modules\preprocs\nasm\nasmlib.h">

+      <Filter>Source Files\preprocs\nasm</Filter>

+    </ClInclude>

+    <ClInclude Include="..\..\..\libyasm\arch.h" />

+    <ClInclude Include="..\..\..\libyasm\bitvect.h" />

+    <ClInclude Include="..\..\..\libyasm\bytecode.h" />

+    <ClInclude Include="..\..\..\libyasm\compat-queue.h" />

+    <ClInclude Include="..\config.h" />

+    <ClInclude Include="..\..\..\libyasm\coretype.h" />

+    <ClInclude Include="..\..\..\libyasm\dbgfmt.h" />

+    <ClInclude Include="..\..\..\libyasm\errwarn.h" />

+    <ClInclude Include="..\..\..\libyasm\expr.h" />

+    <ClInclude Include="..\..\..\libyasm\file.h" />

+    <ClInclude Include="..\..\..\libyasm\floatnum.h" />

+    <ClInclude Include="..\..\..\libyasm\hamt.h" />

+    <ClInclude Include="..\..\..\libyasm\insn.h" />

+    <ClInclude Include="..\..\..\libyasm\intnum.h" />

+    <ClInclude Include="..\libyasm-stdint.h" />

+    <ClInclude Include="..\..\..\libyasm.h" />

+    <ClInclude Include="..\..\..\libyasm\listfmt.h" />

+    <ClInclude Include="..\..\..\libyasm\md5.h" />

+    <ClInclude Include="..\..\..\libyasm\module.h" />

+    <ClInclude Include="..\..\..\modules\parsers\nasm\nasm-parser-struct.h" />

+    <ClInclude Include="..\..\..\libyasm\objfmt.h" />

+    <ClInclude Include="..\..\..\libyasm\parser.h" />

+    <ClInclude Include="..\..\..\libyasm\phash.h" />

+    <ClInclude Include="..\..\..\libyasm\preproc.h" />

+    <ClInclude Include="..\..\..\libyasm\value.h" />

+    <ClInclude Include="..\..\..\libyasm\valparam.h" />

+    <ClInclude Include="..\..\..\libyasm\symrec.h" />

+    <ClInclude Include="..\..\..\libyasm\linemap.h" />

+    <ClInclude Include="..\..\..\libyasm\section.h" />

+    <ClInclude Include="..\..\..\util.h" />

+  </ItemGroup>

+</Project>
\ No newline at end of file
diff --git a/Mkfiles/vc10/out_copy_rename.bat b/Mkfiles/vc10/out_copy_rename.bat
new file mode 100644
index 0000000..349ee33
--- /dev/null
+++ b/Mkfiles/vc10/out_copy_rename.bat
@@ -0,0 +1,42 @@
+@echo off

+if not exist %1 goto nofile

+if exist %2 goto copy

+

+echo creating directory %2

+md %2 > nul

+

+:copy

+set str=%2

+for /f "useback tokens=*" %%a in ('%str%') do set str=%%~a

+set str=%str:~-1%

+if %str% == "\" goto hasbackslash

+

+if not exist %2\%3 goto cpy

+fc %1 %2\%3 > nul && if not %errorlevel 1 goto exit

+echo overwriting %2\%3 with %1

+copy %1 %2\%3 > nul

+goto exit

+

+:cpy

+echo copying %1 to %2\%3

+copy %1 %2\%3 > nul

+goto exit

+

+:hasbackslash

+if not exist %2%3 goto cpy2 

+fc %1 %2%3 > nul && if not %errorlevel 1 goto exit

+echo overwriting %2%3 with %1

+copy %1 %2%3 > nul

+goto exit

+

+:cpy2

+echo copying %1 to %2%3

+copy %1 %2%3 > nul

+goto exit

+

+:nofile

+echo %1 not found

+

+:exit

+

+

diff --git a/Mkfiles/vc10/re2c/re2c.vcxproj b/Mkfiles/vc10/re2c/re2c.vcxproj
new file mode 100644
index 0000000..fb50f14
--- /dev/null
+++ b/Mkfiles/vc10/re2c/re2c.vcxproj
@@ -0,0 +1,134 @@
+<?xml version="1.0" encoding="utf-8"?>

+<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">

+  <ItemGroup Label="ProjectConfigurations">

+    <ProjectConfiguration Include="Debug|Win32">

+      <Configuration>Debug</Configuration>

+      <Platform>Win32</Platform>

+    </ProjectConfiguration>

+    <ProjectConfiguration Include="Release|Win32">

+      <Configuration>Release</Configuration>

+      <Platform>Win32</Platform>

+    </ProjectConfiguration>

+  </ItemGroup>

+  <PropertyGroup Label="Globals">

+    <ProjectGuid>{3C58BE13-50A3-4583-984D-D8902B3D7713}</ProjectGuid>

+    <RootNamespace>re2c</RootNamespace>

+    <Keyword>Win32Proj</Keyword>

+  </PropertyGroup>

+  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />

+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">

+    <ConfigurationType>Application</ConfigurationType>

+    <CharacterSet>MultiByte</CharacterSet>

+  </PropertyGroup>

+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">

+    <ConfigurationType>Application</ConfigurationType>

+    <CharacterSet>MultiByte</CharacterSet>

+  </PropertyGroup>

+  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />

+  <ImportGroup Label="ExtensionSettings">

+  </ImportGroup>

+  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets">

+    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" />

+    <Import Project="..\crt_secure_no_deprecate.props" />

+  </ImportGroup>

+  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets">

+    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" />

+    <Import Project="..\crt_secure_no_deprecate.props" />

+  </ImportGroup>

+  <PropertyGroup Label="UserMacros" />

+  <PropertyGroup>

+    <_ProjectFileVersion>10.0.21006.1</_ProjectFileVersion>

+    <OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(Platform)\$(Configuration)\</OutDir>

+    <IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(Platform)\$(Configuration)\</IntDir>

+    <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</LinkIncremental>

+    <OutDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(Platform)\$(Configuration)\</OutDir>

+    <IntDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(Platform)\$(Configuration)\</IntDir>

+    <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">false</LinkIncremental>

+  </PropertyGroup>

+  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">

+    <ClCompile>

+      <Optimization>Disabled</Optimization>

+      <AdditionalIncludeDirectories>..;../../..;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>

+      <PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>

+      <MinimalRebuild>true</MinimalRebuild>

+      <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>

+      <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>

+      <PrecompiledHeader>

+      </PrecompiledHeader>

+      <ProgramDataBaseFileName>$(IntDir)</ProgramDataBaseFileName>

+      <WarningLevel>Level3</WarningLevel>

+      <CompileAs>Default</CompileAs>

+      <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>

+    </ClCompile>

+    <Link>

+      <OutputFile>$(OutDir)re2c.exe</OutputFile>

+      <GenerateDebugInformation>true</GenerateDebugInformation>

+      <ProgramDatabaseFile>$(OutDir)$(TargetName).pdb</ProgramDatabaseFile>

+      <SubSystem>Console</SubSystem>

+      <RandomizedBaseAddress>false</RandomizedBaseAddress>

+      <DataExecutionPrevention>

+      </DataExecutionPrevention>

+      <TargetMachine>MachineX86</TargetMachine>

+    </Link>

+    <PostBuildEvent>

+      <Command>run.bat "$(TargetPath)"</Command>

+    </PostBuildEvent>

+  </ItemDefinitionGroup>

+  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">

+    <ClCompile>

+      <Optimization>Full</Optimization>

+      <AdditionalIncludeDirectories>..;../../..;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>

+      <PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>

+      <RuntimeLibrary>MultiThreaded</RuntimeLibrary>

+      <PrecompiledHeader>

+      </PrecompiledHeader>

+      <ProgramDataBaseFileName>$(IntDir)</ProgramDataBaseFileName>

+      <WarningLevel>Level3</WarningLevel>

+      <CompileAs>Default</CompileAs>

+    </ClCompile>

+    <Link>

+      <OutputFile>$(OutDir)re2c.exe</OutputFile>

+      <ProgramDatabaseFile>$(OutDir)$(TargetName).pdb</ProgramDatabaseFile>

+      <SubSystem>Console</SubSystem>

+      <OptimizeReferences>true</OptimizeReferences>

+      <EnableCOMDATFolding>true</EnableCOMDATFolding>

+      <RandomizedBaseAddress>false</RandomizedBaseAddress>

+      <DataExecutionPrevention>

+      </DataExecutionPrevention>

+      <TargetMachine>MachineX86</TargetMachine>

+    </Link>

+    <PostBuildEvent>

+      <Command>run.bat "$(TargetPath)"</Command>

+    </PostBuildEvent>

+  </ItemDefinitionGroup>

+  <ItemGroup>

+    <ClCompile Include="..\..\..\tools\re2c\actions.c" />

+    <ClCompile Include="..\..\..\tools\re2c\code.c" />

+    <ClCompile Include="..\..\..\tools\re2c\dfa.c" />

+    <ClCompile Include="..\..\..\tools\re2c\main.c" />

+    <ClCompile Include="..\..\..\tools\re2c\mbo_getopt.c" />

+    <ClCompile Include="..\..\..\tools\re2c\parser.c" />

+    <ClCompile Include="..\..\..\tools\re2c\scanner.c" />

+    <ClCompile Include="..\..\..\tools\re2c\substr.c" />

+    <ClCompile Include="..\..\..\tools\re2c\translate.c" />

+  </ItemGroup>

+  <ItemGroup>

+    <ClInclude Include="..\..\..\tools\re2c\basics.h" />

+    <ClInclude Include="..\..\..\tools\re2c\dfa.h" />

+    <ClInclude Include="..\..\..\tools\re2c\globals.h" />

+    <ClInclude Include="..\..\..\tools\re2c\ins.h" />

+    <ClInclude Include="..\..\..\tools\re2c\mbo_getopt.h" />

+    <ClInclude Include="..\..\..\tools\re2c\parse.h" />

+    <ClInclude Include="..\..\..\tools\re2c\parser.h" />

+    <ClInclude Include="..\..\..\tools\re2c\re.h" />

+    <ClInclude Include="..\..\..\tools\re2c\scanner.h" />

+    <ClInclude Include="..\..\..\tools\re2c\substr.h" />

+    <ClInclude Include="..\..\..\tools\re2c\token.h" />

+  </ItemGroup>

+  <ItemGroup>

+    <None Include="run.bat" />

+  </ItemGroup>

+  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />

+  <ImportGroup Label="ExtensionTargets">

+  </ImportGroup>

+</Project>
\ No newline at end of file
diff --git a/Mkfiles/vc10/re2c/re2c.vcxproj.filters b/Mkfiles/vc10/re2c/re2c.vcxproj.filters
new file mode 100644
index 0000000..426ee6e
--- /dev/null
+++ b/Mkfiles/vc10/re2c/re2c.vcxproj.filters
@@ -0,0 +1,80 @@
+<?xml version="1.0" encoding="utf-8"?>

+<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">

+  <ItemGroup>

+    <Filter Include="Header Files">

+      <UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>

+      <Extensions>h;hpp;hxx;hm;inl;inc;xsd</Extensions>

+    </Filter>

+    <Filter Include="Source Files">

+      <UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>

+      <Extensions>cpp;c;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>

+    </Filter>

+  </ItemGroup>

+  <ItemGroup>

+    <ClCompile Include="..\..\..\tools\re2c\actions.c">

+      <Filter>Source Files</Filter>

+    </ClCompile>

+    <ClCompile Include="..\..\..\tools\re2c\code.c">

+      <Filter>Source Files</Filter>

+    </ClCompile>

+    <ClCompile Include="..\..\..\tools\re2c\dfa.c">

+      <Filter>Source Files</Filter>

+    </ClCompile>

+    <ClCompile Include="..\..\..\tools\re2c\main.c">

+      <Filter>Source Files</Filter>

+    </ClCompile>

+    <ClCompile Include="..\..\..\tools\re2c\mbo_getopt.c">

+      <Filter>Source Files</Filter>

+    </ClCompile>

+    <ClCompile Include="..\..\..\tools\re2c\parser.c">

+      <Filter>Source Files</Filter>

+    </ClCompile>

+    <ClCompile Include="..\..\..\tools\re2c\scanner.c">

+      <Filter>Source Files</Filter>

+    </ClCompile>

+    <ClCompile Include="..\..\..\tools\re2c\substr.c">

+      <Filter>Source Files</Filter>

+    </ClCompile>

+    <ClCompile Include="..\..\..\tools\re2c\translate.c">

+      <Filter>Source Files</Filter>

+    </ClCompile>

+  </ItemGroup>

+  <ItemGroup>

+    <ClInclude Include="..\..\..\tools\re2c\basics.h">

+      <Filter>Header Files</Filter>

+    </ClInclude>

+    <ClInclude Include="..\..\..\tools\re2c\dfa.h">

+      <Filter>Header Files</Filter>

+    </ClInclude>

+    <ClInclude Include="..\..\..\tools\re2c\globals.h">

+      <Filter>Header Files</Filter>

+    </ClInclude>

+    <ClInclude Include="..\..\..\tools\re2c\ins.h">

+      <Filter>Header Files</Filter>

+    </ClInclude>

+    <ClInclude Include="..\..\..\tools\re2c\parse.h">

+      <Filter>Header Files</Filter>

+    </ClInclude>

+    <ClInclude Include="..\..\..\tools\re2c\parser.h">

+      <Filter>Header Files</Filter>

+    </ClInclude>

+    <ClInclude Include="..\..\..\tools\re2c\re.h">

+      <Filter>Header Files</Filter>

+    </ClInclude>

+    <ClInclude Include="..\..\..\tools\re2c\scanner.h">

+      <Filter>Header Files</Filter>

+    </ClInclude>

+    <ClInclude Include="..\..\..\tools\re2c\substr.h">

+      <Filter>Header Files</Filter>

+    </ClInclude>

+    <ClInclude Include="..\..\..\tools\re2c\token.h">

+      <Filter>Header Files</Filter>

+    </ClInclude>

+    <ClInclude Include="..\..\..\tools\re2c\mbo_getopt.h">

+      <Filter>Header Files</Filter>

+    </ClInclude>

+  </ItemGroup>

+  <ItemGroup>

+    <None Include="run.bat" />

+  </ItemGroup>

+</Project>
\ No newline at end of file
diff --git a/Mkfiles/vc10/re2c/run.bat b/Mkfiles/vc10/re2c/run.bat
new file mode 100644
index 0000000..cde2a7b
--- /dev/null
+++ b/Mkfiles/vc10/re2c/run.bat
@@ -0,0 +1,4 @@
+cd ..\..\..\

+%1 -s -o lc3bid.c modules\arch\lc3b\lc3bid.re

+%1 -b -o nasm-token.c modules\parsers\nasm\nasm-token.re

+%1 -b -o gas-token.c modules\parsers\gas\gas-token.re

diff --git a/Mkfiles/vc10/readme.vc10.txt b/Mkfiles/vc10/readme.vc10.txt
new file mode 100644
index 0000000..0182520
--- /dev/null
+++ b/Mkfiles/vc10/readme.vc10.txt
@@ -0,0 +1,119 @@
+Building YASM with Microsoft Visual Studio 2010 (C/C++ v10)

+-----------------------------------------------------------

+

+This note describes how to build YASM using Microsoft Visual

+Studio 2010 (C/C++ v10).

+

+1. The Compiler

+---------------

+

+If you want to build the 64-bit version of YASM you will need 

+to install the Visual Studio 2010 64-bit tools, which may not 

+be installed by default.  If using Visual C++ Express 2010, 

+you will need to install the Windows SDK to obtain the 64-bit

+build tools. 

+

+2. YASM Download

+----------------

+

+First YASM needs to be downloaded and the files placed within 

+a suitable directory, which will be called <yasm> here but can 

+be named and located as you wish.

+

+3. Building YASM with Microsoft 2010 (VC10)

+-------------------------------------------

+

+Now locate and double click on the yasm.sln solution file in 

+the 'Mkfiles/vc10' subdirectory to open the build project in 

+the Visual Studio 2010 IDE and then select:

+

+    win32 or x64 build

+    release or debug build

+

+as appropriate to build the YASM binaries that you need.

+

+4. Using YASM with Visual Sudio 2010 and VC++ version 10

+--------------------------------------------------------

+

+The YASM version vsyasm.exe is designed specifically for use

+with Visual Studio 2010. To tell Visual Studio where to find

+vsyasm.exe, the environment variable YASMPATH can be set to 

+the absolute path of the directory in which vsyasm.exe is

+located (this path should include the final backslash). 

+

+Alternatively you can find the directory (or directories) 

+where the VC++ compiler binaries are located and put copies 

+of the vsyasm.exe binary in these directories. The typical 

+location on 64-bit Windows is:

+

+C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\bin

+

+On 32-bit Windows it is normally at:

+  

+C:\Program Files\Microsoft Visual Studio 10.0\VC\bin

+

+Depending on your system you can use either the win32 or the

+x64 version of vsyasm.exe, which must be named vsyasm.exe. 

+

+To use the new custom tools facility in Visual Studio 2010, you

+need to place a copy of three files - yasm.props, yasm.targets 

+and yasm.xml - into a location where they can be found by the

+Visual Studio build customisation processes.  There are several 

+ways to do this:

+

+  a. put these files in the MSBUILD customisation directory, 

+  which is typically at:

+

+    C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\BuildCustomizations

+  

+  or:

+  

+    C:\Program Files\MSBuild\Microsoft.Cpp\v4.0\BuildCustomizations

+

+  b. put them in a convenient location and set this path in the 

+     'Build Customisations Search Path' in the Visual Studio 

+	 'Projects and Solutions|VC++ Project Settings' item in

+	 the 'Tools|Options' menu; 

+

+  c. put them in a convenient location and set this path in the 

+     'Build Customisation dialogue (discussed later).

+

+To use YASM in a project, right click on the project in the Solution 

+Explorer and select 'Build Customisations..'. This will give you a 

+dialog box that allows you to select YASM as an assembler (note that 

+your assembler files need to have the extension '.asm').  If you have 

+used option c. above, you will need to let the dialogue find them 

+using the 'Find Existing' button below the dialogue.

+

+To assemble a file with YASM, select the Property Page for the 

+file and the select 'Yasm Assembler' in the Tool dialog entry. 

+Then click 'Apply' and an additional property page entry will 

+appear and enable YASM settings to be established.

+

+5. A Linker Issue

+-----------------

+

+There appears to be a linker bug in the VC++ linker that 

+prevents symbols with absolute addresses being linked in DLL 

+builds.  This means, for example, that LEA instructions of 

+the general form:

+

+   lea, rax,[rax+symbol]

+

+cannot be used for DLL builds.  The following general form 

+has to be used instead:

+

+   lea rcx,[symbol wrt rip]

+   lea rax,[rax+rcx]

+

+This limitation may also cause problems with other instruction 

+that use absolute addresses.

+

+6. Acknowledgements

+-------------------

+

+I am most grateful for the fantastic support that Peter Johnson,

+YASM's creator, has given me in tracking down issues in using

+YASM for the production of Windows x64 code.

+

+  Brian Gladman, 29th January 2011

diff --git a/Mkfiles/vc10/vsyasm.props b/Mkfiles/vc10/vsyasm.props
new file mode 100644
index 0000000..89476f2
--- /dev/null
+++ b/Mkfiles/vc10/vsyasm.props
@@ -0,0 +1,27 @@
+<?xml version="1.0" encoding="utf-8"?>

+<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">

+  <PropertyGroup

+    Condition="'$(YASMBeforeTargets)' == '' and '$(YASMAfterTargets)' == '' and '$(ConfigurationType)' != 'Makefile'">

+    <YASMBeforeTargets>Midl</YASMBeforeTargets>

+    <YASMAfterTargets>CustomBuild</YASMAfterTargets>

+  </PropertyGroup>

+  <PropertyGroup>

+    <YASMDependsOn

+      Condition="'$(ConfigurationType)' != 'Makefile'">_SelectedFiles;$(YASMDependsOn)</YASMDependsOn>

+  </PropertyGroup>

+  <PropertyGroup>

+    <YasmPath Condition= "'$(YASMPATH)' == ''">$(VCInstallDir)bin\</YasmPath>

+  </PropertyGroup>

+  <ItemDefinitionGroup>

+    <YASM>

+      <Debug>False</Debug>

+      <ObjectFile>$(IntDir)</ObjectFile>

+      <PreProc>0</PreProc>

+      <Parser>0</Parser>

+      <CommandLineTemplate>"$(YasmPath)"vsyasm.exe -Xvc -f $(Platform) [AllOptions] [AdditionalOptions] [Inputs]</CommandLineTemplate>

+      <Outputs>%(ObjectFile)</Outputs>

+      <ExecutionDescription>Assembling %(Filename)%(Extension)</ExecutionDescription>

+      <ShowOnlyRuleProperties>false</ShowOnlyRuleProperties>

+    </YASM>

+  </ItemDefinitionGroup>

+</Project>
\ No newline at end of file
diff --git a/Mkfiles/vc10/vsyasm.targets b/Mkfiles/vc10/vsyasm.targets
new file mode 100644
index 0000000..c86180d
--- /dev/null
+++ b/Mkfiles/vc10/vsyasm.targets
@@ -0,0 +1,108 @@
+<?xml version="1.0" encoding="utf-8"?>

+<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">

+  <ItemGroup>

+    <PropertyPageSchema

+      Include="$(MSBuildThisFileDirectory)$(MSBuildThisFileName).xml" />

+    <AvailableItemName

+      Include="YASM">

+      <Targets>_YASM</Targets>

+    </AvailableItemName>

+  </ItemGroup>

+  <UsingTask

+    TaskName="YASM"

+    TaskFactory="XamlTaskFactory"

+    AssemblyName="Microsoft.Build.Tasks.v4.0">

+    <Task>$(MSBuildThisFileDirectory)$(MSBuildThisFileName).xml</Task>

+  </UsingTask>

+  <Target

+    Name="_YASM"

+    BeforeTargets="$(YASMBeforeTargets)"

+    AfterTargets="$(YASMAfterTargets)"

+    Condition="'@(YASM)' != ''"

+    DependsOnTargets="$(YASMDependsOn);ComputeYASMOutput"

+    Outputs="@(YASM->'%(ObjectFile)')"

+    Inputs="@(YASM);%(YASM.AdditionalDependencies);$(MSBuildProjectFile)">

+    <ItemGroup

+      Condition="'@(SelectedFiles)' != ''">

+      <YASM

+        Remove="@(YASM)"

+        Condition="'%(Identity)' != '@(SelectedFiles)'" />

+    </ItemGroup>

+    <ItemGroup>

+      <YASM_tlog

+        Include="%(YASM.ObjectFile)"

+        Condition="'%(YASM.ObjectFile)' != '' and '%(YASM.ExcludedFromBuild)' != 'true'">

+        <Source>@(YASM, '|')</Source>

+      </YASM_tlog>

+    </ItemGroup>

+    <Message

+      Importance="High"

+      Text="%(YASM.ExecutionDescription)" />

+    <WriteLinesToFile

+      Condition="'@(YASM_tlog)' != '' and '%(YASM_tlog.ExcludedFromBuild)' != 'true'"

+      File="$(IntDir)$(ProjectName).write.1.tlog"

+      Lines="^%(YASM_tlog.Source);@(YASM_tlog->'%(Fullpath)')" />

+    <YASM

+      Condition="'@(YASM)' != '' and '%(YASM.ExcludedFromBuild)' != 'true'"

+      CommandLineTemplate="%(YASM.CommandLineTemplate)"

+      Debug="%(YASM.Debug)"

+      PreIncludeFile="%(YASM.PreIncludeFile)"

+      IncludePaths="%(YASM.IncludePaths)"

+      Defines="%(YASM.Defines)"

+      UnDefines="%(YASM.UnDefines)"

+      ObjectFile="%(YASM.ObjectFile)"

+      ListFile="%(YASM.ListFile)"

+      MapFile="%(YASM.MapFile)"

+      ErrorFile="%(YASM.ErrorFile)"

+      SymbolPrefix="%(YASM.SymbolPrefix)"

+      SymbolSuffix="%(YASM.SymbolSuffix)"

+      PreProc="%(YASM.PreProc)"

+      Parser="%(YASM.Parser)"

+      AdditionalOptions="%(YASM.AdditionalOptions)"

+      Inputs="@(YASM)" />

+  </Target>

+  <PropertyGroup>

+    <ComputeLinkInputsTargets>

+            $(ComputeLinkInputsTargets);

+            ComputeYASMOutput;

+          </ComputeLinkInputsTargets>

+    <ComputeLibInputsTargets>

+            $(ComputeLibInputsTargets);

+            ComputeYASMOutput;

+          </ComputeLibInputsTargets>

+  </PropertyGroup>

+  <Target

+    Name="ComputeYASMOutput"

+    Condition="'@(YASM)' != ''">

+    <ItemGroup>

+      <YASMDirsToMake

+        Condition="'@(YASM)' != '' and '%(YASM.ExcludedFromBuild)' != 'true' and !HasTrailingSlash('%(YASM.ObjectFile)')"

+        Include="%(YASM.ObjectFile)" />

+      <Link

+        Include="%(YASMDirsToMake.Identity)"

+        Condition="'%(Extension)'=='.obj' or '%(Extension)'=='.res' or '%(Extension)'=='.rsc' or '%(Extension)'=='.lib'" />

+      <Lib

+        Include="%(YASMDirsToMake.Identity)"

+        Condition="'%(Extension)'=='.obj' or '%(Extension)'=='.res' or '%(Extension)'=='.rsc' or '%(Extension)'=='.lib'" />

+      <ImpLib

+        Include="%(YASMDirsToMake.Identity)"

+        Condition="'%(Extension)'=='.obj' or '%(Extension)'=='.res' or '%(Extension)'=='.rsc' or '%(Extension)'=='.lib'" />

+    </ItemGroup>

+    <ItemGroup>

+      <YASMDirsToMake

+        Condition="'@(YASM)' != '' and '%(YASM.ExcludedFromBuild)' != 'true' and HasTrailingSlash('%(YASM.ObjectFile)')"

+        Include="@(YASM->'%(ObjectFile)%(Filename).obj')" />

+      <Link

+        Include="%(YASMDirsToMake.Identity)"

+        Condition="'%(Extension)'=='.obj' or '%(Extension)'=='.res' or '%(Extension)'=='.rsc' or '%(Extension)'=='.lib'" />

+      <Lib

+        Include="%(YASMDirsToMake.Identity)"

+        Condition="'%(Extension)'=='.obj' or '%(Extension)'=='.res' or '%(Extension)'=='.rsc' or '%(Extension)'=='.lib'" />

+      <ImpLib

+        Include="%(YASMDirsToMake.Identity)"

+        Condition="'%(Extension)'=='.obj' or '%(Extension)'=='.res' or '%(Extension)'=='.rsc' or '%(Extension)'=='.lib'" />

+    </ItemGroup>

+    <MakeDir

+      Directories="@(YASMDirsToMake->'%(RootDir)%(Directory)')" />

+  </Target>

+</Project>
\ No newline at end of file
diff --git a/Mkfiles/vc10/vsyasm.vcxproj b/Mkfiles/vc10/vsyasm.vcxproj
new file mode 100644
index 0000000..a5ed260
--- /dev/null
+++ b/Mkfiles/vc10/vsyasm.vcxproj
@@ -0,0 +1,275 @@
+<?xml version="1.0" encoding="utf-8"?>

+<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">

+  <ItemGroup Label="ProjectConfigurations">

+    <ProjectConfiguration Include="Debug|Win32">

+      <Configuration>Debug</Configuration>

+      <Platform>Win32</Platform>

+    </ProjectConfiguration>

+    <ProjectConfiguration Include="Debug|x64">

+      <Configuration>Debug</Configuration>

+      <Platform>x64</Platform>

+    </ProjectConfiguration>

+    <ProjectConfiguration Include="Release|Win32">

+      <Configuration>Release</Configuration>

+      <Platform>Win32</Platform>

+    </ProjectConfiguration>

+    <ProjectConfiguration Include="Release|x64">

+      <Configuration>Release</Configuration>

+      <Platform>x64</Platform>

+    </ProjectConfiguration>

+  </ItemGroup>

+  <PropertyGroup Label="Globals">

+    <ProjectGuid>{7FDD85BB-CC86-442B-A425-989B5B296ED5}</ProjectGuid>

+    <RootNamespace>vsyasm</RootNamespace>

+  </PropertyGroup>

+  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />

+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">

+    <ConfigurationType>Application</ConfigurationType>

+    <UseOfMfc>false</UseOfMfc>

+    <CharacterSet>MultiByte</CharacterSet>

+  </PropertyGroup>

+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">

+    <ConfigurationType>Application</ConfigurationType>

+    <UseOfMfc>false</UseOfMfc>

+    <CharacterSet>MultiByte</CharacterSet>

+  </PropertyGroup>

+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">

+    <ConfigurationType>Application</ConfigurationType>

+    <UseOfMfc>false</UseOfMfc>

+    <CharacterSet>MultiByte</CharacterSet>

+  </PropertyGroup>

+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">

+    <ConfigurationType>Application</ConfigurationType>

+    <UseOfMfc>false</UseOfMfc>

+    <CharacterSet>MultiByte</CharacterSet>

+  </PropertyGroup>

+  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />

+  <ImportGroup Label="ExtensionSettings">

+  </ImportGroup>

+  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets">

+    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" />

+    <Import Project="crt_secure_no_deprecate.props" />

+  </ImportGroup>

+  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets">

+    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" />

+    <Import Project="crt_secure_no_deprecate.props" />

+  </ImportGroup>

+  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets">

+    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" />

+    <Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC71.props" />

+    <Import Project="crt_secure_no_deprecate.props" />

+  </ImportGroup>

+  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets">

+    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" />

+    <Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC71.props" />

+    <Import Project="crt_secure_no_deprecate.props" />

+  </ImportGroup>

+  <PropertyGroup Label="UserMacros" />

+  <PropertyGroup>

+    <_ProjectFileVersion>10.0.21006.1</_ProjectFileVersion>

+    <OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(Platform)\$(Configuration)\</OutDir>

+    <IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(Platform)\$(Configuration)\</IntDir>

+    <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">false</LinkIncremental>

+    <OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(Platform)\$(Configuration)\</OutDir>

+    <IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(Platform)\$(Configuration)\</IntDir>

+    <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">false</LinkIncremental>

+    <OutDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(Platform)\$(Configuration)\</OutDir>

+    <IntDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(Platform)\$(Configuration)\</IntDir>

+    <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">false</LinkIncremental>

+    <OutDir Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(Platform)\$(Configuration)\</OutDir>

+    <IntDir Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(Platform)\$(Configuration)\</IntDir>

+    <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|x64'">false</LinkIncremental>

+  </PropertyGroup>

+  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">

+    <Midl>

+      <TypeLibraryName>$(Platform)\$(Configuration)/yasm.tlb</TypeLibraryName>

+      <HeaderFileName>

+      </HeaderFileName>

+    </Midl>

+    <ClCompile>

+      <Optimization>Disabled</Optimization>

+      <AdditionalIncludeDirectories>.;../..;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>

+      <PreprocessorDefinitions>_DEBUG;WIN32;_LIB;HAVE_CONFIG_H;VC;%(PreprocessorDefinitions)</PreprocessorDefinitions>

+      <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>

+      <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>

+      <PrecompiledHeader>

+      </PrecompiledHeader>

+      <PrecompiledHeaderOutputFile>

+      </PrecompiledHeaderOutputFile>

+      <AssemblerListingLocation>$(IntDir)</AssemblerListingLocation>

+      <ObjectFileName>$(IntDir)</ObjectFileName>

+      <ProgramDataBaseFileName>$(IntDir)</ProgramDataBaseFileName>

+      <WarningLevel>Level3</WarningLevel>

+      <SuppressStartupBanner>true</SuppressStartupBanner>

+      <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>

+      <CompileAs>Default</CompileAs>

+    </ClCompile>

+    <ResourceCompile>

+      <PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>

+      <Culture>0x0409</Culture>

+    </ResourceCompile>

+    <Link>

+      <OutputFile>$(OutDir)vsyasm.exe</OutputFile>

+      <SuppressStartupBanner>true</SuppressStartupBanner>

+      <GenerateDebugInformation>true</GenerateDebugInformation>

+      <ProgramDatabaseFile>$(OutDir)$(ProjectName).pdb</ProgramDatabaseFile>

+      <SubSystem>Console</SubSystem>

+      <RandomizedBaseAddress>false</RandomizedBaseAddress>

+      <DataExecutionPrevention>

+      </DataExecutionPrevention>

+      <TargetMachine>MachineX86</TargetMachine>

+    </Link>

+  </ItemDefinitionGroup>

+  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">

+    <Midl>

+      <TargetEnvironment>X64</TargetEnvironment>

+      <TypeLibraryName>$(Platform)\$(Configuration)/yasm.tlb</TypeLibraryName>

+      <HeaderFileName>

+      </HeaderFileName>

+    </Midl>

+    <ClCompile>

+      <Optimization>Disabled</Optimization>

+      <AdditionalIncludeDirectories>.;../..;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>

+      <PreprocessorDefinitions>_DEBUG;_LIB;HAVE_CONFIG_H;VC;WIN64;%(PreprocessorDefinitions)</PreprocessorDefinitions>

+      <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>

+      <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>

+      <PrecompiledHeader>

+      </PrecompiledHeader>

+      <PrecompiledHeaderOutputFile>

+      </PrecompiledHeaderOutputFile>

+      <AssemblerListingLocation>$(IntDir)</AssemblerListingLocation>

+      <ObjectFileName>$(IntDir)</ObjectFileName>

+      <ProgramDataBaseFileName>$(IntDir)</ProgramDataBaseFileName>

+      <WarningLevel>Level3</WarningLevel>

+      <SuppressStartupBanner>true</SuppressStartupBanner>

+      <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>

+      <CompileAs>Default</CompileAs>

+    </ClCompile>

+    <ResourceCompile>

+      <PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>

+      <Culture>0x0409</Culture>

+    </ResourceCompile>

+    <Link>

+      <OutputFile>$(OutDir)vsyasm.exe</OutputFile>

+      <SuppressStartupBanner>true</SuppressStartupBanner>

+      <GenerateDebugInformation>true</GenerateDebugInformation>

+      <ProgramDatabaseFile>$(OutDir)$(TargetName).pdb</ProgramDatabaseFile>

+      <SubSystem>Console</SubSystem>

+      <RandomizedBaseAddress>false</RandomizedBaseAddress>

+      <DataExecutionPrevention>

+      </DataExecutionPrevention>

+      <TargetMachine>MachineX64</TargetMachine>

+    </Link>

+  </ItemDefinitionGroup>

+  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">

+    <Midl>

+      <TypeLibraryName>$(Platform)\$(Configuration)/yasm.tlb</TypeLibraryName>

+      <HeaderFileName>

+      </HeaderFileName>

+    </Midl>

+    <ClCompile>

+      <Optimization>Full</Optimization>

+      <InlineFunctionExpansion>Default</InlineFunctionExpansion>

+      <IntrinsicFunctions>true</IntrinsicFunctions>

+      <AdditionalIncludeDirectories>.;../..;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>

+      <PreprocessorDefinitions>NDEBUG;WIN32;_LIB;HAVE_CONFIG_H;VC;%(PreprocessorDefinitions)</PreprocessorDefinitions>

+      <StringPooling>true</StringPooling>

+      <RuntimeLibrary>MultiThreaded</RuntimeLibrary>

+      <FunctionLevelLinking>true</FunctionLevelLinking>

+      <PrecompiledHeader>

+      </PrecompiledHeader>

+      <PrecompiledHeaderOutputFile>

+      </PrecompiledHeaderOutputFile>

+      <AssemblerListingLocation>$(IntDir)</AssemblerListingLocation>

+      <ObjectFileName>$(IntDir)</ObjectFileName>

+      <ProgramDataBaseFileName>$(IntDir)</ProgramDataBaseFileName>

+      <WarningLevel>Level3</WarningLevel>

+      <SuppressStartupBanner>true</SuppressStartupBanner>

+      <CompileAs>Default</CompileAs>

+      <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>

+    </ClCompile>

+    <ResourceCompile>

+      <PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>

+      <Culture>0x0409</Culture>

+    </ResourceCompile>

+    <Link>

+      <OutputFile>$(OutDir)vsyasm.exe</OutputFile>

+      <SuppressStartupBanner>true</SuppressStartupBanner>

+      <GenerateDebugInformation>true</GenerateDebugInformation>

+      <ProgramDatabaseFile>$(OutDir)$(ProjectName).pdb</ProgramDatabaseFile>

+      <SubSystem>Console</SubSystem>

+      <RandomizedBaseAddress>false</RandomizedBaseAddress>

+      <DataExecutionPrevention>

+      </DataExecutionPrevention>

+      <TargetMachine>MachineX86</TargetMachine>

+    </Link>

+  </ItemDefinitionGroup>

+  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">

+    <Midl>

+      <TargetEnvironment>X64</TargetEnvironment>

+      <TypeLibraryName>$(Platform)\$(Configuration)/yasm.tlb</TypeLibraryName>

+      <HeaderFileName>

+      </HeaderFileName>

+    </Midl>

+    <ClCompile>

+      <Optimization>Full</Optimization>

+      <InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>

+      <AdditionalIncludeDirectories>.;../..;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>

+      <PreprocessorDefinitions>NDEBUG;_LIB;HAVE_CONFIG_H;VC;WIN64;%(PreprocessorDefinitions)</PreprocessorDefinitions>

+      <StringPooling>true</StringPooling>

+      <RuntimeLibrary>MultiThreaded</RuntimeLibrary>

+      <FunctionLevelLinking>true</FunctionLevelLinking>

+      <PrecompiledHeader>

+      </PrecompiledHeader>

+      <PrecompiledHeaderOutputFile>

+      </PrecompiledHeaderOutputFile>

+      <AssemblerListingLocation>$(IntDir)</AssemblerListingLocation>

+      <ObjectFileName>$(IntDir)</ObjectFileName>

+      <ProgramDataBaseFileName>$(IntDir)</ProgramDataBaseFileName>

+      <WarningLevel>Level3</WarningLevel>

+      <SuppressStartupBanner>true</SuppressStartupBanner>

+      <CompileAs>Default</CompileAs>

+      <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>

+    </ClCompile>

+    <ResourceCompile>

+      <PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>

+      <Culture>0x0409</Culture>

+    </ResourceCompile>

+    <Link>

+      <OutputFile>$(OutDir)vsyasm.exe</OutputFile>

+      <SuppressStartupBanner>true</SuppressStartupBanner>

+      <ProgramDatabaseFile>$(OutDir)$(TargetName).pdb</ProgramDatabaseFile>

+      <SubSystem>Console</SubSystem>

+      <RandomizedBaseAddress>false</RandomizedBaseAddress>

+      <DataExecutionPrevention>

+      </DataExecutionPrevention>

+      <TargetMachine>MachineX64</TargetMachine>

+      <GenerateDebugInformation>true</GenerateDebugInformation>

+    </Link>

+  </ItemDefinitionGroup>

+  <ItemGroup>

+    <ClCompile Include="..\..\frontends\vsyasm\vsyasm.c" />

+    <ClCompile Include="..\..\frontends\yasm\yasm-options.c" />

+  </ItemGroup>

+  <ItemGroup>

+    <ProjectReference Include="libyasm\libyasm.vcxproj">

+      <Project>{29fe7874-1256-4ad6-b889-68e399dc9608}</Project>

+      <ReferenceOutputAssembly>false</ReferenceOutputAssembly>

+    </ProjectReference>

+    <ProjectReference Include="modules\modules.vcxproj">

+      <Project>{d715a3d4-efaa-442e-ad8b-5b4ff64e1dd6}</Project>

+      <ReferenceOutputAssembly>false</ReferenceOutputAssembly>

+    </ProjectReference>

+  </ItemGroup>

+  <ItemGroup>

+    <ClInclude Include="..\..\frontends\yasm\yasm-options.h" />

+    <ClInclude Include="..\..\frontends\yasm\yasm-plugin.h" />

+    <ClInclude Include="..\..\libyasm.h" />

+    <ClInclude Include="..\..\libyasm\bitvect.h" />

+    <ClInclude Include="..\..\libyasm\compat-queue.h" />

+    <ClInclude Include="..\..\util.h" />

+  </ItemGroup>

+  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />

+  <ImportGroup Label="ExtensionTargets">

+  </ImportGroup>

+</Project>
\ No newline at end of file
diff --git a/Mkfiles/vc10/vsyasm.xml b/Mkfiles/vc10/vsyasm.xml
new file mode 100644
index 0000000..860bce8
--- /dev/null
+++ b/Mkfiles/vc10/vsyasm.xml
@@ -0,0 +1,283 @@
+<?xml version="1.0" encoding="utf-8"?>

+<ProjectSchemaDefinitions xmlns="clr-namespace:Microsoft.Build.Framework.XamlTypes;assembly=Microsoft.Build.Framework" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:sys="clr-namespace:System;assembly=mscorlib" xmlns:transformCallback="Microsoft.Cpp.Dev10.ConvertPropertyCallback">

+  <Rule

+    Name="YASM"

+    PageTemplate="tool"

+    DisplayName="Yasm Assembler"

+    Order="200">

+      

+    <Rule.DataSource>

+      <DataSource

+        Persistence="ProjectFile"

+        ItemType="YASM" />

+    </Rule.DataSource>

+      

+    <Rule.Categories>

+        

+      <Category

+        Name="General">

+        <Category.DisplayName>

+          <sys:String>General</sys:String>

+        </Category.DisplayName>

+      </Category>

+

+      <Category

+        Name="Symbols">

+          <Category.DisplayName>

+              <sys:String>Symbols</sys:String>

+          </Category.DisplayName>

+      </Category>

+

+      <Category

+        Name="Files">

+          <Category.DisplayName>

+              <sys:String>Files</sys:String>

+          </Category.DisplayName>

+      </Category>

+        

+      <Category

+        Name="Command Line"

+        Subtype="CommandLine">

+        <Category.DisplayName>

+          <sys:String>Command Line</sys:String>

+        </Category.DisplayName>

+      </Category>

+        

+    </Rule.Categories>

+

+    <StringListProperty

+      Name="Inputs"

+      Category="Command Line"

+      IsRequired="true"

+      Switch=" ">

+      <StringListProperty.DataSource>

+        <DataSource

+          Persistence="ProjectFile"

+          ItemType="YASM"

+          SourceType="Item" />

+      </StringListProperty.DataSource>

+    </StringListProperty>

+    

+    <BoolProperty

+      Name="Debug"

+      Subcategory="Configuration"

+      HelpContext="0"

+      DisplayName="Debug Information"

+      Description="Generate debugging information"

+      Switch="-g cv8" />

+

+    <StringListProperty

+      Name="IncludePaths"

+      Subcategory="Configuration"

+      HelpContext="0"

+      DisplayName="Include Paths"

+      Description="Set the paths for any additional include files"

+      Switch="-i &quot;[value]&quot;" />

+

+    <StringListProperty

+      Name="Defines"

+      Category="Symbols"

+      Subcategory="Pre-Defined Symbols"

+      HelpContext="0"

+      DisplayName="Defined Symbols"

+      Description="Specify pre-defined symbols ('symbol' or 'symbol = value') "

+      Switch="-d &quot;[value]&quot;" />

+    

+    <StringListProperty

+      Name="UnDefines"

+      Category="Symbols"

+      Subcategory="Pre-Defined Symbols"

+      HelpContext="0"

+      DisplayName="Remove Symbols"

+      Description="Remove pre-defined symbols "

+      Switch="-u &quot;[value]&quot;" />

+    

+    <StringProperty

+      Name="ObjectFile"

+      Subcategory="Output"

+      HelpContext="0"

+      DisplayName="Object File Name"

+      Description="Select the output file name"

+      Switch="-o &quot;[value]&quot;" />

+    

+    <StringProperty

+      Name="ListFile"

+      Category="Files"

+      Subcategory="Output"

+      HelpContext="0"

+      DisplayName="List File Name"

+      Description="Select an output listing by setting its file name"

+      Switch="-l &quot;[value]&quot;" />

+    

+    <StringProperty

+      Name="PreIncludeFile"

+      Category="Files"

+      Subcategory="Configuration"

+      HelpContext="0"

+      DisplayName="Pre Include File"

+      Description="Select a pre-included file by setting its name"

+      Switch="-P &quot;[value]&quot;" />

+      

+    <StringProperty

+      Name="MapFile"

+      Category="Files"

+      Subcategory="Output"

+      HelpContext="0"

+      DisplayName="Map File Name"

+      Description="Select a map output by setting its file name"

+      Switch="--mapdir= &quot;[value]&quot;" />

+

+    <StringProperty

+      Name="ErrorFile"

+      Category="Files"

+      Subcategory="Output"

+      HelpContext="0"

+      DisplayName="Error File Name"

+      Description="Send error/warning messages to a file by setting its name"

+      Switch="-E &quot;[value]&quot;" />

+

+    <StringProperty

+      Name="SymbolPrefix"

+      Category="Symbols"

+      Subcategory="Symbols"

+      HelpContext="0"

+      DisplayName="External Symbol Prefix"

+      Description="Prepend symbol to all external symbols"

+      Switch="--prefix &quot;[value]&quot;" />

+

+    <StringProperty

+      Name="SymbolSuffix"

+      Category="Symbols"

+      Subcategory="Symbols"

+      HelpContext="0"

+      DisplayName="External Symbol Suffix"

+      Description="Append symbol to all external symbols"

+      Switch="--suffix &quot;[value]&quot;" />

+

+    <EnumProperty

+      Name="PreProc"

+      Subcategory="Configuration"

+      HelpContext="0"

+      DisplayName="Pre-Processor"

+      Description="Select the pre-processor ('nasm' or 'raw')">

+      <EnumValue

+        Name="0"

+        DisplayName="Nasm "

+        Switch="-rnasm" />

+      <EnumValue

+        Name="1"

+        DisplayName="Raw"

+        Switch="-rraw" />

+    </EnumProperty>

+    

+    <EnumProperty

+      Name="Parser"

+      Subcategory="Configuration"

+      HelpContext="0"

+      DisplayName="Parser"

+      Description="Select the parser for Intel ('nasm') or AT&amp;T ( 'gas') syntax">

+      <EnumValue

+        Name="0"

+        DisplayName="Nasm"

+        Switch="-pnasm" />

+      <EnumValue

+        Name="1"

+        DisplayName="Gas"

+        Switch="-pgas" />

+    </EnumProperty>

+    

+    <StringProperty

+      Name="CommandLineTemplate"

+      DisplayName="Command Line"

+      Visible="False"

+      IncludeInCommandLine="False" />

+    

+    <DynamicEnumProperty

+      Name="YASMBeforeTargets"

+      Category="General"

+      EnumProvider="Targets"

+      IncludeInCommandLine="False">

+      <DynamicEnumProperty.DisplayName>

+        <sys:String>Execute Before</sys:String>

+      </DynamicEnumProperty.DisplayName>

+      <DynamicEnumProperty.Description>

+        <sys:String>Specifies the targets for the build customization to run before.</sys:String>

+      </DynamicEnumProperty.Description>

+      <DynamicEnumProperty.ProviderSettings>

+        <NameValuePair

+          Name="Exclude"

+          Value="^YASMBeforeTargets|^Compute" />

+      </DynamicEnumProperty.ProviderSettings>

+      <DynamicEnumProperty.DataSource>

+        <DataSource

+          Persistence="ProjectFile"

+          HasConfigurationCondition="true" />

+      </DynamicEnumProperty.DataSource>

+    </DynamicEnumProperty>

+    

+    <DynamicEnumProperty

+      Name="YASMAfterTargets"

+      Category="General"

+      EnumProvider="Targets"

+      IncludeInCommandLine="False">

+      <DynamicEnumProperty.DisplayName>

+        <sys:String>Execute After</sys:String>

+      </DynamicEnumProperty.DisplayName>

+      <DynamicEnumProperty.Description>

+        <sys:String>Specifies the targets for the build customization to run after.</sys:String>

+      </DynamicEnumProperty.Description>

+      <DynamicEnumProperty.ProviderSettings>

+        <NameValuePair

+          Name="Exclude"

+          Value="^YASMAfterTargets|^Compute" />

+      </DynamicEnumProperty.ProviderSettings>

+      <DynamicEnumProperty.DataSource>

+        <DataSource

+          Persistence="ProjectFile"

+          ItemType=""

+          HasConfigurationCondition="true" />

+      </DynamicEnumProperty.DataSource>

+    </DynamicEnumProperty>

+    

+    <StringListProperty

+      Name="Outputs"

+      DisplayName="Outputs"

+      Visible="False"

+      IncludeInCommandLine="False" />

+    

+    <StringProperty

+      Name="ExecutionDescription"

+      DisplayName="Execution Description"

+      Visible="False"

+      IncludeInCommandLine="False" />

+    

+    <StringListProperty

+      Name="AdditionalDependencies"

+      DisplayName="Additional Dependencies"

+      IncludeInCommandLine="False"

+      Visible="true" />

+    

+    <StringProperty

+      Subtype="AdditionalOptions"

+      Name="AdditionalOptions"

+      Category="Command Line">

+      <StringProperty.DisplayName>

+        <sys:String>Additional Options</sys:String>

+      </StringProperty.DisplayName>

+      <StringProperty.Description>

+        <sys:String>Additional Options</sys:String>

+      </StringProperty.Description>

+    </StringProperty>

+  </Rule>

+  

+  <ItemType

+    Name="YASM"

+    DisplayName="Yasm Assembler" />

+  <FileExtension

+    Name="*.asm"

+    ContentType="YASM" />

+  <ContentType

+    Name="YASM"

+    DisplayName="Yasm Assembler"

+    ItemType="YASM" />

+</ProjectSchemaDefinitions>
\ No newline at end of file
diff --git a/Mkfiles/vc10/yasm.sln b/Mkfiles/vc10/yasm.sln
new file mode 100644
index 0000000..306c7b1
--- /dev/null
+++ b/Mkfiles/vc10/yasm.sln
@@ -0,0 +1,140 @@
+Microsoft Visual Studio Solution File, Format Version 11.00

+# Visual Studio 2010

+Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{825AC694-358C-4D8D-92DE-33A2691978CE}"

+	ProjectSection(SolutionItems) = preProject

+		crt_secure_no_deprecate.vsprops = crt_secure_no_deprecate.vsprops

+		readme.vc10.txt = readme.vc10.txt

+	EndProjectSection

+EndProject

+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libyasm", "libyasm\libyasm.vcxproj", "{29FE7874-1256-4AD6-B889-68E399DC9608}"

+	ProjectSection(ProjectDependencies) = postProject

+		{B545983B-8EE0-4A7B-A67A-E749EEAE62A2} = {B545983B-8EE0-4A7B-A67A-E749EEAE62A2}

+	EndProjectSection

+EndProject

+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "modules", "modules\modules.vcxproj", "{D715A3D4-EFAA-442E-AD8B-5B4FF64E1DD6}"

+EndProject

+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "yasm", "yasm.vcxproj", "{34EB1BEB-C2D6-4A52-82B7-7ACD714A30D5}"

+EndProject

+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "genmacro", "genmacro\genmacro.vcxproj", "{225700A5-07B8-434E-AD61-555278BF6733}"

+EndProject

+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "genversion", "genversion\genversion.vcxproj", "{B545983B-8EE0-4A7B-A67A-E749EEAE62A2}"

+EndProject

+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "re2c", "re2c\re2c.vcxproj", "{3C58BE13-50A3-4583-984D-D8902B3D7713}"

+EndProject

+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "genperf", "genperf\genperf.vcxproj", "{C45A8B59-8B59-4D5D-A8E8-FB090F8DD619}"

+EndProject

+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "genmodule", "genmodule\genmodule.vcxproj", "{F0E8B707-00C5-4FF2-B8EF-7C39817132A0}"

+EndProject

+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "genstring", "genstring\genstring.vcxproj", "{021CEB0A-F721-4F59-B349-9CEEAF244459}"

+EndProject

+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ytasm", "ytasm.vcxproj", "{2162937B-0DBD-4450-B45F-DF578D8E7508}"

+	ProjectSection(ProjectDependencies) = postProject

+		{021CEB0A-F721-4F59-B349-9CEEAF244459} = {021CEB0A-F721-4F59-B349-9CEEAF244459}

+	EndProjectSection

+EndProject

+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "vsyasm", "vsyasm.vcxproj", "{7FDD85BB-CC86-442B-A425-989B5B296ED5}"

+	ProjectSection(ProjectDependencies) = postProject

+		{021CEB0A-F721-4F59-B349-9CEEAF244459} = {021CEB0A-F721-4F59-B349-9CEEAF244459}

+	EndProjectSection

+EndProject

+Global

+	GlobalSection(SolutionConfigurationPlatforms) = preSolution

+		Debug|Win32 = Debug|Win32

+		Debug|x64 = Debug|x64

+		Release|Win32 = Release|Win32

+		Release|x64 = Release|x64

+	EndGlobalSection

+	GlobalSection(ProjectConfigurationPlatforms) = postSolution

+		{29FE7874-1256-4AD6-B889-68E399DC9608}.Debug|Win32.ActiveCfg = Debug|Win32

+		{29FE7874-1256-4AD6-B889-68E399DC9608}.Debug|Win32.Build.0 = Debug|Win32

+		{29FE7874-1256-4AD6-B889-68E399DC9608}.Debug|x64.ActiveCfg = Debug|x64

+		{29FE7874-1256-4AD6-B889-68E399DC9608}.Debug|x64.Build.0 = Debug|x64

+		{29FE7874-1256-4AD6-B889-68E399DC9608}.Release|Win32.ActiveCfg = Release|Win32

+		{29FE7874-1256-4AD6-B889-68E399DC9608}.Release|Win32.Build.0 = Release|Win32

+		{29FE7874-1256-4AD6-B889-68E399DC9608}.Release|x64.ActiveCfg = Release|x64

+		{29FE7874-1256-4AD6-B889-68E399DC9608}.Release|x64.Build.0 = Release|x64

+		{D715A3D4-EFAA-442E-AD8B-5B4FF64E1DD6}.Debug|Win32.ActiveCfg = Debug|Win32

+		{D715A3D4-EFAA-442E-AD8B-5B4FF64E1DD6}.Debug|Win32.Build.0 = Debug|Win32

+		{D715A3D4-EFAA-442E-AD8B-5B4FF64E1DD6}.Debug|x64.ActiveCfg = Debug|x64

+		{D715A3D4-EFAA-442E-AD8B-5B4FF64E1DD6}.Debug|x64.Build.0 = Debug|x64

+		{D715A3D4-EFAA-442E-AD8B-5B4FF64E1DD6}.Release|Win32.ActiveCfg = Release|Win32

+		{D715A3D4-EFAA-442E-AD8B-5B4FF64E1DD6}.Release|Win32.Build.0 = Release|Win32

+		{D715A3D4-EFAA-442E-AD8B-5B4FF64E1DD6}.Release|x64.ActiveCfg = Release|x64

+		{D715A3D4-EFAA-442E-AD8B-5B4FF64E1DD6}.Release|x64.Build.0 = Release|x64

+		{34EB1BEB-C2D6-4A52-82B7-7ACD714A30D5}.Debug|Win32.ActiveCfg = Debug|Win32

+		{34EB1BEB-C2D6-4A52-82B7-7ACD714A30D5}.Debug|Win32.Build.0 = Debug|Win32

+		{34EB1BEB-C2D6-4A52-82B7-7ACD714A30D5}.Debug|x64.ActiveCfg = Debug|x64

+		{34EB1BEB-C2D6-4A52-82B7-7ACD714A30D5}.Debug|x64.Build.0 = Debug|x64

+		{34EB1BEB-C2D6-4A52-82B7-7ACD714A30D5}.Release|Win32.ActiveCfg = Release|Win32

+		{34EB1BEB-C2D6-4A52-82B7-7ACD714A30D5}.Release|Win32.Build.0 = Release|Win32

+		{34EB1BEB-C2D6-4A52-82B7-7ACD714A30D5}.Release|x64.ActiveCfg = Release|x64

+		{34EB1BEB-C2D6-4A52-82B7-7ACD714A30D5}.Release|x64.Build.0 = Release|x64

+		{225700A5-07B8-434E-AD61-555278BF6733}.Debug|Win32.ActiveCfg = Debug|Win32

+		{225700A5-07B8-434E-AD61-555278BF6733}.Debug|Win32.Build.0 = Debug|Win32

+		{225700A5-07B8-434E-AD61-555278BF6733}.Debug|x64.ActiveCfg = Debug|Win32

+		{225700A5-07B8-434E-AD61-555278BF6733}.Debug|x64.Build.0 = Debug|Win32

+		{225700A5-07B8-434E-AD61-555278BF6733}.Release|Win32.ActiveCfg = Release|Win32

+		{225700A5-07B8-434E-AD61-555278BF6733}.Release|Win32.Build.0 = Release|Win32

+		{225700A5-07B8-434E-AD61-555278BF6733}.Release|x64.ActiveCfg = Release|Win32

+		{225700A5-07B8-434E-AD61-555278BF6733}.Release|x64.Build.0 = Release|Win32

+		{B545983B-8EE0-4A7B-A67A-E749EEAE62A2}.Debug|Win32.ActiveCfg = Debug|Win32

+		{B545983B-8EE0-4A7B-A67A-E749EEAE62A2}.Debug|Win32.Build.0 = Debug|Win32

+		{B545983B-8EE0-4A7B-A67A-E749EEAE62A2}.Debug|x64.ActiveCfg = Debug|Win32

+		{B545983B-8EE0-4A7B-A67A-E749EEAE62A2}.Debug|x64.Build.0 = Debug|Win32

+		{B545983B-8EE0-4A7B-A67A-E749EEAE62A2}.Release|Win32.ActiveCfg = Release|Win32

+		{B545983B-8EE0-4A7B-A67A-E749EEAE62A2}.Release|Win32.Build.0 = Release|Win32

+		{B545983B-8EE0-4A7B-A67A-E749EEAE62A2}.Release|x64.ActiveCfg = Release|Win32

+		{B545983B-8EE0-4A7B-A67A-E749EEAE62A2}.Release|x64.Build.0 = Release|Win32

+		{3C58BE13-50A3-4583-984D-D8902B3D7713}.Debug|Win32.ActiveCfg = Debug|Win32

+		{3C58BE13-50A3-4583-984D-D8902B3D7713}.Debug|Win32.Build.0 = Debug|Win32

+		{3C58BE13-50A3-4583-984D-D8902B3D7713}.Debug|x64.ActiveCfg = Debug|Win32

+		{3C58BE13-50A3-4583-984D-D8902B3D7713}.Debug|x64.Build.0 = Debug|Win32

+		{3C58BE13-50A3-4583-984D-D8902B3D7713}.Release|Win32.ActiveCfg = Release|Win32

+		{3C58BE13-50A3-4583-984D-D8902B3D7713}.Release|Win32.Build.0 = Release|Win32

+		{3C58BE13-50A3-4583-984D-D8902B3D7713}.Release|x64.ActiveCfg = Release|Win32

+		{3C58BE13-50A3-4583-984D-D8902B3D7713}.Release|x64.Build.0 = Release|Win32

+		{C45A8B59-8B59-4D5D-A8E8-FB090F8DD619}.Debug|Win32.ActiveCfg = Debug|Win32

+		{C45A8B59-8B59-4D5D-A8E8-FB090F8DD619}.Debug|Win32.Build.0 = Debug|Win32

+		{C45A8B59-8B59-4D5D-A8E8-FB090F8DD619}.Debug|x64.ActiveCfg = Debug|Win32

+		{C45A8B59-8B59-4D5D-A8E8-FB090F8DD619}.Debug|x64.Build.0 = Debug|Win32

+		{C45A8B59-8B59-4D5D-A8E8-FB090F8DD619}.Release|Win32.ActiveCfg = Release|Win32

+		{C45A8B59-8B59-4D5D-A8E8-FB090F8DD619}.Release|Win32.Build.0 = Release|Win32

+		{C45A8B59-8B59-4D5D-A8E8-FB090F8DD619}.Release|x64.ActiveCfg = Release|Win32

+		{C45A8B59-8B59-4D5D-A8E8-FB090F8DD619}.Release|x64.Build.0 = Release|Win32

+		{F0E8B707-00C5-4FF2-B8EF-7C39817132A0}.Debug|Win32.ActiveCfg = Debug|Win32

+		{F0E8B707-00C5-4FF2-B8EF-7C39817132A0}.Debug|Win32.Build.0 = Debug|Win32

+		{F0E8B707-00C5-4FF2-B8EF-7C39817132A0}.Debug|x64.ActiveCfg = Debug|Win32

+		{F0E8B707-00C5-4FF2-B8EF-7C39817132A0}.Debug|x64.Build.0 = Debug|Win32

+		{F0E8B707-00C5-4FF2-B8EF-7C39817132A0}.Release|Win32.ActiveCfg = Release|Win32

+		{F0E8B707-00C5-4FF2-B8EF-7C39817132A0}.Release|Win32.Build.0 = Release|Win32

+		{F0E8B707-00C5-4FF2-B8EF-7C39817132A0}.Release|x64.ActiveCfg = Release|Win32

+		{F0E8B707-00C5-4FF2-B8EF-7C39817132A0}.Release|x64.Build.0 = Release|Win32

+		{021CEB0A-F721-4F59-B349-9CEEAF244459}.Debug|Win32.ActiveCfg = Debug|Win32

+		{021CEB0A-F721-4F59-B349-9CEEAF244459}.Debug|Win32.Build.0 = Debug|Win32

+		{021CEB0A-F721-4F59-B349-9CEEAF244459}.Debug|x64.ActiveCfg = Debug|Win32

+		{021CEB0A-F721-4F59-B349-9CEEAF244459}.Debug|x64.Build.0 = Debug|Win32

+		{021CEB0A-F721-4F59-B349-9CEEAF244459}.Release|Win32.ActiveCfg = Release|Win32

+		{021CEB0A-F721-4F59-B349-9CEEAF244459}.Release|Win32.Build.0 = Release|Win32

+		{021CEB0A-F721-4F59-B349-9CEEAF244459}.Release|x64.ActiveCfg = Release|Win32

+		{021CEB0A-F721-4F59-B349-9CEEAF244459}.Release|x64.Build.0 = Release|Win32

+		{2162937B-0DBD-4450-B45F-DF578D8E7508}.Debug|Win32.ActiveCfg = Debug|Win32

+		{2162937B-0DBD-4450-B45F-DF578D8E7508}.Debug|Win32.Build.0 = Debug|Win32

+		{2162937B-0DBD-4450-B45F-DF578D8E7508}.Debug|x64.ActiveCfg = Debug|x64

+		{2162937B-0DBD-4450-B45F-DF578D8E7508}.Debug|x64.Build.0 = Debug|x64

+		{2162937B-0DBD-4450-B45F-DF578D8E7508}.Release|Win32.ActiveCfg = Release|Win32

+		{2162937B-0DBD-4450-B45F-DF578D8E7508}.Release|Win32.Build.0 = Release|Win32

+		{2162937B-0DBD-4450-B45F-DF578D8E7508}.Release|x64.ActiveCfg = Release|x64

+		{2162937B-0DBD-4450-B45F-DF578D8E7508}.Release|x64.Build.0 = Release|x64

+		{7FDD85BB-CC86-442B-A425-989B5B296ED5}.Debug|Win32.ActiveCfg = Debug|Win32

+		{7FDD85BB-CC86-442B-A425-989B5B296ED5}.Debug|Win32.Build.0 = Debug|Win32

+		{7FDD85BB-CC86-442B-A425-989B5B296ED5}.Debug|x64.ActiveCfg = Debug|x64

+		{7FDD85BB-CC86-442B-A425-989B5B296ED5}.Debug|x64.Build.0 = Debug|x64

+		{7FDD85BB-CC86-442B-A425-989B5B296ED5}.Release|Win32.ActiveCfg = Release|Win32

+		{7FDD85BB-CC86-442B-A425-989B5B296ED5}.Release|Win32.Build.0 = Release|Win32

+		{7FDD85BB-CC86-442B-A425-989B5B296ED5}.Release|x64.ActiveCfg = Release|x64

+		{7FDD85BB-CC86-442B-A425-989B5B296ED5}.Release|x64.Build.0 = Release|x64

+	EndGlobalSection

+	GlobalSection(SolutionProperties) = preSolution

+		HideSolutionNode = FALSE

+	EndGlobalSection

+EndGlobal

diff --git a/Mkfiles/vc10/yasm.vcxproj b/Mkfiles/vc10/yasm.vcxproj
new file mode 100644
index 0000000..9379d70
--- /dev/null
+++ b/Mkfiles/vc10/yasm.vcxproj
@@ -0,0 +1,279 @@
+<?xml version="1.0" encoding="utf-8"?>

+<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">

+  <ItemGroup Label="ProjectConfigurations">

+    <ProjectConfiguration Include="Debug|Win32">

+      <Configuration>Debug</Configuration>

+      <Platform>Win32</Platform>

+    </ProjectConfiguration>

+    <ProjectConfiguration Include="Debug|x64">

+      <Configuration>Debug</Configuration>

+      <Platform>x64</Platform>

+    </ProjectConfiguration>

+    <ProjectConfiguration Include="Release|Win32">

+      <Configuration>Release</Configuration>

+      <Platform>Win32</Platform>

+    </ProjectConfiguration>

+    <ProjectConfiguration Include="Release|x64">

+      <Configuration>Release</Configuration>

+      <Platform>x64</Platform>

+    </ProjectConfiguration>

+  </ItemGroup>

+  <PropertyGroup Label="Globals">

+    <ProjectGuid>{34EB1BEB-C2D6-4A52-82B7-7ACD714A30D5}</ProjectGuid>

+    <RootNamespace>yasm</RootNamespace>

+  </PropertyGroup>

+  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />

+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">

+    <ConfigurationType>Application</ConfigurationType>

+    <UseOfMfc>false</UseOfMfc>

+    <CharacterSet>MultiByte</CharacterSet>

+  </PropertyGroup>

+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">

+    <ConfigurationType>Application</ConfigurationType>

+    <UseOfMfc>false</UseOfMfc>

+    <CharacterSet>MultiByte</CharacterSet>

+  </PropertyGroup>

+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">

+    <ConfigurationType>Application</ConfigurationType>

+    <UseOfMfc>false</UseOfMfc>

+    <CharacterSet>MultiByte</CharacterSet>

+  </PropertyGroup>

+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">

+    <ConfigurationType>Application</ConfigurationType>

+    <UseOfMfc>false</UseOfMfc>

+    <CharacterSet>MultiByte</CharacterSet>

+  </PropertyGroup>

+  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />

+  <ImportGroup Label="ExtensionSettings">

+  </ImportGroup>

+  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets">

+    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" />

+    <Import Project="crt_secure_no_deprecate.props" />

+  </ImportGroup>

+  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets">

+    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" />

+    <Import Project="crt_secure_no_deprecate.props" />

+  </ImportGroup>

+  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets">

+    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" />

+    <Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC71.props" />

+    <Import Project="crt_secure_no_deprecate.props" />

+  </ImportGroup>

+  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets">

+    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" />

+    <Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC71.props" />

+    <Import Project="crt_secure_no_deprecate.props" />

+  </ImportGroup>

+  <PropertyGroup Label="UserMacros" />

+  <PropertyGroup>

+    <_ProjectFileVersion>10.0.21006.1</_ProjectFileVersion>

+    <OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(Platform)\$(Configuration)\</OutDir>

+    <IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(Platform)\$(Configuration)\</IntDir>

+    <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">false</LinkIncremental>

+    <OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(Platform)\$(Configuration)\</OutDir>

+    <IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(Platform)\$(Configuration)\</IntDir>

+    <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">false</LinkIncremental>

+    <OutDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(Platform)\$(Configuration)\</OutDir>

+    <IntDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(Platform)\$(Configuration)\</IntDir>

+    <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">false</LinkIncremental>

+    <OutDir Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(Platform)\$(Configuration)\</OutDir>

+    <IntDir Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(Platform)\$(Configuration)\</IntDir>

+    <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|x64'">false</LinkIncremental>

+  </PropertyGroup>

+  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">

+    <Midl>

+      <TypeLibraryName>$(Platform)\$(Configuration)/yasm.tlb</TypeLibraryName>

+      <HeaderFileName>

+      </HeaderFileName>

+    </Midl>

+    <ClCompile>

+      <Optimization>Disabled</Optimization>

+      <AdditionalIncludeDirectories>.;../..;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>

+      <PreprocessorDefinitions>_DEBUG;WIN32;_LIB;HAVE_CONFIG_H;VC;%(PreprocessorDefinitions)</PreprocessorDefinitions>

+      <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>

+      <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>

+      <PrecompiledHeader>

+      </PrecompiledHeader>

+      <PrecompiledHeaderOutputFile>

+      </PrecompiledHeaderOutputFile>

+      <AssemblerListingLocation>$(IntDir)</AssemblerListingLocation>

+      <ObjectFileName>$(IntDir)</ObjectFileName>

+      <ProgramDataBaseFileName>$(IntDir)</ProgramDataBaseFileName>

+      <WarningLevel>Level3</WarningLevel>

+      <SuppressStartupBanner>true</SuppressStartupBanner>

+      <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>

+      <CompileAs>Default</CompileAs>

+    </ClCompile>

+    <ResourceCompile>

+      <PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>

+      <Culture>0x0409</Culture>

+    </ResourceCompile>

+    <Link>

+      <OutputFile>$(OutDir)yasm.exe</OutputFile>

+      <SuppressStartupBanner>true</SuppressStartupBanner>

+      <GenerateDebugInformation>true</GenerateDebugInformation>

+      <ProgramDatabaseFile>$(OutDir)$(ProjectName).pdb</ProgramDatabaseFile>

+      <SubSystem>Console</SubSystem>

+      <RandomizedBaseAddress>false</RandomizedBaseAddress>

+      <DataExecutionPrevention>

+      </DataExecutionPrevention>

+      <TargetMachine>MachineX86</TargetMachine>

+    </Link>

+  </ItemDefinitionGroup>

+  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">

+    <Midl>

+      <TargetEnvironment>X64</TargetEnvironment>

+      <TypeLibraryName>$(Platform)\$(Configuration)/yasm.tlb</TypeLibraryName>

+      <HeaderFileName>

+      </HeaderFileName>

+    </Midl>

+    <ClCompile>

+      <Optimization>Disabled</Optimization>

+      <AdditionalIncludeDirectories>.;../..;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>

+      <PreprocessorDefinitions>_DEBUG;_LIB;HAVE_CONFIG_H;VC;WIN64;%(PreprocessorDefinitions)</PreprocessorDefinitions>

+      <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>

+      <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>

+      <PrecompiledHeader>

+      </PrecompiledHeader>

+      <PrecompiledHeaderOutputFile>

+      </PrecompiledHeaderOutputFile>

+      <AssemblerListingLocation>$(IntDir)</AssemblerListingLocation>

+      <ObjectFileName>$(IntDir)</ObjectFileName>

+      <ProgramDataBaseFileName>$(IntDir)</ProgramDataBaseFileName>

+      <WarningLevel>Level3</WarningLevel>

+      <SuppressStartupBanner>true</SuppressStartupBanner>

+      <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>

+      <CompileAs>Default</CompileAs>

+    </ClCompile>

+    <ResourceCompile>

+      <PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>

+      <Culture>0x0409</Culture>

+    </ResourceCompile>

+    <Link>

+      <OutputFile>$(OutDir)yasm.exe</OutputFile>

+      <SuppressStartupBanner>true</SuppressStartupBanner>

+      <GenerateDebugInformation>true</GenerateDebugInformation>

+      <ProgramDatabaseFile>$(OutDir)$(TargetName).pdb</ProgramDatabaseFile>

+      <SubSystem>Console</SubSystem>

+      <RandomizedBaseAddress>false</RandomizedBaseAddress>

+      <DataExecutionPrevention>

+      </DataExecutionPrevention>

+      <TargetMachine>MachineX64</TargetMachine>

+    </Link>

+  </ItemDefinitionGroup>

+  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">

+    <Midl>

+      <TypeLibraryName>$(Platform)\$(Configuration)/yasm.tlb</TypeLibraryName>

+      <HeaderFileName>

+      </HeaderFileName>

+    </Midl>

+    <ClCompile>

+      <Optimization>Full</Optimization>

+      <InlineFunctionExpansion>Default</InlineFunctionExpansion>

+      <IntrinsicFunctions>true</IntrinsicFunctions>

+      <AdditionalIncludeDirectories>.;../..;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>

+      <PreprocessorDefinitions>NDEBUG;WIN32;_LIB;HAVE_CONFIG_H;VC;%(PreprocessorDefinitions)</PreprocessorDefinitions>

+      <StringPooling>true</StringPooling>

+      <RuntimeLibrary>MultiThreaded</RuntimeLibrary>

+      <FunctionLevelLinking>true</FunctionLevelLinking>

+      <PrecompiledHeader>

+      </PrecompiledHeader>

+      <PrecompiledHeaderOutputFile>

+      </PrecompiledHeaderOutputFile>

+      <AssemblerListingLocation>$(IntDir)</AssemblerListingLocation>

+      <ObjectFileName>$(IntDir)</ObjectFileName>

+      <ProgramDataBaseFileName>$(IntDir)</ProgramDataBaseFileName>

+      <WarningLevel>Level3</WarningLevel>

+      <SuppressStartupBanner>true</SuppressStartupBanner>

+      <CompileAs>Default</CompileAs>

+      <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>

+    </ClCompile>

+    <ResourceCompile>

+      <PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>

+      <Culture>0x0409</Culture>

+    </ResourceCompile>

+    <Link>

+      <OutputFile>$(OutDir)yasm.exe</OutputFile>

+      <SuppressStartupBanner>true</SuppressStartupBanner>

+      <GenerateDebugInformation>true</GenerateDebugInformation>

+      <ProgramDatabaseFile>$(OutDir)$(ProjectName).pdb</ProgramDatabaseFile>

+      <SubSystem>Console</SubSystem>

+      <RandomizedBaseAddress>false</RandomizedBaseAddress>

+      <DataExecutionPrevention>

+      </DataExecutionPrevention>

+      <TargetMachine>MachineX86</TargetMachine>

+    </Link>

+  </ItemDefinitionGroup>

+  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">

+    <Midl>

+      <TargetEnvironment>X64</TargetEnvironment>

+      <TypeLibraryName>$(Platform)\$(Configuration)/yasm.tlb</TypeLibraryName>

+      <HeaderFileName>

+      </HeaderFileName>

+    </Midl>

+    <ClCompile>

+      <Optimization>Full</Optimization>

+      <InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>

+      <AdditionalIncludeDirectories>.;../..;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>

+      <PreprocessorDefinitions>NDEBUG;_LIB;HAVE_CONFIG_H;VC;WIN64;%(PreprocessorDefinitions)</PreprocessorDefinitions>

+      <StringPooling>true</StringPooling>

+      <RuntimeLibrary>MultiThreaded</RuntimeLibrary>

+      <FunctionLevelLinking>true</FunctionLevelLinking>

+      <PrecompiledHeader>

+      </PrecompiledHeader>

+      <PrecompiledHeaderOutputFile>

+      </PrecompiledHeaderOutputFile>

+      <AssemblerListingLocation>$(IntDir)</AssemblerListingLocation>

+      <ObjectFileName>$(IntDir)</ObjectFileName>

+      <ProgramDataBaseFileName>$(IntDir)</ProgramDataBaseFileName>

+      <WarningLevel>Level3</WarningLevel>

+      <SuppressStartupBanner>true</SuppressStartupBanner>

+      <CompileAs>Default</CompileAs>

+      <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>

+    </ClCompile>

+    <ResourceCompile>

+      <PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>

+      <Culture>0x0409</Culture>

+    </ResourceCompile>

+    <Link>

+      <OutputFile>$(OutDir)yasm.exe</OutputFile>

+      <SuppressStartupBanner>true</SuppressStartupBanner>

+      <ProgramDatabaseFile>$(OutDir)$(TargetName).pdb</ProgramDatabaseFile>

+      <SubSystem>Console</SubSystem>

+      <RandomizedBaseAddress>false</RandomizedBaseAddress>

+      <DataExecutionPrevention>

+      </DataExecutionPrevention>

+      <TargetMachine>MachineX64</TargetMachine>

+      <GenerateDebugInformation>true</GenerateDebugInformation>

+    </Link>

+  </ItemDefinitionGroup>

+  <ItemGroup>

+    <ClCompile Include="..\..\frontends\yasm\yasm-options.c" />

+    <ClCompile Include="..\..\frontends\yasm\yasm.c" />

+  </ItemGroup>

+  <ItemGroup>

+    <ClInclude Include="..\..\frontends\yasm\yasm-options.h" />

+    <ClInclude Include="..\..\frontends\yasm\yasm-plugin.h" />

+    <ClInclude Include="..\..\libyasm.h" />

+    <ClInclude Include="..\..\libyasm\bitvect.h" />

+    <ClInclude Include="..\..\libyasm\compat-queue.h" />

+    <ClInclude Include="..\..\util.h" />

+  </ItemGroup>

+  <ItemGroup>

+    <ProjectReference Include="genstring\genstring.vcxproj">

+      <Project>{021ceb0a-f721-4f59-b349-9ceeaf244459}</Project>

+      <ReferenceOutputAssembly>false</ReferenceOutputAssembly>

+    </ProjectReference>

+    <ProjectReference Include="libyasm\libyasm.vcxproj">

+      <Project>{29fe7874-1256-4ad6-b889-68e399dc9608}</Project>

+      <ReferenceOutputAssembly>false</ReferenceOutputAssembly>

+    </ProjectReference>

+    <ProjectReference Include="modules\modules.vcxproj">

+      <Project>{d715a3d4-efaa-442e-ad8b-5b4ff64e1dd6}</Project>

+      <ReferenceOutputAssembly>false</ReferenceOutputAssembly>

+    </ProjectReference>

+  </ItemGroup>

+  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />

+  <ImportGroup Label="ExtensionTargets">

+  </ImportGroup>

+</Project>
\ No newline at end of file
diff --git a/Mkfiles/vc10/yasm.vcxproj.filters b/Mkfiles/vc10/yasm.vcxproj.filters
new file mode 100644
index 0000000..df5419b
--- /dev/null
+++ b/Mkfiles/vc10/yasm.vcxproj.filters
@@ -0,0 +1,41 @@
+<?xml version="1.0" encoding="utf-8"?>

+<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">

+  <ItemGroup>

+    <Filter Include="Header Files">

+      <UniqueIdentifier>{51f0d88e-1373-4bf8-a72e-c79706d37f8b}</UniqueIdentifier>

+      <Extensions>h;hpp;hxx;hm;inl</Extensions>

+    </Filter>

+    <Filter Include="Source Files">

+      <UniqueIdentifier>{db67b411-6f59-462c-9c20-75024c6b3912}</UniqueIdentifier>

+      <Extensions>cpp;c;cxx;rc;def;r;odl;idl;hpj;bat</Extensions>

+    </Filter>

+  </ItemGroup>

+  <ItemGroup>

+    <ClCompile Include="..\..\frontends\yasm\yasm-options.c">

+      <Filter>Source Files</Filter>

+    </ClCompile>

+    <ClCompile Include="..\..\frontends\yasm\yasm.c">

+      <Filter>Source Files</Filter>

+    </ClCompile>

+  </ItemGroup>

+  <ItemGroup>

+    <ClInclude Include="..\..\frontends\yasm\yasm-options.h">

+      <Filter>Header Files</Filter>

+    </ClInclude>

+    <ClInclude Include="..\..\libyasm\compat-queue.h">

+      <Filter>Header Files</Filter>

+    </ClInclude>

+    <ClInclude Include="..\..\libyasm.h">

+      <Filter>Header Files</Filter>

+    </ClInclude>

+    <ClInclude Include="..\..\libyasm\bitvect.h">

+      <Filter>Header Files</Filter>

+    </ClInclude>

+    <ClInclude Include="..\..\util.h">

+      <Filter>Header Files</Filter>

+    </ClInclude>

+    <ClInclude Include="..\..\frontends\yasm\yasm-plugin.h">

+      <Filter>Header Files</Filter>

+    </ClInclude>

+  </ItemGroup>

+</Project>
\ No newline at end of file
diff --git a/Mkfiles/vc10/ytasm.vcxproj b/Mkfiles/vc10/ytasm.vcxproj
new file mode 100644
index 0000000..d45cdf4
--- /dev/null
+++ b/Mkfiles/vc10/ytasm.vcxproj
@@ -0,0 +1,274 @@
+<?xml version="1.0" encoding="utf-8"?>

+<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">

+  <ItemGroup Label="ProjectConfigurations">

+    <ProjectConfiguration Include="Debug|Win32">

+      <Configuration>Debug</Configuration>

+      <Platform>Win32</Platform>

+    </ProjectConfiguration>

+    <ProjectConfiguration Include="Debug|x64">

+      <Configuration>Debug</Configuration>

+      <Platform>x64</Platform>

+    </ProjectConfiguration>

+    <ProjectConfiguration Include="Release|Win32">

+      <Configuration>Release</Configuration>

+      <Platform>Win32</Platform>

+    </ProjectConfiguration>

+    <ProjectConfiguration Include="Release|x64">

+      <Configuration>Release</Configuration>

+      <Platform>x64</Platform>

+    </ProjectConfiguration>

+  </ItemGroup>

+  <PropertyGroup Label="Globals">

+    <ProjectGuid>{2162937B-0DBD-4450-B45F-DF578D8E7508}</ProjectGuid>

+    <RootNamespace>ytasm</RootNamespace>

+  </PropertyGroup>

+  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />

+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">

+    <ConfigurationType>Application</ConfigurationType>

+    <UseOfMfc>false</UseOfMfc>

+    <CharacterSet>MultiByte</CharacterSet>

+  </PropertyGroup>

+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">

+    <ConfigurationType>Application</ConfigurationType>

+    <UseOfMfc>false</UseOfMfc>

+    <CharacterSet>MultiByte</CharacterSet>

+  </PropertyGroup>

+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">

+    <ConfigurationType>Application</ConfigurationType>

+    <UseOfMfc>false</UseOfMfc>

+    <CharacterSet>MultiByte</CharacterSet>

+  </PropertyGroup>

+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">

+    <ConfigurationType>Application</ConfigurationType>

+    <UseOfMfc>false</UseOfMfc>

+    <CharacterSet>MultiByte</CharacterSet>

+  </PropertyGroup>

+  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />

+  <ImportGroup Label="ExtensionSettings">

+  </ImportGroup>

+  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets">

+    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" />

+    <Import Project="crt_secure_no_deprecate.props" />

+  </ImportGroup>

+  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets">

+    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" />

+    <Import Project="crt_secure_no_deprecate.props" />

+  </ImportGroup>

+  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets">

+    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" />

+    <Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC71.props" />

+    <Import Project="crt_secure_no_deprecate.props" />

+  </ImportGroup>

+  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets">

+    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" />

+    <Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC71.props" />

+    <Import Project="crt_secure_no_deprecate.props" />

+  </ImportGroup>

+  <PropertyGroup Label="UserMacros" />

+  <PropertyGroup>

+    <_ProjectFileVersion>10.0.21006.1</_ProjectFileVersion>

+    <OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(Platform)\$(Configuration)\</OutDir>

+    <IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(Platform)\$(Configuration)\</IntDir>

+    <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">false</LinkIncremental>

+    <OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(Platform)\$(Configuration)\</OutDir>

+    <IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(Platform)\$(Configuration)\</IntDir>

+    <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">false</LinkIncremental>

+    <OutDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(Platform)\$(Configuration)\</OutDir>

+    <IntDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(Platform)\$(Configuration)\</IntDir>

+    <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">false</LinkIncremental>

+    <OutDir Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(Platform)\$(Configuration)\</OutDir>

+    <IntDir Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(Platform)\$(Configuration)\</IntDir>

+    <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|x64'">false</LinkIncremental>

+  </PropertyGroup>

+  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">

+    <Midl>

+      <TypeLibraryName>$(Platform)\$(Configuration)/yasm.tlb</TypeLibraryName>

+      <HeaderFileName>

+      </HeaderFileName>

+    </Midl>

+    <ClCompile>

+      <Optimization>Disabled</Optimization>

+      <AdditionalIncludeDirectories>.;../..;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>

+      <PreprocessorDefinitions>_DEBUG;WIN32;_LIB;HAVE_CONFIG_H;VC;%(PreprocessorDefinitions)</PreprocessorDefinitions>

+      <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>

+      <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>

+      <PrecompiledHeader>

+      </PrecompiledHeader>

+      <PrecompiledHeaderOutputFile>

+      </PrecompiledHeaderOutputFile>

+      <AssemblerListingLocation>$(IntDir)</AssemblerListingLocation>

+      <ObjectFileName>$(IntDir)</ObjectFileName>

+      <ProgramDataBaseFileName>$(IntDir)</ProgramDataBaseFileName>

+      <WarningLevel>Level3</WarningLevel>

+      <SuppressStartupBanner>true</SuppressStartupBanner>

+      <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>

+      <CompileAs>Default</CompileAs>

+    </ClCompile>

+    <ResourceCompile>

+      <PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>

+      <Culture>0x0409</Culture>

+    </ResourceCompile>

+    <Link>

+      <OutputFile>$(OutDir)ytasm.exe</OutputFile>

+      <SuppressStartupBanner>true</SuppressStartupBanner>

+      <GenerateDebugInformation>true</GenerateDebugInformation>

+      <ProgramDatabaseFile>$(OutDir)$(ProjectName).pdb</ProgramDatabaseFile>

+      <SubSystem>Console</SubSystem>

+      <RandomizedBaseAddress>false</RandomizedBaseAddress>

+      <DataExecutionPrevention>

+      </DataExecutionPrevention>

+      <TargetMachine>MachineX86</TargetMachine>

+    </Link>

+  </ItemDefinitionGroup>

+  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">

+    <Midl>

+      <TargetEnvironment>X64</TargetEnvironment>

+      <TypeLibraryName>$(Platform)\$(Configuration)/yasm.tlb</TypeLibraryName>

+      <HeaderFileName>

+      </HeaderFileName>

+    </Midl>

+    <ClCompile>

+      <Optimization>Disabled</Optimization>

+      <AdditionalIncludeDirectories>.;../..;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>

+      <PreprocessorDefinitions>_DEBUG;_LIB;HAVE_CONFIG_H;VC;WIN64;%(PreprocessorDefinitions)</PreprocessorDefinitions>

+      <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>

+      <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>

+      <PrecompiledHeader>

+      </PrecompiledHeader>

+      <PrecompiledHeaderOutputFile>

+      </PrecompiledHeaderOutputFile>

+      <AssemblerListingLocation>$(IntDir)</AssemblerListingLocation>

+      <ObjectFileName>$(IntDir)</ObjectFileName>

+      <ProgramDataBaseFileName>$(IntDir)</ProgramDataBaseFileName>

+      <WarningLevel>Level3</WarningLevel>

+      <SuppressStartupBanner>true</SuppressStartupBanner>

+      <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>

+      <CompileAs>Default</CompileAs>

+    </ClCompile>

+    <ResourceCompile>

+      <PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>

+      <Culture>0x0409</Culture>

+    </ResourceCompile>

+    <Link>

+      <OutputFile>$(OutDir)ytasm.exe</OutputFile>

+      <SuppressStartupBanner>true</SuppressStartupBanner>

+      <GenerateDebugInformation>true</GenerateDebugInformation>

+      <ProgramDatabaseFile>$(OutDir)$(TargetName).pdb</ProgramDatabaseFile>

+      <SubSystem>Console</SubSystem>

+      <RandomizedBaseAddress>false</RandomizedBaseAddress>

+      <DataExecutionPrevention>

+      </DataExecutionPrevention>

+      <TargetMachine>MachineX64</TargetMachine>

+    </Link>

+  </ItemDefinitionGroup>

+  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">

+    <Midl>

+      <TypeLibraryName>$(Platform)\$(Configuration)/yasm.tlb</TypeLibraryName>

+      <HeaderFileName>

+      </HeaderFileName>

+    </Midl>

+    <ClCompile>

+      <Optimization>Full</Optimization>

+      <InlineFunctionExpansion>Default</InlineFunctionExpansion>

+      <IntrinsicFunctions>true</IntrinsicFunctions>

+      <AdditionalIncludeDirectories>.;../..;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>

+      <PreprocessorDefinitions>NDEBUG;WIN32;_LIB;HAVE_CONFIG_H;VC;%(PreprocessorDefinitions)</PreprocessorDefinitions>

+      <StringPooling>true</StringPooling>

+      <RuntimeLibrary>MultiThreaded</RuntimeLibrary>

+      <FunctionLevelLinking>true</FunctionLevelLinking>

+      <PrecompiledHeader>

+      </PrecompiledHeader>

+      <PrecompiledHeaderOutputFile>

+      </PrecompiledHeaderOutputFile>

+      <AssemblerListingLocation>$(IntDir)</AssemblerListingLocation>

+      <ObjectFileName>$(IntDir)</ObjectFileName>

+      <ProgramDataBaseFileName>$(IntDir)</ProgramDataBaseFileName>

+      <WarningLevel>Level3</WarningLevel>

+      <SuppressStartupBanner>true</SuppressStartupBanner>

+      <CompileAs>Default</CompileAs>

+      <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>

+    </ClCompile>

+    <ResourceCompile>

+      <PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>

+      <Culture>0x0409</Culture>

+    </ResourceCompile>

+    <Link>

+      <OutputFile>$(OutDir)ytasm.exe</OutputFile>

+      <SuppressStartupBanner>true</SuppressStartupBanner>

+      <GenerateDebugInformation>true</GenerateDebugInformation>

+      <ProgramDatabaseFile>$(OutDir)$(ProjectName).pdb</ProgramDatabaseFile>

+      <SubSystem>Console</SubSystem>

+      <RandomizedBaseAddress>false</RandomizedBaseAddress>

+      <DataExecutionPrevention>

+      </DataExecutionPrevention>

+      <TargetMachine>MachineX86</TargetMachine>

+    </Link>

+  </ItemDefinitionGroup>

+  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">

+    <Midl>

+      <TargetEnvironment>X64</TargetEnvironment>

+      <TypeLibraryName>$(Platform)\$(Configuration)/yasm.tlb</TypeLibraryName>

+      <HeaderFileName>

+      </HeaderFileName>

+    </Midl>

+    <ClCompile>

+      <Optimization>Full</Optimization>

+      <InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>

+      <AdditionalIncludeDirectories>.;../..;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>

+      <PreprocessorDefinitions>NDEBUG;_LIB;HAVE_CONFIG_H;VC;WIN64;%(PreprocessorDefinitions)</PreprocessorDefinitions>

+      <StringPooling>true</StringPooling>

+      <RuntimeLibrary>MultiThreaded</RuntimeLibrary>

+      <FunctionLevelLinking>true</FunctionLevelLinking>

+      <PrecompiledHeader>

+      </PrecompiledHeader>

+      <PrecompiledHeaderOutputFile>

+      </PrecompiledHeaderOutputFile>

+      <AssemblerListingLocation>$(IntDir)</AssemblerListingLocation>

+      <ObjectFileName>$(IntDir)</ObjectFileName>

+      <ProgramDataBaseFileName>$(IntDir)</ProgramDataBaseFileName>

+      <WarningLevel>Level3</WarningLevel>

+      <SuppressStartupBanner>true</SuppressStartupBanner>

+      <CompileAs>Default</CompileAs>

+      <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>

+    </ClCompile>

+    <ResourceCompile>

+      <PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>

+      <Culture>0x0409</Culture>

+    </ResourceCompile>

+    <Link>

+      <OutputFile>$(OutDir)ytasm.exe</OutputFile>

+      <SuppressStartupBanner>true</SuppressStartupBanner>

+      <ProgramDatabaseFile>$(OutDir)$(TargetName).pdb</ProgramDatabaseFile>

+      <SubSystem>Console</SubSystem>

+      <RandomizedBaseAddress>false</RandomizedBaseAddress>

+      <DataExecutionPrevention>

+      </DataExecutionPrevention>

+      <TargetMachine>MachineX64</TargetMachine>

+      <GenerateDebugInformation>true</GenerateDebugInformation>

+    </Link>

+  </ItemDefinitionGroup>

+  <ItemGroup>

+    <ClCompile Include="..\..\frontends\tasm\tasm-options.c" />

+    <ClCompile Include="..\..\frontends\tasm\tasm.c" />

+  </ItemGroup>

+  <ItemGroup>

+    <ClInclude Include="..\..\frontends\tasm\tasm-options.h" />

+    <ClInclude Include="..\..\libyasm.h" />

+    <ClInclude Include="..\..\libyasm\bitvect.h" />

+    <ClInclude Include="..\..\libyasm\compat-queue.h" />

+    <ClInclude Include="..\..\util.h" />

+  </ItemGroup>

+  <ItemGroup>

+    <ProjectReference Include="libyasm\libyasm.vcxproj">

+      <Project>{29fe7874-1256-4ad6-b889-68e399dc9608}</Project>

+      <ReferenceOutputAssembly>false</ReferenceOutputAssembly>

+    </ProjectReference>

+    <ProjectReference Include="modules\modules.vcxproj">

+      <Project>{d715a3d4-efaa-442e-ad8b-5b4ff64e1dd6}</Project>

+      <ReferenceOutputAssembly>false</ReferenceOutputAssembly>

+    </ProjectReference>

+  </ItemGroup>

+  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />

+  <ImportGroup Label="ExtensionTargets">

+  </ImportGroup>

+</Project>
\ No newline at end of file
diff --git a/Mkfiles/vc9/YASM-VERSION.h b/Mkfiles/vc9/YASM-VERSION.h
new file mode 100644
index 0000000..41966a5
--- /dev/null
+++ b/Mkfiles/vc9/YASM-VERSION.h
@@ -0,0 +1,2 @@
+#define PACKAGE_STRING "yasm 1.2.0"
+#define PACKAGE_VERSION "1.2.0"
diff --git a/Mkfiles/vc9/vsyasm.vcproj b/Mkfiles/vc9/vsyasm.vcproj
new file mode 100644
index 0000000..215d8ed
--- /dev/null
+++ b/Mkfiles/vc9/vsyasm.vcproj
@@ -0,0 +1,406 @@
+<?xml version="1.0" encoding="Windows-1252"?>

+<VisualStudioProject

+	ProjectType="Visual C++"

+	Version="9.00"

+	Name="vsyasm"

+	ProjectGUID="{7FDD85BB-CC86-442B-A425-989B5B296ED5}"

+	RootNamespace="vsyasm"

+	TargetFrameworkVersion="131072"

+	>

+	<Platforms>

+		<Platform

+			Name="Win32"

+		/>

+		<Platform

+			Name="x64"

+		/>

+	</Platforms>

+	<ToolFiles>

+	</ToolFiles>

+	<Configurations>

+		<Configuration

+			Name="Debug|Win32"

+			OutputDirectory="$(PlatformName)\$(ConfigurationName)"

+			IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"

+			ConfigurationType="1"

+			InheritedPropertySheets=".\crt_secure_no_deprecate.vsprops"

+			UseOfMFC="0"

+			ATLMinimizesCRunTimeLibraryUsage="false"

+			CharacterSet="2"

+			>

+			<Tool

+				Name="VCPreBuildEventTool"

+			/>

+			<Tool

+				Name="VCCustomBuildTool"

+			/>

+			<Tool

+				Name="VCXMLDataGeneratorTool"

+			/>

+			<Tool

+				Name="VCWebServiceProxyGeneratorTool"

+			/>

+			<Tool

+				Name="VCMIDLTool"

+				TypeLibraryName="$(PlatformName)\$(ConfigurationName)/vsyasm.tlb"

+				HeaderFileName=""

+			/>

+			<Tool

+				Name="VCCLCompilerTool"

+				Optimization="0"

+				AdditionalIncludeDirectories=".,../.."

+				PreprocessorDefinitions="_DEBUG;WIN32;_LIB;HAVE_CONFIG_H;VC"

+				BasicRuntimeChecks="3"

+				RuntimeLibrary="1"

+				UsePrecompiledHeader="0"

+				PrecompiledHeaderFile=""

+				AssemblerListingLocation="$(IntDir)\"

+				ObjectFile="$(IntDir)\"

+				ProgramDataBaseFileName="$(IntDir)\"

+				WarningLevel="3"

+				SuppressStartupBanner="true"

+				DebugInformationFormat="4"

+				CompileAs="0"

+			/>

+			<Tool

+				Name="VCManagedResourceCompilerTool"

+			/>

+			<Tool

+				Name="VCResourceCompilerTool"

+				PreprocessorDefinitions="_DEBUG"

+				Culture="1033"

+			/>

+			<Tool

+				Name="VCPreLinkEventTool"

+			/>

+			<Tool

+				Name="VCLinkerTool"

+				OutputFile="$(OutDir)\vsyasm.exe"

+				LinkIncremental="1"

+				SuppressStartupBanner="true"

+				GenerateDebugInformation="true"

+				ProgramDatabaseFile="$(OutDir)\$(ProjectName).pdb"

+				SubSystem="1"

+				RandomizedBaseAddress="1"

+				DataExecutionPrevention="0"

+				TargetMachine="1"

+			/>

+			<Tool

+				Name="VCALinkTool"

+			/>

+			<Tool

+				Name="VCManifestTool"

+			/>

+			<Tool

+				Name="VCXDCMakeTool"

+			/>

+			<Tool

+				Name="VCBscMakeTool"

+			/>

+			<Tool

+				Name="VCFxCopTool"

+			/>

+			<Tool

+				Name="VCAppVerifierTool"

+			/>

+			<Tool

+				Name="VCPostBuildEventTool"

+			/>

+		</Configuration>

+		<Configuration

+			Name="Debug|x64"

+			OutputDirectory="$(PlatformName)\$(ConfigurationName)"

+			IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"

+			ConfigurationType="1"

+			InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops;.\crt_secure_no_deprecate.vsprops"

+			UseOfMFC="0"

+			ATLMinimizesCRunTimeLibraryUsage="false"

+			CharacterSet="2"

+			>

+			<Tool

+				Name="VCPreBuildEventTool"

+			/>

+			<Tool

+				Name="VCCustomBuildTool"

+			/>

+			<Tool

+				Name="VCXMLDataGeneratorTool"

+			/>

+			<Tool

+				Name="VCWebServiceProxyGeneratorTool"

+			/>

+			<Tool

+				Name="VCMIDLTool"

+				TargetEnvironment="3"

+				TypeLibraryName="$(PlatformName)\$(ConfigurationName)/vsyasm.tlb"

+				HeaderFileName=""

+			/>

+			<Tool

+				Name="VCCLCompilerTool"

+				Optimization="0"

+				AdditionalIncludeDirectories=".,../.."

+				PreprocessorDefinitions="_DEBUG;_LIB;HAVE_CONFIG_H;VC;WIN64"

+				BasicRuntimeChecks="3"

+				RuntimeLibrary="1"

+				UsePrecompiledHeader="0"

+				PrecompiledHeaderFile=""

+				AssemblerListingLocation="$(IntDir)\"

+				ObjectFile="$(IntDir)\"

+				ProgramDataBaseFileName="$(IntDir)\"

+				WarningLevel="3"

+				SuppressStartupBanner="true"

+				DebugInformationFormat="3"

+				CompileAs="0"

+			/>

+			<Tool

+				Name="VCManagedResourceCompilerTool"

+			/>

+			<Tool

+				Name="VCResourceCompilerTool"

+				PreprocessorDefinitions="_DEBUG"

+				Culture="1033"

+			/>

+			<Tool

+				Name="VCPreLinkEventTool"

+			/>

+			<Tool

+				Name="VCLinkerTool"

+				OutputFile="$(OutDir)\vsyasm.exe"

+				LinkIncremental="1"

+				SuppressStartupBanner="true"

+				GenerateDebugInformation="true"

+				ProgramDatabaseFile="$(OutDir)\$(TargetName).pdb"

+				SubSystem="1"

+				RandomizedBaseAddress="1"

+				DataExecutionPrevention="0"

+				TargetMachine="17"

+			/>

+			<Tool

+				Name="VCALinkTool"

+			/>

+			<Tool

+				Name="VCManifestTool"

+			/>

+			<Tool

+				Name="VCXDCMakeTool"

+			/>

+			<Tool

+				Name="VCBscMakeTool"

+			/>

+			<Tool

+				Name="VCFxCopTool"

+			/>

+			<Tool

+				Name="VCAppVerifierTool"

+			/>

+			<Tool

+				Name="VCPostBuildEventTool"

+			/>

+		</Configuration>

+		<Configuration

+			Name="Release|Win32"

+			OutputDirectory="$(PlatformName)\$(ConfigurationName)"

+			IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"

+			ConfigurationType="1"

+			InheritedPropertySheets=".\crt_secure_no_deprecate.vsprops"

+			UseOfMFC="0"

+			ATLMinimizesCRunTimeLibraryUsage="false"

+			CharacterSet="2"

+			>

+			<Tool

+				Name="VCPreBuildEventTool"

+			/>

+			<Tool

+				Name="VCCustomBuildTool"

+			/>

+			<Tool

+				Name="VCXMLDataGeneratorTool"

+			/>

+			<Tool

+				Name="VCWebServiceProxyGeneratorTool"

+			/>

+			<Tool

+				Name="VCMIDLTool"

+				TypeLibraryName="$(PlatformName)\$(ConfigurationName)/vsyasm.tlb"

+				HeaderFileName=""

+			/>

+			<Tool

+				Name="VCCLCompilerTool"

+				Optimization="3"

+				InlineFunctionExpansion="0"

+				EnableIntrinsicFunctions="true"

+				AdditionalIncludeDirectories=".,../.."

+				PreprocessorDefinitions="NDEBUG;WIN32;_LIB;HAVE_CONFIG_H;VC"

+				StringPooling="true"

+				RuntimeLibrary="0"

+				EnableFunctionLevelLinking="true"

+				UsePrecompiledHeader="0"

+				PrecompiledHeaderFile=""

+				AssemblerListingLocation="$(IntDir)\"

+				ObjectFile="$(IntDir)\"

+				ProgramDataBaseFileName="$(IntDir)\"

+				WarningLevel="3"

+				SuppressStartupBanner="true"

+				CompileAs="0"

+			/>

+			<Tool

+				Name="VCManagedResourceCompilerTool"

+			/>

+			<Tool

+				Name="VCResourceCompilerTool"

+				PreprocessorDefinitions="NDEBUG"

+				Culture="1033"

+			/>

+			<Tool

+				Name="VCPreLinkEventTool"

+			/>

+			<Tool

+				Name="VCLinkerTool"

+				OutputFile="$(OutDir)\vsyasm.exe"

+				LinkIncremental="1"

+				SuppressStartupBanner="true"

+				GenerateDebugInformation="false"

+				ProgramDatabaseFile="$(OutDir)\$(ProjectName).pdb"

+				SubSystem="1"

+				RandomizedBaseAddress="1"

+				DataExecutionPrevention="0"

+				TargetMachine="1"

+			/>

+			<Tool

+				Name="VCALinkTool"

+			/>

+			<Tool

+				Name="VCManifestTool"

+			/>

+			<Tool

+				Name="VCXDCMakeTool"

+			/>

+			<Tool

+				Name="VCBscMakeTool"

+			/>

+			<Tool

+				Name="VCFxCopTool"

+			/>

+			<Tool

+				Name="VCAppVerifierTool"

+			/>

+			<Tool

+				Name="VCPostBuildEventTool"

+			/>

+		</Configuration>

+		<Configuration

+			Name="Release|x64"

+			OutputDirectory="$(PlatformName)\$(ConfigurationName)"

+			IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"

+			ConfigurationType="1"

+			InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops;.\crt_secure_no_deprecate.vsprops"

+			UseOfMFC="0"

+			ATLMinimizesCRunTimeLibraryUsage="false"

+			CharacterSet="2"

+			>

+			<Tool

+				Name="VCPreBuildEventTool"

+			/>

+			<Tool

+				Name="VCCustomBuildTool"

+			/>

+			<Tool

+				Name="VCXMLDataGeneratorTool"

+			/>

+			<Tool

+				Name="VCWebServiceProxyGeneratorTool"

+			/>

+			<Tool

+				Name="VCMIDLTool"

+				TargetEnvironment="3"

+				TypeLibraryName="$(PlatformName)\$(ConfigurationName)/vsyasm.tlb"

+				HeaderFileName=""

+			/>

+			<Tool

+				Name="VCCLCompilerTool"

+				Optimization="3"

+				InlineFunctionExpansion="1"

+				AdditionalIncludeDirectories=".,../.."

+				PreprocessorDefinitions="NDEBUG;_LIB;HAVE_CONFIG_H;VC;WIN64"

+				StringPooling="true"

+				RuntimeLibrary="0"

+				EnableFunctionLevelLinking="true"

+				UsePrecompiledHeader="0"

+				PrecompiledHeaderFile=""

+				AssemblerListingLocation="$(IntDir)\"

+				ObjectFile="$(IntDir)\"

+				ProgramDataBaseFileName="$(IntDir)\"

+				WarningLevel="3"

+				SuppressStartupBanner="true"

+				CompileAs="0"

+			/>

+			<Tool

+				Name="VCManagedResourceCompilerTool"

+			/>

+			<Tool

+				Name="VCResourceCompilerTool"

+				PreprocessorDefinitions="NDEBUG"

+				Culture="1033"

+			/>

+			<Tool

+				Name="VCPreLinkEventTool"

+			/>

+			<Tool

+				Name="VCLinkerTool"

+				OutputFile="$(OutDir)\vsyasm.exe"

+				LinkIncremental="1"

+				SuppressStartupBanner="true"

+				ProgramDatabaseFile="$(OutDir)\$(TargetName).pdb"

+				SubSystem="1"

+				RandomizedBaseAddress="1"

+				DataExecutionPrevention="0"

+				TargetMachine="17"

+			/>

+			<Tool

+				Name="VCALinkTool"

+			/>

+			<Tool

+				Name="VCManifestTool"

+			/>

+			<Tool

+				Name="VCXDCMakeTool"

+			/>

+			<Tool

+				Name="VCBscMakeTool"

+			/>

+			<Tool

+				Name="VCFxCopTool"

+			/>

+			<Tool

+				Name="VCAppVerifierTool"

+			/>

+			<Tool

+				Name="VCPostBuildEventTool"

+			/>

+		</Configuration>

+	</Configurations>

+	<References>

+	</References>

+	<Files>

+		<Filter

+			Name="Source Files"

+			Filter="cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"

+			>

+			<File

+				RelativePath="..\..\frontends\vsyasm\vsyasm.c"

+				>

+			</File>

+			<File

+				RelativePath="..\..\frontends\yasm\yasm-options.c"

+				>

+			</File>

+		</Filter>

+		<Filter

+			Name="Header Files"

+			Filter="h;hpp;hxx;hm;inl"

+			>

+		</Filter>

+	</Files>

+	<Globals>

+	</Globals>

+</VisualStudioProject>

diff --git a/YASM-VERSION-GEN.sh b/YASM-VERSION-GEN.sh
new file mode 100755
index 0000000..3a9f743
--- /dev/null
+++ b/YASM-VERSION-GEN.sh
@@ -0,0 +1,42 @@
+#!/bin/sh
+
+YVF=YASM-VERSION-FILE
+DEF_VER=v1.2.0
+
+LF='
+'
+
+# First see if there is a version file (included in release tarballs),
+# then try git-describe, then default.
+if test -f version
+then
+	VN=$(cat version) || VN="$DEF_VER"
+elif test -d .git -o -f .git &&
+	VN=$(git describe --match "v[0-9]*" --abbrev=4 HEAD 2>/dev/null) &&
+	case "$VN" in
+	*$LF*) (exit 1) ;;
+	v[0-9]*)
+		git update-index -q --refresh
+		test -z "$(git diff-index --name-only HEAD --)" ||
+		VN="$VN-dirty" ;;
+	esac
+then
+	VN=$(echo "$VN" | sed -e 's/-/./g');
+else
+	VN="$DEF_VER"
+fi
+
+VN=$(expr "$VN" : v*'\(.*\)')
+
+if test -r $YVF
+then
+	VC=$(cat $YVF)
+else
+	VC=unset
+fi
+test "$VN" = "$VC" || {
+	echo >&2 "$VN"
+	echo "$VN" >$YVF
+	echo "#define PACKAGE_STRING \"yasm $VN\"" > YASM-VERSION.h
+	echo "#define PACKAGE_VERSION \"$VN\"" >> YASM-VERSION.h
+}
diff --git a/config/ltmain.sh b/config/ltmain.sh
deleted file mode 100755
index a85567f..0000000
--- a/config/ltmain.sh
+++ /dev/null
@@ -1,6919 +0,0 @@
-# ltmain.sh - Provide generalized library-building support services.
-# NOTE: Changing this file will not affect anything until you rerun configure.
-#
-# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005
-# Free Software Foundation, Inc.
-# Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2 of the License, or
-# (at your option) any later version.
-#
-# This program 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
-# General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-#
-# As a special exception to the GNU General Public License, if you
-# distribute this file as part of a program that contains a
-# configuration script generated by Autoconf, you may include it under
-# the same distribution terms that you use for the rest of that program.
-
-basename="s,^.*/,,g"
-
-# Work around backward compatibility issue on IRIX 6.5. On IRIX 6.4+, sh
-# is ksh but when the shell is invoked as "sh" and the current value of
-# the _XPG environment variable is not equal to 1 (one), the special
-# positional parameter $0, within a function call, is the name of the
-# function.
-progpath="$0"
-
-# The name of this program:
-progname=`echo "$progpath" | $SED $basename`
-modename="$progname"
-
-# Global variables:
-EXIT_SUCCESS=0
-EXIT_FAILURE=1
-
-PROGRAM=ltmain.sh
-PACKAGE=libtool
-VERSION=1.5.22
-TIMESTAMP=" (1.1220.2.365 2005/12/18 22:14:06)"
-
-# See if we are running on zsh, and set the options which allow our
-# commands through without removal of \ escapes.
-if test -n "${ZSH_VERSION+set}" ; then
-  setopt NO_GLOB_SUBST
-fi
-
-# Check that we have a working $echo.
-if test "X$1" = X--no-reexec; then
-  # Discard the --no-reexec flag, and continue.
-  shift
-elif test "X$1" = X--fallback-echo; then
-  # Avoid inline document here, it may be left over
-  :
-elif test "X`($echo '\t') 2>/dev/null`" = 'X\t'; then
-  # Yippee, $echo works!
-  :
-else
-  # Restart under the correct shell, and then maybe $echo will work.
-  exec $SHELL "$progpath" --no-reexec ${1+"$@"}
-fi
-
-if test "X$1" = X--fallback-echo; then
-  # used as fallback echo
-  shift
-  cat <<EOF
-$*
-EOF
-  exit $EXIT_SUCCESS
-fi
-
-default_mode=
-help="Try \`$progname --help' for more information."
-magic="%%%MAGIC variable%%%"
-mkdir="mkdir"
-mv="mv -f"
-rm="rm -f"
-
-# Sed substitution that helps us do robust quoting.  It backslashifies
-# metacharacters that are still active within double-quoted strings.
-Xsed="${SED}"' -e 1s/^X//'
-sed_quote_subst='s/\([\\`\\"$\\\\]\)/\\\1/g'
-# test EBCDIC or ASCII
-case `echo X|tr X '\101'` in
- A) # ASCII based system
-    # \n is not interpreted correctly by Solaris 8 /usr/ucb/tr
-  SP2NL='tr \040 \012'
-  NL2SP='tr \015\012 \040\040'
-  ;;
- *) # EBCDIC based system
-  SP2NL='tr \100 \n'
-  NL2SP='tr \r\n \100\100'
-  ;;
-esac
-
-# NLS nuisances.
-# Only set LANG and LC_ALL to C if already set.
-# These must not be set unconditionally because not all systems understand
-# e.g. LANG=C (notably SCO).
-# We save the old values to restore during execute mode.
-if test "${LC_ALL+set}" = set; then
-  save_LC_ALL="$LC_ALL"; LC_ALL=C; export LC_ALL
-fi
-if test "${LANG+set}" = set; then
-  save_LANG="$LANG"; LANG=C; export LANG
-fi
-
-# Make sure IFS has a sensible default
-lt_nl='
-'
-IFS=" 	$lt_nl"
-
-if test "$build_libtool_libs" != yes && test "$build_old_libs" != yes; then
-  $echo "$modename: not configured to build any kind of library" 1>&2
-  $echo "Fatal configuration error.  See the $PACKAGE docs for more information." 1>&2
-  exit $EXIT_FAILURE
-fi
-
-# Global variables.
-mode=$default_mode
-nonopt=
-prev=
-prevopt=
-run=
-show="$echo"
-show_help=
-execute_dlfiles=
-duplicate_deps=no
-preserve_args=
-lo2o="s/\\.lo\$/.${objext}/"
-o2lo="s/\\.${objext}\$/.lo/"
-
-#####################################
-# Shell function definitions:
-# This seems to be the best place for them
-
-# func_mktempdir [string]
-# Make a temporary directory that won't clash with other running
-# libtool processes, and avoids race conditions if possible.  If
-# given, STRING is the basename for that directory.
-func_mktempdir ()
-{
-    my_template="${TMPDIR-/tmp}/${1-$progname}"
-
-    if test "$run" = ":"; then
-      # Return a directory name, but don't create it in dry-run mode
-      my_tmpdir="${my_template}-$$"
-    else
-
-      # If mktemp works, use that first and foremost
-      my_tmpdir=`mktemp -d "${my_template}-XXXXXXXX" 2>/dev/null`
-
-      if test ! -d "$my_tmpdir"; then
-	# Failing that, at least try and use $RANDOM to avoid a race
-	my_tmpdir="${my_template}-${RANDOM-0}$$"
-
-	save_mktempdir_umask=`umask`
-	umask 0077
-	$mkdir "$my_tmpdir"
-	umask $save_mktempdir_umask
-      fi
-
-      # If we're not in dry-run mode, bomb out on failure
-      test -d "$my_tmpdir" || {
-        $echo "cannot create temporary directory \`$my_tmpdir'" 1>&2
-	exit $EXIT_FAILURE
-      }
-    fi
-
-    $echo "X$my_tmpdir" | $Xsed
-}
-
-
-# func_win32_libid arg
-# return the library type of file 'arg'
-#
-# Need a lot of goo to handle *both* DLLs and import libs
-# Has to be a shell function in order to 'eat' the argument
-# that is supplied when $file_magic_command is called.
-func_win32_libid ()
-{
-  win32_libid_type="unknown"
-  win32_fileres=`file -L $1 2>/dev/null`
-  case $win32_fileres in
-  *ar\ archive\ import\ library*) # definitely import
-    win32_libid_type="x86 archive import"
-    ;;
-  *ar\ archive*) # could be an import, or static
-    if eval $OBJDUMP -f $1 | $SED -e '10q' 2>/dev/null | \
-      $EGREP -e 'file format pe-i386(.*architecture: i386)?' >/dev/null ; then
-      win32_nmres=`eval $NM -f posix -A $1 | \
-	$SED -n -e '1,100{/ I /{s,.*,import,;p;q;};}'`
-      case $win32_nmres in
-      import*)  win32_libid_type="x86 archive import";;
-      *)        win32_libid_type="x86 archive static";;
-      esac
-    fi
-    ;;
-  *DLL*)
-    win32_libid_type="x86 DLL"
-    ;;
-  *executable*) # but shell scripts are "executable" too...
-    case $win32_fileres in
-    *MS\ Windows\ PE\ Intel*)
-      win32_libid_type="x86 DLL"
-      ;;
-    esac
-    ;;
-  esac
-  $echo $win32_libid_type
-}
-
-
-# func_infer_tag arg
-# Infer tagged configuration to use if any are available and
-# if one wasn't chosen via the "--tag" command line option.
-# Only attempt this if the compiler in the base compile
-# command doesn't match the default compiler.
-# arg is usually of the form 'gcc ...'
-func_infer_tag ()
-{
-    # FreeBSD-specific: where we install compilers with non-standard names
-    tag_compilers_CC="*cc cc* *gcc gcc*"
-    tag_compilers_CXX="*c++ c++* *g++ g++*"
-    base_compiler=`set -- "$@"; echo $1`
-
-    # If $tagname isn't set, then try to infer if the default "CC" tag applies
-    if test -z "$tagname"; then
-      for zp in $tag_compilers_CC; do
-        case $base_compiler in
-	 $zp) tagname="CC"; break;;
-	esac
-      done
-    fi
-
-    if test -n "$available_tags" && test -z "$tagname"; then
-      CC_quoted=
-      for arg in $CC; do
-	case $arg in
-	  *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \	]*|*]*|"")
-	  arg="\"$arg\""
-	  ;;
-	esac
-	CC_quoted="$CC_quoted $arg"
-      done
-      case $@ in
-      # Blanks in the command may have been stripped by the calling shell,
-      # but not from the CC environment variable when configure was run.
-      " $CC "* | "$CC "* | " `$echo $CC` "* | "`$echo $CC` "* | " $CC_quoted"* | "$CC_quoted "* | " `$echo $CC_quoted` "* | "`$echo $CC_quoted` "*) ;;
-      # Blanks at the start of $base_compile will cause this to fail
-      # if we don't check for them as well.
-      *)
-	for z in $available_tags; do
-	  if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $z$" < "$progpath" > /dev/null; then
-	    # Evaluate the configuration.
-	    eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$z'$/,/^# ### END LIBTOOL TAG CONFIG: '$z'$/p' < $progpath`"
-	    CC_quoted=
-	    for arg in $CC; do
-	    # Double-quote args containing other shell metacharacters.
-	    case $arg in
-	      *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \	]*|*]*|"")
-	      arg="\"$arg\""
-	      ;;
-	    esac
-	    CC_quoted="$CC_quoted $arg"
-	  done
-	    case "$@ " in
-	      " $CC "* | "$CC "* | " `$echo $CC` "* | "`$echo $CC` "* | " $CC_quoted"* | "$CC_quoted "* | " `$echo $CC_quoted` "* | "`$echo $CC_quoted` "*)
-	      # The compiler in the base compile command matches
-	      # the one in the tagged configuration.
-	      # Assume this is the tagged configuration we want.
-	      tagname=$z
-	      break
-	      ;;
-	    esac
-
-	    # FreeBSD-specific: try compilers based on inferred tag
-	    if test -z "$tagname"; then
-	      eval "tag_compilers=\$tag_compilers_${z}"
-	      if test -n "$tag_compilers"; then
-		for zp in $tag_compilers; do
-		  case $base_compiler in   
-		    $zp) tagname=$z; break;;
-		  esac
-		done
-		if test -n "$tagname"; then
-		  break
-		fi
-	      fi
-            fi
-          fi
-	done
-	# If $tagname still isn't set, then no tagged configuration
-	# was found and let the user know that the "--tag" command
-	# line option must be used.
-	if test -z "$tagname"; then
-	  $echo "$modename: unable to infer tagged configuration"
-	  $echo "$modename: specify a tag with \`--tag'" 1>&2
-	  exit $EXIT_FAILURE
-#        else
-#          $echo "$modename: using $tagname tagged configuration"
-	fi
-	;;
-      esac
-    fi
-}
-
-
-# func_extract_an_archive dir oldlib
-func_extract_an_archive ()
-{
-    f_ex_an_ar_dir="$1"; shift
-    f_ex_an_ar_oldlib="$1"
-
-    $show "(cd $f_ex_an_ar_dir && $AR x $f_ex_an_ar_oldlib)"
-    $run eval "(cd \$f_ex_an_ar_dir && $AR x \$f_ex_an_ar_oldlib)" || exit $?
-    if ($AR t "$f_ex_an_ar_oldlib" | sort | sort -uc >/dev/null 2>&1); then
-     :
-    else
-      $echo "$modename: ERROR: object name conflicts: $f_ex_an_ar_dir/$f_ex_an_ar_oldlib" 1>&2
-      exit $EXIT_FAILURE
-    fi
-}
-
-# func_extract_archives gentop oldlib ...
-func_extract_archives ()
-{
-    my_gentop="$1"; shift
-    my_oldlibs=${1+"$@"}
-    my_oldobjs=""
-    my_xlib=""
-    my_xabs=""
-    my_xdir=""
-    my_status=""
-
-    $show "${rm}r $my_gentop"
-    $run ${rm}r "$my_gentop"
-    $show "$mkdir $my_gentop"
-    $run $mkdir "$my_gentop"
-    my_status=$?
-    if test "$my_status" -ne 0 && test ! -d "$my_gentop"; then
-      exit $my_status
-    fi
-
-    for my_xlib in $my_oldlibs; do
-      # Extract the objects.
-      case $my_xlib in
-	[\\/]* | [A-Za-z]:[\\/]*) my_xabs="$my_xlib" ;;
-	*) my_xabs=`pwd`"/$my_xlib" ;;
-      esac
-      my_xlib=`$echo "X$my_xlib" | $Xsed -e 's%^.*/%%'`
-      my_xdir="$my_gentop/$my_xlib"
-
-      $show "${rm}r $my_xdir"
-      $run ${rm}r "$my_xdir"
-      $show "$mkdir $my_xdir"
-      $run $mkdir "$my_xdir"
-      exit_status=$?
-      if test "$exit_status" -ne 0 && test ! -d "$my_xdir"; then
-	exit $exit_status
-      fi
-      case $host in
-      *-darwin*)
-	$show "Extracting $my_xabs"
-	# Do not bother doing anything if just a dry run
-	if test -z "$run"; then
-	  darwin_orig_dir=`pwd`
-	  cd $my_xdir || exit $?
-	  darwin_archive=$my_xabs
-	  darwin_curdir=`pwd`
-	  darwin_base_archive=`$echo "X$darwin_archive" | $Xsed -e 's%^.*/%%'`
-	  darwin_arches=`lipo -info "$darwin_archive" 2>/dev/null | $EGREP Architectures 2>/dev/null`
-	  if test -n "$darwin_arches"; then 
-	    darwin_arches=`echo "$darwin_arches" | $SED -e 's/.*are://'`
-	    darwin_arch=
-	    $show "$darwin_base_archive has multiple architectures $darwin_arches"
-	    for darwin_arch in  $darwin_arches ; do
-	      mkdir -p "unfat-$$/${darwin_base_archive}-${darwin_arch}"
-	      lipo -thin $darwin_arch -output "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}" "${darwin_archive}"
-	      cd "unfat-$$/${darwin_base_archive}-${darwin_arch}"
-	      func_extract_an_archive "`pwd`" "${darwin_base_archive}"
-	      cd "$darwin_curdir"
-	      $rm "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}"
-	    done # $darwin_arches
-      ## Okay now we have a bunch of thin objects, gotta fatten them up :)
-	    darwin_filelist=`find unfat-$$ -type f -name \*.o -print -o -name \*.lo -print| xargs basename | sort -u | $NL2SP`
-	    darwin_file=
-	    darwin_files=
-	    for darwin_file in $darwin_filelist; do
-	      darwin_files=`find unfat-$$ -name $darwin_file -print | $NL2SP`
-	      lipo -create -output "$darwin_file" $darwin_files
-	    done # $darwin_filelist
-	    ${rm}r unfat-$$
-	    cd "$darwin_orig_dir"
-	  else
-	    cd "$darwin_orig_dir"
- 	    func_extract_an_archive "$my_xdir" "$my_xabs"
-	  fi # $darwin_arches
-	fi # $run
-	;;
-      *)
-        func_extract_an_archive "$my_xdir" "$my_xabs"
-        ;;
-      esac
-      my_oldobjs="$my_oldobjs "`find $my_xdir -name \*.$objext -print -o -name \*.lo -print | $NL2SP`
-    done
-    func_extract_archives_result="$my_oldobjs"
-}
-# End of Shell function definitions
-#####################################
-
-# Darwin sucks
-eval std_shrext=\"$shrext_cmds\"
-
-disable_libs=no
-
-# Parse our command line options once, thoroughly.
-while test "$#" -gt 0
-do
-  arg="$1"
-  shift
-
-  case $arg in
-  -*=*) optarg=`$echo "X$arg" | $Xsed -e 's/[-_a-zA-Z0-9]*=//'` ;;
-  *) optarg= ;;
-  esac
-
-  # If the previous option needs an argument, assign it.
-  if test -n "$prev"; then
-    case $prev in
-    execute_dlfiles)
-      execute_dlfiles="$execute_dlfiles $arg"
-      ;;
-    tag)
-      tagname="$arg"
-      preserve_args="${preserve_args}=$arg"
-
-      # Check whether tagname contains only valid characters
-      case $tagname in
-      *[!-_A-Za-z0-9,/]*)
-	$echo "$progname: invalid tag name: $tagname" 1>&2
-	exit $EXIT_FAILURE
-	;;
-      esac
-
-      case $tagname in
-      CC)
-	# Don't test for the "default" C tag, as we know, it's there, but
-	# not specially marked.
-	;;
-      *)
-	if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$" < "$progpath" > /dev/null; then
-	  taglist="$taglist $tagname"
-	  # Evaluate the configuration.
-	  eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$tagname'$/,/^# ### END LIBTOOL TAG CONFIG: '$tagname'$/p' < $progpath`"
-	else
-	  $echo "$progname: ignoring unknown tag $tagname" 1>&2
-	fi
-	;;
-      esac
-      ;;
-    *)
-      eval "$prev=\$arg"
-      ;;
-    esac
-
-    prev=
-    prevopt=
-    continue
-  fi
-
-  # Have we seen a non-optional argument yet?
-  case $arg in
-  --help)
-    show_help=yes
-    ;;
-
-  --version)
-    $echo "$PROGRAM (GNU $PACKAGE) $VERSION$TIMESTAMP"
-    $echo
-    $echo "Copyright (C) 2005  Free Software Foundation, Inc."
-    $echo "This is free software; see the source for copying conditions.  There is NO"
-    $echo "warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
-    exit $?
-    ;;
-
-  --config)
-    ${SED} -e '1,/^# ### BEGIN LIBTOOL CONFIG/d' -e '/^# ### END LIBTOOL CONFIG/,$d' $progpath
-    # Now print the configurations for the tags.
-    for tagname in $taglist; do
-      ${SED} -n -e "/^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$/,/^# ### END LIBTOOL TAG CONFIG: $tagname$/p" < "$progpath"
-    done
-    exit $?
-    ;;
-
-  --debug)
-    $echo "$progname: enabling shell trace mode"
-    set -x
-    preserve_args="$preserve_args $arg"
-    ;;
-
-  --dry-run | -n)
-    run=:
-    ;;
-
-  --features)
-    $echo "host: $host"
-    if test "$build_libtool_libs" = yes; then
-      $echo "enable shared libraries"
-    else
-      $echo "disable shared libraries"
-    fi
-    if test "$build_old_libs" = yes; then
-      $echo "enable static libraries"
-    else
-      $echo "disable static libraries"
-    fi
-    exit $?
-    ;;
-
-  --finish) mode="finish" ;;
-
-  --mode) prevopt="--mode" prev=mode ;;
-  --mode=*) mode="$optarg" ;;
-
-  --preserve-dup-deps) duplicate_deps="yes" ;;
-
-  --quiet | --silent)
-    show=:
-    preserve_args="$preserve_args $arg"
-    ;;
-
-  --tag)
-    prevopt="--tag"
-    prev=tag
-    preserve_args="$preserve_args --tag"
-    ;;
-  --tag=*)
-    set tag "$optarg" ${1+"$@"}
-    shift
-    prev=tag
-    preserve_args="$preserve_args --tag"
-    ;;
-
-  -dlopen)
-    prevopt="-dlopen"
-    prev=execute_dlfiles
-    ;;
-
-  -*)
-    $echo "$modename: unrecognized option \`$arg'" 1>&2
-    $echo "$help" 1>&2
-    exit $EXIT_FAILURE
-    ;;
-
-  *)
-    nonopt="$arg"
-    break
-    ;;
-  esac
-done
-
-if test -n "$prevopt"; then
-  $echo "$modename: option \`$prevopt' requires an argument" 1>&2
-  $echo "$help" 1>&2
-  exit $EXIT_FAILURE
-fi
-
-case $disable_libs in
-no) 
-  ;;
-shared)
-  build_libtool_libs=no
-  build_old_libs=yes
-  ;;
-static)
-  build_old_libs=`case $build_libtool_libs in yes) echo no;; *) echo yes;; esac`
-  ;;
-esac
-
-# If this variable is set in any of the actions, the command in it
-# will be execed at the end.  This prevents here-documents from being
-# left over by shells.
-exec_cmd=
-
-if test -z "$show_help"; then
-
-  # Infer the operation mode.
-  if test -z "$mode"; then
-    $echo "*** Warning: inferring the mode of operation is deprecated." 1>&2
-    $echo "*** Future versions of Libtool will require --mode=MODE be specified." 1>&2
-    case $nonopt in
-    *cc | cc* | *++ | gcc* | *-gcc* | g++* | xlc*)
-      mode=link
-      for arg
-      do
-	case $arg in
-	-c)
-	   mode=compile
-	   break
-	   ;;
-	esac
-      done
-      ;;
-    *db | *dbx | *strace | *truss)
-      mode=execute
-      ;;
-    *install*|cp|mv)
-      mode=install
-      ;;
-    *rm)
-      mode=uninstall
-      ;;
-    *)
-      # If we have no mode, but dlfiles were specified, then do execute mode.
-      test -n "$execute_dlfiles" && mode=execute
-
-      # Just use the default operation mode.
-      if test -z "$mode"; then
-	if test -n "$nonopt"; then
-	  $echo "$modename: warning: cannot infer operation mode from \`$nonopt'" 1>&2
-	else
-	  $echo "$modename: warning: cannot infer operation mode without MODE-ARGS" 1>&2
-	fi
-      fi
-      ;;
-    esac
-  fi
-
-  # Only execute mode is allowed to have -dlopen flags.
-  if test -n "$execute_dlfiles" && test "$mode" != execute; then
-    $echo "$modename: unrecognized option \`-dlopen'" 1>&2
-    $echo "$help" 1>&2
-    exit $EXIT_FAILURE
-  fi
-
-  # Change the help message to a mode-specific one.
-  generic_help="$help"
-  help="Try \`$modename --help --mode=$mode' for more information."
-
-  # These modes are in order of execution frequency so that they run quickly.
-  case $mode in
-  # libtool compile mode
-  compile)
-    modename="$modename: compile"
-    # Get the compilation command and the source file.
-    base_compile=
-    srcfile="$nonopt"  #  always keep a non-empty value in "srcfile"
-    suppress_opt=yes
-    suppress_output=
-    arg_mode=normal
-    libobj=
-    later=
-
-    for arg
-    do
-      case $arg_mode in
-      arg  )
-	# do not "continue".  Instead, add this to base_compile
-	lastarg="$arg"
-	arg_mode=normal
-	;;
-
-      target )
-	libobj="$arg"
-	arg_mode=normal
-	continue
-	;;
-
-      normal )
-	# Accept any command-line options.
-	case $arg in
-	-o)
-	  if test -n "$libobj" ; then
-	    $echo "$modename: you cannot specify \`-o' more than once" 1>&2
-	    exit $EXIT_FAILURE
-	  fi
-	  arg_mode=target
-	  continue
-	  ;;
-
-	-static | -prefer-pic | -prefer-non-pic)
-	  later="$later $arg"
-	  continue
-	  ;;
-
-	-no-suppress)
-	  suppress_opt=no
-	  continue
-	  ;;
-
-	-Xcompiler)
-	  arg_mode=arg  #  the next one goes into the "base_compile" arg list
-	  continue      #  The current "srcfile" will either be retained or
-	  ;;            #  replaced later.  I would guess that would be a bug.
-
-	-Wc,*)
-	  args=`$echo "X$arg" | $Xsed -e "s/^-Wc,//"`
-	  lastarg=
-	  save_ifs="$IFS"; IFS=','
- 	  for arg in $args; do
-	    IFS="$save_ifs"
-
-	    # Double-quote args containing other shell metacharacters.
-	    # Many Bourne shells cannot handle close brackets correctly
-	    # in scan sets, so we specify it separately.
-	    case $arg in
-	      *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \	]*|*]*|"")
-	      arg="\"$arg\""
-	      ;;
-	    esac
-	    lastarg="$lastarg $arg"
-	  done
-	  IFS="$save_ifs"
-	  lastarg=`$echo "X$lastarg" | $Xsed -e "s/^ //"`
-
-	  # Add the arguments to base_compile.
-	  base_compile="$base_compile $lastarg"
-	  continue
-	  ;;
-
-	* )
-	  # Accept the current argument as the source file.
-	  # The previous "srcfile" becomes the current argument.
-	  #
-	  lastarg="$srcfile"
-	  srcfile="$arg"
-	  ;;
-	esac  #  case $arg
-	;;
-      esac    #  case $arg_mode
-
-      # Aesthetically quote the previous argument.
-      lastarg=`$echo "X$lastarg" | $Xsed -e "$sed_quote_subst"`
-
-      case $lastarg in
-      # Double-quote args containing other shell metacharacters.
-      # Many Bourne shells cannot handle close brackets correctly
-      # in scan sets, and some SunOS ksh mistreat backslash-escaping
-      # in scan sets (worked around with variable expansion),
-      # and furthermore cannot handle '|' '&' '(' ')' in scan sets 
-      # at all, so we specify them separately.
-      *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \	]*|*]*|"")
-	lastarg="\"$lastarg\""
-	;;
-      esac
-
-      base_compile="$base_compile $lastarg"
-    done # for arg
-
-    case $arg_mode in
-    arg)
-      $echo "$modename: you must specify an argument for -Xcompile"
-      exit $EXIT_FAILURE
-      ;;
-    target)
-      $echo "$modename: you must specify a target with \`-o'" 1>&2
-      exit $EXIT_FAILURE
-      ;;
-    *)
-      # Get the name of the library object.
-      [ -z "$libobj" ] && libobj=`$echo "X$srcfile" | $Xsed -e 's%^.*/%%'`
-      ;;
-    esac
-
-    # Recognize several different file suffixes.
-    # If the user specifies -o file.o, it is replaced with file.lo
-    xform='[cCFSifmso]'
-    case $libobj in
-    *.ada) xform=ada ;;
-    *.adb) xform=adb ;;
-    *.ads) xform=ads ;;
-    *.asm) xform=asm ;;
-    *.c++) xform=c++ ;;
-    *.cc) xform=cc ;;
-    *.ii) xform=ii ;;
-    *.class) xform=class ;;
-    *.cpp) xform=cpp ;;
-    *.cxx) xform=cxx ;;
-    *.f90) xform=f90 ;;
-    *.for) xform=for ;;
-    *.java) xform=java ;;
-    esac
-
-    libobj=`$echo "X$libobj" | $Xsed -e "s/\.$xform$/.lo/"`
-
-    case $libobj in
-    *.lo) obj=`$echo "X$libobj" | $Xsed -e "$lo2o"` ;;
-    *)
-      $echo "$modename: cannot determine name of library object from \`$libobj'" 1>&2
-      exit $EXIT_FAILURE
-      ;;
-    esac
-
-    func_infer_tag $base_compile
-
-    for arg in $later; do
-      case $arg in
-      -static)
-	build_old_libs=yes
-	continue
-	;;
-
-      -prefer-pic)
-	pic_mode=yes
-	continue
-	;;
-
-      -prefer-non-pic)
-	pic_mode=no
-	continue
-	;;
-      esac
-    done
-
-    qlibobj=`$echo "X$libobj" | $Xsed -e "$sed_quote_subst"`
-    case $qlibobj in
-      *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \	]*|*]*|"")
-	qlibobj="\"$qlibobj\"" ;;
-    esac
-    test "X$libobj" != "X$qlibobj" \
-	&& $echo "X$libobj" | grep '[]~#^*{};<>?"'"'"' 	&()|`$[]' \
-	&& $echo "$modename: libobj name \`$libobj' may not contain shell special characters."
-    objname=`$echo "X$obj" | $Xsed -e 's%^.*/%%'`
-    xdir=`$echo "X$obj" | $Xsed -e 's%/[^/]*$%%'`
-    if test "X$xdir" = "X$obj"; then
-      xdir=
-    else
-      xdir=$xdir/
-    fi
-    lobj=${xdir}$objdir/$objname
-
-    if test -z "$base_compile"; then
-      $echo "$modename: you must specify a compilation command" 1>&2
-      $echo "$help" 1>&2
-      exit $EXIT_FAILURE
-    fi
-
-    # Delete any leftover library objects.
-    if test "$build_old_libs" = yes; then
-      removelist="$obj $lobj $libobj ${libobj}T"
-    else
-      removelist="$lobj $libobj ${libobj}T"
-    fi
-
-    $run $rm $removelist
-    trap "$run $rm $removelist; exit $EXIT_FAILURE" 1 2 15
-
-    # On Cygwin there's no "real" PIC flag so we must build both object types
-    case $host_os in
-    cygwin* | mingw* | pw32* | os2*)
-      pic_mode=default
-      ;;
-    esac
-    if test "$pic_mode" = no && test "$deplibs_check_method" != pass_all; then
-      # non-PIC code in shared libraries is not supported
-      pic_mode=default
-    fi
-
-    # Calculate the filename of the output object if compiler does
-    # not support -o with -c
-    if test "$compiler_c_o" = no; then
-      output_obj=`$echo "X$srcfile" | $Xsed -e 's%^.*/%%' -e 's%\.[^.]*$%%'`.${objext}
-      lockfile="$output_obj.lock"
-      removelist="$removelist $output_obj $lockfile"
-      trap "$run $rm $removelist; exit $EXIT_FAILURE" 1 2 15
-    else
-      output_obj=
-      need_locks=no
-      lockfile=
-    fi
-
-    # Lock this critical section if it is needed
-    # We use this script file to make the link, it avoids creating a new file
-    if test "$need_locks" = yes; then
-      until $run ln "$progpath" "$lockfile" 2>/dev/null; do
-	$show "Waiting for $lockfile to be removed"
-	sleep 2
-      done
-    elif test "$need_locks" = warn; then
-      if test -f "$lockfile"; then
-	$echo "\
-*** ERROR, $lockfile exists and contains:
-`cat $lockfile 2>/dev/null`
-
-This indicates that another process is trying to use the same
-temporary object file, and libtool could not work around it because
-your compiler does not support \`-c' and \`-o' together.  If you
-repeat this compilation, it may succeed, by chance, but you had better
-avoid parallel builds (make -j) in this platform, or get a better
-compiler."
-
-	$run $rm $removelist
-	exit $EXIT_FAILURE
-      fi
-      $echo "$srcfile" > "$lockfile"
-    fi
-
-    if test -n "$fix_srcfile_path"; then
-      eval srcfile=\"$fix_srcfile_path\"
-    fi
-    qsrcfile=`$echo "X$srcfile" | $Xsed -e "$sed_quote_subst"`
-    case $qsrcfile in
-      *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \	]*|*]*|"")
-      qsrcfile="\"$qsrcfile\"" ;;
-    esac
-
-    $run $rm "$libobj" "${libobj}T"
-
-    # Create a libtool object file (analogous to a ".la" file),
-    # but don't create it if we're doing a dry run.
-    test -z "$run" && cat > ${libobj}T <<EOF
-# $libobj - a libtool object file
-# Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
-#
-# Please DO NOT delete this file!
-# It is necessary for linking the library.
-
-# Name of the PIC object.
-EOF
-
-    # Only build a PIC object if we are building libtool libraries.
-    if test "$build_libtool_libs" = yes; then
-      # Without this assignment, base_compile gets emptied.
-      fbsd_hideous_sh_bug=$base_compile
-
-      if test "$pic_mode" != no; then
-	command="$base_compile $qsrcfile $pic_flag"
-      else
-	# Don't build PIC code
-	command="$base_compile $qsrcfile"
-      fi
-
-      if test ! -d "${xdir}$objdir"; then
-	$show "$mkdir ${xdir}$objdir"
-	$run $mkdir ${xdir}$objdir
-	exit_status=$?
-	if test "$exit_status" -ne 0 && test ! -d "${xdir}$objdir"; then
-	  exit $exit_status
-	fi
-      fi
-
-      if test -z "$output_obj"; then
-	# Place PIC objects in $objdir
-	command="$command -o $lobj"
-      fi
-
-      $run $rm "$lobj" "$output_obj"
-
-      $show "$command"
-      if $run eval "$command"; then :
-      else
-	test -n "$output_obj" && $run $rm $removelist
-	exit $EXIT_FAILURE
-      fi
-
-      if test "$need_locks" = warn &&
-	 test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then
-	$echo "\
-*** ERROR, $lockfile contains:
-`cat $lockfile 2>/dev/null`
-
-but it should contain:
-$srcfile
-
-This indicates that another process is trying to use the same
-temporary object file, and libtool could not work around it because
-your compiler does not support \`-c' and \`-o' together.  If you
-repeat this compilation, it may succeed, by chance, but you had better
-avoid parallel builds (make -j) in this platform, or get a better
-compiler."
-
-	$run $rm $removelist
-	exit $EXIT_FAILURE
-      fi
-
-      # Just move the object if needed, then go on to compile the next one
-      if test -n "$output_obj" && test "X$output_obj" != "X$lobj"; then
-	$show "$mv $output_obj $lobj"
-	if $run $mv $output_obj $lobj; then :
-	else
-	  error=$?
-	  $run $rm $removelist
-	  exit $error
-	fi
-      fi
-
-      # Append the name of the PIC object to the libtool object file.
-      test -z "$run" && cat >> ${libobj}T <<EOF
-pic_object='$objdir/$objname'
-
-EOF
-
-      # Allow error messages only from the first compilation.
-      if test "$suppress_opt" = yes; then
-        suppress_output=' >/dev/null 2>&1'
-      fi
-    else
-      # No PIC object so indicate it doesn't exist in the libtool
-      # object file.
-      test -z "$run" && cat >> ${libobj}T <<EOF
-pic_object=none
-
-EOF
-    fi
-
-    # Only build a position-dependent object if we build old libraries.
-    if test "$build_old_libs" = yes; then
-      if test "$pic_mode" != yes; then
-	# Don't build PIC code
-	command="$base_compile $qsrcfile"
-      else
-	command="$base_compile $qsrcfile $pic_flag"
-      fi
-      if test "$compiler_c_o" = yes; then
-	command="$command -o $obj"
-      fi
-
-      # Suppress compiler output if we already did a PIC compilation.
-      command="$command$suppress_output"
-      $run $rm "$obj" "$output_obj"
-      $show "$command"
-      if $run eval "$command"; then :
-      else
-	$run $rm $removelist
-	exit $EXIT_FAILURE
-      fi
-
-      if test "$need_locks" = warn &&
-	 test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then
-	$echo "\
-*** ERROR, $lockfile contains:
-`cat $lockfile 2>/dev/null`
-
-but it should contain:
-$srcfile
-
-This indicates that another process is trying to use the same
-temporary object file, and libtool could not work around it because
-your compiler does not support \`-c' and \`-o' together.  If you
-repeat this compilation, it may succeed, by chance, but you had better
-avoid parallel builds (make -j) in this platform, or get a better
-compiler."
-
-	$run $rm $removelist
-	exit $EXIT_FAILURE
-      fi
-
-      # Just move the object if needed
-      if test -n "$output_obj" && test "X$output_obj" != "X$obj"; then
-	$show "$mv $output_obj $obj"
-	if $run $mv $output_obj $obj; then :
-	else
-	  error=$?
-	  $run $rm $removelist
-	  exit $error
-	fi
-      fi
-
-      # Append the name of the non-PIC object the libtool object file.
-      # Only append if the libtool object file exists.
-      test -z "$run" && cat >> ${libobj}T <<EOF
-# Name of the non-PIC object.
-non_pic_object='$objname'
-
-EOF
-    else
-      # Append the name of the non-PIC object the libtool object file.
-      # Only append if the libtool object file exists.
-      test -z "$run" && cat >> ${libobj}T <<EOF
-# Name of the non-PIC object.
-non_pic_object=none
-
-EOF
-    fi
-
-    $run $mv "${libobj}T" "${libobj}"
-
-    # Unlock the critical section if it was locked
-    if test "$need_locks" != no; then
-      $run $rm "$lockfile"
-    fi
-
-    exit $EXIT_SUCCESS
-    ;;
-
-  # libtool link mode
-  link | relink)
-    modename="$modename: link"
-    case $host in
-    *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*)
-      # It is impossible to link a dll without this setting, and
-      # we shouldn't force the makefile maintainer to figure out
-      # which system we are compiling for in order to pass an extra
-      # flag for every libtool invocation.
-      # allow_undefined=no
-
-      # FIXME: Unfortunately, there are problems with the above when trying
-      # to make a dll which has undefined symbols, in which case not
-      # even a static library is built.  For now, we need to specify
-      # -no-undefined on the libtool link line when we can be certain
-      # that all symbols are satisfied, otherwise we get a static library.
-      allow_undefined=yes
-      ;;
-    *)
-      allow_undefined=yes
-      ;;
-    esac
-    libtool_args="$nonopt"
-    base_compile="$nonopt $@"
-    compile_command="$nonopt"
-    finalize_command="$nonopt"
-
-    compile_rpath=
-    finalize_rpath=
-    compile_shlibpath=
-    finalize_shlibpath=
-    convenience=
-    old_convenience=
-    deplibs=
-    old_deplibs=
-    compiler_flags=
-    linker_flags=
-    dllsearchpath=
-    lib_search_path=`pwd`
-    inst_prefix_dir=
-
-    avoid_version=no
-    dlfiles=
-    dlprefiles=
-    dlself=no
-    export_dynamic=no
-    export_symbols=
-    export_symbols_regex=
-    generated=
-    libobjs=
-    ltlibs=
-    module=no
-    no_install=no
-    objs=
-    non_pic_objects=
-    notinst_path= # paths that contain not-installed libtool libraries
-    precious_files_regex=
-    prefer_static_libs=no
-    preload=no
-    prev=
-    prevarg=
-    release=
-    rpath=
-    xrpath=
-    perm_rpath=
-    temp_rpath=
-    thread_safe=no
-    vinfo=
-    vinfo_number=no
-
-    func_infer_tag $base_compile
-
-    # We need to know -static, to get the right output filenames.
-    for arg
-    do
-      case $arg in
-      -all-static | -static)
-	if test "X$arg" = "X-all-static"; then
-	  if test "$build_libtool_libs" = yes && test -z "$link_static_flag"; then
-	    $echo "$modename: warning: complete static linking is impossible in this configuration" 1>&2
-	  fi
-	  if test -n "$link_static_flag"; then
-	    dlopen_self=$dlopen_self_static
-	  fi
-	  prefer_static_libs=yes
-	else
-	  if test -z "$pic_flag" && test -n "$link_static_flag"; then
-	    dlopen_self=$dlopen_self_static
-	  fi
-	  prefer_static_libs=built
-	fi
-	build_libtool_libs=no
-	build_old_libs=yes
-	break
-	;;
-      esac
-    done
-
-    # See if our shared archives depend on static archives.
-    test -n "$old_archive_from_new_cmds" && build_old_libs=yes
-
-    # Go through the arguments, transforming them on the way.
-    while test "$#" -gt 0; do
-      arg="$1"
-      shift
-      case $arg in
-      *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \	]*|*]*|"")
-	qarg=\"`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`\" ### testsuite: skip nested quoting test
-	;;
-      *) qarg=$arg ;;
-      esac
-      libtool_args="$libtool_args $qarg"
-
-      # If the previous option needs an argument, assign it.
-      if test -n "$prev"; then
-	case $prev in
-	output)
-	  compile_command="$compile_command @OUTPUT@"
-	  finalize_command="$finalize_command @OUTPUT@"
-	  ;;
-	esac
-
-	case $prev in
-	dlfiles|dlprefiles)
-	  if test "$preload" = no; then
-	    # Add the symbol object into the linking commands.
-	    compile_command="$compile_command @SYMFILE@"
-	    finalize_command="$finalize_command @SYMFILE@"
-	    preload=yes
-	  fi
-	  case $arg in
-	  *.la | *.lo) ;;  # We handle these cases below.
-	  force)
-	    if test "$dlself" = no; then
-	      dlself=needless
-	      export_dynamic=yes
-	    fi
-	    prev=
-	    continue
-	    ;;
-	  self)
-	    if test "$prev" = dlprefiles; then
-	      dlself=yes
-	    elif test "$prev" = dlfiles && test "$dlopen_self" != yes; then
-	      dlself=yes
-	    else
-	      dlself=needless
-	      export_dynamic=yes
-	    fi
-	    prev=
-	    continue
-	    ;;
-	  *)
-	    if test "$prev" = dlfiles; then
-	      dlfiles="$dlfiles $arg"
-	    else
-	      dlprefiles="$dlprefiles $arg"
-	    fi
-	    prev=
-	    continue
-	    ;;
-	  esac
-	  ;;
-	expsyms)
-	  export_symbols="$arg"
-	  if test ! -f "$arg"; then
-	    $echo "$modename: symbol file \`$arg' does not exist"
-	    exit $EXIT_FAILURE
-	  fi
-	  prev=
-	  continue
-	  ;;
-	expsyms_regex)
-	  export_symbols_regex="$arg"
-	  prev=
-	  continue
-	  ;;
-	inst_prefix)
-	  inst_prefix_dir="$arg"
-	  prev=
-	  continue
-	  ;;
-	precious_regex)
-	  precious_files_regex="$arg"
-	  prev=
-	  continue
-	  ;;
-	release)
-	  release="-$arg"
-	  prev=
-	  continue
-	  ;;
-	objectlist)
-	  if test -f "$arg"; then
-	    save_arg=$arg
-	    moreargs=
-	    for fil in `cat $save_arg`
-	    do
-#	      moreargs="$moreargs $fil"
-	      arg=$fil
-	      # A libtool-controlled object.
-
-	      # Check to see that this really is a libtool object.
-	      if (${SED} -e '2q' $arg | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
-		pic_object=
-		non_pic_object=
-
-		# Read the .lo file
-		# If there is no directory component, then add one.
-		case $arg in
-		*/* | *\\*) . $arg ;;
-		*) . ./$arg ;;
-		esac
-
-		if test -z "$pic_object" || \
-		   test -z "$non_pic_object" ||
-		   test "$pic_object" = none && \
-		   test "$non_pic_object" = none; then
-		  $echo "$modename: cannot find name of object for \`$arg'" 1>&2
-		  exit $EXIT_FAILURE
-		fi
-
-		# Extract subdirectory from the argument.
-		xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'`
-		if test "X$xdir" = "X$arg"; then
-		  xdir=
-		else
-		  xdir="$xdir/"
-		fi
-
-		if test "$pic_object" != none; then
-		  # Prepend the subdirectory the object is found in.
-		  pic_object="$xdir$pic_object"
-
-		  if test "$prev" = dlfiles; then
-		    if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then
-		      dlfiles="$dlfiles $pic_object"
-		      prev=
-		      continue
-		    else
-		      # If libtool objects are unsupported, then we need to preload.
-		      prev=dlprefiles
-		    fi
-		  fi
-
-		  # CHECK ME:  I think I busted this.  -Ossama
-		  if test "$prev" = dlprefiles; then
-		    # Preload the old-style object.
-		    dlprefiles="$dlprefiles $pic_object"
-		    prev=
-		  fi
-
-		  # A PIC object.
-		  libobjs="$libobjs $pic_object"
-		  arg="$pic_object"
-		fi
-
-		# Non-PIC object.
-		if test "$non_pic_object" != none; then
-		  # Prepend the subdirectory the object is found in.
-		  non_pic_object="$xdir$non_pic_object"
-
-		  # A standard non-PIC object
-		  non_pic_objects="$non_pic_objects $non_pic_object"
-		  if test -z "$pic_object" || test "$pic_object" = none ; then
-		    arg="$non_pic_object"
-		  fi
-		else
-		  # If the PIC object exists, use it instead.
-		  # $xdir was prepended to $pic_object above.
-		  non_pic_object="$pic_object"
-		  non_pic_objects="$non_pic_objects $non_pic_object"
-		fi
-	      else
-		# Only an error if not doing a dry-run.
-		if test -z "$run"; then
-		  $echo "$modename: \`$arg' is not a valid libtool object" 1>&2
-		  exit $EXIT_FAILURE
-		else
-		  # Dry-run case.
-
-		  # Extract subdirectory from the argument.
-		  xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'`
-		  if test "X$xdir" = "X$arg"; then
-		    xdir=
-		  else
-		    xdir="$xdir/"
-		  fi
-
-		  pic_object=`$echo "X${xdir}${objdir}/${arg}" | $Xsed -e "$lo2o"`
-		  non_pic_object=`$echo "X${xdir}${arg}" | $Xsed -e "$lo2o"`
-		  libobjs="$libobjs $pic_object"
-		  non_pic_objects="$non_pic_objects $non_pic_object"
-		fi
-	      fi
-	    done
-	  else
-	    $echo "$modename: link input file \`$save_arg' does not exist"
-	    exit $EXIT_FAILURE
-	  fi
-	  arg=$save_arg
-	  prev=
-	  continue
-	  ;;
-	rpath | xrpath)
-	  # We need an absolute path.
-	  case $arg in
-	  [\\/]* | [A-Za-z]:[\\/]*) ;;
-	  *)
-	    $echo "$modename: only absolute run-paths are allowed" 1>&2
-	    exit $EXIT_FAILURE
-	    ;;
-	  esac
-	  if test "$prev" = rpath; then
-	    case "$rpath " in
-	    *" $arg "*) ;;
-	    *) rpath="$rpath $arg" ;;
-	    esac
-	  else
-	    case "$xrpath " in
-	    *" $arg "*) ;;
-	    *) xrpath="$xrpath $arg" ;;
-	    esac
-	  fi
-	  prev=
-	  continue
-	  ;;
-	xcompiler)
-	  compiler_flags="$compiler_flags $qarg"
-	  prev=
-	  compile_command="$compile_command $qarg"
-	  finalize_command="$finalize_command $qarg"
-	  continue
-	  ;;
-	xlinker)
-	  linker_flags="$linker_flags $qarg"
-	  compiler_flags="$compiler_flags $wl$qarg"
-	  prev=
-	  compile_command="$compile_command $wl$qarg"
-	  finalize_command="$finalize_command $wl$qarg"
-	  continue
-	  ;;
-	xcclinker)
-	  linker_flags="$linker_flags $qarg"
-	  compiler_flags="$compiler_flags $qarg"
-	  prev=
-	  compile_command="$compile_command $qarg"
-	  finalize_command="$finalize_command $qarg"
-	  continue
-	  ;;
-	shrext)
-  	  shrext_cmds="$arg"
-	  prev=
-	  continue
-	  ;;
-	darwin_framework|darwin_framework_skip)
-	  test "$prev" = "darwin_framework" && compiler_flags="$compiler_flags $arg"
-	  compile_command="$compile_command $arg"
-	  finalize_command="$finalize_command $arg"
-	  prev=
-	  continue
-	  ;;
-	*)
-	  eval "$prev=\"\$arg\""
-	  prev=
-	  continue
-	  ;;
-	esac
-      fi # test -n "$prev"
-
-      prevarg="$arg"
-
-      case $arg in
-      -all-static)
-	if test -n "$link_static_flag"; then
-	  compile_command="$compile_command $link_static_flag"
-	  finalize_command="$finalize_command $link_static_flag"
-	fi
-	continue
-	;;
-
-      -allow-undefined)
-	# FIXME: remove this flag sometime in the future.
-	$echo "$modename: \`-allow-undefined' is deprecated because it is the default" 1>&2
-	continue
-	;;
-
-      -avoid-version)
-	avoid_version=yes
-	continue
-	;;
-
-      -dlopen)
-	prev=dlfiles
-	continue
-	;;
-
-      -dlpreopen)
-	prev=dlprefiles
-	continue
-	;;
-
-      -export-dynamic)
-	export_dynamic=yes
-	continue
-	;;
-
-      -export-symbols | -export-symbols-regex)
-	if test -n "$export_symbols" || test -n "$export_symbols_regex"; then
-	  $echo "$modename: more than one -exported-symbols argument is not allowed"
-	  exit $EXIT_FAILURE
-	fi
-	if test "X$arg" = "X-export-symbols"; then
-	  prev=expsyms
-	else
-	  prev=expsyms_regex
-	fi
-	continue
-	;;
-
-      -framework|-arch|-isysroot)
-	case " $CC " in
-	  *" ${arg} ${1} "* | *" ${arg}	${1} "*) 
-		prev=darwin_framework_skip ;;
-	  *) compiler_flags="$compiler_flags $arg"
-	     prev=darwin_framework ;;
-	esac
-	compile_command="$compile_command $arg"
-	finalize_command="$finalize_command $arg"
-	continue
-	;;
-
-      -inst-prefix-dir)
-	prev=inst_prefix
-	continue
-	;;
-
-      # The native IRIX linker understands -LANG:*, -LIST:* and -LNO:*
-      # so, if we see these flags be careful not to treat them like -L
-      -L[A-Z][A-Z]*:*)
-	case $with_gcc/$host in
-	no/*-*-irix* | /*-*-irix*)
-	  compile_command="$compile_command $arg"
-	  finalize_command="$finalize_command $arg"
-	  ;;
-	esac
-	continue
-	;;
-
-      -L*)
-	dir=`$echo "X$arg" | $Xsed -e 's/^-L//'`
-	# We need an absolute path.
-	case $dir in
-	[\\/]* | [A-Za-z]:[\\/]*) ;;
-	*)
-	  absdir=`cd "$dir" && pwd`
-	  if test -z "$absdir"; then
-	    $echo "$modename: cannot determine absolute directory name of \`$dir'" 1>&2
-	    absdir="$dir"
-	    notinst_path="$notinst_path $dir"
-	  fi
-	  dir="$absdir"
-	  ;;
-	esac
-	case "$deplibs " in
-	*" -L$dir "*) ;;
-	*)
-	  deplibs="$deplibs -L$dir"
-	  lib_search_path="$lib_search_path $dir"
-	  ;;
-	esac
-	case $host in
-	*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*)
-	  testbindir=`$echo "X$dir" | $Xsed -e 's*/lib$*/bin*'`
-	  case :$dllsearchpath: in
-	  *":$dir:"*) ;;
-	  *) dllsearchpath="$dllsearchpath:$dir";;
-	  esac
-	  case :$dllsearchpath: in
-	  *":$testbindir:"*) ;;
-	  *) dllsearchpath="$dllsearchpath:$testbindir";;
-	  esac
-	  ;;
-	esac
-	continue
-	;;
-
-      -l*)
-	if test "X$arg" = "X-lc" || test "X$arg" = "X-lm"; then
-	  case $host in
-	  *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-beos*)
-	    # These systems don't actually have a C or math library (as such)
-	    continue
-	    ;;
-	  *-*-os2*)
-	    # These systems don't actually have a C library (as such)
-	    test "X$arg" = "X-lc" && continue
-	    ;;
-	  *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*)
-	    # Do not include libc due to us having libc/libc_r.
-	    test "X$arg" = "X-lc" && continue
-	    ;;
-	  *-*-rhapsody* | *-*-darwin1.[012])
-	    # Rhapsody C and math libraries are in the System framework
-	    deplibs="$deplibs -framework System"
-	    continue
-	    ;;
-	  *-*-sco3.2v5* | *-*-sco5v6*)
-	    # Causes problems with __ctype
-	    test "X$arg" = "X-lc" && continue
-	    ;;
-	  *-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*)
-	    # Compiler inserts libc in the correct place for threads to work
-	    test "X$arg" = "X-lc" && continue
-	    ;;
-	  esac
-	elif test "X$arg" = "X-lc_r"; then
-	 case $host in
-	 *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*)
-	   # Do not include libc_r directly, use -pthread flag.
-	   continue
-	   ;;
-	 esac
-	fi
-	deplibs="$deplibs $arg"
-	continue
-	;;
-
-      # Tru64 UNIX uses -model [arg] to determine the layout of C++
-      # classes, name mangling, and exception handling.
-      -model)
-	compile_command="$compile_command $arg"
-	compiler_flags="$compiler_flags $arg"
-	finalize_command="$finalize_command $arg"
-	prev=xcompiler
-	continue
-	;;
-
-     -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe)
-	compiler_flags="$compiler_flags $arg"
-	compile_command="$compile_command $arg"
-	finalize_command="$finalize_command $arg"
-	deplibs="$deplibs $arg"
-	continue
-	;;
-
-      -module)
-	module=yes
-	continue
-	;;
-
-      # -64, -mips[0-9] enable 64-bit mode on the SGI compiler
-      # -r[0-9][0-9]* specifies the processor on the SGI compiler
-      # -xarch=*, -xtarget=* enable 64-bit mode on the Sun compiler
-      # +DA*, +DD* enable 64-bit mode on the HP compiler
-      # -q* pass through compiler args for the IBM compiler
-      # -m* pass through architecture-specific compiler args for GCC
-      # -m*, -t[45]*, -txscale* pass through architecture-specific
-      # compiler args for GCC
-      # -pg pass through profiling flag for GCC
-      # @file GCC response files
-      -64|-mips[0-9]|-r[0-9][0-9]*|-xarch=*|-xtarget=*|+DA*|+DD*|-q*|-m*|-pg| \
-      -t[45]*|-txscale*|@*)
-
-	# Unknown arguments in both finalize_command and compile_command need
-	# to be aesthetically quoted because they are evaled later.
-	arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
-	case $arg in
-	*[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \	]*|*]*|"")
-	  arg="\"$arg\""
-	  ;;
-	esac
-        compile_command="$compile_command $arg"
-        finalize_command="$finalize_command $arg"
-        compiler_flags="$compiler_flags $arg"
-        continue
-        ;;
-
-      -shrext)
-	prev=shrext
-	continue
-	;;
-
-      -no-fast-install)
-	fast_install=no
-	continue
-	;;
-
-      -no-install)
-	case $host in
-	*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*)
-	  # The PATH hackery in wrapper scripts is required on Windows
-	  # in order for the loader to find any dlls it needs.
-	  $echo "$modename: warning: \`-no-install' is ignored for $host" 1>&2
-	  $echo "$modename: warning: assuming \`-no-fast-install' instead" 1>&2
-	  fast_install=no
-	  ;;
-	*) no_install=yes ;;
-	esac
-	continue
-	;;
-
-      -no-undefined)
-	allow_undefined=no
-	continue
-	;;
-
-      -objectlist)
-	prev=objectlist
-	continue
-	;;
-
-      -o) prev=output ;;
-
-      -precious-files-regex)
-	prev=precious_regex
-	continue
-	;;
-
-      -release)
-	prev=release
-	continue
-	;;
-
-      -rpath)
-	prev=rpath
-	continue
-	;;
-
-      -R)
-	prev=xrpath
-	continue
-	;;
-
-      -R*)
-	dir=`$echo "X$arg" | $Xsed -e 's/^-R//'`
-	# We need an absolute path.
-	case $dir in
-	[\\/]* | [A-Za-z]:[\\/]*) ;;
-	*)
-	  $echo "$modename: only absolute run-paths are allowed" 1>&2
-	  exit $EXIT_FAILURE
-	  ;;
-	esac
-	case "$xrpath " in
-	*" $dir "*) ;;
-	*) xrpath="$xrpath $dir" ;;
-	esac
-	continue
-	;;
-
-      -static)
-	# The effects of -static are defined in a previous loop.
-	# We used to do the same as -all-static on platforms that
-	# didn't have a PIC flag, but the assumption that the effects
-	# would be equivalent was wrong.  It would break on at least
-	# Digital Unix and AIX.
-	continue
-	;;
-
-      -thread-safe)
-	thread_safe=yes
-	continue
-	;;
-
-      -version-info)
-	prev=vinfo
-	continue
-	;;
-      -version-number)
-	prev=vinfo
-	vinfo_number=yes
-	continue
-	;;
-
-      -Wc,*)
-	args=`$echo "X$arg" | $Xsed -e "$sed_quote_subst" -e 's/^-Wc,//'`
-	arg=
-	save_ifs="$IFS"; IFS=','
-	for flag in $args; do
-	  IFS="$save_ifs"
-	  case $flag in
-	    *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \	]*|*]*|"")
-	    flag="\"$flag\""
-	    ;;
-	  esac
-	  arg="$arg $wl$flag"
-	  compiler_flags="$compiler_flags $flag"
-	done
-	IFS="$save_ifs"
-	arg=`$echo "X$arg" | $Xsed -e "s/^ //"`
-	;;
-
-      -Wl,*)
-	args=`$echo "X$arg" | $Xsed -e "$sed_quote_subst" -e 's/^-Wl,//'`
-	arg=
-	save_ifs="$IFS"; IFS=','
-	for flag in $args; do
-	  IFS="$save_ifs"
-	  case $flag in
-	    *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \	]*|*]*|"")
-	    flag="\"$flag\""
-	    ;;
-	  esac
-	  arg="$arg $wl$flag"
-	  compiler_flags="$compiler_flags $wl$flag"
-	  linker_flags="$linker_flags $flag"
-	done
-	IFS="$save_ifs"
-	arg=`$echo "X$arg" | $Xsed -e "s/^ //"`
-	;;
-
-      -Xcompiler)
-	prev=xcompiler
-	continue
-	;;
-
-      -Xlinker)
-	prev=xlinker
-	continue
-	;;
-
-      -XCClinker)
-	prev=xcclinker
-	continue
-	;;
-
-      # Some other compiler flag.
-      -* | +*)
-	# Unknown arguments in both finalize_command and compile_command need
-	# to be aesthetically quoted because they are evaled later.
-	arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
-	case $arg in
-	*[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \	]*|*]*|"")
-	  arg="\"$arg\""
-	  ;;
-	esac
-	;;
-
-      *.$objext)
-	# A standard object.
-	objs="$objs $arg"
-	;;
-
-      *.lo)
-	# A libtool-controlled object.
-
-	# Check to see that this really is a libtool object.
-	if (${SED} -e '2q' $arg | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
-	  pic_object=
-	  non_pic_object=
-
-	  # Read the .lo file
-	  # If there is no directory component, then add one.
-	  case $arg in
-	  */* | *\\*) . $arg ;;
-	  *) . ./$arg ;;
-	  esac
-
-	  if test -z "$pic_object" || \
-	     test -z "$non_pic_object" ||
-	     test "$pic_object" = none && \
-	     test "$non_pic_object" = none; then
-	    $echo "$modename: cannot find name of object for \`$arg'" 1>&2
-	    exit $EXIT_FAILURE
-	  fi
-
-	  # Extract subdirectory from the argument.
-	  xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'`
-	  if test "X$xdir" = "X$arg"; then
-	    xdir=
- 	  else
-	    xdir="$xdir/"
-	  fi
-
-	  if test "$pic_object" != none; then
-	    # Prepend the subdirectory the object is found in.
-	    pic_object="$xdir$pic_object"
-
-	    if test "$prev" = dlfiles; then
-	      if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then
-		dlfiles="$dlfiles $pic_object"
-		prev=
-		continue
-	      else
-		# If libtool objects are unsupported, then we need to preload.
-		prev=dlprefiles
-	      fi
-	    fi
-
-	    # CHECK ME:  I think I busted this.  -Ossama
-	    if test "$prev" = dlprefiles; then
-	      # Preload the old-style object.
-	      dlprefiles="$dlprefiles $pic_object"
-	      prev=
-	    fi
-
-	    # A PIC object.
-	    libobjs="$libobjs $pic_object"
-	    arg="$pic_object"
-	  fi
-
-	  # Non-PIC object.
-	  if test "$non_pic_object" != none; then
-	    # Prepend the subdirectory the object is found in.
-	    non_pic_object="$xdir$non_pic_object"
-
-	    # A standard non-PIC object
-	    non_pic_objects="$non_pic_objects $non_pic_object"
-	    if test -z "$pic_object" || test "$pic_object" = none ; then
-	      arg="$non_pic_object"
-	    fi
-	  else
-	    # If the PIC object exists, use it instead.
-	    # $xdir was prepended to $pic_object above.
-	    non_pic_object="$pic_object"
-	    non_pic_objects="$non_pic_objects $non_pic_object"
-	  fi
-	else
-	  # Only an error if not doing a dry-run.
-	  if test -z "$run"; then
-	    $echo "$modename: \`$arg' is not a valid libtool object" 1>&2
-	    exit $EXIT_FAILURE
-	  else
-	    # Dry-run case.
-
-	    # Extract subdirectory from the argument.
-	    xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'`
-	    if test "X$xdir" = "X$arg"; then
-	      xdir=
-	    else
-	      xdir="$xdir/"
-	    fi
-
-	    pic_object=`$echo "X${xdir}${objdir}/${arg}" | $Xsed -e "$lo2o"`
-	    non_pic_object=`$echo "X${xdir}${arg}" | $Xsed -e "$lo2o"`
-	    libobjs="$libobjs $pic_object"
-	    non_pic_objects="$non_pic_objects $non_pic_object"
-	  fi
-	fi
-	;;
-
-      *.$libext)
-	# An archive.
-	deplibs="$deplibs $arg"
-	old_deplibs="$old_deplibs $arg"
-	continue
-	;;
-
-      *.la)
-	# A libtool-controlled library.
-
-	if test "$prev" = dlfiles; then
-	  # This library was specified with -dlopen.
-	  dlfiles="$dlfiles $arg"
-	  prev=
-	elif test "$prev" = dlprefiles; then
-	  # The library was specified with -dlpreopen.
-	  dlprefiles="$dlprefiles $arg"
-	  prev=
-	else
-	  deplibs="$deplibs $arg"
-	fi
-	continue
-	;;
-
-      # Some other compiler argument.
-      *)
-	# Unknown arguments in both finalize_command and compile_command need
-	# to be aesthetically quoted because they are evaled later.
-	arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
-	case $arg in
-	*[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \	]*|*]*|"")
-	  arg="\"$arg\""
-	  ;;
-	esac
-	;;
-      esac # arg
-
-      # Now actually substitute the argument into the commands.
-      if test -n "$arg"; then
-	compile_command="$compile_command $arg"
-	finalize_command="$finalize_command $arg"
-      fi
-    done # argument parsing loop
-
-    if test -n "$prev"; then
-      $echo "$modename: the \`$prevarg' option requires an argument" 1>&2
-      $echo "$help" 1>&2
-      exit $EXIT_FAILURE
-    fi
-
-    if test "$export_dynamic" = yes && test -n "$export_dynamic_flag_spec"; then
-      eval arg=\"$export_dynamic_flag_spec\"
-      compile_command="$compile_command $arg"
-      finalize_command="$finalize_command $arg"
-    fi
-
-    oldlibs=
-    # calculate the name of the file, without its directory
-    outputname=`$echo "X$output" | $Xsed -e 's%^.*/%%'`
-    libobjs_save="$libobjs"
-
-    if test -n "$shlibpath_var"; then
-      # get the directories listed in $shlibpath_var
-      eval shlib_search_path=\`\$echo \"X\${$shlibpath_var}\" \| \$Xsed -e \'s/:/ /g\'\`
-    else
-      shlib_search_path=
-    fi
-    eval sys_lib_search_path=\"$sys_lib_search_path_spec\"
-    eval sys_lib_dlsearch_path=\"$sys_lib_dlsearch_path_spec\"
-
-    output_objdir=`$echo "X$output" | $Xsed -e 's%/[^/]*$%%'`
-    if test "X$output_objdir" = "X$output"; then
-      output_objdir="$objdir"
-    else
-      output_objdir="$output_objdir/$objdir"
-    fi
-    # Create the object directory.
-    if test ! -d "$output_objdir"; then
-      $show "$mkdir $output_objdir"
-      $run $mkdir $output_objdir
-      exit_status=$?
-      if test "$exit_status" -ne 0 && test ! -d "$output_objdir"; then
-	exit $exit_status
-      fi
-    fi
-
-    # Determine the type of output
-    case $output in
-    "")
-      $echo "$modename: you must specify an output file" 1>&2
-      $echo "$help" 1>&2
-      exit $EXIT_FAILURE
-      ;;
-    *.$libext) linkmode=oldlib ;;
-    *.lo | *.$objext) linkmode=obj ;;
-    *.la) linkmode=lib ;;
-    *) linkmode=prog ;; # Anything else should be a program.
-    esac
-
-    case $host in
-    *cygwin* | *mingw* | *pw32*)
-      # don't eliminate duplications in $postdeps and $predeps
-      duplicate_compiler_generated_deps=yes
-      ;;
-    *)
-      duplicate_compiler_generated_deps=$duplicate_deps
-      ;;
-    esac
-    specialdeplibs=
-
-    libs=
-    # Find all interdependent deplibs by searching for libraries
-    # that are linked more than once (e.g. -la -lb -la)
-    for deplib in $deplibs; do
-      if test "X$duplicate_deps" = "Xyes" ; then
-	case "$libs " in
-	*" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
-	esac
-      fi
-      libs="$libs $deplib"
-    done
-
-    if test "$linkmode" = lib; then
-      libs="$predeps $libs $compiler_lib_search_path $postdeps"
-
-      # Compute libraries that are listed more than once in $predeps
-      # $postdeps and mark them as special (i.e., whose duplicates are
-      # not to be eliminated).
-      pre_post_deps=
-      if test "X$duplicate_compiler_generated_deps" = "Xyes" ; then
-	for pre_post_dep in $predeps $postdeps; do
-	  case "$pre_post_deps " in
-	  *" $pre_post_dep "*) specialdeplibs="$specialdeplibs $pre_post_deps" ;;
-	  esac
-	  pre_post_deps="$pre_post_deps $pre_post_dep"
-	done
-      fi
-      pre_post_deps=
-    fi
-
-    deplibs=
-    newdependency_libs=
-    newlib_search_path=
-    need_relink=no # whether we're linking any uninstalled libtool libraries
-    notinst_deplibs= # not-installed libtool libraries
-    case $linkmode in
-    lib)
-	passes="conv link"
-	for file in $dlfiles $dlprefiles; do
-	  case $file in
-	  *.la) ;;
-	  *)
-	    $echo "$modename: libraries can \`-dlopen' only libtool libraries: $file" 1>&2
-	    exit $EXIT_FAILURE
-	    ;;
-	  esac
-	done
-	;;
-    prog)
-	compile_deplibs=
-	finalize_deplibs=
-	alldeplibs=no
-	newdlfiles=
-	newdlprefiles=
-	passes="conv scan dlopen dlpreopen link"
-	;;
-    *)  passes="conv"
-	;;
-    esac
-    for pass in $passes; do
-      if test "$linkmode,$pass" = "lib,link" ||
-	 test "$linkmode,$pass" = "prog,scan"; then
-	libs="$deplibs"
-	deplibs=
-      fi
-      if test "$linkmode" = prog; then
-	case $pass in
-	dlopen) libs="$dlfiles" ;;
-	dlpreopen) libs="$dlprefiles" ;;
-	link) libs="$deplibs %DEPLIBS% $dependency_libs" ;;
-	esac
-      fi
-      if test "$pass" = dlopen; then
-	# Collect dlpreopened libraries
-	save_deplibs="$deplibs"
-	deplibs=
-      fi
-      for deplib in $libs; do
-	lib=
-	found=no
-	case $deplib in
-	-mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe)
-	  if test "$linkmode,$pass" = "prog,link"; then
-	    compile_deplibs="$deplib $compile_deplibs"
-	    finalize_deplibs="$deplib $finalize_deplibs"
-	  else
-	    compiler_flags="$compiler_flags $deplib"
-	  fi
-
-	  case $linkmode in
-	  lib)
-	    deplibs="$deplib $deplibs"
-	    test "$pass" = conv && continue
-	    newdependency_libs="$deplib $newdependency_libs"
-	    ;;
-	  prog)
-	    if test "$pass" = conv; then
-	      deplibs="$deplib $deplibs"
-	      continue
-	    fi
-	    if test "$pass" = scan; then
-	      deplibs="$deplib $deplibs"
-	    else
-	      compile_deplibs="$deplib $compile_deplibs"
-	      finalize_deplibs="$deplib $finalize_deplibs"
-	    fi
-	    ;;
-	  *)
-	    ;;
-	  esac # linkmode
-
-	  continue
-	  ;;
-	-l*)
-	  if test "$linkmode" != lib && test "$linkmode" != prog; then
-	    $echo "$modename: warning: \`-l' is ignored for archives/objects" 1>&2
-	    continue
-	  fi
-	  name=`$echo "X$deplib" | $Xsed -e 's/^-l//'`
-	  for searchdir in $newlib_search_path $lib_search_path $sys_lib_search_path $shlib_search_path; do
-	    for search_ext in .la $std_shrext .so .a; do
-	      # Search the libtool library
-	      lib="$searchdir/lib${name}${search_ext}"
-	      if test -f "$lib"; then
-		if test "$search_ext" = ".la"; then
-		  found=yes
-		else
-		  found=no
-		fi
-		break 2
-	      fi
-	    done
-	  done
-	  if test "$found" != yes; then
-	    # deplib doesn't seem to be a libtool library
-	    if test "$linkmode,$pass" = "prog,link"; then
-	      compile_deplibs="$deplib $compile_deplibs"
-	      finalize_deplibs="$deplib $finalize_deplibs"
-	    else
-	      deplibs="$deplib $deplibs"
-	      test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs"
-	    fi
-	    continue
-	  else # deplib is a libtool library
-	    # If $allow_libtool_libs_with_static_runtimes && $deplib is a stdlib,
-	    # We need to do some special things here, and not later.
-	    if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
-	      case " $predeps $postdeps " in
-	      *" $deplib "*)
-		if (${SED} -e '2q' $lib |
-                    grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
-		  library_names=
-		  old_library=
-		  case $lib in
-		  */* | *\\*) . $lib ;;
-		  *) . ./$lib ;;
-		  esac
-		  for l in $old_library $library_names; do
-		    ll="$l"
-		  done
-		  if test "X$ll" = "X$old_library" ; then # only static version available
-		    found=no
-		    ladir=`$echo "X$lib" | $Xsed -e 's%/[^/]*$%%'`
-		    test "X$ladir" = "X$lib" && ladir="."
-		    lib=$ladir/$old_library
-		    if test "$linkmode,$pass" = "prog,link"; then
-		      compile_deplibs="$deplib $compile_deplibs"
-		      finalize_deplibs="$deplib $finalize_deplibs"
-		    else
-		      deplibs="$deplib $deplibs"
-		      test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs"
-		    fi
-		    continue
-		  fi
-		fi
-	        ;;
-	      *) ;;
-	      esac
-	    fi
-	  fi
-	  ;; # -l
-	-L*)
-	  case $linkmode in
-	  lib)
-	    deplibs="$deplib $deplibs"
-	    test "$pass" = conv && continue
-	    newdependency_libs="$deplib $newdependency_libs"
-	    newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`
-	    ;;
-	  prog)
-	    if test "$pass" = conv; then
-	      deplibs="$deplib $deplibs"
-	      continue
-	    fi
-	    if test "$pass" = scan; then
-	      deplibs="$deplib $deplibs"
-	    else
-	      compile_deplibs="$deplib $compile_deplibs"
-	      finalize_deplibs="$deplib $finalize_deplibs"
-	    fi
-	    newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`
-	    ;;
-	  *)
-	    $echo "$modename: warning: \`-L' is ignored for archives/objects" 1>&2
-	    ;;
-	  esac # linkmode
-	  continue
-	  ;; # -L
-	-R*)
-	  if test "$pass" = link; then
-	    dir=`$echo "X$deplib" | $Xsed -e 's/^-R//'`
-	    # Make sure the xrpath contains only unique directories.
-	    case "$xrpath " in
-	    *" $dir "*) ;;
-	    *) xrpath="$xrpath $dir" ;;
-	    esac
-	  fi
-	  deplibs="$deplib $deplibs"
-	  continue
-	  ;;
-	*.la) lib="$deplib" ;;
-	*.$libext)
-	  if test "$pass" = conv; then
-	    deplibs="$deplib $deplibs"
-	    continue
-	  fi
-	  case $linkmode in
-	  lib)
-	    valid_a_lib=no
-	    case $deplibs_check_method in
-	      match_pattern*)
-		set dummy $deplibs_check_method
-	        match_pattern_regex=`expr "$deplibs_check_method" : "$2 \(.*\)"`
-		if eval $echo \"$deplib\" 2>/dev/null \
-		    | $SED 10q \
-		    | $EGREP "$match_pattern_regex" > /dev/null; then
-		  valid_a_lib=yes
-		fi
-		;;
-	      pass_all)
-		valid_a_lib=yes
-		;;
-            esac
-	    if test "$valid_a_lib" != yes; then
-	      $echo
-	      $echo "*** Warning: Trying to link with static lib archive $deplib."
-	      $echo "*** I have the capability to make that library automatically link in when"
-	      $echo "*** you link to this library.  But I can only do this if you have a"
-	      $echo "*** shared version of the library, which you do not appear to have"
-	      $echo "*** because the file extensions .$libext of this argument makes me believe"
-	      $echo "*** that it is just a static archive that I should not used here."
-	    else
-	      $echo
-	      $echo "*** Warning: Linking the shared library $output against the"
-	      $echo "*** static library $deplib is not portable!"
-	      deplibs="$deplib $deplibs"
-	    fi
-	    continue
-	    ;;
-	  prog)
-	    if test "$pass" != link; then
-	      deplibs="$deplib $deplibs"
-	    else
-	      compile_deplibs="$deplib $compile_deplibs"
-	      finalize_deplibs="$deplib $finalize_deplibs"
-	    fi
-	    continue
-	    ;;
-	  esac # linkmode
-	  ;; # *.$libext
-	*.lo | *.$objext)
-	  if test "$pass" = conv; then
-	    deplibs="$deplib $deplibs"
-	  elif test "$linkmode" = prog; then
-	    if test "$pass" = dlpreopen || test "$dlopen_support" != yes || test "$build_libtool_libs" = no; then
-	      # If there is no dlopen support or we're linking statically,
-	      # we need to preload.
-	      newdlprefiles="$newdlprefiles $deplib"
-	      compile_deplibs="$deplib $compile_deplibs"
-	      finalize_deplibs="$deplib $finalize_deplibs"
-	    else
-	      newdlfiles="$newdlfiles $deplib"
-	    fi
-	  fi
-	  continue
-	  ;;
-	%DEPLIBS%)
-	  alldeplibs=yes
-	  continue
-	  ;;
-	esac # case $deplib
-	if test "$found" = yes || test -f "$lib"; then :
-	else
-	  $echo "$modename: cannot find the library \`$lib' or unhandled argument \`$deplib'" 1>&2
-	  exit $EXIT_FAILURE
-	fi
-
-	# Check to see that this really is a libtool archive.
-	if (${SED} -e '2q' $lib | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then :
-	else
-	  $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
-	  exit $EXIT_FAILURE
-	fi
-
-	ladir=`$echo "X$lib" | $Xsed -e 's%/[^/]*$%%'`
-	test "X$ladir" = "X$lib" && ladir="."
-
-	dlname=
-	dlopen=
-	dlpreopen=
-	libdir=
-	library_names=
-	old_library=
-	# If the library was installed with an old release of libtool,
-	# it will not redefine variables installed, or shouldnotlink
-	installed=yes
-	shouldnotlink=no
-	avoidtemprpath=
-
-
-	# Read the .la file
-	case $lib in
-	*/* | *\\*) . $lib ;;
-	*) . ./$lib ;;
-	esac
-
-	if test "$linkmode,$pass" = "lib,link" ||
-	   test "$linkmode,$pass" = "prog,scan" ||
-	   { test "$linkmode" != prog && test "$linkmode" != lib; }; then
-	  test -n "$dlopen" && dlfiles="$dlfiles $dlopen"
-	  test -n "$dlpreopen" && dlprefiles="$dlprefiles $dlpreopen"
-	fi
-
-	if test "$pass" = conv; then
-	  # Only check for convenience libraries
-	  deplibs="$lib $deplibs"
-	  if test -z "$libdir"; then
-	    if test -z "$old_library"; then
-	      $echo "$modename: cannot find name of link library for \`$lib'" 1>&2
-	      exit $EXIT_FAILURE
-	    fi
-	    # It is a libtool convenience library, so add in its objects.
-	    convenience="$convenience $ladir/$objdir/$old_library"
-	    old_convenience="$old_convenience $ladir/$objdir/$old_library"
-	    tmp_libs=
-	    for deplib in $dependency_libs; do
-	      deplibs="$deplib $deplibs"
-              if test "X$duplicate_deps" = "Xyes" ; then
-	        case "$tmp_libs " in
-	        *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
-	        esac
-              fi
-	      tmp_libs="$tmp_libs $deplib"
-	    done
-	  elif test "$linkmode" != prog && test "$linkmode" != lib; then
-	    $echo "$modename: \`$lib' is not a convenience library" 1>&2
-	    exit $EXIT_FAILURE
-	  fi
-	  continue
-	fi # $pass = conv
-
-
-	# Get the name of the library we link against.
-	linklib=
-	for l in $old_library $library_names; do
-	  linklib="$l"
-	done
-	if test -z "$linklib"; then
-	  $echo "$modename: cannot find name of link library for \`$lib'" 1>&2
-	  exit $EXIT_FAILURE
-	fi
-
-	# This library was specified with -dlopen.
-	if test "$pass" = dlopen; then
-	  if test -z "$libdir"; then
-	    $echo "$modename: cannot -dlopen a convenience library: \`$lib'" 1>&2
-	    exit $EXIT_FAILURE
-	  fi
-	  if test -z "$dlname" ||
-	     test "$dlopen_support" != yes ||
-	     test "$build_libtool_libs" = no; then
-	    # If there is no dlname, no dlopen support or we're linking
-	    # statically, we need to preload.  We also need to preload any
-	    # dependent libraries so libltdl's deplib preloader doesn't
-	    # bomb out in the load deplibs phase.
-	    dlprefiles="$dlprefiles $lib $dependency_libs"
-	  else
-	    newdlfiles="$newdlfiles $lib"
-	  fi
-	  continue
-	fi # $pass = dlopen
-
-	# We need an absolute path.
-	case $ladir in
-	[\\/]* | [A-Za-z]:[\\/]*) abs_ladir="$ladir" ;;
-	*)
-	  abs_ladir=`cd "$ladir" && pwd`
-	  if test -z "$abs_ladir"; then
-	    $echo "$modename: warning: cannot determine absolute directory name of \`$ladir'" 1>&2
-	    $echo "$modename: passing it literally to the linker, although it might fail" 1>&2
-	    abs_ladir="$ladir"
-	  fi
-	  ;;
-	esac
-	laname=`$echo "X$lib" | $Xsed -e 's%^.*/%%'`
-
-	# Find the relevant object directory and library name.
-	if test "X$installed" = Xyes; then
-	  if test ! -f "$libdir/$linklib" && test -f "$abs_ladir/$linklib"; then
-	    $echo "$modename: warning: library \`$lib' was moved." 1>&2
-	    dir="$ladir"
-	    absdir="$abs_ladir"
-	    libdir="$abs_ladir"
-	  else
-	    dir="$libdir"
-	    absdir="$libdir"
-	  fi
-	  test "X$hardcode_automatic" = Xyes && avoidtemprpath=yes
-	else
-	  if test ! -f "$ladir/$objdir/$linklib" && test -f "$abs_ladir/$linklib"; then
-	    dir="$ladir"
-	    absdir="$abs_ladir"
-	    # Remove this search path later
-	    notinst_path="$notinst_path $abs_ladir"
-	  else
-	    dir="$ladir/$objdir"
-	    absdir="$abs_ladir/$objdir"
-	    # Remove this search path later
-	    notinst_path="$notinst_path $abs_ladir"
-	  fi
-	fi # $installed = yes
-	name=`$echo "X$laname" | $Xsed -e 's/\.la$//' -e 's/^lib//'`
-
-	# This library was specified with -dlpreopen.
-	if test "$pass" = dlpreopen; then
-	  if test -z "$libdir"; then
-	    $echo "$modename: cannot -dlpreopen a convenience library: \`$lib'" 1>&2
-	    exit $EXIT_FAILURE
-	  fi
-	  # Prefer using a static library (so that no silly _DYNAMIC symbols
-	  # are required to link).
-	  if test -n "$old_library"; then
-	    newdlprefiles="$newdlprefiles $dir/$old_library"
-	  # Otherwise, use the dlname, so that lt_dlopen finds it.
-	  elif test -n "$dlname"; then
-	    newdlprefiles="$newdlprefiles $dir/$dlname"
-	  else
-	    newdlprefiles="$newdlprefiles $dir/$linklib"
-	  fi
-	fi # $pass = dlpreopen
-
-	if test -z "$libdir"; then
-	  # Link the convenience library
-	  if test "$linkmode" = lib; then
-	    deplibs="$dir/$old_library $deplibs"
-	  elif test "$linkmode,$pass" = "prog,link"; then
-	    compile_deplibs="$dir/$old_library $compile_deplibs"
-	    finalize_deplibs="$dir/$old_library $finalize_deplibs"
-	  else
-	    deplibs="$lib $deplibs" # used for prog,scan pass
-	  fi
-	  continue
-	fi
-
-
-	if test "$linkmode" = prog && test "$pass" != link; then
-	  newlib_search_path="$newlib_search_path $ladir"
-	  deplibs="$lib $deplibs"
-
-	  linkalldeplibs=no
-	  if test "$link_all_deplibs" != no || test -z "$library_names" ||
-	     test "$build_libtool_libs" = no; then
-	    linkalldeplibs=yes
-	  fi
-
-	  tmp_libs=
-	  for deplib in $dependency_libs; do
-	    case $deplib in
-	    -L*) newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`;; ### testsuite: skip nested quoting test
-	    esac
-	    # Need to link against all dependency_libs?
-	    if test "$linkalldeplibs" = yes; then
-	      deplibs="$deplib $deplibs"
-	    else
-	      # Need to hardcode shared library paths
-	      # or/and link against static libraries
-	      newdependency_libs="$deplib $newdependency_libs"
-	    fi
-	    if test "X$duplicate_deps" = "Xyes" ; then
-	      case "$tmp_libs " in
-	      *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
-	      esac
-	    fi
-	    tmp_libs="$tmp_libs $deplib"
-	  done # for deplib
-	  continue
-	fi # $linkmode = prog...
-
-	if test "$linkmode,$pass" = "prog,link"; then
-	  if test -n "$library_names" &&
-	     { test "$prefer_static_libs" = no || test -z "$old_library"; }; then
-	    # We need to hardcode the library path
-	    if test -n "$shlibpath_var" && test -z "$avoidtemprpath" ; then
-	      # Make sure the rpath contains only unique directories.
-	      case "$temp_rpath " in
-	      *" $dir "*) ;;
-	      *" $absdir "*) ;;
-	      *) temp_rpath="$temp_rpath $absdir" ;;
-	      esac
-	    fi
-
-	    # Hardcode the library path.
-	    # Skip directories that are in the system default run-time
-	    # search path.
-	    case " $sys_lib_dlsearch_path " in
-	    *" $absdir "*) ;;
-	    *)
-	      case "$compile_rpath " in
-	      *" $absdir "*) ;;
-	      *) compile_rpath="$compile_rpath $absdir"
-	      esac
-	      ;;
-	    esac
-	    case " $sys_lib_dlsearch_path " in
-	    *" $libdir "*) ;;
-	    *)
-	      case "$finalize_rpath " in
-	      *" $libdir "*) ;;
-	      *) finalize_rpath="$finalize_rpath $libdir"
-	      esac
-	      ;;
-	    esac
-	  fi # $linkmode,$pass = prog,link...
-
-	  if test "$alldeplibs" = yes &&
-	     { test "$deplibs_check_method" = pass_all ||
-	       { test "$build_libtool_libs" = yes &&
-		 test -n "$library_names"; }; }; then
-	    # We only need to search for static libraries
-	    continue
-	  fi
-	fi
-
-	link_static=no # Whether the deplib will be linked statically
-	use_static_libs=$prefer_static_libs
-	if test "$use_static_libs" = built && test "$installed" = yes ; then
-	  use_static_libs=no
-	fi
-	if test -n "$library_names" &&
-	   { test "$use_static_libs" = no || test -z "$old_library"; }; then
-	  if test "$installed" = no; then
-	    notinst_deplibs="$notinst_deplibs $lib"
-	    need_relink=yes
-	  fi
-	  # This is a shared library
-
-	  # Warn about portability, can't link against -module's on
-	  # some systems (darwin)
-	  if test "$shouldnotlink" = yes && test "$pass" = link ; then
-	    $echo
-	    if test "$linkmode" = prog; then
-	      $echo "*** Warning: Linking the executable $output against the loadable module"
-	    else
-	      $echo "*** Warning: Linking the shared library $output against the loadable module"
-	    fi
-	    $echo "*** $linklib is not portable!"
-	  fi
-	  if test "$linkmode" = lib &&
-	     test "$hardcode_into_libs" = yes; then
-	    # Hardcode the library path.
-	    # Skip directories that are in the system default run-time
-	    # search path.
-	    case " $sys_lib_dlsearch_path " in
-	    *" $absdir "*) ;;
-	    *)
-	      case "$compile_rpath " in
-	      *" $absdir "*) ;;
-	      *) compile_rpath="$compile_rpath $absdir"
-	      esac
-	      ;;
-	    esac
-	    case " $sys_lib_dlsearch_path " in
-	    *" $libdir "*) ;;
-	    *)
-	      case "$finalize_rpath " in
-	      *" $libdir "*) ;;
-	      *) finalize_rpath="$finalize_rpath $libdir"
-	      esac
-	      ;;
-	    esac
-	  fi
-
-	  if test -n "$old_archive_from_expsyms_cmds"; then
-	    # figure out the soname
-	    set dummy $library_names
-	    realname="$2"
-	    shift; shift
-	    libname=`eval \\$echo \"$libname_spec\"`
-	    # use dlname if we got it. it's perfectly good, no?
-	    if test -n "$dlname"; then
-	      soname="$dlname"
-	    elif test -n "$soname_spec"; then
-	      # bleh windows
-	      case $host in
-	      *cygwin* | mingw*)
-		major=`expr $current - $age`
-		versuffix="-$major"
-		;;
-	      esac
-	      eval soname=\"$soname_spec\"
-	    else
-	      soname="$realname"
-	    fi
-
-	    # Make a new name for the extract_expsyms_cmds to use
-	    soroot="$soname"
-	    soname=`$echo $soroot | ${SED} -e 's/^.*\///'`
-	    newlib="libimp-`$echo $soname | ${SED} 's/^lib//;s/\.dll$//'`.a"
-
-	    # If the library has no export list, then create one now
-	    if test -f "$output_objdir/$soname-def"; then :
-	    else
-	      $show "extracting exported symbol list from \`$soname'"
-	      save_ifs="$IFS"; IFS='~'
-	      cmds=$extract_expsyms_cmds
-	      for cmd in $cmds; do
-		IFS="$save_ifs"
-		eval cmd=\"$cmd\"
-		$show "$cmd"
-		$run eval "$cmd" || exit $?
-	      done
-	      IFS="$save_ifs"
-	    fi
-
-	    # Create $newlib
-	    if test -f "$output_objdir/$newlib"; then :; else
-	      $show "generating import library for \`$soname'"
-	      save_ifs="$IFS"; IFS='~'
-	      cmds=$old_archive_from_expsyms_cmds
-	      for cmd in $cmds; do
-		IFS="$save_ifs"
-		eval cmd=\"$cmd\"
-		$show "$cmd"
-		$run eval "$cmd" || exit $?
-	      done
-	      IFS="$save_ifs"
-	    fi
-	    # make sure the library variables are pointing to the new library
-	    dir=$output_objdir
-	    linklib=$newlib
-	  fi # test -n "$old_archive_from_expsyms_cmds"
-
-	  if test "$linkmode" = prog || test "$mode" != relink; then
-	    add_shlibpath=
-	    add_dir=
-	    add=
-	    lib_linked=yes
-	    case $hardcode_action in
-	    immediate | unsupported)
-	      if test "$hardcode_direct" = no; then
-		add="$dir/$linklib"
-		case $host in
-		  *-*-sco3.2v5.0.[024]*) add_dir="-L$dir" ;;
-		  *-*-sysv4*uw2*) add_dir="-L$dir" ;;
-		  *-*-sysv5OpenUNIX* | *-*-sysv5UnixWare7.[01].[10]* | \
-		    *-*-unixware7*) add_dir="-L$dir" ;;
-		  *-*-darwin* )
-		    # if the lib is a module then we can not link against
-		    # it, someone is ignoring the new warnings I added
-		    if /usr/bin/file -L $add 2> /dev/null |
-                      $EGREP ": [^:]* bundle" >/dev/null ; then
-		      $echo "** Warning, lib $linklib is a module, not a shared library"
-		      if test -z "$old_library" ; then
-		        $echo
-		        $echo "** And there doesn't seem to be a static archive available"
-		        $echo "** The link will probably fail, sorry"
-		      else
-		        add="$dir/$old_library"
-		      fi
-		    fi
-		esac
-	      elif test "$hardcode_minus_L" = no; then
-		case $host in
-		*-*-sunos*) add_shlibpath="$dir" ;;
-		esac
-		add_dir="-L$dir"
-		add="-l$name"
-	      elif test "$hardcode_shlibpath_var" = no; then
-		add_shlibpath="$dir"
-		add="-l$name"
-	      else
-		lib_linked=no
-	      fi
-	      ;;
-	    relink)
-	      if test "$hardcode_direct" = yes; then
-		add="$dir/$linklib"
-	      elif test "$hardcode_minus_L" = yes; then
-		add_dir="-L$dir"
-		# Try looking first in the location we're being installed to.
-		if test -n "$inst_prefix_dir"; then
-		  case $libdir in
-		    [\\/]*)
-		      add_dir="$add_dir -L$inst_prefix_dir$libdir"
-		      ;;
-		  esac
-		fi
-		add="-l$name"
-	      elif test "$hardcode_shlibpath_var" = yes; then
-		add_shlibpath="$dir"
-		add="-l$name"
-	      else
-		lib_linked=no
-	      fi
-	      ;;
-	    *) lib_linked=no ;;
-	    esac
-
-	    if test "$lib_linked" != yes; then
-	      $echo "$modename: configuration error: unsupported hardcode properties"
-	      exit $EXIT_FAILURE
-	    fi
-
-	    if test -n "$add_shlibpath"; then
-	      case :$compile_shlibpath: in
-	      *":$add_shlibpath:"*) ;;
-	      *) compile_shlibpath="$compile_shlibpath$add_shlibpath:" ;;
-	      esac
-	    fi
-	    if test "$linkmode" = prog; then
-	      test -n "$add_dir" && compile_deplibs="$add_dir $compile_deplibs"
-	      test -n "$add" && compile_deplibs="$add $compile_deplibs"
-	    else
-	      test -n "$add_dir" && deplibs="$add_dir $deplibs"
-	      test -n "$add" && deplibs="$add $deplibs"
-	      if test "$hardcode_direct" != yes && \
-		 test "$hardcode_minus_L" != yes && \
-		 test "$hardcode_shlibpath_var" = yes; then
-		case :$finalize_shlibpath: in
-		*":$libdir:"*) ;;
-		*) finalize_shlibpath="$finalize_shlibpath$libdir:" ;;
-		esac
-	      fi
-	    fi
-	  fi
-
-	  if test "$linkmode" = prog || test "$mode" = relink; then
-	    add_shlibpath=
-	    add_dir=
-	    add=
-	    # Finalize command for both is simple: just hardcode it.
-	    if test "$hardcode_direct" = yes; then
-	      add="$libdir/$linklib"
-	    elif test "$hardcode_minus_L" = yes; then
-	      add_dir="-L$libdir"
-	      add="-l$name"
-	    elif test "$hardcode_shlibpath_var" = yes; then
-	      case :$finalize_shlibpath: in
-	      *":$libdir:"*) ;;
-	      *) finalize_shlibpath="$finalize_shlibpath$libdir:" ;;
-	      esac
-	      add="-l$name"
-	    elif test "$hardcode_automatic" = yes; then
-	      if test -n "$inst_prefix_dir" &&
-		 test -f "$inst_prefix_dir$libdir/$linklib" ; then
-	        add="$inst_prefix_dir$libdir/$linklib"
-	      else
-	        add="$libdir/$linklib"
-	      fi
-	    else
-	      # We cannot seem to hardcode it, guess we'll fake it.
-	      add_dir="-L$libdir"
-	      # Try looking first in the location we're being installed to.
-	      if test -n "$inst_prefix_dir"; then
-		case $libdir in
-		  [\\/]*)
-		    add_dir="$add_dir -L$inst_prefix_dir$libdir"
-		    ;;
-		esac
-	      fi
-	      add="-l$name"
-	    fi
-
-	    if test "$linkmode" = prog; then
-	      test -n "$add_dir" && finalize_deplibs="$add_dir $finalize_deplibs"
-	      test -n "$add" && finalize_deplibs="$add $finalize_deplibs"
-	    else
-	      test -n "$add_dir" && deplibs="$add_dir $deplibs"
-	      test -n "$add" && deplibs="$add $deplibs"
-	    fi
-	  fi
-	elif test "$linkmode" = prog; then
-	  # Here we assume that one of hardcode_direct or hardcode_minus_L
-	  # is not unsupported.  This is valid on all known static and
-	  # shared platforms.
-	  if test "$hardcode_direct" != unsupported; then
-	    test -n "$old_library" && linklib="$old_library"
-	    compile_deplibs="$dir/$linklib $compile_deplibs"
-	    finalize_deplibs="$dir/$linklib $finalize_deplibs"
-	  else
-	    compile_deplibs="-l$name -L$dir $compile_deplibs"
-	    finalize_deplibs="-l$name -L$dir $finalize_deplibs"
-	  fi
-	elif test "$build_libtool_libs" = yes; then
-	  # Not a shared library
-	  if test "$deplibs_check_method" != pass_all; then
-	    # We're trying link a shared library against a static one
-	    # but the system doesn't support it.
-
-	    # Just print a warning and add the library to dependency_libs so
-	    # that the program can be linked against the static library.
-	    $echo
-	    $echo "*** Warning: This system can not link to static lib archive $lib."
-	    $echo "*** I have the capability to make that library automatically link in when"
-	    $echo "*** you link to this library.  But I can only do this if you have a"
-	    $echo "*** shared version of the library, which you do not appear to have."
-	    if test "$module" = yes; then
-	      $echo "*** But as you try to build a module library, libtool will still create "
-	      $echo "*** a static module, that should work as long as the dlopening application"
-	      $echo "*** is linked with the -dlopen flag to resolve symbols at runtime."
-	      if test -z "$global_symbol_pipe"; then
-		$echo
-		$echo "*** However, this would only work if libtool was able to extract symbol"
-		$echo "*** lists from a program, using \`nm' or equivalent, but libtool could"
-		$echo "*** not find such a program.  So, this module is probably useless."
-		$echo "*** \`nm' from GNU binutils and a full rebuild may help."
-	      fi
-	      if test "$build_old_libs" = no; then
-		build_libtool_libs=module
-		build_old_libs=yes
-	      else
-		build_libtool_libs=no
-	      fi
-	    fi
-	  else
-	    deplibs="$dir/$old_library $deplibs"
-	    link_static=yes
-	  fi
-	fi # link shared/static library?
-
-	if test "$linkmode" = lib; then
-	  if test -n "$dependency_libs" &&
-	     { test "$hardcode_into_libs" != yes ||
-	       test "$build_old_libs" = yes ||
-	       test "$link_static" = yes; }; then
-	    # Extract -R from dependency_libs
-	    temp_deplibs=
-	    for libdir in $dependency_libs; do
-	      case $libdir in
-	      -R*) temp_xrpath=`$echo "X$libdir" | $Xsed -e 's/^-R//'`
-		   case " $xrpath " in
-		   *" $temp_xrpath "*) ;;
-		   *) xrpath="$xrpath $temp_xrpath";;
-		   esac;;
-	      *) temp_deplibs="$temp_deplibs $libdir";;
-	      esac
-	    done
-	    dependency_libs="$temp_deplibs"
-	  fi
-
-	  newlib_search_path="$newlib_search_path $absdir"
-	  # Link against this library
-	  test "$link_static" = no && newdependency_libs="$abs_ladir/$laname $newdependency_libs"
-	  # ... and its dependency_libs
-	  tmp_libs=
-	  for deplib in $dependency_libs; do
-	    newdependency_libs="$deplib $newdependency_libs"
-	    if test "X$duplicate_deps" = "Xyes" ; then
-	      case "$tmp_libs " in
-	      *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
-	      esac
-	    fi
-	    tmp_libs="$tmp_libs $deplib"
-	  done
-
-	  if test "$link_all_deplibs" != no; then
-	    # Add the search paths of all dependency libraries
-	    for deplib in $dependency_libs; do
-	      case $deplib in
-	      -L*) path="$deplib" ;;
-	      *.la)
-		dir=`$echo "X$deplib" | $Xsed -e 's%/[^/]*$%%'`
-		test "X$dir" = "X$deplib" && dir="."
-		# We need an absolute path.
-		case $dir in
-		[\\/]* | [A-Za-z]:[\\/]*) absdir="$dir" ;;
-		*)
-		  absdir=`cd "$dir" && pwd`
-		  if test -z "$absdir"; then
-		    $echo "$modename: warning: cannot determine absolute directory name of \`$dir'" 1>&2
-		    absdir="$dir"
-		  fi
-		  ;;
-		esac
-		if grep "^installed=no" $deplib > /dev/null; then
-		  path="$absdir/$objdir"
-		else
-		  eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib`
-		  if test -z "$libdir"; then
-		    $echo "$modename: \`$deplib' is not a valid libtool archive" 1>&2
-		    exit $EXIT_FAILURE
-		  fi
-		  if test "$absdir" != "$libdir"; then
-		    $echo "$modename: warning: \`$deplib' seems to be moved" 1>&2
-		  fi
-		  path="$absdir"
-		fi
-		depdepl=
-		case $host in
-		*-*-darwin*)
-		  # we do not want to link against static libs,
-		  # but need to link against shared
-		  eval deplibrary_names=`${SED} -n -e 's/^library_names=\(.*\)$/\1/p' $deplib`
-		  if test -n "$deplibrary_names" ; then
-		    for tmp in $deplibrary_names ; do
-		      depdepl=$tmp
-		    done
-		    if test -f "$path/$depdepl" ; then
-		      depdepl="$path/$depdepl"
-		    fi
-		    # do not add paths which are already there
-		    case " $newlib_search_path " in
-		    *" $path "*) ;;
-		    *) newlib_search_path="$newlib_search_path $path";;
-		    esac
-		  fi
-		  path=""
-		  ;;
-		*)
-		  path="-L$path"
-		  ;;
-		esac
-		;;
-	      -l*)
-		case $host in
-		*-*-darwin*)
-		  # Again, we only want to link against shared libraries
-		  eval tmp_libs=`$echo "X$deplib" | $Xsed -e "s,^\-l,,"`
-		  for tmp in $newlib_search_path ; do
-		    if test -f "$tmp/lib$tmp_libs.dylib" ; then
-		      eval depdepl="$tmp/lib$tmp_libs.dylib"
-		      break
-		    fi
-		  done
-		  path=""
-		  ;;
-		*) continue ;;
-		esac
-		;;
-	      *) continue ;;
-	      esac
-	      case " $deplibs " in
-	      *" $path "*) ;;
-	      *) deplibs="$path $deplibs" ;;
-	      esac
-	      case " $deplibs " in
-	      *" $depdepl "*) ;;
-	      *) deplibs="$depdepl $deplibs" ;;
-	      esac
-	    done
-	  fi # link_all_deplibs != no
-	fi # linkmode = lib
-      done # for deplib in $libs
-      dependency_libs="$newdependency_libs"
-      if test "$pass" = dlpreopen; then
-	# Link the dlpreopened libraries before other libraries
-	for deplib in $save_deplibs; do
-	  deplibs="$deplib $deplibs"
-	done
-      fi
-      if test "$pass" != dlopen; then
-	if test "$pass" != conv; then
-	  # Make sure lib_search_path contains only unique directories.
-	  lib_search_path=
-	  for dir in $newlib_search_path; do
-	    case "$lib_search_path " in
-	    *" $dir "*) ;;
-	    *) lib_search_path="$lib_search_path $dir" ;;
-	    esac
-	  done
-	  newlib_search_path=
-	fi
-
-	if test "$linkmode,$pass" != "prog,link"; then
-	  vars="deplibs"
-	else
-	  vars="compile_deplibs finalize_deplibs"
-	fi
-	for var in $vars dependency_libs; do
-	  # Add libraries to $var in reverse order
-	  eval tmp_libs=\"\$$var\"
-	  new_libs=
-	  for deplib in $tmp_libs; do
-	    # FIXME: Pedantically, this is the right thing to do, so
-	    #        that some nasty dependency loop isn't accidentally
-	    #        broken:
-	    #new_libs="$deplib $new_libs"
-	    # Pragmatically, this seems to cause very few problems in
-	    # practice:
-	    case $deplib in
-	    -L*) new_libs="$deplib $new_libs" ;;
-	    -R*) ;;
-	    *)
-	      # And here is the reason: when a library appears more
-	      # than once as an explicit dependence of a library, or
-	      # is implicitly linked in more than once by the
-	      # compiler, it is considered special, and multiple
-	      # occurrences thereof are not removed.  Compare this
-	      # with having the same library being listed as a
-	      # dependency of multiple other libraries: in this case,
-	      # we know (pedantically, we assume) the library does not
-	      # need to be listed more than once, so we keep only the
-	      # last copy.  This is not always right, but it is rare
-	      # enough that we require users that really mean to play
-	      # such unportable linking tricks to link the library
-	      # using -Wl,-lname, so that libtool does not consider it
-	      # for duplicate removal.
-	      case " $specialdeplibs " in
-	      *" $deplib "*) new_libs="$deplib $new_libs" ;;
-	      *)
-		case " $new_libs " in
-		*" $deplib "*) ;;
-		*) new_libs="$deplib $new_libs" ;;
-		esac
-		;;
-	      esac
-	      ;;
-	    esac
-	  done
-	  tmp_libs=
-	  for deplib in $new_libs; do
-	    case $deplib in
-	    -L*)
-	      case " $tmp_libs " in
-	      *" $deplib "*) ;;
-	      *) tmp_libs="$tmp_libs $deplib" ;;
-	      esac
-	      ;;
-	    *) tmp_libs="$tmp_libs $deplib" ;;
-	    esac
-	  done
-	  eval $var=\"$tmp_libs\"
-	done # for var
-      fi
-      # Last step: remove runtime libs from dependency_libs
-      # (they stay in deplibs)
-      tmp_libs=
-      for i in $dependency_libs ; do
-	case " $predeps $postdeps $compiler_lib_search_path " in
-	*" $i "*)
-	  i=""
-	  ;;
-	esac
-	if test -n "$i" ; then
-	  tmp_libs="$tmp_libs $i"
-	fi
-      done
-      dependency_libs=$tmp_libs
-    done # for pass
-    if test "$linkmode" = prog; then
-      dlfiles="$newdlfiles"
-      dlprefiles="$newdlprefiles"
-    fi
-
-    case $linkmode in
-    oldlib)
-      if test -n "$deplibs"; then
-	$echo "$modename: warning: \`-l' and \`-L' are ignored for archives" 1>&2
-      fi
-
-      if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
-	$echo "$modename: warning: \`-dlopen' is ignored for archives" 1>&2
-      fi
-
-      if test -n "$rpath"; then
-	$echo "$modename: warning: \`-rpath' is ignored for archives" 1>&2
-      fi
-
-      if test -n "$xrpath"; then
-	$echo "$modename: warning: \`-R' is ignored for archives" 1>&2
-      fi
-
-      if test -n "$vinfo"; then
-	$echo "$modename: warning: \`-version-info/-version-number' is ignored for archives" 1>&2
-      fi
-
-      if test -n "$release"; then
-	$echo "$modename: warning: \`-release' is ignored for archives" 1>&2
-      fi
-
-      if test -n "$export_symbols" || test -n "$export_symbols_regex"; then
-	$echo "$modename: warning: \`-export-symbols' is ignored for archives" 1>&2
-      fi
-
-      # Now set the variables for building old libraries.
-      build_libtool_libs=no
-      oldlibs="$output"
-      objs="$objs$old_deplibs"
-      ;;
-
-    lib)
-      # Make sure we only generate libraries of the form `libNAME.la'.
-      case $outputname in
-      lib*)
-	name=`$echo "X$outputname" | $Xsed -e 's/\.la$//' -e 's/^lib//'`
-	eval shared_ext=\"$shrext_cmds\"
-	eval libname=\"$libname_spec\"
-	;;
-      *)
-	if test "$module" = no; then
-	  $echo "$modename: libtool library \`$output' must begin with \`lib'" 1>&2
-	  $echo "$help" 1>&2
-	  exit $EXIT_FAILURE
-	fi
-	if test "$need_lib_prefix" != no; then
-	  # Add the "lib" prefix for modules if required
-	  name=`$echo "X$outputname" | $Xsed -e 's/\.la$//'`
-	  eval shared_ext=\"$shrext_cmds\"
-	  eval libname=\"$libname_spec\"
-	else
-	  libname=`$echo "X$outputname" | $Xsed -e 's/\.la$//'`
-	fi
-	;;
-      esac
-
-      if test -n "$objs"; then
-	if test "$deplibs_check_method" != pass_all; then
-	  $echo "$modename: cannot build libtool library \`$output' from non-libtool objects on this host:$objs" 2>&1
-	  exit $EXIT_FAILURE
-	else
-	  $echo
-	  $echo "*** Warning: Linking the shared library $output against the non-libtool"
-	  $echo "*** objects $objs is not portable!"
-	  libobjs="$libobjs $objs"
-	fi
-      fi
-
-      if test "$dlself" != no; then
-	$echo "$modename: warning: \`-dlopen self' is ignored for libtool libraries" 1>&2
-      fi
-
-      set dummy $rpath
-      if test "$#" -gt 2; then
-	$echo "$modename: warning: ignoring multiple \`-rpath's for a libtool library" 1>&2
-      fi
-      install_libdir="$2"
-
-      oldlibs=
-      if test -z "$rpath"; then
-	if test "$build_libtool_libs" = yes; then
-	  # Building a libtool convenience library.
-	  # Some compilers have problems with a `.al' extension so
-	  # convenience libraries should have the same extension an
-	  # archive normally would.
-	  oldlibs="$output_objdir/$libname.$libext $oldlibs"
-	  build_libtool_libs=convenience
-	  build_old_libs=yes
-	fi
-
-	if test -n "$vinfo"; then
-	  $echo "$modename: warning: \`-version-info/-version-number' is ignored for convenience libraries" 1>&2
-	fi
-
-	if test -n "$release"; then
-	  $echo "$modename: warning: \`-release' is ignored for convenience libraries" 1>&2
-	fi
-      else
-
-	# Parse the version information argument.
-	save_ifs="$IFS"; IFS=':'
-	set dummy $vinfo 0 0 0
-	IFS="$save_ifs"
-
-	if test -n "$8"; then
-	  $echo "$modename: too many parameters to \`-version-info'" 1>&2
-	  $echo "$help" 1>&2
-	  exit $EXIT_FAILURE
-	fi
-
-	# convert absolute version numbers to libtool ages
-	# this retains compatibility with .la files and attempts
-	# to make the code below a bit more comprehensible
-
-	case $vinfo_number in
-	yes)
-	  number_major="$2"
-	  number_minor="$3"
-	  number_revision="$4"
-	  #
-	  # There are really only two kinds -- those that
-	  # use the current revision as the major version
-	  # and those that subtract age and use age as
-	  # a minor version.  But, then there is irix
-	  # which has an extra 1 added just for fun
-	  #
-	  case $version_type in
-	  darwin|linux|osf|windows)
-	    current=`expr $number_major + $number_minor`
-	    age="$number_minor"
-	    revision="$number_revision"
-	    ;;
-	  freebsd-aout|freebsd-elf|sunos)
-	    current="$number_major"
-	    revision="$number_minor"
-	    age="0"
-	    ;;
-	  irix|nonstopux)
-	    current=`expr $number_major + $number_minor - 1`
-	    age="$number_minor"
-	    revision="$number_minor"
-	    ;;
-	  esac
-	  ;;
-	no)
-	  current="$2"
-	  revision="$3"
-	  age="$4"
-	  ;;
-	esac
-
-	# Check that each of the things are valid numbers.
-	case $current in
-	0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;;
-	*)
-	  $echo "$modename: CURRENT \`$current' must be a nonnegative integer" 1>&2
-	  $echo "$modename: \`$vinfo' is not valid version information" 1>&2
-	  exit $EXIT_FAILURE
-	  ;;
-	esac
-
-	case $revision in
-	0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;;
-	*)
-	  $echo "$modename: REVISION \`$revision' must be a nonnegative integer" 1>&2
-	  $echo "$modename: \`$vinfo' is not valid version information" 1>&2
-	  exit $EXIT_FAILURE
-	  ;;
-	esac
-
-	case $age in
-	0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;;
-	*)
-	  $echo "$modename: AGE \`$age' must be a nonnegative integer" 1>&2
-	  $echo "$modename: \`$vinfo' is not valid version information" 1>&2
-	  exit $EXIT_FAILURE
-	  ;;
-	esac
-
-	if test "$age" -gt "$current"; then
-	  $echo "$modename: AGE \`$age' is greater than the current interface number \`$current'" 1>&2
-	  $echo "$modename: \`$vinfo' is not valid version information" 1>&2
-	  exit $EXIT_FAILURE
-	fi
-
-	# Calculate the version variables.
-	major=
-	versuffix=
-	verstring=
-	case $version_type in
-	none) ;;
-
-	darwin)
-	  # Like Linux, but with the current version available in
-	  # verstring for coding it into the library header
-	  major=.`expr $current - $age`
-	  versuffix="$major.$age.$revision"
-	  # Darwin ld doesn't like 0 for these options...
-	  minor_current=`expr $current + 1`
-	  verstring="${wl}-compatibility_version ${wl}$minor_current ${wl}-current_version ${wl}$minor_current.$revision"
-	  ;;
-
-	freebsd-aout)
-	  major=".$current"
-	  versuffix=".$current.$revision";
-	  ;;
-
-	freebsd-elf)
-	  major=".$current"
-	  versuffix=".$current";
-	  ;;
-
-	irix | nonstopux)
-	  major=`expr $current - $age + 1`
-
-	  case $version_type in
-	    nonstopux) verstring_prefix=nonstopux ;;
-	    *)         verstring_prefix=sgi ;;
-	  esac
-	  verstring="$verstring_prefix$major.$revision"
-
-	  # Add in all the interfaces that we are compatible with.
-	  loop=$revision
-	  while test "$loop" -ne 0; do
-	    iface=`expr $revision - $loop`
-	    loop=`expr $loop - 1`
-	    verstring="$verstring_prefix$major.$iface:$verstring"
-	  done
-
-	  # Before this point, $major must not contain `.'.
-	  major=.$major
-	  versuffix="$major.$revision"
-	  ;;
-
-	linux)
-	  major=.`expr $current - $age`
-	  versuffix="$major.$age.$revision"
-	  ;;
-
-	osf)
-	  major=.`expr $current - $age`
-	  versuffix=".$current.$age.$revision"
-	  verstring="$current.$age.$revision"
-
-	  # Add in all the interfaces that we are compatible with.
-	  loop=$age
-	  while test "$loop" -ne 0; do
-	    iface=`expr $current - $loop`
-	    loop=`expr $loop - 1`
-	    verstring="$verstring:${iface}.0"
-	  done
-
-	  # Make executables depend on our current version.
-	  verstring="$verstring:${current}.0"
-	  ;;
-
-	sunos)
-	  major=".$current"
-	  versuffix=".$current.$revision"
-	  ;;
-
-	windows)
-	  # Use '-' rather than '.', since we only want one
-	  # extension on DOS 8.3 filesystems.
-	  major=`expr $current - $age`
-	  versuffix="-$major"
-	  ;;
-
-	*)
-	  $echo "$modename: unknown library version type \`$version_type'" 1>&2
-	  $echo "Fatal configuration error.  See the $PACKAGE docs for more information." 1>&2
-	  exit $EXIT_FAILURE
-	  ;;
-	esac
-
-	# Clear the version info if we defaulted, and they specified a release.
-	if test -z "$vinfo" && test -n "$release"; then
-	  major=
-	  case $version_type in
-	  darwin)
-	    # we can't check for "0.0" in archive_cmds due to quoting
-	    # problems, so we reset it completely
-	    verstring=
-	    ;;
-	  *)
-	    verstring="0.0"
-	    ;;
-	  esac
-	  if test "$need_version" = no; then
-	    versuffix=
-	  else
-	    versuffix=".0.0"
-	  fi
-	fi
-
-	# Remove version info from name if versioning should be avoided
-	if test "$avoid_version" = yes && test "$need_version" = no; then
-	  major=
-	  versuffix=
-	  verstring=""
-	fi
-
-	# Check to see if the archive will have undefined symbols.
-	if test "$allow_undefined" = yes; then
-	  if test "$allow_undefined_flag" = unsupported; then
-	    $echo "$modename: warning: undefined symbols not allowed in $host shared libraries" 1>&2
-	    build_libtool_libs=no
-	    build_old_libs=yes
-	  fi
-	else
-	  # Don't allow undefined symbols.
-	  allow_undefined_flag="$no_undefined_flag"
-	fi
-      fi
-
-      if test "$mode" != relink; then
-	# Remove our outputs, but don't remove object files since they
-	# may have been created when compiling PIC objects.
-	removelist=
-	tempremovelist=`$echo "$output_objdir/*"`
-	for p in $tempremovelist; do
-	  case $p in
-	    *.$objext)
-	       ;;
-	    $output_objdir/$outputname | $output_objdir/$libname.* | $output_objdir/${libname}${release}.*)
-	       if test "X$precious_files_regex" != "X"; then
-	         if echo $p | $EGREP -e "$precious_files_regex" >/dev/null 2>&1
-	         then
-		   continue
-		 fi
-	       fi
-	       removelist="$removelist $p"
-	       ;;
-	    *) ;;
-	  esac
-	done
-	if test -n "$removelist"; then
-	  $show "${rm}r $removelist"
-	  $run ${rm}r $removelist
-	fi
-      fi
-
-      # Now set the variables for building old libraries.
-      if test "$build_old_libs" = yes && test "$build_libtool_libs" != convenience ; then
-	oldlibs="$oldlibs $output_objdir/$libname.$libext"
-
-	# Transform .lo files to .o files.
-	oldobjs="$objs "`$echo "X$libobjs" | $SP2NL | $Xsed -e '/\.'${libext}'$/d' -e "$lo2o" | $NL2SP`
-      fi
-
-      # Eliminate all temporary directories.
-      for path in $notinst_path; do
-	lib_search_path=`$echo "$lib_search_path " | ${SED} -e "s% $path % %g"`
-	deplibs=`$echo "$deplibs " | ${SED} -e "s% -L$path % %g"`
-	dependency_libs=`$echo "$dependency_libs " | ${SED} -e "s% -L$path % %g"`
-      done
-
-      if test -n "$xrpath"; then
-	# If the user specified any rpath flags, then add them.
-	temp_xrpath=
-	for libdir in $xrpath; do
-	  temp_xrpath="$temp_xrpath -R$libdir"
-	  case "$finalize_rpath " in
-	  *" $libdir "*) ;;
-	  *) finalize_rpath="$finalize_rpath $libdir" ;;
-	  esac
-	done
-	if test "$hardcode_into_libs" != yes || test "$build_old_libs" = yes; then
-	  dependency_libs="$temp_xrpath $dependency_libs"
-	fi
-      fi
-
-      # Make sure dlfiles contains only unique files that won't be dlpreopened
-      old_dlfiles="$dlfiles"
-      dlfiles=
-      for lib in $old_dlfiles; do
-	case " $dlprefiles $dlfiles " in
-	*" $lib "*) ;;
-	*) dlfiles="$dlfiles $lib" ;;
-	esac
-      done
-
-      # Make sure dlprefiles contains only unique files
-      old_dlprefiles="$dlprefiles"
-      dlprefiles=
-      for lib in $old_dlprefiles; do
-	case "$dlprefiles " in
-	*" $lib "*) ;;
-	*) dlprefiles="$dlprefiles $lib" ;;
-	esac
-      done
-
-      if test "$build_libtool_libs" = yes; then
-	if test -n "$rpath"; then
-	  case $host in
-	  *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-beos*)
-	    # these systems don't actually have a c library (as such)!
-	    ;;
-	  *-*-rhapsody* | *-*-darwin1.[012])
-	    # Rhapsody C library is in the System framework
-	    deplibs="$deplibs -framework System"
-	    ;;
-	  *-*-netbsd*)
-	    # Don't link with libc until the a.out ld.so is fixed.
-	    ;;
-	  *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*)
-	    # Do not include libc due to us having libc/libc_r.
-	    ;;
-	  *-*-sco3.2v5* | *-*-sco5v6*)
-	    # Causes problems with __ctype
-	    ;;
-	  *-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*)
-	    # Compiler inserts libc in the correct place for threads to work
-	    ;;
- 	  *)
-	    # Add libc to deplibs on all other systems if necessary.
-	    if test "$build_libtool_need_lc" = "yes"; then
-	      deplibs="$deplibs -lc"
-	    fi
-	    ;;
-	  esac
-	fi
-
-	# Transform deplibs into only deplibs that can be linked in shared.
-	name_save=$name
-	libname_save=$libname
-	release_save=$release
-	versuffix_save=$versuffix
-	major_save=$major
-	# I'm not sure if I'm treating the release correctly.  I think
-	# release should show up in the -l (ie -lgmp5) so we don't want to
-	# add it in twice.  Is that correct?
-	release=""
-	versuffix=""
-	major=""
-	newdeplibs=
-	droppeddeps=no
-	case $deplibs_check_method in
-	pass_all)
-	  # Don't check for shared/static.  Everything works.
-	  # This might be a little naive.  We might want to check
-	  # whether the library exists or not.  But this is on
-	  # osf3 & osf4 and I'm not really sure... Just
-	  # implementing what was already the behavior.
-	  newdeplibs=$deplibs
-	  ;;
-	test_compile)
-	  # This code stresses the "libraries are programs" paradigm to its
-	  # limits. Maybe even breaks it.  We compile a program, linking it
-	  # against the deplibs as a proxy for the library.  Then we can check
-	  # whether they linked in statically or dynamically with ldd.
-	  $rm conftest.c
-	  cat > conftest.c <<EOF
-	  int main() { return 0; }
-EOF
-	  $rm conftest
-	  $LTCC $LTCFLAGS -o conftest conftest.c $deplibs
-	  if test "$?" -eq 0 ; then
-	    ldd_output=`ldd conftest`
-	    for i in $deplibs; do
-	      name=`expr $i : '-l\(.*\)'`
-	      # If $name is empty we are operating on a -L argument.
-              if test "$name" != "" && test "$name" -ne "0"; then
-		if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
-		  case " $predeps $postdeps " in
-		  *" $i "*)
-		    newdeplibs="$newdeplibs $i"
-		    i=""
-		    ;;
-		  esac
-	        fi
-		if test -n "$i" ; then
-		  libname=`eval \\$echo \"$libname_spec\"`
-		  deplib_matches=`eval \\$echo \"$library_names_spec\"`
-		  set dummy $deplib_matches
-		  deplib_match=$2
-		  if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then
-		    newdeplibs="$newdeplibs $i"
-		  else
-		    droppeddeps=yes
-		    $echo
-		    $echo "*** Warning: dynamic linker does not accept needed library $i."
-		    $echo "*** I have the capability to make that library automatically link in when"
-		    $echo "*** you link to this library.  But I can only do this if you have a"
-		    $echo "*** shared version of the library, which I believe you do not have"
-		    $echo "*** because a test_compile did reveal that the linker did not use it for"
-		    $echo "*** its dynamic dependency list that programs get resolved with at runtime."
-		  fi
-		fi
-	      else
-		newdeplibs="$newdeplibs $i"
-	      fi
-	    done
-	  else
-	    # Error occurred in the first compile.  Let's try to salvage
-	    # the situation: Compile a separate program for each library.
-	    for i in $deplibs; do
-	      name=`expr $i : '-l\(.*\)'`
-	      # If $name is empty we are operating on a -L argument.
-              if test "$name" != "" && test "$name" != "0"; then
-		$rm conftest
-		$LTCC $LTCFLAGS -o conftest conftest.c $i
-		# Did it work?
-		if test "$?" -eq 0 ; then
-		  ldd_output=`ldd conftest`
-		  if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
-		    case " $predeps $postdeps " in
-		    *" $i "*)
-		      newdeplibs="$newdeplibs $i"
-		      i=""
-		      ;;
-		    esac
-		  fi
-		  if test -n "$i" ; then
-		    libname=`eval \\$echo \"$libname_spec\"`
-		    deplib_matches=`eval \\$echo \"$library_names_spec\"`
-		    set dummy $deplib_matches
-		    deplib_match=$2
-		    if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then
-		      newdeplibs="$newdeplibs $i"
-		    else
-		      droppeddeps=yes
-		      $echo
-		      $echo "*** Warning: dynamic linker does not accept needed library $i."
-		      $echo "*** I have the capability to make that library automatically link in when"
-		      $echo "*** you link to this library.  But I can only do this if you have a"
-		      $echo "*** shared version of the library, which you do not appear to have"
-		      $echo "*** because a test_compile did reveal that the linker did not use this one"
-		      $echo "*** as a dynamic dependency that programs can get resolved with at runtime."
-		    fi
-		  fi
-		else
-		  droppeddeps=yes
-		  $echo
-		  $echo "*** Warning!  Library $i is needed by this library but I was not able to"
-		  $echo "***  make it link in!  You will probably need to install it or some"
-		  $echo "*** library that it depends on before this library will be fully"
-		  $echo "*** functional.  Installing it before continuing would be even better."
-		fi
-	      else
-		newdeplibs="$newdeplibs $i"
-	      fi
-	    done
-	  fi
-	  ;;
-	file_magic*)
-	  set dummy $deplibs_check_method
-	  file_magic_regex=`expr "$deplibs_check_method" : "$2 \(.*\)"`
-	  for a_deplib in $deplibs; do
-	    name=`expr $a_deplib : '-l\(.*\)'`
-	    # If $name is empty we are operating on a -L argument.
-            if test "$name" != "" && test  "$name" != "0"; then
-	      if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
-		case " $predeps $postdeps " in
-		*" $a_deplib "*)
-		  newdeplibs="$newdeplibs $a_deplib"
-		  a_deplib=""
-		  ;;
-		esac
-	      fi
-	      if test -n "$a_deplib" ; then
-		libname=`eval \\$echo \"$libname_spec\"`
-		for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do
-		  potential_libs=`ls $i/$libname[.-]* 2>/dev/null`
-		  for potent_lib in $potential_libs; do
-		      # Follow soft links.
-		      if ls -lLd "$potent_lib" 2>/dev/null \
-			 | grep " -> " >/dev/null; then
-			continue
-		      fi
-		      # The statement above tries to avoid entering an
-		      # endless loop below, in case of cyclic links.
-		      # We might still enter an endless loop, since a link
-		      # loop can be closed while we follow links,
-		      # but so what?
-		      potlib="$potent_lib"
-		      while test -h "$potlib" 2>/dev/null; do
-			potliblink=`ls -ld $potlib | ${SED} 's/.* -> //'`
-			case $potliblink in
-			[\\/]* | [A-Za-z]:[\\/]*) potlib="$potliblink";;
-			*) potlib=`$echo "X$potlib" | $Xsed -e 's,[^/]*$,,'`"$potliblink";;
-			esac
-		      done
-		      if eval $file_magic_cmd \"\$potlib\" 2>/dev/null \
-			 | ${SED} 10q \
-			 | $EGREP "$file_magic_regex" > /dev/null; then
-			newdeplibs="$newdeplibs $a_deplib"
-			a_deplib=""
-			break 2
-		      fi
-		  done
-		done
-	      fi
-	      if test -n "$a_deplib" ; then
-		droppeddeps=yes
-		$echo
-		$echo "*** Warning: linker path does not have real file for library $a_deplib."
-		$echo "*** I have the capability to make that library automatically link in when"
-		$echo "*** you link to this library.  But I can only do this if you have a"
-		$echo "*** shared version of the library, which you do not appear to have"
-		$echo "*** because I did check the linker path looking for a file starting"
-		if test -z "$potlib" ; then
-		  $echo "*** with $libname but no candidates were found. (...for file magic test)"
-		else
-		  $echo "*** with $libname and none of the candidates passed a file format test"
-		  $echo "*** using a file magic. Last file checked: $potlib"
-		fi
-	      fi
-	    else
-	      # Add a -L argument.
-	      newdeplibs="$newdeplibs $a_deplib"
-	    fi
-	  done # Gone through all deplibs.
-	  ;;
-	match_pattern*)
-	  set dummy $deplibs_check_method
-	  match_pattern_regex=`expr "$deplibs_check_method" : "$2 \(.*\)"`
-	  for a_deplib in $deplibs; do
-	    name=`expr $a_deplib : '-l\(.*\)'`
-	    # If $name is empty we are operating on a -L argument.
-	    if test -n "$name" && test "$name" != "0"; then
-	      if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
-		case " $predeps $postdeps " in
-		*" $a_deplib "*)
-		  newdeplibs="$newdeplibs $a_deplib"
-		  a_deplib=""
-		  ;;
-		esac
-	      fi
-	      if test -n "$a_deplib" ; then
-		libname=`eval \\$echo \"$libname_spec\"`
-		for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do
-		  potential_libs=`ls $i/$libname[.-]* 2>/dev/null`
-		  for potent_lib in $potential_libs; do
-		    potlib="$potent_lib" # see symlink-check above in file_magic test
-		    if eval $echo \"$potent_lib\" 2>/dev/null \
-		        | ${SED} 10q \
-		        | $EGREP "$match_pattern_regex" > /dev/null; then
-		      newdeplibs="$newdeplibs $a_deplib"
-		      a_deplib=""
-		      break 2
-		    fi
-		  done
-		done
-	      fi
-	      if test -n "$a_deplib" ; then
-		droppeddeps=yes
-		$echo
-		$echo "*** Warning: linker path does not have real file for library $a_deplib."
-		$echo "*** I have the capability to make that library automatically link in when"
-		$echo "*** you link to this library.  But I can only do this if you have a"
-		$echo "*** shared version of the library, which you do not appear to have"
-		$echo "*** because I did check the linker path looking for a file starting"
-		if test -z "$potlib" ; then
-		  $echo "*** with $libname but no candidates were found. (...for regex pattern test)"
-		else
-		  $echo "*** with $libname and none of the candidates passed a file format test"
-		  $echo "*** using a regex pattern. Last file checked: $potlib"
-		fi
-	      fi
-	    else
-	      # Add a -L argument.
-	      newdeplibs="$newdeplibs $a_deplib"
-	    fi
-	  done # Gone through all deplibs.
-	  ;;
-	none | unknown | *)
-	  newdeplibs=""
-	  tmp_deplibs=`$echo "X $deplibs" | $Xsed -e 's/ -lc$//' \
-	    -e 's/ -[LR][^ ]*//g'`
-	  if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
-	    for i in $predeps $postdeps ; do
-	      # can't use Xsed below, because $i might contain '/'
-	      tmp_deplibs=`$echo "X $tmp_deplibs" | ${SED} -e "1s,^X,," -e "s,$i,,"`
-	    done
-	  fi
-	  if $echo "X $tmp_deplibs" | $Xsed -e 's/[ 	]//g' \
-	    | grep . >/dev/null; then
-	    $echo
-	    if test "X$deplibs_check_method" = "Xnone"; then
-	      $echo "*** Warning: inter-library dependencies are not supported in this platform."
-	    else
-	      $echo "*** Warning: inter-library dependencies are not known to be supported."
-	    fi
-	    $echo "*** All declared inter-library dependencies are being dropped."
-	    droppeddeps=yes
-	  fi
-	  ;;
-	esac
-	versuffix=$versuffix_save
-	major=$major_save
-	release=$release_save
-	libname=$libname_save
-	name=$name_save
-
-	case $host in
-	*-*-rhapsody* | *-*-darwin1.[012])
-	  # On Rhapsody replace the C library is the System framework
-	  newdeplibs=`$echo "X $newdeplibs" | $Xsed -e 's/ -lc / -framework System /'`
-	  ;;
-	esac
-
-	if test "$droppeddeps" = yes; then
-	  if test "$module" = yes; then
-	    $echo
-	    $echo "*** Warning: libtool could not satisfy all declared inter-library"
-	    $echo "*** dependencies of module $libname.  Therefore, libtool will create"
-	    $echo "*** a static module, that should work as long as the dlopening"
-	    $echo "*** application is linked with the -dlopen flag."
-	    if test -z "$global_symbol_pipe"; then
-	      $echo
-	      $echo "*** However, this would only work if libtool was able to extract symbol"
-	      $echo "*** lists from a program, using \`nm' or equivalent, but libtool could"
-	      $echo "*** not find such a program.  So, this module is probably useless."
-	      $echo "*** \`nm' from GNU binutils and a full rebuild may help."
-	    fi
-	    if test "$build_old_libs" = no; then
-	      oldlibs="$output_objdir/$libname.$libext"
-	      build_libtool_libs=module
-	      build_old_libs=yes
-	    else
-	      build_libtool_libs=no
-	    fi
-	  else
-	    $echo "*** The inter-library dependencies that have been dropped here will be"
-	    $echo "*** automatically added whenever a program is linked with this library"
-	    $echo "*** or is declared to -dlopen it."
-
-	    if test "$allow_undefined" = no; then
-	      $echo
-	      $echo "*** Since this library must not contain undefined symbols,"
-	      $echo "*** because either the platform does not support them or"
-	      $echo "*** it was explicitly requested with -no-undefined,"
-	      $echo "*** libtool will only create a static version of it."
-	      if test "$build_old_libs" = no; then
-		oldlibs="$output_objdir/$libname.$libext"
-		build_libtool_libs=module
-		build_old_libs=yes
-	      else
-		build_libtool_libs=no
-	      fi
-	    fi
-	  fi
-	fi
-	# Done checking deplibs!
-	deplibs=$newdeplibs
-      fi
-
-
-      # move library search paths that coincide with paths to not yet
-      # installed libraries to the beginning of the library search list
-      new_libs=
-      for path in $notinst_path; do
-	case " $new_libs " in
-	*" -L$path/$objdir "*) ;;
-	*)
-	  case " $deplibs " in
-	  *" -L$path/$objdir "*)
-	    new_libs="$new_libs -L$path/$objdir" ;;
-	  esac
-	  ;;
-	esac
-      done
-      for deplib in $deplibs; do
-	case $deplib in
-	-L*)
-	  case " $new_libs " in
-	  *" $deplib "*) ;;
-	  *) new_libs="$new_libs $deplib" ;;
-	  esac
-	  ;;
-	*) new_libs="$new_libs $deplib" ;;
-	esac
-      done
-      deplibs="$new_libs"
-
-
-      # All the library-specific variables (install_libdir is set above).
-      library_names=
-      old_library=
-      dlname=
-
-      # Test again, we may have decided not to build it any more
-      if test "$build_libtool_libs" = yes; then
-	if test "$hardcode_into_libs" = yes; then
-	  # Hardcode the library paths
-	  hardcode_libdirs=
-	  dep_rpath=
-	  rpath="$finalize_rpath"
-	  test "$mode" != relink && rpath="$compile_rpath$rpath"
-	  for libdir in $rpath; do
-	    if test -n "$hardcode_libdir_flag_spec"; then
-	      if test -n "$hardcode_libdir_separator"; then
-		if test -z "$hardcode_libdirs"; then
-		  hardcode_libdirs="$libdir"
-		else
-		  # Just accumulate the unique libdirs.
-		  case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
-		  *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
-		    ;;
-		  *)
-		    hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir"
-		    ;;
-		  esac
-		fi
-	      else
-		eval flag=\"$hardcode_libdir_flag_spec\"
-		dep_rpath="$dep_rpath $flag"
-	      fi
-	    elif test -n "$runpath_var"; then
-	      case "$perm_rpath " in
-	      *" $libdir "*) ;;
-	      *) perm_rpath="$perm_rpath $libdir" ;;
-	      esac
-	    fi
-	  done
-	  # Substitute the hardcoded libdirs into the rpath.
-	  if test -n "$hardcode_libdir_separator" &&
-	     test -n "$hardcode_libdirs"; then
-	    libdir="$hardcode_libdirs"
-	    if test -n "$hardcode_libdir_flag_spec_ld"; then
-	      eval dep_rpath=\"$hardcode_libdir_flag_spec_ld\"
-	    else
-	      eval dep_rpath=\"$hardcode_libdir_flag_spec\"
-	    fi
-	  fi
-	  if test -n "$runpath_var" && test -n "$perm_rpath"; then
-	    # We should set the runpath_var.
-	    rpath=
-	    for dir in $perm_rpath; do
-	      rpath="$rpath$dir:"
-	    done
-	    eval "$runpath_var='$rpath\$$runpath_var'; export $runpath_var"
-	  fi
-	  test -n "$dep_rpath" && deplibs="$dep_rpath $deplibs"
-	fi
-
-	shlibpath="$finalize_shlibpath"
-	test "$mode" != relink && shlibpath="$compile_shlibpath$shlibpath"
-	if test -n "$shlibpath"; then
-	  eval "$shlibpath_var='$shlibpath\$$shlibpath_var'; export $shlibpath_var"
-	fi
-
-	# Get the real and link names of the library.
-	eval shared_ext=\"$shrext_cmds\"
-	eval library_names=\"$library_names_spec\"
-	set dummy $library_names
-	realname="$2"
-	shift; shift
-
-	if test -n "$soname_spec"; then
-	  eval soname=\"$soname_spec\"
-	else
-	  soname="$realname"
-	fi
-	if test -z "$dlname"; then
-	  dlname=$soname
-	fi
-
-	lib="$output_objdir/$realname"
-	linknames=
-	for link
-	do
-	  linknames="$linknames $link"
-	done
-
-	# Use standard objects if they are pic
-	test -z "$pic_flag" && libobjs=`$echo "X$libobjs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
-
-	# Prepare the list of exported symbols
-	if test -z "$export_symbols"; then
-	  if test "$always_export_symbols" = yes || test -n "$export_symbols_regex"; then
-	    $show "generating symbol list for \`$libname.la'"
-	    export_symbols="$output_objdir/$libname.exp"
-	    $run $rm $export_symbols
-	    cmds=$export_symbols_cmds
-	    save_ifs="$IFS"; IFS='~'
-	    for cmd in $cmds; do
-	      IFS="$save_ifs"
-	      eval cmd=\"$cmd\"
-	      if len=`expr "X$cmd" : ".*"` &&
-	       test "$len" -le "$max_cmd_len" || test "$max_cmd_len" -le -1; then
-	        $show "$cmd"
-	        $run eval "$cmd" || exit $?
-	        skipped_export=false
-	      else
-	        # The command line is too long to execute in one step.
-	        $show "using reloadable object file for export list..."
-	        skipped_export=:
-		# Break out early, otherwise skipped_export may be
-		# set to false by a later but shorter cmd.
-		break
-	      fi
-	    done
-	    IFS="$save_ifs"
-	    if test -n "$export_symbols_regex"; then
-	      $show "$EGREP -e \"$export_symbols_regex\" \"$export_symbols\" > \"${export_symbols}T\""
-	      $run eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"'
-	      $show "$mv \"${export_symbols}T\" \"$export_symbols\""
-	      $run eval '$mv "${export_symbols}T" "$export_symbols"'
-	    fi
-	  fi
-	fi
-
-	if test -n "$export_symbols" && test -n "$include_expsyms"; then
-	  $run eval '$echo "X$include_expsyms" | $SP2NL >> "$export_symbols"'
-	fi
-
-	tmp_deplibs=
-	for test_deplib in $deplibs; do
-		case " $convenience " in
-		*" $test_deplib "*) ;;
-		*)
-			tmp_deplibs="$tmp_deplibs $test_deplib"
-			;;
-		esac
-	done
-	deplibs="$tmp_deplibs"
-
-	if test -n "$convenience"; then
-	  if test -n "$whole_archive_flag_spec"; then
-	    save_libobjs=$libobjs
-	    eval libobjs=\"\$libobjs $whole_archive_flag_spec\"
-	  else
-	    gentop="$output_objdir/${outputname}x"
-	    generated="$generated $gentop"
-
-	    func_extract_archives $gentop $convenience
-	    libobjs="$libobjs $func_extract_archives_result"
-	  fi
-	fi
-	
-	if test "$thread_safe" = yes && test -n "$thread_safe_flag_spec"; then
-	  eval flag=\"$thread_safe_flag_spec\"
-	  linker_flags="$linker_flags $flag"
-	fi
-
-	# Make a backup of the uninstalled library when relinking
-	if test "$mode" = relink; then
-	  $run eval '(cd $output_objdir && $rm ${realname}U && $mv $realname ${realname}U)' || exit $?
-	fi
-
-	# Do each of the archive commands.
-	if test "$module" = yes && test -n "$module_cmds" ; then
-	  if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then
-	    eval test_cmds=\"$module_expsym_cmds\"
-	    cmds=$module_expsym_cmds
-	  else
-	    eval test_cmds=\"$module_cmds\"
-	    cmds=$module_cmds
-	  fi
-	else
-	if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then
-	  eval test_cmds=\"$archive_expsym_cmds\"
-	  cmds=$archive_expsym_cmds
-	else
-	  eval test_cmds=\"$archive_cmds\"
-	  cmds=$archive_cmds
-	  fi
-	fi
-
-	if test "X$skipped_export" != "X:" &&
-	   len=`expr "X$test_cmds" : ".*" 2>/dev/null` &&
-	   test "$len" -le "$max_cmd_len" || test "$max_cmd_len" -le -1; then
-	  :
-	else
-	  # The command line is too long to link in one step, link piecewise.
-	  $echo "creating reloadable object files..."
-
-	  # Save the value of $output and $libobjs because we want to
-	  # use them later.  If we have whole_archive_flag_spec, we
-	  # want to use save_libobjs as it was before
-	  # whole_archive_flag_spec was expanded, because we can't
-	  # assume the linker understands whole_archive_flag_spec.
-	  # This may have to be revisited, in case too many
-	  # convenience libraries get linked in and end up exceeding
-	  # the spec.
-	  if test -z "$convenience" || test -z "$whole_archive_flag_spec"; then
-	    save_libobjs=$libobjs
-	  fi
-	  save_output=$output
-	  output_la=`$echo "X$output" | $Xsed -e "$basename"`
-
-	  # Clear the reloadable object creation command queue and
-	  # initialize k to one.
-	  test_cmds=
-	  concat_cmds=
-	  objlist=
-	  delfiles=
-	  last_robj=
-	  k=1
-	  output=$output_objdir/$output_la-${k}.$objext
-	  # Loop over the list of objects to be linked.
-	  for obj in $save_libobjs
-	  do
-	    eval test_cmds=\"$reload_cmds $objlist $last_robj\"
-	    if test "X$objlist" = X ||
-	       { len=`expr "X$test_cmds" : ".*" 2>/dev/null` &&
-		 test "$len" -le "$max_cmd_len"; }; then
-	      objlist="$objlist $obj"
-	    else
-	      # The command $test_cmds is almost too long, add a
-	      # command to the queue.
-	      if test "$k" -eq 1 ; then
-		# The first file doesn't have a previous command to add.
-		eval concat_cmds=\"$reload_cmds $objlist $last_robj\"
-	      else
-		# All subsequent reloadable object files will link in
-		# the last one created.
-		eval concat_cmds=\"\$concat_cmds~$reload_cmds $objlist $last_robj\"
-	      fi
-	      last_robj=$output_objdir/$output_la-${k}.$objext
-	      k=`expr $k + 1`
-	      output=$output_objdir/$output_la-${k}.$objext
-	      objlist=$obj
-	      len=1
-	    fi
-	  done
-	  # Handle the remaining objects by creating one last
-	  # reloadable object file.  All subsequent reloadable object
-	  # files will link in the last one created.
-	  test -z "$concat_cmds" || concat_cmds=$concat_cmds~
-	  eval concat_cmds=\"\${concat_cmds}$reload_cmds $objlist $last_robj\"
-
-	  if ${skipped_export-false}; then
-	    $show "generating symbol list for \`$libname.la'"
-	    export_symbols="$output_objdir/$libname.exp"
-	    $run $rm $export_symbols
-	    libobjs=$output
-	    # Append the command to create the export file.
-	    eval concat_cmds=\"\$concat_cmds~$export_symbols_cmds\"
-          fi
-
-	  # Set up a command to remove the reloadable object files
-	  # after they are used.
-	  i=0
-	  while test "$i" -lt "$k"
-	  do
-	    i=`expr $i + 1`
-	    delfiles="$delfiles $output_objdir/$output_la-${i}.$objext"
-	  done
-
-	  $echo "creating a temporary reloadable object file: $output"
-
-	  # Loop through the commands generated above and execute them.
-	  save_ifs="$IFS"; IFS='~'
-	  for cmd in $concat_cmds; do
-	    IFS="$save_ifs"
-	    $show "$cmd"
-	    $run eval "$cmd" || exit $?
-	  done
-	  IFS="$save_ifs"
-
-	  libobjs=$output
-	  # Restore the value of output.
-	  output=$save_output
-
-	  if test -n "$convenience" && test -n "$whole_archive_flag_spec"; then
-	    eval libobjs=\"\$libobjs $whole_archive_flag_spec\"
-	  fi
-	  # Expand the library linking commands again to reset the
-	  # value of $libobjs for piecewise linking.
-
-	  # Do each of the archive commands.
-	  if test "$module" = yes && test -n "$module_cmds" ; then
-	    if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then
-	      cmds=$module_expsym_cmds
-	    else
-	      cmds=$module_cmds
-	    fi
-	  else
-	  if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then
-	    cmds=$archive_expsym_cmds
-	  else
-	    cmds=$archive_cmds
-	    fi
-	  fi
-
-	  # Append the command to remove the reloadable object files
-	  # to the just-reset $cmds.
-	  eval cmds=\"\$cmds~\$rm $delfiles\"
-	fi
-	save_ifs="$IFS"; IFS='~'
-	for cmd in $cmds; do
-	  IFS="$save_ifs"
-	  eval cmd=\"$cmd\"
-	  $show "$cmd"
-	  $run eval "$cmd" || {
-	    lt_exit=$?
-
-	    # Restore the uninstalled library and exit
-	    if test "$mode" = relink; then
-	      $run eval '(cd $output_objdir && $rm ${realname}T && $mv ${realname}U $realname)'
-	    fi
-
-	    exit $lt_exit
-	  }
-	done
-	IFS="$save_ifs"
-
-	# Restore the uninstalled library and exit
-	if test "$mode" = relink; then
-	  $run eval '(cd $output_objdir && $rm ${realname}T && $mv $realname ${realname}T && $mv "$realname"U $realname)' || exit $?
-
-	  if test -n "$convenience"; then
-	    if test -z "$whole_archive_flag_spec"; then
-	      $show "${rm}r $gentop"
-	      $run ${rm}r "$gentop"
-	    fi
-	  fi
-
-	  exit $EXIT_SUCCESS
-	fi
-
-	# Create links to the real library.
-	for linkname in $linknames; do
-	  if test "$realname" != "$linkname"; then
-	    $show "(cd $output_objdir && $rm $linkname && $LN_S $realname $linkname)"
-	    $run eval '(cd $output_objdir && $rm $linkname && $LN_S $realname $linkname)' || exit $?
-	  fi
-	done
-
-	# If -module or -export-dynamic was specified, set the dlname.
-	if test "$module" = yes || test "$export_dynamic" = yes; then
-	  # On all known operating systems, these are identical.
-	  dlname="$soname"
-	fi
-      fi
-      ;;
-
-    obj)
-      if test -n "$deplibs"; then
-	$echo "$modename: warning: \`-l' and \`-L' are ignored for objects" 1>&2
-      fi
-
-      if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
-	$echo "$modename: warning: \`-dlopen' is ignored for objects" 1>&2
-      fi
-
-      if test -n "$rpath"; then
-	$echo "$modename: warning: \`-rpath' is ignored for objects" 1>&2
-      fi
-
-      if test -n "$xrpath"; then
-	$echo "$modename: warning: \`-R' is ignored for objects" 1>&2
-      fi
-
-      if test -n "$vinfo"; then
-	$echo "$modename: warning: \`-version-info' is ignored for objects" 1>&2
-      fi
-
-      if test -n "$release"; then
-	$echo "$modename: warning: \`-release' is ignored for objects" 1>&2
-      fi
-
-      case $output in
-      *.lo)
-	if test -n "$objs$old_deplibs"; then
-	  $echo "$modename: cannot build library object \`$output' from non-libtool objects" 1>&2
-	  exit $EXIT_FAILURE
-	fi
-	libobj="$output"
-	obj=`$echo "X$output" | $Xsed -e "$lo2o"`
-	;;
-      *)
-	libobj=
-	obj="$output"
-	;;
-      esac
-
-      # Delete the old objects.
-      $run $rm $obj $libobj
-
-      # Objects from convenience libraries.  This assumes
-      # single-version convenience libraries.  Whenever we create
-      # different ones for PIC/non-PIC, this we'll have to duplicate
-      # the extraction.
-      reload_conv_objs=
-      gentop=
-      # reload_cmds runs $LD directly, so let us get rid of
-      # -Wl from whole_archive_flag_spec
-      wl=
-
-      if test -n "$convenience"; then
-	if test -n "$whole_archive_flag_spec"; then
-	  eval reload_conv_objs=\"\$reload_objs $whole_archive_flag_spec\"
-	else
-	  gentop="$output_objdir/${obj}x"
-	  generated="$generated $gentop"
-
-	  func_extract_archives $gentop $convenience
-	  reload_conv_objs="$reload_objs $func_extract_archives_result"
-	fi
-      fi
-
-      # Create the old-style object.
-      reload_objs="$objs$old_deplibs "`$echo "X$libobjs" | $SP2NL | $Xsed -e '/\.'${libext}$'/d' -e '/\.lib$/d' -e "$lo2o" | $NL2SP`" $reload_conv_objs" ### testsuite: skip nested quoting test
-
-      output="$obj"
-      cmds=$reload_cmds
-      save_ifs="$IFS"; IFS='~'
-      for cmd in $cmds; do
-	IFS="$save_ifs"
-	eval cmd=\"$cmd\"
-	$show "$cmd"
-	$run eval "$cmd" || exit $?
-      done
-      IFS="$save_ifs"
-
-      # Exit if we aren't doing a library object file.
-      if test -z "$libobj"; then
-	if test -n "$gentop"; then
-	  $show "${rm}r $gentop"
-	  $run ${rm}r $gentop
-	fi
-
-	exit $EXIT_SUCCESS
-      fi
-
-      if test "$build_libtool_libs" != yes; then
-	if test -n "$gentop"; then
-	  $show "${rm}r $gentop"
-	  $run ${rm}r $gentop
-	fi
-
-	# Create an invalid libtool object if no PIC, so that we don't
-	# accidentally link it into a program.
-	# $show "echo timestamp > $libobj"
-	# $run eval "echo timestamp > $libobj" || exit $?
-	exit $EXIT_SUCCESS
-      fi
-
-      if test -n "$pic_flag" || test "$pic_mode" != default; then
-	# Only do commands if we really have different PIC objects.
-	reload_objs="$libobjs $reload_conv_objs"
-	output="$libobj"
-	cmds=$reload_cmds
-	save_ifs="$IFS"; IFS='~'
-	for cmd in $cmds; do
-	  IFS="$save_ifs"
-	  eval cmd=\"$cmd\"
-	  $show "$cmd"
-	  $run eval "$cmd" || exit $?
-	done
-	IFS="$save_ifs"
-      fi
-
-      if test -n "$gentop"; then
-	$show "${rm}r $gentop"
-	$run ${rm}r $gentop
-      fi
-
-      exit $EXIT_SUCCESS
-      ;;
-
-    prog)
-      case $host in
-	*cygwin*) output=`$echo $output | ${SED} -e 's,.exe$,,;s,$,.exe,'` ;;
-      esac
-      if test -n "$vinfo"; then
-	$echo "$modename: warning: \`-version-info' is ignored for programs" 1>&2
-      fi
-
-      if test -n "$release"; then
-	$echo "$modename: warning: \`-release' is ignored for programs" 1>&2
-      fi
-
-      if test "$preload" = yes; then
-	if test "$dlopen_support" = unknown && test "$dlopen_self" = unknown &&
-	   test "$dlopen_self_static" = unknown; then
-	  $echo "$modename: warning: \`AC_LIBTOOL_DLOPEN' not used. Assuming no dlopen support."
-	fi
-      fi
-
-      case $host in
-      *-*-rhapsody* | *-*-darwin1.[012])
-	# On Rhapsody replace the C library is the System framework
-	compile_deplibs=`$echo "X $compile_deplibs" | $Xsed -e 's/ -lc / -framework System /'`
-	finalize_deplibs=`$echo "X $finalize_deplibs" | $Xsed -e 's/ -lc / -framework System /'`
-	;;
-      esac
-
-      case $host in
-      *darwin*)
-        # Don't allow lazy linking, it breaks C++ global constructors
-        if test "$tagname" = CXX ; then
-        compile_command="$compile_command ${wl}-bind_at_load"
-        finalize_command="$finalize_command ${wl}-bind_at_load"
-        fi
-        ;;
-      esac
-
-
-      # move library search paths that coincide with paths to not yet
-      # installed libraries to the beginning of the library search list
-      new_libs=
-      for path in $notinst_path; do
-	case " $new_libs " in
-	*" -L$path/$objdir "*) ;;
-	*)
-	  case " $compile_deplibs " in
-	  *" -L$path/$objdir "*)
-	    new_libs="$new_libs -L$path/$objdir" ;;
-	  esac
-	  ;;
-	esac
-      done
-      for deplib in $compile_deplibs; do
-	case $deplib in
-	-L*)
-	  case " $new_libs " in
-	  *" $deplib "*) ;;
-	  *) new_libs="$new_libs $deplib" ;;
-	  esac
-	  ;;
-	*) new_libs="$new_libs $deplib" ;;
-	esac
-      done
-      compile_deplibs="$new_libs"
-
-
-      compile_command="$compile_command $compile_deplibs"
-      finalize_command="$finalize_command $finalize_deplibs"
-
-      if test -n "$rpath$xrpath"; then
-	# If the user specified any rpath flags, then add them.
-	for libdir in $rpath $xrpath; do
-	  # This is the magic to use -rpath.
-	  case "$finalize_rpath " in
-	  *" $libdir "*) ;;
-	  *) finalize_rpath="$finalize_rpath $libdir" ;;
-	  esac
-	done
-      fi
-
-      # Now hardcode the library paths
-      rpath=
-      hardcode_libdirs=
-      for libdir in $compile_rpath $finalize_rpath; do
-	if test -n "$hardcode_libdir_flag_spec"; then
-	  if test -n "$hardcode_libdir_separator"; then
-	    if test -z "$hardcode_libdirs"; then
-	      hardcode_libdirs="$libdir"
-	    else
-	      # Just accumulate the unique libdirs.
-	      case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
-	      *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
-		;;
-	      *)
-		hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir"
-		;;
-	      esac
-	    fi
-	  else
-	    eval flag=\"$hardcode_libdir_flag_spec\"
-	    rpath="$rpath $flag"
-	  fi
-	elif test -n "$runpath_var"; then
-	  case "$perm_rpath " in
-	  *" $libdir "*) ;;
-	  *) perm_rpath="$perm_rpath $libdir" ;;
-	  esac
-	fi
-	case $host in
-	*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*)
-	  testbindir=`$echo "X$libdir" | $Xsed -e 's*/lib$*/bin*'`
-	  case :$dllsearchpath: in
-	  *":$libdir:"*) ;;
-	  *) dllsearchpath="$dllsearchpath:$libdir";;
-	  esac
-	  case :$dllsearchpath: in
-	  *":$testbindir:"*) ;;
-	  *) dllsearchpath="$dllsearchpath:$testbindir";;
-	  esac
-	  ;;
-	esac
-      done
-      # Substitute the hardcoded libdirs into the rpath.
-      if test -n "$hardcode_libdir_separator" &&
-	 test -n "$hardcode_libdirs"; then
-	libdir="$hardcode_libdirs"
-	eval rpath=\" $hardcode_libdir_flag_spec\"
-      fi
-      compile_rpath="$rpath"
-
-      rpath=
-      hardcode_libdirs=
-      for libdir in $finalize_rpath; do
-	if test -n "$hardcode_libdir_flag_spec"; then
-	  if test -n "$hardcode_libdir_separator"; then
-	    if test -z "$hardcode_libdirs"; then
-	      hardcode_libdirs="$libdir"
-	    else
-	      # Just accumulate the unique libdirs.
-	      case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
-	      *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
-		;;
-	      *)
-		hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir"
-		;;
-	      esac
-	    fi
-	  else
-	    eval flag=\"$hardcode_libdir_flag_spec\"
-	    rpath="$rpath $flag"
-	  fi
-	elif test -n "$runpath_var"; then
-	  case "$finalize_perm_rpath " in
-	  *" $libdir "*) ;;
-	  *) finalize_perm_rpath="$finalize_perm_rpath $libdir" ;;
-	  esac
-	fi
-      done
-      # Substitute the hardcoded libdirs into the rpath.
-      if test -n "$hardcode_libdir_separator" &&
-	 test -n "$hardcode_libdirs"; then
-	libdir="$hardcode_libdirs"
-	eval rpath=\" $hardcode_libdir_flag_spec\"
-      fi
-      finalize_rpath="$rpath"
-
-      if test -n "$libobjs" && test "$build_old_libs" = yes; then
-	# Transform all the library objects into standard objects.
-	compile_command=`$echo "X$compile_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
-	finalize_command=`$echo "X$finalize_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
-      fi
-
-      dlsyms=
-      if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
-	if test -n "$NM" && test -n "$global_symbol_pipe"; then
-	  dlsyms="${outputname}S.c"
-	else
-	  $echo "$modename: not configured to extract global symbols from dlpreopened files" 1>&2
-	fi
-      fi
-
-      if test -n "$dlsyms"; then
-	case $dlsyms in
-	"") ;;
-	*.c)
-	  # Discover the nlist of each of the dlfiles.
-	  nlist="$output_objdir/${outputname}.nm"
-
-	  $show "$rm $nlist ${nlist}S ${nlist}T"
-	  $run $rm "$nlist" "${nlist}S" "${nlist}T"
-
-	  # Parse the name list into a source file.
-	  $show "creating $output_objdir/$dlsyms"
-
-	  test -z "$run" && $echo > "$output_objdir/$dlsyms" "\
-/* $dlsyms - symbol resolution table for \`$outputname' dlsym emulation. */
-/* Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP */
-
-#ifdef __cplusplus
-extern \"C\" {
-#endif
-
-/* Prevent the only kind of declaration conflicts we can make. */
-#define lt_preloaded_symbols some_other_symbol
-
-/* External symbol declarations for the compiler. */\
-"
-
-	  if test "$dlself" = yes; then
-	    $show "generating symbol list for \`$output'"
-
-	    test -z "$run" && $echo ': @PROGRAM@ ' > "$nlist"
-
-	    # Add our own program objects to the symbol list.
-	    progfiles=`$echo "X$objs$old_deplibs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
-	    for arg in $progfiles; do
-	      $show "extracting global C symbols from \`$arg'"
-	      $run eval "$NM $arg | $global_symbol_pipe >> '$nlist'"
-	    done
-
-	    if test -n "$exclude_expsyms"; then
-	      $run eval '$EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T'
-	      $run eval '$mv "$nlist"T "$nlist"'
-	    fi
-
-	    if test -n "$export_symbols_regex"; then
-	      $run eval '$EGREP -e "$export_symbols_regex" "$nlist" > "$nlist"T'
-	      $run eval '$mv "$nlist"T "$nlist"'
-	    fi
-
-	    # Prepare the list of exported symbols
-	    if test -z "$export_symbols"; then
-	      export_symbols="$output_objdir/$outputname.exp"
-	      $run $rm $export_symbols
-	      $run eval "${SED} -n -e '/^: @PROGRAM@ $/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"'
-              case $host in
-              *cygwin* | *mingw* )
-	        $run eval "echo EXPORTS "'> "$output_objdir/$outputname.def"'
-		$run eval 'cat "$export_symbols" >> "$output_objdir/$outputname.def"'
-                ;;
-              esac
-	    else
-	      $run eval "${SED} -e 's/\([].[*^$]\)/\\\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$outputname.exp"'
-	      $run eval 'grep -f "$output_objdir/$outputname.exp" < "$nlist" > "$nlist"T'
-	      $run eval 'mv "$nlist"T "$nlist"'
-              case $host in
-              *cygwin* | *mingw* )
-	        $run eval "echo EXPORTS "'> "$output_objdir/$outputname.def"'
-		$run eval 'cat "$nlist" >> "$output_objdir/$outputname.def"'
-                ;;
-              esac
-	    fi
-	  fi
-
-	  for arg in $dlprefiles; do
-	    $show "extracting global C symbols from \`$arg'"
-	    name=`$echo "$arg" | ${SED} -e 's%^.*/%%'`
-	    $run eval '$echo ": $name " >> "$nlist"'
-	    $run eval "$NM $arg | $global_symbol_pipe >> '$nlist'"
-	  done
-
-	  if test -z "$run"; then
-	    # Make sure we have at least an empty file.
-	    test -f "$nlist" || : > "$nlist"
-
-	    if test -n "$exclude_expsyms"; then
-	      $EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T
-	      $mv "$nlist"T "$nlist"
-	    fi
-
-	    # Try sorting and uniquifying the output.
-	    if grep -v "^: " < "$nlist" |
-		if sort -k 3 </dev/null >/dev/null 2>&1; then
-		  sort -k 3
-		else
-		  sort +2
-		fi |
-		uniq > "$nlist"S; then
-	      :
-	    else
-	      grep -v "^: " < "$nlist" > "$nlist"S
-	    fi
-
-	    if test -f "$nlist"S; then
-	      eval "$global_symbol_to_cdecl"' < "$nlist"S >> "$output_objdir/$dlsyms"'
-	    else
-	      $echo '/* NONE */' >> "$output_objdir/$dlsyms"
-	    fi
-
-	    $echo >> "$output_objdir/$dlsyms" "\
-
-#undef lt_preloaded_symbols
-
-#if defined (__STDC__) && __STDC__
-# define lt_ptr void *
-#else
-# define lt_ptr char *
-# define const
-#endif
-
-/* The mapping between symbol names and symbols. */
-"
-
-	    case $host in
-	    *cygwin* | *mingw* )
-	  $echo >> "$output_objdir/$dlsyms" "\
-/* DATA imports from DLLs on WIN32 can't be const, because
-   runtime relocations are performed -- see ld's documentation
-   on pseudo-relocs */
-struct {
-"
-	      ;;
-	    * )
-	  $echo >> "$output_objdir/$dlsyms" "\
-const struct {
-"
-	      ;;
-	    esac
-
-
-	  $echo >> "$output_objdir/$dlsyms" "\
-  const char *name;
-  lt_ptr address;
-}
-lt_preloaded_symbols[] =
-{\
-"
-
-	    eval "$global_symbol_to_c_name_address" < "$nlist" >> "$output_objdir/$dlsyms"
-
-	    $echo >> "$output_objdir/$dlsyms" "\
-  {0, (lt_ptr) 0}
-};
-
-/* This works around a problem in FreeBSD linker */
-#ifdef FREEBSD_WORKAROUND
-static const void *lt_preloaded_setup() {
-  return lt_preloaded_symbols;
-}
-#endif
-
-#ifdef __cplusplus
-}
-#endif\
-"
-	  fi
-
-	  pic_flag_for_symtable=
-	  case $host in
-	  # compiling the symbol table file with pic_flag works around
-	  # a FreeBSD bug that causes programs to crash when -lm is
-	  # linked before any other PIC object.  But we must not use
-	  # pic_flag when linking with -static.  The problem exists in
-	  # FreeBSD 2.2.6 and is fixed in FreeBSD 3.1.
-	  *-*-freebsd2*|*-*-freebsd3.0*|*-*-freebsdelf3.0*)
-	    case "$compile_command " in
-	    *" -static "*) ;;
-	    *) pic_flag_for_symtable=" $pic_flag -DFREEBSD_WORKAROUND";;
-	    esac;;
-	  *-*-hpux*)
-	    case "$compile_command " in
-	    *" -static "*) ;;
-	    *) pic_flag_for_symtable=" $pic_flag";;
-	    esac
-	  esac
-
-	  # Now compile the dynamic symbol file.
-	  $show "(cd $output_objdir && $LTCC  $LTCFLAGS -c$no_builtin_flag$pic_flag_for_symtable \"$dlsyms\")"
-	  $run eval '(cd $output_objdir && $LTCC  $LTCFLAGS -c$no_builtin_flag$pic_flag_for_symtable "$dlsyms")' || exit $?
-
-	  # Clean up the generated files.
-	  $show "$rm $output_objdir/$dlsyms $nlist ${nlist}S ${nlist}T"
-	  $run $rm "$output_objdir/$dlsyms" "$nlist" "${nlist}S" "${nlist}T"
-
-	  # Transform the symbol file into the correct name.
-          case $host in
-          *cygwin* | *mingw* )
-            if test -f "$output_objdir/${outputname}.def" ; then
-              compile_command=`$echo "X$compile_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}.def $output_objdir/${outputname}S.${objext}%"`
-              finalize_command=`$echo "X$finalize_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}.def $output_objdir/${outputname}S.${objext}%"`
-            else
-              compile_command=`$echo "X$compile_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%"`
-              finalize_command=`$echo "X$finalize_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%"`
-             fi
-            ;;
-          * )
-            compile_command=`$echo "X$compile_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%"`
-            finalize_command=`$echo "X$finalize_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%"`
-            ;;
-          esac
-	  ;;
-	*-*-freebsd*)
-	  # FreeBSD doesn't need this...
-	  ;;
-	*)
-	  $echo "$modename: unknown suffix for \`$dlsyms'" 1>&2
-	  exit $EXIT_FAILURE
-	  ;;
-	esac
-      else
-	# We keep going just in case the user didn't refer to
-	# lt_preloaded_symbols.  The linker will fail if global_symbol_pipe
-	# really was required.
-
-	# Nullify the symbol file.
-	compile_command=`$echo "X$compile_command" | $Xsed -e "s% @SYMFILE@%%"`
-	finalize_command=`$echo "X$finalize_command" | $Xsed -e "s% @SYMFILE@%%"`
-      fi
-
-      if test "$need_relink" = no || test "$build_libtool_libs" != yes; then
-	# Replace the output file specification.
-	compile_command=`$echo "X$compile_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'`
-	link_command="$compile_command$compile_rpath"
-
-	# We have no uninstalled library dependencies, so finalize right now.
-	$show "$link_command"
-	$run eval "$link_command"
-	exit_status=$?
-
-	# Delete the generated files.
-	if test -n "$dlsyms"; then
-	  $show "$rm $output_objdir/${outputname}S.${objext}"
-	  $run $rm "$output_objdir/${outputname}S.${objext}"
-	fi
-
-	exit $exit_status
-      fi
-
-      if test -n "$shlibpath_var"; then
-	# We should set the shlibpath_var
-	rpath=
-	for dir in $temp_rpath; do
-	  case $dir in
-	  [\\/]* | [A-Za-z]:[\\/]*)
-	    # Absolute path.
-	    rpath="$rpath$dir:"
-	    ;;
-	  *)
-	    # Relative path: add a thisdir entry.
-	    rpath="$rpath\$thisdir/$dir:"
-	    ;;
-	  esac
-	done
-	temp_rpath="$rpath"
-      fi
-
-      if test -n "$compile_shlibpath$finalize_shlibpath"; then
-	compile_command="$shlibpath_var=\"$compile_shlibpath$finalize_shlibpath\$$shlibpath_var\" $compile_command"
-      fi
-      if test -n "$finalize_shlibpath"; then
-	finalize_command="$shlibpath_var=\"$finalize_shlibpath\$$shlibpath_var\" $finalize_command"
-      fi
-
-      compile_var=
-      finalize_var=
-      if test -n "$runpath_var"; then
-	if test -n "$perm_rpath"; then
-	  # We should set the runpath_var.
-	  rpath=
-	  for dir in $perm_rpath; do
-	    rpath="$rpath$dir:"
-	  done
-	  compile_var="$runpath_var=\"$rpath\$$runpath_var\" "
-	fi
-	if test -n "$finalize_perm_rpath"; then
-	  # We should set the runpath_var.
-	  rpath=
-	  for dir in $finalize_perm_rpath; do
-	    rpath="$rpath$dir:"
-	  done
-	  finalize_var="$runpath_var=\"$rpath\$$runpath_var\" "
-	fi
-      fi
-
-      if test "$no_install" = yes; then
-	# We don't need to create a wrapper script.
-	link_command="$compile_var$compile_command$compile_rpath"
-	# Replace the output file specification.
-	link_command=`$echo "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'`
-	# Delete the old output file.
-	$run $rm $output
-	# Link the executable and exit
-	$show "$link_command"
-	$run eval "$link_command" || exit $?
-	exit $EXIT_SUCCESS
-      fi
-
-      if test "$hardcode_action" = relink; then
-	# Fast installation is not supported
-	link_command="$compile_var$compile_command$compile_rpath"
-	relink_command="$finalize_var$finalize_command$finalize_rpath"
-
-	$echo "$modename: warning: this platform does not like uninstalled shared libraries" 1>&2
-	$echo "$modename: \`$output' will be relinked during installation" 1>&2
-      else
-	if test "$fast_install" != no; then
-	  link_command="$finalize_var$compile_command$finalize_rpath"
-	  if test "$fast_install" = yes; then
-	    relink_command=`$echo "X$compile_var$compile_command$compile_rpath" | $Xsed -e 's%@OUTPUT@%\$progdir/\$file%g'`
-	  else
-	    # fast_install is set to needless
-	    relink_command=
-	  fi
-	else
-	  link_command="$compile_var$compile_command$compile_rpath"
-	  relink_command="$finalize_var$finalize_command$finalize_rpath"
-	fi
-      fi
-
-      # Replace the output file specification.
-      link_command=`$echo "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output_objdir/$outputname"'%g'`
-
-      # Delete the old output files.
-      $run $rm $output $output_objdir/$outputname $output_objdir/lt-$outputname
-
-      $show "$link_command"
-      $run eval "$link_command" || exit $?
-
-      # Now create the wrapper script.
-      $show "creating $output"
-
-      # Quote the relink command for shipping.
-      if test -n "$relink_command"; then
-	# Preserve any variables that may affect compiler behavior
-	for var in $variables_saved_for_relink; do
-	  if eval test -z \"\${$var+set}\"; then
-	    relink_command="{ test -z \"\${$var+set}\" || unset $var || { $var=; export $var; }; }; $relink_command"
-	  elif eval var_value=\$$var; test -z "$var_value"; then
-	    relink_command="$var=; export $var; $relink_command"
-	  else
-	    var_value=`$echo "X$var_value" | $Xsed -e "$sed_quote_subst"`
-	    relink_command="$var=\"$var_value\"; export $var; $relink_command"
-	  fi
-	done
-	relink_command="(cd `pwd`; $relink_command)"
-	relink_command=`$echo "X$relink_command" | $Xsed -e "$sed_quote_subst"`
-      fi
-
-      # Quote $echo for shipping.
-      if test "X$echo" = "X$SHELL $progpath --fallback-echo"; then
-	case $progpath in
-	[\\/]* | [A-Za-z]:[\\/]*) qecho="$SHELL $progpath --fallback-echo";;
-	*) qecho="$SHELL `pwd`/$progpath --fallback-echo";;
-	esac
-	qecho=`$echo "X$qecho" | $Xsed -e "$sed_quote_subst"`
-      else
-	qecho=`$echo "X$echo" | $Xsed -e "$sed_quote_subst"`
-      fi
-
-      # Only actually do things if our run command is non-null.
-      if test -z "$run"; then
-	# win32 will think the script is a binary if it has
-	# a .exe suffix, so we strip it off here.
-	case $output in
-	  *.exe) output=`$echo $output|${SED} 's,.exe$,,'` ;;
-	esac
-	# test for cygwin because mv fails w/o .exe extensions
-	case $host in
-	  *cygwin*)
-	    exeext=.exe
-	    outputname=`$echo $outputname|${SED} 's,.exe$,,'` ;;
-	  *) exeext= ;;
-	esac
-	case $host in
-	  *cygwin* | *mingw* )
-            output_name=`basename $output`
-            output_path=`dirname $output`
-            cwrappersource="$output_path/$objdir/lt-$output_name.c"
-            cwrapper="$output_path/$output_name.exe"
-            $rm $cwrappersource $cwrapper
-            trap "$rm $cwrappersource $cwrapper; exit $EXIT_FAILURE" 1 2 15
-
-	    cat > $cwrappersource <<EOF
-
-/* $cwrappersource - temporary wrapper executable for $objdir/$outputname
-   Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
-
-   The $output program cannot be directly executed until all the libtool
-   libraries that it depends on are installed.
-
-   This wrapper executable should never be moved out of the build directory.
-   If it is, it will not operate correctly.
-
-   Currently, it simply execs the wrapper *script* "/bin/sh $output",
-   but could eventually absorb all of the scripts functionality and
-   exec $objdir/$outputname directly.
-*/
-EOF
-	    cat >> $cwrappersource<<"EOF"
-#include <stdio.h>
-#include <stdlib.h>
-#include <unistd.h>
-#include <malloc.h>
-#include <stdarg.h>
-#include <assert.h>
-#include <string.h>
-#include <ctype.h>
-#include <sys/stat.h>
-
-#if defined(PATH_MAX)
-# define LT_PATHMAX PATH_MAX
-#elif defined(MAXPATHLEN)
-# define LT_PATHMAX MAXPATHLEN
-#else
-# define LT_PATHMAX 1024
-#endif
-
-#ifndef DIR_SEPARATOR
-# define DIR_SEPARATOR '/'
-# define PATH_SEPARATOR ':'
-#endif
-
-#if defined (_WIN32) || defined (__MSDOS__) || defined (__DJGPP__) || \
-  defined (__OS2__)
-# define HAVE_DOS_BASED_FILE_SYSTEM
-# ifndef DIR_SEPARATOR_2
-#  define DIR_SEPARATOR_2 '\\'
-# endif
-# ifndef PATH_SEPARATOR_2
-#  define PATH_SEPARATOR_2 ';'
-# endif
-#endif
-
-#ifndef DIR_SEPARATOR_2
-# define IS_DIR_SEPARATOR(ch) ((ch) == DIR_SEPARATOR)
-#else /* DIR_SEPARATOR_2 */
-# define IS_DIR_SEPARATOR(ch) \
-        (((ch) == DIR_SEPARATOR) || ((ch) == DIR_SEPARATOR_2))
-#endif /* DIR_SEPARATOR_2 */
-
-#ifndef PATH_SEPARATOR_2
-# define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR)
-#else /* PATH_SEPARATOR_2 */
-# define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR_2)
-#endif /* PATH_SEPARATOR_2 */
-
-#define XMALLOC(type, num)      ((type *) xmalloc ((num) * sizeof(type)))
-#define XFREE(stale) do { \
-  if (stale) { free ((void *) stale); stale = 0; } \
-} while (0)
-
-/* -DDEBUG is fairly common in CFLAGS.  */
-#undef DEBUG
-#if defined DEBUGWRAPPER
-# define DEBUG(format, ...) fprintf(stderr, format, __VA_ARGS__)
-#else
-# define DEBUG(format, ...)
-#endif
-
-const char *program_name = NULL;
-
-void * xmalloc (size_t num);
-char * xstrdup (const char *string);
-const char * base_name (const char *name);
-char * find_executable(const char *wrapper);
-int    check_executable(const char *path);
-char * strendzap(char *str, const char *pat);
-void lt_fatal (const char *message, ...);
-
-int
-main (int argc, char *argv[])
-{
-  char **newargz;
-  int i;
-
-  program_name = (char *) xstrdup (base_name (argv[0]));
-  DEBUG("(main) argv[0]      : %s\n",argv[0]);
-  DEBUG("(main) program_name : %s\n",program_name);
-  newargz = XMALLOC(char *, argc+2);
-EOF
-
-            cat >> $cwrappersource <<EOF
-  newargz[0] = (char *) xstrdup("$SHELL");
-EOF
-
-            cat >> $cwrappersource <<"EOF"
-  newargz[1] = find_executable(argv[0]);
-  if (newargz[1] == NULL)
-    lt_fatal("Couldn't find %s", argv[0]);
-  DEBUG("(main) found exe at : %s\n",newargz[1]);
-  /* we know the script has the same name, without the .exe */
-  /* so make sure newargz[1] doesn't end in .exe */
-  strendzap(newargz[1],".exe");
-  for (i = 1; i < argc; i++)
-    newargz[i+1] = xstrdup(argv[i]);
-  newargz[argc+1] = NULL;
-
-  for (i=0; i<argc+1; i++)
-  {
-    DEBUG("(main) newargz[%d]   : %s\n",i,newargz[i]);
-    ;
-  }
-
-EOF
-
-            case $host_os in
-              mingw*)
-                cat >> $cwrappersource <<EOF
-  execv("$SHELL",(char const **)newargz);
-EOF
-              ;;
-              *)
-                cat >> $cwrappersource <<EOF
-  execv("$SHELL",newargz);
-EOF
-              ;;
-            esac
-
-            cat >> $cwrappersource <<"EOF"
-  return 127;
-}
-
-void *
-xmalloc (size_t num)
-{
-  void * p = (void *) malloc (num);
-  if (!p)
-    lt_fatal ("Memory exhausted");
-
-  return p;
-}
-
-char *
-xstrdup (const char *string)
-{
-  return string ? strcpy ((char *) xmalloc (strlen (string) + 1), string) : NULL
-;
-}
-
-const char *
-base_name (const char *name)
-{
-  const char *base;
-
-#if defined (HAVE_DOS_BASED_FILE_SYSTEM)
-  /* Skip over the disk name in MSDOS pathnames. */
-  if (isalpha ((unsigned char)name[0]) && name[1] == ':')
-    name += 2;
-#endif
-
-  for (base = name; *name; name++)
-    if (IS_DIR_SEPARATOR (*name))
-      base = name + 1;
-  return base;
-}
-
-int
-check_executable(const char * path)
-{
-  struct stat st;
-
-  DEBUG("(check_executable)  : %s\n", path ? (*path ? path : "EMPTY!") : "NULL!");
-  if ((!path) || (!*path))
-    return 0;
-
-  if ((stat (path, &st) >= 0) &&
-      (
-        /* MinGW & native WIN32 do not support S_IXOTH or S_IXGRP */
-#if defined (S_IXOTH)
-       ((st.st_mode & S_IXOTH) == S_IXOTH) ||
-#endif
-#if defined (S_IXGRP)
-       ((st.st_mode & S_IXGRP) == S_IXGRP) ||
-#endif
-       ((st.st_mode & S_IXUSR) == S_IXUSR))
-      )
-    return 1;
-  else
-    return 0;
-}
-
-/* Searches for the full path of the wrapper.  Returns
-   newly allocated full path name if found, NULL otherwise */
-char *
-find_executable (const char* wrapper)
-{
-  int has_slash = 0;
-  const char* p;
-  const char* p_next;
-  /* static buffer for getcwd */
-  char tmp[LT_PATHMAX + 1];
-  int tmp_len;
-  char* concat_name;
-
-  DEBUG("(find_executable)  : %s\n", wrapper ? (*wrapper ? wrapper : "EMPTY!") : "NULL!");
-
-  if ((wrapper == NULL) || (*wrapper == '\0'))
-    return NULL;
-
-  /* Absolute path? */
-#if defined (HAVE_DOS_BASED_FILE_SYSTEM)
-  if (isalpha ((unsigned char)wrapper[0]) && wrapper[1] == ':')
-  {
-    concat_name = xstrdup (wrapper);
-    if (check_executable(concat_name))
-      return concat_name;
-    XFREE(concat_name);
-  }
-  else
-  {
-#endif
-    if (IS_DIR_SEPARATOR (wrapper[0]))
-    {
-      concat_name = xstrdup (wrapper);
-      if (check_executable(concat_name))
-        return concat_name;
-      XFREE(concat_name);
-    }
-#if defined (HAVE_DOS_BASED_FILE_SYSTEM)
-  }
-#endif
-
-  for (p = wrapper; *p; p++)
-    if (*p == '/')
-    {
-      has_slash = 1;
-      break;
-    }
-  if (!has_slash)
-  {
-    /* no slashes; search PATH */
-    const char* path = getenv ("PATH");
-    if (path != NULL)
-    {
-      for (p = path; *p; p = p_next)
-      {
-        const char* q;
-        size_t p_len;
-        for (q = p; *q; q++)
-          if (IS_PATH_SEPARATOR(*q))
-            break;
-        p_len = q - p;
-        p_next = (*q == '\0' ? q : q + 1);
-        if (p_len == 0)
-        {
-          /* empty path: current directory */
-          if (getcwd (tmp, LT_PATHMAX) == NULL)
-            lt_fatal ("getcwd failed");
-          tmp_len = strlen(tmp);
-          concat_name = XMALLOC(char, tmp_len + 1 + strlen(wrapper) + 1);
-          memcpy (concat_name, tmp, tmp_len);
-          concat_name[tmp_len] = '/';
-          strcpy (concat_name + tmp_len + 1, wrapper);
-        }
-        else
-        {
-          concat_name = XMALLOC(char, p_len + 1 + strlen(wrapper) + 1);
-          memcpy (concat_name, p, p_len);
-          concat_name[p_len] = '/';
-          strcpy (concat_name + p_len + 1, wrapper);
-        }
-        if (check_executable(concat_name))
-          return concat_name;
-        XFREE(concat_name);
-      }
-    }
-    /* not found in PATH; assume curdir */
-  }
-  /* Relative path | not found in path: prepend cwd */
-  if (getcwd (tmp, LT_PATHMAX) == NULL)
-    lt_fatal ("getcwd failed");
-  tmp_len = strlen(tmp);
-  concat_name = XMALLOC(char, tmp_len + 1 + strlen(wrapper) + 1);
-  memcpy (concat_name, tmp, tmp_len);
-  concat_name[tmp_len] = '/';
-  strcpy (concat_name + tmp_len + 1, wrapper);
-
-  if (check_executable(concat_name))
-    return concat_name;
-  XFREE(concat_name);
-  return NULL;
-}
-
-char *
-strendzap(char *str, const char *pat)
-{
-  size_t len, patlen;
-
-  assert(str != NULL);
-  assert(pat != NULL);
-
-  len = strlen(str);
-  patlen = strlen(pat);
-
-  if (patlen <= len)
-  {
-    str += len - patlen;
-    if (strcmp(str, pat) == 0)
-      *str = '\0';
-  }
-  return str;
-}
-
-static void
-lt_error_core (int exit_status, const char * mode,
-          const char * message, va_list ap)
-{
-  fprintf (stderr, "%s: %s: ", program_name, mode);
-  vfprintf (stderr, message, ap);
-  fprintf (stderr, ".\n");
-
-  if (exit_status >= 0)
-    exit (exit_status);
-}
-
-void
-lt_fatal (const char *message, ...)
-{
-  va_list ap;
-  va_start (ap, message);
-  lt_error_core (EXIT_FAILURE, "FATAL", message, ap);
-  va_end (ap);
-}
-EOF
-          # we should really use a build-platform specific compiler
-          # here, but OTOH, the wrappers (shell script and this C one)
-          # are only useful if you want to execute the "real" binary.
-          # Since the "real" binary is built for $host, then this
-          # wrapper might as well be built for $host, too.
-          $run $LTCC $LTCFLAGS -s -o $cwrapper $cwrappersource
-          ;;
-        esac
-        $rm $output
-        trap "$rm $output; exit $EXIT_FAILURE" 1 2 15
-
-	$echo > $output "\
-#! $SHELL
-
-# $output - temporary wrapper script for $objdir/$outputname
-# Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
-#
-# The $output program cannot be directly executed until all the libtool
-# libraries that it depends on are installed.
-#
-# This wrapper script should never be moved out of the build directory.
-# If it is, it will not operate correctly.
-
-# Sed substitution that helps us do robust quoting.  It backslashifies
-# metacharacters that are still active within double-quoted strings.
-Xsed='${SED} -e 1s/^X//'
-sed_quote_subst='$sed_quote_subst'
-
-# The HP-UX ksh and POSIX shell print the target directory to stdout
-# if CDPATH is set.
-(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
-
-relink_command=\"$relink_command\"
-
-# This environment variable determines our operation mode.
-if test \"\$libtool_install_magic\" = \"$magic\"; then
-  # install mode needs the following variable:
-  notinst_deplibs='$notinst_deplibs'
-else
-  # When we are sourced in execute mode, \$file and \$echo are already set.
-  if test \"\$libtool_execute_magic\" != \"$magic\"; then
-    echo=\"$qecho\"
-    file=\"\$0\"
-    # Make sure echo works.
-    if test \"X\$1\" = X--no-reexec; then
-      # Discard the --no-reexec flag, and continue.
-      shift
-    elif test \"X\`(\$echo '\t') 2>/dev/null\`\" = 'X\t'; then
-      # Yippee, \$echo works!
-      :
-    else
-      # Restart under the correct shell, and then maybe \$echo will work.
-      exec $SHELL \"\$0\" --no-reexec \${1+\"\$@\"}
-    fi
-  fi\
-"
-	$echo >> $output "\
-
-  # Find the directory that this script lives in.
-  thisdir=\`\$echo \"X\$file\" | \$Xsed -e 's%/[^/]*$%%'\`
-  test \"x\$thisdir\" = \"x\$file\" && thisdir=.
-
-  # Follow symbolic links until we get to the real thisdir.
-  file=\`ls -ld \"\$file\" | ${SED} -n 's/.*-> //p'\`
-  while test -n \"\$file\"; do
-    destdir=\`\$echo \"X\$file\" | \$Xsed -e 's%/[^/]*\$%%'\`
-
-    # If there was a directory component, then change thisdir.
-    if test \"x\$destdir\" != \"x\$file\"; then
-      case \"\$destdir\" in
-      [\\\\/]* | [A-Za-z]:[\\\\/]*) thisdir=\"\$destdir\" ;;
-      *) thisdir=\"\$thisdir/\$destdir\" ;;
-      esac
-    fi
-
-    file=\`\$echo \"X\$file\" | \$Xsed -e 's%^.*/%%'\`
-    file=\`ls -ld \"\$thisdir/\$file\" | ${SED} -n 's/.*-> //p'\`
-  done
-
-  # Try to get the absolute directory name.
-  absdir=\`cd \"\$thisdir\" && pwd\`
-  test -n \"\$absdir\" && thisdir=\"\$absdir\"
-"
-
-	if test "$fast_install" = yes; then
-	  $echo >> $output "\
-  program=lt-'$outputname'$exeext
-  progdir=\"\$thisdir/$objdir\"
-
-  if test ! -f \"\$progdir/\$program\" || \\
-     { file=\`ls -1dt \"\$progdir/\$program\" \"\$progdir/../\$program\" 2>/dev/null | ${SED} 1q\`; \\
-       test \"X\$file\" != \"X\$progdir/\$program\"; }; then
-
-    file=\"\$\$-\$program\"
-
-    if test ! -d \"\$progdir\"; then
-      $mkdir \"\$progdir\"
-    else
-      $rm \"\$progdir/\$file\"
-    fi"
-
-	  $echo >> $output "\
-
-    # relink executable if necessary
-    if test -n \"\$relink_command\"; then
-      if relink_command_output=\`eval \$relink_command 2>&1\`; then :
-      else
-	$echo \"\$relink_command_output\" >&2
-	$rm \"\$progdir/\$file\"
-	exit $EXIT_FAILURE
-      fi
-    fi
-
-    $mv \"\$progdir/\$file\" \"\$progdir/\$program\" 2>/dev/null ||
-    { $rm \"\$progdir/\$program\";
-      $mv \"\$progdir/\$file\" \"\$progdir/\$program\"; }
-    $rm \"\$progdir/\$file\"
-  fi"
-	else
-	  $echo >> $output "\
-  program='$outputname'
-  progdir=\"\$thisdir/$objdir\"
-"
-	fi
-
-	$echo >> $output "\
-
-  if test -f \"\$progdir/\$program\"; then"
-
-	# Export our shlibpath_var if we have one.
-	if test "$shlibpath_overrides_runpath" = yes && test -n "$shlibpath_var" && test -n "$temp_rpath"; then
-	  $echo >> $output "\
-    # Add our own library path to $shlibpath_var
-    $shlibpath_var=\"$temp_rpath\$$shlibpath_var\"
-
-    # Some systems cannot cope with colon-terminated $shlibpath_var
-    # The second colon is a workaround for a bug in BeOS R4 sed
-    $shlibpath_var=\`\$echo \"X\$$shlibpath_var\" | \$Xsed -e 's/::*\$//'\`
-
-    export $shlibpath_var
-"
-	fi
-
-	# fixup the dll searchpath if we need to.
-	if test -n "$dllsearchpath"; then
-	  $echo >> $output "\
-    # Add the dll search path components to the executable PATH
-    PATH=$dllsearchpath:\$PATH
-"
-	fi
-
-	$echo >> $output "\
-    if test \"\$libtool_execute_magic\" != \"$magic\"; then
-      # Run the actual program with our arguments.
-"
-	case $host in
-	# Backslashes separate directories on plain windows
-	*-*-mingw | *-*-os2*)
-	  $echo >> $output "\
-      exec \"\$progdir\\\\\$program\" \${1+\"\$@\"}
-"
-	  ;;
-
-	*)
-	  $echo >> $output "\
-      exec \"\$progdir/\$program\" \${1+\"\$@\"}
-"
-	  ;;
-	esac
-	$echo >> $output "\
-      \$echo \"\$0: cannot exec \$program \${1+\"\$@\"}\"
-      exit $EXIT_FAILURE
-    fi
-  else
-    # The program doesn't exist.
-    \$echo \"\$0: error: \\\`\$progdir/\$program' does not exist\" 1>&2
-    \$echo \"This script is just a wrapper for \$program.\" 1>&2
-    $echo \"See the $PACKAGE documentation for more information.\" 1>&2
-    exit $EXIT_FAILURE
-  fi
-fi\
-"
-	chmod +x $output
-      fi
-      exit $EXIT_SUCCESS
-      ;;
-    esac
-
-    # See if we need to build an old-fashioned archive.
-    for oldlib in $oldlibs; do
-
-      if test "$build_libtool_libs" = convenience; then
-	oldobjs="$libobjs_save"
-	addlibs="$convenience"
-	build_libtool_libs=no
-      else
-	if test "$build_libtool_libs" = module; then
-	  oldobjs="$libobjs_save"
-	  build_libtool_libs=no
-	else
-	  oldobjs="$old_deplibs $non_pic_objects"
-	fi
-	addlibs="$old_convenience"
-      fi
-
-      if test -n "$addlibs"; then
-	gentop="$output_objdir/${outputname}x"
-	generated="$generated $gentop"
-
-	func_extract_archives $gentop $addlibs
-	oldobjs="$oldobjs $func_extract_archives_result"
-      fi
-
-      # Do each command in the archive commands.
-      if test -n "$old_archive_from_new_cmds" && test "$build_libtool_libs" = yes; then
-       cmds=$old_archive_from_new_cmds
-      else
-	# POSIX demands no paths to be encoded in archives.  We have
-	# to avoid creating archives with duplicate basenames if we
-	# might have to extract them afterwards, e.g., when creating a
-	# static archive out of a convenience library, or when linking
-	# the entirety of a libtool archive into another (currently
-	# not supported by libtool).
-	if (for obj in $oldobjs
-	    do
-	      $echo "X$obj" | $Xsed -e 's%^.*/%%'
-	    done | sort | sort -uc >/dev/null 2>&1); then
-	  :
-	else
-	  $echo "copying selected object files to avoid basename conflicts..."
-
-	  if test -z "$gentop"; then
-	    gentop="$output_objdir/${outputname}x"
-	    generated="$generated $gentop"
-
-	    $show "${rm}r $gentop"
-	    $run ${rm}r "$gentop"
-	    $show "$mkdir $gentop"
-	    $run $mkdir "$gentop"
-	    exit_status=$?
-	    if test "$exit_status" -ne 0 && test ! -d "$gentop"; then
-	      exit $exit_status
-	    fi
-	  fi
-
-	  save_oldobjs=$oldobjs
-	  oldobjs=
-	  counter=1
-	  for obj in $save_oldobjs
-	  do
-	    objbase=`$echo "X$obj" | $Xsed -e 's%^.*/%%'`
-	    case " $oldobjs " in
-	    " ") oldobjs=$obj ;;
-	    *[\ /]"$objbase "*)
-	      while :; do
-		# Make sure we don't pick an alternate name that also
-		# overlaps.
-		newobj=lt$counter-$objbase
-		counter=`expr $counter + 1`
-		case " $oldobjs " in
-		*[\ /]"$newobj "*) ;;
-		*) if test ! -f "$gentop/$newobj"; then break; fi ;;
-		esac
-	      done
-	      $show "ln $obj $gentop/$newobj || cp $obj $gentop/$newobj"
-	      $run ln "$obj" "$gentop/$newobj" ||
-	      $run cp "$obj" "$gentop/$newobj"
-	      oldobjs="$oldobjs $gentop/$newobj"
-	      ;;
-	    *) oldobjs="$oldobjs $obj" ;;
-	    esac
-	  done
-	fi
-
-	eval cmds=\"$old_archive_cmds\"
-
-	if len=`expr "X$cmds" : ".*"` &&
-	     test "$len" -le "$max_cmd_len" || test "$max_cmd_len" -le -1; then
-	  cmds=$old_archive_cmds
-	else
-	  # the command line is too long to link in one step, link in parts
-	  $echo "using piecewise archive linking..."
-	  save_RANLIB=$RANLIB
-	  RANLIB=:
-	  objlist=
-	  concat_cmds=
-	  save_oldobjs=$oldobjs
-
-	  # Is there a better way of finding the last object in the list?
-	  for obj in $save_oldobjs
-	  do
-	    last_oldobj=$obj
-	  done
-	  for obj in $save_oldobjs
-	  do
-	    oldobjs="$objlist $obj"
-	    objlist="$objlist $obj"
-	    eval test_cmds=\"$old_archive_cmds\"
-	    if len=`expr "X$test_cmds" : ".*" 2>/dev/null` &&
-	       test "$len" -le "$max_cmd_len"; then
-	      :
-	    else
-	      # the above command should be used before it gets too long
-	      oldobjs=$objlist
-	      if test "$obj" = "$last_oldobj" ; then
-	        RANLIB=$save_RANLIB
-	      fi
-	      test -z "$concat_cmds" || concat_cmds=$concat_cmds~
-	      eval concat_cmds=\"\${concat_cmds}$old_archive_cmds\"
-	      objlist=
-	    fi
-	  done
-	  RANLIB=$save_RANLIB
-	  oldobjs=$objlist
-	  if test "X$oldobjs" = "X" ; then
-	    eval cmds=\"\$concat_cmds\"
-	  else
-	    eval cmds=\"\$concat_cmds~\$old_archive_cmds\"
-	  fi
-	fi
-      fi
-      save_ifs="$IFS"; IFS='~'
-      for cmd in $cmds; do
-        eval cmd=\"$cmd\"
-	IFS="$save_ifs"
-	$show "$cmd"
-	$run eval "$cmd" || exit $?
-      done
-      IFS="$save_ifs"
-    done
-
-    if test -n "$generated"; then
-      $show "${rm}r$generated"
-      $run ${rm}r$generated
-    fi
-
-    # Now create the libtool archive.
-    case $output in
-    *.la)
-      old_library=
-      test "$build_old_libs" = yes && old_library="$libname.$libext"
-      $show "creating $output"
-
-      # Preserve any variables that may affect compiler behavior
-      for var in $variables_saved_for_relink; do
-	if eval test -z \"\${$var+set}\"; then
-	  relink_command="{ test -z \"\${$var+set}\" || unset $var || { $var=; export $var; }; }; $relink_command"
-	elif eval var_value=\$$var; test -z "$var_value"; then
-	  relink_command="$var=; export $var; $relink_command"
-	else
-	  var_value=`$echo "X$var_value" | $Xsed -e "$sed_quote_subst"`
-	  relink_command="$var=\"$var_value\"; export $var; $relink_command"
-	fi
-      done
-      # Quote the link command for shipping.
-      relink_command="(cd `pwd`; $SHELL $progpath $preserve_args --mode=relink $libtool_args @inst_prefix_dir@)"
-      relink_command=`$echo "X$relink_command" | $Xsed -e "$sed_quote_subst"`
-      if test "$hardcode_automatic" = yes ; then
-	relink_command=
-      fi
-
-
-      # Only create the output if not a dry run.
-      if test -z "$run"; then
-	for installed in no yes; do
-	  if test "$installed" = yes; then
-	    if test -z "$install_libdir"; then
-	      break
-	    fi
-	    output="$output_objdir/$outputname"i
-	    # Replace all uninstalled libtool libraries with the installed ones
-	    newdependency_libs=
-	    for deplib in $dependency_libs; do
-	      case $deplib in
-	      *.la)
-		name=`$echo "X$deplib" | $Xsed -e 's%^.*/%%'`
-		eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib`
-		if test -z "$libdir"; then
-		  $echo "$modename: \`$deplib' is not a valid libtool archive" 1>&2
-		  exit $EXIT_FAILURE
-		fi
-		newdependency_libs="$newdependency_libs $libdir/$name"
-		;;
-	      *) newdependency_libs="$newdependency_libs $deplib" ;;
-	      esac
-	    done
-	    dependency_libs="$newdependency_libs"
-	    newdlfiles=
-	    for lib in $dlfiles; do
-	      name=`$echo "X$lib" | $Xsed -e 's%^.*/%%'`
-	      eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib`
-	      if test -z "$libdir"; then
-		$echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
-		exit $EXIT_FAILURE
-	      fi
-	      newdlfiles="$newdlfiles $libdir/$name"
-	    done
-	    dlfiles="$newdlfiles"
-	    newdlprefiles=
-	    for lib in $dlprefiles; do
-	      name=`$echo "X$lib" | $Xsed -e 's%^.*/%%'`
-	      eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib`
-	      if test -z "$libdir"; then
-		$echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
-		exit $EXIT_FAILURE
-	      fi
-	      newdlprefiles="$newdlprefiles $libdir/$name"
-	    done
-	    dlprefiles="$newdlprefiles"
-	  else
-	    newdlfiles=
-	    for lib in $dlfiles; do
-	      case $lib in
-		[\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;;
-		*) abs=`pwd`"/$lib" ;;
-	      esac
-	      newdlfiles="$newdlfiles $abs"
-	    done
-	    dlfiles="$newdlfiles"
-	    newdlprefiles=
-	    for lib in $dlprefiles; do
-	      case $lib in
-		[\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;;
-		*) abs=`pwd`"/$lib" ;;
-	      esac
-	      newdlprefiles="$newdlprefiles $abs"
-	    done
-	    dlprefiles="$newdlprefiles"
-	  fi
-	  $rm $output
-	  # place dlname in correct position for cygwin
-	  tdlname=$dlname
-	  case $host,$output,$installed,$module,$dlname in
-	    *cygwin*,*lai,yes,no,*.dll | *mingw*,*lai,yes,no,*.dll) tdlname=../bin/$dlname ;;
-	  esac
-	  $echo > $output "\
-# $outputname - a libtool library file
-# Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
-#
-# Please DO NOT delete this file!
-# It is necessary for linking the library.
-
-# The name that we can dlopen(3).
-dlname='$tdlname'
-
-# Names of this library.
-library_names='$library_names'
-
-# The name of the static archive.
-old_library='$old_library'
-
-# Libraries that this one depends upon.
-dependency_libs='$dependency_libs'
-
-# Version information for $libname.
-current=$current
-age=$age
-revision=$revision
-
-# Is this an already installed library?
-installed=$installed
-
-# Should we warn about portability when linking against -modules?
-shouldnotlink=$module
-
-# Files to dlopen/dlpreopen
-dlopen='$dlfiles'
-dlpreopen='$dlprefiles'
-
-# Directory that this library needs to be installed in:
-libdir='$install_libdir'"
-	  if test "$installed" = no && test "$need_relink" = yes; then
-	    $echo >> $output "\
-relink_command=\"$relink_command\""
-	  fi
-	done
-      fi
-
-      # Do a symbolic link so that the libtool archive can be found in
-      # LD_LIBRARY_PATH before the program is installed.
-      $show "(cd $output_objdir && $rm $outputname && $LN_S ../$outputname $outputname)"
-      $run eval '(cd $output_objdir && $rm $outputname && $LN_S ../$outputname $outputname)' || exit $?
-      ;;
-    esac
-    exit $EXIT_SUCCESS
-    ;;
-
-  # libtool install mode
-  install)
-    modename="$modename: install"
-
-    # There may be an optional sh(1) argument at the beginning of
-    # install_prog (especially on Windows NT).
-    if test "$nonopt" = "$SHELL" || test "$nonopt" = /bin/sh ||
-       # Allow the use of GNU shtool's install command.
-       $echo "X$nonopt" | grep shtool > /dev/null; then
-      # Aesthetically quote it.
-      arg=`$echo "X$nonopt" | $Xsed -e "$sed_quote_subst"`
-      case $arg in
-      *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \	]*|*]*|"")
-	arg="\"$arg\""
-	;;
-      esac
-      install_prog="$arg "
-      arg="$1"
-      shift
-    else
-      install_prog=
-      arg=$nonopt
-    fi
-
-    # The real first argument should be the name of the installation program.
-    # Aesthetically quote it.
-    arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
-    case $arg in
-    *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \	]*|*]*|"")
-      arg="\"$arg\""
-      ;;
-    esac
-    install_prog="$install_prog$arg"
-
-    # We need to accept at least all the BSD install flags.
-    dest=
-    files=
-    opts=
-    prev=
-    install_type=
-    isdir=no
-    stripme=
-    for arg
-    do
-      if test -n "$dest"; then
-	files="$files $dest"
-	dest=$arg
-	continue
-      fi
-
-      case $arg in
-      -d) isdir=yes ;;
-      -f) 
-      	case " $install_prog " in
-	*[\\\ /]cp\ *) ;;
-	*) prev=$arg ;;
-	esac
-	;;
-      -g | -m | -o) prev=$arg ;;
-      -s)
-	stripme=" -s"
-	continue
-	;;
-      -*)
-	;;
-      *)
-	# If the previous option needed an argument, then skip it.
-	if test -n "$prev"; then
-	  prev=
-	else
-	  dest=$arg
-	  continue
-	fi
-	;;
-      esac
-
-      # Aesthetically quote the argument.
-      arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
-      case $arg in
-      *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \	]*|*]*|"")
-	arg="\"$arg\""
-	;;
-      esac
-      install_prog="$install_prog $arg"
-    done
-
-    if test -z "$install_prog"; then
-      $echo "$modename: you must specify an install program" 1>&2
-      $echo "$help" 1>&2
-      exit $EXIT_FAILURE
-    fi
-
-    if test -n "$prev"; then
-      $echo "$modename: the \`$prev' option requires an argument" 1>&2
-      $echo "$help" 1>&2
-      exit $EXIT_FAILURE
-    fi
-
-    if test -z "$files"; then
-      if test -z "$dest"; then
-	$echo "$modename: no file or destination specified" 1>&2
-      else
-	$echo "$modename: you must specify a destination" 1>&2
-      fi
-      $echo "$help" 1>&2
-      exit $EXIT_FAILURE
-    fi
-
-    # Strip any trailing slash from the destination.
-    dest=`$echo "X$dest" | $Xsed -e 's%/$%%'`
-
-    # Check to see that the destination is a directory.
-    test -d "$dest" && isdir=yes
-    if test "$isdir" = yes; then
-      destdir="$dest"
-      destname=
-    else
-      destdir=`$echo "X$dest" | $Xsed -e 's%/[^/]*$%%'`
-      test "X$destdir" = "X$dest" && destdir=.
-      destname=`$echo "X$dest" | $Xsed -e 's%^.*/%%'`
-
-      # Not a directory, so check to see that there is only one file specified.
-      set dummy $files
-      if test "$#" -gt 2; then
-	$echo "$modename: \`$dest' is not a directory" 1>&2
-	$echo "$help" 1>&2
-	exit $EXIT_FAILURE
-      fi
-    fi
-    case $destdir in
-    [\\/]* | [A-Za-z]:[\\/]*) ;;
-    *)
-      for file in $files; do
-	case $file in
-	*.lo) ;;
-	*)
-	  $echo "$modename: \`$destdir' must be an absolute directory name" 1>&2
-	  $echo "$help" 1>&2
-	  exit $EXIT_FAILURE
-	  ;;
-	esac
-      done
-      ;;
-    esac
-
-    # This variable tells wrapper scripts just to set variables rather
-    # than running their programs.
-    libtool_install_magic="$magic"
-
-    staticlibs=
-    future_libdirs=
-    current_libdirs=
-    for file in $files; do
-
-      # Do each installation.
-      case $file in
-      *.$libext)
-	# Do the static libraries later.
-	staticlibs="$staticlibs $file"
-	;;
-
-      *.la)
-	# Check to see that this really is a libtool archive.
-	if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then :
-	else
-	  $echo "$modename: \`$file' is not a valid libtool archive" 1>&2
-	  $echo "$help" 1>&2
-	  exit $EXIT_FAILURE
-	fi
-
-	library_names=
-	old_library=
-	relink_command=
-	# If there is no directory component, then add one.
-	case $file in
-	*/* | *\\*) . $file ;;
-	*) . ./$file ;;
-	esac
-
-	# Add the libdir to current_libdirs if it is the destination.
-	if test "X$destdir" = "X$libdir"; then
-	  case "$current_libdirs " in
-	  *" $libdir "*) ;;
-	  *) current_libdirs="$current_libdirs $libdir" ;;
-	  esac
-	else
-	  # Note the libdir as a future libdir.
-	  case "$future_libdirs " in
-	  *" $libdir "*) ;;
-	  *) future_libdirs="$future_libdirs $libdir" ;;
-	  esac
-	fi
-
-	dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`/
-	test "X$dir" = "X$file/" && dir=
-	dir="$dir$objdir"
-
-	if test -n "$relink_command"; then
-	  # Determine the prefix the user has applied to our future dir.
-	  inst_prefix_dir=`$echo "$destdir" | $SED "s%$libdir\$%%"`
-
-	  # Don't allow the user to place us outside of our expected
-	  # location b/c this prevents finding dependent libraries that
-	  # are installed to the same prefix.
-	  # At present, this check doesn't affect windows .dll's that
-	  # are installed into $libdir/../bin (currently, that works fine)
-	  # but it's something to keep an eye on.
-	  if test "$inst_prefix_dir" = "$destdir"; then
-	    $echo "$modename: error: cannot install \`$file' to a directory not ending in $libdir" 1>&2
-	    exit $EXIT_FAILURE
-	  fi
-
-	  if test -n "$inst_prefix_dir"; then
-	    # Stick the inst_prefix_dir data into the link command.
-	    relink_command=`$echo "$relink_command" | $SED "s%@inst_prefix_dir@%-inst-prefix-dir $inst_prefix_dir%"`
-	  else
-	    relink_command=`$echo "$relink_command" | $SED "s%@inst_prefix_dir@%%"`
-	  fi
-
-	  $echo "$modename: warning: relinking \`$file'" 1>&2
-	  $show "$relink_command"
-	  if $run eval "$relink_command"; then :
-	  else
-	    $echo "$modename: error: relink \`$file' with the above command before installing it" 1>&2
-	    exit $EXIT_FAILURE
-	  fi
-	fi
-
-	# See the names of the shared library.
-	set dummy $library_names
-	if test -n "$2"; then
-	  realname="$2"
-	  shift
-	  shift
-
-	  srcname="$realname"
-	  test -n "$relink_command" && srcname="$realname"T
-
-	  # Install the shared library and build the symlinks.
-	  $show "$install_prog $dir/$srcname $destdir/$realname"
-	  $run eval "$install_prog $dir/$srcname $destdir/$realname" || exit $?
-	  if test -n "$stripme" && test -n "$striplib"; then
-	    $show "$striplib $destdir/$realname"
-	    $run eval "$striplib $destdir/$realname" || exit $?
-	  fi
-
-	  if test "$#" -gt 0; then
-	    # Delete the old symlinks, and create new ones.
-	    # Try `ln -sf' first, because the `ln' binary might depend on
-	    # the symlink we replace!  Solaris /bin/ln does not understand -f,
-	    # so we also need to try rm && ln -s.
-	    for linkname
-	    do
-	      if test "$linkname" != "$realname"; then
-                $show "(cd $destdir && { $LN_S -f $realname $linkname || { $rm $linkname && $LN_S $realname $linkname; }; })"
-                $run eval "(cd $destdir && { $LN_S -f $realname $linkname || { $rm $linkname && $LN_S $realname $linkname; }; })"
-	      fi
-	    done
-	  fi
-
-	  # Do each command in the postinstall commands.
-	  lib="$destdir/$realname"
-	  cmds=$postinstall_cmds
-	  save_ifs="$IFS"; IFS='~'
-	  for cmd in $cmds; do
-	    IFS="$save_ifs"
-	    eval cmd=\"$cmd\"
-	    $show "$cmd"
-	    $run eval "$cmd" || {
-	      lt_exit=$?
-
-	      # Restore the uninstalled library and exit
-	      if test "$mode" = relink; then
-		$run eval '(cd $output_objdir && $rm ${realname}T && $mv ${realname}U $realname)'
-	      fi
-
-	      exit $lt_exit
-	    }
-	  done
-	  IFS="$save_ifs"
-	fi
-
-	# Install the pseudo-library for information purposes.
-	name=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
-	instname="$dir/$name"i
-	$show "$install_prog $instname $destdir/$name"
-	$run eval "$install_prog $instname $destdir/$name" || exit $?
-
-	# Maybe install the static library, too.
-	test -n "$old_library" && staticlibs="$staticlibs $dir/$old_library"
-	;;
-
-      *.lo)
-	# Install (i.e. copy) a libtool object.
-
-	# Figure out destination file name, if it wasn't already specified.
-	if test -n "$destname"; then
-	  destfile="$destdir/$destname"
-	else
-	  destfile=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
-	  destfile="$destdir/$destfile"
-	fi
-
-	# Deduce the name of the destination old-style object file.
-	case $destfile in
-	*.lo)
-	  staticdest=`$echo "X$destfile" | $Xsed -e "$lo2o"`
-	  ;;
-	*.$objext)
-	  staticdest="$destfile"
-	  destfile=
-	  ;;
-	*)
-	  $echo "$modename: cannot copy a libtool object to \`$destfile'" 1>&2
-	  $echo "$help" 1>&2
-	  exit $EXIT_FAILURE
-	  ;;
-	esac
-
-	# Install the libtool object if requested.
-	if test -n "$destfile"; then
-	  $show "$install_prog $file $destfile"
-	  $run eval "$install_prog $file $destfile" || exit $?
-	fi
-
-	# Install the old object if enabled.
-	if test "$build_old_libs" = yes; then
-	  # Deduce the name of the old-style object file.
-	  staticobj=`$echo "X$file" | $Xsed -e "$lo2o"`
-
-	  $show "$install_prog $staticobj $staticdest"
-	  $run eval "$install_prog \$staticobj \$staticdest" || exit $?
-	fi
-	exit $EXIT_SUCCESS
-	;;
-
-      *)
-	# Figure out destination file name, if it wasn't already specified.
-	if test -n "$destname"; then
-	  destfile="$destdir/$destname"
-	else
-	  destfile=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
-	  destfile="$destdir/$destfile"
-	fi
-
-	# If the file is missing, and there is a .exe on the end, strip it
-	# because it is most likely a libtool script we actually want to
-	# install
-	stripped_ext=""
-	case $file in
-	  *.exe)
-	    if test ! -f "$file"; then
-	      file=`$echo $file|${SED} 's,.exe$,,'`
-	      stripped_ext=".exe"
-	    fi
-	    ;;
-	esac
-
-	# Do a test to see if this is really a libtool program.
-	case $host in
-	*cygwin*|*mingw*)
-	    wrapper=`$echo $file | ${SED} -e 's,.exe$,,'`
-	    ;;
-	*)
-	    wrapper=$file
-	    ;;
-	esac
-	if (${SED} -e '4q' $wrapper | grep "^# Generated by .*$PACKAGE")>/dev/null 2>&1; then
-	  notinst_deplibs=
-	  relink_command=
-
-	  # Note that it is not necessary on cygwin/mingw to append a dot to
-	  # foo even if both foo and FILE.exe exist: automatic-append-.exe
-	  # behavior happens only for exec(3), not for open(2)!  Also, sourcing
-	  # `FILE.' does not work on cygwin managed mounts.
-	  #
-	  # If there is no directory component, then add one.
-	  case $wrapper in
-	  */* | *\\*) . ${wrapper} ;;
-	  *) . ./${wrapper} ;;
-	  esac
-
-	  # Check the variables that should have been set.
-	  if test -z "$notinst_deplibs"; then
-	    $echo "$modename: invalid libtool wrapper script \`$wrapper'" 1>&2
-	    exit $EXIT_FAILURE
-	  fi
-
-	  finalize=yes
-	  for lib in $notinst_deplibs; do
-	    # Check to see that each library is installed.
-	    libdir=
-	    if test -f "$lib"; then
-	      # If there is no directory component, then add one.
-	      case $lib in
-	      */* | *\\*) . $lib ;;
-	      *) . ./$lib ;;
-	      esac
-	    fi
-	    libfile="$libdir/"`$echo "X$lib" | $Xsed -e 's%^.*/%%g'` ### testsuite: skip nested quoting test
-	    if test -n "$libdir" && test ! -f "$libfile"; then
-	      $echo "$modename: warning: \`$lib' has not been installed in \`$libdir'" 1>&2
-	      finalize=no
-	    fi
-	  done
-
-	  relink_command=
-	  # Note that it is not necessary on cygwin/mingw to append a dot to
-	  # foo even if both foo and FILE.exe exist: automatic-append-.exe
-	  # behavior happens only for exec(3), not for open(2)!  Also, sourcing
-	  # `FILE.' does not work on cygwin managed mounts.
-	  #
-	  # If there is no directory component, then add one.
-	  case $wrapper in
-	  */* | *\\*) . ${wrapper} ;;
-	  *) . ./${wrapper} ;;
-	  esac
-
-	  outputname=
-	  if test "$fast_install" = no && test -n "$relink_command"; then
-	    if test "$finalize" = yes && test -z "$run"; then
-	      tmpdir=`func_mktempdir`
-	      file=`$echo "X$file$stripped_ext" | $Xsed -e 's%^.*/%%'`
-	      outputname="$tmpdir/$file"
-	      # Replace the output file specification.
-	      relink_command=`$echo "X$relink_command" | $Xsed -e 's%@OUTPUT@%'"$outputname"'%g'`
-
-	      $show "$relink_command"
-	      if $run eval "$relink_command"; then :
-	      else
-		$echo "$modename: error: relink \`$file' with the above command before installing it" 1>&2
-		${rm}r "$tmpdir"
-		continue
-	      fi
-	      file="$outputname"
-	    else
-	      $echo "$modename: warning: cannot relink \`$file'" 1>&2
-	    fi
-	  else
-	    # Install the binary that we compiled earlier.
-	    file=`$echo "X$file$stripped_ext" | $Xsed -e "s%\([^/]*\)$%$objdir/\1%"`
-	  fi
-	fi
-
-	# remove .exe since cygwin /usr/bin/install will append another
-	# one anyway 
-	case $install_prog,$host in
-	*/usr/bin/install*,*cygwin*)
-	  case $file:$destfile in
-	  *.exe:*.exe)
-	    # this is ok
-	    ;;
-	  *.exe:*)
-	    destfile=$destfile.exe
-	    ;;
-	  *:*.exe)
-	    destfile=`$echo $destfile | ${SED} -e 's,.exe$,,'`
-	    ;;
-	  esac
-	  ;;
-	esac
-	$show "$install_prog$stripme $file $destfile"
-	$run eval "$install_prog\$stripme \$file \$destfile" || exit $?
-	test -n "$outputname" && ${rm}r "$tmpdir"
-	;;
-      esac
-    done
-
-    for file in $staticlibs; do
-      name=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
-
-      # Set up the ranlib parameters.
-      oldlib="$destdir/$name"
-
-      $show "$install_prog $file $oldlib"
-      $run eval "$install_prog \$file \$oldlib" || exit $?
-
-      if test -n "$stripme" && test -n "$old_striplib"; then
-	$show "$old_striplib $oldlib"
-	$run eval "$old_striplib $oldlib" || exit $?
-      fi
-
-      # Do each command in the postinstall commands.
-      cmds=$old_postinstall_cmds
-      save_ifs="$IFS"; IFS='~'
-      for cmd in $cmds; do
-	IFS="$save_ifs"
-	eval cmd=\"$cmd\"
-	$show "$cmd"
-	$run eval "$cmd" || exit $?
-      done
-      IFS="$save_ifs"
-    done
-
-    if test -n "$future_libdirs"; then
-      $echo "$modename: warning: remember to run \`$progname --finish$future_libdirs'" 1>&2
-    fi
-
-    if test -n "$current_libdirs"; then
-      # Maybe just do a dry run.
-      test -n "$run" && current_libdirs=" -n$current_libdirs"
-      exec_cmd='$SHELL $progpath $preserve_args --finish$current_libdirs'
-    else
-      exit $EXIT_SUCCESS
-    fi
-    ;;
-
-  # libtool finish mode
-  finish)
-    modename="$modename: finish"
-    libdirs="$nonopt"
-    admincmds=
-
-    if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then
-      for dir
-      do
-	libdirs="$libdirs $dir"
-      done
-
-      for libdir in $libdirs; do
-	if test -n "$finish_cmds"; then
-	  # Do each command in the finish commands.
-	  cmds=$finish_cmds
-	  save_ifs="$IFS"; IFS='~'
-	  for cmd in $cmds; do
-	    IFS="$save_ifs"
-	    eval cmd=\"$cmd\"
-	    $show "$cmd"
-	    $run eval "$cmd" || admincmds="$admincmds
-       $cmd"
-	  done
-	  IFS="$save_ifs"
-	fi
-	if test -n "$finish_eval"; then
-	  # Do the single finish_eval.
-	  eval cmds=\"$finish_eval\"
-	  $run eval "$cmds" || admincmds="$admincmds
-       $cmds"
-	fi
-      done
-    fi
-
-    # Exit here if they wanted silent mode.
-    test "$show" = : && exit $EXIT_SUCCESS
-
-    $echo "X----------------------------------------------------------------------" | $Xsed
-    $echo "Libraries have been installed in:"
-    for libdir in $libdirs; do
-      $echo "   $libdir"
-    done
-    $echo
-    $echo "If you ever happen to want to link against installed libraries"
-    $echo "in a given directory, LIBDIR, you must either use libtool, and"
-    $echo "specify the full pathname of the library, or use the \`-LLIBDIR'"
-    $echo "flag during linking and do at least one of the following:"
-    if test -n "$shlibpath_var"; then
-      $echo "   - add LIBDIR to the \`$shlibpath_var' environment variable"
-      $echo "     during execution"
-    fi
-    if test -n "$runpath_var"; then
-      $echo "   - add LIBDIR to the \`$runpath_var' environment variable"
-      $echo "     during linking"
-    fi
-    if test -n "$hardcode_libdir_flag_spec"; then
-      libdir=LIBDIR
-      eval flag=\"$hardcode_libdir_flag_spec\"
-
-      $echo "   - use the \`$flag' linker flag"
-    fi
-    if test -n "$admincmds"; then
-      $echo "   - have your system administrator run these commands:$admincmds"
-    fi
-    if test -f /etc/ld.so.conf; then
-      $echo "   - have your system administrator add LIBDIR to \`/etc/ld.so.conf'"
-    fi
-    $echo
-    $echo "See any operating system documentation about shared libraries for"
-    $echo "more information, such as the ld(1) and ld.so(8) manual pages."
-    $echo "X----------------------------------------------------------------------" | $Xsed
-    exit $EXIT_SUCCESS
-    ;;
-
-  # libtool execute mode
-  execute)
-    modename="$modename: execute"
-
-    # The first argument is the command name.
-    cmd="$nonopt"
-    if test -z "$cmd"; then
-      $echo "$modename: you must specify a COMMAND" 1>&2
-      $echo "$help"
-      exit $EXIT_FAILURE
-    fi
-
-    # Handle -dlopen flags immediately.
-    for file in $execute_dlfiles; do
-      if test ! -f "$file"; then
-	$echo "$modename: \`$file' is not a file" 1>&2
-	$echo "$help" 1>&2
-	exit $EXIT_FAILURE
-      fi
-
-      dir=
-      case $file in
-      *.la)
-	# Check to see that this really is a libtool archive.
-	if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then :
-	else
-	  $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
-	  $echo "$help" 1>&2
-	  exit $EXIT_FAILURE
-	fi
-
-	# Read the libtool library.
-	dlname=
-	library_names=
-
-	# If there is no directory component, then add one.
-	case $file in
-	*/* | *\\*) . $file ;;
-	*) . ./$file ;;
-	esac
-
-	# Skip this library if it cannot be dlopened.
-	if test -z "$dlname"; then
-	  # Warn if it was a shared library.
-	  test -n "$library_names" && $echo "$modename: warning: \`$file' was not linked with \`-export-dynamic'"
-	  continue
-	fi
-
-	dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`
-	test "X$dir" = "X$file" && dir=.
-
-	if test -f "$dir/$objdir/$dlname"; then
-	  dir="$dir/$objdir"
-	else
-	  $echo "$modename: cannot find \`$dlname' in \`$dir' or \`$dir/$objdir'" 1>&2
-	  exit $EXIT_FAILURE
-	fi
-	;;
-
-      *.lo)
-	# Just add the directory containing the .lo file.
-	dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`
-	test "X$dir" = "X$file" && dir=.
-	;;
-
-      *)
-	$echo "$modename: warning \`-dlopen' is ignored for non-libtool libraries and objects" 1>&2
-	continue
-	;;
-      esac
-
-      # Get the absolute pathname.
-      absdir=`cd "$dir" && pwd`
-      test -n "$absdir" && dir="$absdir"
-
-      # Now add the directory to shlibpath_var.
-      if eval "test -z \"\$$shlibpath_var\""; then
-	eval "$shlibpath_var=\"\$dir\""
-      else
-	eval "$shlibpath_var=\"\$dir:\$$shlibpath_var\""
-      fi
-    done
-
-    # This variable tells wrapper scripts just to set shlibpath_var
-    # rather than running their programs.
-    libtool_execute_magic="$magic"
-
-    # Check if any of the arguments is a wrapper script.
-    args=
-    for file
-    do
-      case $file in
-      -*) ;;
-      *)
-	# Do a test to see if this is really a libtool program.
-	if (${SED} -e '4q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
-	  # If there is no directory component, then add one.
-	  case $file in
-	  */* | *\\*) . $file ;;
-	  *) . ./$file ;;
-	  esac
-
-	  # Transform arg to wrapped name.
-	  file="$progdir/$program"
-	fi
-	;;
-      esac
-      # Quote arguments (to preserve shell metacharacters).
-      file=`$echo "X$file" | $Xsed -e "$sed_quote_subst"`
-      args="$args \"$file\""
-    done
-
-    if test -z "$run"; then
-      if test -n "$shlibpath_var"; then
-	# Export the shlibpath_var.
-	eval "export $shlibpath_var"
-      fi
-
-      # Restore saved environment variables
-      if test "${save_LC_ALL+set}" = set; then
-	LC_ALL="$save_LC_ALL"; export LC_ALL
-      fi
-      if test "${save_LANG+set}" = set; then
-	LANG="$save_LANG"; export LANG
-      fi
-
-      # Now prepare to actually exec the command.
-      exec_cmd="\$cmd$args"
-    else
-      # Display what would be done.
-      if test -n "$shlibpath_var"; then
-	eval "\$echo \"\$shlibpath_var=\$$shlibpath_var\""
-	$echo "export $shlibpath_var"
-      fi
-      $echo "$cmd$args"
-      exit $EXIT_SUCCESS
-    fi
-    ;;
-
-  # libtool clean and uninstall mode
-  clean | uninstall)
-    modename="$modename: $mode"
-    rm="$nonopt"
-    files=
-    rmforce=
-    exit_status=0
-
-    # This variable tells wrapper scripts just to set variables rather
-    # than running their programs.
-    libtool_install_magic="$magic"
-
-    for arg
-    do
-      case $arg in
-      -f) rm="$rm $arg"; rmforce=yes ;;
-      -*) rm="$rm $arg" ;;
-      *) files="$files $arg" ;;
-      esac
-    done
-
-    if test -z "$rm"; then
-      $echo "$modename: you must specify an RM program" 1>&2
-      $echo "$help" 1>&2
-      exit $EXIT_FAILURE
-    fi
-
-    rmdirs=
-
-    origobjdir="$objdir"
-    for file in $files; do
-      dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`
-      if test "X$dir" = "X$file"; then
-	dir=.
-	objdir="$origobjdir"
-      else
-	objdir="$dir/$origobjdir"
-      fi
-      name=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
-      test "$mode" = uninstall && objdir="$dir"
-
-      # Remember objdir for removal later, being careful to avoid duplicates
-      if test "$mode" = clean; then
-	case " $rmdirs " in
-	  *" $objdir "*) ;;
-	  *) rmdirs="$rmdirs $objdir" ;;
-	esac
-      fi
-
-      # Don't error if the file doesn't exist and rm -f was used.
-      if (test -L "$file") >/dev/null 2>&1 \
-	|| (test -h "$file") >/dev/null 2>&1 \
-	|| test -f "$file"; then
-	:
-      elif test -d "$file"; then
-	exit_status=1
-	continue
-      elif test "$rmforce" = yes; then
-	continue
-      fi
-
-      rmfiles="$file"
-
-      case $name in
-      *.la)
-	# Possibly a libtool archive, so verify it.
-	if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
-	  . $dir/$name
-
-	  # Delete the libtool libraries and symlinks.
-	  for n in $library_names; do
-	    rmfiles="$rmfiles $objdir/$n"
-	  done
-	  test -n "$old_library" && rmfiles="$rmfiles $objdir/$old_library"
-
-	  case "$mode" in
-	  clean)
-	    case "  $library_names " in
-	    # "  " in the beginning catches empty $dlname
-	    *" $dlname "*) ;;
-	    *) rmfiles="$rmfiles $objdir/$dlname" ;;
-	    esac
-	     test -n "$libdir" && rmfiles="$rmfiles $objdir/$name $objdir/${name}i"
-	    ;;
-	  uninstall)
-	    if test -n "$library_names"; then
-	      # Do each command in the postuninstall commands.
-	      cmds=$postuninstall_cmds
-	      save_ifs="$IFS"; IFS='~'
-	      for cmd in $cmds; do
-		IFS="$save_ifs"
-		eval cmd=\"$cmd\"
-		$show "$cmd"
-		$run eval "$cmd"
-		if test "$?" -ne 0 && test "$rmforce" != yes; then
-		  exit_status=1
-		fi
-	      done
-	      IFS="$save_ifs"
-	    fi
-
-	    if test -n "$old_library"; then
-	      # Do each command in the old_postuninstall commands.
-	      cmds=$old_postuninstall_cmds
-	      save_ifs="$IFS"; IFS='~'
-	      for cmd in $cmds; do
-		IFS="$save_ifs"
-		eval cmd=\"$cmd\"
-		$show "$cmd"
-		$run eval "$cmd"
-		if test "$?" -ne 0 && test "$rmforce" != yes; then
-		  exit_status=1
-		fi
-	      done
-	      IFS="$save_ifs"
-	    fi
-	    # FIXME: should reinstall the best remaining shared library.
-	    ;;
-	  esac
-	fi
-	;;
-
-      *.lo)
-	# Possibly a libtool object, so verify it.
-	if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
-
-	  # Read the .lo file
-	  . $dir/$name
-
-	  # Add PIC object to the list of files to remove.
-	  if test -n "$pic_object" \
-	     && test "$pic_object" != none; then
-	    rmfiles="$rmfiles $dir/$pic_object"
-	  fi
-
-	  # Add non-PIC object to the list of files to remove.
-	  if test -n "$non_pic_object" \
-	     && test "$non_pic_object" != none; then
-	    rmfiles="$rmfiles $dir/$non_pic_object"
-	  fi
-	fi
-	;;
-
-      *)
-	if test "$mode" = clean ; then
-	  noexename=$name
-	  case $file in
-	  *.exe)
-	    file=`$echo $file|${SED} 's,.exe$,,'`
-	    noexename=`$echo $name|${SED} 's,.exe$,,'`
-	    # $file with .exe has already been added to rmfiles,
-	    # add $file without .exe
-	    rmfiles="$rmfiles $file"
-	    ;;
-	  esac
-	  # Do a test to see if this is a libtool program.
-	  if (${SED} -e '4q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
-	    relink_command=
-	    . $dir/$noexename
-
-	    # note $name still contains .exe if it was in $file originally
-	    # as does the version of $file that was added into $rmfiles
-	    rmfiles="$rmfiles $objdir/$name $objdir/${name}S.${objext}"
-	    if test "$fast_install" = yes && test -n "$relink_command"; then
-	      rmfiles="$rmfiles $objdir/lt-$name"
-	    fi
-	    if test "X$noexename" != "X$name" ; then
-	      rmfiles="$rmfiles $objdir/lt-${noexename}.c"
-	    fi
-	  fi
-	fi
-	;;
-      esac
-      $show "$rm $rmfiles"
-      $run $rm $rmfiles || exit_status=1
-    done
-    objdir="$origobjdir"
-
-    # Try to remove the ${objdir}s in the directories where we deleted files
-    for dir in $rmdirs; do
-      if test -d "$dir"; then
-	$show "rmdir $dir"
-	$run rmdir $dir >/dev/null 2>&1
-      fi
-    done
-
-    exit $exit_status
-    ;;
-
-  "")
-    $echo "$modename: you must specify a MODE" 1>&2
-    $echo "$generic_help" 1>&2
-    exit $EXIT_FAILURE
-    ;;
-  esac
-
-  if test -z "$exec_cmd"; then
-    $echo "$modename: invalid operation mode \`$mode'" 1>&2
-    $echo "$generic_help" 1>&2
-    exit $EXIT_FAILURE
-  fi
-fi # test -z "$show_help"
-
-if test -n "$exec_cmd"; then
-  eval exec $exec_cmd
-  exit $EXIT_FAILURE
-fi
-
-# We need to display help for each of the modes.
-case $mode in
-"") $echo \
-"Usage: $modename [OPTION]... [MODE-ARG]...
-
-Provide generalized library-building support services.
-
-    --config          show all configuration variables
-    --debug           enable verbose shell tracing
--n, --dry-run         display commands without modifying any files
-    --features        display basic configuration information and exit
-    --finish          same as \`--mode=finish'
-    --help            display this help message and exit
-    --mode=MODE       use operation mode MODE [default=inferred from MODE-ARGS]
-    --quiet           same as \`--silent'
-    --silent          don't print informational messages
-    --tag=TAG         use configuration variables from tag TAG
-    --version         print version information
-
-MODE must be one of the following:
-
-      clean           remove files from the build directory
-      compile         compile a source file into a libtool object
-      execute         automatically set library path, then run a program
-      finish          complete the installation of libtool libraries
-      install         install libraries or executables
-      link            create a library or an executable
-      uninstall       remove libraries from an installed directory
-
-MODE-ARGS vary depending on the MODE.  Try \`$modename --help --mode=MODE' for
-a more detailed description of MODE.
-
-Report bugs to <bug-libtool@gnu.org>."
-  exit $EXIT_SUCCESS
-  ;;
-
-clean)
-  $echo \
-"Usage: $modename [OPTION]... --mode=clean RM [RM-OPTION]... FILE...
-
-Remove files from the build directory.
-
-RM is the name of the program to use to delete files associated with each FILE
-(typically \`/bin/rm').  RM-OPTIONS are options (such as \`-f') to be passed
-to RM.
-
-If FILE is a libtool library, object or program, all the files associated
-with it are deleted. Otherwise, only FILE itself is deleted using RM."
-  ;;
-
-compile)
-  $echo \
-"Usage: $modename [OPTION]... --mode=compile COMPILE-COMMAND... SOURCEFILE
-
-Compile a source file into a libtool library object.
-
-This mode accepts the following additional options:
-
-  -o OUTPUT-FILE    set the output file name to OUTPUT-FILE
-  -prefer-pic       try to building PIC objects only
-  -prefer-non-pic   try to building non-PIC objects only
-  -static           always build a \`.o' file suitable for static linking
-
-COMPILE-COMMAND is a command to be used in creating a \`standard' object file
-from the given SOURCEFILE.
-
-The output file name is determined by removing the directory component from
-SOURCEFILE, then substituting the C source code suffix \`.c' with the
-library object suffix, \`.lo'."
-  ;;
-
-execute)
-  $echo \
-"Usage: $modename [OPTION]... --mode=execute COMMAND [ARGS]...
-
-Automatically set library path, then run a program.
-
-This mode accepts the following additional options:
-
-  -dlopen FILE      add the directory containing FILE to the library path
-
-This mode sets the library path environment variable according to \`-dlopen'
-flags.
-
-If any of the ARGS are libtool executable wrappers, then they are translated
-into their corresponding uninstalled binary, and any of their required library
-directories are added to the library path.
-
-Then, COMMAND is executed, with ARGS as arguments."
-  ;;
-
-finish)
-  $echo \
-"Usage: $modename [OPTION]... --mode=finish [LIBDIR]...
-
-Complete the installation of libtool libraries.
-
-Each LIBDIR is a directory that contains libtool libraries.
-
-The commands that this mode executes may require superuser privileges.  Use
-the \`--dry-run' option if you just want to see what would be executed."
-  ;;
-
-install)
-  $echo \
-"Usage: $modename [OPTION]... --mode=install INSTALL-COMMAND...
-
-Install executables or libraries.
-
-INSTALL-COMMAND is the installation command.  The first component should be
-either the \`install' or \`cp' program.
-
-The rest of the components are interpreted as arguments to that command (only
-BSD-compatible install options are recognized)."
-  ;;
-
-link)
-  $echo \
-"Usage: $modename [OPTION]... --mode=link LINK-COMMAND...
-
-Link object files or libraries together to form another library, or to
-create an executable program.
-
-LINK-COMMAND is a command using the C compiler that you would use to create
-a program from several object files.
-
-The following components of LINK-COMMAND are treated specially:
-
-  -all-static       do not do any dynamic linking at all
-  -avoid-version    do not add a version suffix if possible
-  -dlopen FILE      \`-dlpreopen' FILE if it cannot be dlopened at runtime
-  -dlpreopen FILE   link in FILE and add its symbols to lt_preloaded_symbols
-  -export-dynamic   allow symbols from OUTPUT-FILE to be resolved with dlsym(3)
-  -export-symbols SYMFILE
-		    try to export only the symbols listed in SYMFILE
-  -export-symbols-regex REGEX
-		    try to export only the symbols matching REGEX
-  -LLIBDIR          search LIBDIR for required installed libraries
-  -lNAME            OUTPUT-FILE requires the installed library libNAME
-  -module           build a library that can dlopened
-  -no-fast-install  disable the fast-install mode
-  -no-install       link a not-installable executable
-  -no-undefined     declare that a library does not refer to external symbols
-  -o OUTPUT-FILE    create OUTPUT-FILE from the specified objects
-  -objectlist FILE  Use a list of object files found in FILE to specify objects
-  -precious-files-regex REGEX
-                    don't remove output files matching REGEX
-  -release RELEASE  specify package release information
-  -rpath LIBDIR     the created library will eventually be installed in LIBDIR
-  -R[ ]LIBDIR       add LIBDIR to the runtime path of programs and libraries
-  -static           do not do any dynamic linking of libtool libraries
-  -version-info CURRENT[:REVISION[:AGE]]
-		    specify library version info [each variable defaults to 0]
-
-All other options (arguments beginning with \`-') are ignored.
-
-Every other argument is treated as a filename.  Files ending in \`.la' are
-treated as uninstalled libtool libraries, other files are standard or library
-object files.
-
-If the OUTPUT-FILE ends in \`.la', then a libtool library is created,
-only library objects (\`.lo' files) may be specified, and \`-rpath' is
-required, except when creating a convenience library.
-
-If OUTPUT-FILE ends in \`.a' or \`.lib', then a standard library is created
-using \`ar' and \`ranlib', or on Windows using \`lib'.
-
-If OUTPUT-FILE ends in \`.lo' or \`.${objext}', then a reloadable object file
-is created, otherwise an executable program is created."
-  ;;
-
-uninstall)
-  $echo \
-"Usage: $modename [OPTION]... --mode=uninstall RM [RM-OPTION]... FILE...
-
-Remove libraries from an installation directory.
-
-RM is the name of the program to use to delete files associated with each FILE
-(typically \`/bin/rm').  RM-OPTIONS are options (such as \`-f') to be passed
-to RM.
-
-If FILE is a libtool library, all the files associated with it are deleted.
-Otherwise, only FILE itself is deleted using RM."
-  ;;
-
-*)
-  $echo "$modename: invalid operation mode \`$mode'" 1>&2
-  $echo "$help" 1>&2
-  exit $EXIT_FAILURE
-  ;;
-esac
-
-$echo
-$echo "Try \`$modename --help' for more information about other modes."
-
-exit $?
-
-# The TAGs below are defined such that we never get into a situation
-# in which we disable both kinds of libraries.  Given conflicting
-# choices, we go for a static library, that is the most portable,
-# since we can't tell whether shared libraries were disabled because
-# the user asked for that or because the platform doesn't support
-# them.  This is particularly important on AIX, because we don't
-# support having both static and shared libraries enabled at the same
-# time on that platform, so we default to a shared-only configuration.
-# If a disable-shared tag is given, we'll fallback to a static-only
-# configuration.  But we'll never go from static-only to shared-only.
-
-# ### BEGIN LIBTOOL TAG CONFIG: disable-shared
-disable_libs=shared
-# ### END LIBTOOL TAG CONFIG: disable-shared
-
-# ### BEGIN LIBTOOL TAG CONFIG: disable-static
-disable_libs=static
-# ### END LIBTOOL TAG CONFIG: disable-static
-
-# Local Variables:
-# mode:shell-script
-# sh-indentation:2
-# End:
diff --git a/frontends/vsyasm/Makefile.inc b/frontends/vsyasm/Makefile.inc
new file mode 100644
index 0000000..df8d9cf
--- /dev/null
+++ b/frontends/vsyasm/Makefile.inc
@@ -0,0 +1,9 @@
+bin_PROGRAMS += vsyasm
+
+vsyasm_SOURCES  = frontends/vsyasm/vsyasm.c
+vsyasm_SOURCES += frontends/yasm/yasm-options.c
+vsyasm_SOURCES += frontends/yasm/yasm-options.h
+
+$(srcdir)/frontends/vsyasm/vsyasm.c: license.c
+
+vsyasm_LDADD = libyasm.a $(INTLLIBS)
diff --git a/frontends/vsyasm/vsyasm.c b/frontends/vsyasm/vsyasm.c
new file mode 100644
index 0000000..4ab4636
--- /dev/null
+++ b/frontends/vsyasm/vsyasm.c
@@ -0,0 +1,1416 @@
+/*
+ * Program entry point, command line parsing
+ *
+ *  Copyright (C) 2001-2007  Peter Johnson
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. 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 AUTHOR AND OTHER 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 AUTHOR OR OTHER 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 <util.h>
+
+#include <ctype.h>
+#include <libyasm/compat-queue.h>
+#include <libyasm/bitvect.h>
+#include <libyasm.h>
+
+#ifdef HAVE_LIBGEN_H
+#include <libgen.h>
+#endif
+
+#include "frontends/yasm/yasm-options.h"
+
+#ifdef CMAKE_BUILD
+#include "frontends/yasm/yasm-plugin.h"
+#endif
+
+#include "license.c"
+
+/*@null@*/ /*@only@*/ static char *objdir_pathname = NULL;
+/*@null@*/ /*@only@*/ static char *global_prefix = NULL, *global_suffix = NULL;
+/*@null@*/ /*@only@*/ static char *listdir_pathname = NULL;
+/*@null@*/ /*@only@*/ static char *mapdir_pathname = NULL;
+/*@null@*/ /*@only@*/ static char *objext = NULL;
+/*@null@*/ /*@only@*/ static char *listext = NULL, *mapext = NULL;
+/*@null@*/ /*@only@*/ static char *machine_name = NULL;
+static int special_options = 0;
+/*@null@*/ /*@dependent@*/ static const yasm_arch_module *
+    cur_arch_module = NULL;
+/*@null@*/ /*@dependent@*/ static const yasm_parser_module *
+    cur_parser_module = NULL;
+/*@null@*/ /*@dependent@*/ static const yasm_preproc_module *
+    cur_preproc_module = NULL;
+/*@null@*/ static char *objfmt_keyword = NULL;
+/*@null@*/ /*@dependent@*/ static const yasm_objfmt_module *
+    cur_objfmt_module = NULL;
+/*@null@*/ /*@dependent@*/ static const yasm_dbgfmt_module *
+    cur_dbgfmt_module = NULL;
+/*@null@*/ /*@dependent@*/ static const yasm_listfmt_module *
+    cur_listfmt_module = NULL;
+static unsigned int force_strict = 0;
+static int warning_error = 0;   /* warnings being treated as errors */
+static FILE *errfile;
+/*@null@*/ /*@only@*/ static char *error_filename = NULL;
+static enum {
+    EWSTYLE_GNU = 0,
+    EWSTYLE_VC
+} ewmsg_style = EWSTYLE_GNU;
+
+/*@null@*/ /*@dependent@*/ static FILE *open_file(const char *filename,
+                                                  const char *mode);
+static int check_errors(/*@only@*/ yasm_errwarns *errwarns,
+                        /*@only@*/ yasm_object *object,
+                        /*@only@*/ yasm_linemap *linemap,
+                        /*@only@*/ yasm_preproc *preproc,
+                        /*@only@*/ yasm_arch *arch);
+static void cleanup(void);
+static void free_input_filenames(void);
+
+/* Forward declarations: cmd line parser handlers */
+static int opt_special_handler(char *cmd, /*@null@*/ char *param, int extra);
+static int opt_arch_handler(char *cmd, /*@null@*/ char *param, int extra);
+static int opt_parser_handler(char *cmd, /*@null@*/ char *param, int extra);
+static int opt_preproc_handler(char *cmd, /*@null@*/ char *param, int extra);
+static int opt_objfmt_handler(char *cmd, /*@null@*/ char *param, int extra);
+static int opt_dbgfmt_handler(char *cmd, /*@null@*/ char *param, int extra);
+static int opt_listfmt_handler(char *cmd, /*@null@*/ char *param, int extra);
+static int opt_listdir_handler(char *cmd, /*@null@*/ char *param, int extra);
+static int opt_objdir_handler(char *cmd, /*@null@*/ char *param, int extra);
+static int opt_mapdir_handler(char *cmd, /*@null@*/ char *param, int extra);
+static int opt_listext_handler(char *cmd, /*@null@*/ char *param, int extra);
+static int opt_objext_handler(char *cmd, /*@null@*/ char *param, int extra);
+static int opt_mapext_handler(char *cmd, /*@null@*/ char *param, int extra);
+static int opt_machine_handler(char *cmd, /*@null@*/ char *param, int extra);
+static int opt_strict_handler(char *cmd, /*@null@*/ char *param, int extra);
+static int opt_warning_handler(char *cmd, /*@null@*/ char *param, int extra);
+static int opt_error_file(char *cmd, /*@null@*/ char *param, int extra);
+static int opt_error_stdout(char *cmd, /*@null@*/ char *param, int extra);
+static int opt_include_option(char *cmd, /*@null@*/ char *param, int extra);
+static int opt_preproc_option(char *cmd, /*@null@*/ char *param, int extra);
+static int opt_ewmsg_handler(char *cmd, /*@null@*/ char *param, int extra);
+static int opt_prefix_handler(char *cmd, /*@null@*/ char *param, int extra);
+static int opt_suffix_handler(char *cmd, /*@null@*/ char *param, int extra);
+#ifdef CMAKE_BUILD
+static int opt_plugin_handler(char *cmd, /*@null@*/ char *param, int extra);
+#endif
+
+static /*@only@*/ char *replace_extension(const char *orig, /*@null@*/
+                                          const char *ext);
+static void print_error(const char *fmt, ...);
+
+static /*@exits@*/ void handle_yasm_int_error(const char *file,
+                                              unsigned int line,
+                                              const char *message);
+static /*@exits@*/ void handle_yasm_fatal(const char *message, va_list va);
+static const char *handle_yasm_gettext(const char *msgid);
+static void print_yasm_error(const char *filename, unsigned long line,
+                             const char *msg, /*@null@*/ const char *xref_fn,
+                             unsigned long xref_line,
+                             /*@null@*/ const char *xref_msg);
+static void print_yasm_warning(const char *filename, unsigned long line,
+                               const char *msg);
+
+static void apply_preproc_builtins(yasm_preproc *preproc);
+static void apply_preproc_standard_macros(yasm_preproc *preproc,
+                                          const yasm_stdmac *stdmacs);
+static void apply_preproc_saved_options(yasm_preproc *preproc);
+static void free_preproc_saved_options(void);
+static void print_list_keyword_desc(const char *name, const char *keyword);
+
+/* values for special_options */
+#define SPECIAL_SHOW_HELP 0x01
+#define SPECIAL_SHOW_VERSION 0x02
+#define SPECIAL_SHOW_LICENSE 0x04
+#define SPECIAL_LISTED 0x08
+
+/* command line options */
+static opt_option options[] =
+{
+    { 0, "version", 0, opt_special_handler, SPECIAL_SHOW_VERSION,
+      N_("show version text"), NULL },
+    { 0, "license", 0, opt_special_handler, SPECIAL_SHOW_LICENSE,
+      N_("show license text"), NULL },
+    { 'h', "help", 0, opt_special_handler, SPECIAL_SHOW_HELP,
+      N_("show help text"), NULL },
+    { 'a', "arch", 1, opt_arch_handler, 0,
+      N_("select architecture (list with -a help)"), N_("arch") },
+    { 'p', "parser", 1, opt_parser_handler, 0,
+      N_("select parser (list with -p help)"), N_("parser") },
+    { 'r', "preproc", 1, opt_preproc_handler, 0,
+      N_("select preprocessor (list with -r help)"), N_("preproc") },
+    { 'f', "oformat", 1, opt_objfmt_handler, 0,
+      N_("select object format (list with -f help)"), N_("format") },
+    { 'g', "dformat", 1, opt_dbgfmt_handler, 0,
+      N_("select debugging format (list with -g help)"), N_("debug") },
+    { 'L', "lformat", 1, opt_listfmt_handler, 0,
+      N_("select list format (list with -L help)"), N_("list") },
+    { 'l', "list", 1, opt_listdir_handler, 0,
+      N_("name of list-file output directory"), N_("pathname") },
+    { 'o', "objdir", 1, opt_objdir_handler, 0,
+      N_("name of object-file output directory"), N_("pathname") },
+    { 0, "mapdir", 1, opt_mapdir_handler, 0,
+      N_("name of map-file output directory"), N_("pathname") },
+    { 0, "listext", 1, opt_listext_handler, 0,
+      N_("list-file extension (default `lst')"), N_("ext") },
+    { 0, "objext", 1, opt_objext_handler, 0,
+      N_("object-file extension (default is by object format)"), N_("ext") },
+    { 0, "mapext", 1, opt_mapext_handler, 0,
+      N_("map-file extension (default `map')"), N_("ext") },
+    { 'm', "machine", 1, opt_machine_handler, 0,
+      N_("select machine (list with -m help)"), N_("machine") },
+    { 0, "force-strict", 0, opt_strict_handler, 0,
+      N_("treat all sized operands as if `strict' was used"), NULL },
+    { 'w', NULL, 0, opt_warning_handler, 1,
+      N_("inhibits warning messages"), NULL },
+    { 'W', NULL, 0, opt_warning_handler, 0,
+      N_("enables/disables warning"), NULL },
+    { 'E', NULL, 1, opt_error_file, 0,
+      N_("redirect error messages to file"), N_("file") },
+    { 's', NULL, 0, opt_error_stdout, 0,
+      N_("redirect error messages to stdout"), NULL },
+    { 'i', NULL, 1, opt_include_option, 0,
+      N_("add include path"), N_("path") },
+    { 'I', NULL, 1, opt_include_option, 0,
+      N_("add include path"), N_("path") },
+    { 'P', NULL, 1, opt_preproc_option, 0,
+      N_("pre-include file"), N_("filename") },
+    { 'd', NULL, 1, opt_preproc_option, 1,
+      N_("pre-define a macro, optionally to value"), N_("macro[=value]") },
+    { 'D', NULL, 1, opt_preproc_option, 1,
+      N_("pre-define a macro, optionally to value"), N_("macro[=value]") },
+    { 'u', NULL, 1, opt_preproc_option, 2,
+      N_("undefine a macro"), N_("macro") },
+    { 'U', NULL, 1, opt_preproc_option, 2,
+      N_("undefine a macro"), N_("macro") },
+    { 'X', NULL, 1, opt_ewmsg_handler, 0,
+      N_("select error/warning message style (`gnu' or `vc')"), N_("style") },
+    { 0, "prefix", 1, opt_prefix_handler, 0,
+      N_("prepend argument to name of all external symbols"), N_("prefix") },
+    { 0, "suffix", 1, opt_suffix_handler, 0,
+      N_("append argument to name of all external symbols"), N_("suffix") },
+    { 0, "postfix", 1, opt_suffix_handler, 0,
+      N_("append argument to name of all external symbols"), N_("suffix") },
+#ifdef CMAKE_BUILD
+    { 'N', "plugin", 1, opt_plugin_handler, 0,
+      N_("load plugin module"), N_("plugin") },
+#endif
+};
+
+/* version message */
+/*@observer@*/ static const char *version_msg[] = {
+    PACKAGE_STRING,
+    "Compiled on " __DATE__ ".",
+    "Copyright (c) 2001-2010 Peter Johnson and other Yasm developers.",
+    "Run yasm --license for licensing overview and summary."
+};
+
+/* help messages */
+/*@observer@*/ static const char *help_head = N_(
+    "usage: vsyasm [option]* file...\n"
+    "Options:\n");
+/*@observer@*/ static const char *help_tail = N_(
+    "\n"
+    "Files are asm sources to be assembled.\n"
+    "\n"
+    "Sample invocation:\n"
+    "   vsyasm -f win64 -o objdir source1.asm source2.asm\n"
+    "\n"
+    "All options apply to all files.\n"
+    "\n"
+    "Report bugs to bug-yasm@tortall.net\n");
+
+/* parsed command line storage until appropriate modules have been loaded */
+typedef STAILQ_HEAD(constcharparam_head, constcharparam) constcharparam_head;
+
+typedef struct constcharparam {
+    STAILQ_ENTRY(constcharparam) link;
+    const char *param;
+    int id;
+} constcharparam;
+
+static constcharparam_head preproc_options;
+static constcharparam_head input_files;
+static int num_input_files = 0;
+
+static int
+do_assemble(const char *in_filename)
+{
+    yasm_object *object;
+    const char *base_filename;
+    char *fn = NULL;
+    char *obj_filename, *list_filename = NULL, *map_filename = NULL;
+    /*@null@*/ FILE *obj = NULL;
+    yasm_arch_create_error arch_error;
+    yasm_linemap *linemap;
+    yasm_arch *arch = NULL;
+    yasm_preproc *preproc = NULL;
+    yasm_errwarns *errwarns = yasm_errwarns_create();
+    int i, matched;
+
+    /* Initialize line map */
+    linemap = yasm_linemap_create();
+    yasm_linemap_set(linemap, in_filename, 0, 1, 1);
+
+    /* determine the output filenames */
+    /* replace (or add) extension to base filename */
+    yasm__splitpath(in_filename, &base_filename);
+    if (base_filename[0] != '\0')
+        fn = replace_extension(base_filename, objext);
+    if (!fn)
+    {
+        print_error(_("could not determine output filename for `%s'"),
+                    in_filename);
+        return EXIT_FAILURE;
+    }
+    obj_filename = yasm__combpath(objdir_pathname, fn);
+    yasm_xfree(fn);
+
+    if (listdir_pathname) {
+        fn = replace_extension(base_filename, listext);
+        if (!fn)
+        {
+            print_error(_("could not determine list filename for `%s'"),
+                        in_filename);
+            return EXIT_FAILURE;
+        }
+        list_filename = yasm__combpath(listdir_pathname, fn);
+        yasm_xfree(fn);
+    }
+
+    if (mapdir_pathname) {
+        fn = replace_extension(base_filename, mapext);
+        if (!fn)
+        {
+            print_error(_("could not determine map filename for `%s'"),
+                        in_filename);
+            return EXIT_FAILURE;
+        }
+        map_filename = yasm__combpath(mapdir_pathname, fn);
+        yasm_xfree(fn);
+    }
+
+    /* Set up architecture using machine and parser. */
+    if (!machine_name) {
+        /* If we're using x86 and the default objfmt bits is 64, default the
+         * machine to amd64.  When we get more arches with multiple machines,
+         * we should do this in a more modular fashion.
+         */
+        if (strcmp(cur_arch_module->keyword, "x86") == 0 &&
+            cur_objfmt_module->default_x86_mode_bits == 64)
+            machine_name = yasm__xstrdup("amd64");
+        else
+            machine_name =
+                yasm__xstrdup(cur_arch_module->default_machine_keyword);
+    }
+
+    arch = yasm_arch_create(cur_arch_module, machine_name,
+                            cur_parser_module->keyword, &arch_error);
+    if (!arch) {
+        switch (arch_error) {
+            case YASM_ARCH_CREATE_BAD_MACHINE:
+                print_error(_("%s: `%s' is not a valid %s for %s `%s'"),
+                            _("FATAL"), machine_name, _("machine"),
+                            _("architecture"), cur_arch_module->keyword);
+                break;
+            case YASM_ARCH_CREATE_BAD_PARSER:
+                print_error(_("%s: `%s' is not a valid %s for %s `%s'"),
+                            _("FATAL"), cur_parser_module->keyword,
+                            _("parser"), _("architecture"),
+                            cur_arch_module->keyword);
+                break;
+            default:
+                print_error(_("%s: unknown architecture error"), _("FATAL"));
+        }
+
+        return EXIT_FAILURE;
+    }
+
+    /* Create object */
+    object = yasm_object_create(in_filename, obj_filename, arch,
+                                cur_objfmt_module, cur_dbgfmt_module);
+    if (!object) {
+        yasm_error_class eclass;
+        unsigned long xrefline;
+        /*@only@*/ /*@null@*/ char *estr, *xrefstr;
+
+        yasm_error_fetch(&eclass, &estr, &xrefline, &xrefstr);
+        print_error("%s: %s", _("FATAL"), estr);
+        yasm_xfree(estr);
+        yasm_xfree(xrefstr);
+        return EXIT_FAILURE;
+    }
+
+    /* Get a fresh copy of objfmt_module as it may have changed. */
+    cur_objfmt_module = ((yasm_objfmt_base *)object->objfmt)->module;
+
+    /* Check to see if the requested preprocessor is in the allowed list
+     * for the active parser.
+     */
+    matched = 0;
+    for (i=0; cur_parser_module->preproc_keywords[i]; i++)
+        if (yasm__strcasecmp(cur_parser_module->preproc_keywords[i],
+                             cur_preproc_module->keyword) == 0)
+            matched = 1;
+    if (!matched) {
+        print_error(_("%s: `%s' is not a valid %s for %s `%s'"), _("FATAL"),
+                    cur_preproc_module->keyword, _("preprocessor"),
+                    _("parser"), cur_parser_module->keyword);
+        yasm_object_destroy(object);
+        return EXIT_FAILURE;
+    }
+
+    if (global_prefix)
+        yasm_object_set_global_prefix(object, global_prefix);
+    if (global_suffix)
+        yasm_object_set_global_suffix(object, global_suffix);
+
+    preproc = yasm_preproc_create(cur_preproc_module, in_filename,
+                                  object->symtab, linemap, errwarns);
+
+    apply_preproc_builtins(preproc);
+    apply_preproc_standard_macros(preproc, cur_parser_module->stdmacs);
+    apply_preproc_standard_macros(preproc, cur_objfmt_module->stdmacs);
+    apply_preproc_saved_options(preproc);
+
+    /* Get initial x86 BITS setting from object format */
+    if (strcmp(cur_arch_module->keyword, "x86") == 0) {
+        yasm_arch_set_var(arch, "mode_bits",
+                          cur_objfmt_module->default_x86_mode_bits);
+    }
+
+    yasm_arch_set_var(arch, "force_strict", force_strict);
+
+    /* Try to enable the map file via a map NASM directive.  This is
+     * somewhat of a hack.
+     */
+    if (map_filename) {
+        const yasm_directive *dir = &cur_objfmt_module->directives[0];
+        matched = 0;
+        for (; dir && dir->name; dir++) {
+            if (yasm__strcasecmp(dir->name, "map") == 0 &&
+                yasm__strcasecmp(dir->parser, "nasm") == 0) {
+                yasm_valparamhead vps;
+                yasm_valparam *vp;
+                matched = 1;
+                yasm_vps_initialize(&vps);
+                vp = yasm_vp_create_string(NULL, yasm__xstrdup(map_filename));
+                yasm_vps_append(&vps, vp);
+                dir->handler(object, &vps, NULL, 0);
+                yasm_vps_delete(&vps);
+            }
+        }
+        if (!matched) {
+            print_error(
+                _("warning: object format `%s' does not support map files"),
+                cur_objfmt_module->keyword);
+        }
+    }
+
+    /* Parse! */
+    cur_parser_module->do_parse(object, preproc, list_filename != NULL,
+                                linemap, errwarns);
+
+    if (check_errors(errwarns, object, linemap, preproc, arch) == EXIT_FAILURE)
+        return EXIT_FAILURE;
+
+    /* Finalize parse */
+    yasm_object_finalize(object, errwarns);
+    if (check_errors(errwarns, object, linemap, preproc, arch) == EXIT_FAILURE)
+        return EXIT_FAILURE;
+
+    /* Optimize */
+    yasm_object_optimize(object, errwarns);
+    if (check_errors(errwarns, object, linemap, preproc, arch) == EXIT_FAILURE)
+        return EXIT_FAILURE;
+
+    /* generate any debugging information */
+    yasm_dbgfmt_generate(object, linemap, errwarns);
+    if (check_errors(errwarns, object, linemap, preproc, arch) == EXIT_FAILURE)
+        return EXIT_FAILURE;
+
+    /* open the object file for output (if not already opened by dbg objfmt) */
+    if (!obj && strcmp(cur_objfmt_module->keyword, "dbg") != 0) {
+        obj = open_file(obj_filename, "wb");
+        if (!obj) {
+            yasm_preproc_destroy(preproc);
+            yasm_object_destroy(object);
+            yasm_linemap_destroy(linemap);
+            yasm_errwarns_destroy(errwarns);
+            return EXIT_FAILURE;
+        }
+    }
+
+    /* Write the object file */
+    yasm_objfmt_output(object, obj?obj:stderr,
+                       strcmp(cur_dbgfmt_module->keyword, "null"), errwarns);
+
+    /* Close object file */
+    if (obj)
+        fclose(obj);
+
+    /* If we had an error at this point, we also need to delete the output
+     * object file (to make sure it's not left newer than the source).
+     */
+    if (yasm_errwarns_num_errors(errwarns, warning_error) > 0)
+        remove(obj_filename);
+    if (check_errors(errwarns, object, linemap, preproc, arch) == EXIT_FAILURE)
+        return EXIT_FAILURE;
+
+    /* Open and write the list file */
+    if (list_filename) {
+        yasm_listfmt *cur_listfmt;
+        FILE *list = open_file(list_filename, "wt");
+        if (!list) {
+            yasm_preproc_destroy(preproc);
+            yasm_object_destroy(object);
+            yasm_linemap_destroy(linemap);
+            yasm_errwarns_destroy(errwarns);
+            return EXIT_FAILURE;
+        }
+        /* Initialize the list format */
+        cur_listfmt = yasm_listfmt_create(cur_listfmt_module, in_filename,
+                                          obj_filename);
+        yasm_listfmt_output(cur_listfmt, list, linemap, arch);
+        yasm_listfmt_destroy(cur_listfmt);
+        fclose(list);
+    }
+
+    yasm_errwarns_output_all(errwarns, linemap, warning_error,
+                             print_yasm_error, print_yasm_warning);
+
+    yasm_preproc_destroy(preproc);
+    yasm_object_destroy(object);
+    yasm_linemap_destroy(linemap);
+    yasm_errwarns_destroy(errwarns);
+
+    yasm_xfree(obj_filename);
+    yasm_xfree(map_filename);
+    yasm_xfree(list_filename);
+    return EXIT_SUCCESS;
+}
+
+/* main function */
+/*@-globstate -unrecog@*/
+int
+main(int argc, char *argv[])
+{
+    size_t i;
+    constcharparam *infile;
+
+    errfile = stderr;
+
+#if defined(HAVE_SETLOCALE) && defined(HAVE_LC_MESSAGES)
+    setlocale(LC_MESSAGES, "");
+#endif
+#if defined(LOCALEDIR)
+    bindtextdomain(PACKAGE, LOCALEDIR);
+#endif
+    textdomain(PACKAGE);
+
+    /* Initialize errwarn handling */
+    yasm_internal_error_ = handle_yasm_int_error;
+    yasm_fatal = handle_yasm_fatal;
+    yasm_gettext_hook = handle_yasm_gettext;
+    yasm_errwarn_initialize();
+
+    /* Initialize BitVector (needed for intnum/floatnum). */
+    if (BitVector_Boot() != ErrCode_Ok) {
+        print_error(_("%s: could not initialize BitVector"), _("FATAL"));
+        return EXIT_FAILURE;
+    }
+
+    /* Initialize intnum and floatnum */
+    yasm_intnum_initialize();
+    yasm_floatnum_initialize();
+
+#ifdef CMAKE_BUILD
+    /* Load standard modules */
+    if (!load_plugin("yasmstd")) {
+        print_error(_("%s: could not load standard modules"), _("FATAL"));
+        return EXIT_FAILURE;
+    }
+#endif
+
+    /* Initialize parameter storage */
+    STAILQ_INIT(&preproc_options);
+    STAILQ_INIT(&input_files);
+
+    if (parse_cmdline(argc, argv, options, NELEMS(options), print_error))
+        return EXIT_FAILURE;
+
+    switch (special_options) {
+        case SPECIAL_SHOW_HELP:
+            /* Does gettext calls internally */
+            help_msg(help_head, help_tail, options, NELEMS(options));
+            return EXIT_SUCCESS;
+        case SPECIAL_SHOW_VERSION:
+            for (i=0; i<NELEMS(version_msg); i++)
+                printf("%s\n", version_msg[i]);
+            return EXIT_SUCCESS;
+        case SPECIAL_SHOW_LICENSE:
+            for (i=0; i<NELEMS(license_msg); i++)
+                printf("%s\n", license_msg[i]);
+            return EXIT_SUCCESS;
+        case SPECIAL_LISTED:
+            /* Printed out earlier */
+            return EXIT_SUCCESS;
+    }
+
+    /* Open error file if specified. */
+    if (error_filename) {
+        int j;
+        errfile = open_file(error_filename, "wt");
+        if (!errfile)
+            return EXIT_FAILURE;
+
+        /* Print command line as first line in error file. */
+        for (j=0; j<argc; j++)
+            fprintf(errfile, "%s%c", argv[j], (j==argc-1) ? '\n' : ' ');
+    }
+
+    /* If not already specified, default to win32 as the object format. */
+    if (!cur_objfmt_module) {
+        if (!objfmt_keyword)
+            objfmt_keyword = yasm__xstrdup("win32");
+        cur_objfmt_module = yasm_load_objfmt(objfmt_keyword);
+        if (!cur_objfmt_module) {
+            print_error(_("%s: could not load default %s"), _("FATAL"),
+                        _("object format"));
+            return EXIT_FAILURE;
+        }
+    }
+
+    /* Default to x86 as the architecture */
+    if (!cur_arch_module) {
+        cur_arch_module = yasm_load_arch("x86");
+        if (!cur_arch_module) {
+            print_error(_("%s: could not load default %s"), _("FATAL"),
+                        _("architecture"));
+            return EXIT_FAILURE;
+        }
+    }
+
+    /* Check for arch help */
+    if (machine_name && strcmp(machine_name, "help") == 0) {
+        const yasm_arch_machine *m = cur_arch_module->machines;
+        printf(_("Available %s for %s `%s':\n"), _("machines"),
+               _("architecture"), cur_arch_module->keyword);
+        while (m->keyword && m->name) {
+            print_list_keyword_desc(m->name, m->keyword);
+            m++;
+        }
+        return EXIT_SUCCESS;
+    }
+
+    /* Default to NASM as the parser */
+    if (!cur_parser_module) {
+        cur_parser_module = yasm_load_parser("nasm");
+        if (!cur_parser_module) {
+            print_error(_("%s: could not load default %s"), _("FATAL"),
+                        _("parser"));
+            cleanup();
+            return EXIT_FAILURE;
+        }
+    }
+
+    /* If not already specified, default to the parser's default preproc. */
+    if (!cur_preproc_module) {
+        cur_preproc_module =
+            yasm_load_preproc(cur_parser_module->default_preproc_keyword);
+        if (!cur_preproc_module) {
+            print_error(_("%s: could not load default %s"), _("FATAL"),
+                        _("preprocessor"));
+            cleanup();
+            return EXIT_FAILURE;
+        }
+    }
+
+    /* Determine input filenames. */
+    if (STAILQ_EMPTY(&input_files)) {
+        print_error(_("No input files specified"));
+        return EXIT_FAILURE;
+    }
+
+    /* If list file enabled, make sure we have a list format loaded. */
+    if (listdir_pathname) {
+        /* If not already specified, default to nasm as the list format. */
+        if (!cur_listfmt_module) {
+            cur_listfmt_module = yasm_load_listfmt("nasm");
+            if (!cur_listfmt_module) {
+                print_error(_("%s: could not load default %s"), _("FATAL"),
+                            _("list format"));
+                return EXIT_FAILURE;
+            }
+        }
+    }
+
+    /* If not already specified, default to null as the debug format. */
+    if (!cur_dbgfmt_module) {
+        cur_dbgfmt_module = yasm_load_dbgfmt("null");
+        if (!cur_dbgfmt_module) {
+            print_error(_("%s: could not load default %s"), _("FATAL"),
+                        _("debug format"));
+            return EXIT_FAILURE;
+        }
+    }
+
+    /* If not already specified, output to the current directory. */
+    if (!objdir_pathname)
+        objdir_pathname = yasm__xstrdup("./");
+    else if ((i = yasm__createpath(objdir_pathname)) > 0 &&
+             num_input_files > 1) {
+        objdir_pathname[i] = '/';
+        objdir_pathname[i+1] = '\0';
+    }
+
+    /* Create other output directories if necessary */
+    if (listdir_pathname && (i = yasm__createpath(listdir_pathname)) > 0 &&
+        num_input_files > 1) {
+        listdir_pathname[i] = '/';
+        listdir_pathname[i+1] = '\0';
+    }
+    if (mapdir_pathname && (i = yasm__createpath(mapdir_pathname)) > 0 &&
+        num_input_files > 1) {
+        mapdir_pathname[i] = '/';
+        mapdir_pathname[i+1] = '\0';
+    }
+
+    /* If not already specified, set file extensions */
+    if (!objext && cur_objfmt_module->extension)
+        objext = yasm__xstrdup(cur_objfmt_module->extension);
+    if (!listext)
+        listext = yasm__xstrdup("lst");
+    if (!mapext)
+        mapext = yasm__xstrdup("map");
+
+    /* Assemble each input file.  Terminate on first error. */
+    STAILQ_FOREACH(infile, &input_files, link)
+    {
+        if (do_assemble(infile->param) == EXIT_FAILURE) {
+            cleanup();
+            return EXIT_FAILURE;
+        }
+    }
+    cleanup();
+    return EXIT_SUCCESS;
+}
+/*@=globstate =unrecog@*/
+
+/* Open the object file.  Returns 0 on failure. */
+static FILE *
+open_file(const char *filename, const char *mode)
+{
+    FILE *f;
+
+    f = fopen(filename, mode);
+    if (!f)
+        print_error(_("could not open file `%s'"), filename);
+    return f;
+}
+
+static int
+check_errors(yasm_errwarns *errwarns, yasm_object *object,
+             yasm_linemap *linemap, yasm_preproc *preproc, yasm_arch *arch)
+{
+    if (yasm_errwarns_num_errors(errwarns, warning_error) > 0) {
+        yasm_errwarns_output_all(errwarns, linemap, warning_error,
+                                 print_yasm_error, print_yasm_warning);
+        yasm_preproc_destroy(preproc);
+        yasm_object_destroy(object);
+        yasm_linemap_destroy(linemap);
+        yasm_errwarns_destroy(errwarns);
+        return EXIT_FAILURE;
+    }
+    return EXIT_SUCCESS;
+}
+
+/* Define DO_FREE to 1 to enable deallocation of all data structures.
+ * Useful for detecting memory leaks, but slows down execution unnecessarily
+ * (as the OS will free everything we miss here).
+ */
+#define DO_FREE         1
+
+/* Cleans up all allocated structures. */
+static void
+cleanup(void)
+{
+    if (DO_FREE) {
+        yasm_floatnum_cleanup();
+        yasm_intnum_cleanup();
+
+        yasm_errwarn_cleanup();
+
+        BitVector_Shutdown();
+    }
+
+    if (DO_FREE) {
+        free_input_filenames();
+        if (objdir_pathname)
+            yasm_xfree(objdir_pathname);
+        if (listdir_pathname)
+            yasm_xfree(listdir_pathname);
+        if (mapdir_pathname)
+            yasm_xfree(mapdir_pathname);
+        if (objext)
+            yasm_xfree(objext);
+        if (listext)
+            yasm_xfree(listext);
+        if (mapext)
+            yasm_xfree(mapext);
+        if (machine_name)
+            yasm_xfree(machine_name);
+        if (objfmt_keyword)
+            yasm_xfree(objfmt_keyword);
+        free_preproc_saved_options();
+    }
+
+    if (errfile != stderr && errfile != stdout)
+        fclose(errfile);
+#ifdef CMAKE_BUILD
+    unload_plugins();
+#endif
+}
+
+static void
+free_input_filenames(void)
+{
+    constcharparam *cp, *cpnext;
+    cp = STAILQ_FIRST(&input_files);
+    while (cp != NULL) {
+        cpnext = STAILQ_NEXT(cp, link);
+        yasm_xfree(cp);
+        cp = cpnext;
+    }
+    STAILQ_INIT(&input_files);
+}
+
+/*
+ *  Command line options handlers
+ */
+int
+not_an_option_handler(char *param)
+{
+    constcharparam *cp;
+    cp = yasm_xmalloc(sizeof(constcharparam));
+    cp->param = param;
+    cp->id = 0;
+    STAILQ_INSERT_TAIL(&input_files, cp, link);
+    ++num_input_files;
+    return 0;
+}
+
+int
+other_option_handler(char *option)
+{
+    /* Accept, but ignore, -O and -Onnn, for compatibility with NASM. */
+    if (option[0] == '-' && option[1] == 'O') {
+        int n = 2;
+        for (;;) {
+            if (option[n] == '\0')
+                return 0;
+            if (!isdigit(option[n]))
+                return 1;
+            n++;
+        }
+    }
+    return 1;
+}
+
+static int
+opt_special_handler(/*@unused@*/ char *cmd, /*@unused@*/ char *param, int extra)
+{
+    if (special_options == 0)
+        special_options = extra;
+    return 0;
+}
+
+static int
+opt_arch_handler(/*@unused@*/ char *cmd, char *param, /*@unused@*/ int extra)
+{
+    assert(param != NULL);
+    cur_arch_module = yasm_load_arch(param);
+    if (!cur_arch_module) {
+        if (!strcmp("help", param)) {
+            printf(_("Available yasm %s:\n"), _("architectures"));
+            yasm_list_arch(print_list_keyword_desc);
+            special_options = SPECIAL_LISTED;
+            return 0;
+        }
+        print_error(_("%s: unrecognized %s `%s'"), _("FATAL"),
+                    _("architecture"), param);
+        exit(EXIT_FAILURE);
+    }
+    return 0;
+}
+
+static int
+opt_parser_handler(/*@unused@*/ char *cmd, char *param, /*@unused@*/ int extra)
+{
+    assert(param != NULL);
+    cur_parser_module = yasm_load_parser(param);
+    if (!cur_parser_module) {
+        if (!strcmp("help", param)) {
+            printf(_("Available yasm %s:\n"), _("parsers"));
+            yasm_list_parser(print_list_keyword_desc);
+            special_options = SPECIAL_LISTED;
+            return 0;
+        }
+        print_error(_("%s: unrecognized %s `%s'"), _("FATAL"), _("parser"),
+                    param);
+        exit(EXIT_FAILURE);
+    }
+    return 0;
+}
+
+static int
+opt_preproc_handler(/*@unused@*/ char *cmd, char *param, /*@unused@*/ int extra)
+{
+    assert(param != NULL);
+    cur_preproc_module = yasm_load_preproc(param);
+    if (!cur_preproc_module) {
+        if (!strcmp("help", param)) {
+            printf(_("Available yasm %s:\n"), _("preprocessors"));
+            yasm_list_preproc(print_list_keyword_desc);
+            special_options = SPECIAL_LISTED;
+            return 0;
+        }
+        print_error(_("%s: unrecognized %s `%s'"), _("FATAL"),
+                    _("preprocessor"), param);
+        exit(EXIT_FAILURE);
+    }
+    return 0;
+}
+
+static int
+opt_objfmt_handler(/*@unused@*/ char *cmd, char *param, /*@unused@*/ int extra)
+{
+    size_t i;
+    assert(param != NULL);
+    cur_objfmt_module = yasm_load_objfmt(param);
+    if (!cur_objfmt_module) {
+        if (!strcmp("help", param)) {
+            printf(_("Available yasm %s:\n"), _("object formats"));
+            yasm_list_objfmt(print_list_keyword_desc);
+            special_options = SPECIAL_LISTED;
+            return 0;
+        }
+        print_error(_("%s: unrecognized %s `%s'"), _("FATAL"),
+                    _("object format"), param);
+        exit(EXIT_FAILURE);
+    }
+    if (objfmt_keyword)
+        yasm_xfree(objfmt_keyword);
+    objfmt_keyword = yasm__xstrdup(param);
+    for (i=0; i<strlen(objfmt_keyword); i++)
+        objfmt_keyword[i] = tolower(objfmt_keyword[i]);
+    return 0;
+}
+
+static int
+opt_dbgfmt_handler(/*@unused@*/ char *cmd, char *param, /*@unused@*/ int extra)
+{
+    assert(param != NULL);
+    cur_dbgfmt_module = yasm_load_dbgfmt(param);
+    if (!cur_dbgfmt_module) {
+        if (!strcmp("help", param)) {
+            printf(_("Available yasm %s:\n"), _("debug formats"));
+            yasm_list_dbgfmt(print_list_keyword_desc);
+            special_options = SPECIAL_LISTED;
+            return 0;
+        }
+        print_error(_("%s: unrecognized %s `%s'"), _("FATAL"),
+                    _("debug format"), param);
+        exit(EXIT_FAILURE);
+    }
+    return 0;
+}
+
+static int
+opt_listfmt_handler(/*@unused@*/ char *cmd, char *param,
+                    /*@unused@*/ int extra)
+{
+    assert(param != NULL);
+    cur_listfmt_module = yasm_load_listfmt(param);
+    if (!cur_listfmt_module) {
+        if (!strcmp("help", param)) {
+            printf(_("Available yasm %s:\n"), _("list formats"));
+            yasm_list_listfmt(print_list_keyword_desc);
+            special_options = SPECIAL_LISTED;
+            return 0;
+        }
+        print_error(_("%s: unrecognized %s `%s'"), _("FATAL"),
+                    _("list format"), param);
+        exit(EXIT_FAILURE);
+    }
+    return 0;
+}
+
+static int
+opt_listdir_handler(/*@unused@*/ char *cmd, char *param,
+                    /*@unused@*/ int extra)
+{
+    if (listdir_pathname) {
+        print_error(
+            _("warning: can output to only one list dir, last specified used"));
+        yasm_xfree(listdir_pathname);
+    }
+
+    assert(param != NULL);
+    listdir_pathname = yasm_xmalloc(strlen(param)+2);
+    strcpy(listdir_pathname, param);
+
+    return 0;
+}
+
+static int
+opt_objdir_handler(/*@unused@*/ char *cmd, char *param,
+                   /*@unused@*/ int extra)
+{
+    if (objdir_pathname) {
+        print_error(
+            _("warning: can output to only one object dir, last specified used"));
+        yasm_xfree(objdir_pathname);
+    }
+
+    assert(param != NULL);
+    objdir_pathname = yasm_xmalloc(strlen(param)+2);
+    strcpy(objdir_pathname, param);
+
+    return 0;
+}
+
+static int
+opt_mapdir_handler(/*@unused@*/ char *cmd, char *param,
+                   /*@unused@*/ int extra)
+{
+    if (mapdir_pathname) {
+        print_error(
+            _("warning: can output to only one map file, last specified used"));
+        yasm_xfree(mapdir_pathname);
+    }
+
+    assert(param != NULL);
+    mapdir_pathname = yasm_xmalloc(strlen(param)+2);
+    strcpy(mapdir_pathname, param);
+
+    return 0;
+}
+
+static int
+opt_listext_handler(/*@unused@*/ char *cmd, char *param,
+                    /*@unused@*/ int extra)
+{
+    if (listext) {
+        print_error(
+            _("warning: can set only one list extension, last specified used"));
+        yasm_xfree(listext);
+    }
+    assert(param != NULL);
+    listext = yasm__xstrdup(param);
+    return 0;
+}
+
+static int
+opt_objext_handler(/*@unused@*/ char *cmd, char *param,
+                   /*@unused@*/ int extra)
+{
+    if (objext) {
+        print_error(
+            _("warning: can set only one object extension, last specified used"));
+        yasm_xfree(objext);
+    }
+    assert(param != NULL);
+    objext = yasm__xstrdup(param);
+    return 0;
+}
+
+static int
+opt_mapext_handler(/*@unused@*/ char *cmd, char *param,
+                   /*@unused@*/ int extra)
+{
+    if (mapext) {
+        print_error(
+            _("warning: can set only one map extension, last specified used"));
+        yasm_xfree(mapext);
+    }
+    assert(param != NULL);
+    mapext = yasm__xstrdup(param);
+    return 0;
+}
+
+static int
+opt_machine_handler(/*@unused@*/ char *cmd, char *param,
+                    /*@unused@*/ int extra)
+{
+    if (machine_name)
+        yasm_xfree(machine_name);
+
+    assert(param != NULL);
+    machine_name = yasm__xstrdup(param);
+
+    return 0;
+}
+
+static int
+opt_strict_handler(/*@unused@*/ char *cmd,
+                   /*@unused@*/ /*@null@*/ char *param,
+                   /*@unused@*/ int extra)
+{
+    force_strict = 1;
+    return 0;
+}
+
+static int
+opt_warning_handler(char *cmd, /*@unused@*/ char *param, int extra)
+{
+    /* is it disabling the warning instead of enabling? */
+    void (*action)(yasm_warn_class wclass) = yasm_warn_enable;
+
+    if (extra == 1) {
+        /* -w, disable warnings */
+        yasm_warn_disable_all();
+        return 0;
+    }
+
+    /* skip past 'W' */
+    cmd++;
+
+    /* detect no- prefix to disable the warning */
+    if (cmd[0] == 'n' && cmd[1] == 'o' && cmd[2] == '-') {
+        action = yasm_warn_disable;
+        cmd += 3;   /* skip past it to get to the warning name */
+    }
+
+    if (cmd[0] == '\0')
+        /* just -W or -Wno-, so definitely not valid */
+        return 1;
+    else if (strcmp(cmd, "error") == 0)
+        warning_error = (action == yasm_warn_enable);
+    else if (strcmp(cmd, "unrecognized-char") == 0)
+        action(YASM_WARN_UNREC_CHAR);
+    else if (strcmp(cmd, "orphan-labels") == 0)
+        action(YASM_WARN_ORPHAN_LABEL);
+    else if (strcmp(cmd, "uninit-contents") == 0)
+        action(YASM_WARN_UNINIT_CONTENTS);
+    else if (strcmp(cmd, "size-override") == 0)
+        action(YASM_WARN_SIZE_OVERRIDE);
+    else
+        return 1;
+
+    return 0;
+}
+
+static int
+opt_error_file(/*@unused@*/ char *cmd, char *param, /*@unused@*/ int extra)
+{
+    if (error_filename) {
+        print_error(
+            _("warning: can output to only one error file, last specified used"));
+        yasm_xfree(error_filename);
+    }
+
+    assert(param != NULL);
+    error_filename = yasm__xstrdup(param);
+
+    return 0;
+}
+
+static int
+opt_error_stdout(/*@unused@*/ char *cmd, /*@unused@*/ char *param,
+                 /*@unused@*/ int extra)
+{
+    /* Clear any specified error filename */
+    if (error_filename) {
+        yasm_xfree(error_filename);
+        error_filename = NULL;
+    }
+    errfile = stdout;
+    return 0;
+}
+
+static int
+opt_include_option(/*@unused@*/ char *cmd, char *param, /*@unused@*/ int extra)
+{
+    yasm_add_include_path(param);
+    return 0;
+}
+
+static int
+opt_preproc_option(/*@unused@*/ char *cmd, char *param, int extra)
+{
+    constcharparam *cp;
+    cp = yasm_xmalloc(sizeof(constcharparam));
+    cp->param = param;
+    cp->id = extra;
+    STAILQ_INSERT_TAIL(&preproc_options, cp, link);
+    return 0;
+}
+
+static int
+opt_ewmsg_handler(/*@unused@*/ char *cmd, char *param, /*@unused@*/ int extra)
+{
+    if (yasm__strcasecmp(param, "gnu") == 0 ||
+        yasm__strcasecmp(param, "gcc") == 0) {
+        ewmsg_style = EWSTYLE_GNU;
+    } else if (yasm__strcasecmp(param, "vc") == 0) {
+        ewmsg_style = EWSTYLE_VC;
+    } else
+        print_error(_("warning: unrecognized message style `%s'"), param);
+
+    return 0;
+}
+
+static int
+opt_prefix_handler(/*@unused@*/ char *cmd, char *param, /*@unused@*/ int extra)
+{
+    if (global_prefix)
+        yasm_xfree(global_prefix);
+
+    assert(param != NULL);
+    global_prefix = yasm__xstrdup(param);
+
+    return 0;
+}
+
+static int
+opt_suffix_handler(/*@unused@*/ char *cmd, char *param, /*@unused@*/ int extra)
+{
+    if (global_suffix)
+        yasm_xfree(global_suffix);
+
+    assert(param != NULL);
+    global_suffix = yasm__xstrdup(param);
+
+    return 0;
+}
+
+#ifdef CMAKE_BUILD
+static int
+opt_plugin_handler(/*@unused@*/ char *cmd, char *param,
+                   /*@unused@*/ int extra)
+{
+    if (!load_plugin(param))
+        print_error(_("warning: could not load plugin `%s'"), param);
+    return 0;
+}
+#endif
+
+static void
+apply_preproc_builtins(yasm_preproc *preproc)
+{
+    char *predef;
+
+    /* Define standard YASM assembly-time macro constants */
+    predef = yasm_xmalloc(strlen("__YASM_OBJFMT__=")
+                          + strlen(objfmt_keyword) + 1);
+    strcpy(predef, "__YASM_OBJFMT__=");
+    strcat(predef, objfmt_keyword);
+    yasm_preproc_define_builtin(preproc, predef);
+    yasm_xfree(predef);
+}
+
+static void
+apply_preproc_standard_macros(yasm_preproc *preproc, const yasm_stdmac *stdmacs)
+{
+    int i, matched;
+
+    if (!stdmacs)
+        return;
+
+    matched = -1;
+    for (i=0; stdmacs[i].parser; i++)
+        if (yasm__strcasecmp(stdmacs[i].parser,
+                             cur_parser_module->keyword) == 0 &&
+            yasm__strcasecmp(stdmacs[i].preproc,
+                             cur_preproc_module->keyword) == 0)
+            matched = i;
+    if (matched >= 0 && stdmacs[matched].macros)
+        yasm_preproc_add_standard(preproc, stdmacs[matched].macros);
+}
+
+static void
+apply_preproc_saved_options(yasm_preproc *preproc)
+{
+    constcharparam *cp;
+
+    void (*funcs[3])(yasm_preproc *, const char *);
+    funcs[0] = cur_preproc_module->add_include_file;
+    funcs[1] = cur_preproc_module->predefine_macro;
+    funcs[2] = cur_preproc_module->undefine_macro;
+
+    STAILQ_FOREACH(cp, &preproc_options, link) {
+        if (0 <= cp->id && cp->id < 3 && funcs[cp->id])
+            funcs[cp->id](preproc, cp->param);
+    }
+}
+
+static void
+free_preproc_saved_options(void)
+{
+    constcharparam *cp, *cpnext;
+    cp = STAILQ_FIRST(&preproc_options);
+    while (cp != NULL) {
+        cpnext = STAILQ_NEXT(cp, link);
+        yasm_xfree(cp);
+        cp = cpnext;
+    }
+    STAILQ_INIT(&preproc_options);
+}
+
+/* Replace extension on a filename (or append one if none is present).
+ * If output filename would be identical to input (same extension out as in),
+ * returns NULL.
+ * A NULL ext means the trailing '.' should NOT be included, whereas a "" ext
+ * means the trailing '.' should be included.
+ */
+static char *
+replace_extension(const char *orig, /*@null@*/ const char *ext)
+{
+    char *out, *outext;
+    size_t outlen;
+
+    /* allocate enough space for full existing name + extension */
+    outlen = strlen(orig) + 2;
+    if (ext)
+        outlen += strlen(ext) + 1;
+    out = yasm_xmalloc(outlen);
+
+    strcpy(out, orig);
+    outext = strrchr(out, '.');
+    if (outext) {
+        /* Existing extension: make sure it's not the same as the replacement
+         * (as we don't want to overwrite the source file).
+         */
+        outext++;   /* advance past '.' */
+        if (ext && strcmp(outext, ext) == 0) {
+            outext = NULL;  /* indicate default should be used */
+            print_error(_("file name already ends in `.%s'"), ext);
+        }
+    } else {
+        /* No extension: make sure the output extension is not empty
+         * (again, we don't want to overwrite the source file).
+         */
+        if (!ext) {
+            outext = NULL;
+            print_error(_("file name already has no extension"));
+        } else {
+            outext = strrchr(out, '\0');    /* point to end of the string */
+            *outext++ = '.';                /* append '.' */
+        }
+    }
+
+    /* replace extension or use default name */
+    if (outext) {
+        if (!ext) {
+            /* Back up and replace '.' with string terminator */
+            outext--;
+            *outext = '\0';
+        } else
+            strcpy(outext, ext);
+    } else
+        return NULL;
+
+    return out;
+}
+
+void
+print_list_keyword_desc(const char *name, const char *keyword)
+{
+    printf("%4s%-12s%s\n", "", keyword, name);
+}
+
+static void
+print_error(const char *fmt, ...)
+{
+    va_list va;
+    fprintf(errfile, "vsyasm: ");
+    va_start(va, fmt);
+    vfprintf(errfile, fmt, va);
+    va_end(va);
+    fputc('\n', errfile);
+}
+
+static /*@exits@*/ void
+handle_yasm_int_error(const char *file, unsigned int line, const char *message)
+{
+    fprintf(stderr, _("INTERNAL ERROR at %s, line %u: %s\n"), file, line,
+            gettext(message));
+#ifdef HAVE_ABORT
+    abort();
+#else
+    exit(EXIT_FAILURE);
+#endif
+}
+
+static /*@exits@*/ void
+handle_yasm_fatal(const char *fmt, va_list va)
+{
+    fprintf(errfile, "vsyasm: %s: ", _("FATAL"));
+    vfprintf(errfile, gettext(fmt), va);
+    fputc('\n', errfile);
+    exit(EXIT_FAILURE);
+}
+
+static const char *
+handle_yasm_gettext(const char *msgid)
+{
+    return gettext(msgid);
+}
+
+static const char *fmt[2] = {
+        "%s:%lu: %s%s\n",       /* GNU */
+        "%s(%lu) : %s%s\n"      /* VC */
+};
+
+static const char *fmt_noline[2] = {
+        "%s: %s%s\n",   /* GNU */
+        "%s : %s%s\n"   /* VC */
+};
+
+static void
+print_yasm_error(const char *filename, unsigned long line, const char *msg,
+                 const char *xref_fn, unsigned long xref_line,
+                 const char *xref_msg)
+{
+    if (line)
+        fprintf(errfile, fmt[ewmsg_style], filename, line, _("error: "), msg);
+    else
+        fprintf(errfile, fmt_noline[ewmsg_style], filename, _("error: "), msg);
+
+    if (xref_fn && xref_msg) {
+        if (xref_line)
+            fprintf(errfile, fmt[ewmsg_style], xref_fn, xref_line, _("error: "),
+                    xref_msg);
+        else
+            fprintf(errfile, fmt_noline[ewmsg_style], xref_fn, _("error: "),
+                    xref_msg);
+    }
+}
+
+static void
+print_yasm_warning(const char *filename, unsigned long line, const char *msg)
+{
+    if (line)
+        fprintf(errfile, fmt[ewmsg_style], filename, line, _("warning: "),
+                msg);
+    else
+        fprintf(errfile, fmt_noline[ewmsg_style], filename, _("warning: "),
+                msg);
+}
diff --git a/libyasm/tests/expr-simplify-identity.asm b/libyasm/tests/expr-simplify-identity.asm
new file mode 100644
index 0000000..cda9c3b
--- /dev/null
+++ b/libyasm/tests/expr-simplify-identity.asm
@@ -0,0 +1,4 @@
+d_key equ 0
+cachedata: DQ 0
+dtable:
+cmp al, [esi + (dtable-cachedata) + ebx*4 + d_key]
diff --git a/libyasm/tests/expr-simplify-identity.hex b/libyasm/tests/expr-simplify-identity.hex
new file mode 100644
index 0000000..4a236bc
--- /dev/null
+++ b/libyasm/tests/expr-simplify-identity.hex
@@ -0,0 +1,13 @@
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+67 
+3a 
+44 
+9e 
+08 
diff --git a/libyasm/tests/timesfwd.asm b/libyasm/tests/timesfwd.asm
new file mode 100644
index 0000000..bdb36d3
--- /dev/null
+++ b/libyasm/tests/timesfwd.asm
@@ -0,0 +1,8 @@
+[section .text]
+[bits 64]
+;[global foo]
+;[global bar]
+times (foo-bar+$$-$)&7 nop
+foo: inc eax
+bar: inc ecx
+
diff --git a/libyasm/tests/timesfwd.hex b/libyasm/tests/timesfwd.hex
new file mode 100644
index 0000000..82904be
--- /dev/null
+++ b/libyasm/tests/timesfwd.hex
@@ -0,0 +1,10 @@
+90 
+90 
+90 
+90 
+90 
+90 
+ff 
+c0 
+ff 
+c1 
diff --git a/libyasm/tests/value-shr-symexpr.asm b/libyasm/tests/value-shr-symexpr.asm
new file mode 100644
index 0000000..988abbf
--- /dev/null
+++ b/libyasm/tests/value-shr-symexpr.asm
@@ -0,0 +1,6 @@
+dw foo
+dw (foo+((1<<9)-1))
+dw (foo+((1<<9)-1)) >> 9
+foo:
+dw (bar+foo)>>(0+1)
+bar:
diff --git a/libyasm/tests/value-shr-symexpr.hex b/libyasm/tests/value-shr-symexpr.hex
new file mode 100644
index 0000000..b316928
--- /dev/null
+++ b/libyasm/tests/value-shr-symexpr.hex
@@ -0,0 +1,8 @@
+06 
+00 
+05 
+02 
+01 
+00 
+07 
+00 
diff --git a/m4/cython.m4 b/m4/cython.m4
new file mode 100644
index 0000000..ba6b3ca
--- /dev/null
+++ b/m4/cython.m4
@@ -0,0 +1,22 @@
+dnl a macro to check for the installed Cython version; note PYTHON needs to
+dnl be set before this function is called.
+dnl  CYTHON_CHECK_VERSION([MIN-VERSION], [ACTION-IF-TRUE], [ACTION-IF-FALSE])
+AC_DEFUN([CYTHON_CHECK_VERSION],
+ [prog="import sys
+from Cython.Compiler.Version import version
+def get_int(arg):
+    try:
+        return int(arg)
+    except ValueError:
+        return 0
+# split strings by '.' and convert to numeric.  Append some zeros
+# because we need at least 4 digits for the hex conversion.
+ver = map(get_int, version.rstrip('abcdefghijklmnopqrstuvwxyz').split('.')) + [[0, 0, 0]]
+verhex = 0
+for i in range(0, 4): verhex = (verhex << 8) + ver[[i]]
+minver = map(get_int, '$1'.split('.')) + [[0, 0, 0]]
+minverhex = 0
+for i in range(0, 4): minverhex = (minverhex << 8) + minver[[i]]
+sys.exit(verhex < minverhex)"
+  AS_IF([AM_RUN_LOG([$PYTHON -c "$prog"])], [$2], [$3])])
+
diff --git a/m4/pyrex.m4 b/m4/pyrex.m4
deleted file mode 100644
index 379c5e3..0000000
--- a/m4/pyrex.m4
+++ /dev/null
@@ -1,17 +0,0 @@
-dnl a macro to check for the installed Pyrex version; note PYTHON needs to
-dnl be set before this function is called.
-dnl  PYREX_CHECK_VERSION([MIN-VERSION], [ACTION-IF-TRUE], [ACTION-IF-FALSE])
-AC_DEFUN([PYREX_CHECK_VERSION],
- [prog="import sys
-from Pyrex.Compiler.Version import version
-# split strings by '.' and convert to numeric.  Append some zeros
-# because we need at least 4 digits for the hex conversion.
-pyrexver = map(int, version.rstrip('abcdefghijklmnopqrstuvwxyz').split('.')) + [[0, 0, 0]]
-pyrexverhex = 0
-for i in xrange(0, 4): pyrexverhex = (pyrexverhex << 8) + pyrexver[[i]]
-minver = map(int, '$1'.split('.')) + [[0, 0, 0]]
-minverhex = 0
-for i in xrange(0, 4): minverhex = (minverhex << 8) + minver[[i]]
-sys.exit(pyrexverhex < minverhex)"
-  AS_IF([AM_RUN_LOG([$PYTHON -c "$prog"])], [$2], [$3])])
-
diff --git a/modules/arch/x86/tests/amd-fma4.asm b/modules/arch/x86/tests/amd-fma4.asm
new file mode 100644
index 0000000..25fdc50
--- /dev/null
+++ b/modules/arch/x86/tests/amd-fma4.asm
@@ -0,0 +1,109 @@
+[bits 64]
+vfmaddpd xmm0, xmm1, xmm2, xmm3
+vfmaddpd xmm0, xmm1, [rax], xmm3
+vfmaddpd xmm0, xmm1, dqword [rax], xmm3
+vfmaddpd xmm0, xmm1, xmm2, [rax]
+vfmaddpd xmm0, xmm1, xmm2, dqword [rax]
+vfmaddpd ymm0, ymm1, ymm2, ymm3
+vfmaddpd ymm0, ymm1, [rax], ymm3
+vfmaddpd ymm0, ymm1, yword [rax], ymm3
+vfmaddpd ymm0, ymm1, ymm2, [rax]
+vfmaddpd ymm0, ymm1, ymm2, yword [rax]
+
+vfmaddps xmm0, xmm1, xmm2, xmm3
+vfmaddps xmm0, xmm1, dqword [rax], xmm3
+vfmaddps xmm0, xmm1, xmm2, dqword [rax]
+vfmaddps ymm0, ymm1, ymm2, ymm3
+vfmaddps ymm0, ymm1, yword [rax], ymm3
+vfmaddps ymm0, ymm1, ymm2, yword [rax]
+
+vfmaddsd xmm0, xmm1, xmm2, xmm3
+vfmaddsd xmm0, xmm1, [rax], xmm3
+vfmaddsd xmm0, xmm1, qword [rax], xmm3
+vfmaddsd xmm0, xmm1, xmm2, [rax]
+vfmaddsd xmm0, xmm1, xmm2, qword [rax]
+
+vfmaddss xmm0, xmm1, xmm2, xmm3
+vfmaddss xmm0, xmm1, dword [rax], xmm3
+vfmaddss xmm0, xmm1, xmm2, dword [rax]
+
+vfmaddsubpd xmm0, xmm1, xmm2, xmm3
+vfmaddsubpd xmm0, xmm1, dqword [rax], xmm3
+vfmaddsubpd xmm0, xmm1, xmm2, dqword [rax]
+vfmaddsubpd ymm0, ymm1, ymm2, ymm3
+vfmaddsubpd ymm0, ymm1, yword [rax], ymm3
+vfmaddsubpd ymm0, ymm1, ymm2, yword [rax]
+
+vfmaddsubps xmm0, xmm1, xmm2, xmm3
+vfmaddsubps xmm0, xmm1, dqword [rax], xmm3
+vfmaddsubps xmm0, xmm1, xmm2, dqword [rax]
+vfmaddsubps ymm0, ymm1, ymm2, ymm3
+vfmaddsubps ymm0, ymm1, yword [rax], ymm3
+vfmaddsubps ymm0, ymm1, ymm2, yword [rax]
+
+vfmsubpd xmm0, xmm1, xmm2, xmm3
+vfmsubpd xmm0, xmm1, dqword [rax], xmm3
+vfmsubpd xmm0, xmm1, xmm2, dqword [rax]
+vfmsubpd ymm0, ymm1, ymm2, ymm3
+vfmsubpd ymm0, ymm1, yword [rax], ymm3
+vfmsubpd ymm0, ymm1, ymm2, yword [rax]
+
+vfmsubps xmm0, xmm1, xmm2, xmm3
+vfmsubps xmm0, xmm1, dqword [rax], xmm3
+vfmsubps xmm0, xmm1, xmm2, dqword [rax]
+vfmsubps ymm0, ymm1, ymm2, ymm3
+vfmsubps ymm0, ymm1, yword [rax], ymm3
+vfmsubps ymm0, ymm1, ymm2, yword [rax]
+
+vfmsubsd xmm0, xmm1, xmm2, xmm3
+vfmsubsd xmm0, xmm1, qword [rax], xmm3
+vfmsubsd xmm0, xmm1, xmm2, qword [rax]
+
+vfmsubss xmm0, xmm1, xmm2, xmm3
+vfmsubss xmm0, xmm1, dword [rax], xmm3
+vfmsubss xmm0, xmm1, xmm2, dword [rax]
+
+vfnmaddpd xmm0, xmm1, xmm2, xmm3
+vfnmaddpd xmm0, xmm1, dqword [rax], xmm3
+vfnmaddpd xmm0, xmm1, xmm2, dqword [rax]
+vfnmaddpd ymm0, ymm1, ymm2, ymm3
+vfnmaddpd ymm0, ymm1, yword [rax], ymm3
+vfnmaddpd ymm0, ymm1, ymm2, yword [rax]
+
+vfnmaddps xmm0, xmm1, xmm2, xmm3
+vfnmaddps xmm0, xmm1, dqword [rax], xmm3
+vfnmaddps xmm0, xmm1, xmm2, dqword [rax]
+vfnmaddps ymm0, ymm1, ymm2, ymm3
+vfnmaddps ymm0, ymm1, yword [rax], ymm3
+vfnmaddps ymm0, ymm1, ymm2, yword [rax]
+
+vfnmaddsd xmm0, xmm1, xmm2, xmm3
+vfnmaddsd xmm0, xmm1, qword [rax], xmm3
+vfnmaddsd xmm0, xmm1, xmm2, qword [rax]
+
+vfnmaddss xmm0, xmm1, xmm2, xmm3
+vfnmaddss xmm0, xmm1, dword [rax], xmm3
+vfnmaddss xmm0, xmm1, xmm2, dword [rax]
+
+vfnmsubpd xmm0, xmm1, xmm2, xmm3
+vfnmsubpd xmm0, xmm1, dqword [rax], xmm3
+vfnmsubpd xmm0, xmm1, xmm2, dqword [rax]
+vfnmsubpd ymm0, ymm1, ymm2, ymm3
+vfnmsubpd ymm0, ymm1, yword [rax], ymm3
+vfnmsubpd ymm0, ymm1, ymm2, yword [rax]
+
+vfnmsubps xmm0, xmm1, xmm2, xmm3
+vfnmsubps xmm0, xmm1, dqword [rax], xmm3
+vfnmsubps xmm0, xmm1, xmm2, dqword [rax]
+vfnmsubps ymm0, ymm1, ymm2, ymm3
+vfnmsubps ymm0, ymm1, yword [rax], ymm3
+vfnmsubps ymm0, ymm1, ymm2, yword [rax]
+
+vfnmsubsd xmm0, xmm1, xmm2, xmm3
+vfnmsubsd xmm0, xmm1, qword [rax], xmm3
+vfnmsubsd xmm0, xmm1, xmm2, qword [rax]
+
+vfnmsubss xmm0, xmm1, xmm2, xmm3
+vfnmsubss xmm0, xmm1, dword [rax], xmm3
+vfnmsubss xmm0, xmm1, xmm2, dword [rax]
+
diff --git a/modules/arch/x86/tests/amd-fma4.hex b/modules/arch/x86/tests/amd-fma4.hex
new file mode 100644
index 0000000..a119317
--- /dev/null
+++ b/modules/arch/x86/tests/amd-fma4.hex
@@ -0,0 +1,540 @@
+c4 
+e3 
+71 
+69 
+c2 
+30 
+c4 
+e3 
+71 
+69 
+00 
+30 
+c4 
+e3 
+71 
+69 
+00 
+30 
+c4 
+e3 
+f1 
+69 
+00 
+20 
+c4 
+e3 
+f1 
+69 
+00 
+20 
+c4 
+e3 
+75 
+69 
+c2 
+30 
+c4 
+e3 
+75 
+69 
+00 
+30 
+c4 
+e3 
+75 
+69 
+00 
+30 
+c4 
+e3 
+f5 
+69 
+00 
+20 
+c4 
+e3 
+f5 
+69 
+00 
+20 
+c4 
+e3 
+71 
+68 
+c2 
+30 
+c4 
+e3 
+71 
+68 
+00 
+30 
+c4 
+e3 
+f1 
+68 
+00 
+20 
+c4 
+e3 
+75 
+68 
+c2 
+30 
+c4 
+e3 
+75 
+68 
+00 
+30 
+c4 
+e3 
+f5 
+68 
+00 
+20 
+c4 
+e3 
+71 
+6b 
+c2 
+30 
+c4 
+e3 
+71 
+6b 
+00 
+30 
+c4 
+e3 
+71 
+6b 
+00 
+30 
+c4 
+e3 
+f1 
+6b 
+00 
+20 
+c4 
+e3 
+f1 
+6b 
+00 
+20 
+c4 
+e3 
+71 
+6a 
+c2 
+30 
+c4 
+e3 
+71 
+6a 
+00 
+30 
+c4 
+e3 
+f1 
+6a 
+00 
+20 
+c4 
+e3 
+71 
+5d 
+c2 
+30 
+c4 
+e3 
+71 
+5d 
+00 
+30 
+c4 
+e3 
+f1 
+5d 
+00 
+20 
+c4 
+e3 
+75 
+5d 
+c2 
+30 
+c4 
+e3 
+75 
+5d 
+00 
+30 
+c4 
+e3 
+f5 
+5d 
+00 
+20 
+c4 
+e3 
+71 
+5c 
+c2 
+30 
+c4 
+e3 
+71 
+5c 
+00 
+30 
+c4 
+e3 
+f1 
+5c 
+00 
+20 
+c4 
+e3 
+75 
+5c 
+c2 
+30 
+c4 
+e3 
+75 
+5c 
+00 
+30 
+c4 
+e3 
+f5 
+5c 
+00 
+20 
+c4 
+e3 
+71 
+6d 
+c2 
+30 
+c4 
+e3 
+71 
+6d 
+00 
+30 
+c4 
+e3 
+f1 
+6d 
+00 
+20 
+c4 
+e3 
+75 
+6d 
+c2 
+30 
+c4 
+e3 
+75 
+6d 
+00 
+30 
+c4 
+e3 
+f5 
+6d 
+00 
+20 
+c4 
+e3 
+71 
+6c 
+c2 
+30 
+c4 
+e3 
+71 
+6c 
+00 
+30 
+c4 
+e3 
+f1 
+6c 
+00 
+20 
+c4 
+e3 
+75 
+6c 
+c2 
+30 
+c4 
+e3 
+75 
+6c 
+00 
+30 
+c4 
+e3 
+f5 
+6c 
+00 
+20 
+c4 
+e3 
+71 
+6f 
+c2 
+30 
+c4 
+e3 
+71 
+6f 
+00 
+30 
+c4 
+e3 
+f1 
+6f 
+00 
+20 
+c4 
+e3 
+71 
+6e 
+c2 
+30 
+c4 
+e3 
+71 
+6e 
+00 
+30 
+c4 
+e3 
+f1 
+6e 
+00 
+20 
+c4 
+e3 
+71 
+79 
+c2 
+30 
+c4 
+e3 
+71 
+79 
+00 
+30 
+c4 
+e3 
+f1 
+79 
+00 
+20 
+c4 
+e3 
+75 
+79 
+c2 
+30 
+c4 
+e3 
+75 
+79 
+00 
+30 
+c4 
+e3 
+f5 
+79 
+00 
+20 
+c4 
+e3 
+71 
+78 
+c2 
+30 
+c4 
+e3 
+71 
+78 
+00 
+30 
+c4 
+e3 
+f1 
+78 
+00 
+20 
+c4 
+e3 
+75 
+78 
+c2 
+30 
+c4 
+e3 
+75 
+78 
+00 
+30 
+c4 
+e3 
+f5 
+78 
+00 
+20 
+c4 
+e3 
+71 
+7b 
+c2 
+30 
+c4 
+e3 
+71 
+7b 
+00 
+30 
+c4 
+e3 
+f1 
+7b 
+00 
+20 
+c4 
+e3 
+71 
+7a 
+c2 
+30 
+c4 
+e3 
+71 
+7a 
+00 
+30 
+c4 
+e3 
+f1 
+7a 
+00 
+20 
+c4 
+e3 
+71 
+7d 
+c2 
+30 
+c4 
+e3 
+71 
+7d 
+00 
+30 
+c4 
+e3 
+f1 
+7d 
+00 
+20 
+c4 
+e3 
+75 
+7d 
+c2 
+30 
+c4 
+e3 
+75 
+7d 
+00 
+30 
+c4 
+e3 
+f5 
+7d 
+00 
+20 
+c4 
+e3 
+71 
+7c 
+c2 
+30 
+c4 
+e3 
+71 
+7c 
+00 
+30 
+c4 
+e3 
+f1 
+7c 
+00 
+20 
+c4 
+e3 
+75 
+7c 
+c2 
+30 
+c4 
+e3 
+75 
+7c 
+00 
+30 
+c4 
+e3 
+f5 
+7c 
+00 
+20 
+c4 
+e3 
+71 
+7f 
+c2 
+30 
+c4 
+e3 
+71 
+7f 
+00 
+30 
+c4 
+e3 
+f1 
+7f 
+00 
+20 
+c4 
+e3 
+71 
+7e 
+c2 
+30 
+c4 
+e3 
+71 
+7e 
+00 
+30 
+c4 
+e3 
+f1 
+7e 
+00 
+20 
diff --git a/modules/arch/x86/tests/avx16.asm b/modules/arch/x86/tests/avx16.asm
new file mode 100644
index 0000000..7216758
--- /dev/null
+++ b/modules/arch/x86/tests/avx16.asm
@@ -0,0 +1,10 @@
+[bits 16]
+extractps eax, xmm1, 5
+vextractps eax, xmm1, 5
+pextrb eax, xmm1, 5
+vpextrb eax, xmm1, 5
+pextrw eax, xmm1, 5
+vpextrw eax, xmm1, 5
+pextrd eax, xmm1, 5
+vpextrd eax, xmm1, 5
+vpinsrd xmm1, xmm2, eax, 5
diff --git a/modules/arch/x86/tests/avx16.hex b/modules/arch/x86/tests/avx16.hex
new file mode 100644
index 0000000..6e3a538
--- /dev/null
+++ b/modules/arch/x86/tests/avx16.hex
@@ -0,0 +1,52 @@
+66 
+0f 
+3a 
+17 
+c8 
+05 
+c4 
+e3 
+79 
+17 
+c8 
+05 
+66 
+0f 
+3a 
+14 
+c8 
+05 
+c4 
+e3 
+79 
+14 
+c8 
+05 
+66 
+0f 
+c5 
+c1 
+05 
+c5 
+f9 
+c5 
+c1 
+05 
+66 
+0f 
+3a 
+16 
+c8 
+05 
+c4 
+e3 
+79 
+16 
+c8 
+05 
+c4 
+e3 
+69 
+22 
+c8 
+05 
diff --git a/modules/arch/x86/tests/avx2.asm b/modules/arch/x86/tests/avx2.asm
new file mode 100644
index 0000000..e76016c
--- /dev/null
+++ b/modules/arch/x86/tests/avx2.asm
@@ -0,0 +1,652 @@
+; Exhaustive test of AVX2 instructions
+;
+;  Copyright (C) 2011  Peter Johnson
+;
+; Redistribution and use in source and binary forms, with or without
+; modification, are permitted provided that the following conditions
+; are met:
+; 1. Redistributions of source code must retain the above copyright
+;    notice, this list of conditions and the following disclaimer.
+; 2. 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 AUTHOR AND OTHER 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 AUTHOR OR OTHER 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.
+;
+
+[bits 64]
+
+vmpsadbw ymm1, ymm3, 3			; c4 e3 75 42 cb 03
+vmpsadbw ymm1, yword [rax], 3		; c4 e3 75 42 08 03
+vmpsadbw ymm1, ymm2, ymm3, 3		; c4 e3 6d 42 cb 03
+vmpsadbw ymm1, ymm2, yword [rax], 3	; c4 e3 6d 42 08 03
+
+vpabsb ymm1, ymm2			; c4 e2 7d 1c ca
+vpabsb ymm1, yword [rax]		; c4 e2 7d 1c 08
+
+vpabsw ymm1, ymm2			; c4 e2 7d 1d ca
+vpabsw ymm1, yword [rax]		; c4 e2 7d 1d 08
+
+vpabsd ymm1, ymm2			; c4 e2 7d 1e ca
+vpabsd ymm1, yword [rax]		; c4 e2 7d 1e 08
+
+vpacksswb ymm1, ymm3			; c5 f5 63 cb
+vpacksswb ymm1, yword [rax]		; c5 f5 63 08
+vpacksswb ymm1, ymm2, ymm3		; c5 ed 63 cb
+vpacksswb ymm1, ymm2, yword [rax]	; c5 ed 63 08
+
+vpackssdw ymm1, ymm3			; c5 f5 6b cb
+vpackssdw ymm1, yword [rax]		; c5 f5 6b 08
+vpackssdw ymm1, ymm2, ymm3		; c5 ed 6b cb
+vpackssdw ymm1, ymm2, yword [rax]	; c5 ed 6b 08
+
+vpackusdw ymm1, ymm3			; c4 e2 75 2b cb
+vpackusdw ymm1, yword [rax]		; c4 e2 75 2b 08
+vpackusdw ymm1, ymm2, ymm3		; c4 e2 6d 2b cb
+vpackusdw ymm1, ymm2, yword [rax]	; c4 e2 6d 2b 08
+
+vpackuswb ymm1, ymm3			; c5 f5 67 cb
+vpackuswb ymm1, yword [rax]		; c5 f5 67 08
+vpackuswb ymm1, ymm2, ymm3		; c5 ed 67 cb
+vpackuswb ymm1, ymm2, yword [rax]	; c5 ed 67 08
+
+vpaddb ymm1, ymm3			; c5 f5 fc cb
+vpaddb ymm1, yword [rax]		; c5 f5 fc 08
+vpaddb ymm1, ymm2, ymm3			; c5 ed fc cb
+vpaddb ymm1, ymm2, yword [rax]		; c5 ed fc 08
+
+vpaddw ymm1, ymm3			; c5 f5 fd cb
+vpaddw ymm1, yword [rax]		; c5 f5 fd 08
+vpaddw ymm1, ymm2, ymm3			; c5 ed fd cb
+vpaddw ymm1, ymm2, yword [rax]		; c5 ed fd 08
+
+vpaddd ymm1, ymm3			; c5 f5 fe cb
+vpaddd ymm1, yword [rax]		; c5 f5 fe 08
+vpaddd ymm1, ymm2, ymm3			; c5 ed fe cb
+vpaddd ymm1, ymm2, yword [rax]		; c5 ed fe 08
+
+vpaddq ymm1, ymm3			; c5 f5 d4 cb
+vpaddq ymm1, yword [rax]		; c5 f5 d4 08
+vpaddq ymm1, ymm2, ymm3			; c5 ed d4 cb
+vpaddq ymm1, ymm2, yword [rax]		; c5 ed d4 08
+
+vpaddsb ymm1, ymm3			; c5 f5 ec cb
+vpaddsb ymm1, yword [rax]		; c5 f5 ec 08
+vpaddsb ymm1, ymm2, ymm3		; c5 ed ec cb
+vpaddsb ymm1, ymm2, yword [rax]		; c5 ed ec 08
+
+vpaddsw ymm1, ymm3			; c5 f5 ed cb
+vpaddsw ymm1, yword [rax]		; c5 f5 ed 08
+vpaddsw ymm1, ymm2, ymm3		; c5 ed ed cb
+vpaddsw ymm1, ymm2, yword [rax]		; c5 ed ed 08
+
+vpaddusb ymm1, ymm3			; c5 f5 dc cb
+vpaddusb ymm1, yword [rax]		; c5 f5 dc 08
+vpaddusb ymm1, ymm2, ymm3		; c5 ed dc cb
+vpaddusb ymm1, ymm2, yword [rax]	; c5 ed dc 08
+
+vpaddusw ymm1, ymm3			; c5 f5 dd cb
+vpaddusw ymm1, yword [rax]		; c5 f5 dd 08
+vpaddusw ymm1, ymm2, ymm3		; c5 ed dd cb
+vpaddusw ymm1, ymm2, yword [rax]	; c5 ed dd 08
+
+vpalignr ymm1, ymm2, ymm3, 3		; c4 e3 6d 0f cb 03
+vpalignr ymm1, ymm2, yword [rax], 3	; c4 e3 6d 0f 08 03
+
+vpand ymm1, ymm3			; c5 f5 db cb
+vpand ymm1, yword [rax]			; c5 f5 db 08
+vpand ymm1, ymm2, ymm3			; c5 ed db cb
+vpand ymm1, ymm2, yword [rax]		; c5 ed db 08
+
+vpandn ymm1, ymm3			; c5 f5 df cb
+vpandn ymm1, yword [rax]		; c5 f5 df 08
+vpandn ymm1, ymm2, ymm3			; c5 ed df cb
+vpandn ymm1, ymm2, yword [rax]		; c5 ed df 08
+
+vpavgb ymm1, ymm3			; c5 f5 e0 cb
+vpavgb ymm1, yword [rax]		; c5 f5 e0 08
+vpavgb ymm1, ymm2, ymm3			; c5 ed e0 cb
+vpavgb ymm1, ymm2, yword [rax]		; c5 ed e0 08
+
+vpavgw ymm1, ymm3			; c5 f5 e3 cb
+vpavgw ymm1, yword [rax]		; c5 f5 e3 08
+vpavgw ymm1, ymm2, ymm3			; c5 ed e3 cb
+vpavgw ymm1, ymm2, yword [rax]		; c5 ed e3 08
+
+vpblendvb ymm1, ymm2, ymm3, ymm4	; c4 e3 6d 4c cb 40
+vpblendvb ymm1, ymm2, yword [rax], ymm4	; c4 e3 6d 4c 08 40
+
+vpblendw ymm1, ymm3, 3			; c4 e3 75 0e cb 03
+vpblendw ymm1, yword [rax], 3		; c4 e3 75 0e 08 03
+vpblendw ymm1, ymm2, ymm3, 3		; c4 e3 6d 0e cb 03
+vpblendw ymm1, ymm2, yword [rax], 3	; c4 e3 6d 0e 08 03
+
+vpcmpeqb ymm1, ymm3			; c5 f5 74 cb
+vpcmpeqb ymm1, yword [rax]		; c5 f5 74 08
+vpcmpeqb ymm1, ymm2, ymm3		; c5 ed 74 cb
+vpcmpeqb ymm1, ymm2, yword [rax]	; c5 ed 74 08
+
+vpcmpeqw ymm1, ymm3			; c5 f5 75 cb
+vpcmpeqw ymm1, yword [rax]		; c5 f5 75 08
+vpcmpeqw ymm1, ymm2, ymm3		; c5 ed 75 cb
+vpcmpeqw ymm1, ymm2, yword [rax]	; c5 ed 75 08
+
+vpcmpeqd ymm1, ymm3			; c5 f5 76 cb
+vpcmpeqd ymm1, yword [rax]		; c5 f5 76 08
+vpcmpeqd ymm1, ymm2, ymm3		; c5 ed 76 cb
+vpcmpeqd ymm1, ymm2, yword [rax]	; c5 ed 76 08
+
+vpcmpeqq ymm1, ymm3			; c4 e2 75 29 cb
+vpcmpeqq ymm1, yword [rax]		; c4 e2 75 29 08
+vpcmpeqq ymm1, ymm2, ymm3		; c4 e2 6d 29 cb
+vpcmpeqq ymm1, ymm2, yword [rax]	; c4 e2 6d 29 08
+
+vpcmpgtb ymm1, ymm3			; c5 f5 64 cb
+vpcmpgtb ymm1, yword [rax]		; c5 f5 64 08
+vpcmpgtb ymm1, ymm2, ymm3		; c5 ed 64 cb
+vpcmpgtb ymm1, ymm2, yword [rax]	; c5 ed 64 08
+
+vpcmpgtw ymm1, ymm3			; c5 f5 65 cb
+vpcmpgtw ymm1, yword [rax]		; c5 f5 65 08
+vpcmpgtw ymm1, ymm2, ymm3		; c5 ed 65 cb
+vpcmpgtw ymm1, ymm2, yword [rax]	; c5 ed 65 08
+
+vpcmpgtd ymm1, ymm3			; c5 f5 66 cb
+vpcmpgtd ymm1, yword [rax]		; c5 f5 66 08
+vpcmpgtd ymm1, ymm2, ymm3		; c5 ed 66 cb
+vpcmpgtd ymm1, ymm2, yword [rax]	; c5 ed 66 08
+
+vpcmpgtq ymm1, ymm3			; c4 e2 75 37 cb
+vpcmpgtq ymm1, yword [rax]		; c4 e2 75 37 08
+vpcmpgtq ymm1, ymm2, ymm3		; c4 e2 6d 37 cb
+vpcmpgtq ymm1, ymm2, yword [rax]	; c4 e2 6d 37 08
+
+vphaddw ymm1, ymm3			; c4 e2 75 01 cb
+vphaddw ymm1, yword [rax]		; c4 e2 75 01 08
+vphaddw ymm1, ymm2, ymm3		; c4 e2 6d 01 cb
+vphaddw ymm1, ymm2, yword [rax]		; c4 e2 6d 01 08
+
+vphaddd ymm1, ymm3			; c4 e2 75 02 cb
+vphaddd ymm1, yword [rax]		; c4 e2 75 02 08
+vphaddd ymm1, ymm2, ymm3		; c4 e2 6d 02 cb
+vphaddd ymm1, ymm2, yword [rax]		; c4 e2 6d 02 08
+
+vphaddsw ymm1, ymm3			; c4 e2 75 03 cb
+vphaddsw ymm1, yword [rax]		; c4 e2 75 03 08
+vphaddsw ymm1, ymm2, ymm3		; c4 e2 6d 03 cb
+vphaddsw ymm1, ymm2, yword [rax]	; c4 e2 6d 03 08
+
+vphsubw ymm1, ymm3			; c4 e2 75 05 cb
+vphsubw ymm1, yword [rax]		; c4 e2 75 05 08
+vphsubw ymm1, ymm2, ymm3		; c4 e2 6d 05 cb
+vphsubw ymm1, ymm2, yword [rax]		; c4 e2 6d 05 08
+
+vphsubd ymm1, ymm3			; c4 e2 75 06 cb
+vphsubd ymm1, yword [rax]		; c4 e2 75 06 08
+vphsubd ymm1, ymm2, ymm3		; c4 e2 6d 06 cb
+vphsubd ymm1, ymm2, yword [rax]		; c4 e2 6d 06 08
+
+vphsubsw ymm1, ymm3			; c4 e2 75 07 cb
+vphsubsw ymm1, yword [rax]		; c4 e2 75 07 08
+vphsubsw ymm1, ymm2, ymm3		; c4 e2 6d 07 cb
+vphsubsw ymm1, ymm2, yword [rax]	; c4 e2 6d 07 08
+
+vpmaddubsw ymm1, ymm3			; c4 e2 75 04 cb
+vpmaddubsw ymm1, yword [rax]		; c4 e2 75 04 08
+vpmaddubsw ymm1, ymm2, ymm3		; c4 e2 6d 04 cb
+vpmaddubsw ymm1, ymm2, yword [rax]	; c4 e2 6d 04 08
+
+vpmaddwd ymm1, ymm3			; c5 f5 f5 cb
+vpmaddwd ymm1, yword [rax]		; c5 f5 f5 08
+vpmaddwd ymm1, ymm2, ymm3		; c5 ed f5 cb
+vpmaddwd ymm1, ymm2, yword [rax]	; c5 ed f5 08
+
+vpmaxsb ymm1, ymm3			; c4 e2 75 3c cb
+vpmaxsb ymm1, yword [rax]		; c4 e2 75 3c 08
+vpmaxsb ymm1, ymm2, ymm3		; c4 e2 6d 3c cb
+vpmaxsb ymm1, ymm2, yword [rax]		; c4 e2 6d 3c 08
+
+vpmaxsw ymm1, ymm3			; c5 f5 ee cb
+vpmaxsw ymm1, yword [rax]		; c5 f5 ee 08
+vpmaxsw ymm1, ymm2, ymm3		; c5 ed ee cb
+vpmaxsw ymm1, ymm2, yword [rax]		; c5 ed ee 08
+
+vpmaxsd ymm1, ymm3			; c4 e2 75 3d cb
+vpmaxsd ymm1, yword [rax]		; c4 e2 75 3d 08
+vpmaxsd ymm1, ymm2, ymm3		; c4 e2 6d 3d cb
+vpmaxsd ymm1, ymm2, yword [rax]		; c4 e2 6d 3d 08
+
+vpmaxub ymm1, ymm3			; c5 f5 de cb
+vpmaxub ymm1, yword [rax]		; c5 f5 de 08
+vpmaxub ymm1, ymm2, ymm3		; c5 ed de cb
+vpmaxub ymm1, ymm2, yword [rax]		; c5 ed de 08
+
+vpmaxuw ymm1, ymm3			; c4 e2 75 3e cb
+vpmaxuw ymm1, yword [rax]		; c4 e2 75 3e 08
+vpmaxuw ymm1, ymm2, ymm3		; c4 e2 6d 3e cb
+vpmaxuw ymm1, ymm2, yword [rax]		; c4 e2 6d 3e 08
+
+vpmaxud ymm1, ymm3			; c4 e2 75 3f cb
+vpmaxud ymm1, yword [rax]		; c4 e2 75 3f 08
+vpmaxud ymm1, ymm2, ymm3		; c4 e2 6d 3f cb
+vpmaxud ymm1, ymm2, yword [rax]		; c4 e2 6d 3f 08
+
+vpminsb ymm1, ymm3			; c4 e2 75 38 cb
+vpminsb ymm1, yword [rax]		; c4 e2 75 38 08
+vpminsb ymm1, ymm2, ymm3		; c4 e2 6d 38 cb
+vpminsb ymm1, ymm2, yword [rax]		; c4 e2 6d 38 08
+
+vpminsw ymm1, ymm3			; c5 f5 ea cb
+vpminsw ymm1, yword [rax]		; c5 f5 ea 08
+vpminsw ymm1, ymm2, ymm3		; c5 ed ea cb
+vpminsw ymm1, ymm2, yword [rax]		; c5 ed ea 08
+
+vpminsd ymm1, ymm3			; c4 e2 75 39 cb
+vpminsd ymm1, yword [rax]		; c4 e2 75 39 08
+vpminsd ymm1, ymm2, ymm3		; c4 e2 6d 39 cb
+vpminsd ymm1, ymm2, yword [rax]		; c4 e2 6d 39 08
+
+vpminub ymm1, ymm3			; c5 f5 da cb
+vpminub ymm1, yword [rax]		; c5 f5 da 08
+vpminub ymm1, ymm2, ymm3		; c5 ed da cb
+vpminub ymm1, ymm2, yword [rax]		; c5 ed da 08
+
+vpminuw ymm1, ymm3			; c4 e2 75 3a cb
+vpminuw ymm1, yword [rax]		; c4 e2 75 3a 08
+vpminuw ymm1, ymm2, ymm3		; c4 e2 6d 3a cb
+vpminuw ymm1, ymm2, yword [rax]		; c4 e2 6d 3a 08
+
+vpminud ymm1, ymm3			; c4 e2 75 3b cb
+vpminud ymm1, yword [rax]		; c4 e2 75 3b 08
+vpminud ymm1, ymm2, ymm3		; c4 e2 6d 3b cb
+vpminud ymm1, ymm2, yword [rax]		; c4 e2 6d 3b 08
+
+vpmovmskb eax, ymm1			; c5 fd d7 c1
+vpmovmskb rax, ymm1			; c5 fd d7 c1
+
+vpmovsxbw ymm1, xmm2			; c4 e2 7d 20 ca
+vpmovsxbw ymm1, [rax]			; c4 e2 7d 20 08
+vpmovsxbw ymm1, oword [rax]		; c4 e2 7d 20 08
+
+vpmovsxbd ymm1, xmm2			; c4 e2 7d 21 ca
+vpmovsxbd ymm1, [rax]			; c4 e2 7d 21 08
+vpmovsxbd ymm1, qword [rax]		; c4 e2 7d 21 08
+
+vpmovsxbq ymm1, xmm2			; c4 e2 7d 22 ca
+vpmovsxbq ymm1, [rax]			; c4 e2 7d 22 08
+vpmovsxbq ymm1, dword [rax]		; c4 e2 7d 22 08
+
+vpmovsxwd ymm1, xmm2			; c4 e2 7d 23 ca
+vpmovsxwd ymm1, [rax]			; c4 e2 7d 23 08
+vpmovsxwd ymm1, oword [rax]		; c4 e2 7d 23 08
+
+vpmovsxwq ymm1, xmm2			; c4 e2 7d 24 ca
+vpmovsxwq ymm1, [rax]			; c4 e2 7d 24 08
+vpmovsxwq ymm1, qword [rax]		; c4 e2 7d 24 08
+
+vpmovsxdq ymm1, xmm2			; c4 e2 7d 25 ca
+vpmovsxdq ymm1, [rax]			; c4 e2 7d 25 08
+vpmovsxdq ymm1, oword [rax]		; c4 e2 7d 25 08
+
+vpmovzxbw ymm1, xmm2			; c4 e2 7d 30 ca
+vpmovzxbw ymm1, [rax]			; c4 e2 7d 30 08
+vpmovzxbw ymm1, oword [rax]		; c4 e2 7d 30 08
+
+vpmovzxbd ymm1, xmm2			; c4 e2 7d 31 ca
+vpmovzxbd ymm1, [rax]			; c4 e2 7d 31 08
+vpmovzxbd ymm1, qword [rax]		; c4 e2 7d 31 08
+
+vpmovzxbq ymm1, xmm2			; c4 e2 7d 32 ca
+vpmovzxbq ymm1, [rax]			; c4 e2 7d 32 08
+vpmovzxbq ymm1, dword [rax]		; c4 e2 7d 32 08
+
+vpmovzxwd ymm1, xmm2			; c4 e2 7d 33 ca
+vpmovzxwd ymm1, [rax]			; c4 e2 7d 33 08
+vpmovzxwd ymm1, oword [rax]		; c4 e2 7d 33 08
+
+vpmovzxwq ymm1, xmm2			; c4 e2 7d 34 ca
+vpmovzxwq ymm1, [rax]			; c4 e2 7d 34 08
+vpmovzxwq ymm1, qword [rax]		; c4 e2 7d 34 08
+
+vpmovzxdq ymm1, xmm2			; c4 e2 7d 35 ca
+vpmovzxdq ymm1, [rax]			; c4 e2 7d 35 08
+vpmovzxdq ymm1, oword [rax]		; c4 e2 7d 35 08
+
+vpmuldq ymm1, ymm3			; c4 e2 75 28 cb
+vpmuldq ymm1, yword [rax]		; c4 e2 75 28 08
+vpmuldq ymm1, ymm2, ymm3		; c4 e2 6d 28 cb
+vpmuldq ymm1, ymm2, yword [rax]		; c4 e2 6d 28 08
+
+vpmulhrsw ymm1, ymm3			; c4 e2 75 0b cb
+vpmulhrsw ymm1, yword [rax]		; c4 e2 75 0b 08
+vpmulhrsw ymm1, ymm2, ymm3		; c4 e2 6d 0b cb
+vpmulhrsw ymm1, ymm2, yword [rax]	; c4 e2 6d 0b 08
+
+vpmulhuw ymm1, ymm3			; c5 f5 e4 cb
+vpmulhuw ymm1, yword [rax]		; c5 f5 e4 08
+vpmulhuw ymm1, ymm2, ymm3		; c5 ed e4 cb
+vpmulhuw ymm1, ymm2, yword [rax]	; c5 ed e4 08
+
+vpmulhw ymm1, ymm3			; c5 f5 e5 cb
+vpmulhw ymm1, yword [rax]		; c5 f5 e5 08
+vpmulhw ymm1, ymm2, ymm3		; c5 ed e5 cb
+vpmulhw ymm1, ymm2, yword [rax]		; c5 ed e5 08
+
+vpmullw ymm1, ymm3			; c5 f5 d5 cb
+vpmullw ymm1, yword [rax]		; c5 f5 d5 08
+vpmullw ymm1, ymm2, ymm3		; c5 ed d5 cb
+vpmullw ymm1, ymm2, yword [rax]		; c5 ed d5 08
+
+vpmulld ymm1, ymm3			; c4 e2 75 40 cb
+vpmulld ymm1, yword [rax]		; c4 e2 75 40 08
+vpmulld ymm1, ymm2, ymm3		; c4 e2 6d 40 cb
+vpmulld ymm1, ymm2, yword [rax]		; c4 e2 6d 40 08
+
+vpmuludq ymm1, ymm3			; c5 f5 f4 cb
+vpmuludq ymm1, yword [rax]		; c5 f5 f4 08
+vpmuludq ymm1, ymm2, ymm3		; c5 ed f4 cb
+vpmuludq ymm1, ymm2, yword [rax]	; c5 ed f4 08
+
+vpor ymm1, ymm3				; c5 f5 eb cb
+vpor ymm1, yword [rax]			; c5 f5 eb 08
+vpor ymm1, ymm2, ymm3			; c5 ed eb cb
+vpor ymm1, ymm2, yword [rax]		; c5 ed eb 08
+
+vpsadbw ymm1, ymm3			; c5 f5 f6 cb
+vpsadbw ymm1, yword [rax]		; c5 f5 f6 08
+vpsadbw ymm1, ymm2, ymm3		; c5 ed f6 cb
+vpsadbw ymm1, ymm2, yword [rax]		; c5 ed f6 08
+
+vpshufb ymm1, ymm3			; c4 e2 75 00 cb
+vpshufb ymm1, yword [rax]		; c4 e2 75 00 08
+vpshufb ymm1, ymm2, ymm3		; c4 e2 6d 00 cb
+vpshufb ymm1, ymm2, yword [rax]		; c4 e2 6d 00 08
+
+vpshufd ymm1, ymm3, 3			; c5 fd 70 cb 03
+vpshufd ymm1, yword [rax], 3		; c5 fd 70 08 03
+
+vpshufhw ymm1, ymm3, 3			; c5 fe 70 cb 03
+vpshufhw ymm1, yword [rax], 3		; c5 fe 70 08 03
+
+vpshuflw ymm1, ymm3, 3			; c5 ff 70 cb 03
+vpshuflw ymm1, yword [rax], 3		; c5 ff 70 08 03
+
+vpsignb ymm1, ymm3			; c4 e2 75 08 cb
+vpsignb ymm1, yword [rax]		; c4 e2 75 08 08
+vpsignb ymm1, ymm2, ymm3		; c4 e2 6d 08 cb
+vpsignb ymm1, ymm2, yword [rax]		; c4 e2 6d 08 08
+
+vpsignw ymm1, ymm3			; c4 e2 75 09 cb
+vpsignw ymm1, yword [rax]		; c4 e2 75 09 08
+vpsignw ymm1, ymm2, ymm3		; c4 e2 6d 09 cb
+vpsignw ymm1, ymm2, yword [rax]		; c4 e2 6d 09 08
+
+vpsignd ymm1, ymm3			; c4 e2 75 0a cb
+vpsignd ymm1, yword [rax]		; c4 e2 75 0a 08
+vpsignd ymm1, ymm2, ymm3		; c4 e2 6d 0a cb
+vpsignd ymm1, ymm2, yword [rax]		; c4 e2 6d 0a 08
+
+vpslldq ymm1, 3				; c5 f5 73 f9 03
+vpslldq ymm1, ymm2, 3			; c5 f5 73 fa 03
+
+vpsllw ymm1, xmm3			; c5 f5 f1 cb
+vpsllw ymm1, oword [rax]		; c5 f5 f1 08
+vpsllw ymm1, 3				; c5 f5 71 f1 03
+vpsllw ymm1, ymm2, xmm3			; c5 ed f1 cb
+vpsllw ymm1, ymm2, oword [rax]		; c5 ed f1 08
+vpsllw ymm1, ymm2, 3			; c5 f5 71 f2 03
+
+vpslld ymm1, xmm3			; c5 f5 f2 cb
+vpslld ymm1, oword [rax]		; c5 f5 f2 08
+vpslld ymm1, 3				; c5 f5 72 f1 03
+vpslld ymm1, ymm2, xmm3			; c5 ed f2 cb
+vpslld ymm1, ymm2, oword [rax]		; c5 ed f2 08
+vpslld ymm1, ymm2, 3			; c5 f5 72 f2 03
+
+vpsllq ymm1, xmm3			; c5 f5 f3 cb
+vpsllq ymm1, oword [rax]		; c5 f5 f3 08
+vpsllq ymm1, 3				; c5 f5 73 f1 03
+vpsllq ymm1, ymm2, xmm3			; c5 ed f3 cb
+vpsllq ymm1, ymm2, oword [rax]		; c5 ed f3 08
+vpsllq ymm1, ymm2, 3			; c5 f5 73 f2 03
+
+vpsraw ymm1, xmm3			; c5 f5 e1 cb
+vpsraw ymm1, oword [rax]		; c5 f5 e1 08
+vpsraw ymm1, 3				; c5 f5 71 e1 03
+vpsraw ymm1, ymm2, xmm3			; c5 ed e1 cb
+vpsraw ymm1, ymm2, oword [rax]		; c5 ed e1 08
+vpsraw ymm1, ymm2, 3			; c5 f5 71 e2 03
+
+vpsrad ymm1, xmm3			; c5 f5 e2 cb
+vpsrad ymm1, oword [rax]		; c5 f5 e2 08
+vpsrad ymm1, 3				; c5 f5 72 e1 03
+vpsrad ymm1, ymm2, xmm3			; c5 ed e2 cb
+vpsrad ymm1, ymm2, oword [rax]		; c5 ed e2 08
+vpsrad ymm1, ymm2, 3			; c5 f5 72 e2 03
+
+vpsrldq ymm1, 3				; c5 f5 73 d9 03
+vpsrldq ymm1, ymm2, 3			; c5 f5 73 da 03
+
+vpsrlw ymm1, xmm3			; c5 f5 d1 cb
+vpsrlw ymm1, oword [rax]		; c5 f5 d1 08
+vpsrlw ymm1, 3				; c5 f5 71 d1 03
+vpsrlw ymm1, ymm2, xmm3			; c5 ed d1 cb
+vpsrlw ymm1, ymm2, oword [rax]		; c5 ed d1 08
+vpsrlw ymm1, ymm2, 3			; c5 f5 71 d2 03
+
+vpsrld ymm1, xmm3			; c5 f5 d2 cb
+vpsrld ymm1, oword [rax]		; c5 f5 d2 08
+vpsrld ymm1, 3				; c5 f5 72 d1 03
+vpsrld ymm1, ymm2, xmm3			; c5 ed d2 cb
+vpsrld ymm1, ymm2, oword [rax]		; c5 ed d2 08
+vpsrld ymm1, ymm2, 3			; c5 f5 72 d2 03
+
+vpsrld ymm1, xmm3			; c5 f5 d2 cb
+vpsrld ymm1, oword [rax]		; c5 f5 d2 08
+vpsrld ymm1, 3				; c5 f5 72 d1 03
+vpsrld ymm1, ymm2, xmm3			; c5 ed d2 cb
+vpsrld ymm1, ymm2, oword [rax]		; c5 ed d2 08
+vpsrld ymm1, ymm2, 3			; c5 f5 72 d2 03
+
+vpsubsb ymm1, ymm3			; c5 f5 e8 cb
+vpsubsb ymm1, yword [rax]		; c5 f5 e8 08
+vpsubsb ymm1, ymm2, ymm3		; c5 ed e8 cb
+vpsubsb ymm1, ymm2, yword [rax]		; c5 ed e8 08
+
+vpsubsw ymm1, ymm3			; c5 f5 e9 cb
+vpsubsw ymm1, yword [rax]		; c5 f5 e9 08
+vpsubsw ymm1, ymm2, ymm3		; c5 ed e9 cb
+vpsubsw ymm1, ymm2, yword [rax]		; c5 ed e9 08
+
+vpsubusb ymm1, ymm3			; c5 f5 d8 cb
+vpsubusb ymm1, yword [rax]		; c5 f5 d8 08
+vpsubusb ymm1, ymm2, ymm3		; c5 ed d8 cb
+vpsubusb ymm1, ymm2, yword [rax]	; c5 ed d8 08
+
+vpsubusw ymm1, ymm3			; c5 f5 d9 cb
+vpsubusw ymm1, yword [rax]		; c5 f5 d9 08
+vpsubusw ymm1, ymm2, ymm3		; c5 ed d9 cb
+vpsubusw ymm1, ymm2, yword [rax]	; c5 ed d9 08
+
+vpunpckhbw ymm1, ymm3			; c5 f5 68 cb
+vpunpckhbw ymm1, yword [rax]		; c5 f5 68 08
+vpunpckhbw ymm1, ymm2, ymm3		; c5 ed 68 cb
+vpunpckhbw ymm1, ymm2, yword [rax]	; c5 ed 68 08
+
+vpunpckhwd ymm1, ymm3			; c5 f5 69 cb
+vpunpckhwd ymm1, yword [rax]		; c5 f5 69 08
+vpunpckhwd ymm1, ymm2, ymm3		; c5 ed 69 cb
+vpunpckhwd ymm1, ymm2, yword [rax]	; c5 ed 69 08
+
+vpunpckhdq ymm1, ymm3			; c5 f5 6a cb
+vpunpckhdq ymm1, yword [rax]		; c5 f5 6a 08
+vpunpckhdq ymm1, ymm2, ymm3		; c5 ed 6a cb
+vpunpckhdq ymm1, ymm2, yword [rax]	; c5 ed 6a 08
+
+vpunpckhqdq ymm1, ymm3			; c5 f5 6d cb
+vpunpckhqdq ymm1, yword [rax]		; c5 f5 6d 08
+vpunpckhqdq ymm1, ymm2, ymm3		; c5 ed 6d cb
+vpunpckhqdq ymm1, ymm2, yword [rax]	; c5 ed 6d 08
+
+vpunpcklbw ymm1, ymm3			; c5 f5 60 cb
+vpunpcklbw ymm1, yword [rax]		; c5 f5 60 08
+vpunpcklbw ymm1, ymm2, ymm3		; c5 ed 60 cb
+vpunpcklbw ymm1, ymm2, yword [rax]	; c5 ed 60 08
+
+vpunpcklwd ymm1, ymm3			; c5 f5 61 cb
+vpunpcklwd ymm1, yword [rax]		; c5 f5 61 08
+vpunpcklwd ymm1, ymm2, ymm3		; c5 ed 61 cb
+vpunpcklwd ymm1, ymm2, yword [rax]	; c5 ed 61 08
+
+vpunpckldq ymm1, ymm3			; c5 f5 62 cb
+vpunpckldq ymm1, yword [rax]		; c5 f5 62 08
+vpunpckldq ymm1, ymm2, ymm3		; c5 ed 62 cb
+vpunpckldq ymm1, ymm2, yword [rax]	; c5 ed 62 08
+
+vpunpcklqdq ymm1, ymm3			; c5 f5 6c cb
+vpunpcklqdq ymm1, yword [rax]		; c5 f5 6c 08
+vpunpcklqdq ymm1, ymm2, ymm3		; c5 ed 6c cb
+vpunpcklqdq ymm1, ymm2, yword [rax]	; c5 ed 6c 08
+
+vpxor ymm1, ymm3			; c5 f5 ef cb
+vpxor ymm1, yword [rax]			; c5 f5 ef 08
+vpxor ymm1, ymm2, ymm3			; c5 ed ef cb
+vpxor ymm1, ymm2, yword [rax]		; c5 ed ef 08
+
+vmovntdqa ymm1, yword [rax]		; c4 e2 7d 2a 08
+
+vbroadcastss xmm1, xmm2			; c4 e2 79 18 ca
+vbroadcastss ymm1, xmm2			; c4 e2 7d 18 ca
+
+vbroadcastsd ymm1, xmm2			; c4 e2 7d 19 ca
+
+vbroadcasti128 ymm1, oword [rax]	; c4 e2 7d 5a 08
+
+vpblendd ymm1, ymm2, ymm3, 3		; c4 e3 6d 02 cb 03
+vpblendd ymm1, ymm2, yword [rax], 3	; c4 e3 6d 02 08 03
+
+vpbroadcastb xmm1, xmm2			; c4 e2 79 78 ca
+vpbroadcastb xmm1, byte [rax]		; c4 e2 79 78 08
+vpbroadcastb ymm1, xmm2			; c4 e2 7d 78 ca
+vpbroadcastb ymm1, byte [rax]		; c4 e2 7d 78 08
+
+vpbroadcastw xmm1, xmm2			; c4 e2 79 79 ca
+vpbroadcastw xmm1, word [rax]		; c4 e2 79 79 08
+vpbroadcastw ymm1, xmm2			; c4 e2 7d 79 ca
+vpbroadcastw ymm1, word [rax]		; c4 e2 7d 79 08
+
+vpbroadcastd xmm1, xmm2			; c4 e2 79 58 ca
+vpbroadcastd xmm1, dword [rax]		; c4 e2 79 58 08
+vpbroadcastd ymm1, xmm2			; c4 e2 7d 58 ca
+vpbroadcastd ymm1, dword [rax]		; c4 e2 7d 58 08
+
+vpbroadcastq xmm1, xmm2			; c4 e2 79 59 ca
+vpbroadcastq xmm1, qword [rax]		; c4 e2 79 59 08
+vpbroadcastq ymm1, xmm2			; c4 e2 7d 59 ca
+vpbroadcastq ymm1, qword [rax]		; c4 e2 7d 59 08
+
+vpermd ymm1, ymm2, ymm3			; c4 e2 6d 36 cb
+vpermd ymm1, ymm2, yword [rax]		; c4 e2 6d 36 08
+
+vpermpd ymm1, ymm2, 3			; c4 e3 fd 01 ca 03
+vpermpd ymm1, yword [rax], 3		; c4 e3 fd 01 08 03
+
+vpermps ymm1, ymm2, ymm3		; c4 e2 6d 16 cb
+vpermps ymm1, ymm2, yword [rax]		; c4 e2 6d 16 08
+
+vpermq ymm1, ymm2, 3			; c4 e3 fd 00 ca 03
+vpermq ymm1, yword [rax], 3		; c4 e3 fd 00 08 03
+
+vperm2i128 ymm1, ymm2, ymm3, 3		; c4 e3 6d 46 cb 03
+vperm2i128 ymm1, ymm2, yword [rax], 3	; c4 e3 6d 46 08 03
+
+vextracti128 xmm1, ymm2, 3		; c4 e3 7d 39 d1 03
+vextracti128 oword [rax], ymm2, 3	; c4 e3 7d 39 10 03
+
+vinserti128 ymm1, ymm2, xmm3, 3		; c4 e3 6d 38 cb 03
+vinserti128 ymm1, ymm2, oword [rax], 3	; c4 e3 6d 38 08 03
+
+vpmaskmovd xmm1, xmm2, oword [rax]	; c4 e2 69 8c 08
+vpmaskmovd ymm1, ymm2, yword [rax]	; c4 e2 6d 8c 08
+vpmaskmovd oword [rax], xmm1, xmm2	; c4 e2 71 8e 10
+vpmaskmovd yword [rax], ymm1, ymm2	; c4 e2 75 8e 10
+
+vpmaskmovq xmm1, xmm2, oword [rax]	; c4 e2 e9 8c 08
+vpmaskmovq ymm1, ymm2, yword [rax]	; c4 e2 ed 8c 08
+vpmaskmovq oword [rax], xmm1, xmm2	; c4 e2 f1 8e 10
+vpmaskmovq yword [rax], ymm1, ymm2	; c4 e2 f5 8e 10
+
+vpsllvd xmm1, xmm2, xmm3		; c4 e2 69 47 cb
+vpsllvd xmm1, xmm2, oword [rax]		; c4 e2 69 47 08
+vpsllvd ymm1, ymm2, ymm3		; c4 e2 6d 47 cb
+vpsllvd ymm1, ymm2, yword [rax]		; c4 e2 6d 47 08
+
+vpsllvq xmm1, xmm2, xmm3		; c4 e2 e9 47 cb
+vpsllvq xmm1, xmm2, oword [rax]		; c4 e2 e9 47 08
+vpsllvq ymm1, ymm2, ymm3		; c4 e2 ed 47 cb
+vpsllvq ymm1, ymm2, yword [rax]		; c4 e2 ed 47 08
+
+vpsravd xmm1, xmm2, xmm3		; c4 e2 69 46 cb
+vpsravd xmm1, xmm2, oword [rax]		; c4 e2 69 46 08
+vpsravd ymm1, ymm2, ymm3		; c4 e2 6d 46 cb
+vpsravd ymm1, ymm2, yword [rax]		; c4 e2 6d 46 08
+
+vpsrlvd xmm1, xmm2, xmm3		; c4 e2 69 45 cb
+vpsrlvd xmm1, xmm2, oword [rax]		; c4 e2 69 45 08
+vpsrlvd ymm1, ymm2, ymm3		; c4 e2 6d 45 cb
+vpsrlvd ymm1, ymm2, yword [rax]		; c4 e2 6d 45 08
+
+vpsrlvq xmm1, xmm2, xmm3		; c4 e2 e9 45 cb
+vpsrlvq xmm1, xmm2, oword [rax]		; c4 e2 e9 45 08
+vpsrlvq ymm1, ymm2, ymm3		; c4 e2 ed 45 cb
+vpsrlvq ymm1, ymm2, yword [rax]		; c4 e2 ed 45 08
+
+vgatherdpd xmm1, [rax+xmm1], xmm2	; c4 e2 e9 92 0c 08
+vgatherdpd xmm1, qword [rax+xmm1], xmm2	; c4 e2 e9 92 0c 08
+vgatherdpd ymm1, [rax+xmm1], ymm2	; c4 e2 ed 92 0c 08
+vgatherdpd ymm1, qword [rax+xmm1], ymm2	; c4 e2 ed 92 0c 08
+
+vgatherqpd xmm1, [rax+xmm1], xmm2	; c4 e2 e9 93 0c 08
+vgatherqpd xmm1, qword [rax+xmm1], xmm2	; c4 e2 e9 93 0c 08
+vgatherqpd ymm1, [rax+ymm1], ymm2	; c4 e2 ed 93 0c 08
+vgatherqpd ymm1, qword [rax+ymm1], ymm2	; c4 e2 ed 93 0c 08
+
+vgatherdps xmm1, [rax+xmm1], xmm2	; c4 e2 69 92 0c 08
+vgatherdps xmm1, dword [rax+xmm1], xmm2	; c4 e2 69 92 0c 08
+vgatherdps ymm1, [rax+ymm1], ymm2	; c4 e2 6d 92 0c 08
+vgatherdps ymm1, dword [rax+ymm1], ymm2	; c4 e2 6d 92 0c 08
+
+vgatherqps xmm1, [rax+xmm1], xmm2	; c4 e2 69 93 0c 08
+vgatherqps xmm1, dword [rax+xmm1], xmm2	; c4 e2 69 93 0c 08
+vgatherqps xmm1, [rax+ymm1], xmm2	; c4 e2 6d 93 0c 08
+vgatherqps xmm1, dword [rax+ymm1], xmm2	; c4 e2 6d 93 0c 08
+
+vpgatherdd xmm1, [rax+xmm1], xmm2	; c4 e2 69 90 0c 08
+vpgatherdd xmm1, dword [rax+xmm1], xmm2	; c4 e2 69 90 0c 08
+vpgatherdd ymm1, [rax+ymm1], ymm2	; c4 e2 6d 90 0c 08
+vpgatherdd ymm1, dword [rax+ymm1], ymm2	; c4 e2 6d 90 0c 08
+
+vpgatherqd xmm1, [rax+xmm1], xmm2	; c4 e2 69 91 0c 08
+vpgatherqd xmm1, dword [rax+xmm1], xmm2	; c4 e2 69 91 0c 08
+vpgatherqd xmm1, [rax+ymm1], xmm2	; c4 e2 6d 91 0c 08
+vpgatherqd xmm1, dword [rax+ymm1], xmm2	; c4 e2 6d 91 0c 08
+
+vpgatherdq xmm1, [rax+xmm1], xmm2	; c4 e2 e9 90 0c 08
+vpgatherdq xmm1, qword [rax+xmm1], xmm2	; c4 e2 e9 90 0c 08
+vpgatherdq ymm1, [rax+xmm1], ymm2	; c4 e2 ed 90 0c 08
+vpgatherdq ymm1, qword [rax+xmm1], ymm2	; c4 e2 ed 90 0c 08
+
+vpgatherqq xmm1, [rax+xmm1], xmm2	; c4 e2 e9 91 0c 08
+vpgatherqq xmm1, qword [rax+xmm1], xmm2	; c4 e2 e9 91 0c 08
+vpgatherqq ymm1, [rax+ymm1], ymm2	; c4 e2 ed 91 0c 08
+vpgatherqq ymm1, qword [rax+ymm1], ymm2	; c4 e2 ed 91 0c 08
diff --git a/modules/arch/x86/tests/avx2.hex b/modules/arch/x86/tests/avx2.hex
new file mode 100644
index 0000000..17f84bd
--- /dev/null
+++ b/modules/arch/x86/tests/avx2.hex
@@ -0,0 +1,2297 @@
+c4 
+e3 
+75 
+42 
+cb 
+03 
+c4 
+e3 
+75 
+42 
+08 
+03 
+c4 
+e3 
+6d 
+42 
+cb 
+03 
+c4 
+e3 
+6d 
+42 
+08 
+03 
+c4 
+e2 
+7d 
+1c 
+ca 
+c4 
+e2 
+7d 
+1c 
+08 
+c4 
+e2 
+7d 
+1d 
+ca 
+c4 
+e2 
+7d 
+1d 
+08 
+c4 
+e2 
+7d 
+1e 
+ca 
+c4 
+e2 
+7d 
+1e 
+08 
+c5 
+f5 
+63 
+cb 
+c5 
+f5 
+63 
+08 
+c5 
+ed 
+63 
+cb 
+c5 
+ed 
+63 
+08 
+c5 
+f5 
+6b 
+cb 
+c5 
+f5 
+6b 
+08 
+c5 
+ed 
+6b 
+cb 
+c5 
+ed 
+6b 
+08 
+c4 
+e2 
+75 
+2b 
+cb 
+c4 
+e2 
+75 
+2b 
+08 
+c4 
+e2 
+6d 
+2b 
+cb 
+c4 
+e2 
+6d 
+2b 
+08 
+c5 
+f5 
+67 
+cb 
+c5 
+f5 
+67 
+08 
+c5 
+ed 
+67 
+cb 
+c5 
+ed 
+67 
+08 
+c5 
+f5 
+fc 
+cb 
+c5 
+f5 
+fc 
+08 
+c5 
+ed 
+fc 
+cb 
+c5 
+ed 
+fc 
+08 
+c5 
+f5 
+fd 
+cb 
+c5 
+f5 
+fd 
+08 
+c5 
+ed 
+fd 
+cb 
+c5 
+ed 
+fd 
+08 
+c5 
+f5 
+fe 
+cb 
+c5 
+f5 
+fe 
+08 
+c5 
+ed 
+fe 
+cb 
+c5 
+ed 
+fe 
+08 
+c5 
+f5 
+d4 
+cb 
+c5 
+f5 
+d4 
+08 
+c5 
+ed 
+d4 
+cb 
+c5 
+ed 
+d4 
+08 
+c5 
+f5 
+ec 
+cb 
+c5 
+f5 
+ec 
+08 
+c5 
+ed 
+ec 
+cb 
+c5 
+ed 
+ec 
+08 
+c5 
+f5 
+ed 
+cb 
+c5 
+f5 
+ed 
+08 
+c5 
+ed 
+ed 
+cb 
+c5 
+ed 
+ed 
+08 
+c5 
+f5 
+dc 
+cb 
+c5 
+f5 
+dc 
+08 
+c5 
+ed 
+dc 
+cb 
+c5 
+ed 
+dc 
+08 
+c5 
+f5 
+dd 
+cb 
+c5 
+f5 
+dd 
+08 
+c5 
+ed 
+dd 
+cb 
+c5 
+ed 
+dd 
+08 
+c4 
+e3 
+6d 
+0f 
+cb 
+03 
+c4 
+e3 
+6d 
+0f 
+08 
+03 
+c5 
+f5 
+db 
+cb 
+c5 
+f5 
+db 
+08 
+c5 
+ed 
+db 
+cb 
+c5 
+ed 
+db 
+08 
+c5 
+f5 
+df 
+cb 
+c5 
+f5 
+df 
+08 
+c5 
+ed 
+df 
+cb 
+c5 
+ed 
+df 
+08 
+c5 
+f5 
+e0 
+cb 
+c5 
+f5 
+e0 
+08 
+c5 
+ed 
+e0 
+cb 
+c5 
+ed 
+e0 
+08 
+c5 
+f5 
+e3 
+cb 
+c5 
+f5 
+e3 
+08 
+c5 
+ed 
+e3 
+cb 
+c5 
+ed 
+e3 
+08 
+c4 
+e3 
+6d 
+4c 
+cb 
+40 
+c4 
+e3 
+6d 
+4c 
+08 
+40 
+c4 
+e3 
+75 
+0e 
+cb 
+03 
+c4 
+e3 
+75 
+0e 
+08 
+03 
+c4 
+e3 
+6d 
+0e 
+cb 
+03 
+c4 
+e3 
+6d 
+0e 
+08 
+03 
+c5 
+f5 
+74 
+cb 
+c5 
+f5 
+74 
+08 
+c5 
+ed 
+74 
+cb 
+c5 
+ed 
+74 
+08 
+c5 
+f5 
+75 
+cb 
+c5 
+f5 
+75 
+08 
+c5 
+ed 
+75 
+cb 
+c5 
+ed 
+75 
+08 
+c5 
+f5 
+76 
+cb 
+c5 
+f5 
+76 
+08 
+c5 
+ed 
+76 
+cb 
+c5 
+ed 
+76 
+08 
+c4 
+e2 
+75 
+29 
+cb 
+c4 
+e2 
+75 
+29 
+08 
+c4 
+e2 
+6d 
+29 
+cb 
+c4 
+e2 
+6d 
+29 
+08 
+c5 
+f5 
+64 
+cb 
+c5 
+f5 
+64 
+08 
+c5 
+ed 
+64 
+cb 
+c5 
+ed 
+64 
+08 
+c5 
+f5 
+65 
+cb 
+c5 
+f5 
+65 
+08 
+c5 
+ed 
+65 
+cb 
+c5 
+ed 
+65 
+08 
+c5 
+f5 
+66 
+cb 
+c5 
+f5 
+66 
+08 
+c5 
+ed 
+66 
+cb 
+c5 
+ed 
+66 
+08 
+c4 
+e2 
+75 
+37 
+cb 
+c4 
+e2 
+75 
+37 
+08 
+c4 
+e2 
+6d 
+37 
+cb 
+c4 
+e2 
+6d 
+37 
+08 
+c4 
+e2 
+75 
+01 
+cb 
+c4 
+e2 
+75 
+01 
+08 
+c4 
+e2 
+6d 
+01 
+cb 
+c4 
+e2 
+6d 
+01 
+08 
+c4 
+e2 
+75 
+02 
+cb 
+c4 
+e2 
+75 
+02 
+08 
+c4 
+e2 
+6d 
+02 
+cb 
+c4 
+e2 
+6d 
+02 
+08 
+c4 
+e2 
+75 
+03 
+cb 
+c4 
+e2 
+75 
+03 
+08 
+c4 
+e2 
+6d 
+03 
+cb 
+c4 
+e2 
+6d 
+03 
+08 
+c4 
+e2 
+75 
+05 
+cb 
+c4 
+e2 
+75 
+05 
+08 
+c4 
+e2 
+6d 
+05 
+cb 
+c4 
+e2 
+6d 
+05 
+08 
+c4 
+e2 
+75 
+06 
+cb 
+c4 
+e2 
+75 
+06 
+08 
+c4 
+e2 
+6d 
+06 
+cb 
+c4 
+e2 
+6d 
+06 
+08 
+c4 
+e2 
+75 
+07 
+cb 
+c4 
+e2 
+75 
+07 
+08 
+c4 
+e2 
+6d 
+07 
+cb 
+c4 
+e2 
+6d 
+07 
+08 
+c4 
+e2 
+75 
+04 
+cb 
+c4 
+e2 
+75 
+04 
+08 
+c4 
+e2 
+6d 
+04 
+cb 
+c4 
+e2 
+6d 
+04 
+08 
+c5 
+f5 
+f5 
+cb 
+c5 
+f5 
+f5 
+08 
+c5 
+ed 
+f5 
+cb 
+c5 
+ed 
+f5 
+08 
+c4 
+e2 
+75 
+3c 
+cb 
+c4 
+e2 
+75 
+3c 
+08 
+c4 
+e2 
+6d 
+3c 
+cb 
+c4 
+e2 
+6d 
+3c 
+08 
+c5 
+f5 
+ee 
+cb 
+c5 
+f5 
+ee 
+08 
+c5 
+ed 
+ee 
+cb 
+c5 
+ed 
+ee 
+08 
+c4 
+e2 
+75 
+3d 
+cb 
+c4 
+e2 
+75 
+3d 
+08 
+c4 
+e2 
+6d 
+3d 
+cb 
+c4 
+e2 
+6d 
+3d 
+08 
+c5 
+f5 
+de 
+cb 
+c5 
+f5 
+de 
+08 
+c5 
+ed 
+de 
+cb 
+c5 
+ed 
+de 
+08 
+c4 
+e2 
+75 
+3e 
+cb 
+c4 
+e2 
+75 
+3e 
+08 
+c4 
+e2 
+6d 
+3e 
+cb 
+c4 
+e2 
+6d 
+3e 
+08 
+c4 
+e2 
+75 
+3f 
+cb 
+c4 
+e2 
+75 
+3f 
+08 
+c4 
+e2 
+6d 
+3f 
+cb 
+c4 
+e2 
+6d 
+3f 
+08 
+c4 
+e2 
+75 
+38 
+cb 
+c4 
+e2 
+75 
+38 
+08 
+c4 
+e2 
+6d 
+38 
+cb 
+c4 
+e2 
+6d 
+38 
+08 
+c5 
+f5 
+ea 
+cb 
+c5 
+f5 
+ea 
+08 
+c5 
+ed 
+ea 
+cb 
+c5 
+ed 
+ea 
+08 
+c4 
+e2 
+75 
+39 
+cb 
+c4 
+e2 
+75 
+39 
+08 
+c4 
+e2 
+6d 
+39 
+cb 
+c4 
+e2 
+6d 
+39 
+08 
+c5 
+f5 
+da 
+cb 
+c5 
+f5 
+da 
+08 
+c5 
+ed 
+da 
+cb 
+c5 
+ed 
+da 
+08 
+c4 
+e2 
+75 
+3a 
+cb 
+c4 
+e2 
+75 
+3a 
+08 
+c4 
+e2 
+6d 
+3a 
+cb 
+c4 
+e2 
+6d 
+3a 
+08 
+c4 
+e2 
+75 
+3b 
+cb 
+c4 
+e2 
+75 
+3b 
+08 
+c4 
+e2 
+6d 
+3b 
+cb 
+c4 
+e2 
+6d 
+3b 
+08 
+c5 
+fd 
+d7 
+c1 
+c5 
+fd 
+d7 
+c1 
+c4 
+e2 
+7d 
+20 
+ca 
+c4 
+e2 
+7d 
+20 
+08 
+c4 
+e2 
+7d 
+20 
+08 
+c4 
+e2 
+7d 
+21 
+ca 
+c4 
+e2 
+7d 
+21 
+08 
+c4 
+e2 
+7d 
+21 
+08 
+c4 
+e2 
+7d 
+22 
+ca 
+c4 
+e2 
+7d 
+22 
+08 
+c4 
+e2 
+7d 
+22 
+08 
+c4 
+e2 
+7d 
+23 
+ca 
+c4 
+e2 
+7d 
+23 
+08 
+c4 
+e2 
+7d 
+23 
+08 
+c4 
+e2 
+7d 
+24 
+ca 
+c4 
+e2 
+7d 
+24 
+08 
+c4 
+e2 
+7d 
+24 
+08 
+c4 
+e2 
+7d 
+25 
+ca 
+c4 
+e2 
+7d 
+25 
+08 
+c4 
+e2 
+7d 
+25 
+08 
+c4 
+e2 
+7d 
+30 
+ca 
+c4 
+e2 
+7d 
+30 
+08 
+c4 
+e2 
+7d 
+30 
+08 
+c4 
+e2 
+7d 
+31 
+ca 
+c4 
+e2 
+7d 
+31 
+08 
+c4 
+e2 
+7d 
+31 
+08 
+c4 
+e2 
+7d 
+32 
+ca 
+c4 
+e2 
+7d 
+32 
+08 
+c4 
+e2 
+7d 
+32 
+08 
+c4 
+e2 
+7d 
+33 
+ca 
+c4 
+e2 
+7d 
+33 
+08 
+c4 
+e2 
+7d 
+33 
+08 
+c4 
+e2 
+7d 
+34 
+ca 
+c4 
+e2 
+7d 
+34 
+08 
+c4 
+e2 
+7d 
+34 
+08 
+c4 
+e2 
+7d 
+35 
+ca 
+c4 
+e2 
+7d 
+35 
+08 
+c4 
+e2 
+7d 
+35 
+08 
+c4 
+e2 
+75 
+28 
+cb 
+c4 
+e2 
+75 
+28 
+08 
+c4 
+e2 
+6d 
+28 
+cb 
+c4 
+e2 
+6d 
+28 
+08 
+c4 
+e2 
+75 
+0b 
+cb 
+c4 
+e2 
+75 
+0b 
+08 
+c4 
+e2 
+6d 
+0b 
+cb 
+c4 
+e2 
+6d 
+0b 
+08 
+c5 
+f5 
+e4 
+cb 
+c5 
+f5 
+e4 
+08 
+c5 
+ed 
+e4 
+cb 
+c5 
+ed 
+e4 
+08 
+c5 
+f5 
+e5 
+cb 
+c5 
+f5 
+e5 
+08 
+c5 
+ed 
+e5 
+cb 
+c5 
+ed 
+e5 
+08 
+c5 
+f5 
+d5 
+cb 
+c5 
+f5 
+d5 
+08 
+c5 
+ed 
+d5 
+cb 
+c5 
+ed 
+d5 
+08 
+c4 
+e2 
+75 
+40 
+cb 
+c4 
+e2 
+75 
+40 
+08 
+c4 
+e2 
+6d 
+40 
+cb 
+c4 
+e2 
+6d 
+40 
+08 
+c5 
+f5 
+f4 
+cb 
+c5 
+f5 
+f4 
+08 
+c5 
+ed 
+f4 
+cb 
+c5 
+ed 
+f4 
+08 
+c5 
+f5 
+eb 
+cb 
+c5 
+f5 
+eb 
+08 
+c5 
+ed 
+eb 
+cb 
+c5 
+ed 
+eb 
+08 
+c5 
+f5 
+f6 
+cb 
+c5 
+f5 
+f6 
+08 
+c5 
+ed 
+f6 
+cb 
+c5 
+ed 
+f6 
+08 
+c4 
+e2 
+75 
+00 
+cb 
+c4 
+e2 
+75 
+00 
+08 
+c4 
+e2 
+6d 
+00 
+cb 
+c4 
+e2 
+6d 
+00 
+08 
+c5 
+fd 
+70 
+cb 
+03 
+c5 
+fd 
+70 
+08 
+03 
+c5 
+fe 
+70 
+cb 
+03 
+c5 
+fe 
+70 
+08 
+03 
+c5 
+ff 
+70 
+cb 
+03 
+c5 
+ff 
+70 
+08 
+03 
+c4 
+e2 
+75 
+08 
+cb 
+c4 
+e2 
+75 
+08 
+08 
+c4 
+e2 
+6d 
+08 
+cb 
+c4 
+e2 
+6d 
+08 
+08 
+c4 
+e2 
+75 
+09 
+cb 
+c4 
+e2 
+75 
+09 
+08 
+c4 
+e2 
+6d 
+09 
+cb 
+c4 
+e2 
+6d 
+09 
+08 
+c4 
+e2 
+75 
+0a 
+cb 
+c4 
+e2 
+75 
+0a 
+08 
+c4 
+e2 
+6d 
+0a 
+cb 
+c4 
+e2 
+6d 
+0a 
+08 
+c5 
+f5 
+73 
+f9 
+03 
+c5 
+f5 
+73 
+fa 
+03 
+c5 
+f5 
+f1 
+cb 
+c5 
+f5 
+f1 
+08 
+c5 
+f5 
+71 
+f1 
+03 
+c5 
+ed 
+f1 
+cb 
+c5 
+ed 
+f1 
+08 
+c5 
+f5 
+71 
+f2 
+03 
+c5 
+f5 
+f2 
+cb 
+c5 
+f5 
+f2 
+08 
+c5 
+f5 
+72 
+f1 
+03 
+c5 
+ed 
+f2 
+cb 
+c5 
+ed 
+f2 
+08 
+c5 
+f5 
+72 
+f2 
+03 
+c5 
+f5 
+f3 
+cb 
+c5 
+f5 
+f3 
+08 
+c5 
+f5 
+73 
+f1 
+03 
+c5 
+ed 
+f3 
+cb 
+c5 
+ed 
+f3 
+08 
+c5 
+f5 
+73 
+f2 
+03 
+c5 
+f5 
+e1 
+cb 
+c5 
+f5 
+e1 
+08 
+c5 
+f5 
+71 
+e1 
+03 
+c5 
+ed 
+e1 
+cb 
+c5 
+ed 
+e1 
+08 
+c5 
+f5 
+71 
+e2 
+03 
+c5 
+f5 
+e2 
+cb 
+c5 
+f5 
+e2 
+08 
+c5 
+f5 
+72 
+e1 
+03 
+c5 
+ed 
+e2 
+cb 
+c5 
+ed 
+e2 
+08 
+c5 
+f5 
+72 
+e2 
+03 
+c5 
+f5 
+73 
+d9 
+03 
+c5 
+f5 
+73 
+da 
+03 
+c5 
+f5 
+d1 
+cb 
+c5 
+f5 
+d1 
+08 
+c5 
+f5 
+71 
+d1 
+03 
+c5 
+ed 
+d1 
+cb 
+c5 
+ed 
+d1 
+08 
+c5 
+f5 
+71 
+d2 
+03 
+c5 
+f5 
+d2 
+cb 
+c5 
+f5 
+d2 
+08 
+c5 
+f5 
+72 
+d1 
+03 
+c5 
+ed 
+d2 
+cb 
+c5 
+ed 
+d2 
+08 
+c5 
+f5 
+72 
+d2 
+03 
+c5 
+f5 
+d2 
+cb 
+c5 
+f5 
+d2 
+08 
+c5 
+f5 
+72 
+d1 
+03 
+c5 
+ed 
+d2 
+cb 
+c5 
+ed 
+d2 
+08 
+c5 
+f5 
+72 
+d2 
+03 
+c5 
+f5 
+e8 
+cb 
+c5 
+f5 
+e8 
+08 
+c5 
+ed 
+e8 
+cb 
+c5 
+ed 
+e8 
+08 
+c5 
+f5 
+e9 
+cb 
+c5 
+f5 
+e9 
+08 
+c5 
+ed 
+e9 
+cb 
+c5 
+ed 
+e9 
+08 
+c5 
+f5 
+d8 
+cb 
+c5 
+f5 
+d8 
+08 
+c5 
+ed 
+d8 
+cb 
+c5 
+ed 
+d8 
+08 
+c5 
+f5 
+d9 
+cb 
+c5 
+f5 
+d9 
+08 
+c5 
+ed 
+d9 
+cb 
+c5 
+ed 
+d9 
+08 
+c5 
+f5 
+68 
+cb 
+c5 
+f5 
+68 
+08 
+c5 
+ed 
+68 
+cb 
+c5 
+ed 
+68 
+08 
+c5 
+f5 
+69 
+cb 
+c5 
+f5 
+69 
+08 
+c5 
+ed 
+69 
+cb 
+c5 
+ed 
+69 
+08 
+c5 
+f5 
+6a 
+cb 
+c5 
+f5 
+6a 
+08 
+c5 
+ed 
+6a 
+cb 
+c5 
+ed 
+6a 
+08 
+c5 
+f5 
+6d 
+cb 
+c5 
+f5 
+6d 
+08 
+c5 
+ed 
+6d 
+cb 
+c5 
+ed 
+6d 
+08 
+c5 
+f5 
+60 
+cb 
+c5 
+f5 
+60 
+08 
+c5 
+ed 
+60 
+cb 
+c5 
+ed 
+60 
+08 
+c5 
+f5 
+61 
+cb 
+c5 
+f5 
+61 
+08 
+c5 
+ed 
+61 
+cb 
+c5 
+ed 
+61 
+08 
+c5 
+f5 
+62 
+cb 
+c5 
+f5 
+62 
+08 
+c5 
+ed 
+62 
+cb 
+c5 
+ed 
+62 
+08 
+c5 
+f5 
+6c 
+cb 
+c5 
+f5 
+6c 
+08 
+c5 
+ed 
+6c 
+cb 
+c5 
+ed 
+6c 
+08 
+c5 
+f5 
+ef 
+cb 
+c5 
+f5 
+ef 
+08 
+c5 
+ed 
+ef 
+cb 
+c5 
+ed 
+ef 
+08 
+c4 
+e2 
+7d 
+2a 
+08 
+c4 
+e2 
+79 
+18 
+ca 
+c4 
+e2 
+7d 
+18 
+ca 
+c4 
+e2 
+7d 
+19 
+ca 
+c4 
+e2 
+7d 
+5a 
+08 
+c4 
+e3 
+6d 
+02 
+cb 
+03 
+c4 
+e3 
+6d 
+02 
+08 
+03 
+c4 
+e2 
+79 
+78 
+ca 
+c4 
+e2 
+79 
+78 
+08 
+c4 
+e2 
+7d 
+78 
+ca 
+c4 
+e2 
+7d 
+78 
+08 
+c4 
+e2 
+79 
+79 
+ca 
+c4 
+e2 
+79 
+79 
+08 
+c4 
+e2 
+7d 
+79 
+ca 
+c4 
+e2 
+7d 
+79 
+08 
+c4 
+e2 
+79 
+58 
+ca 
+c4 
+e2 
+79 
+58 
+08 
+c4 
+e2 
+7d 
+58 
+ca 
+c4 
+e2 
+7d 
+58 
+08 
+c4 
+e2 
+79 
+59 
+ca 
+c4 
+e2 
+79 
+59 
+08 
+c4 
+e2 
+7d 
+59 
+ca 
+c4 
+e2 
+7d 
+59 
+08 
+c4 
+e2 
+6d 
+36 
+cb 
+c4 
+e2 
+6d 
+36 
+08 
+c4 
+e3 
+fd 
+01 
+ca 
+03 
+c4 
+e3 
+fd 
+01 
+08 
+03 
+c4 
+e2 
+6d 
+16 
+cb 
+c4 
+e2 
+6d 
+16 
+08 
+c4 
+e3 
+fd 
+00 
+ca 
+03 
+c4 
+e3 
+fd 
+00 
+08 
+03 
+c4 
+e3 
+6d 
+46 
+cb 
+03 
+c4 
+e3 
+6d 
+46 
+08 
+03 
+c4 
+e3 
+7d 
+39 
+d1 
+03 
+c4 
+e3 
+7d 
+39 
+10 
+03 
+c4 
+e3 
+6d 
+38 
+cb 
+03 
+c4 
+e3 
+6d 
+38 
+08 
+03 
+c4 
+e2 
+69 
+8c 
+08 
+c4 
+e2 
+6d 
+8c 
+08 
+c4 
+e2 
+71 
+8e 
+10 
+c4 
+e2 
+75 
+8e 
+10 
+c4 
+e2 
+e9 
+8c 
+08 
+c4 
+e2 
+ed 
+8c 
+08 
+c4 
+e2 
+f1 
+8e 
+10 
+c4 
+e2 
+f5 
+8e 
+10 
+c4 
+e2 
+69 
+47 
+cb 
+c4 
+e2 
+69 
+47 
+08 
+c4 
+e2 
+6d 
+47 
+cb 
+c4 
+e2 
+6d 
+47 
+08 
+c4 
+e2 
+e9 
+47 
+cb 
+c4 
+e2 
+e9 
+47 
+08 
+c4 
+e2 
+ed 
+47 
+cb 
+c4 
+e2 
+ed 
+47 
+08 
+c4 
+e2 
+69 
+46 
+cb 
+c4 
+e2 
+69 
+46 
+08 
+c4 
+e2 
+6d 
+46 
+cb 
+c4 
+e2 
+6d 
+46 
+08 
+c4 
+e2 
+69 
+45 
+cb 
+c4 
+e2 
+69 
+45 
+08 
+c4 
+e2 
+6d 
+45 
+cb 
+c4 
+e2 
+6d 
+45 
+08 
+c4 
+e2 
+e9 
+45 
+cb 
+c4 
+e2 
+e9 
+45 
+08 
+c4 
+e2 
+ed 
+45 
+cb 
+c4 
+e2 
+ed 
+45 
+08 
+c4 
+e2 
+e9 
+92 
+0c 
+08 
+c4 
+e2 
+e9 
+92 
+0c 
+08 
+c4 
+e2 
+ed 
+92 
+0c 
+08 
+c4 
+e2 
+ed 
+92 
+0c 
+08 
+c4 
+e2 
+e9 
+93 
+0c 
+08 
+c4 
+e2 
+e9 
+93 
+0c 
+08 
+c4 
+e2 
+ed 
+93 
+0c 
+08 
+c4 
+e2 
+ed 
+93 
+0c 
+08 
+c4 
+e2 
+69 
+92 
+0c 
+08 
+c4 
+e2 
+69 
+92 
+0c 
+08 
+c4 
+e2 
+6d 
+92 
+0c 
+08 
+c4 
+e2 
+6d 
+92 
+0c 
+08 
+c4 
+e2 
+69 
+93 
+0c 
+08 
+c4 
+e2 
+69 
+93 
+0c 
+08 
+c4 
+e2 
+6d 
+93 
+0c 
+08 
+c4 
+e2 
+6d 
+93 
+0c 
+08 
+c4 
+e2 
+69 
+90 
+0c 
+08 
+c4 
+e2 
+69 
+90 
+0c 
+08 
+c4 
+e2 
+6d 
+90 
+0c 
+08 
+c4 
+e2 
+6d 
+90 
+0c 
+08 
+c4 
+e2 
+69 
+91 
+0c 
+08 
+c4 
+e2 
+69 
+91 
+0c 
+08 
+c4 
+e2 
+6d 
+91 
+0c 
+08 
+c4 
+e2 
+6d 
+91 
+0c 
+08 
+c4 
+e2 
+e9 
+90 
+0c 
+08 
+c4 
+e2 
+e9 
+90 
+0c 
+08 
+c4 
+e2 
+ed 
+90 
+0c 
+08 
+c4 
+e2 
+ed 
+90 
+0c 
+08 
+c4 
+e2 
+e9 
+91 
+0c 
+08 
+c4 
+e2 
+e9 
+91 
+0c 
+08 
+c4 
+e2 
+ed 
+91 
+0c 
+08 
+c4 
+e2 
+ed 
+91 
+0c 
+08 
diff --git a/modules/arch/x86/tests/bmi1.asm b/modules/arch/x86/tests/bmi1.asm
new file mode 100644
index 0000000..4913a4f
--- /dev/null
+++ b/modules/arch/x86/tests/bmi1.asm
@@ -0,0 +1,32 @@
+[bits 64]
+andn eax, ebx, ecx	; c4 e2 60 f2 c1
+andn eax, ebx, [0]	; c4 e2 60 f2 04 25 00 00 00 00
+andn rax, rbx, rcx	; c4 e2 e0 f2 c1
+andn rax, rbx, [0]	; c4 e2 e0 f2 04 25 00 00 00 00
+
+bextr eax, ebx, ecx	; c4 e2 70 f7 c3
+bextr eax, [0], ecx	; c4 e2 70 f7 04 25 00 00 00 00
+bextr rax, rbx, rcx	; c4 e2 f0 f7 c3
+bextr rax, [0], rcx	; c4 e2 f0 f7 04 25 00 00 00 00
+
+blsi eax, ecx		; c4 e2 78 f3 d9
+blsi eax, [0]		; c4 e2 78 f3 1c 25 00 00 00 00
+blsi rax, rcx		; c4 e2 f8 f3 d9
+blsi rax, [0]		; c4 e2 f8 f3 1c 25 00 00 00 00
+
+blsmsk eax, ecx		; c4 e2 78 f3 d1
+blsmsk eax, [0]		; c4 e2 78 f3 14 25 00 00 00 00
+blsmsk rax, rcx		; c4 e2 f8 f3 d1
+blsmsk rax, [0]		; c4 e2 f8 f3 14 25 00 00 00 00
+
+blsr eax, ecx		; c4 e2 78 f3 c9
+blsr eax, [0]		; c4 e2 78 f3 0c 25 00 00 00 00
+blsr rax, rcx		; c4 e2 f8 f3 c9
+blsr rax, [0]		; c4 e2 f8 f3 0c 25 00 00 00 00
+
+tzcnt ax, bx		; 66 f3 0f bc c3
+tzcnt ax, [0]		; 66 f3 0f bc 04 25 00 00 00 00
+tzcnt eax, ebx		; f3 0f bc c3
+tzcnt eax, [0]		; f3 0f bc 04 25 00 00 00 00
+tzcnt rax, rbx		; f3 48 0f bc c3
+tzcnt rax, [0]		; f3 48 0f bc 04 25 00 00 00 00
diff --git a/modules/arch/x86/tests/bmi1.hex b/modules/arch/x86/tests/bmi1.hex
new file mode 100644
index 0000000..fc692cd
--- /dev/null
+++ b/modules/arch/x86/tests/bmi1.hex
@@ -0,0 +1,193 @@
+c4 
+e2 
+60 
+f2 
+c1 
+c4 
+e2 
+60 
+f2 
+04 
+25 
+00 
+00 
+00 
+00 
+c4 
+e2 
+e0 
+f2 
+c1 
+c4 
+e2 
+e0 
+f2 
+04 
+25 
+00 
+00 
+00 
+00 
+c4 
+e2 
+70 
+f7 
+c3 
+c4 
+e2 
+70 
+f7 
+04 
+25 
+00 
+00 
+00 
+00 
+c4 
+e2 
+f0 
+f7 
+c3 
+c4 
+e2 
+f0 
+f7 
+04 
+25 
+00 
+00 
+00 
+00 
+c4 
+e2 
+78 
+f3 
+d9 
+c4 
+e2 
+78 
+f3 
+1c 
+25 
+00 
+00 
+00 
+00 
+c4 
+e2 
+f8 
+f3 
+d9 
+c4 
+e2 
+f8 
+f3 
+1c 
+25 
+00 
+00 
+00 
+00 
+c4 
+e2 
+78 
+f3 
+d1 
+c4 
+e2 
+78 
+f3 
+14 
+25 
+00 
+00 
+00 
+00 
+c4 
+e2 
+f8 
+f3 
+d1 
+c4 
+e2 
+f8 
+f3 
+14 
+25 
+00 
+00 
+00 
+00 
+c4 
+e2 
+78 
+f3 
+c9 
+c4 
+e2 
+78 
+f3 
+0c 
+25 
+00 
+00 
+00 
+00 
+c4 
+e2 
+f8 
+f3 
+c9 
+c4 
+e2 
+f8 
+f3 
+0c 
+25 
+00 
+00 
+00 
+00 
+66 
+f3 
+0f 
+bc 
+c3 
+66 
+f3 
+0f 
+bc 
+04 
+25 
+00 
+00 
+00 
+00 
+f3 
+0f 
+bc 
+c3 
+f3 
+0f 
+bc 
+04 
+25 
+00 
+00 
+00 
+00 
+f3 
+48 
+0f 
+bc 
+c3 
+f3 
+48 
+0f 
+bc 
+04 
+25 
+00 
+00 
+00 
+00 
diff --git a/modules/arch/x86/tests/bmi2.asm b/modules/arch/x86/tests/bmi2.asm
new file mode 100644
index 0000000..d19d7f3
--- /dev/null
+++ b/modules/arch/x86/tests/bmi2.asm
@@ -0,0 +1,40 @@
+[bits 64]
+bzhi eax, ebx, ecx	; c4 e2 70 f5 c3
+bzhi eax, [0], ecx	; c4 e2 70 f5 04 25 00 00 00 00
+bzhi rax, rbx, rcx	; c4 e2 f0 f5 c3
+bzhi rax, [0], rcx	; c4 e2 f0 f5 04 25 00 00 00 00
+
+mulx eax, ebx, ecx	; c4 e2 63 f6 c1
+mulx eax, ebx, [0]	; c4 e2 63 f6 04 25 00 00 00 00
+mulx rax, rbx, rcx	; c4 e2 e3 f6 c1
+mulx rax, rbx, [0]	; c4 e2 e3 f6 04 25 00 00 00 00
+
+pdep eax, ebx, ecx	; c4 e2 63 f5 c1
+pdep eax, ebx, [0]	; c4 e2 63 f5 04 25 00 00 00 00
+pdep rax, rbx, rcx	; c4 e2 e3 f5 c1
+pdep rax, rbx, [0]	; c4 e2 e3 f5 04 25 00 00 00 00
+
+pext eax, ebx, ecx	; c4 e2 62 f5 c1
+pext eax, ebx, [0]	; c4 e2 62 f5 04 25 00 00 00 00
+pext rax, rbx, rcx	; c4 e2 e2 f5 c1
+pext rax, rbx, [0]	; c4 e2 e2 f5 04 25 00 00 00 00
+
+rorx eax, ebx, 3	; c4 e3 7b f0 c3 03
+rorx eax, [0], 3	; c4 e3 7b f0 04 25 00 00 00 00 03
+rorx rax, rbx, 3	; c4 e3 fb f0 c3 03
+rorx rax, [0], 3	; c4 e3 fb f0 04 25 00 00 00 00 03
+
+sarx eax, ebx, ecx	; c4 e2 72 f7 c3
+sarx eax, [0], ecx	; c4 e2 72 f7 04 25 00 00 00 00
+sarx rax, rbx, rcx	; c4 e2 f2 f7 c3
+sarx rax, [0], rcx	; c4 e2 f2 f7 04 25 00 00 00 00
+
+shlx eax, ebx, ecx	; c4 e2 71 f7 c3
+shlx eax, [0], ecx	; c4 e2 71 f7 04 25 00 00 00 00
+shlx rax, rbx, rcx	; c4 e2 f1 f7 c3
+shlx rax, [0], rcx	; c4 e2 f1 f7 04 25 00 00 00 00
+
+shrx eax, ebx, ecx	; c4 e2 73 f7 c3
+shrx eax, [0], ecx	; c4 e2 73 f7 04 25 00 00 00 00
+shrx rax, rbx, rcx	; c4 e2 f3 f7 c3
+shrx rax, [0], rcx	; c4 e2 f3 f7 04 25 00 00 00 00
diff --git a/modules/arch/x86/tests/bmi2.hex b/modules/arch/x86/tests/bmi2.hex
new file mode 100644
index 0000000..c152972
--- /dev/null
+++ b/modules/arch/x86/tests/bmi2.hex
@@ -0,0 +1,244 @@
+c4 
+e2 
+70 
+f5 
+c3 
+c4 
+e2 
+70 
+f5 
+04 
+25 
+00 
+00 
+00 
+00 
+c4 
+e2 
+f0 
+f5 
+c3 
+c4 
+e2 
+f0 
+f5 
+04 
+25 
+00 
+00 
+00 
+00 
+c4 
+e2 
+63 
+f6 
+c1 
+c4 
+e2 
+63 
+f6 
+04 
+25 
+00 
+00 
+00 
+00 
+c4 
+e2 
+e3 
+f6 
+c1 
+c4 
+e2 
+e3 
+f6 
+04 
+25 
+00 
+00 
+00 
+00 
+c4 
+e2 
+63 
+f5 
+c1 
+c4 
+e2 
+63 
+f5 
+04 
+25 
+00 
+00 
+00 
+00 
+c4 
+e2 
+e3 
+f5 
+c1 
+c4 
+e2 
+e3 
+f5 
+04 
+25 
+00 
+00 
+00 
+00 
+c4 
+e2 
+62 
+f5 
+c1 
+c4 
+e2 
+62 
+f5 
+04 
+25 
+00 
+00 
+00 
+00 
+c4 
+e2 
+e2 
+f5 
+c1 
+c4 
+e2 
+e2 
+f5 
+04 
+25 
+00 
+00 
+00 
+00 
+c4 
+e3 
+7b 
+f0 
+c3 
+03 
+c4 
+e3 
+7b 
+f0 
+04 
+25 
+00 
+00 
+00 
+00 
+03 
+c4 
+e3 
+fb 
+f0 
+c3 
+03 
+c4 
+e3 
+fb 
+f0 
+04 
+25 
+00 
+00 
+00 
+00 
+03 
+c4 
+e2 
+72 
+f7 
+c3 
+c4 
+e2 
+72 
+f7 
+04 
+25 
+00 
+00 
+00 
+00 
+c4 
+e2 
+f2 
+f7 
+c3 
+c4 
+e2 
+f2 
+f7 
+04 
+25 
+00 
+00 
+00 
+00 
+c4 
+e2 
+71 
+f7 
+c3 
+c4 
+e2 
+71 
+f7 
+04 
+25 
+00 
+00 
+00 
+00 
+c4 
+e2 
+f1 
+f7 
+c3 
+c4 
+e2 
+f1 
+f7 
+04 
+25 
+00 
+00 
+00 
+00 
+c4 
+e2 
+73 
+f7 
+c3 
+c4 
+e2 
+73 
+f7 
+04 
+25 
+00 
+00 
+00 
+00 
+c4 
+e2 
+f3 
+f7 
+c3 
+c4 
+e2 
+f3 
+f7 
+04 
+25 
+00 
+00 
+00 
+00 
diff --git a/modules/arch/x86/tests/eptvpid.asm b/modules/arch/x86/tests/eptvpid.asm
new file mode 100644
index 0000000..8c4881f
--- /dev/null
+++ b/modules/arch/x86/tests/eptvpid.asm
@@ -0,0 +1,8 @@
+[bits 32]
+invept eax, [eax]
+invvpid eax, [eax]
+
+[bits 64]
+invept rax, [rax]
+invvpid rax, [rax]
+
diff --git a/modules/arch/x86/tests/eptvpid.hex b/modules/arch/x86/tests/eptvpid.hex
new file mode 100644
index 0000000..1e2c242
--- /dev/null
+++ b/modules/arch/x86/tests/eptvpid.hex
@@ -0,0 +1,22 @@
+66 
+0f 
+38 
+80 
+00 
+66 
+0f 
+38 
+81 
+00 
+66 
+48 
+0f 
+38 
+80 
+00 
+66 
+48 
+0f 
+38 
+81 
+00 
diff --git a/modules/arch/x86/tests/f16c.asm b/modules/arch/x86/tests/f16c.asm
new file mode 100644
index 0000000..06fa5f1
--- /dev/null
+++ b/modules/arch/x86/tests/f16c.asm
@@ -0,0 +1,10 @@
+[bits 64]
+vcvtph2ps ymm1, xmm2
+vcvtph2ps ymm1, oword [0]
+vcvtph2ps xmm1, xmm2
+vcvtph2ps xmm1, qword [0]
+
+vcvtps2ph xmm1, ymm2, 4
+vcvtps2ph oword [0], ymm2, 8
+vcvtps2ph xmm1, xmm2, 3
+vcvtps2ph qword [0], xmm2, 5
diff --git a/modules/arch/x86/tests/f16c.hex b/modules/arch/x86/tests/f16c.hex
new file mode 100644
index 0000000..8ba06fc
--- /dev/null
+++ b/modules/arch/x86/tests/f16c.hex
@@ -0,0 +1,64 @@
+c4 
+e2 
+7d 
+13 
+ca 
+c4 
+e2 
+7d 
+13 
+0c 
+25 
+00 
+00 
+00 
+00 
+c4 
+e2 
+79 
+13 
+ca 
+c4 
+e2 
+79 
+13 
+0c 
+25 
+00 
+00 
+00 
+00 
+c4 
+e3 
+7d 
+1d 
+d1 
+04 
+c4 
+e3 
+7d 
+1d 
+14 
+25 
+00 
+00 
+00 
+00 
+08 
+c4 
+e3 
+79 
+1d 
+d1 
+03 
+c4 
+e3 
+79 
+1d 
+14 
+25 
+00 
+00 
+00 
+00 
+05 
diff --git a/modules/arch/x86/tests/fsgsbase.asm b/modules/arch/x86/tests/fsgsbase.asm
new file mode 100644
index 0000000..bae7301
--- /dev/null
+++ b/modules/arch/x86/tests/fsgsbase.asm
@@ -0,0 +1,10 @@
+[bits 64]
+rdfsbase ebx
+rdfsbase rbx
+rdgsbase ecx
+rdgsbase rcx
+
+wrfsbase ebx
+wrfsbase rbx
+wrgsbase ecx
+wrgsbase rcx
diff --git a/modules/arch/x86/tests/fsgsbase.hex b/modules/arch/x86/tests/fsgsbase.hex
new file mode 100644
index 0000000..27b5eee
--- /dev/null
+++ b/modules/arch/x86/tests/fsgsbase.hex
@@ -0,0 +1,36 @@
+f3 
+0f 
+ae 
+c3 
+f3 
+48 
+0f 
+ae 
+c3 
+f3 
+0f 
+ae 
+c9 
+f3 
+48 
+0f 
+ae 
+c9 
+f3 
+0f 
+ae 
+d3 
+f3 
+48 
+0f 
+ae 
+d3 
+f3 
+0f 
+ae 
+d9 
+f3 
+48 
+0f 
+ae 
+d9 
diff --git a/modules/arch/x86/tests/gas32/gas-farjump.asm b/modules/arch/x86/tests/gas32/gas-farjump.asm
new file mode 100644
index 0000000..6d890da
--- /dev/null
+++ b/modules/arch/x86/tests/gas32/gas-farjump.asm
@@ -0,0 +1,13 @@
+call $0x1234, $0x567890ab
+lcall $0x1234, $0x567890ab
+jmp $0x1234, $0x567890ab
+ljmp $0x1234, $0x567890ab
+ljmp *(%eax)
+lcall *(%eax)
+jmp *(%eax)
+call *(%eax)
+jmp *%eax
+call *%eax
+ret
+lret
+lret $0x100
diff --git a/modules/arch/x86/tests/gas32/gas-farjump.hex b/modules/arch/x86/tests/gas32/gas-farjump.hex
new file mode 100644
index 0000000..839492d
--- /dev/null
+++ b/modules/arch/x86/tests/gas32/gas-farjump.hex
@@ -0,0 +1,408 @@
+7f 
+45 
+4c 
+46 
+01 
+01 
+01 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+01 
+00 
+03 
+00 
+01 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+d0 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+34 
+00 
+00 
+00 
+00 
+00 
+28 
+00 
+05 
+00 
+01 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+9a 
+ab 
+90 
+78 
+56 
+34 
+12 
+9a 
+ab 
+90 
+78 
+56 
+34 
+12 
+ea 
+ab 
+90 
+78 
+56 
+34 
+12 
+ea 
+ab 
+90 
+78 
+56 
+34 
+12 
+ff 
+28 
+ff 
+18 
+ff 
+20 
+ff 
+10 
+ff 
+e0 
+ff 
+d0 
+c3 
+cb 
+ca 
+00 
+01 
+00 
+00 
+00 
+00 
+2e 
+74 
+65 
+78 
+74 
+00 
+2e 
+73 
+74 
+72 
+74 
+61 
+62 
+00 
+2e 
+73 
+79 
+6d 
+74 
+61 
+62 
+00 
+2e 
+73 
+68 
+73 
+74 
+72 
+74 
+61 
+62 
+00 
+00 
+00 
+00 
+00 
+2d 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+01 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+04 
+00 
+f1 
+ff 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+03 
+00 
+04 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+17 
+00 
+00 
+00 
+03 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+70 
+00 
+00 
+00 
+21 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+07 
+00 
+00 
+00 
+03 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+94 
+00 
+00 
+00 
+03 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+0f 
+00 
+00 
+00 
+02 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+98 
+00 
+00 
+00 
+30 
+00 
+00 
+00 
+02 
+00 
+00 
+00 
+03 
+00 
+00 
+00 
+04 
+00 
+00 
+00 
+10 
+00 
+00 
+00 
+01 
+00 
+00 
+00 
+01 
+00 
+00 
+00 
+06 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+40 
+00 
+00 
+00 
+2d 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+10 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
diff --git a/modules/arch/x86/tests/gas32/gas-invlpg.asm b/modules/arch/x86/tests/gas32/gas-invlpg.asm
new file mode 100644
index 0000000..f7d6faa
--- /dev/null
+++ b/modules/arch/x86/tests/gas32/gas-invlpg.asm
@@ -0,0 +1,2 @@
+invlpg (%eax)
+
diff --git a/modules/arch/x86/tests/gas32/gas-invlpg.hex b/modules/arch/x86/tests/gas32/gas-invlpg.hex
new file mode 100644
index 0000000..c40e050
--- /dev/null
+++ b/modules/arch/x86/tests/gas32/gas-invlpg.hex
@@ -0,0 +1,360 @@
+7f 
+45 
+4c 
+46 
+01 
+01 
+01 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+01 
+00 
+03 
+00 
+01 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+a0 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+34 
+00 
+00 
+00 
+00 
+00 
+28 
+00 
+05 
+00 
+01 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+0f 
+01 
+38 
+00 
+00 
+2e 
+74 
+65 
+78 
+74 
+00 
+2e 
+73 
+74 
+72 
+74 
+61 
+62 
+00 
+2e 
+73 
+79 
+6d 
+74 
+61 
+62 
+00 
+2e 
+73 
+68 
+73 
+74 
+72 
+74 
+61 
+62 
+00 
+00 
+00 
+00 
+00 
+2d 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+01 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+04 
+00 
+f1 
+ff 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+03 
+00 
+04 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+17 
+00 
+00 
+00 
+03 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+44 
+00 
+00 
+00 
+21 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+07 
+00 
+00 
+00 
+03 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+68 
+00 
+00 
+00 
+03 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+0f 
+00 
+00 
+00 
+02 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+6c 
+00 
+00 
+00 
+30 
+00 
+00 
+00 
+02 
+00 
+00 
+00 
+03 
+00 
+00 
+00 
+04 
+00 
+00 
+00 
+10 
+00 
+00 
+00 
+01 
+00 
+00 
+00 
+01 
+00 
+00 
+00 
+06 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+40 
+00 
+00 
+00 
+03 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+10 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
diff --git a/modules/arch/x86/tests/gas32/gas-loop32.asm b/modules/arch/x86/tests/gas32/gas-loop32.asm
new file mode 100644
index 0000000..3b5777d
--- /dev/null
+++ b/modules/arch/x86/tests/gas32/gas-loop32.asm
@@ -0,0 +1,5 @@
+loop label
+loopw label
+loopl label
+#loopq label
+label:
diff --git a/modules/arch/x86/tests/gas32/gas-loop32.hex b/modules/arch/x86/tests/gas32/gas-loop32.hex
new file mode 100644
index 0000000..5bf161b
--- /dev/null
+++ b/modules/arch/x86/tests/gas32/gas-loop32.hex
@@ -0,0 +1,376 @@
+7f 
+45 
+4c 
+46 
+01 
+01 
+01 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+01 
+00 
+03 
+00 
+01 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+b0 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+34 
+00 
+00 
+00 
+00 
+00 
+28 
+00 
+05 
+00 
+01 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+e2 
+05 
+67 
+e2 
+02 
+e2 
+00 
+00 
+00 
+2e 
+74 
+65 
+78 
+74 
+00 
+2e 
+73 
+74 
+72 
+74 
+61 
+62 
+00 
+2e 
+73 
+79 
+6d 
+74 
+61 
+62 
+00 
+2e 
+73 
+68 
+73 
+74 
+72 
+74 
+61 
+62 
+00 
+00 
+00 
+00 
+00 
+2d 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+01 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+04 
+00 
+f1 
+ff 
+00 
+00 
+00 
+00 
+07 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+04 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+03 
+00 
+04 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+17 
+00 
+00 
+00 
+03 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+48 
+00 
+00 
+00 
+21 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+07 
+00 
+00 
+00 
+03 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+6c 
+00 
+00 
+00 
+03 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+0f 
+00 
+00 
+00 
+02 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+70 
+00 
+00 
+00 
+40 
+00 
+00 
+00 
+02 
+00 
+00 
+00 
+04 
+00 
+00 
+00 
+04 
+00 
+00 
+00 
+10 
+00 
+00 
+00 
+01 
+00 
+00 
+00 
+01 
+00 
+00 
+00 
+06 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+40 
+00 
+00 
+00 
+07 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+10 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
diff --git a/modules/arch/x86/tests/gas32/gas-pop.asm b/modules/arch/x86/tests/gas32/gas-pop.asm
new file mode 100644
index 0000000..7c47ebe
--- /dev/null
+++ b/modules/arch/x86/tests/gas32/gas-pop.asm
@@ -0,0 +1,50 @@
+.code64
+push %cx		# out: 66 51
+pop %cx			# out: 66 59
+push %rcx		# out: 51
+pop %rcx		# out: 59
+pushw %cx		# out: 66 51
+popw %cx		# out: 66 59
+pushq %rcx		# out: 51
+popq %rcx		# out: 59
+
+push -24(%rcx)		# out: ff 71 e8
+pop -24(%rcx)		# out: 8f 41 e8
+pushw -24(%rcx)		# out: 66 ff 71 e8
+popw -24(%rcx)		# out: 66 8f 41 e8
+pushq -24(%rcx)		# out: ff 71 e8
+popq -24(%rcx)		# out: 8f 41 e8
+
+.code32
+push %cx		# out: 66 51
+pop %cx			# out: 66 59
+push %ecx		# out: 51
+pop %ecx		# out: 59
+pushw %cx		# out: 66 51
+popw %cx		# out: 66 59
+pushl %ecx		# out: 51
+popl %ecx		# out: 59
+
+push -24(%ecx)		# out: ff 71 e8
+pop -24(%ecx)		# out: 8f 41 e8
+pushw -24(%ecx)		# out: 66 ff 71 e8
+popw -24(%ecx)		# out: 66 8f 41 e8
+pushl -24(%ecx)		# out: ff 71 e8
+popl -24(%ecx)		# out: 8f 41 e8
+
+.code16
+push %cx		# out: 51
+pop %cx			# out: 59
+push %ecx		# out: 66 51
+pop %ecx		# out: 66 59
+pushw %cx		# out: 51
+popw %cx		# out: 59
+pushl %ecx		# out: 66 51
+popl %ecx		# out: 66 59
+
+push -24(%bp)		# out: ff 76 e8
+pop -24(%bp)		# out: 8f 46 e8
+pushw -24(%bp)		# out: ff 76 e8
+popw -24(%bp)		# out: 8f 46 e8
+pushl -24(%bp)		# out: 66 ff 76 e8
+popl -24(%bp)		# out: 66 8f 46 e8
diff --git a/modules/arch/x86/tests/gas32/gas-pop.hex b/modules/arch/x86/tests/gas32/gas-pop.hex
new file mode 100644
index 0000000..3074437
--- /dev/null
+++ b/modules/arch/x86/tests/gas32/gas-pop.hex
@@ -0,0 +1,456 @@
+7f 
+45 
+4c 
+46 
+01 
+01 
+01 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+01 
+00 
+03 
+00 
+01 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+01 
+00 
+00 
+00 
+00 
+00 
+00 
+34 
+00 
+00 
+00 
+00 
+00 
+28 
+00 
+05 
+00 
+01 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+66 
+51 
+66 
+59 
+51 
+59 
+66 
+51 
+66 
+59 
+51 
+59 
+ff 
+71 
+e8 
+8f 
+41 
+e8 
+66 
+ff 
+71 
+e8 
+66 
+8f 
+41 
+e8 
+ff 
+71 
+e8 
+8f 
+41 
+e8 
+66 
+51 
+66 
+59 
+51 
+59 
+66 
+51 
+66 
+59 
+51 
+59 
+ff 
+71 
+e8 
+8f 
+41 
+e8 
+66 
+ff 
+71 
+e8 
+66 
+8f 
+41 
+e8 
+ff 
+71 
+e8 
+8f 
+41 
+e8 
+51 
+59 
+66 
+51 
+66 
+59 
+51 
+59 
+66 
+51 
+66 
+59 
+ff 
+76 
+e8 
+8f 
+46 
+e8 
+ff 
+76 
+e8 
+8f 
+46 
+e8 
+66 
+ff 
+76 
+e8 
+66 
+8f 
+46 
+e8 
+00 
+2e 
+74 
+65 
+78 
+74 
+00 
+2e 
+73 
+74 
+72 
+74 
+61 
+62 
+00 
+2e 
+73 
+79 
+6d 
+74 
+61 
+62 
+00 
+2e 
+73 
+68 
+73 
+74 
+72 
+74 
+61 
+62 
+00 
+00 
+00 
+00 
+00 
+2d 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+01 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+04 
+00 
+f1 
+ff 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+03 
+00 
+04 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+17 
+00 
+00 
+00 
+03 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+a0 
+00 
+00 
+00 
+21 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+07 
+00 
+00 
+00 
+03 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+c4 
+00 
+00 
+00 
+03 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+0f 
+00 
+00 
+00 
+02 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+c8 
+00 
+00 
+00 
+30 
+00 
+00 
+00 
+02 
+00 
+00 
+00 
+03 
+00 
+00 
+00 
+04 
+00 
+00 
+00 
+10 
+00 
+00 
+00 
+01 
+00 
+00 
+00 
+01 
+00 
+00 
+00 
+06 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+40 
+00 
+00 
+00 
+60 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+10 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
diff --git a/modules/arch/x86/tests/gas64/gas-loop64.asm b/modules/arch/x86/tests/gas64/gas-loop64.asm
new file mode 100644
index 0000000..d441ad6
--- /dev/null
+++ b/modules/arch/x86/tests/gas64/gas-loop64.asm
@@ -0,0 +1,5 @@
+loop label
+#loopw label
+loopl label
+loopq label
+label:
diff --git a/modules/arch/x86/tests/gas64/gas-loop64.hex b/modules/arch/x86/tests/gas64/gas-loop64.hex
new file mode 100644
index 0000000..7c1e924
--- /dev/null
+++ b/modules/arch/x86/tests/gas64/gas-loop64.hex
@@ -0,0 +1,528 @@
+7f 
+45 
+4c 
+46 
+02 
+01 
+01 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+01 
+00 
+3e 
+00 
+01 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+d0 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+40 
+00 
+00 
+00 
+00 
+00 
+40 
+00 
+05 
+00 
+01 
+00 
+e2 
+05 
+67 
+e2 
+02 
+e2 
+00 
+00 
+00 
+2e 
+74 
+65 
+78 
+74 
+00 
+2e 
+73 
+74 
+72 
+74 
+61 
+62 
+00 
+2e 
+73 
+79 
+6d 
+74 
+61 
+62 
+00 
+2e 
+73 
+68 
+73 
+74 
+72 
+74 
+61 
+62 
+00 
+00 
+00 
+00 
+00 
+2d 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+01 
+00 
+00 
+00 
+04 
+00 
+f1 
+ff 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+04 
+00 
+07 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+03 
+00 
+04 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+17 
+00 
+00 
+00 
+03 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+48 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+21 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+07 
+00 
+00 
+00 
+03 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+6c 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+03 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+0f 
+00 
+00 
+00 
+02 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+70 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+60 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+02 
+00 
+00 
+00 
+04 
+00 
+00 
+00 
+08 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+18 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+01 
+00 
+00 
+00 
+01 
+00 
+00 
+00 
+06 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+40 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+07 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+10 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
diff --git a/modules/arch/x86/tests/invpcid.asm b/modules/arch/x86/tests/invpcid.asm
new file mode 100644
index 0000000..90f517a
--- /dev/null
+++ b/modules/arch/x86/tests/invpcid.asm
@@ -0,0 +1,6 @@
+[bits 32]
+invpcid eax, oword [0]		; 66 0f 38 82 05 00 00 00 00
+
+[bits 64]
+invpcid rax, oword [0]		; 66 0f 38 82 04 25 00 00 00 00
+
diff --git a/modules/arch/x86/tests/invpcid.hex b/modules/arch/x86/tests/invpcid.hex
new file mode 100644
index 0000000..cfc8726
--- /dev/null
+++ b/modules/arch/x86/tests/invpcid.hex
@@ -0,0 +1,19 @@
+66 
+0f 
+38 
+82 
+05 
+00 
+00 
+00 
+00 
+66 
+0f 
+38 
+82 
+04 
+25 
+00 
+00 
+00 
+00 
diff --git a/modules/arch/x86/tests/larlsl.asm b/modules/arch/x86/tests/larlsl.asm
new file mode 100644
index 0000000..51c3fec
--- /dev/null
+++ b/modules/arch/x86/tests/larlsl.asm
@@ -0,0 +1,59 @@
+[bits 16]
+lar ax, bx
+lar ax, [bx]
+lar ax, word [bx]
+lar eax, bx
+lar eax, ebx
+lar eax, [bx]
+lar eax, word [bx]
+
+lsl ax, bx
+lsl ax, [bx]
+lsl ax, word [bx]
+lsl eax, bx
+lsl eax, ebx
+lsl eax, [bx]
+lsl eax, word [bx]
+
+[bits 32]
+lar ax, bx
+lar ax, [ebx]
+lar ax, word [ebx]
+lar eax, bx
+lar eax, ebx
+lar eax, [ebx]
+lar eax, word [ebx]
+
+lsl ax, bx
+lsl ax, [ebx]
+lsl ax, word [ebx]
+lsl eax, bx
+lsl eax, ebx
+lsl eax, [ebx]
+lsl eax, word [ebx]
+
+[bits 64]
+lar ax, bx
+lar ax, [rbx]
+lar ax, word [rbx]
+lar eax, bx
+lar eax, ebx
+lar eax, [rbx]
+lar eax, word [rbx]
+lar rax, bx
+lar rax, ebx
+lar rax, [rbx]
+lar rax, word [rbx]
+
+lsl ax, bx
+lsl ax, [rbx]
+lsl ax, word [rbx]
+lsl eax, bx
+lsl eax, ebx
+lsl eax, [rbx]
+lsl eax, word [rbx]
+lsl rax, bx
+lsl rax, ebx
+lsl rax, [rbx]
+lsl rax, word [rbx]
+
diff --git a/modules/arch/x86/tests/larlsl.hex b/modules/arch/x86/tests/larlsl.hex
new file mode 100644
index 0000000..38c8b97
--- /dev/null
+++ b/modules/arch/x86/tests/larlsl.hex
@@ -0,0 +1,178 @@
+0f 
+02 
+c3 
+0f 
+02 
+07 
+0f 
+02 
+07 
+66 
+0f 
+02 
+c3 
+66 
+0f 
+02 
+c3 
+66 
+0f 
+02 
+07 
+66 
+0f 
+02 
+07 
+0f 
+03 
+c3 
+0f 
+03 
+07 
+0f 
+03 
+07 
+66 
+0f 
+03 
+c3 
+66 
+0f 
+03 
+c3 
+66 
+0f 
+03 
+07 
+66 
+0f 
+03 
+07 
+66 
+0f 
+02 
+c3 
+66 
+0f 
+02 
+03 
+66 
+0f 
+02 
+03 
+0f 
+02 
+c3 
+0f 
+02 
+c3 
+0f 
+02 
+03 
+0f 
+02 
+03 
+66 
+0f 
+03 
+c3 
+66 
+0f 
+03 
+03 
+66 
+0f 
+03 
+03 
+0f 
+03 
+c3 
+0f 
+03 
+c3 
+0f 
+03 
+03 
+0f 
+03 
+03 
+66 
+0f 
+02 
+c3 
+66 
+0f 
+02 
+03 
+66 
+0f 
+02 
+03 
+0f 
+02 
+c3 
+0f 
+02 
+c3 
+0f 
+02 
+03 
+0f 
+02 
+03 
+48 
+0f 
+02 
+c3 
+48 
+0f 
+02 
+c3 
+48 
+0f 
+02 
+03 
+48 
+0f 
+02 
+03 
+66 
+0f 
+03 
+c3 
+66 
+0f 
+03 
+03 
+66 
+0f 
+03 
+03 
+0f 
+03 
+c3 
+0f 
+03 
+c3 
+0f 
+03 
+03 
+0f 
+03 
+03 
+48 
+0f 
+03 
+c3 
+48 
+0f 
+03 
+c3 
+48 
+0f 
+03 
+03 
+48 
+0f 
+03 
+03 
diff --git a/modules/arch/x86/tests/lfs64.asm b/modules/arch/x86/tests/lfs64.asm
new file mode 100644
index 0000000..5ee0476
--- /dev/null
+++ b/modules/arch/x86/tests/lfs64.asm
@@ -0,0 +1,10 @@
+[bits 64]
+lfs ax, [rbx]
+lfs eax, [rbx]
+lfs rax, [rbx]
+lgs ax, [rbx]
+lgs eax, [rbx]
+lgs rax, [rbx]
+lss ax, [rbx]
+lss eax, [rbx]
+lss rax, [rbx]
diff --git a/modules/arch/x86/tests/lfs64.hex b/modules/arch/x86/tests/lfs64.hex
new file mode 100644
index 0000000..8eb7186
--- /dev/null
+++ b/modules/arch/x86/tests/lfs64.hex
@@ -0,0 +1,33 @@
+66 
+0f 
+b4 
+03 
+0f 
+b4 
+03 
+48 
+0f 
+b4 
+03 
+66 
+0f 
+b5 
+03 
+0f 
+b5 
+03 
+48 
+0f 
+b5 
+03 
+66 
+0f 
+b2 
+03 
+0f 
+b2 
+03 
+48 
+0f 
+b2 
+03 
diff --git a/modules/arch/x86/tests/lzcnt.asm b/modules/arch/x86/tests/lzcnt.asm
new file mode 100644
index 0000000..4e545df
--- /dev/null
+++ b/modules/arch/x86/tests/lzcnt.asm
@@ -0,0 +1,8 @@
+[bits 64]
+
+lzcnt ax, bx	; 66 f3 0f bd c3
+lzcnt ax, [0]	; 66 f3 0f bd 04 25 00 00 00 00
+lzcnt eax, ebx	; f3 0f bd c3
+lzcnt eax, [0]	; f3 0f bd 04 25 00 00 00 00
+lzcnt rax, rbx	; f3 48 0f bd c3
+lzcnt rax, [0]	; f3 48 0f bd 04 25 00 00 00 00
diff --git a/modules/arch/x86/tests/lzcnt.hex b/modules/arch/x86/tests/lzcnt.hex
new file mode 100644
index 0000000..ed14eb0
--- /dev/null
+++ b/modules/arch/x86/tests/lzcnt.hex
@@ -0,0 +1,43 @@
+66 
+f3 
+0f 
+bd 
+c3 
+66 
+f3 
+0f 
+bd 
+04 
+25 
+00 
+00 
+00 
+00 
+f3 
+0f 
+bd 
+c3 
+f3 
+0f 
+bd 
+04 
+25 
+00 
+00 
+00 
+00 
+f3 
+48 
+0f 
+bd 
+c3 
+f3 
+48 
+0f 
+bd 
+04 
+25 
+00 
+00 
+00 
+00 
diff --git a/modules/arch/x86/tests/pinsrb.asm b/modules/arch/x86/tests/pinsrb.asm
new file mode 100644
index 0000000..7ee059d
--- /dev/null
+++ b/modules/arch/x86/tests/pinsrb.asm
@@ -0,0 +1,6 @@
+[bits 16]
+pinsrb xmm4, eax, 0x55
+[bits 32]
+pinsrb xmm4, eax, 0x55
+[bits 64]
+pinsrb xmm4, eax, 0x55
diff --git a/modules/arch/x86/tests/pinsrb.hex b/modules/arch/x86/tests/pinsrb.hex
new file mode 100644
index 0000000..27e71a9
--- /dev/null
+++ b/modules/arch/x86/tests/pinsrb.hex
@@ -0,0 +1,18 @@
+66 
+0f 
+3a 
+20 
+e0 
+55 
+66 
+0f 
+3a 
+20 
+e0 
+55 
+66 
+0f 
+3a 
+20 
+e0 
+55 
diff --git a/modules/arch/x86/tests/rdrnd.asm b/modules/arch/x86/tests/rdrnd.asm
new file mode 100644
index 0000000..234451d
--- /dev/null
+++ b/modules/arch/x86/tests/rdrnd.asm
@@ -0,0 +1,4 @@
+[bits 64]
+rdrand cx
+rdrand ecx
+rdrand rcx
diff --git a/modules/arch/x86/tests/rdrnd.hex b/modules/arch/x86/tests/rdrnd.hex
new file mode 100644
index 0000000..be4bb80
--- /dev/null
+++ b/modules/arch/x86/tests/rdrnd.hex
@@ -0,0 +1,11 @@
+66 
+0f 
+c7 
+f1 
+0f 
+c7 
+f1 
+48 
+0f 
+c7 
+f1 
diff --git a/modules/arch/x86/tests/shift64.asm b/modules/arch/x86/tests/shift64.asm
new file mode 100644
index 0000000..c1ce6b1
--- /dev/null
+++ b/modules/arch/x86/tests/shift64.asm
@@ -0,0 +1,5 @@
+[bits 64]
+shl rax, 5
+shl rax, 32
+shr rax, 5
+shr rax, 32
diff --git a/modules/arch/x86/tests/shift64.hex b/modules/arch/x86/tests/shift64.hex
new file mode 100644
index 0000000..ad28eb2
--- /dev/null
+++ b/modules/arch/x86/tests/shift64.hex
@@ -0,0 +1,16 @@
+48 
+c1 
+e0 
+05 
+48 
+c1 
+e0 
+20 
+48 
+c1 
+e8 
+05 
+48 
+c1 
+e8 
+20 
diff --git a/modules/arch/x86/tests/smx.asm b/modules/arch/x86/tests/smx.asm
new file mode 100644
index 0000000..e5ca5b5
--- /dev/null
+++ b/modules/arch/x86/tests/smx.asm
@@ -0,0 +1,3 @@
+[bits 32]
+getsec
+
diff --git a/modules/arch/x86/tests/smx.hex b/modules/arch/x86/tests/smx.hex
new file mode 100644
index 0000000..7e6dae1
--- /dev/null
+++ b/modules/arch/x86/tests/smx.hex
@@ -0,0 +1,2 @@
+0f 
+37 
diff --git a/modules/arch/x86/tests/sse5-all.asm b/modules/arch/x86/tests/sse5-all.asm
deleted file mode 100644
index c4fdd6d..0000000
--- a/modules/arch/x86/tests/sse5-all.asm
+++ /dev/null
@@ -1,509 +0,0 @@
-; Instructions are ordered in SSE5 databook order
-; BITS=16 to minimize output length
-[bits 16]
-compd xmm1, xmm4, xmm7, 5		; 0F 25 2D 347 10 05
-compd xmm2, xmm5, [0], byte 5		; 0F 25 2D 056 20 00 00 05
-compd xmm3, xmm6, dqword [0], 5		; 0F 25 2D 066 30 00 00 05
-
-comps xmm1, xmm4, xmm7, 5		; 0F 25 2C 347 10 05
-comps xmm2, xmm5, [0], byte 5		; 0F 25 2C 056 20 00 00 05
-comps xmm3, xmm6, dqword [0], 5		; 0F 25 2C 066 30 00 00 05
-
-comsd xmm1, xmm4, xmm7, 5		; 0F 25 2F 347 10 05
-comsd xmm2, xmm5, [0], byte 5		; 0F 25 2F 056 20 00 00 05
-comsd xmm3, xmm6, qword [0], 5		; 0F 25 2F 066 30 00 00 05
-
-comss xmm1, xmm4, xmm7, 5		; 0F 25 2E 347 10 05
-comss xmm2, xmm5, [0], byte 5		; 0F 25 2E 056 20 00 00 05
-comss xmm3, xmm6, dword [0], 5		; 0F 25 2E 066 30 00 00 05
-
-cvtph2ps xmm1, xmm4			; 0F 7A 30 314
-cvtph2ps xmm2, [0]			; 0F 7A 30 026 00 00
-cvtph2ps xmm3, qword [0]		; 0F 7A 30 036 00 00
-
-cvtps2ph xmm1, xmm4			; 0F 7A 31 341
-cvtps2ph [0], xmm2			; 0F 7A 31 026 00 00
-cvtps2ph qword [0], xmm3		; 0F 7A 31 036 00 00
-
-fmaddpd xmm1, xmm1, xmm2, xmm3		; 0F 24 01 323 10 /or/ 0F 24 01 332 18
-fmaddpd xmm1, xmm1, xmm2, [0]		; 0F 24 01 026 10 00 00
-fmaddpd xmm1, xmm1, xmm2, dqword [0]	; 0F 24 01 026 10 00 00
-fmaddpd xmm1, xmm1, [0], xmm3		; 0F 24 01 036 18 00 00
-fmaddpd xmm1, xmm1, dqword [0], xmm3	; 0F 24 01 036 18 00 00
-fmaddpd xmm1, xmm2, xmm3, xmm1		; 0F 24 05 323 10 /or/ 0F 24 05 332 18
-fmaddpd xmm1, xmm2, [0], xmm1		; 0F 24 05 026 10 00 00
-fmaddpd xmm1, xmm2, dqword [0], xmm1	; 0F 24 05 026 10 00 00
-fmaddpd xmm1, [0], xmm3, xmm1		; 0F 24 05 036 18 00 00
-fmaddpd xmm1, dqword [0], xmm3, xmm1	; 0F 24 05 036 18 00 00
-
-fmaddps xmm1, xmm1, xmm2, xmm3		; 0F 24 00 323 10 /or/ 0F 24 00 332 18
-fmaddps xmm1, xmm1, xmm2, [0]		; 0F 24 00 026 10 00 00
-fmaddps xmm1, xmm1, xmm2, dqword [0]	; 0F 24 00 026 10 00 00
-fmaddps xmm1, xmm1, [0], xmm3		; 0F 24 00 036 18 00 00
-fmaddps xmm1, xmm1, dqword [0], xmm3	; 0F 24 00 036 18 00 00
-fmaddps xmm1, xmm2, xmm3, xmm1		; 0F 24 04 323 10 /or/ 0F 24 04 332 18
-fmaddps xmm1, xmm2, [0], xmm1		; 0F 24 04 026 10 00 00
-fmaddps xmm1, xmm2, dqword [0], xmm1	; 0F 24 04 026 10 00 00
-fmaddps xmm1, [0], xmm3, xmm1		; 0F 24 04 036 18 00 00
-fmaddps xmm1, dqword [0], xmm3, xmm1	; 0F 24 04 036 18 00 00
-
-fmaddsd xmm1, xmm1, xmm2, xmm3		; 0F 24 03 323 10 /or/ 0F 24 03 332 18
-fmaddsd xmm1, xmm1, xmm2, [0]		; 0F 24 03 026 10 00 00
-fmaddsd xmm1, xmm1, xmm2, qword [0]	; 0F 24 03 026 10 00 00
-fmaddsd xmm1, xmm1, [0], xmm3		; 0F 24 03 036 18 00 00
-fmaddsd xmm1, xmm1, qword [0], xmm3	; 0F 24 03 036 18 00 00
-fmaddsd xmm1, xmm2, xmm3, xmm1		; 0F 24 07 323 10 /or/ 0F 24 07 332 18
-fmaddsd xmm1, xmm2, [0], xmm1		; 0F 24 07 026 10 00 00
-fmaddsd xmm1, xmm2, qword [0], xmm1	; 0F 24 07 026 10 00 00
-fmaddsd xmm1, [0], xmm3, xmm1		; 0F 24 07 036 18 00 00
-fmaddsd xmm1, qword [0], xmm3, xmm1	; 0F 24 07 036 18 00 00
-
-fmaddss xmm1, xmm1, xmm2, xmm3		; 0F 24 02 323 10 /or/ 0F 24 02 332 18
-fmaddss xmm1, xmm1, xmm2, [0]		; 0F 24 02 026 10 00 00
-fmaddss xmm1, xmm1, xmm2, dword [0]	; 0F 24 02 026 10 00 00
-fmaddss xmm1, xmm1, [0], xmm3		; 0F 24 02 036 18 00 00
-fmaddss xmm1, xmm1, dword [0], xmm3	; 0F 24 02 036 18 00 00
-fmaddss xmm1, xmm2, xmm3, xmm1		; 0F 24 06 323 10 /or/ 0F 24 06 332 18
-fmaddss xmm1, xmm2, [0], xmm1		; 0F 24 06 026 10 00 00
-fmaddss xmm1, xmm2, dword [0], xmm1	; 0F 24 06 026 10 00 00
-fmaddss xmm1, [0], xmm3, xmm1		; 0F 24 06 036 18 00 00
-fmaddss xmm1, dword [0], xmm3, xmm1	; 0F 24 06 036 18 00 00
-
-fmsubpd xmm1, xmm1, xmm2, xmm3		; 0F 24 09 323 10 /or/ 0F 24 09 332 18
-fmsubpd xmm1, xmm1, xmm2, [0]		; 0F 24 09 026 10 00 00
-fmsubpd xmm1, xmm1, xmm2, dqword [0]	; 0F 24 09 026 10 00 00
-fmsubpd xmm1, xmm1, [0], xmm3		; 0F 24 09 036 18 00 00
-fmsubpd xmm1, xmm1, dqword [0], xmm3	; 0F 24 09 036 18 00 00
-fmsubpd xmm1, xmm2, xmm3, xmm1		; 0F 24 0D 323 10 /or/ 0F 24 0D 332 18
-fmsubpd xmm1, xmm2, [0], xmm1		; 0F 24 0D 026 10 00 00
-fmsubpd xmm1, xmm2, dqword [0], xmm1	; 0F 24 0D 026 10 00 00
-fmsubpd xmm1, [0], xmm3, xmm1		; 0F 24 0D 036 18 00 00
-fmsubpd xmm1, dqword [0], xmm3, xmm1	; 0F 24 0D 036 18 00 00
-
-fmsubps xmm1, xmm1, xmm2, xmm3		; 0F 24 08 323 10 /or/ 0F 24 08 332 18
-fmsubps xmm1, xmm1, xmm2, [0]		; 0F 24 08 026 10 00 00
-fmsubps xmm1, xmm1, xmm2, dqword [0]	; 0F 24 08 026 10 00 00
-fmsubps xmm1, xmm1, [0], xmm3		; 0F 24 08 036 18 00 00
-fmsubps xmm1, xmm1, dqword [0], xmm3	; 0F 24 08 036 18 00 00
-fmsubps xmm1, xmm2, xmm3, xmm1		; 0F 24 0C 323 10 /or/ 0F 24 0C 332 18
-fmsubps xmm1, xmm2, [0], xmm1		; 0F 24 0C 026 10 00 00
-fmsubps xmm1, xmm2, dqword [0], xmm1	; 0F 24 0C 026 10 00 00
-fmsubps xmm1, [0], xmm3, xmm1		; 0F 24 0C 036 18 00 00
-fmsubps xmm1, dqword [0], xmm3, xmm1	; 0F 24 0C 036 18 00 00
-
-fmsubsd xmm1, xmm1, xmm2, xmm3		; 0F 24 0B 323 10 /or/ 0F 24 0B 332 18
-fmsubsd xmm1, xmm1, xmm2, [0]		; 0F 24 0B 026 10 00 00
-fmsubsd xmm1, xmm1, xmm2, qword [0]	; 0F 24 0B 026 10 00 00
-fmsubsd xmm1, xmm1, [0], xmm3		; 0F 24 0B 036 18 00 00
-fmsubsd xmm1, xmm1, qword [0], xmm3	; 0F 24 0B 036 18 00 00
-fmsubsd xmm1, xmm2, xmm3, xmm1		; 0F 24 0F 323 10 /or/ 0F 24 0F 332 18
-fmsubsd xmm1, xmm2, [0], xmm1		; 0F 24 0F 026 10 00 00
-fmsubsd xmm1, xmm2, qword [0], xmm1	; 0F 24 0F 026 10 00 00
-fmsubsd xmm1, [0], xmm3, xmm1		; 0F 24 0F 036 18 00 00
-fmsubsd xmm1, qword [0], xmm3, xmm1	; 0F 24 0F 036 18 00 00
-
-fmsubss xmm1, xmm1, xmm2, xmm3		; 0F 24 0A 323 10 /or/ 0F 24 0A 332 18
-fmsubss xmm1, xmm1, xmm2, [0]		; 0F 24 0A 026 10 00 00
-fmsubss xmm1, xmm1, xmm2, dword [0]	; 0F 24 0A 026 10 00 00
-fmsubss xmm1, xmm1, [0], xmm3		; 0F 24 0A 036 18 00 00
-fmsubss xmm1, xmm1, dword [0], xmm3	; 0F 24 0A 036 18 00 00
-fmsubss xmm1, xmm2, xmm3, xmm1		; 0F 24 0E 323 10 /or/ 0F 24 0E 332 18
-fmsubss xmm1, xmm2, [0], xmm1		; 0F 24 0E 026 10 00 00
-fmsubss xmm1, xmm2, dword [0], xmm1	; 0F 24 0E 026 10 00 00
-fmsubss xmm1, [0], xmm3, xmm1		; 0F 24 0E 036 18 00 00
-fmsubss xmm1, dword [0], xmm3, xmm1	; 0F 24 0E 036 18 00 00
-
-fnmaddpd xmm1, xmm1, xmm2, xmm3		; 0F 24 11 323 10 /or/ 0F 24 11 332 18
-fnmaddpd xmm1, xmm1, xmm2, [0]		; 0F 24 11 026 10 00 00
-fnmaddpd xmm1, xmm1, xmm2, dqword [0]	; 0F 24 11 026 10 00 00
-fnmaddpd xmm1, xmm1, [0], xmm3		; 0F 24 11 036 18 00 00
-fnmaddpd xmm1, xmm1, dqword [0], xmm3	; 0F 24 11 036 18 00 00
-fnmaddpd xmm1, xmm2, xmm3, xmm1		; 0F 24 15 323 10 /or/ 0F 24 15 332 18
-fnmaddpd xmm1, xmm2, [0], xmm1		; 0F 24 15 026 10 00 00
-fnmaddpd xmm1, xmm2, dqword [0], xmm1	; 0F 24 15 026 10 00 00
-fnmaddpd xmm1, [0], xmm3, xmm1		; 0F 24 15 036 18 00 00
-fnmaddpd xmm1, dqword [0], xmm3, xmm1	; 0F 24 15 036 18 00 00
-
-fnmaddps xmm1, xmm1, xmm2, xmm3		; 0F 24 10 323 10 /or/ 0F 24 10 332 18
-fnmaddps xmm1, xmm1, xmm2, [0]		; 0F 24 10 026 10 00 00
-fnmaddps xmm1, xmm1, xmm2, dqword [0]	; 0F 24 10 026 10 00 00
-fnmaddps xmm1, xmm1, [0], xmm3		; 0F 24 10 036 18 00 00
-fnmaddps xmm1, xmm1, dqword [0], xmm3	; 0F 24 10 036 18 00 00
-fnmaddps xmm1, xmm2, xmm3, xmm1		; 0F 24 14 323 10 /or/ 0F 24 14 332 18
-fnmaddps xmm1, xmm2, [0], xmm1		; 0F 24 14 026 10 00 00
-fnmaddps xmm1, xmm2, dqword [0], xmm1	; 0F 24 14 026 10 00 00
-fnmaddps xmm1, [0], xmm3, xmm1		; 0F 24 14 036 18 00 00
-fnmaddps xmm1, dqword [0], xmm3, xmm1	; 0F 24 14 036 18 00 00
-
-fnmaddsd xmm1, xmm1, xmm2, xmm3		; 0F 24 13 323 10 /or/ 0F 24 13 332 18
-fnmaddsd xmm1, xmm1, xmm2, [0]		; 0F 24 13 026 10 00 00
-fnmaddsd xmm1, xmm1, xmm2, qword [0]	; 0F 24 13 026 10 00 00
-fnmaddsd xmm1, xmm1, [0], xmm3		; 0F 24 13 036 18 00 00
-fnmaddsd xmm1, xmm1, qword [0], xmm3	; 0F 24 13 036 18 00 00
-fnmaddsd xmm1, xmm2, xmm3, xmm1		; 0F 24 17 323 10 /or/ 0F 24 17 332 18
-fnmaddsd xmm1, xmm2, [0], xmm1		; 0F 24 17 026 10 00 00
-fnmaddsd xmm1, xmm2, qword [0], xmm1	; 0F 24 17 026 10 00 00
-fnmaddsd xmm1, [0], xmm3, xmm1		; 0F 24 17 036 18 00 00
-fnmaddsd xmm1, qword [0], xmm3, xmm1	; 0F 24 17 036 18 00 00
-
-fnmaddss xmm1, xmm1, xmm2, xmm3		; 0F 24 12 323 10 /or/ 0F 24 12 332 18
-fnmaddss xmm1, xmm1, xmm2, [0]		; 0F 24 12 026 10 00 00
-fnmaddss xmm1, xmm1, xmm2, dword [0]	; 0F 24 12 026 10 00 00
-fnmaddss xmm1, xmm1, [0], xmm3		; 0F 24 12 036 18 00 00
-fnmaddss xmm1, xmm1, dword [0], xmm3	; 0F 24 12 036 18 00 00
-fnmaddss xmm1, xmm2, xmm3, xmm1		; 0F 24 16 323 10 /or/ 0F 24 16 332 18
-fnmaddss xmm1, xmm2, [0], xmm1		; 0F 24 16 026 10 00 00
-fnmaddss xmm1, xmm2, dword [0], xmm1	; 0F 24 16 026 10 00 00
-fnmaddss xmm1, [0], xmm3, xmm1		; 0F 24 16 036 18 00 00
-fnmaddss xmm1, dword [0], xmm3, xmm1	; 0F 24 16 036 18 00 00
-
-fnmsubpd xmm1, xmm1, xmm2, xmm3		; 0F 24 19 323 10 /or/ 0F 24 19 332 18
-fnmsubpd xmm1, xmm1, xmm2, [0]		; 0F 24 19 026 10 00 00
-fnmsubpd xmm1, xmm1, xmm2, dqword [0]	; 0F 24 19 026 10 00 00
-fnmsubpd xmm1, xmm1, [0], xmm3		; 0F 24 19 036 18 00 00
-fnmsubpd xmm1, xmm1, dqword [0], xmm3	; 0F 24 19 036 18 00 00
-fnmsubpd xmm1, xmm2, xmm3, xmm1		; 0F 24 1D 323 10 /or/ 0F 24 1D 332 18
-fnmsubpd xmm1, xmm2, [0], xmm1		; 0F 24 1D 026 10 00 00
-fnmsubpd xmm1, xmm2, dqword [0], xmm1	; 0F 24 1D 026 10 00 00
-fnmsubpd xmm1, [0], xmm3, xmm1		; 0F 24 1D 036 18 00 00
-fnmsubpd xmm1, dqword [0], xmm3, xmm1	; 0F 24 1D 036 18 00 00
-
-fnmsubps xmm1, xmm1, xmm2, xmm3		; 0F 24 18 323 10 /or/ 0F 24 18 332 18
-fnmsubps xmm1, xmm1, xmm2, [0]		; 0F 24 18 026 10 00 00
-fnmsubps xmm1, xmm1, xmm2, dqword [0]	; 0F 24 18 026 10 00 00
-fnmsubps xmm1, xmm1, [0], xmm3		; 0F 24 18 036 18 00 00
-fnmsubps xmm1, xmm1, dqword [0], xmm3	; 0F 24 18 036 18 00 00
-fnmsubps xmm1, xmm2, xmm3, xmm1		; 0F 24 1C 323 10 /or/ 0F 24 1C 332 18
-fnmsubps xmm1, xmm2, [0], xmm1		; 0F 24 1C 026 10 00 00
-fnmsubps xmm1, xmm2, dqword [0], xmm1	; 0F 24 1C 026 10 00 00
-fnmsubps xmm1, [0], xmm3, xmm1		; 0F 24 1C 036 18 00 00
-fnmsubps xmm1, dqword [0], xmm3, xmm1	; 0F 24 1C 036 18 00 00
-
-fnmsubsd xmm1, xmm1, xmm2, xmm3		; 0F 24 1B 323 10 /or/ 0F 24 1B 332 18
-fnmsubsd xmm1, xmm1, xmm2, [0]		; 0F 24 1B 026 10 00 00
-fnmsubsd xmm1, xmm1, xmm2, qword [0]	; 0F 24 1B 026 10 00 00
-fnmsubsd xmm1, xmm1, [0], xmm3		; 0F 24 1B 036 18 00 00
-fnmsubsd xmm1, xmm1, qword [0], xmm3	; 0F 24 1B 036 18 00 00
-fnmsubsd xmm1, xmm2, xmm3, xmm1		; 0F 24 1F 323 10 /or/ 0F 24 1F 332 18
-fnmsubsd xmm1, xmm2, [0], xmm1		; 0F 24 1F 026 10 00 00
-fnmsubsd xmm1, xmm2, qword [0], xmm1	; 0F 24 1F 026 10 00 00
-fnmsubsd xmm1, [0], xmm3, xmm1		; 0F 24 1F 036 18 00 00
-fnmsubsd xmm1, qword [0], xmm3, xmm1	; 0F 24 1F 036 18 00 00
-
-fnmsubss xmm1, xmm1, xmm2, xmm3		; 0F 24 1A 323 10 /or/ 0F 24 1A 332 18
-fnmsubss xmm1, xmm1, xmm2, [0]		; 0F 24 1A 026 10 00 00
-fnmsubss xmm1, xmm1, xmm2, dword [0]	; 0F 24 1A 026 10 00 00
-fnmsubss xmm1, xmm1, [0], xmm3		; 0F 24 1A 036 18 00 00
-fnmsubss xmm1, xmm1, dword [0], xmm3	; 0F 24 1A 036 18 00 00
-fnmsubss xmm1, xmm2, xmm3, xmm1		; 0F 24 1E 323 10 /or/ 0F 24 1E 332 18
-fnmsubss xmm1, xmm2, [0], xmm1		; 0F 24 1E 026 10 00 00
-fnmsubss xmm1, xmm2, dword [0], xmm1	; 0F 24 1E 026 10 00 00
-fnmsubss xmm1, [0], xmm3, xmm1		; 0F 24 1E 036 18 00 00
-fnmsubss xmm1, dword [0], xmm3, xmm1	; 0F 24 1E 036 18 00 00
-
-frczpd xmm1, xmm2			; 0F 7A 11 312
-frczpd xmm1, [0]			; 0F 7A 11 016 00 00
-frczpd xmm1, dqword [0]			; 0F 7A 11 016 00 00
-
-frczps xmm1, xmm2			; 0F 7A 10 312
-frczps xmm1, [0]			; 0F 7A 10 016 00 00
-frczps xmm1, dqword [0]			; 0F 7A 10 016 00 00
-
-frczsd xmm1, xmm2			; 0F 7A 13 312
-frczsd xmm1, [0]			; 0F 7A 13 016 00 00
-frczsd xmm1, qword [0]			; 0F 7A 13 016 00 00
-
-frczss xmm1, xmm2			; 0F 7A 12 312
-frczss xmm1, [0]			; 0F 7A 12 016 00 00
-frczss xmm1, dword [0]			; 0F 7A 12 016 00 00
-
-pcmov xmm1, xmm1, xmm2, xmm3		; 0F 24 22 323 10 /or/ 0F 24 22 332 18
-pcmov xmm1, xmm1, xmm2, [0]		; 0F 24 22 026 10 00 00
-pcmov xmm1, xmm1, xmm2, dqword [0]	; 0F 24 22 026 10 00 00
-pcmov xmm1, xmm1, [0], xmm3		; 0F 24 22 036 18 00 00
-pcmov xmm1, xmm1, dqword [0], xmm3	; 0F 24 22 036 18 00 00
-pcmov xmm1, xmm2, xmm3, xmm1		; 0F 24 26 323 10 /or/ 0F 24 26 332 18
-pcmov xmm1, xmm2, [0], xmm1		; 0F 24 26 026 10 00 00
-pcmov xmm1, xmm2, dqword [0], xmm1	; 0F 24 26 026 10 00 00
-pcmov xmm1, [0], xmm3, xmm1		; 0F 24 26 036 18 00 00
-pcmov xmm1, dqword [0], xmm3, xmm1	; 0F 24 26 036 18 00 00
-
-pcomb xmm1, xmm4, xmm7, 5		; 0F 25 4C 347 10 05
-pcomb xmm2, xmm5, [0], byte 5		; 0F 25 4C 056 20 00 00 05
-pcomb xmm3, xmm6, dqword [0], 5		; 0F 25 4C 066 30 00 00 05
-
-pcomd xmm1, xmm4, xmm7, 5		; 0F 25 4E 347 10 05
-pcomd xmm2, xmm5, [0], byte 5		; 0F 25 4E 056 20 00 00 05
-pcomd xmm3, xmm6, dqword [0], 5		; 0F 25 4E 066 30 00 00 05
-
-pcomq xmm1, xmm4, xmm7, 5		; 0F 25 4F 347 10 05
-pcomq xmm2, xmm5, [0], byte 5		; 0F 25 4F 056 20 00 00 05
-pcomq xmm3, xmm6, dqword [0], 5		; 0F 25 4F 066 30 00 00 05
-
-pcomub xmm1, xmm4, xmm7, 5		; 0F 25 6C 347 10 05
-pcomub xmm2, xmm5, [0], byte 5		; 0F 25 6C 056 20 00 00 05
-pcomub xmm3, xmm6, dqword [0], 5	; 0F 25 6C 066 30 00 00 05
-
-pcomud xmm1, xmm4, xmm7, 5		; 0F 25 6E 347 10 05
-pcomud xmm2, xmm5, [0], byte 5		; 0F 25 6E 056 20 00 00 05
-pcomud xmm3, xmm6, dqword [0], 5	; 0F 25 6E 066 30 00 00 05
-
-pcomuq xmm1, xmm4, xmm7, 5		; 0F 25 6F 347 10 05
-pcomuq xmm2, xmm5, [0], byte 5		; 0F 25 6F 056 20 00 00 05
-pcomuq xmm3, xmm6, dqword [0], 5	; 0F 25 6F 066 30 00 00 05
-
-pcomuw xmm1, xmm4, xmm7, 5		; 0F 25 6D 347 10 05
-pcomuw xmm2, xmm5, [0], byte 5		; 0F 25 6D 056 20 00 00 05
-pcomuw xmm3, xmm6, dqword [0], 5	; 0F 25 6D 066 30 00 00 05
-
-pcomw xmm1, xmm4, xmm7, 5		; 0F 25 4D 347 10 05
-pcomw xmm2, xmm5, [0], byte 5		; 0F 25 4D 056 20 00 00 05
-pcomw xmm3, xmm6, dqword [0], 5		; 0F 25 4D 066 30 00 00 05
-
-permpd xmm1, xmm1, xmm2, xmm3		; 0F 24 21 323 10 /or/ 0F 24 21 332 18
-permpd xmm1, xmm1, xmm2, [0]		; 0F 24 21 026 10 00 00
-permpd xmm1, xmm1, xmm2, dqword [0]	; 0F 24 21 026 10 00 00
-permpd xmm1, xmm1, [0], xmm3		; 0F 24 21 036 18 00 00
-permpd xmm1, xmm1, dqword [0], xmm3	; 0F 24 21 036 18 00 00
-permpd xmm1, xmm2, xmm3, xmm1		; 0F 24 25 323 10 /or/ 0F 24 25 332 18
-permpd xmm1, xmm2, [0], xmm1		; 0F 24 25 026 10 00 00
-permpd xmm1, xmm2, dqword [0], xmm1	; 0F 24 25 026 10 00 00
-permpd xmm1, [0], xmm3, xmm1		; 0F 24 25 036 18 00 00
-permpd xmm1, dqword [0], xmm3, xmm1	; 0F 24 25 036 18 00 00
-
-permps xmm1, xmm1, xmm2, xmm3		; 0F 24 20 323 10 /or/ 0F 24 20 332 18
-permps xmm1, xmm1, xmm2, [0]		; 0F 24 20 026 10 00 00
-permps xmm1, xmm1, xmm2, dqword [0]	; 0F 24 20 026 10 00 00
-permps xmm1, xmm1, [0], xmm3		; 0F 24 20 036 18 00 00
-permps xmm1, xmm1, dqword [0], xmm3	; 0F 24 20 036 18 00 00
-permps xmm1, xmm2, xmm3, xmm1		; 0F 24 24 323 10 /or/ 0F 24 24 332 18
-permps xmm1, xmm2, [0], xmm1		; 0F 24 24 026 10 00 00
-permps xmm1, xmm2, dqword [0], xmm1	; 0F 24 24 026 10 00 00
-permps xmm1, [0], xmm3, xmm1		; 0F 24 24 036 18 00 00
-permps xmm1, dqword [0], xmm3, xmm1	; 0F 24 24 036 18 00 00
-
-phaddbd xmm1, xmm2			; 0F 7A 42 312
-phaddbd xmm1, [0]			; 0F 7A 42 016 00 00
-phaddbd xmm1, dqword [0]		; 0F 7A 42 016 00 00
-
-phaddbq xmm1, xmm2			; 0F 7A 43 312
-phaddbq xmm1, [0]			; 0F 7A 43 016 00 00
-phaddbq xmm1, dqword [0]		; 0F 7A 43 016 00 00
-
-phaddbw xmm1, xmm2			; 0F 7A 41 312
-phaddbw xmm1, [0]			; 0F 7A 41 016 00 00
-phaddbw xmm1, dqword [0]		; 0F 7A 41 016 00 00
-
-phadddq xmm1, xmm2			; 0F 7A 4B 312
-phadddq xmm1, [0]			; 0F 7A 4B 016 00 00
-phadddq xmm1, dqword [0]		; 0F 7A 4B 016 00 00
-
-phaddubd xmm1, xmm2			; 0F 7A 52 312
-phaddubd xmm1, [0]			; 0F 7A 52 016 00 00
-phaddubd xmm1, dqword [0]		; 0F 7A 52 016 00 00
-
-phaddubq xmm1, xmm2			; 0F 7A 53 312
-phaddubq xmm1, [0]			; 0F 7A 53 016 00 00
-phaddubq xmm1, dqword [0]		; 0F 7A 53 016 00 00
-
-phaddubw xmm1, xmm2			; 0F 7A 51 312
-phaddubw xmm1, [0]			; 0F 7A 51 016 00 00
-phaddubw xmm1, dqword [0]		; 0F 7A 51 016 00 00
-
-phaddudq xmm1, xmm2			; 0F 7A 5B 312
-phaddudq xmm1, [0]			; 0F 7A 5B 016 00 00
-phaddudq xmm1, dqword [0]		; 0F 7A 5B 016 00 00
-
-phadduwd xmm1, xmm2			; 0F 7A 56 312
-phadduwd xmm1, [0]			; 0F 7A 56 016 00 00
-phadduwd xmm1, dqword [0]		; 0F 7A 56 016 00 00
-
-phadduwq xmm1, xmm2			; 0F 7A 57 312
-phadduwq xmm1, [0]			; 0F 7A 57 016 00 00
-phadduwq xmm1, dqword [0]		; 0F 7A 57 016 00 00
-
-phaddwd xmm1, xmm2			; 0F 7A 46 312
-phaddwd xmm1, [0]			; 0F 7A 46 016 00 00
-phaddwd xmm1, dqword [0]		; 0F 7A 46 016 00 00
-
-phaddwq xmm1, xmm2			; 0F 7A 47 312
-phaddwq xmm1, [0]			; 0F 7A 47 016 00 00
-phaddwq xmm1, dqword [0]		; 0F 7A 47 016 00 00
-
-phsubbw xmm1, xmm2			; 0F 7A 61 312
-phsubbw xmm1, [0]			; 0F 7A 61 016 00 00
-phsubbw xmm1, dqword [0]		; 0F 7A 61 016 00 00
-
-phsubdq xmm1, xmm2			; 0F 7A 63 312
-phsubdq xmm1, [0]			; 0F 7A 63 016 00 00
-phsubdq xmm1, dqword [0]		; 0F 7A 63 016 00 00
-
-phsubwd xmm1, xmm2			; 0F 7A 62 312
-phsubwd xmm1, [0]			; 0F 7A 62 016 00 00
-phsubwd xmm1, dqword [0]		; 0F 7A 62 016 00 00
-
-pmacsdd xmm1, xmm4, xmm7, xmm1		; 0F 24 9E 347 10
-pmacsdd xmm2, xmm5, [0], xmm2		; 0F 24 9E 056 20 00 00
-pmacsdd xmm3, xmm6, dqword [0], xmm3	; 0F 24 9E 066 30 00 00
-
-pmacsdqh xmm1, xmm4, xmm7, xmm1		; 0F 24 9F 347 10
-pmacsdqh xmm2, xmm5, [0], xmm2		; 0F 24 9F 056 20 00 00
-pmacsdqh xmm3, xmm6, dqword [0], xmm3	; 0F 24 9F 066 30 00 00
-
-pmacsdql xmm1, xmm4, xmm7, xmm1		; 0F 24 97 347 10
-pmacsdql xmm2, xmm5, [0], xmm2		; 0F 24 97 056 20 00 00
-pmacsdql xmm3, xmm6, dqword [0], xmm3	; 0F 24 97 066 30 00 00
-
-pmacssdd xmm1, xmm4, xmm7, xmm1		; 0F 24 8E 347 10
-pmacssdd xmm2, xmm5, [0], xmm2		; 0F 24 8E 056 20 00 00
-pmacssdd xmm3, xmm6, dqword [0], xmm3	; 0F 24 8E 066 30 00 00
-
-pmacssdqh xmm1, xmm4, xmm7, xmm1	; 0F 24 8F 347 10
-pmacssdqh xmm2, xmm5, [0], xmm2		; 0F 24 8F 056 20 00 00
-pmacssdqh xmm3, xmm6, dqword [0], xmm3	; 0F 24 8F 066 30 00 00
-
-pmacssdql xmm1, xmm4, xmm7, xmm1	; 0F 24 87 347 10
-pmacssdql xmm2, xmm5, [0], xmm2		; 0F 24 87 056 20 00 00
-pmacssdql xmm3, xmm6, dqword [0], xmm3	; 0F 24 87 066 30 00 00
-
-pmacsswd xmm1, xmm4, xmm7, xmm1		; 0F 24 86 347 10
-pmacsswd xmm2, xmm5, [0], xmm2		; 0F 24 86 056 20 00 00
-pmacsswd xmm3, xmm6, dqword [0], xmm3	; 0F 24 86 066 30 00 00
-
-pmacssww xmm1, xmm4, xmm7, xmm1		; 0F 24 85 347 10
-pmacssww xmm2, xmm5, [0], xmm2		; 0F 24 85 056 20 00 00
-pmacssww xmm3, xmm6, dqword [0], xmm3	; 0F 24 85 066 30 00 00
-
-pmacswd xmm1, xmm4, xmm7, xmm1		; 0F 24 96 347 10
-pmacswd xmm2, xmm5, [0], xmm2		; 0F 24 96 056 20 00 00
-pmacswd xmm3, xmm6, dqword [0], xmm3	; 0F 24 96 066 30 00 00
-
-pmacsww xmm1, xmm4, xmm7, xmm1		; 0F 24 95 347 10
-pmacsww xmm2, xmm5, [0], xmm2		; 0F 24 95 056 20 00 00
-pmacsww xmm3, xmm6, dqword [0], xmm3	; 0F 24 95 066 30 00 00
-
-pmadcsswd xmm1, xmm4, xmm7, xmm1	; 0F 24 A6 347 10
-pmadcsswd xmm2, xmm5, [0], xmm2		; 0F 24 A6 056 20 00 00
-pmadcsswd xmm3, xmm6, dqword [0], xmm3	; 0F 24 A6 066 30 00 00
-
-pmadcswd xmm1, xmm4, xmm7, xmm1		; 0F 24 B6 347 10
-pmadcswd xmm2, xmm5, [0], xmm2		; 0F 24 B6 056 20 00 00
-pmadcswd xmm3, xmm6, dqword [0], xmm3	; 0F 24 B6 066 30 00 00
-
-pperm xmm1, xmm1, xmm2, xmm3		; 0F 24 23 323 10 /or/ 0F 24 23 332 18
-pperm xmm1, xmm1, xmm2, [0]		; 0F 24 23 026 10 00 00
-pperm xmm1, xmm1, xmm2, dqword [0]	; 0F 24 23 026 10 00 00
-pperm xmm1, xmm1, [0], xmm3		; 0F 24 23 036 18 00 00
-pperm xmm1, xmm1, dqword [0], xmm3	; 0F 24 23 036 18 00 00
-pperm xmm1, xmm2, xmm3, xmm1		; 0F 24 27 323 10 /or/ 0F 24 27 332 18
-pperm xmm1, xmm2, [0], xmm1		; 0F 24 27 026 10 00 00
-pperm xmm1, xmm2, dqword [0], xmm1	; 0F 24 27 026 10 00 00
-pperm xmm1, [0], xmm3, xmm1		; 0F 24 27 036 18 00 00
-pperm xmm1, dqword [0], xmm3, xmm1	; 0F 24 27 036 18 00 00
-
-protb xmm1, xmm2, xmm3			; 0F 24 40 323 10 /or/ 0F 24 40 332 18
-protb xmm1, xmm2, [0]			; 0F 24 40 026 10 00 00
-protb xmm1, xmm2, dqword [0]		; 0F 24 40 026 10 00 00
-protb xmm1, [0], xmm3			; 0F 24 40 036 18 00 00
-protb xmm1, dqword [0], xmm3		; 0F 24 40 036 18 00 00
-protb xmm1, xmm2, byte 5		; 0F 7B 40 312 05
-protb xmm1, [0], byte 5			; 0F 7B 40 016 00 00 05
-protb xmm1, dqword [0], 5		; 0F 7B 40 016 00 00 05
-
-protd xmm1, xmm2, xmm3			; 0F 24 42 323 10 /or/ 0F 24 42 332 18
-protd xmm1, xmm2, [0]			; 0F 24 42 026 10 00 00
-protd xmm1, xmm2, dqword [0]		; 0F 24 42 026 10 00 00
-protd xmm1, [0], xmm3			; 0F 24 42 036 18 00 00
-protd xmm1, dqword [0], xmm3		; 0F 24 42 036 18 00 00
-protd xmm1, xmm2, byte 5		; 0F 7B 42 312 05
-protd xmm1, [0], byte 5			; 0F 7B 42 016 00 00 05
-protd xmm1, dqword [0], 5		; 0F 7B 42 016 00 00 05
-
-protq xmm1, xmm2, xmm3			; 0F 24 43 323 10 /or/ 0F 24 43 332 18
-protq xmm1, xmm2, [0]			; 0F 24 43 026 10 00 00
-protq xmm1, xmm2, dqword [0]		; 0F 24 43 026 10 00 00
-protq xmm1, [0], xmm3			; 0F 24 43 036 18 00 00
-protq xmm1, dqword [0], xmm3		; 0F 24 43 036 18 00 00
-protq xmm1, xmm2, byte 5		; 0F 7B 43 312 05
-protq xmm1, [0], byte 5			; 0F 7B 43 016 00 00 05
-protq xmm1, dqword [0], 5		; 0F 7B 43 016 00 00 05
-
-protw xmm1, xmm2, xmm3			; 0F 24 41 323 10 /or/ 0F 24 41 332 18
-protw xmm1, xmm2, [0]			; 0F 24 41 026 10 00 00
-protw xmm1, xmm2, dqword [0]		; 0F 24 41 026 10 00 00
-protw xmm1, [0], xmm3			; 0F 24 41 036 18 00 00
-protw xmm1, dqword [0], xmm3		; 0F 24 41 036 18 00 00
-protw xmm1, xmm2, byte 5		; 0F 7B 41 312 05
-protw xmm1, [0], byte 5			; 0F 7B 41 016 00 00 05
-protw xmm1, dqword [0], 5		; 0F 7B 41 016 00 00 05
-
-pshab xmm1, xmm2, xmm3			; 0F 24 48 323 10 /or/ 0F 24 48 332 18
-pshab xmm1, xmm2, [0]			; 0F 24 48 026 10 00 00
-pshab xmm1, xmm2, dqword [0]		; 0F 24 48 026 10 00 00
-pshab xmm1, [0], xmm3			; 0F 24 48 036 18 00 00
-pshab xmm1, dqword [0], xmm3		; 0F 24 48 036 18 00 00
-
-pshad xmm1, xmm2, xmm3			; 0F 24 4A 323 10 /or/ 0F 24 4A 332 18
-pshad xmm1, xmm2, [0]			; 0F 24 4A 026 10 00 00
-pshad xmm1, xmm2, dqword [0]		; 0F 24 4A 026 10 00 00
-pshad xmm1, [0], xmm3			; 0F 24 4A 036 18 00 00
-pshad xmm1, dqword [0], xmm3		; 0F 24 4A 036 18 00 00
-
-pshaq xmm1, xmm2, xmm3			; 0F 24 4B 323 10 /or/ 0F 24 4B 332 18
-pshaq xmm1, xmm2, [0]			; 0F 24 4B 026 10 00 00
-pshaq xmm1, xmm2, dqword [0]		; 0F 24 4B 026 10 00 00
-pshaq xmm1, [0], xmm3			; 0F 24 4B 036 18 00 00
-pshaq xmm1, dqword [0], xmm3		; 0F 24 4B 036 18 00 00
-
-pshaw xmm1, xmm2, xmm3			; 0F 24 49 323 10 /or/ 0F 24 49 332 18
-pshaw xmm1, xmm2, [0]			; 0F 24 49 026 10 00 00
-pshaw xmm1, xmm2, dqword [0]		; 0F 24 49 026 10 00 00
-pshaw xmm1, [0], xmm3			; 0F 24 49 036 18 00 00
-pshaw xmm1, dqword [0], xmm3		; 0F 24 49 036 18 00 00
-
-pshlb xmm1, xmm2, xmm3			; 0F 24 44 323 10 /or/ 0F 24 44 332 18
-pshlb xmm1, xmm2, [0]			; 0F 24 44 026 10 00 00
-pshlb xmm1, xmm2, dqword [0]		; 0F 24 44 026 10 00 00
-pshlb xmm1, [0], xmm3			; 0F 24 44 036 18 00 00
-pshlb xmm1, dqword [0], xmm3		; 0F 24 44 036 18 00 00
-
-pshld xmm1, xmm2, xmm3			; 0F 24 46 323 10 /or/ 0F 24 46 332 18
-pshld xmm1, xmm2, [0]			; 0F 24 46 026 10 00 00
-pshld xmm1, xmm2, dqword [0]		; 0F 24 46 026 10 00 00
-pshld xmm1, [0], xmm3			; 0F 24 46 036 18 00 00
-pshld xmm1, dqword [0], xmm3		; 0F 24 46 036 18 00 00
-
-pshlq xmm1, xmm2, xmm3			; 0F 24 47 323 10 /or/ 0F 24 47 332 18
-pshlq xmm1, xmm2, [0]			; 0F 24 47 026 10 00 00
-pshlq xmm1, xmm2, dqword [0]		; 0F 24 47 026 10 00 00
-pshlq xmm1, [0], xmm3			; 0F 24 47 036 18 00 00
-pshlq xmm1, dqword [0], xmm3		; 0F 24 47 036 18 00 00
-
-pshlw xmm1, xmm2, xmm3			; 0F 24 45 323 10 /or/ 0F 24 45 332 18
-pshlw xmm1, xmm2, [0]			; 0F 24 45 026 10 00 00
-pshlw xmm1, xmm2, dqword [0]		; 0F 24 45 026 10 00 00
-pshlw xmm1, [0], xmm3			; 0F 24 45 036 18 00 00
-pshlw xmm1, dqword [0], xmm3		; 0F 24 45 036 18 00 00
-
-; SSE5 instructions that are also SSE4.1 instructions
-
-ptest xmm1, xmm2			; 66 0F 38 17 312
-ptest xmm1, [0]				; 66 0F 38 17 016 00 00
-ptest xmm1, dqword [0]			; 66 0F 38 17 016 00 00
-
-roundpd xmm1, xmm2, 5			; 66 0F 3A 09 312 05
-roundpd xmm1, [0], byte 5		; 66 0F 3A 09 016 00 00 05
-roundpd xmm1, dqword [0], 5		; 66 0F 3A 09 016 00 00 05
-
-roundps xmm1, xmm2, 5			; 66 0F 3A 08 312 05
-roundps xmm1, [0], byte 5		; 66 0F 3A 08 016 00 00 05
-roundps xmm1, dqword [0], 5		; 66 0F 3A 08 016 00 00 05
-
-roundsd xmm1, xmm2, 5			; 66 0F 3A 0B 312 05
-roundsd xmm1, [0], byte 5		; 66 0F 3A 0B 016 00 00 05
-roundsd xmm1, qword [0], 5		; 66 0F 3A 0B 016 00 00 05
-
-roundss xmm1, xmm2, 5			; 66 0F 3A 0A 312 05
-roundss xmm1, [0], byte 5		; 66 0F 3A 0A 016 00 00 05
-roundss xmm1, dword [0], 5		; 66 0F 3A 0A 016 00 00 05
-
diff --git a/modules/arch/x86/tests/sse5-all.hex b/modules/arch/x86/tests/sse5-all.hex
deleted file mode 100644
index 1c9edac..0000000
--- a/modules/arch/x86/tests/sse5-all.hex
+++ /dev/null
@@ -1,2727 +0,0 @@
-0f 
-25 
-2d 
-e7 
-10 
-05 
-0f 
-25 
-2d 
-2e 
-20 
-00 
-00 
-05 
-0f 
-25 
-2d 
-36 
-30 
-00 
-00 
-05 
-0f 
-25 
-2c 
-e7 
-10 
-05 
-0f 
-25 
-2c 
-2e 
-20 
-00 
-00 
-05 
-0f 
-25 
-2c 
-36 
-30 
-00 
-00 
-05 
-0f 
-25 
-2f 
-e7 
-10 
-05 
-0f 
-25 
-2f 
-2e 
-20 
-00 
-00 
-05 
-0f 
-25 
-2f 
-36 
-30 
-00 
-00 
-05 
-0f 
-25 
-2e 
-e7 
-10 
-05 
-0f 
-25 
-2e 
-2e 
-20 
-00 
-00 
-05 
-0f 
-25 
-2e 
-36 
-30 
-00 
-00 
-05 
-0f 
-7a 
-30 
-cc 
-0f 
-7a 
-30 
-16 
-00 
-00 
-0f 
-7a 
-30 
-1e 
-00 
-00 
-0f 
-7a 
-31 
-e1 
-0f 
-7a 
-31 
-16 
-00 
-00 
-0f 
-7a 
-31 
-1e 
-00 
-00 
-0f 
-24 
-01 
-d3 
-10 
-0f 
-24 
-01 
-16 
-10 
-00 
-00 
-0f 
-24 
-01 
-16 
-10 
-00 
-00 
-0f 
-24 
-01 
-1e 
-18 
-00 
-00 
-0f 
-24 
-01 
-1e 
-18 
-00 
-00 
-0f 
-24 
-05 
-d3 
-10 
-0f 
-24 
-05 
-16 
-10 
-00 
-00 
-0f 
-24 
-05 
-16 
-10 
-00 
-00 
-0f 
-24 
-05 
-1e 
-18 
-00 
-00 
-0f 
-24 
-05 
-1e 
-18 
-00 
-00 
-0f 
-24 
-00 
-d3 
-10 
-0f 
-24 
-00 
-16 
-10 
-00 
-00 
-0f 
-24 
-00 
-16 
-10 
-00 
-00 
-0f 
-24 
-00 
-1e 
-18 
-00 
-00 
-0f 
-24 
-00 
-1e 
-18 
-00 
-00 
-0f 
-24 
-04 
-d3 
-10 
-0f 
-24 
-04 
-16 
-10 
-00 
-00 
-0f 
-24 
-04 
-16 
-10 
-00 
-00 
-0f 
-24 
-04 
-1e 
-18 
-00 
-00 
-0f 
-24 
-04 
-1e 
-18 
-00 
-00 
-0f 
-24 
-03 
-d3 
-10 
-0f 
-24 
-03 
-16 
-10 
-00 
-00 
-0f 
-24 
-03 
-16 
-10 
-00 
-00 
-0f 
-24 
-03 
-1e 
-18 
-00 
-00 
-0f 
-24 
-03 
-1e 
-18 
-00 
-00 
-0f 
-24 
-07 
-d3 
-10 
-0f 
-24 
-07 
-16 
-10 
-00 
-00 
-0f 
-24 
-07 
-16 
-10 
-00 
-00 
-0f 
-24 
-07 
-1e 
-18 
-00 
-00 
-0f 
-24 
-07 
-1e 
-18 
-00 
-00 
-0f 
-24 
-02 
-d3 
-10 
-0f 
-24 
-02 
-16 
-10 
-00 
-00 
-0f 
-24 
-02 
-16 
-10 
-00 
-00 
-0f 
-24 
-02 
-1e 
-18 
-00 
-00 
-0f 
-24 
-02 
-1e 
-18 
-00 
-00 
-0f 
-24 
-06 
-d3 
-10 
-0f 
-24 
-06 
-16 
-10 
-00 
-00 
-0f 
-24 
-06 
-16 
-10 
-00 
-00 
-0f 
-24 
-06 
-1e 
-18 
-00 
-00 
-0f 
-24 
-06 
-1e 
-18 
-00 
-00 
-0f 
-24 
-09 
-d3 
-10 
-0f 
-24 
-09 
-16 
-10 
-00 
-00 
-0f 
-24 
-09 
-16 
-10 
-00 
-00 
-0f 
-24 
-09 
-1e 
-18 
-00 
-00 
-0f 
-24 
-09 
-1e 
-18 
-00 
-00 
-0f 
-24 
-0d 
-d3 
-10 
-0f 
-24 
-0d 
-16 
-10 
-00 
-00 
-0f 
-24 
-0d 
-16 
-10 
-00 
-00 
-0f 
-24 
-0d 
-1e 
-18 
-00 
-00 
-0f 
-24 
-0d 
-1e 
-18 
-00 
-00 
-0f 
-24 
-08 
-d3 
-10 
-0f 
-24 
-08 
-16 
-10 
-00 
-00 
-0f 
-24 
-08 
-16 
-10 
-00 
-00 
-0f 
-24 
-08 
-1e 
-18 
-00 
-00 
-0f 
-24 
-08 
-1e 
-18 
-00 
-00 
-0f 
-24 
-0c 
-d3 
-10 
-0f 
-24 
-0c 
-16 
-10 
-00 
-00 
-0f 
-24 
-0c 
-16 
-10 
-00 
-00 
-0f 
-24 
-0c 
-1e 
-18 
-00 
-00 
-0f 
-24 
-0c 
-1e 
-18 
-00 
-00 
-0f 
-24 
-0b 
-d3 
-10 
-0f 
-24 
-0b 
-16 
-10 
-00 
-00 
-0f 
-24 
-0b 
-16 
-10 
-00 
-00 
-0f 
-24 
-0b 
-1e 
-18 
-00 
-00 
-0f 
-24 
-0b 
-1e 
-18 
-00 
-00 
-0f 
-24 
-0f 
-d3 
-10 
-0f 
-24 
-0f 
-16 
-10 
-00 
-00 
-0f 
-24 
-0f 
-16 
-10 
-00 
-00 
-0f 
-24 
-0f 
-1e 
-18 
-00 
-00 
-0f 
-24 
-0f 
-1e 
-18 
-00 
-00 
-0f 
-24 
-0a 
-d3 
-10 
-0f 
-24 
-0a 
-16 
-10 
-00 
-00 
-0f 
-24 
-0a 
-16 
-10 
-00 
-00 
-0f 
-24 
-0a 
-1e 
-18 
-00 
-00 
-0f 
-24 
-0a 
-1e 
-18 
-00 
-00 
-0f 
-24 
-0e 
-d3 
-10 
-0f 
-24 
-0e 
-16 
-10 
-00 
-00 
-0f 
-24 
-0e 
-16 
-10 
-00 
-00 
-0f 
-24 
-0e 
-1e 
-18 
-00 
-00 
-0f 
-24 
-0e 
-1e 
-18 
-00 
-00 
-0f 
-24 
-11 
-d3 
-10 
-0f 
-24 
-11 
-16 
-10 
-00 
-00 
-0f 
-24 
-11 
-16 
-10 
-00 
-00 
-0f 
-24 
-11 
-1e 
-18 
-00 
-00 
-0f 
-24 
-11 
-1e 
-18 
-00 
-00 
-0f 
-24 
-15 
-d3 
-10 
-0f 
-24 
-15 
-16 
-10 
-00 
-00 
-0f 
-24 
-15 
-16 
-10 
-00 
-00 
-0f 
-24 
-15 
-1e 
-18 
-00 
-00 
-0f 
-24 
-15 
-1e 
-18 
-00 
-00 
-0f 
-24 
-10 
-d3 
-10 
-0f 
-24 
-10 
-16 
-10 
-00 
-00 
-0f 
-24 
-10 
-16 
-10 
-00 
-00 
-0f 
-24 
-10 
-1e 
-18 
-00 
-00 
-0f 
-24 
-10 
-1e 
-18 
-00 
-00 
-0f 
-24 
-14 
-d3 
-10 
-0f 
-24 
-14 
-16 
-10 
-00 
-00 
-0f 
-24 
-14 
-16 
-10 
-00 
-00 
-0f 
-24 
-14 
-1e 
-18 
-00 
-00 
-0f 
-24 
-14 
-1e 
-18 
-00 
-00 
-0f 
-24 
-13 
-d3 
-10 
-0f 
-24 
-13 
-16 
-10 
-00 
-00 
-0f 
-24 
-13 
-16 
-10 
-00 
-00 
-0f 
-24 
-13 
-1e 
-18 
-00 
-00 
-0f 
-24 
-13 
-1e 
-18 
-00 
-00 
-0f 
-24 
-17 
-d3 
-10 
-0f 
-24 
-17 
-16 
-10 
-00 
-00 
-0f 
-24 
-17 
-16 
-10 
-00 
-00 
-0f 
-24 
-17 
-1e 
-18 
-00 
-00 
-0f 
-24 
-17 
-1e 
-18 
-00 
-00 
-0f 
-24 
-12 
-d3 
-10 
-0f 
-24 
-12 
-16 
-10 
-00 
-00 
-0f 
-24 
-12 
-16 
-10 
-00 
-00 
-0f 
-24 
-12 
-1e 
-18 
-00 
-00 
-0f 
-24 
-12 
-1e 
-18 
-00 
-00 
-0f 
-24 
-16 
-d3 
-10 
-0f 
-24 
-16 
-16 
-10 
-00 
-00 
-0f 
-24 
-16 
-16 
-10 
-00 
-00 
-0f 
-24 
-16 
-1e 
-18 
-00 
-00 
-0f 
-24 
-16 
-1e 
-18 
-00 
-00 
-0f 
-24 
-19 
-d3 
-10 
-0f 
-24 
-19 
-16 
-10 
-00 
-00 
-0f 
-24 
-19 
-16 
-10 
-00 
-00 
-0f 
-24 
-19 
-1e 
-18 
-00 
-00 
-0f 
-24 
-19 
-1e 
-18 
-00 
-00 
-0f 
-24 
-1d 
-d3 
-10 
-0f 
-24 
-1d 
-16 
-10 
-00 
-00 
-0f 
-24 
-1d 
-16 
-10 
-00 
-00 
-0f 
-24 
-1d 
-1e 
-18 
-00 
-00 
-0f 
-24 
-1d 
-1e 
-18 
-00 
-00 
-0f 
-24 
-18 
-d3 
-10 
-0f 
-24 
-18 
-16 
-10 
-00 
-00 
-0f 
-24 
-18 
-16 
-10 
-00 
-00 
-0f 
-24 
-18 
-1e 
-18 
-00 
-00 
-0f 
-24 
-18 
-1e 
-18 
-00 
-00 
-0f 
-24 
-1c 
-d3 
-10 
-0f 
-24 
-1c 
-16 
-10 
-00 
-00 
-0f 
-24 
-1c 
-16 
-10 
-00 
-00 
-0f 
-24 
-1c 
-1e 
-18 
-00 
-00 
-0f 
-24 
-1c 
-1e 
-18 
-00 
-00 
-0f 
-24 
-1b 
-d3 
-10 
-0f 
-24 
-1b 
-16 
-10 
-00 
-00 
-0f 
-24 
-1b 
-16 
-10 
-00 
-00 
-0f 
-24 
-1b 
-1e 
-18 
-00 
-00 
-0f 
-24 
-1b 
-1e 
-18 
-00 
-00 
-0f 
-24 
-1f 
-d3 
-10 
-0f 
-24 
-1f 
-16 
-10 
-00 
-00 
-0f 
-24 
-1f 
-16 
-10 
-00 
-00 
-0f 
-24 
-1f 
-1e 
-18 
-00 
-00 
-0f 
-24 
-1f 
-1e 
-18 
-00 
-00 
-0f 
-24 
-1a 
-d3 
-10 
-0f 
-24 
-1a 
-16 
-10 
-00 
-00 
-0f 
-24 
-1a 
-16 
-10 
-00 
-00 
-0f 
-24 
-1a 
-1e 
-18 
-00 
-00 
-0f 
-24 
-1a 
-1e 
-18 
-00 
-00 
-0f 
-24 
-1e 
-d3 
-10 
-0f 
-24 
-1e 
-16 
-10 
-00 
-00 
-0f 
-24 
-1e 
-16 
-10 
-00 
-00 
-0f 
-24 
-1e 
-1e 
-18 
-00 
-00 
-0f 
-24 
-1e 
-1e 
-18 
-00 
-00 
-0f 
-7a 
-11 
-ca 
-0f 
-7a 
-11 
-0e 
-00 
-00 
-0f 
-7a 
-11 
-0e 
-00 
-00 
-0f 
-7a 
-10 
-ca 
-0f 
-7a 
-10 
-0e 
-00 
-00 
-0f 
-7a 
-10 
-0e 
-00 
-00 
-0f 
-7a 
-13 
-ca 
-0f 
-7a 
-13 
-0e 
-00 
-00 
-0f 
-7a 
-13 
-0e 
-00 
-00 
-0f 
-7a 
-12 
-ca 
-0f 
-7a 
-12 
-0e 
-00 
-00 
-0f 
-7a 
-12 
-0e 
-00 
-00 
-0f 
-24 
-22 
-d3 
-10 
-0f 
-24 
-22 
-16 
-10 
-00 
-00 
-0f 
-24 
-22 
-16 
-10 
-00 
-00 
-0f 
-24 
-22 
-1e 
-18 
-00 
-00 
-0f 
-24 
-22 
-1e 
-18 
-00 
-00 
-0f 
-24 
-26 
-d3 
-10 
-0f 
-24 
-26 
-16 
-10 
-00 
-00 
-0f 
-24 
-26 
-16 
-10 
-00 
-00 
-0f 
-24 
-26 
-1e 
-18 
-00 
-00 
-0f 
-24 
-26 
-1e 
-18 
-00 
-00 
-0f 
-25 
-4c 
-e7 
-10 
-05 
-0f 
-25 
-4c 
-2e 
-20 
-00 
-00 
-05 
-0f 
-25 
-4c 
-36 
-30 
-00 
-00 
-05 
-0f 
-25 
-4e 
-e7 
-10 
-05 
-0f 
-25 
-4e 
-2e 
-20 
-00 
-00 
-05 
-0f 
-25 
-4e 
-36 
-30 
-00 
-00 
-05 
-0f 
-25 
-4f 
-e7 
-10 
-05 
-0f 
-25 
-4f 
-2e 
-20 
-00 
-00 
-05 
-0f 
-25 
-4f 
-36 
-30 
-00 
-00 
-05 
-0f 
-25 
-6c 
-e7 
-10 
-05 
-0f 
-25 
-6c 
-2e 
-20 
-00 
-00 
-05 
-0f 
-25 
-6c 
-36 
-30 
-00 
-00 
-05 
-0f 
-25 
-6e 
-e7 
-10 
-05 
-0f 
-25 
-6e 
-2e 
-20 
-00 
-00 
-05 
-0f 
-25 
-6e 
-36 
-30 
-00 
-00 
-05 
-0f 
-25 
-6f 
-e7 
-10 
-05 
-0f 
-25 
-6f 
-2e 
-20 
-00 
-00 
-05 
-0f 
-25 
-6f 
-36 
-30 
-00 
-00 
-05 
-0f 
-25 
-6d 
-e7 
-10 
-05 
-0f 
-25 
-6d 
-2e 
-20 
-00 
-00 
-05 
-0f 
-25 
-6d 
-36 
-30 
-00 
-00 
-05 
-0f 
-25 
-4d 
-e7 
-10 
-05 
-0f 
-25 
-4d 
-2e 
-20 
-00 
-00 
-05 
-0f 
-25 
-4d 
-36 
-30 
-00 
-00 
-05 
-0f 
-24 
-21 
-d3 
-10 
-0f 
-24 
-21 
-16 
-10 
-00 
-00 
-0f 
-24 
-21 
-16 
-10 
-00 
-00 
-0f 
-24 
-21 
-1e 
-18 
-00 
-00 
-0f 
-24 
-21 
-1e 
-18 
-00 
-00 
-0f 
-24 
-25 
-d3 
-10 
-0f 
-24 
-25 
-16 
-10 
-00 
-00 
-0f 
-24 
-25 
-16 
-10 
-00 
-00 
-0f 
-24 
-25 
-1e 
-18 
-00 
-00 
-0f 
-24 
-25 
-1e 
-18 
-00 
-00 
-0f 
-24 
-20 
-d3 
-10 
-0f 
-24 
-20 
-16 
-10 
-00 
-00 
-0f 
-24 
-20 
-16 
-10 
-00 
-00 
-0f 
-24 
-20 
-1e 
-18 
-00 
-00 
-0f 
-24 
-20 
-1e 
-18 
-00 
-00 
-0f 
-24 
-24 
-d3 
-10 
-0f 
-24 
-24 
-16 
-10 
-00 
-00 
-0f 
-24 
-24 
-16 
-10 
-00 
-00 
-0f 
-24 
-24 
-1e 
-18 
-00 
-00 
-0f 
-24 
-24 
-1e 
-18 
-00 
-00 
-0f 
-7a 
-42 
-ca 
-0f 
-7a 
-42 
-0e 
-00 
-00 
-0f 
-7a 
-42 
-0e 
-00 
-00 
-0f 
-7a 
-43 
-ca 
-0f 
-7a 
-43 
-0e 
-00 
-00 
-0f 
-7a 
-43 
-0e 
-00 
-00 
-0f 
-7a 
-41 
-ca 
-0f 
-7a 
-41 
-0e 
-00 
-00 
-0f 
-7a 
-41 
-0e 
-00 
-00 
-0f 
-7a 
-4b 
-ca 
-0f 
-7a 
-4b 
-0e 
-00 
-00 
-0f 
-7a 
-4b 
-0e 
-00 
-00 
-0f 
-7a 
-52 
-ca 
-0f 
-7a 
-52 
-0e 
-00 
-00 
-0f 
-7a 
-52 
-0e 
-00 
-00 
-0f 
-7a 
-53 
-ca 
-0f 
-7a 
-53 
-0e 
-00 
-00 
-0f 
-7a 
-53 
-0e 
-00 
-00 
-0f 
-7a 
-51 
-ca 
-0f 
-7a 
-51 
-0e 
-00 
-00 
-0f 
-7a 
-51 
-0e 
-00 
-00 
-0f 
-7a 
-5b 
-ca 
-0f 
-7a 
-5b 
-0e 
-00 
-00 
-0f 
-7a 
-5b 
-0e 
-00 
-00 
-0f 
-7a 
-56 
-ca 
-0f 
-7a 
-56 
-0e 
-00 
-00 
-0f 
-7a 
-56 
-0e 
-00 
-00 
-0f 
-7a 
-57 
-ca 
-0f 
-7a 
-57 
-0e 
-00 
-00 
-0f 
-7a 
-57 
-0e 
-00 
-00 
-0f 
-7a 
-46 
-ca 
-0f 
-7a 
-46 
-0e 
-00 
-00 
-0f 
-7a 
-46 
-0e 
-00 
-00 
-0f 
-7a 
-47 
-ca 
-0f 
-7a 
-47 
-0e 
-00 
-00 
-0f 
-7a 
-47 
-0e 
-00 
-00 
-0f 
-7a 
-61 
-ca 
-0f 
-7a 
-61 
-0e 
-00 
-00 
-0f 
-7a 
-61 
-0e 
-00 
-00 
-0f 
-7a 
-63 
-ca 
-0f 
-7a 
-63 
-0e 
-00 
-00 
-0f 
-7a 
-63 
-0e 
-00 
-00 
-0f 
-7a 
-62 
-ca 
-0f 
-7a 
-62 
-0e 
-00 
-00 
-0f 
-7a 
-62 
-0e 
-00 
-00 
-0f 
-24 
-9e 
-e7 
-10 
-0f 
-24 
-9e 
-2e 
-20 
-00 
-00 
-0f 
-24 
-9e 
-36 
-30 
-00 
-00 
-0f 
-24 
-9f 
-e7 
-10 
-0f 
-24 
-9f 
-2e 
-20 
-00 
-00 
-0f 
-24 
-9f 
-36 
-30 
-00 
-00 
-0f 
-24 
-97 
-e7 
-10 
-0f 
-24 
-97 
-2e 
-20 
-00 
-00 
-0f 
-24 
-97 
-36 
-30 
-00 
-00 
-0f 
-24 
-8e 
-e7 
-10 
-0f 
-24 
-8e 
-2e 
-20 
-00 
-00 
-0f 
-24 
-8e 
-36 
-30 
-00 
-00 
-0f 
-24 
-8f 
-e7 
-10 
-0f 
-24 
-8f 
-2e 
-20 
-00 
-00 
-0f 
-24 
-8f 
-36 
-30 
-00 
-00 
-0f 
-24 
-87 
-e7 
-10 
-0f 
-24 
-87 
-2e 
-20 
-00 
-00 
-0f 
-24 
-87 
-36 
-30 
-00 
-00 
-0f 
-24 
-86 
-e7 
-10 
-0f 
-24 
-86 
-2e 
-20 
-00 
-00 
-0f 
-24 
-86 
-36 
-30 
-00 
-00 
-0f 
-24 
-85 
-e7 
-10 
-0f 
-24 
-85 
-2e 
-20 
-00 
-00 
-0f 
-24 
-85 
-36 
-30 
-00 
-00 
-0f 
-24 
-96 
-e7 
-10 
-0f 
-24 
-96 
-2e 
-20 
-00 
-00 
-0f 
-24 
-96 
-36 
-30 
-00 
-00 
-0f 
-24 
-95 
-e7 
-10 
-0f 
-24 
-95 
-2e 
-20 
-00 
-00 
-0f 
-24 
-95 
-36 
-30 
-00 
-00 
-0f 
-24 
-a6 
-e7 
-10 
-0f 
-24 
-a6 
-2e 
-20 
-00 
-00 
-0f 
-24 
-a6 
-36 
-30 
-00 
-00 
-0f 
-24 
-b6 
-e7 
-10 
-0f 
-24 
-b6 
-2e 
-20 
-00 
-00 
-0f 
-24 
-b6 
-36 
-30 
-00 
-00 
-0f 
-24 
-23 
-d3 
-10 
-0f 
-24 
-23 
-16 
-10 
-00 
-00 
-0f 
-24 
-23 
-16 
-10 
-00 
-00 
-0f 
-24 
-23 
-1e 
-18 
-00 
-00 
-0f 
-24 
-23 
-1e 
-18 
-00 
-00 
-0f 
-24 
-27 
-d3 
-10 
-0f 
-24 
-27 
-16 
-10 
-00 
-00 
-0f 
-24 
-27 
-16 
-10 
-00 
-00 
-0f 
-24 
-27 
-1e 
-18 
-00 
-00 
-0f 
-24 
-27 
-1e 
-18 
-00 
-00 
-0f 
-24 
-40 
-d3 
-10 
-0f 
-24 
-40 
-16 
-10 
-00 
-00 
-0f 
-24 
-40 
-16 
-10 
-00 
-00 
-0f 
-24 
-40 
-1e 
-18 
-00 
-00 
-0f 
-24 
-40 
-1e 
-18 
-00 
-00 
-0f 
-7b 
-40 
-ca 
-05 
-0f 
-7b 
-40 
-0e 
-00 
-00 
-05 
-0f 
-7b 
-40 
-0e 
-00 
-00 
-05 
-0f 
-24 
-42 
-d3 
-10 
-0f 
-24 
-42 
-16 
-10 
-00 
-00 
-0f 
-24 
-42 
-16 
-10 
-00 
-00 
-0f 
-24 
-42 
-1e 
-18 
-00 
-00 
-0f 
-24 
-42 
-1e 
-18 
-00 
-00 
-0f 
-7b 
-42 
-ca 
-05 
-0f 
-7b 
-42 
-0e 
-00 
-00 
-05 
-0f 
-7b 
-42 
-0e 
-00 
-00 
-05 
-0f 
-24 
-43 
-d3 
-10 
-0f 
-24 
-43 
-16 
-10 
-00 
-00 
-0f 
-24 
-43 
-16 
-10 
-00 
-00 
-0f 
-24 
-43 
-1e 
-18 
-00 
-00 
-0f 
-24 
-43 
-1e 
-18 
-00 
-00 
-0f 
-7b 
-43 
-ca 
-05 
-0f 
-7b 
-43 
-0e 
-00 
-00 
-05 
-0f 
-7b 
-43 
-0e 
-00 
-00 
-05 
-0f 
-24 
-41 
-d3 
-10 
-0f 
-24 
-41 
-16 
-10 
-00 
-00 
-0f 
-24 
-41 
-16 
-10 
-00 
-00 
-0f 
-24 
-41 
-1e 
-18 
-00 
-00 
-0f 
-24 
-41 
-1e 
-18 
-00 
-00 
-0f 
-7b 
-41 
-ca 
-05 
-0f 
-7b 
-41 
-0e 
-00 
-00 
-05 
-0f 
-7b 
-41 
-0e 
-00 
-00 
-05 
-0f 
-24 
-48 
-d3 
-10 
-0f 
-24 
-48 
-16 
-10 
-00 
-00 
-0f 
-24 
-48 
-16 
-10 
-00 
-00 
-0f 
-24 
-48 
-1e 
-18 
-00 
-00 
-0f 
-24 
-48 
-1e 
-18 
-00 
-00 
-0f 
-24 
-4a 
-d3 
-10 
-0f 
-24 
-4a 
-16 
-10 
-00 
-00 
-0f 
-24 
-4a 
-16 
-10 
-00 
-00 
-0f 
-24 
-4a 
-1e 
-18 
-00 
-00 
-0f 
-24 
-4a 
-1e 
-18 
-00 
-00 
-0f 
-24 
-4b 
-d3 
-10 
-0f 
-24 
-4b 
-16 
-10 
-00 
-00 
-0f 
-24 
-4b 
-16 
-10 
-00 
-00 
-0f 
-24 
-4b 
-1e 
-18 
-00 
-00 
-0f 
-24 
-4b 
-1e 
-18 
-00 
-00 
-0f 
-24 
-49 
-d3 
-10 
-0f 
-24 
-49 
-16 
-10 
-00 
-00 
-0f 
-24 
-49 
-16 
-10 
-00 
-00 
-0f 
-24 
-49 
-1e 
-18 
-00 
-00 
-0f 
-24 
-49 
-1e 
-18 
-00 
-00 
-0f 
-24 
-44 
-d3 
-10 
-0f 
-24 
-44 
-16 
-10 
-00 
-00 
-0f 
-24 
-44 
-16 
-10 
-00 
-00 
-0f 
-24 
-44 
-1e 
-18 
-00 
-00 
-0f 
-24 
-44 
-1e 
-18 
-00 
-00 
-0f 
-24 
-46 
-d3 
-10 
-0f 
-24 
-46 
-16 
-10 
-00 
-00 
-0f 
-24 
-46 
-16 
-10 
-00 
-00 
-0f 
-24 
-46 
-1e 
-18 
-00 
-00 
-0f 
-24 
-46 
-1e 
-18 
-00 
-00 
-0f 
-24 
-47 
-d3 
-10 
-0f 
-24 
-47 
-16 
-10 
-00 
-00 
-0f 
-24 
-47 
-16 
-10 
-00 
-00 
-0f 
-24 
-47 
-1e 
-18 
-00 
-00 
-0f 
-24 
-47 
-1e 
-18 
-00 
-00 
-0f 
-24 
-45 
-d3 
-10 
-0f 
-24 
-45 
-16 
-10 
-00 
-00 
-0f 
-24 
-45 
-16 
-10 
-00 
-00 
-0f 
-24 
-45 
-1e 
-18 
-00 
-00 
-0f 
-24 
-45 
-1e 
-18 
-00 
-00 
-66 
-0f 
-38 
-17 
-ca 
-66 
-0f 
-38 
-17 
-0e 
-00 
-00 
-66 
-0f 
-38 
-17 
-0e 
-00 
-00 
-66 
-0f 
-3a 
-09 
-ca 
-05 
-66 
-0f 
-3a 
-09 
-0e 
-00 
-00 
-05 
-66 
-0f 
-3a 
-09 
-0e 
-00 
-00 
-05 
-66 
-0f 
-3a 
-08 
-ca 
-05 
-66 
-0f 
-3a 
-08 
-0e 
-00 
-00 
-05 
-66 
-0f 
-3a 
-08 
-0e 
-00 
-00 
-05 
-66 
-0f 
-3a 
-0b 
-ca 
-05 
-66 
-0f 
-3a 
-0b 
-0e 
-00 
-00 
-05 
-66 
-0f 
-3a 
-0b 
-0e 
-00 
-00 
-05 
-66 
-0f 
-3a 
-0a 
-ca 
-05 
-66 
-0f 
-3a 
-0a 
-0e 
-00 
-00 
-05 
-66 
-0f 
-3a 
-0a 
-0e 
-00 
-00 
-05 
diff --git a/modules/arch/x86/tests/sse5-basic.asm b/modules/arch/x86/tests/sse5-basic.asm
deleted file mode 100644
index ed79e77..0000000
--- a/modules/arch/x86/tests/sse5-basic.asm
+++ /dev/null
@@ -1,12 +0,0 @@
-[bits 32]
-compd xmm1, xmm4, xmm7, 5			; 0F 25 2D 347 10 05
-compd xmm2, xmm5, [0], byte 5			; 0F 25 2D 055 20 00 00 00 00 05
-compd xmm3, xmm6, dqword [ebx+ecx*4], byte 5	; 0F 25 2D 064 213 30 05
-
-[bits 64]
-compd xmm8, xmm11, xmm3, 5			; 0F 25 2D 333 84 05
-compd xmm12, xmm4, xmm14, 5			; 0F 25 2D 346 C1 05
-compd xmm9, xmm12, [0], byte 5			; 0F 25 2D 044 045 94 00 00 00 00 05
-compd xmm9, xmm12, [r8], byte 5			; 0F 25 2D 040 95 05
-compd xmm10, xmm13, dqword [rbx+r9*4], 5	; 0F 25 2D 054 213 A6 05
-
diff --git a/modules/arch/x86/tests/sse5-basic.hex b/modules/arch/x86/tests/sse5-basic.hex
deleted file mode 100644
index 2d6c87b..0000000
--- a/modules/arch/x86/tests/sse5-basic.hex
+++ /dev/null
@@ -1,59 +0,0 @@
-0f 
-25 
-2d 
-e7 
-10 
-05 
-0f 
-25 
-2d 
-2d 
-20 
-00 
-00 
-00 
-00 
-05 
-0f 
-25 
-2d 
-34 
-8b 
-30 
-05 
-0f 
-25 
-2d 
-db 
-84 
-05 
-0f 
-25 
-2d 
-e6 
-c1 
-05 
-0f 
-25 
-2d 
-24 
-25 
-94 
-00 
-00 
-00 
-00 
-05 
-0f 
-25 
-2d 
-20 
-95 
-05 
-0f 
-25 
-2d 
-2c 
-8b 
-a6 
-05 
diff --git a/modules/arch/x86/tests/sse5-cc.asm b/modules/arch/x86/tests/sse5-cc.asm
deleted file mode 100644
index 309f500..0000000
--- a/modules/arch/x86/tests/sse5-cc.asm
+++ /dev/null
@@ -1,49 +0,0 @@
-[bits 16]
-comeqpd xmm1, xmm2, xmm3	; 0F 25 2D 323 10 00
-comltpd xmm1, xmm2, xmm3	; 0F 25 2D 323 10 01
-comungepd xmm1, xmm2, xmm3	; 0F 25 2D 323 10 01
-comlepd xmm1, xmm2, xmm3	; 0F 25 2D 323 10 02
-comungtpd xmm1, xmm2, xmm3	; 0F 25 2D 323 10 02
-comunordpd xmm1, xmm2, xmm3	; 0F 25 2D 323 10 03
-comnepd xmm1, xmm2, xmm3	; 0F 25 2D 323 10 04
-comneqpd xmm1, xmm2, xmm3	; 0F 25 2D 323 10 04
-comnltpd xmm1, xmm2, xmm3	; 0F 25 2D 323 10 05
-comugepd xmm1, xmm2, xmm3	; 0F 25 2D 323 10 05
-comnlepd xmm1, xmm2, xmm3	; 0F 25 2D 323 10 06
-comugtpd xmm1, xmm2, xmm3	; 0F 25 2D 323 10 06
-comordpd xmm1, xmm2, xmm3	; 0F 25 2D 323 10 07
-comueqpd xmm1, xmm2, xmm3	; 0F 25 2D 323 10 08
-comultpd xmm1, xmm2, xmm3	; 0F 25 2D 323 10 09
-comngepd xmm1, xmm2, xmm3	; 0F 25 2D 323 10 09
-comulepd xmm1, xmm2, xmm3	; 0F 25 2D 323 10 0A
-comngtpd xmm1, xmm2, xmm3	; 0F 25 2D 323 10 0A
-comfalsepd xmm1, xmm2, xmm3	; 0F 25 2D 323 10 0B
-comunepd xmm1, xmm2, xmm3	; 0F 25 2D 323 10 0C
-comuneqpd xmm1, xmm2, xmm3	; 0F 25 2D 323 10 0C
-comunltpd xmm1, xmm2, xmm3	; 0F 25 2D 323 10 0D
-comgepd xmm1, xmm2, xmm3	; 0F 25 2D 323 10 0D
-comunlepd xmm1, xmm2, xmm3	; 0F 25 2D 323 10 0E
-comgtpd xmm1, xmm2, xmm3	; 0F 25 2D 323 10 0E
-comtruepd xmm1, xmm2, xmm3	; 0F 25 2D 323 10 0F
-
-pcomltb xmm1, xmm2, xmm3	; 0F 25 4C 323 10 00
-pcomleb xmm1, xmm2, xmm3	; 0F 25 4C 323 10 01
-pcomgtb xmm1, xmm2, xmm3	; 0F 25 4C 323 10 02
-pcomgeb xmm1, xmm2, xmm3	; 0F 25 4C 323 10 03
-pcomeqb xmm1, xmm2, xmm3	; 0F 25 4C 323 10 04
-pcomneqb xmm1, xmm2, xmm3	; 0F 25 4C 323 10 05
-pcomneb xmm1, xmm2, xmm3	; 0F 25 4C 323 10 05
-pcomfalseb xmm1, xmm2, xmm3	; 0F 25 4C 323 10 06
-pcomtrueb xmm1, xmm2, xmm3	; 0F 25 4C 323 10 07
-
-pcomltub xmm1, xmm2, xmm3	; 0F 25 6C 323 10 00
-pcomleub xmm1, xmm2, xmm3	; 0F 25 6C 323 10 01
-pcomgtub xmm1, xmm2, xmm3	; 0F 25 6C 323 10 02
-pcomgeub xmm1, xmm2, xmm3	; 0F 25 6C 323 10 03
-pcomequb xmm1, xmm2, xmm3	; 0F 25 6C 323 10 04
-pcomnequb xmm1, xmm2, xmm3	; 0F 25 6C 323 10 05
-pcomneub xmm1, xmm2, xmm3	; 0F 25 6C 323 10 05
-pcomfalseub xmm1, xmm2, xmm3	; 0F 25 6C 323 10 06
-pcomtrueub xmm1, xmm2, xmm3	; 0F 25 6C 323 10 07
-
-
diff --git a/modules/arch/x86/tests/sse5-cc.hex b/modules/arch/x86/tests/sse5-cc.hex
deleted file mode 100644
index d41b9cf..0000000
--- a/modules/arch/x86/tests/sse5-cc.hex
+++ /dev/null
@@ -1,264 +0,0 @@
-0f 
-25 
-2d 
-d3 
-10 
-00 
-0f 
-25 
-2d 
-d3 
-10 
-01 
-0f 
-25 
-2d 
-d3 
-10 
-01 
-0f 
-25 
-2d 
-d3 
-10 
-02 
-0f 
-25 
-2d 
-d3 
-10 
-02 
-0f 
-25 
-2d 
-d3 
-10 
-03 
-0f 
-25 
-2d 
-d3 
-10 
-04 
-0f 
-25 
-2d 
-d3 
-10 
-04 
-0f 
-25 
-2d 
-d3 
-10 
-05 
-0f 
-25 
-2d 
-d3 
-10 
-05 
-0f 
-25 
-2d 
-d3 
-10 
-06 
-0f 
-25 
-2d 
-d3 
-10 
-06 
-0f 
-25 
-2d 
-d3 
-10 
-07 
-0f 
-25 
-2d 
-d3 
-10 
-08 
-0f 
-25 
-2d 
-d3 
-10 
-09 
-0f 
-25 
-2d 
-d3 
-10 
-09 
-0f 
-25 
-2d 
-d3 
-10 
-0a 
-0f 
-25 
-2d 
-d3 
-10 
-0a 
-0f 
-25 
-2d 
-d3 
-10 
-0b 
-0f 
-25 
-2d 
-d3 
-10 
-0c 
-0f 
-25 
-2d 
-d3 
-10 
-0c 
-0f 
-25 
-2d 
-d3 
-10 
-0d 
-0f 
-25 
-2d 
-d3 
-10 
-0d 
-0f 
-25 
-2d 
-d3 
-10 
-0e 
-0f 
-25 
-2d 
-d3 
-10 
-0e 
-0f 
-25 
-2d 
-d3 
-10 
-0f 
-0f 
-25 
-4c 
-d3 
-10 
-00 
-0f 
-25 
-4c 
-d3 
-10 
-01 
-0f 
-25 
-4c 
-d3 
-10 
-02 
-0f 
-25 
-4c 
-d3 
-10 
-03 
-0f 
-25 
-4c 
-d3 
-10 
-04 
-0f 
-25 
-4c 
-d3 
-10 
-05 
-0f 
-25 
-4c 
-d3 
-10 
-05 
-0f 
-25 
-4c 
-d3 
-10 
-06 
-0f 
-25 
-4c 
-d3 
-10 
-07 
-0f 
-25 
-6c 
-d3 
-10 
-00 
-0f 
-25 
-6c 
-d3 
-10 
-01 
-0f 
-25 
-6c 
-d3 
-10 
-02 
-0f 
-25 
-6c 
-d3 
-10 
-03 
-0f 
-25 
-6c 
-d3 
-10 
-04 
-0f 
-25 
-6c 
-d3 
-10 
-05 
-0f 
-25 
-6c 
-d3 
-10 
-05 
-0f 
-25 
-6c 
-d3 
-10 
-06 
-0f 
-25 
-6c 
-d3 
-10 
-07 
diff --git a/modules/arch/x86/tests/sse5-err.asm b/modules/arch/x86/tests/sse5-err.asm
deleted file mode 100644
index 93b474f..0000000
--- a/modules/arch/x86/tests/sse5-err.asm
+++ /dev/null
@@ -1,116 +0,0 @@
-fmaddpd xmm1, xmm2, xmm1, xmm3		; illegal
-fmaddpd xmm1, xmm2, xmm3, xmm3		; illegal
-fmaddpd xmm1, xmm2, xmm2, xmm3		; illegal
-
-fmaddps xmm1, xmm2, xmm1, xmm3		; illegal
-fmaddps xmm1, xmm2, xmm3, xmm3		; illegal
-fmaddps xmm1, xmm2, xmm2, xmm3		; illegal
-
-fmaddsd xmm1, xmm2, xmm1, xmm3		; illegal
-fmaddsd xmm1, xmm2, xmm3, xmm3		; illegal
-fmaddsd xmm1, xmm2, xmm2, xmm3		; illegal
-
-fmaddss xmm1, xmm2, xmm1, xmm3		; illegal
-fmaddss xmm1, xmm2, xmm3, xmm3		; illegal
-fmaddss xmm1, xmm2, xmm2, xmm3		; illegal
-
-fmsubpd xmm1, xmm2, xmm1, xmm3		; illegal
-fmsubpd xmm1, xmm2, xmm3, xmm3		; illegal
-fmsubpd xmm1, xmm2, xmm2, xmm3		; illegal
-
-fmsubps xmm1, xmm2, xmm1, xmm3		; illegal
-fmsubps xmm1, xmm2, xmm3, xmm3		; illegal
-fmsubps xmm1, xmm2, xmm2, xmm3		; illegal
-
-fmsubsd xmm1, xmm2, xmm1, xmm3		; illegal
-fmsubsd xmm1, xmm2, xmm3, xmm3		; illegal
-fmsubsd xmm1, xmm2, xmm2, xmm3		; illegal
-
-fmsubss xmm1, xmm2, xmm1, xmm3		; illegal
-fmsubss xmm1, xmm2, xmm3, xmm3		; illegal
-fmsubss xmm1, xmm2, xmm2, xmm3		; illegal
-
-fnmaddpd xmm1, xmm2, xmm1, xmm3		; illegal
-fnmaddpd xmm1, xmm2, xmm3, xmm3		; illegal
-fnmaddpd xmm1, xmm2, xmm2, xmm3		; illegal
-
-fnmaddps xmm1, xmm2, xmm1, xmm3		; illegal
-fnmaddps xmm1, xmm2, xmm3, xmm3		; illegal
-fnmaddps xmm1, xmm2, xmm2, xmm3		; illegal
-
-fnmaddsd xmm1, xmm2, xmm1, xmm3		; illegal
-fnmaddsd xmm1, xmm2, xmm3, xmm3		; illegal
-fnmaddsd xmm1, xmm2, xmm2, xmm3		; illegal
-
-fnmaddss xmm1, xmm2, xmm1, xmm3		; illegal
-fnmaddss xmm1, xmm2, xmm3, xmm3		; illegal
-fnmaddss xmm1, xmm2, xmm2, xmm3		; illegal
-
-fnmsubpd xmm1, xmm2, xmm1, xmm3		; illegal
-fnmsubpd xmm1, xmm2, xmm3, xmm3		; illegal
-fnmsubpd xmm1, xmm2, xmm2, xmm3		; illegal
-
-fnmsubps xmm1, xmm2, xmm1, xmm3		; illegal
-fnmsubps xmm1, xmm2, xmm3, xmm3		; illegal
-fnmsubps xmm1, xmm2, xmm2, xmm3		; illegal
-
-fnmsubsd xmm1, xmm2, xmm1, xmm3		; illegal
-fnmsubsd xmm1, xmm2, xmm3, xmm3		; illegal
-fnmsubsd xmm1, xmm2, xmm2, xmm3		; illegal
-
-fnmsubss xmm1, xmm2, xmm1, xmm3		; illegal
-fnmsubss xmm1, xmm2, xmm3, xmm3		; illegal
-fnmsubss xmm1, xmm2, xmm2, xmm3		; illegal
-
-pcmov xmm1, xmm2, xmm1, xmm3		; illegal
-pcmov xmm1, xmm2, xmm3, xmm3		; illegal
-pcmov xmm1, xmm2, xmm2, xmm3		; illegal
-
-permpd xmm1, xmm2, xmm1, xmm3		; illegal
-permpd xmm1, xmm2, xmm3, xmm3		; illegal
-permpd xmm1, xmm2, xmm2, xmm3		; illegal
-
-permps xmm1, xmm2, xmm1, xmm3		; illegal
-permps xmm1, xmm2, xmm3, xmm3		; illegal
-permps xmm1, xmm2, xmm2, xmm3		; illegal
-
-pmacsdd xmm1, xmm2, xmm1, xmm3		; illegal
-pmacsdd xmm1, xmm1, xmm2, xmm3		; illegal - better message?
-
-pmacsdqh xmm1, xmm2, xmm1, xmm3		; illegal
-pmacsdqh xmm1, xmm1, xmm2, xmm3		; illegal - better message?
-
-pmacsdql xmm1, xmm2, xmm1, xmm3		; illegal
-pmacsdql xmm1, xmm1, xmm2, xmm3		; illegal - better message?
-
-pmacssdd xmm1, xmm2, xmm1, xmm3		; illegal
-pmacssdd xmm1, xmm1, xmm2, xmm3		; illegal - better message?
-
-pmacssdqh xmm1, xmm2, xmm1, xmm3	; illegal
-pmacssdqh xmm1, xmm1, xmm2, xmm3	; illegal - better message?
-
-pmacssdql xmm1, xmm2, xmm1, xmm3	; illegal
-pmacssdql xmm1, xmm1, xmm2, xmm3	; illegal - better message?
-
-pmacsswd xmm1, xmm2, xmm1, xmm3		; illegal
-pmacsswd xmm1, xmm1, xmm2, xmm3		; illegal - better message?
-
-pmacssww xmm1, xmm2, xmm1, xmm3		; illegal
-pmacssww xmm1, xmm1, xmm2, xmm3		; illegal - better message?
-
-pmacswd xmm1, xmm2, xmm1, xmm3		; illegal
-pmacswd xmm1, xmm1, xmm2, xmm3		; illegal - better message?
-
-pmacsww xmm1, xmm2, xmm1, xmm3		; illegal
-pmacsww xmm1, xmm1, xmm2, xmm3		; illegal - better message?
-
-pmadcsswd xmm1, xmm2, xmm1, xmm3	; illegal
-pmadcsswd xmm1, xmm1, xmm2, xmm3	; illegal - better message?
-
-pmadcswd xmm1, xmm2, xmm1, xmm3		; illegal
-pmadcswd xmm1, xmm1, xmm2, xmm3		; illegal - better message?
-
-pperm xmm1, xmm2, xmm1, xmm3		; illegal
-pperm xmm1, xmm2, xmm3, xmm3		; illegal
-pperm xmm1, xmm2, xmm2, xmm3		; illegal
-
diff --git a/modules/arch/x86/tests/sse5-err.errwarn b/modules/arch/x86/tests/sse5-err.errwarn
deleted file mode 100644
index 3c76880..0000000
--- a/modules/arch/x86/tests/sse5-err.errwarn
+++ /dev/null
@@ -1,84 +0,0 @@
--:1: error: one of source operand 1 or 3 must match dest operand
--:2: error: one of source operand 1 or 3 must match dest operand
--:3: error: one of source operand 1 or 3 must match dest operand
--:5: error: one of source operand 1 or 3 must match dest operand
--:6: error: one of source operand 1 or 3 must match dest operand
--:7: error: one of source operand 1 or 3 must match dest operand
--:9: error: one of source operand 1 or 3 must match dest operand
--:10: error: one of source operand 1 or 3 must match dest operand
--:11: error: one of source operand 1 or 3 must match dest operand
--:13: error: one of source operand 1 or 3 must match dest operand
--:14: error: one of source operand 1 or 3 must match dest operand
--:15: error: one of source operand 1 or 3 must match dest operand
--:17: error: one of source operand 1 or 3 must match dest operand
--:18: error: one of source operand 1 or 3 must match dest operand
--:19: error: one of source operand 1 or 3 must match dest operand
--:21: error: one of source operand 1 or 3 must match dest operand
--:22: error: one of source operand 1 or 3 must match dest operand
--:23: error: one of source operand 1 or 3 must match dest operand
--:25: error: one of source operand 1 or 3 must match dest operand
--:26: error: one of source operand 1 or 3 must match dest operand
--:27: error: one of source operand 1 or 3 must match dest operand
--:29: error: one of source operand 1 or 3 must match dest operand
--:30: error: one of source operand 1 or 3 must match dest operand
--:31: error: one of source operand 1 or 3 must match dest operand
--:33: error: one of source operand 1 or 3 must match dest operand
--:34: error: one of source operand 1 or 3 must match dest operand
--:35: error: one of source operand 1 or 3 must match dest operand
--:37: error: one of source operand 1 or 3 must match dest operand
--:38: error: one of source operand 1 or 3 must match dest operand
--:39: error: one of source operand 1 or 3 must match dest operand
--:41: error: one of source operand 1 or 3 must match dest operand
--:42: error: one of source operand 1 or 3 must match dest operand
--:43: error: one of source operand 1 or 3 must match dest operand
--:45: error: one of source operand 1 or 3 must match dest operand
--:46: error: one of source operand 1 or 3 must match dest operand
--:47: error: one of source operand 1 or 3 must match dest operand
--:49: error: one of source operand 1 or 3 must match dest operand
--:50: error: one of source operand 1 or 3 must match dest operand
--:51: error: one of source operand 1 or 3 must match dest operand
--:53: error: one of source operand 1 or 3 must match dest operand
--:54: error: one of source operand 1 or 3 must match dest operand
--:55: error: one of source operand 1 or 3 must match dest operand
--:57: error: one of source operand 1 or 3 must match dest operand
--:58: error: one of source operand 1 or 3 must match dest operand
--:59: error: one of source operand 1 or 3 must match dest operand
--:61: error: one of source operand 1 or 3 must match dest operand
--:62: error: one of source operand 1 or 3 must match dest operand
--:63: error: one of source operand 1 or 3 must match dest operand
--:65: error: one of source operand 1 or 3 must match dest operand
--:66: error: one of source operand 1 or 3 must match dest operand
--:67: error: one of source operand 1 or 3 must match dest operand
--:69: error: one of source operand 1 or 3 must match dest operand
--:70: error: one of source operand 1 or 3 must match dest operand
--:71: error: one of source operand 1 or 3 must match dest operand
--:73: error: one of source operand 1 or 3 must match dest operand
--:74: error: one of source operand 1 or 3 must match dest operand
--:75: error: one of source operand 1 or 3 must match dest operand
--:77: error: one of source operand 1 or 3 must match dest operand
--:78: error: one of source operand 1 or 3 must match dest operand
--:80: error: one of source operand 1 or 3 must match dest operand
--:81: error: one of source operand 1 or 3 must match dest operand
--:83: error: one of source operand 1 or 3 must match dest operand
--:84: error: one of source operand 1 or 3 must match dest operand
--:86: error: one of source operand 1 or 3 must match dest operand
--:87: error: one of source operand 1 or 3 must match dest operand
--:89: error: one of source operand 1 or 3 must match dest operand
--:90: error: one of source operand 1 or 3 must match dest operand
--:92: error: one of source operand 1 or 3 must match dest operand
--:93: error: one of source operand 1 or 3 must match dest operand
--:95: error: one of source operand 1 or 3 must match dest operand
--:96: error: one of source operand 1 or 3 must match dest operand
--:98: error: one of source operand 1 or 3 must match dest operand
--:99: error: one of source operand 1 or 3 must match dest operand
--:101: error: one of source operand 1 or 3 must match dest operand
--:102: error: one of source operand 1 or 3 must match dest operand
--:104: error: one of source operand 1 or 3 must match dest operand
--:105: error: one of source operand 1 or 3 must match dest operand
--:107: error: one of source operand 1 or 3 must match dest operand
--:108: error: one of source operand 1 or 3 must match dest operand
--:110: error: one of source operand 1 or 3 must match dest operand
--:111: error: one of source operand 1 or 3 must match dest operand
--:113: error: one of source operand 1 or 3 must match dest operand
--:114: error: one of source operand 1 or 3 must match dest operand
--:115: error: one of source operand 1 or 3 must match dest operand
diff --git a/modules/arch/x86/tests/vsib-err.asm b/modules/arch/x86/tests/vsib-err.asm
new file mode 100644
index 0000000..ee30603
--- /dev/null
+++ b/modules/arch/x86/tests/vsib-err.asm
@@ -0,0 +1,14 @@
+; Errors caught during instruction matching
+
+[bits 64]
+
+vpgatherdq xmm0,xmm0,xmm0 ; no reg EA template
+
+vpgatherdq xmm0,[ymm0],xmm0 ; not a VSIB256 template
+vpgatherqq ymm0,[xmm0],ymm0 ; not a VSIB128 template
+
+vpgatherdq xmm0,[rel 0],xmm0
+vpgatherdq xmm0,[0],xmm0
+vpgatherdq xmm0,[rax],xmm0
+vpgatherdq xmm0,[rax+rbx],xmm0
+
diff --git a/modules/arch/x86/tests/vsib-err.errwarn b/modules/arch/x86/tests/vsib-err.errwarn
new file mode 100644
index 0000000..8d2d084
--- /dev/null
+++ b/modules/arch/x86/tests/vsib-err.errwarn
@@ -0,0 +1,7 @@
+-:5: error: invalid combination of opcode and operands
+-:7: error: invalid combination of opcode and operands
+-:8: error: invalid combination of opcode and operands
+-:10: error: invalid combination of opcode and operands
+-:11: error: invalid combination of opcode and operands
+-:12: error: invalid combination of opcode and operands
+-:13: error: invalid combination of opcode and operands
diff --git a/modules/arch/x86/tests/vsib.asm b/modules/arch/x86/tests/vsib.asm
new file mode 100644
index 0000000..fc2a705
--- /dev/null
+++ b/modules/arch/x86/tests/vsib.asm
@@ -0,0 +1,114 @@
+[bits 16]
+; test promotion to 32-bit address size
+vpgatherdq xmm0,[xmm0],xmm0		; 67 c4 e2 f9 90 04 05 00 00 00 00
+vpgatherqq ymm0,[ymm0],ymm0		; 67 c4 e2 fd 91 04 05 00 00 00 00
+
+[bits 32]
+; test promotion from base to index
+vpgatherdq xmm0,[xmm0],xmm0		; c4 e2 f9 90 04 05 00 00 00 00
+vpgatherqq ymm0,[ymm0],ymm0		; c4 e2 fd 91 04 05 00 00 00 00
+
+; various combinations
+vpgatherdq xmm0,[ecx+xmm5],xmm0		; c4 e2 f9 90 04 29
+vpgatherqq ymm0,[ecx+ymm5],ymm0		; c4 e2 fd 91 04 29
+vpgatherdq xmm0,[ebp+xmm5],xmm0		; c4 e2 f9 90 44 2d 00
+vpgatherqq ymm0,[ebp+ymm5],ymm0		; c4 e2 fd 91 44 2d 00
+ 
+vpgatherdq xmm0,[xmm5+ecx],xmm0		; c4 e2 f9 90 04 29
+vpgatherqq ymm0,[ymm5+ecx],ymm0		; c4 e2 fd 91 04 29
+vpgatherdq xmm0,[xmm5+ebp],xmm0		; c4 e2 f9 90 44 2d 00
+vpgatherqq ymm0,[ymm5+ebp],ymm0		; c4 e2 fd 91 44 2d 00
+
+vpgatherdq xmm0,[ecx+xmm5*1],xmm0	; c4 e2 f9 90 04 29
+vpgatherqq ymm0,[ecx+ymm5*1],ymm0	; c4 e2 fd 91 04 29
+vpgatherdq xmm0,[ebp+xmm5*1],xmm0	; c4 e2 f9 90 44 2d 00
+vpgatherqq ymm0,[ebp+ymm5*1],ymm0	; c4 e2 fd 91 44 2d 00
+
+vpgatherdq xmm0,[xmm5+ecx*1],xmm0	; c4 e2 f9 90 04 29
+vpgatherqq ymm0,[ymm5+ecx*1],ymm0	; c4 e2 fd 91 04 29
+vpgatherdq xmm0,[xmm5+ebp*1],xmm0	; c4 e2 f9 90 44 2d 00
+vpgatherqq ymm0,[ymm5+ebp*1],ymm0	; c4 e2 fd 91 44 2d 00
+
+vpgatherdq xmm0,[nosplit 12345678h + xmm5*1],xmm0; c4 e2 f9 90 04 2d 78 56 34 12
+vpgatherqq ymm0,[nosplit 12345678h + ymm5*1],ymm0; c4 e2 fd 91 04 2d 78 56 34 12
+
+vpgatherdq xmm0,[byte ecx + 12 + xmm5*2],xmm0	; c4 e2 f9 90 44 69 0c
+vpgatherqq ymm0,[byte ecx + 12 + ymm5*2],ymm0	; c4 e2 fd 91 44 69 0c
+vpgatherdq xmm0,[byte ebp + 12 + xmm5*2],xmm0	; c4 e2 f9 90 44 6d 0c
+vpgatherqq ymm0,[byte ebp + 12 + ymm5*2],ymm0	; c4 e2 fd 91 44 6d 0c
+
+vpgatherdq xmm0,[dword ecx + 12 + xmm5*4],xmm0	; c4 e2 f9 90 84 a9 0c 00 00 00
+vpgatherqq ymm0,[dword ecx + 12 + ymm5*4],ymm0	; c4 e2 fd 91 84 a9 0c 00 00 00
+vpgatherdq xmm0,[dword ebp + 12 + xmm5*4],xmm0	; c4 e2 f9 90 84 ad 0c 00 00 00
+vpgatherqq ymm0,[dword ebp + 12 + ymm5*4],ymm0	; c4 e2 fd 91 84 ad 0c 00 00 00
+
+vpgatherdq xmm0,[ecx + 12345678h + xmm5*4],xmm0	; c4 e2 f9 90 84 a9 78 56 34 12
+vpgatherqq ymm0,[ecx + 12345678h + ymm5*4],ymm0	; c4 e2 fd 91 84 a9 78 56 34 12
+vpgatherdq xmm0,[ebp + 12345678h + xmm5*4],xmm0	; c4 e2 f9 90 84 ad 78 56 34 12
+vpgatherqq ymm0,[ebp + 12345678h + ymm5*4],ymm0	; c4 e2 fd 91 84 ad 78 56 34 12
+
+vpgatherdq xmm0,[ecx + 12 + xmm5*4],xmm0	; c4 e2 f9 90 44 a9 0c
+vpgatherqq ymm0,[ecx + 12 + ymm5*4],ymm0	; c4 e2 fd 91 44 a9 0c
+vpgatherdq xmm0,[ebp + 12 + xmm5*4],xmm0	; c4 e2 f9 90 44 ad 0c
+vpgatherqq ymm0,[ebp + 12 + ymm5*4],ymm0	; c4 e2 fd 91 44 ad 0c
+
+vpgatherdq xmm0,[dword 12 + xmm5*8],xmm0	; c4 e2 f9 90 04 ed 0c 00 00 00
+vpgatherqq ymm0,[dword 12 + ymm5*8],ymm0	; c4 e2 fd 91 04 ed 0c 00 00 00
+vpgatherdq xmm0,[12 + xmm5*8],xmm0		; c4 e2 f9 90 04 ed 0c 00 00 00
+vpgatherqq ymm0,[12 + ymm5*8],ymm0		; c4 e2 fd 91 04 ed 0c 00 00 00
+
+[bits 64]
+; test promotion from base to index
+vpgatherdq xmm0,[xmm0],xmm0		; c4 e2 f9 90 04 05 00 00 00 00
+vpgatherqq ymm0,[ymm0],ymm0		; c4 e2 fd 91 04 05 00 00 00 00
+
+; various combinations
+vpgatherdq xmm0,[rcx+xmm5],xmm0		; c4 e2 f9 90 04 29
+vpgatherqq ymm0,[rcx+ymm13],ymm0	; c4 a2 fd 91 04 29
+vpgatherdq xmm0,[r13+xmm13],xmm0	; c4 82 f9 90 44 2d 00
+vpgatherqq ymm0,[r13+ymm5],ymm0		; c4 c2 fd 91 44 2d 00
+ 
+vpgatherdq xmm0,[xmm5+rcx],xmm0		; c4 e2 f9 90 04 29
+vpgatherqq ymm0,[ymm13+rcx],ymm0	; c4 a2 fd 91 04 29
+vpgatherdq xmm0,[xmm13+r13],xmm0	; c4 82 f9 90 44 2d 00
+vpgatherqq ymm0,[ymm5+r13],ymm0		; c4 c2 fd 91 44 2d 00
+
+vpgatherdq xmm0,[rcx+xmm5*1],xmm0	; c4 e2 f9 90 04 29
+vpgatherqq ymm0,[rcx+ymm13*1],ymm0	; c4 a2 fd 91 04 29
+vpgatherdq xmm0,[r13+xmm13*1],xmm0	; c4 82 f9 90 44 2d 00
+vpgatherqq ymm0,[r13+ymm5*1],ymm0	; c4 c2 fd 91 44 2d 00
+
+vpgatherdq xmm0,[xmm5+rcx*1],xmm0	; c4 e2 f9 90 04 29
+vpgatherqq ymm0,[ymm13+rcx*1],ymm0	; c4 a2 fd 91 04 29
+vpgatherdq xmm0,[xmm13+r13*1],xmm0	; c4 82 f9 90 44 2d 00
+vpgatherqq ymm0,[ymm5+r13*1],ymm0	; c4 c2 fd 91 44 2d 00
+
+vpgatherdq xmm0,[nosplit 12345678h + xmm5*1],xmm0; c4 e2 f9 90 04 2d 78 56 34 12
+vpgatherqq ymm0,[nosplit 12345678h + ymm5*1],ymm0; c4 e2 fd 91 04 2d 78 56 34 12
+
+vpgatherdq xmm0,[byte rcx + 12 + xmm5*2],xmm0	; c4 e2 f9 90 44 69 0c
+vpgatherqq ymm0,[byte rcx + 12 + ymm13*2],ymm0	; c4 a2 fd 91 44 69 0c
+vpgatherdq xmm0,[byte r13 + 12 + xmm13*2],xmm0	; c4 82 f9 90 44 6d 0c
+vpgatherqq ymm0,[byte r13 + 12 + ymm5*2],ymm0	; c4 c2 fd 91 44 6d 0c
+
+vpgatherdq xmm0,[dword rcx + 12 + xmm5*4],xmm0	; c4 e2 f9 90 84 a9 0c 00 00 00
+vpgatherqq ymm0,[dword rcx + 12 + ymm13*4],ymm0	; c4 a2 fd 91 84 a9 0c 00 00 00
+vpgatherdq xmm0,[dword r13 + 12 + xmm13*4],xmm0	; c4 82 f9 90 84 ad 0c 00 00 00
+vpgatherqq ymm0,[dword r13 + 12 + ymm5*4],ymm0	; c4 c2 fd 91 84 ad 0c 00 00 00
+
+vpgatherdq xmm0,[rcx + 12345678h + xmm5*4],xmm0	; c4 e2 f9 90 84 a9 78 56 34 12
+vpgatherqq ymm0,[rcx + 12345678h + ymm13*4],ymm0; c4 a2 fd 91 84 a9 78 56 34 12
+vpgatherdq xmm0,[r13 + 12345678h + xmm13*4],xmm0; c4 82 f9 90 84 ad 78 56 34 12
+vpgatherqq ymm0,[r13 + 12345678h + ymm5*4],ymm0	; c4 c2 fd 91 84 ad 78 56 34 12
+
+vpgatherdq xmm0,[rcx + 12 + xmm5*4],xmm0	; c4 e2 f9 90 44 a9 0c
+vpgatherqq ymm0,[rcx + 12 + ymm13*4],ymm0	; c4 a2 fd 91 44 a9 0c
+vpgatherdq xmm0,[r13 + 12 + xmm13*4],xmm0	; c4 82 f9 90 44 ad 0c
+vpgatherqq ymm0,[r13 + 12 + ymm5*4],ymm0	; c4 c2 fd 91 44 ad 0c
+
+vpgatherdq xmm0,[dword 12 + xmm5*8],xmm0	; c4 e2 f9 90 04 ed 0c 00 00 00
+vpgatherqq ymm0,[dword 12 + ymm13*8],ymm0	; c4 a2 fd 91 04 ed 0c 00 00 00
+vpgatherdq xmm0,[12 + xmm13*8],xmm0		; c4 a2 f9 90 04 ed 0c 00 00 00
+vpgatherqq ymm0,[12 + ymm5*8],ymm0		; c4 e2 fd 91 04 ed 0c 00 00 00
+
+
diff --git a/modules/arch/x86/tests/vsib.hex b/modules/arch/x86/tests/vsib.hex
new file mode 100644
index 0000000..7dfde88
--- /dev/null
+++ b/modules/arch/x86/tests/vsib.hex
@@ -0,0 +1,662 @@
+67 
+c4 
+e2 
+f9 
+90 
+04 
+05 
+00 
+00 
+00 
+00 
+67 
+c4 
+e2 
+fd 
+91 
+04 
+05 
+00 
+00 
+00 
+00 
+c4 
+e2 
+f9 
+90 
+04 
+05 
+00 
+00 
+00 
+00 
+c4 
+e2 
+fd 
+91 
+04 
+05 
+00 
+00 
+00 
+00 
+c4 
+e2 
+f9 
+90 
+04 
+29 
+c4 
+e2 
+fd 
+91 
+04 
+29 
+c4 
+e2 
+f9 
+90 
+44 
+2d 
+00 
+c4 
+e2 
+fd 
+91 
+44 
+2d 
+00 
+c4 
+e2 
+f9 
+90 
+04 
+29 
+c4 
+e2 
+fd 
+91 
+04 
+29 
+c4 
+e2 
+f9 
+90 
+44 
+2d 
+00 
+c4 
+e2 
+fd 
+91 
+44 
+2d 
+00 
+c4 
+e2 
+f9 
+90 
+04 
+29 
+c4 
+e2 
+fd 
+91 
+04 
+29 
+c4 
+e2 
+f9 
+90 
+44 
+2d 
+00 
+c4 
+e2 
+fd 
+91 
+44 
+2d 
+00 
+c4 
+e2 
+f9 
+90 
+04 
+29 
+c4 
+e2 
+fd 
+91 
+04 
+29 
+c4 
+e2 
+f9 
+90 
+44 
+2d 
+00 
+c4 
+e2 
+fd 
+91 
+44 
+2d 
+00 
+c4 
+e2 
+f9 
+90 
+04 
+2d 
+78 
+56 
+34 
+12 
+c4 
+e2 
+fd 
+91 
+04 
+2d 
+78 
+56 
+34 
+12 
+c4 
+e2 
+f9 
+90 
+44 
+69 
+0c 
+c4 
+e2 
+fd 
+91 
+44 
+69 
+0c 
+c4 
+e2 
+f9 
+90 
+44 
+6d 
+0c 
+c4 
+e2 
+fd 
+91 
+44 
+6d 
+0c 
+c4 
+e2 
+f9 
+90 
+84 
+a9 
+0c 
+00 
+00 
+00 
+c4 
+e2 
+fd 
+91 
+84 
+a9 
+0c 
+00 
+00 
+00 
+c4 
+e2 
+f9 
+90 
+84 
+ad 
+0c 
+00 
+00 
+00 
+c4 
+e2 
+fd 
+91 
+84 
+ad 
+0c 
+00 
+00 
+00 
+c4 
+e2 
+f9 
+90 
+84 
+a9 
+78 
+56 
+34 
+12 
+c4 
+e2 
+fd 
+91 
+84 
+a9 
+78 
+56 
+34 
+12 
+c4 
+e2 
+f9 
+90 
+84 
+ad 
+78 
+56 
+34 
+12 
+c4 
+e2 
+fd 
+91 
+84 
+ad 
+78 
+56 
+34 
+12 
+c4 
+e2 
+f9 
+90 
+44 
+a9 
+0c 
+c4 
+e2 
+fd 
+91 
+44 
+a9 
+0c 
+c4 
+e2 
+f9 
+90 
+44 
+ad 
+0c 
+c4 
+e2 
+fd 
+91 
+44 
+ad 
+0c 
+c4 
+e2 
+f9 
+90 
+04 
+ed 
+0c 
+00 
+00 
+00 
+c4 
+e2 
+fd 
+91 
+04 
+ed 
+0c 
+00 
+00 
+00 
+c4 
+e2 
+f9 
+90 
+04 
+ed 
+0c 
+00 
+00 
+00 
+c4 
+e2 
+fd 
+91 
+04 
+ed 
+0c 
+00 
+00 
+00 
+c4 
+e2 
+f9 
+90 
+04 
+05 
+00 
+00 
+00 
+00 
+c4 
+e2 
+fd 
+91 
+04 
+05 
+00 
+00 
+00 
+00 
+c4 
+e2 
+f9 
+90 
+04 
+29 
+c4 
+a2 
+fd 
+91 
+04 
+29 
+c4 
+82 
+f9 
+90 
+44 
+2d 
+00 
+c4 
+c2 
+fd 
+91 
+44 
+2d 
+00 
+c4 
+e2 
+f9 
+90 
+04 
+29 
+c4 
+a2 
+fd 
+91 
+04 
+29 
+c4 
+82 
+f9 
+90 
+44 
+2d 
+00 
+c4 
+c2 
+fd 
+91 
+44 
+2d 
+00 
+c4 
+e2 
+f9 
+90 
+04 
+29 
+c4 
+a2 
+fd 
+91 
+04 
+29 
+c4 
+82 
+f9 
+90 
+44 
+2d 
+00 
+c4 
+c2 
+fd 
+91 
+44 
+2d 
+00 
+c4 
+e2 
+f9 
+90 
+04 
+29 
+c4 
+a2 
+fd 
+91 
+04 
+29 
+c4 
+82 
+f9 
+90 
+44 
+2d 
+00 
+c4 
+c2 
+fd 
+91 
+44 
+2d 
+00 
+c4 
+e2 
+f9 
+90 
+04 
+2d 
+78 
+56 
+34 
+12 
+c4 
+e2 
+fd 
+91 
+04 
+2d 
+78 
+56 
+34 
+12 
+c4 
+e2 
+f9 
+90 
+44 
+69 
+0c 
+c4 
+a2 
+fd 
+91 
+44 
+69 
+0c 
+c4 
+82 
+f9 
+90 
+44 
+6d 
+0c 
+c4 
+c2 
+fd 
+91 
+44 
+6d 
+0c 
+c4 
+e2 
+f9 
+90 
+84 
+a9 
+0c 
+00 
+00 
+00 
+c4 
+a2 
+fd 
+91 
+84 
+a9 
+0c 
+00 
+00 
+00 
+c4 
+82 
+f9 
+90 
+84 
+ad 
+0c 
+00 
+00 
+00 
+c4 
+c2 
+fd 
+91 
+84 
+ad 
+0c 
+00 
+00 
+00 
+c4 
+e2 
+f9 
+90 
+84 
+a9 
+78 
+56 
+34 
+12 
+c4 
+a2 
+fd 
+91 
+84 
+a9 
+78 
+56 
+34 
+12 
+c4 
+82 
+f9 
+90 
+84 
+ad 
+78 
+56 
+34 
+12 
+c4 
+c2 
+fd 
+91 
+84 
+ad 
+78 
+56 
+34 
+12 
+c4 
+e2 
+f9 
+90 
+44 
+a9 
+0c 
+c4 
+a2 
+fd 
+91 
+44 
+a9 
+0c 
+c4 
+82 
+f9 
+90 
+44 
+ad 
+0c 
+c4 
+c2 
+fd 
+91 
+44 
+ad 
+0c 
+c4 
+e2 
+f9 
+90 
+04 
+ed 
+0c 
+00 
+00 
+00 
+c4 
+a2 
+fd 
+91 
+04 
+ed 
+0c 
+00 
+00 
+00 
+c4 
+a2 
+f9 
+90 
+04 
+ed 
+0c 
+00 
+00 
+00 
+c4 
+e2 
+fd 
+91 
+04 
+ed 
+0c 
+00 
+00 
+00 
diff --git a/modules/arch/x86/tests/vsib2-err.asm b/modules/arch/x86/tests/vsib2-err.asm
new file mode 100644
index 0000000..7e3ac55
--- /dev/null
+++ b/modules/arch/x86/tests/vsib2-err.asm
@@ -0,0 +1,19 @@
+; Errors caught during EA checking
+
+[bits 32]
+vpgatherqq ymm0,[ymm0+ecx*2],ymm0
+
+[bits 64]
+addpd xmm0,[xmm0] ; not a VSIB128 template
+addpd xmm0,[ymm0] ; not a VSIB256 template
+
+[bits 32]
+vpgatherdq xmm0,[bp+xmm0],xmm0
+
+vpgatherdq xmm0,[xmm0+ymm0],xmm0
+
+vpgatherqq ymm0,[word ymm0],ymm0
+
+vpgatherqq ymm0,[byte ymm0],ymm0
+
+
diff --git a/modules/arch/x86/tests/vsib2-err.errwarn b/modules/arch/x86/tests/vsib2-err.errwarn
new file mode 100644
index 0000000..877ce62
--- /dev/null
+++ b/modules/arch/x86/tests/vsib2-err.errwarn
@@ -0,0 +1,7 @@
+-:4: error: invalid effective address
+-:7: error: invalid effective address
+-:8: error: invalid effective address
+-:11: error: invalid effective address
+-:13: error: invalid effective address
+-:15: error: invalid effective address
+-:17: warning: invalid displacement size; fixed
diff --git a/modules/arch/x86/tests/xop-all.asm b/modules/arch/x86/tests/xop-all.asm
new file mode 100644
index 0000000..db5dabf
--- /dev/null
+++ b/modules/arch/x86/tests/xop-all.asm
@@ -0,0 +1,266 @@
+; Instructions are ordered in XOP databook order
+; BITS=16 to minimize output length
+[bits 16]
+vfrczpd xmm1, xmm2			; 8F E9 78 81 312
+vfrczpd xmm1, [0]			; 8F E9 78 81 016 00 00
+vfrczpd xmm1, dqword [0]		; 8F E9 78 81 016 00 00
+vfrczpd ymm1, ymm2			; 8F E9 7C 81 312
+vfrczpd ymm1, [0]			; 8F E9 7C 81 016 00 00
+vfrczpd ymm1, yword [0]			; 8F E9 7C 81 016 00 00
+
+vfrczps xmm1, xmm2			; 8F E9 78 80 312
+vfrczps xmm1, [0]			; 8F E9 78 80 016 00 00
+vfrczps xmm1, dqword [0]		; 8F E9 78 80 016 00 00
+vfrczps ymm1, ymm2			; 8F E9 7C 80 312
+vfrczps ymm1, [0]			; 8F E9 7C 80 016 00 00
+vfrczps ymm1, yword [0]			; 8F E9 7C 80 016 00 00
+
+vfrczsd xmm1, xmm2			; 8F E9 78 83 312
+vfrczsd xmm1, [0]			; 8F E9 78 83 016 00 00
+vfrczsd xmm1, qword [0]			; 8F E9 78 83 016 00 00
+
+vfrczss xmm1, xmm2			; 8F E9 78 82 312
+vfrczss xmm1, [0]			; 8F E9 78 82 016 00 00
+vfrczss xmm1, dword [0]			; 8F E9 78 82 016 00 00
+
+vpcmov xmm1, xmm2, xmm3, xmm4		; 8F E8 68 A2 313 40 /or/ 8F E8 E8 A2 314 30
+vpcmov xmm1, xmm2, xmm3, [0]		; 8F E8 E8 A2 016 00 00 30
+vpcmov xmm1, xmm2, xmm3, dqword [0]	; 8F E8 E8 A2 016 00 00 30
+vpcmov xmm1, xmm2, [0], xmm4		; 8F E8 68 A2 016 00 00 40
+vpcmov xmm1, xmm2, dqword [0], xmm4	; 8F E8 68 A2 016 00 00 40
+vpcmov ymm1, ymm2, ymm3, ymm4		; 8F E8 6C A2 313 40 /or/ 8F E8 EC A2 314 30
+vpcmov ymm1, ymm2, ymm3, [0]		; 8F E8 EC A2 016 00 00 30
+vpcmov ymm1, ymm2, ymm3, yword [0]	; 8F E8 EC A2 016 00 00 30
+vpcmov ymm1, ymm2, [0], ymm4		; 8F E8 6C A2 016 00 00 40
+vpcmov ymm1, ymm2, yword [0], ymm4	; 8F E8 6C A2 016 00 00 40
+
+vpcomb xmm1, xmm4, xmm7, 5		; 8F E8 58 CC 317 05
+vpcomb xmm2, xmm5, [0], byte 5		; 8F E8 50 CC 026 00 00 05
+vpcomb xmm3, xmm6, dqword [0], 5	; 8F E8 48 CC 036 00 00 05
+
+vpcomd xmm1, xmm4, xmm7, 5		; 8F E8 58 CE 317 05
+vpcomd xmm2, xmm5, [0], byte 5		; 8F E8 50 CE 026 00 00 05
+vpcomd xmm3, xmm6, dqword [0], 5	; 8F E8 48 CE 036 00 00 05
+
+vpcomq xmm1, xmm4, xmm7, 5		; 8F E8 58 CF 317 05
+vpcomq xmm2, xmm5, [0], byte 5		; 8F E8 50 CF 026 00 00 05
+vpcomq xmm3, xmm6, dqword [0], 5	; 8F E8 48 CF 036 00 00 05
+
+vpcomub xmm1, xmm4, xmm7, 5		; 8F E8 58 EC 317 05
+vpcomub xmm2, xmm5, [0], byte 5		; 8F E8 50 EC 026 00 00 05
+vpcomub xmm3, xmm6, dqword [0], 5	; 8F E8 48 EC 036 00 00 05
+
+vpcomud xmm1, xmm4, xmm7, 5		; 8F E8 58 EE 317 05
+vpcomud xmm2, xmm5, [0], byte 5		; 8F E8 50 EE 026 00 00 05
+vpcomud xmm3, xmm6, dqword [0], 5	; 8F E8 48 EE 036 00 00 05
+
+vpcomuq xmm1, xmm4, xmm7, 5		; 8F E8 58 EF 317 05
+vpcomuq xmm2, xmm5, [0], byte 5		; 8F E8 50 EF 026 00 00 05
+vpcomuq xmm3, xmm6, dqword [0], 5	; 8F E8 48 EF 036 00 00 05
+
+vpcomuw xmm1, xmm4, xmm7, 5		; 8F E8 58 ED 317 05
+vpcomuw xmm2, xmm5, [0], byte 5		; 8F E8 50 ED 026 00 00 05
+vpcomuw xmm3, xmm6, dqword [0], 5	; 8F E8 48 ED 036 00 00 05
+
+vpcomw xmm1, xmm4, xmm7, 5		; 8F E8 58 CD 317 05
+vpcomw xmm2, xmm5, [0], byte 5		; 8F E8 50 CD 026 00 00 05
+vpcomw xmm3, xmm6, dqword [0], 5	; 8F E8 48 CD 036 00 00 05
+
+vphaddbd xmm1, xmm2			; 8F E9 78 C2 312
+vphaddbd xmm1, [0]			; 8F E9 78 C2 016 00 00
+vphaddbd xmm1, dqword [0]		; 8F E9 78 C2 016 00 00
+
+vphaddbq xmm1, xmm2			; 8F E9 78 C3 312
+vphaddbq xmm1, [0]			; 8F E9 78 C3 016 00 00
+vphaddbq xmm1, dqword [0]		; 8F E9 78 C3 016 00 00
+
+vphaddbw xmm1, xmm2			; 8F E9 78 C1 312
+vphaddbw xmm1, [0]			; 8F E9 78 C1 016 00 00
+vphaddbw xmm1, dqword [0]		; 8F E9 78 C1 016 00 00
+
+vphadddq xmm1, xmm2			; 8F E9 78 CB 312
+vphadddq xmm1, [0]			; 8F E9 78 CB 016 00 00
+vphadddq xmm1, dqword [0]		; 8F E9 78 CB 016 00 00
+
+vphaddubd xmm1, xmm2			; 8F E9 78 D2 312
+vphaddubd xmm1, [0]			; 8F E9 78 D2 016 00 00
+vphaddubd xmm1, dqword [0]		; 8F E9 78 D2 016 00 00
+
+vphaddubq xmm1, xmm2			; 8F E9 78 D3 312
+vphaddubq xmm1, [0]			; 8F E9 78 D3 016 00 00
+vphaddubq xmm1, dqword [0]		; 8F E9 78 D3 016 00 00
+
+vphaddubw xmm1, xmm2			; 8F E9 78 D1 312
+vphaddubw xmm1, [0]			; 8F E9 78 D1 016 00 00
+vphaddubw xmm1, dqword [0]		; 8F E9 78 D1 016 00 00
+
+vphaddudq xmm1, xmm2			; 8F E9 78 DB 312
+vphaddudq xmm1, [0]			; 8F E9 78 DB 016 00 00
+vphaddudq xmm1, dqword [0]		; 8F E9 78 DB 016 00 00
+
+vphadduwd xmm1, xmm2			; 8F E9 78 D6 312
+vphadduwd xmm1, [0]			; 8F E9 78 D6 016 00 00
+vphadduwd xmm1, dqword [0]		; 8F E9 78 D6 016 00 00
+
+vphadduwq xmm1, xmm2			; 8F E9 78 D7 312
+vphadduwq xmm1, [0]			; 8F E9 78 D7 016 00 00
+vphadduwq xmm1, dqword [0]		; 8F E9 78 D7 016 00 00
+
+vphaddwd xmm1, xmm2			; 8F E9 78 C6 312
+vphaddwd xmm1, [0]			; 8F E9 78 C6 016 00 00
+vphaddwd xmm1, dqword [0]		; 8F E9 78 C6 016 00 00
+
+vphaddwq xmm1, xmm2			; 8F E9 78 C7 312
+vphaddwq xmm1, [0]			; 8F E9 78 C7 016 00 00
+vphaddwq xmm1, dqword [0]		; 8F E9 78 C7 016 00 00
+
+vphsubbw xmm1, xmm2			; 8F E9 78 E1 312
+vphsubbw xmm1, [0]			; 8F E9 78 E1 016 00 00
+vphsubbw xmm1, dqword [0]		; 8F E9 78 E1 016 00 00
+
+vphsubdq xmm1, xmm2			; 8F E9 78 E3 312
+vphsubdq xmm1, [0]			; 8F E9 78 E3 016 00 00
+vphsubdq xmm1, dqword [0]		; 8F E9 78 E3 016 00 00
+
+vphsubwd xmm1, xmm2			; 8F E9 78 E2 312
+vphsubwd xmm1, [0]			; 8F E9 78 E2 016 00 00
+vphsubwd xmm1, dqword [0]		; 8F E9 78 E2 016 00 00
+
+vpmacsdd xmm1, xmm4, xmm7, xmm3		; 8F E8 58 9E 317 30
+vpmacsdd xmm2, xmm5, [0], xmm0		; 8F E8 50 9E 026 00 00 00
+vpmacsdd xmm3, xmm6, dqword [0], xmm2	; 8F E8 48 9E 036 00 00 20
+
+vpmacsdqh xmm1, xmm4, xmm7, xmm3	; 8F E8 58 9F 317 30
+vpmacsdqh xmm2, xmm5, [0], xmm0		; 8F E8 50 9F 026 00 00 00
+vpmacsdqh xmm3, xmm6, dqword [0], xmm2	; 8F E8 48 9F 036 00 00 20
+
+vpmacsdql xmm1, xmm4, xmm7, xmm3	; 8F E8 58 97 317 30
+vpmacsdql xmm2, xmm5, [0], xmm0		; 8F E8 50 97 026 00 00 00
+vpmacsdql xmm3, xmm6, dqword [0], xmm2	; 8F E8 48 97 036 00 00 20
+
+vpmacssdd xmm1, xmm4, xmm7, xmm3	; 8F E8 58 8E 317 30
+vpmacssdd xmm2, xmm5, [0], xmm0		; 8F E8 50 8E 026 00 00 00
+vpmacssdd xmm3, xmm6, dqword [0], xmm2	; 8F E8 48 8E 036 00 00 20
+
+vpmacssdqh xmm1, xmm4, xmm7, xmm3	; 8F E8 58 8F 317 30
+vpmacssdqh xmm2, xmm5, [0], xmm0	; 8F E8 50 8F 026 00 00 00
+vpmacssdqh xmm3, xmm6, dqword [0], xmm2	; 8F E8 48 8F 036 00 00 20
+
+vpmacssdql xmm1, xmm4, xmm7, xmm3	; 8F E8 58 87 317 30
+vpmacssdql xmm2, xmm5, [0], xmm0	; 8F E8 50 87 026 00 00 00
+vpmacssdql xmm3, xmm6, dqword [0], xmm2	; 8F E8 48 87 036 00 00 20
+
+vpmacsswd xmm1, xmm4, xmm7, xmm3	; 8F E8 58 86 317 30
+vpmacsswd xmm2, xmm5, [0], xmm0		; 8F E8 50 86 026 00 00 00
+vpmacsswd xmm3, xmm6, dqword [0], xmm2	; 8F E8 48 86 036 00 00 20
+
+vpmacssww xmm1, xmm4, xmm7, xmm3	; 8F E8 58 85 317 30
+vpmacssww xmm2, xmm5, [0], xmm0		; 8F E8 50 85 026 00 00 00
+vpmacssww xmm3, xmm6, dqword [0], xmm2	; 8F E8 48 85 036 00 00 20
+
+vpmacswd xmm1, xmm4, xmm7, xmm3		; 8F E8 58 96 317 30
+vpmacswd xmm2, xmm5, [0], xmm0		; 8F E8 50 96 026 00 00 00
+vpmacswd xmm3, xmm6, dqword [0], xmm2	; 8F E8 48 96 036 00 00 20
+
+vpmacsww xmm1, xmm4, xmm7, xmm3		; 8F E8 58 95 317 30
+vpmacsww xmm2, xmm5, [0], xmm0		; 8F E8 50 95 026 00 00 00
+vpmacsww xmm3, xmm6, dqword [0], xmm2	; 8F E8 48 95 036 00 00 20
+
+vpmadcsswd xmm1, xmm4, xmm7, xmm3	; 8F E8 58 A6 317 30
+vpmadcsswd xmm2, xmm5, [0], xmm0	; 8F E8 50 A6 026 00 00 00
+vpmadcsswd xmm3, xmm6, dqword [0], xmm2	; 8F E8 48 A6 036 00 00 20
+
+vpmadcswd xmm1, xmm4, xmm7, xmm3	; 8F E8 58 B6 317 30
+vpmadcswd xmm2, xmm5, [0], xmm0		; 8F E8 50 B6 026 00 00 00
+vpmadcswd xmm3, xmm6, dqword [0], xmm2	; 8F E8 48 B6 036 00 00 20
+
+vpperm xmm1, xmm2, xmm3, xmm4		; 8F E8 68 A3 313 40 /or/ 8F E8 E8 A3 314 30
+vpperm xmm1, xmm2, xmm3, [0]		; 8F E8 E8 A3 016 00 00 30
+vpperm xmm1, xmm2, xmm3, dqword [0]	; 8F E8 E8 A3 016 00 00 30
+vpperm xmm1, xmm2, [0], xmm4		; 8F E8 68 A3 016 00 00 40
+vpperm xmm1, xmm2, dqword [0], xmm4	; 8F E8 68 A3 016 00 00 40
+
+vprotb xmm1, xmm2, xmm3			; 8F E9 60 90 312 /or/ 8F E9 E8 90 313
+vprotb xmm1, xmm2, [0]			; 8F E9 E8 90 016 00 00
+vprotb xmm1, xmm2, dqword [0]		; 8F E9 E8 90 016 00 00
+vprotb xmm1, [0], xmm3			; 8F E9 60 90 016 00 00
+vprotb xmm1, dqword [0], xmm3		; 8F E9 60 90 016 00 00
+vprotb xmm1, xmm2, byte 5		; 8F E8 78 C0 312 05
+vprotb xmm1, [0], byte 5		; 8F E8 78 C0 016 00 00 05
+vprotb xmm1, dqword [0], 5		; 8F E8 78 C0 016 00 00 05
+
+vprotd xmm1, xmm2, xmm3			; 8F E9 60 92 312 /or/ 8F E9 E8 92 313
+vprotd xmm1, xmm2, [0]			; 8F E9 E8 92 016 00 00
+vprotd xmm1, xmm2, dqword [0]		; 8F E9 E8 92 016 00 00
+vprotd xmm1, [0], xmm3			; 8F E9 60 92 016 00 00
+vprotd xmm1, dqword [0], xmm3		; 8F E9 60 92 016 00 00
+vprotd xmm1, xmm2, byte 5		; 8F E8 78 C2 312 05
+vprotd xmm1, [0], byte 5		; 8F E8 78 C2 016 00 00 05
+vprotd xmm1, dqword [0], 5		; 8F E8 78 C2 016 00 00 05
+
+vprotq xmm1, xmm2, xmm3			; 8F E9 60 93 312 /or/ 8F E9 E8 93 313
+vprotq xmm1, xmm2, [0]			; 8F E9 E8 93 016 00 00
+vprotq xmm1, xmm2, dqword [0]		; 8F E9 E8 93 016 00 00
+vprotq xmm1, [0], xmm3			; 8F E9 60 93 016 00 00
+vprotq xmm1, dqword [0], xmm3		; 8F E9 60 93 016 00 00
+vprotq xmm1, xmm2, byte 5		; 8F E8 78 C3 312 05
+vprotq xmm1, [0], byte 5		; 8F E8 78 C3 016 00 00 05
+vprotq xmm1, dqword [0], 5		; 8F E8 78 C3 016 00 00 05
+
+vprotw xmm1, xmm2, xmm3			; 8F E9 60 91 312 /or/ 8F E9 E8 91 313
+vprotw xmm1, xmm2, [0]			; 8F E9 E8 91 016 00 00
+vprotw xmm1, xmm2, dqword [0]		; 8F E9 E8 91 016 00 00
+vprotw xmm1, [0], xmm3			; 8F E9 60 91 016 00 00
+vprotw xmm1, dqword [0], xmm3		; 8F E9 60 91 016 00 00
+vprotw xmm1, xmm2, byte 5		; 8F E8 78 C1 312 05
+vprotw xmm1, [0], byte 5		; 8F E8 78 C1 016 00 00 05
+vprotw xmm1, dqword [0], 5		; 8F E8 78 C1 016 00 00 05
+
+vpshab xmm1, xmm2, xmm3			; 8F E9 60 98 312 /or/ 8F E9 E8 98 313
+vpshab xmm1, xmm2, [0]			; 8F E9 E8 98 016 00 00
+vpshab xmm1, xmm2, dqword [0]		; 8F E9 E8 98 016 00 00
+vpshab xmm1, [0], xmm3			; 8F E9 60 98 016 00 00
+vpshab xmm1, dqword [0], xmm3		; 8F E9 60 98 016 00 00
+
+vpshad xmm1, xmm2, xmm3			; 8F E9 60 9A 312 /or/ 8F E9 E8 9A 313
+vpshad xmm1, xmm2, [0]			; 8F E9 E8 9A 016 00 00
+vpshad xmm1, xmm2, dqword [0]		; 8F E9 E8 9A 016 00 00
+vpshad xmm1, [0], xmm3			; 8F E9 60 9A 016 00 00
+vpshad xmm1, dqword [0], xmm3		; 8F E9 60 9A 016 00 00
+
+vpshaq xmm1, xmm2, xmm3			; 8F E9 60 9B 312 /or/ 8F E9 E8 9B 313
+vpshaq xmm1, xmm2, [0]			; 8F E9 E8 9B 016 00 00
+vpshaq xmm1, xmm2, dqword [0]		; 8F E9 E8 9B 016 00 00
+vpshaq xmm1, [0], xmm3			; 8F E9 60 9B 016 00 00
+vpshaq xmm1, dqword [0], xmm3		; 8F E9 60 9B 016 00 00
+
+vpshaw xmm1, xmm2, xmm3			; 8F E9 60 99 312 /or/ 8F E9 E8 99 313
+vpshaw xmm1, xmm2, [0]			; 8F E9 E8 99 016 00 00
+vpshaw xmm1, xmm2, dqword [0]		; 8F E9 E8 99 016 00 00
+vpshaw xmm1, [0], xmm3			; 8F E9 60 99 016 00 00
+vpshaw xmm1, dqword [0], xmm3		; 8F E9 60 99 016 00 00
+
+vpshlb xmm1, xmm2, xmm3			; 8F E9 60 94 312 /or/ 8F E9 E8 94 313
+vpshlb xmm1, xmm2, [0]			; 8F E9 E8 94 016 00 00
+vpshlb xmm1, xmm2, dqword [0]		; 8F E9 E8 94 016 00 00
+vpshlb xmm1, [0], xmm3			; 8F E9 60 94 016 00 00
+vpshlb xmm1, dqword [0], xmm3		; 8F E9 60 94 016 00 00
+
+vpshld xmm1, xmm2, xmm3			; 8F E9 60 96 312 /or/ 8F E9 E8 96 313
+vpshld xmm1, xmm2, [0]			; 8F E9 E8 96 016 00 00
+vpshld xmm1, xmm2, dqword [0]		; 8F E9 E8 96 016 00 00
+vpshld xmm1, [0], xmm3			; 8F E9 60 96 016 00 00
+vpshld xmm1, dqword [0], xmm3		; 8F E9 60 96 016 00 00
+
+vpshlq xmm1, xmm2, xmm3			; 8F E9 60 97 312 /or/ 8F E9 E8 97 313
+vpshlq xmm1, xmm2, [0]			; 8F E9 E8 97 016 00 00
+vpshlq xmm1, xmm2, dqword [0]		; 8F E9 E8 97 016 00 00
+vpshlq xmm1, [0], xmm3			; 8F E9 60 97 016 00 00
+vpshlq xmm1, dqword [0], xmm3		; 8F E9 60 97 016 00 00
+
+vpshlw xmm1, xmm2, xmm3			; 8F E9 60 95 312 /or/ 8F E9 E8 95 313
+vpshlw xmm1, xmm2, [0]			; 8F E9 E8 95 016 00 00
+vpshlw xmm1, xmm2, dqword [0]		; 8F E9 E8 95 016 00 00
+vpshlw xmm1, [0], xmm3			; 8F E9 60 95 016 00 00
+vpshlw xmm1, dqword [0], xmm3		; 8F E9 60 95 016 00 00
+
diff --git a/modules/arch/x86/tests/xop-all.hex b/modules/arch/x86/tests/xop-all.hex
new file mode 100644
index 0000000..1d03cbe
--- /dev/null
+++ b/modules/arch/x86/tests/xop-all.hex
@@ -0,0 +1,1437 @@
+8f 
+e9 
+78 
+81 
+ca 
+8f 
+e9 
+78 
+81 
+0e 
+00 
+00 
+8f 
+e9 
+78 
+81 
+0e 
+00 
+00 
+8f 
+e9 
+7c 
+81 
+ca 
+8f 
+e9 
+7c 
+81 
+0e 
+00 
+00 
+8f 
+e9 
+7c 
+81 
+0e 
+00 
+00 
+8f 
+e9 
+78 
+80 
+ca 
+8f 
+e9 
+78 
+80 
+0e 
+00 
+00 
+8f 
+e9 
+78 
+80 
+0e 
+00 
+00 
+8f 
+e9 
+7c 
+80 
+ca 
+8f 
+e9 
+7c 
+80 
+0e 
+00 
+00 
+8f 
+e9 
+7c 
+80 
+0e 
+00 
+00 
+8f 
+e9 
+78 
+83 
+ca 
+8f 
+e9 
+78 
+83 
+0e 
+00 
+00 
+8f 
+e9 
+78 
+83 
+0e 
+00 
+00 
+8f 
+e9 
+78 
+82 
+ca 
+8f 
+e9 
+78 
+82 
+0e 
+00 
+00 
+8f 
+e9 
+78 
+82 
+0e 
+00 
+00 
+8f 
+e8 
+68 
+a2 
+cb 
+40 
+8f 
+e8 
+e8 
+a2 
+0e 
+00 
+00 
+30 
+8f 
+e8 
+e8 
+a2 
+0e 
+00 
+00 
+30 
+8f 
+e8 
+68 
+a2 
+0e 
+00 
+00 
+40 
+8f 
+e8 
+68 
+a2 
+0e 
+00 
+00 
+40 
+8f 
+e8 
+6c 
+a2 
+cb 
+40 
+8f 
+e8 
+ec 
+a2 
+0e 
+00 
+00 
+30 
+8f 
+e8 
+ec 
+a2 
+0e 
+00 
+00 
+30 
+8f 
+e8 
+6c 
+a2 
+0e 
+00 
+00 
+40 
+8f 
+e8 
+6c 
+a2 
+0e 
+00 
+00 
+40 
+8f 
+e8 
+58 
+cc 
+cf 
+05 
+8f 
+e8 
+50 
+cc 
+16 
+00 
+00 
+05 
+8f 
+e8 
+48 
+cc 
+1e 
+00 
+00 
+05 
+8f 
+e8 
+58 
+ce 
+cf 
+05 
+8f 
+e8 
+50 
+ce 
+16 
+00 
+00 
+05 
+8f 
+e8 
+48 
+ce 
+1e 
+00 
+00 
+05 
+8f 
+e8 
+58 
+cf 
+cf 
+05 
+8f 
+e8 
+50 
+cf 
+16 
+00 
+00 
+05 
+8f 
+e8 
+48 
+cf 
+1e 
+00 
+00 
+05 
+8f 
+e8 
+58 
+ec 
+cf 
+05 
+8f 
+e8 
+50 
+ec 
+16 
+00 
+00 
+05 
+8f 
+e8 
+48 
+ec 
+1e 
+00 
+00 
+05 
+8f 
+e8 
+58 
+ee 
+cf 
+05 
+8f 
+e8 
+50 
+ee 
+16 
+00 
+00 
+05 
+8f 
+e8 
+48 
+ee 
+1e 
+00 
+00 
+05 
+8f 
+e8 
+58 
+ef 
+cf 
+05 
+8f 
+e8 
+50 
+ef 
+16 
+00 
+00 
+05 
+8f 
+e8 
+48 
+ef 
+1e 
+00 
+00 
+05 
+8f 
+e8 
+58 
+ed 
+cf 
+05 
+8f 
+e8 
+50 
+ed 
+16 
+00 
+00 
+05 
+8f 
+e8 
+48 
+ed 
+1e 
+00 
+00 
+05 
+8f 
+e8 
+58 
+cd 
+cf 
+05 
+8f 
+e8 
+50 
+cd 
+16 
+00 
+00 
+05 
+8f 
+e8 
+48 
+cd 
+1e 
+00 
+00 
+05 
+8f 
+e9 
+78 
+c2 
+ca 
+8f 
+e9 
+78 
+c2 
+0e 
+00 
+00 
+8f 
+e9 
+78 
+c2 
+0e 
+00 
+00 
+8f 
+e9 
+78 
+c3 
+ca 
+8f 
+e9 
+78 
+c3 
+0e 
+00 
+00 
+8f 
+e9 
+78 
+c3 
+0e 
+00 
+00 
+8f 
+e9 
+78 
+c1 
+ca 
+8f 
+e9 
+78 
+c1 
+0e 
+00 
+00 
+8f 
+e9 
+78 
+c1 
+0e 
+00 
+00 
+8f 
+e9 
+78 
+cb 
+ca 
+8f 
+e9 
+78 
+cb 
+0e 
+00 
+00 
+8f 
+e9 
+78 
+cb 
+0e 
+00 
+00 
+8f 
+e9 
+78 
+d2 
+ca 
+8f 
+e9 
+78 
+d2 
+0e 
+00 
+00 
+8f 
+e9 
+78 
+d2 
+0e 
+00 
+00 
+8f 
+e9 
+78 
+d3 
+ca 
+8f 
+e9 
+78 
+d3 
+0e 
+00 
+00 
+8f 
+e9 
+78 
+d3 
+0e 
+00 
+00 
+8f 
+e9 
+78 
+d1 
+ca 
+8f 
+e9 
+78 
+d1 
+0e 
+00 
+00 
+8f 
+e9 
+78 
+d1 
+0e 
+00 
+00 
+8f 
+e9 
+78 
+d8 
+ca 
+8f 
+e9 
+78 
+d8 
+0e 
+00 
+00 
+8f 
+e9 
+78 
+d8 
+0e 
+00 
+00 
+8f 
+e9 
+78 
+d6 
+ca 
+8f 
+e9 
+78 
+d6 
+0e 
+00 
+00 
+8f 
+e9 
+78 
+d6 
+0e 
+00 
+00 
+8f 
+e9 
+78 
+d7 
+ca 
+8f 
+e9 
+78 
+d7 
+0e 
+00 
+00 
+8f 
+e9 
+78 
+d7 
+0e 
+00 
+00 
+8f 
+e9 
+78 
+c6 
+ca 
+8f 
+e9 
+78 
+c6 
+0e 
+00 
+00 
+8f 
+e9 
+78 
+c6 
+0e 
+00 
+00 
+8f 
+e9 
+78 
+c7 
+ca 
+8f 
+e9 
+78 
+c7 
+0e 
+00 
+00 
+8f 
+e9 
+78 
+c7 
+0e 
+00 
+00 
+8f 
+e9 
+78 
+e1 
+ca 
+8f 
+e9 
+78 
+e1 
+0e 
+00 
+00 
+8f 
+e9 
+78 
+e1 
+0e 
+00 
+00 
+8f 
+e9 
+78 
+e3 
+ca 
+8f 
+e9 
+78 
+e3 
+0e 
+00 
+00 
+8f 
+e9 
+78 
+e3 
+0e 
+00 
+00 
+8f 
+e9 
+78 
+e2 
+ca 
+8f 
+e9 
+78 
+e2 
+0e 
+00 
+00 
+8f 
+e9 
+78 
+e2 
+0e 
+00 
+00 
+8f 
+e8 
+58 
+9e 
+cf 
+30 
+8f 
+e8 
+50 
+9e 
+16 
+00 
+00 
+00 
+8f 
+e8 
+48 
+9e 
+1e 
+00 
+00 
+20 
+8f 
+e8 
+58 
+9f 
+cf 
+30 
+8f 
+e8 
+50 
+9f 
+16 
+00 
+00 
+00 
+8f 
+e8 
+48 
+9f 
+1e 
+00 
+00 
+20 
+8f 
+e8 
+58 
+97 
+cf 
+30 
+8f 
+e8 
+50 
+97 
+16 
+00 
+00 
+00 
+8f 
+e8 
+48 
+97 
+1e 
+00 
+00 
+20 
+8f 
+e8 
+58 
+8e 
+cf 
+30 
+8f 
+e8 
+50 
+8e 
+16 
+00 
+00 
+00 
+8f 
+e8 
+48 
+8e 
+1e 
+00 
+00 
+20 
+8f 
+e8 
+58 
+8f 
+cf 
+30 
+8f 
+e8 
+50 
+8f 
+16 
+00 
+00 
+00 
+8f 
+e8 
+48 
+8f 
+1e 
+00 
+00 
+20 
+8f 
+e8 
+58 
+87 
+cf 
+30 
+8f 
+e8 
+50 
+87 
+16 
+00 
+00 
+00 
+8f 
+e8 
+48 
+87 
+1e 
+00 
+00 
+20 
+8f 
+e8 
+58 
+86 
+cf 
+30 
+8f 
+e8 
+50 
+86 
+16 
+00 
+00 
+00 
+8f 
+e8 
+48 
+86 
+1e 
+00 
+00 
+20 
+8f 
+e8 
+58 
+85 
+cf 
+30 
+8f 
+e8 
+50 
+85 
+16 
+00 
+00 
+00 
+8f 
+e8 
+48 
+85 
+1e 
+00 
+00 
+20 
+8f 
+e8 
+58 
+96 
+cf 
+30 
+8f 
+e8 
+50 
+96 
+16 
+00 
+00 
+00 
+8f 
+e8 
+48 
+96 
+1e 
+00 
+00 
+20 
+8f 
+e8 
+58 
+95 
+cf 
+30 
+8f 
+e8 
+50 
+95 
+16 
+00 
+00 
+00 
+8f 
+e8 
+48 
+95 
+1e 
+00 
+00 
+20 
+8f 
+e8 
+58 
+a6 
+cf 
+30 
+8f 
+e8 
+50 
+a6 
+16 
+00 
+00 
+00 
+8f 
+e8 
+48 
+a6 
+1e 
+00 
+00 
+20 
+8f 
+e8 
+58 
+b6 
+cf 
+30 
+8f 
+e8 
+50 
+b6 
+16 
+00 
+00 
+00 
+8f 
+e8 
+48 
+b6 
+1e 
+00 
+00 
+20 
+8f 
+e8 
+68 
+a3 
+cb 
+40 
+8f 
+e8 
+e8 
+a3 
+0e 
+00 
+00 
+30 
+8f 
+e8 
+e8 
+a3 
+0e 
+00 
+00 
+30 
+8f 
+e8 
+68 
+a3 
+0e 
+00 
+00 
+40 
+8f 
+e8 
+68 
+a3 
+0e 
+00 
+00 
+40 
+8f 
+e9 
+60 
+90 
+ca 
+8f 
+e9 
+e8 
+90 
+0e 
+00 
+00 
+8f 
+e9 
+e8 
+90 
+0e 
+00 
+00 
+8f 
+e9 
+60 
+90 
+0e 
+00 
+00 
+8f 
+e9 
+60 
+90 
+0e 
+00 
+00 
+8f 
+e8 
+78 
+c0 
+ca 
+05 
+8f 
+e8 
+78 
+c0 
+0e 
+00 
+00 
+05 
+8f 
+e8 
+78 
+c0 
+0e 
+00 
+00 
+05 
+8f 
+e9 
+60 
+92 
+ca 
+8f 
+e9 
+e8 
+92 
+0e 
+00 
+00 
+8f 
+e9 
+e8 
+92 
+0e 
+00 
+00 
+8f 
+e9 
+60 
+92 
+0e 
+00 
+00 
+8f 
+e9 
+60 
+92 
+0e 
+00 
+00 
+8f 
+e8 
+78 
+c2 
+ca 
+05 
+8f 
+e8 
+78 
+c2 
+0e 
+00 
+00 
+05 
+8f 
+e8 
+78 
+c2 
+0e 
+00 
+00 
+05 
+8f 
+e9 
+60 
+93 
+ca 
+8f 
+e9 
+e8 
+93 
+0e 
+00 
+00 
+8f 
+e9 
+e8 
+93 
+0e 
+00 
+00 
+8f 
+e9 
+60 
+93 
+0e 
+00 
+00 
+8f 
+e9 
+60 
+93 
+0e 
+00 
+00 
+8f 
+e8 
+78 
+c3 
+ca 
+05 
+8f 
+e8 
+78 
+c3 
+0e 
+00 
+00 
+05 
+8f 
+e8 
+78 
+c3 
+0e 
+00 
+00 
+05 
+8f 
+e9 
+60 
+91 
+ca 
+8f 
+e9 
+e8 
+91 
+0e 
+00 
+00 
+8f 
+e9 
+e8 
+91 
+0e 
+00 
+00 
+8f 
+e9 
+60 
+91 
+0e 
+00 
+00 
+8f 
+e9 
+60 
+91 
+0e 
+00 
+00 
+8f 
+e8 
+78 
+c1 
+ca 
+05 
+8f 
+e8 
+78 
+c1 
+0e 
+00 
+00 
+05 
+8f 
+e8 
+78 
+c1 
+0e 
+00 
+00 
+05 
+8f 
+e9 
+60 
+98 
+ca 
+8f 
+e9 
+e8 
+98 
+0e 
+00 
+00 
+8f 
+e9 
+e8 
+98 
+0e 
+00 
+00 
+8f 
+e9 
+60 
+98 
+0e 
+00 
+00 
+8f 
+e9 
+60 
+98 
+0e 
+00 
+00 
+8f 
+e9 
+60 
+9a 
+ca 
+8f 
+e9 
+e8 
+9a 
+0e 
+00 
+00 
+8f 
+e9 
+e8 
+9a 
+0e 
+00 
+00 
+8f 
+e9 
+60 
+9a 
+0e 
+00 
+00 
+8f 
+e9 
+60 
+9a 
+0e 
+00 
+00 
+8f 
+e9 
+60 
+9b 
+ca 
+8f 
+e9 
+e8 
+9b 
+0e 
+00 
+00 
+8f 
+e9 
+e8 
+9b 
+0e 
+00 
+00 
+8f 
+e9 
+60 
+9b 
+0e 
+00 
+00 
+8f 
+e9 
+60 
+9b 
+0e 
+00 
+00 
+8f 
+e9 
+60 
+99 
+ca 
+8f 
+e9 
+e8 
+99 
+0e 
+00 
+00 
+8f 
+e9 
+e8 
+99 
+0e 
+00 
+00 
+8f 
+e9 
+60 
+99 
+0e 
+00 
+00 
+8f 
+e9 
+60 
+99 
+0e 
+00 
+00 
+8f 
+e9 
+60 
+94 
+ca 
+8f 
+e9 
+e8 
+94 
+0e 
+00 
+00 
+8f 
+e9 
+e8 
+94 
+0e 
+00 
+00 
+8f 
+e9 
+60 
+94 
+0e 
+00 
+00 
+8f 
+e9 
+60 
+94 
+0e 
+00 
+00 
+8f 
+e9 
+60 
+96 
+ca 
+8f 
+e9 
+e8 
+96 
+0e 
+00 
+00 
+8f 
+e9 
+e8 
+96 
+0e 
+00 
+00 
+8f 
+e9 
+60 
+96 
+0e 
+00 
+00 
+8f 
+e9 
+60 
+96 
+0e 
+00 
+00 
+8f 
+e9 
+60 
+97 
+ca 
+8f 
+e9 
+e8 
+97 
+0e 
+00 
+00 
+8f 
+e9 
+e8 
+97 
+0e 
+00 
+00 
+8f 
+e9 
+60 
+97 
+0e 
+00 
+00 
+8f 
+e9 
+60 
+97 
+0e 
+00 
+00 
+8f 
+e9 
+60 
+95 
+ca 
+8f 
+e9 
+e8 
+95 
+0e 
+00 
+00 
+8f 
+e9 
+e8 
+95 
+0e 
+00 
+00 
+8f 
+e9 
+60 
+95 
+0e 
+00 
+00 
+8f 
+e9 
+60 
+95 
+0e 
+00 
+00 
diff --git a/modules/arch/x86/tests/xop-basic.asm b/modules/arch/x86/tests/xop-basic.asm
new file mode 100644
index 0000000..516b4bd
--- /dev/null
+++ b/modules/arch/x86/tests/xop-basic.asm
@@ -0,0 +1,8 @@
+[bits 64]
+vfrczpd ymm9, ymm10			; 8F 49 7C 81 312
+vfrczpd ymm9, [0]			; 8F 69 7C 81 0C 25 00 00 00 00
+vfrczpd ymm9, yword [0]			; 8F 69 7C 81 0C 25 00 00 00 00
+vfrczpd ymm9, [r8*4]			; 8F 29 7C 81 0C 85 00 00 00 00
+vfrczpd ymm9, [r8*4+r9]			; 8F 09 7C 81 0C 81
+
+vpcmov ymm10, ymm11, ymm12, ymm13	; 8F 48 24 A2 324 D0
diff --git a/modules/arch/x86/tests/xop-basic.hex b/modules/arch/x86/tests/xop-basic.hex
new file mode 100644
index 0000000..6be478a
--- /dev/null
+++ b/modules/arch/x86/tests/xop-basic.hex
@@ -0,0 +1,47 @@
+8f 
+49 
+7c 
+81 
+ca 
+8f 
+69 
+7c 
+81 
+0c 
+25 
+00 
+00 
+00 
+00 
+8f 
+69 
+7c 
+81 
+0c 
+25 
+00 
+00 
+00 
+00 
+8f 
+29 
+7c 
+81 
+0c 
+85 
+00 
+00 
+00 
+00 
+8f 
+09 
+7c 
+81 
+0c 
+81 
+8f 
+48 
+24 
+a2 
+d4 
+d0 
diff --git a/modules/arch/x86/tests/xop-cc.asm b/modules/arch/x86/tests/xop-cc.asm
new file mode 100644
index 0000000..8b8bbe3
--- /dev/null
+++ b/modules/arch/x86/tests/xop-cc.asm
@@ -0,0 +1,22 @@
+[bits 16]
+vpcomltb xmm1, xmm2, xmm3	; 8F E8 68 CC 313 00
+vpcomleb xmm1, xmm2, xmm3	; 8F E8 68 CC 313 01
+vpcomgtb xmm1, xmm2, xmm3	; 8F E8 68 CC 313 02
+vpcomgeb xmm1, xmm2, xmm3	; 8F E8 68 CC 313 03
+vpcomeqb xmm1, xmm2, xmm3	; 8F E8 68 CC 313 04
+vpcomneqb xmm1, xmm2, xmm3	; 8F E8 68 CC 313 05
+vpcomneb xmm1, xmm2, xmm3	; 8F E8 68 CC 313 05
+vpcomfalseb xmm1, xmm2, xmm3	; 8F E8 68 CC 313 06
+vpcomtrueb xmm1, xmm2, xmm3	; 8F E8 68 CC 313 07
+
+vpcomltuw xmm1, xmm2, xmm3	; 8F E8 68 ED 313 00
+vpcomleuw xmm1, xmm2, xmm3	; 8F E8 68 ED 313 01
+vpcomgtuw xmm1, xmm2, xmm3	; 8F E8 68 ED 313 02
+vpcomgeuw xmm1, xmm2, xmm3	; 8F E8 68 ED 313 03
+vpcomequw xmm1, xmm2, xmm3	; 8F E8 68 ED 313 04
+vpcomnequw xmm1, xmm2, xmm3	; 8F E8 68 ED 313 05
+vpcomneuw xmm1, xmm2, xmm3	; 8F E8 68 ED 313 05
+vpcomfalseuw xmm1, xmm2, xmm3	; 8F E8 68 ED 313 06
+vpcomtrueuw xmm1, xmm2, xmm3	; 8F E8 68 ED 313 07
+
+
diff --git a/modules/arch/x86/tests/xop-cc.hex b/modules/arch/x86/tests/xop-cc.hex
new file mode 100644
index 0000000..2430058
--- /dev/null
+++ b/modules/arch/x86/tests/xop-cc.hex
@@ -0,0 +1,108 @@
+8f 
+e8 
+68 
+cc 
+cb 
+00 
+8f 
+e8 
+68 
+cc 
+cb 
+01 
+8f 
+e8 
+68 
+cc 
+cb 
+02 
+8f 
+e8 
+68 
+cc 
+cb 
+03 
+8f 
+e8 
+68 
+cc 
+cb 
+04 
+8f 
+e8 
+68 
+cc 
+cb 
+05 
+8f 
+e8 
+68 
+cc 
+cb 
+05 
+8f 
+e8 
+68 
+cc 
+cb 
+06 
+8f 
+e8 
+68 
+cc 
+cb 
+07 
+8f 
+e8 
+68 
+ed 
+cb 
+00 
+8f 
+e8 
+68 
+ed 
+cb 
+01 
+8f 
+e8 
+68 
+ed 
+cb 
+02 
+8f 
+e8 
+68 
+ed 
+cb 
+03 
+8f 
+e8 
+68 
+ed 
+cb 
+04 
+8f 
+e8 
+68 
+ed 
+cb 
+05 
+8f 
+e8 
+68 
+ed 
+cb 
+05 
+8f 
+e8 
+68 
+ed 
+cb 
+06 
+8f 
+e8 
+68 
+ed 
+cb 
+07 
diff --git a/modules/dbgfmts/dwarf2/tests/gen64/Makefile.inc b/modules/dbgfmts/dwarf2/tests/gen64/Makefile.inc
new file mode 100644
index 0000000..88ca78c
--- /dev/null
+++ b/modules/dbgfmts/dwarf2/tests/gen64/Makefile.inc
@@ -0,0 +1,6 @@
+TESTS += modules/dbgfmts/dwarf2/tests/gen64/dwarf2_gen64_test.sh
+
+EXTRA_DIST += modules/dbgfmts/dwarf2/tests/gen64/dwarf2_gen64_test.sh
+EXTRA_DIST += modules/dbgfmts/dwarf2/tests/gen64/dwarf64_pathname.asm
+EXTRA_DIST += modules/dbgfmts/dwarf2/tests/gen64/dwarf64_pathname.hex
+
diff --git a/modules/dbgfmts/dwarf2/tests/gen64/dwarf2_gen64_test.sh b/modules/dbgfmts/dwarf2/tests/gen64/dwarf2_gen64_test.sh
new file mode 100755
index 0000000..dae5f42
--- /dev/null
+++ b/modules/dbgfmts/dwarf2/tests/gen64/dwarf2_gen64_test.sh
@@ -0,0 +1,3 @@
+#! /bin/sh
+${srcdir}/out_test.sh dwarf2_gen64_test modules/dbgfmts/dwarf2/tests/gen64 "dwarf2 dbgfmt gen64" "-f elf64 -g dwarf2" ".o"
+exit $?
diff --git a/modules/dbgfmts/dwarf2/tests/gen64/dwarf64_pathname.asm b/modules/dbgfmts/dwarf2/tests/gen64/dwarf64_pathname.asm
new file mode 100644
index 0000000..a216f9b
--- /dev/null
+++ b/modules/dbgfmts/dwarf2/tests/gen64/dwarf64_pathname.asm
@@ -0,0 +1,22 @@
+[bits 64]
+[section .text]
+[default rel]
+
+%line 1+0 ./some_filename
+; program tst_wyjatki
+global _start
+_start:
+  XOR EBP, EBP
+  CALL main
+  XOR RAX, RAX
+  MOV RDI, RAX
+  MOV RAX, 60
+  SYSCALL
+  HLT
+
+main:
+  PUSH rbp
+  MOV rbp, rsp
+  SUB RSP, 0x20
+    %line 2+0 some_filename
+    SUB RSP, 64
diff --git a/modules/dbgfmts/dwarf2/tests/gen64/dwarf64_pathname.hex b/modules/dbgfmts/dwarf2/tests/gen64/dwarf64_pathname.hex
new file mode 100644
index 0000000..c67b19d
--- /dev/null
+++ b/modules/dbgfmts/dwarf2/tests/gen64/dwarf64_pathname.hex
@@ -0,0 +1,1632 @@
+7f 
+45 
+4c 
+46 
+02 
+01 
+01 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+01 
+00 
+3e 
+00 
+01 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+60 
+03 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+40 
+00 
+00 
+00 
+00 
+00 
+40 
+00 
+0c 
+00 
+01 
+00 
+31 
+ed 
+e8 
+10 
+00 
+00 
+00 
+48 
+31 
+c0 
+48 
+89 
+c7 
+48 
+c7 
+c0 
+3c 
+00 
+00 
+00 
+0f 
+05 
+f4 
+55 
+48 
+89 
+e5 
+48 
+83 
+ec 
+20 
+48 
+83 
+ec 
+40 
+4c 
+00 
+00 
+00 
+02 
+00 
+29 
+00 
+00 
+00 
+01 
+01 
+fb 
+0e 
+0d 
+00 
+01 
+01 
+01 
+01 
+00 
+00 
+00 
+01 
+00 
+00 
+01 
+00 
+2d 
+00 
+00 
+00 
+00 
+73 
+6f 
+6d 
+65 
+5f 
+66 
+69 
+6c 
+65 
+6e 
+61 
+6d 
+65 
+00 
+00 
+00 
+00 
+00 
+04 
+02 
+00 
+09 
+02 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+01 
+2e 
+58 
+3c 
+3c 
+74 
+2e 
+20 
+20 
+3c 
+4b 
+02 
+04 
+00 
+01 
+01 
+00 
+38 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+01 
+00 
+00 
+00 
+08 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+01 
+11 
+00 
+10 
+06 
+11 
+01 
+12 
+01 
+03 
+08 
+1b 
+08 
+25 
+08 
+13 
+05 
+00 
+00 
+00 
+2d 
+00 
+00 
+00 
+02 
+00 
+00 
+00 
+00 
+00 
+08 
+01 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+2d 
+00 
+2e 
+2f 
+00 
+79 
+61 
+73 
+6d 
+20 
+48 
+45 
+41 
+44 
+00 
+01 
+80 
+00 
+00 
+00 
+06 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+0a 
+00 
+00 
+00 
+04 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+0c 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+0a 
+00 
+00 
+00 
+05 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+10 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+01 
+00 
+00 
+00 
+07 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+18 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+01 
+00 
+00 
+00 
+07 
+00 
+00 
+00 
+23 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+2c 
+00 
+00 
+00 
+02 
+00 
+00 
+00 
+00 
+00 
+08 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+23 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+06 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+0a 
+00 
+00 
+00 
+03 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+10 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+01 
+00 
+00 
+00 
+07 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+2e 
+74 
+65 
+78 
+74 
+00 
+2e 
+64 
+65 
+62 
+75 
+67 
+5f 
+6c 
+69 
+6e 
+65 
+00 
+2e 
+64 
+65 
+62 
+75 
+67 
+5f 
+61 
+62 
+62 
+72 
+65 
+76 
+00 
+2e 
+64 
+65 
+62 
+75 
+67 
+5f 
+69 
+6e 
+66 
+6f 
+00 
+2e 
+64 
+65 
+62 
+75 
+67 
+5f 
+61 
+72 
+61 
+6e 
+67 
+65 
+73 
+00 
+2e 
+72 
+65 
+6c 
+61 
+2e 
+64 
+65 
+62 
+75 
+67 
+5f 
+6c 
+69 
+6e 
+65 
+00 
+2e 
+72 
+65 
+6c 
+61 
+2e 
+64 
+65 
+62 
+75 
+67 
+5f 
+69 
+6e 
+66 
+6f 
+00 
+2e 
+72 
+65 
+6c 
+61 
+2e 
+64 
+65 
+62 
+75 
+67 
+5f 
+61 
+72 
+61 
+6e 
+67 
+65 
+73 
+00 
+2e 
+73 
+74 
+72 
+74 
+61 
+62 
+00 
+2e 
+73 
+79 
+6d 
+74 
+61 
+62 
+00 
+2e 
+73 
+68 
+73 
+74 
+72 
+74 
+61 
+62 
+00 
+00 
+2d 
+00 
+5f 
+73 
+74 
+61 
+72 
+74 
+00 
+6d 
+61 
+69 
+6e 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+01 
+00 
+00 
+00 
+04 
+00 
+f1 
+ff 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+03 
+00 
+0a 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+03 
+00 
+08 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+03 
+00 
+07 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+03 
+00 
+05 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+0a 
+00 
+00 
+00 
+00 
+00 
+04 
+00 
+17 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+03 
+00 
+04 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+03 
+00 
+00 
+00 
+10 
+00 
+04 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+82 
+00 
+00 
+00 
+03 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+e0 
+01 
+00 
+00 
+00 
+00 
+00 
+00 
+8c 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+72 
+00 
+00 
+00 
+03 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+6c 
+02 
+00 
+00 
+00 
+00 
+00 
+00 
+0f 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+7a 
+00 
+00 
+00 
+02 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+7c 
+02 
+00 
+00 
+00 
+00 
+00 
+00 
+d8 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+02 
+00 
+00 
+00 
+08 
+00 
+00 
+00 
+08 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+18 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+01 
+00 
+00 
+00 
+01 
+00 
+00 
+00 
+06 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+40 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+23 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+10 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+07 
+00 
+00 
+00 
+01 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+63 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+50 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+01 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+3c 
+00 
+00 
+00 
+04 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+b4 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+18 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+03 
+00 
+00 
+00 
+05 
+00 
+00 
+00 
+08 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+18 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+13 
+00 
+00 
+00 
+01 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+cc 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+14 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+21 
+00 
+00 
+00 
+01 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+e0 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+31 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+4d 
+00 
+00 
+00 
+04 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+14 
+01 
+00 
+00 
+00 
+00 
+00 
+00 
+60 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+03 
+00 
+00 
+00 
+08 
+00 
+00 
+00 
+08 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+18 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+2d 
+00 
+00 
+00 
+01 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+80 
+01 
+00 
+00 
+00 
+00 
+00 
+00 
+30 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+10 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+5e 
+00 
+00 
+00 
+04 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+b0 
+01 
+00 
+00 
+00 
+00 
+00 
+00 
+30 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+03 
+00 
+00 
+00 
+0a 
+00 
+00 
+00 
+08 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+18 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
diff --git a/modules/objfmts/bin/tests/bin-rip.asm b/modules/objfmts/bin/tests/bin-rip.asm
old mode 100644
new mode 100755
diff --git a/modules/objfmts/elf/tests/amd64/multiplefixup.asm b/modules/objfmts/elf/tests/amd64/multiplefixup.asm
new file mode 100644
index 0000000..ec253cb
--- /dev/null
+++ b/modules/objfmts/elf/tests/amd64/multiplefixup.asm
@@ -0,0 +1,8 @@
+[section .data]
+foobar:
+	dq	42
+[section .text]
+foo:
+	times 4 mov rax, [rel foobar]
+	times 4 mov rax, [foobar]
+	times 4 jmp foo
diff --git a/modules/objfmts/elf/tests/amd64/multiplefixup.hex b/modules/objfmts/elf/tests/amd64/multiplefixup.hex
new file mode 100644
index 0000000..16565ff
--- /dev/null
+++ b/modules/objfmts/elf/tests/amd64/multiplefixup.hex
@@ -0,0 +1,992 @@
+7f 
+45 
+4c 
+46 
+02 
+01 
+01 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+01 
+00 
+3e 
+00 
+01 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+20 
+02 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+40 
+00 
+00 
+00 
+00 
+00 
+40 
+00 
+07 
+00 
+01 
+00 
+48 
+8b 
+05 
+00 
+00 
+00 
+00 
+48 
+8b 
+05 
+00 
+00 
+00 
+00 
+48 
+8b 
+05 
+00 
+00 
+00 
+00 
+48 
+8b 
+05 
+00 
+00 
+00 
+00 
+48 
+8b 
+04 
+25 
+00 
+00 
+00 
+00 
+48 
+8b 
+04 
+25 
+00 
+00 
+00 
+00 
+48 
+8b 
+04 
+25 
+00 
+00 
+00 
+00 
+48 
+8b 
+04 
+25 
+00 
+00 
+00 
+00 
+eb 
+c2 
+eb 
+c0 
+eb 
+be 
+eb 
+bc 
+03 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+02 
+00 
+00 
+00 
+04 
+00 
+00 
+00 
+fc 
+ff 
+ff 
+ff 
+ff 
+ff 
+ff 
+ff 
+0a 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+02 
+00 
+00 
+00 
+04 
+00 
+00 
+00 
+fc 
+ff 
+ff 
+ff 
+ff 
+ff 
+ff 
+ff 
+11 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+02 
+00 
+00 
+00 
+04 
+00 
+00 
+00 
+fc 
+ff 
+ff 
+ff 
+ff 
+ff 
+ff 
+ff 
+18 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+02 
+00 
+00 
+00 
+04 
+00 
+00 
+00 
+fc 
+ff 
+ff 
+ff 
+ff 
+ff 
+ff 
+ff 
+20 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+0a 
+00 
+00 
+00 
+04 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+28 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+0a 
+00 
+00 
+00 
+04 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+30 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+0a 
+00 
+00 
+00 
+04 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+38 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+0a 
+00 
+00 
+00 
+04 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+2a 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+2e 
+74 
+65 
+78 
+74 
+00 
+2e 
+64 
+61 
+74 
+61 
+00 
+2e 
+72 
+65 
+6c 
+61 
+2e 
+74 
+65 
+78 
+74 
+00 
+2e 
+73 
+74 
+72 
+74 
+61 
+62 
+00 
+2e 
+73 
+79 
+6d 
+74 
+61 
+62 
+00 
+2e 
+73 
+68 
+73 
+74 
+72 
+74 
+61 
+62 
+00 
+00 
+00 
+00 
+2d 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+01 
+00 
+00 
+00 
+04 
+00 
+f1 
+ff 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+04 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+06 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+03 
+00 
+06 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+03 
+00 
+04 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+28 
+00 
+00 
+00 
+03 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+4c 
+01 
+00 
+00 
+00 
+00 
+00 
+00 
+32 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+18 
+00 
+00 
+00 
+03 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+80 
+01 
+00 
+00 
+00 
+00 
+00 
+00 
+03 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+20 
+00 
+00 
+00 
+02 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+84 
+01 
+00 
+00 
+00 
+00 
+00 
+00 
+90 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+02 
+00 
+00 
+00 
+06 
+00 
+00 
+00 
+08 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+18 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+01 
+00 
+00 
+00 
+01 
+00 
+00 
+00 
+06 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+40 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+44 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+10 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+0d 
+00 
+00 
+00 
+04 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+84 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+c0 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+03 
+00 
+00 
+00 
+04 
+00 
+00 
+00 
+08 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+18 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+07 
+00 
+00 
+00 
+01 
+00 
+00 
+00 
+03 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+44 
+01 
+00 
+00 
+00 
+00 
+00 
+00 
+08 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+04 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
diff --git a/modules/objfmts/elf/tests/elfmanysym.asm b/modules/objfmts/elf/tests/elfmanysym.asm
old mode 100644
new mode 100755
diff --git a/modules/objfmts/elf/tests/gas32/elf_gas32_got.asm b/modules/objfmts/elf/tests/gas32/elf_gas32_got.asm
new file mode 100644
index 0000000..22a60a5
--- /dev/null
+++ b/modules/objfmts/elf/tests/gas32/elf_gas32_got.asm
@@ -0,0 +1,13 @@
+.text
+
+.extern a
+
+.globl tst
+tst:
+   call L1
+L1:
+   pop %eax
+   add $_GLOBAL_OFFSET_TABLE_+(.-L1), %eax
+   mov (a@GOT)(%eax), %eax
+   movl $5, (%eax)
+   ret
diff --git a/modules/objfmts/elf/tests/gas32/elf_gas32_got.hex b/modules/objfmts/elf/tests/gas32/elf_gas32_got.hex
new file mode 100644
index 0000000..c7060e6
--- /dev/null
+++ b/modules/objfmts/elf/tests/gas32/elf_gas32_got.hex
@@ -0,0 +1,544 @@
+7f 
+45 
+4c 
+46 
+01 
+01 
+01 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+01 
+00 
+03 
+00 
+01 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+30 
+01 
+00 
+00 
+00 
+00 
+00 
+00 
+34 
+00 
+00 
+00 
+00 
+00 
+28 
+00 
+06 
+00 
+01 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+e8 
+00 
+00 
+00 
+00 
+58 
+05 
+02 
+00 
+00 
+00 
+8b 
+80 
+00 
+00 
+00 
+00 
+c7 
+00 
+05 
+00 
+00 
+00 
+c3 
+07 
+00 
+00 
+00 
+0a 
+06 
+00 
+00 
+0d 
+00 
+00 
+00 
+03 
+04 
+00 
+00 
+00 
+2e 
+74 
+65 
+78 
+74 
+00 
+2e 
+72 
+65 
+6c 
+2e 
+74 
+65 
+78 
+74 
+00 
+2e 
+73 
+74 
+72 
+74 
+61 
+62 
+00 
+2e 
+73 
+79 
+6d 
+74 
+61 
+62 
+00 
+2e 
+73 
+68 
+73 
+74 
+72 
+74 
+61 
+62 
+00 
+00 
+00 
+2d 
+00 
+61 
+00 
+74 
+73 
+74 
+00 
+5f 
+47 
+4c 
+4f 
+42 
+41 
+4c 
+5f 
+4f 
+46 
+46 
+53 
+45 
+54 
+5f 
+54 
+41 
+42 
+4c 
+45 
+5f 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+01 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+04 
+00 
+f1 
+ff 
+00 
+00 
+00 
+00 
+05 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+04 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+03 
+00 
+04 
+00 
+03 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+10 
+00 
+00 
+00 
+05 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+10 
+00 
+04 
+00 
+09 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+10 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+21 
+00 
+00 
+00 
+03 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+68 
+00 
+00 
+00 
+2b 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+11 
+00 
+00 
+00 
+03 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+94 
+00 
+00 
+00 
+1f 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+19 
+00 
+00 
+00 
+02 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+b4 
+00 
+00 
+00 
+70 
+00 
+00 
+00 
+02 
+00 
+00 
+00 
+04 
+00 
+00 
+00 
+04 
+00 
+00 
+00 
+10 
+00 
+00 
+00 
+01 
+00 
+00 
+00 
+01 
+00 
+00 
+00 
+06 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+40 
+00 
+00 
+00 
+18 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+10 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+07 
+00 
+00 
+00 
+09 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+58 
+00 
+00 
+00 
+10 
+00 
+00 
+00 
+03 
+00 
+00 
+00 
+04 
+00 
+00 
+00 
+04 
+00 
+00 
+00 
+08 
+00 
+00 
+00 
diff --git a/modules/objfmts/macho/tests/nasm32/macho32-pext.asm b/modules/objfmts/macho/tests/nasm32/macho32-pext.asm
new file mode 100644
index 0000000..f881b4f
--- /dev/null
+++ b/modules/objfmts/macho/tests/nasm32/macho32-pext.asm
@@ -0,0 +1,4 @@
+[GLOBAL function:private_extern]
+
+function:
+	ret
diff --git a/modules/objfmts/macho/tests/nasm32/macho32-pext.hex b/modules/objfmts/macho/tests/nasm32/macho32-pext.hex
new file mode 100644
index 0000000..6a8eb4f
--- /dev/null
+++ b/modules/objfmts/macho/tests/nasm32/macho32-pext.hex
@@ -0,0 +1,202 @@
+ce 
+fa 
+ed 
+fe 
+07 
+00 
+00 
+00 
+03 
+00 
+00 
+00 
+01 
+00 
+00 
+00 
+02 
+00 
+00 
+00 
+94 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+01 
+00 
+00 
+00 
+7c 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+01 
+00 
+00 
+00 
+b0 
+00 
+00 
+00 
+01 
+00 
+00 
+00 
+07 
+00 
+00 
+00 
+07 
+00 
+00 
+00 
+01 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+5f 
+5f 
+74 
+65 
+78 
+74 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+5f 
+5f 
+54 
+45 
+58 
+54 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+01 
+00 
+00 
+00 
+b0 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+80 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+02 
+00 
+00 
+00 
+18 
+00 
+00 
+00 
+b4 
+00 
+00 
+00 
+01 
+00 
+00 
+00 
+c0 
+00 
+00 
+00 
+0a 
+00 
+00 
+00 
+c3 
+00 
+00 
+00 
+01 
+00 
+00 
+00 
+1f 
+01 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+66 
+75 
+6e 
+63 
+74 
+69 
+6f 
+6e 
+00 
diff --git a/modules/objfmts/macho/tests/nasm32/macho32-pic.asm b/modules/objfmts/macho/tests/nasm32/macho32-pic.asm
new file mode 100644
index 0000000..438923d
--- /dev/null
+++ b/modules/objfmts/macho/tests/nasm32/macho32-pic.asm
@@ -0,0 +1,46 @@
+; At present, nasm doesn't seem to support PIC generation for Mach-O.
+; The PIC support code below is a little tricky.
+[extern func]
+        SECTION .rodata
+const_base:
+
+%define GOTOFF(got,sym) (got) + (sym) - const_base
+
+%imacro get_GOT 1
+        ; NOTE: this macro destroys ecx resister.
+        call    %%geteip
+        add     ecx, byte (%%ref - $)
+        jmp     short %%adjust
+%%geteip:
+        mov     ecx, [esp]
+        ret
+%%adjust:
+        push    ebp
+        xor     ebp,ebp         ; ebp = 0
+%ifidni %1,ebx  ; (%1 == ebx)
+        ; db 0x8D,0x9C + jmp near const_base =
+        ;   lea ebx, [ecx+ebp*8+(const_base-%%ref)] ; 8D,9C,E9,(offset32)
+        db      0x8D,0x9C               ; 8D,9C
+        jmp     near const_base         ; E9,(const_base-%%ref)
+%%ref:
+%else  ; (%1 != ebx)
+        ; db 0x8D,0x8C + jmp near const_base =
+        ;   lea ecx, [ecx+ebp*8+(const_base-%%ref)] ; 8D,8C,E9,(offset32)
+        db      0x8D,0x8C               ; 8D,8C
+        jmp     strict near const_base          ; E9,(const_base-%%ref)
+%%ref:  mov     %1, ecx
+%endif ; (%1 == ebx)
+        pop     ebp
+%endmacro
+
+SECTION .text
+
+jmp const_base
+
+get_GOT ebx
+
+jmp const_base
+
+call func
+
+ret
diff --git a/modules/objfmts/macho/tests/nasm32/macho32-pic.hex b/modules/objfmts/macho/tests/nasm32/macho32-pic.hex
new file mode 100644
index 0000000..f81f708
--- /dev/null
+++ b/modules/objfmts/macho/tests/nasm32/macho32-pic.hex
@@ -0,0 +1,338 @@
+ce 
+fa 
+ed 
+fe 
+07 
+00 
+00 
+00 
+03 
+00 
+00 
+00 
+01 
+00 
+00 
+00 
+02 
+00 
+00 
+00 
+d8 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+01 
+00 
+00 
+00 
+c0 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+29 
+00 
+00 
+00 
+f4 
+00 
+00 
+00 
+29 
+00 
+00 
+00 
+07 
+00 
+00 
+00 
+07 
+00 
+00 
+00 
+02 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+5f 
+5f 
+74 
+65 
+78 
+74 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+5f 
+5f 
+54 
+45 
+58 
+54 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+29 
+00 
+00 
+00 
+f4 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+20 
+01 
+00 
+00 
+04 
+00 
+00 
+00 
+00 
+03 
+00 
+80 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+5f 
+5f 
+63 
+6f 
+6e 
+73 
+74 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+5f 
+5f 
+44 
+41 
+54 
+41 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+29 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+1d 
+01 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+02 
+00 
+00 
+00 
+18 
+00 
+00 
+00 
+40 
+01 
+00 
+00 
+01 
+00 
+00 
+00 
+4c 
+01 
+00 
+00 
+06 
+00 
+00 
+00 
+e9 
+24 
+00 
+00 
+00 
+e8 
+05 
+00 
+00 
+00 
+83 
+c1 
+13 
+eb 
+04 
+8b 
+0c 
+24 
+c3 
+55 
+31 
+ed 
+8d 
+9c 
+e9 
+0c 
+00 
+00 
+00 
+5d 
+e9 
+06 
+00 
+00 
+00 
+e8 
+d8 
+ff 
+ff 
+ff 
+c3 
+00 
+00 
+00 
+01 
+00 
+00 
+00 
+02 
+00 
+00 
+05 
+19 
+00 
+00 
+00 
+02 
+00 
+00 
+05 
+1f 
+00 
+00 
+00 
+02 
+00 
+00 
+05 
+24 
+00 
+00 
+00 
+00 
+00 
+00 
+0d 
+01 
+00 
+00 
+00 
+01 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+66 
+75 
+6e 
+63 
+00 
diff --git a/modules/objfmts/macho/tests/nasm32/macho32-size.asm b/modules/objfmts/macho/tests/nasm32/macho32-size.asm
new file mode 100644
index 0000000..f8cd50f
--- /dev/null
+++ b/modules/objfmts/macho/tests/nasm32/macho32-size.asm
@@ -0,0 +1,60 @@
+			section .data align=16
+
+			align 16
+
+			mmx_yuy2_00ff	dw 000ffh, 000ffh, 000ffh, 000ffh
+
+			section .text
+
+; -- Import/Export ------------------------------------------------------
+
+			global mb_yuy2yuv_mmx
+
+			struc macroblock_yuy2_param
+			.dsty:		resd 1
+			.dstu:		resd 1
+			.dstv:		resd 1
+			.dypitch:	resd 1
+			.dcpitch:	resd 1
+			.src:		resd 1
+			.spitch:	resd 1
+			endstruc
+
+; -----------------------------------------------------------------------
+;  -= mb_yuy2yuv_mmx =-
+;  
+;  extern "C" int __fastcall mb_yuy2yuv_mmx( macroblock_param *param );
+; -----------------------------------------------------------------------
+
+			align 16
+
+mb_yuy2yuv_mmx:
+
+			push		ebx
+			push		edx
+
+			push		esi
+			push		edi
+			push		ebp
+
+			mov			esi, [ecx + macroblock_yuy2_param.src]
+			mov			edx, [ecx + macroblock_yuy2_param.spitch]
+
+			mov			edi, [ecx + macroblock_yuy2_param.dsty]
+			mov			eax, [ecx + macroblock_yuy2_param.dstu]
+			mov			ebx, [ecx + macroblock_yuy2_param.dstv]
+
+			mov			ebp, [ecx + macroblock_yuy2_param.dypitch]
+			mov			ecx, [ecx + macroblock_yuy2_param.dcpitch]
+
+			movq		mm6, [mmx_yuy2_00ff]
+
+			pop			ebp
+			pop			edi
+			pop			esi
+
+			pop			edx
+			pop			ebx
+
+			retn
+
diff --git a/modules/objfmts/macho/tests/nasm32/macho32-size.hex b/modules/objfmts/macho/tests/nasm32/macho32-size.hex
new file mode 100644
index 0000000..2ed324e
--- /dev/null
+++ b/modules/objfmts/macho/tests/nasm32/macho32-size.hex
@@ -0,0 +1,328 @@
+ce 
+fa 
+ed 
+fe 
+07 
+00 
+00 
+00 
+03 
+00 
+00 
+00 
+01 
+00 
+00 
+00 
+02 
+00 
+00 
+00 
+d8 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+01 
+00 
+00 
+00 
+c0 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+38 
+00 
+00 
+00 
+f4 
+00 
+00 
+00 
+2e 
+00 
+00 
+00 
+07 
+00 
+00 
+00 
+07 
+00 
+00 
+00 
+02 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+5f 
+5f 
+74 
+65 
+78 
+74 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+5f 
+5f 
+54 
+45 
+58 
+54 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+26 
+00 
+00 
+00 
+f4 
+00 
+00 
+00 
+04 
+00 
+00 
+00 
+24 
+01 
+00 
+00 
+01 
+00 
+00 
+00 
+00 
+01 
+00 
+80 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+5f 
+5f 
+64 
+61 
+74 
+61 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+5f 
+5f 
+44 
+41 
+54 
+41 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+30 
+00 
+00 
+00 
+08 
+00 
+00 
+00 
+1a 
+01 
+00 
+00 
+04 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+02 
+00 
+00 
+00 
+18 
+00 
+00 
+00 
+2c 
+01 
+00 
+00 
+01 
+00 
+00 
+00 
+38 
+01 
+00 
+00 
+10 
+00 
+00 
+00 
+53 
+52 
+56 
+57 
+55 
+8b 
+71 
+14 
+8b 
+51 
+18 
+8b 
+39 
+8b 
+41 
+04 
+8b 
+59 
+08 
+8b 
+69 
+0c 
+8b 
+49 
+10 
+0f 
+6f 
+35 
+30 
+00 
+00 
+00 
+5d 
+5f 
+5e 
+5a 
+5b 
+c3 
+ff 
+00 
+ff 
+00 
+ff 
+00 
+ff 
+00 
+00 
+00 
+1c 
+00 
+00 
+00 
+02 
+00 
+00 
+04 
+01 
+00 
+00 
+00 
+0f 
+01 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+6d 
+62 
+5f 
+79 
+75 
+79 
+32 
+79 
+75 
+76 
+5f 
+6d 
+6d 
+78 
+00 
diff --git a/modules/objfmts/win32/tests/gas/win32def.asm b/modules/objfmts/win32/tests/gas/win32def.asm
new file mode 100644
index 0000000..e476466
--- /dev/null
+++ b/modules/objfmts/win32/tests/gas/win32def.asm
@@ -0,0 +1,7 @@
+.globl label
+label:
+
+.def label
+.scl 2
+.type 32
+.endef
diff --git a/modules/objfmts/win32/tests/gas/win32def.hex b/modules/objfmts/win32/tests/gas/win32def.hex
new file mode 100644
index 0000000..bfedd51
--- /dev/null
+++ b/modules/objfmts/win32/tests/gas/win32def.hex
@@ -0,0 +1,172 @@
+4c 
+01 
+01 
+00 
+00 
+00 
+00 
+00 
+3c 
+00 
+00 
+00 
+06 
+00 
+00 
+00 
+00 
+00 
+0c 
+01 
+2e 
+74 
+65 
+78 
+74 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+20 
+00 
+50 
+60 
+2e 
+66 
+69 
+6c 
+65 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+fe 
+ff 
+00 
+00 
+67 
+01 
+2d 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+40 
+66 
+65 
+61 
+74 
+2e 
+30 
+30 
+01 
+00 
+00 
+00 
+ff 
+ff 
+00 
+00 
+03 
+00 
+2e 
+74 
+65 
+78 
+74 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+01 
+00 
+00 
+00 
+03 
+01 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+6c 
+61 
+62 
+65 
+6c 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+01 
+00 
+20 
+00 
+02 
+00 
+04 
+00 
+00 
+00 
diff --git a/modules/objfmts/win32/tests/gas/win32secrel32.asm b/modules/objfmts/win32/tests/gas/win32secrel32.asm
new file mode 100644
index 0000000..0e8a82f
--- /dev/null
+++ b/modules/objfmts/win32/tests/gas/win32secrel32.asm
@@ -0,0 +1,80 @@
+# [oformat win32]

+.text

+

+	.ascii ">>>>"

+pre04:	.ascii "<<<<"

+	.ascii ">>>>>"

+pre0d:	.ascii "<<<"

+	.ascii ">>>>>>"

+pre16:	.ascii "<<"

+	.ascii ">>>>>>>"

+pre1f:	.ascii "<"

+

+.data

+

+	.ascii ">>>>"

+sam04:	.ascii "<<<<"

+	.ascii ">>>>>"

+sam0d:	.ascii "<<<"

+	.ascii ">>>>>>"

+sam16:	.ascii "<<"

+	.ascii ">>>>>>>"

+sam1f:	.ascii "<"

+

+	.ascii ">>>>"

+	.secrel32 pre04

+	.byte 0x11

+	.secrel32 pre0d

+	.byte 0x11

+	.secrel32 pre16

+	.byte 0x11

+	.secrel32 pre1f

+	.byte 0x11

+	.ascii "<<<<<<<<"

+

+	.ascii ">>>>"

+	.secrel32 sam04

+	.byte 0x11

+	.secrel32 sam0d

+	.byte 0x11

+	.secrel32 sam16

+	.byte 0x11

+	.secrel32 sam1f

+	.byte 0x11

+	.ascii "<<<<<<<<"

+

+	.ascii ">>>>"

+	.secrel32 nex04

+	.byte 0x11

+	.secrel32 nex0d

+	.byte 0x11

+	.secrel32 nex16

+	.byte 0x11

+	.secrel32 nex1f

+	.byte 0x11

+	.ascii "<<<<<<<<"

+

+	.ascii ">>>>"

+	.secrel32 ext24

+	.byte 0x11

+	.secrel32 ext2d

+	.byte 0x11

+	.secrel32 ext36

+	.byte 0x11

+	.secrel32 ext3f

+	.byte 0x11

+	.ascii "<<<<<<<<"

+

+.section .rdata

+

+	.ascii ">>>>"

+nex04:	.ascii "<<<<"

+	.ascii ">>>>>"

+nex0d:	.ascii "<<<"

+	.ascii ">>>>>>"

+nex16:	.ascii "<<"

+	.ascii ">>>>>>>"

+nex1f:	.ascii "<"

+	.ascii ">>>>"

+

+	.p2align 4,0

diff --git a/modules/objfmts/win32/tests/gas/win32secrel32.hex b/modules/objfmts/win32/tests/gas/win32secrel32.hex
new file mode 100644
index 0000000..28cc864
--- /dev/null
+++ b/modules/objfmts/win32/tests/gas/win32secrel32.hex
@@ -0,0 +1,778 @@
+4c 
+01 
+03 
+00 
+00 
+00 
+00 
+00 
+1c 
+02 
+00 
+00 
+0d 
+00 
+00 
+00 
+00 
+00 
+0c 
+01 
+2e 
+74 
+65 
+78 
+74 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+20 
+00 
+00 
+00 
+8c 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+20 
+00 
+50 
+60 
+2e 
+64 
+61 
+74 
+61 
+00 
+00 
+00 
+20 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+a0 
+00 
+00 
+00 
+ac 
+00 
+00 
+00 
+4c 
+01 
+00 
+00 
+00 
+00 
+00 
+00 
+10 
+00 
+00 
+00 
+40 
+00 
+30 
+c0 
+2e 
+72 
+64 
+61 
+74 
+61 
+00 
+00 
+c0 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+30 
+00 
+00 
+00 
+ec 
+01 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+40 
+00 
+50 
+40 
+3e 
+3e 
+3e 
+3e 
+3c 
+3c 
+3c 
+3c 
+3e 
+3e 
+3e 
+3e 
+3e 
+3c 
+3c 
+3c 
+3e 
+3e 
+3e 
+3e 
+3e 
+3e 
+3c 
+3c 
+3e 
+3e 
+3e 
+3e 
+3e 
+3e 
+3e 
+3c 
+3e 
+3e 
+3e 
+3e 
+3c 
+3c 
+3c 
+3c 
+3e 
+3e 
+3e 
+3e 
+3e 
+3c 
+3c 
+3c 
+3e 
+3e 
+3e 
+3e 
+3e 
+3e 
+3c 
+3c 
+3e 
+3e 
+3e 
+3e 
+3e 
+3e 
+3e 
+3c 
+3e 
+3e 
+3e 
+3e 
+04 
+00 
+00 
+00 
+11 
+0d 
+00 
+00 
+00 
+11 
+16 
+00 
+00 
+00 
+11 
+1f 
+00 
+00 
+00 
+11 
+3c 
+3c 
+3c 
+3c 
+3c 
+3c 
+3c 
+3c 
+3e 
+3e 
+3e 
+3e 
+04 
+00 
+00 
+00 
+11 
+0d 
+00 
+00 
+00 
+11 
+16 
+00 
+00 
+00 
+11 
+1f 
+00 
+00 
+00 
+11 
+3c 
+3c 
+3c 
+3c 
+3c 
+3c 
+3c 
+3c 
+3e 
+3e 
+3e 
+3e 
+04 
+00 
+00 
+00 
+11 
+0d 
+00 
+00 
+00 
+11 
+16 
+00 
+00 
+00 
+11 
+1f 
+00 
+00 
+00 
+11 
+3c 
+3c 
+3c 
+3c 
+3c 
+3c 
+3c 
+3c 
+3e 
+3e 
+3e 
+3e 
+00 
+00 
+00 
+00 
+11 
+00 
+00 
+00 
+00 
+11 
+00 
+00 
+00 
+00 
+11 
+00 
+00 
+00 
+00 
+11 
+3c 
+3c 
+3c 
+3c 
+3c 
+3c 
+3c 
+3c 
+24 
+00 
+00 
+00 
+03 
+00 
+00 
+00 
+0b 
+00 
+29 
+00 
+00 
+00 
+03 
+00 
+00 
+00 
+0b 
+00 
+2e 
+00 
+00 
+00 
+03 
+00 
+00 
+00 
+0b 
+00 
+33 
+00 
+00 
+00 
+03 
+00 
+00 
+00 
+0b 
+00 
+44 
+00 
+00 
+00 
+05 
+00 
+00 
+00 
+0b 
+00 
+49 
+00 
+00 
+00 
+05 
+00 
+00 
+00 
+0b 
+00 
+4e 
+00 
+00 
+00 
+05 
+00 
+00 
+00 
+0b 
+00 
+53 
+00 
+00 
+00 
+05 
+00 
+00 
+00 
+0b 
+00 
+64 
+00 
+00 
+00 
+0b 
+00 
+00 
+00 
+0b 
+00 
+69 
+00 
+00 
+00 
+0b 
+00 
+00 
+00 
+0b 
+00 
+6e 
+00 
+00 
+00 
+0b 
+00 
+00 
+00 
+0b 
+00 
+73 
+00 
+00 
+00 
+0b 
+00 
+00 
+00 
+0b 
+00 
+84 
+00 
+00 
+00 
+07 
+00 
+00 
+00 
+0b 
+00 
+89 
+00 
+00 
+00 
+08 
+00 
+00 
+00 
+0b 
+00 
+8e 
+00 
+00 
+00 
+09 
+00 
+00 
+00 
+0b 
+00 
+93 
+00 
+00 
+00 
+0a 
+00 
+00 
+00 
+0b 
+00 
+3e 
+3e 
+3e 
+3e 
+3c 
+3c 
+3c 
+3c 
+3e 
+3e 
+3e 
+3e 
+3e 
+3c 
+3c 
+3c 
+3e 
+3e 
+3e 
+3e 
+3e 
+3e 
+3c 
+3c 
+3e 
+3e 
+3e 
+3e 
+3e 
+3e 
+3e 
+3c 
+3e 
+3e 
+3e 
+3e 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+2e 
+66 
+69 
+6c 
+65 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+fe 
+ff 
+00 
+00 
+67 
+01 
+2d 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+40 
+66 
+65 
+61 
+74 
+2e 
+30 
+30 
+01 
+00 
+00 
+00 
+ff 
+ff 
+00 
+00 
+03 
+00 
+2e 
+74 
+65 
+78 
+74 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+01 
+00 
+00 
+00 
+03 
+01 
+20 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+2e 
+64 
+61 
+74 
+61 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+02 
+00 
+00 
+00 
+03 
+01 
+a0 
+00 
+00 
+00 
+10 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+65 
+78 
+74 
+32 
+34 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+02 
+00 
+65 
+78 
+74 
+32 
+64 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+02 
+00 
+65 
+78 
+74 
+33 
+36 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+02 
+00 
+65 
+78 
+74 
+33 
+66 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+02 
+00 
+2e 
+72 
+64 
+61 
+74 
+61 
+00 
+00 
+00 
+00 
+00 
+00 
+03 
+00 
+00 
+00 
+03 
+01 
+30 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+04 
+00 
+00 
+00 
diff --git a/modules/objfmts/win64/tests/win64-imagebase.asm b/modules/objfmts/win64/tests/win64-imagebase.asm
new file mode 100644
index 0000000..bd63602
--- /dev/null
+++ b/modules/objfmts/win64/tests/win64-imagebase.asm
@@ -0,0 +1,17 @@
+[section .text]
+handler: ret
+func:	ret
+func_end:
+
+[section .pdata]
+	dd func
+	dd func_end
+	dd myunwnd
+
+[section .xdata]
+myunwnd:
+	db 9,0,0,0
+	dd handler
+
+[section .foo]
+	dd handler wrt ..imagebase
diff --git a/modules/objfmts/win64/tests/win64-imagebase.hex b/modules/objfmts/win64/tests/win64-imagebase.hex
new file mode 100644
index 0000000..b715eb4
--- /dev/null
+++ b/modules/objfmts/win64/tests/win64-imagebase.hex
@@ -0,0 +1,512 @@
+64 
+86 
+04 
+00 
+00 
+00 
+00 
+00 
+00 
+01 
+00 
+00 
+0e 
+00 
+00 
+00 
+00 
+00 
+04 
+00 
+2e 
+74 
+65 
+78 
+74 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+02 
+00 
+00 
+00 
+b4 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+20 
+00 
+50 
+60 
+2e 
+70 
+64 
+61 
+74 
+61 
+00 
+00 
+02 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+0c 
+00 
+00 
+00 
+b6 
+00 
+00 
+00 
+c2 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+03 
+00 
+00 
+00 
+40 
+00 
+30 
+40 
+2e 
+78 
+64 
+61 
+74 
+61 
+00 
+00 
+0e 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+08 
+00 
+00 
+00 
+e0 
+00 
+00 
+00 
+e8 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+01 
+00 
+00 
+00 
+40 
+00 
+40 
+40 
+2e 
+66 
+6f 
+6f 
+00 
+00 
+00 
+00 
+16 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+04 
+00 
+00 
+00 
+f2 
+00 
+00 
+00 
+f6 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+01 
+00 
+00 
+00 
+20 
+00 
+00 
+60 
+c3 
+c3 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+05 
+00 
+00 
+00 
+03 
+00 
+04 
+00 
+00 
+00 
+06 
+00 
+00 
+00 
+03 
+00 
+08 
+00 
+00 
+00 
+09 
+00 
+00 
+00 
+03 
+00 
+09 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+04 
+00 
+00 
+00 
+04 
+00 
+00 
+00 
+03 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+04 
+00 
+00 
+00 
+03 
+00 
+2e 
+66 
+69 
+6c 
+65 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+fe 
+ff 
+00 
+00 
+67 
+01 
+2d 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+2e 
+74 
+65 
+78 
+74 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+01 
+00 
+00 
+00 
+03 
+01 
+02 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+68 
+61 
+6e 
+64 
+6c 
+65 
+72 
+00 
+00 
+00 
+00 
+00 
+01 
+00 
+00 
+00 
+03 
+00 
+66 
+75 
+6e 
+63 
+00 
+00 
+00 
+00 
+01 
+00 
+00 
+00 
+01 
+00 
+00 
+00 
+03 
+00 
+66 
+75 
+6e 
+63 
+5f 
+65 
+6e 
+64 
+02 
+00 
+00 
+00 
+01 
+00 
+00 
+00 
+03 
+00 
+2e 
+70 
+64 
+61 
+74 
+61 
+00 
+00 
+00 
+00 
+00 
+00 
+02 
+00 
+00 
+00 
+03 
+01 
+0c 
+00 
+00 
+00 
+03 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+6d 
+79 
+75 
+6e 
+77 
+6e 
+64 
+00 
+00 
+00 
+00 
+00 
+03 
+00 
+00 
+00 
+03 
+00 
+2e 
+78 
+64 
+61 
+74 
+61 
+00 
+00 
+00 
+00 
+00 
+00 
+03 
+00 
+00 
+00 
+03 
+01 
+08 
+00 
+00 
+00 
+01 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+2e 
+66 
+6f 
+6f 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+04 
+00 
+00 
+00 
+03 
+01 
+04 
+00 
+00 
+00 
+01 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+00 
+04 
+00 
+00 
+00 
diff --git a/modules/parsers/gas/tests/bin/gas-intel_syntax-noprefix.asm b/modules/parsers/gas/tests/bin/gas-intel_syntax-noprefix.asm
new file mode 100644
index 0000000..25c6507
--- /dev/null
+++ b/modules/parsers/gas/tests/bin/gas-intel_syntax-noprefix.asm
@@ -0,0 +1,19 @@
+.intel_syntax noprefix
+.section	.rodata
+.LC0:
+.string	"Hello"
+.text
+	lea	ecx, 4 [esp]
+	and	esp, -16
+	push	DWORD PTR [ecx-4]
+	push	ebp
+	fstp	st(0)
+	ffree	st(1)
+	mov	ebp, esp
+	push	ecx
+	sub	esp, 4
+	mov	DWORD PTR [esp], OFFSET FLAT:.LC0
+	add	esp, 4
+	pop	ebp
+	lea	esp, [ecx-4]
+	ret
diff --git a/modules/parsers/gas/tests/bin/gas-intel_syntax-noprefix.hex b/modules/parsers/gas/tests/bin/gas-intel_syntax-noprefix.hex
new file mode 100644
index 0000000..fe0fdaf
--- /dev/null
+++ b/modules/parsers/gas/tests/bin/gas-intel_syntax-noprefix.hex
@@ -0,0 +1,58 @@
+67 
+66 
+8d 
+4c 
+24 
+04 
+66 
+83 
+e4 
+f0 
+67 
+66 
+ff 
+71 
+fc 
+66 
+55 
+dd 
+d8 
+dd 
+c1 
+66 
+89 
+e5 
+66 
+51 
+66 
+83 
+ec 
+04 
+67 
+66 
+c7 
+04 
+24 
+34 
+00 
+00 
+00 
+66 
+83 
+c4 
+04 
+66 
+5d 
+67 
+66 
+8d 
+61 
+fc 
+c3 
+00 
+48 
+65 
+6c 
+6c 
+6f 
+00 
diff --git a/modules/parsers/gas/tests/bin/gas-macro.asm b/modules/parsers/gas/tests/bin/gas-macro.asm
new file mode 100644
index 0000000..29b475c
--- /dev/null
+++ b/modules/parsers/gas/tests/bin/gas-macro.asm
@@ -0,0 +1,25 @@
+.macro foo arg1, arg2
+.byte \arg1
+.byte \arg2
+.endm
+
+.macro bar x y
+.byte \x-\y
+.endm
+
+.macro def a=5 b
+.byte \a + \b
+.endm
+
+.macro nest x=9
+.macro zap y
+.byte \y
+.endm
+zap \x
+.endm
+
+foo 5 6
+bar 3, 2
+def ,3
+def 3 2
+nest
diff --git a/modules/parsers/gas/tests/bin/gas-macro.hex b/modules/parsers/gas/tests/bin/gas-macro.hex
new file mode 100644
index 0000000..0904d1c
--- /dev/null
+++ b/modules/parsers/gas/tests/bin/gas-macro.hex
@@ -0,0 +1,6 @@
+05 
+06 
+01 
+08 
+05 
+09 
diff --git a/modules/parsers/gas/tests/bin/gas-str.asm b/modules/parsers/gas/tests/bin/gas-str.asm
new file mode 100644
index 0000000..4d02a02
--- /dev/null
+++ b/modules/parsers/gas/tests/bin/gas-str.asm
@@ -0,0 +1 @@
+.string "a\\"
diff --git a/modules/parsers/gas/tests/bin/gas-str.hex b/modules/parsers/gas/tests/bin/gas-str.hex
new file mode 100644
index 0000000..d4eaa85
--- /dev/null
+++ b/modules/parsers/gas/tests/bin/gas-str.hex
@@ -0,0 +1,3 @@
+61 
+5c 
+00 
diff --git a/modules/parsers/gas/tests/bin/reptnested-err.errwarn b/modules/parsers/gas/tests/bin/reptnested-err.errwarn
deleted file mode 100644
index d7ac0b7..0000000
--- a/modules/parsers/gas/tests/bin/reptnested-err.errwarn
+++ /dev/null
@@ -1,7 +0,0 @@
--:2: error: nested rept not supported
--:3: error: rept without matching endr
--:4: error: nested rept not supported
--:4: error: nested rept not supported
--:4: error: nested rept not supported
--:4: error: nested rept not supported
--:4: error: nested rept not supported
diff --git a/modules/parsers/gas/tests/bin/reptnested-err.asm b/modules/parsers/gas/tests/bin/reptnested.asm
similarity index 69%
rename from modules/parsers/gas/tests/bin/reptnested-err.asm
rename to modules/parsers/gas/tests/bin/reptnested.asm
index bb85988..061cae0 100644
--- a/modules/parsers/gas/tests/bin/reptnested-err.asm
+++ b/modules/parsers/gas/tests/bin/reptnested.asm
@@ -1,7 +1,7 @@
-.rept 6
+.rept 3
 .byte 1
 .rept 2
-.byte 2
-.endr
 .byte 3
 .endr
+.endr
+.byte 5
diff --git a/modules/parsers/gas/tests/bin/reptnested.hex b/modules/parsers/gas/tests/bin/reptnested.hex
new file mode 100644
index 0000000..451c1d3
--- /dev/null
+++ b/modules/parsers/gas/tests/bin/reptnested.hex
@@ -0,0 +1,10 @@
+01
+03
+03
+01
+03
+03
+01
+03
+03
+05
diff --git a/modules/parsers/nasm/tests/dirwarning.asm b/modules/parsers/nasm/tests/dirwarning.asm
new file mode 100644
index 0000000..265d60a
--- /dev/null
+++ b/modules/parsers/nasm/tests/dirwarning.asm
@@ -0,0 +1 @@
+[warning -w]
diff --git a/modules/parsers/nasm/tests/dirwarning.errwarn b/modules/parsers/nasm/tests/dirwarning.errwarn
new file mode 100644
index 0000000..366c8d6
--- /dev/null
+++ b/modules/parsers/nasm/tests/dirwarning.errwarn
@@ -0,0 +1 @@
+-:1: warning: [warning] directive not supported; ignored
diff --git a/modules/parsers/nasm/tests/dirwarning.hex b/modules/parsers/nasm/tests/dirwarning.hex
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/modules/parsers/nasm/tests/dirwarning.hex
diff --git a/modules/parsers/nasm/tests/strucbase.asm b/modules/parsers/nasm/tests/strucbase.asm
new file mode 100644
index 0000000..81e2fc0
--- /dev/null
+++ b/modules/parsers/nasm/tests/strucbase.asm
@@ -0,0 +1,11 @@
+struc base, -7
+.a: resb 1
+.b: resb 1
+endstruc
+
+; Expect base and base.a to appear at -7, base.b at -6
+db base
+db base.a
+db base.b
+; The size should be '2' here
+db base_size
diff --git a/modules/parsers/nasm/tests/strucbase.hex b/modules/parsers/nasm/tests/strucbase.hex
new file mode 100644
index 0000000..5d48c5e
--- /dev/null
+++ b/modules/parsers/nasm/tests/strucbase.hex
@@ -0,0 +1,4 @@
+f9 
+f9 
+fa 
+02 
diff --git a/modules/preprocs/gas/Makefile.inc b/modules/preprocs/gas/Makefile.inc
new file mode 100644
index 0000000..a7289a9
--- /dev/null
+++ b/modules/preprocs/gas/Makefile.inc
@@ -0,0 +1,9 @@
+libyasm_a_SOURCES += modules/preprocs/gas/gas-preproc.c
+libyasm_a_SOURCES += modules/preprocs/gas/gas-eval.h
+libyasm_a_SOURCES += modules/preprocs/gas/gas-eval.c
+
+YASM_MODULES += preproc_gas
+
+EXTRA_DIST += modules/preprocs/gas/tests/Makefile.inc
+
+include modules/preprocs/gas/tests/Makefile.inc
diff --git a/modules/preprocs/gas/gas-eval.c b/modules/preprocs/gas/gas-eval.c
new file mode 100644
index 0000000..3625c7a
--- /dev/null
+++ b/modules/preprocs/gas/gas-eval.c
@@ -0,0 +1,444 @@
+/* eval.c    expression evaluator 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 licence given in the file "Licence"
+ * distributed in the NASM archive.
+ *
+ * initial version 27/iii/95 by Simon Tatham
+ */
+#include <util.h>
+#include <libyasm-stdint.h>
+#include <libyasm/coretype.h>
+#include <libyasm/intnum.h>
+#include <libyasm/expr.h>
+#include <libyasm/symrec.h>
+#include <ctype.h>
+
+#include "gas-eval.h"
+
+/* The assembler symbol table. */
+static yasm_symtab *symtab;
+
+static scanner scan;    /* Address of scanner routine */
+static efunc error;     /* Address of error reporting routine */
+
+static struct tokenval *tokval;   /* The current token */
+static int i;                     /* The t_type of tokval */
+
+static void *scpriv;
+static void *epriv;
+
+/*
+ * 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 yasm_expr *rexp0(void), *rexp1(void), *rexp2(void), *rexp3(void);
+
+static yasm_expr *expr0(void), *expr1(void), *expr2(void), *expr3(void);
+static yasm_expr *expr4(void), *expr5(void), *expr6(void);
+
+static yasm_expr *(*bexpr)(void);
+
+static yasm_expr *rexp0(void) 
+{
+    yasm_expr *e, *f;
+
+    e = rexp1();
+    if (!e)
+        return NULL;
+
+    while (i == TOKEN_DBL_OR) 
+    {   
+        i = scan(scpriv, tokval);
+        f = rexp1();
+        if (!f) {
+            yasm_expr_destroy(e);
+            return NULL;
+        }
+
+        e = yasm_expr_create_tree(e, YASM_EXPR_LOR, f, 0);
+    }
+    return e;
+}
+
+static yasm_expr *rexp1(void)
+{
+    yasm_expr *e, *f;
+
+    e = rexp2();
+    if (!e)
+        return NULL;
+    
+    while (i == TOKEN_DBL_XOR) 
+    {
+        i = scan(scpriv, tokval);
+        f = rexp2();
+        if (!f) {
+            yasm_expr_destroy(e);
+            return NULL;
+        }
+
+        e = yasm_expr_create_tree(e, YASM_EXPR_LXOR, f, 0);
+    }
+    return e;
+}
+
+static yasm_expr *rexp2(void) 
+{
+    yasm_expr *e, *f;
+
+    e = rexp3();
+    if (!e)
+        return NULL;
+    while (i == TOKEN_DBL_AND) 
+    {
+        i = scan(scpriv, tokval);
+        f = rexp3();
+        if (!f) {
+            yasm_expr_destroy(e);
+            return NULL;
+        }
+
+        e = yasm_expr_create_tree(e, YASM_EXPR_LAND, f, 0);
+    }
+    return e;
+}
+
+static yasm_expr *rexp3(void) 
+{
+    yasm_expr *e, *f;
+
+    e = expr0();
+    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();
+        if (!f) {
+            yasm_expr_destroy(e);
+            return NULL;
+        }
+
+        switch (j) 
+        {
+            case TOKEN_EQ:
+                e = yasm_expr_create_tree(e, YASM_EXPR_EQ, f, 0);
+                break;
+            case TOKEN_LT:
+                e = yasm_expr_create_tree(e, YASM_EXPR_LT, f, 0);
+                break;
+            case TOKEN_GT:
+                e = yasm_expr_create_tree(e, YASM_EXPR_GT, f, 0);
+                break;
+            case TOKEN_NE:
+                e = yasm_expr_create_tree(e, YASM_EXPR_NE, f, 0);
+                break;
+            case TOKEN_LE:
+                e = yasm_expr_create_tree(e, YASM_EXPR_LE, f, 0);
+                break;
+            case TOKEN_GE:
+                e = yasm_expr_create_tree(e, YASM_EXPR_GE, f, 0);
+                break;
+        }
+    }
+    return e;
+}
+
+static yasm_expr *expr0(void) 
+{
+    yasm_expr *e, *f;
+
+    e = expr1();
+    if (!e)
+        return NULL;
+
+    while (i == '|') 
+    {
+        i = scan(scpriv, tokval);
+        f = expr1();
+        if (!f) {
+            yasm_expr_destroy(e);
+            return NULL;
+        }
+
+        e = yasm_expr_create_tree(e, YASM_EXPR_OR, f, 0);
+    }
+    return e;
+}
+
+static yasm_expr *expr1(void) 
+{
+    yasm_expr *e, *f;
+
+    e = expr2();
+    if (!e)
+        return NULL;
+
+    while (i == '^') {
+        i = scan(scpriv, tokval);
+        f = expr2();
+        if (!f) {
+            yasm_expr_destroy(e);
+            return NULL;
+        }
+
+        e = yasm_expr_create_tree(e, YASM_EXPR_XOR, f, 0);
+    }
+    return e;
+}
+
+static yasm_expr *expr2(void) 
+{
+    yasm_expr *e, *f;
+
+    e = expr3();
+    if (!e)
+        return NULL;
+
+    while (i == '&') {
+        i = scan(scpriv, tokval);
+        f = expr3();
+        if (!f) {
+            yasm_expr_destroy(e);
+            return NULL;
+        }
+
+        e = yasm_expr_create_tree(e, YASM_EXPR_AND, f, 0);
+    }
+    return e;
+}
+
+static yasm_expr *expr3(void) 
+{
+    yasm_expr *e, *f;
+
+    e = expr4();
+    if (!e)
+        return NULL;
+
+    while (i == TOKEN_SHL || i == TOKEN_SHR) 
+    {
+        int j = i;
+        i = scan(scpriv, tokval);
+        f = expr4();
+        if (!f) {
+            yasm_expr_destroy(e);
+            return NULL;
+        }
+
+        switch (j) {
+            case TOKEN_SHL:
+                e = yasm_expr_create_tree(e, YASM_EXPR_SHL, f, 0);
+                break;
+            case TOKEN_SHR:
+                e = yasm_expr_create_tree(e, YASM_EXPR_SHR, f, 0);
+                break;
+        }
+    }
+    return e;
+}
+
+static yasm_expr *expr4(void)
+{
+    yasm_expr *e, *f;
+
+    e = expr5();
+    if (!e)
+        return NULL;
+    while (i == '+' || i == '-') 
+    {
+        int j = i;
+        i = scan(scpriv, tokval);
+        f = expr5();
+        if (!f) {
+            yasm_expr_destroy(e);
+            return NULL;
+        }
+        switch (j) {
+          case '+':
+            e = yasm_expr_create_tree(e, YASM_EXPR_ADD, f, 0);
+            break;
+          case '-':
+            e = yasm_expr_create_tree(e, YASM_EXPR_SUB, f, 0);
+            break;
+        }
+    }
+    return e;
+}
+
+static yasm_expr *expr5(void)
+{
+    yasm_expr *e, *f;
+
+    e = expr6();
+    if (!e)
+        return NULL;
+    while (i == '*' || i == '/' || i == '%' ||
+           i == TOKEN_SDIV || i == TOKEN_SMOD) 
+    {
+        int j = i;
+        i = scan(scpriv, tokval);
+        f = expr6();
+        if (!f) {
+            yasm_expr_destroy(e);
+            return NULL;
+        }
+        switch (j) {
+          case '*':
+            e = yasm_expr_create_tree(e, YASM_EXPR_MUL, f, 0);
+            break;
+          case '/':
+            e = yasm_expr_create_tree(e, YASM_EXPR_DIV, f, 0);
+            break;
+          case '%':
+            e = yasm_expr_create_tree(e, YASM_EXPR_MOD, f, 0);
+            break;
+          case TOKEN_SDIV:
+            e = yasm_expr_create_tree(e, YASM_EXPR_SIGNDIV, f, 0);
+            break;
+          case TOKEN_SMOD:
+            e = yasm_expr_create_tree(e, YASM_EXPR_SIGNMOD, f, 0);
+            break;
+        }
+    }
+    return e;
+}
+
+static yasm_expr *expr6(void)
+{
+    yasm_expr *e = NULL;
+
+    if (i == '-') {
+        i = scan(scpriv, tokval);
+        e = expr6();
+        if (!e)
+            return NULL;
+        return yasm_expr_create_branch(YASM_EXPR_NEG, e, 0);
+    } else if (i == '+') {
+        i = scan(scpriv, tokval);
+        return expr6();
+    } else if (i == '~') {
+        i = scan(scpriv, tokval);
+        e = expr6();
+        if (!e)
+            return NULL;
+        return yasm_expr_create_branch(YASM_EXPR_NOT, e, 0);
+    } else if (i == TOKEN_SEG) {
+        i = scan(scpriv, tokval);
+        e = expr6();
+        if (!e)
+            return NULL;
+        error(epriv, ERR_NONFATAL, "%s not supported", "SEG");
+        return e;
+    } else if (i == '(') {
+        i = scan(scpriv, tokval);
+        e = bexpr();
+        if (!e)
+            return NULL;
+        if (i != ')') {
+            error(epriv, ERR_NONFATAL, "expecting `)'");
+            return NULL;
+        }
+        i = scan(scpriv, tokval);
+        return e;
+    } 
+    else if (i == TOKEN_NUM || i == TOKEN_ID ||
+             i == TOKEN_HERE || i == TOKEN_BASE) 
+    {
+        switch (i) {
+          case TOKEN_NUM:
+            e = yasm_expr_create_ident(yasm_expr_int(tokval->t_integer), 0);
+            tokval->t_integer = NULL;
+            break;
+          case TOKEN_ID:
+            if (symtab) {
+                yasm_symrec *sym =
+                    yasm_symtab_get(symtab, tokval->t_charptr);
+                if (sym) {
+                    e = yasm_expr_create_ident(yasm_expr_sym(sym), 0);
+                } else {
+                    error(epriv, ERR_NONFATAL,
+                          "undefined symbol `%s' in preprocessor",
+                          tokval->t_charptr);
+                    e = yasm_expr_create_ident(yasm_expr_int(
+                        yasm_intnum_create_int(1)), 0);
+                }
+                break;
+            }
+            /*fallthrough*/
+          case TOKEN_HERE:
+          case TOKEN_BASE:
+            error(epriv, ERR_NONFATAL,
+                  "cannot reference symbol `%s' in preprocessor",
+                  (i == TOKEN_ID ? tokval->t_charptr :
+                   i == TOKEN_HERE ? "$" : "$$"));
+            e = yasm_expr_create_ident(yasm_expr_int(yasm_intnum_create_int(1)),
+                                       0);
+            break;
+        }
+        i = scan(scpriv, tokval);
+        return e;
+    } else {
+        error(epriv, ERR_NONFATAL, "expression syntax error");
+        return NULL;
+    }
+}
+
+yasm_expr *evaluate (scanner sc, void *scprivate, struct tokenval *tv,
+                     void *eprivate, int critical, efunc report_error,
+                     yasm_symtab *st)
+{
+    if (critical & CRITICAL) {
+        critical &= ~CRITICAL;
+        bexpr = rexp0;
+    } else
+        bexpr = expr0;
+
+    scan = sc;
+    scpriv = scprivate;
+    tokval = tv;
+    error = report_error;
+    epriv = eprivate;
+    symtab = st;
+
+    if (tokval->t_type == TOKEN_INVALID)
+        i = scan(scpriv, tokval);
+    else
+        i = tokval->t_type;
+
+    return bexpr ();
+}
diff --git a/modules/preprocs/gas/gas-eval.h b/modules/preprocs/gas/gas-eval.h
new file mode 100644
index 0000000..18dcc51
--- /dev/null
+++ b/modules/preprocs/gas/gas-eval.h
@@ -0,0 +1,120 @@
+/* eval.h   header file for eval.c
+ *
+ * The Netwide Assembler is copyright (C) 1996 Simon Tatham and
+ * Julian Hall. All rights reserved. The software is
+ * redistributable under the licence given in the file "Licence"
+ * distributed in the NASM archive.
+ */
+
+#ifndef YASM_EVAL_H
+#define YASM_EVAL_H
+
+/*
+ * -------------------------
+ * Error reporting functions
+ * -------------------------
+ */
+
+/*
+ * An error reporting function should look like this.
+ */
+typedef void (*efunc) (void *private_data, int severity, const char *fmt, ...);
+
+/*
+ * 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 */
+
+/*
+ * These codes define specific types of suppressible warning.
+ */
+
+#define ERR_WARN_MASK   0x0000FF00      /* the mask for this feature */
+#define ERR_WARN_SHR    8               /* how far to shift right */
+
+#define ERR_WARN_MNP    0x00000100      /* macro-num-parameters warning */
+#define ERR_WARN_MSR    0x00000200      /* macro self-reference */
+#define ERR_WARN_OL     0x00000300      /* orphan label (no colon, and
+                                        * alone on line) */
+#define ERR_WARN_NOV    0x00000400      /* numeric overflow */
+#define ERR_WARN_GNUELF 0x00000500      /* using GNU ELF extensions */
+#define ERR_WARN_MAX    5               /* the highest numbered one */
+
+/*
+ * 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 {
+    int t_type;
+    yasm_intnum *t_integer, *t_inttwo;
+    char *t_charptr;
+};
+typedef int (*scanner) (void *private_data, struct tokenval *tv);
+
+/*
+ * Token types returned by the scanner, in addition to ordinary
+ * ASCII character values, and zero for end-of-string.
+ */
+enum {                                 /* 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, TOKEN_NUM, TOKEN_REG, TOKEN_INSN,  /* major token types */
+    TOKEN_ERRNUM,                      /* numeric constant with error in */
+    TOKEN_HERE, TOKEN_BASE,            /* $ and $$ */
+    TOKEN_SPECIAL,                     /* BYTE, WORD, DWORD, 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_FLOAT                        /* floating-point constant */
+};
+
+/*
+ * 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.
+ *
+ * `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 ||.
+ */
+#define CRITICAL 0x100
+typedef yasm_expr *(*evalfunc) (scanner sc, void *scprivate, struct tokenval *tv,
+                                int critical, efunc error, yasm_symtab *symtab);
+
+/*
+ * The evaluator itself.
+ */
+yasm_expr *evaluate (scanner sc, void *scprivate, struct tokenval *tv,
+                     void *eprivate, int critical, efunc report_error,
+                     yasm_symtab *symtab);
+
+#endif
diff --git a/modules/preprocs/gas/gas-preproc.c b/modules/preprocs/gas/gas-preproc.c
new file mode 100644
index 0000000..96dec82
--- /dev/null
+++ b/modules/preprocs/gas/gas-preproc.c
@@ -0,0 +1,1409 @@
+/*
+ * GAS preprocessor (emulates GNU Assembler's preprocessor)
+ *
+ *  Copyright (C) 2009 Alexei Svitkine
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. 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 AUTHOR AND OTHER 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 AUTHOR OR OTHER 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 <util.h>
+#include <ctype.h>
+
+#include <libyasm.h>
+#include "modules/preprocs/gas/gas-eval.h"
+
+#define FALSE 0
+#define TRUE  1
+#define BSIZE 512
+
+#ifndef MAXPATHLEN
+#define MAXPATHLEN 1024
+#endif
+
+typedef struct buffered_line {
+    char *line;
+    int line_number;
+    SLIST_ENTRY(buffered_line) next;
+} buffered_line;
+
+typedef struct included_file {
+    char *filename;
+    int lines_remaining;
+    SLIST_ENTRY(included_file) next;
+} included_file;
+
+typedef struct macro_entry {
+    char *name;
+    int num_params;
+    char **params;
+    int num_lines;
+    char **lines;
+    STAILQ_ENTRY(macro_entry) next;
+} macro_entry;
+
+typedef struct deferred_define {
+    char *name;
+    char *value;
+    SLIST_ENTRY(deferred_define) next;
+} deferred_define;
+
+typedef struct expr_state {
+    const char *string;
+    char *symbol;
+    int string_cursor;
+} expr_state;
+
+typedef struct yasm_preproc_gas {
+    yasm_preproc_base preproc;   /* base structure */
+
+    FILE *in;
+    char *in_filename;
+
+    yasm_symtab *defines;
+    SLIST_HEAD(deferred_defines_head, deferred_define) deferred_defines;
+
+    int depth;
+    int skip_depth;
+
+    int in_comment;
+
+    expr_state expr;
+
+    SLIST_HEAD(buffered_lines_head, buffered_line) buffered_lines;
+    SLIST_HEAD(included_files_head, included_file) included_files;
+    STAILQ_HEAD(macros_head, macro_entry) macros;
+
+    int in_line_number;
+    int next_line_number;
+    int current_line_number; /* virtual (output) line number */
+
+    yasm_linemap *cur_lm;
+    yasm_errwarns *errwarns;
+    int fatal_error;
+    int detect_errors_only;
+} yasm_preproc_gas;
+
+yasm_preproc_module yasm_gas_LTX_preproc;
+
+/* Forward declarations. */
+
+static int substitute_values(yasm_preproc_gas *pp, char **line_ptr);
+
+/* String helpers. */
+
+static const char *starts_with(const char *big, const char *little)
+{
+    while (*little) {
+        if (*little++ != *big++) {
+            return NULL;
+        }
+    }
+    return big;
+}
+
+static void skip_whitespace(const char **line)
+{
+    while (isspace(**line)) {
+        (*line)++;
+    }
+}
+
+static void skip_whitespace2(char **line)
+{
+    while (isspace(**line)) {
+        (*line)++;
+    }
+}
+
+static const char *matches(const char *line, const char *directive)
+{
+    skip_whitespace(&line);
+
+    if (*line == '.') {
+        line = starts_with(line + 1, directive);
+        if (line && (!*line || isspace(*line))) {
+            skip_whitespace(&line);
+            return line;
+        }
+    }
+
+    return NULL;
+}
+
+static int unquote(const char *arg, char *to, size_t to_size, char q, char expected, const char **remainder)
+{
+    const char *quote;
+    const char *end;
+    size_t len;
+
+    skip_whitespace(&arg);
+    if (*arg != q) {
+        return -1;
+    }
+
+    arg++;
+
+    end = arg;
+    do {
+        quote = strchr(end, q);
+        if (!quote) {
+            return -2;
+        }
+        end = quote + 1;
+    } while (*(quote - 1) == '\\');
+
+    skip_whitespace(&end);
+    if (*end != expected) {
+        return -3;
+    }
+
+    if (remainder) {
+        *remainder = end + 1;
+    }
+    
+    len = (size_t) (quote - arg);
+    if (len >= to_size) {
+        return -4;
+    }
+
+    strncpy(to, arg, len);
+    to[len] = '\0';
+
+    return (int) len;
+}
+
+/* Line-reading. */
+
+static char *read_line_from_file(yasm_preproc_gas *pp, FILE *file)
+{
+    int bufsize = BSIZE;
+    char *buf;
+    char *p;
+
+    buf = yasm_xmalloc((size_t)bufsize);
+
+    /* Loop to ensure entire line is read (don't want to limit line length). */
+    p = buf;
+    for (;;) {
+        if (!fgets(p, bufsize - (p - buf), file)) {
+            if (ferror(file)) {
+                yasm_error_set(YASM_ERROR_IO, N_("error when reading from file"));
+                yasm_errwarn_propagate(pp->errwarns, pp->current_line_number);
+            }
+            break;
+        }
+        p += strlen(p);
+        if (p > buf && p[-1] == '\n') {
+            break;
+        }
+        if ((p - buf) + 1 >= bufsize) {
+            /* Increase size of buffer */
+            char *oldbuf = buf;
+            bufsize *= 2;
+            buf = yasm_xrealloc(buf, (size_t) bufsize);
+            p = buf + (p - oldbuf);
+        }
+    }
+
+    if (p == buf) {
+        /* No data; must be at EOF */
+        yasm_xfree(buf);
+        return NULL;
+    }
+
+    /* Strip the line ending */
+    buf[strcspn(buf, "\r\n")] = '\0';
+    return buf;
+}
+
+static char *read_line(yasm_preproc_gas *pp)
+{
+    char *line;
+
+    if (!SLIST_EMPTY(&pp->included_files)) {
+        included_file *inc_file = SLIST_FIRST(&pp->included_files);
+        if (inc_file->lines_remaining <= 0) {
+            SLIST_REMOVE_HEAD(&pp->included_files, next);
+            yasm_xfree(inc_file->filename);
+            yasm_xfree(inc_file);
+        }
+    }
+
+    if (!SLIST_EMPTY(&pp->buffered_lines)) {
+        buffered_line *bline = SLIST_FIRST(&pp->buffered_lines);
+        SLIST_REMOVE_HEAD(&pp->buffered_lines, next);
+        line = bline->line;
+        if (bline->line_number != -1) {
+            pp->next_line_number = bline->line_number;
+        }
+        yasm_xfree(bline);
+        if (!SLIST_EMPTY(&pp->included_files)) {
+            SLIST_FIRST(&pp->included_files)->lines_remaining--;
+        }
+        return line;
+    }
+
+    line = read_line_from_file(pp, pp->in);
+    if (line) {
+        pp->in_line_number++;
+        pp->next_line_number = pp->in_line_number;
+    }
+
+    return line;
+}
+
+static const char *get_arg(yasm_preproc_gas *pp, const char *src, char *dest, size_t dest_size)
+{
+    const char *comma = strchr(src, ',');
+    if (comma) {
+        size_t len = (size_t) (comma - src);
+        if (len >= dest_size) {
+            len = dest_size - 1;
+        }
+        strncpy(dest, src, len);
+        dest[len] = '\0';
+        comma++;
+        skip_whitespace(&comma);        
+    } else {
+        yasm_error_set(YASM_ERROR_SYNTAX, N_("expected comma"));
+        yasm_errwarn_propagate(pp->errwarns, pp->current_line_number);
+    }
+    return comma;
+}
+
+/* GAS expression evaluation. */
+
+static char get_char(yasm_preproc_gas *pp)
+{
+    return pp->expr.string[pp->expr.string_cursor];
+}
+
+static const char *get_str(yasm_preproc_gas *pp)
+{
+    return pp->expr.string + pp->expr.string_cursor;
+}
+
+static void next_char(yasm_preproc_gas *pp)
+{
+    pp->expr.string_cursor++;
+}
+
+static int ishex(char c)
+{
+    c = tolower(c);
+    return isdigit(c) || (c >= 'a' && c <= 'f');
+}
+
+static void gas_scan_init(yasm_preproc_gas *pp, struct tokenval *tokval, const char *arg1)
+{
+    pp->expr.symbol = NULL;
+    pp->expr.string = arg1;
+    pp->expr.string_cursor = 0;
+    memset(tokval, 0, sizeof(struct tokenval));
+    tokval->t_type = TOKEN_INVALID;
+}
+
+static void gas_scan_cleanup(yasm_preproc_gas *pp, struct tokenval *tokval)
+{
+    if (tokval->t_integer) {
+        yasm_intnum_destroy(tokval->t_integer);
+        tokval->t_integer = NULL;
+    }
+    if (pp->expr.symbol) {
+        yasm_xfree(pp->expr.symbol);
+        pp->expr.symbol = NULL;
+    }
+}
+
+static int gas_scan(void *preproc, struct tokenval *tokval)
+{
+    yasm_preproc_gas *pp = (yasm_preproc_gas *) preproc;
+    char c = get_char(pp);
+    const char *str;
+
+    tokval->t_charptr = NULL;
+
+    if (c == '\0') {
+        return tokval->t_type = TOKEN_EOS;
+    }
+
+    if (isspace(c)) {
+        do {
+            next_char(pp);
+            c = get_char(pp);
+        } while (isspace(c));
+    }
+
+    if (isdigit(c)) {
+        int char_index = 0;
+        int value = 0;
+
+        do {
+            value = value*10 + (c - '0');
+            char_index++;
+            next_char(pp);
+            c = get_char(pp);
+            if (char_index == 1 && c == 'x' && value == 0) {
+                next_char(pp);
+                c = get_char(pp);
+                /* Hex notation. */
+                while (ishex(c)) {
+                    if (isdigit(c)) {
+                        value = (value << 4) | (c - '0');
+                    } else {
+                        value = (value << 4) | (tolower(c) - 'a' + 0xa);
+                    }
+                    next_char(pp);
+                    c = get_char(pp);
+                }
+                break;
+            }
+        } while (isdigit(c));
+
+        if (tokval->t_integer) {
+            yasm_intnum_destroy(tokval->t_integer);
+        }
+        tokval->t_integer = yasm_intnum_create_int(value);
+        return tokval->t_type = TOKEN_NUM;
+    }
+
+    tokval->t_type = TOKEN_INVALID;
+    str = get_str(pp);
+
+    {
+        /* It should be tested whether GAS supports all of these or if there are missing ones. */
+        unsigned i;
+        struct {
+            const char *op;
+            int token;
+        } ops[] = {
+            { "<<", TOKEN_SHL },
+            { ">>", TOKEN_SHR },
+            { "//", TOKEN_SDIV },
+            { "%%", TOKEN_SMOD },
+            { "==", TOKEN_EQ },
+            { "!=", TOKEN_NE },
+            { "<>", TOKEN_NE },
+            { "<>", TOKEN_NE },
+            { "<=", TOKEN_LE },
+            { ">=", TOKEN_GE },
+            { "&&", TOKEN_DBL_AND },
+            { "^^", TOKEN_DBL_XOR },
+            { "||", TOKEN_DBL_OR }
+        };
+        for (i = 0; i < sizeof(ops)/sizeof(ops[0]); i++) {
+            if (!strcmp(str, ops[i].op)) {
+                tokval->t_type = ops[i].token;
+                break;
+            }
+        }
+    }
+
+    if (tokval->t_type != TOKEN_INVALID) {
+        next_char(pp);
+        next_char(pp);
+    } else {
+        str = get_str(pp);
+
+        next_char(pp);
+        tokval->t_type = c;
+
+        /* Is it a symbol? If so we need to make it a TOKEN_ID. */
+        if (isalpha(c) || c == '_' || c == '.') {
+            int symbol_length = 1;
+
+            c = get_char(pp);
+            while (isalnum(c) || c == '$' || c == '_') {
+                symbol_length++;
+                next_char(pp);
+                c = get_char(pp);
+            }
+
+            pp->expr.symbol = yasm_xrealloc(pp->expr.symbol, symbol_length + 1);
+            memcpy(pp->expr.symbol, str, symbol_length);
+            pp->expr.symbol[symbol_length] = '\0';
+
+            tokval->t_type = TOKEN_ID;
+            tokval->t_charptr = pp->expr.symbol;
+        }
+    }
+    
+    return tokval->t_type;
+}
+
+static void gas_err(void *private_data, int severity, const char *fmt, ...)
+{
+    va_list args;
+    yasm_preproc_gas *pp = private_data;
+
+    if (!pp->detect_errors_only) {
+        va_start(args, fmt);
+        yasm_error_set_va(YASM_ERROR_SYNTAX, N_(fmt), args);
+        yasm_errwarn_propagate(pp->errwarns, pp->current_line_number);
+        va_end(args);
+    }
+
+    pp->fatal_error = 1;
+}
+
+static long eval_expr(yasm_preproc_gas *pp, const char *arg1)
+{
+    struct tokenval tv;
+    yasm_expr *expr;
+    yasm_intnum *intn;
+    long value;
+    expr_state prev_state;
+
+    if (!*arg1) {
+        return 0;
+    }
+
+    prev_state = pp->expr;
+    gas_scan_init(pp, &tv, arg1);
+    expr = evaluate(gas_scan, pp, &tv, pp, CRITICAL, gas_err, pp->defines);
+    intn = yasm_expr_get_intnum(&expr, 0);
+    value = yasm_intnum_get_int(intn);
+    yasm_expr_destroy(expr);
+    gas_scan_cleanup(pp, &tv);
+    pp->expr = prev_state;
+
+    return value;
+}
+
+/* If-directive helpers. */
+
+static int handle_if(yasm_preproc_gas *pp, int is_true)
+{
+    assert(pp->depth >= 0);
+    assert(pp->skip_depth == 0);
+    if (is_true) {
+        pp->depth++;
+    } else {
+        pp->skip_depth = 1;
+    }
+    return 1;
+}
+
+static int handle_endif(yasm_preproc_gas *pp)
+{
+    if (pp->depth) {
+        pp->depth--;
+    } else {
+        yasm_error_set(YASM_ERROR_SYNTAX, N_("\".endif\" without \".if\""));
+        yasm_errwarn_propagate(pp->errwarns, pp->current_line_number);
+        return 0;
+    }
+    return 1;
+}
+
+static int handle_else(yasm_preproc_gas *pp, int is_elseif)
+{
+    if (!pp->depth) {
+        yasm_error_set(YASM_ERROR_SYNTAX, N_("\".%s\" without \".if\""), is_elseif ? "elseif" : "else");
+        yasm_errwarn_propagate(pp->errwarns, pp->current_line_number);
+        return 0;
+    } else {
+        pp->skip_depth = 1;
+    }
+    return 1;
+}
+
+/* Directive-handling functions. */
+
+static int eval_if(yasm_preproc_gas *pp, int negate, const char *arg1)
+{
+    long value;
+    if (!*arg1) {
+        yasm_error_set(YASM_ERROR_SYNTAX, N_("expression is required in \".if\" statement"));
+        yasm_errwarn_propagate(pp->errwarns, pp->current_line_number);
+        return 0;
+    }
+    value = eval_expr(pp, arg1);
+    handle_if(pp, (negate ? !value : !!value));
+    return 1;
+}
+
+static int eval_else(yasm_preproc_gas *pp, int unused)
+{
+    return handle_else(pp, 0);
+}
+
+static int eval_endif(yasm_preproc_gas *pp, int unused)
+{
+    return handle_endif(pp);
+}
+
+static int eval_elseif(yasm_preproc_gas *pp, int unused, const char *arg1)
+{
+    if (!*arg1) {
+        yasm_error_set(YASM_ERROR_SYNTAX, N_("expression is required in \".elseif\" statement"));
+        yasm_errwarn_propagate(pp->errwarns, pp->current_line_number);
+        return 0;
+    }
+    if (!handle_else(pp, 1)) {
+        return 0;
+    }
+    return eval_if(pp, 0, arg1);
+}
+
+static int eval_ifb(yasm_preproc_gas *pp, int negate, const char *arg1)
+{
+    int is_blank = !*arg1;
+    return handle_if(pp, (negate ? !is_blank : is_blank));
+}
+
+static int eval_ifc(yasm_preproc_gas *pp, int negate, const char *args)
+{
+    char arg1[512], arg2[512];
+    const char *remainder;
+    int len = unquote(args, arg1, sizeof(arg1), '\'', ',', &remainder);
+    if (len >= 0) {
+        len = unquote(remainder, arg2, sizeof(arg2), '\'', '\0', NULL);
+        if (len >= 0) {
+            int result = !strcmp(arg1, arg2);
+            return handle_if(pp, (negate ? !result : result));
+        }
+    } else {
+        /* first argument was not single-quoted, assume non-quoted mode */
+        remainder = get_arg(pp, args, arg1, sizeof(arg1));
+        if (remainder) {
+            int result = !strcmp(arg1, remainder);
+            return handle_if(pp, (negate ? !result : result));
+        }
+    }
+    yasm_error_set(YASM_ERROR_SYNTAX, N_("\"%s\" expects two single-quoted or unquoted arguments"), negate ? ".ifnc" : ".ifc");
+    yasm_errwarn_propagate(pp->errwarns, pp->current_line_number);
+    return 0;
+}
+
+static int eval_ifeqs(yasm_preproc_gas *pp, int negate, const char *args)
+{
+    char arg1[512], arg2[512];
+    const char *remainder;
+    int len = unquote(args, arg1, sizeof(arg1), '"', ',', &remainder);
+    if (len >= 0) {
+        len = unquote(remainder, arg2, sizeof(arg2), '"', '\0', NULL);
+        if (len >= 0) {
+            int result = !strcmp(arg1, arg2);
+            return handle_if(pp, (negate ? !result : result));
+        }
+    }
+    yasm_error_set(YASM_ERROR_SYNTAX, N_("\"%s\" expects two double-quoted arguments"), negate ? ".ifnes" : ".ifeqs");
+    yasm_errwarn_propagate(pp->errwarns, pp->current_line_number);
+    return 1;
+}
+
+static int eval_ifdef(yasm_preproc_gas *pp, int negate, const char *name)
+{
+    yasm_symrec *rec = yasm_symtab_get(pp->defines, name);
+    int result = (rec != NULL);
+    return handle_if(pp, (negate ? !result : result));
+}
+
+static int eval_ifge(yasm_preproc_gas *pp, int negate, const char *arg1)
+{
+    long value = eval_expr(pp, arg1);
+    int result = (value >= 0);
+    return handle_if(pp, (negate ? !result : result));
+}
+
+static int eval_ifgt(yasm_preproc_gas *pp, int negate, const char *arg1)
+{
+    long value = eval_expr(pp, arg1);
+    int result = (value > 0);
+    return handle_if(pp, (negate ? !result : result));
+}
+
+static int eval_include(yasm_preproc_gas *pp, int unused, const char *arg1)
+{
+    char *current_filename;
+    char filename[MAXPATHLEN];
+    char *line;
+    int num_lines;
+    FILE *file;
+    buffered_line *prev_bline;
+    included_file *inc_file;
+
+    if (unquote(arg1, filename, sizeof(filename), '"', '\0', NULL) < 0) {
+        yasm_error_set(YASM_ERROR_SYNTAX, N_("string expected"));
+        yasm_errwarn_propagate(pp->errwarns, pp->current_line_number);
+        return 0;
+    }
+
+    if (SLIST_EMPTY(&pp->included_files)) {
+        current_filename = pp->in_filename;
+    } else {
+        current_filename = SLIST_FIRST(&pp->included_files)->filename;
+    }
+    file = yasm_fopen_include(filename, current_filename, "r", NULL);
+    if (!file) {
+        yasm_error_set(YASM_ERROR_SYNTAX, N_("unable to open included file \"%s\""), filename);
+        yasm_errwarn_propagate(pp->errwarns, pp->current_line_number);
+        return 0;
+    }
+
+    num_lines = 0;
+    prev_bline = NULL;
+    line = read_line_from_file(pp, file);
+    while (line) {
+        buffered_line *bline = yasm_xmalloc(sizeof(buffered_line));
+        bline->line = line;
+        bline->line_number = -1;
+        if (prev_bline) {
+            SLIST_INSERT_AFTER(prev_bline, bline, next);
+        } else {
+            SLIST_INSERT_HEAD(&pp->buffered_lines, bline, next);
+        }
+        prev_bline = bline;
+        line = read_line_from_file(pp, file);
+        num_lines++;
+    }
+
+    inc_file = yasm_xmalloc(sizeof(included_file));
+    inc_file->filename = yasm__xstrdup(filename);
+    inc_file->lines_remaining = num_lines;
+    SLIST_INSERT_HEAD(&pp->included_files, inc_file, next);
+    return 1;
+}
+
+static int try_eval_expr(yasm_preproc_gas *pp, const char *value, long *result)
+{
+    int success;
+
+    pp->detect_errors_only = 1;
+    *result = eval_expr(pp, value);
+    success = !pp->fatal_error;
+    pp->fatal_error = 0;
+    pp->detect_errors_only = 0;
+
+    return success;
+}
+
+static int remove_define(yasm_preproc_gas *pp, const char *name, int allow_redefine)
+{
+    yasm_symrec *rec = yasm_symtab_get(pp->defines, name);
+    if (rec) {
+        const yasm_symtab_iter *entry;
+        yasm_symtab *new_defines;
+
+        if (!allow_redefine) {
+            yasm_error_set(YASM_ERROR_SYNTAX, N_("symbol \"%s\" is already defined"), name);
+            yasm_errwarn_propagate(pp->errwarns, pp->current_line_number);
+            return 0;
+        }
+
+        new_defines = yasm_symtab_create();
+
+        for (entry = yasm_symtab_first(pp->defines); entry; entry = yasm_symtab_next(entry)) {
+            yasm_symrec *entry_rec = yasm_symtab_iter_value(entry);
+            const char *rec_name = yasm_symrec_get_name(entry_rec);
+            if (strcmp(rec_name, name)) {
+                yasm_intnum *num = yasm_intnum_create_int(eval_expr(pp, rec_name));
+                yasm_expr *expr = yasm_expr_create_ident(yasm_expr_int(num), 0);
+                yasm_symtab_define_equ(new_defines, rec_name, expr, 0);
+            } 
+        }
+
+        yasm_symtab_destroy(pp->defines);
+        pp->defines = new_defines;
+    }
+    return (rec != NULL);
+}
+
+static void add_define(yasm_preproc_gas *pp, const char *name, long value, int allow_redefine, int substitute)
+{
+    deferred_define *def, *prev_def, *temp_def;
+    yasm_intnum *num;
+    yasm_expr *expr;
+
+    remove_define(pp, name, allow_redefine);
+
+    /* Add the new define. */
+    num = yasm_intnum_create_int(value);
+    expr = yasm_expr_create_ident(yasm_expr_int(num), 0);
+    yasm_symtab_define_equ(pp->defines, name, expr, 0);
+
+    /* Perform substitution on any deferred defines. */
+    if (substitute) {
+        prev_def = NULL;
+        temp_def = NULL;
+        SLIST_FOREACH_SAFE(def, &pp->deferred_defines, next, temp_def) {
+            if (substitute_values(pp, &def->value)) {
+                /* Value was updated - check if it can be added to the symtab. */
+                if (try_eval_expr(pp, def->value, &value)) {
+                    add_define(pp, def->name, value, FALSE, FALSE);
+                    if (prev_def) {
+                        SLIST_NEXT(prev_def, next) = SLIST_NEXT(def, next);
+                    } else {
+                        SLIST_FIRST(&pp->deferred_defines) = SLIST_NEXT(def, next);
+                    }
+                    yasm_xfree(def->name);
+                    yasm_xfree(def->value);
+                    yasm_xfree(def);
+                    continue;
+                }
+            }
+            prev_def = def;
+        }
+    }
+}
+
+static int eval_set(yasm_preproc_gas *pp, int allow_redefine, const char *name, const char *value)
+{
+    if (!pp->skip_depth) {
+        long result;
+
+        if (!try_eval_expr(pp, value, &result)) {
+            deferred_define *def;
+            remove_define(pp, name, allow_redefine);
+            def = yasm_xmalloc(sizeof(deferred_define));
+            def->name = yasm__xstrdup(name);
+            def->value = yasm__xstrdup(value);
+            substitute_values(pp, &def->value);
+            SLIST_INSERT_HEAD(&pp->deferred_defines, def, next);
+        } else {
+            add_define(pp, name, result, allow_redefine, TRUE);
+        }
+    }
+    return 1;
+}
+
+static int eval_macro(yasm_preproc_gas *pp, int unused, char *args)
+{
+    char *end;
+    char *line;
+    long nesting = 1;
+    macro_entry *macro = yasm_xmalloc(sizeof(macro_entry));
+
+    memset(macro, 0, sizeof(macro_entry));
+
+    end = args;
+    while (*end && !isspace(*end)) {
+        end++;
+    }
+    macro->name = yasm_xmalloc(end - args + 1);
+    memcpy(macro->name, args, end - args);
+    macro->name[end - args] = '\0';
+
+    skip_whitespace2(&end);
+    while (*end) {
+        args = end;
+        while (*end && !isspace(*end) && *end != ',') {
+            end++;
+        }
+        macro->num_params++;
+        macro->params = yasm_xrealloc(macro->params, macro->num_params*sizeof(char *));
+        macro->params[macro->num_params - 1] = yasm_xmalloc(end - args + 1);
+        memcpy(macro->params[macro->num_params - 1], args, end - args);
+        macro->params[macro->num_params - 1][end - args] = '\0';
+        skip_whitespace2(&end);
+        if (*end == ',') {
+            end++;
+            skip_whitespace2(&end);
+        }
+    }
+
+    STAILQ_INSERT_TAIL(&pp->macros, macro, next);
+
+    line = read_line(pp);
+    while (line) {
+        char *line2 = line;
+        skip_whitespace2(&line2);
+        if (starts_with(line2, ".macro")) {
+            nesting++;
+        } else if (starts_with(line, ".endm") && --nesting == 0) {
+            return 1;
+        }
+        macro->num_lines++;
+        macro->lines = yasm_xrealloc(macro->lines, macro->num_lines*sizeof(char *));
+        macro->lines[macro->num_lines - 1] = line;
+        line = read_line(pp);
+    }
+
+    yasm_error_set(YASM_ERROR_SYNTAX, N_("unexpected EOF in \".macro\" block"));
+    yasm_errwarn_propagate(pp->errwarns, yasm_linemap_get_current(pp->cur_lm));
+    return 0;
+}
+
+static int eval_endm(yasm_preproc_gas *pp, int unused)
+{
+    yasm_error_set(YASM_ERROR_SYNTAX, N_("\".endm\" without \".macro\""));
+    yasm_errwarn_propagate(pp->errwarns, yasm_linemap_get_current(pp->cur_lm));
+    return 0;
+}
+
+static void get_param_value(macro_entry *macro, int param_index, const char *args, const char **value, int *length)
+{
+    int arg_index = 0;
+    const char *default_value = NULL;
+    const char *end, *eq = strstr(macro->params[param_index], "=");
+
+    if (eq) {
+        default_value = eq + 1;
+    }
+
+    skip_whitespace(&args);
+    end = args;
+    while (*end) {
+        args = end;
+        while (*end && !isspace(*end) && *end != ',') {
+            end++;
+        }
+        if (arg_index == param_index) {
+            if (end == args && default_value) {
+                *value = default_value;
+                *length = strlen(default_value);
+            } else {
+                *value = args;
+                *length = end - args;
+            }
+            return;
+        }
+        arg_index++;
+        skip_whitespace(&end);
+        if (*end == ',') {
+            end++;
+            skip_whitespace(&end);
+        }
+    }
+
+    *value = default_value;
+    *length = (default_value ? strlen(default_value) : 0);
+}
+
+static void expand_macro(yasm_preproc_gas *pp, macro_entry *macro, const char *args)
+{
+    int i, j;
+    buffered_line *prev_bline = NULL;
+
+    for (i = 0; i < macro->num_lines; i++) {
+        buffered_line *bline = yasm_xmalloc(sizeof(buffered_line));
+        struct tokenval tokval;
+        int prev_was_backslash = FALSE;
+        int line_length = strlen(macro->lines[i]);
+        char *work = yasm__xstrdup(macro->lines[i]);
+        expr_state prev_state = pp->expr;
+
+        gas_scan_init(pp, &tokval, work);
+        while (gas_scan(pp, &tokval) != TOKEN_EOS) {
+            if (prev_was_backslash) {
+                if (tokval.t_type == TOKEN_ID) {
+                    for (j = 0; j < macro->num_params; j++) {
+                        char *end = strstr(macro->params[j], "=");
+                        int len = (end ? (size_t)(end - macro->params[j])
+                                       : strlen(macro->params[j]));
+                        if (!strncmp(tokval.t_charptr, macro->params[j], len)
+                            && tokval.t_charptr[len] == '\0') {
+                            /* now, find matching argument. */
+                            const char *value;
+                            char *line = work + (pp->expr.string - work);
+                            int cursor = pp->expr.string_cursor;
+                            int value_length, delta;
+
+                            get_param_value(macro, j, args, &value, &value_length);
+
+                            len++; /* leading slash */
+                            delta = value_length - len;
+                            line_length += delta;
+                            if (delta > 0) {
+                                line = yasm_xrealloc(line, line_length + 1);
+                            }
+                            memmove(line + cursor - len + value_length, line + cursor, strlen(line + cursor) + 1);
+                            memcpy(line + cursor - len, value, value_length);
+                            pp->expr.string = work = line;
+                            pp->expr.string_cursor += delta;
+                            if (pp->expr.symbol) {
+                                yasm_xfree(pp->expr.symbol);
+                                pp->expr.symbol = NULL;
+                            }
+                        }
+                    }
+                }
+                prev_was_backslash = FALSE;
+            } else if (tokval.t_type == '\\') {
+                prev_was_backslash = TRUE;
+            }
+        }
+        gas_scan_cleanup(pp, &tokval);
+
+        bline->line = work + (pp->expr.string - work);
+        bline->line_number = -1;
+        pp->expr = prev_state;
+
+        if (prev_bline) {
+            SLIST_INSERT_AFTER(prev_bline, bline, next);
+        } else {
+            SLIST_INSERT_HEAD(&pp->buffered_lines, bline, next);
+        }
+        prev_bline = bline;
+    }
+}
+
+static int eval_rept(yasm_preproc_gas *pp, int unused, const char *arg1)
+{
+    long i, n = eval_expr(pp, arg1);
+    long num_lines = 0;
+    long nesting = 1;
+    char *line = read_line(pp);
+    buffered_line *prev_bline = NULL;
+    SLIST_HEAD(buffered_lines_head, buffered_line) lines;
+    int rept_start_file_line_number = pp->next_line_number - 1;
+    int rept_start_output_line_number = pp->current_line_number;
+
+    SLIST_INIT(&lines);
+
+    while (line) {
+        skip_whitespace2(&line);
+        if (starts_with(line, ".rept")) {
+            nesting++;
+        } else if (starts_with(line, ".endr") && --nesting == 0) {
+            for (i = 0; i < n; i++) {
+                buffered_line *current_line;
+                prev_bline = NULL;
+                SLIST_FOREACH(current_line, &lines, next) {
+                    buffered_line *bline = yasm_xmalloc(sizeof(buffered_line));
+                    bline->line = yasm__xstrdup(current_line->line);
+                    bline->line_number = current_line->line_number;
+                    if (prev_bline) {
+                        SLIST_INSERT_AFTER(prev_bline, bline, next);
+                    } else {
+                        SLIST_INSERT_HEAD(&pp->buffered_lines, bline, next);
+                    }
+                    prev_bline = bline;
+                }
+            }
+            if (!SLIST_EMPTY(&pp->included_files)) {
+                included_file *inc_file = SLIST_FIRST(&pp->included_files);
+                inc_file->lines_remaining += n * num_lines;
+            }
+            while (!SLIST_EMPTY(&lines)) {
+                buffered_line *bline = SLIST_FIRST(&lines);
+                SLIST_REMOVE_HEAD(&lines, next);
+                yasm_xfree(bline->line);
+                yasm_xfree(bline);
+            }
+            yasm_xfree(line);
+            return 1;
+        }
+        if (n > 0) {
+            buffered_line *bline = yasm_xmalloc(sizeof(buffered_line));
+            bline->line = line;
+            bline->line_number = pp->next_line_number;
+            if (prev_bline) {
+                SLIST_INSERT_AFTER(prev_bline, bline, next);
+            } else {
+                SLIST_INSERT_HEAD(&lines, bline, next);
+            }
+            prev_bline = bline;
+        } else {
+            yasm_xfree(line);
+        }
+        line = read_line(pp);
+        num_lines++;
+    }
+    yasm_linemap_set(pp->cur_lm, pp->in_filename, rept_start_output_line_number, rept_start_file_line_number, 0);
+    yasm_error_set(YASM_ERROR_SYNTAX, N_("rept without matching endr"));
+    yasm_errwarn_propagate(pp->errwarns, rept_start_output_line_number);
+    return 0;
+}
+
+static int eval_endr(yasm_preproc_gas *pp, int unused)
+{
+    yasm_error_set(YASM_ERROR_SYNTAX, N_("\".endr\" without \".rept\""));
+    yasm_errwarn_propagate(pp->errwarns, pp->current_line_number);
+    return 0;
+}
+
+/* Top-level line processing. */
+
+typedef int (*pp_fn0_t)(yasm_preproc_gas *pp, int param);
+typedef int (*pp_fn1_t)(yasm_preproc_gas *pp, int param, const char *arg1);
+typedef int (*pp_fn2_t)(yasm_preproc_gas *pp, int param, const char *arg1, const char *arg2);
+
+#define FN(f) ((pp_fn0_t) &(f))
+
+static void kill_comments(yasm_preproc_gas *pp, char *line)
+{
+    int next = 2;
+    char *cstart;
+
+    skip_whitespace2(&line);
+    if (*line == '#' || !strncmp(line, "//", 2)) {
+        *line = '\0';
+        return;
+    }
+
+    if (pp->in_comment) {
+        cstart = line;
+        next = 0;
+    } else {
+        cstart = strstr(line, "/*");
+        next = 2;
+    }
+
+    while (cstart) {
+        char *cend = strstr(cstart + next, "*/");
+
+        if (!cend) {
+            *cstart = '\0';
+            pp->in_comment = TRUE;
+            return;
+        }
+
+        memmove(cstart, cend + 2, strlen(cend + 2) + 1);
+        pp->in_comment = FALSE;
+        cstart = strstr(cstart, "/*");
+        next = 2;
+   }
+}
+
+static int substitute_values(yasm_preproc_gas *pp, char **line_ptr)
+{
+    int changed = 0;
+    char *line = *line_ptr;
+    int line_length = strlen(line);
+    struct tokenval tokval;
+    expr_state prev_state = pp->expr;
+
+    gas_scan_init(pp, &tokval, line);
+    while (gas_scan(pp, &tokval) != TOKEN_EOS) {
+        if (tokval.t_type == TOKEN_ID) {
+            yasm_symrec *rec = yasm_symtab_get(pp->defines, tokval.t_charptr);
+            if (rec) {
+                int cursor = pp->expr.string_cursor;
+                int len = strlen(tokval.t_charptr);
+                char value[64];
+                int value_length = sprintf(value, "%ld", eval_expr(pp, tokval.t_charptr));
+                int delta = value_length - len;
+
+                line_length += delta;
+                if (delta > 0) {
+                    line = yasm_xrealloc(line, line_length + 1);
+                }
+                memmove(line + cursor - len + value_length, line + cursor, strlen(line + cursor) + 1);
+                memcpy(line + cursor - len, value, value_length);
+                pp->expr.string = line;
+                pp->expr.string_cursor = cursor + delta;
+                changed = 1;
+            }
+            yasm_xfree(pp->expr.symbol);
+            pp->expr.symbol = NULL;
+        }
+    }
+    gas_scan_cleanup(pp, &tokval);
+    pp->expr = prev_state;
+
+    if (changed) {
+        *line_ptr = line;
+    }
+
+    return changed;
+}
+
+static int process_line(yasm_preproc_gas *pp, char **line_ptr)
+{
+    macro_entry *macro;
+    size_t i;
+    char *line = *line_ptr;
+    struct {
+        const char *name;
+        int nargs;
+        pp_fn0_t fn;
+        int param;
+    } directives[] = {
+        {"else", 0, FN(eval_else), 0},
+        {"elseif", 1, FN(eval_elseif), 0},
+        {"endif", 0, FN(eval_endif), 0},
+        {"if", 1, FN(eval_if), 0},
+        {"ifb", 1, FN(eval_ifb), 0},
+        {"ifc", 1, FN(eval_ifc), 0},
+        {"ifdef", 1, FN(eval_ifdef), 0},
+        {"ifeq", 1, FN(eval_if), 1},
+        {"ifeqs", 1, FN(eval_ifeqs), 0},
+        {"ifge", 1, FN(eval_ifge), 0},
+        {"ifgt", 1, FN(eval_ifgt), 0},
+        {"ifle", 1, FN(eval_ifgt), 1},
+        {"iflt", 1, FN(eval_ifge), 1},
+        {"ifnb", 1, FN(eval_ifb), 1},
+        {"ifnc", 1, FN(eval_ifc), 1},
+        {"ifndef", 1, FN(eval_ifdef), 1},
+        {"ifnotdef", 1, FN(eval_ifdef), 1},
+        {"ifne", 1, FN(eval_if), 0},
+        {"ifnes", 1, FN(eval_ifeqs), 1},
+        {"include", 1, FN(eval_include), 0},
+        {"set", 2, FN(eval_set), 1},
+        {"equ", 2, FN(eval_set), 1},
+        {"equiv", 2, FN(eval_set), 0},
+        {"macro", 1, FN(eval_macro), 0},
+        {"endm", 0, FN(eval_endm), 0},
+        {"rept", 1, FN(eval_rept), 0},
+        {"endr", 1, FN(eval_endr), 0},
+    };
+
+    kill_comments(pp, line);
+    skip_whitespace2(&line);
+    if (*line == '\0') {
+        return FALSE;
+    }
+
+    /* See if this is a macro call. */
+    STAILQ_FOREACH(macro, &pp->macros, next) {
+        const char *remainder = starts_with(line, macro->name);
+        if (remainder && (!*remainder || isspace(*remainder))) {
+            skip_whitespace2(&line);
+            expand_macro(pp, macro, remainder);
+            return FALSE;
+        }
+    }
+
+    for (i = 0; i < sizeof(directives)/sizeof(directives[0]); i++) {
+        char buf1[1024];
+        const char *remainder = matches(line, directives[i].name);
+        
+        if (remainder) {
+            if (pp->skip_depth) {
+                if (!strncmp("if", directives[i].name, 2)) {
+                    pp->skip_depth++;
+                } else if (!strcmp("endif", directives[i].name)) {
+                    pp->skip_depth--;
+                } else if (!strcmp("else", directives[i].name)) {
+                    if (pp->skip_depth == 1) {
+                        pp->skip_depth = 0;
+                        pp->depth++;
+                    }
+                }
+                return FALSE;
+            } else if (directives[i].nargs == 0) {
+                pp_fn0_t fn = (pp_fn0_t) directives[i].fn;
+                pp->fatal_error = !fn(pp, directives[i].param);
+                return FALSE;
+            } else if (directives[i].nargs == 1) {
+                pp_fn1_t fn = (pp_fn1_t) directives[i].fn;
+                skip_whitespace(&remainder);
+                pp->fatal_error = !fn(pp, directives[i].param, remainder);
+                return FALSE;
+            } else if (directives[i].nargs == 2) {
+                remainder = get_arg(pp, remainder, buf1, sizeof(buf1));
+                if (!remainder || !*remainder || !*buf1) {
+                    yasm_error_set(YASM_ERROR_SYNTAX, N_("\".%s\" expects two arguments"), directives[i].name);
+                    yasm_errwarn_propagate(pp->errwarns, pp->current_line_number);
+                    pp->fatal_error = 1;
+                } else {
+                    pp_fn2_t fn = (pp_fn2_t) directives[i].fn;
+                    pp->fatal_error = !fn(pp, directives[i].param, buf1, remainder);
+                }
+                return FALSE;
+            }
+        }
+    }
+
+    if (pp->skip_depth == 0) {
+        substitute_values(pp, line_ptr);
+        return TRUE;
+    }
+
+    return FALSE;
+}
+
+/* Functions exported by the preprocessor. */
+
+static yasm_preproc *
+gas_preproc_create(const char *in_filename, yasm_symtab *symtab,
+                   yasm_linemap *lm, yasm_errwarns *errwarns)
+{
+    FILE *f;
+    yasm_preproc_gas *pp = yasm_xmalloc(sizeof(yasm_preproc_gas));
+
+    if (strcmp(in_filename, "-") != 0) {
+        f = fopen(in_filename, "r");
+        if (!f) {
+            yasm__fatal(N_("Could not open input file"));
+        }
+    } else {
+        f = stdin;
+    }
+
+    pp->preproc.module = &yasm_gas_LTX_preproc;
+    pp->in = f;
+    pp->in_filename = yasm__xstrdup(in_filename);
+    pp->defines = yasm_symtab_create();
+    SLIST_INIT(&pp->deferred_defines);
+    yasm_symtab_set_case_sensitive(pp->defines, 1);
+    pp->depth = 0;
+    pp->skip_depth = 0;
+    pp->in_comment = FALSE;
+    SLIST_INIT(&pp->buffered_lines);
+    SLIST_INIT(&pp->included_files);
+    STAILQ_INIT(&pp->macros);
+    pp->in_line_number = 0;
+    pp->next_line_number = 0;
+    pp->current_line_number = 0;
+    pp->cur_lm = lm;
+    pp->errwarns = errwarns;
+    pp->fatal_error = 0;
+    pp->detect_errors_only = 0;
+
+    return (yasm_preproc *) pp;
+}
+
+static void
+gas_preproc_destroy(yasm_preproc *preproc)
+{
+    yasm_preproc_gas *pp = (yasm_preproc_gas *) preproc;
+    yasm_xfree(pp->in_filename);
+    yasm_symtab_destroy(pp->defines);
+    while (!SLIST_EMPTY(&pp->deferred_defines)) {
+        deferred_define *def = SLIST_FIRST(&pp->deferred_defines);
+        SLIST_REMOVE_HEAD(&pp->deferred_defines, next);
+        yasm_xfree(def->name);
+        yasm_xfree(def->value);
+        yasm_xfree(def);
+    }
+    while (!SLIST_EMPTY(&pp->buffered_lines)) {
+        buffered_line *bline = SLIST_FIRST(&pp->buffered_lines);
+        SLIST_REMOVE_HEAD(&pp->buffered_lines, next);
+        yasm_xfree(bline->line);
+        yasm_xfree(bline);
+    }
+    while (!SLIST_EMPTY(&pp->included_files)) {
+        included_file *inc_file = SLIST_FIRST(&pp->included_files);
+        SLIST_REMOVE_HEAD(&pp->included_files, next);
+        yasm_xfree(inc_file->filename);
+        yasm_xfree(inc_file);
+    }
+    while (!STAILQ_EMPTY(&pp->macros)) {
+        int i;
+        macro_entry *macro = STAILQ_FIRST(&pp->macros);
+        STAILQ_REMOVE_HEAD(&pp->macros, next);
+        yasm_xfree(macro->name);
+        for (i = 0; i < macro->num_params; i++)
+            yasm_xfree(macro->params[i]);
+        yasm_xfree(macro->params);
+        for (i = 0; i < macro->num_lines; i++)
+            yasm_xfree(macro->lines[i]);
+        yasm_xfree(macro->lines);
+        yasm_xfree(macro);
+    }
+    yasm_xfree(preproc);
+}
+
+static char *
+gas_preproc_get_line(yasm_preproc *preproc)
+{
+    yasm_preproc_gas *pp = (yasm_preproc_gas *)preproc;
+    int done = FALSE;
+    char *line = NULL;
+
+    pp->current_line_number++;
+
+    do {
+        if (line != NULL) {
+            yasm_xfree(line);
+        }
+        if (pp->fatal_error) {
+            return NULL;
+        }
+        line = read_line(pp);
+        if (line == NULL) {
+            if (pp->in_comment) {
+                yasm_linemap_set(pp->cur_lm, pp->in_filename, pp->current_line_number, pp->next_line_number, 0);
+                yasm_warn_set(YASM_WARN_GENERAL, N_("end of file in comment"));
+                yasm_errwarn_propagate(pp->errwarns, pp->current_line_number);
+                pp->in_comment = FALSE;
+            }
+            return NULL;
+        }
+        done = process_line(pp, &line);
+    } while (!done);
+
+    yasm_linemap_set(pp->cur_lm, pp->in_filename, pp->current_line_number, pp->next_line_number, 0);
+
+    return line;
+}
+
+static size_t
+gas_preproc_get_included_file(yasm_preproc *preproc, char *buf,
+                              size_t max_size)
+{
+    /* TODO */
+    return 0;
+}
+
+static void
+gas_preproc_add_include_file(yasm_preproc *preproc, const char *filename)
+{
+    yasm_preproc_gas *pp = (yasm_preproc_gas *) preproc;
+    eval_include(pp, 0, filename);
+}
+
+static void
+gas_preproc_predefine_macro(yasm_preproc *preproc, const char *macronameval)
+{
+    yasm_preproc_gas *pp = (yasm_preproc_gas *) preproc;
+    const char *eq = strstr(macronameval, "=");
+    char *name, *value;
+    if (eq) {
+        value = yasm__xstrdup(eq + 1);
+        name = yasm_xmalloc(eq - macronameval + 1);
+        memcpy(name, macronameval, eq - macronameval);
+        name[eq - macronameval] = '\0';
+    } else {
+        name = yasm__xstrdup(macronameval);
+        value = yasm__xstrdup("");
+    }
+    eval_set(pp, 1, name, value);
+    yasm_xfree(name);
+    yasm_xfree(value);
+}
+
+static void
+gas_preproc_undefine_macro(yasm_preproc *preproc, const char *macroname)
+{
+    /* TODO */
+}
+
+static void
+gas_preproc_define_builtin(yasm_preproc *preproc, const char *macronameval)
+{
+    /* TODO */
+}
+
+static void
+gas_preproc_add_standard(yasm_preproc *preproc, const char **macros)
+{
+    /* TODO */
+}
+
+
+/* Define preproc structure -- see preproc.h for details */
+yasm_preproc_module yasm_gas_LTX_preproc = {
+    "GNU AS (GAS)-compatible preprocessor",
+    "gas",
+    gas_preproc_create,
+    gas_preproc_destroy,
+    gas_preproc_get_line,
+    gas_preproc_get_included_file,
+    gas_preproc_add_include_file,
+    gas_preproc_predefine_macro,
+    gas_preproc_undefine_macro,
+    gas_preproc_define_builtin,
+    gas_preproc_add_standard
+};
diff --git a/modules/preprocs/gas/tests/Makefile.inc b/modules/preprocs/gas/tests/Makefile.inc
new file mode 100644
index 0000000..c5e628a
--- /dev/null
+++ b/modules/preprocs/gas/tests/Makefile.inc
@@ -0,0 +1,5 @@
+#TESTS += modules/preprocs/gas/tests/rawpp_test.sh
+
+#EXTRA_DIST += modules/preprocs/gas/tests/rawpp_test.sh
+#EXTRA_DIST += modules/preprocs/gas/tests/longline.asm
+#EXTRA_DIST += modules/preprocs/gas/tests/longline.hex
diff --git a/modules/preprocs/nasm/tests/scope-err.asm b/modules/preprocs/nasm/tests/scope-err.asm
new file mode 100644
index 0000000..0359532
--- /dev/null
+++ b/modules/preprocs/nasm/tests/scope-err.asm
@@ -0,0 +1,13 @@
+%define a b
+%error a
+%scope
+%define a c
+%error a
+%scope
+%define a d
+%error a
+%endscope
+%error a
+%endscope
+%error a
+%endscope
diff --git a/modules/preprocs/nasm/tests/scope-err.errwarn b/modules/preprocs/nasm/tests/scope-err.errwarn
new file mode 100644
index 0000000..32cea76
--- /dev/null
+++ b/modules/preprocs/nasm/tests/scope-err.errwarn
@@ -0,0 +1,6 @@
+-:2: warning: b
+-:5: warning: c
+-:8: warning: d
+-:10: warning: c
+-:12: warning: b
+-:13: error: `%endscope': already popped all levels
diff --git a/modules/preprocs/tasm/Makefile.inc b/modules/preprocs/tasm/Makefile.inc
new file mode 100644
index 0000000..a946835
--- /dev/null
+++ b/modules/preprocs/tasm/Makefile.inc
@@ -0,0 +1,3 @@
+EXTRA_DIST += modules/preprocs/tasm/tests/Makefile.inc
+
+include modules/preprocs/tasm/tests/Makefile.inc
diff --git a/modules/preprocs/tasm/tests/Makefile.inc b/modules/preprocs/tasm/tests/Makefile.inc
new file mode 100644
index 0000000..e2d56c1
--- /dev/null
+++ b/modules/preprocs/tasm/tests/Makefile.inc
@@ -0,0 +1,7 @@
+TESTS += modules/preprocs/tasm/tests/tasmpp_test.sh
+
+EXTRA_DIST += modules/preprocs/tasm/tests/tasmpp_test.sh
+EXTRA_DIST += modules/preprocs/tasm/tests/tasm-assume-comment.asm
+EXTRA_DIST += modules/preprocs/tasm/tests/tasm-assume-comment.hex
+EXTRA_DIST += modules/preprocs/tasm/tests/tasm-comment-instr.asm
+EXTRA_DIST += modules/preprocs/tasm/tests/tasm-comment-instr.hex
diff --git a/modules/preprocs/tasm/tests/tasm-assume-comment.asm b/modules/preprocs/tasm/tests/tasm-assume-comment.asm
new file mode 100644
index 0000000..6b7cc1b
--- /dev/null
+++ b/modules/preprocs/tasm/tests/tasm-assume-comment.asm
@@ -0,0 +1,3 @@
+assume cs:code,ds:code,es:code		; tiny model (CS=DS=ES)
+assume ds:code,es:code; close comment
+assume fs:code,gs:code
diff --git a/modules/preprocs/tasm/tests/tasm-assume-comment.hex b/modules/preprocs/tasm/tests/tasm-assume-comment.hex
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/modules/preprocs/tasm/tests/tasm-assume-comment.hex
diff --git a/modules/preprocs/tasm/tests/tasm-comment-instr.asm b/modules/preprocs/tasm/tests/tasm-comment-instr.asm
new file mode 100644
index 0000000..d93001b
--- /dev/null
+++ b/modules/preprocs/tasm/tests/tasm-comment-instr.asm
@@ -0,0 +1 @@
+ansi_normal db 0x27,'[0;40;37m$'
diff --git a/modules/preprocs/tasm/tests/tasm-comment-instr.hex b/modules/preprocs/tasm/tests/tasm-comment-instr.hex
new file mode 100644
index 0000000..594d68f
--- /dev/null
+++ b/modules/preprocs/tasm/tests/tasm-comment-instr.hex
@@ -0,0 +1,11 @@
+27 
+5b 
+30 
+3b 
+34 
+30 
+3b 
+33 
+37 
+6d 
+24 
diff --git a/modules/preprocs/tasm/tests/tasmpp_test.sh b/modules/preprocs/tasm/tests/tasmpp_test.sh
new file mode 100755
index 0000000..622e5a0
--- /dev/null
+++ b/modules/preprocs/tasm/tests/tasmpp_test.sh
@@ -0,0 +1,3 @@
+#! /bin/sh
+${srcdir}/out_test.sh tasmpp_test modules/preprocs/tasm/tests "tasm preproc" "-f bin -p tasm" ""
+exit $?
diff --git a/tools/re2c/mbo_getopt.c b/tools/re2c/mbo_getopt.c
old mode 100644
new mode 100755
diff --git a/tools/re2c/mbo_getopt.h b/tools/re2c/mbo_getopt.h
old mode 100644
new mode 100755
diff --git a/version b/version
new file mode 100644
index 0000000..26aaba0
--- /dev/null
+++ b/version
@@ -0,0 +1 @@
+1.2.0