Cosmos/source/Indy.IL2CPU.IL.X86/Conv_U1.cs
2007-10-11 14:17:11 +00:00

36 lines
No EOL
778 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.Conv_U1)]
public class Conv_U1: Op {
public Conv_U1(Mono.Cecil.Cil.Instruction aInstruction, MethodInformation aMethodInfo)
: base(aInstruction, aMethodInfo) {
}
public override void DoAssemble() {
int xSource = Assembler.StackSizes.Peek();
switch (xSource) {
case 2:
case 4: {
Pop("eax");
Pushd(1, "eax");
break;
}
case 8: {
Pop("eax");
Pop("ecx");
Pushd(1, "eax");
break;
}
case 1: {
break;
}
default:
throw new Exception("SourceSize " + xSource + " not supported!");
}
}
}
}