Cosmos/source/Indy.IL2CPU.IL.X86/Sub.cs
mterwoord_cp 55b55528cf
2007-12-21 17:45:39 +00:00

19 lines
No EOL
564 B
C#

using System;
using Mono.Cecil.Cil;
using CPUx86 = Indy.IL2CPU.Assembler.X86;
namespace Indy.IL2CPU.IL.X86 {
[OpCode(Code.Sub)]
public class Sub: Op {
public Sub(Mono.Cecil.Cil.Instruction aInstruction, MethodInformation aMethodInfo)
: base(aInstruction, aMethodInfo) {
}
public override void DoAssemble() {
new CPUx86.Pop(CPUx86.Registers.ECX);
new CPUx86.Pop(CPUx86.Registers.EAX);
new CPUx86.Sub(CPUx86.Registers.EAX, CPUx86.Registers.ECX);
new CPUx86.Push(CPUx86.Registers.EAX);
Assembler.StackSizes.Pop();
}
}
}