Skip to content

Commit 016dfa3

Browse files
committed
Adding Episode 2
1 parent fd24521 commit 016dfa3

File tree

6 files changed

+160
-31
lines changed

6 files changed

+160
-31
lines changed

Diff for: Assembly64.sln

+15-10
Original file line numberDiff line numberDiff line change
@@ -7,34 +7,39 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "AssemblyAndC", "Episode1\As
77
EndProject
88
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "AssemblyOnly", "Episode1\AssemblyOnly\AssemblyOnly.vcxproj", "{2428959B-A8CD-4714-925C-449824952972}"
99
EndProject
10+
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Episode 1", "Episode 1", "{61B13938-2A49-4055-9F82-408CA73A43E0}"
11+
EndProject
12+
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Episode 2", "Episode 2", "{00B8EA82-EE93-4557-A6F6-27E1FF7E9EB7}"
13+
EndProject
14+
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Registers+MOV", "Episode2\Registers+MOV\Registers+MOV.vcxproj", "{A1259A23-9513-4BC9-955C-8460C98A84AF}"
15+
EndProject
1016
Global
1117
GlobalSection(SolutionConfigurationPlatforms) = preSolution
1218
Debug|x64 = Debug|x64
13-
Debug|x86 = Debug|x86
1419
Release|x64 = Release|x64
15-
Release|x86 = Release|x86
1620
EndGlobalSection
1721
GlobalSection(ProjectConfigurationPlatforms) = postSolution
1822
{B6DFCD0B-A590-489A-BD7D-54EDE27EBCCA}.Debug|x64.ActiveCfg = Debug|x64
1923
{B6DFCD0B-A590-489A-BD7D-54EDE27EBCCA}.Debug|x64.Build.0 = Debug|x64
20-
{B6DFCD0B-A590-489A-BD7D-54EDE27EBCCA}.Debug|x86.ActiveCfg = Debug|x64
21-
{B6DFCD0B-A590-489A-BD7D-54EDE27EBCCA}.Debug|x86.Build.0 = Debug|x64
2224
{B6DFCD0B-A590-489A-BD7D-54EDE27EBCCA}.Release|x64.ActiveCfg = Release|x64
2325
{B6DFCD0B-A590-489A-BD7D-54EDE27EBCCA}.Release|x64.Build.0 = Release|x64
24-
{B6DFCD0B-A590-489A-BD7D-54EDE27EBCCA}.Release|x86.ActiveCfg = Release|x64
25-
{B6DFCD0B-A590-489A-BD7D-54EDE27EBCCA}.Release|x86.Build.0 = Release|x64
2626
{2428959B-A8CD-4714-925C-449824952972}.Debug|x64.ActiveCfg = Debug|x64
2727
{2428959B-A8CD-4714-925C-449824952972}.Debug|x64.Build.0 = Debug|x64
28-
{2428959B-A8CD-4714-925C-449824952972}.Debug|x86.ActiveCfg = Debug|Win32
29-
{2428959B-A8CD-4714-925C-449824952972}.Debug|x86.Build.0 = Debug|Win32
3028
{2428959B-A8CD-4714-925C-449824952972}.Release|x64.ActiveCfg = Release|x64
3129
{2428959B-A8CD-4714-925C-449824952972}.Release|x64.Build.0 = Release|x64
32-
{2428959B-A8CD-4714-925C-449824952972}.Release|x86.ActiveCfg = Release|Win32
33-
{2428959B-A8CD-4714-925C-449824952972}.Release|x86.Build.0 = Release|Win32
30+
{A1259A23-9513-4BC9-955C-8460C98A84AF}.Debug|x64.ActiveCfg = Debug|x64
31+
{A1259A23-9513-4BC9-955C-8460C98A84AF}.Debug|x64.Build.0 = Debug|x64
32+
{A1259A23-9513-4BC9-955C-8460C98A84AF}.Release|x64.ActiveCfg = Release|x64
33+
{A1259A23-9513-4BC9-955C-8460C98A84AF}.Release|x64.Build.0 = Release|x64
3434
EndGlobalSection
3535
GlobalSection(SolutionProperties) = preSolution
3636
HideSolutionNode = FALSE
3737
EndGlobalSection
38+
GlobalSection(NestedProjects) = preSolution
39+
{B6DFCD0B-A590-489A-BD7D-54EDE27EBCCA} = {61B13938-2A49-4055-9F82-408CA73A43E0}
40+
{2428959B-A8CD-4714-925C-449824952972} = {61B13938-2A49-4055-9F82-408CA73A43E0}
41+
{A1259A23-9513-4BC9-955C-8460C98A84AF} = {00B8EA82-EE93-4557-A6F6-27E1FF7E9EB7}
42+
EndGlobalSection
3843
GlobalSection(ExtensibilityGlobals) = postSolution
3944
SolutionGuid = {74B06FA8-487D-4545-8B72-13DF56D10686}
4045
EndGlobalSection

