Cosmos/source/Indy.IL2CPU.IL.X86/Ldftn.cs
2007-11-17 12:53:28 +00:00

27 lines
No EOL
746 B
C#

using System;
using System.Linq;
using Mono.Cecil;
using Mono.Cecil.Cil;
using CPU = Indy.IL2CPU.Assembler;
using CPUx86 = Indy.IL2CPU.Assembler.X86;
namespace Indy.IL2CPU.IL.X86 {
[OpCode(Code.Ldftn)]
public class Ldftn: Op {
private string mFunctionLabel;
public Ldftn(Instruction aInstruction, MethodInformation aMethodInfo)
: base(aInstruction, aMethodInfo) {
MethodReference xMethodRef = aInstruction.Operand as MethodReference;
if (xMethodRef == null) {
throw new Exception("Unable to determine Method!");
}
mFunctionLabel = CPU.Label.GenerateLabelName(xMethodRef);
}
public override void DoAssemble() {
new CPUx86.Pushd(mFunctionLabel);
Assembler.StackSizes.Push(4);
}
}
}