This commit is contained in:
kudzu_cp 2012-08-06 01:15:06 +00:00
parent 185baa7fc4
commit 110a4b244f
5 changed files with 9 additions and 44 deletions

View file

@ -169,7 +169,7 @@ namespace Cosmos.Build.MSBuild {
xAsm.EmitELF = true;
#endif
var xNasmAsm = (AssemblerNasm)xAsm.Assembler;
var xNasm = (CosmosAssembler)xAsm.Assembler;
xAsm.Assembler.Initialize();
using (var xScanner = new ILScanner(xAsm)) {
xScanner.TempDebug += x => LogMessage(x);
@ -181,7 +181,7 @@ namespace Cosmos.Build.MSBuild {
using (var xOut = new StreamWriter(OutputFilename, false)) {
//if (EmitDebugSymbols) {
xNasmAsm.FlushText(xOut);
xNasm.FlushText(xOut);
xAsm.FinalizeDebugInfo();
}
}

View file

@ -16,7 +16,7 @@ namespace Cosmos.IL2CPU.X86 {
protected AppAssembler(byte comportNumber)
: base(new AssemblerNasm(comportNumber)) {
: base(new CosmosAssembler(comportNumber)) {
}
protected override void Move(string aDestLabelName, int aValue) {

View file

@ -1,40 +0,0 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using CPUx86 = Cosmos.Assembler.x86;
using System.Reflection;
using System.IO;
using Cosmos.Assembler;
using System.Diagnostics.SymbolStore;
using Microsoft.Samples.Debugging.CorSymbolStore;
using Cosmos.Debug.Common;
using Cosmos.Build.Common;
namespace Cosmos.IL2CPU.X86 {
public class AssemblerNasm : CosmosAssembler
{
public AssemblerNasm(byte aComNumber) : base(aComNumber) { }
public override void FlushText(TextWriter aOutput)
{
aOutput.WriteLine("%ifndef ELF_COMPILATION");
{
aOutput.WriteLine("use32");
aOutput.WriteLine("org 0x200000");
aOutput.WriteLine("[map all main.map]");
}
aOutput.WriteLine("%endif");
aOutput.WriteLine("global Kernel_Start");
base.FlushText(aOutput);
}
public bool EmitELF
{
get;
set;
}
}
}

View file

@ -92,7 +92,6 @@
<Compile Include="AppAssembler.cs" />
<Compile Include="AppAssemblerNasm.cs" />
<Compile Include="CosmosAssembler.cs" />
<Compile Include="AssemblerNasm.cs" />
<Compile Include="IL\FieldInfo.cs" />
<Compile Include="ILOp.cs" />
<Compile Include="IL\Add.cs" />

View file

@ -354,6 +354,12 @@ namespace Cosmos.IL2CPU.X86 {
public override void FlushText(TextWriter aOutput) {
base.FlushText(aOutput);
aOutput.WriteLine("%ifndef ELF_COMPILATION");
aOutput.WriteLine("use32");
aOutput.WriteLine("org 0x200000");
aOutput.WriteLine("[map all main.map]");
aOutput.WriteLine("%endif");
aOutput.WriteLine("global Kernel_Start");
}
}
}