Diff for: Episode1/AssemblyOnly/AssemblyOnly.vcxproj

-21
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,6 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
33
<ItemGroup Label="ProjectConfigurations">
4-
<ProjectConfiguration Include="Debug|Win32">
5-
<Configuration>Debug</Configuration>
6-
<Platform>Win32</Platform>
7-
</ProjectConfiguration>
8-
<ProjectConfiguration Include="Release|Win32">
9-
<Configuration>Release</Configuration>
10-
<Platform>Win32</Platform>
11-
</ProjectConfiguration>
124
<ProjectConfiguration Include="Debug|x64">
135
<Configuration>Debug</Configuration>
146
<Platform>x64</Platform>
@@ -26,19 +18,6 @@
2618
<WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>
2719
</PropertyGroup>
2820
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
29-
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
30-
<ConfigurationType>Application</ConfigurationType>
31-
<UseDebugLibraries>true</UseDebugLibraries>
32-
<PlatformToolset>v143</PlatformToolset>
33-
<CharacterSet>Unicode</CharacterSet>
34-
</PropertyGroup>
35-
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
36-
<ConfigurationType>Application</ConfigurationType>
37-
<UseDebugLibraries>false</UseDebugLibraries>
38-
<PlatformToolset>v143</PlatformToolset>
39-
<WholeProgramOptimization>true</WholeProgramOptimization>
40-
<CharacterSet>Unicode</CharacterSet>
41-
</PropertyGroup>
4221
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
4322
<ConfigurationType>Application</ConfigurationType>
4423
<UseDebugLibraries>true</UseDebugLibraries>

Diff for: Episode2/Registers+MOV/Registers+MOV.vcxproj

