From f0052deb3a374f28de9dcb429c3e19d5f65fa17c Mon Sep 17 00:00:00 2001 From: kudzu_cp <6d05c8c8ef5431987001abfdb2eadc9593ac9498> Date: Sun, 26 Jul 2009 23:46:05 +0000 Subject: [PATCH] --- .../IL2PCU/Cosmos.IL2CPU.X86/IL/Add_Ovf.cs | 32 ++----------------- .../IL2PCU/Cosmos.IL2CPU.X86/IL/Add_Ovf_Un.cs | 31 ------------------ source2/IL2PCU/Cosmos.IL2CPU.X86/IL/And.cs | 20 ------------ .../IL2PCU/Cosmos.IL2CPU.X86/IL/Arglist.cs | 28 ---------------- source2/IL2PCU/Cosmos.IL2CPU.X86/IL/Bge_Un.cs | 1 + source2/IL2PCU/Cosmos.IL2CPU.X86/IL/Dup.cs | 30 ++++------------- .../IL2PCU/Cosmos.IL2CPU.X86/IL/Endfilter.cs | 21 +----------- .../IL2PCU/Cosmos.IL2CPU.X86/IL/Endfinally.cs | 20 ------------ .../IL2PCU/Cosmos.IL2CPU.X86/IL/Volatile.cs | 2 +- 9 files changed, 12 insertions(+), 173 deletions(-) diff --git a/source2/IL2PCU/Cosmos.IL2CPU.X86/IL/Add_Ovf.cs b/source2/IL2PCU/Cosmos.IL2CPU.X86/IL/Add_Ovf.cs index 209826fcd..b1f8e5d98 100644 --- a/source2/IL2PCU/Cosmos.IL2CPU.X86/IL/Add_Ovf.cs +++ b/source2/IL2PCU/Cosmos.IL2CPU.X86/IL/Add_Ovf.cs @@ -11,36 +11,8 @@ namespace Cosmos.IL2CPU.X86.IL public override void Execute(uint aMethodUID, ILOpCode aOpCode) { - //TODO: Implement this Op - } + throw new NotImplementedException("Add_Ovf not implemented"); + } - - // using System; - // using System.IO; - // - // - // using CPU = Indy.IL2CPU.Assembler.X86; - // - // namespace Indy.IL2CPU.IL.X86 { - // [OpCode(OpCodeEnum.Add_Ovf)] - // public class Add_Ovf: Op { - // private string mNextLabel; - // private string mCurLabel; - // private uint mCurOffset; - // private MethodInformation mMethodInformation; - // public Add_Ovf(ILReader aReader, MethodInformation aMethodInfo) - // : base(aReader, aMethodInfo) { - // mMethodInformation = aMethodInfo; - // mCurOffset = aReader.Position; - // mCurLabel = IL.Op.GetInstructionLabel(aReader); - // mNextLabel = IL.Op.GetInstructionLabel(aReader.NextPosition); - // } - // public override void DoAssemble() { - // EmitNotImplementedException(Assembler, GetServiceProvider(), "Add_Ovf not yet implemented", mCurLabel, mMethodInformation, mCurOffset, mNextLabel); - // //AddWithOverflow(Assembler, true); - // } - // } - // } - } } diff --git a/source2/IL2PCU/Cosmos.IL2CPU.X86/IL/Add_Ovf_Un.cs b/source2/IL2PCU/Cosmos.IL2CPU.X86/IL/Add_Ovf_Un.cs index b9546d04e..d3fffd7a7 100644 --- a/source2/IL2PCU/Cosmos.IL2CPU.X86/IL/Add_Ovf_Un.cs +++ b/source2/IL2PCU/Cosmos.IL2CPU.X86/IL/Add_Ovf_Un.cs @@ -14,36 +14,5 @@ namespace Cosmos.IL2CPU.X86.IL throw new NotImplementedException("Add_Ovf_Un not implemented"); } - - // using System; - // using System.IO; - // - // - // using CPU = Indy.IL2CPU.Assembler.X86; - // - // namespace Indy.IL2CPU.IL.X86 { - // [OpCode(OpCodeEnum.Add_Ovf_Un)] - // public class Add_Ovf_Un: Add_Ovf { - // private string mNextLabel; - // private string mCurLabel; - // private uint mCurOffset; - // private MethodInformation mMethodInformation; - // public Add_Ovf_Un(ILReader aReader, MethodInformation aMethodInfo) - // : base(aReader, aMethodInfo) { - // mMethodInformation = aMethodInfo; - // mCurOffset = aReader.Position; - // mCurLabel = IL.Op.GetInstructionLabel(aReader); - // mNextLabel = IL.Op.GetInstructionLabel(aReader.NextPosition); - // } - // - // public override void DoAssemble() - // { - // EmitNotImplementedException(Assembler, GetServiceProvider(), "Add_Ovf_Un not yet implemented", mCurLabel, mMethodInformation, mCurOffset, mNextLabel); - // - // //AddWithOverflow(Assembler, false); - // } - // } - // } - } } diff --git a/source2/IL2PCU/Cosmos.IL2CPU.X86/IL/And.cs b/source2/IL2PCU/Cosmos.IL2CPU.X86/IL/And.cs index 86717ace0..57430dd32 100644 --- a/source2/IL2PCU/Cosmos.IL2CPU.X86/IL/And.cs +++ b/source2/IL2PCU/Cosmos.IL2CPU.X86/IL/And.cs @@ -43,26 +43,6 @@ namespace Cosmos.IL2CPU.X86.IL } OldAsmblr.StackContents.Push(xStackContent); } - - - // using System; - // using System.IO; - // - // - // using CPU = Indy.IL2CPU.Assembler.X86; - // using Indy.IL2CPU.Assembler; - // - // namespace Indy.IL2CPU.IL.X86 { - // [OpCode(OpCodeEnum.And)] - // public class And: Op { - // public And(ILReader aReader, MethodInformation aMethodInfo) - // : base(aReader, aMethodInfo) { - // } - // public override void DoAssemble() { - // - // } - // } - // } } } diff --git a/source2/IL2PCU/Cosmos.IL2CPU.X86/IL/Arglist.cs b/source2/IL2PCU/Cosmos.IL2CPU.X86/IL/Arglist.cs index 64070588d..476b02120 100644 --- a/source2/IL2PCU/Cosmos.IL2CPU.X86/IL/Arglist.cs +++ b/source2/IL2PCU/Cosmos.IL2CPU.X86/IL/Arglist.cs @@ -13,34 +13,6 @@ namespace Cosmos.IL2CPU.X86.IL { throw new NotImplementedException("Arglist not yet implemented!"); } - - - // using System; - // using System.IO; - // - // - // using CPU = Indy.IL2CPU.Assembler.X86; - // - // namespace Indy.IL2CPU.IL.X86 { - // [OpCode(OpCodeEnum.Arglist)] - // public class Arglist: Op { - // private string mNextLabel; - // private string mCurLabel; - // private uint mCurOffset; - // private MethodInformation mMethodInformation; - // - // public Arglist(ILReader aReader, MethodInformation aMethodInfo) - // : base(aReader, aMethodInfo) { - // mMethodInformation = aMethodInfo; - // mCurOffset = aReader.Position; - // mCurLabel = IL.Op.GetInstructionLabel(aReader); - // mNextLabel = IL.Op.GetInstructionLabel(aReader.NextPosition); - // } - // public override void DoAssemble() { - // EmitNotImplementedException(Assembler, GetServiceProvider(), "ArgList opcode has not been implemented yet", mCurLabel, mMethodInformation, mCurOffset, mNextLabel); - // } - // } - // } } } diff --git a/source2/IL2PCU/Cosmos.IL2CPU.X86/IL/Bge_Un.cs b/source2/IL2PCU/Cosmos.IL2CPU.X86/IL/Bge_Un.cs index c4dc0caea..23988e04f 100644 --- a/source2/IL2PCU/Cosmos.IL2CPU.X86/IL/Bge_Un.cs +++ b/source2/IL2PCU/Cosmos.IL2CPU.X86/IL/Bge_Un.cs @@ -11,6 +11,7 @@ namespace Cosmos.IL2CPU.X86.IL public override void Execute(uint aMethodUID, ILOpCode aOpCode) { //TODO: Implement this Op + //TODO: Merge these like Branch if possible, ie Branch_Un } diff --git a/source2/IL2PCU/Cosmos.IL2CPU.X86/IL/Dup.cs b/source2/IL2PCU/Cosmos.IL2CPU.X86/IL/Dup.cs index 6f9678204..800fa6615 100644 --- a/source2/IL2PCU/Cosmos.IL2CPU.X86/IL/Dup.cs +++ b/source2/IL2PCU/Cosmos.IL2CPU.X86/IL/Dup.cs @@ -1,4 +1,5 @@ using System; +using CPUx86 = Indy.IL2CPU.Assembler.X86; namespace Cosmos.IL2CPU.X86.IL { @@ -10,30 +11,13 @@ namespace Cosmos.IL2CPU.X86.IL } public override void Execute(uint aMethodUID, ILOpCode aOpCode) { - //TODO: Implement this Op + var xStackContent = OldAsmblr.StackContents.Peek(); + for (int i = 0; i < ((xStackContent.Size / 4) + (xStackContent.Size % 4 == 0 ? 0 : 1)); i++) { + new CPUx86.Move { DestinationReg = CPUx86.Registers.EAX, SourceReg = CPUx86.Registers.ESP, SourceDisplacement = i * 4, SourceIsIndirect = true }; + new CPUx86.Push { DestinationReg = CPUx86.Registers.EAX }; + } + OldAsmblr.StackContents.Push(xStackContent); } - - - // using System; - // - // using CPUx86 = Indy.IL2CPU.Assembler.X86; - // - // namespace Indy.IL2CPU.IL.X86 { - // [OpCode(OpCodeEnum.Dup)] - // public class Dup: Op { - // public Dup(ILReader aReader, MethodInformation aMethodInfo) - // : base(aReader, aMethodInfo) { - // } - // public override void DoAssemble() { - // var xStackContent = Assembler.StackContents.Peek(); - // for (int i = 0; i < ((xStackContent.Size / 4) + (xStackContent.Size % 4 == 0 ? 0 : 1)) ; i++) { - // new CPUx86.Move { DestinationReg = CPUx86.Registers.EAX, SourceReg = CPUx86.Registers.ESP, SourceDisplacement=i*4, SourceIsIndirect=true }; - // new CPUx86.Push { DestinationReg = CPUx86.Registers.EAX }; - // } - // Assembler.StackContents.Push(xStackContent); - // } - // } - // } } } diff --git a/source2/IL2PCU/Cosmos.IL2CPU.X86/IL/Endfilter.cs b/source2/IL2PCU/Cosmos.IL2CPU.X86/IL/Endfilter.cs index 2557b999c..3c08c5783 100644 --- a/source2/IL2PCU/Cosmos.IL2CPU.X86/IL/Endfilter.cs +++ b/source2/IL2PCU/Cosmos.IL2CPU.X86/IL/Endfilter.cs @@ -10,27 +10,8 @@ namespace Cosmos.IL2CPU.X86.IL } public override void Execute(uint aMethodUID, ILOpCode aOpCode) { - //TODO: Implement this Op + throw new Exception("not implemented"); } - - // using System; - // using System.IO; - // - // - // using CPU = Indy.IL2CPU.Assembler.X86; - // - // namespace Indy.IL2CPU.IL.X86 { - // [OpCode(OpCodeEnum.Endfilter)] - // public class Endfilter: Op { - // public Endfilter(ILReader aReader, MethodInformation aMethodInfo) - // : base(aReader, aMethodInfo) { - // } - // public override void DoAssemble() { - // throw new NotImplementedException("This file has been autogenerated and not been changed afterwards!"); - // } - // } - // } - } } diff --git a/source2/IL2PCU/Cosmos.IL2CPU.X86/IL/Endfinally.cs b/source2/IL2PCU/Cosmos.IL2CPU.X86/IL/Endfinally.cs index fbca8caaf..87627bb4c 100644 --- a/source2/IL2PCU/Cosmos.IL2CPU.X86/IL/Endfinally.cs +++ b/source2/IL2PCU/Cosmos.IL2CPU.X86/IL/Endfinally.cs @@ -12,26 +12,6 @@ namespace Cosmos.IL2CPU.X86.IL public override void Execute(uint aMethodUID, ILOpCode aOpCode) { //TODO: Implement this Op } - - - // using System; - // using System.IO; - // - // - // using CPU = Indy.IL2CPU.Assembler.X86; - // - // namespace Indy.IL2CPU.IL.X86 { - // [OpCode(OpCodeEnum.Endfinally)] - // public class Endfinally: Op { - // public Endfinally(ILReader aReader, MethodInformation aMethodInfo) - // : base(aReader, aMethodInfo) { - // } - // public override void DoAssemble() { - // // TODO: unimplemented - // //throw new NotImplementedException("This file has been autogenerated and not been changed afterwards!"); - // } - // } - // } } } diff --git a/source2/IL2PCU/Cosmos.IL2CPU.X86/IL/Volatile.cs b/source2/IL2PCU/Cosmos.IL2CPU.X86/IL/Volatile.cs index b88852fe2..3c4357304 100644 --- a/source2/IL2PCU/Cosmos.IL2CPU.X86/IL/Volatile.cs +++ b/source2/IL2PCU/Cosmos.IL2CPU.X86/IL/Volatile.cs @@ -11,7 +11,7 @@ namespace Cosmos.IL2CPU.X86.IL } public override void Execute(uint aMethodUID, ILOpCode aOpCode) { - throw new Exception("TODO: Volatile"); + //TODO: Volatile } }