diff --git a/source/HelloWorldMetal/HelloWorldMetal.csproj b/source/HelloWorldMetal/HelloWorldMetal.csproj new file mode 100644 index 000000000..d3f625981 --- /dev/null +++ b/source/HelloWorldMetal/HelloWorldMetal.csproj @@ -0,0 +1,49 @@ + + + + Debug + AnyCPU + 9.0.20706 + 2.0 + {B57BEF6D-48D6-49DD-B4C5-893537E0EBB8} + Exe + Properties + HelloWorldMetal + HelloWorldMetal + v3.5 + 512 + SAK + SAK + SAK + SAK + + + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + + + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + + + + + + \ No newline at end of file diff --git a/source/HelloWorldMetal/HelloWorldMetal.csproj.vspscc b/source/HelloWorldMetal/HelloWorldMetal.csproj.vspscc new file mode 100644 index 000000000..feffdecaa --- /dev/null +++ b/source/HelloWorldMetal/HelloWorldMetal.csproj.vspscc @@ -0,0 +1,10 @@ +"" +{ +"FILE_VERSION" = "9237" +"ENLISTMENT_CHOICE" = "NEVER" +"PROJECT_FILE_RELATIVE_PATH" = "" +"NUMBER_OF_EXCLUDED_FILES" = "0" +"ORIGINAL_PROJECT_FILE_PATH" = "" +"NUMBER_OF_NESTED_PROJECTS" = "0" +"SOURCE_CONTROL_SETTINGS_PROVIDER" = "PROVIDER" +} diff --git a/source/HelloWorldMetal/Program.cs b/source/HelloWorldMetal/Program.cs new file mode 100644 index 000000000..d10fcc09a --- /dev/null +++ b/source/HelloWorldMetal/Program.cs @@ -0,0 +1,33 @@ +using System; + +namespace HelloWorldMetal { + // Restrictions for Metal compile is that static members only, and no heap usage + // Basic string support is provided by using c strings in data sections + class Program { + // These would be output in the data section. Since no heap exists, + // all are treated as globals and space is fixed and preallocated + static int Level = 0; + static string StringValue = "Hello"; + + static void Main() { + // Local variables are ok too, since they are stack based + int i = 0; + // String literals translate to ldstr - these would automatically be pulled out + // and put in the data section. String manipuation not permitted unless the actual + // bytes are modified directly. + // + // Implement the P/Invoke interface. This will allow interfacing to Windows + // and other systems. + // + // Certain statics can have points mapped and replaced with future metal code + // or translations to P/Invokes. + // Such as Console.Write. It can be determined by name and remapped to + // the Win32 calll. + // Console.Write("Hello World"); + // For now - lets stick with P/Invoke only - I want to do some more investigation + // around map replacement + // So the current test would be - declare a P/Invoke for writing to console in Win32 + // then call it below with "HelloWorld" + } + } +} diff --git a/source/HelloWorldMetal/Properties/AssemblyInfo.cs b/source/HelloWorldMetal/Properties/AssemblyInfo.cs new file mode 100644 index 000000000..d651e3290 --- /dev/null +++ b/source/HelloWorldMetal/Properties/AssemblyInfo.cs @@ -0,0 +1,36 @@ +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +[assembly: AssemblyTitle("HelloWorldMetal")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("HelloWorldMetal")] +[assembly: AssemblyCopyright("Copyright © 2007")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from +// COM, set the ComVisible attribute to true on that type. +[assembly: ComVisible(false)] + +// The following GUID is for the ID of the typelib if this project is exposed to COM +[assembly: Guid("64e502f4-e371-46df-b089-0d6f6e11d778")] + +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// You can specify all the values or you can default the Build and Revision Numbers +// by using the '*' as shown below: +// [assembly: AssemblyVersion("1.0.*")] +[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/source/IL2CPU.sln b/source/IL2CPU.sln index d9de7afcf..164077e57 100644 --- a/source/IL2CPU.sln +++ b/source/IL2CPU.sln @@ -19,9 +19,11 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Indy.IL2CPU.IL.X86", "Indy. EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "HelloWorldAssembler", "HelloWorldAssembler\HelloWorldAssembler.csproj", "{E17BC1C6-3E4F-443F-804E-CB43A5610DDB}" EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "HelloWorldMetal", "HelloWorldMetal\HelloWorldMetal.csproj", "{B57BEF6D-48D6-49DD-B4C5-893537E0EBB8}" +EndProject Global GlobalSection(TeamFoundationVersionControl) = preSolution - SccNumberOfProjects = 10 + SccNumberOfProjects = 11 SccEnterpriseProvider = {4CA58AB2-18FA-4F8D-95D4-32DDF27D184C} SccTeamFoundationServer = https://tfs04.codeplex.com/ SccLocalPath0 = . @@ -52,6 +54,9 @@ Global SccProjectUniqueName9 = HelloWorldAssembler\\HelloWorldAssembler.csproj SccProjectName9 = HelloWorldAssembler SccLocalPath9 = HelloWorldAssembler + SccProjectUniqueName10 = HelloWorldMetal\\HelloWorldMetal.csproj + SccProjectName10 = HelloWorldMetal + SccLocalPath10 = HelloWorldMetal EndGlobalSection GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -94,6 +99,10 @@ Global {E17BC1C6-3E4F-443F-804E-CB43A5610DDB}.Debug|Any CPU.Build.0 = Debug|Any CPU {E17BC1C6-3E4F-443F-804E-CB43A5610DDB}.Release|Any CPU.ActiveCfg = Release|Any CPU {E17BC1C6-3E4F-443F-804E-CB43A5610DDB}.Release|Any CPU.Build.0 = Release|Any CPU + {B57BEF6D-48D6-49DD-B4C5-893537E0EBB8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {B57BEF6D-48D6-49DD-B4C5-893537E0EBB8}.Debug|Any CPU.Build.0 = Debug|Any CPU + {B57BEF6D-48D6-49DD-B4C5-893537E0EBB8}.Release|Any CPU.ActiveCfg = Release|Any CPU + {B57BEF6D-48D6-49DD-B4C5-893537E0EBB8}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE