Cosmos/source2/IL2CPU/Cosmos.IL2CPU.X86/IL/Ldc_I8.cs
2011-02-26 13:38:21 +00:00

23 lines
No EOL
837 B
C#

using System;
using Cosmos.Compiler.Assembler;
using Cosmos.IL2CPU.ILOpCodes;
using CPUx86 = Cosmos.Compiler.Assembler.X86;
using System.Collections.Generic;
namespace Cosmos.IL2CPU.X86.IL
{
[Cosmos.IL2CPU.OpCode( ILOpCode.Code.Ldc_I8 )]
public class Ldc_I8 : ILOp
{
public Ldc_I8( Cosmos.Compiler.Assembler.Assembler aAsmblr ) : base( aAsmblr ) { }
public override void Execute( MethodInfo aMethod, ILOpCode aOpCode ) {
var xOp = (OpInt64)aOpCode;
// push high part
new CPUx86.Push { DestinationValue = BitConverter.ToUInt32(BitConverter.GetBytes(xOp.Value), 4) };
// push low part
new CPUx86.Push { DestinationValue = BitConverter.ToUInt32(BitConverter.GetBytes(xOp.Value), 0) };
Assembler.Stack.Push(8, typeof( long ));
}
}
}