Skip to content
This repository has been archived by the owner on Mar 27, 2024. It is now read-only.

Commit

Permalink
Initial commit.
Browse files Browse the repository at this point in the history
  • Loading branch information
koutheir committed Mar 18, 2014
1 parent 2f990b9 commit f7dcd55
Show file tree
Hide file tree
Showing 26 changed files with 4,855 additions and 1 deletion.
6 changes: 6 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,9 @@
*.lai
*.la
*.a

*.user
/Release
*.com
*.exe

35 changes: 35 additions & 0 deletions I8086CL/I8086CL.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@

#include <windows.h>


BOOL APIENTRY wWinMain(HINSTANCE, HINSTANCE, LPTSTR, int)
{
int argc;
wchar_t **argv = CommandLineToArgvW(GetCommandLineW(), &argc);

if (argc < 4) return ERROR_INVALID_PARAMETER;

DWORD nErr=ERROR_SUCCESS, nParentID = (DWORD)_wtol(argv[1]);
HANDLE hList[2] = {
OpenProcess(SYNCHRONIZE, FALSE, nParentID),
(HANDLE)_wtol(argv[3])
};
if (!hList[0]) return GetLastError();

if (!AttachConsole(nParentID)) { //Attach to the parent console
nErr = GetLastError();
goto Done;
}

if (!SetEvent((HANDLE)_wtol(argv[2]))) { //Allow the parent to continue execution
nErr = GetLastError();
goto Done;
}

if (WaitForMultipleObjects(2, hList, FALSE, INFINITE) == WAIT_FAILED)
nErr = GetLastError();

Done:
CloseHandle(hList[0]);
return nErr;
}
177 changes: 177 additions & 0 deletions I8086CL/I8086CL.vcproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,177 @@
<?xml version="1.0" encoding="Windows-1252"?>
<VisualStudioProject
ProjectType="Visual C++"
Version="9,00"
Name="Intel 8086 Console Locker"
ProjectGUID="{5DA65652-1883-473F-8585-62DD4BB6F0A8}"
RootNamespace="I8086CL"
Keyword="Win32Proj"
TargetFrameworkVersion="196613"
>
<Platforms>
<Platform
Name="Win32"
/>
</Platforms>
<ToolFiles>
</ToolFiles>
<Configurations>
<Configuration
Name="Debug|Win32"
OutputDirectory="$(SolutionDir)$(ConfigurationName)"
IntermediateDirectory="$(ConfigurationName)"
ConfigurationType="1"
UseOfATL="1"
CharacterSet="1"
>
<Tool
Name="VCPreBuildEventTool"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
/>
<Tool
Name="VCCLCompilerTool"
Optimization="0"
PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS"
MinimalRebuild="true"
BasicRuntimeChecks="3"
RuntimeLibrary="1"
UsePrecompiledHeader="0"
WarningLevel="4"
DebugInformationFormat="3"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLinkerTool"
OutputFile="$(OutDir)\I8086CL.exe"
LinkIncremental="2"
GenerateDebugInformation="true"
SubSystem="2"
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|Win32"
OutputDirectory="$(SolutionDir)$(ConfigurationName)"
IntermediateDirectory="$(ConfigurationName)"
ConfigurationType="1"
UseOfATL="1"
CharacterSet="1"
WholeProgramOptimization="1"
>
<Tool
Name="VCPreBuildEventTool"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
/>
<Tool
Name="VCCLCompilerTool"
Optimization="3"
EnableIntrinsicFunctions="true"
PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS"
StringPooling="true"
RuntimeLibrary="0"
EnableFunctionLevelLinking="true"
WarningLevel="4"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLinkerTool"
OutputFile="$(OutDir)\I8086CL.exe"
LinkIncremental="1"
SubSystem="2"
OptimizeReferences="2"
EnableCOMDATFolding="2"
TargetMachine="1"
/>
<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>
<File
RelativePath=".\I8086CL.cpp"
>
</File>
</Files>
<Globals>
</Globals>
</VisualStudioProject>
31 changes: 31 additions & 0 deletions Intel 8086 Simulator.sln
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@

Microsoft Visual Studio Solution File, Format Version 10.00
# Visual Studio 2008
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Intel 8086 Simulator", "i8086sim\I8086Sim.vcproj", "{CAFADABB-9465-4EC5-AFF4-59E2EA07BFEB}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Intel 8086 Console Locker", "I8086CL\I8086CL.vcproj", "{5DA65652-1883-473F-8585-62DD4BB6F0A8}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Documents", "Documents", "{81D1EABA-86F5-4F23-9EBD-0D5342B3F36C}"
ProjectSection(SolutionItems) = preProject
I8086SIM.odt = I8086SIM.odt
EndProjectSection
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Win32 = Debug|Win32
Release|Win32 = Release|Win32
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{CAFADABB-9465-4EC5-AFF4-59E2EA07BFEB}.Debug|Win32.ActiveCfg = Debug|Win32
{CAFADABB-9465-4EC5-AFF4-59E2EA07BFEB}.Debug|Win32.Build.0 = Debug|Win32
{CAFADABB-9465-4EC5-AFF4-59E2EA07BFEB}.Release|Win32.ActiveCfg = Release|Win32
{CAFADABB-9465-4EC5-AFF4-59E2EA07BFEB}.Release|Win32.Build.0 = Release|Win32
{5DA65652-1883-473F-8585-62DD4BB6F0A8}.Debug|Win32.ActiveCfg = Debug|Win32
{5DA65652-1883-473F-8585-62DD4BB6F0A8}.Debug|Win32.Build.0 = Debug|Win32
{5DA65652-1883-473F-8585-62DD4BB6F0A8}.Release|Win32.ActiveCfg = Release|Win32
{5DA65652-1883-473F-8585-62DD4BB6F0A8}.Release|Win32.Build.0 = Release|Win32
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
EndGlobal
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
i8086sim
========

A simulator for the 16 bits microprocessor 8086 of Intel
A simulator for the 16 bits microprocessor 8086 of Intel.
7 changes: 7 additions & 0 deletions Test/com.asm
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@

org 100h

mov ax,2
xor cx,cx
div cx
int 20h
Loading

0 comments on commit f7dcd55

Please sign in to comment.