mirror of
https://github.com/danbulant/Cosmos
synced 2026-05-20 21:08:51 +00:00
19 lines
No EOL
564 B
C#
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();
|
|
}
|
|
}
|
|
} |