mirror of
https://github.com/danbulant/Cosmos
synced 2026-05-27 22:12:25 +00:00
35 lines
No EOL
773 B
C#
35 lines
No EOL
773 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 int mValue;
|
|
protected void SetValue(int aValue) {
|
|
mValue = aValue;
|
|
}
|
|
|
|
protected void SetValue(string aValue) {
|
|
SetValue(Int32.Parse(aValue));
|
|
}
|
|
|
|
public Ldc_I4(Mono.Cecil.Cil.Instruction aInstruction, MethodInformation aMethodInfo)
|
|
: base(aInstruction, aMethodInfo) {
|
|
if (aInstruction.Operand != null) {
|
|
SetValue(aInstruction.Operand.ToString());
|
|
}
|
|
}
|
|
|
|
public int Value {
|
|
get {
|
|
return mValue;
|
|
}
|
|
}
|
|
public override sealed void DoAssemble() {
|
|
Pushd("0" + mValue.ToString("X") + "h");
|
|
}
|
|
}
|
|
} |