mirror of
https://github.com/danbulant/Cosmos
synced 2026-05-20 04:48:53 +00:00
This commit is contained in:
parent
e88adb857a
commit
9fa84dcf5f
5 changed files with 22 additions and 11 deletions
|
|
@ -4,7 +4,7 @@ using System.Linq;
|
|||
using System.Text;
|
||||
|
||||
namespace Cosmos.IL2CPU.X86 {
|
||||
public class Assembler : Cosmos.IL2CPU.Assembler {
|
||||
public class AssemblerBin : Cosmos.IL2CPU.Assembler {
|
||||
|
||||
protected override void InitILOps() {
|
||||
InitILOps(typeof(ILOp));
|
||||
14
source2/IL2PCU/Cosmos.IL2CPU.X86/AssemblerNasm.cs
Normal file
14
source2/IL2PCU/Cosmos.IL2CPU.X86/AssemblerNasm.cs
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
|
||||
namespace Cosmos.IL2CPU.X86 {
|
||||
public class AssemblerNasm : Cosmos.IL2CPU.Assembler {
|
||||
|
||||
protected override void InitILOps() {
|
||||
InitILOps(typeof(ILOp));
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
|
@ -49,7 +49,8 @@
|
|||
<Reference Include="System.Xml" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="Assembler.cs" />
|
||||
<Compile Include="AssemblerBin.cs" />
|
||||
<Compile Include="AssemblerNasm.cs" />
|
||||
<Compile Include="ILOp.cs" />
|
||||
<Compile Include="IL\Add.cs" />
|
||||
<Compile Include="IL\Add_Ovf.cs" />
|
||||
|
|
|
|||
|
|
@ -5,19 +5,15 @@ using CPU = Indy.IL2CPU.Assembler.X86;
|
|||
namespace Cosmos.IL2CPU.X86.IL
|
||||
{
|
||||
[Cosmos.IL2CPU.OpCode(ILOpCode.Code.Beq)]
|
||||
public class Beq: ILOp
|
||||
{
|
||||
public class Beq: ILOp {
|
||||
|
||||
public Beq(Cosmos.IL2CPU.Assembler aAsmblr) : base(aAsmblr)
|
||||
{
|
||||
public Beq(Cosmos.IL2CPU.Assembler aAsmblr) : base(aAsmblr) {
|
||||
}
|
||||
|
||||
public override void Execute(uint aMethodUID, ILOpCode aOpCode)
|
||||
{
|
||||
public override void Execute(uint aMethodUID, ILOpCode aOpCode) {
|
||||
var xStackContent = OldAsmblr.StackContents.Pop();
|
||||
OldAsmblr.StackContents.Pop();
|
||||
if (xStackContent.Size > 8)
|
||||
{
|
||||
if (xStackContent.Size > 8) {
|
||||
throw new Exception("StackSize>8 not supported");
|
||||
}
|
||||
string BaseLabel = "_" + aMethodUID + "_" + ((ILOpCodes.OpBranch)aOpCode).Value + "__";
|
||||
|
|
|
|||
|
|
@ -18,7 +18,7 @@ namespace HelloWorld {
|
|||
//TODO: Move new build logic into new sort.
|
||||
// Build stuff is all UI, launching QEMU, making ISO etc.
|
||||
// IL2CPU should only contain scanning and assembling of binary files
|
||||
var xAsmblr = new Cosmos.IL2CPU.X86.Assembler();
|
||||
var xAsmblr = new Cosmos.IL2CPU.X86.AssemblerNasm();
|
||||
var xScanner = new ILScanner(xAsmblr);
|
||||
var xEntryPoint = typeof(Program).GetMethod("Init", BindingFlags.Public | BindingFlags.Static);
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue