Cosmos/source/Indy.IL2CPU.IL.X86/Brtrue.cs
2007-11-18 16:51:28 +00:00

22 lines
No EOL
668 B
C#

using System;
using System.IO;
using Mono.Cecil;
using Mono.Cecil.Cil;
using CPUx86 = Indy.IL2CPU.Assembler.X86;
namespace Indy.IL2CPU.IL.X86 {
[OpCode(Code.Brtrue)]
public class Brtrue: Op {
public readonly string TargetLabel;
public Brtrue(Mono.Cecil.Cil.Instruction aInstruction, MethodInformation aMethodInfo)
: base(aInstruction, aMethodInfo) {
TargetLabel = GetInstructionLabel((Instruction)aInstruction.Operand);
}
public override void DoAssemble() {
new CPUx86.Popd(CPUx86.Registers.EAX);
new CPUx86.Compare(CPUx86.Registers.EAX, "1");
new CPUx86.JumpIfEquals(TargetLabel);
Assembler.StackSizes.Pop();
}
}
}