mirror of
https://github.com/danbulant/Cosmos
synced 2026-05-27 22:12:25 +00:00
19 lines
No EOL
573 B
C#
19 lines
No EOL
573 B
C#
using System;
|
|
using System.Linq;
|
|
using Mono.Cecil.Cil;
|
|
using CPU = Indy.IL2CPU.Assembler.X86;
|
|
|
|
namespace Indy.IL2CPU.IL.X86 {
|
|
[OpCode(Code.Ldc_R4)]
|
|
public class Ldc_R4: Op {
|
|
private Single mValue;
|
|
public Ldc_R4(Mono.Cecil.Cil.Instruction aInstruction, MethodInformation aMethodInfo)
|
|
: base(aInstruction, aMethodInfo) {
|
|
mValue = (Single)aInstruction.Operand;
|
|
}
|
|
public override void DoAssemble() {
|
|
new CPU.Pushd("0x" + BitConverter.GetBytes(mValue).Aggregate("", (x, b) => x + b.ToString("X2")));
|
|
Assembler.StackSizes.Push(4);
|
|
}
|
|
}
|
|
} |