+85
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,85 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3+
<ItemGroup Label="ProjectConfigurations">
4+
<ProjectConfiguration Include="Debug|x64">
5+
<Configuration>Debug</Configuration>
6+
<Platform>x64</Platform>
7+
</ProjectConfiguration>
8+
<ProjectConfiguration Include="Release|x64">
9+
<Configuration>Release</Configuration>
10+
<Platform>x64</Platform>
11+
</ProjectConfiguration>
12+
</ItemGroup>
13+
<PropertyGroup Label="Globals">
14+
<VCProjectVersion>16.0</VCProjectVersion>
15+
<Keyword>Win32Proj</Keyword>
16+
<ProjectGuid>{a1259a23-9513-4bc9-955c-8460c98a84af}</ProjectGuid>
17+
<RootNamespace>Registers_MOV</RootNamespace>
18+
<WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>
19+
</PropertyGroup>
20+
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
21+
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
22+
<ConfigurationType>Application</ConfigurationType>
23+
<UseDebugLibraries>true</UseDebugLibraries>
24+
<PlatformToolset>v143</PlatformToolset>
25+
<CharacterSet>Unicode</CharacterSet>
26+
</PropertyGroup>
27+
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
28+
<ConfigurationType>Application</ConfigurationType>
29+
<UseDebugLibraries>false</UseDebugLibraries>
30+
<PlatformToolset>v143</PlatformToolset>
31+
<WholeProgramOptimization>true</WholeProgramOptimization>
32+
<CharacterSet>Unicode</CharacterSet>
33+
</PropertyGroup>
34+
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
35+
<ImportGroup Label="ExtensionSettings">
36+
<Import Project="$(VCTargetsPath)\BuildCustomizations\masm.props" />
37+
</ImportGroup>
38+
<ImportGroup Label="Shared">
39+
</ImportGroup>
40+
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
41+
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
42+
</ImportGroup>
43+
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
44+
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
45+
</ImportGroup>
46+
<PropertyGroup Label="UserMacros" />
47+
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
48+
<ClCompile>
49+
<WarningLevel>Level3</WarningLevel>
50+
<SDLCheck>true</SDLCheck>
51+
<PreprocessorDefinitions>_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
52+
<ConformanceMode>true</ConformanceMode>
53+
</ClCompile>
54+
<Link>
55+
<SubSystem>Console</SubSystem>
56+
<GenerateDebugInformation>true</GenerateDebugInformation>
57+
</Link>
58+
</ItemDefinitionGroup>
59+
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
60+
<ClCompile>
61+
<WarningLevel>Level3</WarningLevel>
62+
<FunctionLevelLinking>true</FunctionLevelLinking>
63+
<IntrinsicFunctions>true</IntrinsicFunctions>
64+
<SDLCheck>true</SDLCheck>
65+
<PreprocessorDefinitions>NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
66+
<ConformanceMode>true</ConformanceMode>
67+
</ClCompile>
68+
<Link>
69+
<SubSystem>Console</SubSystem>
70+
<EnableCOMDATFolding>true</EnableCOMDATFolding>
71+
<OptimizeReferences>true</OptimizeReferences>
72+
<GenerateDebugInformation>true</GenerateDebugInformation>
73+
</Link>
74+
</ItemDefinitionGroup>
75+
<ItemGroup>
76+
<ClCompile Include="main.cpp" />
77+
</ItemGroup>
78+
<ItemGroup>
79+
<MASM Include="registers+MOV.asm" />
80+
</ItemGroup>
81+
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
82+
<ImportGroup Label="ExtensionTargets">
83+
<Import Project="$(VCTargetsPath)\BuildCustomizations\masm.targets" />
84+
</ImportGroup>
85+
</Project>

Diff for: Episode2/Registers+MOV/Registers+MOV.vcxproj.filters

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3+
<ItemGroup>
4+
<ClCompile Include="main.cpp" />
5+
</ItemGroup>
6+
<ItemGroup>
7+
<MASM Include="registers+MOV.asm" />
8+
</ItemGroup>
9+
</Project>

Diff for: Episode2/Registers+MOV/main.cpp

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
#include "stdio.h"
2+
3+
4+
extern "C" void Example();
5+
6+
7+
8+
int main()
9+
{
10+
Example();
11+
return 0;
12+
}

Diff for: Episode2/Registers+MOV/registers+MOV.asm

+39
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
.CODE
2+
3+
4+
; <------
5+
; mov <dest>, <src>
6+
;
7+
; mov <register>, <memory>
8+
; mov <register>, <immediate value>
9+
; mov <register>, <register>
10+
; mov <memory>, <register>
11+
12+
13+
14+
Example PROC
15+
16+
mov r8, 0 ; clear
17+
mov r8b, 11h ; move 8 bits
18+
mov r8w, 2222h ; move 16 bits
19+
mov r8d, 33333333h ; move 32 bits
20+
mov r8, 4444444444444444h ; move 64 bits
21+
mov rax, r8 ; move from register to register
22+
23+
mov rax, 0 ; clear
24+
mov al, 11h ; move into lower 8 bits of 16 bit register
25+
mov ah, 22h ; move into higher 8 bits of 16 bit register
26+
mov ax, 3333h ; move 16 bits
27+
mov eax, 44444444h ; move 32 bits
28+
mov rax, 5555555555555555h ; move 64 bits
29+
30+
mov r8, 0FFFFFFFFFFFFFFFFh ; initialize
31+
mov r8b, 11h ; move 8 bits
32+
mov r8w, 2222h ; move 16 bits
33+
mov r8d, 33333333h ; !!! storing in the lower 32 bits will clear the top 32 bits !!!
34+
35+
ret
36+
Example ENDP
37+
38+
39+
END

0 commit comments

Comments
 (0)