Cosmos/source/Indy.IL2CPU.IL.X86/Ldc_I4.cs
mterwoord_cp 71ecc7cdf5
2007-09-05 13:51:29 +00:00

35 lines
No EOL
747 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.Ldc_I4)]
public class Ldc_I4: Op {
private string mValue;
protected void SetValue(int aValue) {
SetValue(aValue.ToString());
}
protected void SetValue(string aValue) {
mValue = aValue;
}
public Ldc_I4(Mono.Cecil.Cil.Instruction aInstruction, MethodInformation aMethodInfo)
: base(aInstruction, aMethodInfo) {
if(aInstruction.Operand != null) {
SetValue(aInstruction.Operand.ToString());
}
}
public string Value {
get {
return mValue;
}
}
public override sealed void Assemble() {
Pushd(Value);
}
}
}