Cosmos/source2/IL2PCU/Cosmos.IL2CPU.X86/X86/Push.cs
2009-09-06 16:59:43 +00:00

40 lines
1.6 KiB
C#

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace Cosmos.IL2CPU.X86 {
[OpCode("push")]
public class Push : InstructionWithDestinationAndSize {
public static void InitializeEncodingData(Instruction.InstructionData aData) {
aData.EncodingOptions.Add(new InstructionData.InstructionEncodingOption {
OpCode = new byte[] { 0x50 },
DestinationRegAny = true,
DestinationRegByte = 0,
DestinationRegBitShiftLeft = 0,
ReverseRegisters=true,
DefaultSize = InstructionSize.DWord,
AllowedSizes=InstructionSizes.DWord | InstructionSizes.Word
}); // register
aData.EncodingOptions.Add(new InstructionData.InstructionEncodingOption {
OpCode = new byte[] { 0x6A },
DestinationImmediate = true,
DefaultSize = InstructionSize.DWord,
AllowedSizes = InstructionSizes.DWord | InstructionSizes.Word
}); // immediate
aData.EncodingOptions.Add(new InstructionData.InstructionEncodingOption {
OpCode = new byte[] { 0xFF },
NeedsModRMByte = true,
DestinationMemory = true,
InitialModRMByteValue = 0x30,
ReverseRegisters = true,
DefaultSize = InstructionSize.DWord,
AllowedSizes = InstructionSizes.DWord | InstructionSizes.Word
}); // pop to memory
}
public Push() {
Size = 32;
}
}
}