diff --git a/source/Indy.IL2CPU.Assembler.X86/IDivide.cs b/source/Indy.IL2CPU.Assembler.X86/IDivide.cs new file mode 100644 index 000000000..38c1e8ca0 --- /dev/null +++ b/source/Indy.IL2CPU.Assembler.X86/IDivide.cs @@ -0,0 +1,20 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; + +namespace Indy.IL2CPU.Assembler.X86 { + /// + /// Puts the result of the divide into EAX, and the remainder in EDX + /// + [OpCode(0xFFFFFFFF, "idiv")] + public class IDivide: Instruction { + private string mSource; + public IDivide(string aSource) { + mSource = aSource; + } + public override string ToString() { + return "idiv " + mSource; + } + } +} diff --git a/source/Indy.IL2CPU.Assembler.X86/Indy.IL2CPU.Assembler.X86.csproj b/source/Indy.IL2CPU.Assembler.X86/Indy.IL2CPU.Assembler.X86.csproj index 912487687..2be630850 100644 --- a/source/Indy.IL2CPU.Assembler.X86/Indy.IL2CPU.Assembler.X86.csproj +++ b/source/Indy.IL2CPU.Assembler.X86/Indy.IL2CPU.Assembler.X86.csproj @@ -56,6 +56,7 @@ + diff --git a/source/Indy.IL2CPU.IL.X86/Div.cs b/source/Indy.IL2CPU.IL.X86/Div.cs index 845ca02c1..71e46b855 100644 --- a/source/Indy.IL2CPU.IL.X86/Div.cs +++ b/source/Indy.IL2CPU.IL.X86/Div.cs @@ -16,7 +16,7 @@ namespace Indy.IL2CPU.IL.X86 { new CPUx86.Pop(CPUx86.Registers.ECX); new CPUx86.Add("esp", "4"); new CPUx86.Pop(CPUx86.Registers.EAX); - new CPUx86.Divide(CPUx86.Registers.ECX); + new CPUx86.IDivide(CPUx86.Registers.ECX); //new CPUx86.Push("0"); new CPUx86.Pushd(CPUx86.Registers.EAX); @@ -24,7 +24,7 @@ namespace Indy.IL2CPU.IL.X86 { new CPUx86.Xor(CPUx86.Registers.EDX, CPUx86.Registers.EDX); new CPUx86.Pop(CPUx86.Registers.ECX); new CPUx86.Pop(CPUx86.Registers.EAX); - new CPUx86.Divide(CPUx86.Registers.ECX); + new CPUx86.IDivide(CPUx86.Registers.ECX); new CPUx86.Pushd(CPUx86.Registers.EAX); } }