forked from Apress/modern-x86-assembly-language-programming
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Apress
committed
Oct 18, 2016
0 parents
commit 7a38dfd
Showing
844 changed files
with
39,820 additions
and
0 deletions.
There are no files selected for viewing
22 changes: 22 additions & 0 deletions
22
978-1-4842-0065-0_SourceCode/AppendixA/Example1/Example1.sln
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
|
||
Microsoft Visual Studio Solution File, Format Version 12.00 | ||
# Visual Studio 2013 | ||
VisualStudioVersion = 12.0.30723.0 | ||
MinimumVisualStudioVersion = 10.0.40219.1 | ||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Example1", "Example1\Example1.vcxproj", "{443F8D86-E763-44FE-97A4-217316E46403}" | ||
EndProject | ||
Global | ||
GlobalSection(SolutionConfigurationPlatforms) = preSolution | ||
Debug|Win32 = Debug|Win32 | ||
Release|Win32 = Release|Win32 | ||
EndGlobalSection | ||
GlobalSection(ProjectConfigurationPlatforms) = postSolution | ||
{443F8D86-E763-44FE-97A4-217316E46403}.Debug|Win32.ActiveCfg = Debug|Win32 | ||
{443F8D86-E763-44FE-97A4-217316E46403}.Debug|Win32.Build.0 = Debug|Win32 | ||
{443F8D86-E763-44FE-97A4-217316E46403}.Release|Win32.ActiveCfg = Release|Win32 | ||
{443F8D86-E763-44FE-97A4-217316E46403}.Release|Win32.Build.0 = Release|Win32 | ||
EndGlobalSection | ||
GlobalSection(SolutionProperties) = preSolution | ||
HideSolutionNode = FALSE | ||
EndGlobalSection | ||
EndGlobal |
15 changes: 15 additions & 0 deletions
15
978-1-4842-0065-0_SourceCode/AppendixA/Example1/Example1/Example1.cpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
#include "stdafx.h" | ||
|
||
extern "C" int CalcResult1_(int a, int b, int c); | ||
|
||
int _tmain(int argc, _TCHAR* argv[]) | ||
{ | ||
int a = 30; | ||
int b = 20; | ||
int c = 10; | ||
int d = CalcResult1_(a, b, c); | ||
|
||
printf("a: %4d b: %4d c: %4d\n", a, b, c); | ||
printf("d: %4d\n", d); | ||
return 0; | ||
} |
114 changes: 114 additions & 0 deletions
114
978-1-4842-0065-0_SourceCode/AppendixA/Example1/Example1/Example1.vcxproj
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,114 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<Project DefaultTargets="Build" ToolsVersion="12.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>{443F8D86-E763-44FE-97A4-217316E46403}</ProjectGuid> | ||
<Keyword>Win32Proj</Keyword> | ||
<RootNamespace>Example1</RootNamespace> | ||
</PropertyGroup> | ||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" /> | ||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration"> | ||
<ConfigurationType>Application</ConfigurationType> | ||
<UseDebugLibraries>true</UseDebugLibraries> | ||
<PlatformToolset>v120</PlatformToolset> | ||
<CharacterSet>Unicode</CharacterSet> | ||
</PropertyGroup> | ||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration"> | ||
<ConfigurationType>Application</ConfigurationType> | ||
<UseDebugLibraries>false</UseDebugLibraries> | ||
<PlatformToolset>v120</PlatformToolset> | ||
<WholeProgramOptimization>true</WholeProgramOptimization> | ||
<CharacterSet>Unicode</CharacterSet> | ||
</PropertyGroup> | ||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" /> | ||
<ImportGroup Label="ExtensionSettings"> | ||
<Import Project="$(VCTargetsPath)\BuildCustomizations\masm.props" /> | ||
</ImportGroup> | ||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'"> | ||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> | ||
</ImportGroup> | ||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'"> | ||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> | ||
</ImportGroup> | ||
<PropertyGroup Label="UserMacros" /> | ||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'"> | ||
<LinkIncremental>true</LinkIncremental> | ||
</PropertyGroup> | ||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'"> | ||
<LinkIncremental>false</LinkIncremental> | ||
</PropertyGroup> | ||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'"> | ||
<ClCompile> | ||
<PrecompiledHeader>Use</PrecompiledHeader> | ||
<WarningLevel>Level3</WarningLevel> | ||
<Optimization>Disabled</Optimization> | ||
<PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions> | ||
<SDLCheck>true</SDLCheck> | ||
</ClCompile> | ||
<Link> | ||
<SubSystem>Console</SubSystem> | ||
<GenerateDebugInformation>true</GenerateDebugInformation> | ||
</Link> | ||
<MASM> | ||
<EnableAssemblyGeneratedCodeListing>true</EnableAssemblyGeneratedCodeListing> | ||
</MASM> | ||
<MASM> | ||
<AssembledCodeListingFile>$(IntDir)\%(Filename).lst</AssembledCodeListingFile> | ||
<UseSafeExceptionHandlers>true</UseSafeExceptionHandlers> | ||
</MASM> | ||
</ItemDefinitionGroup> | ||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'"> | ||
<ClCompile> | ||
<WarningLevel>Level3</WarningLevel> | ||
<PrecompiledHeader>Use</PrecompiledHeader> | ||
<Optimization>MaxSpeed</Optimization> | ||
<FunctionLevelLinking>true</FunctionLevelLinking> | ||
<IntrinsicFunctions>true</IntrinsicFunctions> | ||
<PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions> | ||
<SDLCheck>true</SDLCheck> | ||
</ClCompile> | ||
<Link> | ||
<SubSystem>Console</SubSystem> | ||
<GenerateDebugInformation>true</GenerateDebugInformation> | ||
<EnableCOMDATFolding>true</EnableCOMDATFolding> | ||
<OptimizeReferences>true</OptimizeReferences> | ||
</Link> | ||
<MASM> | ||
<EnableAssemblyGeneratedCodeListing>true</EnableAssemblyGeneratedCodeListing> | ||
</MASM> | ||
<MASM> | ||
<AssembledCodeListingFile>$(IntDir)\%(Filename).lst</AssembledCodeListingFile> | ||
<UseSafeExceptionHandlers>true</UseSafeExceptionHandlers> | ||
</MASM> | ||
</ItemDefinitionGroup> | ||
<ItemGroup> | ||
<Text Include="ReadMe.txt" /> | ||
</ItemGroup> | ||
<ItemGroup> | ||
<ClInclude Include="stdafx.h" /> | ||
<ClInclude Include="targetver.h" /> | ||
</ItemGroup> | ||
<ItemGroup> | ||
<ClCompile Include="Example1.cpp" /> | ||
<ClCompile Include="stdafx.cpp"> | ||
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Create</PrecompiledHeader> | ||
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">Create</PrecompiledHeader> | ||
</ClCompile> | ||
</ItemGroup> | ||
<ItemGroup> | ||
<MASM Include="Example1_.asm" /> | ||
</ItemGroup> | ||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" /> | ||
<ImportGroup Label="ExtensionTargets"> | ||
<Import Project="$(VCTargetsPath)\BuildCustomizations\masm.targets" /> | ||
</ImportGroup> | ||
</Project> |
41 changes: 41 additions & 0 deletions
41
978-1-4842-0065-0_SourceCode/AppendixA/Example1/Example1/Example1.vcxproj.filters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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="Source Files"> | ||
<UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier> | ||
<Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions> | ||
</Filter> | ||
<Filter Include="Header Files"> | ||
<UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier> | ||
<Extensions>h;hh;hpp;hxx;hm;inl;inc;xsd</Extensions> | ||
</Filter> | ||
<Filter Include="Resource Files"> | ||
<UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier> | ||
<Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions> | ||
</Filter> | ||
</ItemGroup> | ||
<ItemGroup> | ||
<Text Include="ReadMe.txt" /> | ||
</ItemGroup> | ||
<ItemGroup> | ||
<ClInclude Include="stdafx.h"> | ||
<Filter>Header Files</Filter> | ||
</ClInclude> | ||
<ClInclude Include="targetver.h"> | ||
<Filter>Header Files</Filter> | ||
</ClInclude> | ||
</ItemGroup> | ||
<ItemGroup> | ||
<ClCompile Include="stdafx.cpp"> | ||
<Filter>Source Files</Filter> | ||
</ClCompile> | ||
<ClCompile Include="Example1.cpp"> | ||
<Filter>Source Files</Filter> | ||
</ClCompile> | ||
</ItemGroup> | ||
<ItemGroup> | ||
<MASM Include="Example1_.asm"> | ||
<Filter>Source Files</Filter> | ||
</MASM> | ||
</ItemGroup> | ||
</Project> |
20 changes: 20 additions & 0 deletions
20
978-1-4842-0065-0_SourceCode/AppendixA/Example1/Example1/Example1_.asm
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
.model flat,c | ||
.code | ||
|
||
; extern "C" int CalcResult1_(int a, int b, int c); | ||
|
||
CalcResult1_ proc | ||
push ebp | ||
mov ebp,esp | ||
|
||
mov eax,[ebp+8] ;eax = a | ||
mov ecx,[ebp+12] ;ecx = b | ||
mov edx,[ebp+16] ;edx = c | ||
|
||
add eax,ecx ;eax = a + b | ||
imul eax,edx ;eax = (a + b) * c | ||
|
||
pop ebp | ||
ret | ||
CalcResult1_ endp | ||
end |
40 changes: 40 additions & 0 deletions
40
978-1-4842-0065-0_SourceCode/AppendixA/Example1/Example1/ReadMe.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
======================================================================== | ||
CONSOLE APPLICATION : Example1 Project Overview | ||
======================================================================== | ||
|
||
AppWizard has created this Example1 application for you. | ||
|
||
This file contains a summary of what you will find in each of the files that | ||
make up your Example1 application. | ||
|
||
|
||
Example1.vcxproj | ||
This is the main project file for VC++ projects generated using an Application Wizard. | ||
It contains information about the version of Visual C++ that generated the file, and | ||
information about the platforms, configurations, and project features selected with the | ||
Application Wizard. | ||
|
||
Example1.vcxproj.filters | ||
This is the filters file for VC++ projects generated using an Application Wizard. | ||
It contains information about the association between the files in your project | ||
and the filters. This association is used in the IDE to show grouping of files with | ||
similar extensions under a specific node (for e.g. ".cpp" files are associated with the | ||
"Source Files" filter). | ||
|
||
Example1.cpp | ||
This is the main application source file. | ||
|
||
///////////////////////////////////////////////////////////////////////////// | ||
Other standard files: | ||
|
||
StdAfx.h, StdAfx.cpp | ||
These files are used to build a precompiled header (PCH) file | ||
named Example1.pch and a precompiled types file named StdAfx.obj. | ||
|
||
///////////////////////////////////////////////////////////////////////////// | ||
Other notes: | ||
|
||
AppWizard uses "TODO:" comments to indicate parts of the source code you | ||
should add to or customize. | ||
|
||
///////////////////////////////////////////////////////////////////////////// |
8 changes: 8 additions & 0 deletions
8
978-1-4842-0065-0_SourceCode/AppendixA/Example1/Example1/stdafx.cpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
// stdafx.cpp : source file that includes just the standard includes | ||
// Example1.pch will be the pre-compiled header | ||
// stdafx.obj will contain the pre-compiled type information | ||
|
||
#include "stdafx.h" | ||
|
||
// TODO: reference any additional headers you need in STDAFX.H | ||
// and not in this file |
15 changes: 15 additions & 0 deletions
15
978-1-4842-0065-0_SourceCode/AppendixA/Example1/Example1/stdafx.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
// stdafx.h : include file for standard system include files, | ||
// or project specific include files that are used frequently, but | ||
// are changed infrequently | ||
// | ||
|
||
#pragma once | ||
|
||
#include "targetver.h" | ||
|
||
#include <stdio.h> | ||
#include <tchar.h> | ||
|
||
|
||
|
||
// TODO: reference additional headers your program requires here |
8 changes: 8 additions & 0 deletions
8
978-1-4842-0065-0_SourceCode/AppendixA/Example1/Example1/targetver.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
#pragma once | ||
|
||
// Including SDKDDKVer.h defines the highest available Windows platform. | ||
|
||
// If you wish to build your application for a previous Windows platform, include WinSDKVer.h and | ||
// set the _WIN32_WINNT macro to the platform you wish to support before including SDKDDKVer.h. | ||
|
||
#include <SDKDDKVer.h> |
22 changes: 22 additions & 0 deletions
22
978-1-4842-0065-0_SourceCode/AppendixA/Example2/Example2.sln
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
|
||
Microsoft Visual Studio Solution File, Format Version 12.00 | ||
# Visual Studio 2013 | ||
VisualStudioVersion = 12.0.30723.0 | ||
MinimumVisualStudioVersion = 10.0.40219.1 | ||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Example2", "Example2\Example2.vcxproj", "{E825B09D-4425-49CA-A440-E5E83DDB89C6}" | ||
EndProject | ||
Global | ||
GlobalSection(SolutionConfigurationPlatforms) = preSolution | ||
Debug|Win32 = Debug|Win32 | ||
Release|Win32 = Release|Win32 | ||
EndGlobalSection | ||
GlobalSection(ProjectConfigurationPlatforms) = postSolution | ||
{E825B09D-4425-49CA-A440-E5E83DDB89C6}.Debug|Win32.ActiveCfg = Debug|Win32 | ||
{E825B09D-4425-49CA-A440-E5E83DDB89C6}.Debug|Win32.Build.0 = Debug|Win32 | ||
{E825B09D-4425-49CA-A440-E5E83DDB89C6}.Release|Win32.ActiveCfg = Release|Win32 | ||
{E825B09D-4425-49CA-A440-E5E83DDB89C6}.Release|Win32.Build.0 = Release|Win32 | ||
EndGlobalSection | ||
GlobalSection(SolutionProperties) = preSolution | ||
HideSolutionNode = FALSE | ||
EndGlobalSection | ||
EndGlobal |
17 changes: 17 additions & 0 deletions
17
978-1-4842-0065-0_SourceCode/AppendixA/Example2/Example2/Example2.cpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
#include "stdafx.h" | ||
|
||
extern "C" void CalcResult2_(int a, int b, int c, int* quo, int* rem); | ||
|
||
int _tmain(int argc, _TCHAR* argv[]) | ||
{ | ||
int a = 75; | ||
int b = 125; | ||
int c = 7; | ||
int quo, rem; | ||
|
||
CalcResult2_(a, b, c, &quo, &rem); | ||
|
||
printf("a: %4d b: %4d c: %4d\n", a, b, c); | ||
printf("quo: %4d rem: %4d\n", quo, rem); | ||
return 0; | ||
} |
Oops, something went wrong.