mirror of
https://github.com/danbulant/Cosmos
synced 2026-05-27 22:12:25 +00:00
31 lines
No EOL
808 B
C#
31 lines
No EOL
808 B
C#
using System;
|
|
using System.IO;
|
|
using Mono.Cecil;
|
|
using Mono.Cecil.Cil;
|
|
using CPU = Indy.IL2CPU.Assembler.X86;
|
|
|
|
namespace Indy.IL2CPU.IL.X86 {
|
|
[OpCode(Code.Ldarg)]
|
|
public class Ldarg: Op {
|
|
private string mAddress;
|
|
protected void SetArgIndex(int aIndex, MethodInformation aMethodInfo) {
|
|
mAddress = aMethodInfo.Arguments[aIndex].VirtualAddress;
|
|
}
|
|
public Ldarg(Mono.Cecil.Cil.Instruction aInstruction, MethodInformation aMethodInfo)
|
|
: base(aInstruction, aMethodInfo) {
|
|
int xArgIndex;
|
|
if (Int32.TryParse((aInstruction.Operand ?? "").ToString(), out xArgIndex)) {
|
|
SetArgIndex(xArgIndex, aMethodInfo);
|
|
}
|
|
}
|
|
public string Address {
|
|
get {
|
|
return mAddress;
|
|
}
|
|
}
|
|
|
|
public sealed override void Assemble() {
|
|
Ldarg(Assembler, mAddress);
|
|
}
|
|
}
|
|
} |